diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Avoidance.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Avoidance.lean new file mode 100644 index 0000000000000000000000000000000000000000..91729c0880f68d759bb939ef1c0fdf807d965c7d --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Avoidance.lean @@ -0,0 +1,188 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Ultrafilter + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +open Filter +open scoped Topology +universe u v +variable {ι : Type*} {A : Type u} [CStarAlgebra A] +local instance avoidanceLimitPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance avoidanceLimitStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance avoidanceLimitOperatorPartialOrder (J : Type*) [NormedAddCommGroup J] + [InnerProductSpace ℂ J] [CompleteSpace J] : + PartialOrder (J →L[ℂ] J) := CStarAlgebra.spectralOrder _ +local instance avoidanceLimitOperatorStarOrderedRing (J : Type*) [NormedAddCommGroup J] + [InnerProductSpace ℂ J] [CompleteSpace J] : + StarOrderedRing (J →L[ℂ] J) := CStarAlgebra.spectralOrderedRing _ +variable {H : ι → Type v} [∀ i, NormedAddCommGroup (H i)] + [∀ i, InnerProductSpace ℂ (H i)] [∀ i, CompleteSpace (H i)] + +theorem four_limit_impossible (ω : Ultrafilter ι) + (π : ∀ i, A →⋆ₐ[ℂ] (H i →L[ℂ] H i)) (ξ : ∀ i, H i) (hξ : ∀ i, ‖ξ i‖ ≤ 1) + {X : A} (hX : 0 ≤ X) (B : Fin 4 → A) + (hV : ∀ᶠ i in (ω : Filter ι), (1/8 : ℝ) ≤ ‖π i (firstV X) (ξ i)‖) + (hD₁ : ∀ i, π i (B 0) * star (π i (B 0)) ≤ (1/2 : ℝ) • 1) + (hm₁ : ∀ i, π i (B 1 * star (B 1)) = π i (B 0 * star (B 0))) + (hc₁ : ∀ i, π i (B 0 * star (B 1)) = 0) + (hs₀ : ∀ i, π i (firstH X * star (B 0)) = π i (star (B 0))) + (hs₁ : ∀ i, π i (firstH X * star (B 1)) = π i (star (B 1))) + (hU : ∀ w : A, Tendsto (fun i => ‖π i (firstU X (B 0) * w * firstV X)‖) + (ω : Filter ι) (𝓝 0)) + (hD₃ : ∀ i, π i (B 2) * star (π i (B 2)) ≤ (1/2 : ℝ) • 1) + (hc₃ : ∀ i, π i (star (B 2) * B 3) = 0) + (hm₃ : ∀ i, π i (star (B 2) * B 2) = π i (star (B 3) * B 3)) + (hR : Tendsto (fun i => ‖π i (lastR X (B 0) (B 2))‖) (ω : Filter ι) (𝓝 0)) + (hs₃ : ∀ i, π i (ramp (prospectiveDefect X (B 0)) 0 (1/2) * B 3) = π i (B 3)) : False := by + let ρ := limitRep ω π ξ hξ + let Ψ := rangeRestriction ρ (firstV X) + have hkill : ∀ a : A, Tendsto (fun i => ‖π i a‖) (ω : Filter ι) (𝓝 0) → Ψ a = 0 := by + intro a ha + have hz : ρ a = 0 := limitRep_annihilates ω π ξ hξ a ha + ext x + change (ρ a x : LimitHilbert ω π ξ hξ) = 0 + rw [hz, zero_apply] + have hzero : ∀ a : A, (∀ i, π i a = 0) → Ψ a = 0 := by + intro a ha + apply hkill a + simp only [ha, norm_zero] + exact tendsto_const_nhds + have heq : ∀ a b : A, (∀ i, π i a = π i b) → Ψ a = Ψ b := by + intro a b hab + have hz := hzero (a-b) (fun i => by rw [map_sub, hab i, sub_self]) + exact sub_eq_zero.mp (by simpa only [map_sub] using hz) + have hbound (j : Fin 4) (hj : ∀ i, π i (B j) * star (π i (B j)) ≤ (1/2 : ℝ) • 1) := by + have hz := hzero (cut (B j * star (B j)) (1/2)) (fun i => by + rw [map_cut_sa (π i) (.mul_star_self _) (by norm_num), map_mul, map_star] + exact cut_zero_of_le (mul_star_self_nonneg _) (by norm_num) (hj i)) + rw [map_cut_sa (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (IsSelfAdjoint.mul_star_self (B j)) (by norm_num : (0:ℝ) ≤ 1/2), map_mul, map_star] at hz + exact le_of_cut_zero (mul_star_self_nonneg _) (by norm_num) hz + have hψV : firstV (Ψ X) ≠ 0 := by + rw [← map_firstV (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (.of_nonneg hX)] + exact rangeRestriction_nonzero ρ (firstV X) (.of_nonneg (cut_nonneg X _)) + (limitRep_nonzero ω π ξ hξ (firstV X) (by norm_num : (0:ℝ) < 1/8) hV) + have hψU : firstU (Ψ X) (Ψ (B 0)) = 0 := by + rw [← map_firstU (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (.of_nonneg hX)] + apply rangeRestriction_kills ρ (firstV X) (firstU X (B 0)) + intro w + simpa only [map_mul] using limitRep_annihilates ω π ξ hξ _ (hU w) + apply four_fixed_impossible (map_nonneg Ψ hX) (fun i => Ψ (B i)) hψV + (hbound 0 hD₁) ?_ ?_ ?_ ?_ hψU (hbound 2 hD₃) ?_ ?_ ?_ ?_ + · simpa only [map_mul, map_star] using heq _ _ hm₁ + · simpa only [map_mul, map_star] using hzero _ hc₁ + · simpa only [map_mul, map_star, map_firstH (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (.of_nonneg hX)] using heq _ _ hs₀ + · simpa only [map_mul, map_star, map_firstH (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (.of_nonneg hX)] using heq _ _ hs₁ + · simpa only [map_mul, map_star] using hzero _ hc₃ + · simpa only [map_mul, map_star] using heq _ _ hm₃ + · simpa only [map_lastR (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (.of_nonneg hX)] using hkill _ hR + · have hp : IsSelfAdjoint (prospectiveDefect X (B 0)) := + .of_nonneg (prospectiveDefect_nonneg X _) + simpa only [map_mul, map_ramp_sa (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ hp le_rfl, map_prospectiveDefect (D := generatedRange ρ (firstV X) →L[ℂ] generatedRange ρ (firstV X)) Ψ (.of_nonneg hX)] using + heq _ _ hs₃ + +end MainGap + +namespace MainGap +universe u v +open Filter +open scoped Topology +variable (A : Type u) [CStarAlgebra A] + +structure HilbertRep where + H : Type v + [normed : NormedAddCommGroup H] + [inner : InnerProductSpace ℂ H] + [complete : CompleteSpace H] + hom : A →⋆ₐ[ℂ] (H →L[ℂ] H) + +attribute [instance] HilbertRep.normed HilbertRep.inner HilbertRep.complete + +variable {A} +local instance avoidancePartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance avoidanceStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance avoidanceOperatorPartialOrder (J : Type*) [NormedAddCommGroup J] + [InnerProductSpace ℂ J] [CompleteSpace J] : + PartialOrder (J →L[ℂ] J) := CStarAlgebra.spectralOrder _ +local instance avoidanceOperatorStarOrderedRing (J : Type*) [NormedAddCommGroup J] + [InnerProductSpace ℂ J] [CompleteSpace J] : + StarOrderedRing (J →L[ℂ] J) := CStarAlgebra.spectralOrderedRing _ + +theorem four_avoidance_unital {X : A} (hX : 0 ≤ X) (B : Fin 4 → A) + (hp : ∀ z : A, 0 ≤ z → z ∈ fourHer X → ProperlyInfinite z) : + ∃ T : Fin 4 → A, (∀ j, ‖T j‖ ≤ 1) ∧ (∀ j, T j ∈ fourHer X) ∧ + ∀ R : HilbertRep.{u,v} A, (1/4 : ℝ) < ‖R.hom X‖ → + ¬ ∀ j, R.hom (T j) = R.hom (B j) := by + classical + by_contra! hbad + let F : ∀ i : FourIndex A, FourChoice.{v,u} X B i.2 (fourEta A i) := + fun i => Classical.choice (fourChoice_nonempty hX B hp i.2 (fourEta_pos A i)) + have hbad' : ∀ i : FourIndex A, ∃ R : HilbertRep.{u,v} A, + (1/4 : ℝ) < ‖R.hom X‖ ∧ ∀ j, R.hom ((F i).T j) = R.hom (B j) := + fun i => hbad (F i).T (F i).contractive (F i).mem + choose R hRX hmatch using hbad' + let π := fun i => (R i).hom + change ∀ i j, π i ((F i).T j) = π i (B j) at hmatch + have hVbig : ∀ i, (1/8 : ℝ) < ‖π i (firstV X)‖ := by + intro i + have hn : ‖π i X - π i (firstV X)‖ ≤ (1/8 : ℝ) := by + rw [← map_sub] + exact (NonUnitalStarAlgHom.norm_apply_le (π i) _).trans + (norm_sub_cut_le hX (by norm_num)) + have hm := norm_sub_norm_le (π i X) (π i (firstV X)) + have hi := hRX i + change (1/4 : ℝ) < ‖π i X‖ at hi + linarith + choose ξ hξ hξV using fun i => (π i (firstV X)).exists_lt_apply_of_lt_opNorm (hVbig i) + have hnξ : ∀ i, ‖ξ i‖ ≤ 1 := fun i => (hξ i).le + have hEt := fourEta_ultra A + apply four_limit_impossible (fourUltra A) π ξ hnξ hX B + (Filter.Eventually.of_forall (fun i => (hξV i).le)) + (fun i => (F i).first_bound (π i) hX (fourEta_pos A i) (hmatch i)) ?_ ?_ ?_ ?_ ?_ + (fun i => (F i).last_bound (π i) hX (fourEta_pos A i) (hmatch i)) ?_ ?_ ?_ ?_ + · intro i + have hm := congrArg (π i) (F i).first_equal + simpa only [map_mul, map_star, hmatch i] using hm + · intro i + have hm := congrArg (π i) (F i).first_cross + simpa only [map_mul, map_star, hmatch i, map_zero] using hm + · intro i + have hm := congrArg (π i) ((F i).first_support₀ hX) + simpa only [map_mul, map_star, hmatch i] using hm + · intro i + have hm := congrArg (π i) ((F i).first_support₁ hX) + simpa only [map_mul, map_star, hmatch i] using hm + · intro w + have hg : Tendsto (fun i : FourIndex A => + Real.sqrt (2 * fourEta A i) * ‖CFC.sqrt (firstV X)‖ + + fourEta A i * ‖w‖ * ‖firstV X‖) (fourUltra A : Filter (FourIndex A)) (𝓝 0) := by + convert ((hEt.const_mul 2).sqrt.mul_const ‖CFC.sqrt (firstV X)‖).add + ((hEt.mul_const ‖w‖).mul_const ‖firstV X‖) using 1; norm_num + apply squeeze_zero' (Filter.Eventually.of_forall (fun i => norm_nonneg _)) ?_ hg + filter_upwards [fourUltra_le A (fourIndex_eventually_mem A w)] with i hi + exact represented_mixed_estimate (π i) (firstU_nonneg _ _) (cut_nonneg X _) + (fourEta_pos A i) hi ((F i).first_norm (π i) hX (fourEta_pos A i) (hmatch i)).le + · intro i + have hm := congrArg (π i) (F i).last_cross + simpa only [map_mul, map_star, hmatch i, map_zero] using hm + · intro i + have hm := congrArg (π i) (F i).last_equal + simpa only [map_mul, map_star, hmatch i] using hm + · have ht : Tendsto (fun i : FourIndex A => 4 * fourEta A i) + (fourUltra A : Filter (FourIndex A)) (𝓝 0) := by + simpa using hEt.const_mul 4 + exact squeeze_zero' (Filter.Eventually.of_forall (fun i => norm_nonneg _)) + (Filter.Eventually.of_forall (fun i => + ((F i).last_norm_lt (π i) hX (fourEta_pos A i) (hmatch i)).le)) ht + · intro i + have hm := congrArg (π i) (F i).last_support + simpa only [map_mul, hmatch i] using hm + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/ChoicePairs.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/ChoicePairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e0be8f8b3fa7c70438eef31dc1e73f6d2b48365 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/ChoicePairs.lean @@ -0,0 +1,327 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Cutoffs + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance choicePairsPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance choicePairsStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma norm_sqrt_le_one {d : A} (hd : 0 ≤ d) (hn : ‖d‖ ≤ 1) : ‖CFC.sqrt d‖ ≤ 1 := by + have hh : ‖CFC.sqrt d‖ ^ 2 = ‖d‖ := by + rw [pow_two, ← CStarRing.norm_star_mul_self, + (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg d)).star_eq, CFC.sqrt_mul_sqrt_self d hd] + nlinarith [norm_nonneg (CFC.sqrt d)] + +lemma fixed_left_of_modulus {b z : A} (h : b * (z * star z) = z * star z) : b*z=z := by + apply sub_eq_zero.mp + apply (CStarRing.mul_star_self_eq_zero_iff _).mp + have hs := congrArg star h + simp only [star_mul, star_star] at hs + calc + (b*z-z) * star (b*z-z) = b*(z*star z)*star b - (z*star z)*star b - b*(z*star z) + z*star z := by + simp only [star_sub, star_mul]; noncomm_ring + _ = 0 := by rw [h]; noncomm_ring + +lemma carrier_mem_Her {n : ℕ} {h v k : A} (S : OrthogonalSlots n h v) + (hv : v ∈ Her k) (i : Fin n) (e : Her h) (he : (e : A) ∈ Her k) : + S.carrier i e ∈ Her k := by + apply mem_Her_of_moduli + · exact Her_mono_of_mem hv (S.outer i i e e) + · rw [S.inner, ite_eq_left rfl] + exact (Her k).mul_mem ((Her k).star_mem' he) he + +theorem first_pair_choice {d v k : A} (hd : 0 ≤ d) (hv : 0 ≤ v) + (hdv : FiniteCuntzLE (diagonalCorner 2 d) (scalarCorner v)) + (hdk : d ∈ Her k) (hvk : v ∈ Her k) {η : ℝ} (hη : 0 < η) : + ∃ T : Fin 2 → A, + (∀ i, ‖T i‖ ≤ 1) ∧ (∀ i, T i ∈ Her k) ∧ + (∀ i j, T i * star (T j) = if i=j then ramp d η (2*η) else 0) ∧ + (∀ i j, star (T i) * T j ∈ Her v) := by + let D := ramp d η (2*η) + have hDpos : 0 ≤ D := ramp_nonneg d (by linarith) + have hDmem : D ∈ Her (cut d η) := ramp_mem_Her_cut hd hη.le + let e : Her (cut d η) := ⟨CFC.sqrt D, sqrt_mem_Her hDmem hDpos⟩ + obtain ⟨S⟩ := orthogonalSlots_of_comparison hd hv hdv hη + have hnorm : ‖(e : A)‖ ≤ 1 := norm_sqrt_le_one hDpos (norm_ramp_le_one d (by linarith)) + have he : (e : A) ∈ Her k := + Her_mono_of_mem hdk (Her_mono_of_mem (cut_mem_Her hd η) e.property) + have hsa : star (e : A) = (e : A) := (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg D)).star_eq + refine ⟨fun i => star (S.carrier i e), ?_, ?_, ?_, ?_⟩ + · intro i + rw [norm_star, S.norm_carrier] + exact hnorm + · intro i + exact (Her k).star_mem' (carrier_mem_Her S hvk i e he) + · intro i j + rw [star_star, S.inner, hsa] + split_ifs + · exact CFC.sqrt_mul_sqrt_self D hDpos + · rfl + · intro i j + rw [star_star] + exact S.outer i j e e + +theorem last_pair_choice {R k : A} (hR : 0 ≤ R) (hRk : R ∈ Her k) + {η : ℝ} (hη : 0 < η) (hp : ProperlyInfinite (cut R η)) : + ∃ T : Fin 2 → A, + (∀ i, ‖T i‖ ≤ 1) ∧ (∀ i, T i ∈ Her k) ∧ + (∀ i j, star (T i) * T j = if i=j then ramp R (2*η) (4*η) * ramp R (2*η) (4*η) else 0) ∧ + (∀ i j, T i * star (T j) ∈ Her (cut R η)) ∧ + (∀ {B : Type*} [NonUnitalCStarAlgebra B] (π : A →⋆ₙₐ[ℂ] B), + 4*η ≤ ‖π R‖ → ∀ i, ‖π (T i)‖ = 1) := by + let t := ramp R (2*η) (4*η) + have ht : t ∈ Her (cut (cut R η) η) := by + rw [cut_cut hR hη.le hη.le, ← two_mul η] + exact ramp_mem_Her_cut hR (by positivity) + let e : Her (cut (cut R η) η) := ⟨t, ht⟩ + obtain ⟨S⟩ := hp.orthogonalSlots (cut_nonneg R η) 2 hη + have hcut : cut R η ∈ Her k := Her_mono_of_mem hRk (cut_mem_Her hR η) + have htk : t ∈ Her k := Her_mono_of_mem hRk + (Her_mono_of_mem (cut_mem_Her hR (2*η)) (ramp_mem_Her_cut hR (by positivity))) + refine ⟨fun i => S.carrier i e, ?_, ?_, ?_, (fun i j => S.outer i j e e), ?_⟩ + · intro i + rw [S.norm_carrier] + exact norm_ramp_le_one R (by linarith) + · intro i + exact carrier_mem_Her S hcut i e htk + · intro i j + rw [S.inner, (IsSelfAdjoint.of_nonneg (ramp_nonneg R (by linarith : 2*η ≤ 4*η))).star_eq] + · intro B _ π hnorm i + let : PartialOrder B := CStarAlgebra.spectralOrder B + let : StarOrderedRing B := CStarAlgebra.spectralOrderedRing B + rw [S.represented_norm] + change ‖π (ramp R (2*η) (4*η))‖ = 1 + rw [map_ramp π hR (by positivity)] + exact norm_ramp_eq_one (map_nonneg π hR) (by positivity) (by linarith) hnorm + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def firstSandwich (U V : A) (η : ℝ) (E : Finset A) : A := + cut U η * (∑ w ∈ E, w * V * star w) * cut U η + +lemma firstSandwich_nonneg {U V : A} (hV : 0 ≤ V) (η : ℝ) (E : Finset A) : + 0 ≤ firstSandwich U V η E := by + have hsum : 0 ≤ ∑ w ∈ E, w * V * star w := + Finset.sum_nonneg (fun w _ => star_right_conjugate_nonneg hV w) + simpa only [firstSandwich, IsSelfAdjoint.of_nonneg (cut_nonneg U η) |>.star_eq] using + star_right_conjugate_nonneg hsum (cut U η) + +lemma firstSandwich_mem (U V : A) (η : ℝ) (E : Finset A) : + firstSandwich U V η E ∈ Her (cut U η) := by + simpa only [firstSandwich, IsSelfAdjoint.of_nonneg (cut_nonneg U η) |>.star_eq] using + sandwich_mem_Her (cut U η) (∑ w ∈ E, w * V * star w) + +lemma firstSandwich_two_cuntzLE {U V : A} (hV : ProperlyInfinite V) + (η : ℝ) (E : Finset A) : + FiniteCuntzLE (diagonalCorner 2 (firstSandwich U V η E)) (scalarCorner V) := by + have heq : firstSandwich U V η E = + ∑ w ∈ E, star (star w * cut U η) * V * (star w * cut U η) := by + simp only [firstSandwich, Finset.mul_sum, Finset.sum_mul, star_mul, star_star, + IsSelfAdjoint.of_nonneg (cut_nonneg U η) |>.star_eq] + apply Finset.sum_congr rfl + intro w _ + noncomm_ring + rw [heq] + exact finsetSum_cuntzLE hV E _ + +lemma norm_ramp_bound {d : A} (hd : 0 ≤ d) {η h : ℝ} (hη : 0 < η) + (hh0 : 0 ≤ h) (hh : h < 1) (hbound : ramp d η (2*η) ≤ h • (1 : A)) : ‖d‖ < 2*η := by + by_contra! hnorm + have hone := norm_ramp_eq_one hd hη.le (by linarith) hnorm + have hD := ramp_nonneg d (by linarith : η ≤ 2*η) + have hnle : ‖ramp d η (2*η)‖ ≤ h := by + exact (CStarAlgebra.norm_le_iff_le_algebraMap _ hh0 hD).mpr (by + simpa only [Algebra.algebraMap_eq_smul_one] using hbound) + linarith + +end MainGap + +namespace MainGap + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def scalingComplement (H : A) : A := CFC.sqrt (1 - H * H) + +def scalingIsometry (H r : A) : A := r + scalingComplement H + +def scalingDefect (H r : A) : A := 1 - scalingIsometry H r * star (scalingIsometry H r) + +lemma complement_nonneg {H : A} (hH : IsSelfAdjoint H) (hnorm : ‖H‖ ≤ 1) : + 0 ≤ 1 - H * H := by + apply sub_nonneg.mpr + apply (CStarAlgebra.norm_le_one_iff_of_nonneg (H * H) ?_).mp + · calc + ‖H * H‖ = ‖H‖ ^ 2 := hH.norm_mul_self + _ ≤ 1 := (sq_le_one_iff₀ (norm_nonneg H)).mpr hnorm + · simpa only [hH.star_eq] using star_mul_self_nonneg H + +lemma scalingComplement_mul_self {H : A} (hH : IsSelfAdjoint H) (hnorm : ‖H‖ ≤ 1) : + scalingComplement H * scalingComplement H = 1 - H * H := + CFC.sqrt_mul_sqrt_self _ (complement_nonneg hH hnorm) + +lemma scalingComplement_selfAdjoint (H : A) : IsSelfAdjoint (scalingComplement H) := + IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg _) + +lemma scalingComplement_mul_eq_zero {H r : A} (hH : IsSelfAdjoint H) + (hnorm : ‖H‖ ≤ 1) (hHr : H * r = r) : scalingComplement H * r = 0 := by + apply (CStarRing.star_mul_self_eq_zero_iff _).mp + rw [star_mul, (scalingComplement_selfAdjoint H).star_eq] + calc + star r * scalingComplement H * (scalingComplement H * r) = + star r * (scalingComplement H * scalingComplement H) * r := by noncomm_ring + _ = star r * (1 - H * H) * r := by rw [scalingComplement_mul_self hH hnorm] + _ = 0 := by simp only [mul_sub, sub_mul, mul_one, mul_assoc, hHr, sub_self] + +lemma scalingIsometry_star_mul_self {H r : A} (hH : IsSelfAdjoint H) + (hnorm : ‖H‖ ≤ 1) (hHr : H * r = r) (hrr : star r * r = H * H) : + star (scalingIsometry H r) * scalingIsometry H r = 1 := by + have hbr := scalingComplement_mul_eq_zero hH hnorm hHr + have hrb : star r * scalingComplement H = 0 := by + simpa only [star_mul, star_zero, (scalingComplement_selfAdjoint H).star_eq] using + congrArg star hbr + simp only [scalingIsometry, star_add, (scalingComplement_selfAdjoint H).star_eq, + add_mul, mul_add, hbr, hrb, hrr, scalingComplement_mul_self hH hnorm] + noncomm_ring + +lemma scalingDefect_projection {H r : A} (hH : IsSelfAdjoint H) + (hnorm : ‖H‖ ≤ 1) (hHr : H * r = r) (hrr : star r * r = H * H) : + IsStarProjection (scalingDefect H r) := by + apply IsStarProjection.one_sub + constructor + · change (scalingIsometry H r * star (scalingIsometry H r)) * + (scalingIsometry H r * star (scalingIsometry H r)) = + scalingIsometry H r * star (scalingIsometry H r) + rw [mul_assoc, ← mul_assoc (star (scalingIsometry H r)), + scalingIsometry_star_mul_self hH hnorm hHr hrr, one_mul] + · exact IsSelfAdjoint.mul_star_self _ + +lemma scalingDefect_fixes_second {H r₁ r₂ : A} (hH : IsSelfAdjoint H) + (hnorm : ‖H‖ ≤ 1) (hHr₂ : H * r₂ = r₂) (hcross : star r₁ * r₂ = 0) : + scalingDefect H r₁ * r₂ = r₂ := by + have hvr : star (scalingIsometry H r₁) * r₂ = 0 := by + simp only [scalingIsometry, star_add, add_mul, + (scalingComplement_selfAdjoint H).star_eq, hcross, + scalingComplement_mul_eq_zero hH hnorm hHr₂, add_zero] + simp only [scalingDefect, sub_mul, one_mul, mul_assoc, hvr, mul_zero, sub_zero] + +lemma scalingDefect_ne_zero {H r₁ r₂ : A} (hH : IsSelfAdjoint H) + (hnorm : ‖H‖ ≤ 1) (hHne : H ≠ 0) (hHr₂ : H * r₂ = r₂) + (hcross : star r₁ * r₂ = 0) (hr₂ : star r₂ * r₂ = H * H) : + scalingDefect H r₁ ≠ 0 := by + intro hP + have hr₂zero : r₂ = 0 := by + have := scalingDefect_fixes_second hH hnorm hHr₂ hcross + simpa only [hP, zero_mul, eq_comm] using this + apply hHne + apply (CStarRing.star_mul_self_eq_zero_iff H).mp + rw [hH.star_eq, ← hr₂, hr₂zero, star_zero, zero_mul] + +omit [PartialOrder A] [StarOrderedRing A] in +lemma last_pair_kills_defect {P B₃ B₄ : A} {h : ℝ} (hh : h ≠ 0) + (hPB₄ : P * B₄ = B₄) (hcross : star B₃ * B₄ = 0) + (hmod : star B₃ * B₃ = star B₄ * B₄) + (hD : (B₃ * star B₃) * P = h • P) : P = 0 := by + have hB₄ : h • B₄ = 0 := by + calc + h • B₄ = (h • P) * B₄ := by rw [smul_mul_assoc, hPB₄] + _ = ((B₃ * star B₃) * P) * B₄ := by rw [hD] + _ = B₃ * (star B₃ * B₄) := by rw [mul_assoc, hPB₄, mul_assoc] + _ = 0 := by rw [hcross, mul_zero] + have hB₄zero : B₄ = 0 := (smul_eq_zero.mp hB₄).resolve_left hh + have hB₃zero : B₃ = 0 := (CStarRing.star_mul_self_eq_zero_iff B₃).mp (by + rw [hmod, hB₄zero, star_zero, zero_mul]) + have hP : h • P = 0 := by simpa only [hB₃zero, zero_mul] using hD.symm + exact (smul_eq_zero.mp hP).resolve_left hh + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance : PartialOrder A := CStarAlgebra.spectralOrder A +local instance : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +def deficiency (d : A) : A := cfc (fun t : ℝ => max ((1/2 : ℝ)-t) 0) d + +def firstX (X : A) : A := cut X (1/16) +def firstV (X : A) : A := cut X (1/8) +def firstU (X B : A) : A := firstX X * deficiency (B * star B) * + deficiency (B * star B) * firstX X + +def firstH (X : A) : A := ramp X (3/32) (1/8) +def firstK (X : A) : A := ramp X (3/64) (1/16) +def firstR (X B : A) : A := (Real.sqrt 2) • (star B * firstH X) +def prospectiveDefect (X B : A) : A := + ramp (firstK X * scalingDefect (firstH X) (firstR X B) * firstK X) 0 1 + +def lastX (X B : A) : A := cut (prospectiveDefect X B) (1/2) +def lastR (X B₁ B₃ : A) : A := lastX X B₁ * deficiency (B₃ * star B₃) * + deficiency (B₃ * star B₃) * lastX X B₁ + +def fourHer (X : A) : NonUnitalStarSubalgebra ℂ A := Her (cut X (1/32)) + +lemma deficiency_nonneg (d : A) : 0 ≤ deficiency d := cfc_nonneg (fun _ _ => le_max_right _ _) +lemma deficiency_selfAdjoint (d : A) : IsSelfAdjoint (deficiency d) := IsSelfAdjoint.cfc + +lemma squareSandwich_nonneg {x : A} (hx : IsSelfAdjoint x) (Q : A) (hQ : IsSelfAdjoint Q) : + 0 ≤ x * Q * Q * x := by + have := star_mul_self_nonneg (Q*x) + simpa only [star_mul, hx.star_eq, hQ.star_eq, mul_assoc] using this + +lemma squareSandwich_mem {x : A} (hx : IsSelfAdjoint x) (Q : A) : + x * Q * Q * x ∈ Her x := by + simpa only [hx.star_eq, mul_assoc] using sandwich_mem_Her x (Q*Q) + +lemma cut_mem_cutHer {X : A} (hX : 0 ≤ X) {l u : ℝ} (hl : 0 ≤ l) (hlu : l ≤ u) : + cut X u ∈ Her (cut X l) := by + have heq : cut X u = cut (cut X l) (u-l) := by + rw [cut_cut hX hl (sub_nonneg.mpr hlu)] + congr 1 + ring + rw [heq] + exact cut_mem_Her (cut_nonneg X l) _ + +lemma firstX_mem {X : A} (hX : 0 ≤ X) : firstX X ∈ fourHer X := + cut_mem_cutHer hX (by norm_num) (by norm_num) +lemma firstV_mem {X : A} (hX : 0 ≤ X) : firstV X ∈ fourHer X := + cut_mem_cutHer hX (by norm_num) (by norm_num) +lemma firstU_nonneg (X B : A) : 0 ≤ firstU X B := + squareSandwich_nonneg (.of_nonneg (cut_nonneg X _)) _ (deficiency_selfAdjoint _) +lemma firstU_mem {X : A} (hX : 0 ≤ X) (B : A) : firstU X B ∈ fourHer X := + Her_mono_of_mem (firstX_mem hX) (squareSandwich_mem (.of_nonneg (cut_nonneg X _)) _) + +lemma firstK_mem {X : A} (hX : 0 ≤ X) : firstK X ∈ fourHer X := by + exact Her_mono_of_mem (cut_mem_cutHer hX (by norm_num : (0:ℝ) ≤ 1/32) + (by norm_num : (1/32:ℝ) ≤ 3/64)) (ramp_mem_Her_cut hX (by norm_num)) + +lemma prospectiveDefect_nonneg (X B : A) : 0 ≤ prospectiveDefect X B := + ramp_nonneg _ (by norm_num) +lemma prospectiveDefect_norm (X B : A) : ‖prospectiveDefect X B‖ ≤ 1 := + norm_ramp_le_one _ (by norm_num) +lemma prospectiveDefect_mem {X : A} (hX : 0 ≤ X) (B : A) : + prospectiveDefect X B ∈ fourHer X := by + change cfcₙ _ _ ∈ Her (cut X (1/32)) + apply cfcₙ_mem (𝕜' := ℂ) + have h := Her_sandwich (firstK_mem hX) (scalingDefect (firstH X) (firstR X B)) + simpa only [firstK, IsSelfAdjoint.of_nonneg (ramp_nonneg X (by norm_num : (3/64:ℝ) ≤ 1/16)) |>.star_eq] using h + +lemma lastX_nonneg (X B : A) : 0 ≤ lastX X B := cut_nonneg _ _ +lemma lastX_mem {X : A} (hX : 0 ≤ X) (B : A) : lastX X B ∈ fourHer X := + Her_mono_of_mem (prospectiveDefect_mem hX B) (cut_mem_Her (prospectiveDefect_nonneg X B) _) +lemma lastR_nonneg (X B₁ B₃ : A) : 0 ≤ lastR X B₁ B₃ := + squareSandwich_nonneg (.of_nonneg (lastX_nonneg X B₁)) _ (deficiency_selfAdjoint _) +lemma lastR_mem {X : A} (hX : 0 ≤ X) (B₁ B₃ : A) : lastR X B₁ B₃ ∈ fourHer X := + Her_mono_of_mem (lastX_mem hX B₁) (squareSandwich_mem (.of_nonneg (lastX_nonneg X B₁)) _) + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/ClosedIdeal.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/ClosedIdeal.lean new file mode 100644 index 0000000000000000000000000000000000000000..0294cfb00751ec477d6d6fd54dd27e9786d92358 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/ClosedIdeal.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] + +def idealWords (v : A) : Set A := { z | ∃ x y : A, z = x * v * y } +def idealSpan (v : A) : Submodule ℂ A := Submodule.span ℂ (idealWords v) + +lemma idealSpan_word (v x y : A) : x * v * y ∈ idealSpan v := + Submodule.subset_span ⟨x, y, rfl⟩ + +lemma idealSpan_left {v z : A} (hz : z ∈ idealSpan v) (a : A) : a * z ∈ idealSpan v := by + induction hz using Submodule.span_induction with + | mem z hz => + obtain ⟨x, y, rfl⟩ := hz + simpa only [mul_assoc] using idealSpan_word v (a * x) y + | zero => simp + | add x y hx hy ihx ihy => simpa only [mul_add] using (idealSpan v).add_mem ihx ihy + | smul c x hx ih => simpa only [mul_smul_comm] using (idealSpan v).smul_mem c ih + +lemma idealSpan_right {v z : A} (hz : z ∈ idealSpan v) (a : A) : z * a ∈ idealSpan v := by + induction hz using Submodule.span_induction with + | mem z hz => + obtain ⟨x, y, rfl⟩ := hz + simpa only [mul_assoc] using idealSpan_word v x (y * a) + | zero => simp + | add x y hx hy ihx ihy => simpa only [add_mul] using (idealSpan v).add_mem ihx ihy + | smul c x hx ih => simpa only [smul_mul_assoc] using (idealSpan v).smul_mem c ih + +lemma idealSpan_star {v z : A} (hv : IsSelfAdjoint v) (hz : z ∈ idealSpan v) : + star z ∈ idealSpan v := by + induction hz using Submodule.span_induction with + | mem z hz => + obtain ⟨x, y, rfl⟩ := hz + simpa only [star_mul, hv.star_eq, mul_assoc] using idealSpan_word v (star y) (star x) + | zero => simp + | add x y hx hy ihx ihy => simpa only [star_add] using (idealSpan v).add_mem ihx ihy + | smul c x hx ih => simpa only [star_smul] using (idealSpan v).smul_mem (star c) ih + +def idealAlgebra (v : A) (hv : IsSelfAdjoint v) : NonUnitalStarSubalgebra ℂ A where + carrier := idealSpan v + zero_mem' := (idealSpan v).zero_mem + add_mem' := (idealSpan v).add_mem + smul_mem' := fun c _ hz => (idealSpan v).smul_mem c hz + mul_mem' := fun _ hy => idealSpan_left hy _ + star_mem' := idealSpan_star hv + +def closedIdeal (v : A) (hv : IsSelfAdjoint v) : NonUnitalStarSubalgebra ℂ A := + (idealAlgebra v hv).topologicalClosure + +lemma closedIdeal_closed (v : A) (hv : IsSelfAdjoint v) : + IsClosed (closedIdeal v hv : Set A) := isClosed_closure + +instance closedIdeal_complete (v : A) (hv : IsSelfAdjoint v) : + CompleteSpace (closedIdeal v hv) := (closedIdeal_closed v hv).completeSpace_coe + +lemma closedIdeal_word (v : A) (hv : IsSelfAdjoint v) (x y : A) : + x * v * y ∈ closedIdeal v hv := subset_closure (idealSpan_word v x y) + +lemma self_mem_closedIdeal (v : A) (hv : IsSelfAdjoint v) : v ∈ closedIdeal v hv := by + simpa using closedIdeal_word v hv 1 1 + +lemma closedIdeal_left {v z : A} (hv : IsSelfAdjoint v) (hz : z ∈ closedIdeal v hv) (a : A) : + a * z ∈ closedIdeal v hv := by + refine (closedIdeal_closed v hv).preimage (continuous_const.mul continuous_id) + |>.closure_subset_iff.mpr (fun x hx => subset_closure (idealSpan_left hx a)) hz + +lemma closedIdeal_right {v z : A} (hv : IsSelfAdjoint v) (hz : z ∈ closedIdeal v hv) (a : A) : + z * a ∈ closedIdeal v hv := by + refine (closedIdeal_closed v hv).preimage (continuous_id.mul continuous_const) + |>.closure_subset_iff.mpr (fun x hx => subset_closure (idealSpan_right hx a)) hz + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Comparison.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Comparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8b39538ba6a57bf9c7b9dd544771631d57832ba --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Comparison.lean @@ -0,0 +1,301 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Hereditary + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap + +variable {A : Type*} [NonUnitalCStarAlgebra A] + +local instance positivityOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance positivityStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +def FiniteCuntzLE {m n : ℕ} (d : CStarMatrix (Fin n) (Fin n) A) + (v : CStarMatrix (Fin m) (Fin m) A) : Prop := + ∃ r : ℕ → CStarMatrix (Fin m) (Fin n) A, + Tendsto (fun j => (r j).conjTranspose * v * r j) atTop (𝓝 d) + +def scalarCorner (h : A) : CStarMatrix (Fin 1) (Fin 1) A := + CStarMatrix.ofMatrix (fun _ _ => h) + +def doubleCorner (h : A) : CStarMatrix (Fin 2) (Fin 2) A := + CStarMatrix.ofMatrix (Matrix.diagonal (fun _ => h)) + +def ProperlyInfinite (h : A) : Prop := + FiniteCuntzLE (doubleCorner h) (scalarCorner h) + +def PropertyP (A : Type*) [NonUnitalCStarAlgebra A] : Prop := + ∀ h : A, 0 ≤ h → ProperlyInfinite h + +def Diagonalization (a b c : A) (ε : ℝ) : Prop := + ∃ s t : A, + ‖star s * a * s - a‖ < ε ∧ + ‖star t * b * t - b‖ < ε ∧ + ‖star s * c * t‖ < ε + +def UnrestrictedDiagonalization (A : Type*) [NonUnitalCStarAlgebra A] : Prop := + ∀ a b : A, 0 ≤ a → 0 ≤ b → ∀ c : A, ∀ ε : ℝ, 0 < ε → + Diagonalization a b c ε + +def StronglyPurelyInfinite (A : Type*) [NonUnitalCStarAlgebra A] : Prop := + ∀ x y : A, 0 ≤ x → 0 ≤ y → ∀ ε : ℝ, 0 < ε → + Diagonalization (x * x) (y * y) (x * y) ε + +lemma matrix_mul_assoc {l m n k : ℕ} (x : CStarMatrix (Fin l) (Fin m) A) + (y : CStarMatrix (Fin m) (Fin n) A) (z : CStarMatrix (Fin n) (Fin k) A) : + (x * y) * z = x * (y * z) := Matrix.mul_assoc x y z + +lemma matrix_star_mul {l m n : ℕ} (x : CStarMatrix (Fin l) (Fin m) A) + (y : CStarMatrix (Fin m) (Fin n) A) : + (x * y).conjTranspose = y.conjTranspose * x.conjTranspose := + Matrix.conjTranspose_mul x y + +lemma continuous_matrix_mul {X : Type*} [TopologicalSpace X] {l m n : ℕ} + {x : X → CStarMatrix (Fin l) (Fin m) A} {y : X → CStarMatrix (Fin m) (Fin n) A} + (hx : Continuous x) (hy : Continuous y) : Continuous (fun t => x t * y t) := + hx.matrix_mul hy + +lemma continuous_matrix_star {X : Type*} [TopologicalSpace X] {l m : ℕ} + {x : X → CStarMatrix (Fin l) (Fin m) A} (hx : Continuous x) : + Continuous (fun t => (x t).conjTranspose) := by + change Continuous (fun t => Matrix.conjTranspose (x t)) + fun_prop + +lemma finiteCuntzLE_iff_closure {m n : ℕ} (d : CStarMatrix (Fin n) (Fin n) A) + (v : CStarMatrix (Fin m) (Fin m) A) : + FiniteCuntzLE d v ↔ d ∈ closure (Set.range + (fun r : CStarMatrix (Fin m) (Fin n) A => r.conjTranspose * v * r)) := by + rw [mem_closure_iff_seq_limit] + constructor + · rintro ⟨r, hr⟩ + exact ⟨_, fun j => ⟨r j, rfl⟩, hr⟩ + · rintro ⟨x, hx, ht⟩ + choose r hr using hx + exact ⟨r, by simpa only [hr] using ht⟩ + +lemma FiniteCuntzLE.exists_approx {m n : ℕ} {d : CStarMatrix (Fin n) (Fin n) A} + {v : CStarMatrix (Fin m) (Fin m) A} (h : FiniteCuntzLE d v) + {ε : ℝ} (hε : 0 < ε) : + ∃ r : CStarMatrix (Fin m) (Fin n) A, ‖d - r.conjTranspose * v * r‖ < ε := by + rw [finiteCuntzLE_iff_closure, Metric.mem_closure_iff] at h + obtain ⟨x, ⟨r, rfl⟩, hr⟩ := h ε hε + exact ⟨r, by simpa only [dist_eq_norm] using hr⟩ + +lemma finiteCuntzLE_of_forall_approx {m n : ℕ} {d : CStarMatrix (Fin n) (Fin n) A} + {v : CStarMatrix (Fin m) (Fin m) A} + (h : ∀ ε > 0, ∃ r : CStarMatrix (Fin m) (Fin n) A, + ‖d - r.conjTranspose * v * r‖ < ε) : FiniteCuntzLE d v := by + rw [finiteCuntzLE_iff_closure, Metric.mem_closure_iff] + intro ε hε + obtain ⟨r, hr⟩ := h ε hε + exact ⟨_, ⟨r, rfl⟩, by simpa only [dist_eq_norm] using hr⟩ + +lemma FiniteCuntzLE.conjugate {l m n : ℕ} {d : CStarMatrix (Fin n) (Fin n) A} + {v : CStarMatrix (Fin m) (Fin m) A} (hdv : FiniteCuntzLE d v) + (x : CStarMatrix (Fin n) (Fin l) A) : + FiniteCuntzLE (x.conjTranspose * d * x) v := by + obtain ⟨r, hr⟩ := hdv + refine ⟨fun j => r j * x, ?_⟩ + have hc : Continuous (fun d : CStarMatrix (Fin n) (Fin n) A => + x.conjTranspose * d * x) := + continuous_matrix_mul (continuous_matrix_mul continuous_const continuous_id) continuous_const + convert hc.continuousAt.tendsto.comp hr using 1 + ext j + rw [matrix_star_mul] + simp only [Function.comp_apply, matrix_mul_assoc] + +lemma FiniteCuntzLE.trans {l m n : ℕ} {d : CStarMatrix (Fin n) (Fin n) A} + {v : CStarMatrix (Fin m) (Fin m) A} {w : CStarMatrix (Fin l) (Fin l) A} + (hdv : FiniteCuntzLE d v) (hvw : FiniteCuntzLE v w) : FiniteCuntzLE d w := by + rw [finiteCuntzLE_iff_closure] at hdv ⊢ + apply closure_minimal _ isClosed_closure hdv + rintro _ ⟨x, rfl⟩ + exact (finiteCuntzLE_iff_closure _ _).mp (hvw.conjugate x) + +lemma isClosed_finiteCuntzLE {m n : ℕ} (v : CStarMatrix (Fin m) (Fin m) A) : + IsClosed {d : CStarMatrix (Fin n) (Fin n) A | FiniteCuntzLE d v} := by + simp_rw [finiteCuntzLE_iff_closure] + exact isClosed_closure + +lemma FiniteCuntzLE.of_tendsto {m n : ℕ} {v : CStarMatrix (Fin m) (Fin m) A} + {d : ℕ → CStarMatrix (Fin n) (Fin n) A} {u : CStarMatrix (Fin n) (Fin n) A} + (hd : ∀ j, FiniteCuntzLE (d j) v) (ht : Tendsto d atTop (𝓝 u)) : + FiniteCuntzLE u v := (isClosed_finiteCuntzLE v).mem_of_tendsto ht (Eventually.of_forall hd) + +lemma FiniteCuntzLE.refl {n : ℕ} (v : CStarMatrix (Fin n) (Fin n) A) : + FiniteCuntzLE v v := by + let M := CStarMatrix (Fin n) (Fin n) A + let : PartialOrder M := CStarAlgebra.spectralOrder M + let : StarOrderedRing M := CStarAlgebra.spectralOrderedRing M + have hu := CStarAlgebra.increasingApproximateUnit M + apply finiteCuntzLE_of_forall_approx + intro ε hε + have hl : ∀ᶠ e : M in CStarAlgebra.approximateUnit M, ‖v - v * e‖ < ε / 2 := by + have ht := ((tendsto_const_nhds (x := v)).sub (hu.tendsto_mul_left v)).norm + simpa only [sub_self, norm_zero] using ht.eventually (Iio_mem_nhds (by simpa only [sub_self, norm_zero] using half_pos hε)) + have hr : ∀ᶠ e : M in CStarAlgebra.approximateUnit M, ‖v - e * v‖ < ε / 2 := by + have ht := ((tendsto_const_nhds (x := v)).sub (hu.tendsto_mul_right v)).norm + simpa only [sub_self, norm_zero] using ht.eventually (Iio_mem_nhds (by simpa only [sub_self, norm_zero] using half_pos hε)) + obtain ⟨e, hesa, hen, hel, her⟩ := + (hu.eventually_star_eq.and (hu.eventually_norm.and (hl.and hr))).exists + refine ⟨e, ?_⟩ + change ‖v - star e * v * e‖ < ε + rw [hesa] + calc + ‖v - e * v * e‖ = ‖(v - e * v) + e * (v - v * e)‖ := by rw [mul_sub, ← mul_assoc]; congr 1; abel + _ ≤ ‖v - e * v‖ + ‖e‖ * ‖v - v * e‖ := + (norm_add_le _ _).trans (add_le_add_right (norm_mul_le _ _) _) + _ ≤ ‖v - e * v‖ + ‖v - v * e‖ := by nlinarith [norm_nonneg (v - v * e)] + _ < ε := by linarith + +def matrixBlock {m n p q : ℕ} (x : CStarMatrix (Fin m) (Fin n) A) + (y : CStarMatrix (Fin p) (Fin q) A) : CStarMatrix (Fin (m+p)) (Fin (n+q)) A := + CStarMatrix.ofMatrix ((Matrix.fromBlocks (CStarMatrix.ofMatrix.symm x) 0 0 (CStarMatrix.ofMatrix.symm y)).submatrix + finSumFinEquiv.symm finSumFinEquiv.symm) + +lemma matrixBlock_mul {m n p q r s : ℕ} + (x : CStarMatrix (Fin m) (Fin n) A) (y : CStarMatrix (Fin p) (Fin q) A) + (u : CStarMatrix (Fin n) (Fin r) A) (v : CStarMatrix (Fin q) (Fin s) A) : + matrixBlock x y * matrixBlock u v = matrixBlock (x * u) (y * v) := by + apply CStarMatrix.ofMatrix.symm.injective + change (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm x) 0 0 (CStarMatrix.ofMatrix.symm y)).submatrix + finSumFinEquiv.symm finSumFinEquiv.symm * + (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm u) 0 0 (CStarMatrix.ofMatrix.symm v)).submatrix + finSumFinEquiv.symm finSumFinEquiv.symm = + (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm x * CStarMatrix.ofMatrix.symm u) 0 0 + (CStarMatrix.ofMatrix.symm y * CStarMatrix.ofMatrix.symm v)).submatrix _ _ + rw [Matrix.submatrix_mul_equiv, Matrix.fromBlocks_multiply] + simp only [Matrix.zero_mul, Matrix.mul_zero, add_zero, zero_add] + +lemma matrixBlock_star {m n p q : ℕ} + (x : CStarMatrix (Fin m) (Fin n) A) (y : CStarMatrix (Fin p) (Fin q) A) : + (matrixBlock x y).conjTranspose = matrixBlock x.conjTranspose y.conjTranspose := by + apply CStarMatrix.ext + intro i j + change star (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm x) 0 0 (CStarMatrix.ofMatrix.symm y) (finSumFinEquiv.symm j) (finSumFinEquiv.symm i)) = _ + generalize hi : finSumFinEquiv.symm i = i' + generalize hj : finSumFinEquiv.symm j = j' + cases i' <;> cases j' <;> simp [matrixBlock, Matrix.fromBlocks, Matrix.submatrix, hi, hj] + +lemma continuous_matrixBlock {X : Type*} [TopologicalSpace X] {m n p q : ℕ} + {x : X → CStarMatrix (Fin m) (Fin n) A} {y : X → CStarMatrix (Fin p) (Fin q) A} + (hx : Continuous x) (hy : Continuous y) : Continuous (fun t => matrixBlock (x t) (y t)) := by + change Continuous (fun t => (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm (x t)) 0 0 + (CStarMatrix.ofMatrix.symm (y t))).submatrix finSumFinEquiv.symm finSumFinEquiv.symm) + apply continuous_pi + intro i + apply continuous_pi + intro j + change Continuous (fun t => Matrix.fromBlocks (CStarMatrix.ofMatrix.symm (x t)) 0 0 + (CStarMatrix.ofMatrix.symm (y t)) (finSumFinEquiv.symm i) (finSumFinEquiv.symm j)) + cases finSumFinEquiv.symm i with + | inl i' => + cases finSumFinEquiv.symm j with + | inl j' => + change Continuous (fun t => CStarMatrix.ofMatrix.symm (x t) i' j') + exact (continuous_apply j').comp ((continuous_apply i').comp hx) + | inr j' => exact continuous_const + | inr i' => + cases finSumFinEquiv.symm j with + | inl j' => exact continuous_const + | inr j' => + change Continuous (fun t => CStarMatrix.ofMatrix.symm (y t) i' j') + exact (continuous_apply j').comp ((continuous_apply i').comp hy) + +lemma tendsto_matrixBlock {X : Type*} {f : Filter X} {m n p q : ℕ} + {x : X → CStarMatrix (Fin m) (Fin n) A} {y : X → CStarMatrix (Fin p) (Fin q) A} + {u : CStarMatrix (Fin m) (Fin n) A} {v : CStarMatrix (Fin p) (Fin q) A} + (hx : Tendsto x f (𝓝 u)) (hy : Tendsto y f (𝓝 v)) : + Tendsto (fun t => matrixBlock (x t) (y t)) f (𝓝 (matrixBlock u v)) := by + change Tendsto (fun t => CStarMatrix.ofMatrix.symm (matrixBlock (x t) (y t))) f + (𝓝 (CStarMatrix.ofMatrix.symm (matrixBlock u v))) + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_pi_nhds.mpr + intro j + change Tendsto (fun t => Matrix.fromBlocks (CStarMatrix.ofMatrix.symm (x t)) 0 0 + (CStarMatrix.ofMatrix.symm (y t)) (finSumFinEquiv.symm i) (finSumFinEquiv.symm j)) f + (𝓝 (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm u) 0 0 + (CStarMatrix.ofMatrix.symm v) (finSumFinEquiv.symm i) (finSumFinEquiv.symm j))) + cases finSumFinEquiv.symm i with + | inl i' => + cases finSumFinEquiv.symm j with + | inl j' => exact (hx.apply_nhds i').apply_nhds j' + | inr j' => exact tendsto_const_nhds + | inr i' => + cases finSumFinEquiv.symm j with + | inl j' => exact tendsto_const_nhds + | inr j' => exact (hy.apply_nhds i').apply_nhds j' + +lemma matrixBlock_conjugate {m n p q : ℕ} + (r : CStarMatrix (Fin m) (Fin n) A) (s : CStarMatrix (Fin p) (Fin q) A) + (v : CStarMatrix (Fin m) (Fin m) A) (w : CStarMatrix (Fin p) (Fin p) A) : + (matrixBlock r s).conjTranspose * matrixBlock v w * matrixBlock r s = + matrixBlock (r.conjTranspose * v * r) (s.conjTranspose * w * s) := by + rw [matrixBlock_star, matrixBlock_mul, matrixBlock_mul] + +lemma FiniteCuntzLE.block {m n p q : ℕ} + {d : CStarMatrix (Fin n) (Fin n) A} {v : CStarMatrix (Fin m) (Fin m) A} + {d' : CStarMatrix (Fin q) (Fin q) A} {v' : CStarMatrix (Fin p) (Fin p) A} + (h : FiniteCuntzLE d v) (h' : FiniteCuntzLE d' v') : + FiniteCuntzLE (matrixBlock d d') (matrixBlock v v') := by + obtain ⟨r, hr⟩ := h + obtain ⟨s, hs⟩ := h' + refine ⟨fun j => matrixBlock (r j) (s j), ?_⟩ + have heq : (fun j => (matrixBlock (r j) (s j)).conjTranspose * + matrixBlock v v' * matrixBlock (r j) (s j)) = + (fun j => matrixBlock ((r j).conjTranspose * v * r j) + ((s j).conjTranspose * v' * s j)) := by + funext j + exact matrixBlock_conjugate (r j) (s j) v v' + rw [heq] + exact tendsto_matrixBlock hr hs + +def diagonalCorner (n : ℕ) (h : A) : CStarMatrix (Fin n) (Fin n) A := + CStarMatrix.ofMatrix (Matrix.diagonal (fun _ => h)) + +lemma matrixBlock_diagonal (n m : ℕ) (h : A) : + matrixBlock (diagonalCorner n h) (diagonalCorner m h) = diagonalCorner (n+m) h := by + apply CStarMatrix.ext + intro i j + change (Matrix.fromBlocks (Matrix.diagonal (fun _ => h)) 0 0 + (Matrix.diagonal (fun _ => h))).submatrix _ _ i j = _ + rw [Matrix.fromBlocks_diagonal] + simp only [Matrix.submatrix_apply, Matrix.diagonal_apply, diagonalCorner, + CStarMatrix.ofMatrix_apply, Equiv.apply_eq_iff_eq] + split_ifs with hij + · cases finSumFinEquiv.symm i <;> rfl + · rfl + +lemma diagonalCorner_one (h : A) : diagonalCorner 1 h = scalarCorner h := by + ext i j + have hij : i = j := Subsingleton.elim _ _ + change Matrix.diagonal (fun _ => h) i j = h + simp [Matrix.diagonal, hij] + +lemma ProperlyInfinite.finite_copies {h : A} (hh : ProperlyInfinite h) (n : ℕ) : + FiniteCuntzLE (diagonalCorner n h) (scalarCorner h) := by + induction n with + | zero => + refine ⟨fun _ => 0, ?_⟩ + have heq : (fun _ : ℕ => (0 : CStarMatrix (Fin 1) (Fin 0) A).conjTranspose * + scalarCorner h * (0 : CStarMatrix (Fin 1) (Fin 0) A)) = fun _ => diagonalCorner 0 h := by + funext j + apply CStarMatrix.ext + intro i + exact Fin.elim0 i + rw [heq] + exact tendsto_const_nhds + | succ n hn => + have hblock := hn.block (FiniteCuntzLE.refl (scalarCorner h)) + rw [← diagonalCorner_one h, matrixBlock_diagonal, matrixBlock_diagonal] at hblock + exact hblock.trans hh + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Compression.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Compression.lean new file mode 100644 index 0000000000000000000000000000000000000000..1dec4aea6a135577c2c5cbeb434a86ecbaff9921 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Compression.lean @@ -0,0 +1,271 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Nonvanishing + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def cutInverseFn (δ t : ℝ) : ℝ := t/(max δ t)^2 + +lemma continuous_cutInverseFn {δ : ℝ} (hδ : 0 < δ) : Continuous (cutInverseFn δ) := by + exact continuous_id.div (((continuous_const.max continuous_id).pow 2)) + (fun t => pow_ne_zero _ (ne_of_gt (hδ.trans_le (le_max_left _ _)))) + +lemma cutInverseFn_zero (δ : ℝ) : cutInverseFn δ 0=0 := by simp [cutInverseFn] + +def cutInverse (a : A) (δ : ℝ) : A := cfcₙ (cutInverseFn δ) a + +lemma cutInverseFn_bound {δ t : ℝ} (hδ : 0 < δ) (ht : 0 ≤ t) : + 0 ≤ cutInverseFn δ t ∧ cutInverseFn δ t ≤ 1/δ := by + refine ⟨div_nonneg ht (sq_nonneg _), ?_⟩ + by_cases htδ : t ≤ δ + · dsimp [cutInverseFn] + rw [max_eq_left htδ] + apply (div_le_iff₀ (sq_pos_of_pos hδ)).mpr + calc + t ≤ δ := htδ + _ = 1/δ*δ^2 := by field_simp + · have htpos : 0 < t := hδ.trans (lt_of_not_ge htδ) + have he : cutInverseFn δ t=1/t := by + dsimp [cutInverseFn] + rw [max_eq_right (le_of_not_ge htδ)] + field_simp + rw [he] + exact one_div_le_one_div_of_le hδ (le_of_not_ge htδ) + +lemma norm_cutInverse_le {a : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 < δ) : + ‖cutInverse a δ‖ ≤ 1/δ := by + apply norm_cfcₙ_le + intro t ht + have hb := cutInverseFn_bound hδ (quasispectrum_nonneg_of_nonneg a ha t ht) + rw [Real.norm_eq_abs, abs_of_nonneg hb.1] + exact hb.2 + +lemma cut_mul_cutInverse {a : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 < δ) : + cut a δ * (cutInverse a δ * a) = cut a δ := by + have hc : Continuous (fun t : ℝ => max (t-δ) 0) := by fun_prop + have h0 : (fun t : ℝ => max (t-δ) 0) 0=0 := by + simp [max_eq_right (neg_nonpos.mpr hδ.le)] + have he : cutInverse a δ*a = cfcₙ (fun t : ℝ => cutInverseFn δ t*t) a := by + simpa only [id_eq, cfcₙ_id' ℝ a ha.isSelfAdjoint, cutInverse] using + (cfcₙ_mul (cutInverseFn δ) id a (continuous_cutInverseFn hδ).continuousOn + (cutInverseFn_zero δ) continuousOn_id rfl).symm + rw [he, cut, ← cfcₙ_mul (fun t : ℝ => max (t-δ) 0) + (fun t : ℝ => cutInverseFn δ t*t) a hc.continuousOn h0 + ((continuous_cutInverseFn hδ).mul continuous_id).continuousOn (by simp [cutInverseFn_zero])] + apply cfcₙ_congr + intro t _ + dsimp only + by_cases ht : t ≤ δ + · rw [max_eq_right (sub_nonpos.mpr ht), zero_mul] + · have ht0 : t ≠ 0 := ne_of_gt (hδ.trans (lt_of_not_ge ht)) + dsimp [cutInverseFn] + rw [max_eq_right (le_of_not_ge ht)] + field_simp + +lemma Her_right_fixed_cutInverse {a x : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 < δ) + (hx : x ∈ Her (cut a δ)) : x*(cutInverse a δ*a)=x := + Her_fixed_right (cut_nonneg a δ).isSelfAdjoint (cut_mul_cutInverse ha hδ) hx + +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def HerCompression (p q c : A) (κ : ℝ) : Prop := + ∀ x : A, x ∈ Her p → ∀ k : A, k ∈ Her q → ‖x*c*k‖ ≤ κ * ‖x‖ * ‖k‖ + +lemma cut_sqrt_lower {d : A} (hd : 0 ≤ d) {δ : ℝ} (hδ : 0 ≤ δ) : + δ • cut d δ ≤ CFC.sqrt (cut d δ) * d * CFC.sqrt (cut d δ) := by + let f : ℝ → ℝ := fun t => max (t-δ) 0 + have hf : Continuous f := (continuous_id.sub continuous_const).max continuous_const + have hf0 : f 0=0 := by simp [f, max_eq_right (neg_nonpos.mpr hδ)] + have hl : δ • cut d δ ≤ d * cut d δ := by + change δ • cfcₙ f d ≤ d * cfcₙ f d + have hu : cfcₙ (fun t => t*f t) d = d*cfcₙ f d := by + rw [cfcₙ_mul (fun t : ℝ => t) f d continuousOn_id rfl hf.continuousOn hf0] + exact congrArg (fun x => x*cfcₙ f d) (cfcₙ_id ℝ d hd.isSelfAdjoint) + rw [← cfcₙ_const_mul δ f d hf.continuousOn hf0, ← hu] + apply (cfcₙ_le_iff _ _ d (continuous_const.mul hf).continuousOn + (continuous_id.mul hf).continuousOn (by simp [hf0]) (by simp [hf0]) hd.isSelfAdjoint).mpr + intro t _ + by_cases ht : δ ≤ t + · exact mul_le_mul_of_nonneg_right ht (le_max_right _ _) + · simp [f, max_eq_right (by linarith : t-δ ≤ 0)] + have hc : Commute (cut d δ) d := (Commute.refl d).cfcₙ_real f + have hs : Commute (CFC.sqrt (cut d δ)) d := hc.cfcₙ_nnreal NNReal.sqrt + calc + δ • cut d δ ≤ d * cut d δ := hl + _ = CFC.sqrt (cut d δ) * d * CFC.sqrt (cut d δ) := by + rw [hs.eq, mul_assoc, CFC.sqrt_mul_sqrt_self (cut d δ) (cut_nonneg d δ)] + +lemma norm_mul_factor_of_order {m z : A} {r : ℝ} (hr : 0 ≤ r) + (h : star (m*z) * (m*z) ≤ r^2 • (star z*z)) (b : A) : + ‖m*(z*b)‖ ≤ r*‖z*b‖ := by + have ho := star_left_conjugate_le_conjugate h b + have ht : star (m*(z*b))*(m*(z*b)) ≤ r^2 • (star (z*b)*(z*b)) := by + simpa only [star_mul, mul_assoc, mul_smul_comm, smul_mul_assoc] using ho + have hn := CStarAlgebra.norm_le_norm_of_le_of_nonneg ht (star_mul_self_nonneg _) + rw [CStarRing.norm_star_mul_self, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (sq_nonneg r), CStarRing.norm_star_mul_self] at hn + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hr (norm_nonneg _))).mp + calc + ‖m*(z*b)‖^2 = ‖m*(z*b)‖*‖m*(z*b)‖ := pow_two _ + _ ≤ r^2 * (‖z*b‖*‖z*b‖) := hn + _ = (r*‖z*b‖)^2 := by ring + +lemma norm_mul_Her_of_order {m z : A} {r : ℝ} (hr : 0 ≤ r) + (h : star (m*z) * (m*z) ≤ r^2 • (star z*z)) + {k : A} (hk : k ∈ Her (z*star z)) : ‖m*k‖ ≤ r*‖k‖ := by + have hc : IsClosed {k : A | ‖m*k‖ ≤ r*‖k‖} := isClosed_le (by fun_prop) (by fun_prop) + apply closure_minimal (s := Set.range (fun b : A => (z*star z)*b*star (z*star z))) _ hc hk + rintro k ⟨b, rfl⟩ + change ‖m*((z*star z)*b*star (z*star z))‖ ≤ r*‖(z*star z)*b*star (z*star z)‖ + simpa only [star_mul, star_star, mul_assoc] using + norm_mul_factor_of_order hr h (star z*b*(z*star z)) + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +lemma conditional_defect_bounds {p y c : A} (hp : 0 ≤ p) (hy : 0 ≤ y) + (hpn : ‖p‖ ≤ 1) (hyn : ‖y‖ ≤ 1) (hcn : ‖c‖ ≤ 1) : + 0 ≤ y*(1-star c*(p*p)*c)*y ∧ + y*(1-star c*(p*p)*c)*y ≤ y*y ∧ y*y ≤ 1 := by + have hm : ‖p*c‖ ≤ 1 := (norm_mul_le _ _).trans (by nlinarith [norm_nonneg p, norm_nonneg c]) + have hm₁ : star (p*c)*(p*c) ≤ 1 := by + apply (CStarAlgebra.norm_le_one_iff_of_nonneg _ (star_mul_self_nonneg _)).mp + rw [CStarRing.norm_star_mul_self] + nlinarith [norm_nonneg (p*c)] + have he : star (p*c)*(p*c) = star c*(p*p)*c := by + simp only [star_mul, hp.isSelfAdjoint.star_eq, mul_assoc] + have hn : 0 ≤ 1-star c*(p*p)*c := sub_nonneg.mpr (he ▸ hm₁) + have hl : 1-star c*(p*p)*c ≤ 1 := sub_le_self _ (he ▸ star_mul_self_nonneg (p*c)) + refine ⟨?_, ?_, ?_⟩ + · simpa only [hy.isSelfAdjoint.star_eq] using star_left_conjugate_nonneg hn y + · simpa only [hy.isSelfAdjoint.star_eq, mul_one] using star_left_conjugate_le_conjugate hl y + · apply (CStarAlgebra.norm_le_one_iff_of_nonneg _ ?_).mp + · rw [hy.isSelfAdjoint.norm_mul_self] + nlinarith [norm_nonneg y] + · simpa only [hy.isSelfAdjoint.star_eq] using star_mul_self_nonneg y + +lemma conditional_order_loss {p y c d : A} (hp : 0 ≤ p) (hy : 0 ≤ y) + (hd : 0 ≤ d) (_hyd : d ≤ y*y) (hy₂ : y*y ≤ 1) + (he : d=y*(1-star c*(p*p)*c)*y) {δ : ℝ} (hδ : 0 ≤ δ) : + let z := y*CFC.sqrt (cut d δ) + star ((p*c)*z)*((p*c)*z) ≤ (1-δ) • (star z*z) := by + let s := CFC.sqrt (cut d δ) + let z := y*s + have hs : IsSelfAdjoint s := (CFC.sqrt_nonneg _).isSelfAdjoint + have hZ : star z*z ≤ cut d δ := by + calc + star z*z = s*(y*y)*s := by + dsimp [z] + simp only [star_mul, hs.star_eq, hy.isSelfAdjoint.star_eq, mul_assoc] + _ ≤ s*1*s := by + simpa only [hs.star_eq] using star_left_conjugate_le_conjugate hy₂ s + _ = cut d δ := by + rw [mul_one] + exact CFC.sqrt_mul_sqrt_self (cut d δ) (cut_nonneg d δ) + have hδZ : δ • (star z*z) ≤ s*d*s := + (smul_le_smul_of_nonneg_left hZ hδ).trans (cut_sqrt_lower hd hδ) + have hid : star ((p*c)*z)*((p*c)*z) = star z*z-s*d*s := by + dsimp [z] + rw [he] + simp only [star_mul, hp.isSelfAdjoint.star_eq, hy.isSelfAdjoint.star_eq, hs.star_eq] + noncomm_ring + change star ((p*c)*z)*((p*c)*z) ≤ (1-δ) • (star z*z) + rw [hid, sub_smul, one_smul] + exact sub_le_sub_left hδZ _ + +lemma conditional_Her_loss {p y c : A} (hp : 0 ≤ p) (hy : 0 ≤ y) + (hpn : ‖p‖ ≤ 1) (hyn : ‖y‖ ≤ 1) (hcn : ‖c‖ ≤ 1) + {δ : ℝ} (hδ : 0 ≤ δ) (hδ₁ : δ ≤ 1) : + let d := y*(1-star c*(p*p)*c)*y + let q := y*cut d δ*y + ∀ k : A, k ∈ Her q → ‖p*c*k‖ ≤ Real.sqrt (1-δ) * ‖k‖ := by + let d := y*(1-star c*(p*p)*c)*y + let z := y*CFC.sqrt (cut d δ) + have hb := conditional_defect_bounds hp hy hpn hyn hcn + have hh : star ((p*c)*z)*((p*c)*z) ≤ (Real.sqrt (1-δ))^2 • (star z*z) := by + rw [Real.sq_sqrt (sub_nonneg.mpr hδ₁)] + exact conditional_order_loss hp hy hb.1 hb.2.1 hb.2.2 rfl hδ + have hq : z*star z=y*cut d δ*y := by + dsimp [z] + simp only [star_mul, hy.isSelfAdjoint.star_eq, (CFC.sqrt_nonneg (cut d δ)).isSelfAdjoint.star_eq] + calc + y*CFC.sqrt (cut d δ)*(CFC.sqrt (cut d δ)*y) = + y*(CFC.sqrt (cut d δ)*CFC.sqrt (cut d δ))*y := by simp only [mul_assoc] + _ = _ := by rw [CFC.sqrt_mul_sqrt_self (cut d δ) (cut_nonneg d δ)] + change ∀ k : A, k ∈ Her (y*cut d δ*y) → ‖p*c*k‖ ≤ Real.sqrt (1-δ)*‖k‖ + intro k hk + exact norm_mul_Her_of_order (Real.sqrt_nonneg _) hh (hq.symm ▸ hk) + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +lemma conditional_q_zero {p y c : A} (hp : 0 ≤ p) (hy : 0 ≤ y) + (hpn : ‖p‖ ≤ 1) (hyn : ‖y‖ ≤ 1) (hcn : ‖c‖ ≤ 1) + {δ : ℝ} (hδ : 0 < δ) + (hq : y*cut (y*(1-star c*(p*p)*c)*y) δ*y=0) : + ‖y*(1-star c*(p*p)*c)*y‖ ≤ δ := by + let d := y*(1-star c*(p*p)*c)*y + let h := cut d δ + let s := CFC.sqrt h + have hs : IsSelfAdjoint s := (CFC.sqrt_nonneg h).isSelfAdjoint + have hd := conditional_defect_bounds hp hy hpn hyn hcn + have hzz : (y*s)*star (y*s) = y*h*y := by + simp only [star_mul, hs.star_eq, hy.isSelfAdjoint.star_eq] + calc + y*s*(s*y)= y*(s*s)*y := by simp only [mul_assoc] + _ = y*h*y := by rw [show s*s=h from CFC.sqrt_mul_sqrt_self h (cut_nonneg d δ)] + have hz : y*s=0 := (CStarRing.mul_star_self_eq_zero_iff _).mp (hzz.trans hq) + have hl : δ • h ≤ 0 := by + calc + δ • h ≤ s*d*s := cut_sqrt_lower hd.1 hδ.le + _ ≤ s*(y*y)*s := by + simpa only [hs.star_eq] using star_left_conjugate_le_conjugate hd.2.1 s + _ = star (y*s)*(y*s) := by + simp only [star_mul, hs.star_eq, hy.isSelfAdjoint.star_eq, mul_assoc] + _ = 0 := by rw [hz, star_zero, mul_zero] + have hsm : δ • h=0 := le_antisymm hl (smul_nonneg hδ.le (cut_nonneg d δ)) + have hh : h=0 := (smul_eq_zero.mp hsm).resolve_left (ne_of_gt hδ) + have hb := norm_sub_cut_le hd.1 hδ.le + change ‖d-h‖ ≤ δ at hb + simpa only [hh, sub_zero] using hb + +lemma compression_of_conditional_loss {p q c : A} (hp : 0 ≤ p) {τ r : ℝ} + (hτ : 0 < τ) (_hr : 0 ≤ r) + (h : ∀ k : A, k ∈ Her q → ‖p*c*k‖ ≤ r*‖k‖) : + HerCompression (ramp p τ 1) q c (r/τ) := by + intro x hx k hk + have hxH : x ∈ Her (cut p τ) := + Her_mono_of_mem (ramp_mem_Her_cut hp hτ.le) hx + have hfix : x*(cutInverse p τ*p)=x := Her_right_fixed_cutInverse hp hτ hxH + have he : x*c*k = (x*cutInverse p τ)*(p*c*k) := by + calc + x*c*k = (x*(cutInverse p τ*p))*c*k := by rw [hfix] + _ = _ := by simp only [mul_assoc] + rw [he] + calc + ‖(x*cutInverse p τ)*(p*c*k)‖ ≤ ‖x*cutInverse p τ‖*‖p*c*k‖ := norm_mul_le _ _ + _ ≤ (‖x‖*(1/τ))*(r*‖k‖) := by + apply mul_le_mul + · exact (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_left (norm_cutInverse_le hp hτ) (norm_nonneg x)) + · exact h k hk + · exact norm_nonneg _ + · positivity + _ = (r/τ)*‖x‖*‖k‖ := by ring + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Cutoffs.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Cutoffs.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9cb64318527cab181293d24def192974cbbeebf --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Cutoffs.lean @@ -0,0 +1,343 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.OrthogonalSlots + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +section MoreHer +variable [PartialOrder A] [StarOrderedRing A] + +omit [PartialOrder A] [StarOrderedRing A] in +lemma norm_left_remainder_sq {e z : A} (he : IsSelfAdjoint e) : + ‖z - e * z‖ ^ 2 = ‖twoSidedRemainder e (z * star z)‖ := by + rw [pow_two, ← CStarRing.norm_self_mul_star] + congr 1 + simp only [twoSidedRemainder, star_sub, star_mul, he.star_eq] + noncomm_ring + +omit [PartialOrder A] [StarOrderedRing A] in +lemma norm_right_remainder_sq {e z : A} (he : IsSelfAdjoint e) : + ‖z - z * e‖ ^ 2 = ‖twoSidedRemainder e (star z * z)‖ := by + rw [← norm_star (z - z * e), star_sub, star_mul, he.star_eq, + norm_left_remainder_sq he, star_star] + +lemma norm_left_remainder_sq_le {e z b : A} (he : IsSelfAdjoint e) + (hen : ‖e‖ ≤ 1) (hle : z * star z ≤ b) : + ‖z - e * z‖ ^ 2 ≤ 2 * ‖b - e * b‖ := by + rw [norm_left_remainder_sq he] + exact (CStarAlgebra.norm_le_norm_of_le_of_nonneg + (twoSidedRemainder_mono he hle) + (twoSidedRemainder_nonneg he (mul_star_self_nonneg z))).trans + (norm_twoSidedRemainder_le hen b) + +lemma norm_right_remainder_sq_le {e z b : A} (he : IsSelfAdjoint e) + (hen : ‖e‖ ≤ 1) (hle : star z * z ≤ b) : + ‖z - z * e‖ ^ 2 ≤ 2 * ‖b - e * b‖ := by + rw [norm_right_remainder_sq he] + exact (CStarAlgebra.norm_le_norm_of_le_of_nonneg + (twoSidedRemainder_mono he hle) + (twoSidedRemainder_nonneg he (star_mul_self_nonneg z))).trans + (norm_twoSidedRemainder_le hen b) + +lemma mem_Her_of_moduli {h z : A} (hl : z * star z ∈ Her h) + (hr : star z * z ∈ Her h) : z ∈ Her h := by + let b := z * star z + star z * z + have hb : 0 ≤ b := add_nonneg (mul_star_self_nonneg z) (star_mul_self_nonneg z) + have hbh : b ∈ Her h := (Her h).add_mem hl hr + have hbl : z * star z ≤ b := le_add_of_nonneg_right (star_mul_self_nonneg z) + have hbr : star z * z ≤ b := le_add_of_nonneg_left (mul_star_self_nonneg z) + have hzc : z ∈ closure (Her h : Set A) := by + rw [Metric.mem_closure_iff] + intro ε hε + obtain ⟨e, he, hesa, hen, hs⟩ := Her_exists_approx_unit hb + (show 0 < ε^2 / 8 by positivity) + have hδ : 2 * ‖b - e * b‖ < (ε / 2)^2 := by linarith + have hle : ‖z - e * z‖ < ε / 2 := by + exact (sq_lt_sq₀ (norm_nonneg _) (by positivity)).mp + ((norm_left_remainder_sq_le hesa hen hbl).trans_lt hδ) + have hre : ‖z - z * e‖ < ε / 2 := by + exact (sq_lt_sq₀ (norm_nonneg _) (by positivity)).mp + ((norm_right_remainder_sq_le hesa hen hbr).trans_lt hδ) + refine ⟨e * z * e, ?_, ?_⟩ + · change e * z * e ∈ Her h + simpa only [hesa.star_eq] using Her_sandwich (Her_mono_of_mem hbh he) z + · rw [dist_eq_norm] + have heq : z - e * z * e = (z - e * z) + e * (z - z * e) := by noncomm_ring + rw [heq] + calc + ‖(z - e * z) + e * (z - z * e)‖ ≤ ‖z - e * z‖ + ‖e * (z - z * e)‖ := norm_add_le _ _ + _ ≤ ‖z - e * z‖ + ‖e‖ * ‖z - z * e‖ := by gcongr; exact norm_mul_le _ _ + _ ≤ ‖z - e * z‖ + ‖z - z * e‖ := by nlinarith [norm_nonneg (z - z * e)] + _ < ε := by linarith + rwa [(isClosed_Her h).closure_eq] at hzc + +end MoreHer +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +section Ramps +variable [PartialOrder A] [StarOrderedRing A] + +lemma norm_mem_quasispectrum_of_nonneg {a : A} (ha : 0 ≤ a) : + ‖a‖ ∈ quasispectrum ℝ a := by + simpa using quasispectrum.algebraMap_mem ℝ + (NonUnitalIsometricContinuousFunctionalCalculus.isGreatest_quasispectrum a ha).1 + +def rampFn (l u t : ℝ) : ℝ := min 1 (max (t-l) 0 / (u-l)) + +lemma continuous_rampFn (l u : ℝ) : Continuous (rampFn l u) := + continuous_const.min (((continuous_id.sub continuous_const).max continuous_const).div_const _) + +lemma rampFn_nonneg {l u t : ℝ} (hlu : l ≤ u) : 0 ≤ rampFn l u t := + le_min (by norm_num) (div_nonneg (le_max_right _ _) (sub_nonneg.mpr hlu)) + +lemma rampFn_le_one (l u t : ℝ) : rampFn l u t ≤ 1 := min_le_left _ _ + +lemma rampFn_zero {l u t : ℝ} (ht : t ≤ l) : rampFn l u t = 0 := by + simp only [rampFn, max_eq_right (sub_nonpos.mpr ht), zero_div, min_eq_right (by norm_num : (0:ℝ) ≤ 1)] + +lemma rampFn_one {l u t : ℝ} (hlu : l < u) (ht : u ≤ t) : rampFn l u t = 1 := by + apply min_eq_left + apply (le_div_iff₀ (sub_pos.mpr hlu)).mpr + rw [one_mul, max_eq_left (sub_nonneg.mpr (hlu.le.trans ht))] + linarith + +def ramp (a : A) (l u : ℝ) : A := cfcₙ (rampFn l u) a + +lemma ramp_nonneg (a : A) {l u : ℝ} (hlu : l ≤ u) : 0 ≤ ramp a l u := + cfcₙ_nonneg (fun _ _ => rampFn_nonneg hlu) + +omit [PartialOrder A] [StarOrderedRing A] in +lemma norm_ramp_le_one (a : A) {l u : ℝ} (hlu : l ≤ u) : ‖ramp a l u‖ ≤ 1 := by + apply norm_cfcₙ_le + intro t _ + rw [Real.norm_eq_abs, abs_of_nonneg (rampFn_nonneg hlu)] + exact rampFn_le_one _ _ _ + +lemma ramp_mem_Her_cut {a : A} (ha : 0 ≤ a) {l u : ℝ} (hl : 0 ≤ l) : + ramp a l u ∈ Her (cut a l) := by + have hcomp : ramp a l u = cfcₙ (fun t : ℝ => min 1 (t / (u-l))) (cut a l) := by + unfold ramp cut + exact cfcₙ_comp (fun t : ℝ => min 1 (t / (u-l))) (fun t : ℝ => max (t-l) 0) a + (continuous_const.min (continuous_id.div_const _)).continuousOn (by norm_num) + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [max_eq_right (neg_nonpos.mpr hl)]) (.of_nonneg ha) + rw [hcomp] + exact cfcₙ_mem (𝕜' := ℂ) _ (self_mem_Her (cut_nonneg a l)) + +lemma norm_ramp_eq_one {a : A} (ha : 0 ≤ a) {l u : ℝ} (hl : 0 ≤ l) + (hlu : l < u) (hu : u ≤ ‖a‖) : ‖ramp a l u‖ = 1 := by + apply le_antisymm (norm_ramp_le_one a hlu.le) + have ht := norm_apply_le_norm_cfcₙ (rampFn l u) a + (norm_mem_quasispectrum_of_nonneg ha) (continuous_rampFn l u).continuousOn + (rampFn_zero hl) (.of_nonneg ha) + change 1 ≤ ‖cfcₙ (rampFn l u) a‖ + simpa only [rampFn_one hlu hu, norm_one] using ht + +lemma map_ramp {B : Type*} [NonUnitalCStarAlgebra B] [PartialOrder B] [StarOrderedRing B] + (π : A →⋆ₙₐ[ℂ] B) {a : A} (ha : 0 ≤ a) {l u : ℝ} (hl : 0 ≤ l) : + π (ramp a l u) = ramp (π a) l u := + π.map_cfcₙ (rampFn l u) a (continuous_rampFn l u).continuousOn (rampFn_zero hl) + (map_continuous π) (.of_nonneg ha) (.of_nonneg (map_nonneg π ha)) + +lemma map_cut {B : Type*} [NonUnitalCStarAlgebra B] [PartialOrder B] [StarOrderedRing B] + (π : A →⋆ₙₐ[ℂ] B) {a : A} (ha : 0 ≤ a) {l : ℝ} (hl : 0 ≤ l) : + π (cut a l) = cut (π a) l := + π.map_cfcₙ (fun t : ℝ => max (t-l) 0) a + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [max_eq_right (neg_nonpos.mpr hl)]) (map_continuous π) + (.of_nonneg ha) (.of_nonneg (map_nonneg π ha)) + +lemma cut_cut {a : A} (ha : 0 ≤ a) {l u : ℝ} (hl : 0 ≤ l) (hu : 0 ≤ u) : + cut (cut a l) u = cut a (l+u) := by + let f : ℝ → ℝ := fun t => max (t-l) 0 + let g : ℝ → ℝ := fun t => max (t-u) 0 + have hcomp := cfcₙ_comp g f a + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [g, max_eq_right (neg_nonpos.mpr hu)]) + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [f, max_eq_right (neg_nonpos.mpr hl)]) (.of_nonneg ha) + change cfcₙ g (cfcₙ f a) = _ + rw [← hcomp] + apply cfcₙ_congr + intro t _ + dsimp [f, g] + by_cases ht : l ≤ t + · rw [max_eq_left (sub_nonneg.mpr ht)] + congr 1 + ring + · rw [max_eq_right (by linarith : t-l ≤ 0), zero_sub, + max_eq_right (neg_nonpos.mpr hu), max_eq_right (by linarith : t-(l+u) ≤ 0)] + +lemma norm_sub_cut_le {a : A} (ha : 0 ≤ a) {l : ℝ} (hl : 0 ≤ l) : + ‖a - cut a l‖ ≤ l := by + conv_lhs => arg 1; lhs; rw [← cfcₙ_id ℝ a (.of_nonneg ha)] + rw [cut, ← cfcₙ_sub id (fun t : ℝ => max (t-l) 0) a continuousOn_id rfl + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [max_eq_right (neg_nonpos.mpr hl)])] + apply norm_cfcₙ_le + intro t ht + have ht0 : 0 ≤ t := quasispectrum_nonneg_of_nonneg a ha t ht + dsimp only [id_eq] + rw [Real.norm_eq_abs, abs_le] + constructor + · have hh : max (t-l) 0 ≤ t := max_le (by linarith) ht0 + linarith + · have hh := le_max_left (t-l) 0 + linarith + +omit [StarOrderedRing A] in +lemma ramp_mul_cut {a : A} (_ha : 0 ≤ a) {l u v : ℝ} (hl : 0 ≤ l) + (hlu : l < u) (huv : u ≤ v) : ramp a l u * cut a v = cut a v := by + have hv : 0 ≤ v := hl.trans (hlu.le.trans huv) + unfold ramp cut + rw [← cfcₙ_mul (rampFn l u) (fun t : ℝ => max (t-v) 0) a (continuous_rampFn l u).continuousOn (rampFn_zero hl) + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [max_eq_right (neg_nonpos.mpr hv)])] + apply cfcₙ_congr + intro t _ + dsimp only + by_cases ht : v ≤ t + · rw [rampFn_one hlu (huv.trans ht), one_mul] + · rw [max_eq_right (by linarith : t-v ≤ 0), mul_zero] + +end Ramps +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] + +lemma Her_map {B : Type*} [NonUnitalCStarAlgebra B] (π : A →⋆ₙₐ[ℂ] B) + {h k : A} (hk : k ∈ Her h) : π k ∈ Her (π h) := by + have hc : IsClosed {k : A | π k ∈ Her (π h)} := + (isClosed_Her (π h)).preimage (map_continuous π) + apply closure_minimal (s := Set.range (fun a : A => h * a * star h)) _ hc hk + rintro k ⟨a, rfl⟩ + change π (h * a * star h) ∈ Her (π h) + simpa only [map_mul, map_star] using sandwich_mem_Her (π h) (π a) + +lemma Her_fixed_left {h t : A} (ht : t * h = h) {k : A} (hk : k ∈ Her h) : t * k = k := by + have hc : IsClosed {k : A | t * k = k} := isClosed_eq (by fun_prop) continuous_id + apply closure_minimal (s := Set.range (fun a : A => h * a * star h)) _ hc hk + rintro k ⟨a, rfl⟩ + change t * (h * a * star h) = h * a * star h + simp only [← mul_assoc, ht] + +lemma Her_killed_left {h t : A} (ht : t * h = 0) {k : A} (hk : k ∈ Her h) : t * k = 0 := by + have hc : IsClosed {k : A | t * k = 0} := isClosed_eq (by fun_prop) continuous_const + apply closure_minimal (s := Set.range (fun a : A => h * a * star h)) _ hc hk + rintro k ⟨a, rfl⟩ + change t * (h * a * star h) = 0 + simp only [← mul_assoc, ht, zero_mul] + +lemma positive_kernel_factor [PartialOrder A] [StarOrderedRing A] {x Q z : A} (hx : 0 ≤ x) (hQ : IsSelfAdjoint Q) + (hz : Q * (x * Q * z) = 0) : x * Q * z = 0 := by + let s := CFC.sqrt x + have hs : IsSelfAdjoint s := .of_nonneg (CFC.sqrt_nonneg x) + have hss : s * s = x := CFC.sqrt_mul_sqrt_self x hx + have hzero : star (s * Q * z) * (s * Q * z) = 0 := by + rw [star_mul, star_mul, hs.star_eq, hQ.star_eq] + calc + star z * (Q * s) * (s * Q * z) = star z * (Q * ((s * s) * Q * z)) := by noncomm_ring + _ = 0 := by rw [hss, hz, mul_zero] + have hz' := (CStarRing.star_mul_self_eq_zero_iff _).mp hzero + rw [← hss, mul_assoc s s, mul_assoc s, hz', mul_zero] + +section UnitalCutBounds +variable {B : Type*} [CStarAlgebra B] [PartialOrder B] [StarOrderedRing B] + +omit [PartialOrder B] [StarOrderedRing B] in +lemma cut_eq_cfc (d : B) {ε : ℝ} (hε : 0 ≤ ε) : + cut d ε = cfc (fun t : ℝ => max (t - ε) 0) d := by + unfold cut + apply cfcₙ_eq_cfc + · exact ((continuous_id.sub continuous_const).max continuous_const).continuousOn + · simp [max_eq_right (neg_nonpos.mpr hε)] + +lemma continuous_reciprocalCutoff {η : ℝ} (hη : 0 < η) : + Continuous (fun t : ℝ => (max t η)⁻¹) := by + apply Continuous.inv₀ (continuous_id.max continuous_const) + intro t + exact ne_of_gt (hη.trans_le (le_max_right t η)) + +omit [PartialOrder B] [StarOrderedRing B] in +lemma cutoffHer_factor {x Q : B} (hx : IsSelfAdjoint x) (hQ : IsSelfAdjoint Q) + {η : ℝ} (hη : 0 < η) {k : B} (hk : k ∈ Her (cut (x * Q * Q * x) η)) : + ∃ z : B, k = x * Q * z := by + let U := x * Q * Q * x + let f : ℝ → ℝ := fun t => (max t η)⁻¹ + have hU : IsSelfAdjoint U := by + change star (x * Q * Q * x) = x * Q * Q * x + simp only [star_mul, hx.star_eq, hQ.star_eq] + noncomm_ring + have hf : Continuous f := continuous_reciprocalCutoff hη + have hg : Continuous (fun t : ℝ => max (t - η) 0) := + (continuous_id.sub continuous_const).max continuous_const + have hfix : (U * cfc f U) * cut U η = cut U η := by + rw [cut_eq_cfc U hη.le] + conv_lhs => lhs; lhs; rw [← cfc_id ℝ U hU] + rw [← cfc_mul _ _ U continuousOn_id hf.continuousOn] + simp only [id_eq] + have hif : ContinuousOn (fun t : ℝ => t * f t) (spectrum ℝ U) := (continuous_id.mul hf).continuousOn + rw [← cfc_mul _ _ U hif hg.continuousOn] + apply cfc_congr + intro t _ + dsimp only + by_cases ht : η ≤ t + · simp only [f, max_eq_left ht, mul_inv_cancel₀ (ne_of_gt (hη.trans_le ht)), one_mul] + · rw [max_eq_right (by linarith : t - η ≤ 0), mul_zero] + have hfixk := Her_fixed_left hfix hk + refine ⟨Q * x * cfc f U * k, ?_⟩ + calc + k = (U * cfc f U) * k := hfixk.symm + _ = x * Q * (Q * x * cfc f U * k) := by dsimp [U]; noncomm_ring + +lemma selfConsistent_cutoff_bound {x d : B} (hx : 0 ≤ x) (hd : 0 ≤ d) + {η h : ℝ} (hη : 0 < η) (hh : 0 ≤ h) + (hmem : d ∈ Her (cut (x * cfc (fun t : ℝ => max (h - t) 0) d * + cfc (fun t : ℝ => max (h - t) 0) d * x) η)) : + d ≤ h • (1 : B) := by + let Q := cfc (fun t : ℝ => max (h - t) 0) d + have hQ : IsSelfAdjoint Q := IsSelfAdjoint.cfc + have hq : Continuous (fun t : ℝ => max (h - t) 0) := + (continuous_const.sub continuous_id).max continuous_const + have hk : Continuous (fun t : ℝ => max (t - h) 0) := + (continuous_id.sub continuous_const).max continuous_const + have hkill : Q * cut d h = 0 := by + rw [cut_eq_cfc d hh] + change cfc (fun t : ℝ => max (h-t) 0) d * cfc (fun t : ℝ => max (t-h) 0) d = 0 + rw [← cfc_mul _ _ d hq.continuousOn hk.continuousOn, ← cfc_zero d (R := ℝ)] + apply cfc_congr + intro t _ + by_cases ht : h ≤ t + · simp [max_eq_right (by linarith : h - t ≤ 0)] + · simp [max_eq_right (by linarith : t - h ≤ 0)] + have hcutmem : cut d h ∈ Her (cut (x * Q * Q * x) η) := + Her_mono_of_mem hmem (cut_mem_Her hd h) + obtain ⟨z, hz⟩ := cutoffHer_factor (.of_nonneg hx) hQ hη hcutmem + have hcutzero : cut d h = 0 := by + rw [hz] + exact positive_kernel_factor hx hQ (by rwa [← hz]) + rw [cut_eq_cfc d hh, ← cfc_zero d (R := ℝ)] at hcutzero + have hzspec := eqOn_of_cfc_eq_cfc (ha := IsSelfAdjoint.of_nonneg hd) hcutzero + rw [← Algebra.algebraMap_eq_smul_one, ← cfc_const h d] + conv_lhs => rw [← cfc_id ℝ d (.of_nonneg hd)] + apply (cfc_le_iff _ _ d continuousOn_id continuousOn_const (.of_nonneg hd)).mpr + intro t ht + have hm : max (t - h) 0 = 0 := hzspec ht + have := le_max_left (t - h) 0 + dsimp only [id_eq] + linarith + +end UnitalCutBounds + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Defect.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Defect.lean new file mode 100644 index 0000000000000000000000000000000000000000..d934b671b85d9377b94020344d1658393bffdd70 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Defect.lean @@ -0,0 +1,275 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.FourChoices + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance deficiencyOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance deficiencyStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma deficiency_eq_sub {d : A} (hd : 0 ≤ d) (hb : d ≤ (1/2 : ℝ) • (1 : A)) : + deficiency d = (1/2 : ℝ) • (1 : A) - d := by + have hdsa : IsSelfAdjoint d := .of_nonneg hd + have hb' : cfc (fun t : ℝ => t) d ≤ cfc (fun _ : ℝ => (1/2 : ℝ)) d := by + rw [cfc_id' ℝ d hdsa, cfc_const (1/2 : ℝ) d hdsa, Algebra.algebraMap_eq_smul_one] + exact hb + have hs := (cfc_le_iff _ _ d continuousOn_id continuousOn_const hdsa).mp hb' + calc + deficiency d = cfc (fun t : ℝ => (1/2 : ℝ)-t) d := by + apply cfc_congr + intro t ht + exact max_eq_left (sub_nonneg.mpr (hs t ht)) + _ = cfc (fun _ : ℝ => (1/2 : ℝ)) d - cfc (fun t : ℝ => t) d := + cfc_sub _ _ d continuousOn_const continuousOn_id + _ = (1/2 : ℝ) • (1 : A) - d := by + rw [cfc_const (1/2 : ℝ) d hdsa, cfc_id' ℝ d hdsa, Algebra.algebraMap_eq_smul_one] + +lemma sandwich_zero_eigen {x d : A} (hx : 0 ≤ x) (hd : 0 ≤ d) + (hdle : d ≤ (1/2 : ℝ) • (1 : A)) + (hU : x * deficiency d * deficiency d * x = 0) : d * x = (1/2 : ℝ) • x := by + have hQx : deficiency d * x = 0 := by + apply (CStarRing.star_mul_self_eq_zero_iff _).mp + simpa only [star_mul, IsSelfAdjoint.of_nonneg hx |>.star_eq, + deficiency_selfAdjoint d |>.star_eq, mul_assoc] using hU + rw [deficiency_eq_sub hd hdle, sub_mul, smul_mul_assoc, one_mul] at hQx + exact (sub_eq_zero.mp hQx).symm + +lemma Her_eigen_left {x d k : A} {h : ℝ} (hx : d*x=h•x) (hk : k ∈ Her x) : + d*k=h•k := by + have hz : (d-h • (1:A))*x=0 := by + simp only [sub_mul, smul_mul_assoc, one_mul, hx, sub_self] + have := Her_killed_left hz hk + simpa only [sub_mul, smul_mul_assoc, one_mul, sub_eq_zero] using this + +lemma firstH_mem_firstX {X : A} (hX : 0 ≤ X) : firstH X ∈ Her (firstX X) := + Her_mono_of_mem (cut_mem_cutHer hX (by norm_num : (0:ℝ) ≤ 1/16) + (by norm_num : (1/16:ℝ) ≤ 3/32)) (ramp_mem_Her_cut hX (by norm_num)) + +lemma firstK_fixes_H {X : A} (hX : 0 ≤ X) : firstK X * firstH X = firstH X := + Her_fixed_left (ramp_mul_cut hX (by norm_num : (0:ℝ) ≤ 3/64) + (by norm_num : (3/64:ℝ) < 1/16) le_rfl) (firstH_mem_firstX hX) + +lemma firstR_fixed_left {X B : A} (hX : 0 ≤ X) (hB : star B * B ∈ Her (firstV X)) : + firstH X * firstR X B = firstR X B := by + have hstar : firstH X * star B = star B := by + apply fixed_left_of_modulus + simp only [star_star] + exact Her_fixed_left (firstH_fixes_V hX) hB + simp only [firstR, mul_smul_comm, ← mul_assoc, hstar] + +lemma firstR_inner {X B C : A} (hmod : B * star C = B * star B) + (hDH : B * star B * firstH X = (1/2 : ℝ) • firstH X) : + star (firstR X B) * firstR X C = firstH X * firstH X := by + have hH : star (firstH X) = firstH X := (IsSelfAdjoint.of_nonneg (ramp_nonneg X (by norm_num : (3/32:ℝ) ≤ 1/8))).star_eq + simp only [firstR, star_smul, star_trivial, star_mul, hH, star_star, + smul_mul_smul] + rw [Real.mul_self_sqrt (by norm_num : (0:ℝ) ≤ 2)] + calc + (2:ℝ) • ((firstH X * B) * (star C * firstH X)) = + (2:ℝ) • (firstH X * ((B * star C) * firstH X)) := by congr 1; noncomm_ring + _ = firstH X * firstH X := by rw [hmod, hDH, mul_smul_comm, smul_smul]; norm_num + +lemma firstR_orthogonal {X B C : A} (hcross : B * star C = 0) : + star (firstR X B) * firstR X C = 0 := by + simp only [firstR, star_smul, star_trivial, star_mul, star_star, smul_mul_smul] + calc + _ = (Real.sqrt 2 * Real.sqrt 2) • (star (firstH X) * (B * star C) * firstH X) := by + congr 1; noncomm_ring + _ = 0 := by rw [hcross, mul_zero, zero_mul, smul_zero] + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance scalingDefectOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance scalingDefectStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma ramp_projection {P : A} (hP : IsStarProjection P) {l u : ℝ} (hl : 0 ≤ l) + (hlu : l < u) (hu : u ≤ 1) : ramp P l u = P := by + conv_rhs => rw [← cfcₙ_id ℝ P hP.isSelfAdjoint] + apply cfcₙ_congr + intro t ht + rcases Set.mem_insert_iff.mp (hP.isIdempotentElem.quasispectrum_subset ℝ ht) with ht | ht + · subst t + exact rampFn_zero hl + · have ht : t = 1 := Set.mem_singleton_iff.mp ht + subst t + exact rampFn_one hlu hu + +lemma cut_projection {P : A} (hP : IsStarProjection P) {l : ℝ} (hl : 0 ≤ l) (hl1 : l ≤ 1) : + cut P l = (1-l) • P := by + conv_rhs => rw [← cfcₙ_id ℝ P hP.isSelfAdjoint] + rw [← cfcₙ_smul (1-l) id P continuousOn_id rfl] + apply cfcₙ_congr + intro t ht + rcases Set.mem_insert_iff.mp (hP.isIdempotentElem.quasispectrum_subset ℝ ht) with ht | ht + · subst t + simp [max_eq_right (neg_nonpos.mpr hl)] + · have ht : t = 1 := Set.mem_singleton_iff.mp ht + subst t + simp [max_eq_left (sub_nonneg.mpr hl1)] + +lemma scalingDefect_expansion {H r : A} (hH : IsSelfAdjoint H) (hnorm : ‖H‖ ≤ 1) : + scalingDefect H r = H*H-r*star r-r*scalingComplement H-scalingComplement H*star r := by + have hb := scalingComplement_mul_self hH hnorm + simp only [scalingDefect, scalingIsometry, star_add, scalingComplement_selfAdjoint H |>.star_eq, + add_mul, mul_add] + rw [hb] + noncomm_ring + +lemma scalingDefect_compress {H K r : A} (hH : IsSelfAdjoint H) (hK : IsSelfAdjoint K) + (hnorm : ‖H‖ ≤ 1) (hKH : K*H=H) (hHr : H*r=r) (hrK : r*K=r) : + K * scalingDefect H r * K = scalingDefect H r := by + have hHK : H*K=H := by + simpa only [star_mul, hH.star_eq, hK.star_eq] using congrArg star hKH + have hKr : K*r=r := by rw [← hHr, ← mul_assoc, hKH] + have hsrK : star r*K=star r := by + simpa only [star_mul, hK.star_eq, star_star] using congrArg star hKr + have hKsr : K*star r=star r := by + simpa only [star_mul, hK.star_eq, star_star] using congrArg star hrK + have hcomm : Commute K H := (show K*H=H*K by rw [hKH,hHK]) + have hbcomm : Commute K (scalingComplement H) := by + exact ((Commute.one_right K).sub_right (hcomm.mul_right hcomm)).symm.cfcₙ_nnreal NNReal.sqrt |>.symm + have hleft : K * scalingDefect H r = scalingDefect H r := by + rw [scalingDefect_expansion hH hnorm] + simp only [mul_sub, ← mul_assoc, hKH, hKr] + rw [hbcomm.eq, mul_assoc, hKsr] + have hright : scalingDefect H r * K = scalingDefect H r := by + simpa only [star_mul, hK.star_eq, show star (scalingDefect H r) = scalingDefect H r from + ((IsSelfAdjoint.one A).sub (IsSelfAdjoint.mul_star_self _)).star_eq] using congrArg star hleft + rw [hleft, hright] + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance fourFixedOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance fourFixedStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +theorem four_fixed_impossible {X : A} (hX : 0 ≤ X) (B : Fin 4 → A) + (hV : firstV X ≠ 0) + (hD : B 0 * star (B 0) ≤ (1/2 : ℝ) • (1 : A)) + (hmod : B 1 * star (B 1) = B 0 * star (B 0)) + (hcross : B 0 * star (B 1) = 0) + (hHB₀ : firstH X * star (B 0) = star (B 0)) + (hHB₁ : firstH X * star (B 1) = star (B 1)) + (hU : firstU X (B 0) = 0) + (hD₃ : B 2 * star (B 2) ≤ (1/2 : ℝ) • (1 : A)) + (hc₃ : star (B 2) * B 3 = 0) + (hm₃ : star (B 2) * B 2 = star (B 3) * B 3) + (hR : lastR X (B 0) (B 2) = 0) + (hs₃ : ramp (prospectiveDefect X (B 0)) 0 (1/2) * B 3 = B 3) : False := by + have hH : IsSelfAdjoint (firstH X) := .of_nonneg (ramp_nonneg X (by norm_num)) + have hK : IsSelfAdjoint (firstK X) := .of_nonneg (ramp_nonneg X (by norm_num)) + have hHnorm : ‖firstH X‖ ≤ 1 := norm_ramp_le_one _ (by norm_num) + have hHne : firstH X ≠ 0 := by + intro hz + apply hV + simpa only [hz, zero_mul] using (firstH_fixes_V hX).symm + have hDx : (B 0 * star (B 0)) * firstX X = (1/2 : ℝ) • firstX X := + sandwich_zero_eigen (cut_nonneg X _) (mul_star_self_nonneg _) hD hU + have hDH : (B 0 * star (B 0)) * firstH X = (1/2 : ℝ) • firstH X := + Her_eigen_left hDx (firstH_mem_firstX hX) + have hρ₀ : star (firstR X (B 0)) * firstR X (B 0) = firstH X * firstH X := + firstR_inner rfl hDH + have hρ₁ : star (firstR X (B 1)) * firstR X (B 1) = firstH X * firstH X := + firstR_inner rfl (hmod ▸ hDH) + have hρc : star (firstR X (B 0)) * firstR X (B 1) = 0 := firstR_orthogonal hcross + have hHr₀ : firstH X * firstR X (B 0) = firstR X (B 0) := by + simp only [firstR, mul_smul_comm, ← mul_assoc, hHB₀] + have hHr₁ : firstH X * firstR X (B 1) = firstR X (B 1) := by + simp only [firstR, mul_smul_comm, ← mul_assoc, hHB₁] + let P := scalingDefect (firstH X) (firstR X (B 0)) + have hP : IsStarProjection P := scalingDefect_projection hH hHnorm hHr₀ hρ₀ + have hPne : P ≠ 0 := scalingDefect_ne_zero hH hHnorm hHne hHr₁ hρc hρ₁ + have hKH : firstK X * firstH X = firstH X := firstK_fixes_H hX + have hHK : firstH X * firstK X = firstH X := by + simpa only [star_mul, hK.star_eq, hH.star_eq] using congrArg star hKH + have hrK : firstR X (B 0) * firstK X = firstR X (B 0) := by + simp only [firstR, smul_mul_assoc, mul_assoc, hHK] + have hP₀ : prospectiveDefect X (B 0) = P := by + change ramp (firstK X * P * firstK X) 0 1 = P + rw [scalingDefect_compress hH hK hHnorm hKH hHr₀ hrK] + exact ramp_projection hP (by norm_num) (by norm_num) le_rfl + have hx' : lastX X (B 0) = (1/2 : ℝ) • P := by + simp only [lastX, hP₀, cut_projection hP (by norm_num : (0:ℝ) ≤ 1/2) + (by norm_num : (1/2:ℝ) ≤ 1)] + norm_num + have hD₃x : (B 2 * star (B 2)) * lastX X (B 0) = (1/2 : ℝ) • lastX X (B 0) := + sandwich_zero_eigen (lastX_nonneg X _) (mul_star_self_nonneg _) hD₃ hR + have hD₃P : (B 2 * star (B 2)) * P = (1/2 : ℝ) • P := by + rw [hx', mul_smul_comm, smul_comm] at hD₃x + exact (smul_right_injective A (by norm_num : (1/2 : ℝ) ≠ 0)) hD₃x + have hPB : P * B 3 = B 3 := by + rw [hP₀, ramp_projection hP (by norm_num) (by norm_num) (by norm_num)] at hs₃ + exact hs₃ + exact hPne (last_pair_kills_defect (by norm_num : (1/2 : ℝ) ≠ 0) hPB hc₃ hm₃ hD₃P) + +end MainGap + +namespace MainGap +variable {A D : Type*} [CStarAlgebra A] [CStarAlgebra D] +local instance defectSandwichOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance defectSandwichStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance representedDefectOrder : PartialOrder D := CStarAlgebra.spectralOrder D +local instance representedDefectStarOrder : StarOrderedRing D := CStarAlgebra.spectralOrderedRing D + +lemma firstSandwich_single_le {U V w : A} (hV : 0 ≤ V) (η : ℝ) {E : Finset A} + (hw : w ∈ E) : + (cut U η * w * CFC.sqrt V) * star (cut U η * w * CFC.sqrt V) ≤ + firstSandwich U V η E := by + have hsum : w * V * star w ≤ ∑ v ∈ E, v * V * star v := + Finset.single_le_sum (fun v _ => star_right_conjugate_nonneg hV v) hw + have h := conjugate_le_conjugate_of_nonneg hsum (cut_nonneg U η) + have heq : (cut U η * w * CFC.sqrt V) * star (cut U η * w * CFC.sqrt V) = + cut U η * (w * V * star w) * cut U η := by + simp only [star_mul, IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg V) |>.star_eq, + IsSelfAdjoint.of_nonneg (cut_nonneg U η) |>.star_eq] + calc + _ = cut U η * w * (CFC.sqrt V * CFC.sqrt V) * star w * cut U η := by noncomm_ring + _ = _ := by rw [CFC.sqrt_mul_sqrt_self V hV]; noncomm_ring + rw [heq] + exact h + +lemma represented_single_sq_le (π : A →⋆ₐ[ℂ] D) {U V w : A} (hV : 0 ≤ V) + (η : ℝ) {E : Finset A} (hw : w ∈ E) : + ‖π (cut U η * w * CFC.sqrt V)‖ ^ 2 ≤ ‖π (firstSandwich U V η E)‖ := by + have h := OrderHomClass.mono π (firstSandwich_single_le (U := U) hV η hw) + rw [map_mul, map_star] at h + simpa only [CStarRing.norm_self_mul_star, sq] using + CStarAlgebra.norm_le_norm_of_le_of_nonneg h (mul_star_self_nonneg _) + +lemma represented_mixed_estimate (π : A →⋆ₐ[ℂ] D) {U V w : A} (hU : 0 ≤ U) (hV : 0 ≤ V) + {η : ℝ} (hη : 0 < η) {E : Finset A} (hw : w ∈ E) + (hD : ‖π (firstSandwich U V η E)‖ ≤ 2*η) : + ‖π (U*w*V)‖ ≤ Real.sqrt (2*η) * ‖CFC.sqrt V‖ + η*‖w‖*‖V‖ := by + have hr : ‖π (cut U η * w * CFC.sqrt V)‖ ≤ Real.sqrt (2*η) := by + exact (Real.le_sqrt (norm_nonneg _) (by positivity)).mpr + ((represented_single_sq_le π hV η hw).trans hD) + have hsplit : U*w*V = (cut U η * w * CFC.sqrt V) * CFC.sqrt V + + (U-cut U η)*w*V := by + rw [mul_assoc (cut U η * w), CFC.sqrt_mul_sqrt_self V hV] + noncomm_ring + rw [hsplit, map_add] + apply norm_add_le _ _ |>.trans + apply add_le_add + · rw [map_mul] + exact (norm_mul_le _ _).trans (mul_le_mul hr (NonUnitalStarAlgHom.norm_apply_le π _) (norm_nonneg _) (by positivity)) + · rw [map_mul, map_mul] + calc + ‖(π (U-cut U η) * π w) * π V‖ ≤ ‖π (U-cut U η)‖ * ‖π w‖ * ‖π V‖ := + (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_right (norm_mul_le _ _) (norm_nonneg _)) + _ ≤ η*‖w‖*‖V‖ := mul_le_mul + (mul_le_mul ((NonUnitalStarAlgHom.norm_apply_le π _).trans (norm_sub_cut_le hU hη.le)) + (NonUnitalStarAlgHom.norm_apply_le π w) (norm_nonneg _) hη.le) + (NonUnitalStarAlgHom.norm_apply_le π V) (norm_nonneg _) (by positivity) + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Diagonalization.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Diagonalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6c131aa1410d2ec1816fd1ab0fd875cd041919f --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Diagonalization.lean @@ -0,0 +1,106 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Signal + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance boundedDiagonalizationPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance boundedDiagonalizationStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +theorem bounded_diagonalization (hP : PropertyP A) {a b : A} (ha : 0 ≤ a) (hb : 0 ≤ b) + (han : ‖a‖ ≤ 1) (hbn : ‖b‖ ≤ 1) (c : A) {δ ρ ζ : ℝ} + (hδ : 0 < δ) (hδhalf : δ < 1/2) (hρ : 0 < ρ) (hρδ : ρ ≤ 2*δ) (hζ : 0 < ζ) : + ∃ s t : A, ‖star s*a*s-a‖ < 2*δ+ρ ∧ ‖star t*b*t-b‖ < 2*δ+ρ ∧ + ‖star s*c*t‖ < ζ ∧ ‖s‖ ≤ Real.sqrt δ⁻¹ ∧ ‖t‖ ≤ Real.sqrt δ⁻¹ := by + let M := max 1 ‖c‖ + have hM1 : 1 ≤ M := le_max_left _ _ + have hM : 0 < M := lt_of_lt_of_le zero_lt_one hM1 + have hcn : ‖M⁻¹ • c‖ ≤ 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hM)] + calc M⁻¹ * ‖c‖ ≤ M⁻¹ * M := mul_le_mul_of_nonneg_left (le_max_right _ _) (inv_nonneg.mpr hM.le) + _ = 1 := inv_mul_cancel₀ hM.ne' + obtain ⟨p,q,κ,hp0,hpn,hpH,hq0,hqn,hqH,hκ0,hκζ,hcomp,hps,hqs⟩ := + iterated_separation hP (ramp_nonneg a (by linarith : δ ≤ 2*δ)) + (norm_ramp_le_one a (by linarith : δ ≤ 2*δ)) + (ramp_nonneg b (by linarith : δ ≤ 2*δ)) + (norm_ramp_le_one b (by linarith : δ ≤ 2*δ)) hcn + (by positivity : 0 < δ*ζ/M) + obtain ⟨w,hw,hsn⟩ := signal_coefficient hP ha han hδ hδhalf hρ hρδ hpH hps + obtain ⟨z,hz,htn⟩ := signal_coefficient hP hb hbn hδ hδhalf hρ hρδ hqH hqs + refine ⟨p*w,q*z,hw,hz,?_,hsn,htn⟩ + have hc : HerCompression p q c (M*κ) := by + intro x hx y hy + have hh := hcomp x hx y hy + rw [mul_smul_comm, smul_mul_assoc, norm_smul, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hM)] at hh + have hh' := mul_le_mul_of_nonneg_left hh hM.le + calc ‖x*c*y‖ = M * (M⁻¹ * ‖x*c*y‖) := by rw [← mul_assoc, mul_inv_cancel₀ hM.ne', one_mul] + _ ≤ M*(κ*‖x‖*‖y‖) := hh' + _ = (M*κ)*‖x‖*‖y‖ := by ring + have hprod : ‖p*w‖*‖q*z‖ ≤ δ⁻¹ := by + calc ‖p*w‖*‖q*z‖ ≤ Real.sqrt δ⁻¹ * Real.sqrt δ⁻¹ := + mul_le_mul hsn htn (norm_nonneg _) (Real.sqrt_nonneg _) + _ = δ⁻¹ := Real.mul_self_sqrt (inv_nonneg.mpr hδ.le) + calc + ‖star (p*w)*c*(q*z)‖ ≤ (M*κ)*‖p*w‖*‖q*z‖ := + HerCompression.right_products (mul_nonneg hM.le hκ0) hp0 hq0 hc w z + _ = (M*κ)*(‖p*w‖*‖q*z‖) := by ring + _ ≤ (M*κ)*δ⁻¹ := mul_le_mul_of_nonneg_left hprod (mul_nonneg hM.le hκ0) + _ < ζ := by + rw [← div_eq_mul_inv] + apply (div_lt_iff₀ hδ).mpr + have hh := (lt_div_iff₀ hM).mp hκζ + nlinarith + +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance diagonalizationPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance diagonalizationStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +theorem individual_to_strong (hP : PropertyP A) : UnrestrictedDiagonalization A := by + intro a b ha hb c ε hε + let M := max 1 (max ‖a‖ ‖b‖) + have hM1 : 1 ≤ M := le_max_left _ _ + have hM : 0 < M := lt_of_lt_of_le zero_lt_one hM1 + have haM : ‖a‖ ≤ M := (le_max_left _ _).trans (le_max_right _ _) + have hbM : ‖b‖ ≤ M := (le_max_right _ _).trans (le_max_right _ _) + let δ := min (1/4 : ℝ) (ε/(8*M)) + have hδ : 0 < δ := lt_min (by norm_num) (div_pos hε (mul_pos (by norm_num) hM)) + have hδhalf : δ < 1/2 := (min_le_left _ _).trans_lt (by norm_num) + have hsmall : M*(2*δ+δ) < ε := by + have hh : δ ≤ ε/(8*M) := min_le_right _ _ + have hh' := (le_div_iff₀ (by positivity : 0 < 8*M)).mp hh + nlinarith + have hn {x : A} (hx : ‖x‖ ≤ M) : ‖M⁻¹ • x‖ ≤ 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hM)] + calc M⁻¹*‖x‖ ≤ M⁻¹*M := mul_le_mul_of_nonneg_left hx (inv_nonneg.mpr hM.le) + _ = 1 := inv_mul_cancel₀ hM.ne' + obtain ⟨s,t,hs,ht,hc,hsn,htn⟩ := bounded_diagonalization hP + (smul_nonneg (inv_nonneg.mpr hM.le) ha) (smul_nonneg (inv_nonneg.mpr hM.le) hb) + (hn haM) (hn hbM) c hδ hδhalf hδ (by linarith : δ ≤ 2*δ) hε + have hscale (x r : A) : M • (star r*(M⁻¹ • x)*r-(M⁻¹ • x)) = star r*x*r-x := by + simp only [mul_smul_comm, smul_mul_assoc, smul_sub, smul_smul, + mul_inv_cancel₀ hM.ne', one_smul] + refine ⟨s,t,?_,?_,hc⟩ + · rw [← hscale a s, norm_smul, Real.norm_eq_abs, abs_of_pos hM] + exact (mul_lt_mul_of_pos_left hs hM).trans hsmall + · rw [← hscale b t, norm_smul, Real.norm_eq_abs, abs_of_pos hM] + exact (mul_lt_mul_of_pos_left ht hM).trans hsmall + +theorem individual_to_strong_spi (hP : PropertyP A) : StronglyPurelyInfinite A := by + intro x y hx hy ε hε + exact individual_to_strong hP (x*x) (y*y) + (by simpa only [hx.isSelfAdjoint.star_eq] using star_mul_self_nonneg x) + (by simpa only [hy.isSelfAdjoint.star_eq] using star_mul_self_nonneg y) (x*y) ε hε + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/FourChoices.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/FourChoices.lean new file mode 100644 index 0000000000000000000000000000000000000000..960ba81f1c69579ccfbcbdc5d2b01c99ae9b5d7b --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/FourChoices.lean @@ -0,0 +1,266 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.ChoicePairs + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance fourChoicesPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance fourChoicesStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +theorem finite_four_choices {X : A} (hX : 0 ≤ X) (B : Fin 4 → A) + (hp : ∀ z : A, 0 ≤ z → z ∈ fourHer X → ProperlyInfinite z) + (E : Finset A) {η : ℝ} (hη : 0 < η) : + ∃ T : Fin 4 → A, + (∀ i, ‖T i‖ ≤ 1) ∧ (∀ i, T i ∈ fourHer X) ∧ + T 0 * star (T 0) = ramp (firstSandwich (firstU X (B 0)) (firstV X) η E) η (2*η) ∧ + T 1 * star (T 1) = T 0 * star (T 0) ∧ T 0 * star (T 1) = 0 ∧ + star (T 0) * T 0 ∈ Her (firstV X) ∧ star (T 1) * T 1 ∈ Her (firstV X) ∧ + star (T 2) * T 3 = 0 ∧ star (T 2) * T 2 = star (T 3) * T 3 ∧ + T 2 * star (T 2) ∈ Her (cut (lastR X (B 0) (B 2)) η) ∧ + T 3 * star (T 3) ∈ Her (cut (lastR X (B 0) (B 2)) η) ∧ + (∀ {D : Type*} [NonUnitalCStarAlgebra D] (π : A →⋆ₙₐ[ℂ] D), + 4*η ≤ ‖π (lastR X (B 0) (B 2))‖ → ‖π (T 2)‖ = 1) := by + let U := firstU X (B 0) + let V := firstV X + let R := lastR X (B 0) (B 2) + let D₀ := firstSandwich U V η E + have hV : 0 ≤ V := cut_nonneg X _ + have hVk : V ∈ fourHer X := firstV_mem hX + have hDk : D₀ ∈ fourHer X := Her_mono_of_mem (firstU_mem hX (B 0)) + (Her_mono_of_mem (cut_mem_Her (firstU_nonneg X (B 0)) η) (firstSandwich_mem U V η E)) + obtain ⟨T₀, hT₀norm, hT₀mem, hT₀mod, hT₀outer⟩ := + first_pair_choice (firstSandwich_nonneg hV η E) hV + (firstSandwich_two_cuntzLE (hp V hV hVk) η E) hDk hVk hη + obtain ⟨T₂, hT₂norm, hT₂mem, hT₂mod, hT₂outer, hT₂rep⟩ := + last_pair_choice (lastR_nonneg X (B 0) (B 2)) (lastR_mem hX _ _) hη + (hp (cut R η) (cut_nonneg R η) + (Her_mono_of_mem (lastR_mem hX _ _) (cut_mem_Her (lastR_nonneg X (B 0) (B 2)) η))) + refine ⟨![T₀ 0, T₀ 1, T₂ 0, T₂ 1], ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro i; fin_cases i <;> first | exact hT₀norm _ | exact hT₂norm _ + · intro i; fin_cases i <;> first | exact hT₀mem _ | exact hT₂mem _ + · simpa using hT₀mod 0 0 + · simpa using (hT₀mod 1 1).trans (hT₀mod 0 0).symm + · simpa using hT₀mod 0 1 + · exact hT₀outer 0 0 + · exact hT₀outer 1 1 + · simpa using hT₂mod 0 1 + · simpa using (hT₂mod 0 0).trans (hT₂mod 1 1).symm + · exact hT₂outer 0 0 + · exact hT₂outer 1 1 + · intro D _ π hR + exact hT₂rep π hR 0 + +end MainGap + +namespace MainGap +variable {A D : Type*} [CStarAlgebra A] [CStarAlgebra D] +local instance fourChoicesMapDomainOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance fourChoicesMapDomainStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance fourChoicesMapCodomainOrder : PartialOrder D := CStarAlgebra.spectralOrder D +local instance fourChoicesMapCodomainStarOrder : StarOrderedRing D := CStarAlgebra.spectralOrderedRing D +variable (π : A →⋆ₐ[ℂ] D) + +lemma map_cut_sa {a : A} (ha : IsSelfAdjoint a) {l : ℝ} (hl : 0 ≤ l) : + π (cut a l) = cut (π a) l := + π.toNonUnitalStarAlgHom.map_cfcₙ (fun t : ℝ => max (t-l) 0) a + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + (by simp [max_eq_right (neg_nonpos.mpr hl)]) (map_continuous π) ha (ha.map π) + +lemma map_ramp_sa {a : A} (ha : IsSelfAdjoint a) {l u : ℝ} (hl : 0 ≤ l) : + π (ramp a l u) = ramp (π a) l u := + π.toNonUnitalStarAlgHom.map_cfcₙ (rampFn l u) a + (continuous_rampFn l u).continuousOn (rampFn_zero hl) + (map_continuous π) ha (ha.map π) + +lemma map_deficiency {d : A} (hd : IsSelfAdjoint d) : + π (deficiency d) = deficiency (π d) := + π.map_cfc (fun t : ℝ => max (1/2-t) 0) d + ((continuous_const.sub continuous_id).max continuous_const).continuousOn + (map_continuous π) hd (hd.map π) + +lemma map_sqrt {a : A} (ha : 0 ≤ a) : π (CFC.sqrt a) = CFC.sqrt (π a) := + π.toNonUnitalStarAlgHom.map_cfcₙ NNReal.sqrt a (by fun_prop) (by simp) + (map_continuous π) ha (map_nonneg π ha) + +lemma map_firstX {X : A} (hX : IsSelfAdjoint X) : π (firstX X) = firstX (π X) := + map_cut_sa π hX (by norm_num) +lemma map_firstV {X : A} (hX : IsSelfAdjoint X) : π (firstV X) = firstV (π X) := + map_cut_sa π hX (by norm_num) +lemma map_firstH {X : A} (hX : IsSelfAdjoint X) : π (firstH X) = firstH (π X) := + map_ramp_sa π hX (by norm_num) +lemma map_firstK {X : A} (hX : IsSelfAdjoint X) : π (firstK X) = firstK (π X) := + map_ramp_sa π hX (by norm_num) + +lemma map_firstU {X : A} (hX : IsSelfAdjoint X) (B : A) : + π (firstU X B) = firstU (π X) (π B) := by + simp only [firstU, map_mul, map_firstX π hX, + map_deficiency π (.mul_star_self B), map_star] + +lemma map_firstR {X : A} (hX : IsSelfAdjoint X) (B : A) : + π (firstR X B) = firstR (π X) (π B) := by + change π ((Real.sqrt 2) • (star B * firstH X)) = _ + calc + π ((Real.sqrt 2) • (star B * firstH X)) = (Real.sqrt 2) • π (star B * firstH X) := + π.toAlgHom.map_smul_of_tower _ _ + _ = firstR (π X) (π B) := by simp only [firstR, map_mul, map_star, map_firstH π hX] + +lemma map_scalingComplement {H : A} (hH : IsSelfAdjoint H) (hn : ‖H‖ ≤ 1) : + π (scalingComplement H) = scalingComplement (π H) := by + simp only [scalingComplement, map_sqrt π (complement_nonneg hH hn), map_sub, map_one, map_mul] + +lemma map_scalingDefect {H : A} (hH : IsSelfAdjoint H) (hn : ‖H‖ ≤ 1) (r : A) : + π (scalingDefect H r) = scalingDefect (π H) (π r) := by + simp only [scalingDefect, scalingIsometry, map_sub, map_mul, map_star, map_one, map_add, + map_scalingComplement π hH hn] + +lemma scalingDefect_selfAdjoint (H r : A) : IsSelfAdjoint (scalingDefect H r) := + (IsSelfAdjoint.one A).sub (.mul_star_self _) + +lemma prospective_input_selfAdjoint (X B : A) : + IsSelfAdjoint (firstK X * scalingDefect (firstH X) (firstR X B) * firstK X) := by + have hK : IsSelfAdjoint (firstK X) := .of_nonneg (ramp_nonneg X (by norm_num)) + rw [isSelfAdjoint_iff] + simp only [star_mul, hK.star_eq, scalingDefect_selfAdjoint _ _ |>.star_eq, mul_assoc] + +lemma map_prospectiveDefect {X : A} (hX : IsSelfAdjoint X) (B : A) : + π (prospectiveDefect X B) = prospectiveDefect (π X) (π B) := by + have hH : IsSelfAdjoint (firstH X) := .of_nonneg (ramp_nonneg X (by norm_num)) + have hn : ‖firstH X‖ ≤ 1 := norm_ramp_le_one _ (by norm_num) + simp only [prospectiveDefect, map_ramp_sa π (prospective_input_selfAdjoint X B) le_rfl, + map_mul, map_firstK π hX, map_scalingDefect π hH hn, map_firstH π hX, + map_firstR π hX] + +lemma map_lastX {X : A} (hX : IsSelfAdjoint X) (B : A) : + π (lastX X B) = lastX (π X) (π B) := by + have hp : IsSelfAdjoint (prospectiveDefect X B) := .of_nonneg (ramp_nonneg _ (by norm_num)) + rw [lastX, map_cut_sa π hp (by norm_num), map_prospectiveDefect π hX] + rfl + +lemma map_lastR {X : A} (hX : IsSelfAdjoint X) (B C : A) : + π (lastR X B C) = lastR (π X) (π B) (π C) := by + simp only [lastR, map_mul, map_lastX π hX, + map_deficiency π (.mul_star_self C), map_star] + +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance fourChoiceStructureOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance fourChoiceStructureStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +universe v + +structure FourChoice (X : A) (B : Fin 4 → A) (E : Finset A) (η : ℝ) where + T : Fin 4 → A + contractive : ∀ i, ‖T i‖ ≤ 1 + mem : ∀ i, T i ∈ fourHer X + first_mod : T 0 * star (T 0) = ramp (firstSandwich (firstU X (B 0)) (firstV X) η E) η (2*η) + first_equal : T 1 * star (T 1) = T 0 * star (T 0) + first_cross : T 0 * star (T 1) = 0 + outer₀ : star (T 0) * T 0 ∈ Her (firstV X) + outer₁ : star (T 1) * T 1 ∈ Her (firstV X) + last_cross : star (T 2) * T 3 = 0 + last_equal : star (T 2) * T 2 = star (T 3) * T 3 + outer₂ : T 2 * star (T 2) ∈ Her (cut (lastR X (B 0) (B 2)) η) + outer₃ : T 3 * star (T 3) ∈ Her (cut (lastR X (B 0) (B 2)) η) + last_norm : ∀ {D : Type v} [NonUnitalCStarAlgebra D] (π : A →⋆ₙₐ[ℂ] D), + 4*η ≤ ‖π (lastR X (B 0) (B 2))‖ → ‖π (T 2)‖ = 1 + +theorem fourChoice_nonempty {X : A} (hX : 0 ≤ X) (B : Fin 4 → A) + (hp : ∀ z : A, 0 ≤ z → z ∈ fourHer X → ProperlyInfinite z) + (E : Finset A) {η : ℝ} (hη : 0 < η) : Nonempty (FourChoice.{v, _} X B E η) := by + obtain ⟨T, h₁, h₂, h₃, h₄, h₅, h₆, h₇, h₈, h₉, h₁₀, h₁₁, h₁₂⟩ := + finite_four_choices hX B hp E hη + exact ⟨⟨T, h₁, h₂, h₃, h₄, h₅, h₆, h₇, h₈, h₉, h₁₀, h₁₁, h₁₂⟩⟩ + +lemma firstH_fixes_V {X : A} (hX : 0 ≤ X) : firstH X * firstV X = firstV X := + ramp_mul_cut hX (by norm_num) (by norm_num) le_rfl + +namespace FourChoice +variable {X : A} {B : Fin 4 → A} {E : Finset A} {η : ℝ} (F : FourChoice.{v, _} X B E η) + +lemma first_mem (hη : 0 < η) : + F.T 0 * star (F.T 0) ∈ Her (cut (firstU X (B 0)) η) := by + rw [F.first_mod] + exact Her_mono_of_mem (firstSandwich_mem _ _ η E) + (Her_mono_of_mem (cut_mem_Her (firstSandwich_nonneg (cut_nonneg X _) η E) η) + (ramp_mem_Her_cut (firstSandwich_nonneg (cut_nonneg X _) η E) hη.le)) + +lemma first_support₀ (hX : 0 ≤ X) : firstH X * star (F.T 0) = star (F.T 0) := by + apply fixed_left_of_modulus + simp only [star_star] + exact Her_fixed_left (firstH_fixes_V hX) F.outer₀ + +lemma first_support₁ (hX : 0 ≤ X) : firstH X * star (F.T 1) = star (F.T 1) := by + apply fixed_left_of_modulus + simp only [star_star] + exact Her_fixed_left (firstH_fixes_V hX) F.outer₁ + +lemma last_support : ramp (prospectiveDefect X (B 0)) 0 (1/2) * F.T 3 = F.T 3 := by + apply fixed_left_of_modulus + apply Her_fixed_left (ramp_mul_cut (prospectiveDefect_nonneg X _) + le_rfl (by norm_num : (0:ℝ) < 1/2) le_rfl) + exact Her_mono_of_mem (squareSandwich_mem (.of_nonneg (lastX_nonneg X _)) _) + (Her_mono_of_mem (cut_mem_Her (lastR_nonneg X _ _) η) F.outer₃) + +variable {D : Type v} [CStarAlgebra D] +local instance fourChoiceRepresentationOrder : PartialOrder D := CStarAlgebra.spectralOrder D +local instance fourChoiceRepresentationStarOrder : StarOrderedRing D := + CStarAlgebra.spectralOrderedRing D +variable (π : A →⋆ₐ[ℂ] D) (hX : 0 ≤ X) (hη : 0 < η) + (hmatch : ∀ i, π (F.T i) = π (B i)) + +include F hX hη hmatch in +lemma first_bound : π (B 0) * star (π (B 0)) ≤ (1/2 : ℝ) • (1 : D) := by + have hm := Her_map π.toNonUnitalStarAlgHom (F.first_mem hη) + change π (F.T 0 * star (F.T 0)) ∈ Her (π (cut (firstU X (B 0)) η)) at hm + simp only [map_mul, map_star, hmatch] at hm + rw [map_cut_sa π (.of_nonneg (firstU_nonneg X (B 0))) hη.le, + map_firstU π (.of_nonneg hX)] at hm + exact selfConsistent_cutoff_bound (cut_nonneg (π X) _) + (mul_star_self_nonneg _) hη (by norm_num) hm + +include F hX hη hmatch in +lemma last_bound : π (B 2) * star (π (B 2)) ≤ (1/2 : ℝ) • (1 : D) := by + have hm := Her_map π.toNonUnitalStarAlgHom F.outer₂ + change π (F.T 2 * star (F.T 2)) ∈ Her (π (cut (lastR X (B 0) (B 2)) η)) at hm + simp only [map_mul, map_star, hmatch] at hm + rw [map_cut_sa π (.of_nonneg (lastR_nonneg X (B 0) (B 2))) hη.le, + map_lastR π (.of_nonneg hX)] at hm + exact selfConsistent_cutoff_bound (lastX_nonneg (π X) _) + (mul_star_self_nonneg _) hη (by norm_num) hm + +include F hX hη hmatch in +lemma first_norm : ‖π (firstSandwich (firstU X (B 0)) (firstV X) η E)‖ < 2*η := by + have hpos : 0 ≤ firstSandwich (firstU X (B 0)) (firstV X) η E := + firstSandwich_nonneg (cut_nonneg X _) η E + have hmod := congrArg π F.first_mod + rw [map_mul, map_star, hmatch, map_ramp_sa π (.of_nonneg hpos) hη.le] at hmod + apply norm_ramp_bound (map_nonneg π hpos) + hη (by norm_num : (0:ℝ) ≤ 1/2) (by norm_num : (1/2:ℝ) < 1) + rw [← hmod] + exact F.first_bound π hX hη hmatch + +include F hX hη hmatch in +lemma last_norm_lt : ‖π (lastR X (B 0) (B 2))‖ < 4*η := by + by_contra! hn + have hone : ‖π (B 2)‖ = 1 := by + have ht : ‖π (F.T 2)‖ = 1 := F.last_norm π.toNonUnitalStarAlgHom hn + rwa [hmatch] at ht + have hle : ‖π (B 2) * star (π (B 2))‖ ≤ 1/2 := by + apply (CStarAlgebra.norm_le_iff_le_algebraMap _ (by norm_num : (0:ℝ) ≤ 1/2) + (mul_star_self_nonneg _)).mpr + simpa only [Algebra.algebraMap_eq_smul_one] using F.last_bound π hX hη hmatch + rw [CStarRing.norm_self_mul_star, hone] at hle + norm_num at hle + +end FourChoice +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Graph.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Graph.lean new file mode 100644 index 0000000000000000000000000000000000000000..ac47c79594896f579395f0e0e0e5ef92adba26d1 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Graph.lean @@ -0,0 +1,639 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Avoidance + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +namespace OrthogonalSlots +section GraphAlgebra +variable {n : ℕ} {h v : A} (S : OrthogonalSlots n h v) + +def graphWord (R : Fin n → A) (hR : ∀ i (k : Her h), R i * (k : A) ∈ Her h) + (k : Her h) : A := ∑ i, S.carrier i ⟨R i * (k : A), hR i k⟩ + +lemma graphWord_inner (R : Fin n → A) (hR : ∀ i (k : Her h), R i * (k : A) ∈ Her h) + (k l : Her h) : + star (S.graphWord R hR k) * S.graphWord R hR l = + star (k : A) * (∑ i, star (R i) * R i) * (l : A) := by + classical + simp only [graphWord, star_sum, Finset.sum_mul, Finset.mul_sum, S.inner] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true] + simp only [star_mul, mul_assoc] + +lemma graphWord_outer (R : Fin n → A) (hR : ∀ i (k : Her h), R i * (k : A) ∈ Her h) + (k l : Her h) : S.graphWord R hR k * star (S.graphWord R hR l) ∈ Her v := by + classical + simp only [graphWord, star_sum, Finset.sum_mul, Finset.mul_sum] + exact (Her v).sum_mem fun i _ => (Her v).sum_mem fun j _ => S.outer j i _ _ + +lemma slot_graphWord (R : Fin n → A) (hR : ∀ i (k : Her h), R i * (k : A) ∈ Her h) + (i : Fin n) (k l : Her h) : + star (S.carrier i k) * S.graphWord R hR l = star (k : A) * R i * (l : A) := by + classical + simp only [graphWord, Finset.mul_sum, S.inner] + simp [mul_assoc] + +lemma graphWord_mul (R : Fin n → A) (hR : ∀ i (k : Her h), R i * (k : A) ∈ Her h) + (k l : Her h) : S.graphWord R hR (k*l) = S.graphWord R hR k * (l : A) := by + classical + simp only [graphWord, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + have he : (⟨R i * ((k*l : Her h) : A), hR i (k*l)⟩ : Her h) = + ⟨R i * (k : A), hR i k⟩ * l := by apply Subtype.ext; exact (mul_assoc _ _ _).symm + rw [he, S.mul] + +end GraphAlgebra +end OrthogonalSlots + +section UnitalGraph +variable {D : Type*} [CStarAlgebra D] [PartialOrder D] [StarOrderedRing D] + +omit [PartialOrder D] [StarOrderedRing D] in +lemma cfc_mul_mem_Her {h q : D} (hq : q ∈ Her h) (hqa : IsSelfAdjoint q) + (f : ℝ → ℝ) (hf : Continuous f) {k : D} (hk : k ∈ Her h) : + cfc f q * k ∈ Her h := by + have hm : cfcₙ (fun x => f x - f 0) q ∈ Her h := cfcₙ_mem (𝕜' := ℂ) _ hq + have he : cfcₙ (fun x => f x - f 0) q = cfc f q - (f 0) • (1 : D) := by + rw [cfcₙ_eq_cfc (f := fun x => f x - f 0) (a := q) ((hf.sub continuous_const).continuousOn) (by simp), + cfc_sub f (fun _ => f 0) q hf.continuousOn continuous_const.continuousOn, + cfc_const _ q hqa, Algebra.algebraMap_eq_smul_one] + have he' : cfc f q = cfcₙ (fun x => f x - f 0) q + (f 0) • (1 : D) := by rw [he]; abel + rw [he', add_mul, smul_mul_assoc, one_mul] + exact (Her h).add_mem ((Her h).mul_mem hm hk) (real_smul_mem_Her hk _) + +def graphComplement (S : Fin 4 → D) : D := + cfc (fun t : ℝ => Real.sqrt ((15-t)/16)) (∑ i, star (S i)*S i) + +lemma graphComplement_nonneg (S : Fin 4 → D) : 0 ≤ graphComplement S := + cfc_nonneg fun _ _ => Real.sqrt_nonneg _ + +lemma graphComplement_mul_self (S : Fin 4 → D) (hS : ∀ i, ‖S i‖ ≤ 1) : + graphComplement S * graphComplement S = + (15/16 : ℝ) • (1 : D) - (1/16 : ℝ) • (∑ i, star (S i)*S i) := by + rcases subsingleton_or_nontrivial D with hD | hD + · exact Subsingleton.elim _ _ + let q := ∑ i, star (S i)*S i + have hq : 0 ≤ q := Finset.sum_nonneg fun i _ => star_mul_self_nonneg _ + have hn : ‖q‖ ≤ 4 := by + calc + ‖q‖ ≤ ∑ i, ‖star (S i)*S i‖ := norm_sum_le _ _ + _ ≤ ∑ _i : Fin 4, (1 : ℝ) := by + apply Finset.sum_le_sum + intro i hi + rw [CStarRing.norm_star_mul_self] + simpa using mul_self_le_mul_self (norm_nonneg _) (hS i) + _ = 4 := by simp + have hc : Continuous (fun t : ℝ => Real.sqrt ((15-t)/16)) := by fun_prop + change cfc _ q * cfc _ q = _ + rw [← cfc_mul _ _ q hc.continuousOn hc.continuousOn] + have he : cfc (fun t : ℝ => Real.sqrt ((15-t)/16) * Real.sqrt ((15-t)/16)) q = + cfc (fun t : ℝ => 15/16 - (1/16)*t) q := by + apply cfc_congr + intro t ht + have ht' : t ≤ 4 := (Real.le_norm_self t).trans ((spectrum.norm_le_norm_of_mem ht).trans hn) + dsimp only + rw [Real.mul_self_sqrt (by linarith : 0 ≤ (15-t)/16)] + ring + rw [he, cfc_sub (fun _ : ℝ => 15/16) (fun t : ℝ => (1/16)*t) q, + cfc_const _ q hq.isSelfAdjoint, cfc_const_mul (1/16 : ℝ) (fun t : ℝ => t) q, + cfc_id' ℝ q hq.isSelfAdjoint, Algebra.algebraMap_eq_smul_one] + +lemma graphComplement_mul_mem {h : D} (S : Fin 4 → D) (hS : ∀ i, S i ∈ Her h) + {k : D} (hk : k ∈ Her h) : graphComplement S * k ∈ Her h := by + apply cfc_mul_mem_Her ?_ ?_ _ (by fun_prop) hk + · exact (Her h).sum_mem fun i _ => (Her h).mul_mem (StarMemClass.star_mem (s := Her h) (hS i)) (hS i) + · exact (Finset.sum_nonneg fun i _ => star_mul_self_nonneg (S i)).isSelfAdjoint + +def graphCoeffs (T : Fin 4 → D) : Fin 6 → D := + ![(1/4 : ℝ) • 1, (1/4 : ℝ) • T 0, (1/4 : ℝ) • T 1, + (1/4 : ℝ) • T 2, (1/4 : ℝ) • T 3, graphComplement T] + +lemma graphCoeffs_inner (T : Fin 4 → D) (hT : ∀ i, ‖T i‖ ≤ 1) : + ∑ i, star (graphCoeffs T i) * graphCoeffs T i = 1 := by + classical + rw [Fin.sum_univ_six] + dsimp [graphCoeffs] + simp only [star_smul, star_trivial, star_one, smul_mul_assoc, mul_smul_comm, + smul_smul, one_mul] + rw [(graphComplement_nonneg T).isSelfAdjoint.star_eq, + graphComplement_mul_self T hT, Fin.sum_univ_four] + module + +lemma graphCoeffs_mem {h : D} (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) + (i : Fin 6) (k : Her h) : graphCoeffs T i * (k : D) ∈ Her h := by + fin_cases i <;> dsimp [graphCoeffs] <;> try simp only [smul_mul_assoc, one_mul] + · exact real_smul_mem_Her k.property _ + · exact real_smul_mem_Her ((Her h).mul_mem (hT 0) k.property) _ + · exact real_smul_mem_Her ((Her h).mul_mem (hT 1) k.property) _ + · exact real_smul_mem_Her ((Her h).mul_mem (hT 2) k.property) _ + · exact real_smul_mem_Her ((Her h).mul_mem (hT 3) k.property) _ + · exact graphComplement_mul_mem T hT k.property + +end UnitalGraph +lemma Her_fixed_right {h t : A} (hh : IsSelfAdjoint h) (ht : h * t = h) + {k : A} (hk : k ∈ Her h) : k * t = k := by + have he : star t * h = h := by + simpa only [star_mul, hh.star_eq] using congrArg star ht + have hs := Her_fixed_left he (StarMemClass.star_mem (s := Her h) hk) + simpa only [star_mul, star_star] using congrArg star hs + +def graphInverseFn (t : ℝ) : ℝ := t / (max (1/32 : ℝ) t)^2 + +lemma continuous_graphInverseFn : Continuous graphInverseFn := by + apply Continuous.div continuous_id + (((continuous_const : Continuous (fun _ : ℝ => (1/32 : ℝ))).max continuous_id).pow 2) + intro t + exact pow_ne_zero _ (ne_of_gt (lt_of_lt_of_le (by norm_num : (0:ℝ)<1/32) (le_max_left _ _))) + +lemma graphInverseFn_zero : graphInverseFn 0 = 0 := by simp [graphInverseFn] + +def graphInverse (X : A) : A := cfcₙ graphInverseFn X + +section InverseOrder +variable [PartialOrder A] [StarOrderedRing A] + +omit [PartialOrder A] [StarOrderedRing A] in +lemma graphInverse_mem {h X : A} (hX : X ∈ Her h) : graphInverse X ∈ Her h := + cfcₙ_mem (𝕜' := ℂ) _ hX + +lemma cut_mul_graphInverse {X : A} (hX : 0 ≤ X) : + cut X (1/32) * (X * graphInverse X) = cut X (1/32) := by + have hc : Continuous (fun t : ℝ => max (t-1/32) 0) := by fun_prop + have h0 : (fun t : ℝ => max (t-1/32) 0) 0 = 0 := by norm_num + have he : X * graphInverse X = cfcₙ (fun t : ℝ => t * graphInverseFn t) X := by + simpa only [id_eq, cfcₙ_id' ℝ X hX.isSelfAdjoint, graphInverse] using + (cfcₙ_mul id graphInverseFn X continuousOn_id rfl + continuous_graphInverseFn.continuousOn graphInverseFn_zero).symm + rw [he, cut, ← cfcₙ_mul (fun t : ℝ => max (t-1/32) 0) + (fun t : ℝ => t * graphInverseFn t) X hc.continuousOn h0 + (continuous_id.mul continuous_graphInverseFn).continuousOn (by simp)] + apply cfcₙ_congr + intro t ht + dsimp only + by_cases h : t ≤ 1/32 + · rw [max_eq_right (sub_nonpos.mpr h), zero_mul] + · have ht0 : t ≠ 0 := ne_of_gt (lt_trans (by norm_num) (lt_of_not_ge h)) + dsimp [graphInverseFn] + rw [max_eq_right (le_of_not_ge h)] + field_simp + +lemma right_fixed_by_graphInverse {X S : A} (hX : 0 ≤ X) + (hS : S ∈ Her (cut X (1/32))) : S * (X * graphInverse X) = S := + Her_fixed_right (cut_nonneg X (1/32)).isSelfAdjoint (cut_mul_graphInverse hX) hS + +lemma map_graphInverse {B : Type*} [NonUnitalCStarAlgebra B] [PartialOrder B] [StarOrderedRing B] + (π : A →⋆ₙₐ[ℂ] B) {X : A} (hX : 0 ≤ X) : + π (graphInverse X) = graphInverse (π X) := + π.map_cfcₙ graphInverseFn X continuous_graphInverseFn.continuousOn graphInverseFn_zero + (map_continuous π) hX.isSelfAdjoint (map_nonneg π hX).isSelfAdjoint + +end InverseOrder +section GraphDefect +variable {D : Type*} [CStarAlgebra D] [PartialOrder D] [StarOrderedRing D] + +lemma positive_mul_zero_of_conjugate_zero {a x : D} (ha : 0 ≤ a) + (hz : star x * a * x = 0) : a * x = 0 := by + have hr : CFC.sqrt a * x = 0 := by + apply (CStarRing.star_mul_self_eq_zero_iff _).mp + calc + star (CFC.sqrt a * x) * (CFC.sqrt a * x) = + star x * (CFC.sqrt a * CFC.sqrt a) * x := by + simp only [star_mul, (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq, mul_assoc] + _ = 0 := by rw [CFC.sqrt_mul_sqrt_self a ha, hz] + rw [← CFC.sqrt_mul_sqrt_self a ha, mul_assoc, hr, mul_zero] + +lemma positive_fixed_of_square_fixed {p x : D} (hp : 0 ≤ p) + (he : p * p * x = x) : p * x = x := by + have hi : IsUnit ((1 : D) + p) := CStarAlgebra.isUnit_of_le 1 (le_add_of_nonneg_right hp) + apply hi.mul_left_cancel + simp only [add_mul, one_mul, ← mul_assoc, he] + exact add_comm _ _ + +lemma sqrt_fixed_of_fixed {p x : D} (hp : 0 ≤ p) (he : p*x=x) : CFC.sqrt p*x=x := by + apply positive_fixed_of_square_fixed (CFC.sqrt_nonneg _) + rwa [CFC.sqrt_mul_sqrt_self p hp] + +lemma star_mul_le_one_of_norm_le_one {x : D} (hx : ‖x‖ ≤ 1) : star x * x ≤ 1 := by + apply (CStarAlgebra.norm_le_one_iff_of_nonneg _ (star_mul_self_nonneg x)).mp + rw [CStarRing.norm_star_mul_self] + simpa using mul_self_le_mul_self (norm_nonneg _) hx + +lemma graph_defect_forces {p c y : D} (hp : 0 ≤ p) (hpn : ‖p‖ ≤ 1) + (hcn : ‖c‖ ≤ 1) (hy : 0 ≤ y) + (hd : y * (1 - star c * (p*p) * c) * y = 0) : + p * (c*y) = c*y ∧ star c * c * y = y := by + have hp2 : 0 ≤ 1 - p*p := sub_nonneg.mpr (by + simpa only [hp.isSelfAdjoint.star_eq] using star_mul_le_one_of_norm_le_one hpn) + have hc2 : 0 ≤ 1 - star c*c := sub_nonneg.mpr (star_mul_le_one_of_norm_le_one hcn) + have h₁ : 0 ≤ y*(1-star c*c)*y := by + simpa only [hy.isSelfAdjoint.star_eq] using star_left_conjugate_nonneg hc2 y + have h₂ : 0 ≤ star (c*y)*(1-p*p)*(c*y) := star_left_conjugate_nonneg hp2 _ + have he : y*(1-star c*c)*y + star (c*y)*(1-p*p)*(c*y) = 0 := by + calc + _ = y * (1 - star c * (p*p) * c) * y := by + simp only [star_mul, hy.isSelfAdjoint.star_eq]; noncomm_ring + _ = 0 := hd + have hz₁ : y*(1-star c*c)*y = 0 := le_antisymm ((le_add_of_nonneg_right h₂).trans_eq he) h₁ + have hz₂ : star (c*y)*(1-p*p)*(c*y) = 0 := le_antisymm ((le_add_of_nonneg_left h₁).trans_eq he) h₂ + have hcfix := positive_mul_zero_of_conjugate_zero hc2 + (show star y*(1-star c*c)*y=0 by simpa only [hy.isSelfAdjoint.star_eq] using hz₁) + have hpfix := positive_mul_zero_of_conjugate_zero hp2 hz₂ + have hec : star c*c*y=y := by + apply Eq.symm + apply sub_eq_zero.mp + simpa only [sub_mul, one_mul] using hcfix + have hep : p*p*(c*y)=c*y := by + apply Eq.symm + apply sub_eq_zero.mp + simpa only [sub_mul, one_mul] using hpfix + exact ⟨positive_fixed_of_square_fixed hp hep, hec⟩ + +lemma norm_conjugate_eq_of_isometric_on {c y : D} (hy : 0 ≤ y) + (hc : star c*c*y=y) : ‖c*y*star c‖=‖y‖ := by + have hs := Her_fixed_left hc (sqrt_mem_Her (self_mem_Her hy) hy) + have he : c*y*star c = (c*CFC.sqrt y)*star (c*CFC.sqrt y) := by + simp only [star_mul, (CFC.sqrt_nonneg y).isSelfAdjoint.star_eq] + rw [show c*y*star c = c * (CFC.sqrt y * CFC.sqrt y) * star c by rw [CFC.sqrt_mul_sqrt_self y hy]] + simp only [mul_assoc] + rw [he, CStarRing.norm_self_mul_star, ← CStarRing.norm_star_mul_self] + congr 1 + calc + star (c*CFC.sqrt y)*(c*CFC.sqrt y) = CFC.sqrt y*(star c*c*CFC.sqrt y) := by + simp only [star_mul, (CFC.sqrt_nonneg y).isSelfAdjoint.star_eq, mul_assoc] + _ = y := by rw [hs, CFC.sqrt_mul_sqrt_self y hy] + +end GraphDefect + +section GraphConstruction +variable {D : Type*} [CStarAlgebra D] [PartialOrder D] [StarOrderedRing D] +variable {h a t : D} (V : OrthogonalSlots 6 h a) (ht : 0 ≤ t) (htH : t ∈ Her h) + +def graphSlot (i : Fin 6) : D := V.carrier i ⟨t, htH⟩ + +def graphZ (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) : D := + V.graphWord (graphCoeffs T) (graphCoeffs_mem T hT) ⟨CFC.sqrt t, sqrt_mem_Her htH ht⟩ + +def graphP (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) : D := + graphZ V ht htH T hT * star (graphZ V ht htH T hT) + +lemma graphZ_inner (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) (hn : ∀ i, ‖T i‖ ≤ 1) : + star (graphZ V ht htH T hT) * graphZ V ht htH T hT = t := by + rw [graphZ, V.graphWord_inner, graphCoeffs_inner T hn] + simpa only [mul_one, (CFC.sqrt_nonneg t).isSelfAdjoint.star_eq] using CFC.sqrt_mul_sqrt_self t ht + +lemma graphP_nonneg (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) : 0 ≤ graphP V ht htH T hT := + mul_star_self_nonneg _ + +lemma graphP_mem (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) : graphP V ht htH T hT ∈ Her a := + V.graphWord_outer _ _ _ _ + +lemma graphP_represented_norm {E : Type*} [NonUnitalCStarAlgebra E] + (π : D →⋆ₙₐ[ℂ] E) (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) (hn : ∀ i, ‖T i‖ ≤ 1) : + ‖π (graphP V ht htH T hT)‖ = ‖π t‖ := by + rw [graphP, map_mul, map_star, CStarRing.norm_self_mul_star, + ← CStarRing.norm_star_mul_self, ← map_star, ← map_mul, graphZ_inner V ht htH T hT hn] + +include ht in +lemma slot_sandwich_mem (i j : Fin 6) (F : D) : + star (graphSlot V htH i) * F * graphSlot V htH j ∈ Her h := by + let r : Her h := ⟨CFC.sqrt t, sqrt_mem_Her htH ht⟩ + have he : (⟨t, htH⟩ : Her h) = r*r := by + apply Subtype.ext + exact (CFC.sqrt_mul_sqrt_self t ht).symm + have hWi : graphSlot V htH i = V.carrier i r * CFC.sqrt t := by rw [graphSlot, he, V.mul] + have hWj : graphSlot V htH j = V.carrier j r * CFC.sqrt t := by rw [graphSlot, he, V.mul] + rw [hWi, hWj, star_mul, (CFC.sqrt_nonneg t).isSelfAdjoint.star_eq] + have hm := Her_sandwich (sqrt_mem_Her htH ht) (star (V.carrier i r) * F * V.carrier j r) + simpa only [(CFC.sqrt_nonneg t).isSelfAdjoint.star_eq, mul_assoc] using hm + +def graphX (F : D) : D := (16 : ℝ) • (star (graphSlot V htH 0) * F * graphSlot V htH 0) + +def graphB (F : D) (i : Fin 4) : D := (16 : ℝ) • + (star (graphSlot V htH i.castSucc.succ) * F * graphSlot V htH 0 * graphInverse (graphX V htH F)) + +lemma graphX_nonneg {F : D} (hF : 0 ≤ F) : 0 ≤ graphX V htH F := + smul_nonneg (by norm_num) (star_left_conjugate_nonneg hF _) + +include ht in +lemma graphX_mem (F : D) : graphX V htH F ∈ Her h := + real_smul_mem_Her (slot_sandwich_mem V ht htH 0 0 F) _ + +include ht in +lemma graphB_mem (F : D) (i : Fin 4) : graphB V htH F i ∈ Her h := + real_smul_mem_Her ((Her h).mul_mem (slot_sandwich_mem V ht htH _ _ F) + (graphInverse_mem (graphX_mem V ht htH F))) _ + +lemma graphSlot0_Z (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) : + star (graphSlot V htH 0) * graphZ V ht htH T hT = (1/4 : ℝ) • (t * CFC.sqrt t) := by + rw [graphSlot, graphZ, V.slot_graphWord] + simp [graphCoeffs, ht.isSelfAdjoint.star_eq] + +lemma graphSlot_Z (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) (i : Fin 4) : + star (graphSlot V htH i.castSucc.succ) * graphZ V ht htH T hT = + (1/4 : ℝ) • (t * T i * CFC.sqrt t) := by + rw [graphSlot, graphZ, V.slot_graphWord] + have he : graphCoeffs T i.castSucc.succ = (1/4 : ℝ) • T i := by fin_cases i <;> rfl + rw [he, ht.isSelfAdjoint.star_eq, mul_smul_comm, smul_mul_assoc] + +lemma norm_compression_eq_of_fixed {z F : D} (hF : 0 ≤ F) (hfix : z*star z*F=F) : + ‖star z*F*z‖=‖F‖ := by + have hs := Her_fixed_left hfix (sqrt_mem_Her (self_mem_Her hF) hF) + calc + ‖star z*F*z‖ = ‖star (CFC.sqrt F*z)*(CFC.sqrt F*z)‖ := by + congr 1 + simp only [star_mul, (CFC.sqrt_nonneg F).isSelfAdjoint.star_eq] + calc + star z*F*z = star z*(CFC.sqrt F*CFC.sqrt F)*z := by rw [CFC.sqrt_mul_sqrt_self F hF] + _ = _ := by noncomm_ring + _ = ‖(CFC.sqrt F*z)*star (CFC.sqrt F*z)‖ := by + rw [CStarRing.norm_star_mul_self, CStarRing.norm_self_mul_star] + _ = ‖F‖ := by + congr 1 + calc + (CFC.sqrt F*z)*star (CFC.sqrt F*z) = CFC.sqrt F*(z*star z*CFC.sqrt F) := by + simp only [star_mul, (CFC.sqrt_nonneg F).isSelfAdjoint.star_eq, mul_assoc] + _ = F := by rw [hs, CFC.sqrt_mul_sqrt_self F hF] + +theorem graph_failure (htn : ‖t‖ ≤ 1) (c y : D) (hy : 0 ≤ y) (hcn : ‖c‖ ≤ 1) + (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) (hTn : ∀ i, ‖T i‖ ≤ 1) + (hTX : ∀ i, T i ∈ Her (cut (graphX V htH (c*y*star c)) (1/32))) + (hd : y * (1-star c*(graphP V ht htH T hT * graphP V ht htH T hT)*c)*y=0) : + ‖graphX V htH (c*y*star c)‖=‖y‖ ∧ ∀ i, graphB V htH (c*y*star c) i = T i := by + let z := graphZ V ht htH T hT + let p := z*star z + let F := c*y*star c + let H₀ := star z*F*z + have hp : 0 ≤ p := mul_star_self_nonneg z + have hpn : ‖p‖ ≤ 1 := by + change ‖graphP V ht htH T hT‖ ≤ 1 + change ‖z*star z‖ ≤ 1 + rw [CStarRing.norm_self_mul_star, ← CStarRing.norm_star_mul_self] + change ‖star (graphZ V ht htH T hT)*graphZ V ht htH T hT‖ ≤ 1 + rw [graphZ_inner V ht htH T hT hTn] + exact htn + have hz : star z*z=t := graphZ_inner V ht htH T hT hTn + have hdf : y*(1-star c*(p*p)*c)*y=0 := hd + obtain ⟨hpc,hcc⟩ := graph_defect_forces hp hpn hcn hy hdf + have hF : 0 ≤ F := star_right_conjugate_nonneg hy c + have hFH : 0 ≤ H₀ := star_left_conjugate_nonneg hF z + have hpF : p*F=F := by + change p*(c*y*star c)=c*y*star c + rw [← mul_assoc, hpc] + have hFp : F*p=F := by + simpa only [star_mul, hF.isSelfAdjoint.star_eq, hp.isSelfAdjoint.star_eq] using congrArg star hpF + have heF : F=z*H₀*star z := by + calc + F = p*F*p := by rw [hpF,hFp] + _ = z*H₀*star z := by dsimp [p,H₀]; noncomm_ring + have htH₀ : t*H₀=H₀ := by + calc + t*H₀ = star z*(p*F)*z := by rw [← hz]; dsimp [H₀,p]; noncomm_ring + _ = H₀ := by rw [hpF] + have hH₀t : H₀*t=H₀ := by + simpa only [star_mul, hFH.isSelfAdjoint.star_eq, ht.isSelfAdjoint.star_eq] using congrArg star htH₀ + have hrH₀ : CFC.sqrt t*H₀=H₀ := sqrt_fixed_of_fixed ht htH₀ + have hH₀r : H₀*CFC.sqrt t=H₀ := by + simpa only [star_mul, hFH.isSelfAdjoint.star_eq, (CFC.sqrt_nonneg t).isSelfAdjoint.star_eq] + using congrArg star hrH₀ + have hW₀ : star (graphSlot V htH 0)*z=(1/4 : ℝ) • (t*CFC.sqrt t) := + graphSlot0_Z V ht htH T hT + have hzW : star z*graphSlot V htH 0=(1/4 : ℝ) • (CFC.sqrt t*t) := by + simpa only [star_mul, star_star, star_smul, star_trivial, + ht.isSelfAdjoint.star_eq, (CFC.sqrt_nonneg t).isSelfAdjoint.star_eq] using congrArg star hW₀ + have hW (i : Fin 6) : star (graphSlot V htH i)*F*graphSlot V htH 0 = + (star (graphSlot V htH i)*z)*H₀*(star z*graphSlot V htH 0) := by + rw [heF]; noncomm_ring + have hXeq : graphX V htH F=H₀ := by + rw [graphX, hW 0, hW₀, hzW] + simp only [smul_mul_assoc, mul_smul_comm, smul_smul] + rw [show (t*CFC.sqrt t)*H₀*(CFC.sqrt t*t)=H₀ by + rw [mul_assoc t (CFC.sqrt t) H₀, hrH₀, htH₀, ← mul_assoc, hH₀r, hH₀t]] + norm_num + have hX : 0 ≤ graphX V htH F := graphX_nonneg V htH hF + refine ⟨?_, fun i => ?_⟩ + · rw [hXeq, norm_compression_eq_of_fixed hF hpF, norm_conjugate_eq_of_isometric_on hy hcc] + · have hTi := hTX i + change T i ∈ Her (cut (graphX V htH F) (1/32)) at hTi + have htX : t*graphX V htH F=graphX V htH F := by rw [hXeq]; exact htH₀ + have htT : t*T i=T i := Her_fixed_left htX (Her_mono_of_mem (cut_mem_Her hX _) hTi) + have hright := right_fixed_by_graphInverse hX hTi + change graphB V htH F i=T i + rw [graphB, hW i.castSucc.succ, graphSlot_Z V ht htH T hT i, hzW] + simp only [smul_mul_assoc, mul_smul_comm, smul_smul] + have he : (t*T i*CFC.sqrt t)*H₀*(CFC.sqrt t*t)*graphInverse (graphX V htH F) = T i := by + calc + _ = (t*T i)*H₀*graphInverse (graphX V htH F) := by + rw [mul_assoc (t*T i) (CFC.sqrt t) H₀, hrH₀, + mul_assoc (t*T i) H₀ (CFC.sqrt t*t), ← mul_assoc H₀, + hH₀r, hH₀t] + _ = T i := by rw [htT, ← hXeq, mul_assoc]; exact hright + rw [he] + norm_num + +end GraphConstruction + +section AbstractMeasurements +variable {D : Type*} [CStarAlgebra D] [PartialOrder D] [StarOrderedRing D] + +def measurementX (w F : D) : D := (16 : ℝ) • (star w*F*w) +def measurementB (w : Fin 6 → D) (F : D) (i : Fin 4) : D := + (16 : ℝ) • (star (w i.castSucc.succ)*F*w 0*graphInverse (measurementX (w 0) F)) + +theorem graph_failure_of_identities {t z : D} (ht : 0 ≤ t) (htn : ‖t‖ ≤ 1) + (w : Fin 6 → D) (hz : star z*z=t) (T : Fin 4 → D) + (hW₀ : star (w 0)*z=(1/4 : ℝ) • (t*CFC.sqrt t)) + (hWi : ∀ i : Fin 4, star (w i.castSucc.succ)*z=(1/4 : ℝ) • (t*T i*CFC.sqrt t)) + (c y : D) (hy : 0 ≤ y) (hcn : ‖c‖ ≤ 1) + (hTX : ∀ i, T i ∈ Her (cut (measurementX (w 0) (c*y*star c)) (1/32))) + (hd : y*(1-star c*((z*star z)*(z*star z))*c)*y=0) : + ‖measurementX (w 0) (c*y*star c)‖=‖y‖ ∧ ∀ i, measurementB w (c*y*star c) i=T i := by + let p := z*star z + let F := c*y*star c + let H₀ := star z*F*z + have hp : 0 ≤ p := mul_star_self_nonneg z + have hpn : ‖p‖ ≤ 1 := by + change ‖z*star z‖ ≤ 1 + rw [CStarRing.norm_self_mul_star, ← CStarRing.norm_star_mul_self, hz] + exact htn + have hdf : y*(1-star c*(p*p)*c)*y=0 := hd + obtain ⟨hpc,hcc⟩ := graph_defect_forces hp hpn hcn hy hdf + have hF : 0 ≤ F := star_right_conjugate_nonneg hy c + have hFH : 0 ≤ H₀ := star_left_conjugate_nonneg hF z + have hpF : p*F=F := by + change p*(c*y*star c)=c*y*star c + rw [← mul_assoc, hpc] + have hFp : F*p=F := by + simpa only [star_mul, hF.isSelfAdjoint.star_eq, hp.isSelfAdjoint.star_eq] using congrArg star hpF + have heF : F=z*H₀*star z := by + calc + F = p*F*p := by rw [hpF,hFp] + _ = z*H₀*star z := by dsimp [p,H₀]; noncomm_ring + have htH₀ : t*H₀=H₀ := by + calc + t*H₀ = star z*(p*F)*z := by rw [← hz]; dsimp [H₀,p]; noncomm_ring + _ = H₀ := by rw [hpF] + have hH₀t : H₀*t=H₀ := by + simpa only [star_mul, hFH.isSelfAdjoint.star_eq, ht.isSelfAdjoint.star_eq] using congrArg star htH₀ + have hrH₀ : CFC.sqrt t*H₀=H₀ := sqrt_fixed_of_fixed ht htH₀ + have hH₀r : H₀*CFC.sqrt t=H₀ := by + simpa only [star_mul, hFH.isSelfAdjoint.star_eq, (CFC.sqrt_nonneg t).isSelfAdjoint.star_eq] + using congrArg star hrH₀ + have hzW : star z*w 0=(1/4 : ℝ) • (CFC.sqrt t*t) := by + simpa only [star_mul, star_star, star_smul, star_trivial, + ht.isSelfAdjoint.star_eq, (CFC.sqrt_nonneg t).isSelfAdjoint.star_eq] using congrArg star hW₀ + have hW (i : Fin 6) : star (w i)*F*w 0 = + (star (w i)*z)*H₀*(star z*w 0) := by + rw [heF]; noncomm_ring + have hXeq : measurementX (w 0) F=H₀ := by + rw [measurementX, hW 0, hW₀, hzW] + simp only [smul_mul_assoc, mul_smul_comm, smul_smul] + rw [show (t*CFC.sqrt t)*H₀*(CFC.sqrt t*t)=H₀ by + rw [mul_assoc t (CFC.sqrt t) H₀, hrH₀, htH₀, ← mul_assoc, hH₀r, hH₀t]] + norm_num + have hX : 0 ≤ measurementX (w 0) F := smul_nonneg (by norm_num) (star_left_conjugate_nonneg hF (w 0)) + refine ⟨?_, fun i => ?_⟩ + · rw [hXeq, norm_compression_eq_of_fixed hF hpF, norm_conjugate_eq_of_isometric_on hy hcc] + · have hTi := hTX i + change T i ∈ Her (cut (measurementX (w 0) F) (1/32)) at hTi + have htX : t*measurementX (w 0) F=measurementX (w 0) F := by rw [hXeq]; exact htH₀ + have htT : t*T i=T i := Her_fixed_left htX (Her_mono_of_mem (cut_mem_Her hX _) hTi) + have hright := right_fixed_by_graphInverse hX hTi + change measurementB w F i=T i + rw [measurementB, hW i.castSucc.succ, hWi i, hzW] + simp only [smul_mul_assoc, mul_smul_comm, smul_smul] + have he : (t*T i*CFC.sqrt t)*H₀*(CFC.sqrt t*t)*graphInverse (measurementX (w 0) F) = T i := by + calc + _ = (t*T i)*H₀*graphInverse (measurementX (w 0) F) := by + rw [mul_assoc (t*T i) (CFC.sqrt t) H₀, hrH₀, + mul_assoc (t*T i) H₀ (CFC.sqrt t*t), ← mul_assoc H₀, + hH₀r, hH₀t] + _ = T i := by rw [htT, ← hXeq, mul_assoc]; exact hright + rw [he] + norm_num + +end AbstractMeasurements + +section RepresentedGraph +variable {D E : Type*} [CStarAlgebra D] [PartialOrder D] [StarOrderedRing D] + [CStarAlgebra E] [PartialOrder E] [StarOrderedRing E] +variable (π : D →⋆ₐ[ℂ] E) {h a t : D} (V : OrthogonalSlots 6 h a) + (ht : 0 ≤ t) (htH : t ∈ Her h) + +omit [PartialOrder D] [StarOrderedRing D] [PartialOrder E] [StarOrderedRing E] in +lemma graph_map_real_smul (r : ℝ) (x : D) : π (r • x) = r • π x := + π.toAlgHom.map_smul_of_tower r x + +lemma graph_map_inverse {X : D} (hX : 0 ≤ X) : + π (graphInverse X)=graphInverse (π X) := map_graphInverse π.toNonUnitalStarAlgHom hX + +omit [PartialOrder D] [StarOrderedRing D] [PartialOrder E] [StarOrderedRing E] in +lemma graphX_map (F : D) : π (graphX V htH F) = + measurementX (π (graphSlot V htH 0)) (π F) := by + simp only [graphX, measurementX, graph_map_real_smul π, map_mul, map_star] + +lemma graphB_map {F : D} (hF : 0 ≤ F) (i : Fin 4) : π (graphB V htH F i) = + measurementB (fun j => π (graphSlot V htH j)) (π F) i := by + simp only [graphB, measurementB, graph_map_real_smul π, map_mul, map_star, + graph_map_inverse π (graphX_nonneg V htH hF), graphX_map] + +theorem graph_failure_represented (htn : ‖t‖ ≤ 1) (c y : D) (hy : 0 ≤ y) (hcn : ‖c‖ ≤ 1) + (T : Fin 4 → D) (hT : ∀ i, T i ∈ Her h) (hTn : ∀ i, ‖T i‖ ≤ 1) + (hTX : ∀ i, T i ∈ Her (cut (graphX V htH (c*y*star c)) (1/32))) + (hd : π (y * (1-star c*(graphP V ht htH T hT * graphP V ht htH T hT)*c)*y)=0) : + ‖π (graphX V htH (c*y*star c))‖=‖π y‖ ∧ + ∀ i, π (graphB V htH (c*y*star c) i) = π (T i) := by + have hF : 0 ≤ c*y*star c := star_right_conjugate_nonneg hy c + have hm : π (CFC.sqrt t)=CFC.sqrt (π t) := + π.toNonUnitalStarAlgHom.map_cfcₙ NNReal.sqrt t (by fun_prop) (by simp) + (map_continuous π) ht (map_nonneg π ht) + have hc := graph_failure_of_identities (map_nonneg π ht) + ((NonUnitalStarAlgHom.norm_apply_le π t).trans htn) + (fun j => π (graphSlot V htH j)) (z := π (graphZ V ht htH T hT)) + (by simpa only [map_mul, map_star] using congrArg π (graphZ_inner V ht htH T hT hTn)) + (fun i => π (T i)) + (by simpa only [map_mul, map_star, graph_map_real_smul π, hm] using + (congrArg π (graphSlot0_Z V ht htH T hT))) + (fun i => by simpa only [map_mul, map_star, graph_map_real_smul π, hm] using + (congrArg π (graphSlot_Z V ht htH T hT i))) + (π c) (π y) (map_nonneg π hy) + ((NonUnitalStarAlgHom.norm_apply_le π c).trans hcn) (fun i => ?_) ?_ + · simpa only [graphX_map, graphB_map π V htH hF, map_mul, map_star] using hc + · have hmem := Her_map π.toNonUnitalStarAlgHom (hTX i) + have hh := cut_map π.toNonUnitalStarAlgHom (graphX V htH (c*y*star c)) (1/32) + (graphX_nonneg V htH hF).isSelfAdjoint (by norm_num) + change π (T i) ∈ Her (π (cut (graphX V htH (c*y*star c)) (1/32))) at hmem + change cut (π (graphX V htH (c*y*star c))) (1/32) = + π (cut (graphX V htH (c*y*star c)) (1/32)) at hh + rw [← hh] at hmem + simpa only [graphX_map, map_mul, map_star] using hmem + · simpa only [graphP, map_mul, map_star, map_sub, map_one] using hd + +end RepresentedGraph + +end MainGap + +namespace MainGap +universe u v +variable {A : Type u} [CStarAlgebra A] +local instance graphNonvanishingOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance graphNonvanishingStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance graphOperatorOrder (J : Type*) [NormedAddCommGroup J] [InnerProductSpace ℂ J] [CompleteSpace J] : + PartialOrder (J →L[ℂ] J) := CStarAlgebra.spectralOrder _ +local instance graphOperatorStarOrder (J : Type*) [NormedAddCommGroup J] [InnerProductSpace ℂ J] [CompleteSpace J] : + StarOrderedRing (J →L[ℂ] J) := CStarAlgebra.spectralOrderedRing _ + +theorem graph_nonvanishing {a y c : A} (ha : 0 ≤ a) (hy : 0 ≤ y) (hcn : ‖c‖ ≤ 1) + (hp : ∀ z : A, 0 ≤ z → z ∈ Her a → ProperlyInfinite z) : + ∃ p : A, 0 ≤ p ∧ ‖p‖ ≤ 1 ∧ p ∈ Her a ∧ + (∀ R : HilbertRep.{u,v} A, (1/2 : ℝ) < ‖R.hom a‖ → ‖R.hom p‖=1) ∧ + (∀ R : HilbertRep.{u,v} A, R.hom (y*(1-star c*(p*p)*c)*y)=0 → ‖R.hom y‖ ≤ (1/4 : ℝ)) := by + classical + obtain ⟨V⟩ := (hp a ha (self_mem_Her ha)).orthogonalSlots ha 6 (by norm_num : (0:ℝ)<1/8) + let t := ramp a (1/4) (1/2) + have ht : 0 ≤ t := ramp_nonneg a (by norm_num) + have htn : ‖t‖ ≤ 1 := norm_ramp_le_one a (by norm_num) + have htH : t ∈ Her (cut a (1/8)) := by + have hcut : cut a (1/4) ∈ Her (cut a (1/8)) := by + have hh := cut_mem_Her (cut_nonneg a (1/8)) (1/8) + rw [cut_cut ha (by norm_num) (by norm_num)] at hh + convert hh using 1; norm_num + exact Her_mono_of_mem hcut (ramp_mem_Her_cut ha (by norm_num)) + let F := c*y*star c + have hF : 0 ≤ F := star_right_conjugate_nonneg hy c + let X := graphX V htH F + let B := graphB V htH F + have hX : 0 ≤ X := graphX_nonneg V htH hF + have hXH : X ∈ Her (cut a (1/8)) := graphX_mem V ht htH F + have hfour : fourHer X ≤ Her (cut a (1/8)) := + Her_mono_of_mem (Her_mono_of_mem hXH (cut_mem_Her hX (1/32))) + obtain ⟨T,hTn,hTX,havoid⟩ := four_avoidance_unital.{u,v} hX B (fun z hz hzm => + hp z hz (Her_mono_of_mem (cut_mem_Her ha (1/8)) (hfour hzm))) + have hT : ∀ i, T i ∈ Her (cut a (1/8)) := fun i => hfour (hTX i) + let p := graphP V ht htH T hT + have hpn : ‖p‖ ≤ 1 := by + have he := graphP_represented_norm V ht htH (NonUnitalStarAlgHom.id ℂ A) T hT hTn + change ‖p‖=‖t‖ at he + rw [he] + exact htn + refine ⟨p, graphP_nonneg V ht htH T hT, hpn, graphP_mem V ht htH T hT, ?_, ?_⟩ + · intro R hRa + change ‖R.hom.toNonUnitalStarAlgHom (graphP V ht htH T hT)‖=1 + rw [graphP_represented_norm V ht htH R.hom.toNonUnitalStarAlgHom T hT hTn] + change ‖R.hom (ramp a (1/4) (1/2))‖=1 + rw [map_ramp_sa R.hom ha.isSelfAdjoint (by norm_num)] + exact norm_ramp_eq_one (map_nonneg R.hom ha) (by norm_num) (by norm_num) hRa.le + · intro R hd + by_contra! hRy + obtain ⟨hRX,hB⟩ := graph_failure_represented R.hom V ht htH htn c y hy hcn T hT hTn hTX hd + exact havoid R (by rw [hRX]; exact hRy) + (fun i => (hB i).symm) +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Hereditary.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Hereditary.lean new file mode 100644 index 0000000000000000000000000000000000000000..f675e67e6641fab0fd1e4178a75a8522ce81f447 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Hereditary.lean @@ -0,0 +1,613 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap + +variable {A : Type*} [NonUnitalCStarAlgebra A] + +def sandwichAlgebra (h : A) : NonUnitalStarSubalgebra ℂ A where + carrier := Set.range (fun a : A => h * a * star h) + zero_mem' := ⟨0, by simp⟩ + add_mem' := by + rintro _ _ ⟨a, rfl⟩ ⟨b, rfl⟩ + exact ⟨a + b, by simp [mul_add, add_mul]⟩ + mul_mem' := by + rintro _ _ ⟨a, rfl⟩ ⟨b, rfl⟩ + exact ⟨a * star h * h * b, by simp only [mul_assoc]⟩ + smul_mem' := by + rintro c _ ⟨a, rfl⟩ + exact ⟨c • a, by simp only [mul_smul_comm, smul_mul_assoc]⟩ + star_mem' := by + rintro _ ⟨a, rfl⟩ + exact ⟨star a, by simp only [star_mul, star_star, mul_assoc]⟩ + +def Her (h : A) : NonUnitalStarSubalgebra ℂ A := (sandwichAlgebra h).topologicalClosure + +lemma mem_Her_iff {h a : A} : a ∈ Her h ↔ + a ∈ closure (Set.range (fun b : A => h * b * star h)) := Iff.rfl + +lemma isClosed_Her (h : A) : IsClosed (Her h : Set A) := isClosed_closure + +instance (h : A) : IsClosed (Her h : Set A) := isClosed_Her h + +lemma sandwich_mem_Her (h a : A) : h * a * star h ∈ Her h := + subset_closure ⟨a, rfl⟩ + +instance (h : A) : CompleteSpace (Her h) := (isClosed_Her h).completeSpace_coe + +def sandwichMap (h : A) : A →ₗ[ℂ] Her h where + toFun a := ⟨h * a * star h, sandwich_mem_Her h a⟩ + map_add' a b := Subtype.ext (by + change h * (a + b) * star h = h * a * star h + h * b * star h + simp only [mul_add, add_mul]) + map_smul' c a := Subtype.ext (by + change h * (c • a) * star h = c • (h * a * star h) + simp only [mul_smul_comm, smul_mul_assoc]) + +@[simp] lemma sandwichMap_val (h a : A) : (sandwichMap h a : A) = h * a * star h := rfl + +lemma sandwichMap_dense (h : A) : DenseRange (sandwichMap h) := by + intro a + rw [closure_subtype] + have heq : Subtype.val '' Set.range (sandwichMap h) = + Set.range (fun b : A => h * b * star h) := by + ext b + constructor + · rintro ⟨k, ⟨c, rfl⟩, rfl⟩ + exact ⟨c, rfl⟩ + · rintro ⟨c, rfl⟩ + exact ⟨sandwichMap h c, ⟨c, rfl⟩, rfl⟩ + rw [heq] + exact a.property + +lemma norm_mul_eq_of_star_mul_eq {z h : A} (hzh : star z * z = star h * h) (a : A) : + ‖z * a‖ = ‖h * a‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + simp only [pow_two, ← CStarRing.norm_star_mul_self, star_mul] + congr 1 + calc + star a * star z * (z * a) = star a * (star z * z) * a := by noncomm_ring + _ = star a * (star h * h) * a := by rw [hzh] + _ = star a * star h * (h * a) := by noncomm_ring + +def carrierNumerator (z h : A) : A →ₗ[ℂ] A where + toFun a := z * a * star h + map_add' a b := by simp only [mul_add, add_mul] + map_smul' c a := by simp only [mul_smul_comm, smul_mul_assoc, RingHom.id_apply] + +def carrier (z h : A) : Her h →L[ℂ] A := + (carrierNumerator z h).extendOfNorm (sandwichMap h) + +lemma carrier_on_sandwich {z h : A} (hzh : star z * z = star h * h) (a : A) : + carrier z h (sandwichMap h a) = z * a * star h := by + apply LinearMap.extendOfNorm_eq (sandwichMap_dense h) + refine ⟨1, fun b => ?_⟩ + change ‖z * b * star h‖ ≤ 1 * ‖h * b * star h‖ + rw [one_mul, mul_assoc, mul_assoc, norm_mul_eq_of_star_mul_eq hzh] + +lemma carrier_norm {z h : A} (hzh : star z * z = star h * h) (k : Her h) : + ‖carrier z h k‖ = ‖(k : A)‖ := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + rw [carrier_on_sandwich hzh, sandwichMap_val, mul_assoc, mul_assoc, + norm_mul_eq_of_star_mul_eq hzh] + +lemma carrier_inner {z h : A} (hzh : star z * z = star h * h) (k l : Her h) : + star (carrier z h k) * carrier z h l = star (k : A) * (l : A) := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + refine (sandwichMap_dense h).induction_on l (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + simp only [carrier_on_sandwich hzh, sandwichMap_val, star_mul, star_star] + calc + h * (star a * star z) * (z * b * star h) = + h * star a * (star z * z) * b * star h := by noncomm_ring + _ = h * star a * (star h * h) * b * star h := by rw [hzh] + _ = h * (star a * star h) * (h * b * star h) := by noncomm_ring + +lemma carrier_mul {z h : A} (hzh : star z * z = star h * h) (k l : Her h) : + carrier z h (k * l) = carrier z h k * (l : A) := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + refine (sandwichMap_dense h).induction_on l (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + have heq : sandwichMap h a * sandwichMap h b = + sandwichMap h (a * star h * h * b) := Subtype.ext (by + change (h * a * star h) * (h * b * star h) = + h * (a * star h * h * b) * star h + simp only [mul_assoc]) + rw [heq, carrier_on_sandwich hzh, carrier_on_sandwich hzh, sandwichMap_val] + simp only [mul_assoc] + +lemma norm_mul_star_eq_of_star_mul_eq {z h : A} (hzh : star z * z = star h * h) (a : A) : + ‖a * star z‖ = ‖a * star h‖ := by + calc + ‖a * star z‖ = ‖star (a * star z)‖ := (norm_star _).symm + _ = ‖z * star a‖ := by rw [star_mul, star_star] + _ = ‖h * star a‖ := norm_mul_eq_of_star_mul_eq hzh _ + _ = ‖star (a * star h)‖ := by rw [star_mul, star_star] + _ = ‖a * star h‖ := norm_star _ + +lemma norm_sandwich_eq {z h : A} (hzh : star z * z = star h * h) (a : A) : + ‖z * a * star z‖ = ‖h * a * star h‖ := by + rw [norm_mul_star_eq_of_star_mul_eq hzh, mul_assoc, mul_assoc, + norm_mul_eq_of_star_mul_eq hzh] + +def conjugationNumerator (z : A) : A →ₗ[ℂ] A where + toFun a := z * a * star z + map_add' a b := by simp only [mul_add, add_mul] + map_smul' c a := by simp only [mul_smul_comm, smul_mul_assoc, RingHom.id_apply] + +def conjugation (z h : A) : Her h →L[ℂ] A := + (conjugationNumerator z).extendOfNorm (sandwichMap h) + +lemma conjugation_on_sandwich {z h : A} (hzh : star z * z = star h * h) (a : A) : + conjugation z h (sandwichMap h a) = z * a * star z := by + apply LinearMap.extendOfNorm_eq (sandwichMap_dense h) + refine ⟨1, fun b => ?_⟩ + change ‖z * b * star z‖ ≤ 1 * ‖h * b * star h‖ + rw [one_mul, norm_sandwich_eq hzh] + +lemma conjugation_norm {z h : A} (hzh : star z * z = star h * h) (k : Her h) : + ‖conjugation z h k‖ = ‖(k : A)‖ := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + rw [conjugation_on_sandwich hzh, sandwichMap_val, norm_sandwich_eq hzh] + +lemma conjugation_mem {z h : A} (hzh : star z * z = star h * h) (k : Her h) : + conjugation z h k ∈ Her z := by + refine (sandwichMap_dense h).induction_on k + ((isClosed_Her z).preimage (conjugation z h).continuous) ?_ + intro a + rw [conjugation_on_sandwich hzh] + exact sandwich_mem_Her z a + +lemma conjugation_mul {z h : A} (hzh : star z * z = star h * h) (k l : Her h) : + conjugation z h (k * l) = conjugation z h k * conjugation z h l := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + refine (sandwichMap_dense h).induction_on l (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + have heq : sandwichMap h a * sandwichMap h b = + sandwichMap h (a * star h * h * b) := Subtype.ext (by + change (h * a * star h) * (h * b * star h) = + h * (a * star h * h * b) * star h + simp only [mul_assoc]) + rw [heq, conjugation_on_sandwich hzh, conjugation_on_sandwich hzh, + conjugation_on_sandwich hzh] + calc + z * (a * star h * h * b) * star z = z * a * (star h * h) * b * star z := by + noncomm_ring + _ = z * a * (star z * z) * b * star z := by rw [hzh] + _ = (z * a * star z) * (z * b * star z) := by noncomm_ring + +lemma carrier_outer {z h : A} (hzh : star z * z = star h * h) (k l : Her h) : + carrier z h k * star (carrier z h l) = conjugation z h (k * star l) := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + refine (sandwichMap_dense h).induction_on l (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + have heq : sandwichMap h a * star (sandwichMap h b) = + sandwichMap h (a * star h * h * star b) := Subtype.ext (by + change (h * a * star h) * star (h * b * star h) = + h * (a * star h * h * star b) * star h + simp only [star_mul, star_star, mul_assoc]) + rw [heq, carrier_on_sandwich hzh, carrier_on_sandwich hzh, conjugation_on_sandwich hzh] + simp only [star_mul, star_star, mul_assoc] + +lemma conjugation_star {z h : A} (hzh : star z * z = star h * h) (k : Her h) : + conjugation z h (star k) = star (conjugation z h k) := by + refine (sandwichMap_dense h).induction_on k + (isClosed_eq ((conjugation z h).continuous.comp continuous_star) + (continuous_star.comp (conjugation z h).continuous)) ?_ + intro a + have heq : star (sandwichMap h a) = sandwichMap h (star a) := Subtype.ext (by + change star (h * a * star h) = h * star a * star h + simp only [star_mul, star_star, mul_assoc]) + rw [heq, conjugation_on_sandwich hzh, conjugation_on_sandwich hzh] + simp only [star_mul, star_star, mul_assoc] + +def transportHom {z h : A} (hzh : star z * z = star h * h) : Her h →⋆ₙₐ[ℂ] A := + { (conjugation z h).toLinearMap with + map_zero' := map_zero (conjugation z h) + map_mul' := conjugation_mul hzh + map_star' := conjugation_star hzh } + +lemma transportHom_injective {z h : A} (hzh : star z * z = star h * h) : + Function.Injective (transportHom hzh) := by + intro k l heq + apply sub_eq_zero.mp + apply Subtype.val_injective + apply norm_eq_zero.mp + rw [← conjugation_norm hzh] + change ‖transportHom hzh (k - l)‖ = 0 + rw [map_sub, heq, sub_self, norm_zero] + +lemma transport_represented_norm {B : Type*} [NonUnitalCStarAlgebra B] + (π : A →⋆ₙₐ[ℂ] B) {z h : A} (hzh : star z * z = star h * h) (k : Her h) : + ‖π (transportHom hzh k)‖ = ‖π (k : A)‖ := by + refine (sandwichMap_dense h).induction_on k (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro a + change ‖π (conjugation z h (sandwichMap h a))‖ = ‖π (h * a * star h)‖ + rw [conjugation_on_sandwich hzh] + simp only [map_mul, map_star] + apply norm_sandwich_eq + simpa only [map_mul, map_star] using congrArg π hzh + +lemma Her_sandwich {h k : A} (hk : k ∈ Her h) (a : A) : k * a * star k ∈ Her h := by + let k' : Her h := ⟨k, hk⟩ + change (k' : A) * a * star (k' : A) ∈ Her h + refine (sandwichMap_dense h).induction_on k' + ((isClosed_Her h).preimage (by fun_prop)) ?_ + intro b + change (h * b * star h) * a * star (h * b * star h) ∈ Her h + convert sandwich_mem_Her h (b * star h * a * h * star b) using 1 + simp only [star_mul, star_star, mul_assoc] + +lemma Her_mono_of_mem {h k : A} (hk : k ∈ Her h) : Her k ≤ Her h := by + apply closure_minimal _ (isClosed_Her h) + rintro _ ⟨a, rfl⟩ + exact Her_sandwich hk a + +lemma Her_mul_le (h k : A) : Her (h * k) ≤ Her h := by + apply closure_minimal _ (isClosed_Her h) + rintro _ ⟨a, rfl⟩ + change (h * k) * a * star (h * k) ∈ Her h + convert sandwich_mem_Her h (k * a * star k) using 1 + simp only [star_mul, mul_assoc] + +structure RegularTransport (h v : A) where + carrier : Her h →L[ℂ] A + hom : Her h →⋆ₙₐ[ℂ] A + inner : ∀ k l : Her h, star (carrier k) * carrier l = star (k : A) * (l : A) + outer : ∀ k l : Her h, carrier k * star (carrier l) = hom (k * star l) + mul : ∀ k l : Her h, carrier (k * l) = carrier k * (l : A) + image : ∀ k : Her h, hom k ∈ Her v + +namespace RegularTransport +variable {h v : A} (T : RegularTransport h v) + +def restrict {k : A} (T : RegularTransport k v) (hle : Her h ≤ Her k) : + RegularTransport h v := by + let ι : Her h →⋆ₙₐ[ℂ] Her k := NonUnitalStarSubalgebra.inclusion hle + let i : Her h →L[ℂ] Her k := { + toFun := ι + map_add' := map_add ι + map_smul' := map_smul ι + cont := by fun_prop } + exact { + carrier := T.carrier.comp i + hom := T.hom.comp ι + inner := fun a b => T.inner (ι a) (ι b) + outer := fun a b => by + change T.carrier (ι a) * star (T.carrier (ι b)) = T.hom (ι (a * star b)) + rw [map_mul, map_star] + exact T.outer (ι a) (ι b) + mul := fun a b => by + change T.carrier (ι (a * b)) = T.carrier (ι a) * (b : A) + rw [map_mul] + exact T.mul (ι a) (ι b) + image := fun a => T.image (ι a) } + +lemma carrier_represented_norm {B : Type*} [NonUnitalCStarAlgebra B] + (π : A →⋆ₙₐ[ℂ] B) (k : Her h) : ‖π (T.carrier k)‖ = ‖π (k : A)‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + simp only [pow_two, ← CStarRing.norm_star_mul_self, ← map_star, ← map_mul, T.inner] + +lemma represented_norm {B : Type*} [NonUnitalCStarAlgebra B] + (π : A →⋆ₙₐ[ℂ] B) (k : Her h) : ‖π (T.hom k)‖ = ‖π (k : A)‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + calc + ‖π (T.hom k)‖ ^ 2 = ‖π (T.hom (star k * k))‖ := by + simp only [map_mul, map_star, CStarRing.norm_star_mul_self, pow_two] + _ = ‖π (T.carrier (star k) * star (T.carrier (star k)))‖ := by + rw [T.outer, star_star] + _ = ‖π (T.carrier (star k))‖ ^ 2 := by + simp only [map_mul, map_star, CStarRing.norm_self_mul_star, pow_two] + _ = ‖π (star (k : A))‖ ^ 2 := by + rw [T.carrier_represented_norm, StarMemClass.coe_star] + _ = ‖π (k : A)‖ ^ 2 := by rw [map_star, norm_star] + +lemma norm_hom (k : Her h) : ‖T.hom k‖ = ‖(k : A)‖ := + T.represented_norm (NonUnitalStarAlgHom.id ℂ A) k + +lemma injective : Function.Injective T.hom := by + intro k l hkl + apply sub_eq_zero.mp + apply Subtype.val_injective + apply norm_eq_zero.mp + rw [← T.norm_hom, map_sub, hkl, sub_self, norm_zero] + +end RegularTransport + +section Order +variable [PartialOrder A] [StarOrderedRing A] + +lemma mul_star_mem_Her (h : A) : h * star h ∈ Her h := by + apply (isClosed_Her h).mem_of_tendsto + (((CStarAlgebra.increasingApproximateUnit A).tendsto_mul_left h).mul_const (star h)) + exact Filter.Eventually.of_forall (sandwich_mem_Her h) + +lemma sqrt_mem_Her {h k : A} (hk : k ∈ Her h) (hkpos : 0 ≤ k) : CFC.sqrt k ∈ Her h := by + rw [CFC.sqrt_eq_real_sqrt k hkpos] + exact cfcₙ_mem (𝕜' := ℂ) Real.sqrt hk + +lemma self_mem_Her {h : A} (hh : 0 ≤ h) : h ∈ Her h := by + have hm : h * h ∈ Her h := by + simpa only [IsSelfAdjoint.of_nonneg hh |>.star_eq] using mul_star_mem_Her h + simpa only [CFC.sqrt_mul_self h hh] using + sqrt_mem_Her hm (by simpa only [IsSelfAdjoint.of_nonneg hh |>.star_eq] using + star_mul_self_nonneg h) + +lemma sqrt_Her_eq {h : A} (hh : 0 ≤ h) : Her (CFC.sqrt h) = Her h := by + apply le_antisymm + · exact Her_mono_of_mem (sqrt_mem_Her (self_mem_Her hh) hh) + · apply Her_mono_of_mem + have ht := self_mem_Her (CFC.sqrt_nonneg h) + have hm : CFC.sqrt h * CFC.sqrt h ∈ Her (CFC.sqrt h) := (Her (CFC.sqrt h)).mul_mem ht ht + rwa [CFC.sqrt_mul_sqrt_self h hh] at hm + +def twoSidedRemainder (e a : A) : A := a - e * a - a * e + e * a * e + +lemma twoSidedRemainder_as_square {e a : A} (he : IsSelfAdjoint e) (ha : 0 ≤ a) : + twoSidedRemainder e a = + (CFC.sqrt a - e * CFC.sqrt a) * star (CFC.sqrt a - e * CFC.sqrt a) := by + have hs : star (CFC.sqrt a) = CFC.sqrt a := (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg a)).star_eq + simp only [star_sub, star_mul, he.star_eq, hs] + calc + twoSidedRemainder e a = a - e * a - a * e + e * a * e := rfl + _ = (CFC.sqrt a * CFC.sqrt a) - e * (CFC.sqrt a * CFC.sqrt a) - + (CFC.sqrt a * CFC.sqrt a) * e + e * (CFC.sqrt a * CFC.sqrt a) * e := by + rw [CFC.sqrt_mul_sqrt_self a ha] + _ = _ := by noncomm_ring + +lemma twoSidedRemainder_nonneg {e a : A} (he : IsSelfAdjoint e) (ha : 0 ≤ a) : + 0 ≤ twoSidedRemainder e a := by + rw [twoSidedRemainder_as_square he ha] + exact mul_star_self_nonneg _ + +lemma twoSidedRemainder_mono {e a b : A} (he : IsSelfAdjoint e) (hab : a ≤ b) : + twoSidedRemainder e a ≤ twoSidedRemainder e b := by + apply sub_nonneg.mp + convert twoSidedRemainder_nonneg he (sub_nonneg.mpr hab) using 1 + simp only [twoSidedRemainder] + noncomm_ring + +omit [PartialOrder A] [StarOrderedRing A] in +lemma norm_twoSidedRemainder_le {e : A} (he : ‖e‖ ≤ 1) (b : A) : + ‖twoSidedRemainder e b‖ ≤ 2 * ‖b - e * b‖ := by + have heq : twoSidedRemainder e b = (b - e * b) - (b - e * b) * e := by + simp only [twoSidedRemainder] + noncomm_ring + rw [heq] + calc + ‖(b - e * b) - (b - e * b) * e‖ ≤ ‖b - e * b‖ + ‖(b - e * b) * e‖ := norm_sub_le _ _ + _ ≤ ‖b - e * b‖ + ‖b - e * b‖ * ‖e‖ := by gcongr; exact norm_mul_le _ _ + _ ≤ 2 * ‖b - e * b‖ := by nlinarith [norm_nonneg (b - e * b)] + +lemma norm_sqrt_remainder_sq_le {e a b : A} (he : IsSelfAdjoint e) (hen : ‖e‖ ≤ 1) + (ha : 0 ≤ a) (hab : a ≤ b) : + ‖CFC.sqrt a - e * CFC.sqrt a‖ ^ 2 ≤ 2 * ‖b - e * b‖ := by + calc + ‖CFC.sqrt a - e * CFC.sqrt a‖ ^ 2 = ‖twoSidedRemainder e a‖ := by + rw [twoSidedRemainder_as_square he ha, CStarRing.norm_self_mul_star, pow_two] + _ ≤ ‖twoSidedRemainder e b‖ := + CStarAlgebra.norm_le_norm_of_le_of_nonneg (twoSidedRemainder_mono he hab) + (twoSidedRemainder_nonneg he ha) + _ ≤ 2 * ‖b - e * b‖ := norm_twoSidedRemainder_le hen b + +lemma norm_compression_error_le {e a : A} (he : IsSelfAdjoint e) (hen : ‖e‖ ≤ 1) + (ha : 0 ≤ a) : + ‖a - e * a * e‖ ≤ 2 * ‖CFC.sqrt a - e * CFC.sqrt a‖ * ‖CFC.sqrt a‖ := by + have ha' : IsSelfAdjoint a := .of_nonneg ha + have hstar : ‖a - a * e‖ = ‖a - e * a‖ := by + rw [← norm_star (a - a * e), star_sub, star_mul, he.star_eq, ha'.star_eq] + have heq : a - e * a * e = (a - e * a) + e * (a - a * e) := by noncomm_ring + have hbound : ‖a - e * a‖ ≤ ‖CFC.sqrt a - e * CFC.sqrt a‖ * ‖CFC.sqrt a‖ := by + calc + ‖a - e * a‖ = ‖(CFC.sqrt a - e * CFC.sqrt a) * CFC.sqrt a‖ := by + rw [sub_mul, mul_assoc e, CFC.sqrt_mul_sqrt_self a ha] + _ ≤ _ := norm_mul_le _ _ + calc + ‖a - e * a * e‖ = ‖(a - e * a) + e * (a - a * e)‖ := congrArg norm heq + _ ≤ ‖a - e * a‖ + ‖e * (a - a * e)‖ := norm_add_le _ _ + _ ≤ ‖a - e * a‖ + ‖e‖ * ‖a - a * e‖ := by gcongr; exact norm_mul_le _ _ + _ ≤ 2 * ‖a - e * a‖ := by rw [hstar]; nlinarith [norm_nonneg (a - e * a)] + _ ≤ _ := by nlinarith + +lemma norm_compression_error_sq_le {e a b : A} (he : IsSelfAdjoint e) (hen : ‖e‖ ≤ 1) + (ha : 0 ≤ a) (hab : a ≤ b) : + ‖a - e * a * e‖ ^ 2 ≤ 8 * ‖a‖ * ‖b - e * b‖ := by + have hsa : IsSelfAdjoint (CFC.sqrt a) := .of_nonneg (CFC.sqrt_nonneg _) + have hsq : ‖CFC.sqrt a‖ ^ 2 = ‖a‖ := by + rw [← hsa.norm_mul_self, CFC.sqrt_mul_sqrt_self a ha] + calc + ‖a - e * a * e‖ ^ 2 ≤ + (2 * ‖CFC.sqrt a - e * CFC.sqrt a‖ * ‖CFC.sqrt a‖) ^ 2 := + (sq_le_sq₀ (norm_nonneg _) (by positivity)).mpr (norm_compression_error_le he hen ha) + _ = 4 * ‖a‖ * ‖CFC.sqrt a - e * CFC.sqrt a‖ ^ 2 := by rw [← hsq]; ring + _ ≤ 4 * ‖a‖ * (2 * ‖b - e * b‖) := by + gcongr + exact norm_sqrt_remainder_sq_le he hen ha hab + _ = _ := by ring + +lemma Her_exists_approx_unit {b : A} (hb : 0 ≤ b) {δ : ℝ} (hδ : 0 < δ) : + ∃ e : A, e ∈ Her b ∧ IsSelfAdjoint e ∧ ‖e‖ ≤ 1 ∧ ‖b - e * b‖ < δ := by + let b' : Her b := ⟨b, self_mem_Her hb⟩ + let : PartialOrder (Her b) := CStarAlgebra.spectralOrder (Her b) + let : StarOrderedRing (Her b) := CStarAlgebra.spectralOrderedRing (Her b) + have hunit := CStarAlgebra.increasingApproximateUnit (Her b) + have ht : Tendsto (fun e : Her b => ‖b' - e * b'‖) + (CStarAlgebra.approximateUnit (Her b)) (𝓝 (0 : ℝ)) := by + simpa only [sub_self, norm_zero] using + ((tendsto_const_nhds (x := b')).sub (hunit.tendsto_mul_right b')).norm + have hsmall : ∀ᶠ e : Her b in CStarAlgebra.approximateUnit (Her b), ‖b' - e * b'‖ < δ := + ht.eventually (Iio_mem_nhds hδ) + obtain ⟨e, hn, hp, hs⟩ := (hunit.eventually_norm.and (hunit.eventually_nonneg.and hsmall)).exists + refine ⟨e, e.property, ?_, hn, hs⟩ + change star (e : A) = (e : A) + have he := congrArg (fun x : Her b => (x : A)) (IsSelfAdjoint.of_nonneg hp |>.star_eq) + exact he + +lemma mem_Her_of_nonneg_le {a b : A} (ha : 0 ≤ a) (hab : a ≤ b) : a ∈ Her b := by + have hb : 0 ≤ b := ha.trans hab + have hc : a ∈ closure (Her b : Set A) := by + rw [Metric.mem_closure_iff] + intro ε hε + have hden : 0 < 8 * ‖a‖ + 1 := by positivity + have hδ : 0 < ε ^ 2 / (8 * ‖a‖ + 1) := div_pos (sq_pos_of_pos hε) hden + obtain ⟨e, he, hesa, hen, hesmall⟩ := Her_exists_approx_unit hb hδ + refine ⟨e * a * e, ?_, ?_⟩ + · change e * a * e ∈ Her b + simpa only [hesa.star_eq] using Her_sandwich he a + · rw [dist_eq_norm] + have hsq := norm_compression_error_sq_le hesa hen ha hab + have hp : (8 * ‖a‖ + 1) * ‖b - e * b‖ < ε ^ 2 := by + have ht := mul_lt_mul_of_pos_left hesmall hden + rwa [mul_div_cancel₀ _ (ne_of_gt hden)] at ht + have hfinal : ‖a - e * a * e‖ ^ 2 < ε ^ 2 := by + nlinarith [norm_nonneg (b - e * b)] + exact (sq_lt_sq₀ (norm_nonneg _) hε.le).mp hfinal + rwa [(isClosed_Her b).closure_eq] at hc + +lemma Her_mono {a b : A} (ha : 0 ≤ a) (hab : a ≤ b) : Her a ≤ Her b := + Her_mono_of_mem (mem_Her_of_nonneg_le ha hab) + +omit [PartialOrder A] [StarOrderedRing A] in +lemma real_smul_mem_Her {h a : A} (ha : a ∈ Her h) (r : ℝ) : r • a ∈ Her h := by + change r • a ∈ (Her h).toSubmodule + simpa only [Complex.coe_smul] using (Her h).smul_mem (r : ℂ) ha + +lemma smul_Her_eq {h : A} (hh : 0 ≤ h) {r : ℝ} (hr : 0 < r) : + Her (r • h) = Her h := by + apply le_antisymm + · exact Her_mono_of_mem (real_smul_mem_Her (self_mem_Her hh) r) + · apply Her_mono_of_mem + have hm := real_smul_mem_Her (self_mem_Her (smul_nonneg hr.le hh)) r⁻¹ + simpa only [smul_smul, inv_mul_cancel₀ (ne_of_gt hr), one_smul] using hm + +lemma square_Her_eq {h : A} (hh : 0 ≤ h) : Her (h * h) = Her h := by + have hm : 0 ≤ h * h := by + simpa only [(IsSelfAdjoint.of_nonneg hh).star_eq] using star_mul_self_nonneg h + simpa only [CFC.sqrt_mul_self h hh] using (sqrt_Her_eq hm).symm + +lemma Her_eq_of_order_bounds {a b : A} (ha : 0 ≤ a) (hb : 0 ≤ b) + {r R : ℝ} (hr : 0 < r) (hR : 0 < R) (hl : r • a ≤ b) (hu : b ≤ R • a) : + Her b = Her a := by + apply le_antisymm + · simpa only [smul_Her_eq ha hR] using Her_mono hb hu + · simpa only [smul_Her_eq ha hr] using Her_mono (smul_nonneg hr.le ha) hl + +def cut (d : A) (ε : ℝ) : A := cfcₙ (fun t : ℝ => max (t - ε) 0) d + +lemma cut_nonneg (d : A) (ε : ℝ) : 0 ≤ cut d ε := by + exact cfcₙ_nonneg (fun _ _ => le_max_right _ _) + +lemma cut_mem_Her {d : A} (hd : 0 ≤ d) (ε : ℝ) : cut d ε ∈ Her d := by + exact cfcₙ_mem (𝕜' := ℂ) _ (self_mem_Her hd) + +lemma cut_sandwich_lower {d : A} (hd : IsSelfAdjoint d) {ε : ℝ} (hε : 0 ≤ ε) : + ε • (cut d ε * cut d ε) ≤ cut d ε * d * cut d ε := by + let f : ℝ → ℝ := fun t => max (t - ε) 0 + have hf : Continuous f := (continuous_id.sub continuous_const).max continuous_const + have hf0 : f 0 = 0 := by simp [f, max_eq_right (neg_nonpos.mpr hε)] + have hid : cfcₙ (fun t : ℝ => t) d = d := cfcₙ_id ℝ d hd + have hl : cfcₙ (fun t => ε * (f t * f t)) d = ε • (cut d ε * cut d ε) := by + rw [cfcₙ_const_mul ε (fun t => f t * f t) d (hf.mul hf).continuousOn + (by simp [hf0]), cfcₙ_mul f f d hf.continuousOn hf0 hf.continuousOn hf0] + rfl + have hu : cfcₙ (fun t => f t * t * f t) d = cut d ε * d * cut d ε := by + rw [cfcₙ_mul (fun t => f t * t) f d (hf.mul continuous_id).continuousOn + (by simp [hf0]) hf.continuousOn hf0, + cfcₙ_mul f (fun t => t) d hf.continuousOn hf0 continuousOn_id rfl, hid] + rfl + rw [← hl, ← hu] + apply (cfcₙ_le_iff _ _ d (continuous_const.mul (hf.mul hf)).continuousOn + ((hf.mul continuous_id).mul hf).continuousOn (by simp [hf0]) (by simp [hf0]) hd).mpr + intro t _ + by_cases ht : ε ≤ t + · calc + ε * (f t * f t) ≤ t * (f t * f t) := + mul_le_mul_of_nonneg_right ht (mul_self_nonneg _) + _ = f t * t * f t := by ring + · simp [f, max_eq_right (by linarith : t - ε ≤ 0)] + +lemma cut_transport_lower {d v s : A} (hd : 0 ≤ d) (hv : 0 ≤ v) + {ε : ℝ} (hε : 0 ≤ ε) : + (ε - ‖d - star s * v * s‖) • (cut d ε * cut d ε) ≤ + cut d ε * (star s * v * s) * cut d ε := by + let h := cut d ε + have hh : IsSelfAdjoint h := .of_nonneg (cut_nonneg d ε) + have hb : IsSelfAdjoint (d - star s * v * s) := + (IsSelfAdjoint.of_nonneg hd).sub (.of_nonneg (star_left_conjugate_nonneg hv s)) + have hbound : h * d * h - h * (star s * v * s) * h ≤ + ‖d - star s * v * s‖ • (h * h) := by + simpa only [hh.star_eq, mul_sub, sub_mul] using + CStarAlgebra.star_left_conjugate_le_norm_smul h (d - star s * v * s) hb + calc + (ε - ‖d - star s * v * s‖) • (h * h) = + ε • (h * h) - ‖d - star s * v * s‖ • (h * h) := sub_smul _ _ _ + _ ≤ h * d * h - ‖d - star s * v * s‖ • (h * h) := + sub_le_sub_right (cut_sandwich_lower (.of_nonneg hd) hε) _ + _ ≤ h * (star s * v * s) * h := (sub_le_comm).mp hbound + +theorem regularTransport_of_approx {d v s : A} (hd : 0 ≤ d) (hv : 0 ≤ v) + {ε : ℝ} (hε : 0 < ε) (hs : ‖d - star s * v * s‖ < ε) : + Nonempty (RegularTransport (cut d ε) v) := by + let h := cut d ε + let z := CFC.sqrt v * s * h + have hhpos : 0 ≤ h := cut_nonneg d ε + have hh : IsSelfAdjoint h := .of_nonneg hhpos + have hvroot : IsSelfAdjoint (CFC.sqrt v) := .of_nonneg (CFC.sqrt_nonneg v) + have hzz : star z * z = h * (star s * v * s) * h := by + simp only [z, star_mul, hh.star_eq, hvroot.star_eq] + calc + h * (star s * CFC.sqrt v) * (CFC.sqrt v * s * h) = + h * (star s * (CFC.sqrt v * CFC.sqrt v) * s) * h := by noncomm_ring + _ = _ := by rw [CFC.sqrt_mul_sqrt_self v hv] + have hspos : 0 ≤ star s * v * s := star_left_conjugate_nonneg hv s + have hh2pos : 0 ≤ h * h := by simpa only [hh.star_eq] using star_mul_self_nonneg h + have hl : (ε - ‖d - star s * v * s‖) • (h * h) ≤ star z * z := by + rw [hzz] + exact cut_transport_lower hd hv hε.le + have hu : star z * z ≤ (‖star s * v * s‖ + 1) • (h * h) := by + rw [hzz] + calc + h * (star s * v * s) * h ≤ ‖star s * v * s‖ • (h * h) := by + simpa only [hh.star_eq] using + CStarAlgebra.star_left_conjugate_le_norm_smul h (star s * v * s) (.of_nonneg hspos) + _ ≤ _ := smul_le_smul_of_nonneg_right (by linarith) hh2pos + have heq : Her (star z * z) = Her h := by + rw [Her_eq_of_order_bounds hh2pos (star_mul_self_nonneg z) + (sub_pos.mpr hs) (by positivity) hl hu, square_Her_eq hhpos] + let q := CFC.sqrt (star z * z) + have hq : star z * z = star q * q := by + rw [(IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg (star z * z))).star_eq] + exact (CFC.sqrt_mul_sqrt_self _ (star_mul_self_nonneg z)).symm + have hqHer : Her q = Her h := (sqrt_Her_eq (star_mul_self_nonneg z)).trans heq + have hrange : Her z ≤ Her v := by + calc + Her z = Her (CFC.sqrt v * (s * h)) := by simp only [z, mul_assoc] + _ ≤ Her (CFC.sqrt v) := Her_mul_le _ _ + _ = Her v := sqrt_Her_eq hv + let T : RegularTransport q v := { + carrier := carrier z q + hom := transportHom hq + inner := carrier_inner hq + outer := carrier_outer hq + mul := carrier_mul hq + image := fun k => hrange (conjugation_mem hq k) } + exact ⟨T.restrict hqHer.ge⟩ + +end Order + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/IdealComparison.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/IdealComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..cfe2e8416b8693fe782cbe1e2ac3e2aa56497700 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/IdealComparison.lean @@ -0,0 +1,164 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.ClosedIdeal +import OAI.Analysis.CStarAlgebra.PureInfiniteness.IdealDetection + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance idealComparisonPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance idealComparisonStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma ScalarCuntzLE.conjugate_scalar {u v : A} (h : ScalarCuntzLE u v) (x : A) : + ScalarCuntzLE (star x * u * x) v := by + have hc : Continuous (fun z : A => star x * z * x) := by fun_prop + have hm := image_closure_subset_closure_image hc ⟨u, h, rfl⟩ + apply closure_mono (s := (fun z : A => star x * z * x) '' + Set.range (fun w : A => star w * v * w)) _ hm + rintro _ ⟨_, ⟨w, rfl⟩, rfl⟩ + exact ⟨w * x, by simp only [star_mul, mul_assoc]⟩ + +lemma scalarCuntzLE_left_square (x z : A) : + ScalarCuntzLE (star (x * z) * (x * z)) (star z * z) := by + have hnorm : star x * x ≤ (‖x‖ ^ 2 + 1) • (1 : A) := by + apply (CStarAlgebra.star_mul_le_algebraMap_norm_sq (a := x)).trans + rw [Algebra.algebraMap_eq_smul_one] + exact smul_le_smul_of_nonneg_right (by linarith) (zero_le_one : (0 : A) ≤ 1) + have h := star_left_conjugate_le_conjugate hnorm z + have hh : star (x * z) * (x * z) ≤ (‖x‖ ^ 2 + 1) • (star z * z) := by + simpa only [star_mul, mul_assoc, mul_smul_comm, smul_mul_assoc, mul_one] using h + exact (scalarCuntzLE_of_order (star_mul_self_nonneg _) hh).trans + (scalarCuntzLE_smul (star_mul_self_nonneg _) (by positivity)) + +lemma scalarCuntzLE_add_of_proper {u w v : A} (hv : ProperlyInfinite v) + (hu : ScalarCuntzLE u v) (hw : ScalarCuntzLE w v) : ScalarCuntzLE (u + w) v := by + have h := ((scalarCuntzLE_iff_finite _ _).mp hu).block + ((scalarCuntzLE_iff_finite _ _).mp hw) + have heq : matrixBlock (scalarCorner v) (scalarCorner v) = doubleCorner v := by + rw [← diagonalCorner_one v, matrixBlock_diagonal] + rfl + rw [heq] at h + have hh := h.trans hv + let Y : CStarMatrix (Fin 2) (Fin 1) A := CStarMatrix.ofMatrix (fun _ _ => 1) + have hy : Y.conjTranspose * matrixBlock (scalarCorner u) (scalarCorner w) * Y = + scalarCorner (u + w) := by + apply CStarMatrix.ext + intro i j + fin_cases i + fin_cases j + simp only [CStarMatrix.mul_apply, Fin.sum_univ_two] + rw [Fin.sum_univ_two] + change ((star (1 : A) * u + star 1 * 0) * 1 + + (star 1 * 0 + star 1 * w) * 1) = u + w + simp + exact (scalarCuntzLE_iff_finite _ _).mpr (by simpa only [hy] using hh.conjugate Y) + +lemma square_add_le (x y : A) : + star (x + y) * (x + y) ≤ (2 : ℝ) • (star x * x + star y * y) := by + have hh := star_mul_self_nonneg (x - y) + have heq : (2 : ℝ) • (star x * x + star y * y) - star (x + y) * (x + y) = + star (x - y) * (x - y) := by + simp only [star_add, star_sub, two_smul] + noncomm_ring + rw [← sub_nonneg, heq] + exact hh + +lemma square_comparison_add {x y v : A} (hv : ProperlyInfinite v) + (hx : ScalarCuntzLE (star x * x) v) (hy : ScalarCuntzLE (star y * y) v) : + ScalarCuntzLE (star (x + y) * (x + y)) v := by + exact (scalarCuntzLE_of_order (star_mul_self_nonneg _) (square_add_le x y)).trans + ((scalarCuntzLE_smul (add_nonneg (star_mul_self_nonneg _) (star_mul_self_nonneg _)) + (by norm_num : (0 : ℝ) < 2)).trans (scalarCuntzLE_add_of_proper hv hx hy)) + +lemma idealSpan_square_comparison {v z : A} (hv : 0 ≤ v) (hpi : ProperlyInfinite v) + (hz : z ∈ idealSpan v) : ScalarCuntzLE (star z * z) v := by + induction hz using Submodule.span_induction with + | mem z hz => + obtain ⟨x, y, rfl⟩ := hz + have hvv : ScalarCuntzLE (star v * v) v := by + apply scalarCuntzLE_of_mem_Her (star_mul_self_nonneg _) hv + rw [hv.isSelfAdjoint.star_eq] + exact mul_mem (self_mem_Her hv) (self_mem_Her hv) + have hh := ((scalarCuntzLE_left_square x v).trans hvv).conjugate_scalar y + simpa only [star_mul, mul_assoc] using hh + | zero => + exact subset_closure ⟨0, by simp⟩ + | add x y hx hy ihx ihy => exact square_comparison_add hpi ihx ihy + | smul c x hx ih => + have hh := (scalarCuntzLE_left_square (c • (1 : A)) x).trans ih + simpa only [smul_mul_assoc, one_mul] using hh + +theorem closedIdeal_comparison {u v : A} (hu : 0 ≤ u) (hv : 0 ≤ v) + (hpi : ProperlyInfinite v) (h : u ∈ closedIdeal v hv.isSelfAdjoint) : + ScalarCuntzLE u v := by + let J := closedIdeal v hv.isSelfAdjoint + have hs : CFC.sqrt u ∈ J := by + rw [CFC.sqrt_eq_real_sqrt u hu] + let : IsClosed (J : Set A) := closedIdeal_closed v hv.isSelfAdjoint + exact cfcₙ_mem (𝕜' := ℂ) Real.sqrt h + have hc : Continuous (fun x : A => star x * x) := by fun_prop + have hh := image_closure_subset_closure_image hc ⟨CFC.sqrt u, hs, rfl⟩ + simp only [(CFC.sqrt_nonneg u).isSelfAdjoint.star_eq, CFC.sqrt_mul_sqrt_self u hu] at hh + apply isClosed_closure.closure_subset_iff.mpr _ hh + rintro _ ⟨x, hx, rfl⟩ + exact idealSpan_square_comparison hv hpi hx + +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance idealComparisonNonUnitalPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance idealComparisonNonUnitalStarOrderedRing : StarOrderedRing A := + CStarAlgebra.spectralOrderedRing A + +lemma scalarCuntzLE_of_inr {u v : A} (hv : 0 ≤ v) + (h : ScalarCuntzLE (Unitization.inr u : Unitization ℂ A) (Unitization.inr v)) : + ScalarCuntzLE u v := by + let V : Unitization ℂ A := Unitization.inr v + have hc : IsClosed {z : Unitization ℂ A | ScalarCuntzLE z.snd v} := + isClosed_closure.preimage Unitization.continuous_snd + apply closure_minimal (s := Set.range (fun w : Unitization ℂ A => star w * V * w)) _ hc h + rintro _ ⟨w, rfl⟩ + change ScalarCuntzLE (star w * V * w).snd v + let hau := CStarAlgebra.increasingApproximateUnit A + let x := CFC.sqrt v + have hxx : star x * x = v := by + rw [(CFC.sqrt_nonneg v).isSelfAdjoint.star_eq, CFC.sqrt_mul_sqrt_self v] + have ht : Tendsto (fun e : A => star (x * e) * (x * e)) + (CStarAlgebra.approximateUnit A) (𝓝 v) := by + simpa only [hxx] using (hau.tendsto_mul_left x).star.mul (hau.tendsto_mul_left x) + have hti := (Unitization.continuous_inr (𝕜 := ℂ)).tendsto v |>.comp ht + have htfinal : Tendsto + (fun e : A => (star w * (Unitization.inr (star (x*e)*(x*e)) : Unitization ℂ A) * w).snd) + (CStarAlgebra.approximateUnit A) (𝓝 (star w * V * w).snd) := + Unitization.continuous_snd.tendsto _ |>.comp (tendsto_const_nhds.mul hti |>.mul tendsto_const_nhds) + apply isClosed_closure.mem_of_tendsto htfinal + apply Filter.Eventually.of_forall + intro e + let r : A := ((Unitization.inr e : Unitization ℂ A) * w).snd + have hr : (Unitization.inr r : Unitization ℂ A) = Unitization.inr e * w := by + have he := Unitization.inl_fst_add_inr_snd_eq ((Unitization.inr e : Unitization ℂ A) * w) + simpa [r] using he + have heq : (star w * (Unitization.inr (star (x*e)*(x*e)) : Unitization ℂ A) * w).snd = + star r * v * r := by + apply Unitization.inr_injective (R := ℂ) + have hs : (Unitization.inr (star r * v * r) : Unitization ℂ A) = + star w * Unitization.inr (star (x*e)*(x*e)) * w := by + simp only [Unitization.inr_mul, Unitization.inr_star, hr, star_mul] + have hx := congrArg (Unitization.inr : A → Unitization ℂ A) hxx + simp only [Unitization.inr_mul, Unitization.inr_star] at hx + simp only [mul_assoc] at hx ⊢ + rw [← hx] + simp only [mul_assoc] + rw [← hs] + rfl + exact heq ▸ subset_closure ⟨r, rfl⟩ + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/IdealDetection.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/IdealDetection.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5ae5edd6885ad449c4823217f9f828093fcba0a --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/IdealDetection.lean @@ -0,0 +1,192 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.PositiveFunctional +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Separation + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +universe u +variable {A : Type u} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def compressedPositive (f : A →ₚ[ℂ] ℂ) (u : A) : A →ₚ[ℂ] ℂ where + toFun a := f (star u * a * u) + map_add' a b := by simp only [mul_add, add_mul, map_add] + map_smul' c a := by simp only [mul_smul_comm, smul_mul_assoc, map_smul, RingHom.id_apply] + monotone' := fun _ _ hab => f.monotone (star_left_conjugate_le_conjugate hab _) + +lemma compressedPositive_norm (f : A →ₚ[ℂ] ℂ) (hf : ∀ a, ‖f a‖ ≤ ‖a‖) + {u : A} (hu : ‖u‖ ≤ 1) (a : A) : ‖compressedPositive f u a‖ ≤ ‖a‖ := by + calc + ‖compressedPositive f u a‖ ≤ ‖star u * a * u‖ := hf _ + _ ≤ ‖u‖ * ‖a‖ * ‖u‖ := by + grw [norm_mul_le, norm_mul_le, norm_star] + _ ≤ 1 * ‖a‖ * 1 := by gcongr + _ = ‖a‖ := by ring + +lemma compressedPositive_square (f : A →ₚ[ℂ] ℂ) (u a : A) : + compressedPositive f u (star a * a) = f (star (a * u) * (a * u)) := by + change f (star u * (star a * a) * u) = _ + simp only [star_mul, mul_assoc] + +lemma norm_one_sub_positive_contraction {e : A} (he : 0 ≤ e) (hen : ‖e‖ ≤ 1) : + ‖1 - e‖ ≤ 1 := by + have he1 : e ≤ 1 := (CStarAlgebra.norm_le_one_iff_of_nonneg e he).mp hen + exact (CStarAlgebra.norm_le_one_iff_of_nonneg (1 - e) (sub_nonneg.mpr he1)).mpr + (sub_le_self _ he) + +lemma exists_rep_killing_ideal (J : NonUnitalStarSubalgebra ℂ A) + (hJ : IsClosed (J : Set A)) + (hleft : ∀ a : A, ∀ z ∈ J, a * z ∈ J) + (hright : ∀ a : A, ∀ z ∈ J, z * a ∈ J) + {a : A} (ha : a ∉ J) : + ∃ R : HilbertRep.{u,u} A, (∀ z ∈ J, R.hom z = 0) ∧ R.hom a ≠ 0 := by + classical + have : Nontrivial A := ⟨⟨a, 0, fun h => ha (h.symm ▸ J.zero_mem)⟩⟩ + have : CompleteSpace J := hJ.completeSpace_coe + let : PartialOrder J := CStarAlgebra.spectralOrder J + let : StarOrderedRing J := CStarAlgebra.spectralOrderedRing J + have hau := CStarAlgebra.increasingApproximateUnit J + let I := {e : J // @LE.le J (CStarAlgebra.spectralOrder J).toLE 0 e ∧ ‖e‖ ≤ 1} + let F : Filter I := Filter.comap Subtype.val (CStarAlgebra.approximateUnit J) + have : F.NeBot := Filter.NeBot.comap_of_range_mem inferInstance (by + filter_upwards [hau.eventually_nonneg.and hau.eventually_norm] with e he + exact ⟨⟨e, he⟩, rfl⟩) + let ω := Ultrafilter.of F + have hω : (ω : Filter I) ≤ F := Ultrafilter.of_le F + have hunit (z : J) : Tendsto (fun e : I => (z : A) * (1 - (e.val : A))) + (ω : Filter I) (𝓝 0) := by + have hh := (continuous_subtype_val.tendsto z).comp + (hau.tendsto_mul_left z |>.comp (Filter.tendsto_comap.mono_left hω)) + have hz := (tendsto_const_nhds (x := (z : A))).sub hh + convert hz using 1 <;> simp only [mul_sub, mul_one, sub_self] + rfl + have hadef : a ∉ closure (J : Set A) := by rwa [hJ.closure_eq] + rw [Metric.mem_closure_iff] at hadef + push Not at hadef + obtain ⟨r, hr, hdist⟩ := hadef + have hlower (e : I) : r ≤ ‖a * (1 - (e.val : A))‖ := by + have hh := hdist (a * (e.val : A)) (hleft a _ e.val.property) + simpa only [dist_eq_norm, mul_sub, mul_one] using hh + have hen (e : I) : ‖1 - (e.val : A)‖ ≤ 1 := by + apply norm_one_sub_positive_contraction + · obtain ⟨b, hb⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp e.property.1 + have hm := congrArg (fun z : J => (z : A)) hb + change (e.val : A) = star (b : A) * (b : A) at hm + rw [hm] + exact star_mul_self_nonneg _ + · exact e.property.2 + have hex (e : I) := exists_norming_positive (A := A) + (star_mul_self_nonneg (a * (1 - (e.val : A)))) + choose f hf hfa using hex + let g (e : I) := compressedPositive (f e) (1 - (e.val : A)) + have hg (e : I) (z : A) : ‖g e z‖ ≤ ‖z‖ := compressedPositive_norm (f e) (hf e) (hen e) z + let L := ultraPositive ω g hg + have hL (z : A) (hz : z ∈ J) : L.gnsStarAlgHom z = 0 := by + change L.gnsNonUnitalStarAlgHom z = 0 + apply gns_zero_of_sandwich + intro b + apply ultraPositive_eq_zero_of_tendsto + have hlim := (hunit ⟨z * b, hright b z hz⟩).norm + apply squeeze_zero_norm (fun e => ?_) (by simpa only [norm_zero, mul_zero] using hlim.mul hlim) + calc + ‖g e (star (z * b) * (z * b))‖ = + ‖f e (star ((z * b) * (1 - (e.val : A))) * ((z * b) * (1 - (e.val : A))))‖ := by + change ‖compressedPositive (f e) (1 - (e.val : A)) (star (z * b) * (z * b))‖ = _ + rw [compressedPositive_square] + _ ≤ ‖star ((z * b) * (1 - (e.val : A))) * ((z * b) * (1 - (e.val : A)))‖ := hf e _ + _ = _ := CStarRing.norm_star_mul_self + have hnon : L (star a * a) ≠ 0 := by + have hv (e : I) : g e (star a * a) = (‖a * (1 - (e.val : A))‖ ^ 2 : ℝ) := by + change compressedPositive (f e) (1 - (e.val : A)) (star a * a) = _ + rw [compressedPositive_square, hfa e, CStarRing.norm_star_mul_self, pow_two] + have hb : (r ^ 2 : ℂ) ≤ L (star a * a) := + ge_of_tendsto' (tendsto_ultraPositive ω g hg _) (fun e => by + rw [hv e] + exact_mod_cast pow_le_pow_left₀ hr.le (hlower e) 2) + intro heq + rw [heq] at hb + have : r ^ 2 ≤ 0 := by exact_mod_cast hb + nlinarith + exact ⟨⟨L.GNS, L.gnsStarAlgHom⟩, hL, gnsStar_nonzero_of_value L a hnon⟩ +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance idealDetectionOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance idealDetectionStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +def ScalarCuntzLE (u v : A) : Prop := + u ∈ closure (Set.range (fun w : A => star w * v * w)) + +lemma scalarCuntzLE_iff_finite (u v : A) : + ScalarCuntzLE u v ↔ FiniteCuntzLE (scalarCorner u) (scalarCorner v) := by + let E : A ≃⋆ₐ[ℂ] CStarMatrix (Fin 1) (Fin 1) A := + CStarMatrix.toOneByOne (Fin 1) ℂ A + have hc : Continuous E := (StarAlgEquiv.isometry E).continuous + have hci : Continuous E.symm := (StarAlgEquiv.isometry E.symm).continuous + rw [finiteCuntzLE_iff_closure] + change u ∈ closure (Set.range (fun w : A => star w * v * w)) ↔ + E u ∈ closure (Set.range (fun w : CStarMatrix (Fin 1) (Fin 1) A => + star w * E v * w)) + constructor + · intro h + apply closure_mono (s := E '' Set.range (fun w : A => star w * v * w)) _ + (image_closure_subset_closure_image hc ⟨u, h, rfl⟩) + rintro _ ⟨_, ⟨w, rfl⟩, rfl⟩ + exact ⟨E w, by simp [map_star]⟩ + · intro h + have hh := image_closure_subset_closure_image hci ⟨E u, h, rfl⟩ + simp only [StarAlgEquiv.symm_apply_apply] at hh + apply closure_mono (s := E.symm '' Set.range (fun w => star w * E v * w)) _ hh + rintro _ ⟨_, ⟨w, rfl⟩, rfl⟩ + exact ⟨E.symm w, by simp [map_star]⟩ + +lemma ScalarCuntzLE.exists_approx {u v : A} (h : ScalarCuntzLE u v) + {ε : ℝ} (hε : 0 < ε) : ∃ w : A, ‖star w * v * w - u‖ < ε := by + obtain ⟨_, ⟨w, rfl⟩, hw⟩ := Metric.mem_closure_iff.mp h ε hε + exact ⟨w, by simpa only [dist_eq_norm, norm_sub_rev] using hw⟩ + +lemma ScalarCuntzLE.trans {u v w : A} (h : ScalarCuntzLE u v) + (h' : ScalarCuntzLE v w) : ScalarCuntzLE u w := + (scalarCuntzLE_iff_finite _ _).mpr + (((scalarCuntzLE_iff_finite _ _).mp h).trans ((scalarCuntzLE_iff_finite _ _).mp h')) + +lemma scalarCuntzLE_of_mem_Her {u v : A} (hu : 0 ≤ u) (hv : 0 ≤ v) + (h : u ∈ Her v) : ScalarCuntzLE u v := by + have hs := sqrt_mem_Her h hu + have hc : Continuous (fun z : A => star z * z) := by fun_prop + have hm := image_closure_subset_closure_image hc ⟨CFC.sqrt u, hs, rfl⟩ + simp only [(CFC.sqrt_nonneg u).isSelfAdjoint.star_eq, CFC.sqrt_mul_sqrt_self u hu] at hm + apply closure_mono (s := (fun z : A => star z * z) '' + Set.range (fun w : A => v * w * star v)) _ hm + rintro _ ⟨_, ⟨w, rfl⟩, rfl⟩ + refine ⟨CFC.sqrt v * w * v, ?_⟩ + have hsv := (CFC.sqrt_nonneg v).isSelfAdjoint.star_eq + have hsq := CFC.sqrt_mul_sqrt_self v hv + simp only [star_mul, hv.isSelfAdjoint.star_eq, hsv, mul_assoc] + have hh : CFC.sqrt v * v * CFC.sqrt v = v * v := by + calc + _ = CFC.sqrt v * (CFC.sqrt v * CFC.sqrt v) * CFC.sqrt v := + congrArg (fun t => CFC.sqrt v * t * CFC.sqrt v) hsq.symm + _ = (CFC.sqrt v * CFC.sqrt v) * (CFC.sqrt v * CFC.sqrt v) := by noncomm_ring + _ = v * v := by rw [hsq] + calc + _ = v * star w * (CFC.sqrt v * v * CFC.sqrt v) * w * v := by noncomm_ring + _ = _ := by rw [hh]; noncomm_ring + +lemma scalarCuntzLE_of_order {u v : A} (hu : 0 ≤ u) (h : u ≤ v) : + ScalarCuntzLE u v := scalarCuntzLE_of_mem_Her hu (hu.trans h) (mem_Her_of_nonneg_le hu h) + +lemma scalarCuntzLE_smul {v : A} (hv : 0 ≤ v) {K : ℝ} (hK : 0 < K) : + ScalarCuntzLE (K • v) v := by + apply scalarCuntzLE_of_mem_Her (smul_nonneg hK.le hv) hv + exact real_smul_mem_Her (self_mem_Her hv) K + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Main.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..861b2dd58768f10dd857a205ab047763cbc4e9fa --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Main.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Diagonalization +import OAI.Analysis.CStarAlgebra.PureInfiniteness.MatrixEntries + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap.Manuscript +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance positivityOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance positivityStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +def CuntzLE (d v : Stable.Stabilization A) : Prop := + ∃ r : ℕ → Stable.Stabilization A, + Tendsto (fun j => star (r j) * v * r j) atTop (𝓝 d) + +def ProperlyInfinite (h : A) : Prop := + CuntzLE ((⟦⟨2, MainGap.doubleCorner h⟩⟧ : Stable.Algebraic A) : Stable.Stabilization A) + ((⟦⟨1, MainGap.scalarCorner h⟩⟧ : Stable.Algebraic A) : Stable.Stabilization A) + +def PropertyP (A : Type*) [NonUnitalCStarAlgebra A] : Prop := + ∀ h : A, 0 ≤ h → ProperlyInfinite h + +lemma finiteCuntzLE_of_stable {m n : ℕ} (d : Stable.Mat A n) (v : Stable.Mat A m) + (h : CuntzLE (Stable.corner n d) (Stable.corner m v)) : MainGap.FiniteCuntzLE d v := by + obtain ⟨r,hr⟩ := h + refine ⟨fun j => Stable.block m n (r j), ?_⟩ + have ht := (Stable.continuous_block (A := A) n n).continuousAt.tendsto.comp hr + simpa only [Function.comp_def, Stable.block_conjugate, Stable.block_corner_self] using ht + +lemma PropertyP.finite (hP : PropertyP A) : MainGap.PropertyP A := by + intro h hh + exact finiteCuntzLE_of_stable _ _ (hP h hh) + +theorem individual_to_strong (hP : PropertyP A) : MainGap.UnrestrictedDiagonalization A := + MainGap.individual_to_strong hP.finite + +theorem individual_to_strong_spi (hP : PropertyP A) : MainGap.StronglyPurelyInfinite A := + MainGap.individual_to_strong_spi hP.finite + +theorem individual_to_strong_main (hP : PropertyP A) : + (∀ a b : A, 0 ≤ a → 0 ≤ b → ∀ c : A, ∀ ε : ℝ, 0 < ε → + ∃ s t : A, + ‖star s * a * s - a‖ < ε ∧ + ‖star t * b * t - b‖ < ε ∧ + ‖star s * c * t‖ < ε) ∧ + MainGap.StronglyPurelyInfinite A := by + exact ⟨individual_to_strong hP, individual_to_strong_spi hP⟩ + +end MainGap.Manuscript + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/MatrixEntries.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/MatrixEntries.lean new file mode 100644 index 0000000000000000000000000000000000000000..9e281f6112b179d7125df03ee1704151332b2dea --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/MatrixEntries.lean @@ -0,0 +1,166 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Stabilization + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap.Stable +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance matrixEntryOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance matrixEntryStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance algebraicTopology' : TopologicalSpace (Algebraic A) := + (inferInstance : PseudoMetricSpace (Algebraic A)).toUniformSpace.toTopologicalSpace + +def paddedEntry (i j n : ℕ) (x : Mat A n) : A := + if hi : i < n then if hj : j < n then x ⟨i,hi⟩ ⟨j,hj⟩ else 0 else 0 + +lemma paddedEntry_pad (i j : ℕ) {n m : ℕ} (h : n ≤ m) (x : Mat A n) : + paddedEntry i j m (pad h x) = paddedEntry i j n x := by + by_cases hi : i < n <;> by_cases hj : j < n + · have hi' := lt_of_lt_of_le hi h + have hj' := lt_of_lt_of_le hj h + simp [paddedEntry, hi, hj, hi', hj', pad_entry] + · by_cases hi' : i < m <;> by_cases hj' : j < m <;> + simp [paddedEntry, hi, hj, hi', hj', pad_entry] + · by_cases hi' : i < m <;> by_cases hj' : j < m <;> + simp [paddedEntry, hi, hi', hj', pad_entry] + · by_cases hi' : i < m <;> by_cases hj' : j < m <;> + simp [paddedEntry, hi, hi', hj', pad_entry] + +def entryAlgLinear (i j : ℕ) : Algebraic A →ₗ[ℂ] A where + toFun := DirectLimit.lift _ (paddedEntry i j) (fun _ _ h x => (paddedEntry_pad i j h x).symm) + map_add' := DirectLimit.induction₂ _ fun n x y => by + rw [DirectLimit.add_def] + change paddedEntry i j n (x+y) = paddedEntry i j n x + paddedEntry i j n y + by_cases hi : i < n <;> by_cases hj : j < n <;> simp [paddedEntry, hi, hj] + map_smul' c := DirectLimit.induction _ fun n x => by + rw [DirectLimit.smul_def] + change paddedEntry i j n (c • x) = c • paddedEntry i j n x + by_cases hi : i < n <;> by_cases hj : j < n <;> simp [paddedEntry, hi, hj] + +@[simp] lemma entryAlgLinear_corner (i j n : ℕ) (x : Mat A n) : + entryAlgLinear i j (cornerAlg n x) = paddedEntry i j n x := rfl + +lemma norm_entryAlgLinear_le (i j : ℕ) (x : Algebraic A) : + ‖entryAlgLinear i j x‖ ≤ ‖x‖ := by + induction x using DirectLimit.induction with + | ih n x => + change ‖paddedEntry i j n x‖ ≤ ‖x‖ + by_cases hi : i < n <;> by_cases hj : j < n + · simpa [paddedEntry, hi, hj] using + (CStarMatrix.norm_entry_le_norm (M := x) (i := ⟨i,hi⟩) (j := ⟨j,hj⟩)) + all_goals simp [paddedEntry, hi, hj] + +def entryAlg (i j : ℕ) : Algebraic A →L[ℂ] A := + (entryAlgLinear i j).mkContinuous 1 (fun x => by simpa using norm_entryAlgLinear_le i j x) + +def entry (i j : ℕ) : Stabilization A → A := + UniformSpace.Completion.extension (entryAlg (A := A) i j) + +lemma continuous_entry (i j : ℕ) : Continuous (entry (A := A) i j) := + UniformSpace.Completion.continuous_extension + +@[simp] lemma entry_coe (i j : ℕ) (x : Algebraic A) : + entry i j (x : Stabilization A) = entryAlg (A := A) i j x := by + unfold entry + exact UniformSpace.Completion.extension_coe (f := (entryAlg (A := A) i j)) + (ContinuousLinearMap.uniformContinuous (entryAlg (A := A) i j)) x + +@[simp] lemma entry_corner (i j n : ℕ) (x : Mat A n) : + entry i j (corner n x) = paddedEntry i j n x := by + rw [corner_apply, entry_coe] + rfl + +def block (m n : ℕ) (x : Stabilization A) : CStarMatrix (Fin m) (Fin n) A := + CStarMatrix.ofMatrix fun i j => entry i.val j.val x + +@[simp] lemma block_apply (m n : ℕ) (x : Stabilization A) (i : Fin m) (j : Fin n) : + block m n x i j = entry i.val j.val x := rfl + +lemma continuous_block (m n : ℕ) : Continuous (block (A := A) m n) := by + exact continuous_pi fun i => continuous_pi fun j => (continuous_entry i.val j.val) + +@[simp] lemma block_corner_self (n : ℕ) (x : Mat A n) : block n n (corner n x) = x := by + ext i j + simp only [block_apply, entry_corner, paddedEntry, dite_eq_left i.isLt, dite_eq_left j.isLt] + +end MainGap.Stable + +namespace MainGap.Stable +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance blockConjugateOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance blockConjugateStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance algebraicTopology'' : TopologicalSpace (Algebraic A) := + (inferInstance : PseudoMetricSpace (Algebraic A)).toUniformSpace.toTopologicalSpace + +lemma paddedEntry_star (i j n : ℕ) (x : Mat A n) : + paddedEntry i j n (star x) = star (paddedEntry j i n x) := by + by_cases hi : i < n <;> by_cases hj : j < n <;> + simp [paddedEntry, hi, hj, CStarMatrix.star_apply] + +lemma paddedEntry_mul (i j n : ℕ) (x y : Mat A n) : + paddedEntry i j n (x*y) = + ∑ k : Fin n, paddedEntry i k.val n x * paddedEntry k.val j n y := by + by_cases hi : i < n <;> by_cases hj : j < n <;> + simp [paddedEntry, hi, hj, CStarMatrix.mul_apply] + +lemma paddedEntry_conjugate (i j : ℕ) {m N : ℕ} (h : m ≤ N) + (z : Mat A N) (v : Mat A m) : + paddedEntry i j N (star z * pad h v * z) = + ∑ q : Fin m, ∑ p : Fin m, + star (paddedEntry p.val i N z) * v p q * paddedEntry q.val j N z := by + classical + simp only [paddedEntry_mul, paddedEntry_star, paddedEntry_pad] + rw [← sum_pad h (fun q : Fin m => ∑ p : Fin m, + star (paddedEntry p.val i N z) * v p q * paddedEntry q.val j N z)] + apply Finset.sum_congr rfl + intro q _ + by_cases hq : q.val < m + · rw [dite_eq_left hq, Finset.sum_mul] + rw [← sum_pad h (fun p : Fin m => + star (paddedEntry p.val i N z) * v p ⟨q,hq⟩ * paddedEntry q.val j N z)] + apply Finset.sum_congr rfl + intro p _ + by_cases hp : p.val < m <;> simp [paddedEntry, hp, hq] + · simp [paddedEntry, hq] + +lemma block_conjugate_corner {m N : ℕ} (h : m ≤ N) (n : ℕ) + (v : Mat A m) (z : Mat A N) : + block n n (star (corner N z) * corner m v * corner N z) = + (block m n (corner N z)).conjTranspose * v * block m n (corner N z) := by + rw [← corner_pad h v] + have he : star (corner N z) * corner N (pad h v) * corner N z = + corner N (star z * pad h v * z) := by rw [map_mul, map_mul, map_star] + rw [he] + ext i j + simp only [block_apply, entry_corner, CStarMatrix.mul_apply, + CStarMatrix.conjTranspose_apply, Finset.sum_mul] + exact paddedEntry_conjugate i.val j.val h z v + +lemma block_conjugate (m n : ℕ) (v : Mat A m) (x : Stabilization A) : + block n n (star x * corner m v * x) = + (block m n x).conjTranspose * v * block m n x := by + refine UniformSpace.Completion.induction_on x ?_ ?_ + · apply isClosed_eq + · exact (continuous_block n n).comp ((continuous_star.mul continuous_const).mul continuous_id) + · have hc : Continuous (fun x : Stabilization A => (block m n x).conjTranspose) := by + change Continuous (fun x : Stabilization A => + fun i j => star (block m n x j i)) + exact continuous_pi fun i => continuous_pi fun j => + continuous_star.comp (continuous_entry j.val i.val) + exact (hc.matrix_mul continuous_const).matrix_mul (continuous_block m n) + · intro z + induction z using DirectLimit.induction with + | ih k z => + change block n n (star (corner k z) * corner m v * corner k z) = + (block m n (corner k z)).conjTranspose * v * block m n (corner k z) + rw [← corner_pad (le_max_right m k) z] + exact block_conjugate_corner (le_max_left m k) n v _ + +end MainGap.Stable + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Nonvanishing.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Nonvanishing.lean new file mode 100644 index 0000000000000000000000000000000000000000..b759f61b522dabcc65cb82a51148d3d705726825 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Nonvanishing.lean @@ -0,0 +1,138 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Graph + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +universe u v +variable {A : Type u} [CStarAlgebra A] +local instance nonvanishingPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance nonvanishingStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance nonvanishingOperatorPartialOrder (J : Type*) + [NormedAddCommGroup J] [InnerProductSpace ℂ J] [CompleteSpace J] : + PartialOrder (J →L[ℂ] J) := CStarAlgebra.spectralOrder _ +local instance nonvanishingOperatorStarOrderedRing (J : Type*) + [NormedAddCommGroup J] [InnerProductSpace ℂ J] [CompleteSpace J] : + StarOrderedRing (J →L[ℂ] J) := CStarAlgebra.spectralOrderedRing _ +lemma cut_eq_zero_of_norm_le {a : A} (ha : 0 ≤ a) {l : ℝ} (hl : ‖a‖ ≤ l) : + cut a l = 0 := by + apply norm_eq_zero.mp + apply le_antisymm _ (norm_nonneg _) + change ‖cfcₙ (fun t : ℝ => max (t-l) 0) a‖ ≤ 0 + apply norm_cfcₙ_le + intro r hr + have hb := NonUnitalIsometricContinuousFunctionalCalculus.norm_quasispectrum_le a hr + ha.isSelfAdjoint + have hb' : |r| ≤ ‖a‖ := by simpa only [Real.norm_eq_abs] using hb + have ht : r ≤ l := (le_abs_self r).trans (hb'.trans hl) + rw [max_eq_right (sub_nonpos.mpr ht), norm_zero] + +theorem quantitative_nonvanishing {d y : A} (hy : 0 ≤ y) + (h : ∀ R : HilbertRep.{u,u} A, R.hom d=0 → ‖R.hom y‖ ≤ (1/4 : ℝ)) : + ∃ δ : ℝ, 0 < δ ∧ δ < 1 ∧ ∀ R : HilbertRep.{u,u} A, + (3/8 : ℝ) < ‖R.hom y‖ → δ < ‖R.hom d‖ := by + classical + by_contra! hh + let η : ℕ → ℝ := fun n => 1 / ((n : ℝ)+2) + have hηpos (n : ℕ) : 0 < η n := by dsimp [η]; positivity + have hηlt (n : ℕ) : η n < 1 := by + dsimp [η] + apply (div_lt_one (by positivity)).mpr + linarith [Nat.cast_nonneg (α := ℝ) n] + have hbad (n : ℕ) : ∃ R : HilbertRep.{u,u} A, + (3/8 : ℝ) < ‖R.hom y‖ ∧ ‖R.hom d‖ ≤ η n := hh (η n) (hηpos n) (hηlt n) + choose R hRy hRd using hbad + let π := fun n => (R n).hom + let a := cut y (5/16) + have ha : ∀ n, (1/16 : ℝ) < ‖π n a‖ := by + intro n + have h₁ : ‖π n y - π n a‖ ≤ (5/16 : ℝ) := by + rw [← map_sub] + exact (NonUnitalStarAlgHom.norm_apply_le (π n) _).trans + (norm_sub_cut_le hy (by norm_num)) + have h₂ := norm_sub_norm_le (π n y) (π n a) + have h₃ := hRy n + change (3/8 : ℝ) < ‖π n y‖ at h₃ + linarith + choose ξ hξ hξa using fun n => (π n a).exists_lt_apply_of_lt_opNorm (ha n) + have hnξ : ∀ n, ‖ξ n‖ ≤ 1 := fun n => (hξ n).le + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + have hω : (ω : Filter ℕ) ≤ atTop := Ultrafilter.of_le _ + have hη : Tendsto η (ω : Filter ℕ) (𝓝 0) := by + have he : η = fun n : ℕ => 1 / (((n+1 : ℕ) : ℝ)+1) := by + funext n + dsimp [η] + push_cast + congr 1; ring + rw [he] + exact ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).comp + (tendsto_add_atTop_nat 1)).mono_left hω + let ρ : HilbertRep.{u,u} A := ⟨LimitHilbert ω π ξ hnξ, limitRep ω π ξ hnξ⟩ + have hd₀ : ρ.hom d=0 := limitRep_annihilates ω π ξ hnξ d + (squeeze_zero (fun n => norm_nonneg _) hRd hη) + have han : ρ.hom a ≠ 0 := limitRep_nonzero ω π ξ hnξ a (by norm_num : (0:ℝ)<1/16) + (Filter.Eventually.of_forall (fun n => (hξa n).le)) + apply han + change ρ.hom (cut y (5/16))=0 + rw [map_cut_sa ρ.hom hy.isSelfAdjoint (by norm_num)] + exact cut_eq_zero_of_norm_le (map_nonneg ρ.hom hy) ((h ρ hd₀).trans (by norm_num)) + +theorem quantitative_nonvanishing_general {d y : A} (hy : 0 ≤ y) + {s s' : ℝ} (hs : 0 ≤ s) (hss : s < s') + (h : ∀ R : HilbertRep.{u,u} A, R.hom d=0 → ‖R.hom y‖ ≤ s) : + ∃ δ : ℝ, 0 < δ ∧ δ < 1 ∧ ∀ R : HilbertRep.{u,u} A, + s' < ‖R.hom y‖ → δ < ‖R.hom d‖ := by + classical + by_contra! hh + let η : ℕ → ℝ := fun n => 1 / ((n : ℝ)+2) + have hηpos (n : ℕ) : 0 < η n := by dsimp [η]; positivity + have hηlt (n : ℕ) : η n < 1 := by + dsimp [η] + apply (div_lt_one (by positivity)).mpr + linarith [Nat.cast_nonneg (α := ℝ) n] + have hbad (n : ℕ) : ∃ R : HilbertRep.{u,u} A, + s' < ‖R.hom y‖ ∧ ‖R.hom d‖ ≤ η n := hh (η n) (hηpos n) (hηlt n) + choose R hRy hRd using hbad + let π := fun n => (R n).hom + let a := cut y ((s+s')/2) + have ha : ∀ n, ((s'-s)/2) < ‖π n a‖ := by + intro n + have h₁ : ‖π n y - π n a‖ ≤ ((s+s')/2) := by + rw [← map_sub] + exact (NonUnitalStarAlgHom.norm_apply_le (π n) _).trans + (norm_sub_cut_le hy (by linarith)) + have h₂ := norm_sub_norm_le (π n y) (π n a) + have h₃ := hRy n + change s' < ‖π n y‖ at h₃ + linarith + choose ξ hξ hξa using fun n => (π n a).exists_lt_apply_of_lt_opNorm (ha n) + have hnξ : ∀ n, ‖ξ n‖ ≤ 1 := fun n => (hξ n).le + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + have hω : (ω : Filter ℕ) ≤ atTop := Ultrafilter.of_le _ + have hη : Tendsto η (ω : Filter ℕ) (𝓝 0) := by + have he : η = fun n : ℕ => 1 / (((n+1 : ℕ) : ℝ)+1) := by + funext n + dsimp [η] + push_cast + congr 1; ring + rw [he] + exact ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).comp + (tendsto_add_atTop_nat 1)).mono_left hω + let ρ : HilbertRep.{u,u} A := ⟨LimitHilbert ω π ξ hnξ, limitRep ω π ξ hnξ⟩ + have hd₀ : ρ.hom d=0 := limitRep_annihilates ω π ξ hnξ d + (squeeze_zero (fun n => norm_nonneg _) hRd hη) + have han : ρ.hom a ≠ 0 := limitRep_nonzero ω π ξ hnξ a (by linarith : (0:ℝ)<(s'-s)/2) + (Filter.Eventually.of_forall (fun n => (hξa n).le)) + apply han + change ρ.hom (cut y ((s+s')/2))=0 + rw [map_cut_sa ρ.hom hy.isSelfAdjoint (by linarith)] + exact cut_eq_zero_of_norm_le (map_nonneg ρ.hom hy) ((h ρ hd₀).trans (by linarith)) + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/OrthogonalSlots.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/OrthogonalSlots.lean new file mode 100644 index 0000000000000000000000000000000000000000..372c884ecabe3e4eedc20d975928ac062d0b8353 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/OrthogonalSlots.lean @@ -0,0 +1,395 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Comparison + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +open scoped CStarAlgebra +local instance orthogonalSlotsPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance orthogonalSlotsStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance orthogonalSlotsMatrixIsScalarTower (n : ℕ) : + IsScalarTower ℝ (CStarMatrix (Fin n) (Fin n) A) + (CStarMatrix (Fin n) (Fin n) A) where + smul_assoc r x y := CStarMatrix.smul_mul r x y +local instance orthogonalSlotsMatrixSMulCommClass (n : ℕ) : + SMulCommClass ℝ (CStarMatrix (Fin n) (Fin n) A) + (CStarMatrix (Fin n) (Fin n) A) where + smul_comm r x y := (CStarMatrix.mul_smul x r y).symm + +lemma cut_map {B : Type*} [NonUnitalCStarAlgebra B] + (f : A →⋆ₙₐ[ℂ] B) (a : A) (ε : ℝ) (ha : IsSelfAdjoint a) (hε : 0 ≤ ε) : + cut (f a) ε = f (cut a ε) := + (f.map_cfcₙ (q := IsSelfAdjoint) (fun t : ℝ => max (t-ε) 0) a + (hf₀ := by simp [hε]) (ha := ha)).symm + +def entry {n : ℕ} (i j : Fin n) (a : A) : CStarMatrix (Fin n) (Fin n) A := + CStarMatrix.ofMatrix (Matrix.single i j a) + +@[simp] lemma entry_apply {n : ℕ} (i j k l : Fin n) (a : A) : + entry i j a k l = if i = k ∧ j = l then a else 0 := rfl + +@[simp] lemma entry_mul {n : ℕ} (i j k : Fin n) (a b : A) : + entry i j a * entry j k b = entry i k (a * b) := + Matrix.single_mul_single_same a i j k b + +lemma entry_mul_of_ne {n : ℕ} (i j k l : Fin n) (a b : A) (h : j ≠ k) : + entry i j a * entry k l b = 0 := + Matrix.single_mul_single_of_ne a i j k h b + +@[simp] lemma star_entry {n : ℕ} (i j : Fin n) (a : A) : + star (entry i j a) = entry j i (star a) := by + apply CStarMatrix.ext + intro k l + change star (Matrix.single i j a l k) = Matrix.single j i (star a) k l + simp only [Matrix.single_apply] + split_ifs <;> simp_all + +@[simp] lemma entry_add {n : ℕ} (i j : Fin n) (a b : A) : + entry i j (a+b) = entry i j a + entry i j b := Matrix.single_add _ _ _ _ + +@[simp] lemma entry_smul {n : ℕ} (i j : Fin n) (c : ℂ) (a : A) : + entry i j (c • a) = c • entry i j a := (Matrix.smul_single _ _ _ _).symm + +@[simp] lemma entry_zero {n : ℕ} (i j : Fin n) : entry i j (0 : A) = 0 := + Matrix.single_zero _ _ + +def cornerHom {n : ℕ} (i : Fin n) : A →⋆ₙₐ[ℂ] CStarMatrix (Fin n) (Fin n) A where + toFun := entry i i + map_zero' := entry_zero i i + map_add' := entry_add i i + map_mul' := fun a b => (entry_mul i i i a b).symm + map_smul' := entry_smul i i + map_star' := fun a => (star_entry i i a).symm + +lemma diagonalCorner_mul {n : ℕ} (a b : A) : + diagonalCorner n (a*b) = diagonalCorner n a * diagonalCorner n b := by + exact congrArg CStarMatrix.ofMatrix (Matrix.diagonal_mul_diagonal (fun _ => a) (fun _ => b)).symm + +lemma star_diagonalCorner {n : ℕ} (a : A) : + star (diagonalCorner n a) = diagonalCorner n (star a) := by + apply CStarMatrix.ext + intro i j + change star (Matrix.diagonal (fun _ => a) j i) = Matrix.diagonal (fun _ => star a) i j + simp only [Matrix.diagonal_apply] + split_ifs <;> simp_all + +def diagonalHom (n : ℕ) : A →⋆ₙₐ[ℂ] CStarMatrix (Fin n) (Fin n) A where + toFun := diagonalCorner n + map_zero' := by ext i j; simp [diagonalCorner] + map_add' a b := by ext i j; simp [diagonalCorner, Matrix.diagonal_apply]; split_ifs <;> simp + map_mul' := diagonalCorner_mul + map_smul' c a := by ext i j; simp [diagonalCorner, Matrix.diagonal_apply] + map_star' := fun a => star_diagonalCorner a |>.symm + +lemma corner_cut {n : ℕ} (i : Fin n) (a : A) (ε : ℝ) (ha : IsSelfAdjoint a) (hε : 0 ≤ ε) : + cut (entry i i a) ε = entry i i (cut a ε) := by + exact cut_map (cornerHom i) a ε ha hε + +lemma diagonal_cut (n : ℕ) (a : A) (ε : ℝ) (ha : IsSelfAdjoint a) (hε : 0 ≤ ε) : + cut (diagonalCorner n a) ε = diagonalCorner n (cut a ε) := by + exact cut_map (diagonalHom n) a ε ha hε + +lemma continuous_entry {n : ℕ} (i j : Fin n) : Continuous (entry (A := A) i j) := by + change Continuous (fun a : A => (Matrix.single i j a : Matrix (Fin n) (Fin n) A)) + apply continuous_pi; intro k + apply continuous_pi; intro l + change Continuous (fun a : A => if i = k ∧ j = l then a else 0) + split_ifs + · exact continuous_id + · exact continuous_const + +lemma entry_mem_diagonalHer {n : ℕ} (i j : Fin n) {h a : A} (ha : a ∈ Her h) : + entry i j a ∈ Her (diagonalCorner n h) := by + refine closure_minimal (s := Set.range (fun b : A => h*b*star h)) + (t := {b | entry i j b ∈ Her (diagonalCorner n h)}) ?_ ?_ ha + · rintro _ ⟨b, rfl⟩ + have heq : entry i j (h*b*star h) = + diagonalCorner n h * entry i j b * star (diagonalCorner n h) := by + rw [star_diagonalCorner] + apply CStarMatrix.ext + intro k l + change Matrix.single i j (h*b*star h) k l = + ((Matrix.diagonal (fun _ : Fin n => h) * Matrix.single i j b * + Matrix.diagonal (fun _ : Fin n => star h)) : Matrix (Fin n) (Fin n) A) k l + simp only [Matrix.mul_diagonal, Matrix.diagonal_mul, Matrix.single_apply] + split_ifs <;> simp + change entry i j (h*b*star h) ∈ Her _ + rw [heq] + exact sandwich_mem_Her _ _ + · exact (isClosed_Her _).preimage (continuous_entry i j) + +lemma cornerHer_entries {n : ℕ} (i : Fin n) {h : A} + {a : CStarMatrix (Fin n) (Fin n) A} (ha : a ∈ Her (entry i i h)) + (j k : Fin n) : a j k ∈ Her h ∧ (j ≠ i ∨ k ≠ i → a j k = 0) := by + refine closure_minimal (s := Set.range (fun b => entry i i h * b * star (entry i i h))) + (t := {b | b j k ∈ Her h ∧ (j ≠ i ∨ k ≠ i → b j k = 0)}) ?_ ?_ ha + · rintro _ ⟨b, rfl⟩ + have heq : entry i i h * b * star (entry i i h) = entry i i (h*b i i*star h) := by + rw [star_entry] + exact Matrix.single_mul_mul_single i i i i h (CStarMatrix.ofMatrix.symm b) (star h) + change (entry i i h * b * star (entry i i h)) j k ∈ Her h ∧ + (j ≠ i ∨ k ≠ i → (entry i i h * b * star (entry i i h)) j k = 0) + rw [heq, entry_apply] + split_ifs with heq + · refine ⟨sandwich_mem_Her h _, ?_⟩ + intro hjk + rcases hjk with hj | hk + · exact (hj heq.1.symm).elim + · exact (hk heq.2.symm).elim + · exact ⟨(Her h).zero_mem, by simp⟩ + · apply IsClosed.inter + · exact (isClosed_Her _).preimage (by fun_prop) + · by_cases hjk : j ≠ i ∨ k ≠ i + · change IsClosed {b : CStarMatrix (Fin n) (Fin n) A | j ≠ i ∨ k ≠ i → b j k = 0} + simpa only [hjk, true_implies] using + (isClosed_eq (show Continuous (fun a : CStarMatrix (Fin n) (Fin n) A => a j k) by fun_prop) + continuous_const) + · simp only [hjk, false_implies] + exact isClosed_univ + +def rowMatrix {n : ℕ} (i : Fin n) (r : CStarMatrix (Fin 1) (Fin n) A) : + CStarMatrix (Fin n) (Fin n) A := + CStarMatrix.ofMatrix (fun j k => if j = i then r 0 k else 0) + +lemma rowMatrix_conjugate {n : ℕ} (i : Fin n) + (r : CStarMatrix (Fin 1) (Fin n) A) (v : A) : + star (rowMatrix i r) * entry i i v * rowMatrix i r = + r.conjTranspose * scalarCorner v * r := by + apply CStarMatrix.ext + intro j k + change (∑ l : Fin n, (∑ p : Fin n, + star (if p = i then r 0 j else 0) * (if i = p ∧ i = l then v else 0)) * + (if l = i then r 0 k else 0)) = + ∑ l : Fin 1, (∑ p : Fin 1, star (r p j) * v) * r l k + simp [mul_ite] + +lemma finiteCuntzLE_corner_approx {n : ℕ} (i : Fin n) {d : CStarMatrix (Fin n) (Fin n) A} + {v : A} (hdv : FiniteCuntzLE d (scalarCorner v)) {ε : ℝ} (hε : 0 < ε) : + ∃ s : CStarMatrix (Fin n) (Fin n) A, ‖d - star s * entry i i v * s‖ < ε := by + obtain ⟨r, hr⟩ := hdv.exists_approx hε + exact ⟨rowMatrix i r, by rwa [rowMatrix_conjugate]⟩ + +lemma regularTransport_diagonal {n : ℕ} (i : Fin n) {d v : A} (hd : 0 ≤ d) (hv : 0 ≤ v) + (hdv : FiniteCuntzLE (diagonalCorner n d) (scalarCorner v)) {ε : ℝ} (hε : 0 < ε) : + Nonempty (RegularTransport (diagonalCorner n (cut d ε)) (entry i i v)) := by + obtain ⟨s, hs⟩ := finiteCuntzLE_corner_approx i hdv hε + have hd' : 0 ≤ diagonalCorner n d := map_nonneg (diagonalHom n) hd + have hv' : 0 ≤ entry i i v := map_nonneg (cornerHom i) hv + have ht := regularTransport_of_approx hd' hv' hε hs + rwa [diagonal_cut n d ε (.of_nonneg hd) hε.le] at ht + +lemma row_zero_of_self_star {n : ℕ} (M : CStarMatrix (Fin n) (Fin n) A) (i : Fin n) + (hi : (M * star M) i i = 0) (j : Fin n) : M i j = 0 := by + have hs : ∑ k : Fin n, M i k * star (M i k) = 0 := hi + have hnonneg : ∀ k ∈ (Finset.univ : Finset (Fin n)), 0 ≤ M i k * star (M i k) := + fun k _ => mul_star_self_nonneg _ + have hzero := ((Finset.sum_eq_zero_iff_of_nonneg hnonneg).mp hs) j (Finset.mem_univ j) + apply norm_eq_zero.mp + have hn : ‖M i j‖ * ‖M i j‖ = 0 := by rw [← CStarRing.norm_self_mul_star, hzero, norm_zero] + nlinarith [norm_nonneg (M i j)] + +lemma col_zero_of_star_self {n : ℕ} (M : CStarMatrix (Fin n) (Fin n) A) (i : Fin n) + (hi : (star M * M) i i = 0) (j : Fin n) : M j i = 0 := by + have h := row_zero_of_self_star (star M) i (by simpa only [star_star] using hi) j + change star (M j i) = 0 at h + exact star_eq_zero.mp h + +def entryHer {n : ℕ} {h : A} (i j : Fin n) (k : Her h) : Her (diagonalCorner n h) := + ⟨entry i j (k : A), entry_mem_diagonalHer i j k.property⟩ + +@[simp] lemma entryHer_val {n : ℕ} {h : A} (i j : Fin n) (k : Her h) : + (entryHer i j k : CStarMatrix (Fin n) (Fin n) A) = entry i j (k : A) := rfl + +namespace RegularTransport +variable {n : ℕ} {h v : A} (i₀ : Fin n) + (T : RegularTransport (diagonalCorner n h) (entry i₀ i₀ v)) + +lemma carrier_entryHer (i : Fin n) (k : Her h) : + T.carrier (entryHer i i₀ k) = + entry i₀ i₀ ((T.carrier (entryHer i i₀ k)) i₀ i₀) := by + let M := T.carrier (entryHer i i₀ k) + have hrow (j : Fin n) (hj : j ≠ i₀) : ∀ l, M j l = 0 := by + apply row_zero_of_self_star + have hout := T.outer (entryHer i i₀ k) (entryHer i i₀ k) + have hm := T.image (entryHer i i₀ k * star (entryHer i i₀ k)) + rw [← hout] at hm + exact (cornerHer_entries i₀ hm j j).2 (Or.inl hj) + have hcol (j : Fin n) (hj : j ≠ i₀) : ∀ l, M l j = 0 := by + apply col_zero_of_star_self + have hin := T.inner (entryHer i i₀ k) (entryHer i i₀ k) + simp only [entryHer_val, star_entry, entry_mul] at hin + have he := congrArg (fun a : CStarMatrix (Fin n) (Fin n) A => a j j) hin + simpa only [entry_apply, ne_comm.mp hj, false_and, ite_false] using he + apply CStarMatrix.ext + intro j l + change M j l = (entry i₀ i₀ (M i₀ i₀)) j l + rw [entry_apply] + by_cases hj : j = i₀ + · subst j + by_cases hl : l = i₀ + · subst l; simp + · simp only [true_and, ne_comm.mp hl, ite_false] + exact hcol l hl i₀ + · simp only [ne_comm.mp hj, false_and, ite_false] + exact hrow j hj l + +def slot (i : Fin n) (k : Her h) : A := T.carrier (entryHer i i₀ k) i₀ i₀ + +lemma slot_inner (i j : Fin n) (k l : Her h) : + star (T.slot i₀ i k) * T.slot i₀ j l = + if i = j then star (k : A) * (l : A) else 0 := by + have hin := T.inner (entryHer i i₀ k) (entryHer j i₀ l) + rw [T.carrier_entryHer i₀ i k, T.carrier_entryHer i₀ j l] at hin + simp only [entryHer_val, star_entry, entry_mul] at hin + change entry i₀ i₀ (star (T.slot i₀ i k) * T.slot i₀ j l) = _ at hin + by_cases hij : i = j + · subst j + rw [entry_mul] at hin + have he := congrArg (fun a : CStarMatrix (Fin n) (Fin n) A => a i₀ i₀) hin + simpa only [entry_apply, and_self, ite_true] using he + · rw [entry_mul_of_ne _ _ _ _ _ _ hij] at hin + have he := congrArg (fun a : CStarMatrix (Fin n) (Fin n) A => a i₀ i₀) hin + simpa only [entry_apply, and_self, ite_true, hij, ite_false, CStarMatrix.zero_apply] using he + +lemma slot_outer_mem (i j : Fin n) (k l : Her h) : + T.slot i₀ i k * star (T.slot i₀ j l) ∈ Her v := by + have hout := T.outer (entryHer i i₀ k) (entryHer j i₀ l) + have hm := T.image (entryHer i i₀ k * star (entryHer j i₀ l)) + rw [← hout, T.carrier_entryHer i₀ i k, T.carrier_entryHer i₀ j l, + star_entry, entry_mul] at hm + simpa only [slot, entry_apply, and_self, ite_true] using (cornerHer_entries i₀ hm i₀ i₀).1 + +lemma slot_mul (i : Fin n) (k l : Her h) : + T.slot i₀ i (k*l) = T.slot i₀ i k * (l : A) := by + have heq : entryHer i i₀ (k*l) = entryHer i i₀ k * entryHer i₀ i₀ l := by + apply Subtype.ext + exact (entry_mul i i₀ i₀ (k : A) (l : A)).symm + have ht := T.mul (entryHer i i₀ k) (entryHer i₀ i₀ l) + rw [← heq, T.carrier_entryHer i₀ i (k*l), T.carrier_entryHer i₀ i k, entryHer_val, + entry_mul] at ht + simpa only [slot, entry_apply, and_self, ite_true] using + congrArg (fun a : CStarMatrix (Fin n) (Fin n) A => a i₀ i₀) ht + +lemma slot_add (i : Fin n) (k l : Her h) : + T.slot i₀ i (k+l) = T.slot i₀ i k + T.slot i₀ i l := by + have heq : entryHer i i₀ (k+l) = entryHer i i₀ k + entryHer i i₀ l := by + apply Subtype.ext + exact entry_add i i₀ (k : A) (l : A) + simp only [slot, heq, map_add, CStarMatrix.add_apply] + +lemma slot_smul (i : Fin n) (c : ℂ) (k : Her h) : + T.slot i₀ i (c • k) = c • T.slot i₀ i k := by + have heq : entryHer i i₀ (c • k) = c • entryHer i i₀ k := by + apply Subtype.ext + exact entry_smul i i₀ c (k : A) + simp only [slot, heq, map_smul, CStarMatrix.smul_apply] + +lemma continuous_slot (i : Fin n) : Continuous (T.slot i₀ i) := by + have he : Continuous (fun k : Her h => entryHer i i₀ k) := by + apply Continuous.subtype_mk + exact (continuous_entry i i₀).comp continuous_subtype_val + change Continuous (fun k : Her h => T.carrier (entryHer i i₀ k) i₀ i₀) + exact (continuous_apply i₀).comp ((continuous_apply i₀).comp (T.carrier.continuous.comp he)) + +def slotCLM (i : Fin n) : Her h →L[ℂ] A where + toFun := T.slot i₀ i + map_add' := T.slot_add i₀ i + map_smul' := T.slot_smul i₀ i + cont := T.continuous_slot i₀ i + +end RegularTransport + +structure OrthogonalSlots (n : ℕ) (h v : A) where + carrier : Fin n → Her h →L[ℂ] A + inner : ∀ i j k l, star (carrier i k) * carrier j l = + if i = j then star (k : A) * (l : A) else 0 + outer : ∀ i j k l, carrier i k * star (carrier j l) ∈ Her v + mul : ∀ i k l, carrier i (k*l) = carrier i k * (l : A) + +theorem orthogonalSlots_of_comparison {n : ℕ} {d v : A} (hd : 0 ≤ d) (hv : 0 ≤ v) + (hdv : FiniteCuntzLE (diagonalCorner n d) (scalarCorner v)) {ε : ℝ} (hε : 0 < ε) : + Nonempty (OrthogonalSlots n (cut d ε) v) := by + by_cases hn : n = 0 + · subst n + exact ⟨{ + carrier := fun i => Fin.elim0 i + inner := fun i => Fin.elim0 i + outer := fun i => Fin.elim0 i + mul := fun i => Fin.elim0 i }⟩ + · let i₀ : Fin n := ⟨0, Nat.pos_of_ne_zero hn⟩ + obtain ⟨T⟩ := regularTransport_diagonal i₀ hd hv hdv hε + exact ⟨{ + carrier := T.slotCLM i₀ + inner := T.slot_inner i₀ + outer := T.slot_outer_mem i₀ + mul := T.slot_mul i₀ }⟩ + +theorem ProperlyInfinite.orthogonalSlots {d : A} (hd : 0 ≤ d) (hp : ProperlyInfinite d) + (n : ℕ) {ε : ℝ} (hε : 0 < ε) : Nonempty (OrthogonalSlots n (cut d ε) d) := + orthogonalSlots_of_comparison hd hd (hp.finite_copies n) hε + +namespace OrthogonalSlots +variable {n : ℕ} {h v : A} (S : OrthogonalSlots n h v) + +lemma represented_norm {B : Type*} [NonUnitalCStarAlgebra B] + (π : A →⋆ₙₐ[ℂ] B) (i : Fin n) (k : Her h) : + ‖π (S.carrier i k)‖ = ‖π (k : A)‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + simp only [pow_two, ← CStarRing.norm_star_mul_self, ← map_star, ← map_mul, + S.inner, ite_true] + +lemma norm_carrier (i : Fin n) (k : Her h) : ‖S.carrier i k‖ = ‖(k : A)‖ := + S.represented_norm (NonUnitalStarAlgHom.id ℂ A) i k + +end OrthogonalSlots + +section FiniteSum + +lemma FiniteCuntzLE.double {d v : A} + (hdv : FiniteCuntzLE (scalarCorner d) (scalarCorner v)) : + FiniteCuntzLE (doubleCorner d) (doubleCorner v) := by + have hh := hdv.block hdv + rw [← diagonalCorner_one d, ← diagonalCorner_one v, matrixBlock_diagonal, + matrixBlock_diagonal] at hh + exact hh + +lemma finiteSum_cuntzLE {v : A} (hv : ProperlyInfinite v) {n : ℕ} (r : Fin n → A) : + FiniteCuntzLE (scalarCorner (∑ i, star (r i) * v * r i)) (scalarCorner v) := by + let x : CStarMatrix (Fin n) (Fin 1) A := CStarMatrix.ofMatrix (fun i _ => r i) + have hcomp : x.conjTranspose * diagonalCorner n v * x = + scalarCorner (∑ i, star (r i) * v * r i) := by + ext i j + change (∑ k : Fin n, (∑ l : Fin n, star (r l) * + (if l = k then v else 0)) * r k) = _ + simp only [mul_ite, mul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true] + rfl + rw [← hcomp] + exact (hv.finite_copies n).conjugate x + +lemma finiteSum_two_cuntzLE {v : A} (hv : ProperlyInfinite v) {n : ℕ} (r : Fin n → A) : + FiniteCuntzLE (diagonalCorner 2 (∑ i, star (r i) * v * r i)) (scalarCorner v) := + (finiteSum_cuntzLE hv r).double.trans hv + +lemma finsetSum_cuntzLE {v : A} (hv : ProperlyInfinite v) {ι : Type*} + (E : Finset ι) (r : ι → A) : + FiniteCuntzLE (diagonalCorner 2 (∑ i ∈ E, star (r i) * v * r i)) (scalarCorner v) := by + classical + let e : Fin (Fintype.card E) ≃ E := (Fintype.equivFin E).symm + have hsum : (∑ i : Fin (Fintype.card E), star (r (e i)) * v * r (e i)) = + ∑ i ∈ E, star (r i) * v * r i := by + calc + _ = ∑ i : E, star (r i) * v * r i := Equiv.sum_comp e _ + _ = _ := by simpa using (Finset.sum_attach E (fun i => star (r i) * v * r i)) + rw [← hsum] + exact finiteSum_two_cuntzLE hv _ + +end FiniteSum +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/PositiveFunctional.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/PositiveFunctional.lean new file mode 100644 index 0000000000000000000000000000000000000000..539daa2faff9b9fbaa044b15ad8a4f66f19232dd --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/PositiveFunctional.lean @@ -0,0 +1,94 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +variable [PartialOrder A] [StarOrderedRing A] + +lemma norm_add_one_of_nonneg [Nontrivial A] {d : A} (hd : 0 ≤ d) : + ‖d + 1‖ = ‖d‖ + 1 := by + apply le_antisymm + · simpa using norm_add_le d 1 + have hh := norm_apply_le_norm_cfc (fun t : ℝ => t + 1) d + (CStarAlgebra.norm_mem_spectrum_of_nonneg d hd) + have he : cfc (fun t : ℝ => t + 1) d = d + 1 := by + rw [cfc_add_const (1 : ℝ) (fun t : ℝ => t) d, cfc_id' ℝ d, map_one] + simpa only [he, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ ‖d‖ + 1)] using hh + +lemma real_norm_one_positive (F : A →L[ℝ] ℝ) (hF : ‖F‖ ≤ 1) (h1 : F 1 = 1) + {h : A} (hh : 0 ≤ h) : 0 ≤ F h := by + have hu : h ≤ algebraMap ℝ A ‖h‖ := + IsSelfAdjoint.le_algebraMap_norm_self h (.of_nonneg hh) + have hp : 0 ≤ algebraMap ℝ A ‖h‖ - h := sub_nonneg.mpr hu + have hb : ‖algebraMap ℝ A ‖h‖ - h‖ ≤ ‖h‖ := + (CStarAlgebra.norm_le_iff_le_algebraMap _ (norm_nonneg _) hp).2 (sub_le_self _ hh) + have he := F.le_opNorm (algebraMap ℝ A ‖h‖ - h) + have hx : F (algebraMap ℝ A ‖h‖ - h) = ‖h‖ - F h := by + rw [map_sub, Algebra.algebraMap_eq_smul_one, map_smul, h1, smul_eq_mul, mul_one] + have : F (algebraMap ℝ A ‖h‖ - h) ≤ ‖h‖ := + (le_abs_self _).trans (he.trans ((mul_le_mul_of_nonneg_right hF (norm_nonneg _)).trans + (by simpa using hb))) + linarith + +def realPartCLM : A →L[ℝ] A := + ((selfAdjoint.submodule ℝ A).subtype.comp (realPart : A →ₗ[ℝ] selfAdjoint A)).mkContinuous 1 + (fun a => by + change ‖(realPart a : A)‖ ≤ 1 * ‖a‖ + simpa using realPart.norm_le a) + +omit [PartialOrder A] [StarOrderedRing A] in +@[simp] lemma realPartCLM_apply (a : A) : realPartCLM a = (realPart a : A) := rfl + +omit [PartialOrder A] [StarOrderedRing A] in +lemma norm_realPartCLM : ‖(realPartCLM : A →L[ℝ] A)‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro a + simpa using realPart.norm_le a + +lemma exists_norming_positive [Nontrivial A] {d : A} (hd : 0 ≤ d) : + ∃ f : A →ₚ[ℂ] ℂ, (∀ a, ‖f a‖ ≤ ‖a‖) ∧ f d = (‖d‖ : ℂ) := by + obtain ⟨F, hF, hFd⟩ := exists_dual_vector'' ℝ (d + 1) + have hFa (a : A) : F a ≤ ‖a‖ := + (le_abs_self _).trans ((F.le_opNorm a).trans + (by simpa using mul_le_mul_of_nonneg_right hF (norm_nonneg a))) + have h1 : F 1 = 1 := by + rw [map_add, norm_add_one_of_nonneg hd] at hFd + simp only [RCLike.ofReal_real_eq_id, id_eq] at hFd + have h1' := hFa 1 + have hd' := hFa d + simp only [norm_one] at h1' + linarith + have hFd' : F d = ‖d‖ := by + rw [map_add, norm_add_one_of_nonneg hd, h1] at hFd + simpa only [RCLike.ofReal_real_eq_id, id_eq, add_left_inj] using hFd + let G : A →L[ℝ] ℝ := F.comp realPartCLM + let H : A →L[ℂ] ℂ := StrongDual.extendRCLike G + have hG : ‖G‖ ≤ 1 := (ContinuousLinearMap.opNorm_comp_le _ _).trans + ((mul_le_mul hF norm_realPartCLM (norm_nonneg _) zero_le_one).trans (by norm_num)) + have hH (a : A) (ha : IsSelfAdjoint a) : H a = (F a : ℂ) := by + simp [H, StrongDual.extendRCLike_apply, G, ha.coe_realPart, realPart_I_smul, + ha.imaginaryPart] + let f : A →ₚ[ℂ] ℂ := + { H.toLinearMap with + monotone' := fun a b hab => by + have hn : 0 ≤ H (b - a) := by + rw [hH _ (.of_nonneg (sub_nonneg.mpr hab))] + exact_mod_cast real_norm_one_positive F hF h1 (sub_nonneg.mpr hab) + change H a ≤ H b + simpa only [map_sub, sub_nonneg] using hn } + refine ⟨f, fun a => ?_, ?_⟩ + · change ‖H a‖ ≤ ‖a‖ + exact (H.le_opNorm a).trans (by + simpa [H] using mul_le_mul_of_nonneg_right hG (norm_nonneg a)) + · change H d = _ + rw [hH d (.of_nonneg hd), hFd'] +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Products.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Products.lean new file mode 100644 index 0000000000000000000000000000000000000000..ddf8faeb4f48703f25495fed9ff7ad7187b1bd7f --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Products.lean @@ -0,0 +1,287 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Shrinking + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance boundedSlotsOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance boundedSlotsStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma cut_le_self {a : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 ≤ δ) : cut a δ ≤ a := by + have he : cfcₙ (fun t : ℝ => t) a = a := cfcₙ_id ℝ a ha.isSelfAdjoint + conv_rhs => rw [← he] + change cfcₙ (fun t : ℝ => max (t-δ) 0) a ≤ cfcₙ (fun t : ℝ => t) a + exact cfcₙ_mono (fun t ht => max_le (by linarith) (quasispectrum_nonneg_of_nonneg a ha t ht)) + ((continuous_id.sub continuous_const).max continuous_const).continuousOn + continuousOn_id (by simp [max_eq_right (neg_nonpos.mpr hδ)]) rfl + +lemma norm_cut_le {a : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 ≤ δ) : ‖cut a δ‖ ≤ ‖a‖ := + CStarAlgebra.norm_le_norm_of_le_of_nonneg (cut_le_self ha hδ) (cut_nonneg a δ) + +lemma cutInverse_nonneg {a : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 < δ) : + 0 ≤ cutInverse a δ := by + apply cfcₙ_nonneg + intro t ht + exact (cutInverseFn_bound hδ (quasispectrum_nonneg_of_nonneg a ha t ht)).1 + +lemma fixed_of_outer_fixed {F r : A} (h : F*(r*star r)=r*star r) : F*r=r := by + apply sub_eq_zero.mp + apply (CStarRing.mul_star_self_eq_zero_iff _).mp + have hs : r*star r*star F = r*star r := by + simpa only [star_mul, star_star, mul_assoc] using congrArg star h + calc + (F*r-r)*star (F*r-r) = F*(r*star r)*star F - F*(r*star r) - r*star r*star F+r*star r := by + simp only [star_sub, star_mul] + noncomm_ring + _ = 0 := by rw [h, hs]; noncomm_ring + +lemma cutInverse_fixed_carrier {a r : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 < δ) + (hr : r*star r ∈ Her (cut a δ)) : (cutInverse a δ*a)*r=r := by + have hFsa : IsSelfAdjoint (cutInverse a δ*a) := by + have hcomm : Commute (cutInverse a δ) a := (Commute.refl a).cfcₙ_real (cutInverseFn δ) + exact (IsSelfAdjoint.commute_iff (cutInverse_nonneg ha hδ).isSelfAdjoint ha.isSelfAdjoint).mp hcomm + have ht := Her_right_fixed_cutInverse ha hδ hr + have hs : (cutInverse a δ*a)*(r*star r)=r*star r := by + simpa only [star_mul, star_star, hFsa.star_eq] using congrArg star ht + exact fixed_of_outer_fixed hs + +theorem bounded_two_slots (hp : PropertyP A) {d : A} (hd : 0 ≤ d) {δ : ℝ} (hδ : 0 < δ) : + ∃ s : Fin 2 → A, + (∀ i j, star (s i)*d*s j = if i=j then cut d (δ+δ) else 0) ∧ + (∀ i, ‖s i‖ ≤ Real.sqrt (1/δ) * Real.sqrt ‖d‖) := by + let h := cut d δ + let k := cut h δ + have hh : 0 ≤ h := cut_nonneg d δ + have hk : 0 ≤ k := cut_nonneg h δ + obtain ⟨S⟩ := (hp h hh).orthogonalSlots hh 2 hδ + let z : Her k := ⟨CFC.sqrt k, sqrt_mem_Her (self_mem_Her hk) hk⟩ + let r := fun i => S.carrier i z + let v := CFC.sqrt (cutInverse d δ) + have hv : 0 ≤ cutInverse d δ := cutInverse_nonneg hd hδ + have hvr : ∀ i, (cutInverse d δ*d)*r i=r i := fun i => + cutInverse_fixed_carrier hd hδ (S.outer i i z z) + have hvd : star v*d*v=cutInverse d δ*d := by + have hc : Commute v d := by + exact ((Commute.refl d).cfcₙ_real (cutInverseFn δ)).cfcₙ_nnreal NNReal.sqrt + rw [(CFC.sqrt_nonneg (cutInverse d δ)).isSelfAdjoint.star_eq] + calc + v*d*v = v*v*d := by rw [mul_assoc, ← hc.eq, ← mul_assoc] + _ = cutInverse d δ*d := by rw [show v*v=cutInverse d δ from CFC.sqrt_mul_sqrt_self _ hv] + refine ⟨fun i => v*r i, ?_, ?_⟩ + · intro i j + calc + star (v*r i)*d*(v*r j) = star (r i)*(star v*d*v)*r j := by simp only [star_mul]; noncomm_ring + _ = star (r i)*r j := by rw [hvd, mul_assoc, hvr] + _ = if i=j then cut d (δ+δ) else 0 := by + rw [S.inner] + have he : k=cut d (δ+δ) := cut_cut hd hδ.le hδ.le + change (if i=j then star (CFC.sqrt k)*CFC.sqrt k else 0) = if i=j then cut d (δ+δ) else 0 + rw [(CFC.sqrt_nonneg k).isSelfAdjoint.star_eq, CFC.sqrt_mul_sqrt_self _ hk, he] + · intro i + calc + ‖v*r i‖ ≤ ‖v‖*‖r i‖ := norm_mul_le _ _ + _ ≤ Real.sqrt (1/δ) * Real.sqrt ‖d‖ := by + apply mul_le_mul + · rw [CFC.norm_sqrt _ hv] + exact Real.sqrt_le_sqrt (norm_cutInverse_le hd hδ) + · rw [S.norm_carrier, CFC.norm_sqrt _ hk] + exact Real.sqrt_le_sqrt ((norm_cut_le hh hδ.le).trans (norm_cut_le hd hδ.le)) + · exact norm_nonneg _ + · positivity +end MainGap + +namespace MainGap +open scoped ENNReal +variable {I : Type*} {E : I → Type*} [∀ i, NonUnitalCStarAlgebra (E i)] +local instance productFactorOrder (i : I) : PartialOrder (E i) := CStarAlgebra.spectralOrder _ +local instance productFactorStarOrder (i : I) : StarOrderedRing (E i) := CStarAlgebra.spectralOrderedRing _ +local instance boundedProductOrder : PartialOrder (lp E ∞) := CStarAlgebra.spectralOrder _ +local instance boundedProductStarOrder : StarOrderedRing (lp E ∞) := CStarAlgebra.spectralOrderedRing _ + +def lpEval (i : I) : lp E ∞ →⋆ₙₐ[ℂ] E i where + toFun f := f i + map_zero' := rfl + map_add' _ _ := rfl + map_mul' _ _ := rfl + map_smul' _ _ := rfl + map_star' _ := rfl + +@[simp] lemma lpEval_apply (i : I) (f : lp E ∞) : lpEval i f=f i := rfl + +def lpBuild (f : ∀ i, E i) (M : ℝ) (h : ∀ i, ‖f i‖ ≤ M) : lp E ∞ := + ⟨f, memℓp_infty ⟨M, by rintro t ⟨i,rfl⟩; exact h i⟩⟩ + +@[simp] lemma lpBuild_apply (f : ∀ i, E i) (M : ℝ) (h : ∀ i, ‖f i‖ ≤ M) (i : I) : + lpBuild f M h i = f i := rfl + +lemma lp_nonneg_iff (d : lp E ∞) : 0 ≤ d ↔ ∀ i, 0 ≤ d i := by + constructor + · intro hd i + exact map_nonneg (lpEval i) hd + · intro hd + let v := lpBuild (fun i => CFC.sqrt (d i)) (Real.sqrt ‖d‖) (fun i => by + rw [CFC.norm_sqrt (d i) (hd i)] + exact Real.sqrt_le_sqrt (lp.norm_apply_le_norm ENNReal.top_ne_zero d i)) + have he : star v*v=d := by + ext i + change star (CFC.sqrt (d i))*CFC.sqrt (d i)=d i + rw [(CFC.sqrt_nonneg _).isSelfAdjoint.star_eq, CFC.sqrt_mul_sqrt_self _ (hd i)] + rw [← he] + exact star_mul_self_nonneg v + +theorem propertyP_lp (hp : ∀ i, PropertyP (E i)) : PropertyP (lp E ∞) := by + intro d hd + apply finiteCuntzLE_of_forall_approx + intro ε hε + let δ := ε/4 + have hδ : 0 < δ := by dsimp [δ]; positivity + have hd' : ∀ i, 0 ≤ d i := (lp_nonneg_iff d).mp hd + choose s hs hn using fun i => bounded_two_slots (hp i) (hd' i) hδ + have hb (i : I) (j : Fin 2) : + ‖s i j‖ ≤ Real.sqrt (1/δ)*Real.sqrt ‖d‖ := + (hn i j).trans (mul_le_mul_of_nonneg_left + (Real.sqrt_le_sqrt (lp.norm_apply_le_norm ENNReal.top_ne_zero d i)) (Real.sqrt_nonneg _)) + let S : Fin 2 → lp E ∞ := fun j => lpBuild (fun i => s i j) _ (fun i => hb i j) + let R : CStarMatrix (Fin 1) (Fin 2) (lp E ∞) := CStarMatrix.ofMatrix (fun _ j => S j) + have he : R.conjTranspose * scalarCorner d * R = doubleCorner (cut d (δ+δ)) := by + apply CStarMatrix.ext + intro j k + apply lp.ext + funext i + change ((∑ l : Fin 1, (∑ m : Fin 1, star (R m j)*scalarCorner d m l)*R l k) i) = + (Matrix.diagonal (fun _ : Fin 2 => cut d (δ+δ)) j k) i + simp only [Fin.sum_univ_one] + change star (s i j)*d i*s i k=(if j=k then cut d (δ+δ) else 0) i + rw [hs i j k] + split_ifs with hjk + · exact (map_cut (lpEval i) hd (show 0 ≤ δ+δ by positivity)).symm + · rfl + refine ⟨R,?_⟩ + rw [he] + change ‖diagonalHom 2 d - diagonalHom 2 (cut d (δ+δ))‖ < ε + rw [← map_sub] + exact ((NonUnitalStarAlgHom.norm_apply_le (diagonalHom (A := lp E ∞) 2) _).trans + (norm_sub_cut_le hd (by positivity))).trans_lt (by dsimp [δ]; linarith) + +end MainGap + +namespace MainGap +open scoped ENNReal +variable {I : Type*} {E : I → Type*} [∀ i, NonUnitalCStarAlgebra (E i)] [DecidableEq I] + +lemma lp_single_mem_Her (i : I) {p : lp E ∞} {x : E i} (hx : x ∈ Her (p i)) : + lp.single ∞ i x ∈ Her p := by + have hc : IsClosed {x : E i | lp.single ∞ i x ∈ Her p} := + (isClosed_Her p).preimage (lp.isometry_single i).continuous + apply closure_minimal (s := Set.range (fun b : E i => p i*b*star (p i))) _ hc hx + rintro x ⟨b,rfl⟩ + change lp.single ∞ i (p i*b*star (p i)) ∈ Her p + have he : lp.single ∞ i (p i*b*star (p i)) = p*lp.single ∞ i b*star p := by + apply lp.ext + funext j + by_cases hj : j=i + · subst j + change lp.single ∞ i (p i*b*star (p i)) i = p i*lp.single ∞ i b i*star (p i) + simp only [lp.single_apply_self] + · change lp.single ∞ i (p i*b*star (p i)) j = p j*lp.single ∞ i b j*star (p j) + rw [lp.single_apply_ne _ _ _ hj, lp.single_apply_ne _ _ _ hj, mul_zero, zero_mul] + rw [he] + exact sandwich_mem_Her p _ + +lemma HerCompression.lp_eval {p q c : lp E ∞} {κ : ℝ} + (h : HerCompression p q c κ) (i : I) : HerCompression (p i) (q i) (c i) κ := by + intro x hx k hk + have hi := h _ (lp_single_mem_Her i hx) _ (lp_single_mem_Her i hk) + have he : lp.single ∞ i x*c*lp.single ∞ i k = lp.single ∞ i (x*c i*k) := by + apply lp.ext + funext j + by_cases hj : j=i + · subst j + change lp.single ∞ i x i*c i*lp.single ∞ i k i=lp.single ∞ i (x*c i*k) i + simp only [lp.single_apply_self] + · change lp.single ∞ i x j*c j*lp.single ∞ i k j=lp.single ∞ i (x*c i*k) j + rw [lp.single_apply_ne _ _ _ hj, lp.single_apply_ne _ _ _ hj, + lp.single_apply_ne _ _ _ hj, zero_mul, mul_zero] + rw [he, lp.norm_single (by simp : (0 : ℝ≥0∞)<∞), + lp.norm_single (by simp : (0 : ℝ≥0∞)<∞), + lp.norm_single (by simp : (0 : ℝ≥0∞)<∞)] at hi + exact hi +end MainGap + +namespace MainGap +open scoped ENNReal +universe u +variable {A : Type u} [NonUnitalCStarAlgebra A] +local instance sequenceFactorOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance sequenceFactorStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance boundedSequenceOrder : PartialOrder (lp (fun _ : ℕ => A) ∞) := CStarAlgebra.spectralOrder _ +local instance boundedSequenceStarOrder : StarOrderedRing (lp (fun _ : ℕ => A) ∞) := CStarAlgebra.spectralOrderedRing _ + +lemma NormSignal.lp_eval {a p : lp (fun _ : ℕ => A) ∞} (h : NormSignal a p) (i : ℕ) : + NormSignal (a i) (p i) := by + intro R hR + let S : HilbertRep.{u,u} (Unitization ℂ (lp (fun _ : ℕ => A) ∞)) := + { R with hom := R.hom.comp (Unitization.starMap (lpEval i)) } + have he (x : lp (fun _ : ℕ => A) ∞) : + S.hom (x : Unitization ℂ (lp (fun _ : ℕ => A) ∞)) = + R.hom (x i : Unitization ℂ A) := by + simp [S] + have hr : (1/2:ℝ)<‖S.hom (a : Unitization ℂ (lp (fun _ : ℕ => A) ∞))‖ := by + rwa [he] + have ht := h S hr + rwa [he] at ht + +theorem uniform_shrinking (hp : PropertyP A) : + ∃ θ : ℝ, 0 < θ ∧ θ < 1 ∧ + ∀ a y c : A, 0 ≤ a → ‖a‖ ≤ 1 → 0 ≤ y → ‖y‖ ≤ 1 → ‖c‖ ≤ 1 → + ∃ p q : A, 0 ≤ p ∧ ‖p‖ ≤ 1 ∧ p ∈ Her a ∧ + 0 ≤ q ∧ ‖q‖ ≤ 1 ∧ q ∈ Her y ∧ + HerCompression p q c θ ∧ NormSignal a p ∧ NormSignal y q := by + classical + by_contra hn + push Not at hn + let θ : ℕ → ℝ := fun n => 1-1/((n:ℝ)+2) + have hθ0 (n : ℕ) : 0 < θ n := by + dsimp [θ] + have h : (1:ℝ)/((n:ℝ)+2)<1 := (div_lt_one (by positivity)).mpr (by linarith [Nat.cast_nonneg (α := ℝ) n]) + linarith + have hθ1 (n : ℕ) : θ n < 1 := by + dsimp [θ] + have : 0 < (1:ℝ)/((n:ℝ)+2) := by positivity + linarith + choose a y c ha han hy hyn hcn hfail using fun n => hn (θ n) (hθ0 n) (hθ1 n) + let a' : lp (fun _ : ℕ => A) ∞ := lpBuild a 1 han + let y' : lp (fun _ : ℕ => A) ∞ := lpBuild y 1 hyn + let c' : lp (fun _ : ℕ => A) ∞ := lpBuild c 1 hcn + have ha' : 0 ≤ a' := (lp_nonneg_iff a').mpr ha + have hy' : 0 ≤ y' := (lp_nonneg_iff y').mpr hy + have hyn' : ‖y'‖ ≤ 1 := lp.norm_le_of_forall_le (by norm_num) hyn + have hcn' : ‖c'‖ ≤ 1 := lp.norm_le_of_forall_le (by norm_num) hcn + obtain ⟨p,q,κ,hp0,hpn,hpH,hq0,hqn,hqH,hκ0,hκ1,hcomp,hps,hqs⟩ := + shrinking_nonunital (propertyP_lp (fun _ : ℕ => hp)) ha' hy' hyn' hcn' + obtain ⟨n,hnκ⟩ := exists_nat_gt (1/(1-κ)) + have hκθ : κ ≤ θ n := by + have hn2 : 1/(1-κ) < (n:ℝ)+2 := by linarith + have hmul : (1:ℝ) < ((n:ℝ)+2)*(1-κ) := (div_lt_iff₀ (by linarith)).mp hn2 + have hdiv : 1/((n:ℝ)+2) < 1-κ := (div_lt_iff₀ (by positivity)).mpr (by nlinarith) + dsimp [θ]; linarith + apply hfail n (p n) (q n) + · exact (lp_nonneg_iff p).mp hp0 n + · exact (lp.norm_apply_le_norm ENNReal.top_ne_zero p n).trans hpn + · exact Her_map (lpEval n) hpH + · exact (lp_nonneg_iff q).mp hq0 n + · exact (lp.norm_apply_le_norm ENNReal.top_ne_zero q n).trans hqn + · exact Her_map (lpEval n) hqH + · intro x hx k hk + exact ((hcomp.lp_eval n) x hx k hk).trans (by gcongr) + · exact hps.lp_eval n + · exact hqs.lp_eval n +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Representation.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Representation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8edf6748d7221fb8d58ce1d7e55f88628b1bf8a1 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Representation.lean @@ -0,0 +1,273 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap + +section Ultra +variable {ι : Type*} (ω : Ultrafilter ι) + +lemma exists_complex_ultralimit (z : ι → ℂ) (R : ℝ) (hz : ∀ i, ‖z i‖ ≤ R) : + ∃ c : ℂ, Tendsto z (ω : Filter ι) (𝓝 c) := by + obtain ⟨c, _, hc⟩ := (isCompact_closedBall (0 : ℂ) R).ultrafilter_le_nhds + (ω.map z) (by + rw [Ultrafilter.coe_map, Filter.le_principal_iff] + change ∀ᶠ i in (ω : Filter ι), z i ∈ Metric.closedBall 0 R + exact Filter.Eventually.of_forall (fun i => by simpa using hz i)) + exact ⟨c, by + change Filter.map z (ω : Filter ι) ≤ 𝓝 c + simpa only [Ultrafilter.coe_map] using hc⟩ + +variable {A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] +variable (f : ι → A →ₚ[ℂ] ℂ) (hf : ∀ i a, ‖f i a‖ ≤ ‖a‖) + +def ultraValue (a : A) : ℂ := + (exists_complex_ultralimit ω (fun i => f i a) ‖a‖ (fun i => hf i a)).choose + +lemma tendsto_ultraValue (a : A) : + Tendsto (fun i => f i a) (ω : Filter ι) (𝓝 (ultraValue ω f hf a)) := + (exists_complex_ultralimit ω (fun i => f i a) ‖a‖ (fun i => hf i a)).choose_spec + +def ultraPositive : A →ₚ[ℂ] ℂ where + toFun := ultraValue ω f hf + map_add' a b := by + apply tendsto_nhds_unique (tendsto_ultraValue ω f hf (a + b)) + simpa only [map_add] using (tendsto_ultraValue ω f hf a).add + (tendsto_ultraValue ω f hf b) + map_smul' c a := by + apply tendsto_nhds_unique (tendsto_ultraValue ω f hf (c • a)) + simpa only [map_smul, RingHom.id_apply] using (tendsto_ultraValue ω f hf a).const_smul c + monotone' := by + intro a b hab + exact le_of_tendsto_of_tendsto (tendsto_ultraValue ω f hf a) + (tendsto_ultraValue ω f hf b) (Filter.Eventually.of_forall fun i => (f i).monotone hab) + +lemma tendsto_ultraPositive (a : A) : + Tendsto (fun i => f i a) (ω : Filter ι) (𝓝 (ultraPositive ω f hf a)) := + tendsto_ultraValue ω f hf a + +lemma ultraPositive_norm_le (a : A) : ‖ultraPositive ω f hf a‖ ≤ ‖a‖ := + le_of_tendsto' (tendsto_ultraPositive ω f hf a).norm (fun i => hf i a) + +lemma ultraPositive_eq_zero_of_tendsto {a : A} + (ha : Tendsto (fun i => f i a) (ω : Filter ι) (𝓝 0)) : + ultraPositive ω f hf a = 0 := + tendsto_nhds_unique (tendsto_ultraPositive ω f hf a) ha +end Ultra + +section GNS +variable {A : Type*} [NonUnitalCStarAlgebra A] [PartialOrder A] [StarOrderedRing A] +variable (f : A →ₚ[ℂ] ℂ) + +lemma gns_zero_of_sandwich (a : A) + (ha : ∀ b : A, f (star (a * b) * (a * b)) = 0) : + f.gnsNonUnitalStarAlgHom a = 0 := by + ext x + induction x using UniformSpace.Completion.induction_on with + | hp => exact isClosed_eq (f.gnsNonUnitalStarAlgHom a).continuous continuous_const + | ih b => + rw [zero_apply, ← norm_eq_zero] + rw [f.gnsNonUnitalStarAlgHom_apply_coe, UniformSpace.Completion.norm_coe] + change ‖f.toPreGNS (a * f.ofPreGNS b)‖ = 0 + rw [f.preGNS_norm_def] + simp only [f.ofPreGNS_toPreGNS, ha, Complex.zero_re, Real.sqrt_zero] + +lemma gnsStar_nonzero_of_value {B : Type*} [CStarAlgebra B] [PartialOrder B] + [StarOrderedRing B] (g : B →ₚ[ℂ] ℂ) (a : B) + (ha : g (star a * a) ≠ 0) : g.gnsStarAlgHom a ≠ 0 := by + intro h + have hx := congrArg (fun T : g.GNS →L[ℂ] g.GNS => T + (↑(g.toPreGNS 1) : g.GNS)) h + have hn := congrArg norm hx + change ‖g.gnsNonUnitalStarAlgHom a (↑(g.toPreGNS 1) : g.GNS)‖ = ‖(0 : g.GNS)‖ at hn + rw [g.gnsNonUnitalStarAlgHom_apply_coe, UniformSpace.Completion.norm_coe] at hn + have hab : ‖g.toPreGNS a‖ = 0 := by + simp only [norm_zero] at hn + change ‖g.toPreGNS (a * 1)‖ = 0 at hn + simpa using hn + have hh := g.preGNS_norm_sq (g.toPreGNS a) + rw [hab] at hh + apply ha + simpa using hh.symm +end GNS + +section Vector +variable {A H : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] +variable [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (π : A →⋆ₐ[ℂ] (H →L[ℂ] H)) (ξ : H) + +def vectorPositive : A →ₚ[ℂ] ℂ where + toFun a := ⟪ξ, π a ξ⟫_ℂ + map_add' a b := by simp + map_smul' c a := by simp + monotone' := by + intro a b hab + rw [← sub_nonneg, ← inner_sub_right, ← sub_apply, ← map_sub] + exact ContinuousLinearMap.nonneg_iff_isPositive.mp + (map_nonneg π (sub_nonneg.mpr hab)) |>.inner_nonneg_right ξ + +lemma vectorPositive_norm_le (hξ : ‖ξ‖ ≤ 1) (a : A) : + ‖vectorPositive π ξ a‖ ≤ ‖a‖ := by + calc + ‖vectorPositive π ξ a‖ ≤ ‖ξ‖ * ‖π a ξ‖ := norm_inner_le_norm ξ (π a ξ) + _ ≤ ‖ξ‖ * (‖a‖ * ‖ξ‖) := mul_le_mul_of_nonneg_left + ((π a).le_opNorm ξ |>.trans (mul_le_mul_of_nonneg_right + (NonUnitalStarAlgHom.norm_apply_le π a) (norm_nonneg ξ))) (norm_nonneg ξ) + _ ≤ 1 * (‖a‖ * 1) := mul_le_mul hξ + (mul_le_mul_of_nonneg_left hξ (norm_nonneg a)) (by positivity) (by positivity) + _ = ‖a‖ := by ring + +lemma vectorPositive_star_mul (a : A) : + vectorPositive π ξ (star a * a) = (‖π a ξ‖ ^ 2 : ℝ) := by + change ⟪ξ, π (star a * a) ξ⟫_ℂ = _ + rw [map_mul, map_star, mul_apply_eq_comp, ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right, inner_self_eq_norm_sq_to_K, Complex.ofReal_pow] + rfl +end Vector + +section LimitRep +variable {ι A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] +variable {H : ι → Type*} [∀ i, NormedAddCommGroup (H i)] + [∀ i, InnerProductSpace ℂ (H i)] [∀ i, CompleteSpace (H i)] +variable (ω : Ultrafilter ι) (π : ∀ i, A →⋆ₐ[ℂ] (H i →L[ℂ] H i)) + (ξ : ∀ i, H i) (hξ : ∀ i, ‖ξ i‖ ≤ 1) + +def limitFunctional : A →ₚ[ℂ] ℂ := + ultraPositive ω (fun i => vectorPositive (π i) (ξ i)) + (fun i => vectorPositive_norm_le (π i) (ξ i) (hξ i)) + +abbrev LimitHilbert := (limitFunctional ω π ξ hξ).GNS + +def limitRep : A →⋆ₐ[ℂ] (LimitHilbert ω π ξ hξ →L[ℂ] LimitHilbert ω π ξ hξ) := + (limitFunctional ω π ξ hξ).gnsStarAlgHom + +lemma limitFunctional_tendsto (a : A) : + Tendsto (fun i => vectorPositive (π i) (ξ i) a) (ω : Filter ι) + (𝓝 (limitFunctional ω π ξ hξ a)) := tendsto_ultraPositive _ _ _ _ + +lemma limitRep_annihilates (a : A) + (ha : Tendsto (fun i => ‖π i a‖) (ω : Filter ι) (𝓝 0)) : + limitRep ω π ξ hξ a = 0 := by + change (limitFunctional ω π ξ hξ).gnsNonUnitalStarAlgHom a = 0 + apply gns_zero_of_sandwich + intro b + apply ultraPositive_eq_zero_of_tendsto + have hh : Tendsto (fun i => ‖π i (a * b) (ξ i)‖) (ω : Filter ι) (𝓝 0) := by + apply squeeze_zero (fun i => norm_nonneg _) (fun i => ?_) + (show Tendsto (fun i => ‖π i a‖ * ‖b‖) (ω : Filter ι) (𝓝 0) by + simpa using ha.mul_const ‖b‖) + have hmul : ‖π i (a * b)‖ ≤ ‖π i a‖ * ‖b‖ := by + rw [map_mul] + exact (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_left + (NonUnitalStarAlgHom.norm_apply_le (π i) b) (norm_nonneg _)) + calc + ‖π i (a * b) (ξ i)‖ ≤ ‖π i (a * b)‖ * ‖ξ i‖ := (π i (a * b)).le_opNorm _ + _ ≤ (‖π i a‖ * ‖b‖) * 1 := mul_le_mul hmul (hξ i) (norm_nonneg _) (by positivity) + _ = ‖π i a‖ * ‖b‖ := mul_one _ + simpa only [vectorPositive_star_mul, zero_pow (by decide : 2 ≠ 0), Complex.ofReal_zero] + using (hh.pow 2).ofReal + +lemma limitRep_nonzero (a : A) {δ : ℝ} (hδ : 0 < δ) + (ha : ∀ᶠ i in (ω : Filter ι), δ ≤ ‖π i a (ξ i)‖) : + limitRep ω π ξ hξ a ≠ 0 := by + apply gnsStar_nonzero_of_value + have hlim := (Complex.continuous_re.tendsto _).comp + (limitFunctional_tendsto ω π ξ hξ (star a * a)) + have hle : δ ^ 2 ≤ (limitFunctional ω π ξ hξ (star a * a)).re := by + apply ge_of_tendsto hlim + filter_upwards [ha] with i hi + simp only [Function.comp_apply, vectorPositive_star_mul, Complex.ofReal_re] + exact pow_le_pow_left₀ hδ.le hi 2 + intro hf + rw [hf, Complex.zero_re] at hle + nlinarith [sq_pos_of_pos hδ] +end LimitRep +end MainGap + +noncomputable section +open scoped Topology ComplexOrder InnerProductSpace +namespace MainGap + +variable {A H : Type*} [CStarAlgebra A] +variable [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable (π : A →⋆ₐ[ℂ] (H →L[ℂ] H)) (v : A) + +def generatedRange : Submodule ℂ H := + (Submodule.span ℂ {x | ∃ a : A, ∃ y : H, x = π a (π v y)}).topologicalClosure + +instance : CompleteSpace (generatedRange π v) := by + unfold generatedRange + infer_instance + +lemma range_mem_generatedRange (y : H) : π v y ∈ generatedRange π v := by + apply Submodule.le_topologicalClosure + apply Submodule.subset_span + exact ⟨1, y, by simp⟩ + +lemma generatedRange_invariant (a : A) : + ∀ x ∈ generatedRange π v, π a x ∈ generatedRange π v := by + change generatedRange π v ≤ (generatedRange π v).comap (π a).toLinearMap + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro x ⟨b, y, rfl⟩ + apply Submodule.le_topologicalClosure + apply Submodule.subset_span + exact ⟨a * b, y, by simp⟩ + · exact (Submodule.isClosed_topologicalClosure _).preimage (π a).continuous + +def rangeRestriction : A →⋆ₐ[ℂ] (generatedRange π v →L[ℂ] generatedRange π v) where + toFun a := (π a).restrict (generatedRange_invariant π v a) + map_one' := by ext x; simp [ContinuousLinearMap.restrict] + map_mul' a b := by ext x; simp [ContinuousLinearMap.restrict] + map_add' a b := by ext x; simp [ContinuousLinearMap.restrict] + commutes' c := by ext x; simp [ContinuousLinearMap.restrict, Algebra.algebraMap_eq_smul_one] + map_zero' := by ext x; simp [ContinuousLinearMap.restrict] + map_star' a := by + change (π (star a)).restrict (generatedRange_invariant π v (star a)) = + ContinuousLinearMap.adjoint ((π a).restrict (generatedRange_invariant π v a)) + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro x y + change ⟪π (star a) (x : H), (y : H)⟫_ℂ = ⟪(x : H), π a (y : H)⟫_ℂ + rw [map_star, ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_left] + +@[simp] +lemma rangeRestriction_apply (a : A) (x : generatedRange π v) : + ((rangeRestriction π v a x : generatedRange π v) : H) = π a (x : H) := rfl + +lemma rangeRestriction_kills (u : A) (hu : ∀ a : A, π u * π a * π v = 0) : + rangeRestriction π v u = 0 := by + have hle : generatedRange π v ≤ (π u).ker := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro x ⟨a, y, rfl⟩ + change π u (π a (π v y)) = 0 + have := congrArg (fun T : H →L[ℂ] H => T y) (hu a) + simpa using this + · exact (π u).isClosed_ker + ext x + exact hle x.property + +lemma rangeRestriction_nonzero (hv : IsSelfAdjoint v) (hne : π v ≠ 0) : + rangeRestriction π v v ≠ 0 := by + intro h + apply hne + apply (CStarRing.star_mul_self_eq_zero_iff (π v)).mp + have hv' : IsSelfAdjoint (π v) := hv.map π + rw [hv'.star_eq] + ext y + have hy := congrArg (fun T : generatedRange π v →L[ℂ] generatedRange π v => + T ⟨π v y, range_mem_generatedRange π v y⟩) h + have := congrArg (fun x : generatedRange π v => (x : H)) hy + simpa using this + +end MainGap + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Separation.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Separation.lean new file mode 100644 index 0000000000000000000000000000000000000000..93841624ec9d660acec2fd0552c86d74a53c9b9f --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Separation.lean @@ -0,0 +1,114 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Products + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +universe u +variable {A : Type u} [NonUnitalCStarAlgebra A] +local instance separationPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance separationStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma ramp_mem_Her {a : A} (ha : 0 ≤ a) {l u : ℝ} (hl : 0 ≤ l) : + ramp a l u ∈ Her a := + Her_mono_of_mem (cut_mem_Her ha l) (ramp_mem_Her_cut ha hl) + +lemma NormSignal.cutoff_ramp {a p : A} (h : NormSignal a p) (hp : 0 ≤ p) : + NormSignal a (ramp p (1/2) 1) := by + intro R hR + let π := R.hom.toNonUnitalStarAlgHom.comp (Unitization.inrNonUnitalStarAlgHom ℂ A) + change ‖π (ramp p (1/2) 1)‖=1 + rw [map_ramp π hp (by norm_num : (0:ℝ)≤1/2)] + apply norm_ramp_eq_one (map_nonneg π hp) (by norm_num) (by norm_num) + exact (h R hR).symm.le + +lemma HerCompression.mono {p q c : A} {κ τ : ℝ} (h : HerCompression p q c κ) + (hκτ : κ ≤ τ) : HerCompression p q c τ := by + intro x hx k hk + exact (h x hx k hk).trans (by gcongr) + +lemma iteration_step {p q c : A} {r θ : ℝ} (hp : 0 ≤ p) (hq : 0 ≤ q) + (hr : 0 < r) (_h : HerCompression p q c r) + {p' q' : A} (hp'H : p' ∈ Her (ramp p (1/2) 1)) + (hq'H : q' ∈ Her (ramp q (1/2) 1)) + (h' : HerCompression p' q' + (r⁻¹ • (ramp p (1/4) (1/2)*c*ramp q (1/4) (1/2))) θ) : + HerCompression p' q' c (r*θ) := by + have hpg : ramp p (1/4) (1/2)*cut p (1/2)=cut p (1/2) := + ramp_mul_cut hp (by norm_num) (by norm_num) le_rfl + have hqg : ramp q (1/4) (1/2)*cut q (1/2)=cut q (1/2) := + ramp_mul_cut hq (by norm_num) (by norm_num) le_rfl + have hpg' : cut p (1/2)*ramp p (1/4) (1/2)=cut p (1/2) := by + simpa only [star_mul, (cut_nonneg p (1/2)).isSelfAdjoint.star_eq, + (ramp_nonneg p (by norm_num : (1/4:ℝ)≤1/2)).isSelfAdjoint.star_eq] using congrArg star hpg + intro x hx k hk + have hxcut : x ∈ Her (cut p (1/2)) := + Her_mono_of_mem (ramp_mem_Her_cut hp (by norm_num : (0:ℝ)≤1/2)) + (Her_mono_of_mem hp'H hx) + have hkcut : k ∈ Her (cut q (1/2)) := + Her_mono_of_mem (ramp_mem_Her_cut hq (by norm_num : (0:ℝ)≤1/2)) + (Her_mono_of_mem hq'H hk) + have hxg := Her_fixed_right (cut_nonneg p (1/2)).isSelfAdjoint hpg' hxcut + have hgk := Her_fixed_left hqg hkcut + have he : x*(r⁻¹ • (ramp p (1/4) (1/2)*c*ramp q (1/4) (1/2)))*k = + r⁻¹ • (x*c*k) := by + rw [mul_smul_comm, smul_mul_assoc] + congr 1 + simp only [mul_assoc, ← mul_assoc x (ramp p (1/4) (1/2)), hxg, hgk] + have hb := h' x hx k hk + rw [he, norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hr)] at hb + have hbr := mul_le_mul_of_nonneg_left hb hr.le + simpa only [← mul_assoc, mul_inv_cancel₀ hr.ne', one_mul] using hbr + +theorem iterated_separation (hp : PropertyP A) {a b c : A} (ha : 0 ≤ a) (han : ‖a‖ ≤ 1) + (hb : 0 ≤ b) (hbn : ‖b‖ ≤ 1) (hcn : ‖c‖ ≤ 1) {ζ : ℝ} (hζ : 0 < ζ) : + ∃ (p q : A) (κ : ℝ), 0 ≤ p ∧ ‖p‖ ≤ 1 ∧ p ∈ Her a ∧ + 0 ≤ q ∧ ‖q‖ ≤ 1 ∧ q ∈ Her b ∧ 0 ≤ κ ∧ κ < ζ ∧ + HerCompression p q c κ ∧ NormSignal a p ∧ NormSignal b q := by + obtain ⟨θ,hθ0,hθ1,huniform⟩ := uniform_shrinking hp + have hi : ∀ n : ℕ, ∃ p q : A, 0 ≤ p ∧ ‖p‖ ≤ 1 ∧ p ∈ Her a ∧ + 0 ≤ q ∧ ‖q‖ ≤ 1 ∧ q ∈ Her b ∧ + HerCompression p q c (θ^(n+1)) ∧ NormSignal a p ∧ NormSignal b q := by + intro n + induction n with + | zero => simpa only [Nat.zero_add, pow_one] using huniform a b c ha han hb hbn hcn + | succ n ih => + obtain ⟨p,q,hp0,hpn,hpH,hq0,hqn,hqH,hcomp,hps,hqs⟩ := ih + let f : A → A := fun p => ramp p (1/2) 1 + let g : A → A := fun p => ramp p (1/4) (1/2) + let r := θ^(n+1) + have hr : 0 < r := pow_pos hθ0 _ + have hgH (p : A) (hp : 0 ≤ p) : g p ∈ Her p := ramp_mem_Her hp (by norm_num) + have hgn (p : A) : ‖g p‖ ≤ 1 := norm_ramp_le_one p (by norm_num) + have hf0 (p : A) : 0 ≤ f p := ramp_nonneg p (by norm_num) + have hfn (p : A) : ‖f p‖ ≤ 1 := norm_ramp_le_one p (by norm_num) + have hc' : ‖r⁻¹ • (g p*c*g q)‖ ≤ 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hr)] + have hh : ‖g p*c*g q‖ ≤ r := (hcomp _ (hgH p hp0) _ (hgH q hq0)).trans (by + calc r*‖g p‖*‖g q‖ ≤ r*1*1 := by gcongr <;> apply hgn + _ = r := by ring) + calc r⁻¹*‖g p*c*g q‖ ≤ r⁻¹*r := mul_le_mul_of_nonneg_left hh (inv_nonneg.mpr hr.le) + _ = 1 := inv_mul_cancel₀ hr.ne' + obtain ⟨p',q',hp'0,hp'n,hp'H,hq'0,hq'n,hq'H,hcomp',hps',hqs'⟩ := + huniform (f p) (f q) (r⁻¹ • (g p*c*g q)) (hf0 p) (hfn p) (hf0 q) (hfn q) hc' + refine ⟨p',q',hp'0,hp'n,?_,hq'0,hq'n,?_,?_,?_,?_⟩ + · exact Her_mono_of_mem hpH (Her_mono_of_mem (ramp_mem_Her hp0 (by norm_num)) hp'H) + · exact Her_mono_of_mem hqH (Her_mono_of_mem (ramp_mem_Her hq0 (by norm_num)) hq'H) + · have hh := iteration_step hp0 hq0 hr hcomp hp'H hq'H hcomp' + simpa only [r, pow_succ] using hh + · intro R hR + exact hps' R (by rw [hps.cutoff_ramp hp0 R hR]; norm_num) + · intro R hR + exact hqs' R (by rw [hqs.cutoff_ramp hq0 R hR]; norm_num) + obtain ⟨n,hn⟩ := exists_pow_lt_of_lt_one hζ hθ1 + obtain ⟨p,q,hp0,hpn,hpH,hq0,hqn,hqH,hcomp,hps,hqs⟩ := hi n + refine ⟨p,q,θ^(n+1),hp0,hpn,hpH,hq0,hqn,hqH,(pow_pos hθ0 _).le,?_,hcomp,hps,hqs⟩ + exact (by rw [pow_succ]; nlinarith [pow_pos hθ0 n] : θ^(n+1)≤θ^n).trans_lt hn +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Shrinking.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Shrinking.lean new file mode 100644 index 0000000000000000000000000000000000000000..412e3e0cc84483d3e1a944ee3d0ec2f87aa1bfdd --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Shrinking.lean @@ -0,0 +1,244 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Compression + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +universe u v +variable {A : Type u} [CStarAlgebra A] +local instance shrinkingPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance shrinkingStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance shrinkingOperatorPartialOrder (J : Type*) [NormedAddCommGroup J] + [InnerProductSpace ℂ J] [CompleteSpace J] : + PartialOrder (J →L[ℂ] J) := CStarAlgebra.spectralOrder _ +local instance shrinkingOperatorStarOrderedRing (J : Type*) [NormedAddCommGroup J] + [InnerProductSpace ℂ J] [CompleteSpace J] : + StarOrderedRing (J →L[ℂ] J) := CStarAlgebra.spectralOrderedRing _ + +theorem conditional_shrinking {a y c p : A} (_ha : 0 ≤ a) (hy : 0 ≤ y) + (hp : 0 ≤ p) (hpn : ‖p‖ ≤ 1) (hyn : ‖y‖ ≤ 1) (hcn : ‖c‖ ≤ 1) + (hpH : p ∈ Her a) + (hsignal : ∀ R : HilbertRep.{u,u} A, (1/2:ℝ)<‖R.hom a‖ → ‖R.hom p‖=1) + (hvan : ∀ R : HilbertRep.{u,u} A, + R.hom (y*(1-star c*(p*p)*c)*y)=0 → ‖R.hom y‖ ≤ (1/4:ℝ)) : + ∃ (p₁ q₁ : A) (κ : ℝ), 0 ≤ p₁ ∧ ‖p₁‖ ≤ 1 ∧ p₁ ∈ Her a ∧ + 0 ≤ q₁ ∧ ‖q₁‖ ≤ 1 ∧ q₁ ∈ Her y ∧ 0 ≤ κ ∧ κ < 1 ∧ + HerCompression p₁ q₁ c κ ∧ + (∀ R : HilbertRep.{u,u} A, (1/2:ℝ)<‖R.hom a‖ → ‖R.hom p₁‖=1) ∧ + (∀ R : HilbertRep.{u,u} A, (1/2:ℝ)<‖R.hom y‖ → ‖R.hom q₁‖=1) := by + obtain ⟨δ,hδ,hδ₁,hquant⟩ := quantitative_nonvanishing hy hvan + let d := y*(1-star c*(p*p)*c)*y + have hd : 0 ≤ d := (conditional_defect_bounds hp hy hpn hyn hcn).1 + let q := y*cut d δ*y + have hq : 0 ≤ q := by + simpa only [hy.isSelfAdjoint.star_eq] using star_left_conjugate_nonneg (cut_nonneg d δ) y + have hqH : q ∈ Her y := by + simpa only [hy.isSelfAdjoint.star_eq] using sandwich_mem_Her y (cut d δ) + have hqvan (R : HilbertRep.{u,u} A) (hz : R.hom q=0) : ‖R.hom y‖ ≤ (3/8:ℝ) := by + have hqzero : R.hom y * cut (R.hom y*(1-star (R.hom c)*(R.hom p*R.hom p)*R.hom c)*R.hom y) δ * R.hom y=0 := by + change R.hom (y*cut d δ*y)=0 at hz + rw [map_mul, map_mul, map_cut_sa R.hom hd.isSelfAdjoint hδ.le] at hz + simpa only [d, map_mul, map_sub, map_one, map_star] using hz + have hb := conditional_q_zero (map_nonneg R.hom hp) (map_nonneg R.hom hy) + ((NonUnitalStarAlgHom.norm_apply_le R.hom p).trans hpn) + ((NonUnitalStarAlgHom.norm_apply_le R.hom y).trans hyn) + ((NonUnitalStarAlgHom.norm_apply_le R.hom c).trans hcn) hδ hqzero + have hb' : ‖R.hom d‖ ≤ δ := by + simpa only [d, map_mul, map_sub, map_one, map_star] using hb + by_contra! hRy + exact (not_lt_of_ge hb') (hquant R hRy) + obtain ⟨δ',hδ',hδ'₁,hquant'⟩ := quantitative_nonvanishing_general hy + (by norm_num : (0:ℝ)≤3/8) (by norm_num : (3/8:ℝ)<1/2) hqvan + let r := Real.sqrt (1-δ) + have hr : 0 ≤ r := Real.sqrt_nonneg _ + have hr₁ : r < 1 := by + apply (Real.sqrt_lt' (by norm_num : (0:ℝ)<1)).mpr + linarith + let τ := (r+1)/2 + have hτ : 0 < τ := by dsimp [τ]; linarith + have hrτ : r < τ := by dsimp [τ]; linarith + have hτ₁ : τ < 1 := by dsimp [τ]; linarith + let p₁ := ramp p τ 1 + let q₁ := ramp q (δ'/2) δ' + have hp₁ : 0 ≤ p₁ := ramp_nonneg p hτ₁.le + have hq₁ : 0 ≤ q₁ := ramp_nonneg q (by linarith) + have hq₁H : q₁ ∈ Her q := + Her_mono_of_mem (cut_mem_Her hq (δ'/2)) (ramp_mem_Her_cut hq (by positivity)) + refine ⟨p₁,q₁,r/τ,hp₁,norm_ramp_le_one p hτ₁.le,?_,hq₁, + norm_ramp_le_one q (by linarith),Her_mono_of_mem hqH hq₁H, + div_nonneg hr hτ.le,(div_lt_one hτ).mpr hrτ,?_,?_,?_⟩ + · exact Her_mono_of_mem hpH (Her_mono_of_mem (cut_mem_Her hp τ) (ramp_mem_Her_cut hp hτ.le)) + · have hcomp := compression_of_conditional_loss hp hτ hr (conditional_Her_loss hp hy hpn hyn hcn hδ.le hδ₁.le) + intro x hx k hk + exact hcomp x hx k (Her_mono_of_mem hq₁H hk) + · intro R hRa + change ‖R.hom (ramp p τ 1)‖=1 + rw [map_ramp_sa R.hom hp.isSelfAdjoint hτ.le] + exact norm_ramp_eq_one (map_nonneg R.hom hp) hτ.le hτ₁ (by rw [hsignal R hRa]) + · intro R hRy + change ‖R.hom (ramp q (δ'/2) δ')‖=1 + rw [map_ramp_sa R.hom hq.isSelfAdjoint (by positivity)] + exact norm_ramp_eq_one (map_nonneg R.hom hq) (by positivity) (by linarith) (hquant' R hRy).le + +theorem shrinking_unital_local {a y c : A} (ha : 0 ≤ a) (hy : 0 ≤ y) + (hyn : ‖y‖ ≤ 1) (hcn : ‖c‖ ≤ 1) + (hp : ∀ z : A, 0 ≤ z → z ∈ Her a → ProperlyInfinite z) : + ∃ (p q : A) (κ : ℝ), 0 ≤ p ∧ ‖p‖ ≤ 1 ∧ p ∈ Her a ∧ + 0 ≤ q ∧ ‖q‖ ≤ 1 ∧ q ∈ Her y ∧ 0 ≤ κ ∧ κ < 1 ∧ + HerCompression p q c κ ∧ + (∀ R : HilbertRep.{u,u} A, (1/2:ℝ)<‖R.hom a‖ → ‖R.hom p‖=1) ∧ + (∀ R : HilbertRep.{u,u} A, (1/2:ℝ)<‖R.hom y‖ → ‖R.hom q‖=1) := by + obtain ⟨p,hpp,hpn,hpH,hsignal,hvan⟩ := graph_nonvanishing.{u,u} ha hy hcn hp + exact conditional_shrinking ha hy hpp hpn hyn hcn hpH hsignal hvan + +end MainGap + +namespace MainGap +variable {A B : Type*} [NonUnitalCStarAlgebra A] [NonUnitalCStarAlgebra B] + +def matrixMap (π : A →⋆ₙₐ[ℂ] B) {m n : ℕ} (x : CStarMatrix (Fin m) (Fin n) A) : + CStarMatrix (Fin m) (Fin n) B := CStarMatrix.ofMatrix (fun i j => π (x i j)) + +lemma matrixMap_mul (π : A →⋆ₙₐ[ℂ] B) {l m n : ℕ} + (x : CStarMatrix (Fin l) (Fin m) A) (y : CStarMatrix (Fin m) (Fin n) A) : + matrixMap π (x*y)=matrixMap π x * matrixMap π y := by + ext i j + change π (∑ k, x i k * y k j) = ∑ k, π (x i k) * π (y k j) + simp only [map_sum, map_mul] + +lemma matrixMap_star (π : A →⋆ₙₐ[ℂ] B) {m n : ℕ} + (x : CStarMatrix (Fin m) (Fin n) A) : + matrixMap π x.conjTranspose=(matrixMap π x).conjTranspose := by + ext i j + change π (star (x j i)) = star (π (x j i)) + exact map_star π _ + +lemma continuous_matrixMap (π : A →⋆ₙₐ[ℂ] B) {m n : ℕ} : + Continuous (matrixMap π : CStarMatrix (Fin m) (Fin n) A → CStarMatrix (Fin m) (Fin n) B) := by + apply continuous_pi + intro i + apply continuous_pi + intro j + exact (map_continuous π).comp ((continuous_apply j).comp (continuous_apply i)) + +lemma FiniteCuntzLE.map (π : A →⋆ₙₐ[ℂ] B) {m n : ℕ} + {d : CStarMatrix (Fin n) (Fin n) A} {v : CStarMatrix (Fin m) (Fin m) A} + (h : FiniteCuntzLE d v) : FiniteCuntzLE (matrixMap π d) (matrixMap π v) := by + obtain ⟨r,ht⟩ := h + refine ⟨fun j => matrixMap π (r j), ?_⟩ + have he := (continuous_matrixMap π).continuousAt.tendsto.comp ht + change Tendsto (fun j => matrixMap π ((r j).conjTranspose * v * r j)) atTop (𝓝 (matrixMap π d)) at he + simpa only [matrixMap_mul, matrixMap_star] using he + +lemma ProperlyInfinite.map (π : A →⋆ₙₐ[ℂ] B) {h : A} (hh : ProperlyInfinite h) : + ProperlyInfinite (π h) := by + have he := FiniteCuntzLE.map π hh + have hdouble : matrixMap π (doubleCorner h)=doubleCorner (π h) := by + ext i j + change π (if i=j then h else 0) = if i=j then π h else 0 + split_ifs <;> simp + have hsingle : matrixMap π (scalarCorner h)=scalarCorner (π h) := rfl + change FiniteCuntzLE _ _ + rwa [hdouble, hsingle] at he + +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance shrinkingHerPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance shrinkingHerStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance shrinkingHerUnitizationPartialOrder : PartialOrder (Unitization ℂ A) := + CStarAlgebra.spectralOrder _ +local instance shrinkingHerUnitizationStarOrderedRing : StarOrderedRing (Unitization ℂ A) := + CStarAlgebra.spectralOrderedRing _ + +lemma unitization_Her {a : A} {z : Unitization ℂ A} + (hz : z ∈ Her (a : Unitization ℂ A)) : z.fst=0 ∧ z.snd ∈ Her a := by + have hc : IsClosed {z : Unitization ℂ A | z.fst=0 ∧ z.snd ∈ Her a} := + (isClosed_eq Unitization.continuous_fst continuous_const).inter + ((isClosed_Her a).preimage Unitization.continuous_snd) + apply closure_minimal (s := Set.range (fun b : Unitization ℂ A => + (a : Unitization ℂ A)*b*star (a : Unitization ℂ A))) _ hc hz + rintro z ⟨b,rfl⟩ + constructor + · simp + · change ((a : Unitization ℂ A)*b*star (a : Unitization ℂ A)).snd ∈ Her a + have he : ((a : Unitization ℂ A)*b*star (a : Unitization ℂ A)).snd = + b.fst • (a*star a) + a*b.snd*star a := by + simp [Unitization.snd_mul, Unitization.fst_mul, add_mul, smul_mul_assoc] + rw [he] + exact (Her a).add_mem ((Her a).smul_mem b.fst (mul_star_mem_Her a)) (sandwich_mem_Her a b.snd) + +lemma unitization_inr_snd_of_Her {a : A} {z : Unitization ℂ A} + (hz : z ∈ Her (a : Unitization ℂ A)) : (z.snd : Unitization ℂ A)=z := by + have he := Unitization.inl_fst_add_inr_snd_eq z + simpa only [(unitization_Her hz).1, Unitization.inl_zero, zero_add] using he + +lemma unitization_proper_hereditary (hp : PropertyP A) {a : A} + {z : Unitization ℂ A} (hz : 0 ≤ z) (hzH : z ∈ Her (a : Unitization ℂ A)) : + ProperlyInfinite z := by + have he := unitization_inr_snd_of_Her hzH + have hz' : 0 ≤ z.snd := Unitization.inr_nonneg_iff.mp (he.symm ▸ hz) + have hh := (hp z.snd hz').map (Unitization.inrNonUnitalStarAlgHom ℂ A) + change ProperlyInfinite (z.snd : Unitization ℂ A) at hh + rwa [he] at hh + +end MainGap + +namespace MainGap +universe u +variable {A : Type u} [NonUnitalCStarAlgebra A] +local instance shrinkingNonunitalPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance shrinkingNonunitalStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance shrinkingNonunitalUnitizationPartialOrder : PartialOrder (Unitization ℂ A) := + CStarAlgebra.spectralOrder _ +local instance shrinkingNonunitalUnitizationStarOrderedRing : StarOrderedRing (Unitization ℂ A) := + CStarAlgebra.spectralOrderedRing _ + +def NormSignal (a p : A) : Prop := + ∀ R : HilbertRep.{u,u} (Unitization ℂ A), (1/2:ℝ)<‖R.hom (a : Unitization ℂ A)‖ → + ‖R.hom (p : Unitization ℂ A)‖=1 + +theorem shrinking_nonunital (hp : PropertyP A) {a y c : A} (ha : 0 ≤ a) (hy : 0 ≤ y) + (hyn : ‖y‖ ≤ 1) (hcn : ‖c‖ ≤ 1) : + ∃ (p q : A) (κ : ℝ), 0 ≤ p ∧ ‖p‖ ≤ 1 ∧ p ∈ Her a ∧ + 0 ≤ q ∧ ‖q‖ ≤ 1 ∧ q ∈ Her y ∧ 0 ≤ κ ∧ κ < 1 ∧ + HerCompression p q c κ ∧ NormSignal a p ∧ NormSignal y q := by + obtain ⟨p,q,κ,hp0,hpn,hpH,hq0,hqn,hqH,hκ0,hκ1,hcomp,hps,hqs⟩ := + shrinking_unital_local (Unitization.inr_nonneg_iff.mpr ha) + (Unitization.inr_nonneg_iff.mpr hy) + (by simpa only [Unitization.norm_inr] using hyn : ‖(y : Unitization ℂ A)‖ ≤ 1) + (by simpa only [Unitization.norm_inr] using hcn : ‖(c : Unitization ℂ A)‖ ≤ 1) + (fun z hz hzH => unitization_proper_hereditary hp hz hzH) + have hep := unitization_inr_snd_of_Her hpH + have heq := unitization_inr_snd_of_Her hqH + refine ⟨p.snd,q.snd,κ,Unitization.inr_nonneg_iff.mp (hep.symm ▸ hp0),?_, + (unitization_Her hpH).2,Unitization.inr_nonneg_iff.mp (heq.symm ▸ hq0),?_, + (unitization_Her hqH).2,hκ0,hκ1,?_,?_,?_⟩ + · have hn : ‖p.snd‖=‖p‖ := by simpa only [Unitization.norm_inr] using congrArg norm hep + rwa [hn] + · have hn : ‖q.snd‖=‖q‖ := by simpa only [Unitization.norm_inr] using congrArg norm heq + rwa [hn] + · intro x hx k hk + have hx' := Her_map (Unitization.inrNonUnitalStarAlgHom ℂ A) hx + have hk' := Her_map (Unitization.inrNonUnitalStarAlgHom ℂ A) hk + change (x : Unitization ℂ A) ∈ Her (p.snd : Unitization ℂ A) at hx' + change (k : Unitization ℂ A) ∈ Her (q.snd : Unitization ℂ A) at hk' + rw [hep] at hx' + rw [heq] at hk' + have hb := hcomp _ hx' _ hk' + simpa only [← Unitization.inr_mul, Unitization.norm_inr] using hb + · intro R hRa + rw [hep] + exact hps R hRa + · intro R hRy + rw [heq] + exact hqs R hRy +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Signal.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Signal.lean new file mode 100644 index 0000000000000000000000000000000000000000..2067f2b096ad0dba192694afd6962764e3b89c23 --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Signal.lean @@ -0,0 +1,200 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.IdealComparison + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance signalCutPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance signalCutStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma Her_cut_lower {a : A} (ha : 0 ≤ a) {δ : ℝ} (hδ : 0 ≤ δ) + {p : A} (hp : p ∈ Her (cut a δ)) : + δ • (star p * p) ≤ star p * a * p := by + have hc : IsClosed {p : A | δ • (star p * p) ≤ star p * a * p} := + isClosed_le (by fun_prop) (by fun_prop) + apply closure_minimal (s := Set.range (fun w : A => cut a δ * w * star (cut a δ))) _ hc hp + rintro _ ⟨w, rfl⟩ + change δ • (star (cut a δ * w * star (cut a δ)) * + (cut a δ * w * star (cut a δ))) ≤ + star (cut a δ * w * star (cut a δ)) * a * (cut a δ * w * star (cut a δ)) + have hh := star_left_conjugate_le_conjugate (cut_sandwich_lower ha.isSelfAdjoint hδ) + (w * cut a δ) + simpa only [star_mul, (cut_nonneg a δ).isSelfAdjoint.star_eq, + mul_smul_comm, smul_mul_assoc, mul_assoc] using hh + +lemma norm_cut_le_sub {a : A} (ha : 0 ≤ a) {M δ : ℝ} (han : ‖a‖ ≤ M) + (hδ : δ ≤ M) : ‖cut a δ‖ ≤ M - δ := by + apply norm_cfcₙ_le + intro t ht + have htM : t ≤ M := (le_abs_self t).trans + ((NonUnitalIsometricContinuousFunctionalCalculus.norm_quasispectrum_le a ht ha.isSelfAdjoint).trans han) + rw [Real.norm_eq_abs, abs_of_nonneg (le_max_right _ _)] + exact max_le (by linarith) (sub_nonneg.mpr hδ) + +lemma cut_eq_zero_of_norm_le_nonunital {a : A} (ha : 0 ≤ a) {δ : ℝ} (haδ : ‖a‖ ≤ δ) : + cut a δ = 0 := by + apply norm_eq_zero.mp + exact le_antisymm (by simpa using norm_cut_le_sub ha haδ le_rfl) (norm_nonneg _) + +end MainGap + +namespace MainGap +universe u +variable {A : Type u} [NonUnitalCStarAlgebra A] +local instance signalComparisonPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance signalComparisonStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A +local instance signalOperatorPartialOrder (H : Type*) [NormedAddCommGroup H] + [InnerProductSpace ℂ H] [CompleteSpace H] : + PartialOrder (H →L[ℂ] H) := CStarAlgebra.spectralOrder _ +local instance signalOperatorStarOrderedRing (H : Type*) [NormedAddCommGroup H] + [InnerProductSpace ℂ H] [CompleteSpace H] : + StarOrderedRing (H →L[ℂ] H) := CStarAlgebra.spectralOrderedRing _ + +lemma signal_cut_comparison (hP : PropertyP A) {a p : A} (ha : 0 ≤ a) {δ : ℝ} + (hδ : 0 < δ) (hpH : p ∈ Her (ramp a δ (2*δ))) + (hsignal : NormSignal (ramp a δ (2*δ)) p) : + ScalarCuntzLE (cut a (2*δ)) (star p * a * p) := by + let v := star p * a * p + have hv : 0 ≤ v := star_left_conjugate_nonneg ha p + let V : Unitization ℂ A := Unitization.inr v + have hV : 0 ≤ V := Unitization.inr_nonneg_iff.mpr hv + let J := closedIdeal V hV.isSelfAdjoint + have hcut : (Unitization.inr (cut a (2*δ)) : Unitization ℂ A) ∈ J := by + by_contra hh + obtain ⟨R,hRJ,hRcut⟩ := exists_rep_killing_ideal J + (closedIdeal_closed V hV.isSelfAdjoint) + (fun x z hz => closedIdeal_left hV.isSelfAdjoint hz x) + (fun x z hz => closedIdeal_right hV.isSelfAdjoint hz x) hh + let π := R.hom.toNonUnitalStarAlgHom.comp (Unitization.inrNonUnitalStarAlgHom ℂ A) + have hvzero : π v = 0 := hRJ V (self_mem_closedIdeal V hV.isSelfAdjoint) + have hlower := Her_cut_lower ha hδ.le + (Her_mono_of_mem (ramp_mem_Her_cut ha hδ.le) hpH) + have hpos := map_nonneg π (sub_nonneg.mpr hlower) + have hsmul (r : ℝ) (z : A) : π (r • z)=r • π z := + LinearMapClass.map_smul_of_tower π r z + change 0 ≤ π (v - δ • (star p * p)) at hpos + rw [map_sub, hvzero, hsmul, map_mul, map_star] at hpos + have hz : δ • (star (π p) * π p) = 0 := + le_antisymm (by simpa only [zero_sub, neg_nonneg] using hpos) + (smul_nonneg hδ.le (star_mul_self_nonneg _)) + have hpzero : π p = 0 := (CStarRing.star_mul_self_eq_zero_iff _).mp + ((smul_eq_zero.mp hz).resolve_left hδ.ne') + have hnorm : 2*δ < ‖π a‖ := by + by_contra! hn + apply hRcut + change π (cut a (2*δ)) = 0 + rw [map_cut π ha (by positivity), cut_eq_zero_of_norm_le (map_nonneg π ha) hn] + have hramp : ‖π (ramp a δ (2*δ))‖ = 1 := by + rw [map_ramp π ha hδ.le] + exact norm_ramp_eq_one (map_nonneg π ha) hδ.le (by linarith) hnorm.le + have hpn := hsignal R (by change (1/2:ℝ) < ‖π (ramp a δ (2*δ))‖; rw [hramp]; norm_num) + change ‖π p‖ = 1 at hpn + rw [hpzero, norm_zero] at hpn + norm_num at hpn + apply scalarCuntzLE_of_inr hv + exact closedIdeal_comparison (Unitization.inr_nonneg_iff.mpr (cut_nonneg _ _)) hV + ((hP v hv).map (Unitization.inrNonUnitalStarAlgHom ℂ A)) hcut + +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance signalCoefficientPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance signalCoefficientStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma signal_coefficient (hP : PropertyP A) {a p : A} (ha : 0 ≤ a) (han : ‖a‖ ≤ 1) + {δ ρ : ℝ} (hδ : 0 < δ) (hδhalf : δ < 1/2) (hρ : 0 < ρ) (hρδ : ρ ≤ 2*δ) + (hpH : p ∈ Her (ramp a δ (2*δ))) (hsignal : NormSignal (ramp a δ (2*δ)) p) : + ∃ w : A, ‖star (p*w)*a*(p*w)-a‖ < 2*δ+ρ ∧ + ‖p*w‖ ≤ Real.sqrt δ⁻¹ := by + have hcomp := signal_cut_comparison hP ha hδ hpH hsignal + obtain ⟨w,hw⟩ := hcomp.exists_approx hρ + have hw' : ‖star (p*w)*a*(p*w) - cut a (2*δ)‖ < ρ := by + simpa only [star_mul, mul_assoc] using hw + refine ⟨w, ?_, ?_⟩ + · calc + ‖star (p*w)*a*(p*w)-a‖ ≤ + ‖star (p*w)*a*(p*w)-cut a (2*δ)‖ + ‖cut a (2*δ)-a‖ := by simpa only [dist_eq_norm] using dist_triangle (star (p*w)*a*(p*w)) (cut a (2*δ)) a + _ < ρ + 2*δ := add_lt_add_of_lt_of_le hw' + (by simpa only [norm_sub_rev] using norm_sub_cut_le ha (by positivity : 0 ≤ 2*δ)) + _ = 2*δ+ρ := by ring + · have hlower := star_left_conjugate_le_conjugate + (Her_cut_lower ha hδ.le (Her_mono_of_mem (ramp_mem_Her_cut ha hδ.le) hpH)) w + have hlower' : δ • (star (p*w)*(p*w)) ≤ star (p*w)*a*(p*w) := by + simpa only [star_mul, mul_smul_comm, smul_mul_assoc, mul_assoc] using hlower + have hn := CStarAlgebra.norm_le_norm_of_le_of_nonneg hlower' + (smul_nonneg hδ.le (star_mul_self_nonneg (p*w))) + simp only [norm_smul, Real.norm_eq_abs, abs_of_pos hδ, CStarRing.norm_star_mul_self] at hn + have hupper : ‖star (p*w)*a*(p*w)‖ < 1 := by + calc + ‖star (p*w)*a*(p*w)‖ ≤ + ‖star (p*w)*a*(p*w)-cut a (2*δ)‖ + ‖cut a (2*δ)‖ := norm_le_norm_sub_add _ _ + _ < ρ + (1-2*δ) := add_lt_add_of_lt_of_le hw' + (norm_cut_le_sub ha han (by linarith)) + _ ≤ 1 := by linarith + have hsq : ‖p*w‖ ^ 2 ≤ δ⁻¹ := by + have hh : δ * (‖p*w‖ ^ 2) ≤ 1 := by nlinarith + have hh' := (le_inv_mul_iff₀ hδ).mpr hh + simpa only [mul_one] using hh' + have hsqrt := Real.sq_sqrt (inv_nonneg.mpr hδ.le) + nlinarith [Real.sqrt_nonneg δ⁻¹, norm_nonneg (p*w)] + +end MainGap + +namespace MainGap +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance signalProductsPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance signalProductsStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma HerCompression.right_products {p q c : A} {κ : ℝ} (hκ : 0 ≤ κ) + (hp : 0 ≤ p) (hq : 0 ≤ q) (h : HerCompression p q c κ) (w z : A) : + ‖star (p*w) * c * (q*z)‖ ≤ κ * ‖p*w‖ * ‖q*z‖ := by + let : PartialOrder (Her p) := CStarAlgebra.spectralOrder _ + let : StarOrderedRing (Her p) := CStarAlgebra.spectralOrderedRing _ + let : PartialOrder (Her q) := CStarAlgebra.spectralOrder _ + let : StarOrderedRing (Her q) := CStarAlgebra.spectralOrderedRing _ + let ap := CStarAlgebra.increasingApproximateUnit (Her p) + let aq := CStarAlgebra.increasingApproximateUnit (Her q) + let pp : Her p := ⟨p, self_mem_Her hp⟩ + let qq : Her q := ⟨q, self_mem_Her hq⟩ + have htp : Tendsto (fun e : Her p => (e : A) * (p*w)) + (CStarAlgebra.approximateUnit (Her p)) (𝓝 (p*w)) := by + have hh := ((continuous_subtype_val.tendsto pp).comp (ap.tendsto_mul_right pp)).mul + (tendsto_const_nhds (x := w)) + change Tendsto (fun e : Her p => ((e : A) * p) * w) _ (𝓝 (p*w)) at hh + simpa only [mul_assoc] using hh + have htq : Tendsto (fun e : Her q => (e : A) * (q*z)) + (CStarAlgebra.approximateUnit (Her q)) (𝓝 (q*z)) := by + have hh := ((continuous_subtype_val.tendsto qq).comp (aq.tendsto_mul_right qq)).mul + (tendsto_const_nhds (x := z)) + change Tendsto (fun e : Her q => ((e : A) * q) * z) _ (𝓝 (q*z)) at hh + simpa only [mul_assoc] using hh + have ht := ((htp.comp tendsto_fst).star.mul (tendsto_const_nhds (x := c))).mul + (htq.comp tendsto_snd) + apply le_of_tendsto ht.norm + filter_upwards [ap.eventually_norm.prod_mk aq.eventually_norm] with ef hef + rcases ef with ⟨e,f⟩ + change ‖star ((e : A)*(p*w))*c*((f : A)*(q*z))‖ ≤ _ + have he : ‖(e : A)‖ ≤ 1 := hef.1 + have hf : ‖(f : A)‖ ≤ 1 := hef.2 + calc + ‖star ((e : A)*(p*w))*c*((f : A)*(q*z))‖ = + ‖star (p*w) * (star (e : A)*c*(f : A)) * (q*z)‖ := by + simp only [star_mul, mul_assoc] + _ ≤ ‖p*w‖ * ‖star (e : A)*c*(f : A)‖ * ‖q*z‖ := by + grw [norm_mul_le, norm_mul_le, norm_star] + _ ≤ ‖p*w‖ * (κ*‖(e : A)‖*‖(f : A)‖) * ‖q*z‖ := by + gcongr + simpa only [norm_star] using h (star (e : A)) (star_mem e.property) (f : A) f.property + _ ≤ ‖p*w‖ * (κ*1*1) * ‖q*z‖ := by gcongr + _ = κ * ‖p*w‖ * ‖q*z‖ := by ring + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Stabilization.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Stabilization.lean new file mode 100644 index 0000000000000000000000000000000000000000..179bcb2825088301b988fea5891567988fd7d99b --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Stabilization.lean @@ -0,0 +1,275 @@ +import Mathlib + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap.Stable +variable {A : Type*} [NonUnitalCStarAlgebra A] +local instance positivityOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance positivityStarOrder : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +abbrev Mat (A : Type*) (n : ℕ) := CStarMatrix (Fin n) (Fin n) A + +def pad {n m : ℕ} (_ : n ≤ m) (x : Mat A n) : Mat A m := + CStarMatrix.ofMatrix fun i j => + if hi : i.val < n then if hj : j.val < n then x ⟨i,hi⟩ ⟨j,hj⟩ else 0 else 0 + +@[simp] lemma pad_entry {n m : ℕ} (h : n ≤ m) (x : Mat A n) (i j : Fin m) : + pad h x i j = (if hi : i.val < n then if hj : j.val < n then x ⟨i,hi⟩ ⟨j,hj⟩ else 0 else 0) := rfl + +@[simp] lemma pad_apply {n m : ℕ} (h : n ≤ m) (x : Mat A n) (i j : Fin n) : + pad h x (Fin.castLE h i) (Fin.castLE h j) = x i j := by simp [pad_entry] + +lemma sum_pad {n m : ℕ} (h : n ≤ m) {B : Type*} [AddCommMonoid B] (f : Fin n → B) : + ∑ k : Fin m, (if hk : k.val < n then f ⟨k,hk⟩ else 0) = ∑ k : Fin n, f k := by + classical + symm + apply Finset.sum_bij_ne_zero (fun i _ _ => Fin.castLE h i) + · simp + · intro i _ _ j _ _ hij + exact Fin.ext (congrArg (fun k : Fin m => k.val) hij) + · intro j _ hj0 + have hj : j.val < n := by + by_contra hn + simp [hn] at hj0 + exact ⟨⟨j,hj⟩, Finset.mem_univ _, by simpa [hj] using hj0, rfl⟩ + · intro i _ _ + simp + +lemma pad_mul {n m : ℕ} (h : n ≤ m) (x y : Mat A n) : + pad h (x*y) = pad h x * pad h y := by + ext i j + by_cases hi : i.val < n <;> by_cases hj : j.val < n + · simp only [pad_entry, dite_eq_left hi, dite_eq_left hj, + CStarMatrix.mul_apply] + rw [← sum_pad h (fun k => x ⟨i,hi⟩ k * y k ⟨j,hj⟩)] + apply Finset.sum_congr rfl + intro k _ + by_cases hk : k.val < n <;> simp [hk] + · simp [pad_entry, hi, hj, CStarMatrix.mul_apply] + · simp [pad_entry, hi, CStarMatrix.mul_apply] + · simp [pad_entry, hi, CStarMatrix.mul_apply] + +def padHom {n m : ℕ} (h : n ≤ m) : Mat A n →⋆ₙₐ[ℂ] Mat A m where + toFun := pad h + map_zero' := by ext i j; simp [pad_entry] + map_add' x y := by ext i j; by_cases hi : i.val < n <;> by_cases hj : j.val < n <;> simp [pad_entry, hi, hj] + map_mul' := pad_mul h + map_smul' c x := by ext i j; by_cases hi : i.val < n <;> by_cases hj : j.val < n <;> simp [pad_entry, hi, hj] + map_star' x := by ext i j; by_cases hi : i.val < n <;> by_cases hj : j.val < n <;> simp [pad_entry, hi, hj, CStarMatrix.star_apply] + +lemma pad_injective {n m : ℕ} (h : n ≤ m) : Function.Injective (pad (A := A) h) := by + intro x y hxy + ext i j + have hh := congrArg (fun z : Mat A m => z (Fin.castLE h i) (Fin.castLE h j)) hxy + simpa using hh + +lemma norm_pad {n m : ℕ} (h : n ≤ m) (x : Mat A n) : ‖pad h x‖ = ‖x‖ := + NonUnitalStarAlgHom.norm_map (padHom h) (pad_injective h) x + +lemma pad_self (n : ℕ) (x : Mat A n) : pad le_rfl x = x := by + ext i j + simp [pad_entry] + +lemma pad_pad {n m k : ℕ} (h : n ≤ m) (h' : m ≤ k) (x : Mat A n) : + pad h' (pad h x) = pad (h.trans h') x := by + ext i j + by_cases hi : i.val < n <;> by_cases hj : j.val < n + · have hi' : i.val < m := lt_of_lt_of_le hi h + have hj' : j.val < m := lt_of_lt_of_le hj h + simp [pad_entry, hi, hj, hi', hj'] + · by_cases hi' : i.val < m <;> by_cases hj' : j.val < m <;> simp [pad_entry, hi, hj, hi', hj'] + · by_cases hi' : i.val < m <;> by_cases hj' : j.val < m <;> simp [pad_entry, hi, hi', hj'] + · by_cases hi' : i.val < m <;> by_cases hj' : j.val < m <;> simp [pad_entry, hi, hi', hj'] + +instance pad_directedSystem : DirectedSystem (Mat A) (fun _ _ h => padHom h) where + map_self := fun {_} x => pad_self _ x + map_map := fun {_ _ _} h h' x => pad_pad h h' x + +abbrev Algebraic (A : Type*) [NonUnitalCStarAlgebra A] := + DirectLimit (Mat A) (fun _ _ h => padHom h) + +local instance matLinear (n m : ℕ) : + LinearMapClass (Mat A n →⋆ₙₐ[ℂ] Mat A m) ℂ (Mat A n) (Mat A m) where + map_add f x y := f.map_add x y + map_smulₛₗ f c x := f.map_smul c x + +instance : Module ℂ (Algebraic A) := DirectLimit.instModule + +instance : Norm (Algebraic A) where + norm := DirectLimit.lift _ (fun _ x => ‖x‖) (fun _ _ h x => (norm_pad h x).symm) + +@[simp] lemma norm_mk (n : ℕ) (x : Mat A n) : + ‖(⟦⟨n,x⟩⟧ : Algebraic A)‖ = ‖x‖ := rfl + +lemma normedCore : NormedSpace.Core ℂ (Algebraic A) where + norm_nonneg := DirectLimit.induction _ fun n x => norm_nonneg x + norm_smul c := DirectLimit.induction _ fun n x => by + rw [DirectLimit.smul_def, norm_mk, norm_mk, norm_smul] + norm_triangle := DirectLimit.induction₂ _ fun n x y => by + rw [DirectLimit.add_def, norm_mk, norm_mk, norm_mk] + exact norm_add_le x y + norm_eq_zero_iff := DirectLimit.induction _ fun n x => by + rw [norm_mk, norm_eq_zero] + constructor + · rintro rfl + exact (DirectLimit.zero_def (f := fun _ _ h => padHom (A := A) h) n).symm + · intro h + apply pad_injective (le_rfl : n ≤ n) + have hi := DirectLimit.mk_injective (fun _ _ h => padHom (A := A) h) (fun _ _ h => pad_injective h) n + exact congrArg (pad le_rfl) (hi (h.trans (DirectLimit.zero_def (f := fun _ _ h => padHom (A := A) h) n))) + +instance : NormedAddCommGroup (Algebraic A) := .ofCore (𝕜 := ℂ) (normedCore (A := A)) +instance : NormedSpace ℂ (Algebraic A) := .ofCore (normedCore (A := A)) +instance : NonUnitalNormedRing (Algebraic A) where + dist_eq _ _ := rfl + norm_mul_le := DirectLimit.induction₂ _ fun n x y => by + rw [DirectLimit.mul_def, norm_mk, norm_mk, norm_mk] + exact norm_mul_le x y +instance : CStarRing (Algebraic A) where + norm_mul_self_le := DirectLimit.induction _ fun n x => by + rw [DirectLimit.star_def, DirectLimit.mul_def, norm_mk, norm_mk] + exact CStarRing.norm_mul_self_le x + +def cornerAlg (n : ℕ) : Mat A n →⋆ₙₐ[ℂ] Algebraic A where + __ := DirectLimit.NonUnitalAlgebra.of (Mat A) (fun _ _ h => padHom h) n + map_star' _ := rfl + +@[simp] lemma cornerAlg_apply (n : ℕ) (x : Mat A n) : + cornerAlg n x = (⟦⟨n,x⟩⟧ : Algebraic A) := rfl + +lemma cornerAlg_isometry (n : ℕ) : Isometry (cornerAlg (A := A) n) := + AddMonoidHomClass.isometry_of_norm (cornerAlg n) (fun _ => rfl) + +abbrev Stabilization (A : Type*) [NonUnitalCStarAlgebra A] := UniformSpace.Completion (Algebraic A) + +local instance algebraicTopology : TopologicalSpace (Algebraic A) := + (inferInstance : PseudoMetricSpace (Algebraic A)).toUniformSpace.toTopologicalSpace + +open UniformSpace +open UniformSpace.Completion + +instance : Mul (Stabilization A) := + ⟨Function.curry <| (isDenseInducing_coe.prodMap isDenseInducing_coe).extend + ((↑) ∘ Function.uncurry (· * · : Algebraic A → Algebraic A → Algebraic A))⟩ + +@[simp, norm_cast] lemma coe_mul_stable (x y : Algebraic A) : + ((x*y : Algebraic A) : Stabilization A) = (x : Stabilization A) * (y : Stabilization A) := + ((isDenseInducing_coe.prodMap isDenseInducing_coe).extend_eq + ((continuous_coe _).comp continuous_mul) (x,y)).symm + +instance : ContinuousMul (Stabilization A) where + continuous_mul := by + let m := (AddMonoidHom.mul : Algebraic A →+ Algebraic A →+ Algebraic A).compr₂ toCompl + have hh : Continuous fun p : Algebraic A × Algebraic A => m p.1 p.2 := + (continuous_coe _).comp continuous_mul + have di : IsDenseInducing (toCompl : Algebraic A → Stabilization A) := isDenseInducing_coe + exact di.extend_Z_bilin di hh + +instance : NonUnitalRing (Stabilization A) where + __ : AddCommGroup (Stabilization A) := inferInstance + zero_mul x := Completion.induction_on x (isClosed_eq (by fun_prop) continuous_const) + fun x => by rw [← coe_zero, ← coe_mul_stable, zero_mul] + mul_zero x := Completion.induction_on x (isClosed_eq (by fun_prop) continuous_const) + fun x => by rw [← coe_zero, ← coe_mul_stable, mul_zero] + mul_assoc x y z := Completion.induction_on₃ x y z + (isClosed_eq (by fun_prop) (by fun_prop)) fun x y z => by + rw [← coe_mul_stable, ← coe_mul_stable, ← coe_mul_stable, ← coe_mul_stable, mul_assoc] + left_distrib x y z := Completion.induction_on₃ x y z + (isClosed_eq (by fun_prop) (by fun_prop)) fun x y z => by + rw [← coe_add, ← coe_mul_stable, ← coe_mul_stable, ← coe_mul_stable, ← coe_add, mul_add] + right_distrib x y z := Completion.induction_on₃ x y z + (isClosed_eq (by fun_prop) (by fun_prop)) fun x y z => by + rw [← coe_add, ← coe_mul_stable, ← coe_mul_stable, ← coe_mul_stable, ← coe_add, add_mul] + +instance : NonUnitalNormedRing (Stabilization A) where + dist_eq := dist_eq_norm_neg_add + norm_mul_le x y := Completion.induction_on₂ x y + (isClosed_le (by fun_prop) (by fun_prop)) fun x y => by + simpa only [← coe_mul_stable, norm_coe] using norm_mul_le x y + +instance : Star (Stabilization A) := ⟨Completion.map (star : Algebraic A → Algebraic A)⟩ + +@[simp, norm_cast] lemma coe_star_stable (x : Algebraic A) : + ((star x : Algebraic A) : Stabilization A) = star (x : Stabilization A) := + (Completion.map_coe star_isometry.uniformContinuous x).symm + +instance : ContinuousStar (Stabilization A) where + continuous_star := Completion.continuous_map + +instance : StarRing (Stabilization A) where + star_involutive x := Completion.induction_on x + (isClosed_eq (by fun_prop) continuous_id) fun x => by + rw [← coe_star_stable, ← coe_star_stable, star_star] + star_add x y := Completion.induction_on₂ x y + (isClosed_eq (by fun_prop) (by fun_prop)) fun x y => by + rw [← coe_add, ← coe_star_stable, ← coe_star_stable, ← coe_star_stable, ← coe_add, star_add] + star_mul x y := Completion.induction_on₂ x y + (isClosed_eq (by fun_prop) (by fun_prop)) fun x y => by + rw [← coe_mul_stable, ← coe_star_stable, ← coe_star_stable, ← coe_star_stable, + ← coe_mul_stable, star_mul] + +instance : CStarRing (Stabilization A) where + norm_mul_self_le x := Completion.induction_on x + (isClosed_le (by fun_prop) (by fun_prop)) fun x => by + simpa only [← coe_star_stable, ← coe_mul_stable, norm_coe] using CStarRing.norm_mul_self_le x + +instance : IsScalarTower ℂ (Stabilization A) (Stabilization A) where + smul_assoc c x y := by + change (c • x) * y = c • (x*y) + refine Completion.induction_on₂ x y ?_ ?_ + · exact isClosed_eq ((continuous_fst.const_smul c).mul continuous_snd) + ((continuous_fst.mul continuous_snd).const_smul c) + · intro x y + rw [← coe_smul, ← coe_mul_stable, ← coe_mul_stable, ← coe_smul, smul_mul_assoc] + +instance : SMulCommClass ℂ (Stabilization A) (Stabilization A) where + smul_comm c x y := by + change c • (x*y) = x * (c • y) + refine Completion.induction_on₂ x y ?_ ?_ + · exact isClosed_eq ((continuous_fst.mul continuous_snd).const_smul c) + (continuous_fst.mul (continuous_snd.const_smul c)) + · intro x y + rw [← coe_mul_stable, ← coe_smul, ← coe_smul, ← coe_mul_stable, mul_smul_comm] + +instance : StarModule ℂ (Stabilization A) where + star_smul c x := by + refine Completion.induction_on x ?_ ?_ + · exact isClosed_eq (continuous_star.comp (continuous_const_smul c)) + (continuous_star.const_smul (star c)) + · intro x + rw [← coe_smul, ← coe_star_stable, ← coe_star_stable, ← coe_smul, star_smul] + +@[instance_reducible] def stabilizationCStarAlgebra : NonUnitalCStarAlgebra (Stabilization A) where + +def corner (n : ℕ) : Mat A n →⋆ₙₐ[ℂ] Stabilization A where + toFun x := (cornerAlg n x : Stabilization A) + map_zero' := by rw [map_zero, coe_zero] + map_add' x y := by simp [map_add, coe_add] + map_mul' x y := by simp [map_mul] + map_smul' c x := by simp [map_smul, coe_smul] + map_star' x := by simp [map_star] + +@[simp] lemma corner_apply (n : ℕ) (x : Mat A n) : + corner n x = (cornerAlg n x : Stabilization A) := rfl + +lemma norm_corner (n : ℕ) (x : Mat A n) : ‖corner n x‖ = ‖x‖ := by + rw [corner_apply, norm_coe, cornerAlg_apply, norm_mk] + +lemma corner_isometry (n : ℕ) : Isometry (corner (A := A) n) := + AddMonoidHomClass.isometry_of_norm (corner n) (norm_corner n) + +lemma corner_pad {n m : ℕ} (h : n ≤ m) (x : Mat A n) : + corner m (pad h x) = corner n x := by + change ((⟦⟨m,padHom h x⟩⟧ : Algebraic A) : Stabilization A) = + ((⟦⟨n,x⟩⟧ : Algebraic A) : Stabilization A) + rw [DirectLimit.mk_apply] + +end MainGap.Stable + +end + +end OAI diff --git a/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Ultrafilter.lean b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Ultrafilter.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5ce3b465722cb11973830b2bdc610eafbdf27da --- /dev/null +++ b/lean/OAI/Analysis/CStarAlgebra/PureInfiniteness/Ultrafilter.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Representation +import OAI.Analysis.CStarAlgebra.PureInfiniteness.Defect + +namespace OAI + +noncomputable section +open Filter +open scoped Topology CStarAlgebra ComplexOrder InnerProductSpace + +namespace MainGap +variable (A : Type*) +abbrev FourIndex := ℕ × Finset A + +def fourEta (i : FourIndex A) : ℝ := 1 / ((i.1 : ℝ)+1) + +lemma fourEta_pos (i : FourIndex A) : 0 < fourEta A i := by + unfold fourEta + positivity + +lemma fourEta_tendsto : Tendsto (fourEta A) atTop (𝓝 0) := by + have h : Tendsto (fun n : ℕ => 1 / ((n:ℝ)+1)) atTop (𝓝 0) := by + simpa using (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) + have hf : Tendsto (fun i : FourIndex A => i.1) atTop atTop := by + apply tendsto_atTop.mpr + intro n + filter_upwards [eventually_ge_atTop (n, (∅ : Finset A))] with i hi + exact hi.1 + exact h.comp hf + +lemma fourIndex_eventually_mem (w : A) : ∀ᶠ i : FourIndex A in atTop, w ∈ i.2 := by + classical + filter_upwards [eventually_ge_atTop ((0:ℕ), ({w} : Finset A))] with i hi + exact hi.2 (Finset.mem_singleton_self w) + +noncomputable def fourUltra : Ultrafilter (FourIndex A) := by + classical + exact Ultrafilter.of atTop + +lemma fourUltra_le : (fourUltra A : Filter (FourIndex A)) ≤ atTop := by + classical + exact Ultrafilter.of_le atTop + +lemma fourEta_ultra : Tendsto (fourEta A) (fourUltra A : Filter (FourIndex A)) (𝓝 0) := + (fourEta_tendsto A).mono_left (fourUltra_le A) +end MainGap + +namespace MainGap +variable {A : Type*} [CStarAlgebra A] +local instance ultrafilterPartialOrder : PartialOrder A := CStarAlgebra.spectralOrder A +local instance ultrafilterStarOrderedRing : StarOrderedRing A := CStarAlgebra.spectralOrderedRing A + +lemma cut_zero_of_le {d : A} (hd : 0 ≤ d) {h : ℝ} (hh : 0 ≤ h) + (hle : d ≤ h • (1:A)) : cut d h = 0 := by + have hdsa : IsSelfAdjoint d := .of_nonneg hd + have hle' : cfc (fun t : ℝ => t) d ≤ cfc (fun _ : ℝ => h) d := by + rw [cfc_id' ℝ d hdsa, cfc_const h d hdsa, Algebra.algebraMap_eq_smul_one] + exact hle + have hs := (cfc_le_iff _ _ d continuousOn_id continuousOn_const hdsa).mp hle' + rw [cut_eq_cfc d hh, ← cfc_zero d (R := ℝ)] + apply cfc_congr + intro t ht + exact max_eq_right (sub_nonpos.mpr (hs t ht)) + +lemma le_of_cut_zero {d : A} (hd : 0 ≤ d) {h : ℝ} (hh : 0 ≤ h) + (hz : cut d h = 0) : d ≤ h • (1:A) := by + have hn := norm_sub_cut_le hd hh + rw [hz, sub_zero] at hn + simpa only [Algebra.algebraMap_eq_smul_one] using + (CStarAlgebra.norm_le_iff_le_algebraMap d hh hd).mp hn + +end MainGap + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/HighProjection.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/HighProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..e647146fb5b195bc5f285a9d268ba7c728d32fa1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/HighProjection.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.FirstFiber + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb + +section +variable {A B ι : Type*} [MeasurableSpace A] [MeasurableSpace B] + {μ : Measure A} {ν : Measure B} [SigmaFinite μ] [SigmaFinite ν] + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + +omit [MeasurableSpace B] [SigmaFinite μ] in +include hv ho in +lemma fiberContract_lowProjection (s : Finset ι) (f : B × A → ℂ) (a : ι) (y : B) : + fiberContract (μ := μ) (v a) (lowProjection (μ := μ) v s f) y = + if a ∈ s then fiberContract (μ := μ) (v a) f y else 0 := by + classical + dsimp only [lowProjection, fiberContract] + rw [show (fun x => star (v a x) * ∑ i ∈ s, + (∫ z, star (v i z) * f (y,z) ∂μ) * v i x) = + (fun x => ∑ i ∈ s, (∫ z, star (v i z) * f (y,z) ∂μ) * (star (v a x) * v i x)) from by + funext x + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring] + rw [integral_finsetSum s (fun i _ => (integrable_star_mul (hv a) (hv i)).const_mul _)] + simp only [integral_const_mul, ho, mul_ite, mul_one, mul_zero] + rw [Finset.sum_ite_eq] + +noncomputable def highProjection (s : Finset ι) (f : B × A → ℂ) : B × A → ℂ := + f - lowProjection (μ := μ) v s f + +include hv in +lemma highProjection_memLp (s : Finset ι) {f : B × A → ℂ} + (hf : MemLp f 2 (ν.prod μ)) : + MemLp (highProjection (μ := μ) v s f) 2 (ν.prod μ) := by + have hp : MemLp (lowProjection (μ := μ) v s f) 2 (ν.prod μ) := + lowProjection_memLp v hv s hf + change MemLp (f - lowProjection (μ := μ) v s f) 2 (ν.prod μ) + exact hf.sub hp + +include hv ho in +lemma fiberContract_highProjection (s : Finset ι) {f : B × A → ℂ} + (hf : MemLp f 2 (ν.prod μ)) (a : ι) : + fiberContract (μ := μ) (v a) (highProjection (μ := μ) v s f) =ᵐ[ν] + fun y => if a ∈ s then 0 else fiberContract (μ := μ) (v a) f y := by + classical + filter_upwards [memLp_fiber_ae hf] with y hy + have hp : MemLp (fun x => lowProjection (μ := μ) v s f (y,x)) 2 μ := + orbital_sum_memLp v hv s (fun i => fiberContract (μ := μ) (v i) f y) + change (∫ x, star (v a x) * (f (y,x) - lowProjection (μ := μ) v s f (y,x)) ∂μ) = _ + simp only [mul_sub] + rw [integral_sub (integrable_star_mul (hv a) hy) (integrable_star_mul (hv a) hp)] + change fiberContract (μ := μ) (v a) f y - + fiberContract (μ := μ) (v a) (lowProjection (μ := μ) v s f) y = _ + rw [fiberContract_lowProjection v hv ho] + split_ifs <;> simp only [sub_self, sub_zero] + +include hv ho in +lemma fiberContract_finite_bessel (s : Finset ι) {f : B × A → ℂ} + (hf : MemLp f 2 (ν.prod μ)) : + ∑ i ∈ s, (∫ y, ‖fiberContract (μ := μ) (v i) f y‖^2 ∂ν) ≤ + ∫ z, ‖f z‖^2 ∂(ν.prod μ) := by + rw [← integral_finsetSum s (fun i _ => (fiberContract_memLp (hv i) hf).norm.integrable_sq)] + rw [integral_prod _ hf.norm.integrable_sq] + apply integral_mono_ae + (integrable_finsetSum s (fun i _ => (fiberContract_memLp (hv i) hf).norm.integrable_sq)) + hf.norm.integrable_sq.integral_prod_left + filter_upwards [memLp_fiber_ae hf] with y hy + have H := (orbital_orthonormal v hv ho).sum_inner_products_le (s := s) (hy.toLp _) + simpa only [inner_toLp_complex, norm_toLp_sq_complex, fiberContract] using H + +include hv ho in +lemma fiberContract_norm_summable {f : B × A → ℂ} (hf : MemLp f 2 (ν.prod μ)) : + Summable (fun i => ∫ y, ‖fiberContract (μ := μ) (v i) f y‖^2 ∂ν) := + summable_of_sum_le (fun _ => integral_nonneg fun _ => sq_nonneg _) + (fun s => fiberContract_finite_bessel v hv ho s hf) + +end + +noncomputable def firstUnfiber {A : Type*} {n : ℕ} (f : (Fin n → A) × A → ℂ) + (x : Fin (n+1) → A) : ℂ := f (Fin.tail x, x 0) + +lemma firstFiber_firstUnfiber {A : Type*} {n : ℕ} (f : (Fin n → A) × A → ℂ) : + firstFiber (firstUnfiber f) = f := by + funext z + simp only [firstFiber, firstUnfiber, Fin.tail_cons, Fin.cons_zero] + +lemma firstUnfiber_memLp {A : Type*} [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] + {n : ℕ} {f : (Fin n → A) × A → ℂ} + (hf : MemLp f 2 ((Measure.pi fun _ : Fin n => μ).prod μ)) : + MemLp (firstUnfiber f) 2 (Measure.pi fun _ => μ) := by + let e := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) => A) 0).trans + (MeasurableEquiv.prodComm : A × (Fin n → A) ≃ᵐ (Fin n → A) × A) + have he : MeasurePreserving e (Measure.pi fun _ => μ) + ((Measure.pi fun _ : Fin n => μ).prod μ) := + (measurePreserving_piFinSuccAbove (fun _ => μ) 0).trans Measure.measurePreserving_swap + have heq : ∀ x : Fin (n+1) → A, e x = (Fin.tail x, x 0) := by + intro x + rfl + change MemLp (fun x : Fin (n+1) → A => f (Fin.tail x, x 0)) 2 (Measure.pi fun _ => μ) + simpa only [Function.comp_def, heq] using hf.comp_measurePreserving he + +lemma firstUnfiber_norm_sq {A : Type*} [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] + {n : ℕ} (f : (Fin n → A) × A → ℂ) : + (∫ x, ‖firstUnfiber f x‖^2 ∂(Measure.pi fun _ => μ)) = + ∫ z, ‖f z‖^2 ∂((Measure.pi fun _ : Fin n => μ).prod μ) := by + let e := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) => A) 0).trans + (MeasurableEquiv.prodComm : A × (Fin n → A) ≃ᵐ (Fin n → A) × A) + have he : MeasurePreserving e (Measure.pi fun _ => μ) + ((Measure.pi fun _ : Fin n => μ).prod μ) := + (measurePreserving_piFinSuccAbove (fun _ => μ) 0).trans Measure.measurePreserving_swap + exact he.integral_comp' (fun z => ‖f z‖^2) + +lemma scalarCoefficient_congr {A ι : Type*} [MeasurableSpace A] {μ : Measure A} + {n : ℕ} {f g : (Fin n → A) → ℂ} (he : f =ᵐ[Measure.pi fun _ => μ] g) + (v : ι → A → ℂ) (b : Fin n → ι) : + scalarCoefficient (μ := μ) f v b = scalarCoefficient (μ := μ) g v b := by + apply integral_congr_ae + filter_upwards [he] with x hx + rw [hx] + +variable {A ι : Type*} [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + +include hv ho in +lemma scalarCoefficient_highFirst {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) (s : Finset ι) (b : Fin (n+1) → ι) : + scalarCoefficient (μ := μ) (firstUnfiber (highProjection (μ := μ) v s (firstFiber f))) v b = + if b 0 ∈ s then 0 else scalarCoefficient (μ := μ) f v b := by + classical + have hff := firstFiber_memLp hf + have hh := highProjection_memLp v hv s hff + have hu := firstUnfiber_memLp hh + have hb : Fin.cons (b 0) (Fin.tail b) = b := by + ext i + exact Fin.cases rfl (fun j => rfl) i + rw [← hb, scalarCoefficient_contract _ hu v hv, scalarCoefficient_contract f hf v hv] + change scalarCoefficient (μ := μ) + (fiberContract (μ := μ) (v (b 0)) (firstFiber (firstUnfiber + (highProjection (μ := μ) v s (firstFiber f))))) v (Fin.tail b) = _ + rw [firstFiber_firstUnfiber] + rw [scalarCoefficient_congr (fiberContract_highProjection v hv ho s hff (b 0))] + by_cases hs : b 0 ∈ s + · simp only [Fin.cons_zero, hs, ite_true, scalarCoefficient, mul_zero, integral_zero] + · simp only [Fin.cons_zero, hs, ite_false] + rfl + +include hv ho in +lemma highProjection_norm_spectrum [Countable ι] (hc : CompleteOrbitals μ v) + {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) (s : Finset ι) : + (∫ z, ‖highProjection (μ := μ) v s (firstFiber f) z‖^2 + ∂((Measure.pi fun _ : Fin n => μ).prod μ)) = + ∑' b, if b 0 ∈ s then 0 else ‖scalarCoefficient (μ := μ) f v b‖^2 := by + rw [← firstUnfiber_norm_sq] + have hh := highProjection_memLp v hv s (firstFiber_memLp hf) + rw [← scalarCoefficient_parseval _ (firstUnfiber_memLp hh) v hv ho hc] + apply tsum_congr + intro b + rw [scalarCoefficient_highFirst v hv ho hf s b] + split_ifs <;> norm_num + +end Coulomb +open MeasureTheory Set Filter +open scoped ENNReal NNReal + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/IntegrableIntegralAeTendsto.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/IntegrableIntegralAeTendsto.lean new file mode 100644 index 0000000000000000000000000000000000000000..56f0184a81137ad3ac7b24c7506bbea765a107c9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/IntegrableIntegralAeTendsto.lean @@ -0,0 +1,199 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Translate + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma integrable_and_integral_le_of_ae_tendsto {A : Type*} [MeasurableSpace A] + {μ : Measure A} {F : ℕ → A → ℝ} {f : A → ℝ} {u : ℕ → ℝ} {C : ℝ} + (hF : ∀ n, Integrable (F n) μ) (hFn : ∀ n x, 0 ≤ F n x) + (hfn : ∀ x, 0 ≤ f x) + (ht : ∀ᵐ x ∂μ, Tendsto (fun n => F n x) atTop (𝓝 (f x))) + (hb : ∀ n, (∫ x, F n x ∂μ) ≤ u n) (hu : Tendsto u atTop (𝓝 C)) : + Integrable f μ ∧ (∫ x, f x ∂μ) ≤ C := by + have hmeas : AEStronglyMeasurable f μ := + aestronglyMeasurable_of_tendsto_ae _ (fun n => (hF n).1) ht + have hfat : (∫⁻ x, ENNReal.ofReal (f x) ∂μ) ≤ ENNReal.ofReal C := by + calc + _ = ∫⁻ x, liminf (fun n => ENNReal.ofReal (F n x)) atTop ∂μ := by + apply lintegral_congr_ae + filter_upwards [ht] with x hx + exact ((ENNReal.continuous_ofReal.tendsto _).comp hx).liminf_eq.symm + _ ≤ liminf (fun n => ∫⁻ x, ENNReal.ofReal (F n x) ∂μ) atTop := + lintegral_liminf_le' (fun n => (hF n).aemeasurable.ennreal_ofReal) + _ ≤ liminf (fun n => ENNReal.ofReal (u n)) atTop := by + apply liminf_le_liminf (hv := isBoundedUnder_of ⟨0, fun _ => bot_le⟩) + (hu := (isBoundedUnder_of ⟨⊤, fun _ => le_top⟩).isCoboundedUnder_ge) + exact Eventually.of_forall fun n => by + rw [← ofReal_integral_eq_lintegral_ofReal (hF n) (Eventually.of_forall (hFn n))] + exact ENNReal.ofReal_le_ofReal (hb n) + _ = ENNReal.ofReal C := ((ENNReal.continuous_ofReal.tendsto _).comp hu).liminf_eq + have hf : Integrable f μ := by + refine ⟨hmeas, ?_⟩ + rw [hasFiniteIntegral_iff_norm] + simp_rw [Real.norm_eq_abs, abs_of_nonneg (hfn _)] + exact hfat.trans_lt ENNReal.ofReal_lt_top + refine ⟨hf, ?_⟩ + have hC : 0 ≤ C := ge_of_tendsto' hu fun n => (integral_nonneg (hFn n)).trans (hb n) + apply (ENNReal.ofReal_le_ofReal_iff hC).mp + rwa [ofReal_integral_eq_lintegral_ofReal hf (Eventually.of_forall hfn)] + +lemma pi_exhaustion {A : Type*} {s : ℕ → Set A} (hs : Monotone s) + (hU : (⋃ k, s k) = univ) (n : ℕ) : + (⋃ k, (univ.pi fun _ : Fin n => s k)) = univ := by + ext z + simp only [mem_iUnion, mem_univ_pi, mem_univ, iff_true] + have hx (i : Fin n) : ∃ k, z i ∈ s k := by + have hi : z i ∈ ⋃ k, s k := by rw [hU]; trivial + simpa only [mem_iUnion] using hi + choose k hk using hx + refine ⟨Finset.univ.sup k, fun i => hs (Finset.le_sup (f := k) (Finset.mem_univ i)) (hk i)⟩ + +lemma density_power_exhaustion {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) {s : ℕ → Set A} + (hs : ∀ k, MeasurableSet (s k)) (hmono : Monotone s) (hU : (⋃ k, s k) = univ) + {p : ℝ} (hp : 0 < p) {u : ℕ → ℝ} {C : ℝ} + (hi : ∀ k, Integrable (fun x => (firstParticleDensity (μ := μ.restrict (s k)) f x)^p) + (μ.restrict (s k))) + (hb : ∀ k, (∫ x, (firstParticleDensity (μ := μ.restrict (s k)) f x)^p ∂(μ.restrict (s k))) ≤ u k) + (hu : Tendsto u atTop (𝓝 C)) : + Integrable (fun x => (firstParticleDensity (μ := μ) f x)^p) μ ∧ + (∫ x, (firstParticleDensity (μ := μ) f x)^p ∂μ) ≤ C := by + let F (k : ℕ) : A → ℝ := (s k).indicator + (fun x => (firstParticleDensity (μ := μ.restrict (s k)) f x)^p) + have hdn {ν : Measure A} (x : A) : 0 ≤ firstParticleDensity (μ := ν) f x := + mul_nonneg (by positivity) (integral_nonneg (fun _ => sq_nonneg _)) + have hn (k) (x) : 0 ≤ F k x := + indicator_nonneg (fun _ _ => Real.rpow_nonneg (hdn _) p) x + apply integrable_and_integral_le_of_ae_tendsto + (F := F) (u := u) (fun k => (integrable_indicator_iff (hs k)).mpr (hi k)) hn + (fun x => Real.rpow_nonneg (hdn x) p) + ?_ (fun k => by simpa only [F, integral_indicator (hs k)] using hb k) hu + have hslice := (firstFiber_memLp hf).norm.integrable_sq.prod_left_ae + filter_upwards [hslice] with x hx + have hset : (⋃ k, (univ.pi fun _ : Fin n => s k)) = univ := pi_exhaustion hmono hU n + have hlim := tendsto_setIntegral_of_monotone + (fun k => MeasurableSet.univ_pi (fun _ : Fin n => hs k)) + (fun k l hkl z hz i _ => hmono hkl (hz i (mem_univ i))) + (f := fun y => ‖firstFiber f (y,x)‖^2) (μ := Measure.pi fun _ : Fin n => μ) + (by simpa only [hset, integrableOn_univ] using hx) + simp only [hset, Measure.restrict_univ, Measure.restrict_pi_pi] at hlim + have hd : Tendsto (fun k => firstParticleDensity (μ := μ.restrict (s k)) f x) atTop + (𝓝 (firstParticleDensity (μ := μ) f x)) := hlim.const_mul _ + have hpw := hd.rpow_const (Or.inr hp.le) + have hex : ∃ k, x ∈ s k := by + have hi : x ∈ ⋃ k, s k := by rw [hU]; trivial + simpa only [mem_iUnion] using hi + obtain ⟨k,hk⟩ := hex + apply hpw.congr' + filter_upwards [eventually_ge_atTop k] with l hl + simp only [F, indicator_of_mem (hmono hl hk)] + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma spinCubeEquiv_full_measurePreserving (n : ℕ) : + MeasurePreserving (spinCubeEquiv n) (Measure.pi fun _ : Fin n => spinSpaceMeasure) + (Measure.count.prod volume) := by + have h1 := measurePreserving_arrowProdEquivProdArrow (Fin 2) (Fin 3 → ℝ) (Fin n) + (fun _ => Measure.count) (fun _ => volume) + rw [measure_pi_count] at h1 + have h2 := (MeasurePreserving.id (Measure.count : Measure (Spins n))).prod + (measurePreserving_const_uncurry (I := Fin n) (J := Fin 3) (volume : Measure ℝ)) + exact h2.comp h1 + +lemma H1Vector.spinSpace_memLp {n : ℕ} (ψ : H1Vector n) : + MemLp (fun sx : Spins n × ((Fin n × Fin 3) → ℝ) => + ψ.value sx.1 (WithLp.toLp 2 sx.2)) 2 (Measure.count.prod volume) := by + have hi (s : Spins n) : MemLp (fun t : Spins n => if t = s then (1:ℂ) else 0) 2 Measure.count := by + apply MemLp.of_bound (by fun_prop) 1 + exact ae_of_all _ (fun t => by split_ifs <;> norm_num) + have H := memLp_finsetSum Finset.univ (fun (s : Spins n) _ => tensorPair_memLp (hi s) + ((ψ.value_L2 s).comp_measurePreserving (PiLp.volume_preserving_toLp _))) + convert H using 1 + funext sx + simp only [ite_mul, one_mul, zero_mul] + simp + +lemma H1Vector.cubeState_full_memLp {n : ℕ} (ψ : H1Vector n) : + MemLp (cubeState ψ) 2 (Measure.pi fun _ : Fin n => spinSpaceMeasure) := + ψ.spinSpace_memLp.comp_measurePreserving (spinCubeEquiv_full_measurePreserving n) + +lemma cubeState_full_mass {n : ℕ} (ψ : H1Vector n) : + (∫ z, ‖cubeState ψ z‖^2 ∂(Measure.pi fun _ : Fin n => spinSpaceMeasure)) = mass ψ := by + change (∫ z, ‖ψ.value ((spinCubeEquiv n) z).1 (WithLp.toLp 2 ((spinCubeEquiv n) z).2)‖^2 + ∂(Measure.pi fun _ : Fin n => spinSpaceMeasure)) = mass ψ + rw [(spinCubeEquiv_full_measurePreserving n).integral_comp' + (fun sx => ‖ψ.value sx.1 (WithLp.toLp 2 sx.2)‖^2)] + rw [integral_prod _ ψ.spinSpace_memLp.norm.integrable_sq, integral_count] + unfold mass + apply Finset.sum_congr rfl + intro s _ + exact (show MeasurePreserving (MeasurableEquiv.toLp 2 ((Fin n × Fin 3) → ℝ)) volume volume from + PiLp.volume_preserving_toLp _).integral_comp' (fun x => ‖ψ.value s x‖^2) + +lemma centeredSpinCube_monotone : Monotone centeredSpinCube := by + intro R S hRS x hx + simp only [centeredSpinCube, mem_prod, mem_univ, true_and, mem_univ_pi, mem_Ioc] at * + intro i + obtain ⟨h1,h2⟩ := hx i + constructor <;> linarith + +lemma centeredSpinCube_exhaustion : (⋃ k : ℕ, centeredSpinCube (k+1)) = univ := by + ext x + simp only [mem_iUnion, mem_univ, iff_true] + obtain ⟨k,hk⟩ := exists_nat_gt (‖x.2‖ : ℝ) + refine ⟨k, ?_⟩ + simp only [centeredSpinCube, mem_prod, mem_univ, true_and, mem_univ_pi, mem_Ioc] + intro i + have hi : |x.2 i| ≤ ‖x.2‖ := by simpa only [Real.norm_eq_abs] using norm_le_pi_norm x.2 i + have h := abs_le.mp hi + constructor <;> linarith + +theorem global_spin_density_power_bound {n : ℕ} (ψ : H1Vector (n+1)) + (hψ : Antisymmetric ψ) (hm : mass ψ ≤ 1) : + Integrable (fun x => (firstParticleDensity (μ := spinSpaceMeasure) (cubeState ψ) x)^(5/3:ℝ)) + spinSpaceMeasure ∧ + (∫ x, (firstParticleDensity (μ := spinSpaceMeasure) (cubeState ψ) x)^(5/3:ℝ) + ∂spinSpaceMeasure) ≤ (8192/(3*Real.pi^2))*kinetic ψ := by + apply density_power_exhaustion ψ.cubeState_full_memLp + (s := fun k : ℕ => centeredSpinCube (k+1)) (fun k => centeredSpinCube_measurable _) + (fun k l h => centeredSpinCube_monotone (by exact_mod_cast Nat.add_le_add_right h 1)) + centeredSpinCube_exhaustion (by norm_num : (0:ℝ) < 5/3) + (u := fun k : ℕ => (64/(k+1:ℝ)^2)*((n+1:ℕ):ℝ)+(8192/(3*Real.pi^2))*kinetic ψ) + (fun k => (centered_density_power_bound ψ hψ hm (by positivity : (0:ℝ) (centered_density_power_bound ψ hψ hm (by positivity : (0:ℝ) (k:ℝ)+1) atTop atTop := + Filter.tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop + have hi := ((tendsto_inv_atTop_zero (𝕜 := ℝ)).comp ((tendsto_pow_atTop (α := ℝ) (by norm_num : (2 : ℕ) ≠ 0)).comp ht)).const_mul 64 + convert (hi.mul_const ((n+1:ℕ):ℝ)).add_const ((8192/(3*Real.pi^2))*kinetic ψ) using 1 <;> + simp [Function.comp_apply, div_eq_mul_inv] + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/IntegrableTsumSummableNormIntegral.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/IntegrableTsumSummableNormIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbdd73beb0a4fd5b52285686e6235b6cd0c9e616 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/IntegrableTsumSummableNormIntegral.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.L2MeasureInclusion + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +variable {Y ι : Type*} [MeasurableSpace Y] [Countable ι] + +lemma integrable_tsum_of_summable_norm_integral {ν : Measure Y} {F : ι → Y → ℝ} + (hF : ∀ i, Integrable (F i) ν) (hs : Summable (fun i => ∫ y, ‖F i y‖ ∂ν)) : + Integrable (fun y => ∑' i, F i y) ν ∧ ∀ᵐ y ∂ν, Summable (fun i => F i y) := by + let f : ι → Lp ℝ 1 ν := fun i => (hF i).toL1 (F i) + have hn (i : ι) : ‖f i‖ = ∫ y, ‖F i y‖ ∂ν := by + rw [Integrable.norm_toL1_eq_lintegral_norm] + exact (integral_eq_lintegral_of_nonneg_ae (Filter.Eventually.of_forall (fun _ => norm_nonneg _)) + (hF i).norm.aestronglyMeasurable).symm + have he : ∑' i, ‖f i‖ₑ ≠ ⊤ := by + apply tsum_enorm_ne_top_iff_summable_norm.mpr + simpa only [hn] using hs + have ha : ∀ᵐ y ∂ν, ∀ i, f i y = F i y := ae_all_iff.mpr (fun i => (hF i).coeFn_toL1) + have hb := Lp.hasSum_coeFn_tsum he + have hc : (fun y => ∑' i, F i y) =ᵐ[ν] (∑' i, f i : Lp ℝ 1 ν) := by + filter_upwards [ha, hb] with y hy hz + simpa only [hy] using hz.tsum_eq + refine ⟨(L1.integrable_coeFn (∑' i, f i)).congr hc.symm, ?_⟩ + filter_upwards [ha, hb] with y hy hz + simpa only [hy] using hz.summable + +lemma l2_weighted_density_integrable {ν : Measure Y} (u : ι → Lp ℂ 2 ν) (w : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hs : Summable (fun i => w i * ‖u i‖^2)) : + Integrable (fun y => ∑' i, w i * ‖u i y‖^2) ν ∧ + ∀ᵐ y ∂ν, Summable (fun i => w i * ‖u i y‖^2) := by + apply integrable_tsum_of_summable_norm_integral + · intro i + exact ((Lp.memLp (u i)).integrable_norm_pow (by norm_num : (2:ℕ) ≠ 0)).const_mul _ + · simpa only [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hw _) (sq_nonneg _)), + integral_const_mul, ← l2_norm_sq] using hs + +lemma l2_weighted_density_hasSum {ν : Measure Y} (u : ι → Lp ℂ 2 ν) (w : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) {s : ℝ} (hs : HasSum (fun i => w i * ‖u i‖^2) s) : + (∫ y, ∑' i, w i * ‖u i y‖^2 ∂ν) = s := by + have hi (i : ι) : Integrable (fun y => w i * ‖u i y‖^2) ν := + ((Lp.memLp (u i)).integrable_norm_pow (by norm_num : (2:ℕ) ≠ 0)).const_mul (w i) + have hn : Summable (fun i => ∫ y, ‖w i * ‖u i y‖^2‖ ∂ν) := by + simpa only [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hw _) (sq_nonneg _)), + integral_const_mul, ← l2_norm_sq] using hs.summable + have h := hasSum_integral_of_summable_integral_norm hi hn + simp only [integral_const_mul, ← l2_norm_sq] at h + exact h.unique hs +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/JoinSpins.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/JoinSpins.lean new file mode 100644 index 0000000000000000000000000000000000000000..75add5d82c2ba3eca078d8f00ab55a9ae635ff2e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/JoinSpins.lean @@ -0,0 +1,227 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.BlockIndex + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +namespace Coulomb +def joinSpins (m k : ℕ) : Spins m × Spins k ≃ Spins (m+k) where + toFun := fun s => Fin.addCases s.1 s.2 + invFun := fun s => (s ∘ Fin.castAdd k, s ∘ Fin.natAdd m) + left_inv := by + intro s + ext i <;> simp + right_inv := by + intro s + funext i + refine Fin.addCases ?_ ?_ i <;> intro j <;> simp [Function.comp_def] + +lemma joinSpins_left (m k : ℕ) (s : Spins m) (t : Spins k) : + (joinSpins m k (s,t)) ∘ Fin.castAdd k = s := by + funext i + simp [joinSpins, Function.comp_def] +lemma joinSpins_right (m k : ℕ) (s : Spins m) (t : Spins k) : + (joinSpins m k (s,t)) ∘ Fin.natAdd m = t := by + funext i + simp [joinSpins, Function.comp_def] + +lemma sum_joinSpins {m k : ℕ} (F : Spins (m+k) → ℝ) : + (∑ s, F s) = ∑ s : Spins m, ∑ t : Spins k, F (joinSpins m k (s,t)) := by + rw [← Equiv.sum_comp (joinSpins m k), Fintype.sum_prod_type] + +lemma sum_configurationBlocks {m k : ℕ} (F : Fin (m+k) × Fin 3 → ℝ) : + (∑ a, F a) = (∑ a : Fin m × Fin 3, F (Fin.castAdd k a.1,a.2)) + + (∑ a : Fin k × Fin 3, F (Fin.natAdd m a.1,a.2)) := by + simp only [Fintype.sum_prod_type] + exact Fin.sum_univ_add _ + +lemma tensorValue_square_integral {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins (m+k)) : + (∫ x, ‖tensorValue u v s x‖^2) = + (∫ x, ‖u.value (s ∘ Fin.castAdd k) x‖^2)* + (∫ y, ‖v.value (s ∘ Fin.natAdd m) y‖^2) := by + rw [← (joinConfiguration_measurePreserving m k).integral_comp' + (fun x => ‖tensorValue u v s x‖^2)] + change (∫ z : Configuration m × Configuration k, + ‖tensorValue u v s (joinConfiguration m k z)‖^2 ∂(volume.prod volume)) = _ + simp_rw [tensorValue_join, norm_mul, mul_pow] + exact integral_prod_mul (μ := volume) (ν := volume) + (fun x : Configuration m => ‖u.value (s ∘ Fin.castAdd k) x‖^2) + (fun y : Configuration k => ‖v.value (s ∘ Fin.natAdd m) y‖^2) + +lemma tensorGradient_square_integral_left {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins (m+k)) (a : Fin m × Fin 3) : + (∫ x, ‖tensorGradient u v s (Fin.castAdd k a.1,a.2) x‖^2) = + (∫ x, ‖u.gradient (s ∘ Fin.castAdd k) a x‖^2)* + (∫ y, ‖v.value (s ∘ Fin.natAdd m) y‖^2) := by + rw [← (joinConfiguration_measurePreserving m k).integral_comp' + (fun x => ‖tensorGradient u v s (Fin.castAdd k a.1,a.2) x‖^2)] + change (∫ z : Configuration m × Configuration k, + ‖tensorGradient u v s (Fin.castAdd k a.1,a.2) (joinConfiguration m k z)‖^2 + ∂(volume.prod volume)) = _ + simp_rw [tensorGradient_join_left, norm_mul, mul_pow] + exact integral_prod_mul (μ := volume) (ν := volume) + (fun x : Configuration m => ‖u.gradient (s ∘ Fin.castAdd k) a x‖^2) + (fun y : Configuration k => ‖v.value (s ∘ Fin.natAdd m) y‖^2) + +lemma tensorGradient_square_integral_right {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins (m+k)) (a : Fin k × Fin 3) : + (∫ x, ‖tensorGradient u v s (Fin.natAdd m a.1,a.2) x‖^2) = + (∫ x, ‖u.value (s ∘ Fin.castAdd k) x‖^2)* + (∫ y, ‖v.gradient (s ∘ Fin.natAdd m) a y‖^2) := by + rw [← (joinConfiguration_measurePreserving m k).integral_comp' + (fun x => ‖tensorGradient u v s (Fin.natAdd m a.1,a.2) x‖^2)] + change (∫ z : Configuration m × Configuration k, + ‖tensorGradient u v s (Fin.natAdd m a.1,a.2) (joinConfiguration m k z)‖^2 + ∂(volume.prod volume)) = _ + simp_rw [tensorGradient_join_right, norm_mul, mul_pow] + exact integral_prod_mul (μ := volume) (ν := volume) + (fun x : Configuration m => ‖u.value (s ∘ Fin.castAdd k) x‖^2) + (fun y : Configuration k => ‖v.gradient (s ∘ Fin.natAdd m) a y‖^2) + +lemma mass_tensor {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : + mass (u.tensor v) = mass u*mass v := by + change (∑ s, ∫ x, ‖tensorValue u v s x‖^2) = _ + simp_rw [tensorValue_square_integral] + rw [sum_joinSpins] + simp only [joinSpins_left, joinSpins_right, mass, Finset.sum_mul, Finset.mul_sum] + exact Finset.sum_comm + +lemma kinetic_tensor {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : + kinetic (u.tensor v) = kinetic u*mass v+mass u*kinetic v := by + change (1/2:ℝ)*(∑ s, ∑ a, ∫ x, ‖tensorGradient u v s a x‖^2) = _ + simp_rw [sum_configurationBlocks, tensorGradient_square_integral_left, + tensorGradient_square_integral_right] + rw [sum_joinSpins] + simp only [joinSpins_left, joinSpins_right] + simp only [mass, kinetic, Finset.sum_add_distrib] + simp_rw [← Finset.mul_sum, ← Finset.sum_mul] + rw [← Finset.sum_mul_sum] + ring +end Coulomb + +open scoped Classical +namespace Coulomb +def blockHom (m k : ℕ) : + (Equiv.Perm (Fin m) × Equiv.Perm (Fin k)) →* Equiv.Perm (Fin (m+k)) := + ((finSumFinEquiv : Fin m ⊕ Fin k ≃ Fin (m+k)).permCongrHom).toMonoidHom.comp + (Equiv.Perm.sumCongrHom (Fin m) (Fin k)) + +def blockGroup (m k : ℕ) : Subgroup (Equiv.Perm (Fin (m+k))) := (blockHom m k).range + +lemma blockHom_left {m k : ℕ} (p : Equiv.Perm (Fin m)) (q : Equiv.Perm (Fin k)) (i : Fin m) : + blockHom m k (p,q) (Fin.castAdd k i) = Fin.castAdd k (p i) := by + change finSumFinEquiv ((Equiv.sumCongr p q) (finSumFinEquiv.symm (Fin.castAdd k i))) = _ + simp [← finSumFinEquiv_apply_left] + +lemma blockHom_right {m k : ℕ} (p : Equiv.Perm (Fin m)) (q : Equiv.Perm (Fin k)) (i : Fin k) : + blockHom m k (p,q) (Fin.natAdd m i) = Fin.natAdd m (q i) := by + change finSumFinEquiv ((Equiv.sumCongr p q) (finSumFinEquiv.symm (Fin.natAdd m i))) = _ + simp [← finSumFinEquiv_apply_right] + +lemma blockHom_sign {m k : ℕ} (p : Equiv.Perm (Fin m)) (q : Equiv.Perm (Fin k)) : + (blockHom m k (p,q)).sign = p.sign*q.sign := by + change (finSumFinEquiv.permCongr (Equiv.sumCongr p q)).sign = _ + rw [Equiv.Perm.sign_permCongr, Equiv.Perm.sign_sumCongr] + +lemma blockHom_injective (m k : ℕ) : Function.Injective (blockHom m k) := + (finSumFinEquiv.permCongrHom.injective).comp Equiv.Perm.sumCongrHom_injective + +lemma card_blockGroup (m k : ℕ) : + Fintype.card (blockGroup m k) = Nat.factorial m*Nat.factorial k := by + rw [show Fintype.card (blockGroup m k) = + Fintype.card (Equiv.Perm (Fin m) × Equiv.Perm (Fin k)) from + Fintype.card_eq.mpr ⟨(Equiv.ofInjective (blockHom m k) (blockHom_injective m k)).symm⟩] + simp [Fintype.card_prod, Fintype.card_perm] + +lemma mem_blockGroup_of_no_crossing {m k : ℕ} (r : Equiv.Perm (Fin (m+k))) + (hr : ∀ i : Fin m, ∃ j : Fin m, r (Fin.castAdd k i) = Fin.castAdd k j) : + r ∈ blockGroup m k := by + let t : Equiv.Perm (Fin m ⊕ Fin k) := finSumFinEquiv.symm.permCongr r + have ht : Set.MapsTo t (Set.range Sum.inl) (Set.range Sum.inl) := by + rintro _ ⟨i, rfl⟩ + rcases hr i with ⟨j,hj⟩ + refine ⟨j, ?_⟩ + change Sum.inl j = finSumFinEquiv.symm (r (finSumFinEquiv (Sum.inl i))) + rw [finSumFinEquiv_apply_left, hj] + simp [← finSumFinEquiv_apply_left] + rcases Equiv.Perm.mem_sumCongrHom_range_of_perm_mapsTo_inl ht with ⟨pq,hpq⟩ + refine ⟨pq, ?_⟩ + apply finSumFinEquiv.symm.permCongr.injective + change finSumFinEquiv.symm.permCongr + (finSumFinEquiv.permCongr (Equiv.Perm.sumCongrHom (Fin m) (Fin k) pq)) = _ + rw [← Equiv.permCongr_symm, Equiv.symm_apply_apply] + exact hpq + +lemma exists_crossing_of_not_mem {m k : ℕ} (r : Equiv.Perm (Fin (m+k))) + (hr : r ∉ blockGroup m k) : + ∃ i : Fin m, ∃ j : Fin k, r (Fin.castAdd k i) = Fin.natAdd m j := by + have hn : ¬ ∀ i : Fin m, ∃ j : Fin m, r (Fin.castAdd k i) = Fin.castAdd k j := + fun h => hr (mem_blockGroup_of_no_crossing r h) + push Not at hn + rcases hn with ⟨i,hi⟩ + refine ⟨i, ?_⟩ + have hcases := Fin.addCases (motive := fun z : Fin (m+k) => + (∃ j : Fin k, z = Fin.natAdd m j) ∨ ∃ j : Fin m, z = Fin.castAdd k j) + (fun j => Or.inr ⟨j,rfl⟩) (fun j => Or.inl ⟨j,rfl⟩) (r (Fin.castAdd k i)) + rcases hcases with h|⟨j,hj⟩ + · exact h + · exact (hi j hj).elim +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LeftPotential.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LeftPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..05f7d7b5f8fcf9cd36c53900caa13738a669f5d6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LeftPotential.lean @@ -0,0 +1,225 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.NuclearPotential + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +namespace Coulomb +def leftPotential {m k : ℕ} (W : Configuration m → ℝ) (x : Configuration (m+k)) : ℝ := + W ((joinConfiguration m k).symm x).1 +def rightPotential {m k : ℕ} (W : Configuration k → ℝ) (x : Configuration (m+k)) : ℝ := + W ((joinConfiguration m k).symm x).2 + +def crossEnergy {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : ℝ := + potentialEnergy (fun x => crossPotential ((joinConfiguration m k).symm x).1 + ((joinConfiguration m k).symm x).2) (u.tensor v) + +lemma tensor_leftPotential_integrable {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (W : Configuration m → ℝ) (hW : ∀ s, Integrable (fun x => W x*‖u.value s x‖^2)) + (s : Spins (m+k)) : + Integrable (fun x => leftPotential W x*‖(u.tensor v).value s x‖^2) := by + have hp : Integrable (fun z : Configuration m × Configuration k => + (W z.1*‖u.value (s ∘ Fin.castAdd k) z.1‖^2)*‖v.value (s ∘ Fin.natAdd m) z.2‖^2) + (volume.prod volume) := + (hW (s ∘ Fin.castAdd k)).mul_prod ((v.value_L2 (s ∘ Fin.natAdd m)).norm.integrable_sq) + have H := (joinConfiguration_symm_measurePreserving m k).integrable_comp_of_integrable hp + apply H.congr + filter_upwards [] with x + change (W _*‖u.value _ _‖^2)*‖v.value _ _‖^2 = W _*‖u.value _ _*v.value _ _‖^2 + rw [norm_mul,mul_pow,mul_assoc] + rfl + +lemma tensor_rightPotential_integrable {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (W : Configuration k → ℝ) (hW : ∀ s, Integrable (fun x => W x*‖v.value s x‖^2)) + (s : Spins (m+k)) : + Integrable (fun x => rightPotential W x*‖(u.tensor v).value s x‖^2) := by + have hp : Integrable (fun z : Configuration m × Configuration k => + ‖u.value (s ∘ Fin.castAdd k) z.1‖^2*(W z.2*‖v.value (s ∘ Fin.natAdd m) z.2‖^2)) + (volume.prod volume) := + ((u.value_L2 (s ∘ Fin.castAdd k)).norm.integrable_sq).mul_prod (hW (s ∘ Fin.natAdd m)) + have H := (joinConfiguration_symm_measurePreserving m k).integrable_comp_of_integrable hp + apply H.congr + filter_upwards [] with x + change ‖u.value _ _‖^2*(W _*‖v.value _ _‖^2) = W _*‖u.value _ _*v.value _ _‖^2 + rw [norm_mul,mul_pow,mul_left_comm] + rfl + +lemma potentialEnergy_tensor_left {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (W : Configuration m → ℝ) : + potentialEnergy (leftPotential W) (u.tensor v) = potentialEnergy W u*mass v := by + have hi (s : Spins (m+k)) : (∫ x, leftPotential W x*‖(u.tensor v).value s x‖^2) = + (∫ x, W x*‖u.value (s ∘ Fin.castAdd k) x‖^2)* + (∫ y, ‖v.value (s ∘ Fin.natAdd m) y‖^2) := by + rw [← (joinConfiguration_measurePreserving m k).integral_comp' + (fun x => leftPotential W x*‖(u.tensor v).value s x‖^2)] + change (∫ z : Configuration m × Configuration k, + leftPotential W (joinConfiguration m k z)*‖tensorValue u v s (joinConfiguration m k z)‖^2 + ∂(volume.prod volume)) = _ + simp only [leftPotential, ContinuousLinearEquiv.symm_apply_apply, tensorValue_join,norm_mul,mul_pow,← mul_assoc] + exact integral_prod_mul (μ := volume) (ν := volume) + (fun x : Configuration m => W x*‖u.value (s ∘ Fin.castAdd k) x‖^2) + (fun y : Configuration k => ‖v.value (s ∘ Fin.natAdd m) y‖^2) + unfold potentialEnergy mass + rw [sum_joinSpins] + simp_rw [hi, joinSpins_left, joinSpins_right] + rw [Finset.sum_mul_sum] + +lemma potentialEnergy_tensor_right {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (W : Configuration k → ℝ) : + potentialEnergy (rightPotential W) (u.tensor v) = mass u*potentialEnergy W v := by + have hi (s : Spins (m+k)) : (∫ x, rightPotential W x*‖(u.tensor v).value s x‖^2) = + (∫ x, ‖u.value (s ∘ Fin.castAdd k) x‖^2)* + (∫ y, W y*‖v.value (s ∘ Fin.natAdd m) y‖^2) := by + rw [← (joinConfiguration_measurePreserving m k).integral_comp' + (fun x => rightPotential W x*‖(u.tensor v).value s x‖^2)] + change (∫ z : Configuration m × Configuration k, + rightPotential W (joinConfiguration m k z)*‖tensorValue u v s (joinConfiguration m k z)‖^2 + ∂(volume.prod volume)) = _ + simp only [rightPotential, ContinuousLinearEquiv.symm_apply_apply,tensorValue_join,norm_mul,mul_pow] + simp_rw [mul_left_comm (W _) (‖u.value _ _‖^2)] + exact integral_prod_mul (μ := volume) (ν := volume) + (fun x : Configuration m => ‖u.value (s ∘ Fin.castAdd k) x‖^2) + (fun y : Configuration k => W y*‖v.value (s ∘ Fin.natAdd m) y‖^2) + unfold potentialEnergy mass + rw [sum_joinSpins] + simp_rw [hi, joinSpins_left, joinSpins_right] + rw [Finset.sum_mul_sum] + +lemma potentialEnergy_add {n : ℕ} (u : H1Vector n) (V W : Configuration n → ℝ) + (hV : ∀ s, Integrable (fun x => V x*‖u.value s x‖^2)) + (hW : ∀ s, Integrable (fun x => W x*‖u.value s x‖^2)) : + potentialEnergy (fun x => V x+W x) u = potentialEnergy V u+potentialEnergy W u := by + simp only [potentialEnergy,add_mul] + simp_rw [integral_add (hV _) (hW _)] + rw [Finset.sum_add_distrib] + +lemma nuclearPotential_split {M m k : ℕ} (S : Nuclei M) (x : Configuration (m+k)) : + nuclearPotential S x = leftPotential (nuclearPotential S) x+ + rightPotential (nuclearPotential S) x := by + have H := nuclearPotential_join S ((joinConfiguration m k).symm x).1 ((joinConfiguration m k).symm x).2 + simpa only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply,leftPotential,rightPotential] using H + +lemma pairPotential_split {m k : ℕ} (x : Configuration (m+k)) : + pairPotential x = leftPotential pairPotential x+rightPotential pairPotential x+ + crossPotential ((joinConfiguration m k).symm x).1 ((joinConfiguration m k).symm x).2 := by + have H := pairPotential_join ((joinConfiguration m k).symm x).1 ((joinConfiguration m k).symm x).2 + simpa only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply,leftPotential,rightPotential] using H + +lemma nuclearEnergy_tensor {M m k : ℕ} (S : Nuclei M) (u : H1Vector m) (v : H1Vector k) : + nuclearEnergy S (u.tensor v) = nuclearEnergy S u*mass v+mass u*nuclearEnergy S v := by + change potentialEnergy (nuclearPotential S) (u.tensor v) = _ + rw [show (nuclearPotential S : Configuration (m+k) → ℝ) = fun x => + leftPotential (nuclearPotential S) x+rightPotential (nuclearPotential S) x + from funext (nuclearPotential_split S)] + have h1 : ∀ s, Integrable (fun x => leftPotential (nuclearPotential S) x*‖(u.tensor v).value s x‖^2) := + tensor_leftPotential_integrable u v (nuclearPotential S) (u.nuclear_integrable S) + have h2 : ∀ s, Integrable (fun x => rightPotential (nuclearPotential S) x*‖(u.tensor v).value s x‖^2) := + tensor_rightPotential_integrable u v (nuclearPotential S) (v.nuclear_integrable S) + rw [potentialEnergy_add _ _ _ h1 h2, + potentialEnergy_tensor_left,potentialEnergy_tensor_right] + rfl + +lemma tensor_crossPotential_integrable {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins (m+k)) : Integrable (fun x => + crossPotential ((joinConfiguration m k).symm x).1 ((joinConfiguration m k).symm x).2 * + ‖(u.tensor v).value s x‖^2) := by + have H := ((u.tensor v).pair_integrable s).sub + ((tensor_leftPotential_integrable u v pairPotential u.pair_integrable s).add + (tensor_rightPotential_integrable u v pairPotential v.pair_integrable s)) + convert H using 1 + funext x + change _ = pairPotential x*_-(_+_) + rw [pairPotential_split] + ring + +lemma pairEnergy_tensor {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : + pairEnergy (u.tensor v) = pairEnergy u*mass v+mass u*pairEnergy v+crossEnergy u v := by + change potentialEnergy pairPotential (u.tensor v) = _ + rw [show (pairPotential : Configuration (m+k) → ℝ) = fun x => + (leftPotential pairPotential x+rightPotential pairPotential x)+ + crossPotential ((joinConfiguration m k).symm x).1 ((joinConfiguration m k).symm x).2 + from funext pairPotential_split] + have h1 := tensor_leftPotential_integrable u v pairPotential u.pair_integrable + have h2 := tensor_rightPotential_integrable u v pairPotential v.pair_integrable + have h12 : ∀ s, Integrable (fun x => (leftPotential pairPotential x+rightPotential pairPotential x)* + ‖(u.tensor v).value s x‖^2) := by + intro s + apply ((h1 s).add (h2 s)).congr + filter_upwards [] with x + exact (add_mul _ _ _).symm + rw [potentialEnergy_add _ _ _ h12 + (tensor_crossPotential_integrable u v), + potentialEnergy_add _ _ _ h1 h2,potentialEnergy_tensor_left,potentialEnergy_tensor_right] + rfl + +lemma form_wedge {M m k : ℕ} (S : Nuclei M) (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) (A B : Set Space) + (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) + (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) : + form S (u.wedge v) = form S u*mass v+mass u*form S v+crossEnergy u v := by + unfold form + rw [kinetic_wedge u v hu hv A B hsu hsv hA hB hAB, + nuclearEnergy_wedge_tensor S u v hu hv A B hsu hsv hAB, + pairEnergy_wedge_tensor u v hu hv A B hsu hsv hAB,nuclearEnergy_tensor,pairEnergy_tensor] + ring +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LipschitzTestEnergy.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LipschitzTestEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a086fdc0ab185684ea885cc93c91744f4051ebc --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LipschitzTestEnergy.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TFCountTest +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior +import OAI.Analysis.CoulombRadii.Packets.LipschitzMollifier + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology ContDiff +namespace Coulomb +open NeutralAtom (dirPartial coordinateLaplacian axis) + +lemma smooth_test_energy_identity {χ : Space → ℝ} (hχ : ContDiff ℝ ∞ χ) + (hc : HasCompactSupport χ) : + (∫ x, testCharge χ x*χ x)= + (4*Real.pi)⁻¹*∑ a : Fin 3, ∫ x, (dirPartial χ (axis a) x)^2 := by + have hp (v : Space) : ContDiff ℝ ∞ (dirPartial χ v) := + NeutralAtom.contDiff_partial (by simpa using hχ) v + have hpc (v : Space) := NeutralAtom.hasCompactSupport_partial hc v + have hpp (v : Space) : ContDiff ℝ ∞ (dirPartial (dirPartial χ v) v) := + NeutralAtom.contDiff_partial (by simpa using hp v) v + have hcross (v : Space) : Integrable (fun x : Space => (dirPartial χ v x)^2) (volume : Measure Space) := by + have hh : HasCompactSupport (fun x => dirPartial χ v x*dirPartial χ v x) := (hpc v).mul_right + have hc : Continuous (fun x : Space => (dirPartial χ v x)^2) := (hp v).continuous.pow 2 + exact hc.integrable_of_hasCompactSupport (μ := (volume : Measure Space)) (by simpa only [pow_two] using hh) + have hsecond (v : Space) : Integrable (fun x => χ x*dirPartial (dirPartial χ v) v x) := + (hχ.continuous.mul (hpp v).continuous).integrable_of_hasCompactSupport hc.mul_right + have hprod (v : Space) : Integrable (fun x => χ x*dirPartial χ v x) := + (hχ.continuous.mul (hp v).continuous).integrable_of_hasCompactSupport hc.mul_right + have hibp (v : Space) : (∫ x, χ x*dirPartial (dirPartial χ v) v x)= + -(∫ x, (dirPartial χ v x)^2) := by + simpa only [dirPartial,pow_two] using + (integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (by simpa only [pow_two,dirPartial] using hcross v) (hsecond v) (hprod v) + (fun x _ => hχ.differentiable (by simp) x) + (fun x _ => (hp v).differentiable (by simp) x)) + have he : (fun x => testCharge χ x*χ x)= + (fun x => -(4*Real.pi)⁻¹*∑ a : Fin 3, χ x*dirPartial (dirPartial χ (axis a)) (axis a) x) := by + funext x + rw [testCharge,NeutralAtom.coordinateLaplacian_eq_partials + ((hχ.of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt),←Finset.mul_sum] + ring + rw [he,integral_const_mul,integral_finsetSum _ (fun a _ => hsecond (axis a))] + simp_rw [hibp] + rw [Finset.sum_neg_distrib] + ring + +lemma smooth_test_energy_le {χ : Space → ℝ} {A R : ℝ} (hA : 0≤A) + (hχ : ContDiff ℝ ∞ χ) (y : Space) + (hs : tsupport χ⊆Metric.closedBall y R) + (hL : ∀ z v, |χ z-χ v|≤A*‖z-v‖) : + (∫ x, testCharge χ x*χ x)≤ + (4*Real.pi)⁻¹*(3*(volume (Metric.closedBall y R)).toReal*A^2) := by + have hc : HasCompactSupport χ := (isCompact_closedBall y R).of_isClosed_subset (isClosed_tsupport χ) hs + rw [smooth_test_energy_identity hχ hc] + apply mul_le_mul_of_nonneg_left _ (by positivity) + have hsingle (a : Fin 3) : (∫ x, (dirPartial χ (axis a) x)^2)≤ + (volume (Metric.closedBall y R)).toReal*A^2 := by + have hd (x : Space) : |dirPartial χ (axis a) x|≤A := by + have hd := norm_fderiv_le_of_lip' ℝ (f := χ) (x₀ := x) hA (Eventually.of_forall (fun z => by + simpa only [Real.norm_eq_abs] using hL z x)) + have ha : ‖axis a‖=1 := by simp [axis] + have hh := (fderiv ℝ χ x).le_opNorm (axis a) + rw [ha,mul_one] at hh + exact (show |dirPartial χ (axis a) x|≤‖fderiv ℝ χ x‖ from hh).trans hd + have hout (x : Space) (hx : x∉Metric.closedBall y R) : (dirPartial χ (axis a) x)^2=0 := by + rw [image_eq_zero_of_notMem_tsupport (fun hh => hx (hs (NeutralAtom.tsupport_dirPartial_subset χ _ hh)))] + norm_num + rw [←setIntegral_eq_integral_of_forall_compl_eq_zero hout] + have hh := norm_setIntegral_le_of_norm_le_const (μ := volume) + (isCompact_closedBall y R).measure_lt_top (fun z _ => show ‖(dirPartial χ (axis a) z)^2‖≤A^2 by + rw [Real.norm_of_nonneg (sq_nonneg _)] + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hA).2 (hd z)) + exact (le_abs_self _).trans (by simpa only [Real.norm_eq_abs,Measure.real,mul_comm] using hh) + have HH := Finset.sum_le_sum (s := Finset.univ) (fun a _ => hsingle a) + simpa [mul_assoc] using HH + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology ContDiff +namespace Coulomb + +theorem raw_coulomb_lipschitz_test {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] {σ K : Space → ℝ} {A B R : ℝ} + (hσ : MemLp σ TFExponent (volume.restrict Ω)) (hσs : ∀ x∉Ω, σ x=0) + (hA : 0≤A) (hR : 0 R*(1/((n:ℝ)+1)) + have hε (n : ℕ) : 0<ε n := by dsimp [ε]; positivity + have hεR (n : ℕ) : ε n≤R := by + dsimp [ε] + apply mul_le_of_le_one_right hR.le + exact (div_le_one (by positivity)).2 (by linarith [Nat.cast_nonneg (α := ℝ) n]) + have hεt : Tendsto ε atTop (𝓝 0) := by + simpa only [mul_zero] using tendsto_one_div_add_atTop_nhds_zero_nat.const_mul R + choose χ hsm hsp hLip happ using + (fun n => NeutralAtom.exists_smooth_lipschitz_approx K hA (hε n) y hK hL) + have hiΩ : Integrable σ (volume.restrict Ω) := hσ.integrable (by norm_num [TFExponent]) + have hind : Ω.indicator σ=σ := by + funext x + by_cases hx : x∈Ω + · exact indicator_of_mem hx σ + · rw [indicator_of_notMem hx,hσs x hx] + have hi : Integrable σ := by + have hh := (integrable_indicator_iff hΩ).2 hiΩ + rwa [hind] at hh + have hpoint (x : Space) : Tendsto (fun n => χ n x) atTop (𝓝 (K x)) := by + apply tendsto_iff_dist_tendsto_zero.mpr + have hh : Tendsto (fun n => A*ε n) atTop (𝓝 0) := by simpa using hεt.const_mul A + exact squeeze_zero (fun n => dist_nonneg) (fun n => by simpa only [Real.dist_eq] using happ n x) hh + have hdom (n : ℕ) (x : Space) : |χ n x|≤B+A*R := by + calc + _≤|χ n x-K x|+|K x| := by simpa only [sub_add_cancel] using abs_add_le (χ n x-K x) (K x) + _≤A*ε n+B := add_le_add (happ n x) (hB x) + _≤_ := by have hh := mul_le_mul_of_nonneg_left (hεR n) hA; linarith + have hconv : Tendsto (fun n => ∫ x, σ x*χ n x) atTop (𝓝 (∫ x, σ x*K x)) := by + apply tendsto_integral_of_dominated_convergence (fun x => ‖σ x‖*(B+A*R)) + · intro n + exact hi.aestronglyMeasurable.mul (hsm n).continuous.aestronglyMeasurable + · exact hi.norm.mul_const _ + · intro n + filter_upwards [] with x + rw [norm_mul,Real.norm_eq_abs (χ n x)] + exact mul_le_mul_of_nonneg_left (hdom n x) (norm_nonneg _) + · filter_upwards [] with x + exact tendsto_const_nhds.mul (hpoint x) + have hQ := raw_coulomb_nonneg hΩ hσ hσs + apply le_of_tendsto (hconv.pow 2) + filter_upwards [] with n + have hsp' : tsupport (χ n)⊆Metric.closedBall y (2*R) := + (hsp n).trans (Metric.closedBall_subset_closedBall (by linarith [hεR n])) + have hc : HasCompactSupport (χ n) := (isCompact_closedBall y (2*R)).of_isClosed_subset + (isClosed_tsupport _) hsp' + exact (raw_coulomb_smooth_test hΩ (hsm n) hc (hsp'.trans hball) hσ hσs).trans + (mul_le_mul_of_nonneg_left (smooth_test_energy_le hA (hsm n) y hsp' (hLip n)) hQ) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LowProjection.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LowProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5a8f9ddbe2504731cbd9f077bedd8a8033da8bb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/LowProjection.lean @@ -0,0 +1,53 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.TsumFixed + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +section LowProjection +variable {A B ι : Type*} [MeasurableSpace A] [MeasurableSpace B] + {μ : Measure A} {ν : Measure B} [SigmaFinite μ] [SigmaFinite ν] + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + +noncomputable def lowProjection (s : Finset ι) (f : B × A → ℂ) (z : B × A) : ℂ := + ∑ i ∈ s, fiberContract (μ := μ) (v i) f z.1 * v i z.2 + +include hv in +lemma lowProjection_memLp (s : Finset ι) {f : B × A → ℂ} (hf : MemLp f 2 (ν.prod μ)) : + MemLp (lowProjection (μ := μ) v s f) 2 (ν.prod μ) := + memLp_finsetSum s (fun i _ => tensorPair_memLp (fiberContract_memLp (hv i) hf) (hv i)) + +include hv in +lemma lowProjection_tail_memLp (s : Finset ι) {f : B × A → ℂ} + (hf : MemLp f 2 (ν.prod μ)) (x : A) : + MemLp (fun y => lowProjection (μ := μ) v s f (y,x)) 2 ν := + memLp_finsetSum s (fun i _ => (fiberContract_memLp (hv i) hf).mul_const (v i x)) + +include hv in +lemma lowProjection_eq_contract (s : Finset ι) {f : B × A → ℂ} + (hf : MemLp f 2 (ν.prod μ)) (x : A) : + (fun y => lowProjection (μ := μ) v s f (y,x)) =ᵐ[ν] + fiberContract (μ := μ) (lowOrbital v s x) f := by + filter_upwards [memLp_fiber_ae hf] with y hy + unfold lowProjection fiberContract lowOrbital + rw [show (fun a => star (∑ i ∈ s, star (v i x) * v i a) * f (y,a)) = + (fun a => ∑ i ∈ s, (star (v i a) * f (y,a)) * v i x) from by + funext a + simp only [star_sum, star_mul, star_star, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + ring] + rw [integral_finsetSum s (fun i _ => (integrable_star_mul (hv i) hy).mul_const (v i x))] + simp only [integral_mul_const] + +end LowProjection +end Coulomb + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/MeridianMap.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/MeridianMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..f01dde9f9052bf4d36a8e90deaf9fcb113a20cb7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/MeridianMap.lean @@ -0,0 +1,520 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.TruncatedCoulomb + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb +noncomputable def meridianMap (p : ℝ × ℝ) : ℝ × ℝ := (Real.sqrt (p.1^2-p.2^2), p.2) +def meridianDomain : Set (ℝ × ℝ) := {p | |p.2| < p.1} +lemma meridianDomain_measurable : MeasurableSet meridianDomain := + measurableSet_lt (measurable_snd.abs) measurable_fst +lemma meridian_radicand_pos {p : ℝ × ℝ} (hp : p ∈ meridianDomain) : 0 < p.1^2-p.2^2 := by + change |p.2| < p.1 at hp + have h0 := abs_nonneg p.2 + nlinarith [sq_abs p.2] +noncomputable def meridianDeriv (p : ℝ × ℝ) : (ℝ × ℝ) →L[ℝ] (ℝ × ℝ) := + (Matrix.toLin (.finTwoProd ℝ) (.finTwoProd ℝ) + !![p.1 / Real.sqrt (p.1^2-p.2^2), -p.2 / Real.sqrt (p.1^2-p.2^2); 0, 1]).toContinuousLinearMap +lemma meridian_hasFDeriv {p : ℝ × ℝ} (hp : p ∈ meridianDomain) : + HasFDerivAt meridianMap (meridianDeriv p) p := by + have hf : HasFDerivAt (fun q : ℝ × ℝ => q.1) (ContinuousLinearMap.fst ℝ ℝ ℝ) p := hasFDerivAt_fst + have hg : HasFDerivAt (fun q : ℝ × ℝ => q.2) (ContinuousLinearMap.snd ℝ ℝ ℝ) p := hasFDerivAt_snd + have hh := (Real.hasDerivAt_sqrt (meridian_radicand_pos hp).ne').comp_hasFDerivAt p + ((hf.pow 2).sub (hg.pow 2)) + have h := hh.prodMk (hasFDerivAt_snd (𝕜:=ℝ) (E:=ℝ) (F:=ℝ)) + unfold meridianDeriv + rw [Matrix.toLin_finTwoProd_toContinuousLinearMap] + apply h.congr_fderiv + ext <;> simp [div_eq_mul_inv] <;> ring +lemma meridian_det (p : ℝ × ℝ) : (meridianDeriv p).det = p.1 / Real.sqrt (p.1^2-p.2^2) := by + simp [meridianDeriv, LinearMap.det_toContinuousLinearMap, LinearMap.det_toLin, + Matrix.det_fin_two_of] +lemma meridianMap_injOn : InjOn meridianMap meridianDomain := by + intro p hp q hq he + have h1 : Real.sqrt (p.1^2-p.2^2) = Real.sqrt (q.1^2-q.2^2) := congrArg Prod.fst he + have h2 : p.2 = q.2 := by simpa [meridianMap] using congrArg Prod.snd he + have hp0 := meridian_radicand_pos hp + have hq0 := meridian_radicand_pos hq + rw [Real.sqrt_inj hp0.le hq0.le] at h1 + have hpp : 0 < p.1 := (abs_nonneg p.2).trans_lt hp + have hqq : 0 < q.1 := (abs_nonneg q.2).trans_lt hq + apply Prod.ext _ h2 + rw [h2] at h1 + nlinarith +lemma meridian_image : meridianMap '' meridianDomain = Ioi (0:ℝ) ×ˢ (univ : Set ℝ) := by + ext q + constructor + · rintro ⟨p, hp, rfl⟩ + exact ⟨Real.sqrt_pos.mpr (meridian_radicand_pos hp), mem_univ _⟩ + · rintro ⟨hq, _⟩ + change 0 < q.1 at hq + refine ⟨(Real.sqrt (q.1^2+q.2^2), q.2), ?_, ?_⟩ + · change |q.2| < Real.sqrt (q.1^2+q.2^2) + rw [Real.lt_sqrt (abs_nonneg _)] + nlinarith [sq_abs q.2, sq_pos_of_pos hq] + · apply Prod.ext + · dsimp [meridianMap] + rw [Real.sq_sqrt (by positivity), add_sub_cancel_right, Real.sqrt_sq hq.le] + · rfl + +lemma meridian_lintegral (f : ℝ × ℝ → ℝ≥0∞) : + (∫⁻ q in Ioi (0:ℝ) ×ˢ (univ : Set ℝ), ENNReal.ofReal q.1 * f q) = + ∫⁻ p in meridianDomain, ENNReal.ofReal p.1 * f (meridianMap p) := by + rw [← meridian_image, lintegral_image_eq_lintegral_abs_det_fderiv_mul volume + meridianDomain_measurable (fun p hp => (meridian_hasFDeriv hp).hasFDerivWithinAt) meridianMap_injOn] + apply setLIntegral_congr_fun meridianDomain_measurable + intro p hp + have hr := meridian_radicand_pos hp + have hs := Real.sqrt_pos.mpr hr + have hp0 : 0 < p.1 := (abs_nonneg p.2).trans_lt hp + dsimp only + rw [meridian_det, abs_of_pos (div_pos hp0 hs)] + change ENNReal.ofReal (p.1 / Real.sqrt (p.1^2-p.2^2)) * + (ENNReal.ofReal (Real.sqrt (p.1^2-p.2^2)) * f _) = _ + rw [← mul_assoc, ← ENNReal.ofReal_mul (div_pos hp0 hs).le, div_mul_cancel₀ _ hs.ne'] + +lemma plane_radial_lintegral (F : ℝ → ℝ≥0∞) (hF : Measurable F) : + (∫⁻ q : ℝ × ℝ, F (Real.sqrt (q.1^2+q.2^2))) = + ENNReal.ofReal (2*Real.pi) * ∫⁻ r in Ioi (0:ℝ), ENNReal.ofReal r * F r := by + rw [← lintegral_comp_polarCoord_symm] + have hpoint (p : ℝ × ℝ) (hp : p ∈ polarCoord.target) : + Real.sqrt ((polarCoord.symm p).1^2+(polarCoord.symm p).2^2) = p.1 := by + have hr : 0 < p.1 := hp.1 + dsimp [polarCoord] + rw [show (p.1 * Real.cos p.2)^2 + (p.1 * Real.sin p.2)^2 = p.1^2 from by + nlinarith [Real.sin_sq_add_cos_sq p.2]] + exact Real.sqrt_sq hr.le + calc + _ = ∫⁻ p in polarCoord.target, ENNReal.ofReal p.1 * F p.1 := by + apply setLIntegral_congr_fun polarCoord.open_target.measurableSet + intro p hp + simp only [smul_eq_mul, hpoint p hp] + _ = _ := by + change (∫⁻ p : ℝ × ℝ in Ioi (0:ℝ) ×ˢ Ioo (-Real.pi) Real.pi, + ENNReal.ofReal p.1 * F p.1) = _ + rw [Measure.volume_eq_prod, ← Measure.prod_restrict, lintegral_prod] + · simp only [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioo, sub_neg_eq_add] + rw [show Real.pi + Real.pi = 2*Real.pi by ring, lintegral_mul_const] + · exact mul_comm _ _ + · exact measurable_id.ennreal_ofReal.mul hF + · exact ((measurable_fst.ennreal_ofReal).mul (hF.comp measurable_fst)).aemeasurable + +lemma axisymmetric_lintegral (F : ℝ × ℝ → ℝ≥0∞) (hF : Measurable F) : + (∫⁻ z : ℝ, ∫⁻ q : ℝ × ℝ, F (Real.sqrt (z^2+q.1^2+q.2^2), z)) = + ENNReal.ofReal (2*Real.pi) * + ∫⁻ p in meridianDomain, ENNReal.ofReal p.1 * F p := by + have hp (z : ℝ) := plane_radial_lintegral + (fun r => F (Real.sqrt (z^2+r^2), z)) + (hF.comp (((measurable_const.add (measurable_id.pow_const 2)).sqrt).prodMk measurable_const)) + have he (z : ℝ) : (∫⁻ q : ℝ × ℝ, F (Real.sqrt (z^2+q.1^2+q.2^2), z)) = + ENNReal.ofReal (2*Real.pi) * + ∫⁻ r in Ioi (0:ℝ), ENNReal.ofReal r * F (Real.sqrt (r^2+z^2), z) := by + convert hp z using 1 + · apply lintegral_congr + intro q + rw [Real.sq_sqrt (by positivity)] + congr 3 + ring + · congr 1 + apply lintegral_congr + intro r + rw [add_comm (z^2) (r^2)] + simp_rw [he] + rw [lintegral_const_mul _ (by fun_prop)] + congr 1 + have hm : Measurable (fun p : ℝ × ℝ => ENNReal.ofReal p.1 * F (Real.sqrt (p.1^2+p.2^2), p.2)) := by + exact measurable_fst.ennreal_ofReal.mul + (hF.comp (((measurable_fst.pow_const 2).add (measurable_snd.pow_const 2)).sqrt.prodMk measurable_snd)) + rw [← lintegral_lintegral_swap hm.aemeasurable] + rw [← lintegral_prod _ hm.aemeasurable] + rw [show (volume.restrict (Ioi (0:ℝ))).prod volume = + (volume : Measure (ℝ × ℝ)).restrict (Ioi (0:ℝ) ×ˢ univ) from by + rw [Measure.volume_eq_prod, ← Measure.prod_restrict, Measure.restrict_univ]] + rw [meridian_lintegral] + apply setLIntegral_congr_fun meridianDomain_measurable + intro p hp + dsimp [meridianMap] + rw [Real.sq_sqrt (meridian_radicand_pos hp).le, sub_add_cancel, + Real.sqrt_sq ((abs_nonneg p.2).trans_lt hp).le] + +lemma meridian_lintegral_iterated (F : ℝ × ℝ → ℝ≥0∞) (hF : Measurable F) : + (∫⁻ p in meridianDomain, ENNReal.ofReal p.1 * F p) = + ∫⁻ s in Ioi (0:ℝ), ∫⁻ z in Ioo (-s) s, ENNReal.ofReal s * F (s,z) := by + have hm : Measurable (meridianDomain.indicator (fun p : ℝ × ℝ => ENNReal.ofReal p.1 * F p)) := + (measurable_fst.ennreal_ofReal.mul hF).indicator meridianDomain_measurable + rw [← lintegral_indicator meridianDomain_measurable, Measure.volume_eq_prod, + lintegral_prod _ hm.aemeasurable, ← lintegral_indicator measurableSet_Ioi] + apply lintegral_congr + intro s + by_cases hs : 0 < s + · rw [Set.indicator_of_mem (show s ∈ Ioi (0:ℝ) from hs), ← lintegral_indicator measurableSet_Ioo] + apply lintegral_congr + intro z + have he : (s,z) ∈ meridianDomain ↔ z ∈ Ioo (-s) s := by + change |z| < s ↔ -s < z ∧ z < s + exact abs_lt + by_cases hz : z ∈ Ioo (-s) s <;> simp [Set.indicator, he, hz] + · rw [Set.indicator_of_notMem (show s ∉ Ioi (0:ℝ) from hs)] + simp [Set.indicator, ENNReal.ofReal_eq_zero.mpr (le_of_not_gt hs)] + +noncomputable def tripleSpaceEquiv : (ℝ × (ℝ × ℝ)) ≃ᵐ Space := + ((MeasurableEquiv.refl ℝ).prodCongr (MeasurableEquiv.piFinTwo (fun _ => ℝ)).symm).trans + (((MeasurableEquiv.piFinSuccAbove (fun _ : Fin 3 => ℝ) 0).symm).trans + (MeasurableEquiv.toLp 2 (Fin 3 → ℝ))) +lemma tripleSpaceEquiv_apply (p : ℝ × (ℝ × ℝ)) : + tripleSpaceEquiv p = WithLp.toLp 2 ![p.1,p.2.1,p.2.2] := by + ext i + fin_cases i <;> rfl +lemma tripleSpaceEquiv_preserving : MeasurePreserving tripleSpaceEquiv volume volume := by + have h1 := (MeasurePreserving.id (volume : Measure ℝ)).prod + ((volume_preserving_piFinTwo (fun _ => ℝ)).symm _) + have h2 := (volume_preserving_piFinSuccAbove (fun _ : Fin 3 => ℝ) 0).symm _ + have h3 := (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin 3)).symm _ + exact h3.comp (h2.comp h1) +lemma norm_tripleSpaceEquiv (p : ℝ × (ℝ × ℝ)) : + ‖tripleSpaceEquiv p‖ = Real.sqrt (p.1^2 + p.2.1^2+p.2.2^2) := by + rw [tripleSpaceEquiv_apply, EuclideanSpace.norm_eq] + simp [Fin.sum_univ_succ, Real.norm_eq_abs, sq_abs, add_assoc] +lemma axisymmetric_space_lintegral (F : ℝ × ℝ → ℝ≥0∞) (hF : Measurable F) : + (∫⁻ x : Space, F (‖x‖, x 0)) = ENNReal.ofReal (2*Real.pi) * + ∫⁻ p in meridianDomain, ENNReal.ofReal p.1 * F p := by + rw [← tripleSpaceEquiv_preserving.lintegral_comp_emb tripleSpaceEquiv.measurableEmbedding, + Measure.volume_eq_prod, lintegral_prod] + · simp only [norm_tripleSpaceEquiv] + have he (p : ℝ × (ℝ × ℝ)) : tripleSpaceEquiv p 0 = p.1 := by + rw [tripleSpaceEquiv_apply]; rfl + simp_rw [he] + exact axisymmetric_lintegral F hF + · have hm : Measurable (fun x : Space => F (‖x‖, x 0)) := + hF.comp (measurable_norm.prodMk (PiLp.continuous_apply 2 (fun _ : Fin 3 => ℝ) 0).measurable) + exact (hm.comp tripleSpaceEquiv.measurable).aemeasurable + +lemma angular_coulomb_integral {r s : ℝ} (hr : 0 < r) (hs : 0 < s) : + (1/2:ℝ) * (∫ u in (-1:ℝ)..1, (r^2+s^2-2*r*s*u)^(-(1/2):ℝ)) = (max r s)⁻¹ := by + have H := intervalIntegral.mul_integral_comp_sub_mul (f := fun x : ℝ => x^(-(1/2):ℝ)) + (a := -1) (b := 1) (2*r*s) (r^2+s^2) + have h1 : r^2+s^2-(2*r*s)*1 = (r-s)^2 := by ring + have h2 : r^2+s^2-(2*r*s)*(-1) = (r+s)^2 := by ring + rw [h1, h2, integral_rpow (Or.inl (by norm_num : (-1:ℝ) < -(1/2)))] at H + norm_num only [show (-(1/2):ℝ)+1 = 1/2 by norm_num] at H + simp_rw [← Real.sqrt_eq_rpow, Real.sqrt_sq_eq_abs] at H + rw [abs_of_pos (add_pos hr hs)] at H + rcases le_total r s with h | h + · rw [max_eq_right h, abs_of_nonpos (sub_nonpos.mpr h)] at * + field_simp + nlinarith + · rw [max_eq_left h, abs_of_nonneg (sub_nonneg.mpr h)] at * + field_simp + nlinarith + +lemma affine_halfpower_intervalIntegrable (d c a b : ℝ) (hc : c ≠ 0) : + IntervalIntegrable (fun z => (d-c*z)^(-(1/2):ℝ)) volume a b := by + have H := ((intervalIntegral.intervalIntegrable_rpow' + (a:=d-c*a) (b:=d-c*b) (by norm_num : (-1:ℝ) < -(1/2))).comp_sub_left d).comp_mul_left (c:=c) + convert H using 1 <;> field_simp <;> ring + +lemma meridian_coulomb_integral {r s : ℝ} (hr : 0 < r) (hs : 0 < s) : + (∫ z in (-s)..s, (r^2+s^2-2*r*z)^(-(1/2):ℝ)) = 2*s*(max r s)⁻¹ := by + have H := intervalIntegral.integral_comp_mul_left (a:=(-1:ℝ)) (b:=1) + (c:=s) (fun z => (r^2+s^2-2*r*z)^(-(1/2):ℝ)) hs.ne' + have he (u : ℝ) : r^2+s^2-2*r*(s*u) = r^2+s^2-2*r*s*u := by ring + simp_rw [he] at H + simp only [mul_neg_one, mul_one, smul_eq_mul] at H + have A := angular_coulomb_integral hr hs + rw [H] at A + have hsi : s*s⁻¹ = 1 := mul_inv_cancel₀ hs.ne' + calc + _ = s * (s⁻¹ * ∫ z in (-s)..s, (r^2+s^2-2*r*z)^(-(1/2):ℝ)) := by rw [← mul_assoc, hsi, one_mul] + _ = _ := by nlinarith + +lemma meridian_coulomb_lintegral {r s : ℝ} (hr : 0 < r) (hs : 0 < s) : + (∫⁻ z in Ioo (-s) s, ENNReal.ofReal ((r^2+s^2-2*r*z)^(-(1/2):ℝ))) = + ENNReal.ofReal (2*s*(max r s)⁻¹) := by + have hab : -s ≤ s := by linarith + have hi := (intervalIntegrable_iff_integrableOn_Ioo_of_le hab).mp + (affine_halfpower_intervalIntegrable (r^2+s^2) (2*r) (-s) s (by positivity)) + rw [← ofReal_integral_eq_lintegral_ofReal hi] + · rw [setIntegral_congr_set Ioo_ae_eq_Ioc, ← intervalIntegral.integral_of_le hab, + meridian_coulomb_integral hr hs] + · filter_upwards [ae_restrict_mem measurableSet_Ioo] with z hz + exact Real.rpow_nonneg (by nlinarith [sq_nonneg (r-s), hz.2]) _ + +lemma norm_axis_sub_rpow (r : ℝ) (x : Space) : + ‖EuclideanSpace.single 0 r - x‖⁻¹ = + (r^2+‖x‖^2-2*r*x 0)^(-(1/2):ℝ) := by + have he : ‖EuclideanSpace.single 0 r - x‖^2 = r^2+‖x‖^2-2*r*x 0 := by + rw [norm_sub_sq_real] + simp [EuclideanSpace.inner_single_left, Real.norm_eq_abs, sq_abs] + ring + rw [← he, Real.rpow_neg (sq_nonneg _) (1/2:ℝ), ← Real.sqrt_eq_rpow, + Real.sqrt_sq (norm_nonneg _)] + +lemma radial_axis_coulomb_lintegral (F : ℝ → ℝ≥0∞) (hF : Measurable F) + {r : ℝ} (hr : 0 < r) : + (∫⁻ x : Space, ENNReal.ofReal ‖EuclideanSpace.single 0 r-x‖⁻¹ * F ‖x‖) = + ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (s^2*(max r s)⁻¹) * F s := by + simp_rw [norm_axis_sub_rpow] + have hm : Measurable (fun p : ℝ × ℝ => + ENNReal.ofReal ((r^2+p.1^2-2*r*p.2)^(-(1/2):ℝ)) * F p.1) := by fun_prop + rw [axisymmetric_space_lintegral _ hm, meridian_lintegral_iterated _ hm] + have he (s : ℝ) (hs : s ∈ Ioi (0:ℝ)) : + (∫⁻ z in Ioo (-s) s, ENNReal.ofReal s * + (ENNReal.ofReal ((r^2+s^2-2*r*z)^(-(1/2):ℝ)) * F s)) = + ENNReal.ofReal 2 * (ENNReal.ofReal (s^2*(max r s)⁻¹) * F s) := by + change 0 < s at hs + rw [lintegral_const_mul _ (by fun_prop), lintegral_mul_const _ (by fun_prop), + meridian_coulomb_lintegral hr hs] + calc + _ = ENNReal.ofReal (s*(2*s*(max r s)⁻¹))*F s := by + rw [← mul_assoc, ← ENNReal.ofReal_mul hs.le] + _ = ENNReal.ofReal (2*(s^2*(max r s)⁻¹))*F s := by congr 2; ring + _ = _ := by rw [ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 2), mul_assoc] + rw [setLIntegral_congr_fun measurableSet_Ioi he, lintegral_const_mul _ (by fun_prop), + ← mul_assoc, ← ENNReal.ofReal_mul (by positivity)] + congr 2 + ring + +lemma radial_space_lintegral (F : ℝ → ℝ≥0∞) (hF : Measurable F) : + (∫⁻ x : Space, F ‖x‖) = ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (s^2) * F s := by + have hm : Measurable (fun p : ℝ × ℝ => F p.1) := hF.comp measurable_fst + rw [axisymmetric_space_lintegral _ hm, meridian_lintegral_iterated _ hm] + have he (s : ℝ) (hs : s ∈ Ioi (0:ℝ)) : + (∫⁻ z in Ioo (-s) s, ENNReal.ofReal s * F s) = + ENNReal.ofReal 2 * (ENNReal.ofReal (s^2) * F s) := by + change 0 < s at hs + simp only [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioo] + rw [show s- -s = 2*s by ring, mul_comm (ENNReal.ofReal s * F s), + ← mul_assoc, ← ENNReal.ofReal_mul (by positivity), ← mul_assoc, + ← ENNReal.ofReal_mul (by norm_num)] + congr 2 + ring + rw [setLIntegral_congr_fun measurableSet_Ioi he, lintegral_const_mul _ (by fun_prop), + ← mul_assoc, ← ENNReal.ofReal_mul (by positivity)] + congr 2 + ring + +lemma radial_coulomb_lintegral (F : ℝ → ℝ≥0∞) (hF : Measurable F) + {x : Space} (hx : x ≠ 0) : + (∫⁻ y : Space, ENNReal.ofReal ‖x-y‖⁻¹ * F ‖y‖) = + ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (s^2*(max ‖x‖ s)⁻¹) * F s := by + let v : Space := EuclideanSpace.single 0 ‖x‖ + let E := (ℝ ∙ (v-x))ᗮ.reflection + have hv : ‖v‖ = ‖x‖ := by simp [v] + have hE : E v = x := Submodule.reflection_sub hv + calc + _ = ∫⁻ y : Space, ENNReal.ofReal ‖x-E y‖⁻¹ * F ‖E y‖ := + (E.measurePreserving.lintegral_comp_emb E.toHomeomorph.measurableEmbedding _).symm + _ = ∫⁻ y : Space, ENNReal.ofReal ‖v-y‖⁻¹ * F ‖y‖ := by + apply lintegral_congr + intro y + rw [← hE, ← E.map_sub, E.norm_map, E.norm_map] + _ = _ := radial_axis_coulomb_lintegral F hF (norm_pos_iff.mpr hx) + +lemma radial_coulomb_lintegral_le (F : ℝ → ℝ≥0∞) (hF : Measurable F) + {x : Space} (hx : x ≠ 0) : + (∫⁻ y : Space, ENNReal.ofReal ‖x-y‖⁻¹ * F ‖y‖) ≤ + ENNReal.ofReal ‖x‖⁻¹ * ∫⁻ y : Space, F ‖y‖ := by + calc + _ = ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (s^2*(max ‖x‖ s)⁻¹) * F s := + radial_coulomb_lintegral F hF hx + _ ≤ ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (‖x‖⁻¹*s^2) * F s := by + apply mul_le_mul_right + apply setLIntegral_mono' measurableSet_Ioi + intro s _ + apply mul_le_mul_left + apply ENNReal.ofReal_le_ofReal + nlinarith [mul_le_mul_of_nonneg_left + (inv_anti₀ (norm_pos_iff.mpr hx) (le_max_left ‖x‖ s)) (sq_nonneg s)] + _ = _ := by + rw [radial_space_lintegral F hF] + simp_rw [ENNReal.ofReal_mul (inv_nonneg.mpr (norm_nonneg x)), mul_assoc] + rw [lintegral_const_mul _ (by fun_prop)] + ac_rfl + +lemma radial_coulomb_lintegral_eq (F : ℝ → ℝ≥0∞) (hF : Measurable F) + {R : ℝ} (hFR : ∀ s, R < s → F s = 0) + {x : Space} (hx : x ≠ 0) (hRx : R ≤ ‖x‖) : + (∫⁻ y : Space, ENNReal.ofReal ‖x-y‖⁻¹ * F ‖y‖) = + ENNReal.ofReal ‖x‖⁻¹ * ∫⁻ y : Space, F ‖y‖ := by + calc + _ = ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (s^2*(max ‖x‖ s)⁻¹) * F s := + radial_coulomb_lintegral F hF hx + _ = ENNReal.ofReal (4*Real.pi) * + ∫⁻ s in Ioi (0:ℝ), ENNReal.ofReal (‖x‖⁻¹*s^2) * F s := by + congr 1 + apply setLIntegral_congr_fun measurableSet_Ioi + intro s _ + dsimp only + by_cases hs : R < s + · simp [hFR s hs] + · rw [max_eq_left ((le_of_not_gt hs).trans hRx), mul_comm (s^2)] + _ = _ := by + rw [radial_space_lintegral F hF] + simp_rw [ENNReal.ofReal_mul (inv_nonneg.mpr (norm_nonneg x)), mul_assoc] + rw [lintegral_const_mul _ (by fun_prop)] + ac_rfl + +lemma space_axis_continuous : Continuous (fun s : ℝ => (EuclideanSpace.single (0 : Fin 3) s : Space)) := by + apply (PiLp.continuous_toLp 2 (fun _ : Fin 3 => ℝ)).comp + apply continuous_pi + intro i + simp only [Pi.single_apply] + split <;> fun_prop + +lemma radial_coulomb_integral_le {f : Space → ℝ} (hf : Integrable f) + (hm : Measurable f) (hf0 : ∀ y, 0 ≤ f y) {M : ℝ} (hfM : ∀ y, f y ≤ M) + (hrad : ∀ y, f y = f (EuclideanSpace.single 0 ‖y‖)) + {x : Space} (hx : x ≠ 0) : + (∫ y, coulombKernel (x-y) * f y) ≤ coulombKernel x * ∫ y, f y := by + let F : ℝ → ℝ≥0∞ := fun s => ENNReal.ofReal (f (EuclideanSpace.single 0 s)) + have hmF : Measurable F := (hm.comp space_axis_continuous.measurable).ennreal_ofReal + have he (y : Space) : F ‖y‖ = ENNReal.ofReal (f y) := congrArg ENNReal.ofReal (hrad y).symm + have H := radial_coulomb_lintegral_le F hmF hx + simp_rw [he] at H + have hi := coulomb_convolution_integrable hf hm hf0 hfM (by norm_num : (0:ℝ) < 1) x + have hp (y : Space) : 0 ≤ coulombKernel (x-y)*f y := mul_nonneg (coulombKernel_nonneg _) (hf0 _) + have hI := ofReal_integral_eq_lintegral_ofReal hi (Filter.Eventually.of_forall hp) + have hmass := ofReal_integral_eq_lintegral_ofReal hf (Filter.Eventually.of_forall hf0) + simp_rw [ENNReal.ofReal_mul (coulombKernel_nonneg _)] at hI + change ENNReal.ofReal (∫ y, coulombKernel (x-y)*f y) = + ∫⁻ y, ENNReal.ofReal ‖x-y‖⁻¹*ENNReal.ofReal (f y) at hI + rw [← hI, ← hmass, ← ENNReal.ofReal_mul (inv_nonneg.mpr (norm_nonneg _))] at H + exact (ENNReal.ofReal_le_ofReal_iff (mul_nonneg (coulombKernel_nonneg x) (integral_nonneg hf0))).mp H + +lemma radial_coulomb_integral_eq {f : Space → ℝ} (hf : Integrable f) + (hm : Measurable f) (hf0 : ∀ y, 0 ≤ f y) {M : ℝ} (hfM : ∀ y, f y ≤ M) + (hrad : ∀ y, f y = f (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hR : 0 ≤ R) (hfs : ∀ y, R < ‖y‖ → f y = 0) + {x : Space} (hx : x ≠ 0) (hRx : R ≤ ‖x‖) : + (∫ y, coulombKernel (x-y) * f y) = coulombKernel x * ∫ y, f y := by + let F : ℝ → ℝ≥0∞ := fun s => ENNReal.ofReal (f (EuclideanSpace.single 0 s)) + have hmF : Measurable F := (hm.comp space_axis_continuous.measurable).ennreal_ofReal + have he (y : Space) : F ‖y‖ = ENNReal.ofReal (f y) := congrArg ENNReal.ofReal (hrad y).symm + have hs : ∀ s, R < s → F s = 0 := by + intro s hs + have hsp : 0 < s := hR.trans_lt hs + have h := hfs (EuclideanSpace.single 0 s) (by simpa [Real.norm_eq_abs, abs_of_pos hsp] using hs) + simp only [F, h, ENNReal.ofReal_zero] + have H := radial_coulomb_lintegral_eq F hmF hs hx hRx + simp_rw [he] at H + have hi := coulomb_convolution_integrable hf hm hf0 hfM (by norm_num : (0:ℝ) < 1) x + have hp (y : Space) : 0 ≤ coulombKernel (x-y)*f y := mul_nonneg (coulombKernel_nonneg _) (hf0 _) + have hI := ofReal_integral_eq_lintegral_ofReal hi (Filter.Eventually.of_forall hp) + have hmass := ofReal_integral_eq_lintegral_ofReal hf (Filter.Eventually.of_forall hf0) + simp_rw [ENNReal.ofReal_mul (coulombKernel_nonneg _)] at hI + change ENNReal.ofReal (∫ y, coulombKernel (x-y)*f y) = + ∫⁻ y, ENNReal.ofReal ‖x-y‖⁻¹*ENNReal.ofReal (f y) at hI + rw [← hI, ← hmass, ← ENNReal.ofReal_mul (inv_nonneg.mpr (norm_nonneg _))] at H + change ENNReal.ofReal (∫ y, coulombKernel (x-y)*f y) = + ENNReal.ofReal (coulombKernel x * ∫ y, f y) at H + have H' := congrArg ENNReal.toReal H + simpa only [ENNReal.toReal_ofReal (integral_nonneg hp), + ENNReal.toReal_ofReal (mul_nonneg (coulombKernel_nonneg x) (integral_nonneg hf0))] using H' + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/MinimizerMidpointControl.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/MinimizerMidpointControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..542d888e2a538a93133f3a6647602597b6adbeeb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/MinimizerMidpointControl.lean @@ -0,0 +1,83 @@ +import Mathlib + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma exists_minimizer_of_midpoint_control {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] [CompleteSpace E] {S : Set E} (hS : IsClosed S) (hne : S.Nonempty) + (hm : ∀ f ∈ S, ∀ g ∈ S, (1/2:ℝ) • (f+g) ∈ S) + {J : E → ℝ} (hJ : Continuous J) (hb : BddBelow (J '' S)) + (hconv : ∀ f ∈ S, ∀ g ∈ S, J ((1/2:ℝ) • (f+g)) ≤ (J f+J g)/2) + (hR : ∀ a : ℝ, ∃ R : ℝ, 0 < R ∧ ∀ f ∈ S, J f ≤ a → ‖f‖ ≤ R) + (hgap : ∀ R : ℝ, 0 < R → ∃ C : ℝ, 0 < C ∧ + ∀ f ∈ S, ∀ g ∈ S, ‖f‖ ≤ R → ‖g‖ ≤ R → + ‖f-g‖^(5/3:ℝ) ≤ C * ((J f+J g)/2 - J ((1/2:ℝ) • (f+g)))^(5/6:ℝ)) : + ∃ f ∈ S, ∀ g ∈ S, J f ≤ J g := by + let I := sInf (J '' S) + obtain ⟨u, hu, hulim, huS⟩ := exists_seq_tendsto_sInf (hne.image J) hb + choose f hfS hfu using huS + obtain ⟨R,hR0,hRb⟩ := hR (u 0) + have hfR (n : ℕ) : ‖f n‖ ≤ R := hRb _ (hfS n) (by rw [hfu]; exact hu (Nat.zero_le n)) + obtain ⟨C,hC,hCb⟩ := hgap R hR0 + have hlow {g : E} (hg : g ∈ S) : I ≤ J g := csInf_le hb ⟨g,hg,rfl⟩ + have huI (n : ℕ) : 0 ≤ u n-I := by have := hlow (hfS n); rw [hfu] at this; linarith + have hwlim : Tendsto (fun n => C*(u n-I)^(5/6:ℝ)) atTop (𝓝 0) := by + have hl : Tendsto (fun n => u n-I) atTop (𝓝 (0:ℝ)) := by + simpa only [I,sub_self] using hulim.sub_const I + have hlr := hl.rpow_const (p := (5/6:ℝ)) (Or.inr (by norm_num)) + simpa using hlr.const_mul C + have hcauchy : CauchySeq f := by + rw [Metric.cauchySeq_iff] + intro ε hε + have hεp : 0 < ε^(5/3:ℝ) := Real.rpow_pos_of_pos hε _ + obtain ⟨N,hN⟩ := eventually_atTop.mp (hwlim.eventually (gt_mem_nhds hεp)) + refine ⟨N,fun m hm' n hn' => ?_⟩ + have hmid := hlow (hm _ (hfS m) _ (hfS n)) + have hg0 : 0 ≤ (J (f m)+J (f n))/2-J ((1/2:ℝ) • (f m+f n)) := by + exact sub_nonneg.mpr (hconv _ (hfS m) _ (hfS n)) + have hgup : (J (f m)+J (f n))/2-J ((1/2:ℝ) • (f m+f n)) ≤ u N-I := by + have hum := hu hm' + have hun := hu hn' + rw [← hfu m] at hum + rw [← hfu n] at hun + linarith + have H := (hCb _ (hfS m) _ (hfS n) (hfR m) (hfR n)).trans + (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow hg0 hgup (by norm_num : (0:ℝ)≤5/6)) hC.le) + have Hlt := H.trans_lt (hN N le_rfl) + have hd : ‖f m-f n‖ < ε := (Real.rpow_lt_rpow_iff (norm_nonneg _) hε.le (by norm_num : (0:ℝ)<5/3)).mp Hlt + simpa only [dist_eq_norm] using hd + obtain ⟨g,hg⟩ := cauchySeq_tendsto_of_complete hcauchy + have hgS : g ∈ S := hS.mem_of_tendsto hg (Eventually.of_forall hfS) + have hJI : J g = I := by + apply tendsto_nhds_unique (hJ.continuousAt.tendsto.comp hg) + simpa only [Function.comp_def,hfu] using hulim + exact ⟨g,hgS,fun x hx => by rw [hJI]; exact hlow hx⟩ +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/ModulatedRealDerivativeNorm.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/ModulatedRealDerivativeNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..0feb599ad594b17eaee84af4013db7428cfcd649 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/ModulatedRealDerivativeNorm.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +namespace Coulomb +lemma modulated_real_derivative_norm (G : Space → ℝ) (hG : Differentiable ℝ G) + (y p x a : Space) : + ‖fderiv ℝ (fun z : Space => Complex.exp ((2*Real.pi*inner ℝ z p : ℝ)*Complex.I) * + (G (z-y) : ℂ)) x a‖^2 = + (2*Real.pi*inner ℝ a p)^2 * G (x-y)^2 + (fderiv ℝ G (x-y) a)^2 := by + have hθ := ((Complex.ofRealCLM.hasFDerivAt.comp x + (((innerSL ℝ).flip p).hasFDerivAt.const_mul (2*Real.pi)))).mul_const Complex.I + have hq := Complex.ofRealCLM.hasFDerivAt.comp x + ((hG (x-y)).hasFDerivAt.comp x ((hasFDerivAt_id x).sub_const y)) + have H := congrArg (fun L : Space →L[ℝ] ℂ => L a) (hθ.cexp.mul hq).fderiv + have hd : fderiv ℝ (fun z : Space => Complex.exp ((2*Real.pi*inner ℝ z p : ℝ)*Complex.I) * + (G (z-y) : ℂ)) x a = + Complex.exp ((2*Real.pi*inner ℝ x p : ℝ)*Complex.I) * + ((fderiv ℝ G (x-y) a : ℂ) + (2*Real.pi*inner ℝ a p*G (x-y) : ℝ)*Complex.I) := by + calc + _ = _ := H + _ = _ := by + simp only [add_apply, smul_apply, + ContinuousLinearMap.comp_apply, Function.comp_apply, id_eq, + ContinuousLinearMap.id_apply, + Complex.ofRealCLM_apply, ContinuousLinearMap.flip_apply, innerSL_apply_apply, + smul_eq_mul, Complex.ofReal_mul, Complex.ofReal_ofNat] + ring + rw [hd, norm_mul, Complex.norm_exp] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.I_im, mul_one, + Complex.ofReal_im, Complex.I_re, mul_zero, sub_zero, Real.exp_zero, one_mul] + rw [Complex.sq_norm] + simp [Complex.normSq_apply] + ring +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NearCoulombFiveHalves.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NearCoulombFiveHalves.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f45dffb47a5dc5d22efa92e4a9884356cec74bd --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NearCoulombFiveHalves.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.TruncatedCoulomb + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +lemma density_memLp_fiveThirds (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (ht : Integrable (fun x => ρ x^(5/3:ℝ))) : MemLp ρ (5/3:ℝ≥0∞) := by + apply (integrable_norm_rpow_iff hm.aestronglyMeasurable (by norm_num : (5/3:ℝ≥0∞) ≠ 0) + (ENNReal.div_ne_top (by norm_num) (by norm_num) : (5/3:ℝ≥0∞) ≠ ⊤)).mp + simpa only [ENNReal.toReal_div,ENNReal.toReal_ofNat,Real.norm_of_nonneg (hp _)] using ht + +lemma compact_density_integrable (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (ht : Integrable (fun x => ρ x^(5/3:ℝ))) (K : Set Space) (hK : IsCompact K) + (hs : ∀ x, x ∉ K → ρ x = 0) : Integrable ρ := by + let : IsFiniteMeasure (volume.restrict K) := isFiniteMeasure_restrict.mpr hK.measure_lt_top.ne + have hLp : MemLp ρ (5/3:ℝ≥0∞) (volume.restrict K) := + (density_memLp_fiveThirds ρ hp hm ht).mono_measure Measure.restrict_le_self + have hI := hLp.integrable (by + rw [ENNReal.le_div_iff_mul_le (Or.inl (by norm_num)) (Or.inl (by norm_num))] + norm_num : (1:ℝ≥0∞) ≤ 5/3) + exact IntegrableOn.integrable_of_forall_notMem_eq_zero hI hs + +noncomputable def nearCoulombFiveHalves (x : Space) : ℝ := + (Metric.ball (0:Space) 1).indicator (fun y => coulombKernel y^(5/2:ℝ)) x + +lemma nearCoulombFiveHalves_integrable : Integrable nearCoulombFiveHalves := by + apply IntegrableOn.integrable_indicator _ measurableSet_ball + apply integrableOn_ball_of_norm_le_rpow (C := 1) (α := 5/2) (by simp [Space]) (by norm_num [Space]) + · filter_upwards [] with x + rw [Real.norm_of_nonneg (Real.rpow_nonneg (coulombKernel_nonneg x) _),one_mul] + change (‖x‖⁻¹)^(5/2:ℝ) ≤ ‖x‖^(-(5/2:ℝ)) + rw [Real.inv_rpow (norm_nonneg x),Real.rpow_neg (norm_nonneg x)] + · exact (coulombKernel_measurable.pow_const _).aestronglyMeasurable + +lemma nearCoulombFiveHalves_nonneg (x : Space) : 0 ≤ nearCoulombFiveHalves x := + Set.indicator_nonneg (fun y _ => Real.rpow_nonneg (coulombKernel_nonneg y) _) x + +lemma density_coulomb_integrand_bound (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (x y : Space) : + coulombKernel (x-y)*ρ y ≤ nearCoulombFiveHalves (x-y) + ρ y^(5/3:ℝ) + ρ y := by + by_cases h : x-y ∈ Metric.ball (0:Space) 1 + · rw [nearCoulombFiveHalves,Set.indicator_of_mem h] + have HY := Real.young_inequality_of_nonneg (coulombKernel_nonneg (x-y)) (hp y) + (show (5/2:ℝ).HolderConjugate (5/3:ℝ) from ⟨by norm_num,by norm_num,by norm_num⟩) + have H1 := Real.rpow_nonneg (coulombKernel_nonneg (x-y)) (5/2:ℝ) + have H2 := Real.rpow_nonneg (hp y) (5/3:ℝ) + linarith [hp y] + · rw [nearCoulombFiveHalves,Set.indicator_of_notMem h,zero_add] + have hn : (1:ℝ) ≤ ‖x-y‖ := by simpa [Metric.mem_ball,dist_zero_right] using h + have hk : coulombKernel (x-y) ≤ 1 := by simpa [coulombKernel] using inv_anti₀ (by norm_num : (0:ℝ)<1) hn + have H := mul_le_mul_of_nonneg_right hk (hp y) + linarith [Real.rpow_nonneg (hp y) (5/3:ℝ)] + +lemma density_coulomb_integrable (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (hi : Integrable ρ) (ht : Integrable (fun x => ρ x^(5/3:ℝ))) (x : Space) : + Integrable (fun y => coulombKernel (x-y)*ρ y) := by + apply (((nearCoulombFiveHalves_integrable.comp_sub_left x).add ht).add hi).mono' + (((coulombKernel_measurable.comp (measurable_const.sub measurable_id)).mul hm).aestronglyMeasurable) + filter_upwards [] with y + change ‖coulombKernel (x-y)*ρ y‖ ≤ nearCoulombFiveHalves (x-y) + ρ y^(5/3:ℝ) + ρ y + rw [Real.norm_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (hp y))] + exact density_coulomb_integrand_bound ρ hp x y + +lemma density_coulomb_bound (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (hi : Integrable ρ) (ht : Integrable (fun x => ρ x^(5/3:ℝ))) (x : Space) : + (∫ y, coulombKernel (x-y)*ρ y) ≤ + (∫ y, nearCoulombFiveHalves y) + (∫ y, ρ y^(5/3:ℝ)) + ∫ y, ρ y := by + calc + _ ≤ ∫ y, nearCoulombFiveHalves (x-y) + ρ y^(5/3:ℝ) + ρ y := + integral_mono (density_coulomb_integrable ρ hp hm hi ht x) + (((nearCoulombFiveHalves_integrable.comp_sub_left x).add ht).add hi) + (density_coulomb_integrand_bound ρ hp x) + _ = _ := by + have HA := integral_add ((nearCoulombFiveHalves_integrable.comp_sub_left x).add ht) hi + have HB := integral_add (nearCoulombFiveHalves_integrable.comp_sub_left x) ht + simp only [Pi.add_apply] at HA HB + rw [HA,HB,integral_sub_left_eq_self] + +lemma density_coulomb_pair_integrable (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (hi : Integrable ρ) (ht : Integrable (fun x => ρ x^(5/3:ℝ))) : + Integrable (fun xy : Space × Space => coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2)) := by + have hm' : Measurable (fun xy : Space × Space => coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2)) := + (coulombKernel_measurable.comp (measurable_fst.sub measurable_snd)).mul + ((hm.comp measurable_fst).mul (hm.comp measurable_snd)) + apply (integrable_prod_iff hm'.aestronglyMeasurable).mpr + constructor + · filter_upwards [] with x + apply ((density_coulomb_integrable ρ hp hm hi ht x).const_mul (ρ x)).congr + filter_upwards [] with y + ring + · let C := (∫ y, nearCoulombFiveHalves y) + (∫ y, ρ y^(5/3:ℝ)) + ∫ y, ρ y + apply (hi.mul_const C).mono' hm'.aestronglyMeasurable.norm.integral_prod_right' + filter_upwards [] with x + rw [Real.norm_of_nonneg (integral_nonneg (fun y => norm_nonneg _))] + have he : (∫ y, ‖coulombKernel (x-y)*(ρ x*ρ y)‖) = + ρ x*(∫ y, coulombKernel (x-y)*ρ y) := by + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with y + rw [Real.norm_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (mul_nonneg (hp _) (hp _)))] + ring + rw [he] + exact mul_le_mul_of_nonneg_left (density_coulomb_bound ρ hp hm hi ht x) (hp x) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NewtonInterior.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NewtonInterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ae76e3aef699cafd1fe3fcf1de25d50d35a05c8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NewtonInterior.lean @@ -0,0 +1,179 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.TailClosure + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +lemma radial_coulomb_lintegral_inner (F : ℝ → ℝ≥0∞) (hF : Measurable F) + {R : ℝ} (hs : ∀ s, s < R → F s=0) {x : Space} (hxR : ‖x‖ ≤ R) : + (∫⁻ y : Space, ENNReal.ofReal ‖x-y‖⁻¹*F ‖y‖)= + ∫⁻ y : Space, ENNReal.ofReal ‖y‖⁻¹*F ‖y‖ := by + by_cases hx : x=0 + · simp only [hx,zero_sub,norm_neg] + rw [radial_coulomb_lintegral F hF hx, + radial_space_lintegral (fun s => ENNReal.ofReal s⁻¹*F s) (by fun_prop)] + congr 1 + apply setLIntegral_congr_fun measurableSet_Ioi + intro s hs0 + dsimp only + by_cases hR : R ≤ s + · rw [max_eq_right (hxR.trans hR),ENNReal.ofReal_mul (sq_nonneg s),mul_assoc] + · simp only [hs s (not_le.mp hR),mul_zero] + +lemma radial_coulomb_integral_inner {f : Space → ℝ} (hf : Integrable f) + (hm : Measurable f) (hf0 : ∀ y, 0 ≤ f y) {M : ℝ} (hfM : ∀ y, f y ≤ M) + (hrad : ∀ y, f y=f (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hfs : ∀ y, ‖y‖ < R → f y=0) {x : Space} (hxR : ‖x‖ ≤ R) : + (∫ y, coulombKernel (x-y)*f y)=∫ y, coulombKernel y*f y := by + by_cases hx : x=0 + · simp only [hx,zero_sub,coulombKernel,norm_neg] + let F : ℝ → ℝ≥0∞ := fun s => if 0 ≤ s then ENNReal.ofReal (f (EuclideanSpace.single 0 s)) else 0 + have hmF : Measurable F := Measurable.ite measurableSet_Ici + ((hm.comp space_axis_continuous.measurable).ennreal_ofReal) measurable_const + have he (y : Space) : F ‖y‖=ENNReal.ofReal (f y) := by + simp only [F,ite_eq_left (norm_nonneg y),←hrad y] + have hs : ∀ s, s < R → F s=0 := by + intro s hs + by_cases hs0 : 0 ≤ s + · have HH := hfs (EuclideanSpace.single 0 s) (by simpa [Real.norm_eq_abs,abs_of_nonneg hs0] using hs) + simp only [F,ite_eq_left hs0,HH,ENNReal.ofReal_zero] + · simp only [F,ite_eq_right hs0] + have H := radial_coulomb_lintegral_inner F hmF hs hxR + simp_rw [he] at H + have hi := coulomb_convolution_integrable hf hm hf0 hfM (by norm_num : (0:ℝ) < 1) x + have hi0 := coulomb_convolution_integrable hf hm hf0 hfM (by norm_num : (0:ℝ) < 1) 0 + simp only [zero_sub,coulombKernel,norm_neg] at hi0 + change Integrable (fun y => coulombKernel y*f y) at hi0 + have hp (y : Space) : 0 ≤ coulombKernel (x-y)*f y := mul_nonneg (coulombKernel_nonneg _) (hf0 _) + have hp0 (y : Space) : 0 ≤ coulombKernel y*f y := mul_nonneg (coulombKernel_nonneg _) (hf0 _) + have hI := ofReal_integral_eq_lintegral_ofReal hi (Eventually.of_forall hp) + have hI0 := ofReal_integral_eq_lintegral_ofReal hi0 (Eventually.of_forall hp0) + simp_rw [ENNReal.ofReal_mul (coulombKernel_nonneg _)] at hI hI0 + change ENNReal.ofReal (∫ y, coulombKernel (x-y)*f y)=∫⁻ y, ENNReal.ofReal ‖x-y‖⁻¹*ENNReal.ofReal (f y) at hI + change ENNReal.ofReal (∫ y, coulombKernel y*f y)=∫⁻ y, ENNReal.ofReal ‖y‖⁻¹*ENNReal.ofReal (f y) at hI0 + rw [←hI,←hI0] at H + have H' := congrArg ENNReal.toReal H + simpa only [ENNReal.toReal_ofReal (integral_nonneg hp),ENNReal.toReal_ofReal (integral_nonneg hp0)] using H' + +end Coulomb +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +def radialShell (h : ℝ) : Set Space := Metric.ball 0 (2*h) \ Metric.ball 0 h + +def radialShellDensity (h : ℝ) : Space → ℝ := (radialShell h).indicator (fun _ => 1) + +lemma measurableSet_radialShell (h : ℝ) : MeasurableSet (radialShell h) := + measurableSet_ball.diff measurableSet_ball +lemma radialShellDensity_measurable (h : ℝ) : Measurable (radialShellDensity h) := + measurable_const.indicator (measurableSet_radialShell h) +lemma radialShellDensity_nonneg (h : ℝ) (z : Space) : 0 ≤ radialShellDensity h z := + Set.indicator_nonneg (fun _ _ => zero_le_one) z +lemma radialShellDensity_le (h : ℝ) (z : Space) : radialShellDensity h z ≤ 1 := + Set.indicator_le_self' (fun _ _ => zero_le_one) z +lemma radialShellDensity_integrable (h : ℝ) : Integrable (radialShellDensity h) := by + apply (integrable_indicator_iff (measurableSet_radialShell h)).mpr + exact integrableOn_const (C:=(1:ℝ)) (measure_ne_top_of_subset sdiff_subset measure_ball_lt_top.ne) + +lemma radialShellDensity_mass {h : ℝ} (hh : 0 < h) : + (∫ z, radialShellDensity h z)=(28*Real.pi/3)*h^3 := by + unfold radialShellDensity radialShell + rw [integral_indicator (measurableSet_ball.diff measurableSet_ball),integral_const,measureReal_restrict_apply_univ,smul_eq_mul,mul_one, + measureReal_sdiff (Metric.ball_subset_ball (by linarith)) measurableSet_ball measure_ball_lt_top.ne, + volume_real_ball_three (2*h) (by positivity),volume_real_ball_three h hh.le] + ring + +lemma radialShellDensity_radial (h : ℝ) (z : Space) : + radialShellDensity h z=radialShellDensity h (EuclideanSpace.single 0 ‖z‖) := by + simp only [radialShellDensity,radialShell,Set.indicator_apply,Set.mem_sdiff,Metric.mem_ball,dist_zero_right, + PiLp.norm_single,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg z)] + +lemma radialShellDensity_zero_inner {h : ℝ} {z : Space} (hz : ‖z‖ < h) : + radialShellDensity h z=0 := by + apply Set.indicator_of_notMem + exact fun hmem => hmem.2 (by simpa only [Metric.mem_ball,dist_zero_right] using hz) + +lemma radialShell_coulomb_integrable (h : ℝ) (x : Space) : + Integrable (fun y => coulombKernel (x-y)*radialShellDensity h y) := + coulomb_convolution_integrable (radialShellDensity_integrable h) (radialShellDensity_measurable h) + (radialShellDensity_nonneg h) (radialShellDensity_le h) (by norm_num : (0:ℝ) < 1) x + +def radialShellMoment (h : ℝ) : ℝ := ∫ y, coulombKernel y*radialShellDensity h y + +lemma radialShellMoment_integrable (h : ℝ) : + Integrable (fun y => coulombKernel y*radialShellDensity h y) := by + simpa only [zero_sub,coulombKernel,norm_neg] using radialShell_coulomb_integrable h 0 + +lemma radialShell_coulomb_inner {h : ℝ} {x : Space} (hx : ‖x‖ ≤ h) : + (∫ y, coulombKernel (x-y)*radialShellDensity h y)=radialShellMoment h := + radial_coulomb_integral_inner (radialShellDensity_integrable h) (radialShellDensity_measurable h) + (radialShellDensity_nonneg h) (radialShellDensity_le h) (radialShellDensity_radial h) + (fun _ hz => radialShellDensity_zero_inner hz) hx + +lemma radialShellMoment_lower {h : ℝ} (hh : 0 < h) : + (∫ y, radialShellDensity h y)/(2*h) ≤ radialShellMoment h := by + rw [div_eq_mul_inv,mul_comm,←integral_const_mul] + apply integral_mono ((radialShellDensity_integrable h).const_mul _) (radialShellMoment_integrable h) + intro y + by_cases hy : y∈radialShell h + · have hn : ‖y‖ < 2*h := by simpa only [Metric.mem_ball,dist_zero_right] using hy.1 + have hn0 : 0 < ‖y‖ := by + have H : h ≤ ‖y‖ := by simpa only [Metric.mem_ball,dist_zero_right,not_lt] using hy.2 + exact hh.trans_le H + exact mul_le_mul_of_nonneg_right ((inv_le_inv₀ (by positivity) hn0).mpr hn.le) (radialShellDensity_nonneg h y) + · simp only [radialShellDensity,indicator_of_notMem hy,mul_zero,le_refl] + +lemma radialShellMoment_pos {h : ℝ} (hh : 0 < h) : 0 < radialShellMoment h := by + have H := radialShellMoment_lower hh + rw [radialShellDensity_mass hh] at H + exact lt_of_lt_of_le (by positivity) H + +lemma atomicInnerField_shell_average {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) {h : ℝ} (_ : 0 < h) : + (∫ y, atomicInnerField S ψ h y*radialShellDensity h y)= + (totalCharge S-expectedPopulation ψ (Metric.ball 0 h))*radialShellMoment h := by + have hAttr : Integrable (fun y => attraction S y*radialShellDensity h y) := by + simp_rw [attraction_atomic S hatom,div_eq_mul_inv,mul_assoc] + exact (radialShellMoment_integrable h).const_mul (totalCharge S) + have hCore := restrictedCorePotential_mul_integrable ψ (A:=Metric.ball 0 h) measurableSet_ball _ (radialShellDensity_integrable h) + simp only [atomicInnerField,sub_mul] + rw [integral_sub hAttr hCore,restrictedCorePotential_fubini ψ measurableSet_ball _ (radialShellDensity_integrable h)] + have ha : (∫ y, attraction S y*radialShellDensity h y)=totalCharge S*radialShellMoment h := by + simp_rw [attraction_atomic S hatom,div_eq_mul_inv,mul_assoc] + exact integral_const_mul _ _ + rw [ha] + have hc : (∑ s : Spins n, ∑ i : Fin n, ∫ x, if position x i∈Metric.ball 0 h then + (∫ y, coulombKernel (position x i-y)*radialShellDensity h y)*‖ψ.value s x‖^2 else 0)= + expectedPopulation ψ (Metric.ball 0 h)*radialShellMoment h := by + rw [expectedPopulation] + simp only [Finset.sum_mul,←integral_mul_const] + apply Finset.sum_congr rfl; intro s hs + apply Finset.sum_congr rfl; intro i hi + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : position x i∈Metric.ball 0 h + · have hn : ‖position x i‖ ≤ h := (by simpa only [Metric.mem_ball,dist_zero_right] using hx : ‖position x i‖ < h).le + rw [ite_eq_left hx,integral_mul_const,radialShell_coulomb_inner hn,indicator_of_mem hx] + ring + · simp only [ite_eq_right hx,indicator_of_notMem hx,zero_mul] + rw [hc] + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NewtonSubmean.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NewtonSubmean.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbf28173a8a2fbe5f3ef41ee9f7ad00e73595dd9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NewtonSubmean.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.CoulombKernel +import OAI.Analysis.CoulombRadii.FieldAnalysis.FarSubmean + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +namespace Coulomb + +lemma ballCloud_coulomb_le {a M : ℝ} (ha : 0 coulombKernel ((x-y)-z)*uniformBall a M z) y] + apply integral_congr_ae + filter_upwards [] with z + change coulombKernel (x-z)*uniformBall a M (z-y) = _ + rw [show (x-y)-(z-y)=x-z by abel] + rw [he] + have H := radial_coulomb_integral_le (uniformBall_integrable a M) (uniformBall_measurable a M) + (uniformBall_nonneg ha hM) (uniformBall_le ha hM) (uniformBall_radial a M) (sub_ne_zero.mpr hxy) + simpa only [uniformBall_mass ha,mul_comm M] using H + +lemma potentialOf_ballCloud_integrable {ρ : Space → ℝ} (hi : Integrable ρ) (hm : Measurable ρ) + {a : ℝ} (ha : 0 NeutralAtom.potentialOf ρ z*ballCloud y a 1 z) := by + have H := (coulomb_pair_integrable hi hm (ballCloud_integrable a 1 y) (ballCloud_measurable a 1 y) + (fun z => by + change ‖uniformBall a 1 (z-y)‖ ≤ _ + rw [Real.norm_eq_abs,abs_of_nonneg (uniformBall_nonneg ha zero_le_one (z-y))] + exact uniformBall_le ha zero_le_one (z-y))).integral_prod_right + apply H.congr + filter_upwards [] with z + simp only [NeutralAtom.potentialOf,←integral_mul_const] + apply integral_congr_ae + filter_upwards [] with x + change ρ x*ballCloud y a 1 z*coulombKernel (x-z) = coulombKernel (z-x)*ρ x*ballCloud y a 1 z + rw [coulombKernel_sub_comm x z] + ring + +lemma potentialOf_ballCloud_le {ρ : Space → ℝ} (hi : Integrable ρ) (hm : Measurable ρ) + (hp : ∀ x, 0≤ρ x) {a : ℝ} (ha : 0 coulombKernel (y-x)*ρ x)) : + (∫ z, NeutralAtom.potentialOf ρ z*ballCloud y a 1 z) ≤ NeutralAtom.potentialOf ρ y := by + have H := coulomb_pair_integrable hi hm (ballCloud_integrable a 1 y) (ballCloud_measurable a 1 y) + (fun z => by + change ‖uniformBall a 1 (z-y)‖ ≤ _ + rw [Real.norm_eq_abs,abs_of_nonneg (uniformBall_nonneg ha zero_le_one (z-y))] + exact uniformBall_le ha zero_le_one (z-y)) + have he : (∫ z, NeutralAtom.potentialOf ρ z*ballCloud y a 1 z) = + ∫ x, ∫ z, ρ x*ballCloud y a 1 z*coulombKernel (x-z) := by + rw [integral_integral_swap H] + apply integral_congr_ae + filter_upwards [] with z + simp only [NeutralAtom.potentialOf,←integral_mul_const] + apply integral_congr_ae + filter_upwards [] with x + change coulombKernel (z-x)*ρ x*ballCloud y a 1 z = ρ x*ballCloud y a 1 z*coulombKernel (x-z) + rw [coulombKernel_sub_comm z x] + ring + rw [he] + apply integral_mono_ae H.integral_prod_left hK + filter_upwards [volume.ae_ne y] with x hxy + have hh := mul_le_mul_of_nonneg_left (ballCloud_coulomb_le ha zero_le_one y x hxy) (hp x) + simpa only [←integral_const_mul,one_mul,coulombKernel_sub_comm y x,mul_left_comm,mul_comm,mul_assoc] using hh + +lemma screenedPotential_ballCloud_submean {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {A : Set Space} (hu : SpatiallySupported u A) + {ρ : Space → ℝ} (hi : Integrable ρ) (hm : Measurable ρ) (hp : ∀ x, 0≤ρ x) + {a : ℝ} (ha : 0 coulombKernel (y-x)*ρ x)) : + coreScreenedField S u y-NeutralAtom.potentialOf ρ y ≤ + ∫ z, (coreScreenedField S u z-NeutralAtom.potentialOf ρ z)*ballCloud y a 1 z := by + have hc : Integrable (fun z => coreScreenedField S u z*ballCloud y a 1 z) := by + apply ((attraction_ballCloud_integrable S ha y).sub + (coreCoulombPotential_mul_integrable u _ (ballCloud_integrable a 1 y))).congr + filter_upwards [] with z + change attraction S z*ballCloud y a 1 z-coreCoulombPotential u z*ballCloud y a 1 z = _ + rw [coreScreenedField,sub_mul] + simp_rw [sub_mul] + rw [integral_sub hc (potentialOf_ballCloud_integrable hi hm ha y), + coreScreenedField_ballCloud S u hu ha zero_le_one y hcore hnuc,one_mul] + linarith [potentialOf_ballCloud_le hi hm hp ha y hK] + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +namespace Coulomb + +lemma closedBall_ae_ball (y : Space) (a : ℝ) : + Metric.closedBall y a =ᵐ[volume] Metric.ball y a := by + filter_upwards [(measure_eq_zero_iff_ae_notMem).mp (Measure.addHaar_sphere volume y a)] with x hx + apply propext + simp only [Metric.mem_closedBall,Metric.mem_ball,Metric.mem_sphere] at * + exact ⟨fun h => lt_of_le_of_ne h hx,le_of_lt⟩ + +lemma integral_ballCloud (F : Space → ℝ) (y : Space) (a : ℝ) : + (∫ x, F x*ballCloud y a 1 x) = + (4*Real.pi/3*a^3)⁻¹*(∫ x in Metric.closedBall y a, F x) := by + have he : (fun x => F x*ballCloud y a 1 x) = + (Metric.ball y a).indicator (fun x => F x*(4*Real.pi/3*a^3)⁻¹) := by + funext x + have hd : x-y∈Metric.ball (0:Space) a ↔ x∈Metric.ball y a := by + simp only [Metric.mem_ball,dist_eq_norm,sub_zero] + by_cases hx : x∈Metric.ball y a + · simp only [ballCloud,uniformBall,indicator_of_mem hx,indicator_of_mem (hd.mpr hx),one_div] + · simp only [ballCloud,uniformBall,indicator_of_notMem hx,indicator_of_notMem (not_congr hd |>.mpr hx),mul_zero] + rw [he,integral_indicator measurableSet_ball,integral_mul_const, + ←setIntegral_congr_set (closedBall_ae_ball y a),mul_comm] + +lemma integral_closedBall_affine (F : Space → ℝ) (y : Space) {a : ℝ} (ha : 0 F (y+a • x)) z := by + have hz : y+a • z∈Metric.closedBall y (a*r) ↔ z∈Metric.closedBall (0:Space) r := by + simp only [Metric.mem_closedBall,dist_eq_norm,add_sub_cancel_left,norm_smul, + Real.norm_eq_abs,abs_of_pos ha,sub_zero] + exact mul_le_mul_iff_right₀ ha + by_cases h : z∈Metric.closedBall (0:Space) r + · simp only [g,indicator_of_mem h,indicator_of_mem (hz.mpr h)] + · simp only [g,indicator_of_notMem h,indicator_of_notMem (not_congr hz |>.mpr h)] + have hh := Measure.integral_comp_smul_of_nonneg volume (fun x => g (y+x)) a (hR:=ha.le) + simp only [Space,finrank_euclideanSpace_fin,smul_eq_mul] at hh + simp_rw [he] at hh + rw [integral_indicator measurableSet_closedBall,integral_add_left_eq_self] at hh + simpa only [g,integral_indicator measurableSet_closedBall] using hh + +lemma volume_closedBall_three (y : Space) {r : ℝ} (hr : 0≤r) : + volume.real (Metric.closedBall y r) = 4*Real.pi/3*r^3 := by + rw [Measure.addHaar_real_closedBall_eq_addHaar_real_ball, + Measure.addHaar_real_ball_center,volume_real_ball_three r hr] + +lemma submean_affine {F : Space → ℝ} (y : Space) {a : ℝ} (ha : 0 first | rfl | field_simp [ha.ne'] + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NormSqSumCosets.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NormSqSumCosets.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d1ff61e8f9a82d3c4e13c767d0b9dc4d6c46981 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/NormSqSumCosets.lean @@ -0,0 +1,245 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PermuteJoinBlock + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +namespace Coulomb +lemma norm_sq_sum_cosets {G : Type*} [Group G] [Fintype G] + (H : Subgroup G) (f : G → ℂ) + (hc : ∀ p q, conj (f p)*f q = if p⁻¹*q ∈ H then ((‖f p‖^2 : ℝ) : ℂ) else 0) : + ‖∑ p, f p‖^2 = (Fintype.card H : ℝ)*∑ p, ‖f p‖^2 := by + apply Complex.ofReal_injective + push_cast + rw [← Complex.conj_mul', map_sum, Finset.sum_mul] + simp_rw [Finset.mul_sum, hc] + have hi (p : G) : + (∑ q : G, if p⁻¹*q ∈ H then ((‖f p‖^2 : ℝ) : ℂ) else (0:ℂ)) = + (Fintype.card H : ℂ)*(‖f p‖^2 : ℝ) := by + rw [← Equiv.sum_comp (Equiv.mulLeft p)] + change (∑ r : G, if p⁻¹*(p*r) ∈ H then ((‖f p‖^2 : ℝ) : ℂ) else 0) = _ + simp only [inv_mul_cancel_left] + rw [← Finset.sum_filter] + simp [Fintype.card_subtype] + simp_rw [hi] + push_cast + rfl + +lemma signed_coset_correlation {G : Type*} [Group G] [Fintype G] + (χ : G →* ℂ) (hχ : ∀ p, χ p*χ p = 1) (hχr : ∀ p, conj (χ p) = χ p) + (H : Subgroup G) (f : G → ℂ) + (hc : ∀ p h, h ∈ H → f (p*h) = χ h*f p) + (hz : ∀ p q, p⁻¹*q ∉ H → conj (f p)*f q = 0) (p q : G) : + conj (χ p*f p)*(χ q*f q) = + if p⁻¹*q ∈ H then ((‖χ p*f p‖^2 : ℝ) : ℂ) else 0 := by + by_cases h : p⁻¹*q ∈ H + · rw [ite_eq_left h] + have hq : q = p*(p⁻¹*q) := by group + have hf := hc p (p⁻¹*q) h + rw [← hq] at hf + rw [hf] + conv_lhs => arg 2; arg 1; rw [hq, map_mul] + have he : χ p * χ (p⁻¹*q) * (χ (p⁻¹*q)*f p) = χ p*f p := by + rw [mul_assoc, ← mul_assoc (χ (p⁻¹*q)), hχ, one_mul] + rw [he, Complex.conj_mul'] + push_cast + rfl + · rw [ite_eq_right h, map_mul, hχr] + calc + _ = χ p*χ q*(conj (f p)*f q) := by ring + _ = 0 := by rw [hz p q h, mul_zero] + +lemma norm_sq_signed_sum_cosets {G : Type*} [Group G] [Fintype G] + (χ : G →* ℂ) (hχ : ∀ p, χ p*χ p = 1) (hχr : ∀ p, conj (χ p) = χ p) + (H : Subgroup G) (f : G → ℂ) + (hc : ∀ p h, h ∈ H → f (p*h) = χ h*f p) + (hz : ∀ p q, p⁻¹*q ∉ H → conj (f p)*f q = 0) : + ‖∑ p, χ p*f p‖^2 = (Fintype.card H : ℝ)*∑ p, ‖f p‖^2 := by + rw [norm_sq_sum_cosets H (fun p => χ p*f p) + (signed_coset_correlation χ hχ hχr H f hc hz)] + congr 1 + apply Finset.sum_congr rfl + intro p _ + have hn : ‖χ p‖^2 = 1 := by + have H := congrArg norm (hχ p) + simpa [norm_mul, pow_two] using H + rw [norm_mul, mul_pow, hn, one_mul] +lemma permutation_mul_value {n : ℕ} (u : H1Vector n) (p q : Equiv.Perm (Fin n)) + (s : Spins n) (x : Configuration n) : + (u.permutation (p*q)).value s x = ((u.permutation q).permutation p).value s x := by + simp only [permutation_value, permute_mul] + rfl +lemma permutation_mul_gradient {n : ℕ} (u : H1Vector n) (p q : Equiv.Perm (Fin n)) + (s : Spins n) (a : Fin n × Fin 3) (x : Configuration n) : + (u.permutation (p*q)).gradient s a x = ((u.permutation q).permutation p).gradient s a x := by + simp only [permutation_gradient, permute_mul] + rfl + +lemma permutation_value_covariance {n : ℕ} (u : H1Vector n) (h : Equiv.Perm (Fin n)) + (c : ℂ) (hc : ∀ s, (u.permutation h).value s =ᵐ[volume] fun x => c*u.value s x) + (p : Equiv.Perm (Fin n)) (s : Spins n) : + (u.permutation (p*h)).value s =ᵐ[volume] fun x => c*(u.permutation p).value s x := by + have H := (permute_measurePreserving p).quasiMeasurePreserving.ae (hc (s ∘ p)) + filter_upwards [H] with x hx + rw [permutation_mul_value, permutation_value, permutation_value] + exact hx + +lemma permutation_gradient_covariance {n : ℕ} (u : H1Vector n) (h : Equiv.Perm (Fin n)) + (c : ℂ) (hc : ∀ s, (u.permutation h).value s =ᵐ[volume] fun x => c*u.value s x) + (p : Equiv.Perm (Fin n)) (s : Spins n) (a : Fin n × Fin 3) : + (u.permutation (p*h)).gradient s a =ᵐ[volume] + fun x => c*(u.permutation p).gradient s a x := by + have hg := H1Vector.gradient_congr_ae (u.permutation h) (u.scale c) hc + (s ∘ p) (p.symm a.1,a.2) + have H := (permute_measurePreserving p).quasiMeasurePreserving.ae hg + filter_upwards [H] with x hx + rw [permutation_mul_gradient] + simpa only [permutation_gradient, H1Vector.scale] using hx + +def complexSign (n : ℕ) : Equiv.Perm (Fin n) →* ℂ where + toFun := fun p => ((p.sign : ℤ) : ℂ) + map_one' := by simp + map_mul' := by intro p q; simp + +lemma complexSign_sq {n : ℕ} (p : Equiv.Perm (Fin n)) : complexSign n p*complexSign n p = 1 := + sign_complex_sq p +lemma complexSign_real {n : ℕ} (p : Equiv.Perm (Fin n)) : conj (complexSign n p) = complexSign n p := by + simp [complexSign] + +lemma fullAntisymmetrize_gradient {n : ℕ} (u : H1Vector n) (s : Spins n) + (a : Fin n × Fin 3) (x : Configuration n) : + u.fullAntisymmetrize.gradient s a x = + ∑ p : Equiv.Perm (Fin n), complexSign n p*(u.permutation p).gradient s a x := rfl + +lemma separated_fullAntisymmetrize_value_sq {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) (A B : Set Space) + (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) (hAB : Disjoint A B) + (s : Spins (m+k)) : + ∀ᵐ x ∂volume, ‖(u.tensor v).fullAntisymmetrize.value s x‖^2 = + (Fintype.card (blockGroup m k) : ℝ)* + ∑ p : Equiv.Perm (Fin (m+k)), ‖((u.tensor v).permutation p).value s x‖^2 := by + have hc : ∀ᵐ x ∂volume, ∀ p : Equiv.Perm (Fin (m+k)), ∀ h : Equiv.Perm (Fin (m+k)), + h ∈ blockGroup m k → + ((u.tensor v).permutation (p*h)).value s x = + complexSign (m+k) h*((u.tensor v).permutation p).value s x := by + apply ae_all_iff.2 + intro p + apply ae_all_iff.2 + intro h + by_cases hh : h ∈ blockGroup m k + · exact (permutation_value_covariance (u.tensor v) h _ + (tensor_block_covariance u v hu hv h hh) p s).mono (fun x hx _ => hx) + · exact Filter.Eventually.of_forall (fun x h => (hh h).elim) + have hz : ∀ᵐ x ∂volume, ∀ p q : Equiv.Perm (Fin (m+k)), p⁻¹*q ∉ blockGroup m k → + conj (((u.tensor v).permutation p).value s x)*((u.tensor v).permutation q).value s x = 0 := by + apply ae_all_iff.2 + intro p + apply ae_all_iff.2 + intro q + by_cases h : p⁻¹*q ∈ blockGroup m k + · exact Filter.Eventually.of_forall (fun x hn => (hn h).elim) + · exact (configSupported_value_orthogonal (u.tensor v) (blockRegion m k A B) + (tensor_configSupported u v A B hsu hsv) p q + (blockRegion_orbit_disjoint hAB p q h) s).mono (fun x hx _ => hx) + filter_upwards [hc,hz] with x hx hy + change ‖∑ p : Equiv.Perm (Fin (m+k)), complexSign (m+k) p* + ((u.tensor v).permutation p).value s x‖^2 = _ + exact norm_sq_signed_sum_cosets (complexSign (m+k)) complexSign_sq complexSign_real + (blockGroup m k) (fun p => ((u.tensor v).permutation p).value s x) hx hy + +lemma separated_fullAntisymmetrize_gradient_sq {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) (A B : Set Space) + (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) + (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) + (s : Spins (m+k)) (a : Fin (m+k) × Fin 3) : + ∀ᵐ x ∂volume, ‖(u.tensor v).fullAntisymmetrize.gradient s a x‖^2 = + (Fintype.card (blockGroup m k) : ℝ)* + ∑ p : Equiv.Perm (Fin (m+k)), ‖((u.tensor v).permutation p).gradient s a x‖^2 := by + have hc : ∀ᵐ x ∂volume, ∀ p : Equiv.Perm (Fin (m+k)), ∀ h : Equiv.Perm (Fin (m+k)), + h ∈ blockGroup m k → + ((u.tensor v).permutation (p*h)).gradient s a x = + complexSign (m+k) h*((u.tensor v).permutation p).gradient s a x := by + apply ae_all_iff.2 + intro p + apply ae_all_iff.2 + intro h + by_cases hh : h ∈ blockGroup m k + · exact (permutation_gradient_covariance (u.tensor v) h _ + (tensor_block_covariance u v hu hv h hh) p s a).mono (fun x hx _ => hx) + · exact Filter.Eventually.of_forall (fun x h => (hh h).elim) + have hz : ∀ᵐ x ∂volume, ∀ p q : Equiv.Perm (Fin (m+k)), p⁻¹*q ∉ blockGroup m k → + conj (((u.tensor v).permutation p).gradient s a x)*((u.tensor v).permutation q).gradient s a x = 0 := by + apply ae_all_iff.2 + intro p + apply ae_all_iff.2 + intro q + by_cases h : p⁻¹*q ∈ blockGroup m k + · exact Filter.Eventually.of_forall (fun x hn => (hn h).elim) + · exact (configSupported_gradient_orthogonal (u.tensor v) (blockRegion m k A B) + (tensor_configSupported u v A B hsu hsv) (isClosed_blockRegion hA hB) p q + (blockRegion_orbit_disjoint hAB p q h) s a).mono (fun x hx _ => hx) + filter_upwards [hc,hz] with x hx hy + rw [fullAntisymmetrize_gradient] + exact norm_sq_signed_sum_cosets (complexSign (m+k)) complexSign_sq complexSign_real + (blockGroup m k) (fun p => ((u.tensor v).permutation p).gradient s a x) hx hy +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Occupancy.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Occupancy.lean new file mode 100644 index 0000000000000000000000000000000000000000..fb689e2c11b87e7de8308dfa331f1838425ceac3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Occupancy.lean @@ -0,0 +1,206 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.OrbitalKernel + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +noncomputable def occupancy (b : Bool) : ℝ := if b then 1 else 0 +noncomputable def bernoulliWeight {ι : Type*} [Fintype ι] (lam : ι → ℝ) (w : ι → Bool) : ℝ := + ∏ i, if w i then lam i else 1-lam i +lemma bernoulliWeight_nonneg {ι : Type*} [Fintype ι] (lam : ι → ℝ) + (hl : ∀ i, 0 ≤ lam i) (hu : ∀ i, lam i ≤ 1) (w : ι → Bool) : + 0 ≤ bernoulliWeight lam w := by + apply Finset.prod_nonneg + intro i _ + split_ifs + · exact hl i + · exact sub_nonneg.mpr (hu i) +lemma bernoulli_product_mean {ι : Type*} [Fintype ι] (lam : ι → ℝ) (f : ι → Bool → ℝ) : + (∑ w : ι → Bool, bernoulliWeight lam w * ∏ i, f i (w i)) = + ∏ i, ((1-lam i)*f i false+lam i*f i true) := by + simp only [bernoulliWeight,←Finset.prod_mul_distrib] + rw [←Fintype.prod_sum (fun i b => (if b then lam i else 1-lam i)*f i b)] + apply Finset.prod_congr rfl + intro i _ + simp [add_comm] +lemma bernoulliWeight_sum {ι : Type*} [Fintype ι] (lam : ι → ℝ) : + ∑ w : ι → Bool, bernoulliWeight lam w = 1 := by + simpa using bernoulli_product_mean lam (fun _ _ => 1) +lemma bernoulli_forced_mean {ι : Type*} [Fintype ι] (lam : ι → ℝ) (s : Finset ι) : + (∑ w : ι → Bool, bernoulliWeight lam w * ∏ i ∈ s,occupancy (w i)) = ∏ i ∈ s,lam i := by + have he (w : ι → Bool) : (∏ i ∈ s,occupancy (w i)) = ∏ i,if i ∈ s then occupancy (w i) else 1 := by + rw [Finset.prod_ite] + simp + simp_rw [he] + rw [bernoulli_product_mean lam (fun i b => if i ∈ s then occupancy b else 1)] + have hp (i : ι) : (1-lam i)*(if i ∈ s then occupancy false else 1)+ + lam i*(if i ∈ s then occupancy true else 1) = if i ∈ s then lam i else 1 := by + by_cases hs : i ∈ s <;> simp [hs,occupancy] + simp_rw [hp] + rw [Finset.prod_ite] + simp +lemma bernoulli_one_mean {ι : Type*} [Fintype ι] (lam : ι → ℝ) (i : ι) : + (∑ w : ι → Bool,bernoulliWeight lam w*occupancy (w i)) = lam i := by + simpa using bernoulli_forced_mean lam {i} +lemma bernoulli_two_mean {ι : Type*} [Fintype ι] (lam : ι → ℝ) {i j : ι} (hij : i ≠ j) : + (∑ w : ι → Bool,bernoulliWeight lam w*(occupancy (w i)*occupancy (w j))) = lam i*lam j := by + simpa [hij] using bernoulli_forced_mean lam {i,j} +lemma bernoulli_linear_mean {ι : Type*} [Fintype ι] (lam a : ι → ℝ) : + (∑ w : ι → Bool,bernoulliWeight lam w*(∑ i,occupancy (w i)*a i)) = ∑ i,lam i*a i := by + simp only [Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + simp only [←mul_assoc,←Finset.sum_mul,bernoulli_one_mean] +lemma bernoulli_pair_mean {ι : Type*} [Fintype ι] (lam : ι → ℝ) (d : ι → ι → ℝ) + (hd : ∀ i, d i i = 0) : + (∑ w : ι → Bool,bernoulliWeight lam w*(∑ i,∑ j,occupancy (w i)*occupancy (w j)*d i j)) = + ∑ i,∑ j,lam i*lam j*d i j := by + simp only [Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + by_cases hij : i=j + · subst j; simp [hd] + · calc + _ = (∑ w : ι → Bool,bernoulliWeight lam w*(occupancy (w i)*occupancy (w j)))*d i j := by + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro w _ + ring + _ = _ := by rw [bernoulli_two_mean lam hij] + +noncomputable def occupiedIndex {ι : Type*} [Fintype ι] (w : ι → Bool) : + Fin (Fintype.card {i // w i = true}) ↪ ι := + (Fintype.equivFin {i // w i = true}).symm.toEmbedding.trans (Function.Embedding.subtype _) + +lemma sum_occupiedIndex {ι R : Type*} [Fintype ι] [AddCommMonoid R] + (w : ι → Bool) (f : ι → R) : + (∑ a, f (occupiedIndex w a)) = ∑ i, if w i then f i else 0 := by + classical + rw [show (∑ a, f (occupiedIndex w a)) = ∑ a : {i // w i = true}, f a by + exact Equiv.sum_comp (Fintype.equivFin {i // w i = true}).symm (fun a => f a)] + rw [← Finset.sum_subtype (Finset.univ.filter (fun i => w i = true)) (by simp) f, + Finset.sum_filter] + +lemma sum_occupiedIndex_real {ι : Type*} [Fintype ι] (w : ι → Bool) (f : ι → ℝ) : + (∑ a, f (occupiedIndex w a)) = ∑ i, occupancy (w i) * f i := by + rw [sum_occupiedIndex] + apply Finset.sum_congr rfl + intro i _ + cases w i <;> simp [occupancy] + +noncomputable def slaterPairEntry {A ι : Type*} [MeasurableSpace A] (μ : Measure A) + (v : ι → A → ℂ) (W : A → A → ℝ) (i j : ι) : ℝ := + (∫ xy : A × A, (W xy.1 xy.2 : ℂ) * + ((star (v i xy.1)*v i xy.1)*(star (v j xy.2)*v j xy.2)) ∂(μ.prod μ)).re - + (∫ xy : A × A, (W xy.1 xy.2 : ℂ) * + ((star (v i xy.1)*v j xy.1)*(star (v j xy.2)*v i xy.2)) ∂(μ.prod μ)).re + +lemma slaterPairEntry_self {A ι : Type*} [MeasurableSpace A] (μ : Measure A) + (v : ι → A → ℂ) (W : A → A → ℝ) (i : ι) : slaterPairEntry μ v W i i = 0 := by + simp [slaterPairEntry] + +lemma slaterWave_two_body_exact {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (W : A → A → ℝ) + (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x)*v b x ∂μ) = if a = b then (1:ℂ) else 0) + (hW : ∀ a b c d, Integrable (fun xy : A × A => (W xy.1 xy.2 : ℂ) * + ((star (v a xy.1)*v c xy.1)*(star (v b xy.2)*v d xy.2))) (μ.prod μ)) : + (∫ x : Fin n → A, (∑ i, ∑ j ∈ Finset.univ.erase i, W (x i) (x j)) * + ‖slaterWave v x‖^2 ∂(Measure.pi fun _ => μ)) = ∑ i, ∑ j, slaterPairEntry μ v W i j := by + have H := determinant_two_body_integral v (fun x y => (W x y : ℂ)) hv ho hW + simp only [complex_star_mul_self, ← Complex.ofReal_sum, ← Complex.ofReal_mul, + integral_complex_ofReal] at H + have HR := congrArg Complex.re H + simp only [Complex.ofReal_re, Complex.mul_re, Complex.natCast_re, Complex.natCast_im, + zero_mul, sub_zero, Complex.re_sum, Complex.sub_re] at HR + have hn : (0:ℝ) < n.factorial := Nat.cast_pos.mpr (Nat.factorial_pos n) + have he (x : Fin n → A) : (∑ i, ∑ j ∈ Finset.univ.erase i, W (x i) (x j)) * + ‖slaterWave v x‖^2 = (n.factorial : ℝ)⁻¹ * + ((∑ i, ∑ j ∈ Finset.univ.erase i, W (x i) (x j)) * ‖determinantWave v x‖^2) := by + simp only [slaterWave, norm_mul, mul_pow, norm_inv, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Real.sqrt_nonneg _), inv_pow, Real.sq_sqrt hn.le] + ring + simp_rw [he] + rw [integral_const_mul, HR, ← mul_assoc, inv_mul_cancel₀ hn.ne', one_mul] + simp only [slaterPairEntry, complex_star_mul_self, ← Complex.ofReal_mul, + integral_complex_ofReal, Complex.ofReal_re] + +lemma bernoulli_slater_pair_mean {A ι : Type*} [MeasurableSpace A] [Fintype ι] + {μ : Measure A} [SigmaFinite μ] (v : ι → A → ℂ) (W : A → A → ℝ) + (lam : ι → ℝ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x)*v b x ∂μ) = if a = b then (1:ℂ) else 0) + (hW : ∀ a b c d, Integrable (fun xy : A × A => (W xy.1 xy.2 : ℂ) * + ((star (v a xy.1)*v c xy.1)*(star (v b xy.2)*v d xy.2))) (μ.prod μ)) : + (∑ w : ι → Bool, bernoulliWeight lam w * + (∫ x : Fin (Fintype.card {i // w i = true}) → A, + (∑ i, ∑ j ∈ Finset.univ.erase i, W (x i) (x j)) * + ‖slaterWave (fun a => v (occupiedIndex w a)) x‖^2 ∂(Measure.pi fun _ => μ))) = + ∑ i, ∑ j, lam i * lam j * slaterPairEntry μ v W i j := by + classical + have he (w : ι → Bool) := slaterWave_two_body_exact + (fun a => v (occupiedIndex w a)) W (fun a => hv _) (fun a b => by + simp only [ho, (occupiedIndex w).injective.eq_iff]) + (fun a b c d => hW _ _ _ _) + simp_rw [he] + have hs (w : ι → Bool) : + (∑ a, ∑ b, slaterPairEntry μ (fun a => v (occupiedIndex w a)) W a b) = + ∑ i, ∑ j, occupancy (w i)*occupancy (w j)*slaterPairEntry μ v W i j := by + change (∑ a, ∑ b, slaterPairEntry μ v W (occupiedIndex w a) (occupiedIndex w b)) = _ + rw [sum_occupiedIndex_real w (fun i => ∑ b, slaterPairEntry μ v W i (occupiedIndex w b))] + simp_rw [sum_occupiedIndex_real, Finset.mul_sum, mul_assoc] + simp_rw [hs] + exact bernoulli_pair_mean lam _ (slaterPairEntry_self μ v W) +end Coulomb + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/OuterJoinConfiguration.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/OuterJoinConfiguration.lean new file mode 100644 index 0000000000000000000000000000000000000000..845cfd6e79e991e98df2a09e4aa3856a0c7c3c45 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/OuterJoinConfiguration.lean @@ -0,0 +1,546 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.RetainedFinePower + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def outerJoinConfiguration (m k : ℕ) : + (Configuration m × Configuration k) ≃L[ℝ] Configuration (k+m) := + (ContinuousLinearEquiv.prodComm ℝ (Configuration m) (Configuration k)).trans + (joinConfiguration k m) +lemma outerJoinConfiguration_apply (m k : ℕ) (x : Configuration m) (y : Configuration k) : + outerJoinConfiguration m k (x,y) = joinConfiguration k m (y,x) := rfl +lemma outerJoinConfiguration_measurePreserving (m k : ℕ) : + MeasurePreserving (outerJoinConfiguration m k).toHomeomorph.toMeasurableEquiv + (volume.prod volume) volume := + (joinConfiguration_measurePreserving k m).comp Measure.measurePreserving_swap +lemma outerJoinConfiguration_right_single (m k : ℕ) (a : Fin k × Fin 3) : + outerJoinConfiguration m k (0, EuclideanSpace.single a 1) = + EuclideanSpace.single (Fin.castAdd m a.1,a.2) 1 := by + ext ⟨i,b⟩ + refine Fin.addCases ?_ ?_ i + · intro j + rw [outerJoinConfiguration_apply, joinConfiguration_left] + simp [PiLp.single_apply, Prod.ext_iff] + · intro j + rw [outerJoinConfiguration_apply, joinConfiguration_right] + simp only [PiLp.single_apply, PiLp.zero_apply, Prod.mk.injEq] + split_ifs with h + · have := congrArg (fun z : Fin (k+m) => z.val) h.1 + simp only [Fin.val_castAdd, Fin.val_natAdd] at this + omega + · rfl +abbrev outerAppend {m k : ℕ} (s : Spins m) (t : Spins k) : Spins (k+m) := Fin.append t s +noncomputable def outerAppendEquiv (m k : ℕ) : Spins m × Spins k ≃ Spins (k+m) := + (Equiv.prodComm _ _).trans (Fin.appendEquiv k m) +noncomputable def outerPerm (m : ℕ) {k : ℕ} (p : Equiv.Perm (Fin k)) : + Equiv.Perm (Fin (k+m)) := + finSumFinEquiv.permCongr (Equiv.sumCongr p (Equiv.refl (Fin m))) +lemma outerPerm_left (m : ℕ) {k : ℕ} (p : Equiv.Perm (Fin k)) (i : Fin k) : + outerPerm m p (Fin.castAdd m i) = Fin.castAdd m (p i) := by simp [outerPerm] +lemma outerPerm_right (m : ℕ) {k : ℕ} (p : Equiv.Perm (Fin k)) (i : Fin m) : + outerPerm m p (Fin.natAdd k i) = Fin.natAdd k i := by simp [outerPerm] +lemma outerPerm_sign (m : ℕ) {k : ℕ} (p : Equiv.Perm (Fin k)) : + (outerPerm m p).sign = p.sign := by simp [outerPerm, Equiv.Perm.sign_sumCongr] +lemma append_outerPerm {m k : ℕ} (s : Spins m) (t : Spins k) (p : Equiv.Perm (Fin k)) : + outerAppend s t ∘ outerPerm m p = outerAppend s (t ∘ p) := by + funext i + refine Fin.addCases ?_ ?_ i + · intro j; simp [outerAppend, outerPerm_left] + · intro j; simp [outerAppend, outerPerm_right] +lemma permute_outer_join {m k : ℕ} (p : Equiv.Perm (Fin k)) (x : Configuration m) + (y : Configuration k) : + permute (outerPerm m p) (outerJoinConfiguration m k (x,y)) = + outerJoinConfiguration m k (x, permute p y) := by + rw [outerJoinConfiguration_apply, outerJoinConfiguration_apply] + ext ⟨i,b⟩ + refine Fin.addCases ?_ ?_ i + · intro j + change joinConfiguration k m (y,x) (outerPerm m p (Fin.castAdd m j),b) = _ + rw [outerPerm_left, joinConfiguration_left, joinConfiguration_left] + rfl + · intro j + change joinConfiguration k m (y,x) (outerPerm m p (Fin.natAdd k j),b) = _ + rw [outerPerm_right, joinConfiguration_right, joinConfiguration_right] +lemma H1Vector.weak_partial_outerJoin {m k : ℕ} (ψ : H1Vector (k+m)) + (s : Spins (k+m)) (a : Fin k × Fin 3) : + ∀ (η : Configuration m × Configuration k → ℝ), ContDiff ℝ (⊤ : ℕ∞) η → + HasCompactSupport η → + (∫ z, ψ.value s (outerJoinConfiguration m k z) * + (fderiv ℝ η z (0, EuclideanSpace.single a 1) : ℂ) ∂(volume.prod volume)) = + -(∫ z, ψ.gradient s (Fin.castAdd m a.1, a.2) (outerJoinConfiguration m k z) * + (η z : ℂ) ∂(volume.prod volume)) := by + apply weak_directional_change (outerJoinConfiguration m k) (outerJoinConfiguration_measurePreserving m k) + (0, EuclideanSpace.single a 1) + rw [outerJoinConfiguration_right_single] + exact ψ.weak_partial s (Fin.castAdd m a.1, a.2) + +lemma H1Vector.outer_slices_H1 {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) : + ∀ᵐ x ∂(volume : Measure (Configuration m)), + (∀ t : Spins k, MemLp (fun y => ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y))) 2 volume) ∧ + (∀ (t : Spins k) (a : Fin k × Fin 3), + MemLp (fun y => ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) + (outerJoinConfiguration m k (x,y))) 2 volume ∧ + ∀ (φ : Configuration k → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ y, ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y)) * + (fderiv ℝ φ y (EuclideanSpace.single a 1) : ℂ)) = + -(∫ y, ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) + (outerJoinConfiguration m k (x,y)) * (φ y : ℂ))) := by + have hV (t : Spins k) := (ψ.value_L2 (outerAppend s t)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k) + have hG (t : Spins k) (a : Fin k × Fin 3) := + (ψ.partial_L2 (outerAppend s t) (Fin.castAdd m a.1,a.2)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k) + have hval : ∀ᵐ x ∂(volume : Measure (Configuration m)), + ∀ t : Spins k, MemLp (fun y => ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y))) 2 volume := + ae_all_iff.mpr (fun t => memLp_fiber_ae + (f := fun z : Configuration m × Configuration k => + ψ.value (outerAppend s t) (outerJoinConfiguration m k z)) (hV t)) + have hgrad := fun (t : Spins k) (a : Fin k × Fin 3) => + weak_slice (hV t) (hG t a) (EuclideanSpace.single a 1) + (ψ.weak_partial_outerJoin (outerAppend s t) a) + have hall := ae_all_iff.mpr (fun t => ae_all_iff.mpr (hgrad t)) + filter_upwards [hval, hall] with x hx hall + exact ⟨hx, fun t a => (hall t a).2⟩ + +def H1Vector.OuterSliceRegular {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + (x : Configuration m) : Prop := + (∀ t : Spins k, MemLp (fun y => ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y))) 2 volume) ∧ + (∀ (t : Spins k) (a : Fin k × Fin 3), + MemLp (fun y => ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) + (outerJoinConfiguration m k (x,y))) 2 volume ∧ + ∀ (φ : Configuration k → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ y, ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y)) * + (fderiv ℝ φ y (EuclideanSpace.single a 1) : ℂ)) = + -(∫ y, ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) + (outerJoinConfiguration m k (x,y)) * (φ y : ℂ))) + +lemma H1Vector.outerSliceRegular_ae {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) : + ∀ᵐ x ∂volume, ψ.OuterSliceRegular s x := ψ.outer_slices_H1 s + +noncomputable def H1Vector.outerSlice {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + (x : Configuration m) : H1Vector k := by + classical + exact if h : ψ.OuterSliceRegular s x then + { value := fun t y => ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y)) + gradient := fun t a y => ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) + (outerJoinConfiguration m k (x,y)) + value_L2 := h.1 + partial_L2 := fun t a => (h.2 t a).1 + weak_partial := fun t a => (h.2 t a).2 } + else H1Vector.zero k + +lemma H1Vector.outerSlice_value {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + {x : Configuration m} (hx : ψ.OuterSliceRegular s x) (t : Spins k) (y : Configuration k) : + (ψ.outerSlice s x).value t y = ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y)) := by + simp [H1Vector.outerSlice, hx] + +lemma H1Vector.outerSlice_gradient {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + {x : Configuration m} (hx : ψ.OuterSliceRegular s x) (t : Spins k) (a : Fin k × Fin 3) + (y : Configuration k) : + (ψ.outerSlice s x).gradient t a y = + ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) (outerJoinConfiguration m k (x,y)) := by + simp [H1Vector.outerSlice, hx] + +lemma mass_outerSlice_ae {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) : + (fun x => mass (ψ.outerSlice s x)) =ᵐ[volume] + fun x => ∑ t : Spins k, ∫ y, ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y))‖^2 := by + filter_upwards [ψ.outerSliceRegular_ae s] with x hx + simp only [mass, ψ.outerSlice_value s hx] + +lemma mass_outerSlice_integrable {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) : + Integrable (fun x => mass (ψ.outerSlice s x)) := by + apply Integrable.congr _ (mass_outerSlice_ae ψ s).symm + apply integrable_finsetSum + intro t _ + have h := ((ψ.value_L2 (outerAppend s t)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k)).integrable_norm_pow (p := 2) (by decide) + exact h.integral_prod_left + +lemma integral_mass_outerSlice {m k : ℕ} (ψ : H1Vector (k+m)) : + (∑ s : Spins m, ∫ x, mass (ψ.outerSlice s x)) = mass ψ := by + calc + _ = ∑ s : Spins m, ∑ t : Spins k, ∫ z, ‖ψ.value (outerAppend s t) z‖^2 := by + apply Finset.sum_congr rfl + intro s _ + rw [integral_congr_ae (mass_outerSlice_ae ψ s), integral_finsetSum] + · apply Finset.sum_congr rfl + intro t _ + have h := ((ψ.value_L2 (outerAppend s t)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k)).integrable_norm_pow (p := 2) (by decide) + change Integrable (fun z : Configuration m × Configuration k => + ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k z)‖^2) (volume.prod volume) at h + rw [← integral_prod _ h] + exact (outerJoinConfiguration_measurePreserving m k).integral_comp' + (fun z => ‖ψ.value (outerAppend s t) z‖^2) + · intro t _ + exact (((ψ.value_L2 (outerAppend s t)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k)).integrable_norm_pow + (p := 2) (by decide)).integral_prod_left + _ = mass ψ := by + rw [← Fintype.sum_prod_type (f := fun st : Spins m × Spins k => + ∫ z, ‖ψ.value (outerAppend st.1 st.2) z‖^2)] + exact Fintype.sum_equiv (outerAppendEquiv m k) _ _ (fun _ => rfl) + +lemma H1Vector.outerSlice_antisymmetric {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + (hψ : ∀ (p : Equiv.Perm (Fin k)) (t : Spins k), + ∀ᵐ z ∂volume, ψ.value (outerAppend s t ∘ outerPerm m p) (permute (outerPerm m p) z) = + (((outerPerm m p).sign : ℤ) : ℂ) * ψ.value (outerAppend s t) z) : + ∀ᵐ x ∂volume, Antisymmetric (ψ.outerSlice s x) := by + have h (p : Equiv.Perm (Fin k)) (t : Spins k) := + Measure.ae_ae_of_ae_prod ((outerJoinConfiguration_measurePreserving m k).quasiMeasurePreserving.ae (hψ p t)) + have hall := ae_all_iff.mpr (fun p => ae_all_iff.mpr (h p)) + filter_upwards [ψ.outerSliceRegular_ae s, hall] with x hx hxA + intro p t + filter_upwards [hxA p t] with y hy + change ψ.value (outerAppend s t ∘ outerPerm m p) + (permute (outerPerm m p) (outerJoinConfiguration m k (x,y))) = + (((outerPerm m p).sign : ℤ) : ℂ) * ψ.value (outerAppend s t) + (outerJoinConfiguration m k (x,y)) at hy + simpa only [ψ.outerSlice_value s hx, append_outerPerm, outerPerm_sign, permute_outer_join] using hy + +lemma Antisymmetric.outerSlice {m k : ℕ} {ψ : H1Vector (k+m)} (hψ : Antisymmetric ψ) + (s : Spins m) : ∀ᵐ x ∂volume, Antisymmetric (ψ.outerSlice s x) := + ψ.outerSlice_antisymmetric s (fun p t => hψ (outerPerm m p) (outerAppend s t)) + +lemma kinetic_outerSlice_ae {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) : + (fun x => kinetic (ψ.outerSlice s x)) =ᵐ[volume] + fun x => (1/2 : ℝ) * ∑ t : Spins k, ∑ a : Fin k × Fin 3, + ∫ y, ‖ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) + (outerJoinConfiguration m k (x,y))‖^2 := by + filter_upwards [ψ.outerSliceRegular_ae s] with x hx + simp only [kinetic, ψ.outerSlice_gradient s hx] + +lemma kinetic_outerSlice_integrable {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) : + Integrable (fun x => kinetic (ψ.outerSlice s x)) := by + apply Integrable.congr _ (kinetic_outerSlice_ae ψ s).symm + apply Integrable.const_mul + apply integrable_finsetSum + intro t _ + apply integrable_finsetSum + intro a _ + exact (((ψ.partial_L2 (outerAppend s t) (Fin.castAdd m a.1,a.2)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k)).integrable_norm_pow (p := 2) (by decide)).integral_prod_left + +lemma integral_kinetic_outerSlice {m k : ℕ} (ψ : H1Vector (k+m)) : + (∑ s : Spins m, ∫ x, kinetic (ψ.outerSlice s x)) = + (1/2 : ℝ) * ∑ st : Spins (k+m), ∑ a : Fin k × Fin 3, + ∫ z, ‖ψ.gradient st (Fin.castAdd m a.1,a.2) z‖^2 := by + have hs (s : Spins m) : (∫ x, kinetic (ψ.outerSlice s x)) = + (1/2 : ℝ) * ∑ t : Spins k, ∑ a : Fin k × Fin 3, + ∫ z, ‖ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) z‖^2 := by + rw [integral_congr_ae (kinetic_outerSlice_ae ψ s), integral_const_mul] + congr 1 + have hi (t : Spins k) (a : Fin k × Fin 3) : + Integrable (fun z : Configuration m × Configuration k => + ‖ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) (outerJoinConfiguration m k z)‖^2) + (volume.prod volume) := + ((ψ.partial_L2 (outerAppend s t) (Fin.castAdd m a.1,a.2)).comp_measurePreserving + (outerJoinConfiguration_measurePreserving m k)).integrable_norm_pow (p := 2) (by decide) + rw [integral_finsetSum _ (fun t _ => integrable_finsetSum _ (fun a _ => (hi t a).integral_prod_left))] + apply Finset.sum_congr rfl + intro t _ + rw [integral_finsetSum _ (fun a _ => (hi t a).integral_prod_left)] + apply Finset.sum_congr rfl + intro a _ + rw [← integral_prod _ (hi t a)] + exact (outerJoinConfiguration_measurePreserving m k).integral_comp' + (fun z => ‖ψ.gradient (outerAppend s t) (Fin.castAdd m a.1,a.2) z‖^2) + simp_rw [hs] + rw [← Finset.mul_sum, ← Fintype.sum_prod_type (f := fun st : Spins m × Spins k => + ∑ a : Fin k × Fin 3, ∫ z, ‖ψ.gradient (outerAppend st.1 st.2) (Fin.castAdd m a.1,a.2) z‖^2)] + congr 1 + exact Fintype.sum_equiv (outerAppendEquiv m k) _ _ (fun _ => rfl) + +lemma potentialForm_outerSlice_ae {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + (V : Configuration k → ℝ) : + (fun x => potentialForm V (ψ.outerSlice s x)) =ᵐ[volume] + fun x => ∑ t : Spins k, ∫ y, V y * ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k (x,y))‖^2 := by + filter_upwards [ψ.outerSliceRegular_ae s] with x hx + simp only [potentialForm, ψ.outerSlice_value s hx] + +lemma potentialForm_outerSlice_integrable {m k : ℕ} (ψ : H1Vector (k+m)) (s : Spins m) + (V : Configuration k → ℝ) + (hV : ∀ t : Spins k, Integrable (fun z => V ((outerJoinConfiguration m k).symm z).2 * + ‖ψ.value (outerAppend s t) z‖^2)) : + Integrable (fun x => potentialForm V (ψ.outerSlice s x)) := by + apply Integrable.congr _ (potentialForm_outerSlice_ae ψ s V).symm + apply integrable_finsetSum + intro t _ + have H := ((outerJoinConfiguration_measurePreserving m k).integrable_comp_emb + (outerJoinConfiguration m k).toHomeomorph.toMeasurableEquiv.measurableEmbedding).mpr (hV t) + have H' : Integrable (fun z : Configuration m × Configuration k => + V z.2 * ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k z)‖^2) (volume.prod volume) := by + change Integrable (fun z : Configuration m × Configuration k => + V ((outerJoinConfiguration m k).symm (outerJoinConfiguration m k z)).2 * + ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k z)‖^2) (volume.prod volume) at H + simpa only [ContinuousLinearEquiv.symm_apply_apply] using H + exact H'.integral_prod_left + +lemma integral_potentialForm_outerSlice {m k : ℕ} (ψ : H1Vector (k+m)) + (V : Configuration k → ℝ) + (hV : ∀ st : Spins (k+m), Integrable (fun z => V ((outerJoinConfiguration m k).symm z).2 * + ‖ψ.value st z‖^2)) : + (∑ s : Spins m, ∫ x, potentialForm V (ψ.outerSlice s x)) = + ∑ st : Spins (k+m), ∫ z, V ((outerJoinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2 := by + have hs (s : Spins m) : (∫ x, potentialForm V (ψ.outerSlice s x)) = + ∑ t : Spins k, ∫ z, V ((outerJoinConfiguration m k).symm z).2 * ‖ψ.value (outerAppend s t) z‖^2 := by + rw [integral_congr_ae (potentialForm_outerSlice_ae ψ s V)] + have hi (t : Spins k) : Integrable (fun z : Configuration m × Configuration k => + V z.2 * ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k z)‖^2) (volume.prod volume) := by + have H := ((outerJoinConfiguration_measurePreserving m k).integrable_comp_emb + (outerJoinConfiguration m k).toHomeomorph.toMeasurableEquiv.measurableEmbedding).mpr + (hV (outerAppend s t)) + change Integrable (fun z : Configuration m × Configuration k => + V ((outerJoinConfiguration m k).symm (outerJoinConfiguration m k z)).2 * + ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k z)‖^2) (volume.prod volume) at H + simpa only [ContinuousLinearEquiv.symm_apply_apply] using H + rw [integral_finsetSum _ (fun t _ => (hi t).integral_prod_left)] + apply Finset.sum_congr rfl + intro t _ + rw [← integral_prod _ (hi t)] + have H := (outerJoinConfiguration_measurePreserving m k).integral_comp' + (fun z => V ((outerJoinConfiguration m k).symm z).2 * ‖ψ.value (outerAppend s t) z‖^2) + change (∫ z : Configuration m × Configuration k, + V ((outerJoinConfiguration m k).symm (outerJoinConfiguration m k z)).2 * + ‖ψ.value (outerAppend s t) (outerJoinConfiguration m k z)‖^2 ∂volume.prod volume) = _ at H + simpa only [ContinuousLinearEquiv.symm_apply_apply] using H + simp_rw [hs] + rw [← Fintype.sum_prod_type (f := fun st : Spins m × Spins k => + ∫ z, V ((outerJoinConfiguration m k).symm z).2 * ‖ψ.value (outerAppend st.1 st.2) z‖^2)] + exact Fintype.sum_equiv (outerAppendEquiv m k) _ _ (fun _ => rfl) + +lemma outerJoinConfiguration_symm_snd (m k : ℕ) (z : Configuration (k+m)) : + ((outerJoinConfiguration m k).symm z).2 = ((joinConfiguration k m).symm z).1 := rfl +lemma outer_finePower_integrable {m k : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration k → Finset (Fin k)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (ψ : H1Vector (k+m)) (st : Spins (k+m)) : + Integrable (fun z => retainedFinePower b r ((outerJoinConfiguration m k).symm z).2 * + ‖ψ.value st z‖^2) := by + have hw : Integrable (fun z => ‖ψ.value st z‖^2) := + (ψ.value_L2 st).integrable_norm_pow (p:=2) (by decide) + apply (hw.const_mul (((k:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*k)).mono' + · exact ((retainedFinePower_measurable b r hr).comp + (measurable_snd.comp (outerJoinConfiguration m k).symm.continuous.measurable)).aestronglyMeasurable.mul hw.aestronglyMeasurable + · exact Eventually.of_forall fun z => by + rw [Real.norm_of_nonneg (mul_nonneg (retainedFinePower_nonneg ..) (sq_nonneg _))] + exact mul_le_mul_of_nonneg_right (retainedFinePower_bound hb r _) (sq_nonneg _) + +theorem outer_block_retained_fine_kinetic_lower {m k : ℕ} (ψ : H1Vector (k+m)) + (hψ : ∀ (s : Spins m) (p : Equiv.Perm (Fin k)) (t : Spins k), + ∀ᵐ z ∂volume, ψ.value (outerAppend s t ∘ outerPerm m p) (permute (outerPerm m p) z) = + (((outerPerm m p).sign : ℤ) : ℂ) * ψ.value (outerAppend s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration k → Finset (Fin k)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * potentialForm + (fun z => retainedFinePower b r ((outerJoinConfiguration m k).symm z).2) ψ - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (k:ℝ)^(4/3:ℝ)) * mass ψ ≤ outerKinetic (m:=k) (k:=m) ψ := by + let C := (b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (k:ℝ)^(4/3:ℝ) + have hs (s : Spins m) : + thomasFermiCoefficient * (∫ x, potentialForm (retainedFinePower b r) (ψ.outerSlice s x)) - + C * (∫ x, mass (ψ.outerSlice s x)) ≤ ∫ x, kinetic (ψ.outerSlice s x) := by + rw [←integral_const_mul, ←integral_const_mul, + ←integral_sub ((potentialForm_outerSlice_integrable ψ s _ (fun t => outer_finePower_integrable hb r hr ψ (outerAppend s t))).const_mul _) + ((mass_outerSlice_integrable ψ s).const_mul C)] + apply integral_mono_ae + (((potentialForm_outerSlice_integrable ψ s _ (fun t => outer_finePower_integrable hb r hr ψ (outerAppend s t))).const_mul _).sub + ((mass_outerSlice_integrable ψ s).const_mul C)) (kinetic_outerSlice_integrable ψ s) + exact (ψ.outerSlice_antisymmetric s (hψ s)).mono fun x hx => + retained_fine_kinetic_lower_all (ψ.outerSlice s x) hx hb r hr + have H := Finset.sum_le_sum (s:=Finset.univ) (fun s _ => hs s) + simp only [Finset.sum_sub_distrib, ←Finset.mul_sum] at H + rw [integral_potentialForm_outerSlice ψ _ (outer_finePower_integrable hb r hr ψ), + integral_mass_outerSlice, integral_kinetic_outerSlice] at H + exact H +lemma ae_outer_block_position_injective (m k : ℕ) : + ∀ᵐ z : Configuration (k+m), Function.Injective (position ((outerJoinConfiguration m k).symm z).2) := by + filter_upwards [ae_position_injective (k+m)] with z hz + intro i j hij + have h : Fin.castAdd m i = Fin.castAdd m j := hz (by simpa only [outerJoinConfiguration_symm_snd, position_split_left] using hij) + exact Fin.ext (congrArg (fun z : Fin (k+m) => z.val) h) + +lemma ae_outer_fine_pair_bound {m k : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration k → Finset (Fin k)) : + ∀ᵐ z : Configuration (k+m), + retainedFineCoulomb b r ((outerJoinConfiguration m k).symm z).2 ≤ + pairPotential ((outerJoinConfiguration m k).symm z).2 + ((2*Real.pi+1)/(2*b))*k := by + filter_upwards [ae_outer_block_position_injective m k] with z hz + have h := retained_fine_pair_lower hb (r ((outerJoinConfiguration m k).symm z).2) + (position ((outerJoinConfiguration m k).symm z).2) hz + have hc : ((r ((outerJoinConfiguration m k).symm z).2).card : ℝ) ≤ k := by + exact_mod_cast (show (r ((outerJoinConfiguration m k).symm z).2).card ≤ k by simpa using Finset.card_le_univ (r ((outerJoinConfiguration m k).symm z).2)) + have hC : 0 ≤ (2*Real.pi+1)/(2*b) := by positivity + have hh := mul_le_mul_of_nonneg_left hc hC + change retainedFineCoulomb b r ((outerJoinConfiguration m k).symm z).2 - + ((2*Real.pi+1)/(2*b))*(r ((outerJoinConfiguration m k).symm z).2).card ≤ + pairPotential ((outerJoinConfiguration m k).symm z).2 at h + linarith + +lemma outer_fineCoulomb_integrable {m k : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration k → Finset (Fin k)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (ψ : H1Vector (k+m)) (st : Spins (k+m)) : + Integrable (fun z => retainedFineCoulomb b r ((outerJoinConfiguration m k).symm z).2 * + ‖ψ.value st z‖^2) := by + have hw : Integrable (fun z => ‖ψ.value st z‖^2) := + (ψ.value_L2 st).integrable_norm_pow (p:=2) (by decide) + apply ((ψ.outer_pair_integrable st).add (hw.const_mul (((2*Real.pi+1)/(2*b))*k))).mono' + · exact ((retainedFineCoulomb_measurable b r hr).comp + (measurable_snd.comp (outerJoinConfiguration m k).symm.continuous.measurable)).aestronglyMeasurable.mul hw.aestronglyMeasurable + · filter_upwards [ae_outer_fine_pair_bound (m:=m) hb r] with z hz + rw [Real.norm_of_nonneg (mul_nonneg (retainedFineCoulomb_nonneg ..) (sq_nonneg _))] + simpa only [add_mul, Pi.add_apply, outerJoinConfiguration_symm_snd] using mul_le_mul_of_nonneg_right hz (sq_nonneg ‖ψ.value st z‖) + +theorem outer_block_retained_fine_pair_lower {m k : ℕ} (ψ : H1Vector (k+m)) + {b : ℝ} (hb : 0 < b) (r : Configuration k → Finset (Fin k)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + potentialForm (fun z => retainedFineCoulomb b r ((outerJoinConfiguration m k).symm z).2) ψ - + (((2*Real.pi+1)/(2*b))*k)*mass ψ ≤ + potentialForm (fun z => pairPotential ((outerJoinConfiguration m k).symm z).2) ψ := + sub_le_iff_le_add.mpr (potentialForm_le_add_const ψ (outer_fineCoulomb_integrable hb r hr ψ) + ψ.outer_pair_integrable (ae_outer_fine_pair_bound hb r)) + +theorem outer_block_retained_fine_energy_lower {m k : ℕ} (ψ : H1Vector (k+m)) + (hψ : ∀ (s : Spins m) (p : Equiv.Perm (Fin k)) (t : Spins k), + ∀ᵐ z ∂volume, ψ.value (outerAppend s t ∘ outerPerm m p) (permute (outerPerm m p) z) = + (((outerPerm m p).sign : ℤ) : ℂ) * ψ.value (outerAppend s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration k → Finset (Fin k)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * potentialForm + (fun z => retainedFinePower b r ((outerJoinConfiguration m k).symm z).2) ψ + + potentialForm (fun z => retainedFineCoulomb b r ((outerJoinConfiguration m k).symm z).2) ψ - + (((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (k:ℝ)^(4/3:ℝ)) + + ((2*Real.pi+1)/(2*b))*k)*mass ψ ≤ + outerKinetic (m:=k) (k:=m) ψ + potentialForm (fun z => pairPotential ((outerJoinConfiguration m k).symm z).2) ψ := by + have h1 := outer_block_retained_fine_kinetic_lower ψ hψ hb r hr + have h2 := outer_block_retained_fine_pair_lower ψ hb r hr + linarith +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PairRegroup.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PairRegroup.lean new file mode 100644 index 0000000000000000000000000000000000000000..703464d06f3bffc1dd5b19ffd173ff363f549f9a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PairRegroup.lean @@ -0,0 +1,94 @@ +import Mathlib + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +noncomputable def pairRegroup {A B C D : Type*} [MeasurableSpace A] [MeasurableSpace B] + [MeasurableSpace C] [MeasurableSpace D] : (A × B) × (C × D) ≃ᵐ (A × C) × (B × D) where + toFun p := ((p.1.1,p.2.1),(p.1.2,p.2.2)) + invFun p := ((p.1.1,p.2.1),(p.1.2,p.2.2)) + left_inv _ := rfl + right_inv _ := rfl + measurable_toFun := by change Measurable (fun p : (A × B) × (C × D) => ((p.1.1,p.2.1),(p.1.2,p.2.2))); fun_prop + measurable_invFun := by change Measurable (fun p : (A × C) × (B × D) => ((p.1.1,p.2.1),(p.1.2,p.2.2))); fun_prop +lemma pairRegroup_measurePreserving {A B C D : Type*} [MeasurableSpace A] [MeasurableSpace B] + [MeasurableSpace C] [MeasurableSpace D] (μa : Measure A) (μb : Measure B) + (μc : Measure C) (μd : Measure D) [SFinite μa] [SFinite μb] [SFinite μc] [SFinite μd] : + MeasurePreserving (pairRegroup : (A×B)×(C×D) ≃ᵐ (A×C)×(B×D)) + ((μa.prod μb).prod (μc.prod μd)) ((μa.prod μc).prod (μb.prod μd)) := by + have h1 := measurePreserving_prodAssoc μa μb (μc.prod μd) + have h2 := (MeasurePreserving.id μa).prod (measurePreserving_prodAssoc μb μc μd).symm + have h3 := (MeasurePreserving.id μa).prod + ((Measure.measurePreserving_swap (μ := μb) (ν := μc)).prod (MeasurePreserving.id μd)) + have h4 := (MeasurePreserving.id μa).prod (measurePreserving_prodAssoc μc μb μd) + have h5 := (measurePreserving_prodAssoc μa μc (μb.prod μd)).symm + exact h5.comp (h4.comp (h3.comp (h2.comp h1))) + +lemma integrable_finite_count_prod {S E F : Type*} [Fintype S] [MeasurableSpace S] + [MeasurableSingletonClass S] [MeasurableSpace E] [NormedAddCommGroup F] + [NormedSpace ℝ F] {μ : Measure E} (f : S × E → F) + (hf : ∀ s, Integrable (fun x => f (s,x)) μ) : Integrable f (Measure.count.prod μ) := by + rw [Measure.prod, Measure.count, + Measure.bind_sum _ _ (measurable_of_countable _).aemeasurable] + simp only [Measure.dirac_bind (measurable_of_countable _)] + refine integrable_sum_measure (fun spin => ?_) (hasSum_fintype _).summable + exact (measurableEmbedding_prodMk_left spin).integrable_map_iff.mpr (hf spin) + +lemma integral_finite_count_prod {S E F : Type*} [Fintype S] [MeasurableSpace S] + [MeasurableSingletonClass S] [MeasurableSpace E] [NormedAddCommGroup F] + [NormedSpace ℝ F] [CompleteSpace F] {μ : Measure E} [SFinite μ] (f : S × E → F) + (hf : ∀ s, Integrable (fun x => f (s,x)) μ) : + (∫ sx, f sx ∂(Measure.count.prod μ)) = ∑ s, ∫ x, f (s,x) ∂μ := by + rw [integral_prod _ (integrable_finite_count_prod f hf), integral_count] +lemma count_prod_count {S T : Type*} [Countable S] [Countable T] [MeasurableSpace S] + [MeasurableSpace T] [MeasurableSingletonClass S] [MeasurableSingletonClass T] : + (Measure.count : Measure S).prod (Measure.count : Measure T) = Measure.count := by + apply Measure.ext_of_singleton + intro st + rw [← singleton_prod_singleton, Measure.prod_prod] + simp +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PatchNegativeMean.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PatchNegativeMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..16c397d08188c5ed52433b9162a9837281578574 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PatchNegativeMean.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.CorePointMeasurable +import OAI.Analysis.CoulombRadii.Variational.WeightedNegative + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +theorem exists_patch_negative_mean_bound : + ∃ C : ℝ, 0 mass ((T.vector p).coreSlice s x)* + max (-patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0)) ∧ + (∑ p, sliceExpectation (T.vector p) (fun s x => + max (-patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0))≤ + (2*K/M)*(∑ p, sliceExpectation (T.vector p) (patchSliceTFGap S (T.vector p) ha hb ht.2 y hn))+ + (2*(C*(r/a))*(a^4)⁻¹)*T.totalMass := by + obtain ⟨C,hC,H⟩ := exists_patch_negative_center_bound + refine ⟨C,hC,?_⟩ + intro J n S T a b t r ha hb hsmall ht y hn hcs hr hra hθ χ K M hK hM hχm hχ hs hmass + let Y := fun p s x => max (-patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0 + let G := fun p s x => patchSliceTFGap S (T.vector p) ha hb ht.2 y hn s x + let A := 2*K/M + let d := 2*(C*(r/a))*(a^4)⁻¹ + have hcs' (p : T.index) (s : Spins (T.out p)) : ∀ᵐ x, + SpatiallySupported ((T.vector p).coreSlice s x).normalized {z | t≤‖z-y‖} := + ((hcs p).coreSlice s).mono (fun _ hx => hx.normalized) + have hGi (p : T.index) (s : Spins (T.out p)) : + Integrable (fun x => mass ((T.vector p).coreSlice s x)*G p s x) := + patchSliceTFGap_weight_integrable S (T.vector p) ha hb ht.2 y hn s (hcs' p s) + have hYm (p : T.index) (s : Spins (T.out p)) : AEStronglyMeasurable (Y p s) volume := + (patchTFScreenedField_slice_aestronglyMeasurable S (T.vector p) s ha hb ht.2 y hn y).neg.sup aestronglyMeasurable_const + have hY0 (p : T.index) (s : Spins (T.out p)) : ∀ᵐ x, 0≤Y p s x := + Eventually.of_forall (fun _ => le_max_right _ _) + have hbound (p : T.index) (s : Spins (T.out p)) : ∀ᵐ x, + mass ((T.vector p).coreSlice s x)≠0 → Y p s x≤A*G p s x+d := by + filter_upwards [hcs' p s,hmass p s] with x hx hm + intro hw + apply H S ((T.vector p).coreSlice s x).normalized ha hb hsmall ht y hx hn hr hra hθ x χ K M hK hM + (Eventually.of_forall hχ) _ hs (hm hw) + exact (retainedFineDensity_integrable hb _ _).mul_bdd hχm.aestronglyMeasurable + (Eventually.of_forall (fun z => by rw [Real.norm_of_nonneg (hχ z).1]; exact (hχ z).2)) + have hYi (p : T.index) (s : Spins (T.out p)) : + Integrable (fun x => mass ((T.vector p).coreSlice s x)*Y p s x) := + NeutralAtom.weighted_nonneg_integrable_of_le (mass_coreSlice_integrable (T.vector p) s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hYm p s) (hY0 p s) (hGi p s) (hbound p s) + refine ⟨hYi,?_⟩ + have hmean (p : T.index) : sliceExpectation (T.vector p) (Y p)≤ + A*sliceExpectation (T.vector p) (G p)+d*mass (T.vector p) := by + have HH := Finset.sum_le_sum (s := Finset.univ) (fun s _ => + NeutralAtom.weighted_integral_le (mass_coreSlice_integrable (T.vector p) s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hYm p s) (hY0 p s) (hGi p s) (hbound p s)) + simpa only [Finset.sum_add_distrib,←Finset.mul_sum,integral_mass_coreSlice,sliceExpectation] using HH + have HH := Finset.sum_le_sum (s := Finset.univ) (fun p _ => hmean p) + simpa only [Finset.sum_add_distrib,←Finset.mul_sum,RecordedEnsemble.totalMass,Y,G,A,d] using HH + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PatchRawTransfer.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PatchRawTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..4fa2f0b4fe9a52c5615c8568ff19b4b8d260768a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PatchRawTransfer.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.CoulombTransfer +import OAI.Analysis.CoulombRadii.Packets.FineNear + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +lemma sqrt_young (x : ℝ) (hx : 0≤x) {ε : ℝ} (hε : 0<ε) : + Real.sqrt x≤ε+x/(4*ε) := by + have h := sq_nonneg (Real.sqrt x-2*ε) + rw [sub_sq,Real.sq_sqrt hx] at h + have he : x/(4*ε)*(4*ε)=x := div_mul_cancel₀ _ (by positivity) + apply (mul_le_mul_iff_of_pos_right (show 0<4*ε by positivity)).mp + nlinarith + +theorem patch_raw_field_transfer {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + {a b t r : ℝ} (ha : 0 mul_comm _ _) + dsimp only [σ,W] at ht' heint + dsimp only at hf + rw [heint] at hf + linarith +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PermOrCompSwapOffTwo.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PermOrCompSwapOffTwo.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0fc2fed83f1febe076d03b948279e4a8ebcc97f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PermOrCompSwapOffTwo.lean @@ -0,0 +1,275 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.DeterminantWave + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma perm_eq_or_comp_swap_of_eq_off_two {α : Type*} [DecidableEq α] + (p q : Equiv.Perm α) (i j : α) (_hij : i ≠ j) + (h : ∀ k, k ≠ i → k ≠ j → p k = q k) : + q = p ∨ q = p * Equiv.swap i j := by + by_cases hi : p i = q i + · left + symm + apply perm_eq_of_eq_off p q j + intro k hkj + by_cases hki : k = i + · simpa only [hki] using hi + · exact h k hki hkj + · right + have hki : q.symm (p i) ≠ i := by + intro he + apply hi + simpa only [he] using (q.apply_symm_apply (p i)).symm + have hkj : q.symm (p i) = j := by + by_contra he + have H : p (q.symm (p i)) = p i := (h _ hki he).trans (q.apply_symm_apply _) + exact hki (p.injective H) + have hji : p i = q j := by simpa only [hkj] using (q.apply_symm_apply (p i)).symm + have hE : p = q * Equiv.swap i j := by + apply perm_eq_of_eq_off p (q * Equiv.swap i j) j + intro k hkj' + by_cases hki' : k = i + · subst k + simpa only [Equiv.Perm.mul_apply, Equiv.swap_apply_left] using hji + · simpa only [Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hki' hkj'] using h k hki' hkj' + rw [hE, mul_assoc, Equiv.swap_mul_self, mul_one] + +lemma perm_mul_swap_ne {α : Type*} [DecidableEq α] (p : Equiv.Perm α) + (i j : α) (hij : i ≠ j) : p * Equiv.swap i j ≠ p := by + intro h + have H := congrArg (fun r : Equiv.Perm α => r i) h + simp only [Equiv.Perm.mul_apply, Equiv.swap_apply_left] at H + exact hij (p.injective H).symm + +lemma permutation_second_minor {α : Type*} [Fintype α] [DecidableEq α] + (p q : Equiv.Perm α) (i j : α) (hij : i ≠ j) : + (∏ k ∈ (Finset.univ.erase i).erase j, if p k = q k then (1 : ℂ) else 0) = + (if q = p then 1 else 0) + (if q = p * Equiv.swap i j then 1 else 0) := by + by_cases h1 : q = p + · subst q + simp [Ne.symm (perm_mul_swap_ne p i j hij)] + by_cases h2 : q = p * Equiv.swap i j + · rw [ite_eq_right h1, ite_eq_left h2, zero_add] + apply Finset.prod_eq_one + intro k hk + obtain ⟨hkj,hki,_⟩ := Finset.mem_erase.mp hk |>.imp_right Finset.mem_erase.mp + simp only [h2, Equiv.Perm.mul_apply, Equiv.swap_apply_of_ne_of_ne hki hkj, ite_true] + · rw [ite_eq_right h1, ite_eq_right h2, zero_add] + obtain ⟨k,hki,hkj,hk⟩ : ∃ k, k ≠ i ∧ k ≠ j ∧ p k ≠ q k := by + by_contra he + have h := perm_eq_or_comp_swap_of_eq_off_two p q i j hij (fun k hki hkj => by + by_contra hk + exact he ⟨k,hki,hkj,hk⟩) + exact h.elim h1 h2 + exact Finset.prod_eq_zero (Finset.mem_erase.mpr ⟨hkj,Finset.mem_erase.mpr ⟨hki,Finset.mem_univ _⟩⟩) + (ite_eq_right hk) + +lemma sign_star_mul_swap {n : ℕ} (p : Equiv.Perm (Fin n)) (i j : Fin n) (hij : i ≠ j) : + star (((p.sign : ℤ) : ℂ)) * ((((p * Equiv.swap i j).sign : ℤ) : ℂ)) = -1 := by + rw [map_mul, Equiv.Perm.sign_swap hij] + simp only [Units.val_mul, Units.val_neg, Units.val_one, Int.cast_mul, Int.cast_neg, + Int.cast_one, ← mul_assoc, sign_star_mul, one_mul] + +lemma pair_minor_trace {n : ℕ} (K : Fin n → Fin n → Fin n → Fin n → ℂ) + (p : Equiv.Perm (Fin n)) (i j : Fin n) (hij : i ≠ j) : + (∑ q : Equiv.Perm (Fin n), star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + (K (p i) (p j) (q i) (q j) * + ∏ k ∈ (Finset.univ.erase i).erase j, if p k = q k then (1:ℂ) else 0)) = + K (p i) (p j) (p i) (p j) - K (p i) (p j) (p j) (p i) := by + simp_rw [permutation_second_minor p _ i j hij, mul_add, Finset.sum_add_distrib] + have h1 : (∑ q : Equiv.Perm (Fin n), star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + (K (p i) (p j) (q i) (q j) * (if q = p then 1 else 0))) = K (p i) (p j) (p i) (p j) := by + rw [Finset.sum_eq_single p] + · simp only [ite_true, mul_one, sign_star_mul, one_mul] + · intro q _ hq + simp only [ite_eq_right hq, mul_zero] + · simp + have h2 : (∑ q : Equiv.Perm (Fin n), star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + (K (p i) (p j) (q i) (q j) * (if q = p * Equiv.swap i j then 1 else 0))) = + -K (p i) (p j) (p j) (p i) := by + rw [Finset.sum_eq_single (p * Equiv.swap i j)] + · simp only [ite_true, mul_one, sign_star_mul_swap p i j hij, neg_one_mul, + Equiv.Perm.mul_apply, Equiv.swap_apply_left, Equiv.swap_apply_right] + · intro q _ hq + simp only [ite_eq_right hq, mul_zero] + · simp + rw [h1,h2,sub_eq_add_neg] + +lemma pair_trace_reindex {n : ℕ} (K : Fin n → Fin n → Fin n → Fin n → ℂ) + (p : Equiv.Perm (Fin n)) : + (∑ i, ∑ j ∈ Finset.univ.erase i, + (K (p i) (p j) (p i) (p j) - K (p i) (p j) (p j) (p i))) = + ∑ i, ∑ j, (K i j i j - K i j j i) := by + have he (i : Fin n) : (∑ j ∈ Finset.univ.erase i, + (K (p i) (p j) (p i) (p j) - K (p i) (p j) (p j) (p i))) = + ∑ j, (K (p i) (p j) (p i) (p j) - K (p i) (p j) (p j) (p i)) := by + rw [Finset.sum_erase_eq_sub (Finset.mem_univ i)] + simp only [sub_self, sub_zero] + simp_rw [he] + have hi (i : Fin n) : (∑ j, (K (p i) (p j) (p i) (p j) - K (p i) (p j) (p j) (p i))) = + ∑ j, (K (p i) j (p i) j - K (p i) j j (p i)) := + Equiv.sum_comp p (fun j => K (p i) j (p i) j - K (p i) j j (p i)) + simp_rw [hi] + exact Equiv.sum_comp p (fun i => ∑ j, (K i j i j - K i j j i)) + +lemma slater_two_body_trace_algebra {n : ℕ} (K : Fin n → Fin n → Fin n → Fin n → ℂ) : + (∑ p : Equiv.Perm (Fin n), ∑ q : Equiv.Perm (Fin n), + star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + ∑ i, ∑ j ∈ Finset.univ.erase i, + K (p i) (p j) (q i) (q j) * + ∏ k ∈ (Finset.univ.erase i).erase j, if p k = q k then (1:ℂ) else 0) = + (n.factorial : ℂ) * ∑ i, ∑ j, (K i j i j - K i j j i) := by + have hp (p : Equiv.Perm (Fin n)) : + (∑ q : Equiv.Perm (Fin n), star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + ∑ i, ∑ j ∈ Finset.univ.erase i, + K (p i) (p j) (q i) (q j) * + ∏ k ∈ (Finset.univ.erase i).erase j, if p k = q k then (1:ℂ) else 0) = + ∑ i, ∑ j, (K i j i j - K i j j i) := by + simp_rw [Finset.mul_sum] + rw [Finset.sum_comm] + calc + _ = ∑ i, ∑ j ∈ Finset.univ.erase i, + (K (p i) (p j) (p i) (p j) - K (p i) (p j) (p j) (p i)) := by + apply Finset.sum_congr rfl + intro i _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j hj + exact pair_minor_trace K p i j (Finset.mem_erase.mp hj).1.symm + _ = _ := pair_trace_reindex K p + simp_rw [hp] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_perm, Fintype.card_fin, + nsmul_eq_mul] + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +noncomputable def pairIndexEquiv {I : Type*} [DecidableEq I] (i j : I) (hij : i ≠ j) : + Fin 2 ≃ {k : I // k = i ∨ k = j} where + toFun b := if b = 0 then ⟨i, Or.inl rfl⟩ else ⟨j, Or.inr rfl⟩ + invFun k := if k.1 = i then 0 else 1 + left_inv b := by fin_cases b <;> simp [Ne.symm hij] + right_inv k := by + rcases k with ⟨k,hk | hk⟩ <;> subst k <;> simp [Ne.symm hij] + +noncomputable def pairSelectedEquiv {I A : Type*} [DecidableEq I] [MeasurableSpace A] + (i j : I) (hij : i ≠ j) : ({k : I // k = i ∨ k = j} → A) ≃ᵐ (A × A) := + (MeasurableEquiv.piCongrLeft (fun _ : {k : I // k = i ∨ k = j} => A) + (pairIndexEquiv i j hij)).symm.trans MeasurableEquiv.finTwoArrow + +noncomputable def pairSplit {I A : Type*} [DecidableEq I] [MeasurableSpace A] + (i j : I) (hij : i ≠ j) : (I → A) ≃ᵐ (A × A) × ({k : I // ¬ (k = i ∨ k = j)} → A) := + (MeasurableEquiv.piEquivPiSubtypeProd (fun _ : I => A) (fun k => k = i ∨ k = j)).trans + ((pairSelectedEquiv i j hij).prodCongr (MeasurableEquiv.refl _)) + +lemma pairSplit_first {I A : Type*} [DecidableEq I] [MeasurableSpace A] + (i j : I) (hij : i ≠ j) (x : I → A) : ((pairSplit i j hij) x).1.1 = x i := by + change x ((pairIndexEquiv i j hij) 0).1 = x i + simp [pairIndexEquiv] + +lemma pairSplit_second {I A : Type*} [DecidableEq I] [MeasurableSpace A] + (i j : I) (hij : i ≠ j) (x : I → A) : ((pairSplit i j hij) x).1.2 = x j := by + change x ((pairIndexEquiv i j hij) 1).1 = x j + simp [pairIndexEquiv] + +lemma pairSplit_rest {I A : Type*} [DecidableEq I] [MeasurableSpace A] + (i j : I) (hij : i ≠ j) (x : I → A) (k : {k : I // ¬ (k = i ∨ k = j)}) : + ((pairSplit i j hij) x).2 k = x k := rfl + +lemma pairSplit_measurePreserving {I A : Type*} [Fintype I] [DecidableEq I] [MeasurableSpace A] + (μ : Measure A) [SigmaFinite μ] (i j : I) (hij : i ≠ j) : + MeasurePreserving (pairSplit (A := A) i j hij) (Measure.pi fun _ => μ) + ((μ.prod μ).prod (Measure.pi fun _ => μ)) := by + have hp : MeasurePreserving (pairSelectedEquiv (A := A) i j hij) + (Measure.pi fun _ => μ) (μ.prod μ) := + (measurePreserving_finTwoArrow μ).comp + ((measurePreserving_piCongrLeft (fun _ => μ) (pairIndexEquiv i j hij)).symm) + exact (hp.prod (MeasurePreserving.id _)).comp + (measurePreserving_piEquivPiSubtypeProd (fun _ => μ) (fun k => k = i ∨ k = j)) + +lemma prod_erase_pair {I : Type*} [Fintype I] [DecidableEq I] (i j : I) (hij : i ≠ j) + (f : I → ℂ) : + (∏ k, f k) = (f i * f j) * ∏ k : {k : I // ¬ (k = i ∨ k = j)}, f k := by + rw [← Finset.mul_prod_erase Finset.univ f (Finset.mem_univ i), + ← Finset.mul_prod_erase (Finset.univ.erase i) f (Finset.mem_erase.mpr ⟨Ne.symm hij, Finset.mem_univ j⟩), + ← mul_assoc] + congr 1 + exact Finset.prod_subtype ((Finset.univ.erase i).erase j) (fun k => by simp [and_comm]) f + +lemma pair_weight_tensor_integrable {I A : Type*} [Fintype I] [DecidableEq I] + [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] (i j : I) (hij : i ≠ j) + (f : I → A → ℂ) (w : A → A → ℂ) (hf : ∀ k, Integrable (f k) μ) + (hw : Integrable (fun ab : A × A => w ab.1 ab.2 * (f i ab.1 * f j ab.2)) (μ.prod μ)) : + Integrable (fun x : I → A => w (x i) (x j) * ∏ k, f k (x k)) (Measure.pi fun _ => μ) := by + have hR : Integrable (fun x : {k : I // ¬ (k = i ∨ k = j)} → A => ∏ k : {k : I // ¬ (k = i ∨ k = j)}, f k (x k)) + (Measure.pi fun _ => μ) := Integrable.fintype_prod (fun k => hf k) + have h := (pairSplit_measurePreserving μ i j hij).integrable_comp_of_integrable (hw.mul_prod hR) + convert h using 1 + funext x + simp only [Function.comp_apply, pairSplit_first, pairSplit_second, pairSplit_rest, + prod_erase_pair i j hij] + ring + +lemma pair_weight_tensor_integral {I A : Type*} [Fintype I] [DecidableEq I] + [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] (i j : I) (hij : i ≠ j) + (f : I → A → ℂ) (w : A → A → ℂ) : + (∫ x : I → A, w (x i) (x j) * ∏ k, f k (x k) ∂(Measure.pi fun _ => μ)) = + (∫ ab : A × A, w ab.1 ab.2 * (f i ab.1 * f j ab.2) ∂(μ.prod μ)) * + ∏ k ∈ (Finset.univ.erase i).erase j, ∫ a, f k a ∂μ := by + have he (x : I → A) : w (x i) (x j) * ∏ k, f k (x k) = + (w ((pairSplit i j hij) x).1.1 ((pairSplit i j hij) x).1.2 * + (f i ((pairSplit i j hij) x).1.1 * f j ((pairSplit i j hij) x).1.2)) * + ∏ k : {k : I // ¬ (k = i ∨ k = j)}, f k (((pairSplit i j hij) x).2 k) := by + simp only [pairSplit_first, pairSplit_second, pairSplit_rest, prod_erase_pair i j hij] + ring + simp_rw [he] + rw [(pairSplit_measurePreserving μ i j hij).integral_comp' + (fun z => (w z.1.1 z.1.2 * (f i z.1.1 * f j z.1.2)) * ∏ k : {k : I // ¬ (k = i ∨ k = j)}, f k (z.2 k)), + integral_prod_mul (fun ab : A × A => w ab.1 ab.2 * (f i ab.1 * f j ab.2)) + (fun x : {k : I // ¬ (k = i ∨ k = j)} → A => ∏ k, f k.1 (x k)), + integral_fintype_prod_eq_prod] + congr 1 + exact (Finset.prod_subtype ((Finset.univ.erase i).erase j) (fun k => by simp [and_comm]) (fun k => ∫ a, f k a ∂μ)).symm + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PermuteJoinBlock.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PermuteJoinBlock.lean new file mode 100644 index 0000000000000000000000000000000000000000..7162a05ac0ab01f1fd1a7c7d6e83a0d562f3b996 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PermuteJoinBlock.lean @@ -0,0 +1,234 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Pullback +import OAI.Analysis.CoulombRadii.FieldAnalysis.JoinSpins + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +namespace Coulomb +lemma permute_join_block {m k : ℕ} (p : Equiv.Perm (Fin m)) (q : Equiv.Perm (Fin k)) + (x : Configuration m) (y : Configuration k) : + permute (blockHom m k (p,q)) (joinConfiguration m k (x,y)) = + joinConfiguration m k (permute p x, permute q y) := by + ext ⟨i,b⟩ + refine Fin.addCases ?_ ?_ i + · intro j + change joinConfiguration m k (x,y) (blockHom m k (p,q) (Fin.castAdd k j),b) = _ + rw [blockHom_left, joinConfiguration_left, joinConfiguration_left] + rfl + · intro j + change joinConfiguration m k (x,y) (blockHom m k (p,q) (Fin.natAdd m j),b) = _ + rw [blockHom_right, joinConfiguration_right, joinConfiguration_right] + rfl + +lemma spins_block_left {m k : ℕ} (p : Equiv.Perm (Fin m)) (q : Equiv.Perm (Fin k)) + (s : Spins (m+k)) : + (s ∘ blockHom m k (p,q)) ∘ Fin.castAdd k = (s ∘ Fin.castAdd k) ∘ p := by + funext i + simp [Function.comp_def, blockHom_left] +lemma spins_block_right {m k : ℕ} (p : Equiv.Perm (Fin m)) (q : Equiv.Perm (Fin k)) + (s : Spins (m+k)) : + (s ∘ blockHom m k (p,q)) ∘ Fin.natAdd m = (s ∘ Fin.natAdd m) ∘ q := by + funext i + simp [Function.comp_def, blockHom_right] + +lemma tensor_block_covariance {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) + (h : Equiv.Perm (Fin (m+k))) (hh : h ∈ blockGroup m k) (s : Spins (m+k)) : + (u.tensor v).permutation h |>.value s =ᵐ[volume] + fun x => ((h.sign : ℤ) : ℂ)*(u.tensor v).value s x := by + rcases hh with ⟨⟨p,q⟩,rfl⟩ + have H1 : ∀ᵐ z : Configuration m × Configuration k ∂(volume.prod volume), + u.value ((s ∘ Fin.castAdd k) ∘ p) (permute p z.1) = + ((p.sign : ℤ) : ℂ)*u.value (s ∘ Fin.castAdd k) z.1 := + Measure.quasiMeasurePreserving_fst.ae (hu p (s ∘ Fin.castAdd k)) + have H2 : ∀ᵐ z : Configuration m × Configuration k ∂(volume.prod volume), + v.value ((s ∘ Fin.natAdd m) ∘ q) (permute q z.2) = + ((q.sign : ℤ) : ℂ)*v.value (s ∘ Fin.natAdd m) z.2 := + Measure.quasiMeasurePreserving_snd.ae (hv q (s ∘ Fin.natAdd m)) + have H1' := (joinConfiguration_symm_measurePreserving m k).quasiMeasurePreserving.ae H1 + have H2' := (joinConfiguration_symm_measurePreserving m k).quasiMeasurePreserving.ae H2 + filter_upwards [H1',H2'] with x hx hy + obtain ⟨⟨x,y⟩,rfl⟩ := (joinConfiguration m k).surjective x + have hez : (joinConfiguration m k).symm.toHomeomorph.toMeasurableEquiv + ((joinConfiguration m k) (x,y)) = (x,y) := + (joinConfiguration m k).symm_apply_apply (x,y) + rw [hez] at hx hy + change u.value ((s ∘ Fin.castAdd k) ∘ p) (permute p x) = + ((p.sign : ℤ) : ℂ)*u.value (s ∘ Fin.castAdd k) x at hx + change v.value ((s ∘ Fin.natAdd m) ∘ q) (permute q y) = + ((q.sign : ℤ) : ℂ)*v.value (s ∘ Fin.natAdd m) y at hy + rw [permutation_value] + change tensorValue u v (s ∘ blockHom m k (p,q)) + (permute (blockHom m k (p,q)) (joinConfiguration m k (x,y))) = + (((blockHom m k (p,q)).sign : ℤ) : ℂ)*tensorValue u v s (joinConfiguration m k (x,y)) + rw [permute_join_block, tensorValue_join, tensorValue_join, spins_block_left, + spins_block_right, blockHom_sign, hx, hy] + push_cast + ring +lemma position_join_left {m k : ℕ} (x : Configuration m) (y : Configuration k) (i : Fin m) : + position (joinConfiguration m k (x,y)) (Fin.castAdd k i) = position x i := by + ext b + exact joinConfiguration_left m k x y i b +lemma position_join_right {m k : ℕ} (x : Configuration m) (y : Configuration k) (i : Fin k) : + position (joinConfiguration m k (x,y)) (Fin.natAdd m i) = position y i := by + ext b + exact joinConfiguration_right m k x y i b + +lemma position_split_left {m k : ℕ} (x : Configuration (m+k)) (i : Fin m) : + position ((joinConfiguration m k).symm x).1 i = position x (Fin.castAdd k i) := by + obtain ⟨⟨y,z⟩,rfl⟩ := (joinConfiguration m k).surjective x + rw [ContinuousLinearEquiv.symm_apply_apply, position_join_left] +lemma position_split_right {m k : ℕ} (x : Configuration (m+k)) (i : Fin k) : + position ((joinConfiguration m k).symm x).2 i = position x (Fin.natAdd m i) := by + obtain ⟨⟨y,z⟩,rfl⟩ := (joinConfiguration m k).surjective x + rw [ContinuousLinearEquiv.symm_apply_apply, position_join_right] + +def blockRegion (m k : ℕ) (A B : Set Space) : Set (Configuration (m+k)) := + {x | (∀ i : Fin m, position x (Fin.castAdd k i) ∈ A) ∧ + (∀ j : Fin k, position x (Fin.natAdd m j) ∈ B)} + +lemma blockRegion_split {m k : ℕ} (A B : Set Space) (x : Configuration (m+k)) : + x ∈ blockRegion m k A B ↔ + ((joinConfiguration m k).symm x).1 ∈ allPositions A ∧ + ((joinConfiguration m k).symm x).2 ∈ allPositions B := by + simp only [blockRegion, allPositions, Set.mem_ofPred_eq, position_split_left, + position_split_right] + +lemma isClosed_blockRegion {m k : ℕ} {A B : Set Space} (hA : IsClosed A) (hB : IsClosed B) : + IsClosed (blockRegion m k A B) := by + have he : blockRegion m k A B = + (⋂ i : Fin m, (fun x => position x (Fin.castAdd k i)) ⁻¹' A) ∩ + (⋂ j : Fin k, (fun x => position x (Fin.natAdd m j)) ⁻¹' B) := by + ext x + simp [blockRegion] + rw [he] + exact (isClosed_iInter (fun i => hA.preimage (continuous_position _))).inter + (isClosed_iInter (fun j => hB.preimage (continuous_position _))) + +lemma tensor_configSupported {m k : ℕ} (u : H1Vector m) (v : H1Vector k) (A B : Set Space) + (hu : SpatiallySupported u A) (hv : SpatiallySupported v B) : + ConfigSupported (u.tensor v) (blockRegion m k A B) := by + intro s + have H1 : ∀ᵐ z : Configuration m × Configuration k ∂(volume.prod volume), + z.1 ∉ allPositions A → u.value (s ∘ Fin.castAdd k) z.1 = 0 := + Measure.quasiMeasurePreserving_fst.ae (hu (s ∘ Fin.castAdd k)) + have H2 : ∀ᵐ z : Configuration m × Configuration k ∂(volume.prod volume), + z.2 ∉ allPositions B → v.value (s ∘ Fin.natAdd m) z.2 = 0 := + Measure.quasiMeasurePreserving_snd.ae (hv (s ∘ Fin.natAdd m)) + have H1' := (joinConfiguration_symm_measurePreserving m k).quasiMeasurePreserving.ae H1 + have H2' := (joinConfiguration_symm_measurePreserving m k).quasiMeasurePreserving.ae H2 + filter_upwards [H1',H2'] with x hx hy + intro hn + change u.value _ _ * v.value _ _ = 0 + change ((joinConfiguration m k).symm x).1 ∉ allPositions A → + u.value (s ∘ Fin.castAdd k) ((joinConfiguration m k).symm x).1 = 0 at hx + change ((joinConfiguration m k).symm x).2 ∉ allPositions B → + v.value (s ∘ Fin.natAdd m) ((joinConfiguration m k).symm x).2 = 0 at hy + by_cases ha : ((joinConfiguration m k).symm x).1 ∈ allPositions A + · have hb : ((joinConfiguration m k).symm x).2 ∉ allPositions B := + fun h => hn ((blockRegion_split A B x).2 ⟨ha,h⟩) + rw [hy hb, mul_zero] + · rw [hx ha, zero_mul] + +lemma blockRegion_orbit_disjoint {m k : ℕ} {A B : Set Space} (hAB : Disjoint A B) + (p q : Equiv.Perm (Fin (m+k))) (hpq : p⁻¹*q ∉ blockGroup m k) + (x : Configuration (m+k)) : + ¬ (permute p x ∈ blockRegion m k A B ∧ permute q x ∈ blockRegion m k A B) := by + rcases exists_crossing_of_not_mem (p⁻¹*q) hpq with ⟨i,j,hij⟩ + intro ⟨hp,hq⟩ + have he : q (Fin.castAdd k i) = p (Fin.natAdd m j) := by + have H := congrArg p hij + simpa using H + have ha := hq.1 i + have hb := hp.2 j + rw [position_permute, he] at ha + rw [position_permute] at hb + exact Set.disjoint_left.1 hAB ha hb + +lemma configSupported_value_orthogonal {n : ℕ} (u : H1Vector n) (R : Set (Configuration n)) + (hu : ConfigSupported u R) (p q : Equiv.Perm (Fin n)) + (hR : ∀ x, ¬(permute p x ∈ R ∧ permute q x ∈ R)) (s : Spins n) : + ∀ᵐ x ∂volume, star ((u.permutation p).value s x)*(u.permutation q).value s x = 0 := by + have hp := (permute_measurePreserving p).quasiMeasurePreserving.ae (hu (s ∘ p)) + have hq := (permute_measurePreserving q).quasiMeasurePreserving.ae (hu (s ∘ q)) + filter_upwards [hp,hq] with x hx hy + rw [permutation_value, permutation_value] + by_cases hpx : permute p x ∈ R + · rw [hy (fun h => hR x ⟨hpx,h⟩), mul_zero] + · rw [hx hpx, star_zero, zero_mul] + +lemma configSupported_gradient_orthogonal {n : ℕ} (u : H1Vector n) (R : Set (Configuration n)) + (hu : ConfigSupported u R) (hclosed : IsClosed R) (p q : Equiv.Perm (Fin n)) + (hR : ∀ x, ¬(permute p x ∈ R ∧ permute q x ∈ R)) (s : Spins n) (a : Fin n × Fin 3) : + ∀ᵐ x ∂volume, star ((u.permutation p).gradient s a x)*(u.permutation q).gradient s a x = 0 := by + have hp := (permute_measurePreserving p).quasiMeasurePreserving.ae + (hu.gradient hclosed (s ∘ p) (p.symm a.1,a.2)) + have hq := (permute_measurePreserving q).quasiMeasurePreserving.ae + (hu.gradient hclosed (s ∘ q) (q.symm a.1,a.2)) + filter_upwards [hp,hq] with x hx hy + rw [permutation_gradient, permutation_gradient] + by_cases hpx : permute p x ∈ R + · rw [hy (fun h => hR x ⟨hpx,h⟩), mul_zero] + · rw [hx hpx, star_zero, zero_mul] +end Coulomb + +open scoped BigOperators ComplexConjugate + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PhaseRegion.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PhaseRegion.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad4e7e0c2afd2b9f2d0fee2ca0ca102fef241478 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PhaseRegion.lean @@ -0,0 +1,221 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +namespace Coulomb + +lemma volume_real_ball_three (r : ℝ) (hr : 0 ≤ r) : + (volume : Measure Space).real (ball 0 r) = 4*Real.pi/3*r^3 := by + rw [measureReal_def, EuclideanSpace.volume_ball_fin_three, ENNReal.toReal_mul, + ENNReal.toReal_pow, ENNReal.toReal_ofReal hr, ENNReal.toReal_ofReal (by positivity)] + ring + +lemma integral_ball_norm_sq_three (r : ℝ) (hr : 0 ≤ r) : + (∫ p : Space in ball 0 r, ‖p‖^2) = 4*Real.pi/5*r^5 := by + have he : (fun p : Space => (ball 0 r).indicator (fun p => ‖p‖^2) p) = + fun p : Space => (Iio r).indicator (fun t : ℝ => t^2) ‖p‖ := by + ext p + simp only [Set.indicator, mem_ball, dist_zero_right, mem_Iio] + rw [← integral_indicator measurableSet_ball, he, + integral_fun_norm_addHaar volume] + simp only [Space, finrank_euclideanSpace_fin, Nat.reduceSub, + nsmul_eq_mul, smul_eq_mul] + have hf : (fun t : ℝ => t^2 * (Iio r).indicator (fun s : ℝ => s^2) t) = + (Iio r).indicator (fun t : ℝ => t^4) := by + ext t + by_cases ht : t < r <;> simp [Set.indicator, ht] + ring + rw [hf, integral_indicator measurableSet_Iio, Measure.restrict_restrict measurableSet_Iio] + have hs : Iio r ∩ Ioi (0 : ℝ) = Ioo 0 r := by ext t; simp; tauto + rw [hs, ← integral_Ioc_eq_integral_Ioo, ← intervalIntegral.integral_of_le hr, + integral_pow, volume_real_ball_three 1 (by norm_num)] + norm_num + ring + +lemma integrableOn_ball_norm_sq_three (r : ℝ) : + IntegrableOn (fun p : Space => ‖p‖^2) (ball 0 r) := by + exact (continuous_norm.pow 2).continuousOn.integrableOn_compact + (isCompact_closedBall (0 : Space) r) |>.mono_set ball_subset_closedBall + +noncomputable def phaseRegion (R : Space → ℝ) : Set (Space × Space) := + {yp | ‖yp.2‖ < R yp.1} +noncomputable def phaseMeasure (R : Space → ℝ) : Measure (Space × Space) := + (volume.prod volume).restrict (phaseRegion R) +lemma phaseRegion_measurable {R : Space → ℝ} (hR : Measurable R) : + MeasurableSet (phaseRegion R) := by + exact measurableSet_lt measurable_snd.norm (hR.comp measurable_fst) +lemma phaseMeasure_le (R : Space → ℝ) : phaseMeasure R ≤ volume.prod volume := + Measure.restrict_le_self + +lemma phaseMeasure_lintegral {R : Space → ℝ} (hR : Measurable R) + (f : Space × Space → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ yp, f yp ∂phaseMeasure R) = ∫⁻ y : Space, ∫⁻ p in ball 0 (R y), f (y,p) := by + rw [phaseMeasure, ← lintegral_indicator (phaseRegion_measurable hR), + lintegral_prod _ (hf.indicator (phaseRegion_measurable hR)).aemeasurable] + apply lintegral_congr + intro y + rw [← lintegral_indicator measurableSet_ball] + apply lintegral_congr + intro p + by_cases hnorm : ‖p‖ < R y <;> simp [phaseRegion, Set.indicator, hnorm] + +lemma phaseMeasure_mass {R : Space → ℝ} (hR : Measurable R) : + phaseMeasure R univ = ∫⁻ y : Space, + ENNReal.ofReal (R y)^3 * ENNReal.ofReal (Real.pi*4/3) := by + rw [← lintegral_one, phaseMeasure_lintegral hR _ measurable_const] + simp + +lemma phaseMeasure_lintegral_momentum {R : Space → ℝ} (hR : Measurable R) + (hRp : ∀ y, 0 ≤ R y) : + (∫⁻ yp, ENNReal.ofReal (‖yp.2‖^2) ∂phaseMeasure R) = + ∫⁻ y : Space, ENNReal.ofReal (4*Real.pi/5*R y^5) := by + rw [phaseMeasure_lintegral hR _ (by fun_prop)] + apply lintegral_congr + intro y + rw [← ofReal_integral_eq_lintegral_ofReal (integrableOn_ball_norm_sq_three (R y)) + (Filter.Eventually.of_forall (fun p => sq_nonneg _)), integral_ball_norm_sq_three _ (hRp y)] + +lemma phaseMeasure_momentum_memLp {R : Space → ℝ} (hR : Measurable R) + (hRp : ∀ y, 0 ≤ R y) (hI : Integrable (fun y => R y^5)) : + MemLp (fun yp : Space × Space => yp.2) 2 (phaseMeasure R) := by + apply (memLp_two_iff_integrable_sq_norm (by fun_prop)).mpr + refine ⟨by fun_prop, ?_⟩ + rw [hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall (fun yp => sq_nonneg _)), + phaseMeasure_lintegral_momentum hR hRp, + ← ofReal_integral_eq_lintegral_ofReal (hI.const_mul (4*Real.pi/5)) + (Filter.Eventually.of_forall (fun y => mul_nonneg (by positivity) (pow_nonneg (hRp y) _)))] + exact ENNReal.ofReal_lt_top + +lemma phaseMeasure_real_momentum {R : Space → ℝ} (hR : Measurable R) + (hRp : ∀ y, 0 ≤ R y) : + (∫ yp, ‖yp.2‖^2 ∂phaseMeasure R) = 4*Real.pi/5 * ∫ y : Space, R y^5 := by + rw [integral_eq_lintegral_of_nonneg_ae (Filter.Eventually.of_forall (fun yp => sq_nonneg _)) + (by fun_prop), phaseMeasure_lintegral_momentum hR hRp, + ← integral_eq_lintegral_of_nonneg_ae + (Filter.Eventually.of_forall (fun y => mul_nonneg (by positivity) (pow_nonneg (hRp y) _))) (by fun_prop), integral_const_mul] + +noncomputable def fermiRadius (ρ : Space → ℝ) (y : Space) : ℝ := + (3/(8*Real.pi)*ρ y) ^ (1/3 : ℝ) +lemma fermiRadius_nonneg (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (y : Space) : + 0 ≤ fermiRadius ρ y := Real.rpow_nonneg (mul_nonneg (by positivity) (hρ y)) _ +lemma fermiRadius_cube (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (y : Space) : + fermiRadius ρ y ^ 3 = 3/(8*Real.pi)*ρ y := by + rw [fermiRadius, ← Real.rpow_mul_natCast (mul_nonneg (by positivity) (hρ y))] + norm_num +lemma fermiRadius_fifth (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (y : Space) : + fermiRadius ρ y ^ 5 = (3/(8*Real.pi))^(5/3 : ℝ) * ρ y^(5/3 : ℝ) := by + rw [fermiRadius, ← Real.rpow_mul_natCast (mul_nonneg (by positivity) (hρ y)), Real.mul_rpow (by positivity) (hρ y)] + norm_num +lemma fermiRadius_measurable (ρ : Space → ℝ) (hρ : Measurable ρ) : + Measurable (fermiRadius ρ) := by + unfold fermiRadius + fun_prop +lemma fermiRadius_ball_mass (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (y : Space) : + (volume : Measure Space) (ball 0 (fermiRadius ρ y)) = ENNReal.ofReal (ρ y/2) := by + rw [EuclideanSpace.volume_ball_fin_three, ← ENNReal.ofReal_pow (fermiRadius_nonneg ρ hρ y), + ← ENNReal.ofReal_mul (pow_nonneg (fermiRadius_nonneg ρ hρ y) _), fermiRadius_cube ρ hρ y] + congr 1 + field_simp + ring + +lemma fermiMeasure_mass (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (hI : Integrable ρ) : + phaseMeasure (fermiRadius ρ) univ = ENNReal.ofReal ((∫ y : Space, ρ y)/2) := by + rw [← lintegral_one, phaseMeasure_lintegral (fermiRadius_measurable ρ hm) _ measurable_const] + simp only [lintegral_one, Measure.restrict_apply_univ, fermiRadius_ball_mass ρ hρ] + rw [← ofReal_integral_eq_lintegral_ofReal (hI.div_const 2) + (Filter.Eventually.of_forall (fun y => div_nonneg (hρ y) (by norm_num))), integral_div] + +lemma fermiMeasure_finite (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (hI : Integrable ρ) : IsFiniteMeasure (phaseMeasure (fermiRadius ρ)) := by + constructor + rw [fermiMeasure_mass ρ hρ hm hI] + exact ENNReal.ofReal_lt_top + +lemma fermiMeasure_momentum_memLp (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hI : Integrable (fun y => ρ y^(5/3 : ℝ))) : + MemLp (fun yp : Space × Space => yp.2) 2 (phaseMeasure (fermiRadius ρ)) := by + apply phaseMeasure_momentum_memLp (fermiRadius_measurable ρ hm) (fermiRadius_nonneg ρ hρ) + simp only [fermiRadius_fifth ρ hρ] + exact hI.const_mul _ +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PhysicalPoisson.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PhysicalPoisson.lean new file mode 100644 index 0000000000000000000000000000000000000000..35a9b1504803f6f0e9d86efc722b94b7430dbb0e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PhysicalPoisson.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.CoulombKernel +import OAI.Analysis.CoulombRadii.Screening.CoreScreenedField + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology ContDiff +noncomputable section +namespace Coulomb + +lemma coreCoulombPotential_continuousOn {k : ℕ} (u : H1Vector k) + {A : Set Space} (hu : SpatiallySupported u A) {y : Space} {r t : ℝ} + (hrt : r ∑ s : Spins k, ∑ i : Fin k, + ∫ x, (max d ‖position x i-z‖)⁻¹*‖u.value s x‖^2 + have hG : Continuous G := by + apply continuous_finsetSum + intro s hs + apply continuous_finsetSum + intro i hi + apply MeasureTheory.continuous_of_dominated (bound := fun x => d⁻¹*‖u.value s x‖^2) + · intro z + exact (((measurable_const.max ((continuous_position i).measurable.sub measurable_const).norm).inv).aestronglyMeasurable).mul + ((u.value_L2 s).aestronglyMeasurable.norm.pow 2) + · intro z + filter_upwards [] with x + rw [Real.norm_of_nonneg (mul_nonneg (inv_nonneg.mpr (le_max_left _ _ |>.trans' hd.le)) (sq_nonneg _))] + exact mul_le_mul_of_nonneg_right (inv_anti₀ hd (le_max_left _ _)) (sq_nonneg _) + · exact ((u.value_L2 s).norm.integrable_sq).const_mul _ + · filter_upwards [] with x + exact (((continuous_const.max (continuous_const.sub continuous_id).norm).inv₀ + (fun z => ne_of_gt (hd.trans_le (le_max_left _ _)))).mul continuous_const) + apply hG.continuousOn.congr + intro z hz + unfold coreCoulombPotential G + apply Finset.sum_congr rfl + intro s hs + apply Finset.sum_congr rfl + intro i hi + apply integral_congr_ae + filter_upwards [hu s] with x hx + by_cases he : u.value s x=0 + · simp [he] + · have ha : position x i∈A := (by_contra (fun hn => he (hx hn)) : x∈allPositions A) i + have hz' : ‖z-y‖ ≤ r := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hz + have htri : ‖position x i-y‖ ≤ ‖position x i-z‖+‖z-y‖ := by + simpa only [dist_eq_norm] using dist_triangle (position x i) z y + have hdist : d ≤ ‖position x i-z‖ := by dsimp [d]; linarith [hsep _ ha] + simp only [max_eq_right hdist,coulombKernel] + +lemma coreCoulombPotential_weak_harmonic {k : ℕ} (u : H1Vector k) + {A U : Set Space} (hu : SpatiallySupported u A) (hdis : Disjoint A U) : + NeutralAtom.HasWeakLaplacian (coreCoulombPotential u) U (fun _ => 0) := by + intro φ hφ hc ht + have hi : Integrable (NeutralAtom.coordinateLaplacian φ) := + (NeutralAtom.continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top))).integrable_of_hasCompactSupport + (NeutralAtom.hasCompactSupport_coordinateLaplacian hc) + rw [coreCoulombPotential_fubini u _ hi] + simp only [zero_mul,integral_zero] + apply Finset.sum_eq_zero + intro s hs + apply Finset.sum_eq_zero + intro i hi + apply integral_eq_zero_of_ae + filter_upwards [hu s] with x hx + by_cases he : u.value s x=0 + · simp [he] + · have ha : position x i∈A := (by_contra (fun hn => he (hx hn)) : x∈allPositions A) i + have hn : position x i∉tsupport φ := fun h => Set.disjoint_left.mp hdis ha (ht h) + have HH := NeutralAtom.integral_translated_coulombKernel_laplacian hφ hc (position x i) + have heq : (∫ z, coulombKernel (position x i-z)*NeutralAtom.coordinateLaplacian φ z)=0 := by + simp_rw [coulombKernel_sub_comm (position x i)] + change (∫ z, NeutralAtom.coulombKernel (z-position x i)*NeutralAtom.coordinateLaplacian φ z)=0 + rw [HH,image_eq_zero_of_notMem_tsupport hn] + ring + simp only [heq,zero_mul,Pi.zero_apply] + +lemma attraction_weak_harmonic {J : ℕ} (S : Nuclei J) {U : Set Space} + (hsep : ∀ j, S.position j∉U) : + NeutralAtom.HasWeakLaplacian (attraction S) U (fun _ => 0) := by + intro φ hφ hc ht + have hL := NeutralAtom.continuous_coordinateLaplacian + (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLc := NeutralAtom.hasCompactSupport_coordinateLaplacian hc + have hts : tsupport (NeutralAtom.coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + exact hx (NeutralAtom.coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + have hi (j : Fin J) : Integrable (fun x => coulombKernel (x-S.position j)*NeutralAtom.coordinateLaplacian φ x) := by + apply NeutralAtom.integrable_mul_compact_of_continuousAt _ hL hLc + intro x hx + have hn : x-S.position j≠0 := sub_ne_zero.mpr (fun he => hsep j (he ▸ ht (hts hx))) + exact ((continuous_id.sub continuous_const).norm.continuousAt).inv₀ (norm_ne_zero_iff.mpr hn) + simp only [attraction,Finset.sum_mul,mul_assoc] + rw [integral_finsetSum _ (fun j _ => (hi j).const_mul _)] + simp only [zero_mul,integral_zero] + apply Finset.sum_eq_zero + intro j hj + rw [integral_const_mul] + change S.charge j*(∫ x, NeutralAtom.coulombKernel (x-S.position j)*NeutralAtom.coordinateLaplacian φ x)=0 + rw [NeutralAtom.integral_translated_coulombKernel_laplacian hφ hc, + image_eq_zero_of_notMem_tsupport (fun h => hsep j (ht h))] + ring + +lemma attraction_continuousOn {J : ℕ} (S : Nuclei J) {U : Set Space} + (hsep : ∀ j, S.position j∉U) : ContinuousOn (attraction S) U := by + change ContinuousOn (fun x => ∑ j : Fin J, S.charge j * ‖x-S.position j‖⁻¹) U + apply continuousOn_finsetSum + intro j hj + refine continuousOn_const.mul ?_ + refine ((continuous_id.sub continuous_const).norm.continuousOn).inv₀ ?_ + intro x hx + exact norm_ne_zero_iff.mpr (sub_ne_zero.mpr (fun he => hsep j ((show x=S.position j from he) ▸ hx))) + +lemma coreScreenedField_continuousOn {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {A : Set Space} (hu : SpatiallySupported u A) {y : Space} {r t : ℝ} + (hrt : r 0) := by + intro φ hφ hc ht + have hL := NeutralAtom.continuous_coordinateLaplacian + (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLc := NeutralAtom.hasCompactSupport_coordinateLaplacian hc + have hi : Integrable (NeutralAtom.coordinateLaplacian φ) := hL.integrable_of_hasCompactSupport hLc + have hiC := coreCoulombPotential_mul_integrable u _ hi + have hiA : Integrable (fun x => attraction S x*NeutralAtom.coordinateLaplacian φ x) := by + apply NeutralAtom.integrable_mul_compact_of_continuousAt _ hL hLc + intro x hx + have hts : tsupport (NeutralAtom.coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + exact hx (NeutralAtom.coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + have hx' : x∈tsupport φ := hts hx + have hs (j) : x≠S.position j := fun h => hnuc j (h ▸ ht hx') + change ContinuousAt (fun x => ∑ j : Fin J, S.charge j * ‖x-S.position j‖⁻¹) x + apply tendsto_finsetSum + intro j hj + exact continuousAt_const.mul (((continuous_id.sub continuous_const).norm.continuousAt).inv₀ + (norm_ne_zero_iff.mpr (sub_ne_zero.mpr (hs j)))) + simp only [coreScreenedField,sub_mul] + rw [integral_sub hiA hiC,attraction_weak_harmonic S hnuc φ hφ hc ht, + coreCoulombPotential_weak_harmonic u hu hdis φ hφ hc ht] + simp + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PoissonInterior.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PoissonInterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..9723a43066cae63cbe7db9746b708285507b2f81 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PoissonInterior.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.HarmonicInterior +import OAI.Analysis.CoulombRadii.Localization.HarmonicScale + +namespace OAI + +noncomputable section + +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ContDiff +namespace NeutralAtom +theorem poisson_interior_estimates (c : Position) {r A M : ℝ} + (hr : 0 < r) (hA : 0 ≤ A) (hM : 0 ≤ M) : + ∃ C : ℝ, 0 < C ∧ ∀ (F σ : Position → ℝ), + ContinuousOn F (Metric.ball c (3*r)) → + HasWeakLaplacian F (Metric.ball c (2*r)) (fun x => 4*Real.pi*σ x) → + Integrable σ → (∀ x, 0 ≤ σ x) → + (∀ x ∈ Metric.closedBall c (3*r), σ x ≤ A) → + (∫ x in Metric.closedBall c (2*r), ‖F x‖) ≤ M → + (∀ z ∈ Metric.closedBall c r, ‖F z‖ ≤ C) ∧ + (∀ z ∈ Metric.closedBall c r, ∀ z' ∈ Metric.closedBall c r, + ‖F z-F z'‖ ≤ C*‖z-z'‖) := by + obtain ⟨HC, hHC, hest⟩ := harmonic_interior_estimates_local hr + let W := Metric.closedBall c (3*r) + let W' := Metric.closedBall c (2*r) + let V := (volume W).toReal + let V' := (volume W').toReal + let PB := A*(∫ y in Metric.ball (0 : Position) 1, coulombKernel y)+A*V + let LB := A*(∫ y in Metric.ball (0 : Position) 1, (coulombKernel y)^2)+A*V + have hPB : 0 ≤ PB := add_nonneg (mul_nonneg hA (integral_nonneg coulombKernel_nonneg)) + (mul_nonneg hA ENNReal.toReal_nonneg) + have hLB : 0 ≤ LB := add_nonneg (mul_nonneg hA (integral_nonneg (fun y => sq_nonneg _))) + (mul_nonneg hA ENNReal.toReal_nonneg) + let H := M+PB*V' + have hH : 0 ≤ H := add_nonneg hM (mul_nonneg hPB ENNReal.toReal_nonneg) + let C := HC*H+PB+LB+1 + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨C, hC, ?_⟩ + intro F σ hF hpoisson hσ hσpos hσbd hIF + let ρ := W.indicator σ + have hρ : Integrable ρ := hσ.indicator measurableSet_closedBall + have hρpos : ∀ x, 0 ≤ ρ x := fun x => Set.indicator_nonneg (fun y _ => hσpos y) x + have hρbd : ∀ x, ρ x ≤ A := by + intro x + by_cases hx : x ∈ W + · simpa only [ρ, Set.indicator_of_mem hx] using hσbd x hx + · simpa only [ρ, Set.indicator_of_notMem hx] using hA + have hmass : (∫ x, ρ x) ≤ A*V := by + rw [show ρ = W.indicator σ from rfl, integral_indicator measurableSet_closedBall] + calc + (∫ x in W, σ x) ≤ ∫ _ in W, A := integral_mono_ae hσ.integrableOn + (integrableOn_const (isCompact_closedBall c (3*r)).measure_ne_top) + ((ae_restrict_mem measurableSet_closedBall).mono (fun x hx => hσbd x hx)) + _ = A*V := by simp only [integral_const, Measure.restrict_apply_univ, smul_eq_mul, V, + measureReal_def, mul_comm] + let P := potentialOf ρ + have hPcont : Continuous P := potentialOf_continuous hρ hρpos hρbd + have hPbd (x : Position) : ‖P x‖ ≤ PB := by + have hp : 0 ≤ P x := integral_nonneg (fun y => mul_nonneg (coulombKernel_nonneg _) (hρpos y)) + rw [Real.norm_eq_abs, abs_of_nonneg hp] + exact (bounded_density_convolution measurable_coulombKernel coulombKernel_nonneg + (coulombKernel_integrableOn_ball 1) (fun _ => coulombKernel_le_one) + hρ hρpos hρbd x).2.trans (by dsimp only [PB]; linarith) + have hPlip (x y : Position) : ‖P x-P y‖ ≤ LB*‖x-y‖ := + (potentialOf_lipschitz_bound hρ hρpos hρbd x y).trans + (mul_le_mul_of_nonneg_right (by dsimp only [LB]; linarith) (norm_nonneg _)) + have hW' : W' ⊆ Metric.ball c (3*r) := by + intro x hx + change dist x c ≤ 2*r at hx + change dist x c < 3*r + linarith + have hball : Metric.ball c (2*r) ⊆ Metric.ball c (3*r) := + Metric.ball_subset_ball (by linarith) + let h : Position → ℝ := fun x => F x+P x + have hhcont : ContinuousOn h (Metric.ball c (3*r)) := hF.add hPcont.continuousOn + have hharm : HasWeakLaplacian h (Metric.ball c (2*r)) (fun _ => 0) := + local_harmonic_part Metric.isOpen_ball (hF.mono hball) hpoisson hρ hρpos hρbd (by + intro x hx + have hxW : x ∈ W := by + change dist x c ≤ 3*r + exact (hball hx).le + exact (Set.indicator_of_mem hxW σ).symm) + have hiF : IntegrableOn (fun x => ‖F x‖) W' := + ((hF.mono hW').norm).integrableOn_compact (isCompact_closedBall c (2*r)) + have hih : IntegrableOn (fun x => ‖h x‖) W' := + ((hhcont.mono hW').norm).integrableOn_compact (isCompact_closedBall c (2*r)) + have hiPB : IntegrableOn (fun _ : Position => PB) W' := + integrableOn_const (isCompact_closedBall c (2*r)).measure_ne_top + have hIh : (∫ x in W', ‖h x‖) ≤ H := by + calc + (∫ x in W', ‖h x‖) ≤ ∫ x in W', ‖F x‖+PB := integral_mono_ae hih (hiF.add hiPB) + (Filter.Eventually.of_forall (fun x => (norm_add_le (F x) (P x)).trans + (add_le_add le_rfl (hPbd x)))) + _ = (∫ x in W', ‖F x‖)+PB*V' := by + rw [integral_add hiF hiPB, integral_const] + simp only [Measure.restrict_apply_univ, smul_eq_mul, V', measureReal_def, mul_comm] + _ ≤ H := by dsimp only [H]; linarith + obtain ⟨hval, hdiff⟩ := hest c h hhcont hharm + have hCval : HC*H+PB ≤ C := by dsimp [C]; linarith + have hClip : HC*H+LB ≤ C := by dsimp [C]; linarith + constructor + · intro z hz + calc + ‖F z‖ = ‖h z-P z‖ := by dsimp [h]; rw [add_sub_cancel_right] + _ ≤ ‖h z‖+‖P z‖ := norm_sub_le _ _ + _ ≤ HC*(∫ x in W', ‖h x‖)+PB := add_le_add (hval z hz) (hPbd z) + _ ≤ HC*H+PB := by linarith [mul_le_mul_of_nonneg_left hIh hHC.le] + _ ≤ C := hCval + · intro z hz z' hz' + calc + ‖F z-F z'‖ = ‖(h z-h z')-(P z-P z')‖ := by congr 1; dsimp [h]; ring + _ ≤ ‖h z-h z'‖+‖P z-P z'‖ := norm_sub_le _ _ + _ ≤ HC*(∫ x in W', ‖h x‖)*‖z-z'‖+LB*‖z-z'‖ := + add_le_add (hdiff z hz z' hz') (hPlip z z') + _ ≤ (HC*H+LB)*‖z-z'‖ := by + have hb := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hIh hHC.le) + (norm_nonneg (z-z')) + nlinarith + _ ≤ C*‖z-z'‖ := mul_le_mul_of_nonneg_right hClip (norm_nonneg _) + +end NeutralAtom + +end +open MeasureTheory Filter Set +open scoped Topology BigOperators ContDiff +namespace NeutralAtom + +lemma HasWeakLaplacian.const_mul {F q : Position → ℝ} {U : Set Position} + (h : HasWeakLaplacian F U q) (b : ℝ) : + HasWeakLaplacian (fun x => b*F x) U (fun x => b*q x) := by + intro φ hφ hφc ht + simp_rw [mul_assoc, integral_const_mul] + rw [h φ hφ hφc ht] + +theorem poisson_unit_negative_oscillation {A M : ℝ} (hA : 0≤A) (hM : 0≤M) : + ∃ C : ℝ, 0 4*Real.pi*σ x) → + Integrable σ → (∀ x, 0≤σ x) → + (∀ x ∈ Metric.closedBall 0 3, σ x≤A) → + (∀ x ∈ Metric.closedBall 0 2, F x≤M) → + volume.real (Metric.closedBall (0:Position) 2)*F 0 ≤ + (∫ x in Metric.closedBall 0 2, F x) → + ∀ z ∈ Metric.closedBall (0:Position) 1, + ‖F z-F 0‖ ≤ C*(1+max (-F 0) 0)*‖z‖ := by + let V := volume.real (Metric.closedBall (0:Position) 2) + have hV : 0≤V := ENNReal.toReal_nonneg + obtain ⟨C,hC,H⟩ := poisson_interior_estimates (0:Position) + (r:=1) (A:=A) (M:=V*(2*M+1)) (by norm_num) hA (by positivity) + refine ⟨C,hC,?_⟩ + intro F σ hF hLap hσ hp hb hFM hmean z hz + let T := 1+max (-F 0) 0 + have hT : 0 2*M) (Metric.closedBall 0 2) := + integrableOn_const (isCompact_closedBall (0:Position) 2).measure_ne_top + have hIF : (∫ x in Metric.closedBall 0 2, ‖F x‖) ≤ V*(2*M+max (-F 0) 0) := by + calc + (∫ x in Metric.closedBall 0 2, ‖F x‖) ≤ + ∫ x in Metric.closedBall 0 2, 2*M-F x := by + apply integral_mono_ae hiabs (hic.sub hiF) + filter_upwards [ae_restrict_mem measurableSet_closedBall] with x hx + change ‖F x‖ ≤ 2*M-F x + rw [Real.norm_eq_abs] + exact abs_le.mpr ⟨by linarith [hFM x hx], by linarith [hFM x hx]⟩ + _ = V*(2*M)-(∫ x in Metric.closedBall 0 2, F x) := by + rw [integral_sub hic hiF,integral_const] + simp only [measureReal_restrict_apply_univ,smul_eq_mul,V] + _ ≤ V*(2*M+max (-F 0) 0) := by + change V*F 0 ≤ _ at hmean + nlinarith [mul_le_mul_of_nonneg_left (le_max_left (-F 0) 0) hV] + have hIscaled : (∫ x in Metric.closedBall 0 2, ‖T⁻¹*F x‖) ≤ V*(2*M+1) := by + simp_rw [norm_mul,Real.norm_eq_abs T⁻¹,abs_of_pos (inv_pos.mpr hT),integral_const_mul] + have hnum : V*(2*M+max (-F 0) 0) ≤ T*(V*(2*M+1)) := by + dsimp [T] + nlinarith [mul_nonneg (mul_nonneg hV hM) (le_max_right (-F 0) 0)] + calc + _ ≤ T⁻¹*(T*(V*(2*M+1))) := + mul_le_mul_of_nonneg_left (hIF.trans hnum) (inv_nonneg.mpr hT.le) + _ = _ := by rw [←mul_assoc,inv_mul_cancel₀ hT.ne',one_mul] + have hLap' : HasWeakLaplacian (fun x => T⁻¹*F x) (Metric.ball 0 2) + (fun x => 4*Real.pi*(T⁻¹*σ x)) := by + convert hLap.const_mul T⁻¹ using 1 + funext point + ring + obtain ⟨_,hdiff⟩ := H (fun x => T⁻¹*F x) (fun x => T⁻¹*σ x) + (by simpa only [mul_one] using hF.const_mul T⁻¹) (by simpa using hLap') + (hσ.const_mul _) (fun x => mul_nonneg (inv_nonneg.mpr hT.le) (hp x)) + (by + intro x hx + have hh : σ x≤A := hb x (by simpa using hx) + have hinv : T⁻¹≤1 := inv_le_one_of_one_le₀ hT1 + exact (mul_le_mul_of_nonneg_left hh (inv_nonneg.mpr hT.le)).trans + (by simpa using mul_le_mul_of_nonneg_right hinv hA)) (by simpa using hIscaled) + have hh := hdiff z (by simpa using hz) 0 (by simp) + simp only [←mul_sub,norm_mul,Real.norm_eq_abs T⁻¹,abs_of_pos (inv_pos.mpr hT),sub_zero] at hh + have hm := mul_le_mul_of_nonneg_left hh hT.le + simpa only [←mul_assoc,mul_inv_cancel₀ hT.ne',one_mul,mul_comm T C,T] using hm + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PositiveField.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PositiveField.lean new file mode 100644 index 0000000000000000000000000000000000000000..4158f8dafe4da83d5ab8ff44d8cdec8576f9b552 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PositiveField.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.BallTrial +import OAI.Analysis.CoulombRadii.Packets.ScaledWindow +import OAI.Analysis.CoulombRadii.FormDomain.FieldOptimization + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +noncomputable section +namespace Coulomb + +def ballTrialCoefficient : ℝ := ballKineticCoefficient+ + (1/2:ℝ)*(∑ b : Fin 3, ∫ x : Space, (fderiv ℝ unitWindow x (EuclideanSpace.single b 1))^2)+2 + +lemma ballTrialCoefficient_pos : 0 < ballTrialCoefficient := by + unfold ballTrialCoefficient + linarith [ballKineticCoefficient_pos,unitWindow_kinetic_nonneg] + +theorem positive_field_ball_trial {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + (hu : Antisymmetric u) (hmu : mass u = 1) + {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) + (y : Space) (A : Set Space) (hA : IsClosed A) (hsu : SpatiallySupported u A) + (hcore : ∀ z ∈ A, 3*a ≤ ‖z-y‖) (hnuc : ∀ j, 3*a ≤ ‖S.position j-y‖) : + unrestrictedFormBottom S ≤ ((form S u-M*coreScreenedField S u y+ + ballTrialCoefficient*(M^(5/3:ℝ)/a^2+M/a^2+M^2/a) : ℝ) : EReal) := by + have H := ballCloud_trial S u hu hmu (scaledWindow unitWindow a ha.ne') + (by rw [scaledWindow_mass unitWindow ha,unitWindow_mass]) + (scaledWindow_compactSupport unitWindow unitWindow_support ha) + (scaledWindow_radial unitWindow unitWindow_radial ha) + ha hM (scaledWindow_support unitWindow unitWindow_support ha) + y A hA hsu hcore hnuc + rw [scaledWindow_kinetic unitWindow ha] at H + apply H.trans + apply EReal.coe_le_coe_iff.mpr + have hc : ballKineticCoefficient ≤ ballTrialCoefficient := by + unfold ballTrialCoefficient + linarith [unitWindow_kinetic_nonneg] + have hg : (1/2:ℝ)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ unitWindow x (EuclideanSpace.single b 1))^2) ≤ ballTrialCoefficient := by + unfold ballTrialCoefficient + linarith [ballKineticCoefficient_pos] + have he : (5/4:ℝ) ≤ ballTrialCoefficient := by + unfold ballTrialCoefficient + linarith [ballKineticCoefficient_pos,unitWindow_kinetic_nonneg] + have Hc := mul_le_mul_of_nonneg_right hc (show 0 ≤ M^(5/3:ℝ)/a^2 by positivity) + have Hg := mul_le_mul_of_nonneg_right hg (show 0 ≤ M/a^2 by positivity) + have He := mul_le_mul_of_nonneg_right he (show 0 ≤ M^2/a by positivity) + linear_combination Hc+Hg+He + +theorem positive_field_core_gain {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + (hu : Antisymmetric u) (hmu : mass u = 1) + {a m : ℝ} (ha : 0 < a) (hm : 0 ≤ m) + (ham : 1 ≤ a*m) (ham' : 1 ≤ a*m^(1/3:ℝ)) + (y : Space) (A : Set Space) (hA : IsClosed A) (hsu : SpatiallySupported u A) + (hcore : ∀ z ∈ A, 3*a ≤ ‖z-y‖) (hnuc : ∀ j, 3*a ≤ ‖S.position j-y‖) : + unrestrictedFormBottom S ≤ ((form S u-a*(max (coreScreenedField S u y) 0)^2/ + (16*ballTrialCoefficient)+4*ballTrialCoefficient*m^2/a : ℝ) : EReal) := by + by_cases hb : unrestrictedFormBottom S = ⊥ + · simp [hb] + have ht : unrestrictedFormBottom S ≠ ⊤ := ne_top_of_le_ne_top (EReal.coe_ne_top _) + (unrestrictedFormBottom_le_trial S u hu hmu) + rw [←EReal.coe_toReal ht hb] + apply EReal.coe_le_coe_iff.mpr + apply positive_field_trial_optimization ha ballTrialCoefficient_pos hm ham ham' + intro M hM + apply EReal.coe_le_coe_iff.mp + rw [EReal.coe_toReal ht hb] + exact positive_field_ball_trial S u hu hmu ha hM y A hA hsu hcore hnuc + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PotentialAddRsmul.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PotentialAddRsmul.lean new file mode 100644 index 0000000000000000000000000000000000000000..2156d7d2aaa6221590d7e6fe73ab56297bc1c72e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/PotentialAddRsmul.lean @@ -0,0 +1,314 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Add + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +open ContinuousLinearMap +open scoped Convolution + +lemma potential_add_rsmul {n : ℕ} (ψ φ : H1Vector n) (t : ℝ) + (s : Spins n) (V : Configuration n → ℝ) + (hψ : Integrable (fun x => V x * ‖ψ.value s x‖^2)) + (hφ : Integrable (fun x => V x * ‖φ.value s x‖^2)) + (hadd : Integrable (fun x => V x * ‖(ψ.add φ).value s x‖^2)) : + (∫ x, V x * ‖(ψ.add (φ.rsmul t)).value s x‖^2) = + (1-t)*(∫ x, V x * ‖ψ.value s x‖^2) + + (t^2-t)*(∫ x, V x * ‖φ.value s x‖^2) + + t*(∫ x, V x * ‖(ψ.add φ).value s x‖^2) := by + have heq : ∀ x, V x * ‖(ψ.add (φ.rsmul t)).value s x‖^2 = + (1-t)*(V x*‖ψ.value s x‖^2) + (t^2-t)*(V x*‖φ.value s x‖^2) + + t*(V x*‖(ψ.add φ).value s x‖^2) := by + intro x + change V x * ‖ψ.value s x + (t : ℂ)*φ.value s x‖^2 = _ + rw [norm_add_rsmul_sq] + change _ = (1-t)*(V x*‖ψ.value s x‖^2) + (t^2-t)*(V x*‖φ.value s x‖^2) + + t*(V x*‖ψ.value s x + φ.value s x‖^2) + ring + simp_rw [heq] + have hsum : Integrable (fun x => (1-t)*(V x*‖ψ.value s x‖^2) + + (t^2-t)*(V x*‖φ.value s x‖^2)) := (hψ.const_mul _).add (hφ.const_mul _) + rw [integral_add hsum (hadd.const_mul t), + integral_add (hψ.const_mul (1-t)) (hφ.const_mul (t^2-t))] + simp only [integral_const_mul] + +lemma nuclearEnergy_add_rsmul {M n : ℕ} (S : Nuclei M) (ψ φ : H1Vector n) (t : ℝ) : + nuclearEnergy S (ψ.add (φ.rsmul t)) = + (1-t)*nuclearEnergy S ψ + (t^2-t)*nuclearEnergy S φ + + t*nuclearEnergy S (ψ.add φ) := by + unfold nuclearEnergy + simp_rw [potential_add_rsmul ψ φ t _ _ (ψ.nuclear_integrable S _) + (φ.nuclear_integrable S _) ((ψ.add φ).nuclear_integrable S _)] + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] + +lemma pairEnergy_add_rsmul {n : ℕ} (ψ φ : H1Vector n) (t : ℝ) : + pairEnergy (ψ.add (φ.rsmul t)) = + (1-t)*pairEnergy ψ + (t^2-t)*pairEnergy φ + t*pairEnergy (ψ.add φ) := by + unfold pairEnergy + simp_rw [potential_add_rsmul ψ φ t _ _ (ψ.pair_integrable _) + (φ.pair_integrable _) ((ψ.add φ).pair_integrable _)] + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] + +lemma form_add_rsmul {M n : ℕ} (S : Nuclei M) (ψ φ : H1Vector n) (t : ℝ) : + form S (ψ.add (φ.rsmul t)) = + (1-t)*form S ψ + (t^2-t)*form S φ + t*form S (ψ.add φ) := by + rw [form, kinetic_add_rsmul, nuclearEnergy_add_rsmul, pairEnergy_add_rsmul] + unfold form + ring + +open scoped Topology + +lemma linear_term_zero_of_eventually_quadratic_nonneg (A B : ℝ) + (h : ∀ᶠ t : ℝ in 𝓝 0, 0 ≤ A*t+B*t^2) : A = 0 := by + have hc : ContinuousAt (fun t : ℝ => A+B*t) 0 := by fun_prop + have hp : ∀ᶠ t : ℝ in 𝓝[>] 0, 0 ≤ A+B*t := by + filter_upwards [h.filter_mono inf_le_left, self_mem_nhdsWithin] with t ht hpos + have hpos' : 0 < t := hpos + have heq : A*t+B*t^2 = (A+B*t)*t := by ring + rw [heq] at ht + exact nonneg_of_mul_nonneg_left ht hpos' + have hm : ∀ᶠ t : ℝ in 𝓝[<] 0, A+B*t ≤ 0 := by + filter_upwards [h.filter_mono inf_le_left, self_mem_nhdsWithin] with t ht hneg + have hneg' : t < 0 := hneg + have heq : A*t+B*t^2 = (- (A+B*t))*(-t) := by ring + rw [heq] at ht + have hu := nonneg_of_mul_nonneg_left ht (neg_pos.mpr hneg') + linarith + have htp : Filter.Tendsto (fun t : ℝ => A+B*t) (𝓝[>] (0 : ℝ)) (𝓝 (A+B*0)) := + hc.tendsto.mono_left nhdsWithin_le_nhds + have htm : Filter.Tendsto (fun t : ℝ => A+B*t) (𝓝[<] (0 : ℝ)) (𝓝 (A+B*0)) := + hc.tendsto.mono_left nhdsWithin_le_nhds + have hge := ge_of_tendsto htp hp + have hle := le_of_tendsto htm hm + simp only [mul_zero, add_zero] at hge hle + exact le_antisymm hle hge + +lemma GroundState.polarization {M n : ℕ} {S : Nuclei M} {ψ : H1Vector n} + (hψ : GroundState S ψ) (hn : n ≠ 0) (φ : H1Vector n) + (hφ : Antisymmetric φ) : + form S (ψ.add φ) - form S ψ - form S φ = + energy S n * (mass (ψ.add φ) - mass ψ - mass φ) := by + let E := energy S n + let A := form S (ψ.add φ) - form S ψ - form S φ - + E * (mass (ψ.add φ) - mass ψ - mass φ) + let B := form S φ - E * mass φ + have hc : Continuous (fun t : ℝ => mass (ψ.add (φ.rsmul t))) := by + simp_rw [mass_add_rsmul] + fun_prop + have hm0 : mass (ψ.add (φ.rsmul 0)) = 1 := by + rw [mass_add_rsmul] + simpa using hψ.2.1 + have hm : ∀ᶠ t : ℝ in 𝓝 0, 0 < mass (ψ.add (φ.rsmul t)) := + continuousAt_const.eventually_lt hc.continuousAt (by rw [hm0]; norm_num) + have hpoly : ∀ᶠ t : ℝ in 𝓝 0, 0 ≤ A*t+B*t^2 := by + filter_upwards [hm] with t ht + have hbound := energy_mul_mass_le_form S hn (ψ.add (φ.rsmul t)) + (hψ.1.add (hφ.rsmul t)) ht + rw [mass_add_rsmul, form_add_rsmul] at hbound + have he : form S ψ = E * mass ψ := by rw [hψ.2.1, mul_one]; exact hψ.2.2 + dsimp [A, B, E] + nlinarith [he] + have hA := linear_term_zero_of_eventually_quadratic_nonneg A B hpoly + dsimp [A, E] at hA + linarith + +lemma norm_double_multiplier_identity (f d : ℝ) (u v : ℂ) : + ‖(d : ℂ)*u+(f : ℂ)*v‖^2 = + (‖v+((d : ℂ)*((f : ℂ)*u)+(f : ℂ)*((d : ℂ)*u+(f : ℂ)*v))‖^2 - + ‖v‖^2 - ‖(d : ℂ)*((f : ℂ)*u)+(f : ℂ)*((d : ℂ)*u+(f : ℂ)*v)‖^2)/2 + + d^2*‖u‖^2 := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.add_re, Complex.add_im, + Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im] + ring + +lemma norm_double_mass_identity (f : ℝ) (u : ℂ) : + ‖(f : ℂ)*u‖^2 = + (‖u+(f : ℂ)*((f : ℂ)*u)‖^2-‖u‖^2-‖(f : ℂ)*((f : ℂ)*u)‖^2)/2 := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.add_re, Complex.add_im, + Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im] + ring + +lemma integral_quadratic_expansion {n : ℕ} (A B C D F : Configuration n → ℝ) + (hB : Integrable B) (hC : Integrable C) (hD : Integrable D) (hF : Integrable F) + (heq : ∀ x, A x = (B x-C x-D x)/2+F x) : + (∫ x, A x) = ((∫ x, B x)-(∫ x, C x)-(∫ x, D x))/2+(∫ x, F x) := by + simp_rw [heq] + have hsub : Integrable (fun x => B x-C x-D x) := (hB.sub hC).sub hD + have hbc : Integrable (fun x => B x-C x) := hB.sub hC + rw [integral_add (hsub.div_const 2) hF, integral_div, + integral_sub hbc hD, integral_sub hB hC] + +lemma mass_double_smoothMul {n : ℕ} (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) : + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + mass χ = (mass (ψ.add θ)-mass ψ-mass θ)/2 := by + dsimp only + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + change mass χ = (mass (ψ.add θ)-mass ψ-mass θ)/2 + have hblock : ∀ s, (∫ x, ‖χ.value s x‖^2) = + ((∫ x, ‖(ψ.add θ).value s x‖^2)-(∫ x, ‖ψ.value s x‖^2)- + (∫ x, ‖θ.value s x‖^2))/2 := by + intro s + have h := integral_quadratic_expansion + (fun x => ‖χ.value s x‖^2) (fun x => ‖(ψ.add θ).value s x‖^2) + (fun x => ‖ψ.value s x‖^2) (fun x => ‖θ.value s x‖^2) (fun _ => 0) + (((ψ.add θ).value_L2 s).integrable_norm_pow (p := 2) (by decide)) + ((ψ.value_L2 s).integrable_norm_pow (p := 2) (by decide)) + ((θ.value_L2 s).integrable_norm_pow (p := 2) (by decide)) (integrable_zero _ _ _) + (fun x => by + change ‖(f x : ℂ)*ψ.value s x‖^2 = + (‖ψ.value s x+(f x : ℂ)*((f x : ℂ)*ψ.value s x)‖^2- + ‖ψ.value s x‖^2-‖(f x : ℂ)*((f x : ℂ)*ψ.value s x)‖^2)/2+0 + simpa only [add_zero] using norm_double_mass_identity (f x) (ψ.value s x)) + simpa only [integral_zero, add_zero] using h + unfold mass + simp_rw [hblock] + rw [← Finset.sum_div, Finset.sum_sub_distrib, Finset.sum_sub_distrib] + +lemma potential_double_smoothMul {n : ℕ} (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) + (s : Spins n) (V : Configuration n → ℝ) + (hψ : Integrable (fun x => V x*‖ψ.value s x‖^2)) + (hθ : Integrable (fun x => V x* + ‖((ψ.smoothMul f hf B D hB hD).smoothMul f hf B D hB hD).value s x‖^2)) + (hadd : Integrable (fun x => V x* + ‖(ψ.add ((ψ.smoothMul f hf B D hB hD).smoothMul f hf B D hB hD)).value s x‖^2)) : + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + (∫ x, V x*‖χ.value s x‖^2) = + ((∫ x, V x*‖(ψ.add θ).value s x‖^2)-(∫ x, V x*‖ψ.value s x‖^2)- + (∫ x, V x*‖θ.value s x‖^2))/2 := by + dsimp only + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + have h := integral_quadratic_expansion + (fun x => V x*‖χ.value s x‖^2) (fun x => V x*‖(ψ.add θ).value s x‖^2) + (fun x => V x*‖ψ.value s x‖^2) (fun x => V x*‖θ.value s x‖^2) (fun _ => 0) + hadd hψ hθ (integrable_zero _ _ _) (fun x => by + change V x*‖(f x : ℂ)*ψ.value s x‖^2 = _ + rw [norm_double_mass_identity] + change _ = (V x*‖ψ.value s x +(f x : ℂ)*((f x : ℂ)*ψ.value s x)‖^2 - + V x*‖ψ.value s x‖^2 - V x*‖(f x : ℂ)*((f x : ℂ)*ψ.value s x)‖^2)/2+0 + ring) + simpa only [integral_zero, add_zero] using h + +lemma kinetic_double_smoothMul {n : ℕ} (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) : + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + kinetic χ = (kinetic (ψ.add θ)-kinetic ψ-kinetic θ)/2 + + (1/2 : ℝ)*∑ s, ∑ a, ∫ x, + (fderiv ℝ f x (EuclideanSpace.single a 1))^2*‖ψ.value s x‖^2 := by + dsimp only + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + have hblock : ∀ s a, (∫ x, ‖χ.gradient s a x‖^2) = + ((∫ x, ‖(ψ.add θ).gradient s a x‖^2)-(∫ x, ‖ψ.gradient s a x‖^2)- + (∫ x, ‖θ.gradient s a x‖^2))/2 + + ∫ x, (fderiv ℝ f x (EuclideanSpace.single a 1))^2*‖ψ.value s x‖^2 := by + intro s a + have hL := memLp_two_real_mul (ψ.value_L2 s) + ((hf.continuous_fderiv (by simp)).clm_apply continuous_const) (hD a) + have herr : Integrable (fun x => + (fderiv ℝ f x (EuclideanSpace.single a 1))^2*‖ψ.value s x‖^2) := by + simpa only [norm_real_mul_sq] using hL.integrable_norm_pow (p := 2) (by decide) + apply integral_quadratic_expansion _ _ _ _ _ + (((ψ.add θ).partial_L2 s a).integrable_norm_pow (p := 2) (by decide)) + ((ψ.partial_L2 s a).integrable_norm_pow (p := 2) (by decide)) + ((θ.partial_L2 s a).integrable_norm_pow (p := 2) (by decide)) herr + intro x + exact norm_double_multiplier_identity (f x) + (fderiv ℝ f x (EuclideanSpace.single a 1)) (ψ.value s x) (ψ.gradient s a x) + change (1/2 : ℝ)*(∑ s, ∑ a, ∫ x, ‖χ.gradient s a x‖^2) = _ + simp_rw [hblock] + simp only [Finset.sum_add_distrib, ← Finset.sum_div, Finset.sum_sub_distrib] + unfold kinetic + ring + +lemma nuclearEnergy_double_smoothMul {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) : + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + nuclearEnergy S χ = + (nuclearEnergy S (ψ.add θ)-nuclearEnergy S ψ-nuclearEnergy S θ)/2 := by + dsimp only + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + unfold nuclearEnergy + simp_rw [potential_double_smoothMul ψ f hf B D hB hD _ _ (ψ.nuclear_integrable S _) + (θ.nuclear_integrable S _) ((ψ.add θ).nuclear_integrable S _)] + rw [← Finset.sum_div, Finset.sum_sub_distrib, Finset.sum_sub_distrib] + +lemma pairEnergy_double_smoothMul {n : ℕ} (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) : + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + pairEnergy χ = (pairEnergy (ψ.add θ)-pairEnergy ψ-pairEnergy θ)/2 := by + dsimp only + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + unfold pairEnergy + simp_rw [potential_double_smoothMul ψ f hf B D hB hD _ _ (ψ.pair_integrable _) + (θ.pair_integrable _) ((ψ.add θ).pair_integrable _)] + rw [← Finset.sum_div, Finset.sum_sub_distrib, Finset.sum_sub_distrib] + +lemma form_double_smoothMul {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) : + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + form S χ = (form S (ψ.add θ)-form S ψ-form S θ)/2 + + (1/2 : ℝ)*∑ s, ∑ a, ∫ x, + (fderiv ℝ f x (EuclideanSpace.single a 1))^2*‖ψ.value s x‖^2 := by + dsimp only + rw [form, kinetic_double_smoothMul, nuclearEnergy_double_smoothMul, + pairEnergy_double_smoothMul] + unfold form + ring + +theorem GroundState.smooth_multiplier_identity {M n : ℕ} {S : Nuclei M} + {ψ : H1Vector n} (hψ : GroundState S ψ) (hn : n ≠ 0) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) + (hsymm : ∀ p x, f (permute p x) = f x) : + form S (ψ.smoothMul f hf B D hB hD) = + energy S n * mass (ψ.smoothMul f hf B D hB hD) + + (1/2 : ℝ)*∑ s, ∑ a, ∫ x, + (fderiv ℝ f x (EuclideanSpace.single a 1))^2*‖ψ.value s x‖^2 := by + let χ := ψ.smoothMul f hf B D hB hD + let θ := χ.smoothMul f hf B D hB hD + have hχ : Antisymmetric χ := + ψ.smoothMul_antisymmetric hψ.1 f hf B D hB hD hsymm + have hθ : Antisymmetric θ := + χ.smoothMul_antisymmetric hχ f hf B D hB hD hsymm + have hp := hψ.polarization hn θ hθ + rw [form_double_smoothMul, mass_double_smoothMul] + change (form S (ψ.add θ)-form S ψ-form S θ)/2+_ = + energy S n*((mass (ψ.add θ)-mass ψ-mass θ)/2)+_ + rw [hp] + ring + +end Coulomb + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawObservable.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawObservable.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ba2bb33b4a7efaad75c765c6ddcac9045884a03 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawObservable.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.CutCombinatorics +import OAI.Analysis.CoulombRadii.RandomFields.CutJensen +import OAI.Analysis.CoulombRadii.FieldAnalysis.FarSubmean + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def rawSignedField {n : ℕ} (V : ℝ) (A : Set Space) (y : Space) (x : Configuration n) : ℝ := + V-restrictedOutPotential x A y + +lemma restrictedOutPotential_measurable_configuration {n : ℕ} {A : Set Space} + (hA : MeasurableSet A) (y : Space) : Measurable (fun x : Configuration n => restrictedOutPotential x A y) := by + apply Finset.measurable_fun_sum + intro i hi + apply Measurable.ite (hA.preimage (continuous_position i).measurable) _ measurable_const + simp only [coulombKernel] + have hm : Measurable (fun x : Configuration n => position x i) := (continuous_position i).measurable + fun_prop + +lemma rawSignedField_measurable {n : ℕ} (V : ℝ) {A : Set Space} (hA : MeasurableSet A) (y : Space) : + Measurable (rawSignedField (n:=n) V A y) := + measurable_const.sub (restrictedOutPotential_measurable_configuration hA y) + +lemma rawSignedField_abs_le {n : ℕ} (V : ℝ) (A : Set Space) (y : Space) + {r : ℝ} (hr : 0 < r) (hsep : ∀ v ∈ A, r ≤ ‖v-y‖) (x : Configuration n) : + |rawSignedField V A y x| ≤ |V|+(n:ℝ)/r := by + have H := restrictedOutPotential_le x A hr y hsep + have H0 := restrictedOutPotential_nonneg x A y + unfold rawSignedField + calc + _ ≤ |V|+|restrictedOutPotential x A y| := abs_sub _ _ + _ ≤ _ := by rw [abs_of_nonneg H0]; linarith + +lemma restrictedOutPotential_permute {n : ℕ} (p : Equiv.Perm (Fin n)) + (x : Configuration n) (A : Set Space) (y : Space) : + restrictedOutPotential (permute p x) A y=restrictedOutPotential x A y := by + simp only [restrictedOutPotential,position_permute] + exact Equiv.sum_comp p (fun i : Fin n => if position x i ∈ A then coulombKernel (position x i-y) else 0) + +lemma rawSignedField_permute {n : ℕ} (V : ℝ) (A : Set Space) (y : Space) + (p : Equiv.Perm (Fin n)) (x : Configuration n) : + rawSignedField V A y (permute p x)=rawSignedField V A y x := by + simp only [rawSignedField,restrictedOutPotential_permute] + +lemma restrictedOutPotential_join {m k : ℕ} (x : Configuration m) (v : Configuration k) + (A : Set Space) (y : Space) : + restrictedOutPotential (joinConfiguration m k (x,v)) A y = + restrictedOutPotential x A y+restrictedOutPotential v A y := by + simp only [restrictedOutPotential,Fin.sum_univ_add,position_join_left,position_join_right] + +lemma potentialForm_restrictedOutPotential {n : ℕ} (u : H1Vector n) {A : Set Space} + (hA : MeasurableSet A) (y : Space) : + potentialForm (fun x => restrictedOutPotential x A y) u=restrictedCorePotential u A y := by + apply Finset.sum_congr rfl + intro s hs + unfold restrictedOutPotential + simp only [Finset.sum_mul] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro i hi + apply integral_congr_ae + exact Eventually.of_forall (fun x => by dsimp only; split_ifs <;> simp) + · intro i hi + exact (restrictedCore_integrable u hA s i y).congr (Eventually.of_forall (fun x => by dsimp only; split_ifs <;> simp)) + +lemma potentialForm_rawSignedField {n : ℕ} (u : H1Vector n) (V : ℝ) {A : Set Space} + (hA : MeasurableSet A) (y : Space) {r : ℝ} (hr : 0 < r) (hsep : ∀ v ∈ A, r ≤ ‖v-y‖) : + potentialForm (rawSignedField V A y) u=V*mass u-restrictedCorePotential u A y := by + rw [←potentialForm_const,←potentialForm_restrictedOutPotential u hA y] + unfold potentialForm rawSignedField + simp only [sub_mul] + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro s hs + rw [integral_sub] + · exact ((u.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul V + · exact boundedObservable_integrable u _ (restrictedOutPotential_measurable_configuration hA y) + (fun x => by rw [abs_of_nonneg (restrictedOutPotential_nonneg x A y)]; exact restrictedOutPotential_le x A hr y hsep) s + +lemma coreConditionalObservable_rawSignedField {m k : ℕ} (u : H1Vector (m+k)) + (V : ℝ) {A : Set Space} (hA : MeasurableSet A) (y : Space) {r : ℝ} + (hr : 0 < r) (hsep : ∀ v ∈ A, r ≤ ‖v-y‖) (s : Spins m) (x : Configuration m) + (hm : 0 < mass (u.coreSlice s x)) : + coreConditionalObservable u (rawSignedField V A y) s x = + V-restrictedCorePotential (u.coreSlice s x).normalized A y-restrictedOutPotential x A y := by + unfold coreConditionalObservable + have he : (fun v => rawSignedField V A y (joinConfiguration m k (x,v))) = + rawSignedField (V-restrictedOutPotential x A y) A y := by + funext v + simp only [rawSignedField,restrictedOutPotential_join] + ring + rw [he,potentialForm_rawSignedField _ _ hA y hr hsep,mass_normalized _ hm,mul_one] + ring + +lemma coreConditionalObservable_raw_positive_weight {m k : ℕ} (u : H1Vector (m+k)) + (V : ℝ) {A : Set Space} (hA : MeasurableSet A) (y : Space) {r : ℝ} + (hr : 0 < r) (hsep : ∀ v ∈ A, r ≤ ‖v-y‖) (s : Spins m) (x : Configuration m) : + mass (u.coreSlice s x)*(max (coreConditionalObservable u (rawSignedField V A y) s x) 0)^2 = + mass (u.coreSlice s x)*(max (V-restrictedCorePotential (u.coreSlice s x).normalized A y- + restrictedOutPotential x A y) 0)^2 := by + by_cases h : mass (u.coreSlice s x)=0 + · simp only [h,zero_mul] + · rw [coreConditionalObservable_rawSignedField u V hA y hr hsep s x + (lt_of_le_of_ne (mass_nonneg _) (Ne.symm h))] + +lemma potentialForm_labelCut {n : ℕ} {L : Type*} [Fintype L] (u : H1Vector n) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (W : Configuration n → ℝ) (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x| ≤ B) : + (∑ p : Fin n → L, potentialForm W (u.labelCut χ hχ hp D hD hd p))=potentialForm W u := by + unfold potentialForm + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro s hs + exact potential_smooth_partition u _ (tensorCut_contDiff χ hχ) 1 D (tensorCut_abs_le_one χ hp) + (tensorCut_partial_bound χ hχ hp hD hd) (tensorCut_partition χ hp) W s + (fun p => boundedObservable_integrable (u.labelCut χ hχ hp D hD hd p) W hW hB s) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawRMS.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawRMS.lean new file mode 100644 index 0000000000000000000000000000000000000000..b88da29e09440ca4ce68d9ff4dfbc28f6322b51e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawRMS.lean @@ -0,0 +1,198 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedCount +import OAI.Analysis.CoulombRadii.Localization.ShellIMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +def rawRMS {n : ℕ} (ψ : H1Vector n) (f : Configuration n → ℝ) : ℝ := + Real.sqrt (potentialForm (fun x => (f x)^2) ψ) + +lemma rawRMS_nonneg {n : ℕ} (ψ : H1Vector n) (f : Configuration n → ℝ) : + 0 ≤ rawRMS ψ f := Real.sqrt_nonneg _ + +lemma potentialForm_nonneg {n : ℕ} (ψ : H1Vector n) (f : Configuration n → ℝ) + (hf : ∀ x, 0 ≤ f x) : 0 ≤ potentialForm f ψ := + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun x => mul_nonneg (hf x) (sq_nonneg _))) + +lemma rawRMS_sq {n : ℕ} (ψ : H1Vector n) (f : Configuration n → ℝ) : + rawRMS ψ f ^ 2 = potentialForm (fun x => (f x)^2) ψ := + Real.sq_sqrt (potentialForm_nonneg ψ _ (fun _ => sq_nonneg _)) + +lemma potentialForm_bounded_cauchy {n : ℕ} (ψ : H1Vector n) + (f g : Configuration n → ℝ) (hf : Measurable f) (hg : Measurable g) + {B C : ℝ} (hB : ∀ x, |f x| ≤ B) (hC : ∀ x, |g x| ≤ C) : + (potentialForm (fun x => f x*g x) ψ)^2 ≤ + potentialForm (fun x => (f x)^2) ψ * potentialForm (fun x => (g x)^2) ψ := by + have hff s := boundedObservable_integrable ψ (fun x => (f x)^2) (hf.pow_const 2) + (fun x => by rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hB x) 2) s + have hgg s := boundedObservable_integrable ψ (fun x => (g x)^2) (hg.pow_const 2) + (fun x => by rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hC x) 2) s + have hfg s := boundedObservable_integrable ψ (fun x => f x*g x) (hf.mul hg) + (fun x => by rw [abs_mul]; exact mul_le_mul (hB x) (hC x) (abs_nonneg _) ((abs_nonneg _).trans (hB x))) s + let A := potentialForm (fun x => (f x)^2) ψ + let Q := potentialForm (fun x => (g x)^2) ψ + let D := potentialForm (fun x => f x*g x) ψ + have hn (t : ℝ) : 0 ≤ A*(t*t)+(-2*D)*t+Q := by + have hp := potentialForm_nonneg ψ (fun x => (t*f x-g x)^2) (fun _ => sq_nonneg _) + have he s : (∫ x, (t*f x-g x)^2*‖ψ.value s x‖^2) = + t^2*(∫ x, (f x)^2*‖ψ.value s x‖^2)- + (2*t)*(∫ x, (f x*g x)*‖ψ.value s x‖^2)+ + (∫ x, (g x)^2*‖ψ.value s x‖^2) := by + have hi : Integrable (fun x => t^2*((f x)^2*‖ψ.value s x‖^2)-(2*t)*((f x*g x)*‖ψ.value s x‖^2)) := + ((hff s).const_mul (t^2)).sub ((hfg s).const_mul (2*t)) + calc + _ = ∫ x, (t^2*((f x)^2*‖ψ.value s x‖^2)-(2*t)*((f x*g x)*‖ψ.value s x‖^2))+ + (g x)^2*‖ψ.value s x‖^2 := integral_congr_ae (Eventually.of_forall (fun _ => by ring)) + _ = _ := by + rw [integral_add hi (hgg s), + integral_sub ((hff s).const_mul _) ((hfg s).const_mul _),integral_const_mul,integral_const_mul] + simp only [potentialForm,he,Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum] at hp + change 0 ≤ t^2*A-2*t*D+Q at hp + nlinarith + have H := discrim_le_zero hn + unfold discrim at H + change D^2 ≤ A*Q + nlinarith + +lemma rawRMS_add {n : ℕ} (ψ : H1Vector n) + (f g : Configuration n → ℝ) (hf : Measurable f) (hg : Measurable g) + {B C : ℝ} (hB : ∀ x, |f x| ≤ B) (hC : ∀ x, |g x| ≤ C) : + rawRMS ψ (fun x => f x+g x) ≤ rawRMS ψ f+rawRMS ψ g := by + have hff s := boundedObservable_integrable ψ (fun x => (f x)^2) (hf.pow_const 2) + (fun x => by rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hB x) 2) s + have hgg s := boundedObservable_integrable ψ (fun x => (g x)^2) (hg.pow_const 2) + (fun x => by rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hC x) 2) s + have hfg s := boundedObservable_integrable ψ (fun x => f x*g x) (hf.mul hg) + (fun x => by rw [abs_mul]; exact mul_le_mul (hB x) (hC x) (abs_nonneg _) ((abs_nonneg _).trans (hB x))) s + have he : rawRMS ψ (fun x => f x+g x)^2 = + rawRMS ψ f^2+2*potentialForm (fun x => f x*g x) ψ+rawRMS ψ g^2 := by + simp only [rawRMS_sq,potentialForm] + rw [Finset.mul_sum,←Finset.sum_add_distrib,←Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro s hs + have hi : Integrable (fun x => (f x)^2*‖ψ.value s x‖^2+2*((f x*g x)*‖ψ.value s x‖^2)) := + (hff s).add ((hfg s).const_mul 2) + calc + _ = ∫ x, ((f x)^2*‖ψ.value s x‖^2+2*((f x*g x)*‖ψ.value s x‖^2))+ + (g x)^2*‖ψ.value s x‖^2 := integral_congr_ae (Eventually.of_forall (fun _ => by ring)) + _ = _ := by rw [integral_add hi (hgg s), + integral_add (hff s) ((hfg s).const_mul _),integral_const_mul] + have hcs := potentialForm_bounded_cauchy ψ f g hf hg hB hC + rw [←rawRMS_sq,←rawRMS_sq] at hcs + have H : potentialForm (fun x => f x*g x) ψ ≤ rawRMS ψ f*rawRMS ψ g := by + have hh : |potentialForm (fun x => f x*g x) ψ| ≤ rawRMS ψ f*rawRMS ψ g := + (sq_le_sq₀ (abs_nonneg _) (mul_nonneg (rawRMS_nonneg ψ f) (rawRMS_nonneg ψ g))).mp + (by simpa only [sq_abs,mul_pow] using hcs) + exact (le_abs_self _).trans hh + nlinarith [rawRMS_nonneg ψ f,rawRMS_nonneg ψ g,rawRMS_nonneg ψ (fun x => f x+g x)] + +lemma rawRMS_const_mul {n : ℕ} (ψ : H1Vector n) (f : Configuration n → ℝ) + {c : ℝ} (hc : 0 ≤ c) : rawRMS ψ (fun x => c*f x)=c*rawRMS ψ f := by + unfold rawRMS potentialForm + have he : (∑ s : Spins n, ∫ x, (c*f x)^2*‖ψ.value s x‖^2)= + c^2*(∑ s : Spins n, ∫ x, (f x)^2*‖ψ.value s x‖^2) := by + simp only [mul_pow,mul_assoc,integral_const_mul,←Finset.mul_sum] + rw [he,Real.sqrt_mul (sq_nonneg c),Real.sqrt_sq hc] + +lemma rawRMS_const {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) {c : ℝ} (hc : 0≤c) : + rawRMS ψ (fun _ => c)=c := by + unfold rawRMS + rw [potentialForm_const,hm,mul_one,Real.sqrt_sq hc] + +lemma rawRMS_mono {n : ℕ} (ψ : H1Vector n) + (f g : Configuration n → ℝ) (hf : Measurable f) (hg : Measurable g) + {B C : ℝ} (hB : ∀ x, |f x| ≤ B) (hC : ∀ x, |g x| ≤ C) + (hf0 : ∀ x, 0 ≤ f x) (hfg : ∀ x, f x ≤ g x) : rawRMS ψ f ≤ rawRMS ψ g := by + apply Real.sqrt_le_sqrt + apply potentialForm_mono_bounded ψ _ _ (hf.pow_const 2) (hg.pow_const 2) + (fun x => by rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hB x) 2) + (fun x => by rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hC x) 2) + exact fun x => pow_le_pow_left₀ (hf0 x) (hfg x) 2 + +end Coulomb +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff Topology +noncomputable section +namespace Coulomb + +def ShellLabels (n : ℕ) : ℕ → Type + | 0 => Unit + | k+1 => ShellLabels n k × (Fin n → Fin 2) + +instance shellLabelsFintype (n k : ℕ) : Fintype (ShellLabels n k) := by + induction k with + | zero => exact inferInstanceAs (Fintype Unit) + | succ k ih => exact inferInstanceAs (Fintype (ShellLabels n k × (Fin n → Fin 2))) + +def shellVector {n : ℕ} (ψ : H1Vector n) (y : Space) + (r : ℕ → {r : ℝ // 0 ψ + | k+1, p => (shellVector ψ y r k p.1).labelCut (radialCut y (r k).val) + (radialCut_smooth y _) (radialCut_partition y _) + (radialCutCoefficient/(r k).val) + (div_nonneg radialCutCoefficient_pos.le (r k).property.le) + (radialCut_derivative_bound y (r k).property) p.2 + +theorem shellVector_conserves {n : ℕ} (ψ : H1Vector n) (y : Space) + (r : ℕ → {r : ℝ // 0 + have : Unique (ShellLabels n 0) := inferInstanceAs (Unique Unit) + simp only [Fintype.sum_unique, shellVector] + | succ k ih => + change (∑ p : ShellLabels n k × (Fin n → Fin 2), _) = _ + rw [Fintype.sum_prod_type] + simp_rw [shellVector,potentialForm_labelCut _ _ _ _ _ _ _ V hV hB] + exact ih + +lemma shellVector_population {n : ℕ} (ψ : H1Vector n) (y : Space) + (r : ℕ → {r : ℝ // 0 by rw [abs_of_nonneg (localCount_nonneg A x)]; exact localCount_le A x) + +theorem shellVector_form_le {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + (y : Space) (r : ℕ → {r : ℝ // 0 + have : Unique (ShellLabels n 0) := inferInstanceAs (Unique Unit) + simp only [Fintype.sum_unique, shellVector, Finset.range_zero, Finset.sum_empty, add_zero, le_refl] + | succ k ih => + change (∑ p : ShellLabels n k × (Fin n → Fin 2), _) ≤ _ + rw [Fintype.sum_prod_type] + calc + _ ≤ ∑ p : ShellLabels n k, (form S (shellVector ψ y r k p) + + 3*(radialCutCoefficient/(r k).val)^2* + expectedPopulation (shellVector ψ y r k p) (imsShell y (r k).val)) := by + apply Finset.sum_le_sum + intro p hp + exact form_radial_labelCut_shell S (shellVector ψ y r k p) y (r k).property + _ = (∑ p : ShellLabels n k, form S (shellVector ψ y r k p)) + + 3*(radialCutCoefficient/(r k).val)^2*expectedPopulation ψ (imsShell y (r k).val) := by + rw [Finset.sum_add_distrib,←Finset.mul_sum, + shellVector_population ψ y r k (measurableSet_imsShell _ _)] + _ ≤ _ := by rw [Finset.sum_range_succ]; linarith + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawThomasFermiEnergy.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawThomasFermiEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b2ffec84329cc562e6d6c327082681bace6b6d8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RawThomasFermiEnergy.lean @@ -0,0 +1,340 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.WindowCoulomb +import OAI.Analysis.CoulombRadii.Packets.FineKernelShiftCoulombIntegrable +import OAI.Analysis.CoulombRadii.Localization.DeletedLabels + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +def rawThomasFermiEnergy (Φ ρ : Space → ℝ) : ℝ := + thomasFermiCoefficient*(∫ y, ρ y^(5/3:ℝ)) - (∫ y, Φ y*ρ y) + coulombBilinear ρ ρ/2 + +lemma sliceExpectation_congr_ae {m k : ℕ} (ψ : H1Vector (m+k)) + {f g : Spins m → Configuration m → ℝ} (h : ∀ s, f s =ᵐ[volume] g s) : + sliceExpectation ψ f = sliceExpectation ψ g := by + apply Finset.sum_congr rfl + intro s _ + apply integral_congr_ae + exact (h s).mono fun x hx => congrArg (mass (ψ.coreSlice s x)*·) hx + +lemma discreteFineTF_eq_raw {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) (s : Spins m) (x : Configuration m) + {A : Set Space} (hu : SpatiallySupported (ψ.coreSlice s x).normalized A) + (hnuc : ∀ j i, i ∈ r x → Real.sqrt 3*b ≤ ‖S.position j-position x i‖) + (hcore : ∀ z ∈ A, ∀ i ∈ r x, Real.sqrt 3*b ≤ ‖z-position x i‖) : + discreteFineTF S ψ b r s x = rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (r x) (position x)) := by + unfold discreteFineTF rawThomasFermiEnergy retainedFinePower retainedFineCoulomb + rw [coreScreenedField_retainedFine_eq S (ψ.coreSlice s x).normalized hu hb (r x) (position x) hnuc hcore] + ring + +theorem conditional_source_free_lower {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (hψ : ∀ (s : Spins k) (p : Equiv.Perm (Fin m)) (t : Spins m), + ∀ᵐ z, ψ.value (outerAppend s t ∘ outerPerm k p) (permute (outerPerm k p) z) = + (((outerPerm k p).sign : ℤ) : ℂ)*ψ.value (outerAppend s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (F : Spins m → Configuration m → ℝ) + (hFi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*(F s x*(deletedLabels r x).card))) + (hcap : ∀ s, ∀ᵐ x, ∀ i ∈ deletedLabels r x, + coreScreenedField S (ψ.coreSlice s x).normalized (position x i) ≤ F s x) + (A : Spins m → Configuration m → Set Space) + (hsupport : ∀ s, ∀ᵐ x, SpatiallySupported (ψ.coreSlice s x).normalized (A s x)) + (hnuc : ∀ s : Spins m, ∀ᵐ x, ∀ j i, i ∈ r x → Real.sqrt 3*b ≤ ‖S.position j-position x i‖) + (hcore : ∀ s, ∀ᵐ x, ∀ z ∈ A s x, ∀ i ∈ r x, Real.sqrt 3*b ≤ ‖z-position x i‖) : + sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized + + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (r x) (position x))) - + sliceExpectation ψ (fun s x => F s x*(deletedLabels r x).card) - fineLocalizationError m b*mass ψ ≤ form S ψ := by + have he : sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized + discreteFineTF S ψ b r s x) = + sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized + + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (r x) (position x))) := by + apply sliceExpectation_congr_ae + intro s + filter_upwards [hsupport s, hnuc s, hcore s] with x hs hn hc + rw [discreteFineTF_eq_raw S ψ hb r s x hs hn hc] + rw [←he] + exact conditional_fine_lower S ψ hψ hb r hr F hFi hcap + +lemma source_free_trial_raw {M k : ℕ} (S : Nuclei M) (u : H1Vector k) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hR : 0 < R) (hgs : ∀ y, R < ‖y‖ → g y = 0) + (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (ht : Integrable (fun y => ρ y^(5/3:ℝ))) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) + (hs : ∀ y, y ∉ K → ρ y = 0) (hsu : SpatiallySupported u A) + (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) + (hcore : ∀ a ∈ A, ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) + (hnuc : ∀ j y, ρ y ≠ 0 → R ≤ ‖S.position j-y‖) : + unrestrictedFormBottom S ≤ ((form S u+rawThomasFermiEnergy (coreScreenedField S u) ρ+ + (1/2:ℝ)*(∫ y, ρ y)*(∑ b : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single b 1))^2) : ℝ) : EReal) := by + have H := source_free_trial_in_hole S u hu hmu g hg hgc hrad hR hgs ρ hp hm ht K A hK hA hs hsu hsep hcore hnuc + convert H using 1 + congr 1 + have he : coulombBilinear ρ ρ = + ∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2) := by + unfold coulombBilinear + apply integral_congr_ae; exact Eventually.of_forall (fun _ => by ring) + unfold rawThomasFermiEnergy + rw [he] + unfold thomasFermiCoefficient thomasFermiKineticConstant + ring + +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +def SourceFreeHoleDensity {M k : ℕ} (S : Nuclei M) (u : H1Vector k) + (g : 𝓢(Space,ℝ)) (R : ℝ) (ρ : Space → ℝ) (K A : Set Space) : Prop := + (∀ y, 0 ≤ ρ y) ∧ Measurable ρ ∧ Integrable (fun y => ρ y^(5/3:ℝ)) ∧ + IsCompact K ∧ IsClosed A ∧ (∀ y, y ∉ K → ρ y=0) ∧ SpatiallySupported u A ∧ + Disjoint A (K+tsupport (g : Space → ℝ)) ∧ + (∀ a ∈ A, ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) ∧ + (∀ j y, ρ y ≠ 0 → R ≤ ‖S.position j-y‖) + +def packetKineticError (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) : ℝ := + (1/2:ℝ)*(∫ y, ρ y)*(∑ b : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single b 1))^2) + +lemma source_free_trial_from_density {M k : ℕ} (S : Nuclei M) (u : H1Vector k) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hR : 0 < R) (hgs : ∀ y, R < ‖y‖ → g y = 0) + (ρ : Space → ℝ) (K A : Set Space) (hρ : SourceFreeHoleDensity S u g R ρ K A) : + unrestrictedFormBottom S ≤ ((form S u+rawThomasFermiEnergy (coreScreenedField S u) ρ+ + packetKineticError g ρ : ℝ) : EReal) := by + rcases hρ with ⟨hp,hm,ht,hK,hA,hs,hsu,hsep,hcore,hnuc⟩ + exact source_free_trial_raw S u hu hmu g hg hgc hrad hR hgs ρ hp hm ht K A hK hA hs hsu hsep hcore hnuc + +lemma sliceExpectation_number {m k : ℕ} (ψ : H1Vector (m+k)) (E : ℝ) : + sliceExpectation ψ (fun _ _ => E) = E*mass ψ := by + simp only [sliceExpectation, mul_comm (mass _) E, integral_const_mul, ←Finset.mul_sum] + rw [integral_mass_coreSlice] + +theorem conditional_source_free_upper {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (hcoreAnti : ∀ s, ∀ᵐ x, Antisymmetric (ψ.coreSlice s x)) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hR : 0 < R) (hgs : ∀ y, R < ‖y‖ → g y = 0) + (ρ : Spins m → Configuration m → Space → ℝ) + (K A : Spins m → Configuration m → Set Space) + (hρ : ∀ s, ∀ᵐ x, SourceFreeHoleDensity S (ψ.coreSlice s x).normalized g R (ρ s x) (K s x) (A s x)) + (hTi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)* + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x))) + (hKi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*packetKineticError g (ρ s x))) + {E : ℝ} (hE : (E : EReal) ≤ unrestrictedFormBottom S) : + E*mass ψ ≤ sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized+ + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x)) + + sliceExpectation ψ (fun s x => packetKineticError g (ρ s x)) := by + have hCi := normalized_coreForm_weight_integrable S ψ + have hCT (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(form S (ψ.coreSlice s x).normalized+ + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x))) := by + apply ((hCi s).add (hTi s)).congr + exact Eventually.of_forall (fun x => (mul_add ..).symm) + rw [←sliceExpectation_add ψ _ _ hCT hKi] + rw [←sliceExpectation_number ψ E] + apply Finset.sum_le_sum + intro s _ + apply integral_mono_ae + (by simpa only [mul_comm (mass _) E] using (mass_coreSlice_integrable ψ s).const_mul E) + (by + apply ((hCT s).add (hKi s)).congr + exact Eventually.of_forall (fun x => (mul_add ..).symm)) + filter_upwards [hcoreAnti s, hρ s] with x hx hρx + by_cases hz : mass (ψ.coreSlice s x)=0 + · simp [hz] + · have hp : 0 < mass (ψ.coreSlice s x) := lt_of_le_of_ne (mass_nonneg _) (Ne.symm hz) + have H := source_free_trial_from_density S (ψ.coreSlice s x).normalized hx.normalized + (mass_normalized _ hp) g hg hgc hrad hR hgs (ρ s x) (K s x) (A s x) hρx + have HE : E ≤ form S (ψ.coreSlice s x).normalized + + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x)+packetKineticError g (ρ s x) := + EReal.coe_le_coe_iff.mp (hE.trans H) + exact mul_le_mul_of_nonneg_left HE hp.le + +theorem source_free_patch_comparison {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (houterAnti : ∀ (s : Spins k) (p : Equiv.Perm (Fin m)) (t : Spins m), + ∀ᵐ z, ψ.value (outerAppend s t ∘ outerPerm k p) (permute (outerPerm k p) z) = + (((outerPerm k p).sign : ℤ) : ℂ)*ψ.value (outerAppend s t) z) + (hcoreAnti : ∀ s, ∀ᵐ x, Antisymmetric (ψ.coreSlice s x)) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (F : Spins m → Configuration m → ℝ) + (hFi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*(F s x*(deletedLabels r x).card))) + (hcap : ∀ s, ∀ᵐ x, ∀ i ∈ deletedLabels r x, + coreScreenedField S (ψ.coreSlice s x).normalized (position x i) ≤ F s x) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hR : 0 < R) (hgs : ∀ y, R < ‖y‖ → g y = 0) + (ρ : Spins m → Configuration m → Space → ℝ) + (K A : Spins m → Configuration m → Set Space) + (hρ : ∀ s, ∀ᵐ x, SourceFreeHoleDensity S (ψ.coreSlice s x).normalized g R (ρ s x) (K s x) (A s x)) + (hnuc : ∀ s : Spins m, ∀ᵐ x, ∀ j i, i ∈ r x → Real.sqrt 3*b ≤ ‖S.position j-position x i‖) + (hcore : ∀ s, ∀ᵐ x, ∀ z ∈ A s x, ∀ i ∈ r x, Real.sqrt 3*b ≤ ‖z-position x i‖) + (hTi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)* + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x))) + (hKi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*packetKineticError g (ρ s x))) + {E : ℝ} (hE : (E : EReal) ≤ unrestrictedFormBottom S) : + sliceExpectation ψ (fun s x => + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (retainedFineDensity b (r x) (position x)) - + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x)) ≤ + form S ψ-E*mass ψ + sliceExpectation ψ (fun s x => packetKineticError g (ρ s x)) + + sliceExpectation ψ (fun s x => F s x*(deletedLabels r x).card) +fineLocalizationError m b*mass ψ := by + have hs : ∀ s, ∀ᵐ x, SpatiallySupported (ψ.coreSlice s x).normalized (A s x) := by + intro s; exact (hρ s).mono fun x h => h.2.2.2.2.2.2.1 + have hσeq (s : Spins m) : discreteFineTF S ψ b r s =ᵐ[volume] + (fun x => rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (r x) (position x))) := by + filter_upwards [hs s, hnuc s, hcore s] with x hx hy hz + exact discreteFineTF_eq_raw S ψ hb r s x hx hy hz + have hσi (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)* + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (retainedFineDensity b (r x) (position x))) := by + apply (discreteFineTF_weight_integrable S ψ hb r hr s).congr + exact (hσeq s).mono fun x hx => congrArg (mass (ψ.coreSlice s x)*·) hx + have HL := conditional_source_free_lower S ψ houterAnti hb r hr F hFi hcap A hs hnuc hcore + have HU := conditional_source_free_upper S ψ hcoreAnti g hg hgc hrad hR hgs ρ K A hρ hTi hKi hE + rw [sliceExpectation_add ψ _ _ (normalized_coreForm_weight_integrable S ψ) hσi] at HL + rw [sliceExpectation_add ψ _ _ (normalized_coreForm_weight_integrable S ψ) hTi] at HU + rw [sliceExpectation_sub ψ _ _ hσi hTi] + linarith +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RestrictedField.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RestrictedField.lean new file mode 100644 index 0000000000000000000000000000000000000000..5203a1946c69807469e0fa4ebfe1fe529aa3bf5b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RestrictedField.lean @@ -0,0 +1,215 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.UniformBall + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def restrictedCorePotential {k : ℕ} (u : H1Vector k) (A : Set Space) (y : Space) : ℝ := + ∑ s : Spins k, ∑ i : Fin k, ∫ x : Configuration k, + if position x i ∈ A then coulombKernel (position x i-y)*‖u.value s x‖^2 else 0 + +lemma restrictedCore_integrable {k : ℕ} (u : H1Vector k) {A : Set Space} + (hA : MeasurableSet A) (s : Spins k) (i : Fin k) (y : Space) : + Integrable (fun x => if position x i ∈ A then coulombKernel (position x i-y)*‖u.value s x‖^2 else 0) := by + exact ((u.nuclear_coulomb_integrable_bound s i y (by norm_num : (0:ℝ)<1)).1).indicator + (hA.preimage (continuous_position i).measurable) + +lemma restrictedCorePotential_nonneg {k : ℕ} (u : H1Vector k) (A : Set Space) (y : Space) : + 0 ≤ restrictedCorePotential u A y := by + apply Finset.sum_nonneg + intro s hs + apply Finset.sum_nonneg + intro i hi + apply integral_nonneg + intro x + dsimp only [Pi.zero_apply] + split_ifs <;> first | exact mul_nonneg (inv_nonneg.mpr (norm_nonneg _)) (sq_nonneg _) | exact le_rfl + +lemma restrictedCorePotential_le {k : ℕ} (u : H1Vector k) {A : Set Space} + (hA : MeasurableSet A) (y : Space) : restrictedCorePotential u A y ≤ coreCoulombPotential u y := by + apply Finset.sum_le_sum + intro s hs + apply Finset.sum_le_sum + intro i hi + apply integral_mono (restrictedCore_integrable u hA s i y) + (u.nuclear_coulomb_integrable_bound s i y (by norm_num : (0:ℝ)<1)).1 + intro x + dsimp only [Pi.zero_apply] + split_ifs <;> first | exact le_rfl | exact mul_nonneg (inv_nonneg.mpr (norm_nonneg _)) (sq_nonneg _) + +lemma restrictedCorePotential_mono {k : ℕ} (u : H1Vector k) {A B : Set Space} + (hA : MeasurableSet A) (hB : MeasurableSet B) (hAB : A ⊆ B) (y : Space) : + restrictedCorePotential u A y ≤ restrictedCorePotential u B y := by + apply Finset.sum_le_sum + intro s hs + apply Finset.sum_le_sum + intro i hi + apply integral_mono (restrictedCore_integrable u hA s i y) (restrictedCore_integrable u hB s i y) + intro x + by_cases h : position x i ∈ A + · simp [h,hAB h] + · simp only [ite_eq_right h] + split_ifs <;> first | exact mul_nonneg (inv_nonneg.mpr (norm_nonneg _)) (sq_nonneg _) | exact le_rfl + +lemma restrictedCorePotential_eq {k : ℕ} (u : H1Vector k) {A : Set Space} + (hu : SpatiallySupported u A) (y : Space) : restrictedCorePotential u A y=coreCoulombPotential u y := by + apply Finset.sum_congr rfl + intro s hs + apply Finset.sum_congr rfl + intro i hi + apply integral_congr_ae + filter_upwards [hu s] with x hx + by_cases h : position x i ∈ A + · simp [h] + · have hz : u.value s x=0 := hx (fun hh => h (hh i)) + simp [h,hz] + +lemma restrictedCorePotential_aestronglyMeasurable {k : ℕ} (u : H1Vector k) + {A : Set Space} (hA : MeasurableSet A) : AEStronglyMeasurable (restrictedCorePotential u A) volume := by + unfold restrictedCorePotential + apply Finset.aestronglyMeasurable_fun_sum + intro s hs + apply Finset.aestronglyMeasurable_fun_sum + intro i hi + have hK : AEStronglyMeasurable (fun z : Configuration k × Space => + coulombKernel (position z.1 i-z.2)*‖u.value s z.1‖^2) (volume.prod volume) := + ((((continuous_position i).measurable.comp measurable_fst).sub measurable_snd).norm.inv.aestronglyMeasurable).mul + ((u.value_L2 s).aestronglyMeasurable.norm.pow 2).comp_fst + have H := hK.indicator (hA.preimage ((continuous_position i).measurable.comp measurable_fst)) + exact H.prod_swap.integral_prod_right' + +lemma restrictedCore_density_prod_integrable {k : ℕ} (u : H1Vector k) + {A : Set Space} (hA : MeasurableSet A) (s : Spins k) (i : Fin k) + (d : Space → ℝ) (hd : Integrable d) : + Integrable (fun z : Configuration k × Space => + if position z.1 i ∈ A then coulombKernel (position z.1 i-z.2)*‖u.value s z.1‖^2*d z.2 else 0) + (volume.prod volume) := by + exact (u.coulomb_density_prod_integrable s i d hd).indicator + (hA.preimage ((continuous_position i).measurable.comp measurable_fst)) + +lemma restrictedCorePotential_mul_integrable {k : ℕ} (u : H1Vector k) + {A : Set Space} (hA : MeasurableSet A) (d : Space → ℝ) (hd : Integrable d) : + Integrable (fun y => restrictedCorePotential u A y*d y) := by + simp only [restrictedCorePotential,Finset.sum_mul] + apply integrable_finsetSum + intro s hs + apply integrable_finsetSum + intro i hi + have H := (restrictedCore_density_prod_integrable u hA s i d hd).integral_prod_right + apply H.congr + filter_upwards [] with y + rw [← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with x + split_ifs <;> simp + +lemma restrictedCorePotential_fubini {k : ℕ} (u : H1Vector k) + {A : Set Space} (hA : MeasurableSet A) (d : Space → ℝ) (hd : Integrable d) : + (∫ y, restrictedCorePotential u A y*d y)= + ∑ s : Spins k, ∑ i : Fin k, ∫ x, + if position x i ∈ A then (∫ y, coulombKernel (position x i-y)*d y)*‖u.value s x‖^2 else 0 := by + have H (s : Spins k) (i : Fin k) := restrictedCore_density_prod_integrable u hA s i d hd + have hi (s : Spins k) (i : Fin k) : + Integrable (fun y => (∫ x, if position x i ∈ A then coulombKernel (position x i-y)*‖u.value s x‖^2 else 0)*d y) := by + apply (H s i).integral_prod_right.congr + filter_upwards [] with y + rw [← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with x + split_ifs <;> simp + simp only [restrictedCorePotential,Finset.sum_mul] + rw [integral_finsetSum _ (fun s _ => integrable_finsetSum _ (fun i _ => hi s i))] + apply Finset.sum_congr rfl + intro s hs + rw [integral_finsetSum _ (fun i _ => hi s i)] + apply Finset.sum_congr rfl + intro i hi' + calc + _ = ∫ y, ∫ x, if position x i ∈ A then coulombKernel (position x i-y)*‖u.value s x‖^2*d y else 0 := by + apply integral_congr_ae + filter_upwards [] with y + rw [← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with x + split_ifs <;> simp + _ = ∫ x, ∫ y, if position x i ∈ A then coulombKernel (position x i-y)*‖u.value s x‖^2*d y else 0 := + (integral_integral_swap (H s i)).symm + _ = _ := by + apply integral_congr_ae + filter_upwards [] with x + by_cases h : position x i ∈ A + · simp only [ite_eq_left h,← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with y + ring + · simp [h] + +lemma restrictedCorePotential_ballCloud {k : ℕ} (u : H1Vector k) + {A : Set Space} (hA : MeasurableSet A) {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y : Space) + (hsep : ∀ z ∈ A, a ≤ ‖z-y‖) : + (∫ z, restrictedCorePotential u A z*ballCloud y a M z)=M*restrictedCorePotential u A y := by + rw [restrictedCorePotential_fubini u hA _ (ballCloud_integrable a M y)] + simp only [restrictedCorePotential,Finset.mul_sum,← integral_const_mul] + apply Finset.sum_congr rfl + intro s hs + apply Finset.sum_congr rfl + intro i hi + apply integral_congr_ae + filter_upwards [] with x + by_cases h : position x i ∈ A + · rw [ite_eq_left h,ite_eq_left h,ballCloud_coulomb ha hM y (position x i) (hsep _ h)] + ring + · simp [h] + +def restrictedOutPotential {m : ℕ} (x : Configuration m) (A : Set Space) (y : Space) : ℝ := + ∑ i : Fin m, if position x i ∈ A then coulombKernel (position x i-y) else 0 + +lemma restrictedOutPotential_nonneg {m : ℕ} (x : Configuration m) (A : Set Space) (y : Space) : + 0 ≤ restrictedOutPotential x A y := by + apply Finset.sum_nonneg + intro i hi + split_ifs <;> first | exact inv_nonneg.mpr (norm_nonneg _) | exact le_rfl + +lemma restrictedOutPotential_mono {m : ℕ} (x : Configuration m) {A B : Set Space} + (hAB : A ⊆ B) (y : Space) : restrictedOutPotential x A y ≤ restrictedOutPotential x B y := by + apply Finset.sum_le_sum + intro i hi + by_cases h : position x i ∈ A + · simp [h,hAB h] + · simp only [ite_eq_right h] + split_ifs <;> first | exact inv_nonneg.mpr (norm_nonneg _) | exact le_rfl + +def recordedFarField {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (A : Set Space) (y : Space) : ℝ := + attraction S y-restrictedCorePotential u A y-restrictedOutPotential x A y + +lemma recordedFarField_le_attraction {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (A : Set Space) (y : Space) : recordedFarField S u x A y ≤ attraction S y := by + unfold recordedFarField + linarith [restrictedCorePotential_nonneg u A y,restrictedOutPotential_nonneg x A y] + +lemma recordedFarField_anti {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) {A B : Set Space} (hA : MeasurableSet A) (hB : MeasurableSet B) + (hAB : A ⊆ B) (y : Space) : recordedFarField S u x B y ≤ recordedFarField S u x A y := by + unfold recordedFarField + linarith [restrictedCorePotential_mono u hA hB hAB y,restrictedOutPotential_mono x hAB y] + +lemma coreField_le_far_addback {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) {A : Set Space} (hA : MeasurableSet A) (y : Space) : + coreScreenedField S u y ≤ recordedFarField S u x A y+restrictedOutPotential x A y := by + unfold coreScreenedField recordedFarField + linarith [restrictedCorePotential_le u hA y] + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFineDensity.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFineDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c3b164c749ab358a0f989cd0faba6626a16a41c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFineDensity.lean @@ -0,0 +1,330 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.RotatedDensityPower +import OAI.Analysis.CoulombRadii.FieldAnalysis.CoulombBilinear + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def retainedFineDensity {n : ℕ} (b : ℝ) (r : Finset (Fin n)) + (x : Fin n → Space) (y : Space) : ℝ := ∑ i ∈ r, fineKernel b (y-x i) + +lemma retainedFineDensity_nonneg {n : ℕ} (b : ℝ) (r : Finset (Fin n)) + (x : Fin n → Space) (y : Space) : 0 ≤ retainedFineDensity b r x y := + Finset.sum_nonneg (fun _ _ => fineKernel_nonneg ..) + +lemma retainedFineDensity_le {n : ℕ} (b : ℝ) (r : Finset (Fin n)) + (x : Fin n → Space) (y : Space) : retainedFineDensity b r x y ≤ fineDensity b x y := by + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ r) + (fun _ _ _ => fineKernel_nonneg ..) + +lemma retainedFineDensity_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) : Integrable (retainedFineDensity b r x) := + integrable_finsetSum _ (fun i _ => fineKernel_shift_integrable hb (x i)) + +lemma retainedFineDensity_measurable {n : ℕ} (b : ℝ) (r : Finset (Fin n)) + (x : Fin n → Space) : Measurable (retainedFineDensity b r x) := + Finset.measurable_sum _ (fun _ _ => (fineKernel_continuous b).measurable.comp (by fun_prop)) + +lemma retainedFineDensity_integral {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) : + (∫ y, retainedFineDensity b r x y) = r.card := by + unfold retainedFineDensity + rw [integral_finsetSum _ (fun i _ => fineKernel_shift_integrable hb (x i))] + simp_rw [fineKernel_shift_integral hb] + simp + +lemma retainedFineDensity_coulomb_expansion {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) : + coulombBilinear (retainedFineDensity b r x) (retainedFineDensity b r x) = + ∑ i ∈ r, ∑ j ∈ r, coulombBilinear (fun y => fineKernel b (y-x i)) + (fun y => fineKernel b (y-x j)) := by + have hi (i j : Fin n) : Integrable (fun p : Space × Space => + fineKernel b (p.1-x i)*fineKernel b (p.2-x j)*coulombKernel (p.1-p.2)) := + coulomb_pair_integrable (fineKernel_shift_integrable hb _) ((fineKernel_continuous b).measurable.comp (by fun_prop)) + (fineKernel_shift_integrable hb _) ((fineKernel_continuous b).measurable.comp (by fun_prop)) + (fun y => by rw [Real.norm_of_nonneg (fineKernel_nonneg ..)]; exact fineKernel_le hb _) + unfold coulombBilinear retainedFineDensity + simp_rw [Finset.sum_mul_sum, Finset.sum_mul] + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hi i j))] + congr 1 + ext i + exact integral_finsetSum _ (fun j _ => hi i j) + +lemma coulombKernel_sub_symm (x y : Space) : coulombKernel (x-y) = coulombKernel (y-x) := by + unfold coulombKernel + rw [norm_sub_rev] + +theorem retained_fine_pair_lower {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) (hx : Function.Injective x) : + coulombBilinear (retainedFineDensity b r x) (retainedFineDensity b r x)/2 - + ((2*Real.pi+1)/(2*b)) * r.card ≤ + ∑ i : Fin n, ∑ j : Fin n, if i < j then coulombKernel (x i-x j) else 0 := by + have hdiag : (∑ i ∈ r, ∑ j ∈ r, + coulombBilinear (fun y => fineKernel b (y-x i)) (fun y => fineKernel b (y-x j))) ≤ + ∑ i ∈ r, ∑ j ∈ r, if i = j then (2*Real.pi+1)/b else coulombKernel (x i-x j) := by + apply Finset.sum_le_sum + intro i hi + apply Finset.sum_le_sum + intro j hj + split_ifs with h + · subst j; exact fineKernel_pair_self_le hb _ + · exact fineKernel_pair_le hb (hx.ne h) + have hs (i : Fin n) : (∑ j ∈ r, if i = j then (2*Real.pi+1)/b else coulombKernel (x i-x j)) = + (if i ∈ r then (2*Real.pi+1)/b else 0) + ∑ j ∈ r, coulombKernel (x i-x j) := by + have hterm (j : Fin n) : (if i = j then (2*Real.pi+1)/b else coulombKernel (x i-x j)) = + (if i = j then (2*Real.pi+1)/b else 0) + coulombKernel (x i-x j) := by + by_cases h : i = j + · subst j; simp [coulombKernel] + · simp [h] + simp_rw [hterm, Finset.sum_add_distrib] + simp + have hall : (∑ i ∈ r, ∑ j ∈ r, coulombKernel (x i-x j)) ≤ + ∑ i : Fin n, ∑ j : Fin n, coulombKernel (x i-x j) := by + apply (Finset.sum_le_sum (fun i _ => Finset.sum_le_sum_of_subset_of_nonneg + (Finset.subset_univ r) (fun _ _ _ => coulombKernel_nonneg _))).trans + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ r) + (fun _ _ _ => Finset.sum_nonneg (fun _ _ => coulombKernel_nonneg _)) + have hsplit : (∑ i : Fin n, ∑ j : Fin n, coulombKernel (x i-x j)) = + 2 * (∑ i : Fin n, ∑ j : Fin n, if i < j then coulombKernel (x i-x j) else 0) := by + have h (i j : Fin n) : coulombKernel (x i-x j) = + (if i < j then coulombKernel (x i-x j) else 0) + + (if j < i then coulombKernel (x j-x i) else 0) := by + rcases lt_trichotomy i j with h | h | h + · simp [h, not_lt.mpr h.le] + · subst j; simp [coulombKernel] + · simp only [h, not_lt.mpr h.le, ite_false, ite_true, zero_add] + exact coulombKernel_sub_symm _ _ + calc + _ = ∑ i : Fin n, ∑ j : Fin n, ((if i < j then coulombKernel (x i-x j) else 0) + + (if j < i then coulombKernel (x j-x i) else 0)) := + Finset.sum_congr rfl (fun i _ => Finset.sum_congr rfl (fun j _ => h i j)) + _ = _ := by + simp only [Finset.sum_add_distrib] + rw [Finset.sum_comm (f := fun i j : Fin n => if j < i then coulombKernel (x j-x i) else 0)] + ring + simp_rw [hs] at hdiag + simp only [Finset.sum_add_distrib, Finset.sum_ite_mem, Finset.inter_self, Finset.sum_const, nsmul_eq_mul] at hdiag + rw [hsplit] at hall + rw [retainedFineDensity_coulomb_expansion hb] + have he : ((2*Real.pi+1)/(2*b))*r.card*2 = r.card*((2*Real.pi+1)/b) := by ring + linarith + +lemma ae_position_injective (n : ℕ) : ∀ᵐ x : Configuration n, Function.Injective (position x) := by + have hpair (i j : Fin n) (hij : i ≠ j) : ∀ᵐ x : Configuration n, position x i ≠ position x j := by + let L : Configuration n →ₗ[ℝ] ℝ := + { toFun := fun x => x (i,0)-x (j,0) + map_add' := by intro x y; simp only [PiLp.add_apply]; ring + map_smul' := by intro c x; simp only [PiLp.smul_apply, smul_eq_mul, RingHom.id_apply]; ring } + have hL : LinearMap.ker L ≠ ⊤ := by + intro h + have hx : EuclideanSpace.single (i,0) (1:ℝ) ∈ LinearMap.ker L := by rw [h]; trivial + simp [LinearMap.mem_ker, L, hij] at hx + have hm := Measure.addHaar_submodule (volume : Measure (Configuration n)) (LinearMap.ker L) hL + have hnull : (volume : Measure (Configuration n)) {x | position x i = position x j} = 0 := by + apply measure_mono_null _ hm + intro x hx + change x (i,0)-x (j,0) = 0 + exact sub_eq_zero.mpr (congrArg (fun z : Space => z 0) hx) + rw [ae_iff] + simpa only [not_not] using hnull + simp only [Function.Injective, ae_all_iff] + intro i j + by_cases h : i = j + · exact Eventually.of_forall fun _ _ => h + · exact (hpair i j h).mono fun _ hx he => (hx he).elim + +lemma ae_retained_fine_pair_lower {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) : + ∀ᵐ x : Configuration n, + coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2 - + ((2*Real.pi+1)/(2*b)) * (r x).card ≤ + ∑ i : Fin n, ∑ j : Fin n, if i < j then coulombKernel (position x i-position x j) else 0 := + (ae_position_injective n).mono fun x hx => retained_fine_pair_lower hb (r x) (position x) hx + +lemma retainedFineDensity_eq_sum_ite {n : ℕ} (b : ℝ) (r : Finset (Fin n)) + (x : Fin n → Space) (y : Space) : + retainedFineDensity b r x y = ∑ i, if i ∈ r then fineKernel b (y-x i) else 0 := by + simp [retainedFineDensity, Finset.sum_ite_mem] + +lemma fineDensity_power_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) : + Integrable (fun y => fineDensity b x y ^ (5/3:ℝ)) := by + apply ((fineDensity_integrable hb x).const_mul ((n*(b⁻¹)^3)^(2/3:ℝ))).mono' + · exact ((fineDensity_measurable b x).pow_const _).aestronglyMeasurable + · exact Eventually.of_forall fun y => by + rw [Real.norm_of_nonneg (Real.rpow_nonneg (fineDensity_nonneg ..) _)] + exact rpow_five_thirds_le_linear (fineDensity_nonneg ..) (fineDensity_le hb ..) + +lemma retainedFineDensity_power_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) : + Integrable (fun y => retainedFineDensity b r x y ^ (5/3:ℝ)) := by + apply (fineDensity_power_integrable hb x).mono' + · exact ((retainedFineDensity_measurable b r x).pow_const _).aestronglyMeasurable + · exact Eventually.of_forall fun y => by + rw [Real.norm_of_nonneg (Real.rpow_nonneg (retainedFineDensity_nonneg ..) _)] + exact Real.rpow_le_rpow (retainedFineDensity_nonneg ..) (retainedFineDensity_le ..) (by norm_num) + +lemma retainedFineDensity_power_le {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) : + (∫ y, retainedFineDensity b r x y^(5/3:ℝ)) ≤ fineDensityPower b x := + integral_mono (retainedFineDensity_power_integrable hb r x) (fineDensity_power_integrable hb x) + (fun y => Real.rpow_le_rpow (retainedFineDensity_nonneg ..) (retainedFineDensity_le ..) (by norm_num)) + +lemma retainedFineDensity_power_configuration_measurable {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (fun x => ∫ y, retainedFineDensity b (r x) (position x) y^(5/3:ℝ)) := by + have hm : Measurable (fun p : Configuration n × Space => retainedFineDensity b (r p.1) (position p.1) p.2) := by + simp_rw [retainedFineDensity_eq_sum_ite] + apply Finset.measurable_sum + intro i hi + apply Measurable.ite ((hr i).preimage measurable_fst) + · exact (fineKernel_continuous b).measurable.comp + (measurable_snd.sub ((continuous_position i).measurable.comp measurable_fst)) + · exact measurable_const + exact (hm.pow_const (5/3:ℝ)).stronglyMeasurable.integral_prod_right'.measurable + +lemma retainedFineDensity_power_weight_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + {w : Configuration n → ℝ} (hw : Integrable w) (hw0 : ∀ x, 0 ≤ w x) : + Integrable (fun x => (∫ y, retainedFineDensity b (r x) (position x) y^(5/3:ℝ))*w x) := by + apply (weighted_fineDensityPower_integrable hb hw hw0).mono' + · exact (retainedFineDensity_power_configuration_measurable b r hr).aestronglyMeasurable.mul + hw.aestronglyMeasurable + · exact Eventually.of_forall fun x => by + rw [Real.norm_of_nonneg (mul_nonneg (integral_nonneg (fun y => + Real.rpow_nonneg (retainedFineDensity_nonneg ..) _)) (hw0 x))] + exact mul_le_mul_of_nonneg_right (retainedFineDensity_power_le hb (r x) (position x)) (hw0 x) + +theorem retained_fine_kinetic_lower {n : ℕ} (hn : 0 < n) (ψ : H1Vector n) + (hψ : Antisymmetric ψ) {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * (∑ s, ∫ x : Configuration n, + (∫ y, retainedFineDensity b (r x) (position x) y^(5/3:ℝ))*‖ψ.value s x‖^2) - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n:ℝ)^(4/3:ℝ)) * mass ψ ≤ kinetic ψ := by + apply le_trans _ (fine_density_kinetic_lower hn ψ hψ hb) + apply sub_le_sub_right + apply mul_le_mul_of_nonneg_left _ (by unfold thomasFermiCoefficient; positivity) + apply Finset.sum_le_sum + intro s hs + have hw : Integrable (fun x => ‖ψ.value s x‖^2) := + (ψ.value_L2 s).integrable_norm_pow (p:=2) (by decide) + exact integral_mono (retainedFineDensity_power_weight_integrable hb r hr hw (fun _ => sq_nonneg _)) + (weighted_fineDensityPower_integrable hb hw (fun _ => sq_nonneg _)) + (fun x => mul_le_mul_of_nonneg_right (retainedFineDensity_power_le hb _ _) (sq_nonneg _)) +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFineDensityConfigurationMeasurable.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFineDensityConfigurationMeasurable.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc959c5bad935bcce1efefdbb9e71a29ce8291b4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFineDensityConfigurationMeasurable.lean @@ -0,0 +1,221 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Add +import OAI.Analysis.CoulombRadii.FieldAnalysis.RetainedFineDensity + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb +lemma retainedFineDensity_configuration_measurable {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (fun p : Configuration n × Space => retainedFineDensity b (r p.1) (position p.1) p.2) := by + simp_rw [retainedFineDensity_eq_sum_ite] + apply Finset.measurable_sum + intro i hi + apply Measurable.ite ((hr i).preimage measurable_fst) + · exact (fineKernel_continuous b).measurable.comp + (measurable_snd.sub ((continuous_position i).measurable.comp measurable_fst)) + · exact measurable_const + +lemma retainedFineDensity_coulomb_configuration_measurable {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (fun x => coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))) := by + have hm := retainedFineDensity_configuration_measurable b r hr + have hi : Measurable (fun p : Configuration n × (Space × Space) => + retainedFineDensity b (r p.1) (position p.1) p.2.1 * + retainedFineDensity b (r p.1) (position p.1) p.2.2 * coulombKernel (p.2.1-p.2.2)) := + ((hm.comp (measurable_fst.prodMk (measurable_fst.comp measurable_snd))).mul + (hm.comp (measurable_fst.prodMk (measurable_snd.comp measurable_snd)))).mul + (coulombKernel_measurable.comp (by fun_prop)) + exact hi.stronglyMeasurable.integral_prod_right'.measurable + +lemma retainedFineDensity_coulomb_nonneg {n : ℕ} (b : ℝ) (r : Finset (Fin n)) + (x : Fin n → Space) : + 0 ≤ coulombBilinear (retainedFineDensity b r x) (retainedFineDensity b r x) := + integral_nonneg fun _ => mul_nonneg + (mul_nonneg (retainedFineDensity_nonneg ..) (retainedFineDensity_nonneg ..)) (coulombKernel_nonneg _) + +lemma retainedFineDensity_coulomb_weight_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (ψ : H1Vector n) (s : Spins n) : + Integrable (fun x => (coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2)*‖ψ.value s x‖^2) := by + have hw : Integrable (fun x => ‖ψ.value s x‖^2) := + (ψ.value_L2 s).integrable_norm_pow (p:=2) (by decide) + apply ((ψ.pair_integrable s).add (hw.const_mul (((2*Real.pi+1)/(2*b))*n))).mono' + · exact ((retainedFineDensity_coulomb_configuration_measurable b r hr).div_const 2).aestronglyMeasurable.mul + hw.aestronglyMeasurable + · filter_upwards [ae_retained_fine_pair_lower hb r] with x hx + rw [Real.norm_of_nonneg (mul_nonneg (div_nonneg (retainedFineDensity_coulomb_nonneg ..) (by norm_num)) (sq_nonneg _))] + have hc : ((r x).card : ℝ) ≤ n := by exact_mod_cast (show (r x).card ≤ n by simpa using Finset.card_le_univ (r x)) + have hC : 0 ≤ (2*Real.pi+1)/(2*b) := by positivity + have h := mul_le_mul_of_nonneg_left hc hC + have H := mul_le_mul_of_nonneg_right (show coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2 ≤ + (∑ i : Fin n, ∑ j : Fin n, if i < j then coulombKernel (position x i-position x j) else 0) + + ((2*Real.pi+1)/(2*b))*n by linarith) (sq_nonneg ‖ψ.value s x‖) + simpa only [Pi.add_apply, mul_add, add_mul] using H + +theorem retained_fine_pair_energy_lower {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (ψ : H1Vector n) : + (∑ s, ∫ x : Configuration n, + (coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2)*‖ψ.value s x‖^2) - + (((2*Real.pi+1)/(2*b))*n)*mass ψ ≤ pairEnergy ψ := by + have hs (s : Spins n) : (∫ x : Configuration n, + (coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2)*‖ψ.value s x‖^2) ≤ + (∫ x : Configuration n, (∑ i : Fin n, ∑ j : Fin n, + if i < j then coulombKernel (position x i-position x j) else 0)*‖ψ.value s x‖^2) + + (((2*Real.pi+1)/(2*b))*n)*(∫ x, ‖ψ.value s x‖^2) := by + have hw : Integrable (fun x => ‖ψ.value s x‖^2) := + (ψ.value_L2 s).integrable_norm_pow (p:=2) (by decide) + rw [←integral_const_mul, ←integral_add (ψ.pair_integrable s) (hw.const_mul _)] + apply integral_mono_ae (retainedFineDensity_coulomb_weight_integrable hb r hr ψ s) + ((ψ.pair_integrable s).add (hw.const_mul _)) + filter_upwards [ae_retained_fine_pair_lower hb r] with x hx + have hc : ((r x).card : ℝ) ≤ n := by exact_mod_cast (show (r x).card ≤ n by simpa using Finset.card_le_univ (r x)) + have hC : 0 ≤ (2*Real.pi+1)/(2*b) := by positivity + have h := mul_le_mul_of_nonneg_left hc hC + have H := mul_le_mul_of_nonneg_right (show coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2 ≤ + (∑ i : Fin n, ∑ j : Fin n, if i < j then coulombKernel (position x i-position x j) else 0) + + ((2*Real.pi+1)/(2*b))*n by linarith) (sq_nonneg ‖ψ.value s x‖) + simpa only [Pi.add_apply, mul_add, add_mul] using H + have H := Finset.sum_le_sum (s:=Finset.univ) (fun s _ => hs s) + simp only [Finset.sum_add_distrib, ←Finset.mul_sum] at H + exact sub_le_iff_le_add.mpr H + +theorem retained_fine_energy_lower {n : ℕ} (hn : 0 < n) (ψ : H1Vector n) + (hψ : Antisymmetric ψ) {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * (∑ s, ∫ x : Configuration n, + (∫ y, retainedFineDensity b (r x) (position x) y^(5/3:ℝ))*‖ψ.value s x‖^2) + + (∑ s, ∫ x : Configuration n, + (coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2)*‖ψ.value s x‖^2) - + (((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n:ℝ)^(4/3:ℝ)) + + ((2*Real.pi+1)/(2*b))*n) * mass ψ ≤ kinetic ψ + pairEnergy ψ := by + have h1 := retained_fine_kinetic_lower hn ψ hψ hb r hr + have h2 := retained_fine_pair_energy_lower hb r hr ψ + linarith +end Coulomb + +open MeasureTheory Set +open scoped BigOperators ENNReal + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFinePower.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFinePower.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1a98fbc84fb692af49ef547fcd0c245c9097e0d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RetainedFinePower.lean @@ -0,0 +1,299 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.RetainedFineDensityConfigurationMeasurable +import OAI.Analysis.CoulombRadii.FormDomain.CoreKinetic + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def retainedFinePower {n : ℕ} (b : ℝ) (r : Configuration n → Finset (Fin n)) + (x : Configuration n) : ℝ := + ∫ y, retainedFineDensity b (r x) (position x) y^(5/3:ℝ) + +lemma retainedFinePower_nonneg {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (x : Configuration n) : + 0 ≤ retainedFinePower b r x := + integral_nonneg (fun _ => Real.rpow_nonneg (retainedFineDensity_nonneg ..) _) + +lemma retainedFinePower_bound {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (x : Configuration n) : + retainedFinePower b r x ≤ ((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n := + (retainedFineDensity_power_le hb _ _).trans (fineDensityPower_bound hb _) + +lemma retainedFinePower_measurable {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (retainedFinePower b r) := retainedFineDensity_power_configuration_measurable b r hr + +lemma core_finePower_integrable {m k : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration k → Finset (Fin k)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (ψ : H1Vector (m+k)) (st : Spins (m+k)) : + Integrable (fun z => retainedFinePower b r ((joinConfiguration m k).symm z).2 * + ‖ψ.value st z‖^2) := by + have hw : Integrable (fun z => ‖ψ.value st z‖^2) := + (ψ.value_L2 st).integrable_norm_pow (p:=2) (by decide) + apply (hw.const_mul (((k:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*k)).mono' + · exact ((retainedFinePower_measurable b r hr).comp + (measurable_snd.comp (joinConfiguration m k).symm.continuous.measurable)).aestronglyMeasurable.mul hw.aestronglyMeasurable + · exact Eventually.of_forall fun z => by + rw [Real.norm_of_nonneg (mul_nonneg (retainedFinePower_nonneg ..) (sq_nonneg _))] + exact mul_le_mul_of_nonneg_right (retainedFinePower_bound hb r _) (sq_nonneg _) + +lemma retained_fine_kinetic_lower_all {n : ℕ} (ψ : H1Vector n) + (hψ : Antisymmetric ψ) {b : ℝ} (hb : 0 < b) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * potentialForm (retainedFinePower b r) ψ - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n:ℝ)^(4/3:ℝ)) * mass ψ ≤ kinetic ψ := by + by_cases hn : 0 < n + · exact retained_fine_kinetic_lower hn ψ hψ hb r hr + · have hn : n = 0 := Nat.eq_zero_of_not_pos hn + subst n + have hr0 (x : Configuration 0) : r x = ∅ := Finset.eq_empty_of_forall_notMem (fun i => Fin.elim0 i) + simpa [potentialForm, retainedFinePower, retainedFineDensity, hr0, + Real.zero_rpow (by norm_num : (5/3:ℝ) ≠ 0), Real.zero_rpow (by norm_num : (4/3:ℝ) ≠ 0)] + using (show 0 ≤ kinetic ψ from by unfold kinetic; positivity) + +theorem block_retained_fine_kinetic_lower {m k : ℕ} (ψ : H1Vector (m+k)) + (hψ : ∀ (s : Spins m) (p : Equiv.Perm (Fin k)) (t : Spins k), + ∀ᵐ z ∂volume, ψ.value (Fin.append s t ∘ corePerm m p) (permute (corePerm m p) z) = + (((corePerm m p).sign : ℤ) : ℂ) * ψ.value (Fin.append s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration k → Finset (Fin k)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * potentialForm + (fun z => retainedFinePower b r ((joinConfiguration m k).symm z).2) ψ - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (k:ℝ)^(4/3:ℝ)) * mass ψ ≤ coreKinetic ψ := by + let C := (b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (k:ℝ)^(4/3:ℝ) + have hs (s : Spins m) : + thomasFermiCoefficient * (∫ x, potentialForm (retainedFinePower b r) (ψ.coreSlice s x)) - + C * (∫ x, mass (ψ.coreSlice s x)) ≤ ∫ x, kinetic (ψ.coreSlice s x) := by + rw [←integral_const_mul, ←integral_const_mul, + ←integral_sub ((potentialForm_coreSlice_integrable ψ s _ (fun t => core_finePower_integrable hb r hr ψ (Fin.append s t))).const_mul _) + ((mass_coreSlice_integrable ψ s).const_mul C)] + apply integral_mono_ae + (((potentialForm_coreSlice_integrable ψ s _ (fun t => core_finePower_integrable hb r hr ψ (Fin.append s t))).const_mul _).sub + ((mass_coreSlice_integrable ψ s).const_mul C)) (kinetic_coreSlice_integrable ψ s) + exact (ψ.coreSlice_antisymmetric s (hψ s)).mono fun x hx => + retained_fine_kinetic_lower_all (ψ.coreSlice s x) hx hb r hr + have H := Finset.sum_le_sum (s:=Finset.univ) (fun s _ => hs s) + simp only [Finset.sum_sub_distrib, ←Finset.mul_sum] at H + rw [integral_potentialForm_coreSlice ψ _ (core_finePower_integrable hb r hr ψ), + integral_mass_coreSlice, integral_kinetic_coreSlice] at H + exact H + +def retainedFineCoulomb {n : ℕ} (b : ℝ) (r : Configuration n → Finset (Fin n)) + (x : Configuration n) : ℝ := + coulombBilinear (retainedFineDensity b (r x) (position x)) + (retainedFineDensity b (r x) (position x))/2 + +lemma retainedFineCoulomb_nonneg {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (x : Configuration n) : + 0 ≤ retainedFineCoulomb b r x := + div_nonneg (retainedFineDensity_coulomb_nonneg ..) (by norm_num) + +lemma retainedFineCoulomb_measurable {n : ℕ} (b : ℝ) + (r : Configuration n → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (retainedFineCoulomb b r) := + (retainedFineDensity_coulomb_configuration_measurable b r hr).div_const 2 + +lemma ae_block_position_injective (m k : ℕ) : + ∀ᵐ z : Configuration (m+k), Function.Injective (position ((joinConfiguration m k).symm z).2) := by + filter_upwards [ae_position_injective (m+k)] with z hz + intro i j hij + have h : Fin.natAdd m i = Fin.natAdd m j := hz (by simpa only [position_split_right] using hij) + exact Fin.ext (Nat.add_left_cancel (congrArg Fin.val h)) + +lemma ae_core_fine_pair_bound {m k : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration k → Finset (Fin k)) : + ∀ᵐ z : Configuration (m+k), + retainedFineCoulomb b r ((joinConfiguration m k).symm z).2 ≤ + pairPotential ((joinConfiguration m k).symm z).2 + ((2*Real.pi+1)/(2*b))*k := by + filter_upwards [ae_block_position_injective m k] with z hz + have h := retained_fine_pair_lower hb (r ((joinConfiguration m k).symm z).2) + (position ((joinConfiguration m k).symm z).2) hz + have hc : ((r ((joinConfiguration m k).symm z).2).card : ℝ) ≤ k := by + exact_mod_cast (show (r ((joinConfiguration m k).symm z).2).card ≤ k by simpa using Finset.card_le_univ (r ((joinConfiguration m k).symm z).2)) + have hC : 0 ≤ (2*Real.pi+1)/(2*b) := by positivity + have hh := mul_le_mul_of_nonneg_left hc hC + change retainedFineCoulomb b r ((joinConfiguration m k).symm z).2 - + ((2*Real.pi+1)/(2*b))*(r ((joinConfiguration m k).symm z).2).card ≤ + pairPotential ((joinConfiguration m k).symm z).2 at h + linarith + +lemma core_fineCoulomb_integrable {m k : ℕ} {b : ℝ} (hb : 0 < b) + (r : Configuration k → Finset (Fin k)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (ψ : H1Vector (m+k)) (st : Spins (m+k)) : + Integrable (fun z => retainedFineCoulomb b r ((joinConfiguration m k).symm z).2 * + ‖ψ.value st z‖^2) := by + have hw : Integrable (fun z => ‖ψ.value st z‖^2) := + (ψ.value_L2 st).integrable_norm_pow (p:=2) (by decide) + apply ((ψ.core_pair_integrable st).add (hw.const_mul (((2*Real.pi+1)/(2*b))*k))).mono' + · exact ((retainedFineCoulomb_measurable b r hr).comp + (measurable_snd.comp (joinConfiguration m k).symm.continuous.measurable)).aestronglyMeasurable.mul hw.aestronglyMeasurable + · filter_upwards [ae_core_fine_pair_bound (m:=m) hb r] with z hz + rw [Real.norm_of_nonneg (mul_nonneg (retainedFineCoulomb_nonneg ..) (sq_nonneg _))] + simpa only [add_mul, Pi.add_apply] using mul_le_mul_of_nonneg_right hz (sq_nonneg ‖ψ.value st z‖) + +lemma potentialForm_le_add_const {n : ℕ} (ψ : H1Vector n) + {V W : Configuration n → ℝ} {C : ℝ} + (hV : ∀ s, Integrable (fun x => V x*‖ψ.value s x‖^2)) + (hW : ∀ s, Integrable (fun x => W x*‖ψ.value s x‖^2)) + (h : ∀ᵐ x, V x ≤ W x+C) : + potentialForm V ψ ≤ potentialForm W ψ + C*mass ψ := by + have hs (s : Spins n) : (∫ x, V x*‖ψ.value s x‖^2) ≤ + (∫ x, W x*‖ψ.value s x‖^2)+C*(∫ x, ‖ψ.value s x‖^2) := by + have hw : Integrable (fun x => ‖ψ.value s x‖^2) := + (ψ.value_L2 s).integrable_norm_pow (p:=2) (by decide) + rw [←integral_const_mul, ←integral_add (hW s) (hw.const_mul C)] + apply integral_mono_ae (hV s) ((hW s).add (hw.const_mul C)) + exact h.mono fun x hx => by simpa only [add_mul, Pi.add_apply] using mul_le_mul_of_nonneg_right hx (sq_nonneg ‖ψ.value s x‖) + have H := Finset.sum_le_sum (s:=Finset.univ) (fun s _ => hs s) + simpa only [potentialForm, mass, Finset.sum_add_distrib, ←Finset.mul_sum] using H + +theorem block_retained_fine_pair_lower {m k : ℕ} (ψ : H1Vector (m+k)) + {b : ℝ} (hb : 0 < b) (r : Configuration k → Finset (Fin k)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + potentialForm (fun z => retainedFineCoulomb b r ((joinConfiguration m k).symm z).2) ψ - + (((2*Real.pi+1)/(2*b))*k)*mass ψ ≤ + potentialForm (fun z => pairPotential ((joinConfiguration m k).symm z).2) ψ := + sub_le_iff_le_add.mpr (potentialForm_le_add_const ψ (core_fineCoulomb_integrable hb r hr ψ) + ψ.core_pair_integrable (ae_core_fine_pair_bound hb r)) + +theorem block_retained_fine_energy_lower {m k : ℕ} (ψ : H1Vector (m+k)) + (hψ : ∀ (s : Spins m) (p : Equiv.Perm (Fin k)) (t : Spins k), + ∀ᵐ z ∂volume, ψ.value (Fin.append s t ∘ corePerm m p) (permute (corePerm m p) z) = + (((corePerm m p).sign : ℤ) : ℂ) * ψ.value (Fin.append s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration k → Finset (Fin k)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + thomasFermiCoefficient * potentialForm + (fun z => retainedFinePower b r ((joinConfiguration m k).symm z).2) ψ + + potentialForm (fun z => retainedFineCoulomb b r ((joinConfiguration m k).symm z).2) ψ - + (((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (k:ℝ)^(4/3:ℝ)) + + ((2*Real.pi+1)/(2*b))*k)*mass ψ ≤ + coreKinetic ψ + potentialForm (fun z => pairPotential ((joinConfiguration m k).symm z).2) ψ := by + have h1 := block_retained_fine_kinetic_lower ψ hψ hb r hr + have h2 := block_retained_fine_pair_lower ψ hb r hr + linarith +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RotatedDensityPower.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RotatedDensityPower.lean new file mode 100644 index 0000000000000000000000000000000000000000..51923fa2b79b48e35fa998a320163ea441317a9f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/RotatedDensityPower.lean @@ -0,0 +1,284 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Pullback +import OAI.Analysis.CoulombRadii.Localization.ConfigSupported +import OAI.Analysis.CoulombRadii.FieldAnalysis.CommonIsometryApply +import OAI.Analysis.CoulombRadii.FieldAnalysis.Rotation + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +namespace Coulomb + +lemma flat_fine_density_kinetic_lower_euclidean {n : ℕ} (hn : 0 < n) (ψ : H1Vector n) + (hψ : Antisymmetric ψ) {b : ℝ} (hb : 0 < b) : + thomasFermiCoefficient * + (∑ s, ∫ x : Configuration n, flatDensityPower b x.ofLp * ‖ψ.value s x‖^2) - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n : ℝ)^(4/3 : ℝ)) * mass ψ ≤ + kinetic ψ := by + have H := flat_fine_density_kinetic_lower hn ψ hψ hb + convert H using 1 + congr 2 + apply Finset.sum_congr rfl + intro s _ + exact (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin n × Fin 3)).integral_comp' + (fun x => flatDensityPower b x * ‖ψ.value s (WithLp.toLp 2 x)‖^2) + +lemma commonIsometry_symm {n : ℕ} (L : Space ≃ₗᵢ[ℝ] Space) : + (commonIsometry (n:=n) L).symm = commonIsometry L.symm := by + ext x ij + rfl + +lemma fixed_rotation_fine_density_kinetic_lower {n : ℕ} (hn : 0 < n) (ψ : H1Vector n) + (hψ : Antisymmetric ψ) {b : ℝ} (hb : 0 < b) (Q : Rotation) : + thomasFermiCoefficient * + (∑ s, ∫ x : Configuration n, + (∫ y : Space, rotatedFlatDensity b Q (position x) y^(5/3:ℝ)) * ‖ψ.value s x‖^2) - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n : ℝ)^(4/3 : ℝ)) * mass ψ ≤ + kinetic ψ := by + let L := commonIsometry (n:=n) (rotationIsometry Q) + have has : Antisymmetric (ψ.pullback L.symm) := by + rw [show L.symm = commonIsometry (rotationIsometry Q).symm from commonIsometry_symm _] + exact hψ.pullback_common _ + have H := flat_fine_density_kinetic_lower_euclidean hn (ψ.pullback L.symm) has hb + rw [mass_pullback, kinetic_pullback] at H + convert H using 1 + congr 2 + apply Finset.sum_congr rfl + intro s _ + have hp := (show MeasurePreserving L.toHomeomorph.toMeasurableEquiv volume volume from + L.measurePreserving).integral_comp' + (fun x : Configuration n => flatDensityPower b x.ofLp * ‖ψ.value s (L.symm x)‖^2) + change (∫ x : Configuration n, flatDensityPower b (L x).ofLp * ‖ψ.value s (L.symm (L x))‖^2) = _ at hp + simpa only [H1Vector.pullback, rotatedFlatDensityPower_eq, LinearIsometryEquiv.symm_apply_apply] using hp + +noncomputable def rotatedDensityPower {n : ℕ} (b : ℝ) (Q : Rotation) (x : Configuration n) : ℝ := + ∫ y : Space, rotatedFlatDensity b Q (position x) y^(5/3:ℝ) + +lemma rotatedDensityPower_nonneg {n : ℕ} (b : ℝ) (Q : Rotation) (x : Configuration n) : + 0 ≤ rotatedDensityPower b Q x := + integral_nonneg (fun _ => Real.rpow_nonneg (rotatedFlatDensity_nonneg ..) _) +lemma rotatedDensityPower_le {n : ℕ} {b : ℝ} (hb : 0 < b) (Q : Rotation) (x : Configuration n) : + rotatedDensityPower b Q x ≤ ((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n := + rotatedFlatDensity_power_integral_le hb .. + +lemma rotation_configuration_continuous {n : ℕ} : + Continuous (fun p : Rotation × Configuration n => commonIsometry (rotationIsometry p.1) p.2) := by + apply (PiLp.continuous_toLp 2 _).comp + apply continuous_pi + intro ij + have hs : Continuous (fun p : Rotation × Configuration n => (p.1, position p.2 ij.1)) := + continuous_fst.prodMk ((continuous_position ij.1).comp continuous_snd) + have hc := rotation_action_continuous.comp hs + have H := (PiLp.continuous_apply 2 (fun _ : Fin 3 => ℝ) ij.2).comp hc + exact H + +lemma rotatedDensityPower_measurable {n : ℕ} (b : ℝ) : + Measurable (fun p : Rotation × Configuration n => rotatedDensityPower b p.1 p.2) := by + simp_rw [rotatedDensityPower, rotatedFlatDensityPower_eq] + exact (flatDensityPower_measurable b).comp + ((PiLp.continuous_ofLp 2 _).measurable.comp rotation_configuration_continuous.measurable) + +lemma fineDensityPower_configuration_measurable {n : ℕ} (b : ℝ) : + Measurable (fun x : Configuration n => fineDensityPower b (position x)) := by + have hm : Measurable (fun p : Configuration n × Space => + fineDensity b (position p.1) p.2^(5/3:ℝ)) := by + apply Measurable.pow_const + apply Finset.measurable_sum + intro i _ + exact (fineKernel_measurable b).comp + (measurable_snd.sub ((continuous_position i).measurable.comp measurable_fst)) + exact hm.stronglyMeasurable.integral_prod_right'.measurable + +lemma fineDensityPower_nonneg {n : ℕ} (b : ℝ) (x : Fin n → Space) : + 0 ≤ fineDensityPower b x := + integral_nonneg (fun _ => Real.rpow_nonneg (fineDensity_nonneg ..) _) + +lemma fineDensityPower_bound {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) : + fineDensityPower b x ≤ ((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n := by + apply (fineDensityPower_le_angularAverage hb x).trans + calc + _ ≤ ∫ _ : Rotation, ((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n ∂rotationMeasure := + integral_mono (rotatedFlatDensity_power_integrable_prod hb x).integral_prod_left + (integrable_const _) (fun Q => rotatedFlatDensity_power_integral_le hb Q x) + _ = _ := by simp + +lemma weighted_rotatedDensityPower_integrable_prod {n : ℕ} {b : ℝ} (hb : 0 < b) + {w : Configuration n → ℝ} (hw : Integrable w) (hw0 : ∀ x, 0 ≤ w x) : + Integrable (fun p : Rotation × Configuration n => rotatedDensityPower b p.1 p.2 * w p.2) + (rotationMeasure.prod volume) := by + apply ((hw.const_mul (((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n)).comp_snd rotationMeasure).mono' + ((rotatedDensityPower_measurable b).aestronglyMeasurable.mul (hw.comp_snd rotationMeasure).aestronglyMeasurable) + exact Filter.Eventually.of_forall (fun p => by + change ‖rotatedDensityPower b p.1 p.2 * w p.2‖ ≤ _ + rw [Real.norm_of_nonneg (mul_nonneg (rotatedDensityPower_nonneg ..) (hw0 _))] + exact mul_le_mul_of_nonneg_right (rotatedDensityPower_le hb ..) (hw0 _)) + +lemma weighted_fineDensityPower_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) + {w : Configuration n → ℝ} (hw : Integrable w) (hw0 : ∀ x, 0 ≤ w x) : + Integrable (fun x => fineDensityPower b (position x) * w x) := by + apply (hw.const_mul (((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n)).mono' + ((fineDensityPower_configuration_measurable b).aestronglyMeasurable.mul hw.aestronglyMeasurable) + exact Filter.Eventually.of_forall (fun x => by + change ‖fineDensityPower b (position x) * w x‖ ≤ _ + rw [Real.norm_of_nonneg (mul_nonneg (fineDensityPower_nonneg ..) (hw0 _))] + exact mul_le_mul_of_nonneg_right (fineDensityPower_bound hb ..) (hw0 _)) + +lemma weighted_fineDensityPower_le_angular {n : ℕ} {b : ℝ} (hb : 0 < b) + {w : Configuration n → ℝ} (hw : Integrable w) (hw0 : ∀ x, 0 ≤ w x) : + (∫ x, fineDensityPower b (position x) * w x) ≤ + ∫ Q, (∫ x, rotatedDensityPower b Q x * w x) ∂rotationMeasure := by + have hi := weighted_rotatedDensityPower_integrable_prod hb hw hw0 + calc + _ ≤ ∫ x, (∫ Q, rotatedDensityPower b Q x * w x ∂rotationMeasure) := by + apply integral_mono (weighted_fineDensityPower_integrable hb hw hw0) hi.integral_prod_right + intro x + change fineDensityPower b (position x) * w x ≤ ∫ Q, rotatedDensityPower b Q x * w x ∂rotationMeasure + rw [integral_mul_const] + exact mul_le_mul_of_nonneg_right (fineDensityPower_le_angularAverage hb (position x)) (hw0 _) + _ = _ := (integral_integral_swap hi).symm + +theorem fine_density_kinetic_lower {n : ℕ} (hn : 0 < n) (ψ : H1Vector n) + (hψ : Antisymmetric ψ) {b : ℝ} (hb : 0 < b) : + thomasFermiCoefficient * + (∑ s, ∫ x : Configuration n, fineDensityPower b (position x) * ‖ψ.value s x‖^2) - + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n : ℝ)^(4/3 : ℝ)) * mass ψ ≤ + kinetic ψ := by + let w (s : Spins n) (x : Configuration n) := ‖ψ.value s x‖^2 + have hw (s : Spins n) : Integrable (w s) := + (ψ.value_L2 s).integrable_norm_pow (p:=2) (by decide) + have hw0 (s : Spins n) (x) : 0 ≤ w s x := sq_nonneg _ + let A (Q : Rotation) := ∑ s, ∫ x, rotatedDensityPower b Q x * w s x + have hAs (s : Spins n) : Integrable (fun Q => ∫ x, rotatedDensityPower b Q x * w s x) rotationMeasure := + (weighted_rotatedDensityPower_integrable_prod hb (hw s) (hw0 s)).integral_prod_left + have hA : Integrable A rotationMeasure := integrable_finsetSum _ (fun s _ => hAs s) + have hJ : (∑ s, ∫ x, fineDensityPower b (position x) * w s x) ≤ ∫ Q, A Q ∂rotationMeasure := by + rw [show (∫ Q, A Q ∂rotationMeasure) = ∑ s, ∫ Q, (∫ x, rotatedDensityPower b Q x * w s x) ∂rotationMeasure from + integral_finsetSum _ (fun s _ => hAs s)] + exact Finset.sum_le_sum (fun s _ => weighted_fineDensityPower_le_angular hb (hw s) (hw0 s)) + have hpoint (Q : Rotation) : thomasFermiCoefficient * A Q ≤ kinetic ψ + + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n : ℝ)^(4/3 : ℝ)) * mass ψ := by + have H := fixed_rotation_fine_density_kinetic_lower hn ψ hψ hb Q + exact sub_le_iff_le_add.mp H + have hI := integral_mono (hA.const_mul thomasFermiCoefficient) + (integrable_const (kinetic ψ + ((b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (n : ℝ)^(4/3 : ℝ)) * mass ψ)) hpoint + rw [integral_const_mul] at hI + simp only [integral_const, probReal_univ, smul_eq_mul, one_mul] at hI + have hc : 0 ≤ thomasFermiCoefficient := by + unfold thomasFermiCoefficient + positivity + exact sub_le_iff_le_add.mpr ((mul_le_mul_of_nonneg_left hJ hc).trans hI) + +end Coulomb + +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Rotation.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Rotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..528f72d8c95c5fc4a9d45b696079f862f26bea95 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Rotation.lean @@ -0,0 +1,551 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.FlatDensityPower + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +namespace Coulomb +abbrev Rotation := Matrix.specialOrthogonalGroup (Fin 3) ℝ + +lemma rotation_entry_sq_sum (Q : Rotation) (j : Fin 3) : + ∑ i : Fin 3, (Q.1 i j)^2 = 1 := by + have H := congrArg (fun M : Matrix (Fin 3) (Fin 3) ℝ => M j j) Q.prop.1.1 + simpa [Matrix.mul_apply, Matrix.star_apply, pow_two] using H + +lemma rotation_entry_abs_le (Q : Rotation) (i j : Fin 3) : |Q.1 i j| ≤ 1 := by + have H : (Q.1 i j)^2 ≤ 1 := by + rw [← rotation_entry_sq_sum Q j] + exact Finset.single_le_sum (fun k _ => sq_nonneg (Q.1 k j)) (Finset.mem_univ i) + exact (sq_le_one_iff_abs_le_one _).mp H + +lemma rotation_closed : IsClosed (Matrix.specialOrthogonalGroup (Fin 3) ℝ : Set (Matrix (Fin 3) (Fin 3) ℝ)) := by + change IsClosed ((unitary (Matrix (Fin 3) (Fin 3) ℝ) : Set _) ∩ + (fun M : Matrix (Fin 3) (Fin 3) ℝ => M.det) ⁻¹' {1}) + exact isClosed_unitary.inter (isClosed_singleton.preimage continuous_id.matrix_det) + +lemma rotation_set_compact : IsCompact (Matrix.specialOrthogonalGroup (Fin 3) ℝ : Set (Matrix (Fin 3) (Fin 3) ℝ)) := by + apply (isCompact_Icc : IsCompact (Icc (fun _ _ : Fin 3 => (-1:ℝ)) (fun _ _ => (1:ℝ)) )).of_isClosed_subset rotation_closed + intro Q hQ + constructor <;> intro i j + · exact (abs_le.mp (rotation_entry_abs_le ⟨Q,hQ⟩ i j)).1 + · exact (abs_le.mp (rotation_entry_abs_le ⟨Q,hQ⟩ i j)).2 + +noncomputable instance rotation_compact : CompactSpace Rotation := + isCompact_iff_compactSpace.mp rotation_set_compact + +instance rotation_continuousStar : ContinuousStar Rotation where + continuous_star := continuous_induced_rng.mpr continuous_subtype_val.star +instance rotation_continuousInv : ContinuousInv Rotation where + continuous_inv := continuous_star +instance rotation_topologicalGroup : IsTopologicalGroup Rotation where + +instance rotation_measurable : MeasurableSpace Rotation := borel Rotation +instance rotation_borel : BorelSpace Rotation := ⟨rfl⟩ + +noncomputable def rotationMeasure : Measure Rotation := + Measure.haarMeasure (⟨⟨univ,isCompact_univ⟩,by simp⟩ : TopologicalSpace.PositiveCompacts Rotation) + +instance : IsProbabilityMeasure rotationMeasure := ⟨Measure.haarMeasure_self⟩ + +noncomputable def rotationIsometry (Q : Rotation) : Space ≃ₗᵢ[ℝ] Space := + Unitary.linearIsometryEquiv ⟨Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ) Q.1, by + constructor + · have H := congrArg (Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ)) Q.prop.1.1 + simpa only [map_mul, map_star, map_one] using H + · have H := congrArg (Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ)) Q.prop.1.2 + simpa only [map_mul, map_star, map_one] using H⟩ + +lemma rotationIsometry_apply (Q : Rotation) (x : Space) (j : Fin 3) : + rotationIsometry Q x j = ∑ k, Q.1 j k*x k := rfl + +lemma rotationIsometry_measurePreserving (Q : Rotation) : + MeasurePreserving (rotationIsometry Q) volume volume := + (rotationIsometry Q).measurePreserving + +lemma rotation_action_continuous : Continuous (fun p : Rotation × Space => rotationIsometry p.1 p.2) := by + apply (PiLp.continuous_toLp 2 _).comp + apply continuous_pi + intro j + change Continuous (fun p : Rotation × Space => ∑ k, p.1.1 j k * p.2 k) + apply continuous_finsetSum + intro k _ + have hQ : Continuous (fun p : Rotation × Space => p.1.val) := + continuous_subtype_val.comp continuous_fst + have hx : Continuous (fun p : Rotation × Space => p.2 k) := + (PiLp.continuous_apply 2 _ k).comp continuous_snd + exact ((continuous_apply k).comp ((continuous_apply j).comp hQ)).mul hx + +lemma flatFineKernel_continuous (b : ℝ) : Continuous (flatFineKernel b) := by + apply Continuous.const_mul + apply continuous_finsetProd + intro j _ + exact continuous_const.max (continuous_const.sub (continuous_apply j).abs) + +lemma flatFineKernel_le {b : ℝ} (hb : 0 < b) (x : Fin 3 → ℝ) : + flatFineKernel b x ≤ (b⁻¹)^3 := by + have H : (∏ j : Fin 3, max 0 (b-|x j|)) ≤ b^3 := by + calc + _ ≤ ∏ _ : Fin 3, b := Finset.prod_le_prod₀ (fun _ _ => le_max_left _ _) + (fun i _ => max_le hb.le (sub_le_self _ (abs_nonneg _))) + _ = _ := by simp + apply (mul_le_mul_of_nonneg_left H (show 0 ≤ (b⁻¹)^6 by positivity)).trans_eq + field_simp [hb.ne'] + +lemma flatFineKernel_eq_zero {b : ℝ} (hb : 0 < b) (x : Space) + (hx : 3*b^2 < ‖x‖^2) : flatFineKernel b x.ofLp = 0 := by + have hj : ∃ j : Fin 3, b ≤ |x j| := by + by_contra! H + have Hs : ‖x‖^2 ≤ 3*b^2 := by + rw [EuclideanSpace.real_norm_sq_eq] + calc + _ ≤ ∑ _ : Fin 3, b^2 := Finset.sum_le_sum (fun j _ => + (sq_abs _).symm.trans_le ((sq_le_sq₀ (abs_nonneg _) hb.le).mpr (H j).le)) + _ = _ := by simp + linarith + obtain ⟨j,hj⟩ := hj + unfold flatFineKernel + rw [Finset.prod_eq_zero (Finset.mem_univ j)] + · ring + · exact max_eq_left (by dsimp; linarith) + +noncomputable def fineKernel (b : ℝ) (x : Space) : ℝ := + ∫ Q : Rotation, flatFineKernel b (rotationIsometry Q x).ofLp ∂rotationMeasure + +lemma rotated_flatKernel_continuous (b : ℝ) : + Continuous (fun p : Rotation × Space => flatFineKernel b (rotationIsometry p.1 p.2).ofLp) := + (flatFineKernel_continuous b).comp ((PiLp.continuous_ofLp 2 _).comp rotation_action_continuous) + +lemma rotated_flatKernel_integrable (b : ℝ) (x : Space) : + Integrable (fun Q : Rotation => flatFineKernel b (rotationIsometry Q x).ofLp) rotationMeasure := + ((rotated_flatKernel_continuous b).comp (continuous_id.prodMk continuous_const)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +lemma fineKernel_nonneg (b : ℝ) (x : Space) : 0 ≤ fineKernel b x := + integral_nonneg (fun _ => flatFineKernel_nonneg _ _) + +lemma fineKernel_le {b : ℝ} (hb : 0 < b) (x : Space) : fineKernel b x ≤ (b⁻¹)^3 := by + calc + _ ≤ ∫ _ : Rotation, (b⁻¹)^3 ∂rotationMeasure := + integral_mono (rotated_flatKernel_integrable b x) (integrable_const _) + (fun _ => flatFineKernel_le hb _) + _ = _ := by simp + +lemma fineKernel_eq_zero {b : ℝ} (hb : 0 < b) (x : Space) + (hx : 3*b^2 < ‖x‖^2) : fineKernel b x = 0 := by + unfold fineKernel + calc + _ = ∫ _ : Rotation, (0 : ℝ) ∂rotationMeasure := by + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun Q => flatFineKernel_eq_zero hb _ (by simpa using hx)) + _ = 0 := integral_zero _ _ + +lemma rotationIsometry_mul (P Q : Rotation) (x : Space) : + rotationIsometry (P*Q) x = rotationIsometry P (rotationIsometry Q x) := by + ext j + simp only [rotationIsometry_apply] + change (∑ k, (P.val * Q.val) j k * x k) = ∑ k, P.val j k * (∑ l, Q.val k l * x l) + simp only [Matrix.mul_apply, Finset.sum_mul, Finset.mul_sum, mul_assoc] + rw [Finset.sum_comm] + +instance : Measure.IsMulLeftInvariant rotationMeasure := by + unfold rotationMeasure + infer_instance + +instance : Measure.IsHaarMeasure rotationMeasure := by + unfold rotationMeasure + infer_instance + +instance : Measure.IsMulRightInvariant rotationMeasure where + map_mul_right_eq_self P := by + have : IsProbabilityMeasure (Measure.map (· * P) rotationMeasure) := inferInstance + have H := Measure.isMulInvariant_eq_smul_of_compactSpace + (Measure.map (· * P) rotationMeasure) rotationMeasure + have H1 := congrArg (fun μ : Measure Rotation => μ univ) H + simp only [Measure.smul_apply, measure_univ, ENNReal.smul_def, smul_eq_mul, mul_one] at H1 + have H2 : (Measure.map (· * P) rotationMeasure).haarScalarFactor rotationMeasure = 1 := + ENNReal.coe_injective (by simpa using H1.symm) + rw [H2, one_smul] at H + exact H + +lemma fineKernel_rotation (b : ℝ) (P : Rotation) (x : Space) : + fineKernel b (rotationIsometry P x) = fineKernel b x := by + unfold fineKernel + simp_rw [← rotationIsometry_mul] + exact integral_mul_right_eq_self (μ := rotationMeasure) (fun Q : Rotation => flatFineKernel b (rotationIsometry Q x).ofLp) P + +lemma tent_continuous (b : ℝ) : Continuous (fun x : ℝ => max 0 (b-|x|)) := by fun_prop +lemma tent_eq_zero {b : ℝ} (x : ℝ) (hx : x ∉ Icc (-b) b) : max 0 (b-|x|) = 0 := by + apply max_eq_left + have : b ≤ |x| := by + by_contra! h + exact hx ⟨by linarith [(neg_abs_le x)], by linarith [le_abs_self x]⟩ + linarith +lemma tent_integrable (b : ℝ) : Integrable (fun x : ℝ => max 0 (b-|x|)) := by + have H := (tent_continuous b).integrableOn_Icc (μ := volume) (a := -b) (b := b) + have he : (Icc (-b) b).indicator (fun x : ℝ => max 0 (b-|x|)) = + (fun x : ℝ => max 0 (b-|x|)) := by + funext x + by_cases hx : x ∈ Icc (-b) b + · simp [hx] + · simp [hx, tent_eq_zero x hx] + rw [← he] + exact H.integrable_indicator measurableSet_Icc +lemma tent_integral {b : ℝ} (hb : 0 < b) : + (∫ x : ℝ, max 0 (b-|x|)) = b^2 := by + have hi (a c : ℝ) := (tent_continuous b).intervalIntegrable (μ := volume) a c + calc + _ = ∫ x in Icc (-b) b, max 0 (b-|x|) := + (setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => tent_eq_zero x hx)).symm + _ = ∫ x in (-b)..b, max 0 (b-|x|) := by + rw [intervalIntegral.integral_of_le (by linarith : -b ≤ b), integral_Icc_eq_integral_Ioc] + _ = (∫ x in (-b)..0, max 0 (b-|x|)) + ∫ x in (0 : ℝ)..b, max 0 (b-|x|) := + (intervalIntegral.integral_add_adjacent_intervals (hi (-b) 0) (hi 0 b)).symm + _ = (∫ x in (-b)..0, b+x) + ∫ x in (0 : ℝ)..b, b-x := by + congr 1 <;> apply intervalIntegral.integral_congr + · intro x hx + dsimp only + rw [uIcc_of_le (by linarith)] at hx + rw [abs_of_nonpos hx.2, sub_neg_eq_add, max_eq_right (by linarith [hx.1])] + · intro x hx + dsimp only + rw [uIcc_of_le hb.le] at hx + rw [abs_of_nonneg hx.1, max_eq_right (by linarith [hx.2])] + _ = b^2 := by + rw [intervalIntegral.integral_add (intervalIntegrable_const (c := b)) (show IntervalIntegrable (fun x : ℝ => x) volume _ _ from continuous_id.intervalIntegrable _ _), + intervalIntegral.integral_sub (intervalIntegrable_const (c := b)) (show IntervalIntegrable (fun x : ℝ => x) volume _ _ from continuous_id.intervalIntegrable _ _)] + simp only [intervalIntegral.integral_const, integral_id, smul_eq_mul] + ring + +lemma flatFineKernel_integrable (b : ℝ) : Integrable (flatFineKernel b) := by + exact ((Integrable.fintype_prod_dep (fun _ : Fin 3 => tent_integrable b)).const_mul ((b⁻¹)^6)) + +lemma flatFineKernel_integral {b : ℝ} (hb : 0 < b) : + (∫ x : Fin 3 → ℝ, flatFineKernel b x) = 1 := by + unfold flatFineKernel + rw [integral_const_mul, + integral_fintype_prod_volume_eq_prod (fun (_ : Fin 3) (u : ℝ) => max 0 (b-|u|))] + simp_rw [tent_integral hb] + simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin] + field_simp [hb.ne'] + +lemma flatFineKernel_space_integrable (b : ℝ) : + Integrable (fun x : Space => flatFineKernel b x.ofLp) := + (PiLp.volume_preserving_ofLp (Fin 3)).integrable_comp_of_integrable (flatFineKernel_integrable b) + +lemma flatFineKernel_space_integral {b : ℝ} (hb : 0 < b) : + (∫ x : Space, flatFineKernel b x.ofLp) = 1 := by + exact ((EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin 3)).integral_comp' (flatFineKernel b)).trans + (flatFineKernel_integral hb) + +lemma rotated_flatKernel_space_integrable (b : ℝ) (Q : Rotation) : + Integrable (fun x : Space => flatFineKernel b (rotationIsometry Q x).ofLp) := + (rotationIsometry Q).measurePreserving.integrable_comp_of_integrable (flatFineKernel_space_integrable b) + +lemma rotated_flatKernel_space_integral {b : ℝ} (hb : 0 < b) (Q : Rotation) : + (∫ x : Space, flatFineKernel b (rotationIsometry Q x).ofLp) = 1 := by + exact ((show MeasurePreserving (rotationIsometry Q).toHomeomorph.toMeasurableEquiv volume volume from + (rotationIsometry Q).measurePreserving).integral_comp' (fun x : Space => flatFineKernel b x.ofLp)).trans + (flatFineKernel_space_integral hb) + +lemma rotated_flatKernel_integrable_prod {b : ℝ} (hb : 0 < b) : + Integrable (fun p : Rotation × Space => flatFineKernel b (rotationIsometry p.1 p.2).ofLp) + (rotationMeasure.prod volume) := by + apply (integrable_prod_iff (rotated_flatKernel_continuous b).aestronglyMeasurable).mpr + constructor + · exact Filter.Eventually.of_forall (fun Q => rotated_flatKernel_space_integrable b Q) + · simp_rw [Real.norm_of_nonneg (flatFineKernel_nonneg ..)] + simp_rw [rotated_flatKernel_space_integral hb] + exact integrable_const _ + +lemma fineKernel_integrable {b : ℝ} (hb : 0 < b) : Integrable (fineKernel b) := + (rotated_flatKernel_integrable_prod hb).integral_prod_right + +lemma fineKernel_integral {b : ℝ} (hb : 0 < b) : (∫ x, fineKernel b x) = 1 := by + unfold fineKernel + rw [← integral_integral_swap (rotated_flatKernel_integrable_prod hb)] + simp_rw [rotated_flatKernel_space_integral hb] + simp + +lemma rpow_five_thirds_le_linear {a A : ℝ} (ha : 0 ≤ a) (hA : a ≤ A) : + a^(5/3 : ℝ) ≤ A^(2/3 : ℝ)*a := by + calc + _ = a^(2/3 : ℝ)*a := by + rw [show (5/3 : ℝ) = 2/3 + 1 by norm_num, Real.rpow_add_one' ha (by norm_num)] + _ ≤ _ := mul_le_mul_of_nonneg_right (Real.rpow_le_rpow ha hA (by norm_num)) ha + +lemma fineKernel_measurable (b : ℝ) : Measurable (fineKernel b) := + (rotated_flatKernel_continuous b).stronglyMeasurable.integral_prod_left'.measurable + +noncomputable def fineDensity {n : ℕ} (b : ℝ) (x : Fin n → Space) (y : Space) : ℝ := + ∑ i, fineKernel b (y-x i) +noncomputable def rotatedFlatDensity {n : ℕ} (b : ℝ) (Q : Rotation) (x : Fin n → Space) (y : Space) : ℝ := + ∑ i, flatFineKernel b (rotationIsometry Q (y-x i)).ofLp + +lemma fineDensity_nonneg {n : ℕ} (b : ℝ) (x : Fin n → Space) (y : Space) : + 0 ≤ fineDensity b x y := Finset.sum_nonneg (fun _ _ => fineKernel_nonneg ..) +lemma fineDensity_le {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) (y : Space) : + fineDensity b x y ≤ n*(b⁻¹)^3 := by + calc + _ ≤ ∑ _ : Fin n, (b⁻¹)^3 := Finset.sum_le_sum (fun _ _ => fineKernel_le hb _) + _ = _ := by simp +lemma rotatedFlatDensity_nonneg {n : ℕ} (b : ℝ) (Q : Rotation) (x : Fin n → Space) (y : Space) : + 0 ≤ rotatedFlatDensity b Q x y := Finset.sum_nonneg (fun _ _ => flatFineKernel_nonneg ..) +lemma rotatedFlatDensity_le {n : ℕ} {b : ℝ} (hb : 0 < b) (Q : Rotation) (x : Fin n → Space) (y : Space) : + rotatedFlatDensity b Q x y ≤ n*(b⁻¹)^3 := by + calc + _ ≤ ∑ _ : Fin n, (b⁻¹)^3 := Finset.sum_le_sum (fun _ _ => flatFineKernel_le hb _) + _ = _ := by simp + +lemma fineDensity_measurable {n : ℕ} (b : ℝ) (x : Fin n → Space) : + Measurable (fineDensity b x) := + Finset.measurable_sum _ (fun _ _ => (fineKernel_measurable b).comp (measurable_id.sub_const _)) + +lemma rotatedFlatDensity_continuous {n : ℕ} (b : ℝ) (x : Fin n → Space) : + Continuous (fun p : Rotation × Space => rotatedFlatDensity b p.1 x p.2) := by + apply continuous_finsetSum + intro i _ + have hs : Continuous (fun p : Rotation × Space => (p.1, p.2 - x i)) := + continuous_fst.prodMk (continuous_snd.sub continuous_const) + have hc := (rotated_flatKernel_continuous b).comp hs + dsimp only [Function.comp_def] at hc + exact hc + +lemma fineDensity_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) : + Integrable (fineDensity b x) := by + apply integrable_finsetSum + intro i _ + exact (measurePreserving_sub_right volume (x i)).integrable_comp_of_integrable (fineKernel_integrable hb) + +lemma fineDensity_integral {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) : + (∫ y, fineDensity b x y) = (n : ℝ) := by + have hi (i : Fin n) : Integrable (fun y : Space => fineKernel b (y - x i)) := + (measurePreserving_sub_right volume (x i)).integrable_comp_of_integrable (fineKernel_integrable hb) + unfold fineDensity + rw [integral_finsetSum _ (fun i _ => hi i)] + simp_rw [integral_sub_right_eq_self, fineKernel_integral hb] + simp + +lemma rotatedFlatDensity_integrable {n : ℕ} (b : ℝ) (Q : Rotation) (x : Fin n → Space) : + Integrable (rotatedFlatDensity b Q x) := by + apply integrable_finsetSum + intro i _ + exact (measurePreserving_sub_right volume (x i)).integrable_comp_of_integrable + (rotated_flatKernel_space_integrable b Q) + +lemma rotatedFlatDensity_integral {n : ℕ} {b : ℝ} (hb : 0 < b) (Q : Rotation) (x : Fin n → Space) : + (∫ y, rotatedFlatDensity b Q x y) = (n : ℝ) := by + have hi (i : Fin n) : Integrable (fun y : Space => flatFineKernel b (rotationIsometry Q (y-x i)).ofLp) := + (measurePreserving_sub_right volume (x i)).integrable_comp_of_integrable + (rotated_flatKernel_space_integrable b Q) + unfold rotatedFlatDensity + rw [integral_finsetSum _ (fun i _ => hi i)] + have hrot (i : Fin n) : (∫ y : Space, flatFineKernel b (rotationIsometry Q (y-x i)).ofLp) = 1 := by + change (∫ y : Space, (fun z : Space => flatFineKernel b (rotationIsometry Q z).ofLp) (y-x i)) = 1 + exact (integral_sub_right_eq_self (fun z : Space => flatFineKernel b (rotationIsometry Q z).ofLp) (x i)).trans + (rotated_flatKernel_space_integral hb Q) + simp_rw [hrot] + simp + +lemma rotatedFlatDensity_power_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) (Q : Rotation) (x : Fin n → Space) : + Integrable (fun y => rotatedFlatDensity b Q x y ^ (5/3 : ℝ)) := by + apply ((rotatedFlatDensity_integrable b Q x).const_mul ((n*(b⁻¹)^3)^(2/3:ℝ))).mono' + · exact (((rotatedFlatDensity_continuous b x).comp (continuous_const.prodMk continuous_id)).measurable.pow_const _).aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun y => by + rw [Real.norm_of_nonneg (Real.rpow_nonneg (rotatedFlatDensity_nonneg ..) _)] + exact rpow_five_thirds_le_linear (rotatedFlatDensity_nonneg ..) (rotatedFlatDensity_le hb ..)) + +lemma rotatedFlatDensity_power_integral_le {n : ℕ} {b : ℝ} (hb : 0 < b) (Q : Rotation) (x : Fin n → Space) : + (∫ y, rotatedFlatDensity b Q x y ^ (5/3 : ℝ)) ≤ ((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n := by + calc + _ ≤ ∫ y, ((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ) * rotatedFlatDensity b Q x y := + integral_mono (rotatedFlatDensity_power_integrable hb Q x) + ((rotatedFlatDensity_integrable b Q x).const_mul _) (fun _ => + rpow_five_thirds_le_linear (rotatedFlatDensity_nonneg ..) (rotatedFlatDensity_le hb ..)) + _ = _ := by rw [integral_const_mul, rotatedFlatDensity_integral hb] + +lemma rotatedFlatDensity_power_integrable_prod {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) : + Integrable (fun p : Rotation × Space => rotatedFlatDensity b p.1 x p.2^(5/3:ℝ)) + (rotationMeasure.prod volume) := by + have hm := (rotatedFlatDensity_continuous b x).measurable.pow_const (5/3:ℝ) + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + constructor + · exact Filter.Eventually.of_forall (fun Q => rotatedFlatDensity_power_integrable hb Q x) + · simp_rw [Real.norm_of_nonneg (Real.rpow_nonneg (rotatedFlatDensity_nonneg ..) _)] + apply (integrable_const (((n:ℝ)*(b⁻¹)^3)^(2/3:ℝ)*n)).mono' + hm.stronglyMeasurable.integral_prod_right'.aestronglyMeasurable + exact Filter.Eventually.of_forall (fun Q => by + rw [Real.norm_of_nonneg (integral_nonneg (fun _ => Real.rpow_nonneg (rotatedFlatDensity_nonneg ..) _))] + exact rotatedFlatDensity_power_integral_le hb Q x) + +lemma fineDensity_eq_angularAverage {n : ℕ} (b : ℝ) (x : Fin n → Space) (y : Space) : + fineDensity b x y = ∫ Q, rotatedFlatDensity b Q x y ∂rotationMeasure := by + unfold fineDensity fineKernel rotatedFlatDensity + exact (integral_finsetSum _ (fun _ _ => rotated_flatKernel_integrable b _)).symm + +lemma rotatedFlatDensity_angular_integrable {n : ℕ} (b : ℝ) (x : Fin n → Space) (y : Space) : + Integrable (fun Q => rotatedFlatDensity b Q x y) rotationMeasure := + integrable_finsetSum _ (fun _ _ => rotated_flatKernel_integrable b _) + +lemma rotatedFlatDensity_power_angular_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) (y : Space) : + Integrable (fun Q => rotatedFlatDensity b Q x y^(5/3:ℝ)) rotationMeasure := by + apply (integrable_const (((n:ℝ)*(b⁻¹)^3)^(5/3:ℝ))).mono' + · exact (((rotatedFlatDensity_continuous b x).comp (continuous_id.prodMk continuous_const)).measurable.pow_const _).aestronglyMeasurable + · exact Filter.Eventually.of_forall (fun Q => by + rw [Real.norm_of_nonneg (Real.rpow_nonneg (rotatedFlatDensity_nonneg ..) _)] + exact Real.rpow_le_rpow (rotatedFlatDensity_nonneg ..) (rotatedFlatDensity_le hb ..) (by norm_num)) + +lemma fineDensity_Jensen {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) (y : Space) : + fineDensity b x y^(5/3:ℝ) ≤ ∫ Q, rotatedFlatDensity b Q x y^(5/3:ℝ) ∂rotationMeasure := by + rw [fineDensity_eq_angularAverage] + exact (convexOn_rpow (by norm_num : (1:ℝ) ≤ 5/3)).map_integral_le + (Real.continuous_rpow_const (by norm_num : (0:ℝ) ≤ 5/3)).continuousOn isClosed_Ici + (Filter.Eventually.of_forall (fun _ => rotatedFlatDensity_nonneg ..)) + (rotatedFlatDensity_angular_integrable b x y) + (rotatedFlatDensity_power_angular_integrable hb x y) + +noncomputable def fineDensityPower {n : ℕ} (b : ℝ) (x : Fin n → Space) : ℝ := + ∫ y, fineDensity b x y^(5/3:ℝ) + +lemma fineDensityPower_le_angularAverage {n : ℕ} {b : ℝ} (hb : 0 < b) (x : Fin n → Space) : + fineDensityPower b x ≤ ∫ Q, ∫ y, rotatedFlatDensity b Q x y^(5/3:ℝ) ∂volume ∂rotationMeasure := by + have hi := rotatedFlatDensity_power_integrable_prod hb x + have hm := (fineDensity_measurable b x).pow_const (5/3:ℝ) + have hl := hi.integral_prod_right.mono' hm.aestronglyMeasurable + (Filter.Eventually.of_forall (fun y => by + rw [Real.norm_of_nonneg (Real.rpow_nonneg (fineDensity_nonneg ..) _)] + exact fineDensity_Jensen hb x y)) + exact (integral_mono hl hi.integral_prod_right (fun y => fineDensity_Jensen hb x y)).trans_eq + (integral_integral_swap hi).symm + +lemma rotatedFlatDensityPower_eq {n : ℕ} (b : ℝ) (Q : Rotation) (x : Configuration n) : + (∫ y, rotatedFlatDensity b Q (position x) y ^ (5/3:ℝ)) = + flatDensityPower b (commonIsometry (rotationIsometry Q) x).ofLp := by + let f : Space → ℝ := fun y => (∑ i : Fin n, flatFineKernel b + (y.ofLp - (rotationIsometry Q (position x i)).ofLp)) ^ (5/3:ℝ) + have hrot := (show MeasurePreserving (rotationIsometry Q).toHomeomorph.toMeasurableEquiv volume volume from + (rotationIsometry Q).measurePreserving).integral_comp' f + have hpi := (EuclideanSpace.volume_preserving_symm_measurableEquiv_toLp (Fin 3)).integral_comp' + (fun y : Fin 3 → ℝ => (∑ i : Fin n, flatFineKernel b + (y - (rotationIsometry Q (position x i)).ofLp)) ^ (5/3:ℝ)) + calc + _ = ∫ y, f (rotationIsometry Q y) := by + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun y => by + dsimp only [f, rotatedFlatDensity] + simp only [map_sub] + rfl) + _ = ∫ y, f y := hrot + _ = _ := by + convert hpi using 1 <;> rfl + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/ScaledOscillation.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/ScaledOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..255008af8813a5f10552a90005b2d98ae32ad15b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/ScaledOscillation.lean @@ -0,0 +1,100 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior +import OAI.Analysis.CoulombRadii.FieldAnalysis.NewtonSubmean + +namespace OAI + +section +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ContDiff +noncomputable section +namespace NeutralAtom + +lemma affine_ball_distance (y z : Position) {a : ℝ} (ha : 0 4*Real.pi*σ x) → + Integrable σ → (∀ x, 0≤σ x) → + (∀ x ∈ Metric.closedBall y (3*a), σ x≤A/a^6) → + (∀ x ∈ Metric.closedBall y (2*a), F x≤M/a^4) → + F y ≤ (∫ x, F x*Coulomb.ballCloud y (2*a) 1 x) → + ∀ z ∈ Metric.closedBall y a, + ‖F z-F y‖ ≤ C*(‖z-y‖/a)*((a^4)⁻¹+max (-F y) 0) := by + obtain ⟨C,hC,H⟩ := poisson_unit_negative_oscillation hA hM + refine ⟨C,hC,?_⟩ + intro F σ y a ha hF hLap hi hp hb hcap hmean z hz + let G := fun x => a^4*F (y+a • x) + let τ := fun x => a^6*σ (y+a • x) + have hmap {R : ℝ} {x : Position} (hx : x∈Metric.ball 0 R) : + y+a • x∈Metric.ball y (R*a) := by + rw [Metric.mem_ball,affine_ball_distance y x ha] + have h := mul_lt_mul_of_pos_left (show ‖x‖ y+a • x) := + continuous_const.add (continuous_id.const_smul a) + have hm3 : MapsTo (fun x : Position => y+a • x) (Metric.ball 0 3) + (Metric.ball y (3*a)) := fun x hx => hmap (R:=3) hx + have hGc : ContinuousOn G (Metric.ball 0 3) := + (hF.comp hAff.continuousOn hm3).const_mul (a^4) + have hGL : HasWeakLaplacian G (Metric.ball 0 2) (fun x => 4*Real.pi*τ x) := by + have hh := HasWeakLaplacian.dilate ha (hLap.translate y) + have hh' := hh.mono (show Metric.ball (0:Position) 2⊆(fun z => a • z) ⁻¹' {x | y+x∈Metric.ball y (2*a)} from + fun x hx => hmap hx) + convert hh' using 1 + funext x + dsimp [G,τ] + ring + have hτ : Integrable τ := ((hi.comp_add_left y).comp_smul ha.ne').const_mul _ + have hτ0 (x) : 0≤τ x := mul_nonneg (pow_nonneg ha.le _) (hp _) + have hτA (x) (hx : x∈Metric.closedBall (0:Position) 3) : τ x≤A := by + have hh := mul_le_mul_of_nonneg_left (hb _ (hmapc hx)) (pow_nonneg ha.le 6) + dsimp [τ] + exact hh.trans_eq (by field_simp [ha.ne']) + have hGM (x) (hx : x∈Metric.closedBall (0:Position) 2) : G x≤M := by + have hh := mul_le_mul_of_nonneg_left (hcap _ (hmapc hx)) (pow_nonneg ha.le 4) + dsimp [G] + exact hh.trans_eq (by field_simp [ha.ne']) + have hG0 : G 0=a^4*F y := by simp [G] + have hGmean : volume.real (Metric.closedBall (0:Position) 2)*G 0 ≤ + (∫ x in Metric.closedBall 0 2, G x) := by + rw [hG0] + exact Coulomb.submean_affine y ha hmean + let w := a⁻¹ • (z-y) + have hw : w∈Metric.closedBall (0:Position) 1 := by + have hdist : ‖z-y‖≤a := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hz + simp only [Metric.mem_closedBall,dist_zero_right,w,norm_smul,Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr ha)] + exact (inv_mul_le_iff₀ ha).mpr (by simpa using hdist) + have hGw : G w=a^4*F z := by + simp only [G,w,smul_smul,mul_inv_cancel₀ ha.ne',one_smul,add_sub_cancel] + have hh := H G τ hGc hGL hτ hτ0 hτA hGM hGmean w hw + rw [hGw,hG0,←mul_sub,norm_mul,Real.norm_eq_abs (a^4),abs_of_pos (pow_pos ha 4)] at hh + have hm : max (-(a^4*F y)) 0=a^4*max (-F y) 0 := by + rw [mul_max_of_nonneg _ _ (pow_nonneg ha.le 4)] + simp only [mul_zero,mul_neg] + rw [hm] at hh + have hn : ‖w‖=a⁻¹*‖z-y‖ := by + simp only [w,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ha)] + rw [hn] at hh + have ht : a^4*(C*(‖z-y‖/a)*((a^4)⁻¹+max (-F y) 0)) = + C*(1+a^4*max (-F y) 0)*(a⁻¹*‖z-y‖) := by + field_simp [ha.ne'] + exact (mul_le_mul_iff_right₀ (pow_pos ha 4)).mp (hh.trans_eq ht.symm) + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SliceExpectation.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SliceExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..fba7628c80194e8181378a5a95062a2dcb0bab1c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SliceExpectation.lean @@ -0,0 +1,291 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CoreScreenedField +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalEnergy + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma nuclearEnergy_unit_eq_coreCoulomb {k : ℕ} (u : H1Vector k) (a : Space) : + nuclearEnergy (unitNucleus a) u = coreCoulombPotential u a := by + unfold nuclearEnergy coreCoulombPotential + apply Finset.sum_congr rfl + intro s _ + simp only [attraction_unitNucleus, Finset.sum_mul] + exact integral_finsetSum _ (fun i _ => + (u.nuclear_coulomb_integrable_bound s i a (by norm_num : (0:ℝ)<1)).1) + +lemma potentialForm_cross_eq_coreCoulomb {m k : ℕ} (x : Configuration m) (u : H1Vector k) : + potentialForm (crossPotential x) u = ∑ i : Fin m, coreCoulombPotential u (position x i) := by + change (∑ t : Spins k, ∫ y, crossPotential x y*‖u.value t y‖^2) = _ + rw [crossPotential_spin_integral] + exact Finset.sum_congr rfl (fun i _ => nuclearEnergy_unit_eq_coreCoulomb u (position x i)) + +lemma conditionalEnergy_eq_screened {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (s : Spins m) (x : Configuration m) : + conditionalEnergy S ψ s x = form S (ψ.coreSlice s x).normalized - + (∑ i : Fin m, coreScreenedField S (ψ.coreSlice s x).normalized (position x i)) + pairPotential x := by + rw [conditionalEnergy, potentialForm_cross_eq_coreCoulomb] + simp only [coreScreenedField, Finset.sum_sub_distrib, nuclearPotential] + ring + +def sliceExpectation {m k : ℕ} (ψ : H1Vector (m+k)) (f : Spins m → Configuration m → ℝ) : ℝ := + ∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x)*f s x + +lemma slice_weight_integrable_const {m k : ℕ} (ψ : H1Vector (m+k)) + (f : Configuration m → ℝ) + (hf : ∀ st, Integrable (fun z => f ((joinConfiguration m k).symm z).1*‖ψ.value st z‖^2)) + (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*f x) := by + have H := potentialForm_coreSlice_parameter_integrable ψ s (fun x _ => f x) (fun t => hf (Fin.append s t)) + apply H.congr + exact Eventually.of_forall (fun x => by dsimp only; rw [potentialForm_const]; ring) + +lemma sliceExpectation_const {m k : ℕ} (ψ : H1Vector (m+k)) + (f : Configuration m → ℝ) + (hf : ∀ st, Integrable (fun z => f ((joinConfiguration m k).symm z).1*‖ψ.value st z‖^2)) : + sliceExpectation ψ (fun _ x => f x) = potentialForm (fun z => f ((joinConfiguration m k).symm z).1) ψ := by + unfold sliceExpectation + simp_rw [mul_comm (mass _) (f _), ←potentialForm_const] + exact integral_potentialForm_coreSlice_parameter ψ (fun x _ => f x) hf + +lemma measurable_retained_sum {α : Type*} [MeasurableSpace α] {n : ℕ} + (r : α → Finset (Fin n)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (f : Fin n → α → ℝ) (hf : ∀ i, Measurable (f i)) : + Measurable (fun x => ∑ i ∈ r x, f i x) := by + have he (x : α) : (∑ i ∈ r x, f i x) = ∑ i : Fin n, if i ∈ r x then f i x else 0 := by simp + simp_rw [he] + exact Finset.measurable_sum _ (fun i _ => Measurable.ite (hr i) (hf i) measurable_const) + +def retainedNuclearPotential {M m : ℕ} (S : Nuclei M) + (r : Configuration m → Finset (Fin m)) (x : Configuration m) : ℝ := + ∑ i ∈ r x, attraction S (position x i) + +def retainedCrossPotential {m k : ℕ} (r : Configuration m → Finset (Fin m)) + (x : Configuration m) (y : Configuration k) : ℝ := + ∑ i ∈ r x, ∑ j : Fin k, coulombKernel (position x i-position y j) + +lemma retainedNuclearPotential_nonneg {M m : ℕ} (S : Nuclei M) + (r : Configuration m → Finset (Fin m)) (x : Configuration m) : + 0 ≤ retainedNuclearPotential S r x := Finset.sum_nonneg (fun i _ => attraction_nonneg S (position x i)) +lemma retainedNuclearPotential_le {M m : ℕ} (S : Nuclei M) + (r : Configuration m → Finset (Fin m)) (x : Configuration m) : + retainedNuclearPotential S r x ≤ nuclearPotential S x := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) (fun i _ _ => attraction_nonneg S (position x i)) +lemma retainedNuclearPotential_measurable {M m : ℕ} (S : Nuclei M) + (r : Configuration m → Finset (Fin m)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (retainedNuclearPotential S r) := + measurable_retained_sum r hr _ (fun i => (attraction_measurable S).comp (positionCLM i).measurable) + +lemma retainedCrossPotential_nonneg {m k : ℕ} (r : Configuration m → Finset (Fin m)) + (x : Configuration m) (y : Configuration k) : 0 ≤ retainedCrossPotential r x y := + Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => coulombKernel_nonneg _)) +lemma retainedCrossPotential_le {m k : ℕ} (r : Configuration m → Finset (Fin m)) + (x : Configuration m) (y : Configuration k) : retainedCrossPotential r x y ≤ crossPotential x y := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) + (fun _ _ _ => Finset.sum_nonneg (fun _ _ => coulombKernel_nonneg _)) +lemma retainedCrossPotential_measurable {m k : ℕ} (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + Measurable (fun p : Configuration m × Configuration k => retainedCrossPotential r p.1 p.2) := by + unfold retainedCrossPotential + apply measurable_retained_sum (fun p : Configuration m × Configuration k => r p.1) + (fun i => (hr i).preimage measurable_fst) + intro i + apply Finset.measurable_sum + intro j _ + exact coulombKernel_measurable.comp (((positionCLM i).measurable.comp measurable_fst).sub + ((positionCLM j).measurable.comp measurable_snd)) + +lemma H1Vector.retained_outer_nuclear_integrable {M m k : ℕ} (ψ : H1Vector (m+k)) + (S : Nuclei M) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (st : Spins (m+k)) : + Integrable (fun z => retainedNuclearPotential S r ((joinConfiguration m k).symm z).1*‖ψ.value st z‖^2) := by + apply (ψ.outer_nuclear_integrable S st).mono' + · exact ((retainedNuclearPotential_measurable S r hr).comp + (measurable_fst.comp (joinConfiguration m k).symm.continuous.measurable)).aestronglyMeasurable.mul + (((ψ.value_L2 st).integrable_norm_pow (p:=2) (by decide)).aestronglyMeasurable) + · exact Eventually.of_forall fun z => by + rw [Real.norm_of_nonneg (mul_nonneg (retainedNuclearPotential_nonneg ..) (sq_nonneg _))] + exact mul_le_mul_of_nonneg_right (retainedNuclearPotential_le S r _) (sq_nonneg _) + +lemma H1Vector.retained_cross_integrable {m k : ℕ} (ψ : H1Vector (m+k)) + (r : Configuration m → Finset (Fin m)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (st : Spins (m+k)) : + Integrable (fun z => retainedCrossPotential r ((joinConfiguration m k).symm z).1 + ((joinConfiguration m k).symm z).2*‖ψ.value st z‖^2) := by + apply (ψ.cross_integrable st).mono' + · exact ((retainedCrossPotential_measurable r hr).comp + (joinConfiguration m k).symm.continuous.measurable).aestronglyMeasurable.mul + (((ψ.value_L2 st).integrable_norm_pow (p:=2) (by decide)).aestronglyMeasurable) + · exact Eventually.of_forall fun z => by + rw [Real.norm_of_nonneg (mul_nonneg (retainedCrossPotential_nonneg ..) (sq_nonneg _))] + exact mul_le_mul_of_nonneg_right (retainedCrossPotential_le r _ _) (sq_nonneg _) + +lemma potentialForm_retainedCross_eq {m k : ℕ} (r : Configuration m → Finset (Fin m)) + (x : Configuration m) (u : H1Vector k) : + potentialForm (retainedCrossPotential r x) u = ∑ i ∈ r x, coreCoulombPotential u (position x i) := by + have he (y : Configuration k) : retainedCrossPotential r x y = + ∑ i ∈ r x, nuclearPotential (unitNucleus (position x i)) y := by + unfold retainedCrossPotential nuclearPotential + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [attraction_unitNucleus, coulombKernel_sub_comm] + unfold potentialForm + simp_rw [he, Finset.sum_mul] + have hi (s : Spins k) : + (∫ y, ∑ i ∈ r x, nuclearPotential (unitNucleus (position x i)) y*‖u.value s y‖^2) = + ∑ i ∈ r x, ∫ y, nuclearPotential (unitNucleus (position x i)) y*‖u.value s y‖^2 := + integral_finsetSum _ (fun i _ => u.nuclear_integrable (unitNucleus (position x i)) s) + simp_rw [hi] + rw [Finset.sum_comm] + exact Finset.sum_congr rfl (fun i _ => nuclearEnergy_unit_eq_coreCoulomb u (position x i)) + +lemma retained_field_weight {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (r : Configuration m → Finset (Fin m)) (s : Spins m) (x : Configuration m) : + mass (ψ.coreSlice s x)*(∑ i ∈ r x, coreScreenedField S (ψ.coreSlice s x).normalized (position x i)) = + mass (ψ.coreSlice s x)*retainedNuclearPotential S r x - + potentialForm (retainedCrossPotential r x) (ψ.coreSlice s x) := by + simp only [coreScreenedField, Finset.sum_sub_distrib, mul_sub] + rw [←potentialForm_retainedCross_eq, potentialForm_normalized_weight] + rfl + +lemma retained_field_weight_integrable {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (r : Configuration m → Finset (Fin m)) (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)* + (∑ i ∈ r x, coreScreenedField S (ψ.coreSlice s x).normalized (position x i))) := by + simp_rw [retained_field_weight] + exact (slice_weight_integrable_const ψ _ (ψ.retained_outer_nuclear_integrable S r hr) s).sub + (potentialForm_coreSlice_parameter_integrable ψ s (retainedCrossPotential r) + (fun t => ψ.retained_cross_integrable r hr (Fin.append s t))) + +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SlotTensor.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SlotTensor.lean new file mode 100644 index 0000000000000000000000000000000000000000..207ae97778c4b19d77cfa04376deff48f6634168 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SlotTensor.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.DeterminantWave + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +noncomputable def slotTensor {A : Type*} {n : ℕ} (v d : Fin n → A → ℂ) + (p : Equiv.Perm (Fin n)) (i : Fin n) (x : Fin n → A) : ℂ := + ∏ j, if j = i then d (p j) (x j) else v (p j) (x j) + +lemma slotTensor_factor {A : Type*} {n : ℕ} (v d : Fin n → A → ℂ) + (p : Equiv.Perm (Fin n)) (i : Fin n) (x : Fin n → A) : + slotTensor v d p i x = d (p i) (x i) * ∏ j ∈ Finset.univ.erase i, v (p j) (x j) := by + unfold slotTensor + rw [← Finset.mul_prod_erase Finset.univ + (fun j => if j = i then d (p j) (x j) else v (p j) (x j)) (Finset.mem_univ i)] + simp only [ite_true] + congr 1 + apply Finset.prod_congr rfl + intro j hj + exact ite_eq_right (Finset.mem_erase.mp hj).1 + +lemma slotTensor_memLp {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v d : Fin n → A → ℂ) + (hv : ∀ a, MemLp (v a) 2 μ) (hd : ∀ a, MemLp (d a) 2 μ) + (p : Equiv.Perm (Fin n)) (i : Fin n) : + MemLp (slotTensor v d p i) 2 (Measure.pi fun _ : Fin n => μ) := by + have H (j : Fin n) : MemLp (fun a => if j = i then d (p j) a else v (p j) a) 2 μ := by + by_cases h : j = i + · simpa only [ite_eq_left h] using hd (p j) + · simpa only [ite_eq_right h] using hv (p j) + exact scalarTensor_memLp (fun j a => if j = i then d (p j) a else v (p j) a) H id + +lemma slotTensor_inner_integral {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v d : Fin n → A → ℂ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) + (p q : Equiv.Perm (Fin n)) (i : Fin n) : + (∫ x, star (slotTensor v d p i x) * slotTensor v d q i x + ∂(Measure.pi fun _ : Fin n => μ)) = + (∫ a, star (d (p i) a) * d (q i) a ∂μ) * + ∏ j ∈ Finset.univ.erase i, if p j = q j then (1:ℂ) else 0 := by + simp only [slotTensor, star_prod, ← Finset.prod_mul_distrib] + rw [integral_fintype_prod_eq_prod (f := fun j a => + star (if j = i then d (p j) a else v (p j) a) * + (if j = i then d (q j) a else v (q j) a)) (μ := fun _ => μ)] + rw [← Finset.mul_prod_erase Finset.univ (fun j => ∫ a, + star (if j = i then d (p j) a else v (p j) a) * + (if j = i then d (q j) a else v (q j) a) ∂μ) (Finset.mem_univ i)] + simp only [ite_true] + congr 1 + apply Finset.prod_congr rfl + intro j hj + simp only [ite_eq_right (Finset.mem_erase.mp hj).1, ho] + +noncomputable def slotDeterminant {A : Type*} {n : ℕ} (v d : Fin n → A → ℂ) + (i : Fin n) (x : Fin n → A) : ℂ := + ∑ p : Equiv.Perm (Fin n), (((p.sign : ℤ) : ℂ)) * slotTensor v d p i x + +lemma slotDeterminant_memLp {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v d : Fin n → A → ℂ) + (hv : ∀ a, MemLp (v a) 2 μ) (hd : ∀ a, MemLp (d a) 2 μ) (i : Fin n) : + MemLp (slotDeterminant v d i) 2 (Measure.pi fun _ : Fin n => μ) := + memLp_finsetSum _ (fun p _ => (slotTensor_memLp v d hv hd p i).const_mul _) + +lemma slotDeterminant_bilinear {A : Type*} {n : ℕ} (v d : Fin n → A → ℂ) + (i : Fin n) (x : Fin n → A) : + star (slotDeterminant v d i x) * slotDeterminant v d i x = + ∑ p : Equiv.Perm (Fin n), ∑ q : Equiv.Perm (Fin n), + star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + (star (slotTensor v d p i x) * slotTensor v d q i x) := by + simp only [slotDeterminant, star_sum, star_mul] + rw [Finset.sum_mul] + simp only [Finset.mul_sum] + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + ring + +lemma slotDeterminant_inner_integral {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v d : Fin n → A → ℂ) + (hv : ∀ a, MemLp (v a) 2 μ) (hd : ∀ a, MemLp (d a) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) + (i : Fin n) : + (∫ x, star (slotDeterminant v d i x) * slotDeterminant v d i x + ∂(Measure.pi fun _ : Fin n => μ)) = + ∑ p : Equiv.Perm (Fin n), ∑ q : Equiv.Perm (Fin n), + star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + ((∫ a, star (d (p i) a) * d (q i) a ∂μ) * + ∏ j ∈ Finset.univ.erase i, if p j = q j then (1:ℂ) else 0) := by + have hi (p q : Equiv.Perm (Fin n)) : Integrable + (fun x : Fin n → A => star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + (star (slotTensor v d p i x) * slotTensor v d q i x)) (Measure.pi fun _ => μ) := + ((slotTensor_memLp v d hv hd p i).star.integrable_mul + (slotTensor_memLp v d hv hd q i)).const_mul _ + simp_rw [slotDeterminant_bilinear] + rw [integral_finsetSum _ (fun p _ => integrable_finsetSum _ (fun q _ => hi p q))] + apply Finset.sum_congr rfl + intro p _ + rw [integral_finsetSum _ (fun q _ => hi p q)] + apply Finset.sum_congr rfl + intro q _ + rw [integral_const_mul, slotTensor_inner_integral v d ho] + +lemma slotDeterminant_total_norm_sq {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v d : Fin n → A → ℂ) + (hv : ∀ a, MemLp (v a) 2 μ) (hd : ∀ a, MemLp (d a) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) : + (∑ i, ∫ x, ‖slotDeterminant v d i x‖^2 ∂(Measure.pi fun _ : Fin n => μ)) = + (n.factorial : ℝ) * ∑ i, ∫ a, ‖d i a‖^2 ∂μ := by + have hn (z : ℂ) : (↑(‖z‖^2) : ℂ) = star z * z := by + rw [mul_comm, Complex.ofReal_pow] + exact (inner_self_eq_norm_sq_to_K (𝕜 := ℂ) z).symm + apply Complex.ofReal_injective + push_cast + simp_rw [← integral_complex_ofReal, hn, slotDeterminant_inner_integral v d hv hd ho] + calc + _ = ∑ p : Equiv.Perm (Fin n), ∑ q : Equiv.Perm (Fin n), + star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + ∑ i, (∫ a, star (d (p i) a) * d (q i) a ∂μ) * + ∏ j ∈ Finset.univ.erase i, if p j = q j then (1:ℂ) else 0 := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro p _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q _ + rw [Finset.mul_sum] + _ = _ := slater_one_body_trace_algebra + (fun a b => ∫ x, star (d a x) * d b x ∂μ) + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SortedObservable.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SortedObservable.lean new file mode 100644 index 0000000000000000000000000000000000000000..457cda644b4ff002671d3b9f9eb294f74d5f624e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SortedObservable.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.SortedCut +import OAI.Analysis.CoulombRadii.FieldAnalysis.RawObservable +import OAI.Analysis.CoulombRadii.Screening.CountMoments + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def reindexConfiguration {m n : ℕ} (e : Fin m ≃ Fin n) (x : Configuration m) : Configuration n := + WithLp.toLp 2 (fun ib => x (e.symm ib.1,ib.2)) + +lemma restrictedOutPotential_reindex {m n : ℕ} (e : Fin m ≃ Fin n) + (x : Configuration m) (A : Set Space) (y : Space) : + restrictedOutPotential (reindexConfiguration e x) A y=restrictedOutPotential x A y := by + change (∑ i : Fin n, if position x (e.symm i) ∈ A then coulombKernel (position x (e.symm i)-y) else 0)=_ + exact Equiv.sum_comp e.symm (fun i => if position x i ∈ A then coulombKernel (position x i-y) else 0) + +lemma rawSignedField_reindex {m n : ℕ} (e : Fin m ≃ Fin n) + (V : ℝ) (A : Set Space) (y : Space) (x : Configuration m) : + rawSignedField V A y (reindexConfiguration e x)=rawSignedField V A y x := by + simp only [rawSignedField,restrictedOutPotential_reindex] + +lemma labelCut_outer_support {m k : ℕ} {L : Type*} [Fintype L] + (ψ : H1Vector (m+k)) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+k) → L) (l : L) (hc : ∀ i, p (Fin.castAdd k i)=l) + (A : Set Space) (hA : ∀ z ∉ A, χ l z=0) (s : Spins m) : + ∀ᵐ x, mass ((ψ.labelCut χ hχ hp D hD hd p).coreSlice s x) ≠0 → + ∀ i, position x i ∈ A := by + let u := ψ.labelCut χ hχ hp D hD hd p + filter_upwards [u.coreSliceRegular_ae s] with x hx hm i + by_contra hi + have hv (t : Spins k) (v : Configuration k) : (u.coreSlice s x).value t v=0 := by + rw [u.coreSlice_value s hx] + change (↑(tensorCut χ p (joinConfiguration m k (x,v))):ℂ)*ψ.value (Fin.append s t) + (joinConfiguration m k (x,v))=0 + have H : tensorCut χ p (joinConfiguration m k (x,v))=0 := by + apply Finset.prod_eq_zero (Finset.mem_univ (Fin.castAdd k i)) + rw [hc,position_join_left,hA _ hi] + rw [H,Complex.ofReal_zero,zero_mul] + apply hm + change mass (u.coreSlice s x)=0 + simp only [mass,hv,norm_zero,zero_pow (by decide : 2≠0),integral_zero,Finset.sum_const_zero] + +lemma outLabelCount_order {m k n : ℕ} (p : Fin n → Fin 2) (e : Fin (m+k) ≃ Fin n) + (h0 : ∀ i : Fin m, p (e (Fin.castAdd k i))=0) + (h1 : ∀ i : Fin k, p (e (Fin.natAdd m i))=1) : outLabelCount p=(m:ℝ) := by + unfold outLabelCount + rw [← Equiv.sum_comp e (fun i => if p i=0 then (1:ℝ) else 0),Fin.sum_univ_add] + simp [h0,h1] + +theorem binary_cut_recorded_outcome {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (hψ : Antisymmetric ψ) + (χ : Fin 2 → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → Fin 2) (A B : Set Space) + (hA : ∀ z ∉ A, χ 1 z=0) (hB : ∀ z ∉ B, χ 0 z=0) : + ∃ m k : ℕ, ∃ u : H1Vector (m+k), ∃ e : Fin (m+k) ≃ Fin n, + m+k=n ∧ outLabelCount p=(m:ℝ) ∧ + mass u=mass (ψ.labelCut χ hχ hp D hD hd p) ∧ + form S u=form S (ψ.labelCut χ hχ hp D hD hd p) ∧ + (∀ W : Configuration n → ℝ, + (∀ q x, W (permute q x)=W x) → + potentialForm (fun x => W (reindexConfiguration e x)) u=potentialForm W (ψ.labelCut χ hχ hp D hD hd p)) ∧ + (∀ s, ∀ᵐ x, Antisymmetric (u.coreSlice s x)) ∧ + (∀ s, ∀ᵐ x, SpatiallySupported (u.coreSlice s x) A) ∧ + (∀ s, ∀ᵐ x, mass (u.coreSlice s x) ≠0 → ∀ i, position x i ∈ B) := by + obtain ⟨m,k,e,he0,he1⟩ := exists_binary_order p + have hn : m+k=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + let v := ψ.labelCut χ hχ hp D hD hd p + let u := (ψ.permutation e.symm).labelCut χ hχ hp D hD hd (p ∘ e) + have hval (s : Spins (m+k)) : (v.permutation e.symm).value s =ᵐ[volume] u.value s := by + exact Eventually.of_forall (fun x => labelCut_permute_value ψ χ hχ hp D hD hd p e.symm s x) + refine ⟨m,k,u,e,rfl,outLabelCount_order p e he0 he1,?_,?_,?_,?_,?_,?_⟩ + · rw [← mass_congr_ae _ _ hval,mass_permutation] + · rw [← form_congr_ae S _ _ hval,form_permutation] + · intro W hW + have hw : (fun x => W (reindexConfiguration e x))=W := by + funext x + exact hW e.symm x + rw [hw] + change potentialEnergy W u=potentialEnergy W v + rw [← potentialEnergy_congr_ae _ _ _ hval,potentialEnergy_permutation W hW] + · intro s + exact labelCut_core_antisymmetric _ (hψ.permutation e.symm) χ hχ hp D hD hd (p ∘ e) 1 he1 s + · intro s + exact labelCut_core_support _ χ hχ hp D hD hd (p ∘ e) 1 he1 A hA s + · intro s + exact labelCut_outer_support _ χ hχ hp D hD hd (p ∘ e) 0 he0 B hB s + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Space.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Space.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bd3fd15c97e1a38c0edcba379f1d8a7184becd2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Space.lean @@ -0,0 +1,400 @@ +import Mathlib + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate + +namespace Coulomb + +abbrev Space := EuclideanSpace ℝ (Fin 3) +abbrev Configuration (n : ℕ) := EuclideanSpace ℝ (Fin n × Fin 3) +abbrev Spins (n : ℕ) := Fin n → Fin 2 + +structure Nuclei (M : ℕ) where + nonempty : 0 < M + position : Fin M → Space + distinct : Function.Injective position + charge : Fin M → ℝ + charge_ge_one : ∀ j, 1 ≤ charge j + +noncomputable def totalCharge {M : ℕ} (S : Nuclei M) : ℝ := ∑ j, S.charge j + +noncomputable def position {n : ℕ} (x : Configuration n) (i : Fin n) : Space := + WithLp.toLp 2 (fun b => x (i, b)) + +noncomputable def coulombKernel (x : Space) : ℝ := ‖x‖⁻¹ + +noncomputable def attraction {M : ℕ} (S : Nuclei M) (x : Space) : ℝ := + ∑ j, S.charge j * coulombKernel (x - S.position j) + +noncomputable def permute {n : ℕ} (p : Equiv.Perm (Fin n)) + (x : Configuration n) : Configuration n := + WithLp.toLp 2 (fun ib => x (p ib.1, ib.2)) + +structure H1Vector (n : ℕ) where + value : Spins n → Configuration n → ℂ + gradient : Spins n → (Fin n × Fin 3) → Configuration n → ℂ + value_L2 : ∀ s, MemLp (value s) 2 volume + partial_L2 : ∀ s a, MemLp (gradient s a) 2 volume + weak_partial : ∀ s a (φ : Configuration n → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, value s x * (fderiv ℝ φ x (EuclideanSpace.single a 1) : ℂ)) = + -(∫ x, gradient s a x * (φ x : ℂ)) + +def Antisymmetric {n : ℕ} (ψ : H1Vector n) : Prop := + ∀ (p : Equiv.Perm (Fin n)) (s : Spins n), + ∀ᵐ x ∂volume, + ψ.value (s ∘ p) (permute p x) = ((p.sign : ℤ) : ℂ) * ψ.value s x + +noncomputable def mass {n : ℕ} (ψ : H1Vector n) : ℝ := + ∑ s, ∫ x, ‖ψ.value s x‖ ^ 2 + +noncomputable def kinetic {n : ℕ} (ψ : H1Vector n) : ℝ := + (1 / 2 : ℝ) * ∑ s, ∑ a, ∫ x, ‖ψ.gradient s a x‖ ^ 2 + +noncomputable def nuclearEnergy {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) : ℝ := + ∑ s, ∫ x, (∑ i, attraction S (position x i)) * ‖ψ.value s x‖ ^ 2 + +noncomputable def pairEnergy {n : ℕ} (ψ : H1Vector n) : ℝ := + ∑ s, ∫ x, (∑ i : Fin n, ∑ j : Fin n, + if i < j then coulombKernel (position x i - position x j) else 0) * + ‖ψ.value s x‖ ^ 2 + +noncomputable def form {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) : ℝ := + kinetic ψ - nuclearEnergy S ψ + pairEnergy ψ + +noncomputable def energy {M : ℕ} (S : Nuclei M) (n : ℕ) : ℝ := + if n = 0 then 0 else + sInf {e : ℝ | ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ form S ψ = e} + +def GroundState {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) : Prop := + Antisymmetric ψ ∧ mass ψ = 1 ∧ form S ψ = energy S n + +def atom (Z : ℕ) (hZ : 1 ≤ Z) : Nuclei 1 where + nonempty := by decide + position := fun _ => 0 + distinct := fun a b _ => Subsingleton.elim a b + charge := fun _ => Z + charge_ge_one := by intro j; exact_mod_cast hZ + +noncomputable def exteriorMass {n : ℕ} (ψ : H1Vector n) (r : ℝ) : ℝ := + ∑ s, ∫ x, (∑ i : Fin n, if r < ‖position x i‖ then (1 : ℝ) else 0) * + ‖ψ.value s x‖ ^ 2 + +noncomputable def outerRadius {n : ℕ} (ψ : H1Vector n) : ℝ := + sInf {r : ℝ | 0 ≤ r ∧ exteriorMass ψ r ≤ (1 / 2 : ℝ)} + +theorem bounded_quadratic_bootstrap (h : ℕ → ℝ) (B : ℝ) + (hB : ∀ j, h j ≤ B) (hgrowth : ∀ j, (h j) ^ 2 ≤ 1 + h (j + 1)) : + h 0 ≤ 2 := by + by_contra hbad + have hstart : 2 < h 0 := lt_of_not_ge hbad + have hlinear : ∀ j : ℕ, 2 + (j : ℝ) ≤ h j := by + intro j + induction j with + | zero => simpa using hstart.le + | succ j ih => + have hjnonneg : (0 : ℝ) ≤ j := Nat.cast_nonneg j + have hj : 2 ≤ h j := by linarith + have hprod : 0 ≤ (h j - 2) * (h j + 1) := + mul_nonneg (by linarith) (by linarith) + have hg := hgrowth j + push_cast + nlinarith + obtain ⟨j, hj⟩ := exists_nat_gt B + have hb := hB j + have hl := hlinear j + linarith + +theorem geometric_quadratic_bootstrap (g : ℕ → ℝ) (C D : ℝ) + (hC : 1 ≤ C) + (hbound : ∀ j, g j ≤ D * C ^ (j + 2)) + (hrec : ∀ j, (g j) ^ 2 ≤ C ^ (j + 1) * (1 + g (j + 1))) : + g 0 ≤ 2 * C ^ 2 := by + have hCpos : 0 < C := lt_of_lt_of_le zero_lt_one hC + let h : ℕ → ℝ := fun j => g j / C ^ (j + 2) + have hbounded : ∀ j, h j ≤ D := by + intro j + exact (div_le_iff₀ (pow_pos hCpos _)).2 (hbound j) + have hrec' : ∀ j, (h j) ^ 2 ≤ 1 + h (j + 1) := by + intro j + have hpow : 1 ≤ C ^ (j + 3) := one_le_pow₀ hC + have hpower : (C ^ (j + 2)) ^ 2 = C ^ (j + 1) * C ^ (j + 3) := by + rw [← pow_mul, ← pow_add] + congr 1 + omega + have hratio : C ^ (j + 1) / (C ^ (j + 2)) ^ 2 ≤ 1 := by + apply (div_le_iff₀ (sq_pos_of_pos (pow_pos hCpos _))).2 + rw [one_mul, hpower] + exact le_mul_of_one_le_right (le_of_lt (pow_pos hCpos _)) hpow + calc + (h j) ^ 2 = (g j) ^ 2 / (C ^ (j + 2)) ^ 2 := div_pow _ _ _ + _ ≤ (C ^ (j + 1) * (1 + g (j + 1))) / (C ^ (j + 2)) ^ 2 := + div_le_div_of_nonneg_right (hrec j) (sq_nonneg _) + _ = C ^ (j + 1) / (C ^ (j + 2)) ^ 2 + h (j + 1) := by + dsimp [h] + rw [hpower] + have heq : j + 1 + 2 = j + 3 := by omega + rw [heq] + field_simp + _ ≤ 1 + h (j + 1) := by linarith + have hzero := bounded_quadratic_bootstrap h D hbounded hrec' + exact (div_le_iff₀ (pow_pos hCpos 2)).1 hzero + +theorem memLp_two_real_mul {n : ℕ} {u : Configuration n → ℂ} + (hu : MemLp u 2 volume) {f : Configuration n → ℝ} (hf : Continuous f) + {B : ℝ} (hB : ∀ x, |f x| ≤ B) : + MemLp (fun x => (f x : ℂ) * u x) 2 volume := by + apply hu.of_le_mul (c := B) ((Complex.continuous_ofReal.comp hf).aestronglyMeasurable.mul + hu.aestronglyMeasurable) + filter_upwards [] with x + simpa only [Pi.mul_apply, Function.comp_apply, norm_mul, Complex.norm_real, Real.norm_eq_abs] using + mul_le_mul_of_nonneg_right (hB x) (norm_nonneg (u x)) + +noncomputable def H1Vector.smoothMul {n : ℕ} (ψ : H1Vector n) + (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) : H1Vector n where + value s x := (f x : ℂ) * ψ.value s x + gradient s a x := + (fderiv ℝ f x (EuclideanSpace.single a 1) : ℂ) * ψ.value s x + + (f x : ℂ) * ψ.gradient s a x + value_L2 s := memLp_two_real_mul (ψ.value_L2 s) hf.continuous hB + partial_L2 s a := + (memLp_two_real_mul (ψ.value_L2 s) + ((hf.continuous_fderiv (by simp)).clm_apply continuous_const) (hD a)).add + (memLp_two_real_mul (ψ.partial_L2 s a) hf.continuous hB) + weak_partial s a φ hφ hφc := by + let v := EuclideanSpace.single a (1 : ℝ) + have hφL : MemLp (fun x => (φ x : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hφc.comp_left (by simp)) + have hdφL : MemLp (fun x => (fderiv ℝ φ x v : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hφc.fderiv_apply ℝ v).comp_left (by simp)) + have hA : Integrable (fun x => ((f x : ℂ) * ψ.value s x) * + (fderiv ℝ φ x v : ℂ)) volume := + (memLp_two_real_mul (ψ.value_L2 s) hf.continuous hB).integrable_mul hdφL + have hB' : Integrable (fun x => + ((fderiv ℝ f x v : ℂ) * ψ.value s x) * (φ x : ℂ)) volume := + (memLp_two_real_mul (ψ.value_L2 s) + ((hf.continuous_fderiv (by simp)).clm_apply continuous_const) (hD a)).integrable_mul hφL + have hC : Integrable (fun x => ((f x : ℂ) * ψ.gradient s a x) * + (φ x : ℂ)) volume := + (memLp_two_real_mul (ψ.partial_L2 s a) hf.continuous hB).integrable_mul hφL + have hweak := ψ.weak_partial s a (f * φ) (hf.mul hφ) hφc.mul_left + have hprod : ∀ x, ψ.value s x * (fderiv ℝ (f * φ) x v : ℂ) = + ((f x : ℂ) * ψ.value s x) * (fderiv ℝ φ x v : ℂ) + + ((fderiv ℝ f x v : ℂ) * ψ.value s x) * (φ x : ℂ) := by + intro x + rw [fderiv_mul (hf.differentiable (by simp) x) (hφ.differentiable (by simp) x)] + simp only [add_apply, smul_apply, + smul_eq_mul, Complex.ofReal_add, Complex.ofReal_mul] + ring + change (∫ x, ψ.value s x * (fderiv ℝ (f * φ) x v : ℂ)) = _ at hweak + simp_rw [hprod] at hweak + rw [integral_add hA hB'] at hweak + have hr : ∀ x, ψ.gradient s a x * ((f * φ) x : ℂ) = + ((f x : ℂ) * ψ.gradient s a x) * (φ x : ℂ) := by + intro x + simp only [Pi.mul_apply, Complex.ofReal_mul] + ring + simp_rw [hr] at hweak + change (∫ x, ((f x : ℂ) * ψ.value s x) * (fderiv ℝ φ x v : ℂ)) = _ + simp_rw [add_mul] + rw [integral_add hB' hC] + linear_combination hweak + +theorem H1Vector.smoothMul_antisymmetric {n : ℕ} (ψ : H1Vector n) + (hψ : Antisymmetric ψ) (f : Configuration n → ℝ) (hf : ContDiff ℝ (⊤ : ℕ∞) f) + (B D : ℝ) (hB : ∀ x, |f x| ≤ B) + (hD : ∀ a x, |fderiv ℝ f x (EuclideanSpace.single a 1)| ≤ D) + (hsymm : ∀ p x, f (permute p x) = f x) : + Antisymmetric (ψ.smoothMul f hf B D hB hD) := by + intro p s + filter_upwards [hψ p s] with x hx + dsimp [H1Vector.smoothMul] + rw [hsymm p x, hx] + ring + +lemma norm_real_mul_sq (a : ℝ) (z : ℂ) : + ‖(a : ℂ) * z‖ ^ 2 = a ^ 2 * ‖z‖ ^ 2 := by + simp only [Complex.sq_norm, Complex.normSq_mul, Complex.normSq_ofReal] + ring + +lemma norm_real_mul_add_sq (a b : ℝ) (u v : ℂ) : + ‖(a : ℂ) * u + (b : ℂ) * v‖ ^ 2 = + a ^ 2 * ‖u‖ ^ 2 + b ^ 2 * ‖v‖ ^ 2 + + 2 * a * b * (u.re * v.re + u.im * v.im) := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.add_re, Complex.add_im, + Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im] + ring + +theorem quadratic_partition_derivative {n : ℕ} {ι : Type*} [Fintype ι] + (f : ι → Configuration n → ℝ) (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) (x v : Configuration n) : + ∑ i, f i x * fderiv ℝ (f i) x v = 0 := by + classical + have heq : (fun y => ∑ i, f i y ^ 2) = fun _ => (1 : ℝ) := funext hpart + have hd := congrArg (fun g : Configuration n → ℝ => fderiv ℝ g x v) heq + rw [fderiv_fun_sum (u := Finset.univ) (A := fun i y => f i y ^ 2) + (fun i _ => (hf i).differentiable (by simp) x |>.pow 2)] at hd + simp only [sum_apply] at hd + have hp : ∀ i, fderiv ℝ (fun y => f i y ^ 2) x v = + 2 * (f i x * fderiv ℝ (f i) x v) := by + intro i + change fderiv ℝ (f i ^ 2) x v = _ + rw [fderiv_pow 2 ((hf i).differentiable (by simp) x)] + simp + ring + simp_rw [hp] at hd + simp only [← Finset.mul_sum] at hd + have hz : fderiv ℝ (fun _ : Configuration n => (1 : ℝ)) x v = 0 := by simp + rw [hz] at hd + linarith + +theorem ims_pointwise {n : ℕ} {ι : Type*} [Fintype ι] + (f : ι → Configuration n → ℝ) (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) (x e : Configuration n) (u v : ℂ) : + (∑ i, ‖(fderiv ℝ (f i) x e : ℂ) * u + (f i x : ℂ) * v‖ ^ 2) = + ‖v‖ ^ 2 + (∑ i, (fderiv ℝ (f i) x e) ^ 2) * ‖u‖ ^ 2 := by + classical + simp_rw [norm_real_mul_add_sq] + rw [Finset.sum_add_distrib, Finset.sum_add_distrib, + ← Finset.sum_mul, ← Finset.sum_mul, hpart, one_mul] + have hcross : (∑ i, 2 * fderiv ℝ (f i) x e * f i x * + (u.re * v.re + u.im * v.im)) = 0 := by + conv_lhs => arg 2; intro i; rw [show + 2 * fderiv ℝ (f i) x e * f i x * (u.re * v.re + u.im * v.im) = + (f i x * fderiv ℝ (f i) x e) * + (2 * (u.re * v.re + u.im * v.im)) by ring] + rw [← Finset.sum_mul, quadratic_partition_derivative f hf hpart, zero_mul] + rw [hcross] + ring + +theorem mass_smooth_partition {n : ℕ} {ι : Type*} [Fintype ι] + (ψ : H1Vector n) (f : ι → Configuration n → ℝ) + (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) (B D : ℝ) + (hB : ∀ i x, |f i x| ≤ B) + (hD : ∀ i a x, |fderiv ℝ (f i) x (EuclideanSpace.single a 1)| ≤ D) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) : + (∑ i, mass (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i))) = mass ψ := by + classical + let χ := fun i => ψ.smoothMul (f i) (hf i) B D (hB i) (hD i) + change (∑ i, mass (χ i)) = mass ψ + have hblock : ∀ s, (∑ i, ∫ x, ‖(χ i).value s x‖ ^ 2) = + ∫ x, ‖ψ.value s x‖ ^ 2 := by + intro s + rw [← integral_finsetSum _ (fun i _ => + ((χ i).value_L2 s).integrable_norm_pow (p := 2) (by decide))] + apply integral_congr_ae + filter_upwards [] with x + change (∑ i, ‖(f i x : ℂ) * ψ.value s x‖ ^ 2) = ‖ψ.value s x‖ ^ 2 + simp_rw [norm_real_mul_sq] + rw [← Finset.sum_mul, hpart, one_mul] + unfold mass + rw [Finset.sum_comm] + exact Finset.sum_congr rfl (fun s _ => hblock s) + +theorem kinetic_smooth_partition {n : ℕ} {ι : Type*} [Fintype ι] + (ψ : H1Vector n) (f : ι → Configuration n → ℝ) + (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) (B D : ℝ) + (hB : ∀ i x, |f i x| ≤ B) + (hD : ∀ i a x, |fderiv ℝ (f i) x (EuclideanSpace.single a 1)| ≤ D) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) : + (∑ i, kinetic (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i))) = + kinetic ψ + (1 / 2 : ℝ) * ∑ s, ∑ a, ∫ x, + (∑ i, (fderiv ℝ (f i) x (EuclideanSpace.single a 1)) ^ 2) * + ‖ψ.value s x‖ ^ 2 := by + classical + let χ := fun i => ψ.smoothMul (f i) (hf i) B D (hB i) (hD i) + have hblock : ∀ s a, (∑ i, ∫ x, ‖(χ i).gradient s a x‖ ^ 2) = + (∫ x, ‖ψ.gradient s a x‖ ^ 2) + + ∫ x, (∑ i, (fderiv ℝ (f i) x (EuclideanSpace.single a 1)) ^ 2) * + ‖ψ.value s x‖ ^ 2 := by + intro s a + have hi : ∀ i, Integrable (fun x => + (fderiv ℝ (f i) x (EuclideanSpace.single a 1)) ^ 2 * ‖ψ.value s x‖ ^ 2) + volume := by + intro i + have hL := memLp_two_real_mul (ψ.value_L2 s) + (((hf i).continuous_fderiv (by simp)).clm_apply continuous_const) (hD i a) + simpa only [norm_real_mul_sq] using hL.integrable_norm_pow (p := 2) (by decide) + have herr : Integrable (fun x => + (∑ i, (fderiv ℝ (f i) x (EuclideanSpace.single a 1)) ^ 2) * + ‖ψ.value s x‖ ^ 2) volume := by + simp_rw [Finset.sum_mul] + exact integrable_finsetSum _ (fun i _ => hi i) + rw [← integral_finsetSum _ (fun i _ => + ((χ i).partial_L2 s a).integrable_norm_pow (p := 2) (by decide))] + have heq : (fun x => ∑ i, ‖(χ i).gradient s a x‖ ^ 2) = + fun x => ‖ψ.gradient s a x‖ ^ 2 + + (∑ i, (fderiv ℝ (f i) x (EuclideanSpace.single a 1)) ^ 2) * + ‖ψ.value s x‖ ^ 2 := by + funext x + exact ims_pointwise f hf hpart x (EuclideanSpace.single a 1) + (ψ.value s x) (ψ.gradient s a x) + rw [heq, integral_add ((ψ.partial_L2 s a).integrable_norm_pow (p := 2) (by decide)) herr] + change (∑ i, kinetic (χ i)) = _ + unfold kinetic + rw [← Finset.mul_sum] + have hswap : (∑ i, ∑ s, ∑ a, ∫ x, ‖(χ i).gradient s a x‖ ^ 2) = + ∑ s, ∑ a, ∑ i, ∫ x, ‖(χ i).gradient s a x‖ ^ 2 := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro s _ + rw [Finset.sum_comm] + rw [hswap] + simp_rw [hblock, Finset.sum_add_distrib] + ring + +open ContinuousLinearMap +open scoped Convolution + +structure HardyCoordinates (n : ℕ) (i : Fin n) where + coord : Fin 3 → Configuration n → ℝ + smooth : ∀ b, ContDiff ℝ (⊤ : ℕ∞) (coord b) + directional : ∀ a b x, fderiv ℝ (coord a) x (EuclideanSpace.single (i,b) 1) = + if a = b then 1 else 0 + +noncomputable def blockRadiusSq {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (x : Configuration n) : ℝ := ∑ b : Fin 3, (R.coord b x)^2 + +lemma blockRadiusSq_nonneg {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) (x : Configuration n) : + 0 ≤ blockRadiusSq i R x := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + +lemma contDiff_blockRadiusSq {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) : + ContDiff ℝ (⊤ : ℕ∞) (blockRadiusSq i R) := by + apply ContDiff.sum + intro b _ + exact (R.smooth b).pow 2 + +lemma fderiv_blockRadiusSq {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (x : Configuration n) (b : Fin 3) : + fderiv ℝ (blockRadiusSq i R) x (EuclideanSpace.single (i,b) 1) = + 2 * R.coord b x := by + unfold blockRadiusSq + rw [fderiv_fun_sum (u := Finset.univ) (A := fun a (y : Configuration n) => (R.coord a y)^2) + (fun a _ => ((R.smooth a).differentiable (by simp) x).pow 2)] + simp only [sum_apply] + have heach : ∀ a : Fin 3, + fderiv ℝ (fun y : Configuration n => (R.coord a y)^2) x + (EuclideanSpace.single (i,b) 1) = + if a = b then 2 * R.coord b x else 0 := by + intro a + have hd := (((R.smooth a).differentiable (by simp) x).hasFDerivAt).pow 2 + rw [hd.fderiv] + simp only [smul_apply, smul_eq_mul, R.directional] + by_cases hab : a = b <;> simp [hab] + simp_rw [heach] + simp + +end Coulomb +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinConfigurationIntegral.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinConfigurationIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..c747896b51e042969063cf56a1a7262a914d0924 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinConfigurationIntegral.lean @@ -0,0 +1,226 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Add +import OAI.Analysis.CoulombRadii.Packets.OrbitalKernel +import OAI.Analysis.CoulombRadii.Localization.TruncatedCoulomb + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma spinConfiguration_integral {n : ℕ} (F : Spins n → Configuration n → ℝ) + (hF : ∀ s, Integrable (F s)) : + (∫ z, F ((spinCubeEquiv n) z).1 (WithLp.toLp 2 ((spinCubeEquiv n) z).2) + ∂(Measure.pi fun _ : Fin n => spinSpaceMeasure)) = ∑ s, ∫ x, F s x := by + rw [(spinCubeEquiv_full_measurePreserving n).integral_comp' + (fun sx => F sx.1 (WithLp.toLp 2 sx.2))] + have hm : MeasurePreserving (MeasurableEquiv.toLp 2 ((Fin n × Fin 3) → ℝ)) volume volume := + PiLp.volume_preserving_toLp _ + rw [integral_finite_count_prod _ (fun s => hm.integrable_comp_of_integrable (hF s))] + apply Finset.sum_congr rfl + intro s _ + exact hm.integral_comp' (F s) + +lemma sum_pair_symmetric {n : ℕ} (w : Fin n → Fin n → ℝ) + (hw : ∀ i j, w i j = w j i) : + (∑ i, ∑ j ∈ Finset.univ.erase i, w i j) = + 2 * ∑ i, ∑ j, if i < j then w i j else 0 := by + have he (i : Fin n) : (∑ j ∈ Finset.univ.erase i, w i j) = + (∑ j, if i < j then w i j else 0) + (∑ j, if j < i then w i j else 0) := by + rw [← Finset.sum_add_distrib] + rw [Finset.sum_erase_eq_sub (Finset.mem_univ i)] + have hpoint (j : Fin n) : w i j = (if i < j then w i j else 0) + + (if j < i then w i j else 0) + (if j = i then w i i else 0) := by + rcases lt_trichotomy i j with h|h|h + · simp [h, h.not_gt, h.ne']; + · subst j; simp + · simp [h, h.not_gt, h.ne] + conv_lhs => lhs; arg 2; ext j; rw [hpoint j] + simp only [Finset.sum_add_distrib, Finset.sum_ite_eq', Finset.mem_univ, ite_true] + ring + simp_rw [he] + rw [Finset.sum_add_distrib] + have hs : (∑ i : Fin n, ∑ j : Fin n, if j < i then w i j else 0) = + ∑ i : Fin n, ∑ j : Fin n, if i < j then w i j else 0 := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [hw j i] + rw [hs] + ring + +lemma cubeState_pair_energy {n : ℕ} (ψ : H1Vector n) : + (∫ z, (∑ i, ∑ j ∈ Finset.univ.erase i, + coulombKernel (WithLp.toLp 2 (z i).2-WithLp.toLp 2 (z j).2)) * ‖cubeState ψ z‖^2 + ∂(Measure.pi fun _ : Fin n => spinSpaceMeasure)) = 2*pairEnergy ψ := by + have hs (z : Fin n → Fin 2 × (Fin 3 → ℝ)) := sum_pair_symmetric + (fun i j => coulombKernel (WithLp.toLp 2 (z i).2-WithLp.toLp 2 (z j).2)) + (fun i j => congrArg (fun r : ℝ => r⁻¹) (norm_sub_rev _ _)) + simp_rw [hs, mul_assoc] + rw [integral_const_mul] + congr 1 + exact spinConfiguration_integral + (fun s x => (∑ i : Fin n, ∑ j : Fin n, if i < j then + coulombKernel (position x i-position x j) else 0)*‖ψ.value s x‖^2) + ψ.pair_integrable + +lemma slaterState_pair_upper_flat {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) : + pairEnergy (slaterState v hv hC) ≤ (1/2:ℝ)* + (∑ a, ∑ b, ∫ xy : (Fin 2 × (Fin 3 → ℝ)) × (Fin 2 × (Fin 3 → ℝ)), + coulombKernel (WithLp.toLp 2 xy.1.2-WithLp.toLp 2 xy.2.2) * + (‖flatSpinOrbital (v a) xy.1‖^2*‖flatSpinOrbital (v b) xy.2‖^2) + ∂(spinSpaceMeasure.prod spinSpaceMeasure)) := by + have hV (a : Fin n) (s : Fin 2) : MemLp (fun x => v a x s) 2 volume := + (hv a s).continuous.memLp_of_hasCompactSupport (hC a s) + have hO (a b : Fin n) : (∫ x, star (flatSpinOrbital (v a) x)*flatSpinOrbital (v b) x + ∂spinSpaceMeasure) = if a = b then (1:ℂ) else 0 := by + rw [flatSpinOrbital_inner (v a) (v b) (hV a) (hV b)] + exact ho a b + have H := slaterWave_two_body_upper (fun a => flatSpinOrbital (v a)) + (fun x y => coulombKernel (WithLp.toLp 2 x.2-WithLp.toLp 2 y.2)) + (fun a => flatSpinOrbital_memLp (v a) (hV a)) hO + (flatSpinOrbital_coulomb_cross_integrable v hv hC) + (fun x y => coulombKernel_nonneg _) + rw [← slaterState_cubeState v hv hC, cubeState_pair_energy] at H + linarith +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma spinPair_integral (F : Fin 2 → Fin 2 → Space × Space → ℝ) + (hF : ∀ s t, Integrable (F s t)) : + (∫ xy : (Fin 2 × (Fin 3 → ℝ)) × (Fin 2 × (Fin 3 → ℝ)), + F xy.1.1 xy.2.1 (WithLp.toLp 2 xy.1.2, WithLp.toLp 2 xy.2.2) + ∂(spinSpaceMeasure.prod spinSpaceMeasure)) = ∑ s, ∑ t, ∫ xy, F s t xy := by + have hm0 : MeasurePreserving (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)) volume volume := + PiLp.volume_preserving_toLp _ + have hm : MeasurePreserving ((MeasurableEquiv.toLp 2 (Fin 3 → ℝ)).prodCongr + (MeasurableEquiv.toLp 2 (Fin 3 → ℝ))) volume volume := hm0.prod hm0 + have hR := pairRegroup_measurePreserving (Measure.count : Measure (Fin 2)) + (volume : Measure (Fin 3 → ℝ)) (Measure.count : Measure (Fin 2)) (volume : Measure (Fin 3 → ℝ)) + rw [count_prod_count] at hR + let G (sz : (Fin 2 × Fin 2) × ((Fin 3 → ℝ) × (Fin 3 → ℝ))) : ℝ := + F sz.1.1 sz.1.2 (WithLp.toLp 2 sz.2.1, WithLp.toLp 2 sz.2.2) + change (∫ p, G (pairRegroup p) ∂((Measure.count.prod volume).prod (Measure.count.prod volume))) = _ + rw [hR.integral_comp' G, integral_finite_count_prod (μ := volume.prod volume) G + (fun st => hm.integrable_comp_of_integrable (hF st.1 st.2))] + rw [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro t _ + exact hm.integral_comp' (F s t) + +lemma compact_coulomb_direct_integrable (f g : Space → ℂ) + (hf : Continuous f) (hg : Continuous g) + (hfc : HasCompactSupport f) (hgc : HasCompactSupport g) : + Integrable (fun xy : Space × Space => coulombKernel (xy.1-xy.2)*(‖f xy.1‖^2*‖g xy.2‖^2)) := by + have h := compact_coulomb_cross_integrable f g f g hf hg hf hg hfc hgc + simp only [complex_star_mul_self, ← Complex.ofReal_mul] at h + exact h.re + +noncomputable def slaterDensity {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) (x : Space) : ℝ := + ∑ a, ∑ s : Fin 2, ‖v a x s‖^2 + +lemma slaterState_pair_upper {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) : + pairEnergy (slaterState v hv hC) ≤ (1/2:ℝ)* + ∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(slaterDensity v xy.1*slaterDensity v xy.2) := by + have hI (a b : Fin n) (s t : Fin 2) := compact_coulomb_direct_integrable + (fun x => v a x s) (fun x => v b x t) (hv a s).continuous (hv b t).continuous (hC a s) (hC b t) + have H := slaterState_pair_upper_flat v hv hC ho + have he (a b : Fin n) : (∫ xy : (Fin 2 × (Fin 3 → ℝ)) × (Fin 2 × (Fin 3 → ℝ)), + coulombKernel (WithLp.toLp 2 xy.1.2-WithLp.toLp 2 xy.2.2) * + (‖flatSpinOrbital (v a) xy.1‖^2*‖flatSpinOrbital (v b) xy.2‖^2) + ∂(spinSpaceMeasure.prod spinSpaceMeasure)) = + ∑ s, ∑ t, ∫ xy : Space × Space, + coulombKernel (xy.1-xy.2)*(‖v a xy.1 s‖^2*‖v b xy.2 t‖^2) := + spinPair_integral (fun s t xy => coulombKernel (xy.1-xy.2)*(‖v a xy.1 s‖^2*‖v b xy.2 t‖^2)) + (hI a b) + simp_rw [he] at H + suffices heq : (∫ xy : Space × Space, coulombKernel (xy.1-xy.2)* + (slaterDensity v xy.1*slaterDensity v xy.2)) = + ∑ a, ∑ b, ∑ s, ∑ t, ∫ xy : Space × Space, + coulombKernel (xy.1-xy.2)*(‖v a xy.1 s‖^2*‖v b xy.2 t‖^2) by rwa [heq] + have hp (xy : Space × Space) : coulombKernel (xy.1-xy.2)* + (slaterDensity v xy.1*slaterDensity v xy.2) = + ∑ a, ∑ b, ∑ s, ∑ t, coulombKernel (xy.1-xy.2)*(‖v a xy.1 s‖^2*‖v b xy.2 t‖^2) := by + unfold slaterDensity + simp only [Finset.sum_mul, Finset.mul_sum] + conv_lhs => arg 2; ext b; rw [Finset.sum_comm] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + rw [Finset.sum_comm] + simp_rw [hp] + rw [integral_finsetSum _ (fun a _ => integrable_finsetSum _ + (fun b _ => integrable_finsetSum _ (fun s _ => integrable_finsetSum _ (fun t _ => hI a b s t))))] + apply Finset.sum_congr rfl + intro a _ + rw [integral_finsetSum _ (fun b _ => integrable_finsetSum _ + (fun s _ => integrable_finsetSum _ (fun t _ => hI a b s t)))] + apply Finset.sum_congr rfl + intro b _ + rw [integral_finsetSum _ (fun s _ => integrable_finsetSum _ (fun t _ => hI a b s t))] + apply Finset.sum_congr rfl + intro s _ + exact integral_finsetSum _ (fun t _ => hI a b s t) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinCubeEquiv.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinCubeEquiv.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9a2ebadd77c5deea9876b5e3f113e16ae9b855c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinCubeEquiv.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.CubeLabelEquiv + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +namespace Coulomb +lemma measurePreserving_const_uncurry {I J A : Type*} [Fintype I] [Fintype J] + [MeasurableSpace A] (μ : Measure A) [SigmaFinite μ] : + MeasurePreserving (MeasurableEquiv.curry I J A).symm + (Measure.pi fun _ : I => Measure.pi fun _ : J => μ) + (Measure.pi fun _ : I × J => μ) := by + refine ⟨(MeasurableEquiv.curry I J A).symm.measurable, ?_⟩ + symm + apply Measure.pi_eq + intro s hs + rw [(MeasurableEquiv.curry I J A).symm.map_apply] + have he : (MeasurableEquiv.curry I J A).symm ⁻¹' univ.pi s = + univ.pi (fun i => univ.pi (fun j => s (i,j))) := by + ext x + simp only [mem_preimage, mem_univ_pi, MeasurableEquiv.curry_symm_apply] + exact ⟨fun h i j => h (i,j), fun h p => h p.1 p.2⟩ + rw [he, Measure.pi_pi] + simp only [Measure.pi_pi, Fintype.prod_prod_type] + +lemma measure_pi_count {I A : Type*} [Fintype I] [Fintype A] + [MeasurableSpace A] [MeasurableSingletonClass A] : + (Measure.pi fun _ : I => (Measure.count : Measure A)) = Measure.count := by + apply Measure.ext_of_singleton + intro x + simp only [Measure.pi_singleton, Measure.count_singleton, Finset.prod_const_one] + +noncomputable def spinCubeEquiv (n : ℕ) : + (Fin n → (Fin 2 × (Fin 3 → ℝ))) ≃ᵐ (Spins n × ((Fin n × Fin 3) → ℝ)) := + (MeasurableEquiv.arrowProdEquivProdArrow (Fin 2) (Fin 3 → ℝ) (Fin n)).trans + ((MeasurableEquiv.refl (Spins n)).prodCongr (MeasurableEquiv.curry (Fin n) (Fin 3) ℝ).symm) + +lemma spinCubeEquiv_measurePreserving (n : ℕ) (b : ℝ) : + MeasurePreserving (spinCubeEquiv n) (Measure.pi fun _ : Fin n => spinCubeMeasure b) + (Measure.count.prod (finiteCubeMeasure b (Fin n × Fin 3))) := by + have h1 := measurePreserving_arrowProdEquivProdArrow (Fin 2) (Fin 3 → ℝ) (Fin n) + (fun _ => Measure.count) (fun _ => cubeMeasure b 3) + rw [measure_pi_count] at h1 + have h2 := (MeasurePreserving.id (Measure.count : Measure (Spins n))).prod + (measurePreserving_const_uncurry (I := Fin n) (J := Fin 3) (volume.restrict (Ioc 0 b))) + exact h2.comp h1 + +instance finiteCubeMeasure_isFinite (b : ℝ) (I : Type*) [Fintype I] : + IsFiniteMeasure (finiteCubeMeasure b I) := by + unfold finiteCubeMeasure + infer_instance +instance spinCubeMeasure_isFinite (b : ℝ) : IsFiniteMeasure (spinCubeMeasure b) := by + unfold spinCubeMeasure + infer_instance + +noncomputable def cubeState {n : ℕ} (ψ : H1Vector n) + (z : Fin n → (Fin 2 × (Fin 3 → ℝ))) : ℂ := + ψ.value (fun i => (z i).1) (WithLp.toLp 2 (fun ij => (z ij.1).2 ij.2)) + +lemma H1Vector.spinCube_memLp {n : ℕ} (ψ : H1Vector n) (b : ℝ) : + MemLp (fun sx : Spins n × ((Fin n × Fin 3) → ℝ) => + ψ.value sx.1 (WithLp.toLp 2 sx.2)) 2 + (Measure.count.prod (finiteCubeMeasure b (Fin n × Fin 3))) := by + classical + have hi (s : Spins n) : MemLp (fun t : Spins n => if t = s then (1:ℂ) else 0) 2 Measure.count := by + apply MemLp.of_bound (by fun_prop) 1 + exact ae_of_all _ (fun t => by split_ifs <;> norm_num) + have H := memLp_finsetSum Finset.univ (fun (s : Spins n) _ => + tensorPair_memLp (hi s) (ψ.cube_memLp b s)) + convert H using 1 + funext sx + simp only [ite_mul, one_mul, zero_mul] + simp + +lemma H1Vector.cubeState_memLp {n : ℕ} (ψ : H1Vector n) (b : ℝ) : + MemLp (cubeState ψ) 2 (Measure.pi fun _ : Fin n => spinCubeMeasure b) := + (ψ.spinCube_memLp b).comp_measurePreserving (spinCubeEquiv_measurePreserving n b) + +lemma cubeState_mass {n : ℕ} (ψ : H1Vector n) (b : ℝ) : + (∫ z, ‖cubeState ψ z‖^2 ∂(Measure.pi fun _ : Fin n => spinCubeMeasure b)) = cubeMass ψ b := by + have H := (spinCubeEquiv_measurePreserving n b).integral_comp' + (fun sx => ‖ψ.value sx.1 (WithLp.toLp 2 sx.2)‖^2) + change (∫ z, ‖cubeState ψ z‖^2 ∂(Measure.pi fun _ : Fin n => spinCubeMeasure b)) = _ at H + rw [H, integral_prod _ ((ψ.spinCube_memLp b).norm.integrable_sq), integral_count] + rfl + +lemma cubeState_antisymmetric {n : ℕ} {ψ : H1Vector n} (hψ : Antisymmetric ψ) (b : ℝ) : + ProductAntisymmetric (μ := spinCubeMeasure b) (cubeState ψ) := by + intro p + have hs (s : Spins n) : ∀ᵐ x ∂(finiteCubeMeasure b (Fin n × Fin 3)), + ψ.value (s ∘ p) (permute p (WithLp.toLp 2 x)) = + ((p.sign : ℤ) : ℂ) * ψ.value s (WithLp.toLp 2 x) := + ((PiLp.volume_preserving_toLp (Fin n × Fin 3)).quasiMeasurePreserving.ae (hψ p s)).filter_mono + (ae_mono (finiteCubeMeasure_le_volume b)) + have hall := (ae_all_iff.mpr hs) + have hp := (Measure.quasiMeasurePreserving_snd (μ := (Measure.count : Measure (Spins n)))).ae hall + have ht := (spinCubeEquiv_measurePreserving n b).quasiMeasurePreserving.ae hp + filter_upwards [ht] with z hz + exact hz (fun i => (z i).1) + +lemma spinCube_tensor_delta {n : ℕ} (b : ℝ) (a : Fin n → SpinMode) + (sx : Spins n × ((Fin n × Fin 3) → ℝ)) : + (∏ i, spinCubeMode b (a i) ((spinCubeEquiv n).symm sx i)) = + (if sx.1 = (cubeLabelEquiv n a).1 then (1:ℂ) else 0) * + finiteCubeMode b (cubeLabelEquiv n a).2 sx.2 := by + classical + change (∏ i, (if sx.1 i = (a i).1 then (1:ℂ) else 0) * + ∏ j, neumannMode b ((a i).2 j) (sx.2 (i,j))) = _ + rw [Finset.prod_mul_distrib] + have he : (∏ i, if sx.1 i = (a i).1 then (1:ℂ) else 0) = + if sx.1 = (cubeLabelEquiv n a).1 then 1 else 0 := by + by_cases h : sx.1 = (cubeLabelEquiv n a).1 + · simp only [h, cubeLabelEquiv, Equiv.coe_fn_mk, ite_true, Finset.prod_const_one] + · rw [ite_eq_right h] + obtain ⟨i,hi⟩ := Function.ne_iff.mp h + apply Finset.prod_eq_zero (Finset.mem_univ i) + exact ite_eq_right hi + rw [he] + congr 1 + simp only [finiteCubeMode, Fintype.prod_prod_type, cubeLabelEquiv, Equiv.coe_fn_mk] + +lemma cubeState_coefficient {n : ℕ} (ψ : H1Vector n) (b : ℝ) (a : Fin n → SpinMode) : + scalarCoefficient (μ := spinCubeMeasure b) (cubeState ψ) (spinCubeMode b) a = + cubeFermionCoefficient ψ b a := by + classical + unfold scalarCoefficient + rw [← (spinCubeEquiv_measurePreserving n b).symm.integral_comp'] + simp only [spinCube_tensor_delta] + have he (sx : Spins n × ((Fin n × Fin 3) → ℝ)) : + star ((if sx.1 = (cubeLabelEquiv n a).1 then (1:ℂ) else 0) * + finiteCubeMode b (cubeLabelEquiv n a).2 sx.2) * cubeState ψ ((spinCubeEquiv n).symm sx) = + (if sx.1 = (cubeLabelEquiv n a).1 then (1:ℂ) else 0) * + (star (finiteCubeMode b (cubeLabelEquiv n a).2 sx.2) * + ψ.value (cubeLabelEquiv n a).1 (WithLp.toLp 2 sx.2)) := by + by_cases h : sx.1 = (cubeLabelEquiv n a).1 + · simp only [ite_eq_left h, one_mul] + change star _ * ψ.value sx.1 (WithLp.toLp 2 sx.2) = _ + rw [h] + · simp only [ite_eq_right h, zero_mul, star_zero] + simp_rw [he] + rw [integral_prod_mul (fun s : Spins n => if s = (cubeLabelEquiv n a).1 then (1:ℂ) else 0) + (fun x => star (finiteCubeMode b (cubeLabelEquiv n a).2 x) * + ψ.value (cubeLabelEquiv n a).1 (WithLp.toLp 2 x)), integral_count] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true, one_mul] + rfl + +end Coulomb + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinMode.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinMode.lean new file mode 100644 index 0000000000000000000000000000000000000000..21cc1164c16fcf3512bfeaf5a9688eebd8362fb5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SpinMode.lean @@ -0,0 +1,417 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.ComplexMollify + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +open scoped Classical +open scoped Classical +open Filter +open scoped Convolution +open ContinuousLinearMap + +abbrev SpinMode := Fin 2 × (Fin 3 → ℕ) + +theorem spin_lattice_count (s : Finset SpinMode) {r : ℝ} + (hr : 0 ≤ r) (hs : ∀ a ∈ s, latticeRadius a.2 ≤ r) : + (s.card : ℝ) ≤ (Real.pi / 3) * (r + Real.sqrt 3)^3 := by + classical + let t := s.image Prod.snd + have H := spin_two_lattice_count t hr (by + intro q hq + obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp hq + exact hs a ha) + have ht : s ⊆ (Finset.univ : Finset (Fin 2)) ×ˢ t := by + intro a ha + exact Finset.mem_product.mpr ⟨Finset.mem_univ _, Finset.mem_image.mpr ⟨a, ha, rfl⟩⟩ + have hc : s.card ≤ 2 * t.card := by simpa using Finset.card_le_card ht + have hcR : (s.card : ℝ) ≤ 2 * (t.card : ℝ) := by exact_mod_cast hc + exact hcR.trans H + +lemma latticeRadius_nonneg (q : Fin 3 → ℕ) : 0 ≤ latticeRadius q := norm_nonneg _ + +theorem ordered_lattice_radius_lower {n : ℕ} (a : Fin n → SpinMode) + (ha : Function.Injective a) (hm : Monotone (fun i => latticeRadius (a i).2)) + (i : Fin n) : + (3 * ((i.val + 1 : ℕ) : ℝ) / Real.pi) ^ (1/3 : ℝ) ≤ + latticeRadius (a i).2 + Real.sqrt 3 := by + classical + let s := (Finset.Iic i).image a + have hc : s.card = i.val + 1 := by + rw [Finset.card_image_of_injective _ ha] + exact Fin.card_Iic i + have h := spin_lattice_count s (latticeRadius_nonneg _) (by + intro q hq + obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hq + exact hm (Finset.mem_Iic.mp hj)) + rw [hc] at h + have hx : 0 ≤ 3 * ((i.val + 1 : ℕ) : ℝ) / Real.pi := by positivity + have hy : 0 ≤ latticeRadius (a i).2 + Real.sqrt 3 := + add_nonneg (latticeRadius_nonneg _) (Real.sqrt_nonneg _) + rw [show (1/3 : ℝ) = (3 : ℝ)⁻¹ by norm_num, + Real.rpow_inv_le_iff_of_pos hx hy (by norm_num)] + norm_num only [Real.rpow_ofNat] + apply (div_le_iff₀ Real.pi_pos).mpr + nlinarith + +lemma sum_two_thirds_lower (n : ℕ) : + (3/5 : ℝ) * (n : ℝ) ^ (5/3 : ℝ) ≤ + ∑ i ∈ Finset.range n, ((i+1 : ℕ) : ℝ) ^ (2/3 : ℝ) := by + have hm : MonotoneOn (fun x : ℝ => x ^ (2/3 : ℝ)) (Set.Icc 0 (0+n)) := by + intro x hx y _ hxy + exact Real.rpow_le_rpow hx.1 hxy (by norm_num) + have h := hm.integral_le_sum + rw [integral_rpow (Or.inl (by norm_num : (-1 : ℝ) < 2/3))] at h + norm_num at h ⊢ + convert h using 1 + ring + +lemma sum_one_third_upper (n : ℕ) : + (∑ i ∈ Finset.range n, ((i+1 : ℕ) : ℝ) ^ (1/3 : ℝ)) ≤ + (n : ℝ) ^ (4/3 : ℝ) := by + have H : (∑ i ∈ Finset.range n, ((i+1 : ℕ) : ℝ) ^ (1/3 : ℝ)) ≤ + ∑ _ ∈ Finset.range n, (n : ℝ) ^ (1/3 : ℝ) := by + apply Finset.sum_le_sum + intro i hi + apply Real.rpow_le_rpow (by positivity) _ (by norm_num) + exact_mod_cast (show i+1 ≤ n from Nat.succ_le_of_lt (Finset.mem_range.mp hi)) + simp only [Finset.sum_const, Finset.card_range, nsmul_eq_mul] at H + convert H using 1 + rw [show (4/3 : ℝ) = 1 + 1/3 by norm_num, + Real.rpow_add' (Nat.cast_nonneg n) (by norm_num : (1 : ℝ)+1/3 ≠ 0), Real.rpow_one] + +lemma square_lower_of_shift {r t c : ℝ} (_hr : 0 ≤ r) (ht : 0 ≤ t) (_hc : 0 ≤ c) + (h : t ≤ r+c) : t^2 - 2*c*t ≤ r^2 := by + by_cases htc : t ≤ c + · nlinarith [mul_nonneg (sub_nonneg.mpr htc) ht, sq_nonneg r] + · have h2 := pow_le_pow_left₀ (sub_nonneg.mpr (le_of_not_ge htc)) + (show t-c ≤ r by linarith) 2 + nlinarith [sq_nonneg c] + +lemma finite_sort_values {n : ℕ} (v : Fin n → ℝ) : + ∃ e : Equiv.Perm (Fin n), Monotone (fun i => v (e i)) := by + classical + let key : Fin n → ℝ ×ₗ Fin n := fun i => toLex (v i, i) + have hk : Function.Injective key := by + intro i j h + exact congrArg (fun z => (ofLex z).2) h + let s := Finset.univ.image key + have hs : s.card = n := by + simp only [s, Finset.card_image_of_injective _ hk, Finset.card_univ, Fintype.card_fin] + let b := s.orderEmbOfFin hs + have hb (i : Fin n) : key (ofLex (b i)).2 = b i := by + have hi := s.orderEmbOfFin_mem hs i + obtain ⟨j, _, hj⟩ := Finset.mem_image.mp hi + rw [← hj] + rfl + let e : Fin n → Fin n := fun i => (ofLex (b i)).2 + have he : Function.Injective e := by + intro i j hij + apply b.injective + rw [← hb i, ← hb j] + exact congrArg key hij + let E : Equiv.Perm (Fin n) := Equiv.ofBijective e + ⟨he, (Finite.injective_iff_surjective).mp he⟩ + refine ⟨E, ?_⟩ + intro i j hij + have H := b.monotone hij + have hi : v (E i) = (ofLex (b i)).1 := by + exact congrArg (fun z => (ofLex z).1) (hb i) + have hj : v (E j) = (ofLex (b j)).1 := by + exact congrArg (fun z => (ofLex z).1) (hb j) + change v (E i) ≤ v (E j) + rw [hi, hj] + rcases Prod.Lex.le_iff.mp H with h | ⟨h, _⟩ + · exact h.le + · exact h.le + +noncomputable def neumannLeading : ℝ := (3/5 : ℝ) * (3/Real.pi) ^ (2/3 : ℝ) +noncomputable def neumannBoundary : ℝ := 2 * Real.sqrt 3 * (3/Real.pi) ^ (1/3 : ℝ) + +theorem neumann_radii_sum_lower {n : ℕ} (a : Fin n → SpinMode) + (ha : Function.Injective a) : + neumannLeading * (n : ℝ) ^ (5/3 : ℝ) - + neumannBoundary * (n : ℝ) ^ (4/3 : ℝ) ≤ + ∑ i, (latticeRadius (a i).2)^2 := by + classical + obtain ⟨e, he⟩ := finite_sort_values (fun i => latticeRadius (a i).2) + let A : ℝ := (3/Real.pi) ^ (1/3 : ℝ) + have hA : 0 ≤ A := Real.rpow_nonneg (by positivity) _ + have hAi : A^2 = (3/Real.pi) ^ (2/3 : ℝ) := by + dsimp only [A] + rw [← Real.rpow_natCast, ← Real.rpow_mul (by positivity)] + norm_num + have hl (i : Fin n) : + A^2 * (((i.val+1 : ℕ) : ℝ) ^ (2/3 : ℝ)) - + (2 * Real.sqrt 3 * A) * (((i.val+1 : ℕ) : ℝ) ^ (1/3 : ℝ)) ≤ + (latticeRadius (a (e i)).2)^2 := by + have h := ordered_lattice_radius_lower (fun i => a (e i)) (ha.comp e.injective) he i + have hx : (3 * ((i.val+1 : ℕ) : ℝ) / Real.pi) ^ (1/3 : ℝ) = + A * (((i.val+1 : ℕ) : ℝ) ^ (1/3 : ℝ)) := by + rw [show 3 * ((i.val+1 : ℕ) : ℝ) / Real.pi = + (3/Real.pi) * ((i.val+1 : ℕ) : ℝ) by ring, + Real.mul_rpow (by positivity) (by positivity)] + rw [hx] at h + have H := square_lower_of_shift (latticeRadius_nonneg _) (mul_nonneg hA (Real.rpow_nonneg (by positivity) _)) + (Real.sqrt_nonneg 3) h + rw [mul_pow] at H + have hp : ((((i.val+1 : ℕ) : ℝ) ^ (1/3 : ℝ)))^2 = + (((i.val+1 : ℕ) : ℝ) ^ (2/3 : ℝ)) := by + rw [← Real.rpow_natCast, ← Real.rpow_mul (by positivity)] + norm_num + rw [hp] at H + nlinarith + have H := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hl i) + simp only [Finset.sum_sub_distrib, ← Finset.mul_sum] at H + have h2 : (3/5 : ℝ) * (n : ℝ) ^ (5/3 : ℝ) ≤ + ∑ i : Fin n, (((i.val+1 : ℕ) : ℝ) ^ (2/3 : ℝ)) := by + simpa only [Finset.sum_range] using sum_two_thirds_lower n + have h1 : (∑ i : Fin n, (((i.val+1 : ℕ) : ℝ) ^ (1/3 : ℝ))) ≤ + (n : ℝ) ^ (4/3 : ℝ) := by + simpa only [Finset.sum_range] using sum_one_third_upper n + have H2 := mul_le_mul_of_nonneg_left h2 (sq_nonneg A) + have H1 := mul_le_mul_of_nonneg_left h1 + (show 0 ≤ 2 * Real.sqrt 3 * A by positivity) + have hs : (∑ i, (latticeRadius (a (e i)).2)^2) = + ∑ i, (latticeRadius (a i).2)^2 := Equiv.sum_comp e (fun i => (latticeRadius (a i).2)^2) + rw [hs] at H + unfold neumannLeading neumannBoundary + rw [← hAi] + change (3/5 : ℝ) * A^2 * (n : ℝ) ^ (5/3 : ℝ) - + (2 * Real.sqrt 3 * A) * (n : ℝ) ^ (4/3 : ℝ) ≤ _ + nlinarith + +noncomputable def thomasFermiCoefficient : ℝ := + (3/10 : ℝ) * (3*Real.pi^2) ^ (2/3 : ℝ) + +lemma neumann_coefficient_exact : + (Real.pi^2/2) * neumannLeading = thomasFermiCoefficient := by + unfold neumannLeading thomasFermiCoefficient + rw [Real.div_rpow (by norm_num) Real.pi_pos.le, + Real.mul_rpow (by norm_num) (sq_nonneg _)] + have hp : (Real.pi^2) ^ (2/3 : ℝ) = Real.pi^2 / Real.pi ^ (2/3 : ℝ) := by + rw [← Real.rpow_natCast_mul Real.pi_pos.le 2 (2/3 : ℝ)] + rw [← Real.rpow_two, ← Real.rpow_sub Real.pi_pos] + norm_num + rw [hp] + ring + +theorem neumann_kinetic_sum_lower {n : ℕ} (a : Fin n → SpinMode) + (ha : Function.Injective a) {b : ℝ} (_hb : 0 < b) : + (b⁻¹)^2 * (thomasFermiCoefficient * (n : ℝ) ^ (5/3 : ℝ) - + ((Real.pi^2/2)*neumannBoundary) * (n : ℝ) ^ (4/3 : ℝ)) ≤ + ∑ i, (Real.pi^2/(2*b^2)) * (latticeRadius (a i).2)^2 := by + have H := mul_le_mul_of_nonneg_left (neumann_radii_sum_lower a ha) + (show 0 ≤ Real.pi^2/(2*b^2) by positivity) + rw [← Finset.mul_sum] + have he : (b⁻¹)^2 * (thomasFermiCoefficient * (n : ℝ) ^ (5/3 : ℝ) - + ((Real.pi^2/2)*neumannBoundary) * (n : ℝ) ^ (4/3 : ℝ)) = + (Real.pi^2/(2*b^2)) * (neumannLeading * (n : ℝ) ^ (5/3 : ℝ) - + neumannBoundary * (n : ℝ) ^ (4/3 : ℝ)) := by + rw [← neumann_coefficient_exact] + field_simp + rw [he] + exact H + +section IndexBridge +variable {I J : Type*} [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] + +noncomputable def finiteCubeMeasure (b : ℝ) (I : Type*) [Fintype I] : Measure (I → ℝ) := + Measure.pi (fun _ => volume.restrict (Ioc 0 b)) + +noncomputable def finiteCubeMode (b : ℝ) (q : I → ℕ) (x : I → ℝ) : ℂ := + ∏ i, neumannMode b (q i) (x i) + +noncomputable def reindexCube (e : I ≃ J) : (I → ℝ) ≃ᵐ (J → ℝ) := + MeasurableEquiv.piCongrLeft (fun _ : J => ℝ) e + +omit [Fintype I] [Fintype J] [DecidableEq I] [DecidableEq J] in +lemma reindexCube_apply (e : I ≃ J) (x : I → ℝ) (j : J) : + reindexCube e x j = x (e.symm j) := by + simpa only [reindexCube, e.apply_symm_apply] using + MeasurableEquiv.piCongrLeft_apply_apply (β := fun _ : J => ℝ) e x (e.symm j) + +omit [DecidableEq I] [DecidableEq J] in +lemma reindexCube_measurePreserving (b : ℝ) (e : I ≃ J) : + MeasurePreserving (reindexCube e) (finiteCubeMeasure b I) (finiteCubeMeasure b J) := by + exact measurePreserving_piCongrLeft (fun _ : J => volume.restrict (Ioc 0 b)) e + +omit [DecidableEq I] [DecidableEq J] in +lemma finiteCubeMode_reindex (b : ℝ) (e : I ≃ J) (q : I → ℕ) (x : I → ℝ) : + finiteCubeMode b (q ∘ e.symm) (reindexCube e x) = finiteCubeMode b q x := by + simpa only [finiteCubeMode, Function.comp_apply, reindexCube_apply] using + Equiv.prod_comp e.symm (fun i => neumannMode b (q i) (x i)) + +omit [DecidableEq I] [DecidableEq J] in +lemma euclidean_reindex_toLp (e : I ≃ J) (x : J → ℝ) : + LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm (WithLp.toLp 2 x) = + WithLp.toLp 2 (reindexCube e.symm x) := by + ext i + simp [LinearIsometryEquiv.piLpCongrLeft_apply, Equiv.piCongrLeft', reindexCube_apply] + +omit [DecidableEq I] [DecidableEq J] in +lemma euclidean_reindex_toLp_cancel (e : I ≃ J) (x : I → ℝ) : + LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm (WithLp.toLp 2 (reindexCube e x)) = + WithLp.toLp 2 x := by + ext i + simp [LinearIsometryEquiv.piLpCongrLeft_apply, Equiv.piCongrLeft', reindexCube_apply] + +omit [DecidableEq I] [DecidableEq J] in +lemma finiteCube_integral_reindex (b : ℝ) (e : I ≃ J) + {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : EuclideanSpace ℝ I → E) : + (∫ y, f (LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm (WithLp.toLp 2 y)) + ∂(finiteCubeMeasure b J)) = + ∫ x, f (WithLp.toLp 2 x) ∂(finiteCubeMeasure b I) := by + rw [← (reindexCube_measurePreserving b e).integral_comp' + (fun y => f (LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm (WithLp.toLp 2 y)))] + apply integral_congr_ae + exact Eventually.of_forall (fun x => by dsimp only; rw [euclidean_reindex_toLp_cancel]) + +omit [DecidableEq I] [DecidableEq J] in +lemma finiteCube_coefficient_reindex (b : ℝ) (e : I ≃ J) + (u : EuclideanSpace ℝ I → ℂ) (q : I → ℕ) : + (∫ y, star (finiteCubeMode b (q ∘ e.symm) y) * + u (LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm (WithLp.toLp 2 y)) + ∂(finiteCubeMeasure b J)) = + ∫ x, star (finiteCubeMode b q x) * u (WithLp.toLp 2 x) + ∂(finiteCubeMeasure b I) := by + rw [← (reindexCube_measurePreserving b e).integral_comp' + (fun y => star (finiteCubeMode b (q ∘ e.symm) y) * + u (LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm (WithLp.toLp 2 y)))] + apply integral_congr_ae + exact Eventually.of_forall (fun x => by dsimp only; rw [finiteCubeMode_reindex, euclidean_reindex_toLp_cancel]) + +lemma euclidean_weak_reindex (e : I ≃ J) {u : EuclideanSpace ℝ I → ℂ} + {g : I → EuclideanSpace ℝ I → ℂ} + (hw : ∀ i (φ : EuclideanSpace ℝ I → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * (fderiv ℝ φ x (EuclideanSpace.single i 1) : ℂ)) = + -(∫ x, g i x * (φ x : ℂ))) (j : J) + (φ : EuclideanSpace ℝ J → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) + (hφc : HasCompactSupport φ) : + (∫ x, u (LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm x) * + (fderiv ℝ φ x (EuclideanSpace.single j 1) : ℂ)) = + -(∫ x, g (e.symm j) (LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm x) * (φ x : ℂ)) := by + classical + let L := LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e + have hcomp : ContDiff ℝ (⊤ : ℕ∞) (φ ∘ L) := + hφ.comp L.contDiff + have hc : HasCompactSupport (φ ∘ L) := hφc.comp_homeomorph L.toHomeomorph + have H := hw (e.symm j) (φ ∘ L) hcomp hc + have hd (x : EuclideanSpace ℝ I) : + fderiv ℝ (φ ∘ L) x (EuclideanSpace.single (e.symm j) 1) = + fderiv ℝ φ (L x) (EuclideanSpace.single j 1) := by + rw [fderiv_comp x (hφ.differentiable (by simp) _) L.differentiableAt] + rw [L.fderiv] + change fderiv ℝ φ (L x) (L (EuclideanSpace.single (e.symm j) 1)) = _ + have hs : L (EuclideanSpace.single (e.symm j) 1) = EuclideanSpace.single j 1 := by + simp [L, EuclideanSpace.single, LinearIsometryEquiv.piLpCongrLeft_single] + rw [hs] + simp_rw [hd] at H + have hp : MeasurePreserving L.symm.toHomeomorph.toMeasurableEquiv volume volume := + L.symm.measurePreserving + rw [← hp.integral_comp' (fun x => u x * (fderiv ℝ φ (L x) (EuclideanSpace.single j 1) : ℂ)), + ← hp.integral_comp' (fun x => g (e.symm j) x * ((φ ∘ L) x : ℂ))] at H + change (∫ x, u (L.symm x) * + (fderiv ℝ φ (L (L.symm x)) (EuclideanSpace.single j 1) : ℂ)) = + -(∫ x, g (e.symm j) (L.symm x) * (φ (L (L.symm x)) : ℂ)) at H + simp_rw [L.apply_symm_apply] at H + simpa only [L, LinearIsometryEquiv.piLpCongrLeft_symm] using H + +theorem finiteCube_weak_spectral_lower {d : ℕ} (e : I ≃ Fin (d+1)) + {b : ℝ} (hb : 0 < b) + {u : EuclideanSpace ℝ I → ℂ} {g : I → EuclideanSpace ℝ I → ℂ} + (hu : MemLp u 2) (hg : ∀ i, MemLp (g i) 2) + (hw : ∀ i (φ : EuclideanSpace ℝ I → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * (fderiv ℝ φ x (EuclideanSpace.single i 1) : ℂ)) = + -(∫ x, g i x * (φ x : ℂ))) (s : Finset (I → ℕ)) : + ∑ q ∈ s, ((∑ i, ((q i : ℝ) * Real.pi / b)^2) * + ‖∫ x, star (finiteCubeMode b q x) * u (WithLp.toLp 2 x) + ∂(finiteCubeMeasure b I)‖^2) ≤ + ∑ i, ∫ x, ‖g i (WithLp.toLp 2 x)‖^2 ∂(finiteCubeMeasure b I) := by + classical + let L := LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ e.symm + let p : (I → ℕ) → (Fin (d+1) → ℕ) := fun q => q ∘ e.symm + have hp : Function.Injective p := by + intro q r h + funext i + simpa only [p, Function.comp_apply, e.symm_apply_apply] using congrFun h (e i) + have H := cube_weak_spectral_lower hb + (hu.comp_measurePreserving L.measurePreserving) + (fun j => (hg (e.symm j)).comp_measurePreserving L.measurePreserving) + (euclidean_weak_reindex e hw) (s.image p) + rw [Finset.sum_image hp.injOn] at H + have HC (q : I → ℕ) : + (∫ x, star (cubeMode b (p q) x) * (u ∘ L) (WithLp.toLp 2 x) + ∂(cubeMeasure b (d+1))) = + ∫ x, star (finiteCubeMode b q x) * u (WithLp.toLp 2 x) + ∂(finiteCubeMeasure b I) := finiteCube_coefficient_reindex b e u q + simp_rw [HC] at H + have HS (q : I → ℕ) : + (∑ j : Fin (d+1), (((p q) j : ℝ) * Real.pi / b)^2) = + ∑ i, ((q i : ℝ) * Real.pi / b)^2 := + Equiv.sum_comp e.symm (fun i => ((q i : ℝ) * Real.pi / b)^2) + simp_rw [HS] at H + have HG (j : Fin (d+1)) : + (∫ x, ‖((g (e.symm j)) ∘ L) (WithLp.toLp 2 x)‖^2 ∂(cubeMeasure b (d+1))) = + ∫ x, ‖g (e.symm j) (WithLp.toLp 2 x)‖^2 ∂(finiteCubeMeasure b I) := + finiteCube_integral_reindex b e (fun x => ‖g (e.symm j) x‖^2) + simp_rw [HG] at H + rw [Equiv.sum_comp e.symm (fun i => ∫ x, ‖g i (WithLp.toLp 2 x)‖^2 ∂(finiteCubeMeasure b I))] at H + exact H + +end IndexBridge + +noncomputable def spinDelta (s t : Fin 2) : ℂ := if t = s then 1 else 0 + +lemma spinDelta_memLp (s : Fin 2) : MemLp (spinDelta s) 2 Measure.count := by + apply MemLp.of_bound (by fun_prop) 1 + exact ae_of_all _ (fun t => by simp [spinDelta]; split_ifs <;> norm_num) + +lemma spinDelta_inner (s t : Fin 2) : + (∫ q, star (spinDelta s q) * spinDelta t q ∂Measure.count) = + if s = t then (1 : ℂ) else 0 := by + classical + simp [integral_count, spinDelta, eq_comm] + +lemma spinDelta_complete : CompleteOrbitals Measure.count spinDelta := by + intro f _ hz + apply ae_of_all + intro s + have H := hz s + simpa [integral_count, spinDelta] using H + +lemma cubeMode_complete {b : ℝ} (hb : 0 < b) (d : ℕ) : + CompleteOrbitals (cubeMeasure b d) (cubeMode b) := + completeOrbitals_finPi (neumannMode b) (neumannMode_memLp b) (neumannModes_complete hb) d + +noncomputable def spinCubeMeasure (b : ℝ) : Measure (Fin 2 × (Fin 3 → ℝ)) := + Measure.count.prod (cubeMeasure b 3) + +noncomputable def spinCubeMode (b : ℝ) (a : SpinMode) (x : Fin 2 × (Fin 3 → ℝ)) : ℂ := + spinDelta a.1 x.1 * cubeMode b a.2 x.2 + +lemma cubeMode_memLp (b : ℝ) {d : ℕ} (q : Fin d → ℕ) : + MemLp (cubeMode b q) 2 (cubeMeasure b d) := + scalarTensor_memLp (neumannMode b) (neumannMode_memLp b) q + +lemma spinCubeMode_memLp (b : ℝ) (a : SpinMode) : + MemLp (spinCubeMode b a) 2 (spinCubeMeasure b) := + tensorPair_memLp (spinDelta_memLp a.1) (cubeMode_memLp b a.2) + +lemma spinCubeMode_complete {b : ℝ} (hb : 0 < b) : + CompleteOrbitals (spinCubeMeasure b) (spinCubeMode b) := + completeOrbitals_tensorPair (fun q => cubeMode_memLp b q) spinDelta_memLp + (cubeMode_complete hb 3) spinDelta_complete + +end Coulomb +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SumSpinDuplicate.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SumSpinDuplicate.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd088250c2cf390e714b95e2ebff272dbc568f42 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SumSpinDuplicate.lean @@ -0,0 +1,201 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.SpectralTheory.FermiPacketSpectralTrace +import OAI.Analysis.CoulombRadii.Packets.PacketIndex + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +namespace Coulomb +lemma hasSum_spin_duplicate {ι : Type*} {f : ι → ℝ} {a : ℝ} + (hf : ∀ i, 0 ≤ f i) (hs : HasSum f a) : + HasSum (fun i : ι × Fin 2 => f i.1) (2*a) := by + have hsum : Summable (fun i : ι × Fin 2 => f i.1) := by + apply (summable_prod_of_nonneg (fun i => hf i.1)).mpr + refine ⟨fun _ => (hasSum_fintype _).summable, ?_⟩ + simpa only [tsum_fintype,Fin.sum_univ_two,← two_mul] using hs.summable.mul_left 2 + apply hsum.hasSum_iff.mpr + rw [hsum.tsum_prod] + simp only [tsum_fintype,Fin.sum_univ_two,← two_mul] + rw [tsum_mul_left,hs.tsum_eq] + +lemma packetBasis_eigen_nonneg (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) + [IsFiniteMeasure μ] (i : packetIndex g μ) : 0 ≤ i.1.re := + compactSpectralBasis_eigen_nonneg _ (packetFrame_compact g μ) (packetFrame_positive g μ) i + +lemma packetBasis_eigen_le_one (g : 𝓢(Space,ℂ)) (hg : (∫ x : Space, ‖g x‖^2) = 1) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] (hμ : μ ≤ volume.prod volume) + (i : packetIndex g μ) : i.1.re ≤ 1 := + compactSpectralBasis_eigen_le_one _ (packetFrame_compact g μ) (packetFrame_positive g μ) + (packetFrame_complement_positive g hg μ hμ) i + +lemma packet_positive_hasSum {g : 𝓢(Space,ℂ)} {μ : Measure (Space × Space)} + [IsFiniteMeasure μ] (f : packetIndex g μ → ℝ) {a : ℝ} + (hs : HasSum (fun i => i.1.re*f i) a) : + HasSum (fun i : positivePacketIndex g μ => i.val.1.re*f i.val) a := by + apply (hasSum_subtype_iff_of_support_subset (s := {i : packetIndex g μ | 0 < i.1.re}) ?_).mpr hs + intro i hi + change 0 < i.1.re + apply lt_of_le_of_ne (packetBasis_eigen_nonneg g μ i) + intro he + exact hi (by simp only [← he,zero_mul]) + +lemma packetPositive_density (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) [IsFiniteMeasure μ] + (F : positivePacketIndex g μ → Space → ℂ) + (he : ∀ i, (packetBasis g μ i.val : Space → ℂ) =ᵐ[volume] F i) : + ∀ᵐ x ∂volume, HasSum + (fun i : positivePacketIndex g μ × Fin 2 => i.1.val.1.re * ∑ s, ‖spinOrbital F i x s‖^2) + (2*frameDensity (packetState_toL2_memLp g μ) x) := by + let b := packetBasis g μ + have hs : Summable (fun i : packetIndex g μ => i.1.re*‖b i‖^2) := by + let : Fact ((2 : ℝ≥0∞) ≠ ⊤) := ⟨by simp⟩ + have hnorm (i : packetIndex g μ) : ‖b i‖ = 1 := (packetBasis g μ).orthonormal.1 i + simp only [hnorm,one_pow,mul_one] + simpa only [packetIndex,packetFrame] using + (frameOperator_spectral_hasSum (packetState_toL2_memLp g μ)).summable + have h := l2_weighted_density_integrable b (fun i => i.1.re) + (packetBasis_eigen_nonneg g μ) hs + filter_upwards [h.2,ae_all_iff.mpr he] with x hx heq + have hp := packet_positive_hasSum (g := g) (μ := μ) (fun i => ‖b i x‖^2) hx.hasSum + have hp' : HasSum (fun i : positivePacketIndex g μ => i.val.1.re*‖F i x‖^2) + (frameDensity (packetState_toL2_memLp g μ) x) := by + convert hp using 1 + · ext i + rw [heq i] + · rfl + simpa only [spinOrbital_density] using hasSum_spin_duplicate + (fun i => mul_nonneg i.property.le (sq_nonneg _)) hp' + +lemma packetPositive_directional_energy (g : 𝓢(Space,ℝ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] + (hp : MemLp (fun yp : Space × Space => yp.2) 2 μ) (a : Space) + (i : positivePacketIndex (complexWindow g) μ) (F : Space → ℂ) + (hFs : ContDiff ℝ (⊤ : ℕ∞) F) (hFc : HasCompactSupport F) + (he : (packetBasis (complexWindow g) μ i.val : Space → ℂ) =ᵐ[volume] F) : + (∫ x : Space, ‖fderiv ℝ F x a‖^2) = + ∫ ξ : Space, (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (packetBasis (complexWindow g) μ i.val) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2 := by + obtain ⟨d,hd,heD⟩ := packetFrame_positive_eigen_weakDerivative g μ hp a i.val (ne_of_gt i.property) + exact (weak_directional_smooth_norm_sq a F hFs hFc he hd).trans heD + +lemma fermiPacket_positive_kinetic (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (ρ : Space → ℝ) (hρ : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hI : Integrable ρ) + (hT : Integrable (fun x => ρ x^(5/3:ℝ))) : + let μ := phaseMeasure (fermiRadius ρ) + letI := fermiMeasure_finite ρ hρ hm hI + ∀ (F : positivePacketIndex (complexWindow g) μ → Space → ℂ), + (∀ i, ContDiff ℝ (⊤ : ℕ∞) (F i)) → (∀ i, HasCompactSupport (F i)) → + (∀ i, (packetBasis (complexWindow g) μ i.val : Space → ℂ) =ᵐ[volume] F i) → + HasSum (fun i : positivePacketIndex (complexWindow g) μ × Fin 2 => + i.1.val.1.re * ∑ s, ∑ b : Fin 3, ∫ x : Space, + ‖fderiv ℝ (fun y => spinOrbital F i y s) x (EuclideanSpace.single b 1)‖^2) + (2*(thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2)) := by + dsimp only + let := fermiMeasure_finite ρ hρ hm hI + intro F hFs hFc he + have hp := fermiMeasure_momentum_memLp ρ hρ hm hT + have H := packet_positive_hasSum (g := complexWindow g) (μ := phaseMeasure (fermiRadius ρ)) + (fun i => ∑ b : Fin 3, ∫ ξ : Space, (2*Real.pi*inner ℝ ξ (EuclideanSpace.single b 1))^2 * + ‖(𝓕 (packetBasis (complexWindow g) (phaseMeasure (fermiRadius ρ)) i) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2) + (fermiPacket_kinetic_trace g hg ρ hρ hm hI hT) + have hedir (i : positivePacketIndex (complexWindow g) (phaseMeasure (fermiRadius ρ))) : + (∑ b : Fin 3, ∫ x : Space, ‖fderiv ℝ (F i) x (EuclideanSpace.single b 1)‖^2) = + ∑ b : Fin 3, ∫ ξ : Space, (2*Real.pi*inner ℝ ξ (EuclideanSpace.single b 1))^2 * + ‖(𝓕 (packetBasis (complexWindow g) (phaseMeasure (fermiRadius ρ)) i.val) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2 := by + apply Finset.sum_congr rfl + intro b _ + exact packetPositive_directional_energy g _ hp _ i (F i) (hFs i) (hFc i) (he i) + simp_rw [← hedir] at H + simpa only [spinOrbital_kinetic] using hasSum_spin_duplicate + (fun i => mul_nonneg i.property.le (Finset.sum_nonneg (fun b _ => integral_nonneg (fun x => sq_nonneg _)))) H +end Coulomb + +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SumSwapNonnegative.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SumSwapNonnegative.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f254205637c6932e53a5194b1ff5f37bb64d573 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/SumSwapNonnegative.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.HilbertBasisSumSqInner + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +namespace Coulomb +variable {X E F : Type*} [MeasurableSpace X] [NormedAddCommGroup E] + [InnerProductSpace ℂ E] [CompleteSpace E] [SeparableSpace E] + [NormedAddCommGroup F] [InnerProductSpace ℂ F] [CompleteSpace F] + +lemma hasSum_swap_nonnegative {ι κ : Type*} {f : ι × κ → ℝ} + (hf : ∀ i, 0 ≤ f i) {r : ι → ℝ} {c : κ → ℝ} {s : ℝ} + (hr : ∀ i, HasSum (fun j => f (i,j)) (r i)) + (hc : ∀ j, HasSum (fun i => f (i,j)) (c j)) (hs : HasSum r s) : HasSum c s := by + have her : (fun i => ∑' j, f (i,j)) = r := funext (fun i => (hr i).tsum_eq) + have hec : (fun j => ∑' i, f (i,j)) = c := funext (fun j => (hc j).tsum_eq) + have hf' : Summable f := (summable_prod_of_nonneg hf).mpr + ⟨fun i => (hr i).summable, by rw [her]; exact hs.summable⟩ + have hh := hf'.prod_symm.prod.hasSum + change HasSum (fun j => ∑' i, f (i,j)) (∑' j, ∑' i, f (i,j)) at hh + rw [hec] at hh + apply hh.summable.hasSum_iff.mpr + calc + (∑' j, c j) = ∑' j, ∑' i, f (i,j) := by rw [hec] + _ = ∑' i, ∑' j, f (i,j) := (Summable.tsum_comm (f := fun i j => f (i,j)) hf') + _ = s := by rw [her]; exact hs.tsum_eq + +omit [SeparableSpace E] in +lemma frameOperator_spectral_image_quadratic_hasSum + {μ : Measure X} {v : X → E} (hv : MemLp v 2 μ) (B : E →L[ℂ] F) (u : F) : + HasSum (fun i : Σ z, eigenspaceBasisSet (frameOperator μ v) z => + i.1.re * ‖inner ℂ u (B (compactSpectralBasis (frameOperator μ v) + (frameOperator_compact hv) (frameOperator_symmetric hv) i))‖^2) + (inner ℂ u (frameOperator μ (fun x => B (v x)) u)).re := by + have h := compactSpectralBasis_quadratic_hasSum (frameOperator μ v) + (frameOperator_compact hv) (frameOperator_symmetric hv) (B.adjoint u) + convert h using 1 + · ext i + simp only [ContinuousLinearMap.adjoint_inner_right, norm_inner_symm] + · have hB : MemLp (fun x => B (v x)) 2 μ := B.comp_memLp' hv + rw [frameOperator_quadratic hB, frameOperator_quadratic hv] + apply integral_congr_ae + filter_upwards [] with x + rw [ContinuousLinearMap.adjoint_inner_right] + +omit [SeparableSpace E] in +lemma frameOperator_spectral_image_hasSum {ι : Type*} [Countable ι] + {μ : Measure X} {v : X → E} (hv : MemLp v 2 μ) + (B : E →L[ℂ] F) (c : HilbertBasis ι ℂ F) : + HasSum (fun i : Σ z, eigenspaceBasisSet (frameOperator μ v) z => + i.1.re * ‖B (compactSpectralBasis (frameOperator μ v) (frameOperator_compact hv) + (frameOperator_symmetric hv) i)‖^2) (∫ x, ‖B (v x)‖^2 ∂μ) := by + let b := compactSpectralBasis (frameOperator μ v) (frameOperator_compact hv) + (frameOperator_symmetric hv) + let f : ι × (Σ z, eigenspaceBasisSet (frameOperator μ v) z) → ℝ := fun ji => + ji.2.1.re * ‖inner ℂ (c ji.1) (B (b ji.2))‖^2 + refine hasSum_swap_nonnegative (f := f) + (r := fun j => (inner ℂ (c j) (frameOperator μ (fun x => B (v x)) (c j))).re) ?_ ?_ ?_ ?_ + · intro ji + exact mul_nonneg (compactSpectralBasis_eigen_nonneg (frameOperator μ v) + (frameOperator_compact hv) (frameOperator_positive hv) ji.2) (sq_nonneg _) + · intro j + exact frameOperator_spectral_image_quadratic_hasSum hv B (c j) + · intro i + exact (hilbertBasis_hasSum_sq_inner c (B (b i))).mul_left i.1.re + · exact frameOperator_hasSum_diagonal (B.comp_memLp' hv) c +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TailClosure.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TailClosure.lean new file mode 100644 index 0000000000000000000000000000000000000000..6d150978b70d76c7f917982f88610da1c64656bf --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TailClosure.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.UniformScreening +import OAI.Analysis.CoulombRadii.Packets.TailMoment + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +theorem atomic_radial_tail_uniform : ∃ C : ℝ, 0 ≤ C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E δ : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E+δ → 0 ≤ δ → + ∀ {h : ℝ}, 0 < h → radialTailPotential ψ h ≤ C*screenMass δ h/h := by + obtain ⟨C,hC,H⟩ := atomic_annular_second_moment (α:=(1/2:ℝ)) (β:=4) (by norm_num) (by norm_num) + refine ⟨4*Real.sqrt C,by positivity,?_⟩ + intro J n S hatom ψ hψ hm E δ hE hstate hδ h hh + have hmean {r : ℝ} (hr : 0 < r) : + expectedPopulation ψ {z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r} ≤ Real.sqrt C*screenMass δ r := by + have hA : MeasurableSet {z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r} := + (isOpen_lt continuous_const continuous_norm).measurableSet.inter (isOpen_lt continuous_norm continuous_const).measurableSet + have hs := (expectedPopulation_sq_le ψ hA hm).trans (H S hatom ψ hψ hm hE hstate hδ hr) + rw [←Real.sq_sqrt hC,←mul_pow] at hs + exact (sq_le_sq₀ (expectedPopulation_nonneg _ _) (mul_nonneg (Real.sqrt_nonneg _) (screenMass_pos _ _).le)).mp hs + let K : ℝ := Real.sqrt C*screenMass δ h/h + have hK : 0 ≤ K := by exact div_nonneg (mul_nonneg (Real.sqrt_nonneg _) (screenMass_pos _ _).le) hh.le + have hstep (j : ℕ) : radialTailPotential ψ ((2:ℝ)^j*h) ≤ K*(3/4:ℝ)^j+ + radialTailPotential ψ ((2:ℝ)^(j+1)*h) := by + have hr : 0 < (2:ℝ)^j*h := by positivity + have H1 := div_le_div_of_nonneg_right (hmean hr) hr.le + have H2 := mul_le_mul_of_nonneg_left (screenMass_dyadic_bound hδ hh j) (Real.sqrt_nonneg C) + have H3 : expectedPopulation ψ {z : Space | (1/2:ℝ)*((2:ℝ)^j*h) < ‖z‖ ∧ ‖z‖ < 4*((2:ℝ)^j*h)}/((2:ℝ)^j*h) ≤ K*(3/4:ℝ)^j := by + calc + _ ≤ Real.sqrt C*screenMass δ ((2:ℝ)^j*h)/((2:ℝ)^j*h) := H1 + _ ≤ K*(3/4:ℝ)^j := by simpa only [K,mul_div_assoc,mul_assoc] using H2 + have He : 2*((2:ℝ)^j*h)=(2:ℝ)^(j+1)*h := by rw [pow_succ]; ring + exact (radialTailPotential_step ψ hr).trans (by rw [He]; exact add_le_add H3 le_rfl) + have hfinite (N : ℕ) : radialTailPotential ψ h ≤ + K*(∑ j∈Finset.range N, (3/4:ℝ)^j)+radialTailPotential ψ ((2:ℝ)^N*h) := by + induction N with + | zero => simp + | succ N ih => + have HS := add_le_add (le_refl (K*∑ j∈Finset.range N, (3/4:ℝ)^j)) (hstep N) + refine ih.trans (HS.trans_eq ?_) + rw [Finset.sum_range_succ] + ring + have hbound (N : ℕ) : radialTailPotential ψ h ≤ 4*K+((n:ℝ)/h)*(1/2:ℝ)^N := by + have hs : (∑ j∈Finset.range N, (3/4:ℝ)^j) ≤ 4 := by + have HH := geom_sum_mul_neg (3/4:ℝ) N + nlinarith [pow_nonneg (by norm_num : (0:ℝ) ≤ 3/4) N] + have ht := radialTailPotential_cap ψ (show 0 < (2:ℝ)^N*h by positivity) + rw [hm,mul_one] at ht + have he : (n:ℝ)/((2:ℝ)^N*h)=((n:ℝ)/h)*(1/2:ℝ)^N := by + rw [div_pow,one_pow] + field_simp + exact (hfinite N).trans (by rw [←he]; nlinarith [mul_le_mul_of_nonneg_left hs hK]) + have hlim : Tendsto (fun N : ℕ => 4*K+(n:ℝ)/h*(1/2:ℝ)^N) atTop (𝓝 (4*K)) := by + convert tendsto_const_nhds.add (tendsto_const_nhds.mul + (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0:ℝ) ≤ 1/2) (by norm_num : (1/2:ℝ) < 1))) using 1 + simp + have Hfinal := ge_of_tendsto' hlim hbound + dsimp [K] at Hfinal + exact Hfinal.trans_eq (by ring) + +def atomicTailConstant : ℝ := Classical.choose atomic_radial_tail_uniform +lemma atomicTailConstant_nonneg : 0 ≤ atomicTailConstant := + (Classical.choose_spec atomic_radial_tail_uniform).1 + +theorem atomic_radial_tail_bound {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) {h : ℝ} (hh : 0 < h) : + radialTailPotential ψ h ≤ atomicTailConstant*screenMass δ h/h := + (Classical.choose_spec atomic_radial_tail_uniform).2 S hatom ψ hψ hm hE hstate hδ hh + +end Coulomb +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +def atomicInnerField {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (h : ℝ) (y : Space) : ℝ := + attraction S y-restrictedCorePotential ψ (Metric.ball 0 h) y + +lemma far_radial_kernel_bound {y z : Space} (hy : y≠0) + (hfar : 40*atomicCellScale y ≤ ‖z-y‖) (hz : z≠0) : + coulombKernel (z-y) ≤ 2501*coulombKernel z := by + have hy0 := atomicCellScale_pos hy + have hd : 0 < ‖z-y‖ := lt_of_lt_of_le (by positivity : 0 < 40*atomicCellScale y) hfar + have hz0 := norm_pos_iff.mpr hz + have hn := norm_add_le (z-y) y + rw [sub_add_cancel] at hn + dsimp only [atomicCellScale] at hfar + have H : (1:ℝ)/‖z-y‖ ≤ 2501/‖z‖ := + (div_le_div_iff₀ hd hz0).mpr (by nlinarith) + simpa only [div_eq_mul_inv,one_mul,coulombKernel] using H + +lemma restrictedCore_far_le_inner_tail {n : ℕ} (ψ : H1Vector n) + {h : ℝ} (hh : 0 < h) {y : Space} (hy : y≠0) : + restrictedCorePotential ψ {z | 40*atomicCellScale y ≤ ‖z-y‖} y ≤ + restrictedCorePotential ψ (Metric.ball 0 h) y+2501*radialTailPotential ψ h := by + let A : Set Space := {z | 40*atomicCellScale y ≤ ‖z-y‖} + have hA : MeasurableSet A := (isClosed_le continuous_const (by fun_prop)).measurableSet + have hk (z : Space) : (if z∈A then coulombKernel (z-y) else 0) ≤ + (if z∈Metric.ball 0 h then coulombKernel (z-y) else 0)+2501*radialTailKernel h z := by + have htail := radialTailKernel_nonneg h z + by_cases hf : z∈A + · by_cases hi : z∈Metric.ball 0 h + · simp only [ite_eq_left hf,ite_eq_left hi]; linarith + · have hz : h ≤ ‖z‖ := by simpa only [Metric.mem_ball,dist_zero_right,not_lt] using hi + have hz0 : z≠0 := norm_pos_iff.mp (hh.trans_le hz) + simp only [ite_eq_left hf,ite_eq_right hi,zero_add,radialTailKernel,ite_eq_left hz] + exact far_radial_kernel_bound hy hf hz0 + · simp only [ite_eq_right hf] + exact add_nonneg (by split_ifs <;> first | exact inv_nonneg.mpr (norm_nonneg _) | exact le_rfl) (by positivity) + rw [radialTailPotential_eq] + change (∑ s : Spins n, ∑ i : Fin n, ∫ x, if position x i∈A then coulombKernel (position x i-y)*‖ψ.value s x‖^2 else 0) ≤ _ + calc + _ ≤ ∑ s : Spins n, ∑ i : Fin n, ∫ x, + (if position x i∈Metric.ball 0 h then coulombKernel (position x i-y)*‖ψ.value s x‖^2 else 0)+ + 2501*(radialTailKernel h (position x i)*‖ψ.value s x‖^2) := by + apply Finset.sum_le_sum; intro s hs + apply Finset.sum_le_sum; intro i hi + have hiR : Integrable (fun x => + (if position x i∈Metric.ball 0 h then coulombKernel (position x i-y)*‖ψ.value s x‖^2 else 0)+ + 2501*(radialTailKernel h (position x i)*‖ψ.value s x‖^2)) := by + exact (restrictedCore_integrable ψ measurableSet_ball s i y).add + ((radialTailKernel_integrable ψ h s i).const_mul 2501) + apply integral_mono (restrictedCore_integrable ψ hA s i y) hiR + intro x + have H := mul_le_mul_of_nonneg_right (hk (position x i)) (sq_nonneg ‖ψ.value s x‖) + simpa only [add_mul,ite_mul,zero_mul,mul_assoc] using H + _ = _ := by + simp_rw [integral_add (restrictedCore_integrable ψ measurableSet_ball _ _ y) + ((radialTailKernel_integrable ψ h _ _).const_mul 2501), integral_const_mul] + simp only [Finset.sum_add_distrib,←Finset.mul_sum,restrictedCorePotential] + +theorem atomic_inner_field_bound {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) {h : ℝ} (hh : 0 < h) {y : Space} (hy : y≠0) : + atomicInnerField S ψ h y ≤ + 2*atomicBudgetRecursionC^2*screenFieldUnit δ atomicCountConstant (atomicCellScale y)+ + 2501*atomicTailConstant*screenMass δ h/h := by + have Hb := restrictedCore_far_le_inner_tail ψ hh hy + have Hr := atomic_expected_raw_field_bound S hatom ψ hψ hm hE hstate hδ hy + have Ht := atomic_radial_tail_bound S hatom ψ hψ hm hE hstate hδ hh + dsimp only [atomicInnerField] + have HM := le_max_left (attraction S y-restrictedCorePotential ψ {z | 40*atomicCellScale y ≤ ‖z-y‖} y) 0 + have Ht' := mul_le_mul_of_nonneg_left Ht (show (0:ℝ) ≤ 2501 by norm_num) + have he : 2501*(atomicTailConstant*screenMass δ h/h)=2501*atomicTailConstant*screenMass δ h/h := by ring + rw [he] at Ht' + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TsumFixed.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TsumFixed.lean new file mode 100644 index 0000000000000000000000000000000000000000..94d64515e10f879130c702585cff7865ce49c38d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TsumFixed.lean @@ -0,0 +1,205 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.HilbertBasisContaining + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb + +lemma tsum_fixed_zero {ι : Type*} {n : ℕ} (f : (Fin (n+1) → ι) → ℝ) (a : ι) : + (∑' b : Fin (n+1) → ι, if b 0 = a then f b else 0) = + ∑' c : Fin n → ι, f (Fin.cons a c) := by + have hinj : Function.Injective (fun c : Fin n → ι => (Fin.cons a c : Fin (n+1) → ι)) := by + intro c d h + funext i + exact congrFun h i.succ + have hs : Function.support (fun b : Fin (n+1) → ι => if b 0 = a then f b else 0) ⊆ + Set.range (fun c : Fin n → ι => (Fin.cons a c : Fin (n+1) → ι)) := by + intro b hb + have ha : b 0 = a := by + by_contra hh + exact hb (ite_eq_right hh) + exact ⟨Fin.tail b, by simpa only [← ha] using Fin.cons_self_tail b⟩ + simpa only [Fin.cons_zero, ite_true] using (hinj.tsum_eq hs).symm + +lemma basis_contraction_pauli {A ι : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] [Countable ι] {n : ℕ} + (f : (Fin (n+1) → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (ha : ProductAntisymmetric (μ := μ) f) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) (a : ι) : + ((n+1 : ℕ) : ℝ) * (∫ y : Fin n → A, + ‖fiberContract (μ := μ) (v a) (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y‖^2 + ∂(Measure.pi fun _ => μ)) ≤ ∫ x, ‖f x‖^2 ∂(Measure.pi fun _ => μ) := by + have hp := (scalarCoefficient_antisymmetric ha v).pauli_bound + (scalarCoefficient_summable f hf v hv ho) a 0 + rw [scalarCoefficient_parseval f hf v hv ho hc, tsum_fixed_zero] at hp + simp only [scalarCoefficient_contract f hf v hv] at hp + let e := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) => A) 0).trans + (MeasurableEquiv.prodComm : A × (Fin n → A) ≃ᵐ (Fin n → A) × A) + have he : MeasurePreserving e (Measure.pi fun _ => μ) + ((Measure.pi fun _ : Fin n => μ).prod μ) := + (measurePreserving_piFinSuccAbove (fun _ => μ) 0).trans Measure.measurePreserving_swap + have hcons : ∀ z : (Fin n → A) × A, e.symm z = Fin.cons z.2 z.1 := by + intro z + ext i + refine Fin.cases ?_ (fun j => ?_) i <;> + simp [e, MeasurableEquiv.piFinSuccAbove, MeasurableEquiv.prodComm] + have hf' : MemLp (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) 2 + ((Measure.pi fun _ : Fin n => μ).prod μ) := by + simpa only [Function.comp_def, hcons] using hf.comp_measurePreserving (he.symm e) + rw [scalarCoefficient_parseval _ (fiberContract_memLp (hv a) hf') v hv ho hc] at hp + exact hp + +lemma unit_contraction_pauli {A : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] [SecondCountableTopology (Lp ℂ 2 μ)] {n : ℕ} + (f : (Fin (n+1) → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (ha : ProductAntisymmetric (μ := μ) f) + (v : A → ℂ) (hv : MemLp v 2 μ) (hv1 : ∫ x, ‖v x‖^2 ∂μ = 1) : + ((n+1 : ℕ) : ℝ) * (∫ y : Fin n → A, + ‖fiberContract (μ := μ) v (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y‖^2 + ∂(Measure.pi fun _ => μ)) ≤ ∫ x, ‖f x‖^2 ∂(Measure.pi fun _ => μ) := by + have hn : ‖hv.toLp v‖ = 1 := by + have hs := norm_toLp_sq_complex hv + rw [hv1] at hs + nlinarith [norm_nonneg (hv.toLp v)] + obtain ⟨w, b, i, hbi, hb⟩ := exists_hilbertBasis_containing (hv.toLp v) hn + have : Countable w := orthonormal_subtype_countable (by + simpa only [hb] using b.orthonormal) + have ho (j k : w) : (∫ a, star (b j a) * b k a ∂μ) = if j = k then (1:ℂ) else 0 := by + rw [← inner_toLp_complex (Lp.memLp (b j)) (Lp.memLp (b k))] + simp only [Lp.toLp_coeFn] + exact (orthonormal_iff_ite.mp b.orthonormal) j k + have H := basis_contraction_pauli f hf ha (fun j => b j) (fun j => Lp.memLp (b j)) + (by intro j k; by_cases h : j = k <;> + simpa only [h, ite_true, ite_false] using ho j k) (HilbertBasis_completeOrbitals b) i + have he : (fun a => b i a) =ᵐ[μ] v := by + simpa only [hbi] using hv.coeFn_toLp + have hc (y : Fin n → A) : + fiberContract (μ := μ) (b i) (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y = + fiberContract (μ := μ) v (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y := by + unfold fiberContract + apply integral_congr_ae + filter_upwards [he] with a ha + rw [ha] + simpa only [hc] using H + +lemma fiberContract_const_mul {A B : Type*} [MeasurableSpace A] {μ : Measure A} + (c : ℂ) (v : A → ℂ) (f : B × A → ℂ) (y : B) : + fiberContract (μ := μ) (fun x => c * v x) f y = star c * fiberContract (μ := μ) v f y := by + unfold fiberContract + rw [show (fun a => star (c * v a) * f (y,a)) = + (fun a => star c * (star (v a) * f (y,a))) from by + funext a; simp only [star_mul]; ring, integral_const_mul] + +lemma contraction_pauli {A : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] [SecondCountableTopology (Lp ℂ 2 μ)] {n : ℕ} + (f : (Fin (n+1) → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (ha : ProductAntisymmetric (μ := μ) f) (v : A → ℂ) (hv : MemLp v 2 μ) : + ((n+1 : ℕ) : ℝ) * (∫ y : Fin n → A, + ‖fiberContract (μ := μ) v (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y‖^2 + ∂(Measure.pi fun _ => μ)) ≤ + (∫ x, ‖v x‖^2 ∂μ) * (∫ x, ‖f x‖^2 ∂(Measure.pi fun _ => μ)) := by + let t : ℝ := ‖hv.toLp v‖ + have ht : 0 ≤ t := norm_nonneg _ + have ht2 : t^2 = ∫ x, ‖v x‖^2 ∂μ := norm_toLp_sq_complex hv + by_cases hz : t = 0 + · have hv0 : hv.toLp v = 0 := norm_eq_zero.mp hz + have hev : v =ᵐ[μ] 0 := hv.coeFn_toLp.symm.trans ((Lp.eq_zero_iff_ae_eq_zero).mp hv0) + have hc (y : Fin n → A) : + fiberContract (μ := μ) v (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y = 0 := by + unfold fiberContract + apply integral_eq_zero_of_ae + filter_upwards [hev] with x hx + simp [hx] + simp only [← ht2, hz, zero_pow (by decide : 2 ≠ 0), zero_mul, hc, norm_zero, integral_zero, + mul_zero, le_refl] + · have htpos : 0 < t := lt_of_le_of_ne ht (Ne.symm hz) + let u : A → ℂ := fun x => (t⁻¹ : ℂ) * v x + have hu : MemLp u 2 μ := hv.const_mul _ + have hu1 : (∫ x, ‖u x‖^2 ∂μ) = 1 := by + simp only [u, norm_mul, norm_inv, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg ht, + mul_pow, integral_const_mul, ← ht2] + field_simp + have H := unit_contraction_pauli f hf ha u hu hu1 + simp only [u, fiberContract_const_mul, norm_mul, norm_star, norm_inv, Complex.norm_real, + Real.norm_eq_abs, abs_of_nonneg ht, mul_pow, integral_const_mul] at H + rw [← ht2] + have H' := mul_le_mul_of_nonneg_left H (sq_nonneg t) + have he : t^2 * (((n+1:ℕ):ℝ) * ((t⁻¹)^2 * + (∫ y : Fin n → A, ‖fiberContract (μ := μ) v + (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y‖^2 ∂(Measure.pi fun _ => μ)))) = + ((n+1:ℕ):ℝ) * (∫ y : Fin n → A, ‖fiberContract (μ := μ) v + (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) y‖^2 ∂(Measure.pi fun _ => μ)) := by + field_simp + rwa [he] at H' + +variable {A ι : Type*} [MeasurableSpace A] {μ : Measure A} + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + +include ho in +lemma orbital_orthonormal : Orthonormal ℂ (fun i => (hv i).toLp (v i)) := by + rw [orthonormal_iff_ite] + intro i j + rw [inner_toLp_complex] + exact ho i j + +include hv in +lemma orbital_sum_memLp (s : Finset ι) (c : ι → ℂ) : + MemLp (fun x => ∑ i ∈ s, c i * v i x) 2 μ := + memLp_finsetSum s (fun i _ => (hv i).const_mul (c i)) + +lemma orbital_sum_toLp (s : Finset ι) (c : ι → ℂ) : + (orbital_sum_memLp v hv s c).toLp (fun x => ∑ i ∈ s, c i * v i x) = + ∑ i ∈ s, c i • (hv i).toLp (v i) := by + classical + induction s using Finset.induction_on with + | empty => simp only [Finset.sum_empty]; rfl + | @insert a s ha ih => + have he : (fun x => ∑ i ∈ insert a s, c i * v i x) = + (fun x => c a * v a x) + (fun x => ∑ i ∈ s, c i * v i x) := by + funext x + simp [Finset.sum_insert ha] + rw [show (orbital_sum_memLp v hv (insert a s) c).toLp _ = + ((hv a).const_mul (c a)).toLp (fun x => c a * v a x) + + (orbital_sum_memLp v hv s c).toLp (fun x => ∑ i ∈ s, c i * v i x) from by + simpa only [he] using ((hv a).const_mul (c a)).toLp_add + (orbital_sum_memLp v hv s c)] + rw [ih, Finset.sum_insert ha] + congr 1 + +include hv ho in +lemma orbital_sum_sq (s : Finset ι) (c : ι → ℂ) : + (∫ x, ‖∑ i ∈ s, c i * v i x‖^2 ∂μ) = ∑ i ∈ s, ‖c i‖^2 := by + rw [← norm_toLp_sq_complex (orbital_sum_memLp v hv s c), orbital_sum_toLp v hv s c] + apply Complex.ofReal_injective + rw [Complex.ofReal_sum] + calc + (↑(‖∑ i ∈ s, c i • (hv i).toLp (v i)‖^2) : ℂ) = + inner ℂ (∑ i ∈ s, c i • (hv i).toLp (v i)) + (∑ i ∈ s, c i • (hv i).toLp (v i)) := by + simp [inner_self_eq_norm_sq_to_K, Complex.ofReal_pow] + _ = ∑ i ∈ s, star (c i) * c i := (orbital_orthonormal v hv ho).inner_sum c c s + _ = ∑ i ∈ s, (↑(‖c i‖^2) : ℂ) := by + apply Finset.sum_congr rfl + intro i _ + simpa only [starRingEnd_apply, Complex.ofReal_pow] using Complex.conj_mul' (c i) + +noncomputable def lowOrbital (s : Finset ι) (x : A) (y : A) : ℂ := + ∑ i ∈ s, star (v i x) * v i y + +include hv in +lemma lowOrbital_memLp (s : Finset ι) (x : A) : + MemLp (lowOrbital v s x) 2 μ := orbital_sum_memLp v hv s _ + +include hv ho in +lemma lowOrbital_sq (s : Finset ι) (x : A) : + (∫ y, ‖lowOrbital v s x y‖^2 ∂μ) = ∑ i ∈ s, ‖v i x‖^2 := by + simpa only [lowOrbital, norm_star] using orbital_sum_sq v hv ho s (fun i => star (v i x)) + +end Coulomb + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TwoBodyTensorIntegrable.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TwoBodyTensorIntegrable.lean new file mode 100644 index 0000000000000000000000000000000000000000..55544390440379a57ae83832f8e321f629c6795a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/TwoBodyTensorIntegrable.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PermOrCompSwapOffTwo + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma two_body_tensor_integrable {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℂ) + (hv : ∀ i, MemLp (v i) 2 μ) + (hw : ∀ a b c d, Integrable (fun xy : A × A => w xy.1 xy.2 * + ((star (v a xy.1) * v c xy.1) * (star (v b xy.2) * v d xy.2))) (μ.prod μ)) + (p q : Equiv.Perm (Fin n)) (i j : Fin n) (hij : i ≠ j) : + Integrable (fun x : Fin n → A => w (x i) (x j) * + (star (∏ k, v (p k) (x k)) * ∏ k, v (q k) (x k))) (Measure.pi fun _ => μ) := by + simp only [star_prod, ← Finset.prod_mul_distrib] + exact pair_weight_tensor_integrable i j hij (fun k a => star (v (p k) a) * v (q k) a) w + (fun k => (hv (p k)).star.integrable_mul (hv (q k))) (hw _ _ _ _) + +lemma two_body_tensor_integral {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℂ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) + (p q : Equiv.Perm (Fin n)) (i j : Fin n) (hij : i ≠ j) : + (∫ x : Fin n → A, w (x i) (x j) * + (star (∏ k, v (p k) (x k)) * ∏ k, v (q k) (x k)) ∂(Measure.pi fun _ => μ)) = + (∫ xy : A × A, w xy.1 xy.2 * + ((star (v (p i) xy.1) * v (q i) xy.1) * (star (v (p j) xy.2) * v (q j) xy.2)) + ∂(μ.prod μ)) * ∏ k ∈ (Finset.univ.erase i).erase j, + if p k = q k then (1:ℂ) else 0 := by + simp only [star_prod, ← Finset.prod_mul_distrib] + rw [pair_weight_tensor_integral i j hij (fun k a => star (v (p k) a) * v (q k) a) w] + simp_rw [ho] + +lemma determinant_two_body_expansion {A : Type*} {n : ℕ} + (v : Fin n → A → ℂ) (w : A → A → ℂ) (x : Fin n → A) : + (∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * + (star (determinantWave v x) * determinantWave v x) = + ∑ p : Equiv.Perm (Fin n), ∑ q : Equiv.Perm (Fin n), + star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) * + ∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j) * + (star (∏ k, v (p k) (x k)) * ∏ k, v (q k) (x k)) := by + rw [determinant_bilinear_expansion] + simp only [Finset.mul_sum] + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + simp only [Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma determinant_two_body_integrable {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℂ) + (hv : ∀ i, MemLp (v i) 2 μ) + (hw : ∀ a b c d, Integrable (fun xy : A × A => w xy.1 xy.2 * + ((star (v a xy.1) * v c xy.1) * (star (v b xy.2) * v d xy.2))) (μ.prod μ)) : + Integrable (fun x : Fin n → A => (∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * + (star (determinantWave v x) * determinantWave v x)) (Measure.pi fun _ => μ) := by + simp_rw [determinant_two_body_expansion] + apply integrable_finsetSum + intro p _ + apply integrable_finsetSum + intro q _ + apply Integrable.const_mul + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j hj + exact two_body_tensor_integrable v w hv hw p q i j (Finset.mem_erase.mp hj).1.symm + +lemma determinant_two_body_integral {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℂ) + (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) + (hw : ∀ a b c d, Integrable (fun xy : A × A => w xy.1 xy.2 * + ((star (v a xy.1) * v c xy.1) * (star (v b xy.2) * v d xy.2))) (μ.prod μ)) : + (∫ x : Fin n → A, (∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * + (star (determinantWave v x) * determinantWave v x) ∂(Measure.pi fun _ => μ)) = + (n.factorial : ℂ) * ∑ i, ∑ j, + ((∫ xy : A × A, w xy.1 xy.2 * + ((star (v i xy.1) * v i xy.1) * (star (v j xy.2) * v j xy.2)) ∂(μ.prod μ)) - + (∫ xy : A × A, w xy.1 xy.2 * + ((star (v i xy.1) * v j xy.1) * (star (v j xy.2) * v i xy.2)) ∂(μ.prod μ))) := by + let F (p q : Equiv.Perm (Fin n)) (i j : Fin n) (x : Fin n → A) : ℂ := + w (x i) (x j) * (star (∏ k, v (p k) (x k)) * ∏ k, v (q k) (x k)) + let c (p q : Equiv.Perm (Fin n)) : ℂ := star (((p.sign : ℤ) : ℂ)) * (((q.sign : ℤ) : ℂ)) + have hi (p q : Equiv.Perm (Fin n)) : Integrable + (fun x => ∑ i, ∑ j ∈ Finset.univ.erase i, F p q i j x) (Measure.pi fun _ => μ) := + integrable_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j hj => + two_body_tensor_integrable v w hv hw p q i j (Finset.mem_erase.mp hj).1.symm)) + have hj (p : Equiv.Perm (Fin n)) : Integrable + (fun x => ∑ q, c p q * ∑ i, ∑ j ∈ Finset.univ.erase i, F p q i j x) + (Measure.pi fun _ => μ) := integrable_finsetSum _ (fun q _ => (hi p q).const_mul _) + calc + _ = ∫ x : Fin n → A, ∑ p, ∑ q, c p q * ∑ i, ∑ j ∈ Finset.univ.erase i, F p q i j x + ∂(Measure.pi fun _ => μ) := by + apply integral_congr_ae + filter_upwards [] with x + exact determinant_two_body_expansion v w x + _ = ∑ p, ∑ q, c p q * ∑ i, ∑ j ∈ Finset.univ.erase i, + ∫ x : Fin n → A, F p q i j x ∂(Measure.pi fun _ => μ) := by + rw [integral_finsetSum _ (fun p _ => hj p)] + apply Finset.sum_congr rfl + intro p _ + rw [integral_finsetSum _ (fun q _ => (hi p q).const_mul _)] + apply Finset.sum_congr rfl + intro q _ + rw [integral_const_mul, integral_finsetSum _ (fun i _ => integrable_finsetSum _ + (fun j hj => two_body_tensor_integrable v w hv hw p q i j (Finset.mem_erase.mp hj).1.symm))] + congr 1 + apply Finset.sum_congr rfl + intro i _ + exact integral_finsetSum _ (fun j hj => + two_body_tensor_integrable v w hv hw p q i j (Finset.mem_erase.mp hj).1.symm) + _ = _ := by + have H := slater_two_body_trace_algebra (fun a b c d => + ∫ xy : A × A, w xy.1 xy.2 * ((star (v a xy.1) * v c xy.1) * + (star (v b xy.2) * v d xy.2)) ∂(μ.prod μ)) + rw [← H] + apply Finset.sum_congr rfl + intro p _ + apply Finset.sum_congr rfl + intro q _ + congr 1 + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j hj + exact two_body_tensor_integral v w ho p q i j (Finset.mem_erase.mp hj).1.symm + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/UniformBall.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/UniformBall.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5d319f40c8e2b9849b1f47a15ac851a4a9def92 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/UniformBall.lean @@ -0,0 +1,197 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CoreScreenedField +import OAI.Analysis.CoulombRadii.FieldAnalysis.CoulombBilinear + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +def uniformBall (a M : ℝ) (x : Space) : ℝ := + (Metric.ball (0 : Space) a).indicator (fun _ => M / (4*Real.pi/3*a^3)) x + +def ballCloud (y : Space) (a M : ℝ) (x : Space) : ℝ := uniformBall a M (x-y) + +lemma uniformBall_nonneg {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (x : Space) : + 0 ≤ uniformBall a M x := by + apply Set.indicator_nonneg + intro x hx + exact div_nonneg hM (by positivity) + +lemma uniformBall_le {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (x : Space) : + uniformBall a M x ≤ M/(4*Real.pi/3*a^3) := by + exact Set.indicator_le_self' (fun _ _ => div_nonneg hM (by positivity)) _ + +lemma uniformBall_measurable (a M : ℝ) : Measurable (uniformBall a M) := + measurable_const.indicator measurableSet_ball + +lemma uniformBall_integrable (a M : ℝ) : Integrable (uniformBall a M) := by + exact (integrable_indicator_iff measurableSet_ball).2 (integrableOn_const (C := M/(4*Real.pi/3*a^3)) measure_ball_lt_top.ne) + +lemma uniformBall_mass {a : ℝ} (ha : 0 < a) (M : ℝ) : + (∫ x, uniformBall a M x) = M := by + unfold uniformBall + rw [integral_indicator measurableSet_ball, integral_const] + rw [measureReal_restrict_apply_univ, smul_eq_mul, volume_real_ball_three a ha.le] + field_simp [ha.ne', Real.pi_ne_zero] + +lemma uniformBall_power_integrable (a M : ℝ) : + Integrable (fun x => uniformBall a M x^(5/3:ℝ)) := by + have he : (fun x => uniformBall a M x^(5/3:ℝ)) = + (Metric.ball (0:Space) a).indicator (fun _ => (M/(4*Real.pi/3*a^3))^(5/3:ℝ)) := by + funext x + simp only [uniformBall,Set.indicator_apply] + split <;> simp + rw [he] + exact (integrable_indicator_iff measurableSet_ball).2 (integrableOn_const (C := (M/(4*Real.pi/3*a^3))^(5/3:ℝ)) measure_ball_lt_top.ne) + +lemma uniformBall_power {a : ℝ} (ha : 0 < a) (M : ℝ) : + (∫ x, uniformBall a M x^(5/3:ℝ)) = (4*Real.pi/3*a^3)*(M/(4*Real.pi/3*a^3))^(5/3:ℝ) := by + have he : (fun x => uniformBall a M x^(5/3:ℝ)) = + (Metric.ball (0:Space) a).indicator (fun _ => (M/(4*Real.pi/3*a^3))^(5/3:ℝ)) := by + funext x + simp only [uniformBall,Set.indicator_apply] + split <;> simp + rw [he, integral_indicator measurableSet_ball, integral_const] + rw [measureReal_restrict_apply_univ, smul_eq_mul, volume_real_ball_three a ha.le] + +lemma uniformBall_radial (a M : ℝ) (x : Space) : + uniformBall a M x = uniformBall a M (EuclideanSpace.single 0 ‖x‖) := by + simp only [uniformBall,Set.indicator_apply,Metric.mem_ball,dist_zero_right, + PiLp.norm_single,Real.norm_eq_abs,abs_of_nonneg (norm_nonneg x)] + +lemma uniformBall_support (a M : ℝ) (x : Space) (hx : a < ‖x‖) : + uniformBall a M x = 0 := by + apply Set.indicator_of_notMem + simpa only [Metric.mem_ball,dist_zero_right,not_lt] using hx.le + +lemma ballCloud_mass {a : ℝ} (ha : 0 < a) (M : ℝ) (y : Space) : + (∫ x, ballCloud y a M x) = M := by + unfold ballCloud + rw [integral_sub_right_eq_self, uniformBall_mass ha] + +lemma ballCloud_integrable (a M : ℝ) (y : Space) : Integrable (ballCloud y a M) := + (uniformBall_integrable a M).comp_sub_right y + +lemma ballCloud_measurable (a M : ℝ) (y : Space) : Measurable (ballCloud y a M) := + (uniformBall_measurable a M).comp (by fun_prop) + +lemma ballCloud_coulomb {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y x : Space) + (hxy : a ≤ ‖x-y‖) : + (∫ z, coulombKernel (x-z)*ballCloud y a M z) = M*coulombKernel (x-y) := by + have he : (∫ z, coulombKernel (x-z)*ballCloud y a M z) = + ∫ z, coulombKernel ((x-y)-z)*uniformBall a M z := by + rw [← integral_sub_right_eq_self (fun z => coulombKernel ((x-y)-z)*uniformBall a M z) y] + apply integral_congr_ae + exact Eventually.of_forall (fun z => by + change coulombKernel (x-z)*uniformBall a M (z-y) = _ + have hz : (x-y)-(z-y) = x-z := by abel + dsimp only + rw [hz]) + rw [he,radial_coulomb_integral_eq (uniformBall_integrable a M) (uniformBall_measurable a M) + (uniformBall_nonneg ha hM) (uniformBall_le ha hM) (uniformBall_radial a M) ha.le + (uniformBall_support a M) (by intro hh; simp [hh] at hxy; linarith) hxy, + uniformBall_mass ha, mul_comm] + +lemma ballCloud_coulomb_bound {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y x : Space) : + (∫ z, coulombKernel (x-z)*ballCloud y a M z) ≤ (5/2:ℝ)*M/a := by + have H := coulomb_convolution_bound (ballCloud_integrable a M y) (ballCloud_measurable a M y) + (fun z => uniformBall_nonneg ha hM (z-y)) (fun z => uniformBall_le ha hM (z-y)) ha x + rw [ballCloud_mass ha] at H + convert H using 1 + field_simp [ha.ne', Real.pi_ne_zero] + ring + +lemma ballCloud_coulombBilinear_bound {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y : Space) : + coulombBilinear (ballCloud y a M) (ballCloud y a M) ≤ (5/2:ℝ)*M^2/a := by + have hi := ballCloud_integrable a M y + have hm := ballCloud_measurable a M y + have hb (z : Space) : ‖ballCloud y a M z‖ ≤ M/(4*Real.pi/3*a^3) := by + change ‖uniformBall a M (z-y)‖ ≤ _ + rw [Real.norm_of_nonneg (uniformBall_nonneg ha hM (z-y))] + exact uniformBall_le ha hM _ + rw [coulombBilinear_iterated hi hm hi hm hb] + have hip : Integrable (fun z => ballCloud y a M z * + (∫ w, coulombKernel (z-w)*ballCloud y a M w)) := by + apply ((coulomb_pair_integrable hi hm hi hm hb).integral_prod_left).congr + exact Eventually.of_forall (fun z => by + dsimp only + rw [← integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall (fun w => by ring)) + have H := integral_mono hip (hi.mul_const ((5/2:ℝ)*M/a)) (fun z => + mul_le_mul_of_nonneg_left (ballCloud_coulomb_bound ha hM y z) (uniformBall_nonneg ha hM (z-y))) + rw [integral_mul_const,ballCloud_mass ha] at H + calc + _ ≤ M*((5/2:ℝ)*M/a) := H + _ = (5/2:ℝ)*M^2/a := by ring + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +lemma coreCoulombPotential_ballCloud {k : ℕ} (u : H1Vector k) + {A : Set Space} (hu : SpatiallySupported u A) + {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y : Space) + (hsep : ∀ z ∈ A, a ≤ ‖z-y‖) : + (∫ z, coreCoulombPotential u z*ballCloud y a M z) = M*coreCoulombPotential u y := by + rw [coreCoulombPotential_fubini u _ (ballCloud_integrable a M y)] + simp only [coreCoulombPotential,Finset.mul_sum,← integral_const_mul] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro i _ + apply integral_congr_ae + filter_upwards [hu s] with x hx + by_cases he : u.value s x = 0 + · simp [he] + · have hz : position x i ∈ A := (by_contra (fun hn => he (hx hn)) : x ∈ allPositions A) i + rw [ballCloud_coulomb ha hM y (position x i) (hsep _ hz)] + ring + +lemma attraction_ballCloud {J : ℕ} (S : Nuclei J) + {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y : Space) + (hsep : ∀ j, a ≤ ‖S.position j-y‖) : + (∫ z, attraction S z*ballCloud y a M z) = M*attraction S y := by + have hi j : Integrable (fun z => S.charge j*(coulombKernel (S.position j-z)*ballCloud y a M z)) := + (coulomb_convolution_integrable (ballCloud_integrable a M y) (ballCloud_measurable a M y) + (fun z => uniformBall_nonneg ha hM (z-y)) (fun z => uniformBall_le ha hM (z-y)) ha (S.position j)).const_mul _ + simp only [attraction,Finset.sum_mul,Finset.mul_sum] + simp_rw [coulombKernel_sub_comm _ (S.position _), mul_assoc] + rw [integral_finsetSum _ (fun j _ => hi j)] + apply Finset.sum_congr rfl + intro j _ + rw [integral_const_mul, ballCloud_coulomb ha hM y (S.position j) (hsep j)] + ring + +lemma coreScreenedField_ballCloud {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {A : Set Space} (hu : SpatiallySupported u A) + {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y : Space) + (hcore : ∀ z ∈ A, a ≤ ‖z-y‖) (hnuc : ∀ j, a ≤ ‖S.position j-y‖) : + (∫ z, coreScreenedField S u z*ballCloud y a M z) = M*coreScreenedField S u y := by + have hi := ballCloud_integrable a M y + have hn : Integrable (fun z => attraction S z*ballCloud y a M z) := by + simp only [attraction,Finset.sum_mul] + apply integrable_finsetSum + intro j _ + have H := (coulomb_convolution_integrable hi (ballCloud_measurable a M y) + (fun z => uniformBall_nonneg ha hM (z-y)) (fun z => uniformBall_le ha hM (z-y)) ha (S.position j)).const_mul (S.charge j) + apply H.congr + exact Eventually.of_forall (fun z => by dsimp only; rw [coulombKernel_sub_comm]; ring) + simp only [coreScreenedField,sub_mul] + rw [integral_sub hn (coreCoulombPotential_mul_integrable u _ hi),attraction_ballCloud S ha hM y hnuc, + coreCoulombPotential_ballCloud u hu ha hM y hcore] + ring + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/UnitNucleus.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/UnitNucleus.lean new file mode 100644 index 0000000000000000000000000000000000000000..f18bab40aba33d62bdfd3d572411cc0a6b9b6fc1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/UnitNucleus.lean @@ -0,0 +1,254 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.FiniteProdSum +import OAI.Analysis.CoulombRadii.FieldAnalysis.LeftPotential + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +namespace Coulomb +noncomputable def unitNucleus (R : Space) : Nuclei 1 where + nonempty := by decide + position := fun _ => R + distinct := Function.injective_of_subsingleton _ + charge := fun _ => 1 + charge_ge_one := fun _ => le_rfl + +lemma attraction_unitNucleus (R x : Space) : + attraction (unitNucleus R) x = coulombKernel (x-R) := by + simp [attraction, unitNucleus] + +lemma crossPotential_nuclear {m k : ℕ} (x : Configuration m) (y : Configuration k) : + crossPotential x y = ∑ i : Fin m, nuclearPotential (unitNucleus (position x i)) y := by + simp only [crossPotential,nuclearPotential,attraction_unitNucleus] + congr 1 + funext i + congr 1 + funext j + exact coulombKernel_sub_comm _ _ + +lemma crossPotential_slice_integrable {m k : ℕ} (x : Configuration m) (v : H1Vector k) + (t : Spins k) : Integrable (fun y => crossPotential x y*‖v.value t y‖^2) := by + simp only [crossPotential_nuclear,Finset.sum_mul] + exact integrable_finsetSum _ (fun i _ => v.nuclear_integrable (unitNucleus (position x i)) t) + +lemma crossPotential_spin_integral {m k : ℕ} (x : Configuration m) (v : H1Vector k) : + (∑ t : Spins k, ∫ y, crossPotential x y*‖v.value t y‖^2) = + ∑ i : Fin m, nuclearEnergy (unitNucleus (position x i)) v := by + have h (t : Spins k) (i : Fin m) : Integrable (fun y => + nuclearPotential (unitNucleus (position x i)) y*‖v.value t y‖^2) := + v.nuclear_integrable (unitNucleus (position x i)) t + simp only [crossPotential_nuclear,Finset.sum_mul] + simp_rw [integral_finsetSum _ (fun i _ => h _ i)] + exact Finset.sum_comm + +lemma tensor_cross_prod_integrable {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins m) (t : Spins k) : Integrable + (fun z : Configuration m × Configuration k => + crossPotential z.1 z.2*(‖u.value s z.1‖^2*‖v.value t z.2‖^2)) + (volume.prod volume) := by + have H := (joinConfiguration_measurePreserving m k).integrable_comp_of_integrable + (tensor_crossPotential_integrable u v (joinSpins m k (s,t))) + apply H.congr + filter_upwards [] with z + change crossPotential ((joinConfiguration m k).symm (joinConfiguration m k z)).1 + ((joinConfiguration m k).symm (joinConfiguration m k z)).2 * + ‖tensorValue u v (joinSpins m k (s,t)) (joinConfiguration m k z)‖^2 = _ + rw [ContinuousLinearEquiv.symm_apply_apply,tensorValue_join,joinSpins_left,joinSpins_right,norm_mul,mul_pow] + +lemma cross_integral_core_integrable {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins m) (t : Spins k) : Integrable (fun x => + (∫ y, crossPotential x y*‖v.value t y‖^2)*‖u.value s x‖^2) := by + have H := (tensor_cross_prod_integrable u v s t).integral_prod_left + apply H.congr + filter_upwards [] with x + have he (y : Configuration k) : + crossPotential x y*(‖u.value s x‖^2*‖v.value t y‖^2) = + (crossPotential x y*‖v.value t y‖^2)*‖u.value s x‖^2 := by ring + simp_rw [he, integral_mul_const] + +lemma crossEnergy_iterated {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : + crossEnergy u v = ∑ s : Spins m, ∑ t : Spins k, + ∫ x, (∫ y, crossPotential x y*‖v.value t y‖^2)*‖u.value s x‖^2 := by + unfold crossEnergy potentialEnergy + rw [sum_joinSpins] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro t _ + rw [← (joinConfiguration_measurePreserving m k).integral_comp'] + change (∫ z : Configuration m × Configuration k, + crossPotential ((joinConfiguration m k).symm (joinConfiguration m k z)).1 + ((joinConfiguration m k).symm (joinConfiguration m k z)).2 * + ‖tensorValue u v (joinSpins m k (s,t)) (joinConfiguration m k z)‖^2 + ∂(volume.prod volume)) = _ + simp only [ContinuousLinearEquiv.symm_apply_apply,tensorValue_join,joinSpins_left,joinSpins_right, + norm_mul,mul_pow] + rw [integral_prod _ (tensor_cross_prod_integrable u v s t)] + apply integral_congr_ae + filter_upwards [] with x + have he (y : Configuration k) : + crossPotential x y*(‖u.value s x‖^2*‖v.value t y‖^2) = + (crossPotential x y*‖v.value t y‖^2)*‖u.value s x‖^2 := by ring + simp_rw [he, integral_mul_const] + +lemma cross_core_integrable {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (s : Spins m) : Integrable (fun x => + (∑ i : Fin m, nuclearEnergy (unitNucleus (position x i)) v)*‖u.value s x‖^2) := by + simp_rw [← crossPotential_spin_integral,Finset.sum_mul] + exact integrable_finsetSum _ (fun t _ => cross_integral_core_integrable u v s t) + +lemma crossEnergy_core {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : + crossEnergy u v = ∑ s : Spins m, + ∫ x, (∑ i : Fin m, nuclearEnergy (unitNucleus (position x i)) v)*‖u.value s x‖^2 := by + rw [crossEnergy_iterated] + apply Finset.sum_congr rfl + intro s _ + rw [← integral_finsetSum _ (fun t _ => cross_integral_core_integrable u v s t)] + apply integral_congr_ae + filter_upwards [] with x + rw [← Finset.sum_mul,crossPotential_spin_integral] + +noncomputable def coreInteractionDensity {m : ℕ} (u : H1Vector m) (d : Space → ℝ) : ℝ := + ∑ s : Spins m, ∫ x, (∑ i : Fin m, ∫ z : Space, + coulombKernel (z-position x i)*d z)*‖u.value s x‖^2 + +lemma selectedSlater_spatialSupport {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) (B : Set Space) + (hB : ∀ a s x, x ∉ B → v a x s = 0) (w : ι → Bool) : + SpatiallySupported (selectedSlater v hv hC w) B := by + intro s + filter_upwards [] with x hx + change ¬∀ i, position x i ∈ B at hx + obtain ⟨j,hj⟩ := not_forall.mp hx + change slaterConfiguration (fun a => v (occupiedIndex w a)) s x = 0 + rw [slaterConfiguration_expansion] + have hp (p : Equiv.Perm (Fin (Fintype.card {i // w i = true}))) : + tensorOrbital (fun a => v (occupiedIndex w a)) p s x = 0 := by + apply Finset.prod_eq_zero (Finset.mem_univ j) + exact hB _ _ _ hj + simp only [hp,mul_zero,Finset.sum_const_zero] + +lemma bernoulli_core_cross_mean {ι : Type*} [Fintype ι] {m : ℕ} + (u : H1Vector m) (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) (lam : ι → ℝ) : + (∑ w : ι → Bool, bernoulliWeight lam w * crossEnergy u (selectedSlater v hv hC w)) = + coreInteractionDensity u (finiteFermiDensity v lam) := by + simp only [crossEnergy_core,Finset.mul_sum] + rw [Finset.sum_comm] + unfold coreInteractionDensity + apply Finset.sum_congr rfl + intro s _ + simp_rw [← integral_const_mul] + rw [← integral_finsetSum _ (fun w _ => + (cross_core_integrable u (selectedSlater v hv hC w) s).const_mul (bernoulliWeight lam w))] + apply integral_congr_ae + filter_upwards [] with x + simp only [← mul_assoc,← Finset.sum_mul] + congr 1 + simp only [Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + rw [bernoulli_slater_nuclear_mean _ v hv hC ho lam] + simp only [attraction_unitNucleus] + +theorem finite_fermi_core_trial {ι : Type*} [Fintype ι] {M m : ℕ} + (S : Nuclei M) (u : H1Vector m) (hu : Antisymmetric u) (hm : mass u = 1) + (A B : Set Space) (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) + (hsu : SpatiallySupported u A) (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (hsv : ∀ a s x, x ∉ B → v a x s = 0) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) (lam : ι → ℝ) + (h0 : ∀ i, 0 ≤ lam i) (h1 : ∀ i, lam i ≤ 1) : + ∃ n : ℕ, ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ + form S ψ ≤ form S u + + ((1/2:ℝ)*(∑ i, lam i * ∑ s, ∑ b : Fin 3, + ∫ x : Space, ‖fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)‖^2) - + (∫ x, attraction S x*finiteFermiDensity v lam x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)* + (finiteFermiDensity v lam xy.1*finiteFermiDensity v lam xy.2))) + + coreInteractionDensity u (finiteFermiDensity v lam) := by + have he (w : ι → Bool) : form S (u.wedge (selectedSlater v hv hC w)) = + form S u+form S (selectedSlater v hv hC w)+crossEnergy u (selectedSlater v hv hC w) := by + rw [form_wedge S u (selectedSlater v hv hC w) hu (selectedSlater_antisymmetric v hv hC w) + A B hsu (selectedSlater_spatialSupport v hv hC B hsv w) hA hB hAB, + selectedSlater_normalized v hv hC ho w,hm,mul_one,one_mul] + obtain ⟨w, hw⟩ := exists_le_weighted_average (bernoulliWeight lam) + (fun w => form S (u.wedge (selectedSlater v hv hC w))) + (bernoulliWeight_nonneg lam h0 h1) (bernoulliWeight_sum lam) + refine ⟨_, u.wedge (selectedSlater v hv hC w), wedge_antisymmetric _ _, ?_, hw.trans ?_⟩ + · rw [mass_wedge u (selectedSlater v hv hC w) hu (selectedSlater_antisymmetric v hv hC w) + A B hsu (selectedSlater_spatialSupport v hv hC B hsv w) hAB, + selectedSlater_normalized v hv hC ho w,hm,mul_one] + · simp only [he,mul_add,Finset.sum_add_distrib] + rw [← Finset.sum_mul,bernoulliWeight_sum,one_mul,bernoulli_core_cross_mean u v hv hC ho lam] + gcongr + exact bernoulli_slater_form_upper S v hv hC ho lam +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeakDirectionalUnique.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeakDirectionalUnique.lean new file mode 100644 index 0000000000000000000000000000000000000000..c09f4aa7dc0c33fe7de4297a51607d1da9a3e3cd --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeakDirectionalUnique.lean @@ -0,0 +1,160 @@ +import Mathlib + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +noncomputable section +namespace Coulomb +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma weak_directional_unique {f d e : E → ℂ} (a : E) + (hd : LocallyIntegrable d volume) (he : LocallyIntegrable e volume) + (hfd : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x a : ℂ)*f x) = -(∫ x, (φ x : ℂ)*d x)) + (hfe : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x a : ℂ)*f x) = -(∫ x, (φ x : ℂ)*e x)) : + d =ᵐ[volume] e := by + apply ae_eq_of_integral_contDiff_smul_eq hd he + intro φ hφ hφC + simpa only [← Complex.real_smul, neg_inj] using (hfd φ hφ hφC).symm.trans (hfe φ hφ hφC) + +lemma weak_directional_zero_on_open {f d : E → ℂ} (a : E) + (hd : LocallyIntegrable d volume) + (hfd : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x a : ℂ)*f x) = -(∫ x, (φ x : ℂ)*d x)) + (U : Set E) (hU : IsOpen U) (hfU : ∀ᵐ x ∂volume, x ∈ U → f x = 0) : + ∀ᵐ x ∂volume, x ∈ U → d x = 0 := by + apply hU.ae_eq_zero_of_integral_contDiff_smul_eq_zero (hd.locallyIntegrableOn U) + intro φ hφ hφC hφU + have hzero : (∫ x, (fderiv ℝ φ x a : ℂ)*f x) = 0 := by + apply integral_eq_zero_of_ae + filter_upwards [hfU] with x hx + by_cases h : x ∈ U + · simp [hx h] + · have hn : x ∉ tsupport φ := fun hh => h (hφU hh) + simp [fderiv_of_notMem_tsupport ℝ hn] + have H := hfd φ hφ hφC + rw [hzero] at H + simpa only [← Complex.real_smul, neg_eq_zero] using H.symm + +lemma smooth_compact_weak_directional (f : E → ℂ) + (hf : ContDiff ℝ ∞ f) (hfc : HasCompactSupport f) (a : E) + (φ : E → ℝ) (hφ : ContDiff ℝ ∞ φ) (hφc : HasCompactSupport φ) : + (∫ x, (fderiv ℝ φ x a : ℂ)*f x) = + -(∫ x, (φ x : ℂ)*fderiv ℝ f x a) := by + let g : E → ℂ := fun x => (φ x : ℂ) + have hg : ContDiff ℝ ∞ g := Complex.ofRealCLM.contDiff.comp hφ + have hgc : HasCompactSupport g := hφc.comp_left Complex.ofReal_zero + have hd (x : E) : fderiv ℝ g x a = (fderiv ℝ φ x a : ℂ) := by + exact congrArg (fun L : E →L[ℝ] ℂ => L a) + ((Complex.ofRealCLM.hasFDerivAt.comp x + ((hφ.differentiable (by simp)) x).hasFDerivAt).fderiv) + have hdf : Continuous (fun x => fderiv ℝ f x a) := + (hf.continuous_fderiv (by simp)).clm_apply continuous_const + have hdg : Continuous (fun x => fderiv ℝ g x a) := + (hg.continuous_fderiv (by simp)).clm_apply continuous_const + have h1 : Integrable (fun x => fderiv ℝ g x a*f x) := + (hdg.mul hf.continuous).integrable_of_hasCompactSupport hfc.mul_left + have h2 : Integrable (fun x => g x*fderiv ℝ f x a) := + (hg.continuous.mul hdf).integrable_of_hasCompactSupport hgc.mul_right + have h3 : Integrable (fun x => g x*f x) := + (hg.continuous.mul hf.continuous).integrable_of_hasCompactSupport hgc.mul_right + have H := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable h1 h2 h3 + (fun x _ => hg.differentiable (by simp) x) + (fun x _ => hf.differentiable (by simp) x) + simpa only [hd, g] using (neg_eq_iff_eq_neg.mp H.symm) + +lemma weak_directional_eq_smooth {u d : Lp ℂ 2 (volume : Measure E)} + (a : E) (F : E → ℂ) (hFs : ContDiff ℝ ∞ F) (hFc : HasCompactSupport F) + (hu : (u : E → ℂ) =ᵐ[volume] F) + (hd : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x a : ℂ)*u x) = -(∫ x, (φ x : ℂ)*d x)) : + (d : E → ℂ) =ᵐ[volume] fun x => fderiv ℝ F x a := by + apply weak_directional_unique (f := F) a + ((Lp.memLp d).locallyIntegrable (by norm_num)) + (((hFs.continuous_fderiv (by simp)).clm_apply continuous_const).locallyIntegrable) + · intro φ hφ hφC + rw [← hd φ hφ hφC] + apply integral_congr_ae + filter_upwards [hu] with x hx + rw [hx] + · exact smooth_compact_weak_directional F hFs hFc a + +lemma weak_directional_smooth_norm_sq {u d : Lp ℂ 2 (volume : Measure E)} + (a : E) (F : E → ℂ) (hFs : ContDiff ℝ ∞ F) (hFc : HasCompactSupport F) + (hu : (u : E → ℂ) =ᵐ[volume] F) + (hd : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x a : ℂ)*u x) = -(∫ x, (φ x : ℂ)*d x)) : + (∫ x, ‖fderiv ℝ F x a‖^2) = ‖d‖^2 := by + have he := weak_directional_eq_smooth a F hFs hFc hu hd + calc + _ = ∫ x, ‖d x‖^2 := integral_congr_ae (he.mono (fun x hx => by dsimp only at hx ⊢; rw [hx])) + _ = ‖d‖^2 := by + apply Complex.ofReal_injective + rw [← integral_complex_ofReal] + calc + _ = inner ℂ d d := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [] with x + simp [inner_self_eq_norm_sq_to_K, Complex.ofReal_pow] + _ = _ := by simp [inner_self_eq_norm_sq_to_K, Complex.ofReal_pow] +end Coulomb + +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WedgeMultiplicity.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WedgeMultiplicity.lean new file mode 100644 index 0000000000000000000000000000000000000000..33ee27c897de945bdcea5fd07cf1cb16ffe15406 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WedgeMultiplicity.lean @@ -0,0 +1,252 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.NormSqSumCosets + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +namespace Coulomb +lemma mass_permutation {n : ℕ} (u : H1Vector n) (p : Equiv.Perm (Fin n)) : + mass (u.permutation p) = mass u := by + calc + _ = mass (u.pullback (permutationIsometry p)) := by + unfold mass + change (∑ s, ∫ x, ‖(u.pullback (permutationIsometry p)).value (permutationSpins p s) x‖^2) = _ + exact Equiv.sum_comp (permutationSpins p) (fun s => ∫ x, ‖(u.pullback (permutationIsometry p)).value s x‖^2) + _ = _ := mass_pullback _ _ +lemma kinetic_permutation {n : ℕ} (u : H1Vector n) (p : Equiv.Perm (Fin n)) : + kinetic (u.permutation p) = kinetic u := by + calc + _ = kinetic (u.pullback (permutationIsometry p)) := by + unfold kinetic + congr 1 + change (∑ s, ∑ a, ∫ x, ‖(u.pullback (permutationIsometry p)).gradient (permutationSpins p s) a x‖^2) = _ + exact Equiv.sum_comp (permutationSpins p) (fun s => ∑ a, ∫ x, ‖(u.pullback (permutationIsometry p)).gradient s a x‖^2) + _ = _ := kinetic_pullback _ _ + +lemma mass_fullAntisymmetrize_of_sq {n : ℕ} (u : H1Vector n) (c : ℝ) + (h : ∀ s, ∀ᵐ x ∂volume, ‖u.fullAntisymmetrize.value s x‖^2 = + c*∑ p : Equiv.Perm (Fin n), ‖(u.permutation p).value s x‖^2) : + mass u.fullAntisymmetrize = c*(Fintype.card (Equiv.Perm (Fin n)) : ℝ)*mass u := by + have hi (s : Spins n) : (∫ x, ‖u.fullAntisymmetrize.value s x‖^2) = + c*∑ p : Equiv.Perm (Fin n), ∫ x, ‖(u.permutation p).value s x‖^2 := by + rw [integral_congr_ae (h s), integral_const_mul, + integral_finsetSum _ (fun p _ => ((u.permutation p).value_L2 s).norm.integrable_sq)] + unfold mass + simp_rw [hi] + rw [← Finset.mul_sum, Finset.sum_comm] + change c*(∑ p : Equiv.Perm (Fin n), mass (u.permutation p)) = _ + simp_rw [mass_permutation] + simp [mass, mul_assoc] + +lemma kinetic_fullAntisymmetrize_of_sq {n : ℕ} (u : H1Vector n) (c : ℝ) + (h : ∀ s a, ∀ᵐ x ∂volume, ‖u.fullAntisymmetrize.gradient s a x‖^2 = + c*∑ p : Equiv.Perm (Fin n), ‖(u.permutation p).gradient s a x‖^2) : + kinetic u.fullAntisymmetrize = c*(Fintype.card (Equiv.Perm (Fin n)) : ℝ)*kinetic u := by + have hi (s : Spins n) (a : Fin n × Fin 3) : (∫ x, ‖u.fullAntisymmetrize.gradient s a x‖^2) = + c*∑ p : Equiv.Perm (Fin n), ∫ x, ‖(u.permutation p).gradient s a x‖^2 := by + rw [integral_congr_ae (h s a), integral_const_mul, + integral_finsetSum _ (fun p _ => ((u.permutation p).partial_L2 s a).norm.integrable_sq)] + have hf : (∑ s, ∑ a, ∫ x, ‖u.fullAntisymmetrize.gradient s a x‖^2) = + c*∑ p : Equiv.Perm (Fin n), ∑ s, ∑ a, ∫ x, ‖(u.permutation p).gradient s a x‖^2 := by + simp_rw [hi, ← Finset.mul_sum] + congr 1 + simp_rw [Finset.sum_comm (γ := Fin n × Fin 3)] + rw [Finset.sum_comm] + unfold kinetic + rw [hf] + calc + _ = c*∑ p : Equiv.Perm (Fin n), kinetic (u.permutation p) := by + simp only [kinetic, Finset.mul_sum] + apply Finset.sum_congr rfl + intro p _ + ring_nf + _ = _ := by + simp_rw [kinetic_permutation] + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + change c*((Fintype.card (Equiv.Perm (Fin n)) : ℝ)*kinetic u) = _ + unfold kinetic + ring + +lemma mass_scale {n : ℕ} (u : H1Vector n) (c : ℂ) : + mass (u.scale c) = ‖c‖^2*mass u := by + simp only [mass,H1Vector.scale,norm_mul,mul_pow,integral_const_mul,← Finset.mul_sum] +lemma kinetic_scale {n : ℕ} (u : H1Vector n) (c : ℂ) : + kinetic (u.scale c) = ‖c‖^2*kinetic u := by + simp only [kinetic,H1Vector.scale,norm_mul,mul_pow,integral_const_mul,← Finset.mul_sum] + ring +lemma antisymmetric_scale {n : ℕ} (u : H1Vector n) (hu : Antisymmetric u) (c : ℂ) : + Antisymmetric (u.scale c) := by + intro p s + filter_upwards [hu p s] with x hx + change c*u.value (s ∘ p) (permute p x) = ((p.sign : ℤ) : ℂ)*(c*u.value s x) + rw [hx] + ring + +def wedgeMultiplicity (m k : ℕ) : ℝ := + (Fintype.card (blockGroup m k) : ℝ)*(Fintype.card (Equiv.Perm (Fin (m+k))) : ℝ) + +lemma wedgeMultiplicity_pos (m k : ℕ) : 0 < wedgeMultiplicity m k := by + unfold wedgeMultiplicity + positivity + +def H1Vector.wedge {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : H1Vector (m+k) := + (u.tensor v).fullAntisymmetrize.scale ((Real.sqrt (wedgeMultiplicity m k))⁻¹ : ℝ) + +lemma wedge_normalizer_sq (m k : ℕ) : + ‖(((Real.sqrt (wedgeMultiplicity m k))⁻¹ : ℝ) : ℂ)‖^2 = (wedgeMultiplicity m k)⁻¹ := by + rw [Complex.norm_real, Real.norm_eq_abs, sq_abs, inv_pow, + Real.sq_sqrt (le_of_lt (wedgeMultiplicity_pos m k))] + +lemma wedge_antisymmetric {m k : ℕ} (u : H1Vector m) (v : H1Vector k) : + Antisymmetric (u.wedge v) := + antisymmetric_scale _ (fullAntisymmetrize_antisymmetric _) _ + +lemma mass_wedge {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) (A B : Set Space) + (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) (hAB : Disjoint A B) : + mass (u.wedge v) = mass u*mass v := by + unfold H1Vector.wedge + rw [mass_scale, wedge_normalizer_sq, + mass_fullAntisymmetrize_of_sq (u.tensor v) _ + (separated_fullAntisymmetrize_value_sq u v hu hv A B hsu hsv hAB)] + change (wedgeMultiplicity m k)⁻¹*(wedgeMultiplicity m k*mass (u.tensor v)) = _ + rw [← mul_assoc, inv_mul_cancel₀ (ne_of_gt (wedgeMultiplicity_pos m k)), one_mul, mass_tensor] + +lemma kinetic_wedge {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) (A B : Set Space) + (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) + (hA : IsClosed A) (hB : IsClosed B) (hAB : Disjoint A B) : + kinetic (u.wedge v) = kinetic u*mass v+mass u*kinetic v := by + unfold H1Vector.wedge + rw [kinetic_scale, wedge_normalizer_sq, + kinetic_fullAntisymmetrize_of_sq (u.tensor v) _ + (separated_fullAntisymmetrize_gradient_sq u v hu hv A B hsu hsv hA hB hAB)] + change (wedgeMultiplicity m k)⁻¹*(wedgeMultiplicity m k*kinetic (u.tensor v)) = _ + rw [← mul_assoc, inv_mul_cancel₀ (ne_of_gt (wedgeMultiplicity_pos m k)), one_mul, kinetic_tensor] + +def potentialEnergy {n : ℕ} (W : Configuration n → ℝ) (u : H1Vector n) : ℝ := + ∑ s, ∫ x, W x*‖u.value s x‖^2 + +lemma permute_integral_real {n : ℕ} (p : Equiv.Perm (Fin n)) (F : Configuration n → ℝ) : + (∫ x, F (permute p x)) = ∫ x, F x := by + exact (show MeasurePreserving (permutationIsometry p).toHomeomorph.toMeasurableEquiv + volume volume from (permutationIsometry p).measurePreserving).integral_comp' F + +lemma potential_integrable_permutation {n : ℕ} (W : Configuration n → ℝ) + (hW : ∀ p x, W (permute p x) = W x) (u : H1Vector n) + (hi : ∀ s, Integrable (fun x => W x*‖u.value s x‖^2)) + (p : Equiv.Perm (Fin n)) (s : Spins n) : + Integrable (fun x => W x*‖(u.permutation p).value s x‖^2) := by + have H := (permute_measurePreserving p).integrable_comp_of_integrable (hi (s ∘ p)) + simpa only [Function.comp_def, hW, permutation_value] using H + +lemma potentialEnergy_permutation {n : ℕ} (W : Configuration n → ℝ) + (hW : ∀ p x, W (permute p x) = W x) (u : H1Vector n) + (p : Equiv.Perm (Fin n)) : potentialEnergy W (u.permutation p) = potentialEnergy W u := by + unfold potentialEnergy + have H (s : Spins n) : (∫ x, W x*‖(u.permutation p).value s x‖^2) = + ∫ x, W x*‖u.value (s ∘ p) x‖^2 := by + simpa only [hW, permutation_value] using + (permute_integral_real p (fun x => W x*‖u.value (s ∘ p) x‖^2)) + simp_rw [H] + exact Equiv.sum_comp (permutationSpins p) (fun s => ∫ x, W x*‖u.value s x‖^2) + +lemma potentialEnergy_fullAntisymmetrize_of_sq {n : ℕ} (u : H1Vector n) (c : ℝ) + (W : Configuration n → ℝ) (hW : ∀ p x, W (permute p x) = W x) + (hi : ∀ s, Integrable (fun x => W x*‖u.value s x‖^2)) + (h : ∀ s, ∀ᵐ x ∂volume, ‖u.fullAntisymmetrize.value s x‖^2 = + c*∑ p : Equiv.Perm (Fin n), ‖(u.permutation p).value s x‖^2) : + potentialEnergy W u.fullAntisymmetrize = + c*(Fintype.card (Equiv.Perm (Fin n)) : ℝ)*potentialEnergy W u := by + have he (s : Spins n) : (∫ x, W x*‖u.fullAntisymmetrize.value s x‖^2) = + c*∑ p : Equiv.Perm (Fin n), ∫ x, W x*‖(u.permutation p).value s x‖^2 := by + rw [integral_congr_ae ((h s).mono (fun x hx => congrArg (W x*·) hx))] + simp_rw [mul_left_comm (W _) c, Finset.mul_sum] + rw [integral_finsetSum _ + (fun p _ => (potential_integrable_permutation W hW u hi p s).const_mul c)] + simp only [integral_const_mul] + unfold potentialEnergy + simp_rw [he] + rw [← Finset.mul_sum, Finset.sum_comm] + change c*(∑ p : Equiv.Perm (Fin n), potentialEnergy W (u.permutation p)) = _ + simp_rw [potentialEnergy_permutation W hW] + simp [potentialEnergy, mul_assoc] + +lemma potentialEnergy_scale {n : ℕ} (W : Configuration n → ℝ) (u : H1Vector n) (c : ℂ) : + potentialEnergy W (u.scale c) = ‖c‖^2*potentialEnergy W u := by + simp only [potentialEnergy,H1Vector.scale,norm_mul,mul_pow] + simp_rw [mul_left_comm (W _) (‖c‖^2),integral_const_mul,← Finset.mul_sum] + +lemma potentialEnergy_wedge {m k : ℕ} (u : H1Vector m) (v : H1Vector k) + (hu : Antisymmetric u) (hv : Antisymmetric v) (A B : Set Space) + (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) (hAB : Disjoint A B) + (W : Configuration (m+k) → ℝ) (hW : ∀ p x, W (permute p x) = W x) + (hi : ∀ s, Integrable (fun x => W x*‖(u.tensor v).value s x‖^2)) : + potentialEnergy W (u.wedge v) = potentialEnergy W (u.tensor v) := by + unfold H1Vector.wedge + rw [potentialEnergy_scale, wedge_normalizer_sq, + potentialEnergy_fullAntisymmetrize_of_sq (u.tensor v) _ W hW hi + (separated_fullAntisymmetrize_value_sq u v hu hv A B hsu hsv hAB)] + change (wedgeMultiplicity m k)⁻¹*(wedgeMultiplicity m k*potentialEnergy W (u.tensor v)) = _ + rw [← mul_assoc, inv_mul_cancel₀ (ne_of_gt (wedgeMultiplicity_pos m k)), one_mul] +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Weighted.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Weighted.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b4fc3dc2d019bb1d6f51d937305f0fbdaec3ae7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/Weighted.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.HighProjection +import OAI.Analysis.CoulombRadii.Localization.DyadicTailPartial + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +namespace Coulomb + +lemma FermionicCoefficients.weighted_eq {n : ℕ} {α : Type*} + {f : (Fin n → α) → ℂ} (hf : FermionicCoefficients f) + (w : α → ℝ) (i j : Fin n) : + (∑' b, w (b i) * ‖f b‖^2) = ∑' b, w (b j) * ‖f b‖^2 := by + classical + let p := Equiv.swap i j + have he := (coefficientPermEquiv (α := α) p).tsum_eq + (fun b => w (b i) * ‖f b‖^2) + change (∑' b, w ((b ∘ p) i) * ‖f (b ∘ p)‖^2) = _ at he + simp only [Function.comp_apply, p, Equiv.swap_apply_left, hf.norm_permute] at he + exact he.symm + +lemma FermionicCoefficients.weighted_summable {n : ℕ} {α : Type*} + {f : (Fin n → α) → ℂ} {w : α → ℝ} (hw : ∀ a, 0 ≤ w a) + (hs : Summable (fun b => (∑ j, w (b j)) * ‖f b‖^2)) (i : Fin n) : + Summable (fun b => w (b i) * ‖f b‖^2) := by + apply Summable.of_nonneg_of_le (fun b => mul_nonneg (hw _) (sq_nonneg _)) _ hs + intro b + exact mul_le_mul_of_nonneg_right + (Finset.single_le_sum (fun j _ => hw (b j)) (Finset.mem_univ i)) (sq_nonneg _) + +lemma FermionicCoefficients.weighted_sum {n : ℕ} {α : Type*} + {f : (Fin n → α) → ℂ} (hf : FermionicCoefficients f) + {w : α → ℝ} (hw : ∀ a, 0 ≤ w a) + (hs : Summable (fun b => (∑ j, w (b j)) * ‖f b‖^2)) (i : Fin n) : + (n : ℝ) * (∑' b, w (b i) * ‖f b‖^2) = + ∑' b, (∑ j, w (b j)) * ‖f b‖^2 := by + simp_rw [Finset.sum_mul] + rw [Summable.tsum_finsetSum (fun j _ => weighted_summable hw hs j)] + simp_rw [hf.weighted_eq w _ i] + simp + +end Coulomb +open MeasureTheory Set Filter +open scoped ENNReal NNReal +namespace Coulomb + +lemma nonneg_integrable_series {A ι : Type*} [MeasurableSpace A] [Countable ι] + {μ : Measure A} (F : ι → A → ℝ) (hF0 : ∀ i x, 0 ≤ F i x) + (hFi : ∀ i, Integrable (F i) μ) (hs : Summable (fun i => ∫ x, F i x ∂μ)) : + (∀ᵐ x ∂μ, Summable (fun i => F i x)) ∧ + Integrable (fun x => ∑' i, F i x) μ ∧ + (∫ x, ∑' i, F i x ∂μ) = ∑' i, ∫ x, F i x ∂μ := by + have hm (i : ι) : AEMeasurable (fun x => ENNReal.ofReal (F i x)) μ := + (hFi i).1.aemeasurable.ennreal_ofReal + have he (i : ι) : eLpNorm (F i) 1 μ = ENNReal.ofReal (∫ x, F i x ∂μ) := by + rw [eLpNorm_one_eq_lintegral_enorm (hFi i).1] + simp_rw [Real.enorm_of_nonneg (hF0 i _)] + exact (ofReal_integral_eq_lintegral_ofReal (hFi i) (ae_of_all μ (hF0 i))).symm + have hfin : (∑' i, eLpNorm (F i) 1 μ) ≠ ∞ := by + simp_rw [he] + rw [← ENNReal.ofReal_tsum_of_nonneg (fun i => integral_nonneg (hF0 i)) hs] + exact ENNReal.ofReal_ne_top + have has : ∀ᵐ x ∂μ, Summable (fun i => F i x) := by + have H := summable_norm_of_tsum_eLpNorm_ne_top (p := 1) le_rfl hfin + simpa only [Real.norm_of_nonneg (hF0 _ _)] using H + have hsum : (∫⁻ x, ∑' i, ENNReal.ofReal (F i x) ∂μ) ≠ ∞ := by + rw [lintegral_tsum hm] + convert hfin using 2 + funext i + rw [eLpNorm_one_eq_lintegral_enorm (hFi i).1] + simp only [Real.enorm_of_nonneg (hF0 _ _)] + have ht := integrable_toReal_of_lintegral_ne_top (AEMeasurable.tsum hm) hsum + have hti : Integrable (fun x => ∑' i, F i x) μ := by + apply ht.congr + filter_upwards [has] with x hx + rw [← ENNReal.ofReal_tsum_of_nonneg (fun i => hF0 i x) hx, + ENNReal.toReal_ofReal (tsum_nonneg (fun i => hF0 i x))] + refine ⟨has, hti, ?_⟩ + exact (integral_tsum_of_summable_integral_norm hFi + (by simpa only [Real.norm_of_nonneg (hF0 _ _)] using hs)).symm + +noncomputable def firstParticleDensity {A : Type*} [MeasurableSpace A] + {μ : Measure A} {n : ℕ} (f : (Fin (n+1) → A) → ℂ) (x : A) : ℝ := + ((n+1:ℕ):ℝ)*(∫ y : Fin n → A, ‖firstFiber f (y,x)‖^2 ∂(Measure.pi fun _ => μ)) + +noncomputable def highParticleDensity {A ι : Type*} [MeasurableSpace A] + {μ : Measure A} {n : ℕ} (v : ι → A → ℂ) (s : Finset ι) + (f : (Fin (n+1) → A) → ℂ) (x : A) : ℝ := + ((n+1:ℕ):ℝ)*(∫ y : Fin n → A, + ‖highProjection (μ := μ) v s (firstFiber f) (y,x)‖^2 ∂(Measure.pi fun _ => μ)) + +lemma firstParticleDensity_integrable {A : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) : + Integrable (firstParticleDensity (μ := μ) f) μ := + (firstFiber_memLp hf).norm.integrable_sq.integral_prod_right.const_mul _ + +lemma highParticleDensity_integrable {A ι : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) (s : Finset ι) : + Integrable (highParticleDensity (μ := μ) v s f) μ := + (highProjection_memLp v hv s (firstFiber_memLp hf)).norm.integrable_sq.integral_prod_right.const_mul _ + +lemma highParticleDensity_integral {A ι : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] [Countable ι] {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) (s : Finset ι) : + (∫ x, highParticleDensity (μ := μ) v s f x ∂μ) = + ((n+1:ℕ):ℝ)*(∑' b, if b 0 ∈ s then 0 else ‖scalarCoefficient (μ := μ) f v b‖^2) := by + simp only [highParticleDensity] + rw [integral_const_mul, ← integral_prod_symm _ + (highProjection_memLp v hv s (firstFiber_memLp hf)).norm.integrable_sq, + highProjection_norm_spectrum v hv ho hc hf s] + +lemma high_density_spectral_series {A ι : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] [Countable ι] {n : ℕ} {f : (Fin (n+1) → A) → ℂ} + (hf : MemLp f 2 (Measure.pi fun _ => μ)) (ha : ProductAntisymmetric (μ := μ) f) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) (s : ℕ → Finset ι) (w : ι → ℝ) + (hw : ∀ a, 0 ≤ w a) (hcut : ∀ k a, a ∉ s k → (4:ℝ)^k < w a) + (hs : Summable (fun b : Fin (n+1) → ι => (∑ j, w (b j))* + ‖scalarCoefficient (μ := μ) f v b‖^2)) : + Summable (fun k : ℕ => (4:ℝ)^k * ∫ x, highParticleDensity (μ := μ) v (s k) f x ∂μ) ∧ + (∑' k : ℕ, (4:ℝ)^k * ∫ x, highParticleDensity (μ := μ) v (s k) f x ∂μ) ≤ + (4/3:ℝ)*(∑' b : Fin (n+1) → ι, (∑ j, w (b j))* + ‖scalarCoefficient (μ := μ) f v b‖^2) := by + classical + let c := scalarCoefficient (μ := μ) f v + have hc2 : Summable (fun b => ‖c b‖^2) := scalarCoefficient_summable f hf v hv ho + have hsingle := FermionicCoefficients.weighted_summable hw hs (0 : Fin (n+1)) + have H := dyadic_spectral_tail_bound (fun b : Fin (n+1) → ι => w (b 0)) + (fun b => ‖c b‖^2) (fun b => hw (b 0)) (fun b => sq_nonneg _) hsingle + have hsum (k : ℕ) : Summable (fun b : Fin (n+1) → ι => + if (4:ℝ)^k < w (b 0) then ‖c b‖^2 else 0) := + Summable.of_nonneg_of_le (fun b => by positivity) + (fun b => by split_ifs <;> simp) hc2 + have hcomp (k : ℕ) : (∫ x, highParticleDensity (μ := μ) v (s k) f x ∂μ) ≤ + ((n+1:ℕ):ℝ)*(∑' b : Fin (n+1) → ι, if (4:ℝ)^k < w (b 0) then ‖c b‖^2 else 0) := by + rw [highParticleDensity_integral hf v hv ho hc] + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Summable.tsum_le_tsum _ _ (hsum k) + · intro b + by_cases hb : b 0 ∈ s k + · simp only [hb, ite_true]; positivity + · simp only [hb, ite_false, hcut k (b 0) hb, ite_true] + exact le_rfl + · change Summable (fun b => if b 0 ∈ s k then 0 else ‖c b‖^2) + exact Summable.of_nonneg_of_le (fun b => by positivity) + (fun b => by split_ifs <;> simp) hc2 + have hl (k : ℕ) : 0 ≤ (4:ℝ)^k * ∫ x, highParticleDensity (μ := μ) v (s k) f x ∂μ := by + apply mul_nonneg (by positivity) + exact integral_nonneg (fun x => mul_nonneg (by positivity) (integral_nonneg (fun y => sq_nonneg _))) + have hb (k : ℕ) : (4:ℝ)^k * ∫ x, highParticleDensity (μ := μ) v (s k) f x ∂μ ≤ + ((n+1:ℕ):ℝ)*((4:ℝ)^k * ∑' b : Fin (n+1) → ι, + if (4:ℝ)^k < w (b 0) then ‖c b‖^2 else 0) := by + simpa only [mul_left_comm ((4:ℝ)^k)] using mul_le_mul_of_nonneg_left (hcomp k) (by positivity : 0 ≤ (4:ℝ)^k) + have hs' := Summable.of_nonneg_of_le hl hb (H.1.mul_left ((n+1:ℕ):ℝ)) + refine ⟨hs', ?_⟩ + calc + _ ≤ ((n+1:ℕ):ℝ)*(∑' k : ℕ, (4:ℝ)^k * ∑' b : Fin (n+1) → ι, + if (4:ℝ)^k < w (b 0) then ‖c b‖^2 else 0) := by + simpa only [tsum_mul_left] using hs'.tsum_le_tsum hb (H.1.mul_left ((n+1:ℕ):ℝ)) + _ ≤ ((n+1:ℕ):ℝ)*((4/3:ℝ)*(∑' b : Fin (n+1) → ι, w (b 0)*‖c b‖^2)) := + mul_le_mul_of_nonneg_left H.2 (by positivity) + _ = _ := by + rw [mul_left_comm, (scalarCoefficient_antisymmetric ha v).weighted_sum hw hs] + +end Coulomb + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedExchangeAlgebra.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedExchangeAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..e799bc7a0ec7af43ad0aebc84431b822d30b1fc8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedExchangeAlgebra.lean @@ -0,0 +1,266 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.DeterminantBodyReal +import OAI.Analysis.CoulombRadii.FieldAnalysis.Occupancy + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma weighted_exchange_algebra {A ι : Type*} [Fintype ι] + (v : ι → A → ℂ) (lam : ι → ℝ) (x y : A) : + (∑ i, ∑ j, (lam i : ℂ)*(lam j : ℂ)* + ((star (v i x)*v j x)*(star (v j y)*v i y))) = + (↑(‖∑ i, (lam i : ℂ)*(v i x*star (v i y))‖^2) : ℂ) := by + have hs (r : ℝ) : star (r : ℂ) = (r : ℂ) := Complex.conj_ofReal r + rw [← complex_star_mul_self] + simp only [star_sum, star_mul, star_star, hs, Finset.sum_mul, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma weighted_exchange_integral {A ι : Type*} [MeasurableSpace A] [Fintype ι] + (μ : Measure A) (v : ι → A → ℂ) (lam : ι → ℝ) (W : A → A → ℝ) + (hW : ∀ i j, Integrable (fun xy : A × A => (W xy.1 xy.2 : ℂ)* + ((star (v i xy.1)*v j xy.1)*(star (v j xy.2)*v i xy.2))) (μ.prod μ)) : + (∑ i, ∑ j, (lam i : ℂ)*(lam j:ℂ)* + (∫ xy : A × A, (W xy.1 xy.2 : ℂ)* + ((star (v i xy.1)*v j xy.1)*(star (v j xy.2)*v i xy.2)) ∂(μ.prod μ))) = + (↑(∫ xy : A × A, W xy.1 xy.2 * + ‖∑ i, (lam i : ℂ)*(v i xy.1*star (v i xy.2))‖^2 ∂(μ.prod μ)) : ℂ) := by + simp_rw [← integral_const_mul] + calc + _ = ∫ xy : A × A, ∑ i, ∑ j, (lam i : ℂ)*(lam j:ℂ)*((W xy.1 xy.2 : ℂ)* + ((star (v i xy.1)*v j xy.1)*(star (v j xy.2)*v i xy.2))) ∂(μ.prod μ) := by + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => + (hW i j).const_mul _))] + apply Finset.sum_congr rfl + intro i _ + exact (integral_finsetSum _ (fun j _ => (hW i j).const_mul _)).symm + _ = ∫ xy : A × A, ((W xy.1 xy.2 * + ‖∑ i, (lam i : ℂ)*(v i xy.1*star (v i xy.2))‖^2 : ℝ) : ℂ) ∂(μ.prod μ) := by + apply integral_congr_ae + filter_upwards [] with xy + rw [Complex.ofReal_mul, ← weighted_exchange_algebra v lam xy.1 xy.2] + simp only [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + _ = _ := integral_complex_ofReal + +lemma weighted_slaterPairEntry_upper {A ι : Type*} [MeasurableSpace A] [Fintype ι] + (μ : Measure A) (v : ι → A → ℂ) (lam : ι → ℝ) (W : A → A → ℝ) + (hW : ∀ a b c d, Integrable (fun xy : A × A => (W xy.1 xy.2 : ℂ)* + ((star (v a xy.1)*v c xy.1)*(star (v b xy.2)*v d xy.2))) (μ.prod μ)) + (hW0 : ∀ x y, 0 ≤ W x y) : + (∑ i, ∑ j, lam i*lam j*slaterPairEntry μ v W i j) ≤ + ∫ xy : A × A, W xy.1 xy.2 * + ((∑ i, lam i*‖v i xy.1‖^2)*(∑ j, lam j*‖v j xy.2‖^2)) ∂(μ.prod μ) := by + have hd (i j : ι) : Integrable + (fun xy : A × A => W xy.1 xy.2*(‖v i xy.1‖^2*‖v j xy.2‖^2)) (μ.prod μ) := by + have h := (hW i j i j).re + simp only [complex_star_mul_self, ← Complex.ofReal_mul] at h + change Integrable (fun xy : A × A => (↑(W xy.1 xy.2*(‖v i xy.1‖^2*‖v j xy.2‖^2)) : ℂ).re) _ at h + simpa only [Complex.ofReal_re] using h + have he := congrArg Complex.re (weighted_exchange_integral μ v lam W (fun i j => hW i j j i)) + simp only [Complex.re_sum, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, Complex.ofReal_im, + mul_zero, zero_mul, sub_zero, add_zero] at he + simp only [slaterPairEntry, complex_star_mul_self, ← Complex.ofReal_mul, + integral_complex_ofReal, Complex.ofReal_re, mul_sub, Finset.sum_sub_distrib] + rw [he] + have hdir : (∑ i, ∑ j, lam i*lam j* + (∫ xy : A × A, W xy.1 xy.2*(‖v i xy.1‖^2*‖v j xy.2‖^2) ∂(μ.prod μ))) = + ∫ xy : A × A, W xy.1 xy.2 * + ((∑ i, lam i*‖v i xy.1‖^2)*(∑ j, lam j*‖v j xy.2‖^2)) ∂(μ.prod μ) := by + simp_rw [← integral_const_mul] + calc + _ = ∫ xy : A × A, ∑ i, ∑ j, lam i*lam j * + (W xy.1 xy.2*(‖v i xy.1‖^2*‖v j xy.2‖^2)) ∂(μ.prod μ) := by + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => (hd i j).const_mul _))] + apply Finset.sum_congr rfl + intro i _ + exact (integral_finsetSum _ (fun j _ => (hd i j).const_mul _)).symm + _ = _ := by + apply integral_congr_ae + filter_upwards [] with xy + simp only [Finset.sum_mul, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + rw [hdir] + exact sub_le_self _ (integral_nonneg (fun xy => mul_nonneg (hW0 _ _) (sq_nonneg _))) + +lemma bernoulli_chosen_sum {ι : Type*} [Fintype ι] (lam f : ι → ℝ) : + (∑ w : ι → Bool, bernoulliWeight lam w * ∑ a, f (occupiedIndex w a)) = + ∑ i, lam i*f i := by + simp_rw [sum_occupiedIndex_real] + exact bernoulli_linear_mean lam f + +lemma bernoulli_slater_pair_upper {A ι : Type*} [MeasurableSpace A] [Fintype ι] + {μ : Measure A} [SigmaFinite μ] (v : ι → A → ℂ) (W : A → A → ℝ) + (lam : ι → ℝ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x)*v b x ∂μ) = if a = b then (1:ℂ) else 0) + (hW : ∀ a b c d, Integrable (fun xy : A × A => (W xy.1 xy.2 : ℂ) * + ((star (v a xy.1)*v c xy.1)*(star (v b xy.2)*v d xy.2))) (μ.prod μ)) + (hW0 : ∀ x y, 0 ≤ W x y) : + (∑ w : ι → Bool, bernoulliWeight lam w * + (∫ x : Fin (Fintype.card {i // w i = true}) → A, + (∑ i, ∑ j ∈ Finset.univ.erase i, W (x i) (x j)) * + ‖slaterWave (fun a => v (occupiedIndex w a)) x‖^2 ∂(Measure.pi fun _ => μ))) ≤ + ∫ xy : A × A, W xy.1 xy.2 * + ((∑ i, lam i*‖v i xy.1‖^2)*(∑ j, lam j*‖v j xy.2‖^2)) ∂(μ.prod μ) := by + rw [bernoulli_slater_pair_mean v W lam hv ho hW] + exact weighted_slaterPairEntry_upper μ v lam W hW hW0 + +noncomputable def selectedSlater {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) (w : ι → Bool) : + H1Vector (Fintype.card {i // w i = true}) := + slaterState (fun index => v (occupiedIndex w index)) + (fun index spin => hv (occupiedIndex w index) spin) + (fun index spin => hC (occupiedIndex w index) spin) + +lemma selectedSlater_antisymmetric {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) (w : ι → Bool) : + Antisymmetric (selectedSlater v hv hC w) := + slaterState_antisymmetric _ _ _ + +lemma selectedSlater_normalized {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) (w : ι → Bool) : + mass (selectedSlater v hv hC w) = 1 := by + apply slaterState_normalized + intro a b + simp only [ho, (occupiedIndex w).injective.eq_iff] + +lemma bernoulli_slater_kinetic_mean {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) (lam : ι → ℝ) : + (∑ w : ι → Bool, bernoulliWeight lam w * kinetic (selectedSlater v hv hC w)) = + (1/2:ℝ)*∑ i, lam i * ∑ s, ∑ b : Fin 3, + ∫ x : Space, ‖fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)‖^2 := by + have hk (w : ι → Bool) := slaterState_kinetic + (fun a => v (occupiedIndex w a)) (fun a s => hv _ s) (fun a s => hC _ s) + (fun a b => by simp only [ho, (occupiedIndex w).injective.eq_iff]) + simp only [selectedSlater, hk] + simp_rw [mul_left_comm (bernoulliWeight lam _) (1/2:ℝ)] + rw [← Finset.mul_sum] + congr 1 + exact bernoulli_chosen_sum lam (fun i => ∑ s, ∑ b : Fin 3, + ∫ x : Space, ‖fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)‖^2) + +noncomputable def finiteFermiDensity {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) (lam : ι → ℝ) (x : Space) : ℝ := + ∑ i, lam i * ∑ s, ‖v i x s‖^2 + +lemma selectedSlater_density {ι : Type*} [Fintype ι] + (v : ι → Space → Fin 2 → ℂ) (w : ι → Bool) (x : Space) : + slaterDensity (fun a => v (occupiedIndex w a)) x = + ∑ i, occupancy (w i)*∑ s, ‖v i x s‖^2 := + sum_occupiedIndex_real w (fun i => ∑ s, ‖v i x s‖^2) + +lemma finiteFermiDensity_nuclear_integrable {ι : Type*} [Fintype ι] {M : ℕ} + (S : Nuclei M) (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) (lam : ι → ℝ) : + Integrable (fun x => attraction S x*finiteFermiDensity v lam x) := by + have hi (i : ι) (s : Fin 2) : Integrable (fun x => attraction S x*‖v i x s‖^2) := by + have h := compact_attraction_cross_integrable S (fun x => v i x s) (fun x => v i x s) + (hv i s).continuous (hv i s).continuous (hC i s) + simp_rw [complex_star_mul_self, ← Complex.ofReal_mul] at h + exact h.re + have H := integrable_finsetSum Finset.univ (fun i _ => + (integrable_finsetSum Finset.univ (fun s _ => hi i s)).const_mul (lam i)) + apply H.congr + filter_upwards [] with x + simp only [finiteFermiDensity, Finset.mul_sum] + congr 1 + funext i + congr 1 + funext s + ring + +lemma bernoulli_slater_nuclear_mean {ι : Type*} [Fintype ι] {M : ℕ} + (S : Nuclei M) (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ a b, (∑ s : Fin 2, ∫ x : Space, star (v a x s)*v b x s) = + if a = b then (1:ℂ) else 0) (lam : ι → ℝ) : + (∑ w : ι → Bool, bernoulliWeight lam w * nuclearEnergy S (selectedSlater v hv hC w)) = + ∫ x, attraction S x*finiteFermiDensity v lam x := by + have hn (w : ι → Bool) := slaterState_nuclear S + (fun a => v (occupiedIndex w a)) (fun a s => hv _ s) (fun a s => hC _ s) + (fun a b => by simp only [ho, (occupiedIndex w).injective.eq_iff]) + simp only [selectedSlater, hn, selectedSlater_density] + simp_rw [← integral_const_mul] + rw [← integral_finsetSum _ (fun w _ => + (finiteFermiDensity_nuclear_integrable S v hv hC (fun i => occupancy (w i))).const_mul _)] + apply integral_congr_ae + filter_upwards [] with x + simp_rw [mul_left_comm (bernoulliWeight lam _) (attraction S x)] + rw [← Finset.mul_sum, bernoulli_linear_mean] + rfl +end Coulomb + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedExterior.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedExterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd44a41e76890d2be341c95b79f857833659c08d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedExterior.lean @@ -0,0 +1,121 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.WeightedInner +import OAI.Analysis.CoulombRadii.Localization.DeletionEnvelope + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +lemma weighted_raw_inner_exterior_abs_le {J n : ℕ} (S : Nuclei J) + (hatom : ∀ j, S.position j=0) {t h : ℝ} (ht : 0 by simpa only [hatom j,sub_zero] using hy) + rw [abs_of_nonneg (attraction_nonneg S y)] at HB + rw [abs_mul] + exact (mul_le_mul_of_nonneg_right (hw y) (abs_nonneg _)).trans + (by simpa only [one_mul] using HB.trans (add_le_add HA le_rfl)) + · rw [hws y (lt_of_not_ge hy),zero_mul,abs_zero] + exact add_nonneg (div_nonneg (totalCharge_nonneg S) ht.le) (by positivity) + +lemma weightedInnerField_exterior_abs_le {J n : ℕ} (S : Nuclei J) + (hatom : ∀ j, S.position j=0) {t h : ℝ} (ht : 0 + weighted_raw_inner_exterior_abs_le S hatom ht hh hw hws (position x i) x) + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] using H + +lemma potentialForm_bounded_tendsto {n : ℕ} (u : H1Vector n) + {F : ℕ → Configuration n → ℝ} {G : Configuration n → ℝ} {B : ℝ} + (hF : ∀ k, Measurable (F k)) (hb : ∀ k x, |F k x| ≤ B) + (hlim : ∀ x, Tendsto (fun k => F k x) atTop (𝓝 (G x))) : + Tendsto (fun k => potentialForm (F k) u) atTop (𝓝 (potentialForm G u)) := by + apply tendsto_finsetSum + intro s _ + apply tendsto_integral_of_dominated_convergence (fun x => B*‖u.value s x‖^2) + · intro k + exact (hF k).aestronglyMeasurable.mul ((u.value_L2 s).aestronglyMeasurable.norm.pow 2) + · exact ((u.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul B + · intro k + filter_upwards [] with x + rw [Real.norm_eq_abs,abs_mul,abs_of_nonneg (sq_nonneg ‖u.value s x‖)] + exact mul_le_mul_of_nonneg_right (hb k x) (sq_nonneg _) + · exact Eventually.of_forall (fun x => (hlim x).mul_const _) + +lemma potentialForm_sum_values {n : ℕ} {ι : Type*} (u : H1Vector n) + (s : Finset ι) (F : ι → Configuration n → ℝ) + (hF : ∀ i∈s, ∀ q : Spins n, Integrable (fun x => F i x*‖u.value q x‖^2)) : + potentialForm (fun x => ∑ i∈s, F i x) u=∑ i∈s, potentialForm (F i) u := by + simp only [potentialForm,Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro q hq + exact integral_finsetSum s (fun i hi => hF i hi q) + +lemma weightedInnerField_sum_weights {J n : ℕ} {ι : Type*} (S : Nuclei J) (h : ℝ) + (s : Finset ι) (w : ι → Space → ℝ) (x : Configuration n) : + weightedInnerField S h (fun y => ∑ i∈s, w i y) x= + ∑ i∈s, weightedInnerField S h (w i) x := by + simp only [weightedInnerField,Finset.sum_mul] + exact Finset.sum_comm + +lemma deletionShellWeight_sum_supported {t : ℝ} (ht : 0 ∑ j∈Finset.range k, deletionShellWeight t w j y) atTop (𝓝 (w y)) := by + have H : Tendsto (fun k : ℕ => (2:ℝ)^k*t) atTop atTop := + (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1:ℝ)<2)).atTop_mul_const ht + have he := H.eventually (eventually_gt_atTop ‖y‖) + by_cases hy : t ≤ ‖y‖ + · apply Tendsto.congr' _ tendsto_const_nhds + filter_upwards [he] with k hk + rw [deletionShellWeight_sum ht,ite_eq_left ⟨hy,hk⟩] + · have hy' : ‖y‖ potentialForm (weightedInnerField S (t/4) + (fun y => ∑ j∈Finset.range k, deletionShellWeight t w j y)) u) + atTop (𝓝 (potentialForm (weightedInnerField S (t/4) w) u)) := by + apply potentialForm_bounded_tendsto (B:=(n:ℝ)*(totalCharge S/t+(n:ℝ)/(t/2))) + · intro k + exact weightedInnerField_measurable S (t/4) + (Finset.measurable_fun_sum _ (fun j _ => deletionShellWeight_measurable hw t j)) + · intro k x + exact weightedInnerField_exterior_abs_le S hatom ht (by linarith) + (deletionShellWeight_sum_bound ht hb k) (deletionShellWeight_sum_supported ht w k) x + · intro x + apply tendsto_finsetSum + intro i hi + exact (deletionShellWeight_sum_tendsto ht hws (position x i)).mul_const _ + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedInner.lean b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedInner.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7b743408c1fbc32fdeeb760d687f0d98488d4c3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FieldAnalysis/WeightedInner.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.ScreenBox +import OAI.Analysis.CoulombRadii.Localization.ShellIMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +def weightedInnerField {J n : ℕ} (S : Nuclei J) (h : ℝ) (w : Space → ℝ) + (x : Configuration n) : ℝ := + ∑ i, w (position x i)*rawSignedField (attraction S (position x i)) (Metric.ball 0 h) (position x i) x + +lemma weightedInnerField_measurable {J n : ℕ} (S : Nuclei J) (h : ℝ) + {w : Space → ℝ} (hw : Measurable w) : Measurable (@weightedInnerField J n S h w) := by + unfold weightedInnerField + apply Finset.measurable_fun_sum + intro i hi + have hp : Measurable (fun x : Configuration n => position x i) := + (continuous_position i).measurable + have hc : Measurable (fun x : Configuration n => (x,position x i)) := + measurable_id.prodMk hp + have hr : Measurable (fun x : Configuration n => + restrictedOutPotential x (Metric.ball 0 h) (position x i)) := + (restrictedOutPotential_joint_measurable (m:=n) (A:=Metric.ball (0:Space) h) measurableSet_ball).comp (f:=fun x : Configuration n => (x,position x i)) hc + have ha : Measurable (fun x : Configuration n => attraction S (position x i)) := + (attraction_measurable S).comp hp + exact (hw.comp hp).mul (ha.sub hr) + +lemma weightedInnerField_reindex {J m n : ℕ} (S : Nuclei J) (h : ℝ) (w : Space → ℝ) + (e : Fin m ≃ Fin n) (x : Configuration m) : + weightedInnerField S h w (reindexConfiguration e x)=weightedInnerField S h w x := by + simp only [weightedInnerField,rawSignedField_reindex] + change (∑ i : Fin n, w (position x (e.symm i))* + rawSignedField (attraction S (position x (e.symm i))) (Metric.ball 0 h) (position x (e.symm i)) x)=_ + exact Equiv.sum_comp e.symm (fun i : Fin m => w (position x i)* + rawSignedField (attraction S (position x i)) (Metric.ball 0 h) (position x i) x) + +lemma inner_shell_separation {u h : ℝ} (hu : 0 by simpa only [hatom j,sub_zero] using hyr) + rw [abs_of_nonneg (attraction_nonneg S y)] at HB + rw [abs_mul] + calc + _ ≤ 1*|rawSignedField (attraction S y) (Metric.ball 0 h) y x| := + mul_le_mul_of_nonneg_right (hw y) (abs_nonneg _) + _ ≤ _ := by simpa only [one_mul] using HB.trans (add_le_add HA le_rfl) + · rw [hws y hy,zero_mul,abs_zero] + exact add_nonneg (div_nonneg (totalCharge_nonneg S) hu.le) (by positivity) + +lemma weightedInnerField_abs_le {J n : ℕ} (S : Nuclei J) (hatom : ∀ j, S.position j=0) + {u h : ℝ} (hu : 0 weighted_raw_inner_abs_le S hatom hu hh hw hws (position x i) x) + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] using H + +lemma weightedInnerField_join_of_support {J m k : ℕ} (S : Nuclei J) (h : ℝ) + {u : ℝ} {w : Space → ℝ} (hws : ∀ y∉imsShell 0 u, w y=0) + (x : Configuration m) {z : Configuration k} (hz : z∈allPositions (imsShell 0 u)ᶜ) : + weightedInnerField S h w (joinConfiguration m k (x,z))= + ∑ i : Fin m, w (position x i)*rawSignedField (attraction S (position x i)) + (Metric.ball 0 h) (position x i) (joinConfiguration m k (x,z)) := by + simp only [weightedInnerField,Fin.sum_univ_add,position_join_left,position_join_right] + have he : (∑ i : Fin k, w (position z i)*rawSignedField (attraction S (position z i)) + (Metric.ball 0 h) (position z i) (joinConfiguration m k (x,z)))=0 := by + exact Finset.sum_eq_zero (fun i _ => by rw [hws _ (hz i),zero_mul]) + rw [he,add_zero] + +lemma potentialForm_const_mul_value {n : ℕ} (v : H1Vector n) (c : ℝ) (F : Configuration n → ℝ) : + potentialForm (fun x => c*F x) v = c*potentialForm F v := by + simp only [potentialForm,mul_assoc,integral_const_mul,Finset.mul_sum] + +lemma conditional_weighted_inner_le {J m k : ℕ} (S : Nuclei J) + (hatom : ∀ j, S.position j=0) (v : H1Vector (m+k)) {u h : ℝ} + (hu : 0 boundedObservable_integrable v₀ (F i) (hFi i) (hFb i) q)] + apply integral_congr_ae + filter_upwards [hcore q] with z hz + by_cases hz' : z∈allPositions (imsShell 0 u)ᶜ + · rw [weightedInnerField_join_of_support S h hws x hz',Finset.sum_mul] + · rw [hz hz',norm_zero,zero_pow (by norm_num : (2:ℕ)≠0),mul_zero] + exact (Finset.sum_eq_zero (fun _ _ => mul_zero _)).symm + rw [he] + calc + _ ≤ ∑ _i : Fin m, M := by + apply Finset.sum_le_sum + intro i hi + by_cases hwz : w (position x i)=0 + · simp only [F,hwz,zero_mul,potentialForm,integral_zero,Finset.sum_const_zero] + exact hM + · have hy : position x i∈imsShell 0 u := by by_contra h; exact hwz (hws _ h) + have hyr : u ≤ ‖position x i‖ ∧ ‖position x i‖ ≤ 2*u := by + simpa only [imsShell,mem_ofPred_eq,sub_zero] using hy + have hhf := coreConditionalObservable_rawSignedField v (attraction S (position x i)) + measurableSet_ball (position x i) (show 0 w (position x i)*rawSignedField (attraction S (position x i)) + (Metric.ball 0 h) (position x i) (joinConfiguration m k (x,z))) from rfl, + potentialForm_const_mul_value] + exact congrArg (fun z => w (position x i)*z) hhf + rw [heq] + exact (mul_le_mul_of_nonneg_left ((le_max_left _ _).trans (hcap _ hyr.1 hyr.2)) (hw0 _)).trans + ((mul_le_mul_of_nonneg_right (hw1 _) hM).trans_eq (one_mul _)) + _ = _ := by simp + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/Add.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/Add.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6e949cf348b15879e9c1b7f9a9193162a5fec89 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/Add.lean @@ -0,0 +1,437 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.HardyMollifier + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +open ContinuousLinearMap +open scoped Convolution + +lemma blockRadiusSq_nuclear {n : ℕ} (i : Fin n) (R : Space) (x : Configuration n) : + blockRadiusSq i (nuclearHardyCoordinates i R) x = ‖position x i - R‖^2 := by + simp [blockRadiusSq, nuclearHardyCoordinates, position, EuclideanSpace.norm_sq_eq, + Real.norm_eq_abs] + +lemma blockRadiusSq_pair {n : ℕ} (i j : Fin n) (hij : i ≠ j) (x : Configuration n) : + blockRadiusSq i (pairHardyCoordinates i j hij) x = ‖position x i - position x j‖^2 := by + simp [blockRadiusSq, pairHardyCoordinates, position, EuclideanSpace.norm_sq_eq, + Real.norm_eq_abs] + +lemma hardyCoulomb_nuclear {n : ℕ} (i : Fin n) (R : Space) (x : Configuration n) : + hardyCoulomb i (nuclearHardyCoordinates i R) x = coulombKernel (position x i - R) := by + rw [hardyCoulomb, blockRadiusSq_nuclear, Real.sqrt_sq (norm_nonneg _)] + rfl + +lemma hardyCoulomb_pair {n : ℕ} (i j : Fin n) (hij : i ≠ j) (x : Configuration n) : + hardyCoulomb i (pairHardyCoordinates i j hij) x = + coulombKernel (position x i - position x j) := by + rw [hardyCoulomb, blockRadiusSq_pair, Real.sqrt_sq (norm_nonneg _)] + rfl + +lemma H1Vector.nuclear_coulomb_integrable_bound {n : ℕ} (ψ : H1Vector n) + (s : Spins n) (i : Fin n) (R : Space) {η : ℝ} (hη : 0 < η) : + Integrable (fun x => coulombKernel (position x i - R) * ‖ψ.value s x‖^2) ∧ + (∫ x, coulombKernel (position x i - R) * ‖ψ.value s x‖^2) ≤ + 4 * η * (∑ b : Fin 3, ∫ x, ‖ψ.gradient s (i,b) x‖^2) + + (1 / (4 * η)) * (∫ x, ‖ψ.value s x‖^2) := by + simpa only [hardyCoulomb_nuclear] using + ψ.coulomb_integrable_bound s i (nuclearHardyCoordinates i R) hη + +lemma H1Vector.pair_coulomb_integrable_bound {n : ℕ} (ψ : H1Vector n) + (s : Spins n) (i j : Fin n) (hij : i ≠ j) {η : ℝ} (hη : 0 < η) : + Integrable (fun x => coulombKernel (position x i - position x j) * ‖ψ.value s x‖^2) ∧ + (∫ x, coulombKernel (position x i - position x j) * ‖ψ.value s x‖^2) ≤ + 4 * η * (∑ b : Fin 3, ∫ x, ‖ψ.gradient s (i,b) x‖^2) + + (1 / (4 * η)) * (∫ x, ‖ψ.value s x‖^2) := by + simpa only [hardyCoulomb_pair] using + ψ.coulomb_integrable_bound s i (pairHardyCoordinates i j hij) hη + +lemma H1Vector.nuclear_integrable {M n : ℕ} (ψ : H1Vector n) (S : Nuclei M) + (s : Spins n) : + Integrable (fun x => (∑ i, attraction S (position x i)) * ‖ψ.value s x‖^2) := by + simp only [attraction, Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + have h := (ψ.nuclear_coulomb_integrable_bound s i (S.position j) (by norm_num : (0 : ℝ) < 1)).1 + simpa only [mul_assoc] using h.const_mul (S.charge j) + +lemma H1Vector.pair_integrable {n : ℕ} (ψ : H1Vector n) (s : Spins n) : + Integrable (fun x => (∑ i : Fin n, ∑ j : Fin n, + if i < j then coulombKernel (position x i - position x j) else 0) * + ‖ψ.value s x‖^2) := by + simp only [Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + by_cases hij : i < j + · simp only [ite_eq_left hij] + exact (ψ.pair_coulomb_integrable_bound s i j hij.ne (by norm_num : (0 : ℝ) < 1)).1 + · simp only [ite_eq_right hij, zero_mul] + exact integrable_zero _ _ _ + +lemma potential_smooth_partition {n : ℕ} {ι : Type*} [Fintype ι] + (ψ : H1Vector n) (f : ι → Configuration n → ℝ) + (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) (B D : ℝ) + (hB : ∀ i x, |f i x| ≤ B) + (hD : ∀ i a x, |fderiv ℝ (f i) x (EuclideanSpace.single a 1)| ≤ D) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) + (V : Configuration n → ℝ) (s : Spins n) + (hI : ∀ i, Integrable (fun x => V x * + ‖(ψ.smoothMul (f i) (hf i) B D (hB i) (hD i)).value s x‖^2)) : + (∑ i, ∫ x, V x * ‖(ψ.smoothMul (f i) (hf i) B D (hB i) (hD i)).value s x‖^2) = + ∫ x, V x * ‖ψ.value s x‖^2 := by + rw [← integral_finsetSum _ (fun i _ => hI i)] + apply integral_congr_ae + apply Filter.Eventually.of_forall + intro x + change (∑ i, V x * ‖(f i x : ℂ) * ψ.value s x‖^2) = _ + simp_rw [norm_real_mul_sq] + rw [← Finset.mul_sum, ← Finset.sum_mul, hpart, one_mul] + +lemma nuclearEnergy_smooth_partition {M n : ℕ} {ι : Type*} [Fintype ι] + (S : Nuclei M) (ψ : H1Vector n) (f : ι → Configuration n → ℝ) + (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) (B D : ℝ) + (hB : ∀ i x, |f i x| ≤ B) + (hD : ∀ i a x, |fderiv ℝ (f i) x (EuclideanSpace.single a 1)| ≤ D) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) : + (∑ i, nuclearEnergy S (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i))) = + nuclearEnergy S ψ := by + unfold nuclearEnergy + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro s _ + exact potential_smooth_partition ψ f hf B D hB hD hpart _ s + (fun i => (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i)).nuclear_integrable S s) + +lemma pairEnergy_smooth_partition {n : ℕ} {ι : Type*} [Fintype ι] + (ψ : H1Vector n) (f : ι → Configuration n → ℝ) + (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) (B D : ℝ) + (hB : ∀ i x, |f i x| ≤ B) + (hD : ∀ i a x, |fderiv ℝ (f i) x (EuclideanSpace.single a 1)| ≤ D) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) : + (∑ i, pairEnergy (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i))) = pairEnergy ψ := by + unfold pairEnergy + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro s _ + exact potential_smooth_partition ψ f hf B D hB hD hpart _ s + (fun i => (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i)).pair_integrable s) + +theorem form_smooth_partition {M n : ℕ} {ι : Type*} [Fintype ι] + (S : Nuclei M) (ψ : H1Vector n) (f : ι → Configuration n → ℝ) + (hf : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (f i)) (B D : ℝ) + (hB : ∀ i x, |f i x| ≤ B) + (hD : ∀ i a x, |fderiv ℝ (f i) x (EuclideanSpace.single a 1)| ≤ D) + (hpart : ∀ x, ∑ i, f i x ^ 2 = 1) : + (∑ i, form S (ψ.smoothMul (f i) (hf i) B D (hB i) (hD i))) = + form S ψ + (1 / 2 : ℝ) * ∑ s, ∑ a, ∫ x, + (∑ i, (fderiv ℝ (f i) x (EuclideanSpace.single a 1)) ^ 2) * + ‖ψ.value s x‖^2 := by + simp only [form, Finset.sum_add_distrib, Finset.sum_sub_distrib] + rw [kinetic_smooth_partition ψ f hf B D hB hD hpart, + nuclearEnergy_smooth_partition S ψ f hf B D hB hD hpart, + pairEnergy_smooth_partition ψ f hf B D hB hD hpart] + ring + +lemma mass_nonneg {n : ℕ} (ψ : H1Vector n) : 0 ≤ mass ψ := + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => sq_nonneg _)) + +lemma kinetic_nonneg {n : ℕ} (ψ : H1Vector n) : 0 ≤ kinetic ψ := by + apply mul_nonneg (by norm_num) + exact Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg + (fun _ _ => integral_nonneg (fun _ => sq_nonneg _))) + +lemma pairEnergy_nonneg {n : ℕ} (ψ : H1Vector n) : 0 ≤ pairEnergy ψ := by + apply Finset.sum_nonneg + intro s _ + apply integral_nonneg + intro x + apply mul_nonneg _ (sq_nonneg _) + apply Finset.sum_nonneg + intro i _ + apply Finset.sum_nonneg + intro j _ + split_ifs + · exact inv_nonneg.mpr (norm_nonneg _) + · exact le_rfl + +lemma totalCharge_ge_card {M : ℕ} (S : Nuclei M) : (M : ℝ) ≤ totalCharge S := by + calc + (M : ℝ) = ∑ _j : Fin M, (1 : ℝ) := by simp + _ ≤ totalCharge S := Finset.sum_le_sum (fun j _ => S.charge_ge_one j) + +lemma totalCharge_pos {M : ℕ} (S : Nuclei M) : 0 < totalCharge S := + (Nat.cast_pos.mpr S.nonempty).trans_le (totalCharge_ge_card S) + +lemma nuclearEnergy_eq_sum {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) : + nuclearEnergy S ψ = ∑ s, ∑ i, ∑ j, + S.charge j * (∫ x, coulombKernel (position x i - S.position j) * ‖ψ.value s x‖^2) := by + unfold nuclearEnergy + apply Finset.sum_congr rfl + intro s _ + have hI : ∀ i j, Integrable (fun x => S.charge j * + (coulombKernel (position x i - S.position j) * ‖ψ.value s x‖^2)) := by + intro i j + exact ((ψ.nuclear_coulomb_integrable_bound s i (S.position j) + (by norm_num : (0 : ℝ) < 1)).1).const_mul _ + simp only [attraction, Finset.sum_mul, mul_assoc] + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hI i j))] + apply Finset.sum_congr rfl + intro i _ + rw [integral_finsetSum _ (fun j _ => hI i j)] + simp only [integral_const_mul] + +lemma nuclearEnergy_bound {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) + {η : ℝ} (hη : 0 < η) : + nuclearEnergy S ψ ≤ 8 * η * totalCharge S * kinetic ψ + + ((n : ℝ) * totalCharge S / (4 * η)) * mass ψ := by + let K : Spins n → Fin n → ℝ := fun s i => ∑ b : Fin 3, ∫ x, + ‖ψ.gradient s (i,b) x‖^2 + let L : Spins n → ℝ := fun s => ∫ x, ‖ψ.value s x‖^2 + rw [nuclearEnergy_eq_sum] + have hbound : (∑ s, ∑ i, ∑ j, S.charge j * + (∫ x, coulombKernel (position x i - S.position j) * ‖ψ.value s x‖^2)) ≤ + ∑ s, ∑ i, ∑ j, S.charge j * (4 * η * K s i + 1 / (4 * η) * L s) := by + apply Finset.sum_le_sum + intro s _ + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + exact mul_le_mul_of_nonneg_left + (ψ.nuclear_coulomb_integrable_bound s i (S.position j) hη).2 + (le_trans (by norm_num) (S.charge_ge_one j)) + refine hbound.trans_eq ?_ + have hJ : ∀ s i, (∑ j, S.charge j * (4 * η * K s i + 1 / (4 * η) * L s)) = + totalCharge S * (4 * η * K s i + 1 / (4 * η) * L s) := by + intro s i + rw [← Finset.sum_mul] + rfl + simp_rw [hJ] + have hI : ∀ s, (∑ i, totalCharge S * (4 * η * K s i + 1 / (4 * η) * L s)) = + (totalCharge S * (4 * η)) * (∑ i, K s i) + + ((n : ℝ) * totalCharge S / (4 * η)) * L s := by + intro s + simp only [mul_add, Finset.sum_add_distrib, ← mul_assoc, ← Finset.mul_sum, + Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + ring + simp_rw [hI] + rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] + have hK : (∑ s, ∑ i, K s i) = 2 * kinetic ψ := by + unfold K kinetic + simp only [Fintype.sum_prod_type] + ring + rw [hK] + change _ = 8 * η * totalCharge S * kinetic ψ + + ((n : ℝ) * totalCharge S / (4 * η)) * (∑ s, L s) + ring + +lemma form_lower_bound {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) : + -(2 * (n : ℝ) * (totalCharge S)^2) * mass ψ ≤ form S ψ := by + let η : ℝ := 1 / (8 * totalCharge S) + have hZ := totalCharge_pos S + have hη : 0 < η := by dsimp [η]; positivity + have hbound := nuclearEnergy_bound S ψ hη + have hfactor₁ : 8 * η * totalCharge S = 1 := by + dsimp [η] + field_simp + have hfactor₂ : (n : ℝ) * totalCharge S / (4 * η) = + 2 * (n : ℝ) * (totalCharge S)^2 := by + dsimp [η] + field_simp + ring + rw [hfactor₁, one_mul, hfactor₂] at hbound + have hpair := pairEnergy_nonneg ψ + unfold form + linarith + +lemma sector_forms_bddBelow {M : ℕ} (S : Nuclei M) (n : ℕ) : + BddBelow {e : ℝ | ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ form S ψ = e} := by + refine ⟨-(2 * (n : ℝ) * (totalCharge S)^2), ?_⟩ + rintro e ⟨ψ, _hanti, hm, he⟩ + have h := form_lower_bound S ψ + rw [hm, mul_one, he] at h + exact h + +lemma energy_le_form {M n : ℕ} (S : Nuclei M) (hn : n ≠ 0) (ψ : H1Vector n) + (hanti : Antisymmetric ψ) (hm : mass ψ = 1) : energy S n ≤ form S ψ := by + rw [energy, ite_eq_right hn] + exact csInf_le (sector_forms_bddBelow S n) ⟨ψ, hanti, hm, rfl⟩ + +lemma GroundState.minimizes {M n : ℕ} {S : Nuclei M} {ψ : H1Vector n} + (hψ : GroundState S ψ) (hn : n ≠ 0) (φ : H1Vector n) + (hφ : Antisymmetric φ) (hm : mass φ = 1) : form S ψ ≤ form S φ := by + rw [hψ.2.2] + exact energy_le_form S hn φ hφ hm + +lemma H1Vector.test_integrable {n : ℕ} (ψ : H1Vector n) (s : Spins n) + (φ : Configuration n → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) + (hc : HasCompactSupport φ) : + Integrable (fun x => ψ.value s x * (φ x : ℂ)) := by + have hL : MemLp (fun x => (φ x : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hc.comp_left (by simp)) + exact (ψ.value_L2 s).integrable_mul hL + +noncomputable def H1Vector.add {n : ℕ} (ψ φ : H1Vector n) : H1Vector n where + value s x := ψ.value s x + φ.value s x + gradient s a x := ψ.gradient s a x + φ.gradient s a x + value_L2 s := (ψ.value_L2 s).add (φ.value_L2 s) + partial_L2 s a := (ψ.partial_L2 s a).add (φ.partial_L2 s a) + weak_partial s a f hf hc := by + have hd : ContDiff ℝ (⊤ : ℕ∞) (fun x => fderiv ℝ f x (EuclideanSpace.single a 1)) := + (hf.fderiv_right (by simp)).clm_apply contDiff_const + have hdc := hc.fderiv_apply ℝ (EuclideanSpace.single a 1) + have hiψ := ψ.test_integrable s _ hd hdc + have hiφ := φ.test_integrable s _ hd hdc + have hL : MemLp (fun x => (f x : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp hf.continuous).memLp_of_hasCompactSupport + (hc.comp_left (by simp)) + have hjψ := (ψ.partial_L2 s a).integrable_mul hL + have hjφ := (φ.partial_L2 s a).integrable_mul hL + change Integrable (fun x => ψ.gradient s a x * (f x : ℂ)) at hjψ + change Integrable (fun x => φ.gradient s a x * (f x : ℂ)) at hjφ + simp_rw [add_mul] + rw [integral_add hiψ hiφ, integral_add hjψ hjφ, + ψ.weak_partial s a f hf hc, φ.weak_partial s a f hf hc] + ring + +noncomputable def H1Vector.rsmul {n : ℕ} (t : ℝ) (ψ : H1Vector n) : H1Vector n where + value s x := (t : ℂ) * ψ.value s x + gradient s a x := (t : ℂ) * ψ.gradient s a x + value_L2 s := memLp_two_real_mul (ψ.value_L2 s) continuous_const (fun _ => le_rfl) + partial_L2 s a := memLp_two_real_mul (ψ.partial_L2 s a) continuous_const (fun _ => le_rfl) + weak_partial s a f hf hc := by + simp_rw [mul_assoc] + rw [integral_const_mul, integral_const_mul, ψ.weak_partial s a f hf hc] + ring + +lemma Antisymmetric.add {n : ℕ} {ψ φ : H1Vector n} + (hψ : Antisymmetric ψ) (hφ : Antisymmetric φ) : Antisymmetric (ψ.add φ) := by + intro p s + filter_upwards [hψ p s, hφ p s] with x hx hy + change ψ.value (s ∘ p) (permute p x) + φ.value (s ∘ p) (permute p x) = _ + rw [hx, hy] + exact (mul_add _ _ _).symm + +lemma Antisymmetric.rsmul {n : ℕ} {ψ : H1Vector n} + (hψ : Antisymmetric ψ) (t : ℝ) : Antisymmetric (ψ.rsmul t) := by + intro p s + filter_upwards [hψ p s] with x hx + change (t : ℂ) * ψ.value (s ∘ p) (permute p x) = _ + rw [hx] + change _ = ((p.sign : ℤ) : ℂ) * ((t : ℂ) * ψ.value s x) + ring + +lemma mass_rsmul {n : ℕ} (ψ : H1Vector n) (t : ℝ) : + mass (ψ.rsmul t) = t^2 * mass ψ := by + unfold mass H1Vector.rsmul + simp only [norm_real_mul_sq, integral_const_mul, Finset.mul_sum] + +lemma kinetic_rsmul {n : ℕ} (ψ : H1Vector n) (t : ℝ) : + kinetic (ψ.rsmul t) = t^2 * kinetic ψ := by + unfold kinetic H1Vector.rsmul + simp only [norm_real_mul_sq, integral_const_mul, ← Finset.mul_sum] + ring + +lemma nuclearEnergy_rsmul {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) (t : ℝ) : + nuclearEnergy S (ψ.rsmul t) = t^2 * nuclearEnergy S ψ := by + unfold nuclearEnergy H1Vector.rsmul + simp only [norm_real_mul_sq] + simp_rw [mul_left_comm _ (t^2), integral_const_mul] + rw [← Finset.mul_sum] + +lemma pairEnergy_rsmul {n : ℕ} (ψ : H1Vector n) (t : ℝ) : + pairEnergy (ψ.rsmul t) = t^2 * pairEnergy ψ := by + unfold pairEnergy H1Vector.rsmul + simp only [norm_real_mul_sq] + simp_rw [mul_left_comm _ (t^2), integral_const_mul] + rw [← Finset.mul_sum] + +lemma form_rsmul {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) (t : ℝ) : + form S (ψ.rsmul t) = t^2 * form S ψ := by + rw [form, kinetic_rsmul, nuclearEnergy_rsmul, pairEnergy_rsmul, form] + ring + +lemma energy_mul_mass_le_form {M n : ℕ} (S : Nuclei M) (hn : n ≠ 0) + (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : 0 < mass ψ) : + energy S n * mass ψ ≤ form S ψ := by + let t : ℝ := (Real.sqrt (mass ψ))⁻¹ + have ht : t^2 = (mass ψ)⁻¹ := by + dsimp [t] + rw [inv_pow, Real.sq_sqrt hm.le] + have hmass : mass (ψ.rsmul t) = 1 := by + rw [mass_rsmul, ht, inv_mul_cancel₀ (ne_of_gt hm)] + have hbound := energy_le_form S hn (ψ.rsmul t) (hψ.rsmul t) hmass + rw [form_rsmul, ht, ← div_eq_inv_mul] at hbound + exact (le_div_iff₀ hm).mp hbound + +lemma norm_add_rsmul_sq (u v : ℂ) (t : ℝ) : + ‖u + (t : ℂ) * v‖^2 = + (1-t)*‖u‖^2 + (t^2-t)*‖v‖^2 + t*‖u+v‖^2 := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.add_re, + Complex.add_im, Complex.mul_re, Complex.mul_im, Complex.ofReal_re, + Complex.ofReal_im] + ring + +lemma mass_add_rsmul {n : ℕ} (ψ φ : H1Vector n) (t : ℝ) : + mass (ψ.add (φ.rsmul t)) = + (1-t)*mass ψ + (t^2-t)*mass φ + t*mass (ψ.add φ) := by + unfold mass + have hiψ := fun s => (ψ.value_L2 s).integrable_norm_pow (p := 2) (by decide) + have hiφ := fun s => (φ.value_L2 s).integrable_norm_pow (p := 2) (by decide) + have hiadd := fun s => ((ψ.add φ).value_L2 s).integrable_norm_pow (p := 2) (by decide) + have heq : ∀ s, (∫ x, ‖(ψ.add (φ.rsmul t)).value s x‖^2) = + (1-t)*(∫ x, ‖ψ.value s x‖^2) + (t^2-t)*(∫ x, ‖φ.value s x‖^2) + + t*(∫ x, ‖(ψ.add φ).value s x‖^2) := by + intro s + change (∫ x, ‖ψ.value s x + (t : ℂ)*φ.value s x‖^2) = _ + simp_rw [norm_add_rsmul_sq] + have hsum : Integrable (fun x => (1-t)*‖ψ.value s x‖^2 + + (t^2-t)*‖φ.value s x‖^2) := ((hiψ s).const_mul _).add ((hiφ s).const_mul _) + have hadd : Integrable (fun x => t*‖ψ.value s x + φ.value s x‖^2) := + (hiadd s).const_mul t + rw [integral_add hsum hadd, + integral_add ((hiψ s).const_mul (1-t)) ((hiφ s).const_mul (t^2-t))] + simp only [integral_const_mul] + rfl + simp_rw [heq] + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] + +lemma kinetic_add_rsmul {n : ℕ} (ψ φ : H1Vector n) (t : ℝ) : + kinetic (ψ.add (φ.rsmul t)) = + (1-t)*kinetic ψ + (t^2-t)*kinetic φ + t*kinetic (ψ.add φ) := by + unfold kinetic + have heq : ∀ s a, (∫ x, ‖(ψ.add (φ.rsmul t)).gradient s a x‖^2) = + (1-t)*(∫ x, ‖ψ.gradient s a x‖^2) + + (t^2-t)*(∫ x, ‖φ.gradient s a x‖^2) + + t*(∫ x, ‖(ψ.add φ).gradient s a x‖^2) := by + intro s a + have hiψ := (ψ.partial_L2 s a).integrable_norm_pow (p := 2) (by decide) + have hiφ := (φ.partial_L2 s a).integrable_norm_pow (p := 2) (by decide) + have hiadd := ((ψ.add φ).partial_L2 s a).integrable_norm_pow (p := 2) (by decide) + change (∫ x, ‖ψ.gradient s a x + (t : ℂ)*φ.gradient s a x‖^2) = _ + simp_rw [norm_add_rsmul_sq] + have hsum : Integrable (fun x => (1-t)*‖ψ.gradient s a x‖^2 + + (t^2-t)*‖φ.gradient s a x‖^2) := (hiψ.const_mul _).add (hiφ.const_mul _) + have hadd : Integrable (fun x => t*‖ψ.gradient s a x + φ.gradient s a x‖^2) := + hiadd.const_mul t + rw [integral_add hsum hadd, integral_add (hiψ.const_mul (1-t)) (hiφ.const_mul (t^2-t))] + simp only [integral_const_mul] + rfl + simp_rw [heq] + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] + ring + +end Coulomb +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/AppendJensen.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/AppendJensen.lean new file mode 100644 index 0000000000000000000000000000000000000000..d247513a7f0b59250be616caf132c76197dac197 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/AppendJensen.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.CoreReindex + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def H1Vector.appendCut {m n : ℕ} {L : Type*} [Fintype L] + (u : H1Vector (m+n)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (hp : ∀ z, ∑ l, χ l z^2=1) + (D : ℝ) (hD : 0≤D) (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) : H1Vector ((m+q)+k) := + (((u.labelCut χ hχ hp D hD hd p).reindex (coreReindex m e)).reindex (recordAssoc m q k)) + +theorem appendCut_positive_jensen {m n : ℕ} {L : Type*} [Fintype L] + (u : H1Vector (m+n)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (hp : ∀ z, ∑ l, χ l z^2=1) + (D : ℝ) (hD : 0≤D) (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (q k : (Fin (m+n) → L) → ℕ) (e : (p : Fin (m+n) → L) → Fin (q p+k p) ≃ Fin n) + (W : Configuration (m+n) → ℝ) (hW : Measurable W) {B : ℝ} + (hB0 : 0≤B) (hB : ∀ x, |W x| ≤ B) : + sliceExpectation u (fun s x => (max (coreConditionalObservable u W s x) 0)^2) ≤ + ∑ p, sliceExpectation (u.appendCut χ hχ hp D hD hd p (e p)) (fun s x => + (max (coreConditionalObservable (u.appendCut χ hχ hp D hD hd p (e p)) + (W ∘ reindexConfiguration (coreReindex m (e p)) ∘ reindexConfiguration (recordAssoc m (q p) (k p))) s x) 0)^2) := by + apply (labelCut_conditional_positive_jensen u χ hχ hp D hD hd W hW hB0 hB).trans + apply Finset.sum_le_sum + intro p hp0 + rw [←slice_positive_square_coreReindex _ (e p) W] + exact record_more_positive_jensen _ _ + (hW.comp (reindexConfiguration_continuous _).measurable) hB0 (fun _ => hB _) + +lemma mass_appendCut {m n : ℕ} {L : Type*} [Fintype L] + (u : H1Vector (m+n)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (hp : ∀ z, ∑ l, χ l z^2=1) + (D : ℝ) (hD : 0≤D) (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) : + mass (u.appendCut χ hχ hp D hD hd p e)=mass (u.labelCut χ hχ hp D hD hd p) := by + simp only [H1Vector.appendCut,mass_reindex] + +lemma form_appendCut {J m n : ℕ} (S : Nuclei J) {L : Type*} [Fintype L] + (u : H1Vector (m+n)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (hp : ∀ z, ∑ l, χ l z^2=1) + (D : ℝ) (hD : 0≤D) (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) : + form S (u.appendCut χ hχ hp D hD hd p e)=form S (u.labelCut χ hχ hp D hD hd p) := by + simp only [H1Vector.appendCut,form_reindex] + +lemma potentialForm_appendCut {m n : ℕ} {L : Type*} [Fintype L] + (u : H1Vector (m+n)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (hp : ∀ z, ∑ l, χ l z^2=1) + (D : ℝ) (hD : 0≤D) (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) + (W : Configuration (m+n) → ℝ) : + potentialForm (W ∘ reindexConfiguration (coreReindex m e) ∘ reindexConfiguration (recordAssoc m q k)) + (u.appendCut χ hχ hp D hD hd p e)=potentialForm W (u.labelCut χ hχ hp D hD hd p) := by + change potentialForm ((W ∘ reindexConfiguration (coreReindex m e)) ∘ reindexConfiguration (recordAssoc m q k)) + (((u.labelCut χ hχ hp D hD hd p).reindex (coreReindex m e)).reindex (recordAssoc m q k))=_ + rw [potentialForm_reindex,potentialForm_reindex] + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def PartlyAntisymmetric {n : ℕ} (u : H1Vector n) (I : Set (Fin n)) : Prop := + ∀ p : Equiv.Perm (Fin n), (∀ i ∉ I, p i=i) → ∀ s : Spins n, + ∀ᵐ x, u.value (s ∘ p) (permute p x)=(((p.sign:ℤ):ℂ))*u.value s x + +def coreIndexSet (m k : ℕ) : Set (Fin (m+k)) := Set.range (Fin.natAdd m : Fin k → Fin (m+k)) + +lemma Antisymmetric.partly {n : ℕ} {u : H1Vector n} (hu : Antisymmetric u) (I : Set (Fin n)) : + PartlyAntisymmetric u I := fun p _ s => hu p s + +lemma reindexConfiguration_measurePreserving {m n : ℕ} (e : Fin m ≃ Fin n) : + MeasurePreserving (reindexConfiguration e) volume volume := by + have h : m=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + exact permute_measurePreserving e.symm + +lemma reindex_permute {m n : ℕ} (e : Fin m ≃ Fin n) (p : Equiv.Perm (Fin m)) (x : Configuration m) : + reindexConfiguration e (permute p x)=permute (e.permCongr p) (reindexConfiguration e x) := by + ext ⟨i,b⟩ + simp [reindexConfiguration,permute,Equiv.permCongr_apply] + +lemma PartlyAntisymmetric.reindex {m n : ℕ} {u : H1Vector n} {I : Set (Fin n)} + (hu : PartlyAntisymmetric u I) (e : Fin m ≃ Fin n) (K : Set (Fin m)) + (hK : ∀ i∈K, e i∈I) : PartlyAntisymmetric (u.reindex e) K := by + intro p hp s + have hfix : ∀ i∉I, e.permCongr p i=i := by + intro i hi + have he : e.symm i∉K := fun h => hi (by simpa using hK _ h) + simp [Equiv.permCongr_apply,hp _ he] + have H := (reindexConfiguration_measurePreserving e).quasiMeasurePreserving.ae + (hu (e.permCongr p) hfix (s ∘ e.symm)) + filter_upwards [H] with x hx + rw [H1Vector.reindex_value,H1Vector.reindex_value,reindex_permute] + have hs : (s ∘ p) ∘ e.symm=(s ∘ e.symm) ∘ (e.permCongr p) := by + funext i + simp [Function.comp_apply,Equiv.permCongr_apply] + rw [hs] + simpa only [Equiv.Perm.sign_permCongr] using hx + +lemma PartlyAntisymmetric.labelCut {n : ℕ} {u : H1Vector n} {I : Set (Fin n)} + (hu : PartlyAntisymmetric u I) {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → L) (K : Set (Fin n)) (hKI : K⊆I) (l : L) + (hc : ∀ i∈K, p i=l) : PartlyAntisymmetric (u.labelCut χ hχ hp D hD hd p) K := by + intro q hq s + have hfix : ∀ i∉I, q i=i := fun i hi => hq i (fun h => hi (hKI h)) + have hperm (i : Fin n) : p (q i)=p i := by + by_cases hi : i∈K + · have hqi : q i∈K := by + by_contra hh + have he : q i=i := q.injective (hq _ hh) + apply hh + rw [he] + exact hi + rw [hc _ hi,hc _ hqi] + · rw [hq _ hi] + filter_upwards [hu q hfix s] with x hx + change (↑(tensorCut χ p (permute q x)):ℂ)*u.value (s ∘ q) (permute q x)=_ + rw [tensorCut_permute_invariant χ p q hperm,hx] + change (↑(tensorCut χ p x):ℂ)*((((q.sign:ℤ):ℂ))*u.value s x)= + (((q.sign:ℤ):ℂ))*((↑(tensorCut χ p x):ℂ)*u.value s x) + ring + +lemma PartlyAntisymmetric.coreSlice {m k : ℕ} {u : H1Vector (m+k)} + (hu : PartlyAntisymmetric u (coreIndexSet m k)) (s : Spins m) : + ∀ᵐ x, Antisymmetric (u.coreSlice s x) := by + apply u.coreSlice_antisymmetric + intro p t + apply hu (corePerm m p) _ (Fin.append s t) + intro i hi + refine Fin.addCases (fun j hj => ?_) (fun j hj => ?_) i hi + · exact corePerm_left m p j + · exact (hj ⟨j,rfl⟩).elim + +lemma appendCut_partlyAntisymmetric {m n : ℕ} {u : H1Vector (m+n)} + (hu : PartlyAntisymmetric u (coreIndexSet m n)) {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) (l : L) + (hc : ∀ i : Fin k, p (Fin.natAdd m (e (Fin.natAdd q i)))=l) : + PartlyAntisymmetric (u.appendCut χ hχ hp D hD hd p e) (coreIndexSet (m+q) k) := by + let I : Set (Fin (m+n)) := Set.range (fun i : Fin k => Fin.natAdd m (e (Fin.natAdd q i))) + let K : Set (Fin (m+(q+k))) := Set.range (fun i : Fin k => Fin.natAdd m (Fin.natAdd q i)) + have hI : I⊆coreIndexSet m n := by rintro i ⟨j,rfl⟩; exact ⟨_,rfl⟩ + have hcut := hu.labelCut χ hχ hp D hD hd p I hI l (by rintro i ⟨j,rfl⟩; exact hc j) + have hsort := hcut.reindex (coreReindex m e) K (by + rintro i ⟨j,rfl⟩ + exact ⟨j,by rw [coreReindex_right]⟩) + exact hsort.reindex (recordAssoc m q k) (coreIndexSet (m+q) k) (by + rintro i ⟨j,rfl⟩ + exact ⟨j,by rw [recordAssoc_right]⟩) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/AtomicPhysicalKinetic.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/AtomicPhysicalKinetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f6b785e974d29cdbd421f4005cd2abe9c2724b7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/AtomicPhysicalKinetic.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.AtomicSmallPatch +import OAI.Analysis.CoulombRadii.LimitTheory.AtomicOutKinetic + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +theorem RecordedEnsemble.atomic_outerKinetic_le {J n : ℕ} (S : Nuclei J) + (hatom : ∀ j,S.position j=0) (T : RecordedEnsemble n) (ha : T.CoreFermionic) + {y : Space} (hy : y≠0) (hs : T.OutSupported (Metric.closedBall y (80*atomicCellScale y))) + {E : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) : + (∑ p,outerKinetic (T.vector p))≤T.totalForm S-E*T.totalMass+ + (atomicCellScale y/2)*(∑ p,sliceExpectation (T.vector p) (fun s x => (atomicPatchCap S ((T.vector p).coreSlice s x).normalized x y)^2))+ + (∑ p,(T.out p:ℝ)^2*mass (T.vector p))/(2*atomicCellScale y) := by + have H := Finset.sum_le_sum (fun (p : T.index) (_ : p∈Finset.univ) => + Coulomb.atomic_outerKinetic_le S hatom (T.vector p) (ha p).coreSlice hy (hs p) hE) + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum] at H + apply H.trans_eq + unfold totalForm totalMass + congr 1 + rw [Finset.sum_div] + apply Finset.sum_congr rfl + intro p _ + ring + +theorem exists_atomic_physical_kinetic {J n : ℕ} (S : Nuclei J) + (hatom : ∀ j,S.position j=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) (hstate : form S ψ≤E+δ) + (hδ : 0≤δ) {y : Space} (hy : y≠0) {b : ℝ} (hb : 0 (atomicPatchCap S ((T.ensemble.vector p).coreSlice s x).normalized x y)^2) + let N := ∑ p,(T.ensemble.out p:ℝ)^2*mass (T.ensemble.vector p) + have hwidth : t+b≤80*a := by dsimp only [a] at *; linarith [ht.2] + have hQ : Q≤atomicPhysicalCapConstant*P*m^2/a^2 := by + have HQ := atomicPatchCap_ensemble_square S hatom T.ensemble hy + (H := (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2) + (fun v hv => (Real.sqrt_le_iff.mp (hraw v hv)).2) + change Q≤_ at HQ + calc + Q≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+8*N/(9*a^2) := HQ + _≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+ + 8*(atomicPatchCountFactor*P*m^2)/(9*a^2) := add_le_add le_rfl + (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hN (by norm_num)) (by positivity)) + _=atomicPhysicalCapConstant*P*m^2/a^2 := by + dsimp only [atomicPhysicalCapConstant,screenFieldUnit,m] + simp only [mul_pow,div_pow,Real.sq_sqrt hP] + ring + have hs : T.ensemble.OutSupported (Metric.closedBall y (80*a)) := by + intro p s + filter_upwards [hos p s] with x hx + intro i hi hn + exact hx i hi (fun hh => hn (Metric.closedBall_subset_closedBall hwidth hh)) + have HK := RecordedEnsemble.atomic_outerKinetic_le S hatom T.ensemble T.fermionic hy hs hE + rw [T.mass_eq,hm,mul_one] at HK + have hB := thinIMS_sharp_budget ψ hm hδ hP + (fun z hz => screenCountParameter_controls ψ hm δ hz) hy hb hwidth + have hq := mul_le_mul_of_nonneg_left hQ (show 0≤a/2 by positivity) + have hn := div_le_div_of_nonneg_right hN (show 0≤2*a by positivity) + refine ⟨t,ht,T,hEt,ho,hcs,hos,?_⟩ + change _≤δ+thinReserveFactor*(Real.sqrt P*m/b^2)+(atomicPhysicalCapConstant+atomicPatchCountFactor)*P*m^2/(2*a) + have hident : (a/2)*(atomicPhysicalCapConstant*P*m^2/a^2)+atomicPatchCountFactor*P*m^2/(2*a)= + (atomicPhysicalCapConstant+atomicPatchCountFactor)*P*m^2/(2*a) := by field_simp + change _≤T.ensemble.totalForm S-E+(a/2)*Q+N/(2*a) at HK + dsimp only [m,P,a] at hq hn hident hB HK ⊢ + linarith + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def atomicKineticFormula (δ P m a b : ℝ) : ℝ := + δ+thinReserveFactor*(Real.sqrt P*m/b^2)+ + (atomicPhysicalCapConstant+atomicPatchCountFactor)*P*m^2/(2*a) + +def atomicKineticConstant : ℝ := 1+2*thinReserveFactor*Real.sqrt atomicCountConstant+ + 2*(atomicPhysicalCapConstant+atomicPatchCountFactor)*atomicCountConstant + +lemma atomicKineticFormula_small {δ P a : ℝ} (hδ : 0≤δ) + (hP : 0≤P) (hPP : P≤atomicCountConstant) (ha : 0 uniformBall a M x^(5/3:ℝ)) y,uniformBall_power ha] + have hc : 0 < 4*Real.pi/3 := by positivity + rw [Real.div_rpow hM (by positivity),Real.mul_rpow hc.le (pow_nonneg ha.le 3)] + have he : (a^3)^(5/3:ℝ) = a^5 := by + rw [← Real.rpow_natCast a 3, ← Real.rpow_mul ha.le] + norm_num + rw [he] + unfold ballKineticCoefficient + field_simp [ha.ne', (Real.rpow_pos_of_pos hc (5/3:ℝ)).ne'] + +lemma ballCloud_rawTF_bound {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {A : Set Space} (hu : SpatiallySupported u A) + {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (y : Space) + (hcore : ∀ z ∈ A, a ≤ ‖z-y‖) (hnuc : ∀ j, a ≤ ‖S.position j-y‖) : + rawThomasFermiEnergy (coreScreenedField S u) (ballCloud y a M) ≤ + ballKineticCoefficient*M^(5/3:ℝ)/a^2-M*coreScreenedField S u y+(5/4:ℝ)*M^2/a := by + unfold rawThomasFermiEnergy + rw [ballCloud_power ha hM,coreScreenedField_ballCloud S u hu ha hM y hcore hnuc] + calc + _ ≤ ballKineticCoefficient*M^(5/3:ℝ)/a^2-M*coreScreenedField S u y+ + ((5/2:ℝ)*M^2/a)/2 := by + have H := ballCloud_coulombBilinear_bound ha hM y + linarith + _ = _ := by ring + +lemma ballCloud_support {a M : ℝ} (y z : Space) (hz : z ∉ Metric.closedBall y a) : + ballCloud y a M z = 0 := by + apply uniformBall_support + simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hz + +lemma ballCloud_ne_zero_norm {a M : ℝ} (y z : Space) (hz : ballCloud y a M z ≠ 0) : + ‖z-y‖ < a := by + by_contra hn + apply hz + change (Metric.ball (0:Space) a).indicator (fun _ => M/(4*Real.pi/3*a^3)) (z-y) = 0 + exact Set.indicator_of_notMem (by simpa only [Metric.mem_ball,dist_zero_right] using hn) _ + +lemma ballCloud_separated_window {a : ℝ} (ha : 0 < a) (y : Space) + (g : 𝓢(Space,ℝ)) (hgs : ∀ z, a < ‖z‖ → g z = 0) + {A : Set Space} (hsep : ∀ z ∈ A, 3*a ≤ ‖z-y‖) : + Disjoint A (Metric.closedBall y a + tsupport (g : Space → ℝ)) := by + apply Set.disjoint_left.mpr + rintro z hz ⟨v,hv,w,hw,rfl⟩ + have hw' : ‖w‖ ≤ a := by + have H : tsupport (g : Space → ℝ) ⊆ Metric.closedBall 0 a := by + apply closure_minimal ?_ Metric.isClosed_closedBall + intro x hx + simpa only [Metric.mem_closedBall,dist_zero_right] using + (le_of_not_gt (fun h => hx (hgs x h)) : ‖x‖ ≤ a) + simpa only [Metric.mem_closedBall,dist_zero_right] using H hw + have hv' : ‖v-y‖ ≤ a := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hv + have hnorm : ‖v+w-y‖ ≤ 2*a := by + calc + ‖v+w-y‖ = ‖(v-y)+w‖ := by congr 1; abel + _ ≤ ‖v-y‖+‖w‖ := norm_add_le _ _ + _ ≤ 2*a := by linarith + linarith [hsep (v+w) hz] + +theorem ballCloud_trial {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ z, g z = g (EuclideanSpace.single 0 ‖z‖)) + {a M : ℝ} (ha : 0 < a) (hM : 0 ≤ M) (hgs : ∀ z, a < ‖z‖ → g z = 0) + (y : Space) (A : Set Space) (hA : IsClosed A) (hsu : SpatiallySupported u A) + (hcore : ∀ z ∈ A, 3*a ≤ ‖z-y‖) (hnuc : ∀ j, 3*a ≤ ‖S.position j-y‖) : + unrestrictedFormBottom S ≤ ((form S u-M*coreScreenedField S u y+ + ballKineticCoefficient*M^(5/3:ℝ)/a^2 + (1/2:ℝ)*M* + (∑ b : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single b 1))^2)+ + (5/4:ℝ)*M^2/a : ℝ) : EReal) := by + have hd : ∀ z x : Space, 3*a ≤ ‖z-y‖ → ballCloud y a M x ≠ 0 → a ≤ ‖z-x‖ := by + intro z x hz hx + have H := norm_sub_le_norm_sub_add_norm_sub z x y + have hx' := ballCloud_ne_zero_norm y x hx + linarith + have H := source_free_trial_raw S u hu hmu g hg hgc hrad ha hgs (ballCloud y a M) + (fun z => uniformBall_nonneg ha hM (z-y)) (ballCloud_measurable a M y) + ((uniformBall_power_integrable a M).comp_sub_right y) (Metric.closedBall y a) A + (isCompact_closedBall y a) hA (ballCloud_support y) hsu + (ballCloud_separated_window ha y g hgs hcore) + (fun z hz x hx => hd z x (hcore z hz) hx) (fun j x hx => hd (S.position j) x (hnuc j) hx) + rw [ballCloud_mass ha] at H + apply H.trans + apply EReal.coe_le_coe_iff.mpr + have HT := ballCloud_rawTF_bound S u hsu ha hM y + (fun z hz => (by linarith [hcore z hz] : a ≤ ‖z-y‖)) + (fun j => (by linarith [hnuc j] : a ≤ ‖S.position j-y‖)) + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/CoreKinetic.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/CoreKinetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c10cfea7d02ed5caba0c57e2c96d2960818a711 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/CoreKinetic.lean @@ -0,0 +1,326 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.NuclearPotentialSplitJoin + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +namespace Coulomb + +lemma potentialForm_coreSlice_parameter_ae {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) + (V : Configuration m → Configuration k → ℝ) : + (fun x => potentialForm (V x) (ψ.coreSlice s x)) =ᵐ[volume] + fun x => ∑ t : Spins k, ∫ y, V x y * ‖ψ.value (Fin.append s t) (joinConfiguration m k (x,y))‖^2 := by + filter_upwards [ψ.coreSliceRegular_ae s] with x hx + simp only [potentialForm, ψ.coreSlice_value s hx] + +lemma potentialForm_coreSlice_parameter_integrable {m k : ℕ} (ψ : H1Vector (m+k)) + (s : Spins m) (V : Configuration m → Configuration k → ℝ) + (hV : ∀ t : Spins k, Integrable (fun z => + V ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 * + ‖ψ.value (Fin.append s t) z‖^2)) : + Integrable (fun x => potentialForm (V x) (ψ.coreSlice s x)) := by + apply Integrable.congr _ (potentialForm_coreSlice_parameter_ae ψ s V).symm + apply integrable_finsetSum + intro t _ + have H := ((joinConfiguration_measurePreserving m k).integrable_comp_emb + (joinConfiguration m k).toHomeomorph.toMeasurableEquiv.measurableEmbedding).mpr (hV t) + change Integrable (fun z : Configuration m × Configuration k => + V ((joinConfiguration m k).symm (joinConfiguration m k z)).1 + ((joinConfiguration m k).symm (joinConfiguration m k z)).2 * + ‖ψ.value (Fin.append s t) (joinConfiguration m k z)‖^2) (volume.prod volume) at H + simp only [ContinuousLinearEquiv.symm_apply_apply] at H + exact H.integral_prod_left + +lemma integral_potentialForm_coreSlice_parameter {m k : ℕ} (ψ : H1Vector (m+k)) + (V : Configuration m → Configuration k → ℝ) + (hV : ∀ st : Spins (m+k), Integrable (fun z => + V ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2)) : + (∑ s : Spins m, ∫ x, potentialForm (V x) (ψ.coreSlice s x)) = + ∑ st : Spins (m+k), ∫ z, + V ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2 := by + have hs (s : Spins m) : (∫ x, potentialForm (V x) (ψ.coreSlice s x)) = + ∑ t : Spins k, ∫ z, + V ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 * + ‖ψ.value (Fin.append s t) z‖^2 := by + rw [integral_congr_ae (potentialForm_coreSlice_parameter_ae ψ s V)] + have hi (t : Spins k) : Integrable (fun z : Configuration m × Configuration k => + V z.1 z.2 * ‖ψ.value (Fin.append s t) (joinConfiguration m k z)‖^2) (volume.prod volume) := by + have H := ((joinConfiguration_measurePreserving m k).integrable_comp_emb + (joinConfiguration m k).toHomeomorph.toMeasurableEquiv.measurableEmbedding).mpr + (hV (Fin.append s t)) + change Integrable (fun z : Configuration m × Configuration k => + V ((joinConfiguration m k).symm (joinConfiguration m k z)).1 + ((joinConfiguration m k).symm (joinConfiguration m k z)).2 * + ‖ψ.value (Fin.append s t) (joinConfiguration m k z)‖^2) (volume.prod volume) at H + simpa only [ContinuousLinearEquiv.symm_apply_apply] using H + rw [integral_finsetSum _ (fun t _ => (hi t).integral_prod_left)] + apply Finset.sum_congr rfl + intro t _ + rw [← integral_prod _ (hi t)] + have H := (joinConfiguration_measurePreserving m k).integral_comp' + (fun z => V ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 * + ‖ψ.value (Fin.append s t) z‖^2) + change (∫ z : Configuration m × Configuration k, + V ((joinConfiguration m k).symm (joinConfiguration m k z)).1 + ((joinConfiguration m k).symm (joinConfiguration m k z)).2 * + ‖ψ.value (Fin.append s t) (joinConfiguration m k z)‖^2 ∂volume.prod volume) = _ at H + simpa only [ContinuousLinearEquiv.symm_apply_apply] using H + simp_rw [hs] + rw [← Fintype.sum_prod_type (f := fun st : Spins m × Spins k => + ∫ z, V ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 * + ‖ψ.value (Fin.append st.1 st.2) z‖^2)] + exact Fintype.sum_equiv (Fin.appendEquiv m k) _ _ (fun _ => rfl) + +lemma potentialForm_const {n : ℕ} (c : ℝ) (ψ : H1Vector n) : + potentialForm (fun _ => c) ψ = c * mass ψ := by + simp only [potentialForm, mass, integral_const_mul, Finset.mul_sum] + +lemma H1Vector.outer_nuclear_integrable {M m k : ℕ} (ψ : H1Vector (m+k)) + (S : Nuclei M) (st : Spins (m+k)) : + Integrable (fun z => nuclearPotential S ((joinConfiguration m k).symm z).1 * ‖ψ.value st z‖^2) := by + simp only [nuclearPotential, attraction, position_split_left, Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + have H := (ψ.nuclear_coulomb_integrable_bound st (Fin.castAdd k i) (S.position j) + (by norm_num : (0:ℝ)<1)).1 + simpa only [mul_assoc] using H.const_mul (S.charge j) + +lemma H1Vector.outer_pair_integrable {m k : ℕ} (ψ : H1Vector (m+k)) (st : Spins (m+k)) : + Integrable (fun z => pairPotential ((joinConfiguration m k).symm z).1 * ‖ψ.value st z‖^2) := by + simp only [pairPotential, position_split_left, Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + by_cases hij : i < j + · simp only [ite_eq_left hij] + exact (ψ.pair_coulomb_integrable_bound st (Fin.castAdd k i) (Fin.castAdd k j) + (fun he => hij.ne (by apply Fin.ext; have H := congrArg Fin.val he; simpa only [Fin.val_castAdd] using H)) (by norm_num : (0:ℝ)<1)).1 + · simp only [ite_eq_right hij, zero_mul] + exact integrable_zero _ _ _ + +lemma H1Vector.cross_integrable {m k : ℕ} (ψ : H1Vector (m+k)) (st : Spins (m+k)) : + Integrable (fun z => crossPotential ((joinConfiguration m k).symm z).1 + ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2) := by + simp only [crossPotential, position_split_left, position_split_right, Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + exact (ψ.pair_coulomb_integrable_bound st (Fin.castAdd k i) (Fin.natAdd m j) + (by intro h; have H := congrArg Fin.val h + simp only [Fin.val_castAdd, Fin.val_natAdd] at H; omega) + (by norm_num : (0:ℝ)<1)).1 + +noncomputable def coreKinetic {m k : ℕ} (ψ : H1Vector (m+k)) : ℝ := + (1/2 : ℝ) * ∑ st : Spins (m+k), ∑ a : Fin k × Fin 3, + ∫ z, ‖ψ.gradient st (Fin.natAdd m a.1,a.2) z‖^2 +noncomputable def outerKinetic {m k : ℕ} (ψ : H1Vector (m+k)) : ℝ := + (1/2 : ℝ) * ∑ st : Spins (m+k), ∑ a : Fin m × Fin 3, + ∫ z, ‖ψ.gradient st (Fin.castAdd k a.1,a.2) z‖^2 + +lemma kinetic_split {m k : ℕ} (ψ : H1Vector (m+k)) : + kinetic ψ = coreKinetic ψ + outerKinetic ψ := by + simp only [kinetic, coreKinetic, outerKinetic, Fintype.sum_prod_type, Fin.sum_univ_add, + Finset.sum_add_distrib, mul_add] + ring + +lemma nuclearEnergy_split {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) : + nuclearEnergy S ψ = + potentialForm (fun z => nuclearPotential S ((joinConfiguration m k).symm z).1) ψ + + potentialForm (fun z => nuclearPotential S ((joinConfiguration m k).symm z).2) ψ := by + have hp (z : Configuration (m+k)) : nuclearPotential S z = + nuclearPotential S ((joinConfiguration m k).symm z).1 + + nuclearPotential S ((joinConfiguration m k).symm z).2 := by + simpa only [Prod.mk.eta, ContinuousLinearEquiv.apply_symm_apply] using + nuclearPotential_split_join S ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 + change potentialForm (nuclearPotential S) ψ = _ + simp only [potentialForm, hp, add_mul] + simp_rw [integral_add (ψ.outer_nuclear_integrable S _) (ψ.core_nuclear_integrable S _)] + exact Finset.sum_add_distrib + +lemma pairEnergy_split {m k : ℕ} (ψ : H1Vector (m+k)) : + pairEnergy ψ = + potentialForm (fun z => pairPotential ((joinConfiguration m k).symm z).1) ψ + + potentialForm (fun z => pairPotential ((joinConfiguration m k).symm z).2) ψ + + potentialForm (fun z => crossPotential ((joinConfiguration m k).symm z).1 + ((joinConfiguration m k).symm z).2) ψ := by + have hp (z : Configuration (m+k)) : pairPotential z = + pairPotential ((joinConfiguration m k).symm z).1 + + pairPotential ((joinConfiguration m k).symm z).2 + + crossPotential ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 := by + simpa only [Prod.mk.eta, ContinuousLinearEquiv.apply_symm_apply, crossPotential] using + pairPotential_split_join ((joinConfiguration m k).symm z).1 ((joinConfiguration m k).symm z).2 + change potentialForm pairPotential ψ = _ + simp only [potentialForm, hp, add_mul] + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro st _ + have H := integral_add ((ψ.outer_pair_integrable st).add (ψ.core_pair_integrable st)) + (ψ.cross_integrable st) + simp only [Pi.add_apply] at H + rw [H, integral_add (ψ.outer_pair_integrable st) (ψ.core_pair_integrable st)] + +lemma form_normalized_weight {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) : + mass ψ * form S ψ.normalized = form S ψ := by + change mass ψ * (kinetic ψ.normalized - potentialForm (nuclearPotential S) ψ.normalized + + potentialForm pairPotential ψ.normalized) = _ + rw [mul_add, mul_sub, kinetic_normalized_weight, potentialForm_normalized_weight, + potentialForm_normalized_weight] + rfl + +lemma form_coreSlice_integrable {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) (s : Spins m) : + Integrable (fun x => form S (ψ.coreSlice s x)) := + ((kinetic_coreSlice_integrable ψ s).sub + (potentialForm_coreSlice_integrable ψ s (nuclearPotential S) + (fun t => ψ.core_nuclear_integrable S (Fin.append s t)))).add + (potentialForm_coreSlice_integrable ψ s pairPotential + (fun t => ψ.core_pair_integrable (Fin.append s t))) + +lemma conditional_core_form_identity {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) : + (∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x) * form S (ψ.coreSlice s x).normalized) = + coreKinetic ψ - potentialForm (fun z => nuclearPotential S ((joinConfiguration m k).symm z).2) ψ + + potentialForm (fun z => pairPotential ((joinConfiguration m k).symm z).2) ψ := by + simp_rw [form_normalized_weight] + change (∑ s : Spins m, ∫ x, kinetic (ψ.coreSlice s x) - + potentialForm (nuclearPotential S) (ψ.coreSlice s x) + potentialForm pairPotential (ψ.coreSlice s x)) = _ + have he (s : Spins m) : + (∫ x, kinetic (ψ.coreSlice s x) - potentialForm (nuclearPotential S) (ψ.coreSlice s x) + + potentialForm pairPotential (ψ.coreSlice s x)) = + (∫ x, kinetic (ψ.coreSlice s x)) - (∫ x, potentialForm (nuclearPotential S) (ψ.coreSlice s x)) + + ∫ x, potentialForm pairPotential (ψ.coreSlice s x) := by + have H := integral_add ((kinetic_coreSlice_integrable ψ s).sub + (potentialForm_coreSlice_integrable ψ s (nuclearPotential S) + (fun t => ψ.core_nuclear_integrable S (Fin.append s t)))) + (potentialForm_coreSlice_integrable ψ s pairPotential + (fun t => ψ.core_pair_integrable (Fin.append s t))) + simp only [Pi.sub_apply] at H + rw [H, integral_sub (kinetic_coreSlice_integrable ψ s) + (potentialForm_coreSlice_integrable ψ s (nuclearPotential S) + (fun t => ψ.core_nuclear_integrable S (Fin.append s t)))] + simp only [he, Finset.sum_add_distrib, Finset.sum_sub_distrib] + rw [integral_kinetic_coreSlice, integral_potentialForm_coreSlice ψ (nuclearPotential S) + (ψ.core_nuclear_integrable S), integral_potentialForm_coreSlice ψ pairPotential ψ.core_pair_integrable] + rfl + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/CoreSliceRegular.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/CoreSliceRegular.lean new file mode 100644 index 0000000000000000000000000000000000000000..374b7c5450f27a57724022c822fc223fc7d92209 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/CoreSliceRegular.lean @@ -0,0 +1,461 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.BlockIndex +import OAI.Analysis.CoulombRadii.FieldAnalysis.Rotation + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal + +open MeasureTheory Set +open scoped BigOperators Matrix +namespace Coulomb +instance : IsProbabilityMeasure rotationMeasure := ⟨Measure.haarMeasure_self⟩ + +instance : Measure.IsMulLeftInvariant rotationMeasure := by + unfold rotationMeasure + infer_instance + +instance : Measure.IsHaarMeasure rotationMeasure := by + unfold rotationMeasure + infer_instance + +instance : Measure.IsMulRightInvariant rotationMeasure where + map_mul_right_eq_self P := by + have H := Measure.isMulInvariant_eq_smul_of_compactSpace + (Measure.map (· * P) rotationMeasure) rotationMeasure + have H1 := congrArg (fun μ : Measure Rotation => μ univ) H + simp only [Measure.smul_apply, measure_univ, ENNReal.smul_def, smul_eq_mul, mul_one] at H1 + have H2 : (Measure.map (· * P) rotationMeasure).haarScalarFactor rotationMeasure = 1 := + ENNReal.coe_injective (by simpa using H1.symm) + rw [H2, one_smul] at H + exact H + +lemma ae_all_zero_of_continuous {X T : Type*} [MeasurableSpace X] + {μ : Measure X} [TopologicalSpace T] [TopologicalSpace.SeparableSpace T] + (A : X → T → ℂ) (hc : ∀ x, Continuous (A x)) + (hz : ∀ t, ∀ᵐ x ∂μ, A x t = 0) : ∀ᵐ x ∂μ, ∀ t, A x t = 0 := by + obtain ⟨D, hD, hdense⟩ := TopologicalSpace.exists_countable_dense T + have hDz : ∀ᵐ x ∂μ, ∀ t ∈ D, A x t = 0 := (ae_ball_iff hD).mpr (fun t _ => hz t) + filter_upwards [hDz] with x hx + have he : A x = fun _ => 0 := Continuous.ext_on hdense (hc x) continuous_const hx + intro t + exact congrFun he t + +section SmoothSlices +variable {E F : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + [MeasureSpace E] [BorelSpace E] + [IsLocallyFiniteMeasure (volume : Measure E)] [SigmaFinite (volume : Measure E)] + [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] + [MeasureSpace F] [BorelSpace F] + [IsLocallyFiniteMeasure (volume : Measure F)] [SigmaFinite (volume : Measure F)] + +omit [NormedSpace ℝ E] [FiniteDimensional ℝ E] [MeasureSpace E] [BorelSpace E] + [IsLocallyFiniteMeasure (volume : Measure E)] [SigmaFinite (volume : Measure E)] + [NormedSpace ℝ F] [FiniteDimensional ℝ F] [MeasureSpace F] [BorelSpace F] + [IsLocallyFiniteMeasure (volume : Measure F)] [SigmaFinite (volume : Measure F)] in +lemma compact_tensor_test {χ : E → ℝ} {φ : F → ℝ} + (hχ : HasCompactSupport χ) (hφ : HasCompactSupport φ) : + HasCompactSupport (fun z : E × F => χ z.1 * φ z.2) := by + apply HasCompactSupport.of_support_subset_isCompact (hχ.prod hφ) + intro z hz + simp only [Function.mem_support, mul_ne_zero_iff] at hz + exact ⟨subset_tsupport _ hz.1, subset_tsupport _ hz.2⟩ + +omit [FiniteDimensional ℝ E] [MeasureSpace E] [BorelSpace E] + [IsLocallyFiniteMeasure (volume : Measure E)] [SigmaFinite (volume : Measure E)] + [FiniteDimensional ℝ F] [MeasureSpace F] [BorelSpace F] + [IsLocallyFiniteMeasure (volume : Measure F)] [SigmaFinite (volume : Measure F)] in +lemma tensor_test_deriv {χ : E → ℝ} {φ : F → ℝ} + (hχ : ContDiff ℝ (⊤ : ℕ∞) χ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) + (v : F) (z : E × F) : + fderiv ℝ (fun z : E × F => χ z.1 * φ z.2) z (0, v) = + χ z.1 * fderiv ℝ φ z.2 v := by + have h1 := (hχ.differentiable (by simp) z.1).hasFDerivAt.comp z (hasFDerivAt_fst (𝕜 := ℝ)) + have h2 := (hφ.differentiable (by simp) z.2).hasFDerivAt.comp z (hasFDerivAt_snd (𝕜 := ℝ)) + change (fderiv ℝ ((χ ∘ Prod.fst) * (φ ∘ Prod.snd)) z) (0,v) = _ + rw [(h1.mul h2).fderiv] + simp + +omit [SigmaFinite (volume : Measure E)] in +lemma test_complex_memLp {φ : E → ℝ} + (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφC : HasCompactSupport φ) : + MemLp (fun x => (φ x : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hφC.comp_left (by simp)) + +omit [SigmaFinite (volume : Measure E)] in +lemma test_direction_complex_memLp {φ : E → ℝ} + (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφC : HasCompactSupport φ) (v : E) : + MemLp (fun x => (fderiv ℝ φ x v : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hφC.fderiv_apply ℝ v).comp_left (by simp)) + +lemma weak_slice_fixed_test {u g : E × F → ℂ} + (hu : MemLp u 2 (volume.prod volume)) (hg : MemLp g 2 (volume.prod volume)) + (v : F) + (hw : ∀ (η : E × F → ℝ), ContDiff ℝ (⊤ : ℕ∞) η → HasCompactSupport η → + (∫ z, u z * (fderiv ℝ η z (0,v) : ℂ) ∂(volume.prod volume)) = + -(∫ z, g z * (η z : ℂ) ∂(volume.prod volume))) + (φ : F → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφC : HasCompactSupport φ) : + ∀ᵐ x ∂(volume : Measure E), + (∫ y, u (x,y) * (fderiv ℝ φ y v : ℂ)) = -(∫ y, g (x,y) * (φ y : ℂ)) := by + let dφ : F → ℂ := fun y => (fderiv ℝ φ y v : ℂ) + let cφ : F → ℂ := fun y => (φ y : ℂ) + have hd := test_direction_complex_memLp hφ hφC v + have hc := test_complex_memLp hφ hφC + let A := fiberContract (μ := volume) dφ u + let B := fiberContract (μ := volume) cφ g + have hA : MemLp A 2 volume := fiberContract_memLp hd hu + have hB : MemLp B 2 volume := fiberContract_memLp hc hg + have hzero : ∀ᵐ x ∂(volume : Measure E), (A + B) x = 0 := by + apply ae_eq_zero_of_integral_contDiff_smul_eq_zero ((hA.add hB).locallyIntegrable (by norm_num)) + intro χ hχ hχC + have hχL := test_complex_memLp hχ hχC + have H := hw (fun z => χ z.1 * φ z.2) + ((hχ.comp contDiff_fst).mul (hφ.comp contDiff_snd)) (compact_tensor_test hχC hφC) + simp_rw [tensor_test_deriv hχ hφ v, Complex.ofReal_mul] at H + have H1 := integral_tensorPair hχL hd hu + have H2 := integral_tensorPair hχL hc hg + simp only [star_mul, Complex.star_def, Complex.conj_ofReal] at H1 H2 + have L1 : (∫ z, u z * ((χ z.1 : ℂ) * (fderiv ℝ φ z.2 v : ℂ)) ∂(volume.prod volume)) = + ∫ x, (χ x : ℂ) * A x := by + simpa only [A, dφ, mul_comm] using H1 + have L2 : (∫ z, g z * ((χ z.1 : ℂ) * (φ z.2 : ℂ)) ∂(volume.prod volume)) = + ∫ x, (χ x : ℂ) * B x := by + simpa only [B, cφ, mul_comm] using H2 + rw [L1, L2] at H + change (∫ x, (χ x) • (A x + B x)) = 0 + simp_rw [Complex.real_smul, mul_add] + have hIntA : Integrable (fun x => (χ x : ℂ) * A x) := hχL.integrable_mul hA + have hIntB : Integrable (fun x => (χ x : ℂ) * B x) := hχL.integrable_mul hB + rw [integral_add hIntA hIntB, H, neg_add_cancel] + filter_upwards [hzero] with x hx + simpa only [Pi.add_apply, A, B, fiberContract, dφ, cφ, + Complex.star_def, Complex.conj_ofReal, mul_comm, add_eq_zero_iff_eq_neg] using hx + +lemma weak_slice {u g : E × F → ℂ} + (hu : MemLp u 2 (volume.prod volume)) (hg : MemLp g 2 (volume.prod volume)) + (v : F) + (hw : ∀ (η : E × F → ℝ), ContDiff ℝ (⊤ : ℕ∞) η → HasCompactSupport η → + (∫ z, u z * (fderiv ℝ η z (0,v) : ℂ) ∂(volume.prod volume)) = + -(∫ z, g z * (η z : ℂ) ∂(volume.prod volume))) : + ∀ᵐ x ∂(volume : Measure E), + MemLp (fun y => u (x,y)) 2 volume ∧ MemLp (fun y => g (x,y)) 2 volume ∧ + ∀ (φ : F → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ y, u (x,y) * (fderiv ℝ φ y v : ℂ)) = -(∫ y, g (x,y) * (φ y : ℂ)) := by + classical + have : Fact ((2 : ℝ≥0∞) ≠ (∞ : ℝ≥0∞)) := ⟨by norm_num⟩ + have : SecondCountableTopology F := + (ContinuousLinearEquiv.ofFinrankEq (Module.finrank_fin_fun ℝ).symm : + F ≃L[ℝ] (Fin (Module.finrank ℝ F) → ℝ)).toHomeomorph.secondCountableTopology + let Tests := {φ : F → ℝ // ContDiff ℝ (⊤ : ℕ∞) φ ∧ HasCompactSupport φ} + let Q : Tests → Lp ℂ 2 (volume : Measure F) × Lp ℂ 2 (volume : Measure F) := fun φ => + ⟨(test_direction_complex_memLp φ.2.1 φ.2.2 v).toLp _, + (test_complex_memLp φ.2.1 φ.2.2).toLp _⟩ + let T := Set.range Q + let U : E → Lp ℂ 2 (volume : Measure F) := fun x => + if h : MemLp (fun y => u (x,y)) 2 volume then h.toLp _ else 0 + let G : E → Lp ℂ 2 (volume : Measure F) := fun x => + if h : MemLp (fun y => g (x,y)) 2 volume then h.toLp _ else 0 + let A : E → T → ℂ := fun x t => inner ℂ t.1.1 (U x) + inner ℂ t.1.2 (G x) + have hAc (x : E) : Continuous (A x) := + ((continuous_fst.comp continuous_subtype_val).inner continuous_const).add + ((continuous_snd.comp continuous_subtype_val).inner continuous_const) + have hAQ (x : E) (hx : MemLp (fun y => u (x,y)) 2 volume) + (hxg : MemLp (fun y => g (x,y)) 2 volume) (φ : Tests) : + A x ⟨Q φ, mem_range_self _⟩ = + (∫ y, u (x,y) * (fderiv ℝ φ.1 y v : ℂ)) + (∫ y, g (x,y) * (φ.1 y : ℂ)) := by + dsimp only [A, Q] + simp only [U, G, dite_eq_left hx, dite_eq_left hxg] + rw [inner_toLp_complex, inner_toLp_complex] + simp only [Complex.star_def, Complex.conj_ofReal, mul_comm] + have hAz (t : T) : ∀ᵐ x ∂(volume : Measure E), A x t = 0 := by + rcases t with ⟨_, φ, rfl⟩ + filter_upwards [memLp_fiber_ae hu, memLp_fiber_ae hg, + weak_slice_fixed_test hu hg v hw φ.1 φ.2.1 φ.2.2] with x hx hxg hweak + rw [hAQ x hx hxg φ, hweak, neg_add_cancel] + have hall := ae_all_zero_of_continuous A hAc hAz + filter_upwards [memLp_fiber_ae hu, memLp_fiber_ae hg, hall] with x hx hxg hall + refine ⟨hx, hxg, ?_⟩ + intro φ hφ hφC + have H := hall ⟨Q ⟨φ, hφ, hφC⟩, mem_range_self _⟩ + rw [hAQ x hx hxg] at H + exact add_eq_zero_iff_eq_neg.mp H + +end SmoothSlices +section LinearChange +variable {E F : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasurableSpace E] [BorelSpace E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [MeasurableSpace F] [BorelSpace F] + {μ : Measure E} {ν : Measure F} + +lemma weak_directional_change {u g : F → ℂ} (L : E ≃L[ℝ] F) + (hL : MeasurePreserving L.toHomeomorph.toMeasurableEquiv μ ν) (v : E) + (hw : ∀ (φ : F → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ y, u y * (fderiv ℝ φ y (L v) : ℂ) ∂ν) = -(∫ y, g y * (φ y : ℂ) ∂ν)) : + ∀ (η : E → ℝ), ContDiff ℝ (⊤ : ℕ∞) η → HasCompactSupport η → + (∫ x, u (L x) * (fderiv ℝ η x v : ℂ) ∂μ) = + -(∫ x, g (L x) * (η x : ℂ) ∂μ) := by + intro η hη hηC + let Φ : F → ℝ := η ∘ L.symm + have HΦ : ContDiff ℝ (⊤ : ℕ∞) Φ := hη.comp L.symm.contDiff + have HC : HasCompactSupport Φ := hηC.comp_homeomorph L.symm.toHomeomorph + have Hd (y : F) : fderiv ℝ Φ y (L v) = fderiv ℝ η (L.symm y) v := by + dsimp only [Φ] + rw [fderiv_comp y (hη.differentiable (by simp)).differentiableAt L.symm.differentiableAt, + show fderiv ℝ (⇑L.symm) y = L.symm.toContinuousLinearMap from + L.symm.toContinuousLinearMap.fderiv] + simp + have H := hw Φ HΦ HC + simp_rw [Hd] at H + rw [← hL.integral_comp' (fun y => u y * (fderiv ℝ η (L.symm y) v : ℂ)), + ← hL.integral_comp' (fun y => g y * (Φ y : ℂ))] at H + simpa [Φ] using H +end LinearChange + +lemma H1Vector.weak_partial_join {m k : ℕ} (ψ : H1Vector (m+k)) + (s : Spins (m+k)) (a : Fin k × Fin 3) : + ∀ (η : Configuration m × Configuration k → ℝ), ContDiff ℝ (⊤ : ℕ∞) η → + HasCompactSupport η → + (∫ z, ψ.value s (joinConfiguration m k z) * + (fderiv ℝ η z (0, EuclideanSpace.single a 1) : ℂ) ∂(volume.prod volume)) = + -(∫ z, ψ.gradient s (Fin.natAdd m a.1, a.2) (joinConfiguration m k z) * + (η z : ℂ) ∂(volume.prod volume)) := by + apply weak_directional_change (joinConfiguration m k) (joinConfiguration_measurePreserving m k) + (0, EuclideanSpace.single a 1) + rw [joinConfiguration_right_single] + exact ψ.weak_partial s (Fin.natAdd m a.1, a.2) + +lemma H1Vector.core_slices_H1 {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) : + ∀ᵐ x ∂(volume : Measure (Configuration m)), + (∀ t : Spins k, MemLp (fun y => ψ.value (Fin.append s t) (joinConfiguration m k (x,y))) 2 volume) ∧ + (∀ (t : Spins k) (a : Fin k × Fin 3), + MemLp (fun y => ψ.gradient (Fin.append s t) (Fin.natAdd m a.1,a.2) + (joinConfiguration m k (x,y))) 2 volume ∧ + ∀ (φ : Configuration k → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ y, ψ.value (Fin.append s t) (joinConfiguration m k (x,y)) * + (fderiv ℝ φ y (EuclideanSpace.single a 1) : ℂ)) = + -(∫ y, ψ.gradient (Fin.append s t) (Fin.natAdd m a.1,a.2) + (joinConfiguration m k (x,y)) * (φ y : ℂ))) := by + have hV (t : Spins k) := (ψ.value_L2 (Fin.append s t)).comp_measurePreserving + (joinConfiguration_measurePreserving m k) + have hG (t : Spins k) (a : Fin k × Fin 3) := + (ψ.partial_L2 (Fin.append s t) (Fin.natAdd m a.1,a.2)).comp_measurePreserving + (joinConfiguration_measurePreserving m k) + have hval : ∀ᵐ x ∂(volume : Measure (Configuration m)), + ∀ t : Spins k, MemLp (fun y => ψ.value (Fin.append s t) (joinConfiguration m k (x,y))) 2 volume := + ae_all_iff.mpr (fun t => memLp_fiber_ae + (f := fun z : Configuration m × Configuration k => + ψ.value (Fin.append s t) (joinConfiguration m k z)) (hV t)) + have hgrad := fun (t : Spins k) (a : Fin k × Fin 3) => + weak_slice (hV t) (hG t a) (EuclideanSpace.single a 1) + (ψ.weak_partial_join (Fin.append s t) a) + have hall := ae_all_iff.mpr (fun t => ae_all_iff.mpr (hgrad t)) + filter_upwards [hval, hall] with x hx hall + exact ⟨hx, fun t a => (hall t a).2⟩ + +def H1Vector.CoreSliceRegular {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) + (x : Configuration m) : Prop := + (∀ t : Spins k, MemLp (fun y => ψ.value (Fin.append s t) (joinConfiguration m k (x,y))) 2 volume) ∧ + (∀ (t : Spins k) (a : Fin k × Fin 3), + MemLp (fun y => ψ.gradient (Fin.append s t) (Fin.natAdd m a.1,a.2) + (joinConfiguration m k (x,y))) 2 volume ∧ + ∀ (φ : Configuration k → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ y, ψ.value (Fin.append s t) (joinConfiguration m k (x,y)) * + (fderiv ℝ φ y (EuclideanSpace.single a 1) : ℂ)) = + -(∫ y, ψ.gradient (Fin.append s t) (Fin.natAdd m a.1,a.2) + (joinConfiguration m k (x,y)) * (φ y : ℂ))) + +lemma H1Vector.coreSliceRegular_ae {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) : + ∀ᵐ x ∂volume, ψ.CoreSliceRegular s x := ψ.core_slices_H1 s + +noncomputable def H1Vector.zero (n : ℕ) : H1Vector n where + value := fun _ _ => 0 + gradient := fun _ _ _ => 0 + value_L2 := fun _ => MemLp.zero' + partial_L2 := fun _ _ => MemLp.zero' + weak_partial := by intros; simp + +noncomputable def H1Vector.coreSlice {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) + (x : Configuration m) : H1Vector k := by + classical + exact if h : ψ.CoreSliceRegular s x then + { value := fun t y => ψ.value (Fin.append s t) (joinConfiguration m k (x,y)) + gradient := fun t a y => ψ.gradient (Fin.append s t) (Fin.natAdd m a.1,a.2) + (joinConfiguration m k (x,y)) + value_L2 := h.1 + partial_L2 := fun t a => (h.2 t a).1 + weak_partial := fun t a => (h.2 t a).2 } + else H1Vector.zero k + +lemma H1Vector.coreSlice_value {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) + {x : Configuration m} (hx : ψ.CoreSliceRegular s x) (t : Spins k) (y : Configuration k) : + (ψ.coreSlice s x).value t y = ψ.value (Fin.append s t) (joinConfiguration m k (x,y)) := by + simp [H1Vector.coreSlice, hx] + +lemma H1Vector.coreSlice_gradient {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) + {x : Configuration m} (hx : ψ.CoreSliceRegular s x) (t : Spins k) (a : Fin k × Fin 3) + (y : Configuration k) : + (ψ.coreSlice s x).gradient t a y = + ψ.gradient (Fin.append s t) (Fin.natAdd m a.1,a.2) (joinConfiguration m k (x,y)) := by + simp [H1Vector.coreSlice, hx] + +lemma mass_coreSlice_ae {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) : + (fun x => mass (ψ.coreSlice s x)) =ᵐ[volume] + fun x => ∑ t : Spins k, ∫ y, ‖ψ.value (Fin.append s t) (joinConfiguration m k (x,y))‖^2 := by + filter_upwards [ψ.coreSliceRegular_ae s] with x hx + simp only [mass, ψ.coreSlice_value s hx] + +lemma mass_coreSlice_integrable {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)) := by + apply Integrable.congr _ (mass_coreSlice_ae ψ s).symm + apply integrable_finsetSum + intro t _ + have h := ((ψ.value_L2 (Fin.append s t)).comp_measurePreserving + (joinConfiguration_measurePreserving m k)).integrable_norm_pow (p := 2) (by decide) + exact h.integral_prod_left + +lemma integral_mass_coreSlice {m k : ℕ} (ψ : H1Vector (m+k)) : + (∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x)) = mass ψ := by + calc + _ = ∑ s : Spins m, ∑ t : Spins k, ∫ z, ‖ψ.value (Fin.append s t) z‖^2 := by + apply Finset.sum_congr rfl + intro s _ + rw [integral_congr_ae (mass_coreSlice_ae ψ s), integral_finsetSum] + · apply Finset.sum_congr rfl + intro t _ + have h := ((ψ.value_L2 (Fin.append s t)).comp_measurePreserving + (joinConfiguration_measurePreserving m k)).integrable_norm_pow (p := 2) (by decide) + change Integrable (fun z : Configuration m × Configuration k => + ‖ψ.value (Fin.append s t) (joinConfiguration m k z)‖^2) (volume.prod volume) at h + rw [← integral_prod _ h] + exact (joinConfiguration_measurePreserving m k).integral_comp' + (fun z => ‖ψ.value (Fin.append s t) z‖^2) + · intro t _ + exact (((ψ.value_L2 (Fin.append s t)).comp_measurePreserving + (joinConfiguration_measurePreserving m k)).integrable_norm_pow + (p := 2) (by decide)).integral_prod_left + _ = mass ψ := by + rw [← Fintype.sum_prod_type (f := fun st : Spins m × Spins k => + ∫ z, ‖ψ.value (Fin.append st.1 st.2) z‖^2)] + exact Fintype.sum_equiv (Fin.appendEquiv m k) _ _ (fun _ => rfl) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/CubeGradient.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/CubeGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b7a61521402b77ae23155c69efcb65420deb863 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/CubeGradient.lean @@ -0,0 +1,199 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.SmoothCompact +import OAI.Analysis.CoulombRadii.FieldAnalysis.SlotTensor + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma positionCLM_single {n : ℕ} (i j : Fin n) (b : Fin 3) : + positionCLM j (EuclideanSpace.single (i,b) 1) = + if j = i then EuclideanSpace.single b 1 else 0 := by + ext c + by_cases h : j = i + · subst j + simp [positionCLM] + · simp [positionCLM, h] + +lemma tensorOrbital_fderiv {n : ℕ} {α : Type*} (v : α → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (p : Fin n → α) (s : Spins n) (x : Configuration n) (i : Fin n) (b : Fin 3) : + fderiv ℝ (tensorOrbital v p s) x (EuclideanSpace.single (i,b) 1) = + (fderiv ℝ (fun y => v (p i) y (s i)) (position x i) (EuclideanSpace.single b 1)) * + ∏ j ∈ Finset.univ.erase i, v (p j) (position x j) (s j) := by + have hd (j : Fin n) : DifferentiableAt ℝ (fun y : Configuration n => + v (p j) (position y j) (s j)) x := + by + change DifferentiableAt ℝ ((fun y : Space => v (p j) y (s j)) ∘ (positionCLM j)) x + exact ((hv (p j) (s j)).differentiable (by simp) (positionCLM j x)).comp x + (positionCLM j).differentiableAt + have he (j : Fin n) : fderiv ℝ (fun y : Configuration n => v (p j) (position y j) (s j)) x = + (fderiv ℝ (fun y => v (p j) y (s j)) (position x j)).comp (positionCLM j) := by + exact (((hv (p j) (s j)).differentiable (by simp) (position x j)).hasFDerivAt.comp x + (positionCLM j).hasFDerivAt).fderiv + unfold tensorOrbital + rw [fderiv_finsetProd (fun j _ => hd j), sum_apply] + simp only [smul_apply, smul_eq_mul, he, ContinuousLinearMap.comp_apply, + positionCLM_single] + rw [Finset.sum_eq_single i] + · simp only [ite_true] + ring + · intro j hj hji + simp only [ite_eq_right hji, map_zero, mul_zero] + · simp + +lemma slaterConfiguration_fderiv {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (s : Spins n) (x : Configuration n) (i : Fin n) (b : Fin 3) : + fderiv ℝ (slaterConfiguration v s) x (EuclideanSpace.single (i,b) 1) = + (↑(Real.sqrt (n.factorial : ℝ))⁻¹ : ℂ) * + slotDeterminant (fun a (sx : Fin 2 × Space) => v a sx.2 sx.1) + (fun a sx => fderiv ℝ (fun y => v a y sx.1) sx.2 (EuclideanSpace.single b 1)) i + (fun j => (s j, position x j)) := by + have ht (p : Equiv.Perm (Fin n)) : DifferentiableAt ℝ (tensorOrbital v p s) x := + (tensorOrbital_contDiff v hv p s).differentiable (by simp) x + rw [slaterConfiguration_expansion, fderiv_const_mul (DifferentiableAt.fun_sum (fun p _ => + (ht p).const_mul _)), fderiv_fun_sum (fun p _ => (ht p).const_mul _)] + simp only [smul_apply, smul_eq_mul, sum_apply, + fderiv_const_mul (ht _), tensorOrbital_fderiv v hv] + unfold slotDeterminant + congr 1 + apply Finset.sum_congr rfl + intro p _ + rw [slotTensor_factor] + +noncomputable def cubeGradient {n : ℕ} (ψ : H1Vector n) (a : Fin n × Fin 3) + (z : Fin n → Fin 2 × (Fin 3 → ℝ)) : ℂ := + ψ.gradient ((spinCubeEquiv n) z).1 a (WithLp.toLp 2 ((spinCubeEquiv n) z).2) + +lemma H1Vector.gradient_spinSpace_memLp {n : ℕ} (ψ : H1Vector n) (a : Fin n × Fin 3) : + MemLp (fun sx : Spins n × ((Fin n × Fin 3) → ℝ) => + ψ.gradient sx.1 a (WithLp.toLp 2 sx.2)) 2 (Measure.count.prod volume) := by + have hi (s : Spins n) : MemLp (fun t : Spins n => if t = s then (1:ℂ) else 0) 2 Measure.count := by + apply MemLp.of_bound (by fun_prop) 1 + exact ae_of_all _ (fun t => by split_ifs <;> norm_num) + have H := memLp_finsetSum Finset.univ (fun (s : Spins n) _ => tensorPair_memLp (hi s) + ((ψ.partial_L2 s a).comp_measurePreserving (PiLp.volume_preserving_toLp _))) + convert H using 1 + funext sx + simp only [ite_mul, one_mul, zero_mul] + simp + +lemma cubeGradient_full_norm {n : ℕ} (ψ : H1Vector n) (a : Fin n × Fin 3) : + (∫ z, ‖cubeGradient ψ a z‖^2 ∂(Measure.pi fun _ : Fin n => spinSpaceMeasure)) = + ∑ s, ∫ x, ‖ψ.gradient s a x‖^2 := by + unfold cubeGradient + rw [(spinCubeEquiv_full_measurePreserving n).integral_comp' + (fun sx => ‖ψ.gradient sx.1 a (WithLp.toLp 2 sx.2)‖^2)] + rw [integral_prod _ (ψ.gradient_spinSpace_memLp a).norm.integrable_sq, integral_count] + apply Finset.sum_congr rfl + intro s _ + exact (show MeasurePreserving (MeasurableEquiv.toLp 2 ((Fin n × Fin 3) → ℝ)) volume volume from + PiLp.volume_preserving_toLp _).integral_comp' (fun x => ‖ψ.gradient s a x‖^2) + +lemma slaterState_cubeGradient {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (i : Fin n) (b : Fin 3) (z : Fin n → Fin 2 × (Fin 3 → ℝ)) : + cubeGradient (slaterState v hv hC) (i,b) z = + (↑(Real.sqrt (n.factorial : ℝ))⁻¹ : ℂ) * + slotDeterminant (fun a => flatSpinOrbital (v a)) + (fun a => flatSpinOrbital (fun x s => + fderiv ℝ (fun y => v a y s) x (EuclideanSpace.single b 1))) i z := by + change fderiv ℝ (slaterConfiguration v _) _ (EuclideanSpace.single (i,b) 1) = _ + rw [slaterConfiguration_fderiv v hv] + rfl + +lemma slaterState_kinetic {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (ho : ∀ i j, (∑ s : Fin 2, ∫ x : Space, star (v i x s) * v j x s) = + if i = j then (1:ℂ) else 0) : + kinetic (slaterState v hv hC) = (1/2:ℝ) * ∑ i, ∑ s, ∑ b : Fin 3, + ∫ x : Space, ‖fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)‖^2 := by + have hV (i : Fin n) (s : Fin 2) : MemLp (fun x => v i x s) 2 volume := + (hv i s).continuous.memLp_of_hasCompactSupport (hC i s) + have hD (i : Fin n) (s : Fin 2) (b : Fin 3) : + MemLp (fun x => fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)) 2 volume := + (((hv i s).continuous_fderiv (by simp)).clm_apply continuous_const).memLp_of_hasCompactSupport + ((hC i s).fderiv_apply ℝ _) + have hO (i j : Fin n) : (∫ a, star (flatSpinOrbital (v i) a) * flatSpinOrbital (v j) a + ∂spinSpaceMeasure) = if i = j then (1:ℂ) else 0 := by + rw [flatSpinOrbital_inner (v i) (v j) (hV i) (hV j)] + exact ho i j + have hb (b : Fin 3) : (∑ i, ∑ s, ∫ x, ‖(slaterState v hv hC).gradient s (i,b) x‖^2) = + ∑ i, ∑ s, ∫ x : Space, + ‖fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)‖^2 := by + simp_rw [← cubeGradient_full_norm, slaterState_cubeGradient] + have hn : (0:ℝ) < n.factorial := Nat.cast_pos.mpr (Nat.factorial_pos n) + simp only [norm_mul, mul_pow, norm_inv, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Real.sqrt_nonneg _), inv_pow, Real.sq_sqrt hn.le, integral_const_mul] + rw [← Finset.mul_sum, slotDeterminant_total_norm_sq _ _ + (fun i => flatSpinOrbital_memLp (v i) (hV i)) + (fun i => flatSpinOrbital_memLp _ (fun s => hD i s b)) hO, + ← mul_assoc, inv_mul_cancel₀ hn.ne', one_mul] + apply Finset.sum_congr rfl + intro i _ + have h := flatSpinOrbital_inner + (fun x s => fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)) + (fun x s => fderiv ℝ (fun y => v i y s) x (EuclideanSpace.single b 1)) + (fun s => hD i s b) (fun s => hD i s b) + have hz (z : ℂ) : star z * z = (↑(‖z‖^2) : ℂ) := by + rw [mul_comm, Complex.ofReal_pow] + exact inner_self_eq_norm_sq_to_K (𝕜 := ℂ) z + simp_rw [hz, integral_complex_ofReal] at h + exact Complex.ofReal_injective (by simpa only [Complex.ofReal_sum] using h) + unfold kinetic + congr 1 + simp only [Fintype.sum_prod_type] + calc + _ = ∑ b : Fin 3, ∑ i, ∑ s, ∫ x, ‖(slaterState v hv hC).gradient s (i,b) x‖^2 := by + rw [Finset.sum_comm] + calc + _ = ∑ i, ∑ b : Fin 3, ∑ s, ∫ x, ‖(slaterState v hv hC).gradient s (i,b) x‖^2 := by + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_comm + _ = _ := Finset.sum_comm + _ = _ := by + simp_rw [hb] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_comm + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/ExplicitMultiplyGradient.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/ExplicitMultiplyGradient.lean new file mode 100644 index 0000000000000000000000000000000000000000..52fb819ad77f48abf281326980bb7216c5627c8c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/ExplicitMultiplyGradient.lean @@ -0,0 +1,434 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.SmoothMultiplier + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +theorem energy_localization_identity {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) + {θ : Configuration n → ℝ} (hθ : SmoothMultiplier θ) : + energy Z (multiplyWavefunction θ ψ) (multiplyGradient θ ψ g) = + formMultiplierPairing Z ψ g (fun x => θ x^2) + localizationError ψ θ := by + have hsq : SmoothMultiplier (fun x => θ x^2) := by + simpa only [pow_two] using hθ.mul hθ + have hi : ∀ σ i a, (∫ x : Configuration n, ‖multiplyGradient θ ψ g σ i a x‖^2) = + (∫ x : Configuration n, + inner ℝ (g σ i a x) (multiplyGradient (fun y => θ y^2) ψ g σ i a x)) + + ∫ x : Configuration n, (fderiv ℝ θ x (coordinateDirection i a))^2*‖ψ σ x‖^2 := by + intro σ i a + simp_rw [norm_multiplyGradient_sq hθ.smooth] + exact integral_add (integrable_real_inner_of_memLp (hd.2.2.2.1 σ i a) + ((hd.multiply hsq).2.2.2.1 σ i a)) (integrable_localization_error hd.2.2.1 hθ σ i a) + simp only [energy, formMultiplierPairing, localizationError, hi, + norm_multiplyWavefunction_sq, Finset.sum_add_distrib, + mul_left_comm (coulombPotential Z _)] + ring + +theorem groundState_localization {Z : ℕ} {ψ : Wavefunction Z} + (hψ : IsNormalizedGroundState Z ψ) : + ∃ g : Gradient Z, FormDomain ψ g ∧ normSquared ψ = 1 ∧ + ∀ (θ : Configuration Z → ℝ), SmoothMultiplier θ → + energy Z (multiplyWavefunction θ ψ) (multiplyGradient θ ψ g) = + energy Z ψ g*normSquared (multiplyWavefunction θ ψ) + localizationError ψ θ := by + obtain ⟨g,hd,hn,hmin⟩ := hψ + refine ⟨g,hd,hn,fun θ hθ => ?_⟩ + have hsq : SmoothMultiplier (fun x => θ x^2) := by + simpa only [pow_two] using hθ.mul hθ + rw [energy_localization_identity Z hd hθ, minimizer_multiplier_pairing Z hd hn hmin hsq] + simp only [stateWeightedIntegral, normSquared, norm_multiplyWavefunction_sq] + +theorem localizationError_nonneg {n : ℕ} (ψ : Wavefunction n) (θ : Configuration n → ℝ) : + 0 ≤ localizationError ψ θ := by + apply mul_nonneg (by norm_num) + exact Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => mul_nonneg (sq_nonneg _) (sq_nonneg _))))) + +theorem localizationError_le {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {θ : Configuration n → ℝ} + (hθ : SmoothMultiplier θ) (C : Fin n → Fin 3 → ℝ) + (hC : ∀ i a x, |fderiv ℝ θ x (coordinateDirection i a)| ≤ C i a) : + localizationError ψ θ ≤ ((1/2:ℝ)*(∑ i : Fin n, ∑ a : Fin 3, (C i a)^2))*normSquared ψ := by + have hi : ∀ σ i a, (∫ x : Configuration n, + (fderiv ℝ θ x (coordinateDirection i a))^2*‖ψ σ x‖^2) ≤ + (C i a)^2 * (∫ x : Configuration n, ‖ψ σ x‖^2) := by + intro σ i a + rw [← integral_const_mul] + apply integral_mono (integrable_localization_error hψ hθ σ i a) + ((hψ σ).norm.integrable_sq.const_mul _) + intro x + apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hC i a x) 2 + calc + localizationError ψ θ ≤ (1/2:ℝ)*(∑ σ : Spins n, ∑ i : Fin n, ∑ a : Fin 3, + (C i a)^2 * (∫ x : Configuration n, ‖ψ σ x‖^2)) := by + apply mul_le_mul_of_nonneg_left _ (by norm_num) + exact Finset.sum_le_sum fun σ _ => Finset.sum_le_sum fun i _ => + Finset.sum_le_sum fun a _ => hi σ i a + _ = ((1/2:ℝ)*(∑ i : Fin n, ∑ a : Fin 3, (C i a)^2))*normSquared ψ := by + simp only [← Finset.sum_mul, ← Finset.mul_sum, normSquared] + ring + +theorem groundState_normalized_localization {Z : ℕ} {ψ : Wavefunction Z} + (hψ : IsNormalizedGroundState Z ψ) : + ∃ g : Gradient Z, FormDomain ψ g ∧ normSquared ψ = 1 ∧ + ∀ (θ : Configuration Z → ℝ), SmoothMultiplier θ → + ∀ _hn : 0 < normSquared (multiplyWavefunction θ ψ), + let c := (Real.sqrt (normSquared (multiplyWavefunction θ ψ)))⁻¹ + FormDomain (scaleWavefunction c (multiplyWavefunction θ ψ)) + (scaleGradient c (multiplyGradient θ ψ g)) ∧ + normSquared (scaleWavefunction c (multiplyWavefunction θ ψ)) = 1 ∧ + energy Z (scaleWavefunction c (multiplyWavefunction θ ψ)) + (scaleGradient c (multiplyGradient θ ψ g)) = energy Z ψ g + + localizationError ψ θ / normSquared (multiplyWavefunction θ ψ) := by + obtain ⟨g,hd,hn,hloc⟩ := groundState_localization hψ + refine ⟨g,hd,hn,fun θ hθ hnθ => ?_⟩ + dsimp only + let c := (Real.sqrt (normSquared (multiplyWavefunction θ ψ)))⁻¹ + change FormDomain (scaleWavefunction c (multiplyWavefunction θ ψ)) + (scaleGradient c (multiplyGradient θ ψ g)) ∧ _ + have hc : c^2 = (normSquared (multiplyWavefunction θ ψ))⁻¹ := by + dsimp [c] + rw [inv_pow, Real.sq_sqrt hnθ.le] + refine ⟨(hd.multiply hθ).scale c, ?_, ?_⟩ + · rw [normSquared_scale, hc, inv_mul_cancel₀ hnθ.ne'] + · rw [energy_scale, hc, hloc θ hθ] + field_simp + +theorem tendsto_integral_bounded_real_smul + {X E : Type*} [MeasurableSpace X] [NormedAddCommGroup E] + [NormedSpace ℝ E] [CompleteSpace E] {μ : Measure X} + {F : ℕ → X → ℝ} {F₀ : X → ℝ} {f : X → E} {C : ℝ} + (hF : ∀ k, AEStronglyMeasurable (F k) μ) + (hb : ∀ k x, |F k x| ≤ C) (hf : Integrable f μ) + (hl : ∀ x, Tendsto (fun k => F k x) atTop (𝓝 (F₀ x))) : + Tendsto (fun k => ∫ x, F k x • f x ∂μ) atTop + (𝓝 (∫ x, F₀ x • f x ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun x => C * ‖f x‖) + · intro k + exact (hF k).smul hf.aestronglyMeasurable + · exact hf.norm.const_mul C + · intro k + exact Eventually.of_forall fun x => by + rw [norm_smul, Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_right (hb k x) (norm_nonneg _) + · exact Eventually.of_forall fun x => (hl x).smul tendsto_const_nhds + +theorem tendsto_integral_two_bounded_real_smul + {X E : Type*} [MeasurableSpace X] [NormedAddCommGroup E] + [NormedSpace ℝ E] [CompleteSpace E] {μ : Measure X} + {F G : ℕ → X → ℝ} {F₀ G₀ : X → ℝ} {f g : X → E} {C D : ℝ} + (hF : ∀ k, AEStronglyMeasurable (F k) μ) + (hG : ∀ k, AEStronglyMeasurable (G k) μ) + (hbF : ∀ k x, |F k x| ≤ C) (hbG : ∀ k x, |G k x| ≤ D) + (hf : Integrable f μ) (hg : Integrable g μ) + (hlF : ∀ x, Tendsto (fun k => F k x) atTop (𝓝 (F₀ x))) + (hlG : ∀ x, Tendsto (fun k => G k x) atTop (𝓝 (G₀ x))) : + Tendsto (fun k => ∫ x, F k x • f x + G k x • g x ∂μ) atTop + (𝓝 (∫ x, F₀ x • f x + G₀ x • g x ∂μ)) := by + apply tendsto_integral_of_dominated_convergence + (fun x => C * ‖f x‖ + D * ‖g x‖) + · intro k + exact ((hF k).smul hf.aestronglyMeasurable).add + ((hG k).smul hg.aestronglyMeasurable) + · exact (hf.norm.const_mul C).add (hg.norm.const_mul D) + · intro k + exact Eventually.of_forall fun x => by + calc + ‖F k x • f x + G k x • g x‖ ≤ ‖F k x • f x‖ + ‖G k x • g x‖ := norm_add_le _ _ + _ ≤ C * ‖f x‖ + D * ‖g x‖ := by + simp only [norm_smul, Real.norm_eq_abs] + exact add_le_add + (mul_le_mul_of_nonneg_right (hbF k x) (norm_nonneg _)) + (mul_le_mul_of_nonneg_right (hbG k x) (norm_nonneg _)) + · exact Eventually.of_forall fun x => + ((hlF x).smul tendsto_const_nhds).add ((hlG x).smul tendsto_const_nhds) + +def explicitMultiplyGradient {n : ℕ} (θ : Configuration n → ℝ) + (Dθ : Fin n → Fin 3 → Configuration n → ℝ) + (ψ : Wavefunction n) (g : Gradient n) : Gradient n := + fun σ i a x => Dθ i a x • ψ σ x + θ x • g σ i a x + +theorem HasWeakGradient.multiply_limit {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hgLp : ∀ σ i a, MemLp (g σ i a) 2 volume) + {θ : Configuration n → ℝ} {Dθ : Fin n → Fin 3 → Configuration n → ℝ} + {θk : ℕ → Configuration n → ℝ} + (hθk : ∀ k, ContDiff ℝ ∞ (θk k)) + (hb : ∃ C : ℝ, ∀ k x, |θk k x| ≤ C) + (hdb : ∀ i a, ∃ C : ℝ, ∀ k x, + |fderiv ℝ (θk k) x (coordinateDirection i a)| ≤ C) + (hl : ∀ x, Tendsto (fun k => θk k x) atTop (𝓝 (θ x))) + (hdl : ∀ i a x, Tendsto + (fun k => fderiv ℝ (θk k) x (coordinateDirection i a)) atTop (𝓝 (Dθ i a x))) : + HasWeakGradient (multiplyWavefunction θ ψ) (explicitMultiplyGradient θ Dθ ψ g) := by + intro σ i a φ hφ hφc + let dφ : Configuration n → ℝ := fun x => fderiv ℝ φ x (coordinateDirection i a) + have hdφ : Continuous dφ := (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hdφc : HasCompactSupport dφ := hφc.fderiv_apply ℝ _ + obtain ⟨C,hC⟩ := hb + obtain ⟨B,hB⟩ := hdb i a + have hi₁ := integrable_test_real_smul (hψ σ) hdφ hdφc + have hi₂ := integrable_test_real_smul (hψ σ) hφ.continuous hφc + have hi₃ := integrable_test_real_smul (hgLp σ i a) hφ.continuous hφc + have hleft := tendsto_integral_bounded_real_smul + (fun k => (hθk k).continuous.aestronglyMeasurable) hC hi₁ hl + have hright := tendsto_integral_two_bounded_real_smul + (fun k => ((hθk k).continuous_fderiv (by simp)).clm_apply continuous_const |>.aestronglyMeasurable) + (fun k => (hθk k).continuous.aestronglyMeasurable) hB hC hi₂ hi₃ (hdl i a) hl + have heq : ∀ k, + (∫ x, θk k x • (dφ x • ψ σ x)) = + -(∫ x, (fderiv ℝ (θk k) x (coordinateDirection i a)) • (φ x • ψ σ x) + + θk k x • (φ x • g σ i a x)) := by + intro k + have h := hg.multiply hψ hgLp (hθk k) σ i a φ hφ hφc + change (∫ x, dφ x • (θk k x • ψ σ x)) = + -(∫ x, φ x • ((fderiv ℝ (θk k) x (coordinateDirection i a)) • ψ σ x + + θk k x • g σ i a x)) at h + simpa only [smul_add, smul_smul, mul_comm] using h + have ht := tendsto_nhds_unique hleft (hright.neg.congr' (Eventually.of_forall fun k => (heq k).symm)) + change (∫ x, dφ x • (θ x • ψ σ x)) = + -(∫ x, φ x • (Dθ i a x • ψ σ x + θ x • g σ i a x)) + simpa only [smul_add, smul_smul, mul_comm] using ht + +theorem memLp_bounded_measurable_real_smul {n : ℕ} {f : Configuration n → ℂ} + (hf : MemLp f 2 volume) {θ : Configuration n → ℝ} + (hθ : AEStronglyMeasurable θ volume) + (hb : ∃ C : ℝ, ∀ x, |θ x| ≤ C) : MemLp (fun x => θ x • f x) 2 volume := by + obtain ⟨C,hC⟩ := hb + apply hf.of_le_mul (c := C) (hθ.smul hf.aestronglyMeasurable) + exact Eventually.of_forall fun x => by + change ‖θ x • f x‖ ≤ C * ‖f x‖ + rw [norm_smul, Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_right (hC x) (norm_nonneg _) + +theorem FormDomain.multiply_limit {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : FormDomain ψ g) + {θ : Configuration n → ℝ} {Dθ : Fin n → Fin 3 → Configuration n → ℝ} + {θk : ℕ → Configuration n → ℝ} + (hθ : Continuous θ) (hsym : ∀ (p : Equiv.Perm (Fin n)) x, θ (x ∘ p) = θ x) + (hD : ∀ i a, AEStronglyMeasurable (Dθ i a) volume) + (hθk : ∀ k, ContDiff ℝ ∞ (θk k)) + (hb : ∃ C : ℝ, ∀ k x, |θk k x| ≤ C) + (hdb : ∀ i a, ∃ C : ℝ, ∀ k x, + |fderiv ℝ (θk k) x (coordinateDirection i a)| ≤ C) + (hl : ∀ x, Tendsto (fun k => θk k x) atTop (𝓝 (θ x))) + (hdl : ∀ i a x, Tendsto + (fun k => fderiv ℝ (θk k) x (coordinateDirection i a)) atTop (𝓝 (Dθ i a x))) : + FormDomain (multiplyWavefunction θ ψ) (explicitMultiplyGradient θ Dθ ψ g) := by + have hbθ : ∃ C : ℝ, ∀ x, |θ x| ≤ C := by + obtain ⟨C,hC⟩ := hb + exact ⟨C, fun x => le_of_tendsto (hl x).abs (Eventually.of_forall fun k => hC k x)⟩ + have hbD : ∀ i a, ∃ C : ℝ, ∀ x, |Dθ i a x| ≤ C := by + intro i a + obtain ⟨C,hC⟩ := hdb i a + exact ⟨C, fun x => le_of_tendsto (hdl i a x).abs (Eventually.of_forall fun k => hC k x)⟩ + refine ⟨hg.1.multiply hsym, + hg.2.1.multiply_limit hg.2.2.1 hg.2.2.2.1 hθk hb hdb hl hdl, ?_, ?_, ?_, ?_⟩ + · intro σ + exact memLp_bounded_real_smul (hg.2.2.1 σ) hθ hbθ + · intro σ i a + exact (memLp_bounded_measurable_real_smul (hg.2.2.1 σ) (hD i a) (hbD i a)).add + (memLp_bounded_real_smul (hg.2.2.2.1 σ i a) hθ hbθ) + · intro σ i + exact integrable_weight_multiply hθ hbθ ψ σ (hg.2.2.2.2.1 σ i) + · intro σ i j hij + exact integrable_weight_multiply hθ hbθ ψ σ (hg.2.2.2.2.2 σ i j hij) + +def explicitLocalizationError {n : ℕ} (ψ : Wavefunction n) + (Dθ : Fin n → Fin 3 → Configuration n → ℝ) : ℝ := + (1/2:ℝ)*(∑ σ : Spins n, ∑ i : Fin n, ∑ a : Fin 3, + ∫ x : Configuration n, (Dθ i a x)^2*‖ψ σ x‖^2) + +theorem energy_localization_explicit {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {θ : Configuration n → ℝ} + {Dθ : Fin n → Fin 3 → Configuration n → ℝ} + (hsq : SmoothMultiplier (fun x => θ x^2)) + (hD : ∀ i a, AEStronglyMeasurable (Dθ i a) volume) + (hDb : ∀ i a, ∃ C : ℝ, ∀ x, |Dθ i a x| ≤ C) + (hrel : ∀ i a x, fderiv ℝ (fun y => θ y^2) x (coordinateDirection i a) = + 2*θ x*Dθ i a x) : + energy Z (multiplyWavefunction θ ψ) (explicitMultiplyGradient θ Dθ ψ g) = + formMultiplierPairing Z ψ g (fun x => θ x^2) + explicitLocalizationError ψ Dθ := by + have hpw : ∀ σ i a x, ‖explicitMultiplyGradient θ Dθ ψ g σ i a x‖^2 = + inner ℝ (g σ i a x) (multiplyGradient (fun y => θ y^2) ψ g σ i a x) + + (Dθ i a x)^2*‖ψ σ x‖^2 := by + intro σ i a x + simp only [explicitMultiplyGradient, multiplyGradient, hrel, norm_add_sq_real, norm_smul, + inner_add_right, real_inner_smul_left, real_inner_smul_right, + real_inner_self_eq_norm_sq, Real.norm_eq_abs, mul_pow, sq_abs] + rw [real_inner_comm (ψ σ x) (g σ i a x)] + ring + have herr : ∀ σ i a, Integrable (fun x : Configuration n => (Dθ i a x)^2*‖ψ σ x‖^2) := by + intro σ i a + have hl := memLp_bounded_measurable_real_smul (hd.2.2.1 σ) (hD i a) (hDb i a) + simpa only [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] using hl.norm.integrable_sq + have hi : ∀ σ i a, (∫ x : Configuration n, ‖explicitMultiplyGradient θ Dθ ψ g σ i a x‖^2) = + (∫ x : Configuration n, + inner ℝ (g σ i a x) (multiplyGradient (fun y => θ y^2) ψ g σ i a x)) + + ∫ x : Configuration n, (Dθ i a x)^2*‖ψ σ x‖^2 := by + intro σ i a + simp_rw [hpw] + exact integral_add (integrable_real_inner_of_memLp (hd.2.2.2.1 σ i a) + ((hd.multiply hsq).2.2.2.1 σ i a)) (herr σ i a) + simp only [energy, formMultiplierPairing, explicitLocalizationError, hi, + norm_multiplyWavefunction_sq, Finset.sum_add_distrib, mul_left_comm (coulombPotential Z _)] + ring + +open scoped ENNReal Convolution + +def observationNoiseBase (u : ℝ) : ℝ := expNegInvGlue (1-u^2) + +theorem observationNoiseBase_contDiff : ContDiff ℝ ∞ observationNoiseBase := + expNegInvGlue.contDiff.comp (contDiff_const.sub (contDiff_id.pow 2)) + +theorem observationNoiseBase_nonneg (u : ℝ) : 0 ≤ observationNoiseBase u := + expNegInvGlue.nonneg _ + +theorem observationNoiseBase_formula (u : ℝ) : + observationNoiseBase u = if |u| < 1 then Real.exp (-(1-u^2)⁻¹) else 0 := by + have he : 0 < 1-u^2 ↔ |u| < 1 := by + rw [abs_lt] + constructor + · intro hh + constructor <;> nlinarith [sq_nonneg (u+1), sq_nonneg (u-1)] + · rintro ⟨hl,hu⟩ + nlinarith [mul_pos (by linarith : 0 < u+1) (by linarith : 0 < 1-u)] + unfold observationNoiseBase expNegInvGlue + by_cases hu : |u| < 1 + · simp [hu, not_le.mpr (he.mpr hu)] + · simp [hu, le_of_not_gt (he.not.mpr hu)] + +theorem observationNoiseBase_compact : HasCompactSupport observationNoiseBase := by + apply HasCompactSupport.intro (isCompact_Icc : IsCompact (Set.Icc (-1:ℝ) 1)) + intro u hu + rw [observationNoiseBase_formula, ite_eq_right] + intro hh + exact hu ⟨(abs_lt.mp hh).1.le, (abs_lt.mp hh).2.le⟩ + +theorem observationNoiseBase_integrable : Integrable observationNoiseBase := + observationNoiseBase_contDiff.continuous.integrable_of_hasCompactSupport + observationNoiseBase_compact + +theorem observationNoiseBase_integral_pos : 0 < ∫ u, observationNoiseBase u := by + apply integral_pos_of_integrable_nonneg_nonzero + observationNoiseBase_contDiff.continuous observationNoiseBase_integrable + observationNoiseBase_nonneg (x := 0) + exact (expNegInvGlue.pos_of_pos (by norm_num : (0:ℝ) < 1-0^2)).ne' + +def observationNoiseNormalizer : ℝ := (∫ u, observationNoiseBase u)⁻¹ + +def observationNoiseDensity (u : ℝ) : ℝ := observationNoiseNormalizer*observationNoiseBase u + +theorem observationNoiseDensity_nonneg (u : ℝ) : 0 ≤ observationNoiseDensity u := + mul_nonneg (inv_nonneg.mpr observationNoiseBase_integral_pos.le) + (observationNoiseBase_nonneg u) + +theorem observationNoiseDensity_contDiff : ContDiff ℝ ∞ observationNoiseDensity := + contDiff_const.mul observationNoiseBase_contDiff + +theorem observationNoiseDensity_integrable : Integrable observationNoiseDensity := + observationNoiseBase_integrable.const_mul _ + +theorem observationNoiseDensity_mass : (∫ u, observationNoiseDensity u) = 1 := by + unfold observationNoiseDensity + rw [integral_const_mul, observationNoiseNormalizer] + exact inv_mul_cancel₀ observationNoiseBase_integral_pos.ne' + +def observationNoiseLaw : Measure ℝ := volume.withDensity + (fun u => ENNReal.ofReal (observationNoiseDensity u)) + +instance observationNoiseLaw_probability : IsProbabilityMeasure observationNoiseLaw := by + constructor + rw [observationNoiseLaw, withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ, + ← ofReal_integral_eq_lintegral_ofReal observationNoiseDensity_integrable + (Filter.Eventually.of_forall observationNoiseDensity_nonneg), observationNoiseDensity_mass] + norm_num + +theorem observationNoiseDensity_formula (u : ℝ) : + observationNoiseDensity u = observationNoiseNormalizer* + (if |u| < 1 then Real.exp (-(1-u^2)⁻¹) else 0) := by + rw [observationNoiseDensity, observationNoiseBase_formula] + +def observationTranslationScore (u : ℝ) : ℝ := 2 * u / (1-u^2)^2 + +theorem observationTranslationScore_measurable : Measurable observationTranslationScore := by + unfold observationTranslationScore + fun_prop + +theorem observationNoiseDensity_even (u : ℝ) : + observationNoiseDensity (-u) = observationNoiseDensity u := by + simp [observationNoiseDensity, observationNoiseBase] + +theorem observationTranslationScore_odd (u : ℝ) : + observationTranslationScore (-u) = -observationTranslationScore u := by + simp [observationTranslationScore, neg_div] + +theorem observationNoiseDensity_hasDerivAt (u : ℝ) : + HasDerivAt observationNoiseDensity + (-observationTranslationScore u * observationNoiseDensity u) u := by + have hg : HasDerivAt expNegInvGlue + ((1-u^2)⁻¹ ^ 2 * expNegInvGlue (1-u^2)) (1-u^2) := by + simpa using expNegInvGlue.hasDerivAt_polynomial_eval_inv_mul (1 : Polynomial ℝ) (1-u^2) + have hi : HasDerivAt (fun v : ℝ => 1-v^2) (-2*u) u := by + convert! (hasDerivAt_pow 2 u).const_sub 1 using 1 + ring + convert! (hg.comp u hi).const_mul observationNoiseNormalizer using 1 + simp only [observationNoiseDensity, observationNoiseBase, observationTranslationScore, + div_eq_mul_inv, inv_pow] + ring + +theorem pow_mul_exp_neg_le_factorial (k : ℕ) {t : ℝ} (ht : 0 ≤ t) : + t^k * Real.exp (-t) ≤ (k.factorial : ℝ) := by + have hk : (0:ℝ) < k.factorial := by positivity + have h := (div_le_iff₀ hk).mp (Real.pow_div_factorial_le_exp t ht k) + have hh := mul_le_mul_of_nonneg_right h (Real.exp_pos (-t)).le + simpa [Real.exp_neg, mul_assoc, mul_left_comm, mul_comm] using hh + +theorem observationScore_weighted_pow_bound (q : ℕ) (u : ℝ) : + |observationTranslationScore u|^q * observationNoiseDensity u ≤ + (Set.Icc (-1:ℝ) 1).indicator + (fun _ => observationNoiseNormalizer * 2^q * ((2*q).factorial : ℝ)) u := by + classical + have hc : 0 ≤ observationNoiseNormalizer := + inv_nonneg.mpr observationNoiseBase_integral_pos.le + by_cases hu : |u| < 1 + · have hb : u ∈ Set.Icc (-1:ℝ) 1 := + ⟨(abs_lt.mp hu).1.le, (abs_lt.mp hu).2.le⟩ + rw [Set.indicator_of_mem hb, observationNoiseDensity_formula, ite_eq_left hu] + have hv : 0 < 1-u^2 := sub_pos.mpr ((sq_lt_one_iff_abs_lt_one u).mpr hu) + have hs : |observationTranslationScore u| ≤ 2 * ((1-u^2)⁻¹)^2 := by + unfold observationTranslationScore + rw [abs_div, abs_mul, abs_of_pos (by norm_num : (0:ℝ) < 2), abs_pow, abs_of_pos hv] + rw [div_eq_mul_inv, inv_pow] + nlinarith [mul_le_mul_of_nonneg_right hu.le + (inv_nonneg.mpr (sq_nonneg (1-u^2)))] + calc + |observationTranslationScore u|^q * + (observationNoiseNormalizer * Real.exp (-(1-u^2)⁻¹)) ≤ + (2 * ((1-u^2)⁻¹)^2)^q * + (observationNoiseNormalizer * Real.exp (-(1-u^2)⁻¹)) := + mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (abs_nonneg _) hs q) + (mul_nonneg hc (Real.exp_pos _).le) + _ = (observationNoiseNormalizer * 2^q) * + (((1-u^2)⁻¹)^(2*q) * Real.exp (-(1-u^2)⁻¹)) := by + rw [mul_pow, pow_mul]; ring + _ ≤ (observationNoiseNormalizer * 2^q) * ((2*q).factorial : ℝ) := + mul_le_mul_of_nonneg_left + (pow_mul_exp_neg_le_factorial (2*q) (inv_nonneg.mpr hv.le)) + (mul_nonneg hc (by positivity)) + · rw [observationNoiseDensity_formula, ite_eq_right hu] + simp only [mul_zero] + exact Set.indicator_nonneg (fun _ _ => by positivity) u + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/FieldOptimization.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/FieldOptimization.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b7fb59f1dd04c0132109ec6b7414ddb794d157a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/FieldOptimization.lean @@ -0,0 +1,85 @@ +import Mathlib + +namespace OAI + +section +section +open scoped BigOperators +noncomputable section +namespace Coulomb + +lemma trial_kinetic_absorption {a M m : ℝ} (ha : 0 ≤ a) (hm : 0 ≤ m) + (hM : m ≤ M) (hs : 1 ≤ a*m^(1/3:ℝ)) : M^(5/3:ℝ) ≤ a*M^2 := by + have hM0 : 0 ≤ M := hm.trans hM + have hsM : 1 ≤ a*M^(1/3:ℝ) := hs.trans + (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow hm hM (by norm_num)) ha) + rcases eq_or_lt_of_le hM0 with h | h + · simp [←h] + · have he : M^(5/3:ℝ)*M^(1/3:ℝ) = M^2 := by + rw [←Real.rpow_add h] + norm_num + calc + M^(5/3:ℝ) ≤ M^(5/3:ℝ)*(a*M^(1/3:ℝ)) := + le_mul_of_one_le_right (Real.rpow_nonneg hM0 _) hsM + _ = a*M^2 := by rw [←he]; ring + +theorem positive_field_trial_optimization {E e a h C m : ℝ} + (ha : 0 < a) (hC : 0 < C) (hm : 0 ≤ m) + (ham : 1 ≤ a*m) (ham' : 1 ≤ a*m^(1/3:ℝ)) + (htrial : ∀ M : ℝ, 0 ≤ M → + E ≤ e-M*h+C*(M^(5/3:ℝ)/a^2+M/a^2+M^2/a)) : + E ≤ e-a*(max h 0)^2/(16*C)+4*C*m^2/a := by + have hE : E ≤ e := by simpa using htrial 0 (le_refl 0) + have hp : 0 ≤ max h 0 := le_max_right _ _ + by_cases hh : a*max h 0 ≤ 8*C*m + · have hs : (a*max h 0)^2 ≤ (8*C*m)^2 := + pow_le_pow_left₀ (mul_nonneg ha.le hp) hh 2 + have hg : a*(max h 0)^2/(16*C) ≤ 4*C*m^2/a := by + apply (div_le_div_iff₀ (by positivity : 0 < 16*C) ha).2 + nlinarith [hs] + linarith + · have hh' : 8*C*m < a*max h 0 := lt_of_not_ge hh + have hhp : 0 < h := by + by_contra hn + rw [max_eq_right (le_of_not_gt hn)] at hh' + have : 0 ≤ 8*C*m := by positivity + nlinarith + rw [max_eq_left hhp.le] at hh' ⊢ + let M : ℝ := a*h/(8*C) + have hM0 : 0 ≤ M := by dsimp [M]; positivity + have hmM : m ≤ M := by + apply (le_div_iff₀ (by positivity : 0 < 8*C)).2 + linarith + have hk := trial_kinetic_absorption ha.le hm hmM ham' + have hq : C*M^2/a = M*h/8 := by + dsimp [M] + field_simp + have hscale : 8*C ≤ a^2*h := by + have H := mul_le_mul_of_nonneg_left hh'.le ha.le + have H' := mul_le_mul_of_nonneg_left ham (show 0 ≤ 8*C by positivity) + nlinarith + have hl : C*M/a^2 ≤ M*h/8 := by + apply (div_le_div_iff₀ (by positivity : 0 < a^2) (by norm_num : (0:ℝ)<8)).2 + nlinarith [mul_le_mul_of_nonneg_left hscale hM0] + have ht : C*(M^(5/3:ℝ)/a^2) ≤ M*h/8 := by + calc + _ ≤ C*(a*M^2/a^2) := mul_le_mul_of_nonneg_left + (div_le_div_of_nonneg_right hk (sq_nonneg a)) hC.le + _ = C*M^2/a := by field_simp + _ = M*h/8 := hq + have hgain : M*h/2 = a*h^2/(16*C) := by dsimp [M]; ring + have H := htrial M hM0 + have herr : 0 ≤ 4*C*m^2/a := by positivity + have hMh : 0 ≤ M*h := mul_nonneg hM0 hhp.le + rw [mul_add,mul_add] at H + simp only [←mul_div_assoc] at H ht + rw [hq] at H + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/H1EnergyLimit.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/H1EnergyLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c92986b9d7a221c8d1e0b7cac41831fb3b9e1be --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/H1EnergyLimit.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.L2MultiplierContinuity + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology ComplexConjugate BigOperators +noncomputable section +namespace Coulomb +lemma pairEnergy_eq_sum {n:ℕ} (u:H1Vector n) : + pairEnergy u=∑ s,∑ i,∑ j,if i if i integrable_finsetSum _ (fun j _ => hi i j))] + apply Finset.sum_congr rfl + intro i _ + rw [integral_finsetSum _ (fun j _ => hi i j)] + apply Finset.sum_congr rfl + intro j _ + split_ifs <;> simp_all + +lemma nuclearEnergy_strong_tendsto {M n:ℕ} (S:Nuclei M) (u:ℕ → H1Vector n) (v:H1Vector n) + (hv:∀ s,Tendsto (fun k => (u k).valueL2 s) atTop (𝓝 (v.valueL2 s))) + (K:ℝ) (hK:∀ k,kinetic (u k)≤K) : + Tendsto (fun k => nuclearEnergy S (u k)) atTop (𝓝 (nuclearEnergy S v)) := by + simp only [nuclearEnergy_eq_sum] + apply tendsto_finsetSum + intro s _ + apply tendsto_finsetSum + intro i _ + apply tendsto_finsetSum + intro j _ + apply Tendsto.const_mul + simpa only [hardyCoulomb_nuclear] using hardy_form_strong_tendsto u v s i (nuclearHardyCoordinates i (S.position j)) (hv s) K hK + +lemma pairEnergy_strong_tendsto {n:ℕ} (u:ℕ → H1Vector n) (v:H1Vector n) + (hv:∀ s,Tendsto (fun k => (u k).valueL2 s) atTop (𝓝 (v.valueL2 s))) + (K:ℝ) (hK:∀ k,kinetic (u k)≤K) : + Tendsto (fun k => pairEnergy (u k)) atTop (𝓝 (pairEnergy v)) := by + simp only [pairEnergy_eq_sum] + apply tendsto_finsetSum + intro s _ + apply tendsto_finsetSum + intro i _ + apply tendsto_finsetSum + intro j _ + by_cases h:i inner ℂ w (u k i)) atTop (𝓝 (inner ℂ w (v i)))) + (hL:Tendsto (fun k => ∑ i,‖u k i‖^2) atTop (𝓝 L)) : ∑ i,‖v i‖^2≤L := by + let U:ℕ → PiLp 2 (fun _:ι => H):=fun k => WithLp.toLp 2 (u k) + let V:PiLp 2 (fun _:ι => H):=WithLp.toLp 2 v + have hL0:0≤L := ge_of_tendsto hL (Eventually.of_forall fun k => Finset.sum_nonneg fun i _ => sq_nonneg _) + have hW:∀ W:PiLp 2 (fun _:ι => H),Tendsto (fun k => inner ℂ W (U k)) atTop (𝓝 (inner ℂ W V)) := by + intro W + simp only [PiLp.inner_apply,U,V] + exact tendsto_finsetSum _ (fun i _ => hw i (W i)) + apply le_of_forall_pos_le_add + intro ε hε + have hU:∀ᶠ k in atTop,‖U k‖≤Real.sqrt (L+ε) := by + filter_upwards [hL.eventually (gt_mem_nhds (show L (u k).valueL2 s) atTop (𝓝 (v.valueL2 s))) + (hw:∀ s a w,Tendsto (fun k => inner ℂ w ((u k).gradientL2 s a)) atTop + (𝓝 (inner ℂ w (v.gradientL2 s a)))) + (K:ℝ) (hK:∀ k,kinetic (u k)≤K) (E:ℝ) + (hE:Tendsto (fun k => form S (u k)) atTop (𝓝 E)) : form S v≤E := by + let : Fact ((2:ℝ≥0∞)≠(⊤:ℝ≥0∞)) := ⟨by norm_num⟩ + have hkin:Tendsto (fun k => kinetic (u k)) atTop (𝓝 (E+nuclearEnergy S v-pairEnergy v)) := by + convert (hE.add (nuclearEnergy_strong_tendsto S u v hv K hK)).sub (pairEnergy_strong_tendsto u v hv K hK) using 1 + ext k; unfold form; ring + have H:=finite_weak_norm_sq_le_of_tendsto + (fun k (sa:Spins n × (Fin n × Fin 3)) => (u k).gradientL2 sa.1 sa.2) + (fun sa => v.gradientL2 sa.1 sa.2) (2*(E+nuclearEnergy S v-pairEnergy v)) + (fun sa => hw sa.1 sa.2) (by + convert hkin.const_mul 2 using 1 + ext k + rw [H1Vector.kinetic_eq_norm,Fintype.sum_prod_type] + ring) + rw [Fintype.sum_prod_type] at H + rw [form,H1Vector.kinetic_eq_norm] + linarith +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/H1Pairing.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/H1Pairing.lean new file mode 100644 index 0000000000000000000000000000000000000000..136fe259faa7f0d63fde9b586fa8fbff62543d82 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/H1Pairing.lean @@ -0,0 +1,215 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PotentialAddRsmul +import OAI.Analysis.CoulombRadii.SpectralTheory.SectorFormBottom +import OAI.Analysis.CoulombRadii.FormDomain.CoreKinetic +import OAI.Analysis.CoulombRadii.FormDomain.H1VectorL2 + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace Coulomb +lemma real_inner_norm_algebra (z w:ℂ) : + 2*inner ℝ z w=‖z+w‖^2-‖z‖^2-‖w‖^2 := by + nlinarith [norm_add_sq_real z w] +lemma weighted_inner_integrable {X:Type*} [MeasurableSpace X] {μ:Measure X} + {f g:X → ℂ} {V:X → ℝ} + (hf:Integrable (fun x => V x*‖f x‖^2) μ) + (hg:Integrable (fun x => V x*‖g x‖^2) μ) + (ha:Integrable (fun x => V x*‖f x+g x‖^2) μ) : + Integrable (fun x => V x*inner ℝ (f x) (g x)) μ := by + convert ((ha.sub hf).sub hg).div_const 2 using 1 + ext x + dsimp only [Pi.sub_apply] + nlinarith [congrArg (fun t:ℝ => V x*t) (real_inner_norm_algebra (f x) (g x))] +lemma integral_weighted_inner {X:Type*} [MeasurableSpace X] {μ:Measure X} + {f g:X → ℂ} {V:X → ℝ} + (hf:Integrable (fun x => V x*‖f x‖^2) μ) + (hg:Integrable (fun x => V x*‖g x‖^2) μ) + (ha:Integrable (fun x => V x*‖f x+g x‖^2) μ) : + 2*(∫ x,V x*inner ℝ (f x) (g x) ∂μ)= + (∫ x,V x*‖f x+g x‖^2 ∂μ)-(∫ x,V x*‖f x‖^2 ∂μ)-(∫ x,V x*‖g x‖^2 ∂μ) := by + rw [←integral_const_mul] + calc + _ = ∫ x,(V x*‖f x+g x‖^2-V x*‖f x‖^2)-V x*‖g x‖^2 ∂μ := by + apply integral_congr_ae + filter_upwards [] with x + nlinarith [congrArg (fun t:ℝ => V x*t) (real_inner_norm_algebra (f x) (g x))] + _ = _ := by + have H:=integral_sub (ha.sub hf) hg + simp only [Pi.sub_apply] at H + rw [H,integral_sub ha hf] + +def massPair {n:ℕ} (u v:H1Vector n) : ℝ := ∑ s,∫ x,inner ℝ (u.value s x) (v.value s x) +def kineticPair {n:ℕ} (u v:H1Vector n) : ℝ := (1/2:ℝ)*∑ s,∑ a,∫ x,inner ℝ (u.gradient s a x) (v.gradient s a x) +def nuclearPair {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) : ℝ := + ∑ s,∫ x,(∑ i,attraction S (position x i))*inner ℝ (u.value s x) (v.value s x) +def repulsionPair {n:ℕ} (u v:H1Vector n) : ℝ := + ∑ s,∫ x,pairPotential x*inner ℝ (u.value s x) (v.value s x) +def formPair {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) : ℝ := kineticPair u v-nuclearPair S u v+repulsionPair u v +lemma massPair_polarization {n:ℕ} (u v:H1Vector n) : + 2*massPair u v=mass (u.add v)-mass u-mass v := by + unfold massPair mass + rw [Finset.mul_sum,←Finset.sum_sub_distrib,←Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro s _ + simpa only [one_mul,H1Vector.add] using integral_weighted_inner (V:=fun _ => 1) + (by simpa using (u.value_L2 s).integrable_norm_pow (by norm_num)) + (by simpa using (v.value_L2 s).integrable_norm_pow (by norm_num)) + (by simpa only [one_mul,H1Vector.add] using ((u.add v).value_L2 s).integrable_norm_pow (by norm_num)) +lemma kineticPair_polarization {n:ℕ} (u v:H1Vector n) : + 2*kineticPair u v=kinetic (u.add v)-kinetic u-kinetic v := by + have h(s:Spins n)(a:Fin n × Fin 3) : + 2*(∫ x,inner ℝ (u.gradient s a x) (v.gradient s a x))= + (∫ x,‖(u.add v).gradient s a x‖^2)-(∫ x,‖u.gradient s a x‖^2)-(∫ x,‖v.gradient s a x‖^2) := by + simpa only [one_mul,H1Vector.add] using integral_weighted_inner (V:=fun _ => 1) + (by simpa using (u.partial_L2 s a).integrable_norm_pow (by norm_num)) + (by simpa using (v.partial_L2 s a).integrable_norm_pow (by norm_num)) + (by simpa only [one_mul,H1Vector.add] using ((u.add v).partial_L2 s a).integrable_norm_pow (by norm_num)) + have H:=congrArg (fun f:Spins n → (Fin n × Fin 3) → ℝ => ∑ s,∑ a,f s a) (funext fun s => funext fun a => h s a) + simp only [Finset.sum_sub_distrib,←Finset.mul_sum] at H + unfold kinetic kineticPair + linarith +lemma nuclearPair_polarization {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) : + 2*nuclearPair S u v=nuclearEnergy S (u.add v)-nuclearEnergy S u-nuclearEnergy S v := by + unfold nuclearPair nuclearEnergy + rw [Finset.mul_sum,←Finset.sum_sub_distrib,←Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro s _ + exact integral_weighted_inner (u.nuclear_integrable S s) (v.nuclear_integrable S s) ((u.add v).nuclear_integrable S s) +lemma repulsionPair_polarization {n:ℕ} (u v:H1Vector n) : + 2*repulsionPair u v=pairEnergy (u.add v)-pairEnergy u-pairEnergy v := by + unfold repulsionPair pairEnergy + rw [Finset.mul_sum,←Finset.sum_sub_distrib,←Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro s _ + exact integral_weighted_inner (u.pair_integrable s) (v.pair_integrable s) ((u.add v).pair_integrable s) +lemma formPair_polarization {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) : + 2*formPair S u v=form S (u.add v)-form S u-form S v := by + unfold formPair form + linarith [kineticPair_polarization u v,nuclearPair_polarization S u v,repulsionPair_polarization u v] +lemma formPair_kinetic_integrable {n:ℕ} (u v:H1Vector n) (s:Spins n) (a:Fin n × Fin 3) : + Integrable (fun x => inner ℝ (u.gradient s a x) (v.gradient s a x)) := + memlp_real_inner_integrable (u.partial_L2 s a) (v.partial_L2 s a) +lemma formPair_nuclear_integrable {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) (s:Spins n) : + Integrable (fun x => (∑ i,attraction S (position x i))*inner ℝ (u.value s x) (v.value s x)) := + weighted_inner_integrable (u.nuclear_integrable S s) (v.nuclear_integrable S s) ((u.add v).nuclear_integrable S s) +lemma formPair_repulsion_integrable {n:ℕ} (u v:H1Vector n) (s:Spins n) : + Integrable (fun x => pairPotential x*inner ℝ (u.value s x) (v.value s x)) := + weighted_inner_integrable (u.pair_integrable s) (v.pair_integrable s) ((u.add v).pair_integrable s) + +lemma form_ge_sector_bottom {M n:ℕ} (S:Nuclei M) (u:H1Vector n) + (ha:Antisymmetric u) (E:ℝ) (hE:(E:EReal) ≤ sectorFormBottom S n) : + E*mass u ≤ form S u := by + rw [←form_normalized_weight S u] + by_cases hz:mass u=0 + · simp [hz] + · have hp:0 < mass u:=lt_of_le_of_ne (mass_nonneg u) (Ne.symm hz) + have H:E≤form S u.normalized:=EReal.coe_le_coe_iff.mp (hE.trans (sInf_le + ⟨u.normalized,ha.normalized,mass_normalized u hp,rfl⟩)) + simpa [mul_comm] using mul_le_mul_of_nonneg_left H hp.le + +lemma sector_minimizer_weak_eigen (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} + (u:H1Vector n) (ha:Antisymmetric u) (hm:mass u=1) + (hmin:(form (atom Z hZ) u:EReal)=sectorFormBottom (atom Z hZ) n) + (v:H1Vector n) (hv:Antisymmetric v) : + formPair (atom Z hZ) u v=form (atom Z hZ) u*massPair u v := by + let E:=form (atom Z hZ) u + let A:=form (atom Z hZ) (u.add v)-form (atom Z hZ) u-form (atom Z hZ) v- + E*(mass (u.add v)-mass u-mass v) + let B:=form (atom Z hZ) v-E*mass v + have hpoly:∀ᶠ t:ℝ in 𝓝 0,0 ≤ A*t+B*t^2 := by + apply Eventually.of_forall + intro t + have H:=form_ge_sector_bottom (atom Z hZ) (u.add (v.rsmul t)) (ha.add (hv.rsmul t)) E hmin.le + rw [mass_add_rsmul,form_add_rsmul,hm] at H + dsimp [E] at H + dsimp [A,B,E] + rw [hm] + nlinarith only [H] + have H:=linear_term_zero_of_eventually_quadratic_nonneg A B hpoly + dsimp [A,E] at H + rw [←formPair_polarization,←massPair_polarization] at H + linarith +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace Coulomb +lemma integrable_real_bounded_mul {X:Type*} [TopologicalSpace X] [MeasureSpace X] + [BorelSpace X] {f F:X → ℝ} (hf:Integrable f) (hF:Continuous F) + (B:ℝ) (hB:∀ x,|F x|≤B) : Integrable (fun x => F x*f x) := + hf.bdd_mul hF.aestronglyMeasurable (Eventually.of_forall fun x => by simpa only [Real.norm_eq_abs] using hB x) + +lemma reciprocal_kinetic_nonneg {n:ℕ} (u:H1Vector n) (s:Spins n) + (I:Finset (Fin n × Fin 3)) (U w:Configuration n → ℝ) + (hU:ContDiff ℝ ∞ U) (hw:ContDiff ℝ ∞ w) + (BU DU Dw Bw DDU:ℝ) + (hBU:∀ x,|U x|≤BU) (hDU:∀ a x,|fderiv ℝ U x (EuclideanSpace.single a 1)|≤DU) + (hBw:∀ x,|w x|≤Bw) (hDw:∀ a x,|fderiv ℝ w x (EuclideanSpace.single a 1)|≤Dw) + (hDDU:∀ a b x,|fderiv ℝ (fun y => fderiv ℝ U y (EuclideanSpace.single a 1)) x (EuclideanSpace.single b 1)|≤DDU) + (hpos:∀ x,0≤U x) (hinv:∀ x,U x*w x=1) + (hlap:∀ x,(∑ a∈I,fderiv ℝ (fun y => fderiv ℝ U y (EuclideanSpace.single a 1)) x (EuclideanSpace.single a 1))≤0) : + let v:=u.smoothMul w hw Bw Dw hBw hDw + 0≤∑ a∈I,∫ x,inner ℝ (u.gradient s a x) (v.gradient s a x) := by + dsimp only + let v:=u.smoothMul w hw Bw Dw hBw hDw + let z:=v.smoothMul U hU BU DU hBU hDU + have he:∀ t,u.value t=ᵐ[volume]z.value t := by + intro t + exact Eventually.of_forall fun x => by + change u.value t x=(U x:ℂ)*((w x:ℂ)*u.value t x) + rw [←mul_assoc,←Complex.ofReal_mul,hinv x] + simp + let dU:=fun a (x:Configuration n) => fderiv ℝ U x (EuclideanSpace.single a 1) + let ddU:=fun a (x:Configuration n) => fderiv ℝ (dU a) x (EuclideanSpace.single a 1) + have hd(a:Fin n × Fin 3):ContDiff ℝ ∞ (dU a):= + (hU.fderiv_right (by simp)).clm_apply contDiff_const + have hi(a:Fin n × Fin 3):Integrable (fun x => U x*‖v.gradient s a x‖^2) := + integrable_real_bounded_mul ((v.partial_L2 s a).integrable_norm_pow (by norm_num)) hU.continuous BU hBU + have hj(a:Fin n × Fin 3):Integrable (fun x => dU a x*inner ℝ (v.value s x) (v.gradient s a x)) := + integrable_real_bounded_mul (memlp_real_inner_integrable (v.value_L2 s) (v.partial_L2 s a)) + (hd a).continuous DU (hDU a) + have hk(a:Fin n × Fin 3):Integrable (fun x => ddU a x*‖v.value s x‖^2) := + integrable_real_bounded_mul ((v.value_L2 s).integrable_norm_pow (by norm_num)) + (((hd a).continuous_fderiv (by simp)).clm_apply continuous_const) DDU (hDDU a a) + have hblock(a:Fin n × Fin 3): + (∫ x,inner ℝ (u.gradient s a x) (v.gradient s a x))= + (∫ x,U x*‖v.gradient s a x‖^2)-(1/2:ℝ)*(∫ x,ddU a x*‖v.value s x‖^2) := by + have H:=h1_multiplier_ibp v s a (dU a) (hd a) DU DDU (hDU a) (hDDU a) + have H':(∫ x,inner ℝ (u.gradient s a x) (v.gradient s a x))= + (∫ x,U x*‖v.gradient s a x‖^2)+(∫ x,dU a x*inner ℝ (v.value s x) (v.gradient s a x)) := by + rw [←integral_add (hi a) (hj a)] + apply integral_congr_ae + filter_upwards [u.gradient_congr_ae z he s a] with x hx + rw [hx] + change inner ℝ ((dU a x:ℂ)*v.value s x+(U x:ℂ)*v.gradient s a x) (v.gradient s a x)=_ + simp only [inner_add_left,←Complex.real_smul,real_inner_smul_left,real_inner_self_eq_norm_sq] + ring + dsimp [ddU] at * + linarith + change 0≤∑ a∈I,∫ x,inner ℝ (u.gradient s a x) (v.gradient s a x) + simp_rw [hblock] + rw [Finset.sum_sub_distrib,←Finset.mul_sum] + have hh:0≤∑ a∈I,∫ x,U x*‖v.gradient s a x‖^2 := + Finset.sum_nonneg fun a _ => integral_nonneg fun x => mul_nonneg (hpos x) (sq_nonneg _) + have hneg:(∑ a∈I,∫ x,ddU a x*‖v.value s x‖^2)≤0 := by + rw [←integral_finsetSum _ (fun a _ => hk a)] + apply integral_nonpos + intro x + dsimp only [Pi.zero_apply] + rw [←Finset.sum_mul] + exact mul_nonpos_of_nonpos_of_nonneg (hlap x) (sq_nonneg _) + linarith +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/H1VectorL2.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/H1VectorL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8fd65ca8eb33ba3b773d5cd52dfb5b428499e5d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/H1VectorL2.lean @@ -0,0 +1,209 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.FermionicCoefficients +import OAI.Analysis.CoulombRadii.FormDomain.WeakFourierDerivative + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology ComplexConjugate ContDiff BigOperators +noncomputable section +namespace Coulomb +namespace H1Vector +variable {n:ℕ} +def valueL2 (u:H1Vector n) (s:Spins n) : Lp ℂ 2 (volume:Measure (Configuration n)) := + (u.value_L2 s).toLp (u.value s) +def gradientL2 (u:H1Vector n) (s:Spins n) (a:Fin n × Fin 3) : Lp ℂ 2 (volume:Measure (Configuration n)) := + (u.partial_L2 s a).toLp (u.gradient s a) +lemma valueL2_ae (u:H1Vector n) (s:Spins n) : (u.valueL2 s:Configuration n → ℂ)=ᵐ[volume]u.value s := + (u.value_L2 s).coeFn_toLp +lemma gradientL2_ae (u:H1Vector n) (s:Spins n) (a:Fin n × Fin 3) : + (u.gradientL2 s a:Configuration n → ℂ)=ᵐ[volume]u.gradient s a := + (u.partial_L2 s a).coeFn_toLp +lemma mass_eq_norm (u:H1Vector n) : mass u=∑ s,‖u.valueL2 s‖^2 := by + apply Finset.sum_congr rfl + intro s _ + rw [l2_norm_sq_integral] + apply integral_congr_ae + filter_upwards [u.valueL2_ae s] with x hx + rw [hx] +lemma kinetic_eq_norm (u:H1Vector n) : kinetic u=(1/2:ℝ)*∑ s,∑ a,‖u.gradientL2 s a‖^2 := by + unfold kinetic + congr 1 + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro a _ + rw [l2_norm_sq_integral] + apply integral_congr_ae + filter_upwards [u.gradientL2_ae s a] with x hx + rw [hx] +lemma weak_partial_L2 (u:H1Vector n) (s:Spins n) (a:Fin n × Fin 3) + (φ:Configuration n → ℝ) (hφ:ContDiff ℝ ∞ φ) (hc:HasCompactSupport φ) : + (∫ x,(fderiv ℝ φ x (EuclideanSpace.single a 1):ℂ)*u.valueL2 s x)= + -(∫ x,(φ x:ℂ)*u.gradientL2 s a x) := by + have h1:(∫ x,(fderiv ℝ φ x (EuclideanSpace.single a 1):ℂ)*u.valueL2 s x)= + ∫ x,u.value s x*(fderiv ℝ φ x (EuclideanSpace.single a 1):ℂ) := by + apply integral_congr_ae + filter_upwards [u.valueL2_ae s] with x hx + rw [hx,mul_comm] + have h2:(∫ x,(φ x:ℂ)*u.gradientL2 s a x)=∫ x,u.gradient s a x*(φ x:ℂ) := by + apply integral_congr_ae + filter_upwards [u.gradientL2_ae s a] with x hx + rw [hx,mul_comm] + rw [h1,h2] + exact u.weak_partial s a φ hφ hc + +def ofL2 (v:Spins n → Lp ℂ 2 (volume:Measure (Configuration n))) + (g:Spins n → (Fin n × Fin 3) → Lp ℂ 2 (volume:Measure (Configuration n))) + (hw:∀ s a (φ:Configuration n → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x (EuclideanSpace.single a 1):ℂ)*v s x)=-(∫ x,(φ x:ℂ)*g s a x)) : H1Vector n where + value:=fun s => v s + gradient:=fun s a => g s a + value_L2:=fun s => Lp.memLp (v s) + partial_L2:=fun s a => Lp.memLp (g s a) + weak_partial:=by + intro s a φ hφ hc + simpa only [mul_comm] using hw s a φ hφ hc +lemma ofL2_valueL2 (v:Spins n → Lp ℂ 2 (volume:Measure (Configuration n))) + (g:Spins n → (Fin n × Fin 3) → Lp ℂ 2 (volume:Measure (Configuration n))) hw (s:Spins n) : + (ofL2 v g hw).valueL2 s=v s := by + apply Lp.ext + exact (Lp.memLp (v s)).coeFn_toLp +lemma ofL2_gradientL2 (v:Spins n → Lp ℂ 2 (volume:Measure (Configuration n))) + (g:Spins n → (Fin n × Fin 3) → Lp ℂ 2 (volume:Measure (Configuration n))) hw (s:Spins n) (a:Fin n × Fin 3) : + (ofL2 v g hw).gradientL2 s a=g s a := by + apply Lp.ext + exact (Lp.memLp (g s a)).coeFn_toLp +end H1Vector + +lemma antisymmetric_iff_valueL2 {n:ℕ} (u:H1Vector n) : Antisymmetric u ↔ + ∀ (p:Equiv.Perm (Fin n)) (s:Spins n), + Lp.compMeasurePreservingₗᵢ ℂ (permute p) (permute_measurePreserving p) (u.valueL2 (s ∘ p))= + ((p.sign:ℤ):ℂ) • u.valueL2 s := by + constructor + · intro ha p s + apply Lp.ext + filter_upwards [Lp.coeFn_compMeasurePreserving (u.valueL2 (s ∘ p)) (permute_measurePreserving p), + (permute_measurePreserving p).quasiMeasurePreserving.ae (u.valueL2_ae (s ∘ p)), + Lp.coeFn_smul ((p.sign:ℤ):ℂ) (u.valueL2 s),u.valueL2_ae s,ha p s] with x h1 h2 h3 h4 h5 + change Lp.compMeasurePreserving (permute p) (permute_measurePreserving p) (u.valueL2 (s ∘ p)) x = _ + rw [h1,h3] + change u.valueL2 (s ∘ p) (permute p x) = ((p.sign:ℤ):ℂ) * u.valueL2 s x + rw [h2,h4] + exact h5 + · intro ha p s + have he:=Lp.ext_iff.mp (ha p s) + filter_upwards [he,Lp.coeFn_compMeasurePreserving (u.valueL2 (s ∘ p)) (permute_measurePreserving p), + (permute_measurePreserving p).quasiMeasurePreserving.ae (u.valueL2_ae (s ∘ p)), + Lp.coeFn_smul ((p.sign:ℤ):ℂ) (u.valueL2 s),u.valueL2_ae s] with x he h1 h2 h3 h4 + change Lp.compMeasurePreserving (permute p) (permute_measurePreserving p) (u.valueL2 (s ∘ p)) x = _ at he + rw [h1,h3] at he + change u.valueL2 (s ∘ p) (permute p x) = ((p.sign:ℤ):ℂ) * u.valueL2 s x at he + rwa [h2,h4] at he + +lemma antisymmetric_strong_limit {n:ℕ} (u:ℕ → H1Vector n) (v:H1Vector n) + (ha:∀ k,Antisymmetric (u k)) + (hv:∀ s,Tendsto (fun k => (u k).valueL2 s) atTop (𝓝 (v.valueL2 s))) : Antisymmetric v := by + rw [antisymmetric_iff_valueL2] + intro p s + have h1:=((Lp.compMeasurePreservingₗᵢ ℂ (permute p) (permute_measurePreserving p)).continuous.tendsto + (v.valueL2 (s ∘ p))).comp (hv (s ∘ p)) + have h2:=(hv s).const_smul (((p.sign:ℤ):ℂ)) + exact tendsto_nhds_unique h1 (by + convert h2 using 1 + apply funext + intro k + exact (antisymmetric_iff_valueL2 (u k)).mp (ha k) p s) +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology FourierTransform ComplexConjugate BigOperators ContDiff +noncomputable section +namespace Coulomb +lemma memlp_real_inner_integrable {X:Type*} [MeasurableSpace X] {μ:Measure X} + {f g:X → ℂ} (hf:MemLp f 2 μ) (hg:MemLp g 2 μ) : Integrable (fun x => inner ℝ (f x) (g x)) μ := by + apply (hf.norm.integrable_sq.add hg.norm.integrable_sq).mono' + (hf.aestronglyMeasurable.inner hg.aestronglyMeasurable) + exact Eventually.of_forall fun x => by + have hb:=norm_inner_le_norm (𝕜:=ℝ) (f x) (g x) + have hs:=sq_nonneg (‖f x‖-‖g x‖) + change ‖inner ℝ (f x) (g x)‖ ≤ ‖f x‖^2+‖g x‖^2 + nlinarith [sq_nonneg ‖f x‖,sq_nonneg ‖g x‖] +lemma l2_weakDeriv_skew {E:Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {u du v dv:Lp ℂ 2 (volume:Measure E)} (a:E) + (hu:∀ φ:E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u x)=-(∫ x,(φ x:ℂ)*du x)) + (hv:∀ φ:E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*v x)=-(∫ x,(φ x:ℂ)*dv x)) : + inner ℂ du v= -inner ℂ u dv := by + rw [←(Lp.fourierTransformₗᵢ E ℂ).inner_map_map du v, + ←(Lp.fourierTransformₗᵢ E ℂ).inner_map_map u dv,L2.inner_def,L2.inner_def,←integral_neg] + apply integral_congr_ae + filter_upwards [l2_weakDeriv_fourier a hu,l2_weakDeriv_fourier a hv] with ξ h1 h2 + change inner ℂ ((𝓕 du:Lp ℂ 2 (volume:Measure E)) ξ) ((𝓕 v:Lp ℂ 2 (volume:Measure E)) ξ)= + -inner ℂ ((𝓕 u:Lp ℂ 2 (volume:Measure E)) ξ) ((𝓕 dv:Lp ℂ 2 (volume:Measure E)) ξ) + rw [h1,h2] + simp only [RCLike.inner_apply,map_mul,map_ofNat,Complex.conj_ofReal,Complex.conj_I] + ring + +lemma h1_green {n:ℕ} (u v:H1Vector n) (s:Spins n) (a:Fin n × Fin 3) : + (∫ x,inner ℝ (u.gradient s a x) (v.value s x)) = + -(∫ x,inner ℝ (u.value s x) (v.gradient s a x)) := by + have H:=l2_weakDeriv_skew (EuclideanSpace.single a (1:ℝ)) (u.weak_partial_L2 s a) (v.weak_partial_L2 s a) + have HH:=congrArg Complex.re H + rw [L2.inner_def,L2.inner_def,Complex.neg_re] at HH + change RCLike.re (∫ x,inner ℂ (u.gradientL2 s a x) (v.valueL2 s x))= + -RCLike.re (∫ x,inner ℂ (u.valueL2 s x) (v.gradientL2 s a x)) at HH + rw [←integral_re (L2.integrable_inner (u.gradientL2 s a) (v.valueL2 s)), + ←integral_re (L2.integrable_inner (u.valueL2 s) (v.gradientL2 s a))] at HH + convert HH using 1 + · apply integral_congr_ae + filter_upwards [u.gradientL2_ae s a,v.valueL2_ae s] with x hx hy + rw [hx,hy] + rfl + · congr 1 + apply integral_congr_ae + filter_upwards [u.valueL2_ae s,v.gradientL2_ae s a] with x hx hy + rw [hx,hy] + rfl + +lemma h1_multiplier_ibp {n:ℕ} (u:H1Vector n) (s:Spins n) (a:Fin n × Fin 3) + (F:Configuration n → ℝ) (hF:ContDiff ℝ ∞ F) (B D:ℝ) + (hB:∀ x,|F x|≤B) (hD:∀ b x,|fderiv ℝ F x (EuclideanSpace.single b 1)|≤D) : + (∫ x,fderiv ℝ F x (EuclideanSpace.single a 1)*‖u.value s x‖^2)= + -2*(∫ x,F x*inner ℝ (u.value s x) (u.gradient s a x)) := by + let v:=u.smoothMul F hF B D hB hD + have H:=h1_green u v s a + have hcross:Integrable (fun x => F x*inner ℝ (u.value s x) (u.gradient s a x)) := by + have h:Integrable (fun x => inner ℝ ((F x:ℂ)*u.value s x) (u.gradient s a x)) := + memlp_real_inner_integrable (v.value_L2 s) (u.partial_L2 s a) + simpa only [←Complex.real_smul,real_inner_smul_left] using h + have hder:Integrable (fun x => fderiv ℝ F x (EuclideanSpace.single a 1)*‖u.value s x‖^2) := by + have h:= memlp_real_inner_integrable (u.value_L2 s) + (memLp_two_real_mul (u.value_L2 s) ((hF.continuous_fderiv (by simp)).clm_apply continuous_const) (hD a)) + simpa only [←Complex.real_smul,real_inner_smul_right,real_inner_self_eq_norm_sq] using h + have hl:(∫ x,inner ℝ (u.gradient s a x) (v.value s x))= + ∫ x,F x*inner ℝ (u.value s x) (u.gradient s a x) := by + apply integral_congr_ae + filter_upwards [] with x + change inner ℝ (u.gradient s a x) ((F x:ℂ)*u.value s x)=_ + rw [←Complex.real_smul,real_inner_smul_right,real_inner_comm] + have hr:(∫ x,inner ℝ (u.value s x) (v.gradient s a x))= + (∫ x,fderiv ℝ F x (EuclideanSpace.single a 1)*‖u.value s x‖^2)+ + ∫ x,F x*inner ℝ (u.value s x) (u.gradient s a x) := by + change (∫ x,inner ℝ (u.value s x) ((fderiv ℝ F x (EuclideanSpace.single a 1):ℂ)*u.value s x+(F x:ℂ)*u.gradient s a x))=_ + simp only [inner_add_right,←Complex.real_smul,real_inner_smul_right,real_inner_self_eq_norm_sq] + exact integral_add hder hcross + rw [hl,hr] at H + linarith +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/HardyMollifier.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/HardyMollifier.lean new file mode 100644 index 0000000000000000000000000000000000000000..42b9f832924f06f7e32fc69a7fdb65955e816244 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/HardyMollifier.lean @@ -0,0 +1,459 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.RegularizedHardyField + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +open ContinuousLinearMap +open scoped Convolution + +noncomputable def hardyMollifier {n : ℕ} (k : ℕ) : ContDiffBump (0 : Configuration n) where + rIn := 1 / ((k : ℝ) + 1) + rOut := 2 / ((k : ℝ) + 1) + rIn_pos := one_div_pos.mpr (by positivity) + rIn_lt_rOut := div_lt_div_of_pos_right (by norm_num) (by positivity) + +lemma hardyMollifier_tendsto {n : ℕ} : + Filter.Tendsto (fun k => (hardyMollifier (n := n) k).rOut) Filter.atTop (nhds 0) := by + have h := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul 2 + simpa only [hardyMollifier, mul_one_div, mul_zero] using h + +lemma weak_compact_hardy {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (u : Configuration n → ℝ) (g : Fin 3 → Configuration n → ℝ) + (hu : MemLp u 2) (hg : ∀ b, MemLp (g b) 2) + (huC : HasCompactSupport u) + (hw : ∀ b (φ : Configuration n → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * fderiv ℝ φ x (EuclideanSpace.single (i,b) 1)) = + -(∫ x, g b x * φ x)) : + Integrable (fun x => (blockRadiusSq i R x)⁻¹ * (u x)^2) ∧ + (∫ x, (blockRadiusSq i R x)⁻¹ * (u x)^2) ≤ + 4 * ∑ b : Fin 3, ∫ x, (g b x)^2 := by + let κ : ℕ → Configuration n → ℝ := fun k => (hardyMollifier k).normed volume + have hκ : ∀ k, ContDiff ℝ (⊤ : ℕ∞) (κ k) := fun k => + (hardyMollifier k).contDiff_normed + have hκC : ∀ k, HasCompactSupport (κ k) := fun k => + (hardyMollifier k).hasCompactSupport_normed + have hκn : ∀ k x, 0 ≤ κ k x := fun k x => (hardyMollifier k).nonneg_normed x + have hκI : ∀ k, (∫ x, κ k x) = 1 := fun k => (hardyMollifier k).integral_normed + have hul : LocallyIntegrable u := hu.locallyIntegrable (by norm_num) + have hus : ∀ k, ContDiff ℝ (⊤ : ℕ∞) (κ k ⋆ u) := fun k => + (hκC k).contDiff_convolution_left (lsmul ℝ ℝ) (hκ k) hul + have huc : ∀ k, HasCompactSupport (κ k ⋆ u) := fun k => + (hκC k).convolution (lsmul ℝ ℝ) huC + have hh := fun k => smooth_compact_hardy i R (κ k ⋆ u) (hus k) (huc k) + have ht : ∀ᵐ x ∂volume, + Filter.Tendsto (fun k => (κ k ⋆ u) x) Filter.atTop (nhds (u x)) := by + apply ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable + (φ := fun k => hardyMollifier k) (K := 2) hardyMollifier_tendsto _ hul + apply Filter.Eventually.of_forall + intro k + simp only [hardyMollifier] + simp only [mul_one_div, le_refl] + apply ae_nonneg_fatou_integrable volume _ + (fun k x => (blockRadiusSq i R x)⁻¹ * ((κ k ⋆ u) x)^2) _ + (fun k => (hh k).1) + (fun k x => mul_nonneg (inv_nonneg.mpr (blockRadiusSq_nonneg i R x)) (sq_nonneg _)) + (fun x => mul_nonneg (inv_nonneg.mpr (blockRadiusSq_nonneg i R x)) (sq_nonneg _)) + · filter_upwards [ht] with x hx + exact (hx.pow 2).const_mul _ + · intro k + apply (hh k).2.trans + apply mul_le_mul_of_nonneg_left _ (by norm_num) + apply Finset.sum_le_sum + intro b _ + have heq : ∀ x, fderiv ℝ (κ k ⋆ u) x (EuclideanSpace.single (i,b) 1) = + (κ k ⋆ g b) x := by + intro x + exact weak_convolution_partial u (g b) (κ k) _ hul (hκ k) (hκC k) (hw b) x + simp_rw [heq] + exact (convolution_sq_integral_le (κ k) (g b) (hκ k).continuous (hκC k) + (hκn k) (hκI k) ((hg b).locallyIntegrable (by norm_num)) (hg b).integrable_sq).2 + +lemma ae_nonneg_fatou_integrable_of_bound_tendsto {X : Type*} [MeasurableSpace X] + (μ : Measure X) (f : X → ℝ) (F : ℕ → X → ℝ) (C : ℝ) (B : ℕ → ℝ) + (hF : ∀ n, Integrable (F n) μ) (hn : ∀ n x, 0 ≤ F n x) + (hf : ∀ x, 0 ≤ f x) + (ht : ∀ᵐ x ∂μ, Filter.Tendsto (fun n => F n x) Filter.atTop (nhds (f x))) + (hC : ∀ n, (∫ x, F n x ∂μ) ≤ B n) + (hB : Filter.Tendsto B Filter.atTop (nhds C)) : + Integrable f μ ∧ (∫ x, f x ∂μ) ≤ C := by + have hfm : AEStronglyMeasurable f μ := + aestronglyMeasurable_of_tendsto_ae _ (fun n => (hF n).aestronglyMeasurable) + ht + have hb : (∫⁻ x, ENNReal.ofReal (f x) ∂μ) ≤ ENNReal.ofReal C := by + calc + _ = ∫⁻ x, Filter.liminf (fun n => ENNReal.ofReal (F n x)) Filter.atTop ∂μ := by + apply lintegral_congr_ae + filter_upwards [ht] with x hx + exact ((ENNReal.continuous_ofReal.tendsto _).comp hx).liminf_eq.symm + _ ≤ Filter.liminf (fun n => ∫⁻ x, ENNReal.ofReal (F n x) ∂μ) Filter.atTop := + lintegral_liminf_le' (fun n => (hF n).aestronglyMeasurable.aemeasurable.ennreal_ofReal) + _ ≤ Filter.liminf (fun n => ENNReal.ofReal (B n)) Filter.atTop := by + apply Filter.liminf_le_liminf (hv := Filter.isBoundedUnder_of ⟨0, fun _ => bot_le⟩) + (hu := Filter.isCoboundedUnder_ge_of_le Filter.atTop (fun _ => le_top)) + apply Filter.Eventually.of_forall + intro n + rw [← ofReal_integral_eq_lintegral_ofReal (hF n) (Filter.Eventually.of_forall (hn n))] + exact ENNReal.ofReal_le_ofReal (hC n) + _ = ENNReal.ofReal C := ((ENNReal.continuous_ofReal.tendsto C).comp hB).liminf_eq + have hfinite : Integrable f μ := ⟨hfm, + (hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall hf)).2 + (lt_of_le_of_lt hb ENNReal.ofReal_lt_top)⟩ + refine ⟨hfinite, ?_⟩ + have hCn : 0 ≤ C := ge_of_tendsto hB + (Filter.Eventually.of_forall (fun n => (integral_nonneg (hn n)).trans (hC n))) + rw [← ofReal_integral_eq_lintegral_ofReal hfinite (Filter.Eventually.of_forall hf)] at hb + exact (ENNReal.ofReal_le_ofReal_iff hCn).1 hb + +lemma realMemLp_bounded_mul {n : ℕ} (u f : Configuration n → ℝ) + (hu : MemLp u 2) (hf : Continuous f) {B : ℝ} (hB : ∀ x, |f x| ≤ B) : + MemLp (fun x => f x * u x) 2 := by + apply hu.of_le_mul (c := B) (hf.aestronglyMeasurable.mul hu.aestronglyMeasurable) + apply Filter.Eventually.of_forall + intro x + change ‖f x * u x‖ ≤ B * ‖u x‖ + rw [norm_mul, Real.norm_eq_abs (f x)] + exact mul_le_mul_of_nonneg_right (hB x) (norm_nonneg _) + +lemma weak_partial_bounded_mul {n : ℕ} (u g f : Configuration n → ℝ) + (v : Configuration n) (hu : MemLp u 2) (hg : MemLp g 2) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) + {B D : ℝ} (hB : ∀ x, |f x| ≤ B) (hD : ∀ x, |fderiv ℝ f x v| ≤ D) + (hw : ∀ φ : Configuration n → ℝ, ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * fderiv ℝ φ x v) = -(∫ x, g x * φ x)) + (φ : Configuration n → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφC : HasCompactSupport φ) : + (∫ x, (f x * u x) * fderiv ℝ φ x v) = + -(∫ x, (f x * g x + fderiv ℝ f x v * u x) * φ x) := by + have hdf : Continuous (fun x => fderiv ℝ f x v) := + (hf.continuous_fderiv (by simp)).clm_apply continuous_const + have hφL : MemLp φ 2 := hφ.continuous.memLp_of_hasCompactSupport hφC + have hdφL : MemLp (fun x => fderiv ℝ φ x v) 2 := + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const).memLp_of_hasCompactSupport + (hφC.fderiv_apply ℝ v) + have hA : Integrable (fun x => (f x * u x) * fderiv ℝ φ x v) := (realMemLp_bounded_mul u f hu hf.continuous hB).integrable_mul hdφL + have hB' : Integrable (fun x => (fderiv ℝ f x v * u x) * φ x) := (realMemLp_bounded_mul u _ hu hdf hD).integrable_mul hφL + have hC : Integrable (fun x => (f x * g x) * φ x) := (realMemLp_bounded_mul g f hg hf.continuous hB).integrable_mul hφL + have hweak := hw (f * φ) (hf.mul hφ) hφC.mul_left + have hprod : ∀ x, u x * fderiv ℝ (f * φ) x v = + (f x * u x) * fderiv ℝ φ x v + (fderiv ℝ f x v * u x) * φ x := by + intro x + rw [fderiv_mul (hf.differentiable (by simp) x) (hφ.differentiable (by simp) x)] + simp only [add_apply, smul_apply, smul_eq_mul] + ring + simp_rw [hprod] at hweak + rw [integral_add hA hB'] at hweak + have hr : ∀ x, g x * (f * φ) x = (f x * g x) * φ x := by + intro x + simp only [Pi.mul_apply] + ring + simp_rw [hr] at hweak + simp_rw [add_mul] + rw [integral_add hC hB'] + linarith + +lemma fderiv_smul_input {n : ℕ} (f : Configuration n → ℝ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (c : ℝ) (x v : Configuration n) : + fderiv ℝ (fun z => f (c • z)) x v = c * fderiv ℝ f (c • x) v := by + have hd := ((hf.differentiable (by simp) (c • x)).hasFDerivAt).comp x + ((hasFDerivAt_id x).const_smul c) + change HasFDerivAt (fun z => f (c • z)) _ x at hd + rw [hd.fderiv] + simp + +lemma exists_hardyCutoffs (n : ℕ) : + ∃ (χ : ℕ → Configuration n → ℝ) (D : ℝ), + (∀ k, ContDiff ℝ (⊤ : ℕ∞) (χ k)) ∧ + (∀ k, HasCompactSupport (χ k)) ∧ + (∀ k x, |χ k x| ≤ 1) ∧ + (∀ k a x, |fderiv ℝ (χ k) x (EuclideanSpace.single a 1)| ≤ D) ∧ + (∀ x, Filter.Tendsto (fun k => χ k x) Filter.atTop (nhds 1)) ∧ + (∀ a x, Filter.Tendsto (fun k => fderiv ℝ (χ k) x + (EuclideanSpace.single a 1)) Filter.atTop (nhds 0)) := by + let β : ContDiffBump (0 : Configuration n) := ⟨1, 2, by norm_num, by norm_num⟩ + let c : ℕ → ℝ := fun k => 1 / ((k : ℝ) + 1) + have hc : ∀ k, 0 < c k := fun k => one_div_pos.mpr (by positivity) + have hc1 : ∀ k, c k ≤ 1 := by + intro k + simpa only [c, div_one] using + one_div_le_one_div_of_le (show (0 : ℝ) < 1 by norm_num) + (show (1 : ℝ) ≤ (k : ℝ) + 1 by linarith [Nat.cast_nonneg (α := ℝ) k]) + have hct : Filter.Tendsto c Filter.atTop (nhds 0) := + tendsto_one_div_add_atTop_nhds_zero_nat + have hβ : ContDiff ℝ (⊤ : ℕ∞) (β : Configuration n → ℝ) := β.contDiff + have hβC := β.hasCompactSupport + have hβ1 : β 0 = 1 := β.one_of_mem_closedBall (by simp [β]) + obtain ⟨D, hD⟩ := ((hβC.fderiv ℝ).isCompact_range + (hβ.continuous_fderiv (by simp))).exists_bound_of_continuousOn + (f := fun z => z) continuous_id.continuousOn + have hD' : ∀ x, ‖fderiv ℝ (β : Configuration n → ℝ) x‖ ≤ D := + fun x => hD _ ⟨x, rfl⟩ + have hDn : 0 ≤ D := (norm_nonneg _).trans (hD' 0) + refine ⟨fun k x => β (c k • x), D, ?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro k + exact hβ.comp (contDiff_id.const_smul (c k)) + · intro k + exact hβC.comp_homeomorph (Homeomorph.smulOfNeZero (c k) (hc k).ne') + · intro k x + rw [abs_of_nonneg β.nonneg] + exact β.le_one + · intro k a x + rw [fderiv_smul_input _ hβ, abs_mul, abs_of_pos (hc k)] + have hnorm : |fderiv ℝ (β : Configuration n → ℝ) (c k • x) + (EuclideanSpace.single a 1)| ≤ D := by + calc + _ = ‖fderiv ℝ (β : Configuration n → ℝ) (c k • x) + (EuclideanSpace.single a 1)‖ := (Real.norm_eq_abs _).symm + _ ≤ ‖fderiv ℝ (β : Configuration n → ℝ) (c k • x)‖ * + ‖EuclideanSpace.single (𝕜 := ℝ) a 1‖ := le_opNorm _ _ + _ ≤ D := by simpa using hD' (c k • x) + exact (mul_le_mul_of_nonneg_left hnorm (hc k).le).trans + (mul_le_of_le_one_left hDn (hc1 k)) + · intro x + have ht : Filter.Tendsto (fun k => c k • x) Filter.atTop (nhds 0) := by + simpa using hct.smul_const x + simpa only [Function.comp_def, hβ1] using (hβ.continuous.tendsto 0).comp ht + · intro a x + have ht : Filter.Tendsto (fun k => c k • x) Filter.atTop (nhds 0) := by + simpa using hct.smul_const x + have hdf : Continuous (fun z => fderiv ℝ (β : Configuration n → ℝ) z + (EuclideanSpace.single a 1)) := + (hβ.continuous_fderiv (by simp)).clm_apply continuous_const + simp_rw [fderiv_smul_input _ hβ] + simpa only [Function.comp_def, zero_mul] using hct.mul ((hdf.tendsto 0).comp ht) + +lemma weak_hardy {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (u : Configuration n → ℝ) (g : Fin 3 → Configuration n → ℝ) + (hu : MemLp u 2) (hg : ∀ b, MemLp (g b) 2) + (hw : ∀ b (φ : Configuration n → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * fderiv ℝ φ x (EuclideanSpace.single (i,b) 1)) = + -(∫ x, g b x * φ x)) : + Integrable (fun x => (blockRadiusSq i R x)⁻¹ * (u x)^2) ∧ + (∫ x, (blockRadiusSq i R x)⁻¹ * (u x)^2) ≤ + 4 * ∑ b : Fin 3, ∫ x, (g b x)^2 := by + obtain ⟨χ, D, hχ, hχC, hχB, hχD, hχt, hχdt⟩ := exists_hardyCutoffs n + let G : ℕ → Fin 3 → Configuration n → ℝ := fun k b x => + χ k x * g b x + fderiv ℝ (χ k) x (EuclideanSpace.single (i,b) 1) * u x + have hdf : ∀ k b, Continuous (fun x => fderiv ℝ (χ k) x + (EuclideanSpace.single (i,b) 1)) := fun k b => + ((hχ k).continuous_fderiv (by simp)).clm_apply continuous_const + have hG : ∀ k b, MemLp (G k b) 2 := fun k b => + (realMemLp_bounded_mul (g b) (χ k) (hg b) (hχ k).continuous (hχB k)).add + (realMemLp_bounded_mul u _ hu (hdf k b) (hχD k (i,b))) + have hU : ∀ k, MemLp (fun x => χ k x * u x) 2 := fun k => + realMemLp_bounded_mul u (χ k) hu (hχ k).continuous (hχB k) + have hUC : ∀ k, HasCompactSupport (fun x => χ k x * u x) := fun k => + (hχC k).mul_right + have hW := fun k => weak_compact_hardy i R (fun x => χ k x * u x) (G k) + (hU k) (hG k) (hUC k) (fun b φ hφ hφC => + weak_partial_bounded_mul u (g b) (χ k) _ hu (hg b) (hχ k) (hχB k) + (hχD k (i,b)) (hw b) φ hφ hφC) + have hGt : ∀ b x, Filter.Tendsto (fun k => G k b x) Filter.atTop (nhds (g b x)) := by + intro b x + have h := ((hχt x).mul_const (g b x)).add ((hχdt (i,b) x).mul_const (u x)) + simpa only [G, one_mul, zero_mul, add_zero] using h + have hDnonneg : 0 ≤ D := (abs_nonneg _).trans (hχD 0 (i,0) 0) + have hbound : ∀ k b x, |(G k b x)^2| ≤ 2 * (g b x)^2 + 2 * D^2 * (u x)^2 := by + intro k b x + rw [abs_of_nonneg (sq_nonneg _)] + have hX : (χ k x)^2 ≤ 1 := by + nlinarith [(sq_le_sq₀ (abs_nonneg (χ k x)) zero_le_one).mpr (hχB k x), sq_abs (χ k x)] + have hY : (fderiv ℝ (χ k) x (EuclideanSpace.single (i,b) 1))^2 ≤ D^2 := by + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg _) hDnonneg).mpr (hχD k (i,b) x) + have hx := mul_le_mul_of_nonneg_right hX (sq_nonneg (g b x)) + have hy := mul_le_mul_of_nonneg_right hY (sq_nonneg (u x)) + dsimp only [G] + nlinarith [sq_nonneg (χ k x * g b x - + fderiv ℝ (χ k) x (EuclideanSpace.single (i,b) 1) * u x)] + have hIt : ∀ b, Filter.Tendsto (fun k => ∫ x, (G k b x)^2) Filter.atTop + (nhds (∫ x, (g b x)^2)) := by + intro b + apply tendsto_integral_of_dominated_convergence + (fun x => 2 * (g b x)^2 + 2 * D^2 * (u x)^2) + · intro k + exact ((hG k b).aestronglyMeasurable.pow 2) + · exact ((hg b).integrable_sq.const_mul 2).add (hu.integrable_sq.const_mul (2 * D^2)) + · intro k + exact Filter.Eventually.of_forall (fun x => hbound k b x) + · exact Filter.Eventually.of_forall (fun x => (hGt b x).pow 2) + apply ae_nonneg_fatou_integrable_of_bound_tendsto volume _ + (fun k x => (blockRadiusSq i R x)⁻¹ * (χ k x * u x)^2) _ + (fun k => 4 * ∑ b : Fin 3, ∫ x, (G k b x)^2) + (fun k => (hW k).1) + (fun k x => mul_nonneg (inv_nonneg.mpr (blockRadiusSq_nonneg i R x)) (sq_nonneg _)) + (fun x => mul_nonneg (inv_nonneg.mpr (blockRadiusSq_nonneg i R x)) (sq_nonneg _)) + · apply Filter.Eventually.of_forall + intro x + have ht := (((hχt x).mul_const (u x)).pow 2).const_mul ((blockRadiusSq i R x)⁻¹) + simpa only [one_mul] using ht + · exact fun k => (hW k).2 + · exact (tendsto_finsetSum _ (fun b _ => hIt b)).const_mul 4 + +noncomputable def nuclearHardyCoordinates {n : ℕ} (i : Fin n) (R : Space) : + HardyCoordinates n i where + coord b x := x (i,b) - R b + smooth b := (EuclideanSpace.proj (𝕜 := ℝ) (i,b)).contDiff.sub contDiff_const + directional a b x := by + have hd := ((EuclideanSpace.proj (𝕜 := ℝ) (i,a)).hasFDerivAt (x := x)).sub_const (R a) + simp only [EuclideanSpace.coe_proj] at hd + rw [hd.fderiv] + by_cases hab : a = b + · subst a; simp + · simp [EuclideanSpace.proj, EuclideanSpace.single, hab] + +noncomputable def pairHardyCoordinates {n : ℕ} (i j : Fin n) (hij : i ≠ j) : + HardyCoordinates n i where + coord b x := x (i,b) - x (j,b) + smooth b := (EuclideanSpace.proj (𝕜 := ℝ) (i,b)).contDiff.sub + (EuclideanSpace.proj (𝕜 := ℝ) (j,b)).contDiff + directional a b x := by + have hd := ((EuclideanSpace.proj (𝕜 := ℝ) (i,a)).hasFDerivAt (x := x)).sub + ((EuclideanSpace.proj (𝕜 := ℝ) (j,a)).hasFDerivAt (x := x)) + simp only [EuclideanSpace.coe_proj] at hd + change HasFDerivAt (fun x => x (i,a) - x (j,a)) _ x at hd + rw [hd.fderiv] + by_cases hab : a = b + · subst a; simp [EuclideanSpace.proj, EuclideanSpace.single, hij.symm] + · simp [EuclideanSpace.proj, EuclideanSpace.single, hab, hij.symm] + +lemma realCLM_mul_ofReal (L : ℂ →L[ℝ] ℝ) (z : ℂ) (t : ℝ) : + L (z * (t : ℂ)) = L z * t := by + rw [mul_comm, mul_comm (L z)] + exact L.map_smul t z + +lemma weak_complex_component {n : ℕ} (u g : Configuration n → ℂ) + (hu : MemLp u 2) (hg : MemLp g 2) (v : Configuration n) + (hw : ∀ (φ : Configuration n → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * (fderiv ℝ φ x v : ℂ)) = -(∫ x, g x * (φ x : ℂ))) + (L : ℂ →L[ℝ] ℝ) (φ : Configuration n → ℝ) + (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφC : HasCompactSupport φ) : + (∫ x, L (u x) * fderiv ℝ φ x v) = -(∫ x, L (g x) * φ x) := by + have hφL : MemLp (fun x => (φ x : ℂ)) 2 := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hφC.comp_left (by simp)) + have hdφL : MemLp (fun x => (fderiv ℝ φ x v : ℂ)) 2 := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hφC.fderiv_apply ℝ v).comp_left (by simp)) + have hA := L.integral_comp_comm (hu.integrable_mul hdφL) + have hB := L.integral_comp_comm (hg.integrable_mul hφL) + simp only [Pi.mul_apply, realCLM_mul_ofReal] at hA hB + rw [hA, hw φ hφ hφC, map_neg, ← hB] + +lemma complex_norm_sq_components (z : ℂ) : ‖z‖^2 = z.re^2 + z.im^2 := by + rw [Complex.sq_norm, Complex.normSq_apply] + ring + +lemma complex_weak_hardy {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (u : Configuration n → ℂ) (g : Fin 3 → Configuration n → ℂ) + (hu : MemLp u 2) (hg : ∀ b, MemLp (g b) 2) + (hw : ∀ b (φ : Configuration n → ℝ), + ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * (fderiv ℝ φ x (EuclideanSpace.single (i,b) 1) : ℂ)) = + -(∫ x, g b x * (φ x : ℂ))) : + Integrable (fun x => (blockRadiusSq i R x)⁻¹ * ‖u x‖^2) ∧ + (∫ x, (blockRadiusSq i R x)⁻¹ * ‖u x‖^2) ≤ + 4 * ∑ b : Fin 3, ∫ x, ‖g b x‖^2 := by + have huR := Complex.reCLM.comp_memLp' hu + have huI := Complex.imCLM.comp_memLp' hu + have hgR := fun b => Complex.reCLM.comp_memLp' (hg b) + have hgI := fun b => Complex.imCLM.comp_memLp' (hg b) + have hr := weak_hardy i R (fun x => (u x).re) (fun b x => (g b x).re) huR hgR + (fun b φ hφ hφC => weak_complex_component u (g b) hu (hg b) _ (hw b) + Complex.reCLM φ hφ hφC) + have hi := weak_hardy i R (fun x => (u x).im) (fun b x => (g b x).im) huI hgI + (fun b φ hφ hφC => weak_complex_component u (g b) hu (hg b) _ (hw b) + Complex.imCLM φ hφ hφC) + have hsplit : ∀ x, (blockRadiusSq i R x)⁻¹ * ‖u x‖^2 = + (blockRadiusSq i R x)⁻¹ * (u x).re^2 + (blockRadiusSq i R x)⁻¹ * (u x).im^2 := + fun x => by rw [complex_norm_sq_components, mul_add] + constructor + · have hsum : Integrable (fun x => (blockRadiusSq i R x)⁻¹ * (u x).re^2 + + (blockRadiusSq i R x)⁻¹ * (u x).im^2) := hr.1.add hi.1 + exact hsum.congr (Filter.Eventually.of_forall (fun x => (hsplit x).symm)) + · simp_rw [hsplit] + rw [integral_add hr.1 hi.1] + have hb : ∀ b, (∫ x, ‖g b x‖^2) = + (∫ x, (g b x).re^2) + (∫ x, (g b x).im^2) := by + intro b + simp_rw [complex_norm_sq_components] + exact integral_add (hgR b).integrable_sq (hgI b).integrable_sq + simp_rw [hb] + rw [Finset.sum_add_distrib, mul_add] + exact add_le_add hr.2 hi.2 + +lemma H1Vector.hardy {n : ℕ} (ψ : H1Vector n) (s : Spins n) + (i : Fin n) (R : HardyCoordinates n i) : + Integrable (fun x => (blockRadiusSq i R x)⁻¹ * ‖ψ.value s x‖^2) ∧ + (∫ x, (blockRadiusSq i R x)⁻¹ * ‖ψ.value s x‖^2) ≤ + 4 * ∑ b : Fin 3, ∫ x, ‖ψ.gradient s (i,b) x‖^2 := + complex_weak_hardy i R (ψ.value s) (fun b => ψ.gradient s (i,b)) + (ψ.value_L2 s) (fun b => ψ.partial_L2 s (i,b)) (fun b => ψ.weak_partial s (i,b)) + +noncomputable def hardyCoulomb {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (x : Configuration n) : ℝ := (Real.sqrt (blockRadiusSq i R x))⁻¹ + +lemma hardyCoulomb_nonneg {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (x : Configuration n) : 0 ≤ hardyCoulomb i R x := inv_nonneg.mpr (Real.sqrt_nonneg _) + +lemma hardyCoulomb_sq {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (x : Configuration n) : (hardyCoulomb i R x)^2 = (blockRadiusSq i R x)⁻¹ := by + rw [hardyCoulomb, inv_pow, Real.sq_sqrt (blockRadiusSq_nonneg i R x)] + +lemma measurable_hardyCoulomb {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) : + Measurable (hardyCoulomb i R) := + (contDiff_blockRadiusSq i R).continuous.measurable.sqrt.inv + +lemma quadratic_young_reciprocal (t : ℝ) {η : ℝ} (hη : 0 < η) : + t ≤ η * t^2 + 1 / (4 * η) := by + calc + t ≤ (4 * η^2 * t^2 + 1) / (4 * η) := by + apply (le_div_iff₀ (by positivity : (0 : ℝ) < 4 * η)).mpr + nlinarith [sq_nonneg (2 * η * t - 1)] + _ = η * t^2 + 1 / (4 * η) := by field_simp + +lemma H1Vector.coulomb_integrable_bound {n : ℕ} (ψ : H1Vector n) (s : Spins n) + (i : Fin n) (R : HardyCoordinates n i) {η : ℝ} (hη : 0 < η) : + Integrable (fun x => hardyCoulomb i R x * ‖ψ.value s x‖^2) ∧ + (∫ x, hardyCoulomb i R x * ‖ψ.value s x‖^2) ≤ + 4 * η * (∑ b : Fin 3, ∫ x, ‖ψ.gradient s (i,b) x‖^2) + + (1 / (4 * η)) * (∫ x, ‖ψ.value s x‖^2) := by + have hH := ψ.hardy s i R + have hρ : Integrable (fun x => ‖ψ.value s x‖^2) := + (memLp_two_iff_integrable_sq_norm (ψ.value_L2 s).aestronglyMeasurable).mp (ψ.value_L2 s) + have hB : Integrable (fun x => η * ((blockRadiusSq i R x)⁻¹ * ‖ψ.value s x‖^2) + + (1 / (4 * η)) * ‖ψ.value s x‖^2) := + (hH.1.const_mul η).add (hρ.const_mul (1 / (4 * η))) + have hpoint : ∀ x, hardyCoulomb i R x * ‖ψ.value s x‖^2 ≤ + η * ((blockRadiusSq i R x)⁻¹ * ‖ψ.value s x‖^2) + + (1 / (4 * η)) * ‖ψ.value s x‖^2 := by + intro x + have ht := mul_le_mul_of_nonneg_right + (quadratic_young_reciprocal (hardyCoulomb i R x) hη) (sq_nonneg ‖ψ.value s x‖) + simpa only [hardyCoulomb_sq, add_mul, mul_assoc] using ht + have hI : Integrable (fun x => hardyCoulomb i R x * ‖ψ.value s x‖^2) := by + apply hB.mono' ((measurable_hardyCoulomb i R).aestronglyMeasurable.mul + ((ψ.value_L2 s).aestronglyMeasurable.norm.pow 2)) + apply Filter.Eventually.of_forall + intro x + simpa only [Pi.mul_apply, Pi.pow_apply, Real.norm_eq_abs, abs_of_nonneg + (mul_nonneg (hardyCoulomb_nonneg i R x) (sq_nonneg _))] using hpoint x + refine ⟨hI, ?_⟩ + have hm := integral_mono hI hB hpoint + rw [integral_add (hH.1.const_mul η) (hρ.const_mul (1 / (4 * η))), + integral_const_mul, integral_const_mul] at hm + have hhard := mul_le_mul_of_nonneg_left hH.2 hη.le + nlinarith + +end Coulomb +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/HilbertBasisContaining.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/HilbertBasisContaining.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4d43489117dadae2bfef0ebc1415e48670d62b9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/HilbertBasisContaining.lean @@ -0,0 +1,63 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.OrbitalHilbertBasis + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb + +lemma exists_hilbertBasis_containing {E : Type*} [NormedAddCommGroup E] + [InnerProductSpace ℂ E] [CompleteSpace E] (v : E) (hv : ‖v‖ = 1) : + ∃ (w : Set E) (b : HilbertBasis w ℂ E) (i : w), b i = v ∧ ⇑b = Subtype.val := by + have ho : Orthonormal ℂ ((↑) : ({v} : Set E) → E) := by + rw [orthonormal_iff_ite] + intro i j + have hi : (i : E) = v := Set.mem_singleton_iff.mp i.property + have hj : (j : E) = v := Set.mem_singleton_iff.mp j.property + have he : i = j := Subtype.ext (hi.trans hj.symm) + simp [he, hj, inner_self_eq_norm_sq_to_K, hv] + obtain ⟨w, b, hw, hb⟩ := ho.exists_hilbertBasis_extension + exact ⟨w, b, ⟨v, hw (Set.mem_singleton v)⟩, congrFun hb _, hb⟩ + +lemma scalarCoefficient_contract {A ι : Type*} [MeasurableSpace A] + {μ : Measure A} [SigmaFinite μ] {n : ℕ} + (f : (Fin (n+1) → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) (a : ι) (b : Fin n → ι) : + scalarCoefficient (μ := μ) f v (Fin.cons a b) = + scalarCoefficient (μ := μ) + (fiberContract (μ := μ) (v a) (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1))) v b := by + let e := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) => A) 0).trans + (MeasurableEquiv.prodComm : A × (Fin n → A) ≃ᵐ (Fin n → A) × A) + have he : MeasurePreserving e (Measure.pi fun _ => μ) + ((Measure.pi fun _ : Fin n => μ).prod μ) := + (measurePreserving_piFinSuccAbove (fun _ => μ) 0).trans (Measure.measurePreserving_swap) + have hcons : ∀ z : (Fin n → A) × A, e.symm z = Fin.cons z.2 z.1 := by + intro z + ext i + refine Fin.cases ?_ (fun j => ?_) i + · simp [e, MeasurableEquiv.piFinSuccAbove, MeasurableEquiv.prodComm] + · simp [e, MeasurableEquiv.piFinSuccAbove, MeasurableEquiv.prodComm] + have hf' : MemLp (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) 2 + ((Measure.pi fun _ : Fin n => μ).prod μ) := by + simpa only [Function.comp_def, hcons] using hf.comp_measurePreserving (he.symm e) + unfold scalarCoefficient + rw [← (he.symm e).integral_comp'] + simp only [hcons] + have hprod (z : (Fin n → A) × A) : + (∏ i : Fin (n+1), v ((Fin.cons a b : Fin (n+1) → ι) i) + ((Fin.cons z.2 z.1 : Fin (n+1) → A) i)) = + (∏ i : Fin n, v (b i) (z.1 i)) * v a z.2 := by + rw [Fin.prod_univ_succ] + simp [mul_comm] + simp only [hprod] + exact integral_tensorPair (scalarTensor_memLp v hv b) (hv a) hf' + +end Coulomb + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/HilbertBasisSumSqInner.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/HilbertBasisSumSqInner.lean new file mode 100644 index 0000000000000000000000000000000000000000..715c22885fd0c250a91f1a03e8240b54135cc200 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/HilbertBasisSumSqInner.lean @@ -0,0 +1,151 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.FrameOperator +import OAI.Analysis.CoulombRadii.SpectralTheory.EigenspaceBasisSet + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +namespace Coulomb +variable {X E : Type*} [MeasurableSpace X] [NormedAddCommGroup E] + [InnerProductSpace ℂ E] [CompleteSpace E] + +omit [CompleteSpace E] in +lemma hilbertBasis_hasSum_sq_inner {ι : Type*} (b : HilbertBasis ι ℂ E) (u : E) : + HasSum (fun i => ‖inner ℂ (b i) u‖^2) (‖u‖^2) := by + have h := (b.hasSum_inner_mul_inner u u).mapL Complex.reCLM + convert h using 1 + · ext i + rw [← inner_conj_symm u (b i), ← Complex.normSq_eq_conj_mul_self] + simpa only [Complex.reCLM_apply, Complex.ofReal_re] using Complex.sq_norm (inner ℂ (b i) u) + · rw [inner_self_eq_norm_sq_to_K] + change ‖u‖^2 = ((‖u‖ : ℂ)^2).re + rw [← Complex.ofReal_pow, Complex.ofReal_re] + +lemma frameOperator_hasSum_diagonal {ι : Type*} [Countable ι] + {μ : Measure X} {v : X → E} (hv : MemLp v 2 μ) (b : HilbertBasis ι ℂ E) : + HasSum (fun i => (inner ℂ (b i) (frameOperator μ v (b i))).re) + (∫ x, ‖v x‖^2 ∂μ) := by + have hs (x : X) := hilbertBasis_hasSum_sq_inner b (v x) + have hh : HasSum (fun i => ∫ x, ‖inner ℂ (b i) (v x)‖^2 ∂μ) + (∫ x, ‖v x‖^2 ∂μ) := by + apply hasSum_integral_of_dominated_convergence (fun i x => ‖inner ℂ (b i) (v x)‖^2) + · intro i + exact (((innerSL ℂ (b i)).continuous.comp_aestronglyMeasurable hv.aestronglyMeasurable).norm.pow 2) + · intro i + exact Filter.Eventually.of_forall (fun x => by rw [Real.norm_of_nonneg (sq_nonneg _)]) + · exact Filter.Eventually.of_forall (fun x => (hs x).summable) + · simp_rw [(hs _).tsum_eq] + exact hv.integrable_norm_pow (by norm_num) + · exact Filter.Eventually.of_forall hs + convert hh using 1 + ext i + rw [frameOperator_quadratic hv] + apply integral_congr_ae + filter_upwards [] with x + rw [norm_inner_symm] + +lemma frameOperator_spectral_hasSum [SeparableSpace E] + {μ : Measure X} {v : X → E} (hv : MemLp v 2 μ) : + HasSum (fun i : Σ z, eigenspaceBasisSet (frameOperator μ v) z => i.1.re) + (∫ x, ‖v x‖^2 ∂μ) := by + let b := compactSpectralBasis (frameOperator μ v) (frameOperator_compact hv) + (frameOperator_symmetric hv) + let : Countable (Σ z, eigenspaceBasisSet (frameOperator μ v) z) := + orthonormal_countable b.orthonormal + convert frameOperator_hasSum_diagonal hv b using 1 + ext i + simp [b, compactSpectralBasis_eigen, + inner_self_eq_norm_sq_to_K, (compactSpectralBasis _ _ _).orthonormal.1 i] + +lemma compactSpectralBasis_quadratic_hasSum (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.IsSymmetric) (u : E) : + HasSum (fun i : Σ z, eigenspaceBasisSet T z => + i.1.re * ‖inner ℂ (compactSpectralBasis T hc hT i) u‖^2) + (inner ℂ u (T u)).re := by + let b := compactSpectralBasis T hc hT + have h := (((b.hasSum_repr u).mapL T).mapL (innerSL ℂ u)).mapL Complex.reCLM + convert h using 1 + · ext i + have hi : i.1 = (i.1.re : ℂ) := Complex.ext rfl (by + simpa only [Complex.ofReal_im] using compactSpectralBasis_eigen_real T hc hT i) + simp only [ContinuousLinearMap.map_smul, innerSL_apply_apply, + HilbertBasis.repr_apply_apply, b, compactSpectralBasis_eigen, + Complex.reCLM_apply] + rw [hi, ← inner_conj_symm (u) (compactSpectralBasis T hc hT i)] + simp only [smul_eq_mul, Complex.ofReal_re] + rw [show inner ℂ (compactSpectralBasis T hc hT i) u * + ((i.1.re : ℂ) * conj (inner ℂ (compactSpectralBasis T hc hT i) u)) = + (i.1.re : ℂ) * (conj (inner ℂ (compactSpectralBasis T hc hT i) u) * + inner ℂ (compactSpectralBasis T hc hT i) u) by ring] + rw [← Complex.normSq_eq_conj_mul_self, ← Complex.sq_norm] + simp [-Complex.ofReal_pow] + · rfl + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L1L2Fourier.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L1L2Fourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..dfff6dca4c3684c292e3dbdc95e776be194bcc3a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L1L2Fourier.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.WeakFourierDerivative + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology SchwartzMap FourierTransform ComplexConjugate ContDiff +noncomputable section +namespace Coulomb +variable {E:Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +lemma l1_l2_fourier_ae (u:Lp ℂ 2 (volume:Measure E)) (hu:Integrable (u:E → ℂ)) : + (𝓕 u : Lp ℂ 2 (volume:Measure E)) =ᵐ[volume] 𝓕 (u:E → ℂ) := by + have hf : Continuous (𝓕 (u:E → ℂ)) := + VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar + (innerSL ℝ).continuous₂ hu + apply ae_eq_of_integral_contDiff_smul_eq + ((Lp.memLp (𝓕 u : Lp ℂ 2 (volume:Measure E))).locallyIntegrable (by norm_num)) + hf.locallyIntegrable + intro φ hφ hc + let χ:E → ℂ := fun x => (φ x:ℂ) + have hχ:ContDiff ℝ ∞ χ := Complex.ofRealCLM.contDiff.comp hφ + have hcχ:HasCompactSupport χ := hc.comp_left (g:=fun r:ℝ => (r:ℂ)) (by simp) + let Φ:𝓢(E,ℂ) := hcχ.toSchwartzMap hχ + have h := congrArg (fun T:𝓢'(E,ℂ) => T Φ) (Lp.fourier_toTemperedDistribution_eq u) + simp only [TemperedDistribution.fourier_apply,Lp.toTemperedDistribution_apply,smul_eq_mul] at h + have hi := VectorFourier.integral_fourierIntegral_smul_eq_flip (L:=innerₗ E) (μ:=volume) (ν:=volume) + Real.continuous_fourierChar continuous_inner Φ.integrable hu + calc + _ = ∫ x,Φ x * (𝓕 u : Lp ℂ 2 (volume:Measure E)) x := by + apply integral_congr_ae + filter_upwards [] with x + simp only [Φ,χ,HasCompactSupport.toSchwartzMap_toFun,Complex.real_smul] + _ = ∫ x,(𝓕 Φ) x * u x := h.symm + _ = ∫ x,Φ x * 𝓕 (u:E → ℂ) x := by + rw [SchwartzMap.fourier_coe] + simpa using! hi + _ = _ := by + apply integral_congr_ae + filter_upwards [] with x + simp only [Φ,χ,HasCompactSupport.toSchwartzMap_toFun,Complex.real_smul] +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology FourierTransform ComplexConjugate +noncomputable section +namespace Coulomb +variable {E:Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +lemma cutL2_integrable (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) + (u:Lp ℂ 2 (volume:Measure E)) : Integrable (cutL2 s hs u : E → ℂ) := by + have h := L2.integrable_inner (𝕜:=ℂ) (indicatorConstLp 2 hs hμ (1:ℂ)) u + apply h.congr + filter_upwards [indicatorConstLp_coeFn (p:=2) (hs:=hs) (hμs:=hμ) (c:=(1:ℂ)),cutL2_ae s hs u] with x h1 h2 + rw [h1,h2] + by_cases hx:x∈s <;> simp [hx] + +def fourierPlane (s:Set E) (ξ:E) : E → ℂ := + s.indicator (fun x => conj (Real.fourierChar (-inner ℝ x ξ):ℂ)) +lemma fourierPlane_memLp (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) (ξ:E) : + MemLp (fourierPlane s ξ) 2 volume := by + apply (memLp_indicator_const 2 hs (1:ℂ) (Or.inr hμ)).mono + · apply AEStronglyMeasurable.indicator _ hs + exact (Complex.continuous_conj.comp (continuous_subtype_val.comp + (Real.continuous_fourierChar.comp (continuous_id.inner continuous_const).neg))).aestronglyMeasurable + · filter_upwards [] with x + by_cases hx:x∈s <;> simp [fourierPlane,hx,Circle.norm_coe] +def fourierPlaneL2 (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) (ξ:E) : + Lp ℂ 2 (volume:Measure E) := (fourierPlane_memLp s hs hμ ξ).toLp (fourierPlane s ξ) +lemma fourierPlaneL2_ae (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) (ξ:E) : + fourierPlaneL2 s hs hμ ξ =ᵐ[volume] fourierPlane s ξ := MemLp.coeFn_toLp _ +lemma fourierPlaneL2_norm (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) (ξ:E) : + ‖fourierPlaneL2 s hs hμ ξ‖ ≤ ‖indicatorConstLp 2 hs hμ (1:ℂ)‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [fourierPlaneL2_ae s hs hμ ξ, + indicatorConstLp_coeFn (p:=2) (hs:=hs) (hμs:=hμ) (c:=(1:ℂ))] with x h1 h2 + rw [h1,h2] + by_cases hx:x∈s <;> simp [fourierPlane,hx,Circle.norm_coe] +lemma fourier_cut_inner (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) + (u:Lp ℂ 2 (volume:Measure E)) (ξ:E) : + 𝓕 (cutL2 s hs u:E → ℂ) ξ=inner ℂ (fourierPlaneL2 s hs hμ ξ) u := by + rw [Real.fourier_eq,L2.inner_def] + apply integral_congr_ae + filter_upwards [fourierPlaneL2_ae s hs hμ ξ,cutL2_ae s hs u] with x h1 h2 + rw [h1,h2] + by_cases hx:x∈s <;> simp [fourierPlane,hx,Circle.smul_def,mul_comm] +lemma fourier_cut_weak_tendsto (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) + (u:ℕ → Lp ℂ 2 (volume:Measure E)) (v:Lp ℂ 2 (volume:Measure E)) + (hw:∀ w,Tendsto (fun n => inner ℂ w (u n)) atTop (𝓝 (inner ℂ w v))) (ξ:E) : + Tendsto (fun n => 𝓕 (cutL2 s hs (u n):E → ℂ) ξ) atTop + (𝓝 (𝓕 (cutL2 s hs v:E → ℂ) ξ)) := by + simp_rw [fourier_cut_inner s hs hμ] + exact hw _ +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology FourierTransform ComplexConjugate +noncomputable section +namespace Coulomb +variable {E:Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +lemma fourier_cut_norm_bound (s:Set E) (hs:MeasurableSet s) (hμ:volume s≠∞) + (u:Lp ℂ 2 (volume:Measure E)) (ξ:E) : + ‖𝓕 (cutL2 s hs u:E → ℂ) ξ‖ ≤ ‖indicatorConstLp 2 hs hμ (1:ℂ)‖*‖u‖ := by + rw [fourier_cut_inner s hs hμ] + exact (norm_inner_le_norm _ _).trans + (mul_le_mul_of_nonneg_right (fourierPlaneL2_norm s hs hμ ξ) (norm_nonneg u)) + +lemma fourier_double_cut_tendsto (s t:Set E) (hs:MeasurableSet s) (ht:MeasurableSet t) + (hμ:volume s≠∞) (hν:volume t≠∞) + (u:ℕ → Lp ℂ 2 (volume:Measure E)) (v:Lp ℂ 2 (volume:Measure E)) + (C:ℝ) (hb:∀ n,‖u n‖≤C) + (hw:∀ w,Tendsto (fun n => inner ℂ w (u n)) atTop (𝓝 (inner ℂ w v))) : + Tendsto (fun n => cutL2 t ht (𝓕 (cutL2 s hs (u n)))) atTop + (𝓝 (cutL2 t ht (𝓕 (cutL2 s hs v)))) := by + let A:ℝ := ‖indicatorConstLp 2 hs hμ (1:ℂ)‖ + let B:ℝ := A*(C+‖v‖) + have hC:0≤C := (norm_nonneg (u 0)).trans (hb 0) + have hA:0≤A := norm_nonneg _ + have hB:0≤B := mul_nonneg hA (add_nonneg hC (norm_nonneg v)) + let f:ℕ → E → ℂ := fun n ξ => 𝓕 (cutL2 s hs (u n):E → ℂ) ξ - 𝓕 (cutL2 s hs v:E → ℂ) ξ + have hf (n:ℕ) : Continuous (f n) := + (VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar + (innerSL ℝ).continuous₂ (cutL2_integrable s hs hμ (u n))).sub + (VectorFourier.fourierIntegral_continuous Real.continuous_fourierChar + (innerSL ℝ).continuous₂ (cutL2_integrable s hs hμ v)) + have hfb (n:ℕ) (ξ:E) : ‖f n ξ‖≤B := by + calc + _≤‖𝓕 (cutL2 s hs (u n):E → ℂ) ξ‖+‖𝓕 (cutL2 s hs v:E → ℂ) ξ‖ := norm_sub_le _ _ + _≤A*‖u n‖+A*‖v‖ := add_le_add (fourier_cut_norm_bound s hs hμ _ _) (fourier_cut_norm_bound s hs hμ _ _) + _≤A*C+A*‖v‖ := add_le_add (mul_le_mul_of_nonneg_left (hb n) hA) (le_refl _) + _=B := by dsimp [B]; ring + let : IsFiniteMeasure (volume.restrict t : Measure E) := ⟨by simpa using hν.lt_top⟩ + have hlim : Tendsto (fun n => ∫ ξ in t,‖f n ξ‖^2) atTop (𝓝 (0:ℝ)) := by + have H := tendsto_integral_of_dominated_convergence (μ:=volume.restrict t) + (F:=fun n ξ => ‖f n ξ‖^2) (f:=fun _ => (0:ℝ)) (fun _ => B^2) + (fun n => ((hf n).norm.pow 2).aestronglyMeasurable) (integrable_const _) + (fun n => Filter.Eventually.of_forall (fun ξ => by + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (norm_nonneg _) (hfb n ξ) _)) + (Filter.Eventually.of_forall (fun ξ => by + have h := (fourier_cut_weak_tendsto s hs hμ u v hw ξ).sub_const + (𝓕 (cutL2 s hs v:E → ℂ) ξ) + simpa [f] using h.norm.pow 2)) + simpa using H + have he (n:ℕ) : + ‖cutL2 t ht (𝓕 (cutL2 s hs (u n)))-cutL2 t ht (𝓕 (cutL2 s hs v))‖^2 + =∫ ξ in t,‖f n ξ‖^2 := by + rw [←cutL2_sub,cutL2_norm_sq] + apply integral_congr_ae + filter_upwards [ae_restrict_of_ae (Lp.coeFn_sub (𝓕 (cutL2 s hs (u n))) (𝓕 (cutL2 s hs v))), + ae_restrict_of_ae (l1_l2_fourier_ae _ (cutL2_integrable s hs hμ (u n))), + ae_restrict_of_ae (l1_l2_fourier_ae _ (cutL2_integrable s hs hμ v))] with ξ h1 h2 h3 + simp only [h1,Pi.sub_apply,h2,h3,f] + have hl := hlim.congr' (Filter.Eventually.of_forall fun n => (he n).symm) + have hn := (Real.continuous_sqrt.tendsto (0:ℝ)).comp hl + simp only [Function.comp_def,Real.sqrt_sq_eq_abs,abs_of_nonneg (norm_nonneg _),Real.sqrt_zero] at hn + exact tendsto_iff_norm_sub_tendsto_zero.mpr hn +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L2KernelIntegral.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2KernelIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2c8bc4b4c50f521d6379362b80c02bcf781b521 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2KernelIntegral.lean @@ -0,0 +1,129 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +namespace Coulomb +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + {μ : Measure X} {ν : Measure Y} [IsFiniteMeasure μ] [SigmaFinite ν] + +lemma l2_kernel_integral (v : X → Lp ℂ 2 ν) (hv : MemLp v 2 μ) + (V : X → Y → ℂ) (hV : ∀ t, (v t : Y → ℂ) =ᵐ[ν] V t) + (hK : MemLp (fun z : X × Y => V z.1 z.2) 2 (μ.prod ν)) + (c : X → ℂ) (hc : AEStronglyMeasurable c μ) + (C : ℝ) (hC : ∀ t, ‖c t‖ ≤ C) + (hF : MemLp (fun y => ∫ t, c t*V t y ∂μ) 2 ν) : + (∫ t, c t • v t ∂μ) = hF.toLp (fun y => ∫ t, c t*V t y ∂μ) := by + have hctop : MemLp c ∞ μ := memLp_top_of_bound hc C (Filter.Eventually.of_forall hC) + have hcv : MemLp (fun t => c t • v t) 2 μ := hctop.smul hv + have hi := hcv.integrable (by norm_num) + have hcprod : MemLp (fun z : X × Y => c z.1) ∞ (μ.prod ν) := + memLp_top_of_bound hc.comp_fst C (Filter.Eventually.of_forall (fun z => hC z.1)) + have hcvprod : MemLp (fun z : X × Y => c z.1*V z.1 z.2) 2 (μ.prod ν) := hcprod.fun_mul hK + apply ext_inner_left ℂ + intro w + have hw : MemLp (fun z : X × Y => star (w z.2)) 2 (μ.prod ν) := + (Lp.memLp w).star.comp_snd μ + have hint : Integrable (fun z : X × Y => star (w z.2)*(c z.1*V z.1 z.2)) (μ.prod ν) := by + exact memLp_one_iff_integrable.mp (hw.fun_mul hcvprod) + calc + inner ℂ w (∫ t, c t • v t ∂μ) = ∫ t, inner ℂ w (c t • v t) ∂μ := by + exact ((innerSL ℂ w).integral_comp_comm hi).symm + _ = ∫ t, ∫ y, star (w y)*(c t*V t y) ∂ν ∂μ := by + apply integral_congr_ae + filter_upwards [] with t + rw [inner_smul_right, L2.inner_def, ← integral_const_mul] + apply integral_congr_ae + filter_upwards [hV t] with y hy + simp only [RCLike.inner_apply', starRingEnd_apply, hy] + ring + _ = ∫ y, ∫ t, star (w y)*(c t*V t y) ∂μ ∂ν := integral_integral_swap hint + _ = ∫ y, star (w y)*(∫ t, c t*V t y ∂μ) ∂ν := by simp only [integral_const_mul] + _ = inner ℂ w (hF.toLp _) := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hF.coeFn_toLp] with y hy + simp only [RCLike.inner_apply', starRingEnd_apply, hy] +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MeasureInclusion.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MeasureInclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..d6b53df7ad5ad9d266dfef78660bafc844e6aae0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MeasureInclusion.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.SumSwapNonnegative + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb + +section +variable {Y : Type*} [MeasurableSpace Y] + +lemma l2_norm_sq (ν : Measure Y) (u : Lp ℂ 2 ν) : + ‖u‖^2 = ∫ y, ‖u y‖^2 ∂ν := by + rw [@norm_sq_eq_re_inner ℂ, L2.inner_def, ← integral_re (L2.integrable_inner u u)] + apply integral_congr_ae + filter_upwards [] with y + simp [inner_self_eq_norm_sq_to_K, ← Complex.ofReal_pow] + +noncomputable def l2MeasureInclusion {ν η : Measure Y} (h : η ≤ ν) : + Lp ℂ 2 ν →L[ℂ] Lp ℂ 2 η where + toFun := Lp.LpToLpOfMeasureLeSMul (c := 1) (by simp) (by simpa using h) + map_add' := by intro u v; exact map_add _ u v + map_smul' := by + intro z u + apply Lp.ext + filter_upwards [Lp.coeFn_LpToLpOfMeasureLeSMul (c := 1) (by simp) (by simpa using h) (z • u), + Lp.coeFn_smul z (Lp.LpToLpOfMeasureLeSMul (c := 1) (by simp) (by simpa using h) u), + Lp.coeFn_LpToLpOfMeasureLeSMul (c := 1) (by simp) (by simpa using h) u, + (Measure.absolutelyContinuous_of_le h).ae_eq (Lp.coeFn_smul z u)] with y h1 h2 h3 h4 + simp only [h1, h2, h4, Pi.smul_apply, h3, RingHom.id_apply] + cont := (Lp.LpToLpOfMeasureLeSMul (c := 1) (by simp) (by simpa using h)).continuous + +lemma l2MeasureInclusion_coe {ν η : Measure Y} (h : η ≤ ν) (u : Lp ℂ 2 ν) : + l2MeasureInclusion h u =ᵐ[η] u := + Lp.coeFn_LpToLpOfMeasureLeSMul (c := 1) (by simp) (by simpa using h) u + +lemma l2MeasureInclusion_norm_sq {ν η : Measure Y} (h : η ≤ ν) (u : Lp ℂ 2 ν) : + ‖l2MeasureInclusion h u‖^2 = ∫ y, ‖u y‖^2 ∂η := by + rw [l2_norm_sq] + apply integral_congr_ae + filter_upwards [l2MeasureInclusion_coe h u] with y hy + rw [hy] +end + +variable {X Y : Type*} [MeasurableSpace X] [MeasurableSpace Y] + +lemma frame_l2_submeasure_trace {μ : Measure X} {ν η : Measure Y} + [SeparableSpace (Lp ℂ 2 ν)] [SeparableSpace (Lp ℂ 2 η)] + {v : X → Lp ℂ 2 ν} (hv : MemLp v 2 μ) (hη : η ≤ ν) : + HasSum (fun i : Σ z, eigenspaceBasisSet (frameOperator μ v) z => + i.1.re * (∫ y, ‖compactSpectralBasis (frameOperator μ v) (frameOperator_compact hv) + (frameOperator_symmetric hv) i y‖^2 ∂η)) + (∫ x, ∫ y, ‖v x y‖^2 ∂η ∂μ) := by + let I := (exists_hilbertBasis ℂ (Lp ℂ 2 η)).choose + let c : HilbertBasis I ℂ (Lp ℂ 2 η) := (exists_hilbertBasis ℂ (Lp ℂ 2 η)).choose_spec.choose + let : Countable I := orthonormal_countable c.orthonormal + have h := frameOperator_spectral_image_hasSum hv (l2MeasureInclusion hη) c + simpa only [l2MeasureInclusion_norm_sq] using h +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MultiplierContinuity.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MultiplierContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e7f6cebe0741590ea6d27f0acbd3018b4a2b918 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MultiplierContinuity.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Add +import OAI.Analysis.CoulombRadii.FormDomain.L2TightCompact +import OAI.Analysis.CoulombRadii.FieldAnalysis.FiniteSubsequence +import OAI.Analysis.CoulombRadii.FormDomain.H1VectorL2 + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology ComplexConjugate BigOperators +noncomputable section +namespace Coulomb +variable {X:Type*} [MeasurableSpace X] {μ:Measure X} +lemma real_multiplier_inner (f:X → ℝ) (u v U V:Lp ℂ 2 μ) + (hu:(U:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*u x) + (hv:(V:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*v x) : + inner ℂ v U=inner ℂ V u := by + rw [L2.inner_def,L2.inner_def] + apply integral_congr_ae + filter_upwards [hu,hv] with x hx hy + simp only [RCLike.inner_apply,hx,hy,map_mul,Complex.conj_ofReal] + ring +lemma real_multiplier_quadratic (f:X → ℝ) (u U:Lp ℂ 2 μ) + (hu:(U:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*u x) : + (inner ℂ u U).re=∫ x,f x*‖u x‖^2 ∂μ := by + rw [L2.inner_def] + change RCLike.re (∫ x,inner ℂ (u x) (U x) ∂μ)=_ + rw [←integral_re (L2.integrable_inner (𝕜:=ℂ) u U)] + apply integral_congr_ae + filter_upwards [hu] with x hx + rw [hx] + change (((f x:ℂ)*u x)*conj (u x)).re=f x*‖u x‖^2 + rw [mul_assoc,Complex.mul_conj] + simp [Complex.normSq_eq_norm_sq,-Complex.ofReal_pow] + +lemma real_multiplier_quadratic_diff_bound (f:X → ℝ) (u v U V:Lp ℂ 2 μ) + (hu:(U:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*u x) + (hv:(V:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*v x) : + |(inner ℂ u U).re-(inner ℂ v V).re|≤(‖U‖+‖V‖)*‖u-v‖ := by + have he : inner ℂ u U-inner ℂ v V=inner ℂ (u-v) U+inner ℂ V (u-v) := by + rw [inner_sub_left,inner_sub_right,←real_multiplier_inner f u v U V hu hv, + ←real_multiplier_inner f v v V V hv hv] + abel + calc + |(inner ℂ u U).re-(inner ℂ v V).re|=|(inner ℂ u U-inner ℂ v V).re|:=rfl + _ ≤ ‖inner ℂ u U-inner ℂ v V‖ := Complex.abs_re_le_norm _ + _ ≤ ‖inner ℂ (u-v) U‖+‖inner ℂ V (u-v)‖ := by rw [he]; exact norm_add_le _ _ + _ ≤ ‖u-v‖*‖U‖+‖V‖*‖u-v‖ := add_le_add (norm_inner_le_norm _ _) (norm_inner_le_norm _ _) + _ = (‖U‖+‖V‖)*‖u-v‖ := by ring +lemma real_multiplier_quadratic_tendsto (f:X → ℝ) (u:ℕ → Lp ℂ 2 μ) (v:Lp ℂ 2 μ) + (U:ℕ → Lp ℂ 2 μ) (V:Lp ℂ 2 μ) + (hu:∀ k,(U k:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*u k x) + (hv:(V:X → ℂ)=ᵐ[μ]fun x => (f x:ℂ)*v x) + (hconv:Tendsto u atTop (𝓝 v)) (C:ℝ) (hC:∀ k,‖U k‖≤C) : + Tendsto (fun k => ∫ x,f x*‖u k x‖^2 ∂μ) atTop (𝓝 (∫ x,f x*‖v x‖^2 ∂μ)) := by + simp_rw [←real_multiplier_quadratic f _ _ hv] + have H:Tendsto (fun k => (inner ℂ (u k) (U k)).re-(inner ℂ v V).re) atTop (𝓝 0) := by + apply squeeze_zero_norm (a:=fun k => (C+‖V‖)*‖u k-v‖) + · intro k + exact (real_multiplier_quadratic_diff_bound f (u k) v (U k) V (hu k) hv).trans + (mul_le_mul_of_nonneg_right (add_le_add (hC k) (le_refl ‖V‖)) (norm_nonneg _)) + · have h:=((hconv.sub_const v).norm.const_mul (C+‖V‖)) + simpa using h + have he: Tendsto (fun k => (inner ℂ (u k) (U k)).re) atTop (𝓝 (inner ℂ v V).re) := + (tendsto_sub_nhds_zero_iff).mp H + simpa only [real_multiplier_quadratic f _ _ (hu _)] using he +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology ComplexConjugate BigOperators +noncomputable section +namespace Coulomb +variable {n:ℕ} +lemma H1Vector.hardy_multiplier_memLp (u:H1Vector n) (s:Spins n) (i:Fin n) (R:HardyCoordinates n i) : + MemLp (fun x => (hardyCoulomb i R x:ℂ)*u.valueL2 s x) 2 volume := by + apply (memLp_two_iff_integrable_sq_norm + (((measurable_hardyCoulomb i R).complex_ofReal.aestronglyMeasurable).mul + (Lp.memLp (u.valueL2 s)).aestronglyMeasurable)).mpr + apply (u.hardy s i R).1.congr + filter_upwards [u.valueL2_ae s] with x hx + change (blockRadiusSq i R x)⁻¹*‖u.value s x‖^2 = ‖(hardyCoulomb i R x:ℂ)*u.valueL2 s x‖^2 + simp only [norm_mul,Complex.norm_real,Real.norm_eq_abs,mul_pow,sq_abs,hardyCoulomb_sq,hx] + +def H1Vector.hardyMultiplier (u:H1Vector n) (s:Spins n) (i:Fin n) (R:HardyCoordinates n i) : + Lp ℂ 2 (volume:Measure (Configuration n)) := + (u.hardy_multiplier_memLp s i R).toLp _ +lemma H1Vector.hardyMultiplier_ae (u:H1Vector n) (s:Spins n) (i:Fin n) (R:HardyCoordinates n i) : + (u.hardyMultiplier s i R:Configuration n → ℂ)=ᵐ[volume]fun x => (hardyCoulomb i R x:ℂ)*u.valueL2 s x := + (u.hardy_multiplier_memLp s i R).coeFn_toLp +lemma H1Vector.hardyMultiplier_norm_sq (u:H1Vector n) (s:Spins n) (i:Fin n) (R:HardyCoordinates n i) : + ‖u.hardyMultiplier s i R‖^2≤8*kinetic u := by + rw [l2_norm_sq_integral] + have he:(∫ x,‖u.hardyMultiplier s i R x‖^2)=∫ x,(blockRadiusSq i R x)⁻¹*‖u.value s x‖^2 := by + apply integral_congr_ae + filter_upwards [u.hardyMultiplier_ae s i R,u.valueL2_ae s] with x hx hy + simp only [hx,norm_mul,Complex.norm_real,Real.norm_eq_abs,mul_pow,sq_abs,hardyCoulomb_sq,hy] + rw [he] + have hs:(∑ b:Fin 3,∫ x,‖u.gradient s (i,b) x‖^2)≤∑ a:Fin n × Fin 3,∫ x,‖u.gradient s a x‖^2 := by + rw [Fintype.sum_prod_type] + exact Finset.single_le_sum (f:=fun j:Fin n => ∑ b:Fin 3,∫ x:Configuration n,‖u.gradient s (j,b) x‖^2) + (fun j _ => Finset.sum_nonneg fun b _ => integral_nonneg fun x => sq_nonneg _) (Finset.mem_univ i) + have ht:(∑ a,∫ x,‖u.gradient s a x‖^2)≤∑ t,∑ a,∫ x,‖u.gradient t a x‖^2 := + Finset.single_le_sum (f:=fun t:Spins n => ∑ a:Fin n × Fin 3,∫ x:Configuration n,‖u.gradient t a x‖^2) + (fun t _ => Finset.sum_nonneg fun a _ => integral_nonneg fun x => sq_nonneg _) (Finset.mem_univ s) + have hh:=(u.hardy s i R).2 + unfold kinetic + linarith +lemma H1Vector.hardyMultiplier_norm_le (u:H1Vector n) (s:Spins n) (i:Fin n) (R:HardyCoordinates n i) + {K:ℝ} (hK:kinetic u≤K) : ‖u.hardyMultiplier s i R‖≤Real.sqrt (8*K) := by + have hp:0≤8*K:=mul_nonneg (by norm_num) ((kinetic_nonneg u).trans hK) + apply (sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mp + rw [Real.sq_sqrt hp] + exact (u.hardyMultiplier_norm_sq s i R).trans (mul_le_mul_of_nonneg_left hK (by norm_num)) +lemma hardy_form_strong_tendsto (u:ℕ → H1Vector n) (v:H1Vector n) (s:Spins n) (i:Fin n) (R:HardyCoordinates n i) + (hv:Tendsto (fun k => (u k).valueL2 s) atTop (𝓝 (v.valueL2 s))) + (K:ℝ) (hK:∀ k,kinetic (u k)≤K) : + Tendsto (fun k => ∫ x,hardyCoulomb i R x*‖(u k).value s x‖^2) atTop + (𝓝 (∫ x,hardyCoulomb i R x*‖v.value s x‖^2)) := by + have H:=real_multiplier_quadratic_tendsto (hardyCoulomb i R) + (fun k => (u k).valueL2 s) (v.valueL2 s) + (fun k => (u k).hardyMultiplier s i R) (v.hardyMultiplier s i R) + (fun k => (u k).hardyMultiplier_ae s i R) (v.hardyMultiplier_ae s i R) hv + (Real.sqrt (8*K)) (fun k => (u k).hardyMultiplier_norm_le s i R (hK k)) + have he(w:H1Vector n) : (∫ x,hardyCoulomb i R x*‖w.valueL2 s x‖^2)= + ∫ x,hardyCoulomb i R x*‖w.value s x‖^2 := by + apply integral_congr_ae + filter_upwards [w.valueL2_ae s] with x hx + rw [hx] + simpa only [he] using H +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology ComplexConjugate ContDiff BigOperators +noncomputable section +namespace Coulomb +lemma h1_bounded_tight_compact {n:ℕ} (u:ℕ → H1Vector n) (K:ℝ) + (hm:∀ k,mass (u k)=1) (hk:∀ k,kinetic (u k)≤K) + (hsp:∀ ε:ℝ,0<ε → ∃ A:Set (Configuration n),∃ hA:MeasurableSet A,volume A≠(⊤:ℝ≥0∞) ∧ + ∀ᶠ k in atTop,∀ s,‖cutL2 Aᶜ hA.compl ((u k).valueL2 s)‖≤ε) : + ∃ v:H1Vector n,mass v=1 ∧ kinetic v≤K ∧ ∃ φ:ℕ → ℕ,StrictMono φ ∧ + (∀ s,Tendsto (fun k => (u (φ k)).valueL2 s) atTop (𝓝 (v.valueL2 s))) ∧ + (∀ s a w,Tendsto (fun k => inner ℂ w ((u (φ k)).gradientL2 s a)) atTop + (𝓝 (inner ℂ w (v.gradientL2 s a)))) := by + let : Fact ((2:ℝ≥0∞)≠(⊤:ℝ≥0∞)) := ⟨by norm_num⟩ + have hK:0≤K := (kinetic_nonneg (u 0)).trans (hk 0) + have huv (k:ℕ) (s:Spins n) : ‖(u k).valueL2 s‖≤1 := by + have H:=hm k + rw [H1Vector.mass_eq_norm] at H + have hh:=Finset.single_le_sum (fun t _ => sq_nonneg ‖(u k).valueL2 t‖) (Finset.mem_univ s) + nlinarith [norm_nonneg ((u k).valueL2 s)] + have hgrad (k:ℕ) : ∑ s,∑ a,‖(u k).gradientL2 s a‖^2≤2*K := by + have H:=hk k + rw [H1Vector.kinetic_eq_norm] at H + linarith + have hgs (k:ℕ) (s:Spins n) : ∑ a,‖(u k).gradientL2 s a‖^2≤2*K := + (Finset.single_le_sum (fun t _ => Finset.sum_nonneg fun a _ => sq_nonneg _) (Finset.mem_univ s)).trans (hgrad k) + obtain ⟨v0,φ,hφ,hv0⟩ := finite_simultaneous_subsequence (fun k s => (u k).valueL2 s) (by + intro s φ hφ + apply h1_spatial_tight_subsequence (fun k => (u (φ k)).valueL2 s) + (fun k a => (u (φ k)).gradientL2 s a) (fun k a => (u (φ k)).weak_partial_L2 s a) + 1 (2*K) (fun k => huv (φ k) s) (fun k => hgs (φ k) s) + intro ε hε + obtain ⟨A,hA,hfin,H⟩:=hsp ε hε + exact ⟨A,hA,hfin,(hφ.tendsto_atTop.eventually H).mono (fun k hk => hk s)⟩) + let g0:ℕ → (Spins n × (Fin n × Fin 3)) → Lp ℂ 2 (volume:Measure (Configuration n)) := + fun k sa => (u (φ k)).gradientL2 sa.1 sa.2 + obtain ⟨g,hg,ψ,hψ,hw⟩:=bounded_finite_hilbert_weak_subsequence g0 (2*K) (by + intro k + simpa only [Fintype.sum_prod_type,g0] using hgrad (φ k)) + have hv(s:Spins n) : Tendsto (fun k => (u (φ (ψ k))).valueL2 s) atTop (𝓝 (v0 s)) := + (hv0 s).comp hψ.tendsto_atTop + have hweak(s:Spins n) (a:Fin n × Fin 3) : ∀ (f:Configuration n → ℝ),ContDiff ℝ ∞ f → HasCompactSupport f → + (∫ x,(fderiv ℝ f x (EuclideanSpace.single a 1):ℂ)*v0 s x)=-(∫ x,(f x:ℂ)*g (s,a) x) := by + apply weak_l2_derivative_limit (EuclideanSpace.single a 1) + (fun w => tendsto_const_nhds.inner (hv s)) (hw (s,a)) + exact fun k => (u (φ (ψ k))).weak_partial_L2 s a + let v:=H1Vector.ofL2 v0 (fun s a => g (s,a)) hweak + have hvv(s:Spins n) : v.valueL2 s=v0 s := H1Vector.ofL2_valueL2 .. + have hvg(s:Spins n) (a:Fin n × Fin 3) : v.gradientL2 s a=g (s,a) := H1Vector.ofL2_gradientL2 .. + refine ⟨v,?_,?_,φ ∘ ψ,hφ.comp hψ,?_,?_⟩ + · have H:Tendsto (fun k => ∑ s,‖(u (φ (ψ k))).valueL2 s‖^2) atTop (𝓝 (∑ s,‖v0 s‖^2)):= + tendsto_finsetSum _ (fun s _ => (hv s).norm.pow 2) + have he (k:ℕ) : (∑ s,‖(u (φ (ψ k))).valueL2 s‖^2)=1 := by + rw [←H1Vector.mass_eq_norm]; exact hm _ + rw [H1Vector.mass_eq_norm] + simp_rw [hvv] + exact tendsto_nhds_unique H (by simp only [he]; exact tendsto_const_nhds) + · rw [H1Vector.kinetic_eq_norm] + simp_rw [hvg] + rw [Fintype.sum_prod_type] at hg + linarith + · intro s + simpa only [hvv,Function.comp_def] using hv s + · intro s a w + simpa only [hvg,Function.comp_def,g0] using hw (s,a) w +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MultiplierDistribution.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MultiplierDistribution.lean new file mode 100644 index 0000000000000000000000000000000000000000..0951896332874055f12b2f77d535b64707114dc0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2MultiplierDistribution.lean @@ -0,0 +1,178 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +namespace Coulomb +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma l2_multiplier_distribution {u w : Lp ℂ 2 (volume : Measure E)} (a : E) + (hw : w =ᵐ[volume] fun ξ => (2 * Real.pi * Complex.I) * + (inner ℝ ξ a : ℂ) * u ξ) : + (w : 𝓢'(E,ℂ)) = (2 * Real.pi * Complex.I) • + TemperedDistribution.smulLeftCLM ℂ (fun ξ => (inner ℝ ξ a : ℂ)) (u : 𝓢'(E,ℂ)) := by + have ht : (fun ξ => (inner ℝ ξ a : ℂ)).HasTemperateGrowth := by fun_prop + ext φ + change Lp.toTemperedDistribution w φ = (2 * Real.pi * Complex.I) • + Lp.toTemperedDistribution u (SchwartzMap.smulLeftCLM ℂ (fun ξ => (inner ℝ ξ a : ℂ)) φ) + simp only [Lp.toTemperedDistribution_apply] + rw [← integral_smul] + apply integral_congr_ae + filter_upwards [hw] with ξ hξ + simp only [hξ, SchwartzMap.smulLeftCLM_apply ht, smul_eq_mul] + ring + +lemma l2_fourier_weakDeriv_distribution {u w : Lp ℂ 2 (volume : Measure E)} (a : E) + (hw : w =ᵐ[volume] fun ξ => (2 * Real.pi * Complex.I) * + (inner ℝ ξ a : ℂ) * (𝓕 u : Lp ℂ 2 (volume : Measure E)) ξ) : + ∂_{a} (u : 𝓢'(E,ℂ)) = (𝓕⁻ w : Lp ℂ 2 (volume : Measure E)) := by + have h := l2_multiplier_distribution a hw + rw [← Lp.fourier_toTemperedDistribution_eq u, + ← TemperedDistribution.fourier_lineDerivOp_eq] at h + have H := congrArg (fun z : 𝓢'(E,ℂ) => 𝓕⁻ z) h + simpa only [Lp.fourierInv_toTemperedDistribution_eq, + FourierTransform.fourierInv_fourier_eq] using H.symm + +lemma l2_fourier_weakDeriv {u w : Lp ℂ 2 (volume : Measure E)} (a : E) + (hw : w =ᵐ[volume] fun ξ => (2 * Real.pi * Complex.I) * + (inner ℝ ξ a : ℂ) * (𝓕 u : Lp ℂ 2 (volume : Measure E)) ξ) + (φ : E → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hφC : HasCompactSupport φ) : + (∫ x : E, (fderiv ℝ φ x a : ℂ) * u x) = + -(∫ x : E, (φ x : ℂ) * (𝓕⁻ w : Lp ℂ 2 (volume : Measure E)) x) := by + let φc : E → ℂ := fun x => (φ x : ℂ) + have hφc : ContDiff ℝ (⊤ : ℕ∞) φc := Complex.ofRealCLM.contDiff.comp hφ + have hφcC : HasCompactSupport φc := hφC.comp_left Complex.ofReal_zero + let Φ : 𝓢(E,ℂ) := hφcC.toSchwartzMap hφc + have h := congrArg (fun T : 𝓢'(E,ℂ) => T Φ) (l2_fourier_weakDeriv_distribution a hw) + have hd (x : E) : (∂_{a} Φ) x = (fderiv ℝ φ x a : ℂ) := by + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv] + change fderiv ℝ φc x a = _ + exact congrArg (fun L : E →L[ℝ] ℂ => L a) + ((Complex.ofRealCLM.hasFDerivAt.comp x + ((hφ.differentiable (by simp)) x).hasFDerivAt).fderiv) + simp only [TemperedDistribution.lineDerivOp_apply_apply, map_neg, + Lp.toTemperedDistribution_apply, smul_eq_mul] at h + have h' : -(∫ x : E, (fderiv ℝ φ x a : ℂ) * u x) = + ∫ x : E, (φ x : ℂ) * (𝓕⁻ w : Lp ℂ 2 (volume : Measure E)) x := by + have hp (x : E) : Φ x = (φ x : ℂ) := rfl + simpa only [hd, hp] using h + simpa only [neg_neg] using congrArg Neg.neg h' + +lemma fourierMultiplier_norm_sq (r : ℝ) (z : ℂ) : + ‖(2 * Real.pi * Complex.I) * (r : ℂ) * z‖^2 = (2*Real.pi*r)^2 * ‖z‖^2 := by + have he : (2 * Real.pi * Complex.I) * (r : ℂ) * z = + ((2*Real.pi*r : ℝ) : ℂ) * Complex.I * z := by push_cast; ring + rw [he, norm_mul, norm_mul, Complex.norm_real, Complex.norm_I, mul_one, mul_pow] + rw [Real.norm_eq_abs, sq_abs] + +lemma l2_norm_sq_fourier (u : Lp ℂ 2 (volume : Measure E)) : + ‖u‖^2 = ∫ y, ‖u y‖^2 := by + rw [@norm_sq_eq_re_inner ℂ, L2.inner_def, ← integral_re (L2.integrable_inner u u)] + apply integral_congr_ae + filter_upwards [] with y + simp [inner_self_eq_norm_sq_to_K, ← Complex.ofReal_pow] + +lemma l2_fourier_weighted_derivative (u : Lp ℂ 2 (volume : Measure E)) (a : E) + (hI : Integrable (fun ξ => (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 u : Lp ℂ 2 (volume : Measure E)) ξ‖^2)) : + ∃ g : Lp ℂ 2 (volume : Measure E), + (∀ (φ : E → ℝ), ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x : E, (fderiv ℝ φ x a : ℂ) * u x) = -(∫ x : E, (φ x : ℂ) * g x)) ∧ + ‖g‖^2 = ∫ ξ, (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 u : Lp ℂ 2 (volume : Measure E)) ξ‖^2 := by + let F : E → ℂ := fun ξ => (2 * Real.pi * Complex.I) * (inner ℝ ξ a : ℂ) * + (𝓕 u : Lp ℂ 2 (volume : Measure E)) ξ + have hm : AEStronglyMeasurable F volume := by + exact (by fun_prop : Continuous (fun ξ => (2 * Real.pi * Complex.I) * + (inner ℝ ξ a : ℂ))).aestronglyMeasurable.mul (Lp.aestronglyMeasurable _) + have hF : MemLp F 2 volume := by + apply (memLp_two_iff_integrable_sq_norm hm).mpr + simpa only [F, fourierMultiplier_norm_sq] using hI + refine ⟨𝓕⁻ (hF.toLp F), ?_, ?_⟩ + · intro φ hφ hφC + exact l2_fourier_weakDeriv a hF.coeFn_toLp φ hφ hφC + · change ‖(Lp.fourierTransformₗᵢ E ℂ).symm (hF.toLp F)‖^2 = _ + rw [(Lp.fourierTransformₗᵢ E ℂ).symm.norm_map, l2_norm_sq_fourier] + apply integral_congr_ae + filter_upwards [hF.coeFn_toLp] with ξ hξ + rw [hξ] + exact fourierMultiplier_norm_sq _ _ +end Coulomb + +open scoped LineDeriv + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L2TightCompact.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2TightCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..a67dfce56b54630d8b3e98c57744c724ee67d5ca --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2TightCompact.lean @@ -0,0 +1,148 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.WeakHilbertCompact +import OAI.Analysis.CoulombRadii.FormDomain.L1L2Fourier + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology FourierTransform ComplexConjugate +noncomputable section +namespace Coulomb +variable {E:Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +lemma cutL2_sub_self (s:Set E) (hs:MeasurableSet s) (u:Lp ℂ 2 (volume:Measure E)) : + u-cutL2 s hs u=cutL2 sᶜ hs.compl u := by + have h := cutL2_add_compl s hs u + exact sub_eq_iff_eq_add.mpr (by simpa only [add_comm] using h.symm) +lemma double_cut_approximation (s t:Set E) (hs:MeasurableSet s) (ht:MeasurableSet t) + (u:Lp ℂ 2 (volume:Measure E)) : + ‖(𝓕 u : Lp ℂ 2 (volume:Measure E))-cutL2 t ht (𝓕 (cutL2 s hs u))‖ ≤ + ‖cutL2 tᶜ ht.compl (𝓕 u)‖+‖cutL2 sᶜ hs.compl u‖ := by + calc + _≤‖(𝓕 u : Lp ℂ 2 (volume:Measure E))-cutL2 t ht (𝓕 u)‖+ + ‖cutL2 t ht (𝓕 u)-cutL2 t ht (𝓕 (cutL2 s hs u))‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _≤‖cutL2 tᶜ ht.compl (𝓕 u)‖+‖(𝓕 u : Lp ℂ 2 (volume:Measure E))-𝓕 (cutL2 s hs u)‖ := by + rw [cutL2_sub_self,←cutL2_sub] + exact add_le_add (le_refl _) (cutL2_norm_le t ht _) + _= _ := by + have h : ‖(𝓕 u : Lp ℂ 2 (volume:Measure E))-𝓕 (cutL2 s hs u)‖=‖u-cutL2 s hs u‖ := by + change ‖(Lp.fourierTransformₗᵢ E ℂ) u-(Lp.fourierTransformₗᵢ E ℂ) (cutL2 s hs u)‖=_ + rw [←map_sub,(Lp.fourierTransformₗᵢ E ℂ).norm_map] + rw [h,cutL2_sub_self] + +lemma l2_tight_frequency_subsequence + (u:ℕ → Lp ℂ 2 (volume:Measure E)) (C:ℝ) (hb:∀ n,‖u n‖≤C) + (hspace:∀ ε:ℝ,0<ε → ∃ s:Set E,∃ hs:MeasurableSet s,volume s≠∞ ∧ + ∀ᶠ n in atTop,‖cutL2 sᶜ hs.compl (u n)‖≤ε) + (hfreq:∀ ε:ℝ,0<ε → ∃ t:Set E,∃ ht:MeasurableSet t,volume t≠∞ ∧ + ∀ᶠ n in atTop,‖cutL2 tᶜ ht.compl (𝓕 (u n))‖≤ε) : + ∃ v:Lp ℂ 2 (volume:Measure E),∃ φ:ℕ → ℕ,StrictMono φ ∧ + Tendsto (u ∘ φ) atTop (𝓝 v) := by + let : Fact ((2:ℝ≥0∞)≠∞) := ⟨by norm_num⟩ + obtain ⟨v,hv,φ,hφ,hw⟩ := bounded_hilbert_weak_subsequence u C hb + have hd : CauchySeq (fun n => (𝓕 (u (φ n)) : Lp ℂ 2 (volume:Measure E))) := by + rw [Metric.cauchySeq_iff] + intro ε hε + have hδ : 0<ε/8 := by positivity + obtain ⟨s,hs,hμ,hsp⟩ := hspace (ε/8) hδ + obtain ⟨t,ht,hν,hfr⟩ := hfreq (ε/8) hδ + have hconv := fourier_double_cut_tendsto s t hs ht hμ hν (u ∘ φ) v C + (fun n => hb (φ n)) hw + have hloc := hconv.eventually (Metric.ball_mem_nhds _ hδ) + have hsp' := hφ.tendsto_atTop.eventually hsp + have hfr' := hφ.tendsto_atTop.eventually hfr + obtain ⟨N,hN⟩ := eventually_atTop.mp ((hloc.and hsp').and hfr') + refine ⟨N,?_⟩ + intro j hj k hk + obtain ⟨⟨hlj,hsj⟩,hfj⟩ := hN j hj + obtain ⟨⟨hlk,hsk⟩,hfk⟩ := hN k hk + have hjj := double_cut_approximation s t hs ht (u (φ j)) + have hkk := double_cut_approximation s t hs ht (u (φ k)) + change dist (cutL2 t ht (𝓕 (cutL2 s hs (u (φ j))))) + (cutL2 t ht (𝓕 (cutL2 s hs v))) < ε/8 at hlj + change dist (cutL2 t ht (𝓕 (cutL2 s hs (u (φ k))))) + (cutL2 t ht (𝓕 (cutL2 s hs v))) < ε/8 at hlk + have hh := dist_triangle4 (𝓕 (u (φ j))) + (cutL2 t ht (𝓕 (cutL2 s hs (u (φ j)))) ) + (cutL2 t ht (𝓕 (cutL2 s hs (u (φ k)))) ) (𝓕 (u (φ k))) + have hmid := dist_triangle (cutL2 t ht (𝓕 (cutL2 s hs (u (φ j))))) + (cutL2 t ht (𝓕 (cutL2 s hs v))) + (cutL2 t ht (𝓕 (cutL2 s hs (u (φ k))))) + rw [dist_comm (cutL2 t ht (𝓕 (cutL2 s hs v)))] at hmid + rw [dist_comm (cutL2 t ht (𝓕 (cutL2 s hs (u (φ k)))))] at hh + simp only [dist_eq_norm] at hh hmid hlj hlk ⊢ + linarith + obtain ⟨w,hw⟩ := cauchySeq_tendsto_of_complete hd + refine ⟨(Lp.fourierTransformₗᵢ E ℂ).symm w,φ,hφ,?_⟩ + have h := ((Lp.fourierTransformₗᵢ E ℂ).symm.continuous.tendsto w).comp hw + change Tendsto (fun n => (Lp.fourierTransformₗᵢ E ℂ).symm + ((Lp.fourierTransformₗᵢ E ℂ) (u (φ n)))) atTop (𝓝 ((Lp.fourierTransformₗᵢ E ℂ).symm w)) at h + simpa only [LinearIsometryEquiv.symm_apply_apply,Function.comp_def] using h +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology FourierTransform ComplexConjugate ContDiff BigOperators +noncomputable section +namespace Coulomb +variable {E:Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] +lemma l2_real_test_inner (f:E → ℝ) (hf:MemLp (fun x => (f x:ℂ)) 2 volume) + (u:Lp ℂ 2 (volume:Measure E)) : + inner ℂ (hf.toLp (fun x => (f x:ℂ))) u = ∫ x,(f x:ℂ)*u x := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [hf.coeFn_toLp] with x hx + simp [hx,RCLike.inner_apply,mul_comm] +lemma weak_l2_pairing_tendsto {u:ℕ → Lp ℂ 2 (volume:Measure E)} + {v:Lp ℂ 2 (volume:Measure E)} + (hw:∀ w,Tendsto (fun n => inner ℂ w (u n)) atTop (𝓝 (inner ℂ w v))) + (f:E → ℝ) (hf:MemLp (fun x => (f x:ℂ)) 2 volume) : + Tendsto (fun n => ∫ x,(f x:ℂ)*u n x) atTop (𝓝 (∫ x,(f x:ℂ)*v x)) := by + simpa only [l2_real_test_inner] using hw (hf.toLp (fun x => (f x:ℂ))) +lemma weak_l2_derivative_limit {u d:ℕ → Lp ℂ 2 (volume:Measure E)} + {v g:Lp ℂ 2 (volume:Measure E)} (a:E) + (hu:∀ w,Tendsto (fun n => inner ℂ w (u n)) atTop (𝓝 (inner ℂ w v))) + (hd:∀ w,Tendsto (fun n => inner ℂ w (d n)) atTop (𝓝 (inner ℂ w g))) + (hw:∀ n (φ:E → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u n x)=-(∫ x,(φ x:ℂ)*d n x)) : + ∀ (φ:E → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*v x)=-(∫ x,(φ x:ℂ)*g x) := by + intro φ hφ hc + have hfc : Continuous (fun x => (φ x:ℂ)) := Complex.continuous_ofReal.comp hφ.continuous + have hfs : HasCompactSupport (fun x => (φ x:ℂ)) := hc.comp_left (g:=fun t:ℝ=>(t:ℂ)) (by simp) + have hdc : Continuous (fun x => (fderiv ℝ φ x a:ℂ)) := + Complex.continuous_ofReal.comp ((hφ.continuous_fderiv_apply (by norm_num)).comp + (continuous_id.prodMk continuous_const)) + have hds : HasCompactSupport (fun x => (fderiv ℝ φ x a:ℂ)) := + ((hc.fderiv ℝ).comp_left (g:=fun T:E →L[ℝ] ℝ => T a) (by simp)).comp_left + (g:=fun t:ℝ=>(t:ℂ)) (by simp) + have H1 := weak_l2_pairing_tendsto hu _ (hdc.memLp_of_hasCompactSupport hds) + have H2 := (weak_l2_pairing_tendsto hd _ (hfc.memLp_of_hasCompactSupport hfs)).neg + exact tendsto_nhds_unique H1 (by simpa only [hw _ φ hφ hc] using H2) + +variable {ι:Type*} [Fintype ι] [DecidableEq ι] + +lemma h1_spatial_tight_subsequence + (u:ℕ → Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (d:ℕ → ι → Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (hw:∀ n i (φ:EuclideanSpace ℝ ι → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x (EuclideanSpace.single i 1):ℂ)*u n x)=-(∫ x,(φ x:ℂ)*d n i x)) + (C K:ℝ) (hb:∀ n,‖u n‖≤C) (hK:∀ n,∑ i,‖d n i‖^2≤K) + (hsp:∀ ε:ℝ,0<ε → ∃ s:Set (EuclideanSpace ℝ ι),∃ hs:MeasurableSet s,volume s≠(⊤:ℝ≥0∞) ∧ + ∀ᶠ n in atTop,‖cutL2 sᶜ hs.compl (u n)‖≤ε) : + ∃ v:Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι)),∃ φ:ℕ → ℕ,StrictMono φ ∧ + Tendsto (u ∘ φ) atTop (𝓝 v) := by + apply l2_tight_frequency_subsequence u C hb hsp + intro ε hε + obtain ⟨R,hR,H⟩ := bounded_gradient_frequency_tight u d hw K hK ε hε + exact ⟨Metric.ball 0 R,measurableSet_ball,measure_ball_lt_top.ne,Filter.Eventually.of_forall H⟩ +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/L2WeightedDensitySetIntegral.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2WeightedDensitySetIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..91d837f0e34c89ee559373a059b8897fa7d178d9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/L2WeightedDensitySetIntegral.lean @@ -0,0 +1,101 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.L2MeasureInclusion + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +variable {Y ι : Type*} [MeasurableSpace Y] [Countable ι] +lemma l2_weighted_density_setIntegral {ν : Measure Y} (u : ι → Lp ℂ 2 ν) (w : ι → ℝ) + (hw : ∀ i, 0 ≤ w i) (hs : Summable (fun i => w i * ‖u i‖^2)) (A : Set Y) : + HasSum (fun i => w i * ∫ y in A, ‖u i y‖^2 ∂ν) + (∫ y in A, ∑' i, w i * ‖u i y‖^2 ∂ν) := by + have hi (i : ι) : Integrable (fun y => w i * ‖u i y‖^2) ν := + ((Lp.memLp (u i)).integrable_norm_pow (by norm_num : (2:ℕ) ≠ 0)).const_mul (w i) + have hp (i : ι) (y : Y) : 0 ≤ w i * ‖u i y‖^2 := mul_nonneg (hw i) (sq_nonneg _) + have hn : Summable (fun i => ∫ y in A, ‖w i * ‖u i y‖^2‖ ∂ν) := by + apply Summable.of_nonneg_of_le (fun index => + integral_nonneg (fun point => norm_nonneg (w index * ‖u index point‖^2))) + (f := fun i => w i * ‖u i‖^2) _ hs + intro i + simp only [Real.norm_eq_abs, abs_of_nonneg (hp i _)] + calc + (∫ y in A, w i * ‖u i y‖^2 ∂ν) ≤ ∫ y, w i * ‖u i y‖^2 ∂ν := + setIntegral_le_integral (hi i) (Filter.Eventually.of_forall (hp i)) + _ = w i * ‖u i‖^2 := by rw [integral_const_mul, ← l2_norm_sq] + have h := hasSum_integral_of_summable_integral_norm (fun i => (hi i).restrict) hn + simpa only [integral_const_mul] using h +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/ObservationAtomic.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/ObservationAtomic.lean new file mode 100644 index 0000000000000000000000000000000000000000..867aacb8964dd6c3a1c6714057d586df9d2f26da --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/ObservationAtomic.lean @@ -0,0 +1,145 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.UniformScreening +import OAI.Analysis.CoulombRadii.Variational.PhysicalBridge +import OAI.Analysis.CoulombRadii.RandomFields.EventTiltWavefunction + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma asH1_potentialForm {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) + (hw : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hg : ∀ σ i a, MemLp (g σ i a) 2 volume) (B : Coulomb.Configuration n → ℝ) : + Coulomb.potentialForm B (asH1 ψ g hw hψ hg) = + stateWeightedIntegral ψ (fun x => B (flattenConfiguration n x)) := by + unfold Coulomb.potentialForm stateWeightedIntegral + apply Finset.sum_congr rfl + intro σ _ + change (∫ x, B x*‖ψ σ ((flattenConfiguration n).symm x)‖^2) = _ + have H := (flattenConfiguration_symm_measurePreserving n).integral_comp' + (fun x => B (flattenConfiguration n x)*‖ψ σ x‖^2) + change (∫ x, B (flattenConfiguration n ((flattenConfiguration n).symm x))* + ‖ψ σ ((flattenConfiguration n).symm x)‖^2) = _ at H + simpa only [ContinuousLinearEquiv.apply_symm_apply] using H + +lemma eventTilt_stateWeightedIntegral {n : ℕ} (ψ : Wavefunction n) + {F : Configuration n → ℝ} (hF : ∀ x, 0 ≤ F x) + (hp : 0 < stateWeightedIntegral ψ F) (B : Configuration n → ℝ) : + stateWeightedIntegral (eventTiltWavefunction ψ F) B = + (stateWeightedIntegral ψ F)⁻¹ * stateWeightedIntegral ψ (fun x => F x*B x) := by + unfold stateWeightedIntegral + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro σ _ + rw [←integral_const_mul] + apply integral_congr_ae + filter_upwards [] with x + rw [eventTiltWavefunction_raw_density ψ hF hp] + simp only [stateWeightedIntegral] + ring + +theorem atomic_arrayEvent_state {H : Type*} [Fintype H] {n : ℕ} + (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ=1 → energy Z ψ g ≤ energy Z χ h) + {E D₀ : ℝ} (hbase : energy Z ψ g ≤ E+D₀) + (ℓ : H → ℝ) (hℓ : ∀ h, 0 < ℓ h) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (hsym : ∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y∈s ↔ y∈s) + (hp : 0 < stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)) : + ∃ u : Coulomb.H1Vector n, Coulomb.Antisymmetric u ∧ Coulomb.mass u=1 ∧ + Coulomb.form (Coulomb.atom Z hZ) u ≤ E+(D₀+observationEventEnergyConstant* + observationWidthSquareSum ℓ*(1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5) ∧ + ∀ B : Coulomb.Configuration n → ℝ, + Coulomb.potentialForm B u = (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ s x*B (flattenConfiguration n x)) := by + obtain ⟨hdom,hmass,henergy⟩ := groundState_arrayEventTilt Z hd hn hmin ℓ hℓ hs hsym hp + let u := asH1 (eventTiltWavefunction ψ (arrayEventLikelihood ℓ s)) + (eventTiltGradient ψ g (arrayEventLikelihood ℓ s)) hdom.2.1 hdom.2.2.1 hdom.2.2.2.1 + refine ⟨u,asH1_antisymmetric hdom,(asH1_mass ..).trans hmass,?_,?_⟩ + · change Coulomb.form (Coulomb.atom Z hZ) (asH1 ..) ≤ _ + rw [asH1_energy Z hZ] + linarith + · intro B + rw [asH1_potentialForm,eventTilt_stateWeightedIntegral ψ (arrayEventLikelihood_nonneg ℓ hs) hp] + +lemma observationEventOffset_nonneg {H : Type*} [Fintype H] {n : ℕ} + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) (hn : normSquared ψ=1) + {D₀ : ℝ} (hD : 0 ≤ D₀) (ℓ : H → ℝ) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (hp : 0 < stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)) : + 0 ≤ D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5 := by + have h1 := stateWeightedIntegral_le_one hd hn (arrayEventLikelihood_contDiff ℓ hs).continuous.measurable + (arrayEventLikelihood_nonneg ℓ hs) (arrayEventLikelihood_le_one ℓ hs) + have hl := Real.log_nonpos hp.le h1 + exact add_nonneg hD (mul_nonneg (mul_nonneg observationEventEnergyConstant_pos.le + (observationWidthSquareSum_nonneg ℓ)) (pow_nonneg (by linarith) _)) + +theorem atomic_arrayEvent_annular_second_moment {α β : ℝ} (hα : 0 < α) (hαβ : α < β) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ {H : Type*} [Fintype H] {n : ℕ} + (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n}, + FormDomain ψ g → normSquared ψ=1 → + (∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ=1 → energy Z ψ g ≤ energy Z χ h) → + ∀ {E D₀ : ℝ}, (E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D₀ → 0 ≤ D₀ → ∀ (ℓ : H → ℝ), (∀ h, 0 < ℓ h) → + ∀ {s : Set ((H × (Fin n × Fin 3)) → ℝ)}, MeasurableSet s → + (∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y∈s ↔ y∈s) → + 0 < stateWeightedIntegral ψ (arrayEventLikelihood ℓ s) → ∀ {r : ℝ}, 0 < r → + (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s))⁻¹ * stateWeightedIntegral ψ + (fun x => arrayEventLikelihood ℓ s x* + (Coulomb.localCount {z : Position | α*r < ‖z‖ ∧ ‖z‖ < β*r} (flattenConfiguration n x))^2) ≤ + C*(Coulomb.screenMass (D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5) r)^2 := by + obtain ⟨C,hC,hbound⟩ := Coulomb.atomic_annular_second_moment hα hαβ + refine ⟨C,hC,?_⟩ + intro H _ n Z hZ ψ g hd hn hmin E D₀ hE hbase hD ℓ hℓ s hs hsym hp r hr + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase ℓ hℓ hs hsym hp + have hb := hbound (Coulomb.atom Z hZ) (by intro i; rfl) u hu hum hE hue + (observationEventOffset_nonneg hd hn hD ℓ hs hp) hr + change Coulomb.potentialForm (fun x => (Coulomb.localCount _ x)^2) u ≤ _ at hb + rw [hlaw] at hb + exact hb + +theorem atomic_arrayEvent_raw_field {H : Type*} [Fintype H] {n : ℕ} + (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ=1 → energy Z ψ g ≤ energy Z χ h) + {E D₀ : ℝ} (hE : (E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g ≤ E+D₀) (hD : 0 ≤ D₀) + (ℓ : H → ℝ) (hℓ : ∀ h, 0 < ℓ h) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (hsym : ∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y∈s ↔ y∈s) + (hp : 0 < stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)) + {y : Position} (hy : y≠0) : + max ((stateWeightedIntegral ψ (arrayEventLikelihood ℓ s))⁻¹ * stateWeightedIntegral ψ + (fun x => arrayEventLikelihood ℓ s x * + Coulomb.rawSignedField (Coulomb.attraction (Coulomb.atom Z hZ) y) + {z | 40*Coulomb.atomicCellScale y ≤ ‖z-y‖} y (flattenConfiguration n x))) 0 ≤ + 2*Coulomb.atomicBudgetRecursionC^2*Coulomb.screenFieldUnit + (D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5) + Coulomb.atomicCountConstant (Coulomb.atomicCellScale y) := by + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase ℓ hℓ hs hsym hp + have hb := Coulomb.atomic_expected_raw_field_bound (Coulomb.atom Z hZ) (by intro i; rfl) + u hu hum hE hue (observationEventOffset_nonneg hd hn hD ℓ hs hp) hy + have hA : MeasurableSet {z : Position | 40*Coulomb.atomicCellScale y ≤ ‖z-y‖} := + (isClosed_le continuous_const (by fun_prop)).measurableSet + rw [←hlaw,Coulomb.potentialForm_rawSignedField u _ hA + y (mul_pos (by norm_num) (Coulomb.atomicCellScale_pos hy)) (fun _ h => h),hum,mul_one] + exact hb +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/OrbitalHilbertBasis.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/OrbitalHilbertBasis.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9fad62270e6c39abe7441749cabc9cb7bc7cee3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/OrbitalHilbertBasis.lean @@ -0,0 +1,412 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.ConfigurationMeasurableEquiv + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +open scoped Classical +open scoped Classical + +theorem exists_countable_spatial_basis : + ∃ (s : Set (Lp ℂ 2 (volume : Measure Space))) (b : HilbertBasis s ℂ (Lp ℂ 2 volume)), + Countable s ∧ ⇑b = Subtype.val := by + let : Fact ((2 : ℝ≥0∞) ≠ ⊤) := ⟨by norm_num⟩ + obtain ⟨s, b, hb⟩ := exists_hilbertBasis ℂ (Lp ℂ 2 (volume : Measure Space)) + refine ⟨s, b, ?_, hb⟩ + apply orthonormal_subtype_countable + simpa only [hb] using b.orthonormal + +theorem hilbertBasis_parseval {ι E : Type*} [NormedAddCommGroup E] + [InnerProductSpace ℂ E] (b : HilbertBasis ι ℂ E) (f : E) : + (∑' i, ‖inner ℂ (b i) f‖ ^ 2) = ‖f‖ ^ 2 := by + have h := lp.norm_rpow_eq_tsum (by norm_num : 0 < (2 : ℝ≥0∞).toReal) (b.repr f) + simp only [ENNReal.toReal_ofNat, Real.rpow_two, b.repr_apply_apply, + LinearIsometryEquiv.norm_map] at h + exact h.symm + +noncomputable def orbitalHilbertBasis {A ι : Type*} [MeasurableSpace A] {μ : Measure A} + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) : HilbertBasis ι ℂ (Lp ℂ 2 μ) := + HilbertBasis.mkOfOrthogonalEqBot (v := fun i => (hv i).toLp (v i)) + (by rw [orthonormal_iff_ite]; intro i j; rw [inner_toLp_complex]; exact ho i j) + (by + apply (Submodule.eq_bot_iff _).mpr + intro f hf + apply Lp.eq_zero_iff_ae_eq_zero.mpr + apply hc f (Lp.memLp f) + intro i + have he := (Submodule.mem_orthogonal _ _).1 hf ((hv i).toLp (v i)) + (Submodule.subset_span (Set.mem_range_self i)) + have hi := inner_toLp_complex (hv i) (Lp.memLp f) + simp only [Lp.toLp_coeFn] at hi + rwa [hi] at he) + +lemma orbitalHilbertBasis_apply {A ι : Type*} [MeasurableSpace A] {μ : Measure A} + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) (i : ι) : + orbitalHilbertBasis v hv ho hc i = (hv i).toLp (v i) := by + simp only [orbitalHilbertBasis, HilbertBasis.coe_mkOfOrthogonalEqBot] + +theorem completeOrbitals_parseval {A ι : Type*} [MeasurableSpace A] {μ : Measure A} + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) (f : A → ℂ) (hf : MemLp f 2 μ) : + (∑' i, ‖∫ a, star (v i a) * f a ∂μ‖ ^ 2) = ∫ a, ‖f a‖ ^ 2 ∂μ := by + have h := hilbertBasis_parseval (orbitalHilbertBasis v hv ho hc) (hf.toLp f) + simpa only [orbitalHilbertBasis_apply, inner_toLp_complex, norm_toLp_sq_complex] using h + +noncomputable def spinOrbital {ι : Type*} (v : ι → Space → ℂ) + (is : ι × Fin 2) (x : Space) (s : Fin 2) : ℂ := if s = is.2 then v is.1 x else 0 + +lemma spinOrbital_memLp {ι : Type*} (v : ι → Space → ℂ) + (hv : ∀ i, MemLp (v i) 2 volume) (is : ι × Fin 2) (s : Fin 2) : + MemLp (fun x => spinOrbital v is x s) 2 volume := by + by_cases h : s = is.2 + · simpa only [spinOrbital, ite_eq_left h] using hv is.1 + · simpa only [spinOrbital, ite_eq_right h] using (MemLp.zero' (μ := (volume : Measure Space)) (p := 2) (ε := ℂ)) + +lemma tensorSpinOrbital_apply {ι : Type*} {n : ℕ} (v : ι → Space → ℂ) + (b : Fin n → ι) (s t : Spins n) (x : Configuration n) : + tensorOrbital (spinOrbital v) (fun i => (b i, s i)) t x = + if t = s then (∏ i, v (b i) (position x i)) else 0 := by + by_cases h : t = s + · subst t + simp only [tensorOrbital, spinOrbital, ite_eq_left] + · rw [ite_eq_right h] + obtain ⟨i, hi⟩ : ∃ i, t i ≠ s i := by + by_contra hn + apply h + funext i + exact not_not.mp (not_exists.mp hn i) + apply Finset.prod_eq_zero (Finset.mem_univ i) + exact ite_eq_right hi + +lemma spinOrbital_orthonormal {ι : Type*} (v : ι → Space → ℂ) + (ho : ∀ i j, (∫ x, star (v i x) * v j x) = if i = j then (1 : ℂ) else 0) : + ∀ i j : ι × Fin 2, (∑ s, ∫ x, star (spinOrbital v i x s) * spinOrbital v j x s) = + if i = j then (1 : ℂ) else 0 := by + intro i j + by_cases ht : i.2 = j.2 + · have hm : ∀ s x, star (spinOrbital v i x s) * spinOrbital v j x s = + if s = i.2 then star (v i.1 x) * v j.1 x else 0 := by + intro s x + by_cases hs : s = i.2 <;> simp [spinOrbital, ← ht, hs] + simp_rw [hm] + have hi : ∀ s : Fin 2, (∫ x, if s = i.2 then star (v i.1 x) * v j.1 x else 0) = + if s = i.2 then (∫ x, star (v i.1 x) * v j.1 x) else 0 := by + intro s + split_ifs <;> simp + simp_rw [hi] + simp only [Finset.sum_ite_eq', Finset.mem_univ, ite_true] + rw [ho] + congr 1 + exact propext ⟨fun h => Prod.ext h ht, fun h => congrArg Prod.fst h⟩ + · have he : i ≠ j := fun h => ht (congrArg Prod.snd h) + rw [ite_eq_right he] + apply Finset.sum_eq_zero + intro s _ + by_cases hi : s = i.2 + · have hj : s ≠ j.2 := by rwa [hi] + simp only [spinOrbital, ite_eq_left hi, ite_eq_right hj, mul_zero, integral_zero] + · simp only [spinOrbital, ite_eq_right hi, star_zero, zero_mul, integral_zero] + +lemma tensorSpinHilbert_inner {ι : Type*} {n : ℕ} (v : ι → Space → ℂ) + (hv : ∀ i, MemLp (v i) 2 volume) (b : Fin n → ι) (s : Spins n) + (f : StateHilbert n) : + inner ℂ (tensorHilbert (spinOrbital v) (spinOrbital_memLp v hv) + (fun i => (b i, s i))) f = + ∫ x, star (∏ i, v (b i) (position x i)) * (f s : Configuration n → ℂ) x := by + rw [PiLp.inner_apply] + have hi : ∀ t : Spins n, + inner ℂ ((tensorHilbert (spinOrbital v) (spinOrbital_memLp v hv) + (fun i => (b i, s i))) t) (f t) = + if t = s then (∫ x, star (∏ i, v (b i) (position x i)) * + (f s : Configuration n → ℂ) x) else 0 := by + intro t + have he := inner_toLp_complex + (tensorOrbital_memLp (spinOrbital v) (spinOrbital_memLp v hv) + (fun i => (b i, s i)) t) (Lp.memLp (f t)) + simp only [Lp.toLp_coeFn] at he + simp only [tensorHilbert, WithLp.ofLp_toLp] + rw [he] + simp_rw [tensorSpinOrbital_apply] + split_ifs with ht + · subst t; rfl + · simp + simp_rw [hi] + simp + +theorem tensorSpinHilbert_orthogonal_eq_bot {ι : Type*} [Countable ι] {n : ℕ} + (v : ι → Space → ℂ) (hv : ∀ i, MemLp (v i) 2 volume) + (hc : CompleteOrbitals volume v) : + (Submodule.span ℂ (Set.range + (tensorHilbert (n := n) (spinOrbital v) (spinOrbital_memLp v hv))))ᗮ = ⊥ := by + apply (Submodule.eq_bot_iff _).mpr + intro f hf + have hcc := (completeOrbitals_finPi v hv hc n).comp + (configurationMeasurableEquiv n) (configurationMeasurableEquiv_measurePreserving n) + apply PiLp.ext + intro s + change f s = (0 : Lp ℂ 2 (volume : Measure (Configuration n))) + apply Lp.eq_zero_iff_ae_eq_zero.mpr + apply hcc (f s) (Lp.memLp (f s)) + intro b + have he := (Submodule.mem_orthogonal _ _).1 hf + (tensorHilbert (spinOrbital v) (spinOrbital_memLp v hv) (fun i => (b i, s i))) + (Submodule.subset_span (Set.mem_range_self _)) + rw [tensorSpinHilbert_inner v hv] at he + exact he + +noncomputable def tensorSpinHilbertBasis {ι : Type*} [Countable ι] {n : ℕ} + (v : ι → Space → ℂ) (hv : ∀ i, MemLp (v i) 2 volume) + (ho : ∀ i j, (∫ x, star (v i x) * v j x) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals volume v) : HilbertBasis (Fin n → ι × Fin 2) ℂ (StateHilbert n) := + HilbertBasis.mkOfOrthogonalEqBot + (tensorHilbert_orthonormal _ _ (by + intro i j + by_cases hij : i = j + · simpa only [ite_eq_left hij] using spinOrbital_orthonormal v ho i j + · simpa only [ite_eq_right hij] using spinOrbital_orthonormal v ho i j)) + (tensorSpinHilbert_orthogonal_eq_bot v hv hc) + +lemma tensorSpinHilbertBasis_apply {ι : Type*} [Countable ι] {n : ℕ} + (v : ι → Space → ℂ) (hv : ∀ i, MemLp (v i) 2 volume) + (ho : ∀ i j, (∫ x, star (v i x) * v j x) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals volume v) (b : Fin n → ι × Fin 2) : + tensorSpinHilbertBasis v hv ho hc b = + tensorHilbert (spinOrbital v) (spinOrbital_memLp v hv) b := by + simp only [tensorSpinHilbertBasis, HilbertBasis.coe_mkOfOrthogonalEqBot] + +theorem orbitalCoefficient_spin_parseval {ι : Type*} [Countable ι] {n : ℕ} + (ψ : H1Vector n) (v : ι → Space → ℂ) (hv : ∀ i, MemLp (v i) 2 volume) + (ho : ∀ i j, (∫ x, star (v i x) * v j x) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals volume v) : + (∑' b : Fin n → ι × Fin 2, ‖orbitalCoefficient ψ (spinOrbital v) b‖ ^ 2) = mass ψ := by + have h := hilbertBasis_parseval (tensorSpinHilbertBasis (n := n) v hv ho hc) ψ.toHilbert + simpa only [tensorSpinHilbertBasis_apply, ← orbitalCoefficient_eq_inner, + H1Vector.toHilbert_norm_sq] using h + +lemma fin_strictMono_nat_le {n : ℕ} (f : Fin n → ℕ) (hf : StrictMono f) (i : Fin n) : + i.val ≤ f i := by + have h : ∀ k (hk : k < n), k ≤ f ⟨k, hk⟩ := by + intro k + induction k with + | zero => intro hk; exact Nat.zero_le _ + | succ k ih => + intro hk + have hk' : k < n := Nat.lt_of_succ_lt hk + have hi := ih hk' + have hj := hf (show (⟨k, hk'⟩ : Fin n) < ⟨k+1, hk⟩ from Nat.lt_succ_self k) + omega + exact h i.val i.isLt + +theorem levels_sum_le {n : ℕ} (levels : ℕ → ℝ) (hlevels : Monotone levels) + (b : Fin n → ℕ) (hb : Function.Injective b) : + (∑ k ∈ Finset.range n, levels k) ≤ ∑ i, levels (b i) := by + classical + let s : Finset ℕ := Finset.univ.image b + have hs : s.card = n := by simp only [s, Finset.card_image_of_injective _ hb, Finset.card_univ, Fintype.card_fin] + let e := s.orderEmbOfFin hs + have he : ∑ i, levels (e i) = ∑ a ∈ s, levels a := by + calc + _ = ∑ a ∈ Finset.univ.image e, levels a := (Finset.sum_image e.injective.injOn).symm + _ = _ := by rw [Finset.image_orderEmbOfFin_univ] + calc + _ = ∑ i : Fin n, levels i.val := Finset.sum_range levels + _ ≤ ∑ i : Fin n, levels (e i) := Finset.sum_le_sum fun i _ => + hlevels (fin_strictMono_nat_le e e.strictMono i) + _ = ∑ a ∈ s, levels a := he + _ = ∑ i, levels (b i) := Finset.sum_image hb.injOn + +theorem FermionicCoefficients.levels_lower {n : ℕ} {f : (Fin n → ℕ) → ℂ} + (hf : FermionicCoefficients f) (hs : Summable (fun b => ‖f b‖^2)) + (levels : ℕ → ℝ) (hlevels : Monotone levels) + (he : Summable (fun b => (∑ i, levels (b i)) * ‖f b‖^2)) : + (∑ k ∈ Finset.range n, levels k) * (∑' b, ‖f b‖^2) ≤ + ∑' b, (∑ i, levels (b i)) * ‖f b‖^2 := by + rw [← tsum_mul_left] + apply Summable.tsum_le_tsum _ (hs.mul_left _) he + intro b + by_cases hz : f b = 0 + · simp [hz] + have hb : Function.Injective b := by + intro i j hij + by_contra hne + exact hz (hf.vanish_of_repeat hne hij) + exact mul_le_mul_of_nonneg_right (levels_sum_le levels hlevels b hb) (sq_nonneg _) + +section GeneralFermionSpace +variable {A ι : Type*} [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] + +lemma measurePreserving_permutePi {n : ℕ} (p : Equiv.Perm (Fin n)) : + MeasurePreserving (fun x : Fin n → A => x ∘ p) + (Measure.pi fun _ => μ) (Measure.pi fun _ => μ) := by + have he : (MeasurableEquiv.piCongrLeft (fun _ => A) p.symm : + (Fin n → A) → (Fin n → A)) = fun x => x ∘ p := by + funext x i + simpa only [Equiv.symm_apply_apply, Function.comp_apply] using + (MeasurableEquiv.piCongrLeft_apply_apply (β := fun _ => A) p.symm x (p i)) + simpa only [he] using measurePreserving_piCongrLeft (fun _ : Fin n => μ) p.symm + +lemma scalarTensor_inner_integral {n : ℕ} (v : ι → A → ℂ) (b c : Fin n → ι) : + (∫ x : Fin n → A, star (∏ i, v (b i) (x i)) * (∏ i, v (c i) (x i)) + ∂(Measure.pi fun _ => μ)) = ∏ i, ∫ a, star (v (b i) a) * v (c i) a ∂μ := by + simp only [star_prod, ← Finset.prod_mul_distrib] + exact integral_fintype_prod_eq_prod (μ := fun _ : Fin n => μ) + (fun i a => star (v (b i) a) * v (c i) a) + +lemma scalarTensor_orthonormal {n : ℕ} (v : ι → A → ℂ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) : + ∀ b c : Fin n → ι, (∫ x, star (∏ i, v (b i) (x i)) * (∏ i, v (c i) (x i)) + ∂(Measure.pi fun _ => μ)) = if b = c then (1 : ℂ) else 0 := by + intro b c + rw [scalarTensor_inner_integral] + simp_rw [ho] + by_cases h : b = c + · subst c; simp + · rw [ite_eq_right h] + obtain ⟨i, hi⟩ : ∃ i, b i ≠ c i := by + by_contra hh + apply h + funext i + exact not_not.mp (not_exists.mp hh i) + apply Finset.prod_eq_zero (Finset.mem_univ i) + exact ite_eq_right hi + +noncomputable def scalarCoefficient {n : ℕ} (f : (Fin n → A) → ℂ) + (v : ι → A → ℂ) (b : Fin n → ι) : ℂ := + ∫ x, star (∏ i, v (b i) (x i)) * f x ∂(Measure.pi fun _ => μ) + +def ProductAntisymmetric {n : ℕ} (f : (Fin n → A) → ℂ) : Prop := + ∀ (p : Equiv.Perm (Fin n)), ∀ᵐ x ∂(Measure.pi fun _ => μ), + f (x ∘ p) = ((p.sign : ℤ) : ℂ) * f x + +lemma scalarCoefficient_antisymmetric {n : ℕ} {f : (Fin n → A) → ℂ} + (hf : ProductAntisymmetric (μ := μ) f) (v : ι → A → ℂ) : + FermionicCoefficients (scalarCoefficient (μ := μ) f v) := by + intro p b + unfold scalarCoefficient + have hp := measurePreserving_piCongrLeft (fun _ : Fin n => μ) p.symm + have he : (MeasurableEquiv.piCongrLeft (fun _ => A) p.symm : + (Fin n → A) → (Fin n → A)) = fun x => x ∘ p := by + funext x i + simpa only [Equiv.symm_apply_apply, Function.comp_apply] using + (MeasurableEquiv.piCongrLeft_apply_apply (β := fun _ => A) p.symm x (p i)) + rw [← hp.integral_comp' (fun x => star (∏ i, v ((b ∘ p) i) (x i)) * f x), he, + ← integral_const_mul] + apply integral_congr_ae + filter_upwards [hf p] with x hx + simp only [Function.comp_apply, hx] + rw [Equiv.prod_comp p (fun i => v (b i) (x i))] + ring + +theorem scalarCoefficient_parseval [Countable ι] {n : ℕ} + (f : (Fin n → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) : + (∑' b : Fin n → ι, ‖scalarCoefficient (μ := μ) f v b‖^2) = + ∫ x, ‖f x‖^2 ∂(Measure.pi fun _ => μ) := by + have ht := completeOrbitals_parseval (μ := Measure.pi fun _ : Fin n => μ) + (fun (b : Fin n → ι) (x : Fin n → A) => ∏ i, v (b i) (x i)) + (scalarTensor_memLp v hv) (by + intro b c + have h := scalarTensor_orthonormal (μ := μ) v ho b c + by_cases he : b = c <;> simpa only [he, ite_true, ite_false] using h) + (completeOrbitals_finPi v hv hc n) f hf + simpa only [scalarCoefficient] using ht + +lemma scalarCoefficient_summable {n : ℕ} + (f : (Fin n → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) : + Summable (fun b : Fin n → ι => ‖scalarCoefficient (μ := μ) f v b‖^2) := by + have ho' : Orthonormal ℂ (fun b : Fin n → ι => + (scalarTensor_memLp v hv b).toLp (fun x : Fin n → A => ∏ i, v (b i) (x i))) := by + rw [orthonormal_iff_ite] + intro b c + rw [inner_toLp_complex] + exact scalarTensor_orthonormal v ho b c + have hs := ho'.inner_products_summable (hf.toLp f) + simpa only [inner_toLp_complex, scalarCoefficient] using hs + +theorem scalarCoefficient_levels_lower {n : ℕ} + (f : (Fin n → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (ha : ProductAntisymmetric (μ := μ) f) + (v : ℕ → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (hc : CompleteOrbitals μ v) (levels : ℕ → ℝ) (hl : Monotone levels) + (he : Summable (fun b => (∑ i, levels (b i)) * + ‖scalarCoefficient (μ := μ) f v b‖^2)) : + (∑ k ∈ Finset.range n, levels k) * (∫ x, ‖f x‖^2 ∂(Measure.pi fun _ => μ)) ≤ + ∑' b, (∑ i, levels (b i)) * ‖scalarCoefficient (μ := μ) f v b‖^2 := by + have ho' : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = + if i = j then (1 : ℂ) else 0 := ho + have hp := scalarCoefficient_parseval f hf v hv (by + intro i j + by_cases hij : i = j <;> simpa only [hij, ite_true, ite_false] using ho' i j) hc + rw [← hp] + exact (scalarCoefficient_antisymmetric ha v).levels_lower + (scalarCoefficient_summable f hf v hv (by + intro i j + by_cases hij : i = j <;> simpa only [hij, ite_true, ite_false] using ho' i j)) levels hl he + +end GeneralFermionSpace + +noncomputable def cosineMode (b : ℝ) (n : ℕ) (x : ℝ) : ℂ := + (Real.cos ((n : ℝ) * Real.pi * x / b) : ℂ) + +noncomputable def evenOnSegment (b : ℝ) (f : ℝ → ℂ) (x : ℝ) : ℂ := + (Ioc 0 b).indicator f x + (Ioc 0 b).indicator f (-x) + +lemma evenOnSegment_memLp {b : ℝ} {f : ℝ → ℂ} + (hf : MemLp f 2 (volume.restrict (Ioc 0 b))) : + MemLp (evenOnSegment b f) 2 volume := by + have hg : MemLp ((Ioc 0 b).indicator f) 2 volume := + (memLp_indicator_iff_restrict measurableSet_Ioc).2 hf + exact hg.add (hg.comp_measurePreserving (Measure.measurePreserving_neg (volume : Measure ℝ))) + +lemma evenOnSegment_pos {b x : ℝ} (f : ℝ → ℂ) (hx : x ∈ Ioc 0 b) : + evenOnSegment b f x = f x := by + have hn : -x ∉ Ioc 0 b := by rintro ⟨hh, _⟩; linarith [hx.1] + simp only [evenOnSegment, indicator_of_mem hx, indicator_of_notMem hn, add_zero] + +lemma evenOnSegment_eq_zero {b x : ℝ} (hb : 0 < b) (f : ℝ → ℂ) + (hx : x ∉ Icc (-b) b) : evenOnSegment b f x = 0 := by + have hp : x ∉ Ioc 0 b := by + intro h + exact hx ⟨by linarith [h.1], h.2⟩ + have hn : -x ∉ Ioc 0 b := by + intro h + exact hx ⟨by linarith [h.2], by linarith [h.1]⟩ + simp [evenOnSegment, hp, hn] + +lemma evenOnSegment_neg (b : ℝ) (f : ℝ → ℂ) (x : ℝ) : + evenOnSegment b f (-x) = evenOnSegment b f x := by + simp only [evenOnSegment, neg_neg, add_comm] + +lemma fourierOn_ae_zero {a b : ℝ} {f : ℝ → ℂ} (hab : a < b) + (hf : MemLp f 2 (volume.restrict (Ioc a b))) + (hz : ∀ n : ℤ, fourierCoeffOn hab f n = 0) : + f =ᵐ[volume.restrict (Ioc a b)] 0 := by + have hp := tsum_sq_fourierCoeffOn hab hf + simp only [hz, norm_zero, zero_pow (by omega : 2 ≠ 0), tsum_zero, + smul_eq_mul, intervalIntegral.integral_of_le hab.le] at hp + have hnorm : (∫ x in Ioc a b, ‖f x‖^2) = 0 := by + exact (mul_eq_zero.mp hp.symm).resolve_left (inv_ne_zero (sub_ne_zero.mpr hab.ne')) + have hz' := (integral_eq_zero_iff_of_nonneg (fun x => sq_nonneg ‖f x‖) + hf.norm.integrable_sq).1 hnorm + filter_upwards [hz'] with x hx + simpa using hx + +end Coulomb +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/PacketStateL2Norm.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/PacketStateL2Norm.lean new file mode 100644 index 0000000000000000000000000000000000000000..d51a8c85f4688adbb7171a6c8dd76a225af1c43d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/PacketStateL2Norm.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketWindowed + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +lemma packetState_toL2_norm (g : 𝓢(Space,ℂ)) (y p : Space) : + ‖(packetState g y p).toLp 2 volume‖ = ‖g.toLp 2 volume‖ := by + rw [SchwartzMap.norm_toLp' (by norm_num : (2:ℝ≥0∞) ≠ 0) (by simp), + SchwartzMap.norm_toLp' (by norm_num : (2:ℝ≥0∞) ≠ 0) (by simp)] + simp only [ENNReal.toReal_ofNat, Real.rpow_two] + rw [packetState_integral_norm_sq] + +lemma packetState_toL2_continuous (g : 𝓢(Space,ℂ)) : + Continuous (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) := by + rw [continuous_iff_continuousAt] + intro yp₀ + apply tendsto_iff_norm_sub_tendsto_zero.mpr + have hc : Continuous (fun yp : Space × Space => + ‖(packetState g yp.1 yp.2).toLp 2 volume - + (packetState g yp₀.1 yp₀.2).toLp 2 volume‖^2) := by + simp only [norm_sub_sq (𝕜 := ℂ), packetState_toL2_norm, packetState_inner] + exact (continuous_const.sub (continuous_const.mul + (Complex.continuous_re.comp (packetAnalysis_continuous g (packetState g yp₀.1 yp₀.2))))).add continuous_const + have h := hc.sqrt.continuousAt (x := yp₀) + simpa only [ContinuousAt, Real.sqrt_sq (norm_nonneg _), sub_self, norm_zero, zero_pow (by norm_num : (2:ℕ) ≠ 0), + Real.sqrt_zero] using h + +lemma schwartz_toL2_norm_sq (g : 𝓢(Space,ℂ)) : + ‖g.toLp 2 volume‖^2 = ∫ x : Space, ‖g x‖^2 := by + have h := congrArg Complex.re (SchwartzMap.inner_toL2_toL2_eq g g volume) + rw [inner_self_eq_norm_sq_to_K] at h + change ((‖g.toLp 2 volume‖ : ℂ)^2).re = (∫ x : Space, inner ℂ (g x) (g x)).re at h + rw [← Complex.ofReal_pow, Complex.ofReal_re] at h + rw [h] + change RCLike.re (∫ x : Space, inner ℂ (g x) (g x)) = _ + rw [← integral_re] + · apply integral_congr_ae + filter_upwards [] with x + simp [inner_self_eq_norm_sq_to_K, ← Complex.ofReal_pow] + · convert ((g.memLp 2 volume).integrable_norm_pow (by norm_num : (2:ℕ) ≠ 0)).ofReal using 1 + ext x + simp [inner_self_eq_norm_sq_to_K, Complex.ofReal_pow] + +lemma packetState_toL2_memLp (g : 𝓢(Space,ℂ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + MemLp (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) 2 μ := + MemLp.of_bound (packetState_toL2_continuous g).aestronglyMeasurable ‖g.toLp 2 volume‖ + (Filter.Eventually.of_forall fun yp => (packetState_toL2_norm g yp.1 yp.2).le) +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/ParticleGradientNorm.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/ParticleGradientNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..2598142c06907e9fe2b9672182c09ecdc47e8c97 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/ParticleGradientNorm.lean @@ -0,0 +1,407 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.WedgeInsert + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + + def oneParticleGradientNorm (f : Position → ℝ) : ℝ := + ∑ a : Fin 3, ∫ y : Position, (fderiv ℝ f y (EuclideanSpace.single a 1))^2 + + theorem gradientNormSquared_insert {n : ℕ} (f : Position → ℝ) + (ψ : Wavefunction n) (g : Gradient n) : + gradientNormSquared (insertGradient f ψ g) = + (∫ y : Position, (f y)^2) * gradientNormSquared g + oneParticleGradientNorm f * normSquared ψ := by + unfold gradientNormSquared + rw [Fin.sum_univ_succ] + change (∑ a : Fin 3, normSquared (insertWavefunction (fun y => fderiv ℝ f y (EuclideanSpace.single a 1)) ψ)) + + (∑ i : Fin n, ∑ a : Fin 3, normSquared (insertWavefunction f (fun σ x => g σ i a x))) = _ + simp only [normSquared_insert, oneParticleGradientNorm, Finset.sum_mul, Finset.mul_sum] + ring + + theorem weighted_normSquared_insert {n : ℕ} (f : Position → ℝ) (ψ : Wavefunction n) + (W : Configuration n → ℝ) : + (∑ σ : Spins (n+1), ∫ x : Configuration (n+1), + W (fun i => x i.succ)*‖insertWavefunction f ψ σ x‖^2) = + (∫ y : Position, (f y)^2) * ∑ σ : Spins n, ∫ x : Configuration n, W x*‖ψ σ x‖^2 := by + classical + rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (n+1) => Fin 2))] + rw [Fintype.sum_prod_type, Fin.sum_univ_two] + have h10 : (1 : Fin 2) ≠ 0 := by decide + simp only [Fin.consEquiv, Equiv.coe_fn_mk, insertWavefunction, Fin.cons_zero, + Fin.cons_succ, h10, ↓reduceIte] + simp only [norm_zero, zero_pow (by decide : 2 ≠ 0), mul_zero, integral_zero, + Finset.sum_const_zero, add_zero, integral_weighted_tensor, Finset.mul_sum] + + theorem potentialForm_insert_le {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular ψ g) {R d : ℝ} (hRd : R < d) + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) + {f : Position → ℝ} (hfLp : MemLp f 2 volume) + (hfout : ∀ y, ‖y‖ ≤ d → f y = 0) + (hi : FormRegular (insertWavefunction f ψ) (insertGradient f ψ g)) : + potentialForm Z (insertWavefunction f ψ) ≤ + (∫ y : Position, (f y)^2) * potentialForm Z ψ + + ((n : ℝ)*(d-R)⁻¹)*normSquared (insertWavefunction f ψ) := by + let C : ℝ := (n : ℝ)*(d-R)⁻¹ + have hold (σ : Spins (n+1)) : Integrable (fun x : Configuration (n+1) => + coulombPotential Z (fun i => x i.succ)*‖insertWavefunction f ψ σ x‖^2) := by + by_cases hσ : σ 0 = 0 + · simpa only [insertWavefunction, hσ, ↓reduceIte] using + integrable_weighted_tensor hfLp (h.integrable_potential Z (fun i => σ i.succ)) + · simp [insertWavefunction, hσ] + have hnew (σ : Spins (n+1)) := ((hi.2.1 σ).norm.integrable_sq).const_mul C + have hb (σ : Spins (n+1)) (x : Configuration (n+1)) : + coulombPotential Z x*‖insertWavefunction f ψ σ x‖^2 ≤ + coulombPotential Z (fun i => x i.succ)*‖insertWavefunction f ψ σ x‖^2 + + C*‖insertWavefunction f ψ σ x‖^2 := by + by_cases hx : insertWavefunction f ψ σ x = 0 + · simp [hx] + · have he : x = Fin.cons (x 0) (fun i => x i.succ) := by ext i; cases i using Fin.cases <;> rfl + have hsum : (∑ i : Fin n, ‖x 0-x i.succ‖⁻¹) ≤ C := by + calc + _ ≤ ∑ _i : Fin n, (d-R)⁻¹ := Finset.sum_le_sum fun i _ => + (le_abs_self _).trans (inserted_pair_bound hRd hfout hψ σ x i hx) + _ = C := by simp [C] + have hpot : coulombPotential Z x ≤ coulombPotential Z (fun i => x i.succ) + C := by + conv_lhs => rw [he, coulombPotential_cons] + have hn : 0 ≤ (Z : ℝ)*‖x 0‖⁻¹ := by positivity + linarith + simpa only [add_mul] using mul_le_mul_of_nonneg_right hpot (sq_nonneg ‖insertWavefunction f ψ σ x‖) + have hiσ (σ : Spins (n+1)) : + (∫ x, coulombPotential Z x*‖insertWavefunction f ψ σ x‖^2) ≤ + (∫ x, coulombPotential Z (fun i => x i.succ)*‖insertWavefunction f ψ σ x‖^2) + + C*(∫ x, ‖insertWavefunction f ψ σ x‖^2) := by + have hm := integral_mono (hi.integrable_potential Z σ) ((hold σ).add (hnew σ)) (hb σ) + change _ ≤ ∫ x, coulombPotential Z (fun i => x i.succ)*‖insertWavefunction f ψ σ x‖^2 + + C*‖insertWavefunction f ψ σ x‖^2 at hm + rw [integral_add (hold σ) (hnew σ), integral_const_mul] at hm + exact hm + have hsum := Finset.sum_le_sum (s := Finset.univ) (fun σ _ => hiσ σ) + simp only [Finset.sum_add_distrib, ← Finset.mul_sum] at hsum + rw [weighted_normSquared_insert] at hsum + exact hsum + + theorem energy_insert_le {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular ψ g) (hn : normSquared ψ = 1) {R d : ℝ} (hRd : R < d) + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) + {f : Position → ℝ} (hfLp : MemLp f 2 volume) (hfn : (∫ y : Position, (f y)^2) = 1) + (hfout : ∀ y, ‖y‖ ≤ d → f y = 0) + (hi : FormRegular (insertWavefunction f ψ) (insertGradient f ψ g)) : + energy Z (insertWavefunction f ψ) (insertGradient f ψ g) ≤ energy Z ψ g + + (1/2 : ℝ)*oneParticleGradientNorm f + (n : ℝ)*(d-R)⁻¹ := by + have hp := potentialForm_insert_le Z h hRd hψ hfLp hfout hi + simp only [hfn, normSquared_insert, hn, one_mul, mul_one] at hp + rw [energy_decompose, energy_decompose, gradientNormSquared_insert, hfn, hn, one_mul, mul_one] + linarith + +def distantCenter : Position := (4 : ℝ) • EuclideanSpace.single 0 1 + +theorem distantCenter_norm : ‖distantCenter‖ = 4 := by + simp [distantCenter, norm_smul, EuclideanSpace.single, PiLp.norm_single] + +theorem bindingBump_smooth : ContDiff ℝ ∞ (fun y : Position => bindingBump y) := bindingBump.contDiff + +def distantMass : ℝ := ∫ y : Position, (bindingBump y)^2 + +theorem distantMass_pos : 0 < distantMass := by + have hc : Continuous (fun y : Position => (bindingBump y)^2) := + bindingBump_smooth.continuous.pow 2 + have hs : HasCompactSupport (fun y : Position => (bindingBump y)^2) := by + apply HasCompactSupport.intro (isCompact_closedBall (0 : Position) 2) + intro y hy + have hh : 2 ≤ ‖y‖ := (lt_of_not_ge (by simpa [Metric.mem_closedBall, dist_zero_right] using hy)).le + rw [bindingBump.zero_of_le_dist (by simpa [bindingBump] using hh)] + norm_num + apply integral_pos_of_integrable_nonneg_nonzero hc (hc.integrable_of_hasCompactSupport hs) + (fun y => sq_nonneg _) (x := 0) + rw [bindingBump.one_of_mem_closedBall (by simp [bindingBump])] + norm_num + +def distantPacket (t : ℝ) (y : Position) : ℝ := + (Real.sqrt (t^3 * distantMass))⁻¹ * bindingBump (t⁻¹ • y - distantCenter) + +theorem distantPacket_smooth (t : ℝ) : ContDiff ℝ ∞ (distantPacket t) := + contDiff_const.mul (bindingBump.contDiff.comp + (((contDiff_const (c := t⁻¹)).smul (contDiff_id (E := Position))).sub contDiff_const)) + +theorem distantPacket_compact {t : ℝ} (ht : 0 < t) : HasCompactSupport (distantPacket t) := by + let u : ℝˣ := Units.mk0 t⁻¹ (inv_ne_zero ht.ne') + have hc : HasCompactSupport (fun y : Position => bindingBump (t⁻¹ • y - distantCenter)) := + (bindingBump.hasCompactSupport.comp_homeomorph (Homeomorph.subRight distantCenter)).comp_homeomorph + (Homeomorph.smul u) + exact hc.mul_left + +theorem distantPacket_memLp {t : ℝ} (ht : 0 < t) : MemLp (distantPacket t) 2 volume := + (distantPacket_smooth t).continuous.memLp_of_hasCompactSupport (distantPacket_compact ht) + +theorem distantPacket_derivative_memLp {t : ℝ} (ht : 0 < t) (v : Position) : + MemLp (fun y => fderiv ℝ (distantPacket t) y v) 2 volume := + (((distantPacket_smooth t).continuous_fderiv (by simp)).clm_apply continuous_const).memLp_of_hasCompactSupport + ((distantPacket_compact ht).fderiv_apply ℝ v) + +theorem integral_distant_comp {t : ℝ} (ht : 0 < t) (F : Position → ℝ) : + (∫ y : Position, F (t⁻¹ • y - distantCenter)) = t^3 * ∫ y : Position, F y := by + rw [show (fun y : Position => F (t⁻¹ • y-distantCenter)) = + (fun y : Position => (fun z : Position => F (z-distantCenter)) (t⁻¹ • y)) from rfl] + rw [Measure.integral_comp_smul_of_nonneg volume (fun z : Position => F (z-distantCenter)) t⁻¹ (hR := by positivity)] + simp [integral_sub_right_eq_self, Position, inv_pow] + +theorem distantPacket_normalized {t : ℝ} (ht : 0 < t) : + (∫ y : Position, (distantPacket t y)^2) = 1 := by + simp only [distantPacket, mul_pow, integral_const_mul] + rw [integral_distant_comp ht (fun y => (bindingBump y)^2)] + rw [inv_pow, Real.sq_sqrt (mul_nonneg (pow_nonneg ht.le 3) distantMass_pos.le)] + change (t^3*distantMass)⁻¹*(t^3*distantMass) = 1 + exact inv_mul_cancel₀ (mul_ne_zero (pow_ne_zero _ ht.ne') distantMass_pos.ne') + +theorem distantPacket_zero {t : ℝ} (ht : 0 < t) {y : Position} (hy : ‖y‖ ≤ 2*t) : + distantPacket t y = 0 := by + have hnorm : ‖t⁻¹ • y‖ ≤ 2 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr ht)] + exact (inv_mul_le_iff₀ ht).mpr (by nlinarith) + have hdist : 2 ≤ ‖t⁻¹ • y - distantCenter‖ := by + have h := norm_sub_norm_le distantCenter (t⁻¹ • y) + rw [distantCenter_norm, norm_sub_rev] at h + linarith + have := bindingBump.zero_of_le_dist (by simpa [bindingBump] using hdist) + simp [distantPacket, this] + +theorem distantPacket_derivative_zero {t : ℝ} (ht : 0 < t) {y : Position} + (hy : ‖y‖ ≤ t) (v : Position) : fderiv ℝ (distantPacket t) y v = 0 := by + have he : distantPacket t =ᶠ[𝓝 y] (fun _ => 0) := by + have hn : ‖y‖ < 2*t := by linarith + filter_upwards [(isOpen_lt continuous_norm continuous_const).mem_nhds hn] with z hz + exact distantPacket_zero ht hz.le + rw [he.fderiv_eq] + simp + +theorem distantPacket_fderiv {t : ℝ} (y v : Position) : + fderiv ℝ (distantPacket t) y v = + (Real.sqrt (t^3*distantMass))⁻¹ * t⁻¹ * + fderiv ℝ (fun z : Position => bindingBump z) (t⁻¹ • y-distantCenter) v := by + have hb := (bindingBump_smooth.differentiable (by simp) (t⁻¹ • y-distantCenter)).hasFDerivAt + have hc := ((hasFDerivAt_id (𝕜 := ℝ) y).const_smul t⁻¹).sub_const distantCenter + have hh := ((hb.comp y hc).const_mul (Real.sqrt (t^3*distantMass))⁻¹).fderiv + change fderiv ℝ (fun y : Position => (Real.sqrt (t^3*distantMass))⁻¹ * + bindingBump (t⁻¹ • y-distantCenter)) y v = _ + change fderiv ℝ (fun y : Position => (Real.sqrt (t^3*distantMass))⁻¹ * + (bindingBump ∘ fun x : Position => (t⁻¹ • id) x - distantCenter) y) y v = _ + rw [hh] + simp [mul_assoc] + +theorem distantPacket_gradientNorm {t : ℝ} (ht : 0 < t) : + oneParticleGradientNorm (distantPacket t) = + t⁻¹^2 * (distantMass⁻¹ * oneParticleGradientNorm bindingBump) := by + unfold oneParticleGradientNorm + simp_rw [distantPacket_fderiv, mul_pow, integral_const_mul] + have hi (a : Fin 3) := integral_distant_comp ht + (fun y => (fderiv ℝ (fun z : Position => bindingBump z) y (EuclideanSpace.single a 1))^2) + simp_rw [hi] + rw [← Finset.mul_sum, ← Finset.mul_sum] + rw [inv_pow, Real.sq_sqrt (mul_nonneg (pow_nonneg ht.le 3) distantMass_pos.le)] + field_simp + +theorem distantInsertion_error_tendsto (n : ℕ) (R : ℝ) : + Tendsto (fun t : ℝ => (1/2 : ℝ) * (t⁻¹^2 * + (distantMass⁻¹ * oneParticleGradientNorm bindingBump)) + (n : ℝ)*(t-R)⁻¹) + atTop (𝓝 0) := by + have hi : Tendsto (fun t : ℝ => (t-R)⁻¹) atTop (𝓝 0) := by + exact tendsto_inv_atTop_zero.comp + (by simpa only [sub_eq_add_neg, id_eq] using tendsto_atTop_add_const_right atTop (-R) tendsto_id) + have hh := ((tendsto_inv_atTop_zero.pow 2).mul_const + (distantMass⁻¹ * oneParticleGradientNorm bindingBump)).const_mul (1/2 : ℝ) + simpa using hh.add (hi.const_mul (n : ℝ)) + +theorem FormDomain.exists_inserted_trial {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) + (hn : normSquared ψ = 1) {R : ℝ} + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) + (hg : ∀ σ i a x, R < ‖x‖ → g σ i a x = 0) + {ε : ℝ} (hε : 0 < ε) : + ∃ (χ : Wavefunction (n+1)) (h : Gradient (n+1)), + FormDomain χ h ∧ normSquared χ = 1 ∧ energy Z χ h < energy Z ψ g + ε := by + have he : ∀ᶠ t : ℝ in atTop, (1/2 : ℝ) * + (t⁻¹^2 * (distantMass⁻¹ * oneParticleGradientNorm bindingBump)) + (n : ℝ)*(t-R)⁻¹ < ε := + (distantInsertion_error_tendsto n R).eventually (Iio_mem_nhds hε) + obtain ⟨t, ht, htR, hterr⟩ := ((eventually_gt_atTop (0 : ℝ)).and + ((eventually_gt_atTop R).and he)).exists + let f := distantPacket t + have hfLp : MemLp f 2 volume := distantPacket_memLp ht + have hfn : (∫ y : Position, (f y)^2) = 1 := distantPacket_normalized ht + have hfout : ∀ y, ‖y‖ ≤ t → f y = 0 := + fun y hy => distantPacket_zero ht (by linarith) + have hi : FormRegular (insertWavefunction f ψ) (insertGradient f ψ g) := + FormRegular.insert_separated hd.2 ht htR hψ (distantPacket_smooth t) hfLp + (fun a => distantPacket_derivative_memLp ht _) hfout + have hfs : ∀ y, ‖y‖ ≤ R → f y = 0 := fun y hy => hfout y (hy.trans htR.le) + have hs := insertionSupport_tensor hfs hψ + have hgs : ∀ i a, InsertionSupport R (fun σ x => insertGradient f ψ g σ i a x) := + insertionSupport_gradient hfs + (fun a y hy => distantPacket_derivative_zero ht (hy.trans htR.le) _) hψ hg + let c : ℝ := (Real.sqrt (n+1 : ℝ))⁻¹ + have hc : c^2 * (n+1 : ℝ) = 1 := by + dsimp [c] + rw [inv_pow, Real.sq_sqrt (by positivity), inv_mul_cancel₀ (by positivity)] + refine ⟨scaleWavefunction c (wedgeInsert f ψ), scaleGradient c (wedgeInsertGradient f ψ g), + (hi.wedgeInsert hd.1).scale c, ?_, ?_⟩ + · rw [normSquared_scale, normSquared_wedgeInsert hd.2.2.1 hfLp hs, + normSquared_insert, hfn, hn] + simpa only [one_mul, mul_one] using hc + · rw [energy_scale, energy_wedgeInsert Z hi hs hgs, ← mul_assoc, hc, one_mul] + have hh := energy_insert_le Z hd.2 hn htR hψ hfLp hfn hfout hi + rw [distantPacket_gradientNorm ht] at hh + linarith + +theorem FormDomain.exists_successor_trial {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) + (hn : normSquared ψ = 1) {ε : ℝ} (hε : 0 < ε) : + ∃ (χ : Wavefunction (n+1)) (h : Gradient (n+1)), + FormDomain χ h ∧ normSquared χ = 1 ∧ energy Z χ h < energy Z ψ g + ε := by + obtain ⟨R, χ, h, _, hχ, hχn, hχe, hχs, hhs⟩ := hd.exists_compact_approximation Z hn + (half_pos hε) + obtain ⟨χ', h', hχ', hχ'n, hχ'e⟩ := hχ.exists_inserted_trial Z hχn hχs hhs (half_pos hε) + exact ⟨χ', h', hχ', hχ'n, by linarith⟩ + +def sectorEnergy (Z n : ℕ) : EReal := + sInf {e : EReal | ∃ (ψ : Wavefunction n) (g : Gradient n), + FormDomain ψ g ∧ normSquared ψ = 1 ∧ e = (energy Z ψ g : EReal)} + +def unrestrictedEnergy (Z : ℕ) : EReal := ⨅ n : ℕ, sectorEnergy Z n + +theorem unrestrictedEnergy_le_sector (Z n : ℕ) : + unrestrictedEnergy Z ≤ sectorEnergy Z n := iInf_le _ n + +theorem sectorEnergy_le_trial {Z n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hψ : FormDomain ψ g) (hn : normSquared ψ = 1) : + sectorEnergy Z n ≤ (energy Z ψ g : EReal) := sInf_le ⟨ψ, g, hψ, hn, rfl⟩ + +theorem sectorEnergy_succ_le (Z n : ℕ) : sectorEnergy Z (n+1) ≤ sectorEnergy Z n := by + apply le_sInf + rintro e ⟨ψ, g, hd, hn, rfl⟩ + by_contra hh + obtain ⟨r, hEr, hrE⟩ := EReal.lt_iff_exists_real_btwn.mp (lt_of_not_ge hh) + have hε : 0 < r-energy Z ψ g := sub_pos.mpr (EReal.coe_lt_coe_iff.mp hEr) + obtain ⟨χ, h, hχ, hχn, hχe⟩ := hd.exists_successor_trial Z hn hε + have hlt : energy Z χ h < r := by linarith + have hle := sectorEnergy_le_trial (Z := Z) hχ hχn + exact (not_lt_of_ge hle) ((EReal.coe_lt_coe_iff.mpr hlt).trans hrE) + +theorem sectorEnergy_antitone (Z : ℕ) : Antitone (sectorEnergy Z) := + antitone_nat_of_succ_le (sectorEnergy_succ_le Z) + +theorem groundState_energy_eq_sector {Z : ℕ} {ψ : Wavefunction Z} + (hψ : IsNormalizedGroundState Z ψ) : + ∃ g : Gradient Z, FormDomain ψ g ∧ normSquared ψ = 1 ∧ + sectorEnergy Z Z = (energy Z ψ g : EReal) := by + obtain ⟨g, hg, hn, hmin⟩ := hψ + refine ⟨g, hg, hn, le_antisymm (sectorEnergy_le_trial hg hn) ?_⟩ + apply le_sInf + rintro e ⟨χ, h, hχ, hχn, rfl⟩ + exact EReal.coe_le_coe_iff.mpr (hmin χ h hχ hχn) + +def vacuumWavefunction : Wavefunction 0 := fun _ _ => 1 + +def vacuumGradient : Gradient 0 := fun _ i => Fin.elim0 i + +theorem vacuum_volume_univ : (volume : Measure (Configuration 0)) Set.univ = 1 := by + rw [volume_pi, Measure.pi_univ] + simp + +theorem vacuum_formDomain : FormDomain vacuumWavefunction vacuumGradient := by + let : IsProbabilityMeasure (volume : Measure (Configuration 0)) := ⟨vacuum_volume_univ⟩ + refine ⟨?_, ?_, ?_, ?_, ?_, ?_⟩ + · intro p σ + have hp : p = 1 := Subsingleton.elim _ _ + simp [vacuumWavefunction, hp] + · intro σ i + exact Fin.elim0 i + · intro σ + exact memLp_const _ + · intro σ i + exact Fin.elim0 i + · intro σ i + exact Fin.elim0 i + · intro σ i + exact Fin.elim0 i + +theorem vacuum_normalized : normSquared vacuumWavefunction = 1 := by + let : IsProbabilityMeasure (volume : Measure (Configuration 0)) := ⟨vacuum_volume_univ⟩ + simp [normSquared, vacuumWavefunction, Spins] + +theorem energy_vacuum_sector (Z : ℕ) (ψ : Wavefunction 0) (g : Gradient 0) : energy Z ψ g = 0 := by + simp [energy, coulombPotential] + +theorem sectorEnergy_vacuum (Z : ℕ) : sectorEnergy Z 0 = 0 := by + apply le_antisymm + · simpa [energy_vacuum_sector] using + sectorEnergy_le_trial (Z := Z) vacuum_formDomain vacuum_normalized + · apply le_sInf + rintro e ⟨ψ, g, _, _, rfl⟩ + simp [energy_vacuum_sector] + +theorem sectorEnergy_nonpos (Z n : ℕ) : sectorEnergy Z n ≤ 0 := by + simpa [sectorEnergy_vacuum] using sectorEnergy_antitone Z (Nat.zero_le n) + +theorem sectorEnergy_finite_of_neutral_groundState {Z : ℕ} {ψ : Wavefunction Z} + (hψ : IsNormalizedGroundState Z ψ) {n : ℕ} (hn : n ≤ Z) : + ∃ e : ℝ, sectorEnergy Z n = (e : EReal) := by + obtain ⟨g, _, _, hg⟩ := groundState_energy_eq_sector hψ + have htop : sectorEnergy Z n ≠ ⊤ := + (lt_of_le_of_lt (sectorEnergy_nonpos Z n) (by simp)).ne + have hbot : sectorEnergy Z n ≠ ⊥ := by + apply (lt_of_lt_of_le (EReal.bot_lt_coe (energy Z ψ g)) ?_).ne' + rw [← hg] + exact sectorEnergy_antitone Z hn + exact ⟨(sectorEnergy Z n).toReal, (EReal.coe_toReal htop hbot).symm⟩ + +def UniformPredecessorOffset : Prop := + ∃ (D : ℝ) (Z₀ : ℕ), 0 ≤ D ∧ ∀ Z : ℕ, Z₀ ≤ Z → 1 ≤ Z → + sectorEnergy Z (Z-1) ≤ unrestrictedEnergy Z+(D : EReal) + +theorem first_ionization_le_of_predecessor_offset {Z : ℕ} {D Eprev Eneutral : ℝ} + (hoff : sectorEnergy Z (Z-1) ≤ unrestrictedEnergy Z+(D : EReal)) + (hp : sectorEnergy Z (Z-1) = (Eprev : EReal)) + (hn : sectorEnergy Z Z = (Eneutral : EReal)) : Eprev-Eneutral ≤ D := by + have hh : (Eprev : EReal) ≤ (Eneutral : EReal)+(D : EReal) := by + calc + (Eprev : EReal) = sectorEnergy Z (Z-1) := hp.symm + _ ≤ unrestrictedEnergy Z+(D : EReal) := hoff + _ ≤ sectorEnergy Z Z+(D : EReal) := + by simpa only [add_comm] using + (add_le_add_right (unrestrictedEnergy_le_sector Z Z) (D : EReal)) + _ = _ := by rw [hn] + rw [← EReal.coe_add, EReal.coe_le_coe_iff] at hh + linarith + +def firstIonization (Z : ℕ) : ℝ := + (sectorEnergy Z (Z-1)).toReal - (sectorEnergy Z Z).toReal + +theorem bounded_firstIonization_of_uniformPredecessorOffset + (hoff : UniformPredecessorOffset) + (ψ : ∀ Z : ℕ, Wavefunction Z) + (hψ : ∀ Z : ℕ, 1 ≤ Z → IsNormalizedGroundState Z (ψ Z)) : + ∃ (D : ℝ) (Z₀ : ℕ), 0 ≤ D ∧ ∀ Z : ℕ, Z₀ ≤ Z → 1 ≤ Z → + 0 ≤ firstIonization Z ∧ firstIonization Z ≤ D := by + obtain ⟨D, Z₀, hD, hbound⟩ := hoff + refine ⟨D, Z₀, hD, ?_⟩ + intro Z hZ hZpos + obtain ⟨Ep, hp⟩ := sectorEnergy_finite_of_neutral_groundState (hψ Z hZpos) (Nat.sub_le Z 1) + obtain ⟨En, hn⟩ := sectorEnergy_finite_of_neutral_groundState (hψ Z hZpos) (le_refl Z) + have hmono : En ≤ Ep := by + apply EReal.coe_le_coe_iff.mp + rw [← hp, ← hn] + exact sectorEnergy_antitone Z (Nat.sub_le Z 1) + have hb := first_ionization_le_of_predecessor_offset (hbound Z hZ hZpos) hp hn + simp only [firstIonization, hp, hn, EReal.toReal_coe] + exact ⟨sub_nonneg.mpr hmono, hb⟩ + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/PatchErrors.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/PatchErrors.lean new file mode 100644 index 0000000000000000000000000000000000000000..dcf1a5414484120108a44334e5d4af91c06f669a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/PatchErrors.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.EnsembleCauchy +import OAI.Analysis.CoulombRadii.Screening.PatchComparison + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped NNReal ENNReal BigOperators Classical +noncomputable section +namespace Coulomb + +def unitWindowKinetic : ℝ := ∑ j : Fin 3, ∫ z : Space, (fderiv ℝ unitWindow z (EuclideanSpace.single j 1))^2 +lemma unitWindowKinetic_nonneg : 0≤unitWindowKinetic := unitWindow_kinetic_nonneg + +lemma patch_packet_bound {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t F : ℝ} (ha : 0 w x*(F x)^2) μ) : Integrable (fun x => w x*F x) μ := by + simpa only [mul_one] using weighted_cap_count_integrable hw hw0 hF hF0 hFi + (aestronglyMeasurable_const (b := (1:ℝ))) zero_le_one (Eventually.of_forall (fun _ => ⟨zero_le_one,le_rfl⟩)) + +lemma slice_ensemble_mean_le_sqrt {P : Type*} [Fintype P] (m k : P → ℕ) + (u : (p : P) → H1Vector (m p+k p)) + (F : (p : P) → Spins (m p) → Configuration (m p) → ℝ) + (hFm : ∀ p s, AEStronglyMeasurable (F p s) volume) + (hF0 : ∀ p s, ∀ᵐ x, 0≤F p s x) + (hFi : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x)^2)) + (hm : (∑ p, mass (u p))=1) : + (∑ p, sliceExpectation (u p) (F p))≤Real.sqrt + (∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2)) := by + have H := slice_ensemble_mul_le_sqrt m k u F (fun _ _ _ => 1) hFi + (fun p s => by simpa only [one_pow,mul_one] using mass_coreSlice_integrable (u p) s) + (fun p s => by + simpa only [mul_one] using (weighted_cap_integrable (mass_coreSlice_integrable (u p) s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hFm p s) (hF0 p s) (hFi p s))) + simpa only [mul_one,one_pow,sliceExpectation_number,one_mul,hm] using H + +lemma ensemble_number_rpow {P : Type*} [Fintype P] (n : P → ℕ) (w : P → ℝ) + (hw : ∀ p, 0≤w p) (hm : ∑ p, w p=1) : + (∑ p, (n p:ℝ)^(4/3:ℝ)*w p) ≤ (∑ p, (n p:ℝ)^2*w p)^(2/3:ℝ) := by + have H := (Real.concaveOn_rpow (by norm_num : (0:ℝ)≤2/3) (by norm_num : (2/3:ℝ)≤1)).le_map_sum + (t := Finset.univ) (w := w) (p := fun p => (n p:ℝ)^2) + (fun p _ => hw p) hm (fun p _ => by change 0 ≤ (n p:ℝ)^2; positivity) + simp only [smul_eq_mul] at H + have he (p : P) : ((n p:ℝ)^2)^(2/3:ℝ)=(n p:ℝ)^(4/3:ℝ) := by + rw [←Real.rpow_natCast,←Real.rpow_mul (Nat.cast_nonneg _)] + congr 1 + norm_num + simp only [he] at H + simpa only [mul_comm] using H + +lemma ensemble_number_mean {P : Type*} [Fintype P] (n : P → ℕ) (w : P → ℝ) + (hw : ∀ p, 0≤w p) (hm : ∑ p, w p=1) : + (∑ p, (n p:ℝ)*w p) ≤ Real.sqrt (∑ p, (n p:ℝ)^2*w p) := by + apply Real.le_sqrt_of_sq_le + have H := Finset.sum_mul_sq_le_sq_mul_sq Finset.univ + (fun p => (n p:ℝ)*Real.sqrt (w p)) (fun p => Real.sqrt (w p)) + simp only [mul_pow,Real.sq_sqrt (hw _)] at H + have he : ∑ p, ↑(n p)*Real.sqrt (w p)*Real.sqrt (w p)=∑ p, ↑(n p)*w p := + Finset.sum_congr rfl (fun p _ => by rw [mul_assoc,←sq,Real.sq_sqrt (hw p)]) + rw [he,hm,mul_one] at H + exact H + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/PhysicalEnsemble.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/PhysicalEnsemble.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f0f3498333aa21c8cff90db10e59b79f2ca3a0c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/PhysicalEnsemble.lean @@ -0,0 +1,156 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.AtomicThinScreening +import OAI.Analysis.CoulombRadii.ThomasFermi.PhysicalCount +import OAI.Analysis.CoulombRadii.FormDomain.PatchErrors +import OAI.Analysis.CoulombRadii.RandomFields.ExactRecordedCount + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace Coulomb + +lemma PartlyAntisymmetric.outer_symmetry {m k : ℕ} {u : H1Vector (m+k)} + (hu : PartlyAntisymmetric u (outIndexSet m k)) + (s : Spins k) (p : Equiv.Perm (Fin m)) (t : Spins m) : + ∀ᵐ z, u.value (outerAppend s t ∘ outerPerm k p) (permute (outerPerm k p) z) = + (((outerPerm k p).sign:ℤ):ℂ)*u.value (outerAppend s t) z := by + apply hu + intro i + refine Fin.addCases (fun j hi => ?_) (fun j _ => ?_) i + · exact False.elim (hi ⟨j,rfl⟩) + · exact outerPerm_right k p j + +lemma patch_packet_expected_bound {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + {a b t : ℝ} (ha : 0 mass (u.coreSlice s x)*(F s x)^2)) + (hcap : ∀ s, ∀ᵐ x, ∀ w∈Metric.ball y (t-4*b), coreScreenedField S (u.coreSlice s x).normalized w≤F s x) : + sliceExpectation u (fun s x => packetKineticError (scaledWindow unitWindow b hb.ne') + (localTFDensity measurableSet_ball (coreTFField S (u.coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht y hn))))≤ + (12*a*unitWindowKinetic/b^2)*sliceExpectation u F := by + unfold sliceExpectation + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + have hTF := coreTF_conditional_integrable measurableSet_ball S u s ha + (patch_nucleus_separation S ha hb ht y hn) (show 0<12*a by positivity) + (patch_diameter ha hb ht y) (F s) (hF0 s) (hFi s) (hcap s) + have hi : Integrable (fun x => mass (u.coreSlice s x)*packetKineticError (scaledWindow unitWindow b hb.ne') + (localTFDensity measurableSet_ball (coreTFField S (u.coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht y hn)))) := by + unfold packetKineticError + convert hTF.1.mul_const ((1/2:ℝ)*(∑ j : Fin 3, ∫ z : Space, + (fderiv ℝ (scaledWindow unitWindow b hb.ne') z (EuclideanSpace.single j 1))^2)) using 1 + funext x + ring + rw [←integral_const_mul] + apply integral_mono_ae hi ((weighted_cap_integrable (mass_coreSlice_integrable u s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hFm s) (hF0 s) (hFi s)).const_mul _) + filter_upwards [hF0 s,hcap s] with x hf hc + simpa only [mul_left_comm (mass _) (12*a*unitWindowKinetic/b^2)] using + mul_le_mul_of_nonneg_left (patch_packet_bound S _ ha hb ht y hn hf hc) (mass_nonneg _) + +lemma ensemble_fineLocalizationError {P : Type*} [Fintype P] (n : P → ℕ) (w : P → ℝ) + (hw : ∀ p, 0≤w p) (hm : ∑ p, w p=1) {b : ℝ} (hb : 0 mass ((T.vector p).coreSlice s x)*(F p s x)^2)) + (hcap : ∀ p s, ∀ᵐ x, ∀ w∈Metric.closedBall y (t+b), coreScreenedField S ((T.vector p).coreSlice s x).normalized w≤F p s x) : + let Q := ∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2) + let N := ∑ p, (T.out p:ℝ)^2*mass (T.vector p) + localCountSecondMoment ψ (Metric.closedBall y a)≤2*(tfInteriorCountConstant/a^3)^2+ + 6*a*(max countTestEnergy 0)*(B+12*a*unitWindowKinetic/b^2*Real.sqrt Q+ + Real.sqrt (Q*T.deletedSquare y t b)+ + (b⁻¹)^2*((Real.pi^2/2)*neumannBoundary)*N^(2/3:ℝ)+ + ((2*Real.pi+1)/(2*b))*Real.sqrt N) := by + dsimp only + let ρ := fun p s x => localTFDensity measurableSet_ball + (coreTFField S ((T.vector p).coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn)) + let G := fun p s x => rawThomasFermiEnergy (coreScreenedField S ((T.vector p).coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy (coreScreenedField S ((T.vector p).coreSlice s x).normalized) (ρ p s x) + have hcs' (p : T.index) (s) : ∀ᵐ x, SpatiallySupported ((T.vector p).coreSlice s x).normalized {z | t≤‖z-y‖} := by + filter_upwards [(hcs p).coreSlice s] with x hx + exact hx.normalized + have hcap' (p : T.index) (s) : ∀ᵐ x, ∀ w∈Metric.ball y (t-4*b), coreScreenedField S ((T.vector p).coreSlice s x).normalized w≤F p s x := by + filter_upwards [hcap p s] with x hx + exact fun w hw => hx w (Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith)) hw) + have hgap (p : T.index) := physical_patch_comparison S (T.vector p) (ho p).outer_symmetry + (fun s => (hc p).coreSlice s) ha hb hsmall ht y hn (hcs' p) (fun s => (hos p).recorded_positions s) + (F p) (hFm p) (hF0 p) (hFi p) (hcap p) hE + have hpacket (p : T.index) := patch_packet_expected_bound S (T.vector p) ha hb ht.2 y hn + (F p) (hFm p) (hF0 p) (hFi p) (hcap' p) + have hmean := slice_ensemble_mean_le_sqrt T.out T.core T.vector F hFm hF0 hFi hm + have hdel := slice_ensemble_mul_le_sqrt T.out T.core T.vector F + (fun _ _ x => localCount {z | t-7*b≤‖z-y‖} x) hFi + (fun p s => sliceCount_weight_integrable (T.vector p) (isClosed_le continuous_const (by fun_prop)).measurableSet s 2) + (fun p s => weighted_cap_count_integrable (mass_coreSlice_integrable (T.vector p) s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hFm p s) (hF0 p s) (hFi p s) + (localCount_measurable (isClosed_le continuous_const (by fun_prop)).measurableSet).aestronglyMeasurable + (Nat.cast_nonneg (T.out p)) (Eventually.of_forall (fun x => ⟨localCount_nonneg _ x,localCount_le _ x⟩))) + have hfine := ensemble_fineLocalizationError T.out (fun p => mass (T.vector p)) (fun p => mass_nonneg _) hm hb + have hsumgap := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hgap p) + have hsumpacket := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hpacket p) + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum] at hsumgap hsumpacket + change (∑ p, sliceExpectation (T.vector p) (G p))≤_ at hsumgap + have hGapBound : (∑ p, sliceExpectation (T.vector p) (G p))≤B+ + 12*a*unitWindowKinetic/b^2*Real.sqrt (∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2))+ + Real.sqrt ((∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2))*T.deletedSquare y t b)+ + (b⁻¹)^2*((Real.pi^2/2)*neumannBoundary)*(∑ p, (T.out p:ℝ)^2*mass (T.vector p))^(2/3:ℝ)+ + ((2*Real.pi+1)/(2*b))*Real.sqrt (∑ p, (T.out p:ℝ)^2*mass (T.vector p)) := by + have hp := mul_le_mul_of_nonneg_left hmean (show 0≤12*a*unitWindowKinetic/b^2 by exact div_nonneg (mul_nonneg (by positivity) unitWindowKinetic_nonneg) (sq_nonneg _)) + change (∑ p, mass (T.vector p))=1 at hm + rw [hm,mul_one] at hsumgap + change (∑ p, form S (T.vector p))≤E+B at henergy + unfold RecordedEnsemble.deletedSquare + linarith + have hAB : Disjoint {z : Space | t≤‖z-y‖} (Metric.closedBall y a) := by + apply Set.disjoint_left.mpr + intro z hz hz' + have hh : ‖z-y‖≤a := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hz' + have hz : t≤‖z-y‖ := hz + linarith [ht.1] + rw [←hC.recorded_secondMoment_eq measurableSet_closedBall hAB hcs] + have hcounts := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => physical_patch_averaged_count S (T.vector p) + ha hb hsmall ht y hn (hcs' p) (F p) (hF0 p) (hFi p) (hcap p)) + simp only [Finset.sum_add_distrib,←Finset.mul_sum] at hcounts + change (∑ p, mass (T.vector p))=1 at hm + rw [hm,mul_one] at hcounts + have hcoef : 0≤6*a*max countTestEnergy 0 := mul_nonneg (mul_nonneg (by norm_num) ha.le) (le_max_right _ _) + exact hcounts.trans (add_le_add le_rfl (mul_le_mul_of_nonneg_left hGapBound hcoef)) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/Pullback.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/Pullback.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0bdef23d63eb63c32b11c12a916475e9468e29e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/Pullback.lean @@ -0,0 +1,305 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +namespace Coulomb + +lemma linear_form_eq_sum {ι : Type*} [Fintype ι] [DecidableEq ι] + (T : EuclideanSpace ℝ ι →L[ℝ] ℝ) (v : EuclideanSpace ℝ ι) : + T v = ∑ a, v a * T (EuclideanSpace.single a 1) := by + conv_lhs => rw [← (EuclideanSpace.basisFun ι ℝ).sum_repr v] + simp only [map_sum, map_smul, EuclideanSpace.basisFun_repr, + EuclideanSpace.basisFun_apply, smul_eq_mul] + +lemma H1Vector.weak_directional {n : ℕ} (ψ : H1Vector n) (s : Spins n) + (v : Configuration n) (φ : Configuration n → ℝ) + (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hcφ : HasCompactSupport φ) : + (∫ x, ψ.value s x * (fderiv ℝ φ x v : ℂ)) = + -(∫ x, (∑ a, (v a : ℂ) * ψ.gradient s a x) * (φ x : ℂ)) := by + have hφL : MemLp (fun x => (φ x : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hcφ.comp_left (by simp)) + have hdφL (a : Fin n × Fin 3) : + MemLp (fun x => (fderiv ℝ φ x (EuclideanSpace.single a 1) : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hcφ.fderiv_apply ℝ _).comp_left (by simp)) + have Hd (x : Configuration n) := linear_form_eq_sum (fderiv ℝ φ x) v + simp_rw [Hd, Complex.ofReal_sum, Complex.ofReal_mul, Finset.mul_sum, + Finset.sum_mul] + have hA (a : Fin n × Fin 3) : Integrable (fun x => ψ.value s x * + ((v a : ℂ) * (fderiv ℝ φ x (EuclideanSpace.single a 1) : ℂ))) := by + simpa only [Pi.mul_apply, mul_left_comm] using ((ψ.value_L2 s).integrable_mul (hdφL a)).const_mul (v a : ℂ) + have hB (a : Fin n × Fin 3) : Integrable (fun x => + ((v a : ℂ) * ψ.gradient s a x) * (φ x : ℂ)) := + by simpa only [Pi.mul_apply, mul_assoc] using ((ψ.partial_L2 s a).integrable_mul hφL).const_mul (v a : ℂ) + rw [integral_finsetSum _ (fun a _ => hA a), integral_finsetSum _ (fun a _ => hB a), + ← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro a _ + simp_rw [mul_left_comm (ψ.value s _) (v a : ℂ), mul_assoc] + rw [integral_const_mul, integral_const_mul, ψ.weak_partial s a φ hφ hcφ] + ring + +lemma H1Vector.weak_partial_isometry {n : ℕ} (ψ : H1Vector n) + (L : Configuration n ≃ₗᵢ[ℝ] Configuration n) (s : Spins n) (a : Fin n × Fin 3) + (φ : Configuration n → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hcφ : HasCompactSupport φ) : + (∫ x, ψ.value s (L x) * (fderiv ℝ φ x (EuclideanSpace.single a 1) : ℂ)) = + -(∫ x, (∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * ψ.gradient s k (L x)) * (φ x : ℂ)) := by + let Φ : Configuration n → ℝ := fun y => φ (L.symm y) + have HΦ : ContDiff ℝ (⊤ : ℕ∞) Φ := hφ.comp L.symm.contDiff + have HC : HasCompactSupport Φ := hcφ.comp_homeomorph L.symm.toHomeomorph + have Hd (y : Configuration n) : fderiv ℝ Φ y (L (EuclideanSpace.single a 1)) = + fderiv ℝ φ (L.symm y) (EuclideanSpace.single a 1) := by + change fderiv ℝ (φ ∘ L.symm) y _ = _ + rw [fderiv_comp y (hφ.differentiable (by simp)).differentiableAt L.symm.differentiableAt] + rw [show fderiv ℝ (⇑L.symm) y = L.symm.toContinuousLinearEquiv.toContinuousLinearMap from + L.symm.toContinuousLinearEquiv.toContinuousLinearMap.fderiv] + simp + have H := ψ.weak_directional s (L (EuclideanSpace.single a 1)) Φ HΦ HC + simp_rw [Hd] at H + have mp : MeasurePreserving L.toHomeomorph.toMeasurableEquiv volume volume := L.measurePreserving + rw [← mp.integral_comp' (fun y => ψ.value s y * + (fderiv ℝ φ (L.symm y) (EuclideanSpace.single a 1) : ℂ)), + ← mp.integral_comp' (fun y => (∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * + ψ.gradient s k y) * (Φ y : ℂ))] at H + simpa [Φ] using H + +noncomputable def H1Vector.pullback {n : ℕ} (ψ : H1Vector n) + (L : Configuration n ≃ₗᵢ[ℝ] Configuration n) : H1Vector n where + value := fun s x => ψ.value s (L x) + gradient := fun s a x => ∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * ψ.gradient s k (L x) + value_L2 := fun s => (ψ.value_L2 s).comp_measurePreserving L.measurePreserving + partial_L2 := fun s _a => memLp_finsetSum _ (fun k _ => + ((ψ.partial_L2 s k).comp_measurePreserving L.measurePreserving).const_mul _) + weak_partial := ψ.weak_partial_isometry L + +lemma isometry_complex_gradient_sq {ι : Type*} [Fintype ι] [DecidableEq ι] + (L : EuclideanSpace ℝ ι ≃ₗᵢ[ℝ] EuclideanSpace ℝ ι) (g : ι → ℂ) : + (∑ a, ‖∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * g k‖^2) = ∑ k, ‖g k‖^2 := by + let u : EuclideanSpace ℝ ι := WithLp.toLp 2 (fun k => (g k).re) + let v : EuclideanSpace ℝ ι := WithLp.toLp 2 (fun k => (g k).im) + let b := (EuclideanSpace.basisFun ι ℝ).map L + have hr (a : ι) : (∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * g k).re = + inner ℝ (b a) u := by + simp [b, u, PiLp.inner_apply, Complex.mul_re, mul_comm] + have hi (a : ι) : (∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * g k).im = + inner ℝ (b a) v := by + simp [b, v, PiLp.inner_apply, Complex.mul_im, mul_comm] + simp_rw [Complex.sq_norm, Complex.normSq_apply, ← pow_two, hr, hi] + rw [Finset.sum_add_distrib, b.sum_sq_inner_right, b.sum_sq_inner_right, + EuclideanSpace.real_norm_sq_eq, EuclideanSpace.real_norm_sq_eq] + simp [u, v, Finset.sum_add_distrib] + +lemma mass_pullback {n : ℕ} (ψ : H1Vector n) + (L : Configuration n ≃ₗᵢ[ℝ] Configuration n) : mass (ψ.pullback L) = mass ψ := by + unfold mass H1Vector.pullback + apply Finset.sum_congr rfl + intro s _ + exact (show MeasurePreserving L.toHomeomorph.toMeasurableEquiv volume volume from + L.measurePreserving).integral_comp' (fun x => ‖ψ.value s x‖^2) + +lemma kinetic_pullback {n : ℕ} (ψ : H1Vector n) + (L : Configuration n ≃ₗᵢ[ℝ] Configuration n) : kinetic (ψ.pullback L) = kinetic ψ := by + unfold kinetic + congr 1 + apply Finset.sum_congr rfl + intro s _ + rw [← integral_finsetSum _ (fun a _ => + ((ψ.pullback L).partial_L2 s a).integrable_norm_pow (p := 2) (by decide)), + ← integral_finsetSum _ (fun a _ => + (ψ.partial_L2 s a).integrable_norm_pow (p := 2) (by decide))] + change (∫ x, ∑ a, ‖∑ k, ((L (EuclideanSpace.single a 1)) k : ℂ) * ψ.gradient s k (L x)‖^2) = _ + simp_rw [isometry_complex_gradient_sq] + exact (show MeasurePreserving L.toHomeomorph.toMeasurableEquiv volume volume from + L.measurePreserving).integral_comp' (fun x => ∑ a, ‖ψ.gradient s a x‖^2) + +noncomputable section +lemma test_L2 {n : ℕ} {φ : Configuration n → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hC : HasCompactSupport φ) : + MemLp (fun x => (φ x : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hC.comp_left Complex.ofReal_zero) + +lemma test_derivative_L2 {n : ℕ} {φ : Configuration n → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hC : HasCompactSupport φ) (a : Configuration n) : + MemLp (fun x => (fderiv ℝ φ x a : ℂ)) 2 volume := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hC.fderiv_apply ℝ a).comp_left Complex.ofReal_zero) + +def H1Vector.scale {n : ℕ} (c : ℂ) (u : H1Vector n) : H1Vector n where + value := fun s x => c*u.value s x + gradient := fun s a x => c*u.gradient s a x + value_L2 := fun s => (u.value_L2 s).const_mul c + partial_L2 := fun s a => (u.partial_L2 s a).const_mul c + weak_partial := by + intro s a φ hφ hC + simp_rw [mul_assoc, integral_const_mul, u.weak_partial s a φ hφ hC] + ring + +def H1Vector.finiteSum {n : ℕ} {ι : Type*} [Fintype ι] (u : ι → H1Vector n) : H1Vector n where + value := fun s x => ∑ i, (u i).value s x + gradient := fun s a x => ∑ i, (u i).gradient s a x + value_L2 := fun s => memLp_finsetSum _ (fun i _ => (u i).value_L2 s) + partial_L2 := fun s a => memLp_finsetSum _ (fun i _ => (u i).partial_L2 s a) + weak_partial := by + intro s a φ hφ hC + simp only [Finset.sum_mul] + rw [integral_finsetSum (f := fun i x => (u i).value s x * + (fderiv ℝ φ x (EuclideanSpace.single a 1) : ℂ)) _ (fun i _ => (u i).value_L2 s |>.integrable_mul + (test_derivative_L2 hφ hC (EuclideanSpace.single a 1))), + integral_finsetSum (f := fun i x => (u i).gradient s a x * (φ x : ℂ)) + _ (fun i _ => (u i).partial_L2 s a |>.integrable_mul + (test_L2 hφ hC))] + simp_rw [H1Vector.weak_partial _ _ _ _ hφ hC] + rw [Finset.sum_neg_distrib] + +def permutationIsometry {n : ℕ} (p : Equiv.Perm (Fin n)) : + Configuration n ≃ₗᵢ[ℝ] Configuration n := + LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ (Equiv.prodCongr p.symm (Equiv.refl _)) + +lemma permutationIsometry_apply {n : ℕ} (p : Equiv.Perm (Fin n)) (x : Configuration n) : + permutationIsometry p x = permute p x := by + ext ⟨i,b⟩ + simp [permutationIsometry, permute, LinearIsometryEquiv.piLpCongrLeft_apply] + +lemma permutationIsometry_single {n : ℕ} (p : Equiv.Perm (Fin n)) (a : Fin n × Fin 3) : + permutationIsometry p (EuclideanSpace.single a 1) = + EuclideanSpace.single (p.symm a.1,a.2) 1 := by + rw [permutationIsometry_apply] + ext ⟨i,b⟩ + simp [permute, PiLp.single_apply, Prod.ext_iff, ← Equiv.eq_symm_apply] + +def H1Vector.permutation {n : ℕ} (u : H1Vector n) (p : Equiv.Perm (Fin n)) : H1Vector n where + value := fun s => (u.pullback (permutationIsometry p)).value (s ∘ p) + gradient := fun s => (u.pullback (permutationIsometry p)).gradient (s ∘ p) + value_L2 := fun s => (u.pullback (permutationIsometry p)).value_L2 (s ∘ p) + partial_L2 := fun s a => (u.pullback (permutationIsometry p)).partial_L2 (s ∘ p) a + weak_partial := fun s a φ hφ hC => + (u.pullback (permutationIsometry p)).weak_partial (s ∘ p) a φ hφ hC + +lemma permutation_value {n : ℕ} (u : H1Vector n) (p : Equiv.Perm (Fin n)) + (s : Spins n) (x : Configuration n) : + (u.permutation p).value s x = u.value (s ∘ p) (permute p x) := by + simp [H1Vector.permutation, H1Vector.pullback, permutationIsometry_apply] + +lemma permutation_gradient {n : ℕ} (u : H1Vector n) (p : Equiv.Perm (Fin n)) + (s : Spins n) (a : Fin n × Fin 3) (x : Configuration n) : + (u.permutation p).gradient s a x = + u.gradient (s ∘ p) (p.symm a.1,a.2) (permute p x) := by + change (∑ k, ((permutationIsometry p (EuclideanSpace.single a 1)) k : ℂ) * + u.gradient (s ∘ p) k (permutationIsometry p x)) = _ + rw [permutationIsometry_single, permutationIsometry_apply] + simp [PiLp.single_apply, apply_ite] + +lemma permute_one {n : ℕ} (x : Configuration n) : permute 1 x = x := by + rfl +lemma permute_mul {n : ℕ} (p q : Equiv.Perm (Fin n)) (x : Configuration n) : + permute q (permute p x) = permute (p*q) x := by + rfl +lemma permute_inv {n : ℕ} (p : Equiv.Perm (Fin n)) (x : Configuration n) : + permute p⁻¹ (permute p x) = x := by + rw [permute_mul, mul_inv_cancel, permute_one] +lemma permute_integral {n : ℕ} (p : Equiv.Perm (Fin n)) (F : Configuration n → ℂ) : + (∫ x, F (permute p x)) = ∫ x, F x := by + have H := (show MeasurePreserving (permutationIsometry p).toHomeomorph.toMeasurableEquiv + volume volume from (permutationIsometry p).measurePreserving).integral_comp' F + exact H + +def permutationSpins {n : ℕ} (p : Equiv.Perm (Fin n)) : Spins n ≃ Spins n := + Equiv.arrowCongr p.symm (Equiv.refl _) +lemma permutationSpins_apply {n : ℕ} (p : Equiv.Perm (Fin n)) (s : Spins n) : + permutationSpins p s = s ∘ p := rfl + +lemma sign_complex_sq {n : ℕ} (p : Equiv.Perm (Fin n)) : + ((p.sign : ℤ) : ℂ)*((p.sign : ℤ) : ℂ) = 1 := by + rcases Int.units_eq_one_or p.sign with h|h <;> simp [h] + +lemma sign_complex_mul {n : ℕ} (p q : Equiv.Perm (Fin n)) : + (((p*q).sign : ℤ) : ℂ) = ((p.sign : ℤ) : ℂ)*((q.sign : ℤ) : ℂ) := by + simp + +def H1Vector.fullAntisymmetrize {n : ℕ} (u : H1Vector n) : H1Vector n := + H1Vector.finiteSum (fun p : Equiv.Perm (Fin n) => + (u.permutation p).scale (((p.sign : ℤ) : ℂ))) + +lemma fullAntisymmetrize_value {n : ℕ} (u : H1Vector n) (s : Spins n) (x : Configuration n) : + u.fullAntisymmetrize.value s x = + ∑ p : Equiv.Perm (Fin n), ((p.sign : ℤ) : ℂ)*u.value (s ∘ p) (permute p x) := by + simp [H1Vector.fullAntisymmetrize, H1Vector.finiteSum, H1Vector.scale, permutation_value] + +lemma fullAntisymmetrize_antisymmetric {n : ℕ} (u : H1Vector n) : + Antisymmetric u.fullAntisymmetrize := by + intro p s + filter_upwards [] with x + rw [fullAntisymmetrize_value, fullAntisymmetrize_value, Finset.mul_sum] + rw [← Equiv.sum_comp (Equiv.mulLeft p⁻¹) + (fun q => ((q.sign : ℤ) : ℂ)*u.value ((s ∘ p) ∘ q) (permute q (permute p x)))] + apply Finset.sum_congr rfl + intro q _ + change (((p⁻¹*q).sign : ℤ) : ℂ)*u.value ((s ∘ p) ∘ ((p⁻¹*q) : Equiv.Perm (Fin n))) + (permute (p⁻¹*q) (permute p x)) = _ + rw [permute_mul, mul_inv_cancel_left] + have hs : (s ∘ p) ∘ ((p⁻¹*q) : Equiv.Perm (Fin n)) = s ∘ q := by + funext i + simp + rw [hs, sign_complex_mul] + simp only [Equiv.Perm.sign_inv] + ring +end +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/RawAnnularMoment.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/RawAnnularMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6d29043f398be4a51d2fb3fad2f1c8c56311253 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/RawAnnularMoment.lean @@ -0,0 +1,62 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalLikelihoodBridge + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom +lemma raw_second_moment_asH1 {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {S : Set Position} (hS : MeasurableSet S) : + (∫ x,(rawCount S x)^2 ∂rawLaw ψ)= + Coulomb.localCountSecondMoment (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) S := by + rw [integral_rawLaw hd.2.2.1,rawExpectation_eq_stateWeightedIntegral hd.2.2.1 + ((measurable_rawCount hS).pow_const 2) (C:=(n:ℝ)^2) (fun x => by + rw [Real.norm_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (rawCount_nonneg S x) (rawCount_le_number S x) 2)] + have H := asH1_potentialForm ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1 + (fun x => (Coulomb.localCount S x)^2) + exact H.symm + +lemma atomic_raw_annular_second_moment {α β : ℝ} (hα : 0<α) (hαβ : α<β) : + ∃ C : ℝ,0≤C ∧ ∀ {n : ℕ} (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n}, + FormDomain ψ g → normSquared ψ=1 → + ∀ {E D : ℝ}, (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g≤E+D → 0≤D → ∀ {r : ℝ},0 rfl) _ (asH1_antisymmetric hd) + ((asH1_mass ..).trans hn) hE _ hD hr + rwa [asH1_energy Z hZ] + +lemma packet_shell_center {g : Position → ℝ} (hg : ∀ x,1<‖x‖ → g x=0) + {c r₀ s r : ℝ} (hc : 0 nlinarith + · have hd := (packetKernel_support g hg hc hr₀ hs z y hK).trans + (packetWidth_le c r₀ s hc.le hr₀ hs z) + rw [max_eq_right (le_of_not_ge hz)] at hd + have hdiff := norm_sub_norm_le y z + have hq' := mul_le_mul_of_nonneg_right hq hr₀.le + constructor <;> nlinarith [norm_nonneg z] +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/RecordReindex.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/RecordReindex.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e34ae48594cd6a5e1e35f21c9aa43773cd585a1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/RecordReindex.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.SortedObservable + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def H1Vector.reindex {m n : ℕ} (u : H1Vector n) (e : Fin m ≃ Fin n) : H1Vector m := by + have h : m=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + exact u.permutation e.symm + +lemma H1Vector.reindex_value {m n : ℕ} (u : H1Vector n) (e : Fin m ≃ Fin n) + (s : Spins m) (x : Configuration m) : + (u.reindex e).value s x=u.value (s ∘ e.symm) (reindexConfiguration e x) := by + have h : m=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + rfl + +lemma mass_reindex {m n : ℕ} (u : H1Vector n) (e : Fin m ≃ Fin n) : + mass (u.reindex e)=mass u := by + have h : m=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + exact mass_permutation _ _ + +lemma form_reindex {J m n : ℕ} (S : Nuclei J) (u : H1Vector n) (e : Fin m ≃ Fin n) : + form S (u.reindex e)=form S u := by + have h : m=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + exact form_permutation _ _ _ + +def recordAssoc (m q k : ℕ) : Fin ((m+q)+k) ≃ Fin (m+(q+k)) := + finSumFinEquiv.symm.trans (((finSumFinEquiv.symm.sumCongr (Equiv.refl _)).trans + (Equiv.sumAssoc (Fin m) (Fin q) (Fin k))).trans + ((Equiv.refl _).sumCongr finSumFinEquiv |>.trans finSumFinEquiv)) + +lemma recordAssoc_left (m q k : ℕ) (i : Fin m) : + recordAssoc m q k (Fin.castAdd k (Fin.castAdd q i))=Fin.castAdd (q+k) i := by + simp only [recordAssoc,Equiv.trans_apply,←finSumFinEquiv_apply_left,Equiv.symm_apply_apply, + Equiv.sumCongr_apply,Sum.map_inl,Equiv.sumAssoc_apply_inl_inl,Equiv.refl_apply] + +lemma recordAssoc_middle (m q k : ℕ) (i : Fin q) : + recordAssoc m q k (Fin.castAdd k (Fin.natAdd m i))=Fin.natAdd m (Fin.castAdd k i) := by + simp only [recordAssoc,Equiv.trans_apply,←finSumFinEquiv_apply_left,←finSumFinEquiv_apply_right, + Equiv.symm_apply_apply,Equiv.sumCongr_apply,Sum.map_inl,Sum.map_inr, + Equiv.sumAssoc_apply_inl_inr] + +lemma recordAssoc_right (m q k : ℕ) (i : Fin k) : + recordAssoc m q k (Fin.natAdd (m+q) i)=Fin.natAdd m (Fin.natAdd q i) := by + simp only [recordAssoc,Equiv.trans_apply,←finSumFinEquiv_apply_right, + Equiv.symm_apply_apply,Equiv.sumCongr_apply,Sum.map_inr, + Equiv.sumAssoc_apply_inr,Equiv.refl_apply] + +lemma append_recordAssoc {m q k : ℕ} (s : Spins m) (t : Spins q) (r : Spins k) : + (Fin.append (Fin.append s t) r) ∘ (recordAssoc m q k).symm=Fin.append s (Fin.append t r) := by + funext i + obtain ⟨j,rfl⟩ := (recordAssoc m q k).surjective i + simp only [Function.comp_apply,Equiv.symm_apply_apply] + refine Fin.addCases (fun l => ?_) (fun l => ?_) j + · refine Fin.addCases (fun l => ?_) (fun l => ?_) l + · simp only [recordAssoc_left,Fin.append_left] + · simp only [recordAssoc_middle,Fin.append_left,Fin.append_right] + · simp only [recordAssoc_right,Fin.append_right] + +lemma reindex_join_recordAssoc {m q k : ℕ} (x : Configuration m) (y : Configuration q) + (z : Configuration k) : + reindexConfiguration (recordAssoc m q k) (joinConfiguration (m+q) k (joinConfiguration m q (x,y),z))= + joinConfiguration m (q+k) (x,joinConfiguration q k (y,z)) := by + ext ⟨i,b⟩ + obtain ⟨j,rfl⟩ := (recordAssoc m q k).surjective i + change joinConfiguration (m+q) k (joinConfiguration m q (x,y),z) + ((recordAssoc m q k).symm (recordAssoc m q k j),b)=_ + rw [Equiv.symm_apply_apply] + refine Fin.addCases (fun l => ?_) (fun l => ?_) j + · refine Fin.addCases (fun l => ?_) (fun l => ?_) l + · rw [recordAssoc_left,joinConfiguration_left,joinConfiguration_left,joinConfiguration_left] + · rw [recordAssoc_middle,joinConfiguration_left,joinConfiguration_right, + joinConfiguration_right,joinConfiguration_left] + · rw [recordAssoc_right,joinConfiguration_right,joinConfiguration_right,joinConfiguration_right] + +lemma reindexConfiguration_continuous {m n : ℕ} (e : Fin m ≃ Fin n) : + Continuous (reindexConfiguration e) := by + have h : m=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + exact (permuteIsometry e.symm).continuous + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/RegularizedHardyField.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/RegularizedHardyField.lean new file mode 100644 index 0000000000000000000000000000000000000000..28c8227e867a503bde691b98046cbf446c37ebc2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/RegularizedHardyField.lean @@ -0,0 +1,460 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +open ContinuousLinearMap +open scoped Convolution + +noncomputable def regularizedHardyField {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (ε : ℝ) (b : Fin 3) (x : Configuration n) : ℝ := + R.coord b x / (blockRadiusSq i R x + ε) + +lemma contDiff_regularizedHardyField {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (b : Fin 3) : + ContDiff ℝ (⊤ : ℕ∞) (regularizedHardyField i R ε b) := by + exact (R.smooth b).div ((contDiff_blockRadiusSq i R).add contDiff_const) + (fun x => ne_of_gt (add_pos_of_nonneg_of_pos (blockRadiusSq_nonneg i R x) hε)) + +lemma fderiv_regularizedHardyField {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (b : Fin 3) (x : Configuration n) : + fderiv ℝ (regularizedHardyField i R ε b) x (EuclideanSpace.single (i,b) 1) = + (blockRadiusSq i R x + ε)⁻¹ - + 2 * (R.coord b x)^2 / (blockRadiusSq i R x + ε)^2 := by + have hd := ((contDiff_blockRadiusSq i R).differentiable (by simp) x).hasFDerivAt.add_const ε + have hne : blockRadiusSq i R x + ε ≠ 0 := + ne_of_gt (add_pos_of_nonneg_of_pos (blockRadiusSq_nonneg i R x) hε) + have hi := (hasFDerivAt_inv hne).comp x hd + have hn := ((R.smooth b).differentiable (by simp) x).hasFDerivAt + have hm := hn.fun_mul hi + change fderiv ℝ (fun y : Configuration n => + R.coord b y * (blockRadiusSq i R y + ε)⁻¹) x _ = _ + simp only [Function.comp_apply] at hm + rw [hm.fderiv] + simp only [add_apply, smul_apply, ContinuousLinearMap.comp_apply, smul_eq_mul, + ContinuousLinearMap.toSpanSingleton_apply] + rw [fderiv_blockRadiusSq, R.directional] + simp only [ite_true, mul_one] + ring + +lemma regularizedHardyField_sq_sum {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (ε : ℝ) (x : Configuration n) : + (∑ b : Fin 3, (regularizedHardyField i R ε b x)^2) = + blockRadiusSq i R x / (blockRadiusSq i R x + ε)^2 := by + simp only [regularizedHardyField, div_pow, ← Finset.sum_div] + rfl + +lemma regularizedHardyField_divergence {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (x : Configuration n) : + (∑ b : Fin 3, fderiv ℝ (regularizedHardyField i R ε b) x + (EuclideanSpace.single (i,b) 1)) = + (blockRadiusSq i R x + 3 * ε) / (blockRadiusSq i R x + ε)^2 := by + simp_rw [fderiv_regularizedHardyField i R hε] + rw [Finset.sum_sub_distrib] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, + ← Finset.sum_div, ← Finset.mul_sum] + change 3 * (blockRadiusSq i R x + ε)⁻¹ - + 2 * blockRadiusSq i R x / (blockRadiusSq i R x + ε)^2 = _ + have hne : blockRadiusSq i R x + ε ≠ 0 := + ne_of_gt (add_pos_of_nonneg_of_pos (blockRadiusSq_nonneg i R x) hε) + field_simp + ring + +lemma regularizedHardyField_weight {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (x : Configuration n) : + (blockRadiusSq i R x + ε)⁻¹ ≤ + 2 * (∑ b : Fin 3, fderiv ℝ (regularizedHardyField i R ε b) x + (EuclideanSpace.single (i,b) 1)) - + ∑ b : Fin 3, (regularizedHardyField i R ε b x)^2 := by + rw [regularizedHardyField_divergence i R hε, regularizedHardyField_sq_sum] + have hpos : 0 < blockRadiusSq i R x + ε := + add_pos_of_nonneg_of_pos (blockRadiusSq_nonneg i R x) hε + apply (mul_le_mul_iff_left₀ (sq_pos_of_pos hpos)).mp + field_simp + nlinarith + +lemma integrable_smooth_mul_compact_deriv {n : ℕ} (u F : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) + (hF : Continuous F) (v : Configuration n) : + Integrable (fun x => F x * fderiv ℝ u x v) := by + exact (hF.mul ((hu.continuous_fderiv (by simp)).clm_apply continuous_const)).integrable_of_hasCompactSupport (huC.fderiv_apply ℝ v).mul_left + +lemma integrable_smooth_deriv_mul_compact {n : ℕ} (u F : Configuration n → ℝ) + (hu : Continuous u) (huC : HasCompactSupport u) + (hF : ContDiff ℝ (⊤ : ℕ∞) F) (v : Configuration n) : + Integrable (fun x => fderiv ℝ F x v * u x) := by + exact (((hF.continuous_fderiv (by simp)).clm_apply continuous_const).mul hu).integrable_of_hasCompactSupport huC.mul_left + +lemma integral_compact_ibp {n : ℕ} (u F : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) + (hF : ContDiff ℝ (⊤ : ℕ∞) F) (v : Configuration n) : + (∫ x, F x * fderiv ℝ u x v) = -(∫ x, fderiv ℝ F x v * u x) := by + apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + · exact integrable_smooth_deriv_mul_compact u F hu.continuous huC hF v + · exact integrable_smooth_mul_compact_deriv u F hu huC hF.continuous v + · exact (hF.continuous.mul hu.continuous).integrable_of_hasCompactSupport huC.mul_left + · intro x _; exact hF.differentiable (by simp) x + · intro x _; exact hu.differentiable (by simp) x + +lemma smooth_square_fderiv {n : ℕ} (u : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (x v : Configuration n) : + fderiv ℝ (fun y => (u y)^2) x v = 2 * u x * fderiv ℝ u x v := by + rw [((hu.differentiable (by simp) x).hasFDerivAt.pow 2).fderiv] + simp only [smul_apply, smul_eq_mul, Nat.reduceSub, pow_one, nsmul_eq_mul, + Nat.cast_ofNat] + +lemma integral_compact_ibp_deriv_form {n : ℕ} (u F : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) + (hF : ContDiff ℝ (⊤ : ℕ∞) F) (v : Configuration n) : + (∫ x, fderiv ℝ F x v * u x + F x * fderiv ℝ u x v) = 0 := by + rw [integral_add + (integrable_smooth_deriv_mul_compact u F hu.continuous huC hF v) + (integrable_smooth_mul_compact_deriv u F hu huC hF.continuous v), + integral_compact_ibp u F hu huC hF v] + exact add_neg_cancel _ + +lemma integral_compact_ibp_square {n : ℕ} (u F : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) + (hF : ContDiff ℝ (⊤ : ℕ∞) F) (v : Configuration n) : + (∫ x, fderiv ℝ F x v * (u x)^2 + 2 * F x * u x * fderiv ℝ u x v) = 0 := by + have hu2 : ContDiff ℝ (⊤ : ℕ∞) (fun x => (u x)^2) := hu.pow 2 + have hu2C : HasCompactSupport (fun x => (u x)^2) := huC.comp_left (g := fun t : ℝ => t^2) (by norm_num) + have heq := integral_compact_ibp_deriv_form (fun x => (u x)^2) F hu2 hu2C hF v + calc + _ = (∫ x, fderiv ℝ F x v * (u x)^2 + F x * fderiv ℝ (fun y => (u y)^2) x v) := by + apply integral_congr_ae + filter_upwards [] with x + rw [smooth_square_fderiv u hu] + ring + _ = 0 := heq + +lemma hardy_pointwise_algebra {ι : Type*} [Fintype ι] + (u w : ℝ) (F D G : ι → ℝ) + (hw : w ≤ 2 * ∑ b, D b - ∑ b, (F b)^2) : + w * u^2 ≤ 4 * ∑ b, (G b)^2 + + 2 * ∑ b, (D b * u^2 + 2 * F b * u * G b) := by + have hs : 0 ≤ ∑ b, (2 * G b + F b * u)^2 := + Finset.sum_nonneg (fun b _ => sq_nonneg _) + have hid : (∑ b, (2 * G b + F b * u)^2) = + 4 * ∑ b, (G b)^2 + 4 * u * ∑ b, F b * G b + + u^2 * ∑ b, (F b)^2 := by + simp only [Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro b _ + ring + have hid2 : (∑ b, (D b * u^2 + 2 * F b * u * G b)) = + u^2 * ∑ b, D b + 2 * u * ∑ b, F b * G b := by + simp only [Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro b _ + ring + have hp := mul_nonneg (sub_nonneg.mpr hw) (sq_nonneg u) + rw [hid] at hs + rw [hid2] + nlinarith + +lemma regularizedHardy_pointwise {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (u : Configuration n → ℝ) (x : Configuration n) : + (blockRadiusSq i R x + ε)⁻¹ * (u x)^2 ≤ + 4 * ∑ b : Fin 3, (fderiv ℝ u x (EuclideanSpace.single (i,b) 1))^2 + + 2 * ∑ b : Fin 3, + (fderiv ℝ (regularizedHardyField i R ε b) x (EuclideanSpace.single (i,b) 1) * + (u x)^2 + 2 * regularizedHardyField i R ε b x * u x * + fderiv ℝ u x (EuclideanSpace.single (i,b) 1)) := + hardy_pointwise_algebra (u x) (blockRadiusSq i R x + ε)⁻¹ + (fun b => regularizedHardyField i R ε b x) + (fun b => fderiv ℝ (regularizedHardyField i R ε b) x (EuclideanSpace.single (i,b) 1)) + (fun b => fderiv ℝ u x (EuclideanSpace.single (i,b) 1)) + (regularizedHardyField_weight i R hε x) + +lemma integrable_compact_deriv_sq {n : ℕ} (u : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) (v : Configuration n) : + Integrable (fun x => (fderiv ℝ u x v)^2) := by + have hc : Continuous (fun x => fderiv ℝ u x v) := + (hu.continuous_fderiv (by simp)).clm_apply continuous_const + have hs : HasCompactSupport (fun x => fderiv ℝ u x v) := huC.fderiv_apply ℝ v + have hs2 : HasCompactSupport (fun x => (fderiv ℝ u x v)^2) := + hs.comp_left (g := fun t : ℝ => t^2) (by norm_num) + exact (hc.pow 2).integrable_of_hasCompactSupport hs2 + +lemma integrable_compact_ibp_square {n : ℕ} (u F : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) + (hF : ContDiff ℝ (⊤ : ℕ∞) F) (v : Configuration n) : + Integrable (fun x => fderiv ℝ F x v * (u x)^2 + + 2 * F x * u x * fderiv ℝ u x v) := by + have hu2C : HasCompactSupport (fun x => (u x)^2) := + huC.comp_left (g := fun t : ℝ => t^2) (by norm_num) + have h1 := integrable_smooth_deriv_mul_compact (fun x => (u x)^2) + F (hu.pow 2).continuous hu2C hF v + have h2 := integrable_smooth_mul_compact_deriv u (fun x => 2 * F x * u x) + hu huC ((continuous_const.mul hF.continuous).mul hu.continuous) v + exact h1.add h2 + +lemma integral_hardy_algebra {X ι : Type*} [MeasurableSpace X] [Fintype ι] + (μ : Measure X) (W : X → ℝ) (G D : ι → X → ℝ) + (hW : Integrable W μ) (hG : ∀ b, Integrable (G b) μ) + (hD : ∀ b, Integrable (D b) μ) (hD0 : ∀ b, (∫ x, D b x ∂μ) = 0) + (hle : ∀ x, W x ≤ 4 * ∑ b, G b x + 2 * ∑ b, D b x) : + (∫ x, W x ∂μ) ≤ 4 * ∑ b, ∫ x, G b x ∂μ := by + have hGs : Integrable (fun x => ∑ b, G b x) μ := + integrable_finsetSum _ (fun b _ => hG b) + have hDs : Integrable (fun x => ∑ b, D b x) μ := + integrable_finsetSum _ (fun b _ => hD b) + have h := integral_mono hW ((hGs.const_mul 4).add (hDs.const_mul 2)) hle + simp only [Pi.add_apply] at h + rw [integral_add (hGs.const_mul 4) (hDs.const_mul 2), + integral_const_mul, integral_const_mul, + integral_finsetSum _ (fun b _ => hG b), + integral_finsetSum _ (fun b _ => hD b)] at h + simpa only [hD0, Finset.sum_const_zero, mul_zero, add_zero] using h + +lemma integrable_compact_regularized_weight {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (u : Configuration n → ℝ) + (hu : Continuous u) (huC : HasCompactSupport u) : + Integrable (fun x => (blockRadiusSq i R x + ε)⁻¹ * (u x)^2) := by + have hwcont : Continuous (fun x => (blockRadiusSq i R x + ε)⁻¹) := + ((contDiff_blockRadiusSq i R).continuous.add continuous_const).inv₀ + (fun x => ne_of_gt (add_pos_of_nonneg_of_pos (blockRadiusSq_nonneg i R x) hε)) + have hs : HasCompactSupport (fun x => (u x)^2) := + huC.comp_left (g := fun t : ℝ => t^2) (by norm_num) + exact (hwcont.mul (hu.pow 2)).integrable_of_hasCompactSupport hs.mul_left + +lemma smooth_compact_regularized_hardy {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + {ε : ℝ} (hε : 0 < ε) (u : Configuration n → ℝ) + (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) : + (∫ x, (blockRadiusSq i R x + ε)⁻¹ * (u x)^2) ≤ + 4 * ∑ b : Fin 3, ∫ x, (fderiv ℝ u x (EuclideanSpace.single (i,b) 1))^2 := by + let G : Fin 3 → Configuration n → ℝ := fun b x => + (fderiv ℝ u x (EuclideanSpace.single (i,b) 1))^2 + let D : Fin 3 → Configuration n → ℝ := fun b x => + fderiv ℝ (regularizedHardyField i R ε b) x (EuclideanSpace.single (i,b) 1) * + (u x)^2 + 2 * regularizedHardyField i R ε b x * u x * + fderiv ℝ u x (EuclideanSpace.single (i,b) 1) + have hG : ∀ b, Integrable (G b) := fun b => integrable_compact_deriv_sq u hu huC + (EuclideanSpace.single (i,b) 1) + have hD : ∀ b, Integrable (D b) := fun b => integrable_compact_ibp_square u + (regularizedHardyField i R ε b) hu huC (contDiff_regularizedHardyField i R hε b) + (EuclideanSpace.single (i,b) 1) + have hD0 : ∀ b, (∫ x, D b x) = 0 := fun b => integral_compact_ibp_square u + (regularizedHardyField i R ε b) hu huC (contDiff_regularizedHardyField i R hε b) + (EuclideanSpace.single (i,b) 1) + exact integral_hardy_algebra volume + (fun x => (blockRadiusSq i R x + ε)⁻¹ * (u x)^2) G D + (integrable_compact_regularized_weight i R hε u hu.continuous huC) + hG hD hD0 (regularizedHardy_pointwise i R hε u) + +lemma nonneg_fatou_integrable {X : Type*} [MeasurableSpace X] + (μ : Measure X) (f : X → ℝ) (F : ℕ → X → ℝ) (C : ℝ) + (hF : ∀ n, Integrable (F n) μ) (hn : ∀ n x, 0 ≤ F n x) + (hf : ∀ x, 0 ≤ f x) + (ht : ∀ x, Filter.Tendsto (fun n => F n x) Filter.atTop (nhds (f x))) + (hC : ∀ n, (∫ x, F n x ∂μ) ≤ C) : + Integrable f μ ∧ (∫ x, f x ∂μ) ≤ C := by + have hfm : AEStronglyMeasurable f μ := + aestronglyMeasurable_of_tendsto_ae _ (fun n => (hF n).aestronglyMeasurable) + (Filter.Eventually.of_forall ht) + have hb : (∫⁻ x, ENNReal.ofReal (f x) ∂μ) ≤ ENNReal.ofReal C := by + calc + _ = ∫⁻ x, Filter.liminf (fun n => ENNReal.ofReal (F n x)) Filter.atTop ∂μ := by + apply lintegral_congr + intro x + exact ((ENNReal.continuous_ofReal.tendsto _).comp (ht x)).liminf_eq.symm + _ ≤ Filter.liminf (fun n => ∫⁻ x, ENNReal.ofReal (F n x) ∂μ) Filter.atTop := + lintegral_liminf_le' (fun n => (hF n).aestronglyMeasurable.aemeasurable.ennreal_ofReal) + _ ≤ ENNReal.ofReal C := by + apply Filter.liminf_le_of_frequently_le (hu_le := Filter.isBoundedUnder_of ⟨0, fun _ => bot_le⟩) + apply Filter.Eventually.frequently + apply Filter.Eventually.of_forall + intro n + rw [← ofReal_integral_eq_lintegral_ofReal (hF n) (Filter.Eventually.of_forall (hn n))] + exact ENNReal.ofReal_le_ofReal (hC n) + have hfinite : Integrable f μ := ⟨hfm, + (hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall hf)).2 + (lt_of_le_of_lt hb ENNReal.ofReal_lt_top)⟩ + refine ⟨hfinite, ?_⟩ + have hCn : 0 ≤ C := (integral_nonneg (hn 0)).trans (hC 0) + rw [← ofReal_integral_eq_lintegral_ofReal hfinite (Filter.Eventually.of_forall hf)] at hb + exact (ENNReal.ofReal_le_ofReal_iff hCn).1 hb + +lemma smooth_compact_hardy {n : ℕ} (i : Fin n) (R : HardyCoordinates n i) + (u : Configuration n → ℝ) (hu : ContDiff ℝ (⊤ : ℕ∞) u) (huC : HasCompactSupport u) : + Integrable (fun x => (blockRadiusSq i R x)⁻¹ * (u x)^2) ∧ + (∫ x, (blockRadiusSq i R x)⁻¹ * (u x)^2) ≤ + 4 * ∑ b : Fin 3, ∫ x, (fderiv ℝ u x (EuclideanSpace.single (i,b) 1))^2 := by + let eps : ℕ → ℝ := fun k => 1 / ((k : ℝ) + 1) + have heps : ∀ k, 0 < eps k := fun k => one_div_pos.mpr (by positivity) + let A := {x : Configuration n | blockRadiusSq i R x ≠ 0} + have hA : MeasurableSet A := + ((contDiff_blockRadiusSq i R).continuous.measurable (measurableSet_singleton 0)).compl + let F : ℕ → Configuration n → ℝ := fun k => + A.indicator (fun x => (blockRadiusSq i R x + eps k)⁻¹ * (u x)^2) + have hF : ∀ k, Integrable (F k) := fun k => + (integrable_compact_regularized_weight i R (heps k) u hu.continuous huC).indicator hA + have hFn : ∀ k x, 0 ≤ F k x := by + intro k x + exact Set.indicator_nonneg (fun x _ => + mul_nonneg (inv_nonneg.mpr (add_nonneg (blockRadiusSq_nonneg i R x) (heps k).le)) + (sq_nonneg (u x))) x + have ht : ∀ x, Filter.Tendsto (fun k => F k x) Filter.atTop + (nhds ((blockRadiusSq i R x)⁻¹ * (u x)^2)) := by + intro x + by_cases hx : x ∈ A + · simp only [F, Set.indicator_of_mem hx] + have ht0 : Filter.Tendsto eps Filter.atTop (nhds 0) := + tendsto_one_div_add_atTop_nhds_zero_nat + have htt := (Filter.Tendsto.const_add (blockRadiusSq i R x) ht0).inv₀ (by simpa only [A, Set.mem_ofPred_eq, add_zero] using hx) + simpa only [add_zero] using htt.mul_const ((u x)^2) + · have hx0 : blockRadiusSq i R x = 0 := by simpa only [A, Set.mem_ofPred_eq, not_not] using hx + simp only [F, Set.indicator_of_notMem hx, hx0, inv_zero, zero_mul] + exact tendsto_const_nhds + apply nonneg_fatou_integrable volume _ F _ hF hFn + (fun x => mul_nonneg (inv_nonneg.mpr (blockRadiusSq_nonneg i R x)) (sq_nonneg (u x))) ht + intro k + calc + (∫ x, F k x) ≤ ∫ x, (blockRadiusSq i R x + eps k)⁻¹ * (u x)^2 := by + apply integral_mono (hF k) + (integrable_compact_regularized_weight i R (heps k) u hu.continuous huC) + intro x + exact Set.indicator_le_self' (fun x _ => + mul_nonneg (inv_nonneg.mpr (add_nonneg (blockRadiusSq_nonneg i R x) (heps k).le)) + (sq_nonneg (u x))) x + _ ≤ _ := smooth_compact_regularized_hardy i R (heps k) u hu huC + +lemma convolution_sq_le {n : ℕ} (κ u : Configuration n → ℝ) + (hκ : Continuous κ) (hκC : HasCompactSupport κ) + (hκn : ∀ x, 0 ≤ κ x) (hκI : (∫ x, κ x) = 1) + (hu : LocallyIntegrable u) (hu2 : Integrable (fun x => (u x)^2)) + (x : Configuration n) : + ((κ ⋆ u) x)^2 ≤ (κ ⋆ (fun x => (u x)^2)) x := by + have h1 : Integrable (fun y => κ (x-y) * u y) := by + simpa only [ConvolutionExistsAt, lsmul_apply, smul_eq_mul, mul_comm] using + hκC.convolutionExists_right (lsmul ℝ ℝ) hu hκ x + have h2 : Integrable (fun y => κ (x-y) * (u y)^2) := by + simpa only [ConvolutionExistsAt, lsmul_apply, smul_eq_mul, mul_comm] using + hκC.convolutionExists_right (lsmul ℝ ℝ) hu2.locallyIntegrable hκ x + have h0 : Integrable (fun y => κ (x-y)) := + (hκ.integrable_of_hasCompactSupport hκC).comp_sub_left x + have heq : (∫ y, κ (x-y) * u y) = (κ ⋆ u) x := by + rw [convolution_eq_swap] + rfl + have heq0 : (∫ y, κ (x-y)) = 1 := by + rw [integral_sub_left_eq_self, hκI] + have hm : (∫ y, (2 * (κ ⋆ u) x) * (κ (x-y) * u y) - + ((κ ⋆ u) x)^2 * κ (x-y)) ≤ ∫ y, κ (x-y) * (u y)^2 := by + apply integral_mono ((h1.const_mul _).sub (h0.const_mul _)) h2 + intro y + simp only [Pi.sub_apply] + nlinarith [mul_nonneg (hκn (x-y)) (sq_nonneg (u y - (κ ⋆ u) x))] + rw [integral_sub (h1.const_mul _) (h0.const_mul _), integral_const_mul, + integral_const_mul, heq, heq0] at hm + have heq2 : (κ ⋆ (fun x => (u x)^2)) x = ∫ y, κ (x-y) * (u y)^2 := by + rw [convolution_eq_swap] + rfl + rw [heq2] + nlinarith + +lemma convolution_sq_integral_le {n : ℕ} (κ u : Configuration n → ℝ) + (hκ : Continuous κ) (hκC : HasCompactSupport κ) + (hκn : ∀ x, 0 ≤ κ x) (hκI : (∫ x, κ x) = 1) + (hu : LocallyIntegrable u) (hu2 : Integrable (fun x => (u x)^2)) : + Integrable (fun x => ((κ ⋆ u) x)^2) ∧ + (∫ x, ((κ ⋆ u) x)^2) ≤ ∫ x, (u x)^2 := by + have hdom : Integrable (κ ⋆ (fun x => (u x)^2)) := + (hκ.integrable_of_hasCompactSupport hκC).integrable_convolution (lsmul ℝ ℝ) hu2 + have hcont : Continuous (κ ⋆ u) := + hκC.continuous_convolution_left (lsmul ℝ ℝ) hκ hu + have hsq : Integrable (fun x => ((κ ⋆ u) x)^2) := by + apply hdom.mono' (hcont.pow 2).aestronglyMeasurable + apply Filter.Eventually.of_forall + intro x + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + exact convolution_sq_le κ u hκ hκC hκn hκI hu hu2 x + refine ⟨hsq, ?_⟩ + calc + _ ≤ ∫ x, (κ ⋆ (fun x => (u x)^2)) x := + integral_mono hsq hdom (convolution_sq_le κ u hκ hκC hκn hκI hu hu2) + _ = _ := by + rw [integral_convolution (lsmul ℝ ℝ) + (hκ.integrable_of_hasCompactSupport hκC) hu2, hκI] + simp + +lemma real_convolution_comm {n : ℕ} (u κ : Configuration n → ℝ) : + u ⋆ κ = κ ⋆ u := by + ext x + rw [convolution_eq_swap, convolution_def] + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun y => mul_comm _ _) + +lemma fderiv_const_sub_comp {n : ℕ} (κ : Configuration n → ℝ) + (hκ : ContDiff ℝ (⊤ : ℕ∞) κ) (x y v : Configuration n) : + fderiv ℝ (fun z => κ (x - z)) y v = -(fderiv ℝ κ (x-y) v) := by + have hd := ((hκ.differentiable (by simp) (x-y)).hasFDerivAt).comp y + ((hasFDerivAt_id y).const_sub x) + change HasFDerivAt (fun z => κ (x-z)) _ y at hd + rw [hd.fderiv] + simp + +lemma weak_convolution_partial {n : ℕ} (u g κ : Configuration n → ℝ) + (v : Configuration n) (hu : LocallyIntegrable u) + (hκ : ContDiff ℝ (⊤ : ℕ∞) κ) (hκC : HasCompactSupport κ) + (hw : ∀ φ : Configuration n → ℝ, ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x, u x * fderiv ℝ φ x v) = -(∫ x, g x * φ x)) + (x : Configuration n) : + fderiv ℝ (κ ⋆ u) x v = (κ ⋆ g) x := by + have hφ : ContDiff ℝ (⊤ : ℕ∞) (fun y => κ (x-y)) := + hκ.comp (contDiff_const.sub contDiff_id) + have hφC : HasCompactSupport (fun y => κ (x-y)) := + hκC.comp_homeomorph (Homeomorph.subLeft x) + have ht := hw (fun y => κ (x-y)) hφ hφC + simp_rw [fderiv_const_sub_comp κ hκ x] at ht + simp only [mul_neg, integral_neg, neg_inj] at ht + rw [real_convolution_comm κ u, + (hκC.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hu (hκ.of_le (by simp)) x).fderiv, + convolution_precompR_apply (lsmul ℝ ℝ) hu (hκC.fderiv ℝ) + (hκ.continuous_fderiv (by simp)) x v] + rw [real_convolution_comm κ g] + simpa only [convolution_def, lsmul_apply, smul_eq_mul] using ht + +lemma ae_nonneg_fatou_integrable {X : Type*} [MeasurableSpace X] + (μ : Measure X) (f : X → ℝ) (F : ℕ → X → ℝ) (C : ℝ) + (hF : ∀ n, Integrable (F n) μ) (hn : ∀ n x, 0 ≤ F n x) + (hf : ∀ x, 0 ≤ f x) + (ht : ∀ᵐ x ∂μ, Filter.Tendsto (fun n => F n x) Filter.atTop (nhds (f x))) + (hC : ∀ n, (∫ x, F n x ∂μ) ≤ C) : + Integrable f μ ∧ (∫ x, f x ∂μ) ≤ C := by + have hfm : AEStronglyMeasurable f μ := + aestronglyMeasurable_of_tendsto_ae _ (fun n => (hF n).aestronglyMeasurable) + ht + have hb : (∫⁻ x, ENNReal.ofReal (f x) ∂μ) ≤ ENNReal.ofReal C := by + calc + _ = ∫⁻ x, Filter.liminf (fun n => ENNReal.ofReal (F n x)) Filter.atTop ∂μ := by + apply lintegral_congr_ae + filter_upwards [ht] with x hx + exact ((ENNReal.continuous_ofReal.tendsto _).comp hx).liminf_eq.symm + _ ≤ Filter.liminf (fun n => ∫⁻ x, ENNReal.ofReal (F n x) ∂μ) Filter.atTop := + lintegral_liminf_le' (fun n => (hF n).aestronglyMeasurable.aemeasurable.ennreal_ofReal) + _ ≤ ENNReal.ofReal C := by + apply Filter.liminf_le_of_frequently_le (hu_le := Filter.isBoundedUnder_of ⟨0, fun _ => bot_le⟩) + apply Filter.Eventually.frequently + apply Filter.Eventually.of_forall + intro n + rw [← ofReal_integral_eq_lintegral_ofReal (hF n) (Filter.Eventually.of_forall (hn n))] + exact ENNReal.ofReal_le_ofReal (hC n) + have hfinite : Integrable f μ := ⟨hfm, + (hasFiniteIntegral_iff_ofReal (Filter.Eventually.of_forall hf)).2 + (lt_of_le_of_lt hb ENNReal.ofReal_lt_top)⟩ + refine ⟨hfinite, ?_⟩ + have hCn : 0 ≤ C := (integral_nonneg (hn 0)).trans (hC 0) + rw [← ofReal_integral_eq_lintegral_ofReal hfinite (Filter.Eventually.of_forall hf)] at hb + exact (ENNReal.ofReal_le_ofReal_iff hCn).1 hb + +end Coulomb +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/RegularizedKinetic.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/RegularizedKinetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f1b091af3ce4d9b7010ef0612bb0b9a5efb2f85 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/RegularizedKinetic.lean @@ -0,0 +1,88 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.H1Pairing +import OAI.Analysis.CoulombRadii.FieldAnalysis.BodyCoefficient + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace Coulomb +lemma regularizedU_second {l:ℝ} (hl:l≠0) (e:ℝ) (a b:Fin 3) (x:Space): + fderiv ℝ (fun y => fderiv ℝ (regularizedU l e) y (EuclideanSpace.single a 1)) x + (EuclideanSpace.single b 1)=NeutralAtom.dirPartial + (NeutralAtom.dirPartial (NeutralAtom.regularizedKernel l) (NeutralAtom.axis a)) + (NeutralAtom.axis b) x := by + simp_rw [regularizedU_partial hl] + rfl +lemma regularizedU_second_le {l:ℝ} (hl:l≠0) (e:ℝ) (a b:Fin 3) (x:Space): + |fderiv ℝ (fun y => fderiv ℝ (regularizedU l e) y (EuclideanSpace.single a 1)) x + (EuclideanSpace.single b 1)|≤4*(l^2)^(-3/2:ℝ) := by + rw [regularizedU_second hl] + exact NeutralAtom.regularizedSecond_uniform_bound hl x a b +lemma regularizedU_lap {l:ℝ} (hl:l≠0) (e:ℝ) (x:Space): + (∑ a:Fin 3,fderiv ℝ (fun y => fderiv ℝ (regularizedU l e) y (EuclideanSpace.single a 1)) x + (EuclideanSpace.single a 1))≤0 := by + simp_rw [regularizedU_second hl] + rw [←NeutralAtom.coordinateLaplacian_eq_partials + ((NeutralAtom.contDiff_regularizedKernel hl).of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt, + NeutralAtom.laplacian_regularizedKernel hl] + unfold NeutralAtom.regularizedCharge + apply neg_nonpos.mpr + positivity + +def regularizedUCoefficient (l e:ℝ) (hl:l≠0):SmoothBoundedCoefficient where + value:=regularizedU l e + smooth:=regularizedU_smooth hl e + bound:=(l^2)^(-1/2:ℝ)+|e| + derivBound:=(l^2)^(-1/2:ℝ)+(l^2)^(-3/2:ℝ) + bound_nonneg:=by positivity + derivBound_nonneg:=by positivity + value_le x:= (abs_add_le _ _).trans (add_le_add (NeutralAtom.regularizedKernel_uniform_bound hl x) le_rfl) + deriv_le a x:=by rw [regularizedU_partial hl]; exact NeutralAtom.regularizedPartial_uniform_bound hl x a + +def firstCoordinateBlock (k:ℕ):Finset (Fin (1+k) × Fin 3):= + Finset.univ.map ⟨fun a => (0,a),fun _ _ h => Prod.mk.inj h |>.2⟩ +lemma regularized_weight_kinetic {k:ℕ} (u:H1Vector (1+k)) (s:Spins (1+k)) + (l e:ℝ) (hl:l≠0) (he:0 w.value (position x 0)) (w.lift_smooth 0) w.bound w.derivBound + (fun x => w.value_le (position x 0)) (w.lift_deriv_le 0) + 0≤∑ a:Fin 3,∫ x,inner ℝ (u.gradient s (0,a) x) (v.gradient s (0,a) x) := by + let U:=regularizedUCoefficient l e hl + let w:=reciprocalCoefficient l e hl he + have hDD:∀ a b (x:Configuration (1+k)), + |fderiv ℝ (fun y => fderiv ℝ (fun z => U.value (position z 0)) y (EuclideanSpace.single a 1)) + x (EuclideanSpace.single b 1)|≤4*(l^2)^(-3/2:ℝ) := by + rintro ⟨j,a⟩ ⟨i,b⟩ x + rw [oneBody_second_derivative U.value U.smooth] + split_ifs + · simpa only [U,regularizedUCoefficient] using regularizedU_second_le hl e a b (position x 0) + · simp only [abs_zero] + positivity + have hLap:∀ x:Configuration (1+k), + (∑ a∈firstCoordinateBlock k,fderiv ℝ (fun y => fderiv ℝ (fun z => U.value (position z 0)) y + (EuclideanSpace.single a 1)) x (EuclideanSpace.single a 1))≤0 := by + intro x + simp only [firstCoordinateBlock,Finset.sum_map] + change (∑ a:Fin 3,fderiv ℝ (fun y => fderiv ℝ (fun z => U.value (position z 0)) y + (EuclideanSpace.single (0,a) 1)) x (EuclideanSpace.single (0,a) 1))≤0 + simp_rw [oneBody_second_derivative U.value U.smooth] + simp only [and_self,ite_true] + simpa only [U,regularizedUCoefficient] using regularizedU_lap hl e (position x 0) + have H:=reciprocal_kinetic_nonneg u s (firstCoordinateBlock k) + (fun x => U.value (position x 0)) (fun x => w.value (position x 0)) + (U.lift_smooth 0) (w.lift_smooth 0) U.bound U.derivBound w.derivBound w.bound (4*(l^2)^(-3/2:ℝ)) + (fun x => U.value_le (position x 0)) (U.lift_deriv_le 0) + (fun x => w.value_le (position x 0)) (w.lift_deriv_le 0) hDD + (fun x => by exact (regularizedU_pos (l:=l) he (position x 0)).le) + (fun x => by exact mul_inv_cancel₀ (regularizedU_pos (l:=l) he (position x 0)).ne') hLap + simp only [firstCoordinateBlock,Finset.sum_map] at H + exact H +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/RetainedPotentialMean.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/RetainedPotentialMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c99df4c52405f3a8e1e754655dd64d95a0a1732 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/RetainedPotentialMean.lean @@ -0,0 +1,142 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.OriginalPotentialTower +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalRetainedLikelihood + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +lemma fromH1_raw_bounded_integral {n : ℕ} (u : Coulomb.H1Vector n) + {F : Configuration n → ℝ} (hF : Measurable F) {C : ℝ} (hC : ∀ x, ‖F x‖≤C) : + (∫ x,F x ∂rawLaw (fromH1Wave u))= + Coulomb.potentialForm (fun x => F ((flattenConfiguration n).symm x)) u := by + have hu (σ : Spins n) : MemLp (fromH1Wave u σ) 2 volume := + (u.value_L2 σ).comp_measurePreserving (flattenConfiguration_measurePreserving n) + rw [integral_rawLaw hu,rawExpectation_eq_stateWeightedIntegral hu hF hC] + unfold stateWeightedIntegral Coulomb.potentialForm + apply Finset.sum_congr rfl + intro σ _ + have H := (flattenConfiguration_measurePreserving n).integral_comp' + (fun x => F ((flattenConfiguration n).symm x)*‖u.value σ x‖^2) + change (∫ x : Configuration n, F ((flattenConfiguration n).symm (flattenConfiguration n x))* + ‖fromH1Wave u σ x‖^2)=_ at H + simpa only [ContinuousLinearEquiv.symm_apply_apply] using H + +theorem retainedEvent_potential_mean {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (r : Fin J → ℝ) (hr : ∀ k, 0 (r k.val)^(101/100:ℝ)) (retainedTailObservation j ⁻¹' B)))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood + (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ)) (retainedTailObservation j ⁻¹' B) x* + F (flattenConfiguration n x))) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r₀ s : ℝ} (hc : 0 potentialOf (conditionalPacketDensity P raw obs g c r₀ s (obs sample)) y) P := + (integrable_condExp (f:=fun sample => potentialOf (rawPacketDensity g c r₀ s (raw sample)) y)).congr + (conditionalPacketPotential_eq_condExp P ν hraw hobs hg hgs hm hc hr hs y).symm + +lemma normalized_event_const_sub {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} + [IsFiniteMeasure P] {A : Set Ω} {f : Ω → ℝ} (hi : Integrable f P) + (hp : 0 (r k.val)^(101/100:ℝ)) (retainedTailObservation j ⁻¹' B)))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood + (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ)) (retainedTailObservation j ⁻¹' B) x* + F (flattenConfiguration n x))) + (hp : 0<(observationLaw J (rawLaw ψ)).real (tailObservation r j ⁻¹' B)) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r₀ s : ℝ} (hc : 0 inner ℝ ξ a).HasTemperateGrowth := by fun_prop + rw [SchwartzMap.fourier_lineDerivOp_eq] + simp only [smul_apply, SchwartzMap.smulLeftCLM_apply_apply ht] + change ‖(2 * Real.pi * Complex.I) * ((inner ℝ ξ a : ℂ) * (𝓕 g : 𝓢(Space,ℂ)) ξ)‖^2 = _ + rw [← mul_assoc] + exact fourierMultiplier_norm_sq _ _ + +lemma schwartz_fourier_weighted_integrable (g : 𝓢(Space,ℂ)) (a : Space) : + Integrable (fun ξ : Space => (2*Real.pi*inner ℝ ξ a)^2 * ‖(𝓕 g : 𝓢(Space,ℂ)) ξ‖^2) := by + simp_rw [← schwartz_fourier_derivative_norm] + exact ((𝓕 (∂_{a} g) : 𝓢(Space,ℂ)).memLp 2 volume).integrable_norm_pow (by norm_num) + +lemma schwartz_fourier_weighted_integral (g : 𝓢(Space,ℂ)) (a : Space) : + (∫ ξ : Space, (2*Real.pi*inner ℝ ξ a)^2 * ‖(𝓕 g : 𝓢(Space,ℂ)) ξ‖^2) = + ∫ x : Space, ‖fderiv ℝ g x a‖^2 := by + simp_rw [← schwartz_fourier_derivative_norm] + rw [← schwartz_toL2_norm_sq, SchwartzMap.norm_fourier_toL2_eq, schwartz_toL2_norm_sq] + simp only [SchwartzMap.lineDerivOp_apply_eq_fderiv] + +lemma packetState_fourier_apply (g : 𝓢(Space,ℂ)) (y p ξ : Space) : + (𝓕 (packetState g y p) : 𝓢(Space,ℂ)) ξ = + Complex.exp ((-2*Real.pi*inner ℝ y (ξ-p) : ℝ)*Complex.I) * (𝓕 g : 𝓢(Space,ℂ)) (ξ-p) := by + rw [packetState, FourierTransform.fourier_fourierInv_eq] + change (𝓕 (SchwartzMap.compSubConstCLM ℂ y g) : 𝓢(Space,ℂ)) (ξ-p) = _ + have ht := congrFun (VectorFourier.fourierIntegral_comp_add_right + Real.fourierChar volume (innerₗ Space) (⇑g) (-y)) (ξ-p) + have hh : (⇑g ∘ fun v => v + -y) = (SchwartzMap.compSubConstCLM ℂ y g : Space → ℂ) := by + ext v; simp [sub_eq_add_neg] + rw [hh] at ht + change 𝓕 (⇑(SchwartzMap.compSubConstCLM ℂ y g)) (ξ-p) = + Real.fourierChar (inner ℝ (-y) (ξ-p)) • 𝓕 (⇑g) (ξ-p) at ht + simpa [SchwartzMap.fourier_coe, Circle.smul_def, Real.fourierChar_apply, inner_neg_left, + neg_mul, mul_neg] using ht + +lemma packetState_fourier_joint_continuous (g : 𝓢(Space,ℂ)) : + Continuous (fun z : (Space × Space) × Space => + (𝓕 (packetState g z.1.1 z.1.2) : 𝓢(Space,ℂ)) z.2) := by + simp only [packetState_fourier_apply] + fun_prop +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/SchwartzSquareIntegrable.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/SchwartzSquareIntegrable.lean new file mode 100644 index 0000000000000000000000000000000000000000..53db1405e7cf29b6e307ffb10a107fa322272bd4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/SchwartzSquareIntegrable.lean @@ -0,0 +1,180 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketDensity +import OAI.Analysis.CoulombRadii.FieldAnalysis.MeridianMap + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +lemma schwartz_square_integrable (g : 𝓢(Space,ℝ)) : Integrable (fun x : Space => g x^2) := by + exact (g.memLp 2 volume).integrable_sq + +lemma window_shift_integrable (g : 𝓢(Space,ℝ)) (a : Space) : + Integrable (fun x : Space => g (x-a)^2) := (schwartz_square_integrable g).comp_sub_right a + +lemma window_shift_coulomb_integral (g : 𝓢(Space,ℝ)) (a x : Space) : + (∫ y, coulombKernel (x-y)*g (y-a)^2) = ∫ y, coulombKernel ((x-a)-y)*g y^2 := by + rw [← integral_sub_right_eq_self (fun y => coulombKernel ((x-a)-y)*g y^2) a] + congr 1 + funext y + congr 2 + abel + +lemma window_coulomb_le (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {x : Space} (hx : x ≠ 0) : + (∫ y : Space, coulombKernel (x-y)*g y^2) ≤ coulombKernel x := by + simpa only [hg,mul_one] using radial_coulomb_integral_le (schwartz_square_integrable g) + (g.continuous.measurable.pow_const 2) (fun y => sq_nonneg (g y)) (schwartz_square_le g) + (fun y => congrArg (fun t : ℝ => t^2) (hrad y)) hx + +lemma window_shape_pair_le (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {a c : Space} (hac : a ≠ c) : + (∫ xy : Space × Space, g (xy.1-a)^2*g (xy.2-c)^2*coulombKernel (xy.1-xy.2)) ≤ + coulombKernel (a-c) := by + have hi := window_shift_integrable g + have hm (v : Space) : Measurable (fun x => g (x-v)^2) := + (g.continuous.measurable.comp (measurable_id.sub measurable_const)).pow_const 2 + have hbnd (v x : Space) : ‖g (x-v)^2‖ ≤ (SchwartzMap.seminorm ℝ 0 0 g)^2 := by + rw [Real.norm_of_nonneg (sq_nonneg _)] + exact schwartz_square_le g _ + have hpair := coulomb_pair_integrable (hi a) (hm a) (hi c) (hm c) (hbnd c) + change (∫ xy : Space × Space, g (xy.1-a)^2*g (xy.2-c)^2*coulombKernel (xy.1-xy.2) ∂volume.prod volume) ≤ _ + rw [integral_prod _ hpair] + have hip : Integrable (fun x => g (x-a)^2*(∫ y, coulombKernel ((x-c)-y)*g y^2)) := by + apply hpair.integral_prod_left.congr + filter_upwards [] with x + rw [← window_shift_coulomb_integral g c x,← integral_const_mul] + congr 1 + funext y + ring + have hik : Integrable (fun x => g (x-a)^2*coulombKernel (x-c)) := by + have H := coulomb_convolution_integrable (hi a) (hm a) (fun y => sq_nonneg (g (y-a))) + (fun y => schwartz_square_le g (y-a)) (by norm_num : (0:ℝ)<1) c + apply H.congr + filter_upwards [] with x + rw [coulombKernel_sub_comm c x] + ring + calc + _ = ∫ x, g (x-a)^2*(∫ y, coulombKernel ((x-c)-y)*g y^2) := by + apply integral_congr_ae + filter_upwards [] with x + rw [← window_shift_coulomb_integral g c x,← integral_const_mul] + congr 1 + funext y + ring + _ ≤ ∫ x, g (x-a)^2*coulombKernel (x-c) := by + apply integral_mono_ae hip hik + have hc : ∀ᵐ x : Space, x ≠ c := by rw [ae_iff]; simp + filter_upwards [hc] with x hx + exact mul_le_mul_of_nonneg_left (window_coulomb_le g hg hrad (sub_ne_zero.mpr hx)) (sq_nonneg _) + _ = ∫ x, coulombKernel ((c-a)-x)*g x^2 := by + rw [← window_shift_coulomb_integral] + apply integral_congr_ae + filter_upwards [] with x + rw [coulombKernel_sub_comm c x] + ring + _ ≤ coulombKernel (c-a) := window_coulomb_le g hg hrad (sub_ne_zero.mpr hac.symm) + _ = _ := coulombKernel_sub_comm c a +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/SmoothCompact.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/SmoothCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..2aec415d211aadf79b1797ab34fff6b2e2d037d7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/SmoothCompact.lean @@ -0,0 +1,222 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.IntegrableIntegralAeTendsto +import OAI.Analysis.CoulombRadii.FieldAnalysis.DeterminantWave + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma complex_smooth_compact_ibp {n : ℕ} (f : Configuration n → ℂ) + (hf : ContDiff ℝ (⊤ : ℕ∞) f) (hC : HasCompactSupport f) + (φ : Configuration n → ℝ) (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) + (hφC : HasCompactSupport φ) (v : Configuration n) : + (∫ x, f x * (fderiv ℝ φ x v : ℂ)) = + -(∫ x, fderiv ℝ f x v * (φ x : ℂ)) := by + let g : Configuration n → ℂ := fun x => (φ x : ℂ) + have hg : ContDiff ℝ (⊤ : ℕ∞) g := Complex.ofRealCLM.contDiff.comp hφ + have hgC : HasCompactSupport g := hφC.comp_left Complex.ofReal_zero + have hd (x : Configuration n) : fderiv ℝ g x v = (fderiv ℝ φ x v : ℂ) := by + exact congrArg (fun L : Configuration n →L[ℝ] ℂ => L v) + ((Complex.ofRealCLM.hasFDerivAt.comp x ((hφ.differentiable (by simp)) x).hasFDerivAt).fderiv) + have hf' : Continuous (fun x => fderiv ℝ f x v) := + (hf.continuous_fderiv (by simp)).clm_apply continuous_const + have hg' : Continuous (fun x => fderiv ℝ g x v) := + (hg.continuous_fderiv (by simp)).clm_apply continuous_const + have hi1 : Integrable (fun x => fderiv ℝ f x v * g x) volume := (hf'.mul hg.continuous).integrable_of_hasCompactSupport + (hgC.mul_left (f := fun x => fderiv ℝ f x v)) + have hi2 : Integrable (fun x => f x * fderiv ℝ g x v) volume := (hf.continuous.mul hg').integrable_of_hasCompactSupport + (hC.mul_right (f' := fun x => fderiv ℝ g x v)) + have hi3 : Integrable (fun x => f x * g x) volume := (hf.continuous.mul hg.continuous).integrable_of_hasCompactSupport + (hC.mul_right (f' := g)) + have h := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable hi1 hi2 hi3 + (fun x _ => (hf.differentiable (by simp)) x) + (fun x _ => (hg.differentiable (by simp)) x) + simpa only [hd] using h + +noncomputable def H1Vector.ofSmoothCompact {n : ℕ} (f : Spins n → Configuration n → ℂ) + (hf : ∀ s, ContDiff ℝ (⊤ : ℕ∞) (f s)) + (hC : ∀ s, HasCompactSupport (f s)) : H1Vector n where + value := f + gradient s a x := fderiv ℝ (f s) x (EuclideanSpace.single a 1) + value_L2 s := (hf s).continuous.memLp_of_hasCompactSupport (hC s) + partial_L2 s a := + (((hf s).continuous_fderiv (by simp)).clm_apply continuous_const).memLp_of_hasCompactSupport + ((hC s).fderiv_apply ℝ (EuclideanSpace.single a 1)) + weak_partial s a φ hφ hφC := complex_smooth_compact_ibp (f s) (hf s) (hC s) φ hφ hφC _ + +lemma tensor_compact_support {A : Type*} [TopologicalSpace A] [T2Space A] + {n : ℕ} (f : Fin n → A → ℂ) (hC : ∀ i, HasCompactSupport (f i)) : + HasCompactSupport (fun x : Fin n → A => ∏ i, f i (x i)) := by + apply HasCompactSupport.intro (isCompact_univ_pi (fun i => (hC i).isCompact)) + intro x hx + have hn : ¬ ∀ i, x i ∈ tsupport (f i) := by simpa only [mem_univ_pi] using hx + obtain ⟨i,hi⟩ := not_forall.mp hn + exact Finset.prod_eq_zero (Finset.mem_univ i) (image_eq_zero_of_notMem_tsupport hi) + +noncomputable def configurationHomeomorph (n : ℕ) : Configuration n ≃ₜ (Fin n → Space) := + ((PiLp.homeomorph 2 (fun _ : Fin n × Fin 3 => ℝ)).trans + (Homeomorph.piCurry (X := Fin n) (Y := Fin 3) (Z := ℝ))).trans + (Homeomorph.piCongrRight fun _ => (PiLp.homeomorph 2 (fun _ : Fin 3 => ℝ)).symm) + +lemma tensorOrbital_compact_support {n : ℕ} {α : Type*} + (v : α → Space → Fin 2 → ℂ) + (hC : ∀ a s, HasCompactSupport (fun x => v a x s)) + (b : Fin n → α) (s : Spins n) : HasCompactSupport (tensorOrbital v b s) := by + exact (tensor_compact_support (fun i x => v (b i) x (s i)) (fun i => hC (b i) (s i))).comp_homeomorph + (configurationHomeomorph n) + +noncomputable def positionCLM {n : ℕ} (i : Fin n) : Configuration n →L[ℝ] Space := + (PiLp.continuousLinearEquiv 2 ℝ (fun _ : Fin 3 => ℝ)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.pi fun b : Fin 3 => + (EuclideanSpace.proj (i,b) : Configuration n →L[ℝ] ℝ)) + +lemma positionCLM_apply {n : ℕ} (i : Fin n) (x : Configuration n) : + positionCLM i x = position x i := rfl + +lemma tensorOrbital_contDiff {n : ℕ} {α : Type*} + (v : α → Space → Fin 2 → ℂ) + (hv : ∀ a s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v a x s)) + (b : Fin n → α) (s : Spins n) : ContDiff ℝ (⊤ : ℕ∞) (tensorOrbital v b s) := by + unfold tensorOrbital + apply contDiff_prod + intro i _ + exact (hv (b i) (s i)).comp (positionCLM i).contDiff + +noncomputable def slaterConfiguration {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (s : Spins n) (x : Configuration n) : ℂ := + slaterWave (fun i (a : Fin 2 × Space) => v i a.2 a.1) (fun i => (s i, position x i)) + +lemma slaterConfiguration_expansion {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (s : Spins n) : slaterConfiguration v s = + fun x => (↑(Real.sqrt (n.factorial : ℝ))⁻¹ : ℂ) * + ∑ p : Equiv.Perm (Fin n), (((p.sign : ℤ) : ℂ)) * tensorOrbital v p s x := by + funext x + simp only [slaterConfiguration, slaterWave, determinantWave_expansion, tensorOrbital] + +lemma slaterConfiguration_contDiff {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ i s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v i x s)) (s : Spins n) : + ContDiff ℝ (⊤ : ℕ∞) (slaterConfiguration v s) := by + rw [slaterConfiguration_expansion] + apply contDiff_const.mul + exact ContDiff.sum (fun p _ => contDiff_const.mul (tensorOrbital_contDiff v hv p s)) + +lemma slaterConfiguration_compact_support {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hC : ∀ i s, HasCompactSupport (fun x => v i x s)) (s : Spins n) : + HasCompactSupport (slaterConfiguration v s) := by + have ht (p : Equiv.Perm (Fin n)) : HasCompactSupport + (fun x => (((p.sign : ℤ) : ℂ)) * tensorOrbital v p s x) := + (tensorOrbital_compact_support v hC p s).mul_left + have hs : HasCompactSupport (fun x => ∑ p : Equiv.Perm (Fin n), + (((p.sign : ℤ) : ℂ)) * tensorOrbital v p s x) := + by + convert (HasCompactSupport.finset_sum (s := Finset.univ) + (f := fun (p : Equiv.Perm (Fin n)) x => (((p.sign : ℤ) : ℂ)) * tensorOrbital v p s x) (fun p _ => ht p)) using 1 + first | rfl | (funext x; simp only [Finset.sum_apply]) + rw [slaterConfiguration_expansion] + exact hs.mul_left (f := fun _ => (↑(Real.sqrt (n.factorial : ℝ))⁻¹ : ℂ)) + +noncomputable def slaterState {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ i s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v i x s)) + (hC : ∀ i s, HasCompactSupport (fun x => v i x s)) : H1Vector n := + H1Vector.ofSmoothCompact (slaterConfiguration v) + (slaterConfiguration_contDiff v hv) (slaterConfiguration_compact_support v hC) + +lemma slaterState_antisymmetric {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ i s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v i x s)) + (hC : ∀ i s, HasCompactSupport (fun x => v i x s)) : + Antisymmetric (slaterState v hv hC) := by + intro p s + filter_upwards [] with x + change slaterConfiguration v (s ∘ p) (permute p x) = _ * slaterConfiguration v s x + have he : (fun i => ((s ∘ p) i, position (permute p x) i)) = + (fun i => (s i, position x i)) ∘ p := by + funext i + simp only [Function.comp_apply, position_permute] + simp only [slaterConfiguration, slaterWave, he, determinantWave_permute] + ring + +noncomputable def flatSpinOrbital (v : Space → Fin 2 → ℂ) : Fin 2 × (Fin 3 → ℝ) → ℂ := + fun sx => v (WithLp.toLp 2 sx.2) sx.1 + +lemma flatSpinOrbital_memLp (v : Space → Fin 2 → ℂ) + (hv : ∀ s, MemLp (fun x => v x s) 2 volume) : + MemLp (flatSpinOrbital v) 2 spinSpaceMeasure := by + change MemLp (flatSpinOrbital v) 2 (Measure.count.prod volume) + have hi (s : Fin 2) : MemLp (fun t : Fin 2 => if t = s then (1:ℂ) else 0) 2 Measure.count := by + apply MemLp.of_bound (by fun_prop) 1 + exact ae_of_all _ (fun t => by split_ifs <;> norm_num) + have H := memLp_finsetSum Finset.univ (fun (s : Fin 2) _ => tensorPair_memLp (hi s) + ((hv s).comp_measurePreserving (PiLp.volume_preserving_toLp _))) + convert H using 1 + funext sx + simp [flatSpinOrbital, ite_mul] + +lemma flatSpinOrbital_inner (v u : Space → Fin 2 → ℂ) + (hv : ∀ s, MemLp (fun x => v x s) 2 volume) + (hu : ∀ s, MemLp (fun x => u x s) 2 volume) : + (∫ a, star (flatSpinOrbital v a) * flatSpinOrbital u a ∂spinSpaceMeasure) = + ∑ s : Fin 2, ∫ x : Space, star (v x s) * u x s := by + have hI := (flatSpinOrbital_memLp v hv).star.integrable_mul (flatSpinOrbital_memLp u hu) + change Integrable (fun a => star (flatSpinOrbital v a) * flatSpinOrbital u a) + (Measure.count.prod volume) at hI + change (∫ a, star (flatSpinOrbital v a) * flatSpinOrbital u a ∂(Measure.count.prod volume)) = _ + rw [integral_prod _ hI, integral_count] + apply Finset.sum_congr rfl + intro s _ + exact (show MeasurePreserving (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)) volume volume from + PiLp.volume_preserving_toLp _).integral_comp' (fun x => star (v x s) * u x s) + +lemma slaterState_cubeState {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ i s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v i x s)) + (hC : ∀ i s, HasCompactSupport (fun x => v i x s)) : + cubeState (slaterState v hv hC) = slaterWave (fun i => flatSpinOrbital (v i)) := by + funext x + rfl + +lemma slaterState_normalized {n : ℕ} (v : Fin n → Space → Fin 2 → ℂ) + (hv : ∀ i s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v i x s)) + (hC : ∀ i s, HasCompactSupport (fun x => v i x s)) + (ho : ∀ i j, (∑ s : Fin 2, ∫ x : Space, star (v i x s) * v j x s) = + if i = j then (1:ℂ) else 0) : mass (slaterState v hv hC) = 1 := by + have hV (i : Fin n) (s : Fin 2) : MemLp (fun x => v i x s) 2 volume := + (hv i s).continuous.memLp_of_hasCompactSupport (hC i s) + rw [← cubeState_full_mass, slaterState_cubeState] + apply slaterWave_normalized (fun i => flatSpinOrbital (v i)) + (fun i => flatSpinOrbital_memLp (v i) (hV i)) + intro i j + rw [flatSpinOrbital_inner (v i) (v j) (hV i) (hV j)] + by_cases h : i = j + · simpa only [ite_eq_left h] using ho i j + · simpa only [ite_eq_right h] using ho i j + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/SortedCut.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/SortedCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..55e20f97781c1fcc7a5cba38d6ef43d015e0c4a2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/SortedCut.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.NuclearPotential +import OAI.Analysis.CoulombRadii.Localization.CutCore +import OAI.Analysis.CoulombRadii.FieldAnalysis.BinaryOrder + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma Antisymmetric.congr_ae {n : ℕ} {u v : H1Vector n} (hu : Antisymmetric u) + (he : ∀ s, u.value s =ᵐ[volume] v.value s) : Antisymmetric v := by + intro p s + filter_upwards [(permute_measurePreserving p).quasiMeasurePreserving.ae (he (s ∘ p)),he s,hu p s] with x hx hy hz + change u.value (s ∘ p) (permute p x)=v.value (s ∘ p) (permute p x) at hx + rw [← hx,← hy] + exact hz + +lemma Antisymmetric.permutation {n : ℕ} {u : H1Vector n} (hu : Antisymmetric u) + (p : Equiv.Perm (Fin n)) : Antisymmetric (u.permutation p) := by + apply (antisymmetric_scale u hu (((p.sign:ℤ):ℂ))).congr_ae + intro s + filter_upwards [hu p s] with x hx + exact hx.symm + +lemma mass_congr_ae {n : ℕ} (u v : H1Vector n) (he : ∀ s, u.value s =ᵐ[volume] v.value s) : + mass u=mass v := by + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [he s] with x hx + rw [hx] + +lemma kinetic_congr_ae {n : ℕ} (u v : H1Vector n) (he : ∀ s, u.value s =ᵐ[volume] v.value s) : + kinetic u=kinetic v := by + unfold kinetic + congr 1 + apply Finset.sum_congr rfl + intro s hs + apply Finset.sum_congr rfl + intro a ha + apply integral_congr_ae + filter_upwards [u.gradient_congr_ae v he s a] with x hx + rw [hx] + +lemma potentialEnergy_congr_ae {n : ℕ} (W : Configuration n → ℝ) (u v : H1Vector n) + (he : ∀ s, u.value s =ᵐ[volume] v.value s) : potentialEnergy W u=potentialEnergy W v := by + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [he s] with x hx + rw [hx] + +lemma form_congr_ae {J n : ℕ} (S : Nuclei J) (u v : H1Vector n) + (he : ∀ s, u.value s =ᵐ[volume] v.value s) : form S u=form S v := by + change kinetic u-potentialEnergy (nuclearPotential S) u+potentialEnergy pairPotential u = + kinetic v-potentialEnergy (nuclearPotential S) v+potentialEnergy pairPotential v + rw [kinetic_congr_ae u v he,potentialEnergy_congr_ae _ u v he,potentialEnergy_congr_ae _ u v he] + +lemma form_permutation {J n : ℕ} (S : Nuclei J) (u : H1Vector n) (p : Equiv.Perm (Fin n)) : + form S (u.permutation p)=form S u := by + change kinetic (u.permutation p)-potentialEnergy (nuclearPotential S) (u.permutation p)+ + potentialEnergy pairPotential (u.permutation p)=_ + rw [kinetic_permutation,potentialEnergy_permutation _ (nuclearPotential_permute S), + potentialEnergy_permutation _ pairPotential_permute] + rfl + +lemma tensorCut_permute {n : ℕ} {L : Type*} (χ : L → Space → ℝ) + (p : Fin n → L) (q : Equiv.Perm (Fin n)) (x : Configuration n) : + tensorCut χ p (permute q x)=tensorCut χ (p ∘ q.symm) x := by + unfold tensorCut + simp only [position_permute] + calc + _ = ∏ i, χ ((p ∘ q.symm) (q i)) (position x (q i)) := by simp only [Function.comp_apply,Equiv.symm_apply_apply] + _ = _ := Equiv.prod_comp q (fun i => χ ((p ∘ q.symm) i) (position x i)) + +lemma labelCut_permute_value {n : ℕ} {L : Type*} [Fintype L] (ψ : H1Vector n) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → L) (q : Equiv.Perm (Fin n)) (s : Spins n) (x : Configuration n) : + ((ψ.labelCut χ hχ hp D hD hd p).permutation q).value s x = + ((ψ.permutation q).labelCut χ hχ hp D hD hd (p ∘ q.symm)).value s x := by + change (↑(tensorCut χ p (permute q x)):ℂ)*ψ.value (s ∘ q) (permute q x) = _ + rw [tensorCut_permute] + rfl + +theorem binary_cut_core_outcome {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (hψ : Antisymmetric ψ) + (χ : Fin 2 → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → Fin 2) (A : Set Space) (hA : ∀ z ∉ A, χ 1 z=0) : + ∃ m k : ℕ, ∃ u : H1Vector (m+k), m+k=n ∧ + mass u=mass (ψ.labelCut χ hχ hp D hD hd p) ∧ + form S u=form S (ψ.labelCut χ hχ hp D hD hd p) ∧ + (∀ s, ∀ᵐ x, Antisymmetric (u.coreSlice s x)) ∧ + (∀ s, ∀ᵐ x, SpatiallySupported (u.coreSlice s x) A) := by + obtain ⟨m,k,e,he0,he1⟩ := exists_binary_order p + have hn : m+k=n := by simpa only [Fintype.card_fin] using Fintype.card_congr e + subst n + let v := ψ.labelCut χ hχ hp D hD hd p + let u := (ψ.permutation e.symm).labelCut χ hχ hp D hD hd (p ∘ e) + have hval (s : Spins (m+k)) : (v.permutation e.symm).value s =ᵐ[volume] u.value s := by + exact Eventually.of_forall (fun x => labelCut_permute_value ψ χ hχ hp D hD hd p e.symm s x) + refine ⟨m,k,u,rfl,?_,?_,?_,?_⟩ + · rw [← mass_congr_ae _ _ hval,mass_permutation] + · rw [← form_congr_ae S _ _ hval,form_permutation] + · intro s + exact labelCut_core_antisymmetric _ (hψ.permutation e.symm) χ hχ hp D hD hd + (p ∘ e) 1 he1 s + · intro s + exact labelCut_core_support _ χ hχ hp D hD hd (p ∘ e) 1 he1 A hA s + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/SpaceFourierL2.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/SpaceFourierL2.lean new file mode 100644 index 0000000000000000000000000000000000000000..e55d5518d4284eca6bd018afe0980fba536af3f5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/SpaceFourierL2.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.PacketFrame +import OAI.Analysis.CoulombRadii.FieldAnalysis.FrameImageDensity +import OAI.Analysis.CoulombRadii.Packets.ComplexWindow + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +namespace Coulomb +noncomputable def spaceFourierL2 : Lp ℂ 2 (volume : Measure Space) →L[ℂ] + Lp ℂ 2 (volume : Measure Space) := + (Lp.fourierTransformₗᵢ Space ℂ).toContinuousLinearEquiv.toContinuousLinearMap + +lemma spaceFourierL2_apply (u : Lp ℂ 2 (volume : Measure Space)) : + spaceFourierL2 u = 𝓕 u := rfl + +lemma packetFrame_fourier_weighted_trace (g : 𝓢(Space,ℝ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] + (hp : MemLp (fun yp : Space × Space => yp.2) 2 μ) (a : Space) : + let hv := packetState_toL2_memLp (complexWindow g) μ + let b := compactSpectralBasis (packetFrame (complexWindow g) μ) + (packetFrame_compact (complexWindow g) μ) (frameOperator_symmetric hv) + (∀ i : Σ z, eigenspaceBasisSet (packetFrame (complexWindow g) μ) z, + i.1.re ≠ 0 → Integrable (fun ξ : Space => (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (b i) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2)) ∧ + HasSum (fun i : Σ z, eigenspaceBasisSet (packetFrame (complexWindow g) μ) z => + i.1.re * ∫ ξ : Space, (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (b i) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2) + (∫ yp : Space × Space, (2*Real.pi*inner ℝ a yp.2)^2 * (∫ x : Space, g x^2) + + (∫ x : Space, (fderiv ℝ g x a)^2) ∂μ) := by + let : Fact ((2 : ℝ≥0∞) ≠ ⊤) := ⟨by simp⟩ + dsimp only + have hV (yp : Space × Space) : + spaceFourierL2 ((packetState (complexWindow g) yp.1 yp.2).toLp 2) =ᵐ[volume] + fun ξ => (𝓕 (packetState (complexWindow g) yp.1 yp.2) : 𝓢(Space,ℂ)) ξ := by + rw [spaceFourierL2_apply, SchwartzMap.toLp_fourier_eq] + exact SchwartzMap.coeFn_toLp _ 2 volume + have h := frameImage_weighted_trace (packetState_toL2_memLp (complexWindow g) μ) + spaceFourierL2 (fun yp ξ => (𝓕 (packetState (complexWindow g) yp.1 yp.2) : 𝓢(Space,ℂ)) ξ) + hV (packetState_fourier_joint_square_integrable (complexWindow g) μ) + (fun ξ : Space => (2*Real.pi*inner ℝ ξ a)^2) (by fun_prop) (fun ξ => sq_nonneg _) + (packetState_real_weighted_joint_integrable g μ hp a) + constructor + · exact h.1 + · convert h.2 using 1 + all_goals first | rfl | (simp only [packetState_real_kinetic_integral]) + +lemma packetFrame_positive_eigen_weakDerivative (g : 𝓢(Space,ℝ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] + (hp : MemLp (fun yp : Space × Space => yp.2) 2 μ) (a : Space) + (i : Σ z, eigenspaceBasisSet (packetFrame (complexWindow g) μ) z) (hi : i.1.re ≠ 0) : + let hv := packetState_toL2_memLp (complexWindow g) μ + let b := compactSpectralBasis (packetFrame (complexWindow g) μ) + (packetFrame_compact (complexWindow g) μ) (frameOperator_symmetric hv) + ∃ d : Lp ℂ 2 (volume : Measure Space), + (∀ φ : Space → ℝ, ContDiff ℝ (⊤ : ℕ∞) φ → HasCompactSupport φ → + (∫ x : Space, (fderiv ℝ φ x a : ℂ) * b i x) = + -(∫ x : Space, (φ x : ℂ) * d x)) ∧ + ‖d‖^2 = ∫ ξ : Space, (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (b i) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2 := by + dsimp only + exact l2_fourier_weighted_derivative _ a + ((packetFrame_fourier_weighted_trace g μ hp a).1 i hi) +end Coulomb + +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/TfGradientField.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/TfGradientField.lean new file mode 100644 index 0000000000000000000000000000000000000000..630b3152abec188fbed10c97734527e408a7c39e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/TfGradientField.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TfRawVariation + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] +noncomputable def tfGradientField (c : ℝ) (W : TFLq (volume.restrict Ω)) + (f : TFLp (volume.restrict Ω)) : TFLq (volume.restrict Ω) := + (c*(5/3:ℝ)) • tfKineticField f-W+tfPotentialField hΩ f +lemma tfGradientField_coe (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + tfGradientField hΩ c W f =ᵐ[volume.restrict Ω] + (fun x => c*(5/3:ℝ)*(f x)^(2/3:ℝ)-W x+tfPotential f x) := by + filter_upwards [Lp.coeFn_add ((c*(5/3:ℝ)) • tfKineticField f-W) (tfPotentialField hΩ f), + Lp.coeFn_sub ((c*(5/3:ℝ)) • tfKineticField f) W, + Lp.coeFn_smul (c*(5/3:ℝ)) (tfKineticField f),tfKineticField_coe f, + tfPotentialField_coe hΩ f,hf] with x ha hs hm hk hp hx + simp only [tfGradientField,ha,Pi.add_apply,hs,Pi.sub_apply,hm,Pi.smul_apply, + smul_eq_mul,hk,Real.norm_of_nonneg hx,hp] +lemma tfGradientField_pair (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (h : TFLp (volume.restrict Ω)) : + tfFieldContinuous (tfGradientField hΩ c W f) h = + c*(5/3:ℝ)*(∫ x in Ω, (f x)^(2/3:ℝ)*h x) - tfFieldContinuous W h+tfCoulomb Ω h f := by + unfold tfGradientField + simp only [map_add,map_sub,map_smul,_root_.add_apply,_root_.sub_apply,_root_.smul_apply,smul_eq_mul] + rw [tfKineticField_pair hf,tfCoulomb_eq_field hΩ h f] +lemma tfGradientField_nonneg (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g) : + ∀ᵐ x ∂volume.restrict Ω, 0 ≤ tfGradientField hΩ c W f x := by + apply tfDual_nonneg + intro h hh hb + rw [tfGradientField_pair hΩ c W hf] + have H := tfFunctional_tangent_nonneg c (tfFieldContinuous W) (tfCoulombContinuous hΩ) hf hm hh hb + change 0 ≤ c*(5/3:ℝ)*(∫ x in Ω, (f x)^(2/3:ℝ)*h x) - tfFieldContinuous W h + + (tfCoulomb Ω f h+tfCoulomb Ω h f)/2 at H + rw [tfCoulomb_symm f h] at H + linarith +lemma tfGradientField_self (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g) : + tfFieldContinuous (tfGradientField hΩ c W f) f = 0 := by + rw [tfGradientField_pair hΩ c W hf,←tfKineticField_pair hf f,tfKineticField_self hf] + exact tfFunctional_scaling_stationary c (tfFieldContinuous W) (tfCoulombContinuous hΩ) hf hm +lemma tfGradientField_complementarity (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g) : + ∀ᵐ x ∂volume.restrict Ω, tfGradientField hΩ c W f x*f x = 0 := by + have hn : 0 ≤ᵐ[volume.restrict Ω] (fun x => tfGradientField hΩ c W f x*f x) := by + filter_upwards [tfGradientField_nonneg hΩ c W hf hm,hf] with x hx hy + exact mul_nonneg hx hy + apply (integral_eq_zero_iff_of_nonneg_ae hn (tfFieldPairing_integrable _ _)).mp + exact tfGradientField_self hΩ c W hf hm +lemma tfEuler_complementarity (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g) : + ∀ᵐ x ∂volume.restrict Ω, + 0 ≤ c*(5/3:ℝ)*(f x)^(2/3:ℝ)-W x+tfPotential f x ∧ + (c*(5/3:ℝ)*(f x)^(2/3:ℝ)-W x+tfPotential f x)*f x = 0 := by + filter_upwards [tfGradientField_coe hΩ c W hf,tfGradientField_nonneg hΩ c W hf hm, + tfGradientField_complementarity hΩ c W hf hm] with x he hn hz + simpa only [he] using And.intro hn hz +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/ThomasFermiKineticConstant.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/ThomasFermiKineticConstant.lean new file mode 100644 index 0000000000000000000000000000000000000000..c7e02fbdadb4548ef6492dde9b1dfeeac164d105 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/ThomasFermiKineticConstant.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PhaseRegion + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +namespace Coulomb +lemma fermiMeasure_center_lintegral (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (f : Space → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ yp, f yp.1 ∂phaseMeasure (fermiRadius ρ)) = + ∫⁻ y : Space, f y * ENNReal.ofReal (ρ y/2) := by + rw [phaseMeasure_lintegral (fermiRadius_measurable ρ hm) (fun yp : Space × Space => f yp.1) (hf.comp measurable_fst)] + simp only [lintegral_const, Measure.restrict_apply_univ, fermiRadius_ball_mass ρ hρ] + +lemma fermiMeasure_center_integral (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (f : Space → ℝ) (hf : Measurable f) (hfp : ∀ y, 0 ≤ f y) : + (∫ yp, f yp.1 ∂phaseMeasure (fermiRadius ρ)) = (1/2:ℝ)*∫ y : Space, f y*ρ y := by + rw [integral_eq_lintegral_of_nonneg_ae (f := fun yp : Space × Space => f yp.1) (Filter.Eventually.of_forall (fun yp : Space × Space => hfp yp.1)) + (hf.comp measurable_fst).aestronglyMeasurable, fermiMeasure_center_lintegral ρ hρ hm _ hf.ennreal_ofReal] + have he (y : Space) : ENNReal.ofReal (f y) * ENNReal.ofReal (ρ y/2) = + ENNReal.ofReal ((1/2:ℝ)*(f y*ρ y)) := by + rw [← ENNReal.ofReal_mul (hfp y)] + congr 1 + ring + simp only [he] + rw [← integral_eq_lintegral_of_nonneg_ae + (Filter.Eventually.of_forall (fun y => mul_nonneg (by norm_num) (mul_nonneg (hfp y) (hρ y)))) + ((hf.mul hm).const_mul (1/2:ℝ)).aestronglyMeasurable, integral_const_mul] + +noncomputable def thomasFermiKineticConstant : ℝ := (3/10:ℝ)*(3*Real.pi^2)^(2/3:ℝ) + +lemma fermi_kinetic_coefficient : + (2*Real.pi)^2 * (4*Real.pi/5) * (3/(8*Real.pi))^(5/3:ℝ) = + thomasFermiKineticConstant := by + have hp : 0 < Real.pi := Real.pi_pos + have hA : 0 < 3/(8*Real.pi) := by positivity + have hpow : (3/(8*Real.pi))^(5/3:ℝ) = + (3/(8*Real.pi)) * (3/(8*Real.pi))^(2/3:ℝ) := by + rw [show (5/3:ℝ) = 1+2/3 by norm_num, Real.rpow_add hA, Real.rpow_one] + have hphase : (2*Real.pi)^2 * (3/(8*Real.pi))^(2/3:ℝ) = + (3*Real.pi^2)^(2/3:ℝ) := by + have he : ((2*Real.pi)^3)^(2/3:ℝ) = (2*Real.pi)^2 := by + rw [← Real.rpow_natCast_mul (by positivity)] + norm_num + rw [← he, ← Real.mul_rpow (by positivity) hA.le] + congr 1 + field_simp + ring + rw [hpow] + calc + _ = (3/10:ℝ)*((2*Real.pi)^2 * (3/(8*Real.pi))^(2/3:ℝ)) := by field_simp; ring + _ = thomasFermiKineticConstant := by rw [hphase]; rfl + +lemma fermiMeasure_kinetic (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) : + (2*Real.pi)^2 * (∫ yp, ‖yp.2‖^2 ∂phaseMeasure (fermiRadius ρ)) = + thomasFermiKineticConstant * ∫ y : Space, ρ y^(5/3:ℝ) := by + rw [phaseMeasure_real_momentum (fermiRadius_measurable ρ hm) (fermiRadius_nonneg ρ hρ)] + simp only [fermiRadius_fifth ρ hρ, integral_const_mul] + rw [← mul_assoc, ← mul_assoc, fermi_kinetic_coefficient] +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/Translate.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/Translate.lean new file mode 100644 index 0000000000000000000000000000000000000000..7434d25ef13a9653b13a4a994f5881b078d720be --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/Translate.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.CubeMassMass + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb +lemma weak_partial_translate {n : ℕ} (ψ : H1Vector n) (c : Configuration n) + (s : Spins n) (a : Fin n × Fin 3) (φ : Configuration n → ℝ) + (hφ : ContDiff ℝ (⊤ : ℕ∞) φ) (hcφ : HasCompactSupport φ) : + (∫ x, ψ.value s (x+c) * (fderiv ℝ φ x (EuclideanSpace.single a 1) : ℂ)) = + -(∫ x, ψ.gradient s a (x+c) * (φ x : ℂ)) := by + let Φ : Configuration n → ℝ := fun y => φ (y-c) + have HΦ : ContDiff ℝ (⊤ : ℕ∞) Φ := hφ.comp (contDiff_id.sub contDiff_const) + have HC : HasCompactSupport Φ := by + simpa only [Φ, Function.comp_def, Homeomorph.coe_addRight, sub_eq_add_neg] using + hcφ.comp_homeomorph (Homeomorph.addRight (-c)) + have Hd (y : Configuration n) : fderiv ℝ Φ y = fderiv ℝ φ (y-c) := by + change fderiv ℝ (φ ∘ (fun y => id y - c)) y = _ + rw [fderiv_comp y (hφ.differentiable (by simp)).differentiableAt + (differentiable_id.sub_const c).differentiableAt] + simp only [fderiv_sub_const, id_eq, fderiv_fun_id, ContinuousLinearMap.comp_id] + have H := ψ.weak_partial s a Φ HΦ HC + simp_rw [Hd] at H + have mp := measurePreserving_add_right (volume : Measure (Configuration n)) c + rw [← (show MeasurePreserving (MeasurableEquiv.addRight c) volume volume from mp).integral_comp' (fun y => ψ.value s y * + (fderiv ℝ φ (y-c) (EuclideanSpace.single a 1) : ℂ)), + ← (show MeasurePreserving (MeasurableEquiv.addRight c) volume volume from mp).integral_comp' (fun y => ψ.gradient s a y * (Φ y : ℂ))] at H + simpa only [Φ, MeasurableEquiv.coe_addRight, add_sub_cancel_right] using H + +noncomputable def H1Vector.translate {n : ℕ} (ψ : H1Vector n) (c : Configuration n) : + H1Vector n where + value := fun s x => ψ.value s (x+c) + gradient := fun s a x => ψ.gradient s a (x+c) + value_L2 := fun s => (ψ.value_L2 s).comp_measurePreserving + (measurePreserving_add_right volume c) + partial_L2 := fun s a => (ψ.partial_L2 s a).comp_measurePreserving + (measurePreserving_add_right volume c) + weak_partial := weak_partial_translate ψ c + +lemma permute_add {n : ℕ} (p : Equiv.Perm (Fin n)) (x c : Configuration n) : + permute p (x+c) = permute p x + permute p c := by + ext ij + rfl + +lemma mass_translate {n : ℕ} (ψ : H1Vector n) (c : Configuration n) : + mass (ψ.translate c) = mass ψ := by + unfold mass H1Vector.translate + congr 1 + funext s + exact integral_add_right_eq_self (fun x => ‖ψ.value s x‖^2) c + +lemma kinetic_translate {n : ℕ} (ψ : H1Vector n) (c : Configuration n) : + kinetic (ψ.translate c) = kinetic ψ := by + unfold kinetic H1Vector.translate + congr 2 + funext s + congr 1 + funext a + exact integral_add_right_eq_self (fun x => ‖ψ.gradient s a x‖^2) c + +noncomputable def commonShift {n : ℕ} (t : Fin 3 → ℝ) : Configuration n := + WithLp.toLp 2 (fun ij => t ij.2) + +lemma Antisymmetric.translate_common {n : ℕ} {ψ : H1Vector n} (hψ : Antisymmetric ψ) + (t : Fin 3 → ℝ) : Antisymmetric (ψ.translate (commonShift t)) := by + intro p s + have H := (measurePreserving_add_right (volume : Measure (Configuration n)) + (commonShift t)).quasiMeasurePreserving.ae (hψ p s) + filter_upwards [H] with x hx + simpa only [H1Vector.translate, permute_add, show permute p (commonShift t) = commonShift t from rfl] using hx + +noncomputable def spinSpaceMeasure : Measure (Fin 2 × (Fin 3 → ℝ)) := Measure.count.prod volume +instance spinSpaceMeasure_sigmaFinite : SigmaFinite spinSpaceMeasure := by + unfold spinSpaceMeasure + infer_instance + +def centeredSpinCube (R : ℝ) : Set (Fin 2 × (Fin 3 → ℝ)) := + univ ×ˢ (univ.pi fun _ : Fin 3 => Ioc (-R) R) +lemma centeredSpinCube_measurable (R : ℝ) : MeasurableSet (centeredSpinCube R) := + MeasurableSet.univ.prod (MeasurableSet.univ_pi (fun _ => measurableSet_Ioc)) + +noncomputable def centeredSpinMeasure (R : ℝ) : Measure (Fin 2 × (Fin 3 → ℝ)) := + spinSpaceMeasure.restrict (centeredSpinCube R) +instance centeredSpinMeasure_sigmaFinite (R : ℝ) : SigmaFinite (centeredSpinMeasure R) := by + unfold centeredSpinMeasure + infer_instance + +noncomputable def spinShift (t : Fin 3 → ℝ) : + (Fin 2 × (Fin 3 → ℝ)) ≃ᵐ (Fin 2 × (Fin 3 → ℝ)) := + (MeasurableEquiv.refl (Fin 2)).prodCongr (MeasurableEquiv.addRight t) + +lemma spinShift_measurePreserving (t : Fin 3 → ℝ) : + MeasurePreserving (spinShift t) spinSpaceMeasure spinSpaceMeasure := + (MeasurePreserving.id Measure.count).prod (measurePreserving_add_right volume t) + +lemma spinCubeMeasure_eq_restrict (b : ℝ) : spinCubeMeasure b = + spinSpaceMeasure.restrict (univ ×ˢ (univ.pi fun _ : Fin 3 => Ioc 0 b)) := by + unfold spinCubeMeasure spinSpaceMeasure cubeMeasure + rw [← Measure.restrict_pi_pi] + rw [← Measure.prod_restrict, Measure.restrict_univ] + rfl + +lemma shift_centeredCube_measurePreserving (R : ℝ) : + MeasurePreserving (spinShift (fun _ => -R)) (spinCubeMeasure (2*R)) (centeredSpinMeasure R) := by + have he : (spinShift (fun _ => -R)) ⁻¹' centeredSpinCube R = + univ ×ˢ (univ.pi fun _ : Fin 3 => Ioc 0 (2*R)) := by + ext x + simp only [centeredSpinCube, mem_preimage, mem_prod, mem_univ, true_and, mem_univ_pi, + mem_Ioc] + change (∀ i, -R < x.2 i + -R ∧ x.2 i + -R ≤ R) ↔ + (∀ i, 0 < x.2 i ∧ x.2 i ≤ 2*R) + constructor <;> intro h i <;> obtain ⟨h1,h2⟩ := h i <;> constructor <;> linarith + refine ⟨(spinShift _).measurable, ?_⟩ + rw [spinCubeMeasure_eq_restrict, ← he, ← MeasurableEquiv.restrict_map, + (spinShift_measurePreserving _).map_eq] + rfl + +lemma firstParticleDensity_equiv {A B : Type*} [MeasurableSpace A] [MeasurableSpace B] + {μ : Measure A} {ν : Measure B} [SigmaFinite ν] (e : A ≃ᵐ B) + (he : MeasurePreserving e μ ν) {n : ℕ} (f : (Fin (n+1) → B) → ℂ) (x : A) : + firstParticleDensity (μ := μ) (fun z => f (e ∘ z)) x = + firstParticleDensity (μ := ν) f (e x) := by + let E : (Fin n → A) ≃ᵐ (Fin n → B) := MeasurableEquiv.piCongrRight (fun _ => e) + have hE : MeasurePreserving E (Measure.pi fun _ : Fin n => μ) (Measure.pi fun _ : Fin n => ν) := + measurePreserving_pi _ _ (fun _ => he) + unfold firstParticleDensity + congr 1 + rw [← hE.integral_comp' (fun y => ‖firstFiber f (y,e x)‖^2)] + congr 1 + funext y + have harg : e ∘ Fin.cons x y = Fin.cons (e x) (E y) := by + funext i + refine Fin.cases ?_ (fun j => ?_) i <;> rfl + simp only [firstFiber, harg] + +lemma cubeState_translate {n : ℕ} (ψ : H1Vector n) (t : Fin 3 → ℝ) + (z : Fin n → (Fin 2 × (Fin 3 → ℝ))) : + cubeState (ψ.translate (commonShift t)) z = cubeState ψ ((spinShift t) ∘ z) := rfl + +theorem centered_density_power_bound {n : ℕ} (ψ : H1Vector (n+1)) (hψ : Antisymmetric ψ) + (hm : mass ψ ≤ 1) {R : ℝ} (hR : 0 < R) : + Integrable (fun x => (firstParticleDensity (μ := centeredSpinMeasure R) (cubeState ψ) x)^(5/3:ℝ)) + (centeredSpinMeasure R) ∧ + (∫ x, (firstParticleDensity (μ := centeredSpinMeasure R) (cubeState ψ) x)^(5/3:ℝ) + ∂(centeredSpinMeasure R)) ≤ (64/R^2)*((n+1:ℕ):ℝ) + (8192/(3*Real.pi^2))*kinetic ψ := by + have H := cube_density_power_bound (ψ.translate (commonShift (fun _ => -R))) + (hψ.translate_common _) (by rwa [mass_translate]) (show 0 < 2*R by positivity) + have hd (x) : firstParticleDensity (μ := spinCubeMeasure (2*R)) + (cubeState (ψ.translate (commonShift (fun _ => -R)))) x = + firstParticleDensity (μ := centeredSpinMeasure R) (cubeState ψ) (spinShift (fun _ => -R) x) := by + rw [show cubeState (ψ.translate (commonShift (fun _ => -R))) = + (fun z => cubeState ψ ((spinShift (fun _ => -R)) ∘ z)) from + funext (cubeState_translate ψ (fun _ => -R))] + exact firstParticleDensity_equiv (spinShift (fun _ => -R)) + (shift_centeredCube_measurePreserving R) (cubeState ψ) x + simp_rw [hd] at H + refine ⟨?_, ?_⟩ + · exact ((shift_centeredCube_measurePreserving R).integrable_comp_emb + (spinShift _).measurableEmbedding).mp H.1 + · have H2 := H.2 + rw [(shift_centeredCube_measurePreserving R).integral_comp' + (fun x => (firstParticleDensity (μ := centeredSpinMeasure R) (cubeState ψ) x)^(5/3:ℝ)), + kinetic_translate] at H2 + convert H2 using 1 + ring + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakFourierDerivative.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakFourierDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..5aa2b3553ec0900e5ef5800d1f33c3dd79551245 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakFourierDerivative.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.L2MultiplierDistribution +import OAI.Analysis.CoulombRadii.FormDomain.WeakSchwartzDerivative + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped BigOperators ENNReal NNReal Topology SchwartzMap LineDeriv FourierTransform ComplexConjugate ContDiff +noncomputable section +namespace Coulomb +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +lemma l2_weakDeriv_fourier {u d : Lp ℂ 2 (volume:Measure E)} (a:E) + (hw : ∀ φ : E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u x)=-(∫ x,(φ x:ℂ)*d x)) : + (𝓕 d : Lp ℂ 2 (volume:Measure E)) =ᵐ[volume] + fun ξ => (2*Real.pi*Complex.I)*(inner ℝ ξ a:ℂ)*(𝓕 u : Lp ℂ 2 (volume:Measure E)) ξ := by + have H := congrArg (fun T:𝓢'(E,ℂ) => 𝓕 T) (l2_weakDeriv_tempered a hw) + rw [TemperedDistribution.fourier_lineDerivOp_eq,Lp.fourier_toTemperedDistribution_eq, + Lp.fourier_toTemperedDistribution_eq] at H + have hg : Continuous (fun ξ:E => (2*Real.pi*Complex.I)*(inner ℝ ξ a:ℂ)) := by fun_prop + apply ae_eq_of_integral_contDiff_smul_eq + ((Lp.memLp (𝓕 d : Lp ℂ 2 (volume:Measure E))).locallyIntegrable (by norm_num)) + (((Lp.memLp (𝓕 u : Lp ℂ 2 (volume:Measure E))).locallyIntegrable (by norm_num)).continuous_mul hg) + intro φ hφ hc + let χ : E → ℂ := fun x => (φ x:ℂ) + have hχ : ContDiff ℝ ∞ χ := Complex.ofRealCLM.contDiff.comp hφ + have hχc : HasCompactSupport χ := hc.comp_left (g:=fun r:ℝ => (r:ℂ)) (by simp) + let Φ : 𝓢(E,ℂ) := hχc.toSchwartzMap hχ + have ht : (fun ξ:E => (inner ℝ ξ a:ℂ)).HasTemperateGrowth := by fun_prop + have HH := congrArg (fun T:𝓢'(E,ℂ) => T Φ) H + simp only [smul_apply,smul_eq_mul, + TemperedDistribution.smulLeftCLM_apply_apply,Lp.toTemperedDistribution_apply] at HH + change (2*Real.pi*Complex.I)*(∫ x, + (SchwartzMap.smulLeftCLM ℂ (fun ξ:E => (inner ℝ ξ a:ℂ)) Φ) x * (𝓕 u : Lp ℂ 2 (volume:Measure E)) x)= + ∫ x,Φ x*(𝓕 d : Lp ℂ 2 (volume:Measure E)) x at HH + rw [←integral_const_mul] at HH + calc + _=∫ x,Φ x*(𝓕 d : Lp ℂ 2 (volume:Measure E)) x := by + apply integral_congr_ae + filter_upwards [] with x + simp only [Φ,χ,HasCompactSupport.toSchwartzMap_toFun,Complex.real_smul] + _= _ := HH.symm + _= _ := by + apply integral_congr_ae + filter_upwards [] with x + simp only [SchwartzMap.smulLeftCLM_apply ht,smul_eq_mul,Φ,χ, + HasCompactSupport.toSchwartzMap_toFun,Complex.real_smul] + ring + +lemma l2_weakDeriv_fourier_energy {u d : Lp ℂ 2 (volume:Measure E)} (a:E) + (hw : ∀ φ : E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u x)=-(∫ x,(φ x:ℂ)*d x)) : + Integrable (fun ξ => (2*Real.pi*inner ℝ ξ a)^2* + ‖(𝓕 u : Lp ℂ 2 (volume:Measure E)) ξ‖^2) ∧ + (∫ ξ,(2*Real.pi*inner ℝ ξ a)^2*‖(𝓕 u : Lp ℂ 2 (volume:Measure E)) ξ‖^2)=‖d‖^2 := by + have h := l2_weakDeriv_fourier a hw + have he : (fun ξ => ‖(𝓕 d : Lp ℂ 2 (volume:Measure E)) ξ‖^2) =ᵐ[volume] + fun ξ => (2*Real.pi*inner ℝ ξ a)^2*‖(𝓕 u : Lp ℂ 2 (volume:Measure E)) ξ‖^2 := by + filter_upwards [h] with ξ hξ + rw [hξ,fourierMultiplier_norm_sq] + refine ⟨((Lp.memLp (𝓕 d : Lp ℂ 2 (volume:Measure E))).integrable_norm_pow (by norm_num)).congr he,?_⟩ + rw [←integral_congr_ae he,←l2_norm_sq_fourier] + exact congrArg (fun t:ℝ => t^2) ((Lp.fourierTransformₗᵢ E ℂ).norm_map d) +end Coulomb +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal Topology ComplexConjugate +noncomputable section +namespace Coulomb +variable {X:Type*} [MeasurableSpace X] {μ:Measure X} +def cutL2 (s:Set X) (hs:MeasurableSet s) (u:Lp ℂ 2 μ) : Lp ℂ 2 μ := + ((Lp.memLp u).indicator hs).toLp (s.indicator u) +lemma cutL2_ae (s:Set X) (hs:MeasurableSet s) (u:Lp ℂ 2 μ) : + cutL2 s hs u =ᵐ[μ] s.indicator u := MemLp.coeFn_toLp _ +lemma cutL2_norm_le (s:Set X) (hs:MeasurableSet s) (u:Lp ℂ 2 μ) : + ‖cutL2 s hs u‖≤‖u‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [cutL2_ae s hs u] with x hx + rw [hx] + by_cases hx:x∈s <;> simp [hx] +lemma cutL2_sub (s:Set X) (hs:MeasurableSet s) (u v:Lp ℂ 2 μ) : + cutL2 s hs (u-v)=cutL2 s hs u-cutL2 s hs v := by + apply Lp.ext + filter_upwards [cutL2_ae s hs (u-v),cutL2_ae s hs u,cutL2_ae s hs v, + Lp.coeFn_sub u v,Lp.coeFn_sub (cutL2 s hs u) (cutL2 s hs v)] with x h h1 h2 huv h3 + rw [h,h3] + simp only [Pi.sub_apply] + rw [h1,h2] + by_cases hx:x∈s + · simp only [Set.indicator_of_mem hx,huv,Pi.sub_apply] + · simp only [Set.indicator_of_notMem hx,sub_self] +lemma cutL2_add_compl (s:Set X) (hs:MeasurableSet s) (u:Lp ℂ 2 μ) : + cutL2 s hs u+cutL2 sᶜ hs.compl u=u := by + apply Lp.ext + filter_upwards [cutL2_ae s hs u,cutL2_ae sᶜ hs.compl u, + Lp.coeFn_add (cutL2 s hs u) (cutL2 sᶜ hs.compl u)] with x h1 h2 h3 + rw [h3] + simp only [Pi.add_apply] + rw [h1,h2] + by_cases hx:x∈s <;> simp [hx] +lemma l2_norm_sq_integral (u:Lp ℂ 2 μ) : ‖u‖^2=∫ x,‖u x‖^2 ∂μ := by + have h := congrArg Complex.re (L2.inner_def u u (𝕜:=ℂ)) + rw [inner_self_eq_norm_sq_to_K] at h + change ((‖u‖:ℂ)^2).re=(∫ x,inner ℂ (u x) (u x) ∂μ).re at h + rw [←Complex.ofReal_pow,Complex.ofReal_re] at h + rw [h] + change RCLike.re (∫ x,inner ℂ (u x) (u x) ∂μ)=_ + rw [←integral_re (L2.integrable_inner (𝕜:=ℂ) u u)] + apply integral_congr_ae + filter_upwards [] with x + simp [inner_self_eq_norm_sq_to_K,←Complex.ofReal_pow] +lemma cutL2_norm_sq (s:Set X) (hs:MeasurableSet s) (u:Lp ℂ 2 μ) : + ‖cutL2 s hs u‖^2=∫ x in s,‖u x‖^2 ∂μ := by + rw [l2_norm_sq_integral,←integral_indicator hs] + apply integral_congr_ae + filter_upwards [cutL2_ae s hs u] with x hx + rw [hx] + by_cases h:x∈s <;> simp [h] +lemma cutL2_mono_norm {s t:Set X} (hs:MeasurableSet s) (ht:MeasurableSet t) + (hst:s⊆t) (u:Lp ℂ 2 μ) : ‖cutL2 s hs u‖≤‖cutL2 t ht u‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [cutL2_ae s hs u,cutL2_ae t ht u] with x hx hy + rw [hx,hy] + by_cases h:x∈s + · simp [h,hst h] + · simp [h] +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology FourierTransform BigOperators ContDiff +noncomputable section +namespace Coulomb +variable {ι:Type*} [Fintype ι] [DecidableEq ι] +lemma l2_gradient_fourier_moment + (u:Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (d:ι → Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (hw:∀ i (φ:EuclideanSpace ℝ ι → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x (EuclideanSpace.single i 1):ℂ)*u x)=-(∫ x,(φ x:ℂ)*d i x)) : + Integrable (fun ξ => (2*Real.pi)^2*‖ξ‖^2*‖(𝓕 u:Lp ℂ 2 volume) ξ‖^2) ∧ + (∫ ξ,(2*Real.pi)^2*‖ξ‖^2*‖(𝓕 u:Lp ℂ 2 volume) ξ‖^2)=∑ i,‖d i‖^2 := by + have H i := l2_weakDeriv_fourier_energy (EuclideanSpace.single i 1) (hw i) + have he (ξ:EuclideanSpace ℝ ι) : + (∑ i,(2*Real.pi*inner ℝ ξ (EuclideanSpace.single i 1))^2*‖(𝓕 u:Lp ℂ 2 volume) ξ‖^2)= + (2*Real.pi)^2*‖ξ‖^2*‖(𝓕 u:Lp ℂ 2 volume) ξ‖^2 := by + simp only [EuclideanSpace.inner_single_right,conj_trivial,one_mul,mul_pow] + rw [←Finset.sum_mul,←Finset.mul_sum,←EuclideanSpace.real_norm_sq_eq] + have hi := integrable_finsetSum Finset.univ (fun i _ => (H i).1) + refine ⟨hi.congr (Filter.Eventually.of_forall he),?_⟩ + rw [←integral_congr_ae (Filter.Eventually.of_forall he),integral_finsetSum _ (fun i _ => (H i).1)] + exact Finset.sum_congr rfl (fun i _ => (H i).2) + +lemma l2_fourier_tail_bound + (u:Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (d:ι → Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (hw:∀ i (φ:EuclideanSpace ℝ ι → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x (EuclideanSpace.single i 1):ℂ)*u x)=-(∫ x,(φ x:ℂ)*d i x)) + {R:ℝ} (hR:0 by positivity) + · filter_upwards [ae_restrict_mem measurableSet_ball.compl] with ξ hξ + have hξR : R≤‖ξ‖ := by simpa [Metric.mem_ball,dist_zero_right,not_lt] using hξ + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hR.le hξR 2) (sq_nonneg _)) (sq_nonneg _) + +lemma bounded_gradient_frequency_tight + (u:ℕ → Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (d:ℕ → ι → Lp ℂ 2 (volume:Measure (EuclideanSpace ℝ ι))) + (hw:∀ n i (φ:EuclideanSpace ℝ ι → ℝ),ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x (EuclideanSpace.single i 1):ℂ)*u n x)=-(∫ x,(φ x:ℂ)*d n i x)) + (K:ℝ) (hK:∀ n,∑ i,‖d n i‖^2≤K) (ε:ℝ) (hε:0<ε) : + ∃ R:ℝ,0 sq_nonneg ‖d 0 i‖).trans (hK 0) + let R:ℝ := (Real.sqrt K+1)/(2*Real.pi*ε) + have hR:0.mpr hp + nlinarith +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakHilbertCompact.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakHilbertCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..69084fd144b3fd96e51afbdc2ed8405225cf8043 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakHilbertCompact.lean @@ -0,0 +1,94 @@ +import Mathlib + +namespace OAI + +section +open Filter Set +open scoped Topology ComplexConjugate +noncomputable section +namespace Coulomb +variable {H:Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [TopologicalSpace.SeparableSpace H] + +lemma bounded_hilbert_weak_subsequence (u:ℕ → H) (C:ℝ) (hb:∀ n,‖u n‖≤C) : + ∃ v:H, ‖v‖≤C ∧ ∃ φ:ℕ → ℕ,StrictMono φ ∧ + ∀ w:H,Tendsto (fun n => inner ℂ w (u (φ n))) atTop (𝓝 (inner ℂ w v)) := by + let F : ℕ → WeakDual ℂ H := fun n => StrongDual.toWeakDual (InnerProductSpace.toDual ℂ H (u n)) + have hm (n:ℕ) : F n ∈ WeakDual.toStrongDual ⁻¹' Metric.closedBall (0:StrongDual ℂ H) C := by + change dist (WeakDual.toStrongDual (StrongDual.toWeakDual (InnerProductSpace.toDual ℂ H (u n)))) 0 ≤ C + have hh (g:StrongDual ℂ H) : WeakDual.toStrongDual (StrongDual.toWeakDual g)=g := by + ext x + rfl + rw [hh,dist_eq_norm] + change ‖InnerProductSpace.toDual ℂ H (u n)-0‖≤ C + simpa only [sub_zero,LinearIsometryEquiv.norm_map] using hb n + obtain ⟨f,hf,φ,hφ,ht⟩ := (WeakDual.isSeqCompact_closedBall (𝕜:=ℂ) (E:=H) 0 C) hm + let v:H := (InnerProductSpace.toDual ℂ H).symm (WeakDual.toStrongDual f) + refine ⟨v,?_,φ,hφ,?_⟩ + · simpa only [Set.mem_preimage,Metric.mem_closedBall,dist_zero_right, + ←(InnerProductSpace.toDual ℂ H).symm.norm_map] using hf + · intro w + have h := (WeakBilin.eval_continuous _ w).tendsto f |>.comp ht + have he : WeakDual.toStrongDual f w=inner ℂ v w := by + rw [←InnerProductSpace.toDual_apply_apply] + exact congrArg (fun g:StrongDual ℂ H => g w) + ((InnerProductSpace.toDual ℂ H).apply_symm_apply _).symm + change Tendsto (fun n => inner ℂ (u (φ n)) w) atTop (𝓝 (WeakDual.toStrongDual f w)) at h + rw [he] at h + simpa only [Function.comp_def,inner_conj_symm] using (Complex.continuous_conj.tendsto _).comp h +end Coulomb +end + +end +section +open Filter Set +open scoped Topology ComplexConjugate BigOperators +noncomputable section +namespace Coulomb +variable {H:Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [TopologicalSpace.SeparableSpace H] +variable {ι:Type*} [Fintype ι] [DecidableEq ι] +lemma bounded_finite_hilbert_weak_subsequence (u:ℕ → ι → H) (K:ℝ) + (hb:∀ n,∑ i,‖u n i‖^2≤K) : + ∃ v:ι → H,(∑ i,‖v i‖^2)≤K ∧ ∃ φ:ℕ → ℕ,StrictMono φ ∧ + ∀ i w,Tendsto (fun n => inner ℂ w (u (φ n) i)) atTop (𝓝 (inner ℂ w (v i))) := by + let U:ℕ → PiLp 2 (fun _:ι => H) := fun n => WithLp.toLp 2 (u n) + have hK:0≤K := (Finset.sum_nonneg fun i _ => sq_nonneg ‖u 0 i‖).trans (hb 0) + have hU (n:ℕ) : ‖U n‖≤Real.sqrt K := by + apply (sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mp + rw [Real.sq_sqrt hK,PiLp.norm_sq_eq_of_L2] + exact hb n + obtain ⟨v,hv,φ,hφ,hw⟩ := bounded_hilbert_weak_subsequence U (Real.sqrt K) hU + refine ⟨fun i => v i,?_,φ,hφ,?_⟩ + · rw [←PiLp.norm_sq_eq_of_L2 (fun _:ι => H) v] + exact (pow_le_pow_left₀ (norm_nonneg _) hv 2).trans_eq (Real.sq_sqrt hK) + · intro i w + have h := hw (PiLp.single 2 i w) + have he (z:PiLp 2 (fun _:ι => H)) : inner ℂ (PiLp.single 2 i w) z = inner ℂ w (z i) := by + simp only [PiLp.inner_apply,PiLp.single_apply] + rw [Finset.sum_eq_single i] + · simp + · intro j _ hji; simp [hji] + · simp + simpa only [he,U,WithLp.toLp_ofLp] using h + +omit [CompleteSpace H] [TopologicalSpace.SeparableSpace H] in +lemma weak_tendsto_norm_le {u:ℕ → H} {v:H} {C:ℝ} (hC:0≤C) + (hw:∀ w,Tendsto (fun n => inner ℂ w (u n)) atTop (𝓝 (inner ℂ w v))) + (hb:∀ᶠ n in atTop,‖u n‖≤C) : ‖v‖≤C := by + have h := (hw v).norm + have hh : ∀ᶠ n in atTop,‖inner ℂ v (u n)‖≤‖v‖*C := by + filter_upwards [hb] with n hn + exact (norm_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_left hn (norm_nonneg _)) + have H := le_of_tendsto h hh + rw [← inner_self_re_eq_norm, ← norm_sq_eq_re_inner] at H + by_cases hv:‖v‖=0 + · rwa [hv] + · have hp:0<‖v‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hv) + nlinarith +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakSchwartzDerivative.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakSchwartzDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..d0b95feb12323abd9cdaa0fcfecf4db9731432c0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/WeakSchwartzDerivative.lean @@ -0,0 +1,198 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +section +end +end +section +open MeasureTheory Filter Set +open scoped BigOperators ENNReal NNReal Topology SchwartzMap LineDeriv FourierTransform ComplexConjugate ContDiff +noncomputable section +namespace Coulomb +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + +private lemma compact_mul_memLp_integrable (f:E → ℂ) (hf:Continuous f) + (hc:HasCompactSupport f) (u:E → ℂ) (hu:MemLp u 2 volume) : + Integrable (fun x => f x*u x) := + (hf.memLp_of_hasCompactSupport hc (p:=2)).integrable_mul hu +private lemma compact_complex_integral_decompose (f:E → ℂ) (hf:Continuous f) + (hc:HasCompactSupport f) (u:E → ℂ) (hu:MemLp u 2 volume) : + (∫ x,f x*u x)=(∫ x,((f x).re:ℂ)*u x)+Complex.I*(∫ x,((f x).im:ℂ)*u x) := by + have hr := compact_mul_memLp_integrable _ + (Complex.continuous_ofReal.comp (Complex.continuous_re.comp hf)) + (hc.comp_left (g:= fun z:ℂ => (z.re:ℂ)) (by simp)) u hu + have hi := compact_mul_memLp_integrable _ + (Complex.continuous_ofReal.comp (Complex.continuous_im.comp hf)) + (hc.comp_left (g:= fun z:ℂ => (z.im:ℂ)) (by simp)) u hu + have he (x:E) : f x*u x=((f x).re:ℂ)*u x+Complex.I*(((f x).im:ℂ)*u x) := by + conv_lhs => rw [←(f x).re_add_im] + ring + simp_rw [he] + change Integrable (fun x => ((f x).re:ℂ)*u x) at hr + change Integrable (fun x => ((f x).im:ℂ)*u x) at hi + rw [integral_add hr (hi.const_mul _),integral_const_mul] + +lemma weak_directional_complex_test {u d : E → ℂ} (hu : MemLp u 2 volume) + (hd : MemLp d 2 volume) (a : E) + (hw : ∀ φ : E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u x)=-(∫ x,(φ x:ℂ)*d x)) + (φ : E → ℂ) (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + (∫ x,fderiv ℝ φ x a*u x)=-(∫ x,φ x*d x) := by + have hr := hw (fun x => (φ x).re) (Complex.reCLM.contDiff.comp hφ) (hc.comp_left rfl) + have hi := hw (fun x => (φ x).im) (Complex.imCLM.contDiff.comp hφ) (hc.comp_left rfl) + have hdr (x:E) : fderiv ℝ (fun y => (φ y).re) x a=(fderiv ℝ φ x a).re := by + exact congrArg (fun L:E →L[ℝ] ℝ => L a) ((Complex.reCLM.hasFDerivAt.comp x ((hφ.differentiable (by simp)) x).hasFDerivAt).fderiv) + have hdi (x:E) : fderiv ℝ (fun y => (φ y).im) x a=(fderiv ℝ φ x a).im := by + exact congrArg (fun L:E →L[ℝ] ℝ => L a) ((Complex.imCLM.hasFDerivAt.comp x ((hφ.differentiable (by simp)) x).hasFDerivAt).fderiv) + have hD : Continuous (fun x => fderiv ℝ φ x a) := + (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + rw [compact_complex_integral_decompose _ hD (hc.fderiv_apply ℝ a) u hu, + compact_complex_integral_decompose _ hφ.continuous hc d hd] + simp only [hdr] at hr + simp only [hdi] at hi + rw [hr,hi] + ring + +section +omit [MeasurableSpace E] [BorelSpace E] + +private def weakCutBump : ContDiffBump (0:E) := ⟨1,2,by norm_num,by norm_num⟩ +private def weakCut (k:ℕ) (x:E) : ℝ := (weakCutBump (E:=E)) (((k:ℝ)+1)⁻¹ • x) +private lemma weakCut_smooth (k:ℕ) : ContDiff ℝ ∞ (weakCut (E:=E) k) := + (weakCutBump (E:=E)).contDiff.comp (contDiff_const.smul contDiff_id) +private lemma weakCut_compact (k:ℕ) : HasCompactSupport (weakCut (E:=E) k) := by + exact (weakCutBump (E:=E)).hasCompactSupport.comp_homeomorph + (Homeomorph.smul (Units.mk0 (((k:ℝ)+1)⁻¹) (by positivity))) +private lemma weakCut_fderiv (k:ℕ) (x a:E) : + fderiv ℝ (weakCut k) x a=((k:ℝ)+1)⁻¹*fderiv ℝ (weakCutBump (E:=E)) (((k:ℝ)+1)⁻¹ • x) a := by + have h := (((weakCutBump (E:=E)).contDiff (n:=⊤)).differentiable (by simp) _).hasFDerivAt.comp x + ((hasFDerivAt_id (𝕜:=ℝ) x).const_smul (((k:ℝ)+1)⁻¹)) + have HH := congrArg (fun L:E →L[ℝ] ℝ => L a) h.fderiv + unfold weakCut + simpa only [Function.comp_def,Pi.smul_apply,id_eq,ContinuousLinearMap.comp_apply,smul_apply,ContinuousLinearMap.id_apply,map_smul,smul_eq_mul] using HH +private lemma weakCut_bound : ∃ C:ℝ,0 ≤ C ∧ ∀ k x a, + |fderiv ℝ (weakCut (E:=E) k) x a| ≤ ((k:ℝ)+1)⁻¹*C*‖a‖ := by + obtain ⟨C,hC⟩ := (((weakCutBump (E:=E)).contDiff (n:=⊤)).continuous_fderiv (by simp)).bounded_above_of_compact_support + ((weakCutBump (E:=E)).hasCompactSupport.fderiv ℝ) + refine ⟨C,(norm_nonneg _).trans (hC 0),?_⟩ + intro k x a + rw [weakCut_fderiv,abs_mul,abs_of_pos (by positivity : (0:ℝ)<((k:ℝ)+1)⁻¹)] + calc + _ ≤ ((k:ℝ)+1)⁻¹*(C*‖a‖) := mul_le_mul_of_nonneg_left + (((fderiv ℝ (weakCutBump (E:=E)) _).le_opNorm a).trans (mul_le_mul_of_nonneg_right (hC _) (norm_nonneg _))) (by positivity) + _ = _ := by ring +private lemma weakCut_tendsto (x:E) : Tendsto (fun k => weakCut k x) atTop (𝓝 1) := by + have ht : Tendsto (fun k:ℕ => ((k:ℝ)+1)⁻¹ • x) atTop (𝓝 (0:E)) := by + have hi : Tendsto (fun k:ℕ => ((k:ℝ)+1)⁻¹) atTop (𝓝 (0:ℝ)) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.atTop_add tendsto_const_nhds) + simpa using hi.smul_const x + have H := ((weakCutBump (E:=E)).continuous.tendsto (0:E)).comp ht + have h1 : (weakCutBump (E:=E)) (0:E)=1 := + (weakCutBump (E:=E)).one_of_mem_closedBall (by simp [weakCutBump]) + simpa only [weakCut,Function.comp_def,h1] using H + +end + +lemma weak_directional_schwartz_test {u d : E → ℂ} (hu : MemLp u 2 volume) + (hd : MemLp d 2 volume) (a : E) + (hw : ∀ φ : E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u x)=-(∫ x,(φ x:ℂ)*d x)) + (Φ : 𝓢(E,ℂ)) : + (∫ x,(∂_{a} Φ) x*u x)=-(∫ x,Φ x*d x) := by + obtain ⟨C,hC,hb⟩ := weakCut_bound (E:=E) + have hinv (k:ℕ) : ((k:ℝ)+1)⁻¹ ≤ 1 := inv_le_one_of_one_le₀ (by have := Nat.cast_nonneg (α:=ℝ) k; linarith) + have hi0 : Tendsto (fun k:ℕ => ((k:ℝ)+1)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.atTop_add tendsto_const_nhds) + have hdt (x:E) : Tendsto (fun k => fderiv ℝ (weakCut k) x a) atTop (𝓝 0) := by + apply squeeze_zero_norm (fun k => hb k x a) + simpa using (hi0.mul_const C).mul_const ‖a‖ + have hc0 (k:ℕ) (x:E) : 0 ≤ weakCut k x := (weakCutBump (E:=E)).nonneg + have hc1 (k:ℕ) (x:E) : weakCut k x ≤ 1 := (weakCutBump (E:=E)).le_one + let F : ℕ → E → ℂ := fun k x => + ((fderiv ℝ (weakCut k) x a:ℂ)*Φ x+(weakCut k x:ℂ)*(∂_{a} Φ) x)*u x + let G : ℕ → E → ℂ := fun k x => (weakCut k x:ℂ)*Φ x*d x + have he (k:ℕ) : (∫ x,F k x)=-(∫ x,G k x) := by + let φ : E → ℂ := fun x => (weakCut k x:ℂ)*Φ x + have hφ : ContDiff ℝ ∞ φ := + (Complex.ofRealCLM.contDiff.comp (weakCut_smooth k)).mul (Φ.smooth ⊤) + have hf (x:E) : fderiv ℝ φ x a = + (fderiv ℝ (weakCut k) x a:ℂ)*Φ x+(weakCut k x:ℂ)*(∂_{a} Φ) x := by + have H := (((Complex.ofRealCLM.hasFDerivAt.comp x + ((weakCut_smooth k).differentiable (by simp) x).hasFDerivAt)).mul (Φ.hasFDerivAt x)).fderiv + have HH := congrArg (fun L:E →L[ℝ] ℂ => L a) H + have HH2 : fderiv ℝ φ x a = (weakCut k x:ℂ)*fderiv ℝ Φ x a+Φ x*(fderiv ℝ (weakCut k) x a:ℂ) := by + simpa only [φ,Pi.mul_def,Pi.mul_apply,Function.comp_def,add_apply,smul_apply,ContinuousLinearMap.comp_apply,Complex.ofRealCLM_apply,smul_eq_mul] using HH + rw [SchwartzMap.lineDerivOp_apply_eq_fderiv,HH2] + ring + have H := weak_directional_complex_test hu hd a hw φ hφ + (((weakCut_compact k).comp_left (by simp : ((0:ℝ):ℂ)=0)).mul_right) + simpa only [hf,φ,F,G] using H + have hφu : Integrable (fun x => ‖Φ x‖*‖u x‖) := + ((Φ.memLp 2 volume).norm).integrable_mul hu.norm + have hdu : Integrable (fun x => ‖(∂_{a} Φ) x‖*‖u x‖) := + (((∂_{a} Φ).memLp 2 volume).norm).integrable_mul hu.norm + have hφd : Integrable (fun x => ‖Φ x‖*‖d x‖) := + ((Φ.memLp 2 volume).norm).integrable_mul hd.norm + have hFm (k:ℕ) : AEStronglyMeasurable (F k) volume := by + exact (((Complex.continuous_ofReal.comp + (((weakCut_smooth k).continuous_fderiv (by simp)).clm_apply (continuous_const (y:=a)))).mul Φ.continuous).add + ((Complex.continuous_ofReal.comp (weakCut_smooth k).continuous).mul + (∂_{a} Φ).continuous)).aestronglyMeasurable.mul hu.aestronglyMeasurable + have hF : Tendsto (fun k => ∫ x,F k x) atTop (𝓝 (∫ x,(∂_{a} Φ) x*u x)) := by + apply tendsto_integral_of_dominated_convergence + (fun x => C*‖a‖*(‖Φ x‖*‖u x‖)+‖(∂_{a} Φ) x‖*‖u x‖) + hFm ((hφu.const_mul _).add hdu) + · intro k + filter_upwards [] with x + dsimp [F] + rw [norm_mul] + have H1 : ‖(fderiv ℝ (weakCut k) x a:ℂ)‖ ≤ C*‖a‖ := by + rw [Complex.norm_real,Real.norm_eq_abs] + exact (hb k x a).trans (by nlinarith [mul_nonneg hC (norm_nonneg a),hinv k]) + have H2 : ‖(weakCut k x:ℂ)‖ ≤ 1 := by + simpa only [Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hc0 k x)] using hc1 k x + calc + _ ≤ (‖(fderiv ℝ (weakCut k) x a:ℂ)‖*‖Φ x‖+ + ‖(weakCut k x:ℂ)‖*‖(∂_{a} Φ) x‖)*‖u x‖ := by + have HH := norm_add_le ((fderiv ℝ (weakCut k) x a:ℂ)*Φ x) ((weakCut k x:ℂ)*(∂_{a} Φ) x) + simpa only [norm_mul] using mul_le_mul_of_nonneg_right HH (norm_nonneg (u x)) + _ ≤ (C*‖a‖*‖Φ x‖+1*‖(∂_{a} Φ) x‖)*‖u x‖ := + mul_le_mul_of_nonneg_right (add_le_add (mul_le_mul_of_nonneg_right H1 (norm_nonneg _)) + (mul_le_mul_of_nonneg_right H2 (norm_nonneg _))) (norm_nonneg _) + _ = _ := by ring + · filter_upwards [] with x + have H := (((Complex.continuous_ofReal.tendsto 0).comp (hdt x)).mul_const (Φ x)).add + (((Complex.continuous_ofReal.tendsto 1).comp (weakCut_tendsto x)).mul_const ((∂_{a} Φ) x)) + simpa only [F,Complex.ofReal_zero,zero_mul,Complex.ofReal_one,one_mul,zero_add,Function.comp_apply] using H.mul_const (u x) + have hG : Tendsto (fun k => ∫ x,G k x) atTop (𝓝 (∫ x,Φ x*d x)) := by + apply tendsto_integral_of_dominated_convergence (fun x => ‖Φ x‖*‖d x‖) + (fun k => (((Complex.continuous_ofReal.comp (weakCut_smooth k).continuous).mul + Φ.continuous).aestronglyMeasurable.mul hd.aestronglyMeasurable)) hφd + · intro k + filter_upwards [] with x + dsimp [G] + rw [norm_mul,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hc0 k x)] + nlinarith [hc1 k x,norm_nonneg (Φ x),norm_nonneg (d x),mul_nonneg (norm_nonneg (Φ x)) (norm_nonneg (d x))] + · filter_upwards [] with x + simpa only [G,Complex.ofReal_one,one_mul,Function.comp_apply,Pi.mul_apply] using + (((Complex.continuous_ofReal.tendsto 1).comp (weakCut_tendsto x)).mul_const (Φ x)).mul_const (d x) + exact tendsto_nhds_unique hF (by simpa only [he] using hG.neg) + +lemma l2_weakDeriv_tempered {u d : Lp ℂ 2 (volume:Measure E)} (a:E) + (hw : ∀ φ : E → ℝ,ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,(fderiv ℝ φ x a:ℂ)*u x)=-(∫ x,(φ x:ℂ)*d x)) : + ∂_{a} (u:𝓢'(E,ℂ))=(d:𝓢'(E,ℂ)) := by + ext Φ + simp only [TemperedDistribution.lineDerivOp_apply_apply,map_neg,Lp.toTemperedDistribution_apply,smul_eq_mul] + have H := weak_directional_schwartz_test (Lp.memLp u) (Lp.memLp d) a hw Φ + simpa only [neg_neg] using congrArg Neg.neg H +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/FormDomain/WindowSquare.lean b/lean/OAI/Analysis/CoulombRadii/FormDomain/WindowSquare.lean new file mode 100644 index 0000000000000000000000000000000000000000..1144e6c2f8c61215bb502a9b96a158b587463bd0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/FormDomain/WindowSquare.lean @@ -0,0 +1,45 @@ +import Mathlib + +namespace OAI + +section +section +open Set +open scoped SchwartzMap +noncomputable section +namespace NeutralAtom +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +theorem schwartz_square_bounded_lipschitz (g : 𝓢(E,ℝ)) : + ∃ B L : ℝ, 0 ≤ B ∧ 0 ≤ L ∧ (∀ x, |g x^2| ≤ B) ∧ + (∀ x v, |g x^2-g v^2| ≤ L*‖x-v‖) := by + let M := SchwartzMap.seminorm ℝ 0 0 g + let D := SchwartzMap.seminorm ℝ 0 0 (SchwartzMap.fderivCLM ℝ E ℝ g) + have hM : 0 ≤ M := apply_nonneg _ _ + have hD : 0 ≤ D := apply_nonneg _ _ + have hm (x : E) : |g x| ≤ M := by simpa only [Real.norm_eq_abs] using g.norm_le_seminorm ℝ x + have hd (x : E) : ‖fderiv ℝ g x‖ ≤ D := + (SchwartzMap.fderivCLM ℝ E ℝ g).norm_le_seminorm ℝ x + have hl (x v : E) : |g x-g v| ≤ D*‖x-v‖ := by + have hh := Convex.norm_image_sub_le_of_norm_hasFDerivWithin_le + (f := (g : E → ℝ)) (f' := fderiv ℝ g) + (fun z (_ : z∈(univ : Set E)) => (g.hasFDerivAt z).hasFDerivWithinAt) + (fun z _ => hd z) (convex_univ : Convex ℝ (univ : Set E)) (mem_univ v) (mem_univ x) + simpa only [Real.norm_eq_abs] using hh + refine ⟨M^2,2*M*D,sq_nonneg _,mul_nonneg (mul_nonneg (by norm_num) hM) hD,?_,?_⟩ + · intro x + rw [abs_pow] + exact pow_le_pow_left₀ (abs_nonneg _) (hm x) 2 + · intro x v + have hsum : |g x+g v| ≤ 2*M := (abs_add_le _ _).trans (by linarith [hm x,hm v]) + rw [show g x^2-g v^2=(g x-g v)*(g x+g v) by ring,abs_mul] + calc + _ ≤ (D*‖x-v‖)*(2*M) := mul_le_mul (hl x v) hsum (abs_nonneg _) (mul_nonneg hD (norm_nonneg _)) + _ = _ := by ring +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/LimitTheory/AdmissibleStage.lean b/lean/OAI/Analysis/CoulombRadii/LimitTheory/AdmissibleStage.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2253afb8d3394b4207e30b39fa7f52a40bd9f7c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/LimitTheory/AdmissibleStage.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.TailFinish + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom + +theorem admissible_profile_stages {Zbar : ℝ → ℕ} {s : ℕ → ℝ} {N : ℕ → ℕ} + (had : Admissible Zbar s N) (ε : ℝ) (Cq sq : ℕ → ℝ) (hsq : ∀ k,0 < sq k) : + ∃ k : ℕ → ℕ,Tendsto k atTop atTop ∧ ∀ᶠ n in atTop, + 0 < s n ∧ s n < sq (k n) ∧ Zbar (s n) ≤ N n+1 ∧ + Cq (k n)*s n^25 ≤ (((k n+2:ℕ):ℝ))⁻¹ ∧ + initialAtomicRadius ε ((N n+1:ℕ):ℝ)/s n ≤ (((k n+2:ℕ):ℝ))⁻¹ := by + have hc : Tendsto (fun n => initialAtomicRadius ε ((N n+1:ℕ):ℝ)/s n) atTop (𝓝 0) := by + simpa only [initialAtomicRadius,Nat.cast_add,Nat.cast_one] using nuclear_clamp_tendsto + (Eventually.of_forall (fun n => (by positivity : (0:ℝ)<(N n+1:ℝ)))) had.1 had.2.2.2 ε + apply slow_stages (P:=fun k n => + 0 < s n ∧ s n < sq k ∧ Zbar (s n) ≤ N n+1 ∧ + Cq k*s n^25 ≤ (((k+2:ℕ):ℝ))⁻¹ ∧ + initialAtomicRadius ε ((N n+1:ℕ):ℝ)/s n ≤ (((k+2:ℕ):ℝ))⁻¹) + intro k + have HK : 0 < (((k+2:ℕ):ℝ))⁻¹ := by positivity + have Hp : Tendsto (fun n => Cq k*s n^25) atTop (𝓝 0) := by simpa using (had.2.1.pow 25).const_mul (Cq k) + filter_upwards [had.1,had.2.1.eventually_lt_const (hsq k),had.2.2.1, + Hp.eventually_lt_const HK,hc.eventually_lt_const HK] with n hs hsq hZ hp hc + exact ⟨hs,hsq,hZ,hp.le,hc.le⟩ + +lemma shifted_stage_tendsto {k : ℕ → ℕ} (hk : Tendsto k atTop atTop) (K : ℕ) : + Tendsto (fun n => k (n+K)+2) atTop atTop := by + exact (tendsto_add_atTop_nat 2).comp (hk.comp (tendsto_add_atTop_nat K)) +end NeutralAtom +end + +end +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom + +theorem physical_expected_exterior_asymptotic : ∃ Zbar : ℝ → ℕ,ExpectedExteriorAsymptotic Zbar := by + obtain ⟨ε,B,C,L,M,hε,hB,hM,Zbar,Hdata⟩ := physical_profile_constants + have HG := fun k : ℕ => Hdata ((k+2:ℕ):ℝ) (by exact_mod_cast (show 2 ≤ k+2 by omega)) + choose Cq hCq sq hsq HD using HG + refine ⟨Zbar,?_⟩ + intro s N had ψ hψ a ha + let : ∀ n,IsProbabilityMeasure (rawLaw (ψ n)) := fun n => + rawLaw_isProbability (hψ n).choose_spec.1.2.2.1 (hψ n).choose_spec.2.1 + obtain ⟨k,hk,hgood⟩ := admissible_profile_stages had ε Cq sq hsq + obtain ⟨K,hK⟩ := eventually_atTop.mp hgood + have Hstage (n : ℕ) := hK (n+K) (Nat.le_add_left K n) + let s' := fun n => s (n+K) + let N' := fun n => N (n+K) + let ψ' := fun n => ψ (n+K) + let q := fun n => k (n+K)+2 + let Cq' := fun n => Cq (k (n+K)) + have hsp : ∀ n,0 < s' n := fun n => (Hstage n).1 + have hs : Tendsto s' atTop (𝓝 0) := had.2.1.comp (tendsto_add_atTop_nat K) + have hz : Tendsto (fun n => N' n+1) atTop atTop := had.charge_tendsto.comp (tendsto_add_atTop_nat K) + have hq : Tendsto q atTop atTop := shifted_stage_tendsto hk K + have hpr : ∀ n,0 < initialAtomicRadius ε ((N' n+1:ℕ):ℝ) := + fun n => initialAtomicRadius_pos hε (by positivity) + have hr : Tendsto (fun n => initialAtomicRadius ε ((N' n+1:ℕ):ℝ)/s' n) atTop (𝓝 0) := by + have HR : Tendsto (fun n => initialAtomicRadius ε ((N n+1:ℕ):ℝ)/s n) atTop (𝓝 0) := by + simpa only [initialAtomicRadius,Nat.cast_add,Nat.cast_one] using nuclear_clamp_tendsto + (Eventually.of_forall (fun n => (by positivity : (0:ℝ)<(N n+1:ℝ)))) had.1 had.2.2.2 ε + exact HR.comp (tendsto_add_atTop_nat K) + have hdn (n : ℕ) : Nonempty (QuantumProfileDatum (ψ' n) ε B C L M (s' n) (q n:ℝ) (Cq' n)) := + HD (k (n+K)) (ψ (n+K)) (hψ (n+K)) (s (n+K)) (Hstage n).1 (Hstage n).2.1 + (Hstage n).2.2.1 (Hstage n).2.2.2.2 + let d := fun n => Classical.choice (hdn n) + have hp : ∀ n,Cq' n*s' n^25 ≤ (q n:ℝ)⁻¹ := fun n => (Hstage n).2.2.2.1 + have hpacket (a b : ℝ) (ha : 0 < a) (hab : a < b) := quantum_profile_packet_limit + N' ψ' (fun n => hψ (n+K)) hε hB hM s' hsp hs hz hr q hq Cq' d hp ha hab + have hann (a b : ℝ) (ha : 0 < a) (hab : a < b) := expected_raw_annulus_of_packets + (fun n => N' n+1) (fun n => rawLaw (ψ' n)) Coulomb.unitWindow Coulomb.unitWindow.continuous + Coulomb.unitWindow_mass Coulomb.unitWindow_support (by norm_num : (0:ℝ)<1) ha hab + (Eventually.of_forall hsp) (Eventually.of_forall hpr) hs hr hpacket + have htail := expected_exterior_of_raw_annuli physical_uniform_count_control s' N' ψ' + (fun n => hψ (n+K)) hsp hs hz hann ha + apply (tendsto_add_atTop_iff_nat K).mp + simpa only [s',N',ψ',bTF_cube] using htail +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/LimitTheory/AtomicOutKinetic.lean b/lean/OAI/Analysis/CoulombRadii/LimitTheory/AtomicOutKinetic.lean new file mode 100644 index 0000000000000000000000000000000000000000..91bae9d5740d3e53a08f49168df5cb0029c67505 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/LimitTheory/AtomicOutKinetic.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.AtomicPatchCap +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma slice_core_form_ge_baseline {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + (ha : ∀ s, ∀ᵐ x, Antisymmetric (u.coreSlice s x)) + {E : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) : + E*mass u≤ sliceExpectation u (fun s x => form S (u.coreSlice s x).normalized) := by + rw [←sliceExpectation_number u E] + apply Finset.sum_le_sum + intro s _ + apply integral_mono_ae + (by simpa only [mul_comm (mass _) E] using (mass_coreSlice_integrable u s).const_mul E) + (normalized_coreForm_weight_integrable S u s) + filter_upwards [ha s] with x hx + by_cases hz : mass (u.coreSlice s x)=0 + · simp [hz] + · have hp := lt_of_le_of_ne (mass_nonneg (u.coreSlice s x)) (Ne.symm hz) + apply mul_le_mul_of_nonneg_left _ hp.le + exact EReal.coe_le_coe_iff.mp (hE.trans + (unrestrictedFormBottom_le_trial S _ hx.normalized (mass_normalized _ hp))) + +theorem atomic_outerKinetic_le {J m k : ℕ} (S : Nuclei J) + (hatom : ∀ j,S.position j=0) (u : H1Vector (m+k)) + (ha : ∀ s, ∀ᵐ x, Antisymmetric (u.coreSlice s x)) + {y : Space} (hy : y≠0) + (hs : PartlySupported u (outIndexSet m k) (Metric.closedBall y (80*atomicCellScale y))) + {E : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) : + outerKinetic u≤form S u-E*mass u+ + (atomicCellScale y/2)*sliceExpectation u (fun s x => (atomicPatchCap S (u.coreSlice s x).normalized x y)^2)+ + (m:ℝ)^2/(2*atomicCellScale y)*mass u := by + let a := atomicCellScale y + have hapos : 0 (atomicPatchCap S (u.coreSlice s x).normalized x y)^2)+ + (m:ℝ)^2/(2*a)*mass u)≤ + sliceExpectation u (fun s x => pairPotential x-∑ i : Fin m,coreScreenedField S (u.coreSlice s x).normalized (position x i)) := by + rw [←sliceExpectation_number u ((m:ℝ)^2/(2*a))] + unfold sliceExpectation + rw [Finset.mul_sum,←Finset.sum_add_distrib,←Finset.sum_neg_distrib] + apply Finset.sum_le_sum + intro s _ + rw [←integral_const_mul,←integral_add ((atomicPatchCap_weight_integrable S hatom u s hy).const_mul (a/2)) + ((mass_coreSlice_integrable u s).mul_const _),←integral_neg] + apply integral_mono_ae + (((atomicPatchCap_weight_integrable S hatom u s hy).const_mul (a/2)).add + ((mass_coreSlice_integrable u s).mul_const _)).neg + (conditionalOutCost_weight_integrable S u s) + filter_upwards [hs.recorded_positions s] with x hx + by_cases hz : mass (u.coreSlice s x)=0 + · simp [hz] + · have hfield : (∑ i : Fin m,coreScreenedField S (u.coreSlice s x).normalized (position x i))≤ + (m:ℝ)*atomicPatchCap S (u.coreSlice s x).normalized x y := by + calc + _≤∑ _i : Fin m,atomicPatchCap S (u.coreSlice s x).normalized x y := by + apply Finset.sum_le_sum + intro i _ + apply coreField_le_atomicPatchCap S hatom _ x hy + simpa only [Metric.mem_closedBall,dist_eq_norm] using hx hz i + _=_ := by simp + have hsq := sq_nonneg (a*atomicPatchCap S (u.coreSlice s x).normalized x y-(m:ℝ)) + have hyoung : (m:ℝ)*atomicPatchCap S (u.coreSlice s x).normalized x y≤ + (a/2)*(atomicPatchCap S (u.coreSlice s x).normalized x y)^2+(m:ℝ)^2/(2*a) := by + apply (mul_le_mul_iff_right₀ (show 0<2*a by positivity)).mp + have he : (m:ℝ)^2/(2*a)*(2*a)=(m:ℝ)^2 := div_mul_cancel₀ _ (by positivity) + nlinarith + have hh := mul_le_mul_of_nonneg_left (show -((a/2)*(atomicPatchCap S (u.coreSlice s x).normalized x y)^2+ + (m:ℝ)^2/(2*a))≤pairPotential x-∑ i : Fin m,coreScreenedField S (u.coreSlice s x).normalized (position x i) by + have hp : 0≤pairPotential x := by + unfold pairPotential + exact Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun j _ => by + split_ifs <;> simp [coulombKernel])) + linarith) (mass_nonneg (u.coreSlice s x)) + dsimp only [Pi.add_apply,Pi.neg_apply,Pi.mul_apply] + nlinarith + have hid := form_eq_conditionalOutCost S u + unfold conditionalOutCost at hid + change outerKinetic u≤form S u-E*mass u+(a/2)*_+(m:ℝ)^2/(2*a)*mass u + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/LimitTheory/NeutralBaseline.lean b/lean/OAI/Analysis/CoulombRadii/LimitTheory/NeutralBaseline.lean new file mode 100644 index 0000000000000000000000000000000000000000..a5502ac5e258be5ac98554f91dd6985e1e9faed8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/LimitTheory/NeutralBaseline.lean @@ -0,0 +1,67 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.SpectralTheory.GlobalSectorMinimum +import OAI.Analysis.CoulombRadii.Variational.PhysicalOffsetMean + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical +noncomputable section +namespace NeutralAtom + +theorem physical_uniform_predecessor_offset : ∃ D:ℝ,0≤D ∧ ∃ Zmin:ℕ, + ∀ Z:ℕ,Zmin≤Z → ∀ hZ:1≤Z, + (Coulomb.sectorFormBottom (Coulomb.atom Z hZ) (Z-1)).toReal ≤ + (Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)).toReal+D := by + obtain ⟨D,hD,Zmin,H⟩:=predecessor_bound_from_attained_physical_state + refine ⟨D,hD,Zmin,?_⟩ + intro Z hZm hZ + obtain ⟨n,hn,hnb,u,ha,hm,he⟩:=Coulomb.atom_global_sector_minimum Z hZ + obtain ⟨N,hN⟩:=Nat.exists_eq_add_of_le hn + have hn' : n=N+1 := by omega + clear hN + subst n + have hr:Coulomb.form (Coulomb.atom Z hZ) u= + (Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)).toReal := by + rw [←he,EReal.toReal_coe] + apply H Z hZm hZ (N:=N) (ψ:=fromH1Wave u) (g:=fromH1Gradient u) + (fromH1_domain u ha) ((fromH1_mass u).trans hm) + · intro χ g hd hnorm + rw [fromH1_energy Z hZ] + have HH:=Coulomb.unrestrictedFormBottom_le_trial (Coulomb.atom Z hZ) + (asH1 χ g hd.2.1 hd.2.2.1 hd.2.2.2.1) (asH1_antisymmetric hd) + ((asH1_mass ..).trans hnorm) + rw [←he,asH1_energy Z hZ] at HH + exact EReal.coe_le_coe_iff.mp HH + · exact (Coulomb.atom_unrestricted_bottom_real Z hZ u ha hm).le + · rw [fromH1_energy Z hZ,hr] + · exact_mod_cast hnb + +theorem physical_neutral_energy_offset : ∃ D:ℝ,0≤D ∧ ∃ Zmin:ℕ, + ∀ Z:ℕ,Zmin≤Z → ∀ hZ:1≤Z, + ∀ {ψ:Wavefunction Z} {g:Gradient Z},FormDomain ψ g → normSquared ψ=1 → + (∀ (χ:Wavefunction Z) (h:Gradient Z),FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) → + energy Z ψ g ≤ (Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)).toReal+D := by + obtain ⟨D,hD,Zmin,H⟩:=physical_uniform_predecessor_offset + refine ⟨D,hD,Zmin,?_⟩ + intro Z hZm hZ ψ g hd hn hmin + have he:(energy Z ψ g:EReal)=Coulomb.sectorFormBottom (Coulomb.atom Z hZ) Z := by + rw [←sectorEnergy_eq_formBottom Z hZ] + apply le_antisymm + · apply le_sInf + rintro e ⟨χ,h,hχ,hm,rfl⟩ + exact EReal.coe_le_coe_iff.mpr (hmin χ h hχ hm) + · exact sectorEnergy_le_trial hd hn + have hle:Coulomb.sectorFormBottom (Coulomb.atom Z hZ) Z ≤ + Coulomb.sectorFormBottom (Coulomb.atom Z hZ) (Z-1):= + Coulomb.atom_sectorFormBottom_antitone Z hZ (Nat.sub_le ..) + have hr:=Coulomb.atom_sectorFormBottom_real Z hZ (Z-1) + rw [←he,←hr] at hle + exact (EReal.coe_le_coe_iff.mp hle).trans (H Z hZm hZ) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/LimitTheory/NeutralCountControl.lean b/lean/OAI/Analysis/CoulombRadii/LimitTheory/NeutralCountControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..61ed89b5d07d9a6e4d38bf7db4278abcc12d9098 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/LimitTheory/NeutralCountControl.lean @@ -0,0 +1,146 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.NeutralBaseline + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical +noncomputable section +namespace NeutralAtom +lemma raw_second_expectation_asH1 {n:ℕ} {ψ:Wavefunction n} {g:Gradient n} + (hd:FormDomain ψ g) {S:Set Position} (hS:MeasurableSet S) : + rawExpectation ψ (fun x => (rawCount S x)^2)= + Coulomb.localCountSecondMoment (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) S := by + rw [rawExpectation_eq_stateWeightedIntegral hd.2.2.1 ((measurable_rawCount hS).pow_const 2) + (C:=(n:ℝ)^2) (fun x => by + rw [Real.norm_of_nonneg (sq_nonneg _)]; exact pow_le_pow_left₀ (rawCount_nonneg S x) (rawCount_le_number S x) 2)] + change stateWeightedIntegral ψ (fun x => (rawCount S x)^2)= + Coulomb.potentialForm (fun x => (Coulomb.localCount S x)^2) _ + simpa only [Coulomb.potentialForm,Coulomb.localCount,position_flattenConfiguration,rawCount] using + (asH1_potentialForm ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1 (fun x => (Coulomb.localCount S x)^2)).symm + +lemma physical_exterior_deficit {N:ℕ} {ψ:Wavefunction (N+1)} {g:Gradient (N+1)} + (hd:FormDomain ψ g) (hn:normSquared ψ=1) (r:ℝ) : + exteriorMass ψ r=(N+1:ℝ)-Coulomb.expectedPopulation (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) + (Metric.ball 0 r) := by + rw [←raw_population_asH1 hd measurableSet_ball,integral_rawLaw hd.2.2.1, + rawExpectation_count_eq_density hd.1 hd.2.2.1 measurableSet_ball] + have hb : ∫ x in Metric.closedBall (0:Position) r,density ψ x = ∫ x in Metric.ball (0:Position) r,density ψ x := by + apply setIntegral_congr_set + have hsphere : ∀ᵐ x : Position,x∉Metric.sphere (0:Position) r := by + rw [ae_iff] + convert Measure.addHaar_sphere volume (0:Position) r using 1 + congr 1 + ext x + simp + filter_upwards [hsphere] with x hx + simp only [Metric.mem_sphere,dist_zero_right] at hx + apply propext + constructor + · intro h + exact Metric.mem_ball.mpr (lt_of_le_of_ne (Metric.mem_closedBall.mp h) (by simpa using hx)) + · intro h + exact Metric.mem_closedBall.mpr (Metric.mem_ball.mp h).le + have H:=integral_add_compl measurableSet_closedBall (integrable_density hd.2.2.1) + (s:=Metric.closedBall (0:Position) r) + rw [integral_density hd.2.2.1,hn,mul_one,hb] at H + have he : (Metric.closedBall (0:Position) r)ᶜ={x:Position | r<‖x‖} := by ext x; simp + rw [he] at H + exact eq_sub_of_add_eq' H + + theorem physical_uniform_count_control : UniformGroundStateCountControl := by + obtain ⟨D,hD,Zmin,H⟩:=physical_neutral_energy_offset + refine ⟨D,Zmin,hD,?_,?_⟩ + · intro α β hα hαβ + obtain ⟨C,hC,HC⟩:=Coulomb.atomic_annular_second_moment hα hαβ + refine ⟨Real.sqrt C,Real.sqrt_nonneg _,?_⟩ + intro N ψ hNZ hψ u hu + obtain ⟨g,hd,hn,hmin⟩:=hψ + let v:=asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1 + have hm:Coulomb.mass v=1 := (asH1_mass ..).trans hn + have hz:1≤N+1:=by omega + have he:Coulomb.form (Coulomb.atom (N+1) hz) v≤ + (Coulomb.unrestrictedFormBottom (Coulomb.atom (N+1) hz)).toReal+D := by + rw [asH1_energy]; exact H (N+1) hNZ hz hd hn hmin + have hE:=Coulomb.atom_unrestricted_bottom_real (N+1) hz v (asH1_antisymmetric hd) hm + have HH:=HC (Coulomb.atom (N+1) hz) (fun _ => rfl) v (asH1_antisymmetric hd) hm hE.le he hD hu + rw [raw_second_expectation_asH1 hd (S:={y:Position | α*u<‖y‖ ∧ ‖y‖<β*u}) (measurableSet_lt measurable_const continuous_norm.measurable |>.inter + (measurableSet_lt continuous_norm.measurable measurable_const))] + apply (Real.sqrt_le_sqrt HH).trans_eq + rw [Real.sqrt_mul hC,Real.sqrt_sq (Coulomb.screenMass_pos D u).le] + rfl + · refine ⟨2*Coulomb.atomicInnerFieldConstant,mul_nonneg (by norm_num) Coulomb.atomicInnerFieldConstant_nonneg,?_⟩ + intro N ψ hNZ hψ + obtain ⟨g,hd,hn,hmin⟩:=hψ + let v:=asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1 + have hm:Coulomb.mass v=1 := (asH1_mass ..).trans hn + have hz:1≤N+1:=by omega + have he:Coulomb.form (Coulomb.atom (N+1) hz) v≤ + (Coulomb.unrestrictedFormBottom (Coulomb.atom (N+1) hz)).toReal+D := by + rw [asH1_energy]; exact H (N+1) hNZ hz hd hn hmin + have hE:=Coulomb.atom_unrestricted_bottom_real (N+1) hz v (asH1_antisymmetric hd) hm + have HH:=Coulomb.atomic_inner_deficit_upper (Coulomb.atom (N+1) hz) (fun _ => rfl) + v (asH1_antisymmetric hd) hm hE.le he hD (by norm_num : (0:ℝ)<1) + rw [physical_exterior_deficit hd hn] + simpa [Coulomb.totalCharge,Coulomb.atom,Coulomb.screenMass,Coulomb.screenBaseMass] using HH +end NeutralAtom +end + +end +section +noncomputable section +open Filter +open scoped Topology +namespace NeutralAtom + +theorem slow_stages {P : ℕ → ℕ → Prop} + (hP : ∀ q : ℕ, ∀ᶠ n : ℕ in atTop, P q n) : + ∃ q : ℕ → ℕ, Tendsto q atTop atTop ∧ ∀ᶠ n in atTop, P (q n) n := by + classical + let q : ℕ → ℕ := fun n => Nat.findGreatest (fun k => P k n) n + refine ⟨q, tendsto_atTop.mpr ?_, ?_⟩ + · intro Q + filter_upwards [eventually_ge_atTop Q, hP Q] with n hn hpn + exact Nat.le_findGreatest hn hpn + · filter_upwards [hP 0] with n hn + exact Nat.findGreatest_spec (P := fun k => P k n) (Nat.zero_le n) hn + +theorem staged_error_tendsto_zero {q : ℕ → ℕ} (hq : Tendsto q atTop atTop) : + Tendsto (fun n => ((q n : ℝ))⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.comp hq) + +end NeutralAtom +end + +end +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom +lemma dyadic_radius_choice {r₀ s q : ℝ} (hr : 0 < r₀) (hs : 0 < s) (hq : 0 < q) + (hsmall : r₀/s ≤ q⁻¹) : + ∃ j : ℕ, s/(2*q) ≤ r₀*2^j ∧ r₀*2^j ≤ s/q := by + have hrq : r₀*q ≤ s := by + have H := (div_le_iff₀ hs).mp hsmall + have H' := mul_le_mul_of_nonneg_right H hq.le + calc + r₀*q ≤ q⁻¹*s*q := H' + _ = s := by field_simp + have hx : 1 ≤ s/(q*r₀) := (one_le_div (mul_pos hq hr)).mpr (by simpa [mul_comm] using hrq) + obtain ⟨j,hj,hj'⟩ := exists_nat_pow_near hx (by norm_num : (1:ℝ)<2) + refine ⟨j,?_,?_⟩ + · have H' := (div_lt_iff₀ (mul_pos hq hr)).mp hj' + rw [pow_succ] at H' + apply (div_le_iff₀ (by positivity : (0:ℝ)<2*q)).mpr + nlinarith only [H',pow_pos (by norm_num : (0:ℝ)<2) j] + · have H := (le_div_iff₀ (mul_pos hq hr)).mp hj + apply (le_div_iff₀ hq).mpr + nlinarith only [H] +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/LimitTheory/TailFinish.lean b/lean/OAI/Analysis/CoulombRadii/LimitTheory/TailFinish.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4ade6843ae0ba614ee360987fa736e1c99c3a84 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/LimitTheory/TailFinish.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketBridge +import OAI.Analysis.CoulombRadii.RandomFields.QuantumRetainedFamily +import OAI.Analysis.CoulombRadii.ThomasFermi.QuantumProfileDatum + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter Set +open scoped Topology BigOperators ENNReal +namespace NeutralAtom +theorem Admissible.charge_tendsto {Zbar : ℝ → ℕ} {s : ℕ → ℝ} {N : ℕ → ℕ} + (h : Admissible Zbar s N) : Tendsto (fun n => N n+1) atTop atTop := by + apply tendsto_atTop.mpr + intro b + filter_upwards [h.1, h.2.1.eventually_lt_const (by norm_num : (0:ℝ) < 1), + h.2.2.2.eventually_ge_atTop (b : ℝ)] with n hsp hs1 hb + have hs3 : s n^3 ≤ 1 := pow_le_one₀ hsp.le hs1.le + have hz : (b : ℝ) ≤ (N n+1 : ℝ) := hb.trans + (mul_le_of_le_one_right (by positivity) hs3) + exact_mod_cast hz + +theorem expected_exterior_of_raw_annuli (hcount : UniformGroundStateCountControl) + (s : ℕ → ℝ) (N : ℕ → ℕ) (ψ : ∀ n, Wavefunction (N n+1)) + (hψ : ∀ n, IsNormalizedGroundState (N n+1) (ψ n)) + (hsp : ∀ n, 0 < s n) (hs : Tendsto s atTop (𝓝 0)) + (hN : Tendsto (fun n => N n+1) atTop atTop) + (hann : ∀ a b, 0 < a → a < b → + Tendsto (fun n => s n^3 * ∫ x, + rawCount (spatialAnnulus (a*s n) (b*s n)) x ∂rawLaw (ψ n)) + atTop (𝓝 ((81*Real.pi^2/2)/a^3-(81*Real.pi^2/2)/b^3))) + {a : ℝ} (ha : 0 < a) : + Tendsto (fun n => s n^3 * exteriorMass (ψ n) (a*s n)) + atTop (𝓝 ((81*Real.pi^2/2)/a^3)) := by + obtain ⟨A,B,Z₀,hA,_hB,hbound⟩ := small_shell_bounds_of_count_control hcount + have hint : ∀ n σ, MemLp (ψ n σ) 2 volume := fun n => (hψ n).choose_spec.1.2.2.1 + have hanti : ∀ n, IsAntisymmetric (ψ n) := fun n => (hψ n).choose_spec.1.1 + apply tails_converge_of_annuli (β := fun n => B*s n^3) (D := (8/7:ℝ)*A) + (by positivity : 0 ≤ 81*Real.pi^2/2) ha + · simpa using (hs.pow 3).const_mul B + · exact fun n r => mul_nonneg (pow_nonneg (hsp n).le 3) (exteriorMass_nonneg (ψ n) _) + · intro M hM + filter_upwards [hN.eventually_ge_atTop Z₀] with n hn + obtain ⟨hfar,hshell⟩ := hbound (N n) (ψ n) hn (hψ n) + exact scaled_dyadic_tail_bound hA (exteriorMass_antitone (hint n)) hfar hshell (hsp n) hM + · intro M haM + have heq : (fun n => s n^3 * exteriorMass (ψ n) (a*s n) - + s n^3 * exteriorMass (ψ n) (M*s n)) = + (fun n => s n^3 * ∫ x, + rawCount (spatialAnnulus (a*s n) (M*s n)) x ∂rawLaw (ψ n)) := by + funext n + rw [← mul_sub, exteriorMass_sub (hint n) + (mul_le_mul_of_nonneg_right haM.le (hsp n).le), integral_rawLaw (hint n), + rawExpectation_count_eq_density (hanti n) (hint n) (measurableSet_spatialAnnulus _ _)] + simpa only [heq] using hann a M ha haM + +end NeutralAtom +end + +end +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom + +theorem quantum_profile_packet_limit + (N : ℕ → ℕ) (ψ : ∀ n,Wavefunction (N n+1)) + (hψ : ∀ n,IsNormalizedGroundState (N n+1) (ψ n)) + [∀ n,IsProbabilityMeasure (rawLaw (ψ n))] + {ε B C L M : ℝ} (hε : 0 < ε) (hB : 0 < B) (_ : 0 ≤ M) + (s : ℕ → ℝ) (hsp : ∀ n,0 < s n) (hs : Tendsto s atTop (𝓝 0)) + (hN : Tendsto (fun n => N n+1) atTop atTop) + (hr₀ : Tendsto (fun n => initialAtomicRadius ε ((N n+1:ℕ):ℝ)/s n) atTop (𝓝 0)) + (q : ℕ → ℕ) (hq : Tendsto q atTop atTop) (Cq : ℕ → ℝ) + (d : ∀ n,QuantumProfileDatum (ψ n) ε B C L M (s n) (q n:ℝ) (Cq n)) + (hprob : ∀ n,Cq n*s n^25 ≤ (q n:ℝ)⁻¹) + {a b : ℝ} (ha : 0 < a) (hab : a < b) : + Tendsto (fun n => s n^3 * ∫ x,packetMass Coulomb.unitWindow 1 + (initialAtomicRadius ε ((N n+1:ℕ):ℝ)) (s n) (spatialAnnulus (a*s n) (b*s n)) x ∂rawLaw (ψ n)) + atTop (𝓝 ((81*Real.pi^2/2)/a^3-(81*Real.pi^2/2)/b^3)) := by + let Ω := fun n => ObservationSample (N n+1) ((d n).j+1) + let P := fun n => observationLaw ((d n).j+1) (rawLaw (ψ n)) + let μ := fun n => profileDensity (ψ n) ε (s n) (d n).j + let rs := fun n (k : Fin ((d n).j+1)) => profileRadius ε (N n) k.val + let obs := fun n => tailObservation (n:=N n+1) (rs n) (d n).j + let r := fun n => profileRadius ε (N n) (d n).j + have hpr (n : ℕ) : 0 < initialAtomicRadius ε ((N n+1:ℕ):ℝ) := initialAtomicRadius_pos hε (by positivity) + have hr (n : ℕ) : 0 < r n := mul_pos (hpr n) (by positivity) + have hμi (n : ℕ) (o : Ω n) : Integrable (μ n o) := + mixturePacketDensity_integrable Coulomb.unitWindow.continuous Coulomb.unitWindow_mass + (by norm_num : (0:ℝ)<1) (hpr n) (hsp n) _ + have hμp (n : ℕ) (o : Ω n) (x : Position) : 0 ≤ μ n o x := + conditionalPacketDensity_nonneg (P n) Prod.fst (obs n) Coulomb.unitWindow + (by norm_num : (0:ℝ)<1) (hpr n) (hsp n) _ x + have hwindow : HasCompactSupport (Coulomb.unitWindow : Position → ℝ) := by + apply HasCompactSupport.intro (K:=Metric.closedBall 0 1) (isCompact_closedBall _ _) + intro x hx + exact Coulomb.unitWindow_support x (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hx) + have hμb (n : ℕ) : ∃ A : ℝ,∀ o : Ω n,∀ x : Position,μ n o x ≤ A := by + obtain ⟨A,hA,HA⟩ := conditionalPacketDensity_bounded (P n) Prod.fst (obs n) + Coulomb.unitWindow.continuous hwindow (by norm_num : (0:ℝ)<1) (hpr n) (hsp n) + exact ⟨A,fun o => HA (obs n o)⟩ + choose A HA using hμb + have hmass (n : ℕ) (o : Ω n) : (∫ x,μ n o x)=(N n+1:ℕ) := by + exact conditionalPacketDensity_mass (P n) Prod.fst (obs n) + Coulomb.unitWindow.continuous Coulomb.unitWindow_mass (by norm_num : (0:ℝ)<1) (hpr n) (hsp n) (obs n o) + let f := physical_family_of_data P μ (fun n => N n+1) q s r B C L physicalSpatialCap + hB physicalSpatialCap_pos.le hsp hr hs hq + (fun n => by + apply (le_div_iff₀ (hsp n)).mpr + simpa only [one_div,mul_comm,div_eq_mul_inv,one_mul] using (d n).low) + (fun n => (div_le_iff₀ (hsp n)).mpr (by simpa only [div_eq_mul_inv,mul_comm] using (d n).high)) + hμi hμp A HA hmass (fun n => (d n).datum) (fun n => (d n).G) + (fun n => (d n).valid) (fun n => (d n).band) + have hbad : Tendsto (fun n => (P n).real (d n).Gᶜ) atTop (𝓝 0) := by + apply squeeze_zero (fun n => measureReal_nonneg) + (fun n => (d n).failure.trans (add_le_add le_rfl (hprob n))) + simpa using ((hs.pow 9).const_mul M).add (staged_error_tendsto_zero hq) + obtain ⟨D,Z₀,hD,Hcount,_⟩ := physical_uniform_count_control + apply expected_packet_annulus_from_retained P + (fun n => MeasurableSpace.comap (obs n) inferInstance) + (fun n => measurable_iff_comap_le.mp (measurable_tailObservation (rs n) (d n).j)) + (fun n => N n+1) (fun n => rawLaw (ψ n)) (fun _ => Prod.fst) + (fun n => observationLaw_rawProjection (rawLaw (ψ n))) s + (fun n => initialAtomicRadius ε ((N n+1:ℕ):ℝ)) hsp hpr hs hr₀ + Coulomb.unitWindow Coulomb.unitWindow.continuous Coulomb.unitWindow_mass Coulomb.unitWindow_support + (by norm_num : (0:ℝ)<1) hD (fun n => (d n).measurable) hbad f.toAnalytic + (fun n o => scaledDensity (s n) (μ n o)) (fun _ _ => rfl) ?_ ?_ ha hab + · intro n a b ha hab + have HH := conditionalPacketDensity_annulus_eq_condExp (P n) (rawLaw (ψ n)) + (observationLaw_rawProjection (rawLaw (ψ n))) (measurable_tailObservation (rs n) (d n).j) + Coulomb.unitWindow.continuous Coulomb.unitWindow_mass (by norm_num : (0:ℝ)<1) + (hpr n) (hsp n) (spatialAnnulus (a*s n) (b*s n)) + filter_upwards [HH] with o ho + rw [annularIntegral_scaledDensity (hsp n)] + exact congrArg (fun t => s n^3*t) ho + · intro a b ha hab + obtain ⟨K,hK,HK⟩ := Hcount a b ha hab + refine ⟨K,hK,?_⟩ + filter_upwards [hN.eventually_ge_atTop Z₀] with n hn + rw [integral_rawLaw (hψ n).choose_spec.1.2.2.1] + exact HK (N n) (ψ n) hn (hψ n) (s n) (hsp n) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/LimitTheory/UniformGroundStateCountControl.lean b/lean/OAI/Analysis/CoulombRadii/LimitTheory/UniformGroundStateCountControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e7a99ea6df5141cacb2d931ff36e73ab2c70aac --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/LimitTheory/UniformGroundStateCountControl.lean @@ -0,0 +1,428 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.ConfigurationDensity + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +theorem rawExpectation_perm {n : ℕ} {ψ : Wavefunction n} + (hψ : IsAntisymmetric ψ) (p : Equiv.Perm (Fin n)) (F : Configuration n → ℝ) : + rawExpectation ψ (fun x => F (x ∘ p)) = rawExpectation ψ F := by + unfold rawExpectation + calc + (∫ x, F (x ∘ p) * configurationDensity ψ x) = + ∫ x, F (x ∘ p) * configurationDensity ψ (x ∘ p) := by + apply integral_congr_ae + filter_upwards [configurationDensity_perm hψ p] with x hx + rw [hx] + _ = ∫ x, F x * configurationDensity ψ x := by + have hi := (volume_measurePreserving_piCongrLeft + (fun _ : Fin n => Position) p.symm).integral_comp' + (fun x => F x * configurationDensity ψ x) + simpa only [MeasurableEquiv.coe_piCongrLeft, piCongrLeft_perm] using hi + +theorem integrable_siteWeight {n : ℕ} {f : Configuration n → ℝ} + (hf : Integrable f) {S : Set Position} (hS : MeasurableSet S) (i : Fin n) : + Integrable (fun x : Configuration n => S.indicator (fun _ => (1 : ℝ)) (x i) * f x) := by + have hi := hf.indicator (hS.preimage (measurable_pi_apply i)) + have heq : (fun x : Configuration n => S.indicator (fun _ => (1 : ℝ)) (x i) * f x) = + ((fun x : Configuration n => x i) ⁻¹' S).indicator f := by + funext x + by_cases hx : x i ∈ S <;> simp [hx] + rw [heq] + exact hi + +theorem rawExpectation_site {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : IsAntisymmetric ψ) (S : Set Position) (i : Fin (N + 1)) : + rawExpectation ψ (fun x => S.indicator (fun _ => (1 : ℝ)) (x i)) = + rawExpectation ψ (fun x => S.indicator (fun _ => (1 : ℝ)) (x 0)) := by + have hp := rawExpectation_perm hψ (Equiv.swap 0 i) + (fun x => S.indicator (fun _ => (1 : ℝ)) (x 0)) + simpa only [Function.comp_apply, Equiv.swap_apply_left] using hp + +theorem rawExpectation_count_factor {N : ℕ} {ψ : Wavefunction (N + 1)} + (hanti : IsAntisymmetric ψ) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + {S : Set Position} (hS : MeasurableSet S) : + rawExpectation ψ (rawCount S) = + (N + 1 : ℝ) * rawExpectation ψ (fun x => S.indicator (fun _ => (1 : ℝ)) (x 0)) := by + have hi := integrable_siteWeight (integrable_configurationDensity hψ) hS + calc + rawExpectation ψ (rawCount S) = ∑ i : Fin (N + 1), + rawExpectation ψ (fun x => S.indicator (fun _ => (1 : ℝ)) (x i)) := by + unfold rawExpectation rawCount + simp_rw [Finset.sum_mul] + exact integral_finsetSum _ fun i _ => hi i + _ = ∑ _i : Fin (N + 1), + rawExpectation ψ (fun x => S.indicator (fun _ => (1 : ℝ)) (x 0)) := by + apply Finset.sum_congr rfl + intro i _ + exact rawExpectation_site hanti S i + _ = _ := by simp + +theorem density_integral_eq_first_site {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {S : Set Position} (hS : MeasurableSet S) : + (∫ x in S, density ψ x) = + (N + 1 : ℝ) * rawExpectation ψ (fun x => S.indicator (fun _ => (1 : ℝ)) (x 0)) := by + have hw (σ : Spins (N + 1)) := integrable_siteWeight + (hψ σ).norm.integrable_sq hS (0 : Fin (N + 1)) + have hinn (σ : Spins (N + 1)) : + Integrable (fun x : Position => ∫ y : Configuration N, ‖ψ σ (Fin.cons x y)‖ ^ 2) := + (integrable_cons (hψ σ).norm.integrable_sq).integral_prod_left + unfold density rawExpectation configurationDensity + rw [integral_const_mul, integral_finsetSum _ (fun σ _ => (hinn σ).integrableOn)] + simp_rw [Finset.mul_sum] + rw [integral_finsetSum _ (fun σ _ => hw σ), ← Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro σ _ + calc + (∫ x in S, ∫ y : Configuration N, ‖ψ σ (Fin.cons x y)‖ ^ 2) = + ∫ x, S.indicator (fun x => ∫ y : Configuration N, ‖ψ σ (Fin.cons x y)‖ ^ 2) x := + (integral_indicator hS).symm + _ = ∫ x : Position, ∫ y : Configuration N, + S.indicator (fun _ => (1 : ℝ)) x * ‖ψ σ (Fin.cons x y)‖ ^ 2 := by + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ S <;> simp [hx] + _ = _ := by simpa only [Fin.cons_zero] using integral_cons (hw σ) + +theorem rawExpectation_count_eq_density {N : ℕ} {ψ : Wavefunction (N + 1)} + (hanti : IsAntisymmetric ψ) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + {S : Set Position} (hS : MeasurableSet S) : + rawExpectation ψ (rawCount S) = ∫ x in S, density ψ x := by + rw [rawExpectation_count_factor hanti hψ hS, density_integral_eq_first_site hψ hS] + +theorem exceptional_event_bound {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsFiniteMeasure μ] {Y : Ω → ℝ} + (hY : MemLp Y 2 μ) (hY0 : 0 ≤ᵐ[μ] Y) + {S : Set Ω} (hS : MeasurableSet S) : + (∫ z in S, Y z ∂μ) ≤ + Real.sqrt (∫ z, Y z ^ 2 ∂μ) * Real.sqrt (μ.real S) := by + let χ : Ω → ℝ := S.indicator (fun _ => 1) + have hχ0 : 0 ≤ᵐ[μ] χ := Filter.Eventually.of_forall fun z => by + by_cases hz : z ∈ S <;> simp [χ, hz] + have hχ : MemLp χ (ENNReal.ofReal 2) μ := by + simpa [χ] using (memLp_const (1 : ℝ) (p := 2) (μ := μ)).indicator hS + have hY' : MemLp Y (ENNReal.ofReal 2) μ := by simpa using hY + have h := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two + hY0 hχ0 hY' hχ + have heq : (fun z => Y z * χ z) = S.indicator Y := by + funext z + by_cases hz : z ∈ S <;> simp [χ, hz] + have hχsq : (fun z => χ z ^ (2 : ℝ)) = χ := by + funext z + by_cases hz : z ∈ S <;> simp [χ, hz] + rw [heq, integral_indicator hS, hχsq] at h + simpa only [χ, Real.rpow_two, integral_indicator hS, setIntegral_const, + smul_eq_mul, mul_one, ← Real.sqrt_eq_rpow] using h + +theorem expectation_error_bound {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsProbabilityMeasure μ] {Y : Ω → ℝ} + (hY : MemLp Y 2 μ) (hY0 : 0 ≤ᵐ[μ] Y) + {G : Set Ω} (hG : MeasurableSet G) {δ C L : ℝ} + (hδ : 0 ≤ δ) (hgood : ∀ z ∈ G, |Y z - L| ≤ δ) + (hL2 : Real.sqrt (∫ z, Y z ^ 2 ∂μ) ≤ C) : + |(∫ z, Y z ∂μ) - L| ≤ δ + C * Real.sqrt (μ.real Gᶜ) + |L| * μ.real Gᶜ := by + have hi : Integrable Y μ := hY.integrable (by norm_num) + have heq : (∫ z, Y z ∂μ) - L = + (∫ z in G, Y z - L ∂μ) + ((∫ z in Gᶜ, Y z ∂μ) - μ.real Gᶜ * L) := by + have hsplit := integral_add_compl hG (hi.sub (integrable_const L)) + simp only [Pi.sub_apply] at hsplit + rw [integral_sub hi (integrable_const L), integral_const] at hsplit + rw [integral_sub (μ := μ.restrict Gᶜ) hi.integrableOn (integrable_const L), + setIntegral_const] at hsplit + simpa [smul_eq_mul] using hsplit.symm + have hA : |∫ z in G, Y z - L ∂μ| ≤ δ := by + have h := norm_setIntegral_le_of_norm_le_const (f := fun z => Y z - L) (C := δ) + (measure_lt_top μ G) + (fun z hz => by simpa only [Real.norm_eq_abs] using hgood z hz) + calc + _ ≤ δ * μ.real G := by simpa only [Real.norm_eq_abs] using h + _ ≤ δ := by nlinarith [measureReal_le_one (μ := μ) (s := G)] + have hB0 : 0 ≤ ∫ z in Gᶜ, Y z ∂μ := integral_nonneg_of_ae (ae_restrict_of_ae hY0) + have hB : (∫ z in Gᶜ, Y z ∂μ) ≤ C * Real.sqrt (μ.real Gᶜ) := + (exceptional_event_bound hY hY0 hG.compl).trans + (mul_le_mul_of_nonneg_right hL2 (Real.sqrt_nonneg _)) + rw [heq] + calc + _ ≤ |∫ z in G, Y z - L ∂μ| + + |(∫ z in Gᶜ, Y z ∂μ) - μ.real Gᶜ * L| := abs_add_le _ _ + _ ≤ |∫ z in G, Y z - L ∂μ| + + (|∫ z in Gᶜ, Y z ∂μ| + |μ.real Gᶜ * L|) := + add_le_add le_rfl (abs_sub _ _) + _ = |∫ z in G, Y z - L ∂μ| + + ((∫ z in Gᶜ, Y z ∂μ) + μ.real Gᶜ * |L|) := by + rw [abs_of_nonneg hB0, abs_mul, abs_of_nonneg measureReal_nonneg] + _ ≤ _ := by linarith + +theorem expectation_tendsto_of_good_events {Ω : ℕ → Type*} + [∀ n, MeasurableSpace (Ω n)] (μ : ∀ n, Measure (Ω n)) + [∀ n, IsProbabilityMeasure (μ n)] (Y : ∀ n, Ω n → ℝ) + (G : ∀ n, Set (Ω n)) (δ : ℕ → ℝ) {C L : ℝ} + (hY : ∀ n, MemLp (Y n) 2 (μ n)) (hY0 : ∀ n, 0 ≤ᵐ[μ n] Y n) + (hG : ∀ n, MeasurableSet (G n)) (hδ0 : ∀ n, 0 ≤ δ n) + (hgood : ∀ n z, z ∈ G n → |Y n z - L| ≤ δ n) + (hL2 : ∀ n, Real.sqrt (∫ z, Y n z ^ 2 ∂μ n) ≤ C) + (hδ : Tendsto δ atTop (𝓝 0)) + (hbad : Tendsto (fun n => (μ n).real (G n)ᶜ) atTop (𝓝 0)) : + Tendsto (fun n => ∫ z, Y n z ∂μ n) atTop (𝓝 L) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + simp only [Real.norm_eq_abs] + apply squeeze_zero (fun _ => abs_nonneg _) + (fun n => expectation_error_bound (hY n) (hY0 n) (hG n) (hδ0 n) (hgood n) (hL2 n)) + have hs : Tendsto (fun n => Real.sqrt ((μ n).real (G n)ᶜ)) atTop (𝓝 0) := by + simpa only [Function.comp_def, Real.sqrt_zero] using + Real.continuous_sqrt.continuousAt.tendsto.comp hbad + simpa only [mul_zero, add_zero] using (hδ.add (hs.const_mul C)).add (hbad.const_mul |L|) + +theorem rawCount_nonneg {n : ℕ} (S : Set Position) (x : Configuration n) : + 0 ≤ rawCount S x := by + apply Finset.sum_nonneg + intro i _ + by_cases hi : x i ∈ S <;> simp [hi] + +theorem rawCount_le_number {n : ℕ} (S : Set Position) (x : Configuration n) : + rawCount S x ≤ n := by + calc + rawCount S x ≤ ∑ _i : Fin n, (1 : ℝ) := by + apply Finset.sum_le_sum + intro i _ + by_cases hi : x i ∈ S <;> simp [hi] + _ = n := by simp + +theorem measurable_rawCount {n : ℕ} {S : Set Position} (hS : MeasurableSet S) : + Measurable (rawCount (n := n) S) := by + apply Finset.measurable_sum + intro i _ + exact (measurable_const.indicator hS).comp (measurable_pi_apply i) + +theorem integrable_count_squared_weight {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {S : Set Position} (hS : MeasurableSet S) : + Integrable (fun x : Configuration n => (rawCount S x) ^ 2 * configurationDensity ψ x) := by + have hq := integrable_configurationDensity hψ + refine (hq.const_mul ((n : ℝ) ^ 2)).mono' ?_ ?_ + · exact (measurable_rawCount hS).pow_const 2 |>.aestronglyMeasurable.mul + hq.aestronglyMeasurable + · filter_upwards [] with x + rw [Real.norm_eq_abs, abs_of_nonneg + (mul_nonneg (sq_nonneg _) (configurationDensity_nonneg ψ x))] + apply mul_le_mul_of_nonneg_right _ (configurationDensity_nonneg ψ x) + exact pow_le_pow_left₀ (rawCount_nonneg S x) (rawCount_le_number S x) 2 + +theorem rawExpectation_count_squared_le {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {S : Set Position} (hS : MeasurableSet S) : + rawExpectation ψ (fun x => (rawCount S x) ^ 2) ≤ (n : ℝ) ^ 2 * normSquared ψ := by + calc + _ ≤ ∫ x : Configuration n, (n : ℝ) ^ 2 * configurationDensity ψ x := by + apply integral_mono (integrable_count_squared_weight hψ hS) + ((integrable_configurationDensity hψ).const_mul _) + intro x + exact mul_le_mul_of_nonneg_right + (pow_le_pow_left₀ (rawCount_nonneg S x) (rawCount_le_number S x) 2) + (configurationDensity_nonneg ψ x) + _ = _ := by rw [integral_const_mul, integral_configurationDensity hψ] + +theorem normalized_count_l2_le_number {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ = 1) + {S : Set Position} (hS : MeasurableSet S) : + Real.sqrt (rawExpectation ψ (fun x => (rawCount S x) ^ 2)) ≤ n := by + have h := rawExpectation_count_squared_le hψ hS + rw [hn, mul_one] at h + calc + _ ≤ Real.sqrt ((n : ℝ) ^ 2) := Real.sqrt_le_sqrt h + _ = n := Real.sqrt_sq (by positivity) + +def UniformGroundStateCountControl : Prop := + ∃ (D : ℝ) (Z₀ : ℕ), 0 ≤ D ∧ + (∀ α β : ℝ, 0 < α → α < β → ∃ C : ℝ, 0 ≤ C ∧ + ∀ (N : ℕ) (ψ : Wavefunction (N + 1)), Z₀ ≤ N + 1 → + IsNormalizedGroundState (N + 1) ψ → ∀ u : ℝ, 0 < u → + Real.sqrt (rawExpectation ψ (fun x => + (rawCount {y : Position | α * u < ‖y‖ ∧ ‖y‖ < β * u} x) ^ 2)) ≤ + C * (max (u ^ 3)⁻¹ 1 + Real.sqrt (D * u))) ∧ + (∃ C : ℝ, 0 ≤ C ∧ ∀ (N : ℕ) (ψ : Wavefunction (N + 1)), Z₀ ≤ N + 1 → + IsNormalizedGroundState (N + 1) ψ → exteriorMass ψ 1 ≤ C * (1 + Real.sqrt D)) + +def rawLaw {n : ℕ} (ψ : Wavefunction n) : Measure (Configuration n) := + volume.withDensity (fun x => ENNReal.ofReal (configurationDensity ψ x)) + +theorem integral_rawLaw {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (F : Configuration n → ℝ) : + (∫ x, F x ∂rawLaw ψ) = rawExpectation ψ F := by + have hq := (integrable_configurationDensity hψ).aemeasurable.ennreal_ofReal + have hqtop : ∀ᵐ x : Configuration n ∂volume, + ENNReal.ofReal (configurationDensity ψ x) < ⊤ := + Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top + have hi := integral_withDensity_eq_integral_toReal_smul₀ hq hqtop F + simpa only [rawLaw, rawExpectation, ENNReal.toReal_ofReal (configurationDensity_nonneg ψ _), + smul_eq_mul, mul_comm] using hi + +theorem rawLaw_isProbability {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ = 1) : + IsProbabilityMeasure (rawLaw ψ) := by + apply isProbabilityMeasure_iff_real.mpr + have h := integral_rawLaw hψ (fun _ => 1) + simpa [integral_const, rawExpectation, integral_configurationDensity hψ, hn] using h + +theorem rawCount_memLp {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ = 1) + {S : Set Position} (hS : MeasurableSet S) : + MemLp (rawCount (n := n) S) 2 (rawLaw ψ) := by + have := rawLaw_isProbability hψ hn + apply MemLp.of_bound (measurable_rawCount hS).aestronglyMeasurable (n : ℝ) + filter_upwards [] with x + simpa only [Real.norm_eq_abs, abs_of_nonneg (rawCount_nonneg S x)] using rawCount_le_number S x + +theorem rawExpectation_sphere_eq_zero {N : ℕ} {ψ : Wavefunction (N + 1)} + (hanti : IsAntisymmetric ψ) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (r : ℝ) : + rawExpectation ψ (rawCount (Metric.sphere (0 : Position) r)) = 0 := by + rw [rawExpectation_count_eq_density hanti hψ Metric.isClosed_sphere.measurableSet] + exact setIntegral_measure_zero _ (Measure.addHaar_sphere volume _ _) + +def packetExponent : ℝ := 1 / 100000 + +def packetWidth (c₁ r₀ s : ℝ) (z : Position) : ℝ := + c₁ * max ‖z‖ r₀ * (min (max ‖z‖ r₀) s) ^ packetExponent + +def packetKernel (g : Position → ℝ) (c₁ r₀ s : ℝ) (z y : Position) : ℝ := + (packetWidth c₁ r₀ s z ^ 3)⁻¹ * + (g ((packetWidth c₁ r₀ s z)⁻¹ • (y - z))) ^ 2 + +theorem packetWidth_pos {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) + (hs : 0 < s) (z : Position) : 0 < packetWidth c₁ r₀ s z := by + unfold packetWidth + have hmax : 0 < max ‖z‖ r₀ := lt_of_lt_of_le hr (le_max_right _ _) + exact mul_pos (mul_pos hc hmax) (Real.rpow_pos_of_pos (lt_min hmax hs) _) + +theorem packetKernel_eq_wavepacket_sq (g : Position → ℝ) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z y : Position) : + packetKernel g c₁ r₀ s z y = + ((packetWidth c₁ r₀ s z) ^ (-(3 / 2 : ℝ)) * + g ((packetWidth c₁ r₀ s z)⁻¹ • (y-z))) ^ 2 := by + have ht := (packetWidth_pos hc hr hs z).le + rw [mul_pow] + unfold packetKernel + congr 1 + rw [← Real.rpow_natCast (_ ^ (-(3 / 2 : ℝ))) 2, ← Real.rpow_mul ht] + norm_num + +theorem packetKernel_nonneg (g : Position → ℝ) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z y : Position) : + 0 ≤ packetKernel g c₁ r₀ s z y := by + rw [packetKernel_eq_wavepacket_sq g hc hr hs] + positivity + +theorem integral_packetKernel (g : Position → ℝ) (hg : (∫ y, g y ^ 2) = 1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z : Position) : + (∫ y, packetKernel g c₁ r₀ s z y) = 1 := by + have ht := packetWidth_pos hc hr hs z + unfold packetKernel + rw [integral_const_mul, integral_sub_right_eq_self + (fun y : Position => (g ((packetWidth c₁ r₀ s z)⁻¹ • y)) ^ 2)] + rw [Measure.integral_comp_inv_smul_of_nonneg volume (fun y : Position => g y ^ 2) ht.le] + simp only [Position, finrank_euclideanSpace, Fintype.card_fin, smul_eq_mul, hg, mul_one] + exact inv_mul_cancel₀ (pow_ne_zero _ ht.ne') + +theorem integrable_packetKernel (g : Position → ℝ) (hg : (∫ y, g y ^ 2) = 1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z : Position) : + Integrable (packetKernel g c₁ r₀ s z) := by + by_contra hnot + have hzero := integral_undef hnot + rw [integral_packetKernel g hg hc hr hs z] at hzero + exact one_ne_zero hzero + +theorem packetKernel_support (g : Position → ℝ) + (hg : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z y : Position) + (hK : packetKernel g c₁ r₀ s z y ≠ 0) : + ‖y-z‖ ≤ packetWidth c₁ r₀ s z := by + have ht := packetWidth_pos hc hr hs z + by_contra! hlt + have harg : 1 < ‖(packetWidth c₁ r₀ s z)⁻¹ • (y-z)‖ := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr ht)] + have : 1 < ‖y-z‖ / packetWidth c₁ r₀ s z := (lt_div_iff₀ ht).mpr (by simpa using hlt) + simpa only [one_mul, div_eq_mul_inv, mul_comm] using this + exact hK (by simp [packetKernel, hg _ harg]) + +theorem packetWidth_le (c₁ r₀ s : ℝ) (hc : 0 ≤ c₁) (_hr : 0 < r₀) + (hs : 0 < s) (z : Position) : + packetWidth c₁ r₀ s z ≤ (c₁ * s ^ packetExponent) * max ‖z‖ r₀ := by + unfold packetWidth + calc + c₁ * max ‖z‖ r₀ * min (max ‖z‖ r₀) s ^ packetExponent + ≤ c₁ * max ‖z‖ r₀ * s ^ packetExponent := by + apply mul_le_mul_of_nonneg_left + · exact Real.rpow_le_rpow (le_min (le_max_of_le_left (norm_nonneg _)) hs.le) + (min_le_right _ _) (by norm_num [packetExponent]) + · exact mul_nonneg hc (le_max_of_le_left (norm_nonneg _)) + _ = (c₁ * s ^ packetExponent) * max ‖z‖ r₀ := by ring + +theorem packetKernel_relative_support (g : Position → ℝ) + (hg : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z y : Position) + (hz : r₀ ≤ ‖z‖) (hK : packetKernel g c₁ r₀ s z y ≠ 0) : + (1-c₁*s^packetExponent)*‖z‖ ≤ ‖y‖ ∧ + ‖y‖ ≤ (1+c₁*s^packetExponent)*‖z‖ := by + have hd := (packetKernel_support g hg hc hr hs z y hK).trans + (packetWidth_le c₁ r₀ s hc.le hr hs z) + rw [max_eq_left hz] at hd + have hn₁ := norm_sub_norm_le y z + have hn₂ := norm_sub_norm_le z y + rw [norm_sub_rev z y] at hn₂ + constructor <;> nlinarith + +theorem packetKernel_clamped_support (g : Position → ℝ) + (hg : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z y : Position) + (hz : ‖z‖ ≤ r₀) (hK : packetKernel g c₁ r₀ s z y ≠ 0) : + ‖y‖ ≤ (1+c₁*s^packetExponent)*r₀ := by + have hd := (packetKernel_support g hg hc hr hs z y hK).trans + (packetWidth_le c₁ r₀ s hc.le hr hs z) + rw [max_eq_right hz] at hd + have hn := norm_sub_norm_le y z + nlinarith + +def packetMass {n : ℕ} (g : Position → ℝ) (c₁ r₀ s : ℝ) + (S : Set Position) (x : Configuration n) : ℝ := + ∑ i, ∫ y in S, packetKernel g c₁ r₀ s (x i) y + +theorem packetMass_nonneg {n : ℕ} (g : Position → ℝ) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S : Set Position) (x : Configuration n) : 0 ≤ packetMass g c₁ r₀ s S x := by + exact Finset.sum_nonneg fun i _ => integral_nonneg fun y => + packetKernel_nonneg g hc hr hs (x i) y + +theorem packetMass_le_rawCount {n : ℕ} (g : Position → ℝ) + (hg : (∫ y, g y ^ 2) = 1) {c₁ r₀ s : ℝ} (hc : 0 < c₁) + (hr : 0 < r₀) (hs : 0 < s) (S T : Set Position) + (hST : ∀ z y, y ∈ S → packetKernel g c₁ r₀ s z y ≠ 0 → z ∈ T) + (x : Configuration n) : packetMass g c₁ r₀ s S x ≤ rawCount T x := by + classical + apply Finset.sum_le_sum + intro i _ + by_cases hi : x i ∈ T + · simp only [Set.indicator_of_mem hi] + calc + (∫ y in S, packetKernel g c₁ r₀ s (x i) y) + ≤ ∫ y, packetKernel g c₁ r₀ s (x i) y := + setIntegral_le_integral (integrable_packetKernel g hg hc hr hs (x i)) + (Filter.Eventually.of_forall (packetKernel_nonneg g hc hr hs (x i))) + _ = 1 := integral_packetKernel g hg hc hr hs (x i) + · simp only [Set.indicator_of_notMem hi] + have hz : (∫ y in S, packetKernel g c₁ r₀ s (x i) y) = 0 := + setIntegral_eq_zero_of_forall_eq_zero fun y hy => by + by_contra hK + exact hi (hST (x i) y hy hK) + exact hz.le + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/AnnularCut.lean b/lean/OAI/Analysis/CoulombRadii/Localization/AnnularCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..653431e37e3824b9d81e4fe1d96b8aac6af348a1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/AnnularCut.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.RadialCut + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff Topology +noncomputable section +namespace Coulomb + +def annularAngle (u : ℝ) (x : Space) : ℝ := cutAngle 0 (2*u) x-cutAngle 0 (u/2) x + +def annularCut (u : ℝ) (l : Fin 2) (x : Space) : ℝ := + if l=0 then Real.sin (annularAngle u x) else Real.cos (annularAngle u x) + +lemma annularAngle_smooth (u : ℝ) : ContDiff ℝ ∞ (annularAngle u) := + (cutAngle_smooth 0 (2*u)).sub (cutAngle_smooth 0 (u/2)) + +lemma annularCut_smooth (u : ℝ) (l : Fin 2) : ContDiff ℝ ∞ (annularCut u l) := by + unfold annularCut + split_ifs + · exact (annularAngle_smooth u).sin + · exact (annularAngle_smooth u).cos + +lemma annularCut_partition (u : ℝ) (x : Space) : ∑ l : Fin 2, annularCut u l x^2=1 := by + simp [Fin.sum_univ_two,annularCut] + +lemma cutAngle_inner (y : Space) {r : ℝ} (hr : 0 u • (e.symm i).val) (u • v) + have hybounds (i : Fin (M+1)) : u/2 ≤ ‖y i‖ ∧ ‖y i‖ ≤ 4*u := by + refine Fin.lastCases ?_ (fun i => ?_) i + · simp only [y,Fin.snoc_last,norm_smul,Real.norm_eq_abs,abs_of_pos hu,hv,mul_one] + constructor <;> linarith + · simp only [y,Fin.snoc_castSucc,norm_smul,Real.norm_eq_abs,abs_of_pos hu] + have H := ht (e.symm i).val (e.symm i).property + constructor <;> nlinarith [H.1,H.2] + have hq : (4:ℝ) ≤ 4^(M+1) := by + simpa only [pow_one] using pow_le_pow_right₀ (show (1:ℝ)≤4 by norm_num) (show 1≤M+1 by omega) + refine ⟨y,(fun i => norm_pos_iff.mp (by linarith [(hybounds i).1])),?_,?_⟩ + · intro i + apply AtomicScaleWindow.enlarge (q:=4) _ (by positivity) hq + dsimp only [AtomicScaleWindow,atomicCellScale] + constructor <;> linarith [(hybounds i).1,(hybounds i).2] + · intro x hx + have hn : ‖u⁻¹ • x‖=‖x‖/u := by simp [norm_smul,abs_of_pos hu,div_eq_mul_inv,mul_comm] + have hlow : (1/2:ℝ) ≤ ‖u⁻¹ • x‖ := by rw [hn]; apply (le_div_iff₀ hu).mpr; linarith [hx.1] + have hhigh : ‖u⁻¹ • x‖ ≤ 4 := by rw [hn]; exact (div_le_iff₀ hu).mpr hx.2.le + obtain ⟨z,hz,hxz⟩ := hcover (u⁻¹ • x) hlow hhigh + apply Set.mem_iUnion.mpr + refine ⟨(e ⟨z,hz⟩).castSucc,?_⟩ + simp only [y,Fin.snoc_castSucc,Equiv.symm_apply_apply,Metric.mem_closedBall,dist_eq_norm] + rw [atomicCellScale_smul hu.le] + have hid : x-u • z=u • (u⁻¹ • x-z) := by simp [smul_sub,smul_smul,hu.ne'] + rw [hid,norm_smul,Real.norm_eq_abs,abs_of_pos hu] + have H := mul_le_mul_of_nonneg_left hxz.le hu.le + nlinarith [atomicCellScale_nonneg z] + +lemma annularIMSCost_reserve {δ u C : ℝ} (hδ : 0≤δ) (hu : 0 (hsupp p).mono_space hcover + mass_eq := hmass + energy := hform.trans (le_add_of_nonneg_right (Finset.sum_nonneg (fun i _ => atomicIMS_nonneg ψ (ys i)))) } + have hB : B≤P*screenEnergy δ (u/100000) := + (annularIMSCost_reserve hδ hu hC₀).trans (mul_le_mul_of_nonneg_right hPcost (screenEnergy_pos δ (by positivity)).le) + have hc (z : Space) (hz : z≠0) : localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z)) ≤ + P*(screenMass δ (atomicCellScale z))^2 := by + exact (screenCountParameter_controls ψ hm δ hz).trans (mul_le_mul_of_nonneg_right + ((screenCountParameter_le_atomicCountConstant S hatom ψ hψ hm hE hstate hδ).trans hPcount) (sq_nonneg _)) + have hy : AtomicScaleWindow (u/100000) (4^j) y := by + apply AtomicScaleWindow.enlarge (q:=4) _ (by positivity) + (by simpa only [pow_one] using pow_le_pow_right₀ (show (1:ℝ)≤4 by norm_num) hj) + dsimp only [AtomicScaleWindow,atomicCellScale] + constructor <;> linarith + have H := U.positive_field S hatom ψ hm hE hstate hB hδ hP (by positivity) hc hys y hy + have Hm : screenMass δ (u/100000) ≤ (100000:ℝ)^3*screenMass δ u := + screenMass_comparable hδ hu (by norm_num) le_rfl (by linarith) + have Hu : screenFieldUnit δ P (u/100000) ≤ Real.sqrt P*(100000:ℝ)^4*screenMass δ u/u := by + unfold screenFieldUnit + exact (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left Hm (Real.sqrt_nonneg _)) (by positivity)).trans_eq (by ring) + exact H.trans ((mul_le_mul_of_nonneg_left Hu (by positivity)).trans_eq (by dsimp [C]; ring)) + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/AtomicHistory.lean b/lean/OAI/Analysis/CoulombRadii/Localization/AtomicHistory.lean new file mode 100644 index 0000000000000000000000000000000000000000..979d8d8db57e6096cfe57d2c72afd57e14a2ebd8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/AtomicHistory.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.EnsembleCoveredCost + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def atomicIMS {n : ℕ} (ψ : H1Vector n) (y : Space) : ℝ := + 3*(radialCutCoefficient/(40*atomicCellScale y))^2* + expectedPopulation ψ (Metric.closedBall y (80*atomicCellScale y)) + +def atomicPatchRegion {j : ℕ} (y : Fin j → Space) : Set Space := + ⋃ i, Metric.closedBall (y i) (80*atomicCellScale (y i)) + +lemma atomicPatchRegion_snoc {j : ℕ} (y : Fin j → Space) (z : Space) : + atomicPatchRegion (Fin.snoc y z)=atomicPatchRegion y∪Metric.closedBall z (80*atomicCellScale z) := by + unfold atomicPatchRegion + rw [Set.iUnion_fin_add_one_eq_iUnion_castSucc] + simp only [Function.comp_def,Fin.snoc_castSucc,Fin.snoc_last] + +structure AtomicCutHistory {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (j : ℕ) where + ensemble : RecordedEnsemble n + target : Fin j → Space + nonzero : ∀ i, target i≠0 + law : ensemble.Conserves ψ + fermionic : ensemble.CoreFermionic + support : ensemble.OutSupported (atomicPatchRegion target) + mass_eq : ensemble.totalMass=mass ψ + energy : ensemble.totalForm S≤form S ψ+∑ i, atomicIMS ψ (target i) + +namespace AtomicCutHistory +variable {J n j : ℕ} {S : Nuclei J} {ψ : H1Vector n} + +def initial (S : Nuclei J) (ψ : H1Vector n) (hψ : Antisymmetric ψ) : AtomicCutHistory S ψ 0 where + ensemble := RecordedEnsemble.initial ψ + target := Fin.elim0 + nonzero := fun i => Fin.elim0 i + law := RecordedEnsemble.initial_conserves ψ + fermionic := RecordedEnsemble.initial_fermionic ψ hψ + support := by simpa only [atomicPatchRegion,Set.iUnion_of_empty] using RecordedEnsemble.initial_supported ψ + mass_eq := RecordedEnsemble.initial_mass ψ + energy := by simp only [RecordedEnsemble.initial_form,Finset.univ_eq_empty,Finset.sum_empty,add_zero,le_refl] + +def center (T : AtomicCutHistory S ψ j) (c : Fin j × {z : Space // z∈atomicPatchMesh}) : Space := + atomicMeshCenter (T.target c.1) c.2.val + +lemma center_nonzero (T : AtomicCutHistory S ψ j) (c) : T.center c≠0 := + atomicCellScale_near_nonzero (T.nonzero c.1) (by + change ‖atomicMeshCenter (T.target c.1) c.2.val-T.target c.1‖≤_ + have H := atomicMeshCenter_distance (T.target c.1) c.2.val c.2.property + nlinarith [atomicCellScale_nonneg (T.target c.1)]) + +theorem append (hatom : ∀ i, S.position i=0) (T : AtomicCutHistory S ψ j) + (hmass : mass ψ=1) {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) + (hstate : form S ψ≤E+δ) {y : Space} (hy : y≠0) : + ∃ U : AtomicCutHistory S ψ (j+1), + U.target=Fin.snoc T.target y ∧ + (∀ H : ℝ, + (∀ c v, ‖v-U.center c‖≤2*atomicCellScale (U.center c) → + U.ensemble.rawSquare S v (atomicCellScale v)≤H) → + atomicCellScale y/(16*ballTrialCoefficient)*T.ensemble.rawSquare S y (atomicCellScale y)≤ + δ+(∑ i, atomicIMS ψ (U.target i))+4*ballTrialCoefficient*(screenBaseMass (atomicCellScale y))^2/atomicCellScale y+ + ∑ c, (Real.sqrt (localCountSecondMoment ψ (Metric.closedBall (U.center c) (atomicCellScale (U.center c)))*(8*H))+ + (((Fintype.card (Fin (j+1) × {z : Space // z∈atomicPatchMesh})):ℝ)* + (∑ d, localCountSecondMoment ψ (Metric.closedBall (U.center d) (atomicCellScale (U.center d)))))/ + (3*atomicCellScale (U.center c)))) := by + have ha := atomicCellScale_pos hy + have hnuc (i) : 3*atomicCellScale y≤‖S.position i-y‖ := by + rw [hatom i] + have H := atomicCellScale_nucleus_far y + linarith [atomicCellScale_nonneg y] + obtain ⟨V,hV,hanti,hsupp,hm,hform,hgain⟩ := T.ensemble.append_radial S ψ T.law T.fermionic + (atomicPatchRegion T.target) T.support ha y hnuc hE + have hag : ∑ i : Fin (j+1), atomicIMS ψ (Fin.snoc (α := fun _ => Space) T.target y i)=(∑ i, atomicIMS ψ (T.target i))+atomicIMS ψ y := by + rw [Fin.sum_univ_castSucc] + simp only [Fin.snoc_castSucc,Fin.snoc_last] + let U : AtomicCutHistory S ψ (j+1) := { + ensemble := V + target := Fin.snoc T.target y + nonzero := by + intro i + refine Fin.lastCases ?_ (fun i => ?_) i + · simpa only [Fin.snoc_last] using hy + · simpa only [Fin.snoc_castSucc] using T.nonzero i + law := hV + fermionic := hanti + support := by rwa [atomicPatchRegion_snoc] + mass_eq := hm.trans T.mass_eq + energy := by + rw [hag] + have HG := T.energy + change V.totalForm S≤_ + change V.totalForm S≤T.ensemble.totalForm S+atomicIMS ψ y at hform + linarith } + refine ⟨U,rfl,?_⟩ + intro H hraw + have hcost := RecordedEnsemble.atomic_cost_lower S hatom ψ U.ensemble U.law U.center U.center_nonzero + (RecordedEnsemble.patches_cover U.ensemble U.target U.nonzero U.support) hraw + have hm1 : T.ensemble.totalMass=1 := T.mass_eq.trans hmass + rw [hm1,mul_one,mul_one] at hgain + have HG := T.energy + have hs : ∑ i, atomicIMS ψ (U.target i)=(∑ i, atomicIMS ψ (T.target i))+atomicIMS ψ y := hag + rw [hs] + change _≤_+atomicIMS ψ y-_ -E+_ at hgain + linarith + +end AtomicCutHistory +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/AtomicRetainedGap.lean b/lean/OAI/Analysis/CoulombRadii/Localization/AtomicRetainedGap.lean new file mode 100644 index 0000000000000000000000000000000000000000..63336a994e89bba65f9cd59f358334c9e16c1e05 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/AtomicRetainedGap.lean @@ -0,0 +1,156 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.AtomicSmallPatch + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +theorem exists_atomic_physical_gap_with_deleted {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) (hstate : form S ψ≤E+δ) + (hδ : 0≤δ) {y : Space} (hy : y≠0) {b : ℝ} (hb : 0 screenCountParameter_controls ψ hm δ (y:=z) hz + obtain ⟨t,ht,T,hEt,ho,hcs,hos,hD,hN,hraw⟩ := + exists_atomic_thin_screened_sharp S hatom ψ hψ hm hE hstate hδ hy hb hsmall hcond + let F := fun p s x => atomicPatchCap S ((T.ensemble.vector p).coreSlice s x).normalized x y + let Q := ∑ p, sliceExpectation (T.ensemble.vector p) (fun s x => (F p s x)^2) + let N := ∑ p, (T.ensemble.out p:ℝ)^2*mass (T.ensemble.vector p) + have hN0 : 0≤N := Finset.sum_nonneg (fun p _ => mul_nonneg (sq_nonneg _) (mass_nonneg _)) + have hD0 : 0≤T.ensemble.deletedSquare y t b := Finset.sum_nonneg (fun p _ => + Finset.sum_nonneg (fun s _ => integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have hwidth : t+b≤80*a := by dsimp only [a] at *; linarith [ht.2] + have hgap : T.ensemble.totalForm S≤E+(δ+thinIMS ψ y t b) := by linarith + have hQ : Q≤atomicPhysicalCapConstant*P*m^2/a^2 := by + have HQ := atomicPatchCap_ensemble_square S hatom T.ensemble hy + (H := (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2) + (fun v hv => (Real.sqrt_le_iff.mp (hraw v hv)).2) + change Q≤_ at HQ + calc + Q≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+8*N/(9*a^2) := HQ + _≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+ + 8*(atomicPatchCountFactor*P*m^2)/(9*a^2) := add_le_add le_rfl + (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hN (by norm_num)) (by positivity)) + _=atomicPhysicalCapConstant*P*m^2/a^2 := by + dsimp only [atomicPhysicalCapConstant,screenFieldUnit,m] + simp only [mul_pow,div_pow,Real.sq_sqrt hP] + ring + have hQ0 : 0≤atomicPhysicalCapConstant*P*m^2/a^2 := by positivity [atomicPhysicalCapConstant_nonneg] + have hn (j) : 20*a≤‖S.position j-y‖ := by + rw [hatom j,zero_sub,norm_neg] + dsimp only [a,atomicCellScale] + nlinarith [norm_nonneg y] + have hH := physical_ensemble_gap S ψ T.ensemble T.law T.fermionic ho + (T.mass_eq.trans hm) hE hgap ha hb hsmall ht y hn hcs hos F + (fun p s => atomicPatchCap_slice_aestronglyMeasurable S (T.ensemble.vector p) s y) + (fun p s => Eventually.of_forall (fun x => atomicPatchCap_nonneg S _ x hy)) + (fun p s => atomicPatchCap_weight_integrable S hatom (T.ensemble.vector p) s hy) + (fun p s => Eventually.of_forall (fun x w hw => coreField_le_atomicPatchCap S hatom _ x hy + ((show ‖w-y‖≤t+b from by simpa only [Metric.mem_closedBall,dist_eq_norm] using hw).trans hwidth))) + refine ⟨t,ht,T,hEt,ho,hcs,hos,?_,hD⟩ + change atomicPatchTFGap S hatom T.ensemble y hy b hb t ht.2≤_ at hH + apply hH.trans + unfold atomicRefinedError + have hB := thinIMS_sharp_budget ψ hm hδ hP hc hy hb hwidth + have hp := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hQ) + (show 0≤12*a*unitWindowKinetic/b^2 from div_nonneg (mul_nonneg (by positivity) unitWindowKinetic_nonneg) (sq_nonneg _)) + have hd := Real.sqrt_le_sqrt (mul_le_mul hQ hD hD0 hQ0) + have hf := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow hN0 hN (by norm_num : (0:ℝ)≤2/3)) + (show 0≤(b⁻¹)^2*((Real.pi^2/2)*neumannBoundary) by positivity [neumannBoundary_nonneg]) + have hn' := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hN) + (show 0≤(2*Real.pi+1)/(2*b) by positivity [Real.pi_pos]) + dsimp only [Q,N,m,a,P] at hp hd hf hn' hB ⊢ + linarith + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma atomic_deleted_small_bound {δ P a : ℝ} (hδ : 0≤δ) (hP : 0≤P) + (hPP : P≤atomicCountConstant) (ha : 0 by dsimp only; rw [hx]))] + simpa only [mul_comm] using v.weak_partial s a φ hφ hc + +def ConfigSupported {n : ℕ} (u : H1Vector n) (A : Set (Configuration n)) : Prop := + ∀ s, ∀ᵐ x ∂volume, x ∉ A → u.value s x = 0 + +lemma ConfigSupported.gradient {n : ℕ} {u : H1Vector n} {A : Set (Configuration n)} + (hu : ConfigSupported u A) (hA : IsClosed A) (s : Spins n) (a : Fin n × Fin 3) : + ∀ᵐ x ∂volume, x ∉ A → u.gradient s a x = 0 := by + apply weak_directional_zero_on_open (EuclideanSpace.single a 1) + ((u.partial_L2 s a).locallyIntegrable (by norm_num)) + (fun φ hφ hc => by simpa only [mul_comm] using u.weak_partial s a φ hφ hc) + Aᶜ hA.isOpen_compl (hu s) + +lemma continuous_position {n : ℕ} (i : Fin n) : + Continuous (fun x : Configuration n => position x i) := by + apply (PiLp.continuous_toLp 2 _).comp + exact continuous_pi (fun b => (EuclideanSpace.proj (i,b)).continuous) + +def allPositions {n : ℕ} (A : Set Space) : Set (Configuration n) := + {x | ∀ i, position x i ∈ A} + +lemma isClosed_allPositions {n : ℕ} {A : Set Space} (hA : IsClosed A) : + IsClosed (allPositions (n := n) A) := by + have he : allPositions (n := n) A = ⋂ i, (fun x : Configuration n => position x i) ⁻¹' A := by + ext x + simp [allPositions] + rw [he] + exact isClosed_iInter (fun i => hA.preimage (continuous_position i)) + +def SpatiallySupported {n : ℕ} (u : H1Vector n) (A : Set Space) : Prop := + ConfigSupported u (allPositions A) + +lemma spatialSupport_gradient {n : ℕ} {u : H1Vector n} {A : Set Space} + (hu : SpatiallySupported u A) (hA : IsClosed A) (s : Spins n) (a : Fin n × Fin 3) : + ∀ᵐ x ∂volume, (∃ i, position x i ∉ A) → u.gradient s a x = 0 := by + simpa only [allPositions, Set.mem_ofPred_eq, not_forall] using + ConfigSupported.gradient hu (isClosed_allPositions hA) s a +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +namespace Coulomb +variable {E F : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + [MeasureSpace E] [BorelSpace E] + [IsLocallyFiniteMeasure (volume : Measure E)] [SigmaFinite (volume : Measure E)] + [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] + [MeasureSpace F] [BorelSpace F] + [IsLocallyFiniteMeasure (volume : Measure F)] [SigmaFinite (volume : Measure F)] + +omit [NormedSpace ℝ E] [FiniteDimensional ℝ E] [MeasureSpace E] [BorelSpace E] + [IsLocallyFiniteMeasure (volume : Measure E)] [SigmaFinite (volume : Measure E)] + [NormedSpace ℝ F] [FiniteDimensional ℝ F] [MeasureSpace F] [BorelSpace F] + [IsLocallyFiniteMeasure (volume : Measure F)] [SigmaFinite (volume : Measure F)] in +lemma compactSupport_slice_right {φ : E × F → ℝ} (hC : HasCompactSupport φ) (x : E) : + HasCompactSupport (fun y => φ (x,y)) := by + apply HasCompactSupport.of_support_subset_isCompact (hC.image continuous_snd) + intro y hy + exact ⟨(x,y), subset_tsupport φ hy, rfl⟩ + +lemma tensor_weak_right {u : E → ℂ} {v d : F → ℂ} + (hu : MemLp u 2 volume) (hv : MemLp v 2 volume) (hd : MemLp d 2 volume) + (a : F) + (hvd : ∀ φ : F → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ y, (fderiv ℝ φ y a : ℂ)*v y) = -(∫ y, (φ y : ℂ)*d y)) + (φ : E × F → ℝ) (hφ : ContDiff ℝ ∞ φ) (hC : HasCompactSupport φ) : + (∫ z, (fderiv ℝ φ z (0,a) : ℂ)*(u z.1*v z.2) ∂(volume.prod volume)) = + -(∫ z, (φ z : ℂ)*(u z.1*d z.2) ∂(volume.prod volume)) := by + have hT : MemLp (fun z => (φ z : ℂ)) 2 (volume.prod volume) := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hC.comp_left Complex.ofReal_zero) + have hD : MemLp (fun z => (fderiv ℝ φ z (0,a) : ℂ)) 2 (volume.prod volume) := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hC.fderiv_apply ℝ (0,a)).comp_left Complex.ofReal_zero) + rw [integral_prod (fun z => (fderiv ℝ φ z (0,a) : ℂ)*(u z.1*v z.2)) + (hD.integrable_mul (tensorPair_memLp hu hv)), + integral_prod (fun z => (φ z : ℂ)*(u z.1*d z.2)) + (hT.integrable_mul (tensorPair_memLp hu hd)), ← integral_neg] + apply integral_congr_ae + filter_upwards [] with x + have hφx : ContDiff ℝ ∞ (fun y => φ (x,y)) := hφ.comp (contDiff_const.prodMk contDiff_id) + have hdφ (y : F) : fderiv ℝ (fun y => φ (x,y)) y a = fderiv ℝ φ (x,y) (0,a) := by + change fderiv ℝ (φ ∘ Prod.mk x) y a = _ + rw [(hφ.differentiable (by simp) (x,y)).hasFDerivAt.comp y + ((hasFDerivAt_const x y).prodMk (hasFDerivAt_id y)) |>.fderiv] + simp + have H := hvd (fun y => φ (x,y)) hφx (compactSupport_slice_right hC x) + simp_rw [hdφ] at H + simp_rw [mul_left_comm _ (u x), integral_const_mul] + rw [H] + ring +omit [NormedSpace ℝ E] [FiniteDimensional ℝ E] [MeasureSpace E] [BorelSpace E] + [IsLocallyFiniteMeasure (volume : Measure E)] [SigmaFinite (volume : Measure E)] + [NormedSpace ℝ F] [FiniteDimensional ℝ F] [MeasureSpace F] [BorelSpace F] + [IsLocallyFiniteMeasure (volume : Measure F)] [SigmaFinite (volume : Measure F)] in +lemma compactSupport_slice_left {φ : E × F → ℝ} (hC : HasCompactSupport φ) (y : F) : + HasCompactSupport (fun x => φ (x,y)) := by + apply HasCompactSupport.of_support_subset_isCompact (hC.image continuous_fst) + intro x hx + exact ⟨(x,y), subset_tsupport φ hx, rfl⟩ + +lemma tensor_weak_left {u d : E → ℂ} {v : F → ℂ} + (hu : MemLp u 2 volume) (hd : MemLp d 2 volume) (hv : MemLp v 2 volume) + (a : E) + (hud : ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x a : ℂ)*u x) = -(∫ x, (φ x : ℂ)*d x)) + (φ : E × F → ℝ) (hφ : ContDiff ℝ ∞ φ) (hC : HasCompactSupport φ) : + (∫ z, (fderiv ℝ φ z (a,0) : ℂ)*(u z.1*v z.2) ∂(volume.prod volume)) = + -(∫ z, (φ z : ℂ)*(d z.1*v z.2) ∂(volume.prod volume)) := by + have hT : MemLp (fun z => (φ z : ℂ)) 2 (volume.prod volume) := + (Complex.continuous_ofReal.comp hφ.continuous).memLp_of_hasCompactSupport + (hC.comp_left Complex.ofReal_zero) + have hD : MemLp (fun z => (fderiv ℝ φ z (a,0) : ℂ)) 2 (volume.prod volume) := + (Complex.continuous_ofReal.comp + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).memLp_of_hasCompactSupport + ((hC.fderiv_apply ℝ (a,0)).comp_left Complex.ofReal_zero) + rw [integral_prod_symm (fun z => (fderiv ℝ φ z (a,0) : ℂ)*(u z.1*v z.2)) + (hD.integrable_mul (tensorPair_memLp hu hv)), + integral_prod_symm (fun z => (φ z : ℂ)*(d z.1*v z.2)) + (hT.integrable_mul (tensorPair_memLp hd hv)), ← integral_neg] + apply integral_congr_ae + filter_upwards [] with y + have hφy : ContDiff ℝ ∞ (fun x => φ (x,y)) := hφ.comp (contDiff_id.prodMk contDiff_const) + have hdφ (x : E) : fderiv ℝ (fun x => φ (x,y)) x a = fderiv ℝ φ (x,y) (a,0) := by + exact congrArg (fun A : E →L[ℝ] ℝ => A a) + (((hφ.differentiable (by simp) (x,y)).hasFDerivAt.comp x + ((hasFDerivAt_id x).prodMk (hasFDerivAt_const y x))).fderiv) + have H := hud (fun x => φ (x,y)) hφy (compactSupport_slice_left hC y) + simp_rw [hdφ] at H + simp_rw [← mul_assoc, integral_mul_const] + rw [H] + ring +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/CutCombinatorics.lean b/lean/OAI/Analysis/CoulombRadii/Localization/CutCombinatorics.lean new file mode 100644 index 0000000000000000000000000000000000000000..146daa9c887568851aa2539505d54db6b7fb3375 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/CutCombinatorics.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.Add +import OAI.Analysis.CoulombRadii.FormDomain.CubeGradient + +namespace OAI + +noncomputable section + +section +open scoped BigOperators Classical +namespace Coulomb + +lemma sum_product_labels {I L : Type*} [Fintype I] [Fintype L] [DecidableEq I] + (f : I → L → ℝ) : (∑ p : I → L, ∏ i, f i (p i)) = ∏ i, ∑ l, f i l := by + simpa only [Fintype.piFinset_univ] using + (Finset.prod_univ_sum (fun _ : I => (Finset.univ : Finset L)) f).symm + +lemma product_partition_square {I L : Type*} [Fintype I] [Fintype L] [DecidableEq I] + (f : I → L → ℝ) (hf : ∀ i, ∑ l, f i l ^ 2 = 1) : + ∑ p : I → L, (∏ i, f i (p i))^2 = 1 := by + simp_rw [←Finset.prod_pow] + rw [sum_product_labels (fun i l => f i l ^ 2)] + simp only [hf,Finset.prod_const_one] + +lemma sum_slot_product {I L : Type*} [Fintype I] [Fintype L] [DecidableEq I] + (f : I → L → ℝ) (g : L → ℝ) (i : I) + (hf : ∀ j, ∑ l, f j l = 1) : + (∑ p : I → L, g (p i) * ∏ j ∈ Finset.univ.erase i, f j (p j)) = ∑ l, g l := by + let w : I → L → ℝ := fun j l => if j=i then g l else f j l + have hp (p : I → L) : g (p i) * ∏ j ∈ Finset.univ.erase i, f j (p j) = ∏ j, w j (p j) := by + rw [←Finset.mul_prod_erase _ _ (Finset.mem_univ i)] + simp only [w,ite_eq_left rfl] + congr 1 + apply Finset.prod_congr rfl + intro j hj + exact (ite_eq_right (Finset.ne_of_mem_erase hj)).symm + simp_rw [hp] + rw [sum_product_labels w] + rw [Finset.prod_eq_single i] + · simp [w] + · intro j hj hji + simp only [w,ite_eq_right hji,hf] + · simp + +lemma sum_slot_product_square {I L : Type*} [Fintype I] [Fintype L] [DecidableEq I] + (f : I → L → ℝ) (g : L → ℝ) (i : I) + (hf : ∀ j, ∑ l, f j l ^ 2 = 1) : + (∑ p : I → L, (g (p i) * ∏ j ∈ Finset.univ.erase i, f j (p j))^2) = ∑ l, g l ^ 2 := by + simp_rw [mul_pow,←Finset.prod_pow] + exact sum_slot_product (fun i l => f i l ^ 2) (fun l => g l ^ 2) i hf + +lemma abs_partition_le_one {L : Type*} [Fintype L] (f : L → ℝ) + (hf : ∑ l, f l ^ 2 = 1) (l : L) : |f l| ≤ 1 := by + have h := Finset.single_le_sum (fun j _ => sq_nonneg (f j)) (Finset.mem_univ l) + rw [hf] at h + nlinarith [sq_abs (f l),abs_nonneg (f l)] + +lemma abs_prod_le_one {I : Type*} (s : Finset I) (f : I → ℝ) + (h : ∀ i ∈ s, |f i| ≤ 1) : |∏ i ∈ s, f i| ≤ 1 := by + rw [Finset.abs_prod] + exact Finset.prod_le_one₀ (fun _ _ => abs_nonneg _) h +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def tensorCut {n : ℕ} {L : Type*} (χ : L → Space → ℝ) (p : Fin n → L) (x : Configuration n) : ℝ := + ∏ i, χ (p i) (position x i) + +lemma tensorCut_contDiff {n : ℕ} {L : Type*} (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (p : Fin n → L) : + ContDiff ℝ (⊤ : ℕ∞) (tensorCut χ p) := by + unfold tensorCut + apply contDiff_prod + intro i hi + exact (hχ (p i)).comp (positionCLM i).contDiff + +lemma tensorCut_fderiv {n : ℕ} {L : Type*} (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) (p : Fin n → L) + (x : Configuration n) (i : Fin n) (b : Fin 3) : + fderiv ℝ (tensorCut χ p) x (EuclideanSpace.single (i,b) 1) = + fderiv ℝ (χ (p i)) (position x i) (EuclideanSpace.single b 1) * + ∏ j ∈ Finset.univ.erase i, χ (p j) (position x j) := by + have hd (j : Fin n) : DifferentiableAt ℝ (fun y : Configuration n => χ (p j) (position y j)) x := by + exact ((hχ (p j)).differentiable (by simp) (positionCLM j x)).comp x + (positionCLM j).differentiableAt + have he (j : Fin n) : fderiv ℝ (fun y : Configuration n => χ (p j) (position y j)) x = + (fderiv ℝ (χ (p j)) (position x j)).comp (positionCLM j) := by + exact (((hχ (p j)).differentiable (by simp) (position x j)).hasFDerivAt.comp x + (positionCLM j).hasFDerivAt).fderiv + unfold tensorCut + rw [fderiv_finsetProd (fun j _ => hd j),sum_apply] + simp only [smul_apply,smul_eq_mul,he,ContinuousLinearMap.comp_apply,positionCLM_single] + rw [Finset.sum_eq_single i] + · simp only [ite_true] + ring + · intro j hj hji + simp only [ite_eq_right hji,map_zero,mul_zero] + · simp + +lemma tensorCut_partition {n : ℕ} {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (x : Configuration n) : + ∑ p : Fin n → L, tensorCut χ p x ^ 2 = 1 := + product_partition_square (fun i l => χ l (position x i)) (fun i => hp (position x i)) + +lemma tensorCut_abs_le_one {n : ℕ} {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (p : Fin n → L) (x : Configuration n) : + |tensorCut χ p x| ≤ 1 := + abs_prod_le_one _ _ (fun i _ => abs_partition_le_one (fun l => χ l (position x i)) (hp _) _) + +lemma tensorCut_partial_bound {n : ℕ} {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) {D : ℝ} (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → L) (a : Fin n × Fin 3) (x : Configuration n) : + |fderiv ℝ (tensorCut χ p) x (EuclideanSpace.single a 1)| ≤ D := by + rcases a with ⟨i,b⟩ + rw [tensorCut_fderiv χ hχ,abs_mul] + calc + _ ≤ D*1 := mul_le_mul (hd _ _ _) (abs_prod_le_one _ _ + (fun j _ => abs_partition_le_one (fun l => χ l (position x j)) (hp _) _)) (abs_nonneg _) hD + _ = D := mul_one D + +lemma tensorCut_gradient_square_sum {n : ℕ} {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (x : Configuration n) (i : Fin n) (b : Fin 3) : + (∑ p : Fin n → L, (fderiv ℝ (tensorCut χ p) x (EuclideanSpace.single (i,b) 1))^2) = + ∑ l, (fderiv ℝ (χ l) (position x i) (EuclideanSpace.single b 1))^2 := by + simp_rw [tensorCut_fderiv χ hχ] + exact sum_slot_product_square (fun j l => χ l (position x j)) + (fun l => fderiv ℝ (χ l) (position x i) (EuclideanSpace.single b 1)) i (fun j => hp _) + +def H1Vector.labelCut {n : ℕ} {L : Type*} [Fintype L] (ψ : H1Vector n) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → L) : H1Vector n := + ψ.smoothMul (tensorCut χ p) (tensorCut_contDiff χ hχ p) 1 D + (tensorCut_abs_le_one χ hp p) (tensorCut_partial_bound χ hχ hp hD hd p) + +lemma mass_labelCut {n : ℕ} {L : Type*} [Fintype L] (ψ : H1Vector n) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) : + ∑ p : Fin n → L, mass (ψ.labelCut χ hχ hp D hD hd p) = mass ψ := + mass_smooth_partition ψ _ (tensorCut_contDiff χ hχ) 1 D (tensorCut_abs_le_one χ hp) + (tensorCut_partial_bound χ hχ hp hD hd) (tensorCut_partition χ hp) + +lemma form_labelCut {J n : ℕ} {L : Type*} [Fintype L] (S : Nuclei J) (ψ : H1Vector n) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) : + (∑ p : Fin n → L, form S (ψ.labelCut χ hχ hp D hD hd p)) = + form S ψ+(1/2:ℝ)*∑ s, ∑ a : Fin n × Fin 3, ∫ x, + (∑ l, (fderiv ℝ (χ l) (position x a.1) (EuclideanSpace.single a.2 1))^2)*‖ψ.value s x‖^2 := by + unfold H1Vector.labelCut + rw [form_smooth_partition S ψ _ _ _ _ _ _ (tensorCut_partition χ hp)] + simp_rw [tensorCut_gradient_square_sum χ hχ hp] + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/CutCore.lean b/lean/OAI/Analysis/CoulombRadii/Localization/CutCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..871d5ebdef9accb6461a7257af58bda090834b1e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/CutCore.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PermuteJoinBlock +import OAI.Analysis.CoulombRadii.FieldAnalysis.CorePerm +import OAI.Analysis.CoulombRadii.Localization.CutCombinatorics + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma tensorCut_permute_invariant {n : ℕ} {L : Type*} (χ : L → Space → ℝ) + (p : Fin n → L) (q : Equiv.Perm (Fin n)) (hp : ∀ i, p (q i)=p i) (x : Configuration n) : + tensorCut χ p (permute q x) = tensorCut χ p x := by + unfold tensorCut + simp only [position_permute] + calc + _ = ∏ i, χ (p (q i)) (position x (q i)) := by simp only [hp] + _ = _ := Equiv.prod_comp q (fun i => χ (p i) (position x i)) + +lemma labelCut_core_antisymmetric {m k : ℕ} {L : Type*} [Fintype L] + (ψ : H1Vector (m+k)) (hψ : Antisymmetric ψ) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+k) → L) (l : L) (hc : ∀ i, p (Fin.natAdd m i)=l) (s : Spins m) : + ∀ᵐ x, Antisymmetric ((ψ.labelCut χ hχ hp D hD hd p).coreSlice s x) := by + apply H1Vector.coreSlice_antisymmetric + intro q t + filter_upwards [hψ (corePerm m q) (Fin.append s t)] with z hz + have H (i : Fin (m+k)) : p (corePerm m q i)=p i := by + refine Fin.addCases ?_ ?_ i + · intro j + rw [corePerm_left] + · intro j + rw [corePerm_right,hc,hc] + change (↑(tensorCut χ p (permute (corePerm m q) z)) : ℂ)* + ψ.value (Fin.append s t ∘ corePerm m q) (permute (corePerm m q) z)=_ + rw [tensorCut_permute_invariant χ p _ H,hz] + change (↑(tensorCut χ p z) : ℂ)*((((corePerm m q).sign:ℤ):ℂ)*ψ.value (Fin.append s t) z) = + (((corePerm m q).sign:ℤ):ℂ)*((↑(tensorCut χ p z):ℂ)*ψ.value (Fin.append s t) z) + ring + +lemma SpatiallySupported.rsmul {n : ℕ} {u : H1Vector n} {A : Set Space} + (hu : SpatiallySupported u A) (c : ℝ) : SpatiallySupported (u.rsmul c) A := by + intro s + filter_upwards [hu s] with x hx hxA + change (c:ℂ)*u.value s x=0 + rw [hx hxA,mul_zero] +lemma SpatiallySupported.normalized {n : ℕ} {u : H1Vector n} {A : Set Space} + (hu : SpatiallySupported u A) : SpatiallySupported u.normalized A := hu.rsmul _ + +lemma labelCut_core_support {m k : ℕ} {L : Type*} [Fintype L] + (ψ : H1Vector (m+k)) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z ^ 2 = 1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+k) → L) (l : L) (hc : ∀ i, p (Fin.natAdd m i)=l) + (A : Set Space) (hA : ∀ z ∉ A, χ l z=0) (s : Spins m) : + ∀ᵐ x, SpatiallySupported ((ψ.labelCut χ hχ hp D hD hd p).coreSlice s x) A := by + let u := ψ.labelCut χ hχ hp D hD hd p + filter_upwards [u.coreSliceRegular_ae s] with x hx + intro t + filter_upwards [] with z hz + rw [u.coreSlice_value s hx] + change (↑(tensorCut χ p (joinConfiguration m k (x,z))):ℂ)*ψ.value (Fin.append s t) + (joinConfiguration m k (x,z))=0 + have hi : ∃ i : Fin k, position z i ∉ A := by + simpa only [allPositions,Set.mem_ofPred_eq,not_forall] using hz + obtain ⟨i,hi⟩ := hi + have H : tensorCut χ p (joinConfiguration m k (x,z))=0 := by + apply Finset.prod_eq_zero (Finset.mem_univ (Fin.natAdd m i)) + rw [hc,position_join_right,hA _ hi] + rw [H,Complex.ofReal_zero,zero_mul] + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/CutRefinement.lean b/lean/OAI/Analysis/CoulombRadii/Localization/CutRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..46a86bd4570b9093f4e89e566b4eef698b61b2e4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/CutRefinement.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.CutCombinatorics +import OAI.Analysis.CoulombRadii.RandomFields.CutJensen + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma positive_square_tangent (b c : ℝ) (hc : 0≤c) : + 2*c*b-c^2 ≤ (max b 0)^2 := by + nlinarith [sq_nonneg (max b 0-c),mul_le_mul_of_nonneg_left (le_max_left b 0) hc] + +lemma finite_mass_positive_jensen {P : Type*} [Fintype P] + (M H : P → ℝ) (hM : ∀ p, 0≤M p) (m h : ℝ) + (hm : ∑ p, M p=m) (hh : ∑ p, M p*H p=m*h) : + m*(max h 0)^2 ≤ ∑ p, M p*(max (H p) 0)^2 := by + let c := max h 0 + have hc : 0≤c := le_max_right _ _ + have H0 := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => + mul_le_mul_of_nonneg_left (positive_square_tangent (H p) c hc) (hM p)) + have he : (∑ p, M p*(2*c*H p-c^2))=2*c*(m*h)-c^2*m := by + simp_rw [mul_sub] + rw [Finset.sum_sub_distrib] + have h1 : (∑ p, M p*(2*c*H p))=2*c*∑ p, M p*H p := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intros + ring + rw [h1,←Finset.sum_mul,hh,hm] + ring + rw [he] at H0 + by_cases hp : 0≤h + · have hec : c=h := max_eq_left hp + rw [hec] at H0 + rw [max_eq_left hp] + nlinarith + · have hec : c=0 := max_eq_right (le_of_not_ge hp) + rw [hec] at H0 + rw [max_eq_right (le_of_not_ge hp)] + nlinarith + +lemma labelCut_coreSlice_law {m k : ℕ} {L : Type*} [Fintype L] + (u : H1Vector (m+k)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (s : Spins m) : + ∀ᵐ x, ∀ t : Spins k, ∀ v : Configuration k, + (∑ p : Fin (m+k) → L, + ‖((u.labelCut χ hχ hp D hD hd p).coreSlice s x).value t v‖^2)= + ‖(u.coreSlice s x).value t v‖^2 := by + have hall : ∀ᵐ x, ∀ p : Fin (m+k) → L, + (u.labelCut χ hχ hp D hD hd p).CoreSliceRegular s x := + ae_all_iff.mpr (fun p => (u.labelCut χ hχ hp D hD hd p).coreSliceRegular_ae s) + filter_upwards [u.coreSliceRegular_ae s,hall] with x hx ha + intro t v + simp_rw [(u.labelCut χ hχ hp D hD hd _).coreSlice_value s (ha _) t v] + rw [u.coreSlice_value s hx] + simp only [H1Vector.labelCut,H1Vector.smoothMul,norm_mul,Complex.norm_real,Real.norm_eq_abs,mul_pow,sq_abs, + ←Finset.sum_mul,tensorCut_partition χ hp,one_mul] + +lemma fiber_mass_law {P : Type*} [Fintype P] {k : ℕ} + (u : H1Vector k) (v : P → H1Vector k) + (hlaw : ∀ s x, (∑ p, ‖(v p).value s x‖^2)=‖u.value s x‖^2) : + (∑ p, mass (v p))=mass u := by + unfold mass + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro s hs + rw [←integral_finsetSum _ (fun p _ => ((v p).value_L2 s).integrable_norm_pow (by norm_num))] + exact integral_congr_ae (Eventually.of_forall (hlaw s)) + +lemma fiber_potential_law {P : Type*} [Fintype P] {k : ℕ} + (u : H1Vector k) (v : P → H1Vector k) + (hlaw : ∀ s x, (∑ p, ‖(v p).value s x‖^2)=‖u.value s x‖^2) + (W : Configuration k → ℝ) (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x| ≤ B) : + (∑ p, potentialForm W (v p))=potentialForm W u := by + unfold potentialForm + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro s hs + rw [←integral_finsetSum _ (fun p _ => boundedObservable_integrable (v p) W hW hB s)] + apply integral_congr_ae + filter_upwards [] with x + rw [←Finset.mul_sum,hlaw] + +theorem labelCut_conditional_positive_jensen {m k : ℕ} {L : Type*} [Fintype L] + (u : H1Vector (m+k)) (χ : L → Space → ℝ) + (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB0 : 0≤B) + (hB : ∀ x, |W x| ≤ B) : + sliceExpectation u (fun s x => (max (coreConditionalObservable u W s x) 0)^2) ≤ + ∑ p : Fin (m+k) → L, sliceExpectation (u.labelCut χ hχ hp D hD hd p) + (fun s x => (max (coreConditionalObservable (u.labelCut χ hχ hp D hD hd p) W s x) 0)^2) := by + let v := fun p : Fin (m+k) → L => u.labelCut χ hχ hp D hD hd p + unfold sliceExpectation + rw [Finset.sum_comm] + apply Finset.sum_le_sum + intro s hs + rw [←integral_finsetSum _ (fun p _ => coreConditionalObservable_positive_weight_integrable (v p) W hW hB0 hB s 2)] + apply integral_mono_ae (coreConditionalObservable_positive_weight_integrable u W hW hB0 hB s 2) + (integrable_finsetSum _ (fun p _ => coreConditionalObservable_positive_weight_integrable (v p) W hW hB0 hB s 2)) + filter_upwards [labelCut_coreSlice_law u χ hχ hp D hD hd s] with x hx + apply finite_mass_positive_jensen (fun p => mass ((v p).coreSlice s x)) + (fun p => coreConditionalObservable (v p) W s x) (fun p => mass_nonneg _) _ _ + · exact fiber_mass_law _ _ hx + · simp only [coreConditionalObservable,potentialForm_normalized_weight] + exact fiber_potential_law _ _ hx _ + (hW.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (fun _ => hB _) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/DeletedLabels.lean b/lean/OAI/Analysis/CoulombRadii/Localization/DeletedLabels.lean new file mode 100644 index 0000000000000000000000000000000000000000..e10f2f070a3e7ed22e8124ff97889e783d95c23e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/DeletedLabels.lean @@ -0,0 +1,291 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.OuterJoinConfiguration +import OAI.Analysis.CoulombRadii.FieldAnalysis.SliceExpectation + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma sliceExpectation_add {m k : ℕ} (ψ : H1Vector (m+k)) + (f g : Spins m → Configuration m → ℝ) + (hf : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*f s x)) + (hg : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*g s x)) : + sliceExpectation ψ (fun s x => f s x+g s x) = sliceExpectation ψ f + sliceExpectation ψ g := by + simp only [sliceExpectation, mul_add, integral_add (hf _) (hg _), Finset.sum_add_distrib] +lemma sliceExpectation_sub {m k : ℕ} (ψ : H1Vector (m+k)) + (f g : Spins m → Configuration m → ℝ) + (hf : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*f s x)) + (hg : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*g s x)) : + sliceExpectation ψ (fun s x => f s x-g s x) = sliceExpectation ψ f - sliceExpectation ψ g := by + simp only [sliceExpectation, mul_sub, integral_sub (hf _) (hg _), Finset.sum_sub_distrib] +lemma sliceExpectation_const_mul {m k : ℕ} (ψ : H1Vector (m+k)) + (c : ℝ) (f : Spins m → Configuration m → ℝ) : + sliceExpectation ψ (fun s x => c*f s x) = c*sliceExpectation ψ f := by + simp only [sliceExpectation, mul_left_comm (mass _) c, integral_const_mul, Finset.mul_sum] +lemma sliceExpectation_mono_ae {m k : ℕ} (ψ : H1Vector (m+k)) + (f g : Spins m → Configuration m → ℝ) + (hf : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*f s x)) + (hg : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*g s x)) + (h : ∀ s, ∀ᵐ x, f s x ≤ g s x) : sliceExpectation ψ f ≤ sliceExpectation ψ g := by + exact Finset.sum_le_sum fun s _ => integral_mono_ae (hf s) (hg s) + ((h s).mono fun x hx => mul_le_mul_of_nonneg_left hx (mass_nonneg _)) + +lemma normalized_coreForm_weight_integrable {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*form S (ψ.coreSlice s x).normalized) := by + simp only [form_normalized_weight] + exact form_coreSlice_integrable S ψ s + +lemma retainedFinePower_weight_integrable {m k : ℕ} (ψ : H1Vector (m+k)) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)*retainedFinePower b r x) := by + apply slice_weight_integrable_const ψ + simpa only [outerJoinConfiguration_symm_snd] using outer_finePower_integrable hb r hr ψ +lemma retainedFineCoulomb_weight_integrable {m k : ℕ} (ψ : H1Vector (m+k)) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)*retainedFineCoulomb b r x) := by + apply slice_weight_integrable_const ψ + simpa only [outerJoinConfiguration_symm_snd] using outer_fineCoulomb_integrable hb r hr ψ +lemma outerPair_weight_integrable {m k : ℕ} (ψ : H1Vector (m+k)) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)*pairPotential x) := + slice_weight_integrable_const ψ pairPotential ψ.outer_pair_integrable s + +def deletedLabels {m : ℕ} (r : Configuration m → Finset (Fin m)) (x : Configuration m) : Finset (Fin m) := + Finset.univ \ r x +lemma deletedLabels_measurable {m : ℕ} (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (i : Fin m) : + MeasurableSet {x | i ∈ deletedLabels r x} := by + have he : {x | i ∈ deletedLabels r x} = {x | i ∈ r x}ᶜ := by ext x; simp [deletedLabels] + rw [he]; exact (hr i).compl +lemma retained_deleted_sum {m : ℕ} (r : Configuration m → Finset (Fin m)) + (x : Configuration m) (f : Fin m → ℝ) : + (∑ i ∈ r x, f i) + (∑ i ∈ deletedLabels r x, f i) = ∑ i : Fin m, f i := by + simpa only [add_comm, deletedLabels] using Finset.sum_sdiff (f:=f) (Finset.subset_univ (r x)) + +def discreteFineTF {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (b : ℝ) (r : Configuration m → Finset (Fin m)) (s : Spins m) (x : Configuration m) : ℝ := + thomasFermiCoefficient*retainedFinePower b r x + retainedFineCoulomb b r x - + ∑ i ∈ r x, coreScreenedField S (ψ.coreSlice s x).normalized (position x i) + +def fineLocalizationError (m : ℕ) (b : ℝ) : ℝ := + (b⁻¹)^2 * ((Real.pi^2/2)*neumannBoundary) * (m:ℝ)^(4/3:ℝ) + ((2*Real.pi+1)/(2*b))*m + +lemma discreteFineTF_weight_integrable {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)*discreteFineTF S ψ b r s x) := by + simp only [discreteFineTF, mul_sub, mul_add, mul_left_comm (mass _) thomasFermiCoefficient] + exact (((retainedFinePower_weight_integrable ψ hb r hr s).const_mul _).add + (retainedFineCoulomb_weight_integrable ψ hb r hr s)).sub + (retained_field_weight_integrable S ψ r hr s) + +lemma fine_energy_expectation_lower {m k : ℕ} (ψ : H1Vector (m+k)) + (hψ : ∀ (s : Spins k) (p : Equiv.Perm (Fin m)) (t : Spins m), + ∀ᵐ z, ψ.value (outerAppend s t ∘ outerPerm k p) (permute (outerPerm k p) z) = + (((outerPerm k p).sign : ℤ) : ℂ)*ψ.value (outerAppend s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) : + sliceExpectation ψ (fun _ x => thomasFermiCoefficient*retainedFinePower b r x + retainedFineCoulomb b r x) - + fineLocalizationError m b*mass ψ ≤ outerKinetic ψ + sliceExpectation ψ (fun _ x => pairPotential x) := by + rw [sliceExpectation_add ψ _ _ + (fun s => by simpa only [mul_left_comm (mass _) thomasFermiCoefficient] using + (retainedFinePower_weight_integrable ψ hb r hr s).const_mul thomasFermiCoefficient) + (retainedFineCoulomb_weight_integrable ψ hb r hr), sliceExpectation_const_mul] + rw [sliceExpectation_const ψ _ (by simpa only [outerJoinConfiguration_symm_snd] using outer_finePower_integrable hb r hr ψ), + sliceExpectation_const ψ _ (by simpa only [outerJoinConfiguration_symm_snd] using outer_fineCoulomb_integrable hb r hr ψ), + sliceExpectation_const ψ _ ψ.outer_pair_integrable] + simpa only [outerJoinConfiguration_symm_snd, fineLocalizationError] using + outer_block_retained_fine_energy_lower ψ hψ hb r hr + +theorem conditional_fine_lower {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (hψ : ∀ (s : Spins k) (p : Equiv.Perm (Fin m)) (t : Spins m), + ∀ᵐ z, ψ.value (outerAppend s t ∘ outerPerm k p) (permute (outerPerm k p) z) = + (((outerPerm k p).sign : ℤ) : ℂ)*ψ.value (outerAppend s t) z) + {b : ℝ} (hb : 0 < b) (r : Configuration m → Finset (Fin m)) + (hr : ∀ i, MeasurableSet {x | i ∈ r x}) + (F : Spins m → Configuration m → ℝ) + (hFi : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*(F s x*(deletedLabels r x).card))) + (hcap : ∀ s, ∀ᵐ x, ∀ i ∈ deletedLabels r x, + coreScreenedField S (ψ.coreSlice s x).normalized (position x i) ≤ F s x) : + sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized + discreteFineTF S ψ b r s x) - + sliceExpectation ψ (fun s x => F s x*(deletedLabels r x).card) - fineLocalizationError m b*mass ψ ≤ form S ψ := by + let P := fun s x => ∑ i ∈ r x, coreScreenedField S (ψ.coreSlice s x).normalized (position x i) + let D := fun s x => ∑ i ∈ deletedLabels r x, coreScreenedField S (ψ.coreSlice s x).normalized (position x i) + let A := fun (_ : Spins m) x => thomasFermiCoefficient*retainedFinePower b r x + retainedFineCoulomb b r x + let e := fun s x => form S (ψ.coreSlice s x).normalized + have hPi := retained_field_weight_integrable S ψ r hr + have hDi := retained_field_weight_integrable S ψ (deletedLabels r) (deletedLabels_measurable r hr) + have hAi (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*A s x) := by + dsimp only [A]; simp only [mul_add, mul_left_comm (mass _) thomasFermiCoefficient] + exact ((retainedFinePower_weight_integrable ψ hb r hr s).const_mul _).add + (retainedFineCoulomb_weight_integrable ψ hb r hr s) + have hei := normalized_coreForm_weight_integrable S ψ + have heq (s : Spins m) (x : Configuration m) : conditionalEnergy S ψ s x = + (e s x-P s x)+pairPotential x-D s x := by + rw [conditionalEnergy_eq_screened, ←retained_deleted_sum r x] + dsimp only [e, P, D]; ring + have hE : form S ψ = outerKinetic ψ + + (sliceExpectation ψ e-sliceExpectation ψ P)+sliceExpectation ψ (fun _ x => pairPotential x)-sliceExpectation ψ D := by + rw [conditional_energy_identity] + change outerKinetic ψ + sliceExpectation ψ (conditionalEnergy S ψ) = _ + conv_lhs => rw [show conditionalEnergy S ψ = (fun s x => (e s x-P s x)+pairPotential x-D s x) by funext s x; exact heq s x] + rw [sliceExpectation_sub ψ _ _ + (fun s => by + apply ((hei s |>.sub (hPi s)).add (outerPair_weight_integrable ψ s)).congr + exact Eventually.of_forall (fun x => by dsimp [e,P]; ring)) hDi, + sliceExpectation_add ψ _ _ (fun s => by + apply ((hei s).sub (hPi s)).congr + exact Eventually.of_forall (fun x => by dsimp [e,P]; ring)) + (outerPair_weight_integrable ψ), sliceExpectation_sub ψ e P hei hPi] + ring + have hD : sliceExpectation ψ D ≤ sliceExpectation ψ (fun s x => F s x*(deletedLabels r x).card) := by + apply sliceExpectation_mono_ae ψ _ _ hDi hFi + intro s + filter_upwards [hcap s] with x hx + calc D s x ≤ ∑ i ∈ deletedLabels r x, F s x := Finset.sum_le_sum hx + _ = F s x*(deletedLabels r x).card := by simp; ring + have hL := fine_energy_expectation_lower ψ hψ hb r hr + have hT : sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized + discreteFineTF S ψ b r s x) = + sliceExpectation ψ e + (sliceExpectation ψ A-sliceExpectation ψ P) := by + change sliceExpectation ψ (fun s x => e s x+(A s x-P s x)) = _ + rw [sliceExpectation_add ψ e _ hei (fun s => by + apply ((hAi s).sub (hPi s)).congr + exact Eventually.of_forall (fun x => by dsimp [A,P]; ring)), + sliceExpectation_sub ψ A P hAi hPi] + rw [hT, hE] + change sliceExpectation ψ A -fineLocalizationError m b*mass ψ ≤ _ at hL + linarith +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/DeletionEnvelope.lean b/lean/OAI/Analysis/CoulombRadii/Localization/DeletionEnvelope.lean new file mode 100644 index 0000000000000000000000000000000000000000..b56024e0b5340c40cf417931a67058f0ce64a593 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/DeletionEnvelope.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.AnnularIMS +import OAI.Analysis.CoulombRadii.Packets.InnerMeshCap +import OAI.Analysis.CoulombRadii.FieldAnalysis.DyadicInnerRMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +theorem exists_atomic_deletion_envelope : ∃ C : ℝ, 0 ≤ C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E → + ∀ {t : ℝ}, 0 hw y) y + +lemma deletionShellWeight_le_one {w : Space → ℝ} (hw : ∀ y, w y ≤ 1) (t : ℝ) (j : ℕ) (y : Space) : + deletionShellWeight t w j y ≤ 1 := by + unfold deletionShellWeight + by_cases hy : y∈deletionShell t j + · rw [indicator_of_mem hy]; exact hw y + · rw [indicator_of_notMem hy]; norm_num + +lemma deletionShellWeight_supported (t : ℝ) (w : Space → ℝ) (j : ℕ) (y : Space) + (hy : y∉imsShell 0 ((2:ℝ)^j*t)) : deletionShellWeight t w j y=0 := by + apply indicator_of_notMem + intro H + apply hy + simp only [imsShell,mem_ofPred_eq,sub_zero] + refine ⟨H.1,?_⟩ + have : (2:ℝ)^(j+1)*t=2*((2:ℝ)^j*t) := by rw [pow_succ]; ring + rw [←this] + exact H.2.le + +lemma deletionShellWeight_sum {t : ℝ} (ht : 0 simp + | succ k ih => + rw [Finset.sum_range_succ,ih] + have hp : 1 ≤ (2:ℝ)^k := one_le_pow₀ (by norm_num) + have htk : t ≤ (2:ℝ)^k*t := by nlinarith + have hnext : (2:ℝ)^k*t ≤ (2:ℝ)^(k+1)*t := by rw [pow_succ]; nlinarith + simp only [deletionShellWeight,Set.indicator_apply,deletionShell,mem_ofPred_eq] + split_ifs <;> simp_all <;> try omega + all_goals nlinarith [mul_le_mul_of_nonneg_right hp ht.le, mul_le_mul_of_nonneg_right hnext ht.le] + +lemma deletionShellWeight_sum_bound {t : ℝ} (ht : 0 norm_num + | succ k ih => rw [Finset.sum_range_succ,ih,pow_succ,Nat.cast_add,Nat.cast_one]; ring + rw [he] + have H : 0 ≤ (2*(k:ℝ)+4)*(1/2:ℝ)^k := by positivity + linarith + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/DensityCut.lean b/lean/OAI/Analysis/CoulombRadii/Localization/DensityCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..18c60e7bda5014e273f5ec977d2cbcddda55ac2e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/DensityCut.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketDensity + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +namespace Coulomb + +def densityCut (ρ : Space → ℝ) (k : ℕ) (x : Space) : ℝ := min (ρ x) (k:ℝ) +lemma densityCut_nonneg (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (k : ℕ) (x : Space) : + 0 ≤ densityCut ρ k x := le_min (hp x) (Nat.cast_nonneg k) +lemma densityCut_le (ρ : Space → ℝ) (k : ℕ) (x : Space) : densityCut ρ k x ≤ ρ x := min_le_left _ _ +lemma densityCut_bound (ρ : Space → ℝ) (k : ℕ) (x : Space) : densityCut ρ k x ≤ (k:ℝ) := min_le_right _ _ +lemma densityCut_measurable (ρ : Space → ℝ) (hm : Measurable ρ) (k : ℕ) : + Measurable (densityCut ρ k) := hm.min measurable_const +lemma densityCut_integrable (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (hi : Integrable ρ) (k : ℕ) : Integrable (densityCut ρ k) := by + apply hi.mono' (densityCut_measurable ρ hm k).aestronglyMeasurable + filter_upwards [] with x + rw [Real.norm_of_nonneg (densityCut_nonneg ρ hp k x)] + exact densityCut_le ρ k x +lemma densityCut_kinetic_integrable (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (ht : Integrable (fun x => ρ x^(5/3:ℝ))) (k : ℕ) : + Integrable (fun x => densityCut ρ k x^(5/3:ℝ)) := by + apply ht.mono' ((densityCut_measurable ρ hm k).pow_const _).aestronglyMeasurable + filter_upwards [] with x + rw [Real.norm_of_nonneg (Real.rpow_nonneg (densityCut_nonneg ρ hp k x) _)] + exact Real.rpow_le_rpow (densityCut_nonneg ρ hp k x) (densityCut_le ρ k x) (by norm_num) +lemma densityCut_support (ρ : Space → ℝ) (K : Set Space) + (hs : ∀ x, x ∉ K → ρ x = 0) (k : ℕ) (x : Space) (hx : x ∉ K) : densityCut ρ k x = 0 := by + simp only [densityCut,hs x hx,min_eq_left (Nat.cast_nonneg k)] +lemma densityCut_tendsto (ρ : Space → ℝ) (x : Space) : + Tendsto (fun k => densityCut ρ k x) atTop (nhds (ρ x)) := by + apply tendsto_const_nhds.congr' + filter_upwards [(tendsto_natCast_atTop_atTop (R := ℝ)).eventually (eventually_ge_atTop (ρ x))] with k hk + exact (min_eq_left hk).symm + +lemma packetDensity_mono (g : 𝓢(Space,ℝ)) (ρ σ : Space → ℝ) + (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) + (hsp : ∀ x, 0 ≤ σ x) (hsm : Measurable σ) (hsi : Integrable σ) + (h : ∀ x, ρ x ≤ σ x) (x : Space) : packetDensity g ρ x ≤ packetDensity g σ x := by + exact integral_mono (packetDensity_integrand_integrable g ρ hp hm hi x) + (packetDensity_integrand_integrable g σ hsp hsm hsi x) + (fun y => mul_le_mul_of_nonneg_left (h y) (sq_nonneg _)) + +lemma packetDensity_cut_tendsto (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) (x : Space) : + Tendsto (fun k => packetDensity g (densityCut ρ k) x) atTop (nhds (packetDensity g ρ x)) := by + apply tendsto_integral_of_dominated_convergence (fun y => g (x-y)^2*ρ y) + (fun k => (packetDensity_integrand_integrable g _ (densityCut_nonneg ρ hp k) + (densityCut_measurable ρ hm k) (densityCut_integrable ρ hp hm hi k) x).1) + (packetDensity_integrand_integrable g ρ hp hm hi x) + · intro k + filter_upwards [] with y + rw [Real.norm_of_nonneg (mul_nonneg (sq_nonneg _) (densityCut_nonneg ρ hp k y))] + exact mul_le_mul_of_nonneg_left (densityCut_le ρ k y) (sq_nonneg _) + · filter_upwards [] with y + exact tendsto_const_nhds.mul (densityCut_tendsto ρ y) + +lemma packetDensity_cut_weighted_tendsto (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) + (w : Space → ℝ) (hwp : ∀ x, 0 ≤ w x) (hwm : Measurable w) + (hwi : Integrable (fun x => w x*packetDensity g ρ x)) : + Tendsto (fun k => ∫ x, w x*packetDensity g (densityCut ρ k) x) atTop + (nhds (∫ x, w x*packetDensity g ρ x)) := by + apply tendsto_integral_of_dominated_convergence (fun x => w x*packetDensity g ρ x) + (fun k => (hwm.mul (packetDensity_measurable g _ (densityCut_measurable ρ hm k))).aestronglyMeasurable) hwi + · intro k + filter_upwards [] with x + change ‖w x*packetDensity g (densityCut ρ k) x‖ ≤ _ + rw [Real.norm_of_nonneg (mul_nonneg (hwp x) (packetDensity_nonneg g _ (densityCut_nonneg ρ hp k) x))] + exact mul_le_mul_of_nonneg_left (packetDensity_mono g _ ρ (densityCut_nonneg ρ hp k) + (densityCut_measurable ρ hm k) (densityCut_integrable ρ hp hm hi k) hp hm hi (densityCut_le ρ k) x) (hwp x) + · filter_upwards [] with x + exact tendsto_const_nhds.mul (packetDensity_cut_tendsto g ρ hp hm hi x) +end Coulomb + +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/DyadicTailPartial.lean b/lean/OAI/Analysis/CoulombRadii/Localization/DyadicTailPartial.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b4311fbcafb0eec663924d36beb820918e4ef3d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/DyadicTailPartial.lean @@ -0,0 +1,139 @@ +import Mathlib + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +namespace Coulomb + +lemma dyadic_tail_partial_le {w : ℝ} (hw : 0 ≤ w) (N : ℕ) : + (∑ k ∈ Finset.range N, if (4:ℝ)^k < w then (4:ℝ)^k else 0) ≤ (4/3:ℝ)*w := by + induction N with + | zero => simp only [Finset.range_zero, Finset.sum_empty]; positivity + | succ N ih => + by_cases h : (4:ℝ)^N < w + · calc + _ ≤ ∑ k ∈ Finset.range (N+1), (4:ℝ)^k := by + apply Finset.sum_le_sum + intro k _ + split_ifs + · exact le_rfl + · positivity + _ = ((4:ℝ)^(N+1)-1)/3 := by rw [geom_sum_eq (by norm_num : (4:ℝ) ≠ 1)]; norm_num + _ ≤ (4/3:ℝ)*w := by rw [pow_succ]; linarith + · simpa only [Finset.sum_range_succ, ite_eq_right h, add_zero] using ih + +lemma dyadic_tail_hasSum {w : ℝ} (hw : 0 ≤ w) : + Summable (fun k : ℕ => if (4:ℝ)^k < w then (4:ℝ)^k else 0) ∧ + (∑' k : ℕ, if (4:ℝ)^k < w then (4:ℝ)^k else 0) ≤ (4/3:ℝ)*w := by + classical + obtain ⟨N,hN⟩ := pow_unbounded_of_one_lt w (by norm_num : (1:ℝ) < 4) + have hz (k : ℕ) (hk : k ∉ Finset.range N) : + (if (4:ℝ)^k < w then (4:ℝ)^k else 0) = 0 := by + have hNk : N ≤ k := by simpa only [Finset.mem_range, not_lt] using hk + have hpow : (4:ℝ)^N ≤ (4:ℝ)^k := pow_le_pow_right₀ (by norm_num) hNk + exact ite_eq_right (not_lt.mpr (hN.le.trans hpow)) + refine ⟨summable_of_ne_finset_zero hz, ?_⟩ + rw [tsum_eq_sum hz] + exact dyadic_tail_partial_le hw N + +lemma pow_eight_two_thirds (k : ℕ) : + ((8:ℝ)^k)^(2/3:ℝ) = (4:ℝ)^k := by + rw [← Real.rpow_natCast_mul (by norm_num), mul_comm, + Real.rpow_mul_natCast (by norm_num)] + congr 1 + have he : (8:ℝ) = (2:ℝ)^(3:ℝ) := by norm_num + rw [he, ← Real.rpow_mul (by norm_num)] + norm_num + +lemma dyadic_density_bound {B r : ℝ} (hB : 0 < B) (hr : 0 ≤ r) + (h : ℕ → ℝ) (h0 : ∀ k, 0 ≤ h k) + (hs : Summable (fun k => (4:ℝ)^k * h k)) + (hcap : ∀ k, r ≤ 2*B*(8:ℝ)^k + 2*h k) : + r^(5/3:ℝ) ≤ (32*B)^(2/3:ℝ)*r + + (4*(32*B)^(2/3:ℝ))*(∑' k, (4:ℝ)^k*h k) := by + have hS : 0 ≤ ∑' k, (4:ℝ)^k*h k := tsum_nonneg (fun k => mul_nonneg (by positivity) (h0 k)) + have hfac : 0 ≤ (32*B)^(2/3:ℝ) := Real.rpow_nonneg (by positivity) _ + have hrpow : r^(5/3:ℝ) = r^(2/3:ℝ)*r := by + by_cases hz : r = 0 + · simp [hz] + · rw [show (5/3:ℝ) = 2/3+1 by norm_num, Real.rpow_add_one hz] + by_cases hsmall : r ≤ 4*B + · have hb : r^(2/3:ℝ) ≤ (32*B)^(2/3:ℝ) := + Real.rpow_le_rpow hr (hsmall.trans (by linarith)) (by norm_num) + rw [hrpow] + have ht := mul_le_mul_of_nonneg_right hb hr + nlinarith [mul_nonneg hfac hS] + · have hbig : 4*B < r := lt_of_not_ge hsmall + obtain ⟨k,hk,hk'⟩ := exists_nat_pow_near + ((le_div_iff₀ (by positivity : (0:ℝ) < 4*B)).2 (by linarith : 1*(4*B) ≤ r)) + (by norm_num : (1:ℝ) < 8) + have hlo : 4*B*(8:ℝ)^k ≤ r := by + have hh := (le_div_iff₀ (by positivity : (0:ℝ) < 4*B)).mp hk + nlinarith + have hup : r ≤ 32*B*(8:ℝ)^k := by + have hh := (div_lt_iff₀ (by positivity : (0:ℝ) < 4*B)).mp hk' + rw [pow_succ] at hh + nlinarith + have hh : r ≤ 4*h k := by have hc := hcap k; linarith + have hpower : r^(2/3:ℝ) ≤ (32*B)^(2/3:ℝ)*(4:ℝ)^k := by + have H := Real.rpow_le_rpow hr hup (by norm_num : (0:ℝ) ≤ 2/3) + rwa [Real.mul_rpow (by positivity) (by positivity), pow_eight_two_thirds] at H + have hsingle : (4:ℝ)^k*h k ≤ ∑' j, (4:ℝ)^j*h j := + hs.le_tsum k (fun j _ => mul_nonneg (by positivity) (h0 j)) + rw [hrpow] + calc + _ ≤ ((32*B)^(2/3:ℝ)*(4:ℝ)^k)*(4*h k) := + mul_le_mul hpower hh hr (by positivity) + _ = (4*(32*B)^(2/3:ℝ))*((4:ℝ)^k*h k) := by ring + _ ≤ (4*(32*B)^(2/3:ℝ))*(∑' j, (4:ℝ)^j*h j) := + mul_le_mul_of_nonneg_left hsingle (by positivity) + _ ≤ _ := le_add_of_nonneg_left (mul_nonneg hfac hr) + +lemma dyadic_spectral_tail_bound {α : Type*} (w c : α → ℝ) + (hw : ∀ a, 0 ≤ w a) (hc : ∀ a, 0 ≤ c a) + (hs : Summable (fun a => w a*c a)) : + Summable (fun k : ℕ => (4:ℝ)^k * (∑' a, if (4:ℝ)^k < w a then c a else 0)) ∧ + (∑' k : ℕ, (4:ℝ)^k * (∑' a, if (4:ℝ)^k < w a then c a else 0)) ≤ + (4/3:ℝ)*(∑' a, w a*c a) := by + classical + let F (a : α) (k : ℕ) := (if (4:ℝ)^k < w a then (4:ℝ)^k else 0)*c a + have hF0 (a : α) (k : ℕ) : 0 ≤ F a k := by + dsimp only [F] + apply mul_nonneg _ (hc a) + split_ifs <;> positivity + have hFa (a : α) : Summable (F a) := + (dyadic_tail_hasSum (hw a)).1.mul_right (c a) + have hFb (a : α) : (∑' k, F a k) ≤ (4/3:ℝ)*(w a*c a) := by + rw [show (∑' k, F a k) = (∑' k, if (4:ℝ)^k < w a then (4:ℝ)^k else 0)*c a from + tsum_mul_right] + have H := mul_le_mul_of_nonneg_right (dyadic_tail_hasSum (hw a)).2 (hc a) + simpa only [mul_assoc] using H + have houter : Summable (fun a => ∑' k, F a k) := + Summable.of_nonneg_of_le (fun a => tsum_nonneg (hF0 a)) hFb (hs.mul_left (4/3:ℝ)) + have hprod : Summable (Function.uncurry F) := + (summable_prod_of_nonneg (fun z => hF0 z.1 z.2)).2 ⟨hFa,houter⟩ + have heq (k : ℕ) : (∑' a, F a k) = + (4:ℝ)^k*(∑' a, if (4:ℝ)^k < w a then c a else 0) := by + rw [← tsum_mul_left] + apply tsum_congr + intro a + dsimp only [F] + split_ifs <;> simp only [zero_mul, mul_zero] + refine ⟨?_, ?_⟩ + · simpa only [Prod.swap_prod_mk, Function.uncurry_apply_pair, heq] using hprod.prod_symm.prod + · simp_rw [← heq] + rw [hprod.tsum_comm] + have H := houter.tsum_le_tsum hFb (hs.mul_left (4/3:ℝ)) + simpa only [tsum_mul_left] using H + +end Coulomb + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/ExteriorCut.lean b/lean/OAI/Analysis/CoulombRadii/Localization/ExteriorCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..412482f819f96e95f99cd42fd16fc4c1d2767692 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/ExteriorCut.lean @@ -0,0 +1,77 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.ShellSummable +import OAI.Analysis.CoulombRadii.Localization.AnnularCut + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology ContDiff +noncomputable section +namespace Coulomb + +def exteriorCut (t : ℝ) (l : Fin 2) : Space → ℝ := + if l=0 then radialCut 0 t 1 else radialCut 0 t 0 + +lemma exteriorCut_smooth (t : ℝ) (l : Fin 2) : ContDiff ℝ ∞ (exteriorCut t l) := by + unfold exteriorCut + split_ifs <;> exact radialCut_smooth 0 t _ + +lemma exteriorCut_partition (t : ℝ) (x : Space) : ∑ l : Fin 2, exteriorCut t l x^2=1 := by + simpa only [Fin.sum_univ_two,exteriorCut,ite_true,show (1:Fin 2)≠0 by decide,ite_false,add_comm] + using radialCut_partition 0 t x + +lemma exteriorCut_derivative_bound {t : ℝ} (ht : 0 exact radialCut_derivative_bound 0 ht _ b x + +lemma exteriorCut_out_zero {t : ℝ} (ht : 0 f y*g y) v x = f x*dirPartial g v x+g x*dirPartial f v x := by + change fderiv ℝ (f*g) x v = _ + rw [fderiv_mul hf hg] + simp [dirPartial] + +theorem dirPartial_add {f g : Position → ℝ} {x v : Position} + (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x) : + dirPartial (fun y => f y+g y) v x = dirPartial f v x+dirPartial g v x := by + change fderiv ℝ (f+g) x v = _ + rw [fderiv_add hf hg] + rfl + +theorem coordinateLaplacian_mul {f g : Position → ℝ} + (hf : ContDiff ℝ 2 f) (hg : ContDiff ℝ 2 g) (x : Position) : + coordinateLaplacian (fun y => f y*g y) x = + f x*coordinateLaplacian g x+g x*coordinateLaplacian f x+ + 2*∑ a : Fin 3, dirPartial f (axis a) x*dirPartial g (axis a) x := by + have hf1 := hf.differentiable (by norm_num) + have hg1 := hg.differentiable (by norm_num) + have hpf (a) : Differentiable ℝ (dirPartial f (axis a)) := + (contDiff_partial (n := 1) hf (axis a)).differentiable (by norm_num) + have hpg (a) : Differentiable ℝ (dirPartial g (axis a)) := + (contDiff_partial (n := 1) hg (axis a)).differentiable (by norm_num) + rw [coordinateLaplacian_eq_partials (hf.mul hg).contDiffAt, + coordinateLaplacian_eq_partials hg.contDiffAt, + coordinateLaplacian_eq_partials hf.contDiffAt] + have hh (a : Fin 3) : dirPartial (dirPartial (fun y => f y*g y) (axis a)) (axis a) x = + f x*dirPartial (dirPartial g (axis a)) (axis a) x+ + g x*dirPartial (dirPartial f (axis a)) (axis a) x+ + 2*(dirPartial f (axis a) x*dirPartial g (axis a) x) := by + have heq : dirPartial (fun y => f y*g y) (axis a) = + fun y => f y*dirPartial g (axis a) y+g y*dirPartial f (axis a) y := + funext (fun y => dirPartial_mul (hf1 y) (hg1 y)) + rw [heq, dirPartial_add + (f := fun y => f y*dirPartial g (axis a) y) + (g := fun y => g y*dirPartial f (axis a) y) + (by simpa only [Pi.mul_def] using (hf1 x).mul (hpg a x)) + (by simpa only [Pi.mul_def] using (hg1 x).mul (hpf a x)), + dirPartial_mul (hf1 x) (hpg a x), dirPartial_mul (hg1 x) (hpf a x)] + ring + simp_rw [hh, Finset.sum_add_distrib, Finset.mul_sum] + +theorem dirPartial_regularizedKernel {ε : ℝ} (hε : ε ≠ 0) + (a : Fin 3) (x : Position) : + dirPartial (regularizedKernel ε) (axis a) x = + -(x a)*(‖x‖^2+ε^2)^(-3/2 : ℝ) := by + have hq : 0 < ‖x‖^2+ε^2 := add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hε) + have heq : (fun t : ℝ => regularizedKernel ε (x+t • axis a)) = + fun t : ℝ => (‖x‖^2+2*t*x a+t^2+ε^2)^(-1/2 : ℝ) := by + ext t + rw [regularizedKernel, norm_sq_axis_shift] + have hd : HasDerivAt (fun t : ℝ => ‖x‖^2+2*t*x a+t^2+ε^2) (2*x a) 0 := by + convert (((hasDerivAt_const 0 (‖x‖^2)).add + (((hasDerivAt_id 0).const_mul 2).mul_const (x a))).add + ((hasDerivAt_id 0).pow 2)).add_const (ε^2) using 1 + all_goals first | rfl | norm_num + have hr := hd.rpow_const (p := (-1/2 : ℝ)) (Or.inl (by simpa using hq.ne')) + have he := deriv_affine_line (v := axis a) (t := 0) + (by simpa using (contDiff_regularizedKernel hε).differentiable (by norm_num) x) + simp only [zero_smul, add_zero] at he + unfold dirPartial + rw [← he, heq] + rw [hr.deriv] + norm_num + ring_nf + all_goals simp + +def coulombPartial (a : Fin 3) (x : Position) : ℝ := + -(x a)*(‖x‖^2)^(-3/2 : ℝ) + +theorem regularizedPartial_tendsto {ε : ℕ → ℝ} (hε : ∀ n, ε n ≠ 0) + (hlim : Tendsto ε atTop (𝓝 0)) (a : Fin 3) {x : Position} (hx : x ≠ 0) : + Tendsto (fun n => dirPartial (regularizedKernel (ε n)) (axis a) x) + atTop (𝓝 (coulombPartial a x)) := by + simp only [dirPartial_regularizedKernel (hε _)] + have hh : Tendsto (fun n => ‖x‖^2+(ε n)^2) atTop (𝓝 (‖x‖^2)) := by + simpa using tendsto_const_nhds.add (hlim.pow 2) + exact tendsto_const_nhds.mul (hh.rpow_const (Or.inl (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)))) + +theorem dirPartial_regularizedKernel_bound {ε : ℝ} (hε : ε ≠ 0) + (a : Fin 3) {x : Position} (hx : x ≠ 0) : + ‖dirPartial (regularizedKernel ε) (axis a) x‖ ≤ (coulombKernel x)^2 := by + rw [dirPartial_regularizedKernel hε] + simp only [norm_mul, norm_neg, Real.norm_eq_abs] + rw [abs_of_nonneg (Real.rpow_nonneg (add_nonneg (sq_nonneg ‖x‖) (sq_nonneg ε)) (-3/2 : ℝ))] + have hnorm : |x a| ≤ ‖x‖ := by simpa only [Real.norm_eq_abs] using PiLp.norm_apply_le x a + have hpos : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hr : (‖x‖^2+ε^2)^(-3/2 : ℝ) ≤ (‖x‖^2)^(-3/2 : ℝ) := + Real.rpow_le_rpow_of_nonpos (by positivity) (by nlinarith [sq_nonneg ε]) (by norm_num) + have he : ‖x‖*(‖x‖^2)^(-3/2 : ℝ) = (coulombKernel x)^2 := by + rw [← Real.rpow_natCast_mul (norm_nonneg x)] + norm_num [Real.rpow_neg hpos.le, coulombKernel] + field_simp + exact (mul_le_mul hnorm hr (by positivity) (norm_nonneg x)).trans_eq he + +theorem locallyIntegrable_coulombKernel_sq : + LocallyIntegrable (fun x => (coulombKernel x)^2) volume := by + intro x + refine ⟨Metric.ball 0 (‖x‖+1), IsOpen.mem_nhds Metric.isOpen_ball ?_, + coulombKernel_sq_integrableOn_ball _⟩ + simpa only [Metric.mem_ball, dist_zero_right] using lt_add_one ‖x‖ + +theorem regularizedPartial_integral_tendsto {ε : ℕ → ℝ} + (hε : ∀ n, 0 < ε n) (hlim : Tendsto ε atTop (𝓝 0)) + (a : Fin 3) {φ : Position → ℝ} (hφ : Continuous φ) (hφc : HasCompactSupport φ) : + Tendsto (fun n => ∫ x, dirPartial (regularizedKernel (ε n)) (axis a) x*φ x) + atTop (𝓝 (∫ x, coulombPartial a x*φ x)) := by + have hae : ∀ᵐ x : Position ∂volume, x ≠ 0 := volume.ae_ne 0 + have hb : Integrable (fun x => (coulombKernel x)^2*‖φ x‖) := by + simpa only [smul_eq_mul] using + locallyIntegrable_coulombKernel_sq.integrable_smul_right_of_hasCompactSupport hφ.norm hφc.norm + apply tendsto_integral_of_dominated_convergence (fun x => (coulombKernel x)^2*‖φ x‖) + · intro n + exact ((contDiff_partial (n := ∞) (by simpa using contDiff_regularizedKernel (hε n).ne') + (axis a)).continuous.mul hφ).aestronglyMeasurable + · exact hb + · intro n + filter_upwards [hae] with x hx + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (dirPartial_regularizedKernel_bound (hε n).ne' a hx) + (norm_nonneg _) + · filter_upwards [hae] with x hx + exact (regularizedPartial_tendsto (fun n => (hε n).ne') hlim a hx).mul_const (φ x) + +theorem weak_harmonic_reproduction {h χ : Position → ℝ} {U : Set Position} + (hh : Continuous h) (hharm : HasWeakLaplacian h U (fun _ => 0)) + (hχ : ContDiff ℝ ∞ χ) (hχc : HasCompactSupport χ) (hχU : tsupport χ ⊆ U) : + (∫ x, coulombKernel x*(h x*coordinateLaplacian χ x)) + + 2*∑ a : Fin 3, ∫ x, coulombPartial a x*(h x*dirPartial χ (axis a) x) = + 4*Real.pi*(h 0*χ 0) := by + let ε : ℕ → ℝ := fun n => ((n:ℝ)+1)⁻¹ + have hε : ∀ n, 0 < ε n := fun n => by dsimp [ε]; positivity + have hεlim : Tendsto ε atTop (𝓝 0) := tendsto_inv_atTop_zero.comp + (tendsto_atTop_add_const_right _ 1 tendsto_natCast_atTop_atTop) + have hχ2 : ContDiff ℝ 2 χ := hχ.of_le (by exact WithTop.coe_le_coe.mpr le_top) + have hcdelta : Continuous (coordinateLaplacian χ) := continuous_coordinateLaplacian hχ2 + have hcsdelta : HasCompactSupport (coordinateLaplacian χ) := + hasCompactSupport_coordinateLaplacian hχc + have hcp (a : Fin 3) : ContDiff ℝ ∞ (dirPartial χ (axis a)) := + contDiff_partial (by simpa using hχ) (axis a) + have hcsp (a : Fin 3) := hasCompactSupport_partial hχc (axis a) + have hn (n : ℕ) : + (∫ x, regularizedKernel (ε n) x*(h x*coordinateLaplacian χ x)) + + 2*∑ a : Fin 3, ∫ x, dirPartial (regularizedKernel (ε n)) (axis a) x* + (h x*dirPartial χ (axis a) x) = + ∫ x, regularizedCharge (ε n) x*(h x*χ x) := by + have hK := contDiff_regularizedKernel (hε n).ne' + have hK2 : ContDiff ℝ 2 (regularizedKernel (ε n)) := + hK.of_le (by exact WithTop.coe_le_coe.mpr le_top) + have hpK (a : Fin 3) : Continuous (dirPartial (regularizedKernel (ε n)) (axis a)) := + (contDiff_partial (n := ∞) (by simpa using hK) (axis a)).continuous + have hq : Continuous (regularizedCharge (ε n)) := by + have heq : regularizedCharge (ε n) = fun x => -coordinateLaplacian (regularizedKernel (ε n)) x := by + ext x + rw [laplacian_regularizedKernel (hε n).ne'] + ring + rw [heq] + exact (continuous_coordinateLaplacian hK2).neg + have hiK : Integrable (fun x => regularizedKernel (ε n) x*(h x*coordinateLaplacian χ x)) := + (hK.continuous.mul (hh.mul hcdelta)).integrable_of_hasCompactSupport + (hcsdelta.mul_left.mul_left) + have hiq : Integrable (fun x => regularizedCharge (ε n) x*(h x*χ x)) := + (hq.mul (hh.mul hχ.continuous)).integrable_of_hasCompactSupport (hχc.mul_left.mul_left) + have hip (a : Fin 3) : Integrable (fun x => dirPartial (regularizedKernel (ε n)) (axis a) x* + (h x*dirPartial χ (axis a) x)) := + ((hpK a).mul (hh.mul (hcp a).continuous)).integrable_of_hasCompactSupport + ((hcsp a).mul_left.mul_left) + have he := hharm (fun x => χ x*regularizedKernel (ε n) x) (hχ.mul hK) + hχc.mul_right (by exact (closure_mono (Function.support_mul_subset_left _ _)).trans hχU) + have heq : (fun x => h x*coordinateLaplacian (fun y => χ y*regularizedKernel (ε n) y) x) = + fun x => (regularizedKernel (ε n) x*(h x*coordinateLaplacian χ x)- + regularizedCharge (ε n) x*(h x*χ x)) + + 2*∑ a : Fin 3, dirPartial (regularizedKernel (ε n)) (axis a) x* + (h x*dirPartial χ (axis a) x) := by + ext x + rw [coordinateLaplacian_mul hχ2 hK2, laplacian_regularizedKernel (hε n).ne'] + simp only [Fin.sum_univ_three] + ring + have hisub : Integrable (fun x => regularizedKernel (ε n) x*(h x*coordinateLaplacian χ x)- + regularizedCharge (ε n) x*(h x*χ x)) := by + simpa only [Pi.sub_def] using hiK.sub hiq + have hisum : Integrable (fun x => 2*∑ a : Fin 3, + dirPartial (regularizedKernel (ε n)) (axis a) x*(h x*dirPartial χ (axis a) x)) := + (integrable_finsetSum Finset.univ (fun a _ => hip a)).const_mul 2 + rw [heq, integral_add hisub hisum, + integral_sub hiK hiq, integral_const_mul, integral_finsetSum _ (fun a _ => hip a)] at he + simp only [zero_mul, integral_zero] at he + linarith + have h1 := regularizedKernel_integral_tendsto hε hεlim (hh.mul hcdelta) hcsdelta.mul_left + have h2 := tendsto_finsetSum Finset.univ (fun a _ => + regularizedPartial_integral_tendsto hε hεlim a (hh.mul (hcp a).continuous) (hcsp a).mul_left) + have h3 := regularizedCharge_tendsto_dirac hε hεlim (hh.mul hχ.continuous) hχc.mul_left + exact tendsto_nhds_unique ((h1.add (h2.const_mul 2)).congr' (Filter.Eventually.of_forall hn)) h3 + +def cutoffHarmonicKernel (χ : Position → ℝ) (x : Position) : ℝ := + (coulombKernel x*coordinateLaplacian χ x + + 2*∑ a : Fin 3, coulombPartial a x*dirPartial χ (axis a) x)/(4*Real.pi) + +theorem contDiffAt_coulombKernel {x : Position} (hx : x ≠ 0) : + ContDiffAt ℝ ∞ coulombKernel x := by + have he : coulombKernel = fun x : Position => (‖x‖^2)^(-1/2 : ℝ) := + funext coulombKernel_eq_rpow + rw [he] + exact (contDiff_norm_sq ℝ).contDiffAt.rpow_const_of_ne + (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)) + +theorem contDiffAt_coulombPartial (a : Fin 3) {x : Position} (hx : x ≠ 0) : + ContDiffAt ℝ ∞ (coulombPartial a) x := by + exact (EuclideanSpace.proj a).contDiff.contDiffAt.neg.mul + ((contDiff_norm_sq ℝ).contDiffAt.rpow_const_of_ne (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx))) + +theorem contDiff_coordinateLaplacian {χ : Position → ℝ} (hχ : ContDiff ℝ ∞ χ) : + ContDiff ℝ ∞ (coordinateLaplacian χ) := by + have he : coordinateLaplacian χ = fun x => ∑ a : Fin 3, + dirPartial (dirPartial χ (axis a)) (axis a) x := funext (fun x => + coordinateLaplacian_eq_partials + (hχ.of_le (show (2 : WithTop ℕ∞) ≤ ∞ by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt) + rw [he] + apply ContDiff.sum + intro a _ + have hp : ContDiff ℝ ∞ (dirPartial χ (axis a)) := + contDiff_partial (n := ∞) (by simpa using hχ) (axis a) + exact contDiff_partial (n := ∞) (by simpa using hp) (axis a) + +theorem cutoffHarmonicKernel_eq_zero_of_eventually_const {χ : Position → ℝ} {x : Position} + {c : ℝ} (hχ : χ =ᶠ[𝓝 x] fun _ => c) : cutoffHarmonicKernel χ x = 0 := by + have hdelta : coordinateLaplacian χ x = 0 := by + rw [coordinateLaplacian_congr_nhds hχ] + simp [coordinateLaplacian] + have hp (a : Fin 3) : dirPartial χ (axis a) x = 0 := by + unfold dirPartial + rw [hχ.fderiv_eq] + simp + simp [cutoffHarmonicKernel, hdelta, hp] + +theorem hasCompactSupport_cutoffHarmonicKernel {χ : Position → ℝ} + (hχc : HasCompactSupport χ) : HasCompactSupport (cutoffHarmonicKernel χ) := by + apply hχc.of_isClosed_subset (isClosed_tsupport _) + apply closure_minimal _ (isClosed_tsupport χ) + intro x hx + by_contra h + exact hx (cutoffHarmonicKernel_eq_zero_of_eventually_const + (notMem_tsupport_iff_eventuallyEq.mp h)) + +theorem contDiff_cutoffHarmonicKernel {χ : Position → ℝ} + (hχ : ContDiff ℝ ∞ χ) (hχ0 : χ =ᶠ[𝓝 (0 : Position)] fun _ => (1 : ℝ)) : + ContDiff ℝ ∞ (cutoffHarmonicKernel χ) := by + apply contDiff_iff_contDiffAt.mpr + intro x + by_cases hx : x = 0 + · subst x + have he : cutoffHarmonicKernel χ =ᶠ[𝓝 (0 : Position)] fun _ => (0 : ℝ) := by + filter_upwards [hχ0.eventually_nhds] with x hx + exact cutoffHarmonicKernel_eq_zero_of_eventually_const hx + exact contDiffAt_const.congr_of_eventuallyEq he + · have hp (a : Fin 3) : ContDiffAt ℝ ∞ (dirPartial χ (axis a)) x := + (contDiff_partial (n := ∞) (by simpa using hχ) (axis a)).contDiffAt + apply ContDiffAt.div_const + apply ContDiffAt.add + · exact (contDiffAt_coulombKernel hx).mul (contDiff_coordinateLaplacian hχ).contDiffAt + · apply contDiffAt_const.mul + apply ContDiffAt.sum + intro a _ + exact (contDiffAt_coulombPartial a hx).mul (hp a) + +theorem coulombPartial_bound (a : Fin 3) (x : Position) : + ‖coulombPartial a x‖ ≤ (coulombKernel x)^2 := by + by_cases hx : x = 0 + · subst x + simp [coulombPartial, coulombKernel] + · have hε : ∀ n : ℕ, ((n:ℝ)+1)⁻¹ ≠ 0 := fun n => by positivity + have hlim : Tendsto (fun n : ℕ => ((n:ℝ)+1)⁻¹) atTop (𝓝 (0 : ℝ)) := + tendsto_inv_atTop_zero.comp (tendsto_atTop_add_const_right _ 1 tendsto_natCast_atTop_atTop) + exact le_of_tendsto (regularizedPartial_tendsto hε hlim a hx).norm + (Filter.Eventually.of_forall (fun n => dirPartial_regularizedKernel_bound (hε n) a hx)) + +theorem measurable_coulombPartial (a : Fin 3) : Measurable (coulombPartial a) := by + exact (EuclideanSpace.proj a).continuous.measurable.neg.mul + ((continuous_norm.measurable.pow_const (2 : ℕ)).pow_const (-3/2 : ℝ)) + +theorem coulombPartial_integrable_mul_compact (a : Fin 3) {φ : Position → ℝ} + (hφ : Continuous φ) (hφc : HasCompactSupport φ) : + Integrable (fun x => coulombPartial a x*φ x) := by + have hb : Integrable (fun x => (coulombKernel x)^2*‖φ x‖) := by + simpa only [smul_eq_mul] using + locallyIntegrable_coulombKernel_sq.integrable_smul_right_of_hasCompactSupport hφ.norm hφc.norm + apply hb.mono' ((measurable_coulombPartial a).aestronglyMeasurable.mul hφ.aestronglyMeasurable) + exact Filter.Eventually.of_forall (fun x => by + change ‖coulombPartial a x*φ x‖ ≤ _ + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (coulombPartial_bound a x) (norm_nonneg _)) + +theorem weak_harmonic_reproduction_kernel {h χ : Position → ℝ} {U : Set Position} + (hh : Continuous h) (hharm : HasWeakLaplacian h U (fun _ => 0)) + (hχ : ContDiff ℝ ∞ χ) (hχc : HasCompactSupport χ) (hχU : tsupport χ ⊆ U) + (hχone : χ 0 = 1) : + (∫ x, cutoffHarmonicKernel χ x*h x) = h 0 := by + have hcdelta := (contDiff_coordinateLaplacian hχ).continuous + have hcsdelta := hasCompactSupport_coordinateLaplacian hχc + have hcp (a : Fin 3) : Continuous (dirPartial χ (axis a)) := + (contDiff_partial (n := ∞) (by simpa using hχ) (axis a)).continuous + have hcsp (a : Fin 3) := hasCompactSupport_partial hχc (axis a) + have hiK : Integrable (fun x => coulombKernel x*(h x*coordinateLaplacian χ x)) := by + simpa only [smul_eq_mul, Pi.mul_apply] using + locallyIntegrable_coulombKernel.integrable_smul_right_of_hasCompactSupport + (hh.mul hcdelta) hcsdelta.mul_left + have hip (a : Fin 3) : Integrable (fun x => coulombPartial a x*(h x*dirPartial χ (axis a) x)) := + coulombPartial_integrable_mul_compact a (hh.mul (hcp a)) (hcsp a).mul_left + have hisum : Integrable (fun x => 2*∑ a : Fin 3, coulombPartial a x*(h x*dirPartial χ (axis a) x)) := + (integrable_finsetSum Finset.univ (fun a _ => hip a)).const_mul 2 + have heq : (fun x => cutoffHarmonicKernel χ x*h x) = fun x => + (4*Real.pi)⁻¹*((coulombKernel x*(h x*coordinateLaplacian χ x))+ + 2*∑ a : Fin 3, coulombPartial a x*(h x*dirPartial χ (axis a) x)) := by + ext x + simp only [cutoffHarmonicKernel, Fin.sum_univ_three] + ring + rw [heq, integral_const_mul, integral_add hiK hisum, integral_const_mul, + integral_finsetSum _ (fun a _ => hip a), weak_harmonic_reproduction hh hharm hχ hχc hχU, hχone] + field_simp + +theorem coordinateLaplacian_sub_right (φ : Position → ℝ) (x z : Position) : + coordinateLaplacian (fun y => φ (y-z)) x = coordinateLaplacian φ (x-z) := by + unfold coordinateLaplacian + apply Finset.sum_congr rfl + intro a _ + have he : (fun t : ℝ => φ ((x+t • axis a)-z)) = fun t => φ ((x-z)+t • axis a) := by + ext t + congr 1 + abel + rw [he] + +theorem HasWeakLaplacian.translate {h q : Position → ℝ} {U : Set Position} + (hh : HasWeakLaplacian h U q) (z : Position) : + HasWeakLaplacian (fun x => h (z+x)) {x | z+x ∈ U} (fun x => q (z+x)) := by + intro φ hφ hφc hφU + have hc : ContDiff ℝ ∞ (fun y => φ (y-z)) := hφ.comp (contDiff_id.sub contDiff_const) + have hcs : HasCompactSupport (fun y => φ (y-z)) := + hφc.comp_homeomorph (Homeomorph.subRight z) + have hs : tsupport (fun y => φ (y-z)) ⊆ U := by + have hsub := tsupport_comp_subset_preimage φ (show Continuous (fun y : Position => y-z) by fun_prop) + intro y hy + have hy' : y-z ∈ tsupport φ := hsub hy + have hh' := hφU hy' + change z+(y-z) ∈ U at hh' + rw [show z+(y-z) = y by abel] at hh' + exact hh' + have he := hh (fun y => φ (y-z)) hc hcs hs + simp_rw [coordinateLaplacian_sub_right] at he + have hl := integral_add_left_eq_self (μ := volume) (fun y => h y*coordinateLaplacian φ (y-z)) z + have hr := integral_add_left_eq_self (μ := volume) (fun y => q y*φ (y-z)) z + simpa only [add_sub_cancel_left] using hl.trans (he.trans hr.symm) + +theorem weak_harmonic_reproduction_at {h χ : Position → ℝ} {U : Set Position} + (hh : Continuous h) (hharm : HasWeakLaplacian h U (fun _ => 0)) + (hχ : ContDiff ℝ ∞ χ) (hχc : HasCompactSupport χ) (hχone : χ 0 = 1) + {z : Position} (hχU : ∀ x ∈ tsupport χ, z+x ∈ U) : + (∫ x, cutoffHarmonicKernel χ (x-z)*h x) = h z := by + have he := weak_harmonic_reproduction_kernel + (hh.comp (show Continuous (fun x : Position => z+x) by fun_prop)) + (hharm.translate z) hχ hχc hχU hχone + have hl := integral_add_left_eq_self (μ := volume) (fun x => cutoffHarmonicKernel χ (x-z)*h x) z + simp only [add_sub_cancel_left] at hl + simpa only [Function.comp_apply, add_zero] using hl.symm.trans he + +theorem harmonic_value_bound {h χ : Position → ℝ} {U W : Set Position} {M : ℝ} + (hh : Continuous h) (hharm : HasWeakLaplacian h U (fun _ => 0)) + (hχ : ContDiff ℝ ∞ χ) (hχc : HasCompactSupport χ) (hχone : χ 0 = 1) + (hW : IsCompact W) (hM : ∀ x, ‖cutoffHarmonicKernel χ x‖ ≤ M) + {z : Position} (hχU : ∀ x ∈ tsupport χ, z+x ∈ U) + (hχW : ∀ x ∈ tsupport χ, z+x ∈ W) : + ‖h z‖ ≤ M*(∫ x in W, ‖h x‖) := by + have hzero : ∀ x, x ∉ W → cutoffHarmonicKernel χ (x-z)*h x = 0 := by + intro x hx + have hh' : x-z ∉ tsupport χ := by + intro hm + have he := hχW (x-z) hm + rw [show z+(x-z)=x by abel] at he + exact hx he + rw [cutoffHarmonicKernel_eq_zero_of_eventually_const + (notMem_tsupport_iff_eventuallyEq.mp hh'), zero_mul] + rw [← weak_harmonic_reproduction_at hh hharm hχ hχc hχone hχU, + ← setIntegral_eq_integral_of_forall_compl_eq_zero hzero] + have hi : IntegrableOn (fun x => M * ‖h x‖) W volume := + (hh.norm.continuousOn.integrableOn_compact hW).const_mul M + have hb := norm_integral_le_of_norm_le + (f := fun x => cutoffHarmonicKernel χ (x-z)*h x) hi + (Filter.Eventually.of_forall (fun x => by + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (hM (x-z)) (norm_nonneg _))) + simpa only [integral_const_mul] using hb + +theorem harmonic_difference_bound {h χ : Position → ℝ} {U W : Set Position} {L : NNReal} + (hh : Continuous h) (hharm : HasWeakLaplacian h U (fun _ => 0)) + (hχ : ContDiff ℝ ∞ χ) (hχc : HasCompactSupport χ) + (hχ0 : χ =ᶠ[𝓝 (0 : Position)] fun _ => (1 : ℝ)) (hW : IsCompact W) + (hL : LipschitzWith L (cutoffHarmonicKernel χ)) + {z z' : Position} (hχU : ∀ x ∈ tsupport χ, z+x ∈ U) + (hχU' : ∀ x ∈ tsupport χ, z'+x ∈ U) + (hχW : ∀ x ∈ tsupport χ, z+x ∈ W) + (hχW' : ∀ x ∈ tsupport χ, z'+x ∈ W) : + ‖h z-h z'‖ ≤ (L:ℝ)*(∫ x in W, ‖h x‖)*‖z-z'‖ := by + have hcQ := (contDiff_cutoffHarmonicKernel hχ hχ0).continuous + have hi (v : Position) : IntegrableOn (fun x => cutoffHarmonicKernel χ (x-v)*h x) W := + ((hcQ.comp (show Continuous (fun x : Position => x-v) by fun_prop)).mul hh).continuousOn.integrableOn_compact hW + have hrepro (v : Position) (hvU : ∀ x ∈ tsupport χ, v+x ∈ U) + (hvW : ∀ x ∈ tsupport χ, v+x ∈ W) : + (∫ x in W, cutoffHarmonicKernel χ (x-v)*h x) = h v := by + rw [setIntegral_eq_integral_of_forall_compl_eq_zero] + · exact weak_harmonic_reproduction_at hh hharm hχ hχc hχ0.eq_of_nhds hvU + · intro x hx + have hh' : x-v ∉ tsupport χ := by + intro hm + have he := hvW (x-v) hm + rw [show v+(x-v)=x by abel] at he + exact hx he + rw [cutoffHarmonicKernel_eq_zero_of_eventually_const + (notMem_tsupport_iff_eventuallyEq.mp hh'), zero_mul] + rw [← hrepro z hχU hχW, ← hrepro z' hχU' hχW', ← integral_sub (hi z) (hi z')] + have hb : ∀ x, ‖cutoffHarmonicKernel χ (x-z)*h x-cutoffHarmonicKernel χ (x-z')*h x‖ ≤ + ((L:ℝ)*‖z-z'‖)*‖h x‖ := by + intro x + rw [← sub_mul, norm_mul] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + have he := hL.norm_sub_le (x-z) (x-z') + simpa only [show (x-z)-(x-z')=z'-z by abel, norm_sub_rev z' z] using he + have hibound : IntegrableOn (fun x => ((L:ℝ)*‖z-z'‖)*‖h x‖) W volume := + (hh.norm.continuousOn.integrableOn_compact hW).const_mul _ + have hbound := norm_integral_le_of_norm_le hibound + (Filter.Eventually.of_forall hb) + rw [integral_const_mul] at hbound + convert hbound using 1 + ring + +theorem harmonic_interior_estimates {r : ℝ} (hr : 0 < r) : + ∃ C : ℝ, 0 < C ∧ ∀ (c : Position) (h : Position → ℝ), Continuous h → + HasWeakLaplacian h (Metric.ball c (2*r)) (fun _ => 0) → + (∀ z ∈ Metric.closedBall c r, ‖h z‖ ≤ C*(∫ x in Metric.closedBall c (2*r), ‖h x‖)) ∧ + (∀ z ∈ Metric.closedBall c r, ∀ z' ∈ Metric.closedBall c r, + ‖h z-h z'‖ ≤ C*(∫ x in Metric.closedBall c (2*r), ‖h x‖)*‖z-z'‖) := by + let χ : ContDiffBump (0 : Position) := ⟨r/4, r/2, by linarith, by linarith⟩ + have hχ0 : (χ : Position → ℝ) =ᶠ[𝓝 (0 : Position)] fun _ => (1 : ℝ) := + χ.eventuallyEq_one + have hQ := contDiff_cutoffHarmonicKernel χ.contDiff hχ0 + have hQc := hasCompactSupport_cutoffHarmonicKernel χ.hasCompactSupport + obtain ⟨M, hM⟩ := hQc.exists_bound_of_continuous hQ.continuous + obtain ⟨L, hL⟩ := ContDiff.lipschitzWith_of_hasCompactSupport hQc hQ (by simp) + let C : ℝ := max M L+1 + have hLC : (L : ℝ) ≤ C := by + dsimp [C] + linarith [le_max_right M (L : ℝ)] + have hMC : M ≤ C := by + dsimp [C] + linarith [le_max_left M (L : ℝ)] + have hC : 0 < C := by + dsimp [C] + linarith [le_max_right M (L : ℝ), L.coe_nonneg] + refine ⟨C, hC, ?_⟩ + intro c h hh hharm + have hs {z : Position} (hz : z ∈ Metric.closedBall c r) : + ∀ x ∈ tsupport (χ : Position → ℝ), z+x ∈ Metric.ball c (2*r) := by + intro x hx + rw [χ.tsupport_eq] at hx + have hx' : ‖x‖ ≤ r/2 := by simpa only [Metric.mem_closedBall, dist_zero_right] using hx + have hz' : ‖z-c‖ ≤ r := by simpa only [Metric.mem_closedBall, dist_eq_norm] using hz + rw [Metric.mem_ball, dist_eq_norm, show z+x-c = (z-c)+x by abel] + exact lt_of_le_of_lt ((norm_add_le _ _).trans (add_le_add hz' hx')) (by linarith) + have hsW {z : Position} (hz : z ∈ Metric.closedBall c r) : + ∀ x ∈ tsupport (χ : Position → ℝ), z+x ∈ Metric.closedBall c (2*r) := + fun x hx => Metric.ball_subset_closedBall (hs hz x hx) + have hI : 0 ≤ ∫ x in Metric.closedBall c (2*r), ‖h x‖ := integral_nonneg (fun _ => norm_nonneg _) + constructor + · intro z hz + exact (harmonic_value_bound hh hharm χ.contDiff χ.hasCompactSupport hχ0.eq_of_nhds + (isCompact_closedBall c (2*r)) hM (hs hz) (hsW hz)).trans (mul_le_mul_of_nonneg_right hMC hI) + · intro z hz z' hz' + exact (harmonic_difference_bound hh hharm χ.contDiff χ.hasCompactSupport hχ0 + (isCompact_closedBall c (2*r)) hL (hs hz) (hs hz') (hsW hz) (hsW hz')).trans + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hLC hI) (norm_nonneg _)) + +theorem HasWeakLaplacian.congrOn {h g q : Position → ℝ} {U : Set Position} + (hh : HasWeakLaplacian h U q) (he : Set.EqOn h g U) : HasWeakLaplacian g U q := by + intro φ hφ hφc hφU + calc + (∫ x, g x*coordinateLaplacian φ x) = ∫ x, h x*coordinateLaplacian φ x := by + apply integral_congr_ae + apply Filter.Eventually.of_forall + intro x + change g x*coordinateLaplacian φ x = h x*coordinateLaplacian φ x + by_cases hx : x ∈ tsupport φ + · rw [he (hφU hx)] + · simp only [coordinateLaplacian_eq_zero_of_notMem_tsupport hx, mul_zero] + _ = _ := hh φ hφ hφc hφU + +theorem harmonic_interior_estimates_local {r : ℝ} (hr : 0 < r) : + ∃ C : ℝ, 0 < C ∧ ∀ (c : Position) (h : Position → ℝ), + ContinuousOn h (Metric.ball c (3*r)) → + HasWeakLaplacian h (Metric.ball c (2*r)) (fun _ => 0) → + (∀ z ∈ Metric.closedBall c r, ‖h z‖ ≤ C*(∫ x in Metric.closedBall c (2*r), ‖h x‖)) ∧ + (∀ z ∈ Metric.closedBall c r, ∀ z' ∈ Metric.closedBall c r, + ‖h z-h z'‖ ≤ C*(∫ x in Metric.closedBall c (2*r), ‖h x‖)*‖z-z'‖) := by + obtain ⟨C, hC, hest⟩ := harmonic_interior_estimates hr + refine ⟨C, hC, ?_⟩ + intro c h hh hharm + let η : ContDiffBump c := ⟨2*r, 5*r/2, by positivity, by linarith⟩ + let g : Position → ℝ := fun x => η x*h x + have hgOn : ContinuousOn g (Metric.ball c (3*r)) := η.continuous.continuousOn.mul hh + have hg : Continuous g := hgOn.continuous_of_tsupport_subset Metric.isOpen_ball (by + intro x hx + have hx' : x ∈ tsupport (η : Position → ℝ) := + closure_mono (Function.support_mul_subset_left _ _) hx + rw [η.tsupport_eq] at hx' + have hd : dist x c ≤ 5*r/2 := hx' + exact lt_of_le_of_lt hd (by linarith)) + have he : Set.EqOn g h (Metric.closedBall c (2*r)) := by + intro x hx + dsimp [g] + rw [η.one_of_mem_closedBall hx, one_mul] + have hgarm : HasWeakLaplacian g (Metric.ball c (2*r)) (fun _ => 0) := + hharm.congrOn (fun x hx => (he (Metric.ball_subset_closedBall hx)).symm) + have hI : (∫ x in Metric.closedBall c (2*r), ‖g x‖) = + ∫ x in Metric.closedBall c (2*r), ‖h x‖ := by + apply setIntegral_congr_fun measurableSet_closedBall + intro x hx + change ‖g x‖ = ‖h x‖ + rw [he hx] + have hes {z : Position} (hz : z ∈ Metric.closedBall c r) : g z = h z := + he (Metric.closedBall_subset_closedBall (by linarith) hz) + obtain ⟨hval, hdiff⟩ := hest c g hg hgarm + constructor + · intro z hz + simpa only [hes hz, hI] using hval z hz + · intro z hz z' hz' + simpa only [hes hz, hes hz', hI] using hdiff z hz z' hz' + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/HarmonicScale.lean b/lean/OAI/Analysis/CoulombRadii/Localization/HarmonicScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..585559d7b55f11f1a409e3978b8278287082378a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/HarmonicScale.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.CorrectionDensity + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped Topology BigOperators ContDiff +noncomputable section +namespace NeutralAtom +theorem tsupport_coordinateLaplacian_subset (φ : Position → ℝ) : + tsupport (coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport φ) + intro x hx + by_contra hn + exact hx (coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + +theorem local_harmonic_part {F σ ρ : Position → ℝ} {U : Set Position} {A : ℝ} + (hU : IsOpen U) (hF : ContinuousOn F U) + (hpoisson : HasWeakLaplacian F U (fun x => 4*Real.pi*σ x)) + (hρ : Integrable ρ) (hρpos : ∀ x, 0 ≤ ρ x) (hρbd : ∀ x, ρ x ≤ A) + (he : Set.EqOn σ ρ U) : + HasWeakLaplacian (fun x => F x+potentialOf ρ x) U (fun _ => 0) := by + intro φ hφ hφc hφU + have hφ2 : ContDiff ℝ 2 φ := hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top) + have hiF : Integrable (fun x => F x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt (fun x hx => + hU.continuousOn_iff.mp hF (hφU (tsupport_coordinateLaplacian_subset φ hx))) + (continuous_coordinateLaplacian hφ2) (hasCompactSupport_coordinateLaplacian hφc) + have hiP : Integrable (fun x => potentialOf ρ x*coordinateLaplacian φ x) := + ((potentialOf_continuous hρ hρpos hρbd).mul (continuous_coordinateLaplacian hφ2)).integrable_of_hasCompactSupport + (hasCompactSupport_coordinateLaplacian hφc).mul_left + have heq : (fun x => (F x+potentialOf ρ x)*coordinateLaplacian φ x) = + fun x => F x*coordinateLaplacian φ x+potentialOf ρ x*coordinateLaplacian φ x := by + ext x + ring + have hrho : (fun x => -(4*Real.pi)*ρ x*φ x) = fun x => -(4*Real.pi*σ x*φ x) := by + ext x + by_cases hx : x ∈ tsupport φ + · rw [he (hφU hx)] + ring + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, neg_zero] + rw [heq, integral_add hiF hiP, hpoisson φ hφ hφc hφU, + potentialOf_weakLaplacian hρ φ hφ hφc (Set.subset_univ _), hrho, integral_neg] + simp only [add_neg_cancel, zero_mul, integral_zero] + +theorem coordinateLaplacian_comp_smul (f : Position → ℝ) (D : ℝ) (x : Position) : + coordinateLaplacian (fun y => f (D • y)) x = D^2*coordinateLaplacian f (D • x) := by + unfold coordinateLaplacian + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + have he : (fun t : ℝ => f (D • (x+t • axis a))) = + (fun t : ℝ => (fun u : ℝ => f (D • x+u • axis a)) (D*t)) := by + funext t + simp only [smul_add, smul_smul] + rw [he] + have hed : (deriv fun t : ℝ => (fun u : ℝ => f (D • x+u • axis a)) (D*t)) = + (fun t : ℝ => D * deriv (fun u : ℝ => f (D • x+u • axis a)) (D*t)) := by + funext t + exact deriv_comp_mul_left D (fun u : ℝ => f (D • x+u • axis a)) t + rw [hed, deriv_const_mul_field, deriv_comp_mul_left] + simp only [smul_eq_mul, mul_zero] + ring + +theorem HasWeakLaplacian.dilate {F q : Position → ℝ} {U : Set Position} + {D : ℝ} (hD : 0 < D) (hw : HasWeakLaplacian F U q) : + HasWeakLaplacian (fun x => D^4*F (D • x)) ((fun x => D • x) ⁻¹' U) + (fun x => D^6*q (D • x)) := by + intro φ hφ hc ht + let e : Position ≃ₜ Position := Homeomorph.smul (Units.mk0 D⁻¹ (inv_ne_zero hD.ne')) + let ψ : Position → ℝ := fun x => φ (D⁻¹ • x) + have hψ : ContDiff ℝ ∞ ψ := hφ.comp (contDiff_id.const_smul D⁻¹) + have hψc : HasCompactSupport ψ := hc.comp_homeomorph e + have hψt : tsupport ψ ⊆ U := by + intro x hx + have hx' : e x ∈ tsupport φ := by + simpa only [ψ, show (fun x : Position => D⁻¹ • x) = e from rfl, + ← Function.comp_def, tsupport_comp_eq_preimage, Set.mem_preimage] using hx + have := ht hx' + simpa only [Set.mem_preimage, e, Homeomorph.smul_apply, Units.smul_def, + Units.val_mk0, smul_smul, mul_inv_cancel₀ hD.ne', one_smul] using this + have hid (x : Position) : D⁻¹ • (D • x) = x := by + rw [smul_smul, inv_mul_cancel₀ hD.ne', one_smul] + have hLap (x : Position) : coordinateLaplacian ψ (D • x) = + (D⁻¹)^2*coordinateLaplacian φ x := by + change coordinateLaplacian (fun y => φ (D⁻¹ • y)) (D • x) = _ + rw [coordinateLaplacian_comp_smul, hid] + have hleft := Measure.integral_comp_smul_of_nonneg volume + (fun x => F x*coordinateLaplacian ψ x) D (hR := hD.le) + have hright := Measure.integral_comp_smul_of_nonneg volume + (fun x => q x*ψ x) D (hR := hD.le) + simp only [Position, finrank_euclideanSpace_fin, smul_eq_mul] at hleft hright + simp_rw [hLap, show ∀ x, F (D • x)*((D⁻¹)^2*coordinateLaplacian φ x) = + (D⁻¹)^2*(F (D • x)*coordinateLaplacian φ x) by intro x; ring, + integral_const_mul] at hleft + simp only [ψ, hid] at hright + have hwe := hw ψ hψ hψc hψt + have hEq : (∫ x, F (D • x)*coordinateLaplacian φ x) = D^2*(∫ x, q (D • x)*φ x) := by + rw [hwe, ← hright] at hleft + field_simp [hD.ne'] at hleft + nlinarith [hleft] + simp_rw [mul_assoc, integral_const_mul] + rw [hEq] + ring + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/Partial.lean b/lean/OAI/Analysis/CoulombRadii/Localization/Partial.lean new file mode 100644 index 0000000000000000000000000000000000000000..0276e440c728fbe5303e37f1fbe89a5eb93bbb43 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/Partial.lean @@ -0,0 +1,185 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.AppendJensen + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def PartlySupported {n : ℕ} (u : H1Vector n) (I : Set (Fin n)) (A : Set Space) : Prop := + ∀ s : Spins n, ∀ᵐ x, ∀ i∈I, position x i∉A → u.value s x=0 + +def outIndexSet (m k : ℕ) : Set (Fin (m+k)) := Set.range (Fin.castAdd k : Fin m → Fin (m+k)) + +lemma position_reindex {m n : ℕ} (e : Fin m ≃ Fin n) (x : Configuration m) (i : Fin m) : + position (reindexConfiguration e x) (e i)=position x i := by + ext b + simp [position,reindexConfiguration] + +lemma PartlySupported.reindex {m n : ℕ} {u : H1Vector n} {I : Set (Fin n)} {A : Set Space} + (hu : PartlySupported u I A) (e : Fin m ≃ Fin n) (K : Set (Fin m)) + (hK : ∀ i∈K, e i∈I) : PartlySupported (u.reindex e) K A := by + intro s + filter_upwards [(reindexConfiguration_measurePreserving e).quasiMeasurePreserving.ae (hu (s ∘ e.symm))] with x hx + intro i hi hxA + rw [H1Vector.reindex_value] + exact hx (e i) (hK i hi) (by rwa [position_reindex]) + +lemma PartlySupported.mono_space {n : ℕ} {u : H1Vector n} {I : Set (Fin n)} {A B : Set Space} + (hu : PartlySupported u I A) (hAB : A⊆B) : PartlySupported u I B := by + intro s + filter_upwards [hu s] with x hx + exact fun i hi hh => hx i hi (fun h => hh (hAB h)) + +lemma PartlySupported.union {n : ℕ} {u : H1Vector n} {I K : Set (Fin n)} {A : Set Space} + (hu : PartlySupported u I A) (hv : PartlySupported u K A) : PartlySupported u (I∪K) A := by + intro s + filter_upwards [hu s,hv s] with x hx hy + intro i hi hh + exact hi.elim (fun h => hx i h hh) (fun h => hy i h hh) + +lemma PartlySupported.labelCut {n : ℕ} {u : H1Vector n} {I : Set (Fin n)} {A : Set Space} + (hu : PartlySupported u I A) {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → L) : PartlySupported (u.labelCut χ hχ hp D hD hd p) I A := by + intro s + filter_upwards [hu s] with x hx + intro i hi hh + change (↑(tensorCut χ p x):ℂ)*u.value s x=0 + rw [hx i hi hh,mul_zero] + +lemma labelCut_partlySupported {n : ℕ} (u : H1Vector n) {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin n → L) (I : Set (Fin n)) (l : L) (hc : ∀ i∈I, p i=l) + (A : Set Space) (hA : ∀ z∉A, χ l z=0) : + PartlySupported (u.labelCut χ hχ hp D hD hd p) I A := by + intro s + filter_upwards [] with x + intro i hi hh + have hzero : tensorCut χ p x=0 := by + apply Finset.prod_eq_zero (Finset.mem_univ i) + rw [hc i hi,hA _ hh] + change (↑(tensorCut χ p x):ℂ)*u.value s x=0 + rw [hzero,Complex.ofReal_zero,zero_mul] + +lemma PartlySupported.coreSlice {m k : ℕ} {u : H1Vector (m+k)} {A : Set Space} + (hu : PartlySupported u (coreIndexSet m k) A) (s : Spins m) : + ∀ᵐ x, SpatiallySupported (u.coreSlice s x) A := by + have hall : ∀ᵐ x : Configuration m, ∀ t : Spins k, ∀ᵐ z : Configuration k, + ∀ i∈coreIndexSet m k, position (joinConfiguration m k (x,z)) i∉A → + u.value (Fin.append s t) (joinConfiguration m k (x,z))=0 := + ae_all_iff.mpr (fun t => Measure.ae_ae_of_ae_prod + ((joinConfiguration_measurePreserving m k).quasiMeasurePreserving.ae (hu (Fin.append s t)))) + filter_upwards [u.coreSliceRegular_ae s,hall] with x hx ha + intro t + filter_upwards [ha t] with z hz hza + obtain ⟨i,hi⟩ : ∃ i : Fin k, position z i∉A := by + simpa only [allPositions,Set.mem_ofPred_eq,not_forall] using hza + rw [u.coreSlice_value s hx] + exact hz (Fin.natAdd m i) ⟨i,rfl⟩ (by rwa [position_join_right]) + +lemma PartlySupported.recorded_positions {m k : ℕ} {u : H1Vector (m+k)} {A : Set Space} + (hu : PartlySupported u (outIndexSet m k) A) (s : Spins m) : + ∀ᵐ x, mass (u.coreSlice s x)≠0 → ∀ i : Fin m, position x i∈A := by + have hall : ∀ᵐ x : Configuration m, ∀ t : Spins k, ∀ᵐ z : Configuration k, + ∀ i∈outIndexSet m k, position (joinConfiguration m k (x,z)) i∉A → + u.value (Fin.append s t) (joinConfiguration m k (x,z))=0 := + ae_all_iff.mpr (fun t => Measure.ae_ae_of_ae_prod + ((joinConfiguration_measurePreserving m k).quasiMeasurePreserving.ae (hu (Fin.append s t)))) + filter_upwards [u.coreSliceRegular_ae s,hall] with x hx ha + intro hm i + by_contra hi + apply hm + unfold mass + apply Finset.sum_eq_zero + intro t ht + apply integral_eq_zero_of_ae + filter_upwards [ha t] with z hz + rw [u.coreSlice_value s hx,hz (Fin.castAdd k i) ⟨i,rfl⟩ (by rwa [position_join_left])] + norm_num + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma appendCut_coreSupported {m n : ℕ} (u : H1Vector (m+n)) {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) (l : L) + (hc : ∀ i : Fin k, p (Fin.natAdd m (e (Fin.natAdd q i)))=l) + (A : Set Space) (hA : ∀ z∉A, χ l z=0) : + PartlySupported (u.appendCut χ hχ hp D hD hd p e) (coreIndexSet (m+q) k) A := by + let I : Set (Fin (m+n)) := Set.range (fun i : Fin k => Fin.natAdd m (e (Fin.natAdd q i))) + let K : Set (Fin (m+(q+k))) := Set.range (fun i : Fin k => Fin.natAdd m (Fin.natAdd q i)) + have hcut := labelCut_partlySupported u χ hχ hp D hD hd p I l (by rintro i ⟨j,rfl⟩; exact hc j) A hA + have hsort := hcut.reindex (coreReindex m e) K (by + rintro i ⟨j,rfl⟩ + exact ⟨j,by rw [coreReindex_right]⟩) + exact hsort.reindex (recordAssoc m q k) (coreIndexSet (m+q) k) (by + rintro i ⟨j,rfl⟩ + exact ⟨j,by rw [recordAssoc_right]⟩) + +lemma appendCut_outSupported {m n : ℕ} {u : H1Vector (m+n)} {A : Set Space} + (hu : PartlySupported u (outIndexSet m n) A) {L : Type*} [Fintype L] + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → L) {q k : ℕ} (e : Fin (q+k) ≃ Fin n) (l : L) + (hc : ∀ i : Fin q, p (Fin.natAdd m (e (Fin.castAdd k i)))=l) + (B : Set Space) (hB : ∀ z∉B, χ l z=0) : + PartlySupported (u.appendCut χ hχ hp D hD hd p e) (outIndexSet (m+q) k) (A∪B) := by + let I : Set (Fin (m+n)) := Set.range (fun i : Fin q => Fin.natAdd m (e (Fin.castAdd k i))) + let K : Set (Fin (m+(q+k))) := Set.range (fun i : Fin q => Fin.natAdd m (Fin.castAdd k i)) + have hnew := labelCut_partlySupported u χ hχ hp D hD hd p I l (by rintro i ⟨j,rfl⟩; exact hc j) B hB + have hold := hu.labelCut χ hχ hp D hD hd p + have hcut := (hold.mono_space (Set.subset_union_left : A⊆A∪B)).union + (hnew.mono_space (Set.subset_union_right : B⊆A∪B)) + have hsort := hcut.reindex (coreReindex m e) (outIndexSet m (q+k)∪K) (by + intro i hi + rcases hi with ⟨j,rfl⟩|⟨j,rfl⟩ + · left + exact ⟨j,by rw [coreReindex_left]⟩ + · right + exact ⟨j,by rw [coreReindex_right]⟩) + apply hsort.reindex (recordAssoc m q k) (outIndexSet (m+q) k) + rintro i ⟨j,rfl⟩ + refine Fin.addCases (fun l => ?_) (fun l => ?_) j + · left + exact ⟨l,by rw [recordAssoc_left]⟩ + · right + exact ⟨l,by rw [recordAssoc_middle]⟩ + +theorem binary_append_cut_outcome {m n : ℕ} (u : H1Vector (m+n)) + (hu : PartlyAntisymmetric u (coreIndexSet m n)) {A : Set Space} + (hA : PartlySupported u (outIndexSet m n) A) + (χ : Fin 2 → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (p : Fin (m+n) → Fin 2) (B C : Set Space) + (hB : ∀ z∉B, χ 0 z=0) (hC : ∀ z∉C, χ 1 z=0) : + ∃ q k : ℕ, ∃ e : Fin (q+k) ≃ Fin n, + PartlyAntisymmetric (u.appendCut χ hχ hp D hD hd p e) (coreIndexSet (m+q) k) ∧ + PartlySupported (u.appendCut χ hχ hp D hD hd p e) (coreIndexSet (m+q) k) C ∧ + PartlySupported (u.appendCut χ hχ hp D hD hd p e) (outIndexSet (m+q) k) (A∪B) := by + obtain ⟨q,k,e,he0,he1⟩ := exists_binary_order (fun i : Fin n => p (Fin.natAdd m i)) + exact ⟨q,k,e,appendCut_partlyAntisymmetric hu χ hχ hp D hD hd p e 1 he1, + appendCut_coreSupported u χ hχ hp D hD hd p e 1 he1 C hC, + appendCut_outSupported hA χ hχ hp D hD hd p e 0 he0 B hB⟩ + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/RadialAppend.lean b/lean/OAI/Analysis/CoulombRadii/Localization/RadialAppend.lean new file mode 100644 index 0000000000000000000000000000000000000000..b0356f28d664c0c294429c0aa5346401eb5450c9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/RadialAppend.lean @@ -0,0 +1,124 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedCount +import OAI.Analysis.CoulombRadii.Localization.Partial + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +theorem radial_append_raw_gain {J m n : ℕ} (S : Nuclei J) + (u : H1Vector (m+n)) (hu : PartlyAntisymmetric u (coreIndexSet m n)) + (A : Set Space) (hA : PartlySupported u (outIndexSet m n) A) + {a E : ℝ} (ha : 0 u.appendCut χ (radialCut_smooth y (40*a)) + (radialCut_partition y (40*a)) D + (div_nonneg radialCutCoefficient_pos.le (by positivity)) + (radialCut_derivative_bound y (by positivity)) p (e p) + (∑ p, mass (v p))=mass u ∧ + (∀ p, PartlyAntisymmetric (v p) (coreIndexSet (m+q p) (k p))) ∧ + (∀ p, PartlySupported (v p) (coreIndexSet (m+q p) (k p)) {z | 40*a ≤ ‖z-y‖}) ∧ + (∀ p, PartlySupported (v p) (outIndexSet (m+q p) (k p)) (A∪Metric.closedBall y (80*a))) ∧ + (∀ W : Configuration (m+n) → ℝ, Measurable W → (∃ B : ℝ, ∀ x, |W x| ≤ B) → + (∑ p, potentialForm (W ∘ reindexConfiguration (coreReindex m (e p)) ∘ + reindexConfiguration (recordAssoc m (q p) (k p))) (v p))=potentialForm W u) ∧ + a/(16*ballTrialCoefficient)*sliceExpectation u (fun s x => + (max (coreConditionalObservable u + (rawSignedField (attraction S y) {z | 40*a ≤ ‖z-y‖} y) s x) 0)^2) ≤ + form S u+3*D^2*expectedPopulation u (Metric.closedBall y (80*a))- + (∑ p, conditionalOutCost S (v p))-E*mass u+ + (4*ballTrialCoefficient*(screenBaseMass a)^2/a)*mass u := by + have hr : 0<40*a := by positivity + let χ := radialCut y (40*a) + let D := radialCutCoefficient/(40*a) + have hD : 0≤D := div_nonneg radialCutCoefficient_pos.le hr.le + have hc : ∀ z∉{z : Space | 40*a ≤ ‖z-y‖}, χ 1 z=0 := by + intro z hz + exact radialCut_core_zero y hr z (le_of_lt (by simpa only [Set.mem_ofPred_eq,not_le] using hz)) + have ho : ∀ z∉Metric.closedBall y (80*a), χ 0 z=0 := by + intro z hz + apply radialCut_out_zero y hr + have h : 80*a < ‖z-y‖ := by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hz + linarith + have H (p : Fin (m+n) → Fin 2) := binary_append_cut_outcome u hu hA χ + (radialCut_smooth y (40*a)) (radialCut_partition y (40*a)) D hD + (radialCut_derivative_bound y hr) p _ _ ho hc + choose q k e hanti hcore hout using H + let v := fun p : Fin (m+n) → Fin 2 => u.appendCut χ (radialCut_smooth y (40*a)) + (radialCut_partition y (40*a)) D hD (radialCut_derivative_bound y hr) p (e p) + have hm : (∑ p, mass (v p))=mass u := by + simp only [v,mass_appendCut] + exact mass_labelCut u χ _ _ _ _ _ + have hs (p) (s : Spins (m+q p)) : ∀ᵐ x, + SpatiallySupported ((v p).coreSlice s x).normalized {z | 40*a ≤ ‖z-y‖} := by + filter_upwards [(hcore p).coreSlice s] with x hx + exact hx.normalized + have hconserve (W : Configuration (m+n) → ℝ) (hW : Measurable W) + (hB : ∃ B : ℝ, ∀ x, |W x| ≤ B) : + (∑ p, potentialForm (W ∘ reindexConfiguration (coreReindex m (e p)) ∘ + reindexConfiguration (recordAssoc m (q p) (k p))) (v p))=potentialForm W u := by + simp only [v,potentialForm_appendCut] + obtain ⟨B,hB⟩ := hB + exact potentialForm_labelCut u χ _ _ _ _ _ W hW hB + have hclosed : IsClosed {z : Space | 40*a ≤ ‖z-y‖} := isClosed_le continuous_const (by fun_prop) + have hg (p : Fin (m+n) → Fin 2) : + a/(16*ballTrialCoefficient)*sliceExpectation (v p) (fun s x => + (max (coreScreenedField S ((v p).coreSlice s x).normalized y) 0)^2) ≤ + form S (v p)-conditionalOutCost S (v p)-E*mass (v p)+ + (4*ballTrialCoefficient*(screenBaseMass a)^2/a)*mass (v p) := by + have HG := conditional_positive_field_gain S (v p) ((hanti p).coreSlice) ha y _ hclosed + (hs p) (fun z hz => by change 40*a ≤ ‖z-y‖ at hz; linarith) hnuc hE + rw [form_eq_conditionalOutCost S (v p)] + linarith + have HI : (∑ p, form S (v p)) ≤ form S u+3*D^2*expectedPopulation u (Metric.closedBall y (80*a)) := by + simp only [v,form_appendCut] + have HI := form_radial_labelCut S u y hr + have heq : 2*(40*a)=80*a := by ring + rw [heq] at HI + exact HI + have HG := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hg p) + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum,hm] at HG + have hraw (p) : sliceExpectation (v p) (fun s x => + (max (coreConditionalObservable (v p) (rawSignedField (attraction S y) {z | 40*a ≤ ‖z-y‖} y) s x) 0)^2) ≤ + sliceExpectation (v p) (fun s x => (max (coreScreenedField S ((v p).coreSlice s x).normalized y) 0)^2) := by + apply Finset.sum_le_sum + intro s hs0 + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)) + · exact coreField_positive_square_weight_integrable S (v p) s y + · filter_upwards [hs p s] with x hx + exact raw_posterior_positive_le_core S (v p) ha y s x hx + let W : Configuration (m+n) → ℝ := rawSignedField (attraction S y) {z | 40*a ≤ ‖z-y‖} y + have hW : Measurable W := rawSignedField_measurable _ hclosed.measurableSet y + let B := |attraction S y|+((m+n:ℕ):ℝ)/(40*a) + have hB0 : 0≤B := by dsimp [B]; positivity + have hB : ∀ x, |W x| ≤ B := rawSignedField_abs_le _ _ y hr (fun _ h => h) + have HJ := appendCut_positive_jensen u χ (radialCut_smooth y (40*a)) (radialCut_partition y (40*a)) D hD (radialCut_derivative_bound y hr) q k e W hW hB0 hB + have heq (p) : W ∘ reindexConfiguration (coreReindex m (e p)) ∘ reindexConfiguration (recordAssoc m (q p) (k p))= + rawSignedField (attraction S y) {z | 40*a ≤ ‖z-y‖} y := by + funext x + simp only [W,Function.comp_apply,rawSignedField_reindex] + simp only [heq] at HJ + have HJL := HJ.trans (Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hraw p)) + have hcoef : 0≤a/(16*ballTrialCoefficient) := div_nonneg ha.le (mul_nonneg (by norm_num) ballTrialCoefficient_pos.le) + have HK := mul_le_mul_of_nonneg_left HJL hcoef + refine ⟨q,k,e,hm,hanti,hcore,hout,hconserve,?_⟩ + change a/(16*ballTrialCoefficient)*sliceExpectation u (fun s x => (max (coreConditionalObservable u W s x) 0)^2) ≤ _ + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/RadialCut.lean b/lean/OAI/Analysis/CoulombRadii/Localization/RadialCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..72e2db1417948bd254c703c1e1101b5a6acc2542 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/RadialCut.lean @@ -0,0 +1,184 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.CutCombinatorics + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff +namespace Coulomb + +def cutSeed (x : Space) : ℝ := Real.smoothTransition ((4-‖x‖^2)/3) +lemma cutSeed_smooth : ContDiff ℝ ∞ cutSeed := by + exact Real.smoothTransition.contDiff.comp ((contDiff_const.sub (contDiff_norm_sq ℝ)).div_const 3) +lemma cutSeed_one (x : Space) (hx : ‖x‖ ≤ 1) : cutSeed x=1 := by + apply Real.smoothTransition.one_of_one_le + nlinarith [norm_nonneg x] +lemma cutSeed_zero (x : Space) (hx : 2 ≤ ‖x‖) : cutSeed x=0 := by + apply Real.smoothTransition.zero_of_nonpos + nlinarith [norm_nonneg x] +lemma cutSeed_compact : HasCompactSupport cutSeed := by + apply HasCompactSupport.intro (K := Metric.closedBall 0 2) (isCompact_closedBall 0 2) + intro x hx + exact cutSeed_zero x (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using le_of_lt (show 2 < ‖x‖ by simpa using hx)) + +lemma cutSeed_derivative_bounded : ∃ C : ℝ, 0 < C ∧ ∀ x, ‖fderiv ℝ cutSeed x‖ ≤ C := by + obtain ⟨B,hB⟩ := (cutSeed_compact.fderiv ℝ).exists_bound_of_continuous + (cutSeed_smooth.continuous_fderiv (by simp)) + exact ⟨max B 1, lt_of_lt_of_le zero_lt_one (le_max_right _ _),fun x => (hB x).trans (le_max_left _ _)⟩ +def cutSeedDerivativeBound : ℝ := Classical.choose cutSeed_derivative_bounded +lemma cutSeedDerivativeBound_pos : 0 < cutSeedDerivativeBound := (Classical.choose_spec cutSeed_derivative_bounded).1 +lemma norm_cutSeed_derivative (x : Space) : ‖fderiv ℝ cutSeed x‖ ≤ cutSeedDerivativeBound := + (Classical.choose_spec cutSeed_derivative_bounded).2 x + +def cutAngle (y : Space) (r : ℝ) (x : Space) : ℝ := (Real.pi/2)*cutSeed (r⁻¹ • (x-y)) +lemma cutAngle_smooth (y : Space) (r : ℝ) : ContDiff ℝ ∞ (cutAngle y r) := by + have ht : ContDiff ℝ ∞ (fun x : Space => r⁻¹ • (x-y)) := by fun_prop + exact contDiff_const.mul (cutSeed_smooth.comp ht) +lemma cutAngle_fderiv (y : Space) (r : ℝ) (x v : Space) : + fderiv ℝ (cutAngle y r) x v = (Real.pi/2)*r⁻¹*fderiv ℝ cutSeed (r⁻¹ • (x-y)) v := by + have ht : HasFDerivAt (fun x : Space => r⁻¹ • (x-y)) + (r⁻¹ • (ContinuousLinearMap.id ℝ Space)) x := by + convert ((hasFDerivAt_id x).sub_const y).const_smul r⁻¹ using 1 + rfl + have h := (((cutSeed_smooth.differentiable (by simp) _).hasFDerivAt.comp x ht).const_mul (Real.pi/2)).fderiv + have hh : fderiv ℝ (cutAngle y r) x = + (Real.pi/2) • ((fderiv ℝ cutSeed (r⁻¹ • (x-y))).comp (r⁻¹ • ContinuousLinearMap.id ℝ Space)) := by + convert h using 1 + rfl + rw [hh] + simp only [smul_apply,smul_eq_mul,ContinuousLinearMap.comp_apply,ContinuousLinearMap.id_apply,map_smul] + ring + +def radialCut (y : Space) (r : ℝ) (l : Fin 2) (x : Space) : ℝ := + if l=0 then Real.sin (cutAngle y r x) else Real.cos (cutAngle y r x) +lemma radialCut_smooth (y : Space) (r : ℝ) (l : Fin 2) : ContDiff ℝ ∞ (radialCut y r l) := by + unfold radialCut + split_ifs + · exact (cutAngle_smooth y r).sin + · exact (cutAngle_smooth y r).cos +lemma radialCut_partition (y : Space) (r : ℝ) (x : Space) : + ∑ l : Fin 2, radialCut y r l x ^ 2 = 1 := by + simp [Fin.sum_univ_two,radialCut] +lemma radialCut_core_zero (y : Space) {r : ℝ} (hr : 0 < r) (x : Space) (hx : ‖x-y‖ ≤ r) : + radialCut y r 1 x=0 := by + have hs : ‖r⁻¹ • (x-y)‖ ≤ 1 := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hr)] + exact (inv_mul_le_one₀ hr).2 hx + simp [radialCut,cutAngle,cutSeed_one _ hs,Real.cos_pi_div_two] +lemma radialCut_out_zero (y : Space) {r : ℝ} (hr : 0 < r) (x : Space) (hx : 2*r ≤ ‖x-y‖) : + radialCut y r 0 x=0 := by + have hs : 2 ≤ ‖r⁻¹ • (x-y)‖ := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hr)] + exact (le_inv_mul_iff₀ hr).2 (by simpa only [mul_comm] using hx) + simp [radialCut,cutAngle,cutSeed_zero _ hs] + +def radialCutCoefficient : ℝ := (Real.pi/2)*cutSeedDerivativeBound +lemma radialCutCoefficient_pos : 0 < radialCutCoefficient := by + exact mul_pos (by positivity) cutSeedDerivativeBound_pos +lemma radialCut_derivative_bound (y : Space) {r : ℝ} (hr : 0 < r) (l : Fin 2) + (b : Fin 3) (x : Space) : + |fderiv ℝ (radialCut y r l) x (EuclideanSpace.single b 1)| ≤ radialCutCoefficient/r := by + have hb : |fderiv ℝ (cutAngle y r) x (EuclideanSpace.single b 1)| ≤ radialCutCoefficient/r := by + rw [cutAngle_fderiv,abs_mul,abs_of_pos (mul_pos (by positivity) (inv_pos.mpr hr))] + have H := ((fderiv ℝ cutSeed (r⁻¹ • (x-y))).le_opNorm (EuclideanSpace.single b 1)).trans + (mul_le_mul_of_nonneg_right (norm_cutSeed_derivative _) (norm_nonneg _)) + simp only [PiLp.norm_single,norm_one,mul_one,Real.norm_eq_abs] at H + calc + _ ≤ (Real.pi/2)*r⁻¹*cutSeedDerivativeBound := mul_le_mul_of_nonneg_left H (by positivity) + _ = radialCutCoefficient/r := by unfold radialCutCoefficient; ring + unfold radialCut + split_ifs + · rw [fderiv_sin ((cutAngle_smooth y r).differentiable (by simp) x)] + simp only [smul_apply,smul_eq_mul,abs_mul] + exact (mul_le_mul_of_nonneg_right (Real.abs_cos_le_one _) (abs_nonneg _)).trans (by simpa using hb) + · rw [fderiv_cos ((cutAngle_smooth y r).differentiable (by simp) x)] + simp only [smul_apply,smul_eq_mul,abs_mul,abs_neg] + exact (mul_le_mul_of_nonneg_right (Real.abs_sin_le_one _) (abs_nonneg _)).trans (by simpa using hb) + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff Topology +namespace Coulomb + +lemma radialCut_fderiv_zero (y : Space) {r : ℝ} (hr : 0 < r) (l : Fin 2) + (x : Space) (hx : 2*r < ‖x-y‖) : fderiv ℝ (radialCut y r l) x=0 := by + have he : radialCut y r l =ᶠ[𝓝 x] (fun _ => if l=0 then (0:ℝ) else 1) := by + have hh : ∀ᶠ z in 𝓝 x, 2*r < ‖z-y‖ := + (isOpen_lt continuous_const (continuous_id.sub continuous_const).norm).mem_nhds hx + filter_upwards [hh] with z hz + have hs : 2 ≤ ‖r⁻¹ • (z-y)‖ := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hr)] + exact (le_inv_mul_iff₀ hr).2 (by nlinarith) + simp only [radialCut,cutAngle,cutSeed_zero _ hs,mul_zero,Real.sin_zero,Real.cos_zero] + rw [he.fderiv_eq] + simp + +lemma radialCut_gradient_bound (y : Space) {r : ℝ} (hr : 0 < r) (b : Fin 3) (x : Space) : + (∑ l : Fin 2, (fderiv ℝ (radialCut y r l) x (EuclideanSpace.single b 1))^2) ≤ + (2*(radialCutCoefficient/r)^2) * (Metric.closedBall y (2*r)).indicator (fun _ => (1:ℝ)) x := by + by_cases hx : x ∈ Metric.closedBall y (2*r) + · rw [indicator_of_mem hx,mul_one] + calc + _ ≤ ∑ _l : Fin 2, (radialCutCoefficient/r)^2 := by + apply Finset.sum_le_sum + intro l hl + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) (div_nonneg radialCutCoefficient_pos.le hr.le)).2 + (radialCut_derivative_bound y hr l b x) + _ = _ := by simp + · rw [indicator_of_notMem hx,mul_zero] + have hd := radialCut_fderiv_zero y hr + have hh : 2*r < ‖x-y‖ := by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hx + simp only [hd _ x hh,zero_apply,ne_eq,OfNat.ofNat_ne_zero,not_false_eq_true, + zero_pow,Finset.sum_const_zero,le_refl] + +def expectedPopulation {n : ℕ} (ψ : H1Vector n) (A : Set Space) : ℝ := + ∑ s, ∑ i : Fin n, ∫ x, (A.indicator (fun _ => (1:ℝ)) (position x i))*‖ψ.value s x‖^2 + +lemma population_integrable {n : ℕ} (ψ : H1Vector n) (A : Set Space) (hA : MeasurableSet A) + (s : Spins n) (i : Fin n) : + Integrable (fun x => (A.indicator (fun _ => (1:ℝ)) (position x i))*‖ψ.value s x‖^2) := by + have H := ((ψ.value_L2 s).integrable_norm_pow (by norm_num)).indicator (hA.preimage (positionCLM i).continuous.measurable) + apply H.congr + filter_upwards [] with x + change (if position x i ∈ A then ‖ψ.value s x‖^2 else 0) = _ + by_cases hx : position x i ∈ A <;> simp [hx] + +theorem form_radial_labelCut {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + (y : Space) {r : ℝ} (hr : 0 < r) : + (∑ p : Fin n → Fin 2, form S (ψ.labelCut (radialCut y r) (radialCut_smooth y r) + (radialCut_partition y r) (radialCutCoefficient/r) (div_nonneg radialCutCoefficient_pos.le hr.le) + (radialCut_derivative_bound y hr) p)) ≤ + form S ψ+3*(radialCutCoefficient/r)^2*expectedPopulation ψ (Metric.closedBall y (2*r)) := by + rw [form_labelCut] + apply add_le_add_right + let c : ℝ := 2*(radialCutCoefficient/r)^2 + have hi s i := population_integrable ψ (Metric.closedBall y (2*r)) measurableSet_closedBall s i + have H (s : Spins n) (a : Fin n × Fin 3) : + (∫ x, (∑ l, (fderiv ℝ (radialCut y r l) (position x a.1) (EuclideanSpace.single a.2 1))^2)*‖ψ.value s x‖^2) ≤ + c*(∫ x, (Metric.closedBall y (2*r)).indicator (fun _ => (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := by + rw [← integral_const_mul] + apply integral_mono_of_nonneg + · filter_upwards [] with x + exact mul_nonneg (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (sq_nonneg _) + · exact (hi s a.1).const_mul c + · filter_upwards [] with x + simpa only [c,mul_assoc] using mul_le_mul_of_nonneg_right (radialCut_gradient_bound y hr a.2 (position x a.1)) (sq_nonneg ‖ψ.value s x‖) + calc + _ ≤ (1/2:ℝ)*∑ s, ∑ a : Fin n × Fin 3, c*(∫ x, + (Metric.closedBall y (2*r)).indicator (fun _ => (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun s _ => Finset.sum_le_sum (fun a _ => H s a))) (by norm_num) + _ = _ := by + simp only [Fintype.sum_prod_type,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul, + ← Finset.mul_sum,expectedPopulation,c] + ring + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/RegularizedBounds.lean b/lean/OAI/Analysis/CoulombRadii/Localization/RegularizedBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..a59201cccb1753648ad6ce40eb37745c34020ec3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/RegularizedBounds.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.HarmonicInterior + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators ContDiff +noncomputable section +namespace NeutralAtom +lemma radial_rpow_partial {l:ℝ} (hl:l≠0) (p:ℝ) (x:Position) (b:Fin 3) : + dirPartial (fun y:Position => (‖y‖^2+l^2)^p) (axis b) x = + p*(‖x‖^2+l^2)^(p-1)*(2*x b) := by + have hq:0<‖x‖^2+l^2:=add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hl) + have H:=((hasStrictFDerivAt_norm_sq x).hasFDerivAt.add_const (l^2)).rpow_const (p:=p) (Or.inl hq.ne') + unfold dirPartial + rw [H.fderiv] + simp [axis,EuclideanSpace.inner_single_right,mul_assoc] +lemma regularized_second_partial {l:ℝ} (hl:l≠0) (x:Position) (a b:Fin 3) : + dirPartial (dirPartial (regularizedKernel l) (axis a)) (axis b) x= + -(if a=b then (1:ℝ) else 0)*(‖x‖^2+l^2)^(-3/2:ℝ)+ + 3*x a*x b*(‖x‖^2+l^2)^(-5/2:ℝ) := by + have he:dirPartial (regularizedKernel l) (axis a)=fun x => -x a*(‖x‖^2+l^2)^(-3/2:ℝ):= + funext fun x => dirPartial_regularizedKernel hl a x + rw [he] + have hcoord := ((EuclideanSpace.proj (𝕜:=ℝ) a).hasFDerivAt (x:=x)).neg + change HasFDerivAt (fun y:Position => -y a) _ x at hcoord + have hd: DifferentiableAt ℝ (fun y:Position => (‖y‖^2+l^2)^(-3/2:ℝ)) x := by + exact (((hasStrictFDerivAt_norm_sq x).hasFDerivAt.add_const (l^2)).rpow_const + (p:=(-3/2:ℝ)) (Or.inl (add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hl)).ne')).differentiableAt + rw [dirPartial_mul hcoord.differentiableAt hd,radial_rpow_partial hl] + have hc:dirPartial (fun y:Position => -y a) (axis b) x= -(if a=b then (1:ℝ) else 0) := by + unfold dirPartial + rw [hcoord.fderiv] + simp [axis,PiLp.single_apply] + rw [hc] + norm_num + ring +lemma regularizedKernel_uniform_bound {l:ℝ} (hl:l≠0) (x:Position) : + |regularizedKernel l x|≤(l^2)^(-1/2:ℝ) := by + unfold regularizedKernel + rw [abs_of_nonneg (Real.rpow_nonneg (by positivity) _)] + exact Real.rpow_le_rpow_of_nonpos (sq_pos_of_ne_zero hl) (by nlinarith [sq_nonneg ‖x‖]) (by norm_num) +lemma regularizedPartial_uniform_bound {l:ℝ} (hl:l≠0) (x:Position) (a:Fin 3) : + |dirPartial (regularizedKernel l) (axis a) x|≤(l^2)^(-1/2:ℝ)+(l^2)^(-3/2:ℝ) := by + let q:=‖x‖^2+l^2 + have hq:0 simp [abs_of_nonneg (Real.rpow_nonneg hq.le _),Real.rpow_nonneg hq.le] + · simp only [abs_mul,abs_of_nonneg (Real.rpow_nonneg hq.le _)] + rw [abs_of_pos (by norm_num : (0:ℝ)<3)] + rw [show 3* |x a| * |x b|=3*(|x a| * |x b|) by ring, mul_assoc,←he] + exact mul_le_mul_of_nonneg_left (mul_le_mul_of_nonneg_right hab (Real.rpow_nonneg hq.le _)) (by norm_num) + _≤_:=by nlinarith +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/ShellChoice.lean b/lean/OAI/Analysis/CoulombRadii/Localization/ShellChoice.lean new file mode 100644 index 0000000000000000000000000000000000000000..32f9a069573773c0aca60c462f5df36aaefa2203 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/ShellChoice.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CountUnits + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma localCountSecondMoment_cover {n : ℕ} {C : Type*} [Fintype C] (ψ : H1Vector n) + {B : Set Space} (A : C → Set Space) (hA : ∀ c, MeasurableSet (A c)) (hcover : B⊆⋃ c, A c) : + localCountSecondMoment ψ B≤(Fintype.card C:ℝ)*∑ c, localCountSecondMoment ψ (A c) := by + unfold localCountSecondMoment + rw [Finset.sum_comm,Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + rw [←integral_finsetSum _ (fun c _ => localCount_weight_integrable ψ (hA c) s 2),←integral_const_mul] + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun _ => mul_nonneg (sq_nonneg _) (sq_nonneg _)) + · exact (integrable_finsetSum _ (fun c _ => localCount_weight_integrable ψ (hA c) s 2)).const_mul _ + · filter_upwards [] with x + rw [←Finset.sum_mul,←mul_assoc] + apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + exact (pow_le_pow_left₀ (localCount_nonneg B x) (localCount_cover A hcover x) 2).trans + (by simpa only [Finset.card_univ] using sq_sum_le_card_mul_sum_sq (s:=Finset.univ) (f:=fun c => localCount (A c) x)) + +lemma localCount_disjoint_sum_le {n : ℕ} {C : Type*} [Fintype C] {B : Set Space} + (A : C → Set Space) (hsub : ∀ c, A c⊆B) + (hdis : Pairwise (fun c d => Disjoint (A c) (A d))) (x : Configuration n) : + (∑ c, localCount (A c) x)≤localCount B x := by + unfold localCount + rw [Finset.sum_comm] + apply Finset.sum_le_sum + intro i hi + by_cases hx : ∃ c, position x i∈A c + · obtain ⟨c,hc⟩ := hx + rw [indicator_of_mem (hsub c hc)] + have he : ∑ d, (A d).indicator (fun _ => (1:ℝ)) (position x i)=1 := by + rw [Finset.sum_eq_single c] + · exact indicator_of_mem hc _ + · intro d hd hdc + apply indicator_of_notMem + intro hd' + exact Set.disjoint_left.mp (hdis hdc) hd' hc + · simp + exact he.le + · have hn (c : C) : position x i∉A c := fun hc => hx ⟨c,hc⟩ + simp only [indicator_of_notMem (hn _),Finset.sum_const_zero] + exact Set.indicator_nonneg (fun _ _ => zero_le_one) _ + +lemma localCountSecondMoment_disjoint_sum_le {n : ℕ} {C : Type*} [Fintype C] (ψ : H1Vector n) + {B : Set Space} (hB : MeasurableSet B) (A : C → Set Space) (hA : ∀ c, MeasurableSet (A c)) + (hsub : ∀ c, A c⊆B) (hdis : Pairwise (fun c d => Disjoint (A c) (A d))) : + (∑ c, localCountSecondMoment ψ (A c))≤localCountSecondMoment ψ B := by + unfold localCountSecondMoment + rw [Finset.sum_comm] + apply Finset.sum_le_sum + intro s hs + rw [←integral_finsetSum _ (fun c _ => localCount_weight_integrable ψ (hA c) s 2)] + apply integral_mono_ae (integrable_finsetSum _ (fun c _ => localCount_weight_integrable ψ (hA c) s 2)) + (localCount_weight_integrable ψ hB s 2) + filter_upwards [] with x + rw [←Finset.sum_mul] + apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + exact (Finset.sum_sq_le_sq_sum_of_nonneg (fun c _ => localCount_nonneg (A c) x)).trans + (pow_le_pow_left₀ (Finset.sum_nonneg (fun c _ => localCount_nonneg (A c) x)) + (localCount_disjoint_sum_le A hsub hdis x) 2) + +def deletedShell (y : Space) (t b : ℝ) : Set Space := {z | t-7*b≤‖z-y‖ ∧ ‖z-y‖≤t+b} + +lemma deletedShell_measurable (y : Space) (t b : ℝ) : MeasurableSet (deletedShell y t b) := by + change MeasurableSet ({z : Space | t-7*b≤‖z-y‖} ∩ {z : Space | ‖z-y‖≤t+b}) + exact (isClosed_le continuous_const (by fun_prop)).measurableSet.inter + (isClosed_le (by fun_prop) continuous_const).measurableSet + +lemma deletedShell_disjoint {y : Space} {t u b : ℝ} (h : t+8*b 5*a+9*b*(j.val:ℝ) + have ht (j : Fin N) : t j∈Set.Icc (5*a) (6*a) := by + have hj : (j.val:ℝ)≤(N:ℝ) := by exact_mod_cast (Nat.le_of_lt j.isLt) + have hh : 9*b*(N:ℝ)≤a := by nlinarith [(le_div_iff₀ (by positivity : 0<9*b)).mp hfloor] + dsimp [t] + constructor + · have hj0 : (0:ℝ)≤ j.val := Nat.cast_nonneg _ + nlinarith + · nlinarith [mul_le_mul_of_nonneg_left hj (by positivity : 0≤9*b)] + let A : Fin N → Set Space := fun j => deletedShell y (t j) b + have hsub (j : Fin N) : A j⊆Metric.closedBall y (7*a) := by + intro z hz + change t j-7*b≤‖z-y‖ ∧ ‖z-y‖≤t j+b at hz + rw [Metric.mem_closedBall,dist_eq_norm] + linarith [(ht j).2] + have hdis : Pairwise (fun i j => Disjoint (A i) (A j)) := by + intro i j hij + rcases lt_or_gt_of_ne hij with hij|hji + · apply deletedShell_disjoint (y:=y) (t:=t i) (u:=t j) (b:=b) + have hv : (i.val:ℝ)+1≤ j.val := by exact_mod_cast (show i.val+1≤ j.val from hij) + dsimp [t] + nlinarith + · have H : t j+8*b deletedShell_measurable y (t j) b) hsub hdis + have hsome : ∃ j : Fin N, localCountSecondMoment ψ (A j)≤ + localCountSecondMoment ψ (Metric.closedBall y (7*a))/(N:ℝ) := by + by_contra hn + push Not at hn + have : Nonempty (Fin N) := ⟨⟨0,hNp⟩⟩ + have H := Finset.sum_lt_sum_of_nonempty (s:=Finset.univ) Finset.univ_nonempty (fun j _ => hn j) + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] at H + rw [mul_div_cancel₀ _ (show (N:ℝ)≠0 by exact_mod_cast (Nat.ne_of_gt hNp))] at H + linarith + obtain ⟨j,hj⟩ := hsome + refine ⟨t j,ht j,hj.trans ?_⟩ + apply (div_le_iff₀ (by exact_mod_cast hNp : (0:ℝ) if l=0 then (1:ℝ) else 0) := by + have hh : ∀ᶠ z in 𝓝 x, ‖z-y‖ < r := + (isOpen_lt (continuous_id.sub continuous_const).norm continuous_const).mem_nhds hx + filter_upwards [hh] with z hz + have hs : ‖r⁻¹ • (z-y)‖ ≤ 1 := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hr)] + exact (inv_mul_le_one₀ hr).2 hz.le + simp only [radialCut,cutAngle,cutSeed_one _ hs,mul_one, + Real.sin_pi_div_two,Real.cos_pi_div_two] + rw [he.fderiv_eq] + simp + +lemma radialCut_gradient_shell_bound (y : Space) {r : ℝ} (hr : 0 < r) + (b : Fin 3) (x : Space) : + (∑ l : Fin 2, (fderiv ℝ (radialCut y r l) x (EuclideanSpace.single b 1))^2) ≤ + (2*(radialCutCoefficient/r)^2) * (imsShell y r).indicator (fun _ => (1:ℝ)) x := by + by_cases hx : x ∈ imsShell y r + · rw [indicator_of_mem hx,mul_one] + calc + _ ≤ ∑ _l : Fin 2, (radialCutCoefficient/r)^2 := by + apply Finset.sum_le_sum + intro l hl + simpa only [sq_abs] using + (sq_le_sq₀ (abs_nonneg _) (div_nonneg radialCutCoefficient_pos.le hr.le)).2 + (radialCut_derivative_bound y hr l b x) + _ = _ := by simp + · rw [indicator_of_notMem hx,mul_zero] + have hd : ∀ l : Fin 2, fderiv ℝ (radialCut y r l) x = 0 := by + have hnot : ¬ (r ≤ ‖x-y‖ ∧ ‖x-y‖ ≤ 2*r) := hx + by_cases hinner : ‖x-y‖ < r + · exact fun l => radialCut_fderiv_zero_inner y hr l x hinner + · have houter : 2*r < ‖x-y‖ := lt_of_not_ge (fun h => hnot ⟨le_of_not_gt hinner,h⟩) + exact fun l => radialCut_fderiv_zero y hr l x houter + simp only [hd,zero_apply,ne_eq,OfNat.ofNat_ne_zero,not_false_eq_true, + zero_pow,Finset.sum_const_zero,le_refl] + +theorem form_radial_labelCut_shell {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + (y : Space) {r : ℝ} (hr : 0 < r) : + (∑ p : Fin n → Fin 2, form S (ψ.labelCut (radialCut y r) (radialCut_smooth y r) + (radialCut_partition y r) (radialCutCoefficient/r) (div_nonneg radialCutCoefficient_pos.le hr.le) + (radialCut_derivative_bound y hr) p)) ≤ + form S ψ+3*(radialCutCoefficient/r)^2*expectedPopulation ψ (imsShell y r) := by + rw [form_labelCut] + apply add_le_add_right + let c : ℝ := 2*(radialCutCoefficient/r)^2 + have hi s i := population_integrable ψ (imsShell y r) (measurableSet_imsShell y r) s i + have H (s : Spins n) (a : Fin n × Fin 3) : + (∫ x, (∑ l, (fderiv ℝ (radialCut y r l) (position x a.1) (EuclideanSpace.single a.2 1))^2)*‖ψ.value s x‖^2) ≤ + c*(∫ x, (imsShell y r).indicator (fun _ => (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := by + rw [← integral_const_mul] + apply integral_mono_of_nonneg + · filter_upwards [] with x + exact mul_nonneg (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (sq_nonneg _) + · exact (hi s a.1).const_mul c + · filter_upwards [] with x + simpa only [c,mul_assoc] using mul_le_mul_of_nonneg_right + (radialCut_gradient_shell_bound y hr a.2 (position x a.1)) (sq_nonneg ‖ψ.value s x‖) + calc + _ ≤ (1/2:ℝ)*∑ s, ∑ a : Fin n × Fin 3, c*(∫ x, + (imsShell y r).indicator (fun _ => (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun s _ => Finset.sum_le_sum (fun a _ => H s a))) (by norm_num) + _ = _ := by + simp only [Fintype.sum_prod_type,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul, + ← Finset.mul_sum,expectedPopulation,c] + ring + +end Coulomb + +namespace NeutralAtom + +theorem fromH1_expectedPopulation {N : ℕ} (ψ : Coulomb.H1Vector (N+1)) + (ha : Coulomb.Antisymmetric ψ) {A : Set Position} (hA : MeasurableSet A) : + Coulomb.expectedPopulation ψ A = ∫ x in A, density (fromH1Wave ψ) x := by + have hd := fromH1_domain ψ ha + rw [← rawExpectation_count_eq_density hd.1 hd.2.2.1 hA, + Coulomb.expectedPopulation_eq ψ hA] + unfold rawExpectation configurationDensity + simp_rw [Finset.mul_sum] + have hi s : Integrable (fun x => rawCount A x * ‖fromH1Wave ψ s x‖^2) := by + simp_rw [rawCount, Finset.sum_mul] + exact integrable_finsetSum _ fun i _ => + integrable_siteWeight (hd.2.2.1 s).norm.integrable_sq hA i + rw [integral_finsetSum _ (fun s _ => hi s)] + apply Finset.sum_congr rfl + intro s _ + exact ((flattenConfiguration_measurePreserving (N+1)).integral_comp' + (fun x => Coulomb.localCount A x*‖ψ.value s x‖^2)).symm + +end NeutralAtom + +namespace Coulomb + +lemma expectedPopulation_labelCut {n : ℕ} {L : Type*} [Fintype L] (ψ : H1Vector n) + (χ : L → Space → ℝ) (hχ : ∀ l, ContDiff ℝ ∞ (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + {A : Set Space} (hA : MeasurableSet A) : + (∑ p : Fin n → L, expectedPopulation (ψ.labelCut χ hχ hp D hD hd p) A) = + expectedPopulation ψ A := by + simp only [expectedPopulation_eq _ hA] + exact potentialForm_labelCut ψ χ hχ hp D hD hd (localCount A) + (localCount_measurable hA) (fun x => by rw [abs_of_nonneg (localCount_nonneg A x)]; exact localCount_le A x) + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/SmoothMultiplier.lean b/lean/OAI/Analysis/CoulombRadii/Localization/SmoothMultiplier.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb75b4a3b9810a4b6ce52c443d8f245f7198de0d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/SmoothMultiplier.lean @@ -0,0 +1,426 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Model + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +structure SmoothMultiplier {n : ℕ} (θ : Configuration n → ℝ) : Prop where + smooth : ContDiff ℝ ∞ θ + symmetric : ∀ (p : Equiv.Perm (Fin n)) x, θ (x ∘ p) = θ x + bounded : ∃ C : ℝ, ∀ x, |θ x| ≤ C + derivative_bounded : ∀ i a, ∃ C : ℝ, + ∀ x, |fderiv ℝ θ x (coordinateDirection i a)| ≤ C + +def multiplyWavefunction {n : ℕ} (θ : Configuration n → ℝ) + (ψ : Wavefunction n) : Wavefunction n := fun σ x => θ x • ψ σ x + +def multiplyGradient {n : ℕ} (θ : Configuration n → ℝ) + (ψ : Wavefunction n) (g : Gradient n) : Gradient n := + fun σ i a x => (fderiv ℝ θ x (coordinateDirection i a)) • ψ σ x + θ x • g σ i a x + +theorem memLp_bounded_real_smul {n : ℕ} {f : Configuration n → ℂ} + (hf : MemLp f 2 volume) {θ : Configuration n → ℝ} (hθ : Continuous θ) + (hb : ∃ C : ℝ, ∀ x, |θ x| ≤ C) : MemLp (fun x => θ x • f x) 2 volume := by + obtain ⟨C,hC⟩ := hb + apply hf.of_le_mul (c := C) (hθ.aestronglyMeasurable.smul hf.aestronglyMeasurable) + exact Eventually.of_forall fun x => by + change ‖θ x • f x‖ ≤ C * ‖f x‖ + rw [norm_smul, Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_right (hC x) (norm_nonneg _) + +theorem integrable_test_real_smul {n : ℕ} {f : Configuration n → ℂ} + (hf : MemLp f 2 volume) {φ : Configuration n → ℝ} (hφ : Continuous φ) + (hc : HasCompactSupport φ) : Integrable (fun x => φ x • f x) := by + exact (hf.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport hφ hc + +theorem IsAntisymmetric.multiply {n : ℕ} {ψ : Wavefunction n} + (hψ : IsAntisymmetric ψ) {θ : Configuration n → ℝ} + (hθ : ∀ (p : Equiv.Perm (Fin n)) x, θ (x ∘ p) = θ x) : + IsAntisymmetric (multiplyWavefunction θ ψ) := by + intro p σ + filter_upwards [hψ p σ] with x hx + simp only [multiplyWavefunction, hθ p x, hx, mul_smul_comm] + +theorem HasWeakGradient.multiply {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hgLp : ∀ σ i a, MemLp (g σ i a) 2 volume) + {θ : Configuration n → ℝ} (hθ : ContDiff ℝ ∞ θ) : + HasWeakGradient (multiplyWavefunction θ ψ) (multiplyGradient θ ψ g) := by + intro σ i a φ hφ hφc + let dθ : Configuration n → ℝ := fun x => fderiv ℝ θ x (coordinateDirection i a) + let dφ : Configuration n → ℝ := fun x => fderiv ℝ φ x (coordinateDirection i a) + have hdθ : Continuous dθ := (hθ.continuous_fderiv (by simp)).clm_apply continuous_const + have hdφ : Continuous dφ := (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hdφc : HasCompactSupport dφ := hφc.fderiv_apply ℝ _ + have hi₁ : Integrable (fun x => (θ x*dφ x) • ψ σ x) := + integrable_test_real_smul (hψ σ) (hθ.continuous.mul hdφ) hdφc.mul_left + have hi₂ : Integrable (fun x => (φ x*dθ x) • ψ σ x) := + integrable_test_real_smul (hψ σ) (hφ.continuous.mul hdθ) hφc.mul_right + have hi₃ : Integrable (fun x => (φ x*θ x) • g σ i a x) := + integrable_test_real_smul (hgLp σ i a) + (hφ.continuous.mul hθ.continuous) hφc.mul_right + have h := hg σ i a (fun x => φ x * θ x) (hφ.mul hθ) hφc.mul_right + have hder : ∀ x, fderiv ℝ (fun x => φ x * θ x) x (coordinateDirection i a) = + θ x*dφ x + φ x*dθ x := by + intro x + change (fderiv ℝ (φ * θ) x) _ = _ + rw [fderiv_mul (hφ.differentiable (by simp)).differentiableAt + (hθ.differentiable (by simp)).differentiableAt] + simp [dθ, dφ, smul_eq_mul, add_comm] + simp_rw [hder] at h + change (∫ x, (θ x*dφ x + φ x*dθ x) • ψ σ x) = + -(∫ x, (φ x*θ x) • g σ i a x) at h + simp_rw [add_smul] at h + rw [integral_add hi₁ hi₂] at h + change (∫ x, dφ x • (θ x • ψ σ x)) = + -(∫ x, φ x • (dθ x • ψ σ x + θ x • g σ i a x)) + simp_rw [smul_add, smul_smul] + rw [integral_add hi₂ hi₃] + simp_rw [mul_comm (dφ _) (θ _)] + linear_combination h + +theorem norm_multiplyWavefunction_sq {n : ℕ} (θ : Configuration n → ℝ) + (ψ : Wavefunction n) (σ : Spins n) (x : Configuration n) : + ‖multiplyWavefunction θ ψ σ x‖^2 = θ x^2 * ‖ψ σ x‖^2 := by + simp [multiplyWavefunction, mul_pow] + +theorem integrable_weight_multiply {n : ℕ} {θ : Configuration n → ℝ} + (hθ : Continuous θ) (hb : ∃ C : ℝ, ∀ x, |θ x| ≤ C) + (ψ : Wavefunction n) (σ : Spins n) {W : Configuration n → ℝ} + (hi : Integrable (fun x => W x*‖ψ σ x‖^2)) : + Integrable (fun x => W x*‖multiplyWavefunction θ ψ σ x‖^2) := by + obtain ⟨C,hC⟩ := hb + have hb' : ∀ᵐ x : Configuration n ∂volume, ‖θ x^2‖ ≤ C^2 := by + exact Eventually.of_forall fun x => by + simpa [Real.norm_eq_abs] using pow_le_pow_left₀ (abs_nonneg (θ x)) (hC x) 2 + have hh := hi.bdd_mul (hθ.pow 2).aestronglyMeasurable hb' + convert hh using 1 + ext x + rw [norm_multiplyWavefunction_sq] + simp only [Pi.pow_apply] + ring + +theorem FormDomain.multiply {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : FormDomain ψ g) {θ : Configuration n → ℝ} (hθ : SmoothMultiplier θ) : + FormDomain (multiplyWavefunction θ ψ) (multiplyGradient θ ψ g) := by + refine ⟨hg.1.multiply hθ.symmetric, + hg.2.1.multiply hg.2.2.1 hg.2.2.2.1 hθ.smooth, ?_, ?_, ?_, ?_⟩ + · intro σ + exact memLp_bounded_real_smul (hg.2.2.1 σ) hθ.smooth.continuous hθ.bounded + · intro σ i a + exact (memLp_bounded_real_smul (hg.2.2.1 σ) + ((hθ.smooth.continuous_fderiv (by simp)).clm_apply continuous_const) + (hθ.derivative_bounded i a)).add + (memLp_bounded_real_smul (hg.2.2.2.1 σ i a) hθ.smooth.continuous hθ.bounded) + · intro σ i + exact integrable_weight_multiply hθ.smooth.continuous hθ.bounded ψ σ (hg.2.2.2.2.1 σ i) + · intro σ i j hij + exact integrable_weight_multiply hθ.smooth.continuous hθ.bounded ψ σ + (hg.2.2.2.2.2 σ i j hij) + +theorem SmoothMultiplier.const {n : ℕ} (c : ℝ) : + SmoothMultiplier (fun _ : Configuration n => c) := by + refine ⟨contDiff_const, fun _ _ => rfl, ⟨|c|, fun _ => le_rfl⟩, ?_⟩ + intro i a + exact ⟨0, fun x => by simp⟩ + +theorem SmoothMultiplier.add {n : ℕ} {θ η : Configuration n → ℝ} + (hθ : SmoothMultiplier θ) (hη : SmoothMultiplier η) : + SmoothMultiplier (fun x => θ x + η x) := by + obtain ⟨C,hC⟩ := hθ.bounded + obtain ⟨D,hD⟩ := hη.bounded + refine ⟨hθ.smooth.add hη.smooth, fun p x => by rw [hθ.symmetric, hη.symmetric], + ⟨C+D, fun x => (abs_add_le _ _).trans (add_le_add (hC x) (hD x))⟩, ?_⟩ + intro i a + obtain ⟨A,hA⟩ := hθ.derivative_bounded i a + obtain ⟨B,hB⟩ := hη.derivative_bounded i a + refine ⟨A+B, fun x => ?_⟩ + change |fderiv ℝ (θ + η) x (coordinateDirection i a)| ≤ _ + rw [fderiv_add (hθ.smooth.differentiable (by simp)).differentiableAt + (hη.smooth.differentiable (by simp)).differentiableAt] + exact (abs_add_le _ _).trans (add_le_add (hA x) (hB x)) + +theorem SmoothMultiplier.mul {n : ℕ} {θ η : Configuration n → ℝ} + (hθ : SmoothMultiplier θ) (hη : SmoothMultiplier η) : + SmoothMultiplier (fun x => θ x * η x) := by + obtain ⟨C,hC⟩ := hθ.bounded + obtain ⟨D,hD⟩ := hη.bounded + have hC0 : 0 ≤ C := (abs_nonneg (θ 0)).trans (hC 0) + have hD0 : 0 ≤ D := (abs_nonneg (η 0)).trans (hD 0) + refine ⟨hθ.smooth.mul hη.smooth, fun p x => by rw [hθ.symmetric, hη.symmetric], + ⟨C*D, fun x => ?_⟩, ?_⟩ + · rw [abs_mul] + exact mul_le_mul (hC x) (hD x) (abs_nonneg _) hC0 + · intro i a + obtain ⟨A,hA⟩ := hθ.derivative_bounded i a + obtain ⟨B,hB⟩ := hη.derivative_bounded i a + refine ⟨C*B+D*A, fun x => ?_⟩ + change |fderiv ℝ (θ * η) x (coordinateDirection i a)| ≤ _ + rw [fderiv_mul (hθ.smooth.differentiable (by simp)).differentiableAt + (hη.smooth.differentiable (by simp)).differentiableAt] + simp only [add_apply, smul_apply, smul_eq_mul] + apply (abs_add_le _ _).trans + rw [abs_mul, abs_mul] + exact add_le_add (mul_le_mul (hC x) (hB x) (abs_nonneg _) hC0) + (mul_le_mul (hD x) (hA x) (abs_nonneg _) hD0) + +def scaleWavefunction {n : ℕ} (c : ℝ) (ψ : Wavefunction n) : Wavefunction n := + fun σ x => c • ψ σ x + +def scaleGradient {n : ℕ} (c : ℝ) (g : Gradient n) : Gradient n := + fun σ i a x => c • g σ i a x + +theorem FormDomain.scale {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : FormDomain ψ g) (c : ℝ) : + FormDomain (scaleWavefunction c ψ) (scaleGradient c g) := by + have he : multiplyGradient (fun _ => c) ψ g = scaleGradient c g := by + funext σ i a x + simp [multiplyGradient, scaleGradient] + change FormDomain (multiplyWavefunction (fun _ => c) ψ) (scaleGradient c g) + rw [← he] + exact hg.multiply (SmoothMultiplier.const c) + +theorem normSquared_scale {n : ℕ} (c : ℝ) (ψ : Wavefunction n) : + normSquared (scaleWavefunction c ψ) = c^2 * normSquared ψ := by + simp only [normSquared, scaleWavefunction, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, + integral_const_mul, Finset.mul_sum] + +theorem energy_scale {n : ℕ} (Z : ℕ) (c : ℝ) (ψ : Wavefunction n) (g : Gradient n) : + energy Z (scaleWavefunction c ψ) (scaleGradient c g) = c^2 * energy Z ψ g := by + simp only [energy, scaleWavefunction, scaleGradient, norm_smul, Real.norm_eq_abs, + mul_pow, sq_abs] + simp_rw [← mul_assoc, mul_comm (coulombPotential Z _) (c^2), mul_assoc, + integral_const_mul, ← Finset.mul_sum] + ring + +theorem normSquared_nonneg {n : ℕ} (ψ : Wavefunction n) : 0 ≤ normSquared ψ := + Finset.sum_nonneg fun _ _ => integral_nonneg fun _ => sq_nonneg _ + +theorem ae_normSquared_eq_zero {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ = 0) (σ : Spins n) : + (fun x => ‖ψ σ x‖^2) =ᵐ[volume] 0 := by + have hi : ∫ x : Configuration n, ‖ψ σ x‖^2 = 0 := + (Finset.sum_eq_zero_iff_of_nonneg (fun τ _ => + integral_nonneg (fun _ => sq_nonneg (‖ψ τ _‖)))).mp hn σ (Finset.mem_univ _) + exact (integral_eq_zero_iff_of_nonneg (fun _ => sq_nonneg _) (hψ σ).norm.integrable_sq).mp hi + +theorem energy_nonneg_of_normSquared_zero {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) (hn : normSquared ψ = 0) : + 0 ≤ energy Z ψ g := by + have hp : ∀ σ, (∫ x : Configuration n, coulombPotential Z x*‖ψ σ x‖^2) = 0 := by + intro σ + have hh := ae_normSquared_eq_zero hd.2.2.1 hn σ + calc + _ = ∫ _ : Configuration n, (0 : ℝ) := integral_congr_ae (hh.mono fun x hx => by simp [hx]) + _ = 0 := integral_zero _ _ + simp only [energy, hp, Finset.sum_const_zero, add_zero] + apply mul_nonneg (by norm_num) + exact Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => sq_nonneg _)))) + +theorem rayleigh_lower_bound {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) + {χ : Wavefunction n} {h : Gradient n} (hd : FormDomain χ h) : + energy Z ψ g * normSquared χ ≤ energy Z χ h := by + rcases (normSquared_nonneg χ).eq_or_lt with hn | hn + · have hn' : normSquared χ = 0 := hn.symm + rw [hn', mul_zero] + exact energy_nonneg_of_normSquared_zero Z hd hn' + · let c : ℝ := (Real.sqrt (normSquared χ))⁻¹ + have hc : c^2*normSquared χ = 1 := by + dsimp [c] + rw [inv_pow, Real.sq_sqrt hn.le, inv_mul_cancel₀ hn.ne'] + have hb := hmin (scaleWavefunction c χ) (scaleGradient c h) (hd.scale c) + (by rw [normSquared_scale, hc]) + calc + energy Z ψ g * normSquared χ ≤ + energy Z (scaleWavefunction c χ) (scaleGradient c h) * normSquared χ := + mul_le_mul_of_nonneg_right hb hn.le + _ = energy Z χ h := by + rw [energy_scale] + calc + (c^2*energy Z χ h)*normSquared χ = (c^2*normSquared χ)*energy Z χ h := by ring + _ = energy Z χ h := by rw [hc, one_mul] + +theorem integrable_real_inner_of_memLp {n : ℕ} {f h : Configuration n → ℂ} + (hf : MemLp f 2 volume) (hh : MemLp h 2 volume) : + Integrable (fun x => inner ℝ (f x) (h x)) := by + apply (hf.norm.integrable_sq.add hh.norm.integrable_sq).mono' + (hf.aestronglyMeasurable.inner hh.aestronglyMeasurable) + exact Eventually.of_forall fun x => by + have hb := norm_inner_le_norm (𝕜 := ℝ) (f x) (h x) + have hs := sq_nonneg (‖f x‖ - ‖h x‖) + change ‖inner ℝ (f x) (h x)‖ ≤ ‖f x‖^2+‖h x‖^2 + nlinarith [sq_nonneg ‖f x‖, sq_nonneg ‖h x‖] + +theorem FormDomain.integrable_potential {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (Z : ℕ) (σ : Spins n) : + Integrable (fun x : Configuration n => coulombPotential Z x*‖ψ σ x‖^2) := by + have hn := integrable_finsetSum Finset.univ (fun i _ => hd.2.2.2.2.1 σ i) + have hp := integrable_finsetSum Finset.univ (fun i _ => + integrable_finsetSum (Finset.univ.filter (fun j : Fin n => i < j)) + (fun j hj => hd.2.2.2.2.2 σ i j (Finset.mem_filter.mp hj).2)) + apply ((hn.const_mul (-(Z:ℝ))).add hp).congr + exact Eventually.of_forall fun x => by + simp only [Pi.add_apply, coulombPotential, add_mul, Finset.sum_mul, mul_assoc] + +theorem integrable_bounded_mul {n : ℕ} {f θ : Configuration n → ℝ} + (hf : Integrable f) (hθ : Continuous θ) (hb : ∃ C : ℝ, ∀ x, |θ x| ≤ C) : + Integrable (fun x => θ x * f x) := by + obtain ⟨C,hC⟩ := hb + exact hf.bdd_mul hθ.aestronglyMeasurable + (Eventually.of_forall fun x => by simpa only [Real.norm_eq_abs] using hC x) + +theorem integral_affine_multiplier_sq {n : ℕ} {f θ : Configuration n → ℝ} + (hf : Integrable f) (hθ : SmoothMultiplier θ) (t : ℝ) : + (∫ x, (1+t*θ x)^2*f x) = (∫ x, f x) + + 2*t*(∫ x, θ x*f x) + t^2*(∫ x, θ x^2*f x) := by + have hi₁ := integrable_bounded_mul hf hθ.smooth.continuous hθ.bounded + have hi₂ : Integrable (fun x => θ x^2*f x) := by + simpa only [pow_two] using integrable_bounded_mul hf + (hθ.mul hθ).smooth.continuous (hθ.mul hθ).bounded + have he : (fun x => (1+t*θ x)^2*f x) = + (fun x => f x + (2*t)*(θ x*f x) + t^2*(θ x^2*f x)) := by + funext x; ring + have hi₃ : Integrable (fun x => f x+(2*t)*(θ x*f x)) := hf.add (hi₁.const_mul (2*t)) + rw [he, integral_add hi₃ (hi₂.const_mul (t^2)), + integral_add hf (hi₁.const_mul (2*t)), integral_const_mul, integral_const_mul] + +theorem integral_norm_add_smul_sq {n : ℕ} {f h : Configuration n → ℂ} + (hf : MemLp f 2 volume) (hh : MemLp h 2 volume) (t : ℝ) : + (∫ x, ‖f x+t • h x‖^2) = (∫ x, ‖f x‖^2) + + 2*t*(∫ x, inner ℝ (f x) (h x)) + t^2*(∫ x, ‖h x‖^2) := by + have hi := integrable_real_inner_of_memLp hf hh + have he : (fun x => ‖f x+t • h x‖^2) = + (fun x => ‖f x‖^2 + (2*t)*(inner ℝ (f x) (h x)) + t^2*‖h x‖^2) := by + funext x + rw [norm_add_sq_real, real_inner_smul_right, norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] + ring + have hi₃ : Integrable (fun x => ‖f x‖^2+(2*t)*(inner ℝ (f x) (h x))) := + hf.norm.integrable_sq.add (hi.const_mul (2*t)) + rw [he, integral_add hi₃ (hh.norm.integrable_sq.const_mul (t^2)), + integral_add hf.norm.integrable_sq (hi.const_mul (2*t)), + integral_const_mul, integral_const_mul] + +def stateWeightedIntegral {n : ℕ} (ψ : Wavefunction n) (θ : Configuration n → ℝ) : ℝ := + ∑ σ : Spins n, ∫ x : Configuration n, θ x*‖ψ σ x‖^2 + +def formMultiplierPairing {n : ℕ} (Z : ℕ) (ψ : Wavefunction n) (g : Gradient n) + (θ : Configuration n → ℝ) : ℝ := + (1/2:ℝ)*(∑ σ : Spins n, ∑ i : Fin n, ∑ a : Fin 3, + ∫ x : Configuration n, inner ℝ (g σ i a x) (multiplyGradient θ ψ g σ i a x)) + + ∑ σ : Spins n, ∫ x : Configuration n, θ x*(coulombPotential Z x*‖ψ σ x‖^2) + +theorem multiplyGradient_affine {n : ℕ} {θ : Configuration n → ℝ} + (hθ : ContDiff ℝ ∞ θ) (ψ : Wavefunction n) (g : Gradient n) (t : ℝ) + (σ : Spins n) (i : Fin n) (a : Fin 3) (x : Configuration n) : + multiplyGradient (fun y => 1+t*θ y) ψ g σ i a x = + g σ i a x + t • multiplyGradient θ ψ g σ i a x := by + have hd : fderiv ℝ (fun y => 1+t*θ y) x = t • fderiv ℝ θ x := by + rw [fderiv_const_add, fderiv_const_mul (hθ.differentiable (by simp)).differentiableAt] + simp only [multiplyGradient, hd, smul_apply, smul_eq_mul, + Complex.ofReal_mul, Complex.ofReal_add, Complex.ofReal_one, Complex.real_smul] + ring + +theorem normSquared_affine_multiplier {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {θ : Configuration n → ℝ} (hθ : SmoothMultiplier θ) (t : ℝ) : + normSquared (multiplyWavefunction (fun x => 1+t*θ x) ψ) = normSquared ψ + + 2*t*stateWeightedIntegral ψ θ + t^2*normSquared (multiplyWavefunction θ ψ) := by + simp only [normSquared, norm_multiplyWavefunction_sq, stateWeightedIntegral] + simp_rw [integral_affine_multiplier_sq (hd.2.2.1 _).norm.integrable_sq hθ, + Finset.sum_add_distrib, ← Finset.mul_sum] + +theorem energy_affine_multiplier {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {θ : Configuration n → ℝ} (hθ : SmoothMultiplier θ) (t : ℝ) : + energy Z (multiplyWavefunction (fun x => 1+t*θ x) ψ) + (multiplyGradient (fun x => 1+t*θ x) ψ g) = energy Z ψ g + + 2*t*formMultiplierPairing Z ψ g θ + + t^2*energy Z (multiplyWavefunction θ ψ) (multiplyGradient θ ψ g) := by + simp only [energy, formMultiplierPairing, multiplyGradient_affine hθ.smooth, + norm_multiplyWavefunction_sq] + simp_rw [integral_norm_add_smul_sq (hd.2.2.2.1 _ _ _) ((hd.multiply hθ).2.2.2.1 _ _ _)] + have hp : ∀ σ : Spins n, (∫ x : Configuration n, + coulombPotential Z x*((1+t*θ x)^2*‖ψ σ x‖^2)) = + (∫ x : Configuration n, coulombPotential Z x*‖ψ σ x‖^2) + + 2*t*(∫ x : Configuration n, θ x*(coulombPotential Z x*‖ψ σ x‖^2)) + + t^2*(∫ x : Configuration n, coulombPotential Z x*(θ x^2*‖ψ σ x‖^2)) := by + intro σ + simpa only [mul_left_comm (coulombPotential Z _)] using + integral_affine_multiplier_sq (hd.integrable_potential Z σ) hθ t + simp_rw [hp, Finset.sum_add_distrib, ← Finset.mul_sum] + ring + +theorem minimizer_multiplier_pairing {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) + {θ : Configuration n → ℝ} (hθ : SmoothMultiplier θ) : + formMultiplierPairing Z ψ g θ = energy Z ψ g * stateWeightedIntegral ψ θ := by + let P := formMultiplierPairing Z ψ g θ - energy Z ψ g * stateWeightedIntegral ψ θ + let A := energy Z (multiplyWavefunction θ ψ) (multiplyGradient θ ψ g) - + energy Z ψ g * normSquared (multiplyWavefunction θ ψ) + have hb : ∀ t : ℝ, 0 ≤ 2*t*P + t^2*A := by + intro t + have hm : SmoothMultiplier (fun x => 1+t*θ x) := + (SmoothMultiplier.const 1).add ((SmoothMultiplier.const t).mul hθ) + have hh := rayleigh_lower_bound Z hmin (hd.multiply hm) + rw [normSquared_affine_multiplier hd hθ t, energy_affine_multiplier Z hd hθ t, hn] at hh + dsimp only [P,A] + nlinarith + have hlocal : IsLocalMin (fun t : ℝ => 2*t*P+t^2*A) 0 := by + exact Eventually.of_forall fun t => by simpa using hb t + have hder : HasDerivAt (fun t : ℝ => 2*t*P+t^2*A) (2*P) 0 := by + convert (((hasDerivAt_id (0 : ℝ)).const_mul 2).mul_const P).add + (((hasDerivAt_id (0 : ℝ)).pow 2).mul_const A) using 1 + all_goals first | rfl | norm_num + have he := hlocal.hasDerivAt_eq_zero hder + dsimp only [P] at he + linarith + +def localizationError {n : ℕ} (ψ : Wavefunction n) (θ : Configuration n → ℝ) : ℝ := + (1/2:ℝ)*(∑ σ : Spins n, ∑ i : Fin n, ∑ a : Fin 3, + ∫ x : Configuration n, (fderiv ℝ θ x (coordinateDirection i a))^2*‖ψ σ x‖^2) + +theorem norm_multiplyGradient_sq {n : ℕ} {θ : Configuration n → ℝ} + (hθ : ContDiff ℝ ∞ θ) (ψ : Wavefunction n) (g : Gradient n) + (σ : Spins n) (i : Fin n) (a : Fin 3) (x : Configuration n) : + ‖multiplyGradient θ ψ g σ i a x‖^2 = + inner ℝ (g σ i a x) (multiplyGradient (fun y => θ y^2) ψ g σ i a x) + + (fderiv ℝ θ x (coordinateDirection i a))^2*‖ψ σ x‖^2 := by + have hder : fderiv ℝ (fun y => θ y^2) x (coordinateDirection i a) = + 2*θ x*(fderiv ℝ θ x (coordinateDirection i a)) := by + simp only [pow_two] + change (fderiv ℝ (θ*θ) x) _ = _ + rw [fderiv_mul (hθ.differentiable (by simp)).differentiableAt + (hθ.differentiable (by simp)).differentiableAt] + simp only [add_apply, smul_apply, smul_eq_mul] + ring + simp only [multiplyGradient, hder, norm_add_sq_real, norm_smul, + inner_add_right, real_inner_smul_left, real_inner_smul_right, + real_inner_self_eq_norm_sq, Real.norm_eq_abs, mul_pow, sq_abs] + rw [real_inner_comm (ψ σ x) (g σ i a x)] + ring + +theorem integrable_localization_error {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {θ : Configuration n → ℝ} + (hθ : SmoothMultiplier θ) (σ : Spins n) (i : Fin n) (a : Fin 3) : + Integrable (fun x : Configuration n => + (fderiv ℝ θ x (coordinateDirection i a))^2*‖ψ σ x‖^2) := by + have hl := memLp_bounded_real_smul (hψ σ) + ((hθ.smooth.continuous_fderiv (by simp)).clm_apply continuous_const) + (hθ.derivative_bounded i a) + simpa only [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] using hl.norm.integrable_sq + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/ThinCut.lean b/lean/OAI/Analysis/CoulombRadii/Localization/ThinCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..846b50085f8c494db7824d67836ce9085502add9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/ThinCut.lean @@ -0,0 +1,155 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff Topology +noncomputable section +namespace Coulomb + +lemma transition_derivative_compact : HasCompactSupport (deriv Real.smoothTransition) := by + apply HasCompactSupport.intro (K:=Set.Icc (0:ℝ) 1) isCompact_Icc + intro x hx + rcases not_and_or.mp hx with h|h + · have hx0 : x<0 := lt_of_not_ge h + have H : Real.smoothTransition =ᶠ[𝓝 x] (fun _ => (0:ℝ)) := by + filter_upwards [eventually_lt_nhds hx0] with y hy + exact Real.smoothTransition.zero_of_nonpos hy.le + rw [H.deriv_eq] + simp + · have hx1 : 1 (1:ℝ)) := by + filter_upwards [eventually_gt_nhds hx1] with y hy + exact Real.smoothTransition.one_of_one_le hy.le + rw [H.deriv_eq] + simp + +lemma transition_derivative_bounded : ∃ C : ℝ, 0 + (by simpa only [Real.norm_eq_abs] using (hB x).trans (le_max_left B 1))⟩ + +def transitionDerivativeBound : ℝ := Classical.choose transition_derivative_bounded +lemma transitionDerivativeBound_pos : 0 ((t+b)^2-t^2)⁻¹ * ((t+b)^2-‖id z-y‖^2)) = + (fun z : Space => ((t+b)^2-‖z-y‖^2)/((t+b)^2-t^2)) := by + funext z + simp only [id_eq,div_eq_mul_inv,mul_comm] + rw [Hfun] at Hf + have Hg := (((Real.smoothTransition.contDiff (n:=1)).differentiable (by simp) _).hasDerivAt.comp_hasFDerivAt x Hf).const_mul (Real.pi/2) + have H := congrArg (fun L : Space →L[ℝ] ℝ => L v) Hg.fderiv + change fderiv ℝ (thinAngle y t b) x v = _ at H + rw [H] + simp only [smul_apply,neg_apply, + smul_eq_mul,ContinuousLinearMap.comp_apply,ContinuousLinearMap.id_apply, + innerSL_apply_apply,id_eq] + ring + +lemma thinAngle_core (y : Space) {t b : ℝ} (ht : 0≤t) (hb : 0 (0:ℝ)) := by + have hh : ∀ᶠ z in 𝓝 x, t+b < ‖z-y‖ := + (isOpen_lt continuous_const (continuous_id.sub continuous_const).norm).mem_nhds hx + filter_upwards [hh] with z hz + exact thinAngle_exterior y ht hb z hz.le + rw [H.fderiv_eq] + simp + +def thinCutCoefficient : ℝ := Real.pi*transitionDerivativeBound +lemma thinCutCoefficient_pos : 0 if l=0 then (0:ℝ) else 1) := by + have hh : ∀ᶠ z in 𝓝 x, t+b < ‖z-y‖ := + (isOpen_lt continuous_const (continuous_id.sub continuous_const).norm).mem_nhds hx + filter_upwards [hh] with z hz + simp only [thinCut,thinAngle_exterior y ht hb z hz.le,Real.sin_zero,Real.cos_zero] + rw [he.fderiv_eq] + simp + +lemma thinCut_gradient_bound (y : Space) {t b : ℝ} (ht : 0≤t) (hb : 0 (1:ℝ)) x := by + by_cases hx : x ∈ Metric.closedBall y (t+b) + · rw [indicator_of_mem hx,mul_one] + calc + _ ≤ ∑ _l : Fin 2, (thinCutCoefficient/b)^2 := by + apply Finset.sum_le_sum + intro l hl + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) (div_nonneg thinCutCoefficient_pos.le hb.le)).2 + (thinCut_derivative_bound y ht hb l i x) + _ = _ := by simp + · rw [indicator_of_notMem hx,mul_zero] + have hd := thinCut_fderiv_zero y ht hb + have hh : t+b < ‖x-y‖ := by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hx + simp only [hd _ x hh,zero_apply,ne_eq,OfNat.ofNat_ne_zero,not_false_eq_true, + zero_pow,Finset.sum_const_zero,le_refl] + +theorem form_thin_labelCut {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + (y : Space) {t b : ℝ} (ht : 0≤t) (hb : 0 (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := by + rw [← integral_const_mul] + apply integral_mono_of_nonneg + · filter_upwards [] with x + exact mul_nonneg (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (sq_nonneg _) + · exact (hi s a.1).const_mul c + · filter_upwards [] with x + simpa only [c,mul_assoc] using mul_le_mul_of_nonneg_right (thinCut_gradient_bound y ht hb a.2 (position x a.1)) (sq_nonneg ‖ψ.value s x‖) + calc + _ ≤ (1/2:ℝ)*∑ s, ∑ a : Fin n × Fin 3, c*(∫ x, + (Metric.closedBall y (t+b)).indicator (fun _ => (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun s _ => Finset.sum_le_sum (fun a _ => H s a))) (by norm_num) + _ = _ := by + simp only [Fintype.sum_prod_type,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul, + ← Finset.mul_sum,expectedPopulation,c] + ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/TotalDeletion.lean b/lean/OAI/Analysis/CoulombRadii/Localization/TotalDeletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f1cb9eeac5cbac459b48d4e097cc89184119048 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/TotalDeletion.lean @@ -0,0 +1,176 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.WeightedExterior +import OAI.Analysis.CoulombRadii.RandomFields.WeightedDeletion + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +theorem atomic_weighted_exterior_deletion : ∃ C : ℝ, 0 ≤ C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ j, S.position j=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E → + ∀ {t : ℝ}, 0 ∑ j∈Finset.range k, deletionShellWeight t w j y)) ψ ≤ + 4*C*(screenMass 0 (t/4))^2/t := by + have hfun : weightedInnerField (n:=n) S (t/4) (fun y => ∑ j∈Finset.range k, deletionShellWeight t w j y)= + (fun x => ∑ j∈Finset.range k, weightedInnerField S (t/4) (deletionShellWeight t w j) x) := + funext (weightedInnerField_sum_weights S (t/4) (Finset.range k) (deletionShellWeight t w)) + rw [hfun,potentialForm_sum_values] + · calc + _ ≤ ∑ j∈Finset.range k, C*(screenMass 0 (t/4))^2*((j:ℝ)+1)/((2:ℝ)^j*t) := by + apply Finset.sum_le_sum + intro j hj + exact H S hatom ψ hψ hm hE hstate ht j (deletionShellWeight t w j) + (deletionShellWeight_measurable hwm t j) (deletionShellWeight_nonneg hw0 t j) + (deletionShellWeight_le_one hw1 t j) (deletionShellWeight_supported t w j) + _ = (C*(screenMass 0 (t/4))^2/t)*∑ j∈Finset.range k, ((j:ℝ)+1)*(1/2:ℝ)^j := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j hj + simp only [div_pow,one_pow] + field_simp + _ ≤ (C*(screenMass 0 (t/4))^2/t)*4 := + mul_le_mul_of_nonneg_left (deletion_geometric_sum k) (by positivity) + _ = _ := by ring + · intro j hj s + apply boundedObservable_integrable ψ _ (weightedInnerField_measurable S (t/4) + (deletionShellWeight_measurable hwm t j)) + have hpow : (1:ℝ) ≤ 2^j := one_le_pow₀ (by norm_num) + have hu : 0<(2:ℝ)^j*t := by positivity + exact weightedInnerField_abs_le S hatom hu (by nlinarith) + (fun y => by rw [abs_of_nonneg (deletionShellWeight_nonneg hw0 t j y)]; exact deletionShellWeight_le_one hw1 t j y) + (deletionShellWeight_supported t w j) + exact le_of_tendsto (weightedInnerField_shell_partial_tendsto S hatom ψ ht hwm hwabs hws) + (Eventually.of_forall hterm) + +end Coulomb +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +def particleInnerExterior {J n : ℕ} (S : Nuclei J) (h t : ℝ) + (i : Fin n) (x : Configuration n) : ℝ := + if t ≤ ‖position x i‖ then + rawSignedField (attraction S (position x i)) (Metric.ball 0 h) (position x i) x else 0 + +lemma particleInnerExterior_measurable {J n : ℕ} (S : Nuclei J) (h t : ℝ) (i : Fin n) : + Measurable (particleInnerExterior S h t i) := by + have hp : Measurable (fun x : Configuration n => position x i) := (continuous_position i).measurable + have hr : Measurable (fun x : Configuration n => restrictedOutPotential x (Metric.ball 0 h) (position x i)) := + (restrictedOutPotential_joint_measurable (m:=n) (A:=Metric.ball (0:Space) h) measurableSet_ball).comp + (f:=fun x : Configuration n => (x,position x i)) (measurable_id.prodMk hp) + exact Measurable.ite (measurableSet_le measurable_const hp.norm) + (((attraction_measurable S).comp hp).sub hr) measurable_const + +lemma particleInnerExterior_abs_le {J n : ℕ} (S : Nuclei J) (hatom : ∀ j,S.position j=0) + {h t : ℝ} (ht : 0 if t≤‖y‖ then 1 else 0 + have hw y : |w y| ≤ 1 := by dsimp [w]; split_ifs <;> norm_num + have hs y (hy : ‖y‖ particleInnerExterior_measurable S h t (Fin.castAdd k index)) + +lemma outerDeletionField_abs_le {J m k : ℕ} (S : Nuclei J) (hatom : ∀ j,S.position j=0) + {h t : ℝ} (ht : 0 particleInnerExterior_abs_le S hatom ht hh (Fin.castAdd k i) v) + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] using H) + +lemma outerDeletionField_ge_attraction_sub_cross {J m k : ℕ} (S : Nuclei J) + {h t : ℝ} (hh : h ≤ t) (x : Configuration m) (z : Configuration k) + (hx : ∀ i, t ≤ ‖position x i‖) : + nuclearPotential S x-crossPotential x z ≤ outerDeletionField S h t (joinConfiguration m k (x,z)) := by + have hzero (y : Space) : restrictedOutPotential x (Metric.ball 0 h) y=0 := by + apply Finset.sum_eq_zero + intro i hi + apply ite_eq_right + simpa only [Metric.mem_ball,dist_zero_right,not_lt] using hh.trans (hx i) + have hle (i : Fin m) : restrictedOutPotential z (Metric.ball 0 h) (position x i) ≤ + ∑ j : Fin k, coulombKernel (position x i-position z j) := by + apply Finset.sum_le_sum + intro j hj + split_ifs + · exact le_of_eq (coulombKernel_sub_comm ..) + · exact inv_nonneg.mpr (norm_nonneg _) + simp only [outerDeletionField,particleInnerExterior,position_join_left,ite_eq_left (hx _),rawSignedField, + restrictedOutPotential_join,hzero,zero_add,nuclearPotential,crossPotential,←Finset.sum_sub_distrib] + exact Finset.sum_le_sum (fun i _ => sub_le_sub_left (hle i) _) + +lemma slice_core_form_le_raw_deletion {J m k : ℕ} (S : Nuclei J) + (hatom : ∀ j,S.position j=0) (v : H1Vector (m+k)) {h t : ℝ} (ht : 0 form S (v.coreSlice s x).normalized) ≤ + form S v+potentialForm (outerDeletionField (m:=m) (k:=k) S h t) v := by + have hfield : potentialForm (fun q => nuclearPotential S ((joinConfiguration m k).symm q).1) v- + potentialForm (fun q => crossPotential ((joinConfiguration m k).symm q).1 ((joinConfiguration m k).symm q).2) v ≤ + potentialForm (outerDeletionField (m:=m) (k:=k) S h t) v := by + unfold potentialForm + rw [←Finset.sum_sub_distrib] + apply Finset.sum_le_sum + intro s hsu + rw [←integral_sub (v.outer_nuclear_integrable S s) (v.cross_integrable s)] + apply integral_mono_ae ((v.outer_nuclear_integrable S s).sub (v.cross_integrable s)) + (boundedObservable_integrable v _ (outerDeletionField_measurable S h t) + (outerDeletionField_abs_le S hatom ht hh) s) + filter_upwards [hs s] with q hq + by_cases hz : v.value s q=0 + · simp [hz] + · have hx i : t ≤ ‖position ((joinConfiguration m k).symm q).1 i‖ := by + have he : position q (Fin.castAdd k i)=position ((joinConfiguration m k).symm q).1 i := by + have H := position_join_left ((joinConfiguration m k).symm q).1 ((joinConfiguration m k).symm q).2 i + simpa only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply] using H + rw [←he] + exact by_contra (fun hn => hz (hq _ ⟨i,rfl⟩ hn)) + have H := outerDeletionField_ge_attraction_sub_cross S (show h≤t by linarith) + ((joinConfiguration m k).symm q).1 ((joinConfiguration m k).symm q).2 hx + simp only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply] at H + simpa only [Pi.sub_apply,sub_mul] using mul_le_mul_of_nonneg_right H (sq_nonneg ‖v.value s q‖) + have hp : 0 ≤ potentialForm (fun q => pairPotential ((joinConfiguration m k).symm q).1) v := + Finset.sum_nonneg (fun s _ => integral_nonneg (fun q => + mul_nonneg (pairPotential_nonneg_pointwise _) (sq_nonneg _))) + have hk := outerKinetic_nonneg v + change (∑ s, ∫ x, mass (v.coreSlice s x)*form S (v.coreSlice s x).normalized) ≤ _ + rw [conditional_core_form_identity] + change _ ≤ kinetic v-nuclearEnergy S v+pairEnergy v+_ + rw [kinetic_split,nuclearEnergy_split,pairEnergy_split] + linarith + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Localization/TruncatedCoulomb.lean b/lean/OAI/Analysis/CoulombRadii/Localization/TruncatedCoulomb.lean new file mode 100644 index 0000000000000000000000000000000000000000..45dca53410ded024cb7c143c70a279b71a7d7661 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Localization/TruncatedCoulomb.lean @@ -0,0 +1,221 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.SmoothCompact +import OAI.Analysis.CoulombRadii.FieldAnalysis.PairRegroup + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma coulombKernel_nonneg (x : Space) : 0 ≤ coulombKernel x := inv_nonneg.mpr (norm_nonneg _) +lemma coulombKernel_measurable : Measurable coulombKernel := measurable_norm.inv +lemma coulombKernel_integrableOn_ball (R : ℝ) : IntegrableOn coulombKernel (Metric.ball 0 R) := by + apply integrableOn_ball_of_norm_le_rpow (C := 1) (α := 1) (by simp) (by norm_num) + · exact Filter.Eventually.of_forall (fun x => by simp [coulombKernel, Real.rpow_neg_one]) + · exact coulombKernel_measurable.aestronglyMeasurable + +lemma coulombKernel_ball_integral {R : ℝ} (hR : 0 ≤ R) : + (∫ x : Space in Metric.ball 0 R, coulombKernel x) = 2 * Real.pi * R^2 := by + have H := integral_fun_norm_addHaar (volume : Measure Space) + (fun t : ℝ => if t < R then t⁻¹ else 0) + have hleft : (∫ x : Space in Metric.ball 0 R, coulombKernel x) = + ∫ x : Space, (if ‖x‖ < R then ‖x‖⁻¹ else 0) := by + rw [← integral_indicator measurableSet_ball] + simp only [Set.indicator, Metric.mem_ball, dist_zero_right, coulombKernel] + rw [hleft, H] + have hball : volume.real (Metric.ball (0 : Space) 1) = 4 * Real.pi / 3 := by + rw [Measure.real, EuclideanSpace.volume_ball_fin_three] + norm_num + rw [ENNReal.toReal_ofReal (by positivity)] + ring + have hdim : Module.finrank ℝ Space = 3 := by simp [Space] + simp only [hdim, hball, nsmul_eq_mul, smul_eq_mul] + have hint : (∫ t in Ioi (0:ℝ), t^(3-1) * (if t < R then t⁻¹ else 0)) = ∫ t in Ioo 0 R, t := by + calc + _ = ∫ t in Ioi (0:ℝ), (Iio R).indicator (fun u : ℝ => u) t := by + apply setIntegral_congr_fun measurableSet_Ioi + intro t ht + change 0 < t at ht + by_cases h : t < R + · simp only [h, ite_true, Set.indicator, mem_Iio] + norm_num + field_simp + · simp [Set.indicator, h] + _ = _ := by rw [integral_indicator measurableSet_Iio, Measure.restrict_restrict measurableSet_Iio, inter_comm, Ioi_inter_Iio] + rw [hint, setIntegral_congr_set Ioo_ae_eq_Ioc, ← intervalIntegral.integral_of_le hR] + norm_num [integral_id] + ring + +noncomputable def truncatedCoulomb (R : ℝ) (x : Space) : ℝ := + (Metric.ball (0:Space) R).indicator coulombKernel x +lemma truncatedCoulomb_nonneg (R : ℝ) (x : Space) : 0 ≤ truncatedCoulomb R x := + Set.indicator_nonneg (fun _ _ => coulombKernel_nonneg _) x +lemma truncatedCoulomb_integrable (R : ℝ) : Integrable (truncatedCoulomb R) := + (coulombKernel_integrableOn_ball R).integrable_indicator measurableSet_ball +lemma truncatedCoulomb_integral {R : ℝ} (hR : 0 ≤ R) : + (∫ x, truncatedCoulomb R x) = 2*Real.pi*R^2 := by + unfold truncatedCoulomb + rw [integral_indicator measurableSet_ball, coulombKernel_ball_integral hR] + +lemma coulomb_integrand_bound {f : Space → ℝ} {M R : ℝ} (hf0 : ∀ y, 0 ≤ f y) + (hfM : ∀ y, f y ≤ M) (hR : 0 < R) (x y : Space) : + coulombKernel (x-y) * f y ≤ M * truncatedCoulomb R (x-y) + R⁻¹ * f y := by + by_cases h : x-y ∈ Metric.ball (0:Space) R + · rw [truncatedCoulomb, Set.indicator_of_mem h] + have H := mul_le_mul_of_nonneg_left (hfM y) (coulombKernel_nonneg (x-y)) + linarith [mul_nonneg (inv_nonneg.mpr hR.le) (hf0 y)] + · rw [truncatedCoulomb, Set.indicator_of_notMem h, mul_zero, zero_add] + have hn : R ≤ ‖x-y‖ := by simpa [Metric.mem_ball, dist_zero_right] using h + exact mul_le_mul_of_nonneg_right (inv_anti₀ hR hn) (hf0 y) + +lemma coulomb_convolution_integrable {f : Space → ℝ} (hf : Integrable f) (hm : Measurable f) + {M R : ℝ} (hf0 : ∀ y, 0 ≤ f y) (hfM : ∀ y, f y ≤ M) (hR : 0 < R) (x : Space) : + Integrable (fun y => coulombKernel (x-y) * f y) := by + have hnear := (truncatedCoulomb_integrable R).comp_sub_left x + apply ((hnear.const_mul M).add (hf.const_mul R⁻¹)).mono' + (((coulombKernel_measurable.comp (measurable_const.sub measurable_id)).mul hm).aestronglyMeasurable) + exact Filter.Eventually.of_forall (fun y => by + change ‖coulombKernel (x-y) * f y‖ ≤ _ + rw [Real.norm_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (hf0 _))] + exact coulomb_integrand_bound hf0 hfM hR x y) + +lemma coulomb_convolution_bound {f : Space → ℝ} (hf : Integrable f) (hm : Measurable f) + {M R : ℝ} (hf0 : ∀ y, 0 ≤ f y) (hfM : ∀ y, f y ≤ M) (hR : 0 < R) (x : Space) : + (∫ y, coulombKernel (x-y) * f y) ≤ 2*Real.pi*M*R^2 + R⁻¹ * ∫ y, f y := by + have hnear := (truncatedCoulomb_integrable R).comp_sub_left x + calc + _ ≤ ∫ y, M * truncatedCoulomb R (x-y) + R⁻¹ * f y := + integral_mono (coulomb_convolution_integrable hf hm hf0 hfM hR x) + ((hnear.const_mul M).add (hf.const_mul R⁻¹)) (coulomb_integrand_bound hf0 hfM hR x) + _ = _ := by + rw [integral_add (hnear.const_mul M) (hf.const_mul R⁻¹), integral_const_mul, + integral_const_mul, integral_sub_left_eq_self, truncatedCoulomb_integral hR.le] + ring + +lemma coulomb_signed_convolution_integrable {f : Space → ℝ} (hf : Integrable f) + (hm : Measurable f) {M : ℝ} (hM : ∀ x, ‖f x‖ ≤ M) (x : Space) : + Integrable (fun y => coulombKernel (x-y)*f y) := by + have h := coulomb_convolution_integrable hf.norm hm.norm (fun y => norm_nonneg _) hM + (by norm_num : (0:ℝ) < 1) x + apply h.mono' (((coulombKernel_measurable.comp (by fun_prop)).mul hm).aestronglyMeasurable) + exact Filter.Eventually.of_forall (fun y => by + change ‖coulombKernel (x-y)*f y‖ ≤ coulombKernel (x-y)*‖f y‖ + rw [norm_mul, Real.norm_of_nonneg (coulombKernel_nonneg _)] ) + +lemma coulomb_pair_integrable {f g : Space → ℝ} (hf : Integrable f) (hfm : Measurable f) + (hg : Integrable g) (hgm : Measurable g) {M : ℝ} (hM : ∀ y, ‖g y‖ ≤ M) : + Integrable (fun p : Space × Space => f p.1*g p.2*coulombKernel (p.1-p.2)) := by + have hm : Measurable (fun p : Space × Space => f p.1*g p.2*coulombKernel (p.1-p.2)) := + ((hfm.comp measurable_fst).mul (hgm.comp measurable_snd)).mul (coulombKernel_measurable.comp (by fun_prop)) + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + constructor + · apply Filter.Eventually.of_forall + intro x + have hi := (coulomb_signed_convolution_integrable hg hgm hM x).const_mul (f x) + apply hi.congr + exact Filter.Eventually.of_forall (fun y => by dsimp only; ring) + · let A : ℝ := 2*Real.pi*M + ∫ y, ‖g y‖ + have hb (x : Space) : (∫ y, coulombKernel (x-y)*‖g y‖) ≤ A := by + simpa [A] using coulomb_convolution_bound hg.norm hgm.norm (fun y => norm_nonneg _) hM + (by norm_num : (0:ℝ) < 1) x + have he (x : Space) : + (∫ y, ‖f x*g y*coulombKernel (x-y)‖) = ‖f x‖*(∫ y, coulombKernel (x-y)*‖g y‖) := by + simp_rw [norm_mul, Real.norm_of_nonneg (coulombKernel_nonneg _)] + simp_rw [mul_assoc, mul_comm ‖g _‖ (coulombKernel _)] + rw [integral_const_mul] + apply (hf.norm.mul_const A).mono' hm.aestronglyMeasurable.norm.integral_prod_right' + exact Filter.Eventually.of_forall (fun x => by + change ‖∫ y, ‖f x*g y*coulombKernel (x-y)‖‖ ≤ ‖f x‖*A + rw [Real.norm_of_nonneg (integral_nonneg (fun y => norm_nonneg _)), he] + exact mul_le_mul_of_nonneg_left (hb x) (norm_nonneg _)) + +lemma compact_coulomb_cross_integrable (f g u v : Space → ℂ) + (hf : Continuous f) (hg : Continuous g) (hu : Continuous u) (hv : Continuous v) + (hfc : HasCompactSupport f) (hgc : HasCompactSupport g) : + Integrable (fun xy : Space × Space => (coulombKernel (xy.1-xy.2) : ℂ) * + ((star (f xy.1)*u xy.1)*(star (g xy.2)*v xy.2))) := by + have hF : Continuous (fun x => ‖f x‖*‖u x‖) := hf.norm.mul hu.norm + have hG : Continuous (fun x => ‖g x‖*‖v x‖) := hg.norm.mul hv.norm + have hFC : HasCompactSupport (fun x => ‖f x‖*‖u x‖) := hfc.norm.mul_right + have hGC : HasCompactSupport (fun x => ‖g x‖*‖v x‖) := hgc.norm.mul_right + obtain ⟨M,hM⟩ := hGC.exists_bound_of_continuous hG + have H := coulomb_pair_integrable (hF.integrable_of_hasCompactSupport hFC) hF.measurable + (hG.integrable_of_hasCompactSupport hGC) hG.measurable hM + apply H.mono' ?_ (ae_of_all _ (fun xy => ?_)) + · exact (((coulombKernel_measurable.comp (measurable_fst.sub measurable_snd)).complex_ofReal).mul + (((hf.star.mul hu).measurable.comp measurable_fst).mul + ((hg.star.mul hv).measurable.comp measurable_snd))).aestronglyMeasurable + · simp only [norm_mul, norm_star, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (coulombKernel_nonneg _)] + exact le_of_eq (by ring) + +lemma flatSpinOrbital_coulomb_cross_integrable {ι : Type*} [Fintype ι] (v : ι → Space → Fin 2 → ℂ) + (hv : ∀ i s, ContDiff ℝ (⊤ : ℕ∞) (fun x => v i x s)) + (hC : ∀ i s, HasCompactSupport (fun x => v i x s)) (a b c d : ι) : + Integrable (fun xy : (Fin 2 × (Fin 3 → ℝ)) × (Fin 2 × (Fin 3 → ℝ)) => + (coulombKernel (WithLp.toLp 2 xy.1.2 - WithLp.toLp 2 xy.2.2) : ℂ) * + ((star (flatSpinOrbital (v a) xy.1)*flatSpinOrbital (v c) xy.1)* + (star (flatSpinOrbital (v b) xy.2)*flatSpinOrbital (v d) xy.2))) + (spinSpaceMeasure.prod spinSpaceMeasure) := by + have hsp (s t : Fin 2) := compact_coulomb_cross_integrable + (fun x => v a x s) (fun x => v b x t) (fun x => v c x s) (fun x => v d x t) + (hv a s).continuous (hv b t).continuous (hv c s).continuous (hv d t).continuous + (hC a s) (hC b t) + have hm0 : MeasurePreserving (MeasurableEquiv.toLp 2 (Fin 3 → ℝ)) volume volume := + PiLp.volume_preserving_toLp _ + have hm := hm0.prod hm0 + let F (sz : (Fin 2 × Fin 2) × ((Fin 3 → ℝ) × (Fin 3 → ℝ))) : ℂ := + (coulombKernel (WithLp.toLp 2 sz.2.1 - WithLp.toLp 2 sz.2.2) : ℂ) * + ((star (v a (WithLp.toLp 2 sz.2.1) sz.1.1)*v c (WithLp.toLp 2 sz.2.1) sz.1.1)* + (star (v b (WithLp.toLp 2 sz.2.2) sz.1.2)*v d (WithLp.toLp 2 sz.2.2) sz.1.2)) + have hF : Integrable F (Measure.count.prod (volume.prod volume)) := + integrable_finite_count_prod F (fun st => hm.integrable_comp_of_integrable (hsp st.1 st.2)) + have hR := pairRegroup_measurePreserving (Measure.count : Measure (Fin 2)) + (volume : Measure (Fin 3 → ℝ)) (Measure.count : Measure (Fin 2)) (volume : Measure (Fin 3 → ℝ)) + rw [count_prod_count] at hR + exact hR.integrable_comp_of_integrable hF +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Main.lean b/lean/OAI/Analysis/CoulombRadii/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..588b16e7b167588cbe42017c78bacb5df5f56b58 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Main.lean @@ -0,0 +1,29 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.AtomicMasterFresh +import OAI.Analysis.CoulombRadii.RandomFields.ObservationFieldTransfer +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalBandRegularity +import OAI.Analysis.CoulombRadii.LimitTheory.AdmissibleStage + +namespace OAI + +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +noncomputable section +namespace NeutralAtom + +theorem generalized_outer_radii + (Ψ : ∀ N : ℕ, Wavefunction (N + 1)) + (hΨ : ∀ N : ℕ, IsNormalizedGroundState (N + 1) (Ψ N)) : + Tendsto (fun m : ℕ => (((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) : EReal) * upperRadius Ψ m) + atTop (𝓝 (bTF : EReal)) ∧ + Tendsto (fun m : ℕ => (((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) : EReal) * lowerRadius Ψ m) + atTop (𝓝 (bTF : EReal)) := by + obtain ⟨Zbar,htail⟩ := physical_expected_exterior_asymptotic + exact iterated_limits_of_expected_exterior_asymptotic Zbar htail Ψ hΨ +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Model.lean b/lean/OAI/Analysis/CoulombRadii/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4c671e35262d428dca1232fefdd38b05dc376a5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Model.lean @@ -0,0 +1,80 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff + +namespace NeutralAtom + +abbrev Position := EuclideanSpace ℝ (Fin 3) +abbrev Configuration (n : ℕ) := Fin n → Position +abbrev Spins (n : ℕ) := Fin n → Fin 2 +abbrev Wavefunction (n : ℕ) := Spins n → Configuration n → ℂ +abbrev Gradient (n : ℕ) := Spins n → Fin n → Fin 3 → Configuration n → ℂ + +def coordinateDirection {n : ℕ} (i : Fin n) (a : Fin 3) : Configuration n := + Pi.single i (EuclideanSpace.single a 1) + +def HasWeakGradient {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) : Prop := + ∀ σ i a (φ : Configuration n → ℝ), ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, (fderiv ℝ φ x (coordinateDirection i a) : ℂ) * ψ σ x) = + -(∫ x, (φ x : ℂ) * g σ i a x) + +def IsAntisymmetric {n : ℕ} (ψ : Wavefunction n) : Prop := + ∀ (p : Equiv.Perm (Fin n)) (σ : Spins n), + (fun x : Configuration n => ψ (σ ∘ p) (x ∘ p)) =ᵐ[volume] + (fun x => (((Equiv.Perm.sign p : ℤ) : ℂ)) * ψ σ x) + +def FormDomain {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) : Prop := + IsAntisymmetric ψ ∧ HasWeakGradient ψ g ∧ + (∀ σ, MemLp (ψ σ) 2 volume) ∧ + (∀ σ i a, MemLp (g σ i a) 2 volume) ∧ + (∀ σ i, Integrable (fun x : Configuration n => ‖x i‖⁻¹ * ‖ψ σ x‖ ^ 2)) ∧ + (∀ σ i j, i < j → + Integrable (fun x : Configuration n => ‖x i - x j‖⁻¹ * ‖ψ σ x‖ ^ 2)) + +def normSquared {n : ℕ} (ψ : Wavefunction n) : ℝ := + ∑ σ : Spins n, ∫ x : Configuration n, ‖ψ σ x‖ ^ 2 + +def coulombPotential {n : ℕ} (Z : ℕ) (x : Configuration n) : ℝ := + -(Z : ℝ) * (∑ i : Fin n, ‖x i‖⁻¹) + + ∑ i : Fin n, ∑ j ∈ Finset.univ.filter (fun j : Fin n => i < j), ‖x i - x j‖⁻¹ + +def energy {n : ℕ} (Z : ℕ) (ψ : Wavefunction n) (g : Gradient n) : ℝ := + (1 / 2 : ℝ) * (∑ σ : Spins n, ∑ i : Fin n, ∑ a : Fin 3, + ∫ x : Configuration n, ‖g σ i a x‖ ^ 2) + + ∑ σ : Spins n, ∫ x : Configuration n, coulombPotential Z x * ‖ψ σ x‖ ^ 2 + +def IsNormalizedGroundState (Z : ℕ) (ψ : Wavefunction Z) : Prop := + ∃ g : Gradient Z, FormDomain ψ g ∧ normSquared ψ = 1 ∧ + ∀ (χ : Wavefunction Z) (h : Gradient Z), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h + +def density {N : ℕ} (ψ : Wavefunction (N + 1)) (x : Position) : ℝ := + (N + 1 : ℝ) * ∑ σ : Spins (N + 1), + ∫ y : Configuration N, ‖ψ σ (Fin.cons x y)‖ ^ 2 + +def exteriorMass {N : ℕ} (ψ : Wavefunction (N + 1)) (r : ℝ) : ℝ := + ∫ x in {x : Position | r < ‖x‖}, density ψ x + +def radius {N : ℕ} (ψ : Wavefunction (N + 1)) (m : ℕ) : ℝ := + sInf {r : ℝ | 0 ≤ r ∧ exteriorMass ψ r ≤ (m : ℝ)} + +def bTF : ℝ := (81 * Real.pi ^ 2 / 2) ^ (1 / 3 : ℝ) + +def largeCharge (m : ℕ) : Filter ℕ := + atTop ⊓ Filter.principal {N : ℕ | m < N + 1} + +def upperRadius (Ψ : ∀ N : ℕ, Wavefunction (N + 1)) (m : ℕ) : EReal := + Filter.limsup (fun N : ℕ => (radius (Ψ N) m : EReal)) (largeCharge m) + +def lowerRadius (Ψ : ∀ N : ℕ, Wavefunction (N + 1)) (m : ℕ) : EReal := + Filter.liminf (fun N : ℕ => (radius (Ψ N) m : EReal)) (largeCharge m) + +end NeutralAtom +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/AnnularAddback.lean b/lean/OAI/Analysis/CoulombRadii/Packets/AnnularAddback.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d800c01a8c1dbd763bd8b1181bb8bcc7a5db71a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/AnnularAddback.lean @@ -0,0 +1,170 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.RadialRMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +def annularAddbackKernel (h u : ℝ) (z : Space) : ℝ := + (5000/u)*{v : Space | h≤‖v‖ ∧ ‖v‖<8*u}.indicator (fun _ => (1:ℝ)) z+ + 2*radialTailKernel (8*u) z +lemma measurableSet_addbackBand (h u : ℝ) : MeasurableSet {v : Space | h≤‖v‖ ∧ ‖v‖<8*u} := + (isClosed_le continuous_const continuous_norm).measurableSet.inter + (isOpen_lt continuous_norm continuous_const).measurableSet +lemma annularAddbackKernel_measurable (h u : ℝ) : Measurable (annularAddbackKernel h u) := + (measurable_const.mul (measurable_const.indicator (measurableSet_addbackBand h u))).add + (measurable_const.mul (radialTailKernel_measurable _)) +lemma annularAddbackKernel_nonneg {u : ℝ} (hu : 0 zero_le_one) _)) + (mul_nonneg (by norm_num) (radialTailKernel_nonneg _ _)) +lemma annularAddbackKernel_bound {u : ℝ} (hu : 0 (1:ℝ)) z≤1 := by + by_cases hz : h≤‖z‖ ∧ ‖z‖<8*u <;> simp [hz] + have ht := radialTailKernel_le (show 0<8*u by positivity) z + have H := add_le_add (mul_le_mul_of_nonneg_left hb (show 0≤5000/u by positivity)) + (mul_le_mul_of_nonneg_left ht (show (0:ℝ)≤2 by norm_num)) + apply H.trans + rw [mul_one] + have he : 5000/u+2*(8*u)⁻¹=(5000+1/4)/u := by ring + rw [he] + exact div_le_div_of_nonneg_right (by norm_num) hu.le + +lemma innerBall_subset_far {u h : ℝ} (hu : 0 hzu h.2),mul_zero,zero_add] + exact H + +lemma rawInnerField_addback {n : ℕ} {u h : ℝ} (hu : 0 H i) + simp only [Finset.sum_add_distrib] at HH + unfold rawSignedField restrictedOutPotential arrayStatistic + linarith + +lemma rawRMS_annularAddback {n : ℕ} (ψ : H1Vector n) {u : ℝ} (hu : 0 + (5000/u)*localCount {v : Space | h≤‖v‖ ∧ ‖v‖<8*u} x+2*arrayStatistic (radialTailKernel (8*u)) x) := by + funext x + simp only [arrayStatistic,annularAddbackKernel,Finset.sum_add_distrib,←Finset.mul_sum,localCount] + rw [he] + have hb (x : Configuration n) : |(5000/u)*localCount {v : Space | h≤‖v‖ ∧ ‖v‖<8*u} x|≤(5000/u)*(n:ℝ) := by + rw [abs_mul,abs_of_nonneg (by positivity : 0≤5000/u),abs_of_nonneg (localCount_nonneg _ _)] + exact mul_le_mul_of_nonneg_left (localCount_le _ _) (by positivity) + have ht (x : Configuration n) : |2*arrayStatistic (radialTailKernel (8*u)) x|≤2*((n:ℝ)/(8*u)) := by + rw [abs_mul,abs_of_pos (by norm_num : (0:ℝ)<2)] + exact mul_le_mul_of_nonneg_left (radialTailStatistic_bound (by positivity) x) (by norm_num) + exact (rawRMS_add ψ _ _ (measurable_const.mul (localCount_measurable (measurableSet_addbackBand h u))) + (measurable_const.mul (arrayStatistic_measurable (radialTailKernel_measurable _))) hb ht).trans_eq (by + change rawRMS ψ (fun x => (5000/u)*localCount {v : Space | h≤‖v‖ ∧ ‖v‖<8*u} x)+ + rawRMS ψ (fun x => 2*arrayStatistic (radialTailKernel (8*u)) x) = _ + rw [rawRMS_const_mul ψ _ (by positivity),rawRMS_const_mul ψ _ (by norm_num)] + rfl) + +lemma screenMass_zero_mono {h r : ℝ} (hh : 0 intro z hz; simp only [pow_zero,one_mul] at hz; exact (not_lt_of_ge hz.1 hz.2).elim + | succ N ih => + intro z hz + by_cases ht : ‖z‖<(2:ℝ)^N*h + · obtain ⟨j,hj⟩ := Set.mem_iUnion.mp (ih ⟨hz.1,ht⟩) + exact Set.mem_iUnion.mpr ⟨j.castSucc,hj⟩ + · refine Set.mem_iUnion.mpr ⟨Fin.last N,?_⟩ + have hr : 0<(2:ℝ)^N*h := by positivity + have H := hz.2 + simp only [pow_succ] at H + constructor <;> simp only [Fin.val_last] <;> nlinarith [le_of_not_gt ht] + +theorem atomic_dyadic_count_RMS : ∃ C : ℝ, 0≤C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E : ℝ}, (E:EReal)≤unrestrictedFormBottom S → form S ψ≤E → + ∀ {h : ℝ}, 0 {z | (1/2:ℝ)*((2:ℝ)^j.val*h)<‖z‖ ∧ ‖z‖<4*((2:ℝ)^j.val*h)} + have hA (j) : MeasurableSet (A j) := + ((isOpen_lt continuous_const continuous_norm).inter (isOpen_lt continuous_norm continuous_const)).measurableSet + have hc (j : Fin N) : localCountSecondMoment ψ (A j)≤C*(screenMass 0 h)^2 := by + have hr : 0<(2:ℝ)^j.val*h := by positivity + have hs : h≤(2:ℝ)^j.val*h := by nlinarith [(one_le_pow₀ (n:=j.val) (show (1:ℝ)≤2 by norm_num))] + have HH := H S hatom ψ hψ hm hE (by simpa only [add_zero] using hstate) (le_refl 0) hr + exact HH.trans (mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (screenMass_pos _ _).le (screenMass_zero_mono hh hs) 2) hC) + have HC := (localCountSecondMoment_cover ψ A hA (dyadic_annulus_cover hh N)).trans + (mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun j _ => hc j)) (by positivity)) + apply Real.sqrt_le_iff.mpr + refine ⟨by positivity [screenMass_pos 0 h],?_⟩ + apply HC.trans_eq + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_pow,Real.sq_sqrt hC] + ring + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/AnnularIMS.lean b/lean/OAI/Analysis/CoulombRadii/Packets/AnnularIMS.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b173cc0f39f2af12fe5473486ea64d0ac143f92 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/AnnularIMS.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.UniformCountConsequences +import OAI.Analysis.CoulombRadii.Localization.ShellIMS +import OAI.Analysis.CoulombRadii.Localization.AnnularCut + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff Topology +noncomputable section +namespace Coulomb + +def annularBand (u : ℝ) : Set Space := {x | u/2 ≤ ‖x‖ ∧ ‖x‖ ≤ 4*u} +lemma measurableSet_annularBand (u : ℝ) : MeasurableSet (annularBand u) := + ((isClosed_le continuous_const continuous_norm).inter (isClosed_le continuous_norm continuous_const)).measurableSet + +lemma annularAngle_zero {u : ℝ} (hu : 0 if l=0 then (0:ℝ) else 1) := by + have hnot : ¬ (u/2 ≤ ‖x‖ ∧ ‖x‖ ≤ 4*u) := hx + by_cases hi : ‖x‖ < u/2 + · have hn := (isOpen_lt continuous_norm continuous_const).mem_nhds hi + filter_upwards [hn] with z hz + simp only [annularCut,annularAngle_zero hu (Or.inl hz.le),Real.sin_zero,Real.cos_zero] + · have ho : 4*u < ‖x‖ := lt_of_not_ge (fun h => hnot ⟨le_of_not_gt hi,h⟩) + have hn := (isOpen_lt continuous_const continuous_norm).mem_nhds ho + filter_upwards [hn] with z hz + simp only [annularCut,annularAngle_zero hu (Or.inr hz.le),Real.sin_zero,Real.cos_zero] + rw [he.fderiv_eq] + simp + +lemma annularCut_gradient_band_bound {u : ℝ} (hu : 0 (1:ℝ)) x := by + by_cases hx : x∈annularBand u + · rw [indicator_of_mem hx,mul_one] + calc + _ ≤ ∑ _l : Fin 2, (3*radialCutCoefficient/u)^2 := by + apply Finset.sum_le_sum + intro l hl + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) (div_nonneg (mul_nonneg (by norm_num) radialCutCoefficient_pos.le) hu.le)).2 (annularCut_derivative_bound hu l b x) + _ = _ := by simp + · rw [indicator_of_notMem hx,mul_zero] + simp only [annularCut_derivative_zero hu _ hx,zero_apply,ne_eq,OfNat.ofNat_ne_zero, + not_false_eq_true,zero_pow,Finset.sum_const_zero,le_refl] + +theorem form_annular_labelCut {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + {u : ℝ} (hu : 0 (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := by + rw [←integral_const_mul] + apply integral_mono_of_nonneg + · filter_upwards [] with x + exact mul_nonneg (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) (sq_nonneg _) + · exact (hi s a.1).const_mul c + · filter_upwards [] with x + simpa only [c,mul_assoc] using mul_le_mul_of_nonneg_right + (annularCut_gradient_band_bound hu a.2 (position x a.1)) (sq_nonneg ‖ψ.value s x‖) + calc + _ ≤ (1/2:ℝ)*∑ s, ∑ a : Fin n × Fin 3, c*(∫ x, + (annularBand u).indicator (fun _ => (1:ℝ)) (position x a.1)*‖ψ.value s x‖^2) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun s _ => Finset.sum_le_sum (fun a _ => H s a))) (by norm_num) + _ = _ := by + simp only [Fintype.sum_prod_type,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul, + ←Finset.mul_sum,expectedPopulation,c] + ring + +def annularIMSCost {n : ℕ} (ψ : H1Vector n) (u : ℝ) : ℝ := + 3*(3*radialCutCoefficient/u)^2*expectedPopulation ψ (annularBand u) + +theorem exists_annular_recorded_ensemble {J n : ℕ} (S : Nuclei J) + (ψ : H1Vector n) (hψ : Antisymmetric ψ) {u : ℝ} (hu : 0 hz ⟨lt_of_not_ge hi,h⟩))) + (by + intro z hz + apply annularCut_core_zero hu + simpa only [mem_compl_iff,not_not,imsShell,mem_ofPred_eq,sub_zero] using hz) + refine ⟨T,hc,hf,ho,hcs,hos,hm,?_⟩ + rw [he] + exact form_annular_labelCut S ψ hu + +theorem exists_atomic_annular_IMS_bound : ∃ C : ℝ, 0≤C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E δ : ℝ}, (E:EReal)≤unrestrictedFormBottom S → form S ψ≤E+δ → 0≤δ → + ∀ {u : ℝ}, 0 linarith [hx.1,hx.2] + have hb := ((expectedPopulation_sq_le ψ (measurableSet_annularBand u) hm).trans + (localCountSecondMoment_mono ψ hA hsub)).trans (H S hatom ψ ha hm hE hstate hδ hu) + have hh : expectedPopulation ψ (annularBand u) ≤ Real.sqrt C*screenMass δ u := by + rw [←Real.sq_sqrt hC,←mul_pow] at hb + exact (sq_le_sq₀ (expectedPopulation_nonneg _ _) (mul_nonneg (Real.sqrt_nonneg C) (screenMass_pos _ _).le)).mp hb + calc + _ ≤ 3*(3*radialCutCoefficient/u)^2*(Real.sqrt C*screenMass δ u) := + mul_le_mul_of_nonneg_left hh (by positivity) + _ = _ := by ring + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/AtomicMesh.lean b/lean/OAI/Analysis/CoulombRadii/Packets/AtomicMesh.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d9de84e777a1756e2abd9daaa82efc4eca296a8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/AtomicMesh.lean @@ -0,0 +1,122 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def atomicCellScale (y : Space) : ℝ := ‖y‖/100000 + +lemma atomicCellScale_nonneg (y : Space) : 0 ≤ atomicCellScale y := div_nonneg (norm_nonneg _) (by norm_num) +lemma atomicCellScale_pos {y : Space} (hy : y≠0) : 0 < atomicCellScale y := div_pos (norm_pos_iff.mpr hy) (by norm_num) +lemma atomicCellScale_norm (y : Space) : 100000*atomicCellScale y=‖y‖ := by unfold atomicCellScale; ring + +lemma atomicCellScale_comparable {y z : Space} (h : ‖z-y‖ ≤ 82*atomicCellScale y) : + atomicCellScale y/2 ≤ atomicCellScale z ∧ atomicCellScale z ≤ 2*atomicCellScale y := by + have h1 : ‖z‖ ≤ ‖z-y‖+‖y‖ := by simpa only [sub_add_cancel] using norm_add_le (z-y) y + have h2 : ‖y‖ ≤ ‖z-y‖+‖z‖ := by + have h := norm_add_le (y-z) z + simpa only [sub_add_cancel,norm_sub_rev y z] using h + have hy := atomicCellScale_nonneg y + have he := atomicCellScale_norm y + have hz := atomicCellScale_norm z + constructor <;> linarith + +lemma atomicCellScale_near_nonzero {y z : Space} (hy : y≠0) + (h : ‖z-y‖ ≤ 82*atomicCellScale y) : z≠0 := by + have hp := atomicCellScale_pos hy + have H := (atomicCellScale_comparable h).1 + intro hz + subst z + have hzero : atomicCellScale (0:Space)=0 := by norm_num [atomicCellScale] + rw [hzero] at H + linarith + +lemma atomicCellScale_nucleus_far (y : Space) : 4*atomicCellScale y ≤ ‖(0:Space)-y‖ := by + rw [zero_sub,norm_neg] + have h := atomicCellScale_norm y + have hz := atomicCellScale_nonneg y + linarith + +lemma exists_atomic_patch_mesh : ∃ t : Finset Space, + (∀ z∈t, ‖z‖ ≤ 80) ∧ (∀ w : Space, ‖w‖ ≤ 80 → ∃ z∈t, ‖w-z‖ < 1/4) := by + let B := Metric.closedBall (0:Space) 80 + have hc : IsCompact B := isCompact_closedBall _ _ + have hcover : B ⊆ ⋃ z : B, Metric.ball z.val (1/4) := by + intro w hw + exact Set.mem_iUnion.mpr ⟨⟨w,hw⟩,by simp⟩ + obtain ⟨t,ht⟩ := hc.elim_finite_subcover (fun z : B => Metric.ball z.val (1/4)) + (fun _ => Metric.isOpen_ball) hcover + refine ⟨t.image Subtype.val,?_,?_⟩ + · intro z hz + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hz + simpa only [B,Metric.mem_closedBall,dist_zero_right] using v.property + · intro w hw + have hwB : w∈B := by simpa only [B,Metric.mem_closedBall,dist_zero_right] using hw + obtain ⟨z,hz⟩ := Set.mem_iUnion.mp (ht hwB) + obtain ⟨hzt,hzw⟩ := Set.mem_iUnion.mp hz + refine ⟨z.val,Finset.mem_image.mpr ⟨z,hzt,rfl⟩,?_⟩ + simpa only [Metric.mem_ball,dist_eq_norm] using hzw + +def atomicPatchMesh : Finset Space := Classical.choose exists_atomic_patch_mesh +lemma atomicPatchMesh_norm (z : Space) (hz : z∈atomicPatchMesh) : ‖z‖ ≤ 80 := + (Classical.choose_spec exists_atomic_patch_mesh).1 z hz +lemma atomicPatchMesh_covers (w : Space) (hw : ‖w‖ ≤ 80) : + ∃ z∈atomicPatchMesh, ‖w-z‖ < 1/4 := (Classical.choose_spec exists_atomic_patch_mesh).2 w hw + +def atomicMeshCenter (y z : Space) : Space := y+atomicCellScale y • z + +lemma atomicMeshCenter_distance (y z : Space) (hz : z∈atomicPatchMesh) : + ‖atomicMeshCenter y z-y‖ ≤ 80*atomicCellScale y := by + simp only [atomicMeshCenter,add_sub_cancel_left,norm_smul,Real.norm_eq_abs,abs_of_nonneg (atomicCellScale_nonneg y)] + nlinarith [atomicPatchMesh_norm z hz,atomicCellScale_nonneg y] + +lemma atomicMeshCenter_comparable (y z : Space) (hz : z∈atomicPatchMesh) : + atomicCellScale y/2 ≤ atomicCellScale (atomicMeshCenter y z) ∧ + atomicCellScale (atomicMeshCenter y z) ≤ 2*atomicCellScale y := + atomicCellScale_comparable (by nlinarith [atomicMeshCenter_distance y z hz,atomicCellScale_nonneg y]) + +theorem atomicMesh_cover {y : Space} (hy : y≠0) (w : Space) + (hw : ‖w-y‖ ≤ 80*atomicCellScale y) : + ∃ z∈atomicPatchMesh, ‖w-atomicMeshCenter y z‖ ≤ atomicCellScale (atomicMeshCenter y z) := by + let a := atomicCellScale y + have ha : 0 linarith + +theorem atomic_band_negative_oscillation {A M : ℝ} (hA : 0 ≤ A) (hM : 0 ≤ M) : + ∃ C : ℝ,0 < C ∧ ∀ (ρ : Position → ℝ) (Z r L lam : ℝ), + Integrable ρ → Measurable ρ → (∀ x,0 ≤ ρ x) → + (∃ B : ℝ,∀ x,ρ x ≤ B) → Continuous (potentialOf ρ) → + 0 < r → 1 ≤ L → 1 ≤ lam → + (∀ x,3*r/4 ≤ ‖x‖ → ‖x‖ ≤ 6*L*r → ρ x ≤ lam*(A/r^6)) → + (∀ x,3*r/4 ≤ ‖x‖ → ‖x‖ ≤ 6*L*r → + Z*coulombKernel x-potentialOf ρ x ≤ lam*(M/r^4)) → + ∀ y z : Position,r ≤ ‖y‖ → ‖y‖ ≤ 4*L*r → ‖z-y‖ ≤ r/16 → + ‖(Z*coulombKernel z-potentialOf ρ z)-(Z*coulombKernel y-potentialOf ρ y)‖ ≤ + C*(‖z-y‖/r)*(lam/r^4+max (-(Z*coulombKernel y-potentialOf ρ y)) 0) := by + obtain ⟨C,hC,H⟩ := poisson_amplitude_negative_oscillation hA hM + refine ⟨16^5*C,by positivity,?_⟩ + intro ρ Z r L lam hi hm hp hb hc hr hL hlam hd hcap y z hy0 hy1 hz + let F := fun x => Z*coulombKernel x-potentialOf ρ x + let a := r/16 + have ha : 0 < a := by dsimp [a]; positivity + have har : a ≤ r := by dsimp [a]; linarith + have hnear (x : Position) (hx : x∈Metric.closedBall y (3*a)) : + 3*r/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 6*L*r := + enlarged_band_near hr hL hy0 hy1 (by simpa only [Metric.mem_closedBall,dist_eq_norm] using hx) + have hnot (b : ℝ) (hb : b ≤ 3*a) : (0:Position) ∉ Metric.ball y b := by + intro h0 + have he := hnear 0 (Metric.mem_closedBall.mpr ((Metric.mem_ball.mp h0).le.trans hb)) + simp only [norm_zero] at he + linarith [he.1] + have hF : ContinuousOn F (Metric.ball y (3*a)) := + ((continuous_norm.continuousOn.inv₀ (fun x hx => norm_ne_zero_iff.mpr + (fun he => hnot (3*a) le_rfl (he ▸ hx)))).const_mul Z).sub hc.continuousOn + have hLap := atomic_screenedField_weakLaplacian hi hc Z (hnot (2*a) (by linarith)) + have hden (x) (hx : x∈Metric.closedBall y (3*a)) : ρ x ≤ lam*(A/a^6) := by + apply (hd x (hnear x hx).1 (hnear x hx).2).trans + apply mul_le_mul_of_nonneg_left _ (by linarith) + exact div_le_div_of_nonneg_left hA (pow_pos ha _) (pow_le_pow_left₀ ha.le har _) + have hbound (x) (hx : x∈Metric.closedBall y (2*a)) : F x ≤ lam*(M/a^4) := by + have hx' : x∈Metric.closedBall y (3*a) := Metric.closedBall_subset_closedBall (by linarith) hx + apply (hcap x (hnear x hx').1 (hnear x hx').2).trans + apply mul_le_mul_of_nonneg_left _ (by linarith) + exact div_le_div_of_nonneg_left hM (pow_pos ha _) (pow_le_pow_left₀ ha.le har _) + obtain ⟨B,hB⟩ := hb + have hmean := atomic_screened_ballCloud_submean hi hm hp hB Z (by linarith : 0 < 2*a) y + (by dsimp [a]; linarith : 2*a ≤ ‖y‖) + have HH := H F ρ y a lam ha (by linarith) hF hLap hi hp hden hbound hmean z + (by simpa only [Metric.mem_closedBall,dist_eq_norm] using hz) + apply HH.trans + have hNN : 0 ≤ max (-F y) 0 := le_max_right _ _ + have hn : 0 ≤ ‖z-y‖ := norm_nonneg _ + dsimp only [a,F] at hNN ⊢ + field_simp + norm_num + simp only [neg_sub] at hNN + nlinarith [mul_nonneg (mul_nonneg hn (pow_nonneg hr.le 4)) hNN] +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma packetKernel_fixed_amplitude {g : Position → ℝ} {B c r₀ s : ℝ} + (hB : 0 ≤ B) (hbound : ∀ z, |g z^2| ≤ B) + (hc : 0 < c) (hr : 0 < r₀) (hs : 0 < s) (x y : Position) : + |packetKernel g c r₀ s x y| ≤ B/(packetWidth c r₀ s x)^3 := by + have ht := packetWidth_pos hc hr hs x + unfold packetKernel + rw [abs_mul,abs_of_pos (by positivity : 0 < ((packetWidth c r₀ s x)^3)⁻¹)] + simpa only [div_eq_mul_inv,mul_comm] using + mul_le_mul (hbound ((packetWidth c r₀ s x)⁻¹ • (y-x))) le_rfl + (by positivity : 0 ≤ ((packetWidth c r₀ s x)^3)⁻¹) hB + +lemma packetKernel_fixed_lipschitz {g : Position → ℝ} {L c r₀ s : ℝ} + (hL : 0 ≤ L) (hlip : ∀ z v, |g z^2-g v^2| ≤ L*‖z-v‖) + (hc : 0 < c) (hr : 0 < r₀) (hs : 0 < s) (x y z : Position) : + |packetKernel g c r₀ s x y-packetKernel g c r₀ s x z| ≤ + (L/(packetWidth c r₀ s x)^4)*‖y-z‖ := by + let t := packetWidth c r₀ s x + have ht : 0 < t := packetWidth_pos hc hr hs x + change |(t^3)⁻¹*g (t⁻¹ • (y-x))^2-(t^3)⁻¹*g (t⁻¹ • (z-x))^2| ≤ _ + rw [←mul_sub,abs_mul,abs_of_pos (by positivity : 0 < (t^3)⁻¹)] + calc + _ ≤ (t^3)⁻¹*(L*‖t⁻¹ • (y-x)-t⁻¹ • (z-x)‖) := + by + simpa only [_root_.mul_comm] using + mul_le_mul (hlip (t⁻¹ • (y-x)) (t⁻¹ • (z-x))) (le_refl ((t^3)⁻¹)) + (by positivity) (mul_nonneg hL (norm_nonneg _)) + _ = (L/t^4)*‖y-z‖ := by + rw [←smul_sub,sub_sub_sub_cancel_right,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ht)] + field_simp + _ = _ := rfl + +theorem mixture_packet_band_bounds {n : ℕ} (ν : Measure (Configuration n)) + [IsProbabilityMeasure ν] {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) + {B L c r₀ s τ : ℝ} (hB : 0 ≤ B) (hL : 0 ≤ L) + (hbound : ∀ z, |g z^2| ≤ B) (hlip : ∀ z v, |g z^2-g v^2| ≤ L*‖z-v‖) + (hc : 0 < c) (hr : 0 < r₀) (hs : 0 < s) (hτ : 0 < τ) + {S T : Set Position} (hS : MeasurableSet S) + (hsp : ∀ y∈T,∀ x,packetKernel g c r₀ s x y ≠ 0 → x∈S) + (hw : ∀ x∈S,τ ≤ packetWidth c r₀ s x) : + (∀ y∈T,mixturePacketDensity ν g c r₀ s y ≤ + (B/τ^3)*(∫ x,rawCount S x ∂ν)) ∧ + (∀ y∈T,∀ z∈T,|mixturePacketDensity ν g c r₀ s y-mixturePacketDensity ν g c r₀ s z| ≤ + (L/τ^4)*‖y-z‖*(∫ x,rawCount S x ∂ν)) := by + have hcount : Integrable (rawCount (n:=n) S) ν := by + apply Integrable.of_bound (measurable_rawCount hS).aestronglyMeasurable (n:ℝ) + filter_upwards [] with x + rw [Real.norm_of_nonneg (rawCount_nonneg S x)] + exact rawCount_le_number S x + have hpoint (x y : Position) (hy : y∈T) : + packetKernel g c r₀ s x y ≤ (B/τ^3)*S.indicator (fun _ => (1:ℝ)) x := by + by_cases hx : x∈S + · rw [Set.indicator_of_mem hx,mul_one] + apply (le_abs_self _).trans + apply (packetKernel_fixed_amplitude hB hbound hc hr hs x y).trans + exact div_le_div_of_nonneg_left hB (pow_pos hτ 3) (pow_le_pow_left₀ hτ.le (hw x hx) 3) + · have hz : packetKernel g c r₀ s x y=0 := by by_contra hh; exact hx (hsp y hy x hh) + simp only [hz,Set.indicator_of_notMem hx,mul_zero,le_refl] + have hdiff (x y z : Position) (hy : y∈T) (hz : z∈T) : + |packetKernel g c r₀ s x y-packetKernel g c r₀ s x z| ≤ + ((L/τ^4)*‖y-z‖)*S.indicator (fun _ => (1:ℝ)) x := by + by_cases hx : x∈S + · rw [Set.indicator_of_mem hx,mul_one] + apply (packetKernel_fixed_lipschitz hL hlip hc hr hs x y z).trans + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + exact div_le_div_of_nonneg_left hL (pow_pos hτ 4) (pow_le_pow_left₀ hτ.le (hw x hx) 4) + · have hy0 : packetKernel g c r₀ s x y=0 := by by_contra hh; exact hx (hsp y hy x hh) + have hz0 : packetKernel g c r₀ s x z=0 := by by_contra hh; exact hx (hsp z hz x hh) + simp only [hy0,hz0,sub_self,abs_zero,Set.indicator_of_notMem hx,mul_zero,le_refl] + constructor + · intro y hy + have H := integral_mono (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν y) + (hcount.const_mul (B/τ^3)) (fun x => show rawPacketDensity g c r₀ s x y ≤ (B/τ^3)*rawCount S x from by + unfold rawPacketDensity rawCount + rw [Finset.mul_sum] + exact Finset.sum_le_sum (fun i _ => hpoint (x i) y hy)) + simpa only [mixturePacketDensity,integral_const_mul] using H + · intro y hy z hz + have hi := (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν y).sub + (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν z) + change |(∫ x,rawPacketDensity g c r₀ s x y ∂ν)-(∫ x,rawPacketDensity g c r₀ s x z ∂ν)| ≤ _ + rw [←integral_sub (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν y) + (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν z)] + apply (abs_integral_le_integral_abs).trans + have H := integral_mono hi.abs (hcount.const_mul ((L/τ^4)*‖y-z‖)) (fun x => show + |rawPacketDensity g c r₀ s x y-rawPacketDensity g c r₀ s x z| ≤ ((L/τ^4)*‖y-z‖)*rawCount S x from by + unfold rawPacketDensity rawCount + rw [←Finset.sum_sub_distrib,Finset.mul_sum] + exact (Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum (fun i _ => hdiff (x i) y z hy hz))) + simpa only [integral_const_mul,Pi.sub_apply] using H +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/ComplexWindow.lean b/lean/OAI/Analysis/CoulombRadii/Packets/ComplexWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..c941bd0172123a932260a15fcb1bb20fead5ae44 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/ComplexWindow.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.ModulatedRealDerivativeNorm +import OAI.Analysis.CoulombRadii.FormDomain.SchwartzFourierDerivativeNorm + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +namespace Coulomb +noncomputable def complexWindow (g : 𝓢(Space,ℝ)) : 𝓢(Space,ℂ) := + g.postcompCLM Complex.ofRealCLM +@[simp] lemma complexWindow_apply (g : 𝓢(Space,ℝ)) (x : Space) : + complexWindow g x = (g x : ℂ) := rfl + +lemma packetState_real_derivative_norm (g : 𝓢(Space,ℝ)) (y p x a : Space) : + ‖fderiv ℝ (packetState (complexWindow g) y p) x a‖^2 = + (2*Real.pi*inner ℝ a p)^2 * g (x-y)^2 + (fderiv ℝ g (x-y) a)^2 := by + have he : (packetState (complexWindow g) y p : Space → ℂ) = + fun z => Complex.exp ((2*Real.pi*inner ℝ z p : ℝ)*Complex.I) * (g (z-y) : ℂ) := by + ext z; rw [packetState_apply, complexWindow_apply] + rw [he] + exact modulated_real_derivative_norm g g.differentiable y p x a + +lemma real_schwartz_derivative_square_integrable (g : 𝓢(Space,ℝ)) (a : Space) : + Integrable (fun x : Space => (fderiv ℝ g x a)^2) := by + have h := ((∂_{a} g : 𝓢(Space,ℝ)).memLp 2 volume).integrable_norm_pow (by norm_num) + simpa only [SchwartzMap.lineDerivOp_apply_eq_fderiv, Real.norm_eq_abs, sq_abs] using h + +lemma packetState_real_kinetic_integral (g : 𝓢(Space,ℝ)) (y p a : Space) : + (∫ ξ : Space, (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (packetState (complexWindow g) y p) : 𝓢(Space,ℂ)) ξ‖^2) = + (2*Real.pi*inner ℝ a p)^2 * (∫ x : Space, g x^2) + + ∫ x : Space, (fderiv ℝ g x a)^2 := by + rw [schwartz_fourier_weighted_integral] + simp only [packetState_real_derivative_norm] + have hG : Integrable (fun x : Space => g x^2) := by + simpa only [Real.norm_eq_abs, sq_abs] using (g.memLp 2 volume).integrable_norm_pow (by norm_num) + have hD := real_schwartz_derivative_square_integrable g a + rw [integral_add ((hG.comp_sub_right y).const_mul _) (hD.comp_sub_right y), + integral_const_mul, integral_sub_right_eq_self (fun x : Space => g x^2) y, + integral_sub_right_eq_self (fun x : Space => (fderiv ℝ g x a)^2) y] + +lemma packetState_fourier_joint_square_integrable (g : 𝓢(Space,ℂ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + Integrable (fun z : (Space × Space) × Space => + ‖(𝓕 (packetState g z.1.1 z.1.2) : 𝓢(Space,ℂ)) z.2‖^2) (μ.prod volume) := by + have hm := (packetState_fourier_joint_continuous g).norm.pow 2 + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + refine ⟨Filter.Eventually.of_forall (fun yp => + ((𝓕 (packetState g yp.1 yp.2) : 𝓢(Space,ℂ)).memLp 2 volume).integrable_norm_pow (by norm_num)), ?_⟩ + have he (yp : Space × Space) : + (∫ ξ : Space, ‖(𝓕 (packetState g yp.1 yp.2) : 𝓢(Space,ℂ)) ξ‖^2) = + ∫ x : Space, ‖g x‖^2 := by + rw [← schwartz_toL2_norm_sq, SchwartzMap.norm_fourier_toL2_eq, schwartz_toL2_norm_sq, + packetState_integral_norm_sq] + change Integrable (fun yp : Space × Space => + ∫ ξ : Space, ‖‖(𝓕 (packetState g yp.1 yp.2) : 𝓢(Space,ℂ)) ξ‖^2‖) μ + simpa only [Real.norm_of_nonneg (sq_nonneg (_ : ℝ)), he] using + (integrable_const (∫ x : Space, ‖g x‖^2) : Integrable (fun _ : Space × Space => ∫ x : Space, ‖g x‖^2) μ) + +lemma packetState_real_weighted_joint_integrable (g : 𝓢(Space,ℝ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] + (hp : MemLp (fun yp : Space × Space => yp.2) 2 μ) (a : Space) : + Integrable (fun z : (Space × Space) × Space => (2*Real.pi*inner ℝ z.2 a)^2 * + ‖(𝓕 (packetState (complexWindow g) z.1.1 z.1.2) : 𝓢(Space,ℂ)) z.2‖^2) (μ.prod volume) := by + have hm : Continuous (fun z : (Space × Space) × Space => (2*Real.pi*inner ℝ z.2 a)^2 * + ‖(𝓕 (packetState (complexWindow g) z.1.1 z.1.2) : 𝓢(Space,ℂ)) z.2‖^2) := by + have hc : Continuous (fun z : (Space × Space) × Space => (2*Real.pi*inner ℝ z.2 a)^2) := by fun_prop + exact hc.mul ((packetState_fourier_joint_continuous _).norm.pow 2) + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + have hi (yp : Space × Space) : Integrable (fun ξ : Space => (2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (packetState (complexWindow g) yp.1 yp.2) : 𝓢(Space,ℂ)) ξ‖^2) := + schwartz_fourier_weighted_integrable (packetState (complexWindow g) yp.1 yp.2) a + refine ⟨Filter.Eventually.of_forall hi, ?_⟩ + change Integrable (fun yp : Space × Space => ∫ ξ : Space, ‖(2*Real.pi*inner ℝ ξ a)^2 * + ‖(𝓕 (packetState (complexWindow g) yp.1 yp.2) : 𝓢(Space,ℂ)) ξ‖^2‖) μ + simp only [Real.norm_of_nonneg (mul_nonneg (sq_nonneg (_ : ℝ)) (sq_nonneg (_ : ℝ))), + packetState_real_kinetic_integral] + have hpa := hp.continuousLinearMap_comp ((2*Real.pi) • (innerSL ℝ a)) + have hi : Integrable (fun yp : Space × Space => (2*Real.pi*inner ℝ a yp.2)^2) μ := by + simpa only [smul_apply, innerSL_apply_apply, smul_eq_mul, + Function.comp_apply, Real.norm_eq_abs, sq_abs] using hpa.integrable_norm_pow (by norm_num) + exact (hi.mul_const _).add (integrable_const _) +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/CoreScreenedFieldPacketIntegral.lean b/lean/OAI/Analysis/CoulombRadii/Packets/CoreScreenedFieldPacketIntegral.lean new file mode 100644 index 0000000000000000000000000000000000000000..a7fd0bc59f536716ac276b60fdc1017460fa084e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/CoreScreenedFieldPacketIntegral.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CoreScreenedField +import OAI.Analysis.CoulombRadii.Localization.DensityCut + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +namespace Coulomb + +lemma coreScreenedField_packet_integral {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) + (hi : Integrable ρ) : + (∫ x, coreScreenedField S u x*packetDensity g ρ x) = + (∫ x, attraction S x*packetDensity g ρ x) - + (∫ x, coreCoulombPotential u x*packetDensity g ρ x) := by + simp only [coreScreenedField,sub_mul] + exact integral_sub (packetDensity_nuclear_integrable S g ρ hp hm hi) + (coreCoulombPotential_mul_integrable u _ (packetDensity_integrable g ρ hp hm hi)) + +theorem packet_core_trial {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) + (ht : Integrable (fun y => ρ y^(5/3:ℝ))) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) + (hs : ∀ y, y ∉ K → ρ y = 0) (hsu : SpatiallySupported u A) + (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) + (ε : ℝ) (hε : 0 < ε) : + ∃ n : ℕ, ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ + form S ψ ≤ form S u + + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2) - + (∫ x, coreScreenedField S u x*packetDensity g ρ x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)* + (packetDensity g ρ xy.1*packetDensity g ρ xy.2)) + ε := by + have hconv := packetDensity_cut_weighted_tendsto g ρ hp hm hi (attraction S) + (attraction_nonneg S) (attraction_measurable S) (packetDensity_nuclear_integrable S g ρ hp hm hi) + have hevent : ∀ᶠ k : ℕ in atTop, + (∫ x, attraction S x*packetDensity g ρ x)-ε/2 < + ∫ x, attraction S x*packetDensity g (densityCut ρ k) x := + hconv (eventually_gt_nhds (sub_lt_self _ (half_pos hε))) + obtain ⟨k,hk⟩ := hevent.exists + let σ := densityCut ρ k + have hsp := densityCut_nonneg ρ hp k + have hsm := densityCut_measurable ρ hm k + have hsi := densityCut_integrable ρ hp hm hi k + have hst := densityCut_kinetic_integrable ρ hp hm ht k + obtain ⟨n,ψ,ha,hmu',he⟩ := bounded_packet_core_trial S u hu hmu g hg hgc σ hsp hsm hsi hst + (k:ℝ) (densityCut_bound ρ k) K A hK hA (densityCut_support ρ K hs k) hsu hsep (ε/2) (half_pos hε) + have hmass : (∫ y, σ y) ≤ ∫ y, ρ y := integral_mono hsi hi (densityCut_le ρ k) + have hkt : (∫ y, σ y^(5/3:ℝ)) ≤ ∫ y, ρ y^(5/3:ℝ) := + integral_mono hst ht (fun y => Real.rpow_le_rpow (hsp y) (densityCut_le ρ k y) (by norm_num)) + have hcf : 0 ≤ thomasFermiKineticConstant := by unfold thomasFermiKineticConstant; positivity + have hkin := mul_le_mul_of_nonneg_left hkt hcf + have hgrad : 0 ≤ ∑ b : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single b 1))^2 := + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => sq_nonneg _)) + have hmassgrad := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hmass (by norm_num : (0:ℝ) ≤ 1/2)) hgrad + have hdle := packetDensity_mono g σ ρ hsp hsm hsi hp hm hi (densityCut_le ρ k) + have hcore := integral_mono + (coreCoulombPotential_mul_integrable u _ (packetDensity_integrable g σ hsp hsm hsi)) + (coreCoulombPotential_mul_integrable u _ (packetDensity_integrable g ρ hp hm hi)) + (fun x => mul_le_mul_of_nonneg_left (hdle x) (coreCoulombPotential_nonneg u x)) + have hdirect := integral_mono (packetDensity_pair_integrable g σ hsp hsm hsi) + (packetDensity_pair_integrable g ρ hp hm hi) (fun xy => + mul_le_mul_of_nonneg_left (mul_le_mul (hdle xy.1) (hdle xy.2) + (packetDensity_nonneg g σ hsp _) (packetDensity_nonneg g ρ hp _)) (coulombKernel_nonneg _)) + rw [coreScreenedField_packet_integral S u g σ hsp hsm hsi] at he + refine ⟨n,ψ,ha,hmu',?_⟩ + rw [coreScreenedField_packet_integral S u g ρ hp hm hi] + change (∫ x, attraction S x*packetDensity g ρ x)-ε/2 < ∫ x, attraction S x*packetDensity g σ x at hk + linarith +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/CoulombKernel.lean b/lean/OAI/Analysis/CoulombRadii/Packets/CoulombKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..971415d39de9b0888fd8b3543d82fb971ebbdb5e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/CoulombKernel.lean @@ -0,0 +1,452 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.WeakLaplacian + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators ContDiff +namespace NeutralAtom +open scoped Convolution +open ContinuousLinearMap + +def coulombKernel (x : Position) : ℝ := ‖x‖⁻¹ + +def potentialOf (ρ : Position → ℝ) (x : Position) : ℝ := + ∫ y, coulombKernel (x-y)*ρ y + +def kernelBallMass (r : ℝ) : ℝ := ∫ y in Metric.ball (0 : Position) r, coulombKernel y + +theorem coulombKernel_nonneg (x : Position) : 0 ≤ coulombKernel x := + inv_nonneg.mpr (norm_nonneg x) + +theorem measurable_coulombKernel : Measurable coulombKernel := + measurable_norm.inv + +theorem coulombKernel_integrableOn_ball (r : ℝ) : + IntegrableOn coulombKernel (Metric.ball (0 : Position) r) := by + apply integrableOn_ball_of_norm_le_rpow + (by simp : 1 ≤ Module.finrank ℝ Position) + (C := 1) (α := 1) (by norm_num : (1:ℝ) < Module.finrank ℝ Position) + _ measurable_coulombKernel.aestronglyMeasurable + exact Filter.Eventually.of_forall (fun x => by + simp [coulombKernel, Real.rpow_neg_one]) + +theorem radial_integral_exterior (f : ℝ → ℝ) {a : ℝ} (ha : 0 ≤ a) : + (∫ x : Position in {x | a < ‖x‖}, f ‖x‖) = + (4*Real.pi) * ∫ r : ℝ in Set.Ioi a, r^2*f r := by + have hS : MeasurableSet {x : Position | a < ‖x‖} := + (isOpen_lt continuous_const continuous_norm).measurableSet + rw [← integral_indicator hS] + have hid : (fun x : Position => Set.indicator {x : Position | a < ‖x‖} (fun x => f ‖x‖) x) = + (fun x : Position => (Set.Ioi a).indicator f ‖x‖) := by + ext x + by_cases hx : a < ‖x‖ <;> simp [hx] + rw [hid, integral_fun_norm_addHaar volume] + have hinner : (∫ r in Set.Ioi (0:ℝ), r^(Module.finrank ℝ Position-1) • (Set.Ioi a).indicator f r) = + ∫ r in Set.Ioi a, r^2*f r := by + simp only [finrank_euclideanSpace_fin] + norm_num + have heq : (fun r : ℝ => r^2*(Set.Ioi a).indicator f r) = + (Set.Ioi a).indicator (fun r => r^2*f r) := by + ext r + by_cases hr : r ∈ Set.Ioi a <;> simp [hr] + rw [heq, setIntegral_indicator measurableSet_Ioi] + rw [Set.inter_eq_right.mpr (Set.Ioi_subset_Ioi ha)] + rw [hinner] + simp only [Measure.real, EuclideanSpace.volume_ball_fin_three, ENNReal.ofReal_one, one_pow, + one_mul, ENNReal.toReal_ofReal (by positivity : 0 ≤ Real.pi*4/3), smul_eq_mul, + nsmul_eq_mul] + norm_num [Position, finrank_euclideanSpace_fin] + ring + +theorem radial_integrable_exterior (f : ℝ → ℝ) {a : ℝ} (ha : 0 ≤ a) : + IntegrableOn (fun x : Position => f ‖x‖) {x | a < ‖x‖} ↔ + IntegrableOn (fun r : ℝ => r^2*f r) (Set.Ioi a) := by + have hS : MeasurableSet {x : Position | a < ‖x‖} := + (isOpen_lt continuous_const continuous_norm).measurableSet + rw [← integrable_indicator_iff hS] + change Integrable (fun x : Position => Set.indicator {x : Position | a < ‖x‖} (fun x => f ‖x‖) x) ↔ _ + have hid : (fun x : Position => Set.indicator {x : Position | a < ‖x‖} (fun x => f ‖x‖) x) = + (fun x : Position => (Set.Ioi a).indicator f ‖x‖) := by + ext x + by_cases hx : a < ‖x‖ <;> simp [hx] + rw [hid, integrable_fun_norm_addHaar volume] + simp only [finrank_euclideanSpace_fin] + norm_num + have heq : (fun r : ℝ => r^2*(Set.Ioi a).indicator f r) = + (Set.Ioi a).indicator (fun r => r^2*f r) := by + ext r + by_cases hr : r ∈ Set.Ioi a <;> simp [hr] + rw [heq, integrableOn_indicator_iff measurableSet_Ioi, + Set.inter_eq_left.mpr (Set.Ioi_subset_Ioi ha)] + +def regularizedKernel (ε : ℝ) (x : Position) : ℝ := + (‖x‖^2+ε^2)^(-1/2 : ℝ) + +def regularizedCharge (ε : ℝ) (x : Position) : ℝ := + 3*ε^2*(‖x‖^2+ε^2)^(-5/2 : ℝ) + +theorem contDiff_regularizedKernel {ε : ℝ} (hε : ε ≠ 0) : + ContDiff ℝ ∞ (regularizedKernel ε) := by + apply ContDiff.rpow_const_of_ne + · exact (contDiff_norm_sq ℝ).add contDiff_const + · intro x + exact (add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hε)).ne' + +theorem laplacian_regularizedKernel {ε : ℝ} (hε : ε ≠ 0) (x : Position) : + coordinateLaplacian (regularizedKernel ε) x = -regularizedCharge ε x := by + have hq : 0 < ‖x‖^2+ε^2 := add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_ne_zero hε) + have he : ∀ a : Fin 3, (fun t : ℝ => regularizedKernel ε (x+t • axis a)) = + (fun t => ((‖x‖^2+ε^2)+2*t*x a+t^2)^(-1/2 : ℝ)) := by + intro a + ext t + unfold regularizedKernel + rw [norm_sq_axis_shift] + congr 1 + ring + unfold coordinateLaplacian + simp_rw [he, second_deriv_quadratic_rpow hq] + norm_num + simp only [Finset.sum_add_distrib, Finset.sum_const, Finset.card_fin, nsmul_eq_mul] + have hpow : (‖x‖^2+ε^2)^(-5/2 : ℝ)*(‖x‖^2+ε^2) = + (‖x‖^2+ε^2)^(-3/2 : ℝ) := by + rw [← Real.rpow_add_one hq.ne'] + norm_num + calc + _ = 3*(‖x‖^2+ε^2)^(-5/2 : ℝ)*(∑ a : Fin 3, (x a)^2) - + 3*(‖x‖^2+ε^2)^(-3/2 : ℝ) := by + rw [Finset.mul_sum] + congr 1 + all_goals ring_nf + _ = _ := by + rw [← EuclideanSpace.real_norm_sq_eq] + unfold regularizedCharge + rw [← hpow] + ring + +def chargePrimitive (r : ℝ) : ℝ := r^3*(1+r^2)^(-3/2 : ℝ) + +theorem hasDerivAt_chargePrimitive (r : ℝ) : + HasDerivAt chargePrimitive (3*r^2*(1+r^2)^(-5/2 : ℝ)) r := by + have hp : 0 < 1+r^2 := by positivity + have hd := ((hasDerivAt_id r).pow 3).mul + (((hasDerivAt_const r 1).add ((hasDerivAt_id r).pow 2)).rpow_const + (p := (-3/2 : ℝ)) (Or.inl hp.ne')) + unfold chargePrimitive + apply hd.congr_deriv + norm_num + have he : (1+r^2)^(-5/2 : ℝ)*(1+r^2) = (1+r^2)^(-3/2 : ℝ) := by + rw [← Real.rpow_add_one hp.ne']; norm_num + norm_num at he + rw [← he] + ring + +theorem chargePrimitive_eq_ratio {r : ℝ} (hr : 0 ≤ r) : + chargePrimitive r = (1-(1+r^2)⁻¹)^(3/2 : ℝ) := by + have hp : 0 < 1+r^2 := by positivity + have hh : 1-(1+r^2)⁻¹ = r^2/(1+r^2) := by field_simp; ring + rw [hh, Real.div_rpow (sq_nonneg _) hp.le] + have hn : (r^2)^(3/2 : ℝ) = r^3 := by + rw [← Real.rpow_natCast_mul hr] + norm_num + rw [hn] + unfold chargePrimitive + rw [show (-3/2:ℝ) = -(3/2:ℝ) by ring, Real.rpow_neg hp.le] + rfl + +theorem tendsto_chargePrimitive : Tendsto chargePrimitive atTop (𝓝 1) := by + have hp : Tendsto (fun r : ℝ => 1+r^2) atTop atTop := + tendsto_atTop_add_const_left _ 1 (tendsto_pow_atTop (by norm_num : (2:ℕ) ≠ 0)) + have hi := tendsto_inv_atTop_zero.comp hp + have hh := (tendsto_const_nhds.sub hi).rpow tendsto_const_nhds + (Or.inl (by norm_num : (1:ℝ)-0 ≠ 0) : (1:ℝ)-0 ≠ 0 ∨ 0 < (3/2:ℝ)) + apply Filter.Tendsto.congr' _ (by simpa using hh) + filter_upwards [eventually_ge_atTop (0:ℝ)] with r hr + exact (chargePrimitive_eq_ratio hr).symm + +theorem integrable_radial_regularizedCharge_one : + IntegrableOn (fun r : ℝ => 3*r^2*(1+r^2)^(-5/2 : ℝ)) (Set.Ioi 0) := by + exact integrableOn_Ioi_deriv_of_nonneg' (fun r _ => hasDerivAt_chargePrimitive r) + (fun r _ => by positivity) tendsto_chargePrimitive + +theorem integral_radial_regularizedCharge_one : + (∫ r : ℝ in Set.Ioi 0, 3*r^2*(1+r^2)^(-5/2 : ℝ)) = 1 := by + have hder := integral_Ioi_of_hasDerivAt_of_nonneg' + (a := (0:ℝ)) (fun r _ => hasDerivAt_chargePrimitive r) + (fun r _ => by positivity : ∀ r ∈ Set.Ioi (0:ℝ), 0 ≤ 3*r^2*(1+r^2)^(-5/2 : ℝ)) + tendsto_chargePrimitive + simpa [chargePrimitive] using hder + +theorem regularizedCharge_one_eq : regularizedCharge 1 = + fun x : Position => 3*(1+‖x‖^2)^(-5/2 : ℝ) := by + ext x + simp [regularizedCharge, add_comm] + +theorem integrable_regularizedCharge_one : Integrable (regularizedCharge 1) := by + rw [regularizedCharge_one_eq, integrable_fun_norm_addHaar volume + (f := fun r : ℝ => 3*(1+r^2)^(-5/2:ℝ))] + simpa [finrank_euclideanSpace_fin, smul_eq_mul, mul_comm, mul_assoc, + mul_left_comm] using integrable_radial_regularizedCharge_one + +theorem integral_regularizedCharge_one : (∫ x, regularizedCharge 1 x) = 4*Real.pi := by + rw [regularizedCharge_one_eq, integral_fun_norm_addHaar volume + (fun r : ℝ => 3*(1+r^2)^(-5/2:ℝ))] + simp only [finrank_euclideanSpace_fin, smul_eq_mul, nsmul_eq_mul] + norm_num + have hi : (∫ r : ℝ in Set.Ioi 0, r^2*(3*(1+r^2)^(-(5/2): ℝ))) = 1 := by + simpa only [neg_div, mul_assoc, mul_comm, mul_left_comm] using + integral_radial_regularizedCharge_one + rw [hi] + simp only [Measure.real, EuclideanSpace.volume_ball_fin_three, ENNReal.ofReal_one, + one_pow, one_mul, ENNReal.toReal_ofReal (by positivity : 0 ≤ Real.pi*4/3)] + ring + +theorem regularizedCharge_smul {ε : ℝ} (hε : 0 < ε) (x : Position) : + regularizedCharge ε (ε • x) = (ε^3)⁻¹*regularizedCharge 1 x := by + unfold regularizedCharge + rw [norm_smul, Real.norm_eq_abs, abs_of_pos hε] + have he : (ε*‖x‖)^2+ε^2 = ε^2*(‖x‖^2+1) := by ring + rw [he, Real.mul_rpow (sq_nonneg _) (by positivity)] + have hp : (ε^2)^(-5/2:ℝ) = (ε^5)⁻¹ := by + rw [← Real.rpow_natCast_mul hε.le] + norm_num [Real.rpow_neg hε.le] + rw [hp] + norm_num + field_simp + +theorem integral_regularizedCharge_scale {ε : ℝ} (hε : 0 < ε) (φ : Position → ℝ) : + (∫ x, regularizedCharge ε x*φ x) = ∫ x, regularizedCharge 1 x*φ (ε • x) := by + have hs := Measure.integral_comp_smul_of_nonneg volume + (fun x => regularizedCharge ε x*φ x) ε (hR := hε.le) + simp only [finrank_euclideanSpace_fin, smul_eq_mul] at hs + have ht : (∫ x, regularizedCharge ε (ε • x)*φ (ε • x)) = + (ε^3)⁻¹*(∫ x, regularizedCharge 1 x*φ (ε • x)) := by + simp_rw [regularizedCharge_smul hε, mul_assoc] + exact integral_const_mul _ _ + rw [ht] at hs + exact (mul_left_cancel₀ (inv_ne_zero (pow_ne_zero _ hε.ne')) hs).symm + +theorem regularizedCharge_nonneg (ε : ℝ) (x : Position) : + 0 ≤ regularizedCharge ε x := by unfold regularizedCharge; positivity + +theorem continuous_regularizedCharge_one : Continuous (regularizedCharge 1) := by + rw [regularizedCharge_one_eq] + apply Continuous.const_mul + apply Continuous.rpow_const + · fun_prop + · intro x + left + positivity + +theorem regularizedCharge_tendsto_dirac {ε : ℕ → ℝ} + (hε : ∀ n, 0 < ε n) (hlim : Tendsto ε atTop (𝓝 0)) + {φ : Position → ℝ} (hφ : Continuous φ) (hφc : HasCompactSupport φ) : + Tendsto (fun n => ∫ x, regularizedCharge (ε n) x*φ x) + atTop (𝓝 (4*Real.pi*φ 0)) := by + obtain ⟨C, hC⟩ := hφ.bounded_above_of_compact_support hφc + have hD := tendsto_integral_of_dominated_convergence + (μ := (volume : Measure Position)) (fun x => regularizedCharge 1 x*C) + (F := fun n x => regularizedCharge 1 x*φ (ε n • x)) + (f := fun x => regularizedCharge 1 x*φ 0) + (fun n => (continuous_regularizedCharge_one.mul + (hφ.comp (show Continuous (fun x : Position => ε n • x) by fun_prop))).aestronglyMeasurable) + (integrable_regularizedCharge_one.mul_const C) + (fun n => Filter.Eventually.of_forall (fun x => by + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (regularizedCharge_nonneg 1 x)] + exact mul_le_mul_of_nonneg_left (hC _) (regularizedCharge_nonneg 1 x))) + (Filter.Eventually.of_forall (fun x => by + have he : Tendsto (fun n => ε n • x) atTop (𝓝 (0 : Position)) := by + simpa using hlim.smul_const x + exact tendsto_const_nhds.mul (hφ.continuousAt.tendsto.comp he))) + simp only [integral_mul_const, integral_regularizedCharge_one] at hD + simpa only [integral_regularizedCharge_scale (hε _)] using hD + +theorem locallyIntegrable_coulombKernel : LocallyIntegrable coulombKernel volume := by + intro x + refine ⟨Metric.ball 0 (‖x‖+1), IsOpen.mem_nhds Metric.isOpen_ball ?_, + coulombKernel_integrableOn_ball _⟩ + simpa only [Metric.mem_ball, dist_zero_right] using lt_add_one ‖x‖ + +theorem coulombKernel_eq_rpow (x : Position) : + coulombKernel x = (‖x‖^2)^(-1/2 : ℝ) := by + rw [← Real.rpow_natCast_mul (norm_nonneg x)] + norm_num [coulombKernel, Real.rpow_neg_one] + +theorem regularizedKernel_le {ε : ℝ} {x : Position} (hx : x ≠ 0) : + regularizedKernel ε x ≤ coulombKernel x := by + rw [coulombKernel_eq_rpow] + exact Real.rpow_le_rpow_of_nonpos (sq_pos_of_pos (norm_pos_iff.mpr hx)) + (le_add_of_nonneg_right (sq_nonneg ε)) (by norm_num) + +theorem regularizedKernel_nonneg (ε : ℝ) (x : Position) : + 0 ≤ regularizedKernel ε x := by unfold regularizedKernel; positivity + +theorem regularizedKernel_tendsto {ε : ℕ → ℝ} (hlim : Tendsto ε atTop (𝓝 0)) + {x : Position} (hx : x ≠ 0) : + Tendsto (fun n => regularizedKernel (ε n) x) atTop (𝓝 (coulombKernel x)) := by + have hh : Tendsto (fun n => ‖x‖^2+(ε n)^2) atTop (𝓝 (‖x‖^2)) := by + simpa using tendsto_const_nhds.add (hlim.pow 2) + have hr := hh.rpow tendsto_const_nhds + (Or.inl (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)) : ‖x‖^2 ≠ 0 ∨ 0 < (-1/2:ℝ)) + simpa only [regularizedKernel, coulombKernel_eq_rpow] using hr + +theorem regularizedKernel_integral_tendsto {ε : ℕ → ℝ} + (hε : ∀ n, 0 < ε n) (hlim : Tendsto ε atTop (𝓝 0)) + {φ : Position → ℝ} (hφ : Continuous φ) (hφc : HasCompactSupport φ) : + Tendsto (fun n => ∫ x, regularizedKernel (ε n) x*φ x) + atTop (𝓝 (∫ x, coulombKernel x*φ x)) := by + have hae : ∀ᵐ x : Position ∂volume, x ≠ 0 := volume.ae_ne 0 + have hb : Integrable (fun x => coulombKernel x*‖φ x‖) := by + simpa only [smul_eq_mul] using + locallyIntegrable_coulombKernel.integrable_smul_right_of_hasCompactSupport hφ.norm hφc.norm + apply tendsto_integral_of_dominated_convergence (fun x => coulombKernel x*‖φ x‖) + · intro n + exact ((contDiff_regularizedKernel (hε n).ne').continuous.mul hφ).aestronglyMeasurable + · exact hb + · intro n + filter_upwards [hae] with x hx + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (regularizedKernel_nonneg _ _)] + exact mul_le_mul_of_nonneg_right (regularizedKernel_le hx) (norm_nonneg _) + · filter_upwards [hae] with x hx + exact (regularizedKernel_tendsto hlim hx).mul_const (φ x) + +theorem integral_coulombKernel_laplacian {φ : Position → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hφc : HasCompactSupport φ) : + (∫ x, coulombKernel x*coordinateLaplacian φ x) = -(4*Real.pi*φ 0) := by + let ε : ℕ → ℝ := fun n => ((n:ℝ)+1)⁻¹ + have hε : ∀ n, 0 < ε n := fun n => by dsimp [ε]; positivity + have hεlim : Tendsto ε atTop (𝓝 0) := by + exact tendsto_inv_atTop_zero.comp + (tendsto_atTop_add_const_right _ 1 tendsto_natCast_atTop_atTop) + have hleft := regularizedKernel_integral_tendsto hε hεlim + (continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top))) + (hasCompactSupport_coordinateLaplacian hφc) + have hright := (regularizedCharge_tendsto_dirac hε hεlim hφ.continuous hφc).neg + have he : (fun n => ∫ x, regularizedKernel (ε n) x*coordinateLaplacian φ x) = + (fun n => -(∫ x, regularizedCharge (ε n) x*φ x)) := by + funext n + rw [integral_mul_coordinateLaplacian_eq + (fun x _ => ((contDiff_regularizedKernel (hε n).ne').of_le + (by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt) hφ hφc] + simp_rw [laplacian_regularizedKernel (hε n).ne', neg_mul, integral_neg] + rw [he] at hleft + exact tendsto_nhds_unique hleft hright + +theorem integrable_coulomb_test_product {ρ φ : Position → ℝ} + (hρ : Integrable ρ) (hφ : Continuous φ) (hφc : HasCompactSupport φ) : + Integrable (fun z : Position × Position => coulombKernel (z.1-z.2)*ρ z.2*φ z.1) + (volume.prod volume) := by + let k : Position → ℝ := (Metric.ball 0 1).indicator coulombKernel + have hk : Integrable k := + (coulombKernel_integrableOn_ball 1).integrable_indicator measurableSet_ball + obtain ⟨C, hC⟩ := hφ.bounded_above_of_compact_support hφc + have hn : Integrable (fun z : Position × Position => ‖ρ z.2‖*k (z.1-z.2)) + (volume.prod volume) := by + simpa using hρ.norm.convolution_integrand (ContinuousLinearMap.lsmul ℝ ℝ) hk + have hf : Integrable (fun z : Position × Position => ‖φ z.1‖*‖ρ z.2‖) + (volume.prod volume) := hφ.integrable_of_hasCompactSupport hφc |>.norm.mul_prod hρ.norm + have hm : AEStronglyMeasurable + (fun z : Position × Position => coulombKernel (z.1-z.2)*ρ z.2*φ z.1) + (volume.prod volume) := by + have hh := hρ.aestronglyMeasurable.convolution_integrand + (ContinuousLinearMap.lsmul ℝ ℝ) (μ := volume) measurable_coulombKernel.aestronglyMeasurable + have hh' : AEStronglyMeasurable + (fun z : Position × Position => ρ z.2*coulombKernel (z.1-z.2)*φ z.1) + (volume.prod volume) := hh.mul hφ.aestronglyMeasurable.comp_fst + convert hh' using 1 + ext z + ring + refine Integrable.mono' ((hn.const_mul C).add hf) hm (Filter.Eventually.of_forall ?_) + intro z + have hK : coulombKernel (z.1-z.2) ≤ k (z.1-z.2)+1 := by + by_cases hz : z.1-z.2 ∈ Metric.ball (0 : Position) 1 + · simp only [k, Set.indicator_of_mem hz] + linarith + · have hl : 1 ≤ ‖z.1-z.2‖ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using hz + have hh : ‖z.1-z.2‖⁻¹ ≤ (1:ℝ) := by simpa using inv_anti₀ (by norm_num : (0:ℝ)<1) hl + simpa only [k, Set.indicator_of_notMem hz, zero_add, coulombKernel] using hh + have hkpos : 0 ≤ k (z.1-z.2) := Set.indicator_nonneg (fun x _ => coulombKernel_nonneg x) _ + rw [norm_mul, norm_mul, Real.norm_eq_abs, abs_of_nonneg (coulombKernel_nonneg _)] + calc + coulombKernel (z.1-z.2)*‖ρ z.2‖*‖φ z.1‖ ≤ + (k (z.1-z.2)+1)*‖ρ z.2‖*‖φ z.1‖ := by gcongr + _ = ‖ρ z.2‖*k (z.1-z.2)*‖φ z.1‖+‖φ z.1‖*‖ρ z.2‖ := by ring + _ ≤ C*(‖ρ z.2‖*k (z.1-z.2))+‖φ z.1‖*‖ρ z.2‖ := by + nlinarith [mul_nonneg (norm_nonneg (ρ z.2)) hkpos, + mul_le_mul_of_nonneg_left (hC z.1) (mul_nonneg (norm_nonneg (ρ z.2)) hkpos)] + +theorem coordinateLaplacian_translate (φ : Position → ℝ) (x y : Position) : + coordinateLaplacian (fun z => φ (z+y)) x = coordinateLaplacian φ (x+y) := by + unfold coordinateLaplacian + simp only [add_right_comm _ _ y] + +theorem integral_translated_coulombKernel_laplacian {φ : Position → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hφc : HasCompactSupport φ) (y : Position) : + (∫ x, coulombKernel (x-y)*coordinateLaplacian φ x) = -(4*Real.pi*φ y) := by + have ht : ContDiff ℝ ∞ (fun z => φ (z+y)) := hφ.comp (contDiff_id.add contDiff_const) + have hc : HasCompactSupport (fun z => φ (z+y)) := + hφc.comp_homeomorph (Homeomorph.addRight y) + have he := integral_coulombKernel_laplacian ht hc + simp only [coordinateLaplacian_translate, zero_add] at he + rw [← integral_add_right_eq_self (fun x => coulombKernel (x-y)*coordinateLaplacian φ x) y] + simpa only [add_sub_cancel_right] using he + +theorem potentialOf_weakLaplacian {ρ : Position → ℝ} (hρ : Integrable ρ) : + HasWeakLaplacian (potentialOf ρ) Set.univ (fun x => -(4*Real.pi)*ρ x) := by + intro φ hφ hφc _ + have hL : Continuous (coordinateLaplacian φ) := + continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + calc + (∫ x, potentialOf ρ x*coordinateLaplacian φ x) = + ∫ x, ∫ y, coulombKernel (x-y)*ρ y*coordinateLaplacian φ x := by + simp only [potentialOf, integral_mul_const] + _ = ∫ y, ∫ x, coulombKernel (x-y)*ρ y*coordinateLaplacian φ x := + integral_integral_swap (integrable_coulomb_test_product hρ hL + (hasCompactSupport_coordinateLaplacian hφc)) + _ = ∫ y, (-(4*Real.pi)*ρ y)*φ y := by + apply integral_congr_ae + filter_upwards [] with y + calc + (∫ x, coulombKernel (x-y)*ρ y*coordinateLaplacian φ x) = + (∫ x, coulombKernel (x-y)*coordinateLaplacian φ x)*ρ y := by + simp only [mul_right_comm _ (ρ y), integral_mul_const] + _ = _ := by rw [integral_translated_coulombKernel_laplacian hφ hφc]; ring + +theorem bounded_density_convolution {k ρ : Position → ℝ} {A : ℝ} + (hk : Measurable k) (hkpos : ∀ x, 0 ≤ k x) + (hki : IntegrableOn k (Metric.ball 0 1)) + (hkfar : ∀ x, 1 ≤ ‖x‖ → k x ≤ 1) + (hρ : Integrable ρ) (hρpos : ∀ x, 0 ≤ ρ x) (hA : ∀ x, ρ x ≤ A) (x : Position) : + Integrable (fun y => k (x-y)*ρ y) ∧ + (∫ y, k (x-y)*ρ y) ≤ A*(∫ y in Metric.ball 0 1, k y)+(∫ y, ρ y) := by + let kn := (Metric.ball (0 : Position) 1).indicator k + have hi : Integrable (fun y => kn (x-y)) := + (integrable_comp_sub_left kn x).mpr (hki.integrable_indicator measurableSet_ball) + have hb : Integrable (fun y => A*kn (x-y)+ρ y) := (hi.const_mul A).add hρ + have hd : ∀ y, k (x-y)*ρ y ≤ A*kn (x-y)+ρ y := by + intro y + by_cases hy : x-y ∈ Metric.ball (0 : Position) 1 + · simp only [kn, Set.indicator_of_mem hy] + nlinarith [mul_le_mul_of_nonneg_left (hA y) (hkpos (x-y)), hρpos y] + · simp only [kn, Set.indicator_of_notMem hy, mul_zero, zero_add] + have hh : 1 ≤ ‖x-y‖ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using hy + simpa using mul_le_mul_of_nonneg_right (hkfar _ hh) (hρpos y) + have hm : AEStronglyMeasurable (fun y => k (x-y)*ρ y) volume := + (hk.comp (measurable_const.sub measurable_id)).aestronglyMeasurable.mul hρ.aestronglyMeasurable + have hp : Integrable (fun y => k (x-y)*ρ y) := + hb.mono' hm (Filter.Eventually.of_forall (fun y => by + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hkpos _) (hρpos _))] + exact hd y)) + refine ⟨hp, (integral_mono hp hb hd).trans_eq ?_⟩ + rw [integral_add (hi.const_mul A) hρ, integral_const_mul, integral_sub_left_eq_self] + rw [integral_indicator measurableSet_ball] + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/CoulombKernelFiveHalvesIntegrable.lean b/lean/OAI/Analysis/CoulombRadii/Packets/CoulombKernelFiveHalvesIntegrable.lean new file mode 100644 index 0000000000000000000000000000000000000000..193eeb8e6f9265333ecdce6aacb253f5258c8715 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/CoulombKernelFiveHalvesIntegrable.lean @@ -0,0 +1,169 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.TruncatedCoulomb + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma coulombKernel_fiveHalves_integrableOn (R : ℝ) : + IntegrableOn (fun x : Space => coulombKernel x ^ (5/2:ℝ)) (Metric.ball 0 R) := by + apply integrableOn_ball_of_norm_le_rpow (C := 1) (α := 5/2) (by simp) (by norm_num) + · exact ae_of_all _ (fun x => by + rw [Real.norm_of_nonneg (Real.rpow_nonneg (coulombKernel_nonneg x) _)] + simp [coulombKernel, Real.rpow_neg_eq_inv_rpow]) + · exact (coulombKernel_measurable.pow_const _).aestronglyMeasurable + +lemma truncatedCoulomb_memLp (R : ℝ) : + MemLp (truncatedCoulomb R) (ENNReal.ofReal (5/2:ℝ)) volume := by + apply (integrable_norm_rpow_iff + (coulombKernel_measurable.indicator measurableSet_ball).aestronglyMeasurable + (by norm_num) (by simp)).mp + have H := (coulombKernel_fiveHalves_integrableOn R).integrable_indicator measurableSet_ball + apply H.congr + filter_upwards [] with x + by_cases hx : x ∈ Metric.ball (0:Space) R + · simp [hx, Real.norm_of_nonneg (coulombKernel_nonneg x), ENNReal.toReal_ofReal (by norm_num : (0:ℝ)≤5/2)] + · simp [hx, ENNReal.toReal_ofReal (by norm_num : (0:ℝ)≤5/2)] + +lemma truncatedCoulomb_fiveHalves_integral {R : ℝ} (hR : 0 ≤ R) : + (∫ x : Space, ‖truncatedCoulomb R x‖ ^ (5/2:ℝ)) = + 8*Real.pi*R^(1/2:ℝ) := by + have he (x : Space) : ‖truncatedCoulomb R x‖ ^ (5/2:ℝ) = + if ‖x‖ < R then ‖x‖ ^ (-(5/2:ℝ)) else 0 := by + by_cases hx : ‖x‖ < R + · simp [truncatedCoulomb, Metric.mem_ball, dist_zero_right, hx, coulombKernel, + ← Real.rpow_neg_eq_inv_rpow] + · simp [truncatedCoulomb, Metric.mem_ball, dist_zero_right, hx] + simp_rw [he] + rw [integral_fun_norm_addHaar (volume : Measure Space) + (fun t : ℝ => if t < R then t ^ (-(5/2:ℝ)) else 0)] + have hball : volume.real (Metric.ball (0 : Space) 1) = 4 * Real.pi / 3 := by + rw [Measure.real, EuclideanSpace.volume_ball_fin_three] + norm_num + rw [ENNReal.toReal_ofReal (by positivity)] + ring + have hdim : Module.finrank ℝ Space = 3 := by simp [Space] + simp only [hdim, hball, nsmul_eq_mul, smul_eq_mul] + have hint : (∫ t in Ioi (0:ℝ), t^(3-1) * (if t < R then t^(-(5/2:ℝ)) else 0)) = + ∫ t in Ioo 0 R, t^(-(1/2:ℝ)) := by + calc + _ = ∫ t in Ioi (0:ℝ), (Iio R).indicator (fun u : ℝ => u^(-(1/2:ℝ))) t := by + apply setIntegral_congr_fun measurableSet_Ioi + intro t ht + change 0 < t at ht + by_cases h : t < R + · simp only [h, ite_true, Set.indicator, mem_Iio] + rw [show (3:ℕ)-1=2 by norm_num, ← Real.rpow_natCast, ← Real.rpow_add ht] + norm_num + · simp [Set.indicator, h] + _ = _ := by rw [integral_indicator measurableSet_Iio, + Measure.restrict_restrict measurableSet_Iio, inter_comm, Ioi_inter_Iio] + rw [hint, setIntegral_congr_set Ioo_ae_eq_Ioc, ← intervalIntegral.integral_of_le hR, + integral_rpow (Or.inl (by norm_num : (-1:ℝ)< -(1/2:ℝ)))] + norm_num + ring + +lemma coulomb_holder_exponents : (5/2:ℝ).HolderConjugate (5/3:ℝ) := by + constructor <;> norm_num + +lemma truncatedCoulomb_mul_integrable {f : Space → ℝ} + (hf : MemLp f (ENNReal.ofReal (5/3:ℝ)) volume) (R : ℝ) (x : Space) : + Integrable (fun y => truncatedCoulomb R (x-y)*f y) := by + have hk := (truncatedCoulomb_memLp R).comp_measurePreserving + (volume.measurePreserving_sub_left x) + have : ENNReal.HolderConjugate (ENNReal.ofReal (5/2:ℝ)) + (ENNReal.ofReal (5/3:ℝ)) := by + exact coulomb_holder_exponents.ennrealOfReal + exact hk.integrable_mul hf + +lemma coulomb_near_holder {f : Space → ℝ} + (hf : MemLp f (ENNReal.ofReal (5/3:ℝ)) volume) {R : ℝ} (hR : 0 ≤ R) (x : Space) : + (∫ y, truncatedCoulomb R (x-y)*‖f y‖) ≤ + (8*Real.pi*R^(1/2:ℝ))^(2/5:ℝ) * (∫ y, ‖f y‖^(5/3:ℝ))^(3/5:ℝ) := by + have hk := (truncatedCoulomb_memLp R).comp_measurePreserving + (volume.measurePreserving_sub_left x) + have H := integral_mul_norm_le_Lp_mul_Lq coulomb_holder_exponents hk hf + simp only [Function.comp_apply] at H + rw [integral_sub_left_eq_self (fun z : Space => ‖truncatedCoulomb R z‖^(5/2:ℝ)) volume x, + truncatedCoulomb_fiveHalves_integral hR] at H + simpa only [Real.norm_of_nonneg (truncatedCoulomb_nonneg ..), + show (1:ℝ)/(5/2)=2/5 by norm_num, show (1:ℝ)/(5/3)=3/5 by norm_num] using H +lemma coulomb_lp_integrand_bound {R : ℝ} (hR : 0 < R) (x y : Space) : + coulombKernel (x-y) ≤ truncatedCoulomb R (x-y)+R⁻¹ := by + by_cases h : x-y ∈ Metric.ball (0:Space) R + · rw [truncatedCoulomb, Set.indicator_of_mem h] + exact le_add_of_nonneg_right (inv_nonneg.mpr hR.le) + · rw [truncatedCoulomb, Set.indicator_of_notMem h, zero_add] + have hn : R ≤ ‖x-y‖ := by simpa [Metric.mem_ball, dist_zero_right] using h + exact inv_anti₀ hR hn + +lemma coulomb_lp_convolution_integrable {f : Space → ℝ} (hf : Integrable f) + (hfm : Measurable f) (hfp : MemLp f (ENNReal.ofReal (5/3:ℝ)) volume) (x : Space) : + Integrable (fun y => coulombKernel (x-y)*f y) := by + have hi := (truncatedCoulomb_mul_integrable hfp.norm 1 x).add hf.norm + apply hi.mono' + ((coulombKernel_measurable.comp (measurable_const.sub measurable_id)).mul hfm).aestronglyMeasurable + filter_upwards [] with y + change ‖coulombKernel (x-y)*f y‖ ≤ truncatedCoulomb 1 (x-y)*‖f y‖+‖f y‖ + rw [norm_mul, Real.norm_of_nonneg (coulombKernel_nonneg _)] + calc + _ ≤ (truncatedCoulomb 1 (x-y)+1)*‖f y‖ := + mul_le_mul_of_nonneg_right (by simpa using coulomb_lp_integrand_bound (by norm_num : (0:ℝ)<1) x y) + (norm_nonneg _) + _ = _ := by ring + +lemma coulomb_lp_convolution_bound {f : Space → ℝ} (hf : Integrable f) + (hfm : Measurable f) (hfp : MemLp f (ENNReal.ofReal (5/3:ℝ)) volume) + {R : ℝ} (hR : 0 < R) (x : Space) : + (∫ y, coulombKernel (x-y)*‖f y‖) ≤ + (8*Real.pi*R^(1/2:ℝ))^(2/5:ℝ)*(∫ y, ‖f y‖^(5/3:ℝ))^(3/5:ℝ) + + R⁻¹*(∫ y, ‖f y‖) := by + have hi := truncatedCoulomb_mul_integrable hfp.norm R x + calc + _ ≤ ∫ y, truncatedCoulomb R (x-y)*‖f y‖ + R⁻¹*‖f y‖ := + integral_mono (coulomb_lp_convolution_integrable hf.norm hfm.norm hfp.norm x) + (hi.add (hf.norm.const_mul _)) (fun y => by + simpa only [add_mul] using + mul_le_mul_of_nonneg_right (coulomb_lp_integrand_bound hR x y) (norm_nonneg (f y))) + _ = (∫ y, truncatedCoulomb R (x-y)*‖f y‖) + R⁻¹*(∫ y, ‖f y‖) := by + rw [integral_add hi (hf.norm.const_mul _), integral_const_mul] + _ ≤ _ := add_le_add (coulomb_near_holder hfp hR.le x) le_rfl + +lemma coulomb_lp_pair_integrable {f g : Space → ℝ} (hf : Integrable f) (hfm : Measurable f) + (hg : Integrable g) (hgm : Measurable g) + (hgp : MemLp g (ENNReal.ofReal (5/3:ℝ)) volume) : + Integrable (fun p : Space × Space => f p.1*g p.2*coulombKernel (p.1-p.2)) := by + have hm : Measurable (fun p : Space × Space => f p.1*g p.2*coulombKernel (p.1-p.2)) := + ((hfm.comp measurable_fst).mul (hgm.comp measurable_snd)).mul + (coulombKernel_measurable.comp (measurable_fst.sub measurable_snd)) + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + constructor + · apply ae_of_all + intro x + have hi := (coulomb_lp_convolution_integrable hg hgm hgp x).const_mul (f x) + exact hi.congr (ae_of_all _ (fun y => by dsimp only; ring)) + · let A : ℝ := (8*Real.pi)^(2/5:ℝ)*(∫ y, ‖g y‖^(5/3:ℝ))^(3/5:ℝ) + ∫ y, ‖g y‖ + have hb (x : Space) : (∫ y, coulombKernel (x-y)*‖g y‖) ≤ A := by + simpa [A] using coulomb_lp_convolution_bound hg hgm hgp (by norm_num : (0:ℝ)<1) x + have he (x : Space) : (∫ y, ‖f x*g y*coulombKernel (x-y)‖) = + ‖f x‖*(∫ y, coulombKernel (x-y)*‖g y‖) := by + simp_rw [norm_mul, Real.norm_of_nonneg (coulombKernel_nonneg _)] + simp_rw [mul_assoc, mul_comm ‖g _‖ (coulombKernel _)] + rw [integral_const_mul] + apply (hf.norm.mul_const A).mono' hm.aestronglyMeasurable.norm.integral_prod_right' + filter_upwards [] with x + change ‖∫ y, ‖f x*g y*coulombKernel (x-y)‖‖ ≤ ‖f x‖*A + rw [Real.norm_of_nonneg (integral_nonneg (fun y => norm_nonneg _)), he] + exact mul_le_mul_of_nonneg_left (hb x) (norm_nonneg _) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/FineKernelShiftCoulombIntegrable.lean b/lean/OAI/Analysis/CoulombRadii/Packets/FineKernelShiftCoulombIntegrable.lean new file mode 100644 index 0000000000000000000000000000000000000000..46bce8963ae68fdfaf8af7b2ff718ca5bd10472d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/FineKernelShiftCoulombIntegrable.lean @@ -0,0 +1,231 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CoreScreenedField +import OAI.Analysis.CoulombRadii.FieldAnalysis.RetainedFineDensity + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma fineKernel_shift_coulomb_integrable {b : ℝ} (hb : 0 < b) (a x : Space) : + Integrable (fun y => coulombKernel (a-y)*fineKernel b (y-x)) := by + have h := (fineKernel_coulomb_integrable hb (a-x)).comp_sub_right x + apply h.congr + exact Eventually.of_forall (fun y => by + change coulombKernel (a-x-(y-x))*fineKernel b (y-x) = _ + rw [show a-x-(y-x) = a-y by abel]) + +lemma fineKernel_shift_coulomb_eq {b : ℝ} (hb : 0 < b) (a x : Space) + (hsep : Real.sqrt 3*b ≤ ‖a-x‖) : + (∫ y, coulombKernel (a-y)*fineKernel b (y-x)) = coulombKernel (a-x) := by + rw [fineKernel_shift_coulomb_integral, fineKernel_coulomb_eq hb hsep] + +lemma retainedFineDensity_coulomb_integrable {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) (a : Space) : + Integrable (fun y => coulombKernel (a-y)*retainedFineDensity b r x y) := by + simp only [retainedFineDensity, Finset.mul_sum] + exact integrable_finsetSum _ (fun i _ => fineKernel_shift_coulomb_integrable hb a (x i)) + +lemma retainedFineDensity_coulomb_eq {n : ℕ} {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) (a : Space) + (hsep : ∀ i ∈ r, Real.sqrt 3*b ≤ ‖a-x i‖) : + (∫ y, coulombKernel (a-y)*retainedFineDensity b r x y) = ∑ i ∈ r, coulombKernel (a-x i) := by + simp only [retainedFineDensity, Finset.mul_sum] + rw [integral_finsetSum _ (fun i _ => fineKernel_shift_coulomb_integrable hb a (x i))] + exact Finset.sum_congr rfl (fun i hi => fineKernel_shift_coulomb_eq hb a (x i) (hsep i hi)) + +lemma coreCoulombPotential_fine_atom_eq {m : ℕ} (u : H1Vector m) + {A : Set Space} (hu : SpatiallySupported u A) {b : ℝ} (hb : 0 < b) (a : Space) + (hsep : ∀ z ∈ A, Real.sqrt 3*b ≤ ‖z-a‖) : + (∫ y, coreCoulombPotential u y*fineKernel b (y-a)) = coreCoulombPotential u a := by + rw [coreCoulombPotential_fubini u _ (fineKernel_shift_integrable hb a)] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro i _ + apply integral_congr_ae + filter_upwards [hu s] with x hx + by_cases he : u.value s x = 0 + · simp [he] + · have ha : position x i ∈ A := (by_contra (fun hn => he (hx hn)) : x ∈ allPositions A) i + rw [fineKernel_shift_coulomb_eq hb _ _ (hsep _ ha)] + +lemma coreCoulombPotential_retainedFine_eq {m n : ℕ} (u : H1Vector m) + {A : Set Space} (hu : SpatiallySupported u A) {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) + (hsep : ∀ z ∈ A, ∀ i ∈ r, Real.sqrt 3*b ≤ ‖z-x i‖) : + (∫ y, coreCoulombPotential u y*retainedFineDensity b r x y) = + ∑ i ∈ r, coreCoulombPotential u (x i) := by + simp only [retainedFineDensity, Finset.mul_sum] + rw [integral_finsetSum _ (fun i _ => coreCoulombPotential_mul_integrable u _ (fineKernel_shift_integrable hb (x i)))] + exact Finset.sum_congr rfl (fun i hi => coreCoulombPotential_fine_atom_eq u hu hb (x i) (fun z hz => hsep z hz i hi)) + +lemma attraction_retainedFine_integrable {M n : ℕ} (S : Nuclei M) {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) : + Integrable (fun y => attraction S y*retainedFineDensity b r x y) := by + simp only [attraction, Finset.sum_mul] + apply integrable_finsetSum + intro j _ + have h := (retainedFineDensity_coulomb_integrable hb r x (S.position j)).const_mul (S.charge j) + apply h.congr + exact Eventually.of_forall (fun y => by dsimp only; rw [coulombKernel_sub_comm y]; ring) + +lemma attraction_retainedFine_eq {M n : ℕ} (S : Nuclei M) {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) + (hsep : ∀ j i, i ∈ r → Real.sqrt 3*b ≤ ‖S.position j-x i‖) : + (∫ y, attraction S y*retainedFineDensity b r x y) = ∑ i ∈ r, attraction S (x i) := by + have hi (j : Fin M) : Integrable (fun y => S.charge j*(coulombKernel (S.position j-y)*retainedFineDensity b r x y)) := + (retainedFineDensity_coulomb_integrable hb r x (S.position j)).const_mul _ + simp only [attraction, Finset.sum_mul] + simp_rw [coulombKernel_sub_comm _ (S.position _), mul_assoc] + rw [integral_finsetSum _ (fun j _ => hi j), Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + rw [integral_const_mul, retainedFineDensity_coulomb_eq hb r x _ (hsep j), Finset.mul_sum] + +lemma coreScreenedField_retainedFine_integrable {M m n : ℕ} (S : Nuclei M) + (u : H1Vector m) {b : ℝ} (hb : 0 < b) (r : Finset (Fin n)) (x : Fin n → Space) : + Integrable (fun y => coreScreenedField S u y*retainedFineDensity b r x y) := by + apply Integrable.congr ((attraction_retainedFine_integrable S hb r x).sub + (coreCoulombPotential_mul_integrable u _ (retainedFineDensity_integrable hb r x))) + exact Eventually.of_forall fun y => (sub_mul _ _ _).symm + +lemma coreScreenedField_retainedFine_eq {M m n : ℕ} (S : Nuclei M) + (u : H1Vector m) {A : Set Space} (hu : SpatiallySupported u A) {b : ℝ} (hb : 0 < b) + (r : Finset (Fin n)) (x : Fin n → Space) + (hnuc : ∀ j i, i ∈ r → Real.sqrt 3*b ≤ ‖S.position j-x i‖) + (hcore : ∀ z ∈ A, ∀ i ∈ r, Real.sqrt 3*b ≤ ‖z-x i‖) : + (∫ y, coreScreenedField S u y*retainedFineDensity b r x y) = + ∑ i ∈ r, coreScreenedField S u (x i) := by + simp only [coreScreenedField,sub_mul] + rw [integral_sub (attraction_retainedFine_integrable S hb r x) + (coreCoulombPotential_mul_integrable u _ (retainedFineDensity_integrable hb r x)), + attraction_retainedFine_eq S hb r x hnuc, + coreCoulombPotential_retainedFine_eq u hu hb r x hcore, Finset.sum_sub_distrib] + +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/FineNear.lean b/lean/OAI/Analysis/CoulombRadii/Packets/FineNear.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b50e195c8e60b7d507abf025be02eb2e9baa15c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/FineNear.lean @@ -0,0 +1,109 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.FermionicNear + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +lemma fineKernel_near_coulomb_le {b : ℝ} (hb : 0 mul_nonneg (coulombKernel_nonneg _) (fineKernel_nonneg ..))) + _≤_ := by + rw [fineKernel_shift_coulomb_integral] + exact fineKernel_coulomb_le hb (sub_ne_zero.mpr hw.symm) + · rw [nearWeight,indicator_of_notMem hn] + have hdist : r+2*b≤‖w-y‖ := by simpa only [Metric.mem_ball,dist_eq_norm,not_lt] using hn + have he : (∫ z in Metric.ball y r,coulombKernel (y-z)*fineKernel b (z-w))=0 := by + apply setIntegral_eq_zero_of_ae_eq_zero + exact Eventually.of_forall (fun z hz => by + have hz' : ‖z-y‖ (fineKernel_shift_coulomb_integrable hb y (position x i)).integrableOn)] + exact (Finset.sum_le_sum (fun i _ => fineKernel_near_coulomb_le hb y (position x i) (hxy i) r)).trans + (Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ I) (fun i _ _ => nearWeight_nonneg y _ _)) + +lemma fineKernel_raw_deficit {b : ℝ} (hb : 0 mul_nonneg (coulombKernel_nonneg _) (fineKernel_nonneg ..))) + · rw [nearWeight,indicator_of_notMem hn] + have hsep : Real.sqrt 3*b≤‖y-w‖ := by + have hd : 2*b≤‖w-y‖ := by simpa only [Metric.mem_ball,dist_eq_norm,not_lt] using hn + have hs : Real.sqrt 3≤2 := by apply (Real.sqrt_le_iff).mpr; norm_num + rw [norm_sub_rev] + exact (mul_le_mul_of_nonneg_right hs hb.le).trans hd + rw [fineKernel_shift_coulomb_eq hb y w hsep,sub_self] + +theorem patchFine_raw_deficit {n : ℕ} {b t a : ℝ} (hb : 0 fineKernel_shift_coulomb_integrable hb y _) + have hraw : nuclearPotential (unitNucleus y) x=∑ i,coulombKernel (y-position x i) := by + simp [nuclearPotential,attraction,unitNucleus,coulombKernel,norm_sub_rev] + have hdel : (∑ i∈D,coulombKernel (y-position x i))≤(D.card:ℝ)/a := by + calc + _≤∑ _i∈D,a⁻¹ := by + apply Finset.sum_le_sum + intro i hi + have hni : i∉I := by simpa only [D,deletedLabels,Finset.mem_sdiff,Finset.mem_univ,true_and] using hi + have hn : t-7*b≤‖position x i-y‖ := by simpa only [I,patchRetained_mem,not_lt] using hni + unfold coulombKernel + rw [norm_sub_rev] + exact inv_anti₀ ha (hat.trans hn) + _=_ := by simp [div_eq_mul_inv] + have he : nuclearPotential (unitNucleus y) x-NeutralAtom.potentialOf (retainedFineDensity b I (position x)) y= + (∑ i∈I,(coulombKernel (y-position x i)-(∫ z,coulombKernel (y-z)*fineKernel b (z-position x i))))+ + ∑ i∈D,coulombKernel (y-position x i) := by + rw [hraw,hpot,←retained_deleted_sum (patchRetained y t b) x (fun i => coulombKernel (y-position x i)),Finset.sum_sub_distrib] + ring + change 0≤nuclearPotential (unitNucleus y) x-NeutralAtom.potentialOf (retainedFineDensity b I (position x)) y ∧ _ + rw [he] + constructor + · exact add_nonneg (Finset.sum_nonneg (fun i _ => (fineKernel_raw_deficit hb y _ (hxy i)).1)) + (Finset.sum_nonneg (fun i _ => coulombKernel_nonneg _)) + · have hh := (Finset.sum_le_sum (fun i (_ : i∈I) => (fineKernel_raw_deficit hb y _ (hxy i)).2)).trans + (Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ I) (fun i _ _ => nearWeight_nonneg y (2*b) _)) + exact add_le_add hh hdel +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/InnerMeshCap.lean b/lean/OAI/Analysis/CoulombRadii/Packets/InnerMeshCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d8c2e766ecdefa0ee48070166e05899e01e1953 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/InnerMeshCap.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.InnerCap + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +lemma exists_inner_shell_mesh : ∃ M : ℕ, ∀ {u : ℝ}, 0 u • (e.symm i).val),?_,?_⟩ + · intro i + simp only [norm_smul,Real.norm_eq_abs,abs_of_pos hu] + have H := ht (e.symm i).val (e.symm i).property + constructor <;> nlinarith [H.1,H.2] + · intro w hw1 hw2 + have hn : ‖u⁻¹ • w‖=‖w‖/u := by simp [norm_smul,abs_of_pos hu,div_eq_mul_inv,mul_comm] + obtain ⟨v,hv,Hv⟩ := hcover (u⁻¹ • w) + (by rw [hn]; exact (one_le_div hu).mpr hw1) + (by rw [hn]; exact (div_le_iff₀ hu).mpr hw2) + refine ⟨e ⟨v,hv⟩,?_⟩ + simp only [Equiv.symm_apply_apply,atomicCellScale_smul hu.le] + have he : w-u • v=u • (u⁻¹ • w-v) := by simp [smul_sub,smul_smul,hu.ne'] + rw [he,norm_smul,Real.norm_eq_abs,abs_of_pos hu] + exact mul_le_mul_of_nonneg_left Hv.le hu.le + +def innerMeshCap {J m k M : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Fin M → Space) : ℝ := + Real.sqrt (∑ i, (innerLocalCap S v x h (z i) (atomicCellScale (z i)))^2) +lemma innerMeshCap_nonneg {J m k M : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Fin M → Space) : + 0 ≤ innerMeshCap S v x h z := Real.sqrt_nonneg _ +lemma innerMeshCap_sq {J m k M : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Fin M → Space) : + (innerMeshCap S v x h z)^2=∑ i, (innerLocalCap S v x h (z i) (atomicCellScale (z i)))^2 := + Real.sq_sqrt (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) +lemma innerLocalCap_le_mesh {J m k M : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Fin M → Space) (i : Fin M) : + innerLocalCap S v x h (z i) (atomicCellScale (z i)) ≤ innerMeshCap S v x h z := by + apply (sq_le_sq₀ (innerLocalCap_nonneg _ _ _ _ _ _) (innerMeshCap_nonneg _ _ _ _ _)).mp + rw [innerMeshCap_sq] + exact Finset.single_le_sum (fun j _ => sq_nonneg (innerLocalCap S v x h (z j) (atomicCellScale (z j)))) (Finset.mem_univ i) +lemma innerMeshCap_normalized_slice_aestronglyMeasurable {J m k M : ℕ} (S : Nuclei J) + (v : H1Vector (m+k)) (s : Spins m) (h : ℝ) (z : Fin M → Space) : + AEStronglyMeasurable (fun x => innerMeshCap S (v.coreSlice s x).normalized x h z) volume := by + apply Real.continuous_sqrt.comp_aestronglyMeasurable + exact Finset.aestronglyMeasurable_fun_sum _ (fun i _ => + (innerLocalCap_normalized_slice_aestronglyMeasurable S v s h _ _).pow 2) +lemma innerMeshCap_bound {J m k M : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Fin M → Space) (hz : ∀ i, z i≠0) + (hnuc : ∀ i j, 4*atomicCellScale (z i)≤‖S.position j-z i‖) : + innerMeshCap S v x h z ≤ Real.sqrt (∑ i, 8*(totalCharge S/(2*atomicCellScale (z i)))^2) := by + apply Real.sqrt_le_sqrt + apply Finset.sum_le_sum + intro i hi + have H := innerLocalCap_le S v x h (z i) (atomicCellScale_pos (hz i)) (hnuc i) + exact (pow_le_pow_left₀ (innerLocalCap_nonneg _ _ _ _ _ _) H 2).trans_eq (Real.sq_sqrt (by positivity)) +lemma innerMeshCap_weight_integrable {J m k M : ℕ} (S : Nuclei J) (v : H1Vector (m+k)) + (s : Spins m) (h : ℝ) (z : Fin M → Space) (hz : ∀ i, z i≠0) + (hnuc : ∀ i j, 4*atomicCellScale (z i)≤‖S.position j-z i‖) (q : ℕ) : + Integrable (fun x => mass (v.coreSlice s x)*(innerMeshCap S (v.coreSlice s x).normalized x h z)^q) := by + apply (mass_coreSlice_integrable v s).mul_bdd ((innerMeshCap_normalized_slice_aestronglyMeasurable S v s h z).pow q) + filter_upwards [] with x + change ‖(innerMeshCap S (v.coreSlice s x).normalized x h z)^q‖ ≤ + (Real.sqrt (∑ i, 8*(totalCharge S/(2*atomicCellScale (z i)))^2))^q + rw [Real.norm_of_nonneg (pow_nonneg (innerMeshCap_nonneg _ _ _ _ _) q)] + exact pow_le_pow_left₀ (innerMeshCap_nonneg _ _ _ _ _) (innerMeshCap_bound S _ x h z hz hnuc) q + +namespace RecordedEnsemble +variable {n J : ℕ} + +structure InnerEnvelope (T : RecordedEnsemble n) (S : Nuclei J) (h u : ℝ) where + value : (p : T.index) → Spins (T.out p) → Configuration (T.out p) → ℝ + nonneg : ∀ p s x, 0≤value p s x + measurable : ∀ p s, AEStronglyMeasurable (value p s) volume + integrable : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*value p s x) + square_integrable : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*(value p s x)^2) + dominates : ∀ p s x w, u≤‖w‖ → ‖w‖≤2*u → + max (recordedFarField S ((T.vector p).coreSlice s x).normalized x (Metric.ball 0 h) w) 0 ≤ value p s x + +theorem exists_inner_shell_envelope : ∃ C : ℝ, 0≤C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ j, S.position j=0) → + ∀ (T : RecordedEnsemble n) {u h K : ℝ}, 0 innerMeshCap S ((T.vector p).coreSlice s x).normalized x h z + nonneg := fun p s x => innerMeshCap_nonneg _ _ _ _ _ + measurable := fun p s => innerMeshCap_normalized_slice_aestronglyMeasurable S (T.vector p) s h z + integrable := fun p s => by simpa only [pow_one] using innerMeshCap_weight_integrable S (T.vector p) s h z hz hnuc 1 + square_integrable := fun p s => innerMeshCap_weight_integrable S (T.vector p) s h z hz hnuc 2 + dominates := fun p s x w hw1 hw2 => by + obtain ⟨i,hi⟩ := hcover w hw1 hw2 + exact (innerLocalCap_dominates S _ x h (z i) w (atomicCellScale_pos (hz i)) hi (hcore i) (hnuc i)).trans + (innerLocalCap_le_mesh S _ x h z i) } + refine ⟨M,?_⟩ + have hwbound i w (hw : ‖w-z i‖≤2*atomicCellScale (z i)) : u/2≤‖w‖ ∧ ‖w‖≤4*u := by + have H1 : ‖z i‖≤‖w-z i‖+‖w‖ := by simpa only [dist_eq_norm,sub_zero,norm_sub_rev] using dist_triangle (z i) w 0 + have H2 : ‖w‖≤‖w-z i‖+‖z i‖ := by simpa only [dist_eq_norm,sub_zero] using dist_triangle w (z i) 0 + unfold atomicCellScale at hw + constructor <;> linarith [(hzbound i).1,(hzbound i).2] + have hsep i w (hw : ‖w-z i‖≤2*atomicCellScale (z i)) q (hq : q∈Metric.ball (0:Space) h) : u/4≤‖q-w‖ := by + have hn : ‖q‖ + (innerLocalCap S ((T.vector p).coreSlice s x).normalized x h (z i) (atomicCellScale (z i)))^2))≤8*K^2 := by + apply T.innerLocalCap_second_moment S h (z i) (atomicCellScale_pos (hz i)) (show 0 + (innerLocalCap S ((T.vector p).coreSlice s x).normalized x h (z i) (atomicCellScale (z i)))^2) := by + rw [T.dataRMS_sq] + simp only [M,innerMeshCap_sq,sliceExpectation,Finset.mul_sum] + conv_lhs => arg 2; ext p; arg 2; ext s; rw [integral_finsetSum _ (fun i _ => + innerLocalCap_weight_integrable S (T.vector p) s h (z i) (atomicCellScale_pos (hz i)) (hnuc i) 2)] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i hi + rw [Finset.sum_comm] + have H := Finset.sum_le_sum (s:=Finset.univ) (fun i _ => hic i) + rw [←he] at H + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] at H + apply (sq_le_sq₀ (T.dataRMS_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) hK)).mp + rw [mul_pow,Real.sq_sqrt (by positivity : (0:ℝ)≤8*Q)] + nlinarith + +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/InverseErrorScale.lean b/lean/OAI/Analysis/CoulombRadii/Packets/InverseErrorScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c61df8ffad36f5eea0514c10b54bae8e7770663 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/InverseErrorScale.lean @@ -0,0 +1,173 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.UniformGroundStateCountControl +import OAI.Analysis.CoulombRadii.FieldAnalysis.AtomicGapScale +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +lemma exists_uniform_inner_scale {f : ℝ → ℝ} (hf : Tendsto f (𝓝[>] 0) (𝓝 0)) + {A ε : ℝ} (hA : 0 inverseResponseError D F K κ L M a*a^6) (𝓝[>] 0) (𝓝 0) := by + have H := (((tendsto_positive_rpow_zero (by norm_num [packetExponent] : + (0:ℝ)<1/200-5*packetExponent/2)).const_mul (Real.sqrt (D/κ^5))).add + ((tendsto_positive_rpow_zero (by norm_num [packetExponent] : + (0:ℝ)<1/5-4*packetExponent)).const_mul (2*F*M/κ^4))).add + ((tendsto_positive_rpow_zero (by norm_num [packetExponent] : + (0:ℝ)<1/100-4*packetExponent)).const_mul (K*Real.sqrt 3*L*M/κ^4)) + simp only [mul_zero,add_zero] at H + apply H.congr' + filter_upwards [self_mem_nhdsWithin] with a ha + exact (inverseResponseError_expansion hD hκ ha).symm + +lemma lower_width_div_pow {a v κ : ℝ} (ha : 0 scaledCenterKernel φ t z y) := by + unfold scaledCenterKernel + exact ((htc.pow 3).inv₀ (fun z => pow_ne_zero _ (ht z).ne')).mul + (hφ.comp ((htc.inv₀ (fun z => (ht z).ne')).smul (continuous_const.sub continuous_id))) + +lemma integrable_scaledCenterKernel {φ t : Coulomb.Space → ℝ} + (hφ : Continuous φ) (htc : Continuous t) (ht : ∀ z, 0 < t z) + (hs : ∀ x, 1 < ‖x‖ → φ x=0) + (hLip : ∀ z z', |t z-t z'| ≤ ‖z-z'‖/4) (y : Coulomb.Space) : + Integrable (fun z => scaledCenterKernel φ t z y) := by + apply (continuous_scaledCenterKernel hφ htc ht y).integrable_of_hasCompactSupport + apply HasCompactSupport.intro (K := Metric.closedBall y (2*t y)) (isCompact_closedBall _ _) + intro z hz + by_contra hK + have hh := (scaledCenterKernel_support_width φ t hs ht hLip z y hK).2 + apply hz + rw [Metric.mem_closedBall,dist_eq_norm,norm_sub_rev] + linarith [ht y] + +lemma integral_constant_scaledCenterKernel (φ : Coulomb.Space → ℝ) + {T : ℝ} (hT : 0 < T) (y : Coulomb.Space) : + (∫ z, scaledCenterKernel φ (fun _ => T) z y) = ∫ z, φ z := by + unfold scaledCenterKernel + rw [integral_const_mul, integral_sub_left_eq_self + (fun z : Coulomb.Space => φ (T⁻¹ • z)), + Measure.integral_comp_inv_smul_of_nonneg volume φ hT.le] + simp only [Coulomb.Space,finrank_euclideanSpace_fin,smul_eq_mul] + rw [←mul_assoc,inv_mul_cancel₀ (pow_ne_zero _ hT.ne'),one_mul] + +theorem center_kernel_mass_defect {φ t : Coulomb.Space → ℝ} {B L q : ℝ} + (hB : 0 ≤ B) (hL : 0 ≤ L) (hq : 0 ≤ q) (hqs : q ≤ 1/4) + (hφc : Continuous φ) (htc : Continuous t) (ht : ∀ z, 0 < t z) + (hs : ∀ x, 1 < ‖x‖ → φ x=0) (hφ : ∀ x, |φ x| ≤ B) + (hφL : ∀ x v, |φ x-φ v| ≤ L*‖x-v‖) + (hLip : ∀ z z', |t z-t z'| ≤ q*‖z-z'‖) + (y : Coulomb.Space) : + |(∫ z, scaledCenterKernel φ t z y)-(∫ z, φ z)| ≤ + (64*Real.pi/3)*(48*B+64*L)*q := by + have hT := ht y + have hLip' : ∀ z z', |t z-t z'| ≤ ‖z-z'‖/4 := by + intro z z' + calc + _ ≤ q*‖z-z'‖ := hLip z z' + _ ≤ (1/4)*‖z-z'‖ := mul_le_mul_of_nonneg_right hqs (norm_nonneg _) + _ = _ := by ring + let F : Coulomb.Space → ℝ := fun z => scaledCenterKernel φ t z y + let G : Coulomb.Space → ℝ := fun z => scaledCenterKernel φ (fun _ => t y) z y + have hFi : Integrable F := integrable_scaledCenterKernel hφc htc ht hs hLip' y + have hGi : Integrable G := integrable_scaledCenterKernel hφc continuous_const (fun _ => hT) hs + (by intro z z'; simp only [sub_self,abs_zero]; positivity) y + have hpt (z : Coulomb.Space) (hz : z∈Metric.closedBall y (2*t y)) : + |F z-G z| ≤ 2*(48*B+64*L)*q/(t y)^3 := by + have hz' : ‖y-z‖ ≤ 2*t y := by simpa only [Metric.mem_closedBall,dist_eq_norm,norm_sub_rev] using hz + have hwd : |t z-t y| ≤ 2*q*t y := by + calc + _ ≤ q*‖z-y‖ := hLip z y + _ ≤ q*(2*t y) := mul_le_mul_of_nonneg_left (by simpa only [norm_sub_rev] using hz') hq + _ = _ := by ring + have ha : t y/2 ≤ t z := by + have hab := abs_le.mp hwd + have hqt := mul_le_mul_of_nonneg_right hqs hT.le + nlinarith + have hh := scaled_kernel_local_bound hT ha (show t y/2 ≤ t y by linarith) hB hL φ hφ hφL + (y-z) (y-z) hz' + simp only [sub_self,norm_zero,mul_zero,add_zero] at hh + calc + _ ≤ ((48*B+64*L)/(t y)^4)*|t z-t y| := hh + _ ≤ ((48*B+64*L)/(t y)^4)*(2*q*t y) := mul_le_mul_of_nonneg_left hwd (by positivity) + _ = _ := by field_simp + have hout (z : Coulomb.Space) (hz : z∉Metric.closedBall y (2*t y)) : F z-G z=0 := by + have hz' : 2*t y < ‖y-z‖ := by simpa only [Metric.mem_closedBall,dist_eq_norm,norm_sub_rev,not_le] using hz + have hF : F z=0 := by + by_contra hh + have hh' := (scaledCenterKernel_support_width φ t hs ht hLip' z y hh).2 + linarith + have hG : G z=0 := by + by_contra hh + have hh' := scaledCenterKernel_support φ (fun _ => t y) hs (fun _ => hT) z y hh + linarith + rw [hF,hG,sub_self] + rw [←integral_constant_scaledCenterKernel φ hT y,←integral_sub hFi hGi] + change |∫ z, F z-G z| ≤ _ + rw [←setIntegral_eq_integral_of_forall_compl_eq_zero hout] + have hh := norm_setIntegral_le_of_norm_le_const (μ := volume) + (isCompact_closedBall y (2*t y)).measure_lt_top + (fun z hz => (show ‖F z-G z‖ ≤ 2*(48*B+64*L)*q/(t y)^3 by simpa only [Real.norm_eq_abs] using hpt z hz)) + rw [Real.norm_eq_abs,Coulomb.volume_closedBall_three y (by positivity : 0 ≤ 2*t y)] at hh + apply hh.trans_eq + field_simp + ring + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/KernelScale.lean b/lean/OAI/Analysis/CoulombRadii/Packets/KernelScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..24d2809adc83c0c9b175b32ab30935b01d1a133e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/KernelScale.lean @@ -0,0 +1,210 @@ +import Mathlib + +namespace OAI + +noncomputable section + +section +open Set +namespace NeutralAtom + +lemma inv_upper_of_half_le {T a : ℝ} (hT : 0 < T) (ha : T/2 ≤ a) : + a⁻¹ ≤ 2/T := by + have ha0 : 0 < a := lt_of_lt_of_le (half_pos hT) ha + calc + a⁻¹ ≤ (T/2)⁻¹ := (inv_le_inv₀ ha0 (half_pos hT)).mpr ha + _ = 2/T := by simp [div_eq_mul_inv] + +lemma inv_sub_bound_of_half_le {T a b : ℝ} + (hT : 0 < T) (ha : T/2 ≤ a) (hb : T/2 ≤ b) : + |a⁻¹-b⁻¹| ≤ (4/T^2)*|a-b| := by + have ha0 : 0 < a := lt_of_lt_of_le (half_pos hT) ha + have hb0 : 0 < b := lt_of_lt_of_le (half_pos hT) hb + rw [inv_sub_inv' ha0.ne' hb0.ne', abs_mul,abs_mul, + abs_of_pos (inv_pos.mpr ha0),abs_of_pos (inv_pos.mpr hb0),abs_sub_comm b a] + calc + _ ≤ ((2/T)*|a-b|)*(2/T) := mul_le_mul + (mul_le_mul_of_nonneg_right (inv_upper_of_half_le hT ha) (abs_nonneg _)) + (inv_upper_of_half_le hT hb) (inv_nonneg.mpr hb0.le) + (mul_nonneg (by positivity) (abs_nonneg _)) + _ = _ := by ring + +lemma inv_cube_sub_bound_of_half_le {T a b : ℝ} + (hT : 0 < T) (ha : T/2 ≤ a) (hb : T/2 ≤ b) : + |(a^3)⁻¹-(b^3)⁻¹| ≤ (48/T^4)*|a-b| := by + have ha0 : 0 < a := lt_of_lt_of_le (half_pos hT) ha + have hb0 : 0 < b := lt_of_lt_of_le (half_pos hT) hb + have href : ∀ z ∈ Ici (T/2), + HasDerivWithinAt (fun x : ℝ => x^(-3:ℝ)) (-3*z^(-4:ℝ)) (Ici (T/2)) z := by + intro z hz + have hd := (Real.hasDerivAt_rpow_const (x := z) (p := -3) + (Or.inl (ne_of_gt (lt_of_lt_of_le (half_pos hT) hz)))).hasDerivWithinAt (s := Ici (T/2)) + norm_num only at hd + exact hd + have hbd : ∀ z ∈ Ici (T/2), ‖-3*z^(-4:ℝ)‖ ≤ 48/T^4 := by + intro z hz + have hz0 : 0 < z := lt_of_lt_of_le (half_pos hT) hz + rw [norm_mul,Real.norm_eq_abs,abs_neg,abs_of_pos (by norm_num : (0:ℝ)<3), + Real.norm_of_nonneg (Real.rpow_nonneg hz0.le _)] + calc + _ ≤ 3*(T/2)^(-4:ℝ) := mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_nonpos (half_pos hT) hz (by norm_num)) (by norm_num) + _ = 48/T^4 := by norm_num [Real.rpow_neg (le_of_lt (half_pos hT)),Real.rpow_natCast]; ring + have hh := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le href hbd (convex_Ici _) + (show a ∈ Ici (T/2) from ha) (show b ∈ Ici (T/2) from hb) + simpa only [Real.norm_eq_abs,show (-3:ℝ) = -(3:ℝ) by norm_num, + Real.rpow_neg ha0.le,Real.rpow_neg hb0.le,Real.rpow_ofNat,abs_sub_comm] using hh + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +def scaledCenterKernel (φ : E → ℝ) (t : E → ℝ) (z y : E) := + ((t z)^3)⁻¹ * φ ((t z)⁻¹ • (y-z)) + +lemma inverse_scaled_argument_bound {T a b : ℝ} (hT : 0 < T) + (ha : T/2 ≤ a) (hb : T/2 ≤ b) (x v : E) (hv : ‖v‖ ≤ 2*T) : + ‖a⁻¹ • x-b⁻¹ • v‖ ≤ (2/T)*‖x-v‖+(8/T)*|a-b| := by + have ha0 : 0 linarith + · linarith + +lemma scaledCenterKernel_uniform_bound (φ : E → ℝ) (t : E → ℝ) + {B : ℝ} (hB : 0 ≤ B) (hs : ∀ x, 1 < ‖x‖ → φ x = 0) + (hφ : ∀ x, |φ x| ≤ B) (ht : ∀ z, 0 < t z) + (hLip : ∀ x v, |t x-t v| ≤ ‖x-v‖/4) (z y : E) : + |scaledCenterKernel φ t z y| ≤ 8*B/(t y)^3 := by + have hT := ht y + by_cases hK : scaledCenterKernel φ t z y=0 + · rw [hK,abs_zero]; positivity + have hc := (scaledCenterKernel_support_width φ t hs ht hLip z y hK).1.1 + have hi := inv_upper_of_half_le (ht y) (show t y/2 ≤ t z by linarith [ht y]) + have hh := pow_le_pow_left₀ (inv_nonneg.mpr (ht z).le) hi 3 + have hh' : ((t z)^3)⁻¹ ≤ 8/(t y)^3 := by + simpa only [inv_pow,div_pow,show (2:ℝ)^3=8 by norm_num] using hh + rw [scaledCenterKernel,abs_mul,abs_of_pos (inv_pos.mpr (pow_pos (ht z) _))] + calc + _ ≤ (8/(t y)^3)*B := mul_le_mul hh' (hφ _) (abs_nonneg _) (by positivity) + _ = _ := by ring + +theorem scaledCenterKernel_center_lipschitz (φ : E → ℝ) (t : E → ℝ) + {B L : ℝ} (hB : 0 ≤ B) (hL : 0 ≤ L) + (hs : ∀ x, 1 < ‖x‖ → φ x = 0) (hφ : ∀ x, |φ x| ≤ B) + (hφL : ∀ x v, |φ x-φ v| ≤ L*‖x-v‖) (ht : ∀ z, 0 < t z) + (hLip : ∀ x v, |t x-t v| ≤ ‖x-v‖/4) (z z' y : E) : + |scaledCenterKernel φ t z y-scaledCenterKernel φ t z' y| ≤ + ((64*B+80*L)/(t y)^4)*‖z-z'‖ := by + have hT := ht y + have hordered (z z' : E) (hK : scaledCenterKernel φ t z y≠0) : + |scaledCenterKernel φ t z y-scaledCenterKernel φ t z' y| ≤ + ((64*B+80*L)/(t y)^4)*‖z-z'‖ := by + have hc := scaledCenterKernel_support_width φ t hs ht hLip z y hK + by_cases hf : t y/4 ≤ ‖z-z'‖ + · calc + _ ≤ |scaledCenterKernel φ t z y|+|scaledCenterKernel φ t z' y| := by simpa only [sub_zero,zero_sub,abs_neg] using (abs_sub_le (scaledCenterKernel φ t z y) 0 (scaledCenterKernel φ t z' y)) + _ ≤ 16*B/(t y)^3 := by + have h₁ := scaledCenterKernel_uniform_bound φ t hB hs hφ ht hLip z y + have h₂ := scaledCenterKernel_uniform_bound φ t hB hs hφ ht hLip z' y + calc + _ ≤ 8*B/(t y)^3+8*B/(t y)^3 := add_le_add h₁ h₂ + _ = _ := by ring + _ = ((64*B)/(t y)^4)*(t y/4) := by field_simp; ring + _ ≤ ((64*B+80*L)/(t y)^4)*‖z-z'‖ := mul_le_mul + (div_le_div_of_nonneg_right (show 64*B ≤ 64*B+80*L by linarith) (pow_nonneg (ht y).le _)) hf + (by positivity) (by positivity) + · have hnear : ‖z-z'‖ < t y/4 := lt_of_not_ge hf + have hab := abs_le.mp (hLip z z') + have hb : t y/2 ≤ t z' := by linarith [hc.1.1] + have ha : t y/2 ≤ t z := by linarith [hc.1.1,ht y] + have hv : ‖y-z'‖ ≤ 2*t y := by + have hh : ‖y-z'‖ ≤ ‖y-z‖+‖z-z'‖ := by + simpa only [sub_add_sub_cancel] using (norm_add_le (y-z) (z-z')) + linarith [hc.2] + have hh := scaled_kernel_local_bound (ht y) ha hb hB hL φ hφ hφL (y-z) (y-z') hv + have he : (y-z)-(y-z')=z'-z := by abel + rw [he,norm_sub_rev z' z] at hh + have had : |t z-t z'| ≤ ‖z-z'‖ := (hLip z z').trans (by linarith [norm_nonneg (z-z')]) + apply hh.trans + calc + _ ≤ ((48*B+64*L)/(t y)^4)*‖z-z'‖+(16*L/(t y)^4)*‖z-z'‖ := + add_le_add (mul_le_mul_of_nonneg_left had (by positivity)) le_rfl + _ = ((48*B+80*L)/(t y)^4)*‖z-z'‖ := by ring + _ ≤ _ := mul_le_mul_of_nonneg_right + (div_le_div_of_nonneg_right (show 48*B+80*L ≤ 64*B+80*L by linarith) (pow_nonneg (ht y).le _)) (norm_nonneg _) + by_cases hz : scaledCenterKernel φ t z y=0 + · by_cases hz' : scaledCenterKernel φ t z' y=0 + · rw [hz,hz',sub_self,abs_zero]; positivity + · simpa only [abs_sub_comm,norm_sub_rev] using hordered z' z hz' + · exact hordered z z' hz + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/LipschitzMollifier.lean b/lean/OAI/Analysis/CoulombRadii/Packets/LipschitzMollifier.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3edfcceed33bff7d4cbc69414b9bef3b4acfd7e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/LipschitzMollifier.lean @@ -0,0 +1,84 @@ +import Mathlib + +namespace OAI + +section +section +open MeasureTheory Set Filter ContinuousLinearMap +open scoped ENNReal NNReal Topology ContDiff Convolution +noncomputable section +namespace NeutralAtom + +theorem exists_smooth_lipschitz_approx + (K : EuclideanSpace ℝ (Fin 3) → ℝ) {A R ε : ℝ} (hA : 0≤A) (hε : 0<ε) + (y : EuclideanSpace ℝ (Fin 3)) + (hs : ∀ z, R<‖z-y‖ → K z=0) + (hL : ∀ z v, |K z-K v|≤A*‖z-v‖) : + ∃ χ : EuclideanSpace ℝ (Fin 3) → ℝ, ContDiff ℝ ∞ χ ∧ + tsupport χ⊆Metric.closedBall y (R+ε) ∧ + (∀ z v, |χ z-χ v|≤A*‖z-v‖) ∧ (∀ z, |χ z-K z|≤A*ε) := by + let φ : ContDiffBump (0 : EuclideanSpace ℝ (Fin 3)) := ⟨ε/2,ε,by positivity,by linarith⟩ + have hKl : LipschitzWith ⟨A,hA⟩ K := by + apply LipschitzWith.of_dist_le_mul + intro z v + change dist (K z) (K v) ≤ A*dist z v + simpa only [Real.dist_eq,dist_eq_norm,Real.norm_eq_abs] using hL z v + have hKc := hKl.continuous + let χ := φ.normed volume ⋆[lsmul ℝ ℝ,volume] K + have hχ : ContDiff ℝ ∞ χ := + φ.hasCompactSupport_normed.contDiff_convolution_left (lsmul ℝ ℝ) + φ.contDiff_normed hKc.locallyIntegrable + have hi (z : EuclideanSpace ℝ (Fin 3)) : + Integrable (fun u => φ.normed volume u * K (z-u)) := by + exact φ.hasCompactSupport_normed.convolutionExists_left (lsmul ℝ ℝ) + φ.continuous_normed hKc.locallyIntegrable z + refine ⟨χ,hχ,?_,?_,?_⟩ + · apply closure_minimal _ Metric.isClosed_closedBall + intro z hz + change χ z≠0 at hz + by_contra hn + have hd : R+ε<‖z-y‖ := by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hn + apply hz + change (∫ u, φ.normed volume u*K (z-u))=0 + apply integral_eq_zero_of_ae + filter_upwards [] with u + change φ.normed volume u*K (z-u)=0 + by_cases hu : φ.normed volume u=0 + · simp only [hu,zero_mul] + have hu' : ‖u‖<ε := by + have hh : u∈Function.support (φ.normed volume) := hu + rw [φ.support_normed_eq] at hh + simpa only [Metric.mem_ball,dist_zero_right] using hh + have htri : ‖z-y‖≤‖z-u-y‖+‖u‖ := by + calc _=‖(z-u-y)+u‖ := by congr 1; module + _≤_ := norm_add_le _ _ + rw [hs _ (by linarith),mul_zero] + · intro z v + change |(∫ u, φ.normed volume u*K (z-u))-(∫ u, φ.normed volume u*K (v-u))|≤_ + rw [←integral_sub (hi z) (hi v)] + calc + _≤∫ u, |φ.normed volume u*K (z-u)-φ.normed volume u*K (v-u)| := abs_integral_le_integral_abs + _≤∫ u, φ.normed volume u*(A*‖z-v‖) := by + apply integral_mono + · simpa only [Pi.sub_apply,Real.norm_eq_abs] using ((hi z).sub (hi v)).norm + · exact φ.integrable_normed.mul_const _ + · intro u + dsimp only + rw [←mul_sub,abs_mul,abs_of_nonneg (φ.nonneg_normed u)] + have he : z-u-(v-u)=z-v := by module + exact mul_le_mul_of_nonneg_left (by simpa only [he] using hL (z-u) (v-u)) (φ.nonneg_normed u) + _=A*‖z-v‖ := by rw [integral_mul_const,φ.integral_normed,one_mul] + · intro z + have hh := φ.dist_normed_convolution_le (μ := volume) hKc.aestronglyMeasurable + (x₀ := z) (ε := A*ε) (fun v hv => by + rw [Real.dist_eq] + exact (hL v z).trans (mul_le_mul_of_nonneg_left (by simpa only [Metric.mem_ball,dist_eq_norm] using hv.le) hA)) + exact hh + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/MasterKernel.lean b/lean/OAI/Analysis/CoulombRadii/Packets/MasterKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f50b90dffada98eb470d45ade82e50fd7e94097 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/MasterKernel.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketWidthScalar +import OAI.Analysis.CoulombRadii.Packets.KernelCenterMass +import OAI.Analysis.CoulombRadii.FormDomain.WindowSquare + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem master_kernel_estimates (g : 𝓢(Position,ℝ)) + (hg : ∀ x, 1 < ‖x‖ → g x=0) (hm : (∫ x, g x^2)=1) : + ∃ C : ℝ, 0 < C ∧ ∀ {c r₀ s : ℝ}, 0 < c → 0 < r₀ → 0 < s → + c*(1+packetExponent)*s^packetExponent ≤ 1/4 → + ∀ y : Position, + (∀ z, packetKernel g c r₀ s z y≠0 → ‖y-z‖ ≤ 2*packetWidth c r₀ s y) ∧ + (∀ z, |packetKernel g c r₀ s z y| ≤ C/(packetWidth c r₀ s y)^3) ∧ + (∀ z z', |packetKernel g c r₀ s z y-packetKernel g c r₀ s z' y| ≤ + (C/(packetWidth c r₀ s y)^4)*‖z-z'‖) ∧ + Integrable (fun z => packetKernel g c r₀ s z y) ∧ + |(∫ z, packetKernel g c r₀ s z y)-1| ≤ + C*(c*(1+packetExponent)*s^packetExponent) := by + obtain ⟨B,L,hB,hL,hφ,hφL⟩ := schwartz_square_bounded_lipschitz g + let A := 8*B + let D := 64*B+80*L + let M := (64*Real.pi/3)*(48*B+64*L) + let C := 1+A+D+M + have hA : 0 ≤ A := by dsimp [A]; positivity + have hD : 0 ≤ D := by dsimp [D]; positivity + have hM : 0 ≤ M := by dsimp [M]; positivity + have hAC : A ≤ C := by dsimp [C]; linarith + have hDC : D ≤ C := by dsimp [C]; linarith + have hMC : M ≤ C := by dsimp [C]; linarith + refine ⟨C,by dsimp [C]; linarith,?_⟩ + intro c r₀ s hc hr hs hsmall y + let t := packetWidth c r₀ s + let q := c*(1+packetExponent)*s^packetExponent + have ht : ∀ z, 0 < t z := packetWidth_pos hc hr hs + have hq : 0 ≤ q := by + dsimp [q] + exact mul_nonneg (mul_nonneg hc.le (by norm_num [packetExponent])) + (Real.rpow_nonneg hs.le _) + have hlip : ∀ z z', |t z-t z'| ≤ q*‖z-z'‖ := packetWidth_lipschitz hc.le hr hs + have hlip' : ∀ z z', |t z-t z'| ≤ ‖z-z'‖/4 := by + intro z z' + calc + _ ≤ q*‖z-z'‖ := hlip z z' + _ ≤ (1/4)*‖z-z'‖ := mul_le_mul_of_nonneg_right hsmall (norm_nonneg _) + _ = _ := by ring + have hφs : ∀ x, 1 < ‖x‖ → (fun z => g z^2) x=0 := by + intro x hx; simp only [hg x hx,zero_pow (by decide : (2:ℕ)≠0)] + have he (z : Position) : packetKernel g c r₀ s z y=scaledCenterKernel (fun z => g z^2) t z y := rfl + refine ⟨?_,?_,?_,?_,?_⟩ + · intro z hK + rw [he] at hK + have hh := (scaledCenterKernel_support_width _ t hφs ht hlip' z y hK).2 + linarith [ht y] + · intro z + rw [he] + exact (scaledCenterKernel_uniform_bound _ t hB hφs hφ ht hlip' z y).trans + (div_le_div_of_nonneg_right hAC (pow_nonneg (ht y).le _)) + · intro z z' + rw [he,he] + exact (scaledCenterKernel_center_lipschitz _ t hB hL hφs hφ hφL ht hlip' z z' y).trans + (mul_le_mul_of_nonneg_right (div_le_div_of_nonneg_right hDC (pow_nonneg (ht y).le _)) (norm_nonneg _)) + · exact integrable_scaledCenterKernel (g.continuous.pow 2) (continuous_packetWidth c r₀ s) ht hφs hlip' y + · have hh := center_kernel_mass_defect hB hL hq hsmall (g.continuous.pow 2) + (continuous_packetWidth c r₀ s) ht hφs hφ hφL hlip y + change |(∫ z, packetKernel g c r₀ s z y)-(∫ z, g z^2)| ≤ M*q at hh + rw [hm] at hh + exact hh.trans (mul_le_mul_of_nonneg_right hMC hq) + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/MasterKernelDuality.lean b/lean/OAI/Analysis/CoulombRadii/Packets/MasterKernelDuality.lean new file mode 100644 index 0000000000000000000000000000000000000000..73da3956ad24fda523c19b0bcab1dd2fe1bb2754 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/MasterKernelDuality.lean @@ -0,0 +1,53 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.MasterKernel +import OAI.Analysis.CoulombRadii.FieldAnalysis.LipschitzTestEnergy + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem master_kernel_coulomb_duality (g : 𝓢(Position,ℝ)) + (hg : ∀ x, 1<‖x‖ → g x=0) (hm : (∫ x, g x^2)=1) : + ∃ C : ℝ, 0 g w^2) ht.le] + simp only [Position,finrank_euclideanSpace_fin,smul_eq_mul,hm,mul_one] + exact inv_mul_cancel₀ (pow_ne_zero _ ht.ne') + +lemma fixed_scaled_window_integrable (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + {t : ℝ} (ht : 0 (t^3)⁻¹*g (t⁻¹ • w)^2) := by + by_contra hn + have hh := integral_undef hn + rw [fixed_scaled_window_mass g hm ht] at hh + exact one_ne_zero hh + +lemma packet_potential_center_shift (g : Position → ℝ) (c r₀ s : ℝ) (z y : Position) : + potentialOf (packetKernel g c r₀ s z) y = + ∫ w, Coulomb.coulombKernel ((y-z)-w)* + ((packetWidth c r₀ s z^3)⁻¹*g ((packetWidth c r₀ s z)⁻¹ • w)^2) := by + rw [←integral_sub_right_eq_self (fun w : Position => Coulomb.coulombKernel ((y-z)-w)* + ((packetWidth c r₀ s z^3)⁻¹*g ((packetWidth c r₀ s z)⁻¹ • w)^2)) z] + unfold potentialOf packetKernel + apply integral_congr_ae + exact Eventually.of_forall fun w => by + dsimp only + rw [show (y-z)-(w-z)=y-w by abel] + rfl + +theorem packet_potential_newton (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + (hrad : ∀ w,g w=g (EuclideanSpace.single 0 ‖w‖)) + {c r₀ s : ℝ} (hc : 0 mul_nonneg (Coulomb.coulombKernel_nonneg _) (hp w)),?_⟩ + have H := Coulomb.radial_coulomb_integral_le (fixed_scaled_window_integrable g hm ht) + (by fun_prop) hp hb hfr (sub_ne_zero.mpr hyz) + rw [fixed_scaled_window_mass g hm ht,mul_one] at H + exact H + +theorem packet_potential_newton_eq (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + (hrad : ∀ w,g w=g (EuclideanSpace.single 0 ‖w‖)) + (hgs : ∀ w,1<‖w‖ → g w=0) + {c r₀ s : ℝ} (hc : 0 coulombKernel (y-z)) z := by + have H := packet_potential_newton g hm hrad hc hr hs hyz + refine ⟨sub_nonneg.mpr H.2,?_⟩ + by_cases hz : z∈Metric.closedBall y (2*packetWidth c r₀ s y) + · rw [Set.indicator_of_mem hz] + linarith [H.1] + · rw [Set.indicator_of_notMem hz] + have hd : 2*packetWidth c r₀ s y<‖z-y‖ := by + simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hz + have hl := packetWidth_lipschitz hc.le hr hs z y + have hi := mul_le_mul_of_nonneg_right hq (norm_nonneg (z-y)) + have hsep : packetWidth c r₀ s z≤‖y-z‖ := by + rw [norm_sub_rev] + have hle := (le_abs_self (packetWidth c r₀ s z-packetWidth c r₀ s y)).trans hl + linarith + rw [packet_potential_newton_eq g hm hrad hgs hc hr hs hsep,sub_self] +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/MasterTruncatedCap.lean b/lean/OAI/Analysis/CoulombRadii/Packets/MasterTruncatedCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..751529d6109cce1ad455aff8e7dd899ad864662b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/MasterTruncatedCap.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.RawMasterNewton +import OAI.Analysis.CoulombRadii.FormDomain.RetainedPotentialMean + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma rawPacketPotential_ge_far {n : ℕ} (g : 𝓢(Position,ℝ)) (hm : (∫ z,g z^2)=1) + (hrad : ∀ z,g z=g (EuclideanSpace.single 0 ‖z‖)) (hgs : ∀ z,1 < ‖z‖ → g z=0) + {c r₀ s R : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) + (hscale : c*(1+packetExponent)*s^packetExponent ≤ 1/2) + (y : Position) (hR : 2*packetWidth c r₀ s y ≤ R) (x : Configuration n) : + Coulomb.restrictedOutPotential (flattenConfiguration n x) {z | R ≤ ‖z-y‖} y ≤ + potentialOf (rawPacketDensity g c r₀ s x) y := by + rw [rawPacketPotential_sum g hm hc hr₀ hs] + apply Finset.sum_le_sum + intro i hi + change (if R ≤ ‖x i-y‖ then ‖x i-y‖⁻¹ else 0) ≤ _ + split_ifs with h + · have hl := packetWidth_lipschitz hc.le hr₀ hs (x i) y + have H := mul_le_mul_of_nonneg_right hscale (norm_nonneg (x i-y)) + have hsep : packetWidth c r₀ s (x i) ≤ ‖y-x i‖ := by + rw [norm_sub_rev] + have H' := (le_abs_self (packetWidth c r₀ s (x i)-packetWidth c r₀ s y)).trans hl + linarith + rw [packet_potential_newton_eq g hm hrad hgs hc hr₀ hs hsep] + simp only [coulombKernel,norm_sub_rev] + exact le_rfl + · exact integral_nonneg (fun z => mul_nonneg (coulombKernel_nonneg _) + (packetKernel_nonneg g hc hr₀ hs (x i) z)) + +theorem master_field_le_truncated {n : ℕ} (u : Coulomb.H1Vector n) (hum : Coulomb.mass u=1) + (g : 𝓢(Position,ℝ)) (hm : (∫ z,g z^2)=1) + (hrad : ∀ z,g z=g (EuclideanSpace.single 0 ‖z‖)) (hgs : ∀ z,1 < ‖z‖ → g z=0) + {c r₀ s R : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) (hR : 0 < R) + (hscale : c*(1+packetExponent)*s^packetExponent ≤ 1/2) + (y : Position) (hwidth : 2*packetWidth c r₀ s y ≤ R) (V : ℝ) : + V-potentialOf (mixturePacketDensity (rawLaw (fromH1Wave u)) g c r₀ s) y ≤ + V-Coulomb.restrictedCorePotential u {z | R ≤ ‖z-y‖} y := by + have hu (σ : Spins n) : MemLp (fromH1Wave u σ) 2 volume := + (u.value_L2 σ).comp_measurePreserving (flattenConfiguration_measurePreserving n) + have := rawLaw_isProbability hu ((fromH1_mass u).trans hum) + have hgc : HasCompactSupport (g : Position → ℝ) := + HasCompactSupport.intro (isCompact_closedBall (0:Position) 1) (fun z hz => + hgs z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + let W := Coulomb.rawSignedField (n:=n) V {z | R ≤ ‖z-y‖} y + have hA : MeasurableSet {z : Position | R ≤ ‖z-y‖} := measurableSet_le measurable_const (by fun_prop) + have hW : Measurable W := Coulomb.rawSignedField_measurable _ hA y + have hF := hW.comp (flattenConfiguration n).continuous.measurable + have hB (x : Configuration n) : ‖W (flattenConfiguration n x)‖ ≤ |V|+(n:ℝ)/R := by + exact Coulomb.rawSignedField_abs_le V _ y hR (fun _ hz => hz) _ + have hi : Integrable (fun x => W (flattenConfiguration n x)) (rawLaw (fromH1Wave u)) := Integrable.of_bound hF.aestronglyMeasurable (|V|+(n:ℝ)/R) + (Eventually.of_forall hB) + have hp := integrable_rawPacketPotential g.continuous hgc hm hc hr₀ hs (rawLaw (fromH1Wave u)) y + have H := integral_mono (integrable_const V |>.sub hp) hi + (fun x => sub_le_sub_left (rawPacketPotential_ge_far g hm hrad hgs hc hr₀ hs hscale y hwidth x) V) + simp only [Pi.sub_apply] at H + rw [integral_sub (integrable_const V) hp,integral_const,probReal_univ,smul_eq_mul,one_mul, + ←mixturePacketPotential g.continuous hgc hm hc hr₀ hs] at H + rw [fromH1_raw_bounded_integral u (F:=fun x => W (flattenConfiguration n x)) hF hB] at H + simp only [ContinuousLinearEquiv.apply_symm_apply] at H + rw [Coulomb.potentialForm_rawSignedField u V hA y hR (fun _ hz => hz),hum,mul_one] at H + exact H + +theorem atomic_master_field_cap {J n : ℕ} (S : Coulomb.Nuclei J) + (hatom : ∀ i,S.position i=0) (u : Coulomb.H1Vector n) + (hu : Coulomb.Antisymmetric u) (hum : Coulomb.mass u=1) + {E δ : ℝ} (hE : (E:EReal) ≤ Coulomb.unrestrictedFormBottom S) + (he : Coulomb.form S u ≤ E+δ) (hδ : 0 ≤ δ) + (g : 𝓢(Position,ℝ)) (hm : (∫ z,g z^2)=1) + (hrad : ∀ z,g z=g (EuclideanSpace.single 0 ‖z‖)) (hgs : ∀ z,1 < ‖z‖ → g z=0) + {c r₀ s : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) + (hscale : c*(1+packetExponent)*s^packetExponent ≤ 1/2) + (y : Position) (hy : y≠0) (hwidth : 2*packetWidth c r₀ s y ≤ 40*Coulomb.atomicCellScale y) : + Coulomb.attraction S y-potentialOf (mixturePacketDensity (rawLaw (fromH1Wave u)) g c r₀ s) y ≤ + 2*Coulomb.atomicBudgetRecursionC^2* + Coulomb.screenFieldUnit δ Coulomb.atomicCountConstant (Coulomb.atomicCellScale y) := by + have ha := Coulomb.atomicCellScale_pos hy + exact (master_field_le_truncated u hum g hm hrad hgs hc hr₀ hs (by positivity) + hscale y hwidth (Coulomb.attraction S y)).trans + ((le_max_left _ _).trans (Coulomb.atomic_expected_raw_field_bound S hatom u hu hum hE he hδ hy)) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/MeshInverseDeterministic.lean b/lean/OAI/Analysis/CoulombRadii/Packets/MeshInverseDeterministic.lean new file mode 100644 index 0000000000000000000000000000000000000000..8ff55b774b73073acd50c276ecaca1247cec1d32 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/MeshInverseDeterministic.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TFResponseMargins + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma exists_height_brackets {hl hh ξ : ℝ} (hξ : 0 < ξ) (hξl : ξ < hl) (hlh : hl ≤ hh) : + ∃ t : Finset ℝ,(∀ v∈t,v∈Icc (hl/2) (2*hh)) ∧ + ∀ h∈Icc hl hh, + (∃ v∈t,h-ξ/4 ≤ v ∧ v ≤ h-ξ/8) ∧ + (∃ v∈t,h+ξ/8 ≤ v ∧ v ≤ h+ξ/4) := by + obtain ⟨S,hSf,hS⟩ := Metric.totallyBounded_iff.mp + (isCompact_Icc : IsCompact (Icc (hl-ξ) (hh+ξ))).totallyBounded (ξ/64) (by positivity) + let t := hSf.toFinset.filter (fun v => v∈Icc (hl/2) (2*hh)) + refine ⟨t,fun v hv => (Finset.mem_filter.mp hv).2,?_⟩ + intro h hh' + have H (a : ℝ) (ha : a∈Icc (hl-ξ) (hh+ξ)) : ∃ v∈S,|a-v| < ξ/64 := by + obtain ⟨v,hv⟩ := mem_iUnion.mp (hS ha) + obtain ⟨hvs,hva⟩ := mem_iUnion.mp hv + exact ⟨v,hvs,by simpa only [Metric.mem_ball,Real.dist_eq] using hva⟩ + obtain ⟨u,hu,hu'⟩ := H (h-3*ξ/16) ⟨by linarith [hh'.1],by linarith [hh'.2]⟩ + obtain ⟨v,hv,hv'⟩ := H (h+3*ξ/16) ⟨by linarith [hh'.1],by linarith [hh'.2]⟩ + have huabs := abs_lt.mp hu' + have hvabs := abs_lt.mp hv' + constructor + · refine ⟨u,Finset.mem_filter.mpr ⟨hSf.mem_toFinset.mpr hu,?_⟩,by linarith,by linarith⟩ + constructor <;> linarith [hh'.1,hh'.2] + · refine ⟨v,Finset.mem_filter.mpr ⟨hSf.mem_toFinset.mpr hv,?_⟩,by linarith,by linarith⟩ + constructor <;> linarith [hh'.1,hh'.2] + +lemma exists_density_mesh_margin {hl hh ξ : ℝ} (hξ : 0 < ξ) (hξl : ξ < hl) (hlh : hl ≤ hh) : + ∃ ε : ℝ,0 < ε ∧ ∀ h∈Icc hl hh, + Coulomb.tfScalarDensity (h-ξ/8)+ε < Coulomb.tfScalarDensity h ∧ + Coulomb.tfScalarDensity h+ε < Coulomb.tfScalarDensity (h+ξ/8) := by + obtain ⟨ε,hε,hε1,H⟩ := Coulomb.exists_tf_response_margins + (show 0 < ξ/8 by positivity) (show ξ/8 < hl by linarith) hlh + refine ⟨ε,hε,?_⟩ + intro h hh' + have HH := H (θ:=0) (δ:=0) (e:=ε) hh' le_rfl hε.le le_rfl hε.le hε.le le_rfl + simp only [add_zero,mul_one,sub_zero] at HH + constructor <;> linarith [HH.1,HH.2] + +lemma negative_modulus_low_transfer {u v δ lam h ξ : ℝ} + (hξ : 0 < ξ) (hh : ξ < h) (_ : 0 ≤ δ) (hδ1 : δ ≤ 1) + (hδl : δ*lam ≤ ξ/8) (hmod : |v-u| ≤ δ*(lam+max (-u) 0)) (hu : u < h-ξ) : + v < h-3*ξ/4 := by + have H := (abs_le.mp hmod).2 + by_cases hu0 : 0 ≤ u + · rw [max_eq_right (by linarith)] at H + linarith + · have hu0 : u < 0 := lt_of_not_ge hu0 + rw [max_eq_left (by linarith)] at H + nlinarith [mul_nonneg (by linarith : 0 ≤ 1-δ) (neg_nonneg.mpr hu0.le)] + +lemma negative_modulus_high_transfer {u v δ lam h ξ : ℝ} + (hξ : 0 < ξ) (hh : 0 ≤ h) (hδl : δ*lam ≤ ξ/8) + (hmod : |v-u| ≤ δ*(lam+max (-u) 0)) (hu : h+ξ < u) : + h+3*ξ/4 < v := by + have H := (abs_le.mp hmod).1 + rw [max_eq_right (by linarith)] at H + linarith + +theorem inverse_of_space_height_mesh {S : Set Position} {t : Finset Position} + {heights : Finset ℝ} {u d : Position → ℝ} {hl hh ξ ε δ lam η : ℝ} + (hξ : 0 < ξ) (hξl : ξ < hl) (_ : 0 < ε) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) + (hδl : δ*lam ≤ ξ/8) (hη : 0 < η) (hηξ : η ≤ ξ/4) + (hheights : ∀ h∈Icc hl hh, + (∃ v∈heights,h-ξ/4 ≤ v ∧ v ≤ h-ξ/8) ∧ + (∃ v∈heights,h+ξ/8 ≤ v ∧ v ≤ h+ξ/4)) + (hmargin : ∀ h∈Icc hl hh, + Coulomb.tfScalarDensity (h-ξ/8)+ε < Coulomb.tfScalarDensity h ∧ + Coulomb.tfScalarDensity h+ε < Coulomb.tfScalarDensity (h+ξ/8)) + (hmesh : ∀ y∈S,∃ z∈t,|d z-d y| ≤ ε ∧ + |u z-u y| ≤ δ*(lam+max (-u y) 0)) + (hinv : ∀ z∈t,∀ h∈heights, + (Coulomb.tfScalarDensity h ≤ d z → h-η < u z) ∧ + (d z ≤ Coulomb.tfScalarDensity h → u z < h+η)) : + ∀ y∈S,∀ h∈Icc hl hh, + (Coulomb.tfScalarDensity h ≤ d y → h-ξ ≤ u y) ∧ + (d y ≤ Coulomb.tfScalarDensity h → u y ≤ h+ξ) := by + intro y hy h hh' + obtain ⟨z,hz,hden,hfield⟩ := hmesh y hy + obtain ⟨hlo,hhi⟩ := hheights h hh' + obtain ⟨hmlo,hmhi⟩ := hmargin h hh' + have hhξ : ξ < h := hξl.trans_le hh'.1 + have hden' := abs_le.mp hden + constructor + · intro hdy + by_contra hn + have hu : u y < h-ξ := lt_of_not_ge hn + obtain ⟨v,hv,hv0,hv1⟩ := hlo + have hdv : Coulomb.tfScalarDensity v ≤ d z := by + have H := Coulomb.tfScalarDensity_mono hv1 + linarith + have H := (hinv z hz v hv).1 hdv + have H' := negative_modulus_low_transfer hξ hhξ hδ hδ1 hδl hfield hu + linarith + · intro hdy + by_contra hn + have hu : h+ξ < u y := lt_of_not_ge hn + obtain ⟨v,hv,hv0,hv1⟩ := hhi + have hdv : d z ≤ Coulomb.tfScalarDensity v := by + have H := Coulomb.tfScalarDensity_mono hv0 + linarith + have H := (hinv z hz v hv).2 hdv + have H' := negative_modulus_high_transfer hξ (by linarith : 0 ≤ h) hδl hfield hu + linarith +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/NearLpCoulomb.lean b/lean/OAI/Analysis/CoulombRadii/Packets/NearLpCoulomb.lean new file mode 100644 index 0000000000000000000000000000000000000000..38441cebe6c63c42ccb863a3a09f57d8c486562d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/NearLpCoulomb.lean @@ -0,0 +1,119 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.TruncatedCoulomb + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +lemma coulombKernel_fiveHalves_integrableOn_ball (R : ℝ) : + IntegrableOn (fun x : Space => coulombKernel x^(5/2:ℝ)) (Metric.ball 0 R) := by + apply integrableOn_ball_of_norm_le_rpow (C := 1) (α := 5/2) (by simp) (by norm_num) + · filter_upwards [] with x + rw [Real.norm_of_nonneg (Real.rpow_nonneg (coulombKernel_nonneg _) _)] + simp only [coulombKernel,Real.inv_rpow (norm_nonneg _),one_mul] + rw [Real.rpow_neg (norm_nonneg _)] + · exact (coulombKernel_measurable.pow_const _).aestronglyMeasurable + +lemma coulombKernel_fiveHalves_ball_integral {R : ℝ} (hR : 0≤R) : + (∫ x : Space in Metric.ball 0 R, coulombKernel x^(5/2:ℝ)) = + 8*Real.pi*R^(1/2:ℝ) := by + have H := integral_fun_norm_addHaar (volume : Measure Space) + (fun t : ℝ => if t t^(-1/2:ℝ)) t := by + apply setIntegral_congr_fun measurableSet_Ioi + intro t ht + by_cases h : t coulombKernel (y-x)^(5/2:ℝ))= + fun x => (Metric.ball (0:Space) R).indicator (fun z => coulombKernel z^(5/2:ℝ)) (y-x) := by + funext x + have hh : y-x∈Metric.ball (0:Space) R ↔ x∈Metric.ball y R := by + simp only [Metric.mem_ball,dist_eq_norm,sub_zero,norm_sub_rev] + by_cases hx : x∈Metric.ball y R <;> simp [hh,hx] + rw [←integral_indicator measurableSet_ball,he,integral_sub_left_eq_self, + integral_indicator measurableSet_ball,coulombKernel_fiveHalves_ball_integral hR] + +lemma translated_coulomb_memLp_fiveHalves (y : Space) (R : ℝ) : + MemLp (fun x => coulombKernel (y-x)) (ENNReal.ofReal (5/2:ℝ)) + (volume.restrict (Metric.ball y R)) := by + apply (integrable_norm_rpow_iff + ((coulombKernel_measurable.comp (measurable_const.sub measurable_id)).aestronglyMeasurable) + (by norm_num : ENNReal.ofReal (5/2:ℝ)≠0) (by simp)).mp + norm_num only [ENNReal.toReal_ofReal (by norm_num : (0:ℝ)≤5/2)] + change IntegrableOn (fun x => ‖coulombKernel (y-x)‖^(5/2:ℝ)) (Metric.ball y R) + simp only [Real.norm_of_nonneg (coulombKernel_nonneg _)] + rw [←integrable_indicator_iff measurableSet_ball] + have he : (Metric.ball y R).indicator (fun x => coulombKernel (y-x)^(5/2:ℝ))= + fun x => (Metric.ball (0:Space) R).indicator (fun z => coulombKernel z^(5/2:ℝ)) (y-x) := by + funext x + have hh : y-x∈Metric.ball (0:Space) R ↔ x∈Metric.ball y R := by + simp only [Metric.mem_ball,dist_eq_norm,sub_zero,norm_sub_rev] + by_cases hx : x∈Metric.ball y R <;> simp [hh,hx] + rw [he] + exact (integrable_comp_sub_left _ y).mpr + ((coulombKernel_fiveHalves_integrableOn_ball R).integrable_indicator measurableSet_ball) + +theorem near_coulomb_holder {ρ : Space → ℝ} (y : Space) {R : ℝ} (hR : 0≤R) + (hρ : MemLp ρ (ENNReal.ofReal (5/3:ℝ)) (volume.restrict (Metric.ball y R))) + (hp : 0≤ᵐ[volume.restrict (Metric.ball y R)] ρ) : + (∫ x in Metric.ball y R, ρ x*coulombKernel (y-x))≤ + (∫ x in Metric.ball y R, ρ x^(5/3:ℝ))^(3/5:ℝ)* + ((8*Real.pi)^(2/5:ℝ)*R^(1/5:ℝ)) := by + have hc : (5/3:ℝ).HolderConjugate (5/2:ℝ) := by + rw [Real.holderConjugate_iff]; norm_num + have H := integral_mul_le_Lp_mul_Lq_of_nonneg hc hp + (Eventually.of_forall (fun x => coulombKernel_nonneg (y-x))) hρ + (translated_coulomb_memLp_fiveHalves y R) + rw [translated_coulomb_power_ball_integral y hR] at H + norm_num only at H + convert H using 1 + rw [Real.mul_rpow (by positivity : (0:ℝ)≤8*Real.pi) (Real.rpow_nonneg hR _), + ←Real.rpow_mul hR] + norm_num + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/NormalizedBandModulus.lean b/lean/OAI/Analysis/CoulombRadii/Packets/NormalizedBandModulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7d31de62254b5bc295a023afbb29462db1cf16c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/NormalizedBandModulus.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.UniformGroundStateCountControl +import OAI.Analysis.CoulombRadii.Packets.AtomicMesh +import OAI.Analysis.CoulombRadii.RandomFields.ObservationSmallScale +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma norm_pow_difference_bound {R : ℝ} (hR : 0 ≤ R) {y z : Position} + (hy : ‖y‖ ≤ R) (hz : ‖z‖ ≤ R) (k : ℕ) : + |‖z‖^k-‖y‖^k| ≤ ‖z-y‖*k*R^(k-1) := by + have H := abs_pow_sub_pow_le (a:=‖z‖) (b:=‖y‖) (n:=k) + simp only [abs_of_nonneg (norm_nonneg _)] at H + apply H.trans + exact mul_le_mul_of_nonneg + (mul_le_mul_of_nonneg_right (abs_norm_sub_norm_le z y) (Nat.cast_nonneg _)) + (pow_le_pow_left₀ (by positivity) (max_le hz hy) _) + (by positivity) (pow_nonneg hR _) + +lemma normalized_density_difference {ρ : Position → ℝ} {r L P Q : ℝ} + (hr : 0 < r) (hL : 1 ≤ L) (hP : 0 ≤ P) (hQ : 0 ≤ Q) + {y z : Position} (_ : r ≤ ‖y‖) (hy1 : ‖y‖ ≤ 4*L*r) + (hz0 : r ≤ ‖z‖) (hz1 : ‖z‖ ≤ 4*L*r) + (hρ0 : 0 ≤ ρ y) (hρ : ρ y ≤ P/r^6) + (hlip : |ρ z-ρ y| ≤ (Q/r^7)*‖z-y‖) : + |‖z‖^6*ρ z-‖y‖^6*ρ y| ≤ + ((4*L)^6*Q+6*(4*L)^5*P)*(‖z-y‖/r) := by + have he : ‖z‖^6*ρ z-‖y‖^6*ρ y=‖z‖^6*(ρ z-ρ y)+(‖z‖^6-‖y‖^6)*ρ y := by ring + rw [he] + apply (abs_add_le _ _).trans + rw [abs_mul,abs_mul,abs_of_nonneg (pow_nonneg (norm_nonneg z) 6),abs_of_nonneg hρ0] + have hdist := norm_pow_difference_bound (by positivity : 0 ≤ 4*L*r) hy1 hz1 6 + norm_num only [Nat.cast_ofNat,Nat.reduceSub] at hdist + calc + _ ≤ (4*L*r)^6*((Q/r^7)*‖z-y‖)+(‖z-y‖*6*(4*L*r)^5)*(P/r^6) := + add_le_add + (mul_le_mul_of_nonneg (pow_le_pow_left₀ (hr.le.trans hz0) hz1 6) hlip + (pow_nonneg (norm_nonneg z) 6) + (mul_nonneg (div_nonneg hQ (pow_nonneg hr.le _)) (norm_nonneg _))) + (mul_le_mul_of_nonneg hdist hρ (abs_nonneg _) + (div_nonneg hP (pow_nonneg hr.le _))) + _ = _ := by field_simp + +lemma normalized_field_difference {F : Position → ℝ} {r L C M lam : ℝ} + (hr : 0 < r) (hL : 1 ≤ L) (hC : 0 ≤ C) (hM : 0 ≤ M) (hlam : 1 ≤ lam) + {y z : Position} (hy0 : r ≤ ‖y‖) (hy1 : ‖y‖ ≤ 4*L*r) + (_ : r ≤ ‖z‖) (hz1 : ‖z‖ ≤ 4*L*r) + (hcap : ‖y‖^4*F y ≤ M) + (hosc : |F z-F y| ≤ C*(‖z-y‖/r)*(lam/r^4+max (-F y) 0)) : + |‖z‖^4*F z-‖y‖^4*F y| ≤ + ((4*L)^4*C+4*(4*L)^3*max M 1)*(‖z-y‖/r)*(lam+max (-(‖y‖^4*F y)) 0) := by + let N := max (-(‖y‖^4*F y)) 0 + have hN : 0 ≤ N := le_max_right _ _ + have hyn : 0 < ‖y‖ := hr.trans_le hy0 + have hFy : F y ≤ M/r^4 := by + calc + _ ≤ M/‖y‖^4 := (le_div_iff₀ (pow_pos hyn 4)).mpr (by simpa only [mul_comm] using hcap) + _ ≤ M/r^4 := div_le_div_of_nonneg_left hM (pow_pos hr 4) (pow_le_pow_left₀ hr.le hy0 4) + have hneg : max (-F y) 0 ≤ N/r^4 := by + apply (le_div_iff₀ (pow_pos hr 4)).mpr + have he : N=‖y‖^4*max (-F y) 0 := by + dsimp [N] + rw [mul_max_of_nonneg _ _ (pow_nonneg (norm_nonneg y) 4),mul_zero,mul_neg] + rw [he] + calc + max (-F y) 0 * r^4 = r^4 * max (-F y) 0 := mul_comm _ _ + _ ≤ ‖y‖^4 * max (-F y) 0 := + mul_le_mul_of_nonneg_right (pow_le_pow_left₀ hr.le hy0 4) (le_max_right _ _) + have habs : |F y| ≤ (M+N)/r^4 := by + rw [abs_le] + constructor + · have H := (le_max_left (-F y) 0).trans hneg + have hMN : N/r^4 ≤ (M+N)/r^4 := div_le_div_of_nonneg_right (by linarith) (pow_nonneg hr.le 4) + linarith + · exact hFy.trans (div_le_div_of_nonneg_right (by linarith) (pow_nonneg hr.le 4)) + have hFdiff : |F z-F y| ≤ C*(‖z-y‖/r)*((lam+N)/r^4) := by + apply hosc.trans + apply mul_le_mul_of_nonneg_left _ (by positivity) + rw [add_div] + gcongr + have hdist := norm_pow_difference_bound (by positivity : 0 ≤ 4*L*r) hy1 hz1 4 + norm_num only [Nat.cast_ofNat,Nat.reduceSub] at hdist + have hMN : M+N ≤ max M 1*(lam+N) := by + have hm0 : 0 ≤ max M 1 := le_trans (by norm_num) (le_max_right _ _) + have hm1 := le_max_right M (1:ℝ) + have H := mul_le_mul_of_nonneg_left hlam hm0 + have HN := mul_le_mul_of_nonneg_right hm1 hN + nlinarith [le_max_left M (1:ℝ)] + have he : ‖z‖^4*F z-‖y‖^4*F y=‖z‖^4*(F z-F y)+(‖z‖^4-‖y‖^4)*F y := by ring + rw [he] + apply (abs_add_le _ _).trans + rw [abs_mul,abs_mul,abs_of_nonneg (pow_nonneg (norm_nonneg z) 4)] + calc + _ ≤ (4*L*r)^4*(C*(‖z-y‖/r)*((lam+N)/r^4))+ + (‖z-y‖*4*(4*L*r)^3)*((M+N)/r^4) := + add_le_add + (mul_le_mul (pow_le_pow_left₀ (norm_nonneg z) hz1 4) hFdiff (abs_nonneg _) (by positivity)) + (mul_le_mul hdist habs (abs_nonneg _) (by positivity)) + _ ≤ (4*L*r)^4*(C*(‖z-y‖/r)*((lam+N)/r^4))+ + (‖z-y‖*4*(4*L*r)^3)*((max M 1*(lam+N))/r^4) := by gcongr + _ = _ := by field_simp; ring +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace NeutralAtom + +lemma mesh_width_ratio_formula {c r : ℝ} (hc : 0 < c) (hr : 0 < r) : + r/(c*(r/3)*(r/3)^packetExponent) = + (3^(1+packetExponent)/c)*r^(-packetExponent) := by + rw [Real.div_rpow hr.le (by norm_num : (0:ℝ) ≤ 3), + Real.rpow_add (by norm_num : (0:ℝ) < 3),Real.rpow_one, + Real.rpow_neg hr.le] + field_simp + +lemma mesh_width_power_tendsto {c : ℝ} (hc : 0 < c) (k : ℕ) + (hk : (k:ℝ)*packetExponent < 1) : + Tendsto (fun r : ℝ => r*(r/(c*(r/3)*(r/3)^packetExponent))^k) (𝓝[>] 0) (𝓝 0) := by + have H := (tendsto_positive_rpow_zero (show 0 < 1-(k:ℝ)*packetExponent by linarith)).const_mul + ((3^(1+packetExponent)/c)^k) + simp only [mul_zero] at H + apply H.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hr : 0 < r := hr + rw [mesh_width_ratio_formula hc hr,mul_pow,←Real.rpow_natCast (r^(-packetExponent)) k, + ←Real.rpow_mul hr.le] + have he : 1-(k:ℝ)*packetExponent=1+(-packetExponent*(k:ℝ)) := by ring + rw [he,Real.rpow_add hr,Real.rpow_one] + ring + +lemma mesh_normalized_density_bound {r L τ B D K : ℝ} {ρ : Position → ℝ} + (hr : 0 < r) (hL : 1 ≤ L) (hτ : 0 < τ) (hτr : τ ≤ r) + (hB : 0 ≤ B) (hD : 0 ≤ D) (hK : 0 ≤ K) + {y z : Position} (hy0 : r ≤ ‖y‖) (hy1 : ‖y‖ ≤ 4*L*r) + (hz0 : r ≤ ‖z‖) (hz1 : ‖z‖ ≤ 4*L*r) (hdist : ‖z-y‖ ≤ r^2) + (hρ0 : 0 ≤ ρ y) (hρ : ρ y ≤ (B/τ^3)*(K/r^3)) + (hlip : |ρ z-ρ y| ≤ (D/τ^4)*‖z-y‖*(K/r^3)) : + |‖z‖^6*ρ z-‖y‖^6*ρ y| ≤ + ((4*L)^6*(D*K)+6*(4*L)^5*(B*K))*(r*(r/τ)^4) := by + have ht : 1 ≤ r/τ := (le_div_iff₀ hτ).mpr (by simpa using hτr) + have hρ' : ρ y ≤ (B*K*(r/τ)^3)/r^6 := hρ.trans_eq (by field_simp) + have hlip' : |ρ z-ρ y| ≤ ((D*K*(r/τ)^4)/r^7)*‖z-y‖ := hlip.trans_eq (by field_simp) + have H := normalized_density_difference hr hL (by positivity : 0 ≤ B*K*(r/τ)^3) + (by positivity : 0 ≤ D*K*(r/τ)^4) hy0 hy1 hz0 hz1 hρ0 hρ' hlip' + have hpow : (r/τ)^3 ≤ (r/τ)^4 := pow_le_pow_right₀ ht (by omega) + have hd : ‖z-y‖/r ≤ r := (div_le_iff₀ hr).mpr (by nlinarith) + calc + _ ≤ ((4*L)^6*(D*K*(r/τ)^4)+6*(4*L)^5*(B*K*(r/τ)^3))*(‖z-y‖/r) := H + _ ≤ ((4*L)^6*(D*K*(r/τ)^4)+6*(4*L)^5*(B*K*(r/τ)^4))*r := by gcongr + _ = _ := by ring + +lemma inverse_count_ball_subset {c r₀ s r L : ℝ} {y : Position} + (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) (hr : 0 < r) (hL : 1 ≤ L) + (hr₀r : r₀ ≤ r) (hy0 : r ≤ ‖y‖) (hy1 : ‖y‖ ≤ 4*L*r) + (hw : c*s^packetExponent ≤ 1/100) (ha : (Coulomb.atomicCellScale y)^(6/5:ℝ) ≤ Coulomb.atomicCellScale y) + (he : Real.sqrt 3*r^(101/100:ℝ) ≤ r/12) : + Metric.closedBall y (2*packetWidth c r₀ s y+2*(Coulomb.atomicCellScale y)^(6/5:ℝ)+ + 2*(Real.sqrt 3*r^(101/100:ℝ))) ⊆ + {z : Position | r/4 ≤ ‖z‖ ∧ ‖z‖ ≤ 12*L*r} := by + have hwidth : packetWidth c r₀ s y ≤ ‖y‖/100 := by + have H := packetWidth_le c r₀ s hc.le hr₀ hs y + rw [max_eq_left (hr₀r.trans hy0)] at H + exact H.trans ((mul_le_mul_of_nonneg_right hw (norm_nonneg y)).trans_eq (by ring)) + have ha' : 2*(Coulomb.atomicCellScale y)^(6/5:ℝ) ≤ ‖y‖/100 := by + dsimp [Coulomb.atomicCellScale] at ha ⊢ + linarith + intro z hz + have hdist : ‖z-y‖ ≤ 3*‖y‖/100+r/6 := by + have H : ‖z-y‖ ≤ 2*packetWidth c r₀ s y+2*(Coulomb.atomicCellScale y)^(6/5:ℝ)+ + 2*(Real.sqrt 3*r^(101/100:ℝ)) := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hz + linarith + have hz' := norm_le_norm_add_norm_sub y z + have hy' := norm_le_norm_add_norm_sub z y + rw [norm_sub_rev y z] at hz' + have hLr := mul_le_mul_of_nonneg_right hL hr.le + constructor <;> nlinarith +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/NormalizedInversePoint.lean b/lean/OAI/Analysis/CoulombRadii/Packets/NormalizedInversePoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..84bbd33c074c0fc00b04d910b8cf7d739b7d77bb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/NormalizedInversePoint.lean @@ -0,0 +1,211 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.InverseGeometry +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalPosteriorInverse +import OAI.Analysis.CoulombRadii.Packets.NormalizedBandModulus + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma atomic_response_normalization (h : ℝ) {y : Position} (hy : y≠0) : + Coulomb.tfScalarDensity (h/100000^4)/(Coulomb.atomicCellScale y)^6 = + Coulomb.tfScalarDensity h/‖y‖^6 := by + rw [Coulomb.tfScalarDensity_scale _ (by norm_num : (0:ℝ) < 100000)] + dsimp [Coulomb.atomicCellScale] + field_simp [norm_ne_zero_iff.mpr hy] + +lemma atomic_field_normalization (h η : ℝ) {y : Position} : + (h/100000^4-2*(η/(8*100000^4)))/(Coulomb.atomicCellScale y)^4=(h-η/4)/‖y‖^4 ∧ + (h/100000^4+2*(η/(8*100000^4)))/(Coulomb.atomicCellScale y)^4=(h+η/4)/‖y‖^4 := by + dsimp [Coulomb.atomicCellScale] + constructor <;> ring + +theorem physical_normalized_inverse_point (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z,1 < ‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) + (hrad : ∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) + {D c L K hl hh ξ : ℝ} (hD : 0 ≤ D) (hc : 0 < c) (hL : 1 ≤ L) + (hK : 0 ≤ K) (hξ : 0 < ξ) (hξl : ξ < hl) (hlh : hl ≤ hh) : + ∃ s₀ : ℝ,0 < s₀ ∧ s₀ ≤ 1 ∧ + ∀ {N J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction (N+1)} {g : Gradient (N+1)}, + ∀ (hd : FormDomain ψ g) (hn : normSquared ψ=1), + (∀ (χ : Wavefunction (N+1)) (h : Gradient (N+1)),FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) → + ∀ {E : ℝ},(E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D → ∀ {r₀ s : ℝ},0 < r₀ → 0 < s → s < s₀ → + c*(1+packetExponent)*s^packetExponent ≤ 1/4 → c*s^packetExponent ≤ 1/100 → + (4*L/100000)*s ≤ 1 → ∀ (j : Fin J),r₀*2^j.val ≤ s → + Real.sqrt 3*(r₀*2^j.val)^(101/100:ℝ) ≤ (r₀*2^j.val)/12 → + ∀ (y : Position),r₀*2^j.val ≤ ‖y‖ → ‖y‖ ≤ 4*L*(r₀*2^j.val) → + ∀ h∈Icc hl hh, + letI := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + let r := fun l : Fin J => r₀*2^l.val + let μ := fun z => conditionalPacketDensity P Prod.fst (tailObservation r j.val) g₀ c r₀ s + (tailObservation r j.val z) + let cnt := fun z => rawCount {x : Position | (r j)/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*(r j)} (observedOrdered r j z) + let f := fun z => (Z:ℝ)*coulombKernel y-potentialOf (μ z) y + P.real {z | cnt z ≤ K/(r j)^3 ∧ Coulomb.tfScalarDensity h ≤ ‖y‖^6*μ z y ∧ ‖y‖^4*f z ≤ h-ξ/4} + ≤ (r j)^42 ∧ + P.real {z | cnt z ≤ K/(r j)^3 ∧ ‖y‖^6*μ z y ≤ Coulomb.tfScalarDensity h ∧ h+ξ/4 ≤ ‖y‖^4*f z} + ≤ (r j)^42 := by + let A := 4*L/100000 + let κ := c*100000/(max 1 A)^packetExponent + let Λ := (100000:ℝ)^(101/100:ℝ) + have hA : 0 < A := by dsimp [A]; positivity + have hκ : 0 < κ := by dsimp [κ]; positivity + obtain ⟨s₀,hs₀,hs₀1,H⟩ := physical_posterior_inverse_point g₀ hg hm hrad hD hc hA hκ + (show 0 ≤ Λ by dsimp [Λ]; positivity) (by positivity : 0 ≤ K*A^3) + (by positivity : 0 ≤ 100000*c) (by positivity : 0 < ξ/(8*100000^4)) + (show ξ/(8*100000^4) < hl/100000^4 by linarith) + (show hl/100000^4 ≤ hh/100000^4 by gcongr) + refine ⟨s₀,hs₀,hs₀1,?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE hbase r₀ s hr₀ hs hss hscale hwidth hsA j hrj hnoise y hy0 hy1 h hh' + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let r : Fin J → ℝ := fun l => r₀*2^l.val + have hr : 0 < r j := by dsimp [r]; positivity + have hr₀r : r₀ ≤ r j := le_mul_of_one_le_right hr₀.le (one_le_pow₀ (by norm_num)) + have hy : y≠0 := norm_pos_iff.mp (hr.trans_le hy0) + have ha : 0 < Coulomb.atomicCellScale y := Coulomb.atomicCellScale_pos hy + have hya : Coulomb.atomicCellScale y ≤ A*(r j) := by dsimp [A,Coulomb.atomicCellScale]; linarith + obtain ⟨hw,hwa,hell⟩ := physical_inverse_width_geometry hc hr₀ hr hs hA + (hr₀r.trans hy0) hy0 hya hrj + have ha1 : Coulomb.atomicCellScale y ≤ 1 := + (hya.trans (mul_le_mul_of_nonneg_left hrj hA.le)).trans hsA + have hball := inverse_count_ball_subset hc hr₀ hs hr hL hr₀r hy0 hy1 hwidth + (Real.rpow_le_self_of_le_one ha.le ha1 (by norm_num : (1:ℝ) ≤ 6/5)) hnoise + have H' := H Z hZ hd hn hmin hE hbase hr₀ hs hss hscale j.val hrj + ⟨j,le_rfl⟩ y hy (hr₀r.trans hy0) hya hw hwa hell + (show h/100000^4∈Icc (hl/100000^4) (hh/100000^4) by + constructor + · exact div_le_div_of_nonneg_right hh'.1 (by norm_num) + · exact div_le_div_of_nonneg_right hh'.2 (by norm_num)) + dsimp only at H' + rw [atomic_response_normalization h hy,(atomic_field_normalization h ξ).1, + (atomic_field_normalization h ξ).2] at H' + have h6 := pow_pos (hr.trans_le hy0) 6 + have h4 := pow_pos (hr.trans_le hy0) 4 + constructor + · apply le_trans (measureReal_mono (μ:=P) ?_) H'.1 + intro z hz + refine ⟨(rawCount_mono (observedOrdered r j z) hball).trans + (hz.1.trans (physical_inverse_count_rescale hK hA hr ha hya)),?_,?_⟩ + · exact (div_le_iff₀ h6).mpr (by simpa only [mul_comm] using hz.2.1) + · exact (le_div_iff₀ h4).mpr (by simpa only [mul_comm] using hz.2.2) + · apply le_trans (measureReal_mono (μ:=P) ?_) H'.2 + intro z hz + refine ⟨(rawCount_mono (observedOrdered r j z) hball).trans + (hz.1.trans (physical_inverse_count_rescale hK hA hr ha hya)),?_,?_⟩ + · exact (le_div_iff₀ h6).mpr (by simpa only [mul_comm] using hz.2.1) + · exact (div_le_iff₀ h4).mpr (by simpa only [mul_comm] using hz.2.2) +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma separated_mesh_volume_bound (t : Finset Position) {R ε : ℝ} + (hR : 0 ≤ R) (hε : 0 < ε) (hball : ∀ x∈t,‖x‖ ≤ R) + (hsep : ∀ x∈t,∀ y∈t,x≠y → ε < ‖x-y‖) : + (t.card:ℝ)*(ε/3)^3 ≤ (R+ε/3)^3 := by + have hdis : Set.PairwiseDisjoint (t:Set Position) (fun x => Metric.closedBall x (ε/3)) := by + intro x hx y hy hxy + apply Metric.closedBall_disjoint_closedBall + rw [dist_eq_norm] + linarith [hsep x hx y hy hxy] + have hsub : (⋃ x∈t,Metric.closedBall x (ε/3)) ⊆ Metric.closedBall (0:Position) (R+ε/3) := by + apply iUnion₂_subset + intro x hx y hy + rw [Metric.mem_closedBall,dist_zero_right] + have hh : ‖y-x‖ ≤ ε/3 := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hy + have ht := norm_le_norm_add_norm_sub x y + rw [norm_sub_rev x y] at ht + linarith [hball x hx] + have H := measureReal_mono (μ:=volume) hsub (isCompact_closedBall (0:Position) (R+ε/3)).measure_ne_top + rw [measureReal_biUnion_finset hdis (fun _ _ => measurableSet_closedBall) + (fun x _ => (isCompact_closedBall x (ε/3)).measure_ne_top), + Coulomb.volume_closedBall_three _ (by positivity : 0 ≤ R+ε/3)] at H + simp_rw [Coulomb.volume_closedBall_three _ (by positivity : 0 ≤ ε/3)] at H + simp only [Finset.sum_const,nsmul_eq_mul] at H + have he : (t.card:ℝ)*(4*Real.pi/3*(ε/3)^3)=(4*Real.pi/3)*((t.card:ℝ)*(ε/3)^3) := by ring + rw [he] at H + exact (mul_le_mul_iff_right₀ (by positivity : 0 < 4*Real.pi/3)).mp H + +theorem exists_quantitative_mesh (S : Set Position) {R ε : ℝ} + (hR : 0 ≤ R) (hε : 0 < ε) (hball : ∀ x∈S,‖x‖ ≤ R) : + ∃ t : Finset Position,(↑t:Set Position) ⊆ S ∧ + (∀ y∈S,∃ x∈t,‖y-x‖ ≤ ε) ∧ + (t.card:ℝ)*(ε/3)^3 ≤ (R+ε/3)^3 := by + let P := fun t : Finset Position => (↑t:Set Position) ⊆ S ∧ + (∀ x∈t,∀ y∈t,x≠y → ε < ‖x-y‖) + let A := {k : ℕ | ∃ t : Finset Position,t.card=k ∧ P t} + have hb (k : ℕ) (hk : k∈A) : k ≤ ⌈(R+ε/3)^3/(ε/3)^3⌉₊ := by + obtain ⟨t,rfl,ht⟩ := hk + have H := separated_mesh_volume_bound t hR hε (fun x hx => hball x (ht.1 hx)) ht.2 + have hh : (t.card:ℝ) ≤ (R+ε/3)^3/(ε/3)^3 := (le_div_iff₀ (by positivity)).mpr H + exact_mod_cast hh.trans (Nat.le_ceil _) + have hAf : A.Finite := (Set.finite_Iic ⌈(R+ε/3)^3/(ε/3)^3⌉₊).subset hb + have hAn : A.Nonempty := ⟨0,∅,by simp,by simp [P]⟩ + obtain ⟨k,hkf,hmaxf⟩ := hAf.toFinset.exists_max_image (fun k : ℕ => k) + (by simpa only [Set.Finite.toFinset_nonempty] using hAn) + have hk : k∈A := hAf.mem_toFinset.mp hkf + have hmax (l : ℕ) (hl : l∈A) : l ≤ k := hmaxf l (hAf.mem_toFinset.mpr hl) + obtain ⟨t,htk,ht⟩ := hk + refine ⟨t,ht.1,?_,separated_mesh_volume_bound t hR hε (fun x hx => hball x (ht.1 hx)) ht.2⟩ + intro y hy + by_contra hh + push Not at hh + have hyn : y∉t := by + intro hyt + have H := hh y hyt + simp only [sub_self,norm_zero] at H + linarith + have hP : P (insert y t) := by + constructor + · intro x hx + rcases Finset.mem_insert.mp hx with rfl|hx + · exact hy + · exact ht.1 hx + · intro x hx z hz hxz + by_cases hxy : x=y + · subst x + have hz' : z∈t := (Finset.mem_insert.mp hz).resolve_left (Ne.symm hxz) + exact hh z hz' + · have hx' : x∈t := (Finset.mem_insert.mp hx).resolve_left hxy + by_cases hzy : z=y + · subst z + simpa only [norm_sub_rev] using hh x hx' + · have hz' : z∈t := (Finset.mem_insert.mp hz).resolve_left hzy + exact ht.2 x hx' z hz' hxz + have HM := hmax (insert y t).card ⟨insert y t,rfl,hP⟩ + simp only [Finset.card_insert_of_notMem hyn,←htk] at HM + omega + +theorem exists_atomic_band_mesh {L r : ℝ} (hL : 1 ≤ L) (hr : 0 < r) (hr1 : r ≤ 1) : + ∃ t : Finset Position,(∀ y∈t,r ≤ ‖y‖ ∧ ‖y‖ ≤ 4*L*r) ∧ + (∀ y : Position,r ≤ ‖y‖ → ‖y‖ ≤ 4*L*r → ∃ z∈t,‖y-z‖ ≤ r^2) ∧ + (t.card:ℝ) ≤ (12*L+1)^3/r^3 := by + let S := {y : Position | r ≤ ‖y‖ ∧ ‖y‖ ≤ 4*L*r} + obtain ⟨t,ht,hcover,hcard⟩ := exists_quantitative_mesh S (R:=4*L*r) (ε:=r^2) + (by positivity) (by positivity) (fun _ h => h.2) + refine ⟨t,fun y hy => ht hy,fun y hy0 hy1 => hcover y ⟨hy0,hy1⟩,?_⟩ + have hroot : 4*L*r+r^2/3 ≤ r*(4*L+1/3) := by nlinarith + have Hpow := pow_le_pow_left₀ (by positivity : 0 ≤ 4*L*r+r^2/3) hroot 3 + have H : (t.card:ℝ)*(r^2/3)^3 ≤ (r*(4*L+1/3))^3 := hcard.trans Hpow + apply (le_div_iff₀ (pow_pos hr 3)).mpr + nlinarith [pow_pos hr 3] +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/OrbitalKernel.lean b/lean/OAI/Analysis/CoulombRadii/Packets/OrbitalKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..2cc7dd991f54fa61a294cc98982e62a3997487c4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/OrbitalKernel.lean @@ -0,0 +1,134 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.TwoBodyTensorIntegrable + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +noncomputable def orbitalKernel {A : Type*} {n : ℕ} (v : Fin n → A → ℂ) (x y : A) : ℂ := + ∑ i, star (v i y) * v i x + +lemma complex_star_mul_self (z : ℂ) : star z * z = (↑(‖z‖^2) : ℂ) := by + rw [mul_comm, Complex.ofReal_pow] + exact inner_self_eq_norm_sq_to_K (𝕜 := ℂ) z + +lemma exchange_algebra {A : Type*} {n : ℕ} (v : Fin n → A → ℂ) (x y : A) : + (∑ i, ∑ j, (star (v i x) * v j x) * (star (v j y) * v i y)) = + (↑(‖orbitalKernel v x y‖^2) : ℂ) := by + rw [← complex_star_mul_self] + simp only [orbitalKernel, star_sum, star_mul, star_star, Finset.sum_mul, Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + ring + +lemma exchange_integral {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℝ) + (hw : ∀ i j, Integrable (fun xy : A × A => (w xy.1 xy.2 : ℂ) * + ((star (v i xy.1) * v j xy.1) * (star (v j xy.2) * v i xy.2))) (μ.prod μ)) : + (∑ i, ∑ j, ∫ xy : A × A, (w xy.1 xy.2 : ℂ) * + ((star (v i xy.1) * v j xy.1) * (star (v j xy.2) * v i xy.2)) ∂(μ.prod μ)) = + (((∫ xy : A × A, w xy.1 xy.2 * ‖orbitalKernel v xy.1 xy.2‖^2 ∂(μ.prod μ)) : ℝ) : ℂ) := by + calc + _ = ∫ xy : A × A, ∑ i, ∑ j, (w xy.1 xy.2 : ℂ) * + ((star (v i xy.1) * v j xy.1) * (star (v j xy.2) * v i xy.2)) ∂(μ.prod μ) := by + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun j _ => hw i j))] + apply Finset.sum_congr rfl + intro i _ + exact (integral_finsetSum _ (fun j _ => hw i j)).symm + _ = ∫ xy : A × A, ((w xy.1 xy.2 * ‖orbitalKernel v xy.1 xy.2‖^2 : ℝ) : ℂ) + ∂(μ.prod μ) := by + apply integral_congr_ae + filter_upwards [] with xy + simp_rw [← Finset.mul_sum] + rw [exchange_algebra, Complex.ofReal_mul] + _ = _ := integral_complex_ofReal + +lemma determinant_two_body_real {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℝ) + (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) + (hw : ∀ a b c d, Integrable (fun xy : A × A => (w xy.1 xy.2 : ℂ) * + ((star (v a xy.1) * v c xy.1) * (star (v b xy.2) * v d xy.2))) (μ.prod μ)) : + (∫ x : Fin n → A, (∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * + ‖determinantWave v x‖^2 ∂(Measure.pi fun _ => μ)) = + (n.factorial : ℝ) * ((∑ i, ∑ j, ∫ xy : A × A, + w xy.1 xy.2 * (‖v i xy.1‖^2 * ‖v j xy.2‖^2) ∂(μ.prod μ)) - + ∫ xy : A × A, w xy.1 xy.2 * ‖orbitalKernel v xy.1 xy.2‖^2 ∂(μ.prod μ)) := by + have H := determinant_two_body_integral v (fun x y => (w x y : ℂ)) hv ho hw + simp only [Finset.sum_sub_distrib] at H + rw [exchange_integral v w (fun i j => hw i j j i)] at H + simp_rw [complex_star_mul_self] at H + apply Complex.ofReal_injective + push_cast + simpa only [← Complex.ofReal_sum, ← Complex.ofReal_mul, integral_complex_ofReal, + Complex.ofReal_natCast] using H + +lemma slaterWave_two_body_upper {A : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] {n : ℕ} (v : Fin n → A → ℂ) (w : A → A → ℝ) + (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ a b, (∫ x, star (v a x) * v b x ∂μ) = if a = b then (1:ℂ) else 0) + (hw : ∀ a b c d, Integrable (fun xy : A × A => (w xy.1 xy.2 : ℂ) * + ((star (v a xy.1) * v c xy.1) * (star (v b xy.2) * v d xy.2))) (μ.prod μ)) + (hw0 : ∀ x y, 0 ≤ w x y) : + (∫ x : Fin n → A, (∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * + ‖slaterWave v x‖^2 ∂(Measure.pi fun _ => μ)) ≤ + ∑ i, ∑ j, ∫ xy : A × A, w xy.1 xy.2 * (‖v i xy.1‖^2 * ‖v j xy.2‖^2) + ∂(μ.prod μ) := by + have hn : (0:ℝ) < n.factorial := Nat.cast_pos.mpr (Nat.factorial_pos n) + have he (x : Fin n → A) : (∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * + ‖slaterWave v x‖^2 = (n.factorial : ℝ)⁻¹ * + ((∑ i, ∑ j ∈ Finset.univ.erase i, w (x i) (x j)) * ‖determinantWave v x‖^2) := by + simp only [slaterWave, norm_mul, mul_pow, norm_inv, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (Real.sqrt_nonneg _), inv_pow, Real.sq_sqrt hn.le] + ring + simp_rw [he] + rw [integral_const_mul, determinant_two_body_real v w hv ho hw, + ← mul_assoc, inv_mul_cancel₀ hn.ne', one_mul] + exact sub_le_self _ (integral_nonneg (fun xy => mul_nonneg (hw0 _ _) (sq_nonneg _))) + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/OriginalPotentialTower.lean b/lean/OAI/Analysis/CoulombRadii/Packets/OriginalPotentialTower.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5ad04e563c22bc92a797db20fecb9d898b2857e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/OriginalPotentialTower.lean @@ -0,0 +1,136 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalMatching + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace NeutralAtom + +theorem rawPacketPotential_uniform {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z, g z^2)=1) + {c r₀ s : ℝ} (hc : 0 coulombKernel (y-z)*rawPacketDensity g c r₀ s x z) ∧ + 0≤potentialOf (rawPacketDensity g c r₀ s x) y ∧ + potentialOf (rawPacketDensity g c r₀ s x) y≤B := by + obtain ⟨A,hA,hAb⟩ := compact_packet_function_bound hg hgs + let M : ℝ := n*((c*r₀*(min r₀ s)^packetExponent)^(-3:ℤ)*A) + have hM : 0≤M := by dsimp [M]; positivity + refine ⟨2*Real.pi*M+n,by positivity,?_⟩ + intro x y + have hρ := rawPacketDensity_integrable g hm hc hr hs x + have hρm : Measurable (rawPacketDensity g c r₀ s x) := + ((continuous_rawPacketDensity hg hc hr hs).comp + ((continuous_const (y := x)).prodMk continuous_id)).measurable + have hρ0 := rawPacketDensity_nonneg g hc hr hs x + have hρM : ∀ z,rawPacketDensity g c r₀ s x z≤M := + rawPacketDensity_bound hA hAb hc hr hs x + refine ⟨Coulomb.coulomb_convolution_integrable hρ hρm hρ0 hρM + (by norm_num : (0:ℝ)<1) y,integral_nonneg (fun z => + mul_nonneg (coulombKernel_nonneg _) (hρ0 z)),?_⟩ + simpa [potentialOf,coulombKernel,Coulomb.coulombKernel,rawPacketDensity_mass g hm hc hr hs] using + Coulomb.coulomb_convolution_bound hρ hρm hρ0 hρM (by norm_num : (0:ℝ)<1) y + +lemma measurable_rawPacketPotential {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + {c r₀ s : ℝ} (hc : 0 potentialOf (rawPacketDensity g c r₀ s x) y) := by + have hi : Measurable (fun xz : Configuration n × Position => + coulombKernel (y-xz.2)*rawPacketDensity g c r₀ s xz.1 xz.2) := + (measurable_coulombKernel.comp (measurable_const.sub measurable_snd)).mul + (continuous_rawPacketDensity hg hc hr hs).measurable + exact hi.stronglyMeasurable.integral_prod_right'.measurable + +lemma integrable_rawPacketPotential {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r₀ s : ℝ} (hc : 0 potentialOf (rawPacketDensity g c r₀ s x) y) ν := by + obtain ⟨B,hB,H⟩ := rawPacketPotential_uniform (n := n) hg hgs hm hc hr hs + apply (integrable_const B).mono' (measurable_rawPacketPotential hg hc hr hs y).aestronglyMeasurable + exact Eventually.of_forall (fun x => by simpa [Real.norm_of_nonneg (H x y).2.1] using (H x y).2.2) + +theorem mixturePacketPotential {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r₀ s : ℝ} (hc : 0 + coulombKernel (y-xz.2)*rawPacketDensity g c r₀ s xz.1 xz.2) := + (measurable_coulombKernel.comp (measurable_const.sub measurable_snd)).mul + (continuous_rawPacketDensity hg hc hr hs).measurable + have hi : Integrable (fun xz : Configuration n × Position => + coulombKernel (y-xz.2)*rawPacketDensity g c r₀ s xz.1 xz.2) (ν.prod volume) := by + apply (integrable_prod_iff hmeas.aestronglyMeasurable).mpr + refine ⟨Eventually.of_forall (fun x => (H x y).1),?_⟩ + have he : (fun x : Configuration n => ∫ z, ‖coulombKernel (y-z)*rawPacketDensity g c r₀ s x z‖)= + fun x => potentialOf (rawPacketDensity g c r₀ s x) y := by + funext x + simp only [potentialOf,Real.norm_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (rawPacketDensity_nonneg g hc hr hs x _))] + rw [he] + exact integrable_rawPacketPotential hg hgs hm hc hr hs ν y + change (∫ z, coulombKernel (y-z)*(∫ x,rawPacketDensity g c r₀ s x z ∂ν))=_ + simp_rw [←integral_const_mul] + exact integral_integral_swap hi.swap + +theorem conditionalPacketPotential_eq_condExp {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + {raw : Ω → Configuration n} {obs : Ω → B} + (hraw : MeasurePreserving raw P ν) (hobs : Measurable obs) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} (hc : 0 potentialOf (conditionalPacketDensity P raw obs g c r₀ s (obs sample)) y) =ᵐ[P] + P[fun sample => potentialOf (rawPacketDensity g c r₀ s (raw sample)) y | + MeasurableSpace.comap obs inferInstance] := by + have he := ProbabilityTheory.condExp_ae_eq_integral_condDistrib hobs hraw.measurable.aemeasurable + (measurable_rawPacketPotential hg hc hr hs y).stronglyMeasurable + (hraw.integrable_comp_of_integrable (integrable_rawPacketPotential hg hgs hm hc hr hs ν y)) + exact (he.trans (Eventually.of_forall (fun sample => + (mixturePacketPotential hg hgs hm hc hr hs (ProbabilityTheory.condDistrib raw obs P (obs sample)) y).symm))).symm + +theorem conditionalPacketPotential_event_tower {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + {raw : Ω → Configuration n} {obs : Ω → B} + (hraw : MeasurePreserving raw P ν) (hobs : Measurable obs) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} (hc : 0 hx))] + exact setIntegral_condExp hle + (hraw.integrable_comp_of_integrable (integrable_rawPacketPotential hg hgs hm hc hr hs ν y)) hA + +theorem physical_observation_potential_tower {n J : ℕ} + (ν : Measure (Configuration n)) [IsProbabilityMeasure ν] + (r : Fin J → ℝ) (j : ℕ) {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r₀ s : ℝ} (hc : 0 nlinarith +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketBridge.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..30701159c09d9783404955b38cca82dbef9bc3e3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketBridge.lean @@ -0,0 +1,393 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RadialBounds.SpatialAnnulus +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalDensity +import OAI.Analysis.CoulombRadii.FieldAnalysis.Field + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open ContinuousLinearMap +open scoped Topology BigOperators ContDiff Convolution Pointwise ENNReal +namespace NeutralAtom + +theorem packetMass_annulus_localization {n : ℕ} (g : Position → ℝ) + (hgnorm : (∫ y, g y^2) = 1) (hgsupp : ∀ x, 1 < ‖x‖ → g x = 0) + {c₁ r₀ s a b : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ha : 0 < a) (hab : a < b) + (hδ : c₁*s^packetExponent < 1/2) + (hclamp : (1+c₁*s^packetExponent)*r₀ ≤ a*s) + (x : Configuration n) : + packetMass g c₁ r₀ s (spatialAnnulus (a*s) (b*s)) x ≤ + rawCount (spatialAnnulus ((a/2)*s) ((2*b)*s)) x := by + have hdpos : 0 < c₁*s^packetExponent := mul_pos hc (Real.rpow_pos_of_pos hs _) + have hb : 0 < b := ha.trans hab + apply packetMass_le_rawCount g hgnorm hc hr hs + intro z y hy hK + change a*s < ‖y‖ ∧ ‖y‖ < b*s at hy + have hz : r₀ ≤ ‖z‖ := by + by_contra! hz + have hyc := packetKernel_clamped_support g hgsupp hc hr hs z y hz.le hK + linarith + obtain ⟨hl,hu⟩ := packetKernel_relative_support g hgsupp hc hr hs z y hz hK + change (a/2)*s < ‖z‖ ∧ ‖z‖ < (2*b)*s + constructor + · have hn := norm_nonneg z + have hsmall : (c₁*s^packetExponent)*‖z‖ < ‖z‖ := + mul_lt_of_lt_one_left (hr.trans_le hz) (by linarith) + nlinarith + · have hlarge : ‖z‖/2 < (1-c₁*s^packetExponent)*‖z‖ := by + nlinarith [mul_pos (show 0 < 1/2-c₁*s^packetExponent by linarith) (hr.trans_le hz)] + nlinarith + +theorem packet_relative_width_tendsto {s : ℕ → ℝ} (hs : Tendsto s atTop (𝓝 0)) + (c₁ : ℝ) : Tendsto (fun n => c₁*s n^packetExponent) atTop (𝓝 0) := by + simpa using (hs.rpow_const_nhds_zero (by norm_num [packetExponent])).const_mul c₁ + +theorem packet_clamp_tendsto {s r₀ : ℕ → ℝ} (hs : Tendsto s atTop (𝓝 0)) + (hr : Tendsto (fun n => r₀ n/s n) atTop (𝓝 0)) (c₁ : ℝ) : + Tendsto (fun n => ((1+c₁*s n^packetExponent)*r₀ n)/s n) atTop (𝓝 0) := by + simpa only [mul_zero, add_zero, one_mul, mul_div_assoc] using + (tendsto_const_nhds.add (packet_relative_width_tendsto hs c₁)).mul hr + +theorem eventually_packet_localization {s r₀ : ℕ → ℝ} (N : ℕ → ℕ) + (g : Position → ℝ) (hgnorm : (∫ y, g y^2) = 1) + (hgsupp : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ a b : ℝ} + (hc : 0 < c₁) (ha : 0 < a) (hab : a < b) + (hsp : ∀ᶠ n in atTop, 0 < s n) (hrp : ∀ᶠ n in atTop, 0 < r₀ n) + (hs : Tendsto s atTop (𝓝 0)) + (hr : Tendsto (fun n => r₀ n/s n) atTop (𝓝 0)) : + ∀ᶠ n in atTop, ∀ x : Configuration (N n), + packetMass g c₁ (r₀ n) (s n) (spatialAnnulus (a*s n) (b*s n)) x ≤ + rawCount (spatialAnnulus ((a/2)*s n) ((2*b)*s n)) x := by + filter_upwards [hsp, hrp, + (packet_relative_width_tendsto hs c₁).eventually_lt_const (by norm_num : (0:ℝ) < 1/2), + (packet_clamp_tendsto hs hr c₁).eventually_lt_const ha] with n hsn hrn hδ hcl + intro x + exact packetMass_annulus_localization g hgnorm hgsupp hc hrn hsn ha hab hδ + ((div_lt_iff₀ hsn).mp hcl).le x + +theorem eventually_packet_sandwich {s r₀ : ℕ → ℝ} (N : ℕ → ℕ) + (g : Position → ℝ) (hgnorm : (∫ y, g y^2) = 1) + (hgsupp : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ a b η : ℝ} + (hc : 0 < c₁) (ha : 0 < a) (hab : a < b) (hη : 0 < η) (hηa : η < a) + (hsp : ∀ᶠ n in atTop, 0 < s n) (hrp : ∀ᶠ n in atTop, 0 < r₀ n) + (hs : Tendsto s atTop (𝓝 0)) + (hr : Tendsto (fun n => r₀ n/s n) atTop (𝓝 0)) : + ∀ᶠ n in atTop, ∀ x : Configuration (N n), + packetMass g c₁ (r₀ n) (s n) (spatialAnnulus ((a+η)*s n) ((b-η)*s n)) x ≤ + rawCount (spatialAnnulus (a*s n) (b*s n)) x ∧ + rawCount (spatialAnnulus (a*s n) (b*s n)) x ≤ + packetMass g c₁ (r₀ n) (s n) (spatialAnnulus ((a-η)*s n) ((b+η)*s n)) x := by + have hd : Tendsto (fun n => (c₁*s n^packetExponent)*b) atTop (𝓝 0) := by + simpa using (packet_relative_width_tendsto hs c₁).mul_const b + filter_upwards [hsp, hrp, hd.eventually_lt_const hη, + (packet_clamp_tendsto hs hr c₁).eventually_lt_const (sub_pos.mpr hηa)] + with n hsn hrn hδ hcl x + exact packetMass_annulus_sandwich g hgnorm hgsupp hc hrn hsn ha hab hη hηa hδ + ((div_lt_iff₀ hsn).mp hcl).le x + +theorem nuclear_clamp_ratio {Z s ε : ℝ} (hZ : 0 < Z) (hs : 0 < s) : + (ε * Z^(-(1/3:ℝ)))/s = ε * (Z*s^3)^(-(1/3:ℝ)) := by + rw [Real.mul_rpow hZ.le (pow_nonneg hs.le 3), + ← Real.rpow_natCast_mul hs.le 3 (-(1/3:ℝ))] + norm_num [Real.rpow_neg_one] + ring + +theorem nuclear_clamp_tendsto {Z s : ℕ → ℝ} (hZ : ∀ᶠ n in atTop, 0 < Z n) + (hs : ∀ᶠ n in atTop, 0 < s n) + (hmass : Tendsto (fun n => Z n*s n^3) atTop atTop) (ε : ℝ) : + Tendsto (fun n => (ε*(Z n)^(-(1/3:ℝ)))/s n) atTop (𝓝 0) := by + have h := ((tendsto_rpow_neg_atTop (by norm_num : (0:ℝ) < 1/3)).comp hmass).const_mul ε + simp only [mul_zero] at h + apply h.congr' + filter_upwards [hZ,hs] with n hzn hsn + exact (nuclear_clamp_ratio hzn hsn).symm + +theorem tendsto_of_parameter_sandwich {α β : Type*} {l : Filter α} {p : Filter β} + [p.NeBot] {f : α → ℝ} {g h : β → α → ℝ} {a b : β → ℝ} {L : ℝ} + (ha : Tendsto a p (𝓝 L)) (hb : Tendsto b p (𝓝 L)) + (hs : ∀ᶠ t in p, + Tendsto (g t) l (𝓝 (a t)) ∧ Tendsto (h t) l (𝓝 (b t)) ∧ + ∀ᶠ n in l, g t n ≤ f n ∧ f n ≤ h t n) : + Tendsto f l (𝓝 L) := by + apply tendsto_order.mpr + constructor + · intro x hx + obtain ⟨t,ht,hs'⟩ := (ha.eventually (lt_mem_nhds hx) |>.and hs).exists + filter_upwards [hs'.1.eventually (lt_mem_nhds ht), hs'.2.2] with n hn hn' + exact hn.trans_le hn'.1 + · intro x hx + obtain ⟨t,ht,hs'⟩ := (hb.eventually (gt_mem_nhds hx) |>.and hs).exists + filter_upwards [hs'.2.1.eventually (gt_mem_nhds ht), hs'.2.2] with n hn hn' + exact hn'.2.trans_lt hn + +theorem raw_annulus_tendsto_of_packet_sandwich + {T : ℕ → ℝ → ℝ → ℝ} {N : ℕ → ℝ} {a b C : ℝ} + (ha : 0 < a) (hab : a < b) + (hT : ∀ u v : ℝ, 0 < u → u < v → + Tendsto (fun n => T n u v) atTop (𝓝 (C/u^3-C/v^3))) + (hs : ∀ η : ℝ, 0 < η → η < min a ((b-a)/2) → + ∀ᶠ n in atTop, T n (a+η) (b-η) ≤ N n ∧ N n ≤ T n (a-η) (b+η)) : + Tendsto N atTop (𝓝 (C/a^3-C/b^3)) := by + have hb : 0 < b := ha.trans hab + apply tendsto_of_parameter_sandwich (p := 𝓝[>] (0 : ℝ)) + (g := fun η n => T n (a+η) (b-η)) (h := fun η n => T n (a-η) (b+η)) + (a := fun η => C/(a+η)^3-C/(b-η)^3) + (b := fun η => C/(a-η)^3-C/(b+η)^3) + · have hcont : ContinuousAt (fun η : ℝ => C/(a+η)^3-C/(b-η)^3) 0 := by + fun_prop (disch := positivity) + simpa using hcont.tendsto.mono_left nhdsWithin_le_nhds + · have hcont : ContinuousAt (fun η : ℝ => C/(a-η)^3-C/(b+η)^3) 0 := by + fun_prop (disch := positivity) + simpa using hcont.tendsto.mono_left nhdsWithin_le_nhds + · have hm : 0 < min a ((b-a)/2) := lt_min ha (by linarith) + filter_upwards [self_mem_nhdsWithin, (gt_mem_nhds hm : ∀ᶠ η : ℝ in 𝓝 0, η < min a ((b-a)/2)).filter_mono nhdsWithin_le_nhds] + with η hη hηm + have hη0 : 0 < η := hη + have hηa : η < a := hηm.trans_le (min_le_left _ _) + have hηab : η < (b-a)/2 := hηm.trans_le (min_le_right _ _) + exact ⟨hT _ _ (by linarith) (by linarith), + hT _ _ (by linarith) (by linarith), hs η hη0 hηm⟩ + +theorem rawCount_memLp_measure {n : ℕ} (μ : Measure (Configuration n)) + [IsFiniteMeasure μ] {S : Set Position} (hS : MeasurableSet S) : + MemLp (rawCount (n := n) S) 2 μ := by + apply MemLp.of_bound (measurable_rawCount hS).aestronglyMeasurable (n : ℝ) + filter_upwards [] with x + simpa only [Real.norm_eq_abs, abs_of_nonneg (rawCount_nonneg S x)] using rawCount_le_number S x + +theorem expected_raw_annulus_of_packets {s r₀ : ℕ → ℝ} (N : ℕ → ℕ) + (μ : ∀ n, Measure (Configuration (N n))) [∀ n, IsFiniteMeasure (μ n)] + (g : Position → ℝ) (hg : Continuous g) (hgnorm : (∫ y, g y^2) = 1) + (hgsupp : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ a b C : ℝ} + (hc : 0 < c₁) (ha : 0 < a) (hab : a < b) + (hsp : ∀ᶠ n in atTop, 0 < s n) (hrp : ∀ᶠ n in atTop, 0 < r₀ n) + (hs : Tendsto s atTop (𝓝 0)) + (hr : Tendsto (fun n => r₀ n/s n) atTop (𝓝 0)) + (hpacket : ∀ u v : ℝ, 0 < u → u < v → + Tendsto (fun n => s n^3 * ∫ x, + packetMass g c₁ (r₀ n) (s n) (spatialAnnulus (u*s n) (v*s n)) x ∂μ n) + atTop (𝓝 (C/u^3-C/v^3))) : + Tendsto (fun n => s n^3 * ∫ x, + rawCount (spatialAnnulus (a*s n) (b*s n)) x ∂μ n) + atTop (𝓝 (C/a^3-C/b^3)) := by + apply raw_annulus_tendsto_of_packet_sandwich ha hab hpacket + intro η hη hηm + have hηa := hηm.trans_le (min_le_left _ _) + filter_upwards [hsp, hrp, + eventually_packet_sandwich N g hgnorm hgsupp hc ha hab hη hηa hsp hrp hs hr] + with n hsn hrn hsan + have hraw := (rawCount_memLp_measure (μ n) + (measurableSet_spatialAnnulus (a*s n) (b*s n))).integrable (by norm_num) + have hlow := (packetMass_memLp hg hgnorm hc hrn hsn + (spatialAnnulus ((a+η)*s n) ((b-η)*s n)) (μ n)).integrable (by norm_num) + have hhigh := (packetMass_memLp hg hgnorm hc hrn hsn + (spatialAnnulus ((a-η)*s n) ((b+η)*s n)) (μ n)).integrable (by norm_num) + exact ⟨mul_le_mul_of_nonneg_left (integral_mono hlow hraw (fun x => (hsan x).1)) + (pow_nonneg hsn.le 3), + mul_le_mul_of_nonneg_left (integral_mono hraw hhigh (fun x => (hsan x).2)) + (pow_nonneg hsn.le 3)⟩ + +theorem conditional_mass_l2 {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (hm : m ≤ m₀) {X Y : Ω → ℝ} {c : ℝ} + (hc : 0 ≤ c) (hX : MemLp X 2 μ) (hX0 : 0 ≤ᵐ[μ] X) + (hY : AEStronglyMeasurable (m := m₀) Y μ) (hY0 : 0 ≤ᵐ[μ] Y) + (hYX : Y ≤ᵐ[μ] c • μ[X | m]) : + MemLp Y 2 μ ∧ Real.sqrt (∫ z, Y z ^ 2 ∂μ) ≤ + c * Real.sqrt (∫ z, X z ^ 2 ∂μ) := by + have hcond := hX.condExp (m := m) (by norm_num : (1 : ℝ≥0∞) ≤ 2) + have hcond0 : 0 ≤ᵐ[μ] μ[X | m] := condExp_nonneg hX0 + have hdom : MemLp (c • μ[X | m]) 2 μ := hcond.const_smul c + have hY2 : MemLp Y 2 μ := hdom.mono' hY (by + filter_upwards [hY0, hYX] with z hz hzx + simpa only [Real.norm_eq_abs, abs_of_nonneg hz] using hzx) + refine ⟨hY2, ?_⟩ + have hsq : (∫ z, Y z ^ 2 ∂μ) ≤ c^2 * (∫ z, X z ^ 2 ∂μ) := by + calc + (∫ z, Y z ^ 2 ∂μ) ≤ ∫ z, (c * μ[X | m] z)^2 ∂μ := by + apply integral_mono_ae hY2.integrable_sq hdom.integrable_sq + filter_upwards [hY0, hYX, hcond0] with z hz hzx hx + exact pow_le_pow_left₀ hz hzx 2 + _ = c^2 * (∫ z, μ[X | m] z ^ 2 ∂μ) := by + simp_rw [mul_pow] + rw [integral_const_mul] + _ ≤ _ := mul_le_mul_of_nonneg_left (conditional_integral_square_le (m₀ := m₀) (m := m) μ hm hX) + (sq_nonneg c) + calc + Real.sqrt (∫ z, Y z ^ 2 ∂μ) ≤ Real.sqrt (c^2 * (∫ z, X z^2 ∂μ)) := + Real.sqrt_le_sqrt hsq + _ = c * Real.sqrt (∫ z, X z^2 ∂μ) := by + rw [Real.sqrt_mul (sq_nonneg c), Real.sqrt_sq hc] + +theorem expectation_of_conditional_mass {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (hm : m ≤ m₀) {X Y : Ω → ℝ} (_hX : Integrable X μ) {c : ℝ} + (hY : Y =ᵐ[μ] c • μ[X | m]) : + (∫ z, Y z ∂μ) = c * ∫ z, X z ∂μ := by + rw [integral_congr_ae hY] + change (∫ z, c * μ[X | m] z ∂μ) = _ + rw [integral_const_mul, integral_condExp hm] + +theorem scaled_count_l2_bound {s D C X Y : ℝ} + (hs : 0 < s) (hs1 : s ≤ 1) (hD : 0 ≤ D) (hC : 0 ≤ C) + (hYX : Y ≤ s^3 * X) + (hX : X ≤ C*(max (s^3)⁻¹ 1 + Real.sqrt (D*s))) : + Y ≤ C*(1+Real.sqrt D) := by + have hs3 : 0 < s^3 := pow_pos hs 3 + have hs3le : s^3 ≤ 1 := pow_le_one₀ hs.le hs1 + have hi : 1 ≤ (s^3)⁻¹ := (one_le_inv₀ hs3).mpr hs3le + have hsq : Real.sqrt (D*s) ≤ Real.sqrt D := + Real.sqrt_le_sqrt (mul_le_of_le_one_right hD hs1) + have hsm : s^3 * Real.sqrt (D*s) ≤ Real.sqrt D := by + calc + s^3 * Real.sqrt (D*s) ≤ 1 * Real.sqrt (D*s) := + mul_le_mul_of_nonneg_right hs3le (Real.sqrt_nonneg _) + _ ≤ _ := by simpa only [one_mul] using hsq + calc + Y ≤ s^3 * (C*(max (s^3)⁻¹ 1 + Real.sqrt (D*s))) := + hYX.trans (mul_le_mul_of_nonneg_left hX hs3.le) + _ = C * (1+s^3*Real.sqrt (D*s)) := by + rw [max_eq_left hi] + field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left (add_le_add le_rfl hsm) hC + +theorem integral_comp_measurePreserving {Ω Ξ : Type*} + [MeasurableSpace Ω] [MeasurableSpace Ξ] {μ : Measure Ω} {ν : Measure Ξ} + {X : Ω → Ξ} (hX : MeasurePreserving X μ ν) {f : Ξ → ℝ} + (hf : AEStronglyMeasurable f ν) : + (∫ z, f (X z) ∂μ) = ∫ x, f x ∂ν := by + rw [← hX.map_eq] at hf ⊢ + exact (integral_map hX.aemeasurable hf).symm + +theorem conditional_packet_memLp {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (_hm : m ≤ m₀) {n : ℕ} (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + (X : Ω → Configuration n) (hX : @MeasurePreserving Ω (Configuration n) m₀ inferInstance X μ ν) + {g : Position → ℝ} (hg : Continuous g) (hgnorm : (∫ y, g y^2) = 1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S : Set Position) {Y : Ω → ℝ} + (hY : Y =ᵐ[μ] (s^3) • μ[(fun z => packetMass g c₁ r₀ s S (X z)) | m]) : + MemLp Y 2 μ := by + let : MeasurableSpace Ω := m₀ + have hP := (packetMass_memLp hg hgnorm hc hr hs S ν).comp_measurePreserving hX + exact (memLp_congr_ae hY).mpr + ((hP.condExp (m := m) (by norm_num : (1 : ℝ≥0∞) ≤ 2)).const_smul (s^3)) + +theorem conditional_packet_l2_bound {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (hm : m ≤ m₀) {n : ℕ} (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + (X : Ω → Configuration n) (hX : @MeasurePreserving Ω (Configuration n) m₀ inferInstance X μ ν) + {g : Position → ℝ} (hg : Continuous g) (hgnorm : (∫ y, g y^2) = 1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S T : Set Position) (hT : MeasurableSet T) + (hloc : ∀ x : Configuration n, packetMass g c₁ r₀ s S x ≤ rawCount T x) + {Y : Ω → ℝ} + (hY : Y =ᵐ[μ] (s^3) • μ[(fun z => packetMass g c₁ r₀ s S (X z)) | m]) : + MemLp Y 2 μ ∧ Real.sqrt (∫ z, Y z^2 ∂μ) ≤ + s^3 * Real.sqrt (∫ x, (rawCount T x)^2 ∂ν) := by + let : MeasurableSpace Ω := m₀ + have hP₀ := packetMass_memLp hg hgnorm hc hr hs S ν + have hP := hP₀.comp_measurePreserving hX + have hN₀ := rawCount_memLp_measure ν hT + have hN := hN₀.comp_measurePreserving hX + have hY2 := conditional_packet_memLp μ hm ν X hX hg hgnorm hc hr hs S hY + have hP0 : 0 ≤ᵐ[μ] (fun z => packetMass g c₁ r₀ s S (X z)) := + Eventually.of_forall fun z => packetMass_nonneg g hc hr hs S (X z) + have hY0 : 0 ≤ᵐ[μ] Y := by + filter_upwards [hY, condExp_nonneg (m := m) hP0] with z hz hpz + rw [hz] + exact mul_nonneg (pow_nonneg hs.le 3) hpz + have hYN : Y ≤ᵐ[μ] (s^3) • μ[(fun z => rawCount T (X z)) | m] := by + have hh := condExp_mono (m := m) (hP.integrable (by norm_num)) + (hN.integrable (by norm_num)) (Eventually.of_forall (fun z => hloc (X z))) + filter_upwards [hY,hh] with z hz hhz + rw [hz] + exact mul_le_mul_of_nonneg_left hhz (pow_nonneg hs.le 3) + have hh := conditional_mass_l2 (m₀ := m₀) (m := m) μ hm (pow_nonneg hs.le 3) hN + (Eventually.of_forall fun z => rawCount_nonneg T (X z)) hY2.aestronglyMeasurable hY0 hYN + have hi := integral_comp_measurePreserving hX hN₀.integrable_sq.aestronglyMeasurable + exact ⟨hh.1, by simpa only [Function.comp_apply, hi] using hh.2⟩ + +theorem expected_conditional_packet {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (hm : m ≤ m₀) {n : ℕ} (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + (X : Ω → Configuration n) (hX : @MeasurePreserving Ω (Configuration n) m₀ inferInstance X μ ν) + {g : Position → ℝ} (hg : Continuous g) (hgnorm : (∫ y, g y^2) = 1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S : Set Position) {Y : Ω → ℝ} + (hY : Y =ᵐ[μ] (s^3) • μ[(fun z => packetMass g c₁ r₀ s S (X z)) | m]) : + (∫ z, Y z ∂μ) = s^3 * ∫ x, packetMass g c₁ r₀ s S x ∂ν := by + let : MeasurableSpace Ω := m₀ + have hP₀ := packetMass_memLp hg hgnorm hc hr hs S ν + rw [expectation_of_conditional_mass μ hm + ((hP₀.comp_measurePreserving hX).integrable (by norm_num)) hY] + simp only [Function.comp_apply] + rw [integral_comp_measurePreserving hX hP₀.aestronglyMeasurable] + +theorem expected_packet_annulus_from_retained {Ω : ℕ → Type*} + [m₀ : ∀ n, MeasurableSpace (Ω n)] (μ : ∀ n, Measure (Ω n)) + [∀ n, IsProbabilityMeasure (μ n)] (m : ∀ n, MeasurableSpace (Ω n)) + (hm : ∀ n, m n ≤ m₀ n) (N : ℕ → ℕ) + (ν : ∀ n, Measure (Configuration (N n))) [∀ n, IsFiniteMeasure (ν n)] + (X : ∀ n, Ω n → Configuration (N n)) + (hX : ∀ n, @MeasurePreserving (Ω n) (Configuration (N n)) (m₀ n) inferInstance (X n) (μ n) (ν n)) + (s r₀ : ℕ → ℝ) (hsp : ∀ n, 0 < s n) (hrp : ∀ n, 0 < r₀ n) + (hs : Tendsto s atTop (𝓝 0)) (hr : Tendsto (fun n => r₀ n/s n) atTop (𝓝 0)) + (g : Position → ℝ) (hg : Continuous g) (hgnorm : (∫ y, g y^2) = 1) + (hgsupp : ∀ x, 1 < ‖x‖ → g x = 0) {c₁ D : ℝ} (hc : 0 < c₁) (hD : 0 ≤ D) + {G : ∀ n, Set (Ω n)} (hG : ∀ n, MeasurableSet[m₀ n] (G n)) + (hbad : Tendsto (fun n => (μ n).real (G n)ᶜ) atTop (𝓝 0)) + (d : RetainedAnalyticFamily (fun n => G n)) + (σ : ∀ n, Ω n → Position → ℝ) (hσ : ∀ n (θ : G n), σ n θ = d.σ n θ) + (hcond : ∀ n a b, 0 < a → a < b → + (fun z => ∫ x in spatialAnnulus a b, σ n z x) =ᵐ[μ n] + s n^3 • (μ n)[(fun z => packetMass g c₁ (r₀ n) (s n) + (spatialAnnulus (a*s n) (b*s n)) (X n z)) | m n]) + (hcount : ∀ a b, 0 < a → a < b → ∃ C : ℝ, 0 ≤ C ∧ + ∀ᶠ n in atTop, Real.sqrt (∫ x, + (rawCount (spatialAnnulus (a*s n) (b*s n)) x)^2 ∂ν n) ≤ + C*(max (s n^3)⁻¹ 1 + Real.sqrt (D*s n))) + {a b : ℝ} (ha : 0 < a) (hab : a < b) : + Tendsto (fun n => s n^3 * ∫ x, packetMass g c₁ (r₀ n) (s n) + (spatialAnnulus (a*s n) (b*s n)) x ∂ν n) + atTop (𝓝 ((81*Real.pi^2/2)/a^3-(81*Real.pi^2/2)/b^3)) := by + let : ∀ n, MeasurableSpace (Ω n) := m₀ + let Y : ∀ n, Ω n → ℝ := fun n z => ∫ x in spatialAnnulus a b, σ n z x + have hY : ∀ n, MemLp (Y n) 2 (μ n) := fun n => + conditional_packet_memLp (μ n) (hm n) (ν n) (X n) (hX n) hg hgnorm hc + (hrp n) (hsp n) _ (hcond n a b ha hab) + have hY0 : ∀ n, 0 ≤ᵐ[μ n] Y n := by + intro n + have hp : 0 ≤ᵐ[μ n] (fun z => packetMass g c₁ (r₀ n) (s n) + (spatialAnnulus (a*s n) (b*s n)) (X n z)) := Eventually.of_forall fun z => + packetMass_nonneg g hc (hrp n) (hsp n) _ (X n z) + filter_upwards [hcond n a b ha hab, condExp_nonneg (m := m n) hp] with z hz hpz + change 0 ≤ Y n z + change Y n z = _ at hz + rw [hz] + exact mul_nonneg (pow_nonneg (hsp n).le 3) hpz + obtain ⟨C,hC,hcb⟩ := hcount (a/2) (2*b) (by linarith) (by linarith) + have hL2 : ∀ᶠ n in atTop, Real.sqrt (∫ z, (Y n z)^2 ∂μ n) ≤ C*(1+Real.sqrt D) := by + filter_upwards [hcb, hs.eventually_lt_const (by norm_num : (0:ℝ) < 1), + eventually_packet_localization N g hgnorm hgsupp hc ha hab + (Eventually.of_forall hsp) (Eventually.of_forall hrp) hs hr] + with n hn hs1 hloc + have hh := conditional_packet_l2_bound (μ n) (hm n) (ν n) (X n) (hX n) + hg hgnorm hc (hrp n) (hsp n) _ _ (measurableSet_spatialAnnulus _ _) hloc + (hcond n a b ha hab) + exact scaled_count_l2_bound (hsp n) hs1.le hD hC hh.2 hn + have hh := d.expected_annulus μ σ hσ ha hab hY hY0 hG hL2 hbad + apply hh.congr' + filter_upwards [] with n + exact expected_conditional_packet (μ n) (hm n) (ν n) (X n) (hX n) + hg hgnorm hc (hrp n) (hsp n) _ (hcond n a b ha hab) + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketDensity.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..14c8bea9d9c5c7635f64f8f35c010060ebf652b3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketDensity.lean @@ -0,0 +1,184 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.SpectralTheory.FermiPacketSpectralTrace + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +namespace Coulomb + +def packetDensity (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (x : Space) : ℝ := + ∫ y : Space, g (x-y)^2*ρ y + +lemma packetDensity_nonneg (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (x : Space) : + 0 ≤ packetDensity g ρ x := integral_nonneg (fun y => mul_nonneg (sq_nonneg _) (hp y)) + +lemma packetDensity_measurable (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (hm : Measurable ρ) : + Measurable (packetDensity g ρ) := by + exact (((g.continuous.measurable.comp (measurable_fst.sub measurable_snd)).pow_const 2).mul + (hm.comp measurable_snd)).stronglyMeasurable.integral_prod_right.measurable + +lemma packetDensity_integrable (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hi : Integrable ρ) : Integrable (packetDensity g ρ) := by + let := fermiMeasure_finite ρ hp hm hi + let : Fact ((2 : ℝ≥0∞) ≠ ⊤) := ⟨by simp⟩ + exact ((frameDensity_integrable (packetState_toL2_memLp (complexWindow g) + (phaseMeasure (fermiRadius ρ)))).const_mul 2).congr (fermiPacket_density g ρ hp hm hi) + +lemma schwartz_square_le (g : 𝓢(Space,ℝ)) (x : Space) : + g x^2 ≤ (SchwartzMap.seminorm ℝ 0 0 g)^2 := by + have h := g.norm_le_seminorm ℝ x + simpa only [Real.norm_eq_abs,sq_abs] using pow_le_pow_left₀ (norm_nonneg (g x)) h 2 + +lemma packetDensity_integrand_integrable (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) (x : Space) : + Integrable (fun y => g (x-y)^2*ρ y) := by + apply (hi.const_mul ((SchwartzMap.seminorm ℝ 0 0 g)^2)).mono' + (((g.continuous.measurable.comp (measurable_const.sub measurable_id)).pow_const 2).mul hm).aestronglyMeasurable + filter_upwards [] with y + change ‖g (x-y)^2*ρ y‖ ≤ _ + rw [Real.norm_of_nonneg (mul_nonneg (sq_nonneg _) (hp y))] + exact mul_le_mul_of_nonneg_right (schwartz_square_le g _) (hp y) + +lemma packetDensity_bound (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hi : Integrable ρ) (x : Space) : + packetDensity g ρ x ≤ (SchwartzMap.seminorm ℝ 0 0 g)^2 * ∫ y, ρ y := by + calc + _ ≤ ∫ y, (SchwartzMap.seminorm ℝ 0 0 g)^2*ρ y := + integral_mono (packetDensity_integrand_integrable g ρ hp hm hi x) + (hi.const_mul _) (fun y => mul_le_mul_of_nonneg_right (schwartz_square_le g _) (hp y)) + _ = _ := integral_const_mul _ _ + +lemma packetDensity_support (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (K : Set Space) + (hs : ∀ y, y ∉ K → ρ y = 0) (x : Space) (hx : x ∉ K + tsupport (g : Space → ℝ)) : + packetDensity g ρ x = 0 := by + apply integral_eq_zero_of_ae + filter_upwards [] with y + by_cases hy : y ∈ K + · have hxy : x-y ∉ tsupport (g : Space → ℝ) := by + intro h + apply hx + exact ⟨y,hy,x-y,h,by abel_nf⟩ + rw [image_eq_zero_of_notMem_tsupport hxy] + norm_num + · simp only [hs y hy,mul_zero,Pi.zero_apply] + +lemma complexWindow_tsupport (g : 𝓢(Space,ℝ)) : + tsupport (complexWindow g : Space → ℂ) = tsupport (g : Space → ℝ) := by + unfold tsupport + congr 1 + ext x + change (↑(g x) : ℂ) ≠ 0 ↔ g x ≠ 0 + exact not_congr Complex.ofReal_eq_zero + +lemma complexWindow_compactSupport (g : 𝓢(Space,ℝ)) (hgc : HasCompactSupport (g : Space → ℝ)) : + HasCompactSupport (complexWindow g : Space → ℂ) := by + change IsCompact (tsupport (complexWindow g : Space → ℂ)) + rw [complexWindow_tsupport] + exact hgc + +lemma fermiPhase_center_mem (ρ : Space → ℝ) (K : Set Space) (hs : ∀ y, y ∉ K → ρ y = 0) + (yp : Space × Space) (hyp : yp ∈ phaseRegion (fermiRadius ρ)) : yp.1 ∈ K := by + by_contra hn + have hzero : fermiRadius ρ yp.1 = 0 := by simp [fermiRadius,hs yp.1 hn] + change ‖yp.2‖ < fermiRadius ρ yp.1 at hyp + rw [hzero] at hyp + exact (not_lt_of_ge (norm_nonneg _)) hyp + +lemma fermiPhase_momentum_bound (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) + (C : ℝ) (hC : ∀ y, ρ y ≤ C) (yp : Space × Space) (hyp : yp ∈ phaseRegion (fermiRadius ρ)) : + ‖yp.2‖ ≤ (3/(8*Real.pi)*C)^(1/3:ℝ) := by + apply (le_of_lt hyp).trans + exact Real.rpow_le_rpow (mul_nonneg (by positivity) (hp _)) + (mul_le_mul_of_nonneg_left (hC _) (by positivity)) (by norm_num) +end Coulomb + +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketDensityReal.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketDensityReal.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ac094fea8b2c4c20c6f684fe351eca1bef531f2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketDensityReal.lean @@ -0,0 +1,210 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CoreScreenedField +import OAI.Analysis.CoulombRadii.FormDomain.SchwartzSquareIntegrable + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +lemma packetDensity_ofReal (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) (x : Space) : + ENNReal.ofReal (packetDensity g ρ x) = ∫⁻ y : Space, ENNReal.ofReal (g (x-y)^2*ρ y) := + ofReal_integral_eq_lintegral_ofReal (packetDensity_integrand_integrable g ρ hp hm hi x) + (Eventually.of_forall (fun y => mul_nonneg (sq_nonneg _) (hp y))) + +lemma packetDensity_product_ofReal (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) (x y : Space) : + ENNReal.ofReal (packetDensity g ρ x*packetDensity g ρ y) = + ∫⁻ ac : Space × Space, ENNReal.ofReal (g (x-ac.1)^2*g (y-ac.2)^2) * + ENNReal.ofReal (ρ ac.1*ρ ac.2) := by + rw [ENNReal.ofReal_mul (packetDensity_nonneg g ρ hp x),packetDensity_ofReal g ρ hp hm hi x, + packetDensity_ofReal g ρ hp hm hi y] + have hx : Measurable (fun a : Space => ENNReal.ofReal (g (x-a)^2*ρ a)) := + (((g.continuous.measurable.comp (measurable_const.sub measurable_id)).pow_const 2).mul hm).ennreal_ofReal + have hy : Measurable (fun c : Space => ENNReal.ofReal (g (y-c)^2*ρ c)) := + (((g.continuous.measurable.comp (measurable_const.sub measurable_id)).pow_const 2).mul hm).ennreal_ofReal + rw [← lintegral_prod_mul hx.aemeasurable hy.aemeasurable] + apply lintegral_congr + intro ac + simp only [ENNReal.ofReal_mul (sq_nonneg _),ENNReal.ofReal_mul (hp _)] + ring + +lemma packetDensity_pair_lintegral (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) : + ENNReal.ofReal (∫ xy : Space × Space, coulombKernel (xy.1-xy.2)* + (packetDensity g ρ xy.1*packetDensity g ρ xy.2)) = + ∫⁻ ac : Space × Space, ENNReal.ofReal (ρ ac.1*ρ ac.2)* + ENNReal.ofReal (∫ xy : Space × Space, + g (xy.1-ac.1)^2*g (xy.2-ac.2)^2*coulombKernel (xy.1-xy.2)) := by + let H (xy ac : Space × Space) : ℝ≥0∞ := ENNReal.ofReal (g (xy.1-ac.1)^2*g (xy.2-ac.2)^2)* + ENNReal.ofReal (ρ ac.1*ρ ac.2)*ENNReal.ofReal (coulombKernel (xy.1-xy.2)) + have hH : Measurable (Function.uncurry H) := by + unfold H Function.uncurry + exact (((((g.continuous.measurable.comp (measurable_fst.fst.sub measurable_snd.fst)).pow_const 2).mul + ((g.continuous.measurable.comp (measurable_fst.snd.sub measurable_snd.snd)).pow_const 2)).ennreal_ofReal).mul + (((hm.comp measurable_snd.fst).mul (hm.comp measurable_snd.snd)).ennreal_ofReal)).mul + ((coulombKernel_measurable.comp (measurable_fst.fst.sub measurable_fst.snd)).ennreal_ofReal) + have he (ac : Space × Space) : (∫⁻ xy : Space × Space, H xy ac) = + ENNReal.ofReal (ρ ac.1*ρ ac.2)*ENNReal.ofReal (∫ xy : Space × Space, + g (xy.1-ac.1)^2*g (xy.2-ac.2)^2*coulombKernel (xy.1-xy.2)) := by + have hm' (a : Space) : Measurable (fun x : Space => g (x-a)^2) := + (g.continuous.measurable.comp (measurable_id.sub measurable_const)).pow_const 2 + have hb (c x : Space) : ‖g (x-c)^2‖ ≤ (SchwartzMap.seminorm ℝ 0 0 g)^2 := by + rw [Real.norm_of_nonneg (sq_nonneg _)] + exact schwartz_square_le g _ + have hij := coulomb_pair_integrable (window_shift_integrable g ac.1) (hm' ac.1) + (window_shift_integrable g ac.2) (hm' ac.2) (hb ac.2) + rw [ofReal_integral_eq_lintegral_ofReal hij (Eventually.of_forall (fun xy => + mul_nonneg (mul_nonneg (sq_nonneg _) (sq_nonneg _)) (coulombKernel_nonneg _)))] + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply lintegral_congr + intro xy + dsimp only [H] + rw [ENNReal.ofReal_mul (mul_nonneg (sq_nonneg _) (sq_nonneg _))] + ac_rfl + have hI := ofReal_integral_eq_lintegral_ofReal (packetDensity_pair_integrable g ρ hp hm hi) + (Eventually.of_forall (fun xy => mul_nonneg (coulombKernel_nonneg _) + (mul_nonneg (packetDensity_nonneg g ρ hp _) (packetDensity_nonneg g ρ hp _)))) + rw [hI] + calc + _ = ∫⁻ xy : Space × Space, ∫⁻ ac : Space × Space, H xy ac := by + apply lintegral_congr + intro xy + rw [ENNReal.ofReal_mul (coulombKernel_nonneg _),packetDensity_product_ofReal g ρ hp hm hi] + rw [← lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply lintegral_congr + intro ac + dsimp only [H] + ac_rfl + _ = ∫⁻ ac : Space × Space, ∫⁻ xy : Space × Space, H xy ac := + lintegral_lintegral_swap hH.aemeasurable + _ = _ := lintegral_congr he + +lemma radial_packetDensity_pair_le (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + (ρ : Space → ℝ) (hp : ∀ x, 0 ≤ ρ x) (hm : Measurable ρ) (hi : Integrable ρ) + (hD : Integrable (fun xy : Space × Space => coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2))) : + (∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(packetDensity g ρ xy.1*packetDensity g ρ xy.2)) ≤ + ∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2) := by + have hpos : 0 ≤ ∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2) := + integral_nonneg (fun xy => mul_nonneg (coulombKernel_nonneg _) (mul_nonneg (hp _) (hp _))) + apply (ENNReal.ofReal_le_ofReal_iff hpos).mp + rw [packetDensity_pair_lintegral g ρ hp hm hi, + ofReal_integral_eq_lintegral_ofReal hD (Eventually.of_forall (fun xy => + mul_nonneg (coulombKernel_nonneg _) (mul_nonneg (hp _) (hp _))))] + apply lintegral_mono_ae + have hne : ∀ᵐ ac : Space × Space ∂(volume : Measure Space).prod volume, ac.1 ≠ ac.2 := by + apply (Measure.ae_prod_iff_ae_ae (p := fun ac : Space × Space => ac.1 ≠ ac.2) + ((measurableSet_eq_fun measurable_fst measurable_snd).compl)).mpr + filter_upwards [] with a + have h : ∀ᵐ c : Space, c ≠ a := by rw [ae_iff]; simp + exact h.mono (fun c hc => Ne.symm hc) + filter_upwards [hne] with ac hac + rw [ENNReal.ofReal_mul (coulombKernel_nonneg _),mul_comm (ENNReal.ofReal (coulombKernel _))] + gcongr + exact window_shape_pair_le g hg hrad hac +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketIndex.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketIndex.lean new file mode 100644 index 0000000000000000000000000000000000000000..608346cd84e26b354aecc7d17e1bace4be906127 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketIndex.lean @@ -0,0 +1,183 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.OrbitalHilbertBasis +import OAI.Analysis.CoulombRadii.Packets.PacketSynthesisIndicator + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff + +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +namespace Coulomb +abbrev packetIndex (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) := + Σ z, eigenspaceBasisSet (packetFrame g μ) z + +def packetBasis (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + HilbertBasis (packetIndex g μ) ℂ (Lp ℂ 2 (volume : Measure Space)) := + compactSpectralBasis (packetFrame g μ) (packetFrame_compact g μ) + (frameOperator_symmetric (packetState_toL2_memLp g μ)) + +instance packetIndexCountable (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + Countable (packetIndex g μ) := by + let : Fact ((2 : ℝ≥0∞) ≠ ⊤) := ⟨by simp⟩ + exact orthonormal_countable (packetBasis g μ).orthonormal + +abbrev positivePacketIndex (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) := + {i : packetIndex g μ // 0 < i.1.re} + +lemma positivePacketIndex_ne_zero {g : 𝓢(Space,ℂ)} {μ : Measure (Space × Space)} + (i : positivePacketIndex g μ) : i.val.1 ≠ 0 := by + intro h + have hi := i.property + rw [h] at hi + exact lt_irrefl 0 hi + +lemma packetPositiveIndex_smooth (g : 𝓢(Space,ℂ)) (hgc : HasCompactSupport (g : Space → ℂ)) + (A : Set (Space × Space)) (hA : MeasurableSet A) + (K : Set Space) (hK : IsCompact K) (P : ℝ) + (hAK : ∀ yp ∈ A, yp.1 ∈ K) (hAP : ∀ yp ∈ A, ‖yp.2‖ ≤ P) : + letI := compactPhase_finite A K hK P hAK hAP + ∃ F : positivePacketIndex g (volume.restrict A) → Space → ℂ, + (∀ i, ContDiff ℝ (⊤ : ℕ∞) (F i)) ∧ (∀ i, HasCompactSupport (F i)) ∧ + (∀ i, (packetBasis g (volume.restrict A) i.val : Space → ℂ) =ᵐ[volume] F i) ∧ + (∀ i x, x ∉ K + tsupport (g : Space → ℂ) → F i x = 0) := by + let := compactPhase_finite A K hK P hAK hAP + have H (i : positivePacketIndex g (volume.restrict A)) := + packetFrame_eigen_smooth_supported g hgc A hA K hK P hAK hAP + (packetBasis g (volume.restrict A) i.val) i.val.1 (positivePacketIndex_ne_zero i) + (compactSpectralBasis_eigen _ _ _ i.val) + choose F hs hc he hsup using H + exact ⟨F,hs,hc,he,hsup⟩ + +lemma orthonormal_representative_inner {ι : Type*} + (b : ι → Lp ℂ 2 (volume : Measure Space)) (hb : Orthonormal ℂ b) + (F : ι → Space → ℂ) (he : ∀ i, (b i : Space → ℂ) =ᵐ[volume] F i) (i j : ι) : + (∫ x : Space, star (F i x)*F j x) = if i = j then 1 else 0 := by + classical + have H : (∫ x : Space, star (F i x)*F j x) = inner ℂ (b i) (b j) := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [he i,he j] with x hi hj + simp only [RCLike.inner_apply',starRingEnd_apply,hi,hj] + rw [H] + exact orthonormal_iff_ite.mp hb i j + +lemma spinOrbital_contDiff {ι : Type*} (F : ι → Space → ℂ) + (hs : ∀ i, ContDiff ℝ (⊤ : ℕ∞) (F i)) (i : ι × Fin 2) (s : Fin 2) : + ContDiff ℝ (⊤ : ℕ∞) (fun x => spinOrbital F i x s) := by + by_cases h : s = i.2 <;> simp only [spinOrbital,h,ite_true,ite_false] + · exact hs i.1 + · exact contDiff_const + +lemma spinOrbital_compactSupport {ι : Type*} (F : ι → Space → ℂ) + (hc : ∀ i, HasCompactSupport (F i)) (i : ι × Fin 2) (s : Fin 2) : + HasCompactSupport (fun x => spinOrbital F i x s) := by + by_cases h : s = i.2 <;> simp only [spinOrbital,h,ite_true,ite_false] + · exact hc i.1 + · exact HasCompactSupport.zero + +lemma spinOrbital_support {ι : Type*} (F : ι → Space → ℂ) (B : Set Space) + (hB : ∀ i x, x ∉ B → F i x = 0) (i : ι × Fin 2) (s : Fin 2) (x : Space) (hx : x ∉ B) : + spinOrbital F i x s = 0 := by simp only [spinOrbital,hB i.1 x hx,ite_self] + +lemma spinOrbital_density {ι : Type*} (F : ι → Space → ℂ) (i : ι × Fin 2) (x : Space) : + (∑ s : Fin 2, ‖spinOrbital F i x s‖^2) = ‖F i.1 x‖^2 := by + simp only [spinOrbital,apply_ite,norm_zero,ite_pow,zero_pow (by decide : 2 ≠ 0)] + simp + +lemma spinOrbital_kinetic {ι : Type*} (F : ι → Space → ℂ) (i : ι × Fin 2) : + (∑ s : Fin 2, ∑ b : Fin 3, ∫ x : Space, + ‖fderiv ℝ (fun y => spinOrbital F i y s) x (EuclideanSpace.single b 1)‖^2) = + ∑ b : Fin 3, ∫ x : Space, ‖fderiv ℝ (F i.1) x (EuclideanSpace.single b 1)‖^2 := by + have he (s : Fin 2) : (∑ b : Fin 3, ∫ x : Space, + ‖fderiv ℝ (fun y => spinOrbital F i y s) x (EuclideanSpace.single b 1)‖^2) = + if s = i.2 then ∑ b : Fin 3, ∫ x : Space, + ‖fderiv ℝ (F i.1) x (EuclideanSpace.single b 1)‖^2 else 0 := by + by_cases h : s = i.2 <;> simp [spinOrbital,h] + simp only [he] + simp +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketStateJointSquareIntegrable.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketStateJointSquareIntegrable.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6c1fa5ed3f4a11817144a88f0eb916387eb5dcb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketStateJointSquareIntegrable.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.PacketStateL2Norm +import OAI.Analysis.CoulombRadii.FieldAnalysis.FrameDensity + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +lemma packetState_joint_square_integrable (g : 𝓢(Space,ℂ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + Integrable (fun z : (Space × Space) × Space => ‖packetState g z.1.1 z.1.2 z.2‖^2) + (μ.prod volume) := by + have hm : Continuous (fun z : (Space × Space) × Space => ‖packetState g z.1.1 z.1.2 z.2‖^2) := by + simp only [packetState_norm] + exact ((g.continuous.comp (continuous_snd.sub continuous_fst.fst)).norm.pow 2) + apply (integrable_prod_iff hm.aestronglyMeasurable).mpr + refine ⟨Filter.Eventually.of_forall (fun yp => ?_), ?_⟩ + · exact ((packetState g yp.1 yp.2).memLp 2 volume).integrable_norm_pow (by norm_num) + · simpa only [Real.norm_of_nonneg (sq_nonneg (_ : ℝ)), packetState_integral_norm_sq] + using (integrable_const (∫ x : Space, ‖g x‖^2) : Integrable (fun _ : Space × Space => ∫ x : Space, ‖g x‖^2) μ) + +lemma packetFrame_density (g : 𝓢(Space,ℂ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + frameDensity (packetState_toL2_memLp g μ) =ᵐ[volume] + (fun x : Space => ∫ yp : Space × Space, ‖g (x-yp.1)‖^2 ∂μ) := by + have h := frameDensity_eq_ae (packetState_toL2_memLp g μ) + (fun yp x => packetState g yp.1 yp.2 x) + (fun yp => (packetState g yp.1 yp.2).coeFn_toLp 2 volume) + (packetState_joint_square_integrable g μ) + simpa only [packetState_norm] using h +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketSynthesis.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketSynthesis.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d6f129853374b562718d5625bc4f9a71f94c46f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketSynthesis.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +namespace Coulomb + +def packetSynthesis (g : Space → ℂ) (f : Space × Space → ℂ) (x : Space) : ℂ := + ∫ yp : Space × Space, f yp * (Complex.exp ((2*Real.pi*inner ℝ x yp.2 : ℝ)*Complex.I) * g (x-yp.1)) + +lemma packetSynthesis_contDiff (g : Space → ℂ) + (hg : ContDiff ℝ (⊤ : ℕ∞) g) (hgc : HasCompactSupport g) + (f : Space × Space → ℂ) (hf : LocallyIntegrable f volume) + (P : ℝ) (hP : ∀ yp, f yp ≠ 0 → ‖yp.2‖ ≤ P) : + ContDiff ℝ (⊤ : ℕ∞) (packetSynthesis g f) := by + let χ : ContDiffBump (0 : Space) := + ⟨max 1 P, max 1 P+1, lt_of_lt_of_le (by norm_num) (le_max_left _ _), by linarith⟩ + let G : Space → Space × Space → ℂ := fun x z => + Complex.exp ((-2*Real.pi*inner ℝ z.2 x : ℝ)*Complex.I) * g z.1 * (χ z.2 : ℂ) + have hG : ContDiff ℝ (⊤ : ℕ∞) (fun z : Space × (Space × Space) => G z.1 z.2) := by + dsimp only [G] + have hphase : ContDiff ℝ (⊤ : ℕ∞) (fun z : Space × (Space × Space) => + ((-2*Real.pi*inner ℝ z.2.2 z.1 : ℝ) : ℂ)) := + Complex.ofRealCLM.contDiff.comp (contDiff_const.mul (contDiff_snd.snd.inner ℝ contDiff_fst)) + have hχ : ContDiff ℝ (⊤ : ℕ∞) (fun z : Space × (Space × Space) => (χ z.2.2 : ℂ)) := + Complex.ofRealCLM.contDiff.comp (χ.contDiff.comp (contDiff_snd.snd)) + fun_prop + have hs (x : Space) (z : Space × Space) (_ : x ∈ (univ : Set Space)) + (hz : z ∉ tsupport g ×ˢ tsupport χ) : G x z = 0 := by + have hh : z.1 ∉ tsupport g ∨ z.2 ∉ tsupport χ := by simpa only [mem_prod, not_and_or] using hz + rcases hh with hz | hz + · simp [G, image_eq_zero_of_notMem_tsupport hz] + · simp [G, image_eq_zero_of_notMem_tsupport hz] + have hc := contDiffOn_convolution_right_with_param_comp + (ContinuousLinearMap.mul ℝ ℂ) (s := (univ : Set Space)) + (v := fun x : Space => (x, (0 : Space))) (f := f) (g := G) + (by fun_prop) isOpen_univ (hgc.isCompact.prod χ.hasCompactSupport.isCompact) hs hf hG.contDiffOn + rw [contDiffOn_univ] at hc + convert hc using 1 + funext x + rw [packetSynthesis, convolution_def] + apply integral_congr_ae + filter_upwards [] with yp + by_cases hz : f yp = 0 + · simp [hz] + · have hχ : χ (-yp.2) = 1 := χ.one_of_mem_closedBall (by + simp only [mem_closedBall, dist_zero_right, norm_neg] + exact (hP yp hz).trans (le_max_right _ _)) + simp only [G, Prod.fst_sub, Prod.snd_sub, zero_sub, hχ, Complex.ofReal_one, mul_one] + congr 2 + congr 1 + rw [inner_neg_left, real_inner_comm] + push_cast + ring + +lemma packetSynthesis_compactSupport (g : Space → ℂ) (hgc : HasCompactSupport g) + (f : Space × Space → ℂ) (K : Set Space) (hK : IsCompact K) + (hfK : ∀ yp, yp.1 ∉ K → f yp = 0) : HasCompactSupport (packetSynthesis g f) := by + apply HasCompactSupport.intro (hK.add hgc.isCompact) + intro x hx + apply integral_eq_zero_of_ae + filter_upwards [] with yp + by_cases hy : yp.1 ∈ K + · have hz : x-yp.1 ∉ tsupport g := by + intro hz + exact hx ⟨yp.1, hy, x-yp.1, hz, by abel_nf⟩ + simp [image_eq_zero_of_notMem_tsupport hz] + · simp [hfK yp hy] +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketSynthesisIndicator.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketSynthesisIndicator.lean new file mode 100644 index 0000000000000000000000000000000000000000..2773919bad9af8aae1c8191c6ded2e1c376e7beb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketSynthesisIndicator.lean @@ -0,0 +1,270 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.PacketFrame +import OAI.Analysis.CoulombRadii.Packets.PacketStateJointSquareIntegrable +import OAI.Analysis.CoulombRadii.Packets.PacketSynthesis +import OAI.Analysis.CoulombRadii.FormDomain.L2KernelIntegral + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +namespace Coulomb +lemma packetSynthesis_indicator_eq (g : 𝓢(Space,ℂ)) (A : Set (Space × Space)) + (hA : MeasurableSet A) (c : Space × Space → ℂ) (x : Space) : + packetSynthesis g (A.indicator c) x = + ∫ yp : Space × Space, c yp * packetState g yp.1 yp.2 x ∂(volume.restrict A) := by + rw [← integral_indicator hA] + apply integral_congr_ae + filter_upwards [] with yp + by_cases hy : yp ∈ A <;> simp [packetState_apply, hy] + +lemma packetState_joint_continuous (g : 𝓢(Space,ℂ)) : + Continuous (fun z : (Space × Space) × Space => packetState g z.1.1 z.1.2 z.2) := by + simp only [packetState_apply] + fun_prop + +lemma compactPhase_finite (A : Set (Space × Space)) (K : Set Space) (hK : IsCompact K) + (P : ℝ) (hAK : ∀ yp ∈ A, yp.1 ∈ K) (hAP : ∀ yp ∈ A, ‖yp.2‖ ≤ P) : + IsFiniteMeasure ((volume : Measure (Space × Space)).restrict A) := by + constructor + rw [Measure.restrict_apply_univ] + have hs : A ⊆ K ×ˢ closedBall 0 P := by + intro yp hy + exact ⟨hAK yp hy, by simpa only [mem_closedBall, dist_zero_right] using hAP yp hy⟩ + exact (measure_mono hs).trans_lt ((hK.prod (isCompact_closedBall (0 : Space) P)).measure_lt_top) + +lemma packetFrame_smooth_range (g : 𝓢(Space,ℂ)) (hgc : HasCompactSupport (g : Space → ℂ)) + (A : Set (Space × Space)) (hA : MeasurableSet A) + (K : Set Space) (hK : IsCompact K) (P : ℝ) + (hAK : ∀ yp ∈ A, yp.1 ∈ K) (hAP : ∀ yp ∈ A, ‖yp.2‖ ≤ P) + (u : Lp ℂ 2 (volume : Measure Space)) : + ∃ F : Space → ℂ, ContDiff ℝ (⊤ : ℕ∞) F ∧ HasCompactSupport F ∧ + (packetFrame g (volume.restrict A) u : Space → ℂ) =ᵐ[volume] F := by + let μ : Measure (Space × Space) := volume.restrict A + let := compactPhase_finite A K hK P hAK hAP + let c : Space × Space → ℂ := fun yp => inner ℂ ((packetState g yp.1 yp.2).toLp 2 volume) u + have hc : Continuous c := (packetState_toL2_continuous g).inner continuous_const + let C : ℝ := ‖g.toLp 2 volume‖ * ‖u‖ + have hC : 0 ≤ C := mul_nonneg (norm_nonneg _) (norm_nonneg _) + have hcb (yp : Space × Space) : ‖c yp‖ ≤ C := by + calc + _ ≤ ‖(packetState g yp.1 yp.2).toLp 2 volume‖ * ‖u‖ := norm_inner_le_norm _ _ + _ = C := by rw [packetState_toL2_norm] + let f := A.indicator c + have hf : LocallyIntegrable f volume := by + apply (locallyIntegrable_const C).mono (hc.aestronglyMeasurable.indicator hA) + filter_upwards [] with yp + rw [Real.norm_of_nonneg hC] + by_cases hy : yp ∈ A + · simpa [f, hy] using hcb yp + · simp [hy, hC] + have hpf (yp : Space × Space) (hy : f yp ≠ 0) : ‖yp.2‖ ≤ P := by + apply hAP yp + by_contra hn + exact hy (by simp [f, hn]) + have hfk (yp : Space × Space) (hy : yp.1 ∉ K) : f yp = 0 := by + have hn : yp ∉ A := by intro h; exact hy (hAK yp h) + simp [f, hn] + let F := packetSynthesis g f + have hFs : ContDiff ℝ (⊤ : ℕ∞) F := packetSynthesis_contDiff g (g.smooth ⊤) hgc f hf P hpf + have hFc : HasCompactSupport F := packetSynthesis_compactSupport g hgc f K hK hfk + have he (x : Space) : F x = ∫ yp, c yp * packetState g yp.1 yp.2 x ∂μ := + packetSynthesis_indicator_eq g A hA c x + have hFm : MemLp (fun x => ∫ yp, c yp * packetState g yp.1 yp.2 x ∂μ) 2 volume := by + simpa only [← he] using hFs.continuous.memLp_of_hasCompactSupport hFc (p := (2:ℝ≥0∞)) + have hK2 : MemLp (fun z : (Space × Space) × Space => packetState g z.1.1 z.1.2 z.2) 2 (μ.prod volume) := + (memLp_two_iff_integrable_sq_norm (packetState_joint_continuous g).aestronglyMeasurable).mpr + (packetState_joint_square_integrable g μ) + have hEq := l2_kernel_integral (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) + (packetState_toL2_memLp g μ) (fun yp x => packetState g yp.1 yp.2 x) + (fun yp => (packetState g yp.1 yp.2).coeFn_toLp 2 volume) hK2 c hc.aestronglyMeasurable C hcb hFm + refine ⟨F, hFs, hFc, ?_⟩ + change (frameOperator μ (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) u : Space → ℂ) =ᵐ[volume] F + have hOp := (frameOperator_apply (packetState_toL2_memLp g μ) u).trans hEq + rw [hOp] + filter_upwards [hFm.coeFn_toLp] with x hx + exact hx.trans (he x).symm + +lemma packetFrame_eigen_smooth (g : 𝓢(Space,ℂ)) (hgc : HasCompactSupport (g : Space → ℂ)) + (A : Set (Space × Space)) (hA : MeasurableSet A) + (K : Set Space) (hK : IsCompact K) (P : ℝ) + (hAK : ∀ yp ∈ A, yp.1 ∈ K) (hAP : ∀ yp ∈ A, ‖yp.2‖ ≤ P) + (u : Lp ℂ 2 (volume : Measure Space)) (lam : ℂ) (hlam : lam ≠ 0) + (hu : packetFrame g (volume.restrict A) u = lam • u) : + ∃ F : Space → ℂ, ContDiff ℝ (⊤ : ℕ∞) F ∧ HasCompactSupport F ∧ + (u : Space → ℂ) =ᵐ[volume] F := by + obtain ⟨F,hFs,hFc,hF⟩ := packetFrame_smooth_range g hgc A hA K hK P hAK hAP u + refine ⟨fun x => lam⁻¹*F x, contDiff_const.mul hFs, hFc.mul_left, ?_⟩ + rw [hu] at hF + filter_upwards [hF, Lp.coeFn_smul lam u] with x hx hy + rw [hy] at hx + change lam * u x = F x at hx + rw [← hx, ← mul_assoc, inv_mul_cancel₀ hlam, one_mul] + +open scoped Pointwise +lemma packetSynthesis_zero_of_notMem_region (g : Space → ℂ) + (f : Space × Space → ℂ) (K : Set Space) + (hfK : ∀ yp, yp.1 ∉ K → f yp = 0) (x : Space) + (hx : x ∉ K + tsupport g) : packetSynthesis g f x = 0 := by + apply integral_eq_zero_of_ae + filter_upwards [] with yp + by_cases hy : yp.1 ∈ K + · have hz : x-yp.1 ∉ tsupport g := by + intro hz + exact hx ⟨yp.1, hy, x-yp.1, hz, by abel_nf⟩ + simp [image_eq_zero_of_notMem_tsupport hz] + · simp [hfK yp hy] +lemma packetFrame_smooth_range_supported (g : 𝓢(Space,ℂ)) (hgc : HasCompactSupport (g : Space → ℂ)) + (A : Set (Space × Space)) (hA : MeasurableSet A) + (K : Set Space) (hK : IsCompact K) (P : ℝ) + (hAK : ∀ yp ∈ A, yp.1 ∈ K) (hAP : ∀ yp ∈ A, ‖yp.2‖ ≤ P) + (u : Lp ℂ 2 (volume : Measure Space)) : + ∃ F : Space → ℂ, ContDiff ℝ (⊤ : ℕ∞) F ∧ HasCompactSupport F ∧ + (packetFrame g (volume.restrict A) u : Space → ℂ) =ᵐ[volume] F ∧ + (∀ x, x ∉ K + tsupport (g : Space → ℂ) → F x = 0) := by + let μ : Measure (Space × Space) := volume.restrict A + let := compactPhase_finite A K hK P hAK hAP + let c : Space × Space → ℂ := fun yp => inner ℂ ((packetState g yp.1 yp.2).toLp 2 volume) u + have hc : Continuous c := (packetState_toL2_continuous g).inner continuous_const + let C : ℝ := ‖g.toLp 2 volume‖ * ‖u‖ + have hC : 0 ≤ C := mul_nonneg (norm_nonneg _) (norm_nonneg _) + have hcb (yp : Space × Space) : ‖c yp‖ ≤ C := by + calc + _ ≤ ‖(packetState g yp.1 yp.2).toLp 2 volume‖ * ‖u‖ := norm_inner_le_norm _ _ + _ = C := by rw [packetState_toL2_norm] + let f := A.indicator c + have hf : LocallyIntegrable f volume := by + apply (locallyIntegrable_const C).mono (hc.aestronglyMeasurable.indicator hA) + filter_upwards [] with yp + rw [Real.norm_of_nonneg hC] + by_cases hy : yp ∈ A + · simpa [f, hy] using hcb yp + · simp [hy, hC] + have hpf (yp : Space × Space) (hy : f yp ≠ 0) : ‖yp.2‖ ≤ P := by + apply hAP yp + by_contra hn + exact hy (by simp [f, hn]) + have hfk (yp : Space × Space) (hy : yp.1 ∉ K) : f yp = 0 := by + have hn : yp ∉ A := by intro h; exact hy (hAK yp h) + simp [f, hn] + let F := packetSynthesis g f + have hFs : ContDiff ℝ (⊤ : ℕ∞) F := packetSynthesis_contDiff g (g.smooth ⊤) hgc f hf P hpf + have hFc : HasCompactSupport F := packetSynthesis_compactSupport g hgc f K hK hfk + have he (x : Space) : F x = ∫ yp, c yp * packetState g yp.1 yp.2 x ∂μ := + packetSynthesis_indicator_eq g A hA c x + have hFm : MemLp (fun x => ∫ yp, c yp * packetState g yp.1 yp.2 x ∂μ) 2 volume := by + simpa only [← he] using hFs.continuous.memLp_of_hasCompactSupport hFc (p := (2:ℝ≥0∞)) + have hK2 : MemLp (fun z : (Space × Space) × Space => packetState g z.1.1 z.1.2 z.2) 2 (μ.prod volume) := + (memLp_two_iff_integrable_sq_norm (packetState_joint_continuous g).aestronglyMeasurable).mpr + (packetState_joint_square_integrable g μ) + have hEq := l2_kernel_integral (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) + (packetState_toL2_memLp g μ) (fun yp x => packetState g yp.1 yp.2 x) + (fun yp => (packetState g yp.1 yp.2).coeFn_toLp 2 volume) hK2 c hc.aestronglyMeasurable C hcb hFm + refine ⟨F, hFs, hFc, ?_, packetSynthesis_zero_of_notMem_region g f K hfk⟩ + change (frameOperator μ (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) u : Space → ℂ) =ᵐ[volume] F + have hOp := (frameOperator_apply (packetState_toL2_memLp g μ) u).trans hEq + rw [hOp] + filter_upwards [hFm.coeFn_toLp] with x hx + exact hx.trans (he x).symm + +lemma packetFrame_eigen_smooth_supported (g : 𝓢(Space,ℂ)) (hgc : HasCompactSupport (g : Space → ℂ)) + (A : Set (Space × Space)) (hA : MeasurableSet A) + (K : Set Space) (hK : IsCompact K) (P : ℝ) + (hAK : ∀ yp ∈ A, yp.1 ∈ K) (hAP : ∀ yp ∈ A, ‖yp.2‖ ≤ P) + (u : Lp ℂ 2 (volume : Measure Space)) (lam : ℂ) (hlam : lam ≠ 0) + (hu : packetFrame g (volume.restrict A) u = lam • u) : + ∃ F : Space → ℂ, ContDiff ℝ (⊤ : ℕ∞) F ∧ HasCompactSupport F ∧ + (u : Space → ℂ) =ᵐ[volume] F ∧ + (∀ x, x ∉ K + tsupport (g : Space → ℂ) → F x = 0) := by + obtain ⟨F,hFs,hFc,hF,hFS⟩ := packetFrame_smooth_range_supported g hgc A hA K hK P hAK hAP u + refine ⟨fun x => lam⁻¹*F x, contDiff_const.mul hFs, hFc.mul_left, ?_, fun x hx => by change lam⁻¹*F x = 0; rw [hFS x hx,mul_zero]⟩ + rw [hu] at hF + filter_upwards [hF, Lp.coeFn_smul lam u] with x hx hy + rw [hy] at hx + change lam * u x = F x at hx + rw [← hx, ← mul_assoc, inv_mul_cancel₀ hlam, one_mul] +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketWidthScalar.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketWidthScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..00cd6b46488eddd8e388ef770034854053bab56d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketWidthScalar.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.UniformGroundStateCountControl + +namespace OAI + +noncomputable section + +section +open Set +namespace NeutralAtom + +theorem clamped_width_scalar_lipschitz {w s u v : ℝ} + (hw : 0 ≤ w) (hs : 0 < s) (hu : 0 < u) (hv : 0 < v) : + |u * (min u s)^w - v * (min v s)^w| ≤ + (1+w)*s^w*|u-v| := by + have hbelow {x y : ℝ} (hx : 0 < x) (hxy : x ≤ y) (hy : y ≤ s) : + |y*(min y s)^w-x*(min x s)^w| ≤ (1+w)*s^w*(y-x) := by + have href : ∀ z ∈ Icc x y, + HasDerivWithinAt (fun z : ℝ => z^(w+1)) ((w+1)*z^w) (Icc x y) z := by + intro z hz + simpa only [add_sub_cancel_right] using (Real.hasDerivAt_rpow_const (p := w+1) (Or.inl (ne_of_gt (hx.trans_le hz.1)))).hasDerivWithinAt (s := Icc x y) + have hbd : ∀ z ∈ Icc x y, ‖(w+1)*z^w‖ ≤ (1+w)*s^w := by + intro z hz + rw [Real.norm_of_nonneg (mul_nonneg (by linarith) (Real.rpow_nonneg (hx.le.trans hz.1) _))] + calc + (w+1)*z^w ≤ (w+1)*s^w := mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow (hx.le.trans hz.1) (hz.2.trans hy) hw) (by linarith) + _ = (1+w)*s^w := by ring + have hh := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le href hbd + (convex_Icc x y) (show x ∈ Icc x y from ⟨le_rfl,hxy⟩) + (show y ∈ Icc x y from ⟨hxy,le_rfl⟩) + rw [Real.rpow_add_one (ne_of_gt (hx.trans_le hxy)), Real.rpow_add_one hx.ne', + Real.norm_eq_abs, Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hxy)] at hh + simpa only [min_eq_left hy, min_eq_left (hxy.trans hy), mul_comm] using hh + have hordered {x y : ℝ} (hx : 0 < x) (hxy : x ≤ y) : + |y*(min y s)^w-x*(min x s)^w| ≤ (1+w)*s^w*(y-x) := by + by_cases hy : y ≤ s + · exact hbelow hx hxy hy + by_cases hxs : s ≤ x + · rw [min_eq_right hxs, min_eq_right (hxs.trans hxy), ←sub_mul, + abs_of_nonneg (mul_nonneg (sub_nonneg.mpr hxy) (Real.rpow_nonneg hs.le _))] + have hw0 := mul_nonneg hw (mul_nonneg (Real.rpow_nonneg hs.le w) (sub_nonneg.mpr hxy)) + nlinarith + · have hxle : x ≤ s := le_of_not_ge hxs + have hsy : s ≤ y := le_of_not_ge hy + have hh := hbelow hx hxle le_rfl + rw [min_self, min_eq_left hxle] at hh + have he : y*s^w - x*x^w = (y-s)*s^w+(s*s^w-x*x^w) := by ring + rw [min_eq_right hsy, min_eq_left hxle,he] + calc + |(y-s)*s^w+(s*s^w-x*x^w)| ≤ |(y-s)*s^w|+|s*s^w-x*x^w| := abs_add_le _ _ + _ ≤ (y-s)*s^w+(1+w)*s^w*(s-x) := by + rw [abs_of_nonneg (mul_nonneg (sub_nonneg.mpr hsy) (Real.rpow_nonneg hs.le _))] + exact add_le_add_right hh _ + _ ≤ (1+w)*s^w*(y-x) := by + have hw0 := mul_nonneg hw (mul_nonneg (Real.rpow_nonneg hs.le w) (sub_nonneg.mpr hsy)) + nlinarith + rcases le_total u v with huv | hvu + · rw [abs_sub_comm,abs_of_nonpos (sub_nonpos.mpr huv)] + simpa only [neg_sub] using hordered hu huv + · rw [abs_of_nonneg (sub_nonneg.mpr hvu)] + exact hordered hv hvu +end NeutralAtom + +end +open MeasureTheory Filter +open scoped Topology BigOperators ENNReal +namespace NeutralAtom + +theorem continuous_packetWidth (c₁ r₀ s : ℝ) : Continuous (packetWidth c₁ r₀ s) := by + unfold packetWidth + fun_prop (disch := norm_num [packetExponent]) + +theorem packetWidth_lipschitz {c r₀ s : ℝ} (hc : 0 ≤ c) + (hr : 0 < r₀) (hs : 0 < s) (z z' : Position) : + |packetWidth c r₀ s z-packetWidth c r₀ s z'| ≤ + (c*(1+packetExponent)*s^packetExponent)*‖z-z'‖ := by + have h := clamped_width_scalar_lipschitz (w := packetExponent) (u := max ‖z‖ r₀) (v := max ‖z'‖ r₀) (by norm_num [packetExponent]) hs + (hr.trans_le (le_max_right _ _)) (hr.trans_le (le_max_right _ _)) + have hm : |max ‖z‖ r₀-max ‖z'‖ r₀| ≤ ‖z-z'‖ := by + calc + _ ≤ max |‖z‖-‖z'‖| |r₀-r₀| := abs_max_sub_max_le_max _ _ _ _ + _ = |‖z‖-‖z'‖| := by simp + _ ≤ ‖z-z'‖ := abs_norm_sub_norm_le _ _ + unfold packetWidth + rw [show c*max ‖z‖ r₀*(min (max ‖z‖ r₀) s)^packetExponent- + c*max ‖z'‖ r₀*(min (max ‖z'‖ r₀) s)^packetExponent = + c*(max ‖z‖ r₀*(min (max ‖z‖ r₀) s)^packetExponent- + max ‖z'‖ r₀*(min (max ‖z'‖ r₀) s)^packetExponent) by ring, + abs_mul,abs_of_nonneg hc] + calc + _ ≤ c*((1+packetExponent)*s^packetExponent*|max ‖z‖ r₀-max ‖z'‖ r₀|) := + mul_le_mul_of_nonneg_left h hc + _ ≤ (c*(1+packetExponent)*s^packetExponent)*‖z-z'‖ := by + have hh := mul_le_mul_of_nonneg_left hm + (show 0 ≤ c*(1+packetExponent)*s^packetExponent from + mul_nonneg (mul_nonneg hc (by norm_num [packetExponent])) (Real.rpow_nonneg hs.le _)) + simpa only [mul_assoc] using hh + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PacketWindowed.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PacketWindowed.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ab4c0039856df772545638b4503b4882a4fd58e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PacketWindowed.lean @@ -0,0 +1,228 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +noncomputable def packetWindowed (g h : 𝓢(Space,ℂ)) (y : Space) : 𝓢(Space,ℂ) := + SchwartzMap.smulLeftCLM ℂ + ((SchwartzMap.compSubConstCLM ℂ y g).postcompCLM Complex.conjCLE.toContinuousLinearMap) h +lemma packetWindowed_apply (g h : 𝓢(Space,ℂ)) (y x : Space) : + packetWindowed g h y x = conj (g (x-y))*h x := by + unfold packetWindowed + rw [SchwartzMap.smulLeftCLM_apply_apply + ((SchwartzMap.compSubConstCLM ℂ y g).postcompCLM Complex.conjCLE.toContinuousLinearMap).hasTemperateGrowth] + rfl +noncomputable def packetAnalysis (g h : 𝓢(Space,ℂ)) (y p : Space) : ℂ := + 𝓕 (packetWindowed g h y) p +lemma packetAnalysis_integral (g h : 𝓢(Space,ℂ)) (y p : Space) : + packetAnalysis g h y p = ∫ x : Space, + Complex.exp ((-2*Real.pi*inner ℝ x p : ℝ)*Complex.I)*(conj (g (x-y))*h x) := by + unfold packetAnalysis + rw [SchwartzMap.fourier_coe,Real.fourier_eq'] + simp only [packetWindowed_apply,smul_eq_mul] +lemma packetAnalysis_measurable (g h : 𝓢(Space,ℂ)) : + StronglyMeasurable (fun yp : Space × Space => packetAnalysis g h yp.1 yp.2) := by + simp only [packetAnalysis_integral] + let k : (Space × Space) × Space → ℂ := fun z => + Complex.exp ((-2*Real.pi*inner ℝ z.2 z.1.2 : ℝ)*Complex.I)* + (conj (g (z.2-z.1.1))*h z.2) + have hk : Continuous k := by + exact (((Complex.continuous_ofReal.comp (continuous_const.mul ((continuous_snd.inner continuous_fst.snd)))).mul + continuous_const).cexp).mul + (((Complex.continuous_conj.comp (g.continuous.comp (continuous_snd.sub continuous_fst.fst)))).mul + (h.continuous.comp continuous_snd)) + exact hk.stronglyMeasurable.integral_prod_right' +lemma packetAnalysis_momentum (g h : 𝓢(Space,ℂ)) (y : Space) : + (∫ p : Space,‖packetAnalysis g h y p‖^2) = + ∫ x : Space, ‖g (x-y)‖^2*‖h x‖^2 := by + simp only [packetAnalysis] + rw [SchwartzMap.integral_norm_sq_fourier] + simp [packetWindowed_apply,mul_pow] +lemma packetAnalysis_momentum_integrable (g h : 𝓢(Space,ℂ)) (y : Space) : + Integrable (fun p : Space => ‖packetAnalysis g h y p‖^2) := + (𝓕 (packetWindowed g h y)).memLp 2 volume |>.integrable_norm_pow (by norm_num) +lemma packetWindowed_joint_integrable (g h : 𝓢(Space,ℂ)) : + Integrable (fun yx : Space × Space => ‖g (yx.2-yx.1)‖^2*‖h yx.2‖^2) + (volume.prod volume) := by + have hg : Integrable (fun x : Space => ‖g x‖^2) := + (g.memLp 2 volume).integrable_norm_pow (by norm_num) + have hh : Integrable (fun x : Space => ‖h x‖^2) := + (h.memLp 2 volume).integrable_norm_pow (by norm_num) + have hm : Continuous (fun yx : Space × Space => ‖g (yx.2-yx.1)‖^2*‖h yx.2‖^2) := + ((g.continuous.comp (continuous_snd.sub continuous_fst)).norm.pow 2).mul + ((h.continuous.comp continuous_snd).norm.pow 2) + apply (integrable_prod_iff' hm.aestronglyMeasurable).mpr + refine ⟨Filter.Eventually.of_forall (fun x => (hg.comp_sub_left x).mul_const (‖h x‖^2)),?_⟩ + change Integrable (fun x : Space => ∫ y : Space, ‖‖g (x-y)‖^2*‖h x‖^2‖) + have hs (x : Space) : (∫ y : Space,‖g (x-y)‖^2) = ∫ y : Space,‖g y‖^2 := + integral_sub_left_eq_self (fun y : Space => ‖g y‖^2) volume x + simp only [Real.norm_of_nonneg (mul_nonneg (sq_nonneg _) (sq_nonneg _)),integral_mul_const,hs] + exact hh.const_mul _ +lemma packetWindowed_joint_integral (g h : 𝓢(Space,ℂ)) : + (∫ yx : Space × Space, ‖g (yx.2-yx.1)‖^2*‖h yx.2‖^2 ∂volume.prod volume) = + (∫ x : Space,‖g x‖^2)*(∫ x : Space,‖h x‖^2) := by + rw [integral_prod_symm _ (packetWindowed_joint_integrable g h)] + have hs (x : Space) : (∫ y : Space,‖g (x-y)‖^2) = ∫ y : Space,‖g y‖^2 := + integral_sub_left_eq_self (fun y : Space => ‖g y‖^2) volume x + simp only [integral_mul_const,hs,integral_const_mul] +lemma packetAnalysis_integrable (g h : 𝓢(Space,ℂ)) : + Integrable (fun yp : Space × Space => ‖packetAnalysis g h yp.1 yp.2‖^2) + (volume.prod volume) := by + apply (integrable_prod_iff ((packetAnalysis_measurable g h).norm.pow 2).aestronglyMeasurable).mpr + refine ⟨Filter.Eventually.of_forall (packetAnalysis_momentum_integrable g h),?_⟩ + change Integrable (fun y : Space => ∫ p : Space, ‖‖packetAnalysis g h y p‖^2‖) + simp only [Real.norm_of_nonneg (sq_nonneg _),packetAnalysis_momentum] + exact (packetWindowed_joint_integrable g h).integral_prod_left +lemma packetAnalysis_resolution (g h : 𝓢(Space,ℂ)) : + (∫ yp : Space × Space,‖packetAnalysis g h yp.1 yp.2‖^2 ∂volume.prod volume) = + (∫ x : Space,‖g x‖^2)*(∫ x : Space,‖h x‖^2) := by + rw [integral_prod _ (packetAnalysis_integrable g h)] + simp only [packetAnalysis_momentum] + rw [←integral_prod _ (packetWindowed_joint_integrable g h)] + exact packetWindowed_joint_integral g h +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +noncomputable def packetState (g : 𝓢(Space,ℂ)) (y p : Space) : 𝓢(Space,ℂ) := + 𝓕⁻ (SchwartzMap.compSubConstCLM ℂ p (𝓕 (SchwartzMap.compSubConstCLM ℂ y g))) +lemma packetState_apply (g : 𝓢(Space,ℂ)) (y p x : Space) : + packetState g y p x = Complex.exp ((2*Real.pi*inner ℝ x p : ℝ)*Complex.I)*g (x-y) := by + let h := SchwartzMap.compSubConstCLM ℂ y g + have ht := congrFun (VectorFourier.fourierIntegral_comp_add_right + Real.fourierChar volume (-(innerₗ Space)) (⇑(𝓕 h : 𝓢(Space,ℂ))) (-p)) x + have ht' : 𝓕⁻ (SchwartzMap.compSubConstCLM ℂ p (𝓕 h)) x = + Real.fourierChar (inner ℝ p x) • 𝓕⁻ (𝓕 h) x := by + have hh : ((𝓕 h : 𝓢(Space,ℂ)) ∘ fun v => v + -p) = + (SchwartzMap.compSubConstCLM ℂ p (𝓕 h) : Space → ℂ) := by + ext v + simp [sub_eq_add_neg] + rw [hh] at ht + change 𝓕⁻ (⇑(SchwartzMap.compSubConstCLM ℂ p (𝓕 h))) x = + Real.fourierChar (-inner ℝ (-p) x) • 𝓕⁻ (⇑(𝓕 h : 𝓢(Space,ℂ))) x at ht + simp only [inner_neg_left,neg_neg] at ht + simpa only [SchwartzMap.fourierInv_coe] using ht + change 𝓕⁻ (SchwartzMap.compSubConstCLM ℂ p (𝓕 h)) x = _ + rw [ht',FourierTransform.fourierInv_fourier_eq] + simp [h,Circle.smul_def,Real.fourierChar_apply,real_inner_comm] +lemma packetState_norm (g : 𝓢(Space,ℂ)) (y p x : Space) : + ‖packetState g y p x‖ = ‖g (x-y)‖ := by + rw [packetState_apply,norm_mul,Complex.norm_exp] + simp +lemma packetState_integral_norm_sq (g : 𝓢(Space,ℂ)) (y p : Space) : + (∫ x : Space,‖packetState g y p x‖^2) = ∫ x : Space,‖g x‖^2 := by + simp only [packetState_norm] + exact integral_sub_right_eq_self (fun x : Space => ‖g x‖^2) y +lemma packetState_inner (g h : 𝓢(Space,ℂ)) (y p : Space) : + inner ℂ ((packetState g y p).toLp 2 volume) (h.toLp 2 volume) = packetAnalysis g h y p := by + rw [SchwartzMap.inner_toL2_toL2_eq _ _ volume,packetAnalysis_integral] + apply integral_congr_ae + filter_upwards [] with x + simp only [packetState_apply,RCLike.inner_apply',starRingEnd_apply,map_mul,mul_assoc] + congr 1 + change conj (Complex.exp _) = _ + rw [←Complex.exp_conj] + congr 1 + simp only [map_mul,Complex.conj_ofReal,Complex.conj_I] + push_cast + ring + +lemma packetAnalysis_continuous (g h : 𝓢(Space,ℂ)) : + Continuous (fun yp : Space × Space => packetAnalysis g h yp.1 yp.2) := by + simp only [packetAnalysis_integral] + let C := SchwartzMap.seminorm ℝ 0 0 g + have hC := SchwartzMap.norm_le_seminorm ℝ g + apply MeasureTheory.continuous_of_dominated + (bound := fun x : Space => C * ‖h x‖) + · intro yp + exact (((Complex.continuous_ofReal.comp + (continuous_const.mul (continuous_id.inner continuous_const))).mul continuous_const).cexp.mul + ((Complex.continuous_conj.comp (g.continuous.comp (continuous_id.sub continuous_const))).mul + h.continuous)).aestronglyMeasurable + · intro yp + filter_upwards [] with x + simp only [norm_mul, Complex.norm_exp] + have he : ((-2*Real.pi*inner ℝ x yp.2 : ℝ)*Complex.I : ℂ).re = 0 := by simp + rw [he, Real.exp_zero, one_mul, Complex.norm_conj] + exact mul_le_mul_of_nonneg_right (hC (x-yp.1)) (norm_nonneg _) + · exact h.integrable.norm.const_mul C + · filter_upwards [] with x + exact (((Complex.continuous_ofReal.comp + (continuous_const.mul (continuous_const.inner continuous_snd))).mul continuous_const).cexp.mul + ((Complex.continuous_conj.comp (g.continuous.comp (continuous_const.sub continuous_fst))).mul + continuous_const)) +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PatchKernelDuality.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PatchKernelDuality.lean new file mode 100644 index 0000000000000000000000000000000000000000..7ad7adc59484bb62ad29a5e4b05c875204b51bf1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PatchKernelDuality.lean @@ -0,0 +1,218 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.MasterKernelDuality +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchNegativeCost + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace Coulomb + +theorem master_kernel_patch_gap (g : 𝓢(NeutralAtom.Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hm : (∫ z, g z^2)=1) : + ∃ C : ℝ, 0 tfDensity_eq_zero _ hz + have hd := hσ.sub (hρ.restrict (s := Ω)) + have hds : ∀ z∉Ω, σ z-ρ z=0 := fun z hz => by rw [hσs z hz,hρs z hz,sub_self] + have HH := H hc hr hs hq y measurableSet_ball (fun z => σ z-ρ z) hd hds + (fun z hz => show z∈Ω from (Metric.mem_ball.mpr ((Metric.mem_closedBall.mp hz).trans_lt hball))) + have Hgap := rawTF_gap_coulomb measurableSet_ball + (coreScreenedField S (u.coreSlice spin x).normalized) W + (coreTFField_coe S _ measurableSet_ball ha (patch_nucleus_separation S ha hb ht y hn)) hσ + (Eventually.of_forall (fun z => retainedFineDensity_nonneg b _ _ z)) hσs + have Hmul := mul_le_mul_of_nonneg_left Hgap + (show 0≤C/(NeutralAtom.packetWidth c r₀ s y)^5 by + have hw := NeutralAtom.packetWidth_pos hc hr hs y + positivity) + apply HH.trans + convert Hmul using 1 + dsimp only [σ,ρ,W,patchSliceTFGap] + ring + +end Coulomb + +namespace NeutralAtom + +theorem kernel_sum_matching {n : ℕ} (K : Position → ℝ) (y : Position) + {R A d : ℝ} (hA : 0 ≤ A) (hd : 0 ≤ d) + (hs : ∀ z, R < ‖z-y‖ → K z=0) + (hL : ∀ z v, |K z-K v| ≤ A*‖z-v‖) + (x v : Configuration n) (hv : ∀ i, ‖x i-v i‖ ≤ d) : + |(∑ i, K (x i))-(∑ i, K (v i))| ≤ + (A*d)*rawCount (Metric.closedBall y (R+d)) v := by + rw [←Finset.sum_sub_distrib,rawCount,Finset.mul_sum] + apply (Finset.abs_sum_le_sum_abs _ _).trans + apply Finset.sum_le_sum + intro i _ + by_cases hi : v i ∈ Metric.closedBall y (R+d) + · rw [indicator_of_mem hi,mul_one] + exact (hL _ _).trans (mul_le_mul_of_nonneg_left (hv i) hA) + · rw [indicator_of_notMem hi,mul_zero] + have hvi : R+d < ‖v i-y‖ := by + simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hi + have hxi : R < ‖x i-y‖ := by + have htri := norm_sub_le_norm_sub_add_norm_sub (v i) (x i) y + rw [norm_sub_rev (v i) (x i)] at htri + linarith [hv i] + rw [hs _ hxi,hs _ (by linarith),sub_self,abs_zero] + +theorem kernel_sum_matching_permuted {n : ℕ} (K : Position → ℝ) (y : Position) + {R A d : ℝ} (hA : 0 ≤ A) (hd : 0 ≤ d) + (hs : ∀ z, R < ‖z-y‖ → K z=0) + (hL : ∀ z v, |K z-K v| ≤ A*‖z-v‖) + (x v : Configuration n) (p : Equiv.Perm (Fin n)) + (hv : ∀ i, ‖x (p i)-v i‖ ≤ d) : + |(∑ i, K (x i))-(∑ i, K (v i))| ≤ + (A*d)*rawCount (Metric.closedBall y (R+d)) v := by + have hh := kernel_sum_matching K y hA hd hs hL (x ∘ p) v hv + have he := Equiv.sum_comp p (fun i => K (x i)) + simp only [Function.comp_apply] at hh + rw [he] at hh + exact hh + +theorem master_kernel_matching (g : 𝓢(Position,ℝ)) + (hg : ∀ x, 1 < ‖x‖ → g x=0) (hm : (∫ x, g x^2)=1) : + ∃ C : ℝ, 0 < C ∧ ∀ {c r₀ s : ℝ}, 0 fineKernel b (z-w)*K z) := + (fineKernel_shift_integrable hb w).mul_bdd hKm.aestronglyMeasurable + (Eventually.of_forall (fun z => by simpa only [Real.norm_eq_abs] using hB z)) + +lemma fineKernel_test_matching {b A B : ℝ} (hb : 0 fineKernel b (z-w)*(K z-K w))= + (fun z => fineKernel b (z-w)*K z-fineKernel b (z-w)*K w) by funext z; ring, + integral_sub hi hc,integral_mul_const,fineKernel_shift_integral hb,one_mul] + rw [he] + calc + _≤∫ z, |fineKernel b (z-w)*(K z-K w)| := abs_integral_le_integral_abs + _≤∫ z, fineKernel b (z-w)*(A*(2*b)) := by + apply integral_mono + · simpa only [Pi.sub_apply,Real.norm_eq_abs,mul_sub] using (hi.sub hc).norm + · exact (fineKernel_shift_integrable hb w).mul_const _ + · intro z + dsimp only + rw [abs_mul,abs_of_nonneg (fineKernel_nonneg ..)] + by_cases hz : fineKernel b (z-w)=0 + · simp only [hz,zero_mul,le_refl] + · have hs : ‖z-w‖≤2*b := le_of_not_gt (fun hh => hz (fineKernel_eq_zero_of_two_mul_lt hb _ hh)) + exact mul_le_mul_of_nonneg_left ((hL z w).trans (mul_le_mul_of_nonneg_left hs hA)) (fineKernel_nonneg ..) + _=A*(2*b) := by rw [integral_mul_const,fineKernel_shift_integral hb,one_mul] + +lemma fineKernel_test_zero_far {b R : ℝ} (hb : 0 hz (fineKernel_eq_zero_of_two_mul_lt hb _ hh)) + have htri := norm_sub_le_norm_sub_add_norm_sub w z y + rw [norm_sub_rev w z] at htri + rw [hs z (by linarith),mul_zero] + +theorem patchFine_kernel_matching {n : ℕ} {b t R A B : ℝ} (hb : 0 fineKernel_test_integrable hb K hKm hB _),hsum,←Finset.sum_sub_distrib] + calc + _≤∑ i∈r, |(∫ z, fineKernel b (z-position x i)*K z)-K (position x i)| := + Finset.abs_sum_le_sum_abs _ _ + _≤∑ i∈r, (A*(2*b))*(Metric.closedBall y (R+2*b)).indicator (fun _ => (1:ℝ)) (position x i) := by + apply Finset.sum_le_sum + intro i _ + by_cases hi : position x i ∈ Metric.closedBall y (R+2*b) + · rw [indicator_of_mem hi,mul_one] + exact fineKernel_test_matching hb hA K hKm hB hL _ + · rw [indicator_of_notMem hi,mul_zero] + have hn : R+2*b<‖position x i-y‖ := by + simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hi + rw [fineKernel_test_zero_far hb K y _ hs hn,hs _ (by linarith),sub_self,abs_zero] + _≤∑ i, (A*(2*b))*(Metric.closedBall y (R+2*b)).indicator (fun _ => (1:ℝ)) (position x i) := by + apply Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) + intro i _ _ + exact mul_nonneg (by positivity) (indicator_nonneg (fun _ _ => by norm_num) _) + _=(A*(2*b))*localCount (Metric.closedBall y (R+2*b)) x := by + rw [localCount,Finset.mul_sum] + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PatchPacketResponse.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PatchPacketResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d82ae644342f34c0f154b14ecb2fa36fa3ed77b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PatchPacketResponse.lean @@ -0,0 +1,168 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalDensity +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchResponse +import OAI.Analysis.CoulombRadii.Packets.PatchKernelDuality + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace Coulomb + +theorem master_kernel_patch_response (g : 𝓢(NeutralAtom.Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hm : (∫ z, g z^2)=1) : + ∃ C D E : ℝ, 0 NeutralAtom.packetKernel g c r₀ s z y + let v := patchTFScreenedField S (u.coreSlice spin x).normalized ha hb ht.2 y hn y + let d := C*(2*w/a)*((a^4)⁻¹+max (-v) 0) + let e := Real.sqrt ((D/w^5)*patchSliceTFGap S u ha hb ht.2 y hn spin x) + let I := ∫ z, retainedFineDensity b (patchRetained y t b x) (position x) z*χ z + tfScalarDensity (v-d)*(∫ z, χ z)-e≤I ∧ + I≤tfScalarDensity (v+d)*(∫ z, χ z)+e ∧ + |(∫ z, χ z)-1|≤E*(c*(1+NeutralAtom.packetExponent)*s^NeutralAtom.packetExponent) := by + obtain ⟨C,hC,HC⟩ := exists_patch_tested_reaction_enclosure + obtain ⟨D,hD,HD⟩ := master_kernel_patch_gap g hg hm + obtain ⟨E,hE,HE⟩ := NeutralAtom.master_kernel_estimates g hg hm + refine ⟨C,D,E,hC,hD,hE,?_⟩ + intro c r₀ s hc hr hs hq J m k S u a b t ha hb hsmall ht y hn hw hball spin x hcs + let w := NeutralAtom.packetWidth c r₀ s y + let χ := fun z => NeutralAtom.packetKernel g c r₀ s z y + let W := coreTFField S (u.coreSlice spin x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn) + let ρ := localTFDensity measurableSet_ball W + let σ := retainedFineDensity b (patchRetained y t b x) (position x) + have hwp : 0 NeutralAtom.packetKernel_nonneg g hc hr hs z y) (E/w^3) hamp + (fun z hz => by simpa only [norm_sub_rev] using hsp z hz) + have Hdual := HD hc hr hs hq S u ha hb ht.2 y hn hball spin x + have hρi : Integrable ρ := (tfExtend_integrable measurableSet_ball (localTFMinimizer measurableSet_ball W)).congr + (tfDensity_ae_tfExtend measurableSet_ball (localTFMinimizer_nonneg measurableSet_ball W)).symm + have htestρ : Integrable (fun z => ρ z*χ z) := hρi.mul_bdd hχm.aestronglyMeasurable + (Eventually.of_forall (fun z => by simpa only [Real.norm_eq_abs] using hamp z)) + have htestσ : Integrable (fun z => σ z*χ z) := + (retainedFineDensity_integrable hb _ _).mul_bdd hχm.aestronglyMeasurable + (Eventually.of_forall (fun z => by simpa only [Real.norm_eq_abs] using hamp z)) + have heq : (∫ z, (σ z-ρ z)*χ z)=(∫ z, σ z*χ z)-(∫ z, ρ z*χ z) := by + simp_rw [sub_mul] + rw [integral_sub htestσ htestρ] + change (∫ z, (σ z-ρ z)*χ z)^2≤(D/w^5)*patchSliceTFGap S u ha hb ht.2 y hn spin x at Hdual + rw [heq] at Hdual + have hpos : 0≤(D/w^5)*patchSliceTFGap S u ha hb ht.2 y hn spin x := + mul_nonneg (by positivity) (patchSliceTFGap_nonneg S u ha hb ht.2 y hn spin x) + have Habs : |(∫ z, σ z*χ z)-(∫ z, ρ z*χ z)|≤ + Real.sqrt ((D/w^5)*patchSliceTFGap S u ha hb ht.2 y hn spin x) := by + apply (sq_le_sq₀ (abs_nonneg _) (Real.sqrt_nonneg _)).mp + rw [sq_abs,Real.sq_sqrt hpos] + exact Hdual + have HH := abs_le.mp Habs + dsimp only at Hresponse ⊢ + refine ⟨?_,?_,hχmass⟩ <;> dsimp only [ρ,W,σ,χ,w] at Hresponse HH ⊢ <;> linarith [Hresponse.1,Hresponse.2] + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace Coulomb + +theorem master_kernel_patch_array_response (g : 𝓢(NeutralAtom.Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hm : (∫ z, g z^2)=1) : + ∃ C D E F : ℝ, 0 NeutralAtom.packetKernel g c r₀ s z y + let v := patchTFScreenedField S (u.coreSlice spin x).normalized ha hb ht.2 y hn y + let d := C*(2*w/a)*((a^4)⁻¹+max (-v) 0) + let e := Real.sqrt ((D/w^5)*patchSliceTFGap S u ha hb ht.2 y hn spin x)+ + (F/w^4*(2*b))*localCount (Metric.closedBall y (2*w+2*b)) x + tfScalarDensity (v-d)*(∫ z, χ z)-e≤∑ i, χ (position x i) ∧ + (∑ i, χ (position x i))≤tfScalarDensity (v+d)*(∫ z, χ z)+e ∧ + |(∫ z, χ z)-1|≤E*(c*(1+NeutralAtom.packetExponent)*s^NeutralAtom.packetExponent) := by + obtain ⟨C,D,E,hC,hD,hE,H⟩ := master_kernel_patch_response g hg hm + obtain ⟨F,hF,HF⟩ := NeutralAtom.master_kernel_estimates g hg hm + refine ⟨C,D,E,F,hC,hD,hE,hF,?_⟩ + intro c r₀ s hc hr hs hq J m k S u a b t ha hb hsmall ht y hn hw spin x hcs + let w := NeutralAtom.packetWidth c r₀ s y + let χ := fun z => NeutralAtom.packetKernel g c r₀ s z y + have hpw : 0 by by_contra hn; have HH := hsp z hn; rw [norm_sub_rev] at HH; linarith) + hL x + have habs := abs_le.mp hmatch + dsimp only at HH ⊢ + refine ⟨?_,?_,HH.2.2⟩ <;> dsimp only [χ,w] at habs ⊢ <;> linarith [HH.1,HH.2.1] + +lemma shifted_negative_feedback_mono {θ A : ℝ} (_ : 0≤θ) (hθ1 : θ≤1) : + Monotone (fun v : ℝ => v+θ*(A+max (-v) 0)) := by + intro v w hvw + change v+θ*(A+max (-v) 0)≤w+θ*(A+max (-w) 0) + by_cases hv : 0≤v + · have hw : 0≤w := hv.trans hvw + rw [max_eq_right (by linarith : -v≤0),max_eq_right (by linarith : -w≤0)] + linarith + · by_cases hw : 0≤w + · rw [max_eq_left (by linarith : 0≤-v),max_eq_right (by linarith : -w≤0)] + nlinarith [mul_le_mul_of_nonneg_right hθ1 (show 0≤-v by linarith)] + · rw [max_eq_left (by linarith : 0≤-v),max_eq_left (by linarith : 0≤-w)] + nlinarith [mul_nonneg (show 0≤1-θ by linarith) (show 0≤w-v by linarith)] + +theorem tf_response_center_exclusion {v θ A M e I L U : ℝ} + (hθ : 0≤θ) (hθ1 : θ≤1) (hM : 0≤M) (hU : 0≤U) + (hlower : tfScalarDensity (v-θ*(A+max (-v) 0))*M-e≤I) + (hupper : I≤tfScalarDensity (v+θ*(A+max (-v) 0))*M+e) : + (tfScalarDensity (L+θ*(A+max (-L) 0))*M+e packet_ball_containment hgs hc hr₀ hs hrR hq hz hK) o.1 + +lemma raw_population_asH1 {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {S : Set Position} (hS : MeasurableSet S) : + (∫ x,rawCount S x ∂rawLaw ψ)= + Coulomb.expectedPopulation (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) S := by + rw [integral_rawLaw hd.2.2.1,rawExpectation_eq_stateWeightedIntegral hd.2.2.1 + (measurable_rawCount hS) (C:=(n:ℝ)) (fun x => by + rw [Real.norm_of_nonneg (rawCount_nonneg S x)]; exact rawCount_le_number S x)] + rw [Coulomb.expectedPopulation_eq _ hS] + change stateWeightedIntegral ψ (fun x => ∑ i : Fin n,S.indicator (fun _ => (1:ℝ)) (x i))=_ + simpa only [Coulomb.potentialForm,Coulomb.localCount,position_flattenConfiguration,rawCount] using + (asH1_potentialForm ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1 (Coulomb.localCount S)).symm +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalInverseCap.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalInverseCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e6b465e46c888b0a057353ec93ba95c820870ad --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalInverseCap.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationAnnulusTail +import OAI.Analysis.CoulombRadii.Screening.PhysicalSpatialCap +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorBandOscillation +import OAI.Analysis.CoulombRadii.Packets.NormalizedInversePoint +import OAI.Analysis.CoulombRadii.Packets.MeshInverseDeterministic +import OAI.Analysis.CoulombRadii.RandomFields.FiniteInverseEvent +import OAI.Analysis.CoulombRadii.Packets.SimultaneousInverseScale +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalBandEvent + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_simultaneous_inverse_cap (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z,1 < ‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) + (hrad : ∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) + {c L hl hh ξ : ℝ} (hc : 0 < c) (hL : 1 ≤ L) + (hξ : 0 < ξ) (hξl : ξ < hl) (hlh : hl ≤ hh) : + ∃ C : ℝ,0 < C ∧ ∀ D : ℝ,0 ≤ D → ∃ s₀ : ℝ,0 < s₀ ∧ s₀ ≤ 1 ∧ + ∀ {N J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction (N+1)} {g : Gradient (N+1)}, + ∀ (hd : FormDomain ψ g) (hn : normSquared ψ=1), + (∀ (χ : Wavefunction (N+1)) (h : Gradient (N+1)),FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) → + ∀ {E : ℝ},(E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D → ∀ {r₀ s : ℝ},0 < r₀ → 0 < s → s < s₀ → + ∀ (j : Fin J),r₀*2^j.val ≤ s → + letI := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + let r := fun k : Fin J => r₀*2^k.val + ∃ G : Set (ObservationSample (N+1) J), + (MeasurableSet G ∧ MeasurableSet[observationSigma r j.val] G) ∧ + P.real Gᶜ ≤ C*(r j)^25 ∧ ∀ a∈G,∀ y : Position,r j ≤ ‖y‖ → ‖y‖ ≤ 4*L*(r j) → + let μ := conditionalPacketDensity P Prod.fst (tailObservation r j.val) g₀ c r₀ s + (tailObservation r j.val a) + let F := (Z:ℝ)*coulombKernel y-potentialOf μ y + ‖y‖^4*F ≤ physicalSpatialCap ∧ ∀ h∈Icc hl hh, + (Coulomb.tfScalarDensity h ≤ ‖y‖^6*μ y → h-ξ ≤ ‖y‖^4*F) ∧ + (‖y‖^6*μ y ≤ Coulomb.tfScalarDensity h → ‖y‖^4*F ≤ h+ξ) := by + obtain ⟨K,hK,Hcount⟩ := physical_observed_small_annular_count_tail + (by norm_num : (0:ℝ) < 1/8) (by norm_num : (1/8:ℝ) < 1/4) + (by linarith : (1/4:ℝ) < 12*L) (by linarith : 12*L < 13*L) + obtain ⟨B,T,hB,hT,Hreg⟩ := physical_posterior_band_event g₀ hg + obtain ⟨Co,hCo,Hosc⟩ := posterior_count_cap_oscillation hB hK.le + obtain ⟨heights,hhband,hheights⟩ := exists_height_brackets hξ hξl hlh + obtain ⟨ε,hε,hmargin⟩ := exists_density_mesh_margin hξ hξl hlh + obtain ⟨Cp,hCp,Hcap⟩ := physical_retained_spatial_cap hL + let A := (4*L)^4*Co+4*(4*L)^3*max physicalSpatialCap 1 + let B' := (4*L)^6*(T*K)+6*(4*L)^5*(B*K) + have hA : 0 ≤ A := by dsimp [A]; positivity + have hB' : 0 ≤ B' := by dsimp [B']; positivity + let C := 1+Cp+2*(12*L+1)^3*(heights.card:ℝ) + have hC : 0 < C := by + change 0 < 1+Cp+2*(12*L+1)^3*(heights.card:ℝ) + have hlast : 0 ≤ 2*(12*L+1)^3*(heights.card:ℝ) := + mul_nonneg (mul_nonneg (by norm_num) (pow_nonneg (by linarith) _)) (Nat.cast_nonneg _) + linarith + refine ⟨C,hC,?_⟩ + intro D hD + obtain ⟨sc,hsc,Hc⟩ := Hcount D hD + obtain ⟨sp,hsp,hsp1,Hp⟩ := physical_normalized_inverse_point g₀ hg hm hrad hD hc hL hK.le + (by positivity : 0 < ξ/2) (show ξ/2 < hl/2 by linarith) + (show hl/2 ≤ 2*hh by linarith) + obtain ⟨sn,hsn,hsn16,Hn⟩ := exists_simultaneous_inverse_scale (L:=L) (D:=D) (A:=A) (B:=B') hc hξ hε + let s₀ := min sc (min sp sn) + have hs₀sc : s₀ ≤ sc := min_le_left _ _ + have hs₀sp : s₀ ≤ sp := (min_le_right _ _).trans (min_le_left _ _) + have hs₀sn : s₀ ≤ sn := (min_le_right _ _).trans (min_le_right _ _) + refine ⟨s₀,lt_min hsc (lt_min hsp hsn),(hs₀sn.trans hsn16).trans (by norm_num),?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE hbase r₀ s hr₀ hs hss j hrs + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let r : Fin J → ℝ := fun k => r₀*2^k.val + let R := r j + have hR : 0 < R := by dsimp [R,r]; positivity + have hR₀ : r₀ ≤ R := le_mul_of_one_le_right hr₀.le (one_le_pow₀ (by norm_num)) + have hRs : R ≤ s := hrs + have hsns : s < sn := hss.trans_le hs₀sn + have hRn : R < sn := hRs.trans_lt hsns + have hR16 : R ≤ 1/16 := hRn.le.trans hsn16 + have hR1 : R ≤ 1 := hR16.trans (by norm_num) + obtain ⟨hscale,hwidth,hsA,hsD,_,_,_,_,_⟩ := Hn hs hsns + obtain ⟨_,_,_,_,hnoise,hτr,hAr,hAl,hBD⟩ := Hn hR hRn + have hw100 : c*s^packetExponent ≤ 1/100 := by linarith + have hgs : HasCompactSupport (g₀ : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun z hz => hg z + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + let obs := tailObservation (n:=N+1) r j.val + let μ := fun a => conditionalPacketDensity P Prod.fst obs g₀ c r₀ s (obs a) + let d := fun a y => ‖y‖^6*μ a y + let u := fun a y => ‖y‖^4*((Z:ℝ)*coulombKernel y-potentialOf (μ a) y) + let O := {x : Position | R/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*R} + let cnt : ObservationSample (N+1) J → ℝ := fun a => rawCount O (observedOrdered r j a) + have hO : MeasurableSet O := (measurableSet_le measurable_const measurable_norm).inter + (measurableSet_le measurable_norm measurable_const) + have hcnt : Measurable[observationSigma r j.val] cnt := measurable_observed_count_tail r j le_rfl hO + have hdmeas : ∀ y,Measurable[observationSigma r j.val] (fun a => d a y) := + measurable_normalized_posterior_density_tail P r j.val g₀.continuous hc hr₀ hs + have humeas : ∀ y,Measurable[observationSigma r j.val] (fun a => u a y) := + measurable_normalized_posterior_field_tail P r j.val g₀.continuous hgs hm hc hr₀ hs (Z:ℝ) + obtain ⟨t,ht,hcover,hcard⟩ := exists_atomic_band_mesh hL hR hR1 + have hp (y : Position) (hy : y∈t) (h : ℝ) (hh' : h∈heights) : + P.real {a | cnt a ≤ K/R^3 ∧ Coulomb.tfScalarDensity h ≤ d a y ∧ u a y ≤ h-(ξ/2)/4} ≤ R^42 ∧ + P.real {a | cnt a ≤ K/R^3 ∧ d a y ≤ Coulomb.tfScalarDensity h ∧ h+(ξ/2)/4 ≤ u a y} ≤ R^42 := by + exact Hp Z hZ hd hn hmin hE hbase hr₀ hs (hss.trans_le hs₀sp) hscale hw100 + (by nlinarith only [hsA,hL,hs] : (4*L/100000)*s ≤ 1) j hrs hnoise y (ht y hy).1 (ht y hy).2 h (hhband h hh') + obtain ⟨Gm,hGm,hmp,Hm⟩ := finite_inverse_mesh_event (observationSigma r j.val) + (observationSigma_le r j.val) P t heights cnt d u hcnt hdmeas humeas hp + obtain ⟨Gr,hGr,hrp,Hr⟩ := Hreg (rawLaw ψ) hc hr₀ hs hR hL hR₀ hRs hscale hw100 + r (fun k => by dsimp [r]; positivity) j le_rfl hnoise + obtain ⟨Gp,hGp,hpp,Hp'⟩ := Hcap g₀ hg hm hrad Z hZ hd hn hmin hE hbase hD hc hr₀ hs + (by linarith only [hscale]) (by nlinarith only [hwidth]) hsA hsD j.val hrs + let Gc := {a | cnt a ≤ K/R^3} + have hGct : MeasurableSet[observationSigma r j.val] Gc := measurableSet_le hcnt measurable_const + have hGc : MeasurableSet Gc := (observationSigma_le r j.val) _ hGct + have hcp : P.real Gcᶜ ≤ R^40 := by + have H := Hc Z hZ hd hn hmin hE hbase r j hR (hRs.trans_lt (hss.trans_le hs₀sc)) + simpa only [Gc,Set.compl_ofPred,not_le,cnt,O,R,P,one_div_mul_eq_div] using H + let G := Gc ∩ (Gp ∩ (Gr ∩ Gm)) + refine ⟨G,⟨hGc.inter (hGp.1.inter (hGr.1.inter hGm.1)), + hGct.inter (hGp.2.inter (hGr.2.inter hGm.2))⟩,?_,?_⟩ + · have hrp' : P.real Grᶜ=0 := by + change ((observationLaw J (rawLaw ψ)) Grᶜ).toReal=0 + rw [hrp,ENNReal.toReal_zero] + have HU (A B : Set (ObservationSample (N+1) J)) : + P.real (A∩B)ᶜ ≤ P.real Aᶜ+P.real Bᶜ := by + rw [compl_inter] + exact measureReal_union_le _ _ + have H := (HU Gc (Gp ∩ (Gr ∩ Gm))).trans + (add_le_add hcp ((HU Gp (Gr ∩ Gm)).trans + (add_le_add hpp ((HU Gr Gm).trans (add_le_add (le_of_eq hrp') hmp))))) + have H' : P.real Gᶜ ≤ R^40+Cp*R^249+2*(t.card:ℝ)*(heights.card:ℝ)*R^42 := by + simpa only [zero_add,←add_assoc] using H + exact H'.trans (mesh_exception_probability_scale hR hR1 hL hCp.le + (Nat.cast_nonneg _) (Nat.cast_nonneg _) hcard) + · intro a ha y hy0 hy1 + refine ⟨Hp' a ha.2.1 y (by linarith) (by + have hpos : 0 ≤ L*R := mul_nonneg (by linarith) hR.le + dsimp only [r,R] at hy1 hpos ⊢ + linarith only [hy1,hpos]),?_⟩ + intro h hh' + have hcnta : cnt a ≤ K/R^3 := ha.1 + have hrega := Hr a ha.2.2.1 + let τ := c*(R/3)*(R/3)^packetExponent + have hτ : 0 < τ := by dsimp [τ]; positivity + have hden : ∀ y,R/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*R → μ a y ≤ (B/τ^3)*(K/R^3) := by + intro y hy0 hy1 + exact (hrega.1 y hy0 hy1).trans (mul_le_mul_of_nonneg_left hcnta (by positivity)) + have hlip : ∀ y z,R/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*R → R/2 ≤ ‖z‖ → ‖z‖ ≤ 8*L*R → + |μ a z-μ a y| ≤ (T/τ^4)*‖z-y‖*(K/R^3) := by + intro y z hy0 hy1 hz0 hz1 + exact (hrega.2 z y hz0 hz1 hy0 hy1).trans (mul_le_mul_of_nonneg_left hcnta (by positivity)) + have hcapa := Hp' a ha.2.1 + have hosca := Hosc P Prod.fst obs g₀ g₀.continuous hgs hm hc hr₀ hs (obs a) (Z:ℝ) R L τ + hR hL hτ hτr hden hcapa + have hmesh (y : Position) (hy : y∈{y : Position | R ≤ ‖y‖ ∧ ‖y‖ ≤ 4*L*R}) : + ∃ z∈t,|d a z-d a y| ≤ ε ∧ |u a z-u a y| ≤ (A*R)*((R/τ)^3+max (-u a y) 0) := by + obtain ⟨z,hz,hdist⟩ := hcover y hy.1 hy.2 + have hdist' : ‖z-y‖ ≤ R^2 := by simpa only [norm_sub_rev] using hdist + have HH := posterior_mesh_modulus P Prod.fst obs g₀ hc hr₀ hs (obs a) (Z:ℝ) + hR hL hτ hτr hR16 hB hT hK.le hCo.le hden hlip hcapa hosca + hy.1 hy.2 (ht z hz).1 (ht z hz).2 hdist' + exact ⟨z,hz,HH.1.trans hBD,HH.2⟩ + exact inverse_of_space_height_mesh hξ hξl hε (mul_nonneg hA hR.le) hAr hAl + (by positivity : 0 < (ξ/2)/4) (by linarith) hheights hmargin hmesh + (Hm a ha.2.2.2 hcnta) y ⟨hy0,hy1⟩ h hh' +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalRetainedDatum.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalRetainedDatum.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5d07c8b7d1095430884edff0bd3cce5dee975ca --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalRetainedDatum.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationExpectedDeficit + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_finite_retained_datum {N K J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) + {ψ : Wavefunction (N+1)} {g : Gradient (N+1)} (hd : FormDomain ψ g) (hn : normSquared ψ=1) + {g₀ : 𝓢(Position,ℝ)} (hgs : ∀ x,1<‖x‖ → g₀ x=0) (hm : (∫ x,g₀ x^2)=1) + {c ε B C r₀ s M : ℝ} (hc : 0 r₀*2^j.val + let μ := fun j o => conditionalPacketDensity P Prod.fst (tailObservation rs j) g₀ c r₀ s (tailObservation rs j o) + ∀ {G₀ : Set (Fin K → UnorderedArray (N+1))},MeasurableSet G₀ → + P.real (tailObservation rs 0 ⁻¹' G₀ᶜ) ≤ 343*r₀^35 → + (∀ a∈G₀,∀ x,r₀ ≤ ‖x‖ → ‖x‖ ≤ 2*r₀ → + potentialOf (conditionalPacketDensity P Prod.fst (tailObservation rs 0) g₀ c r₀ s a) x ≤ (1/10:ℝ)*(Z:ℝ)/r₀) → + ∀ (G : Fin J → Set (ObservationSample (N+1) K)), + (∀ j,MeasurableSet (G j)) → + (∀ j,∀ o∈G j,∀ x,(r₀*2^j.val) ≤ ‖x‖ → ‖x‖ ≤ 4*k.L*(r₀*2^j.val) → + let F := (Z:ℝ)*coulombKernel x-potentialOf (μ j.val o) x + F ≤ C/‖x‖^4 ∧ ∀ h∈Icc (B/2) C, + (Coulomb.tfScalarDensity h ≤ ‖x‖^6*μ j.val o x → h-k.ξ ≤ ‖x‖^4*F) ∧ + (‖x‖^6*μ j.val o x ≤ Coulomb.tfScalarDensity h → ‖x‖^4*F ≤ h+k.ξ)) → + (∀ j,(∫ o in (G j)ᶜ,∫ x in {x : Position | (r₀*2^j.val) ≤ ‖x‖ ∧ ‖x‖<2*(r₀*2^j.val)},μ j.val o x ∂volume ∂P) ≤ M*(r₀*2^j.val)^9) → + ∃ d : PropagationDatum P B C (r₀*2^J) (Z:ℝ) k.L (μ J), + (∫ o,(∫ x,d.error o x) ∂P) ≤ (1029*ε^3+M)*(r₀*2^J)^9 := by + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw K (rawLaw ψ) + let rs := fun j : Fin K => r₀*2^j.val + let μ := fun j o => conditionalPacketDensity P Prod.fst (tailObservation rs j) g₀ c r₀ s (tailObservation rs j o) + let H := fun j o x => -potentialOf (μ j o) x + intro G₀ hG₀ hp₀ hlow G hG hgood hcost + have hcompact : HasCompactSupport (g₀ : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun x hx => hgs x + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hx)) + have hZr : 0<(Z:ℝ) := by exact_mod_cast (zero_lt_one.trans_le hZ) + have q (j : ℕ) : NuclearRandomDatum (Z:ℝ) (μ j) (H j) := + posterior_nuclear_datum P Prod.fst (tailObservation rs j) (measurable_tailObservation rs j) + g₀.continuous hcompact hm hc hr hs Z + let bad₀ := fun o => tailObservation rs 0 o∉G₀ + have hb₀ : MeasurableSet {o | bad₀ o} := hG₀.compl.preimage (measurable_tailObservation rs 0) + have gates := initial_scaled_gates (B:=B) hZr hr hcubic hR + have init := (q 0).initial_hypotheses (bad:=bad₀) hB hZr.le hr + (by positivity : 0 ≤ (Z:ℝ)/(80*r₀^3)) k.L_large.le + (by rw [mul_assoc,hcubic]; linarith only [hBe]) hBC + (by rw [mul_assoc,hcubic]; exact heC) gates.1 gates.2 hbar (by + intro o ho x hx hx' + have hh := hlow (tailObservation rs 0 o) (by simpa only [bad₀,not_not] using ho) x hx hx' + change potentialOf (μ 0 o) x ≤ _ at hh + change -(1/10:ℝ)*(Z:ℝ)/r₀ ≤ -potentialOf (μ 0 o) x + simpa only [neg_mul,neg_div] using neg_le_neg hh) + let d₀ := initialPropagationDatum (P:=P) hr hb₀ (q 0).H_measurable (q 0).mu_measurable + (q 0).H_bounds (q 0).mu_bounds (Eventually.of_forall init) + have hnε : (N+1:ℝ)*r₀^3 ≤ 3*ε^3 := by + rw [←hcubic,←mul_assoc] + exact mul_le_mul_of_nonneg_right hnum (pow_nonneg hr.le 3) + have he₀ : (∫ o,(∫ x,d₀.error o x) ∂P) ≤ 1029*ε^3*r₀^9 := + (q 0).initial_error_bound hb₀ (fun o => (conditionalPacketDensity_mass P Prod.fst + (tailObservation rs 0) g₀.continuous hm hc hr hs _).le) hr hr1 hε.le (by simpa using hnε) hp₀ + let bad := fun j o => ∃ hj : j tailObservation rs j) bad d₀ (by positivity : 0 ≤ 1029*ε^3) hM he₀ + (fun j _ => measurable_tailObservation rs (j+1)) (fun j hj => by + have he : {o | bad j o}=(G ⟨j,hj⟩)ᶜ := by ext o; simp [bad,hj] + rw [he]; exact (hG _).compl) + (fun j _ => q j) (by + intro j hj o ho x hx hx' + have hh := (hgood ⟨j,hj⟩ o (by simpa [bad,hj] using ho) x hx hx').1 + simpa only [H,sub_eq_add_neg] using hh) (by + intro j hj o ho x hx hx' h hh + have hgood' := (hgood ⟨j,hj⟩ o (by simpa [bad,hj] using ho) x hx hx').2 h hh + simpa only [H,sub_eq_add_neg] using hgood') + (fun j _ => posteriorPacketDensity_tower (rawLaw ψ) g₀.continuous hcompact hc hr hs rs (Nat.le_succ j)) (by + intro j hj + have he : {o | bad j o}=(G ⟨j,hj⟩)ᶜ := by ext o; simp [bad,hj] + rw [he]; exact hcost ⟨j,hj⟩) + exact ⟨d,hd'⟩ +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalRetainedMean.lean b/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalRetainedMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..3f72acd9526ece4090fa11fed8d72c62ffbb6050 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/PhysicalRetainedMean.lean @@ -0,0 +1,300 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationMeanBounds +import OAI.Analysis.CoulombRadii.ThomasFermi.TFResponseMargins +import OAI.Analysis.CoulombRadii.Variational.RetainedMasterTransfer +import OAI.Analysis.CoulombRadii.FormDomain.RetainedPotentialMean +import OAI.Analysis.CoulombRadii.Packets.InverseErrorScale + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +namespace NeutralAtom + +theorem physical_retained_inverse_means (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) + (hrad : ∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) : + ∃ C D₁ E₁ F K N₁ B₀ : ℝ, + 0 r₀*2^k.val) j ⁻¹' B) → + ∀ (k : RetainedScales J j) (y : Position) (_ : y≠0), r₀ ≤ ‖y‖ → + Coulomb.atomicCellScale y ≤ A*(r₀*2^j) → + letI := rawLaw_isProbability hd.2.2.1 hn + let a := Coulomb.atomicCellScale y + let b := a^(6/5:ℝ) + let w := packetWidth c r₀ s y + let ell := (r₀*2^k.val.val)^(101/100:ℝ) + let θ := C*(2*w/a) + let δ := E₁*(c*(1+packetExponent)*s^packetExponent) + let field := fun z : ObservationSample (N+1) J => (Z:ℝ)*coulombKernel y- + potentialOf (conditionalPacketDensity (observationLaw J (rawLaw ψ)) Prod.fst + (tailObservation (fun l : Fin J => r₀*2^l.val) j) g₀ c r₀ s + (tailObservation (fun l : Fin J => r₀*2^l.val) j z)) y + let event := tailObservation (fun l : Fin J => r₀*2^l.val) j ⁻¹' B + let fieldMean := ((observationLaw J (rawLaw ψ)).real event)⁻¹* + ∫ z in event, field z ∂observationLaw J (rawLaw ψ) + ∀ {M Qlo Qhi q L U : ℝ}, 18*b ≤ a → 2*w ≤ a → + (∀ z∈retainedTailObservation j ⁻¹' B, + Qlo ≤ ∑ i,packetKernel g₀ c r₀ s (observationArrayPositions k z i) y) → + (∀ z∈retainedTailObservation j ⁻¹' B, + (∑ i,packetKernel g₀ c r₀ s (observationArrayPositions k z i) y) ≤ Qhi) → + (∀ z∈retainedTailObservation j ⁻¹' B, + rawCount (Metric.closedBall y (2*w+2*b+2*(Real.sqrt 3*ell))) + (observationArrayPositions k z) ≤ M) → + 0 ≤ L → 0 ≤ U → 0 rfl) y + have Hmeans := Hmean hc hr₀ hs hscale + (fun l : RetainedScales J j => (r₀*2^l.val.val)^(101/100:ℝ)) + (fun _ => Real.rpow_pos_of_pos (by positivity) _) k + (hB.preimage (measurable_retainedTailObservation j)) ψ u hlaw + (Coulomb.atom Z hZ) T.ensemble T.law hTM ha hb hsmall ht y hnu hcs hw + hlo hhi hcount hL hU hq hθ + have hgs : HasCompactSupport (g₀ : Position → ℝ) := by + apply HasCompactSupport.intro (K := Metric.closedBall 0 1) (isCompact_closedBall _ _) + intro z hz + exact hg z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz) + have hp0 := (pow_pos (show 0 r₀*2^l.val) (fun _ => by positivity) j hB u hum hlaw hp0 + g₀.continuous hgs hm hc hr₀ hs y ((Z:ℝ)*coulombKernel y) + have HT := hFtransfer g₀ hm hrad hg + rw [Htower] at HT + have hgap : (∑ p,Coulomb.sliceExpectation (T.ensemble.vector p) + (Coulomb.patchSliceTFGap (Coulomb.atom Z hZ) (T.ensemble.vector p) ha hb ht.2 y hnu)) ≤ + 2*a^(-349/50:ℝ) := by + exact hG + have hfield : (∑ p,Coulomb.sliceExpectation (T.ensemble.vector p) (fun spin x => + Coulomb.patchTFScreenedField (Coulomb.atom Z hZ) + ((T.ensemble.vector p).coreSlice spin x).normalized ha hb ht.2 y hnu y))= + Coulomb.atomicPatchMeanField (Coulomb.atom Z hZ) (fun _ => rfl) T.ensemble y hy b hb t ht.2 := rfl + rw [hfield] at Hmeans + constructor + · intro P hP hNw hPm hmargin + have HI := Hmeans.1 hP hNw hPm hmargin + have hcoef : 0 ≤ L/q+2*(B₀/w^3)/P := by positivity [packetWidth_pos hc hr₀ hs y] + have HH := mul_le_mul_of_nonneg_left hgap hcoef + have HT' := (abs_le.mp HT).1 + dsimp only [a,b,w] at HH HI HT' ⊢ + linarith + · intro hmargin + have HI := Hmeans.2 hmargin + have hcoef : 0 ≤ (Coulomb.tfInteriorConstant Coulomb.thomasFermiKineticConstant/a^4)/q := by + positivity [Coulomb.tfInteriorConstant_nonneg Coulomb.thomasFermiKineticConstant] + have HH := mul_le_mul_of_nonneg_left hgap hcoef + have HT' := (abs_le.mp HT).2 + dsimp only [a,b,w] at HH HI HT' ⊢ + linarith +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +namespace NeutralAtom + +lemma inverse_all_errors_majorized {D F K K₀ B κ Λ M a v ell m : ℝ} + (hD : 0 ≤ D) (hF : 0 ≤ F) (hK : 0 ≤ K) (hK₀ : 0 ≤ K₀) (hB : 0 ≤ B) + (hκ : 0<κ) (hΛ : 0 ≤ Λ) (hM : 0 ≤ M) (ha : 0 + (2*V+2*C*V+4*N*V+E₁*c*(1+packetExponent))*s^packetExponent) (𝓝[>] 0) (𝓝 0) := by + simpa using ht.const_mul (2*V+2*C*V+4*N*V+E₁*c*(1+packetExponent)) + obtain ⟨s₂,hs₂,Hs₂⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp + (hlim.eventually (gt_mem_nhds hε)) + change 0 r₀*2^k.val + ∃ G : Set (ObservationSample (N+1) J), + (MeasurableSet G ∧ MeasurableSet[observationSigma r j.val] G) ∧ + P.real Gᶜ ≤ C*(r j)^25 ∧ ∀ a∈G,∀ y : Position,r j ≤ ‖y‖ → ‖y‖ ≤ 4*L*(r j) → + ∀ h∈Icc hl hh, + let μ := conditionalPacketDensity P Prod.fst (tailObservation r j.val) g₀ c r₀ s + (tailObservation r j.val a) + let F := (Z:ℝ)*coulombKernel y-potentialOf μ y + (Coulomb.tfScalarDensity h ≤ ‖y‖^6*μ y → h-ξ ≤ ‖y‖^4*F) ∧ + (‖y‖^6*μ y ≤ Coulomb.tfScalarDensity h → ‖y‖^4*F ≤ h+ξ) := by + obtain ⟨K,hK,Hcount⟩ := physical_observed_small_annular_count_tail + (by norm_num : (0:ℝ) < 1/8) (by norm_num : (1/8:ℝ) < 1/4) + (by linarith : (1/4:ℝ) < 12*L) (by linarith : 12*L < 13*L) + obtain ⟨B,T,hB,hT,Hreg⟩ := physical_posterior_band_event g₀ hg + obtain ⟨Co,hCo,Hosc⟩ := posterior_count_cap_oscillation hB hK.le + obtain ⟨heights,hhband,hheights⟩ := exists_height_brackets hξ hξl hlh + obtain ⟨ε,hε,hmargin⟩ := exists_density_mesh_margin hξ hξl hlh + obtain ⟨Cp,hCp,Hcap⟩ := physical_retained_spatial_cap hL + let A := (4*L)^4*Co+4*(4*L)^3*max physicalSpatialCap 1 + let B' := (4*L)^6*(T*K)+6*(4*L)^5*(B*K) + have hA : 0 ≤ A := by dsimp [A]; positivity + have hB' : 0 ≤ B' := by dsimp [B']; positivity + let C := 1+Cp+2*(12*L+1)^3*(heights.card:ℝ) + have hC : 0 < C := by + change 0 < 1+Cp+2*(12*L+1)^3*(heights.card:ℝ) + have hlast : 0 ≤ 2*(12*L+1)^3*(heights.card:ℝ) := + mul_nonneg (mul_nonneg (by norm_num) (pow_nonneg (by linarith) _)) (Nat.cast_nonneg _) + linarith + refine ⟨C,hC,?_⟩ + intro D hD + obtain ⟨sc,hsc,Hc⟩ := Hcount D hD + obtain ⟨sp,hsp,hsp1,Hp⟩ := physical_normalized_inverse_point g₀ hg hm hrad hD hc hL hK.le + (by positivity : 0 < ξ/2) (show ξ/2 < hl/2 by linarith) + (show hl/2 ≤ 2*hh by linarith) + obtain ⟨sn,hsn,hsn16,Hn⟩ := exists_simultaneous_inverse_scale (L:=L) (D:=D) (A:=A) (B:=B') hc hξ hε + let s₀ := min sc (min sp sn) + have hs₀sc : s₀ ≤ sc := min_le_left _ _ + have hs₀sp : s₀ ≤ sp := (min_le_right _ _).trans (min_le_left _ _) + have hs₀sn : s₀ ≤ sn := (min_le_right _ _).trans (min_le_right _ _) + refine ⟨s₀,lt_min hsc (lt_min hsp hsn),(hs₀sn.trans hsn16).trans (by norm_num),?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE hbase r₀ s hr₀ hs hss j hrs + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let r : Fin J → ℝ := fun k => r₀*2^k.val + let R := r j + have hR : 0 < R := by dsimp [R,r]; positivity + have hR₀ : r₀ ≤ R := le_mul_of_one_le_right hr₀.le (one_le_pow₀ (by norm_num)) + have hRs : R ≤ s := hrs + have hsns : s < sn := hss.trans_le hs₀sn + have hRn : R < sn := hRs.trans_lt hsns + have hR16 : R ≤ 1/16 := hRn.le.trans hsn16 + have hR1 : R ≤ 1 := hR16.trans (by norm_num) + obtain ⟨hscale,hwidth,hsA,hsD,_,_,_,_,_⟩ := Hn hs hsns + obtain ⟨_,_,_,_,hnoise,hτr,hAr,hAl,hBD⟩ := Hn hR hRn + have hw100 : c*s^packetExponent ≤ 1/100 := by linarith + have hgs : HasCompactSupport (g₀ : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun z hz => hg z + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + let obs := tailObservation (n:=N+1) r j.val + let μ := fun a => conditionalPacketDensity P Prod.fst obs g₀ c r₀ s (obs a) + let d := fun a y => ‖y‖^6*μ a y + let u := fun a y => ‖y‖^4*((Z:ℝ)*coulombKernel y-potentialOf (μ a) y) + let O := {x : Position | R/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*R} + let cnt : ObservationSample (N+1) J → ℝ := fun a => rawCount O (observedOrdered r j a) + have hO : MeasurableSet O := (measurableSet_le measurable_const measurable_norm).inter + (measurableSet_le measurable_norm measurable_const) + have hcnt : Measurable[observationSigma r j.val] cnt := measurable_observed_count_tail r j le_rfl hO + have hdmeas : ∀ y,Measurable[observationSigma r j.val] (fun a => d a y) := + measurable_normalized_posterior_density_tail P r j.val g₀.continuous hc hr₀ hs + have humeas : ∀ y,Measurable[observationSigma r j.val] (fun a => u a y) := + measurable_normalized_posterior_field_tail P r j.val g₀.continuous hgs hm hc hr₀ hs (Z:ℝ) + obtain ⟨t,ht,hcover,hcard⟩ := exists_atomic_band_mesh hL hR hR1 + have hp (y : Position) (hy : y∈t) (h : ℝ) (hh' : h∈heights) : + P.real {a | cnt a ≤ K/R^3 ∧ Coulomb.tfScalarDensity h ≤ d a y ∧ u a y ≤ h-(ξ/2)/4} ≤ R^42 ∧ + P.real {a | cnt a ≤ K/R^3 ∧ d a y ≤ Coulomb.tfScalarDensity h ∧ h+(ξ/2)/4 ≤ u a y} ≤ R^42 := by + exact Hp Z hZ hd hn hmin hE hbase hr₀ hs (hss.trans_le hs₀sp) hscale hw100 + (by nlinarith only [hsA,hL,hs] : (4*L/100000)*s ≤ 1) j hrs hnoise y (ht y hy).1 (ht y hy).2 h (hhband h hh') + obtain ⟨Gm,hGm,hmp,Hm⟩ := finite_inverse_mesh_event (observationSigma r j.val) + (observationSigma_le r j.val) P t heights cnt d u hcnt hdmeas humeas hp + obtain ⟨Gr,hGr,hrp,Hr⟩ := Hreg (rawLaw ψ) hc hr₀ hs hR hL hR₀ hRs hscale hw100 + r (fun k => by dsimp [r]; positivity) j le_rfl hnoise + obtain ⟨Gp,hGp,hpp,Hp'⟩ := Hcap g₀ hg hm hrad Z hZ hd hn hmin hE hbase hD hc hr₀ hs + (by linarith only [hscale]) (by nlinarith only [hwidth]) hsA hsD j.val hrs + let Gc := {a | cnt a ≤ K/R^3} + have hGct : MeasurableSet[observationSigma r j.val] Gc := measurableSet_le hcnt measurable_const + have hGc : MeasurableSet Gc := (observationSigma_le r j.val) _ hGct + have hcp : P.real Gcᶜ ≤ R^40 := by + have H := Hc Z hZ hd hn hmin hE hbase r j hR (hRs.trans_lt (hss.trans_le hs₀sc)) + simpa only [Gc,Set.compl_ofPred,not_le,cnt,O,R,P,one_div_mul_eq_div] using H + let G := Gc ∩ (Gp ∩ (Gr ∩ Gm)) + refine ⟨G,⟨hGc.inter (hGp.1.inter (hGr.1.inter hGm.1)), + hGct.inter (hGp.2.inter (hGr.2.inter hGm.2))⟩,?_,?_⟩ + · have hrp' : P.real Grᶜ=0 := by + change ((observationLaw J (rawLaw ψ)) Grᶜ).toReal=0 + rw [hrp,ENNReal.toReal_zero] + have HU (A B : Set (ObservationSample (N+1) J)) : + P.real (A∩B)ᶜ ≤ P.real Aᶜ+P.real Bᶜ := by + rw [compl_inter] + exact measureReal_union_le _ _ + have H := (HU Gc (Gp ∩ (Gr ∩ Gm))).trans + (add_le_add hcp ((HU Gp (Gr ∩ Gm)).trans + (add_le_add hpp ((HU Gr Gm).trans (add_le_add (le_of_eq hrp') hmp))))) + have H' : P.real Gᶜ ≤ R^40+Cp*R^249+2*(t.card:ℝ)*(heights.card:ℝ)*R^42 := by + simpa only [zero_add,←add_assoc] using H + exact H'.trans (mesh_exception_probability_scale hR hR1 hL hCp.le + (Nat.cast_nonneg _) (Nat.cast_nonneg _) hcard) + · intro a ha y hy0 hy1 h hh' + have hcnta : cnt a ≤ K/R^3 := ha.1 + have hrega := Hr a ha.2.2.1 + let τ := c*(R/3)*(R/3)^packetExponent + have hτ : 0 < τ := by dsimp [τ]; positivity + have hden : ∀ y,R/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*R → μ a y ≤ (B/τ^3)*(K/R^3) := by + intro y hy0 hy1 + exact (hrega.1 y hy0 hy1).trans (mul_le_mul_of_nonneg_left hcnta (by positivity)) + have hlip : ∀ y z,R/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*R → R/2 ≤ ‖z‖ → ‖z‖ ≤ 8*L*R → + |μ a z-μ a y| ≤ (T/τ^4)*‖z-y‖*(K/R^3) := by + intro y z hy0 hy1 hz0 hz1 + exact (hrega.2 z y hz0 hz1 hy0 hy1).trans (mul_le_mul_of_nonneg_left hcnta (by positivity)) + have hcapa := Hp' a ha.2.1 + have hosca := Hosc P Prod.fst obs g₀ g₀.continuous hgs hm hc hr₀ hs (obs a) (Z:ℝ) R L τ + hR hL hτ hτr hden hcapa + have hmesh (y : Position) (hy : y∈{y : Position | R ≤ ‖y‖ ∧ ‖y‖ ≤ 4*L*R}) : + ∃ z∈t,|d a z-d a y| ≤ ε ∧ |u a z-u a y| ≤ (A*R)*((R/τ)^3+max (-u a y) 0) := by + obtain ⟨z,hz,hdist⟩ := hcover y hy.1 hy.2 + have hdist' : ‖z-y‖ ≤ R^2 := by simpa only [norm_sub_rev] using hdist + have HH := posterior_mesh_modulus P Prod.fst obs g₀ hc hr₀ hs (obs a) (Z:ℝ) + hR hL hτ hτr hR16 hB hT hK.le hCo.le hden hlip hcapa hosca + hy.1 hy.2 (ht z hz).1 (ht z hz).2 hdist' + exact ⟨z,hz,HH.1.trans hBD,HH.2⟩ + exact inverse_of_space_height_mesh hξ hξl hε (mul_nonneg hA hR.le) hAr hAl + (by positivity : 0 < (ξ/2)/4) (by linarith) hheights hmargin hmesh + (Hm a ha.2.2.2 hcnta) y ⟨hy0,hy1⟩ h hh' +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/RadialRMS.lean b/lean/OAI/Analysis/CoulombRadii/Packets/RadialRMS.lean new file mode 100644 index 0000000000000000000000000000000000000000..7fe55a035cb098267b8372dab0307b1481a187e6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/RadialRMS.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.TailMoment +import OAI.Analysis.CoulombRadii.RandomFields.RecordedStatistic +import OAI.Analysis.CoulombRadii.FieldAnalysis.RawRMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +lemma radialTailKernel_measurable (r : ℝ) : Measurable (radialTailKernel r) := by + unfold radialTailKernel + exact Measurable.ite (measurableSet_le measurable_const continuous_norm.measurable) + continuous_norm.measurable.inv measurable_const + +lemma radialTailStatistic_nonneg {n : ℕ} (r : ℝ) (x : Configuration n) : + 0 ≤ arrayStatistic (radialTailKernel r) x := + Finset.sum_nonneg (fun _ _ => radialTailKernel_nonneg _ _) + +lemma radialTailStatistic_bound {n : ℕ} {r : ℝ} (hr : 0 radialTailKernel_le hr _) + _ = _ := by simp [div_eq_mul_inv] + +lemma radialTailStatistic_step {n : ℕ} {r : ℝ} (hr : 0 radialTailKernel_step hr (position x i)) + simpa only [Finset.sum_add_distrib,←Finset.mul_sum,arrayStatistic,localCount] using H + +lemma radialTailRMS_step {n : ℕ} (ψ : H1Vector n) {r : ℝ} (hr : 0 r⁻¹*localCount A x) := measurable_const.mul (localCount_measurable hA) + have hm2 := arrayStatistic_measurable (n:=n) (radialTailKernel_measurable (2*r)) + calc + _ ≤ rawRMS ψ (fun x => r⁻¹*localCount A x+arrayStatistic (radialTailKernel (2*r)) x) := + rawRMS_mono ψ _ _ (arrayStatistic_measurable (radialTailKernel_measurable r)) (hm1.add hm2) + (radialTailStatistic_bound hr) hsum (radialTailStatistic_nonneg _) (radialTailStatistic_step hr) + _ ≤ rawRMS ψ (fun x => r⁻¹*localCount A x)+rawRMS ψ (arrayStatistic (radialTailKernel (2*r))) := + rawRMS_add ψ _ _ hm1 hm2 hb ht + _ = _ := by + rw [rawRMS_const_mul ψ _ (inv_nonneg.mpr hr.le)] + change r⁻¹ * Real.sqrt (localCountSecondMoment ψ A) + _ = _ + dsimp [A] + ring + +lemma radialTailRMS_cap {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) {r : ℝ} (hr : 0 (n:ℝ)/r) := rawRMS_mono ψ _ _ + (arrayStatistic_measurable (radialTailKernel_measurable r)) measurable_const + (radialTailStatistic_bound hr) (fun _ => le_rfl) + (radialTailStatistic_nonneg _) (fun x => (le_abs_self _).trans (radialTailStatistic_bound hr x)) + _ = _ := rawRMS_const ψ hm (by positivity) + +theorem atomic_radial_tail_second_moment : ∃ C : ℝ, 0 ≤ C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E δ : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E+δ → 0 ≤ δ → + ∀ {h : ℝ}, 0 simp + | succ N ih => + have HS := add_le_add (le_refl (K*∑ j∈Finset.range N, (3/4:ℝ)^j)) (hstep N) + refine ih.trans (HS.trans_eq ?_) + rw [Finset.sum_range_succ] + ring + have hbound (N : ℕ) : rawRMS ψ (arrayStatistic (radialTailKernel h)) ≤ 4*K+((n:ℝ)/h)*(1/2:ℝ)^N := by + have hs : (∑ j∈Finset.range N, (3/4:ℝ)^j) ≤ 4 := by + have HH := geom_sum_mul_neg (3/4:ℝ) N + nlinarith [pow_nonneg (by norm_num : (0:ℝ) ≤ 3/4) N] + have ht := radialTailRMS_cap ψ hm (show 0 < (2:ℝ)^N*h by positivity) + have he : (n:ℝ)/((2:ℝ)^N*h)=((n:ℝ)/h)*(1/2:ℝ)^N := by + rw [div_pow,one_pow] + field_simp + exact (hfinite N).trans (by rw [←he]; nlinarith [mul_le_mul_of_nonneg_left hs hK]) + have hlim : Tendsto (fun N : ℕ => 4*K+(n:ℝ)/h*(1/2:ℝ)^N) atTop (𝓝 (4*K)) := by + convert tendsto_const_nhds.add (tendsto_const_nhds.mul + (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0:ℝ) ≤ 1/2) (by norm_num : (1/2:ℝ) < 1))) using 1 + simp + have Hfinal := ge_of_tendsto' hlim hbound + dsimp [K] at Hfinal + exact Hfinal.trans_eq (by ring) + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/RawMasterNewton.lean b/lean/OAI/Analysis/CoulombRadii/Packets/RawMasterNewton.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4cf726a453c9f936e156d6de8e906219b22a130 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/RawMasterNewton.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.OriginalPotentialTower +import OAI.Analysis.CoulombRadii.Packets.MasterNewton +import OAI.Analysis.CoulombRadii.Variational.PhysicalDensityWeighted + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma integrable_packet_coulomb (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + {c r₀ s : ℝ} (hc : 0 coulombKernel (y-w)*packetKernel g c r₀ s z w) := by + apply Coulomb.coulomb_convolution_integrable (integrable_packetKernel g hm hc hr hs z) + (((continuous_packetKernel g.continuous hc hr hs).comp (continuous_const.prodMk continuous_id)).measurable) + (packetKernel_nonneg g hc hr hs z) + (M := (packetWidth c r₀ s z^3)⁻¹*(SchwartzMap.seminorm ℝ 0 0 g)^2) + (fun w => mul_le_mul_of_nonneg_left (Coulomb.schwartz_square_le g _) + (by have ht := packetWidth_pos hc hr hs z; positivity)) (by norm_num : (0:ℝ)<1) y + +lemma rawPacketPotential_sum {n : ℕ} (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + {c r₀ s : ℝ} (hc : 0 integrable_packet_coulomb g hm hc hr hs (x i) y) + +theorem rawPacketPotential_near_deficit {n : ℕ} (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + (hrad : ∀ w,g w=g (EuclideanSpace.single 0 ‖w‖)) + (hgs : ∀ w,1<‖w‖ → g w=0) + {c r₀ s : ℝ} (hc : 0 coulombKernel (y-z)) (x i) := by + rw [rawPacketPotential_sum g hm hc hr hs,←Finset.sum_sub_distrib] + refine ⟨Finset.sum_nonneg (fun i _ => ?_),Finset.sum_le_sum (fun i _ => ?_)⟩ + · exact (packet_potential_near_deficit g hm hrad hgs hc hr hs hq (hxy i).symm).1 + · exact (packet_potential_near_deficit g hm hrad hgs hc hr hs hq (hxy i).symm).2 + +lemma integrable_rawLaw_of_weight {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ,MemLp (ψ σ) 2 volume) (F : Configuration n → ℝ) + (hi : Integrable (fun x => F x*configurationDensity ψ x)) : + Integrable F (rawLaw ψ) := by + have HH := (integrable_withDensity_iff_integrable_smul₀' + (integrable_configurationDensity hψ).aemeasurable.ennreal_ofReal + (Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top)) (g := F)) + apply HH.mpr + simpa only [ENNReal.toReal_ofReal (configurationDensity_nonneg ψ _),smul_eq_mul,mul_comm] using hi + +lemma integrable_rawLaw_oneBody {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ,MemLp (ψ σ) 2 volume) (W : Position → ℝ) + (hi : ∀ σ i,Integrable (fun x : Configuration n => W (x i)*‖ψ σ x‖^2)) : + Integrable (fun x => ∑ i : Fin n,W (x i)) (rawLaw ψ) := by + apply integrable_rawLaw_of_weight hψ + simp only [Finset.sum_mul,configurationDensity,Finset.mul_sum] + exact integrable_finsetSum _ (fun σ _ => integrable_finsetSum _ (fun i _ => hi σ i)) + +lemma fromH1_raw_potential_integral {n : ℕ} (u : Coulomb.H1Vector n) (y : Position) : + (∫ x, (∑ i : Fin n,coulombKernel (y-x i)) ∂rawLaw (fromH1Wave u))=Coulomb.coreCoulombPotential u y := by + have hψ (σ : Spins n) : MemLp (fromH1Wave u σ) 2 volume := + (u.value_L2 σ).comp_measurePreserving (flattenConfiguration_measurePreserving n) + rw [integral_rawLaw hψ] + unfold rawExpectation configurationDensity + simp_rw [Finset.mul_sum] + rw [integral_finsetSum _ (fun σ _ => by + simp only [Finset.sum_mul] + exact integrable_finsetSum _ (fun i _ => fromH1_coulomb_weight_integrable u y σ i))] + unfold Coulomb.coreCoulombPotential + apply Finset.sum_congr rfl + intro σ _ + rw [show (fun x : Configuration n => (∑ i,coulombKernel (y-x i))*‖fromH1Wave u σ x‖^2)= + fun x => ∑ i : Fin n,coulombKernel (y-x i)*‖fromH1Wave u σ x‖^2 by funext x; rw [Finset.sum_mul]] + rw [integral_finsetSum _ (fun i _ => fromH1_coulomb_weight_integrable u y σ i)] + apply Finset.sum_congr rfl + intro i _ + have H := (flattenConfiguration_measurePreserving n).integral_comp' + (fun x => Coulomb.coulombKernel (Coulomb.position x i-y)*‖u.value σ x‖^2) + change (∫ x : Configuration n,Coulomb.coulombKernel (x i-y)*‖fromH1Wave u σ x‖^2)=_ at H + simpa only [coulombKernel,Coulomb.coulombKernel,norm_sub_rev] using H + +theorem physical_master_near_deficit {N : ℕ} (u : Coulomb.H1Vector (N+1)) + (ha : Coulomb.Antisymmetric u) (hn : Coulomb.mass u=1) + (g : 𝓢(Position,ℝ)) (hm : (∫ w,g w^2)=1) + (hrad : ∀ w,g w=g (EuclideanSpace.single 0 ‖w‖)) + (hgs : ∀ w,1<‖w‖ → g w=0) + {c r₀ s : ℝ} (hc : 0 + hgs z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hraw := integrable_rawLaw_oneBody hd.2.2.1 (fun z => coulombKernel (y-z)) + (fromH1_coulomb_weight_integrable u y) + have hnear := integrable_rawLaw_oneBody hd.2.2.1 + ((Metric.closedBall y (2*packetWidth c r₀ s y)).indicator (fun z => coulombKernel (y-z))) + (fromH1_coulomb_near_weight_integrable u y _) + have hms := integrable_rawPacketPotential g.continuous hgc hm hc hr hs (rawLaw (fromH1Wave u)) y + have hpt : ∀ᵐ x ∂rawLaw (fromH1Wave u), + 0≤(∑ i : Fin (N+1),coulombKernel (y-x i))-potentialOf (rawPacketDensity g c r₀ s x) y ∧ + (∑ i : Fin (N+1),coulombKernel (y-x i))-potentialOf (rawPacketDensity g c r₀ s x) y≤ + ∑ i : Fin (N+1),(Metric.closedBall y (2*packetWidth c r₀ s y)).indicator + (fun z => coulombKernel (y-z)) (x i) := by + filter_upwards [rawLaw_no_fixed_particle hd.1 hd.2.2.1 hn' y] with x hx + exact rawPacketPotential_near_deficit g hm hrad hgs hc hr hs hq x y hx + have he : Coulomb.coreCoulombPotential u y-potentialOf (mixturePacketDensity (rawLaw (fromH1Wave u)) g c r₀ s) y= + ∫ x,((∑ i : Fin (N+1),coulombKernel (y-x i))-potentialOf (rawPacketDensity g c r₀ s x) y) ∂rawLaw (fromH1Wave u) := by + rw [integral_sub hraw hms,fromH1_raw_potential_integral,mixturePacketPotential g.continuous hgc hm hc hr hs] + rw [he] + refine ⟨integral_nonneg_of_ae (hpt.mono (fun _ hx => hx.1)),?_⟩ + calc + _≤∫ x,(∑ i : Fin (N+1),(Metric.closedBall y (2*packetWidth c r₀ s y)).indicator + (fun z => coulombKernel (y-z)) (x i)) ∂rawLaw (fromH1Wave u) := + integral_mono_ae (hraw.sub hms) hnear (hpt.mono (fun _ hx => hx.2)) + _=_ := by + rw [integral_rawLaw hd.2.2.1,rawExpectation_oneBody_eq_density hd.1 _ + (fromH1_coulomb_near_weight_integrable u y _),←integral_indicator measurableSet_closedBall] + apply integral_congr_ae + exact Eventually.of_forall fun z => by + by_cases hz : z∈Metric.closedBall y (2*packetWidth c r₀ s y) <;> simp [hz] +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/RetainedInverseOffset.lean b/lean/OAI/Analysis/CoulombRadii/Packets/RetainedInverseOffset.lean new file mode 100644 index 0000000000000000000000000000000000000000..2746aca3e2a767382ace369448b217f31daaf777 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/RetainedInverseOffset.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationPatchScale +import OAI.Analysis.CoulombRadii.RandomFields.ObservationDyadicWidth + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +def retainedInverseOffset (D r : ℝ) : ℝ := + D+(4/3:ℝ)*inverseObservationOffset 0 r + +lemma retainedInverseOffset_scaled_tendsto (D : ℝ) : + Tendsto (fun r => retainedInverseOffset D r*r^(349/50:ℝ)) (𝓝[>] 0) (𝓝 0) := by + have H := ((tendsto_positive_rpow_zero (by norm_num : (0:ℝ)<349/50)).const_mul D).add + ((inverseObservationOffset_scaled_tendsto 0).const_mul (4/3:ℝ)) + simp only [mul_zero,add_zero] at H + convert H using 1 + funext r + unfold retainedInverseOffset + ring + +lemma retainedInverseOffset_nonneg {D r : ℝ} (hD : 0≤D) (hr : 0] 0, + r<1 ∧ retainedInverseOffset D r*r^(349/50:ℝ)*A^(349/50:ℝ)<1 := by + filter_upwards [(eventually_lt_nhds (by norm_num : (0:ℝ)<1)).filter_mono nhdsWithin_le_nhds, + ht.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1))] with r hr hh + exact ⟨hr,hh⟩ + obtain ⟨s,hs,hsub⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp he + refine ⟨min s 1,lt_min hs (by norm_num),min_le_right _ _,?_⟩ + intro r a hr hrs ha haA + obtain ⟨hr1,hh⟩ := hsub ⟨hr,hrs.trans_le (min_le_left _ _)⟩ + have hδ := retainedInverseOffset_nonneg hD hr hr1.le + have hm : retainedInverseOffset D r*a^(349/50:ℝ)≤1 := by + calc + _ ≤ retainedInverseOffset D r*(A*r)^(349/50:ℝ) := + mul_le_mul_of_nonneg_left (Real.rpow_le_rpow ha.le haA (by norm_num)) hδ + _ = retainedInverseOffset D r*r^(349/50:ℝ)*A^(349/50:ℝ) := by + rw [Real.mul_rpow hA.le hr.le]; ring + _ ≤ 1 := hh.le + rw [neg_div,Real.rpow_neg ha.le,inv_eq_one_div] + exact (le_div_iff₀ (Real.rpow_pos_of_pos ha _)).mpr hm + +lemma retained_event_offset_le {r₀ D p : ℝ} (hr₀ : 0 (r₀*2^k.val.val)^(101/100:ℝ))* + (1-Real.log p)^5≤retainedInverseOffset D (r₀*2^j) := by + have hr : 0 (r₀*2^k.val.val)^(101/100:ℝ)) D + (pow_pos hr 42) hp hp1 + have hl : Real.log ((r₀*2^j)^42)≤0 := + Real.log_nonpos (pow_pos hr 42).le (hp.trans hp1) + have hw := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (observationWidthSquareSum_retained_dyadic hr₀ J j) + observationEventEnergyConstant_pos.le) + (pow_nonneg (by linarith : 0≤1-Real.log ((r₀*2^j)^42)) 5) + unfold retainedInverseOffset inverseObservationOffset + linarith + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/ScaledWindow.lean b/lean/OAI/Analysis/CoulombRadii/Packets/ScaledWindow.lean new file mode 100644 index 0000000000000000000000000000000000000000..e29038102644b1788171bc03dbd4b54a902c316c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/ScaledWindow.lean @@ -0,0 +1,139 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Space + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +def scaledWindow (g : 𝓢(Space,ℝ)) (a : ℝ) (ha : a ≠ 0) : 𝓢(Space,ℝ) := + (Real.sqrt (a^3))⁻¹ • SchwartzMap.compCLMOfContinuousLinearEquiv ℝ + (ContinuousLinearEquiv.smulLeft (Units.mk0 a⁻¹ (inv_ne_zero ha))) g + +@[simp] lemma scaledWindow_apply (g : 𝓢(Space,ℝ)) (a : ℝ) (ha : a ≠ 0) (x : Space) : + scaledWindow g a ha x = (Real.sqrt (a^3))⁻¹*g (a⁻¹ • x) := rfl + +lemma space_integral_inv_smul (f : Space → ℝ) {a : ℝ} (ha : 0 < a) : + (∫ x, f (a⁻¹ • x)) = a^3*(∫ x, f x) := by + rw [Measure.integral_comp_smul_of_nonneg volume f a⁻¹ (hR := inv_nonneg.mpr ha.le)] + simp [finrank_euclideanSpace, smul_eq_mul] + +lemma scaledWindow_mass (g : 𝓢(Space,ℝ)) {a : ℝ} (ha : 0 < a) : + (∫ x : Space, scaledWindow g a ha.ne' x^2) = ∫ x : Space, g x^2 := by + simp only [scaledWindow_apply,mul_pow,inv_pow] + rw [Real.sq_sqrt (by positivity), integral_const_mul,space_integral_inv_smul (fun x => g x^2) ha] + field_simp + +lemma scaledWindow_fderiv (g : 𝓢(Space,ℝ)) {a : ℝ} (ha : 0 < a) (x v : Space) : + fderiv ℝ (scaledWindow g a ha.ne') x v = + (Real.sqrt (a^3))⁻¹*a⁻¹*(fderiv ℝ g (a⁻¹ • x) v) := by + have hd := (g.differentiableAt (x := a⁻¹ • x)).hasFDerivAt.comp x + ((a⁻¹ • ContinuousLinearMap.id ℝ Space).hasFDerivAt) + have H := (hd.const_mul (Real.sqrt (a^3))⁻¹).fderiv + change fderiv ℝ (fun z => (Real.sqrt (a^3))⁻¹*g (a⁻¹ • z)) x v = _ + simp only [Function.comp_def] at H + rw [H] + simp only [smul_apply,ContinuousLinearMap.comp_apply, + ContinuousLinearMap.id_apply,ContinuousLinearMap.map_smul,smul_eq_mul] + ring + +lemma scaledWindow_kinetic (g : 𝓢(Space,ℝ)) {a : ℝ} (ha : 0 < a) : + (∑ b : Fin 3, ∫ x : Space, (fderiv ℝ (scaledWindow g a ha.ne') x (EuclideanSpace.single b 1))^2) = + (∑ b : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single b 1))^2)/a^2 := by + simp only [scaledWindow_fderiv g ha,mul_pow,inv_pow] + rw [Real.sq_sqrt (by positivity)] + simp_rw [integral_const_mul] + have hi (b : Fin 3) := space_integral_inv_smul + (fun x => (fderiv ℝ g x (EuclideanSpace.single b 1))^2) ha + simp_rw [hi, ←mul_assoc] + rw [←Finset.mul_sum] + field_simp + +lemma scaledWindow_support (g : 𝓢(Space,ℝ)) (hgs : ∀ z, 1 < ‖z‖ → g z = 0) + {a : ℝ} (ha : 0 < a) (x : Space) (hx : a < ‖x‖) : + scaledWindow g a ha.ne' x = 0 := by + rw [scaledWindow_apply,hgs,mul_zero] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ha)] + exact (one_lt_inv_mul₀ ha).2 hx + +lemma scaledWindow_compactSupport (g : 𝓢(Space,ℝ)) + (hgs : ∀ z, 1 < ‖z‖ → g z = 0) {a : ℝ} (ha : 0 < a) : + HasCompactSupport (scaledWindow g a ha.ne' : Space → ℝ) := by + apply HasCompactSupport.intro (K := Metric.closedBall 0 a) (isCompact_closedBall 0 a) + intro x hx + exact scaledWindow_support g hgs ha x (by simpa [Metric.mem_closedBall] using hx) + +lemma scaledWindow_radial (g : 𝓢(Space,ℝ)) + (hrad : ∀ z, g z = g (EuclideanSpace.single 0 ‖z‖)) {a : ℝ} (ha : 0 < a) (x : Space) : + scaledWindow g a ha.ne' x = scaledWindow g a ha.ne' (EuclideanSpace.single 0 ‖x‖) := by + simp only [scaledWindow_apply] + congr 1 + rw [hrad (a⁻¹ • x)] + congr 1 + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ha)] + symm + ext i + simp only [PiLp.smul_apply,PiLp.single_apply,smul_eq_mul] + split <;> simp_all + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise ContDiff +namespace Coulomb + +def windowSeed (x : Space) : ℝ := Real.smoothTransition (2*(1-‖x‖^2)) + +lemma windowSeed_smooth : ContDiff ℝ ∞ windowSeed := by + apply Real.smoothTransition.contDiff.comp + exact contDiff_const.mul (contDiff_const.sub (contDiff_norm_sq ℝ)) + +lemma windowSeed_support (x : Space) (hx : 1 ≤ ‖x‖) : windowSeed x = 0 := by + apply Real.smoothTransition.zero_of_nonpos + nlinarith [norm_nonneg x] + +lemma windowSeed_compact : HasCompactSupport windowSeed := by + apply HasCompactSupport.intro (K := Metric.closedBall 0 1) (isCompact_closedBall 0 1) + intro x hx + apply windowSeed_support x + have hx' : 1 < ‖x‖ := by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hx + exact hx'.le + +lemma windowSeed_mass_pos : 0 < ∫ x : Space, windowSeed x^2 := by + apply integral_pos_of_integrable_nonneg_nonzero + (windowSeed_smooth.continuous.pow 2) + ((windowSeed_smooth.continuous.pow 2).integrable_of_hasCompactSupport (by simpa only [pow_two] using (windowSeed_compact.mul_left (f := windowSeed)))) + (fun x => sq_nonneg _) (x := 0) + norm_num [windowSeed, Real.smoothTransition.one_of_one_le] + +def unitWindow : 𝓢(Space,ℝ) := + (Real.sqrt (∫ x : Space, windowSeed x^2))⁻¹ • + windowSeed_compact.toSchwartzMap windowSeed_smooth + +lemma unitWindow_apply (x : Space) : unitWindow x = + (Real.sqrt (∫ z : Space, windowSeed z^2))⁻¹*windowSeed x := rfl + +lemma unitWindow_mass : (∫ x : Space, unitWindow x^2) = 1 := by + simp only [unitWindow_apply,mul_pow,inv_pow] + rw [Real.sq_sqrt windowSeed_mass_pos.le,integral_const_mul,inv_mul_cancel₀ windowSeed_mass_pos.ne'] + +lemma unitWindow_support (x : Space) (hx : 1 < ‖x‖) : unitWindow x = 0 := by + rw [unitWindow_apply,windowSeed_support x hx.le,mul_zero] + +lemma unitWindow_radial (x : Space) : unitWindow x = unitWindow (EuclideanSpace.single 0 ‖x‖) := by + simp [unitWindow_apply,windowSeed,PiLp.norm_single] + +lemma unitWindow_kinetic_nonneg : + 0 ≤ ∑ b : Fin 3, ∫ x : Space, (fderiv ℝ unitWindow x (EuclideanSpace.single b 1))^2 := by + exact Finset.sum_nonneg (fun b hb => integral_nonneg (fun x => sq_nonneg _)) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/ScreenBox.lean b/lean/OAI/Analysis/CoulombRadii/Packets/ScreenBox.lean new file mode 100644 index 0000000000000000000000000000000000000000..81f88f52d1537638fa59bc50a4d52e0d75850969 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/ScreenBox.lean @@ -0,0 +1,121 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.AtomicHistory +import OAI.Analysis.CoulombRadii.Screening.ScreenUnits +import OAI.Analysis.CoulombRadii.RandomFields.RawCap + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def AtomicScaleWindow (a q : ℝ) (y : Space) : Prop := + a ≤ q*atomicCellScale y ∧ atomicCellScale y ≤ q*a + +lemma AtomicScaleWindow.nonzero {a q : ℝ} {y : Space} (h : AtomicScaleWindow a q y) + (ha : 0 le_trans (by norm_num) (S.charge_ge_one i)) + +lemma atomicRawValues_cap {J n : ℕ} (S : Nuclei J) (hatom : ∀ i, S.position i=0) + (ψ : H1Vector n) (hm : mass ψ=1) {a w : ℝ} (ha : 0 r) (𝓝[>] 0) (𝓝 0) := tendsto_id.mono_left nhdsWithin_le_nhds + have h3 := ht.const_mul (8*L/100000) + have h4 := ((ht.const_mul (8*L/100000)).pow 7).const_mul D + have h5 := (tendsto_positive_rpow_zero (by norm_num : (0:ℝ) < 1/100)).const_mul (Real.sqrt 3) + have h6 := (tendsto_positive_rpow_zero hw).const_mul (c/(3^packetExponent)) + have h7 := ht.const_mul A + have h8 := (mesh_width_power_tendsto hc 3 (by norm_num [packetExponent])).const_mul A + have h9 := (mesh_width_power_tendsto hc 4 (by norm_num [packetExponent])).const_mul B + simp only [mul_zero,zero_pow (by decide : 7≠0)] at h1 h2 h3 h4 h5 h6 h7 h8 h9 + have he : ∀ᶠ r : ℝ in 𝓝[>] 0, + c*(1+packetExponent)*r^packetExponent < 1/4 ∧ + c*r^packetExponent < 1/10000 ∧ + (8*L/100000)*r < 1 ∧ D*((8*L/100000)*r)^7 < 1 ∧ + Real.sqrt 3*r^(1/100:ℝ) < 1/12 ∧ + (c/(3^packetExponent))*r^packetExponent < 3 ∧ + A*r < 1 ∧ A*(r*(r/(c*(r/3)*(r/3)^packetExponent))^3) < ξ/8 ∧ + B*(r*(r/(c*(r/3)*(r/3)^packetExponent))^4) < ε := by + filter_upwards [h1.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1/4)), + h2.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1/10000)), + h3.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1)), + h4.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1)), + h5.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1/12)), + h6.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 3)), + h7.eventually (gt_mem_nhds (by norm_num : (0:ℝ) < 1)), + h8.eventually (gt_mem_nhds (by positivity : (0:ℝ) < ξ/8)), + h9.eventually (gt_mem_nhds hε)] with r hh1 hh2 hh3 hh4 hh5 hh6 hh7 hh8 hh9 + exact ⟨hh1,hh2,hh3,hh4,hh5,hh6,hh7,hh8,hh9⟩ + obtain ⟨s,hs,Hs⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp he + refine ⟨min s (1/16),lt_min hs (by norm_num),min_le_right _ _,?_⟩ + intro r hr hrs + obtain ⟨H1,H2,H3,H4,H5,H6,H7,H8,H9⟩ := Hs ⟨hr,hrs.trans_le (min_le_left _ _)⟩ + refine ⟨H1.le,H2.le,H3.le,H4.le,?_,?_,H7.le,?_,H9.le⟩ + · have he : (101/100:ℝ)=1+1/100 := by norm_num + rw [he,Real.rpow_add hr,Real.rpow_one] + nlinarith [mul_le_mul_of_nonneg_left H5.le hr.le] + · have ht : c*(r/3)^packetExponent < 3 := by + rw [Real.div_rpow hr.le (by norm_num : (0:ℝ) ≤ 3)] + convert H6 using 1 + ring + nlinarith [mul_le_mul_of_nonneg_left ht.le (by positivity : 0 ≤ r/3)] + · simpa only [mul_assoc] using H8.le +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma mesh_exception_probability_scale {r L C N M : ℝ} + (hr : 0 < r) (hr1 : r ≤ 1) (hL : 1 ≤ L) (hC : 0 ≤ C) + (hN : 0 ≤ N) (hM : 0 ≤ M) (hMbound : M ≤ (12*L+1)^3/r^3) : + r^40+C*r^249+2*M*N*r^42 ≤ (1+C+2*(12*L+1)^3*N)*r^25 := by + have h40 : r^40 ≤ r^25 := pow_le_pow_of_le_one hr.le hr1 (by omega) + have h249 : r^249 ≤ r^25 := pow_le_pow_of_le_one hr.le hr1 (by omega) + have h39 : r^39 ≤ r^25 := pow_le_pow_of_le_one hr.le hr1 (by omega) + have H : 2*M*N*r^42 ≤ 2*(12*L+1)^3*N*r^39 := by + calc + _ ≤ 2*((12*L+1)^3/r^3)*N*r^42 := by + apply mul_le_mul_of_nonneg_right ?_ (by positivity) + apply mul_le_mul_of_nonneg_right ?_ hN + exact mul_le_mul le_rfl hMbound hM (by norm_num) + _ = _ := by field_simp + calc + _ ≤ r^25+C*r^25+2*(12*L+1)^3*N*r^25 := + add_le_add (add_le_add h40 (mul_le_mul_of_nonneg_left h249 hC)) + (H.trans (mul_le_mul_of_nonneg_left h39 (by positivity))) + _ = _ := by ring +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/TailMoment.lean b/lean/OAI/Analysis/CoulombRadii/Packets/TailMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..64226ac0b56923afeefea5dd9cbb8a49f85981cb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/TailMoment.lean @@ -0,0 +1,123 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.RestrictedField +import OAI.Analysis.CoulombRadii.Localization.RadialCut +import OAI.Analysis.CoulombRadii.Screening.ScreenUnits + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +lemma screenBaseMass_antitone {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + screenBaseMass b ≤ screenBaseMass a := by + have hb : 0 < b := ha.trans_le hab + unfold screenBaseMass + exact max_le_max ((inv_le_inv₀ (by positivity) (by positivity)).mpr (pow_le_pow_left₀ ha.le hab 3)) le_rfl + +lemma screenMass_dyadic_bound {δ h : ℝ} (hδ : 0 ≤ δ) (hh : 0 < h) (j : ℕ) : + screenMass δ ((2:ℝ)^j*h)/((2:ℝ)^j*h) ≤ screenMass δ h/h*(3/4:ℝ)^j := by + have h2 : (1:ℝ) ≤ 2^j := one_le_pow₀ (by norm_num) + have h3 : (1:ℝ) ≤ (3/2:ℝ)^j := one_le_pow₀ (by norm_num) + have hb := screenBaseMass_antitone hh (show h ≤ (2:ℝ)^j*h by nlinarith) + have hb' : screenBaseMass ((2:ℝ)^j*h) ≤ (3/2:ℝ)^j*screenBaseMass h := + hb.trans (le_mul_of_one_le_left (screenBaseMass_nonneg h) h3) + have hp : (2:ℝ)^j ≤ ((3/2:ℝ)^j)^2 := by + have H := pow_le_pow_left₀ (by norm_num : (0:ℝ) ≤ 2) (by norm_num : (2:ℝ) ≤ (3/2:ℝ)^2) j + simpa only [←pow_mul,Nat.mul_comm] using H + have hr : Real.sqrt (δ*((2:ℝ)^j*h)) ≤ (3/2:ℝ)^j*Real.sqrt (δ*h) := by + apply (Real.sqrt_le_iff).mpr + refine ⟨by positivity,?_⟩ + rw [mul_pow,Real.sq_sqrt (mul_nonneg hδ hh.le)] + nlinarith [mul_le_mul_of_nonneg_right hp (mul_nonneg hδ hh.le)] + have hm : screenMass δ ((2:ℝ)^j*h) ≤ (3/2:ℝ)^j*screenMass δ h := by + unfold screenMass + nlinarith + refine (div_le_div_of_nonneg_right hm (by positivity)).trans_eq ?_ + have he : (3/2:ℝ)^j=(3/4:ℝ)^j*(2:ℝ)^j := by rw [←mul_pow]; congr 1; norm_num + rw [he] + field_simp + +def radialTailKernel (r : ℝ) (x : Space) : ℝ := if r ≤ ‖x‖ then ‖x‖⁻¹ else 0 + +def radialTailPotential {n : ℕ} (ψ : H1Vector n) (r : ℝ) : ℝ := + restrictedCorePotential ψ {x | r ≤ ‖x‖} 0 + +lemma radialTailPotential_eq {n : ℕ} (ψ : H1Vector n) (r : ℝ) : + radialTailPotential ψ r=∑ s, ∑ i : Fin n, ∫ x, radialTailKernel r (position x i)*‖ψ.value s x‖^2 := by + unfold radialTailPotential restrictedCorePotential radialTailKernel coulombKernel + simp only [sub_zero,Set.mem_ofPred_eq,ite_mul,zero_mul] + +lemma radialTailKernel_nonneg (r : ℝ) (x : Space) : 0 ≤ radialTailKernel r x := by + unfold radialTailKernel + split_ifs <;> positivity + +lemma radialTailKernel_le {r : ℝ} (hr : 0 < r) (x : Space) : radialTailKernel r x ≤ r⁻¹ := by + unfold radialTailKernel + split_ifs with hx + · exact (inv_le_inv₀ (hr.trans_le hx) hr).mpr hx + · positivity + +lemma radialTailKernel_integrable {n : ℕ} (ψ : H1Vector n) (r : ℝ) (s : Spins n) (i : Fin n) : + Integrable (fun x => radialTailKernel r (position x i)*‖ψ.value s x‖^2) := by + simpa only [radialTailKernel,coulombKernel,sub_zero,Set.mem_ofPred_eq,ite_mul,zero_mul] using + restrictedCore_integrable ψ (isClosed_le continuous_const continuous_norm).measurableSet s i 0 + +lemma radialTailPotential_cap {n : ℕ} (ψ : H1Vector n) {r : ℝ} (hr : 0 < r) : + radialTailPotential ψ r ≤ (n:ℝ)/r*mass ψ := by + rw [radialTailPotential_eq] + calc + _ ≤ ∑ s : Spins n, ∑ i : Fin n, ∫ x, r⁻¹*‖ψ.value s x‖^2 := by + apply Finset.sum_le_sum; intro s hs + apply Finset.sum_le_sum; intro i hi + exact integral_mono (radialTailKernel_integrable ψ r s i) + (((ψ.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul _) + (fun x => mul_le_mul_of_nonneg_right (radialTailKernel_le hr _) (sq_nonneg _)) + _ = _ := by simp only [integral_const_mul,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mass,div_eq_mul_inv,←Finset.mul_sum,mul_assoc] + +lemma radialTailKernel_step {r : ℝ} (hr : 0 < r) (x : Space) : + radialTailKernel r x ≤ r⁻¹*({z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r}.indicator (fun _ => (1:ℝ)) x)+ + radialTailKernel (2*r) x := by + by_cases h0 : r ≤ ‖x‖ + · by_cases h1 : 2*r ≤ ‖x‖ + · simp only [radialTailKernel,ite_eq_left h0,ite_eq_left h1] + have H : 0 ≤ ({z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r}.indicator (fun _ => (1:ℝ)) x) := Set.indicator_nonneg (fun _ _ => zero_le_one) _ + nlinarith [mul_nonneg (inv_nonneg.mpr hr.le) H] + · have hA : x∈{z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r} := by constructor <;> linarith + simp only [indicator_of_mem hA,mul_one,radialTailKernel,ite_eq_left h0,ite_eq_right h1,add_zero] + exact (inv_le_inv₀ (hr.trans_le h0) hr).mpr h0 + · rw [radialTailKernel,ite_eq_right h0] + exact add_nonneg (mul_nonneg (inv_nonneg.mpr hr.le) (Set.indicator_nonneg (fun _ _ => zero_le_one) _)) (radialTailKernel_nonneg _ _) + +lemma radialTailPotential_step {n : ℕ} (ψ : H1Vector n) {r : ℝ} (hr : 0 < r) : + radialTailPotential ψ r ≤ expectedPopulation ψ {z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r}/r+ + radialTailPotential ψ (2*r) := by + let A : Set Space := {z : Space | (1/2:ℝ)*r < ‖z‖ ∧ ‖z‖ < 4*r} + have hA : MeasurableSet A := (isOpen_lt continuous_const continuous_norm).measurableSet.inter + (isOpen_lt continuous_norm continuous_const).measurableSet + rw [radialTailPotential_eq,radialTailPotential_eq] + calc + _ ≤ ∑ s : Spins n, ∑ i : Fin n, ∫ x, (r⁻¹*A.indicator (fun _ => (1:ℝ)) (position x i)+radialTailKernel (2*r) (position x i))*‖ψ.value s x‖^2 := by + apply Finset.sum_le_sum; intro s hs + apply Finset.sum_le_sum; intro i hi + apply integral_mono (radialTailKernel_integrable ψ r s i) _ + (fun x => mul_le_mul_of_nonneg_right (radialTailKernel_step hr _) (sq_nonneg _)) + convert ((population_integrable ψ A hA s i).const_mul r⁻¹).add + (radialTailKernel_integrable ψ (2*r) s i) using 1 + first | rfl | (ext x; simp only [Pi.add_apply]; ring) + _ = _ := by + simp_rw [add_mul,mul_assoc] + simp_rw [integral_add ((population_integrable ψ A hA _ _).const_mul _) (radialTailKernel_integrable ψ (2*r) _ _),integral_const_mul] + simp only [Finset.sum_add_distrib,←Finset.mul_sum,expectedPopulation,A,div_eq_mul_inv] + ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Packets/WindowCoulomb.lean b/lean/OAI/Analysis/CoulombRadii/Packets/WindowCoulomb.lean new file mode 100644 index 0000000000000000000000000000000000000000..4944fb0ee8f1f13abc6e1993e9492f366b4cf918 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Packets/WindowCoulomb.lean @@ -0,0 +1,303 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.SpectralTheory.SectorFormBottom + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +lemma window_coulomb_eq (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {R : ℝ} (hR : 0 < R) + (hs : ∀ y, R < ‖y‖ → g y = 0) {x : Space} (hx : R ≤ ‖x‖) : + (∫ y, coulombKernel (x-y)*g y^2) = coulombKernel x := by + have hx0 : x ≠ 0 := by intro he; subst x; simp at hx; linarith + simpa only [hg,mul_one] using radial_coulomb_integral_eq (schwartz_square_integrable g) + (g.continuous.measurable.pow_const 2) (fun x => sq_nonneg (g x)) (schwartz_square_le g) + (fun y => congrArg (fun t : ℝ => t^2) (hrad y)) hR.le (fun y hy => by simp [hs y hy]) hx0 hx + +lemma window_coulomb_bound (g : 𝓢(Space,ℝ)) (x : Space) : + (∫ y, coulombKernel (x-y)*g y^2) ≤ + 2*Real.pi*(SchwartzMap.seminorm ℝ 0 0 g)^2 + ∫ y : Space, g y^2 := by + simpa only [one_pow,mul_one,one_div,one_mul,inv_one] using + coulomb_convolution_bound (schwartz_square_integrable g) (g.continuous.measurable.pow_const 2) + (fun y => sq_nonneg (g y)) (schwartz_square_le g) (by norm_num : (0:ℝ)<1) x + +lemma packetDensity_coulomb_prod_integrable (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) (a : Space) : + Integrable (fun p : Space × Space => coulombKernel (a-p.1)*g (p.1-p.2)^2*ρ p.2) + (volume.prod volume) := by + let C := 2*Real.pi*(SchwartzMap.seminorm ℝ 0 0 g)^2+∫ y : Space, g y^2 + have hF : Measurable (fun p : Space × Space => coulombKernel (a-p.1)*g (p.1-p.2)^2*ρ p.2) := + ((coulombKernel_measurable.comp (measurable_const.sub measurable_fst)).mul + ((g.continuous.measurable.comp (measurable_fst.sub measurable_snd)).pow_const 2)).mul + (hm.comp measurable_snd) + have hI (y : Space) : Integrable (fun x => coulombKernel (a-x)*g (x-y)^2) := + coulomb_convolution_integrable (window_shift_integrable g y) + (((g.continuous.measurable.comp (measurable_id.sub measurable_const)).pow_const 2)) + (fun x => sq_nonneg _) (fun x => schwartz_square_le g (x-y)) (by norm_num : (0:ℝ)<1) a + apply (integrable_prod_iff' hF.aestronglyMeasurable).2 + constructor + · exact Eventually.of_forall fun y => (hI y).mul_const (ρ y) + · apply (hi.const_mul C).mono' hF.aestronglyMeasurable.prod_swap.norm.integral_prod_right' + exact Eventually.of_forall fun y => by + rw [Real.norm_of_nonneg (integral_nonneg (fun _ => norm_nonneg _))] + have he : (∫ x, ‖coulombKernel (a-x)*g (x-y)^2*ρ y‖) = + (∫ x, coulombKernel (a-x)*g (x-y)^2)*ρ y := by + rw [←integral_mul_const] + exact integral_congr_ae (Eventually.of_forall fun _ => + Real.norm_of_nonneg (mul_nonneg (mul_nonneg (coulombKernel_nonneg _) (sq_nonneg _)) (hp y))) + change (∫ x, ‖coulombKernel (a-x)*g (x-y)^2*ρ y‖) ≤ C*ρ y + rw [he,window_shift_coulomb_integral] + exact mul_le_mul_of_nonneg_right (window_coulomb_bound g _) (hp y) + +lemma packetDensity_coulomb_integral (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) (a : Space) : + (∫ x, coulombKernel (a-x)*packetDensity g ρ x) = + ∫ y, (∫ x, coulombKernel ((a-y)-x)*g x^2)*ρ y := by + have hI := packetDensity_coulomb_prod_integrable g ρ hp hm hi a + calc + _ = ∫ x, ∫ y, coulombKernel (a-x)*g (x-y)^2*ρ y := by + unfold packetDensity + simp_rw [←integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall (fun x => integral_congr_ae (Eventually.of_forall fun y => by ring)) + _ = ∫ y, ∫ x, coulombKernel (a-x)*g (x-y)^2*ρ y := integral_integral_swap hI + _ = _ := by simp_rw [integral_mul_const, window_shift_coulomb_integral] + +lemma packetDensity_coulomb_eq (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {R : ℝ} (hR : 0 < R) + (hs : ∀ y, R < ‖y‖ → g y = 0) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) (a : Space) + (hsep : ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) : + (∫ x, coulombKernel (a-x)*packetDensity g ρ x) = ∫ y, coulombKernel (a-y)*ρ y := by + rw [packetDensity_coulomb_integral g ρ hp hm hi a] + apply integral_congr_ae + exact Eventually.of_forall fun y => by + by_cases hy : ρ y = 0 + · simp [hy] + · change (∫ x, coulombKernel (a-y-x)*g x^2)*ρ y = coulombKernel (a-y)*ρ y + rw [window_coulomb_eq g hg hrad hR hs (hsep y hy)] + +lemma separated_density_coulomb_integrable {ρ : Space → ℝ} (hp : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hi : Integrable ρ) {R : ℝ} (hR : 0 < R) (a : Space) + (hsep : ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) : + Integrable (fun y => coulombKernel (a-y)*ρ y) := by + apply (hi.const_mul R⁻¹).mono' + · exact ((coulombKernel_measurable.comp (measurable_const.sub measurable_id)).mul hm).aestronglyMeasurable + · exact Eventually.of_forall fun y => by + rw [Real.norm_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (hp y))] + by_cases hy : ρ y = 0 + · simp [hy] + · exact mul_le_mul_of_nonneg_right (by simpa [coulombKernel,one_div] using (one_div_le_one_div_of_le hR (hsep y hy))) (hp y) + +lemma coreCoulombPotential_packet_eq {m : ℕ} (u : H1Vector m) + {A : Set Space} (hu : SpatiallySupported u A) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {R : ℝ} (hR : 0 < R) + (hs : ∀ y, R < ‖y‖ → g y = 0) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) + (hsep : ∀ a ∈ A, ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) : + (∫ x, coreCoulombPotential u x*packetDensity g ρ x) = ∫ x, coreCoulombPotential u x*ρ x := by + rw [coreCoulombPotential_fubini u _ (packetDensity_integrable g ρ hp hm hi), + coreCoulombPotential_fubini u ρ hi] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro i _ + apply integral_congr_ae + filter_upwards [hu s] with x hx + by_cases he : u.value s x = 0 + · simp [he] + · have ha : position x i ∈ A := (by_contra (fun hn => he (hx hn)) : x ∈ allPositions A) i + change (∫ z, coulombKernel (position x i-z)*packetDensity g ρ z)*‖u.value s x‖^2 = _ + rw [packetDensity_coulomb_eq g hg hrad hR hs ρ hp hm hi (position x i) (hsep _ ha)] + +lemma separated_density_nuclear_integrable {M : ℕ} (S : Nuclei M) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) + {R : ℝ} (hR : 0 < R) + (hsep : ∀ j y, ρ y ≠ 0 → R ≤ ‖S.position j-y‖) : + Integrable (fun x => attraction S x*ρ x) := by + simp only [attraction,Finset.sum_mul] + apply integrable_finsetSum + intro j _ + have h := (separated_density_coulomb_integrable hp hm hi hR (S.position j) (hsep j)).const_mul (S.charge j) + apply h.congr + exact Eventually.of_forall fun x => by + dsimp only + rw [coulombKernel_sub_comm x] + ring + +lemma attraction_packet_eq {M : ℕ} (S : Nuclei M) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {R : ℝ} (hR : 0 < R) + (hs : ∀ y, R < ‖y‖ → g y = 0) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) + (hsep : ∀ j y, ρ y ≠ 0 → R ≤ ‖S.position j-y‖) : + (∫ x, attraction S x*packetDensity g ρ x) = ∫ x, attraction S x*ρ x := by + have hn (j : Fin M) : Integrable (fun x => S.charge j*(coulombKernel (S.position j-x)*ρ x)) := + (separated_density_coulomb_integrable hp hm hi hR (S.position j) (hsep j)).const_mul _ + have hsmooth (j : Fin M) : Integrable (fun x => S.charge j*(coulombKernel (S.position j-x)*packetDensity g ρ x)) := by + have h := (packetDensity_coulomb_prod_integrable g ρ hp hm hi (S.position j)).integral_prod_left + apply (h.const_mul (S.charge j)).congr + exact Eventually.of_forall fun x => by + simp only [packetDensity,←integral_const_mul] + apply integral_congr_ae + exact Eventually.of_forall (fun y => by ring) + simp only [attraction,Finset.sum_mul] + simp_rw [coulombKernel_sub_comm _ (S.position _),mul_assoc] + rw [integral_finsetSum _ (fun j _ => hsmooth j),integral_finsetSum _ (fun j _ => hn j)] + apply Finset.sum_congr rfl + intro j _ + rw [integral_const_mul,integral_const_mul, + packetDensity_coulomb_eq g hg hrad hR hs ρ hp hm hi _ (hsep j)] + +lemma coreScreenedField_packet_eq {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + {A : Set Space} (hu : SpatiallySupported u A) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) {R : ℝ} (hR : 0 < R) + (hs : ∀ y, R < ‖y‖ → g y = 0) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) + (hsep : ∀ a ∈ A, ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) + (hnuc : ∀ j y, ρ y ≠ 0 → R ≤ ‖S.position j-y‖) : + (∫ x, coreScreenedField S u x*packetDensity g ρ x) = ∫ x, coreScreenedField S u x*ρ x := by + rw [coreScreenedField_packet_integral S u g ρ hp hm hi, + coreCoulombPotential_packet_eq u hu g hg hrad hR hs ρ hp hm hi hsep, + attraction_packet_eq S g hg hrad hR hs ρ hp hm hi hnuc] + simp only [coreScreenedField,sub_mul] + exact (integral_sub (separated_density_nuclear_integrable S ρ hp hm hi hR hnuc) + (coreCoulombPotential_mul_integrable u ρ hi)).symm + +theorem source_free_trial_in_hole {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + {R : ℝ} (hR : 0 < R) (hgs : ∀ y, R < ‖y‖ → g y = 0) + (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (ht : Integrable (fun y => ρ y^(5/3:ℝ))) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) + (hs : ∀ y, y ∉ K → ρ y = 0) (hsu : SpatiallySupported u A) + (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) + (hcore : ∀ a ∈ A, ∀ y, ρ y ≠ 0 → R ≤ ‖a-y‖) + (hnuc : ∀ j y, ρ y ≠ 0 → R ≤ ‖S.position j-y‖) : + unrestrictedFormBottom S ≤ ((form S u + + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2) - + (∫ x, coreScreenedField S u x*ρ x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2)) : ℝ) : EReal) := by + have H := trial_in_hole S u hu hmu g hg hgc hrad ρ hp hm ht K A hK hA hs hsu hsep + rw [coreScreenedField_packet_eq S u hsu g hg hrad hR hgs ρ hp hm + (compact_density_integrable ρ hp hm ht K hK hs) hcore hnuc] at H + exact H + +end Coulomb + +open MeasureTheory Set +open scoped BigOperators ENNReal + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/EnsembleMoments.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/EnsembleMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..dec548b82c9df5d34b75b6861b52028f91b9e023 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/EnsembleMoments.lean @@ -0,0 +1,116 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedEnsemble + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb +namespace RecordedEnsemble + +def initial {n : ℕ} (ψ : H1Vector n) : RecordedEnsemble n where + index := Unit + finite := inferInstance + out := fun _ => 0 + core := fun _ => n + vector := fun _ => ψ.reindex (finCongr (Nat.zero_add n)) + labels := fun _ => finCongr (Nat.zero_add n) + +lemma initial_conserves {n : ℕ} (ψ : H1Vector n) : (initial ψ).Conserves ψ := by + intro W hW hB + change (∑ p : Unit, potentialForm (W ∘ reindexConfiguration (finCongr (Nat.zero_add n))) + (ψ.reindex (finCongr (Nat.zero_add n))))=potentialForm W ψ + simp only [potentialForm_reindex] + simp + +lemma initial_fermionic {n : ℕ} (ψ : H1Vector n) (hψ : Antisymmetric ψ) : + (initial ψ).CoreFermionic := by + intro p + exact (hψ.reindex _).partly _ + +lemma initial_supported {n : ℕ} (ψ : H1Vector n) : (initial ψ).OutSupported ∅ := by + intro p s + exact Eventually.of_forall (fun x i hi => by obtain ⟨j,hj⟩ := hi; exact Fin.elim0 j) + +lemma initial_mass {n : ℕ} (ψ : H1Vector n) : (initial ψ).totalMass=mass ψ := by + change (∑ p : Unit, mass (ψ.reindex (finCongr (Nat.zero_add n))))=mass ψ + simp [mass_reindex] +lemma initial_form {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) : (initial ψ).totalForm S=form S ψ := by + change (∑ p : Unit, form S (ψ.reindex (finCongr (Nat.zero_add n))))=form S ψ + simp [form_reindex] + +lemma out_square_le {n : ℕ} {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) {A : Set Space} (hA : MeasurableSet A) (hsupp : T.OutSupported A) : + (∑ p, (T.out p:ℝ)^2*mass (T.vector p))≤localCountSecondMoment ψ A := by + calc + _ = ∑ p, sliceExpectation (T.vector p) (fun _ x => (localCount A x)^2) := by + apply Finset.sum_congr rfl + intro p hp + rw [←sliceExpectation_number] + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [(hsupp p).recorded_positions s] with x hx + by_cases hm : mass ((T.vector p).coreSlice s x)=0 + · simp only [hm,zero_mul] + · have he : localCount A x=(T.out p:ℝ) := by simp only [localCount,indicator_of_mem (hx hm _),Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + rw [he] + _ ≤ _ := hT.recorded_secondMoment hA + +lemma count_cover_le {m : ℕ} {C : Type*} [Fintype C] (A : C → Set Space) + (x : Configuration m) (hcover : ∀ i, ∃ c, position x i∈A c) : + (m:ℝ)≤∑ c, localCount (A c) x := by + calc + _ = ∑ i : Fin m, (1:ℝ) := by simp + _ ≤ ∑ i : Fin m, ∑ c : C, (A c).indicator (fun _ => (1:ℝ)) (position x i) := by + apply Finset.sum_le_sum + intro i hi + obtain ⟨c,hc⟩ := hcover i + calc + 1=(A c).indicator (fun _ => (1:ℝ)) (position x i) := by rw [indicator_of_mem hc] + _≤_ := Finset.single_le_sum (fun c _ => Set.indicator_nonneg (fun _ _ => zero_le_one) _) (Finset.mem_univ c) + _ = _ := Finset.sum_comm + +lemma out_square_cover {n : ℕ} {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) {C : Type*} [Fintype C] (A : C → Set Space) + (hA : ∀ c, MeasurableSet (A c)) + (hcover : ∀ p s, ∀ᵐ x, mass ((T.vector p).coreSlice s x)≠0 → ∀ i, ∃ c, position x i∈A c) : + (∑ p, (T.out p:ℝ)^2*mass (T.vector p))≤ + (Fintype.card C:ℝ)*(∑ c, localCountSecondMoment ψ (A c)) := by + have H (p : T.index) : (T.out p:ℝ)^2*mass (T.vector p)≤ + (Fintype.card C:ℝ)*∑ c, sliceExpectation (T.vector p) (fun _ x => (localCount (A c) x)^2) := by + rw [←sliceExpectation_number] + change (∑ s, ∫ x, mass ((T.vector p).coreSlice s x)*(T.out p:ℝ)^2)≤_ + simp only [sliceExpectation] + rw [Finset.sum_comm,Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + rw [←integral_finsetSum _ (fun c _ => sliceCount_weight_integrable (T.vector p) (hA c) s 2),←integral_const_mul] + apply integral_mono_ae + · exact (mass_coreSlice_integrable (T.vector p) s).mul_const _ + · exact (integrable_finsetSum _ (fun c _ => sliceCount_weight_integrable (T.vector p) (hA c) s 2)).const_mul _ + · filter_upwards [hcover p s] with x hx + by_cases hm : mass ((T.vector p).coreSlice s x)=0 + · simp only [hm,zero_mul,Finset.sum_const_zero,mul_zero,le_refl] + · have H := count_cover_le A x (hx hm) + have HS := sq_sum_le_card_mul_sum_sq (s:=Finset.univ) (f:=fun c => localCount (A c) x) + simp only [Finset.card_univ] at HS + have HG := (pow_le_pow_left₀ (Nat.cast_nonneg _) H 2).trans HS + have HM := mul_le_mul_of_nonneg_left HG (mass_nonneg ((T.vector p).coreSlice s x)) + simpa only [Finset.mul_sum,mul_left_comm] using HM + have HH := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => H p) + rw [←Finset.mul_sum,Finset.sum_comm] at HH + refine HH.trans (mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun c _ => ?_)) (Nat.cast_nonneg _)) + exact hT.recorded_secondMoment (hA c) + +end RecordedEnsemble +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/InitialDatum.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/InitialDatum.lean new file mode 100644 index 0000000000000000000000000000000000000000..f949000ace5e5ff48e71a79f76de77b2e62d9dad --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/InitialDatum.lean @@ -0,0 +1,163 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.InitialInvariant +import OAI.Analysis.CoulombRadii.RandomFields.CompactRandomField + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Init +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} +variable {bad : Ω → Prop} {H μ : Ω → Position → ℝ} {B C Z r a L : ℝ} +lemma initialPropagationOffset_joint_measurable (hb : MeasurableSet {o | bad o}) + (hH : Measurable (Function.uncurry H)) : + Measurable (fun z : Ω×Position => initialPropagationOffset (bad z.1) Z r a (H z.1) z.2) := by + exact ((measurable_const.ite (hb.preimage measurable_fst) hH).sub measurable_const).add + (measurable_const.mul ((continuous_norm.measurable.comp measurable_snd).pow_const 2)) + +omit [MeasurableSpace Ω] in +lemma initialPropagationOffset_uniform_bounds + (hbH : ∀ D : ℝ,∃ A : ℝ,∀ o x,x∈Metric.closedBall 0 D → |H o x|≤A) : + ∀ D : ℝ,∃ A : ℝ,∀ o x,x∈Metric.closedBall 0 D → + |initialPropagationOffset (bad o) Z r a (H o) x|≤A := by + intro D + obtain ⟨K,hK⟩ := hbH D + refine ⟨max 0 K+|(7/10:ℝ)*Z/r|+|a| * D^2,fun o x hx => ?_⟩ + have hn : ‖x‖≤D := by simpa using hx + have h2 : ‖x‖^2≤D^2 := pow_le_pow_left₀ (norm_nonneg x) hn 2 + have hi : |if bad o then (0:ℝ) else H o x| ≤ max 0 K := by + split_ifs + · simpa only [abs_zero] using le_max_left 0 K + · exact (hK o x hx).trans (le_max_right 0 K) + exact (abs_add_le _ _).trans (add_le_add ((abs_sub _ _).trans (add_le_add hi le_rfl)) + (by rw [abs_mul,abs_of_nonneg (sq_nonneg ‖x‖)]; exact mul_le_mul_of_nonneg_left h2 (abs_nonneg a))) + +lemma initialNextOffset_joint_measurable (hr : 0 initialNextOffset (bad z.1) B Z r a (H z.1) z.2) := + radialMaxSplice_joint_measurable (f:=fun o => initialPropagationOffset (bad o) Z r a (H o)) + (g:=fun _ => propagationBarrierOffset B r Z) ((103/100)*r) ((39/20)*r) + (initialPropagationOffset_joint_measurable hb hH) + ((propagationBarrierOffset_continuous B Z hr).measurable.comp measurable_snd) + +omit [MeasurableSpace Ω] in +lemma initialNextOffset_uniform_bounds (hr : 0 radialMaxSplice_abs_bound (hK o x hx) (hA x hx)⟩ + +lemma initialPropagationError_joint_measurable (hb : MeasurableSet {o | bad o}) + (hμ : Measurable (Function.uncurry μ)) : + Measurable (fun z : Ω×Position => initialPropagationError (bad z.1) r (μ z.1) z.2) := + hμ.ite ((hb.preimage measurable_fst).inter (measurableSet_lt + (continuous_norm.measurable.comp measurable_snd) measurable_const)) measurable_const + +omit [MeasurableSpace Ω] in +lemma initialPropagationError_uniform_bounds + (hbμ : ∀ D : ℝ,∃ A : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤A) : + ∀ D : ℝ,∃ A : ℝ,∀ o x,x∈Metric.closedBall 0 D → + |initialPropagationError (bad o) r (μ o) x|≤A := by + intro D + obtain ⟨K,hK⟩ := hbμ D + refine ⟨max K 0,fun o x hx => ?_⟩ + unfold initialPropagationError + split_ifs + · exact (hK o x hx).trans (le_max_left K 0) + · simpa only [abs_zero] using le_max_right K 0 + +def initialPropagationDatum (hr : 0 initialNextOffset (bad o) B Z r a (H o),fun o => initialPropagationError (bad o) r (μ o), + initialNextOffset_joint_measurable hr hb hH,initialPropagationError_joint_measurable hb hμ, + initialNextOffset_uniform_bounds hr hbH,initialPropagationError_uniform_bounds hbμ, + hd.mono (fun _ h => h.invariant)⟩ +end Init +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Error +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable {μ p : Ω → Position → ℝ} {bad : Ω → Prop} {r R : ℝ} + +lemma shell_error_product_integrable (hm : Measurable (Function.uncurry μ)) + (hb : MeasurableSet {o | bad o}) + (hbm : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤C) : + Integrable (fun z : Ω×Position => if bad z.1 ∧ r≤‖z.2‖ ∧ ‖z.2‖ if bad o ∧ r≤‖x‖ ∧ ‖x‖ ?_⟩ + split_ifs + · exact (hC o x hx).trans (le_max_left _ _) + · simpa only [abs_zero] using le_max_right C 0 + · exact Eventually.of_forall (fun o x hx => ite_eq_right (fun h => (not_lt.mpr hx) h.2.2)) + +lemma propagationStepError_total (hm : Measurable (Function.uncurry μ)) + (hb : MeasurableSet {o | bad o}) + (hbm : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤C) + (hip : Integrable (Function.uncurry p) (P.prod volume)) : + (∫ o,(∫ x,propagationStepError (bad o) r R ‖x‖ (μ o x) (p o x)) ∂P)= + (∫ o,(∫ x,p o x) ∂P)+(∫ o in {o | bad o},∫ x in {x : Position | r≤‖x‖ ∧ ‖x‖ if bad o ∧ r≤‖x‖ ∧ ‖x‖ ∫ x in {x : Position | r≤‖x‖ ∧ ‖x‖ ?_)) + simp only [f,ho,true_and,Set.indicator_apply,mem_ofPred_eq] + · simp only [f,ho,false_and,ite_false,integral_zero,Set.indicator_of_notMem (s:={o | bad o}) ho] + change (∫ o,(∫ x,p o x+f o x) ∂P)=_ + have hie : Integrable (Function.uncurry f) (P.prod volume) := hi + have hiadd : Integrable (fun z : Ω×Position => p z.1 z.2+f z.1 z.2) (P.prod volume) := hip.add hie + rw [←integral_prod _ hiadd] + change (∫ z,(Function.uncurry p z + Function.uncurry f z) ∂P.prod volume)=_ + rw [integral_add hip hie,integral_prod _ hip,integral_prod _ hie] + congr 1 + change (∫ o,(∫ x,f o x) ∂P)=_ + simp_rw [he] + exact integral_indicator hb + +omit [IsProbabilityMeasure P] in +lemma initialPropagationError_total (_ : Measurable (Function.uncurry μ)) + (hb : MeasurableSet {o | bad o}) : + (∫ o,(∫ x,initialPropagationError (bad o) r (μ o) x) ∂P)= + ∫ o in {o | bad o},∫ x in Metric.ball (0:Position) r,μ o x ∂volume ∂P := by + rw [←integral_indicator hb] + apply integral_congr_ae (Eventually.of_forall (fun o => ?_)) + by_cases ho : bad o + · rw [Set.indicator_of_mem (s:={o | bad o}) ho,←integral_indicator measurableSet_ball] + apply integral_congr_ae (Eventually.of_forall (fun x => ?_)) + simp [initialPropagationError,ho,Set.indicator_apply,Metric.mem_ball] + · simp [initialPropagationError,ho] +end Error +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/InitialInvariant.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/InitialInvariant.lean new file mode 100644 index 0000000000000000000000000000000000000000..07c88dc7121d0909be21c122258c6a09740e2aa3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/InitialInvariant.lean @@ -0,0 +1,189 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationDatumRegularity +import OAI.Analysis.CoulombRadii.Propagation.InitializationBranch + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma propagationRHS_ball_bounds {r Z : ℝ} {u μ p : Position → ℝ} (hr : 0 ?_⟩ + rw [propagationRHS_eq] + exact (abs_add_le _ _).trans (add_le_add (hA x hx) (hK x hx)) + +structure InitialPropagationData (bad : Prop) (B C Z r a L : ℝ) (H μ : Position → ℝ) : Prop where + B_pos : 0 Z*coulombKernel x+H x) Z univ (fun x => 4*Real.pi*μ x) + +namespace InitialPropagationData +variable {bad : Prop} {B C Z r a L : ℝ} {H μ : Position → ℝ} +variable (d : InitialPropagationData bad B C Z r a L H μ) +include d + +lemma next_continuous : Continuous (initialNextOffset bad B Z r a H) := + initialNextOffset_continuous d.B_pos d.Z_nonneg d.r_pos d.a_nonneg d.BZ d.quadratic d.H_cont d.H_nonpos d.H_lower + +lemma branch_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+initialPropagationOffset bad Z r a H x) Z {x | ‖x‖<2*r} + (fun x => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) + (Z*coulombKernel x+initialPropagationOffset bad Z r a H x)) := + initialPropagationOffset_weak d.Z_nonneg d.r_pos d.a_nonneg d.quadratic d.reaction d.H_cont d.H_nonpos + d.mu_measurable d.mu_nonneg d.mu_bounds d.nuclear + +lemma barrier_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+propagationBarrierOffset B r Z x) Z {x | r<‖x‖} + (fun x => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) + (Z*coulombKernel x+propagationBarrierOffset B r Z x)) := by + apply (propagationBarrier_weak (Z:=Z) d.B_pos d.r_pos d.barrier_small).congr_on + · intro x hx; rfl + · intro x hx + have hrx : r ≤ ‖x‖ := le_of_lt hx + simp [propagationRHS,propagationCoreSource,initialPropagationError,not_lt_of_ge hrx,hrx, + propagationBarrierOffset_eq hrx] + +lemma middle_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+max (initialPropagationOffset bad Z r a H x) (propagationBarrierOffset B r Z x)) + Z {x | r<‖x‖ ∧ ‖x‖<2*r} + (fun x => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) + (Z*coulombKernel x+max (initialPropagationOffset bad Z r a H x) (propagationBarrierOffset B r Z x))) := by + have hc := initialPropagationOffset_continuous bad Z r a d.H_cont + have hb := propagationBarrierOffset_continuous B Z d.r_pos + have he := initialPropagationError_measurable bad r d.mu_measurable + have heK := initialPropagationError_ball_bounds (bad:=bad) (r:=r) d.mu_bounds + have Hmax := WeakNuclearSubsolution.max_reaction + (Z:=Z) (b:=fun _ => 0) (F:=fun x v => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) v) + (U:={x | r<‖x‖ ∧ ‖x‖<2*r}) + ((isOpen_lt continuous_const continuous_norm).inter (isOpen_lt continuous_norm continuous_const)) + hc hb + (by simpa only [zero_add] using propagationRHS_locallyIntegrable (Z:=Z) d.r_pos hc d.mu_measurable he d.mu_bounds heK) + (by simpa only [zero_add] using propagationRHS_locallyIntegrable (Z:=Z) d.r_pos hb d.mu_measurable he d.mu_bounds heK) + (by simpa only [zero_add] using propagationRHS_ball_bounds (Z:=Z) d.r_pos hc d.mu_bounds heK) + (by simpa only [zero_add] using propagationRHS_ball_bounds (Z:=Z) d.r_pos hb d.mu_bounds heK) + (by simpa only [zero_add] using d.branch_weak.mono_domain (fun x hx => hx.2)) + (by simpa only [zero_add] using d.barrier_weak.mono_domain (fun x hx => hx.1)) + simpa only [zero_add] using Hmax + +lemma next_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+initialNextOffset bad B Z r a H x) Z univ + (fun x => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) + (Z*coulombKernel x+initialNextOffset bad B Z r a H x)) := by + apply WeakNuclearSubsolution.radialMaxSplice (a:=(53/50)*r) (b:=r) (e:=(19/10)*r) (c:=2*r) + (q:=fun x v => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) (Z*coulombKernel x+v)) + · linarith only [d.r_pos] + · linarith only [d.r_pos] + · linarith only [d.r_pos] + · linarith only [d.r_pos] + · linarith only [d.r_pos] + · exact initialPropagationOffset_continuous bad Z r a d.H_cont + · exact propagationBarrierOffset_continuous B Z d.r_pos + · exact fun x hx hx' => initialPropagationOffset_low_overlap d.B_pos d.Z_nonneg d.r_pos d.a_nonneg d.BZ d.H_lower hx hx' + · exact fun x hx hx' => initialPropagationOffset_high_overlap d.B_pos d.Z_nonneg d.r_pos d.a_nonneg d.quadratic d.H_nonpos hx hx' + · exact propagationRHS_locallyIntegrable d.r_pos d.next_continuous d.mu_measurable + (initialPropagationError_measurable bad r d.mu_measurable) d.mu_bounds (initialPropagationError_ball_bounds d.mu_bounds) + · exact d.branch_weak.mono_domain (fun x hx => by + change ‖x‖<(53/50)*r at hx + change ‖x‖<2*r + linarith only [hx,d.r_pos]) + · exact d.middle_weak + · exact d.barrier_weak.mono_domain (fun x hx => by + change (19/10)*r<‖x‖ at hx + change r<‖x‖ + linarith only [hx,d.r_pos]) + +end InitialPropagationData +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +namespace InitialPropagationData +variable {bad : Prop} {B C Z r a L : ℝ} {H μ : Position → ℝ} +variable (d : InitialPropagationData bad B C Z r a L H μ) +include d + +lemma branch_cap {x : Position} (hx : r ≤ ‖x‖) (hx' : ‖x‖ ≤ 2*r) : + Z*coulombKernel x+initialPropagationOffset bad Z r a H x ≤ C/‖x‖^4 := by + have hd := d.r_pos.trans_le hx + have H := initialPropagationOffset_upper (bad:=bad) d.Z_nonneg d.r_pos d.a_nonneg d.quadratic d.H_nonpos hx hx' + have hp := pow_le_pow_left₀ (norm_nonneg x) hx' 4 + have hpre : (2*Z/r)*‖x‖^4 ≤ C := by + have hmul := mul_le_mul_of_nonneg_left hp (div_nonneg (mul_nonneg (by norm_num : (0:ℝ) ≤ 2) d.Z_nonneg) d.r_pos.le) + calc + _ ≤ (2*Z/r)*(2*r)^4 := hmul + _ = 32*Z*r^3 := by field_simp; ring + _ ≤ C := d.C_Z + exact H.trans ((le_div_iff₀ (pow_pos hd 4)).mpr hpre) + +lemma next_caps {x : Position} (hx : r ≤ ‖x‖) : + propagationBarrier B r x ≤ Z*coulombKernel x+initialNextOffset bad B Z r a H x ∧ + Z*coulombKernel x+initialNextOffset bad B Z r a H x ≤ C/‖x‖^4 := by + have hd := d.r_pos.trans_le hx + have hbar := (propagationBarrier_two_sided d.B_pos.le d.r_pos hx).2.trans + (div_le_div_of_nonneg_right d.C_B (pow_pos hd 4).le) + have he := propagationBarrierOffset_eq (B:=B) (Z:=Z) hx + unfold initialNextOffset radialMaxSplice + split_ifs with hα hβ + · have hlow := initialPropagationOffset_low_overlap d.B_pos d.Z_nonneg d.r_pos d.a_nonneg d.BZ d.H_lower hx + (show ‖x‖ ≤ (53/50)*r by linarith only [hα,d.r_pos]) + refine ⟨?_,d.branch_cap hx (by linarith only [hα,d.r_pos])⟩ + linarith only [hlow,he] + · have hlow := le_max_right (initialPropagationOffset bad Z r a H x) (propagationBarrierOffset B r Z x) + refine ⟨by linarith only [hlow,he],?_⟩ + rw [add_max] + exact max_le (d.branch_cap hx (by linarith only [hβ,d.r_pos])) (by simpa only [he] using hbar) + · simpa only [he] using And.intro le_rfl hbar + +lemma next_outer {x : Position} (hx : L*r<‖x‖) : + Z*coulombKernel x+initialNextOffset bad B Z r a H x=propagationBarrier B r x := by + have h2 : 2*r ≤ L*r := mul_le_mul_of_nonneg_right d.L_large d.r_pos.le + have h1 : r ≤ ‖x‖ := by linarith only [hx,h2,d.r_pos] + have hα : ¬‖x‖<(103/100)*r := by linarith only [hx,h2,d.r_pos] + have hβ : ¬‖x‖<(39/20)*r := by linarith only [hx,h2,d.r_pos] + simpa only [initialNextOffset,radialMaxSplice,ite_eq_right hα,ite_eq_right hβ] using + (propagationBarrierOffset_eq (B:=B) (Z:=Z) h1) + +theorem invariant : PropagationInvariant B C r Z L (initialNextOffset bad B Z r a H) μ + (initialPropagationError bad r μ) := + ⟨d.next_continuous,initialPropagationError_nonneg d.mu_nonneg, + fun _ hx => initialPropagationError_support bad r μ hx,d.next_weak, + fun _ hx => d.next_caps hx,fun _ hx => d.next_outer hx⟩ + +end InitialPropagationData +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/InitialMesh.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/InitialMesh.lean new file mode 100644 index 0000000000000000000000000000000000000000..a488e5950ca50ac76e4338019e61edbe34a051ea --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/InitialMesh.lean @@ -0,0 +1,229 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PhysicalInitialPoint + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Topology Classical +noncomputable section +namespace NeutralAtom + +lemma exists_initial_band_mesh {r : ℝ} (hr : 0 h.2) + refine ⟨t,fun y hy => ht hy,fun y hy0 hy1 => hcover y ⟨hy0,hy1⟩,?_⟩ + have hroot : 2*r+r^3/3≤7*r/3 := by + have H := mul_le_mul_of_nonneg_left (pow_le_one₀ hr.le hr1 (n:=2)) hr.le + nlinarith only [H] + have Hpow := pow_le_pow_left₀ (by positivity : 0≤2*r+r^3/3) hroot 3 + have H := hcard.trans Hpow + apply (le_div_iff₀ (pow_pos hr 6)).mpr + have H' : (t.card:ℝ)*r^9≤343*r^3 := by nlinarith only [H] + have HH : ((t.card:ℝ)*r^6)*r^3≤343*r^3 := by nlinarith only [H'] + exact (mul_le_mul_iff_left₀ (pow_pos hr 3)).mp HH + +theorem initial_posterior_mesh_event {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsProbabilityMeasure P] (raw : Ω → Configuration n) + {obs : Ω → B} (_ : Measurable obs) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ x,g x^2)=1) + {A c r s Z T : ℝ} (hA : 0≤A) (hAb : ∀ x,g x^2≤A) + (hc : 0 potentialOf (conditionalPacketDensity P raw obs g c r s a) + let Bbad : Position → Set B := fun y => {a | T≤V a y} + let E : Set B := ⋃ y∈t,Bbad y + have hbad (y : Position) : MeasurableSet (Bbad y) := measurableSet_le measurable_const + (measurable_conditionalPacketPotential_data P raw obs hg hgs hm hc hr hs y) + have hE : MeasurableSet E := t.measurableSet_biUnion (fun y _ => hbad y) + refine ⟨Eᶜ,hE.compl,?_,?_⟩ + · rw [compl_compl] + have hpre : obs ⁻¹' E=⋃ y∈t,obs ⁻¹' Bbad y := by simp only [E,preimage_iUnion] + rw [hpre] + calc + _≤∑ y∈t,P.real (obs ⁻¹' Bbad y) := measureReal_biUnion_finset_le _ _ + _≤∑ _y∈t,r^42 := Finset.sum_le_sum (fun y _ => hpoint y) + _=(t.card:ℝ)*r^42 := by simp + _≤(343/r^6)*r^42 := mul_le_mul_of_nonneg_right hcard (by positivity) + _=343*r^36 := by field_simp + · intro a ha y hy0 hy1 + obtain ⟨z,hz,hzy⟩ := hcover y hy0 hy1 + have hz' : V a z ha (Set.mem_iUnion.mpr ⟨z,Set.mem_iUnion.mpr ⟨hz,H⟩⟩) + exact lt_of_not_ge Hz + have HL := initial_potential_mesh_modulus hg hgs hm hA hAb hc hr hs hrs hZ hn + (ProbabilityTheory.condDistrib raw obs P a) hzy + change potentialOf (conditionalPacketDensity P raw obs g c r s a) y≤_ + have HH := le_abs_self (V a y-V a z) + change |V a y-V a z|≤_ at HL + linarith only [HL,HH,hz'] +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Topology Classical +noncomputable section +namespace NeutralAtom + +lemma retainedInverseOffset_seventh_tendsto (D : ℝ) : + Tendsto (fun r => retainedInverseOffset D r*r^7) (𝓝[>] 0) (𝓝 0) := by + have H := (retainedInverseOffset_scaled_tendsto D).mul + (tendsto_positive_rpow_zero (by norm_num : (0:ℝ)<1/50)) + simp only [mul_zero] at H + apply H.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hr' : 0] 0) := by + apply tendsto_nhdsWithin_iff.mpr + constructor + · change Tendsto (fun Z : ℝ => ε*Z^(-(1/3:ℝ))) atTop (𝓝 0) + simpa only [mul_zero] using + (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ)<1/3)).const_mul ε + · filter_upwards [eventually_gt_atTop (0:ℝ)] with Z hZ + exact initialAtomicRadius_pos hε hZ + +lemma initialAtomicRadius_cubic {ε Z : ℝ} (hZ : 0 r₀*2^k.val + ∃ G : Set (Fin J → UnorderedArray (N+1)),MeasurableSet G ∧ + P.real (tailObservation r 0 ⁻¹' Gᶜ)≤343*r₀^35 ∧ + ∀ a∈G,∀ y : Position,r₀≤‖y‖ → ‖y‖≤2*r₀ → + potentialOf (conditionalPacketDensity P Prod.fst (tailObservation r 0) g₀ c r₀ s a) y≤ + (1/10:ℝ)*(Z:ℝ)/r₀ := by + obtain ⟨C,hC,HC⟩ := physical_initial_potential_point + refine ⟨1/(20*C),by positivity,?_⟩ + intro ε hε hεmax D g₀ hm hrad hg c s hc hs hq + have hgs : HasCompactSupport (g₀ : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun z hz => hg z + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + obtain ⟨A,hA,hAb⟩ := compact_packet_function_bound g₀.continuous hgs + let I := ∫ z in Metric.ball (0:Position) 1,coulombKernel z^2 + have ht := initialAtomicRadius_tendsto hε + have hmod := (initialPacketModulus_tendsto (A*I) c).comp ht + have hsmall : ∀ᶠ Z : ℝ in atTop,0 r₀*2^k.val + have HA : ∀ x,(g₀ x)^2≤A := hAb + obtain ⟨G,hG,hp,HG⟩ := initial_posterior_mesh_event P Prod.fst (measurable_tailObservation r 0) + g₀.continuous hgs hm hA HA hc hr hr1 hs hrs hZr.le (by exact_mod_cast hnum) + (HC Z hZ hd hn hmin hE hbase hnum g₀ hm hrad hg hc hr hs hq hδ) + refine ⟨G,hG,?_,?_⟩ + · exact hp.trans (mul_le_mul_of_nonneg_left (pow_le_pow_of_le_one hr.le hr1 (by decide : 35≤36)) (by norm_num)) + · intro a ha y hy0 hy1 + have H := HG a ha y hy0 hy1 + have hCe : C*ε≤1/20 := by + have hh := (le_div_iff₀ (by positivity : 0<20*C)).mp hεmax + nlinarith only [hh] + have hscale : C*(Z:ℝ)^(4/3:ℝ)=(Z:ℝ)/r₀*(C*ε) := by + apply (mul_right_cancel₀ hr.ne') + rw [mul_assoc,initialAtomicRadius_potential_scale hZr] + dsimp only [r₀] + field_simp + change potentialOf (conditionalPacketDensity P Prod.fst (tailObservation r 0) g₀ c r₀ s a) y≤_ + rw [hscale] at H + have HM := mul_le_mul_of_nonneg_left (add_le_add hCe hM) (div_nonneg hZr.le hr.le) + dsimp only [I] at HM + calc + _≤(Z:ℝ)/r₀*(C*ε+initialPacketModulus (A*I) c r₀) := by linarith only [H] + _≤(Z:ℝ)/r₀*(1/20+1/20) := HM + _=(1/10:ℝ)*(Z:ℝ)/r₀ := by ring +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/InitializationBranch.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/InitializationBranch.lean new file mode 100644 index 0000000000000000000000000000000000000000..045fbfabff2bed278c53833d2b18963ed491077d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/InitializationBranch.lean @@ -0,0 +1,245 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationRegularity +import OAI.Analysis.CoulombRadii.Variational.WeakAdd + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +def initialPropagationOffset (bad : Prop) (Z r a : ℝ) (H : Position → ℝ) (x : Position) : ℝ := + (if bad then 0 else H x)-(7/10:ℝ)*Z/r+a*‖x‖^2 + +def initialPropagationError (bad : Prop) (r : ℝ) (μ : Position → ℝ) (x : Position) : ℝ := + if bad ∧ ‖x‖ ?_⟩ + unfold initialPropagationError + split_ifs + · exact (hC x hx).trans (le_max_left _ _) + · simpa only [abs_zero] using le_max_right C 0 + +lemma initial_core_source (bad : Prop) (r : ℝ) (μ : Position → ℝ) (x : Position) + (hμ : 0≤μ x) : propagationCoreSource r ‖x‖ (μ x) (initialPropagationError bad r μ x)≤ + 4*Real.pi*(if bad then 0 else μ x) := by + by_cases hb : bad <;> by_cases hd : ‖x‖ Z*coulombKernel x+H x) Z univ (fun x => 4*Real.pi*μ x)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+initialPropagationOffset bad Z r a H x) Z univ + (fun x => 4*Real.pi*(if bad then 0 else μ x)+6*a) := by + apply (weakNuclearSubsolution_offset_iff (initialPropagationOffset_continuous bad Z r a hH)).2 + have hc : Continuous (fun x => if bad then (0:ℝ) else H x) := by + by_cases hb : bad <;> simp only [hb,ite_true,ite_false] + · exact continuous_const + · exact hH + have hq : LocallyIntegrable (fun x => 4*Real.pi*(if bad then 0 else μ x)) volume := by + by_cases hb : bad + · simp only [ite_eq_left hb,mul_zero] + exact continuous_const.locallyIntegrable + · simp only [ite_eq_right hb] + exact hμ.smul (4*Real.pi) + have hb : WeakLaplacianGE (fun x => if bad then (0:ℝ) else H x) univ + (fun x => 4*Real.pi*(if bad then 0 else μ x)) := by + by_cases hb : bad + · simpa only [ite_eq_left hb,mul_zero] using WeakLaplacianGE.zero + · simpa only [ite_eq_right hb] using (weakNuclearSubsolution_offset_iff hH).1 hw + exact WeakLaplacianGE.add (hc.sub continuous_const) + (continuous_const.mul (continuous_norm.pow 2)) hq continuous_const.locallyIntegrable + (hb.sub_const hc ((7/10:ℝ)*Z/r)) (WeakLaplacianGE.quadratic a) + +lemma initialPropagationOffset_upper {bad : Prop} {Z r a : ℝ} {H : Position → ℝ} + (hZ : 0≤Z) (hr : 0 Z*coulombKernel x+H x) Z univ (fun x => 4*Real.pi*μ x)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+initialPropagationOffset bad Z r a H x) Z + {x | ‖x‖<2*r} + (fun x => propagationRHS r ‖x‖ (μ x) (initialPropagationError bad r μ x) + (Z*coulombKernel x+initialPropagationOffset bad Z r a H x)) := by + have hc := initialPropagationOffset_continuous bad Z r a hH + have hμi := locallyIntegrable_of_ball_bounds hμ hbμ + have Hbase := (initialPropagationOffset_base_weak (bad:=bad) (r:=r) (a:=a) hH hμi hw).mono_domain + (subset_univ {x : Position | ‖x‖<2*r}) + have hqi : LocallyIntegrable (fun x => 4*Real.pi*(if bad then 0 else μ x)+6*a) volume := by + by_cases hb : bad + · simpa only [ite_eq_left hb,mul_zero,zero_add] using (continuous_const.locallyIntegrable : LocallyIntegrable (fun _ : Position => 6*a) volume) + · simp only [ite_eq_right hb] + have hscaled : LocallyIntegrable (fun x => 4*Real.pi*μ x) volume := hμi.smul (4*Real.pi) + exact hscaled.add (continuous_const.locallyIntegrable : LocallyIntegrable (fun _ : Position => 6*a) volume) + apply (weakNuclearSubsolution_offset_iff hc).2 + apply ((weakNuclearSubsolution_offset_iff hc).1 Hbase).mono_source_on hqi + (propagationRHS_locallyIntegrable hr hc hμ (initialPropagationError_measurable bad r hμ) + hbμ (initialPropagationError_ball_bounds hbμ)) + exact Eventually.of_forall (fun x hx => by + have hcore := initial_core_source bad r μ x (hμnonneg x) + unfold propagationRHS + by_cases hxr : r≤‖x‖ + · rw [ite_eq_left hxr] + have hreact := (tfReaction_monotone (initialPropagationOffset_upper (bad:=bad) hZ hr ha hquad hHnonpos hxr + (le_of_lt hx))).trans hreaction + exact add_le_add hcore hreact + · rw [ite_eq_right hxr,add_zero] + linarith only [hcore,ha]) + +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma initialPropagationOffset_lower {bad : Prop} {Z r a : ℝ} {H : Position → ℝ} + (hZ : 0 ≤ Z) (hr : 0 field_simp + have hquad : 0 ≤ a*‖x‖^2 := mul_nonneg ha (sq_nonneg _) + have hZr := div_nonneg hZ hr.le + unfold initialPropagationOffset + simp only [mul_div_assoc] + linarith only [hpot,hker,hquad,hZr] + +lemma initialPropagationOffset_nonpos {bad : Prop} {Z r a : ℝ} {H : Position → ℝ} + (hZ : 0 ≤ Z) (hr : 0 field_simp + have hsq := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (norm_nonneg x) hx' 2) ha + have hZr := div_nonneg hZ hr.le + unfold initialPropagationOffset + simp only [mul_div_assoc] at hquad ⊢ + nlinarith only [hpot,hker,hsq,hquad,hZr] + +lemma initialPropagationOffset_low_overlap {bad : Prop} {B Z r a : ℝ} {H : Position → ℝ} + (hB : 0 initialPropagationOffset_low_overlap hB hZ hr ha hBZ hHlow hx hx' + · exact fun x hx hx' => initialPropagationOffset_high_overlap hB hZ hr ha hquad hHnonpos hx hx' + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/MaximumMollifier.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/MaximumMollifier.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e364fe05ecfc0b1608e9cd701b06f6cfbc23014 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/MaximumMollifier.lean @@ -0,0 +1,219 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior +import OAI.Analysis.CoulombRadii.Propagation.SmoothMaximum + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter ContinuousLinearMap +open scoped BigOperators Topology ContDiff Convolution +namespace NeutralAtom + +def maximumBump (n : ℕ) : ContDiffBump (0:Position) := + ⟨(1/((n:ℝ)+1))/2, 1/((n:ℝ)+1), by positivity, by + have H : 0<1/((n:ℝ)+1) := by positivity + linarith⟩ + +def maximumMollify (n : ℕ) (f : Position → ℝ) : Position → ℝ := + f ⋆[lsmul ℝ ℝ,volume] (maximumBump n).normed volume + +lemma maximumBump_rOut_le_one (n : ℕ) : (maximumBump n).rOut≤1 := by + dsimp [maximumBump] + exact (div_le_one (by positivity)).mpr (by have := Nat.cast_nonneg (α:=ℝ) n; linarith) + +lemma maximumBump_rOut_tendsto : Tendsto (fun n => (maximumBump n).rOut) atTop (𝓝 0) := + tendsto_one_div_add_atTop_nhds_zero_nat + +lemma maximumMollify_contDiff {f : Position → ℝ} (hf : LocallyIntegrable f volume) (n : ℕ) : + ContDiff ℝ ∞ (maximumMollify n f) := + (maximumBump n).hasCompactSupport_normed.contDiff_convolution_right (lsmul ℝ ℝ) hf + (maximumBump n).contDiff_normed + +lemma maximumMollify_tendsto {f : Position → ℝ} (hf : Continuous f) (x : Position) : + Tendsto (fun n => maximumMollify n f x) atTop (𝓝 (f x)) := by + have H := ContDiffBump.convolution_tendsto_right_of_continuous (μ:=volume) + maximumBump_rOut_tendsto hf x + simpa only [continuous_convolution_comm,maximumMollify] using H + +lemma maximumMollify_ae_tendsto {f : Position → ℝ} (hf : LocallyIntegrable f volume) : + ∀ᵐ x, Tendsto (fun n => maximumMollify n f x) atTop (𝓝 (f x)) := by + have H := ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable (μ:=volume) + maximumBump_rOut_tendsto (K:=2) (Eventually.of_forall (fun n => by dsimp [maximumBump]; linarith)) hf + simpa only [continuous_convolution_comm,maximumMollify] using H + +lemma weakLaplacianGE_maximumMollify {f q : Position → ℝ} + (hf : LocallyIntegrable f volume) (hw : WeakLaplacianGE f univ q) (n : ℕ) (x : Position) : + maximumMollify n q x≤coordinateLaplacian (maximumMollify n f) x := by + let φ := maximumBump n + have ht := normed_bump_reflect_tsupport φ x + have hc : HasCompactSupport (fun y => φ.normed volume (x-y)) := + (isCompact_closedBall x φ.rOut).of_isClosed_subset (isClosed_tsupport _) ht + have hs : ContDiff ℝ ∞ (fun y => φ.normed volume (x-y)) := + φ.contDiff_normed.comp (contDiff_const.sub contDiff_id) + have H := hw _ hs hc (subset_univ _) (fun y => φ.nonneg_normed _) + unfold maximumMollify + rw [coordinateLaplacian_convolution hf (maximumBump n).contDiff_normed (maximumBump n).hasCompactSupport_normed] + simpa only [coordinateLaplacian_reflect,convolution_def,lsmul_apply,smul_eq_mul] using H + +lemma maximumMollify_abs_le {f : Position → ℝ} (hf : LocallyIntegrable f volume) + {A : ℝ} {U : Set Position} (hA : ∀ y∈U, |f y|≤A) (n : ℕ) {x : Position} + (hx : Metric.closedBall x (maximumBump n).rOut⊆U) : |maximumMollify n f x|≤A := by + let φ := maximumBump n + have hi := (φ.hasCompactSupport_normed (μ:=volume)).convolutionExists_right (lsmul ℝ ℝ) hf φ.continuous_normed x + change Integrable (fun y => f y*φ.normed volume (x-y)) volume at hi + change |∫ y, f y*φ.normed volume (x-y)|≤A + calc + _ ≤ ∫ y, |f y*φ.normed volume (x-y)| := by + simpa only [Real.norm_eq_abs] using norm_integral_le_integral_norm (fun y => f y*φ.normed volume (x-y)) + _ ≤ ∫ y, A*φ.normed volume (x-y) := by + have hin : Integrable (fun y => |f y*φ.normed volume (x-y)|) volume := hi.norm + apply integral_mono hin ((integrable_normed_bump_reflect φ x).const_mul A) + intro y + change |f y*φ.normed volume (x-y)|≤A*φ.normed volume (x-y) + rw [abs_mul,abs_of_nonneg (φ.nonneg_normed _)] + by_cases hy : φ.normed volume (x-y)=0 + · simp [hy] + · apply mul_le_mul_of_nonneg_right _ (φ.nonneg_normed _) + exact hA y (hx (normed_bump_reflect_tsupport φ x (subset_closure hy))) + _ = A := by rw [integral_const_mul,integral_sub_left_eq_self,φ.integral_normed,mul_one] + +lemma maximumMollify_abs_le_ball {f : Position → ℝ} (hf : LocallyIntegrable f volume) + {A R : ℝ} (hA : ∀ y∈Metric.closedBall (0:Position) (R+1), |f y|≤A) + (n : ℕ) {x : Position} (hx : x∈Metric.closedBall 0 R) : |maximumMollify n f x|≤A := by + apply maximumMollify_abs_le hf hA n + intro y hy + simp only [Metric.mem_closedBall] at * + have h := dist_triangle y x 0 + exact h.trans (add_le_add (hy.trans (maximumBump_rOut_le_one n)) hx |>.trans_eq (add_comm 1 R)) + +end NeutralAtom + +end +open MeasureTheory Set Filter ContinuousLinearMap +open scoped BigOperators Topology ContDiff Convolution +namespace NeutralAtom + +lemma continuous_softWeight {e : ℝ} (he : 0 < e) : Continuous (softWeight e) := + (continuous_const.add (continuous_id.div (contDiff_softAbs he).continuous + (fun x => ne_of_gt (softAbs_pos he x)))).div_const 2 + +lemma convex_pair_abs_le {p u v A B : ℝ} (hp : 0 ≤ p) (hp1 : p ≤ 1) + (hu : |u| ≤ A) (hv : |v| ≤ B) : |p*u+(1-p)*v| ≤ A+B := by + calc + _ ≤ |p*u|+|(1-p)*v| := abs_add_le _ _ + _ ≤ |u|+|v| := by + rw [abs_mul,abs_mul,abs_of_nonneg hp,abs_of_nonneg (sub_nonneg.mpr hp1)] + apply add_le_add + · simpa using mul_le_mul_of_nonneg_right hp1 (abs_nonneg u) + · simpa using mul_le_mul_of_nonneg_right (show 1-p ≤ 1 by linarith) (abs_nonneg v) + _ ≤ A+B := add_le_add hu hv + +lemma tendsto_integral_compact_mul {F : ℕ → Position → ℝ} {f φ : Position → ℝ} + (hF : ∀ n, Continuous (F n)) (hφ : Continuous φ) (hc : HasCompactSupport φ) + {C : ℝ} (hb : ∀ n x, x ∈ tsupport φ → |F n x| ≤ C) + (ht : ∀ᵐ x, Tendsto (fun n => F n x) atTop (𝓝 (f x))) : + Tendsto (fun n => ∫ x, F n x*φ x) atTop (𝓝 (∫ x, f x*φ x)) := by + apply tendsto_integral_of_dominated_convergence (fun x => C*‖φ x‖) + (fun n => ((hF n).mul hφ).aestronglyMeasurable) + ((hφ.integrable_of_hasCompactSupport hc).norm.const_mul C) + · intro n + filter_upwards [] with x + change ‖F n x*φ x‖ ≤ C*‖φ x‖ + rw [norm_mul,Real.norm_eq_abs (F n x)] + by_cases hx : x ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hb n x hx) (norm_nonneg _) + · simp [image_eq_zero_of_notMem_tsupport hx] + · filter_upwards [ht] with x hx + exact hx.mul_const _ + +lemma weakLaplacianGE_maximumMollify_local {f q : Position → ℝ} {U : Set Position} + (hf : LocallyIntegrable f volume) (hw : WeakLaplacianGE f U q) (n : ℕ) (x : Position) + (hx : Metric.closedBall x (maximumBump n).rOut ⊆ U) : + maximumMollify n q x ≤ coordinateLaplacian (maximumMollify n f) x := by + let φ := maximumBump n + have ht := normed_bump_reflect_tsupport φ x + have hc : HasCompactSupport (fun y => φ.normed volume (x-y)) := + (isCompact_closedBall x φ.rOut).of_isClosed_subset (isClosed_tsupport _) ht + have hs : ContDiff ℝ ∞ (fun y => φ.normed volume (x-y)) := + φ.contDiff_normed.comp (contDiff_const.sub contDiff_id) + have H := hw _ hs hc (ht.trans hx) (fun y => φ.nonneg_normed _) + unfold maximumMollify + rw [coordinateLaplacian_convolution hf (maximumBump n).contDiff_normed (maximumBump n).hasCompactSupport_normed] + simpa only [coordinateLaplacian_reflect,convolution_def,lsmul_apply,smul_eq_mul] using H + +theorem WeakLaplacianGE.max_tied {f g q r : Position → ℝ} {U : Set Position} + (hU : IsOpen U) (hf : Continuous f) (hg : Continuous g) + (hq : LocallyIntegrable q volume) (hr : LocallyIntegrable r volume) + (hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, |q x| ≤ C) + (hbr : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, |r x| ≤ C) + (hwf : WeakLaplacianGE f U q) (hwg : WeakLaplacianGE g U r) + (htie : ∀ x, f x=g x → q x=r x) : + WeakLaplacianGE (fun x => max (f x) (g x)) U (fun x => if g x ≤ f x then q x else r x) := by + intro φ hφ hc ht hp + obtain ⟨R,hR⟩ := hc.isBounded.subset_closedBall (0:Position) + obtain ⟨A,hA⟩ := (isCompact_closedBall (0:Position) (R+1)).exists_bound_of_continuousOn hf.continuousOn + obtain ⟨B,hB⟩ := (isCompact_closedBall (0:Position) (R+1)).exists_bound_of_continuousOn hg.continuousOn + obtain ⟨Q,hQ⟩ := hbq (R+1) + obtain ⟨S,hS⟩ := hbr (R+1) + let e : ℕ → ℝ := fun n => (maximumBump n).rOut + have he : ∀ n, 0 < e n := fun n => (maximumBump n).rOut_pos + have hF (n : ℕ) := maximumMollify_contDiff hf.locallyIntegrable n + have hG (n : ℕ) := maximumMollify_contDiff hg.locallyIntegrable n + have hQn (n : ℕ) := maximumMollify_contDiff hq n + have hSn (n : ℕ) := maximumMollify_contDiff hr n + let p : ℕ → Position → ℝ := fun n x => softWeight (e n) (maximumMollify n f x-maximumMollify n g x) + let v : ℕ → Position → ℝ := fun n x => softMax (e n) (maximumMollify n f x) (maximumMollify n g x) + let a : ℕ → Position → ℝ := fun n x => p n x*maximumMollify n q x+(1-p n x)*maximumMollify n r x + have hpc (n : ℕ) : Continuous (p n) := (continuous_softWeight (he n)).comp ((hF n).continuous.sub (hG n).continuous) + have hvc (n : ℕ) : ContDiff ℝ ∞ (v n) := contDiff_softMax (he n) (hF n) (hG n) + have hac (n : ℕ) : Continuous (a n) := ((hpc n).mul (hQn n).continuous).add ((continuous_const.sub (hpc n)).mul (hSn n).continuous) + have hbv (n : ℕ) (x : Position) (hx : x ∈ tsupport φ) : |v n x| ≤ A+B+1 := by + have H := softMax_abs_le (he n).le + (maximumMollify_abs_le_ball hf.locallyIntegrable hA n (hR hx)) + (maximumMollify_abs_le_ball hg.locallyIntegrable hB n (hR hx)) + have hle : e n ≤ 1 := maximumBump_rOut_le_one n + linarith + have hba (n : ℕ) (x : Position) (hx : x ∈ tsupport φ) : |a n x| ≤ Q+S := by + exact convex_pair_abs_le (softWeight_bounds (he n) _).1 (softWeight_bounds (he n) _).2 + (maximumMollify_abs_le_ball hq hQ n (hR hx)) + (maximumMollify_abs_le_ball hr hS n (hR hx)) + have hva (x : Position) : Tendsto (fun n => v n x) atTop (𝓝 (max (f x) (g x))) := + softMax_tendsto maximumBump_rOut_tendsto (maximumMollify_tendsto hf x) (maximumMollify_tendsto hg x) + have haa : ∀ᵐ x, Tendsto (fun n => a n x) atTop (𝓝 (if g x ≤ f x then q x else r x)) := by + filter_upwards [maximumMollify_ae_tendsto hq,maximumMollify_ae_tendsto hr] with x hx hy + exact softWeight_response_tendsto maximumBump_rOut_tendsto he (maximumMollify_tendsto hf x) + (maximumMollify_tendsto hg x) hx hy (htie x) + have hla := tendsto_integral_compact_mul hac hφ.continuous hc hba haa + have hlv := tendsto_integral_compact_mul (fun n => (hvc n).continuous) + (contDiff_coordinateLaplacian hφ).continuous (hasCompactSupport_coordinateLaplacian hc) + (fun n x hx => hbv n x (tsupport_coordinateLaplacian_subset φ hx)) (Eventually.of_forall hva) + apply le_of_tendsto_of_tendsto hla hlv + obtain ⟨δ,hδ,hδU⟩ := hc.exists_cthickening_subset_open hU ht + have hn : ∀ᶠ n in atTop, e n < δ := maximumBump_rOut_tendsto.eventually (gt_mem_nhds hδ) + filter_upwards [hn] with n hn + have hlocal (x : Position) (hx : x ∈ tsupport φ) : Metric.closedBall x (maximumBump n).rOut ⊆ U := + (Metric.closedBall_subset_closedBall hn.le).trans ((Metric.closedBall_subset_cthickening hx δ).trans hδU) + have hpoint (x : Position) (hx : x ∈ tsupport φ) : a n x ≤ coordinateLaplacian (v n) x := by + apply le_trans _ (coordinateLaplacian_softMax_lower (he n) (hF n) (hG n) x) + apply add_le_add + · exact mul_le_mul_of_nonneg_left (weakLaplacianGE_maximumMollify_local hf.locallyIntegrable hwf n x (hlocal x hx)) + (softWeight_bounds (he n) _).1 + · exact mul_le_mul_of_nonneg_left (weakLaplacianGE_maximumMollify_local hg.locallyIntegrable hwg n x (hlocal x hx)) + (sub_nonneg.mpr (softWeight_bounds (he n) _).2) + rw [integral_mul_coordinateLaplacian_eq (fun x _ => (hvc n).contDiffAt.of_le (by exact WithTop.coe_le_coe.mpr le_top)) hφ hc] + apply integral_mono + (integrable_mul_compact_of_continuousAt (fun x _ => (hac n).continuousAt) hφ.continuous hc) + (integrable_mul_compact_of_continuousAt (fun x _ => (contDiff_coordinateLaplacian (hvc n)).continuous.continuousAt) hφ.continuous hc) + intro x + change a n x*φ x ≤ coordinateLaplacian (v n) x*φ x + by_cases hx : x ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hpoint x hx) (hp x) + · simp [image_eq_zero_of_notMem_tsupport hx] + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/NearActiveMaximum.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/NearActiveMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..401d76a35c0b4358208fa4fb55e8c82fa4f3ec3c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/NearActiveMaximum.lean @@ -0,0 +1,233 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TFResponseMargins +import OAI.Analysis.CoulombRadii.Propagation.WeakLocality +import OAI.Analysis.CoulombRadii.RadialBounds.NearActive + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +lemma WeakLaplacianGE.congr_on {f g q r : Position → ℝ} {U : Set Position} + (hw : WeakLaplacianGE f U q) (he : ∀ x∈U, f x=g x) (hq : ∀ x∈U, q x=r x) : + WeakLaplacianGE g U r := by + intro φ hφ hc ht hp + have H := hw φ hφ hc ht hp + have hleft : (fun x => q x*φ x)=(fun x => r x*φ x) := by + funext x + by_cases hx : x∈tsupport φ + · rw [hq x (ht hx)] + · simp [image_eq_zero_of_notMem_tsupport hx] + have hright : (fun x => f x*coordinateLaplacian φ x)=(fun x => g x*coordinateLaplacian φ x) := by + funext x + by_cases hx : x∈tsupport φ + · rw [he x (ht hx)] + · simp [coordinateLaplacian_eq_zero_of_notMem_tsupport hx] + simpa only [hleft,hright] using H + +lemma WeakLaplacianGE.mono_domain {f q : Position → ℝ} {U V : Set Position} + (hw : WeakLaplacianGE f U q) (hVU : V⊆U) : WeakLaplacianGE f V q := + fun φ hφ hc ht hp => hw φ hφ hc (ht.trans hVU) hp + +theorem WeakNuclearSubsolution.near_active_cutoffTF {ι : Type*} + (s : Finset ι) (hs : s.Nonempty) (f q : ι → Position → ℝ) + {b : Position → ℝ} {a Z η : ℝ} {U : Set Position} + (ha : 0 Z*coulombKernel x+f i x) Z U (q i)) + (hcompare : ∀ i∈s, ∀ x∈U, s.sup' hs (fun j => f j x)-f i x<2*η → + b x+cutoffReaction a (fun y => Z*coulombKernel y+f i y) x≤q i x) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+s.sup' hs (fun i => f i x)) Z U + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+s.sup' hs (fun i => f i y)) x) := by + classical + let M : Position → ℝ := fun x => s.sup' hs (fun i => f i x) + have hM : Continuous M := Continuous.finset_sup'_apply hs hf + have hbi : LocallyIntegrable b volume := locallyIntegrable_of_ball_bounds hb hbb + apply (weakNuclearSubsolution_offset_iff hM).2 + apply WeakLaplacianGE.of_local hM.locallyIntegrable + (hbi.add (cutoffReaction_offset_locallyIntegrable ha hM)) + intro x₀ hx₀ + obtain ⟨t,ht,hts,_,V,hxV,hV,hVU,hmax,hnear⟩ := + finite_max_near_active s hs f hf hU hx₀ hη + have hft (i) (hi : i∈t) : Continuous (f i) := hf i (hts hi) + have hwt (i) (hi : i∈t) : WeakNuclearSubsolution (fun x => Z*coulombKernel x+f i x) Z V + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+f i y) x) := by + apply (weakNuclearSubsolution_offset_iff (hft i hi)).2 + apply (((weakNuclearSubsolution_offset_iff (hft i hi)).1 (hw i (hts hi))).mono_domain hVU).mono_source_on + (hq i (hts hi)) (hbi.add (cutoffReaction_offset_locallyIntegrable ha (hft i hi))) + exact Eventually.of_forall (fun x hx => hcompare i (hts hi) x (hVU hx) (hnear i hi x hx)) + have H := WeakNuclearSubsolution.finset_max_cutoffTF t ht f ha hV hft hb hbb hwt + have H' := (weakNuclearSubsolution_offset_iff (Continuous.finset_sup'_apply ht hft)).1 H + refine ⟨V,hxV,hV,H'.congr_on (fun x hx => (hmax x hx).symm) ?_⟩ + intro x hx + dsimp only [M] + unfold cutoffReaction + by_cases haX : a ≤ ‖x‖ + · simp [Pi.add_apply, Set.indicator, haX, hmax x hx] + · simp [Pi.add_apply, Set.indicator, haX] + +def propagationBarrier (B r : ℝ) (x : Position) : ℝ := + B*(radialPower (-2) x-r/8*radialPower (-(5/2:ℝ)) x) + +lemma radialPower_half_nat (n : ℕ) (x : Position) : + radialPower (-((n:ℝ)/2)) x=(‖x‖^n)⁻¹ := by + unfold radialPower + rw [←Real.rpow_natCast ‖x‖ 2,←Real.rpow_mul (norm_nonneg x)] + norm_num only [Nat.cast_ofNat] + rw [show (2:ℝ)*-((n:ℝ)/2)=-(n:ℝ) by ring] + rw [Real.rpow_neg (norm_nonneg x),Real.rpow_natCast] + +lemma propagationBarrier_eq (B r : ℝ) (x : Position) : + propagationBarrier B r x=B/‖x‖^4*(1-r/(8*‖x‖)) := by + unfold propagationBarrier + rw [show (-2:ℝ)=-(((4:ℕ):ℝ)/2) by norm_num, + show (-(5/2:ℝ))=-(((5:ℕ):ℝ)/2) by norm_num] + rw [radialPower_half_nat,radialPower_half_nat] + by_cases hn : ‖x‖=0 + · simp [hn] + · field_simp + +lemma contDiffOn_propagationBarrier (B r : ℝ) (n : WithTop ℕ∞) : + ContDiffOn ℝ n (propagationBarrier B r) punctured := + contDiffOn_const.mul ((contDiffOn_radialPower (-2) n).sub + (contDiffOn_const.mul (contDiffOn_radialPower (-(5/2:ℝ)) n))) + +lemma laplacian_propagationBarrier {x : Position} (hx : x≠0) (B r : ℝ) : + coordinateLaplacian (propagationBarrier B r) x= + B/‖x‖^6*(12-5*r/(2*‖x‖)) := by + have hcp (p : ℝ) : ContDiffAt ℝ 2 (radialPower p) x := + (contDiffOn_radialPower p 2).contDiffAt (isOpen_punctured.mem_nhds hx) + unfold propagationBarrier + rw [coordinateLaplacian_const_mul] + have he : (fun y => radialPower (-2) y-r/8*radialPower (-(5/2:ℝ)) y)= + (fun y => radialPower (-2) y+(-r/8)*radialPower (-(5/2:ℝ)) y) := by + funext y + ring + rw [he,coordinateLaplacian_add_at (hcp (-2)) (contDiffAt_const.mul (hcp (-(5/2:ℝ)))), + coordinateLaplacian_const_mul] + simp only [coordinateLaplacian_radialPower hx] + have h7 : (‖x‖^2)^(-(7/2:ℝ))=(‖x‖^7)⁻¹ := by + exact radialPower_half_nat 7 x + norm_num [show (-(5/2:ℝ))-1=-(7/2:ℝ) by ring,Real.rpow_neg_natCast,h7] + have hn := norm_ne_zero_iff.mpr hx + field_simp + ring + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +lemma tfScalarDensity_eq_kTF (v : ℝ) : + Coulomb.tfScalarDensity v=kTF*(max v 0)^(3/2:ℝ) := by + have hπ : 0<3*Real.pi^2 := by positivity + have hcf : Coulomb.thomasFermiKineticConstant*(5/3:ℝ)=(3*Real.pi^2)^(2/3:ℝ)/2 := by + unfold Coulomb.thomasFermiKineticConstant + ring + unfold Coulomb.tfScalarDensity + rw [hcf,Real.div_rpow (le_max_right _ _) (by positivity), + Real.div_rpow (Real.rpow_nonneg hπ.le _) (by norm_num),←Real.rpow_mul hπ.le] + norm_num + unfold kTF + field_simp + +lemma tfReaction_eq_scalar (v : ℝ) : tfReaction v=4*Real.pi*Coulomb.tfScalarDensity v := by + rw [tfScalarDensity_eq_kTF] + unfold tfReaction + ring + +lemma tfReaction_normalized {d : ℝ} (hd : 0 attraction S (position x i)) + +lemma coulombKernel_sub_comm (x y : Space) : coulombKernel (x-y) = coulombKernel (y-x) := by + simp only [coulombKernel, norm_sub_rev] + +lemma twice_pairPotential {n : ℕ} (x : Configuration n) : + 2*pairPotential x = ∑ i : Fin n, ∑ j : Fin n, coulombKernel (position x i-position x j) := by + have H (i j : Fin n) : coulombKernel (position x i-position x j) = + (if i < j then coulombKernel (position x i-position x j) else 0)+ + (if j < i then coulombKernel (position x j-position x i) else 0) := by + rcases lt_trichotomy i j with h|h|h + · simp [h, not_lt_of_ge h.le] + · subst j; simp [coulombKernel] + · simp [h, not_lt_of_ge h.le, coulombKernel_sub_comm] + have hs : pairPotential x = ∑ i : Fin n, ∑ j : Fin n, + if j < i then coulombKernel (position x j-position x i) else 0 := by + unfold pairPotential + rw [Finset.sum_comm] + calc + 2*pairPotential x = pairPotential x+pairPotential x := by ring + _ = ∑ i : Fin n, ∑ j : Fin n, + ((if i < j then coulombKernel (position x i-position x j) else 0)+ + (if j < i then coulombKernel (position x j-position x i) else 0)) := by + simp only [Finset.sum_add_distrib] + change pairPotential x+pairPotential x = pairPotential x+_ + rw [hs] + _ = _ := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + exact (H i j).symm + +lemma pairPotential_permute {n : ℕ} (p : Equiv.Perm (Fin n)) (x : Configuration n) : + pairPotential (permute p x) = pairPotential x := by + apply (mul_left_cancel₀ (by norm_num : (2 : ℝ) ≠ 0)) + rw [twice_pairPotential, twice_pairPotential] + simp_rw [position_permute] + rw [Equiv.sum_comp p (fun i => ∑ j, coulombKernel (position x i-position x (p j)))] + apply Finset.sum_congr rfl + intro i _ + exact Equiv.sum_comp p (fun j => coulombKernel (position x i-position x j)) + +lemma nuclearEnergy_wedge_tensor {M m k : ℕ} (S : Nuclei M) + (u : H1Vector m) (v : H1Vector k) (hu : Antisymmetric u) (hv : Antisymmetric v) + (A B : Set Space) (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) + (hAB : Disjoint A B) : nuclearEnergy S (u.wedge v) = nuclearEnergy S (u.tensor v) := + potentialEnergy_wedge u v hu hv A B hsu hsv hAB (nuclearPotential S) + (nuclearPotential_permute S) ((u.tensor v).nuclear_integrable S) + +lemma pairEnergy_wedge_tensor {m k : ℕ} + (u : H1Vector m) (v : H1Vector k) (hu : Antisymmetric u) (hv : Antisymmetric v) + (A B : Set Space) (hsu : SpatiallySupported u A) (hsv : SpatiallySupported v B) + (hAB : Disjoint A B) : pairEnergy (u.wedge v) = pairEnergy (u.tensor v) := + potentialEnergy_wedge u v hu hv A B hsu hsv hAB pairPotential + pairPotential_permute (u.tensor v).pair_integrable + +lemma nuclearPotential_join {M m k : ℕ} (S : Nuclei M) + (x : Configuration m) (y : Configuration k) : + nuclearPotential S (joinConfiguration m k (x,y)) = nuclearPotential S x+nuclearPotential S y := by + simp [nuclearPotential, Fin.sum_univ_add, position_join_left, position_join_right] + +def crossPotential {m k : ℕ} (x : Configuration m) (y : Configuration k) : ℝ := + ∑ i : Fin m, ∑ j : Fin k, coulombKernel (position x i-position y j) + +lemma pairPotential_join {m k : ℕ} (x : Configuration m) (y : Configuration k) : + pairPotential (joinConfiguration m k (x,y)) = pairPotential x+pairPotential y+crossPotential x y := by + have hll (i j : Fin m) : Fin.castAdd k i < Fin.castAdd k j ↔ i < j := Iff.rfl + have hlr (i : Fin m) (j : Fin k) : Fin.castAdd k i < Fin.natAdd m j := by + change i.val < m+j.val + omega + have hrl (i : Fin k) (j : Fin m) : ¬Fin.natAdd m i < Fin.castAdd k j := by + change ¬m+i.val < j.val + omega + simp only [pairPotential, Fin.sum_univ_add,position_join_left,position_join_right, + hll,Fin.natAdd_lt_natAdd_iff,hlr,hrl, + ite_true,ite_false,Finset.sum_const_zero,add_zero,Finset.sum_add_distrib] + unfold crossPotential + ring +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/NuclearPotentialSplitJoin.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/NuclearPotentialSplitJoin.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a3f7bacbc0edeb1cd348933a0d49a42a59d4d5e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/NuclearPotentialSplitJoin.lean @@ -0,0 +1,190 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.NuclearPotential +import OAI.Analysis.CoulombRadii.FieldAnalysis.CorePerm + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +namespace Coulomb + +lemma nuclearPotential_split_join {M m k : ℕ} (S : Nuclei M) (x : Configuration m) + (y : Configuration k) : + nuclearPotential S (joinConfiguration m k (x,y)) = nuclearPotential S x + nuclearPotential S y := by + simp only [nuclearPotential, Fin.sum_univ_add, position_join_left, position_join_right] + +lemma pairPotential_split_join {m k : ℕ} (x : Configuration m) (y : Configuration k) : + pairPotential (joinConfiguration m k (x,y)) = pairPotential x + pairPotential y + + ∑ i : Fin m, ∑ j : Fin k, coulombKernel (position x i - position y j) := by + simp only [pairPotential, Fin.sum_univ_add, position_join_left, position_join_right] + have hleft (i j : Fin m) : Fin.castAdd k i < Fin.castAdd k j ↔ i < j := by rfl + have hright (i j : Fin k) : Fin.natAdd m i < Fin.natAdd m j ↔ i < j := by + simp only [Fin.lt_def, Fin.val_natAdd, Nat.add_lt_add_iff_left] + have hlr (i : Fin m) (j : Fin k) : Fin.castAdd k i < Fin.natAdd m j := by + simp only [Fin.lt_def, Fin.val_castAdd, Fin.val_natAdd]; omega + have hrl (i : Fin k) (j : Fin m) : ¬Fin.natAdd m i < Fin.castAdd k j := by + simp only [Fin.lt_def, Fin.val_castAdd, Fin.val_natAdd]; omega + simp only [hleft, hright, hlr, hrl, ite_true, ite_false, Finset.sum_const_zero, zero_add, + Finset.sum_add_distrib] + ring + +lemma H1Vector.core_nuclear_integrable {M m k : ℕ} (ψ : H1Vector (m+k)) + (S : Nuclei M) (st : Spins (m+k)) : + Integrable (fun z => nuclearPotential S ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2) := by + simp only [nuclearPotential, attraction, position_split_right, Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + have H := (ψ.nuclear_coulomb_integrable_bound st (Fin.natAdd m i) (S.position j) + (by norm_num : (0:ℝ)<1)).1 + simpa only [mul_assoc] using H.const_mul (S.charge j) + +lemma H1Vector.core_pair_integrable {m k : ℕ} (ψ : H1Vector (m+k)) (st : Spins (m+k)) : + Integrable (fun z => pairPotential ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2) := by + simp only [pairPotential, position_split_right, Finset.sum_mul] + apply integrable_finsetSum + intro i _ + apply integrable_finsetSum + intro j _ + by_cases hij : i < j + · simp only [ite_eq_left hij] + exact (ψ.pair_coulomb_integrable_bound st (Fin.natAdd m i) (Fin.natAdd m j) + (fun he => hij.ne (by apply Fin.ext; have hh := congrArg Fin.val he; simpa only [Fin.val_natAdd, Nat.add_left_cancel_iff] using hh)) (by norm_num : (0:ℝ)<1)).1 + · simp only [ite_eq_right hij, zero_mul] + exact integrable_zero _ _ _ + +lemma conditional_core_nuclear_identity {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) : + (∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x) * nuclearEnergy S (ψ.coreSlice s x).normalized) = + ∑ st : Spins (m+k), ∫ z, nuclearPotential S ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2 := by + change (∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x) * + potentialForm (nuclearPotential S) (ψ.coreSlice s x).normalized) = _ + simp_rw [potentialForm_normalized_weight] + exact integral_potentialForm_coreSlice ψ (nuclearPotential S) (ψ.core_nuclear_integrable S) + +lemma conditional_core_pair_identity {m k : ℕ} (ψ : H1Vector (m+k)) : + (∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x) * pairEnergy (ψ.coreSlice s x).normalized) = + ∑ st : Spins (m+k), ∫ z, pairPotential ((joinConfiguration m k).symm z).2 * ‖ψ.value st z‖^2 := by + change (∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x) * + potentialForm pairPotential (ψ.coreSlice s x).normalized) = _ + simp_rw [potentialForm_normalized_weight] + exact integral_potentialForm_coreSlice ψ pairPotential ψ.core_pair_integrable + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/ObservationGoodGap.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/ObservationGoodGap.lean new file mode 100644 index 0000000000000000000000000000000000000000..cf1f4704264576eec9d3e2891f7c49a62222cdbc --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/ObservationGoodGap.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationNegativeMean + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace Coulomb + +lemma tf_reaction_response_good_gap {v θ A M e e₀ δ Qlo Qhi L U : ℝ} + (hθ : 0≤θ) (hθ1 : θ≤1) (hM : 0≤M) (hMass : |M-1|≤δ) + (hL : 0≤L) (hU : 0≤U) (he : e≤e₀) + (hlo : Qlo≤tfScalarDensity (v+θ*(A+max (-v) 0))*M+e) + (hhi : tfScalarDensity (v-θ*(A+max (-v) 0))*M-e≤Qhi) + : (tfScalarDensity (L+θ*A)*(1+δ)+e₀ arrayEventLikelihood ℓ B x*f (flattenConfiguration n x))) → + ∀ (S : Coulomb.Nuclei J) (T : Coulomb.RecordedEnsemble n), T.Conserves u → + ∀ {a b t M Qlo Qhi q L U : ℝ} (ha : 0 packetKernel_nonneg g hc hr hs z y)) hmass' hL hU + (add_le_add he le_rfl) hu hl +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PhysicalFinitePropagation.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PhysicalFinitePropagation.lean new file mode 100644 index 0000000000000000000000000000000000000000..49e343ec788e7a195dca4adeef03f885e08ae6c5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PhysicalFinitePropagation.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationExpectedDeficit +import OAI.Analysis.CoulombRadii.Packets.PhysicalInteriorTransfer + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_finite_propagation {N J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) + {ψ : Wavefunction (N+1)} {g : Gradient (N+1)} (hd : FormDomain ψ g) (hn : normSquared ψ=1) + {g₀ : 𝓢(Position,ℝ)} (hgs : ∀ x,1<‖x‖ → g₀ x=0) (hm : (∫ x,g₀ x^2)=1) + {c ε B C r₀ s M : ℝ} (hc : 0 r₀*2^j.val + let μ := fun j o => conditionalPacketDensity P Prod.fst (tailObservation rs j) g₀ c r₀ s (tailObservation rs j o) + ∀ {G₀ : Set (Fin J → UnorderedArray (N+1))},MeasurableSet G₀ → + P.real (tailObservation rs 0 ⁻¹' G₀ᶜ) ≤ 343*r₀^35 → + (∀ a∈G₀,∀ x,r₀ ≤ ‖x‖ → ‖x‖ ≤ 2*r₀ → + potentialOf (conditionalPacketDensity P Prod.fst (tailObservation rs 0) g₀ c r₀ s a) x ≤ (1/10:ℝ)*(Z:ℝ)/r₀) → + ∀ (G : Fin J → Set (ObservationSample (N+1) J)), + (∀ j,MeasurableSet (G j)) → + (∀ j,∀ o∈G j,∀ x,rs j ≤ ‖x‖ → ‖x‖ ≤ 4*k.L*(rs j) → + let F := (Z:ℝ)*coulombKernel x-potentialOf (μ j.val o) x + F ≤ C/‖x‖^4 ∧ ∀ h∈Icc (B/2) C, + (Coulomb.tfScalarDensity h ≤ ‖x‖^6*μ j.val o x → h-k.ξ ≤ ‖x‖^4*F) ∧ + (‖x‖^6*μ j.val o x ≤ Coulomb.tfScalarDensity h → ‖x‖^4*F ≤ h+k.ξ)) → + (∀ j,(∫ o in (G j)ᶜ,∫ x in {x : Position | rs j ≤ ‖x‖ ∧ ‖x‖<2*(rs j)},μ j.val o x ∂volume ∂P) ≤ M*(rs j)^9) → + (∫ x,rawCount (Metric.ball (0:Position) ((r₀*2^J)/2)) x ∂rawLaw ψ) ≤ + (Z:ℝ)-(tfReaction (7*B/128)*(28*Real.pi/3))/(4*Real.pi*(r₀*2^J)^3)+ + (1029*ε^3+M)*(r₀*2^J)^9 := by + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let rs := fun j : Fin J => r₀*2^j.val + let μ := fun j o => conditionalPacketDensity P Prod.fst (tailObservation rs j) g₀ c r₀ s (tailObservation rs j o) + let H := fun j o x => -potentialOf (μ j o) x + intro G₀ hG₀ hp₀ hlow G hG hgood hcost + have hcompact : HasCompactSupport (g₀ : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun x hx => hgs x + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hx)) + have hZr : 0<(Z:ℝ) := by exact_mod_cast (zero_lt_one.trans_le hZ) + have q (j : ℕ) : NuclearRandomDatum (Z:ℝ) (μ j) (H j) := + posterior_nuclear_datum P Prod.fst (tailObservation rs j) (measurable_tailObservation rs j) + g₀.continuous hcompact hm hc hr hs Z + let bad₀ := fun o => tailObservation rs 0 o∉G₀ + have hb₀ : MeasurableSet {o | bad₀ o} := hG₀.compl.preimage (measurable_tailObservation rs 0) + have gates := initial_scaled_gates (B:=B) hZr hr hcubic hR + have init := (q 0).initial_hypotheses (bad:=bad₀) hB hZr.le hr + (by positivity : 0 ≤ (Z:ℝ)/(80*r₀^3)) k.L_large.le + (by rw [mul_assoc,hcubic]; linarith only [hBe]) hBC + (by rw [mul_assoc,hcubic]; exact heC) gates.1 gates.2 hbar (by + intro o ho x hx hx' + have hh := hlow (tailObservation rs 0 o) (by simpa only [bad₀,not_not] using ho) x hx hx' + change potentialOf (μ 0 o) x ≤ _ at hh + change -(1/10:ℝ)*(Z:ℝ)/r₀ ≤ -potentialOf (μ 0 o) x + simpa only [neg_mul,neg_div] using neg_le_neg hh) + let d₀ := initialPropagationDatum (P:=P) hr hb₀ (q 0).H_measurable (q 0).mu_measurable + (q 0).H_bounds (q 0).mu_bounds (Eventually.of_forall init) + have hnε : (N+1:ℝ)*r₀^3 ≤ 3*ε^3 := by + rw [←hcubic,←mul_assoc] + exact mul_le_mul_of_nonneg_right hnum (pow_nonneg hr.le 3) + have he₀ : (∫ o,(∫ x,d₀.error o x) ∂P) ≤ 1029*ε^3*r₀^9 := + (q 0).initial_error_bound hb₀ (fun o => (conditionalPacketDensity_mass P Prod.fst + (tailObservation rs 0) g₀.continuous hm hc hr hs _).le) hr hr1 hε.le (by simpa using hnε) hp₀ + let bad := fun j o => ∃ hj : j tailObservation rs j) bad d₀ (by positivity : 0 ≤ 1029*ε^3) hM he₀ + (fun j _ => measurable_tailObservation rs (j+1)) (fun j hj => by + have he : {o | bad j o}=(G ⟨j,hj⟩)ᶜ := by ext o; simp [bad,hj] + rw [he]; exact (hG _).compl) + (fun j _ => q j) (by + intro j hj o ho x hx hx' + have hh := (hgood ⟨j,hj⟩ o (by simpa [bad,hj] using ho) x hx hx').1 + simpa only [H,sub_eq_add_neg] using hh) (by + intro j hj o ho x hx hx' h hh + have hgood' := (hgood ⟨j,hj⟩ o (by simpa [bad,hj] using ho) x hx hx').2 h hh + simpa only [H,sub_eq_add_neg] using hgood') + (fun j _ => posteriorPacketDensity_tower (rawLaw ψ) g₀.continuous hcompact hc hr hs rs (Nat.le_succ j)) (by + intro j hj + have he : {o | bad j o}=(G ⟨j,hj⟩)ᶜ := by ext o; simp [bad,hj] + rw [he]; exact hcost ⟨j,hj⟩) + have hrJ : 0 r₀*2^k.val + P.real {a | C*(Z:ℝ)^(4/3:ℝ)≤potentialOf + (conditionalPacketDensity P Prod.fst (tailObservation r 0) g₀ c r₀ s (tailObservation r 0 a)) y}≤r₀^42 := by + obtain ⟨C,hC,HC⟩ := atomic_global_master_potential + refine ⟨2*C,by positivity,?_⟩ + intro N J Z hZ ψ g hd hn hmin E D hE hbase hnum g₀ hm hrad hg c r₀ s hc hr₀ hs hq hoff y + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let r : Fin J → ℝ := fun k => r₀*2^k.val + let V := fun datum : Fin J → UnorderedArray (N+1) => + potentialOf (conditionalPacketDensity P Prod.fst (tailObservation r 0) g₀ c r₀ s datum) y + let B : Set (Fin J → UnorderedArray (N+1)) := {datum | 2*C*(Z:ℝ)^(4/3:ℝ)≤V datum} + have hgs : HasCompactSupport (g₀ : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun z hz => hg z + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hV : Measurable V := measurable_conditionalPacketPotential_data P Prod.fst + (tailObservation r 0) g₀.continuous hgs hm hc hr₀ hs y + have hB : MeasurableSet B := measurableSet_le measurable_const hV + change P.real (tailObservation r 0 ⁻¹' B)≤r₀^42 + by_contra H + have hp : r₀^42 (r₀*2^k.val.val)^(101/100:ℝ)) + (fun k => Real.rpow_pos_of_pos (by positivity) _) + (hB.preimage (measurable_retainedTailObservation 0)) + (fun p z => by simp only [mem_preimage,retainedTailObservation_permute]) + (hpEq ▸ hp0) + have hoff' := retained_event_offset_le (D:=D) hr₀ J 0 + (by simpa only [pow_zero,mul_one] using hp.le) hp1 + have hEn : E≤0 := EReal.coe_le_coe_iff.mp (hE.trans (Coulomb.atom_unrestricted_bottom_nonpos Z hZ)) + have hue' : Coulomb.form (Coulomb.atom Z hZ) u≤(Z:ℝ)^(7/3:ℝ) := by + rw [←hpEq] at hue + simp only [pow_zero,mul_one] at hoff' + linarith only [hue,hoff',hoff,hEn] + have Hupper := HC Z hZ u hu hum hnum hue' g₀ hm hrad hg hc hr₀ hs hq y + have Hmean := retainedEvent_potential_mean hd.2.2.1 hn r hr 0 hB u hum hlaw + g₀.continuous hgs hm hc hr₀ hs y + have Hlower := le_normalized_event (hB.preimage (measurable_tailObservation r 0)) + (conditionalPacketPotential_integrable P (rawLaw ψ) (observationLaw_rawProjection _) + (measurable_tailObservation r 0) g₀.continuous hgs hm hc hr₀ hs y) hp0 + (Eventually.of_forall (fun a (ha : a∈tailObservation r 0 ⁻¹' B) => ha)) + rw [←Hmean] at Hlower + have hz : 0<(Z:ℝ) := by exact_mod_cast (lt_of_lt_of_le (by decide : 0<1) hZ) + have hcpos : 0 by simpa only [min_eq_left hrs] using rawPacketDensity_bound hA hAb hc hr hs x y) + simpa only [mixturePacketDensity,integral_const,probReal_univ,one_smul] using H + +lemma initial_width_modulus_identity {c r : ℝ} (_ : 0] 0) (𝓝 0) := by + have H := (((tendsto_positive_rpow_zero (by norm_num [packetExponent] : + (0:ℝ)<1-3*packetExponent)).const_mul (A*(c^3)⁻¹)).add + ((tendsto_id.mono_left nhdsWithin_le_nhds : Tendsto (fun r : ℝ => r) (𝓝[>] 0) (𝓝 0)).pow 4)).const_mul 3 + convert H using 1 <;> simp only [mul_zero,zero_pow (by decide : 4≠0),add_zero,id_eq] + funext r + rfl + +theorem initial_potential_mesh_modulus {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ x,g x^2)=1) + {A c r s Z : ℝ} (hA : 0≤A) (hAb : ∀ x,g x^2≤A) + (hc : 0 sq_nonneg _) + have H := potentialOf_lipschitz_bound (mixturePacketDensity_integrable hg hm hc hr hs ν) + (mixturePacketDensity_nonneg ν g hc hr hs) + (mixturePacketDensity_explicit_bound hg hgs hA hAb hc hr hs hrs ν) x y + rw [mixturePacketDensity_mass hg hm hc hr hs ν,Real.norm_eq_abs] at H + have hn0 : 0≤(n:ℝ) := Nat.cast_nonneg n + calc + _≤((n:ℝ)*((c*r*r^packetExponent)^(-3:ℤ)*A)*I+(n:ℝ))*‖x-y‖ := H + _≤((n:ℝ)*((c*r*r^packetExponent)^(-3:ℤ)*A)*I+(n:ℝ))*r^3 := by gcongr + _=(n:ℝ)*((c*r*r^packetExponent)^(-3:ℤ)*(A*I)+1)*r^3 := by ring + _≤(3*Z)*((c*r*r^packetExponent)^(-3:ℤ)*(A*I)+1)*r^3 := by gcongr + _=(Z/r)*initialPacketModulus (A*I) c r := by + have He := initial_width_modulus_identity hc hr + apply (mul_right_cancel₀ hr.ne') + dsimp only [initialPacketModulus] + calc + _=3*Z*((A*I)*((c*r*r^packetExponent)^(-3:ℤ)*r^4)+r^4) := by ring + _=3*Z*((A*I)*((c^3)⁻¹*r^(1-3*packetExponent))+r^4) := by rw [He] + _=_ := by field_simp +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PosteriorPropagationData.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PosteriorPropagationData.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ac30968fcc234ff80a49d9d4b11eb1a8e0c1046 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PosteriorPropagationData.lean @@ -0,0 +1,157 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationConstants +import OAI.Analysis.CoulombRadii.Propagation.PropagationPosteriorMass +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorRegularBounds + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +structure NuclearRandomDatum {Ω : Type*} [MeasurableSpace Ω] (Z : ℝ) + (μ H : Ω → Position → ℝ) : Prop where + mu_measurable : Measurable (Function.uncurry μ) + H_measurable : Measurable (Function.uncurry H) + mu_bounds : ∀ D : ℝ,∃ M : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤M + H_bounds : ∀ D : ℝ,∃ M : ℝ,∀ o x,x∈Metric.closedBall 0 D → |H o x|≤M + continuous_H : ∀ o,Continuous (H o) + nonpositive_H : ∀ o x,H o x≤0 + nonnegative_mu : ∀ o x,0≤μ o x + integrable_mu : ∀ o,Integrable (μ o) + nuclear : ∀ o,WeakNuclearSubsolution (fun x => Z*coulombKernel x+H o x) Z univ + (fun x => 4*Real.pi*μ o x) + +lemma posterior_nuclear_datum {Ω A : Type*} [MeasurableSpace Ω] [MeasurableSpace A] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → A) (ho : Measurable obs) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r s : ℝ} (hc : 0 conditionalPacketDensity P raw obs g c r s (obs o) + NuclearRandomDatum Z μ (fun o x => -potentialOf (μ o) x) := by + let μ := fun o => conditionalPacketDensity P raw obs g c r s (obs o) + refine ⟨(measurable_conditionalPacketDensity_joint P raw obs hg hgs hc hr hs).comp (ho.prodMap measurable_id), + ((measurable_conditionalPacketPotential_joint P raw obs hg hgs hm hc hr hs).comp (ho.prodMap measurable_id)).neg, + ?_,?_,fun o => (conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr hs (obs o)).neg, + fun o x => neg_nonpos.mpr (potentialOf_nonneg (conditionalPacketDensity_nonneg P raw obs g hc hr hs (obs o)) x), + fun o => conditionalPacketDensity_nonneg P raw obs g hc hr hs (obs o), + fun o => mixturePacketDensity_integrable hg hm hc hr hs _,fun o => ?_⟩ + · intro D + obtain ⟨C,hC⟩ := conditionalPacketDensity_uniform_bounds P raw obs hg hgs hc hr hs D + exact ⟨C,fun o => hC (obs o)⟩ + · intro D + obtain ⟨C,hC⟩ := conditionalPacketOffset_uniform_bounds P raw obs hg hgs hm hc hr hs D + exact ⟨C,fun o => hC (obs o)⟩ + · exact conditionalPacketField_nuclear P raw obs hg hgs hm hc hr hs (obs o) Z + +section Assembly +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} {B C r Z : ℝ} +variable {μ H : Ω → Position → ℝ} {bad : Ω → Prop} + +lemma PropagationDatum.step_hypotheses (k : PropagationConstants B C) + (d : PropagationDatum P B C r Z k.L μ) (q : NuclearRandomDatum Z μ H) + (hB : 0 + intro hj + have he : r*(2:ℝ)^(0:ℕ)=r := by simp + rw [he] + exact ⟨d₀,hinit.trans (mul_le_mul_of_nonneg_right (le_add_of_nonneg_right hM) (by positivity))⟩ + | succ j ih => + intro hj + have hjJ : j f o x) μ := by + obtain ⟨C,hC⟩ := hb ‖x‖ + apply (integrable_const C).mono' (hm.comp (measurable_id.prodMk measurable_const)).aestronglyMeasurable + filter_upwards [] with o + change ‖f o x‖ ≤ C + simpa only [Real.norm_eq_abs] using hC o x (by simp) + +lemma average_ball_bounds {f : Ω → Position → ℝ} + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |f o x| ≤ C) : + ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, |∫ o, f o x ∂μ| ≤ C := by + intro R + obtain ⟨C,hC⟩ := hb R + refine ⟨C,fun x hx => ?_⟩ + calc + |∫ o, f o x ∂μ| ≤ ∫ o, |f o x| ∂μ := abs_integral_le_integral_abs + _ ≤ ∫ _ : Ω, C ∂μ := integral_mono_of_nonneg + (Eventually.of_forall (fun o => abs_nonneg (f o x))) (integrable_const C) + (Eventually.of_forall (fun o => hC o x hx)) + _ = C := by simp + +theorem continuous_average_of_ball_bounds {f : Ω → Position → ℝ} + (hf : ∀ o, Continuous (f o)) (hm : Measurable (Function.uncurry f)) + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |f o x| ≤ C) : + Continuous (fun x => ∫ o, f o x ∂μ) := by + rw [continuous_iff_continuousAt] + intro x₀ + obtain ⟨C,hC⟩ := hb (‖x₀‖+1) + apply continuousAt_of_dominated + (Eventually.of_forall (fun x => (hm.comp (measurable_id.prodMk measurable_const)).aestronglyMeasurable)) + (bound := fun _ => C) ?_ (integrable_const C) + (Eventually.of_forall (fun o => (hf o).continuousAt)) + filter_upwards [Metric.ball_mem_nhds x₀ (by norm_num : (0:ℝ)<1)] with x hx + filter_upwards [] with o + have hdist : ‖x-x₀‖<1 := by simpa only [Metric.mem_ball,dist_eq_norm] using hx + have hn : ‖x‖≤‖x₀‖+1 := by + have h := norm_add_le (x-x₀) x₀ + rw [sub_add_cancel] at h + linarith + change ‖f o x‖ ≤ C + simpa only [Real.norm_eq_abs] using hC o x (by simpa using hn) + +omit [MeasurableSpace Ω] in +lemma cutoffReaction_offset_uniform_bound {a Z : ℝ} (ha : 0 Z*coulombKernel y+f o y) x| ≤ C := by + intro R + obtain ⟨D,hD⟩ := hb R + refine ⟨tfReaction (|Z|/a+D),?_⟩ + intro o x hx + by_cases haX : a ≤ ‖x‖ + · have hn : 0 < ‖x‖ := ha.trans_le haX + have hZ : Z*coulombKernel x ≤ |Z|/a := by + unfold coulombKernel + calc + Z*‖x‖⁻¹ ≤ |Z| *‖x‖⁻¹ := mul_le_mul_of_nonneg_right (le_abs_self _) (inv_nonneg.mpr hn.le) + _ ≤ |Z| *a⁻¹ := mul_le_mul_of_nonneg_left (inv_anti₀ ha haX) (abs_nonneg _) + _ = |Z|/a := by rw [div_eq_mul_inv] + have h := tfReaction_monotone (show Z*coulombKernel x+f o x ≤ |Z|/a+D by + have H : f o x ≤ D := (le_abs_self _).trans (hD o x hx) + linarith) + simpa [cutoffReaction, haX, abs_of_nonneg (tfReaction_nonneg _)] using h + · simpa [cutoffReaction, haX] using tfReaction_nonneg (|Z|/a+D) + +lemma cutoffReaction_offset_joint_measurable {a Z : ℝ} {f : Ω → Position → ℝ} + (hm : Measurable (Function.uncurry f)) : + Measurable (fun z : Ω × Position => cutoffReaction a (fun y => Z*coulombKernel y+f z.1 y) z.2) := by + have h : Measurable (fun z : Ω × Position => tfReaction (Z*coulombKernel z.2+f z.1 z.2)) := + tfReaction_continuous.measurable.comp ((measurable_const.mul + (measurable_coulombKernel.comp measurable_snd)).add hm) + exact h.ite ((isClosed_le continuous_const continuous_norm).measurableSet.preimage measurable_snd) + measurable_const + +lemma cutoffReaction_average_le {a Z : ℝ} {f : Ω → Position → ℝ} + (hm : Measurable (Function.uncurry f)) + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |f o x| ≤ C) + (x : Position) : + cutoffReaction a (fun y => Z*coulombKernel y+∫ o, f o y ∂μ) x ≤ + ∫ o, cutoffReaction a (fun y => Z*coulombKernel y+f o y) x ∂μ := by + by_cases haX : a ≤ ‖x‖ + · simp only [cutoffReaction, Set.indicator, Set.mem_ofPred_eq, haX, ↓reduceIte] + have hi := integrable_section_of_ball_bounds (μ:=μ) hm hb x + have hi' : Integrable (fun o => Z*coulombKernel x+f o x) μ := + (integrable_const (Z*coulombKernel x)).add hi + have hpow : Integrable (fun o => (max (Z*coulombKernel x+f o x) 0)^(3/2:ℝ)) μ := by + obtain ⟨C,hC⟩ := hb ‖x‖ + have hB : 0≤|Z*coulombKernel x|+max C 0 := add_nonneg (abs_nonneg _) (le_max_right _ _) + apply (integrable_const ((|Z*coulombKernel x|+max C 0)^(3/2:ℝ))).mono' + ((Real.continuous_rpow_const (by norm_num : (0:ℝ)≤3/2)).measurable.comp + (((measurable_const.add (hm.comp (measurable_id.prodMk measurable_const))).max measurable_const))).aestronglyMeasurable + filter_upwards [] with o + change ‖(max (Z*coulombKernel x+f o x) 0)^(3/2:ℝ)‖ ≤ _ + rw [Real.norm_eq_abs,abs_of_nonneg (Real.rpow_nonneg (le_max_right _ _) _)] + apply Real.rpow_le_rpow (le_max_right _ _) _ (by norm_num) + apply max_le _ hB + have H := hC o x (by simp) + linarith [le_abs_self (Z*coulombKernel x),le_abs_self (f o x), le_max_left C 0] + have H := tfReaction_integral_le hi' hpow + simpa [integral_add (integrable_const _) hi] using H + · simp [cutoffReaction,haX] + +theorem WeakNuclearSubsolution.average_cutoffTF {a Z : ℝ} {U : Set Position} + {f b : Ω → Position → ℝ} (ha : 0 Z*coulombKernel x+f o x) Z U + (fun x => b o x+cutoffReaction a (fun y => Z*coulombKernel y+f o y) x)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+∫ o, f o x ∂μ) Z U + (fun x => (∫ o, b o x ∂μ)+cutoffReaction a (fun y => Z*coulombKernel y+∫ o, f o y ∂μ) x) := by + let q : Ω → Position → ℝ := fun o x => b o x+cutoffReaction a (fun y => Z*coulombKernel y+f o y) x + have hmq : Measurable (Function.uncurry q) := hmb.add (cutoffReaction_offset_joint_measurable hmf) + have hbc := cutoffReaction_offset_uniform_bound (Z:=Z) ha hbf + have hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |q o x| ≤ C := by + intro R + obtain ⟨C,hC⟩ := hbb R + obtain ⟨D,hD⟩ := hbc R + exact ⟨C+D,fun o x hx => (abs_add_le _ _).trans (add_le_add (hC o x hx) (hD o x hx))⟩ + have hc := continuous_average_of_ball_bounds (μ:=μ) hf hmf hbf + have H := WeakNuclearSubsolution.average hf hc hmf hmq hbf hbq hw + apply (weakNuclearSubsolution_offset_iff hc).2 + apply ((weakNuclearSubsolution_offset_iff hc).1 H).mono_source_on + · exact locallyIntegrable_of_ball_bounds hmq.stronglyMeasurable.integral_prod_left.measurable + (average_ball_bounds (μ:=μ) hbq) + · exact (locallyIntegrable_of_ball_bounds hmb.stronglyMeasurable.integral_prod_left.measurable + (average_ball_bounds (μ:=μ) hbb)).add (cutoffReaction_offset_locallyIntegrable ha hc) + · filter_upwards [] with x hx + have hib := integrable_section_of_ball_bounds (μ:=μ) hmb hbb x + have hic := integrable_section_of_ball_bounds (μ:=μ) + (f:=fun o x => cutoffReaction a (fun y => Z*coulombKernel y+f o y) x) + (cutoffReaction_offset_joint_measurable hmf) hbc x + change (∫ o, b o x ∂μ)+cutoffReaction a (fun y => Z*coulombKernel y+∫ o, f o y ∂μ) x ≤ + ∫ o, b o x+cutoffReaction a (fun y => Z*coulombKernel y+f o y) x ∂μ + rw [integral_add hib hic] + have h := cutoffReaction_average_le (μ:=μ) (a:=a) (Z:=Z) hmf hbf x + linarith + +end Average +end NeutralAtom + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationAverageAE.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationAverageAE.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c1402e019feb10e2448683c8699e44a0daa13a0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationAverageAE.lean @@ -0,0 +1,149 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationDatumRegularity + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +noncomputable section +namespace NeutralAtom +section Average +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +theorem continuous_average_ae_of_ball_bounds {f : Ω → Position → ℝ} + (hf : ∀ᵐ o ∂μ, Continuous (f o)) (hm : Measurable (Function.uncurry f)) + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |f o x| ≤ C) : + Continuous (fun x => ∫ o, f o x ∂μ) := by + rw [continuous_iff_continuousAt] + intro x₀ + obtain ⟨C,hC⟩ := hb (‖x₀‖+1) + apply continuousAt_of_dominated + (Eventually.of_forall (fun x => (hm.comp (measurable_id.prodMk measurable_const)).aestronglyMeasurable)) + (bound := fun _ => C) ?_ (integrable_const C) + (hf.mono (fun o ho => ho.continuousAt)) + filter_upwards [Metric.ball_mem_nhds x₀ (by norm_num : (0:ℝ)<1)] with x hx + filter_upwards [] with o + have hdist : ‖x-x₀‖<1 := by simpa only [Metric.mem_ball,dist_eq_norm] using hx + have hn : ‖x‖≤‖x₀‖+1 := by + have h := norm_add_le (x-x₀) x₀ + rw [sub_add_cancel] at h + linarith + change ‖f o x‖ ≤ C + simpa only [Real.norm_eq_abs] using hC o x (by simpa using hn) + +theorem WeakNuclearSubsolution.average_ae {f q : Ω → Position → ℝ} {Z : ℝ} {U : Set Position} + (hf : ∀ᵐ o ∂μ, Continuous (f o)) + (hcf : Continuous (fun x => ∫ o, f o x ∂μ)) + (hmf : Measurable (Function.uncurry f)) (hmq : Measurable (Function.uncurry q)) + (hbf : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |f o x| ≤ C) + (hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |q o x| ≤ C) + (hw : ∀ᵐ o ∂μ, WeakNuclearSubsolution (fun x => Z*coulombKernel x+f o x) Z U (q o)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+∫ o, f o x ∂μ) Z U + (fun x => ∫ o, q o x ∂μ) := by + apply (weakNuclearSubsolution_offset_iff hcf).2 + apply WeakLaplacianGE.average hmf hmq hbf hbq + filter_upwards [hw,hf] with o ho hf + exact (weakNuclearSubsolution_offset_iff hf).1 ho + +theorem WeakNuclearSubsolution.average_cutoffTF_ae {a Z : ℝ} {U : Set Position} + {f b : Ω → Position → ℝ} (ha : 0 Z*coulombKernel x+f o x) Z U + (fun x => b o x+cutoffReaction a (fun y => Z*coulombKernel y+f o y) x)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+∫ o, f o x ∂μ) Z U + (fun x => (∫ o, b o x ∂μ)+cutoffReaction a (fun y => Z*coulombKernel y+∫ o, f o y ∂μ) x) := by + let q : Ω → Position → ℝ := fun o x => b o x+cutoffReaction a (fun y => Z*coulombKernel y+f o y) x + have hmq : Measurable (Function.uncurry q) := hmb.add (cutoffReaction_offset_joint_measurable hmf) + have hbc := cutoffReaction_offset_uniform_bound (Z:=Z) ha hbf + have hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |q o x| ≤ C := by + intro R + obtain ⟨C,hC⟩ := hbb R + obtain ⟨D,hD⟩ := hbc R + exact ⟨C+D,fun o x hx => (abs_add_le _ _).trans (add_le_add (hC o x hx) (hD o x hx))⟩ + have hc := continuous_average_ae_of_ball_bounds (μ:=μ) hf hmf hbf + have H := WeakNuclearSubsolution.average_ae hf hc hmf hmq hbf hbq hw + apply (weakNuclearSubsolution_offset_iff hc).2 + apply ((weakNuclearSubsolution_offset_iff hc).1 H).mono_source_on + · exact locallyIntegrable_of_ball_bounds hmq.stronglyMeasurable.integral_prod_left.measurable + (average_ball_bounds (μ:=μ) hbq) + · exact (locallyIntegrable_of_ball_bounds hmb.stronglyMeasurable.integral_prod_left.measurable + (average_ball_bounds (μ:=μ) hbb)).add (cutoffReaction_offset_locallyIntegrable ha hc) + · filter_upwards [] with x hx + have hib := integrable_section_of_ball_bounds (μ:=μ) hmb hbb x + have hic := integrable_section_of_ball_bounds (μ:=μ) + (f:=fun o x => cutoffReaction a (fun y => Z*coulombKernel y+f o y) x) + (cutoffReaction_offset_joint_measurable hmf) hbc x + change (∫ o, b o x ∂μ)+cutoffReaction a (fun y => Z*coulombKernel y+∫ o, f o y ∂μ) x ≤ + ∫ o, b o x+cutoffReaction a (fun y => Z*coulombKernel y+f o y) x ∂μ + rw [integral_add hib hic] + have h := cutoffReaction_average_le (μ:=μ) (a:=a) (Z:=Z) hmf hbf x + linarith + +end Average +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Average +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable {u μ p : Ω → Position → ℝ} {B C r Z L : ℝ} +theorem PropagationInvariant.average_ae (hr : 0 ∫ o,u o x ∂P) + (fun x => ∫ o,μ o x ∂P) (fun x => ∫ o,p o x ∂P) := by + constructor + · exact continuous_average_ae_of_ball_bounds (hi.mono (fun o ho => ho.continuous_offset)) hu hbu + · intro x + exact integral_nonneg_of_ae (hi.mono (fun o ho => ho.nonnegative_error x)) + · intro x hx + exact integral_eq_zero_of_ae (hi.mono (fun o ho => ho.error_support x hx)) + · have H := WeakNuclearSubsolution.average_cutoffTF_ae (μ:=P) (Z:=Z) + (b:=fun o x => propagationCoreSource r ‖x‖ (μ o x) (p o x)) hr + (hi.mono (fun o ho => ho.continuous_offset)) hu (propagationCoreSource_joint_measurable (r:=r) hμ hp) + hbu (propagationCoreSource_uniform_bounds (r:=r) hbμ hbp) + (hi.mono (fun o ho => by simpa only [propagationRHS_eq] using ho.weak)) + simp only [propagationCoreSource_average hμ hp hbμ hbp] at H + simpa only [propagationRHS,cutoffReaction,Set.indicator,Set.mem_ofPred_eq] using H + · intro x hx + have hiu := integrable_section_of_ball_bounds (μ:=P) hu hbu x + have hii := (integrable_const (Z*coulombKernel x)).add hiu + have he : (∫ o,Z*coulombKernel x+u o x ∂P)=Z*coulombKernel x+∫ o,u o x ∂P := by + rw [integral_add (integrable_const _) hiu]; simp + constructor + · have H := integral_mono_ae (integrable_const (propagationBarrier B r x)) hii + (hi.mono (fun o ho => (ho.caps x hx).1)) + change (∫ _ : Ω,propagationBarrier B r x ∂P) ≤ (∫ o,Z*coulombKernel x+u o x ∂P) at H + simpa only [integral_const,probReal_univ,one_smul,he] using H + · have H := integral_mono_ae hii (integrable_const (C/‖x‖^4)) + (hi.mono (fun o ho => (ho.caps x hx).2)) + change (∫ o,Z*coulombKernel x+u o x ∂P) ≤ (∫ _ : Ω,C/‖x‖^4 ∂P) at H + simpa only [integral_const,probReal_univ,one_smul,he] using H + · intro x hx + have hiu := integrable_section_of_ball_bounds (μ:=P) hu hbu x + have he : (∫ o,Z*coulombKernel x+u o x ∂P)=Z*coulombKernel x+∫ o,u o x ∂P := by + rw [integral_add (integrable_const _) hiu]; simp + rw [←he] + calc + _ = ∫ _ : Ω,propagationBarrier B r x ∂P := integral_congr_ae (hi.mono (fun o ho => ho.outer x hx)) + _ = _ := by simp +end Average +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationBarrierBounds.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationBarrierBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..7fa89730323ceea293bc49bd17960c99a9026150 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationBarrierBounds.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.NearActiveMaximum + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +def propagationGamma (B : ℝ) : ℝ := B/(16*(11/10:ℝ)^5) + +lemma propagationGamma_pos {B : ℝ} (hB : 0 hf x (ht hx)) hφ hc] + apply integral_mono (integrable_mul_test_on hq hφ.continuous hc ht) + (integrable_mul_compact_of_continuousAt + (fun x hx => continuousAt_coordinateLaplacian (hf x (ht hx))) hφ.continuous hc) + intro x + by_cases hx : x ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hle x (ht hx)) (hp x) + · simp only [image_eq_zero_of_notMem_tsupport hx,mul_zero,le_refl] + +lemma WeakLaplacianGE.to_nuclear_away {f q : Position → ℝ} {U : Set Position} + (hw : WeakLaplacianGE f U q) (h0 : (0:Position) ∉ U) (Z : ℝ) : + WeakNuclearSubsolution f Z U q := by + intro φ hφ hc ht hp + have hz := image_eq_zero_of_notMem_tsupport (show (0:Position) ∉ tsupport φ from fun h => h0 (ht h)) + simpa only [hz,mul_zero,neg_zero,zero_add] using hw φ hφ hc ht hp + +lemma WeakNuclearSubsolution.congr_on {f g q r : Position → ℝ} {U : Set Position} {Z : ℝ} + (hw : WeakNuclearSubsolution f Z U q) (he : ∀ x ∈ U, f x=g x) (hq : ∀ x ∈ U, q x=r x) : + WeakNuclearSubsolution g Z U r := by + intro φ hφ hc ht hp + have H := hw φ hφ hc ht hp + have hleft : (fun x => q x*φ x)=(fun x => r x*φ x) := by + funext x + by_cases hx : x ∈ tsupport φ + · rw [hq x (ht hx)] + · simp [image_eq_zero_of_notMem_tsupport hx] + have hright : (fun x => f x*coordinateLaplacian φ x)=(fun x => g x*coordinateLaplacian φ x) := by + funext x + by_cases hx : x ∈ tsupport φ + · rw [he x (ht hx)] + · simp [coordinateLaplacian_eq_zero_of_notMem_tsupport hx] + simpa only [hleft,hright] using H + +lemma WeakNuclearSubsolution.mono_domain {f q : Position → ℝ} {U V : Set Position} {Z : ℝ} + (hw : WeakNuclearSubsolution f Z U q) (hVU : V ⊆ U) : WeakNuclearSubsolution f Z V q := + fun φ hφ hc ht hp => hw φ hφ hc (ht.trans hVU) hp + +lemma WeakNuclearSubsolution.of_local {f q : Position → ℝ} {U : Set Position} {Z : ℝ} + (hf : Continuous f) (hq : LocallyIntegrable q volume) + (hw : ∀ x ∈ U, ∃ V : Set Position, x ∈ V ∧ IsOpen V ∧ + WeakNuclearSubsolution (fun y => Z*coulombKernel y+f y) Z V q) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+f x) Z U q := by + apply (weakNuclearSubsolution_offset_iff hf).2 + apply WeakLaplacianGE.of_local hf.locallyIntegrable hq + intro x hx + obtain ⟨V,hxV,hV,hWV⟩ := hw x hx + exact ⟨V,hxV,hV,(weakNuclearSubsolution_offset_iff hf).1 hWV⟩ + +lemma WeakLaplacianGE.sub_const {f q : Position → ℝ} {U : Set Position} + (hf : Continuous f) (hw : WeakLaplacianGE f U q) (c : ℝ) : + WeakLaplacianGE (fun x => f x-c) U q := by + intro φ hφ hc ht hp + have hi := integrable_mul_compact_of_continuousAt (fun x _ => hf.continuousAt) + (contDiff_coordinateLaplacian hφ).continuous (hasCompactSupport_coordinateLaplacian hc) + have hi' : Integrable (fun x => c*coordinateLaplacian φ x) := ((contDiff_coordinateLaplacian hφ).continuous.integrable_of_hasCompactSupport + (hasCompactSupport_coordinateLaplacian hc)).const_mul c + simp_rw [sub_mul] + rw [integral_sub hi hi',integral_const_mul,integral_coordinateLaplacian hφ hc,mul_zero,sub_zero] + exact hw φ hφ hc ht hp + +lemma WeakNuclearSubsolution.sub_offset_const {f q : Position → ℝ} {U : Set Position} {Z : ℝ} + (hf : Continuous f) (hw : WeakNuclearSubsolution (fun x => Z*coulombKernel x+f x) Z U q) (c : ℝ) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+(f x-c)) Z U q := + (weakNuclearSubsolution_offset_iff (hf.sub continuous_const)).2 + (((weakNuclearSubsolution_offset_iff hf).1 hw).sub_const hf c) + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationBarrierOffset.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationBarrierOffset.lean new file mode 100644 index 0000000000000000000000000000000000000000..caee914ead7f1b9ae4199da17fad3c7087742846 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationBarrierOffset.lean @@ -0,0 +1,212 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationBarrierBounds + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +def propagationBarrierOffset (B R Z : ℝ) (x : Position) : ℝ := + B/(max R ‖x‖)^4*(1-R/(8*max R ‖x‖))-Z/(max R ‖x‖) + +lemma propagationBarrierOffset_continuous (B Z : ℝ) {R : ℝ} (hR : 0 max R ‖x‖) := continuous_const.max continuous_norm + have hne (x : Position) : max R ‖x‖≠0 := ne_of_gt (hR.trans_le (le_max_left _ _)) + exact ((continuous_const.div (hD.pow 4) (fun x => pow_ne_zero 4 (hne x))).mul + (continuous_const.sub (continuous_const.div (continuous_const.mul hD) + (fun x => mul_ne_zero (by norm_num) (hne x))))).sub (continuous_const.div hD hne) + +lemma propagationBarrierOffset_eq {B R Z : ℝ} {x : Position} (hx : R≤‖x‖) : + Z*coulombKernel x+propagationBarrierOffset B R Z x=propagationBarrier B R x := by + rw [propagationBarrierOffset,max_eq_right hx,propagationBarrier_eq] + unfold coulombKernel + ring + +lemma propagationBarrier_weak {B R Z : ℝ} (hB : 0 Z*coulombKernel x+propagationBarrierOffset B R Z x) Z + {x | R<‖x‖} (fun x => tfReaction (propagationBarrier B R x)) := by + have hU : IsOpen {x : Position | R<‖x‖} := isOpen_lt continuous_const continuous_norm + have hsub : {x : Position | R<‖x‖} ⊆ punctured := by + intro x hx + exact norm_pos_iff.mp (hR.trans hx) + have hp : ContDiffOn ℝ 2 (propagationBarrier B R) {x | R<‖x‖} := + (contDiffOn_propagationBarrier B R 2).mono hsub + have hf : ∀ x ∈ {x : Position | R<‖x‖},ContDiffAt ℝ 2 (propagationBarrier B R) x := + fun x hx => hp.contDiffAt (hU.mem_nhds hx) + have hq : LocallyIntegrableOn (fun x => tfReaction (propagationBarrier B R x)) {x | R<‖x‖} := + (tfReaction_continuous.comp_continuousOn hp.continuousOn).locallyIntegrableOn hU.measurableSet + have H := WeakLaplacianGE.of_classical hf hq + (fun x hx => propagationBarrier_laplacian_ge_reaction hB hR hsmall hx.le) + apply (H.to_nuclear_away (by simp [not_lt_of_ge hR.le]) Z).congr_on + · intro x hx + exact (propagationBarrierOffset_eq hx.le).symm + · intro x hx + rfl + +end NeutralAtom + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +namespace NeutralAtom + +def propagationCoreSource (r d μ p : ℝ) : ℝ := 4*Real.pi*((if d positivity + +lemma propagation_old_source {bad : Prop} {r R d μ p u l : ℝ} + (hrR : r≤R) (hR : 0 Z*coulombKernel y+f y) x := by + simp [propagationRHS,cutoffReaction,Set.indicator] + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +lemma normalized_cap {d C v : ℝ} (hd : 0.trans_eq (mul_comm _ _) + +lemma normalized_near_barrier_lower {B R L e v : ℝ} (hB : 0≤B) (hR : 0 8*Real.pi*kTF*Real.sqrt (2*ε^3)) := by fun_prop + have hcontB : Continuous (fun ε : ℝ => 4*Real.pi*kTF*Real.sqrt (ε^3/10)) := by fun_prop + have hsmall : ∀ᶠ ε : ℝ in 𝓝[>] 0,ε<εmax ∧ + 8*Real.pi*kTF*Real.sqrt (2*ε^3)<3/40 ∧ + 4*Real.pi*kTF*Real.sqrt (ε^3/10)<19/2 := by + have ht1 : Tendsto (fun ε : ℝ => 8*Real.pi*kTF*Real.sqrt (2*ε^3)) (𝓝 0) (𝓝 0) := by + simpa using hcont.tendsto 0 + have ht2 : Tendsto (fun ε : ℝ => 4*Real.pi*kTF*Real.sqrt (ε^3/10)) (𝓝 0) (𝓝 0) := by + simpa using hcontB.tendsto 0 + have h1 := ht1.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<3/40)) + have h2 := ht2.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<19/2)) + exact ((gt_mem_nhds hεmax).and (h1.and h2)).filter_mono nhdsWithin_le_nhds + have hpositive : ∀ᶠ ε : ℝ in 𝓝[>] 0,0<ε := self_mem_nhdsWithin + obtain ⟨ε,hε,hεm,hR,hB⟩ := (hpositive.and hsmall).exists + have hεp : 0<ε := hε + refine ⟨ε,ε^3/10,hεp,hεm.le,by positivity,le_rfl,?_,hB.le⟩ + rw [tfReaction_posFactor (by positivity)] + have H := mul_le_mul_of_nonneg_right hR.le (pow_nonneg hεp.le 3) + nlinarith only [H] + +lemma initial_scaled_gates {ε B Z r : ℝ} (hZ : 0 r₀*2^l.val + ∃ G : Set (ObservationSample (N+1) J), + (MeasurableSet G ∧ MeasurableSet[observationSigma rs j.val] G) ∧ + P.real Gᶜ ≤ K*(rs j)^24 ∧ + ∀ o∈G,∀ x : Position,rs j ≤ ‖x‖ → ‖x‖ ≤ 4*k.L*(rs j) → + let μ := conditionalPacketDensity P Prod.fst (tailObservation rs j.val) g₀ c r₀ s (tailObservation rs j.val o) + let F := (Z:ℝ)*coulombKernel x-potentialOf μ x + F ≤ C/‖x‖^4 ∧ ∀ h∈Icc (B/2) C, + (Coulomb.tfScalarDensity h ≤ ‖x‖^6*μ x → h-k.ξ ≤ ‖x‖^4*F) ∧ + (‖x‖^6*μ x ≤ Coulomb.tfScalarDensity h → ‖x‖^4*F ≤ h+k.ξ) := by + have hL : 1 ≤ k.L := by linarith [k.L_large] + obtain ⟨Ki,hKi,Hi⟩ := physical_simultaneous_inverse g₀ hg hm hrad hc hL k.xi_pos k.xi_lt_height + (show B/2 ≤ C by linarith) + obtain ⟨Kc,hKc,Hc⟩ := physical_retained_spatial_cap hL + refine ⟨Ki+Kc,add_pos hKi hKc,?_⟩ + intro D hD + obtain ⟨si,hsi,hsi1,Hi⟩ := Hi D hD + obtain ⟨sn,hsn,hsn16,Hn⟩ := exists_simultaneous_inverse_scale (L:=k.L) (D:=D) (A:=0) (B:=0) + hc k.xi_pos (by norm_num : (0:ℝ)<1) + have ht : Tendsto (fun s : ℝ => D*s^7) (𝓝[>] 0) (𝓝 0) := by + convert ((tendsto_id.mono_left nhdsWithin_le_nhds : Tendsto (fun s : ℝ => s) (𝓝[>] 0) (𝓝 0)).pow 7).const_mul D using 1 <;> simp + obtain ⟨sd,hsd,Hd⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp (ht.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1))) + let s₀ := min si (min sn sd) + have hsi' : s₀ ≤ si := min_le_left _ _ + have hsn' : s₀ ≤ sn := (min_le_right _ _).trans (min_le_left _ _) + have hsd' : s₀ ≤ sd := (min_le_right _ _).trans (min_le_right _ _) + refine ⟨s₀,lt_min hsi (lt_min hsn hsd),hsi'.trans hsi1,?_,?_⟩ + · intro s hs hss + obtain ⟨h1,h2,-⟩ := Hn hs (hss.trans_le hsn') + exact ⟨h1.trans (by norm_num),h2.trans (by norm_num),(Hd ⟨hs,hss.trans_le hsd'⟩).le⟩ + intro N J Z hZ ψ g hd hn hmin E hE he r₀ s hr₀ hs hss j hrjs + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let rs := fun l : Fin J => r₀*2^l.val + have hrj : 0 propagationPairOffset (bad z.1) R l1 l2 (u z.1) (H z.1) z.2) := by + exact (hu.sub measurable_const).ite (hb.preimage measurable_fst) + ((hu.sub measurable_const).max (hH.sub measurable_const)) + +omit [MeasurableSpace Ω] in +lemma propagationPairOffset_uniform_bounds + (hu : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |u o x|≤C) + (hH : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |H o x|≤C) : + ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → + |propagationPairOffset (bad o) R l1 l2 (u o) (H o) x|≤C := by + intro D + obtain ⟨C,hC⟩ := hu D + obtain ⟨A,hA⟩ := hH D + refine ⟨max (C+|l1/R^4|) (A+|l2/R^4|),?_⟩ + intro o x hx + have h1 := (abs_sub (u o x) (l1/R^4)).trans (add_le_add (hC o x hx) le_rfl) + have h2 := (abs_sub (H o x) (l2/R^4)).trans (add_le_add (hA o x hx) le_rfl) + unfold propagationPairOffset + split_ifs + · exact h1.trans (le_max_left _ _) + · exact abs_max_le_max_abs_abs.trans (max_le_max h1 h2) + +lemma propagationNextOffset_joint_measurable (hR : 0 propagationNextOffset (bad z.1) B R Z L l1 l2 (u z.1) (H z.1) z.2) := + radialMaxSplice_joint_measurable (f:=fun o => propagationPairOffset (bad o) R l1 l2 (u o) (H o)) + (g:=fun _ => propagationBarrierOffset B R Z) ((53/50)*R) ((3/2)*L*R) (propagationPairOffset_joint_measurable hb hu hH) + ((propagationBarrierOffset_continuous B Z hR).measurable.comp measurable_snd) + +omit [MeasurableSpace Ω] in +lemma propagationNextOffset_uniform_bounds (hR : 0 radialMaxSplice_abs_bound (hC o x hx) (hA x hx)⟩ + +lemma propagationStepError_joint_measurable (hb : MeasurableSet {o | bad o}) + (hμ : Measurable (Function.uncurry μ)) (hp : Measurable (Function.uncurry p)) : + Measurable (fun z : Ω×Position => propagationStepError (bad z.1) r R ‖z.2‖ (μ z.1 z.2) (p z.1 z.2)) := by + apply hp.add + exact hμ.ite ((hb.preimage measurable_fst).inter + ((measurableSet_le measurable_const (continuous_norm.measurable.comp measurable_snd)).inter + (measurableSet_lt (continuous_norm.measurable.comp measurable_snd) measurable_const))) measurable_const + +omit [MeasurableSpace Ω] in +lemma propagationStepError_uniform_bounds + (hμ : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤C) + (hp : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |p o x|≤C) : + ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → + |propagationStepError (bad o) r R ‖x‖ (μ o x) (p o x)|≤C := by + intro D + obtain ⟨C,hC⟩ := hμ D + obtain ⟨A,hA⟩ := hp D + refine ⟨A+max C 0,?_⟩ + intro o x hx + apply (abs_add_le _ _).trans + apply add_le_add (hA o x hx) + split_ifs + · exact (hC o x hx).trans (le_max_left _ _) + · simp +end Datum +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma atomic_screenedField_nuclear {ρ : Position → ℝ} (hi : Integrable ρ) + (hc : Continuous (potentialOf ρ)) (Z : ℝ) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x-potentialOf ρ x) Z univ + (fun x => 4*Real.pi*ρ x) := by + change WeakNuclearSubsolution (fun x => Z*coulombKernel x+(-potentialOf ρ x)) Z univ _ + apply (weakNuclearSubsolution_offset_iff hc.neg).2 + intro φ hφ hφc ht hp + have H := potentialOf_weakLaplacian hi φ hφ hφc ht + have H' : (∫ x,(-potentialOf ρ x)*coordinateLaplacian φ x)= + ∫ x,(4*Real.pi*ρ x)*φ x := by + simp only [neg_mul,integral_neg] at H ⊢ + rw [H] + simp only [neg_neg] + exact H'.ge + +lemma conditionalPacketField_nuclear {Ω A : Type*} + [MeasurableSpace Ω] [MeasurableSpace A] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → A) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} + (hc : 0 Z*coulombKernel x-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) x) Z univ + (fun x => 4*Real.pi*conditionalPacketDensity P raw obs g c r₀ s datum x) := + atomic_screenedField_nuclear (mixturePacketDensity_integrable hg hm hc hr hs _) + (conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr hs datum) Z +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +structure PropagationInvariant (B C r Z L : ℝ) (u μ p : Position → ℝ) : Prop where + continuous_offset : Continuous u + nonnegative_error : ∀ x,0≤p x + error_support : ∀ x,r≤‖x‖ → p x=0 + weak : WeakNuclearSubsolution (fun x => Z*coulombKernel x+u x) Z univ + (fun x => propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x)) + caps : ∀ x,r≤‖x‖ → propagationBarrier B r x≤Z*coulombKernel x+u x ∧ + Z*coulombKernel x+u x≤C/‖x‖^4 + outer : ∀ x,L*r<‖x‖ → Z*coulombKernel x+u x=propagationBarrier B r x + +lemma PropagationStepHypotheses.next_invariant + {bad : Prop} {B C r R Z L l1 l2 e ξ hl hh : ℝ} {u H μ p : Position → ℝ} + (d : PropagationStepHypotheses bad B C r R Z L l1 l2 e ξ hl hh u H μ p) + (hs : ∀ x,r≤‖x‖ → p x=0) : + PropagationInvariant B C R Z L (propagationNextOffset bad B R Z L l1 l2 u H) μ + (fun x => propagationStepError bad r R ‖x‖ (μ x) (p x)) := + ⟨d.next_continuous,d.next_error_nonneg,d.next_error_support hs,d.next_weak, + fun _ => d.next_caps,fun _ => d.next_outer⟩ + +section Average +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable {u μ p : Ω → Position → ℝ} {B C r Z L : ℝ} + +lemma propagationCoreSource_joint_measurable + (hμ : Measurable (Function.uncurry μ)) (hp : Measurable (Function.uncurry p)) : + Measurable (fun z : Ω×Position => propagationCoreSource r ‖z.2‖ (μ z.1 z.2) (p z.1 z.2)) := + measurable_const.mul ((hμ.ite (measurableSet_lt + (continuous_norm.measurable.comp measurable_snd) measurable_const) measurable_const).sub hp) + +omit [MeasurableSpace Ω] in +lemma propagationCoreSource_uniform_bounds + (hμ : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤C) + (hp : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |p o x|≤C) : + ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → + |propagationCoreSource r ‖x‖ (μ o x) (p o x)|≤C := by + intro D + obtain ⟨A,hA⟩ := hμ D + obtain ⟨K,hK⟩ := hp D + exact ⟨4*Real.pi*(A+K),fun o x hx => propagationCoreSource_abs_bound (hA o x hx) (hK o x hx)⟩ + +lemma propagationCoreSource_average (hμ : Measurable (Function.uncurry μ)) + (hp : Measurable (Function.uncurry p)) + (hbμ : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μ o x|≤C) + (hbp : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |p o x|≤C) (x : Position) : + (∫ o,propagationCoreSource r ‖x‖ (μ o x) (p o x) ∂P)= + propagationCoreSource r ‖x‖ (∫ o,μ o x ∂P) (∫ o,p o x ∂P) := by + obtain h1 := integrable_section_of_ball_bounds (μ:=P) hμ hbμ x + obtain h2 := integrable_section_of_ball_bounds (μ:=P) hp hbp x + unfold propagationCoreSource + split_ifs + · rw [integral_const_mul,integral_sub h1 h2] + · simp only [zero_sub,integral_const_mul,integral_neg] + +theorem PropagationInvariant.average (hr : 0 ∫ o,u o x ∂P) + (fun x => ∫ o,μ o x ∂P) (fun x => ∫ o,p o x ∂P) := by + constructor + · exact continuous_average_of_ball_bounds (fun o => (hi o).continuous_offset) hu hbu + · intro x + exact integral_nonneg (fun o => (hi o).nonnegative_error x) + · intro x hx + simp only [(hi _).error_support x hx,integral_zero] + · have H := WeakNuclearSubsolution.average_cutoffTF (μ:=P) (Z:=Z) + (b:=fun o x => propagationCoreSource r ‖x‖ (μ o x) (p o x)) hr + (fun o => (hi o).continuous_offset) hu (propagationCoreSource_joint_measurable (r:=r) hμ hp) + hbu (propagationCoreSource_uniform_bounds (r:=r) hbμ hbp) + (Eventually.of_forall (fun o => by simpa only [propagationRHS_eq] using (hi o).weak)) + simp only [propagationCoreSource_average hμ hp hbμ hbp] at H + simpa only [propagationRHS,cutoffReaction,Set.indicator,Set.mem_ofPred_eq] using H + · intro x hx + have hiu := integrable_section_of_ball_bounds (μ:=P) hu hbu x + have hii := (integrable_const (Z*coulombKernel x)).add hiu + have he : (∫ o,Z*coulombKernel x+u o x ∂P)=Z*coulombKernel x+∫ o,u o x ∂P := by + rw [integral_add (integrable_const _) hiu]; simp + constructor + · have H := integral_mono (integrable_const (propagationBarrier B r x)) hii + (fun o => ((hi o).caps x hx).1) + change (∫ _ : Ω,propagationBarrier B r x ∂P) ≤ (∫ o,Z*coulombKernel x+u o x ∂P) at H + simpa only [integral_const,probReal_univ,one_smul,he] using H + · have H := integral_mono hii (integrable_const (C/‖x‖^4)) + (fun o => ((hi o).caps x hx).2) + change (∫ o,Z*coulombKernel x+u o x ∂P) ≤ (∫ _ : Ω,C/‖x‖^4 ∂P) at H + simpa only [integral_const,probReal_univ,one_smul,he] using H + · intro x hx + have hiu := integrable_section_of_ball_bounds (μ:=P) hu hbu x + have he : (∫ o,Z*coulombKernel x+u o x ∂P)=Z*coulombKernel x+∫ o,u o x ∂P := by + rw [integral_add (integrable_const _) hiu]; simp + rw [←he] + simp only [(hi _).outer x hx,integral_const,probReal_univ,one_smul] +end Average +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationExpectedDeficit.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationExpectedDeficit.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4462395b7eec3882ae41e49d9b0ba6f10cfab1a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationExpectedDeficit.lean @@ -0,0 +1,154 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.WedgeInsert +import OAI.Analysis.CoulombRadii.Propagation.PropagationMassTest +import OAI.Analysis.CoulombRadii.Propagation.PosteriorPropagationData + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology Classical +noncomputable section +namespace NeutralAtom +section Expectation +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable {B C r Z L : ℝ} {μ H : Ω → Position → ℝ} +lemma NuclearRandomDatum.ball_product_integrable (q : NuclearRandomDatum Z μ H) (R : ℝ) : + Integrable (fun z : Ω×Position => (Metric.ball (0:Position) R).indicator (μ z.1) z.2) (P.prod volume) := by + apply compact_random_field_integrable (P:=P) (R:=R) (f:=fun o x => (Metric.ball (0:Position) R).indicator (μ o) x) + · exact q.mu_measurable.indicator (measurableSet_ball.preimage measurable_snd) + · intro D + obtain ⟨M,hM⟩ := q.mu_bounds D + refine ⟨max M 0,?_⟩ + intro o x hx + by_cases h : x∈Metric.ball (0:Position) R + · simpa only [Set.indicator_of_mem h] using (hM o x hx).trans (le_max_left M 0) + · simp only [Set.indicator_of_notMem h,abs_zero]; exact le_max_right M 0 + · exact Eventually.of_forall (fun o x hx => Set.indicator_of_notMem (by simpa using not_lt.mpr hx) _) + +theorem PropagationDatum.expected_charge_deficit (d : PropagationDatum P B C r Z L μ) + (q : NuclearRandomDatum Z μ H) (hr : 0 ∫ x,d.error o x) P := hpi.integral_prod_left + have him : Integrable (fun o => ∫ x in Metric.ball 0 r,μ o x) P := by + simpa only [integral_indicator measurableSet_ball] using hmi.integral_prod_left + have H : ∀ᵐ o ∂P,(∫ x in Metric.ball 0 r,μ o x)≤ + Z-(tfReaction (7*B/128)*(28*Real.pi/3))/(4*Real.pi*r^3)+(∫ x,d.error o x) := by + filter_upwards [d.invariant,hpi.prod_right_ae] with o hi hp + have HD := hi.charge_deficit hr hB hC (q.integrable_mu o) hp + linarith only [HD] + have HH := integral_mono_ae him ((integrable_const _).add hip) H + change (∫ o,(∫ x in Metric.ball 0 r,μ o x) ∂P)≤ + ∫ o,(Z-(tfReaction (7*B/128)*(28*Real.pi/3))/(4*Real.pi*r^3)+(∫ x,d.error o x)) ∂P at HH + rw [integral_add (integrable_const _) hip,integral_const,probReal_univ,one_smul] at HH + exact HH +end Expectation +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology Classical +noncomputable section +namespace NeutralAtom +section Init +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable {Z r n ε : ℝ} {μ H : Ω → Position → ℝ} {bad : Ω → Prop} +lemma NuclearRandomDatum.initial_error_bound (q : NuclearRandomDatum Z μ H) + (hb : MeasurableSet {o | bad o}) (hn : ∀ o,(∫ x,μ o x) ≤ n) + (hr : 0 ∫ x in Metric.ball 0 r,μ o x) P := by + simpa only [integral_indicator measurableSet_ball] using (q.ball_product_integrable (P:=P) r).integral_prod_left + have hno : 0 ≤ n := by + obtain ⟨o⟩ := nonempty_of_isProbabilityMeasure P + exact (integral_nonneg (q.nonnegative_mu o)).trans (hn o) + have H : (∫ o in {o | bad o},∫ x in Metric.ball 0 r,μ o x ∂volume ∂P) ≤ P.real {o | bad o}*n := by + have HH := integral_mono (hi.integrableOn (s:={o | bad o})) (integrable_const n (μ:=P.restrict {o | bad o})) + (fun o => (setIntegral_le_integral (q.integrable_mu o) + (Eventually.of_forall (q.nonnegative_mu o))).trans (hn o)) + simpa only [integral_const,Measure.real,Measure.restrict_apply_univ,smul_eq_mul] using HH + calc + _ ≤ P.real {o | bad o}*n := H + _ ≤ (343*r^35)*n := mul_le_mul_of_nonneg_right hp hno + _ = 343*(n*r^3)*r^32 := by ring + _ ≤ 343*(3*ε^3)*r^32 := by gcongr + _ = 1029*ε^3*r^32 := by ring + _ ≤ 1029*ε^3*r^9 := mul_le_mul_of_nonneg_left + (pow_le_pow_of_le_one hr.le hr1 (by decide)) (by positivity) +end Init +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace Coulomb + +lemma atomic_nuclear_nonsingular_bound {n : ℕ} (Z : ℕ) (hZ : 1≤Z) + (u : H1Vector n) {R : ℝ} (hR : 0 H i) + simpa only [Finset.sum_add_distrib,←Finset.mul_sum,Finset.sum_const,Finset.card_univ, + Fintype.card_fin,nsmul_eq_mul,nearPotential,div_eq_mul_inv,mul_assoc,mul_left_comm] using Hsum + have hV (s : Spins n) : Integrable (fun x => + (∑ i,attraction (atom Z hZ) (position x i))*‖u.value s x‖^2) := by + simpa only [attraction,atom,Fin.sum_univ_one,sub_zero,Finset.sum_mul,mul_assoc] using + integrable_finsetSum Finset.univ (fun i _ => + ((u.nuclear_coulomb_integrable_bound s i 0 (by norm_num : (0:ℝ)<1)).1).const_mul (Z:ℝ)) + have hW (s : Spins n) : Integrable (fun x => + ((Z:ℝ)*nearPotential 0 R x)*‖u.value s x‖^2) := by + simpa only [mul_assoc] using (nearPotential_integrable u 0 R s).const_mul (Z:ℝ) + have H := potentialForm_le_add_const u hV hW (Eventually.of_forall point) + change _ ≤ _ at H + have he : potentialForm (fun x => (Z:ℝ)*nearPotential 0 R x) u = + (Z:ℝ)*potentialForm (nearPotential 0 R) u := by + simp only [potentialForm,mul_assoc,integral_const_mul,Finset.mul_sum] + rw [he] at H + exact H + +lemma atomic_kinetic_le_near {n : ℕ} (Z : ℕ) (hZ : 1≤Z) + (u : H1Vector n) (hu : Antisymmetric u) (hm : mass u=1) + {R D : ℝ} (hR : 0 Z*coulombKernel y+u y) x*φ x) ≤ + 4*Real.pi*(Z-(∫ x in Metric.ball 0 r,μ x)+(∫ x,p x))+ + (∫ x,(Z*coulombKernel x+u x)*coordinateLaplacian φ x) := by + let m : Position → ℝ := (Metric.ball (0:Position) r).indicator μ + have him : Integrable m := hμ.indicator measurableSet_ball + have hmp : ∀ x,m x*φ x=m x := by + intro x + by_cases hx : ‖x‖ propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x)*φ x)= + fun x => 4*Real.pi*(m x-p x)+cutoffReaction r (fun y => Z*coulombKernel y+u y) x*φ x := by + funext x + rw [propagationRHS_eq,add_mul,propagationCoreSource,mul_assoc,sub_mul,hpp] + have hh : (if ‖x‖ 4*Real.pi*(m x-p x)) := (him.sub hp).const_mul (4*Real.pi) + have H := d.weak φ hφ hc (subset_univ _) hφn + rw [hone 0 (by simpa using hr.le),he, + integral_add hicore hic, + integral_const_mul,integral_sub him hp] at H + have hm : (∫ x,m x)=∫ x in Metric.ball 0 r,μ x := integral_indicator measurableSet_ball + rw [hm] at H + linarith only [H] + +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma propagation_shell_volume {r : ℝ} (hr : 0 Z*coulombKernel y+u y) x*Coulomb.countTest 0 R x := by + let F := fun x => cutoffReaction r (fun y => Z*coulombKernel y+u y) x*Coulomb.countTest 0 R x + let A : Set Position := Metric.ball 0 (2*r) \ Metric.ball 0 r + have hRp : 0 Z*coulombKernel y+u y) x*Coulomb.countTest 0 R x + rw [Hone,mul_one] + simp only [cutoffReaction,Set.indicator_of_mem (show x∈{x : Position | r≤‖x‖} from hl)] + rw [←tfReaction_div_fourth _ hr] + exact tfReaction_monotone ((propagationBarrier_shell_lower hB hr hl hu.le).trans (d.caps x hl).1) + have H := integral_mono_ae (integrable_const (tfReaction (7*B/128)/r^6)) hi.integrableOn + (ae_restrict_of_forall_mem (measurableSet_ball.diff measurableSet_ball) hb) + rw [setIntegral_const] at H + have Hvol : (volume : Measure Position).real A=(28*Real.pi/3)*r^3 := propagation_shell_volume hr + rw [Hvol,smul_eq_mul] at H + have he : (28*Real.pi/3)*r^3*(tfReaction (7*B/128)/r^6)= + (tfReaction (7*B/128)*(28*Real.pi/3))/r^3 := by field_simp + rw [he] at H + exact H.trans (setIntegral_le_integral hi (Eventually.of_forall hn)) + +theorem PropagationInvariant.charge_deficit {B C r Z L : ℝ} {u μ p : Position → ℝ} + (d : PropagationInvariant B C r Z L u μ p) (hr : 0 Coulomb.countTest_one 0 hRp (by simpa using hx.trans hrR)) + have h3 := countTest_pairing_bound (F:=fun x => Z*coulombKernel x+u x) + ((measurable_const.mul measurable_coulombKernel).add d.continuous_offset.measurable) hC hRp + (fun x hx => by + have H := d.caps x (hrR.trans hx) + rw [abs_of_nonneg (((by positivity : (0:ℝ)≤(7/8:ℝ)*B/‖x‖^4).trans + (propagationBarrier_two_sided hB hr (hrR.trans hx)).1).trans H.1)] + exact H.2) + exact h1.trans (h2.trans (add_le_add le_rfl ((le_abs_self _).trans h3))) + have ht : Tendsto (fun R : ℝ => 4*Real.pi*D+C*I/R^3) atTop (𝓝 (4*Real.pi*D)) := by + have H : Tendsto (fun R : ℝ => R⁻¹^3) atTop (𝓝 (0:ℝ)) := by simpa using (tendsto_inv_atTop_zero (𝕜:=ℝ)).pow 3 + convert (tendsto_const_nhds (x:=C*I)).mul H |>.const_add (4*Real.pi*D) using 1 <;> + simp [div_eq_mul_inv,inv_pow] + have H := ge_of_tendsto ht he + apply (div_le_iff₀ (by positivity : 0<4*Real.pi*r^3)).mpr + have HH := (div_le_iff₀ (pow_pos hr 3)).mp H + nlinarith only [HH] + +lemma propagationDeficit_coefficient_pos {B : ℝ} (hB : 0 u x-l1/R^4,fun x => H x-l2/R^4,propagationBarrierOffset B R Z] + +def propagationCandidateSources (r R Z : ℝ) (u μ p b : Position → ℝ) : Fin 3 → Position → ℝ := + ![fun x => propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x), + fun x => 4*Real.pi*μ x,cutoffReaction R (fun x => Z*coulombKernel x+b x)] + +theorem propagation_finite_max_step {bad : Prop} {B C r R Z L l1 l2 e ξ hl hh : ℝ} + {u H μ p : Position → ℝ} {U : Set Position} (s : Finset (Fin 3)) (h0 : 0∈s) + (h1 : 1∈s ↔ ¬bad) (h2 : 2∈s → ∀ x∈U,R<‖x‖) + (hB : 0 propagationCoreSource R ‖x‖ (μ x) + (propagationStepError bad r R ‖x‖ (μ x) (p x)))) + (hbb : ∀ D : ℝ, ∃ K : ℝ, ∀ x∈Metric.closedBall 0 D, + |propagationCoreSource R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x))|≤K) + (hwu : WeakNuclearSubsolution (fun x => Z*coulombKernel x+u x) Z U + (fun x => propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x))) + (hwH : WeakNuclearSubsolution (fun x => Z*coulombKernel x+H x) Z U (fun x => 4*Real.pi*μ x)) + (hsmall : 4*Real.pi*kTF*Real.sqrt B≤19/2) + (hu : ∀ x,r≤‖x‖ → propagationBarrier B r x≤Z*coulombKernel x+u x ∧ + Z*coulombKernel x+u x≤C/‖x‖^4) + (hH : ¬bad → ∀ x,r≤‖x‖ → ‖x‖≤2*L*R → Z*coulombKernel x+H x≤C/‖x‖^4) + (hinv : ¬bad → ∀ x,r≤‖x‖ → ‖x‖≤2*L*R → ∀ h∈Icc hl hh, + (‖x‖^6*μ x≤Coulomb.tfScalarDensity h → ‖x‖^4*(Z*coulombKernel x+H x)≤h+ξ) ∧ + (Coulomb.tfScalarDensity h≤‖x‖^6*μ x → h-ξ≤‖x‖^4*(Z*coulombKernel x+H x))) + (hlo : ∀ x∈U,R≤‖x‖ → propagationBarrier B R x≤Z*coulombKernel x+ + s.sup' ⟨0,h0⟩ (fun i => propagationCandidates B R Z l1 l2 u H i x)) : + WeakNuclearSubsolution + (fun x => Z*coulombKernel x+s.sup' ⟨0,h0⟩ (fun i => propagationCandidates B R Z l1 l2 u H i x)) Z U + (fun x => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+s.sup' ⟨0,h0⟩ (fun i => propagationCandidates B R Z l1 l2 u H i x))) := by + have hRp : 0 Z*coulombKernel x+propagationCandidates B R Z l1 l2 u H i x) Z U + (propagationCandidateSources r R Z u μ p (propagationBarrierOffset B R Z) i) := by + intro i hi + fin_cases i + · exact hwu.sub_offset_const huc (l1/R^4) + · exact hwH.sub_offset_const hHc (l2/R^4) + · apply ((propagationBarrier_weak (Z:=Z) hB hRp hsmall).mono_domain (h2 hi)).congr_on (fun x hx => rfl) + intro x hx + simp [propagationCandidateSources,cutoffReaction,le_of_lt (h2 hi x hx),propagationBarrierOffset_eq] + have Hmax := WeakNuclearSubsolution.near_active_cutoffTF s ⟨0,h0⟩ + (propagationCandidates B R Z l1 l2 u H) + (propagationCandidateSources r R Z u μ p (propagationBarrierOffset B R Z)) + hRp hη hU hf hqi hb hbb hw + apply (Hmax ?_).congr_on (fun x hx => rfl) + · intro x hx + simp [propagationRHS,cutoffReaction,Set.indicator] + · intro i hi x hx hnear + change propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+propagationCandidates B R Z l1 l2 u H i x) ≤ _ + fin_cases i + · change propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+(u x-l1/R^4)) ≤ propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x) + rw [←add_sub_assoc] + apply propagation_old_source hrR hRp (hl2.trans hl21) + intro hbad hrx hRx + have hcand := Finset.le_sup' (f:=fun j => propagationCandidates B R Z l1 l2 u H j x) ((h1).2 hbad) + have hn : (Z*coulombKernel x+s.sup' ⟨0,h0⟩ (fun j => propagationCandidates B R Z l1 l2 u H j x))- + (Z*coulombKernel x+u x-l1/R^4)<2*e/R^4 := by + change (s.sup' ⟨0,h0⟩ (fun j => propagationCandidates B R Z l1 l2 u H j x))-(u x-l1/R^4)<2*(e/R^4) at hnear + rw [←mul_div_assoc] at hnear + linarith only [hnear] + have hc : Z*coulombKernel x+H x-l2/R^4≤ + Z*coulombKernel x+s.sup' ⟨0,h0⟩ (fun j => propagationCandidates B R Z l1 l2 u H j x) := by + change H x-l2/R^4 ≤ s.sup' ⟨0,h0⟩ (fun j => propagationCandidates B R Z l1 l2 u H j x) at hcand + linarith only [hcand] + have hhlo : hl≤(7/8:ℝ)*B := by + have ht : 0≤2*e*(2*L)^4 := by positivity + linarith only [hhl,ht] + exact propagation_near_old_gain (hl:=hl) (hh:=hh) hB.le hr hR hrx hhlo + hhh (hu x hrx) hξ hgap (fun a ha => (hinv hbad x hrx (hUb x hx) a ha).2) hc hn + · have hbad := h1.mp hi + change propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+(H x-l2/R^4)) ≤ 4*Real.pi*μ x + rw [←add_sub_assoc] + apply @propagation_physical_source _ _ _ _ _ _ _ ξ _ (hμ x) (hp x) + intro hRx + have hrx := hrR.trans hRx + apply propagation_near_physical_reaction hB.le hRp hL he.le hRx (hUb x hx) hhl hhh + (hH hbad x hrx (hUb x hx)) hξ hl2 hξl (hlo x hx hRx) + · change (s.sup' ⟨0,h0⟩ (fun j => propagationCandidates B R Z l1 l2 u H j x))-(H x-l2/R^4)<2*(e/R^4) at hnear + rw [←mul_div_assoc] at hnear + linarith only [hnear] + · exact fun a ha => (hinv hbad x hrx (hUb x hx) a ha).1 + · have hRx := (h2 hi x hx).le + simpa [propagationCandidates,propagationCandidateSources,cutoffReaction,hRx] using + (propagation_barrier_source (bad:=bad) (r:=r) (v:=Z*coulombKernel x+propagationBarrierOffset B R Z x) + hRx (hμ x) (hp x)) + +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +def propagationInnerIndices (bad : Prop) : Finset (Fin 3) := if bad then {0} else {0,1} +def propagationMiddleIndices (bad : Prop) : Finset (Fin 3) := insert 2 (propagationInnerIndices bad) + +lemma zero_mem_propagationInnerIndices (bad : Prop) : (0:Fin 3)∈propagationInnerIndices bad := by + by_cases h : bad <;> simp [propagationInnerIndices,h] +lemma one_mem_propagationInnerIndices (bad : Prop) : (1:Fin 3)∈propagationInnerIndices bad ↔ ¬bad := by + by_cases h : bad <;> simp [propagationInnerIndices,h] +lemma two_not_mem_propagationInnerIndices (bad : Prop) : (2:Fin 3)∉propagationInnerIndices bad := by + by_cases h : bad <;> simp [propagationInnerIndices,h] +lemma zero_mem_propagationMiddleIndices (bad : Prop) : (0:Fin 3)∈propagationMiddleIndices bad := + Finset.mem_insert_of_mem (zero_mem_propagationInnerIndices bad) +lemma one_mem_propagationMiddleIndices (bad : Prop) : (1:Fin 3)∈propagationMiddleIndices bad ↔ ¬bad := by + simp [propagationMiddleIndices,one_mem_propagationInnerIndices] +lemma two_mem_propagationMiddleIndices (bad : Prop) : (2:Fin 3)∈propagationMiddleIndices bad := + Finset.mem_insert_self _ _ + +lemma propagationInner_sup (bad : Prop) (B R Z l1 l2 : ℝ) (u H : Position → ℝ) (x : Position) : + (propagationInnerIndices bad).sup' ⟨0,zero_mem_propagationInnerIndices bad⟩ + (fun i => propagationCandidates B R Z l1 l2 u H i x)=propagationPairOffset bad R l1 l2 u H x := by + by_cases h : bad <;> simp [propagationInnerIndices,propagationCandidates,propagationPairOffset,h] + +lemma propagationMiddle_sup (bad : Prop) (B R Z l1 l2 : ℝ) (u H : Position → ℝ) (x : Position) : + (propagationMiddleIndices bad).sup' ⟨0,zero_mem_propagationMiddleIndices bad⟩ + (fun i => propagationCandidates B R Z l1 l2 u H i x)= + max (propagationPairOffset bad R l1 l2 u H x) (propagationBarrierOffset B R Z x) := by + change (insert 2 (propagationInnerIndices bad)).sup' _ _=_ + rw [Finset.sup'_insert ⟨0,zero_mem_propagationInnerIndices bad⟩,propagationInner_sup] + exact max_comm _ _ + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationPosteriorMass.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationPosteriorMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a41ce5f9d21cc4d9be5cb81c65aa8fca7251454 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationPosteriorMass.lean @@ -0,0 +1,43 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.InitialDatum + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Step +variable {Ω A : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [Nonempty Ω] [MeasurableSpace A] +variable {P : Measure Ω} [IsProbabilityMeasure P] {B C r R Z L l1 l2 e ξ hl hh : ℝ} +variable {μ μ' H : Ω → Position → ℝ} {bad : Ω → Prop} +lemma PropagationDatum.posteriorStep_total (d : PropagationDatum P B C r Z L μ) + (obs : Ω → A) (ho : Measurable obs) (hR : 0 propagationStepError (bad o) r R ‖x‖ (μ o x) (d.error o x) + change (∫ o,(∫ x,posteriorAverage P obs q (obs o) x) ∂P)=_ + have hq := propagationStepError_joint_measurable (r:=r) (R:=R) hb hμ d.error_measurable + have hqb := propagationStepError_uniform_bounds (bad:=bad) (r:=r) (R:=R) hbμ d.error_bounds + have hqs : ∀ᵐ o ∂P,∀ x,R≤‖x‖ → q o x=0 := by + filter_upwards [d.invariant,hstep] with o hi hs + exact (hs.next_invariant hi.error_support).error_support + rw [posteriorAverage_total_integral (f:=q) (P:=P) obs ho hq hqb hqs] + exact propagationStepError_total hμ hb hbμ d.error_product_integrable +end Step +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationPosteriorStep.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationPosteriorStep.lean new file mode 100644 index 0000000000000000000000000000000000000000..b38bdd15a1800fba6ed3d2467d08f5b1d08e858f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationPosteriorStep.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorDensityContinuity + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +structure PropagationDatum {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + (B C r Z L : ℝ) (μ : Ω → Position → ℝ) where + offset : Ω → Position → ℝ + error : Ω → Position → ℝ + offset_measurable : Measurable (Function.uncurry offset) + error_measurable : Measurable (Function.uncurry error) + offset_bounds : ∀ D : ℝ,∃ A : ℝ,∀ o x,x∈Metric.closedBall 0 D → |offset o x|≤A + error_bounds : ∀ D : ℝ,∃ A : ℝ,∀ o x,x∈Metric.closedBall 0 D → |error o x|≤A + invariant : ∀ᵐ o ∂P,PropagationInvariant B C r Z L (offset o) (μ o) (error o) + +section Step +variable {Ω A : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [Nonempty Ω] [MeasurableSpace A] +variable {P : Measure Ω} [IsProbabilityMeasure P] {B C r R Z L l1 l2 e ξ hl hh : ℝ} +variable {μ μ' H : Ω → Position → ℝ} {bad : Ω → Prop} + +def PropagationDatum.posteriorStep (d : PropagationDatum P B C r Z L μ) + (obs : Ω → A) (ho : Measurable obs) (hR : 0 propagationNextOffset (bad o) B R Z L l1 l2 (d.offset o) (H o) + let q := fun o x => propagationStepError (bad o) r R ‖x‖ (μ o x) (d.error o x) + have hv := propagationNextOffset_joint_measurable (B:=B) (Z:=Z) (L:=L) (l1:=l1) (l2:=l2) + hR hb d.offset_measurable hH + have hq := propagationStepError_joint_measurable (r:=r) (R:=R) hb hμ d.error_measurable + have hvb := propagationNextOffset_uniform_bounds (bad:=bad) (B:=B) (Z:=Z) (L:=L) (l1:=l1) (l2:=l2) + hR d.offset_bounds hbH + have hqb := propagationStepError_uniform_bounds (bad:=bad) (r:=r) (R:=R) hbμ d.error_bounds + refine ⟨fun o => posteriorAverage P obs v (obs o),fun o => posteriorAverage P obs q (obs o), + (posteriorAverage_joint_measurable P obs (f:=v) hv).comp (ho.prodMap measurable_id), + (posteriorAverage_joint_measurable P obs (f:=q) hq).comp (ho.prodMap measurable_id),?_,?_,?_⟩ + · intro D + obtain ⟨K,hK⟩ := posteriorAverage_uniform_bounds P obs hvb D + exact ⟨K,fun o => hK (obs o)⟩ + · intro D + obtain ⟨K,hK⟩ := posteriorAverage_uniform_bounds P obs hqb D + exact ⟨K,fun o => hK (obs o)⟩ + · have hi : ∀ᵐ o ∂P,PropagationInvariant B C R Z L (v o) (μ o) (q o) := by + filter_upwards [d.invariant,hstep] with o hoi hos + exact hos.next_invariant hoi.error_support + have Havg := posteriorAverage_invariant P obs hR ho hi hv hμ hq hvb hbμ hqb + filter_upwards [Havg,htower] with o hi ht + simpa only [ht] using hi +end Step +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationRegularity.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..d41b3f8af6c72aa799e534024bb9280075faf3d9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationRegularity.lean @@ -0,0 +1,219 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationMaximum + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma propagationCoreSource_measurable {r : ℝ} {μ p : Position → ℝ} + (hμ : Measurable μ) (hp : Measurable p) : + Measurable (fun x => propagationCoreSource r ‖x‖ (μ x) (p x)) := by + exact measurable_const.mul ((hμ.ite (isOpen_lt continuous_norm continuous_const).measurableSet measurable_const).sub hp) + +lemma propagationStepError_measurable (bad : Prop) (r R : ℝ) {μ p : Position → ℝ} + (hμ : Measurable μ) (hp : Measurable p) : + Measurable (fun x => propagationStepError bad r R ‖x‖ (μ x) (p x)) := by + unfold propagationStepError + by_cases hb : bad + · simp only [hb,true_and] + exact hp.add (hμ.ite ((isClosed_le continuous_const continuous_norm).measurableSet.inter + (isOpen_lt continuous_norm continuous_const).measurableSet) measurable_const) + · simpa only [hb,false_and,ite_false,add_zero] using hp + +lemma propagationCoreSource_abs_bound {r d μ p M P : ℝ} (hμ : |μ|≤M) (hp : |p|≤P) : + |propagationCoreSource r d μ p|≤4*Real.pi*(M+P) := by + have hm : |if d propagationCoreSource_abs_bound (hM x hx) (hP x hx)⟩ + +lemma propagationStepError_ball_bounds {bad : Prop} {r R : ℝ} {μ p : Position → ℝ} + (hμ : ∀ D : ℝ,∃ M : ℝ,∀ x∈Metric.closedBall 0 D,|μ x|≤M) + (hp : ∀ D : ℝ,∃ P : ℝ,∀ x∈Metric.closedBall 0 D,|p x|≤P) : + ∀ D : ℝ,∃ K : ℝ,∀ x∈Metric.closedBall 0 D,|propagationStepError bad r R ‖x‖ (μ x) (p x)|≤K := by + intro D + obtain ⟨M,hM⟩ := hμ D + obtain ⟨P,hP⟩ := hp D + exact ⟨P+M,fun x hx => propagationStepError_abs_bound (hM x hx) (hP x hx)⟩ + +lemma propagationRHS_locallyIntegrable {r Z : ℝ} {u μ p : Position → ℝ} (hr : 0 propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x)) volume := by + have H : LocallyIntegrable (fun x => propagationCoreSource r ‖x‖ (μ x) (p x)+ + cutoffReaction r (fun y => Z*coulombKernel y+u y) x) volume := (locallyIntegrable_of_ball_bounds (propagationCoreSource_measurable (r:=r) hμ hp) + (propagationCoreSource_ball_bounds (r:=r) hbμ hbp)).add (cutoffReaction_offset_locallyIntegrable (Z:=Z) hr hu) + simpa only [propagationRHS_eq] using H + +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +theorem WeakNuclearSubsolution.radialMaxSplice {α β a b c e Z : ℝ} + {f g : Position → ℝ} {q : Position → ℝ → ℝ} + (hbα : b<α) (hαa : α q x (radialMaxSplice α β f g x)) volume) + (hinner : WeakNuclearSubsolution (fun x => Z*coulombKernel x+f x) Z {x | ‖x‖ q x (f x))) + (hmiddle : WeakNuclearSubsolution (fun x => Z*coulombKernel x+max (f x) (g x)) Z + {x | b<‖x‖ ∧ ‖x‖ q x (max (f x) (g x)))) + (houter : WeakNuclearSubsolution (fun x => Z*coulombKernel x+g x) Z {x | e<‖x‖} (fun x => q x (g x))) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+radialMaxSplice α β f g x) Z univ + (fun x => q x (radialMaxSplice α β f g x)) := by + apply WeakNuclearSubsolution.of_local + (continuous_radialMaxSplice hbα hαa hae heβ hβc hf hg hlow hupp) hqi + intro x hx + by_cases hxa : ‖x‖ Z*coulombKernel x+u x) Z univ + (fun x => propagationRHS r ‖x‖ (μ x) (p x) (Z*coulombKernel x+u x)) + H_weak : WeakNuclearSubsolution (fun x => Z*coulombKernel x+H x) Z univ (fun x => 4*Real.pi*μ x) + barrier_small : 4*Real.pi*kTF*Real.sqrt B≤19/2 + old_caps : ∀ x,r≤‖x‖ → propagationBarrier B r x≤Z*coulombKernel x+u x ∧ + Z*coulombKernel x+u x≤C/‖x‖^4 + physical_cap : ¬bad → ∀ x,r≤‖x‖ → ‖x‖≤2*L*R → Z*coulombKernel x+H x≤C/‖x‖^4 + inverse : ¬bad → ∀ x,r≤‖x‖ → ‖x‖≤2*L*R → ∀ h∈Icc hl hh, + (‖x‖^6*μ x≤Coulomb.tfScalarDensity h → ‖x‖^4*(Z*coulombKernel x+H x)≤h+ξ) ∧ + (Coulomb.tfScalarDensity h≤‖x‖^6*μ x → h-ξ≤‖x‖^4*(Z*coulombKernel x+H x)) + +namespace PropagationStepHypotheses +variable {bad : Prop} {B C r R Z L l1 l2 e ξ hl hh : ℝ} {u H μ p : Position → ℝ} +variable (d : PropagationStepHypotheses bad B C r R Z L l1 l2 e ξ hl hh u H μ p) +include d + +lemma R_pos : 0 propagationStepError bad r R ‖x‖ (μ x) (p x)) := + propagationStepError_measurable bad r R d.mu_measurable d.p_measurable +lemma step_error_bounds : ∀ D : ℝ,∃ K : ℝ,∀ x∈Metric.closedBall 0 D, + |propagationStepError bad r R ‖x‖ (μ x) (p x)|≤K := + propagationStepError_ball_bounds d.mu_bounds d.p_bounds + +lemma finite_step {U : Set Position} (s : Finset (Fin 3)) (h0 : 0∈s) + (h1 : 1∈s ↔ ¬bad) (h2 : 2∈s → ∀ x∈U,R<‖x‖) + (hU : IsOpen U) (hUb : ∀ x∈U,‖x‖≤2*L*R) + (hlo : ∀ x∈U,R≤‖x‖ → propagationBarrier B R x≤Z*coulombKernel x+ + s.sup' ⟨0,h0⟩ (fun i => propagationCandidates B R Z l1 l2 u H i x)) : + WeakNuclearSubsolution + (fun x => Z*coulombKernel x+s.sup' ⟨0,h0⟩ (fun i => propagationCandidates B R Z l1 l2 u H i x)) Z U + (fun x => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+s.sup' ⟨0,h0⟩ (fun i => propagationCandidates B R Z l1 l2 u H i x))) := by + have hqi : ∀ i∈s,LocallyIntegrable + (propagationCandidateSources r R Z u μ p (propagationBarrierOffset B R Z) i) volume := by + intro i hi + fin_cases i + · exact propagationRHS_locallyIntegrable d.r_pos d.u_cont d.mu_measurable d.p_measurable d.mu_bounds d.p_bounds + · exact (locallyIntegrable_of_ball_bounds d.mu_measurable d.mu_bounds).smul (4*Real.pi) + · exact cutoffReaction_offset_locallyIntegrable d.R_pos (propagationBarrierOffset_continuous B Z d.R_pos) + exact propagation_finite_max_step s h0 h1 h2 d.B_pos d.r_pos d.R_eq d.L_pos.le + d.l2_nonneg d.l2_le_l1 d.e_pos d.xi_nonneg d.xi_lt_l2 d.gain_gap d.height_lower d.height_upper + hU hUb d.u_cont d.H_cont d.mu_nonneg d.p_nonneg hqi + (propagationCoreSource_measurable d.mu_measurable d.step_error_measurable) + (propagationCoreSource_ball_bounds d.mu_bounds d.step_error_bounds) + (d.u_weak.mono_domain (subset_univ _)) (d.H_weak.mono_domain (subset_univ _)) + d.barrier_small d.old_caps d.physical_cap d.inverse hlo + +end PropagationStepHypotheses +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationStepWeak.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationStepWeak.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4ffd7c9fa4f1a9d3e3a56027b0c88dda03b498e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/PropagationStepWeak.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationRegularity + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +namespace PropagationStepHypotheses +variable {bad : Prop} {B C r R Z L l1 l2 e ξ hl hh : ℝ} {u H μ p : Position → ℝ} +variable (d : PropagationStepHypotheses bad B C r R Z L l1 l2 e ξ hl hh u H μ p) +include d + +lemma lower_pair {x : Position} (hx : R≤‖x‖) (hx' : ‖x‖≤(11/10)*R) : + propagationBarrier B R x≤Z*coulombKernel x+propagationPairOffset bad R l1 l2 u H x := by + have Hold := propagation_old_lower_overlap d.B_pos d.r_pos d.R_eq d.l1_le_gamma hx hx' + (d.old_caps x (d.old_le_new.trans hx)).1 + have H' := Hold.trans (le_propagationPairOffset bad R l1 l2 u H x) + have he := propagationBarrierOffset_eq (B:=B) (Z:=Z) hx + linarith only [H',he] + +lemma inner_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+propagationPairOffset bad R l1 l2 u H x) Z {x | ‖x‖<(27/25)*R} + (fun x => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+propagationPairOffset bad R l1 l2 u H x)) := by + have hh : (27/25)*R≤2*L*R := by nlinarith only [mul_pos (show 0<2*L-27/25 by linarith only [d.L_large]) d.R_pos] + have Hmax := d.finite_step (U:={x | ‖x‖<(27/25)*R}) (propagationInnerIndices bad) + (zero_mem_propagationInnerIndices bad) (one_mem_propagationInnerIndices bad) + (fun hi => False.elim (two_not_mem_propagationInnerIndices bad hi)) + (isOpen_lt continuous_norm continuous_const) (fun x hx => hx.le.trans hh) + (fun x hx hxR => by + rw [propagationInner_sup] + exact d.lower_pair hxR (by + change ‖x‖ < (27/25)*R at hx + linarith only [hx,d.R_pos])) + simpa only [propagationInner_sup] using Hmax + +lemma middle_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+max (propagationPairOffset bad R l1 l2 u H x) (propagationBarrierOffset B R Z x)) Z + {x | (26/25)*R<‖x‖ ∧ ‖x‖<2*L*R} + (fun x => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+max (propagationPairOffset bad R l1 l2 u H x) (propagationBarrierOffset B R Z x))) := by + have Hmax := d.finite_step (U:={x | (26/25)*R<‖x‖ ∧ ‖x‖<2*L*R}) (propagationMiddleIndices bad) + (zero_mem_propagationMiddleIndices bad) (one_mem_propagationMiddleIndices bad) + (fun hi x hx => by linarith only [hx.1,d.R_pos]) + ((isOpen_lt continuous_const continuous_norm).inter (isOpen_lt continuous_norm continuous_const)) + (fun x hx => hx.2.le) (fun x hx hxR => by + rw [propagationMiddle_sup] + have H := le_max_right (propagationPairOffset bad R l1 l2 u H x) (propagationBarrierOffset B R Z x) + have he := propagationBarrierOffset_eq (B:=B) (Z:=Z) hxR + linarith only [H,he]) + simpa only [propagationMiddle_sup] using Hmax + +lemma outer_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+propagationBarrierOffset B R Z x) Z {x | L*R<‖x‖} + (fun x => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+propagationBarrierOffset B R Z x)) := by + have hsub : {x : Position | L*R<‖x‖}⊆{x | R<‖x‖} := by + intro x hx + have hh : R Z*coulombKernel x+propagationBarrierOffset B R Z x) Z {x | L*R<‖x‖} + (cutoffReaction R (fun x => Z*coulombKernel x+propagationBarrierOffset B R Z x)) := by + apply ((propagationBarrier_weak (Z:=Z) d.B_pos d.R_pos d.barrier_small).mono_domain hsub).congr_on (fun x hx => rfl) + intro x hx + have hRx : R ≤ ‖x‖ := le_of_lt (hsub hx) + simp [cutoffReaction,hRx,propagationBarrierOffset_eq hRx] + apply (weakNuclearSubsolution_offset_iff hbc).2 + apply ((weakNuclearSubsolution_offset_iff hbc).1 Hbar).mono_source_on + (cutoffReaction_offset_locallyIntegrable d.R_pos hbc) + (propagationRHS_locallyIntegrable d.R_pos hbc d.mu_measurable d.step_error_measurable d.mu_bounds d.step_error_bounds) + exact Eventually.of_forall (fun x hx => by + have hRx : R ≤ ‖x‖ := le_of_lt (hsub hx) + simpa [cutoffReaction,hRx] using + (propagation_barrier_source (bad:=bad) (r:=r) (v:=Z*coulombKernel x+propagationBarrierOffset B R Z x) + hRx (d.mu_nonneg x) (d.p_nonneg x))) + +theorem next_weak : WeakNuclearSubsolution + (fun x => Z*coulombKernel x+propagationNextOffset bad B R Z L l1 l2 u H x) Z univ + (fun x => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) + (Z*coulombKernel x+propagationNextOffset bad B R Z L l1 l2 u H x)) := by + obtain ⟨hlo,hup⟩ := propagation_splice_overlaps d.B_pos d.r_pos d.R_eq d.L_large d.l2_nonneg + d.l2_le_l1 d.l1_le_gamma d.upper_overlap d.old_caps d.physical_cap + apply WeakNuclearSubsolution.radialMaxSplice + (a:=(27/25)*R) (b:=(26/25)*R) (e:=L*R) (c:=2*L*R) + (q:=fun x v => propagationRHS R ‖x‖ (μ x) (propagationStepError bad r R ‖x‖ (μ x) (p x)) (Z*coulombKernel x+v)) + · linarith only [d.R_pos] + · linarith only [d.R_pos] + · nlinarith only [mul_pos (show 0 radialMaxSplice α β (f z.1) (g z.1) z.2) := by + exact hf.ite (measurableSet_lt (continuous_norm.measurable.comp measurable_snd) measurable_const) + ((hf.max hg).ite (measurableSet_lt (continuous_norm.measurable.comp measurable_snd) measurable_const) hg) + +lemma radialMaxSplice_abs_bound {α β A B : ℝ} {f g : Position → ℝ} {x : Position} + (hf : |f x|≤A) (hg : |g x|≤B) : |radialMaxSplice α β f g x| ≤ max A B := by + unfold radialMaxSplice + split_ifs + · exact hf.trans (le_max_left _ _) + · have hAf : -(max A B)≤f x := (neg_le_neg (le_max_left A B)).trans ((abs_le.mp hf).1) + have hBf : f x ≤ max A B := (abs_le.mp hf).2.trans (le_max_left _ _) + have hAg : g x ≤ max A B := (abs_le.mp hg).2.trans (le_max_right _ _) + exact abs_le.mpr ⟨hAf.trans (le_max_left _ _),max_le hBf hAg⟩ + · exact hg.trans (le_max_right _ _) + +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +def propagationPairOffset (bad : Prop) (R l1 l2 : ℝ) (u H : Position → ℝ) (x : Position) : ℝ := + if bad then u x-l1/R^4 else max (u x-l1/R^4) (H x-l2/R^4) + +def propagationNextOffset (bad : Prop) (B R Z L l1 l2 : ℝ) (u H : Position → ℝ) : Position → ℝ := + radialMaxSplice ((53/50)*R) ((3/2)*L*R) + (propagationPairOffset bad R l1 l2 u H) (propagationBarrierOffset B R Z) + +lemma propagationPairOffset_continuous (bad : Prop) (R l1 l2 : ℝ) {u H : Position → ℝ} + (hu : Continuous u) (hH : Continuous H) : Continuous (propagationPairOffset bad R l1 l2 u H) := by + change Continuous (fun x => if bad then u x-l1/R^4 else max (u x-l1/R^4) (H x-l2/R^4)) + by_cases hb : bad + · simp only [ite_eq_left hb] + exact hu.sub continuous_const + · simp only [ite_eq_right hb] + exact (hu.sub continuous_const).max (hH.sub continuous_const) + +lemma le_propagationPairOffset (bad : Prop) (R l1 l2 : ℝ) (u H : Position → ℝ) (x : Position) : + u x-l1/R^4 ≤ propagationPairOffset bad R l1 l2 u H x := by + unfold propagationPairOffset + split_ifs + · rfl + · exact le_max_left _ _ + +lemma propagation_shift_cap_nonpos {C d R L l v : ℝ} (hR : 0 ∫ x,d.error o x + have hXm : Measurable X := d.error_measurable.stronglyMeasurable.integral_prod_right.measurable + have hXi : Integrable X P := d.error_product_integrable.integral_prod_left + have hXp : 0 ≤ᵐ[P] X := d.invariant.mono (fun o ho => integral_nonneg ho.nonnegative_error) + let A := {o | X o ≤ 1} + have hA : MeasurableSet A := measurableSet_le hXm measurable_const + have hAp : P.real Aᶜ ≤ M := by + calc + P.real Aᶜ ≤ P.real {o | 1 ≤ X o} := measureReal_mono (by intro o ho; change ¬ X o ≤ 1 at ho; exact (lt_of_not_ge ho).le) + _ ≤ ∫ o,X o ∂P := by simpa only [one_mul] using mul_meas_ge_le_integral_of_nonneg hXp hXi 1 + _ ≤ M := hcost + refine ⟨W∩A,hW.inter hA,?_,?_⟩ + · rw [compl_inter] + exact (measureReal_union_le _ _).trans (by simpa only [hWzero,zero_add] using add_le_add (le_refl (P.real Wᶜ)) hAp) + · intro o ho + have hb : o∉bad := fun hb => ho.1 (subset_toMeasurable P bad hb) + exact ⟨(not_not.mp hb).1,(not_not.mp hb).2,ho.2⟩ + +lemma PropagationDatum.error_global_bound {Ω : Type*} [MeasurableSpace Ω] + {P : Measure Ω} {B C r Z L : ℝ} {μ : Ω → Position → ℝ} + (d : PropagationDatum P B C r Z L μ) : + ∃ A : ℝ,∀ o,PropagationInvariant B C r Z L (d.offset o) (μ o) (d.error o) → + ∀ x,d.error o x ≤ A := by + obtain ⟨A,hA⟩ := d.error_bounds r + refine ⟨max A 0,?_⟩ + intro o ho x + by_cases hx : ‖x‖ ≤ r + · exact (le_abs_self _).trans ((hA o x (by simpa only [Metric.mem_closedBall,dist_zero_right] using hx)).trans (le_max_left _ _)) + · rw [ho.error_support x (le_of_not_ge hx)] + exact le_max_right _ _ +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/SmoothMaximum.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/SmoothMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..52c873c7b7edb9547adde82550502d2016d78f32 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/SmoothMaximum.lean @@ -0,0 +1,243 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.WeakLaplacian + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +def softAbs (e x : ℝ) := Real.sqrt (x^2+e^2) +def softSlope (e x : ℝ) := x/softAbs e x +def softWeight (e x : ℝ) := (1+softSlope e x)/2 +def softPlus (e x : ℝ) := (x+softAbs e x)/2 +def softMax (e a b : ℝ) := b+softPlus e (a-b) + +lemma softAbs_pos {e : ℝ} (he : 0 linarith + +lemma softAbs_hasDerivAt {e : ℝ} (he : 0.add contDiff_const).sqrt + intro x + nlinarith [sq_nonneg x] + +lemma contDiff_softPlus {e : ℝ} (he : 0 softMax e (f x) (g x)) := + hg.add ((contDiff_softPlus he).comp (hf.sub hg)) + +lemma second_deriv_comp_scalar {f h : ℝ → ℝ} (hf : ContDiff ℝ 2 f) + (hh : ContDiff ℝ 2 h) (x : ℝ) : + deriv (deriv (fun t => h (f t))) x= + deriv (deriv h) (f x)*(deriv f x)^2+deriv h (f x)*deriv (deriv f) x := by + have hd : deriv (fun t => h (f t))=fun t => deriv h (f t)*deriv f t := by + funext t + exact ((hh.differentiable (by norm_num) (f t)).hasDerivAt.comp t + (hf.differentiable (by norm_num) t).hasDerivAt).deriv + rw [hd] + have hh' : Differentiable ℝ (deriv h) := hh.differentiable_deriv_two + have hf' : Differentiable ℝ (deriv f) := hf.differentiable_deriv_two + have H := ((hh' (f x)).hasDerivAt.comp x (hf.differentiable (by norm_num) x).hasDerivAt).mul + (hf' x).hasDerivAt + change deriv ((deriv h ∘ f)*deriv f) x=_ + rw [H.deriv] + simp only [Function.comp_def] + ring + +lemma second_deriv_softPlus {e : ℝ} (he : 0 (softPlus_hasDerivAt he x).deriv) + rw [h] + exact (softWeight_hasDerivAt he x).deriv + +lemma coordinateLaplacian_comp_scalar {f : Position → ℝ} {h : ℝ → ℝ} + (hf : ContDiff ℝ 2 f) (hh : ContDiff ℝ 2 h) (x : Position) : + coordinateLaplacian (fun y => h (f y)) x= + deriv (deriv h) (f x)*(∑ a : Fin 3, (deriv (fun t : ℝ => f (x+t • axis a)) 0)^2)+ + deriv h (f x)*coordinateLaplacian f x := by + unfold coordinateLaplacian + have H (a : Fin 3) : ContDiff ℝ 2 (fun t : ℝ => f (x+t • axis a)) := + hf.comp (contDiff_const.add (contDiff_id.smul contDiff_const)) + simp_rw [second_deriv_comp_scalar (H _) hh,zero_smul,add_zero] + rw [Finset.sum_add_distrib,Finset.mul_sum,Finset.mul_sum] + +lemma coordinateLaplacian_softMax_lower {e : ℝ} (he : 0 softMax e (f y) (g y)) x := by + have hf2 : ContDiff ℝ 2 f := hf.of_le (by exact WithTop.coe_le_coe.mpr le_top) + have hg2 : ContDiff ℝ 2 g := hg.of_le (by exact WithTop.coe_le_coe.mpr le_top) + have hs2 : ContDiff ℝ 2 (softPlus e) := (contDiff_softPlus he).of_le (by exact WithTop.coe_le_coe.mpr le_top) + unfold softMax + have hcomp : ContDiff ℝ 2 (fun y => softPlus e (f y-g y)) := hs2.comp (hf2.sub hg2) + rw [coordinateLaplacian_add_at hg2.contDiffAt hcomp.contDiffAt, + coordinateLaplacian_comp_scalar (hf2.sub hg2) hs2,second_deriv_softPlus he, + (softPlus_hasDerivAt he _).deriv,coordinateLaplacian_sub hf2 hg2] + have H : 0≤e^2/(2*(softAbs e (f x-g x))^3)* + (∑ a : Fin 3, (deriv (fun t : ℝ => f (x+t • axis a)-g (x+t • axis a)) 0)^2) := by + apply mul_nonneg + · have hp := softAbs_pos he (f x-g x) + positivity + · exact Finset.sum_nonneg (fun _ _ => sq_nonneg _) + nlinarith + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +lemma softAbs_le {e : ℝ} (he : 0≤ e) (x : ℝ) : softAbs e x≤ |x|+e := by + have h := softAbs_sq e x + have h0 : 0≤ softAbs e x := Real.sqrt_nonneg _ + nlinarith [abs_nonneg x,sq_abs x,mul_nonneg (abs_nonneg x) he] + +lemma softMax_zero (a b : ℝ) : softMax 0 a b=max a b := by + unfold softMax softPlus softAbs + simp only [zero_pow (by decide : 2≠0),add_zero,Real.sqrt_sq_eq_abs] + by_cases h : b≤ a + · rw [abs_of_nonneg (sub_nonneg.mpr h),max_eq_left h] + ring + · rw [abs_of_nonpos (sub_nonpos.mpr (le_of_not_ge h)),max_eq_right (le_of_not_ge h)] + ring + +lemma softMax_bounds {e : ℝ} (he : 0≤ e) (a b : ℝ) : + max a b≤ softMax e a b ∧ softMax e a b≤ max a b+e/2 := by + have h1 := abs_le_softAbs e (a-b) + have h2 := softAbs_le he (a-b) + have hz := softMax_zero a b + unfold softMax softPlus softAbs at hz + simp only [zero_pow (by decide : 2≠0),add_zero,Real.sqrt_sq_eq_abs] at hz + unfold softMax softPlus + constructor <;> linarith + +lemma softMax_abs_le {e a b A B : ℝ} (he : 0≤ e) (ha : |a|≤ A) (hb : |b|≤ B) : + |softMax e a b|≤ A+B+e := by + have h := softMax_bounds he a b + have hA := (abs_nonneg a).trans ha + have hB := (abs_nonneg b).trans hb + have hu : max a b≤ A+B := max_le (by linarith [(le_abs_self a).trans ha]) (by linarith [(le_abs_self b).trans hb]) + have hl : -(A+B)≤ max a b := by linarith [(abs_le.mp ha).1,le_max_left a b] + exact abs_le.mpr ⟨by linarith,by linarith⟩ + +lemma softMax_tendsto {e a b : ℕ → ℝ} {A B : ℝ} + (he : Tendsto e atTop (𝓝 0)) (ha : Tendsto a atTop (𝓝 A)) (hb : Tendsto b atTop (𝓝 B)) : + Tendsto (fun n => softMax (e n) (a n) (b n)) atTop (𝓝 (max A B)) := by + have h := hb.add (((ha.sub hb).add (((ha.sub hb).pow 2).add (he.pow 2)).sqrt).div_const 2) + simpa only [softMax,softPlus,softAbs,←softMax_zero] using h + +lemma softWeight_tendsto_of_lt {e a b : ℕ → ℝ} {A B : ℝ} + (he : Tendsto e atTop (𝓝 0)) (ha : Tendsto a atTop (𝓝 A)) (hb : Tendsto b atTop (𝓝 B)) + (hAB : B softWeight (e n) (a n-b n)) atTop (𝓝 1) := by + have hs : Tendsto (fun n => softAbs (e n) (a n-b n)) atTop (𝓝 (A-B)) := by + have H := (((ha.sub hb).pow 2).add (he.pow 2)).sqrt + simpa only [softAbs,zero_pow (by decide : 2≠0),add_zero,Real.sqrt_sq_eq_abs, + abs_of_pos (sub_pos.mpr hAB)] using H + have h1 : Tendsto (fun _ : ℕ => (1:ℝ)) atTop (𝓝 1) := tendsto_const_nhds + have H := (h1.add ((ha.sub hb).div hs (ne_of_gt (sub_pos.mpr hAB)))).div_const 2 + simpa only [softWeight,softSlope,Pi.div_apply,div_self (ne_of_gt (sub_pos.mpr hAB)),one_add_one_eq_two,div_self (by norm_num : (2:ℝ)≠0)] using H + +lemma softWeight_tendsto_of_gt {e a b : ℕ → ℝ} {A B : ℝ} + (he : Tendsto e atTop (𝓝 0)) (ha : Tendsto a atTop (𝓝 A)) (hb : Tendsto b atTop (𝓝 B)) + (hAB : A softWeight (e n) (a n-b n)) atTop (𝓝 0) := by + have hs : Tendsto (fun n => softAbs (e n) (a n-b n)) atTop (𝓝 (B-A)) := by + have H := (((ha.sub hb).pow 2).add (he.pow 2)).sqrt + simpa only [softAbs,zero_pow (by decide : 2≠0),add_zero,Real.sqrt_sq_eq_abs, + abs_of_neg (sub_neg.mpr hAB),neg_sub] using H + have h1 : Tendsto (fun _ : ℕ => (1:ℝ)) atTop (𝓝 1) := tendsto_const_nhds + have H := (h1.add ((ha.sub hb).div hs (ne_of_gt (sub_pos.mpr hAB)))).div_const 2 + have hr : (A-B)/(B-A)= -1 := by rw [show A-B= -(B-A) by ring,neg_div,div_self (ne_of_gt (sub_pos.mpr hAB))] + simpa only [softWeight,softSlope,Pi.div_apply,hr,add_neg_cancel,zero_div] using H + +lemma convex_pair_bounds {p u v : ℝ} (hp : 0≤ p) (hp1 : p≤ 1) : + min u v≤ p*u+(1-p)*v ∧ p*u+(1-p)*v≤ max u v := by + by_cases h : u≤ v + · rw [min_eq_left h,max_eq_right h] + constructor <;> nlinarith [mul_nonneg hp (sub_nonneg.mpr h),mul_nonneg (sub_nonneg.mpr hp1) (sub_nonneg.mpr h)] + · have h := le_of_not_ge h + rw [min_eq_right h,max_eq_left h] + constructor <;> nlinarith [mul_nonneg hp (sub_nonneg.mpr h),mul_nonneg (sub_nonneg.mpr hp1) (sub_nonneg.mpr h)] + +lemma softWeight_response_tendsto {e a b q r : ℕ → ℝ} {A B Q R : ℝ} + (he : Tendsto e atTop (𝓝 0)) (hep : ∀ n,0 softWeight (e n) (a n-b n)*q n+ + (1-softWeight (e n) (a n-b n))*r n) atTop (𝓝 (if B≤ A then Q else R)) := by + have h1 : Tendsto (fun _ : ℕ => (1:ℝ)) atTop (𝓝 1) := tendsto_const_nhds + rcases lt_trichotomy A B with h|h|h + · rw [ite_eq_right (not_le.mpr h)] + have hw := softWeight_tendsto_of_gt he ha hb h + simpa using (hw.mul hq).add ((h1.sub hw).mul hr) + · have hQR := htie h + rw [ite_eq_left h.ge,hQR] + rw [hQR] at hq + apply (show Tendsto (fun n => min (q n) (r n)) atTop (𝓝 R) by simpa using hq.min hr).squeeze + (show Tendsto (fun n => max (q n) (r n)) atTop (𝓝 R) by simpa using hq.max hr) + · intro n; exact (convex_pair_bounds (softWeight_bounds (hep n) _).1 (softWeight_bounds (hep n) _).2).1 + · intro n; exact (convex_pair_bounds (softWeight_bounds (hep n) _).1 (softWeight_bounds (hep n) _).2).2 + · rw [ite_eq_left h.le] + have hw := softWeight_tendsto_of_lt he ha hb h + simpa using (hw.mul hq).add ((h1.sub hw).mul hr) + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/TfReaction.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/TfReaction.lean new file mode 100644 index 0000000000000000000000000000000000000000..de974a6d870598bcf459025a58c6e4c743e7912b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/TfReaction.lean @@ -0,0 +1,172 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.CorrectionDensity + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators ContDiff +namespace NeutralAtom +open scoped Convolution +open ContinuousLinearMap + +def tfReaction (t : ℝ) : ℝ := 4*Real.pi*kTF*(max t 0)^(3/2 : ℝ) + +def cutoffReaction (a : ℝ) (F : Position → ℝ) : Position → ℝ := + {x : Position | a ≤ ‖x‖}.indicator (fun x => tfReaction (F x)) + +def screenedPotential (lam : ℝ) (σ : Position → ℝ) (x : Position) : ℝ := + lam*coulombKernel x-potentialOf σ x + +def barrierSource (a : ℝ) (U σ p : Position → ℝ) (x : Position) : ℝ := + (4*Real.pi)*({y : Position | ‖y‖ < a}.indicator σ x)- + (4*Real.pi)*p x+cutoffReaction a U x + +theorem tfReaction_nonneg (t : ℝ) : 0 ≤ tfReaction t := by + have := kTF_pos + unfold tfReaction + positivity + +theorem tfReaction_monotone : Monotone tfReaction := by + intro x y hxy + unfold tfReaction + have := kTF_pos + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply Real.rpow_le_rpow (le_max_right _ _) (max_le_max hxy le_rfl) + norm_num + +theorem tfReaction_continuous : Continuous tfReaction := by + exact continuous_const.mul ((Real.continuous_rpow_const (by norm_num : (0:ℝ)≤3/2)).comp + (continuous_id.max continuous_const)) + +theorem cutoffReaction_locallyIntegrable {a A : ℝ} {F : Position → ℝ} + (hm : Measurable F) (hbd : ∀ x, a ≤ ‖x‖ → F x ≤ A) : + LocallyIntegrable (cutoffReaction a F) := by + have hmeas : Measurable (cutoffReaction a F) := + (tfReaction_continuous.measurable.comp hm).indicator + (isClosed_le continuous_const continuous_norm).measurableSet + apply (locallyIntegrable_const (tfReaction A)).mono hmeas.aestronglyMeasurable + apply Filter.Eventually.of_forall + intro x + by_cases hx : a ≤ ‖x‖ + · have hh := tfReaction_monotone (hbd x hx) + simpa [cutoffReaction, hx, Real.norm_eq_abs, + abs_of_nonneg (tfReaction_nonneg _)] using hh + · simp [cutoffReaction, hx] + +theorem screenedPotential_measurable {lam A : ℝ} {σ : Position → ℝ} + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ A) : + Measurable (screenedPotential lam σ) := + (measurable_const.mul measurable_coulombKernel).sub + (potentialOf_continuous hσ hσpos hσbd).measurable + +theorem screenedPotential_upper {lam a : ℝ} {σ : Position → ℝ} + (ha : 0 < a) (hσpos : ∀ x, 0 ≤ σ x) {x : Position} (hx : a ≤ ‖x‖) : + screenedPotential lam σ x ≤ |lam|/a := by + have hK : 0 ≤ coulombKernel x := coulombKernel_nonneg x + have hKa : coulombKernel x ≤ a⁻¹ := inv_anti₀ ha hx + have hp := potentialOf_nonneg hσpos x + dsimp [screenedPotential] + calc + lam*coulombKernel x-potentialOf σ x ≤ lam*coulombKernel x := sub_le_self _ hp + _ ≤ |lam| *coulombKernel x := mul_le_mul_of_nonneg_right (le_abs_self _) hK + _ ≤ |lam| *a⁻¹ := mul_le_mul_of_nonneg_left hKa (abs_nonneg _) + _ = _ := by rw [div_eq_mul_inv] + +theorem barrier_difference_weakGE {U σ p e : Position → ℝ} + {lam a S c AU Aσ Ap Ae : ℝ} (ha : 0 < a) + (hU : Continuous (fun x => U x-lam*coulombKernel x)) + (hUbd : ∀ x, a ≤ ‖x‖ → U x ≤ AU) + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hp : Integrable p) (hppos : ∀ x, 0 ≤ p x) (hpbd : ∀ x, p x ≤ Ap) + (he : Integrable e) (hepos : ∀ x, 0 ≤ e x) (hebd : ∀ x, e x ≤ Ae) + (hw : WeakNuclearSubsolution U lam (Metric.ball 0 S) (barrierSource a U σ p)) + (hband : ∀ x ∈ Metric.ball (0 : Position) S, a ≤ ‖x‖ → + (4*Real.pi)*σ x ≤ tfReaction (screenedPotential lam σ x)+(4*Real.pi)*e x) : + WeakLaplacianGE + (fun x => U x-screenedPotential lam σ x-potentialOf (fun y => p y+e y) x-c) + (Metric.ball 0 S) (fun x => cutoffReaction a U x-cutoffReaction a (screenedPotential lam σ) x) := by + have hmU : Measurable U := by + have hm : Measurable (fun x => U x-lam*coulombKernel x+lam*coulombKernel x) := + hU.measurable.add (measurable_coulombKernel.const_mul lam) + simpa only [sub_add_cancel] using hm + have hiU := cutoffReaction_locallyIntegrable hmU hUbd + have hiF := cutoffReaction_locallyIntegrable + (screenedPotential_measurable (lam := lam) hσ hσpos hσbd) + (fun x hx => screenedPotential_upper ha hσpos hx) + have hiσ : LocallyIntegrable (fun x => (4*Real.pi)*({x : Position | ‖x‖ < a}.indicator σ) x) := + (hσ.locallyIntegrable.indicator + (isOpen_lt continuous_norm continuous_const).measurableSet).smul (4*Real.pi) + have his : LocallyIntegrable (barrierSource a U σ p) := + (hiσ.sub (hp.locallyIntegrable.smul (4*Real.pi))).add hiU + apply cancel_nuclear_source hU hσ hσpos hσbd + (hp.add he) (fun x => add_nonneg (hppos x) (hepos x)) + (fun x => add_le_add (hpbd x) (hebd x)) + (his.locallyIntegrableOn _) ((hiU.sub hiF).locallyIntegrableOn _) hw + intro x hx + change cutoffReaction a U x-cutoffReaction a (screenedPotential lam σ) x ≤ + barrierSource a U σ p x-(4*Real.pi)*σ x+(4*Real.pi)*(p x+e x) + by_cases hin : ‖x‖ < a + · simp only [barrierSource, cutoffReaction, Set.indicator, Set.mem_ofPred_eq, + ite_eq_left hin, ite_eq_right (not_le.mpr hin), sub_self] + have he0 := hepos x + nlinarith [Real.pi_pos] + · have hout : a ≤ ‖x‖ := le_of_not_gt hin + have hh := hband x hx hout + simp only [barrierSource, cutoffReaction, Set.indicator, Set.mem_ofPred_eq, + ite_eq_right hin, ite_eq_left hout, mul_zero] + linarith + +theorem positive_barrier_comparison {U σ p e : Position → ℝ} + {lam a S c AU Aσ Ap Ae : ℝ} (ha : 0 < a) (hS : 0 < S) (hc : 0 ≤ c) + (hU : Continuous (fun x => U x-lam*coulombKernel x)) + (hUbd : ∀ x, a ≤ ‖x‖ → U x ≤ AU) + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hp : Integrable p) (hppos : ∀ x, 0 ≤ p x) (hpbd : ∀ x, p x ≤ Ap) + (he : Integrable e) (hepos : ∀ x, 0 ≤ e x) (hebd : ∀ x, e x ≤ Ae) + (hw : WeakNuclearSubsolution U lam (Metric.ball 0 S) (barrierSource a U σ p)) + (hband : ∀ x ∈ Metric.ball (0 : Position) S, a ≤ ‖x‖ → + (4*Real.pi)*σ x ≤ tfReaction (screenedPotential lam σ x)+(4*Real.pi)*e x) + (hbdy : ∀ x : Position, ‖x‖ = S → + U x-screenedPotential lam σ x-potentialOf (fun y => p y+e y) x-c ≤ 0) : + ∀ x ∈ Metric.closedBall (0 : Position) S, + U x ≤ screenedPotential lam σ x+potentialOf (fun y => p y+e y) x+c := by + have hmU : Measurable U := by + have hm : Measurable (fun x => U x-lam*coulombKernel x+lam*coulombKernel x) := + hU.measurable.add (measurable_coulombKernel.const_mul lam) + simpa only [sub_add_cancel] using hm + have hiU := cutoffReaction_locallyIntegrable hmU hUbd + have hiF := cutoffReaction_locallyIntegrable + (screenedPotential_measurable (lam := lam) hσ hσpos hσbd) + (fun x hx => screenedPotential_upper ha hσpos hx) + have hη := hp.add he + have hηpos : ∀ x, 0 ≤ p x+e x := fun x => add_nonneg (hppos x) (hepos x) + have hηbd : ∀ x, p x+e x ≤ Ap+Ae := fun x => add_le_add (hpbd x) (hebd x) + have hcont : Continuous (fun x => U x-screenedPotential lam σ x- + potentialOf (fun y => p y+e y) x-c) := by + have hh := ((hU.add (potentialOf_continuous hσ hσpos hσbd)).sub + (potentialOf_continuous hη hηpos hηbd)).sub (continuous_const (y := c)) + convert hh using 1 + funext x + change U x-(lam*coulombKernel x-potentialOf σ x)-potentialOf (p+e) x-c = + U x-lam*coulombKernel x+potentialOf σ x-potentialOf (p+e) x-c + ring + apply weak_comparison_closedBall hS hc hcont.continuousOn + (fun x _ => potentialOf_nonneg hηpos x) hbdy + (barrier_difference_weakGE ha hU hUbd hσ hσpos hσbd + hp hppos hpbd he hepos hebd hw hband) ((hiU.sub hiF).locallyIntegrableOn _) + intro x _ hx + by_cases hax : a ≤ ‖x‖ + · simp only [cutoffReaction, Set.indicator, Set.mem_ofPred_eq, ite_eq_left hax] + exact sub_nonneg.mpr (tfReaction_monotone hx.le) + · simp [cutoffReaction, hax] + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/UniformScreening.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/UniformScreening.lean new file mode 100644 index 0000000000000000000000000000000000000000..095b9cd0b25b0bb237f9ae70e95e9920db284032 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/UniformScreening.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.UniformCountConsequences + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +theorem AtomicBudgetHistory.universal_positive_field {J n j : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ a B : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hB : B ≤ atomicCountConstant*screenEnergy δ a) (hδ : 0 ≤ δ) (ha : 0 < a) + (T : AtomicBudgetHistory S ψ B j) (hT : ∀ i, AtomicScaleWindow a (4^j) (T.target i)) + (y : Space) (hy : AtomicScaleWindow a (4^j) y) : + Real.sqrt (T.ensemble.rawSquare S y (atomicCellScale y)) ≤ + 2*atomicBudgetRecursionC^(j+2)*screenFieldUnit δ atomicCountConstant a := by + apply T.positive_field S hatom ψ hm hE hstate hB hδ + (by linarith [atomicCountConstant_ge_two]) ha _ hT y hy + intro z hz + exact (screenCountParameter_controls ψ hm δ hz).trans + (mul_le_mul_of_nonneg_right (screenCountParameter_le_atomicCountConstant S hatom ψ hψ hm hE hstate hδ) (sq_nonneg _)) + +def AtomicBudgetHistory.initial {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + (hψ : Antisymmetric ψ) : AtomicBudgetHistory S ψ 0 0 where + ensemble := RecordedEnsemble.initial ψ + target := Fin.elim0 + nonzero := fun i => Fin.elim0 i + law := RecordedEnsemble.initial_conserves ψ + fermionic := RecordedEnsemble.initial_fermionic ψ hψ + support := by simpa only [atomicPatchRegion,Set.iUnion_of_empty] using RecordedEnsemble.initial_supported ψ + mass_eq := RecordedEnsemble.initial_mass ψ + energy := by simp only [RecordedEnsemble.initial_form,Finset.univ_eq_empty,Finset.sum_empty,add_zero,le_refl] + +lemma RecordedEnsemble.mean_raw_le_sqrt {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) + (hm : mass ψ=1) (T : RecordedEnsemble n) (hT : T.Conserves ψ) + (hTm : T.totalMass=mass ψ) (y : Space) {a : ℝ} (ha : 0 < a) : + max (attraction S y-restrictedCorePotential ψ {z | 40*a ≤ ‖z-y‖} y) 0 ≤ + Real.sqrt (T.rawSquare S y a) := by + let A : Set Space := {z | 40*a ≤ ‖z-y‖} + have hA : MeasurableSet A := (isClosed_le continuous_const (by fun_prop)).measurableSet + let W : Configuration n → ℝ := rawSignedField (attraction S y) A y + have hW : Measurable W := rawSignedField_measurable _ hA y + let B : ℝ := |attraction S y|+(n:ℝ)/(40*a) + have hB0 : 0 ≤ B := by dsimp [B]; positivity + have hB : ∀ x, |W x| ≤ B := rawSignedField_abs_le _ _ y (by positivity) (fun _ h => h) + have hcons := hT W hW ⟨B,hB⟩ + have hreindex (p) (x : Configuration (T.out p+T.core p)) : + W (reindexConfiguration (T.labels p) x)=rawSignedField (attraction S y) A y x := + rawSignedField_reindex _ _ _ _ _ + have H := conditional_ensemble_positive_jensen T.out T.core T.vector + (fun p x => W (reindexConfiguration (T.labels p) x)) + (fun p => by simpa only [hreindex] using (rawSignedField_measurable (n:=T.out p+T.core p) (attraction S y) hA y)) + hB0 (fun p x => hB _) (hTm.trans hm) + change (max (∑ p, potentialForm (W ∘ reindexConfiguration (T.labels p)) (T.vector p)) 0)^2 ≤ _ at H + rw [hcons,potentialForm_rawSignedField ψ _ hA y (by positivity) (fun _ h => h),hm,mul_one] at H + simp_rw [hreindex] at H + exact (Real.le_sqrt (le_max_right _ _) (T.rawSquare_nonneg S y a)).mpr H + +theorem atomic_expected_raw_field_bound {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) {y : Space} (hy : y≠0) : + max (attraction S y-restrictedCorePotential ψ {z | 40*atomicCellScale y ≤ ‖z-y‖} y) 0 ≤ + 2*atomicBudgetRecursionC^2*screenFieldUnit δ atomicCountConstant (atomicCellScale y) := by + let T := AtomicBudgetHistory.initial S ψ hψ + have ha := atomicCellScale_pos hy + have hB : (0:ℝ) ≤ atomicCountConstant*screenEnergy δ (atomicCellScale y) := + mul_nonneg (by linarith [atomicCountConstant_ge_two]) (div_nonneg (sq_nonneg _) ha.le) + have H := T.universal_positive_field S hatom ψ hψ hm hE hstate hB hδ ha + (fun i => Fin.elim0 i) y (by simp only [pow_zero,AtomicScaleWindow,one_mul,le_refl,and_self]) + exact (T.ensemble.mean_raw_le_sqrt S ψ hm T.law T.mass_eq y ha).trans H + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/WeakLocality.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/WeakLocality.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cc191a6be3cee3f2537832b6d0e7b87d275befb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/WeakLocality.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.WeakReactionMax + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Manifold +namespace NeutralAtom + +lemma coordinateLaplacian_finset_sum {ι : Type*} (s : Finset ι) (f : ι → Position → ℝ) + (hf : ∀ i, ContDiff ℝ ∞ (f i)) (x : Position) : + coordinateLaplacian (fun y => ∑ i ∈ s, f i y) x=∑ i ∈ s, coordinateLaplacian (f i) x := by + classical + induction s using Finset.induction_on with + | empty => simp [coordinateLaplacian] + | @insert i s hi ih => + simp only [Finset.sum_insert hi] + rw [coordinateLaplacian_add_at ((hf i).of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt + ((ContDiff.sum (s:=s) (fun j _ => hf j)).of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt,ih] + +theorem WeakLaplacianGE.of_local {f q : Position → ℝ} {U : Set Position} + (hf : LocallyIntegrable f volume) (hq : LocallyIntegrable q volume) + (hlocal : ∀ x ∈ U, ∃ V : Set Position, x ∈ V ∧ IsOpen V ∧ WeakLaplacianGE f V q) : + WeakLaplacianGE f U q := by + classical + intro φ hφ hc ht hp + choose V hmem hopen hweak using (fun x : tsupport φ => hlocal x.val (ht x.property)) + have hcover : tsupport φ ⊆ ⋃ x : tsupport φ, V x := by + intro x hx + exact mem_iUnion.mpr ⟨⟨x,hx⟩,hmem ⟨x,hx⟩⟩ + obtain ⟨s,hs⟩ := hc.elim_finite_subcover V hopen hcover + let W : s → Set Position := fun i => V i.val + have hW : tsupport φ ⊆ ⋃ i : s, W i := by + intro x hx + obtain ⟨i,hi,hxi⟩ := mem_iUnion₂.mp (hs hx) + exact mem_iUnion.mpr ⟨⟨i,hi⟩,hxi⟩ + obtain ⟨P,hP⟩ := SmoothPartitionOfUnity.exists_isSubordinate (I:=𝓘(ℝ,Position)) + (isClosed_tsupport φ) W (fun i => hopen i.val) hW + let ψ : s → Position → ℝ := fun i x => P i x*φ x + have hψc (i : s) : ContDiff ℝ ∞ (ψ i) := by + exact (contMDiff_iff_contDiff.mp (P i).contMDiff).mul hφ + have hψs (i : s) : HasCompactSupport (ψ i) := hc.mul_left + have hψt (i : s) : tsupport (ψ i) ⊆ W i := + (tsupport_mul_subset_left).trans (hP i) + have hsum : (fun x => ∑ i : s, ψ i x)=φ := by + funext x + by_cases hx : x ∈ tsupport φ + · have H := P.sum_eq_one hx + rw [finsum_eq_sum_of_fintype] at H + simp only [ψ,←Finset.sum_mul,H,one_mul] + · simp [ψ,image_eq_zero_of_notMem_tsupport hx] + have hiq (i : s) : Integrable (fun x => q x*ψ i x) := by + simpa only [smul_eq_mul] using hq.integrable_smul_right_of_hasCompactSupport + (hψc i).continuous (hψs i) + have hif (i : s) : Integrable (fun x => f x*coordinateLaplacian (ψ i) x) := by + simpa only [smul_eq_mul] using hf.integrable_smul_right_of_hasCompactSupport + (contDiff_coordinateLaplacian (hψc i)).continuous (hasCompactSupport_coordinateLaplacian (hψs i)) + have H := Finset.sum_le_sum (s:=Finset.univ) (fun i _ => + hweak i.val (ψ i) (hψc i) (hψs i) (hψt i) + (fun x => mul_nonneg (P.nonneg i x) (hp x))) + rw [←integral_finsetSum _ (fun i _ => hiq i),←integral_finsetSum _ (fun i _ => hif i)] at H + have hsume x : (∑ i : s, ψ i x)=φ x := congrFun hsum x + simpa only [←Finset.mul_sum,←coordinateLaplacian_finset_sum Finset.univ ψ hψc,hsum,hsume] using H + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +lemma locallyIntegrable_of_ball_bounds {q : Position → ℝ} (hm : Measurable q) + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, |q x| ≤ C) : + LocallyIntegrable q volume := by + rw [locallyIntegrable_iff] + intro K hK + obtain ⟨R,hR⟩ := hK.isBounded.subset_closedBall (0:Position) + obtain ⟨C,hC⟩ := hb R + have hfin : volume K < ⊤ := hK.measure_lt_top + have : IsFiniteMeasure (volume.restrict K) := ⟨by simpa using hfin⟩ + apply (integrable_const C).mono' hm.aestronglyMeasurable + filter_upwards [ae_restrict_mem hK.measurableSet] with x hx + simpa only [Real.norm_eq_abs] using hC x (hR hx) + +lemma cutoffReaction_offset_locallyIntegrable {a Z : ℝ} (ha : 0 Z*coulombKernel x+f x)) volume := by + apply locallyIntegrable_of_ball_bounds + · exact (tfReaction_continuous.measurable.comp ((measurable_const.mul + measurable_coulombKernel).add hf.measurable)).indicator + (isClosed_le continuous_const continuous_norm).measurableSet + · exact cutoffReaction_offset_ball_bound ha hf + +lemma WeakLaplacianGE.mono_source_on {f q r : Position → ℝ} {U : Set Position} + (hw : WeakLaplacianGE f U q) (hq : LocallyIntegrable q volume) + (hr : LocallyIntegrable r volume) (hle : ∀ᵐ x, x ∈ U → r x≤q x) : + WeakLaplacianGE f U r := by + intro φ hφ hc ht hp + apply le_trans _ (hw φ hφ hc ht hp) + have hi (g : Position → ℝ) (hg : LocallyIntegrable g volume) : + Integrable (fun x => g x*φ x) := by + simpa only [smul_eq_mul] using hg.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + apply integral_mono_ae (hi r hr) (hi q hq) + filter_upwards [hle] with x hx + by_cases h : x ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hx (ht h)) (hp x) + · simp [image_eq_zero_of_notMem_tsupport h] + +theorem WeakNuclearSubsolution.max_cutoffTF {f g b : Position → ℝ} {a Z : ℝ} + {U : Set Position} (ha : 0 Z*coulombKernel x+f x) Z U + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+f y) x)) + (hwg : WeakNuclearSubsolution (fun x => Z*coulombKernel x+g x) Z U + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+g y) x)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+max (f x) (g x)) Z U + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+max (f y) (g y)) x) := by + have hbi := locallyIntegrable_of_ball_bounds hb hbb + apply WeakNuclearSubsolution.max_reaction (F := fun x t => if a≤‖x‖ then tfReaction t else 0) + hU hf hg + · exact hbi.add (cutoffReaction_offset_locallyIntegrable ha hf) + · exact hbi.add (cutoffReaction_offset_locallyIntegrable ha hg) + · intro R + obtain ⟨C,hC⟩ := hbb R + obtain ⟨D,hD⟩ := cutoffReaction_offset_ball_bound (Z:=Z) ha hf R + exact ⟨C+D,fun x hx => (abs_add_le _ _).trans (add_le_add (hC x hx) (hD x hx))⟩ + · intro R + obtain ⟨C,hC⟩ := hbb R + obtain ⟨D,hD⟩ := cutoffReaction_offset_ball_bound (Z:=Z) ha hg R + exact ⟨C+D,fun x hx => (abs_add_le _ _).trans (add_le_add (hC x hx) (hD x hx))⟩ + · exact hwf + · exact hwg + +theorem WeakNuclearSubsolution.finset_max_cutoffTF {ι : Type*} + (s : Finset ι) (hs : s.Nonempty) (f : ι → Position → ℝ) {b : Position → ℝ} + {a Z : ℝ} {U : Set Position} (ha : 0 Z*coulombKernel x+f i x) Z U + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+f i y) x)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+s.sup' hs (fun i => f i x)) Z U + (fun x => b x+cutoffReaction a (fun y => Z*coulombKernel y+s.sup' hs (fun i => f i y)) x) := by + classical + induction s using Finset.induction_on with + | empty => exact False.elim (Finset.not_nonempty_empty hs) + | @insert i s hi ih => + by_cases hne : s.Nonempty + · have hf' : ∀ j∈s, Continuous (f j) := fun j hj => hf j (Finset.mem_insert_of_mem hj) + have h := WeakNuclearSubsolution.max_cutoffTF ha hU (hf i (Finset.mem_insert_self _ _)) + (Continuous.finset_sup'_apply hne hf') hb hbb + (hw i (Finset.mem_insert_self _ _)) + (ih hne hf' (fun j hj => hw j (Finset.mem_insert_of_mem hj))) + simpa only [Finset.sup'_insert hne] using h + · have he := Finset.not_nonempty_iff_eq_empty.mp hne + subst s + simpa using hw i (Finset.mem_insert_self _ _) + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Propagation/WeakReactionMax.lean b/lean/OAI/Analysis/CoulombRadii/Propagation/WeakReactionMax.lean new file mode 100644 index 0000000000000000000000000000000000000000..53851a70da7eeed2db4125f0161e24575d585df0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Propagation/WeakReactionMax.lean @@ -0,0 +1,184 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.TfReaction +import OAI.Analysis.CoulombRadii.Propagation.MaximumMollifier + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +theorem WeakLaplacianGE.max_reaction {f g b : Position → ℝ} {F : Position → ℝ → ℝ} + {U : Set Position} (hU : IsOpen U) (hf : Continuous f) (hg : Continuous g) + (hq : LocallyIntegrable (fun x => b x+F x (f x)) volume) + (hr : LocallyIntegrable (fun x => b x+F x (g x)) volume) + (hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, |b x+F x (f x)| ≤ C) + (hbr : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, |b x+F x (g x)| ≤ C) + (hwf : WeakLaplacianGE f U (fun x => b x+F x (f x))) + (hwg : WeakLaplacianGE g U (fun x => b x+F x (g x))) : + WeakLaplacianGE (fun x => max (f x) (g x)) U (fun x => b x+F x (max (f x) (g x))) := by + have H := WeakLaplacianGE.max_tied hU hf hg hq hr hbq hbr hwf hwg (fun x h => by rw [h]) + convert H using 1 + funext x + by_cases h : g x ≤ f x + · simp [h] + · simp [h,max_eq_right (le_of_not_ge h)] + +lemma cutoffReaction_offset_ball_bound {a Z : ℝ} (ha : 0 < a) + {f : Position → ℝ} (hf : Continuous f) (R : ℝ) : + ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, + |cutoffReaction a (fun y => Z*coulombKernel y+f y) x| ≤ C := by + obtain ⟨D,hD⟩ := (isCompact_closedBall (0:Position) R).exists_bound_of_continuousOn hf.continuousOn + refine ⟨tfReaction (|Z|/a+D),?_⟩ + intro x hx + by_cases haX : a ≤ ‖x‖ + · have hn : 0 < ‖x‖ := ha.trans_le haX + have hZ : Z*coulombKernel x ≤ |Z|/a := by + unfold coulombKernel + calc + Z*‖x‖⁻¹ ≤ |Z| *‖x‖⁻¹ := mul_le_mul_of_nonneg_right (le_abs_self _) (inv_nonneg.mpr hn.le) + _ ≤ |Z| *a⁻¹ := mul_le_mul_of_nonneg_left (inv_anti₀ ha haX) (abs_nonneg _) + _ = |Z|/a := by rw [div_eq_mul_inv] + have h := tfReaction_monotone (show Z*coulombKernel x+f x ≤ |Z|/a+D by + have H : f x ≤ D := (le_abs_self _).trans (by simpa only [Real.norm_eq_abs] using hD x hx) + linarith) + simpa [cutoffReaction, haX, abs_of_nonneg (tfReaction_nonneg _)] using h + · simpa [cutoffReaction, haX] using tfReaction_nonneg (|Z|/a+D) + +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +lemma joint_compact_test_integrable {F : Ω → Position → ℝ} + (hm : Measurable (Function.uncurry F)) + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |F o x| ≤ C) + {φ : Position → ℝ} (hφ : Continuous φ) (hc : HasCompactSupport φ) : + Integrable (fun z : Ω × Position => F z.1 z.2*φ z.2) (μ.prod volume) := by + obtain ⟨R,hR⟩ := hc.isBounded.subset_closedBall (0:Position) + obtain ⟨C,hC⟩ := hb R + have hi : Integrable (fun z : Ω × Position => C*‖φ z.2‖) (μ.prod volume) := + ((hφ.integrable_of_hasCompactSupport hc).norm.const_mul C).comp_snd μ + apply hi.mono' (hm.mul (hφ.measurable.comp measurable_snd)).aestronglyMeasurable + filter_upwards [] with z + change ‖F z.1 z.2*φ z.2‖ ≤ C*‖φ z.2‖ + rw [norm_mul,Real.norm_eq_abs (F z.1 z.2)] + by_cases hz : z.2 ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hC z.1 z.2 (hR hz)) (norm_nonneg _) + · simp [image_eq_zero_of_notMem_tsupport hz] + +lemma integral_average_test {F : Ω → Position → ℝ} + (hm : Measurable (Function.uncurry F)) + (hb : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |F o x| ≤ C) + {φ : Position → ℝ} (hφ : Continuous φ) (hc : HasCompactSupport φ) : + (∫ x, (∫ o, F o x ∂μ)*φ x)=(∫ o, (∫ x, F o x*φ x) ∂μ) := by + simp_rw [←integral_mul_const] + exact (integral_integral_swap (joint_compact_test_integrable hm hb hφ hc)).symm + +theorem WeakLaplacianGE.average {F Q : Ω → Position → ℝ} {U : Set Position} + (hF : Measurable (Function.uncurry F)) (hQ : Measurable (Function.uncurry Q)) + (hbF : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |F o x| ≤ C) + (hbQ : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |Q o x| ≤ C) + (hw : ∀ᵐ o ∂μ, WeakLaplacianGE (F o) U (Q o)) : + WeakLaplacianGE (fun x => ∫ o, F o x ∂μ) U (fun x => ∫ o, Q o x ∂μ) := by + intro φ hφ hc ht hp + rw [integral_average_test hQ hbQ hφ.continuous hc, + integral_average_test hF hbF (contDiff_coordinateLaplacian hφ).continuous + (hasCompactSupport_coordinateLaplacian hc)] + apply integral_mono_ae + (joint_compact_test_integrable hQ hbQ hφ.continuous hc).integral_prod_left + (joint_compact_test_integrable hF hbF (contDiff_coordinateLaplacian hφ).continuous + (hasCompactSupport_coordinateLaplacian hc)).integral_prod_left + filter_upwards [hw] with o ho + exact ho φ hφ hc ht hp + +theorem tfReaction_integral_le {f : Ω → ℝ} (hf : Integrable f μ) + (hr : Integrable (fun o => (max (f o) 0)^(3/2:ℝ)) μ) : + tfReaction (∫ o, f o ∂μ) ≤ ∫ o, tfReaction (f o) ∂μ := by + have hpos : Integrable (fun o => max (f o) 0) μ := hf.sup (integrable_const 0) + have hm : max (∫ o, f o ∂μ) 0 ≤ ∫ o, max (f o) 0 ∂μ := max_le + (integral_mono hf hpos (fun o => le_max_left _ _)) + (integral_nonneg (fun o => le_max_right _ _)) + have hJ := (convexOn_rpow (by norm_num : (1:ℝ) ≤ 3/2)).map_integral_le + (Real.continuous_rpow_const (by norm_num : (0:ℝ) ≤ 3/2)).continuousOn isClosed_Ici + (Eventually.of_forall (fun o => (show max (f o) 0 ∈ Ici (0:ℝ) from (show 0 ≤ max (f o) 0 from le_max_right _ _)))) hpos hr + unfold tfReaction + rw [integral_const_mul] + apply mul_le_mul_of_nonneg_left _ (by have := kTF_pos; positivity) + exact (Real.rpow_le_rpow (le_max_right _ _) hm (by norm_num)).trans hJ + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +lemma nuclear_offset_test_identity {f φ : Position → ℝ} (hf : Continuous f) + (Z : ℝ) (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + (∫ x, (Z*coulombKernel x+f x)*coordinateLaplacian φ x)= + -(4*Real.pi*Z*φ 0)+(∫ x, f x*coordinateLaplacian φ x) := by + have hL := (contDiff_coordinateLaplacian hφ).continuous + have hLc := hasCompactSupport_coordinateLaplacian hc + have hiK : Integrable (fun x => coulombKernel x*coordinateLaplacian φ x) := by + simpa only [smul_eq_mul] using + locallyIntegrable_coulombKernel.integrable_smul_right_of_hasCompactSupport hL hLc + have hiF := integrable_mul_compact_of_continuousAt (fun x _ => hf.continuousAt) hL hLc + simp_rw [add_mul] + rw [integral_add (by simpa only [mul_assoc] using hiK.const_mul Z) hiF] + simp_rw [mul_assoc Z] + rw [integral_const_mul,integral_coulombKernel_laplacian hφ hc] + ring + +theorem weakNuclearSubsolution_offset_iff {f q : Position → ℝ} {Z : ℝ} {U : Set Position} + (hf : Continuous f) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+f x) Z U q ↔ WeakLaplacianGE f U q := by + constructor <;> intro h φ hφ hc ht hp + · have H := h φ hφ hc ht hp + rw [nuclear_offset_test_identity hf Z hφ hc] at H + linarith + · rw [nuclear_offset_test_identity hf Z hφ hc] + linarith [h φ hφ hc ht hp] + +theorem WeakNuclearSubsolution.max_reaction {f g b : Position → ℝ} {Z : ℝ} + {F : Position → ℝ → ℝ} {U : Set Position} + (hU : IsOpen U) (hf : Continuous f) (hg : Continuous g) + (hq : LocallyIntegrable (fun x => b x+F x (Z*coulombKernel x+f x)) volume) + (hr : LocallyIntegrable (fun x => b x+F x (Z*coulombKernel x+g x)) volume) + (hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, + |b x+F x (Z*coulombKernel x+f x)| ≤ C) + (hbr : ∀ R : ℝ, ∃ C : ℝ, ∀ x ∈ Metric.closedBall 0 R, + |b x+F x (Z*coulombKernel x+g x)| ≤ C) + (hwf : WeakNuclearSubsolution (fun x => Z*coulombKernel x+f x) Z U + (fun x => b x+F x (Z*coulombKernel x+f x))) + (hwg : WeakNuclearSubsolution (fun x => Z*coulombKernel x+g x) Z U + (fun x => b x+F x (Z*coulombKernel x+g x))) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+max (f x) (g x)) Z U + (fun x => b x+F x (Z*coulombKernel x+max (f x) (g x))) := by + apply (weakNuclearSubsolution_offset_iff (hf.max hg)).2 + exact WeakLaplacianGE.max_reaction (F := fun x t => F x (Z*coulombKernel x+t)) + hU hf hg hq hr hbq hbr + ((weakNuclearSubsolution_offset_iff (Z:=Z) hf).1 hwf) + ((weakNuclearSubsolution_offset_iff (Z:=Z) hg).1 hwg) + +theorem WeakNuclearSubsolution.average {Ω : Type*} [MeasurableSpace Ω] + {μ : Measure Ω} [IsProbabilityMeasure μ] + {f q : Ω → Position → ℝ} {Z : ℝ} {U : Set Position} + (hf : ∀ o, Continuous (f o)) + (hcf : Continuous (fun x => ∫ o, f o x ∂μ)) + (hmf : Measurable (Function.uncurry f)) (hmq : Measurable (Function.uncurry q)) + (hbf : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |f o x| ≤ C) + (hbq : ∀ R : ℝ, ∃ C : ℝ, ∀ o x, x ∈ Metric.closedBall 0 R → |q o x| ≤ C) + (hw : ∀ᵐ o ∂μ, WeakNuclearSubsolution (fun x => Z*coulombKernel x+f o x) Z U (q o)) : + WeakNuclearSubsolution (fun x => Z*coulombKernel x+∫ o, f o x ∂μ) Z U + (fun x => ∫ o, q o x ∂μ) := by + apply (weakNuclearSubsolution_offset_iff hcf).2 + apply WeakLaplacianGE.average hmf hmq hbf hbq + filter_upwards [hw] with o ho + exact (weakNuclearSubsolution_offset_iff (hf o)).1 ho + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RadialBounds/AtomicMasterError.lean b/lean/OAI/Analysis/CoulombRadii/RadialBounds/AtomicMasterError.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e3864ac81472193e80a6f20207b197ad9020513 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RadialBounds/AtomicMasterError.lean @@ -0,0 +1,58 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.RawMasterNewton +import OAI.Analysis.CoulombRadii.FieldAnalysis.AtomicNear + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma physical_closed_near_le_open {N : ℕ} (u : Coulomb.H1Vector (N+1)) + (hu : Coulomb.Antisymmetric u) (y : Position) {R : ℝ} (hR : 0 coulombKernel (y-z)) + (fun σ => fromH1_coulomb_weight_integrable u y σ 0) + have hh := setIntegral_mono_set (s := Metric.closedBall y R) (t := Metric.ball y (2*R)) hi.integrableOn + (Eventually.of_forall (fun z => mul_nonneg (Coulomb.coulombKernel_nonneg _) (by unfold density; positivity))) + (Eventually.of_forall (fun z (hz : z∈Metric.closedBall y R) => + (Metric.mem_ball.mpr ((Metric.mem_closedBall.mp hz).trans_lt (by linarith : R<2*R))))) + simpa only [coulombKernel,Coulomb.coulombKernel,mul_comm] using hh + +theorem exists_atomic_master_error_scale : ∃ s₀ : ℝ, 0 (q+2*t*b+c*t^2)^p)) 0 = + p*(p-1)*q^(p-2)*(2*b)^2+2*c*p*q^(p-1) := by + let Q : ℝ → ℝ := fun t => q+2*t*b+c*t^2 + have hQ (t : ℝ) : HasDerivAt Q (2*b+2*c*t) t := by + convert (((hasDerivAt_const t q).add + (((hasDerivAt_id t).const_mul 2).mul_const b)).add + (((hasDerivAt_id t).pow 2).const_mul c)) using 1 + all_goals first | rfl | dsimp [Q]; ring + have hQ0 : Q 0=q := by simp [Q] + have hQe : ∀ᶠ t in 𝓝 (0:ℝ), Q t≠0 := + (hQ 0).continuousAt.eventually_ne (by simpa [hQ0] using ne_of_gt hq) + have hd : deriv (fun t => Q t^p) =ᶠ[𝓝 0] fun t => p*Q t^(p-1)*(2*b+2*c*t) := by + filter_upwards [hQe] with t ht + convert ((hQ t).rpow_const (Or.inl ht)).deriv using 1 + ring + rw [hd.deriv_eq] + have hh := (((hQ 0).rpow_const (p := p-1) + (Or.inl (by simpa [hQ0] using ne_of_gt hq))).const_mul p).mul + ((hasDerivAt_const 0 (2*b)).add ((hasDerivAt_id 0).const_mul (2*c))) + have hh' : HasDerivAt (fun t => p*Q t^(p-1)*(2*b+2*c*t)) + (p*((2*b)*(p-1)*q^(p-1-1))*(2*b)+p*q^(p-1)*(2*c)) 0 := by + convert hh using 1 + all_goals first | rfl | norm_num [Q] + rw [hh'.deriv,show p-1-1=p-2 by ring] + ring + +def interiorBump (y : Position) (s A : ℝ) (x : Position) : ℝ := + A*(s^2-‖x-y‖^2)^(-4:ℝ) + +lemma interiorBump_eq_div {y x : Position} {s A : ℝ} + (h : 0 (s^2-‖x+t • axis a-y‖^2)^(-4:ℝ))= + (fun t : ℝ => ((s^2-‖x-y‖^2)+2*t*(-(x-y) a)+(-1)*t^2)^(-4:ℝ)) := by + funext t + rw [show x+t • axis a-y=(x-y)+t • axis a by module,norm_sq_axis_shift] + congr 1 + ring + simp_rw [he,second_deriv_general_quadratic_rpow h] + congr 1 + norm_num + have H : (∑ a : Fin 3, (y a-x a)^2)=‖x-y‖^2 := by + have H := EuclideanSpace.real_norm_sq_eq (y-x) + simpa only [PiLp.sub_apply,norm_sub_rev] using H.symm + simp only [Finset.sum_add_distrib] + rw [show (∑ a : Fin 3, 20*((s^2-‖x-y‖^2)^6)⁻¹*(2*(y a-x a))^2)= + 80*((s^2-‖x-y‖^2)^6)⁻¹*(∑ a : Fin 3, (y a-x a)^2) by + rw [Finset.mul_sum]; apply Finset.sum_congr rfl; intro a ha; ring] + rw [H] + simp only [Finset.sum_const,Finset.card_fin,nsmul_eq_mul] + ring + +lemma contDiffOn_interiorBump {y : Position} {s : ℝ} (hs : 0.mpr hx')) + +lemma coordinateLaplacian_interiorBump_le {y x : Position} {s A : ℝ} + (hs : 0 c*(max (F x) 0)^(3/2:ℝ))) + {z : Position} (hz : z∈Metric.ball y s) : + F z ≤ (80/c)^2*s^4/(s^2-‖z-y‖^2)^4 := by + let g : Position → ℝ := fun x => (s^2-‖x-y‖^2)^4*F x + have hg : ContinuousOn g (Metric.closedBall y s) := + (((continuous_const.sub ((continuous_id.sub continuous_const).norm.pow 2)).pow 4).continuousOn).mul hF + obtain ⟨x,hx,hm⟩ := (isCompact_closedBall y s).exists_isMaxOn + ⟨y,Metric.mem_closedBall_self hs.le⟩ hg + have hzsq : 0 F v-interiorBump y s (g x) v) x := by + filter_upwards [Metric.isOpen_ball.mem_nhds hxi] with v hv + rw [he,sub_self] + exact sub_nonpos.mpr (hbar v hv) + have hq : ContinuousOn (fun v => c*(max (F v) 0)^(3/2:ℝ)) (Metric.ball y s) := by + exact continuousOn_const.mul (((hF.mono Metric.ball_subset_closedBall).sup continuousOn_const).rpow_const + (fun _ _ => Or.inr (by norm_num))) + have HL := (weakLaplacian_le_at_local_max Metric.isOpen_ball hxi + (hF.mono Metric.ball_subset_closedBall) hq (contDiffOn_interiorBump hs (g x)) hw hmax).trans + (coordinateLaplacian_interiorBump_le hs hpos.le hxi) + rw [max_eq_left hFx.le] at HL + have hid : (g x)^(3/2:ℝ)=(s^2-‖x-y‖^2)^6*(F x)^(3/2:ℝ) := by + dsimp [g] + rw [Real.mul_rpow (pow_nonneg hxq.le 4) hFx.le] + congr 1 + rw [←Real.rpow_natCast _ 4,←Real.rpow_mul hxq.le] + norm_num + have HR : c*(g x)^(3/2:ℝ) ≤ 80*(g x)*s^2 := by + rw [hid] + have H := (le_div_iff₀ (pow_pos hxq 6)).mp HL + nlinarith [H] + exact (hm (Metric.ball_subset_closedBall hz)).trans (weighted_reaction_bound hpos hc HR) + · exact (hm (Metric.ball_subset_closedBall hz)).trans + ((le_of_not_gt hpos).trans (by positivity)) + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RadialBounds/NearActive.lean b/lean/OAI/Analysis/CoulombRadii/RadialBounds/NearActive.lean new file mode 100644 index 0000000000000000000000000000000000000000..227113d6750be5ff7df99b8a061a2735d1e837d5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RadialBounds/NearActive.lean @@ -0,0 +1,74 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Model + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff +noncomputable section +namespace NeutralAtom + +theorem finite_max_near_active {ι : Type*} (s : Finset ι) (hs : s.Nonempty) + (f : ι → Position → ℝ) (hf : ∀ i∈s, Continuous (f i)) + {x₀ : Position} {O : Set Position} (hO : IsOpen O) (hx₀ : x₀∈O) + {η : ℝ} (hη : 0<η) : + ∃ t : Finset ι, ∃ ht : t.Nonempty, t⊆s ∧ + (∀ i∈s, i∈t ↔ s.sup' hs (fun j => f j x₀)-f i x₀≤η) ∧ + ∃ U : Set Position, x₀∈U ∧ IsOpen U ∧ U⊆O ∧ + (∀ x∈U, s.sup' hs (fun j => f j x)=t.sup' ht (fun j => f j x)) ∧ + (∀ i∈t, ∀ x∈U, s.sup' hs (fun j => f j x)-f i x<2*η) := by + classical + let M : Position → ℝ := fun x => s.sup' hs (fun j => f j x) + have hM : Continuous M := Continuous.finset_sup'_apply hs hf + obtain ⟨i₀,hi₀,hmax⟩ := Finset.exists_mem_eq_sup' hs (fun i => f i x₀) + let t := s.filter (fun i => M x₀-f i x₀≤η) + have hti₀ : i₀∈t := by + simp only [t,Finset.mem_filter] + exact ⟨hi₀,by dsimp only [M]; rw [hmax]; linarith⟩ + have ht : t.Nonempty := ⟨i₀,hti₀⟩ + have hts : t⊆s := Finset.filter_subset _ s + let V : ι → Set Position := fun i => if i∈t then {x | M x-f i x<2*η} + else {x | f i x hxV i hi)⟩ + · exact hO.inter (isOpen_biInter_finset fun i hi => hV i hi) + · intro x hx + apply le_antisymm + · apply Finset.sup'_le + intro i hi + by_cases hit : i∈t + · exact Finset.le_sup' (fun j => f j x) hit + · have hh := mem_iInter₂.mp hx.2 i hi + have hh' : f i x f j x) hti₀) + · exact Finset.sup'_mono (fun j => f j x) hts ht + · intro i hi x hx + have hh := mem_iInter₂.mp hx.2 i (hts hi) + simpa only [V,ite_eq_left hi,mem_ofPred_eq,M] using hh + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RadialBounds/PhysicalBarrierData.lean b/lean/OAI/Analysis/CoulombRadii/RadialBounds/PhysicalBarrierData.lean new file mode 100644 index 0000000000000000000000000000000000000000..4112e5d53652be0fc6033f7696ed95cde2d58b8f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RadialBounds/PhysicalBarrierData.lean @@ -0,0 +1,90 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RadialBounds.PhysicalShellError +import OAI.Analysis.CoulombRadii.Propagation.InitialMesh +import OAI.Analysis.CoulombRadii.Packets.PhysicalRetainedDatum + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_barrier_data : ∃ ε B C L M : ℝ,0<ε ∧ 0 r₀*2^j.val + ∀ (j : Fin K), rs j ≤ s → + ∃ d:PropagationDatum P B C (rs j) (Z:ℝ) L + (fun o => conditionalPacketDensity P Prod.fst (tailObservation rs j.val) + Coulomb.unitWindow 1 r₀ s (tailObservation rs j.val o)), + (∫ o,(∫ x,d.error o x) ∂P) ≤ M*(rs j)^9 := by + obtain ⟨εmax,hεmax,HI⟩ := physical_initial_event + obtain ⟨ε,B,hε,hεceil,hB,hBe,hR,hbar⟩ := initial_constants_exist hεmax + let C := max physicalSpatialCap (max B (32*ε^3)) + have hBC : B ≤ C := (le_max_left _ _).trans (le_max_right _ _) + have hcapC : physicalSpatialCap ≤ C := le_max_left _ _ + have heC : 32*ε^3 ≤ C := (le_max_right _ _).trans (le_max_right _ _) + obtain ⟨k⟩ := propagation_constants_exist hB hBC + obtain ⟨Kprob,hK,HG⟩ := physical_propagation_good_events Coulomb.unitWindow Coulomb.unitWindow_support + Coulomb.unitWindow_mass Coulomb.unitWindow_radial (by norm_num : (0:ℝ)<1) hB hBC hcapC k + obtain ⟨M,hM,HC⟩ := physical_bad_shell_error + let T := 1029*ε^3+M*Real.sqrt Kprob + have hT : 0 ≤ T := by dsimp [T]; positivity + refine ⟨ε,B,C,k.L,T,hε,hB,hB.le.trans hBC,hT,?_⟩ + intro D hD + obtain ⟨s₀,hs₀,hs₀1,hgates,HG⟩ := HG D hD + refine ⟨s₀,hs₀,hs₀1,?_⟩ + intro s hs hss + have hs1 : s ≤ 1 := hss.le.trans hs₀1 + obtain ⟨hq1,hq2,hDs⟩ := hgates hs hss + obtain ⟨Zi,Hi⟩ := HI hε hεceil D Coulomb.unitWindow Coulomb.unitWindow_mass + Coulomb.unitWindow_radial Coulomb.unitWindow_support (by norm_num : (0:ℝ)<1) hs hq1 + refine ⟨Zi,?_⟩ + intro Z hZi hZ N K ψ g hd hn hmin E hE he hnum + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + intro j hjs + have hZpos : 0<(Z:ℝ) := by exact_mod_cast (zero_lt_one.trans_le hZ) + let r₀ := initialAtomicRadius ε (Z:ℝ) + have hr : 0 r₀*2^l.val + let ix : Fin j.val → Fin K := fun l => ⟨l.val,l.isLt.trans j.isLt⟩ + have hscale (l:Fin j.val) : rs (ix l) ≤ s := + (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (by norm_num : (1:ℝ) ≤ 2) l.isLt.le) hr.le).trans hjs + have hge (l:Fin j.val) : r₀ ≤ rs (ix l) := le_mul_of_one_le_right hr.le (one_le_pow₀ (by norm_num : (1:ℝ) ≤ 2)) + obtain ⟨G₀,hG₀,hp₀,hlo⟩ := Hi Z hZi hZ (J:=K) hd hn hmin hE he hnum + have HG' := fun l : Fin j.val => HG Z hZ hd hn hmin hE he hr hs hss (ix l) (hscale l) + choose G hG hp HGood using HG' + have hcost (l : Fin j.val) : + (∫ o in (G l)ᶜ,∫ y in {y : Position | rs (ix l) ≤ ‖y‖ ∧ ‖y‖<2*(rs (ix l))}, + conditionalPacketDensity P Prod.fst (tailObservation rs l.val) Coulomb.unitWindow 1 r₀ s + (tailObservation rs l.val o) y ∂volume ∂P) ≤ M*Real.sqrt Kprob*(rs (ix l))^9 := by + exact HC Z hZ hd hn hE he hD Coulomb.unitWindow.continuous Coulomb.unitWindow_mass + Coulomb.unitWindow_support (by norm_num : (0:ℝ)<1) hr hs (hge l) ((hscale l).trans hs1) + ((mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (hr.trans_le (hge l)).le (hscale l) 7) hD).trans hDs) + hq2 hK.le rs l.val (hG l).2.compl (hp l) + have HF := physical_finite_retained_datum Z hZ hd hn Coulomb.unitWindow_support Coulomb.unitWindow_mass + (by norm_num : (0:ℝ)<1) hε hB hBC hr hr1 hs (mul_nonneg hM (Real.sqrt_nonneg Kprob)) hq2 + (initialAtomicRadius_cubic hZpos) hnum hBe heC hR hbar k hG₀ hp₀ hlo G + (fun j => (hG j).1) HGood hcost + exact HF +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RadialBounds/PhysicalShellError.lean b/lean/OAI/Analysis/CoulombRadii/RadialBounds/PhysicalShellError.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec6496b4df738f92f2e0afdc608b352f118458df --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RadialBounds/PhysicalShellError.lean @@ -0,0 +1,72 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationSmallScale +import OAI.Analysis.CoulombRadii.FormDomain.RawAnnularMoment +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorShellError + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom +lemma shell_error_numeric {C K D r m p : ℝ} (hC : 0≤C) (hK : 0≤K) (hD : 0≤D) + (hr : 0 packet_shell_center hgs hc hr₀ hs hrr hq hy hk) hBad + apply H.trans + apply shell_error_numeric hC hK hD hr hr1 hDr _ hp + simpa only [one_div_mul_eq_div] using HC Z hZ hd hn hE he hD hr +end NeutralAtom + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RadialBounds/Radial.lean b/lean/OAI/Analysis/CoulombRadii/RadialBounds/Radial.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f58f2f13b61450bdfb7da2f927d3bc96fb88241 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RadialBounds/Radial.lean @@ -0,0 +1,417 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open ContinuousLinearMap +open scoped Topology BigOperators ContDiff Convolution Pointwise ENNReal +namespace NeutralAtom + +def IsRadial (w : Position → ℝ) : Prop := ∀ x y, ‖x‖ = ‖y‖ → w x = w y + +theorem potentialOf_isometry {w : Position → ℝ} (hw : IsRadial w) + (T : Position ≃ₗᵢ[ℝ] Position) (x : Position) : + potentialOf w (T x) = potentialOf w x := by + unfold potentialOf + rw [← T.measurePreserving.integral_comp T.toMeasurableEquiv.measurableEmbedding] + apply integral_congr_ae + filter_upwards [] with y + rw [← T.map_sub] + simp only [coulombKernel, T.norm_map] + rw [hw (T y) y (T.norm_map y)] + +theorem potentialOf_radial {w : Position → ℝ} (hw : IsRadial w) : + IsRadial (potentialOf w) := by + intro x y hxy + let T : Position ≃ₗᵢ[ℝ] Position := (ℝ ∙ (x-y))ᗮ.reflection + have hT : T x = y := Submodule.reflection_sub hxy + rw [← hT] + exact (potentialOf_isometry hw T x).symm + +theorem radial_potential_le_center {w : Position → ℝ} {A : ℝ} + (hi : Integrable w) (hp : ∀ x, 0 ≤ w x) (hb : ∀ x, w x ≤ A) + (hr : IsRadial w) (x : Position) : potentialOf w x ≤ potentialOf w 0 := by + by_cases hx : x = 0 + · simp [hx] + have hR : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hcont := potentialOf_continuous hi hp hb + have hrad := potentialOf_radial hr + have hw : WeakLaplacianLower (fun y => potentialOf w x-potentialOf w y) + (Metric.ball 0 ‖x‖ ∩ {y | 0 < potentialOf w x-potentialOf w y}) 0 := by + intro φ hφ hc _ hpos + have hL : Continuous (coordinateLaplacian φ) := + continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLc := hasCompactSupport_coordinateLaplacian hc + have hiP : Integrable (fun y => potentialOf w y*coordinateLaplacian φ y) := + integrable_mul_compact_of_continuousAt (fun _ _ => hcont.continuousAt) hL hLc + simp_rw [sub_mul] + rw [integral_sub ((hL.integrable_of_hasCompactSupport hLc).const_mul _) hiP, + integral_const_mul, integral_coordinateLaplacian hφ hc, + potentialOf_weakLaplacian hi φ hφ hc (Set.subset_univ _)] + simp only [zero_mul, mul_zero, zero_sub, neg_mul, integral_neg, neg_neg] + exact integral_nonneg (fun y => mul_nonneg (mul_nonneg (by positivity) (hp y)) (hpos y)) + have hh := weak_maximum_principle_closedBall hR + (continuous_const.sub hcont).continuousOn + (fun y hy => by + change potentialOf w x-potentialOf w y ≤ 0 + rw [hrad y x hy, sub_self]) hw + (0 : Position) (by simp [hR.le]) + change potentialOf w x-potentialOf w 0 ≤ 0 at hh + linarith + +theorem integrable_coulomb_pairing {ρ w : Position → ℝ} {C : ℝ} + (hρ : Integrable ρ) (hw : Integrable w) (hb : ∀ x, ‖w x‖ ≤ C) : + Integrable (fun z : Position × Position => coulombKernel (z.1-z.2)*ρ z.2*w z.1) + (volume.prod volume) := by + let k : Position → ℝ := (Metric.ball 0 1).indicator coulombKernel + have hk : Integrable k := + (coulombKernel_integrableOn_ball 1).integrable_indicator measurableSet_ball + have hn : Integrable (fun z : Position × Position => ‖ρ z.2‖*k (z.1-z.2)) + (volume.prod volume) := by + simpa using hρ.norm.convolution_integrand (ContinuousLinearMap.lsmul ℝ ℝ) hk + have hf : Integrable (fun z : Position × Position => ‖w z.1‖*‖ρ z.2‖) + (volume.prod volume) := hw.norm.mul_prod hρ.norm + have hm : AEStronglyMeasurable + (fun z : Position × Position => coulombKernel (z.1-z.2)*ρ z.2*w z.1) + (volume.prod volume) := by + have hh := hρ.aestronglyMeasurable.convolution_integrand + (ContinuousLinearMap.lsmul ℝ ℝ) (μ := volume) measurable_coulombKernel.aestronglyMeasurable + have hh' : AEStronglyMeasurable + (fun z : Position × Position => ρ z.2*coulombKernel (z.1-z.2)*w z.1) + (volume.prod volume) := hh.mul hw.aestronglyMeasurable.comp_fst + convert hh' using 1 + ext z + ring + refine Integrable.mono' ((hn.const_mul C).add hf) hm (Filter.Eventually.of_forall ?_) + intro z + have hK : coulombKernel (z.1-z.2) ≤ k (z.1-z.2)+1 := by + by_cases hz : z.1-z.2 ∈ Metric.ball (0 : Position) 1 + · simp only [k, Set.indicator_of_mem hz] + linarith + · have hl : 1 ≤ ‖z.1-z.2‖ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using hz + have hh : ‖z.1-z.2‖⁻¹ ≤ (1:ℝ) := by simpa using inv_anti₀ (by norm_num : (0:ℝ)<1) hl + simpa only [k, Set.indicator_of_notMem hz, zero_add, coulombKernel] using hh + have hkpos : 0 ≤ k (z.1-z.2) := Set.indicator_nonneg (fun y _ => coulombKernel_nonneg y) _ + rw [norm_mul, norm_mul, Real.norm_eq_abs, abs_of_nonneg (coulombKernel_nonneg _)] + calc + coulombKernel (z.1-z.2)*‖ρ z.2‖*‖w z.1‖ ≤ + (k (z.1-z.2)+1)*‖ρ z.2‖*‖w z.1‖ := by gcongr + _ = ‖ρ z.2‖*k (z.1-z.2)*‖w z.1‖+‖w z.1‖*‖ρ z.2‖ := by ring + _ ≤ C*(‖ρ z.2‖*k (z.1-z.2))+‖w z.1‖*‖ρ z.2‖ := by + nlinarith [mul_nonneg (norm_nonneg (ρ z.2)) hkpos, + mul_le_mul_of_nonneg_left (hb z.1) (mul_nonneg (norm_nonneg (ρ z.2)) hkpos)] + +theorem coulomb_pairing_comm {ρ w : Position → ℝ} {C : ℝ} + (hρ : Integrable ρ) (hw : Integrable w) (hb : ∀ x, ‖w x‖ ≤ C) : + (∫ x, potentialOf ρ x*w x) = ∫ y, potentialOf w y*ρ y := by + calc + (∫ x, potentialOf ρ x*w x) = ∫ x, ∫ y, coulombKernel (x-y)*ρ y*w x := by + simp only [potentialOf, integral_mul_const] + _ = ∫ y, ∫ x, coulombKernel (x-y)*ρ y*w x := + integral_integral_swap (integrable_coulomb_pairing hρ hw hb) + _ = ∫ y, potentialOf w y*ρ y := by + apply integral_congr_ae + filter_upwards [] with y + simp only [potentialOf, ← integral_mul_const] + apply integral_congr_ae + filter_upwards [] with x + simp only [coulombKernel, norm_sub_rev x y] + ring + +theorem neutral_radial_average_nonneg {σ w : Position → ℝ} {lam Aσ Aw : ℝ} + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hmass : (∫ x, σ x) = lam) + (hw : Integrable w) (hwpos : ∀ x, 0 ≤ w x) (hwbd : ∀ x, w x ≤ Aw) + (hwrad : IsRadial w) : + 0 ≤ ∫ x, (lam*coulombKernel x-potentialOf σ x)*w x := by + have hwabs : ∀ x, ‖w x‖ ≤ Aw := fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (hwpos x)] + exact hwbd x + have hiK : Integrable (fun x => coulombKernel x*w x) := by + have hh := (bounded_density_convolution measurable_coulombKernel coulombKernel_nonneg + (coulombKernel_integrableOn_ball 1) (fun _ h => coulombKernel_le_one h) + hw hwpos hwbd (0 : Position)).1 + simpa [coulombKernel] using hh + have hiP : Integrable (fun x => potentialOf σ x*w x) := by + have hh := (integrable_coulomb_pairing hσ hw hwabs).integral_prod_left + simpa only [potentialOf, integral_mul_const] using hh + have hiPw : Integrable (fun x => potentialOf w x*σ x) := by + have hh := (integrable_coulomb_pairing hw hσ (fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (hσpos x)] + exact hσbd x)).integral_prod_left + simpa only [potentialOf, integral_mul_const] using hh + have hmax : ∀ x, potentialOf w x*σ x ≤ potentialOf w 0*σ x := fun x => + mul_le_mul_of_nonneg_right (radial_potential_le_center hw hwpos hwbd hwrad x) (hσpos x) + have hle := integral_mono hiPw (hσ.const_mul (potentialOf w 0)) hmax + rw [integral_const_mul, hmass] at hle + have hzero : potentialOf w 0 = ∫ x, coulombKernel x*w x := by + simp only [potentialOf, coulombKernel, zero_sub, norm_neg] + simp_rw [sub_mul] + have hilam : Integrable (fun x => lam*coulombKernel x*w x) := by + simpa only [mul_assoc] using hiK.const_mul lam + rw [integral_sub hilam hiP, coulomb_pairing_comm hσ hw hwabs] + simp_rw [mul_assoc lam, integral_const_mul] + rw [← hzero] + nlinarith + +theorem neutral_weighted_lone_bound {σ w : Position → ℝ} {lam Aσ Aw B : ℝ} + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hmass : (∫ x, σ x) = lam) + (hw : Integrable w) (hwpos : ∀ x, 0 ≤ w x) (hwbd : ∀ x, w x ≤ Aw) + (hwrad : IsRadial w) (hB : 0 ≤ B) + (hcap : ∀ x, w x ≠ 0 → lam*coulombKernel x-potentialOf σ x ≤ B) : + (∫ x, |lam*coulombKernel x-potentialOf σ x| *w x) ≤ 2*B*(∫ x, w x) := by + let F (x : Position) := lam*coulombKernel x-potentialOf σ x + have hwabs : ∀ x, ‖w x‖ ≤ Aw := fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (hwpos x)] + exact hwbd x + have hiK : Integrable (fun x => coulombKernel x*w x) := by + have hh := (bounded_density_convolution measurable_coulombKernel coulombKernel_nonneg + (coulombKernel_integrableOn_ball 1) (fun _ h => coulombKernel_le_one h) + hw hwpos hwbd (0 : Position)).1 + simpa [coulombKernel] using hh + have hiP : Integrable (fun x => potentialOf σ x*w x) := by + have hh := (integrable_coulomb_pairing hσ hw hwabs).integral_prod_left + simpa only [potentialOf, integral_mul_const] using hh + have hiF : Integrable (fun x => F x*w x) := by + simpa only [Pi.sub_def, F, sub_mul, mul_assoc] using (hiK.const_mul lam).sub hiP + have hiabs : Integrable (fun x => |F x| *w x) := by + simpa only [Real.norm_eq_abs, abs_mul, abs_of_nonneg (hwpos _)] using hiF.norm + have hle : ∀ x, |F x| *w x ≤ 2*B*w x-F x*w x := by + intro x + by_cases hx : w x = 0 + · simp [hx] + · have hh := hcap x hx + have hh' : |F x| ≤ 2*B-F x := by + rw [abs_le] + constructor <;> dsimp [F] <;> linarith + nlinarith [mul_le_mul_of_nonneg_right hh' (hwpos x)] + have hh := integral_mono hiabs ((hw.const_mul (2*B)).sub hiF) hle + simp only [Pi.sub_apply] at hh + rw [integral_sub (hw.const_mul (2*B)) hiF, integral_const_mul] at hh + have hmean := neutral_radial_average_nonneg hσ hσpos hσbd hmass hw hwpos hwbd hwrad + change 0 ≤ ∫ x, F x*w x at hmean + linarith + +theorem neutral_annulus_lone_bound {σ : Position → ℝ} {lam Aσ C a b : ℝ} + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hmass : (∫ x, σ x) = lam) (ha : 0 < a) (hC : 0 ≤ C) + (hcap : ∀ x : Position, a ≤ ‖x‖ → ‖x‖ ≤ b → + lam*coulombKernel x-potentialOf σ x ≤ C/(‖x‖^4)) : + (∫ x in {x : Position | a ≤ ‖x‖ ∧ ‖x‖ ≤ b}, + |lam*coulombKernel x-potentialOf σ x|) ≤ + 2*(C/a^4)*(volume {x : Position | a ≤ ‖x‖ ∧ ‖x‖ ≤ b}).toReal := by + let s : Set Position := {x | a ≤ ‖x‖ ∧ ‖x‖ ≤ b} + let w : Position → ℝ := s.indicator (fun _ => 1) + have hs : IsCompact s := by + have hs' : s = Metric.closedBall (0 : Position) b ∩ {x | a ≤ ‖x‖} := by + ext x + simp only [s, Set.mem_ofPred_eq, Set.mem_inter_iff, Metric.mem_closedBall, + dist_zero_right, and_comm] + rw [hs'] + exact (isCompact_closedBall (0 : Position) b).inter_right (isClosed_le continuous_const continuous_norm) + have hw : Integrable w := by + apply (integrable_indicator_iff hs.measurableSet).mpr + exact integrableOn_const hs.measure_ne_top + have hwpos : ∀ x, 0 ≤ w x := fun x => Set.indicator_nonneg (fun _ _ => by norm_num) x + have hwbd : ∀ x, w x ≤ 1 := by + intro x + by_cases hx : x ∈ s <;> simp [w, hx] + have hwrad : IsRadial w := by + intro x y hxy + by_cases hx : a ≤ ‖x‖ ∧ ‖x‖ ≤ b + · have hy : a ≤ ‖y‖ ∧ ‖y‖ ≤ b := by simpa only [hxy] using hx + simp [w, s, hx, hy] + · have hy : ¬(a ≤ ‖y‖ ∧ ‖y‖ ≤ b) := by simpa only [hxy] using hx + simp [w, s, hx, hy] + have hB : 0 ≤ C/a^4 := div_nonneg hC (by positivity) + have hcap' : ∀ x, w x ≠ 0 → lam*coulombKernel x-potentialOf σ x ≤ C/a^4 := by + intro x hx + have hxs : x ∈ s := by + by_contra h + exact hx (Set.indicator_of_notMem h _) + exact (hcap x hxs.1 hxs.2).trans + (div_le_div_of_nonneg_left hC (by positivity) (pow_le_pow_left₀ ha.le hxs.1 4)) + have hh := neutral_weighted_lone_bound hσ hσpos hσbd hmass hw hwpos hwbd hwrad hB hcap' + have heq : (fun x => |lam*coulombKernel x-potentialOf σ x| *w x) = + s.indicator (fun x => |lam*coulombKernel x-potentialOf σ x|) := by + ext x + by_cases hx : x ∈ s <;> simp [w, hx] + rw [heq, integral_indicator hs.measurableSet] at hh + have hiw : (∫ x, w x) = (volume s).toReal := by + rw [show w = s.indicator (fun _ => (1:ℝ)) from rfl, + integral_indicator hs.measurableSet, integral_const] + simp only [Measure.restrict_apply_univ, smul_eq_mul, mul_one, measureReal_def] + rw [hiw] at hh + exact hh + +theorem locallyUniform_subsequence_of_equicontinuous + {X : Type*} [PseudoMetricSpace X] [LocallyCompactSpace X] + [SecondCountableTopology X] + (F : ℕ → C(X, ℝ)) + (heq : Equicontinuous (fun n x => F n x)) + (hbd : ∀ x, ∃ M : ℝ, ∀ n, ‖F n x‖ ≤ M) : + ∃ f : C(X, ℝ), ∃ φ : ℕ → ℕ, StrictMono φ ∧ + TendstoLocallyUniformly (fun n x => F (φ n) x) f atTop := by + let : T2Space (UniformOnFun X ℝ {K : Set X | IsCompact K}) := + UniformOnFun.t2Space_of_covering (by + apply Set.eq_univ_of_forall + intro x + exact Set.mem_sUnion_of_mem (Set.mem_singleton x) isCompact_singleton) + let S := Set.range F + have hs : IsCompact (closure S) := by + apply ArzelaAscoli.isCompact_closure_of_isClosedEmbedding + (F := fun f : C(X, ℝ) => (f : X → ℝ)) + (𝔖 := {K : Set X | IsCompact K}) (fun _ hK => hK) + ContinuousMap.isUniformEmbedding_toUniformOnFunIsCompact.isClosedEmbedding + · intro K _ + let pick : S → ℕ := fun f => Classical.choose f.property + have hp (f : S) : F (pick f) = f.val := Classical.choose_spec f.property + have hh := (heq.comp pick).equicontinuousOn K + convert hh using 1 + ext f x + exact congrArg (fun u : C(X, ℝ) => u x) (hp f).symm + · intro K _ x _ + obtain ⟨M, hM⟩ := hbd x + refine ⟨Set.Icc (-M) M, isCompact_Icc, ?_⟩ + rintro f ⟨n, rfl⟩ + exact abs_le.mp (hM n) + obtain ⟨f, _, φ, hφ, ht⟩ := hs.tendsto_subseq (fun n => subset_closure (Set.mem_range_self n)) + refine ⟨f, φ, hφ, ?_⟩ + exact ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp ht + +theorem equicontinuous_of_eventual_local_lipschitz + {X : Type*} [PseudoMetricSpace X] (F : ℕ → X → ℝ) + (hc : ∀ n, Continuous (F n)) + (hl : ∀ x, ∃ (r C : ℝ) (N : ℕ), 0 < r ∧ 0 ≤ C ∧ + ∀ n, N ≤ n → ∀ y ∈ Metric.ball x r, ‖F n x-F n y‖ ≤ C*dist y x) : + Equicontinuous F := by + intro x + obtain ⟨r, C, N, hr, hC, hN⟩ := hl x + apply Metric.equicontinuousAt_iff.mpr + intro ε hε + have hf : EquicontinuousAt (fun n : Fin N => F n) x := + equicontinuousAt_finite.mpr (fun n => (hc n).continuousAt) + obtain ⟨δ, hδ, hd⟩ := Metric.equicontinuousAt_iff.mp hf ε hε + refine ⟨min r (min δ (ε/(C+1))), lt_min hr (lt_min hδ (div_pos hε (by linarith))), ?_⟩ + intro y hy n + have hyr : dist y x < r := lt_of_lt_of_le hy (min_le_left _ _) + have hyδ : dist y x < δ := lt_of_lt_of_le hy ((min_le_right _ _).trans (min_le_left _ _)) + have hyε : dist y x < ε/(C+1) := + lt_of_lt_of_le hy ((min_le_right _ _).trans (min_le_right _ _)) + by_cases hn : n < N + · exact hd y hyδ ⟨n, hn⟩ + · have hh := hN n (le_of_not_gt hn) y hyr + rw [dist_eq_norm] + have hmul := (lt_div_iff₀ (by linarith : 0 < C+1)).mp hyε + nlinarith [dist_nonneg (x := y) (y := x)] + +theorem norm_bounded_of_eventually_bounded (a : ℕ → ℝ) {C : ℝ} (hC : 0 ≤ C) + (h : ∀ᶠ n in atTop, ‖a n‖ ≤ C) : ∃ M : ℝ, ∀ n, ‖a n‖ ≤ M := by + obtain ⟨N, hN⟩ := eventually_atTop.mp h + refine ⟨C+∑ j ∈ Finset.range N, ‖a j‖, ?_⟩ + intro n + have hs : 0 ≤ ∑ j ∈ Finset.range N, ‖a j‖ := Finset.sum_nonneg (fun _ _ => norm_nonneg _) + by_cases hn : n < N + · have hh := Finset.single_le_sum (fun j (_ : j ∈ Finset.range N) => norm_nonneg (a j)) + (Finset.mem_range.mpr hn) + linarith + · have hh := hN n (le_of_not_gt hn) + linarith + +theorem locallyUniform_subsequence_of_eventual_ball_estimates + {X : Type*} [PseudoMetricSpace X] [LocallyCompactSpace X] + [SecondCountableTopology X] (F : ℕ → X → ℝ) + (hc : ∀ n, Continuous (F n)) + (he : ∀ x, ∃ (r C : ℝ) (N : ℕ), 0 < r ∧ 0 ≤ C ∧ + ∀ n, N ≤ n → ‖F n x‖ ≤ C ∧ + ∀ y ∈ Metric.ball x r, ∀ z ∈ Metric.ball x r, + ‖F n y-F n z‖ ≤ C*dist y z) : + ∃ f : C(X, ℝ), ∃ φ : ℕ → ℕ, StrictMono φ ∧ + TendstoLocallyUniformly (fun n x => F (φ n) x) f atTop ∧ + LocallyLipschitzOn Set.univ f := by + let G : ℕ → C(X, ℝ) := fun n => ⟨F n, hc n⟩ + have hEq : Equicontinuous (fun n x => G n x) := by + apply equicontinuous_of_eventual_local_lipschitz F hc + intro x + obtain ⟨r, C, N, hr, hC, hN⟩ := he x + refine ⟨r, C, N, hr, hC, ?_⟩ + intro n hn y hy + simpa only [dist_comm x y] using (hN n hn).2 x (Metric.mem_ball_self hr) y hy + have hBd : ∀ x, ∃ M : ℝ, ∀ n, ‖G n x‖ ≤ M := by + intro x + obtain ⟨r, C, N, _, hC, hN⟩ := he x + exact norm_bounded_of_eventually_bounded (fun n => F n x) hC + (eventually_atTop.mpr ⟨N, fun n hn => (hN n hn).1⟩) + obtain ⟨f, φ, hφ, hu⟩ := locallyUniform_subsequence_of_equicontinuous G hEq hBd + refine ⟨f, φ, hφ, hu, ?_⟩ + intro x _ + obtain ⟨r, C, N, hr, _, hN⟩ := he x + refine ⟨C.toNNReal, Metric.ball x r, ?_, ?_⟩ + · simpa only [nhdsWithin_univ] using Metric.ball_mem_nhds x hr + · apply LipschitzOnWith.of_dist_le' + intro y hy z hz + have ht (w : X) : Tendsto (fun n => F (φ n) w) atTop (𝓝 (f w)) := + hu.tendstoLocallyUniformlyOn.tendsto_at (Set.mem_univ w) + have hn : ∀ᶠ n : ℕ in atTop, N ≤ φ n := hφ.tendsto_atTop.eventually (eventually_ge_atTop N) + have hl := le_of_tendsto ((ht y).sub (ht z)).norm (hn.mono (fun n hn => (hN (φ n) hn).2 y hy z hz)) + simpa only [dist_eq_norm] using hl + +def screenedField (lam : ℝ) (σ : Position → ℝ) (x : Position) : ℝ := + lam*coulombKernel x-potentialOf σ x + +theorem screenedField_continuousOn {lam A : ℝ} {σ : Position → ℝ} + (hi : Integrable σ) (hp : ∀ x, 0 ≤ σ x) (hb : ∀ x, σ x ≤ A) : + ContinuousOn (screenedField lam σ) {x | x ≠ 0} := by + intro x hx + have hk : ContinuousAt coulombKernel x := + continuous_norm.continuousAt.inv₀ (norm_ne_zero_iff.mpr hx) + exact ((continuousAt_const.mul hk).sub + (potentialOf_continuous hi hp hb).continuousAt).continuousWithinAt + +theorem screenedField_weakLaplacian {lam A : ℝ} {σ : Position → ℝ} + (hi : Integrable σ) (hp : ∀ x, 0 ≤ σ x) (hb : ∀ x, σ x ≤ A) : + HasWeakLaplacian (screenedField lam σ) {x | x ≠ 0} (fun x => 4*Real.pi*σ x) := by + intro φ hφ hc ht + have hLc : Continuous (coordinateLaplacian φ) := + continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLs := hasCompactSupport_coordinateLaplacian hc + have hiK : Integrable (fun x => coulombKernel x*coordinateLaplacian φ x) := by + simpa only [smul_eq_mul, Pi.mul_apply] using + locallyIntegrable_coulombKernel.integrable_smul_right_of_hasCompactSupport hLc hLs + have hiP : Integrable (fun x => potentialOf σ x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt (fun _ _ => (potentialOf_continuous hi hp hb).continuousAt) + hLc hLs + have hzero : φ 0 = 0 := image_eq_zero_of_notMem_tsupport (fun hx => ht hx rfl) + calc + (∫ x, screenedField lam σ x*coordinateLaplacian φ x) = + lam*(∫ x, coulombKernel x*coordinateLaplacian φ x)- + ∫ x, potentialOf σ x*coordinateLaplacian φ x := by + simp only [screenedField, sub_mul, mul_assoc] + rw [integral_sub (hiK.const_mul lam) hiP, integral_const_mul] + _ = ∫ x, (4*Real.pi*σ x)*φ x := by + rw [integral_coulombKernel_laplacian hφ hc, hzero, + potentialOf_weakLaplacian hi φ hφ hc (Set.subset_univ _)] + simp only [mul_zero, neg_zero, zero_sub, ← integral_neg] + congr 1 + ext x + ring + +theorem isCompact_closedNormAnnulus (a b : ℝ) : + IsCompact {x : Position | a ≤ ‖x‖ ∧ ‖x‖ ≤ b} := by + have he : {x : Position | a ≤ ‖x‖ ∧ ‖x‖ ≤ b} = + Metric.closedBall (0 : Position) b ∩ {x | a ≤ ‖x‖} := by + ext x + simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, Metric.mem_closedBall, + dist_zero_right, and_comm] + rw [he] + exact (isCompact_closedBall (0 : Position) b).inter_right (isClosed_le continuous_const continuous_norm) + +end NeutralAtom +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RadialBounds/SpatialAnnulus.lean b/lean/OAI/Analysis/CoulombRadii/RadialBounds/SpatialAnnulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..c15accfd3aa7e0e078824e138fb2619283badf78 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RadialBounds/SpatialAnnulus.lean @@ -0,0 +1,328 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.UniformGroundStateCountControl + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +theorem rawCount_le_packetMass {n : ℕ} (g : Position → ℝ) + (hg : (∫ y, g y ^ 2) = 1) {c₁ r₀ s : ℝ} (hc : 0 < c₁) + (hr : 0 < r₀) (hs : 0 < s) (S T : Set Position) + (hST : ∀ z y, z ∈ S → packetKernel g c₁ r₀ s z y ≠ 0 → y ∈ T) + (x : Configuration n) : rawCount S x ≤ packetMass g c₁ r₀ s T x := by + classical + apply Finset.sum_le_sum + intro i _ + by_cases hi : x i ∈ S + · simp only [Set.indicator_of_mem hi] + have h := setIntegral_eq_integral_of_forall_compl_eq_zero + (s := T) (μ := volume) (f := packetKernel g c₁ r₀ s (x i)) (fun y hy => by + by_contra hK + exact hy (hST (x i) y hi hK)) + rw [h, integral_packetKernel g hg hc hr hs] + · simp only [Set.indicator_of_notMem hi] + exact integral_nonneg fun y => packetKernel_nonneg g hc hr hs (x i) y + +def spatialAnnulus (a b : ℝ) : Set Position := {x | a < ‖x‖ ∧ ‖x‖ < b} + +theorem measurableSet_spatialAnnulus (a b : ℝ) : MeasurableSet (spatialAnnulus a b) := + (isOpen_lt continuous_const continuous_norm).measurableSet.inter + (isOpen_lt continuous_norm continuous_const).measurableSet + +theorem packetMass_annulus_sandwich {n : ℕ} (g : Position → ℝ) + (hgnorm : (∫ y, g y ^ 2) = 1) (hgsupp : ∀ x, 1 < ‖x‖ → g x = 0) + {c₁ r₀ s a b η : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ha : 0 < a) (hab : a < b) (hη : 0 < η) (hηa : η < a) + (hδ : (c₁ * s ^ packetExponent) * b < η) + (hclamp : (1 + c₁ * s ^ packetExponent) * r₀ ≤ (a-η)*s) + (x : Configuration n) : + packetMass g c₁ r₀ s (spatialAnnulus ((a+η)*s) ((b-η)*s)) x ≤ + rawCount (spatialAnnulus (a*s) (b*s)) x ∧ + rawCount (spatialAnnulus (a*s) (b*s)) x ≤ + packetMass g c₁ r₀ s (spatialAnnulus ((a-η)*s) ((b+η)*s)) x := by + have hdpos : 0 < c₁ * s ^ packetExponent := mul_pos hc (Real.rpow_pos_of_pos hs _) + have hdb : 0 < b := ha.trans hab + have hd1 : c₁ * s ^ packetExponent < 1 := by nlinarith + have hr_as : r₀ < a*s := by nlinarith + constructor + · apply packetMass_le_rawCount g hgnorm hc hr hs + intro z y hy hK + change (a+η)*s < ‖y‖ ∧ ‖y‖ < (b-η)*s at hy + have hz : r₀ ≤ ‖z‖ := by + by_contra! hz + have hyc := packetKernel_clamped_support g hgsupp hc hr hs z y hz.le hK + nlinarith + obtain ⟨hl, hu⟩ := packetKernel_relative_support g hgsupp hc hr hs z y hz hK + change a*s < ‖z‖ ∧ ‖z‖ < b*s + constructor + · by_contra! hn + have hstep : (1+c₁*s^packetExponent)*‖z‖ ≤ (1+c₁*s^packetExponent)*(a*s) := + mul_le_mul_of_nonneg_left hn (by positivity) + have hδa : (c₁*s^packetExponent)*a < η := by nlinarith + have hsmall := mul_lt_mul_of_pos_right hδa hs + nlinarith + · by_contra! hn + have hstep : (1-c₁*s^packetExponent)*(b*s) ≤ (1-c₁*s^packetExponent)*‖z‖ := + mul_le_mul_of_nonneg_left hn (by linarith) + have hsmall := mul_lt_mul_of_pos_right hδ hs + nlinarith + · apply rawCount_le_packetMass g hgnorm hc hr hs + intro z y hz hK + change a*s < ‖z‖ ∧ ‖z‖ < b*s at hz + obtain ⟨hl, hu⟩ := packetKernel_relative_support g hgsupp hc hr hs z y + (hr_as.le.trans hz.1.le) hK + have hsmall := mul_lt_mul_of_pos_right hδ hs + have hstep : (c₁*s^packetExponent)*‖z‖ < (c₁*s^packetExponent)*(b*s) := + mul_lt_mul_of_pos_left hz.2 hdpos + change (a-η)*s < ‖y‖ ∧ ‖y‖ < (b+η)*s + constructor <;> nlinarith + +theorem conditional_integral_square_le {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (_hm : m ≤ m₀) {X : Ω → ℝ} (hX : MemLp X 2 μ) : + (∫ z, μ[X | m] z ^ 2 ∂μ) ≤ ∫ z, X z ^ 2 ∂μ := by + have hnorm : Integrable (fun z => ‖X z‖ ^ (2 : ℝ)) μ := by + simpa only [Real.rpow_two, Real.norm_eq_abs, sq_abs] using hX.integrable_sq + have hJ := integral_norm_condExp_rpow_le (m := m) (by norm_num : (1 : ℝ) ≤ 2) hnorm + simpa only [Real.rpow_two, Real.norm_eq_abs, sq_abs] using hJ + +theorem conditional_l2_le {Ω : Type*} [m₀ : MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {m : MeasurableSpace Ω} + (hm : m ≤ m₀) {X : Ω → ℝ} (hX : MemLp X 2 μ) : + Real.sqrt (∫ z, μ[X | m] z ^ 2 ∂μ) ≤ Real.sqrt (∫ z, X z ^ 2 ∂μ) := + by exact Real.sqrt_le_sqrt (conditional_integral_square_le (m₀ := m₀) (m := m) μ hm hX) + +theorem exteriorMass_sub {N : ℕ} {ψ : Wavefunction (N+1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {r R : ℝ} (hrR : r ≤ R) : + exteriorMass ψ r - exteriorMass ψ R = ∫ x in spatialAnnulus r R, density ψ x := by + unfold exteriorMass + rw [← setIntegral_sdiff (isOpen_lt continuous_const continuous_norm).measurableSet + (integrable_density hψ).integrableOn (by intro x hx; exact lt_of_le_of_lt hrR hx)] + apply setIntegral_congr_set + have hsphere : ∀ᵐ x : Position, x ∉ Metric.sphere (0 : Position) R := by + rw [ae_iff] + convert Measure.addHaar_sphere volume (0 : Position) R using 1 + congr 1 + ext x + simp + filter_upwards [hsphere] with x hx + simp only [Metric.mem_sphere, dist_zero_right] at hx + apply propext + change (r < ‖x‖ ∧ ¬ R < ‖x‖) ↔ (r < ‖x‖ ∧ ‖x‖ < R) + constructor + · rintro ⟨hr, hR⟩ + exact ⟨hr, lt_of_le_of_ne (le_of_not_gt hR) hx⟩ + · exact fun h => ⟨h.1, not_lt_of_ge h.2.le⟩ + +theorem dyadic_tail_bound {T : ℝ → ℝ} {A B : ℝ} (hA : 0 ≤ A) + (hT : Antitone T) (hB : T 1 ≤ B) + (hshell : ∀ r : ℝ, 0 < r → r < 1 → T r - T (2*r) ≤ A / r^3) + {r : ℝ} (hr : 0 < r) : T r ≤ ((8/7 : ℝ)*A) / r^3 + B := by + have hind : ∀ n : ℕ, ∀ u : ℝ, 0 < u → 1 ≤ (2:ℝ)^n*u → + T u ≤ ((8/7 : ℝ)*A) / u^3 + B := by + intro n + induction n with + | zero => + intro u hu htop + have ht : T u ≤ B := (hT (by simpa using htop)).trans hB + have : 0 ≤ ((8/7 : ℝ)*A) / u^3 := by positivity + linarith + | succ n ih => + intro u hu htop + by_cases hu1 : 1 ≤ u + · have ht := (hT hu1).trans hB + have : 0 ≤ ((8/7 : ℝ)*A) / u^3 := by positivity + linarith + · have htop' : 1 ≤ (2:ℝ)^n*(2*u) := by + simpa only [pow_succ, mul_assoc] using htop + have hnext := ih (2*u) (by positivity) htop' + have hnow := hshell u hu (lt_of_not_ge hu1) + have hid : A/u^3 + ((8/7:ℝ)*A)/(2*u)^3 = ((8/7:ℝ)*A)/u^3 := by + field_simp + ring + linarith + obtain ⟨n, hn⟩ := ((tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1:ℝ)<2)).eventually + (eventually_ge_atTop (1/r))).exists + exact hind n r hr ((div_le_iff₀ hr).mp hn) + +def Admissible (Zbar : ℝ → ℕ) (s : ℕ → ℝ) (N : ℕ → ℕ) : Prop := + (∀ᶠ n in atTop, 0 < s n) ∧ Tendsto s atTop (𝓝 0) ∧ + (∀ᶠ n in atTop, Zbar (s n) ≤ N n + 1) ∧ + Tendsto (fun n => (N n + 1 : ℝ) * s n ^ (3 : ℕ)) atTop atTop + +def ExpectedExteriorAsymptotic (Zbar : ℝ → ℕ) : Prop := + ∀ (s : ℕ → ℝ) (N : ℕ → ℕ), Admissible Zbar s N → + ∀ ψ : ∀ n, Wavefunction (N n + 1), + (∀ n, IsNormalizedGroundState (N n + 1) (ψ n)) → + ∀ a : ℝ, 0 < a → + Tendsto (fun n => s n ^ (3 : ℕ) * exteriorMass (ψ n) (a*s n)) + atTop (𝓝 (bTF^ (3 : ℕ) / a^ (3 : ℕ))) + +def radiusChargeThreshold (Zbar : ℝ → ℕ) (m : ℕ) : ℕ := + max (Zbar ((m : ℝ)^(-(1/3 : ℝ)))) ((m+1)^2) + +theorem radius_scales_admissible (Zbar : ℝ → ℕ) (m N : ℕ → ℕ) + (hm : StrictMono m) (hN : ∀ n, radiusChargeThreshold Zbar (m n) ≤ N n) : + Admissible Zbar (fun n => (m n : ℝ)^(-(1/3 : ℝ))) N := by + have hmR : Tendsto (fun n => (m n : ℝ)) atTop atTop := + tendsto_natCast_atTop_atTop.comp hm.tendsto_atTop + have hmp : ∀ᶠ n in atTop, 0 < (m n : ℝ) := hmR.eventually (eventually_gt_atTop 0) + refine ⟨hmp.mono (fun n hn => Real.rpow_pos_of_pos hn _), + (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ)<1/3)).comp hmR, ?_, ?_⟩ + · exact Eventually.of_forall fun n => + ((le_max_left _ _).trans (hN n)).trans (Nat.le_succ _) + · apply tendsto_atTop_mono' atTop _ hmR + filter_upwards [hmp] with n hn + rw [Real.rpow_neg hn.le, inv_pow, cube_root_cube, ← div_eq_mul_inv] + apply (le_div_iff₀ hn).mpr + have hlarge : ((m n + 1 : ℕ) : ℝ)^2 ≤ (N n : ℝ) := by + exact_mod_cast ((le_max_right _ _).trans (hN n)) + simp only [Nat.cast_add, Nat.cast_one] at hlarge + nlinarith + +theorem iterated_limits_of_expected_exterior_asymptotic (Zbar : ℝ → ℕ) + (htail : ExpectedExteriorAsymptotic Zbar) + (Ψ : ∀ N : ℕ, Wavefunction (N + 1)) + (hΨ : ∀ N, IsNormalizedGroundState (N+1) (Ψ N)) : + Tendsto (fun m : ℕ => (((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) : EReal) * upperRadius Ψ m) + atTop (𝓝 (bTF : EReal)) ∧ + Tendsto (fun m : ℕ => (((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) : EReal) * lowerRadius Ψ m) + atTop (𝓝 (bTF : EReal)) := by + have huniform : ∀ a : ℝ, 0 < a → ∀ ε : ℝ, 0 < ε → + ∀ᶠ m : ℕ in atTop, ∀ N, radiusChargeThreshold Zbar m ≤ N → + ∀ ψ : Wavefunction (N+1), IsNormalizedGroundState (N+1) ψ → + |exteriorMass ψ (a / (m : ℝ)^(1/3 : ℝ)) / m - bTF^ (3 : ℕ) / a^ (3 : ℕ)| < ε := by + intro a ha + apply uniform_threshold_of_sequential + (fun N ψ => IsNormalizedGroundState (N+1) ψ) + (radiusChargeThreshold Zbar) + (fun m N ψ => exteriorMass ψ (a / (m : ℝ)^(1/3 : ℝ)) / m) + (bTF^ (3 : ℕ) / a^ (3 : ℕ)) + intro m N hm hN ψ hψ + have ht := htail _ _ (radius_scales_admissible Zbar m N hm hN) ψ hψ a ha + simpa only [normalized_tail_scale] using ht + apply iterated_limits_of_radius_brackets Ψ + intro l u hl hlb hbu + have hu : 0 < u := bTF_pos.trans hbu + have cl : 1 < bTF^ (3 : ℕ) / l^ (3 : ℕ) := + (one_lt_div₀ (pow_pos hl 3)).mpr (pow_lt_pow_left₀ hlb hl.le (by decide)) + have cu : bTF^ (3 : ℕ) / u^ (3 : ℕ) < 1 := + (div_lt_one (pow_pos hu 3)).mpr (pow_lt_pow_left₀ hbu bTF_pos.le (by decide)) + filter_upwards [huniform l hl ((bTF^ (3 : ℕ) / l^ (3 : ℕ) - 1)/2) (by linarith), + huniform u hu ((1 - bTF^ (3 : ℕ) / u^ (3 : ℕ))/2) (by linarith), + eventually_gt_atTop (0 : ℕ)] with m hml hmu hm + filter_upwards [eventually_ge_atTop (radiusChargeThreshold Zbar m)] with N hN + have hmp : 0 < (m : ℝ) := by exact_mod_cast hm + have hc : 0 < (m : ℝ)^(1/3 : ℝ) := Real.rpow_pos_of_pos hmp _ + have hL := (abs_lt.mp (hml N hN (Ψ N) (hΨ N))).1 + have hU := (abs_lt.mp (hmu N hN (Ψ N) (hΨ N))).2 + have hL' : (m : ℝ) < exteriorMass (Ψ N) (l / (m : ℝ)^(1/3 : ℝ)) := + (one_lt_div₀ hmp).mp (by linarith) + have hU' : exteriorMass (Ψ N) (u / (m : ℝ)^(1/3 : ℝ)) < (m : ℝ) := + (div_lt_one hmp).mp (by linarith) + obtain ⟨g, hdom, _, _⟩ := hΨ N + obtain ⟨hlo, hup⟩ := radius_bracket hdom.2.2.1 hL' (by positivity) hU'.le + exact ⟨by simpa [mul_comm] using (div_le_iff₀ hc).mp hlo, + by simpa [mul_comm] using (le_div_iff₀ hc).mp hup⟩ + +theorem rawExpectation_count_le_l2 {N : ℕ} {ψ : Wavefunction (N+1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ = 1) + {S : Set Position} (hS : MeasurableSet S) : + rawExpectation ψ (rawCount S) ≤ + Real.sqrt (rawExpectation ψ (fun x => (rawCount S x)^2)) := by + have := rawLaw_isProbability hψ hn + have h := exceptional_event_bound (rawCount_memLp hψ hn hS) + (Eventually.of_forall (rawCount_nonneg S)) MeasurableSet.univ + simpa only [setIntegral_univ, probReal_univ, Real.sqrt_one, mul_one, + integral_rawLaw hψ] using h + +theorem small_shell_bounds_of_count_control (hcount : UniformGroundStateCountControl) : + ∃ (A B : ℝ) (Z₀ : ℕ), 0 ≤ A ∧ 0 ≤ B ∧ + ∀ (N : ℕ) (ψ : Wavefunction (N+1)), Z₀ ≤ N+1 → + IsNormalizedGroundState (N+1) ψ → + exteriorMass ψ 1 ≤ B ∧ ∀ r : ℝ, 0 < r → r < 1 → + exteriorMass ψ r - exteriorMass ψ (2*r) ≤ A/r^3 := by + obtain ⟨D, Z₀, hD, hann, C₀, hC₀, h₀⟩ := hcount + obtain ⟨C, hC, hCbound⟩ := hann 1 2 (by norm_num) (by norm_num) + refine ⟨C*(1+Real.sqrt D), C₀*(1+Real.sqrt D), Z₀, by positivity, by positivity, ?_⟩ + intro N ψ hZ hψ + refine ⟨h₀ N ψ hZ hψ, ?_⟩ + intro r hr hr1 + obtain ⟨g, hdom, hnorm, _⟩ := hψ + have hbound := hCbound N ψ hZ ⟨g, hdom, hnorm, by assumption⟩ r hr + have hmean := rawExpectation_count_le_l2 hdom.2.2.1 hnorm + (measurableSet_spatialAnnulus (a := r) (b := 2*r)) + have hmean' : exteriorMass ψ r - exteriorMass ψ (2*r) ≤ + C * (max (r^3)⁻¹ 1 + Real.sqrt (D*r)) := by + rw [exteriorMass_sub hdom.2.2.1 (by linarith), + ← rawExpectation_count_eq_density hdom.1 hdom.2.2.1 (measurableSet_spatialAnnulus _ _)] + exact hmean.trans (by simpa only [one_mul, spatialAnnulus] using hbound) + have hr3 : 0 < r^3 := by positivity + have hr3le : r^3 ≤ 1 := pow_le_one₀ hr.le hr1.le + have hinv : 1 ≤ (r^3)⁻¹ := (one_le_inv₀ hr3).mpr hr3le + have hsqrt : Real.sqrt (D*r) ≤ Real.sqrt D := + Real.sqrt_le_sqrt (mul_le_of_le_one_right hD hr1.le) + calc + exteriorMass ψ r - exteriorMass ψ (2*r) ≤ + C*((r^3)⁻¹ + Real.sqrt D) := by + apply hmean'.trans + rw [max_eq_left hinv] + exact mul_le_mul_of_nonneg_left (add_le_add le_rfl hsqrt) hC + _ ≤ C*((r^3)⁻¹ + Real.sqrt D*(r^3)⁻¹) := by + apply mul_le_mul_of_nonneg_left _ hC + exact add_le_add le_rfl (le_mul_of_one_le_right (Real.sqrt_nonneg D) hinv) + _ = (C*(1+Real.sqrt D))/r^3 := by ring + +theorem scaled_dyadic_tail_bound {T : ℝ → ℝ} {A B s M : ℝ} (hA : 0 ≤ A) + (hT : Antitone T) (hB : T 1 ≤ B) + (hshell : ∀ r : ℝ, 0 < r → r < 1 → T r - T (2*r) ≤ A/r^3) + (hs : 0 < s) (hM : 0 < M) : + s^3*T (M*s) ≤ ((8/7 : ℝ)*A)/M^3 + B*s^3 := by + have h := mul_le_mul_of_nonneg_left + (dyadic_tail_bound hA hT hB hshell (mul_pos hM hs)) (pow_nonneg hs.le 3) + calc + s^3*T (M*s) ≤ s^3*(((8/7:ℝ)*A)/(M*s)^3+B) := h + _ = _ := by field_simp + +theorem tails_converge_of_annuli {T : ℕ → ℝ → ℝ} {β : ℕ → ℝ} {C D a : ℝ} + (hC : 0 ≤ C) (ha : 0 < a) (hβ : Tendsto β atTop (𝓝 0)) + (hT : ∀ n r, 0 ≤ T n r) + (hbound : ∀ M : ℝ, 0 < M → ∀ᶠ n in atTop, T n M ≤ D/M^3 + β n) + (hann : ∀ M : ℝ, a < M → + Tendsto (fun n => T n a - T n M) atTop (𝓝 (C/a^3-C/M^3))) : + Tendsto (fun n => T n a) atTop (𝓝 (C/a^3)) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + have hsmall : Tendsto (fun M : ℝ => (C+D)/M^3) atTop (𝓝 0) := + tendsto_const_nhds.div_atTop (tendsto_pow_atTop (by decide : 3 ≠ 0)) + obtain ⟨M, hlarge, hMsmall⟩ := ((eventually_gt_atTop a).and + (hsmall.eventually (gt_mem_nhds (by linarith : (0:ℝ)<ε/3)))).exists + have hM : 0 < M := ha.trans hlarge + have hann' := (Metric.tendsto_nhds.mp (hann M hlarge)) (ε/3) (by positivity) + have hβ' := hβ.eventually (gt_mem_nhds (by linarith : (0:ℝ)<ε/3)) + filter_upwards [hann', hβ', hbound M hM] with n hn hβn hbn + rw [Real.dist_eq] at hn ⊢ + have hsplit : |T n a - C/a^3| ≤ + |(T n a-T n M)-(C/a^3-C/M^3)| + T n M + C/M^3 := by + have hh := abs_add_le ((T n a-T n M)-(C/a^3-C/M^3)) (T n M-C/M^3) + have hh' := abs_sub (T n M) (C/M^3) + rw [abs_of_nonneg (hT n M), abs_of_nonneg (div_nonneg hC (pow_nonneg hM.le 3))] at hh' + have hid : ((T n a-T n M)-(C/a^3-C/M^3)) + (T n M-C/M^3) = + T n a-C/a^3 := by ring + rw [hid] at hh + linarith + have hcoeff : C/M^3+D/M^3 = (C+D)/M^3 := by ring + linarith + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/AtomicThinScreening.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/AtomicThinScreening.lean new file mode 100644 index 0000000000000000000000000000000000000000..22a87e7bfe6baaed574f4f904751f70a4d73cabd --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/AtomicThinScreening.lean @@ -0,0 +1,91 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.AtomicThinCounts + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def RecordedEnsemble.deletedSquare {n : ℕ} (T : RecordedEnsemble n) (y : Space) (t b : ℝ) : ℝ := + ∑ p, sliceExpectation (T.vector p) (fun _ x => (localCount {z | t-7*b≤‖z-y‖} x)^2) + +lemma RecordedEnsemble.deletedSquare_le {n : ℕ} {T : RecordedEnsemble n} {ψ : H1Vector n} + (hC : T.Conserves ψ) {y : Space} {t b : ℝ} + (hs : T.OutSupported (Metric.closedBall y (t+b))) : + T.deletedSquare y t b≤localCountSecondMoment ψ (deletedShell y t b) := by + have HE : T.deletedSquare y t b= + ∑ p, sliceExpectation (T.vector p) (fun _ x => (localCount (deletedShell y t b) x)^2) := by + apply Finset.sum_congr rfl + intro p hp + apply Finset.sum_congr rfl + intro s hs' + apply integral_congr_ae + filter_upwards [(hs p).recorded_positions s] with x hx + by_cases hm : mass ((T.vector p).coreSlice s x)=0 + · simp only [hm,zero_mul] + · congr 2 + apply Finset.sum_congr rfl + intro i hi + have hi : ‖position x i-y‖≤t+b := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hx hm i + have he : (position x i∈{z | t-7*b≤‖z-y‖}) ↔ position x i∈deletedShell y t b := by + change (t-7*b≤‖position x i-y‖) ↔ (t-7*b≤‖position x i-y‖ ∧ ‖position x i-y‖≤t+b) + exact ⟨fun h => ⟨h,hi⟩,And.left⟩ + simp only [Set.indicator_apply,he] + rw [HE] + exact hC.recorded_secondMoment (deletedShell_measurable y t b) + +theorem exists_atomic_thin_screened {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) (hstate : form S ψ≤E+δ) + (hδ : 0≤δ) {y : Space} (hy : y≠0) {b : ℝ} (hb : 0 screenCountParameter_controls ψ hm δ (y:=z) hz + obtain ⟨t,ht,hdel⟩ := exists_atomic_deletedShell ψ hm hδ hy hb hsmall + have ht0 : 0≤t := by nlinarith [ht.1,atomicCellScale_nonneg y] + have hwidth : t+b≤80*atomicCellScale y := by linarith [ht.2,atomicCellScale_nonneg y] + obtain ⟨T,hTr,ho,hcs,hos⟩ := thin_localization_history S ψ hψ hy ht0 hb hwidth + have hbudget := thinIMS_budget ψ hm hδ hP hc hy hb hwidth hcond + have hP' : 1≤thinReserveFactor*P := by nlinarith [thinReserveFactor_ge_one] + have hc' (z : Space) (hz : z≠0) : localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z))≤ + (thinReserveFactor*P)*(screenMass δ (atomicCellScale z))^2 := + (hc z hz).trans (mul_le_mul_of_nonneg_right + (le_mul_of_one_le_left hP0 thinReserveFactor_ge_one) (sq_nonneg _)) + refine ⟨t,ht,T,ho,hcs,hos,(RecordedEnsemble.deletedSquare_le T.law hos).trans hdel,?_,?_⟩ + · exact (RecordedEnsemble.out_square_le T.law measurableSet_closedBall hos).trans + ((localCountSecondMoment_mono ψ measurableSet_closedBall (Metric.closedBall_subset_closedBall hwidth)).trans + (atomicPatch_secondMoment ψ hδ hP0 hc hy)) + · intro v hv + have H := T.positive_field S hatom ψ hm hE hstate hbudget hδ hP' (atomicCellScale_pos hy) hc' + (fun i => by rw [hTr i]; constructor <;> norm_num <;> linarith [atomicCellScale_nonneg y]) + v (by simpa only [pow_one] using hv) + convert H using 1 + simp only [screenFieldUnit,Real.sqrt_mul thinReserveFactor_nonneg] + ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/BinaryDeletion.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/BinaryDeletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f818118a0ab2835eec609ba21cec218120d8670 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/BinaryDeletion.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.TotalDeletion +import OAI.Analysis.CoulombRadii.FieldAnalysis.ColoredObservable + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology ContDiff +noncomputable section +namespace Coulomb + +lemma coloredDeletion_reindex {J m k n : ℕ} (S : Nuclei J) (h t : ℝ) + (p : Fin n → Fin 2) (e : Fin (m+k) ≃ Fin n) + (he0 : ∀ i, p (e (Fin.castAdd k i))=0) (he1 : ∀ i, p (e (Fin.natAdd m i))=1) + (x : Configuration (m+k)) : + coloredObservable (particleInnerExterior S h t) p (reindexConfiguration e x)= + outerDeletionField (m:=m) (k:=k) S h t x := by + unfold coloredObservable + rw [←Equiv.sum_comp e (fun i : Fin n => if p i=0 then particleInnerExterior S h t i (reindexConfiguration e x) else 0)] + simp only [particleInnerExterior_reindex,Fin.sum_univ_add,he0,he1,ite_true, + show (1:Fin 2)≠0 by decide,ite_false,Finset.sum_const_zero,add_zero,outerDeletionField] + +lemma coloredDeletion_labelCut {J n : ℕ} (S : Nuclei J) (hatom : ∀ j,S.position j=0) + (u : H1Vector n) (χ : Fin 2 → Space → ℝ) (hχ : ∀ l, ContDiff ℝ ∞ (χ l)) + (hp : ∀ y, ∑ l, χ l y^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b y, |fderiv ℝ (χ l) y (EuclideanSpace.single b 1)|≤D) + {h t : ℝ} (ht : 0 χ 0 y^2)) u := by + rw [potentialForm_colored_labelCut u χ hχ hp D hD hd _ + (particleInnerExterior_measurable S h t) (show 0≤totalCharge S/t+(n:ℝ)/(t/2) by + exact add_nonneg (div_nonneg (totalCharge_nonneg S) ht.le) (by positivity)) + (particleInnerExterior_abs_le S hatom ht hh)] + congr 1 + funext x + unfold weightedInnerField + apply Finset.sum_congr rfl + intro i hi + unfold particleInnerExterior + split_ifs with hy + · rfl + · simp [hinner _ (lt_of_not_ge hy)] + +namespace RecordedEnsemble + +def totalCoreForm {J n : ℕ} (T : RecordedEnsemble n) (S : Nuclei J) : ℝ := + ∑ p, sliceExpectation (T.vector p) (fun s x => form S ((T.vector p).coreSlice s x).normalized) + +theorem binary_localization_deletion {J n : ℕ} (S : Nuclei J) + (hatom : ∀ j,S.position j=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) + (χ : Fin 2 → Space → ℝ) (hχ : ∀ l, ContDiff ℝ ∞ (χ l)) + (hp : ∀ y, ∑ l, χ l y^2=1) (D : ℝ) (hD : 0≤D) + (hd : ∀ l b y, |fderiv ℝ (χ l) y (EuclideanSpace.single b 1)|≤D) + {h t : ℝ} (ht : 0 χ 0 y^2)) ψ := by + have H (p : Fin n → Fin 2) := exists_binary_order p + choose m k e he0 he1 using H + let v (p : Fin n → Fin 2) := (ψ.labelCut χ hχ hp D hD hd p).reindex (e p) + let T : RecordedEnsemble n := { + index := Fin n → Fin 2 + finite := inferInstance + out := m + core := k + vector := v + labels := e } + have hanti (p : Fin n → Fin 2) : PartlyAntisymmetric (v p) (coreIndexSet (m p) (k p)) := by + let K : Set (Fin n) := {i | p i=1} + have hc := (hψ.partly (Set.univ : Set (Fin n))).labelCut χ hχ hp D hD hd p K + (Set.subset_univ _) 1 (fun _ h => h) + exact hc.reindex (e p) (coreIndexSet (m p) (k p)) (by rintro _ ⟨i,rfl⟩; exact he1 p i) + have hsupp (p : Fin n → Fin 2) (I : Set (Fin (m p+k p))) (l : Fin 2) + (hi : ∀ i∈I, p (e p i)=l) (C : Set Space) (hC : ∀ y∉C, χ l y=0) : + PartlySupported (v p) I C := by + let K : Set (Fin n) := {i | p i=l} + have hc := labelCut_partlySupported ψ χ hχ hp D hD hd p K l (fun _ h => h) C hC + exact hc.reindex (e p) I hi + have hout p : PartlySupported (v p) (outIndexSet (m p) (k p)) {y | t≤‖y‖} := + hsupp p _ 0 (by rintro _ ⟨i,rfl⟩; exact he0 p i) _ (fun y hy => hinner y (lt_of_not_ge hy)) + refine ⟨T,?_,hanti,?_,hout,?_,?_,?_⟩ + · intro W hW hbound + dsimp [T,v] + simp only [potentialForm_reindex] + obtain ⟨M,hM⟩ := hbound + exact potentialForm_labelCut ψ χ hχ hp D hD hd W hW hM + · intro p + exact hsupp p (coreIndexSet (m p) (k p)) 1 (by rintro _ ⟨i,rfl⟩; exact he1 p i) B hB + · dsimp [totalMass,T,v] + simp only [mass_reindex] + exact mass_labelCut ψ χ hχ hp D hD hd + · dsimp [totalForm,T,v] + simp only [form_reindex] + · have hc p := slice_core_form_le_raw_deletion S hatom (v p) ht hh (hout p) + have he p : potentialForm (outerDeletionField (m:=m p) (k:=k p) S h t) (v p)= + potentialForm (coloredObservable (particleInnerExterior S h t) p) + (ψ.labelCut χ hχ hp D hD hd p) := by + have hf : outerDeletionField (m:=m p) (k:=k p) S h t= + coloredObservable (particleInnerExterior S h t) p ∘ reindexConfiguration (e p) := by + funext x + exact (coloredDeletion_reindex S h t p (e p) (he0 p) (he1 p) x).symm + rw [hf] + exact potentialForm_reindex _ _ _ + have hu := Finset.sum_le_sum (s:=Finset.univ) (fun p _ => hc p) + simp only [Finset.sum_add_distrib,he,coloredDeletion_labelCut S hatom ψ χ hχ hp D hD hd ht hh hinner] at hu + exact hu + +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/CompactRandomField.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/CompactRandomField.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5f2939bb863fa00d96c66880ff59cfbec6b465d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/CompactRandomField.lean @@ -0,0 +1,84 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationPosteriorStep + +namespace OAI + +section +open MeasureTheory Set Filter ProbabilityTheory +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Compact +variable {Ω : Type*} [MeasurableSpace Ω] {P : Measure Ω} [IsProbabilityMeasure P] +variable {f : Ω → Position → ℝ} {R : ℝ} + +lemma compact_random_field_integrable + (hm : Measurable (Function.uncurry f)) + (hb : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |f o x|≤C) + (hs : ∀ᵐ o ∂P,∀ x,R≤‖x‖ → f o x=0) : + Integrable (Function.uncurry f) (P.prod volume) := by + obtain ⟨C,hC⟩ := hb R + let g := (Metric.closedBall (0:Position) R).indicator (fun _ => max C 0) + have hgm : Measurable g := measurable_const.indicator measurableSet_closedBall + have hgi : Integrable g := (integrable_indicator_iff measurableSet_closedBall).2 + (integrableOn_const (C:=max C 0) (isCompact_closedBall (0:Position) R).measure_ne_top) + apply (hgi.comp_snd P).mono' hm.aestronglyMeasurable + apply (Measure.ae_prod_iff_ae_ae (measurableSet_le hm.norm (hgm.comp measurable_snd))).2 + filter_upwards [hs] with o ho + apply Eventually.of_forall + intro x + change ‖f o x‖≤g x + by_cases hx : x∈Metric.closedBall (0:Position) R + · simpa only [g,Set.indicator_of_mem hx,Real.norm_eq_abs] using (hC o x hx).trans (le_max_left C 0) + · have hRx : R≤‖x‖ := le_of_lt (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hx) + simp only [ho x hRx,g,Set.indicator_of_notMem hx,norm_zero,le_refl] + +lemma PropagationDatum.error_product_integrable {B C r Z L : ℝ} {μ : Ω → Position → ℝ} + (d : PropagationDatum P B C r Z L μ) : + Integrable (Function.uncurry d.error) (P.prod volume) := + compact_random_field_integrable d.error_measurable d.error_bounds + (d.invariant.mono (fun _ h => h.error_support)) +end Compact + +section Posterior +variable {Ω A : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [Nonempty Ω] [MeasurableSpace A] +variable {P : Measure Ω} [IsProbabilityMeasure P] {f : Ω → Position → ℝ} {R : ℝ} +variable (obs : Ω → A) (ho : Measurable obs) + +include ho +lemma posteriorAverage_support_ae (hs : ∀ᵐ o ∂P,∀ x,R≤‖x‖ → f o x=0) : + ∀ᵐ o ∂P,∀ x,R≤‖x‖ → posteriorAverage P obs f (obs o) x=0 := by + filter_upwards [posterior_ae P obs ho hs] with o hoi + intro x hx + exact integral_eq_zero_of_ae (hoi.mono (fun v hv => hv x hx)) + +lemma posteriorAverage_integral (hm : Measurable (Function.uncurry f)) + (hb : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |f o x|≤C) (x : Position) : + (∫ o,posteriorAverage P obs f (obs o) x ∂P)=∫ o,f o x ∂P := by + have he := ProbabilityTheory.condExp_ae_eq_integral_condDistrib_id ho + (integrable_section_of_ball_bounds (μ:=P) hm hb x) + calc + _ = ∫ o,P[fun v => f v x | MeasurableSpace.comap obs inferInstance] o ∂P := integral_congr_ae he.symm + _ = _ := integral_condExp ho.comap_le + +lemma posteriorAverage_total_integral (hm : Measurable (Function.uncurry f)) + (hb : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |f o x|≤C) + (hs : ∀ᵐ o ∂P,∀ x,R≤‖x‖ → f o x=0) : + (∫ o,(∫ x,posteriorAverage P obs f (obs o) x) ∂P)=∫ o,(∫ x,f o x) ∂P := by + have hm' : Measurable (fun z : Ω×Position => posteriorAverage P obs f (obs z.1) z.2) := + (posteriorAverage_joint_measurable P obs hm).comp (ho.prodMap measurable_id) + have hb' : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |posteriorAverage P obs f (obs o) x|≤C := by + intro D + obtain ⟨C,hC⟩ := posteriorAverage_uniform_bounds P obs hb D + exact ⟨C,fun o => hC (obs o)⟩ + have hi := compact_random_field_integrable hm hb hs + have hi' := compact_random_field_integrable hm' hb' (posteriorAverage_support_ae obs ho hs) + rw [integral_integral_swap hi',integral_integral_swap hi] + exact integral_congr_ae (Eventually.of_forall (fun x => posteriorAverage_integral obs ho hm hb x)) +end Posterior +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalDensity.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..9eb6bab71eb6a43bab4c391471442532ec6aead7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalDensity.lean @@ -0,0 +1,305 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketWidthScalar + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators ENNReal +namespace NeutralAtom + +theorem continuous_packetKernel {g : Position → ℝ} (hg : Continuous g) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) : + Continuous (fun zy : Position × Position => packetKernel g c₁ r₀ s zy.1 zy.2) := by + have ht : Continuous (fun zy : Position × Position => packetWidth c₁ r₀ s zy.1) := + (continuous_packetWidth c₁ r₀ s).comp continuous_fst + have htne : ∀ zy : Position × Position, packetWidth c₁ r₀ s zy.1 ≠ 0 := + fun zy => (packetWidth_pos hc hr hs zy.1).ne' + unfold packetKernel + exact ((ht.pow 3).inv₀ (fun zy => pow_ne_zero _ (htne zy))).mul + ((hg.comp ((ht.inv₀ htne).smul (continuous_snd.sub continuous_fst))).pow 2) + +theorem measurable_packetMass {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S : Set Position) : Measurable (packetMass (n := n) g c₁ r₀ s S) := by + have hjoint := (continuous_packetKernel hg hc hr hs).stronglyMeasurable + have hint : Measurable (fun z : Position => ∫ y in S, packetKernel g c₁ r₀ s z y) := + (hjoint.integral_prod_right' (ν := volume.restrict S)).measurable + exact Finset.measurable_sum _ (fun i _ => hint.comp (measurable_pi_apply i)) + +theorem packetMass_le_number {n : ℕ} (g : Position → ℝ) (hg : (∫ y, g y^2) = 1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S : Set Position) (x : Configuration n) : packetMass g c₁ r₀ s S x ≤ n := by + exact (packetMass_le_rawCount g hg hc hr hs S Set.univ (by simp) x).trans + (rawCount_le_number Set.univ x) + +theorem packetMass_memLp {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + (hgnorm : (∫ y, g y^2) = 1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (S : Set Position) + (μ : Measure (Configuration n)) [IsFiniteMeasure μ] : + MemLp (packetMass g c₁ r₀ s S) 2 μ := by + apply MemLp.of_bound (measurable_packetMass hg hc hr hs S).aestronglyMeasurable (n : ℝ) + filter_upwards [] with x + simpa only [Real.norm_eq_abs, abs_of_nonneg (packetMass_nonneg g hc hr hs S x)] + using packetMass_le_number g hgnorm hc hr hs S x + +def rawPacketDensity {n : ℕ} (g : Position → ℝ) (c₁ r₀ s : ℝ) + (x : Configuration n) (y : Position) : ℝ := + ∑ i : Fin n, packetKernel g c₁ r₀ s (x i) y + +theorem rawPacketDensity_nonneg {n : ℕ} (g : Position → ℝ) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (x : Configuration n) (y : Position) : + 0 ≤ rawPacketDensity g c₁ r₀ s x y := + Finset.sum_nonneg (fun i _ => packetKernel_nonneg g hc hr hs (x i) y) + +theorem rawPacketDensity_integrable {n : ℕ} (g : Position → ℝ) (hgnorm : (∫ y, g y^2)=1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (x : Configuration n) : + Integrable (rawPacketDensity g c₁ r₀ s x) := + integrable_finsetSum _ (fun i _ => integrable_packetKernel g hgnorm hc hr hs (x i)) + +theorem rawPacketDensity_mass {n : ℕ} (g : Position → ℝ) (hgnorm : (∫ y, g y^2)=1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (x : Configuration n) : + (∫ y, rawPacketDensity g c₁ r₀ s x y) = n := by + unfold rawPacketDensity + rw [integral_finsetSum _ (fun i _ => integrable_packetKernel g hgnorm hc hr hs (x i))] + simp only [integral_packetKernel g hgnorm hc hr hs, Finset.sum_const, Finset.card_univ, + Fintype.card_fin, nsmul_eq_mul, mul_one] + +theorem continuous_rawPacketDensity {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) : + Continuous (fun xy : Configuration n × Position => rawPacketDensity g c₁ r₀ s xy.1 xy.2) := by + have hi : ∀ i : Fin n, Continuous (fun xy : Configuration n × Position => + packetKernel g c₁ r₀ s (xy.1 i) xy.2) := by + intro i + have hh : Continuous (fun xy : Configuration n × Position => xy.1 i) := + (continuous_apply i).comp continuous_fst + have hhpair : Continuous (fun xy : Configuration n × Position => (xy.1 i,xy.2)) := + hh.prodMk continuous_snd + change Continuous ((fun zy : Position × Position => packetKernel g c₁ r₀ s zy.1 zy.2) ∘ + (fun xy : Configuration n × Position => (xy.1 i,xy.2))) + exact (continuous_packetKernel hg hc hr hs).comp hhpair + exact continuous_finsetSum Finset.univ (fun i _ => hi i) + +theorem rawPacketDensity_prod_integrable {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + (hgnorm : (∫ y, g y^2)=1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] : + Integrable (fun xy : Configuration n × Position => rawPacketDensity g c₁ r₀ s xy.1 xy.2) + (ν.prod volume) := by + apply (integrable_prod_iff (continuous_rawPacketDensity hg hc hr hs).aestronglyMeasurable).mpr + constructor + · exact Filter.Eventually.of_forall (rawPacketDensity_integrable g hgnorm hc hr hs) + · have he : (fun x : Configuration n => ∫ y, ‖rawPacketDensity g c₁ r₀ s x y‖) = + (fun _ => (n : ℝ)) := by + funext x + simp only [Real.norm_eq_abs, abs_of_nonneg (rawPacketDensity_nonneg g hc hr hs x _), + rawPacketDensity_mass g hgnorm hc hr hs] + rw [he] + exact integrable_const _ + +def mixturePacketDensity {n : ℕ} (ν : Measure (Configuration n)) + (g : Position → ℝ) (c₁ r₀ s : ℝ) (y : Position) : ℝ := + ∫ x, rawPacketDensity g c₁ r₀ s x y ∂ν + +theorem mixturePacketDensity_integrable {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + (hgnorm : (∫ y, g y^2)=1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] : + Integrable (mixturePacketDensity ν g c₁ r₀ s) := + (rawPacketDensity_prod_integrable hg hgnorm hc hr hs ν).integral_prod_right + +theorem mixturePacketDensity_nonneg {n : ℕ} (ν : Measure (Configuration n)) + (g : Position → ℝ) {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (y : Position) : 0 ≤ mixturePacketDensity ν g c₁ r₀ s y := + integral_nonneg (fun x => rawPacketDensity_nonneg g hc hr hs x y) + +theorem mixturePacketDensity_mass {n : ℕ} {g : Position → ℝ} (hg : Continuous g) + (hgnorm : (∫ y, g y^2)=1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ν : Measure (Configuration n)) [IsProbabilityMeasure ν] : + (∫ y, mixturePacketDensity ν g c₁ r₀ s y) = n := by + unfold mixturePacketDensity + have hi : Integrable (Function.uncurry (fun y x => rawPacketDensity g c₁ r₀ s x y)) + (volume.prod ν) := (rawPacketDensity_prod_integrable hg hgnorm hc hr hs ν).swap + rw [integral_integral_swap hi] + simp only [rawPacketDensity_mass g hgnorm hc hr hs, integral_const, probReal_univ, + one_smul] + +theorem packetWidth_lower {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z : Position) : + c₁*r₀*(min r₀ s)^packetExponent ≤ packetWidth c₁ r₀ s z := by + unfold packetWidth + apply mul_le_mul + · exact mul_le_mul_of_nonneg_left (le_max_right _ _) hc.le + · exact Real.rpow_le_rpow (lt_min hr hs).le + (min_le_min (le_max_right _ _) le_rfl) (by norm_num [packetExponent]) + · exact Real.rpow_nonneg (lt_min hr hs).le _ + · exact mul_nonneg hc.le (hr.le.trans (le_max_right _ _)) + +theorem compact_packet_function_bound {g : Position → ℝ} (hg : Continuous g) + (hgs : HasCompactSupport g) : ∃ A : ℝ, 0 ≤ A ∧ ∀ x, g x^2 ≤ A := by + obtain ⟨A,hA⟩ := ((hgs.isCompact_range hg).image (continuous_id.pow 2)).bddAbove + refine ⟨A, (sq_nonneg (g 0)).trans (hA ⟨g 0, ⟨0,rfl⟩,rfl⟩), ?_⟩ + intro x + exact hA ⟨g x,⟨x,rfl⟩,rfl⟩ + +theorem packetKernel_bound {g : Position → ℝ} {A c₁ r₀ s : ℝ} + (_hA : 0 ≤ A) (hg : ∀ x, g x^2 ≤ A) + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (z y : Position) : + packetKernel g c₁ r₀ s z y ≤ (c₁*r₀*(min r₀ s)^packetExponent)^(-3:ℤ)*A := by + have hp : 0 < c₁*r₀*(min r₀ s)^packetExponent := by positivity + have hh := packetWidth_lower hc hr hs z + have hinv := inv_anti₀ (pow_pos hp 3) (pow_le_pow_left₀ hp.le hh 3) + change (packetWidth c₁ r₀ s z^3)⁻¹*g _^2 ≤ _ + rw [zpow_neg] + exact mul_le_mul hinv (hg _) (sq_nonneg _) (by positivity) + +theorem rawPacketDensity_bound {n : ℕ} {g : Position → ℝ} {A c₁ r₀ s : ℝ} + (hA : 0 ≤ A) (hg : ∀ x, g x^2 ≤ A) + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (x : Configuration n) (y : Position) : + rawPacketDensity g c₁ r₀ s x y ≤ + n*((c₁*r₀*(min r₀ s)^packetExponent)^(-3:ℤ)*A) := by + calc + _ ≤ ∑ _i : Fin n, (c₁*r₀*(min r₀ s)^packetExponent)^(-3:ℤ)*A := + Finset.sum_le_sum (fun i _ => packetKernel_bound hA hg hc hr hs (x i) y) + _ = _ := by simp + +theorem rawPacketDensity_integrable_configuration {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] (y : Position) : + Integrable (fun x => rawPacketDensity g c₁ r₀ s x y) ν := by + obtain ⟨A,hA,hAb⟩ := compact_packet_function_bound hg hgs + have hm : AEStronglyMeasurable (fun x => rawPacketDensity g c₁ r₀ s x y) ν := + ((continuous_rawPacketDensity hg hc hr hs).comp + (continuous_id.prodMk (continuous_const (y := y)))).aestronglyMeasurable + apply (integrable_const (n*((c₁*r₀*(min r₀ s)^packetExponent)^(-3:ℤ)*A))).mono' hm + filter_upwards [] with x + simpa only [Real.norm_eq_abs, abs_of_nonneg (rawPacketDensity_nonneg g hc hr hs x y)] + using rawPacketDensity_bound hA hAb hc hr hs x y + +theorem mixturePacketDensity_bounded {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgs : HasCompactSupport g) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) : + ∃ A : ℝ, 0 ≤ A ∧ ∀ (ν : Measure (Configuration n)) [IsProbabilityMeasure ν] y, + mixturePacketDensity ν g c₁ r₀ s y ≤ A := by + obtain ⟨A,hA,hAb⟩ := compact_packet_function_bound hg hgs + let C := n*((c₁*r₀*(min r₀ s)^packetExponent)^(-3:ℤ)*A) + have hw : 0 < c₁*r₀*(min r₀ s)^packetExponent := by positivity + refine ⟨C, by dsimp [C]; positivity, ?_⟩ + intro ν hν y + have hh := integral_mono (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν y) + (integrable_const C) (fun x => rawPacketDensity_bound hA hAb hc hr hs x y) + simpa only [mixturePacketDensity, integral_const, probReal_univ, one_smul] using hh + +theorem rawPacketDensity_setIntegral {n : ℕ} (g : Position → ℝ) + (hgnorm : (∫ y, g y^2)=1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (S : Set Position) (x : Configuration n) : + (∫ y in S, rawPacketDensity g c₁ r₀ s x y) = packetMass g c₁ r₀ s S x := by + unfold rawPacketDensity packetMass + exact integral_finsetSum _ (fun i _ => (integrable_packetKernel g hgnorm hc hr hs (x i)).integrableOn) + +theorem rawPacketDensity_prod_restrict_integrable {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgnorm : (∫ y, g y^2)=1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] (S : Set Position) : + Integrable (fun xy : Configuration n × Position => rawPacketDensity g c₁ r₀ s xy.1 xy.2) + (ν.prod (volume.restrict S)) := by + apply (integrable_prod_iff (continuous_rawPacketDensity hg hc hr hs).aestronglyMeasurable).mpr + constructor + · exact Filter.Eventually.of_forall (fun x => (rawPacketDensity_integrable g hgnorm hc hr hs x).integrableOn) + · have he : (fun x : Configuration n => ∫ y in S, ‖rawPacketDensity g c₁ r₀ s x y‖) = + packetMass g c₁ r₀ s S := by + funext x + simp only [Real.norm_eq_abs, abs_of_nonneg (rawPacketDensity_nonneg g hc hr hs x _), + rawPacketDensity_setIntegral g hgnorm hc hr hs] + rw [he] + exact (packetMass_memLp hg hgnorm hc hr hs S ν).integrable (by norm_num) + +theorem mixturePacketDensity_setIntegral {n : ℕ} {g : Position → ℝ} + (hg : Continuous g) (hgnorm : (∫ y, g y^2)=1) {c₁ r₀ s : ℝ} + (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] (S : Set Position) : + (∫ y in S, mixturePacketDensity ν g c₁ r₀ s y) = + ∫ x, packetMass g c₁ r₀ s S x ∂ν := by + have hi : Integrable (Function.uncurry (fun y x => rawPacketDensity g c₁ r₀ s x y)) + ((volume.restrict S).prod ν) := + (rawPacketDensity_prod_restrict_integrable hg hgnorm hc hr hs ν S).swap + unfold mixturePacketDensity + rw [integral_integral_swap hi] + simp_rw [rawPacketDensity_setIntegral g hgnorm hc hr hs] + +def conditionalPacketDensity {Ω B : Type*} [MeasurableSpace Ω] [MeasurableSpace B] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (raw : Ω → Configuration n) (obs : Ω → B) + (g : Position → ℝ) (c₁ r₀ s : ℝ) (datum : B) (y : Position) : ℝ := + mixturePacketDensity (ProbabilityTheory.condDistrib raw obs P datum) g c₁ r₀ s y + +theorem conditionalPacketDensity_mass {Ω B : Type*} [MeasurableSpace Ω] [MeasurableSpace B] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) (hgnorm : (∫ y, g y^2)=1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (datum : B) : + (∫ y, conditionalPacketDensity P raw obs g c₁ r₀ s datum y) = n := + mixturePacketDensity_mass hg hgnorm hc hr hs _ + +theorem conditionalPacketDensity_nonneg {Ω B : Type*} [MeasurableSpace Ω] [MeasurableSpace B] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (raw : Ω → Configuration n) (obs : Ω → B) + (g : Position → ℝ) {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) + (datum : B) (y : Position) : 0 ≤ conditionalPacketDensity P raw obs g c₁ r₀ s datum y := + mixturePacketDensity_nonneg _ g hc hr hs y + +theorem conditionalPacketDensity_bounded {Ω B : Type*} [MeasurableSpace Ω] [MeasurableSpace B] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) : + ∃ A : ℝ, 0 ≤ A ∧ ∀ datum y, conditionalPacketDensity P raw obs g c₁ r₀ s datum y ≤ A := by + obtain ⟨A,hA,h⟩ := mixturePacketDensity_bounded (n := n) hg hgs hc hr hs + exact ⟨A,hA,fun datum y => h (ProbabilityTheory.condDistrib raw obs P datum) y⟩ + +theorem conditionalPacketDensity_eq_condExp {Ω B : Type*} [MeasurableSpace Ω] [MeasurableSpace B] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + {raw : Ω → Configuration n} {obs : Ω → B} + (hraw : MeasurePreserving raw P ν) (hobs : Measurable obs) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (y : Position) : + (fun sample => conditionalPacketDensity P raw obs g c₁ r₀ s (obs sample) y) =ᵐ[P] + P[fun sample => rawPacketDensity g c₁ r₀ s (raw sample) y | + MeasurableSpace.comap obs inferInstance] := by + have hf : StronglyMeasurable (fun x : Configuration n => rawPacketDensity g c₁ r₀ s x y) := + ((continuous_rawPacketDensity hg hc hr hs).comp + (continuous_id.prodMk (continuous_const (y := y)))).stronglyMeasurable + exact (ProbabilityTheory.condExp_ae_eq_integral_condDistrib hobs hraw.measurable.aemeasurable hf + (hraw.integrable_comp_of_integrable (rawPacketDensity_integrable_configuration hg hgs hc hr hs ν y))).symm + +theorem conditionalPacketDensity_annulus_eq_condExp {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + {raw : Ω → Configuration n} {obs : Ω → B} + (hraw : MeasurePreserving raw P ν) (hobs : Measurable obs) + {g : Position → ℝ} (hg : Continuous g) (hgnorm : (∫ y, g y^2)=1) + {c₁ r₀ s : ℝ} (hc : 0 < c₁) (hr : 0 < r₀) (hs : 0 < s) (S : Set Position) : + (fun sample => ∫ y in S, conditionalPacketDensity P raw obs g c₁ r₀ s (obs sample) y) =ᵐ[P] + P[fun sample => packetMass g c₁ r₀ s S (raw sample) | + MeasurableSpace.comap obs inferInstance] := by + have hf := (measurable_packetMass (n := n) hg hc hr hs S).stronglyMeasurable + have hi := (packetMass_memLp hg hgnorm hc hr hs S ν).integrable (by norm_num) + have he := ProbabilityTheory.condExp_ae_eq_integral_condDistrib hobs + hraw.measurable.aemeasurable hf (hraw.integrable_comp_of_integrable hi) + exact (he.trans (Filter.Eventually.of_forall (fun sample => + (mixturePacketDensity_setIntegral hg hgnorm hc hr hs _ S).symm))).symm + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalEnergy.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..49534d6fe9541197ea8c6ff9cb82ce9ffab359d4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalEnergy.lean @@ -0,0 +1,198 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.CoreKinetic + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +open MeasureTheory Set +open scoped BigOperators Matrix ENNReal +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +open MeasureTheory Set +open scoped BigOperators ENNReal +open MeasureTheory Set +open scoped BigOperators Matrix +namespace Coulomb + +noncomputable def conditionalEnergy {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (s : Spins m) (x : Configuration m) : ℝ := + form S (ψ.coreSlice s x).normalized - nuclearPotential S x + pairPotential x + + potentialForm (crossPotential x) (ψ.coreSlice s x).normalized + +lemma conditionalEnergy_weight {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) + (s : Spins m) (x : Configuration m) : + mass (ψ.coreSlice s x) * conditionalEnergy S ψ s x = + form S (ψ.coreSlice s x) - + potentialForm (fun _ : Configuration k => nuclearPotential S x) (ψ.coreSlice s x) + + potentialForm (fun _ : Configuration k => pairPotential x) (ψ.coreSlice s x) + + potentialForm (crossPotential x) (ψ.coreSlice s x) := by + simp only [conditionalEnergy, mul_add, mul_sub, form_normalized_weight, + potentialForm_normalized_weight, potentialForm_const] + ring + +lemma conditionalEnergy_weight_integrable {M m k : ℕ} (S : Nuclei M) + (ψ : H1Vector (m+k)) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x) * conditionalEnergy S ψ s x) := by + simp only [conditionalEnergy_weight] + exact (((form_coreSlice_integrable S ψ s).sub + (potentialForm_coreSlice_parameter_integrable ψ s (fun x _ => nuclearPotential S x) + (fun t => ψ.outer_nuclear_integrable S (Fin.append s t)))).add + (potentialForm_coreSlice_parameter_integrable ψ s (fun x _ => pairPotential x) + (fun t => ψ.outer_pair_integrable (Fin.append s t)))).add + (potentialForm_coreSlice_parameter_integrable ψ s crossPotential + (fun t => ψ.cross_integrable (Fin.append s t))) + +lemma conditional_energy_identity {M m k : ℕ} (S : Nuclei M) (ψ : H1Vector (m+k)) : + form S ψ = outerKinetic ψ + + ∑ s : Spins m, ∫ x, mass (ψ.coreSlice s x) * conditionalEnergy S ψ s x := by + have hi (s : Spins m) : + (∫ x, mass (ψ.coreSlice s x) * conditionalEnergy S ψ s x) = + (∫ x, form S (ψ.coreSlice s x)) - + (∫ x, potentialForm (fun _ : Configuration k => nuclearPotential S x) (ψ.coreSlice s x)) + + (∫ x, potentialForm (fun _ : Configuration k => pairPotential x) (ψ.coreSlice s x)) + + (∫ x, potentialForm (crossPotential x) (ψ.coreSlice s x)) := by + simp only [conditionalEnergy_weight] + have hn := potentialForm_coreSlice_parameter_integrable ψ s (fun x _ => nuclearPotential S x) + (fun t => ψ.outer_nuclear_integrable S (Fin.append s t)) + have hp := potentialForm_coreSlice_parameter_integrable ψ s (fun x _ => pairPotential x) + (fun t => ψ.outer_pair_integrable (Fin.append s t)) + have hc := potentialForm_coreSlice_parameter_integrable ψ s crossPotential + (fun t => ψ.cross_integrable (Fin.append s t)) + have hf := form_coreSlice_integrable S ψ s + have H := integral_add ((hf.sub hn).add hp) hc + simp only [Pi.sub_apply, Pi.add_apply] at H + rw [H] + have H' := integral_add (hf.sub hn) hp + simp only [Pi.sub_apply] at H' + rw [H', integral_sub hf hn] + simp only [hi, Finset.sum_add_distrib, Finset.sum_sub_distrib] + rw [integral_potentialForm_coreSlice_parameter ψ (fun x _ => nuclearPotential S x) + (ψ.outer_nuclear_integrable S), + integral_potentialForm_coreSlice_parameter ψ (fun x _ => pairPotential x) ψ.outer_pair_integrable, + integral_potentialForm_coreSlice_parameter ψ crossPotential ψ.cross_integrable] + have hc := conditional_core_form_identity S ψ + simp only [form_normalized_weight] at hc + rw [hc] + change kinetic ψ - nuclearEnergy S ψ + pairEnergy ψ = _ + rw [kinetic_split, nuclearEnergy_split, pairEnergy_split] + simp only [potentialForm] + ring + +lemma outerKinetic_nonneg {m k : ℕ} (ψ : H1Vector (m+k)) : 0 ≤ outerKinetic ψ := by + exact mul_nonneg (by norm_num) (Finset.sum_nonneg fun _ _ => + Finset.sum_nonneg fun _ _ => integral_nonneg fun _ => sq_nonneg _) + +end Coulomb + +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalMatching.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalMatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..112db9d8db47aed885391f78d9e65db7c402b7f0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalMatching.lean @@ -0,0 +1,270 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalDensity +import OAI.Analysis.CoulombRadii.FormDomain.ExplicitMultiplyGradient +import OAI.Analysis.CoulombRadii.Packets.PatchKernelDuality + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal Topology +namespace NeutralAtom + +theorem condExp_matching {α : Type*} [m₀ : MeasurableSpace α] + {μ : Measure α} [IsFiniteMeasure μ] {m : MeasurableSpace α} + (hm : m ≤ m₀) {f g e : α → ℝ} + (hf : Integrable f μ) (hg : Integrable g μ) (he : Integrable e μ) + (hgm : StronglyMeasurable[m] g) (hem : StronglyMeasurable[m] e) + (hfg : ∀ᵐ z ∂μ, |f z-g z|≤e z) : + ∀ᵐ z ∂μ, |(μ[f|m]) z-g z|≤e z := by + have hupper := condExp_mono hf (hg.add he) (hfg.mono (fun z hz => by + have hh := (abs_le.mp hz).2 + change f z≤g z+e z + linarith)) (m := m) + have hlower := condExp_mono (hg.sub he) hf (hfg.mono (fun z hz => by + have hh := (abs_le.mp hz).1 + change g z-e z≤f z + linarith)) (m := m) + rw [condExp_of_stronglyMeasurable hm (hgm.add hem) (hg.add he)] at hupper + rw [condExp_of_stronglyMeasurable hm (hgm.sub hem) (hg.sub he)] at hlower + filter_upwards [hupper,hlower] with z hu hl + change _≤g z+e z at hu + change g z-e z≤_ at hl + exact abs_le.mpr ⟨by linarith,by linarith⟩ + +end NeutralAtom + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace NeutralAtom + +theorem master_kernel_posterior_matching (g : 𝓢(Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hgn : (∫ z, g z^2)=1) : + ∃ C : ℝ, 0 rawPacketDensity g c r₀ s (raw z) y + let v := fun z => rawPacketDensity g c r₀ s (array (obs z)) y + let e := fun z => (A*d)*rawCount (Metric.closedBall y (2*t+d)) (array (obs z)) + have hgs : HasCompactSupport (g : Position → ℝ) := by + apply HasCompactSupport.intro (K := Metric.closedBall 0 1) (isCompact_closedBall _ _) + intro z hz + apply hg + simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz + have hfm : Integrable f P := hraw.integrable_comp_of_integrable + (rawPacketDensity_integrable_configuration g.continuous hgs hc hr hs ν y) + have hpm : Measurable (fun x : Configuration n => rawPacketDensity g c r₀ s x y) := + ((continuous_rawPacketDensity g.continuous hc hr hs).comp + (continuous_id.prodMk (continuous_const (y := y)))).measurable + have hvmeas : StronglyMeasurable[m] v := + (hpm.comp (harray.comp (Measurable.of_comap_le le_rfl : @Measurable Ω B m _ obs))).stronglyMeasurable + have hemeas : StronglyMeasurable[m] e := + (measurable_const.mul ((measurable_rawCount measurableSet_closedBall).comp + (harray.comp (Measurable.of_comap_le le_rfl : @Measurable Ω B m _ obs)))).stronglyMeasurable + have hvi : Integrable v P := by + apply Integrable.of_bound (hvmeas.mono hm).aestronglyMeasurable ((n:ℝ)*(C/t^3)) + filter_upwards [] with z + rw [Real.norm_eq_abs] + apply (Finset.abs_sum_le_sum_abs _ _).trans + calc + _≤∑ _i : Fin n, C/t^3 := Finset.sum_le_sum (fun i _ => hamp _) + _=_ := by simp + have hei : Integrable e P := by + apply Integrable.of_bound (hemeas.mono hm).aestronglyMeasurable ((A*d)*(n:ℝ)) + filter_upwards [] with z + have hp : 0≤e z := mul_nonneg (mul_nonneg hA hd) (rawCount_nonneg _ _) + rw [Real.norm_of_nonneg hp] + exact mul_le_mul_of_nonneg_left (rawCount_le_number _ _) (mul_nonneg hA hd) + have hcomp : ∀ᵐ z ∂P, |f z-v z|≤e z := by + filter_upwards [hdisp] with z hz + obtain ⟨p,hp⟩ := hz + apply kernel_sum_matching_permuted _ y hA hd ?_ hL (raw z) (array (obs z)) p hp + intro u hu + by_contra hn + have hh := hsp u hn + rw [norm_sub_rev] at hh + linarith + have HH := condExp_matching hm hfm hvi hei hvmeas hemeas hcomp + have He := conditionalPacketDensity_eq_condExp P ν hraw hobs g.continuous hgs hc hr hs y + filter_upwards [HH,He] with z hz he + rw [he] + exact hz + +end NeutralAtom + +end +open MeasureTheory +open scoped ENNReal ContDiff +namespace NeutralAtom + +def configurationOrderSetoid (n : ℕ) : Setoid (Configuration n) where + r x y := ∃ p : Equiv.Perm (Fin n), y = x ∘ p + iseqv := { + refl := fun _ => ⟨Equiv.refl _, rfl⟩ + symm := by + rintro x y ⟨p,rfl⟩ + refine ⟨p.symm, ?_⟩ + funext i + simp + trans := by + rintro x y z ⟨p,rfl⟩ ⟨q,rfl⟩ + exact ⟨q.trans p,rfl⟩ } + +def UnorderedArray (n : ℕ) := Quotient (configurationOrderSetoid n) + +def forgetOrder {n : ℕ} (x : Configuration n) : UnorderedArray n := Quotient.mk _ x + +instance unorderedArrayMeasurable (n : ℕ) : MeasurableSpace (UnorderedArray n) := + MeasurableSpace.map forgetOrder inferInstance + +theorem measurable_forgetOrder {n : ℕ} : Measurable (forgetOrder (n := n)) := + measurable_iff_le_map.mpr le_rfl + +theorem forgetOrder_permutation {n : ℕ} (x : Configuration n) (p : Equiv.Perm (Fin n)) : + forgetOrder (x ∘ p) = forgetOrder x := by + apply Eq.symm + exact Quotient.sound ⟨p,rfl⟩ + +abbrev ObservationNoise (n J : ℕ) := Fin J → Fin n → Fin 3 → ℝ +abbrev ObservationSample (n J : ℕ) := Configuration n × ObservationNoise n J + +def allObservationNoiseLaw (n J : ℕ) : Measure (ObservationNoise n J) := + Measure.pi (fun _ : Fin J => Measure.pi (fun _ : Fin n => + Measure.pi (fun _ : Fin 3 => observationNoiseLaw))) + +instance allObservationNoiseLaw_probability (n J : ℕ) : + IsProbabilityMeasure (allObservationNoiseLaw n J) := by + unfold allObservationNoiseLaw + infer_instance + +def observationLaw {n : ℕ} (J : ℕ) (ν : Measure (Configuration n)) : + Measure (ObservationSample n J) := ν.prod (allObservationNoiseLaw n J) + +instance observationLaw_probability {n J : ℕ} (ν : Measure (Configuration n)) + [IsProbabilityMeasure ν] : IsProbabilityMeasure (observationLaw J ν) := by + unfold observationLaw + infer_instance + +theorem observationLaw_rawProjection {n J : ℕ} (ν : Measure (Configuration n)) : + MeasurePreserving Prod.fst (observationLaw J ν) ν := measurePreserving_fst + +def observationNoiseVector (v : Fin 3 → ℝ) : Position := + ∑ a : Fin 3, v a • EuclideanSpace.single a 1 + +theorem observationNoiseVector_coordinate (v : Fin 3 → ℝ) (a : Fin 3) : + observationNoiseVector v a = v a := by + simp [observationNoiseVector, Pi.single_apply] + +theorem continuous_observationNoiseVector : Continuous observationNoiseVector := by + unfold observationNoiseVector + exact continuous_finsetSum Finset.univ (fun a _ => (continuous_apply a).smul continuous_const) + +def observedOrdered {n J : ℕ} (r : Fin J → ℝ) (j : Fin J) + (sample : ObservationSample n J) : Configuration n := + fun i => sample.1 i + (r j)^(101/100 : ℝ) • observationNoiseVector (sample.2 j i) + +def observedArray {n J : ℕ} (r : Fin J → ℝ) (j : Fin J) + (sample : ObservationSample n J) : UnorderedArray n := + forgetOrder (observedOrdered r j sample) + +theorem measurable_observedOrdered {n J : ℕ} (r : Fin J → ℝ) (j : Fin J) : + Measurable (observedOrdered (n := n) r j) := by + apply Measurable.of_eval + intro i + have hn : Measurable (fun sample : ObservationSample n J => sample.2 j i) := + (measurable_pi_apply i).comp ((measurable_pi_apply j).comp measurable_snd) + exact ((measurable_pi_apply i).comp measurable_fst).add + ((continuous_observationNoiseVector.measurable.comp hn).const_smul ((r j)^(101/100 : ℝ))) + +theorem measurable_observedArray {n J : ℕ} (r : Fin J → ℝ) (j : Fin J) : + Measurable (observedArray (n := n) r j) := + measurable_forgetOrder.comp (measurable_observedOrdered r j) + +def tailObservation {n J : ℕ} (r : Fin J → ℝ) (j : ℕ) + (sample : ObservationSample n J) : Fin J → UnorderedArray n := + fun k => if j ≤ k.val then observedArray r k sample else forgetOrder 0 + +theorem measurable_tailObservation {n J : ℕ} (r : Fin J → ℝ) (j : ℕ) : + Measurable (tailObservation (n := n) r j) := by + apply Measurable.of_eval + intro k + by_cases hj : j ≤ k.val + · simpa only [tailObservation, ite_eq_left hj] using measurable_observedArray r k + · simpa only [tailObservation, ite_eq_right hj] using + (measurable_const : Measurable (fun _ : ObservationSample n J => forgetOrder (0 : Configuration n))) + +@[instance_reducible] def observationSigma {n J : ℕ} (r : Fin J → ℝ) (j : ℕ) : + MeasurableSpace (ObservationSample n J) := + MeasurableSpace.comap (tailObservation r j) inferInstance + +theorem observationSigma_le {n J : ℕ} (r : Fin J → ℝ) (j : ℕ) : + observationSigma (n := n) r j ≤ (inferInstance : MeasurableSpace (ObservationSample n J)) := + measurable_iff_comap_le.mp (measurable_tailObservation r j) + +def eraseEarlierArrays {n J : ℕ} (j : ℕ) (v : Fin J → UnorderedArray n) : + Fin J → UnorderedArray n := fun k => if j ≤ k.val then v k else forgetOrder 0 + +theorem measurable_eraseEarlierArrays {n J : ℕ} (j : ℕ) : + Measurable (eraseEarlierArrays (n := n) (J := J) j) := by + apply Measurable.of_eval + intro k + by_cases hj : j ≤ k.val + · simpa only [eraseEarlierArrays, ite_eq_left hj] using (measurable_pi_apply k) + · simpa only [eraseEarlierArrays, ite_eq_right hj] using + (measurable_const : Measurable (fun _ : Fin J → UnorderedArray n => forgetOrder (0 : Configuration n))) + +theorem tailObservation_erase {n J : ℕ} (r : Fin J → ℝ) {i j : ℕ} (hij : i ≤ j) : + tailObservation (n := n) r j = eraseEarlierArrays j ∘ tailObservation r i := by + funext sample k + by_cases hj : j ≤ k.val + · simp only [tailObservation, eraseEarlierArrays, Function.comp_apply, + ite_eq_left hj, ite_eq_left (hij.trans hj)] + · simp only [tailObservation, eraseEarlierArrays, Function.comp_apply, ite_eq_right hj] + +theorem observationSigma_antitone {n J : ℕ} (r : Fin J → ℝ) : + Antitone (observationSigma (n := n) r) := by + intro i j hij + unfold observationSigma + rw [tailObservation_erase r hij, ← MeasurableSpace.comap_comp] + exact MeasurableSpace.comap_mono (measurable_iff_comap_le.mp (measurable_eraseEarlierArrays j)) + +theorem observationSigma_trivial {n J : ℕ} (r : Fin J → ℝ) : + observationSigma (n := n) r J = ⊥ := by + have hh : tailObservation (n := n) r J = fun _ => fun _ => forgetOrder (0 : Configuration n) := by + funext sample k + simp only [tailObservation, ite_eq_right (not_le.mpr k.isLt)] + unfold observationSigma + rw [hh] + apply le_antisymm _ bot_le + exact measurable_iff_comap_le.mp measurable_const + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalPositiveField.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalPositiveField.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d3355151264f2bc4d49e38f1fdcb08fde6cd6ae --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalPositiveField.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PositiveField +import OAI.Analysis.CoulombRadii.Screening.ScreeningNormalization + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap Pointwise +noncomputable section +namespace Coulomb + +lemma potentialForm_normalized_eq {n : ℕ} (V : Configuration n → ℝ) (u : H1Vector n) : + potentialForm V u.normalized = (mass u)⁻¹*potentialForm V u := by + rw [H1Vector.normalized,potentialForm_rsmul,inv_pow,Real.sq_sqrt (mass_nonneg u)] + +lemma normalized_corePotential_aestronglyMeasurable {m k : ℕ} (ψ : H1Vector (m+k)) + (s : Spins m) (y : Space) : AEStronglyMeasurable + (fun x => coreCoulombPotential (ψ.coreSlice s x).normalized y) volume := by + simp only [←nuclearEnergy_unit_eq_coreCoulomb] + change AEStronglyMeasurable (fun x => potentialForm (nuclearPotential (unitNucleus y)) + (ψ.coreSlice s x).normalized) _ + simp only [potentialForm_normalized_eq] + exact (mass_coreSlice_integrable ψ s).aestronglyMeasurable.inv₀.mul + (potentialForm_coreSlice_integrable ψ s (nuclearPotential (unitNucleus y)) + (fun t => ψ.core_nuclear_integrable (unitNucleus y) (Fin.append s t))).aestronglyMeasurable + +lemma coreField_positive_le {J k : ℕ} (S : Nuclei J) (u : H1Vector k) (y : Space) : + max (coreScreenedField S u y) 0 ≤ attraction S y := by + apply max_le _ (attraction_nonneg S y) + unfold coreScreenedField + linarith [coreCoulombPotential_nonneg u y] + +lemma coreField_positive_square_weight_integrable {J m k : ℕ} (S : Nuclei J) + (ψ : H1Vector (m+k)) (s : Spins m) (y : Space) : + Integrable (fun x => mass (ψ.coreSlice s x)*(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2) := by + have hm : AEStronglyMeasurable (fun x => (max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2) volume := by + exact ((aestronglyMeasurable_const.sub (normalized_corePotential_aestronglyMeasurable ψ s y)).sup + aestronglyMeasurable_const).pow 2 + have hb : ∀ᵐ x ∂volume, ‖(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2‖ ≤ (attraction S y)^2 := by + filter_upwards [] with x + rw [Real.norm_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (le_max_right _ _) (coreField_positive_le S _ y) 2 + exact (mass_coreSlice_integrable ψ s).mul_bdd hm hb + +theorem conditional_positive_field_gain {J m k : ℕ} (S : Nuclei J) (ψ : H1Vector (m+k)) + (hanti : ∀ s, ∀ᵐ x, Antisymmetric (ψ.coreSlice s x)) + {a : ℝ} (ha : 0 < a) (y : Space) (A : Set Space) (hA : IsClosed A) + (hs : ∀ s, ∀ᵐ x, SpatiallySupported (ψ.coreSlice s x).normalized A) + (hcore : ∀ z ∈ A, 3*a ≤ ‖z-y‖) (hnuc : ∀ j, 3*a ≤ ‖S.position j-y‖) + {E : ℝ} (hE : (E : EReal) ≤ unrestrictedFormBottom S) : + a/(16*ballTrialCoefficient)*sliceExpectation ψ (fun s x => + (max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2) ≤ + sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized)-E*mass ψ+ + (4*ballTrialCoefficient*(screenBaseMass a)^2/a)*mass ψ := by + have hi := normalized_coreForm_weight_integrable S ψ + have hp := coreField_positive_square_weight_integrable S ψ + let c : ℝ := a/(16*ballTrialCoefficient) + let d : ℝ := 4*ballTrialCoefficient*(screenBaseMass a)^2/a + have HD (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(form S (ψ.coreSlice s x).normalized- + c*(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2+d-E)) := by + apply (((hi s).sub (by simpa only [mul_left_comm (mass _) c] using (hp s y).const_mul c)).add + (by simpa only [mul_comm (mass _) d] using (mass_coreSlice_integrable ψ s).const_mul d)).sub + (by simpa only [mul_comm (mass _) E] using (mass_coreSlice_integrable ψ s).const_mul E) |>.congr + exact Eventually.of_forall (fun x => by dsimp only [Pi.sub_apply,Pi.add_apply]; ring) + have H : 0 ≤ sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized- + c*(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2+d-E) := by + apply Finset.sum_nonneg + intro s _ + apply integral_nonneg_of_ae + filter_upwards [hanti s,hs s] with x hax hsx + by_cases hz : mass (ψ.coreSlice s x)=0 + · simp [hz] + · have hpx : 0 < mass (ψ.coreSlice s x) := lt_of_le_of_ne (mass_nonneg _) (Ne.symm hz) + have HG := positive_field_core_gain S (ψ.coreSlice s x).normalized hax.normalized + (mass_normalized _ hpx) ha (screenBaseMass_nonneg a) (screenBaseMass_scale ha) + (screenBaseMass_cuberoot_scale ha) y A hA hsx hcore hnuc + have HE := EReal.coe_le_coe_iff.mp (hE.trans HG) + apply mul_nonneg hpx.le + dsimp [c,d] + convert sub_nonneg.mpr HE using 1 + first | rfl | ring + have HH : sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized- + c*(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2+d-E) = + sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized)- + c*sliceExpectation ψ (fun s x => (max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2)+ + d*mass ψ-E*mass ψ := by + have hconst (v : ℝ) (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*v) := + (mass_coreSlice_integrable ψ s).mul_const v + have hc (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(c* + (max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2)) := by + simpa only [mul_left_comm (mass _) c] using (hp s y).const_mul c + have hd (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(form S (ψ.coreSlice s x).normalized- + c*(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2)) := by + exact ((hi s).sub (hc s)).congr (Eventually.of_forall (fun x => by dsimp; ring)) + have he (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(form S (ψ.coreSlice s x).normalized- + c*(max (coreScreenedField S (ψ.coreSlice s x).normalized y) 0)^2+d)) := by + exact ((hd s).add (hconst d s)).congr (Eventually.of_forall (fun x => by dsimp; ring)) + rw [sliceExpectation_sub ψ _ _ he (hconst E),sliceExpectation_add ψ _ _ hd (hconst d), + sliceExpectation_sub ψ _ _ hi hc,sliceExpectation_const_mul, + sliceExpectation_number,sliceExpectation_number] + rw [HH] at H + dsimp [c,d] at H + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalRMS.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalRMS.lean new file mode 100644 index 0000000000000000000000000000000000000000..6dd4dd02ec5ea564608aa580b03b7eab655efa5c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ConditionalRMS.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedEnsemble +import OAI.Analysis.CoulombRadii.RandomFields.EnsembleCauchy +import OAI.Analysis.CoulombRadii.FieldAnalysis.RawRMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +lemma potentialForm_bounded_add {n : ℕ} (ψ : H1Vector n) + (f g : Configuration n → ℝ) (hf : Measurable f) (hg : Measurable g) + {B C : ℝ} (hB : ∀ x, |f x|≤B) (hC : ∀ x, |g x|≤C) : + potentialForm (fun x => f x+g x) ψ=potentialForm f ψ+potentialForm g ψ := by + simp only [potentialForm,add_mul,integral_add (boundedObservable_integrable ψ f hf hB _) + (boundedObservable_integrable ψ g hg hC _),Finset.sum_add_distrib] + +lemma coreConditionalObservable_nonneg {m k : ℕ} (ψ : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : ∀ x, 0≤W x) (s : Spins m) (x : Configuration m) : + 0≤coreConditionalObservable ψ W s x := potentialForm_nonneg _ _ (fun _ => hW _) + +lemma coreConditionalObservable_mono {m k : ℕ} (ψ : H1Vector (m+k)) + (f g : Configuration (m+k) → ℝ) (hf : Measurable f) (hg : Measurable g) + {B C : ℝ} (hB : ∀ x, |f x|≤B) (hC : ∀ x, |g x|≤C) (hfg : ∀ x, f x≤g x) + (s : Spins m) (x : Configuration m) : + coreConditionalObservable ψ f s x≤coreConditionalObservable ψ g s x := by + exact potentialForm_mono_bounded _ _ _ + (hf.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (hg.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (fun _ => hB _) (fun _ => hC _) (fun _ => hfg _) + +lemma coreConditionalObservable_add {m k : ℕ} (ψ : H1Vector (m+k)) + (f g : Configuration (m+k) → ℝ) (hf : Measurable f) (hg : Measurable g) + {B C : ℝ} (hB : ∀ x, |f x|≤B) (hC : ∀ x, |g x|≤C) + (s : Spins m) (x : Configuration m) : + coreConditionalObservable ψ (fun z => f z+g z) s x= + coreConditionalObservable ψ f s x+coreConditionalObservable ψ g s x := by + exact potentialForm_bounded_add _ _ _ + (hf.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (hg.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (fun _ => hB _) (fun _ => hC _) + +lemma coreConditionalObservable_square_weight_integrable {m k : ℕ} (ψ : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB0 : 0≤B) + (hB : ∀ x, |W x|≤B) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)*(coreConditionalObservable ψ W s x)^2) := by + apply (mass_coreSlice_integrable ψ s).mul_bdd + ((coreConditionalObservable_aestronglyMeasurable ψ W hW hB s).pow 2) + filter_upwards [] with x + change ‖(coreConditionalObservable ψ W s x)^2‖ ≤ B^2 + rw [Real.norm_of_nonneg (sq_nonneg _)] + simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) + (coreConditionalObservable_abs_le ψ W hW hB0 hB s x) 2 + +lemma potentialForm_normalized_square_le {n : ℕ} (ψ : H1Vector n) + (W : Configuration n → ℝ) (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x|≤B) : + (potentialForm W ψ.normalized)^2 ≤ potentialForm (fun x => (W x)^2) ψ.normalized := by + have H := potentialForm_bounded_cauchy ψ.normalized W (fun _ => 1) hW measurable_const hB (fun _ => le_rfl) + simp only [mul_one,one_pow,potentialForm_const,one_mul] at H + exact H.trans (by nlinarith [mass_normalized_le_one ψ, + potentialForm_nonneg ψ.normalized (fun x => (W x)^2) (fun _ => sq_nonneg _)]) + +lemma slice_conditional_square_le {m k : ℕ} (ψ : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB0 : 0≤B) + (hB : ∀ x, |W x|≤B) : + sliceExpectation ψ (fun s x => (coreConditionalObservable ψ W s x)^2) ≤ + potentialForm (fun x => (W x)^2) ψ := by + have hB2 (x) : |(W x)^2|≤B^2 := by + rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hB x) 2 + rw [←sliceExpectation_coreConditionalObservable ψ _ (hW.pow_const 2) hB2] + apply sliceExpectation_mono_ae ψ _ _ + (coreConditionalObservable_square_weight_integrable ψ W hW hB0 hB) + (coreConditionalObservable_weight_integrable ψ _ (hW.pow_const 2) (sq_nonneg _) hB2) + intro s + filter_upwards [] with x + exact potentialForm_normalized_square_le _ _ + (hW.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (fun _ => hB _) + +namespace RecordedEnsemble +variable {n : ℕ} +def dataRMS (T : RecordedEnsemble n) + (F : (p : T.index) → Spins (T.out p) → Configuration (T.out p) → ℝ) : ℝ := + Real.sqrt (∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2)) +lemma dataRMS_nonneg (T : RecordedEnsemble n) (F) : 0≤T.dataRMS F := Real.sqrt_nonneg _ +lemma dataRMS_sq (T : RecordedEnsemble n) (F) : + T.dataRMS F^2=∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2) := + Real.sq_sqrt (Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => + integral_nonneg (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _))))) + +lemma dataRMS_mono (T : RecordedEnsemble n) (F G) + (hF : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*(F p s x)^2)) + (hG : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*(G p s x)^2)) + (hF0 : ∀ p s x, 0≤F p s x) (hFG : ∀ p s x, F p s x≤G p s x) : T.dataRMS F≤T.dataRMS G := by + apply Real.sqrt_le_sqrt + apply Finset.sum_le_sum + intro p hp + exact sliceExpectation_mono_ae _ _ _ (hF p) (hG p) (fun s => Eventually.of_forall (fun x => + pow_le_pow_left₀ (hF0 p s x) (hFG p s x) 2)) + +lemma dataRMS_add (T : RecordedEnsemble n) (F G) + (hF : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*(F p s x)^2)) + (hG : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*(G p s x)^2)) + (hFG : ∀ p s, Integrable (fun x => mass ((T.vector p).coreSlice s x)*(F p s x*G p s x))) : + T.dataRMS (fun p s x => F p s x+G p s x) ≤ T.dataRMS F+T.dataRMS G := by + have he : T.dataRMS (fun p s x => F p s x+G p s x)^2 = + T.dataRMS F^2+2*(∑ p, sliceExpectation (T.vector p) (fun s x => F p s x*G p s x))+T.dataRMS G^2 := by + simp only [dataRMS_sq,sliceExpectation] + rw [Finset.mul_sum,←Finset.sum_add_distrib,←Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro p hp + rw [Finset.mul_sum,←Finset.sum_add_distrib,←Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro s hs + have hi : Integrable (fun x => mass ((T.vector p).coreSlice s x)*(F p s x)^2+ + 2*(mass ((T.vector p).coreSlice s x)*(F p s x*G p s x))) := (hF p s).add ((hFG p s).const_mul 2) + calc + _ = ∫ x, (mass ((T.vector p).coreSlice s x)*(F p s x)^2+ + 2*(mass ((T.vector p).coreSlice s x)*(F p s x*G p s x)))+ + mass ((T.vector p).coreSlice s x)*(G p s x)^2 := integral_congr_ae (Eventually.of_forall (fun _ => by ring)) + _ = _ := by rw [integral_add hi (hG p s),integral_add (hF p s) ((hFG p s).const_mul _),integral_const_mul] + have hcs := slice_ensemble_cauchy T.out T.core T.vector F G hF hG hFG + rw [←dataRMS_sq,←dataRMS_sq] at hcs + have H : (∑ p, sliceExpectation (T.vector p) (fun s x => F p s x*G p s x)) ≤T.dataRMS F*T.dataRMS G := by + exact (le_abs_self _).trans ((sq_le_sq₀ (abs_nonneg _) (mul_nonneg (T.dataRMS_nonneg F) (T.dataRMS_nonneg G))).mp + (by simpa only [sq_abs,mul_pow] using hcs)) + nlinarith [T.dataRMS_nonneg F,T.dataRMS_nonneg G,T.dataRMS_nonneg (fun p s x => F p s x+G p s x)] + +theorem Conserves.dataRMS_conditional_le {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) (W : Configuration n → ℝ) (hW : Measurable W) + {B : ℝ} (hB0 : 0≤B) (hB : ∀ x, |W x|≤B) : + T.dataRMS (fun p => coreConditionalObservable (T.vector p) (W ∘ reindexConfiguration (T.labels p))) ≤rawRMS ψ W := by + apply Real.sqrt_le_sqrt + have hB2 (x) : |(W x)^2|≤B^2 := by + rw [abs_of_nonneg (sq_nonneg _)]; simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) (hB x) 2 + have H := Finset.sum_le_sum (s:=Finset.univ) (fun p _ => slice_conditional_square_le (T.vector p) + (W ∘ reindexConfiguration (T.labels p)) (hW.comp (reindexConfiguration_continuous _).measurable) + hB0 (fun x => hB _)) + exact H.trans_eq (hT (fun x => (W x)^2) (hW.pow_const 2) ⟨B^2,hB2⟩) + +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/CoreBudget.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/CoreBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..987b093b0b2742d0afff849403bd8bc8047ecf44 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/CoreBudget.lean @@ -0,0 +1,59 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.BinaryDeletion +import OAI.Analysis.CoulombRadii.Localization.ExteriorCut + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology ContDiff +noncomputable section +namespace Coulomb +namespace RecordedEnsemble + +theorem atomic_zero_offset_core_deletion : ∃ C : ℝ, 0≤C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ j,S.position j=0) → + ∀ ψ : H1Vector n, Antisymmetric ψ → mass ψ=1 → + ∀ {E : ℝ}, (E:EReal)≤unrestrictedFormBottom S → form S ψ≤E → + ∀ {t : ℝ}, 0 exteriorCut t 0 y^2) + ((exteriorCut_smooth t 0).continuous.measurable.pow_const 2) (fun y => sq_nonneg _) hweight + (fun y hy => by simp only [hinner y hy,zero_pow (by decide : 2≠0)]) + have hi := Hi S hatom ψ hψ hm hE he ht + rw [←hform] at hi + have h1 : 0≤(screenMass 0 (t/4))^2/t := div_nonneg (sq_nonneg _) ht.le + have h2 : 0 ≤ screenMass 0 t/t^2 := div_nonneg (screenMass_pos _ _).le (sq_nonneg _) + calc + T.totalCoreForm S ≤ T.totalForm S+potentialForm (weightedInnerField S (t/4) (fun y => exteriorCut t 0 y^2)) ψ := hcoreform + _ ≤ (form S ψ+Ci*screenMass 0 t/t^2)+Ca*(screenMass 0 (t/4))^2/t := add_le_add hi ha + _ ≤ E+(Ci+Ca)*((screenMass 0 (t/4))^2/t+screenMass 0 t/t^2) := by + simp only [mul_div_assoc] at * + nlinarith [mul_nonneg hCi h1,mul_nonneg hCa h2] + +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/CoreGap.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/CoreGap.lean new file mode 100644 index 0000000000000000000000000000000000000000..c83a3c615eb3893c7a89ff9a990f2f357cbbc8ba --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/CoreGap.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.UpperDeficit +import OAI.Analysis.CoulombRadii.LimitTheory.AtomicOutKinetic +import OAI.Analysis.CoulombRadii.SpectralTheory.SectorBottomBridge +import OAI.Analysis.CoulombRadii.RandomFields.BinaryDeletion +import OAI.Analysis.CoulombRadii.Screening.CoreCount + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb.RecordedEnsemble + +lemma core_gap_lower {J n Z : ℕ} (S : Nuclei J) (T : RecordedEnsemble n) + (hF : T.CoreFermionic) (hmono : Antitone (sectorFormBottom S)) + {E P : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) + (hP : (P:EReal)≤ sectorFormBottom S (Z-1)) : + E*T.totalMass+(P-E)*T.favorableMass Z≤T.totalCoreForm S := by + have H p : E*mass (T.vector p)+(P-E)*(if (T.core p:ℝ)<(Z:ℝ) then mass (T.vector p) else 0)≤ + sliceExpectation (T.vector p) (fun s x => form S ((T.vector p).coreSlice s x).normalized) := by + by_cases hp : (T.core p:ℝ)<(Z:ℝ) + · rw [ite_eq_left hp] + have hk : T.core p≤Z-1 := by have := (Nat.cast_lt (α:=ℝ)).mp hp; omega + have h := slice_core_form_ge_sector S (T.vector p) (fun s => (hF p).coreSlice s) (hP.trans (hmono hk)) + nlinarith + · rw [ite_eq_right hp,mul_zero,add_zero] + exact slice_core_form_ge_baseline S (T.vector p) (fun s => (hF p).coreSlice s) hE + have hh := Finset.sum_le_sum (s:=Finset.univ) (fun p _ => H p) + simpa only [Finset.sum_add_distrib,←Finset.mul_sum,totalMass,favorableMass,totalCoreForm] using hh + +lemma predecessor_bound_of_core_budget {J n Z : ℕ} (S : Nuclei J) (T : RecordedEnsemble n) + (hF : T.CoreFermionic) (hmono : Antitone (sectorFormBottom S)) + {E P M C : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) + (hP : (P:EReal)≤ sectorFormBottom S (Z-1)) (hEP : E≤P) + (hM : 0 F x*Coulomb.localCount A (flattenConfiguration n x))≤T := by + have hm : Measurable (fun x : Configuration n => Coulomb.localCount A (flattenConfiguration n x)) := + (Coulomb.localCount_measurable hA).comp (flattenConfiguration n).continuous.measurable + have H := stateWeightedIntegral_mono_bounded hd + (F:=fun x => F x*Coulomb.localCount A (flattenConfiguration n x)) + (G:=fun x => T*F x) (hF.mul hm) (measurable_const.mul hF) + (C:=(n:ℝ)) (D:=|T|) + (fun x => by + rw [abs_of_nonneg (mul_nonneg (hF0 x) (Coulomb.localCount_nonneg A _))] + exact (mul_le_of_le_one_left (Coulomb.localCount_nonneg A _) (hF1 x)).trans + (Coulomb.localCount_le A _)) + (fun x => by + rw [abs_mul,abs_of_nonneg (hF0 x)] + exact mul_le_of_le_one_right (abs_nonneg _) (hF1 x)) + (fun x => by + by_cases hx : F x=0 + · simp [hx] + · have H := mul_le_mul_of_nonneg_left (hmatch x (lt_of_le_of_ne (hF0 x) (Ne.symm hx))) (hF0 x) + simpa only [mul_comm] using H) + rw [stateWeightedIntegral_const_mul] at H + calc + _ ≤ (stateWeightedIntegral ψ F)⁻¹*(T*stateWeightedIntegral ψ F) := + mul_le_mul_of_nonneg_left H (inv_nonneg.mpr hp.le) + _ = T := by field_simp + +theorem atomic_arrayEvent_deficit_upper {H : Type*} [Fintype H] {n : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hE : (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g≤E+D₀) (hD : 0≤D₀) + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (hsym : ∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y∈s ↔ y∈s) + (hp : 0 by positivity) _ + +lemma observed_deficit_event_measurable {H : Type*} {n : ℕ} (h : H) (Z a T : ℝ) : + MeasurableSet {y : (H × (Fin n × Fin 3)) → ℝ | + T (Metric.ball 0 a).indicator (fun _ => (1:ℝ)) (observationArrayPositions h y i)) + exact congrArg (fun q => T Iff.of_eq + +theorem atomic_observed_inner_deficit_tail {H : Type*} [Fintype H] {n : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hE : (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g≤E+D₀) (hD : 0≤D₀) + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : H) {r a T p₀ : ℝ} + (hr : 0 (hℓ k).ne') s x hx + have H := raw_inner_observed_count_le x + (observationArrayPositions h (fun ia => x ia.2.1 ia.2.2+ℓ ia.1*u ia)) hre + (observationArrayPositions_displacement ℓ hℓ x hu h) + change T<(Z:ℝ)-rawCount _ _ at he + linarith + have hb := atomic_arrayEvent_deficit_upper Z hZ hd hn hmin hE hbase hD ℓ hℓ hs + (observed_deficit_event_symmetric h Z a T) hp hr hm + have hδ := observationEventOffset_mono_probability ℓ D₀ hp₀ (le_of_not_ge hc) hp1 + have hmass : Coulomb.screenMass (D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5) r≤ + Coulomb.screenMass (D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ*(1-Real.log p₀)^5) r := by + unfold Coulomb.screenMass + exact add_le_add le_rfl (Real.sqrt_le_sqrt (mul_le_mul_of_nonneg_right hδ hr.le)) + have := mul_le_mul_of_nonneg_left hmass + (mul_nonneg (by norm_num : (0:ℝ)≤2) Coulomb.atomicInnerFieldConstant_nonneg) + linarith + +end NeutralAtom + +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/CutJensen.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/CutJensen.lean new file mode 100644 index 0000000000000000000000000000000000000000..8cbc224cb0254c1f087f21bf6a9ecd250534c62e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/CutJensen.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalPositiveField + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma boundedObservable_integrable {n : ℕ} (u : H1Vector n) (W : Configuration n → ℝ) + (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x| ≤ B) (s : Spins n) : + Integrable (fun x => W x*‖u.value s x‖^2) := by + exact ((u.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).bdd_mul hW.aestronglyMeasurable + (Eventually.of_forall (fun x => by simpa only [Real.norm_eq_abs] using hB x)) + +lemma potentialForm_abs_le {n : ℕ} (u : H1Vector n) (W : Configuration n → ℝ) + (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x| ≤ B) : + |potentialForm W u| ≤ B*mass u := by + rw [abs_le] + have h (s : Spins n) : -(B*(∫ x, ‖u.value s x‖^2)) ≤ ∫ x, W x*‖u.value s x‖^2 ∧ + (∫ x, W x*‖u.value s x‖^2) ≤ B*(∫ x, ‖u.value s x‖^2) := by + constructor + · rw [← integral_const_mul,← integral_neg] + apply integral_mono (((u.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul B).neg + (boundedObservable_integrable u W hW hB s) + intro x + have H := (abs_le.mp (hB x)).1 + dsimp only [Pi.neg_apply] + nlinarith [sq_nonneg ‖u.value s x‖,mul_le_mul_of_nonneg_right H (sq_nonneg ‖u.value s x‖)] + · rw [← integral_const_mul] + exact integral_mono (boundedObservable_integrable u W hW hB s) + (((u.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul B) + (fun x => mul_le_mul_of_nonneg_right (abs_le.mp (hB x)).2 (sq_nonneg _)) + constructor + · simpa only [potentialForm,mass,Finset.sum_neg_distrib,←Finset.mul_sum] using + Finset.sum_le_sum (fun s (_ : s ∈ Finset.univ) => (h s).1) + · simpa only [potentialForm,mass,←Finset.mul_sum] using + Finset.sum_le_sum (fun s (_ : s ∈ Finset.univ) => (h s).2) + +lemma mass_normalized_le_one {n : ℕ} (u : H1Vector n) : mass u.normalized ≤ 1 := by + by_cases h : mass u=0 + · simp [H1Vector.normalized,mass_rsmul,h] + · exact (mass_normalized u (lt_of_le_of_ne (mass_nonneg u) (Ne.symm h))).le + +def coreConditionalObservable {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (s : Spins m) (x : Configuration m) : ℝ := + potentialForm (fun v => W (joinConfiguration m k (x,v))) (u.coreSlice s x).normalized + +lemma coreConditionalObservable_abs_le {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB0 : 0 ≤ B) + (hB : ∀ x, |W x| ≤ B) (s : Spins m) (x : Configuration m) : + |coreConditionalObservable u W s x| ≤ B := by + apply (potentialForm_abs_le _ _ (hW.comp ((joinConfiguration m k).continuous.measurable.comp + (measurable_const.prodMk measurable_id))) (fun v => hB _)).trans + simpa only [mul_one] using mul_le_mul_of_nonneg_left (mass_normalized_le_one (u.coreSlice s x)) hB0 + +lemma coreConditionalObservable_aestronglyMeasurable {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x| ≤ B) + (s : Spins m) : AEStronglyMeasurable (coreConditionalObservable u W s) volume := by + unfold coreConditionalObservable + simp only [potentialForm_normalized_eq] + apply (mass_coreSlice_integrable u s).aestronglyMeasurable.inv₀.mul + apply (potentialForm_coreSlice_parameter_integrable u s (fun x v => W (joinConfiguration m k (x,v))) ?_).aestronglyMeasurable + intro t + simpa only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply] using + boundedObservable_integrable u W hW hB (Fin.append s t) + +lemma coreConditionalObservable_weight_integrable {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB0 : 0 ≤ B) + (hB : ∀ x, |W x| ≤ B) (s : Spins m) : + Integrable (fun x => mass (u.coreSlice s x)*coreConditionalObservable u W s x) := by + exact (mass_coreSlice_integrable u s).mul_bdd + (coreConditionalObservable_aestronglyMeasurable u W hW hB s) + (Eventually.of_forall (fun x => by simpa only [Real.norm_eq_abs] using + (coreConditionalObservable_abs_le u W hW hB0 hB s x))) + +lemma coreConditionalObservable_positive_weight_integrable {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB0 : 0 ≤ B) + (hB : ∀ x, |W x| ≤ B) (s : Spins m) (q : ℕ) : + Integrable (fun x => mass (u.coreSlice s x)*(max (coreConditionalObservable u W s x) 0)^q) := by + apply (mass_coreSlice_integrable u s).mul_bdd + (((coreConditionalObservable_aestronglyMeasurable u W hW hB s).sup aestronglyMeasurable_const).pow q) + filter_upwards [] with x + change ‖(max (coreConditionalObservable u W s x) 0)^q‖ ≤ B^q + rw [Real.norm_of_nonneg (pow_nonneg (le_max_right _ _) q)] + exact pow_le_pow_left₀ (le_max_right _ _) (max_le (le_trans (le_abs_self _) + (coreConditionalObservable_abs_le u W hW hB0 hB s x)) hB0) q + +lemma sliceExpectation_coreConditionalObservable {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} (hB : ∀ x, |W x| ≤ B) : + sliceExpectation u (coreConditionalObservable u W)=potentialForm W u := by + unfold sliceExpectation coreConditionalObservable + simp_rw [potentialForm_normalized_weight] + have H := integral_potentialForm_coreSlice_parameter u (fun x v => W (joinConfiguration m k (x,v))) + (fun st => by simpa only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply] using + boundedObservable_integrable u W hW hB st) + simpa only [Prod.mk.eta,ContinuousLinearEquiv.apply_symm_apply,potentialForm] using H + +theorem conditional_ensemble_positive_jensen {P : Type*} [Fintype P] + (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + (W : (p : P) → Configuration (m p+k p) → ℝ) + (hW : ∀ p, Measurable (W p)) {B : ℝ} (hB0 : 0 ≤ B) + (hB : ∀ p x, |W p x| ≤ B) (hmass : (∑ p, mass (u p))=1) : + (max (∑ p, potentialForm (W p) (u p)) 0)^2 ≤ + ∑ p, sliceExpectation (u p) (fun s x => (max (coreConditionalObservable (u p) (W p) s x) 0)^2) := by + let F := fun p => coreConditionalObservable (u p) (W p) + let c : ℝ := ∑ p, sliceExpectation (u p) (fun s x => max (F p s x) 0) + have hp (p) (s : Spins (m p)) : Integrable (fun x => mass ((u p).coreSlice s x)*max (F p s x) 0) := by + simpa only [pow_one] using coreConditionalObservable_positive_weight_integrable (u p) (W p) (hW p) hB0 (hB p) s 1 + have hq (p) (s : Spins (m p)) := coreConditionalObservable_positive_weight_integrable (u p) (W p) (hW p) hB0 (hB p) s 2 + have hc0 : 0 ≤ c := Finset.sum_nonneg (fun p _ => Finset.sum_nonneg (fun s _ => + integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (le_max_right _ _)))) + have hc : max (∑ p, potentialForm (W p) (u p)) 0 ≤ c := by + apply max_le _ hc0 + apply Finset.sum_le_sum + intro p _ + rw [←sliceExpectation_coreConditionalObservable (u p) (W p) (hW p) (hB p)] + apply Finset.sum_le_sum + intro s _ + exact integral_mono (coreConditionalObservable_weight_integrable (u p) (W p) (hW p) hB0 (hB p) s) + (hp p s) (fun x => mul_le_mul_of_nonneg_left (le_max_left _ _) (mass_nonneg _)) + have hn : 0 ≤ ∑ p, ∑ s : Spins (m p), ∫ x, mass ((u p).coreSlice s x)*(max (F p s x) 0-c)^2 := + Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have he (p) (s : Spins (m p)) : + (∫ x, mass ((u p).coreSlice s x)*(max (F p s x) 0-c)^2) = + (∫ x, mass ((u p).coreSlice s x)*(max (F p s x) 0)^2)- + 2*c*(∫ x, mass ((u p).coreSlice s x)*max (F p s x) 0)+ + c^2*(∫ x, mass ((u p).coreSlice s x)) := by + have hi : Integrable (fun x => mass ((u p).coreSlice s x)*(max (F p s x) 0)^2- + (2*c)*(mass ((u p).coreSlice s x)*max (F p s x) 0)) := by + exact (hq p s).sub ((hp p s).const_mul (2*c)) + calc + _ = ∫ x, (mass ((u p).coreSlice s x)*(max (F p s x) 0)^2- + (2*c)*(mass ((u p).coreSlice s x)*max (F p s x) 0))+c^2*mass ((u p).coreSlice s x) := + integral_congr_ae (Eventually.of_forall (fun x => by ring)) + _ = _ := by rw [integral_add hi ((mass_coreSlice_integrable (u p) s).const_mul _), + integral_sub (hq p s) ((hp p s).const_mul _),integral_const_mul,integral_const_mul] + simp only [he,Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum,integral_mass_coreSlice,hmass,mul_one] at hn + change 0 ≤ (∑ p, sliceExpectation (u p) (fun s x => (max (F p s x) 0)^2))-2*c*c+c^2 at hn + have H := pow_le_pow_left₀ (le_max_right (∑ p, potentialForm (W p) (u p)) 0) hc 2 + dsimp [F] at hn + nlinarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleCauchy.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f30e4147b235fb0a36eb6e5ff6e1d35bd3f8091 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleCauchy.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.OutCap + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma slice_ensemble_count_cauchy {P : Type*} [Fintype P] + (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + (F : (p : P) → Spins (m p) → Configuration (m p) → ℝ) + (hF : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*F p s x)) + (hF2 : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x)^2)) : + (∑ p, (m p:ℝ)*sliceExpectation (u p) (F p))^2 ≤ + (∑ p, (m p:ℝ)^2*mass (u p))*(∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2)) := by + let N : ℝ := ∑ p, (m p:ℝ)^2*mass (u p) + let C : ℝ := ∑ p, (m p:ℝ)*sliceExpectation (u p) (F p) + let H : ℝ := ∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2) + have hn (t : ℝ) : 0 ≤ N*(t*t)+(-2*C)*t+H := by + have hp : 0 ≤ ∑ p, ∑ s : Spins (m p), ∫ x, + mass ((u p).coreSlice s x)*(F p s x-t*(m p:ℝ))^2 := + Finset.sum_nonneg (fun p _ => Finset.sum_nonneg (fun s _ => + integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have he (p) (s : Spins (m p)) : + (∫ x, mass ((u p).coreSlice s x)*(F p s x-t*(m p:ℝ))^2) = + (∫ x, mass ((u p).coreSlice s x)*(F p s x)^2)- + (2*t*(m p:ℝ))*(∫ x, mass ((u p).coreSlice s x)*F p s x)+ + t^2*(m p:ℝ)^2*(∫ x, mass ((u p).coreSlice s x)) := by + have hi : Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x)^2- + (2*t*(m p:ℝ))*(mass ((u p).coreSlice s x)*F p s x)) := + (hF2 p s).sub ((hF p s).const_mul (2*t*(m p:ℝ))) + calc + _ = ∫ x, (mass ((u p).coreSlice s x)*(F p s x)^2- + (2*t*(m p:ℝ))*(mass ((u p).coreSlice s x)*F p s x))+ + (t^2*(m p:ℝ)^2)*mass ((u p).coreSlice s x) := + integral_congr_ae (Eventually.of_forall (fun x => by ring)) + _ = _ := by + rw [integral_add hi ((mass_coreSlice_integrable (u p) s).const_mul _), + integral_sub (hF2 p s) ((hF p s).const_mul _),integral_const_mul,integral_const_mul] + simp only [he,Finset.sum_sub_distrib,Finset.sum_add_distrib,←Finset.mul_sum,integral_mass_coreSlice] at hp + have hc : (∑ p, 2*t*(m p:ℝ)*(∑ s : Spins (m p), ∫ x, mass ((u p).coreSlice s x)*F p s x))=2*t*C := by + simp only [C,sliceExpectation,Finset.mul_sum] + apply Finset.sum_congr rfl + intro p hp + ring_nf + have hN : (∑ p, t^2*(m p:ℝ)^2*mass (u p))=t^2*N := by + simp only [N,Finset.mul_sum] + apply Finset.sum_congr rfl + intro p hp + ring + rw [hc,hN] at hp + change 0 ≤ H-2*t*C+t^2*N at hp + nlinarith + have h := discrim_le_zero hn + unfold discrim at h + change C^2 ≤ N*H + nlinarith + +theorem conditionalOutCost_ensemble_lower {P : Type*} [Fintype P] {J : ℕ} + (S : Nuclei J) (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + {a : ℝ} (ha : 0 < a) (y : Space) (hnuc : ∀ j, 4*a ≤ ‖S.position j-y‖) + (hsupp : ∀ p s, ∀ᵐ x, mass ((u p).coreSlice s x) ≠0 → ∀ i, ‖position x i-y‖ ≤ a) : + -Real.sqrt ((∑ p, (m p:ℝ)^2*mass (u p))* + (∑ p, sliceExpectation (u p) (fun s x => (localFarCap S ((u p).coreSlice s x).normalized x y a)^2)))- + (∑ p, (m p:ℝ)^2*mass (u p))/(3*a) ≤ ∑ p, conditionalOutCost S (u p) := by + let F := fun p s x => localFarCap S ((u p).coreSlice s x).normalized x y a + let N : ℝ := ∑ p, (m p:ℝ)^2*mass (u p) + let C : ℝ := ∑ p, (m p:ℝ)*sliceExpectation (u p) (F p) + let H : ℝ := ∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2) + have hC0 : 0 ≤ C := Finset.sum_nonneg (fun p _ => mul_nonneg (Nat.cast_nonneg _) + (Finset.sum_nonneg (fun s _ => integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (localFarCap_nonneg _ _ _ _ _))))) + have hN0 : 0 ≤ N := Finset.sum_nonneg (fun p _ => mul_nonneg (sq_nonneg _) (mass_nonneg _)) + have hH0 : 0 ≤ H := Finset.sum_nonneg (fun p _ => Finset.sum_nonneg (fun s _ => + integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have hCsq : C^2 ≤ N*H := by + apply slice_ensemble_count_cauchy m k u F + · intro p s + simpa only [pow_one] using localFarCap_weight_integrable S (u p) s ha y hnuc 1 + · intro p s + exact localFarCap_weight_integrable S (u p) s ha y hnuc 2 + have hCle : C ≤ Real.sqrt (N*H) := (Real.le_sqrt hC0 (mul_nonneg hN0 hH0)).2 hCsq + have h := Finset.sum_le_sum (fun p (_ : p ∈ Finset.univ) => conditionalOutCost_lower_local S (u p) ha y hnuc (hsupp p)) + have he : (∑ p, (-(m p:ℝ)*sliceExpectation (u p) (F p)-(m p:ℝ)^2/(3*a)*mass (u p))) = -C-N/(3*a) := by + simp only [C,N,Finset.sum_sub_distrib,Finset.sum_div,←Finset.sum_neg_distrib,neg_mul] + congr 1 + apply Finset.sum_congr rfl + intro p hp + ring + change (∑ p, (-(m p:ℝ)*sliceExpectation (u p) (F p)-(m p:ℝ)^2/(3*a)*mass (u p))) ≤ _ at h + rw [he] at h + change -Real.sqrt (N*H)-N/(3*a) ≤ _ + linarith + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma slice_ensemble_cauchy {P : Type*} [Fintype P] + (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + (F G : (p : P) → Spins (m p) → Configuration (m p) → ℝ) + (hF : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x)^2)) + (hG : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(G p s x)^2)) + (hFG : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x*G p s x))) : + (∑ p, sliceExpectation (u p) (fun s x => F p s x*G p s x))^2 ≤ + (∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2))* + (∑ p, sliceExpectation (u p) (fun s x => (G p s x)^2)) := by + let A : ℝ := ∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2) + let B : ℝ := ∑ p, sliceExpectation (u p) (fun s x => (G p s x)^2) + let C : ℝ := ∑ p, sliceExpectation (u p) (fun s x => F p s x*G p s x) + have hn (t : ℝ) : 0 ≤ A*(t*t)+(-2*C)*t+B := by + have hp : 0 ≤ ∑ p, ∑ s : Spins (m p), ∫ x, + mass ((u p).coreSlice s x)*(t*F p s x-G p s x)^2 := + Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => + integral_nonneg (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have he (p) (s : Spins (m p)) : + (∫ x, mass ((u p).coreSlice s x)*(t*F p s x-G p s x)^2) = + t^2*(∫ x, mass ((u p).coreSlice s x)*(F p s x)^2)- + (2*t)*(∫ x, mass ((u p).coreSlice s x)*(F p s x*G p s x))+ + (∫ x, mass ((u p).coreSlice s x)*(G p s x)^2) := by + have hi : Integrable (fun x => t^2*(mass ((u p).coreSlice s x)*(F p s x)^2)- + (2*t)*(mass ((u p).coreSlice s x)*(F p s x*G p s x))) := + ((hF p s).const_mul (t^2)).sub ((hFG p s).const_mul (2*t)) + calc + _ = ∫ x, (t^2*(mass ((u p).coreSlice s x)*(F p s x)^2)- + (2*t)*(mass ((u p).coreSlice s x)*(F p s x*G p s x)))+ + mass ((u p).coreSlice s x)*(G p s x)^2 := + integral_congr_ae (Eventually.of_forall (fun x => by ring)) + _ = _ := by + rw [integral_add hi (hG p s),integral_sub ((hF p s).const_mul _) ((hFG p s).const_mul _),integral_const_mul,integral_const_mul] + simp only [he,Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum] at hp + change 0 ≤ t^2*A-2*t*C+B at hp + nlinarith + have h := discrim_le_zero hn + unfold discrim at h + change C^2 ≤ A*B + nlinarith + +lemma slice_ensemble_mul_le_sqrt {P : Type*} [Fintype P] + (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + (F G : (p : P) → Spins (m p) → Configuration (m p) → ℝ) + (hF : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x)^2)) + (hG : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(G p s x)^2)) + (hFG : ∀ p s, Integrable (fun x => mass ((u p).coreSlice s x)*(F p s x*G p s x))) : + (∑ p, sliceExpectation (u p) (fun s x => F p s x*G p s x)) ≤ + Real.sqrt ((∑ p, sliceExpectation (u p) (fun s x => (F p s x)^2))* + (∑ p, sliceExpectation (u p) (fun s x => (G p s x)^2))) := + Real.le_sqrt_of_sq_le (slice_ensemble_cauchy m k u F G hF hG hFG) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleCoveredCost.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleCoveredCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd11cf8ab1ff73b99d052e5fbe7baa181f315b71 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleCoveredCost.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.EnsembleMoments +import OAI.Analysis.CoulombRadii.Screening.AtomicCapRaw +import OAI.Analysis.CoulombRadii.RandomFields.EnsembleCauchy + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma sliceExpectation_localCount_le {m k : ℕ} (u : H1Vector (m+k)) + {A : Set Space} (hA : MeasurableSet A) : + sliceExpectation u (fun _ x => localCount A x) ≤ (m:ℝ)*mass u := by + rw [←integral_mass_coreSlice u,Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + rw [←integral_const_mul] + apply integral_mono + · simpa only [pow_one] using sliceCount_weight_integrable u hA s 1 + · exact (mass_coreSlice_integrable u s).const_mul _ + · intro x + dsimp only + nlinarith [mul_le_mul_of_nonneg_left (localCount_le A x) (mass_nonneg (u.coreSlice s x))] + +lemma sliceExpectation_count_cap_addback {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {a : ℝ} (ha : 0 localCount (Metric.closedBall y a) x* + (localFarCap S (u.coreSlice s x).normalized x y a+(m:ℝ)/(3*a))) ≤ + sliceExpectation u (fun s x => localCount (Metric.closedBall y a) x* + localFarCap S (u.coreSlice s x).normalized x y a)+(m:ℝ)^2/(3*a)*mass u := by + have hc (s : Spins m) : Integrable (fun x => mass (u.coreSlice s x)* + (localCount (Metric.closedBall y a) x*localFarCap S (u.coreSlice s x).normalized x y a)) := by + simpa only [mul_assoc] using sliceCount_cap_weight_integrable S u measurableSet_closedBall s ha y hnuc + have hn (s : Spins m) : Integrable (fun x => mass (u.coreSlice s x)* + ((m:ℝ)/(3*a)*localCount (Metric.closedBall y a) x)) := by + have h : Integrable (fun x => mass (u.coreSlice s x)*localCount (Metric.closedBall y a) x) := by + simpa only [pow_one] using sliceCount_weight_integrable u measurableSet_closedBall s 1 + simpa only [mul_left_comm (mass _) ((m:ℝ)/(3*a))] using h.const_mul ((m:ℝ)/(3*a)) + have he : sliceExpectation u (fun s x => localCount (Metric.closedBall y a) x* + (localFarCap S (u.coreSlice s x).normalized x y a+(m:ℝ)/(3*a))) = + sliceExpectation u (fun s x => localCount (Metric.closedBall y a) x* + localFarCap S (u.coreSlice s x).normalized x y a)+ + (m:ℝ)/(3*a)*sliceExpectation u (fun _ x => localCount (Metric.closedBall y a) x) := by + rw [←sliceExpectation_const_mul,←sliceExpectation_add u _ _ hc hn] + congr 1 + funext s x + ring + rw [he] + have H := mul_le_mul_of_nonneg_left (sliceExpectation_localCount_le u (A:=Metric.closedBall y a) measurableSet_closedBall) + (show 0 ≤ (m:ℝ)/(3*a) by positivity) + have heq : (m:ℝ)/(3*a)*((m:ℝ)*mass u)=(m:ℝ)^2/(3*a)*mass u := by ring + rw [heq] at H + exact add_le_add le_rfl H + +theorem conditionalOutCost_ensemble_cover_lower {P C : Type*} [Fintype P] [Fintype C] {J : ℕ} + (S : Nuclei J) (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + (y : C → Space) (a : C → ℝ) (ha : ∀ c, 0 (localCount (Metric.closedBall (y c) (a c)) x)^2))* + (∑ p, sliceExpectation (u p) (fun s x => (localFarCap S ((u p).coreSlice s x).normalized x (y c) (a c))^2)))+ + (∑ p, (m p:ℝ)^2*mass (u p))/(3*a c))) ≤ ∑ p, conditionalOutCost S (u p) := by + let F := fun c p (s : Spins (m p)) (x : Configuration (m p)) => + localCount (Metric.closedBall (y c) (a c)) x*(localFarCap S ((u p).coreSlice s x).normalized x (y c) (a c)+(m p:ℝ)/(3*a c)) + have hlow := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => conditionalOutCost_lower_cover S (u p) y a ha hnuc (hsupp p)) + change (∑ p, -(∑ c, sliceExpectation (u p) (F c p))) ≤ _ at hlow + rw [Finset.sum_neg_distrib,Finset.sum_comm] at hlow + refine (neg_le_neg (Finset.sum_le_sum (fun c (_ : c∈Finset.univ) => ?_))).trans hlow + have hcs := slice_ensemble_mul_le_sqrt m k u + (fun _ _ x => localCount (Metric.closedBall (y c) (a c)) x) + (fun p s x => localFarCap S ((u p).coreSlice s x).normalized x (y c) (a c)) + (fun p s => sliceCount_weight_integrable (u p) measurableSet_closedBall s 2) + (fun p s => localFarCap_weight_integrable S (u p) s (ha c) (y c) (hnuc c) 2) + (fun p s => by simpa only [mul_assoc] using sliceCount_cap_weight_integrable S (u p) measurableSet_closedBall s (ha c) (y c) (hnuc c)) + have hsum := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => sliceExpectation_count_cap_addback S (u p) (ha c) (y c) (hnuc c)) + rw [Finset.sum_add_distrib] at hsum + have he : (∑ p, (m p:ℝ)^2/(3*a c)*mass (u p))=(∑ p, (m p:ℝ)^2*mass (u p))/(3*a c) := by + rw [Finset.sum_div] + apply Finset.sum_congr rfl + intro p hp + ring + rw [he] at hsum + exact hsum.trans (add_le_add hcs le_rfl) + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb +namespace RecordedEnsemble + +theorem atomic_cost_lower {n J : ℕ} {C : Type*} [Fintype C] + (S : Nuclei J) (hatom : ∀ j, S.position j=0) (ψ : H1Vector n) + (T : RecordedEnsemble n) (hT : T.Conserves ψ) (z : C → Space) (hz : ∀ c, z c≠0) + (hcover : ∀ p s, ∀ᵐ x, mass ((T.vector p).coreSlice s x)≠0 → + ∀ i, ∃ c, ‖position x i-z c‖≤atomicCellScale (z c)) + {H : ℝ} + (hraw : ∀ c v, ‖v-z c‖≤2*atomicCellScale (z c) → T.rawSquare S v (atomicCellScale v)≤H) : + -(∑ c, (Real.sqrt (localCountSecondMoment ψ (Metric.closedBall (z c) (atomicCellScale (z c)))*(8*H))+ + ((Fintype.card C:ℝ)*(∑ d, localCountSecondMoment ψ (Metric.closedBall (z d) (atomicCellScale (z d)))))/ + (3*atomicCellScale (z c)))) ≤ ∑ p, conditionalOutCost S (T.vector p) := by + let a := fun c => atomicCellScale (z c) + have ha (c) : 0 + (localFarCap S ((T.vector p).coreSlice s x).normalized x (z c) (a c))^2))≤8*H := + atomic_cap_sq_le_of_raw_bound S T.out T.core T.vector (hz c) (hnuc c) (hraw c) + have hcount := out_square_cover hT (fun c => Metric.closedBall (z c) (a c)) + (fun _ => measurableSet_closedBall) + (fun p s => by + filter_upwards [hcover p s] with x hx + intro hm i + obtain ⟨c,hc⟩ := hx hm i + exact ⟨c,by simpa only [Metric.mem_closedBall,dist_eq_norm] using hc⟩) + refine (neg_le_neg (Finset.sum_le_sum (fun c _ => ?_))).trans HC + apply add_le_add + · apply Real.sqrt_le_sqrt + apply mul_le_mul (hT.recorded_secondMoment measurableSet_closedBall) (hcap c) + · exact Finset.sum_nonneg (fun p _ => Finset.sum_nonneg (fun s _ => integral_nonneg + (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + · exact localCountSecondMoment_nonneg ψ _ + · exact div_le_div_of_nonneg_right hcount (mul_nonneg (by norm_num) (ha c).le) + +lemma patches_cover {n : ℕ} {I : Type*} [Fintype I] + (T : RecordedEnsemble n) (target : I → Space) (htarget : ∀ i, target i≠0) + (hsupp : T.OutSupported (⋃ i, Metric.closedBall (target i) (80*atomicCellScale (target i)))) : + ∀ p s, ∀ᵐ x, mass ((T.vector p).coreSlice s x)≠0 → + ∀ j, ∃ c : I × {v : Space // v∈atomicPatchMesh}, + ‖position x j-atomicMeshCenter (target c.1) c.2.val‖≤ + atomicCellScale (atomicMeshCenter (target c.1) c.2.val) := by + intro p s + filter_upwards [(hsupp p).recorded_positions s] with x hx + intro hm j + obtain ⟨i,hi⟩ := Set.mem_iUnion.mp (hx hm j) + obtain ⟨v,hv,hclose⟩ := atomicMesh_cover (htarget i) (position x j) + (by simpa only [Metric.mem_closedBall,dist_eq_norm] using hi) + exact ⟨(i,⟨v,hv⟩),hclose⟩ + +end RecordedEnsemble +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleTransfer.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdb1189494526756c7d4db348d136e66c6247f7b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/EnsembleTransfer.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.CorePointMeasurable + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +lemma sliceExpectation_linear_remainder {m k : ℕ} (u : H1Vector (m+k)) + (G N₁ N₂ D : Spins m → Configuration m → ℝ) (c ε C a : ℝ) + (hG : ∀ s,Integrable (fun x => mass (u.coreSlice s x)*G s x)) + (hN₁ : ∀ s,Integrable (fun x => mass (u.coreSlice s x)*N₁ s x)) + (hN₂ : ∀ s,Integrable (fun x => mass (u.coreSlice s x)*N₂ s x)) + (hD : ∀ s,Integrable (fun x => mass (u.coreSlice s x)*D s x)) : + sliceExpectation u (fun s x => ε+c*G s x+N₁ s x+N₂ s x+D s x/a+C)= + ε*mass u+c*sliceExpectation u G+sliceExpectation u N₁+sliceExpectation u N₂+ + sliceExpectation u D/a+C*mass u := by + have he (s : Spins m) : + (∫ x,mass (u.coreSlice s x)*(ε+c*G s x+N₁ s x+N₂ s x+D s x/a+C))= + ε*(∫ x,mass (u.coreSlice s x))+c*(∫ x,mass (u.coreSlice s x)*G s x)+ + (∫ x,mass (u.coreSlice s x)*N₁ s x)+(∫ x,mass (u.coreSlice s x)*N₂ s x)+ + (∫ x,mass (u.coreSlice s x)*D s x)/a+C*(∫ x,mass (u.coreSlice s x)) := by + have h0 := (mass_coreSlice_integrable u s).const_mul ε + have h1 := (hG s).const_mul c + have hd := (hD s).div_const a + have hC := (mass_coreSlice_integrable u s).const_mul C + calc + _=(∫ x,ε*mass (u.coreSlice s x)+c*(mass (u.coreSlice s x)*G s x)+ + mass (u.coreSlice s x)*N₁ s x+mass (u.coreSlice s x)*N₂ s x+ + (mass (u.coreSlice s x)*D s x)/a+C*mass (u.coreSlice s x)) := by + apply integral_congr_ae + exact Eventually.of_forall (fun x => by ring) + _=_ := by + have hA := integral_add ((((h0.add h1).add (hN₁ s)).add (hN₂ s)).add hd) hC + have hB := integral_add (((h0.add h1).add (hN₁ s)).add (hN₂ s)) hd + have hE := integral_add ((h0.add h1).add (hN₁ s)) (hN₂ s) + have hF := integral_add (h0.add h1) (hN₁ s) + have hH := integral_add h0 h1 + simp only [Pi.add_apply] at hA hB hE hF hH + rw [hA,hB,hE,hF,hH,integral_const_mul,integral_const_mul,integral_const_mul,integral_div] + unfold sliceExpectation + simp only [he,Finset.sum_add_distrib,←Finset.mul_sum,←Finset.sum_div,integral_mass_coreSlice] + +lemma nearPotential_fresh_expectation {n : ℕ} (T : RecordedEnsemble n) (u : H1Vector n) + (hT : T.Conserves u) {y : Space} {R t : ℝ} (hs : T.CoreSupported {z | t≤‖z-y‖}) (hRt : R≤t) : + (∑ p,sliceExpectation (T.vector p) (fun _ x => nearPotential y R x))= + potentialForm (nearPotential y R) u := by + rw [←hT.nearPotential y R] + apply Finset.sum_congr rfl + intro p _ + rw [sliceExpectation_const (T.vector p) _ (nearPotential_outer_integrable (T.vector p) y R)] + exact (supported_core_nearPotential (T.vector p) y hRt (hs p)).symm + +lemma fresh_deleted_mean_le {n : ℕ} (T : RecordedEnsemble n) + (hm : (∑ p,mass (T.vector p))=1) (y : Space) (t b : ℝ) : + (∑ p,sliceExpectation (T.vector p) (fun _ x => localCount {z | t-7*b≤‖z-y‖} x))≤ + Real.sqrt (T.deletedSquare y t b) := by + apply slice_ensemble_mean_le_sqrt T.out T.core T.vector _ _ _ _ hm + · exact fun p s => (localCount_measurable (isClosed_le continuous_const (by fun_prop)).measurableSet).aestronglyMeasurable + · exact fun p s => Eventually.of_forall (fun x => localCount_nonneg _ x) + · exact fun p s => sliceCount_weight_integrable (T.vector p) + (isClosed_le continuous_const (by fun_prop)).measurableSet s 2 + +theorem ensemble_patch_error_bound {J n : ℕ} (S : Nuclei J) (T : RecordedEnsemble n) (u : H1Vector n) + (hT : T.Conserves u) (hm : (∑ p,mass (T.vector p))=1) + {a b t r ε : ℝ} (ha : 0 hx.normalized) + have HB := (Finset.abs_sum_le_sum_abs _ _).trans (Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => + (patchFieldTransferError_integrable_mean S (T.vector p) ha hb hsmall ht y hn hr hra hε (hs p)).2)) + have HE (p : T.index) : + sliceExpectation (T.vector p) (patchTransferRemainder S (T.vector p) ha hb ht.2 y hn r ε)= + ε*mass (T.vector p)+(5/(4*r*ε))*sliceExpectation (T.vector p) (patchSliceTFGap S (T.vector p) ha hb ht.2 y hn)+ + sliceExpectation (T.vector p) (fun _ x => nearPotential y (r+2*b) x)+ + sliceExpectation (T.vector p) (fun _ x => nearPotential y (2*b) x)+ + sliceExpectation (T.vector p) (fun _ x => localCount {z | t-7*b≤‖z-y‖} x)/a+ + (((tfInteriorConstant thomasFermiKineticConstant/ + (thomasFermiKineticConstant*(5/3:ℝ)))^(3/2:ℝ)/a^6)*(2*Real.pi*r^2))*mass (T.vector p) := by + apply sliceExpectation_linear_remainder + · exact fun s => patchSliceTFGap_weight_integrable S (T.vector p) ha hb ht.2 y hn s (hs p s) + · exact fun s => slice_weight_integrable_const (T.vector p) _ (nearPotential_outer_integrable (T.vector p) y (r+2*b)) s + · exact fun s => slice_weight_integrable_const (T.vector p) _ (nearPotential_outer_integrable (T.vector p) y (2*b)) s + · intro s + simpa only [pow_one] using sliceCount_weight_integrable (T.vector p) + (isClosed_le continuous_const (by fun_prop)).measurableSet s 1 + simp only [HE,Finset.sum_add_distrib,←Finset.mul_sum,←Finset.sum_div,hm,mul_one] at HB + rw [nearPotential_fresh_expectation T u hT hcs (by linarith [ht.1] : r+2*b≤t), + nearPotential_fresh_expectation T u hT hcs (by linarith [ht.1] : 2*b≤t)] at HB + have hD := div_le_div_of_nonneg_right (fresh_deleted_mean_le T hm y t b) ha.le + linarith +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/EventTiltWavefunction.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/EventTiltWavefunction.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf492d78e8df1ac10bd13cf92453b0fca116ec6f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/EventTiltWavefunction.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationWidthSquareSum + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +open scoped ENNReal Convolution +open scoped BigOperators +open scoped Convolution + +theorem energy_eventRoot_identity {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) + {F : Configuration n → ℝ} {K : ℝ} + (hK : 0 ≤ K) (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hsym : ∀ (p : Equiv.Perm (Fin n)) x, F (x ∘ p) = F x) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) : + energy Z (multiplyWavefunction (fun x => Real.sqrt (F x)) ψ) + (explicitMultiplyGradient (fun x => Real.sqrt (F x)) (eventRootDerivative F) ψ g) = + energy Z ψ g * stateWeightedIntegral ψ F + explicitLocalizationError ψ (eventRootDerivative F) := by + have hsq : SmoothMultiplier (fun x => (Real.sqrt (F x))^2) := by + simpa only [Real.sq_sqrt (hF0 _)] using likelihood_smoothMultiplier hK hF hF0 hF1 hsym hgrad + rw [energy_localization_explicit Z hd hsq + (fun i a => (eventRootDerivative_measurable hF i a).aestronglyMeasurable) + (fun i a => ⟨_, eventRootDerivative_bound hK hF0 hF1 hgrad i a⟩) + (eventRoot_square_derivative hF0 hgrad), minimizer_multiplier_pairing Z hd hn hmin hsq] + simp only [Real.sq_sqrt (hF0 _)] + +def eventTiltWavefunction {n : ℕ} (ψ : Wavefunction n) (F : Configuration n → ℝ) : + Wavefunction n := + scaleWavefunction (Real.sqrt (stateWeightedIntegral ψ F))⁻¹ + (multiplyWavefunction (fun x => Real.sqrt (F x)) ψ) + +def eventTiltGradient {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) + (F : Configuration n → ℝ) : Gradient n := + scaleGradient (Real.sqrt (stateWeightedIntegral ψ F))⁻¹ + (explicitMultiplyGradient (fun x => Real.sqrt (F x)) (eventRootDerivative F) ψ g) + +theorem normSquared_eventRoot {n : ℕ} (ψ : Wavefunction n) {F : Configuration n → ℝ} + (hF0 : ∀ x, 0 ≤ F x) : + normSquared (multiplyWavefunction (fun x => Real.sqrt (F x)) ψ) = + stateWeightedIntegral ψ F := by + simp only [normSquared, norm_multiplyWavefunction_sq, Real.sq_sqrt (hF0 _), stateWeightedIntegral] + +theorem eventTiltWavefunction_normalized {n : ℕ} (ψ : Wavefunction n) {F : Configuration n → ℝ} + (hF0 : ∀ x, 0 ≤ F x) (hp : 0 < stateWeightedIntegral ψ F) : + normSquared (eventTiltWavefunction ψ F) = 1 := by + rw [eventTiltWavefunction, normSquared_scale, inv_pow, Real.sq_sqrt hp.le, + normSquared_eventRoot ψ hF0, inv_mul_cancel₀ hp.ne'] + +theorem eventTiltWavefunction_raw_density {n : ℕ} (ψ : Wavefunction n) {F : Configuration n → ℝ} + (hF0 : ∀ x, 0 ≤ F x) (hp : 0 < stateWeightedIntegral ψ F) + (σ : Spins n) (x : Configuration n) : + ‖eventTiltWavefunction ψ F σ x‖^2 = + F x / stateWeightedIntegral ψ F * ‖ψ σ x‖^2 := by + simp only [eventTiltWavefunction, scaleWavefunction, multiplyWavefunction, + norm_smul, Real.norm_eq_abs, mul_pow, sq_abs, inv_pow, Real.sq_sqrt hp.le, + Real.sq_sqrt (hF0 x)] + ring + +theorem groundState_eventTilt {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) + {F : Configuration n → ℝ} {K : ℝ} + (hK : 0 ≤ K) (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hsym : ∀ (p : Equiv.Perm (Fin n)) x, F (x ∘ p) = F x) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + (hp : 0 < stateWeightedIntegral ψ F) : + FormDomain (eventTiltWavefunction ψ F) (eventTiltGradient ψ g F) ∧ + normSquared (eventTiltWavefunction ψ F) = 1 ∧ + energy Z (eventTiltWavefunction ψ F) (eventTiltGradient ψ g F) ≤ + energy Z ψ g + K/8*(1+120*Real.exp 1)*(1-Real.log (stateWeightedIntegral ψ F))^5 := by + refine ⟨(hd.eventRoot hK hF hF0 hF1 hsym hgrad).scale _, + eventTiltWavefunction_normalized ψ hF0 hp, ?_⟩ + unfold eventTiltWavefunction eventTiltGradient + rw [energy_scale, inv_pow, Real.sq_sqrt hp.le, + energy_eventRoot_identity Z hd hn hmin hK hF hF0 hF1 hsym hgrad] + calc + _ ≤ (stateWeightedIntegral ψ F)⁻¹ * + (energy Z ψ g * stateWeightedIntegral ψ F + + K/8*(1+120*Real.exp 1)*stateWeightedIntegral ψ F* + (1-Real.log (stateWeightedIntegral ψ F))^5) := + mul_le_mul_of_nonneg_left (add_le_add le_rfl + (explicitLocalizationError_eventRoot_le hd hn hK hF hF0 hF1 hgrad hp)) + (inv_nonneg.mpr hp.le) + _ = _ := by field_simp + +def observationEventEnergyConstant : ℝ := + observationScoreConstant/8*(1+120*Real.exp 1) + +theorem observationEventEnergyConstant_pos : 0 < observationEventEnergyConstant := by + unfold observationEventEnergyConstant + have := observationScoreConstant_pos + positivity + +theorem groundState_arrayEventTilt {H : Type*} [Fintype H] {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) + (ℓ : H → ℝ) (hℓ : ∀ h, 0 < ℓ h) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (hsym : ∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y ∈ s ↔ y ∈ s) + (hp : 0 < stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)) : + FormDomain (eventTiltWavefunction ψ (arrayEventLikelihood ℓ s)) + (eventTiltGradient ψ g (arrayEventLikelihood ℓ s)) ∧ + normSquared (eventTiltWavefunction ψ (arrayEventLikelihood ℓ s)) = 1 ∧ + energy Z (eventTiltWavefunction ψ (arrayEventLikelihood ℓ s)) + (eventTiltGradient ψ g (arrayEventLikelihood ℓ s)) ≤ + energy Z ψ g + observationEventEnergyConstant * observationWidthSquareSum ℓ * + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5 := by + have hh := groundState_eventTilt Z hd hn hmin + (mul_nonneg observationScoreConstant_pos.le (observationWidthSquareSum_nonneg ℓ)) + (arrayEventLikelihood_contDiff ℓ hs) (arrayEventLikelihood_nonneg ℓ hs) + (arrayEventLikelihood_le_one ℓ hs) + (arrayEventLikelihood_symmetric ℓ (fun h => (hℓ h).ne') hsym) + (arrayEventLikelihood_gradient_bound ℓ hs) hp + refine ⟨hh.1, hh.2.1, ?_⟩ + convert hh.2.2 using 1 + unfold observationEventEnergyConstant + ring + +theorem groundState_arrayEventTilt_singleScale {H : Type*} [Fintype H] {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) + (ℓ : H → ℝ) (hℓ : ∀ h, 0 < ℓ h) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (hsym : ∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y ∈ s ↔ y ∈ s) + (hp : 0 < stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)) + {r Cℓ : ℝ} (hwidth : observationWidthSquareSum ℓ ≤ Cℓ*r⁻¹^2) : + energy Z (eventTiltWavefunction ψ (arrayEventLikelihood ℓ s)) + (eventTiltGradient ψ g (arrayEventLikelihood ℓ s)) ≤ + energy Z ψ g + observationEventEnergyConstant * Cℓ * r⁻¹^2 * + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5 := by + apply (groundState_arrayEventTilt Z hd hn hmin ℓ hℓ hs hsym hp).2.2.trans + apply add_le_add le_rfl + have hp1 := stateWeightedIntegral_le_one hd hn (arrayEventLikelihood_contDiff ℓ hs).continuous.measurable + (arrayEventLikelihood_nonneg ℓ hs) (arrayEventLikelihood_le_one ℓ hs) + have hlog := Real.log_nonpos hp.le hp1 + have hh := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hwidth observationEventEnergyConstant_pos.le) + (pow_nonneg (by linarith : 0 ≤ 1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s))) 5) + nlinarith only [hh] + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ExactRecordedCount.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ExactRecordedCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..4daad8cc6af9da63468cc6a1ff06e4968bc44053 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ExactRecordedCount.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedEnsemble +import OAI.Analysis.CoulombRadii.ThomasFermi.BinaryEnsemble + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace Coulomb + +lemma localCount_eq_zero_of_allPositions {n : ℕ} {A B : Set Space} (hAB : Disjoint A B) + {x : Configuration n} (hx : x∈allPositions A) : localCount B x=0 := by + apply Finset.sum_eq_zero + intro i hi + apply indicator_of_notMem + exact fun h => Set.disjoint_left.mp hAB (hx i) h + +lemma potentialForm_count_join_of_support {m k : ℕ} {u : H1Vector k} + {A B : Set Space} (hAB : Disjoint A B) (hu : SpatiallySupported u A) (x : Configuration m) : + potentialForm (fun z => (localCount B (joinConfiguration m k (x,z)))^2) u= + (localCount B x)^2*mass u := by + rw [←potentialForm_const ((localCount B x)^2) u] + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [hu s] with z hz + by_cases h : z∈allPositions A + · rw [localCount_join,localCount_eq_zero_of_allPositions hAB h,add_zero] + · rw [hz h,norm_zero,zero_pow (by norm_num : (2:ℕ)≠0),mul_zero,mul_zero] + +lemma sliceExpectation_localCount_sq_eq {m k : ℕ} (u : H1Vector (m+k)) + {A B : Set Space} (hB : MeasurableSet B) (hAB : Disjoint A B) + (hu : PartlySupported u (coreIndexSet m k) A) : + sliceExpectation u (fun _ x => (localCount B x)^2)=localCountSecondMoment u B := by + let W := fun x : Configuration (m+k) => (localCount B x)^2 + have hWB : ∀ x, |W x|≤((m+k:ℕ):ℝ)^2 := by + intro x + rw [abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (localCount_nonneg _ _) (localCount_le _ _) 2 + change sliceExpectation u (fun _ x => (localCount B x)^2)=potentialForm W u + rw [←sliceExpectation_coreConditionalObservable u W ((localCount_measurable hB).pow_const 2) hWB] + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [hu.coreSlice s] with x hx + by_cases hm : mass (u.coreSlice s x)=0 + · simp only [hm,zero_mul] + · have hm' := lt_of_le_of_ne (mass_nonneg (u.coreSlice s x)) (Ne.symm hm) + unfold coreConditionalObservable + rw [potentialForm_count_join_of_support hAB hx.normalized x,mass_normalized _ hm',mul_one] + +lemma RecordedEnsemble.Conserves.recorded_secondMoment_eq {n : ℕ} {T : RecordedEnsemble n} + {ψ : H1Vector n} (hT : T.Conserves ψ) {A B : Set Space} (hB : MeasurableSet B) + (hAB : Disjoint A B) (hcs : T.CoreSupported A) : + (∑ p, sliceExpectation (T.vector p) (fun _ x => (localCount B x)^2))=localCountSecondMoment ψ B := by + rw [←hT.secondMoment hB] + exact Finset.sum_congr rfl (fun p _ => sliceExpectation_localCount_sq_eq (T.vector p) hB hAB (hcs p)) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ExteriorIMS.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ExteriorIMS.lean new file mode 100644 index 0000000000000000000000000000000000000000..d31b563d4ff71c2dd6187653b9daab2df8438739 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ExteriorIMS.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.OutCap +import OAI.Analysis.CoulombRadii.FieldAnalysis.SortedObservable +import OAI.Analysis.CoulombRadii.SpectralTheory.SectorBottomBridge + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace Coulomb +lemma conditionalOutCost_lower_attraction {J m k:ℕ} (S:Nuclei J) (u:H1Vector (m+k)) + (B:ℝ) (hs:∀ s,∀ᵐ x,mass (u.coreSlice s x)≠0 → ∀ i,attraction S (position x i) ≤ B) : + -((m:ℝ)*B)*mass u ≤ conditionalOutCost S u := by + have H: -((m:ℝ)*B)*mass u ≤ sliceExpectation u (fun s x => pairPotential x-∑ i:Fin m,coreScreenedField S (u.coreSlice s x).normalized (position x i)) := by + rw [←sliceExpectation_number u (-((m:ℝ)*B))] + apply Finset.sum_le_sum + intro s _ + apply integral_mono_ae + · exact (mass_coreSlice_integrable u s).mul_const _ + · exact conditionalOutCost_weight_integrable S u s + filter_upwards [hs s] with x hx + by_cases hz:mass (u.coreSlice s x)=0 + · simp [hz] + apply mul_le_mul_of_nonneg_left _ (mass_nonneg _) + have hb:(∑ i:Fin m,coreScreenedField S (u.coreSlice s x).normalized (position x i)) ≤ (m:ℝ)*B := by + calc + _ ≤ ∑ _i:Fin m,B := Finset.sum_le_sum (fun i _ => (sub_le_self _ (coreCoulombPotential_nonneg _ _)).trans (hx hz i)) + _=_ := by simp + linarith [pairPotential_nonneg_pointwise x] + exact H.trans (le_add_of_nonneg_left (outerKinetic_nonneg u)) + +lemma outLabelCount_eq_zero_iff {n:ℕ} (p:Fin n → Fin 2) : outLabelCount p=0 ↔ p=fun _ => 1 := by + unfold outLabelCount + constructor + · intro h + funext i + have hi: (if p i=0 then (1:ℝ) else 0) ≤ 0 := by + exact (Finset.single_le_sum (f:=fun j:Fin n => if p j=0 then (1:ℝ) else 0) + (fun j _ => by split_ifs <;> norm_num) (Finset.mem_univ i)).trans_eq h + have hp:p i≠0 := by intro hz; norm_num [hz] at hi + apply Fin.ext + have hv:(p i).val≠0 := by simpa only [ne_eq,Fin.ext_iff,Fin.val_zero] using hp + have hvlt:=(p i).isLt + change (p i).val=1 + omega + · rintro rfl; simp + +lemma form_binary_cut_global {J n:ℕ} (S:Nuclei J) (u:H1Vector n) + (χ:Fin 2 → Space → ℝ) (hc:∀ l,ContDiff ℝ ∞ (χ l)) + (hp:∀ z,∑ l,χ l z^2=1) (D:ℝ) (hD:0 ≤ D) + (hd:∀ l b z,|fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) : + (∑ p:Fin n → Fin 2,form S (u.labelCut χ hc hp D hD hd p)) ≤ form S u+3*(n:ℝ)*D^2*mass u := by + rw [form_labelCut] + apply add_le_add_right + have H (s:Spins n) (a:Fin n × Fin 3) : + (∫ x,(∑ l:Fin 2,(fderiv ℝ (χ l) (position x a.1) (EuclideanSpace.single a.2 1))^2)*‖u.value s x‖^2) ≤ + 2*D^2*(∫ x,‖u.value s x‖^2) := by + rw [←integral_const_mul] + apply integral_mono_of_nonneg + · exact Eventually.of_forall fun x => mul_nonneg (Finset.sum_nonneg fun l _ => sq_nonneg _) (sq_nonneg _) + · exact ((u.value_L2 s).integrable_norm_pow (by norm_num)).const_mul _ + · exact Eventually.of_forall fun x => mul_le_mul_of_nonneg_right (by + calc + _ ≤ ∑ _l:Fin 2,D^2 := Finset.sum_le_sum (fun l _ => by + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hD).mpr (hd l a.2 (position x a.1))) + _=_ := by simp) (sq_nonneg _) + calc + _ ≤ (1/2:ℝ)*∑ s,∑ _a:Fin n × Fin 3,2*D^2*(∫ x,‖u.value s x‖^2) := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun s _ => Finset.sum_le_sum fun a _ => H s a) (by norm_num) + _=_ := by simp only [Finset.sum_const,Finset.card_univ,Fintype.card_prod,Fintype.card_fin,nsmul_eq_mul,Nat.cast_mul,Nat.cast_ofNat,←Finset.mul_sum,mass]; ring + +lemma binary_cut_sector_lower (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} (hn:0 1 then E else P)-(n:ℝ)*B)*mass (u.labelCut χ hc hp D hD hd p) ≤ + form (atom Z hZ) (u.labelCut χ hc hp D hD hd p) := by + obtain ⟨m,k,v,e,hmk,hcount,hm,hform,hobs,hanti,hcore,hout⟩ := + binary_cut_recorded_outcome (atom Z hZ) u ha χ hc hp D hD hd p univ {z | attraction (atom Z hZ) z ≤ B} + (by simp) (by intro z hz; by_contra hh; exact hz (hχ z hh)) + rw [←hm,←hform,form_eq_conditionalOutCost] + have hsector: ((if p=fun _ => 1 then E else P : ℝ):EReal) ≤ sectorFormBottom (atom Z hZ) k := by + by_cases h:p=fun _ => 1 + · have hm0:m=0 := by + have H:=hcount + rw [(outLabelCount_eq_zero_iff p).mpr h] at H + exact_mod_cast H.symm + have hk:k=n := by omega + simpa only [ite_eq_left h,hk] using hE + · have hm0:0 < m := by + by_contra hh + have H:m=0 := by omega + have H':outLabelCount p=0 := by simpa [H] using hcount + exact h ((outLabelCount_eq_zero_iff p).mp H') + have hk:k ≤ n-1 := by omega + simpa only [ite_eq_right h] using hP.trans (atom_sectorFormBottom_antitone Z hZ hk) + have H:=slice_core_form_ge_sector (atom Z hZ) v hanti hsector + have H':=conditionalOutCost_lower_attraction (atom Z hZ) v B hout + have hmn:(m:ℝ) ≤ n := by exact_mod_cast (show m ≤ n by omega) + have hmul:=mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hmn hB) (mass_nonneg v) + linarith + +lemma binary_cut_loss_bound (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} (hn:0 1))) ≤ + form (atom Z hZ) u-E*mass u+(3*(n:ℝ)*D^2+(n:ℝ)*B)*mass u := by + have H:=Finset.sum_le_sum (fun p (_:p∈(Finset.univ:Finset (Fin n → Fin 2))) => + binary_cut_sector_lower Z hZ hn u ha χ hc hp D hD hd B hB hχ E P hE hP p) + have H':=form_binary_cut_global (atom Z hZ) u χ hc hp D hD hd + have he(p:Fin n → Fin 2) : + ((if p=fun _ => 1 then E else P)-(n:ℝ)*B)*mass (u.labelCut χ hc hp D hD hd p)= + (P-(n:ℝ)*B)*mass (u.labelCut χ hc hp D hD hd p)+ + (if p=fun _ => 1 then (E-P)*mass (u.labelCut χ hc hp D hD hd (fun _ => 1)) else 0) := by + by_cases h:p=fun _ => 1 <;> simp only [h,ite_true,ite_false] <;> ring + simp_rw [he] at H + rw [Finset.sum_add_distrib,←Finset.mul_sum,mass_labelCut] at H + simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] at H + linarith + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/FiniteInverseEvent.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/FiniteInverseEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8a026afc5c2e30a1d16e58700b65313891227f3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/FiniteInverseEvent.lean @@ -0,0 +1,64 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchResponse + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +theorem finite_inverse_mesh_event {Ω : Type*} [m₀ : MeasurableSpace Ω] + (m : MeasurableSpace Ω) (hm : m ≤ m₀) + (P : @Measure Ω m₀) [IsFiniteMeasure P] (t : Finset Position) (heights : Finset ℝ) + (cnt : Ω → ℝ) (d u : Ω → Position → ℝ) {K η p : ℝ} + (hc : Measurable[m] cnt) (hd : ∀ y,Measurable[m] (fun a => d a y)) + (hu : ∀ y,Measurable[m] (fun a => u a y)) + (hp : ∀ y∈t,∀ h∈heights, + P.real {a | cnt a ≤ K ∧ Coulomb.tfScalarDensity h ≤ d a y ∧ u a y ≤ h-η} ≤ p ∧ + P.real {a | cnt a ≤ K ∧ d a y ≤ Coulomb.tfScalarDensity h ∧ h+η ≤ u a y} ≤ p) : + ∃ G : Set Ω,(MeasurableSet[m₀] G ∧ MeasurableSet[m] G) ∧ + P.real Gᶜ ≤ 2*(t.card:ℝ)*(heights.card:ℝ)*p ∧ + ∀ a∈G,cnt a ≤ K → ∀ y∈t,∀ h∈heights, + (Coulomb.tfScalarDensity h ≤ d a y → h-η < u a y) ∧ + (d a y ≤ Coulomb.tfScalarDensity h → u a y < h+η) := by + let B := fun q : Position × ℝ => + {a | cnt a ≤ K ∧ Coulomb.tfScalarDensity q.2 ≤ d a q.1 ∧ u a q.1 ≤ q.2-η} ∪ + {a | cnt a ≤ K ∧ d a q.1 ≤ Coulomb.tfScalarDensity q.2 ∧ q.2+η ≤ u a q.1} + let s := t.product heights + have hBm (q : Position × ℝ) : MeasurableSet[m] (B q) := by + exact ((measurableSet_le hc measurable_const).inter + ((measurableSet_le measurable_const (hd q.1)).inter (measurableSet_le (hu q.1) measurable_const))).union + ((measurableSet_le hc measurable_const).inter + ((measurableSet_le (hd q.1) measurable_const).inter (measurableSet_le measurable_const (hu q.1)))) + let E := ⋃ q∈s,B q + have hEm : MeasurableSet[m] E := MeasurableSet.biUnion (s.finite_toSet.countable) (fun q _ => hBm q) + refine ⟨Eᶜ,⟨hm _ hEm.compl,hEm.compl⟩,?_,?_⟩ + · rw [compl_compl] + calc + P.real E ≤ ∑ q∈s,P.real (B q) := measureReal_biUnion_finset_le _ _ + _ ≤ ∑ q∈s,(2*p) := by + apply Finset.sum_le_sum + intro q hq + obtain ⟨hq0,hq1⟩ := Finset.mem_product.mp hq + have H := hp q.1 hq0 q.2 hq1 + exact (measureReal_union_le _ _).trans (by linarith) + _ = 2*(t.card:ℝ)*(heights.card:ℝ)*p := by simp [s]; ring + · intro a ha hcnt y hy h hh + have hnot : a∉B (y,h) := by + intro hab + exact ha (mem_iUnion.mpr ⟨(y,h),mem_iUnion.mpr ⟨Finset.mem_product.mpr ⟨hy,hh⟩,hab⟩⟩) + constructor + · intro hden + by_contra H + exact hnot (Or.inl ⟨hcnt,hden,le_of_not_gt H⟩) + · intro hden + by_contra H + exact hnot (Or.inr ⟨hcnt,hden,le_of_not_gt H⟩) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/InnerFieldRMS.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/InnerFieldRMS.lean new file mode 100644 index 0000000000000000000000000000000000000000..26f85d6064f4c779e3c59aba30c98ee45ce9c669 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/InnerFieldRMS.lean @@ -0,0 +1,121 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalRMS +import OAI.Analysis.CoulombRadii.Packets.AnnularAddback + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +namespace RecordedEnsemble +variable {n : ℕ} + +lemma Conserves.positive_addback_RMS {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) (W V A : Configuration n → ℝ) + (hW : Measurable W) (hV : Measurable V) (hA : Measurable A) + {BW BV BA : ℝ} (hBW : 0≤ BW) (hBV : 0≤ BV) (hBA : 0≤ BA) + (hwb : ∀ x, |W x|≤ BW) (hvb : ∀ x, |V x|≤ BV) (hab : ∀ x, |A x|≤ BA) + (ha0 : ∀ x, 0≤ A x) (hwa : ∀ x, W x≤ V x+A x) : + T.dataRMS (fun p s x => max (coreConditionalObservable (T.vector p) + (W ∘ reindexConfiguration (T.labels p)) s x) 0) ≤ + 2*(T.dataRMS (fun p s x => max (coreConditionalObservable (T.vector p) + (V ∘ reindexConfiguration (T.labels p)) s x) 0)+rawRMS ψ A) := by + let F p := coreConditionalObservable (T.vector p) (W ∘ reindexConfiguration (T.labels p)) + let G p := coreConditionalObservable (T.vector p) (V ∘ reindexConfiguration (T.labels p)) + let H p := coreConditionalObservable (T.vector p) (A ∘ reindexConfiguration (T.labels p)) + have hsum (x) : |V x+A x|≤ BV+BA := (abs_add_le _ _).trans (add_le_add (hvb x) (hab x)) + have hh p s x : 0≤ H p s x := coreConditionalObservable_nonneg _ _ (fun _ => ha0 _) s x + have hfg p s x : max (F p s x) 0≤ max (G p s x) 0+H p s x := by + have he := coreConditionalObservable_add (T.vector p) + (V ∘ reindexConfiguration (T.labels p)) (A ∘ reindexConfiguration (T.labels p)) + (hV.comp (reindexConfiguration_continuous (T.labels p)).measurable) + (hA.comp (reindexConfiguration_continuous (T.labels p)).measurable) (fun _ => hvb _) (fun _ => hab _) s x + have hm := coreConditionalObservable_mono (T.vector p) + (W ∘ reindexConfiguration (T.labels p)) (fun x => (V ∘ reindexConfiguration (T.labels p)) x+(A ∘ reindexConfiguration (T.labels p)) x) + (hW.comp (reindexConfiguration_continuous (T.labels p)).measurable) + ((hV.add hA).comp (reindexConfiguration_continuous (T.labels p)).measurable) + (fun _ => hwb _) (fun _ => hsum _) (fun _ => hwa _) s x + rw [he] at hm + exact max_le (hm.trans (add_le_add (le_max_left _ _) le_rfl)) + (add_nonneg (le_max_right _ _) (hh p s x)) + have hiG p s := coreConditionalObservable_positive_weight_integrable (T.vector p) + (V ∘ reindexConfiguration (T.labels p)) + (hV.comp (reindexConfiguration_continuous (T.labels p)).measurable) hBV (fun _ => hvb _) s 2 + have hiH p s := coreConditionalObservable_square_weight_integrable (T.vector p) + (A ∘ reindexConfiguration (T.labels p)) + (hA.comp (reindexConfiguration_continuous (T.labels p)).measurable) hBA (fun _ => hab _) s + have hsq : (T.dataRMS (fun p s x => max (F p s x) 0))^2 ≤ + 2*(T.dataRMS (fun p s x => max (G p s x) 0))^2+2*(T.dataRMS H)^2 := by + simp only [dataRMS_sq,sliceExpectation] + rw [Finset.mul_sum,Finset.mul_sum,←Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro p hp + rw [Finset.mul_sum,Finset.mul_sum,←Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro s hs + rw [←integral_const_mul,←integral_const_mul,←integral_add ((hiG p s).const_mul 2) ((hiH p s).const_mul 2)] + apply integral_mono_ae + · exact coreConditionalObservable_positive_weight_integrable (T.vector p) + (W ∘ reindexConfiguration (T.labels p)) + (hW.comp (reindexConfiguration_continuous (T.labels p)).measurable) hBW (fun _ => hwb _) s 2 + · exact ((hiG p s).const_mul 2).add ((hiH p s).const_mul 2) + · filter_upwards [] with x + have Hsq : (max (F p s x) 0)^2≤2*(max (G p s x) 0)^2+2*(H p s x)^2 := by + have H1 := pow_le_pow_left₀ (le_max_right (F p s x) 0) (hfg p s x) 2 + nlinarith [sq_nonneg (max (G p s x) 0-H p s x)] + have H2 := mul_le_mul_of_nonneg_left Hsq (mass_nonneg ((T.vector p).coreSlice s x)) + nlinarith + have hH := hT.dataRMS_conditional_le A hA hBA hab + have hmG := T.dataRMS_nonneg (fun p s x => max (G p s x) 0) + have hmH := T.dataRMS_nonneg H + have hR := rawRMS_nonneg ψ A + change T.dataRMS (fun p s x => max (F p s x) 0) ≤ + 2*(T.dataRMS (fun p s x => max (G p s x) 0)+rawRMS ψ A) + change T.dataRMS H ≤ rawRMS ψ A at hH + nlinarith [T.dataRMS_nonneg (fun p s x => max (F p s x) 0)] + +def innerSquare {J : ℕ} (T : RecordedEnsemble n) (S : Nuclei J) (h : ℝ) (y : Space) : ℝ := + ∑ p, sliceExpectation (T.vector p) (fun s x => + (max (coreConditionalObservable (T.vector p) + (rawSignedField (attraction S y) (Metric.ball 0 h) y) s x) 0)^2) +lemma innerSquare_nonneg {J : ℕ} (T : RecordedEnsemble n) (S : Nuclei J) (h : ℝ) (y : Space) : + 0≤ T.innerSquare S h y := Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => + integral_nonneg (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + +lemma Conserves.innerSquare_addback {J : ℕ} {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) (S : Nuclei J) {u h : ℝ} (hu : 0 annularAddbackKernel_nonneg hu h _))] + calc + _ ≤ ∑ _i : Fin n, 5001/u := Finset.sum_le_sum (fun _ _ => annularAddbackKernel_bound hu h _) + _ = _ := by simp + have hb := rawSignedField_abs_le (n:=n) (attraction S y) _ y ha (fun _ hz => innerBall_subset_far hu hh hylo hz) + have hj := rawSignedField_abs_le (n:=n) (attraction S y) _ y ha (fun _ hz => hz) + have H := hT.positive_addback_RMS + (rawSignedField (attraction S y) (Metric.ball 0 h) y) + (rawSignedField (attraction S y) {z : Space | 40*atomicCellScale y≤‖z-y‖} y) + (arrayStatistic (annularAddbackKernel h u)) + (rawSignedField_measurable _ measurableSet_ball y) (rawSignedField_measurable _ hA y) + (arrayStatistic_measurable (annularAddbackKernel_measurable h u)) hb0 hb0 (by positivity) + hb hj hb1 (fun _ => Finset.sum_nonneg (fun _ _ => annularAddbackKernel_nonneg hu h _)) + (rawInnerField_addback hu hh _ hylo hyhi) + simpa only [dataRMS,innerSquare,rawSquare,Function.comp_def,rawSignedField_reindex] using H + +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/InverseEventContradiction.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/InverseEventContradiction.lean new file mode 100644 index 0000000000000000000000000000000000000000..0fd7aeab21114f7310174ca1da0cccd77c1e1097 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/InverseEventContradiction.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PhysicalRetainedMean + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma inverse_high_mean_contradiction {η h hh B γ κ N a v mean : ℝ} + (hη : 0 < η) (hηh : η < h) (hhh : h ≤ hh) (hB : 0 ≤ B) (hγ : 0 < γ) + (hκ : 0 < κ) (hN : 0 ≤ N) (ha : 0 < a) (hv : κ*a^(1+packetExponent) ≤ v) + (herr : inverseHighMeanError hh B γ κ N a v < η/4) + (hmean : (h-η)/a^4-(((h-η)/a^4)/a^(-699/100:ℝ)+2*(B/v^3)/(γ/a^6))* + (2*a^(-349/50:ℝ))-2*(N*(2*v/a))*(a^4)⁻¹-(η/4)*a^(-4:ℝ) ≤ mean) + (hbad : mean ≤ (h-2*η)/a^4) : False := by + have he := inverseHighMeanError_bound (hη.le.trans ((hηh.le).trans hhh)) hB hγ hκ hN + ha hv (show 0 ≤ (h-η)/a^4 by positivity) + (show (h-η)/a^4 ≤ hh/a^4 by gcongr; linarith) (le_refl (2*a^(-349/50:ℝ))) + have he' := he.trans_lt herr + have hpow : a^(-4:ℝ)=(a^4)⁻¹ := by rw [Real.rpow_neg ha.le]; norm_num + rw [hpow] at hmean + have HH := mul_le_mul_of_nonneg_right (hmean.trans hbad) (pow_nonneg ha.le 4) + have h4 : a^4≠0 := pow_ne_zero _ ha.ne' + simp only [sub_mul,div_mul_cancel₀ _ h4,mul_assoc,inv_mul_cancel₀ h4,mul_one] at HH + simp only [add_mul,mul_assoc,inv_mul_cancel₀ h4,mul_one] at he' + nlinarith only [HH,he',hη] + +lemma inverse_low_mean_contradiction {η h H a mean : ℝ} (hη : 0 < η) (ha : 0 < a) + (herr : 2*H*a^(1/100:ℝ) < η/4) + (hmean : mean ≤ (h+η)/a^4+((H/a^4)/a^(-699/100:ℝ))*(2*a^(-349/50:ℝ))+ + (η/4)*a^(-4:ℝ)) (hbad : (h+2*η)/a^4 ≤ mean) : False := by + have HH := mul_le_mul_of_nonneg_right (hbad.trans hmean) (pow_nonneg ha.le 4) + have hpow : a^(-4:ℝ)=(a^4)⁻¹ := by rw [Real.rpow_neg ha.le]; norm_num + rw [hpow] at HH + have he := inverse_low_mean_scaled (H:=H) ha + have h4 : a^4≠0 := pow_ne_zero _ ha.ne' + simp only [add_mul,div_mul_cancel₀ _ h4,mul_assoc,inv_mul_cancel₀ h4,mul_one] at HH + nlinarith only [HH,he,herr,hη] + +theorem physical_retained_inverse_event (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z, 1 < ‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) + (hrad : ∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) + {D c A κ Λ M V K₀ hl hh η : ℝ} + (hD : 0 ≤ D) (hc : 0 < c) (hA : 0 < A) (hκ : 0 < κ) (hΛ : 0 ≤ Λ) + (hM : 0 ≤ M) (hV : 0 ≤ V) (hK₀ : 0 ≤ K₀) (hη : 0 < η) (hηl : η < hl) (hlh : hl ≤ hh) : + ∃ s₀ : ℝ, 0 < s₀ ∧ s₀ ≤ 1 ∧ + ∀ {N J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction (N+1)} {g : Gradient (N+1)}, + ∀ (hd : FormDomain ψ g) (hn : normSquared ψ=1), + (∀ (χ : Wavefunction (N+1)) (h : Gradient (N+1)), FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) → + ∀ {E : ℝ}, (E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D → ∀ {r₀ s : ℝ}, 0 < r₀ → 0 < s → s < s₀ → + c*(1+packetExponent)*s^packetExponent ≤ 1/4 → + ∀ (j : ℕ), r₀*2^j ≤ s → ∀ (k : RetainedScales J j) (y : Position) (_ : y≠0), + r₀ ≤ ‖y‖ → Coulomb.atomicCellScale y ≤ A*(r₀*2^j) → + letI := rawLaw_isProbability hd.2.2.1 hn + let a := Coulomb.atomicCellScale y + let w := packetWidth c r₀ s y + let ell := (r₀*2^k.val.val)^(101/100:ℝ) + let m := M*a^(-3:ℝ) + let e₀ := K₀/w^4*(Real.sqrt 3*ell)*m + let field := fun z : ObservationSample (N+1) J => (Z:ℝ)*coulombKernel y- + potentialOf (conditionalPacketDensity (observationLaw J (rawLaw ψ)) Prod.fst + (tailObservation (fun l : Fin J => r₀*2^l.val) j) g₀ c r₀ s + (tailObservation (fun l : Fin J => r₀*2^l.val) j z)) y + κ*a^(1+packetExponent) ≤ w → w/a ≤ V*s^packetExponent → + ell ≤ Λ*a^(101/100:ℝ) → ∀ {h : ℝ}, h∈Icc hl hh → + ∀ {B : Set (Fin J → UnorderedArray (N+1))}, MeasurableSet B → + (∀ z∈retainedTailObservation j ⁻¹' B, + rawCount (Metric.closedBall y (2*w+2*a^(6/5:ℝ)+2*(Real.sqrt 3*ell))) + (observationArrayPositions k z) ≤ m) → + ((∀ z∈retainedTailObservation j ⁻¹' B, + Coulomb.tfScalarDensity h/a^6-e₀ ≤ ∑ i,packetKernel g₀ c r₀ s (observationArrayPositions k z i) y) ∧ + (∀ᵐ z ∂observationLaw J (rawLaw ψ), + z∈tailObservation (fun l : Fin J => r₀*2^l.val) j ⁻¹' B → field z ≤ (h-2*η)/a^4) ∨ + (∀ z∈retainedTailObservation j ⁻¹' B, + (∑ i,packetKernel g₀ c r₀ s (observationArrayPositions k z i) y) ≤ Coulomb.tfScalarDensity h/a^6+e₀) ∧ + (∀ᵐ z ∂observationLaw J (rawLaw ψ), + z∈tailObservation (fun l : Fin J => r₀*2^l.val) j ⁻¹' B → (h+2*η)/a^4 ≤ field z)) → + (observationLaw J (rawLaw ψ)).real + (tailObservation (fun l : Fin J => r₀*2^l.val) j ⁻¹' B) < (r₀*2^j)^42 := by + obtain ⟨C,D₁,E₁,F,K,N₁,B₀,hC,hD₁,hE₁,hF,hK,hN₁,hB₀,Hmean⟩ := + physical_retained_inverse_means g₀ hg hm hrad + obtain ⟨s₁,hs₁,hs₁1,Hs₁⟩ := Hmean hD hc hA (show 0 < η/4 by positivity) + obtain ⟨s₂,hs₂,Hs₂⟩ := inverse_errors_uniform (H:=Coulomb.tfInteriorConstant Coulomb.thomasFermiKineticConstant) + hD₁.le hF.le hK.le hK₀ hB₀.le hκ hΛ hM hA hV hC.le hE₁.le hc.le hN₁.le hη hηl hlh + obtain ⟨Kcap,hKcap,Hcap⟩ := master_kernel_estimates g₀ hg hm + refine ⟨min s₁ s₂,lt_min hs₁ hs₂,(min_le_left _ _).trans hs₁1,?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE hbase r₀ s hr₀ hs hss hscale j hrj k y hy hry hya + dsimp only + intro hw hwa hell h hh' B hB hcount hbad + by_contra hp + have hp' := le_of_not_gt hp + have ha := Coulomb.atomicCellScale_pos hy + let a := Coulomb.atomicCellScale y + let w := packetWidth c r₀ s y + let ell := (r₀*2^k.val.val)^(101/100:ℝ) + let m := M*a^(-3:ℝ) + let e₀ := K₀/w^4*(Real.sqrt 3*ell)*m + have hhη : η < h := hηl.trans_le hh'.1 + have hs1 := hss.trans_le (min_le_left _ _) + have hs2 := hss.trans_le (min_le_right _ _) + have has : a ≤ A*s := hya.trans (mul_le_mul_of_nonneg_left hrj hA.le) + have hm0 : 0 ≤ m := by dsimp [m]; positivity + have he0 : 0 ≤ ell := by dsimp [ell]; positivity + have Hnum := Hs₂ hs hs2 ha has hw hwa he0 hell hm0 (le_refl m) hh' + obtain ⟨hthin,hww,hθ,hNw,hP,hhi,hlo,hErr,hErr'⟩ := Hnum + have hl0 : 0 ≤ (h-η)/a^4 := div_nonneg (sub_nonneg.mpr hhη.le) (pow_nonneg ha.le _) + have hh0 : 0 < h := hη.trans hhη + have hu0 : 0 ≤ (h+η)/a^4 := by positivity + have hq : 0 < a^(-699/100:ℝ) := Real.rpow_pos_of_pos ha _ + have := rawLaw_isProbability hd.2.2.1 hn + have hgs : HasCompactSupport (g₀ : Position → ℝ) := by + apply HasCompactSupport.intro (K:=Metric.closedBall 0 1) (isCompact_closedBall _ _) + intro z hz + exact hg z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz) + have hf := (integrable_const ((Z:ℝ)*coulombKernel y)).sub + (conditionalPacketPotential_integrable (observationLaw J (rawLaw ψ)) (rawLaw ψ) + (observationLaw_rawProjection _) (measurable_tailObservation (fun l : Fin J =>r₀*2^l.val) j) + g₀.continuous hgs hm hc hr₀ hs y) + have hp0 : 0 < (observationLaw J (rawLaw ψ)).real + (tailObservation (fun l : Fin J =>r₀*2^l.val) j ⁻¹' B) := + (pow_pos (show 0 < r₀*2^j by positivity) 42).trans_le hp' + have hγ : 0 < Coulomb.tfScalarDensity hl/2 := by + have H := Coulomb.tfScalarDensity_strict (show (0:ℝ) ≤ 0 by rfl) (hη.trans hηl) + have : 0 < Coulomb.tfScalarDensity hl := by simpa [Coulomb.tfScalarDensity] using H + positivity + have htfl : 0 < Coulomb.tfScalarDensity hl := by linarith only [hγ] + rcases hbad with ⟨hgate,hbad⟩ | ⟨hgate,hbad⟩ + · have hupper (z) (_hz : z∈retainedTailObservation j ⁻¹' B) : + (∑ i,packetKernel g₀ c r₀ s (observationArrayPositions k z i) y) ≤ + (N+1:ℕ)*(Kcap/w^3) := by + calc + _ ≤ ∑ i : Fin (N+1), Kcap/w^3 := Finset.sum_le_sum (fun i _ => + (le_abs_self _).trans ((Hcap hc hr₀ hs hscale y).2.1 _)) + _ = _ := by simp + have Hmeans := Hs₁ Z hZ hd hn hmin hE hbase hr₀ hs hs1 hscale j hrj hB hp' k y hy hry hya + hthin hww hgate hupper hcount hl0 hu0 hq hθ + have H := Hmeans.1 (P:=Coulomb.tfScalarDensity hl/(2*a^6)) (by positivity) + hNw hP hhi + have Hb := normalized_event_le (hB.preimage (measurable_tailObservation _ j)) hf hp0 hbad + have HP : Coulomb.tfScalarDensity hl/(2*a^6)=(Coulomb.tfScalarDensity hl/2)/a^6 := by ring + rw [HP] at H + exact inverse_high_mean_contradiction hη hhη hh'.2 hB₀.le hγ hκ hN₁.le ha hw hErr H Hb + · have hlower (z) (_hz : z∈retainedTailObservation j ⁻¹' B) : + 0 ≤ ∑ i,packetKernel g₀ c r₀ s (observationArrayPositions k z i) y := + Finset.sum_nonneg (fun i _ => packetKernel_nonneg g₀ hc hr₀ hs _ _) + have Hmeans := Hs₁ Z hZ hd hn hmin hE hbase hr₀ hs hs1 hscale j hrj hB hp' k y hy hry hya + hthin hww hlower hgate hcount hl0 hu0 hq hθ + have H := Hmeans.2 hlo + have Hb := le_normalized_event (hB.preimage (measurable_tailObservation _ j)) hf hp0 hbad + exact inverse_low_mean_contradiction hη ha hErr' H Hb +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/JointSlice.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/JointSlice.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8154392b7a8717fbab99783484b43fe0ebad333 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/JointSlice.lean @@ -0,0 +1,137 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.RawObservable + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma potentialForm_coreSlice_joint_aestronglyMeasurable {m k : ℕ} + (ψ : H1Vector (m+k)) (s : Spins m) + (W : (Configuration m × Space) × Configuration k → ℝ) (hW : Measurable W) : + AEStronglyMeasurable (fun z : Configuration m × Space => + potentialForm (fun v => W (z,v)) (ψ.coreSlice s z.1)) (volume.prod volume) := by + have hreg : ∀ᵐ z : Configuration m × Space ∂volume.prod volume, ψ.CoreSliceRegular s z.1 := + Measure.quasiMeasurePreserving_fst.ae (ψ.coreSliceRegular_ae s) + apply AEStronglyMeasurable.congr _ + (show (fun z : Configuration m × Space => ∑ t : Spins k, ∫ v, + W (z,v)*‖ψ.value (Fin.append s t) (joinConfiguration m k (z.1,v))‖^2) =ᵐ[volume.prod volume] + (fun z => potentialForm (fun v => W (z,v)) (ψ.coreSlice s z.1)) from ?_) + · apply Finset.aestronglyMeasurable_fun_sum + intro t ht + have hψ := ((ψ.value_L2 (Fin.append s t)).aestronglyMeasurable.comp_measurePreserving + (joinConfiguration_measurePreserving m k)).norm.pow 2 + have hp : MeasurePreserving (fun z : (Configuration m × Space) × Configuration k => + ((z.1.1,z.2),z.1.2)) ((volume.prod volume).prod volume) ((volume.prod volume).prod volume) := by + have h1 := measurePreserving_prodAssoc (volume : Measure (Configuration m)) + (volume : Measure Space) (volume : Measure (Configuration k)) + have h2 := (MeasurePreserving.id (volume : Measure (Configuration m))).prod + (Measure.measurePreserving_swap (μ := (volume : Measure Space)) (ν := (volume : Measure (Configuration k)))) + have h3 := (measurePreserving_prodAssoc (volume : Measure (Configuration m)) + (volume : Measure (Configuration k)) (volume : Measure Space)).symm MeasurableEquiv.prodAssoc + exact h3.comp (h2.comp h1) + have hl := (hψ.comp_fst (ν := (volume : Measure Space))).comp_measurePreserving hp + exact (hW.aestronglyMeasurable.mul hl).integral_prod_right' + · filter_upwards [hreg] with z hz + simp only [potentialForm, ψ.coreSlice_value s hz] + +lemma potentialForm_normalized_coreSlice_joint_aestronglyMeasurable {m k : ℕ} + (ψ : H1Vector (m+k)) (s : Spins m) + (W : (Configuration m × Space) × Configuration k → ℝ) (hW : Measurable W) : + AEStronglyMeasurable (fun z : Configuration m × Space => + potentialForm (fun v => W (z,v)) (ψ.coreSlice s z.1).normalized) (volume.prod volume) := by + simp only [potentialForm_normalized_eq] + exact ((mass_coreSlice_integrable ψ s).aestronglyMeasurable.comp_fst).inv₀.mul + (potentialForm_coreSlice_joint_aestronglyMeasurable ψ s W hW) + +lemma restrictedOutPotential_joint_measurable {m : ℕ} {A : Set Space} (hA : MeasurableSet A) : + Measurable (fun z : Configuration m × Space => restrictedOutPotential z.1 A z.2) := by + apply Finset.measurable_fun_sum + intro i hi + apply Measurable.ite (hA.preimage ((continuous_position i).measurable.comp measurable_fst)) _ measurable_const + simp only [coulombKernel] + exact (((continuous_position i).measurable.comp measurable_fst).sub measurable_snd).norm.inv + +lemma restrictedCorePotential_normalized_slice_joint {m k : ℕ} (u : H1Vector (m+k)) + (s : Spins m) {A : Set Space} (hA : MeasurableSet A) : + AEStronglyMeasurable (fun z : Configuration m × Space => + restrictedCorePotential (u.coreSlice s z.1).normalized A z.2) (volume.prod volume) := by + have hW : Measurable (fun z : (Configuration m × Space) × Configuration k => + restrictedOutPotential z.2 A z.1.2) := + (restrictedOutPotential_joint_measurable hA).comp (measurable_snd.prodMk measurable_fst.snd) + have H := potentialForm_normalized_coreSlice_joint_aestronglyMeasurable u s _ hW + simpa only [potentialForm_restrictedOutPotential _ hA] using H + +lemma recordedFarField_normalized_slice_joint {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) (s : Spins m) {A : Set Space} (hA : MeasurableSet A) : + AEStronglyMeasurable (fun z : Configuration m × Space => + recordedFarField S (u.coreSlice s z.1).normalized z.1 A z.2) (volume.prod volume) := by + exact ((attraction_measurable S).comp measurable_snd).aestronglyMeasurable.sub + (restrictedCorePotential_normalized_slice_joint u s hA) |>.sub + (restrictedOutPotential_joint_measurable hA).aestronglyMeasurable + +lemma farSquare_mass_ballCloud_integrable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) (s : Spins m) {A : Set Space} (hA : MeasurableSet A) + {a : ℝ} (ha : 0 < a) (y : Space) (hnuc : ∀ j, 2*a ≤ ‖S.position j-y‖) : + Integrable (fun z : Configuration m × Space => mass (u.coreSlice s z.1)* + (max (recordedFarField S (u.coreSlice s z.1).normalized z.1 A z.2) 0)^2* + ballCloud y a 1 z.2) (volume.prod volume) := by + let K := (totalCharge S/a)^2 + have hm := (mass_coreSlice_integrable u s).aestronglyMeasurable.comp_fst (ν := (volume : Measure Space)) + have hf := ((recordedFarField_normalized_slice_joint S u s hA).sup + (aestronglyMeasurable_const (b:=(0:ℝ)))).pow 2 + have hb : Measurable (fun z : Configuration m × Space => ballCloud y a 1 z.2) := + (ballCloud_measurable a 1 y).comp measurable_snd + apply (((mass_coreSlice_integrable u s).mul_prod (ballCloud_integrable a 1 y)).const_mul K).mono' + ((hm.mul hf).mul hb.aestronglyMeasurable) + filter_upwards [] with z + change ‖mass (u.coreSlice s z.1)* + (max (recordedFarField S (u.coreSlice s z.1).normalized z.1 A z.2) 0)^2*ballCloud y a 1 z.2‖ ≤ _ + have hball : 0 ≤ ballCloud y a 1 z.2 := uniformBall_nonneg ha zero_le_one (z.2-y) + rw [Real.norm_of_nonneg (mul_nonneg (mul_nonneg (mass_nonneg _) (sq_nonneg _)) hball)] + by_cases hz : z.2-y ∈ Metric.ball (0:Space) a + · have hdist : ‖z.2-y‖ < a := by simpa only [Metric.mem_ball,dist_zero_right] using hz + have hsep (j : Fin J) : a ≤ ‖z.2-S.position j‖ := by + have ht : ‖S.position j-y‖ ≤ ‖S.position j-z.2‖+‖z.2-y‖ := by + simpa only [dist_eq_norm] using dist_triangle (S.position j) z.2 y + rw [norm_sub_rev (S.position j) z.2] at ht + linarith [hnuc j] + have hP : max (recordedFarField S (u.coreSlice s z.1).normalized z.1 A z.2) 0 ≤ totalCharge S/a := + (max_le (recordedFarField_le_attraction S _ _ A z.2) (attraction_nonneg S z.2)).trans + (attraction_le_totalCharge_div S ha z.2 hsep) + have H := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (le_max_right _ _) hP 2) (mass_nonneg (u.coreSlice s z.1))) hball + dsimp [K] + nlinarith + · simp only [ballCloud,uniformBall,indicator_of_notMem hz,mul_zero,le_refl] + +theorem sliceExpectation_farSquare_ballCloud {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {A : Set Space} (hA : MeasurableSet A) + {a : ℝ} (ha : 0 < a) (y : Space) (hnuc : ∀ j, 2*a ≤ ‖S.position j-y‖) : + sliceExpectation u (fun s x => ∫ v, + (max (recordedFarField S (u.coreSlice s x).normalized x A v) 0)^2*ballCloud y a 1 v) = + ∫ v, (sliceExpectation u (fun s x => + (max (recordedFarField S (u.coreSlice s x).normalized x A v) 0)^2))*ballCloud y a 1 v := by + unfold sliceExpectation + simp only [←integral_const_mul,Finset.sum_mul,←integral_mul_const] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro s hs + have H := integral_integral_swap (f := fun x v => mass (u.coreSlice s x)* + (max (recordedFarField S (u.coreSlice s x).normalized x A v) 0)^2*ballCloud y a 1 v) + (farSquare_mass_ballCloud_integrable S u s hA ha y hnuc) + simpa only [mul_assoc] using H + · intro s hs + exact (farSquare_mass_ballCloud_integrable S u s hA ha y hnuc).integral_prod_right + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/LocalizedEnsemble.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/LocalizedEnsemble.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e35b46b82736fc592c002a0c4da216d0067db46 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/LocalizedEnsemble.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalPositiveField +import OAI.Analysis.CoulombRadii.FormDomain.SortedCut +import OAI.Analysis.CoulombRadii.Localization.RadialCut + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def conditionalOutCost {J m k : ℕ} (S : Nuclei J) (ψ : H1Vector (m+k)) : ℝ := + outerKinetic ψ+sliceExpectation ψ (fun s x => pairPotential x- + ∑ i : Fin m, coreScreenedField S (ψ.coreSlice s x).normalized (position x i)) + +lemma conditionalOutCost_weight_integrable {J m k : ℕ} (S : Nuclei J) + (ψ : H1Vector (m+k)) (s : Spins m) : + Integrable (fun x => mass (ψ.coreSlice s x)*(pairPotential x- + ∑ i : Fin m, coreScreenedField S (ψ.coreSlice s x).normalized (position x i))) := by + apply ((conditionalEnergy_weight_integrable S ψ s).sub + (normalized_coreForm_weight_integrable S ψ s)).congr + exact Eventually.of_forall (fun x => by + simp only [Pi.sub_apply,conditionalEnergy_eq_screened] + ring) + +lemma form_eq_conditionalOutCost {J m k : ℕ} (S : Nuclei J) (ψ : H1Vector (m+k)) : + form S ψ = sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized)+conditionalOutCost S ψ := by + rw [conditional_energy_identity] + change outerKinetic ψ+sliceExpectation ψ (conditionalEnergy S ψ)=_ + have H : sliceExpectation ψ (conditionalEnergy S ψ) = + sliceExpectation ψ (fun s x => form S (ψ.coreSlice s x).normalized)+ + sliceExpectation ψ (fun s x => pairPotential x- + ∑ i : Fin m, coreScreenedField S (ψ.coreSlice s x).normalized (position x i)) := by + rw [← sliceExpectation_add ψ _ _ (normalized_coreForm_weight_integrable S ψ) + (conditionalOutCost_weight_integrable S ψ)] + congr 1 + funext s x + rw [conditionalEnergy_eq_screened] + ring + rw [H] + unfold conditionalOutCost + ring + +theorem radial_conditional_gain_ensemble {J n : ℕ} (S : Nuclei J) + (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hmass : mass ψ=1) + {a E δ : ℝ} (ha : 0 < a) (y : Space) (hnuc : ∀ j, 3*a ≤ ‖S.position j-y‖) + (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) : + ∃ (m k : (Fin n → Fin 2) → ℕ) (u : (p : Fin n → Fin 2) → H1Vector (m p+k p)), + (∀ p, m p+k p=n) ∧ (∑ p, mass (u p))=1 ∧ + (∀ p s, ∀ᵐ x, Antisymmetric ((u p).coreSlice s x)) ∧ + (∀ p s, ∀ᵐ x, SpatiallySupported ((u p).coreSlice s x).normalized {z | 3*a ≤ ‖z-y‖}) ∧ + a/(16*ballTrialCoefficient)*(∑ p, sliceExpectation (u p) (fun s x => + (max (coreScreenedField S ((u p).coreSlice s x).normalized y) 0)^2)) ≤ + δ+3*(radialCutCoefficient/(3*a))^2*expectedPopulation ψ (Metric.closedBall y (6*a))+ + 4*ballTrialCoefficient*(screenBaseMass a)^2/a-∑ p, conditionalOutCost S (u p) := by + have hr : 0 < 3*a := by positivity + let χ := radialCut y (3*a) + have hc : ∀ z ∉ {z | 3*a ≤ ‖z-y‖}, χ 1 z=0 := by + intro z hz + apply radialCut_core_zero y hr z + exact (lt_of_not_ge hz).le + have H (p : Fin n → Fin 2) := binary_cut_core_outcome S ψ hψ χ (radialCut_smooth y (3*a)) + (radialCut_partition y (3*a)) (radialCutCoefficient/(3*a)) + (div_nonneg radialCutCoefficient_pos.le hr.le) (radialCut_derivative_bound y hr) p _ hc + choose m k u hn hm hf hanti hs using H + have hsum : (∑ p, mass (u p))=1 := by + simp_rw [hm] + rw [mass_labelCut,hmass] + have hsupport (p) (s : Spins (m p)) : + ∀ᵐ x, SpatiallySupported ((u p).coreSlice s x).normalized {z | 3*a ≤ ‖z-y‖} := by + filter_upwards [hs p s] with x hx + exact hx.normalized + have hclosed : IsClosed {z : Space | 3*a ≤ ‖z-y‖} := isClosed_le continuous_const (by fun_prop) + have HG (p : Fin n → Fin 2) : + a/(16*ballTrialCoefficient)*sliceExpectation (u p) (fun s x => + (max (coreScreenedField S ((u p).coreSlice s x).normalized y) 0)^2) ≤ + form S (u p)-conditionalOutCost S (u p)-E*mass (u p)+ + (4*ballTrialCoefficient*(screenBaseMass a)^2/a)*mass (u p) := by + have H := conditional_positive_field_gain S (u p) (hanti p) ha y _ hclosed + (hsupport p) (fun _ h => h) hnuc hE + rw [form_eq_conditionalOutCost S (u p)] + linarith + have HI : (∑ p, form S (u p)) ≤ E+δ+ + 3*(radialCutCoefficient/(3*a))^2*expectedPopulation ψ (Metric.closedBall y (6*a)) := by + simp_rw [hf] + have H := form_radial_labelCut S ψ y hr + dsimp [χ] + have he : 2*(3*a)=6*a := by ring + rw [he] at H + exact H.trans (add_le_add hstate le_rfl) + have HH := Finset.sum_le_sum (fun p (_ : p ∈ Finset.univ) => HG p) + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,← Finset.mul_sum,hsum,mul_one] at HH + refine ⟨m,k,u,hn,hsum,hanti,hsupport,?_⟩ + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationAnnulusTail.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationAnnulusTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..32317ad72f747a50a28eb1d6a16f056230cd6259 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationAnnulusTail.lean @@ -0,0 +1,159 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationSmallScale +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalLikelihoodBridge + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +theorem atomic_observed_small_annular_count_tail {α A B β : ℝ} + (hα : 0<α) (hαA : α r^(101/100:ℝ)) + {y | K/r^3] 0, r<1 ∧ singleObservationOffset D₀ r*r^7 ≤ 1 ∧ + Real.sqrt 3*r^(101/100:ℝ)/r] 0, r<1 := + (eventually_lt_nhds (by norm_num : (0:ℝ)<1)).filter_mono nhdsWithin_le_nhds + filter_upwards [hr,hm,ha,hb] with r hr hm ha hb + exact ⟨hr,hm.le,ha,hb⟩ + obtain ⟨s,hs,hsub⟩ := (mem_nhdsGT_iff_exists_Ioo_subset).mp hevent + refine ⟨s,hs,?_⟩ + intro n Z hZ ψ g hd hn hmin E hE hbase r hr hrs + obtain ⟨hr1,hm,ha,hb⟩ := hsub ⟨hr,hrs⟩ + have hδ : 0 ≤ singleObservationOffset D₀ r := by + unfold singleObservationOffset + have hl : Real.log (r^40) ≤ 0 := Real.log_nonpos (by positivity) (pow_le_one₀ hr.le hr1.le) + exact add_nonneg hD (mul_nonneg (mul_nonneg observationEventEnergyConstant_pos.le + (sq_nonneg _)) (pow_nonneg (by linarith) _)) + have hmass := screenMass_small_offset hr hr1.le hδ hm + have hcoeff : 4*C r^(101/100:ℝ))=((r^(101/100:ℝ))⁻¹)^2 := by + simp [observationWidthSquareSum] + have ht' : C*(Coulomb.screenMass (D₀+observationEventEnergyConstant* + observationWidthSquareSum (fun _ : Fin 1 => r^(101/100:ℝ))*(1-Real.log (r^40))^5) r)^2<(K/r^3)^2 := by + simpa only [hsum,singleObservationOffset] using hth + exact hbound Z hZ hd hn hmin hE hbase hD _ + (fun _ => Real.rpow_pos_of_pos hr _) (0:Fin 1) hr (by positivity) (by positivity) ha' hb' ht' +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom + +def observationSingleScale {n J : ℕ} (k : Fin J) + (sample : ObservationSample n J) : ObservationSample n 1 := + (sample.1, fun _ => sample.2 k) + +lemma observationSingleScale_preserving {n J : ℕ} + (ν : Measure (Configuration n)) [SFinite ν] (k : Fin J) : + MeasurePreserving (observationSingleScale k) (observationLaw J ν) (observationLaw 1 ν) := by + have hn : MeasurePreserving (fun u : ObservationNoise n J => fun _ : Fin 1 => u k) + (allObservationNoiseLaw n J) (allObservationNoiseLaw n 1) := + (measurePreserving_funUnique + (Measure.pi (fun _ : Fin n => Measure.pi (fun _ : Fin 3 => observationNoiseLaw))) + (Fin 1)).symm.comp (measurePreserving_eval _ k) + exact (MeasurePreserving.id ν).prod hn + +lemma physical_arrayEvent_probability {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (ℓ : Fin J → ℝ) (hℓ : ∀ k, ℓ k≠0) + {B : Set ((Fin J × (Fin n × Fin 3)) → ℝ)} (hB : MeasurableSet B) : + (observationLaw J (rawLaw ψ)).real (observationCoordinateData ℓ ⁻¹' B)= + stateWeightedIntegral ψ (arrayEventLikelihood ℓ B) := by + have H := physical_arrayEvent_bayes_integral hψ hn ℓ hℓ hB + (measurable_const : Measurable (fun _ : Configuration n => (1:ℝ))) + (C:=1) (fun _ => by simp) + simpa only [integral_indicator_const _ (hB.preimage (measurable_observationCoordinateData ℓ)), + smul_eq_mul,mul_one] using H + +theorem physical_observed_small_annular_count_tail {α A B β : ℝ} + (hα : 0<α) (hαA : α (r k)^(101/100:ℝ)) (fun _ => (Real.rpow_pos_of_pos hr _).ne') hS + have hpre : observationSingleScale k ⁻¹' + (observationCoordinateData (fun _ : Fin 1 => (r k)^(101/100:ℝ)) ⁻¹' S)= + {sample | K/(r k)^3 (r k)^(101/100:ℝ)) + (observationSingleScale k sample))=observedOrdered r k sample := by + funext i + ext a + simp [observationArrayPositions,observationCoordinateData,observationSingleScale, + observedOrdered,observationNoiseVector_coordinate] + simp only [mem_preimage,S,mem_ofPred_eq,he] + rw [←hpre] + have he := (observationSingleScale_preserving (rawLaw ψ) k).measure_preimage + (hS.preimage (measurable_observationCoordinateData + (fun _ : Fin 1 => (r k)^(101/100:ℝ)))).nullMeasurableSet + unfold Measure.real + rw [he] + change (observationLaw 1 (rawLaw ψ)).real _≤_ + rw [hp] + exact Hs Z hZ hd hn hmin hE hbase hr hrs +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationDyadicWidth.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationDyadicWidth.lean new file mode 100644 index 0000000000000000000000000000000000000000..994958333cc6b79b5fa7d9c2be72eb70daa1df3d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationDyadicWidth.lean @@ -0,0 +1,149 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalRetainedLikelihood + +namespace OAI + +noncomputable section + +section +open MeasureTheory Filter +open scoped BigOperators Topology Classical +namespace NeutralAtom + +lemma observationWidthSquareSum_dyadic {r : ℝ} (hr : 0 (r*2^k.val)^(101/100:ℝ))≤ + (4/3:ℝ)*((r^(101/100:ℝ))⁻¹)^2 := by + have hg : (∑ k : Fin J, (1/4:ℝ)^k.val)≤4/3 := by + rw [Fin.sum_univ_eq_sum_range] + have H := geom_sum_mul_neg (1/4:ℝ) J + have hn := pow_nonneg (by norm_num : (0:ℝ)≤1/4) J + nlinarith + have hp := Real.rpow_pos_of_pos hr (101/100:ℝ) + unfold observationWidthSquareSum + calc + _ ≤ ∑ k : Fin J, ((r^(101/100:ℝ))⁻¹)^2*(1/4:ℝ)^k.val := by + apply Finset.sum_le_sum + intro k _ + have hpow : (2:ℝ)^k.val≤((2:ℝ)^k.val)^(101/100:ℝ) := + Real.self_le_rpow_of_one_le (one_le_pow₀ (by norm_num)) (by norm_num) + have hwidth : r^(101/100:ℝ)*2^k.val≤(r*2^k.val)^(101/100:ℝ) := by + rw [Real.mul_rpow hr.le (by positivity)] + exact mul_le_mul_of_nonneg_left hpow hp.le + have hi : ((r*2^k.val)^(101/100:ℝ))⁻¹≤(r^(101/100:ℝ)*2^k.val)⁻¹ := + (inv_le_inv₀ (Real.rpow_pos_of_pos (by positivity) _) (by positivity)).2 hwidth + convert pow_le_pow_left₀ (inv_nonneg.mpr (Real.rpow_nonneg (by positivity) _)) hi 2 using 1 + have he : ((2:ℝ)^k.val)⁻¹^2 = (1/4:ℝ)^k.val := by + rw [← inv_pow, ← pow_mul, show k.val*2=2*k.val from Nat.mul_comm _ _, pow_mul, inv_pow] + norm_num + rw [mul_inv_rev, mul_pow, he] + ring + _ = ((r^(101/100:ℝ))⁻¹)^2*(∑ k : Fin J, (1/4:ℝ)^k.val) := by rw [Finset.mul_sum] + _ ≤ ((r^(101/100:ℝ))⁻¹)^2*(4/3:ℝ) := + mul_le_mul_of_nonneg_left hg (sq_nonneg _) + _ = _ := mul_comm _ _ + +lemma observationWidthSquareSum_retained_dyadic {r : ℝ} (hr : 0 + (r*2^k.val.val)^(101/100:ℝ))≤ + (4/3:ℝ)*(((r*2^j)^(101/100:ℝ))⁻¹)^2 := by + let sh : RetainedScales J j → Fin J := + fun k => ⟨k.val.val-j, lt_of_le_of_lt (Nat.sub_le _ _) k.val.isLt⟩ + have hs : Function.Injective sh := by + intro k l h + apply Subtype.ext + apply Fin.ext + have he := congrArg Fin.val h + dsimp [sh] at he + have hk := k.property + have hl := l.property + omega + have hg : (∑ k : RetainedScales J j, (1/4:ℝ)^(k.val.val-j))≤4/3 := by + calc + _ = ∑ k ∈ Finset.univ.image sh, (1/4:ℝ)^k.val := by + rw [Finset.sum_image (by intro a _ b _ hab; exact hs hab)] + _ ≤ ∑ k : Fin J, (1/4:ℝ)^k.val := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.subset_univ _) + (fun _ _ _ => by positivity) + _ ≤ 4/3 := by + rw [Fin.sum_univ_eq_sum_range] + have H := geom_sum_mul_neg (1/4:ℝ) J + have hn := pow_nonneg (by norm_num : (0:ℝ)≤1/4) J + nlinarith + have hp := Real.rpow_pos_of_pos (by positivity : 0 r₀*2^k.val) j ⁻¹' B)) : + ∃ u : Coulomb.H1Vector n, Coulomb.Antisymmetric u ∧ Coulomb.mass u=1 ∧ + Coulomb.form (Coulomb.atom Z hZ) u≤E+(D₀+observationEventEnergyConstant* + ((4/3:ℝ)*(((r₀*2^j)^(101/100:ℝ))⁻¹)^2)* + (1-Real.log ((observationLaw J (rawLaw ψ)).real + (tailObservation (fun k : Fin J => r₀*2^k.val) j ⁻¹' B)))^5) ∧ + ∀ F : Configuration n → ℝ, Measurable F → (∃ C : ℝ, ∀ x, ‖F x‖≤C) → + Coulomb.potentialForm (fun x => F ((flattenConfiguration n).symm x)) u= + ((observationLaw J (rawLaw ψ)).real + (tailObservation (fun k : Fin J => r₀*2^k.val) j ⁻¹' B))⁻¹* + ∫ sample, (tailObservation (fun k : Fin J => r₀*2^k.val) j ⁻¹' B).indicator + (fun z => F z.1) sample ∂observationLaw J (rawLaw ψ) := by + obtain ⟨u,hu,hum,hue,hlaw⟩ := physical_retainedTailEvent_state Z hZ hd hn hmin hbase + (fun k : Fin J => r₀*2^k.val) (fun k => by positivity) j hB hp + refine ⟨u,hu,hum,hue.trans ?_,hlaw⟩ + have := rawLaw_isProbability hd.2.2.1 hn + have h1 : (observationLaw J (rawLaw ψ)).real + (tailObservation (fun k : Fin J => r₀*2^k.val) j ⁻¹' B)≤1 := measureReal_le_one + have hl := Real.log_nonpos hp.le h1 + have hlog : 0≤1-Real.log ((observationLaw J (rawLaw ψ)).real + (tailObservation (fun k : Fin J => r₀*2^k.val) j ⁻¹' B)) := by linarith + have hc := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (observationWidthSquareSum_retained_dyadic hr₀ J j) + observationEventEnergyConstant_pos.le) + (pow_nonneg hlog 5) + linarith +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationFieldTransfer.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationFieldTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae76897a686d9afeee56ca3dc271299941120c0c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationFieldTransfer.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationPatchScale +import OAI.Analysis.CoulombRadii.FieldAnalysis.FreshTransferScale + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +theorem atomic_observation_fresh_field_transfer {D A : ℝ} (hD : 0≤D) (hA : 0 r^(101/100:ℝ)) B) → + ∀ (y : Position) (hy : y≠0), Coulomb.atomicCellScale y≤A*r → + ∃ u : Coulomb.H1Vector n, Coulomb.Antisymmetric u ∧ Coulomb.mass u=1 ∧ + Coulomb.form (Coulomb.atom Z hZ) u≤E+inverseObservationOffset D r ∧ + (∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B x* + F (flattenConfiguration n x))) ∧ + ∃ t : ℝ, ∃ ht : t∈Set.Icc (5*Coulomb.atomicCellScale y) (6*Coulomb.atomicCellScale y), + ∃ T : Coulomb.AtomicBudgetHistory (Coulomb.atom Z hZ) u + (Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ))) 1, + T.ensemble.totalForm (Coulomb.atom Z hZ)≤Coulomb.form (Coulomb.atom Z hZ) u+ + Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ)) ∧ + T.ensemble.OutFermionic ∧ T.ensemble.CoreSupported {z | t≤‖z-y‖} ∧ + T.ensemble.OutSupported (Metric.closedBall y (t+(Coulomb.atomicCellScale y)^(6/5:ℝ))) ∧ + Coulomb.atomicPatchTFGap (Coulomb.atom Z hZ) (by intro i; rfl) T.ensemble y hy + ((Coulomb.atomicCellScale y)^(6/5:ℝ)) + (Real.rpow_pos_of_pos (Coulomb.atomicCellScale_pos hy) _) t ht.2≤ + 2*(Coulomb.atomicCellScale y)^(-349/50:ℝ) ∧ + T.ensemble.deletedSquare y t ((Coulomb.atomicCellScale y)^(6/5:ℝ))≤ + (72*Coulomb.atomicPatchCountFactor*Coulomb.atomicCountConstant)*(Coulomb.atomicCellScale y)^(-29/5:ℝ) ∧ + |Coulomb.coreScreenedField (Coulomb.atom Z hZ) u y- + Coulomb.atomicPatchMeanField (Coulomb.atom Z hZ) (by intro i; rfl) T.ensemble y hy + ((Coulomb.atomicCellScale y)^(6/5:ℝ)) + (Real.rpow_pos_of_pos (Coulomb.atomicCellScale_pos hy) _) t ht.2|≤ + Coulomb.atomicTransferConstant*(Coulomb.atomicCellScale y)^(-1999/500:ℝ) := by + obtain ⟨s₀,hs₀,hs₀1,hscale⟩ := exists_inverseObservationOffset_small hD hA + obtain ⟨s₁,hs₁,_,hpatch⟩ := Coulomb.exists_atomic_fresh_field_transfer + refine ⟨min s₀ (s₁/A),lt_min hs₀ (div_pos hs₁ hA),?_⟩ + intro n Z hZ ψ g hd hn hmin E hE hbase r hr hrs B hB hsym hprob y hy hya + have hrs₀ : r r^(101/100:ℝ)) B) := + (pow_pos hr 42).trans_le hprob + have hp1 := stateWeightedIntegral_le_one hd hn + (arrayEventLikelihood_contDiff (fun _ : Fin 1 => r^(101/100:ℝ)) hB).continuous.measurable + (arrayEventLikelihood_nonneg _ hB) (arrayEventLikelihood_le_one _ hB) + have hm := observationEventOffset_mono_probability (fun _ : Fin 1 => r^(101/100:ℝ)) D + (pow_pos hr 42) hprob hp1 + have hm' : D+observationEventEnergyConstant* + observationWidthSquareSum (fun _ : Fin 1 => r^(101/100:ℝ))* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B)))^5≤ + inverseObservationOffset D r := by + simpa [inverseObservationOffset,observationWidthSquareSum] using hm + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase + (fun _ : Fin 1 => r^(101/100:ℝ)) (fun _ => Real.rpow_pos_of_pos hr _) hB hsym hp + have hue' := hue.trans (add_le_add le_rfl hm') + refine ⟨u,hu,hum,hue',hlaw,?_⟩ + apply hpatch (Coulomb.atom Z hZ) (by intro i; rfl) u hu hum hE hue' + (inverseObservationOffset_nonneg hD hr hr1) y hy + · have hh : r zero_le_one) _ + +lemma arrayStatistic_matching_observed_count {n : ℕ} (χ : Space → ℝ) (x z : Configuration n) + (y : Space) {r d L : ℝ} (hd : 0≤d) (hL : 0≤L) + (hs : ∀ v, χ v≠0 → ‖v-y‖≤r) (hLip : ∀ v w, |χ v-χ w|≤L*‖v-w‖) + (hmatch : ∀ i, ‖position z i-position x i‖≤d) : + |arrayStatistic χ z-arrayStatistic χ x|≤ + (L*d)*localCount (Metric.closedBall y (r+2*d)) z := by + have H := arrayStatistic_local_matching χ x z y hd hL hs hLip hmatch + apply H.trans + apply mul_le_mul_of_nonneg_left _ (mul_nonneg hL hd) + convert localCount_ball_matching x z y (r:=r+d) hmatch using 1 + congr 2 + ring +end Coulomb +namespace NeutralAtom + +theorem arrayEvent_fresh_statistic_lower {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : H) + {E : Set ((H × (Fin n × Fin 3)) → ℝ)} (hE : MeasurableSet E) + (ψ : Wavefunction n) (u : Coulomb.H1Vector n) + (hbayes : ∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood ℓ E))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ E x*F (flattenConfiguration n x))) + (T : Coulomb.RecordedEnsemble n) (hT : T.Conserves u) + (χ : Position → ℝ) (hχm : Measurable χ) {A : Set Position} + (hχ : ∀ z∈A, χ z=0) (hcs : T.CoreSupported A) + (y : Position) {r L M Q : ℝ} (hL : 0≤L) + (hs : ∀ v, χ v≠0 → ‖v-y‖≤r) (hLip : ∀ v w, |χ v-χ w|≤L*‖v-w‖) + (hhigh : ∀ z∈E, Q≤∑ i, χ (observationArrayPositions h z i)) + (hcount : ∀ z∈E, rawCount (Metric.closedBall y (r+2*(Real.sqrt 3*ℓ h))) + (observationArrayPositions h z)≤M) : + ∀ p s, ∀ᵐ x, Coulomb.mass ((T.vector p).coreSlice s x)≠0 → + Q-L*(Real.sqrt 3*ℓ h)*M≤Coulomb.arrayStatistic χ x := by + apply arrayEvent_fresh_statistic_ae ℓ (fun h => (hℓ h).ne') hE ψ u hbayes T hT hχm hχ hcs + measurableSet_Ici + intro x z hz he + let w := fun ia : H × (Fin n × Fin 3) => x ia.2.1 ia.2.2+ℓ ia.1*z ia + let X := flattenConfiguration n x + let Y := flattenConfiguration n (observationArrayPositions h w) + have hd : 0≤Real.sqrt 3*ℓ h := mul_nonneg (Real.sqrt_nonneg _) (hℓ h).le + have hd' (i : Fin n) : ‖Coulomb.position Y i-Coulomb.position X i‖≤Real.sqrt 3*ℓ h := by + simpa only [X,Y,position_flattenConfiguration] using observationArrayPositions_displacement ℓ hℓ x hz h i + have Hmatch := Coulomb.arrayStatistic_matching_observed_count χ X Y y hd hL hs hLip hd' + have Hcount : Coulomb.localCount (Metric.closedBall y (r+2*(Real.sqrt 3*ℓ h))) Y≤M := by + simpa only [Y,Coulomb.localCount,position_flattenConfiguration,rawCount] using hcount w he + have Hhigh : Q≤Coulomb.arrayStatistic χ Y := by + simpa only [Y,Coulomb.arrayStatistic,position_flattenConfiguration] using hhigh w he + have Herror := Hmatch.trans (mul_le_mul_of_nonneg_left Hcount (mul_nonneg hL hd)) + change Q-L*(Real.sqrt 3*ℓ h)*M≤Coulomb.arrayStatistic χ X + linarith [(abs_le.mp Herror).2] + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace NeutralAtom + +theorem arrayEvent_fresh_count_upper {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : H) + {E : Set ((H × (Fin n × Fin 3)) → ℝ)} (hE : MeasurableSet E) + (ψ : Wavefunction n) (u : Coulomb.H1Vector n) + (hbayes : ∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood ℓ E))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ E x*F (flattenConfiguration n x))) + (T : Coulomb.RecordedEnsemble n) (hT : T.Conserves u) + {A : Set Position} (hcs : T.CoreSupported A) (y : Position) {R M : ℝ} + (hfar : ∀ z∈A, R<‖z-y‖) + (hcount : ∀ z∈E, rawCount (Metric.closedBall y (R+Real.sqrt 3*ℓ h)) + (observationArrayPositions h z)≤M) : + ∀ p s, ∀ᵐ x, Coulomb.mass ((T.vector p).coreSlice s x)≠0 → + Coulomb.localCount (Metric.closedBall y R) x≤M := by + let χ : Position → ℝ := (Metric.closedBall y R).indicator (fun _ => 1) + have hχm : Measurable χ := measurable_const.indicator measurableSet_closedBall + have hχ (z) (hz : z∈A) : χ z=0 := by + apply indicator_of_notMem + simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hfar z hz + apply arrayEvent_fresh_statistic_ae ℓ (fun h => (hℓ h).ne') hE ψ u hbayes T hT hχm hχ hcs + (B := Set.Iic M) measurableSet_Iic + intro x z hz he + let w := fun ia : H × (Fin n × Fin 3) => x ia.2.1 ia.2.2+ℓ ia.1*z ia + let X := flattenConfiguration n x + let Y := flattenConfiguration n (observationArrayPositions h w) + have hd (i : Fin n) : ‖Coulomb.position Y i-Coulomb.position X i‖≤Real.sqrt 3*ℓ h := by + simpa only [X,Y,position_flattenConfiguration] using observationArrayPositions_displacement ℓ hℓ x hz h i + have HH := Coulomb.localCount_ball_matching X Y y (r:=R) hd + have HC : Coulomb.localCount (Metric.closedBall y (R+Real.sqrt 3*ℓ h)) Y≤M := by + simpa only [Y,Coulomb.localCount,position_flattenConfiguration,rawCount] using hcount w he + exact HH.trans HC + +theorem arrayEvent_fresh_fine_lower {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : H) + {E : Set ((H × (Fin n × Fin 3)) → ℝ)} (hE : MeasurableSet E) + (ψ : Wavefunction n) (u : Coulomb.H1Vector n) + (hbayes : ∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood ℓ E))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ E x*F (flattenConfiguration n x))) + (T : Coulomb.RecordedEnsemble n) (hT : T.Conserves u) + (χ : Position → ℝ) (hχm : Measurable χ) (y : Position) {r b t L M Q K : ℝ} + (hb : 0 hrawcount z hz (by linarith)) + have Hcount := arrayEvent_fresh_count_upper ℓ hℓ h hE ψ u hbayes T hT hcs y + (R:=r+2*b) (fun z hz => by change t≤‖z-y‖ at hz; linarith) + (fun z hz => hrawcount z hz (by linarith)) + intro p s + filter_upwards [Hhigh p s,Hcount p s] with x hx hc + intro hm + have hh := hx hm + have hcx := hc hm + have Hfine := Coulomb.patchFine_kernel_matching hb hL hretain χ hχm hK y + (fun z hz => by by_contra hn; linarith [hs z hn]) hLip x + have HE := Hfine.trans (mul_le_mul_of_nonneg_left hcx (by positivity : 0≤L*(2*b))) + change Q-L*(Real.sqrt 3*ℓ h)*M≤∑ i,χ (Coulomb.position x i) at hh + linarith [(abs_le.mp HE).1] + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationMatching.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationMatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..522c920e0ed9f8acc8a921139b1f5987c65bde7c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationMatching.lean @@ -0,0 +1,213 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.ObservationAtomic + +namespace OAI + +noncomputable section + +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +namespace NeutralAtom + +lemma observationProductDensity_ne_zero_support {I : Type*} [Fintype I] + {u : I → ℝ} (hu : observationProductDensity u≠0) (i : I) : |u i|<1 := by + have hi : observationNoiseDensity (u i)≠0 := fun h => hu (Finset.prod_eq_zero (Finset.mem_univ i) h) + by_contra h + apply hi + rw [observationNoiseDensity_formula,ite_eq_right h,mul_zero] + +lemma arrayEventLikelihood_pos_matching {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, ℓ h≠0) + (s : Set ((H × (Fin n × Fin 3)) → ℝ)) (x : Configuration n) + (hp : 0 < arrayEventLikelihood ℓ s x) : + ∃ u : (H × (Fin n × Fin 3)) → ℝ, (∀ ia, |u ia|<1) ∧ + (fun ia => x ia.2.1 ia.2.2+ℓ ia.1*u ia)∈s := by + by_contra hn + push Not at hn + have he : arrayEventLikelihood ℓ s x=0 := by + rw [arrayEventLikelihood_integral ℓ hℓ,observationNoiseLaw_pi_integral] + apply integral_eq_zero_of_ae + filter_upwards [] with u + by_cases hu : observationProductDensity u=0 + · simp [hu] + · simp [Set.indicator_of_notMem (hn u (observationProductDensity_ne_zero_support hu))] + linarith + +def observationArrayPositions {H : Type*} {n : ℕ} (h : H) + (y : (H × (Fin n × Fin 3)) → ℝ) : Configuration n := + fun i => WithLp.toLp 2 (fun a => y (h,i,a)) + +lemma observationArrayPositions_displacement {H : Type*} {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (x : Configuration n) + {u : (H × (Fin n × Fin 3)) → ℝ} (hu : ∀ ia, |u ia|<1) (h : H) (i : Fin n) : + ‖observationArrayPositions h (fun ia => x ia.2.1 ia.2.2+ℓ ia.1*u ia) i-x i‖ ≤ + Real.sqrt 3*ℓ h := by + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (hℓ h).le)).mp + rw [EuclideanSpace.real_norm_sq_eq,mul_pow,Real.sq_sqrt (by norm_num : (0:ℝ)≤3)] + calc + _ = ∑ a : Fin 3, (ℓ h*u (h,i,a))^2 := by + apply Finset.sum_congr rfl + intro a _ + change (x i a+ℓ h*u (h,i,a)-x i a)^2=_ + ring + _ ≤ ∑ _a : Fin 3, (ℓ h)^2 := Finset.sum_le_sum (fun a _ => by + have H := (sq_le_sq₀ (abs_nonneg (u (h,i,a))) (by norm_num : (0:ℝ)≤1)).2 (hu (h,i,a)).le + rw [sq_abs,one_pow] at H + nlinarith [mul_le_mul_of_nonneg_left H (sq_nonneg (ℓ h))]) + _ = _ := by simp + +lemma observed_annular_count_le {n : ℕ} (x y : Configuration n) + {a b A B d : ℝ} (hd : ∀ i, ‖y i-x i‖≤d) + (hA : A+d linarith [hd i] + simp [hi,hx] + · simpa [Set.indicator, hi] using + (Set.indicator_nonneg (s:={z : Position | A<‖z‖ ∧ ‖z‖ (zero_le_one : (0:ℝ)≤1)) (x i)) + +lemma observed_annular_event_implies_raw_count {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : H) + {a b A B T : ℝ} (hA : A+Real.sqrt 3*ℓ h (hℓ h).ne') _ x hp + exact hs.trans_le (observed_annular_count_le x _ + (fun i => observationArrayPositions_displacement ℓ hℓ x hu h i) hA hB) + +lemma measurable_observationArrayPositions {H : Type*} {n : ℕ} (h : H) : + Measurable (@observationArrayPositions H n h) := by + unfold observationArrayPositions + fun_prop + +lemma observed_annular_event_measurable {H : Type*} {n : ℕ} (h : H) (a b T : ℝ) : + MeasurableSet {y : (H × (Fin n × Fin 3)) → ℝ | + T {z : Position | a≤‖z‖ ∧ ‖z‖≤b}.indicator (fun _ => (1:ℝ)) (observationArrayPositions h y i)) + exact congrArg (fun q => T Iff.of_eq +end NeutralAtom + +end +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +namespace NeutralAtom + +lemma stateWeightedIntegral_mono_bounded {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {F G : Configuration n → ℝ} + (hF : Measurable F) (hG : Measurable G) + {C D : ℝ} (hFb : ∀ x, |F x| ≤ C) (hGb : ∀ x, |G x| ≤ D) (hFG : ∀ x, F x ≤ G x) : + stateWeightedIntegral ψ F ≤ stateWeightedIntegral ψ G := by + unfold stateWeightedIntegral + apply Finset.sum_le_sum + intro σ _ + exact integral_mono (stateWeighted_integrable hd hF hFb σ) (stateWeighted_integrable hd hG hGb σ) + (fun x => mul_le_mul_of_nonneg_right (hFG x) (sq_nonneg _)) + +lemma stateWeightedIntegral_const_mul {n : ℕ} (ψ : Wavefunction n) + (F : Configuration n → ℝ) (c : ℝ) : + stateWeightedIntegral ψ (fun x => c*F x)=c*stateWeightedIntegral ψ F := by + unfold stateWeightedIntegral + simp_rw [mul_assoc,integral_const_mul,Finset.mul_sum] + +lemma event_count_square_lower {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {F : Configuration n → ℝ} (hF : Measurable F) + (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + {A : Set Position} (hA : MeasurableSet A) {T : ℝ} (hT : 0 ≤ T) + (hmatch : ∀ x, 0 F x*(Coulomb.localCount A (flattenConfiguration n x))^2) := by + have hcm : Measurable (fun x : Configuration n => Coulomb.localCount A (flattenConfiguration n x)) := + (Coulomb.localCount_measurable hA).comp (flattenConfiguration n).continuous.measurable + have H := stateWeightedIntegral_mono_bounded hd + (F:=fun x => T^2*F x) (G:=fun x => F x*(Coulomb.localCount A (flattenConfiguration n x))^2) + (measurable_const.mul hF) + (hF.mul (hcm.pow_const 2)) (C:=T^2) (D:=(n:ℝ)^2) + (fun x => by rw [abs_mul,abs_of_nonneg (sq_nonneg _),abs_of_nonneg (hF0 x)]; exact mul_le_of_le_one_right (sq_nonneg _) (hF1 x)) + (fun x => by + rw [abs_of_nonneg (mul_nonneg (hF0 x) (sq_nonneg _))] + exact (mul_le_of_le_one_left (sq_nonneg _) (hF1 x)).trans + (pow_le_pow_left₀ (Coulomb.localCount_nonneg A _) (Coulomb.localCount_le A _) 2)) + (fun x => by + by_cases hx : F x=0 + · simp [hx] + · have H2 := pow_le_pow_left₀ hT (hmatch x (lt_of_le_of_ne (hF0 x) (Ne.symm hx))) 2 + nlinarith [mul_le_mul_of_nonneg_left H2 (hF0 x)]) + rw [stateWeightedIntegral_const_mul] at H + calc + T^2=(stateWeightedIntegral ψ F)⁻¹*(T^2*stateWeightedIntegral ψ F) := by field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left H (inv_nonneg.mpr hp.le) + +lemma observationEventOffset_mono_probability {H : Type*} [Fintype H] + (ℓ : H → ℝ) (D : ℝ) {p q : ℝ} (hp : 0 (observed_annular_event_implies_raw_count ℓ hℓ h hA hB x hx).le) hp + have hu := hbound Z hZ hd hn hmin hE hbase hD ℓ hℓ hs + (observed_annular_event_symmetric h a b T) hp hr + have hδ := observationEventOffset_mono_probability ℓ D₀ hp₀ (le_of_not_ge hc) hp1 + have hmass : Coulomb.screenMass (D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood ℓ s)))^5) r ≤ + Coulomb.screenMass (D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ*(1-Real.log p₀)^5) r := by + unfold Coulomb.screenMass + exact add_le_add le_rfl (Real.sqrt_le_sqrt (mul_le_mul_of_nonneg_right hδ hr.le)) + exact (not_lt_of_ge (hlow.trans (hu.trans (mul_le_mul_of_nonneg_left + (pow_le_pow_left₀ (Coulomb.screenMass_pos _ _).le hmass 2) hC)))) hth +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationMeanBounds.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationMeanBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..cede119297cfc1022b04491229f96c458ec4e9a9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationMeanBounds.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchFieldMeans +import OAI.Analysis.CoulombRadii.Propagation.ObservationGoodGap + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem arrayEvent_fresh_field_means (g : 𝓢(Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hm : (∫ z,g z^2)=1) : + ∃ C D E F K N B₀ : ℝ, 0 arrayEventLikelihood ℓ B x*f (flattenConfiguration n x))) → + ∀ (S : Coulomb.Nuclei J) (T : Coulomb.RecordedEnsemble n), T.Conserves u → T.totalMass=1 → + ∀ {a b t M Qlo Qhi q L U : ℝ} (ha : 0 + Coulomb.patchTFScreenedField S ((T.vector p).coreSlice spin x).normalized ha hb ht.2 y hn y) + (∀ {P : ℝ}, 0

packetKernel g c r₀ s z y) := + ((continuous_packetKernel g.continuous hc hr hs).comp (continuous_id.prodMk continuous_const)).measurable + obtain ⟨hi,hnmean⟩ := Hneg ℓ hℓ h hB ψ u hlaw S T hT ha hb hsmall ht y hn hcs + (show 0≤2*packetWidth c r₀ s y by positivity) hw + (show 2*packetWidth c r₀ s y+2*b packetKernel g c r₀ s z y) hχm + (fun z => ⟨packetKernel_nonneg g hc hr hs z y,(le_abs_self _).trans (hamp z)⟩) + (fun z hz => by simpa only [norm_sub_rev] using hsp z hz) hLip hlo hcount + have Hmean := Coulomb.patch_field_mean_lower S T ha hb hsmall ht y hn hcs hq hL hi (fun p spin => ?_) + · rw [hTM,mul_one] at Hmean hnmean + linarith + · filter_upwards [HG p spin] with x hx + exact fun hm hg => ((hx hm hg).1 hmargin).le + · intro hmargin + have Hmean := Coulomb.patch_field_mean_upper S T ha hb hsmall ht y hn hcs hq hU (fun p spin => ?_) + · simpa only [hTM,mul_one] using Hmean + · filter_upwards [HG p spin] with x hx + exact fun hm hg => ((hx hm hg).2 hmargin).le +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationNegativeMean.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationNegativeMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..918ae2e39d2660cd7c74702602885ba9302cd5b3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationNegativeMean.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PatchPacketResponse +import OAI.Analysis.CoulombRadii.RandomFields.ObservationHigh +import OAI.Analysis.CoulombRadii.FieldAnalysis.PatchNegativeMean + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace NeutralAtom + +theorem exists_arrayEvent_fresh_negative_mean : + ∃ C : ℝ, 0 arrayEventLikelihood ℓ E x*F (flattenConfiguration n x))) → + ∀ (S : Coulomb.Nuclei J) (T : Coulomb.RecordedEnsemble n), T.Conserves u → + ∀ {a b t r L M Q K P : ℝ} (ha : 0 Coulomb.mass ((T.vector p).coreSlice s x)* + max (-Coulomb.patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0)) ∧ + (∑ p, Coulomb.sliceExpectation (T.vector p) (fun s x => + max (-Coulomb.patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0))≤ + (2*K/P)*(∑ p, Coulomb.sliceExpectation (T.vector p) + (Coulomb.patchSliceTFGap S (T.vector p) ha hb ht.2 y hn))+ + (2*(C*(r/a))*(a^4)⁻¹)*T.totalMass := by + obtain ⟨C,hC,Hbound⟩ := Coulomb.exists_patch_negative_mean_bound + refine ⟨C,hC,?_⟩ + intro J n H inst ℓ hℓ h E hE ψ u hbayes S T hT a b t r L M Q K P ha hb hsmall ht y hn hcs hr hra hret hθ hL hK hP hmargin χ hχm hχ hs hLip hhigh hcount + have Hfine := arrayEvent_fresh_fine_lower ℓ hℓ h hE ψ u hbayes T hT χ hχm y hb hL hret hcs + (fun z => by rw [abs_of_nonneg (hχ z).1]; exact (hχ z).2) hs hLip hhigh hcount + apply Hbound S T ha hb hsmall ht y hn hcs hr hra hθ χ K P hK hP hχm hχ hs + intro p s + filter_upwards [Hfine p s] with x hx + exact fun hm => hmargin.trans (hx hm) + +theorem arrayEvent_fresh_statistic_upper {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : H) + {E : Set ((H × (Fin n × Fin 3)) → ℝ)} (hE : MeasurableSet E) + (ψ : Wavefunction n) (u : Coulomb.H1Vector n) + (hbayes : ∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood ℓ E))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ E x*F (flattenConfiguration n x))) + (T : Coulomb.RecordedEnsemble n) (hT : T.Conserves u) + (χ : Position → ℝ) (hχm : Measurable χ) {A : Set Position} + (hχ : ∀ z∈A, χ z=0) (hcs : T.CoreSupported A) + (y : Position) {r L M Q : ℝ} (hL : 0≤L) + (hs : ∀ v, χ v≠0 → ‖v-y‖≤r) (hLip : ∀ v w, |χ v-χ w|≤L*‖v-w‖) + (hlow : ∀ z∈E, (∑ i, χ (observationArrayPositions h z i))≤Q) + (hcount : ∀ z∈E, rawCount (Metric.closedBall y (r+2*(Real.sqrt 3*ℓ h))) + (observationArrayPositions h z)≤M) : + ∀ p s, ∀ᵐ x, Coulomb.mass ((T.vector p).coreSlice s x)≠0 → + Coulomb.arrayStatistic χ x≤Q+L*(Real.sqrt 3*ℓ h)*M := by + have Hlow := arrayEvent_fresh_statistic_lower ℓ hℓ h hE ψ u hbayes T hT + (fun z => -χ z) hχm.neg + (fun z hz => by rw [hχ z hz,neg_zero]) hcs y hL + (fun v hv => hs v (fun hh => hv (by rw [hh,neg_zero]))) + (fun v w => by simpa only [neg_sub_neg,abs_sub_comm] using hLip v w) + (Q:=-Q) (fun z hz => by simpa only [Finset.sum_neg_distrib,neg_le_neg_iff] using hlow z hz) hcount + intro p s + filter_upwards [Hlow p s] with x hx + intro hm + have HH := hx hm + simp only [Coulomb.arrayStatistic,Finset.sum_neg_distrib] at HH ⊢ + linarith + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace NeutralAtom + +theorem arrayEvent_fresh_patch_response (g : 𝓢(Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hm : (∫ z,g z^2)=1) : + ∃ C D E F K : ℝ, 0 arrayEventLikelihood ℓ B x*f (flattenConfiguration n x))) → + ∀ (S : Coulomb.Nuclei J) (T : Coulomb.RecordedEnsemble n), T.Conserves u → + ∀ {a b t M Qlo Qhi : ℝ} (ha : 0 packetKernel g c r₀ s z y + let v := Coulomb.patchTFScreenedField S ((T.vector p).coreSlice spin x).normalized ha hb ht.2 y hn y + let d := C*(2*w/a)*((a^4)⁻¹+max (-v) 0) + let e := Real.sqrt ((D/w^5)*Coulomb.patchSliceTFGap S (T.vector p) ha hb ht.2 y hn spin x)+ + (F/w^4*(2*b)+K/w^4*(Real.sqrt 3*ℓ h))*M + Coulomb.tfScalarDensity (v-d)*(∫ z,χ z)-e≤Qhi ∧ + Qlo≤Coulomb.tfScalarDensity (v+d)*(∫ z,χ z)+e ∧ + |(∫ z,χ z)-1|≤E*(c*(1+packetExponent)*s^packetExponent) := by + obtain ⟨C,D,E,F,hC,hD,hE,hF,Hresponse⟩ := Coulomb.master_kernel_patch_array_response g hg hm + obtain ⟨K,hK,Hkernel⟩ := master_kernel_estimates g hg hm + refine ⟨C,D,E,F,K,hC,hD,hE,hF,hK,?_⟩ + intro c r₀ s hc hr hs hq H inst n J ℓ hℓ h B hB ψ u hbayes S T hT a b t M Qlo Qhi ha hb hsmall ht y hn hcs hw hhigh hlow hcount + let w := packetWidth c r₀ s y + let χ := fun z => packetKernel g c r₀ s z y + have hpw : 0 hrawcount z hz (by linarith)) + have Hlow := arrayEvent_fresh_statistic_upper ℓ hℓ h hB ψ u hbayes T hT χ hχm hχ hcs y + (show 0≤K/w^4 by positivity) hχs hLip hlow (fun z hz => hrawcount z hz (by linarith)) + have Hcount := arrayEvent_fresh_count_upper ℓ hℓ h hB ψ u hbayes T hT hcs y + (R:=2*w+2*b) (fun z hz => by change t≤‖z-y‖ at hz; dsimp only [w]; linarith [ht.1]) + (fun z hz => hrawcount z hz (by linarith)) + intro p spin + have Hcore : ∀ᵐ x, Coulomb.SpatiallySupported ((T.vector p).coreSlice spin x).normalized + {z | t≤‖z-y‖} := ((hcs p).coreSlice spin).mono (fun _ hx => hx.normalized) + filter_upwards [Hhigh p spin,Hlow p spin,Hcount p spin,Hcore] with x hhi hlo hco hcore + intro hmass + have Hhi := hhi hmass + have Hlo := hlo hmass + have Hco := hco hmass + have Hresponse := Hresponse hc hr hs hq S (T.vector p) ha hb hsmall ht y hn hw spin x hcore + have HE := mul_le_mul_of_nonneg_left Hco (show 0≤F/w^4*(2*b) by positivity) + dsimp only at Hresponse ⊢ + dsimp only [Coulomb.arrayStatistic,χ,w] at Hhi Hlo HE + refine ⟨?_,?_,Hresponse.2.2⟩ <;> linarith [Hresponse.1,Hresponse.2.1] +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationPatchScale.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationPatchScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2837a09e4c439986a2195de9dd1c080cf6249a2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationPatchScale.lean @@ -0,0 +1,183 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationMatching +import OAI.Analysis.CoulombRadii.FieldAnalysis.AtomicNear + +namespace OAI + +noncomputable section + +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +namespace NeutralAtom + +def inverseObservationOffset (D r : ℝ) : ℝ := + D+observationEventEnergyConstant*((r^(101/100:ℝ))⁻¹)^2*(1-Real.log (r^42))^5 + +lemma inverseObservationOffset_scaled_tendsto (D : ℝ) : + Tendsto (fun r => inverseObservationOffset D r*r^(349/50:ℝ)) (𝓝[>] 0) (𝓝 0) := by + have ht := (tendsto_positive_rpow_zero (by norm_num : (0:ℝ)<124/125)).sub + ((tendsto_log_mul_rpow_nhdsGT_zero (by norm_num : (0:ℝ)<124/125)).const_mul 42) + have hh := ((tendsto_positive_rpow_zero (by norm_num : (0:ℝ)<349/50)).const_mul D).add + ((ht.pow 5).const_mul observationEventEnergyConstant) + simp only [mul_zero,sub_self,zero_pow (by decide : 5≠0),add_zero] at hh + apply hh.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hr : 0] 0, + r<1 ∧ inverseObservationOffset D r*r^(349/50:ℝ)*A^(349/50:ℝ)<1 := by + filter_upwards [(eventually_lt_nhds (by norm_num : (0:ℝ)<1)).filter_mono nhdsWithin_le_nhds, + ht.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1))] with r hr hh + exact ⟨hr,hh⟩ + obtain ⟨s,hs,hsub⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp hevent + refine ⟨min s 1,lt_min hs (by norm_num),min_le_right _ _,?_⟩ + intro r a hr hrs ha haA + obtain ⟨hr1,hh⟩ := hsub ⟨hr,hrs.trans_le (min_le_left _ _)⟩ + have hδ := inverseObservationOffset_nonneg hD hr hr1.le + have hmul : inverseObservationOffset D r*a^(349/50:ℝ)≤1 := by + calc + _ ≤ inverseObservationOffset D r*(A*r)^(349/50:ℝ) := + mul_le_mul_of_nonneg_left (Real.rpow_le_rpow ha.le haA (by norm_num)) hδ + _ = inverseObservationOffset D r*r^(349/50:ℝ)*A^(349/50:ℝ) := by rw [Real.mul_rpow hA.le hr.le]; ring + _ ≤ 1 := hh.le + rw [neg_div,Real.rpow_neg ha.le,inv_eq_one_div] + exact (le_div_iff₀ (Real.rpow_pos_of_pos ha _)).mpr hmul + +theorem atomic_observation_refined_patch {D A : ℝ} (hD : 0≤D) (hA : 0 r^(101/100:ℝ)) B) → + ∀ (y : Position) (hy : y≠0), Coulomb.atomicCellScale y≤A*r → + ∃ u : Coulomb.H1Vector n, Coulomb.Antisymmetric u ∧ Coulomb.mass u=1 ∧ + Coulomb.form (Coulomb.atom Z hZ) u≤E+inverseObservationOffset D r ∧ + (∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B x* + F (flattenConfiguration n x))) ∧ + ∃ t : ℝ, ∃ ht : t∈Set.Icc (5*Coulomb.atomicCellScale y) (6*Coulomb.atomicCellScale y), + ∃ T : Coulomb.AtomicBudgetHistory (Coulomb.atom Z hZ) u + (Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ))) 1, + T.ensemble.totalForm (Coulomb.atom Z hZ)≤Coulomb.form (Coulomb.atom Z hZ) u+ + Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ)) ∧ + T.ensemble.OutFermionic ∧ T.ensemble.CoreSupported {z | t≤‖z-y‖} ∧ + T.ensemble.OutSupported (Metric.closedBall y (t+(Coulomb.atomicCellScale y)^(6/5:ℝ))) ∧ + Coulomb.atomicPatchTFGap (Coulomb.atom Z hZ) (by intro i; rfl) T.ensemble y hy + ((Coulomb.atomicCellScale y)^(6/5:ℝ)) + (Real.rpow_pos_of_pos (Coulomb.atomicCellScale_pos hy) _) t ht.2≤ + 2*(Coulomb.atomicCellScale y)^(-349/50:ℝ) := by + obtain ⟨s₀,hs₀,hs₀1,hscale⟩ := exists_inverseObservationOffset_small hD hA + obtain ⟨s₁,hs₁,_,hpatch⟩ := Coulomb.exists_atomic_small_physical_gap + refine ⟨min s₀ (s₁/A),lt_min hs₀ (div_pos hs₁ hA),?_⟩ + intro n Z hZ ψ g hd hn hmin E hE hbase r hr hrs B hB hsym hprob y hy hya + have hrs₀ : r r^(101/100:ℝ)) B) := + (pow_pos hr 42).trans_le hprob + have hp1 := stateWeightedIntegral_le_one hd hn + (arrayEventLikelihood_contDiff (fun _ : Fin 1 => r^(101/100:ℝ)) hB).continuous.measurable + (arrayEventLikelihood_nonneg _ hB) (arrayEventLikelihood_le_one _ hB) + have hm := observationEventOffset_mono_probability (fun _ : Fin 1 => r^(101/100:ℝ)) D + (pow_pos hr 42) hprob hp1 + have hm' : D+observationEventEnergyConstant* + observationWidthSquareSum (fun _ : Fin 1 => r^(101/100:ℝ))* + (1-Real.log (stateWeightedIntegral ψ (arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B)))^5≤ + inverseObservationOffset D r := by + simpa [inverseObservationOffset,observationWidthSquareSum] using hm + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase + (fun _ : Fin 1 => r^(101/100:ℝ)) (fun _ => Real.rpow_pos_of_pos hr _) hB hsym hp + have hue' := hue.trans (add_le_add le_rfl hm') + refine ⟨u,hu,hum,hue',hlaw,?_⟩ + apply hpatch (Coulomb.atom Z hZ) (by intro i; rfl) u hu hum hE hue' + (inverseObservationOffset_nonneg hD hr hr1) y hy + · have hh : r r^(101/100:ℝ)) B) → + ∀ (y : Position) (hy : y≠0), Coulomb.atomicCellScale y≤A*r → + ∃ u : Coulomb.H1Vector n, Coulomb.Antisymmetric u ∧ Coulomb.mass u=1 ∧ + Coulomb.form (Coulomb.atom Z hZ) u≤E+inverseObservationOffset D r ∧ + (∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood (fun _ : Fin 1 => r^(101/100:ℝ)) B x* + F (flattenConfiguration n x))) ∧ + (∀ {R : ℝ}, 0≤R → R≤4*Coulomb.atomicCellScale y → + Coulomb.potentialForm (Coulomb.nearPotential y R) u≤ + Coulomb.atomicNearConstant*(Coulomb.atomicCellScale y)^(-21/5:ℝ)*R^(1/5:ℝ)) ∧ + ∃ t : ℝ, ∃ ht : t∈Set.Icc (5*Coulomb.atomicCellScale y) (6*Coulomb.atomicCellScale y), + ∃ T : Coulomb.AtomicBudgetHistory (Coulomb.atom Z hZ) u + (Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ))) 1, + T.ensemble.totalForm (Coulomb.atom Z hZ)≤Coulomb.form (Coulomb.atom Z hZ) u+ + Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ)) ∧ + T.ensemble.OutFermionic ∧ T.ensemble.CoreSupported {z | t≤‖z-y‖} ∧ + T.ensemble.OutSupported (Metric.closedBall y (t+(Coulomb.atomicCellScale y)^(6/5:ℝ))) ∧ + Coulomb.atomicPatchTFGap (Coulomb.atom Z hZ) (by intro i; rfl) T.ensemble y hy + ((Coulomb.atomicCellScale y)^(6/5:ℝ)) + (Real.rpow_pos_of_pos (Coulomb.atomicCellScale_pos hy) _) t ht.2≤ + 2*(Coulomb.atomicCellScale y)^(-349/50:ℝ) := by + obtain ⟨s₀,hs₀,hs₀1,hscale⟩ := exists_inverseObservationOffset_small hD hA + obtain ⟨s₁,hs₁,hs₁1,hnear⟩ := Coulomb.exists_atomic_near_scale + obtain ⟨s₂,hs₂,hpatch⟩ := atomic_observation_refined_patch hD hA + refine ⟨min s₂ (min s₀ (s₁/A)),lt_min hs₂ (lt_min hs₀ (div_pos hs₁ hA)),?_⟩ + intro n Z hZ ψ g hd hn hmin E hE hbase r hr hrs B hB hsym hprob y hy hya + have hrs₂ : r |f x|^q) μ) : + (∫ x in s, |f x| ∂μ)^q ≤ (μ.real s)^(q-1) * (∫ x, |f x|^q ∂μ) := by + have h0 : μ s ≠ 0 := by + intro h + simp [Measure.real, h] at hp + have hj := (convexOn_pow q).map_set_average_le + (continuous_id.pow q).continuousOn isClosed_Ici h0 (measure_ne_top μ s) + (Filter.Eventually.of_forall (fun x => abs_nonneg (f x))) + hf.abs.integrableOn hfq.integrableOn + simp only [average_eq, Measure.real, Measure.restrict_apply MeasurableSet.univ, + Set.univ_inter, smul_eq_mul, ← div_eq_inv_mul, div_pow] at hj + change (∫ x in s, |f x| ∂μ)^q / (μ.real s)^q ≤ + (∫ x in s, |f x|^q ∂μ) / μ.real s at hj + have hj' := (div_le_div_iff₀ (pow_pos hp q) hp).mp hj + have hpow : (μ.real s)^q = (μ.real s)^(q-1) * μ.real s := by + rw [← pow_succ] + congr 1 + omega + rw [hpow] at hj' + have hj'' : (∫ x in s, |f x| ∂μ)^q ≤ + (μ.real s)^(q-1) * (∫ x in s, |f x|^q ∂μ) := + (mul_le_mul_iff_left₀ hp).mp (by nlinarith [hj']) + exact hj''.trans (mul_le_mul_of_nonneg_left + (integral_mono_measure μ.restrict_le_self + (Filter.Eventually.of_forall fun x => pow_nonneg (abs_nonneg (f x)) q) hfq) + (pow_nonneg hp.le (q-1))) + +theorem square_le_log_fifth_of_moments {x p D : ℝ} + (hp : 0 < p) (hp1 : p ≤ 1) (hD : 0 ≤ D) + (hx : ∀ k : ℕ, 0 < k → x^(2*k) ≤ p^(2*k-1) * (2*(D*(k:ℝ)^5)^k)) : + x^2 ≤ 32 * Real.exp 2 * D * p^2 * (1-Real.log p)^5 := by + let L : ℝ := 1-Real.log p + have hlog : Real.log p ≤ 0 := Real.log_nonpos hp.le hp1 + have hL : 1 ≤ L := by dsimp [L]; linarith + have hL0 : 0 ≤ L := le_trans zero_le_one hL + let k : ℕ := ⌈L⌉₊ + have hkL : L ≤ (k:ℝ) := Nat.le_ceil L + have hk : 0 < k := Nat.ceil_pos.mpr (lt_of_lt_of_le zero_lt_one hL) + have hk1 : 1 ≤ (k:ℝ) := le_trans hL hkL + have hkU : (k:ℝ) ≤ 2*L := by + have hh := Nat.ceil_lt_add_one hL0 + change (k:ℝ) < L+1 at hh + linarith + have h2p : 2 ≤ p * (Real.exp 2)^k := by + calc + 2 ≤ Real.exp 1 := Real.exp_one_gt_two.le + _ ≤ Real.exp (Real.log p + (k:ℝ)*2) := by + apply Real.exp_le_exp.mpr + dsimp [L] at hkL + linarith + _ = p * (Real.exp 2)^k := by rw [Real.exp_add, Real.exp_log hp, Real.exp_nat_mul] + have hxp : (x^2)^k ≤ (D * Real.exp 2 * (k:ℝ)^5 * p^2)^k := by + calc + (x^2)^k = x^(2*k) := by rw [pow_mul] + _ ≤ p^(2*k-1) * (2*(D*(k:ℝ)^5)^k) := hx k hk + _ ≤ p^(2*k-1) * ((p * (Real.exp 2)^k)*(D*(k:ℝ)^5)^k) := + mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right h2p (by positivity)) (by positivity) + _ = (D * Real.exp 2 * (k:ℝ)^5 * p^2)^k := by + have he : p^(2*k-1)*p = p^(2*k) := by + rw [← pow_succ] + congr 1 + omega + calc + p^(2*k-1) * ((p * (Real.exp 2)^k)*(D*(k:ℝ)^5)^k) = + (p^(2*k-1)*p) * ((Real.exp 2)^k*(D*(k:ℝ)^5)^k) := by ring + _ = (p^2)^k * ((Real.exp 2)^k*(D*(k:ℝ)^5)^k) := by rw [he, pow_mul] + _ = (D * Real.exp 2 * (k:ℝ)^5 * p^2)^k := by simp only [mul_pow]; ring + have hx2 : x^2 ≤ D * Real.exp 2 * (k:ℝ)^5 * p^2 := + (pow_le_pow_iff_left₀ (sq_nonneg x) (by positivity) hk.ne').mp hxp + calc + x^2 ≤ D * Real.exp 2 * (k:ℝ)^5 * p^2 := hx2 + _ ≤ D * Real.exp 2 * (2*L)^5 * p^2 := by gcongr + _ = 32 * Real.exp 2 * D * p^2 * (1-Real.log p)^5 := by dsimp [L]; ring + +theorem observationScorePi_event_bound {ι : Type*} [Fintype ι] + (a : ι → ℝ) (s : Set (ι → ℝ)) + (hp : 0 < (Measure.pi (fun _ : ι => observationNoiseLaw)).real s) : + (∫ u in s, |∑ i, a i * observationTranslationScore (u i)| + ∂Measure.pi (fun _ : ι => observationNoiseLaw))^2 ≤ + (32 * Real.exp 2 * (2048 * Real.exp 1 * (max 1 (2*observationNoiseNormalizer))^2)) * + (∑ i, (a i)^2) * ((Measure.pi (fun _ : ι => observationNoiseLaw)).real s)^2 * + (1-Real.log ((Measure.pi (fun _ : ι => observationNoiseLaw)).real s))^5 := by + classical + let μ := Measure.pi (fun _ : ι => observationNoiseLaw) + let f := fun u : ι → ℝ => ∑ i, a i * observationTranslationScore (u i) + let D := 2048 * Real.exp 1 * (max 1 (2*observationNoiseNormalizer))^2 * + (∑ i, (a i)^2) + have hD : 0 ≤ D := by dsimp [D]; positivity + have hf : Integrable f μ := (observationScorePi_sum_memLp a 1 (by omega)).integrable (by norm_num) + have hh := square_le_log_fifth_of_moments hp measureReal_le_one hD + (x := ∫ u in s, |f u| ∂μ) (fun k hk => by + have hi := observationScorePi_sum_pow_integrable a (2*k) (by omega) + have hj := setIntegral_abs_pow_le μ f s hp hf (2*k) (by omega) hi + apply hj.trans + have hb := mul_le_mul_of_nonneg_left (observationScorePi_moment_le a k hk) + (pow_nonneg hp.le (2*k-1)) + convert hb using 1 + dsimp [D] + congr 3 + ring) + convert hh using 1 + dsimp [D] + ring + +open scoped Convolution + +def observationProductDensity {ι : Type*} [Fintype ι] (u : ι → ℝ) : ℝ := + ∏ i, observationNoiseDensity (u i) + +theorem observationProductDensity_nonneg {ι : Type*} [Fintype ι] (u : ι → ℝ) : + 0 ≤ observationProductDensity u := + Finset.prod_nonneg (fun _i _ => observationNoiseDensity_nonneg _) + +theorem observationProductDensity_contDiff {ι : Type*} [Fintype ι] : + ContDiff ℝ ∞ (@observationProductDensity ι _) := by + unfold observationProductDensity + have h := observationNoiseDensity_contDiff + fun_prop + +theorem observationProductDensity_compact {ι : Type*} [Fintype ι] : + HasCompactSupport (@observationProductDensity ι _) := by + classical + apply HasCompactSupport.intro + (isCompact_pi_infinite (fun _ : ι => (isCompact_Icc : IsCompact (Set.Icc (-1:ℝ) 1)))) + intro u hu + simp only [Set.mem_ofPred_eq, not_forall] at hu + obtain ⟨i, hi⟩ := hu + apply Finset.prod_eq_zero (Finset.mem_univ i) + rw [observationNoiseDensity_formula, ite_eq_right, mul_zero] + intro hh + exact hi ⟨(abs_lt.mp hh).1.le, (abs_lt.mp hh).2.le⟩ + +theorem observationProductDensity_integrable {ι : Type*} [Fintype ι] : + Integrable (@observationProductDensity ι _) := + Integrable.fintype_prod (fun _ => observationNoiseDensity_integrable) + +theorem observationProductDensity_even {ι : Type*} [Fintype ι] (u : ι → ℝ) : + observationProductDensity (-u) = observationProductDensity u := by + simp [observationProductDensity, observationNoiseDensity_even] + +theorem observationNoiseLaw_pi_density {ι : Type*} [Fintype ι] : + Measure.pi (fun _ : ι => observationNoiseLaw) = + volume.withDensity (fun u : ι → ℝ => ENNReal.ofReal (observationProductDensity u)) := by + classical + apply Measure.pi_eq + intro s hs + rw [withDensity_apply _ (MeasurableSet.univ_pi hs), + ← ofReal_integral_eq_lintegral_ofReal observationProductDensity_integrable.integrableOn + (Filter.Eventually.of_forall observationProductDensity_nonneg)] + change ENNReal.ofReal (∫ u : ι → ℝ in Set.univ.pi s, + ∏ i, observationNoiseDensity (u i) ∂Measure.pi (fun _ => volume)) = _ + rw [Measure.restrict_pi_pi, integral_fintype_prod_eq_prod, ENNReal.ofReal_prod_of_nonneg] + · apply Finset.prod_congr rfl + intro i _ + rw [observationNoiseLaw, withDensity_apply _ (hs i), + ← ofReal_integral_eq_lintegral_ofReal observationNoiseDensity_integrable.integrableOn + (Filter.Eventually.of_forall observationNoiseDensity_nonneg)] + · intro i _ + exact integral_nonneg observationNoiseDensity_nonneg + +theorem observationNoiseLaw_pi_integral {ι : Type*} [Fintype ι] (f : (ι → ℝ) → ℝ) : + (∫ u, f u ∂Measure.pi (fun _ : ι => observationNoiseLaw)) = + ∫ u, observationProductDensity u * f u := by + rw [observationNoiseLaw_pi_density, integral_withDensity_eq_integral_toReal_smul] + · simp only [ENNReal.toReal_ofReal (observationProductDensity_nonneg _), smul_eq_mul] + · exact observationProductDensity_contDiff.continuous.measurable.ennreal_ofReal + · exact Filter.Eventually.of_forall (fun _ => ENNReal.ofReal_lt_top) + +theorem observationProductDensity_fderiv {ι : Type*} [Fintype ι] + (u v : ι → ℝ) : + fderiv ℝ observationProductDensity u v = + -(∑ i, v i * observationTranslationScore (u i)) * observationProductDensity u := by + classical + have hd (i : ι) : HasFDerivAt (fun w : ι → ℝ => observationNoiseDensity (w i)) + ((-observationTranslationScore (u i) * observationNoiseDensity (u i)) • + (ContinuousLinearMap.proj i : (ι → ℝ) →L[ℝ] ℝ)) u := + (observationNoiseDensity_hasDerivAt (u i)).comp_hasFDerivAt + (f := fun w : ι → ℝ => w i) u (ContinuousLinearMap.proj i : (ι → ℝ) →L[ℝ] ℝ).hasFDerivAt + unfold observationProductDensity + rw [(HasFDerivAt.finsetProd (fun i (_ : i ∈ Finset.univ) => hd i)).fderiv] + simp only [sum_apply, smul_apply, + ContinuousLinearMap.proj_apply, smul_eq_mul] + rw [← Finset.sum_neg_distrib, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + have he := Finset.mul_prod_erase Finset.univ (fun j => observationNoiseDensity (u j)) hi + change (∏ j ∈ Finset.univ.erase i, observationNoiseDensity (u j)) * + ((-observationTranslationScore (u i) * observationNoiseDensity (u i)) * v i) = + -(v i * observationTranslationScore (u i)) * (∏ j, observationNoiseDensity (u j)) + rw [← he] + ring + +def observationEventLikelihood {ι : Type*} [Fintype ι] + (s : Set (ι → ℝ)) (z : ι → ℝ) : ℝ := + (s.indicator (fun _ => (1:ℝ)) ⋆[ContinuousLinearMap.mul ℝ ℝ] observationProductDensity) z + +theorem observationEventLikelihood_contDiff {ι : Type*} [Fintype ι] + {s : Set (ι → ℝ)} (hs : MeasurableSet s) : + ContDiff ℝ ∞ (observationEventLikelihood s) := + observationProductDensity_compact.contDiff_convolution_right (ContinuousLinearMap.mul ℝ ℝ) + ((locallyIntegrable_const 1).indicator hs) observationProductDensity_contDiff + +theorem observationEventLikelihood_integral {ι : Type*} [Fintype ι] + (s : Set (ι → ℝ)) (z : ι → ℝ) : + observationEventLikelihood s z = + ∫ u, s.indicator (fun _ => (1:ℝ)) (z+u) + ∂Measure.pi (fun _ : ι => observationNoiseLaw) := by + rw [observationEventLikelihood, convolution_def, observationNoiseLaw_pi_integral, + ← integral_add_left_eq_self (fun y : ι → ℝ => + (ContinuousLinearMap.mul ℝ ℝ) (s.indicator (fun _ => (1:ℝ)) y) + (observationProductDensity (z-y))) z] + apply integral_congr_ae + filter_upwards with u + simp only [ContinuousLinearMap.mul_apply', show z-(z+u) = -u by abel, + observationProductDensity_even] + ring + +theorem observationEventLikelihood_probability {ι : Type*} [Fintype ι] + {s : Set (ι → ℝ)} (hs : MeasurableSet s) (z : ι → ℝ) : + observationEventLikelihood s z = + (Measure.pi (fun _ : ι => observationNoiseLaw)).real ((fun u => z+u) ⁻¹' s) := by + rw [observationEventLikelihood_integral] + have he : (fun u => s.indicator (fun _ => (1:ℝ)) (z+u)) = + ((fun u => z+u) ⁻¹' s).indicator (fun _ => (1:ℝ)) := by + ext u + exact (Set.indicator_comp_right (fun u : ι → ℝ => z+u)).symm + rw [he] + have ht : MeasurableSet ((fun u : ι → ℝ => z+u) ⁻¹' s) := hs.preimage (by fun_prop) + rw [integral_indicator ht, setIntegral_const, smul_eq_mul, mul_one] + +theorem observationEventLikelihood_fderiv {ι : Type*} [Fintype ι] + {s : Set (ι → ℝ)} (hs : MeasurableSet s) (z v : ι → ℝ) : + fderiv ℝ (observationEventLikelihood s) z v = + ∫ u in ((fun u => z+u) ⁻¹' s), ∑ i, v i * observationTranslationScore (u i) + ∂Measure.pi (fun _ : ι => observationNoiseLaw) := by + have hf := (locallyIntegrable_const (1:ℝ) (μ := (volume : Measure (ι → ℝ)))).indicator hs + have hg : ContDiff ℝ 1 (@observationProductDensity ι _) := + observationProductDensity_contDiff.of_le (by norm_num) + have hd := observationProductDensity_compact.hasFDerivAt_convolution_right + (ContinuousLinearMap.mul ℝ ℝ) hf hg z + change fderiv ℝ (s.indicator (fun _ => (1:ℝ)) ⋆[ContinuousLinearMap.mul ℝ ℝ] + observationProductDensity) z v = _ + rw [hd.fderiv, convolution_precompR_apply (ContinuousLinearMap.mul ℝ ℝ) hf + (observationProductDensity_compact.fderiv ℝ) (hg.continuous_fderiv one_ne_zero), + convolution_def] + have ht : MeasurableSet ((fun u : ι → ℝ => z+u) ⁻¹' s) := hs.preimage (by fun_prop) + rw [← integral_indicator ht, observationNoiseLaw_pi_integral, + ← integral_add_left_eq_self (fun y : ι → ℝ => + (ContinuousLinearMap.mul ℝ ℝ) (s.indicator (fun _ => (1:ℝ)) y) + (fderiv ℝ observationProductDensity (z-y) v)) z] + apply integral_congr_ae + filter_upwards with u + rw [observationProductDensity_fderiv] + simp only [show z-(z+u) = -u by abel, ContinuousLinearMap.mul_apply', + observationProductDensity_even, Pi.neg_apply, observationTranslationScore_odd, + mul_neg, Finset.sum_neg_distrib, neg_neg] + by_cases hu : z+u ∈ s + · simp [hu, mul_comm] + · simp [hu] + +theorem observationEventLikelihood_nonneg {ι : Type*} [Fintype ι] + {s : Set (ι → ℝ)} (hs : MeasurableSet s) (z : ι → ℝ) : + 0 ≤ observationEventLikelihood s z := by + rw [observationEventLikelihood_probability hs] + exact measureReal_nonneg + +theorem observationEventLikelihood_le_one {ι : Type*} [Fintype ι] + {s : Set (ι → ℝ)} (hs : MeasurableSet s) (z : ι → ℝ) : + observationEventLikelihood s z ≤ 1 := by + rw [observationEventLikelihood_probability hs] + exact measureReal_le_one + +def observationScoreConstant : ℝ := + 32 * Real.exp 2 * (2048 * Real.exp 1 * (max 1 (2*observationNoiseNormalizer))^2) + +theorem observationScoreConstant_pos : 0 < observationScoreConstant := by + unfold observationScoreConstant + have : 0 < max 1 (2*observationNoiseNormalizer) := lt_of_lt_of_le zero_lt_one (le_max_left _ _) + positivity + +theorem observationEventLikelihood_derivative_bound {ι : Type*} [Fintype ι] + {s : Set (ι → ℝ)} (hs : MeasurableSet s) (z v : ι → ℝ) : + (fderiv ℝ (observationEventLikelihood s) z v)^2 ≤ + observationScoreConstant * (∑ i, (v i)^2) * (observationEventLikelihood s z)^2 * + (1-Real.log (observationEventLikelihood s z))^5 := by + let μ := Measure.pi (fun _ : ι => observationNoiseLaw) + let t := (fun u : ι → ℝ => z+u) ⁻¹' s + rw [observationEventLikelihood_fderiv hs, observationEventLikelihood_probability hs] + change (∫ u in t, ∑ i, v i * observationTranslationScore (u i) ∂μ)^2 ≤ + observationScoreConstant * (∑ i, (v i)^2) * (μ.real t)^2 * (1-Real.log (μ.real t))^5 + rcases (measureReal_nonneg : 0 ≤ μ.real t).eq_or_lt with hp | hp + · have hzero : μ t = 0 := (ENNReal.toReal_eq_zero_iff _).mp hp.symm |>.resolve_right (measure_ne_top μ t) + simp [Measure.restrict_eq_zero.mpr hzero, hp.symm] + · have hh := observationScorePi_event_bound v t hp + apply le_trans _ hh + have ha := abs_integral_le_integral_abs (f := fun u : ι → ℝ => + ∑ i, v i * observationTranslationScore (u i)) (μ := μ.restrict t) + simpa only [sq_abs] using pow_le_pow_left₀ (abs_nonneg _) ha 2 + +theorem likelihood_log_fifth_majorant {u p : ℝ} + (hu : 0 ≤ u) (hu1 : u ≤ 1) (hp : 0 < p) (hp1 : p ≤ 1) : + u * (1-Real.log u)^5 ≤ + (u + 120 * Real.exp 1 * p) * (1-Real.log p)^5 := by + have hL : 1 ≤ 1-Real.log p := by have := Real.log_nonpos hp.le hp1; linarith + have hL0 : 0 ≤ 1-Real.log p := by linarith + rcases hu.eq_or_lt with rfl | hu + · simp only [zero_mul, zero_add] + positivity + by_cases hup : u ≤ p + · let t := Real.log p - Real.log u + have ht : 0 ≤ t := sub_nonneg.mpr (Real.log_le_log hu hup) + have hpow : (1-Real.log u)^5 ≤ ((1-Real.log p)*(1+t))^5 := by + apply pow_le_pow_left₀ (by have := Real.log_nonpos hu.le hu1; linarith) + have he : 1-Real.log u = (1-Real.log p)+t := by dsimp [t]; ring + rw [he] + nlinarith + have hex := pow_mul_exp_neg_le_factorial 5 (add_nonneg zero_le_one ht) + have hex' : (1+t)^5 * Real.exp (-t) ≤ 120 * Real.exp 1 := by + have hh := mul_le_mul_of_nonneg_right hex (Real.exp_pos 1).le + rw [mul_assoc, ← Real.exp_add] at hh + convert hh using 1 <;> norm_num + have he : u = p * Real.exp (-t) := by + dsimp [t] + rw [neg_sub, Real.exp_sub, Real.exp_log hu, Real.exp_log hp] + field_simp + calc + u * (1-Real.log u)^5 ≤ u * ((1-Real.log p)*(1+t))^5 := + mul_le_mul_of_nonneg_left hpow hu.le + _ = p * (1-Real.log p)^5 * ((1+t)^5 * Real.exp (-t)) := by rw [he, mul_pow]; ring + _ ≤ p * (1-Real.log p)^5 * (120 * Real.exp 1) := + mul_le_mul_of_nonneg_left hex' (by positivity) + _ ≤ (u + 120 * Real.exp 1 * p) * (1-Real.log p)^5 := by + nlinarith [mul_nonneg hu.le (pow_nonneg hL0 5)] + · have hpu : p ≤ u := (lt_of_not_ge hup).le + have hl : 1-Real.log u ≤ 1-Real.log p := sub_le_sub_left (Real.log_le_log hp hpu) 1 + have h0 : 0 ≤ 1-Real.log u := by have := Real.log_nonpos hu.le hu1; linarith + calc + u * (1-Real.log u)^5 ≤ u * (1-Real.log p)^5 := by gcongr + _ ≤ (u + 120 * Real.exp 1 * p) * (1-Real.log p)^5 := by + apply mul_le_mul_of_nonneg_right _ (pow_nonneg hL0 5) + exact le_add_of_nonneg_right (by positivity) + +theorem integral_likelihood_log_fifth {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {f : Ω → ℝ} + (hf : Measurable f) (hf0 : ∀ x, 0 ≤ f x) (hf1 : ∀ x, f x ≤ 1) + (hp : 0 < ∫ x, f x ∂μ) : + Integrable (fun x => f x * (1-Real.log (f x))^5) μ ∧ + (∫ x, f x * (1-Real.log (f x))^5 ∂μ) ≤ + (1+120*Real.exp 1) * (∫ x, f x ∂μ) * (1-Real.log (∫ x, f x ∂μ))^5 := by + let p := ∫ x, f x ∂μ + have hfi : Integrable f μ := Integrable.mono' (integrable_const (1:ℝ)) + hf.aestronglyMeasurable (Filter.Eventually.of_forall (fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (hf0 x)]; exact hf1 x)) + have hp1 : p ≤ 1 := by + calc + p ≤ ∫ _ : Ω, (1:ℝ) ∂μ := integral_mono hfi (integrable_const _) hf1 + _ = 1 := by simp + have hmaj (x : Ω) := likelihood_log_fifth_majorant (hf0 x) (hf1 x) hp hp1 + have hnonneg (x : Ω) : 0 ≤ f x * (1-Real.log (f x))^5 := by + have hh := Real.log_nonpos (hf0 x) (hf1 x) + exact mul_nonneg (hf0 x) (pow_nonneg (by linarith) 5) + have hgi : Integrable (fun x => (f x+120*Real.exp 1*p)*(1-Real.log p)^5) μ := + (hfi.add (integrable_const _)).mul_const _ + have hai : Integrable (fun x => f x * (1-Real.log (f x))^5) μ := + Integrable.mono' hgi (by fun_prop) (Filter.Eventually.of_forall (fun x => by + rw [Real.norm_eq_abs, abs_of_nonneg (hnonneg x)]; exact hmaj x)) + refine ⟨hai, (integral_mono hai hgi hmaj).trans_eq ?_⟩ + rw [integral_mul_const, integral_add hfi (integrable_const _)] + simp only [integral_const, probReal_univ, smul_eq_mul, one_mul] + dsimp [p] + ring + +def coordinateLinear {n : ℕ} (i : Fin n) (a : Fin 3) : Configuration n →L[ℝ] ℝ := + (EuclideanSpace.proj a).comp (ContinuousLinearMap.proj i) + +@[simp] theorem coordinateLinear_apply {n : ℕ} (i : Fin n) (a : Fin 3) (x : Configuration n) : + coordinateLinear i a x = x i a := rfl + +def observationArrayCenter {H : Type*} [Fintype H] {n : ℕ} (ℓ : H → ℝ) : + Configuration n →L[ℝ] ((H × (Fin n × Fin 3)) → ℝ) := + ContinuousLinearMap.pi (fun hia => (ℓ hia.1)⁻¹ • coordinateLinear hia.2.1 hia.2.2) + +def observationArrayRescale {H : Type*} {n : ℕ} (ℓ : H → ℝ) + (y : (H × (Fin n × Fin 3)) → ℝ) : (H × (Fin n × Fin 3)) → ℝ := + fun hia => ℓ hia.1 * y hia + +def arrayEventLikelihood {H : Type*} [Fintype H] {n : ℕ} (ℓ : H → ℝ) + (s : Set ((H × (Fin n × Fin 3)) → ℝ)) (x : Configuration n) : ℝ := + observationEventLikelihood (observationArrayRescale ℓ ⁻¹' s) (observationArrayCenter ℓ x) + +theorem arrayEventLikelihood_contDiff {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) : + ContDiff ℝ ∞ (arrayEventLikelihood ℓ s) := + (observationEventLikelihood_contDiff (hs.preimage (by + unfold observationArrayRescale; fun_prop))).comp (observationArrayCenter ℓ).contDiff + +theorem arrayEventLikelihood_nonneg {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (x : Configuration n) : 0 ≤ arrayEventLikelihood ℓ s x := + observationEventLikelihood_nonneg (hs.preimage (by unfold observationArrayRescale; fun_prop)) _ + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationSmallScale.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationSmallScale.lean new file mode 100644 index 0000000000000000000000000000000000000000..28549c79b4a6646536e3d251ca8335608d23ff95 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservationSmallScale.lean @@ -0,0 +1,85 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.ScreenUnits +import OAI.Analysis.CoulombRadii.RandomFields.EventTiltWavefunction + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma tendsto_positive_rpow_zero {q : ℝ} (hq : 0 r^q) (𝓝[>] 0) (𝓝 0) := by + simpa [Real.zero_rpow hq.ne'] using + ((Real.continuous_rpow_const hq.le).tendsto 0).mono_left nhdsWithin_le_nhds + +def singleObservationOffset (D r : ℝ) : ℝ := + D+observationEventEnergyConstant*((r^(101/100:ℝ))⁻¹)^2*(1-Real.log (r^40))^5 + +lemma singleObservationOffset_scaled_tendsto (D : ℝ) : + Tendsto (fun r => singleObservationOffset D r*r^7) (𝓝[>] 0) (𝓝 0) := by + have ht := (tendsto_positive_rpow_zero (by norm_num : (0:ℝ)<249/250)).sub + ((tendsto_log_mul_rpow_nhdsGT_zero (by norm_num : (0:ℝ)<249/250)).const_mul 40) + have hpow : Tendsto (fun r : ℝ => r^7) (𝓝[>] 0) (𝓝 0) := by + simpa using (tendsto_id.mono_left nhdsWithin_le_nhds : Tendsto (fun r : ℝ => r) (𝓝[>] 0) (𝓝 0)).pow 7 + have hh := (hpow.const_mul D).add ((ht.pow 5).const_mul observationEventEnergyConstant) + simp only [mul_zero,sub_self,zero_pow (by decide : 5≠0),add_zero] at hh + apply hh.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hr : 0 Real.sqrt 3*r^(101/100:ℝ)/r) (𝓝[>] 0) (𝓝 0) := by + have h := (tendsto_positive_rpow_zero (by norm_num : (0:ℝ)<1/100)).const_mul (Real.sqrt 3) + simp only [mul_zero] at h + apply h.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + have hr : 0 (1:ℝ)) (fun hia => x hia.2.1 hia.2.2 + ℓ hia.1 * u hia) + ∂Measure.pi (fun _ : H × (Fin n × Fin 3) => observationNoiseLaw) := by + rw [arrayEventLikelihood, observationEventLikelihood_integral] + apply integral_congr_ae + filter_upwards with u + have he : observationArrayRescale ℓ (observationArrayCenter ℓ x + u) = + (fun hia => x hia.2.1 hia.2.2 + ℓ hia.1 * u hia) := by + ext hia + simp [observationArrayRescale, observationArrayCenter, mul_add, hℓ] + change (observationArrayRescale ℓ ⁻¹' s).indicator + ((fun _ => (1:ℝ)) ∘ observationArrayRescale ℓ) (observationArrayCenter ℓ x + u) = _ + rw [Set.indicator_comp_right, he] + +def observationWidthSquareSum {H : Type*} [Fintype H] (ℓ : H → ℝ) : ℝ := + ∑ h, ((ℓ h)⁻¹)^2 + +theorem observationWidthSquareSum_nonneg {H : Type*} [Fintype H] (ℓ : H → ℝ) : + 0 ≤ observationWidthSquareSum ℓ := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + +theorem arrayEventLikelihood_direction_bound {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (x v : Configuration n) : + (fderiv ℝ (arrayEventLikelihood ℓ s) x v)^2 ≤ + observationScoreConstant * observationWidthSquareSum ℓ * (∑ i, ∑ a, (v i a)^2) * + (arrayEventLikelihood ℓ s x)^2 * (1-Real.log (arrayEventLikelihood ℓ s x))^5 := by + have ht : MeasurableSet (observationArrayRescale ℓ ⁻¹' s) := hs.preimage (by + unfold observationArrayRescale; fun_prop) + have hd := (observationEventLikelihood_contDiff ht).differentiable (by simp) + have he : fderiv ℝ (arrayEventLikelihood ℓ s) x v = + fderiv ℝ (observationEventLikelihood (observationArrayRescale ℓ ⁻¹' s)) + (observationArrayCenter ℓ x) (observationArrayCenter ℓ v) := by + exact congrArg (fun D : Configuration n →L[ℝ] ℝ => D v) + ((hd _).hasFDerivAt.comp x (observationArrayCenter ℓ).hasFDerivAt).fderiv + rw [he] + have hh := observationEventLikelihood_derivative_bound ht (observationArrayCenter ℓ x) + (observationArrayCenter ℓ v) + have hsum : (∑ hia : H × (Fin n × Fin 3), (observationArrayCenter ℓ v hia)^2) = + observationWidthSquareSum ℓ * (∑ i, ∑ a, (v i a)^2) := by + simp only [observationArrayCenter, ContinuousLinearMap.pi_apply, smul_apply, + smul_eq_mul, coordinateLinear_apply, mul_pow, Fintype.sum_prod_type, + ← Finset.mul_sum, ← Finset.sum_mul, observationWidthSquareSum] + simpa only [hsum, arrayEventLikelihood, mul_assoc] using hh + +theorem configuration_coordinate_expansion {n : ℕ} (v : Configuration n) : + v = ∑ i, ∑ a, (v i a) • coordinateDirection i a := by + classical + ext i a + simp [coordinateDirection, Pi.single_apply] + +theorem arrayEventLikelihood_gradient_bound {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) {s : Set ((H × (Fin n × Fin 3)) → ℝ)} (hs : MeasurableSet s) + (x : Configuration n) : + (∑ i, ∑ a, (fderiv ℝ (arrayEventLikelihood ℓ s) x (coordinateDirection i a))^2) ≤ + observationScoreConstant * observationWidthSquareSum ℓ * + (arrayEventLikelihood ℓ s x)^2 * (1-Real.log (arrayEventLikelihood ℓ s x))^5 := by + let d : Fin n → Fin 3 → ℝ := fun i a => + fderiv ℝ (arrayEventLikelihood ℓ s) x (coordinateDirection i a) + let v : Configuration n := fun i => (EuclideanSpace.equiv (Fin 3) ℝ).symm (d i) + let A : ℝ := ∑ i, ∑ a, (d i a)^2 + have hA : 0 ≤ A := Finset.sum_nonneg (fun i _ => Finset.sum_nonneg (fun a _ => sq_nonneg _)) + have hv (i : Fin n) (a : Fin 3) : v i a = d i a := rfl + have he : fderiv ℝ (arrayEventLikelihood ℓ s) x v = A := by + conv_lhs => rw [configuration_coordinate_expansion v] + simp only [map_sum, map_smul, smul_eq_mul, hv, d, A, pow_two] + have hh := arrayEventLikelihood_direction_bound ℓ hs x v + simp only [he, hv] at hh + change A^2 ≤ observationScoreConstant * observationWidthSquareSum ℓ * A * + (arrayEventLikelihood ℓ s x)^2 * (1-Real.log (arrayEventLikelihood ℓ s x))^5 at hh + change A ≤ _ + rcases hA.eq_or_lt with hAz | hAz + · rw [← hAz] + have hl := Real.log_nonpos (arrayEventLikelihood_nonneg ℓ hs x) (arrayEventLikelihood_le_one ℓ hs x) + exact mul_nonneg (mul_nonneg (mul_nonneg observationScoreConstant_pos.le + (observationWidthSquareSum_nonneg ℓ)) (sq_nonneg _)) (pow_nonneg (by linarith) 5) + · exact (mul_le_mul_iff_left₀ hAz).mp (by nlinarith only [hh]) + +def permuteObservationArray {H : Type*} {n : ℕ} (p : Equiv.Perm (Fin n)) + (y : (H × (Fin n × Fin 3)) → ℝ) : (H × (Fin n × Fin 3)) → ℝ := + fun hia => y (hia.1, p hia.2.1, hia.2.2) + +theorem arrayEventLikelihood_symmetric {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, ℓ h ≠ 0) + {s : Set ((H × (Fin n × Fin 3)) → ℝ)} + (hsym : ∀ (p : Equiv.Perm (Fin n)) y, permuteObservationArray p y ∈ s ↔ y ∈ s) + (p : Equiv.Perm (Fin n)) (x : Configuration n) : + arrayEventLikelihood ℓ s (x ∘ p) = arrayEventLikelihood ℓ s x := by + rw [arrayEventLikelihood_integral ℓ hℓ, arrayEventLikelihood_integral ℓ hℓ] + let e : Equiv.Perm (H × (Fin n × Fin 3)) := + Equiv.prodCongr (Equiv.refl H) (Equiv.prodCongr p (Equiv.refl (Fin 3))) + let F : ((H × (Fin n × Fin 3)) → ℝ) → ℝ := fun u => + s.indicator (fun _ => (1:ℝ)) (fun hia => (x ∘ p) hia.2.1 hia.2.2 + ℓ hia.1 * u hia) + have he := (measurePreserving_piCongrLeft + (fun _ : H × (Fin n × Fin 3) => observationNoiseLaw) e.symm).integral_comp' F + rw [← he] + apply integral_congr_ae + filter_upwards with u + have hu : (MeasurableEquiv.piCongrLeft (fun _ : H × (Fin n × Fin 3) => ℝ) e.symm) u = + permuteObservationArray p u := by + ext hia + have hh := MeasurableEquiv.piCongrLeft_apply_apply (β := fun _ => ℝ) e.symm u (e hia) + rw [e.symm_apply_apply] at hh + exact hh + rw [hu] + dsimp only [F] + have hv : (fun hia => (x ∘ p) hia.2.1 hia.2.2 + ℓ hia.1 * permuteObservationArray p u hia) = + permuteObservationArray p (fun hia => x hia.2.1 hia.2.2 + ℓ hia.1 * u hia) := rfl + rw [hv] + simp only [Set.indicator, hsym] + +def eventRootDerivative {n : ℕ} (F : Configuration n → ℝ) + (i : Fin n) (a : Fin 3) (x : Configuration n) : ℝ := + fderiv ℝ F x (coordinateDirection i a) / (2 * Real.sqrt (F x)) + +def regularizedEventRoot {n : ℕ} (F : Configuration n → ℝ) + (k : ℕ) (x : Configuration n) : ℝ := Real.sqrt (1/((k:ℝ)+1) + F x) + +theorem regularizedEventRoot_derivative {n : ℕ} {F : Configuration n → ℝ} + (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) + (k : ℕ) (i : Fin n) (a : Fin 3) (x : Configuration n) : + fderiv ℝ (regularizedEventRoot F k) x (coordinateDirection i a) = + fderiv ℝ F x (coordinateDirection i a) / (2 * regularizedEventRoot F k x) := by + have hpos : 0 < 1/((k:ℝ)+1) + F x := add_pos_of_pos_of_nonneg (by positivity) (hF0 x) + unfold regularizedEventRoot + rw [fderiv_sqrt ((contDiff_const.add hF).differentiable (by simp)).differentiableAt hpos.ne', + fderiv_const_add] + simp only [smul_apply, smul_eq_mul] + ring + +theorem root_gradient_square_bound {n : ℕ} {F : Configuration n → ℝ} + {K : ℝ} (hK : 0 ≤ K) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + {ε : ℝ} (hε : 0 ≤ ε) (x : Configuration n) : + (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a) / + (2 * Real.sqrt (ε + F x)))^2) ≤ K/4 * F x * (1-Real.log (F x))^5 := by + have hlog : 0 ≤ (1-Real.log (F x))^5 := by + apply pow_nonneg + have := Real.log_nonpos (hF0 x) (hF1 x) + linarith + rcases (add_nonneg hε (hF0 x)).eq_or_lt with hh | hh + · rw [← hh, Real.sqrt_zero, mul_zero] + simp only [div_zero, zero_pow (by decide : 2 ≠ 0), Finset.sum_const_zero] + exact mul_nonneg (mul_nonneg (div_nonneg hK (by norm_num)) (hF0 x)) hlog + · simp only [div_pow, mul_pow, Real.sq_sqrt hh.le, ← Finset.sum_div] + apply (div_le_iff₀ (by positivity : (0:ℝ) < 2^2*(ε+F x))).mpr + have hnonneg := mul_nonneg (mul_nonneg (mul_nonneg hK (hF0 x)) hlog) hε + nlinarith [hgrad x] + +theorem eventRootDerivative_gradient_bound {n : ℕ} {F : Configuration n → ℝ} + {K : ℝ} (hK : 0 ≤ K) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) (x : Configuration n) : + (∑ i, ∑ a, (eventRootDerivative F i a x)^2) ≤ + K/4 * F x * (1-Real.log (F x))^5 := by + simpa only [zero_add, eventRootDerivative] using + root_gradient_square_bound hK hF0 hF1 hgrad (ε := 0) le_rfl x + +theorem coordinate_square_le_sum {n : ℕ} (D : Fin n → Fin 3 → ℝ) + (i : Fin n) (a : Fin 3) : (D i a)^2 ≤ ∑ j, ∑ b, (D j b)^2 := by + apply (Finset.single_le_sum (fun b _ => sq_nonneg (D i b)) (Finset.mem_univ a)).trans + exact Finset.single_le_sum (fun j _ => Finset.sum_nonneg (fun b _ => sq_nonneg (D j b))) + (Finset.mem_univ i) + +theorem regularizedEventRoot_tendsto {n : ℕ} (F : Configuration n → ℝ) + (x : Configuration n) : + Tendsto (fun k => regularizedEventRoot F k x) atTop (𝓝 (Real.sqrt (F x))) := by + have ht : Tendsto (fun k : ℕ => 1/((k:ℝ)+1) + F x) atTop (𝓝 (F x)) := by + simpa only [zero_add] using tendsto_one_div_add_atTop_nhds_zero_nat.add_const (F x) + exact Real.continuous_sqrt.continuousAt.tendsto.comp ht + +theorem likelihood_log_fifth_nonneg {u : ℝ} (hu : 0 ≤ u) (hu1 : u ≤ 1) : + 0 ≤ u * (1-Real.log u)^5 := by + have := Real.log_nonpos hu hu1 + exact mul_nonneg hu (pow_nonneg (by linarith) 5) + +theorem likelihood_log_fifth_bounded {u : ℝ} (hu : 0 ≤ u) (hu1 : u ≤ 1) : + u * (1-Real.log u)^5 ≤ 1+120*Real.exp 1 := by + have hh := likelihood_log_fifth_majorant hu hu1 (p := 1) (by norm_num) le_rfl + simp only [Real.log_one, sub_zero, one_pow, mul_one] at hh + linarith + +theorem likelihood_gradient_zero {n : ℕ} {F : Configuration n → ℝ} {K : ℝ} + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + {x : Configuration n} (hzero : F x = 0) (i : Fin n) (a : Fin 3) : + fderiv ℝ F x (coordinateDirection i a) = 0 := by + have hh := (coordinate_square_le_sum + (fun i a => fderiv ℝ F x (coordinateDirection i a)) i a).trans (hgrad x) + rw [hzero] at hh + nlinarith [sq_nonneg (fderiv ℝ F x (coordinateDirection i a))] + +theorem regularizedEventRoot_contDiff {n : ℕ} {F : Configuration n → ℝ} + (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) (k : ℕ) : + ContDiff ℝ ∞ (regularizedEventRoot F k) := + (contDiff_const.add hF).sqrt (fun x => + (add_pos_of_pos_of_nonneg (by positivity) (hF0 x)).ne') + +theorem regularizedEventRoot_bound {n : ℕ} {F : Configuration n → ℝ} + (hF1 : ∀ x, F x ≤ 1) (k : ℕ) (x : Configuration n) : + |regularizedEventRoot F k x| ≤ Real.sqrt 2 := by + rw [regularizedEventRoot, abs_of_nonneg (Real.sqrt_nonneg _)] + apply Real.sqrt_le_sqrt + have hh : 1/((k:ℝ)+1) ≤ 1 := by + apply (div_le_one (by positivity)).mpr + have := Nat.cast_nonneg (α := ℝ) k + linarith + linarith [hF1 x] + +theorem regularizedEventRoot_derivative_bound {n : ℕ} {F : Configuration n → ℝ} + {K : ℝ} (hK : 0 ≤ K) (hF : ContDiff ℝ ∞ F) + (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + (k : ℕ) (i : Fin n) (a : Fin 3) (x : Configuration n) : + |fderiv ℝ (regularizedEventRoot F k) x (coordinateDirection i a)| ≤ + Real.sqrt (K/4*(1+120*Real.exp 1)) := by + rw [regularizedEventRoot_derivative hF hF0] + apply Real.abs_le_sqrt + apply (coordinate_square_le_sum + (fun i a => fderiv ℝ F x (coordinateDirection i a) / + (2*regularizedEventRoot F k x)) i a).trans + calc + _ ≤ K/4 * F x * (1-Real.log (F x))^5 := + root_gradient_square_bound hK hF0 hF1 hgrad (by positivity) x + _ ≤ K/4*(1+120*Real.exp 1) := by + rw [mul_assoc] + exact mul_le_mul_of_nonneg_left (likelihood_log_fifth_bounded (hF0 x) (hF1 x)) + (div_nonneg hK (by norm_num)) + +theorem regularizedEventRoot_derivative_tendsto {n : ℕ} {F : Configuration n → ℝ} + {K : ℝ} (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + (i : Fin n) (a : Fin 3) (x : Configuration n) : + Tendsto (fun k => fderiv ℝ (regularizedEventRoot F k) x (coordinateDirection i a)) + atTop (𝓝 (eventRootDerivative F i a x)) := by + simp_rw [regularizedEventRoot_derivative hF hF0] + unfold eventRootDerivative + by_cases hz : F x = 0 + · simp_rw [likelihood_gradient_zero hgrad hz i a, zero_div] + exact tendsto_const_nhds + · exact tendsto_const_nhds.div (tendsto_const_nhds.mul (regularizedEventRoot_tendsto F x)) + (mul_ne_zero (by norm_num) (Real.sqrt_ne_zero'.mpr (lt_of_le_of_ne (hF0 x) (Ne.symm hz)))) + +theorem eventRootDerivative_measurable {n : ℕ} {F : Configuration n → ℝ} + (hF : ContDiff ℝ ∞ F) (i : Fin n) (a : Fin 3) : + Measurable (eventRootDerivative F i a) := + (((hF.continuous_fderiv (by simp)).clm_apply continuous_const).measurable).div + (measurable_const.mul (Real.continuous_sqrt.comp hF.continuous).measurable) + +theorem eventRootDerivative_bound {n : ℕ} {F : Configuration n → ℝ} + {K : ℝ} (hK : 0 ≤ K) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + (i : Fin n) (a : Fin 3) (x : Configuration n) : + |eventRootDerivative F i a x| ≤ Real.sqrt (K/4*(1+120*Real.exp 1)) := by + apply Real.abs_le_sqrt + apply (coordinate_square_le_sum (fun i a => eventRootDerivative F i a x) i a).trans + exact (eventRootDerivative_gradient_bound hK hF0 hF1 hgrad x).trans (by + rw [mul_assoc] + exact mul_le_mul_of_nonneg_left (likelihood_log_fifth_bounded (hF0 x) (hF1 x)) + (div_nonneg hK (by norm_num))) + +theorem FormDomain.eventRoot {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {F : Configuration n → ℝ} {K : ℝ} + (hK : 0 ≤ K) (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hsym : ∀ (p : Equiv.Perm (Fin n)) x, F (x ∘ p) = F x) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) : + FormDomain (multiplyWavefunction (fun x => Real.sqrt (F x)) ψ) + (explicitMultiplyGradient (fun x => Real.sqrt (F x)) (eventRootDerivative F) ψ g) := by + apply hd.multiply_limit (θk := regularizedEventRoot F) + (Real.continuous_sqrt.comp hF.continuous) (fun p x => by dsimp only [Function.comp_apply]; rw [hsym p x]) + (fun i a => (eventRootDerivative_measurable hF i a).aestronglyMeasurable) + (regularizedEventRoot_contDiff hF hF0) + ⟨Real.sqrt 2, regularizedEventRoot_bound hF1⟩ + (fun i a => ⟨_, fun k x => regularizedEventRoot_derivative_bound hK hF hF0 hF1 hgrad k i a x⟩) + (regularizedEventRoot_tendsto F) + (regularizedEventRoot_derivative_tendsto hF hF0 hgrad) + +theorem likelihood_smoothMultiplier {n : ℕ} {F : Configuration n → ℝ} {K : ℝ} + (hK : 0 ≤ K) (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hsym : ∀ (p : Equiv.Perm (Fin n)) x, F (x ∘ p) = F x) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) : SmoothMultiplier F := by + refine ⟨hF, hsym, ⟨1, fun x => by rw [abs_of_nonneg (hF0 x)]; exact hF1 x⟩, ?_⟩ + intro i a + refine ⟨Real.sqrt (K*(1+120*Real.exp 1)), fun x => Real.abs_le_sqrt ?_⟩ + apply (coordinate_square_le_sum (fun i a => fderiv ℝ F x (coordinateDirection i a)) i a).trans + apply (hgrad x).trans + calc + K * F x^2 * (1-Real.log (F x))^5 = K * F x * (F x * (1-Real.log (F x))^5) := by ring + _ ≤ K * 1 * (1+120*Real.exp 1) := + mul_le_mul (mul_le_mul_of_nonneg_left (hF1 x) hK) + (likelihood_log_fifth_bounded (hF0 x) (hF1 x)) + (likelihood_log_fifth_nonneg (hF0 x) (hF1 x)) (by positivity) + _ = _ := by ring + +theorem eventRoot_square_derivative {n : ℕ} {F : Configuration n → ℝ} {K : ℝ} + (hF0 : ∀ x, 0 ≤ F x) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + (i : Fin n) (a : Fin 3) (x : Configuration n) : + fderiv ℝ (fun y => (Real.sqrt (F y))^2) x (coordinateDirection i a) = + 2*Real.sqrt (F x)*eventRootDerivative F i a x := by + simp_rw [Real.sq_sqrt (hF0 _)] + unfold eventRootDerivative + by_cases hz : F x = 0 + · rw [likelihood_gradient_zero hgrad hz i a]; simp + · field_simp [Real.sqrt_ne_zero'.mpr (lt_of_le_of_ne (hF0 x) (Ne.symm hz))] + +theorem stateWeighted_integrable {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) {F : Configuration n → ℝ} (hF : Measurable F) + {C : ℝ} (hFb : ∀ x, |F x| ≤ C) (σ : Spins n) : + Integrable (fun x => F x * ‖ψ σ x‖^2) := + (hd.2.2.1 σ).norm.integrable_sq.bdd_mul hF.aestronglyMeasurable + (Eventually.of_forall fun x => by simpa only [Real.norm_eq_abs] using hFb x) + +theorem stateWeightedIntegral_le_one {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + {F : Configuration n → ℝ} (hF : Measurable F) + (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) : stateWeightedIntegral ψ F ≤ 1 := by + rw [← hn] + apply Finset.sum_le_sum + intro σ _ + apply integral_mono (stateWeighted_integrable hd hF (C := 1) + (fun x => by rw [abs_of_nonneg (hF0 x)]; exact hF1 x) σ) (hd.2.2.1 σ).norm.integrable_sq + intro x + exact mul_le_of_le_one_left (sq_nonneg _) (hF1 x) + +theorem stateWeightedIntegral_log_fifth {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + {F : Configuration n → ℝ} (hF : Measurable F) + (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hp : 0 < stateWeightedIntegral ψ F) : + stateWeightedIntegral ψ (fun x => F x*(1-Real.log (F x))^5) ≤ + (1+120*Real.exp 1)*stateWeightedIntegral ψ F* + (1-Real.log (stateWeightedIntegral ψ F))^5 := by + let p := stateWeightedIntegral ψ F + have hp1 : p ≤ 1 := stateWeightedIntegral_le_one hd hn hF hF0 hF1 + have hfi (σ : Spins n) := stateWeighted_integrable hd hF (C := 1) + (fun x => by rw [abs_of_nonneg (hF0 x)]; exact hF1 x) σ + have hli (σ : Spins n) := stateWeighted_integrable hd + (F := fun x => F x*(1-Real.log (F x))^5) + (hF.mul ((measurable_const.sub hF.log).pow_const 5)) + (C := 1+120*Real.exp 1) + (fun x => by rw [abs_of_nonneg (likelihood_log_fifth_nonneg (hF0 x) (hF1 x))] + exact likelihood_log_fifth_bounded (hF0 x) (hF1 x)) σ + have hh (σ : Spins n) : + (∫ x, (F x*(1-Real.log (F x))^5)*‖ψ σ x‖^2) ≤ + ((∫ x, F x*‖ψ σ x‖^2) + 120*Real.exp 1*p*(∫ x, ‖ψ σ x‖^2))* + (1-Real.log p)^5 := by + calc + _ ≤ ∫ x, ((F x+120*Real.exp 1*p)*‖ψ σ x‖^2)*(1-Real.log p)^5 := by + apply integral_mono (hli σ) + (((hfi σ).add ((hd.2.2.1 σ).norm.integrable_sq.const_mul (120*Real.exp 1*p))).mul_const ((1-Real.log p)^5) |>.congr + (Eventually.of_forall fun x => by dsimp only [Pi.add_apply]; ring)) + intro x + have ht := mul_le_mul_of_nonneg_right + (likelihood_log_fifth_majorant (hF0 x) (hF1 x) hp hp1) (sq_nonneg ‖ψ σ x‖) + nlinarith only [ht] + _ = _ := by + rw [integral_mul_const] + congr 1 + simp_rw [add_mul] + rw [integral_add (hfi σ) ((hd.2.2.1 σ).norm.integrable_sq.const_mul (120*Real.exp 1*p)), + integral_const_mul] + have hs := Finset.sum_le_sum (fun σ (_ : σ ∈ (Finset.univ : Finset (Spins n))) => hh σ) + simp only [← Finset.sum_mul, Finset.sum_add_distrib, ← Finset.mul_sum] at hs + change stateWeightedIntegral ψ (fun x => F x*(1-Real.log (F x))^5) ≤ + (p+120*Real.exp 1*p*normSquared ψ)*(1-Real.log p)^5 at hs + rw [hn] at hs + convert hs using 1 + dsimp only [p] + ring + +theorem explicitLocalizationError_eventRoot_le {n : ℕ} + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) + (hn : normSquared ψ = 1) {F : Configuration n → ℝ} {K : ℝ} + (hK : 0 ≤ K) (hF : ContDiff ℝ ∞ F) (hF0 : ∀ x, 0 ≤ F x) (hF1 : ∀ x, F x ≤ 1) + (hgrad : ∀ x, (∑ i, ∑ a, (fderiv ℝ F x (coordinateDirection i a))^2) ≤ + K * (F x)^2 * (1-Real.log (F x))^5) + (hp : 0 < stateWeightedIntegral ψ F) : + explicitLocalizationError ψ (eventRootDerivative F) ≤ + K/8*(1+120*Real.exp 1)*stateWeightedIntegral ψ F* + (1-Real.log (stateWeightedIntegral ψ F))^5 := by + have hdi (σ : Spins n) (i : Fin n) (a : Fin 3) : + Integrable (fun x => (eventRootDerivative F i a x)^2*‖ψ σ x‖^2) := by + have hl := memLp_bounded_measurable_real_smul (hd.2.2.1 σ) + (eventRootDerivative_measurable hF i a).aestronglyMeasurable + ⟨_, eventRootDerivative_bound hK hF0 hF1 hgrad i a⟩ + simpa only [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] using hl.norm.integrable_sq + have hli (σ : Spins n) := stateWeighted_integrable hd + (F := fun x => F x*(1-Real.log (F x))^5) + (hF.continuous.measurable.mul ((measurable_const.sub hF.continuous.measurable.log).pow_const 5)) + (C := 1+120*Real.exp 1) + (fun x => by rw [abs_of_nonneg (likelihood_log_fifth_nonneg (hF0 x) (hF1 x))] + exact likelihood_log_fifth_bounded (hF0 x) (hF1 x)) σ + have hs (σ : Spins n) : + (∑ i, ∑ a, ∫ x, (eventRootDerivative F i a x)^2*‖ψ σ x‖^2) ≤ + K/4 * ∫ x, (F x*(1-Real.log (F x))^5)*‖ψ σ x‖^2 := by + calc + _ = ∫ x, (∑ i, ∑ a, (eventRootDerivative F i a x)^2)*‖ψ σ x‖^2 := by + simp_rw [Finset.sum_mul] + rw [integral_finsetSum _ (fun i _ => integrable_finsetSum _ (fun a _ => hdi σ i a))] + apply Finset.sum_congr rfl + intro i _ + exact (integral_finsetSum _ (fun a _ => hdi σ i a)).symm + _ ≤ ∫ x, K/4*((F x*(1-Real.log (F x))^5)*‖ψ σ x‖^2) := by + apply integral_mono + · simpa only [Finset.sum_mul] using + integrable_finsetSum _ (fun i _ => integrable_finsetSum _ (fun a _ => hdi σ i a)) + · exact (hli σ).const_mul _ + · intro x + have hh := mul_le_mul_of_nonneg_right + (eventRootDerivative_gradient_bound hK hF0 hF1 hgrad x) (sq_nonneg ‖ψ σ x‖) + nlinarith only [hh] + _ = _ := integral_const_mul _ _ + have hh := mul_le_mul_of_nonneg_left (Finset.sum_le_sum + (fun σ (_ : σ ∈ (Finset.univ : Finset (Spins n))) => hs σ)) (by norm_num : (0:ℝ) ≤ 1/2) + simp only [← Finset.mul_sum] at hh + change explicitLocalizationError ψ (eventRootDerivative F) ≤ + (1/2)*(K/4*stateWeightedIntegral ψ (fun x => F x*(1-Real.log (F x))^5)) at hh + apply hh.trans + have hlog := mul_le_mul_of_nonneg_left + (stateWeightedIntegral_log_fifth hd hn hF.continuous.measurable hF0 hF1 hp) + (div_nonneg hK (by norm_num : (0:ℝ) ≤ 8)) + nlinarith only [hlog] + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservedUnordered.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservedUnordered.lean new file mode 100644 index 0000000000000000000000000000000000000000..34df70fed2be74fd31b6ec3485970db3e1b0b8b5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ObservedUnordered.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalMatching + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace NeutralAtom + +def unorderedSum {n : ℕ} (f : Position → ℝ) : UnorderedArray n → ℝ := + Quotient.lift (fun x : Configuration n => ∑ i, f (x i)) (by + rintro x y ⟨p,rfl⟩ + exact (Equiv.sum_comp p (fun i => f (x i))).symm) + +@[simp] theorem unorderedSum_forgetOrder {n : ℕ} (f : Position → ℝ) (x : Configuration n) : + unorderedSum f (forgetOrder x)=∑ i, f (x i) := rfl + +lemma measurable_unorderedSum {n : ℕ} {f : Position → ℝ} (hf : Measurable f) : + Measurable (unorderedSum (n := n) f) := by + intro s hs + change MeasurableSet ((fun x : Configuration n => ∑ i, f (x i)) ⁻¹' s) + exact (Finset.measurable_sum _ (fun i _ => hf.comp (measurable_pi_apply i))) hs + +lemma unorderedSum_bound {n : ℕ} (f : Position → ℝ) {M : ℝ} + (hf : ∀ x, |f x|≤M) (v : UnorderedArray n) : |unorderedSum f v|≤(n:ℝ)*M := by + induction v using Quotient.inductionOn with | h x => + change |∑ i, f (x i)|≤_ + exact (Finset.abs_sum_le_sum_abs _ _).trans + ((Finset.sum_le_sum (fun i _ => hf (x i))).trans_eq (by simp)) + +lemma observationNoiseLaw_ae_support : ∀ᵐ u ∂observationNoiseLaw, |u|<1 := by + rw [observationNoiseLaw,ae_withDensity_iff observationNoiseDensity_contDiff.continuous.measurable.ennreal_ofReal] + filter_upwards [] with u hu + by_contra hn + apply hu + simp [observationNoiseDensity_formula,hn] + +lemma allObservationNoiseLaw_ae_support (n J : ℕ) : + ∀ᵐ u ∂allObservationNoiseLaw n J, ∀ j i a, |u j i a|<1 := by + simp only [ae_all_iff] + intro j i a + exact ((measurePreserving_eval (fun _ : Fin 3 => observationNoiseLaw) a).comp + ((measurePreserving_eval (fun _ : Fin n => Measure.pi (fun _ : Fin 3 => observationNoiseLaw)) i).comp + (measurePreserving_eval (fun _ : Fin J => Measure.pi (fun _ : Fin n => Measure.pi (fun _ : Fin 3 => observationNoiseLaw))) j))).quasiMeasurePreserving.ae observationNoiseLaw_ae_support + +lemma observationNoiseVector_norm_le {v : Fin 3 → ℝ} (hv : ∀ a, |v a|≤1) : + ‖observationNoiseVector v‖≤Real.sqrt 3 := by + apply (sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mp + rw [EuclideanSpace.real_norm_sq_eq,Real.sq_sqrt (by norm_num : (0:ℝ)≤3)] + calc + _≤∑ _a : Fin 3, (1:ℝ) := Finset.sum_le_sum (fun a _ => by + rw [observationNoiseVector_coordinate] + nlinarith [(abs_le.mp (hv a)).1,(abs_le.mp (hv a)).2]) + _=_ := by norm_num + +lemma observationLaw_ae_displacement {n J : ℕ} (ν : Measure (Configuration n)) + [IsProbabilityMeasure ν] (r : Fin J → ℝ) (hR : ∀ k, 0≤r k) : + ∀ᵐ z ∂observationLaw J ν, ∀ j i, + ‖z.1 i-observedOrdered r j z i‖≤Real.sqrt 3*(r j)^(101/100:ℝ) := by + have hh : ∀ᵐ z ∂observationLaw J ν, ∀ j i a, |z.2 j i a|<1 := + measurePreserving_snd.quasiMeasurePreserving.ae (allObservationNoiseLaw_ae_support n J) + filter_upwards [hh] with z hz j i + have hn := observationNoiseVector_norm_le (fun a => (hz j i a).le) + rw [observedOrdered,sub_add_cancel_left,norm_neg,norm_smul,Real.norm_eq_abs, + abs_of_nonneg (Real.rpow_nonneg (hR j) _)] + simpa [mul_comm] using mul_le_mul_of_nonneg_left hn (Real.rpow_nonneg (hR j) _) + +lemma unorderedSum_tail_stronglyMeasurable {n J : ℕ} (r : Fin J → ℝ) (j : ℕ) + (k : Fin J) {f : Position → ℝ} (hf : Measurable f) : + StronglyMeasurable[observationSigma (n := n) r j] + (fun z => unorderedSum f (tailObservation r j z k)) := + ((measurable_unorderedSum hf).comp ((measurable_pi_apply k).comp + (comap_measurable (tailObservation r j)))).stronglyMeasurable + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace NeutralAtom + +theorem physical_posterior_kernel_matching (g : 𝓢(Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g z=0) (hgn : (∫ z, g z^2)=1) : + ∃ C : ℝ, 0 rawPacketDensity g c r₀ s (observedOrdered r k z) y + let e := fun z : ObservationSample n J => (A*d)*rawCount (Metric.closedBall y (2*t+d)) (observedOrdered r k z) + have hvmeas : StronglyMeasurable[observationSigma r j] v := by + have HH := unorderedSum_tail_stronglyMeasurable (n := n) r j k + (((continuous_packetKernel g.continuous hc hr hs).comp + (continuous_id.prodMk (continuous_const (y := y)))).measurable) + simpa only [v,tailObservation,ite_eq_left hj,observedArray,unorderedSum_forgetOrder,rawPacketDensity,Function.comp_apply,id_eq] using HH + have hemeas : StronglyMeasurable[observationSigma r j] e := by + have HH := unorderedSum_tail_stronglyMeasurable (n := n) r j k + (measurable_const.indicator (s := Metric.closedBall y (2*t+d)) measurableSet_closedBall : + Measurable ((Metric.closedBall y (2*t+d)).indicator (fun _ => (1:ℝ)))) + have HHH := HH.const_mul (A*d) + simpa only [e,tailObservation,ite_eq_left hj,observedArray,unorderedSum_forgetOrder,rawCount] using HHH + have hgs : HasCompactSupport (g : Position → ℝ) := by + apply HasCompactSupport.intro (K := Metric.closedBall 0 1) (isCompact_closedBall _ _) + intro z hz + apply hg + simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz + have hf : Integrable (fun z : ObservationSample n J => rawPacketDensity g c r₀ s z.1 y) P := + (observationLaw_rawProjection ν).integrable_comp_of_integrable + (rawPacketDensity_integrable_configuration g.continuous hgs hc hr hs ν y) + have hv : Integrable v P := by + apply Integrable.of_bound (hvmeas.mono (observationSigma_le _ _)).aestronglyMeasurable ((n:ℝ)*(C/t^3)) + filter_upwards [] with z + rw [Real.norm_eq_abs] + exact (Finset.abs_sum_le_sum_abs _ _).trans + ((Finset.sum_le_sum (fun i _ => hamp (observedOrdered r k z i))).trans_eq (by simp [t])) + have he : Integrable e P := by + apply Integrable.of_bound (hemeas.mono (observationSigma_le _ _)).aestronglyMeasurable ((A*d)*(n:ℝ)) + filter_upwards [] with z + rw [Real.norm_of_nonneg (mul_nonneg (mul_nonneg hA hd) (rawCount_nonneg _ _))] + exact mul_le_mul_of_nonneg_left (rawCount_le_number _ _) (mul_nonneg hA hd) + have hcomp : ∀ᵐ z ∂P, |rawPacketDensity g c r₀ s z.1 y-v z|≤e z := by + filter_upwards [observationLaw_ae_displacement ν r hR] with z hz + apply kernel_sum_matching _ y hA hd ?_ hL z.1 (observedOrdered r k z) (hz k) + intro u hu + by_contra hn + have hh := hsp u hn + rw [norm_sub_rev] at hh + linarith + have HH := condExp_matching (observationSigma_le r j) hf hv he hvmeas hemeas hcomp + have He := conditionalPacketDensity_eq_condExp (observationLaw J ν) ν + (observationLaw_rawProjection ν) (measurable_tailObservation r j) g.continuous hgs hc hr hs y + filter_upwards [HH,He] with z hz he + rw [he] + exact hz + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalBandEvent.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalBandEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bf6cec0ec934338747c8393f9339c4e012d2543 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalBandEvent.lean @@ -0,0 +1,192 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.BandOscillation +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorCount +import OAI.Analysis.CoulombRadii.Packets.PacketBandGeometry +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorSpatialCap +import OAI.Analysis.CoulombRadii.Packets.NormalizedBandModulus + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_posterior_band_event (g : 𝓢(Position,ℝ)) + (hg : ∀ z,1 < ‖z‖ → g z=0) : + ∃ B D : ℝ,0 ≤ B ∧ 0 ≤ D ∧ + ∀ {n J : ℕ} (ν : Measure (Configuration n)) [IsProbabilityMeasure ν], + ∀ {c r₀ s r L : ℝ},0 < c → 0 < r₀ → 0 < s → 0 < r → 1 ≤ L → r₀ ≤ r → r ≤ s → + c*(1+packetExponent)*s^packetExponent ≤ 1/4 → c*s^packetExponent ≤ 1/100 → + ∀ (rads : Fin J → ℝ),(∀ k,0 ≤ rads k) → ∀ {j : ℕ} (k : Fin J),j ≤ k.val → + Real.sqrt 3*(rads k)^(101/100:ℝ) ≤ r/12 → + ∃ G : Set (ObservationSample n J), + (MeasurableSet G ∧ MeasurableSet[observationSigma rads j] G) ∧ + (observationLaw J ν) Gᶜ=0 ∧ ∀ sample∈G, + let μ := conditionalPacketDensity (observationLaw J ν) Prod.fst (tailObservation rads j) + g c r₀ s (tailObservation rads j sample) + let m := rawCount {x : Position | r/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*r} (observedOrdered rads k sample) + let τ := c*(r/3)*(r/3)^packetExponent + (∀ y : Position,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → μ y ≤ (B/τ^3)*m) ∧ + (∀ y z : Position,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → r/2 ≤ ‖z‖ → ‖z‖ ≤ 8*L*r → + |μ y-μ z| ≤ (D/τ^4)*‖y-z‖*m) := by + obtain ⟨B,D,hB,hD,hbound,hlip⟩ := schwartz_square_bounded_lipschitz g + refine ⟨B,D,hB,hD,?_⟩ + intro n J ν hν c r₀ s r L hc hr₀ hs hr hL hrr₀ hrs hscale hwidth rads hrads j k hk hnoise + let S := {x : Position | r/3 ≤ ‖x‖ ∧ ‖x‖ ≤ 10*L*r} + let T := {x : Position | r/2 ≤ ‖x‖ ∧ ‖x‖ ≤ 8*L*r} + let O := {x : Position | r/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*r} + have hS : MeasurableSet S := (measurableSet_le measurable_const measurable_norm).inter + (measurableSet_le measurable_norm measurable_const) + have hO : MeasurableSet O := (measurableSet_le measurable_const measurable_norm).inter + (measurableSet_le measurable_norm measurable_const) + have hgs : HasCompactSupport (g : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun z hz => hg z + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hpost := posterior_count_le_observed ν rads hrads k hk hS hO + (fun x hx y hxy => packet_band_observation_support hr hL hnoise hx hxy) + let obs := tailObservation (n:=n) rads j + let P := observationLaw J ν + let C := fun datum : Fin J → UnorderedArray n => + ∫ x,rawCount S x ∂ProbabilityTheory.condDistrib Prod.fst obs P datum + let M := fun datum : Fin J → UnorderedArray n => + unorderedSum (O.indicator (fun _ => (1:ℝ))) (datum k) + have hC : Measurable C := ((measurable_rawCount hS).stronglyMeasurable.integral_kernel + (κ:=ProbabilityTheory.condDistrib Prod.fst obs P)).measurable + have hM : Measurable M := (measurable_unorderedSum + (measurable_const.indicator hO)).comp (measurable_pi_apply k) + let G := obs ⁻¹' {datum | C datum ≤ M datum} + have hM_eq (sample : ObservationSample n J) : M (obs sample)= + rawCount O (observedOrdered rads k sample) := by + exact unorderedSum_tailObservation rads k hk _ sample + have hG : MeasurableSet G := (measurableSet_le hC hM).preimage (measurable_tailObservation rads j) + have hGt : MeasurableSet[observationSigma rads j] G := + ⟨{datum | C datum ≤ M datum},measurableSet_le hC hM,rfl⟩ + have hGae : ∀ᵐ sample ∂P,sample∈G := by + filter_upwards [hpost] with sample hh + change C (obs sample) ≤ M (obs sample) + rw [hM_eq] + exact hh + refine ⟨G,⟨hG,hGt⟩,by exact ae_iff.mp hGae,?_⟩ + intro sample hsamp + have hh : C (obs sample) ≤ rawCount O (observedOrdered rads k sample) := by + have hh : C (obs sample) ≤ M (obs sample) := hsamp + rwa [hM_eq] at hh + let ν' := ProbabilityTheory.condDistrib Prod.fst (tailObservation rads j) (observationLaw J ν) + (tailObservation rads j sample) + have hτ : 0 < c*(r/3)*(r/3)^packetExponent := by positivity + have H := mixture_packet_band_bounds ν' g.continuous hgs hB hD hbound hlip hc hr₀ hs hτ hS + (T:=T) (fun y hy x hx => packet_band_center_support hg hc hr₀ hs hr hL hrr₀ hscale hwidth hy.1 hy.2 hx) + (fun x hx => packet_band_width_lower hc hr₀ hs hr hrs hx.1) + dsimp only + constructor + · intro y hy0 hy1 + exact (H.1 y ⟨hy0,hy1⟩).trans (mul_le_mul_of_nonneg_left hh (by positivity)) + · intro y z hy0 hy1 hz0 hz1 + exact (H.2 y ⟨hy0,hy1⟩ z ⟨hz0,hz1⟩).trans (mul_le_mul_of_nonneg_left hh (by positivity)) +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma posterior_mesh_modulus {Ω Data : Type*} [MeasurableSpace Ω] [MeasurableSpace Data] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] + (raw : Ω → Configuration n) (obs : Ω → Data) (g : Position → ℝ) + {c r₀ s : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) + (datum : Data) (Z : ℝ) {r L τ B D K C : ℝ} + (hr : 0 < r) (hL : 1 ≤ L) (hτ : 0 < τ) (hτr : τ ≤ r) + (hrsmall : r ≤ 1/16) (hB : 0 ≤ B) (hD : 0 ≤ D) (hK : 0 ≤ K) (hC : 0 ≤ C) + (hden : ∀ y,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → + conditionalPacketDensity P raw obs g c r₀ s datum y ≤ (B/τ^3)*(K/r^3)) + (hlip : ∀ y z,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → r/2 ≤ ‖z‖ → ‖z‖ ≤ 8*L*r → + |conditionalPacketDensity P raw obs g c r₀ s datum z- + conditionalPacketDensity P raw obs g c r₀ s datum y| ≤ (D/τ^4)*‖z-y‖*(K/r^3)) + (hcap : ∀ y,3*r/4 ≤ ‖y‖ → ‖y‖ ≤ 6*L*r → + ‖y‖^4*(Z*coulombKernel y-potentialOf (conditionalPacketDensity P raw obs g c r₀ s datum) y) ≤ physicalSpatialCap) + (hosc : ∀ y z,r ≤ ‖y‖ → ‖y‖ ≤ 4*L*r → ‖z-y‖ ≤ r/16 → + let F := fun x => Z*coulombKernel x-potentialOf (conditionalPacketDensity P raw obs g c r₀ s datum) x + ‖F z-F y‖ ≤ C*(‖z-y‖/r)*((r/τ)^3/r^4+max (-F y) 0)) + {y z : Position} (hy0 : r ≤ ‖y‖) (hy1 : ‖y‖ ≤ 4*L*r) + (hz0 : r ≤ ‖z‖) (hz1 : ‖z‖ ≤ 4*L*r) (hdist : ‖z-y‖ ≤ r^2) : + let ρ := conditionalPacketDensity P raw obs g c r₀ s datum + let U := fun x => ‖x‖^4*(Z*coulombKernel x-potentialOf ρ x) + |‖z‖^6*ρ z-‖y‖^6*ρ y| ≤ + ((4*L)^6*(D*K)+6*(4*L)^5*(B*K))*(r*(r/τ)^4) ∧ + |U z-U y| ≤ (((4*L)^4*C+4*(4*L)^3*max physicalSpatialCap 1)*r)* + ((r/τ)^3+max (-U y) 0) := by + let ρ := conditionalPacketDensity P raw obs g c r₀ s datum + let F := fun x => Z*coulombKernel x-potentialOf ρ x + have hLr : 0 ≤ L*r := mul_nonneg (by linarith) hr.le + have hylo : r/2 ≤ ‖y‖ := by linarith + have hyhi : ‖y‖ ≤ 8*L*r := by nlinarith + have hzlo : r/2 ≤ ‖z‖ := by linarith + have hzhi : ‖z‖ ≤ 8*L*r := by nlinarith + dsimp only + constructor + · exact mesh_normalized_density_bound hr hL hτ hτr hB hD hK hy0 hy1 hz0 hz1 hdist + (conditionalPacketDensity_nonneg P raw obs g hc hr₀ hs datum y) + (hden y hylo hyhi) (hlip y z hylo hyhi hzlo hzhi) + · have hd : ‖z-y‖ ≤ r/16 := hdist.trans (by nlinarith) + have HH := normalized_field_difference (F:=F) (lam:=(r/τ)^3) hr hL hC physicalSpatialCap_pos.le + (one_le_pow₀ ((le_div_iff₀ hτ).mpr (by simpa using hτr))) hy0 hy1 hz0 hz1 + (hcap y (by linarith) (by nlinarith)) (by simpa only [Real.norm_eq_abs] using hosc y z hy0 hy1 hd) + apply HH.trans + have hratio : ‖z-y‖/r ≤ r := (div_le_iff₀ hr).mpr (by nlinarith) + gcongr +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma measurable_tailObservation_for_sigma {n J : ℕ} (r : Fin J → ℝ) (j : ℕ) : + Measurable[observationSigma r j] (tailObservation (n:=n) r j) := + measurable_iff_comap_le.mpr le_rfl + +lemma measurable_observed_count_tail {n J : ℕ} (r : Fin J → ℝ) {j : ℕ} (k : Fin J) + (hk : j ≤ k.val) {S : Set Position} (hS : MeasurableSet S) : + Measurable[observationSigma r j] + (fun z : ObservationSample n J => rawCount S (observedOrdered r k z)) := by + have HM : Measurable (fun datum : Fin J → UnorderedArray n => + unorderedSum (S.indicator (fun _ => (1:ℝ))) (datum k)) := + (measurable_unorderedSum (measurable_const.indicator hS)).comp (measurable_pi_apply k) + have H := HM.comp (measurable_tailObservation_for_sigma r j) + convert H using 1 + funext z + exact (unorderedSum_tailObservation r k hk _ z).symm + +lemma measurable_normalized_posterior_density_tail {n J : ℕ} + (P : Measure (ObservationSample n J)) [IsFiniteMeasure P] + (r : Fin J → ℝ) (j : ℕ) {g : Position → ℝ} (hg : Continuous g) + {c r₀ s : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) (y : Position) : + Measurable[observationSigma r j] (fun z => ‖y‖^6* + conditionalPacketDensity P Prod.fst (tailObservation r j) g c r₀ s (tailObservation r j z) y) := + measurable_const.mul ((measurable_conditionalPacketDensity_data P Prod.fst + (tailObservation r j) hg hc hr₀ hs y).comp (measurable_tailObservation_for_sigma r j)) + +lemma measurable_normalized_posterior_field_tail {n J : ℕ} + (P : Measure (ObservationSample n J)) [IsFiniteMeasure P] + (r : Fin J → ℝ) (j : ℕ) {g : Position → ℝ} (hg : Continuous g) + (hgs : HasCompactSupport g) (hm : (∫ z,g z^2)=1) + {c r₀ s : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) (Z : ℝ) (y : Position) : + Measurable[observationSigma r j] (fun z => ‖y‖^4*(Z*coulombKernel y-potentialOf + (conditionalPacketDensity P Prod.fst (tailObservation r j) g c r₀ s (tailObservation r j z)) y)) := + measurable_const.mul (measurable_const.sub + ((measurable_conditionalPacketPotential_data P Prod.fst (tailObservation r j) hg hgs hm hc hr₀ hs y).comp + (measurable_tailObservation_for_sigma r j))) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalBandRegularity.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalBandRegularity.lean new file mode 100644 index 0000000000000000000000000000000000000000..08d8b27c7a4bbc278521777521bc6f5b441cc298 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalBandRegularity.lean @@ -0,0 +1,63 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.BandOscillation +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorCount +import OAI.Analysis.CoulombRadii.Packets.PacketBandGeometry + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_posterior_band_bounds (g : 𝓢(Position,ℝ)) + (hg : ∀ z,1 < ‖z‖ → g z=0) : + ∃ B D : ℝ,0 ≤ B ∧ 0 ≤ D ∧ + ∀ {n J : ℕ} (ν : Measure (Configuration n)) [IsProbabilityMeasure ν], + ∀ {c r₀ s r L : ℝ},0 < c → 0 < r₀ → 0 < s → 0 < r → 1 ≤ L → r₀ ≤ r → r ≤ s → + c*(1+packetExponent)*s^packetExponent ≤ 1/4 → c*s^packetExponent ≤ 1/100 → + ∀ (rads : Fin J → ℝ),(∀ k,0 ≤ rads k) → ∀ {j : ℕ} (k : Fin J),j ≤ k.val → + Real.sqrt 3*(rads k)^(101/100:ℝ) ≤ r/12 → + ∀ᵐ sample ∂observationLaw J ν, + let μ := conditionalPacketDensity (observationLaw J ν) Prod.fst (tailObservation rads j) + g c r₀ s (tailObservation rads j sample) + let m := rawCount {x : Position | r/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*r} (observedOrdered rads k sample) + let τ := c*(r/3)*(r/3)^packetExponent + (∀ y : Position,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → μ y ≤ (B/τ^3)*m) ∧ + (∀ y z : Position,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → r/2 ≤ ‖z‖ → ‖z‖ ≤ 8*L*r → + |μ y-μ z| ≤ (D/τ^4)*‖y-z‖*m) := by + obtain ⟨B,D,hB,hD,hbound,hlip⟩ := schwartz_square_bounded_lipschitz g + refine ⟨B,D,hB,hD,?_⟩ + intro n J ν hν c r₀ s r L hc hr₀ hs hr hL hrr₀ hrs hscale hwidth rads hrads j k hk hnoise + let S := {x : Position | r/3 ≤ ‖x‖ ∧ ‖x‖ ≤ 10*L*r} + let T := {x : Position | r/2 ≤ ‖x‖ ∧ ‖x‖ ≤ 8*L*r} + let O := {x : Position | r/4 ≤ ‖x‖ ∧ ‖x‖ ≤ 12*L*r} + have hS : MeasurableSet S := (measurableSet_le measurable_const measurable_norm).inter + (measurableSet_le measurable_norm measurable_const) + have hO : MeasurableSet O := (measurableSet_le measurable_const measurable_norm).inter + (measurableSet_le measurable_norm measurable_const) + have hgs : HasCompactSupport (g : Position → ℝ) := HasCompactSupport.intro + (isCompact_closedBall (0:Position) 1) (fun z hz => hg z + (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hpost := posterior_count_le_observed ν rads hrads k hk hS hO + (fun x hx y hxy => packet_band_observation_support hr hL hnoise hx hxy) + filter_upwards [hpost] with sample hh + let ν' := ProbabilityTheory.condDistrib Prod.fst (tailObservation rads j) (observationLaw J ν) + (tailObservation rads j sample) + have hτ : 0 < c*(r/3)*(r/3)^packetExponent := by positivity + have H := mixture_packet_band_bounds ν' g.continuous hgs hB hD hbound hlip hc hr₀ hs hτ hS + (T:=T) (fun y hy x hx => packet_band_center_support hg hc hr₀ hs hr hL hrr₀ hscale hwidth hy.1 hy.2 hx) + (fun x hx => packet_band_width_lower hc hr₀ hs hr hrs hx.1) + dsimp only + constructor + · intro y hy0 hy1 + exact (H.1 y ⟨hy0,hy1⟩).trans (mul_le_mul_of_nonneg_left hh (by positivity)) + · intro y z hy0 hy1 hz0 hz1 + exact (H.2 y ⟨hy0,hy1⟩ z ⟨hz0,hz1⟩).trans (mul_le_mul_of_nonneg_left hh (by positivity)) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalDeficitMoment.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalDeficitMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..4a68b31fecac752463337fb40460c9fd6302a604 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalDeficitMoment.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservedUnordered +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalDeficitTail +import OAI.Analysis.CoulombRadii.Screening.DeficitMoment + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators Classical +noncomputable section +namespace NeutralAtom + +theorem physical_observed_positive_deficit_second_moment {n J : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hE : (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g≤E+D₀) (hD : 0≤D₀) + (ℓ : Fin J → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : Fin J) {r a : ℝ} + (hr : 0 + max ((Z:ℝ)-rawCount (Metric.ball 0 a) + (observationArrayPositions h (observationCoordinateData ℓ sample))) 0 + let t : ℕ → ℝ := fun k => C*(1+(k:ℝ))^3 + have hC : 1≤C := by + dsimp [C,observedDeficitCoefficient] + have : 0≤2*Coulomb.atomicInnerFieldConstant*(Coulomb.screenBaseMass r+ + Real.sqrt ((D₀+observationEventEnergyConstant*observationWidthSquareSum ℓ)*r)) := + mul_nonneg (mul_nonneg (by norm_num) Coulomb.atomicInnerFieldConstant_nonneg) + (add_nonneg (Coulomb.screenBaseMass_nonneg r) (Real.sqrt_nonneg _)) + linarith + have ht : ∀ k, 0≤t k := fun k => mul_nonneg (by linarith) (by positivity) + have hf : Measurable f := + (measurable_const.sub ((measurable_rawCount measurableSet_ball).comp + ((measurable_observationArrayPositions h).comp (measurable_observationCoordinateData ℓ)))).max measurable_const + have hz : 0≤(Z:ℝ) := Nat.cast_nonneg _ + have hb : ∀ sample, f sample≤t Z := by + intro sample + have hfZ : f sample≤(Z:ℝ) := max_le + (sub_le_self _ (rawCount_nonneg _ _)) hz + have hp : (Z:ℝ)≤(1+(Z:ℝ))^3 := by nlinarith [sq_nonneg (Z:ℝ),pow_nonneg hz 3] + exact hfZ.trans (hp.trans (le_mul_of_one_le_left (by positivity) hC)) + have htail : ∀ k, (observationLaw J (rawLaw ψ)).real {sample | t k le_max_right _ _) t (fun k => Real.exp (-(k:ℝ))) ht Z hb htail + (summable_cubic_exponential_tail C) + simpa only [f,t,Nat.cast_zero,add_zero,one_pow,mul_one] using H +end NeutralAtom +end + +end +end +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +lemma observationCoordinateData_positions_linear {n J : ℕ} (ℓ : Fin J → ℝ) + (sample : ObservationSample n J) (j : Fin J) (i : Fin n) : + observationArrayPositions j (observationCoordinateData ℓ sample) i = + sample.1 i+ℓ j • observationNoiseVector (sample.2 j i) := by + ext a + simp [observationArrayPositions,observationCoordinateData,observationNoiseVector_coordinate] + +lemma observationLaw_ae_linear_displacement {n J : ℕ} (ν : Measure (Configuration n)) + [IsProbabilityMeasure ν] (ℓ : Fin J → ℝ) (hℓ : ∀ j, 0≤ℓ j) : + ∀ᵐ sample ∂observationLaw J ν, ∀ j i, + ‖observationArrayPositions j (observationCoordinateData ℓ sample) i-sample.1 i‖≤ + Real.sqrt 3*ℓ j := by + have hh : ∀ᵐ z ∂observationLaw J ν, ∀ j i a, |z.2 j i a|<1 := + measurePreserving_snd.quasiMeasurePreserving.ae (allObservationNoiseLaw_ae_support n J) + filter_upwards [hh] with z hz j i + rw [observationCoordinateData_positions_linear,add_sub_cancel_left,norm_smul, + Real.norm_eq_abs,abs_of_nonneg (hℓ j)] + exact (mul_le_mul_of_nonneg_left (observationNoiseVector_norm_le (fun a => (hz j i a).le)) + (hℓ j)).trans_eq (mul_comm _ _) + +lemma rawCount_flatten {n : ℕ} (A : Set Position) (x : Configuration n) : + Coulomb.localCount A (flattenConfiguration n x)=rawCount A x := by + simp only [Coulomb.localCount,rawCount,position_flattenConfiguration] + +lemma raw_positive_deficit_moment_le_observed {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + {Z : ℝ} (hZ : 0≤Z) (ℓ : Fin J → ℝ) (hℓ : ∀ j, 0≤ℓ j) + (j : Fin J) {a t : ℝ} (hat : a+Real.sqrt 3*ℓ j≤t) : + stateWeightedIntegral ψ (fun x => (max (Z-rawCount (Metric.ball 0 t) x) 0)^2) ≤ + ∫ sample, (max (Z-rawCount (Metric.ball 0 a) + (observationArrayPositions j (observationCoordinateData ℓ sample))) 0)^2 + ∂observationLaw J (rawLaw ψ) := by + let := rawLaw_isProbability hψ hn + let f : Configuration n → ℝ := fun x => (max (Z-rawCount (Metric.ball 0 t) x) 0)^2 + let g : ObservationSample n J → ℝ := fun sample => + (max (Z-rawCount (Metric.ball 0 a) + (observationArrayPositions j (observationCoordinateData ℓ sample))) 0)^2 + have hb (A : Set Position) (x : Configuration n) : ‖(max (Z-rawCount A x) 0)^2‖≤Z^2 := by + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (le_max_right _ _) (max_le (sub_le_self _ (rawCount_nonneg _ _)) hZ) 2 + have hf : Measurable f := ((measurable_const.sub (measurable_rawCount measurableSet_ball)).max measurable_const).pow_const 2 + have hg : Measurable g := ((measurable_const.sub ((measurable_rawCount measurableSet_ball).comp + ((measurable_observationArrayPositions j).comp (measurable_observationCoordinateData ℓ)))).max measurable_const).pow_const 2 + have hi : Integrable (fun z : ObservationSample n J => f z.1) (observationLaw J (rawLaw ψ)) := + (integrable_const (Z^2)).mono' (hf.comp measurable_fst).aestronglyMeasurable + (Eventually.of_forall (fun z => hb _ z.1)) + have hgi : Integrable g (observationLaw J (rawLaw ψ)) := + (integrable_const (Z^2)).mono' hg.aestronglyMeasurable + (Eventually.of_forall (fun z => hb _ _)) + have he : (∫ z : ObservationSample n J, f z.1 ∂observationLaw J (rawLaw ψ))= + stateWeightedIntegral ψ f := by + rw [observationLaw,integral_prod _ hi] + simp only [integral_const,probReal_univ,one_smul] + rw [integral_rawLaw hψ,rawExpectation_eq_stateWeightedIntegral hψ hf (fun x => hb _ x)] + rw [←he] + apply integral_mono_ae hi hgi + filter_upwards [observationLaw_ae_linear_displacement (rawLaw ψ) ℓ hℓ] with sample hs + dsimp [f,g] + apply pow_le_pow_left₀ (le_max_right _ _) + apply max_le_max_right + apply sub_le_sub_left + have H := raw_inner_observed_count_le + (observationArrayPositions j (observationCoordinateData ℓ sample)) sample.1 hat + (fun i => by simpa only [norm_sub_rev] using hs j i) + simpa only [rawCount_flatten] using H + +theorem physical_raw_positive_deficit_second_moment {n J : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hE : (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g≤E+D₀) (hD : 0≤D₀) + (ℓ : Fin J → ℝ) (hℓ : ∀ h, 0<ℓ h) (j : Fin J) {r a t : ℝ} + (hr : 0 (Coulomb.positiveInnerDeficit (Z:ℝ) (Metric.ball 0 t) x)^2) + (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) ≤ + (observedDeficitCoefficient ℓ D₀ r)^2+ + ∑' k : ℕ, (observedDeficitCoefficient ℓ D₀ r*(1+((k+1:ℕ):ℝ))^3)^2*Real.exp (-(k:ℝ)) := by + rw [asH1_potentialForm] + simp only [Coulomb.positiveInnerDeficit,rawCount_flatten] + exact (raw_positive_deficit_moment_le_observed hd.2.2.1 hn (Nat.cast_nonneg Z) ℓ + (fun j => (hℓ j).le) j hat).trans + (physical_observed_positive_deficit_second_moment Z hZ hd hn hmin hE hbase hD ℓ hℓ j hr hre) + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalDeficitTail.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalDeficitTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6f90f5620b8cecb3b8d5f9d6f1bfae464d5f42d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalDeficitTail.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationAnnulusTail +import OAI.Analysis.CoulombRadii.RandomFields.CoreGap + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators Classical +noncomputable section +namespace NeutralAtom + +theorem physical_observed_inner_deficit_tail {n J : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hE : (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g≤E+D₀) (hD : 0≤D₀) + (ℓ : Fin J → ℝ) (hℓ : ∀ h, 0<ℓ h) (h : Fin J) {r a T p₀ : ℝ} + (hr : 0 (hℓ h).ne') + (observed_deficit_event_measurable h Z a T)] + exact atomic_observed_inner_deficit_tail Z hZ hd hn hmin hE hbase hD ℓ hℓ h hr hp₀ hre hth + +lemma deficit_screening_exponential_cutoff {B K D r k : ℝ} + (hB : 0≤B) (hK : 0≤K) (hD : 0≤D) (hr : 0≤r) (hk : 0≤k) : + B*Coulomb.screenMass (D+K*(1-Real.log (Real.exp (-k)))^5) r < + (B*(Coulomb.screenBaseMass r+Real.sqrt ((D+K)*r))+1)*(1+k)^3 := by + rw [Real.log_exp] + have hv : 1≤1+k := by linarith + have h6 : 1≤(1+k)^6 := one_le_pow₀ hv + have h56 : (1+k)^5≤(1+k)^6 := by + calc + _ ≤ (1+k)^5*(1+k) := le_mul_of_one_le_right (by positivity) hv + _ = _ := by ring + have hδ : (D+K*(1- -k)^5)*r≤((D+K)*r)*((1+k)^3)^2 := by + have hD' := mul_le_mul_of_nonneg_left h6 hD + have hK' := mul_le_mul_of_nonneg_left h56 hK + have H : D+K*(1- -k)^5≤(D+K)*(1+k)^6 := by nlinarith + have H' := mul_le_mul_of_nonneg_right H hr + nlinarith + have hs : Real.sqrt ((D+K*(1- -k)^5)*r)≤Real.sqrt ((D+K)*r)*(1+k)^3 := by + apply (Real.sqrt_le_iff).2 + refine ⟨by positivity,?_⟩ + rw [mul_pow,Real.sq_sqrt (mul_nonneg (add_nonneg hD hK) hr)] + exact hδ + have hbase : Coulomb.screenBaseMass r≤Coulomb.screenBaseMass r*(1+k)^3 := + le_mul_of_one_le_right (Coulomb.screenBaseMass_nonneg r) (one_le_pow₀ hv) + unfold Coulomb.screenMass + have H := mul_le_mul_of_nonneg_left (add_le_add hbase hs) hB + have hp : 0<(1+k)^3 := by positivity + nlinarith + +def observedDeficitCoefficient {J : ℕ} (ℓ : Fin J → ℝ) (D r : ℝ) : ℝ := + 2*Coulomb.atomicInnerFieldConstant*(Coulomb.screenBaseMass r+ + Real.sqrt ((D+observationEventEnergyConstant*observationWidthSquareSum ℓ)*r))+1 + +lemma observedDeficitCoefficient_pos {J : ℕ} (ℓ : Fin J → ℝ) (D r : ℝ) : + 0 mass ((T.vector p).coreSlice s x)*(F p s x)^2)) + (hcap : ∀ p s, ∀ᵐ x, ∀ w∈Metric.closedBall y (t+b), coreScreenedField S ((T.vector p).coreSlice s x).normalized w≤F p s x) : + let Q := ∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2) + let N := ∑ p, (T.out p:ℝ)^2*mass (T.vector p) + let ρ := fun p s x => localTFDensity measurableSet_ball + (coreTFField S ((T.vector p).coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn)) + (∑ p, sliceExpectation (T.vector p) (fun s x => + rawThomasFermiEnergy (coreScreenedField S ((T.vector p).coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy (coreScreenedField S ((T.vector p).coreSlice s x).normalized) (ρ p s x))) ≤ + B+12*a*unitWindowKinetic/b^2*Real.sqrt Q+Real.sqrt (Q*T.deletedSquare y t b)+ + (b⁻¹)^2*((Real.pi^2/2)*neumannBoundary)*N^(2/3:ℝ)+ + ((2*Real.pi+1)/(2*b))*Real.sqrt N := by + dsimp only + let ρ := fun p s x => localTFDensity measurableSet_ball + (coreTFField S ((T.vector p).coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn)) + let G := fun p s x => rawThomasFermiEnergy (coreScreenedField S ((T.vector p).coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy (coreScreenedField S ((T.vector p).coreSlice s x).normalized) (ρ p s x) + have hcs' (p : T.index) (s) : ∀ᵐ x, SpatiallySupported ((T.vector p).coreSlice s x).normalized {z | t≤‖z-y‖} := by + filter_upwards [(hcs p).coreSlice s] with x hx + exact hx.normalized + have hcap' (p : T.index) (s) : ∀ᵐ x, ∀ w∈Metric.ball y (t-4*b), coreScreenedField S ((T.vector p).coreSlice s x).normalized w≤F p s x := by + filter_upwards [hcap p s] with x hx + exact fun w hw => hx w (Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith)) hw) + have hgap (p : T.index) := physical_patch_comparison S (T.vector p) (ho p).outer_symmetry + (fun s => (hc p).coreSlice s) ha hb hsmall ht y hn (hcs' p) (fun s => (hos p).recorded_positions s) + (F p) (hFm p) (hF0 p) (hFi p) (hcap p) hE + have hpacket (p : T.index) := patch_packet_expected_bound S (T.vector p) ha hb ht.2 y hn + (F p) (hFm p) (hF0 p) (hFi p) (hcap' p) + have hmean := slice_ensemble_mean_le_sqrt T.out T.core T.vector F hFm hF0 hFi hm + have hdel := slice_ensemble_mul_le_sqrt T.out T.core T.vector F + (fun _ _ x => localCount {z | t-7*b≤‖z-y‖} x) hFi + (fun p s => sliceCount_weight_integrable (T.vector p) (isClosed_le continuous_const (by fun_prop)).measurableSet s 2) + (fun p s => weighted_cap_count_integrable (mass_coreSlice_integrable (T.vector p) s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hFm p s) (hF0 p s) (hFi p s) + (localCount_measurable (isClosed_le continuous_const (by fun_prop)).measurableSet).aestronglyMeasurable + (Nat.cast_nonneg (T.out p)) (Eventually.of_forall (fun x => ⟨localCount_nonneg _ x,localCount_le _ x⟩))) + have hfine := ensemble_fineLocalizationError T.out (fun p => mass (T.vector p)) (fun p => mass_nonneg _) hm hb + have hsumgap := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hgap p) + have hsumpacket := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hpacket p) + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum] at hsumgap hsumpacket + change (∑ p, sliceExpectation (T.vector p) (G p))≤_ at hsumgap + have hGapBound : (∑ p, sliceExpectation (T.vector p) (G p))≤B+ + 12*a*unitWindowKinetic/b^2*Real.sqrt (∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2))+ + Real.sqrt ((∑ p, sliceExpectation (T.vector p) (fun s x => (F p s x)^2))*T.deletedSquare y t b)+ + (b⁻¹)^2*((Real.pi^2/2)*neumannBoundary)*(∑ p, (T.out p:ℝ)^2*mass (T.vector p))^(2/3:ℝ)+ + ((2*Real.pi+1)/(2*b))*Real.sqrt (∑ p, (T.out p:ℝ)^2*mass (T.vector p)) := by + have hp := mul_le_mul_of_nonneg_left hmean (show 0≤12*a*unitWindowKinetic/b^2 by exact div_nonneg (mul_nonneg (by positivity) unitWindowKinetic_nonneg) (sq_nonneg _)) + change (∑ p, mass (T.vector p))=1 at hm + rw [hm,mul_one] at hsumgap + change (∑ p, form S (T.vector p))≤E+B at henergy + unfold RecordedEnsemble.deletedSquare + linarith + exact hGapBound +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalLikelihoodBridge.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalLikelihoodBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..15f16009b23f1c8ef2507df2ba3baf18acff9900 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalLikelihoodBridge.lean @@ -0,0 +1,220 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationMatching +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalMatching + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +namespace NeutralAtom + +def flattenObservationNoise (n J : ℕ) : + ObservationNoise n J ≃ᵐ ((Fin J × (Fin n × Fin 3)) → ℝ) where + toEquiv := { + toFun := fun u ia => u ia.1 ia.2.1 ia.2.2 + invFun := fun v j i a => v (j,i,a) + left_inv := by intro u; rfl + right_inv := by intro v; rfl } + measurable_toFun := by change Measurable (fun (u : ObservationNoise n J) (ia : Fin J × (Fin n × Fin 3)) => u ia.1 ia.2.1 ia.2.2); fun_prop + measurable_invFun := by change Measurable (fun (v : (Fin J × (Fin n × Fin 3)) → ℝ) (j : Fin J) (i : Fin n) (a : Fin 3) => v (j,i,a)); fun_prop + +lemma flattenObservationNoise_preserving (n J : ℕ) : + MeasurePreserving (flattenObservationNoise n J) (allObservationNoiseLaw n J) + (Measure.pi (fun _ : Fin J × (Fin n × Fin 3) => observationNoiseLaw)) := by + refine ⟨(flattenObservationNoise n J).measurable,?_⟩ + refine (Measure.pi_eq (fun v hv => ?_)).symm + rw [MeasurableEquiv.map_apply] + have he : (flattenObservationNoise n J) ⁻¹' Set.univ.pi v= + Set.univ.pi (fun j => Set.univ.pi (fun i => Set.univ.pi (fun a => v (j,i,a)))) := by + ext u + simp only [mem_preimage,Set.mem_pi,mem_univ,true_implies,flattenObservationNoise, + MeasurableEquiv.coe_mk,Equiv.coe_fn_mk] + exact ⟨fun h j i a => h (j,i,a),fun h ⟨j,i,a⟩ => h j i a⟩ + rw [he] + simp only [allObservationNoiseLaw,Measure.pi_pi] + simp only [Fintype.prod_prod_type] + +def observationCoordinateData {n J : ℕ} (ℓ : Fin J → ℝ) + (z : ObservationSample n J) : (Fin J × (Fin n × Fin 3)) → ℝ := + fun ia => z.1 ia.2.1 ia.2.2+ℓ ia.1*z.2 ia.1 ia.2.1 ia.2.2 + +lemma measurable_observationCoordinateData {n J : ℕ} (ℓ : Fin J → ℝ) : + Measurable (@observationCoordinateData n J ℓ) := by + unfold observationCoordinateData + fun_prop + +lemma observationCoordinateData_positions {n J : ℕ} (r : Fin J → ℝ) + (sample : ObservationSample n J) (j : Fin J) : + observationArrayPositions j (observationCoordinateData (fun k => (r k)^(101/100:ℝ)) sample)= + observedOrdered r j sample := by + funext i + ext a + simp [observationArrayPositions,observationCoordinateData,observedOrdered, + observationNoiseVector_coordinate] + +lemma arrayEventLikelihood_nested_integral {n J : ℕ} (ℓ : Fin J → ℝ) + (hℓ : ∀ h, ℓ h≠0) (B : Set ((Fin J × (Fin n × Fin 3)) → ℝ)) + (x : Configuration n) : + arrayEventLikelihood ℓ B x= + ∫ u, B.indicator (fun _ => (1:ℝ)) (observationCoordinateData ℓ (x,u)) + ∂allObservationNoiseLaw n J := by + rw [arrayEventLikelihood_integral ℓ hℓ] + exact ((flattenObservationNoise_preserving n J).integral_comp' + (fun u => B.indicator (fun _ => (1:ℝ)) (fun ia => x ia.2.1 ia.2.2+ℓ ia.1*u ia))).symm + +lemma rawExpectation_eq_stateWeightedIntegral {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {F : Configuration n → ℝ} + (hF : Measurable F) {C : ℝ} (hC : ∀ x, ‖F x‖≤C) : + rawExpectation ψ F=stateWeightedIntegral ψ F := by + unfold rawExpectation configurationDensity stateWeightedIntegral + simp_rw [Finset.mul_sum] + exact integral_finsetSum _ (fun σ _ => + (hψ σ).norm.integrable_sq.bdd_mul hF.aestronglyMeasurable + (Eventually.of_forall hC)) + +theorem physical_arrayEvent_bayes_integral {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (ℓ : Fin J → ℝ) (hℓ : ∀ h, ℓ h≠0) + {B : Set ((Fin J × (Fin n × Fin 3)) → ℝ)} (hB : MeasurableSet B) + {F : Configuration n → ℝ} (hF : Measurable F) {C : ℝ} + (hC : ∀ x, ‖F x‖≤C) : + (∫ sample, ((observationCoordinateData ℓ) ⁻¹' B).indicator + (fun z => F z.1) sample ∂observationLaw J (rawLaw ψ))= + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ B x*F x) := by + let := rawLaw_isProbability hψ hn + have hi : Integrable (fun z : ObservationSample n J => F z.1) + (observationLaw J (rawLaw ψ)) := + (integrable_const C).mono' (hF.comp measurable_fst).aestronglyMeasurable + (Eventually.of_forall (fun z => hC z.1)) + have hA := hB.preimage (measurable_observationCoordinateData ℓ) + rw [observationLaw,integral_prod _ (hi.indicator hA)] + have hi2 : (fun x : Configuration n => ∫ u, + ((observationCoordinateData ℓ) ⁻¹' B).indicator (fun z => F z.1) (x,u) + ∂allObservationNoiseLaw n J)= + fun x => arrayEventLikelihood ℓ B x*F x := by + funext x + rw [arrayEventLikelihood_nested_integral ℓ hℓ B x,←integral_mul_const] + apply integral_congr_ae + exact Eventually.of_forall fun u => by + by_cases h : observationCoordinateData ℓ (x,u)∈B <;> simp [h] + rw [hi2,integral_rawLaw hψ] + apply rawExpectation_eq_stateWeightedIntegral (C:=C) hψ + (((arrayEventLikelihood_contDiff ℓ hB).continuous.measurable).mul hF) + intro x + change ‖arrayEventLikelihood ℓ B x*F x‖≤C + rw [norm_mul,Real.norm_of_nonneg (arrayEventLikelihood_nonneg ℓ hB x)] + exact (mul_le_mul_of_nonneg_right (arrayEventLikelihood_le_one ℓ hB x) + (norm_nonneg _)).trans (by simpa using hC x) + +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace NeutralAtom + +def coordinateTailObservation {n J : ℕ} (j : ℕ) + (z : (Fin J × (Fin n × Fin 3)) → ℝ) : Fin J → UnorderedArray n := + fun k => if j≤k.val then forgetOrder (observationArrayPositions k z) else forgetOrder 0 + +lemma measurable_coordinateTailObservation {n J : ℕ} (j : ℕ) : + Measurable (@coordinateTailObservation n J j) := by + apply Measurable.of_eval + intro k + by_cases hk : j≤k.val + · simpa only [coordinateTailObservation,ite_eq_left hk,Function.comp_def] using + measurable_forgetOrder.comp (measurable_observationArrayPositions k) + · simpa only [coordinateTailObservation,ite_eq_right hk] using + (measurable_const : Measurable (fun _ : (Fin J × (Fin n × Fin 3)) → ℝ => + forgetOrder (0 : Configuration n))) + +lemma coordinateTailObservation_permute {n J : ℕ} (j : ℕ) + (p : Equiv.Perm (Fin n)) (z : (Fin J × (Fin n × Fin 3)) → ℝ) : + coordinateTailObservation j (permuteObservationArray p z)=coordinateTailObservation j z := by + funext k + by_cases hk : j≤k.val + · simp only [coordinateTailObservation,ite_eq_left hk] + exact forgetOrder_permutation (observationArrayPositions k z) p + · simp only [coordinateTailObservation,ite_eq_right hk] + +lemma coordinateTailObservation_physical {n J : ℕ} (r : Fin J → ℝ) + (j : ℕ) (sample : ObservationSample n J) : + coordinateTailObservation j (observationCoordinateData (fun k => (r k)^(101/100:ℝ)) sample)= + tailObservation r j sample := by + funext k + by_cases hk : j≤k.val + · simp only [coordinateTailObservation,tailObservation,ite_eq_left hk, + observationCoordinateData_positions,observedArray] + · simp only [coordinateTailObservation,tailObservation,ite_eq_right hk] + +lemma physical_tailEvent_bayes_integral {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (r : Fin J → ℝ) (hr : ∀ k, 0 F z.1) sample + ∂observationLaw J (rawLaw ψ))= + stateWeightedIntegral ψ (fun x => + arrayEventLikelihood (fun k => (r k)^(101/100:ℝ)) + (coordinateTailObservation j ⁻¹' B) x*F x) := by + have he : observationCoordinateData (fun k => (r k)^(101/100:ℝ)) ⁻¹' + (coordinateTailObservation j ⁻¹' B)=tailObservation r j ⁻¹' B := by + ext sample + simp only [mem_preimage,coordinateTailObservation_physical] + rw [←he] + exact physical_arrayEvent_bayes_integral hψ hn _ + (fun k => (Real.rpow_pos_of_pos (hr k) _).ne') + (hB.preimage (measurable_coordinateTailObservation j)) hF hC + +lemma physical_tailEvent_probability {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (r : Fin J → ℝ) (hr : ∀ k, 0 (r k)^(101/100:ℝ)) + (coordinateTailObservation j ⁻¹' B)) := by + have H := physical_tailEvent_bayes_integral hψ hn r hr j hB + (measurable_const : Measurable (fun _ : Configuration n => (1:ℝ))) + (C:=1) (fun _ => by simp) + simpa only [integral_indicator_const _ (hB.preimage (measurable_tailObservation r j)), + smul_eq_mul,mul_one] using H + +theorem physical_tailEvent_state {n J : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hbase : energy Z ψ g≤E+D₀) + (r : Fin J → ℝ) (hr : ∀ k, 0 (r k)^(101/100:ℝ))* + (1-Real.log ((observationLaw J (rawLaw ψ)).real (tailObservation r j ⁻¹' B)))^5) ∧ + ∀ F : Configuration n → ℝ, Measurable F → (∃ C : ℝ, ∀ x, ‖F x‖≤C) → + Coulomb.potentialForm (fun x => F ((flattenConfiguration n).symm x)) u= + ((observationLaw J (rawLaw ψ)).real (tailObservation r j ⁻¹' B))⁻¹* + ∫ sample, (tailObservation r j ⁻¹' B).indicator (fun z => F z.1) sample + ∂observationLaw J (rawLaw ψ) := by + have hpEq := physical_tailEvent_probability hd.2.2.1 hn r hr j hB + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase + (fun k => (r k)^(101/100:ℝ)) (fun k => Real.rpow_pos_of_pos (hr k) _) + (hB.preimage (measurable_coordinateTailObservation j)) + (fun p z => by simp only [mem_preimage,coordinateTailObservation_permute]) + (hpEq ▸ hp) + refine ⟨u,hu,hum,?_,?_⟩ + · simpa only [hpEq] using hue + · intro F hF hbound + obtain ⟨C,hC⟩ := hbound + rw [hlaw,physical_tailEvent_bayes_integral hd.2.2.1 hn r hr j hB hF hC,hpEq] + simp only [ContinuousLinearEquiv.symm_apply_apply] + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalPosteriorInverse.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalPosteriorInverse.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd0d8a36790b3a14aec4d72cb2cfaa22dc222fea --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PhysicalPosteriorInverse.lean @@ -0,0 +1,205 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.InverseEventContradiction +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorDataMeasurable + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +namespace NeutralAtom + +lemma rawCount_mono {n : ℕ} {S T : Set Position} (x : Configuration n) + (h : S ⊆ T) : rawCount S x ≤ rawCount T x := by + apply Finset.sum_le_sum + intro i hi + by_cases hS : x i ∈ S + · simp only [Set.indicator_of_mem hS, Set.indicator_of_mem (h hS)] + exact le_rfl + · simp only [Set.indicator_of_notMem hS] + exact Set.indicator_nonneg (fun _ _ => by norm_num) _ + +theorem physical_posterior_matching_count (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z, 1 < ‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) : + ∃ K₀ : ℝ, 0 < K₀ ∧ ∀ {c r₀ s : ℝ}, 0 < c → 0 < r₀ → 0 < s → + c*(1+packetExponent)*s^packetExponent ≤ 1/4 → + ∀ {n J : ℕ} (ν : Measure (Configuration n)) [IsProbabilityMeasure ν] + (r : Fin J → ℝ), (∀ k, 0 ≤ r k) → ∀ {j : ℕ} (k : Fin J), j ≤ k.val → + ∀ (y : Position) (a m : ℝ), 0 ≤ a → + ∀ᵐ z ∂observationLaw J ν, + rawCount (Metric.closedBall y (2*packetWidth c r₀ s y+2*a^(6/5:ℝ)+2*(Real.sqrt 3*(r k)^(101/100:ℝ)))) + (observedOrdered r k z) ≤ m → + |conditionalPacketDensity (observationLaw J ν) Prod.fst (tailObservation r j) g₀ c r₀ s + (tailObservation r j z) y-rawPacketDensity g₀ c r₀ s (observedOrdered r k z) y| ≤ + (K₀/(packetWidth c r₀ s y)^4*(Real.sqrt 3*(r k)^(101/100:ℝ)))*m := by + obtain ⟨K₀,hK₀,H⟩ := physical_posterior_kernel_matching g₀ hg hm + refine ⟨K₀,hK₀,?_⟩ + intro c r₀ s hc hr₀ hs hscale n J ν inst r hr j k hk y a m ha + have hrk := hr k + filter_upwards [H hc hr₀ hs hscale ν r hr k hk y] with z hz hcz + apply hz.trans + apply mul_le_mul_of_nonneg_left _ (by positivity) + apply (rawCount_mono (observedOrdered r k z) ?_).trans hcz + apply Metric.closedBall_subset_closedBall + have hb : 0 ≤ a^(6/5:ℝ) := Real.rpow_nonneg ha _ + have he : 0 ≤ Real.sqrt 3*(r k)^(101/100:ℝ) := by positivity + linarith + +theorem physical_posterior_inverse_point (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z, 1<‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) + (hrad : ∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) + {D c A κ Λ M V hl hh η : ℝ} + (hD : 0 ≤ D) (hc : 0 + rawCount (Metric.closedBall y (2*w+2*a^(6/5:ℝ)+2*(Real.sqrt 3*ell))) + (observedOrdered (fun l : Fin J => r₀*2^l.val) k.val z) + let μ := fun z : ObservationSample (N+1) J => + conditionalPacketDensity (observationLaw J (rawLaw ψ)) Prod.fst + (tailObservation (fun l : Fin J => r₀*2^l.val) j) g₀ c r₀ s + (tailObservation (fun l : Fin J => r₀*2^l.val) j z) + let field := fun z : ObservationSample (N+1) J => (Z:ℝ)*coulombKernel y-potentialOf (μ z) y + κ*a^(1+packetExponent) ≤ w → w/a ≤ V*s^packetExponent → + ell ≤ Λ*a^(101/100:ℝ) → ∀ {h : ℝ}, h∈Icc hl hh → + (observationLaw J (rawLaw ψ)).real + {z | count z ≤ M*a^(-3:ℝ) ∧ Coulomb.tfScalarDensity h/a^6 ≤ μ z y ∧ field z ≤ (h-2*η)/a^4} + ≤ (r₀*2^j)^42 ∧ + (observationLaw J (rawLaw ψ)).real + {z | count z ≤ M*a^(-3:ℝ) ∧ μ z y ≤ Coulomb.tfScalarDensity h/a^6 ∧ (h+2*η)/a^4 ≤ field z} + ≤ (r₀*2^j)^42 := by + obtain ⟨K₀,hK₀,Hmatch⟩ := physical_posterior_matching_count g₀ hg hm + obtain ⟨s₀,hs₀,hs₀1,Hfail⟩ := physical_retained_inverse_event g₀ hg hm hrad + hD hc hA hκ hΛ hM hV hK₀.le hη hηl hlh + refine ⟨s₀,hs₀,hs₀1,?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE hbase r₀ s hr₀ hs hss hscale j hrj k y hy hry hya + dsimp only + intro hw hwa hell h hh' + have := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + let r : Fin J → ℝ := fun l => r₀*2^l.val + let obs : ObservationSample (N+1) J → (Fin J → UnorderedArray (N+1)) := tailObservation r j + let a := Coulomb.atomicCellScale y + let w := packetWidth c r₀ s y + let ell := (r k.val)^(101/100:ℝ) + let m := M*a^(-3:ℝ) + let ball := Metric.closedBall y (2*w+2*a^(6/5:ℝ)+2*(Real.sqrt 3*ell)) + have hgs : HasCompactSupport (g₀ : Position → ℝ) := by + apply HasCompactSupport.intro (K:=Metric.closedBall 0 1) (isCompact_closedBall _ _) + intro z hz + exact hg z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz) + let μ := conditionalPacketDensity P Prod.fst obs g₀ c r₀ s + let H := fun datum => (Z:ℝ)*coulombKernel y-potentialOf (μ datum) y + have hH : Measurable H := measurable_const.sub + (measurable_conditionalPacketPotential_data P Prod.fst obs g₀.continuous hgs hm hc hr₀ hs y) + have ha : 0 < a := Coulomb.atomicCellScale_pos hy + have hmatch := Hmatch hc hr₀ hs hscale (rawLaw ψ) r + (fun _ => by dsimp [r]; positivity) k.val k.property y a m ha.le + have Hfail' (B : Set (Fin J → UnorderedArray (N+1))) := + Hfail Z hZ hd hn hmin hE hbase hr₀ hs hss hscale j hrj k y hy hry hya hw hwa hell hh' (B:=B) + exact retained_inverse_gate_transfer (rawLaw ψ) r k measurableSet_closedBall + (measurable_packetKernel_center g₀.continuous hc hr₀ hs y) (μ:=fun datum => μ datum y) hH + (by simpa only [rawPacketDensity] using hmatch) + (fun hB hcnt hgate hfld => (Hfail' _ hB hcnt (Or.inl ⟨hgate,hfld⟩)).le) + (fun hB hcnt hgate hfld => (Hfail' _ hB hcnt (Or.inr ⟨hgate,hfld⟩)).le) +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +namespace NeutralAtom + +lemma mixturePacketDensity_measurable {n : ℕ} (ν : Measure (Configuration n)) [SFinite ν] + {g : Position → ℝ} (hg : Continuous g) {c r₀ s : ℝ} + (hc : 0 potentialOf + (conditionalPacketDensity P raw obs g c r₀ s dy.1) dy.2) := by + let u := fun y : Position => fun datum : B => potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) y + have hcont : ∀ datum, Continuous (fun y => u y datum) := + conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr hs + have hmeas : ∀ y, Measurable (u y) := + measurable_conditionalPacketPotential_data P raw obs hg hgs hm hc hr hs + have H : Measurable (Function.uncurry u) := + measurable_uncurry_of_continuous_of_measurable hcont hmeas + change Measurable (Function.uncurry u ∘ (Prod.swap : B × Position → Position × B)) + exact Measurable.comp H measurable_swap + +lemma atomic_screened_ballCloud_submean {ρ : Position → ℝ} (hi : Integrable ρ) + (hm : Measurable ρ) (hp : ∀ x,0≤ρ x) {A : ℝ} (hA : ∀ x,ρ x≤A) + (Z : ℝ) {a : ℝ} (ha : 0 coulombKernel z*Coulomb.ballCloud y a 1 z) := by + have H := Coulomb.coulomb_convolution_integrable (Coulomb.ballCloud_integrable a 1 y) + (Coulomb.ballCloud_measurable a 1 y) (fun z => Coulomb.uniformBall_nonneg ha zero_le_one (z-y)) + (fun z => Coulomb.uniformBall_le ha zero_le_one (z-y)) ha (0:Position) + simpa only [Coulomb.coulombKernel,coulombKernel,zero_sub,norm_neg] using H + have he : (∫ z,coulombKernel z*Coulomb.ballCloud y a 1 z)=coulombKernel y := by + have H := Coulomb.ballCloud_coulomb ha zero_le_one y (0:Position) (by simpa only [zero_sub,norm_neg] using hy) + simpa only [Coulomb.coulombKernel,coulombKernel,zero_sub,norm_neg,one_mul] using H + have hK := Coulomb.coulomb_convolution_integrable hi hm hp hA (by norm_num : (0:ℝ)<1) y + have H := Coulomb.potentialOf_ballCloud_le hi hm hp ha y hK + simp_rw [sub_mul,mul_assoc] + rw [integral_sub (hnI.const_mul Z) (Coulomb.potentialOf_ballCloud_integrable hi hm ha y), + integral_const_mul,he] + linarith + +lemma conditionalPacketField_submean {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} + (hc : 0 u ia.1 ia.2.1 ia.2.2 + invFun := fun v h i a => v (h,i,a) + left_inv := by intro u; rfl + right_inv := by intro v; rfl } + measurable_toFun := by change Measurable (fun (u : H → Fin n → Fin 3 → ℝ) (ia : H × (Fin n × Fin 3)) => u ia.1 ia.2.1 ia.2.2); fun_prop + measurable_invFun := by change Measurable (fun (v : (H × (Fin n × Fin 3)) → ℝ) (h : H) (i : Fin n) (a : Fin 3) => v (h,i,a)); fun_prop + +lemma flattenIndexedNoise_preserving (n : ℕ) (H : Type*) [Fintype H] : + MeasurePreserving (flattenIndexedNoise n H) + (Measure.pi (fun _ : H => Measure.pi (fun _ : Fin n => Measure.pi (fun _ : Fin 3 => observationNoiseLaw)))) + (Measure.pi (fun _ : H × (Fin n × Fin 3) => observationNoiseLaw)) := by + refine ⟨(flattenIndexedNoise n H).measurable,?_⟩ + refine (Measure.pi_eq (fun v hv => ?_)).symm + rw [MeasurableEquiv.map_apply] + have he : (flattenIndexedNoise n H) ⁻¹' Set.univ.pi v= + Set.univ.pi (fun j => Set.univ.pi (fun i => Set.univ.pi (fun a => v (j,i,a)))) := by + ext u + simp only [mem_preimage,Set.mem_pi,mem_univ,true_implies,flattenIndexedNoise, + MeasurableEquiv.coe_mk,Equiv.coe_fn_mk] + exact ⟨fun h j i a => h (j,i,a),fun h ⟨j,i,a⟩ => h j i a⟩ + rw [he] + simp only [Measure.pi_pi,Fintype.prod_prod_type] + +abbrev RetainedScales (J j : ℕ) := {k : Fin J // j≤k.val} + +def retainedNoise {n J : ℕ} (j : ℕ) (u : ObservationNoise n J) : + (RetainedScales J j × (Fin n × Fin 3)) → ℝ := + fun ia => u ia.1.val ia.2.1 ia.2.2 + +lemma retainedNoise_preserving (n J j : ℕ) : + MeasurePreserving (@retainedNoise n J j) (allObservationNoiseLaw n J) + (Measure.pi (fun _ : RetainedScales J j × (Fin n × Fin 3) => observationNoiseLaw)) := by + have hp : MeasurePreserving + (fun u : ObservationNoise n J => fun k : RetainedScales J j => u k.val) + (allObservationNoiseLaw n J) + (Measure.pi (fun _ : RetainedScales J j => + Measure.pi (fun _ : Fin n => Measure.pi (fun _ : Fin 3 => observationNoiseLaw)))) := + measurePreserving_fst.comp (measurePreserving_piEquivPiSubtypeProd + (fun _ : Fin J => Measure.pi (fun _ : Fin n => Measure.pi (fun _ : Fin 3 => observationNoiseLaw))) + (fun k : Fin J => j≤k.val)) + exact (flattenIndexedNoise_preserving n (RetainedScales J j)).comp hp + +def retainedObservationData {n J : ℕ} (j : ℕ) (ℓ : RetainedScales J j → ℝ) + (z : ObservationSample n J) : (RetainedScales J j × (Fin n × Fin 3)) → ℝ := + fun ia => z.1 ia.2.1 ia.2.2+ℓ ia.1*z.2 ia.1.val ia.2.1 ia.2.2 + +lemma measurable_retainedObservationData {n J : ℕ} (j : ℕ) (ℓ : RetainedScales J j → ℝ) : + Measurable (@retainedObservationData n J j ℓ) := by + unfold retainedObservationData + fun_prop + +lemma arrayEventLikelihood_retained_integral {n J : ℕ} (j : ℕ) (ℓ : RetainedScales J j → ℝ) + (hℓ : ∀ h, ℓ h≠0) (B : Set ((RetainedScales J j × (Fin n × Fin 3)) → ℝ)) + (hB : MeasurableSet B) (x : Configuration n) : + arrayEventLikelihood ℓ B x= + ∫ u, B.indicator (fun _ => (1:ℝ)) (retainedObservationData j ℓ (x,u)) + ∂allObservationNoiseLaw n J := by + have hm : Measurable (fun u : (RetainedScales J j × (Fin n × Fin 3)) → ℝ => + B.indicator (fun _ => (1:ℝ)) (fun ia => x ia.2.1 ia.2.2+ℓ ia.1*u ia)) := + (measurable_const.indicator hB).comp (by fun_prop) + rw [arrayEventLikelihood_integral ℓ hℓ,←(retainedNoise_preserving n J j).map_eq] + exact integral_map_of_stronglyMeasurable (retainedNoise_preserving n J j).measurable hm.stronglyMeasurable + +theorem physical_retainedEvent_bayes_integral {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (j : ℕ) (ℓ : RetainedScales J j → ℝ) (hℓ : ∀ k, ℓ k≠0) + {B : Set ((RetainedScales J j × (Fin n × Fin 3)) → ℝ)} (hB : MeasurableSet B) + {F : Configuration n → ℝ} (hF : Measurable F) {C : ℝ} (hC : ∀ x, ‖F x‖≤C) : + (∫ sample, (retainedObservationData j ℓ ⁻¹' B).indicator (fun z => F z.1) sample + ∂observationLaw J (rawLaw ψ))= + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ B x*F x) := by + let := rawLaw_isProbability hψ hn + have hi : Integrable (fun z : ObservationSample n J => F z.1) + (observationLaw J (rawLaw ψ)) := + (integrable_const C).mono' (hF.comp measurable_fst).aestronglyMeasurable + (Eventually.of_forall (fun z => hC z.1)) + have hA := hB.preimage (measurable_retainedObservationData j ℓ) + rw [observationLaw,integral_prod _ (hi.indicator hA)] + have hi2 : (fun x : Configuration n => ∫ u, + (retainedObservationData j ℓ ⁻¹' B).indicator (fun z => F z.1) (x,u) + ∂allObservationNoiseLaw n J)= + fun x => arrayEventLikelihood ℓ B x*F x := by + funext x + rw [arrayEventLikelihood_retained_integral j ℓ hℓ B hB x,←integral_mul_const] + apply integral_congr_ae + exact Eventually.of_forall fun u => by + by_cases h : retainedObservationData j ℓ (x,u)∈B <;> simp [h] + rw [hi2,integral_rawLaw hψ] + apply rawExpectation_eq_stateWeightedIntegral (C:=C) hψ + (((arrayEventLikelihood_contDiff ℓ hB).continuous.measurable).mul hF) + intro x + change ‖arrayEventLikelihood ℓ B x*F x‖≤C + rw [norm_mul,Real.norm_of_nonneg (arrayEventLikelihood_nonneg ℓ hB x)] + exact (mul_le_mul_of_nonneg_right (arrayEventLikelihood_le_one ℓ hB x) + (norm_nonneg _)).trans (by simpa using hC x) +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace NeutralAtom + +def retainedTailObservation {n J : ℕ} (j : ℕ) + (z : (RetainedScales J j × (Fin n × Fin 3)) → ℝ) : Fin J → UnorderedArray n := + fun k => if hk : j≤k.val then forgetOrder (observationArrayPositions ⟨k,hk⟩ z) else forgetOrder 0 + +lemma measurable_retainedTailObservation {n J : ℕ} (j : ℕ) : + Measurable (@retainedTailObservation n J j) := by + apply Measurable.of_eval + intro k + by_cases hk : j≤k.val + · simpa only [retainedTailObservation,dite_eq_left hk,Function.comp_def] using + measurable_forgetOrder.comp (measurable_observationArrayPositions (⟨k,hk⟩ : RetainedScales J j)) + · simpa only [retainedTailObservation,dite_eq_right hk] using + (measurable_const : Measurable (fun _ : (RetainedScales J j × (Fin n × Fin 3)) → ℝ => + forgetOrder (0 : Configuration n))) + +lemma retainedTailObservation_permute {n J : ℕ} (j : ℕ) + (p : Equiv.Perm (Fin n)) (z : (RetainedScales J j × (Fin n × Fin 3)) → ℝ) : + retainedTailObservation j (permuteObservationArray p z)=retainedTailObservation j z := by + funext k + by_cases hk : j≤k.val + · simp only [retainedTailObservation,dite_eq_left hk] + exact forgetOrder_permutation (observationArrayPositions ⟨k,hk⟩ z) p + · simp only [retainedTailObservation,dite_eq_right hk] + +lemma retainedTailObservation_physical {n J : ℕ} (r : Fin J → ℝ) + (j : ℕ) (sample : ObservationSample n J) : + retainedTailObservation j (retainedObservationData j (fun k => (r k.val)^(101/100:ℝ)) sample)= + tailObservation r j sample := by + funext k + by_cases hk : j≤k.val + · simp only [retainedTailObservation,tailObservation,dite_eq_left hk,ite_eq_left hk,observedArray] + congr 1 + funext i + ext a + simp [observationArrayPositions,retainedObservationData,observedOrdered, + observationNoiseVector_coordinate] + · simp only [retainedTailObservation,tailObservation,dite_eq_right hk,ite_eq_right hk] + +lemma physical_retainedTailEvent_bayes_integral {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (r : Fin J → ℝ) (hr : ∀ k, 0 F z.1) sample + ∂observationLaw J (rawLaw ψ))= + stateWeightedIntegral ψ (fun x => + arrayEventLikelihood (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ)) + (retainedTailObservation j ⁻¹' B) x*F x) := by + have he : retainedObservationData j (fun k => (r k.val)^(101/100:ℝ)) ⁻¹' + (retainedTailObservation j ⁻¹' B)=tailObservation r j ⁻¹' B := by + ext sample + simp only [mem_preimage,retainedTailObservation_physical] + rw [←he] + exact physical_retainedEvent_bayes_integral hψ hn j _ + (fun k => (Real.rpow_pos_of_pos (hr k.val) _).ne') + (hB.preimage (measurable_retainedTailObservation j)) hF hC + +lemma physical_retainedTailEvent_probability {n J : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hn : normSquared ψ=1) + (r : Fin J → ℝ) (hr : ∀ k, 0 (r k.val)^(101/100:ℝ)) + (retainedTailObservation j ⁻¹' B)) := by + have H := physical_retainedTailEvent_bayes_integral hψ hn r hr j hB + (measurable_const : Measurable (fun _ : Configuration n => (1:ℝ))) + (C:=1) (fun _ => by simp) + simpa only [integral_indicator_const _ (hB.preimage (measurable_tailObservation r j)), + smul_eq_mul,mul_one] using H + +theorem physical_retainedTailEvent_state {n J : ℕ} + (Z : ℕ) (hZ : 1≤Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → energy Z ψ g≤energy Z χ h) + {E D₀ : ℝ} (hbase : energy Z ψ g≤E+D₀) + (r : Fin J → ℝ) (hr : ∀ k, 0 (r k.val)^(101/100:ℝ))* + (1-Real.log ((observationLaw J (rawLaw ψ)).real (tailObservation r j ⁻¹' B)))^5) ∧ + ∀ F : Configuration n → ℝ, Measurable F → (∃ C : ℝ, ∀ x, ‖F x‖≤C) → + Coulomb.potentialForm (fun x => F ((flattenConfiguration n).symm x)) u= + ((observationLaw J (rawLaw ψ)).real (tailObservation r j ⁻¹' B))⁻¹* + ∫ sample, (tailObservation r j ⁻¹' B).indicator (fun z => F z.1) sample + ∂observationLaw J (rawLaw ψ) := by + have hpEq := physical_retainedTailEvent_probability hd.2.2.1 hn r hr j hB + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase + (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ)) (fun k => Real.rpow_pos_of_pos (hr k.val) _) + (hB.preimage (measurable_retainedTailObservation j)) + (fun p z => by simp only [mem_preimage,retainedTailObservation_permute]) + (hpEq ▸ hp) + refine ⟨u,hu,hum,?_,?_⟩ + · simpa only [hpEq] using hue + · intro F hF hbound + obtain ⟨C,hC⟩ := hbound + rw [hlaw,physical_retainedTailEvent_bayes_integral hd.2.2.1 hn r hr j hB hF hC,hpEq] + simp only [ContinuousLinearEquiv.symm_apply_apply] + +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorBandOscillation.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorBandOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..d71a36bb2d43dbbb3c99602bee518fcb349bbefd --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorBandOscillation.lean @@ -0,0 +1,61 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.BandOscillation +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorSpatialCap + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem posterior_count_cap_oscillation {B K : ℝ} (hB : 0 ≤ B) (hK : 0 ≤ K) : + ∃ C : ℝ,0 < C ∧ ∀ {Ω Data : Type*} [MeasurableSpace Ω] [MeasurableSpace Data] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → Data) + (g : Position → ℝ),Continuous g → HasCompactSupport g → (∫ z,g z^2)=1 → + ∀ {c r₀ s : ℝ},0 < c → 0 < r₀ → 0 < s → ∀ (datum : Data) (Z r L τ : ℝ), + 0 < r → 1 ≤ L → 0 < τ → τ ≤ r → + (∀ y,r/2 ≤ ‖y‖ → ‖y‖ ≤ 8*L*r → + conditionalPacketDensity P raw obs g c r₀ s datum y ≤ (B/τ^3)*(K/r^3)) → + (∀ y,3*r/4 ≤ ‖y‖ → ‖y‖ ≤ 6*L*r → + ‖y‖^4*(Z*coulombKernel y-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) y) ≤ physicalSpatialCap) → + ∀ y z : Position,r ≤ ‖y‖ → ‖y‖ ≤ 4*L*r → ‖z-y‖ ≤ r/16 → + let F := fun x => Z*coulombKernel x-potentialOf (conditionalPacketDensity P raw obs g c r₀ s datum) x + ‖F z-F y‖ ≤ C*(‖z-y‖/r)*((r/τ)^3/r^4+max (-F y) 0) := by + obtain ⟨C,hC,H⟩ := atomic_band_negative_oscillation (mul_nonneg hB hK) + (by have := physicalSpatialCap_pos; positivity : 0 ≤ 16*physicalSpatialCap) + refine ⟨C,hC,?_⟩ + intro Ω Data mΩ mData n P hP raw obs g hg hgs hm c r₀ s hc hr₀ hs datum Z r L τ hr hL hτ hτr hden hcap y z hy0 hy1 hz + let ρ := conditionalPacketDensity P raw obs g c r₀ s datum + have hi : Integrable ρ := mixturePacketDensity_integrable hg hm hc hr₀ hs _ + have hmeas : Measurable ρ := mixturePacketDensity_measurable _ hg hc hr₀ hs + have hp : ∀ x,0 ≤ ρ x := conditionalPacketDensity_nonneg P raw obs g hc hr₀ hs datum + obtain ⟨A,hA,HA⟩ := conditionalPacketDensity_bounded P raw obs hg hgs hc hr₀ hs + have hlam : 1 ≤ (r/τ)^3 := one_le_pow₀ ((le_div_iff₀ hτ).mpr (by simpa using hτr)) + have hρ (x) (hx0 : 3*r/4 ≤ ‖x‖) (hx1 : ‖x‖ ≤ 6*L*r) : ρ x ≤ (r/τ)^3*((B*K)/r^6) := by + have hh := hden x (by linarith) (by nlinarith [mul_nonneg (by linarith : 0 ≤ L) hr.le]) + apply hh.trans_eq + field_simp + have hcapPos := physicalSpatialCap_pos + have hF (x) (hx0 : 3*r/4 ≤ ‖x‖) (hx1 : ‖x‖ ≤ 6*L*r) : + Z*coulombKernel x-potentialOf ρ x ≤ (r/τ)^3*((16*physicalSpatialCap)/r^4) := by + have hxn : 0 < ‖x‖ := by linarith + have hpow : (r/2)^4 ≤ ‖x‖^4 := pow_le_pow_left₀ (by positivity) (by linarith) 4 + have hhalf : physicalSpatialCap/‖x‖^4 ≤ physicalSpatialCap/(r/2)^4 := + div_le_div_of_nonneg_left physicalSpatialCap_pos.le (by positivity) hpow + calc + _ ≤ physicalSpatialCap/‖x‖^4 := (le_div_iff₀ (pow_pos hxn 4)).mpr (by simpa only [mul_comm] using hcap x hx0 hx1) + _ ≤ physicalSpatialCap/(r/2)^4 := hhalf + _ = (16*physicalSpatialCap)/r^4 := by ring + _ ≤ (r/τ)^3*((16*physicalSpatialCap)/r^4) := le_mul_of_one_le_left (by positivity) hlam + exact H ρ Z r L ((r/τ)^3) hi hmeas hp ⟨A,HA datum⟩ + (conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr₀ hs datum) + hr hL hlam hρ hF y z hy0 hy1 hz +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorCount.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..910cb17933a71aa4a202f2cf586e1b7dbcff83da --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorCount.lean @@ -0,0 +1,70 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservedUnordered + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma rawCount_le_displaced {n : ℕ} {S T : Set Position} + (x v : Configuration n) {d : ℝ} + (hdisp : ∀ i,‖x i-v i‖ ≤ d) + (hST : ∀ a∈S,∀ b,‖a-b‖ ≤ d → b∈T) : rawCount S x ≤ rawCount T v := by + apply Finset.sum_le_sum + intro i _ + by_cases hi : x i∈S + · simp only [Set.indicator_of_mem hi,Set.indicator_of_mem (hST _ hi _ (hdisp i)),le_refl] + · rw [Set.indicator_of_notMem hi] + exact Set.indicator_nonneg (fun _ _ => by norm_num) _ + +lemma physical_observed_count_measurable {n J : ℕ} (r : Fin J → ℝ) + (j : ℕ) (k : Fin J) (hk : j ≤ k.val) {S : Set Position} (hS : MeasurableSet S) : + StronglyMeasurable[observationSigma (n:=n) r j] + (fun sample => rawCount S (observedOrdered r k sample)) := by + have H := unorderedSum_tail_stronglyMeasurable (n:=n) r j k + (measurable_const.indicator hS : Measurable (S.indicator (fun _ => (1:ℝ)))) + simpa only [tailObservation,ite_eq_left hk,observedArray,unorderedSum_forgetOrder,rawCount] using H + +lemma posterior_count_le_observed {n J : ℕ} (ν : Measure (Configuration n)) + [IsProbabilityMeasure ν] (r : Fin J → ℝ) (hr : ∀ k,0 ≤ r k) + {j : ℕ} (k : Fin J) (hk : j ≤ k.val) {S T : Set Position} + (hS : MeasurableSet S) (hT : MeasurableSet T) + (hST : ∀ a∈S,∀ b,‖a-b‖ ≤ Real.sqrt 3*(r k)^(101/100:ℝ) → b∈T) : + ∀ᵐ sample ∂observationLaw J ν, + (∫ x,rawCount S x ∂ProbabilityTheory.condDistrib Prod.fst (tailObservation r j) + (observationLaw J ν) (tailObservation r j sample)) ≤ rawCount T (observedOrdered r k sample) := by + let P := observationLaw J ν + let f := fun sample : ObservationSample n J => rawCount S sample.1 + let H := fun sample : ObservationSample n J => rawCount T (observedOrdered r k sample) + have hfν : Integrable (rawCount (n:=n) S) ν := by + apply Integrable.of_bound (measurable_rawCount hS).aestronglyMeasurable (n:ℝ) + filter_upwards [] with x + rw [Real.norm_of_nonneg (rawCount_nonneg S x)] + exact rawCount_le_number S x + have hf : Integrable f P := (observationLaw_rawProjection ν).integrable_comp_of_integrable hfν + have hHm := physical_observed_count_measurable (n:=n) r j k hk hT + have hH : Integrable H P := by + apply Integrable.of_bound (hHm.mono (observationSigma_le r j)).aestronglyMeasurable (n:ℝ) + filter_upwards [] with sample + rw [Real.norm_of_nonneg (rawCount_nonneg T _)] + exact rawCount_le_number T _ + have hle : ∀ᵐ sample ∂P,f sample ≤ H sample := by + filter_upwards [observationLaw_ae_displacement ν r hr] with sample hh + exact rawCount_le_displaced sample.1 (observedOrdered r k sample) (hh k) hST + have Hle := condExp_mono hf hH hle (m:=observationSigma r j) + rw [condExp_of_stronglyMeasurable (observationSigma_le r j) hHm hH] at Hle + have He := ProbabilityTheory.condExp_ae_eq_integral_condDistrib + (measurable_tailObservation r j) (observationLaw_rawProjection ν).measurable.aemeasurable + (measurable_rawCount hS).stronglyMeasurable hf + filter_upwards [Hle,He] with sample hh he + rw [←he] + exact hh +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorDataMeasurable.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorDataMeasurable.lean new file mode 100644 index 0000000000000000000000000000000000000000..cec1d37df72a64df487d9d55fc63f38a9bf978cf --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorDataMeasurable.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservedUnordered +import OAI.Analysis.CoulombRadii.Packets.OriginalPotentialTower +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalRetainedLikelihood + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +namespace NeutralAtom + +lemma measurable_conditionalPacketDensity_data {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) {c r₀ s : ℝ} + (hc : 0 conditionalPacketDensity P raw obs g c r₀ s datum y) := by + exact (((continuous_rawPacketDensity hg hc hr hs).comp + (continuous_id.prodMk continuous_const)).stronglyMeasurable.integral_kernel + (κ:=ProbabilityTheory.condDistrib raw obs P)).measurable + +lemma measurable_conditionalPacketPotential_data {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} + (hc : 0 potentialOf (conditionalPacketDensity P raw obs g c r₀ s datum) y) := by + have H := ((measurable_rawPacketPotential (n:=n) hg hc hr hs y).stronglyMeasurable.integral_kernel + (κ:=ProbabilityTheory.condDistrib raw obs P)).measurable + convert H using 1 + funext datum + exact mixturePacketPotential hg hgs hm hc hr hs _ y + +lemma measurable_packetKernel_center {g : Position → ℝ} (hg : Continuous g) + {c r₀ s : ℝ} (hc : 0 packetKernel g c r₀ s x y) := by + exact ((continuous_packetKernel hg hc hr hs).comp + (continuous_id.prodMk continuous_const)).measurable +end NeutralAtom + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +namespace NeutralAtom + +lemma measureReal_mono_ae_of_finite {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) + [IsFiniteMeasure P] {A B : Set Ω} (h : A ≤ᵐ[P] B) : P.real A ≤ P.real B := + ENNReal.toReal_mono (measure_ne_top P B) (measure_mono_ae h) + +lemma posterior_inverse_failure_transfer {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] (P : Measure Ω) [IsFiniteMeasure P] + {obs : Ω → B} (hobs : Measurable obs) {μ H S C : B → ℝ} + (hH : Measurable H) (hS : Measurable S) (hC : Measurable C) + {m q e L U p : ℝ} + (hmatch : ∀ᵐ z ∂P, C (obs z) ≤ m → |μ (obs z)-S (obs z)| ≤ e) + (hhi : ∀ {A : Set B}, MeasurableSet A → + (∀ d∈A, C d ≤ m) → (∀ d∈A, q-e ≤ S d) → (∀ d∈A,H d ≤ L) → P.real (obs ⁻¹' A) ≤ p) + (hlo : ∀ {A : Set B}, MeasurableSet A → + (∀ d∈A, C d ≤ m) → (∀ d∈A, S d ≤ q+e) → (∀ d∈A,U ≤ H d) → P.real (obs ⁻¹' A) ≤ p) : + P.real {z | C (obs z) ≤ m ∧ q ≤ μ (obs z) ∧ H (obs z) ≤ L} ≤ p ∧ + P.real {z | C (obs z) ≤ m ∧ μ (obs z) ≤ q ∧ U ≤ H (obs z)} ≤ p := by + have transfer {event : Set Ω} {dataEvent : Set B} (hmeas : MeasurableSet dataEvent) + (hsub : event ≤ᵐ[P] obs ⁻¹' dataEvent) : P.real event ≤ P.real (obs ⁻¹' dataEvent) := by + have hnull : P.real (event \ obs ⁻¹' dataEvent) = 0 := by + simp only [measureReal_def, ae_le_set.mp hsub, ENNReal.toReal_zero] + rw [← measureReal_inter_add_sdiff (hmeas.preimage hobs), hnull, add_zero] + exact measureReal_mono Set.inter_subset_right + have hmeasHi : MeasurableSet {datum | C datum ≤ m ∧ q-e ≤ S datum ∧ H datum ≤ L} := + (measurableSet_le hC measurable_const).inter + ((measurableSet_le measurable_const hS).inter (measurableSet_le hH measurable_const)) + have hmeasLo : MeasurableSet {datum | C datum ≤ m ∧ S datum ≤ q+e ∧ U ≤ H datum} := + (measurableSet_le hC measurable_const).inter + ((measurableSet_le hS measurable_const).inter (measurableSet_le measurable_const hH)) + have Hhi := hhi (A:={d | C d ≤ m ∧ q-e ≤ S d ∧ H d ≤ L}) hmeasHi + (fun _ hd =>hd.1) (fun _ hd =>hd.2.1) (fun _ hd =>hd.2.2) + have Hlo := hlo (A:={d | C d ≤ m ∧ S d ≤ q+e ∧ U ≤ H d}) hmeasLo + (fun _ hd =>hd.1) (fun _ hd =>hd.2.1) (fun _ hd =>hd.2.2) + constructor + · exact (transfer hmeasHi (by + filter_upwards [hmatch] with z hz + intro hd + exact ⟨hd.1,by linarith [(abs_le.mp (hz hd.1)).2,hd.2.1],hd.2.2⟩)).trans Hhi + · exact (transfer hmeasLo (by + filter_upwards [hmatch] with z hz + intro hd + exact ⟨hd.1,by linarith [(abs_le.mp (hz hd.1)).1,hd.2.1],hd.2.2⟩)).trans Hlo + +@[simp] lemma unorderedSum_retainedTailObservation {n J : ℕ} {j : ℕ} + (k : RetainedScales J j) (f : Position → ℝ) + (z : (RetainedScales J j × (Fin n × Fin 3)) → ℝ) : + unorderedSum f (retainedTailObservation j z k.val)= + ∑ i,f (observationArrayPositions k z i) := by + simp only [retainedTailObservation,dite_eq_left k.property,unorderedSum_forgetOrder] + +@[simp] lemma unorderedSum_tailObservation {n J : ℕ} (r : Fin J → ℝ) {j : ℕ} + (k : Fin J) (hk : j ≤ k.val) (f : Position → ℝ) (z : ObservationSample n J) : + unorderedSum f (tailObservation r j z k)=∑ i,f (observedOrdered r k z i) := by + simp only [tailObservation,ite_eq_left hk,observedArray,unorderedSum_forgetOrder] + +lemma retained_inverse_gate_transfer {n J : ℕ} (ν : Measure (Configuration n)) + [IsProbabilityMeasure ν] (r : Fin J → ℝ) {j : ℕ} (k : RetainedScales J j) + {ball : Set Position} (hb : MeasurableSet ball) {f : Position → ℝ} (hf : Measurable f) + {μ H : (Fin J → UnorderedArray n) → ℝ} (hH : Measurable H) {m e q L U p : ℝ} + (hmatch : ∀ᵐ z ∂observationLaw J ν, rawCount ball (observedOrdered r k.val z) ≤ m → + |μ (tailObservation r j z)-(∑ i,f (observedOrdered r k.val z i))| ≤ e) + (hhi : ∀ {B : Set (Fin J → UnorderedArray n)}, MeasurableSet B → + (∀ z∈retainedTailObservation j ⁻¹' B,rawCount ball (observationArrayPositions k z) ≤ m) → + (∀ z∈retainedTailObservation j ⁻¹' B,q-e ≤ ∑ i,f (observationArrayPositions k z i)) → + (∀ᵐ z ∂observationLaw J ν,z∈tailObservation r j ⁻¹' B → H (tailObservation r j z) ≤ L) → + (observationLaw J ν).real (tailObservation r j ⁻¹' B) ≤ p) + (hlo : ∀ {B : Set (Fin J → UnorderedArray n)}, MeasurableSet B → + (∀ z∈retainedTailObservation j ⁻¹' B,rawCount ball (observationArrayPositions k z) ≤ m) → + (∀ z∈retainedTailObservation j ⁻¹' B,(∑ i,f (observationArrayPositions k z i)) ≤ q+e) → + (∀ᵐ z ∂observationLaw J ν,z∈tailObservation r j ⁻¹' B → U ≤ H (tailObservation r j z)) → + (observationLaw J ν).real (tailObservation r j ⁻¹' B) ≤ p) : + (observationLaw J ν).real {z | rawCount ball (observedOrdered r k.val z) ≤ m ∧ + q ≤ μ (tailObservation r j z) ∧ H (tailObservation r j z) ≤ L} ≤ p ∧ + (observationLaw J ν).real {z | rawCount ball (observedOrdered r k.val z) ≤ m ∧ + μ (tailObservation r j z) ≤ q ∧ U ≤ H (tailObservation r j z)} ≤ p := by + let C := fun datum : Fin J → UnorderedArray n => + unorderedSum (ball.indicator (fun _ => (1:ℝ))) (datum k.val) + let S := fun datum : Fin J → UnorderedArray n => unorderedSum f (datum k.val) + have hS : Measurable S := (measurable_unorderedSum hf).comp (measurable_pi_apply k.val) + have hC : Measurable C := (measurable_unorderedSum + (measurable_const.indicator hb)).comp (measurable_pi_apply k.val) + have hcount (z : ObservationSample n J) : + C (tailObservation r j z)=rawCount ball (observedOrdered r k.val z) := by + simp only [C,unorderedSum_tailObservation r k.val k.property,rawCount] + have hsum (z : ObservationSample n J) : + S (tailObservation r j z)=∑ i,f (observedOrdered r k.val z i) := by + simp only [S,unorderedSum_tailObservation r k.val k.property] + have hcRet (z : (RetainedScales J j × (Fin n × Fin 3)) → ℝ) : + C (retainedTailObservation j z)=rawCount ball (observationArrayPositions k z) := by + simp only [C,unorderedSum_retainedTailObservation,rawCount] + have hsRet (z : (RetainedScales J j × (Fin n × Fin 3)) → ℝ) : + S (retainedTailObservation j z)=∑ i,f (observationArrayPositions k z i) := by + simp only [S,unorderedSum_retainedTailObservation] + have HH := posterior_inverse_failure_transfer (observationLaw J ν) + (measurable_tailObservation r j) hH hS hC (by simpa only [hcount,hsum] using hmatch) + (q:=q) (L:=L) (U:=U) (p:=p) + (by + intro B hB hcnt hgate hfld + apply hhi hB + · intro z hz; rw [←hcRet]; exact hcnt _ hz + · intro z hz; rw [←hsRet]; exact hgate _ hz + · exact Eventually.of_forall (fun z hz => hfld _ hz)) + (by + intro B hB hcnt hgate hfld + apply hlo hB + · intro z hz; rw [←hcRet]; exact hcnt _ hz + · intro z hz; rw [←hsRet]; exact hgate _ hz + · exact Eventually.of_forall (fun z hz => hfld _ hz)) + simpa only [hcount] using HH +end NeutralAtom + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorDensityContinuity.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorDensityContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..790236adcf1cb7d9dd17e50378867c18af300fc3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorDensityContinuity.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationAverageAE + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +lemma mixturePacketDensity_continuous {n : ℕ} (ν : Measure (Configuration n)) [IsProbabilityMeasure ν] + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) {c r s : ℝ} + (hc : 0 ∫ o,rawPacketDensity g c r s o x ∂ν) + have hb : ∀ D : ℝ,∃ C : ℝ,∀ (o : Configuration n) x,x∈Metric.closedBall 0 D → |rawPacketDensity g c r s o x|≤C := by + intro D + refine ⟨n*((c*r*(min r s)^packetExponent)^(-3:ℤ)*A),fun o x _ => ?_⟩ + rw [abs_of_nonneg (rawPacketDensity_nonneg g hc hr hs o x)] + exact rawPacketDensity_bound hA hAb hc hr hs o x + have hj : Continuous (fun z : Configuration n×Position => rawPacketDensity g c r s z.1 z.2) := + continuous_rawPacketDensity hg hc hr hs + have hx : ∀ o : Configuration n,Continuous (rawPacketDensity g c r s o) := by + intro o + exact Continuous.uncurry_left (f:=rawPacketDensity g c r s) o hj + exact continuous_average_of_ball_bounds (μ:=ν) (f:=fun (o : Configuration n) (x : Position) => rawPacketDensity g c r s o x) hx hj.measurable hb + +lemma conditionalPacketDensity_continuous {Ω A : Type*} + [MeasurableSpace Ω] [MeasurableSpace A] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → A) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) {c r s : ℝ} + (hc : 0 conditionalPacketDensity P raw obs g c r s z.1 z.2) := by + have H : Measurable (fun z : Position×A => conditionalPacketDensity P raw obs g c r s z.2 z.1) := + measurable_uncurry_of_continuous_of_measurable + (conditionalPacketDensity_continuous P raw obs hg hgs hc hr hs) + (measurable_conditionalPacketDensity_data P raw obs hg hc hr hs) + exact H.comp measurable_swap +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter ProbabilityTheory +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Posterior +variable {Ω A : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [Nonempty Ω] [MeasurableSpace A] +variable (P : Measure Ω) [IsProbabilityMeasure P] (obs : Ω → A) + +def posteriorAverage (f : Ω → Position → ℝ) (a : A) (x : Position) : ℝ := + ∫ o,f o x ∂ProbabilityTheory.condDistrib id obs P a +lemma posteriorAverage_joint_measurable {f : Ω → Position → ℝ} + (hf : Measurable (Function.uncurry f)) : Measurable (Function.uncurry (posteriorAverage P obs f)) := by + let κ : ProbabilityTheory.Kernel (A×Position) Ω := (ProbabilityTheory.condDistrib id obs P).comap (Prod.fst : A×Position → A) measurable_fst + have H : StronglyMeasurable (fun z : (A×Position)×Ω => f z.2 z.1.2) := + hf.stronglyMeasurable.comp_measurable (measurable_snd.prodMk measurable_fst.snd) + exact (H.integral_kernel_prod_right' (κ:=κ)).measurable +lemma posteriorAverage_uniform_bounds {f : Ω → Position → ℝ} + (hb : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |f o x|≤C) : + ∀ D : ℝ,∃ C : ℝ,∀ a x,x∈Metric.closedBall 0 D → |posteriorAverage P obs f a x|≤C := by + intro D + obtain ⟨C,hC⟩ := hb D + refine ⟨C,fun a x hx => ?_⟩ + calc + |posteriorAverage P obs f a x| ≤ ∫ o, |f o x| ∂ProbabilityTheory.condDistrib id obs P a := abs_integral_le_integral_abs + _ ≤ ∫ _ : Ω, C ∂ProbabilityTheory.condDistrib id obs P a := integral_mono_of_nonneg + (Eventually.of_forall (fun o => abs_nonneg (f o x))) (integrable_const C) + (Eventually.of_forall (fun o => hC o x hx)) + _ = C := by simp +lemma posterior_ae {q : Ω → Prop} (ho : Measurable obs) (hq : ∀ᵐ o ∂P,q o) : + ∀ᵐ o ∂P,∀ᵐ v ∂ProbabilityTheory.condDistrib id obs P (obs o),q v := by + have H : ∀ᵐ v ∂(ProbabilityTheory.condDistrib id obs P ∘ₘ P.map obs),q v := by + simpa only [ProbabilityTheory.condDistrib_comp_map ho.aemeasurable aemeasurable_id,Measure.map_id] using hq + exact ae_of_ae_map ho.aemeasurable (Measure.ae_ae_of_ae_comp H) +lemma posteriorAverage_invariant {B C r Z L : ℝ} (hr : 0 he x) + filter_upwards [H] with o ho + exact Continuous.ext_on hSd (hf o) (hg o) (fun x hx => ho ⟨x,hx⟩) + +theorem posteriorPacketDensity_tower {n J : ℕ} (ν : Measure (Configuration n)) [IsProbabilityMeasure ν] + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) {c r₀ s : ℝ} + (hc : 0 conditionalPacketDensity P Prod.fst (tailObservation r i) g c r₀ s (tailObservation r i o) + ∀ᵐ o ∂P,posteriorAverage P (tailObservation r j) μi (tailObservation r j o)= + conditionalPacketDensity P Prod.fst (tailObservation r j) g c r₀ s (tailObservation r j o) := by + let P := observationLaw J ν + let oi := tailObservation (n:=n) r i + let oj := tailObservation (n:=n) r j + let μi := fun o => conditionalPacketDensity P Prod.fst oi g c r₀ s (oi o) + have hoi : Measurable oi := measurable_tailObservation r i + have hoj : Measurable oj := measurable_tailObservation r j + have hμ : Measurable (Function.uncurry μi) := + (measurable_conditionalPacketDensity_joint P Prod.fst oi hg hgs hc hr hs).comp (hoi.prodMap measurable_id) + obtain ⟨A,hA,hAb⟩ := conditionalPacketDensity_bounded P Prod.fst oi hg hgs hc hr hs + have hb : ∀ D : ℝ,∃ C : ℝ,∀ o x,x∈Metric.closedBall 0 D → |μi o x|≤C := by + intro D + refine ⟨A,fun o x _ => ?_⟩ + change |conditionalPacketDensity P Prod.fst oi g c r₀ s (oi o) x|≤A + simpa only [abs_of_nonneg (conditionalPacketDensity_nonneg P Prod.fst oi g hc hr hs (oi o) x)] using hAb (oi o) x + apply ae_all_position_eq P + (fun o => continuous_average_of_ball_bounds + (fun v => conditionalPacketDensity_continuous P Prod.fst oi hg hgs hc hr hs (oi v)) hμ hb) + (fun o => conditionalPacketDensity_continuous P Prod.fst oj hg hgs hc hr hs (oj o)) + intro x + have hi : (fun o => μi o x)=ᵐ[P] + P[fun o => rawPacketDensity g c r₀ s o.1 x | observationSigma r i] := + conditionalPacketDensity_eq_condExp P ν (observationLaw_rawProjection ν) hoi hg hgs hc hr hs x + have hj : (fun o => conditionalPacketDensity P Prod.fst oj g c r₀ s (oj o) x)=ᵐ[P] + P[fun o => rawPacketDensity g c r₀ s o.1 x | observationSigma r j] := + conditionalPacketDensity_eq_condExp P ν (observationLaw_rawProjection ν) hoj hg hgs hc hr hs x + have hix := integrable_section_of_ball_bounds (μ:=P) hμ hb x + have ha := ProbabilityTheory.condExp_ae_eq_integral_condDistrib_id hoj hix + exact ha.symm.trans ((condExp_congr_ae hi).trans + ((condExp_condExp_of_le (observationSigma_antitone r hij) (observationSigma_le r i)).trans hj.symm)) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorFieldPDE.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorFieldPDE.lean new file mode 100644 index 0000000000000000000000000000000000000000..a09d5e949ac78411c439ab1298a50286885c3546 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorFieldPDE.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalPosteriorInverse + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma atomic_screenedField_weakLaplacian {ρ : Position → ℝ} (hi : Integrable ρ) + (hc : Continuous (potentialOf ρ)) (Z : ℝ) {U : Set Position} (hU : (0:Position) ∉ U) : + HasWeakLaplacian (fun x => Z*coulombKernel x-potentialOf ρ x) U + (fun x => 4*Real.pi*ρ x) := by + intro φ hφ hφc ht + have hL := continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLc := hasCompactSupport_coordinateLaplacian hφc + have hts : tsupport (coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + exact hx (coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + have hK : Integrable (fun x => coulombKernel x*coordinateLaplacian φ x) := by + apply integrable_mul_compact_of_continuousAt _ hL hLc + intro x hx + have hn : x≠0 := fun he => hU (he ▸ ht (hts hx)) + exact continuous_norm.continuousAt.inv₀ (norm_ne_zero_iff.mpr hn) + have hP : Integrable (fun x => potentialOf ρ x*coordinateLaplacian φ x) := + (hc.mul hL).integrable_of_hasCompactSupport hLc.mul_left + have he : (∫ x,coulombKernel x*coordinateLaplacian φ x)=0 := by + rw [integral_coulombKernel_laplacian hφ hφc, + image_eq_zero_of_notMem_tsupport (fun h => hU (ht h))] + ring + simp_rw [sub_mul,mul_assoc] + rw [integral_sub (hK.const_mul Z) hP,integral_const_mul,he,mul_zero, + potentialOf_weakLaplacian hi φ hφ hφc (fun _ _ => mem_univ _)] + simp only [neg_mul,integral_neg,zero_sub,neg_neg] + apply integral_congr_ae + filter_upwards [] with x + ring + +lemma conditionalPacketField_weakLaplacian {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} + (hc : 0 Z*coulombKernel x-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) x) U + (fun x => 4*Real.pi*conditionalPacketDensity P raw obs g c r₀ s datum x) := + atomic_screenedField_weakLaplacian (mixturePacketDensity_integrable hg hm hc hr hs _) + (conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr hs datum) Z hU + +lemma conditionalPacketField_continuousOn {Ω B : Type*} + [MeasurableSpace Ω] [MeasurableSpace B] {n : ℕ} + (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → B) + {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) + (hm : (∫ z,g z^2)=1) {c r₀ s : ℝ} + (hc : 0 Z*coulombKernel x-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) x) U := by + apply ContinuousOn.sub _ + (conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr hs datum).continuousOn + apply ContinuousOn.mul continuousOn_const + exact continuous_norm.continuousOn.inv₀ (fun x hx => norm_ne_zero_iff.mpr + (fun he => hU (he ▸ hx))) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorRegularBounds.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorRegularBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..08da7b164163546421348807e089f451b7038045 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorRegularBounds.lean @@ -0,0 +1,51 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.CorrectionDensity +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalDensity + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +section Fields +variable {Ω A : Type*} [MeasurableSpace Ω] [MeasurableSpace A] {n : ℕ} +variable (P : Measure Ω) [IsFiniteMeasure P] (raw : Ω → Configuration n) (obs : Ω → A) +variable {g : Position → ℝ} (hg : Continuous g) (hgs : HasCompactSupport g) +variable (hm : (∫ z,g z^2)=1) {c r s : ℝ} (hc : 0 ⟨C,fun a x _ => by + rw [abs_of_nonneg (conditionalPacketDensity_nonneg P raw obs g hc hr hs a x)] + exact hCb a x⟩ + +include hm +lemma conditionalPacketPotential_bounded : ∃ C : ℝ,0≤C ∧ ∀ a x, + |potentialOf (conditionalPacketDensity P raw obs g c r s a) x|≤C := by + obtain ⟨A,hA,hAb⟩ := conditionalPacketDensity_bounded P raw obs hg hgs hc hr hs + refine ⟨A*kernelBallMass 1+n,add_nonneg (mul_nonneg hA (kernelBallMass_nonneg 1)) (Nat.cast_nonneg n),fun a x => ?_⟩ + rw [abs_of_nonneg (potentialOf_nonneg (conditionalPacketDensity_nonneg P raw obs g hc hr hs a) x)] + have H := (potential_integrable_and_bound (x:=x) (mixturePacketDensity_integrable hg hm hc hr hs _) + (conditionalPacketDensity_nonneg P raw obs g hc hr hs a) (by norm_num : (0:ℝ)<1) + (fun y _ => hAb a y)).2 + change potentialOf (conditionalPacketDensity P raw obs g c r s a) x ≤ + A*kernelBallMass 1+1⁻¹*(∫ y,conditionalPacketDensity P raw obs g c r s a y) at H + simpa only [inv_one,one_mul,conditionalPacketDensity_mass P raw obs hg hm hc hr hs] using H + +lemma conditionalPacketOffset_uniform_bounds : + ∀ D : ℝ,∃ C : ℝ,∀ a x,x∈Metric.closedBall 0 D → + |-potentialOf (conditionalPacketDensity P raw obs g c r s a) x|≤C := by + obtain ⟨C,hC,hCb⟩ := conditionalPacketPotential_bounded P raw obs hg hgs hm hc hr hs + exact fun D => ⟨C,fun a x _ => by simpa only [abs_neg] using hCb a x⟩ +end Fields +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorShellError.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorShellError.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec73a30250b7b5c5caf8e8334191f6cbb3dbc2cb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorShellError.lean @@ -0,0 +1,60 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ConditionalDensity + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom +lemma conditional_packet_event_mass {Ω A : Type*} [MeasurableSpace Ω] [MeasurableSpace A] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + {raw : Ω → Configuration n} {obs : Ω → A} (hraw : MeasurePreserving raw P ν) + (ho : Measurable obs) {g : Position → ℝ} (hg : Continuous g) (hm : (∫ y,g y^2)=1) + {c r₀ s : ℝ} (hc : 0 packetMass g c r₀ s S (raw o) | MeasurableSpace.comap obs inferInstance]) o ∂P := + integral_congr_ae (ae_restrict_of_ae (conditionalPacketDensity_annulus_eq_condExp P ν hraw ho hg hm hc hr₀ hs S)) + _ = _ := setIntegral_condExp hle (hraw.integrable_comp_of_integrable hi) hB + +lemma conditional_packet_event_bound {Ω A : Type*} [MeasurableSpace Ω] [MeasurableSpace A] + {n : ℕ} (P : Measure Ω) [IsFiniteMeasure P] (ν : Measure (Configuration n)) [IsFiniteMeasure ν] + {raw : Ω → Configuration n} {obs : Ω → A} (hraw : MeasurePreserving raw P ν) + (ho : Measurable obs) {g : Position → ℝ} (hg : Continuous g) (hm : (∫ y,g y^2)=1) + {c r₀ s : ℝ} (hc : 0 by + rw [Real.norm_of_nonneg (rawCount_nonneg T x)]; exact rawCount_le_number T x)) + have hY := hX.comp_measurePreserving hraw + calc + _ ≤ ∫ o in B,rawCount T (raw o) ∂P := integral_mono + (hraw.integrable_comp_of_integrable hi).integrableOn + (hY.integrable (by norm_num)).integrableOn + (fun o => packetMass_le_rawCount g hm hc hr₀ hs S T hST (raw o)) + _ ≤ Real.sqrt (∫ o,(rawCount T (raw o))^2 ∂P)*Real.sqrt (P.real B) := + exceptional_event_bound hY (Eventually.of_forall (fun o => rawCount_nonneg T (raw o))) (ho.comap_le B hB) + _ = _ := by + have H := integral_map hraw.measurable.aemeasurable + (((measurable_rawCount hT).pow_const 2).aestronglyMeasurable : + AEStronglyMeasurable (fun x : Configuration n => (rawCount T x)^2) (P.map raw)) + rw [hraw.map_eq] at H + rw [←H] +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorSpatialCap.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorSpatialCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..9794170236aaea5f742419ca98424755508a43b6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/PosteriorSpatialCap.lean @@ -0,0 +1,130 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalPosteriorInverse +import OAI.Analysis.CoulombRadii.Screening.AnnularSubmeanCap +import OAI.Analysis.CoulombRadii.Screening.PhysicalCapMoment + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +def physicalSpatialCap : ℝ := 32*physicalFieldCapBase+1 +lemma physicalSpatialCap_pos : 0 Z*coulombKernel y-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s (obs ω)) y + let T := 2*physicalFieldCapBase + let A := {y : Position | r/2≤‖y‖ ∧ ‖y‖≤8*L*r} + let Q := fun wy : Ω × Position => max (‖wy.2‖^4*F wy.1 wy.2-T) 0 + let V := 4*Real.pi/3*(r/8)^3 + have hV : 0 F wy.1 wy.2) := by + have hp := measurable_conditionalPacketPotential_joint P raw obs hg hgs hm hc hr₀ hs + have hcmeas : Measurable (fun wy : Ω × Position => + potentialOf (conditionalPacketDensity P raw obs g c r₀ s (obs wy.1)) wy.2) := by + change Measurable ((fun dy : B × Position => + potentialOf (conditionalPacketDensity P raw obs g c r₀ s dy.1) dy.2) ∘ + (fun wy : Ω × Position => (obs wy.1,wy.2))) + exact hp.comp ((hobs.comp measurable_fst).prodMk measurable_snd) + exact ((measurable_coulombKernel.comp measurable_snd).const_mul Z).sub hcmeas + have hQmeas : Measurable Q := + (((measurable_snd.norm.pow_const 4).mul hFmeas).sub_const T).max measurable_const + have hQ0 : ∀ wy,0≤Q wy := fun _ => le_max_right _ _ + have HB : ∀ ω y,y∈A → Q (ω,y)≤Z*(8*L*r)^3 := by + intro ω y hy + exact posterior_scaled_excess_bounded P raw obs g hc hr₀ hs (obs ω) hZ hr hL hT hy.1 hy.2 + obtain ⟨hI,hi,hprob⟩ := spatial_moment_markov P hA.measurableSet hA.measure_lt_top + hQmeas hQ0 HB (fun y hy => hM y hy.1 hy.2) (div_pos hV (by norm_num : (0:ℝ)<16)) + let G := {ω | (∫ y in A,Q (ω,y))≤V/16} + have hIdata : Measurable (fun datum : B => ∫ y in A, + max (‖y‖^4*(Z*coulombKernel y-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) y)-T) 0) := by + have hp := measurable_conditionalPacketPotential_joint P raw obs hg hgs hm hc hr₀ hs + have hq : Measurable (fun dy : B × Position => max (‖dy.2‖^4*(Z*coulombKernel dy.2-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s dy.1) dy.2)-T) 0) := + (((measurable_snd.norm.pow_const 4).mul + (((measurable_coulombKernel.comp measurable_snd).const_mul Z).sub hp)).sub_const T).max measurable_const + exact hq.stronglyMeasurable.integral_prod_right'.measurable + have hGtail : MeasurableSet[MeasurableSpace.comap obs ‹MeasurableSpace B›] G := by + exact ⟨{datum : B | (∫ y in A,max (‖y‖^4*(Z*coulombKernel y-potentialOf + (conditionalPacketDensity P raw obs g c r₀ s datum) y)-T) 0)≤V/16}, + measurableSet_le hIdata measurable_const,rfl⟩ + refine ⟨G,⟨measurableSet_le hI measurable_const,hGtail⟩,?_,?_⟩ + · have hGe : Gᶜ={ω | V/16<(∫ y in A,Q (ω,y))} := by ext ω; simp only [G,mem_compl_iff,mem_ofPred_eq,not_le] + rw [hGe] + apply hprob.trans + have hv := cap_annulus_volume_ratio hr hL + have he : volume.real A*M/(V/16)=16*(volume.real A/V)*M := by ring + rw [he] + nlinarith [mul_le_mul_of_nonneg_right hv hM0] + · intro ω hω y hy0 hy1 + have hFn : ContinuousOn (F ω) (Metric.closedBall y (r/8)) := by + apply (continuousOn_const.mul (continuous_norm.continuousOn.inv₀ ?_)).sub + (conditionalPacketPotential_continuous P raw obs hg hgs hm hc hr₀ hs (obs ω)).continuousOn + intro z hz + have hn := (cap_ball_geometry hr hL hy0 hy1 hz).1 + have hz0 : 0<‖z‖ := by linarith + exact ne_of_gt hz0 + have hmean := conditionalPacketField_submean P raw obs hg hgs hm hc hr₀ hs + (obs ω) Z (div_pos hr (by norm_num : (0:ℝ)<8)) y (by linarith : r/8≤‖y‖) + have H := annular_submean_cap hr hL hT (hi ω) hy0 hy1 + (hFn.integrableOn_compact (isCompact_closedBall _ _)) hmean + have hω' : (∫ z in A,Q (ω,z))≤V/16 := hω + have hsmall : 16*V⁻¹*(∫ z in A,Q (ω,z))≤1 := by + have hh := mul_le_mul_of_nonneg_left hω' (by positivity : 0≤16*V⁻¹) + have he : 16*V⁻¹*(V/16)=1 := by field_simp + exact hh.trans_eq he + change ‖y‖^4*F ω y≤physicalSpatialCap + change ‖y‖^4*F ω y≤16*T+16*V⁻¹*(∫ z in A,Q (ω,z)) at H + dsimp [physicalSpatialCap,T] at * + linarith +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/QuantumRetainedFamily.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/QuantumRetainedFamily.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d61b25a45a72585f3149c6e8e508224bec07280 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/QuantumRetainedFamily.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.Rescaling +import OAI.Analysis.CoulombRadii.Propagation.RetainedGoodEvent + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +def physical_family_of_data {Ω : ℕ → Type*} [∀ n,MeasurableSpace (Ω n)] + (P : ∀ n,Measure (Ω n)) (μ : ∀ n,Ω n → Position → ℝ) + (Z q : ℕ → ℕ) (s r : ℕ → ℝ) (B C L Ccap : ℝ) + (hB : 0 < B) (hcap : 0 ≤ Ccap) (hs : ∀ n,0 < s n) (hr : ∀ n,0 < r n) + (hslim : Tendsto s atTop (𝓝 0)) (hqlim : Tendsto q atTop atTop) + (hlo : ∀ n,1/(2*(q n:ℝ)) ≤ r n/s n) (hhi : ∀ n,r n/s n ≤ (q n:ℝ)⁻¹) + (hμi : ∀ n o,Integrable (μ n o)) (hμp : ∀ n o x,0 ≤ μ n o x) + (Aμ : ℕ → ℝ) (hμb : ∀ n o x,μ n o x ≤ Aμ n) + (hμmass : ∀ n o,(∫ x,μ n o x)=(Z n:ℝ)) + (d : ∀ n,PropagationDatum (P n) B C (r n) (Z n:ℝ) L (μ n)) + (G : ∀ n,Set (Ω n)) + (hvalid : ∀ n o,o∈G n → PropagationInvariant B C (r n) (Z n:ℝ) L + ((d n).offset o) (μ n o) ((d n).error o) ∧ Integrable ((d n).error o) ∧ + (∫ x,(d n).error o x) ≤ 1) + (hband : ∀ n o,o∈G n → ∀ x,r n ≤ ‖x‖ → ‖x‖ ≤ (q n:ℝ)*s n → + screenedField (Z n:ℝ) (μ n o) x ≤ Ccap/‖x‖^4 ∧ + |μ n o x-tfDensityScalar (screenedField (Z n:ℝ) (μ n o) x)| ≤ ((q n:ℝ)^8)⁻¹/‖x‖^6) : + PhysicalRetainedFamily (fun n => G n) where + μ := fun n o => μ n o + u := fun n o x => (Z n:ℝ)*coulombKernel x+(d n).offset o x + p := fun n o => (d n).error o + Z := Z + s := s + r := r + q := q + Aμ := fun n _ => Aμ n + Ap := fun n _ => ((d n).error_global_bound).choose + B := B + Ccap := Ccap + Cinv := C + Bpos := hB + Cpos := hcap + sp := hs + rp := hr + slim := hslim + qlim := hqlim + rlo := hlo + rhi := hhi + μi := fun n o => hμi n o + μp := fun n o => hμp n o + μb := fun n o => hμb n o + μmass := fun n o => hμmass n o + pi := fun n o => (hvalid n o o.property).2.1 + pp := fun n o => (hvalid n o o.property).1.nonnegative_error + pb := fun n o => ((d n).error_global_bound).choose_spec o (hvalid n o o.property).1 + ps := fun n o x hx => (hvalid n o o.property).1.error_support x hx.le + pm := fun n o => (hvalid n o o.property).2.2 + ucont := fun n o => by simpa only [add_sub_cancel_left] using (hvalid n o o.property).1.continuous_offset + ubounds := fun n o x hx => by + simpa only [propagationBarrier_eq] using (hvalid n o o.property).1.caps x hx + uweak := fun n o => by + rw [show barrierSource (r n) (fun x => (Z n:ℝ)*coulombKernel x+(d n).offset o x) + (μ n o) ((d n).error o) = (fun x => propagationRHS (r n) ‖x‖ (μ n o x) + ((d n).error o x) ((Z n:ℝ)*coulombKernel x+(d n).offset o x)) from + funext (barrierSource_eq_propagationRHS _ _ _ _)] + exact (hvalid n o o.property).1.weak + band := fun n o => hband n o o.property +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/RawCap.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/RawCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..30c824cae4826b868a2fb26c6e385f15e9a4af44 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/RawCap.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedEnsemble +import OAI.Analysis.CoulombRadii.Packets.AtomicMesh + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma RecordedEnsemble.rawSquare_nonneg {n J : ℕ} (T : RecordedEnsemble n) (S : Nuclei J) + (y : Space) (a : ℝ) : 0 ≤ T.rawSquare S y a := by + exact Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => integral_nonneg + (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + +lemma RecordedEnsemble.rawSquare_le {n J : ℕ} (T : RecordedEnsemble n) (S : Nuclei J) + (y : Space) {a : ℝ} (ha : 0 mul_nonneg (mass_nonneg _) (sq_nonneg _)) + · exact (mass_coreSlice_integrable (T.vector p) s).mul_const _ + · filter_upwards [] with x + rw [coreConditionalObservable_raw_positive_weight (T.vector p) (attraction S y) + (A := {z | 40*a ≤ ‖z-y‖}) + (isClosed_le continuous_const (by fun_prop)).measurableSet y + (show 0<40*a by positivity) (fun _ h => h)] + apply mul_le_mul_of_nonneg_left _ (mass_nonneg _) + apply pow_le_pow_left₀ (le_max_right _ _) _ 2 + apply max_le _ (attraction_nonneg S y) + linarith [restrictedCorePotential_nonneg (T.vector p |>.coreSlice s x |>.normalized) {z | 40*a ≤ ‖z-y‖} y, + restrictedOutPotential_nonneg x {z | 40*a ≤ ‖z-y‖} y] + +lemma attraction_atomic {J : ℕ} (S : Nuclei J) (hatom : ∀ i, S.position i=0) (y : Space) : + attraction S y=totalCharge S/‖y‖ := by + simp only [attraction,hatom,sub_zero,coulombKernel,div_eq_mul_inv,totalCharge,Finset.sum_mul] + +lemma RecordedEnsemble.rawSquare_atomic_cap {n J : ℕ} (T : RecordedEnsemble n) (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (hm : T.totalMass=1) {y : Space} (hy : y≠0) : + T.rawSquare S y (atomicCellScale y) ≤ (totalCharge S/(100000*atomicCellScale y))^2 := by + simpa only [attraction_atomic S hatom,atomicCellScale_norm,hm,mul_one] using + T.rawSquare_le S y (atomicCellScale_pos hy) + +lemma localCount_mono {n : ℕ} {A B : Set Space} (h : A ⊆ B) (x : Configuration n) : + localCount A x ≤ localCount B x := by + apply Finset.sum_le_sum + intro i hi + by_cases hx : position x i∈A + · simp [hx,h hx] + · simp only [indicator_of_notMem hx] + exact Set.indicator_nonneg (fun _ _ => zero_le_one) _ + +lemma localCountSecondMoment_mono {n : ℕ} (ψ : H1Vector n) {A B : Set Space} + (hB : MeasurableSet B) (h : A ⊆ B) : + localCountSecondMoment ψ A ≤ localCountSecondMoment ψ B := by + apply Finset.sum_le_sum + intro s hs + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun _ => mul_nonneg (sq_nonneg _) (sq_nonneg _)) + · exact localCount_weight_integrable ψ hB s 2 + · exact Eventually.of_forall (fun x => mul_le_mul_of_nonneg_right + (pow_le_pow_left₀ (localCount_nonneg A x) (localCount_mono h x) 2) (sq_nonneg _)) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordJensen.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordJensen.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8b997f6c506e46a409f69a8fa4fd7d13a870880 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordJensen.lean @@ -0,0 +1,180 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.CutRefinement +import OAI.Analysis.CoulombRadii.FormDomain.RecordReindex + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma slice_positive_square_jensen {m k : ℕ} (u : H1Vector (m+k)) + (W : Configuration (m+k) → ℝ) (hW : Measurable W) {B : ℝ} + (hB0 : 0≤B) (hB : ∀ x, |W x| ≤ B) : + mass u*(max (potentialForm W u.normalized) 0)^2 ≤ + sliceExpectation u (fun s x => (max (coreConditionalObservable u W s x) 0)^2) := by + let c := max (potentialForm W u.normalized) 0 + have hc : 0≤c := le_max_right _ _ + have hi (s : Spins m) : Integrable (fun x => mass (u.coreSlice s x)* + (2*c*coreConditionalObservable u W s x-c^2)) := by + have H := (coreConditionalObservable_weight_integrable u W hW hB0 hB s).const_mul (2*c) + have K := (mass_coreSlice_integrable u s).mul_const (c^2) + apply (H.sub K).congr + exact Eventually.of_forall (fun x => by dsimp only [Pi.sub_apply]; ring) + have H0 : sliceExpectation u (fun s x => 2*c*coreConditionalObservable u W s x-c^2) ≤ + sliceExpectation u (fun s x => (max (coreConditionalObservable u W s x) 0)^2) := by + apply Finset.sum_le_sum + intro s hs + exact integral_mono (hi s) (coreConditionalObservable_positive_weight_integrable u W hW hB0 hB s 2) + (fun x => mul_le_mul_of_nonneg_left (positive_square_tangent _ c hc) (mass_nonneg _)) + have he (s : Spins m) : (∫ x, mass (u.coreSlice s x)*(2*c*coreConditionalObservable u W s x-c^2))= + 2*c*(∫ x, mass (u.coreSlice s x)*coreConditionalObservable u W s x)-c^2*(∫ x, mass (u.coreSlice s x)) := by + calc + _ = ∫ x, 2*c*(mass (u.coreSlice s x)*coreConditionalObservable u W s x)-c^2*mass (u.coreSlice s x) := by congr 1; funext x; ring + _ = _ := by rw [integral_sub ((coreConditionalObservable_weight_integrable u W hW hB0 hB s).const_mul _) + ((mass_coreSlice_integrable u s).const_mul _),integral_const_mul,integral_const_mul] + have hs : sliceExpectation u (fun s x => 2*c*coreConditionalObservable u W s x-c^2)= + 2*c*potentialForm W u-c^2*mass u := by + unfold sliceExpectation + simp_rw [he] + rw [Finset.sum_sub_distrib,←Finset.mul_sum,←Finset.mul_sum,integral_mass_coreSlice] + rw [show (∑ s, ∫ x, mass (u.coreSlice s x)*coreConditionalObservable u W s x)=potentialForm W u from + sliceExpectation_coreConditionalObservable u W hW hB] + rw [hs] at H0 + have hw := potentialForm_normalized_weight W u + by_cases hp : 0≤potentialForm W u.normalized + · have hec : c=potentialForm W u.normalized := max_eq_left hp + rw [hec] at H0 + rw [max_eq_left hp] + nlinarith + · have hec : c=0 := max_eq_right (le_of_not_ge hp) + rw [hec] at H0 + rw [max_eq_right (le_of_not_ge hp)] + nlinarith + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma potentialForm_congr_values {k : ℕ} (W : Configuration k → ℝ) (u v : H1Vector k) + (hv : ∀ t, u.value t =ᵐ[volume] v.value t) : potentialForm W u=potentialForm W v := by + apply Finset.sum_congr rfl + intro t ht + apply integral_congr_ae + filter_upwards [hv t] with z hz + rw [hz] + +lemma potentialForm_normalized_congr_values {k : ℕ} (W : Configuration k → ℝ) + (u v : H1Vector k) (hv : ∀ t, u.value t =ᵐ[volume] v.value t) : + potentialForm W u.normalized=potentialForm W v.normalized := by + rw [potentialForm_normalized_eq,potentialForm_normalized_eq, + mass_congr_ae u v hv,potentialForm_congr_values W u v hv] + +lemma nested_coreSlice_values {m q k : ℕ} (u : H1Vector (m+(q+k))) + (s : Spins m) (t : Spins q) : + ∀ᵐ x : Configuration m, ∀ᵐ y : Configuration q, + ∀ r : Spins k, ∀ z : Configuration k, + ((u.coreSlice s x).coreSlice t y).value r z= + ((u.reindex (recordAssoc m q k)).coreSlice (Fin.append s t) + (joinConfiguration m q (x,y))).value r z := by + let v := u.reindex (recordAssoc m q k) + have hd : ∀ᵐ x : Configuration m, ∀ᵐ y : Configuration q, + v.CoreSliceRegular (Fin.append s t) (joinConfiguration m q (x,y)) := + Measure.ae_ae_of_ae_prod ((joinConfiguration_measurePreserving m q).quasiMeasurePreserving.ae + (v.coreSliceRegular_ae (Fin.append s t))) + filter_upwards [u.coreSliceRegular_ae s,hd] with x hx hd + filter_upwards [(u.coreSlice s x).coreSliceRegular_ae t,hd] with y hy hd + intro r z + rw [(u.coreSlice s x).coreSlice_value t hy,u.coreSlice_value s hx,v.coreSlice_value (Fin.append s t) hd] + simp only [v,H1Vector.reindex_value,append_recordAssoc,reindex_join_recordAssoc] + +lemma nested_coreConditional_weight {m q k : ℕ} (u : H1Vector (m+(q+k))) + (W : Configuration (m+(q+k)) → ℝ) (s : Spins m) (t : Spins q) : + ∀ᵐ x : Configuration m, ∀ᵐ y : Configuration q, + mass ((u.coreSlice s x).coreSlice t y)* + (max (coreConditionalObservable (u.coreSlice s x) + (fun w => W (joinConfiguration m (q+k) (x,w))) t y) 0)^2 = + mass ((u.reindex (recordAssoc m q k)).coreSlice (Fin.append s t) (joinConfiguration m q (x,y)))* + (max (coreConditionalObservable (u.reindex (recordAssoc m q k)) + (W ∘ reindexConfiguration (recordAssoc m q k)) (Fin.append s t) (joinConfiguration m q (x,y))) 0)^2 := by + filter_upwards [nested_coreSlice_values u s t] with x hx + filter_upwards [hx] with y hy + have hv : ∀ r, ((u.coreSlice s x).coreSlice t y).value r =ᵐ[volume] + ((u.reindex (recordAssoc m q k)).coreSlice (Fin.append s t) (joinConfiguration m q (x,y))).value r := + fun r => Eventually.of_forall (hy r) + rw [mass_congr_ae _ _ hv] + congr 2 + unfold coreConditionalObservable + simp only [Function.comp_apply,reindex_join_recordAssoc] + exact congrArg (fun b : ℝ => max b 0) + (potentialForm_normalized_congr_values _ _ _ hv) + +theorem record_more_positive_jensen {m q k : ℕ} (u : H1Vector (m+(q+k))) + (W : Configuration (m+(q+k)) → ℝ) (hW : Measurable W) {B : ℝ} + (hB0 : 0≤B) (hB : ∀ x, |W x| ≤ B) : + sliceExpectation u (fun s x => (max (coreConditionalObservable u W s x) 0)^2) ≤ + sliceExpectation (u.reindex (recordAssoc m q k)) (fun s x => + (max (coreConditionalObservable (u.reindex (recordAssoc m q k)) + (W ∘ reindexConfiguration (recordAssoc m q k)) s x) 0)^2) := by + let v := u.reindex (recordAssoc m q k) + let V := W ∘ reindexConfiguration (recordAssoc m q k) + have hV : Measurable V := hW.comp (reindexConfiguration_continuous _).measurable + let F := fun (s : Spins m) (t : Spins q) (x : Configuration m) (y : Configuration q) => + mass (v.coreSlice (Fin.append s t) (joinConfiguration m q (x,y)))* + (max (coreConditionalObservable v V (Fin.append s t) (joinConfiguration m q (x,y))) 0)^2 + have hi (s : Spins m) (t : Spins q) : Integrable (fun xy : Configuration m × Configuration q => F s t xy.1 xy.2) + (volume.prod volume) := by + exact ((joinConfiguration_measurePreserving m q).integrable_comp_emb + (joinConfiguration m q).toHomeomorph.toMeasurableEquiv.measurableEmbedding).mpr + (coreConditionalObservable_positive_weight_integrable v V hV hB0 (fun x => hB _) (Fin.append s t) 2) + have hstep (s : Spins m) : + (∫ x, mass (u.coreSlice s x)*(max (coreConditionalObservable u W s x) 0)^2) ≤ + ∑ t : Spins q, ∫ xy, mass (v.coreSlice (Fin.append s t) xy)* + (max (coreConditionalObservable v V (Fin.append s t) xy) 0)^2 := by + calc + _ ≤ ∫ x, ∑ t, ∫ y, F s t x y := by + apply integral_mono_ae (coreConditionalObservable_positive_weight_integrable u W hW hB0 hB s 2) + (integrable_finsetSum _ (fun t _ => (hi s t).integral_prod_left)) + have hall : ∀ᵐ x : Configuration m, ∀ t : Spins q, + ∀ᵐ y : Configuration q, + mass ((u.coreSlice s x).coreSlice t y)* + (max (coreConditionalObservable (u.coreSlice s x) + (fun w => W (joinConfiguration m (q+k) (x,w))) t y) 0)^2=F s t x y := + ae_all_iff.mpr (fun t => nested_coreConditional_weight u W s t) + filter_upwards [hall] with x hx + have H := slice_positive_square_jensen (u.coreSlice s x) + (fun w => W (joinConfiguration m (q+k) (x,w))) + (hW.comp ((joinConfiguration m (q+k)).continuous.measurable.comp + (measurable_const.prodMk measurable_id))) hB0 (fun w => hB _) + change mass (u.coreSlice s x)*(max (coreConditionalObservable u W s x) 0)^2 ≤ _ at H + apply H.trans_eq + exact Finset.sum_congr rfl (fun t _ => integral_congr_ae (hx t)) + _ = ∑ t, ∫ xy : Configuration m × Configuration q, F s t xy.1 xy.2 ∂volume.prod volume := by + rw [integral_finsetSum _ (fun t _ => (hi s t).integral_prod_left)] + exact Finset.sum_congr rfl (fun t _ => (integral_prod _ (hi s t)).symm) + _ = _ := by + apply Finset.sum_congr rfl + intro t ht + exact (joinConfiguration_measurePreserving m q).integral_comp' (fun xy : Configuration (m+q) => + mass (v.coreSlice (Fin.append s t) xy)*(max (coreConditionalObservable v V (Fin.append s t) xy) 0)^2) + calc + _ ≤ ∑ s : Spins m, ∑ t : Spins q, ∫ x, mass (v.coreSlice (Fin.append s t) x)* + (max (coreConditionalObservable v V (Fin.append s t) x) 0)^2 := + Finset.sum_le_sum (fun s (_ : s∈Finset.univ) => hstep s) + _ = _ := by + unfold sliceExpectation + rw [←Fintype.sum_prod_type (f:=fun st : Spins m × Spins q => ∫ x, + mass (v.coreSlice (Fin.append st.1 st.2) x)*(max (coreConditionalObservable v V (Fin.append st.1 st.2) x) 0)^2)] + exact Fintype.sum_equiv (Fin.appendEquiv m q) _ _ (fun _ => rfl) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedCount.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..9bda270ce26c573231975e25d2e3e11d98b15a4b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedCount.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CoveredOutCost +import OAI.Analysis.CoulombRadii.FieldAnalysis.SortedObservable + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma localCount_join {m k : ℕ} (A : Set Space) (x : Configuration m) (v : Configuration k) : + localCount A (joinConfiguration m k (x,v))=localCount A x+localCount A v := by + simp only [localCount,Fin.sum_univ_add,position_join_left,position_join_right] + +lemma localCount_permute {n : ℕ} (A : Set Space) (p : Equiv.Perm (Fin n)) (x : Configuration n) : + localCount A (permute p x)=localCount A x := by + simp only [localCount,position_permute] + exact Equiv.sum_comp p (fun i : Fin n => A.indicator (fun _ => (1:ℝ)) (position x i)) + +lemma localCount_reindex {m n : ℕ} (A : Set Space) (e : Fin m ≃ Fin n) (x : Configuration m) : + localCount A (reindexConfiguration e x)=localCount A x := by + change (∑ i : Fin n, A.indicator (fun _ => (1:ℝ)) (position x (e.symm i)))=_ + exact Equiv.sum_comp e.symm (fun i : Fin m => A.indicator (fun _ => (1:ℝ)) (position x i)) + +lemma potentialForm_mono_bounded {n : ℕ} (u : H1Vector n) + (F G : Configuration n → ℝ) (hF : Measurable F) (hG : Measurable G) + {B C : ℝ} (hFB : ∀ x, |F x| ≤ B) (hGC : ∀ x, |G x| ≤ C) + (hFG : ∀ x, F x ≤ G x) : potentialForm F u ≤ potentialForm G u := by + apply Finset.sum_le_sum + intro s hs + apply integral_mono (boundedObservable_integrable u F hF hFB s) (boundedObservable_integrable u G hG hGC s) + intro x + exact mul_le_mul_of_nonneg_right (hFG x) (sq_nonneg _) + +lemma sliceExpectation_localCount_sq_le {m k : ℕ} (u : H1Vector (m+k)) + {A : Set Space} (hA : MeasurableSet A) : + sliceExpectation u (fun _ x => (localCount A x)^2) ≤ localCountSecondMoment u A := by + let W : Configuration (m+k) → ℝ := fun v => (localCount A v)^2 + have hW : Measurable W := (localCount_measurable hA).pow_const 2 + have hB : ∀ v, |W v| ≤ ((m+k:ℕ):ℝ)^2 := by + intro v + rw [abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (localCount_nonneg _ _) (localCount_le _ _) 2 + have hp : sliceExpectation u (fun _ x => (localCount A x)^2) ≤ sliceExpectation u (coreConditionalObservable u W) := by + apply Finset.sum_le_sum + intro s hs + apply integral_mono (sliceCount_weight_integrable u hA s 2) + (coreConditionalObservable_weight_integrable u W hW (sq_nonneg _) hB s) + intro x + by_cases hm : mass (u.coreSlice s x)=0 + · simp only [hm,zero_mul,le_refl] + · apply mul_le_mul_of_nonneg_left _ (mass_nonneg _) + have hm' := lt_of_le_of_ne (mass_nonneg (u.coreSlice s x)) (Ne.symm hm) + let w := (u.coreSlice s x).normalized + calc + (localCount A x)^2 = potentialForm (fun _ : Configuration k => (localCount A x)^2) w := by + rw [potentialForm_const,mass_normalized _ hm',mul_one] + _ ≤ potentialForm (fun v => W (joinConfiguration m k (x,v))) w := by + apply potentialForm_mono_bounded w _ _ measurable_const + (hW.comp ((joinConfiguration m k).continuous.measurable.comp (measurable_const.prodMk measurable_id))) + (fun _ => le_rfl) (fun v => hB _) + intro v + dsimp [W] + rw [localCount_join] + exact pow_le_pow_left₀ (localCount_nonneg _ _) (le_add_of_nonneg_right (localCount_nonneg _ _)) 2 + _ = _ := rfl + rw [sliceExpectation_coreConditionalObservable u W hW hB] at hp + exact hp + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +lemma raw_posterior_positive_le_core {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {a : ℝ} (ha : 0 h), + restrictedCorePotential_eq _ hs] + apply mul_le_mul_of_nonneg_left _ (mass_nonneg _) + apply pow_le_pow_left₀ (le_max_right _ _) _ 2 + apply max_le_max _ le_rfl + unfold coreScreenedField + linarith [restrictedOutPotential_nonneg x {z | 40*a ≤ ‖z-y‖} y] + +theorem radial_raw_gain_step {J n : ℕ} (S : Nuclei J) + (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hmass : mass ψ=1) + {a E δ : ℝ} (ha : 0 W (reindexConfiguration (e p) x)) (u p))=potentialForm W ψ) ∧ + (∑ p, (m p:ℝ)^2*mass (u p)) ≤ localCountSecondMoment ψ (Metric.closedBall y (80*a)) ∧ + (∀ A : Set Space, MeasurableSet A → + (∑ p, sliceExpectation (u p) (fun _ x => (localCount A x)^2)) ≤ localCountSecondMoment ψ A) ∧ + a/(16*ballTrialCoefficient)*(∑ p, sliceExpectation (u p) (fun s x => + (max (coreConditionalObservable (u p) + (rawSignedField (attraction S y) {z | 40*a ≤ ‖z-y‖} y) s x) 0)^2)) ≤ + δ+3*(radialCutCoefficient/(40*a))^2*expectedPopulation ψ (Metric.closedBall y (80*a))+ + 4*ballTrialCoefficient*(screenBaseMass a)^2/a-∑ p, conditionalOutCost S (u p) := by + have hr : 0<40*a := by positivity + let χ := radialCut y (40*a) + have hc : ∀ z ∉ {z | 40*a ≤ ‖z-y‖}, χ 1 z=0 := by + intro z hz + exact radialCut_core_zero y hr z (lt_of_not_ge hz).le + have ho : ∀ z ∉ Metric.closedBall y (80*a), χ 0 z=0 := by + intro z hz + apply radialCut_out_zero y hr + have h : 80*a < ‖z-y‖ := by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hz + linarith + have H (p : Fin n → Fin 2) := binary_cut_recorded_outcome S ψ hψ χ (radialCut_smooth y (40*a)) + (radialCut_partition y (40*a)) (radialCutCoefficient/(40*a)) + (div_nonneg radialCutCoefficient_pos.le hr.le) (radialCut_derivative_bound y hr) p _ _ hc ho + choose m k u e hn hcount hm hf hobs hanti hs hout using H + have hsum : (∑ p, mass (u p))=1 := by + simp_rw [hm] + rw [mass_labelCut,hmass] + have hsupport (p) (s : Spins (m p)) : ∀ᵐ x, + SpatiallySupported ((u p).coreSlice s x).normalized {z | 40*a ≤ ‖z-y‖} := by + filter_upwards [hs p s] with x hx + exact hx.normalized + have houter (p) (s : Spins (m p)) : ∀ᵐ x, + mass ((u p).coreSlice s x) ≠0 → ∀ i, ‖position x i-y‖ ≤ 80*a := by + filter_upwards [hout p s] with x hx + intro hm i + simpa only [Metric.mem_closedBall,dist_eq_norm] using hx hm i + have hconserve (W : Configuration n → ℝ) (hW : Measurable W) + (hB : ∃ B : ℝ, ∀ x, |W x| ≤ B) (hSym : ∀ q x, W (permute q x)=W x) : + (∑ p, potentialForm (fun x => W (reindexConfiguration (e p) x)) (u p))=potentialForm W ψ := by + simp_rw [hobs _ W hSym] + obtain ⟨B,hB⟩ := hB + exact potentialForm_labelCut ψ χ _ _ _ _ _ W hW hB + have hmsq : (∑ p, (m p:ℝ)^2*mass (u p)) ≤ localCountSecondMoment ψ (Metric.closedBall y (80*a)) := by + simp_rw [←hcount,hm] + exact labelCut_outCount_secondMoment_le ψ χ _ _ _ _ _ _ measurableSet_closedBall ho + have hcsq (A : Set Space) (hA : MeasurableSet A) : + (∑ p, sliceExpectation (u p) (fun _ x => (localCount A x)^2)) ≤ localCountSecondMoment ψ A := by + have hcons := hconserve (fun x => (localCount A x)^2) ((localCount_measurable hA).pow_const 2) + ⟨(n:ℝ)^2,fun x => by rw [abs_of_nonneg (sq_nonneg _)]; exact pow_le_pow_left₀ (localCount_nonneg _ _) (localCount_le _ _) 2⟩ + (fun q x => by rw [localCount_permute]) + simp only [localCount_reindex] at hcons + calc + _ ≤ ∑ p, localCountSecondMoment (u p) A := Finset.sum_le_sum (fun p _ => sliceExpectation_localCount_sq_le (u p) hA) + _ = _ := hcons + have hclosed : IsClosed {z : Space | 40*a ≤ ‖z-y‖} := isClosed_le continuous_const (by fun_prop) + have hg (p : Fin n → Fin 2) : + a/(16*ballTrialCoefficient)*sliceExpectation (u p) (fun s x => + (max (coreScreenedField S ((u p).coreSlice s x).normalized y) 0)^2) ≤ + form S (u p)-conditionalOutCost S (u p)-E*mass (u p)+ + (4*ballTrialCoefficient*(screenBaseMass a)^2/a)*mass (u p) := by + have HG := conditional_positive_field_gain S (u p) (hanti p) ha y _ hclosed + (hsupport p) (fun z hz => by change 40*a ≤ ‖z-y‖ at hz; linarith) hnuc hE + rw [form_eq_conditionalOutCost S (u p)] + linarith + have HI : (∑ p, form S (u p)) ≤ E+δ+ + 3*(radialCutCoefficient/(40*a))^2*expectedPopulation ψ (Metric.closedBall y (80*a)) := by + simp_rw [hf] + have HI := form_radial_labelCut S ψ y hr + dsimp [χ] + have he : 2*(40*a)=80*a := by ring + rw [he] at HI + exact HI.trans (add_le_add hstate le_rfl) + have HH := Finset.sum_le_sum (fun p (_ : p ∈ Finset.univ) => hg p) + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum,hsum,mul_one] at HH + have hp (p) : sliceExpectation (u p) (fun s x => + (max (coreConditionalObservable (u p) (rawSignedField (attraction S y) {z | 40*a ≤ ‖z-y‖} y) s x) 0)^2) ≤ + sliceExpectation (u p) (fun s x => (max (coreScreenedField S ((u p).coreSlice s x).normalized y) 0)^2) := by + apply Finset.sum_le_sum + intro s hs' + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)) + · exact coreField_positive_square_weight_integrable S (u p) s y + · filter_upwards [hsupport p s] with x hx + exact raw_posterior_positive_le_core S (u p) ha y s x hx + have hco : 0 ≤ a/(16*ballTrialCoefficient) := div_nonneg ha.le (mul_nonneg (by norm_num) ballTrialCoefficient_pos.le) + have HP := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun p (_ : p ∈ Finset.univ) => hp p)) hco + refine ⟨m,k,u,e,hn,hsum,hanti,hsupport,houter,hconserve,hmsq,hcsq,?_⟩ + linarith + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedEnsemble.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedEnsemble.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef69cc3baaacc2e7f241aa0e38081a3266b9dceb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedEnsemble.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.RadialAppend + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +structure RecordedEnsemble (n : ℕ) where + index : Type + finite : Fintype index + out : index → ℕ + core : index → ℕ + vector : (p : index) → H1Vector (out p+core p) + labels : (p : index) → Fin (out p+core p) ≃ Fin n +attribute [instance] RecordedEnsemble.finite + +namespace RecordedEnsemble +variable {n J : ℕ} + +def totalMass (T : RecordedEnsemble n) : ℝ := ∑ p, mass (T.vector p) +def totalForm (T : RecordedEnsemble n) (S : Nuclei J) : ℝ := ∑ p, form S (T.vector p) +def Conserves (T : RecordedEnsemble n) (ψ : H1Vector n) : Prop := + ∀ W : Configuration n → ℝ, Measurable W → (∃ B : ℝ, ∀ x, |W x|≤B) → + (∑ p, potentialForm (W ∘ reindexConfiguration (T.labels p)) (T.vector p))=potentialForm W ψ + +def CoreFermionic (T : RecordedEnsemble n) : Prop := + ∀ p, PartlyAntisymmetric (T.vector p) (coreIndexSet (T.out p) (T.core p)) +def OutSupported (T : RecordedEnsemble n) (A : Set Space) : Prop := + ∀ p, PartlySupported (T.vector p) (outIndexSet (T.out p) (T.core p)) A + +def rawSquare (T : RecordedEnsemble n) (S : Nuclei J) (y : Space) (a : ℝ) : ℝ := + ∑ p, sliceExpectation (T.vector p) (fun s x => + (max (coreConditionalObservable (T.vector p) + (rawSignedField (attraction S y) {z | 40*a≤‖z-y‖} y) s x) 0)^2) + +lemma reindexConfiguration_trans {a b c : ℕ} (e : Fin a ≃ Fin b) (f : Fin b ≃ Fin c) : + reindexConfiguration (e.trans f)=reindexConfiguration f ∘ reindexConfiguration e := by + funext x + ext ⟨i,j⟩ + rfl + +lemma Conserves.population {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) {A : Set Space} (hA : MeasurableSet A) : + (∑ p, expectedPopulation (T.vector p) A)=expectedPopulation ψ A := by + have H := hT (localCount A) (localCount_measurable hA) + ⟨n,fun x => by rw [abs_of_nonneg (localCount_nonneg _ _)]; exact localCount_le _ _⟩ + simpa only [Function.comp_def,localCount_reindex,potentialForm,expectedPopulation_eq _ hA] using H + +lemma Conserves.secondMoment {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) {A : Set Space} (hA : MeasurableSet A) : + (∑ p, localCountSecondMoment (T.vector p) A)=localCountSecondMoment ψ A := by + have hb (x : Configuration n) : |(localCount A x)^2|≤(n:ℝ)^2 := by + rw [abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (localCount_nonneg _ _) (localCount_le _ _) 2 + have H := hT (fun x => (localCount A x)^2) ((localCount_measurable hA).pow_const 2) ⟨_,hb⟩ + simpa only [Function.comp_def,localCount_reindex,potentialForm,localCountSecondMoment] using H + +lemma Conserves.recorded_secondMoment {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) {A : Set Space} (hA : MeasurableSet A) : + (∑ p, sliceExpectation (T.vector p) (fun _ x => (localCount A x)^2))≤ + localCountSecondMoment ψ A := by + rw [←hT.secondMoment hA] + exact Finset.sum_le_sum (fun p _ => sliceExpectation_localCount_sq_le (T.vector p) hA) + +theorem append_radial (S : Nuclei J) (ψ : H1Vector n) (T : RecordedEnsemble n) + (hT : T.Conserves ψ) (hanti : T.CoreFermionic) (A : Set Space) (hsupp : T.OutSupported A) + {a E : ℝ} (ha : 0 T.out pl.1+q pl.1 pl.2 + core := fun pl => k pl.1 pl.2 + vector := fun pl => v pl.1 pl.2 + labels := fun pl => (recordAssoc _ _ _).trans ((coreReindex _ (e pl.1 pl.2)).trans (T.labels pl.1)) } + have hmass : U.totalMass=T.totalMass := by + dsimp [totalMass,U] + rw [Fintype.sum_sigma] + exact Finset.sum_congr rfl (fun p _ => hm p) + have HC : U.Conserves ψ := by + intro W hW hB + change (∑ pl : (p : T.index) × (Fin (T.out p+T.core p) → Fin 2), + potentialForm (W ∘ reindexConfiguration ((recordAssoc _ _ _).trans + ((coreReindex _ (e pl.1 pl.2)).trans (T.labels pl.1)))) (v pl.1 pl.2))=_ + rw [Fintype.sum_sigma] + simp only [reindexConfiguration_trans,←Function.comp_assoc] + rw [show (∑ p, ∑ l, potentialForm (((W ∘ reindexConfiguration (T.labels p)) ∘ + reindexConfiguration (coreReindex _ (e p l))) ∘ reindexConfiguration (recordAssoc _ _ _)) (v p l))= + ∑ p, potentialForm (W ∘ reindexConfiguration (T.labels p)) (T.vector p) from ?_] + · exact hT W hW hB + · apply Finset.sum_congr rfl + intro p hp + exact hcons p _ (hW.comp (reindexConfiguration_continuous _).measurable) + (hB.imp (fun B hb x => hb _)) + have HI : U.totalForm S≤T.totalForm S+3*D^2*expectedPopulation ψ (Metric.closedBall y (80*a)) := by + dsimp [totalForm,U] + rw [Fintype.sum_sigma] + have HH := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => + form_radial_labelCut S (T.vector p) y hr) + simp only [Finset.sum_add_distrib,←Finset.mul_sum,show 2*(40*a)=80*a by ring] at HH + rw [hT.population measurableSet_closedBall] at HH + simpa only [v,form_appendCut] using HH + have HG := Finset.sum_le_sum (fun p (_ : p∈Finset.univ) => hgain p) + change (∑ p, a/(16*ballTrialCoefficient)*_)≤_ at HG + simp only [Finset.sum_add_distrib,Finset.sum_sub_distrib,←Finset.mul_sum] at HG + rw [hT.population measurableSet_closedBall] at HG + refine ⟨U,HC,(fun pl => hanti' pl.1 pl.2),(fun pl => hout pl.1 pl.2),hmass,HI,?_⟩ + change _≤T.totalForm S+3*D^2*expectedPopulation ψ (Metric.closedBall y (80*a))- + (∑ pl : (p : T.index) × (Fin (T.out p+T.core p) → Fin 2), conditionalOutCost S (v pl.1 pl.2))- + E*T.totalMass+_ + rw [Fintype.sum_sigma] + exact HG + +end RecordedEnsemble +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedStatistic.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedStatistic.lean new file mode 100644 index 0000000000000000000000000000000000000000..ec4de68ab91f8c4a6016fa00b3592c5717d31961 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/RecordedStatistic.lean @@ -0,0 +1,195 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ObservationMatching + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def arrayStatistic {n : ℕ} (χ : Space → ℝ) (x : Configuration n) : ℝ := + ∑ i, χ (position x i) + +lemma arrayStatistic_measurable {n : ℕ} {χ : Space → ℝ} (hχ : Measurable χ) : + Measurable (@arrayStatistic n χ) := by + unfold arrayStatistic + exact Finset.measurable_fun_sum _ (fun i _ => hχ.comp (continuous_position i).measurable) + +lemma arrayStatistic_join {m k : ℕ} (χ : Space → ℝ) (x : Configuration m) (z : Configuration k) : + arrayStatistic χ (joinConfiguration m k (x,z))=arrayStatistic χ x+arrayStatistic χ z := by + simp only [arrayStatistic,Fin.sum_univ_add,position_join_left,position_join_right] + +lemma arrayStatistic_reindex {m n : ℕ} (χ : Space → ℝ) (e : Fin m ≃ Fin n) (x : Configuration m) : + arrayStatistic χ (reindexConfiguration e x)=arrayStatistic χ x := by + change (∑ i : Fin n, χ (position x (e.symm i)))=_ + exact Equiv.sum_comp e.symm (fun i : Fin m => χ (position x i)) + +lemma arrayStatistic_eq_zero_of_allPositions {n : ℕ} {χ : Space → ℝ} {A : Set Space} + (hχ : ∀ z∈A, χ z=0) {x : Configuration n} (hx : x∈allPositions A) : + arrayStatistic χ x=0 := Finset.sum_eq_zero (fun i _ => hχ _ (hx i)) + +lemma potentialForm_statistic_join_of_support {m k : ℕ} {u : H1Vector k} + {χ : Space → ℝ} {A : Set Space} (hχ : ∀ z∈A, χ z=0) + (hu : SpatiallySupported u A) (φ : ℝ → ℝ) (x : Configuration m) : + potentialForm (fun z => φ (arrayStatistic χ (joinConfiguration m k (x,z)))) u= + φ (arrayStatistic χ x)*mass u := by + rw [←potentialForm_const (φ (arrayStatistic χ x)) u] + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [hu s] with z hz + by_cases h : z∈allPositions A + · rw [arrayStatistic_join,arrayStatistic_eq_zero_of_allPositions hχ h,add_zero] + · rw [hz h,norm_zero,zero_pow (by norm_num : (2:ℕ)≠0),mul_zero,mul_zero] + +lemma sliceExpectation_statistic_eq {m k : ℕ} (u : H1Vector (m+k)) + {χ : Space → ℝ} (hχm : Measurable χ) {A : Set Space} (hχ : ∀ z∈A, χ z=0) + (hu : PartlySupported u (coreIndexSet m k) A) (φ : ℝ → ℝ) + (hφ : Measurable φ) {B : ℝ} (hB : ∀ q, |φ q|≤B) : + sliceExpectation u (fun _ x => φ (arrayStatistic χ x))= + potentialForm (fun x => φ (arrayStatistic χ x)) u := by + have HH := sliceExpectation_coreConditionalObservable u (fun x => φ (arrayStatistic χ x)) + (hφ.comp (arrayStatistic_measurable hχm)) (fun x => hB _) + rw [←HH] + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [hu.coreSlice s] with x hx + by_cases hm : mass (u.coreSlice s x)=0 + · simp only [hm,zero_mul] + · unfold coreConditionalObservable + rw [potentialForm_statistic_join_of_support hχ hx.normalized φ x, + mass_normalized _ (lt_of_le_of_ne (mass_nonneg _) (Ne.symm hm)),mul_one] + +lemma RecordedEnsemble.Conserves.statistic {n : ℕ} {T : RecordedEnsemble n} + {ψ : H1Vector n} (hT : T.Conserves ψ) {χ : Space → ℝ} (hχm : Measurable χ) + {A : Set Space} (hχ : ∀ z∈A, χ z=0) (hcs : T.CoreSupported A) + (φ : ℝ → ℝ) (hφ : Measurable φ) {B : ℝ} (hB : ∀ q, |φ q|≤B) : + (∑ p, sliceExpectation (T.vector p) (fun _ x => φ (arrayStatistic χ x)))= + potentialForm (fun x => φ (arrayStatistic χ x)) ψ := by + have H := hT (fun x => φ (arrayStatistic χ x)) (hφ.comp (arrayStatistic_measurable hχm)) ⟨B,fun x => hB _⟩ + simp only [Function.comp_def,arrayStatistic_reindex] at H + rw [←H] + exact Finset.sum_congr rfl (fun p _ => sliceExpectation_statistic_eq (T.vector p) hχm hχ (hcs p) φ hφ hB) + +theorem RecordedEnsemble.Conserves.statistic_event_ae {n : ℕ} {T : RecordedEnsemble n} + {ψ : H1Vector n} (hT : T.Conserves ψ) {χ : Space → ℝ} (hχm : Measurable χ) + {A : Set Space} (hχ : ∀ z∈A, χ z=0) (hcs : T.CoreSupported A) + {B : Set ℝ} (hB : MeasurableSet B) + (hzero : potentialForm (fun x => Bᶜ.indicator (fun _ => (1:ℝ)) (arrayStatistic χ x)) ψ=0) : + ∀ p s, ∀ᵐ x, mass ((T.vector p).coreSlice s x)≠0 → arrayStatistic χ x∈B := by + let φ : ℝ → ℝ := Bᶜ.indicator (fun _ => 1) + have hφ : Measurable φ := measurable_const.indicator hB.compl + have hφ0 (q : ℝ) : 0≤φ q := indicator_nonneg (fun _ _ => zero_le_one) q + have hφ1 (q : ℝ) : |φ q|≤1 := by + dsimp [φ] + by_cases h : q∈Bᶜ <;> simp [h] + have HI (p : T.index) (s : Spins (T.out p)) : + Integrable (fun x => mass ((T.vector p).coreSlice s x)*φ (arrayStatistic χ x)) := by + have H := (mass_coreSlice_integrable (T.vector p) s).bdd_mul + (hφ.comp (arrayStatistic_measurable hχm)).aestronglyMeasurable + (Eventually.of_forall (fun x => (show ‖φ (arrayStatistic χ x)‖≤1 by simpa only [Real.norm_eq_abs] using hφ1 _))) + exact H.congr (Eventually.of_forall (fun x => mul_comm _ _)) + have H0 (p : T.index) (s : Spins (T.out p)) (x : Configuration (T.out p)) : + 0 ≤ mass ((T.vector p).coreSlice s x)*φ (arrayStatistic χ x) := mul_nonneg (mass_nonneg _) (hφ0 _) + have H := hT.statistic hχm hχ hcs φ hφ hφ1 + rw [show potentialForm (fun x => φ (arrayStatistic χ x)) ψ=0 from hzero] at H + have Hs := (Finset.sum_eq_zero_iff_of_nonneg (fun p (_ : p∈Finset.univ) => + Finset.sum_nonneg (fun s _ => integral_nonneg (H0 p s)))).mp H + intro p s + have Hss := (Finset.sum_eq_zero_iff_of_nonneg (fun s (_ : s∈Finset.univ) => + integral_nonneg (H0 p s))).mp (Hs p (Finset.mem_univ _)) s (Finset.mem_univ _) + have Hae := (integral_eq_zero_iff_of_nonneg (H0 p s) (HI p s)).mp Hss + filter_upwards [Hae] with x hx + intro hm + have hz : φ (arrayStatistic χ x)=0 := (mul_eq_zero.mp hx).resolve_left hm + by_contra hb + have he : φ (arrayStatistic χ x)=1 := indicator_of_mem hb _ + linarith + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace NeutralAtom + +theorem arrayEvent_fresh_statistic_ae {H : Type*} [Fintype H] {n : ℕ} + (ℓ : H → ℝ) (hℓ : ∀ h, ℓ h≠0) + {E : Set ((H × (Fin n × Fin 3)) → ℝ)} (hE : MeasurableSet E) + (ψ : Wavefunction n) (u : Coulomb.H1Vector n) + (hbayes : ∀ F : Coulomb.Configuration n → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood ℓ E))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ E x*F (flattenConfiguration n x))) + (T : Coulomb.RecordedEnsemble n) (hT : T.Conserves u) + {χ : Position → ℝ} (hχm : Measurable χ) {A : Set Position} + (hχ : ∀ z∈A, χ z=0) (hcs : T.CoreSupported A) + {B : Set ℝ} (hB : MeasurableSet B) + (hmatch : ∀ (x : Configuration n) (z : (H × (Fin n × Fin 3)) → ℝ), + (∀ ia, |z ia|<1) → (fun ia => x ia.2.1 ia.2.2+ℓ ia.1*z ia)∈E → + Coulomb.arrayStatistic χ (flattenConfiguration n x)∈B) : + ∀ p s, ∀ᵐ x, Coulomb.mass ((T.vector p).coreSlice s x)≠0 → + Coulomb.arrayStatistic χ x∈B := by + apply hT.statistic_event_ae hχm hχ hcs hB + rw [hbayes] + have hz : stateWeightedIntegral ψ (fun x => arrayEventLikelihood ℓ E x* + Bᶜ.indicator (fun _ => (1:ℝ)) (Coulomb.arrayStatistic χ (flattenConfiguration n x)))=0 := by + unfold stateWeightedIntegral + apply Finset.sum_eq_zero + intro s hs + apply integral_eq_zero_of_ae + filter_upwards [] with x + by_cases hp : arrayEventLikelihood ℓ E x=0 + · simp [hp] + · have hpos := lt_of_le_of_ne (arrayEventLikelihood_nonneg ℓ hE x) (Ne.symm hp) + obtain ⟨z,hz,he⟩ := arrayEventLikelihood_pos_matching ℓ hℓ E x hpos + have hb := hmatch x z hz he + simp only [Set.indicator_of_notMem (show Coulomb.arrayStatistic χ (flattenConfiguration n x)∉Bᶜ from not_not.mpr hb),mul_zero,zero_mul] + rfl + rw [hz,mul_zero] + +end NeutralAtom +namespace Coulomb + +theorem arrayStatistic_local_matching {n : ℕ} (χ : Space → ℝ) (x z : Configuration n) + (y : Space) {r d L : ℝ} (hd : 0≤d) (hL : 0≤L) + (hs : ∀ v, χ v≠0 → ‖v-y‖≤r) + (hLip : ∀ v w, |χ v-χ w|≤L*‖v-w‖) + (hmatch : ∀ i, ‖position z i-position x i‖≤d) : + |arrayStatistic χ z-arrayStatistic χ x|≤ + (L*d)*localCount (Metric.closedBall y (r+d)) x := by + have Hone (i : Fin n) : |χ (position z i)-χ (position x i)|≤ + (L*d)*(Metric.closedBall y (r+d)).indicator (fun _ => (1:ℝ)) (position x i) := by + by_cases hx : position x i∈Metric.closedBall y (r+d) + · rw [indicator_of_mem hx,mul_one] + exact (hLip _ _).trans (mul_le_mul_of_nonneg_left (hmatch i) hL) + · rw [indicator_of_notMem hx,mul_zero] + have hxx : χ (position x i)=0 := by + by_contra h + apply hx + rw [Metric.mem_closedBall,dist_eq_norm] + exact (hs _ h).trans (by linarith) + have hzz : χ (position z i)=0 := by + by_contra h + apply hx + rw [Metric.mem_closedBall,dist_eq_norm] + have ht := norm_sub_le_norm_sub_add_norm_sub (position x i) (position z i) y + have hh := hmatch i + rw [norm_sub_rev (position z i) (position x i)] at hh + linarith [hs _ h] + simp [hxx,hzz] + calc + _ = |∑ i, (χ (position z i)-χ (position x i))| := by rw [Finset.sum_sub_distrib]; rfl + _ ≤ ∑ i, |χ (position z i)-χ (position x i)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ i, (L*d)*(Metric.closedBall y (r+d)).indicator (fun _ => (1:ℝ)) (position x i) := + Finset.sum_le_sum (fun i _ => Hone i) + _ = _ := by rw [←Finset.mul_sum]; rfl + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/ThinEnsemble.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/ThinEnsemble.lean new file mode 100644 index 0000000000000000000000000000000000000000..204cd69c4ace255d0b0691ba7366d6df948b3b97 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/ThinEnsemble.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.AtomicBudgetScreening +import OAI.Analysis.CoulombRadii.ThomasFermi.BinaryEnsemble +import OAI.Analysis.CoulombRadii.Localization.ThinIMS + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma expectedPopulation_nonneg {n : ℕ} (ψ : H1Vector n) (A : Set Space) : + 0≤expectedPopulation ψ A := by + apply Finset.sum_nonneg + intro s hs + apply Finset.sum_nonneg + intro i hi + exact integral_nonneg (fun x => mul_nonneg (Set.indicator_nonneg (fun _ _ => zero_le_one) _) (sq_nonneg _)) + +lemma expectedPopulation_mono {n : ℕ} (ψ : H1Vector n) {A B : Set Space} + (hA : MeasurableSet A) (hB : MeasurableSet B) (hAB : A⊆B) : + expectedPopulation ψ A≤expectedPopulation ψ B := by + rw [expectedPopulation_eq ψ hA,expectedPopulation_eq ψ hB] + apply Finset.sum_le_sum + intro s hs + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun x => mul_nonneg (localCount_nonneg _ _) (sq_nonneg _)) + · simpa only [pow_one] using localCount_weight_integrable ψ hB s 1 + · exact Eventually.of_forall (fun x => mul_le_mul_of_nonneg_right (localCount_mono hAB x) (sq_nonneg _)) + +def thinIMS {n : ℕ} (ψ : H1Vector n) (y : Space) (t b : ℝ) : ℝ := + 3*(thinCutCoefficient/b)^2*expectedPopulation ψ (Metric.closedBall y (t+b)) + +lemma thinIMS_nonneg {n : ℕ} (ψ : H1Vector n) (y : Space) (t b : ℝ) : 0≤thinIMS ψ y t b := by + exact mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg _)) (expectedPopulation_nonneg _ _) + +theorem thin_localization {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (hψ : Antisymmetric ψ) + (y : Space) {t b : ℝ} (ht : 0≤t) (hb : 0 thinCut_out_zero y ht hb z (by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using (show t+b≤‖z-y‖ from le_of_lt (by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using hz)))) + (fun z hz => thinCut_core_zero y ht hb z (le_of_lt (by simpa only [Set.mem_ofPred_eq,not_le] using hz))) + refine ⟨T,hC,hc,ho,hcs,hos,hm,?_⟩ + rw [hf] + exact form_thin_labelCut S ψ y ht hb + +theorem thin_localization_history {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (hψ : Antisymmetric ψ) + {y : Space} (hy : y≠0) {t b : ℝ} (ht : 0≤t) (hb : 0 y + nonzero := fun _ => hy + law := hC + fermionic := hc + support := by + intro p + apply (hos p).mono_space + intro z hz + apply Set.mem_iUnion.mpr + refine ⟨0,?_⟩ + exact Metric.closedBall_subset_closedBall hwidth hz + mass_eq := hm + energy := by + apply hf.trans + apply le_add_of_nonneg_right + exact Finset.sum_nonneg (fun i _ => mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg _)) + (expectedPopulation_nonneg _ _)) } + exact ⟨T,fun _ => rfl,ho,hcs,hos⟩ + +theorem thin_localization_raw_control {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) (hstate : form S ψ≤E+δ) + (hδ : 0≤δ) {y : Space} (hy : y≠0) {t b : ℝ} (ht : 0≤t) (hb : 0 norm_num <;> linarith [atomicCellScale_nonneg y] + · simpa only [pow_one] using hv + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/RandomFields/WeightedDeletion.lean b/lean/OAI/Analysis/CoulombRadii/RandomFields/WeightedDeletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d59a14e46688de864ab1582ed1dffc90105aed7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/RandomFields/WeightedDeletion.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.WeightedInner +import OAI.Analysis.CoulombRadii.Localization.DeletionEnvelope + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb +namespace RecordedEnsemble + +theorem Conserves.weightedInner_expectation_le {J n : ℕ} {T : RecordedEnsemble n} + {ψ : H1Vector n} (hT : T.Conserves ψ) (S : Nuclei J) (hatom : ∀ j, S.position j=0) + {u h : ℝ} (hu : 0 Hlocal p) + rw [HT] at HB + apply HB.trans + let R : ℝ := ∑ p, (T.out p:ℝ)*sliceExpectation (T.vector p) (M.value p) + have hR : 0 ≤ R := Finset.sum_nonneg (fun p _ => mul_nonneg (Nat.cast_nonneg _) + (Finset.sum_nonneg (fun s _ => integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (M.nonneg p s x))))) + have HC := slice_ensemble_count_cauchy T.out T.core T.vector M.value M.integrable M.square_integrable + have ho := out_square_le hT hA hout + have hsecond : 0 ≤ ∑ p, sliceExpectation (T.vector p) (fun s x => (M.value p s x)^2) := + Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => integral_nonneg + (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have HH := HC.trans (mul_le_mul_of_nonneg_right ho hsecond) + change R^2 ≤ localCountSecondMoment ψ A*_ at HH + have hN : 0 ≤ localCountSecondMoment ψ A := localCountSecondMoment_nonneg ψ A + apply (sq_le_sq₀ hR (mul_nonneg (Real.sqrt_nonneg _) (T.dataRMS_nonneg _))).mp + rw [mul_pow,Real.sq_sqrt hN,T.dataRMS_sq] + exact HH + +end RecordedEnsemble + +theorem atomic_weighted_shell_deletion : ∃ C : ℝ, 0 ≤ C ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ j, S.position j=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E → + ∀ {t : ℝ}, 0 linarith + +lemma annular_submean_cap {F : Position → ℝ} {r L T : ℝ} + (hr : 0 max (‖z‖^4*F z-T) 0) + {z | r/2≤‖z‖ ∧ ‖z‖≤8*L*r}) {y : Position} + (hy0 : 3*r/4≤‖y‖) (hy1 : ‖y‖≤6*L*r) + (hF : IntegrableOn F (Metric.closedBall y (r/8))) + (hmean : F y≤(4*Real.pi/3*(r/8)^3)⁻¹*(∫ z in Metric.closedBall y (r/8),F z)) : + ‖y‖^4*F y≤16*T+16*(4*Real.pi/3*(r/8)^3)⁻¹* + ∫ z in {z | r/2≤‖z‖ ∧ ‖z‖≤8*L*r},max (‖z‖^4*F z-T) 0 := by + let A : Set Position := {z | r/2≤‖z‖ ∧ ‖z‖≤8*L*r} + let B := Metric.closedBall y (r/8) + let V := 4*Real.pi/3*(r/8)^3 + let E := fun z : Position => max (‖z‖^4*F z-T) 0 + have hV : 0 (cap_ball_geometry hr hL hy0 hy1 hz).1 |> fun h0 => + ⟨h0,(cap_ball_geometry hr hL hy0 hy1 hz).2.1⟩ + have hEB : IntegrableOn E B := hE.mono_set hsub + have hloc (z : Position) (hz : z∈B) : ‖y‖^4*F z≤16*T+16*E z := by + have H := cap_ball_geometry hr hL hy0 hy1 hz + have he : ‖z‖^4*F z≤T+E z := by dsimp [E]; linarith [le_max_left (‖z‖^4*F z-T) 0] + by_cases hf : 0≤F z + · have hn : ‖y‖^4≤16*‖z‖^4 := by + have hh := pow_le_pow_left₀ (norm_nonneg y) H.2.2 4 + norm_num [mul_pow] at hh ⊢ + exact hh + have hh := mul_le_mul_of_nonneg_right hn hf + nlinarith + · have hf' : F z≤0 := le_of_not_ge hf + have hh := mul_nonpos_of_nonneg_of_nonpos (pow_nonneg (norm_nonneg y) 4) hf' + have he0 : 0≤E z := le_max_right _ _ + linarith + have hcI : IntegrableOn (fun _ : Position => (16*T:ℝ)) B := + integrableOn_const (isCompact_closedBall y (r/8)).measure_ne_top + have hIB : (∫ z in B,‖y‖^4*F z)≤∫ z in B,16*T+16*E z := by + apply setIntegral_mono_on (hF.const_mul _) (hcI.add (hEB.const_mul _)) + measurableSet_closedBall + exact hloc + have hIE : (∫ z in B,E z)≤∫ z in A,E z := by + apply setIntegral_mono_set hE + · exact Eventually.of_forall (fun z => le_max_right _ _) + · exact Eventually.of_forall (fun _ hz => hsub hz) + have hconst : (∫ z in B,(16*T:ℝ))=V*(16*T) := by + rw [integral_const,smul_eq_mul,measureReal_restrict_apply_univ] + rw [show volume.real B=V from Coulomb.volume_closedBall_three _ (by positivity)] + rw [integral_const_mul,integral_add hcI (hEB.const_mul _), + hconst,integral_const_mul] at hIB + have hm := mul_le_mul_of_nonneg_left hmean (pow_nonneg (norm_nonneg y) 4) + have hIB' := mul_le_mul_of_nonneg_left hIB (inv_nonneg.mpr hV.le) + have hIV : V⁻¹*V=1 := inv_mul_cancel₀ hV.ne' + change ‖y‖^4*F y≤16*T+16*V⁻¹*∫ z in A,E z + calc + _ ≤ V⁻¹*(‖y‖^4*(∫ z in B,F z)) := by simpa only [V,B,mul_left_comm] using hm + _ ≤ V⁻¹*(V*(16*T)+16*(∫ z in B,E z)) := hIB' + _ = 16*T+16*V⁻¹*(∫ z in B,E z) := by rw [mul_add,←mul_assoc,hIV]; ring + _ ≤ _ := by linarith [mul_le_mul_of_nonneg_left hIE (show 0≤16*V⁻¹ by positivity)] +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma spatial_moment_markov {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] {A : Set Position} + (hA : MeasurableSet A) (hAfin : volume A<∞) + {Q : Ω × Position → ℝ} (hQ : Measurable Q) (hQ0 : ∀ z,0≤Q z) + {B M : ℝ} (hB : ∀ ω y,y∈A → Q (ω,y)≤B) + (hM : ∀ y,y∈A → (∫ ω,Q (ω,y) ∂P)≤M) {t : ℝ} (ht : 0 ∫ y in A,Q (ω,y)) ∧ + (∀ ω,IntegrableOn (fun y => Q (ω,y)) A) ∧ + P.real {ω | t<(∫ y in A,Q (ω,y))}≤volume.real A*M/t := by + have : IsFiniteMeasure (volume.restrict A) := ⟨by simpa only [Measure.restrict_apply_univ] using hAfin⟩ + have hI (ω : Ω) : IntegrableOn (fun y => Q (ω,y)) A := by + apply Integrable.of_bound ((hQ.comp (measurable_const.prodMk measurable_id)).aestronglyMeasurable) B + filter_upwards [ae_restrict_mem hA] with y hy + change ‖Q (ω,y)‖≤B + rw [Real.norm_of_nonneg (hQ0 _)] + exact hB ω y hy + have hprod : Integrable Q (P.prod (volume.restrict A)) := by + apply Integrable.of_bound hQ.aestronglyMeasurable B + rw [Measure.ae_prod_iff_ae_ae (measurableSet_le hQ.norm measurable_const)] + filter_upwards [] with ω + filter_upwards [ae_restrict_mem hA] with y hy + rw [Real.norm_of_nonneg (hQ0 _)] + exact hB ω y hy + have hIm : Measurable (fun ω => ∫ y in A,Q (ω,y)) := + hQ.stronglyMeasurable.integral_prod_right'.measurable + refine ⟨hIm,hI,?_⟩ + have hswap : (∫ ω,(∫ y in A,Q (ω,y)) ∂P)=(∫ y in A,∫ ω,Q (ω,y) ∂P) := + integral_integral_swap hprod + have hmean : (∫ ω,(∫ y in A,Q (ω,y)) ∂P)≤volume.real A*M := by + rw [hswap] + calc + _ ≤ ∫ y in A,M := integral_mono_ae hprod.integral_prod_right (integrable_const M) + (by filter_upwards [ae_restrict_mem hA] with y hy; exact hM y hy) + _ = _ := by simp only [integral_const,measureReal_restrict_apply_univ,smul_eq_mul] + have hMark := mul_meas_ge_le_integral_of_nonneg + (Eventually.of_forall (fun ω => integral_nonneg (fun y => hQ0 (ω,y)))) + hprod.integral_prod_left t + have hprob : P.real {ω | t<(∫ y in A,Q (ω,y))}≤P.real {ω | t≤(∫ y in A,Q (ω,y))} := + measureReal_mono (by + intro ω hω + exact (show t<(∫ y in A,Q (ω,y)) from hω).le) + apply (le_div_iff₀ ht).2 + have hh := mul_le_mul_of_nonneg_left hprob ht.le + linarith +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/AtomicBudgetHistory.lean b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicBudgetHistory.lean new file mode 100644 index 0000000000000000000000000000000000000000..22a4d71e1d761ec91adb1abaed0b699bd2a41d76 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicBudgetHistory.lean @@ -0,0 +1,96 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.AtomicHistory + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +structure AtomicBudgetHistory {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (B : ℝ) (j : ℕ) where + ensemble : RecordedEnsemble n + target : Fin j → Space + nonzero : ∀ i, target i≠0 + law : ensemble.Conserves ψ + fermionic : ensemble.CoreFermionic + support : ensemble.OutSupported (atomicPatchRegion target) + mass_eq : ensemble.totalMass=mass ψ + energy : ensemble.totalForm S≤form S ψ+B+∑ i, atomicIMS ψ (target i) + +namespace AtomicBudgetHistory +variable {J n j : ℕ} {S : Nuclei J} {ψ : H1Vector n} {B : ℝ} + +def center (T : AtomicBudgetHistory S ψ B j) (c : Fin j × {z : Space // z∈atomicPatchMesh}) : Space := + atomicMeshCenter (T.target c.1) c.2.val + +lemma center_nonzero (T : AtomicBudgetHistory S ψ B j) (c) : T.center c≠0 := + atomicCellScale_near_nonzero (T.nonzero c.1) (by + change ‖atomicMeshCenter (T.target c.1) c.2.val-T.target c.1‖≤_ + have H := atomicMeshCenter_distance (T.target c.1) c.2.val c.2.property + nlinarith [atomicCellScale_nonneg (T.target c.1)]) + +theorem append (hatom : ∀ i, S.position i=0) (T : AtomicBudgetHistory S ψ B j) + (hmass : mass ψ=1) {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) + (hstate : form S ψ≤E+δ) {y : Space} (hy : y≠0) : + ∃ U : AtomicBudgetHistory S ψ B (j+1), + U.target=Fin.snoc T.target y ∧ + (∀ H : ℝ, + (∀ c v, ‖v-U.center c‖≤2*atomicCellScale (U.center c) → + U.ensemble.rawSquare S v (atomicCellScale v)≤H) → + atomicCellScale y/(16*ballTrialCoefficient)*T.ensemble.rawSquare S y (atomicCellScale y)≤ + δ+B+(∑ i, atomicIMS ψ (U.target i))+4*ballTrialCoefficient*(screenBaseMass (atomicCellScale y))^2/atomicCellScale y+ + ∑ c, (Real.sqrt (localCountSecondMoment ψ (Metric.closedBall (U.center c) (atomicCellScale (U.center c)))*(8*H))+ + (((Fintype.card (Fin (j+1) × {z : Space // z∈atomicPatchMesh})):ℝ)* + (∑ d, localCountSecondMoment ψ (Metric.closedBall (U.center d) (atomicCellScale (U.center d)))))/ + (3*atomicCellScale (U.center c)))) := by + have ha := atomicCellScale_pos hy + have hnuc (i) : 3*atomicCellScale y≤‖S.position i-y‖ := by + rw [hatom i] + have H := atomicCellScale_nucleus_far y + linarith [atomicCellScale_nonneg y] + obtain ⟨V,hV,hanti,hsupp,hm,hform,hgain⟩ := T.ensemble.append_radial S ψ T.law T.fermionic + (atomicPatchRegion T.target) T.support ha y hnuc hE + have hag : ∑ i : Fin (j+1), atomicIMS ψ (Fin.snoc (α := fun _ => Space) T.target y i)=(∑ i, atomicIMS ψ (T.target i))+atomicIMS ψ y := by + rw [Fin.sum_univ_castSucc] + simp only [Fin.snoc_castSucc,Fin.snoc_last] + let U : AtomicBudgetHistory S ψ B (j+1) := { + ensemble := V + target := Fin.snoc T.target y + nonzero := by + intro i + refine Fin.lastCases ?_ (fun i => ?_) i + · simpa only [Fin.snoc_last] using hy + · simpa only [Fin.snoc_castSucc] using T.nonzero i + law := hV + fermionic := hanti + support := by rwa [atomicPatchRegion_snoc] + mass_eq := hm.trans T.mass_eq + energy := by + rw [hag] + have HG := T.energy + change V.totalForm S≤_ + change V.totalForm S≤T.ensemble.totalForm S+atomicIMS ψ y at hform + linarith } + refine ⟨U,rfl,?_⟩ + intro H hraw + have hcost := RecordedEnsemble.atomic_cost_lower S hatom ψ U.ensemble U.law U.center U.center_nonzero + (RecordedEnsemble.patches_cover U.ensemble U.target U.nonzero U.support) hraw + have hm1 : T.ensemble.totalMass=1 := T.mass_eq.trans hmass + rw [hm1,mul_one,mul_one] at hgain + have HG := T.energy + have hs : ∑ i, atomicIMS ψ (U.target i)=(∑ i, atomicIMS ψ (T.target i))+atomicIMS ψ y := hag + rw [hs] + change _≤_+atomicIMS ψ y-_ -E+_ at hgain + linarith + +end AtomicBudgetHistory +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/AtomicBudgetScreening.lean b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicBudgetScreening.lean new file mode 100644 index 0000000000000000000000000000000000000000..3095aada5c7bf14b32083cef9709eb85f7a1bdf6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicBudgetScreening.lean @@ -0,0 +1,290 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.GeometricRecursion +import OAI.Analysis.CoulombRadii.Screening.AtomicBudgetHistory + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def atomicBudgetRawValues {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (B a w : ℝ) (j : ℕ) : Set ℝ := + insert 0 {r | ∃ k ≤ j, ∃ T : AtomicBudgetHistory S ψ B k, + (∀ i, AtomicScaleWindow a (4^j) (T.target i)) ∧ + ∃ y, AtomicScaleWindow a (4^j) y ∧ r=Real.sqrt (T.ensemble.rawSquare S y (atomicCellScale y))/w} + +def atomicBudgetRawSup {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (B a w : ℝ) (j : ℕ) : ℝ := + sSup (atomicBudgetRawValues S ψ B a w j) + +lemma atomicBudgetRawValues_nonempty {J n : ℕ} (S : Nuclei J) (ψ : H1Vector n) (B a w : ℝ) (j : ℕ) : + (atomicBudgetRawValues S ψ B a w j).Nonempty := ⟨0,Set.mem_insert _ _⟩ + +lemma atomicBudgetRawValues_cap {J n : ℕ} (S : Nuclei J) (hatom : ∀ i, S.position i=0) + (ψ : H1Vector n) (hm : mass ψ=1) {B a w : ℝ} (ha : 0 ?_) i + · simpa only [Fin.snoc_last] using hy + · simpa only [Fin.snoc_castSucc] using hT i + refine ⟨U,ht,hU,?_⟩ + intro G hG hraw + let Q := 4*q + have hQ : 1 ≤ Q := by dsimp [Q]; linarith + have hQ0 : 0 HI i) + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_assoc] using H + have hbase : (screenBaseMass (atomicCellScale y))^2/atomicCellScale y ≤ screenEnergy δ (atomicCellScale y) := by + exact div_le_div_of_nonneg_right (pow_le_pow_left₀ (screenBaseMass_nonneg _) (screenMass_ge_base _ _) 2) + (atomicCellScale_nonneg _) + have henergy : screenEnergy δ (atomicCellScale y) ≤ P*Q^7*screenEnergy δ a := + calc + _ ≤ Q^7*screenEnergy δ a := hyQ.energy ha hQ hδ + _ ≤ P*(Q^7*screenEnergy δ a) := le_mul_of_one_le_left (mul_nonneg (pow_nonneg hQ0.le _) he.le) hP + _ = _ := by ring + have hbase' : 4*ballTrialCoefficient*(screenBaseMass (atomicCellScale y))^2/atomicCellScale y ≤ + 4*ballTrialCoefficient*P*Q^7*screenEnergy δ a := by + have H := mul_le_mul_of_nonneg_left (hbase.trans henergy) (show 0 ≤ 4*ballTrialCoefficient by positivity [ballTrialCoefficient_pos]) + simpa only [mul_div_assoc,mul_assoc] using H + have hcost := atomic_cell_cost_units ψ hδ hP ha hQ hG U.center hcQ hc + have HG := hgain ((screenFieldUnit δ P a*G)^2) hraw + let L : ℝ := Fintype.card (Fin (k+1) × {z : Space // z∈atomicPatchMesh}) + have HG' : atomicCellScale y/(16*ballTrialCoefficient)*T.ensemble.rawSquare S y (atomicCellScale y) ≤ + P*Q^7*screenEnergy δ a*(2+(k+1:ℕ)*atomicIMSConstant+4*ballTrialCoefficient+3*L*G+L^3) := by + dsimp [L] + nlinarith [hδe,hBe,hisum,hbase',hcost] + exact screening_gain_normalized ha (atomicCellScale_pos hy0) hQ0 ballTrialCoefficient_pos + (screenFieldUnit_pos hP ha) (T.ensemble.rawSquare_nonneg S y _) hyQ.1 + (screenFieldUnit_square hp0 ha) HG' + +def atomicBudgetRecursionA : ℝ := max 1 (16*ballTrialCoefficient* + (2+atomicIMSConstant+4*ballTrialCoefficient+ + 3*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)+ + (Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)^3)) + +def atomicBudgetRecursionC : ℝ := atomicBudgetRecursionA*524288 + +lemma atomicBudgetRecursionC_ge_four : 4 ≤ atomicBudgetRecursionC := by + have h : 1 ≤ atomicBudgetRecursionA := le_max_left _ _ + unfold atomicBudgetRecursionC + linarith + +lemma AtomicBudgetHistory.rawSquare_le_next_sup {J n k j : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hm : mass ψ=1) + {B a w : ℝ} (ha : 0 ring + have hA : 16*ballTrialCoefficient*(2+atomicIMSConstant+4*ballTrialCoefficient+3*M+M^3) ≤ + atomicBudgetRecursionA := le_max_right _ _ + calc + _ ≤ 16*ballTrialCoefficient*(4*4^j)^8* + (2+(k+1:ℕ)*atomicIMSConstant+4*ballTrialCoefficient+3*L*G+L^3) := HG + _ ≤ 16*ballTrialCoefficient*(4*4^j)^8* + ((2+atomicIMSConstant+4*ballTrialCoefficient+3*M+M^3)*(j+1:ℕ)^3*(1+G)) := + mul_le_mul_of_nonneg_left Hpoly (by positivity [ballTrialCoefficient_pos]) + _ = (16*ballTrialCoefficient*(2+atomicIMSConstant+4*ballTrialCoefficient+3*M+M^3))* + ((4:ℝ)^(j+1))^8*(j+1:ℕ)^3*(1+G) := by rw [pow_succ]; ring + _ ≤ atomicBudgetRecursionA*((4:ℝ)^(j+1))^8*(j+1:ℕ)^3*(1+G) := by + gcongr + _ ≤ atomicBudgetRecursionC^(j+1)*(1+G) := + mul_le_mul_of_nonneg_right (screening_exponential_majorant (le_max_left _ _) j) (by linarith) + +theorem atomicBudgetRawSup_recursion {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hm : mass ψ=1) + {E δ P a B : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hB : B≤P*screenEnergy δ a) (hδ : 0≤δ) (hP : 1≤P) (ha : 0 screenCountParameter_controls ψ hm δ hy) hT y hy + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/AtomicCapRaw.lean b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicCapRaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..999f05803d8c165db25421e22d0abceca674b451 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicCapRaw.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.OutCap +import OAI.Analysis.CoulombRadii.Packets.AtomicMesh + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma farSquare_to_atomic_raw {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + {z v : Space} (hz : z≠0) (hv : ‖v-z‖ ≤ 2*atomicCellScale z) : + sliceExpectation u (fun s x => + (max (recordedFarField S (u.coreSlice s x).normalized x {w | 4*atomicCellScale z ≤ ‖w-z‖} v) 0)^2) ≤ + sliceExpectation u (fun s x => + (max (coreConditionalObservable u + (rawSignedField (attraction S v) {w | 40*atomicCellScale v ≤ ‖w-v‖} v) s x) 0)^2) := by + have hv0 : v≠0 := atomicCellScale_near_nonzero hz (by nlinarith [atomicCellScale_nonneg z]) + have hvpos := atomicCellScale_pos hv0 + have hp : 0<40*atomicCellScale v := by positivity + have hA : MeasurableSet {w : Space | 40*atomicCellScale v ≤ ‖w-v‖} := + (isClosed_le continuous_const (by fun_prop)).measurableSet + have hB : MeasurableSet {w : Space | 4*atomicCellScale z ≤ ‖w-z‖} := + (isClosed_le continuous_const (by fun_prop)).measurableSet + have hb := rawSignedField_abs_le (n:=m+k) (attraction S v) _ v hp (fun _ h => h) + have hB0 : 0 ≤ |attraction S v|+((m+k:ℕ):ℝ)/(40*atomicCellScale v) := by positivity + apply Finset.sum_le_sum + intro s hs + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun _ => mul_nonneg (mass_nonneg _) (sq_nonneg _)) + · exact coreConditionalObservable_positive_weight_integrable u _ + (rawSignedField_measurable _ hA v) hB0 hb s 2 + · filter_upwards [] with x + by_cases hm : mass (u.coreSlice s x)=0 + · simp only [hm,zero_mul,le_refl] + · have hm' := lt_of_le_of_ne (mass_nonneg (u.coreSlice s x)) (Ne.symm hm) + rw [coreConditionalObservable_rawSignedField u _ hA v hp (fun _ h => h) s x hm'] + apply mul_le_mul_of_nonneg_left _ (mass_nonneg _) + apply pow_le_pow_left₀ (le_max_right _ _) _ 2 + apply max_le_max _ le_rfl + exact recordedFarField_anti S (u.coreSlice s x).normalized x hA hB (atomic_raw_exclusion_subset hv) v + +lemma sliceFarSquare_ballCloud_integrable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {A : Set Space} (hA : MeasurableSet A) + {a : ℝ} (ha : 0 (sliceExpectation u (fun s x => + (max (recordedFarField S (u.coreSlice s x).normalized x A v) 0)^2))*ballCloud y a 1 v) := by + unfold sliceExpectation + simp only [Finset.sum_mul,←integral_mul_const] + exact integrable_finsetSum _ (fun s _ => + (farSquare_mass_ballCloud_integrable S u s hA ha y hnuc).integral_prod_right) + +theorem atomic_cap_sq_le_of_raw_bound {P : Type*} [Fintype P] {J : ℕ} + (S : Nuclei J) (m k : P → ℕ) (u : (p : P) → H1Vector (m p+k p)) + {z : Space} (hz : z≠0) (hnuc : ∀ j, 4*atomicCellScale z ≤ ‖S.position j-z‖) + {H : ℝ} (hraw : ∀ v : Space, ‖v-z‖ ≤ 2*atomicCellScale z → + (∑ p, sliceExpectation (u p) (fun s x => + (max (coreConditionalObservable (u p) + (rawSignedField (attraction S v) {w | 40*atomicCellScale v ≤ ‖w-v‖} v) s x) 0)^2)) ≤ H) : + (∑ p, sliceExpectation (u p) (fun s x => + (localFarCap S ((u p).coreSlice s x).normalized x z (atomicCellScale z))^2)) ≤ 8*H := by + have ha := atomicCellScale_pos hz + let A := {w : Space | 4*atomicCellScale z ≤ ‖w-z‖} + have hA : MeasurableSet A := (isClosed_le continuous_const (by fun_prop)).measurableSet + let F := fun p v => sliceExpectation (u p) (fun s x => + (max (recordedFarField S ((u p).coreSlice s x).normalized x A v) 0)^2) + have hi (p) : Integrable (fun v => F p v*ballCloud z (2*atomicCellScale z) 1 v) := + sliceFarSquare_ballCloud_integrable S (u p) hA (by positivity) z (fun j => by nlinarith [hnuc j]) + have hb : Integrable (fun v => H*ballCloud z (2*atomicCellScale z) 1 v) := (ballCloud_integrable _ _ _).const_mul H + have hsum : (∫ v, ∑ p, F p v*ballCloud z (2*atomicCellScale z) 1 v) ≤ H := by + calc + _ ≤ ∫ v, H*ballCloud z (2*atomicCellScale z) 1 v := by + apply integral_mono (integrable_finsetSum _ (fun p _ => hi p)) hb + intro v + change (∑ p, F p v*ballCloud z (2*atomicCellScale z) 1 v) ≤ H*ballCloud z (2*atomicCellScale z) 1 v + rw [←Finset.sum_mul] + by_cases hv : v-z ∈ Metric.ball (0:Space) (2*atomicCellScale z) + · have hdist : ‖v-z‖ ≤ 2*atomicCellScale z := by + exact (by simpa only [Metric.mem_ball,dist_zero_right] using hv : ‖v-z‖ < 2*atomicCellScale z).le + apply mul_le_mul_of_nonneg_right _ (uniformBall_nonneg (by positivity) zero_le_one (v-z)) + exact (Finset.sum_le_sum (fun p _ => farSquare_to_atomic_raw S (u p) hz hdist)).trans (hraw v hdist) + · simp only [ballCloud,uniformBall,indicator_of_notMem hv,mul_zero,le_refl] + _ = H := by rw [integral_const_mul,ballCloud_mass (by positivity) 1 z,mul_one] + calc + _ = ∑ p, 8*(∫ v, F p v*ballCloud z (2*atomicCellScale z) 1 v) := by + apply Finset.sum_congr rfl + intro p hp + exact sliceExpectation_localFarCap_sq S (u p) ha z hnuc + _ = 8*(∫ v, ∑ p, F p v*ballCloud z (2*atomicCellScale z) 1 v) := by + rw [←Finset.mul_sum,integral_finsetSum _ (fun p _ => hi p)] + _ ≤ _ := mul_le_mul_of_nonneg_left hsum (by norm_num) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/AtomicMasterFresh.lean b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicMasterFresh.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb3b51642ed447124f35bfabca87a9d9cf29f72f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicMasterFresh.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RadialBounds.AtomicMasterError +import OAI.Analysis.CoulombRadii.FieldAnalysis.FreshTransferScale + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma master_deficit_power {a w : ℝ} (ha : 0 f x*‖u.value s x‖^2) := + (u.value_L2 s).norm.integrable_sq.bdd_mul hf hb +lemma fraction_pair_integrable {n:ℕ} (u:H1Vector n) (i j:Fin n) {e:ℝ} (he:0 atomicFraction e (position x i)*atomicFraction e (position x j)*‖u.value s x‖^2) := by + apply bounded_potential_integrable u _ + ((((atomicFraction_measurable e).comp (continuous_position i).measurable).mul + ((atomicFraction_measurable e).comp (continuous_position j).measurable)).aestronglyMeasurable) + (C:=1) _ s + exact Eventually.of_forall fun x => by + dsimp only [Function.comp_apply,Pi.mul_apply] + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (atomicFraction_nonneg he _) (atomicFraction_nonneg he _))] + exact (mul_le_of_le_one_left (atomicFraction_nonneg he _) + (atomicFraction_le_one he _)).trans (atomicFraction_le_one he _) +lemma weighted_attraction_le {n:ℕ} (Z:ℕ) (u:H1Vector n) (hm:mass u=1) (i:Fin n) + {e:ℝ} (he:0 (Z:ℝ)*coulombKernel (position x i)*atomicWeight e (position x i)) u≤Z := by + have hi:∀ s,Integrable (fun x => (Z:ℝ)*atomicFraction e (position x i)*‖u.value s x‖^2) := by + intro s + apply bounded_potential_integrable u _ + (((atomicFraction_measurable e).comp (continuous_position i).measurable).const_mul (Z:ℝ)).aestronglyMeasurable + (C:=(Z:ℝ)) _ s + exact Eventually.of_forall fun x => by + dsimp only [Function.comp_apply,Pi.mul_apply] + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (Nat.cast_nonneg _) (atomicFraction_nonneg he _))] + exact mul_le_of_le_one_right (Nat.cast_nonneg _) (atomicFraction_le_one he _) + have H:=potentialForm_mono_ae u (fun x => (Z:ℝ)*atomicFraction e (position x i)) (fun _ => (Z:ℝ)) hi + (fun s => (u.value_L2 s).norm.integrable_sq.const_mul _) (Eventually.of_forall fun x => + mul_le_of_le_one_right (Nat.cast_nonneg _) (atomicFraction_le_one he _)) + rw [potentialForm_const,hm,mul_one] at H + simpa only [atomicFraction,mul_assoc] using H +lemma atomic_fraction_pair_bound (Z:ℕ) (hZ:1≤Z) {k:ℕ} + (u:H1Vector (1+k)) (ha:Antisymmetric u) (hm:mass u=1) + (hmin:(form (atom Z hZ) u:EReal)=sectorFormBottom (atom Z hZ) (1+k)) + {e:ℝ} (he:0 atomicFraction e (position x 0)* + atomicFraction e (position x (Fin.natAdd 1 j))) u)≤2*(Z:ℝ) := by + have hne(j:Fin k):(0:Fin (1+k))≠Fin.natAdd 1 j:=by + intro hh; have H:=congrArg Fin.val hh; simp only [Fin.val_zero,Fin.val_natAdd] at H; omega + let F:Fin k → Configuration (1+k) → ℝ:=fun j x => + coulombKernel (position x 0-position x (Fin.natAdd 1 j))*atomicWeight e (position x 0) + have hi:∀ j:Fin k,∀ s,Integrable (fun x => F j x*‖u.value s x‖^2):=fun j s => + pair_weight_integrable u 0 (Fin.natAdd 1 j) 0 (hne j) he s + have hj(j:Fin k):potentialForm (fun x => atomicFraction e (position x 0)* + atomicFraction e (position x (Fin.natAdd 1 j))) u≤2*potentialForm (F j) u := by + have hi':∀ s,Integrable (fun x => coulombKernel (position x 0-position x (Fin.natAdd 1 j))* + atomicWeight e (position x (Fin.natAdd 1 j))*‖u.value s x‖^2):=fun s => + pair_weight_integrable u 0 (Fin.natAdd 1 j) (Fin.natAdd 1 j) (hne j) he s + have H:=potentialForm_mono_ae u _ + (fun x => F j x+coulombKernel (position x 0-position x (Fin.natAdd 1 j))*atomicWeight e (position x (Fin.natAdd 1 j))) + (fraction_pair_integrable u 0 (Fin.natAdd 1 j) he) + (fun s => ((hi j s).add (hi' s)).congr (Eventually.of_forall fun x => by dsimp only; rw [add_mul]; rfl)) (by + filter_upwards [ae_position_ne (1+k) 0,ae_position_injective (1+k)] with x hx hp + simpa only [F,mul_add] using atomic_weight_triangle he (hx 0) (hx (Fin.natAdd 1 j)) + (fun h => hne j (hp h))) + rw [potentialForm_add _ _ _ (hi j) hi',pair_weight_symmetry u ha] at H + linarith only [H] + have Hsum:=Finset.sum_le_sum (fun j (_:j∈(Finset.univ:Finset (Fin k))) => hj j) + rw [←Finset.mul_sum,←potentialForm_finsetSum u Finset.univ F (fun j _ => hi j)] at Hsum + have hid:(fun x => ∑ j:Fin k,F j x)=(fun x => atomicCross x*atomicWeight e (position x 0)):=by + funext x; simp only [F,atomicCross,Finset.sum_mul] + rw [hid] at Hsum + exact Hsum.trans (mul_le_mul_of_nonneg_left + ((regularized_weighted_core_limit Z hZ u ha hm hmin e he).trans (weighted_attraction_le Z u hm 0 he)) (by norm_num)) +lemma atomicFraction_tendsto {e:ℕ → ℝ} (ht:Tendsto e atTop (𝓝 0)) {x:Space} (hx:x≠0): + Tendsto (fun j => atomicFraction (e j) x) atTop (𝓝 1) := by + have hr:0 ((j:ℝ)+1)⁻¹ + have he:∀ j,0 by dsimp [e]; positivity + have ht:Tendsto e atTop (𝓝 0):=by + simpa only [one_div] using tendsto_one_div_add_atTop_nhds_zero_nat (𝕜:=ℝ) + have hlim(j:Fin k):Tendsto (fun q => potentialForm (fun x => atomicFraction (e q) (position x 0)* + atomicFraction (e q) (position x (Fin.natAdd 1 j))) u) atTop (𝓝 1) := by + have H:=potentialForm_tendsto_bdd u (fun _ => 1) + (fun s => by simpa using (u.value_L2 s).norm.integrable_sq) + (fun q x => atomicFraction (e q) (position x 0)*atomicFraction (e q) (position x (Fin.natAdd 1 j))) + (fun _ => 1) 1 + (fun q => by + apply AEStronglyMeasurable.mul + · exact ((atomicFraction_measurable (e q)).comp (continuous_position 0).measurable).aestronglyMeasurable + · exact ((atomicFraction_measurable (e q)).comp (continuous_position (Fin.natAdd 1 j)).measurable).aestronglyMeasurable) + (fun q => Eventually.of_forall fun x => by + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (atomicFraction_nonneg (he q) _) (atomicFraction_nonneg (he q) _))] + exact (mul_le_of_le_one_left (atomicFraction_nonneg (he q) _) + (atomicFraction_le_one (he q) _)).trans (atomicFraction_le_one (he q) _)) + (by + filter_upwards [ae_position_ne (1+k) 0] with x hx + simpa only [one_mul] using (atomicFraction_tendsto ht (hx 0)).mul + (atomicFraction_tendsto ht (hx (Fin.natAdd 1 j)))) + simpa only [one_mul,potentialForm_const,hm,mul_one] using H + have Hlim:=tendsto_finsetSum Finset.univ (fun j _ => hlim j) + have H:=le_of_tendsto Hlim (Eventually.of_forall fun q => atomic_fraction_pair_bound Z hZ u ha hm hmin (he q)) + have H':(k:ℝ)≤2*(Z:ℝ):=by simpa using H + exact_mod_cast H' +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/AtomicPatchCap.lean b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicPatchCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba58232c3fb6002c4ea0de706d8356efbec25feb --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/AtomicPatchCap.lean @@ -0,0 +1,161 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.ScreenBox + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma le_sqrt_sum_squares {C : Type*} [Fintype C] (f : C → ℝ) (c : C) : + f c≤Real.sqrt (∑ v, (f v)^2) := by + apply le_trans (le_abs_self _) + apply (Real.le_sqrt (abs_nonneg _) (Finset.sum_nonneg (fun _ _ => sq_nonneg _))).mpr + rw [sq_abs] + exact Finset.single_le_sum (fun v _ => sq_nonneg (f v)) (Finset.mem_univ c) + +def atomicPatchCap {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (y : Space) : ℝ := + Real.sqrt (∑ z : {z : Space // z∈atomicPatchMesh}, + (localFarCap S u x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2)+ + 2*(m:ℝ)/(3*atomicCellScale y) + +lemma atomicPatchCap_nonneg {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) {y : Space} (hy : y≠0) : 0≤atomicPatchCap S u x y := by + have ha := atomicCellScale_pos hy + unfold atomicPatchCap + positivity + +lemma coreField_le_atomicPatchCap {J m k : ℕ} (S : Nuclei J) (hatom : ∀ j, S.position j=0) + (u : H1Vector k) (x : Configuration m) {y : Space} (hy : y≠0) {w : Space} + (hw : ‖w-y‖≤80*atomicCellScale y) : coreScreenedField S u w≤atomicPatchCap S u x y := by + obtain ⟨z,hz,hwz⟩ := atomicMesh_cover hy w hw + have hz0 : atomicMeshCenter y z≠0 := atomicCellScale_near_nonzero hy + (by nlinarith [atomicMeshCenter_distance y z hz,atomicCellScale_nonneg y]) + have hza := atomicCellScale_pos hz0 + have H := coreField_le_local_far_cap S u x hza (atomicMeshCenter y z) w hwz + (fun j => by rw [hatom j]; exact atomicCellScale_nucleus_far _) + have hcap := le_sqrt_sum_squares + (fun v : {z : Space // z∈atomicPatchMesh} => + localFarCap S u x (atomicMeshCenter y v.val) (atomicCellScale (atomicMeshCenter y v.val))) + (⟨z,hz⟩ : {z : Space // z∈atomicPatchMesh}) + have hcount : (m:ℝ)/(3*atomicCellScale (atomicMeshCenter y z))≤2*(m:ℝ)/(3*atomicCellScale y) := by + calc + _≤(m:ℝ)/(3*(atomicCellScale y/2)) := div_le_div_of_nonneg_left (Nat.cast_nonneg _) + (by positivity [atomicCellScale_pos hy]) (by linarith [(atomicMeshCenter_comparable y z hz).1]) + _=_ := by ring + exact H.trans (add_le_add hcap hcount) + +lemma atomicPatchCap_square_le {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (y : Space) : (atomicPatchCap S u x y)^2≤ + 2*∑ z : {z : Space // z∈atomicPatchMesh}, + (localFarCap S u x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2+ + 8*(m:ℝ)^2/(9*(atomicCellScale y)^2) := by + have hs := Real.sq_sqrt (x := ∑ z : {z : Space // z∈atomicPatchMesh}, + (localFarCap S u x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2) + (Finset.sum_nonneg (fun z _ => sq_nonneg + (localFarCap S u x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val))))) + unfold atomicPatchCap + have H := sq_nonneg (Real.sqrt (∑ z : {z : Space // z∈atomicPatchMesh}, + (localFarCap S u x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2)- + 2*(m:ℝ)/(3*atomicCellScale y)) + rw [show 8*(m:ℝ)^2/(9*(atomicCellScale y)^2)=2*(2*(m:ℝ)/(3*atomicCellScale y))^2 by ring] + nlinarith + +lemma atomicPatchCap_slice_aestronglyMeasurable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) (s : Spins m) (y : Space) : + AEStronglyMeasurable (fun x => atomicPatchCap S (u.coreSlice s x).normalized x y) volume := by + apply AEStronglyMeasurable.add_const + apply Real.continuous_sqrt.comp_aestronglyMeasurable + exact Finset.aestronglyMeasurable_fun_sum _ (fun z _ => + (localFarCap_normalized_slice_aestronglyMeasurable S u s _ _).pow 2) + +lemma atomicPatchCap_weight_integrable {J m k : ℕ} (S : Nuclei J) + (hatom : ∀ j, S.position j=0) (u : H1Vector (m+k)) (s : Spins m) {y : Space} (hy : y≠0) : + Integrable (fun x => mass (u.coreSlice s x)*(atomicPatchCap S (u.coreSlice s x).normalized x y)^2) := by + let C := {z : Space // z∈atomicPatchMesh} + have hi (z : C) : Integrable (fun x => mass (u.coreSlice s x)* + (localFarCap S (u.coreSlice s x).normalized x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2) := by + apply localFarCap_weight_integrable S u s + · exact atomicCellScale_pos (atomicCellScale_near_nonzero hy (by + nlinarith [atomicMeshCenter_distance y z.val z.property,atomicCellScale_nonneg y])) + · intro j + rw [hatom j] + exact atomicCellScale_nucleus_far _ + have HR : Integrable (fun x => 2*(∑ z : C, mass (u.coreSlice s x)* + (localFarCap S (u.coreSlice s x).normalized x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2)+ + mass (u.coreSlice s x)*(8*(m:ℝ)^2/(9*(atomicCellScale y)^2))) := + ((integrable_finsetSum _ (fun z _ => hi z)).const_mul 2).add ((mass_coreSlice_integrable u s).mul_const _) + apply HR.mono' + ((mass_coreSlice_integrable u s).aestronglyMeasurable.mul ((atomicPatchCap_slice_aestronglyMeasurable S u s y).pow 2)) + filter_upwards [] with x + simp only [Pi.mul_apply,Pi.pow_apply] + rw [Real.norm_of_nonneg (mul_nonneg (mass_nonneg _) (sq_nonneg _))] + have H := mul_le_mul_of_nonneg_left (atomicPatchCap_square_le S (u.coreSlice s x).normalized x y) (mass_nonneg (u.coreSlice s x)) + simpa only [Pi.add_apply,mul_add,Finset.mul_sum,mul_left_comm (mass _) 2] using H + +theorem atomicPatchCap_ensemble_square {J n : ℕ} (S : Nuclei J) + (hatom : ∀ j, S.position j=0) (T : RecordedEnsemble n) {y : Space} (hy : y≠0) {H : ℝ} + (hraw : ∀ v, AtomicScaleWindow (atomicCellScale y) 4 v → T.rawSquare S v (atomicCellScale v)≤H) : + (∑ p, sliceExpectation (T.vector p) (fun s x => (atomicPatchCap S ((T.vector p).coreSlice s x).normalized x y)^2))≤ + 16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)*H+ + 8*(∑ p, (T.out p:ℝ)^2*mass (T.vector p))/(9*(atomicCellScale y)^2) := by + let C := {z : Space // z∈atomicPatchMesh} + have hz (z : C) : atomicMeshCenter y z.val≠0 := atomicCellScale_near_nonzero hy (by + nlinarith [atomicMeshCenter_distance y z.val z.property,atomicCellScale_nonneg y]) + have hnuc (z : C) (j) : 4*atomicCellScale (atomicMeshCenter y z.val)≤‖S.position j-atomicMeshCenter y z.val‖ := by + rw [hatom j] + exact atomicCellScale_nucleus_far _ + have Hcap (z : C) : (∑ p, sliceExpectation (T.vector p) (fun s x => + (localFarCap S ((T.vector p).coreSlice s x).normalized x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2))≤8*H := by + apply atomic_cap_sq_le_of_raw_bound S T.out T.core T.vector (hz z) (hnuc z) + intro v hv + apply hraw v + have hw : AtomicScaleWindow (atomicCellScale y) 1 y := by constructor <;> simp + simpa only [mul_one] using hw.mesh_near zero_le_one z.property hv + have Hp (p : T.index) : sliceExpectation (T.vector p) (fun s x => (atomicPatchCap S ((T.vector p).coreSlice s x).normalized x y)^2)≤ + 2*(∑ z : C, sliceExpectation (T.vector p) (fun s x => + (localFarCap S ((T.vector p).coreSlice s x).normalized x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2))+ + (8*(T.out p:ℝ)^2/(9*(atomicCellScale y)^2))*mass (T.vector p) := by + rw [←sliceExpectation_number (T.vector p) (8*(T.out p:ℝ)^2/(9*(atomicCellScale y)^2))] + unfold sliceExpectation + rw [Finset.sum_comm,Finset.mul_sum,←Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro s hs + rw [←integral_finsetSum _ (fun z _ => localFarCap_weight_integrable S (T.vector p) s (atomicCellScale_pos (hz z)) _ (hnuc z) 2),←integral_const_mul, + ←integral_add ((integrable_finsetSum _ (fun z _ => localFarCap_weight_integrable S (T.vector p) s (atomicCellScale_pos (hz z)) _ (hnuc z) 2)).const_mul 2) + ((mass_coreSlice_integrable (T.vector p) s).mul_const _)] + apply integral_mono_ae (atomicPatchCap_weight_integrable S hatom (T.vector p) s hy) + (((integrable_finsetSum _ (fun z _ => localFarCap_weight_integrable S (T.vector p) s (atomicCellScale_pos (hz z)) _ (hnuc z) 2)).const_mul 2).add + ((mass_coreSlice_integrable (T.vector p) s).mul_const _)) + filter_upwards [] with x + have HH := mul_le_mul_of_nonneg_left (atomicPatchCap_square_le S ((T.vector p).coreSlice s x).normalized x y) + (mass_nonneg ((T.vector p).coreSlice s x)) + simpa only [Pi.add_apply,mul_add,Finset.mul_sum,mul_left_comm (mass _) 2] using HH + calc + _≤∑ p, (2*(∑ z : C, sliceExpectation (T.vector p) (fun s x => + (localFarCap S ((T.vector p).coreSlice s x).normalized x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2))+ + (8*(T.out p:ℝ)^2/(9*(atomicCellScale y)^2))*mass (T.vector p)) := Finset.sum_le_sum (fun p _ => Hp p) + _=2*(∑ z : C, ∑ p, sliceExpectation (T.vector p) (fun s x => + (localFarCap S ((T.vector p).coreSlice s x).normalized x (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)))^2))+ + 8*(∑ p, (T.out p:ℝ)^2*mass (T.vector p))/(9*(atomicCellScale y)^2) := by + rw [Finset.sum_add_distrib,←Finset.mul_sum,Finset.sum_comm] + congr 1 + simp only [Finset.mul_sum,Finset.sum_div] + apply Finset.sum_congr rfl + intro p hp + ring + _≤2*(∑ _z : C, 8*H)+8*(∑ p, (T.out p:ℝ)^2*mass (T.vector p))/(9*(atomicCellScale y)^2) := by + exact add_le_add (mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun z _ => Hcap z)) (show (0:ℝ)≤2 by norm_num)) le_rfl + _=_ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,Fintype.card_coe, C]; ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/CoreCount.lean b/lean/OAI/Analysis/CoulombRadii/Screening/CoreCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..799ab9a9144ccddfb7450b3a3a3967127ac06036 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/CoreCount.lean @@ -0,0 +1,150 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.RecordedEnsemble +import OAI.Analysis.CoulombRadii.ThomasFermi.BinaryEnsemble + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma localCount_core_le {m k : ℕ} (A : Set Space) (x : Configuration (m+k)) + (hx : ∀ i : Fin k, position x (Fin.natAdd m i)∈A) : (k:ℝ)≤localCount A x := by + unfold localCount + rw [Fin.sum_univ_add] + have he : (∑ i : Fin k, A.indicator (fun _ => (1:ℝ)) (position x (Fin.natAdd m i)))=k := by + simp only [indicator_of_mem (hx _),Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_one] + rw [he] + exact le_add_of_nonneg_left (Finset.sum_nonneg (fun _ _ => indicator_nonneg (fun _ _ => zero_le_one) _)) + +lemma localCount_le_core {m k : ℕ} (A : Set Space) (x : Configuration (m+k)) + (hx : ∀ i : Fin m, position x (Fin.castAdd k i)∉A) : localCount A x≤(k:ℝ) := by + unfold localCount + rw [Fin.sum_univ_add] + have he : (∑ i : Fin m, A.indicator (fun _ => (1:ℝ)) (position x (Fin.castAdd k i)))=0 := by + simp only [indicator_of_notMem (hx _),Finset.sum_const_zero] + rw [he,zero_add] + calc + _ ≤ ∑ _i : Fin k, (1:ℝ) := Finset.sum_le_sum (fun i _ => by + by_cases h : position x (Fin.natAdd m i)∈A <;> simp [h]) + _ = _ := by simp + +lemma PartlySupported.core_population {m k : ℕ} {v : H1Vector (m+k)} + {A : Set Space} (hA : MeasurableSet A) (hv : PartlySupported v (coreIndexSet m k) A) : + (k:ℝ)*mass v≤expectedPopulation v A := by + rw [expectedPopulation_eq v hA] + unfold mass + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + rw [←integral_const_mul] + apply integral_mono_ae (((v.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul _) + (by simpa using localCount_weight_integrable v hA s 1) + filter_upwards [hv s] with x hx + by_cases hz : v.value s x=0 + · simp [hz] + · apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + exact localCount_core_le A x (fun i => by + by_contra h + exact hz (hx _ ⟨i,rfl⟩ h)) + +def positiveInnerDeficit {n : ℕ} (Z : ℝ) (A : Set Space) (x : Configuration n) : ℝ := + max (Z-localCount A x) 0 + +lemma positiveInnerDeficit_measurable {n : ℕ} (Z : ℝ) {A : Set Space} (hA : MeasurableSet A) : + Measurable (positiveInnerDeficit (n:=n) Z A) := + (measurable_const.sub (localCount_measurable hA)).max measurable_const + +lemma positiveInnerDeficit_nonneg {n : ℕ} (Z : ℝ) (A : Set Space) (x : Configuration n) : + 0≤positiveInnerDeficit Z A x := le_max_right _ _ + +lemma positiveInnerDeficit_le {n : ℕ} {Z : ℝ} (hZ : 0≤Z) (A : Set Space) (x : Configuration n) : + positiveInnerDeficit Z A x≤Z := max_le (sub_le_self _ (localCount_nonneg _ _)) hZ + +lemma PartlySupported.deficit_moment {m k : ℕ} {v : H1Vector (m+k)} {Z : ℝ} (hZ : 0≤Z) + {A B : Set Space} (hA : MeasurableSet A) (hAB : Disjoint A B) + (hv : PartlySupported v (outIndexSet m k) B) : + (max (Z-(k:ℝ)) 0)^2*mass v≤potentialForm (fun x => (positiveInnerDeficit Z A x)^2) v := by + unfold mass potentialForm + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + rw [←integral_const_mul] + apply integral_mono_ae (((v.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul _) + (boundedObservable_integrable v _ ((positiveInnerDeficit_measurable Z hA).pow_const 2) + (fun x => by + rw [abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (positiveInnerDeficit_nonneg _ _ _) (positiveInnerDeficit_le hZ A x) 2) s) + filter_upwards [hv s] with x hx + by_cases hz : v.value s x=0 + · simp [hz] + · apply mul_le_mul_of_nonneg_right _ (sq_nonneg _) + apply pow_le_pow_left₀ (le_max_right _ _) + apply max_le_max_right + apply sub_le_sub_left + exact localCount_le_core A x (fun i hi => by + have hn : position x (Fin.castAdd k i)∉B := fun h => Set.disjoint_left.mp hAB hi h + exact hz (hx _ ⟨i,rfl⟩ hn)) + +namespace RecordedEnsemble + +def coreMean {n : ℕ} (T : RecordedEnsemble n) : ℝ := ∑ p, (T.core p:ℝ)*mass (T.vector p) +def coreDeficitMoment {n : ℕ} (T : RecordedEnsemble n) (Z : ℝ) : ℝ := + ∑ p, (max (Z-(T.core p:ℝ)) 0)^2*mass (T.vector p) +def favorableMass {n : ℕ} (T : RecordedEnsemble n) (Z : ℝ) : ℝ := + ∑ p, if (T.core p:ℝ) (hs p).core_population hA) + +lemma coreDeficitMoment_le_raw {n : ℕ} {T : RecordedEnsemble n} {ψ : H1Vector n} + (hT : T.Conserves ψ) {Z : ℝ} (hZ : 0≤Z) {A B : Set Space} (hA : MeasurableSet A) + (hAB : Disjoint A B) (hs : T.OutSupported B) : + T.coreDeficitMoment Z≤potentialForm (fun x => (positiveInnerDeficit Z A x)^2) ψ := by + have H := hT (fun x => (positiveInnerDeficit Z A x)^2) + ((positiveInnerDeficit_measurable Z hA).pow_const 2) + ⟨Z^2,fun x => by rw [abs_of_nonneg (sq_nonneg _)]; exact + pow_le_pow_left₀ (positiveInnerDeficit_nonneg _ _ _) (positiveInnerDeficit_le hZ A x) 2⟩ + have he p : (fun x => (positiveInnerDeficit (n:=n) Z A x)^2) ∘ reindexConfiguration (T.labels p)= + (fun x => (positiveInnerDeficit Z A x)^2) := by + funext x + simp only [Function.comp_def,positiveInnerDeficit,localCount_reindex] + simp only [he] at H + rw [←H] + exact Finset.sum_le_sum (fun p _ => (hs p).deficit_moment hZ hA hAB) + +lemma favorableMass_of_core_moments {n : ℕ} (T : RecordedEnsemble n) {Z M : ℝ} + (hM : 0 H p) + have he : (∑ p, 2*M*(Z-(T.core p:ℝ))*mass (T.vector p))=2*M*(Z*T.totalMass-T.coreMean) := by + simp only [totalMass,coreMean,Finset.mul_sum,Finset.sum_sub_distrib,mul_sub,sub_mul] + simp only [mul_assoc] + rw [he,hm,mul_one] at HH + simp only [Finset.sum_add_distrib,←Finset.mul_sum] at HH + change 2*M*(Z-T.coreMean)≤T.coreDeficitMoment Z+M^2*T.favorableMass Z at HH + apply (div_le_iff₀ hM).mpr + apply (mul_le_mul_iff_left₀ hM).mp + nlinarith [mul_le_mul_of_nonneg_left hmean (show 0≤2*M by positivity)] + +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/CoreMoment.lean b/lean/OAI/Analysis/CoulombRadii/Screening/CoreMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..43edbabcdd33c3af19eb411f4ab4ae9176106c66 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/CoreMoment.lean @@ -0,0 +1,81 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PhysicalDeficitMoment + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom + +def fixedCoreMomentBound (t : ℝ) : ℝ := + 1+(observedDeficitCoefficient (fun _ : Fin 1 => t/16) 0 (t/4))^2+ + ∑' k : ℕ, (observedDeficitCoefficient (fun _ : Fin 1 => t/16) 0 (t/4)* + (1+((k+1:ℕ):ℝ))^3)^2*Real.exp (-(k:ℝ)) + +lemma fixedCoreMomentBound_pos (t : ℝ) : 0 t/16) 0 (t/4)* + (1+((k+1:ℕ):ℝ))^3)^2*Real.exp (-(k:ℝ)) := + tsum_nonneg (fun _ => mul_nonneg (sq_nonneg _) (Real.exp_pos _).le) + positivity + +lemma zero_offset_raw_deficit_moment {n : ℕ} (Z : ℕ) (hZ : 1≤Z) + (u : Coulomb.H1Vector n) (ha : Coulomb.Antisymmetric u) (hm : Coulomb.mass u=1) + {E : ℝ} (hE : (E:EReal)≤Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (he : Coulomb.form (Coulomb.atom Z hZ) u≤E) {t : ℝ} (ht : 0 (Coulomb.positiveInnerDeficit (Z:ℝ) (Metric.ball 0 t) x)^2) u≤ + fixedCoreMomentBound t := by + let ψ := fromH1Wave u + let g := fromH1Gradient u + have hd : FormDomain ψ g := fromH1_domain u ha + have hn : normSquared ψ=1 := (fromH1_mass u).trans hm + have hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → + energy Z ψ g≤energy Z χ h := by + intro χ h hχ hχm + have hv := Coulomb.unrestrictedFormBottom_le_trial (Coulomb.atom Z hZ) + (asH1 χ h hχ.2.1 hχ.2.2.1 hχ.2.2.2.1) (asH1_antisymmetric hχ) ((asH1_mass ..).trans hχm) + rw [asH1_energy Z hZ] at hv + rw [fromH1_energy Z hZ] + exact he.trans (EReal.coe_le_coe_iff.mp (hE.trans hv)) + have hbase : energy Z ψ g≤E+0 := by + change energy Z (fromH1Wave u) (fromH1Gradient u)≤E+0 + simpa only [fromH1_energy Z hZ,add_zero] using he + have hsqrt : Real.sqrt 3≤2 := by nlinarith [Real.sq_sqrt (by norm_num : (0:ℝ)≤3),Real.sqrt_nonneg 3] + have hw : Real.sqrt 3*(t/16)≤t/8 := by nlinarith + have H := physical_raw_positive_deficit_second_moment Z hZ hd hn hmin hE hbase le_rfl + (fun _ : Fin 1 => t/16) (fun _ => by positivity) (0:Fin 1) + (show 0 (Coulomb.positiveInnerDeficit (Z:ℝ) (Metric.ball 0 t) x)^2) u≤ + (observedDeficitCoefficient (fun _ : Fin 1 => t/16) 0 (t/4))^2+ + ∑' k : ℕ, (observedDeficitCoefficient (fun _ : Fin 1 => t/16) 0 (t/4)* + (1+((k+1:ℕ):ℝ))^3)^2*Real.exp (-(k:ℝ)) := by + simpa only [Coulomb.potentialForm,ψ,g,asH1,fromH1Wave,ContinuousLinearEquiv.apply_symm_apply] using H + unfold fixedCoreMomentBound + linarith + +end NeutralAtom +namespace Coulomb.RecordedEnsemble + +lemma zero_offset_core_deficit_moment {n : ℕ} (Z : ℕ) (hZ : 1≤Z) + (u : H1Vector n) (ha : Antisymmetric u) (hm : mass u=1) + {E : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom (atom Z hZ)) + (he : form (atom Z hZ) u≤E) {t : ℝ} (ht : 0 attraction S x*d x) := by + simp only [attraction,Finset.sum_mul] + apply integrable_finsetSum + intro j _ + have H := (coulomb_convolution_integrable hd hm hp hC (by norm_num : (0:ℝ)<1) (S.position j)).const_mul (S.charge j) + apply H.congr + filter_upwards [] with x + rw [coulombKernel_sub_comm (S.position j)] + ring + +lemma packetDensity_nuclear_integrable {M : ℕ} (S : Nuclei M) + (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hi : Integrable ρ) : + Integrable (fun x => attraction S x*packetDensity g ρ x) := + boundedDensity_nuclear_integrable S _ (packetDensity_integrable g ρ hp hm hi) + (packetDensity_measurable g ρ hm) (packetDensity_nonneg g ρ hp) _ + (packetDensity_bound g ρ hp hm hi) + +lemma packetDensity_pair_integrable (g : 𝓢(Space,ℝ)) (ρ : Space → ℝ) + (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) : + Integrable (fun xy : Space × Space => coulombKernel (xy.1-xy.2)* + (packetDensity g ρ xy.1*packetDensity g ρ xy.2)) := by + have hd := packetDensity_integrable g ρ hp hm hi + have hdm := packetDensity_measurable g ρ hm + have H := coulomb_pair_integrable hd hdm hd hdm (fun y => by + rw [Real.norm_of_nonneg (packetDensity_nonneg g ρ hp y)] + exact packetDensity_bound g ρ hp hm hi y) + apply H.congr + filter_upwards [] with xy + ring + +lemma packetPositive_orthonormal (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) [IsFiniteMeasure μ] + (F : positivePacketIndex g μ → Space → ℂ) + (he : ∀ i, (packetBasis g μ i.val : Space → ℂ) =ᵐ[volume] F i) : + ∀ i j, (∫ x : Space, star (F i x)*F j x) = @ite ℂ (i = j) (Classical.propDecidable _) 1 0 := by + have ho : Orthonormal ℂ (fun i : positivePacketIndex g μ => packetBasis g μ i.val) := + (packetBasis g μ).orthonormal.comp (fun i : positivePacketIndex g μ => i.val) Subtype.val_injective + exact orthonormal_representative_inner (fun i : positivePacketIndex g μ => packetBasis g μ i.val) ho F he + +def coreScreenedField {M m : ℕ} (S : Nuclei M) (u : H1Vector m) (x : Space) : ℝ := + attraction S x - coreCoulombPotential u x + +theorem bounded_packet_core_trial {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hi : Integrable ρ) + (ht : Integrable (fun y => ρ y^(5/3:ℝ))) (C : ℝ) (hC : ∀ y, ρ y ≤ C) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) + (hs : ∀ y, y ∉ K → ρ y = 0) (hsu : SpatiallySupported u A) + (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) + (ε : ℝ) (hε : 0 < ε) : + ∃ n : ℕ, ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ + form S ψ ≤ form S u + + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2) - + (∫ x, coreScreenedField S u x*packetDensity g ρ x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)* + (packetDensity g ρ xy.1*packetDensity g ρ xy.2)) + ε := by + let μ := volume.restrict (phaseRegion (fermiRadius ρ)) + let : IsFiniteMeasure (volume.restrict (phaseRegion (fermiRadius ρ))) := fermiMeasure_finite ρ hp hm hi + let : Countable (packetIndex (complexWindow g) (volume.restrict (phaseRegion (fermiRadius ρ)))) := packetIndexCountable _ _ + let : Countable (positivePacketIndex (complexWindow g) (volume.restrict (phaseRegion (fermiRadius ρ)))) := inferInstance + obtain ⟨F,hFs,hFc,he,hSup⟩ := packetPositiveIndex_smooth (complexWindow g) + (complexWindow_compactSupport g hgc) (phaseRegion (fermiRadius ρ)) + (phaseRegion_measurable (fermiRadius_measurable ρ hm)) K hK + ((3/(8*Real.pi)*C)^(1/3:ℝ)) (fermiPhase_center_mem ρ K hs) + (fermiPhase_momentum_bound ρ hp C hC) + have hsup : ∀ i x, x ∉ K+tsupport (g : Space → ℝ) → F i x = 0 := by + simpa only [complexWindow_tsupport] using hSup + have ho : ∀ i j, (∫ x : Space, star (F i x)*F j x) = @ite ℂ (i = j) (Classical.propDecidable _) 1 0 := by + exact packetPositive_orthonormal (complexWindow g) μ F he + have hg' : (∫ x : Space, ‖complexWindow g x‖^2) = 1 := by + simpa only [complexWindow_apply,Complex.norm_real,Real.norm_eq_abs,sq_abs] using hg + have hdens := packetPositive_density (complexWindow g) μ F he + have hde : (fun x => ∑' i : positivePacketIndex (complexWindow g) μ × Fin 2, + i.1.val.1.re*∑ s, ‖spinOrbital F i x s‖^2) =ᵐ[volume] packetDensity g ρ := by + filter_upwards [hdens,fermiPacket_density g ρ hp hm hi] with x hx hy + exact hx.tsum_eq.trans hy + have hkin := fermiPacket_positive_kinetic g hg ρ hp hm hi ht F hFs hFc he + have hnuc := packetDensity_nuclear_integrable S g ρ hp hm hi + have hcor := coreCoulombPotential_mul_integrable u _ (packetDensity_integrable g ρ hp hm hi) + have hfield : (∫ x, coreScreenedField S u x*packetDensity g ρ x) = + (∫ x, attraction S x*packetDensity g ρ x) - + (∫ x, coreCoulombPotential u x*packetDensity g ρ x) := by + simp only [coreScreenedField,sub_mul] + exact integral_sub hnuc hcor + obtain ⟨n,ψ,hψa,hψm,hψe⟩ := infinite_fermi_core_trial S u hu hmu A + (K+tsupport (g : Space → ℝ)) hA (hK.add hgc).isClosed hsep hsu + (spinOrbital F) (spinOrbital_contDiff F hFs) (spinOrbital_compactSupport F hFc) + (spinOrbital_support F _ hsup) (fun i j => by + by_cases hij : i = j + · simpa only [ite_eq_left hij] using spinOrbital_orthonormal F ho i j + · simpa only [ite_eq_right hij] using spinOrbital_orthonormal F ho i j) + (fun i => i.1.val.1.re) (fun i => i.1.property.le) + (fun i => packetBasis_eigen_le_one (complexWindow g) hg' μ (phaseMeasure_le _) i.1.val) + (packetDensity g ρ) (packetDensity_integrable g ρ hp hm hi) + (hdens.mono (fun _ hx => hx.summable)) hde hnuc + (packetDensity_pair_integrable g ρ hp hm hi) hkin.summable ε hε + refine ⟨n,ψ,hψa,hψm,?_⟩ + dsimp only [phaseMeasure] at hkin + change HasSum (fun i : positivePacketIndex (complexWindow g) (volume.restrict (phaseRegion (fermiRadius ρ))) × Fin 2 => + i.1.val.1.re*∑ s, ∑ b : Fin 3, ∫ x : Space, + ‖fderiv ℝ (fun y => spinOrbital F i y s) x (EuclideanSpace.single b 1)‖^2) _ at hkin + rw [hkin.tsum_eq] at hψe + rw [hfield] + linarith +end Coulomb + +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/CountMoments.lean b/lean/OAI/Analysis/CoulombRadii/Screening/CountMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a28350a21ae504144b67cd4f2407cd719d21c9c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/CountMoments.lean @@ -0,0 +1,166 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.ConfigSupported +import OAI.Analysis.CoulombRadii.Localization.RadialCut + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def localCount {n : ℕ} (A : Set Space) (x : Configuration n) : ℝ := + ∑ i : Fin n, A.indicator (fun _ => (1:ℝ)) (position x i) + +lemma localCount_nonneg {n : ℕ} (A : Set Space) (x : Configuration n) : 0 ≤ localCount A x := by + exact Finset.sum_nonneg (fun i _ => Set.indicator_nonneg (fun _ _ => zero_le_one) _) +lemma localCount_le {n : ℕ} (A : Set Space) (x : Configuration n) : localCount A x ≤ n := by + calc + _ ≤ ∑ _i : Fin n, (1:ℝ) := Finset.sum_le_sum (fun i _ => by + by_cases h : position x i ∈ A <;> simp [h]) + _ = _ := by simp +lemma localCount_measurable {n : ℕ} {A : Set Space} (hA : MeasurableSet A) : + Measurable (localCount (n:=n) A) := by + exact Finset.measurable_fun_sum _ (fun i _ => (measurable_const.indicator hA).comp (continuous_position i).measurable) + +lemma localCount_weight_integrable {n : ℕ} (ψ : H1Vector n) {A : Set Space} + (hA : MeasurableSet A) (s : Spins n) (q : ℕ) : + Integrable (fun x => (localCount A x)^q*‖ψ.value s x‖^2) := by + have hw := (ψ.value_L2 s).integrable_norm_pow (p:=2) (by norm_num) + apply (hw.const_mul ((n:ℝ)^q)).mono' + (((localCount_measurable hA).pow_const q).aestronglyMeasurable.mul hw.aestronglyMeasurable) + filter_upwards [] with x + change ‖(localCount A x)^q*‖ψ.value s x‖^2‖ ≤ (n:ℝ)^q*‖ψ.value s x‖^2 + rw [Real.norm_of_nonneg (mul_nonneg (pow_nonneg (localCount_nonneg A x) _) (sq_nonneg _))] + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (localCount_nonneg A x) (localCount_le A x) q) (sq_nonneg _) + +def localCountSecondMoment {n : ℕ} (ψ : H1Vector n) (A : Set Space) : ℝ := + ∑ s : Spins n, ∫ x, (localCount A x)^2*‖ψ.value s x‖^2 + +lemma localCountSecondMoment_nonneg {n : ℕ} (ψ : H1Vector n) (A : Set Space) : + 0 ≤ localCountSecondMoment ψ A := + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => mul_nonneg (sq_nonneg _) (sq_nonneg _))) + +lemma localCountSecondMoment_le {n : ℕ} (ψ : H1Vector n) (A : Set Space) : + localCountSecondMoment ψ A ≤ (n:ℝ)^2*mass ψ := by + unfold localCountSecondMoment mass + rw [Finset.mul_sum] + apply Finset.sum_le_sum + intro s hs + rw [← integral_const_mul] + apply integral_mono_of_nonneg + · filter_upwards [] with x + positivity + · exact ((ψ.value_L2 s).integrable_norm_pow (p:=2) (by norm_num)).const_mul _ + · filter_upwards [] with x + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (localCount_nonneg A x) (localCount_le A x) 2) (sq_nonneg _) + +lemma expectedPopulation_eq {n : ℕ} (ψ : H1Vector n) {A : Set Space} (hA : MeasurableSet A) : + expectedPopulation ψ A = ∑ s : Spins n, ∫ x, localCount A x*‖ψ.value s x‖^2 := by + apply Finset.sum_congr rfl + intro s hs + simp only [localCount,Finset.sum_mul] + exact (integral_finsetSum _ (fun i _ => population_integrable ψ A hA s i)).symm + +lemma expectedPopulation_sq_le {n : ℕ} (ψ : H1Vector n) {A : Set Space} + (hA : MeasurableSet A) (hmass : mass ψ=1) : + (expectedPopulation ψ A)^2 ≤ localCountSecondMoment ψ A := by + let c := expectedPopulation ψ A + have hn : 0 ≤ ∑ s : Spins n, ∫ x, (localCount A x-c)^2*‖ψ.value s x‖^2 := + Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => mul_nonneg (sq_nonneg _) (sq_nonneg _))) + have hi (s : Spins n) : + (∫ x, (localCount A x-c)^2*‖ψ.value s x‖^2) = + (∫ x, (localCount A x)^2*‖ψ.value s x‖^2)-2*c*(∫ x, localCount A x*‖ψ.value s x‖^2)+ + c^2*(∫ x, ‖ψ.value s x‖^2) := by + have h1 : Integrable (fun x => localCount A x*‖ψ.value s x‖^2) := by + simpa using localCount_weight_integrable ψ hA s 1 + have h2 := localCount_weight_integrable ψ hA s 2 + have h0 := (ψ.value_L2 s).integrable_norm_pow (p:=2) (by norm_num) + have hsub : Integrable (fun x => (localCount A x)^2*‖ψ.value s x‖^2-(2*c)*(localCount A x*‖ψ.value s x‖^2)) := by + exact h2.sub (h1.const_mul (2*c)) + calc + _ = ∫ x, ((localCount A x)^2*‖ψ.value s x‖^2-(2*c)*(localCount A x*‖ψ.value s x‖^2))+c^2*‖ψ.value s x‖^2 := + integral_congr_ae (Eventually.of_forall (fun x => by ring)) + _ = _ := by + rw [integral_add hsub (h0.const_mul _),integral_sub h2 (h1.const_mul _), + integral_const_mul,integral_const_mul] + simp only [hi,Finset.sum_add_distrib,Finset.sum_sub_distrib,← Finset.mul_sum] at hn + rw [← expectedPopulation_eq ψ hA] at hn + change 0 ≤ localCountSecondMoment ψ A-2*c*expectedPopulation ψ A+c^2*mass ψ at hn + rw [hmass] at hn + dsimp [c] at hn + nlinarith + +def outLabelCount {n : ℕ} (p : Fin n → Fin 2) : ℝ := + ∑ i : Fin n, if p i=0 then 1 else 0 + +lemma outLabelCount_nonneg {n : ℕ} (p : Fin n → Fin 2) : 0 ≤ outLabelCount p := + Finset.sum_nonneg (fun _ _ => by split_ifs <;> norm_num) + +lemma tensorCut_zero_of_outCount_lt {n : ℕ} (χ : Fin 2 → Space → ℝ) + (p : Fin n → Fin 2) (A : Set Space) (hA : ∀ z ∉ A, χ 0 z=0) + (x : Configuration n) (hx : localCount A x < outLabelCount p) : tensorCut χ p x=0 := by + by_contra h + have H (i : Fin n) : (if p i=0 then (1:ℝ) else 0) ≤ A.indicator (fun _ => (1:ℝ)) (position x i) := by + by_cases hp : p i=0 + · have hmem : position x i ∈ A := by + by_contra hi + have hc : χ (p i) (position x i)=0 := by rw [hp,hA _ hi] + exact h (Finset.prod_eq_zero (Finset.mem_univ i) hc) + simp [hp,hmem] + · simpa [hp] using Set.indicator_nonneg (fun _ _ => zero_le_one) (position x i) + exact (not_lt_of_ge (Finset.sum_le_sum (fun i _ => H i))) hx + +lemma tensorCut_outCount_square_le {n : ℕ} (χ : Fin 2 → Space → ℝ) + (hp : ∀ z, ∑ l, χ l z^2=1) (A : Set Space) (hA : ∀ z ∉ A, χ 0 z=0) (x : Configuration n) : + (∑ p : Fin n → Fin 2, (outLabelCount p)^2*(tensorCut χ p x)^2) ≤ (localCount A x)^2 := by + calc + _ ≤ ∑ p : Fin n → Fin 2, (localCount A x)^2*(tensorCut χ p x)^2 := by + apply Finset.sum_le_sum + intro p hp' + by_cases h : outLabelCount p ≤ localCount A x + · exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (outLabelCount_nonneg p) h 2) (sq_nonneg _) + · rw [tensorCut_zero_of_outCount_lt χ p A hA x (lt_of_not_ge h)] + simp + _ = _ := by rw [← Finset.mul_sum,tensorCut_partition χ hp,mul_one] + +theorem labelCut_outCount_secondMoment_le {n : ℕ} (ψ : H1Vector n) + (χ : Fin 2 → Space → ℝ) (hχ : ∀ l, ContDiff ℝ (⊤ : ℕ∞) (χ l)) + (hp : ∀ z, ∑ l, χ l z^2=1) (D : ℝ) (hD : 0 ≤ D) + (hd : ∀ l b z, |fderiv ℝ (χ l) z (EuclideanSpace.single b 1)| ≤ D) + (A : Set Space) (hA : MeasurableSet A) (hsupp : ∀ z ∉ A, χ 0 z=0) : + (∑ p : Fin n → Fin 2, (outLabelCount p)^2*mass (ψ.labelCut χ hχ hp D hD hd p)) ≤ + localCountSecondMoment ψ A := by + have hint (s : Spins n) (p : Fin n → Fin 2) : + Integrable (fun x => (outLabelCount p)^2*((tensorCut χ p x)^2*‖ψ.value s x‖^2)) := by + have hcut := ((ψ.labelCut χ hχ hp D hD hd p).value_L2 s).integrable_norm_pow (p:=2) (by norm_num) + apply (hcut.const_mul ((outLabelCount p)^2)).congr + filter_upwards [] with x + simp only [H1Vector.labelCut,H1Vector.smoothMul,norm_mul,Complex.norm_real,Real.norm_eq_abs,mul_pow,sq_abs] + unfold mass localCountSecondMoment + simp only [Finset.mul_sum] + rw [Finset.sum_comm] + apply Finset.sum_le_sum + intro s hs + simp only [← integral_const_mul] + have he (p : Fin n → Fin 2) : + (fun x => (outLabelCount p)^2*‖(ψ.labelCut χ hχ hp D hD hd p).value s x‖^2) = + (fun x => (outLabelCount p)^2*((tensorCut χ p x)^2*‖ψ.value s x‖^2)) := by + funext x + simp only [H1Vector.labelCut,H1Vector.smoothMul,norm_mul,Complex.norm_real,Real.norm_eq_abs,mul_pow,sq_abs] + simp_rw [he] + rw [← integral_finsetSum _ (fun p _ => hint s p)] + apply integral_mono (integrable_finsetSum _ (fun p _ => hint s p)) (localCount_weight_integrable ψ hA s 2) + intro x + simp only [← mul_assoc,← Finset.sum_mul] + exact mul_le_mul_of_nonneg_right (tensorCut_outCount_square_le χ hp A hsupp x) (sq_nonneg _) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/CountScalar.lean b/lean/OAI/Analysis/CoulombRadii/Screening/CountScalar.lean new file mode 100644 index 0000000000000000000000000000000000000000..866c9bc79b0c5020baa4431c97d1422946890363 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/CountScalar.lean @@ -0,0 +1,242 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.SharpThinScreening + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +namespace Coulomb + +lemma screenMass_inv_cube_le (δ : ℝ) (a : ℝ) : (a^3)⁻¹ ≤ screenMass δ a := + (le_max_left _ _).trans (screenMass_ge_base δ a) + +lemma screenMass_square_ge (δ a : ℝ) : screenMass δ a ≤ (screenMass δ a)^2 := by + nlinarith [screenMass_ge_one δ a] + +lemma screenMass_pairscale (δ : ℝ) {a : ℝ} (ha : 0 < a) : screenMass δ a/a ≤ (screenMass δ a)^2 := by + apply (div_le_iff₀ ha).mpr + have H := mul_le_mul_of_nonneg_left (screenMass_scale δ ha) (screenMass_pos δ a).le + nlinarith + +lemma screenMass_kinetic_scale (δ : ℝ) {a : ℝ} (ha : 0 < a) : + (screenMass δ a)^(4/3:ℝ)/a ≤ (screenMass δ a)^2 := by + let m := screenMass δ a + have hm : 0 < m := screenMass_pos δ a + have h13 : 1 ≤ a*m^(1/3:ℝ) := (screenBaseMass_cuberoot_scale ha).trans + (mul_le_mul_of_nonneg_left (Real.rpow_le_rpow (screenBaseMass_nonneg a) (screenMass_ge_base δ a) (by norm_num)) ha.le) + have h23 : 1 ≤ a*m^(2/3:ℝ) := h13.trans (mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_exponent_le (screenMass_ge_one δ a) (by norm_num : (1/3:ℝ) ≤ 2/3)) ha.le) + have H := mul_le_mul_of_nonneg_left h23 (Real.rpow_nonneg hm.le (4/3:ℝ)) + have he : m^(4/3:ℝ)*(a*m^(2/3:ℝ))=m^2*a := by + calc + _ = a*(m^(4/3:ℝ)*m^(2/3:ℝ)) := by ring + _ = _ := by rw [←Real.rpow_add hm]; norm_num; ring + rw [mul_one,he] at H + exact (div_le_iff₀ ha).mpr H + +lemma sqrt_cap_expression {C P m a : ℝ} (hC : 0 ≤ C) (hP : 0 ≤ P) (hm : 0 ≤ m) (ha : 0 < a) : + Real.sqrt (C*P*m^2/a^2)=Real.sqrt C*Real.sqrt P*m/a := by + rw [Real.sqrt_div (mul_nonneg (mul_nonneg hC hP) (sq_nonneg _)), + Real.sqrt_mul (mul_nonneg hC hP),Real.sqrt_mul hC,Real.sqrt_sq hm,Real.sqrt_sq ha.le] + +lemma sqrt_deleted_expression {C D P m a β : ℝ} (hC : 0 ≤ C) (hD : 0 ≤ D) + (hP : 0 ≤ P) (hm : 0 ≤ m) (ha : 0 < a) (hβ : 0 ≤ β) : + Real.sqrt ((C*P*m^2/a^2)*(18*D*(β*a/a)*P*m^2))= + Real.sqrt (18*C*D)*Real.sqrt β*P*m^2/a := by + have he : (C*P*m^2/a^2)*(18*D*(β*a/a)*P*m^2)=(18*C*D)*β*(P*m^2/a)^2 := by field_simp + rw [he,Real.sqrt_mul (mul_nonneg (by positivity) hβ),Real.sqrt_mul (by positivity), + Real.sqrt_sq (div_nonneg (mul_nonneg hP (pow_nonneg hm 2)) ha.le)] + ring + +lemma sqrt_out_expression {C P m : ℝ} (hC : 0 ≤ C) (hP : 0 ≤ P) (hm : 0 ≤ m) : + Real.sqrt (C*P*m^2)=Real.sqrt C*Real.sqrt P*m := by + rw [Real.sqrt_mul (mul_nonneg hC hP),Real.sqrt_mul hC,Real.sqrt_sq hm] + +lemma fine_count_expression {C P m : ℝ} (hC : 0 ≤ C) (hP : 0 ≤ P) (hm : 0 ≤ m) : + (C*P*m^2)^(2/3:ℝ)=C^(2/3:ℝ)*P^(2/3:ℝ)*m^(4/3:ℝ) := by + rw [Real.mul_rpow (mul_nonneg hC hP) (sq_nonneg _),Real.mul_rpow hC hP,←Real.rpow_natCast,←Real.rpow_mul hm] + norm_num + +def countBootstrapA : ℝ := 2*tfInteriorCountConstant^2+6*max countTestEnergy 0 + def countBootstrapB : ℝ := 6*max countTestEnergy 0*Real.sqrt (18*atomicPhysicalCapConstant*atomicPatchCountFactor) + def countBootstrapC : ℝ := 6*max countTestEnergy 0*(thinReserveFactor+12*unitWindowKinetic*Real.sqrt atomicPhysicalCapConstant) + def countBootstrapD : ℝ := 3*max countTestEnergy 0*(2*Real.pi+1)*Real.sqrt atomicPatchCountFactor + def countBootstrapE : ℝ := 6*max countTestEnergy 0*((Real.pi^2/2)*neumannBoundary)*atomicPatchCountFactor^(2/3:ℝ) + +def countBootstrapMajorant (β P : ℝ) : ℝ := countBootstrapA+countBootstrapB*Real.sqrt β*P+ + (countBootstrapC/β^2+countBootstrapD/β)*Real.sqrt P+countBootstrapE/β^2*P^(2/3:ℝ) + +lemma countBootstrap_coefficients_nonneg : 0 ≤ countBootstrapA ∧ 0 ≤ countBootstrapB ∧ + 0 ≤ countBootstrapC ∧ 0 ≤ countBootstrapD ∧ 0 ≤ countBootstrapE := by + have hM : 0 ≤ max countTestEnergy 0 := le_max_right _ _ + have hK := unitWindowKinetic_nonneg + have hR := thinReserveFactor_nonneg + have hN := neumannBoundary_nonneg + have hD := atomicPatchCountFactor_nonneg + unfold countBootstrapA countBootstrapB countBootstrapC countBootstrapD countBootstrapE + exact ⟨by positivity,by positivity,by positivity,by positivity [Real.pi_pos],by positivity⟩ + +lemma atomicComparisonExpression_le_majorant {δ P a β : ℝ} (hδ : 0 ≤ δ) (hP : 0 ≤ P) + (ha : 0 < a) (hβ : 0 < β) : + atomicComparisonExpression δ P a (β*a) ≤ countBootstrapMajorant β P*(screenMass δ a)^2 := by + let m := screenMass δ a + let M := max countTestEnergy 0 + let C := atomicPhysicalCapConstant + let D := atomicPatchCountFactor + have hm : 0 < m := screenMass_pos δ a + have hM : 0 ≤ M := le_max_right _ _ + have hC : 0 ≤ C := atomicPhysicalCapConstant_nonneg + have hD : 0 ≤ D := atomicPatchCountFactor_nonneg + have hK : 0 ≤ unitWindowKinetic := unitWindowKinetic_nonneg + have hN : 0 ≤ neumannBoundary := neumannBoundary_nonneg + have hR : 0 ≤ thinReserveFactor := thinReserveFactor_nonneg + have h1 : 2*(tfInteriorCountConstant/a^3)^2 ≤ 2*tfInteriorCountConstant^2*m^2 := by + have H := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (by positivity : 0 ≤ (a^3)⁻¹) + (screenMass_inv_cube_le δ a) 2) (show 0 ≤ 2*tfInteriorCountConstant^2 by positivity) + simpa only [m, div_pow, div_eq_mul_inv, inv_pow, mul_pow, mul_assoc] using H + have h2 : 6*a*M*δ ≤ 6*M*m^2 := by + have H := (le_div_iff₀ ha).mp (screenEnergy_ge_offset hδ ha) + change δ*a ≤ m^2 at H + nlinarith [mul_le_mul_of_nonneg_left H (show 0 ≤ 6*M by positivity)] + have h3 := mul_le_mul_of_nonneg_left (screenMass_pairscale δ ha) + (show 0 ≤ 6*M*thinReserveFactor/β^2*Real.sqrt P by positivity) + have h4 := mul_le_mul_of_nonneg_left (screenMass_pairscale δ ha) + (show 0 ≤ 72*M*unitWindowKinetic*Real.sqrt C/β^2*Real.sqrt P by positivity) + have h5 := mul_le_mul_of_nonneg_left (screenMass_kinetic_scale δ ha) + (show 0 ≤ 6*M*((Real.pi^2/2)*neumannBoundary)*D^(2/3:ℝ)/β^2*P^(2/3:ℝ) by positivity) + have h6 := mul_le_mul_of_nonneg_left (screenMass_square_ge δ a) + (show 0 ≤ 3*M*(2*Real.pi+1)*Real.sqrt D/β*Real.sqrt P by positivity [Real.pi_pos]) + have he : atomicComparisonExpression δ P a (β*a)= + 2*(tfInteriorCountConstant/a^3)^2+6*a*M*δ+ + (6*M*thinReserveFactor/β^2*Real.sqrt P)*(m/a)+ + (72*M*unitWindowKinetic*Real.sqrt C/β^2*Real.sqrt P)*(m/a)+ + (6*M*Real.sqrt (18*C*D)*Real.sqrt β*P)*m^2+ + (6*M*((Real.pi^2/2)*neumannBoundary)*D^(2/3:ℝ)/β^2*P^(2/3:ℝ))*(m^(4/3:ℝ)/a)+ + (3*M*(2*Real.pi+1)*Real.sqrt D/β*Real.sqrt P)*m := by + unfold atomicComparisonExpression + rw [sqrt_cap_expression hC hP hm.le ha,sqrt_deleted_expression hC hD hP hm.le ha hβ.le, + sqrt_out_expression hD hP hm.le,fine_count_expression hD hP hm.le] + dsimp only [M,C,D,m] + field_simp + ring + rw [he] + have HH := add_le_add (add_le_add (add_le_add (add_le_add (add_le_add (add_le_add h1 h2) h3) h4) (le_refl ((6*M*Real.sqrt (18*C*D)*Real.sqrt β*P)*m^2))) h5) h6 + apply HH.trans_eq + unfold countBootstrapMajorant countBootstrapA countBootstrapB countBootstrapC countBootstrapD countBootstrapE + dsimp only [M,C,D,m] + ring + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +lemma countBootstrap_small_parameter : ∃ β : ℝ, 0 < β ∧ 18*β ≤ 1 ∧ countBootstrapB*Real.sqrt β < 1/4 := by + have hB := countBootstrap_coefficients_nonneg.2.1 + let u : ℝ := 1/(100*(countBootstrapB+1)) + have hu : 0 < u := by dsimp [u]; positivity + have hu1 : u ≤ 1/100 := by + dsimp [u] + apply (div_le_div_iff₀ (by positivity) (by norm_num)).mpr + nlinarith + refine ⟨u^2,by positivity,by nlinarith,?_⟩ + rw [Real.sqrt_sq hu.le] + have H : countBootstrapB*u < 1/100 := by + dsimp [u] + rw [←mul_div_assoc,mul_one] + apply (div_lt_iff₀ (by positivity)).mpr + nlinarith + linarith + +lemma countBootstrap_ratio_limit (β : ℝ) : + Tendsto (fun P : ℝ => countBootstrapA*P^(-(1:ℝ))+countBootstrapB*Real.sqrt β+ + (countBootstrapC/β^2+countBootstrapD/β)*P^(-(1/2:ℝ))+ + countBootstrapE/β^2*P^(-(1/3:ℝ))) atTop (𝓝 (countBootstrapB*Real.sqrt β)) := by + have h1 := (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ)<1)).const_mul countBootstrapA + have h2 := (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ)<1/2)).const_mul (countBootstrapC/β^2+countBootstrapD/β) + have h3 := (tendsto_rpow_neg_atTop (by norm_num : (0:ℝ)<1/3)).const_mul (countBootstrapE/β^2) + simpa only [mul_zero,zero_add,add_zero] using ((h1.add tendsto_const_nhds).add h2).add h3 + +lemma countBootstrap_ratio_identity {β P : ℝ} (hP : 0 < P) : + countBootstrapMajorant β P= + (countBootstrapA*P^(-(1:ℝ))+countBootstrapB*Real.sqrt β+ + (countBootstrapC/β^2+countBootstrapD/β)*P^(-(1/2:ℝ))+ + countBootstrapE/β^2*P^(-(1/3:ℝ)))*P := by + have h (r : ℝ) : P^r*P=P^(r+1) := by + nth_rw 2 [←Real.rpow_one P] + rw [←Real.rpow_add hP] + have h1 := h (-(1:ℝ)) + have h2 := h (-(1/2:ℝ)) + have h3 := h (-(1/3:ℝ)) + norm_num at h1 h2 h3 + calc + _ = countBootstrapA*(P^(-(1:ℝ))*P)+countBootstrapB*Real.sqrt β*P+ + (countBootstrapC/β^2+countBootstrapD/β)*(P^(-(1/2:ℝ))*P)+ + countBootstrapE/β^2*(P^(-(1/3:ℝ))*P) := by + rw [h1,h2,h3] + simp only [countBootstrapMajorant,Real.sqrt_eq_rpow,mul_one] + _ = _ := by ring + +theorem countBootstrap_threshold : ∃ β P₀ : ℝ, 0 < β ∧ 18*β ≤ 1 ∧ 2 ≤ P₀ ∧ + ∀ P ≥ P₀, 1 ≤ β^2*Real.sqrt P ∧ countBootstrapMajorant β P ≤ P/2 := by + obtain ⟨β,hβ,hβsmall,hβB⟩ := countBootstrap_small_parameter + obtain ⟨q,hq⟩ := eventually_atTop.mp ((countBootstrap_ratio_limit β).eventually_lt_const + (show countBootstrapB*Real.sqrt β < 1/2 by linarith)) + let P₀ := max 2 (max q ((β^2)⁻¹^2)) + refine ⟨β,P₀,hβ,hβsmall,le_max_left _ _,?_⟩ + intro P hP + have hP2 : 2 ≤ P := (le_max_left _ _).trans hP + have hP0 : 0 < P := by linarith + have hPq : q ≤ P := (le_max_left _ _).trans ((le_max_right _ _).trans hP) + have hPt : (β^2)⁻¹^2 ≤ P := (le_max_right _ _).trans ((le_max_right _ _).trans hP) + constructor + · have H := Real.sqrt_le_sqrt hPt + rw [Real.sqrt_sq (by positivity)] at H + have H' := mul_le_mul_of_nonneg_left H (sq_nonneg β) + simpa only [mul_inv_cancel₀ (ne_of_gt (sq_pos_of_pos hβ))] using H' + · rw [countBootstrap_ratio_identity hP0] + have H := mul_le_mul_of_nonneg_right (hq P hPq).le hP0.le + simpa only [one_div,mul_comm (2:ℝ)⁻¹ P,←div_eq_mul_inv] using H + +theorem atomic_screenCountParameter_uniform : ∃ P₀ : ℝ, 2 ≤ P₀ ∧ + ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E δ : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E+δ → 0 ≤ δ → + screenCountParameter ψ δ ≤ P₀ := by + obtain ⟨β,P₀,hβ,hβsmall,hP₀,hthreshold⟩ := countBootstrap_threshold + refine ⟨P₀,hP₀,?_⟩ + intro J n S hatom ψ hψ hm E δ hE hstate hδ + by_contra hbound + have hPbig : P₀ < screenCountParameter ψ δ := lt_of_not_ge hbound + let P := screenCountParameter ψ δ + have hP2 : 2 ≤ P := hP₀.trans hPbig.le + have hP := screenCountParameter_ge_one ψ δ + obtain ⟨hcondP,himp⟩ := hthreshold P hPbig.le + have hbetter : screenCountParameter ψ δ ≤ P/2 := by + apply screenCountParameter_le_of ψ δ (by dsimp [P] at *; linarith) + intro y hy + let a := atomicCellScale y + have ha : 0 < a := atomicCellScale_pos hy + have hb : 0 < β*a := mul_pos hβ ha + have hs : 18*(β*a) ≤ a := by nlinarith [mul_le_mul_of_nonneg_right hβsmall ha.le] + have hcond : a ≤ (β*a)^2*Real.sqrt P*screenMass δ a := by + have H := mul_le_mul hcondP (screenMass_scale δ ha) (by norm_num : (0:ℝ)≤1) + (mul_nonneg (sq_nonneg β) (Real.sqrt_nonneg P)) + have H' := mul_le_mul_of_nonneg_left H ha.le + nlinarith + have H := atomic_physical_count_comparison S hatom ψ hψ hm hE hstate hδ hy hb hs hcond + exact H.trans ((atomicComparisonExpression_le_majorant hδ (by linarith) ha hβ).trans + (mul_le_mul_of_nonneg_right himp (sq_nonneg _))) + dsimp [P] at hbetter hP2 + linarith + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/CountUnits.lean b/lean/OAI/Analysis/CoulombRadii/Screening/CountUnits.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f2eb8a8073e33b0d13edfe809ddf56aba53762d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/CountUnits.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CountMoments +import OAI.Analysis.CoulombRadii.Packets.AtomicMesh +import OAI.Analysis.CoulombRadii.Screening.ScreenUnits + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma localCount_cover {n : ℕ} {C : Type*} [Fintype C] {B : Set Space} (A : C → Set Space) + (hc : B ⊆ ⋃ c, A c) (x : Configuration n) : localCount B x ≤ ∑ c, localCount (A c) x := by + unfold localCount + rw [Finset.sum_comm] + apply Finset.sum_le_sum + intro i hi + by_cases hx : position x i∈B + · obtain ⟨c,hc⟩ := Set.mem_iUnion.mp (hc hx) + rw [indicator_of_mem hx] + calc + 1=(A c).indicator (fun _ => (1:ℝ)) (position x i) := by rw [indicator_of_mem hc] + _ ≤ _ := Finset.single_le_sum (fun d _ => Set.indicator_nonneg (fun _ _ => zero_le_one) _) (Finset.mem_univ c) + · rw [indicator_of_notMem hx] + exact Finset.sum_nonneg (fun _ _ => Set.indicator_nonneg (fun _ _ => zero_le_one) _) + +lemma expectedPopulation_cover {n : ℕ} (ψ : H1Vector n) {C : Type*} [Fintype C] + {B : Set Space} (hB : MeasurableSet B) (A : C → Set Space) (hA : ∀ c, MeasurableSet (A c)) + (hc : B ⊆ ⋃ c, A c) : expectedPopulation ψ B ≤ ∑ c, expectedPopulation ψ (A c) := by + rw [expectedPopulation_eq ψ hB] + simp_rw [expectedPopulation_eq ψ (hA _)] + rw [Finset.sum_comm] + apply Finset.sum_le_sum + intro s hs + rw [←integral_finsetSum _ (fun c _ => by simpa using localCount_weight_integrable ψ (hA c) s 1)] + apply integral_mono_of_nonneg + · exact Eventually.of_forall (fun _ => mul_nonneg (localCount_nonneg _ _) (sq_nonneg _)) + · exact integrable_finsetSum _ (fun c _ => by simpa using localCount_weight_integrable ψ (hA c) s 1) + · exact Eventually.of_forall (fun x => by + dsimp only + rw [←Finset.sum_mul] + exact mul_le_mul_of_nonneg_right (localCount_cover A hc x) (sq_nonneg _)) + +def screenCountRatio {n : ℕ} (ψ : H1Vector n) (δ : ℝ) (y : Space) : ℝ := + if y=0 then 0 else localCountSecondMoment ψ (Metric.closedBall y (atomicCellScale y))/(screenMass δ (atomicCellScale y))^2 + +def screenCountParameter {n : ℕ} (ψ : H1Vector n) (δ : ℝ) : ℝ := + max 1 (sSup (Set.range (screenCountRatio ψ δ))) + +lemma screenCountRatio_nonneg {n : ℕ} (ψ : H1Vector n) (δ : ℝ) (y : Space) : + 0 ≤ screenCountRatio ψ δ y := by + unfold screenCountRatio + split_ifs + · exact le_rfl + · exact div_nonneg (localCountSecondMoment_nonneg _ _) (sq_nonneg _) + +lemma screenCountRatio_le {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) (δ : ℝ) (y : Space) : + screenCountRatio ψ δ y ≤ (n:ℝ)^2 := by + unfold screenCountRatio + split_ifs + · positivity + · rw [div_le_iff₀ (sq_pos_of_pos (screenMass_pos δ _))] + have H := localCountSecondMoment_le ψ (Metric.closedBall y (atomicCellScale y)) + rw [hm,mul_one] at H + exact H.trans (le_mul_of_one_le_right (sq_nonneg _) (by nlinarith [screenMass_ge_one δ (atomicCellScale y)])) + +lemma screenCountParameter_ge_one {n : ℕ} (ψ : H1Vector n) (δ : ℝ) : + 1 ≤ screenCountParameter ψ δ := le_max_left _ _ + +lemma screenCountParameter_le {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) (δ : ℝ) : + screenCountParameter ψ δ ≤ max 1 ((n:ℝ)^2) := by + unfold screenCountParameter + apply max_le (le_max_left _ _) + exact (csSup_le (Set.range_nonempty _) (fun _ ⟨y,hy⟩ => hy ▸ screenCountRatio_le ψ hm δ y)).trans (le_max_right _ _) + +lemma screenCountParameter_controls {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) (δ : ℝ) + {y : Space} (hy : y≠0) : + localCountSecondMoment ψ (Metric.closedBall y (atomicCellScale y)) ≤ + screenCountParameter ψ δ*(screenMass δ (atomicCellScale y))^2 := by + have hb : BddAbove (Set.range (screenCountRatio ψ δ)) := + ⟨(n:ℝ)^2,fun _ ⟨z,hz⟩ => hz ▸ screenCountRatio_le ψ hm δ z⟩ + have H := (le_csSup hb (Set.mem_range_self y)).trans (le_max_right 1 (sSup (Set.range (screenCountRatio ψ δ)))) + change screenCountRatio ψ δ y ≤ screenCountParameter ψ δ at H + simpa only [screenCountRatio,ite_eq_right hy,div_le_iff₀ (sq_pos_of_pos (screenMass_pos δ _))] using H + +lemma screenCountParameter_le_of {n : ℕ} (ψ : H1Vector n) (δ : ℝ) {P : ℝ} (hP : 1 ≤ P) + (hc : ∀ y : Space, y≠0 → localCountSecondMoment ψ (Metric.closedBall y (atomicCellScale y)) ≤ + P*(screenMass δ (atomicCellScale y))^2) : screenCountParameter ψ δ ≤ P := by + apply max_le hP + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨y,rfl⟩ + unfold screenCountRatio + split_ifs with hy + · linarith + · exact (div_le_iff₀ (sq_pos_of_pos (screenMass_pos δ _))).mpr (hc y hy) + +lemma atomicPatch_population {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) + {δ P : ℝ} (hδ : 0 ≤ δ) (hP : 0 ≤ P) + (hc : ∀ z : Space, z≠0 → localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z)) ≤ + P*(screenMass δ (atomicCellScale z))^2) {y : Space} (hy : y≠0) : + expectedPopulation ψ (Metric.closedBall y (80*atomicCellScale y)) ≤ + (Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)*8*Real.sqrt P*screenMass δ (atomicCellScale y) := by + let A := fun z : {z : Space // z∈atomicPatchMesh} => + Metric.closedBall (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)) + have hcover : Metric.closedBall y (80*atomicCellScale y) ⊆ ⋃ z, A z := by + intro x hx + obtain ⟨z,hz,hzx⟩ := atomicMesh_cover hy x (by simpa only [Metric.mem_closedBall,dist_eq_norm] using hx) + exact Set.mem_iUnion.mpr ⟨⟨z,hz⟩,by simpa only [A,Metric.mem_closedBall,dist_eq_norm] using hzx⟩ + have HB := expectedPopulation_cover ψ measurableSet_closedBall A (fun _ => measurableSet_closedBall) hcover + have HE (z : {z : Space // z∈atomicPatchMesh}) : expectedPopulation ψ (A z) ≤ + 8*Real.sqrt P*screenMass δ (atomicCellScale y) := by + have hz : atomicMeshCenter y z.val≠0 := atomicCellScale_near_nonzero hy + (by nlinarith [atomicMeshCenter_distance y z.val z.property,atomicCellScale_nonneg y]) + have hs := expectedPopulation_sq_le ψ (A:=A z) measurableSet_closedBall hm + have HC := hc (atomicMeshCenter y z.val) hz + have hu := atomicMeshCenter_comparable y z.val z.property + have Hm := screenMass_comparable hδ (atomicCellScale_pos hy) (show (1:ℝ) ≤ 2 by norm_num) hu.1 (by linarith [hu.2]) + norm_num at Hm + have hsq : (expectedPopulation ψ (A z))^2 ≤ (Real.sqrt P*screenMass δ (atomicCellScale (atomicMeshCenter y z.val)))^2 := by + rw [mul_pow,Real.sq_sqrt hP] + exact hs.trans HC + have hp : expectedPopulation ψ (A z) ≤ Real.sqrt P*screenMass δ (atomicCellScale (atomicMeshCenter y z.val)) := + (sq_le_sq₀ (show 0 ≤ expectedPopulation ψ (A z) from Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => mul_nonneg (Set.indicator_nonneg (fun _ _ => zero_le_one) _) (sq_nonneg _))))) (mul_nonneg (Real.sqrt_nonneg _) (screenMass_pos _ _).le)).mp hsq + exact hp.trans (by nlinarith [mul_le_mul_of_nonneg_left Hm (Real.sqrt_nonneg P)]) + calc + _ ≤ ∑ z, expectedPopulation ψ (A z) := HB + _ ≤ ∑ _z : {z : Space // z∈atomicPatchMesh}, 8*Real.sqrt P*screenMass δ (atomicCellScale y) := + Finset.sum_le_sum (fun z _ => HE z) + _ = _ := by simp; ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/CoveredOutCost.lean b/lean/OAI/Analysis/CoulombRadii/Screening/CoveredOutCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..301369394304191f2704b09a8f068d2df282f508 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/CoveredOutCost.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.OutCap +import OAI.Analysis.CoulombRadii.Screening.CountMoments + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma sliceCount_weight_integrable {m k : ℕ} (u : H1Vector (m+k)) + {A : Set Space} (hA : MeasurableSet A) (s : Spins m) (q : ℕ) : + Integrable (fun x => mass (u.coreSlice s x)*(localCount A x)^q) := by + apply ((mass_coreSlice_integrable u s).mul_const ((m:ℝ)^q)).mono' + ((mass_coreSlice_integrable u s).aestronglyMeasurable.mul + ((localCount_measurable hA).pow_const q).aestronglyMeasurable) + filter_upwards [] with x + dsimp only [Pi.mul_apply] + rw [Real.norm_of_nonneg (mul_nonneg (mass_nonneg _) (pow_nonneg (localCount_nonneg _ _) _))] + exact mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (localCount_nonneg _ _) (localCount_le _ _) q) (mass_nonneg _) + +lemma sliceCount_cap_weight_integrable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {A : Set Space} (hA : MeasurableSet A) + (s : Spins m) {a : ℝ} (ha : 0 mass (u.coreSlice s x)*localCount A x*localFarCap S (u.coreSlice s x).normalized x y a) := by + have hc : Integrable (fun x => mass (u.coreSlice s x)*localFarCap S (u.coreSlice s x).normalized x y a) := by + simpa only [pow_one] using localFarCap_weight_integrable S u s ha y hnuc 1 + apply (hc.mul_const (m:ℝ)).mono' + (((mass_coreSlice_integrable u s).aestronglyMeasurable.mul (localCount_measurable hA).aestronglyMeasurable).mul + (localFarCap_normalized_slice_aestronglyMeasurable S u s y a)) + filter_upwards [] with x + dsimp only [Pi.mul_apply] + rw [Real.norm_of_nonneg (mul_nonneg (mul_nonneg (mass_nonneg _) (localCount_nonneg _ _)) (localFarCap_nonneg _ _ _ _ _))] + calc + _ = mass (u.coreSlice s x)*localFarCap S (u.coreSlice s x).normalized x y a*localCount A x := by ring + _ ≤ _ := mul_le_mul_of_nonneg_left (localCount_le _ _) (mul_nonneg (mass_nonneg _) (localFarCap_nonneg _ _ _ _ _)) + +lemma coreScreenedField_sum_le_cover {C : Type*} [Fintype C] {J m k : ℕ} + (S : Nuclei J) (u : H1Vector k) (x : Configuration m) + (y : C → Space) (a : C → ℝ) (ha : ∀ c, 0 if position x i ∈ Metric.closedBall (y d) (a d) then + localFarCap S u x (y d) (a d)+(m:ℝ)/(3*a d) else 0) (fun d _ => by + split_ifs + · exact add_nonneg (localFarCap_nonneg _ _ _ _ _) (div_nonneg (Nat.cast_nonneg _) (mul_nonneg (by norm_num) (ha d).le)) + · exact le_refl _) (Finset.mem_univ c) + calc + _ ≤ ∑ i : Fin m, ∑ c, if position x i ∈ Metric.closedBall (y c) (a c) then + localFarCap S u x (y c) (a c)+(m:ℝ)/(3*a c) else 0 := Finset.sum_le_sum (fun i _ => H i) + _ = _ := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro c hc + simp only [localCount,Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + by_cases h : position x i ∈ Metric.closedBall (y c) (a c) <;> simp only [Set.indicator,h,ite_true,ite_false,one_mul,zero_mul] + +theorem conditionalOutCost_lower_cover {C : Type*} [Fintype C] {J m k : ℕ} + (S : Nuclei J) (u : H1Vector (m+k)) + (y : C → Space) (a : C → ℝ) (ha : ∀ c, 0 localCount (Metric.closedBall (y c) (a c)) x* + (localFarCap S (u.coreSlice s x).normalized x (y c) (a c)+(m:ℝ)/(3*a c)))) ≤ conditionalOutCost S u := by + let F := fun c (s : Spins m) (x : Configuration m) => localCount (Metric.closedBall (y c) (a c)) x* + (localFarCap S (u.coreSlice s x).normalized x (y c) (a c)+(m:ℝ)/(3*a c)) + have hi (c : C) (s : Spins m) : Integrable (fun x => mass (u.coreSlice s x)*F c s x) := by + have hc := sliceCount_cap_weight_integrable S u (show MeasurableSet (Metric.closedBall (y c) (a c)) from measurableSet_closedBall) s (ha c) (y c) (hnuc c) + have hn : Integrable (fun x => mass (u.coreSlice s x)*localCount (Metric.closedBall (y c) (a c)) x) := by + simpa only [pow_one] using sliceCount_weight_integrable u (show MeasurableSet (Metric.closedBall (y c) (a c)) from measurableSet_closedBall) s 1 + exact (hc.add (hn.mul_const ((m:ℝ)/(3*a c)))).congr (Eventually.of_forall (fun x => by dsimp [F]; ring)) + have H (s : Spins m) : + -(∑ c, ∫ x, mass (u.coreSlice s x)*F c s x) ≤ + ∫ x, mass (u.coreSlice s x)*(pairPotential x-∑ i : Fin m, coreScreenedField S (u.coreSlice s x).normalized (position x i)) := by + rw [←integral_finsetSum _ (fun c _ => hi c s),←integral_neg] + apply integral_mono_ae ((integrable_finsetSum _ (fun c _ => hi c s)).neg) + (conditionalOutCost_weight_integrable S u s) + filter_upwards [hsupp s] with x hx + by_cases hm : mass (u.coreSlice s x)=0 + · simp [hm] + · have h := coreScreenedField_sum_le_cover S (u.coreSlice s x).normalized x y a ha hnuc (hx hm) + have hp := pairPotential_nonneg_pointwise x + have h' := mul_le_mul_of_nonneg_left (show -(∑ c, F c s x) ≤ pairPotential x-∑ i : Fin m, coreScreenedField S (u.coreSlice s x).normalized (position x i) by dsimp [F]; linarith) (mass_nonneg (u.coreSlice s x)) + simpa only [Finset.mul_sum,mul_neg,Pi.neg_apply] using h' + have H' := Finset.sum_le_sum (fun s (_ : s ∈ Finset.univ) => H s) + rw [Finset.sum_neg_distrib,Finset.sum_comm] at H' + change -(∑ c, sliceExpectation u (F c)) ≤ sliceExpectation u _ at H' + exact H'.trans (le_add_of_nonneg_left (outerKinetic_nonneg u)) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/DeficitMoment.lean b/lean/OAI/Analysis/CoulombRadii/Screening/DeficitMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c71eeba9aad44abb6e728ed7104d9d87d978178 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/DeficitMoment.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators Classical +noncomputable section +namespace NeutralAtom + +lemma sq_le_discrete_tail_sum (t : ℕ → ℝ) (_ht : ∀ k, 0≤t k) + {x : ℝ} (hx : 0≤x) (N : ℕ) (hxN : x≤t N) : + x^2≤(t 0)^2+∑ k∈Finset.range N, (t (k+1))^2*(if t k simpa using pow_le_pow_left₀ hx hxN 2 + | succ N ih => + rw [Finset.sum_range_succ] + by_cases H : x≤t N + · have hn : 0≤(t (N+1))^2*(if t N positivity + linarith [ih H] + · rw [ite_eq_left (lt_of_not_ge H),mul_one] + have hsum : 0≤∑ k∈Finset.range N, (t (k+1))^2*(if t k positivity + have hpow := pow_le_pow_left₀ hx hxN 2 + nlinarith [sq_nonneg (t 0)] + +theorem secondMoment_le_discrete_tails {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {f : Ω → ℝ} (hf : Measurable f) + (hf0 : ∀ ω, 0≤f ω) (t b : ℕ → ℝ) (ht : ∀ k, 0≤t k) + (N : ℕ) (hbound : ∀ ω, f ω≤t N) + (htail : ∀ k, μ.real {ω | t k (t (k+1))^2*b k)) : + (∫ ω, (f ω)^2 ∂μ)≤(t 0)^2+∑' k, (t (k+1))^2*b k := by + let F : ℕ → Ω → ℝ := fun k => ({ω | t k (1:ℝ)) + have hF : ∀ k, Integrable (F k) μ := fun k => + (integrable_const 1).indicator (measurableSet_lt measurable_const hf) + have hfi : Integrable (fun ω => (f ω)^2) μ := by + apply (integrable_const ((t N)^2)).mono' (hf.pow_const 2).aestronglyMeasurable + filter_upwards [] with ω + rw [Real.norm_eq_abs,abs_of_nonneg (sq_nonneg _)] + exact pow_le_pow_left₀ (hf0 ω) (hbound ω) 2 + have hgi : Integrable (fun ω => (t 0)^2+∑ k∈Finset.range N, (t (k+1))^2*F k ω) μ := + (integrable_const _).add (integrable_finsetSum _ (fun k _ => (hF k).const_mul _)) + have H := integral_mono hfi hgi (fun ω => sq_le_discrete_tail_sum t ht (hf0 ω) N (hbound ω)) + have hInt : (∫ ω, (t 0)^2+∑ k∈Finset.range N, (t (k+1))^2*F k ω ∂μ)= + (t 0)^2+∑ k∈Finset.range N, (t (k+1))^2*μ.real {ω | t k (hF k).const_mul _)), + integral_finsetSum _ (fun k _ => (hF k).const_mul _)] + simp only [integral_const,probReal_univ,smul_eq_mul,one_mul] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [integral_const_mul] + congr 1 + exact integral_indicator_const _ (measurableSet_lt measurable_const hf) |>.trans (by simp) + rw [hInt] at H + apply H.trans + exact add_le_add le_rfl (by + calc + _ ≤ ∑ k∈Finset.range N, (t (k+1))^2*b k := + Finset.sum_le_sum (fun k _ => mul_le_mul_of_nonneg_left (htail k) (sq_nonneg _)) + _ ≤ ∑' k, (t (k+1))^2*b k := + hsum.sum_le_tsum _ (fun k _ => mul_nonneg (sq_nonneg _) ((measureReal_nonneg).trans (htail k))) + ) + +lemma summable_cubic_exponential_tail (C : ℝ) : + Summable (fun k : ℕ => (C*(1+((k+1:ℕ):ℝ))^3)^2*Real.exp (-(k:ℝ))) := by + have hs := Real.summable_pow_mul_exp_neg_nat_mul 6 (r:=1) (by norm_num) + have hshift := (summable_nat_add_iff 2).mpr hs + have hsimple : Summable (fun k : ℕ => ((k:ℝ)+2)^6*Real.exp (-((k:ℝ)+2))) := by + simpa only [Nat.cast_add,Nat.cast_ofNat,neg_mul,one_mul] using hshift + have heq : (fun k : ℕ => (C*(1+((k+1:ℕ):ℝ))^3)^2*Real.exp (-(k:ℝ))) = + (fun k : ℕ => (C^2*Real.exp 2)*(((k:ℝ)+2)^6*Real.exp (-((k:ℝ)+2)))) := by + funext k + have he : Real.exp 2*Real.exp (-((k:ℝ)+2))=Real.exp (-(k:ℝ)) := by + rw [←Real.exp_add] + congr 1 + ring + simp only [Nat.cast_add,Nat.cast_one] + calc + _ = C^2*((k:ℝ)+2)^6*(Real.exp 2*Real.exp (-((k:ℝ)+2))) := by rw [he]; ring + _ = _ := by ring + rw [heq] + exact hsimple.mul_left (C^2*Real.exp 2) + +theorem positive_event_probability_of_second_moment {Ω : Type*} [MeasurableSpace Ω] + (μ : Measure Ω) [IsProbabilityMeasure μ] {f : Ω → ℝ} (hf : Measurable f) + (hf0 : ∀ ω, 0≤f ω) (hfi : Integrable f μ) + (hf2 : Integrable (fun ω => (f ω)^2) μ) {M : ℝ} (hM : 0 M^2)) μ := + (integrable_const _).indicator hA + have H := integral_mono (hfi.const_mul (2*M)) (hf2.add hi) (fun ω => by + change 2*M*f ω≤(f ω)^2+({ω | 0 M^2) ω + by_cases hp : 0 fineKernel_le hb _) + _=_ := by simp + +def patchRetained {n : ℕ} (y : Space) (t b : ℝ) (x : Configuration n) : Finset (Fin n) := + Finset.univ.filter (fun i => ‖position x i-y‖ t-7*b≤‖position x i-y‖) := by + ext i + simp [deletedLabels,patchRetained,not_lt] + rw [he] + simp only [Finset.card_eq_sum_ones,Nat.cast_sum,Finset.sum_filter,localCount,Set.indicator_apply,Set.mem_ofPred_eq] + simp + +lemma fineKernel_countTest_one {a b : ℝ} (ha : 0 hz (fineKernel_eq_zero_of_two_mul_lt hb _ h)) + rw [countTest_one y (by positivity) (le_trans (norm_sub_le_norm_sub_add_norm_sub z w y) (by linarith)),mul_one] + +lemma localCount_le_fine_test {n : ℕ} {a b t : ℝ} (ha : 0 integrable_mul_countTest (fineKernel_shift_integrable hb _) y (3*a/2))] + have hr : localCount (Metric.closedBall y a) x= + ∑ i∈patchRetained y t b x, (Metric.closedBall y a).indicator (fun _ => (1:ℝ)) (position x i) := by + unfold localCount + apply (Finset.sum_subset (Finset.subset_univ _) ?_).symm + intro i hi hn + apply indicator_of_notMem + intro hm + apply hn + apply (patchRetained_mem ..).mpr + have hh : ‖position x i-y‖≤a := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hm + exact hh.trans_lt ht + rw [hr] + apply Finset.sum_le_sum + intro i hi + by_cases hm : position x i∈Metric.closedBall y a + · rw [indicator_of_mem hm,fineKernel_countTest_one ha hb hsmall y (by simpa only [Metric.mem_closedBall,dist_eq_norm] using hm)] + · rw [indicator_of_notMem hm] + exact integral_nonneg (fun z => mul_nonneg (fineKernel_nonneg ..) (countTest_nonneg ..)) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/InnerCap.lean b/lean/OAI/Analysis/CoulombRadii/Screening/InnerCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f799a39f59ab1fd3c5c0917fb6c4800aa2dfac2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/InnerCap.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.InnerFieldRMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +def innerLocalCap {J m k : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Space) (a : ℝ) : ℝ := + Real.sqrt (8*(∫ w, (max (recordedFarField S v x (Metric.ball 0 h) w) 0)^2* + ballCloud z (2*a) 1 w)) +lemma innerLocalCap_nonneg {J m k : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Space) (a : ℝ) : + 0 ≤ innerLocalCap S v x h z a := Real.sqrt_nonneg _ +lemma innerLocalCap_sq {J m k : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Space) {a : ℝ} (ha : 0 mul_nonneg (sq_nonneg _) + (uniformBall_nonneg (by positivity) zero_le_one (w-z)))) +lemma innerLocalCap_le {J m k : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z : Space) {a : ℝ} (ha : 0 by nlinarith [hnuc j]) +lemma innerLocalCap_normalized_slice_aestronglyMeasurable {J m k : ℕ} (S : Nuclei J) + (v : H1Vector (m+k)) (s : Spins m) (h : ℝ) (z : Space) (a : ℝ) : + AEStronglyMeasurable (fun x => innerLocalCap S (v.coreSlice s x).normalized x h z a) volume := by + have hf := recordedFarField_normalized_slice_joint S v s (measurableSet_ball (x:=(0:Space)) (ε:=h)) + have H : AEStronglyMeasurable (fun p : Configuration m × Space => + (max (recordedFarField S (v.coreSlice s p.1).normalized p.1 (Metric.ball 0 h) p.2) 0)^2* + ballCloud z (2*a) 1 p.2) (volume.prod volume) := + ((hf.sup aestronglyMeasurable_const).pow 2).mul + ((ballCloud_measurable (2*a) 1 z).comp measurable_snd).aestronglyMeasurable + exact Real.continuous_sqrt.comp_aestronglyMeasurable (H.integral_prod_right'.const_mul 8) +lemma innerLocalCap_weight_integrable {J m k : ℕ} (S : Nuclei J) (v : H1Vector (m+k)) + (s : Spins m) (h : ℝ) (z : Space) {a : ℝ} (ha : 0 mass (v.coreSlice s x)*(innerLocalCap S (v.coreSlice s x).normalized x h z a)^q) := by + apply (mass_coreSlice_integrable v s).mul_bdd ((innerLocalCap_normalized_slice_aestronglyMeasurable S v s h z a).pow q) + filter_upwards [] with x + change ‖(innerLocalCap S (v.coreSlice s x).normalized x h z a)^q‖ ≤ (Real.sqrt (8*(totalCharge S/(2*a))^2))^q + rw [Real.norm_of_nonneg (pow_nonneg (innerLocalCap_nonneg _ _ _ _ _ _) q)] + exact pow_le_pow_left₀ (innerLocalCap_nonneg _ _ _ _ _ _) (innerLocalCap_le S _ x h z ha hnuc) q + +lemma innerLocalCap_dominates {J m k : ℕ} (S : Nuclei J) (v : H1Vector k) + (x : Configuration m) (h : ℝ) (z w : Space) {a : ℝ} (ha : 0 (innerLocalCap S (v.coreSlice s x).normalized x h z a)^2) = + 8*(∫ w, (sliceExpectation v (fun s x => + (max (recordedFarField S (v.coreSlice s x).normalized x (Metric.ball 0 h) w) 0)^2))*ballCloud z (2*a) 1 w) := by + simp only [innerLocalCap_sq S _ _ h z ha] + rw [sliceExpectation_const_mul,sliceExpectation_farSquare_ballCloud S v measurableSet_ball + (by positivity) z (fun j => by nlinarith [hnuc j])] + +namespace RecordedEnsemble +variable {n J : ℕ} +lemma innerSquare_eq_recorded (T : RecordedEnsemble n) (S : Nuclei J) (h : ℝ) (w : Space) + {r : ℝ} (hr : 0 + (max (recordedFarField S ((T.vector p).coreSlice s x).normalized x (Metric.ball 0 h) w) 0)^2) := by + unfold innerSquare sliceExpectation + apply Finset.sum_congr rfl + intro p hp + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + exact Eventually.of_forall (fun x => coreConditionalObservable_raw_positive_weight (T.vector p) + (attraction S w) measurableSet_ball w hr hsep s x) + +theorem innerLocalCap_second_moment (T : RecordedEnsemble n) (S : Nuclei J) + (h : ℝ) (z : Space) {a r K : ℝ} (ha : 0 + (innerLocalCap S ((T.vector p).coreSlice s x).normalized x h z a)^2)) ≤ 8*K := by + let F := fun p w => sliceExpectation (T.vector p) (fun s x => + (max (recordedFarField S ((T.vector p).coreSlice s x).normalized x (Metric.ball 0 h) w) 0)^2) + have hi p : Integrable (fun w => F p w*ballCloud z (2*a) 1 w) := + sliceFarSquare_ballCloud_integrable S (T.vector p) measurableSet_ball (by positivity) z (fun j => by nlinarith [hnuc j]) + have hb : Integrable (fun w => K*ballCloud z (2*a) 1 w) := (ballCloud_integrable _ _ _).const_mul K + have hsum : (∫ w, ∑ p, F p w*ballCloud z (2*a) 1 w) ≤ K := by + calc + _ ≤ ∫ w, K*ballCloud z (2*a) 1 w := by + apply integral_mono (integrable_finsetSum _ (fun p _ => hi p)) hb + intro w + change (∑ p, F p w*ballCloud z (2*a) 1 w) ≤ K*ballCloud z (2*a) 1 w + rw [←Finset.sum_mul] + by_cases hw : w-z ∈ Metric.ball (0:Space) (2*a) + · have hd : ‖w-z‖≤2*a := (by simpa only [Metric.mem_ball,dist_zero_right] using hw : ‖w-z‖<2*a).le + apply mul_le_mul_of_nonneg_right _ (uniformBall_nonneg (by positivity) zero_le_one (w-z)) + rw [←T.innerSquare_eq_recorded S h w hr (hsep w hd)] + exact hraw w hd + · simp only [ballCloud,uniformBall,indicator_of_notMem hw,mul_zero,le_refl] + _ = K := by rw [integral_const_mul,ballCloud_mass (by positivity) 1 z,mul_one] + calc + _ = ∑ p, 8*(∫ w, F p w*ballCloud z (2*a) 1 w) := by + apply Finset.sum_congr rfl + intro p hp + exact sliceExpectation_innerLocalCap_sq S (T.vector p) h z ha hnuc + _ = 8*(∫ w, ∑ p, F p w*ballCloud z (2*a) 1 w) := by + rw [←Finset.mul_sum,integral_finsetSum _ (fun p _ => hi p)] + _ ≤ _ := mul_le_mul_of_nonneg_left hsum (by norm_num) +end RecordedEnsemble +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/LogTailMoment.lean b/lean/OAI/Analysis/CoulombRadii/Screening/LogTailMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..b853be01a152b1c133a209f4fbcfbe93dbe0fb03 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/LogTailMoment.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +lemma log_probability_fifth {p : ℝ} (hp : 0 < p) (hp1 : p ≤ 1) : + (1-Real.log p)^5 ≤ 251^5*p^(-1/50:ℝ) := by + have hlog : 0 ≤ 1-Real.log p := by linarith [Real.log_nonpos hp.le hp1] + have h := Real.log_le_rpow_div (inv_nonneg.mpr hp.le) (by norm_num : (0:ℝ) < 1/250) + rw [Real.log_inv,Real.inv_rpow hp.le,←Real.rpow_neg hp.le] at h + have hpow : 1 ≤ p^(-1/250:ℝ) := by + exact Real.one_le_rpow_of_pos_of_le_one_of_nonpos hp hp1 (by norm_num) + have hlin : 1-Real.log p ≤ 251*p^(-1/250:ℝ) := by linarith + have H := pow_le_pow_left₀ hlog hlin 5 + apply H.trans_eq + rw [mul_pow] + congr 1 + rw [←Real.rpow_natCast,←Real.rpow_mul hp.le] + norm_num + +lemma probability_of_log_fifth {p b d : ℝ} (hp : 0 < p) (hp1 : p ≤ 1) + (hb : 0 < b) (hd : 0 ≤ d) + (h : b^2 ≤ d*(1-Real.log p)^5) : + p ≤ (251^5*d)^50/b^100 := by + have H := h.trans (mul_le_mul_of_nonneg_left (log_probability_fifth hp hp1) hd) + have hpw : 0 < p^(1/50:ℝ) := Real.rpow_pos_of_pos hp _ + have H' := mul_le_mul_of_nonneg_right H hpw.le + have he : p^(-1/50:ℝ)*p^(1/50:ℝ)=1 := by + rw [←Real.rpow_add hp]; norm_num + have HH : b^2*p^(1/50:ℝ) ≤ 251^5*d := by + calc + _ ≤ d*(251^5*p^(-1/50:ℝ))*p^(1/50:ℝ) := H' + _ = (251^5*d)*(p^(-1/50:ℝ)*p^(1/50:ℝ)) := by ring + _ = _ := by rw [he,mul_one] + have Hpow := pow_le_pow_left₀ (by positivity : 0 ≤ b^2*p^(1/50:ℝ)) HH 50 + have he' : (p^(1/50:ℝ))^50=p := by + rw [←Real.rpow_natCast,←Real.rpow_mul hp.le]; norm_num + rw [mul_pow,he',←pow_mul] at Hpow + norm_num only [Nat.mul_one] at Hpow + apply (le_div_iff₀ (pow_pos hb 100)).mpr + nlinarith only [Hpow] +end NeutralAtom + +namespace NeutralAtom +lemma le_discrete_tail_sum (t : ℕ → ℝ) (ht : ∀ k, 0 ≤ t k) + {x : ℝ} (_ : 0 ≤ x) (N : ℕ) (hxN : x ≤ t N) : + x ≤ t 0+∑ k∈Finset.range N,t (k+1)*(if t k simpa using hxN + | succ N ih => + rw [Finset.sum_range_succ] + by_cases h : x ≤ t N + · have hn : 0 ≤ t (N+1)*(if t N simp only [mul_one,mul_zero]; exact ht _; exact le_rfl + linarith [ih h] + · rw [ite_eq_left (lt_of_not_ge h),mul_one] + have hsum : 0 ≤ ∑ k∈Finset.range N,t (k+1)*(if t k simp only [mul_one,mul_zero]; exact ht _; exact le_rfl + linarith [ht 0] + +lemma firstMoment_le_discrete_tails {Ω : Type*} [MeasurableSpace Ω] + (P : Measure Ω) [IsProbabilityMeasure P] {f : Ω → ℝ} (hf : Measurable f) + (hf0 : ∀ z,0 ≤ f z) (t b : ℕ → ℝ) (ht : ∀ k,0 ≤ t k) + (N : ℕ) (hbound : ∀ z,f z ≤ t N) + (htail : ∀ k,P.real {z | t k t (k+1)*b k)) : + (∫ z,f z ∂P) ≤ t 0+∑' k,t (k+1)*b k := by + let F : ℕ → Ω → ℝ := fun k => ({z | t k (1:ℝ)) + have hF : ∀ k,Integrable (F k) P := fun k => + (integrable_const 1).indicator (measurableSet_lt measurable_const hf) + have hfi : Integrable f P := by + apply Integrable.of_bound hf.aestronglyMeasurable (t N) + exact Eventually.of_forall (fun z => by rw [Real.norm_of_nonneg (hf0 z)]; exact hbound z) + have hgi : Integrable (fun z => t 0+∑ k∈Finset.range N,t (k+1)*F k z) P := + (integrable_const _).add (integrable_finsetSum _ (fun k _ => (hF k).const_mul _)) + have H := integral_mono hfi hgi (fun z => le_discrete_tail_sum t ht (hf0 z) N (hbound z)) + have he : (∫ z,t 0+∑ k∈Finset.range N,t (k+1)*F k z ∂P)= + t 0+∑ k∈Finset.range N,t (k+1)*P.real {z | t k (hF k).const_mul _)), + integral_finsetSum _ (fun k _ => (hF k).const_mul _)] + simp only [integral_const,probReal_univ,smul_eq_mul,one_mul] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [integral_const_mul] + congr 1 + exact integral_indicator_const _ (measurableSet_lt measurable_const hf) |>.trans (by simp) + rw [he] at H + apply H.trans + apply add_le_add le_rfl + calc + _ ≤ ∑ k∈Finset.range N,t (k+1)*b k := + Finset.sum_le_sum (fun k _ => mul_le_mul_of_nonneg_left (htail k) (ht _)) + _ ≤ ∑' k,t (k+1)*b k := + hsum.sum_le_tsum _ (fun k _ => mul_nonneg (ht _) (measureReal_nonneg.trans (htail k))) + +lemma positive_part_tail {Ω : Type*} (f : Ω → ℝ) {C k : ℝ} (hk : 0 ≤ k) : + {z | k < max (f z-C) 0}={z | C+k < f z} := by + ext z + simp only [mem_ofPred_eq,lt_max_iff,not_lt_of_ge hk,or_false] + constructor <;> intro h <;> linarith + +theorem logarithmic_tail_integral : ∃ K : ℝ,0 < K ∧ + ∀ {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] + {f : Ω → ℝ}, Measurable f → ∀ {B C d : ℝ}, (∀ z,f z ≤ B) → 1 ≤ C → 0 ≤ d → + (∀ b : ℝ,2*C ≤ b → 0 < P.real {z | b ((k:ℝ)+1)^(-99:ℝ) + have hW : Summable W := by + have H := (Real.summable_nat_rpow.mpr (by norm_num : (-99:ℝ) < -1)) + simpa only [W,Nat.cast_add,Nat.cast_one] using (summable_nat_add_iff 1).mpr H + let K : ℝ := 251^(250:ℕ)*((∑' k,W k)+1) + have hW0 : ∀ k,0 ≤ W k := fun k => by dsimp [W]; positivity + have hK : 0 < K := mul_pos (pow_pos (by norm_num) 250) (by have h : 0 ≤ ∑' k,W k := tsum_nonneg hW0; linarith) + refine ⟨K,hK,?_⟩ + intro Ω inst P instP f hf B C d hB hC hd hprob + let A : ℝ := (251^5*d)^50 + have hA : 0 ≤ A := pow_nonneg (mul_nonneg (pow_nonneg (by norm_num) 5) hd) 50 + let t : ℕ → ℝ := fun k => k + let b : ℕ → ℝ := fun k => A/((k:ℝ)+1)^100 + have hsEq (k : ℕ) : t (k+1)*b k=A*W k := by + have hk : (k:ℝ)+1 ≠ 0 := by positivity + simp only [t,b,W,Nat.cast_add,Nat.cast_one] + rw [show (-99:ℝ)= -((99:ℕ):ℝ) by norm_num,Real.rpow_neg_natCast] + simp only [zpow_neg,zpow_natCast] + rw [show (((k:ℝ)+1)^100)=((k:ℝ)+1)*((k:ℝ)+1)^99 by rw [pow_succ']] + field_simp [hk] + have hsum : Summable (fun k => t (k+1)*b k) := by + simp_rw [hsEq] + exact hW.mul_left A + have htail (k : ℕ) : P.real {z | t k < max (f z-2*C) 0} ≤ b k := by + rw [positive_part_tail f (show 0 ≤ t k from Nat.cast_nonneg k)] + by_cases hp : 0 < P.real {z | 2*C+(k:ℝ) le_max_right _ _) t b (fun k => Nat.cast_nonneg k) N hbnd htail hsum + simp_rw [hsEq,tsum_mul_left] at H + simp only [t,Nat.cast_zero,zero_add] at H + apply H.trans + have he : A=251^(250:ℕ)*d^50 := by dsimp [A]; rw [mul_pow,←pow_mul] + rw [he] + dsimp [K] + calc + _ ≤ 251^250*d^50*((∑' k,W k)+1) := mul_le_mul_of_nonneg_left (le_add_of_nonneg_right zero_le_one) (mul_nonneg (pow_nonneg (by norm_num) 250) (pow_nonneg hd 50)) + _ = _ := by ac_rfl +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/NegativeCost.lean b/lean/OAI/Analysis/CoulombRadii/Screening/NegativeCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..885ac2dad44e9a7bd3e47814291c06076a3615d1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/NegativeCost.lean @@ -0,0 +1,68 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped Topology +noncomputable section +namespace NeutralAtom + +lemma negative_center_of_oscillation {v w θ B : ℝ} (hθ : 0 ≤ θ) (hθh : θ ≤ 1/2) + (hB : 0 ≤ B) (hosc : ‖w-v‖ ≤ θ*(B+max (-v) 0)) : + max (-v) 0 ≤ 2*max (-w) 0+2*θ*B := by + have hz := (abs_le.mp (Real.norm_eq_abs (w-v) ▸ hosc)).2 + have hm : max (-v) 0 ≤ max (-w) 0+θ*(B+max (-v) 0) := + max_le (by linarith [le_max_left (-w) 0]) (by positivity) + have hhalf := mul_le_mul_of_nonneg_right hθh (le_max_right (-v) 0) + nlinarith + +theorem negative_center_of_test_mass {X : Type*} [MeasurableSpace X] {μ : Measure X} + (W σ χ : X → ℝ) (v θ B K m : ℝ) + (hθ : 0 ≤ θ) (hθh : θ ≤ 1/2) (hB : 0 ≤ B) (hK : 0 ≤ K) (hm : 0 < m) + (hσ : ∀ᵐ x ∂μ, 0 ≤ σ x) (hχ : ∀ᵐ x ∂μ, 0 ≤ χ x ∧ χ x ≤ K) + (hi : Integrable (fun x => σ x*χ x) μ) + (hc : Integrable (fun x => max (-W x) 0*σ x) μ) + (hmass : m ≤ ∫ x, σ x*χ x ∂μ) + (hosc : ∀ᵐ x ∂μ, χ x≠0 → ‖W x-v‖ ≤ θ*(B+max (-v) 0)) : + max (-v) 0 ≤ (2*K/m)*(∫ x, max (-W x) 0*σ x ∂μ)+2*θ*B := by + let Y := max (-v) 0 + let d := 2*θ*B + let I := ∫ x, max (-W x) 0*σ x ∂μ + let q := ∫ x, σ x*χ x ∂μ + have hI : 0 ≤ I := integral_nonneg_of_ae (hσ.mono fun x hx => mul_nonneg (le_max_right _ _) hx) + have H : Y*q ≤ 2*K*I+d*q := by + calc + Y*q = ∫ x, Y*(σ x*χ x) ∂μ := (integral_const_mul _ _).symm + _ ≤ ∫ x, (2*K)*(max (-W x) 0*σ x)+d*(σ x*χ x) ∂μ := by + apply integral_mono_ae (hi.const_mul _) ((hc.const_mul _).add (hi.const_mul _)) + filter_upwards [hσ,hχ,hosc] with x hs hx ho + change Y*(σ x*χ x) ≤ (2*K)*(max (-W x) 0*σ x)+d*(σ x*χ x) + by_cases hz : χ x=0 + · simp only [hz,mul_zero,add_zero] + positivity + · have hy := negative_center_of_oscillation hθ hθh hB (ho hz) + have hy' := mul_le_mul_of_nonneg_right hy (mul_nonneg hs hx.1) + have hk := mul_le_mul_of_nonneg_left hx.2 (mul_nonneg (le_max_right (-W x) 0) hs) + dsimp only [Y,d] + nlinarith + _ = 2*K*I+d*q := by rw [integral_add (hc.const_mul _) (hi.const_mul _),integral_const_mul,integral_const_mul] + have hnon : 0 ≤ 2*K*I/m := div_nonneg (by positivity) hm.le + have H' : Y ≤ 2*K*I/m+d := by + by_cases hd : Y ≤ d + · linarith + · have hl : (Y-d)*m ≤ (Y-d)*q := mul_le_mul_of_nonneg_left hmass (by linarith) + have hb : Y-d ≤ 2*K*I/m := (le_div_iff₀ hm).mpr (by nlinarith) + linarith + dsimp only [Y,d,I] at H' + simpa only [div_mul_eq_mul_div] using H' + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/OutCap.lean b/lean/OAI/Analysis/CoulombRadii/Screening/OutCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..96b6cf3ffa36827f9dcd47dc0f774f5da40c82f7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/OutCap.lean @@ -0,0 +1,158 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.JointSlice +import OAI.Analysis.CoulombRadii.RandomFields.LocalizedEnsemble + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma positive_square_ballCloud_integral_le {J : ℕ} (S : Nuclei J) (f : Space → ℝ) + (hm : AEStronglyMeasurable f volume) (hbound : ∀ z, f z ≤ attraction S z) + {a : ℝ} (ha : 0 < a) (y : Space) (hnuc : ∀ j, 2*a ≤ ‖S.position j-y‖) : + (∫ z, (max (f z) 0)^2*ballCloud y a 1 z) ≤ (totalCharge S/a)^2 := by + calc + _ ≤ ∫ z, (totalCharge S/a)^2*ballCloud y a 1 z := by + apply integral_mono (positive_square_ballCloud_integrable S f hm hbound ha y hnuc) + ((ballCloud_integrable a 1 y).const_mul _) + intro z + by_cases hz : z-y ∈ Metric.ball (0:Space) a + · have hdist : ‖z-y‖ < a := by simpa only [Metric.mem_ball,dist_zero_right] using hz + have hsep (j : Fin J) : a ≤ ‖z-S.position j‖ := by + have ht : ‖S.position j-y‖ ≤ ‖S.position j-z‖+‖z-y‖ := by + simpa only [dist_eq_norm] using dist_triangle (S.position j) z y + rw [norm_sub_rev (S.position j) z] at ht + linarith [hnuc j] + have hP : max (f z) 0 ≤ totalCharge S/a := + (max_le (hbound z) (attraction_nonneg S z)).trans (attraction_le_totalCharge_div S ha z hsep) + exact mul_le_mul_of_nonneg_right (pow_le_pow_left₀ (le_max_right _ _) hP 2) + (uniformBall_nonneg ha zero_le_one (z-y)) + · simp only [ballCloud,uniformBall,indicator_of_notMem hz,mul_zero,le_refl] + _ = _ := by rw [integral_const_mul,ballCloud_mass ha,mul_one] + +def localFarCap {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (y : Space) (a : ℝ) : ℝ := + Real.sqrt (8*(∫ v, (max (recordedFarField S u x {z | 4*a ≤ ‖z-y‖} v) 0)^2* + ballCloud y (2*a) 1 v)) + +lemma localFarCap_nonneg {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (y : Space) (a : ℝ) : 0 ≤ localFarCap S u x y a := Real.sqrt_nonneg _ + +lemma localFarCap_sq {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (y : Space) {a : ℝ} (ha : 0 < a) : + (localFarCap S u x y a)^2=8*(∫ v, + (max (recordedFarField S u x {z | 4*a ≤ ‖z-y‖} v) 0)^2*ballCloud y (2*a) 1 v) := by + apply Real.sq_sqrt + apply mul_nonneg (by norm_num) + exact integral_nonneg (fun v => mul_nonneg (sq_nonneg _) (uniformBall_nonneg (by linarith) zero_le_one (v-y))) + +lemma localFarCap_le {J m k : ℕ} (S : Nuclei J) (u : H1Vector k) + (x : Configuration m) (y : Space) {a : ℝ} (ha : 0 < a) + (hnuc : ∀ j, 4*a ≤ ‖S.position j-y‖) : + localFarCap S u x y a ≤ Real.sqrt (8*(totalCharge S/(2*a))^2) := by + apply Real.sqrt_le_sqrt + apply mul_le_mul_of_nonneg_left _ (by norm_num) + apply positive_square_ballCloud_integral_le S _ + (recordedFarField_aestronglyMeasurable S u x (isClosed_le continuous_const (by fun_prop)).measurableSet) + (recordedFarField_le_attraction S u x _) (by positivity) y + intro j + nlinarith [hnuc j] + +lemma localFarCap_normalized_slice_aestronglyMeasurable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) (s : Spins m) (y : Space) (a : ℝ) : + AEStronglyMeasurable (fun x => localFarCap S (u.coreSlice s x).normalized x y a) volume := by + have hf := recordedFarField_normalized_slice_joint S u s + (isClosed_le continuous_const (by fun_prop) : IsClosed {z : Space | 4*a ≤ ‖z-y‖}).measurableSet + have H : AEStronglyMeasurable (fun z : Configuration m × Space => + (max (recordedFarField S (u.coreSlice s z.1).normalized z.1 {z | 4*a ≤ ‖z-y‖} z.2) 0)^2* + ballCloud y (2*a) 1 z.2) (volume.prod volume) := + ((hf.sup aestronglyMeasurable_const).pow 2).mul + ((ballCloud_measurable (2*a) 1 y).comp measurable_snd).aestronglyMeasurable + exact Real.continuous_sqrt.comp_aestronglyMeasurable (H.integral_prod_right'.const_mul 8) + +lemma localFarCap_weight_integrable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) (s : Spins m) {a : ℝ} (ha : 0 < a) (y : Space) + (hnuc : ∀ j, 4*a ≤ ‖S.position j-y‖) (q : ℕ) : + Integrable (fun x => mass (u.coreSlice s x)*(localFarCap S (u.coreSlice s x).normalized x y a)^q) := by + apply (mass_coreSlice_integrable u s).mul_bdd ((localFarCap_normalized_slice_aestronglyMeasurable S u s y a).pow q) + filter_upwards [] with x + change ‖(localFarCap S (u.coreSlice s x).normalized x y a)^q‖ ≤ (Real.sqrt (8*(totalCharge S/(2*a))^2))^q + rw [Real.norm_of_nonneg (pow_nonneg (localFarCap_nonneg _ _ _ _ _) q)] + exact pow_le_pow_left₀ (localFarCap_nonneg _ _ _ _ _) (localFarCap_le S _ x y ha hnuc) q + +theorem sliceExpectation_localFarCap_sq {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {a : ℝ} (ha : 0 < a) (y : Space) + (hnuc : ∀ j, 4*a ≤ ‖S.position j-y‖) : + sliceExpectation u (fun s x => (localFarCap S (u.coreSlice s x).normalized x y a)^2) = + 8*(∫ v, (sliceExpectation u (fun s x => + (max (recordedFarField S (u.coreSlice s x).normalized x {z | 4*a ≤ ‖z-y‖} v) 0)^2))* + ballCloud y (2*a) 1 v) := by + simp only [localFarCap_sq S _ _ y ha] + rw [sliceExpectation_const_mul,sliceExpectation_farSquare_ballCloud S u + (isClosed_le continuous_const (by fun_prop)).measurableSet (by positivity) y (fun j => by nlinarith [hnuc j])] + +lemma pairPotential_nonneg_pointwise {m : ℕ} (x : Configuration m) : 0 ≤ pairPotential x := by + unfold pairPotential + apply Finset.sum_nonneg + intro i hi + apply Finset.sum_nonneg + intro j hj + split_ifs <;> first | exact inv_nonneg.mpr (norm_nonneg _) | exact le_rfl + +theorem conditionalOutCost_lower_local {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) {a : ℝ} (ha : 0 < a) (y : Space) + (hnuc : ∀ j, 4*a ≤ ‖S.position j-y‖) + (hsupp : ∀ s, ∀ᵐ x, mass (u.coreSlice s x) ≠0 → ∀ i, ‖position x i-y‖ ≤ a) : + -(m:ℝ)*sliceExpectation u (fun s x => localFarCap S (u.coreSlice s x).normalized x y a)- + (m:ℝ)^2/(3*a)*mass u ≤ conditionalOutCost S u := by + have H (s : Spins m) : + ∫ x, mass (u.coreSlice s x)*(-(m:ℝ)*localFarCap S (u.coreSlice s x).normalized x y a-(m:ℝ)^2/(3*a)) ≤ + ∫ x, mass (u.coreSlice s x)*(pairPotential x- + ∑ i : Fin m, coreScreenedField S (u.coreSlice s x).normalized (position x i)) := by + have hic : Integrable (fun x => mass (u.coreSlice s x)*localFarCap S (u.coreSlice s x).normalized x y a) := by + simpa only [pow_one] using localFarCap_weight_integrable S u s ha y hnuc 1 + apply integral_mono_ae + · convert (hic.const_mul (-(m:ℝ))).sub ((mass_coreSlice_integrable u s).mul_const ((m:ℝ)^2/(3*a))) using 1 + funext x + dsimp + ring + · exact conditionalOutCost_weight_integrable S u s + · filter_upwards [hsupp s] with x hx + by_cases hm : mass (u.coreSlice s x)=0 + · simp only [hm,zero_mul,le_refl] + · apply mul_le_mul_of_nonneg_left _ (mass_nonneg _) + have hcap : (∑ i : Fin m, coreScreenedField S (u.coreSlice s x).normalized (position x i)) ≤ + (m:ℝ)*(localFarCap S (u.coreSlice s x).normalized x y a+(m:ℝ)/(3*a)) := by + calc + _ ≤ ∑ _i : Fin m, (localFarCap S (u.coreSlice s x).normalized x y a+(m:ℝ)/(3*a)) := by + apply Finset.sum_le_sum + intro i hi + exact coreField_le_local_far_cap S (u.coreSlice s x).normalized x ha y (position x i) (hx hm i) hnuc + _ = _ := by simp; ring + have hp := pairPotential_nonneg_pointwise x + have he : (m:ℝ)*((m:ℝ)/(3*a))=(m:ℝ)^2/(3*a) := by ring + nlinarith + have HH := Finset.sum_le_sum (fun s (_ : s ∈ Finset.univ) => H s) + have hc (s : Spins m) : Integrable (fun x => mass (u.coreSlice s x)*localFarCap S (u.coreSlice s x).normalized x y a) := by + simpa only [pow_one] using localFarCap_weight_integrable S u s ha y hnuc 1 + have he (s : Spins m) : + (∫ x, mass (u.coreSlice s x)*(-(m:ℝ)*localFarCap S (u.coreSlice s x).normalized x y a-(m:ℝ)^2/(3*a))) = + -(m:ℝ)*(∫ x, mass (u.coreSlice s x)*localFarCap S (u.coreSlice s x).normalized x y a)- + (m:ℝ)^2/(3*a)*(∫ x, mass (u.coreSlice s x)) := by + simp only [mul_sub,mul_left_comm (mass _) (-(m:ℝ))] + rw [integral_sub ((hc s).const_mul _) ((mass_coreSlice_integrable u s).mul_const _),integral_const_mul,integral_mul_const] + ring + simp only [he,Finset.sum_sub_distrib,←Finset.mul_sum,integral_mass_coreSlice] at HH + exact HH.trans (le_add_of_nonneg_left (outerKinetic_nonneg u)) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/PatchComparison.lean b/lean/OAI/Analysis/CoulombRadii/Screening/PatchComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..f400c9c230b232bb663997cacc5faa2ca6433d3c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/PatchComparison.lean @@ -0,0 +1,149 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.FineCountTest +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchGeometry + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical SchwartzMap +noncomputable section +namespace Coulomb + +lemma weighted_cap_count_integrable {X : Type*} [MeasurableSpace X] {μ : Measure X} + {w F N : X → ℝ} (hw : Integrable w μ) (hw0 : ∀ᵐ x ∂μ, 0≤w x) + (hF : AEStronglyMeasurable F μ) (hF0 : ∀ᵐ x ∂μ, 0≤F x) + (hFi : Integrable (fun x => w x*(F x)^2) μ) + (hN : AEStronglyMeasurable N μ) {n : ℝ} (hn : 0≤n) + (hN0 : ∀ᵐ x ∂μ, 0≤N x ∧ N x≤n) : + Integrable (fun x => w x*(F x*N x)) μ := by + apply ((hw.add hFi).const_mul n).mono' (hw.aestronglyMeasurable.mul (hF.mul hN)) + filter_upwards [hw0,hF0,hN0] with x hw hf hnn + dsimp only [Pi.add_apply,Pi.mul_apply] + rw [Real.norm_of_nonneg (mul_nonneg hw (mul_nonneg hf hnn.1))] + have h1 := mul_le_mul_of_nonneg_left hnn.2 (mul_nonneg hw hf) + have h2 := mul_nonneg (mul_nonneg hw hn) (sq_nonneg (F x-1/2)) + nlinarith + +lemma patch_diameter {a b t : ℝ} (_ : 0 mass (ψ.coreSlice s x)*(F s x)^2)) + (hcap : ∀ s, ∀ᵐ x, ∀ w∈Metric.closedBall y (t+b), coreScreenedField S (ψ.coreSlice s x).normalized w≤F s x) + {E : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) : + let ρ := fun s x => localTFDensity measurableSet_ball + (coreTFField S (ψ.coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn)) + sliceExpectation ψ (fun s x => rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x)) ≤ + form S ψ-E*mass ψ+ + sliceExpectation ψ (fun s x => packetKineticError (scaledWindow unitWindow b hb.ne') (ρ s x))+ + sliceExpectation ψ (fun s x => F s x*localCount {z | t-7*b≤‖z-y‖} x)+fineLocalizationError m b*mass ψ := by + dsimp only + let ρ := fun s x => localTFDensity measurableSet_ball + (coreTFField S (ψ.coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn)) + have hcap' (s : Spins m) : ∀ᵐ x, ∀ w∈Metric.ball y (t-4*b), coreScreenedField S (ψ.coreSlice s x).normalized w≤F s x := by + filter_upwards [hcap s] with x hx + intro w hw + apply hx w + exact Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith)) hw + have hTF (s : Spins m) := coreTF_conditional_integrable measurableSet_ball S ψ s ha + (patch_nucleus_separation S ha hb ht.2 y hn) (show 0<12*a by positivity) + (patch_diameter ha hb ht.2 y) (F s) (hF0 s) (hFi s) (hcap' s) + have hFC (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(F s x*(deletedLabels (patchRetained y t b) x).card)) := by + simp_rw [deletedLabels_patchRetained] + exact weighted_cap_count_integrable (mass_coreSlice_integrable ψ s) + (Eventually.of_forall (fun _ => mass_nonneg _)) (hFm s) (hF0 s) (hFi s) + (localCount_measurable (isClosed_le continuous_const (by fun_prop)).measurableSet).aestronglyMeasurable + (Nat.cast_nonneg m) (Eventually.of_forall (fun x => ⟨localCount_nonneg _ x,localCount_le _ x⟩)) + have hKC (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*packetKineticError (scaledWindow unitWindow b hb.ne') (ρ s x)) := by + unfold packetKineticError + convert (hTF s).1.mul_const ((1/2:ℝ)*(∑ j : Fin 3, ∫ z : Space, + (fderiv ℝ (scaledWindow unitWindow b hb.ne') z (EuclideanSpace.single j 1))^2)) using 1 + funext x + ring + let F' := fun s x => if mass (ψ.coreSlice s x)=0 then + ∑ i : Fin m, max (coreScreenedField S (ψ.coreSlice s x).normalized (position x i)) 0 else F s x + have hFC' (s : Spins m) : Integrable (fun x => mass (ψ.coreSlice s x)*(F' s x*(deletedLabels (patchRetained y t b) x).card)) := by + apply (hFC s).congr + filter_upwards [] with x + dsimp only [F'] + split_ifs with hm <;> simp_all + have hFE : sliceExpectation ψ (fun s x => F' s x*(deletedLabels (patchRetained y t b) x).card)= + sliceExpectation ψ (fun s x => F s x*localCount {z | t-7*b≤‖z-y‖} x) := by + apply Finset.sum_congr rfl + intro s hs + apply integral_congr_ae + filter_upwards [] with x + rw [deletedLabels_patchRetained] + dsimp only [F'] + split_ifs with hm <;> simp_all + have HH := source_free_patch_comparison S ψ ho hc hb (patchRetained y t b) (patchRetained_measurable y t b) + F' hFC' (show ∀ s, ∀ᵐ x, ∀ i∈deletedLabels (patchRetained y t b) x, + coreScreenedField S (ψ.coreSlice s x).normalized (position x i)≤F' s x from ?_) + (scaledWindow unitWindow b hb.ne') (by rw [scaledWindow_mass _ hb,unitWindow_mass]) + (scaledWindow_compactSupport unitWindow unitWindow_support hb) + (scaledWindow_radial unitWindow unitWindow_radial hb) hb + (scaledWindow_support unitWindow unitWindow_support hb) ρ + (fun _ _ => Metric.closedBall y (t-4*b)) (fun _ _ => {z | t≤‖z-y‖}) + (show ∀ s, ∀ᵐ x, SourceFreeHoleDensity S (ψ.coreSlice s x).normalized _ b (ρ s x) _ _ from ?_) + (show ∀ s : Spins m, ∀ᵐ x, ∀ j i, i∈patchRetained y t b x → Real.sqrt 3*b≤‖S.position j-position x i‖ from ?_) + (fun _ => Eventually.of_forall (fun x => patch_retained_separated ha hb y x)) + (fun s => (hTF s).2) hKC hE + · rwa [hFE] at HH + · intro s + filter_upwards [hcap s,hos s] with x hx ho + intro i hi + dsimp only [F'] + split_ifs with hm + · exact (le_max_left _ 0).trans (Finset.single_le_sum (fun j _ => le_max_right (coreScreenedField S (ψ.coreSlice s x).normalized (position x j)) 0) (Finset.mem_univ i)) + · exact hx _ (ho hm i) + · intro s + filter_upwards [hcs s] with x hx + exact patch_hole_density S _ ha hb hsmall ht.2 y hx hn _ + · intro s + filter_upwards [] with x + intro j i hi + have hret := (patchRetained_mem ..).mp hi + have H := norm_sub_le_norm_sub_add_norm_sub (S.position j) (position x i) y + have hs : Real.sqrt 3≤2 := (Real.sqrt_le_iff).mpr ⟨by norm_num,by norm_num⟩ + nlinarith [hn j,ht.2] + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/PhysicalCapMoment.lean b/lean/OAI/Analysis/CoulombRadii/Screening/PhysicalCapMoment.lean new file mode 100644 index 0000000000000000000000000000000000000000..209c1dff03def914c12f9575762dd79b4399326f --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/PhysicalCapMoment.lean @@ -0,0 +1,128 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.ScaledFieldCap +import OAI.Analysis.CoulombRadii.Screening.LogTailMoment + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +def physicalFieldCapBase : ℝ := max 1 (2*physicalFieldCapUnit) +lemma physicalFieldCapBase_ge_one : 1 ≤ physicalFieldCapBase := le_max_left _ _ +lemma physicalFieldCapBase_ge_unit : 2*physicalFieldCapUnit ≤ physicalFieldCapBase := le_max_right _ _ + +theorem physical_retained_field_excess_moment : ∃ K : ℝ,0 < K ∧ + ∀ (g₀ : 𝓢(Position,ℝ)), (∀ z,1 < ‖z‖ → g₀ z=0) → (∫ z,g₀ z^2)=1 → + (∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) → + ∀ {n J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n}, + ∀ (hd : FormDomain ψ g) (hn : normSquared ψ=1), + (∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) → + ∀ {E D : ℝ}, (E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D → 0 ≤ D → ∀ (r : Fin J → ℝ), (∀ k,0 < r k) → ∀ (j : ℕ), + ∀ {c r₀ s : ℝ}, 0 < c → 0 < r₀ → 0 < s → + c*(1+packetExponent)*s^packetExponent ≤ 1/2 → + ∀ (y : Position), y≠0 → Coulomb.atomicCellScale y ≤ 1 → + D*(Coulomb.atomicCellScale y)^7 ≤ 1 → + 2*packetWidth c r₀ s y ≤ 40*Coulomb.atomicCellScale y → + letI := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + (∫ z,max (‖y‖^4*((Z:ℝ)*coulombKernel y- + potentialOf (conditionalPacketDensity P Prod.fst (tailObservation r j) g₀ c r₀ s + (tailObservation r j z)) y)-2*physicalFieldCapBase) 0 ∂P) ≤ + K*(physicalFieldCapUnit^2*observationEventEnergyConstant* + observationWidthSquareSum (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ))* + (Coulomb.atomicCellScale y)^7)^50 := by + obtain ⟨K,hK,HK⟩ := logarithmic_tail_integral + refine ⟨K,hK,?_⟩ + intro g₀ hg hm hrad n J Z hZ ψ g hd hn hmin E D hE hbase hD r hr j c r₀ s hc hr₀ hs hscale y hy ha1 hDa hwidth + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let μ := conditionalPacketDensity P Prod.fst (tailObservation r j) g₀ c r₀ s + let f := fun z : ObservationSample n J => ‖y‖^4*((Z:ℝ)*coulombKernel y-potentialOf (μ (tailObservation r j z)) y) + have hgs : HasCompactSupport (g₀ : Position → ℝ) := + HasCompactSupport.intro (isCompact_closedBall (0:Position) 1) (fun z hz => + hg z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hf : Measurable f := ((measurable_const.sub + (measurable_conditionalPacketPotential_data P Prod.fst (tailObservation r j) + g₀.continuous hgs hm hc hr₀ hs y)).comp (measurable_tailObservation r j)).const_mul _ + have hB (z : ObservationSample n J) : f z ≤ ‖y‖^4*((Z:ℝ)*coulombKernel y) := by + apply mul_le_mul_of_nonneg_left _ (pow_nonneg (norm_nonneg y) 4) + have hpot := potentialOf_nonneg (conditionalPacketDensity_nonneg P Prod.fst + (tailObservation r j) g₀ hc hr₀ hs (tailObservation r j z)) y + linarith + apply HK P hf hB physicalFieldCapBase_ge_one + (mul_nonneg (mul_nonneg (mul_nonneg (sq_nonneg _) observationEventEnergyConstant_pos.le) + (observationWidthSquareSum_nonneg _)) (pow_nonneg (Coulomb.atomicCellScale_pos hy).le 7)) + intro b hb hp + have hC0 : 0 ≤ physicalFieldCapBase := zero_le_one.trans physicalFieldCapBase_ge_one + have hb' : physicalFieldCapBase ≤ b := by linarith + have H := physical_retained_field_tail g₀ hg hm hrad Z hZ hd hn hmin hE hbase hD + r hr j hc hr₀ hs hscale y hy ha1 hDa hwidth + (physicalFieldCapBase_ge_unit.trans hb') hp + apply le_trans _ H + apply pow_le_pow_left₀ (by linarith : 0 ≤ b-physicalFieldCapBase) + linarith [physicalFieldCapBase_ge_unit] +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical +noncomputable section +namespace NeutralAtom +lemma cap_scale_power {r : ℝ} (hr : 0 + ‖fromH1Wave u (Fin.cons s σ) (Fin.cons x y)‖^2)) : + Coulomb.firstParticleDensity (μ := Coulomb.spinSpaceMeasure) (Coulomb.cubeState u) + (s,WithLp.ofLp x) = (N+1:ℝ)*∑ σ : Spins N,∫ y : Configuration N, + ‖fromH1Wave u (Fin.cons s σ) (Fin.cons x y)‖^2 := by + unfold Coulomb.firstParticleDensity + simp only [Nat.cast_add,Nat.cast_one] + congr 1 + let F (σ : Coulomb.Spins N) (z : Coulomb.Configuration N) : ℝ := + ‖fromH1Wave u (Fin.cons s σ) (Fin.cons x ((flattenConfiguration N).symm z))‖^2 + have hF (σ) : Integrable (F σ) := + (flattenConfiguration_symm_measurePreserving N).integrable_comp_of_integrable (hi σ) + calc + _=∫ z,F ((Coulomb.spinCubeEquiv N) z).1 + (WithLp.toLp 2 ((Coulomb.spinCubeEquiv N) z).2) + ∂(Measure.pi fun _ : Fin N => Coulomb.spinSpaceMeasure) := by + apply integral_congr_ae + filter_upwards [] with z + congr 2 + unfold Coulomb.firstFiber Coulomb.cubeState fromH1Wave + congr 1 + · funext i + refine Fin.cases ?_ (fun j => ?_) i <;> rfl + · ext ⟨i,a⟩ + refine Fin.cases ?_ (fun j => ?_) i <;> rfl + _=∑ σ,∫ z,F σ z := Coulomb.spinConfiguration_integral F hF + _=_ := by + apply Finset.sum_congr rfl + intro σ _ + exact (flattenConfiguration_symm_measurePreserving N).integral_comp' + (fun y : Configuration N => ‖fromH1Wave u (Fin.cons s σ) (Fin.cons x y)‖^2) + +theorem density_fromH1_eq_oneBodyDensity {N : ℕ} (u : Coulomb.H1Vector (N+1)) : + density (fromH1Wave u)=ᵐ[volume] Coulomb.oneBodyDensity u := by + have hL (σ : Spins (N+1)) : Integrable (fun z : Configuration (N+1) => ‖fromH1Wave u σ z‖^2) := + ((u.value_L2 σ).comp_measurePreserving (flattenConfiguration_measurePreserving (N+1))).norm.integrable_sq + have hi : ∀ᵐ x : Position,∀ σ : Spins (N+1),Integrable + (fun y : Configuration N => ‖fromH1Wave u σ (Fin.cons x y)‖^2) := by + rw [ae_all_iff] + intro σ + exact (integrable_cons (hL σ)).prod_right_ae + filter_upwards [hi] with x hx + unfold Coulomb.oneBodyDensity Coulomb.flatOneBodyDensity + simp_rw [firstParticleDensity_physical_slice u _ x (fun σ => hx _)] + rw [←Finset.mul_sum] + unfold density + congr 1 + let e : Spins (N+1) ≃ (Fin 2 × Spins N) := + { toFun := fun σ => (σ 0,Fin.tail σ) + invFun := fun p => Fin.cons p.1 p.2 + left_inv := fun σ => Fin.cons_self_tail σ + right_inv := fun p => by cases p; rfl } + calc + _=∑ p : Fin 2 × Spins N,∫ y : Configuration N, + ‖fromH1Wave u (Fin.cons p.1 p.2) (Fin.cons x y)‖^2 := by + apply Fintype.sum_equiv e + intro σ + change (∫ y : Configuration N,‖fromH1Wave u σ (Fin.cons x y)‖^2)= + ∫ y : Configuration N,‖fromH1Wave u (Fin.cons (σ 0) (Fin.tail σ)) (Fin.cons x y)‖^2 + rw [Fin.cons_self_tail] + _=_ := Fintype.sum_prod_type _ + +theorem physical_density_power_bound {N : ℕ} (u : Coulomb.H1Vector (N+1)) + (hu : Coulomb.Antisymmetric u) (hm : Coulomb.mass u≤1) : + Integrable (fun x => (density (fromH1Wave u) x)^(5/3:ℝ)) ∧ + (∫ x,(density (fromH1Wave u) x)^(5/3:ℝ))≤(32768/(3*Real.pi^2))*Coulomb.kinetic u := by + have he := (density_fromH1_eq_oneBodyDensity u).fun_comp (fun t : ℝ => t^(5/3:ℝ)) + obtain ⟨hi,hb⟩ := Coulomb.oneBodyDensity_power_bound u hu hm + exact ⟨hi.congr he.symm,(integral_congr_ae he).trans_le hb⟩ +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/PhysicalSpatialCap.lean b/lean/OAI/Analysis/CoulombRadii/Screening/PhysicalSpatialCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..20ee5fa97456f749b11be0cc2e8be686a15bc99e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/PhysicalSpatialCap.lean @@ -0,0 +1,99 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorSpatialCap + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_retained_spatial_cap {L : ℝ} (hL : 1 ≤ L) : + ∃ C : ℝ,0 < C ∧ + ∀ (g₀ : 𝓢(Position,ℝ)), (∀ z,1 < ‖z‖ → g₀ z=0) → (∫ z,g₀ z^2)=1 → + (∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) → + ∀ {n J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n}, + ∀ (hd : FormDomain ψ g) (hn : normSquared ψ=1), + (∀ (χ : Wavefunction n) (h : Gradient n),FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) → + ∀ {E D : ℝ}, (E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D → 0 ≤ D → + ∀ {c r₀ s : ℝ},0 < c → 0 < r₀ → 0 < s → + c*(1+packetExponent)*s^packetExponent ≤ 1/2 → + 100000*c*s^packetExponent ≤ 10 → + (8*L/100000)*s ≤ 1 → D*((8*L/100000)*s)^7 ≤ 1 → + ∀ (j : ℕ),r₀*2^j ≤ s → + letI := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + let r := fun k : Fin J => r₀*2^k.val + ∃ G : Set (ObservationSample n J),(MeasurableSet G ∧ + MeasurableSet[MeasurableSpace.comap (tailObservation r j) inferInstance] G) ∧ + P.real Gᶜ ≤ C*(r₀*2^j)^249 ∧ + ∀ z∈G,∀ y : Position,3*(r₀*2^j)/4 ≤ ‖y‖ → ‖y‖ ≤ 6*L*(r₀*2^j) → + ‖y‖^4*((Z:ℝ)*coulombKernel y-potentialOf + (conditionalPacketDensity P Prod.fst (tailObservation r j) g₀ c r₀ s + (tailObservation r j z)) y) ≤ physicalSpatialCap := by + obtain ⟨K,hK,HK⟩ := physical_retained_field_excess_moment + let A := 8*L/100000 + let B := physicalFieldCapUnit^2*observationEventEnergyConstant + let C₀ := K*((4/3:ℝ)*B*A^7)^50 + have hA : 0 < A := by dsimp [A]; positivity + have hB : 0 < B := by dsimp [B]; exact mul_pos (sq_pos_of_pos physicalFieldCapUnit_pos) observationEventEnergyConstant_pos + have hC₀ : 0 < C₀ := by dsimp [C₀]; positivity + refine ⟨16*(64*L)^3*C₀,by positivity,?_⟩ + intro g₀ hg hm hrad n J Z hZ ψ g hd hn hmin E D hE hb hD c r₀ s hc hr₀ hs hscale hw hsA hsD j hrj + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + let P := observationLaw J (rawLaw ψ) + let r : Fin J → ℝ := fun k => r₀*2^k.val + let R := r₀*2^j + have hR : 0 < R := by dsimp [R]; positivity + have hrR : r₀ ≤ R := le_mul_of_one_le_right hr₀.le (one_le_pow₀ (by norm_num)) + have hgs : HasCompactSupport (g₀ : Position → ℝ) := + HasCompactSupport.intro (isCompact_closedBall (0:Position) 1) (fun z hz => + hg z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hmoment (y : Position) (hy0 : R/2 ≤ ‖y‖) (hy1 : ‖y‖ ≤ 8*L*R) : + (∫ z,max (‖y‖^4*((Z:ℝ)*coulombKernel y-potentialOf + (conditionalPacketDensity P Prod.fst (tailObservation r j) g₀ c r₀ s + (tailObservation r j z)) y)-2*physicalFieldCapBase) 0 ∂P) ≤ C₀*R^249 := by + have hyn : 0 < ‖y‖ := by linarith + have hy : y≠0 := norm_pos_iff.mp hyn + let a := Coulomb.atomicCellScale y + have ha : 0 < a := Coulomb.atomicCellScale_pos hy + have haR : a ≤ A*R := by dsimp [a,A,Coulomb.atomicCellScale]; linarith + have haS : a ≤ A*s := haR.trans (mul_le_mul_of_nonneg_left hrj hA.le) + have ha1 : a ≤ 1 := haS.trans hsA + have hDa : D*a^7 ≤ 1 := + (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ ha.le haS 7) hD).trans hsD + have hmax : max ‖y‖ r₀ ≤ 2*‖y‖ := max_le (by linarith) (by linarith) + have hp := (packetWidth_le c r₀ s hc.le hr₀ hs y).trans + (mul_le_mul_of_nonneg_left hmax (by positivity)) + have hwidth : 2*packetWidth c r₀ s y ≤ 40*a := by + have hmul := mul_le_mul_of_nonneg_right hw hyn.le + dsimp [a,Coulomb.atomicCellScale] + nlinarith + have H := HK g₀ hg hm hrad Z hZ hd hn hmin hE hb hD r + (fun _ => by dsimp [r]; positivity) j hc hr₀ hs hscale y hy ha1 hDa hwidth + apply H.trans + have Hfac := cap_moment_factor hR ha.le hA.le hB.le + (observationWidthSquareSum_nonneg (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ))) + haR (observationWidthSquareSum_retained_dyadic hr₀ J j) + have Hmul := mul_le_mul_of_nonneg_left Hfac hK.le + change K*(B*observationWidthSquareSum (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ))*a^7)^50 ≤ C₀*R^249 + calc + _ ≤ K*(((4/3:ℝ)*B*A^7)^50*R^249) := Hmul + _ = _ := by dsimp [C₀]; ring + obtain ⟨G,hG,hprob,hcap⟩ := posterior_spatial_cap_of_moment P Prod.fst + (tailObservation r j) (measurable_tailObservation r j) g₀.continuous hgs hm hc hr₀ hs + (by positivity : (0:ℝ) ≤ Z) hR hL (by positivity : 0 ≤ C₀*R^249) hmoment + refine ⟨G,hG,?_,hcap⟩ + calc + _ ≤ 16*(64*L)^3*(C₀*R^249) := hprob + _ = _ := by ring +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/ScaledFieldCap.lean b/lean/OAI/Analysis/CoulombRadii/Screening/ScaledFieldCap.lean new file mode 100644 index 0000000000000000000000000000000000000000..8edefab165e68614067159e83cf89feba771f219 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/ScaledFieldCap.lean @@ -0,0 +1,152 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.PosteriorDataMeasurable +import OAI.Analysis.CoulombRadii.Packets.MasterTruncatedCap + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +def physicalFieldCapUnit : ℝ := + 2*Coulomb.atomicBudgetRecursionC^2*Real.sqrt Coulomb.atomicCountConstant*100000^4 +lemma physicalFieldCapUnit_pos : 0 < physicalFieldCapUnit := by + have h : 0 < Coulomb.atomicBudgetRecursionC := lt_of_lt_of_le (by norm_num) Coulomb.atomicBudgetRecursionC_ge_four + have hP : 0 < Coulomb.atomicCountConstant := lt_of_lt_of_le (by norm_num) Coulomb.atomicCountConstant_ge_two + unfold physicalFieldCapUnit + positivity + +lemma scaled_screen_field {a δ : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) (_ : 0 ≤ δ) : + (100000*a)^4*(2*Coulomb.atomicBudgetRecursionC^2* + Coulomb.screenFieldUnit δ Coulomb.atomicCountConstant a)= + physicalFieldCapUnit*(1+Real.sqrt (δ*a^7)) := by + have hpow : a^3 ≤ 1 := pow_le_one₀ ha.le ha1 + have hinv : 1 ≤ (a^3)⁻¹ := (one_le_inv₀ (pow_pos ha 3)).mpr hpow + have hsqrt : Real.sqrt (δ*a^7)=a^3*Real.sqrt (δ*a) := by + rw [show δ*a^7=(a^3)^2*(δ*a) by ring, Real.sqrt_mul (sq_nonneg _), + Real.sqrt_sq (pow_nonneg ha.le 3)] + unfold Coulomb.screenFieldUnit Coulomb.screenMass Coulomb.screenBaseMass physicalFieldCapUnit + rw [max_eq_left hinv,hsqrt] + field_simp [ha.ne'] + +lemma scaled_screen_field_log {a D Q : ℝ} (ha : 0 < a) (ha1 : a ≤ 1) + (hD : 0 ≤ D) (hQ : 0 ≤ Q) (hDa : D*a^7 ≤ 1) : + (100000*a)^4*(2*Coulomb.atomicBudgetRecursionC^2* + Coulomb.screenFieldUnit (D+Q) Coulomb.atomicCountConstant a) ≤ + 2*physicalFieldCapUnit+physicalFieldCapUnit*Real.sqrt (Q*a^7) := by + rw [scaled_screen_field ha ha1 (add_nonneg hD hQ),add_mul] + have hs : Real.sqrt (D*a^7+Q*a^7) ≤ 1+Real.sqrt (Q*a^7) := by + apply (Real.sqrt_le_iff).mpr + constructor + · positivity + · nlinarith [Real.sq_sqrt (mul_nonneg hQ (pow_nonneg ha.le 7)),Real.sqrt_nonneg (Q*a^7)] + have hC := physicalFieldCapUnit_pos.le + nlinarith [mul_le_mul_of_nonneg_left hs hC] + +lemma cap_square_of_mean {b C Q a : ℝ} (_ : 0 ≤ C) (hQ : 0 ≤ Q) (ha : 0 ≤ a) + (hb : 2*C ≤ b) (hh : b ≤ 2*C+C*Real.sqrt (Q*a^7)) : + (b-2*C)^2 ≤ C^2*Q*a^7 := by + have ht : 0 ≤ b-2*C := by linarith + have hle : b-2*C ≤ C*Real.sqrt (Q*a^7) := by linarith + have H := pow_le_pow_left₀ ht hle 2 + rw [mul_pow,Real.sq_sqrt (mul_nonneg hQ (pow_nonneg ha 7))] at H + nlinarith only [H] +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_retained_field_tail (g₀ : 𝓢(Position,ℝ)) + (hg : ∀ z,1 < ‖z‖ → g₀ z=0) (hm : (∫ z,g₀ z^2)=1) + (hrad : ∀ z,g₀ z=g₀ (EuclideanSpace.single 0 ‖z‖)) + {n J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (hn : normSquared ψ=1) + (hmin : ∀ (χ : Wavefunction n) (h : Gradient n), FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) + {E D : ℝ} (hE : (E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ)) + (hbase : energy Z ψ g ≤ E+D) (hD : 0 ≤ D) + (r : Fin J → ℝ) (hr : ∀ k,0 < r k) (j : ℕ) + {c r₀ s : ℝ} (hc : 0 < c) (hr₀ : 0 < r₀) (hs : 0 < s) + (hscale : c*(1+packetExponent)*s^packetExponent ≤ 1/2) + (y : Position) (hy : y≠0) (ha1 : Coulomb.atomicCellScale y ≤ 1) + (hDa : D*(Coulomb.atomicCellScale y)^7 ≤ 1) + (hwidth : 2*packetWidth c r₀ s y ≤ 40*Coulomb.atomicCellScale y) : + letI := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + let f := fun z : ObservationSample n J => ‖y‖^4*((Z:ℝ)*coulombKernel y- + potentialOf (conditionalPacketDensity P Prod.fst (tailObservation r j) g₀ c r₀ s + (tailObservation r j z)) y) + ∀ {b : ℝ}, 2*physicalFieldCapUnit ≤ b → 0 < P.real {z | b < f z} → + (b-2*physicalFieldCapUnit)^2 ≤ + (physicalFieldCapUnit^2*observationEventEnergyConstant* + observationWidthSquareSum (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ))* + (Coulomb.atomicCellScale y)^7)*(1-Real.log (P.real {z | b < f z}))^5 := by + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + intro b hb hp + let P := observationLaw J (rawLaw ψ) + let obs : ObservationSample n J → Fin J → UnorderedArray n := tailObservation r j + let F := fun datum => (Z:ℝ)*coulombKernel y- + potentialOf (conditionalPacketDensity P Prod.fst obs g₀ c r₀ s datum) y + let B := {datum | b < ‖y‖^4*F datum} + have hgs : HasCompactSupport (g₀ : Position → ℝ) := + HasCompactSupport.intro (isCompact_closedBall (0:Position) 1) (fun z hz => + hg z (by simpa only [Metric.mem_closedBall,dist_zero_right,not_le] using hz)) + have hF : Measurable F := measurable_const.sub + (measurable_conditionalPacketPotential_data P Prod.fst obs g₀.continuous hgs hm hc hr₀ hs y) + have hB : MeasurableSet B := measurableSet_lt measurable_const (hF.const_mul _) + have hpEq := physical_retainedTailEvent_probability hd.2.2.1 hn r hr j hB + change 0 < P.real (obs ⁻¹' B) at hp + have hp1 : P.real (obs ⁻¹' B) ≤ 1 := measureReal_le_one + let p := P.real (obs ⁻¹' B) + let Q := observationEventEnergyConstant* + observationWidthSquareSum (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ))*(1-Real.log p)^5 + have hlog : 0 ≤ 1-Real.log p := by linarith [Real.log_nonpos hp.le hp1] + have hQ : 0 ≤ Q := mul_nonneg (mul_nonneg observationEventEnergyConstant_pos.le + (observationWidthSquareSum_nonneg _)) (pow_nonneg hlog 5) + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase + (fun k : RetainedScales J j => (r k.val)^(101/100:ℝ)) + (fun k => Real.rpow_pos_of_pos (hr k.val) _) + (hB.preimage (measurable_retainedTailObservation j)) + (fun p z => by simp only [mem_preimage,retainedTailObservation_permute]) + (hpEq ▸ hp) + have hue' : Coulomb.form (Coulomb.atom Z hZ) u ≤ E+(D+Q) := by + simpa only [←hpEq] using hue + have Hcap := atomic_master_field_cap (Coulomb.atom Z hZ) (by intro i; rfl) + u hu hum hE hue' (add_nonneg hD hQ) g₀ hm hrad hg hc hr₀ hs hscale y hy hwidth + have Htower := retainedEvent_field_mean hd.2.2.1 hn r hr j hB u hum hlaw hp + g₀.continuous hgs hm hc hr₀ hs y ((Z:ℝ)*coulombKernel y) + have hatt : Coulomb.attraction (Coulomb.atom Z hZ) y=(Z:ℝ)*coulombKernel y := by + simp [Coulomb.attraction,Coulomb.atom,Coulomb.coulombKernel,coulombKernel] + rw [hatt,Htower] at Hcap + have hfi : Integrable (fun z => F (obs z)) P := + (integrable_const _).sub (conditionalPacketPotential_integrable P (rawLaw ψ) + (observationLaw_rawProjection _) (measurable_tailObservation r j) g₀.continuous hgs hm hc hr₀ hs y) + have Hlow := le_normalized_event (hB.preimage (measurable_tailObservation r j)) + (hfi.const_mul (‖y‖^4)) hp (v:=b) + (Eventually.of_forall (fun z hz => (show b < ‖y‖^4*F (obs z) from hz).le)) + rw [integral_const_mul] at Hlow + have Hs := mul_le_mul_of_nonneg_left Hcap (pow_nonneg (norm_nonneg y) 4) + have he : ‖y‖=100000*Coulomb.atomicCellScale y := by unfold Coulomb.atomicCellScale; ring + have Hlog := scaled_screen_field_log (Coulomb.atomicCellScale_pos hy) ha1 hD hQ hDa + rw [←he] at Hlog + have hb' : b ≤ 2*physicalFieldCapUnit+physicalFieldCapUnit*Real.sqrt (Q*(Coulomb.atomicCellScale y)^7) := by + exact (Hlow.trans (by simpa only [mul_left_comm] using Hs)).trans Hlog + have H := cap_square_of_mean physicalFieldCapUnit_pos.le hQ + (Coulomb.atomicCellScale_pos hy).le hb hb' + convert H using 1 + dsimp [Q,p,P,obs,B,F] + ring +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/ScaledTest.lean b/lean/OAI/Analysis/CoulombRadii/Screening/ScaledTest.lean new file mode 100644 index 0000000000000000000000000000000000000000..5795b071dd3990a1ba3f69854a56a49e7f2e3a03 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/ScaledTest.lean @@ -0,0 +1,98 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.RadialCut +import OAI.Analysis.CoulombRadii.FieldAnalysis.CoulombTest + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology ContDiff +noncomputable section +namespace Coulomb +open NeutralAtom (dirPartial coordinateLaplacian axis) + +lemma dirPartial_scaled {f : Space → ℝ} (hf : Differentiable ℝ f) (c : ℝ) (y x v : Space) : + dirPartial (fun z => f (c • (z-y))) v x = c*dirPartial f v (c • (x-y)) := by + have ht : HasFDerivAt (fun z : Space => c • (z-y)) + (c • ContinuousLinearMap.id ℝ Space) x := by + convert ((hasFDerivAt_id x).sub_const y).const_smul c using 1 + rfl + have h := ((hf (c • (x-y))).hasFDerivAt.comp x ht).fderiv + simp only [Function.comp_def] at h + unfold dirPartial + rw [h] + simp only [ContinuousLinearMap.comp_apply,smul_apply,ContinuousLinearMap.id_apply,map_smul,smul_eq_mul] + +lemma dirPartial_const_mul {f : Space → ℝ} (hf : Differentiable ℝ f) (c : ℝ) (x v : Space) : + dirPartial (fun z => c*f z) v x = c*dirPartial f v x := by + unfold dirPartial + rw [((hf x).hasFDerivAt.const_mul c).fderiv] + rfl + +lemma coordinateLaplacian_scaled {f : Space → ℝ} (hf : ContDiff ℝ 2 f) (c : ℝ) (y x : Space) : + coordinateLaplacian (fun z => f (c • (z-y))) x = c^2*coordinateLaplacian f (c • (x-y)) := by + have hg : ContDiff ℝ 2 (fun z : Space => f (c • (z-y))) := hf.comp (by fun_prop) + rw [NeutralAtom.coordinateLaplacian_eq_partials hg.contDiffAt, + NeutralAtom.coordinateLaplacian_eq_partials hf.contDiffAt,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i hi + have he : dirPartial (fun z => f (c • (z-y))) (axis i) = + fun z => c*dirPartial f (axis i) (c • (z-y)) := by + funext z; exact dirPartial_scaled (hf.differentiable (by norm_num)) c y z _ + rw [he] + have hp : Differentiable ℝ (dirPartial f (axis i)) := + (NeutralAtom.contDiff_partial (n := 1) hf (axis i)).differentiable (by norm_num) + have hpc : Differentiable ℝ (fun z : Space => dirPartial f (axis i) (c • (z-y))) := hp.comp (by fun_prop) + rw [dirPartial_const_mul hpc c, + dirPartial_scaled hp c] + ring + +def countTest (y : Space) (a : ℝ) (x : Space) : ℝ := cutSeed (a⁻¹ • (x-y)) +lemma countTest_smooth (y : Space) (a : ℝ) : ContDiff ℝ ∞ (countTest y a) := cutSeed_smooth.comp (by fun_prop) +lemma countTest_nonneg (y : Space) (a : ℝ) (x : Space) : 0≤countTest y a x := Real.smoothTransition.nonneg _ +lemma countTest_le_one (y : Space) (a : ℝ) (x : Space) : countTest y a x≤1 := Real.smoothTransition.le_one _ +lemma countTest_one (y : Space) {a : ℝ} (ha : 0 (testCharge cutSeed (a⁻¹ • (x-y))*cutSeed (a⁻¹ • (x-y)))) y] + simp only [add_sub_cancel_right] + rw [Measure.integral_comp_inv_smul (volume : Measure Space) (fun x => testCharge cutSeed x*cutSeed x) a] + simp only [show Module.finrank ℝ Space=3 from by simp [Space],smul_eq_mul,abs_of_pos (pow_pos ha _)] + dsimp only [countTestEnergy] + field_simp + +end Coulomb + +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/ScreenNumeric.lean b/lean/OAI/Analysis/CoulombRadii/Screening/ScreenNumeric.lean new file mode 100644 index 0000000000000000000000000000000000000000..e55b0d0599e5c2b24014fbd124e472d8127e77e8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/ScreenNumeric.lean @@ -0,0 +1,208 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CountUnits +import OAI.Analysis.CoulombRadii.Packets.ScreenBox + +namespace OAI + +noncomputable section + +namespace Coulomb + +lemma screening_ims_units {P a m : ℝ} (hP : 1 ≤ P) (ha : 0 hmom c) + have hsqrt (c) : Real.sqrt (localCountSecondMoment ψ (Metric.closedBall (z c) (atomicCellScale (z c)))* + (8*(screenFieldUnit δ P a*G)^2)) ≤ 3*P*q^7*screenEnergy δ a*G := by + have H := sqrt_count_raw_product hp0 (screenMass_pos δ (atomicCellScale (z c))).le hw.le hG + (hc _ ((hz c).nonzero ha)) + calc + _ ≤ 3*Real.sqrt P*screenMass δ (atomicCellScale (z c))*screenFieldUnit δ P a*G := H + _ ≤ 3*Real.sqrt P*(q^3*M)*screenFieldUnit δ P a*G := by + gcongr + exact (hz c).mass ha hq hδ + _ = 3*q^3*(P*screenEnergy δ a)*G := by + have hu := screenFieldUnit_product (δ:=δ) (a:=a) hp0 + dsimp [M] + calc + _ = 3*q^3*(Real.sqrt P*screenMass δ a*screenFieldUnit δ P a)*G := by ring + _ = _ := by rw [hu] + _ ≤ _ := by + have HH := mul_le_mul_of_nonneg_right hq37 (show 0 ≤ 3*P*screenEnergy δ a*G by positivity) + nlinarith + have hother (c) : (L*(∑ d, localCountSecondMoment ψ (Metric.closedBall (z d) (atomicCellScale (z d)))))/ + (3*atomicCellScale (z c)) ≤ L^2*P*q^7*screenEnergy δ a := by + calc + _ ≤ (L*(L*(P*q^6*M^2)))/(a/q) := by + apply div_le_div₀ + · positivity + · exact mul_le_mul_of_nonneg_left hsum hL + · exact div_pos ha hq0 + · have H := (hz c).div_lower hq0 + linarith [atomicCellScale_nonneg (z c)] + _ = _ := by unfold screenEnergy; dsimp [M]; field_simp + calc + _ ≤ ∑ _c : C, (3*P*q^7*screenEnergy δ a*G+L^2*P*q^7*screenEnergy δ a) := + Finset.sum_le_sum (fun c _ => add_le_add (hsqrt c) (hother c)) + _ = _ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul]; dsimp [L]; ring + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/ScreenRecurrence.lean b/lean/OAI/Analysis/CoulombRadii/Screening/ScreenRecurrence.lean new file mode 100644 index 0000000000000000000000000000000000000000..8024706bcdc58fbb46a0e8160e185a6ecee54b76 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/ScreenRecurrence.lean @@ -0,0 +1,195 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.ScreenNumeric + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +theorem AtomicCutHistory.append_normalized {J n k : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hm : mass ψ=1) + {E δ P a q : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) (hP : 1 ≤ P) (ha : 0 ?_) i + · simpa only [Fin.snoc_last] using hy + · simpa only [Fin.snoc_castSucc] using hT i + refine ⟨U,ht,hU,?_⟩ + intro G hG hraw + let Q := 4*q + have hQ : 1 ≤ Q := by dsimp [Q]; linarith + have hQ0 : 0 HI i) + simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,mul_assoc] using H + have hbase : (screenBaseMass (atomicCellScale y))^2/atomicCellScale y ≤ screenEnergy δ (atomicCellScale y) := by + exact div_le_div_of_nonneg_right (pow_le_pow_left₀ (screenBaseMass_nonneg _) (screenMass_ge_base _ _) 2) + (atomicCellScale_nonneg _) + have henergy : screenEnergy δ (atomicCellScale y) ≤ P*Q^7*screenEnergy δ a := + calc + _ ≤ Q^7*screenEnergy δ a := hyQ.energy ha hQ hδ + _ ≤ P*(Q^7*screenEnergy δ a) := le_mul_of_one_le_left (mul_nonneg (pow_nonneg hQ0.le _) he.le) hP + _ = _ := by ring + have hbase' : 4*ballTrialCoefficient*(screenBaseMass (atomicCellScale y))^2/atomicCellScale y ≤ + 4*ballTrialCoefficient*P*Q^7*screenEnergy δ a := by + have H := mul_le_mul_of_nonneg_left (hbase.trans henergy) (show 0 ≤ 4*ballTrialCoefficient by positivity [ballTrialCoefficient_pos]) + simpa only [mul_div_assoc,mul_assoc] using H + have hcost := atomic_cell_cost_units ψ hδ hP ha hQ hG U.center hcQ hc + have HG := hgain ((screenFieldUnit δ P a*G)^2) hraw + let L : ℝ := Fintype.card (Fin (k+1) × {z : Space // z∈atomicPatchMesh}) + have HG' : atomicCellScale y/(16*ballTrialCoefficient)*T.ensemble.rawSquare S y (atomicCellScale y) ≤ + P*Q^7*screenEnergy δ a*(1+(k+1:ℕ)*atomicIMSConstant+4*ballTrialCoefficient+3*L*G+L^3) := by + dsimp [L] + nlinarith [hδe,hisum,hbase',hcost] + exact screening_gain_normalized ha (atomicCellScale_pos hy0) hQ0 ballTrialCoefficient_pos + (screenFieldUnit_pos hP ha) (T.ensemble.rawSquare_nonneg S y _) hyQ.1 + (screenFieldUnit_square hp0 ha) HG' + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +namespace Coulomb + +def atomicRecursionA : ℝ := max 1 (16*ballTrialCoefficient* + (1+atomicIMSConstant+4*ballTrialCoefficient+ + 3*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)+ + (Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)^3)) + +def atomicRecursionC : ℝ := atomicRecursionA*524288 + +lemma atomicRecursionC_ge_four : 4 ≤ atomicRecursionC := by + have h : 1 ≤ atomicRecursionA := le_max_left _ _ + unfold atomicRecursionC + linarith + +lemma AtomicCutHistory.rawSquare_le_next_sup {J n k j : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hm : mass ψ=1) + {a w : ℝ} (ha : 0 y + nonzero := fun _ => hy + law := hC + fermionic := hc + support := by + intro p + apply (hos p).mono_space + intro z hz + apply Set.mem_iUnion.mpr + refine ⟨0,?_⟩ + exact Metric.closedBall_subset_closedBall hwidth hz + mass_eq := hm + energy := by + apply hf.trans + apply le_add_of_nonneg_right + exact Finset.sum_nonneg (fun i _ => mul_nonneg (mul_nonneg (by norm_num) (sq_nonneg _)) + (expectedPopulation_nonneg _ _)) } + exact ⟨T,fun _ => rfl,ho,hcs,hos,hf⟩ + +theorem exists_atomic_thin_screened_sharp {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) (hstate : form S ψ≤E+δ) + (hδ : 0≤δ) {y : Space} (hy : y≠0) {b : ℝ} (hb : 0 screenCountParameter_controls ψ hm δ (y:=z) hz + obtain ⟨t,ht,hdel⟩ := exists_atomic_deletedShell ψ hm hδ hy hb hsmall + have ht0 : 0≤t := by nlinarith [ht.1,atomicCellScale_nonneg y] + have hwidth : t+b≤80*atomicCellScale y := by linarith [ht.2,atomicCellScale_nonneg y] + obtain ⟨T,hTr,ho,hcs,hos,hEt⟩ := thin_localization_history_sharp S ψ hψ hy ht0 hb hwidth + have hbudget := thinIMS_budget ψ hm hδ hP hc hy hb hwidth hcond + have hP' : 1≤thinReserveFactor*P := by nlinarith [thinReserveFactor_ge_one] + have hc' (z : Space) (hz : z≠0) : localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z))≤ + (thinReserveFactor*P)*(screenMass δ (atomicCellScale z))^2 := + (hc z hz).trans (mul_le_mul_of_nonneg_right + (le_mul_of_one_le_left hP0 thinReserveFactor_ge_one) (sq_nonneg _)) + refine ⟨t,ht,T,hEt,ho,hcs,hos,(RecordedEnsemble.deletedSquare_le T.law hos).trans hdel,?_,?_⟩ + · exact (RecordedEnsemble.out_square_le T.law measurableSet_closedBall hos).trans + ((localCountSecondMoment_mono ψ measurableSet_closedBall (Metric.closedBall_subset_closedBall hwidth)).trans + (atomicPatch_secondMoment ψ hδ hP0 hc hy)) + · intro v hv + have H := T.positive_field S hatom ψ hm hE hstate hbudget hδ hP' (atomicCellScale_pos hy) hc' + (fun i => by rw [hTr i]; constructor <;> norm_num <;> linarith [atomicCellScale_nonneg y]) + v (by simpa only [pow_one] using hv) + convert H using 1 + simp only [screenFieldUnit,Real.sqrt_mul thinReserveFactor_nonneg] + ring + +lemma thinIMS_sharp_budget {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) + {δ P : ℝ} (hδ : 0≤δ) (hP : 0≤P) + (hc : ∀ z : Space, z≠0 → localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z))≤ + P*(screenMass δ (atomicCellScale z))^2) + {y : Space} (hy : y≠0) {t b : ℝ} (hb : 0 screenCountParameter_controls ψ hm δ (y:=z) hz + obtain ⟨t,ht,T,hEt,ho,hcs,hos,hD,hN,hraw⟩ := + exists_atomic_thin_screened_sharp S hatom ψ hψ hm hE hstate hδ hy hb hsmall hcond + let F := fun p s x => atomicPatchCap S ((T.ensemble.vector p).coreSlice s x).normalized x y + let Q := ∑ p, sliceExpectation (T.ensemble.vector p) (fun s x => (F p s x)^2) + let N := ∑ p, (T.ensemble.out p:ℝ)^2*mass (T.ensemble.vector p) + have hN0 : 0≤N := Finset.sum_nonneg (fun p _ => mul_nonneg (sq_nonneg _) (mass_nonneg _)) + have hD0 : 0≤T.ensemble.deletedSquare y t b := Finset.sum_nonneg (fun p _ => + Finset.sum_nonneg (fun s _ => integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have hwidth : t+b≤80*a := by dsimp only [a] at *; linarith [ht.2] + have hgap : T.ensemble.totalForm S≤E+(δ+thinIMS ψ y t b) := by linarith + have hQ : Q≤atomicPhysicalCapConstant*P*m^2/a^2 := by + have HQ := atomicPatchCap_ensemble_square S hatom T.ensemble hy + (H := (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2) + (fun v hv => (Real.sqrt_le_iff.mp (hraw v hv)).2) + change Q≤_ at HQ + calc + Q≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+8*N/(9*a^2) := HQ + _≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+ + 8*(atomicPatchCountFactor*P*m^2)/(9*a^2) := add_le_add le_rfl + (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hN (by norm_num)) (by positivity)) + _=atomicPhysicalCapConstant*P*m^2/a^2 := by + dsimp only [atomicPhysicalCapConstant,screenFieldUnit,m] + simp only [mul_pow,div_pow,Real.sq_sqrt hP] + ring + have hQ0 : 0≤atomicPhysicalCapConstant*P*m^2/a^2 := by positivity [atomicPhysicalCapConstant_nonneg] + have hn (j) : 20*a≤‖S.position j-y‖ := by + rw [hatom j,zero_sub,norm_neg] + dsimp only [a,atomicCellScale] + nlinarith [norm_nonneg y] + have hH := physical_ensemble_count S ψ T.ensemble T.law T.fermionic ho + (T.mass_eq.trans hm) hE hgap ha hb hsmall ht y hn hcs hos F + (fun p s => atomicPatchCap_slice_aestronglyMeasurable S (T.ensemble.vector p) s y) + (fun p s => Eventually.of_forall (fun x => atomicPatchCap_nonneg S _ x hy)) + (fun p s => atomicPatchCap_weight_integrable S hatom (T.ensemble.vector p) s hy) + (fun p s => Eventually.of_forall (fun x w hw => coreField_le_atomicPatchCap S hatom _ x hy + ((show ‖w-y‖≤t+b from by simpa only [Metric.mem_closedBall,dist_eq_norm] using hw).trans hwidth))) + change localCountSecondMoment ψ (Metric.closedBall y a)≤_ at hH + apply hH.trans + unfold atomicComparisonExpression + apply add_le_add le_rfl + apply mul_le_mul_of_nonneg_left _ (mul_nonneg (mul_nonneg (by norm_num) ha.le) (le_max_right _ _)) + have hB := thinIMS_sharp_budget ψ hm hδ hP hc hy hb hwidth + have hp := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hQ) + (show 0≤12*a*unitWindowKinetic/b^2 from div_nonneg (mul_nonneg (by positivity) unitWindowKinetic_nonneg) (sq_nonneg _)) + have hd := Real.sqrt_le_sqrt (mul_le_mul hQ hD hD0 hQ0) + have hf := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow hN0 hN (by norm_num : (0:ℝ)≤2/3)) + (show 0≤(b⁻¹)^2*((Real.pi^2/2)*neumannBoundary) by positivity [neumannBoundary_nonneg]) + have hn' := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hN) + (show 0≤(2*Real.pi+1)/(2*b) by positivity [Real.pi_pos]) + dsimp only [Q,N,m,a,P] at hp hd hf hn' hB ⊢ + linarith + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/ShellSummable.lean b/lean/OAI/Analysis/CoulombRadii/Screening/ShellSummable.lean new file mode 100644 index 0000000000000000000000000000000000000000..7249fedb47c4998a1127de961cfd1fb199132fc6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/ShellSummable.lean @@ -0,0 +1,115 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.UniformCountConsequences +import OAI.Analysis.CoulombRadii.Localization.ShellIMS + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical ContDiff Topology +noncomputable section +namespace Coulomb + +lemma screenMass_dilate {δ t q : ℝ} (hδ : 0≤δ) (ht : 0 linarith [hx.1,hx.2] + have hp := expectedPopulation_sq_le ψ (measurableSet_imsShell 0 u) hm + have hmom := localCountSecondMoment_mono ψ hA hsub + have hw : 0≤ screenMass δ u := by + dsimp only [screenMass] + linarith [screenBaseMass_ge_one u, Real.sqrt_nonneg (δ*u)] + have hs := Real.sq_sqrt hC + have hprod := mul_nonneg (Real.sqrt_nonneg C) hw + nlinarith [sq_nonneg (Real.sqrt C*screenMass δ u-expectedPopulation ψ (imsShell 0 u))] + +lemma dyadic_inverse_square_sum (k : ℕ) : + (∑ j ∈ Finset.range k, ((1/4:ℝ)^j)) ≤ 4/3 := by + have he : (∑ j ∈ Finset.range k, ((1/4:ℝ)^j)) = 4/3*(1-(1/4:ℝ)^k) := by + induction k with + | zero => simp + | succ k ih => rw [Finset.sum_range_succ,ih,pow_succ]; ring + rw [he] + have hp := pow_nonneg (by norm_num : (0:ℝ)≤1/4) k + linarith + +lemma dyadic_inverse_sum (k : ℕ) : + (∑ j ∈ Finset.range k, ((1/2:ℝ)^j)) ≤ 2 := by + have he : (∑ j ∈ Finset.range k, ((1/2:ℝ)^j)) = 2*(1-(1/2:ℝ)^k) := by + induction k with + | zero => simp + | succ k ih => rw [Finset.sum_range_succ,ih,pow_succ]; ring + rw [he] + have hp := pow_nonneg (by norm_num : (0:ℝ)≤1/2) k + linarith + +theorem exists_atomic_dyadic_IMS_bound : + ∃ C : ℝ, 0≤C ∧ ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E δ : ℝ}, (E:EReal)≤unrestrictedFormBottom S → form S ψ≤E+δ → 0≤δ → + ∀ {t : ℝ}, 0 hterm j) + _ = (3*radialCutCoefficient^2*C*screenMass δ t/t^2)*∑ j ∈ Finset.range k, (1/2:ℝ)^j := by + rw [Finset.mul_sum] + _ ≤ (3*radialCutCoefficient^2*C*screenMass δ t/t^2)*2 := + mul_le_mul_of_nonneg_left (dyadic_inverse_sum k) (by positivity) + _ = _ := by ring + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/UniformCountConsequences.lean b/lean/OAI/Analysis/CoulombRadii/Screening/UniformCountConsequences.lean new file mode 100644 index 0000000000000000000000000000000000000000..225f2f0ce7de8599235d083fbc074dac23c71cf2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/UniformCountConsequences.lean @@ -0,0 +1,139 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.CountScalar + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +def atomicCountConstant : ℝ := Classical.choose atomic_screenCountParameter_uniform +lemma atomicCountConstant_ge_two : 2 ≤ atomicCountConstant := + (Classical.choose_spec atomic_screenCountParameter_uniform).1 + +theorem screenCountParameter_le_atomicCountConstant {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) : screenCountParameter ψ δ ≤ atomicCountConstant := + (Classical.choose_spec atomic_screenCountParameter_uniform).2 S hatom ψ hψ hm hE hstate hδ + +lemma screenMass_square_bound {δ a : ℝ} (hδ : 0 ≤ δ) (ha : 0 < a) : + (screenMass δ a)^2 ≤ 2*(max ((a^6)⁻¹) 1+δ*a) := by + have hroot := Real.sq_sqrt (mul_nonneg hδ ha.le) + have hb : (screenBaseMass a)^2=max ((a^6)⁻¹) 1 := by + unfold screenBaseMass + have he : ((a^3)⁻¹)^2=(a^6)⁻¹ := by rw [←inv_pow,←pow_mul]; norm_num + rcases le_total ((a^3)⁻¹) 1 with H|H + · rw [max_eq_right H,one_pow,max_eq_right] + rw [←he] + nlinarith [inv_nonneg.mpr (pow_nonneg ha.le 3)] + · rw [max_eq_left H,max_eq_left] + · exact he + · rw [←he]; nlinarith + unfold screenMass + nlinarith [sq_nonneg (screenBaseMass a-Real.sqrt (δ*a))] + +theorem atomic_local_second_moment {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) {y : Space} (hy : y≠0) : + localCountSecondMoment ψ (Metric.closedBall y (atomicCellScale y)) ≤ + 2*atomicCountConstant*(max (((atomicCellScale y)^6)⁻¹) 1+δ*atomicCellScale y) := by + have hC : 0 ≤ atomicCountConstant := by linarith [atomicCountConstant_ge_two] + have H := (screenCountParameter_controls ψ hm δ hy).trans + (mul_le_mul_of_nonneg_right (screenCountParameter_le_atomicCountConstant S hatom ψ hψ hm hE hstate hδ) (sq_nonneg _)) + exact H.trans (by nlinarith [mul_le_mul_of_nonneg_left (screenMass_square_bound hδ (atomicCellScale_pos hy)) hC]) + +lemma exists_atomic_annular_mesh {α β : ℝ} (hα : 0 < α) : ∃ t : Finset Space, + (∀ z∈t, α ≤ ‖z‖ ∧ ‖z‖ ≤ β) ∧ + (∀ w : Space, α ≤ ‖w‖ → ‖w‖ ≤ β → ∃ z∈t, ‖w-z‖ < atomicCellScale z) := by + let B : Set Space := {z | α ≤ ‖z‖ ∧ ‖z‖ ≤ β} + have hc : IsCompact B := (isCompact_closedBall (0:Space) β).of_isClosed_subset + ((isClosed_le continuous_const continuous_norm).inter (isClosed_le continuous_norm continuous_const)) + (fun z hz => by simpa only [Metric.mem_closedBall,dist_zero_right] using hz.2) + have hp (z : B) : 0 < atomicCellScale z.val := atomicCellScale_pos (by + intro he; have H:=z.property.1; simpa [he] using hα.trans_le H) + have hcover : B ⊆ ⋃ z : B, Metric.ball z.val (atomicCellScale z.val) := by + intro w hw + exact Set.mem_iUnion.mpr ⟨⟨w,hw⟩,Metric.mem_ball_self (hp ⟨w,hw⟩)⟩ + obtain ⟨t,ht⟩ := hc.elim_finite_subcover (fun z : B => Metric.ball z.val (atomicCellScale z.val)) + (fun _ => Metric.isOpen_ball) hcover + refine ⟨t.image Subtype.val,?_,?_⟩ + · intro z hz + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp hz + exact v.property + · intro w hw1 hw2 + obtain ⟨z,hz⟩ := Set.mem_iUnion.mp (ht ⟨hw1,hw2⟩) + obtain ⟨hzt,hzw⟩ := Set.mem_iUnion.mp hz + exact ⟨z.val,Finset.mem_image.mpr ⟨z,hzt,rfl⟩,by simpa only [Metric.mem_ball,dist_eq_norm] using hzw⟩ + +lemma atomicCellScale_smul {u : ℝ} (hu : 0 ≤ u) (z : Space) : + atomicCellScale (u • z)=u*atomicCellScale z := by + simp only [atomicCellScale,norm_smul,Real.norm_eq_abs,abs_of_nonneg hu] + ring + +theorem atomic_annular_second_moment {α β : ℝ} (hα : 0 < α) (hαβ : α < β) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ {J n : ℕ} (S : Nuclei J), (∀ i, S.position i=0) → + ∀ (ψ : H1Vector n), Antisymmetric ψ → mass ψ=1 → + ∀ {E δ : ℝ}, (E:EReal) ≤ unrestrictedFormBottom S → form S ψ ≤ E+δ → 0 ≤ δ → + ∀ {u : ℝ}, 0 < u → + localCountSecondMoment ψ {x : Space | α*u < ‖x‖ ∧ ‖x‖ < β*u} ≤ C*(screenMass δ u)^2 := by + obtain ⟨t,ht,hcover⟩ := exists_atomic_annular_mesh (β:=β) hα + let q : ℝ := max 1 (max (100000/α) (β/100000)) + have hq : 1 ≤ q := le_max_left _ _ + have hqα : 100000/α ≤ q := (le_max_left _ _).trans (le_max_right _ _) + have hqβ : β/100000 ≤ q := (le_max_right _ _).trans (le_max_right _ _) + have hq0 : 0 < q := (div_pos (hα.trans hαβ) (by norm_num)).trans_le hqβ + let C : ℝ := (Fintype.card {z : Space // z∈t}:ℝ)^2*atomicCountConstant*q^6 + have hC0 : 0 ≤ atomicCountConstant := by linarith [atomicCountConstant_ge_two] + refine ⟨C,by dsimp [C]; positivity,?_⟩ + intro J n S hatom ψ hψ hm E δ hE hstate hδ u hu + let A := fun z : {z : Space // z∈t} => Metric.closedBall (u • z.val) (atomicCellScale (u • z.val)) + have hz0 (z : {z : Space // z∈t}) : z.val≠0 := by + intro he; have H:=(ht z.val z.property).1; simpa [he] using hα.trans_le H + have hmz (z : {z : Space // z∈t}) : screenMass δ (atomicCellScale (u • z.val)) ≤ q^3*screenMass δ u := by + apply screenMass_comparable hδ hu hq + · rw [atomicCellScale_smul hu.le] + apply (div_le_iff₀ hq0).mpr + have H := (div_le_iff₀ hα).mp hqα + have Hz := mul_le_mul_of_nonneg_left (ht z.val z.property).1 hq0.le + dsimp only [atomicCellScale] + nlinarith + · rw [atomicCellScale_smul hu.le] + apply mul_le_mul_of_nonneg_left _ hu.le + exact (div_le_div_of_nonneg_right (ht z.val z.property).2 (by norm_num)).trans hqβ + have hA : {x : Space | α*u < ‖x‖ ∧ ‖x‖ < β*u} ⊆ ⋃ z, A z := by + intro x hx + have hn : ‖u⁻¹ • x‖=‖x‖/u := by simp [norm_smul,abs_of_pos hu,div_eq_mul_inv,mul_comm] + have hlow : α ≤ ‖u⁻¹ • x‖ := by rw [hn]; exact (le_div_iff₀ hu).mpr hx.1.le + have hhigh : ‖u⁻¹ • x‖ ≤ β := by rw [hn]; exact (div_le_iff₀ hu).mpr hx.2.le + obtain ⟨z,hz,hxz⟩ := hcover (u⁻¹ • x) hlow hhigh + refine Set.mem_iUnion.mpr ⟨⟨z,hz⟩,?_⟩ + change ‖x-u • z‖ ≤ atomicCellScale (u • z) + rw [atomicCellScale_smul hu.le] + have hid : x-u • z=u • (u⁻¹ • x-z) := by simp [smul_sub,smul_smul,hu.ne'] + rw [hid,norm_smul,Real.norm_eq_abs,abs_of_pos hu] + exact mul_le_mul_of_nonneg_left hxz.le hu.le + have H := localCountSecondMoment_cover ψ A (fun _ => measurableSet_closedBall) hA + have Hc (z : {z : Space // z∈t}) : localCountSecondMoment ψ (A z) ≤ + atomicCountConstant*(q^3*screenMass δ u)^2 := by + have H0 := (screenCountParameter_controls ψ hm δ (smul_ne_zero hu.ne' (hz0 z))).trans + (mul_le_mul_of_nonneg_right (screenCountParameter_le_atomicCountConstant S hatom ψ hψ hm hE hstate hδ) (sq_nonneg _)) + exact H0.trans (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (screenMass_pos δ _).le (hmz z) 2) hC0) + apply H.trans + have HH := mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun z (_ : z∈Finset.univ) => Hc z)) + (show 0 ≤ (Fintype.card {z : Space // z∈t}:ℝ) by positivity) + apply HH.trans_eq + simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,C] + ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Screening/UpperDeficit.lean b/lean/OAI/Analysis/CoulombRadii/Screening/UpperDeficit.lean new file mode 100644 index 0000000000000000000000000000000000000000..0cc5220c31bcc117383a2f379d5ff2f84a39f1c8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Screening/UpperDeficit.lean @@ -0,0 +1,94 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.NewtonInterior + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb + +def atomicInnerFieldConstant : ℝ := + 2*atomicBudgetRecursionC^2*Real.sqrt atomicCountConstant*(100000:ℝ)^4+2501*atomicTailConstant +lemma atomicInnerFieldConstant_nonneg : 0 ≤ atomicInnerFieldConstant := by + unfold atomicInnerFieldConstant + exact add_nonneg (by positivity) (mul_nonneg (by norm_num) atomicTailConstant_nonneg) + +lemma atomic_inner_field_shell_bound {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) {h : ℝ} (hh : 0 < h) {y : Space} (hy : y∈radialShell h) : + atomicInnerField S ψ h y ≤ atomicInnerFieldConstant*screenMass δ h/h := by + have hlo : h ≤ ‖y‖ := by simpa only [radialShell,Metric.mem_ball,dist_zero_right,not_lt] using hy.2 + have hhi : ‖y‖ ≤ 2*h := (by simpa only [radialShell,Metric.mem_ball,dist_zero_right] using hy.1 : ‖y‖ < 2*h).le + have hy0 : y≠0 := norm_pos_iff.mp (hh.trans_le hlo) + have ha := atomicCellScale_pos hy0 + have hlowa : h/100000 ≤ atomicCellScale y := by dsimp only [atomicCellScale]; linarith + have hhigha : atomicCellScale y ≤ h*100000 := by dsimp only [atomicCellScale]; linarith + have hc := screenMass_comparable hδ hh (show (1:ℝ) ≤ 100000 by norm_num) hlowa hhigha + have hm0 := (screenMass_pos δ h).le + have hunit : screenFieldUnit δ atomicCountConstant (atomicCellScale y) ≤ + Real.sqrt atomicCountConstant*(100000:ℝ)^4*screenMass δ h/h := by + calc + _ ≤ (Real.sqrt atomicCountConstant*((100000:ℝ)^3*screenMass δ h))/(atomicCellScale y) := + div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hc (Real.sqrt_nonneg _)) ha.le + _ ≤ (Real.sqrt atomicCountConstant*((100000:ℝ)^3*screenMass δ h))/(h/100000) := + div_le_div_of_nonneg_left (by positivity) (by positivity) hlowa + _ = _ := by field_simp + have H := atomic_inner_field_bound S hatom ψ hψ hm hE hstate hδ hh hy0 + apply H.trans + have HH := mul_le_mul_of_nonneg_left hunit (show 0 ≤ 2*atomicBudgetRecursionC^2 by positivity) + have he : atomicInnerFieldConstant*screenMass δ h/h= + 2*atomicBudgetRecursionC^2*(Real.sqrt atomicCountConstant*(100000:ℝ)^4*screenMass δ h/h)+ + 2501*atomicTailConstant*screenMass δ h/h := by unfold atomicInnerFieldConstant; ring + rw [he] + exact add_le_add HH le_rfl + +theorem atomic_inner_deficit_upper {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal) ≤ unrestrictedFormBottom S) (hstate : form S ψ ≤ E+δ) + (hδ : 0 ≤ δ) {h : ℝ} (hh : 0 < h) : + totalCharge S-expectedPopulation ψ (Metric.ball 0 h) ≤ + 2*atomicInnerFieldConstant*screenMass δ h := by + have hm0 := (screenMass_pos δ h).le + have hR : 0 ≤ 2*atomicInnerFieldConstant*screenMass δ h := + mul_nonneg (mul_nonneg (by norm_num) atomicInnerFieldConstant_nonneg) hm0 + by_cases hd : totalCharge S-expectedPopulation ψ (Metric.ball 0 h) ≤ 0 + · exact hd.trans hR + have hd0 := (not_le.mp hd).le + have hAttr : Integrable (fun y => attraction S y*radialShellDensity h y) := by + simp_rw [attraction_atomic S hatom,div_eq_mul_inv,mul_assoc] + exact (radialShellMoment_integrable h).const_mul (totalCharge S) + have hCore := restrictedCorePotential_mul_integrable ψ (A:=Metric.ball 0 h) measurableSet_ball _ (radialShellDensity_integrable h) + have hInt : Integrable (fun y => atomicInnerField S ψ h y*radialShellDensity h y) := by + convert hAttr.sub hCore using 1 + first | rfl | (ext y; simp only [atomicInnerField,Pi.sub_apply]; ring) + have hAv : (totalCharge S-expectedPopulation ψ (Metric.ball 0 h))*radialShellMoment h ≤ + (atomicInnerFieldConstant*screenMass δ h/h)*(∫ y,radialShellDensity h y) := by + rw [←atomicInnerField_shell_average S hatom ψ hh,←integral_const_mul] + apply integral_mono hInt ((radialShellDensity_integrable h).const_mul _) + intro y + by_cases hy : y∈radialShell h + · exact mul_le_mul_of_nonneg_right (atomic_inner_field_shell_bound S hatom ψ hψ hm hE hstate hδ hh hy) + (radialShellDensity_nonneg h y) + · simp only [radialShellDensity,indicator_of_notMem hy,mul_zero,le_refl] + have hb := radialShellMoment_lower hh + have hmass : 0 < ∫ y,radialShellDensity h y := by rw [radialShellDensity_mass hh]; positivity + have hfrac : 0 < (∫ y,radialShellDensity h y)/(2*h) := div_pos hmass (by positivity) + calc + _ ≤ ((totalCharge S-expectedPopulation ψ (Metric.ball 0 h))*radialShellMoment h)/ + ((∫ y,radialShellDensity h y)/(2*h)) := + (le_div_iff₀ hfrac).mpr (mul_le_mul_of_nonneg_left hb hd0) + _ ≤ ((atomicInnerFieldConstant*screenMass δ h/h)*(∫ y,radialShellDensity h y))/ + ((∫ y,radialShellDensity h y)/(2*h)) := div_le_div_of_nonneg_right hAv hfrac.le + _ = _ := by field_simp [hh.ne',hmass.ne'] + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/AmbientEigen.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/AmbientEigen.lean new file mode 100644 index 0000000000000000000000000000000000000000..5795b40ecf79dc9982f1ed204e3882f25c01cacd --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/AmbientEigen.lean @@ -0,0 +1,224 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.SortedCut +import OAI.Analysis.CoulombRadii.SpectralTheory.SectorBottomBridge +import OAI.Analysis.CoulombRadii.FormDomain.H1Pairing + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical +noncomputable section +namespace Coulomb +lemma massPair_congr {n:ℕ} (u v u' v':H1Vector n) + (hu:∀ s,u.value s=ᵐ[volume]u'.value s) (hv:∀ s,v.value s=ᵐ[volume]v'.value s) : + massPair u v=massPair u' v' := by + unfold massPair + apply Finset.sum_congr rfl + intro s _ + apply integral_congr_ae + filter_upwards [hu s,hv s] with x hx hy + rw [hx,hy] +lemma formPair_congr {M n:ℕ} (S:Nuclei M) (u v u' v':H1Vector n) + (hu:∀ s,u.value s=ᵐ[volume]u'.value s) (hv:∀ s,v.value s=ᵐ[volume]v'.value s) : + formPair S u v=formPair S u' v' := by + have he:∀ s,(u.add v).value s=ᵐ[volume](u'.add v').value s:=fun s => (hu s).add (hv s) + have hh:=form_congr_ae S (u.add v) (u'.add v') he + linarith [formPair_polarization S u v,formPair_polarization S u' v',form_congr_ae S u u' hu,form_congr_ae S v v' hv] +lemma massPair_symm {n:ℕ} (u v:H1Vector n) : massPair u v=massPair v u := by + simp only [massPair,real_inner_comm] +lemma formPair_symm {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) : formPair S u v=formPair S v u := by + simp only [formPair,kineticPair,nuclearPair,repulsionPair,real_inner_comm] +lemma massPair_rsmul_right {n:ℕ} (u v:H1Vector n) (t:ℝ) : massPair u (v.rsmul t)=t*massPair u v := by + simp only [massPair,H1Vector.rsmul,←Complex.real_smul,real_inner_smul_right,integral_const_mul,Finset.mul_sum] +lemma formPair_rsmul_right {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) (t:ℝ) : + formPair S u (v.rsmul t)=t*formPair S u v := by + unfold formPair kineticPair nuclearPair repulsionPair + simp only [H1Vector.rsmul,←Complex.real_smul,real_inner_smul_right] + simp_rw [mul_left_comm _ t,integral_const_mul,←Finset.mul_sum] + ring +lemma massPair_rsmul_left {n:ℕ} (u v:H1Vector n) (t:ℝ) : massPair (u.rsmul t) v=t*massPair u v := by + rw [massPair_symm,massPair_rsmul_right,massPair_symm v u] +lemma formPair_rsmul_left {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) (t:ℝ) : + formPair S (u.rsmul t) v=t*formPair S u v := by + rw [formPair_symm,formPair_rsmul_right,formPair_symm S v u] +lemma massPair_permutation {n:ℕ} (u v:H1Vector n) (p:Equiv.Perm (Fin n)) : + massPair (u.permutation p) (v.permutation p)=massPair u v := by + have he:∀ s,((u.add v).permutation p).value s=ᵐ[volume]((u.permutation p).add (v.permutation p)).value s := + fun s => Eventually.of_forall fun x => by simp only [permutation_value,H1Vector.add] + have hh:=mass_congr_ae _ _ he + rw [mass_permutation] at hh + have h:=massPair_polarization (u.permutation p) (v.permutation p) + rw [mass_permutation,mass_permutation,←hh] at h + linarith [massPair_polarization u v] +lemma formPair_permutation {M n:ℕ} (S:Nuclei M) (u v:H1Vector n) (p:Equiv.Perm (Fin n)) : + formPair S (u.permutation p) (v.permutation p)=formPair S u v := by + have he:∀ s,((u.add v).permutation p).value s=ᵐ[volume]((u.permutation p).add (v.permutation p)).value s := + fun s => Eventually.of_forall fun x => by simp only [permutation_value,H1Vector.add] + have hh:=form_congr_ae S _ _ he + rw [form_permutation] at hh + have h:=formPair_polarization S (u.permutation p) (v.permutation p) + rw [form_permutation,form_permutation,←hh] at h + linarith [formPair_polarization S u v] +lemma massPair_finiteSum {n:ℕ} {ι:Type*} [Fintype ι] (u:H1Vector n) (v:ι → H1Vector n) : + massPair u (H1Vector.finiteSum v)=∑ i,massPair u (v i) := by + unfold massPair + simp only [H1Vector.finiteSum,inner_sum] + simp_rw [integral_finsetSum _ (fun i _ => memlp_real_inner_integrable (u.value_L2 _) ((v i).value_L2 _))] + exact Finset.sum_comm +lemma formPair_finiteSum {M n:ℕ} {ι:Type*} [Fintype ι] (S:Nuclei M) (u:H1Vector n) (v:ι → H1Vector n) : + formPair S u (H1Vector.finiteSum v)=∑ i,formPair S u (v i) := by + have hT:kineticPair u (H1Vector.finiteSum v)=∑ i,kineticPair u (v i) := by + unfold kineticPair + simp only [H1Vector.finiteSum,inner_sum] + simp_rw [integral_finsetSum _ (fun i _ => formPair_kinetic_integrable u (v i) _ _)] + rw [←Finset.mul_sum] + congr 1 + calc + _ = ∑ s,∑ i,∑ a,∫ x,inner ℝ (u.gradient s a x) ((v i).gradient s a x) := + Finset.sum_congr rfl (fun s _ => Finset.sum_comm) + _ = _ := Finset.sum_comm + have hN:nuclearPair S u (H1Vector.finiteSum v)=∑ i,nuclearPair S u (v i) := by + unfold nuclearPair + simp only [H1Vector.finiteSum,inner_sum,Finset.mul_sum] + simp_rw [integral_finsetSum _ (fun i _ => formPair_nuclear_integrable S u (v i) _)] + exact Finset.sum_comm + have hP:repulsionPair u (H1Vector.finiteSum v)=∑ i,repulsionPair u (v i) := by + unfold repulsionPair + simp only [H1Vector.finiteSum,inner_sum,Finset.mul_sum] + simp_rw [integral_finsetSum _ (fun i _ => formPair_repulsion_integrable u (v i) _)] + exact Finset.sum_comm + simp only [formPair,hT,hN,hP,Finset.sum_add_distrib,Finset.sum_sub_distrib] + +lemma sector_minimizer_ambient_eigen (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} + (u:H1Vector n) (ha:Antisymmetric u) (hm:mass u=1) + (hmin:(form (atom Z hZ) u:EReal)=sectorFormBottom (atom Z hZ) n) + (v:H1Vector n) : + formPair (atom Z hZ) u v=form (atom Z hZ) u*massPair u v := by + let sign:=fun p:Equiv.Perm (Fin n) => ((p.sign:ℤ):ℝ) + let av:=H1Vector.finiteSum (fun p:Equiv.Perm (Fin n) => (v.permutation p).rsmul (sign p)) + have he:∀ s,av.value s=ᵐ[volume]v.fullAntisymmetrize.value s:= by + intro s + exact Eventually.of_forall fun x => by simp [av,fullAntisymmetrize_value,H1Vector.finiteSum,H1Vector.rsmul,sign,permutation_value] + have hav:Antisymmetric av := by + intro p s + filter_upwards [he (s ∘ p) |>.comp_tendsto (permute_measurePreserving p).quasiMeasurePreserving.tendsto_ae, + he s,fullAntisymmetrize_antisymmetric v p s] with x hx hy hz + dsimp only [Function.comp_apply] at hx + rw [hx,hz,←hy] + have hp(p:Equiv.Perm (Fin n)):∀ s,(u.permutation p).value s=ᵐ[volume](u.rsmul (sign p)).value s := by + intro s + filter_upwards [ha p s] with x hx + simpa only [permutation_value,H1Vector.rsmul,sign,Complex.ofReal_intCast] using hx + have hform:formPair (atom Z hZ) u av=(Fintype.card (Equiv.Perm (Fin n)):ℝ)*formPair (atom Z hZ) u v := by + rw [formPair_finiteSum] + calc + _ = ∑ _p:Equiv.Perm (Fin n),formPair (atom Z hZ) u v := by + apply Finset.sum_congr rfl + intro p _ + rw [formPair_rsmul_right,←formPair_rsmul_left] + rw [←formPair_congr (atom Z hZ) (u.permutation p) (v.permutation p) _ _ (hp p) (fun _ => EventuallyEq.rfl)] + exact formPair_permutation _ _ _ _ + _ = _ := by simp + have hmass:massPair u av=(Fintype.card (Equiv.Perm (Fin n)):ℝ)*massPair u v := by + rw [massPair_finiteSum] + calc + _ = ∑ _p:Equiv.Perm (Fin n),massPair u v := by + apply Finset.sum_congr rfl + intro p _ + rw [massPair_rsmul_right,←massPair_rsmul_left] + rw [←massPair_congr (u.permutation p) (v.permutation p) _ _ (hp p) (fun _ => EventuallyEq.rfl)] + exact massPair_permutation _ _ _ + _ = _ := by simp + have H:=sector_minimizer_weak_eigen Z hZ u ha hm hmin av hav + rw [hform,hmass] at H + have hc:0<(Fintype.card (Equiv.Perm (Fin n)):ℝ):=by exact_mod_cast Fintype.card_pos + nlinarith +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace Coulomb +lemma inner_double_real (a:ℂ) (f:ℝ) : + inner ℝ a ((f:ℂ)*((f:ℂ)*a))=‖(f:ℂ)*a‖^2 := by + simp only [←Complex.real_smul,real_inner_smul_right,real_inner_self_eq_norm_sq, + norm_smul,Real.norm_eq_abs,mul_pow,sq_abs] + ring +lemma weighted_core_inequality (Z:ℕ) (hZ:1≤Z) {k:ℕ} + (u:H1Vector (1+k)) (ha:Antisymmetric u) (hm:mass u=1) + (hmin:(form (atom Z hZ) u:EReal)=sectorFormBottom (atom Z hZ) (1+k)) + (f:Configuration (1+k) → ℝ) (hf:ContDiff ℝ ∞ f) + (B D:ℝ) (hB:∀ x,|f x|≤B) + (hD:∀ a x,|fderiv ℝ f x (EuclideanSpace.single a 1)|≤D) + (hcore:∀ (a:Fin k × Fin 3) x,fderiv ℝ f x (EuclideanSpace.single (Fin.natAdd 1 a.1,a.2) 1)=0) + (hperm:∀ (p:Equiv.Perm (Fin k)) x,f (permute (corePerm 1 p) x)=f x) + (hkin:let z:=u.smoothMul f hf B D hB hD + let v:=z.smoothMul f hf B D hB hD + 0≤∑ s,∑ a:Fin 3,∫ x,inner ℝ (u.gradient s (0,a) x) (v.gradient s (0,a) x)) : + let z:=u.smoothMul f hf B D hB hD + potentialForm (fun x => crossPotential ((joinConfiguration 1 k).symm x).1 + ((joinConfiguration 1 k).symm x).2) z ≤ + potentialForm (fun x => nuclearPotential (atom Z hZ) ((joinConfiguration 1 k).symm x).1) z := by + let z:=u.smoothMul f hf B D hB hD + let v:=z.smoothMul f hf B D hB hD + have hi(s:Spins (1+k))(x:Configuration (1+k)): + inner ℝ (u.value s x) (v.value s x)=‖z.value s x‖^2:=inner_double_real _ _ + have hmz:massPair u v=mass z := by simp only [massPair,mass,hi] + have hnz:nuclearPair (atom Z hZ) u v=nuclearEnergy (atom Z hZ) z := by + simp only [nuclearPair,nuclearEnergy,hi] + have hpz:repulsionPair u v=pairEnergy z := by simp only [repulsionPair,pairEnergy,hi,pairPotential] + have hg(s:Spins (1+k))(a:Fin k × Fin 3)(x:Configuration (1+k)): + inner ℝ (u.gradient s (Fin.natAdd 1 a.1,a.2) x) + (v.gradient s (Fin.natAdd 1 a.1,a.2) x)= + ‖z.gradient s (Fin.natAdd 1 a.1,a.2) x‖^2 := by + simp only [v,z,H1Vector.smoothMul,hcore,Complex.ofReal_zero,zero_mul,zero_add] + exact inner_double_real _ _ + have hk:kineticPair u v=coreKinetic z+ + (1/2:ℝ)*(∑ s,∑ a:Fin 3,∫ x,inner ℝ (u.gradient s (0,a) x) (v.gradient s (0,a) x)) := by + unfold kineticPair coreKinetic + simp only [Fintype.sum_prod_type,Fin.sum_univ_add,Fin.sum_univ_one,Finset.sum_add_distrib] + have hg' (s:Spins (1+k))(i:Fin k)(a:Fin 3)(x:Configuration (1+k)) := hg s (i,a) x + simp only [hg',show Fin.castAdd k (0:Fin 1)=(0:Fin (1+k)) from rfl] + ring + have he:=sector_minimizer_ambient_eigen Z hZ u ha hm hmin v + rw [formPair,hk,hnz,hpz,hmz] at he + have hanti:∀ s:Spins 1,∀ᵐ x,Antisymmetric (z.coreSlice s x) := by + intro s + apply z.coreSlice_antisymmetric + intro p t + filter_upwards [ha (corePerm 1 p) (Fin.append s t)] with x hx + change (f (permute (corePerm 1 p) x):ℂ)*u.value _ (permute (corePerm 1 p) x)=_ + rw [hperm,hx] + change (f x:ℂ)*(_*u.value _ x)=_ *((f x:ℂ)*u.value _ x) + ring + have hs:=slice_core_form_ge_sector (atom Z hZ) z hanti + (P:=form (atom Z hZ) u) + (hmin.le.trans (atom_sectorFormBottom_antitone Z hZ (by omega : k≤1+k))) + change _≤∑ s:Spins 1,∫ x,mass (z.coreSlice s x)*form (atom Z hZ) (z.coreSlice s x).normalized at hs + rw [conditional_core_form_identity] at hs + rw [nuclearEnergy_split,pairEnergy_split] at he + have houter:0≤potentialForm (fun x => pairPotential ((joinConfiguration 1 k).symm x).1) z := by + apply Finset.sum_nonneg + intro s _ + exact integral_nonneg fun x => mul_nonneg (by + unfold pairPotential + apply Finset.sum_nonneg + intro i _ + apply Finset.sum_nonneg + intro j _ + split_ifs + · exact inv_nonneg.mpr (norm_nonneg _) + · rfl) (sq_nonneg _) + dsimp only at hkin ⊢ + change _≤_ + linarith only [he,hs,houter,hkin] +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/BindingBump.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/BindingBump.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a55a7d16acdfeed033741b1b5280ddf3fa16c2b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/BindingBump.lean @@ -0,0 +1,436 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Localization.SmoothMultiplier +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +def bindingBump : ContDiffBump (0 : Position) := + ⟨1, 2, by norm_num, by norm_num⟩ + +def bindingCutoff (n : ℕ) (x : Configuration n) : ℝ := + ∏ i : Fin n, bindingBump (x i) + +theorem bindingCutoff_smooth (n : ℕ) : ContDiff ℝ ∞ (bindingCutoff n) := by + exact contDiff_prod fun i _ => bindingBump.contDiff.comp (contDiff_apply ℝ Position i) + +theorem bindingCutoff_symmetric (n : ℕ) (p : Equiv.Perm (Fin n)) + (x : Configuration n) : bindingCutoff n (x ∘ p) = bindingCutoff n x := by + exact Equiv.prod_comp p (fun i => bindingBump (x i)) + +theorem bindingCutoff_nonneg (n : ℕ) (x : Configuration n) : 0 ≤ bindingCutoff n x := + Finset.prod_nonneg fun _ _ => bindingBump.nonneg + +theorem bindingCutoff_le_one (n : ℕ) (x : Configuration n) : bindingCutoff n x ≤ 1 := by + exact Finset.prod_le_one₀ (fun _ _ => bindingBump.nonneg) (fun _ _ => bindingBump.le_one) + +theorem bindingCutoff_eq_one {n : ℕ} {x : Configuration n} (hx : ‖x‖ ≤ 1) : + bindingCutoff n x = 1 := by + apply Finset.prod_eq_one + intro i _ + apply bindingBump.one_of_mem_closedBall + simpa [bindingBump, Metric.mem_closedBall, dist_zero_right] using + (norm_le_pi_norm x i).trans hx + +theorem bindingCutoff_eq_zero {n : ℕ} {x : Configuration n} (hx : 2 < ‖x‖) : + bindingCutoff n x = 0 := by + have he : ∃ i : Fin n, 2 < ‖x i‖ := by + by_contra! h + exact (not_lt_of_ge ((pi_norm_le_iff_of_nonneg (by norm_num : (0:ℝ) ≤ 2)).mpr h)) hx + obtain ⟨i, hi⟩ := he + exact Finset.prod_eq_zero (Finset.mem_univ i) + (bindingBump.zero_of_le_dist (by simpa [bindingBump] using hi.le)) + +theorem bindingCutoff_compact (n : ℕ) : HasCompactSupport (bindingCutoff n) := by + apply HasCompactSupport.intro (isCompact_closedBall (0 : Configuration n) 2) + intro x hx + apply bindingCutoff_eq_zero + simpa [Metric.mem_closedBall, dist_zero_right] using hx + +theorem bindingCutoff_derivative_bounded (n : ℕ) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ x, ‖fderiv ℝ (bindingCutoff n) x‖ ≤ C := by + obtain ⟨C, hC⟩ := (bindingCutoff_smooth n).continuous_fderiv (by simp) + |>.bounded_above_of_compact_support ((bindingCutoff_compact n).fderiv ℝ) + exact ⟨C, (norm_nonneg _).trans (hC 0), hC⟩ + +def bindingScale (k : ℕ) : ℝ := ((k : ℝ)+1)⁻¹ + +def expandingCutoff (n k : ℕ) (x : Configuration n) : ℝ := + bindingCutoff n (bindingScale k • x) + +theorem bindingScale_pos (k : ℕ) : 0 < bindingScale k := + inv_pos.mpr (by positivity) + +theorem bindingScale_le_one (k : ℕ) : bindingScale k ≤ 1 := by + apply inv_le_one_of_one_le₀ + have := Nat.cast_nonneg (α := ℝ) k + linarith + +theorem bindingScale_tendsto : Tendsto bindingScale atTop (𝓝 0) := by + exact tendsto_inv_atTop_zero.comp + (tendsto_natCast_atTop_atTop.atTop_add tendsto_const_nhds) + +theorem expandingCutoff_smooth (n k : ℕ) : ContDiff ℝ ∞ (expandingCutoff n k) := by + apply (bindingCutoff_smooth n).comp + exact (contDiff_const (c := bindingScale k)).smul contDiff_id + +theorem expandingCutoff_nonneg (n k : ℕ) (x : Configuration n) : + 0 ≤ expandingCutoff n k x := bindingCutoff_nonneg _ _ + +theorem expandingCutoff_le_one (n k : ℕ) (x : Configuration n) : + expandingCutoff n k x ≤ 1 := bindingCutoff_le_one _ _ + +theorem expandingCutoff_fderiv (n k : ℕ) (x v : Configuration n) : + fderiv ℝ (expandingCutoff n k) x v = + bindingScale k * fderiv ℝ (bindingCutoff n) (bindingScale k • x) v := by + have hf := ((bindingCutoff_smooth n).differentiable (by simp) (bindingScale k • x)).hasFDerivAt + have hc := (hasFDerivAt_id (𝕜 := ℝ) x).const_smul (bindingScale k) + have hh := (hf.comp x hc).fderiv + change fderiv ℝ (bindingCutoff n ∘ fun x => bindingScale k • x) x v = _ + rw [hh] + simp + +theorem expandingCutoff_multiplier (n k : ℕ) : SmoothMultiplier (expandingCutoff n k) := by + refine ⟨expandingCutoff_smooth n k, ?_, ⟨1, fun x => ?_⟩, ?_⟩ + · intro p x + exact bindingCutoff_symmetric n p (bindingScale k • x) + · rw [abs_of_nonneg (expandingCutoff_nonneg _ _ _)] + exact expandingCutoff_le_one _ _ _ + · intro i a + obtain ⟨C, hC, hb⟩ := bindingCutoff_derivative_bounded n + refine ⟨C*‖coordinateDirection i a‖, fun x => ?_⟩ + rw [expandingCutoff_fderiv, abs_mul, abs_of_pos (bindingScale_pos k)] + calc + bindingScale k * |fderiv ℝ (bindingCutoff n) (bindingScale k • x) + (coordinateDirection i a)| ≤ + 1*(C*‖coordinateDirection i a‖) := by + apply mul_le_mul (bindingScale_le_one k) _ (abs_nonneg _) (by norm_num) + exact ((fderiv ℝ (bindingCutoff n) (bindingScale k • x)).le_opNorm _).trans + (mul_le_mul_of_nonneg_right (hb _) (norm_nonneg _)) + _ = _ := one_mul _ + +theorem expandingCutoff_tendsto (n : ℕ) (x : Configuration n) : + Tendsto (fun k => expandingCutoff n k x) atTop (𝓝 1) := by + have ht := ((bindingCutoff_smooth n).continuous.tendsto 0).comp + (by simpa using bindingScale_tendsto.smul_const x) + simpa [Function.comp_def, expandingCutoff, bindingCutoff_eq_one (by simp : ‖(0 : Configuration n)‖ ≤ 1)] using ht + +theorem expandingCutoff_fderiv_tendsto (n : ℕ) (x v : Configuration n) : + Tendsto (fun k => fderiv ℝ (expandingCutoff n k) x v) atTop (𝓝 0) := by + simp_rw [expandingCutoff_fderiv] + have ht := (((bindingCutoff_smooth n).continuous_fderiv (by simp)).clm_apply + (continuous_const (y := v))).tendsto 0 |>.comp (by simpa using bindingScale_tendsto.smul_const x) + simpa using bindingScale_tendsto.mul ht + +theorem expandingCutoff_eq_zero {n k : ℕ} {x : Configuration n} + (hx : 2*((k:ℝ)+1) < ‖x‖) : expandingCutoff n k x = 0 := by + apply bindingCutoff_eq_zero + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (bindingScale_pos k)] + dsimp [bindingScale] + rw [← div_eq_inv_mul] + exact (lt_div_iff₀ (by positivity)).mpr hx + +theorem expandingCutoff_derivative_uniform_bound (n : ℕ) (i : Fin n) (a : Fin 3) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ k x, + |fderiv ℝ (expandingCutoff n k) x (coordinateDirection i a)| ≤ C := by + obtain ⟨C, hC, hb⟩ := bindingCutoff_derivative_bounded n + refine ⟨C*‖coordinateDirection i a‖, mul_nonneg hC (norm_nonneg _), fun k x => ?_⟩ + rw [expandingCutoff_fderiv, abs_mul, abs_of_pos (bindingScale_pos k)] + calc + _ ≤ 1*(C*‖coordinateDirection i a‖) := by + apply mul_le_mul (bindingScale_le_one k) _ (abs_nonneg _) (by norm_num) + exact ((fderiv ℝ (bindingCutoff n) (bindingScale k • x)).le_opNorm _).trans + (mul_le_mul_of_nonneg_right (hb _) (norm_nonneg _)) + _ = _ := one_mul _ + +theorem integral_expandingCutoff_sq_tendsto {n : ℕ} {f : Configuration n → ℝ} + (hf : Integrable f) : + Tendsto (fun k => ∫ x, (expandingCutoff n k x)^2 * f x) atTop (𝓝 (∫ x, f x)) := by + apply tendsto_integral_of_dominated_convergence (fun x => ‖f x‖) + · intro k + exact ((expandingCutoff_smooth n k).continuous.aestronglyMeasurable.pow 2).mul + hf.aestronglyMeasurable + · exact hf.norm + · intro k + exact Eventually.of_forall fun x => by + rw [norm_mul, Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + exact mul_le_of_le_one_left (norm_nonneg _) (pow_le_one₀ + (expandingCutoff_nonneg _ _ _) (expandingCutoff_le_one _ _ _)) + · exact Eventually.of_forall fun x => by + simpa using ((expandingCutoff_tendsto n x).pow 2).mul_const (f x) + +theorem normSquared_cutoff_tendsto {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) : + Tendsto (fun k => normSquared (multiplyWavefunction (expandingCutoff n k) ψ)) + atTop (𝓝 (normSquared ψ)) := by + simp only [normSquared, norm_multiplyWavefunction_sq] + exact tendsto_finsetSum _ fun σ _ => + integral_expandingCutoff_sq_tendsto (hd.2.2.1 σ).norm.integrable_sq + +theorem kinetic_cutoff_tendsto {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) (σ : Spins n) (i : Fin n) (a : Fin 3) : + Tendsto (fun k => ∫ x, ‖multiplyGradient (expandingCutoff n k) ψ g σ i a x‖^2) + atTop (𝓝 (∫ x, ‖g σ i a x‖^2)) := by + obtain ⟨C, hC, hb⟩ := expandingCutoff_derivative_uniform_bound n i a + apply tendsto_integral_of_dominated_convergence + (fun x => 2*C^2*‖ψ σ x‖^2 + 2*‖g σ i a x‖^2) + · intro k + exact ((hd.multiply (expandingCutoff_multiplier n k)).2.2.2.1 σ i a).norm.aestronglyMeasurable.pow 2 + · exact ((hd.2.2.1 σ).norm.integrable_sq.const_mul (2*C^2)).add + ((hd.2.2.2.1 σ i a).norm.integrable_sq.const_mul 2) + · intro k + exact Eventually.of_forall fun x => by + have h1 : ‖multiplyGradient (expandingCutoff n k) ψ g σ i a x‖ ≤ + C*‖ψ σ x‖+‖g σ i a x‖ := by + unfold multiplyGradient + apply (norm_add_le _ _).trans + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (expandingCutoff_nonneg _ _ _)] + exact add_le_add (mul_le_mul_of_nonneg_right (hb k x) (norm_nonneg _)) + (mul_le_of_le_one_left (norm_nonneg _) (expandingCutoff_le_one _ _ _)) + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + have h2 := pow_le_pow_left₀ (norm_nonneg _) h1 2 + nlinarith [sq_nonneg (C*‖ψ σ x‖-‖g σ i a x‖)] + · exact Eventually.of_forall fun x => by + have h1 := (expandingCutoff_fderiv_tendsto n x (coordinateDirection i a)).smul_const (ψ σ x) + have h2 := (expandingCutoff_tendsto n x).smul_const (g σ i a x) + simpa [multiplyGradient] using (h1.add h2).norm.pow 2 + +theorem energy_cutoff_tendsto {n : ℕ} (Z : ℕ) {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) : + Tendsto (fun k => energy Z (multiplyWavefunction (expandingCutoff n k) ψ) + (multiplyGradient (expandingCutoff n k) ψ g)) atTop (𝓝 (energy Z ψ g)) := by + apply Tendsto.add + · apply Tendsto.const_mul + exact tendsto_finsetSum _ fun σ _ => tendsto_finsetSum _ fun i _ => + tendsto_finsetSum _ fun a _ => kinetic_cutoff_tendsto hd σ i a + · apply tendsto_finsetSum + intro σ _ + have h := integral_expandingCutoff_sq_tendsto (hd.integrable_potential Z σ) + convert h using 1 + funext k + apply integral_congr_ae + exact Eventually.of_forall fun x => by dsimp only; rw [norm_multiplyWavefunction_sq]; ring + +theorem expandingCutoff_fderiv_eq_zero {n k : ℕ} {x : Configuration n} + (hx : 2*((k:ℝ)+1) < ‖x‖) : fderiv ℝ (expandingCutoff n k) x = 0 := by + have he : expandingCutoff n k =ᶠ[𝓝 x] (fun _ => 0) := by + filter_upwards [(isOpen_lt continuous_const continuous_norm).mem_nhds hx] with y hy + exact expandingCutoff_eq_zero hy + simpa using he.fderiv_eq + +theorem FormDomain.exists_compact_approximation {n : ℕ} (Z : ℕ) + {ψ : Wavefunction n} {g : Gradient n} (hd : FormDomain ψ g) + (hn : normSquared ψ = 1) {ε : ℝ} (hε : 0 < ε) : + ∃ (R : ℝ) (χ : Wavefunction n) (h : Gradient n), 0 < R ∧ + FormDomain χ h ∧ normSquared χ = 1 ∧ energy Z χ h < energy Z ψ g + ε ∧ + (∀ σ x, R < ‖x‖ → χ σ x = 0) ∧ + (∀ σ i a x, R < ‖x‖ → h σ i a x = 0) := by + let χ : ℕ → Wavefunction n := fun k => multiplyWavefunction (expandingCutoff n k) ψ + let h : ℕ → Gradient n := fun k => multiplyGradient (expandingCutoff n k) ψ g + let c : ℕ → ℝ := fun k => (Real.sqrt (normSquared (χ k)))⁻¹ + have hnorm : Tendsto (fun k => normSquared (χ k)) atTop (𝓝 1) := by + simpa [hn] using normSquared_cutoff_tendsto hd + have hc : Tendsto c atTop (𝓝 1) := by + have ht := (Real.continuous_sqrt.tendsto 1).comp hnorm + have hi := ht.inv₀ (by norm_num : Real.sqrt (1 : ℝ) ≠ 0) + simpa [c] using hi + have he : Tendsto (fun k => energy Z (scaleWavefunction (c k) (χ k)) + (scaleGradient (c k) (h k))) atTop (𝓝 (energy Z ψ g)) := by + simp_rw [energy_scale] + simpa only [one_pow, one_mul] using (hc.pow 2).mul (energy_cutoff_tendsto Z hd) + have hpos : ∀ᶠ k in atTop, 0 < normSquared (χ k) := + hnorm.eventually (Ioi_mem_nhds (by norm_num)) + have hclose : ∀ᶠ k in atTop, energy Z (scaleWavefunction (c k) (χ k)) + (scaleGradient (c k) (h k)) < energy Z ψ g + ε := + he.eventually (Iio_mem_nhds (lt_add_of_pos_right _ hε)) + obtain ⟨k, hkpos, hkclose⟩ := (hpos.and hclose).exists + refine ⟨2*((k:ℝ)+1), scaleWavefunction (c k) (χ k), scaleGradient (c k) (h k), + by positivity, (hd.multiply (expandingCutoff_multiplier n k)).scale _, ?_, hkclose, ?_, ?_⟩ + · rw [normSquared_scale] + dsimp [c] + rw [inv_pow, Real.sq_sqrt hkpos.le, inv_mul_cancel₀ hkpos.ne'] + · intro σ x hx + simp [scaleWavefunction, χ, multiplyWavefunction, expandingCutoff_eq_zero hx] + · intro σ i a x hx + simp [scaleGradient, h, multiplyGradient, expandingCutoff_eq_zero hx, + expandingCutoff_fderiv_eq_zero hx] + +theorem memLp_two_real_tensor {A B : Type*} [MeasurableSpace A] [MeasurableSpace B] + {μ : Measure A} {ν : Measure B} [SFinite μ] [SFinite ν] + {f : A → ℝ} {g : B → ℂ} (hf : MemLp f 2 μ) (hg : MemLp g 2 ν) : + MemLp (fun z : A×B => f z.1 • g z.2) 2 (μ.prod ν) := by + apply (memLp_two_iff_integrable_sq_norm + (hf.aestronglyMeasurable.comp_fst.smul hg.aestronglyMeasurable.comp_snd)).mpr + change Integrable (fun z : A×B => ‖f z.1 • g z.2‖^2) (μ.prod ν) + simpa only [norm_smul, mul_pow] using + hf.norm.integrable_sq.mul_prod hg.norm.integrable_sq + +section ProductWeakDerivative +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + [MeasureSpace E] [BorelSpace E] [Measure.IsAddHaarMeasure (volume : Measure E)] + [MeasureSpace F] [BorelSpace F] [Measure.IsAddHaarMeasure (volume : Measure F)] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + +def WeakDirectionalDerivative (ψ g : F → ℂ) (v : F) : Prop := + ∀ φ : F → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, fderiv ℝ φ x v • ψ x) = -(∫ x, φ x • g x) + +omit [NormedSpace ℝ E] [NormedSpace ℝ F] [MeasureSpace E] [BorelSpace E] + [Measure.IsAddHaarMeasure (volume : Measure E)] [MeasureSpace F] [BorelSpace F] + [Measure.IsAddHaarMeasure (volume : Measure F)] [FiniteDimensional ℝ E] + [FiniteDimensional ℝ F] in +theorem compact_support_partial_right {φ : E×F → ℝ} + (hφ : HasCompactSupport φ) (y : E) : HasCompactSupport (fun x => φ (y,x)) := by + apply hφ.comp_isClosedEmbedding + refine ⟨isEmbedding_prodMkRight y, ?_⟩ + have he : Set.range (Prod.mk y : F → E×F) = {y} ×ˢ Set.univ := by + ext ⟨a,b⟩ + simp [eq_comm] + rw [he] + exact isClosed_singleton.prod isClosed_univ + +omit [NormedSpace ℝ E] [NormedSpace ℝ F] [MeasureSpace E] [BorelSpace E] + [Measure.IsAddHaarMeasure (volume : Measure E)] [MeasureSpace F] [BorelSpace F] + [Measure.IsAddHaarMeasure (volume : Measure F)] [FiniteDimensional ℝ E] + [FiniteDimensional ℝ F] in +theorem compact_support_partial_left {φ : E×F → ℝ} + (hφ : HasCompactSupport φ) (x : F) : HasCompactSupport (fun y => φ (y,x)) := by + apply hφ.comp_isClosedEmbedding + refine ⟨isEmbedding_prodMkLeft x, ?_⟩ + have he : Set.range (fun y : E => (y,x)) = Set.univ ×ˢ {x} := by + ext ⟨a,b⟩ + simp [eq_comm] + rw [he] + exact isClosed_univ.prod isClosed_singleton + +omit [MeasureSpace E] [BorelSpace E] [Measure.IsAddHaarMeasure (volume : Measure E)] + [MeasureSpace F] [BorelSpace F] [Measure.IsAddHaarMeasure (volume : Measure F)] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in +theorem fderiv_partial_right {φ : E×F → ℝ} (hφ : ContDiff ℝ ∞ φ) + (y : E) (x v : F) : fderiv ℝ (fun z => φ (y,z)) x v = + fderiv ℝ φ (y,x) (0,v) := by + have hc := (hasFDerivAt_const (𝕜 := ℝ) y x).prodMk (hasFDerivAt_id x) + exact congrArg (fun A : F →L[ℝ] ℝ => A v) + (((hφ.differentiable (by simp) (y,x)).hasFDerivAt.comp x hc).fderiv) + +omit [MeasureSpace E] [BorelSpace E] [Measure.IsAddHaarMeasure (volume : Measure E)] + [MeasureSpace F] [BorelSpace F] [Measure.IsAddHaarMeasure (volume : Measure F)] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in +theorem fderiv_partial_left {φ : E×F → ℝ} (hφ : ContDiff ℝ ∞ φ) + (y v : E) (x : F) : fderiv ℝ (fun z => φ (z,x)) y v = + fderiv ℝ φ (y,x) (v,0) := by + have hc := (hasFDerivAt_id (𝕜 := ℝ) y).prodMk (hasFDerivAt_const x y) + exact congrArg (fun A : E →L[ℝ] ℝ => A v) + (((hφ.differentiable (by simp) (y,x)).hasFDerivAt.comp y hc).fderiv) + +theorem WeakDirectionalDerivative.tensor_right {ψ g : F → ℂ} {v : F} + (hd : WeakDirectionalDerivative ψ g v) (hψ : MemLp ψ 2 volume) (hg : MemLp g 2 volume) + {f : E → ℝ} (hf : MemLp f 2 volume) : + WeakDirectionalDerivative (fun z : E×F => f z.1 • ψ z.2) + (fun z : E×F => f z.1 • g z.2) (0,v) := by + intro φ hφ hφc + dsimp only + have hLp := memLp_two_real_tensor hf hψ + have hgLp := memLp_two_real_tensor hf hg + have hi₁ : Integrable (fun z : E×F => fderiv ℝ φ z (0,v) • (f z.1 • ψ z.2)) := + (hLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) (hφc.fderiv_apply ℝ _) + have hi₂ : Integrable (fun z : E×F => φ z • (f z.1 • g z.2)) := + (hgLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + hφ.continuous hφc + change (∫ z : E×F, fderiv ℝ φ z (0,v) • (f z.1 • ψ z.2) ∂(volume.prod volume)) = + -(∫ z : E×F, φ z • (f z.1 • g z.2) ∂(volume.prod volume)) + rw [integral_prod _ hi₁, integral_prod _ hi₂, ← integral_neg] + apply integral_congr_ae + exact Eventually.of_forall fun y => by + have hs := hd (fun x => φ (y,x)) (hφ.comp (contDiff_const.prodMk contDiff_id)) + (compact_support_partial_right hφc y) + simp_rw [fderiv_partial_right hφ y] at hs + simp_rw [smul_comm _ (f y), integral_smul] + simpa only [smul_neg] using congrArg (fun z : ℂ => f y • z) hs + +theorem smooth_tensor_weak_left {f : E → ℝ} (hf : ContDiff ℝ ∞ f) + (hfLp : MemLp f 2 volume) (u : E) + (hdfLp : MemLp (fun y => fderiv ℝ f y u) 2 volume) + {ψ : F → ℂ} (hψ : MemLp ψ 2 volume) : + WeakDirectionalDerivative (fun z : E×F => f z.1 • ψ z.2) + (fun z : E×F => fderiv ℝ f z.1 u • ψ z.2) (u,0) := by + intro φ hφ hφc + dsimp only + have hLp := memLp_two_real_tensor hfLp hψ + have hgLp := memLp_two_real_tensor hdfLp hψ + have hi₁ : Integrable (fun z : E×F => fderiv ℝ φ z (u,0) • (f z.1 • ψ z.2)) := + (hLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) (hφc.fderiv_apply ℝ _) + have hi₂ : Integrable (fun z : E×F => φ z • (fderiv ℝ f z.1 u • ψ z.2)) := + (hgLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + hφ.continuous hφc + change (∫ z : E×F, fderiv ℝ φ z (u,0) • (f z.1 • ψ z.2) ∂(volume.prod volume)) = + -(∫ z : E×F, φ z • (fderiv ℝ f z.1 u • ψ z.2) ∂(volume.prod volume)) + rw [integral_prod_symm _ hi₁, integral_prod_symm _ hi₂, ← integral_neg] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + let φx : E → ℝ := fun y => φ (y,x) + have hs : ContDiff ℝ ∞ φx := hφ.comp (contDiff_id.prodMk contDiff_const) + have hsc : HasCompactSupport φx := compact_support_partial_left hφc x + have hfd : Continuous (fun y => fderiv ℝ φx y u) := + (hs.continuous_fderiv (by simp)).clm_apply continuous_const + have hid : Integrable (fun y => fderiv ℝ φx y u * f y) := + (hfLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + hfd (hsc.fderiv_apply ℝ _) + have hid' : Integrable (fun y => fderiv ℝ f y u * φx y) := by + simpa only [smul_eq_mul, mul_comm] using + (hdfLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + hs.continuous hsc + have hi : Integrable (fun y => f y * φx y) := by + simpa only [smul_eq_mul, mul_comm] using + (hfLp.locallyIntegrable (by norm_num)).integrable_smul_left_of_hasCompactSupport + hs.continuous hsc + have hh := integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable (v := u) + hid' (by simpa only [mul_comm] using hid) hi + (fun y _ => hf.differentiable (by simp) y) (fun y _ => hs.differentiable (by simp) y) + have hh' : (∫ y, fderiv ℝ φ (y,x) (u,0) * f y) = + -(∫ y, φ (y,x) * fderiv ℝ f y u) := by + simpa only [φx, fderiv_partial_left hφ, mul_comm] using hh + simp_rw [smul_smul] + rw [integral_smul_const, integral_smul_const, hh', neg_smul] + +omit [Measure.IsAddHaarMeasure (volume : Measure E)] + [Measure.IsAddHaarMeasure (volume : Measure F)] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] in +theorem WeakDirectionalDerivative.comp_equiv {ψ g : F → ℂ} {v : F} + (hd : WeakDirectionalDerivative ψ g v) (e : E ≃L[ℝ] F) + (he : MeasurePreserving e) : + WeakDirectionalDerivative (ψ ∘ e) (g ∘ e) (e.symm v) := by + intro φ hφ hφc + have hc := hφ.comp e.symm.contDiff + have hcc : HasCompactSupport (φ ∘ e.symm) := + hφc.comp_homeomorph e.symm.toHomeomorph + have hdφ : ∀ y, fderiv ℝ (φ ∘ e.symm) y v = fderiv ℝ φ (e.symm y) (e.symm v) := by + intro y + rw [((hφ.differentiable (by simp) (e.symm y)).hasFDerivAt.comp y + e.symm.hasFDerivAt).fderiv] + rfl + have hint := hd (φ ∘ e.symm) hc hcc + simp_rw [hdφ] at hint + dsimp only [Function.comp_apply] at hint + rw [← he.integral_comp e.toHomeomorph.measurableEmbedding + (fun y => fderiv ℝ φ (e.symm y) (e.symm v) • ψ y), + ← he.integral_comp e.toHomeomorph.measurableEmbedding + (fun y => φ (e.symm y) • g y)] at hint + simpa only [ContinuousLinearEquiv.symm_apply_apply, Function.comp_apply] using hint + +end ProductWeakDerivative + +end NeutralAtom +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/BindingCut.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/BindingCut.lean new file mode 100644 index 0000000000000000000000000000000000000000..f978df0f8341c69accb240020844eefc06b835d3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/BindingCut.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.H1VectorL2 +import OAI.Analysis.CoulombRadii.RandomFields.ExteriorIMS + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace Coulomb +def bindingCut (r:ℝ) (l:Fin 2) : Space → ℝ := radialCut 0 r (Equiv.swap 0 1 l) +lemma bindingCut_smooth (r:ℝ) (l:Fin 2) : ContDiff ℝ ∞ (bindingCut r l) := radialCut_smooth .. +lemma bindingCut_partition (r:ℝ) (z:Space) : ∑ l,bindingCut r l z^2=1 := by + rw [show (∑ l,bindingCut r l z^2)=∑ l,radialCut 0 r l z^2 from Equiv.sum_comp (Equiv.swap (0:Fin 2) 1) (fun l => radialCut 0 r l z^2)] + exact radialCut_partition 0 r z +lemma bindingCut_derivative {r:ℝ} (hr:0.mpr hn.le) (Nat.cast_nonneg Z) + +def bindingLocalized {n:ℕ} (u:H1Vector n) {r:ℝ} (hr:0 (isClosed_le (positionCLM i).continuous.norm (continuous_const (y:=2*r))).measurableSet) +lemma configurationBox_finite (n:ℕ) {r:ℝ} (hr:0 1)).value s x=0 := by + have hi:∃ i,2*r < ‖position x i‖ := by simpa only [configurationBox,mem_ofPred_eq,not_forall,not_le] using hx + obtain ⟨i,hi⟩:=hi + have ht:tensorCut (bindingCut r) (fun _ : Fin n => 1) x=0 := by + apply Finset.prod_eq_zero (Finset.mem_univ i) + simpa [bindingCut] using radialCut_out_zero 0 hr (position x i) (by simpa using hi.le) + change (tensorCut (bindingCut r) (fun _ : Fin n => 1) x:ℂ)*u.value s x=0 + rw [ht,Complex.ofReal_zero,zero_mul] + +lemma bindingLocalized_norm_le {n:ℕ} (u:H1Vector n) {r:ℝ} (hr:0 1)).value s x‖^2 ≤ ‖u.value s x‖^2 := by + change ‖(tensorCut (bindingCut r) (fun _ : Fin n => 1) x:ℂ)*u.value s x‖^2 ≤ _ + rw [norm_mul,Complex.norm_real,Real.norm_eq_abs,mul_pow] + have h:=pow_le_pow_left₀ (abs_nonneg _) (tensorCut_abs_le_one (bindingCut r) (bindingCut_partition r) (fun _ : Fin n => 1) x) 2 + simpa using mul_le_mul_of_nonneg_right h (sq_nonneg ‖u.value s x‖) + +lemma binding_loss_controls_cut {n:ℕ} (u:H1Vector n) {r:ℝ} (hr:0 1)) := by + let v:=bindingLocalized u hr (fun _ => 1) + have hd(t:Spins n):Integrable (fun x => ‖u.value t x‖^2-‖v.value t x‖^2) := + ((u.value_L2 t).integrable_norm_pow (by norm_num)).sub ((v.value_L2 t).integrable_norm_pow (by norm_num)) + have hn(t:Spins n)(x:Configuration n):0 ≤ ‖u.value t x‖^2-‖v.value t x‖^2 := sub_nonneg.mpr (bindingLocalized_norm_le u hr t x) + have he:mass u-mass v=∑ t,∫ x,‖u.value t x‖^2-‖v.value t x‖^2 := by + simp only [mass,integral_sub ((u.value_L2 _).integrable_norm_pow (by norm_num)) ((v.value_L2 _).integrable_norm_pow (by norm_num)),Finset.sum_sub_distrib] + rw [he] + apply le_trans _ (Finset.single_le_sum (f:=fun t:Spins n => ∫ x,‖u.value t x‖^2-‖v.value t x‖^2) + (fun t _ => integral_nonneg (hn t)) (Finset.mem_univ s)) + rw [l2_norm_sq_integral] + apply integral_mono_ae + · exact (Lp.memLp _).integrable_norm_pow (by norm_num) + · exact hd s + filter_upwards [cutL2_ae (configurationBox n r)ᶜ (configurationBox_measurable n r).compl (u.valueL2 s),u.valueL2_ae s] with x hx hu + rw [hx] + by_cases h:x∈configurationBox n r + · simp only [mem_compl_iff,h,not_true_eq_false,not_false_eq_true,indicator_of_notMem,norm_zero,zero_pow (by decide : 2≠0)] + exact hn s x + · rw [indicator_of_mem h,hu,show v.value s x=0 from bindingLocalized_value_outside u hr s x h] + simp + +lemma binding_loss_bound (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} (hn:0 1))) ≤ + form (atom Z hZ) u-E*mass u+ + (3*(n:ℝ)*(radialCutCoefficient/r)^2+(n:ℝ)*((Z:ℝ)/r))*mass u := + binary_cut_loss_bound Z hZ hn u ha _ _ _ _ _ _ _ (by positivity) (bindingCut_attraction Z hZ hr) E P hE hP +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/CorePredecessor.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/CorePredecessor.lean new file mode 100644 index 0000000000000000000000000000000000000000..875aae6f213d3a630230cc9837edeea9898162e8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/CorePredecessor.lean @@ -0,0 +1,45 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.CoreBudget +import OAI.Analysis.CoulombRadii.Screening.CoreMoment + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +theorem atomic_predecessor_from_physical_mean : ∃ C : ℝ, 0≤C ∧ + ∀ (Z : ℕ) (hZ : 1≤Z) {n : ℕ} (u : H1Vector n), + Antisymmetric u → mass u=1 → + ∀ {E : ℝ}, (E:EReal)≤unrestrictedFormBottom (atom Z hZ) → form (atom Z hZ) u≤E → + ∀ {t : ℝ}, 0 rfl) u ha hm hE he ht + have hs : T.CoreSupported (Metric.ball 0 (2*t)) := by + simpa only [Metric.ball,dist_zero_right] using hS + have hm' : 1≤(Z:ℝ)-T.coreMean := by + have hp := RecordedEnsemble.coreMean_le_population hT measurableSet_ball hs + linarith + have hsecond := RecordedEnsemble.zero_offset_core_deficit_moment Z hZ u ha hm hE he ht T hT hO + let P := (sectorFormBottom (atom Z hZ) (Z-1)).toReal + have hP : (P:EReal)=sectorFormBottom (atom Z hZ) (Z-1) := atom_sectorFormBottom_real Z hZ _ + have hEP : E≤P := EReal.coe_le_coe_iff.mp (hE.trans (by + rw [hP] + exact iInf_le (fun k => sectorFormBottom (atom Z hZ) k) (Z-1))) + have H := T.predecessor_bound_of_core_budget (atom Z hZ) hF + (atom_sectorFormBottom_antitone Z hZ) hE hP.le hEP + (NeutralAtom.fixedCoreMomentBound_pos t) hM hm' hsecond hform + simpa only [mul_assoc] using H + +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/EigenspaceBasisSet.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/EigenspaceBasisSet.lean new file mode 100644 index 0000000000000000000000000000000000000000..9f586363c8e749b9d9f1ecfc30837422a22107de --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/EigenspaceBasisSet.lean @@ -0,0 +1,162 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +namespace Coulomb +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] +noncomputable def eigenspaceBasisSet (T : E →L[ℂ] E) (z : ℂ) : Set (eigenspace T.toLinearMap z) := by + letI : CompleteSpace (eigenspace T.toLinearMap z) := + (T.isClosed_eigenspace z).isComplete.completeSpace_coe + exact (exists_hilbertBasis ℂ (eigenspace T.toLinearMap z)).choose +noncomputable def eigenspaceHilbertBasis (T : E →L[ℂ] E) (z : ℂ) : + HilbertBasis (eigenspaceBasisSet T z) ℂ (eigenspace T.toLinearMap z) := by + letI : CompleteSpace (eigenspace T.toLinearMap z) := + (T.isClosed_eigenspace z).isComplete.completeSpace_coe + exact (exists_hilbertBasis ℂ (eigenspace T.toLinearMap z)).choose_spec.choose +noncomputable def spectralVectors (T : E →L[ℂ] E) (i : Σ z, eigenspaceBasisSet T z) : E := + eigenspaceHilbertBasis T i.1 i.2 +lemma spectralVectors_orthonormal (T : E →L[ℂ] E) (hT : T.IsSymmetric) : + Orthonormal ℂ (spectralVectors T) := + hT.orthogonalFamily_eigenspaces.orthonormal_sigma_orthonormal + (fun z => (eigenspaceHilbertBasis T z).orthonormal) +lemma spectralVectors_eigen (T : E →L[ℂ] E) (i : Σ z, eigenspaceBasisSet T z) : + T (spectralVectors T i) = i.1 • spectralVectors T i := + (mem_eigenspace_iff).mp (eigenspaceHilbertBasis T i.1 i.2).property +lemma spectralVectors_orthogonal_eq_bot (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.IsSymmetric) : + (Submodule.span ℂ (Set.range (spectralVectors T)))ᗮ = ⊥ := by + apply le_antisymm _ bot_le + intro x hx + have hx' : x ∈ (⨆ z, eigenspace T.toLinearMap z)ᗮ := by + rw [←Submodule.iInf_orthogonal] + rw [Submodule.mem_iInf] + intro z + rw [Submodule.mem_orthogonal'] + intro v hv + let v' : eigenspace T.toLinearMap z := ⟨v,hv⟩ + have hs := (eigenspaceHilbertBasis T z).hasSum_repr v' + have he : ∀ i : eigenspaceBasisSet T z, + inner ℂ x ((eigenspaceHilbertBasis T z i : eigenspace T.toLinearMap z) : E) = 0 := by + intro i + exact ((Submodule.mem_orthogonal' _ _).mp hx) _ + (Submodule.subset_span (Set.mem_range.mpr ⟨⟨z,i⟩,rfl⟩)) + have hsum := (hs.mapL (eigenspace T.toLinearMap z).subtypeL).mapL (innerSL ℂ x) + have hz : HasSum (fun _ : eigenspaceBasisSet T z => (0:ℂ)) (inner ℂ x v) := by + simpa only [ContinuousLinearMap.map_smul,Submodule.subtypeL_apply, + innerSL_apply_apply,he,smul_zero] using hsum + exact hz.unique hasSum_zero + simpa only [T.orthogonalComplement_iSup_eigenspaces_eq_bot hc hT] using hx' +noncomputable def compactSpectralBasis (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.IsSymmetric) : + HilbertBasis (Σ z, eigenspaceBasisSet T z) ℂ E := + HilbertBasis.mkOfOrthogonalEqBot (spectralVectors_orthonormal T hT) + (spectralVectors_orthogonal_eq_bot T hc hT) +lemma compactSpectralBasis_eigen (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.IsSymmetric) (i : Σ z, eigenspaceBasisSet T z) : + T (compactSpectralBasis T hc hT i) = i.1 • compactSpectralBasis T hc hT i := by + simpa only [compactSpectralBasis,HilbertBasis.coe_mkOfOrthogonalEqBot] using spectralVectors_eigen T i +omit [CompleteSpace E] in +lemma orthonormal_countable {ι : Type*} [SeparableSpace E] {v : ι → E} + (hv : Orthonormal ℂ v) : Countable ι := by + have hd : Pairwise (Disjoint on (fun i => Metric.ball (v i) (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.1 i, hv.1 j, hv.2 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⟩) +lemma compactSpectralBasis_eigen_real (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.IsSymmetric) (i : Σ z, eigenspaceBasisSet T z) : + i.1.im = 0 := by + have h := hT.im_inner_self_apply (compactSpectralBasis T hc hT i) + simpa [compactSpectralBasis_eigen,inner_smul_right,inner_self_eq_norm_sq_to_K, + (compactSpectralBasis T hc hT).orthonormal.1 i] using h +lemma compactSpectralBasis_eigen_nonneg (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.toLinearMap.IsPositive) (i : Σ z, eigenspaceBasisSet T z) : + 0 ≤ i.1.re := by + have h := hT.re_inner_nonneg_right (compactSpectralBasis T hc hT.1 i) + simpa [compactSpectralBasis_eigen,inner_smul_right,inner_self_eq_norm_sq_to_K, + (compactSpectralBasis T hc hT.1).orthonormal.1 i] using h +lemma compactSpectralBasis_eigen_le_one (T : E →L[ℂ] E) + (hc : IsCompactOperator T) (hT : T.toLinearMap.IsPositive) + (hI : (ContinuousLinearMap.id ℂ E-T).toLinearMap.IsPositive) + (i : Σ z, eigenspaceBasisSet T z) : i.1.re ≤ 1 := by + have h := hI.re_inner_nonneg_right (compactSpectralBasis T hc hT.1 i) + change 0 ≤ RCLike.re (inner ℂ _ (_-T _)) at h + rw [inner_sub_right,map_sub] at h + simpa [compactSpectralBasis_eigen,inner_smul_right,inner_self_eq_norm_sq_to_K, + (compactSpectralBasis T hc hT.1).orthonormal.1 i,sub_nonneg] using h +end Coulomb + +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/FermiPacketSpectralTrace.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/FermiPacketSpectralTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c56119269e1968e06f89a15b4be2ee712ce0784 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/FermiPacketSpectralTrace.lean @@ -0,0 +1,168 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.PacketStateJointSquareIntegrable +import OAI.Analysis.CoulombRadii.FormDomain.SpaceFourierL2 +import OAI.Analysis.CoulombRadii.FormDomain.ThomasFermiKineticConstant + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +namespace Coulomb +lemma fermiPacket_spectral_trace (g : 𝓢(Space,ℝ)) + (hg : (∫ x : Space, g x^2) = 1) (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hI : Integrable ρ) : + HasSum (fun i : Σ z, eigenspaceBasisSet (packetFrame (complexWindow g) + (phaseMeasure (fermiRadius ρ))) z => 2*i.1.re) (∫ y : Space, ρ y) := by + let := fermiMeasure_finite ρ hρ hm hI + have hg' : (∫ x : Space, ‖complexWindow g x‖^2) = 1 := by + simpa only [complexWindow_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] using hg + have h := (packetFrame_spectral_trace (complexWindow g) hg' (phaseMeasure (fermiRadius ρ))).mul_left 2 + rw [measureReal_def, fermiMeasure_mass ρ hρ hm hI, + ENNReal.toReal_ofReal (div_nonneg (integral_nonneg hρ) (by norm_num))] at h + convert h using 1 + ring + +lemma fermiPacket_density (g : 𝓢(Space,ℝ)) + (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) (hI : Integrable ρ) : + let μ := phaseMeasure (fermiRadius ρ) + letI := fermiMeasure_finite ρ hρ hm hI + (fun x : Space => 2 * frameDensity (packetState_toL2_memLp (complexWindow g) μ) x) =ᵐ[volume] + (fun x : Space => ∫ y : Space, g (x-y)^2 * ρ y) := by + dsimp only + let := fermiMeasure_finite ρ hρ hm hI + filter_upwards [packetFrame_density (complexWindow g) (phaseMeasure (fermiRadius ρ))] with x hx + rw [hx] + simp only [complexWindow_apply, Complex.norm_real, Real.norm_eq_abs, sq_abs] + rw [fermiMeasure_center_integral ρ hρ hm (fun y => g (x-y)^2) (by fun_prop) (fun y => sq_nonneg _)] + ring + +lemma packet_momentum_basis_sum (p : Space) : + (∑ d : Fin 3, (2*Real.pi*inner ℝ (EuclideanSpace.single d 1) p)^2) = + (2*Real.pi)^2*‖p‖^2 := by + simp only [EuclideanSpace.inner_single_left, conj_trivial, one_mul, mul_pow] + rw [← Finset.mul_sum, EuclideanSpace.real_norm_sq_eq] + +lemma fermiPacket_kinetic_trace (g : 𝓢(Space,ℝ)) + (hg : (∫ x : Space, g x^2) = 1) (ρ : Space → ℝ) (hρ : ∀ y, 0 ≤ ρ y) + (hm : Measurable ρ) (hI : Integrable ρ) (hT : Integrable (fun y => ρ y^(5/3:ℝ))) : + let μ := phaseMeasure (fermiRadius ρ) + letI := fermiMeasure_finite ρ hρ hm hI + let hv := packetState_toL2_memLp (complexWindow g) μ + let b := compactSpectralBasis (packetFrame (complexWindow g) μ) + (packetFrame_compact (complexWindow g) μ) (frameOperator_symmetric hv) + HasSum (fun i : Σ z, eigenspaceBasisSet (packetFrame (complexWindow g) μ) z => + i.1.re * ∑ d : Fin 3, ∫ ξ : Space, (2*Real.pi*inner ℝ ξ (EuclideanSpace.single d 1))^2 * + ‖(𝓕 (b i) : Lp ℂ 2 (volume : Measure Space)) ξ‖^2) + (thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y) * + ∑ d : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single d 1))^2) := by + dsimp only + let μ := phaseMeasure (fermiRadius ρ) + let := fermiMeasure_finite ρ hρ hm hI + have hp := fermiMeasure_momentum_memLp ρ hρ hm hT + have hs := hasSum_sum (s := (Finset.univ : Finset (Fin 3))) + (fun d _ => (packetFrame_fourier_weighted_trace g μ hp (EuclideanSpace.single d 1)).2) + simp only [← Finset.mul_sum, hg, mul_one] at hs + have hi (d : Fin 3) : Integrable (fun yp : Space × Space => + (2*Real.pi*inner ℝ (EuclideanSpace.single d 1) yp.2)^2) μ := by + have ha := hp.continuousLinearMap_comp ((2*Real.pi) • innerSL ℝ (EuclideanSpace.single d 1)) + simpa only [smul_apply, innerSL_apply_apply, smul_eq_mul, + Function.comp_apply, Real.norm_eq_abs, sq_abs] using ha.integrable_norm_pow (by norm_num) + have hmμ : μ.real univ = (∫ y : Space, ρ y)/2 := by + rw [measureReal_def, fermiMeasure_mass ρ hρ hm hI, + ENNReal.toReal_ofReal (div_nonneg (integral_nonneg hρ) (by norm_num))] + have he : (∑ d : Fin 3, ∫ yp : Space × Space, + (2*Real.pi*inner ℝ (EuclideanSpace.single d 1) yp.2)^2 + + (∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single d 1))^2) ∂μ) = + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y) * + ∑ d : Fin 3, ∫ x : Space, (fderiv ℝ g x (EuclideanSpace.single d 1))^2 := by + simp_rw [integral_add (hi _) (integrable_const _), integral_const, smul_eq_mul] + rw [Finset.sum_add_distrib, ← integral_finsetSum _ (fun d _ => hi d), + ← Finset.mul_sum] + simp only [packet_momentum_basis_sum, integral_const_mul] + rw [fermiMeasure_kinetic ρ hρ hm, hmμ] + ring + rw [he] at hs + exact hs +end Coulomb + +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/GlobalSectorMinimum.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/GlobalSectorMinimum.lean new file mode 100644 index 0000000000000000000000000000000000000000..af8ee028a23fd984fa8ee9c15fedfef5b61b4bf5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/GlobalSectorMinimum.lean @@ -0,0 +1,71 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.AtomicNumber +import OAI.Analysis.CoulombRadii.SpectralTheory.StrictBinding + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical +noncomputable section +namespace Coulomb +lemma atom_strict_sector_bound (Z:ℕ) (hZ:1≤Z) {n:ℕ} (hn:0 0 simp + | succ d ih => + have hle:E (N+(d+1))≤E (N+d):=atom_sectorFormBottom_antitone Z hZ (by omega) + have hnlt:¬E (N+(d+1)) sectorFormBottom (atom Z hZ) k) n) + rw [he] at H + exact EReal.coe_ne_bot _ (le_bot_iff.mp H) + +lemma slice_core_form_ge_sector {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + (ha : ∀ s, ∀ᵐ x, Antisymmetric (u.coreSlice s x)) + {P : ℝ} (hP : (P:EReal)≤ sectorFormBottom S k) : + P*mass u≤ sliceExpectation u (fun s x => form S (u.coreSlice s x).normalized) := by + rw [←sliceExpectation_number u P] + apply Finset.sum_le_sum + intro s _ + apply integral_mono_ae + (by simpa only [mul_comm (mass _) P] using (mass_coreSlice_integrable u s).const_mul P) + (normalized_coreForm_weight_integrable S u s) + filter_upwards [ha s] with x hx + by_cases hz : mass (u.coreSlice s x)=0 + · simp [hz] + · have hp := lt_of_le_of_ne (mass_nonneg (u.coreSlice s x)) (Ne.symm hz) + apply mul_le_mul_of_nonneg_left _ hp.le + exact EReal.coe_le_coe_iff.mp (hP.trans (sInf_le + ⟨(u.coreSlice s x).normalized,hx.normalized,mass_normalized _ hp,rfl⟩)) + +end Coulomb + +end +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical +namespace Coulomb +lemma atom_sector_trial_approx (Z:ℕ) (hZ:1 ≤ Z) (n:ℕ) (E:ℝ) + (hE:(E:EReal)=sectorFormBottom (atom Z hZ) n) {ε:ℝ} (hε:0<ε) : + ∃ u:H1Vector n,Antisymmetric u ∧ mass u=1 ∧ form (atom Z hZ) u form (atom Z hZ) (u k)) atTop (𝓝 E) := by + choose u ha hm hf using fun k:ℕ => atom_sector_trial_approx Z hZ n E hE (show 0<(1:ℝ)/(k+1) by positivity) + refine ⟨u,ha,hm,?_,?_⟩ + · intro k + have H:=kinetic_bound_of_form_bound (atom Z hZ) (u k) + have htotal:totalCharge (atom Z hZ)=(Z:ℝ) := by simp [totalCharge,atom] + rw [hm k,htotal,mul_one] at H + have hsmall:(1:ℝ)/(k+1) ≤ 1 := (div_le_one (by positivity)).mpr (by linarith [Nat.cast_nonneg (α:=ℝ) k]) + linarith [hf k] + · apply tendsto_of_tendsto_of_tendsto_of_le_of_le tendsto_const_nhds + (show Tendsto (fun k:ℕ => E+1/((k:ℝ)+1)) atTop (𝓝 E) from by + simpa using tendsto_const_nhds.add (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜:=ℝ))) + · intro k; exact atom_normalized_form_ge_bottom Z hZ (u k) (ha k) (hm k) E hE.le + · exact fun k => (hf k).le +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/SectorFormBottom.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/SectorFormBottom.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad74e64c4d9145d3c16605ad1f008104d26509b0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/SectorFormBottom.lean @@ -0,0 +1,186 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.CoreScreenedFieldPacketIntegral +import OAI.Analysis.CoulombRadii.Packets.PacketDensityReal +import OAI.Analysis.CoulombRadii.FieldAnalysis.NearCoulombFiveHalves + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Filter +open scoped ENNReal NNReal FourierTransform SchwartzMap LineDeriv ComplexConjugate +open scoped LineDeriv +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace Convolution +open MeasureTheory Set Filter +open scoped ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal ComplexConjugate Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped Classical SchwartzMap FourierTransform ENNReal NNReal Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise +namespace Coulomb + +def sectorFormBottom {M : ℕ} (S : Nuclei M) (n : ℕ) : EReal := + sInf {e : EReal | ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ e = (form S ψ : EReal)} + +def unrestrictedFormBottom {M : ℕ} (S : Nuclei M) : EReal := ⨅ n, sectorFormBottom S n + +lemma unrestrictedFormBottom_le_trial {M n : ℕ} (S : Nuclei M) (ψ : H1Vector n) + (ha : Antisymmetric ψ) (hm : mass ψ = 1) : unrestrictedFormBottom S ≤ (form S ψ : EReal) := + (iInf_le _ n).trans (sInf_le ⟨ψ,ha,hm,rfl⟩) + +theorem radial_packet_core_trial {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (ht : Integrable (fun y => ρ y^(5/3:ℝ))) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) + (hs : ∀ y, y ∉ K → ρ y = 0) (hsu : SpatiallySupported u A) + (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) + (ε : ℝ) (hε : 0 < ε) : + ∃ n : ℕ, ∃ ψ : H1Vector n, Antisymmetric ψ ∧ mass ψ = 1 ∧ + form S ψ ≤ form S u + + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2) - + (∫ x, coreScreenedField S u x*packetDensity g ρ x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2)) + ε := by + have hi := compact_density_integrable ρ hp hm ht K hK hs + obtain ⟨n,ψ,ha,hmass,he⟩ := packet_core_trial S u hu hmu g hg hgc ρ hp hm hi ht + K A hK hA hs hsu hsep ε hε + have hD := radial_packetDensity_pair_le g hg hrad ρ hp hm hi + (density_coulomb_pair_integrable ρ hp hm hi ht) + exact ⟨n,ψ,ha,hmass,by linarith⟩ + +theorem trial_in_hole {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (hu : Antisymmetric u) (hmu : mass u = 1) + (g : 𝓢(Space,ℝ)) (hg : (∫ x : Space, g x^2) = 1) + (hgc : HasCompactSupport (g : Space → ℝ)) + (hrad : ∀ y, g y = g (EuclideanSpace.single 0 ‖y‖)) + (ρ : Space → ℝ) (hp : ∀ y, 0 ≤ ρ y) (hm : Measurable ρ) + (ht : Integrable (fun y => ρ y^(5/3:ℝ))) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) + (hs : ∀ y, y ∉ K → ρ y = 0) (hsu : SpatiallySupported u A) + (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) : + unrestrictedFormBottom S ≤ ((form S u + + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2) - + (∫ x, coreScreenedField S u x*packetDensity g ρ x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2)) : ℝ) : EReal) := by + let B : ℝ := form S u + + thomasFermiKineticConstant * (∫ y : Space, ρ y^(5/3:ℝ)) + + (1/2:ℝ)*(∫ y : Space, ρ y)*(∑ b : Fin 3, ∫ x : Space, + (fderiv ℝ g x (EuclideanSpace.single b 1))^2) - + (∫ x, coreScreenedField S u x*packetDensity g ρ x) + + (1/2:ℝ)*(∫ xy : Space × Space, coulombKernel (xy.1-xy.2)*(ρ xy.1*ρ xy.2)) + change unrestrictedFormBottom S ≤ (B:EReal) + apply EReal.le_of_forall_lt_iff_le.mp + intro z hz + have hpz : 0 < z-B := sub_pos.mpr (EReal.coe_lt_coe_iff.mp hz) + obtain ⟨n,ψ,ha,hmass,he⟩ := radial_packet_core_trial S u hu hmu g hg hgc hrad ρ hp hm ht + K A hK hA hs hsu hsep (z-B) hpz + have hel : form S ψ ≤ z := by change form S ψ ≤ B+(z-B) at he; linarith + exact (unrestrictedFormBottom_le_trial S ψ ha hmass).trans (EReal.coe_le_coe hel) + +lemma vacuum_trial_in_hole {M m : ℕ} (S : Nuclei M) (u : H1Vector m) + (hu : Antisymmetric u) (hmu : mass u = 1) : unrestrictedFormBottom S ≤ (form S u : EReal) := + unrestrictedFormBottom_le_trial S u hu hmu +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical SchwartzMap Pointwise + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/SpectralTheory/StrictBinding.lean b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/StrictBinding.lean new file mode 100644 index 0000000000000000000000000000000000000000..565a5a5df02c44cfffcc2893919f69e1953a6493 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/SpectralTheory/StrictBinding.lean @@ -0,0 +1,185 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.SpectralTheory.BindingCut +import OAI.Analysis.CoulombRadii.FormDomain.H1EnergyLimit + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical +noncomputable section +namespace Coulomb +lemma binding_cost_tendsto (n Z:ℕ) : + Tendsto (fun j:ℕ => 3*(n:ℝ)*(radialCutCoefficient/((j:ℝ)+1))^2+(n:ℝ)*((Z:ℝ)/((j:ℝ)+1))) atTop (𝓝 0) := by + have h:=tendsto_one_div_add_atTop_nhds_zero_nat (𝕜:=ℝ) + simpa only [mul_zero,zero_pow (by decide : 2≠0),zero_add,mul_one_div] using + ((h.const_mul radialCutCoefficient).pow 2 |>.const_mul (3*(n:ℝ))).add ((h.const_mul (Z:ℝ)).const_mul (n:ℝ)) + +lemma strictly_bound_sequence_tight (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} (hn:0 form (atom Z hZ) (u k)) atTop (𝓝 E)) : + ∀ ε:ℝ,0<ε → ∃ A:Set (Configuration n),∃ hA:MeasurableSet A,volume A≠(⊤:ℝ≥0∞) ∧ + ∀ᶠ k in atTop,∀ s,‖cutL2 Aᶜ hA.compl ((u k).valueL2 s)‖≤ε := by + intro ε hε + have hh:0<(P-E)*ε^2/2 := by positivity + obtain ⟨j,hj⟩:=((binding_cost_tendsto n Z).eventually (gt_mem_nhds hh)).exists + let r:ℝ:=(j:ℝ)+1 + have hr:0 1)) ≤ ε^2 := by + rw [hm k] + dsimp [r] at H + nlinarith + exact (sq_le_sq₀ (norm_nonneg _) hε.le).mp (hc.trans hdiff) + +lemma atom_strict_binding_attained (Z:ℕ) (hZ:1 ≤ Z) {n:ℕ} (hn:0 u (φ k)) v (fun k => ha (φ k)) hv + have hupper:=form_strong_weak_limit_le (atom Z hZ) (fun k => u (φ k)) v hv hw _ (fun k => hk (φ k)) E (hlim.comp hφ.tendsto_atTop) + have hlower:=atom_normalized_form_ge_bottom Z hZ v hva hvm E hE.le + refine ⟨v,hva,hvm,?_⟩ + rw [le_antisymm hupper hlower,hE] +end Coulomb +end + +end +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology BigOperators Classical ContDiff +noncomputable section +namespace NeutralAtom +lemma integral_first_weighted_tensor {n:ℕ} (f:Position → ℝ) (ψ:Configuration n → ℂ) (W:Position → ℝ): + (∫ x:Configuration (n+1),W (x 0)*‖f (x 0) • ψ (fun i => x i.succ)‖^2)= + (∫ y:Position,W y*(f y)^2)*(∫ x:Configuration n,‖ψ x‖^2) := by + have he := (configurationSplit_preserving n).integral_comp + (configurationSplit n).toHomeomorph.measurableEmbedding + (fun z:Position × Configuration n => (W z.1*(f z.1)^2)*‖ψ z.2‖^2) + rw [←integral_prod_mul (μ:=volume) (ν:=volume) (fun y:Position => W y*(f y)^2) + (fun x:Configuration n => ‖ψ x‖^2)] + change _ = ∫ z:Position × Configuration n,(W z.1*(f z.1)^2)*‖ψ z.2‖^2 + rw [←he] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [configurationSplit_apply,norm_smul,mul_pow,Real.norm_eq_abs,sq_abs] + ring +lemma weighted_normSquared_insert_first {n:ℕ} (f:Position → ℝ) (ψ:Wavefunction n) (W:Position → ℝ): + (∑ s:Spins (n+1),∫ x,W (x 0)*‖insertWavefunction f ψ s x‖^2)= + (∫ y:Position,W y*(f y)^2)*normSquared ψ := by + rw [←Equiv.sum_comp (Fin.consEquiv (fun _:Fin (n+1) => Fin 2))] + rw [Fintype.sum_prod_type,Fin.sum_univ_two] + have h10:(1:Fin 2)≠0:=by decide + simp only [Fin.consEquiv,Equiv.coe_fn_mk,insertWavefunction,Fin.cons_zero, + Fin.cons_succ,h10,↓reduceIte,norm_zero,zero_pow (by decide : 2≠0),mul_zero, + integral_zero,Finset.sum_const_zero,add_zero,integral_first_weighted_tensor,Finset.mul_sum,normSquared] +lemma distantPacket_outer_zero {t:ℝ} (ht:0 ‖y‖⁻¹*(distantPacket t y)^2) := by + exact locallyIntegrable_coulombKernel.integrable_smul_right_of_hasCompactSupport + ((distantPacket_smooth t).continuous.pow 2) (by + simp only [sq] + change HasCompactSupport ((distantPacket t)*(distantPacket t)) + exact (distantPacket_compact ht).mul_left) + have hi':Integrable (fun y:Position => (6*t)⁻¹*(distantPacket t y)^2):= + ((distantPacket_memLp ht).integrable_sq).const_mul _ + have H:=integral_mono hi' hi (fun y => by + by_cases hz:distantPacket t y=0 + · simp [hz] + · have hy:‖y‖<6*t:=lt_of_not_ge (fun h => hz (distantPacket_outer_zero ht h)) + have hy0:0<‖y‖:=lt_of_le_of_lt (by positivity : (0:ℝ)≤2*t) + (lt_of_not_ge (fun h => hz (distantPacket_zero ht h))) + exact mul_le_mul_of_nonneg_right (inv_anti₀ hy0 hy.le) (sq_nonneg _)) + rwa [integral_const_mul,distantPacket_normalized ht,mul_one] at H +lemma onePacket_domain {t:ℝ} (ht:0 distantPacket_derivative_memLp ht _) ?_⟩ + · intro p s + have hp:p=1:=by + apply Equiv.ext + intro i + apply Fin.ext + change (p i).val=i.val + have H1:(p i).val<1:=(p i).isLt + have H2:i.val<1:=i.isLt + omega + subst p + simp + · intro s x hx + have H:x=0:=Subsingleton.elim _ _ + simp [H] at hx + · intro y hy + exact distantPacket_zero ht (by linarith) +lemma onePacket_energy (Z:ℕ) {t:ℝ} (ht:0 ‖y‖⁻¹) + rw [hw,vacuum_normalized,mul_one] + rw [hp] + simp only [gradientNormSquared,Finset.univ_eq_empty,Finset.sum_empty,mul_zero,zero_add,mul_one] + ring +lemma sectorEnergy_one_neg (Z:ℕ) (hZ:1≤Z):sectorEnergy Z 1<0 := by + let C:=distantMass⁻¹*oneParticleGradientNorm bindingBump + let t:ℝ:=3*|C|+1 + have ht:0 + let Φ := coreScreenedField S ((T.vector p).coreSlice s x).normalized + let ρ := localTFDensity measurableSet_ball + (coreTFField S ((T.vector p).coreSlice s x).normalized measurableSet_ball + (atomicCellScale_pos hy) + (patch_nucleus_separation S (atomicCellScale_pos hy) hb ht y + (atomic_patch_nucleus_distance S hatom y))) + rawThomasFermiEnergy Φ (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy Φ ρ) + +def atomicRefinedError (δ P a b : ℝ) : ℝ := +(δ+thinReserveFactor*(Real.sqrt P*screenMass δ a/b^2))+ + 12*a*unitWindowKinetic/b^2*Real.sqrt (atomicPhysicalCapConstant*P*(screenMass δ a)^2/a^2)+ + Real.sqrt ((atomicPhysicalCapConstant*P*(screenMass δ a)^2/a^2)* + (18*atomicPatchCountFactor*(b/a)*P*(screenMass δ a)^2))+ + (b⁻¹)^2*((Real.pi^2/2)*neumannBoundary)*(atomicPatchCountFactor*P*(screenMass δ a)^2)^(2/3:ℝ)+ + ((2*Real.pi+1)/(2*b))*Real.sqrt (atomicPatchCountFactor*P*(screenMass δ a)^2) + +theorem exists_atomic_physical_gap {J n : ℕ} (S : Nuclei J) + (hatom : ∀ i, S.position i=0) (ψ : H1Vector n) (hψ : Antisymmetric ψ) (hm : mass ψ=1) + {E δ : ℝ} (hE : (E:EReal)≤unrestrictedFormBottom S) (hstate : form S ψ≤E+δ) + (hδ : 0≤δ) {y : Space} (hy : y≠0) {b : ℝ} (hb : 0 screenCountParameter_controls ψ hm δ (y:=z) hz + obtain ⟨t,ht,T,hEt,ho,hcs,hos,hD,hN,hraw⟩ := + exists_atomic_thin_screened_sharp S hatom ψ hψ hm hE hstate hδ hy hb hsmall hcond + let F := fun p s x => atomicPatchCap S ((T.ensemble.vector p).coreSlice s x).normalized x y + let Q := ∑ p, sliceExpectation (T.ensemble.vector p) (fun s x => (F p s x)^2) + let N := ∑ p, (T.ensemble.out p:ℝ)^2*mass (T.ensemble.vector p) + have hN0 : 0≤N := Finset.sum_nonneg (fun p _ => mul_nonneg (sq_nonneg _) (mass_nonneg _)) + have hD0 : 0≤T.ensemble.deletedSquare y t b := Finset.sum_nonneg (fun p _ => + Finset.sum_nonneg (fun s _ => integral_nonneg (fun x => mul_nonneg (mass_nonneg _) (sq_nonneg _)))) + have hwidth : t+b≤80*a := by dsimp only [a] at *; linarith [ht.2] + have hgap : T.ensemble.totalForm S≤E+(δ+thinIMS ψ y t b) := by linarith + have hQ : Q≤atomicPhysicalCapConstant*P*m^2/a^2 := by + have HQ := atomicPatchCap_ensemble_square S hatom T.ensemble hy + (H := (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2) + (fun v hv => (Real.sqrt_le_iff.mp (hraw v hv)).2) + change Q≤_ at HQ + calc + Q≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+8*N/(9*a^2) := HQ + _≤16*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)* + (2*atomicBudgetRecursionC^3*Real.sqrt thinReserveFactor*screenFieldUnit δ P a)^2+ + 8*(atomicPatchCountFactor*P*m^2)/(9*a^2) := add_le_add le_rfl + (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hN (by norm_num)) (by positivity)) + _=atomicPhysicalCapConstant*P*m^2/a^2 := by + dsimp only [atomicPhysicalCapConstant,screenFieldUnit,m] + simp only [mul_pow,div_pow,Real.sq_sqrt hP] + ring + have hQ0 : 0≤atomicPhysicalCapConstant*P*m^2/a^2 := by positivity [atomicPhysicalCapConstant_nonneg] + have hn (j) : 20*a≤‖S.position j-y‖ := by + rw [hatom j,zero_sub,norm_neg] + dsimp only [a,atomicCellScale] + nlinarith [norm_nonneg y] + have hH := physical_ensemble_gap S ψ T.ensemble T.law T.fermionic ho + (T.mass_eq.trans hm) hE hgap ha hb hsmall ht y hn hcs hos F + (fun p s => atomicPatchCap_slice_aestronglyMeasurable S (T.ensemble.vector p) s y) + (fun p s => Eventually.of_forall (fun x => atomicPatchCap_nonneg S _ x hy)) + (fun p s => atomicPatchCap_weight_integrable S hatom (T.ensemble.vector p) s hy) + (fun p s => Eventually.of_forall (fun x w hw => coreField_le_atomicPatchCap S hatom _ x hy + ((show ‖w-y‖≤t+b from by simpa only [Metric.mem_closedBall,dist_eq_norm] using hw).trans hwidth))) + refine ⟨t,ht,T,hEt,ho,hcs,hos,?_⟩ + change atomicPatchTFGap S hatom T.ensemble y hy b hb t ht.2≤_ at hH + apply hH.trans + unfold atomicRefinedError + have hB := thinIMS_sharp_budget ψ hm hδ hP hc hy hb hwidth + have hp := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hQ) + (show 0≤12*a*unitWindowKinetic/b^2 from div_nonneg (mul_nonneg (by positivity) unitWindowKinetic_nonneg) (sq_nonneg _)) + have hd := Real.sqrt_le_sqrt (mul_le_mul hQ hD hD0 hQ0) + have hf := mul_le_mul_of_nonneg_left (Real.rpow_le_rpow hN0 hN (by norm_num : (0:ℝ)≤2/3)) + (show 0≤(b⁻¹)^2*((Real.pi^2/2)*neumannBoundary) by positivity [neumannBoundary_nonneg]) + have hn' := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hN) + (show 0≤(2*Real.pi+1)/(2*b) by positivity [Real.pi_pos]) + dsimp only [Q,N,m,a,P] at hp hd hf hn' hB ⊢ + linarith + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/AtomicThinCounts.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/AtomicThinCounts.lean new file mode 100644 index 0000000000000000000000000000000000000000..43fa48da77acc584b1df4d7895c114f21b0ccfa5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/AtomicThinCounts.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RandomFields.ThinEnsemble +import OAI.Analysis.CoulombRadii.Localization.ShellChoice + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +def atomicPatchCountFactor : ℝ := (Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)^2*64 +lemma atomicPatchCountFactor_nonneg : 0≤atomicPatchCountFactor := by unfold atomicPatchCountFactor; positivity + +lemma atomicPatch_secondMoment {n : ℕ} (ψ : H1Vector n) + {δ P : ℝ} (hδ : 0≤δ) (hP : 0≤P) + (hc : ∀ z : Space, z≠0 → localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z))≤ + P*(screenMass δ (atomicCellScale z))^2) {y : Space} (hy : y≠0) : + localCountSecondMoment ψ (Metric.closedBall y (80*atomicCellScale y))≤ + atomicPatchCountFactor*P*(screenMass δ (atomicCellScale y))^2 := by + let A := fun z : {z : Space // z∈atomicPatchMesh} => + Metric.closedBall (atomicMeshCenter y z.val) (atomicCellScale (atomicMeshCenter y z.val)) + have hcover : Metric.closedBall y (80*atomicCellScale y) ⊆ ⋃ z, A z := by + intro x hx + obtain ⟨z,hz,hzx⟩ := atomicMesh_cover hy x (by simpa only [Metric.mem_closedBall,dist_eq_norm] using hx) + exact Set.mem_iUnion.mpr ⟨⟨z,hz⟩,by simpa only [A,Metric.mem_closedBall,dist_eq_norm] using hzx⟩ + have HE (z : {z : Space // z∈atomicPatchMesh}) : localCountSecondMoment ψ (A z)≤ + 64*P*(screenMass δ (atomicCellScale y))^2 := by + have hz : atomicMeshCenter y z.val≠0 := atomicCellScale_near_nonzero hy + (by nlinarith [atomicMeshCenter_distance y z.val z.property,atomicCellScale_nonneg y]) + have hu := atomicMeshCenter_comparable y z.val z.property + have Hm := screenMass_comparable hδ (atomicCellScale_pos hy) (show (1:ℝ)≤2 by norm_num) hu.1 (by linarith [hu.2]) + norm_num at Hm + apply (hc _ hz).trans + have HS := mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (screenMass_pos δ _).le Hm 2) hP + nlinarith + calc + _≤(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)*∑ z, localCountSecondMoment ψ (A z) := + localCountSecondMoment_cover ψ A (fun _ => measurableSet_closedBall) hcover + _≤(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)*∑ _ : {z : Space // z∈atomicPatchMesh}, + 64*P*(screenMass δ (atomicCellScale y))^2 := + mul_le_mul_of_nonneg_left (Finset.sum_le_sum (fun z _ => HE z)) (Nat.cast_nonneg _) + _=_ := by simp only [Finset.sum_const,Finset.card_univ,nsmul_eq_mul,atomicPatchCountFactor]; ring + +lemma exists_atomic_deletedShell {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) + {δ : ℝ} (hδ : 0≤δ) {y : Space} (hy : y≠0) {b : ℝ} (hb : 0 screenCountParameter_controls ψ hm δ hz) hy + have HM := localCountSecondMoment_mono ψ (A:=Metric.closedBall y (7*atomicCellScale y)) measurableSet_closedBall + (Metric.closedBall_subset_closedBall (show 7*atomicCellScale y≤80*atomicCellScale y by nlinarith [atomicCellScale_nonneg y])) + have Hmul := mul_le_mul_of_nonneg_left (HM.trans HP) + (show 0≤18*b/atomicCellScale y from div_nonneg (by positivity) (atomicCellScale_nonneg y)) + convert Hmul using 1 + ring + +def thinReserveFactor : ℝ := max 1 (3*thinCutCoefficient^2*(Fintype.card {z : Space // z∈atomicPatchMesh}:ℝ)*8) +lemma thinReserveFactor_ge_one : 1≤ thinReserveFactor := le_max_left _ _ +lemma thinReserveFactor_nonneg : 0≤ thinReserveFactor := le_trans zero_le_one thinReserveFactor_ge_one + +lemma thinIMS_budget {n : ℕ} (ψ : H1Vector n) (hm : mass ψ=1) + {δ P : ℝ} (hδ : 0≤δ) (hP : 1≤P) + (hc : ∀ z : Space, z≠0 → localCountSecondMoment ψ (Metric.closedBall z (atomicCellScale z))≤ + P*(screenMass δ (atomicCellScale z))^2) + {y : Space} (hy : y≠0) {t b : ℝ} (hb : 0 h) + exact hc.reindex (e p) I hi + have hsupp (p : Fin n → Fin 2) (I : Set (Fin (m p+k p))) (l : Fin 2) + (hi : ∀ i∈I, p (e p i)=l) (C : Set Space) (hC : ∀ z∉C, χ l z=0) : + PartlySupported (v p) I C := by + let K : Set (Fin n) := {i | p i=l} + have hc := labelCut_partlySupported ψ χ hχ hp D hD hd p K l (fun _ h => h) C hC + exact hc.reindex (e p) I hi + refine ⟨T,?_,?_,?_,?_,?_,?_,?_⟩ + · intro W hW hbound + dsimp [T,v] + simp only [potentialForm_reindex] + obtain ⟨M,hM⟩ := hbound + exact potentialForm_labelCut ψ χ hχ hp D hD hd W hW hM + · intro p + exact hanti p (coreIndexSet (m p) (k p)) 1 (by rintro _ ⟨i,rfl⟩; exact he1 p i) + · intro p + exact hanti p (outIndexSet (m p) (k p)) 0 (by rintro _ ⟨i,rfl⟩; exact he0 p i) + · intro p + exact hsupp p (coreIndexSet (m p) (k p)) 1 (by rintro _ ⟨i,rfl⟩; exact he1 p i) B hB + · intro p + exact hsupp p (outIndexSet (m p) (k p)) 0 (by rintro _ ⟨i,rfl⟩; exact he0 p i) A hA + · dsimp [totalMass,T,v] + simp only [mass_reindex] + exact mass_labelCut ψ χ hχ hp D hD hd + · dsimp [totalForm,T,v] + simp only [form_reindex] + +end RecordedEnsemble +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/CountTestFlux.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/CountTestFlux.lean new file mode 100644 index 0000000000000000000000000000000000000000..25aec24e4a1db3b9213ac10a1db5774652539729 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/CountTestFlux.lean @@ -0,0 +1,69 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.ScaledTest +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma countTest_laplacian_scaled (R : ℝ) (x : Position) : + coordinateLaplacian (Coulomb.countTest 0 R) x= + R⁻¹^2*coordinateLaplacian Coulomb.cutSeed (R⁻¹ • x) := by + unfold Coulomb.countTest + rw [Coulomb.coordinateLaplacian_scaled (Coulomb.cutSeed_smooth.of_le (WithTop.coe_le_coe.mpr le_top))] + simp only [sub_zero] + +lemma countTest_laplacian_inner {R : ℝ} {x : Position} (hx : ‖x‖ (1:ℝ)) := by + filter_upwards [continuous_norm.continuousAt.eventually (gt_mem_nhds hx)] with y hy + exact Coulomb.countTest_one 0 hR (by simpa only [sub_zero] using hy.le) + rw [coordinateLaplacian_congr_nhds he] + simp [coordinateLaplacian] + +lemma countTest_laplacian_abs_integral {R : ℝ} (hR : 0 |coordinateLaplacian Coulomb.cutSeed x|) R] + simp only [show Module.finrank ℝ Position=3 by simp [Position],smul_eq_mul,abs_of_pos (pow_pos hR 3)] + field_simp + +lemma countTest_pairing_bound {F : Position → ℝ} {C R : ℝ} + (hF : Measurable F) (hC : 0≤C) (hR : 0 |Δ x|) := (hΔc.integrable_of_hasCompactSupport hΔs).abs + have hb : ∀ x,|F x*Δ x|≤(C/R^4)*|Δ x| := by + intro x + by_cases hx : R≤‖x‖ + · rw [abs_mul] + apply mul_le_mul_of_nonneg_right ((hbound x hx).trans ?_) (abs_nonneg _) + exact div_le_div_of_nonneg_left hC (pow_pos hR 4) (pow_le_pow_left₀ hR.le hx 4) + · rw [show Δ x=0 from countTest_laplacian_inner (lt_of_not_ge hx)] + simp + have hi : Integrable (fun x => F x*Δ x) := + (hiΔ.const_mul (C/R^4)).mono' (hF.mul hΔc.measurable).aestronglyMeasurable + (Eventually.of_forall (fun x => by simpa only [Real.norm_eq_abs] using hb x)) + calc + _≤∫ x,|F x*Δ x| := abs_integral_le_integral_abs + _≤∫ x,(C/R^4)*|Δ x| := integral_mono hi.abs (hiΔ.const_mul _) hb + _=(C/R^4)*(R*(∫ x,|coordinateLaplacian Coulomb.cutSeed x|)) := by + rw [integral_const_mul,countTest_laplacian_abs_integral hR] + _=_ := by field_simp + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/FirstFiber.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/FirstFiber.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b8ac7c1a08df70f390facb11d76c3297c2b9547 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/FirstFiber.lean @@ -0,0 +1,75 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.LowProjection + +namespace OAI + +section +section +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +namespace Coulomb + +noncomputable def firstFiber {A : Type*} {n : ℕ} (f : (Fin (n+1) → A) → ℂ) + (z : (Fin n → A) × A) : ℂ := f (Fin.cons z.2 z.1) + +lemma firstFiber_memLp {A : Type*} [MeasurableSpace A] {μ : Measure A} [SigmaFinite μ] + {n : ℕ} {f : (Fin (n+1) → A) → ℂ} (hf : MemLp f 2 (Measure.pi fun _ => μ)) : + MemLp (firstFiber f) 2 ((Measure.pi fun _ : Fin n => μ).prod μ) := by + change MemLp (fun z : (Fin n → A) × A => f (Fin.cons z.2 z.1)) 2 _ + let e := (MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n+1) => A) 0).trans + (MeasurableEquiv.prodComm : A × (Fin n → A) ≃ᵐ (Fin n → A) × A) + have he : MeasurePreserving e (Measure.pi fun _ => μ) + ((Measure.pi fun _ : Fin n => μ).prod μ) := + (measurePreserving_piFinSuccAbove (fun _ => μ) 0).trans Measure.measurePreserving_swap + have hcons : ∀ z : (Fin n → A) × A, e.symm z = Fin.cons z.2 z.1 := by + intro z + ext i + refine Fin.cases ?_ (fun j => ?_) i + · simp [e, MeasurableEquiv.piFinSuccAbove, MeasurableEquiv.prodComm] + · simp [e, MeasurableEquiv.piFinSuccAbove, MeasurableEquiv.prodComm] + simpa only [Function.comp_def, hcons] using hf.comp_measurePreserving (he.symm e) + +lemma lowProjection_density_pauli {A ι : Type*} [MeasurableSpace A] {μ : Measure A} + [SigmaFinite μ] [SecondCountableTopology (Lp ℂ 2 μ)] {n : ℕ} + (f : (Fin (n+1) → A) → ℂ) (hf : MemLp f 2 (Measure.pi fun _ => μ)) + (ha : ProductAntisymmetric (μ := μ) f) + (v : ι → A → ℂ) (hv : ∀ i, MemLp (v i) 2 μ) + (ho : ∀ i j, (∫ a, star (v i a) * v j a ∂μ) = if i = j then (1 : ℂ) else 0) + (s : Finset ι) (x : A) : + ((n+1:ℕ):ℝ) * (∫ y : Fin n → A, ‖lowProjection (μ := μ) v s (firstFiber f) (y,x)‖^2 + ∂(Measure.pi fun _ => μ)) ≤ + (∑ i ∈ s, ‖v i x‖^2) * (∫ z, ‖f z‖^2 ∂(Measure.pi fun _ => μ)) := by + have H := contraction_pauli f hf ha (lowOrbital v s x) (lowOrbital_memLp v hv s x) + rw [lowOrbital_sq v hv ho] at H + have he := lowProjection_eq_contract v hv s (firstFiber_memLp hf) x + have he' : (∫ y : Fin n → A, ‖lowProjection (μ := μ) v s (firstFiber f) (y,x)‖^2 + ∂(Measure.pi fun _ => μ)) = + ∫ y : Fin n → A, ‖fiberContract (μ := μ) (lowOrbital v s x) (firstFiber f) y‖^2 + ∂(Measure.pi fun _ => μ) := integral_congr_ae (he.fun_comp fun z => ‖z‖^2) + rw [he'] + exact H + +lemma norm_sq_le_two_norm_sq_add_sub (a b : ℂ) : + ‖a‖^2 ≤ 2*‖b‖^2 + 2*‖a-b‖^2 := by + have h : ‖a‖ ≤ ‖b‖ + ‖a-b‖ := by + simpa only [add_sub_cancel] using norm_add_le b (a-b) + nlinarith [norm_nonneg a, norm_nonneg b, norm_nonneg (a-b), sq_nonneg (‖b‖-‖a-b‖)] + +lemma fiber_norm_sq_split {A : Type*} [MeasurableSpace A] {μ : Measure A} + {f g : A → ℂ} (hf : MemLp f 2 μ) (hg : MemLp g 2 μ) : + (∫ x, ‖f x‖^2 ∂μ) ≤ 2*(∫ x, ‖g x‖^2 ∂μ) + 2*(∫ x, ‖f x-g x‖^2 ∂μ) := by + have hi : Integrable (fun x => ‖f x-g x‖^2) μ := (hf.sub hg).norm.integrable_sq + calc + _ ≤ ∫ x, 2*‖g x‖^2 + 2*‖f x-g x‖^2 ∂μ := + integral_mono hf.norm.integrable_sq + ((hg.norm.integrable_sq.const_mul 2).add (hi.const_mul 2)) + (fun x => norm_sq_le_two_norm_sq_add_sub (f x) (g x)) + _ = _ := by rw [integral_add (hg.norm.integrable_sq.const_mul 2) + (hi.const_mul 2), integral_const_mul, integral_const_mul] + +end Coulomb + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/InverseDensityError.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/InverseDensityError.lean new file mode 100644 index 0000000000000000000000000000000000000000..fa788d03df2255c16d57dca08f3babe2a1db386d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/InverseDensityError.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.NearActiveMaximum +import OAI.Analysis.CoulombRadii.ThomasFermi.Rescaling +import OAI.Analysis.CoulombRadii.Packets.PhysicalInverseCap + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom +lemma tfDensityScalar_eq_scalar (v : ℝ) : tfDensityScalar v = Coulomb.tfScalarDensity v := + (tfScalarDensity_eq_kTF v).symm + +theorem inverse_density_error_parameters (cap : ℝ) {η : ℝ} (hη : 0 < η) : + ∃ hl hh ξ : ℝ, 0 < ξ ∧ ξ < hl/16 ∧ hl ≤ hh ∧ + ∀ d v : ℝ, 0 ≤ d → v ≤ cap → + (∀ h∈Icc hl hh, + (Coulomb.tfScalarDensity h ≤ d → h-ξ ≤ v) ∧ + (d ≤ Coulomb.tfScalarDensity h → v ≤ h+ξ)) → + |d-tfDensityScalar v| ≤ η := by + have hz : Coulomb.tfScalarDensity 0 = 0 := by simp [Coulomb.tfScalarDensity] + have htwo : Tendsto (fun x : ℝ => 2*x) (𝓝[>] 0) (𝓝 0) := by + simpa using (((tendsto_id : Tendsto (fun x : ℝ => x) (𝓝 0) (𝓝 0)).const_mul (2:ℝ)).mono_left nhdsWithin_le_nhds) + have hlim : Tendsto (fun x : ℝ => Coulomb.tfScalarDensity (2*x)) (𝓝[>] 0) (𝓝 0) := by + simpa only [hz, Function.comp_def] using (Coulomb.tfScalarDensity_continuous.tendsto 0).comp htwo + have hepos : ∀ᶠ x : ℝ in 𝓝[>] 0, 0 < x := self_mem_nhdsWithin + obtain ⟨hl,hhl,htf⟩ := (hepos.and (hlim.eventually (gt_mem_nhds hη))).exists + have hhl : 0 < hl := hhl + let hh := max (max cap 0 + 2) (2*hl) + have hhcap : cap+2 ≤ hh := by + have h1 : cap ≤ max cap 0 := le_max_left _ _ + have h2 : max cap 0+2 ≤ hh := le_max_left _ _ + linarith only [h1,h2] + have hh0 : 0 < hh := (by linarith [le_max_right cap 0] : (0:ℝ) < max cap 0+2).trans_le (le_max_left _ _) + have hhlhh : hl ≤ hh := (by linarith : hl ≤ 2*hl).trans (le_max_right _ _) + have hu := (isCompact_Icc : IsCompact (Icc (0:ℝ) hh)).uniformContinuousOn_of_continuous + Coulomb.tfScalarDensity_continuous.continuousOn + obtain ⟨δ,hδ,Hδ⟩ := Metric.uniformContinuousOn_iff.mp hu η hη + let ξ := min (hl/32) (min (δ/2) (1/2)) + have hξ : 0 < ξ := lt_min (by positivity) (lt_min (by positivity) (by norm_num)) + have hξhl : ξ < hl/16 := (min_le_left _ _).trans_lt (by linarith) + have hξδ : ξ < δ := ((min_le_right _ _).trans (min_le_left _ _)).trans_lt (by linarith) + have hξ1 : ξ ≤ 1/2 := (min_le_right _ _).trans (min_le_right _ _) + refine ⟨hl,hh,ξ,hξ,hξhl,hhlhh,?_⟩ + intro d v hd hv HI + rw [tfDensityScalar_eq_scalar] + have hdhi : d < Coulomb.tfScalarDensity hh := by + by_contra hh' + have H := (HI hh ⟨hhlhh,le_rfl⟩).1 (le_of_not_gt hh') + linarith only [H,hv,hhcap,hξ1] + by_cases hdlo : d ≤ Coulomb.tfScalarDensity hl + · have hvlo := (HI hl ⟨le_rfl,hhlhh⟩).2 hdlo + have hv2 : v ≤ 2*hl := by linarith only [hvlo,hξhl,hhl] + have hdη : d ≤ η := hdlo.trans ((Coulomb.tfScalarDensity_mono (by linarith : hl ≤ 2*hl)).trans htf.le) + have hvη : Coulomb.tfScalarDensity v ≤ η := (Coulomb.tfScalarDensity_mono hv2).trans htf.le + exact abs_le.mpr ⟨by linarith only [hd,hvη],by linarith only [hdη,Coulomb.tfScalarDensity_nonneg v]⟩ + · obtain ⟨t,ht,hdt⟩ := intermediate_value_Icc hhlhh Coulomb.tfScalarDensity_continuous.continuousOn + ⟨(lt_of_not_ge hdlo).le,hdhi.le⟩ + have HV := HI t ht + have hvt : |v-t| ≤ ξ := abs_le.mpr ⟨by linarith [HV.1 hdt.le],by linarith [HV.2 hdt.ge]⟩ + have hvp : max v 0 ∈ Icc (0:ℝ) hh := ⟨le_max_right _ _,max_le (hv.trans (by linarith only [hhcap])) hh0.le⟩ + have htp : t ∈ Icc (0:ℝ) hh := ⟨hhl.le.trans ht.1,ht.2⟩ + have hpdist : dist (max v 0) t < δ := by + rw [Real.dist_eq] + have H : max v 0 ≤ t+ξ := max_le + (by linarith [abs_le.mp hvt |>.2]) (by linarith only [htp.1,hξ]) + have H' : t-ξ ≤ max v 0 := (by linarith [abs_le.mp hvt |>.1] : t-ξ ≤ v).trans (le_max_left _ _) + exact (abs_le.mpr ⟨by linarith only [H'],by linarith only [H]⟩).trans_lt hξδ + have He := Hδ (max v 0) hvp t htp hpdist + rw [Real.dist_eq,hdt] at He + have hmax : Coulomb.tfScalarDensity (max v 0) = Coulomb.tfScalarDensity v := by simp [Coulomb.tfScalarDensity] + rw [hmax,abs_sub_comm] at He + exact He.le +end NeutralAtom +end + +end +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +theorem physical_tf_band {q : ℝ} (hq : 2 ≤ q) : ∃ C : ℝ,0 < C ∧ + ∀ D : ℝ,0 ≤ D → ∃ s₀ : ℝ,0 < s₀ ∧ s₀ ≤ 1 ∧ + ∀ {N J : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction (N+1)} {g : Gradient (N+1)}, + ∀ (hd : FormDomain ψ g) (hn : normSquared ψ=1), + (∀ (χ : Wavefunction (N+1)) (h : Gradient (N+1)),FormDomain χ h → normSquared χ=1 → + energy Z ψ g ≤ energy Z χ h) → + ∀ {E : ℝ},(E:EReal) ≤ Coulomb.unrestrictedFormBottom (Coulomb.atom Z hZ) → + energy Z ψ g ≤ E+D → ∀ {r₀ s : ℝ},0 < r₀ → 0 < s → s < s₀ → + ∀ (j : Fin J),r₀*2^j.val ≤ s → + letI := rawLaw_isProbability hd.2.2.1 hn + let P := observationLaw J (rawLaw ψ) + let rs := fun k : Fin J => r₀*2^k.val + ∃ G : Set (ObservationSample (N+1) J),MeasurableSet G ∧ P.real Gᶜ ≤ C*s^25 ∧ + ∀ o∈G,∀ y : Position,rs j ≤ ‖y‖ → ‖y‖ ≤ 4*q^2*(rs j) → + let μ := conditionalPacketDensity P Prod.fst (tailObservation rs j.val) + Coulomb.unitWindow 1 r₀ s (tailObservation rs j.val o) + screenedField (Z:ℝ) μ y ≤ physicalSpatialCap/‖y‖^4 ∧ + |μ y-tfDensityScalar (screenedField (Z:ℝ) μ y)| ≤ (q^8)⁻¹/‖y‖^6 := by + have hqpos : 0 < q := by linarith only [hq] + obtain ⟨hl,hh,ξ,hξ,hξhl,hhlhh,Herror⟩ := inverse_density_error_parameters physicalSpatialCap + (by positivity : 0 < (q^8)⁻¹) + obtain ⟨C,hC,H⟩ := physical_simultaneous_inverse_cap Coulomb.unitWindow Coulomb.unitWindow_support + Coulomb.unitWindow_mass Coulomb.unitWindow_radial (by norm_num : (0:ℝ) < 1) + (show 1 ≤ q^2 by nlinarith only [hq]) hξ (show ξ < hl from by linarith only [hξhl,hξ]) hhlhh + refine ⟨C,hC,?_⟩ + intro D hD + obtain ⟨s₀,hs₀,hs₀1,H⟩ := H D hD + refine ⟨s₀,hs₀,hs₀1,?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE he r₀ s hr₀ hs hss j hrjs + have := rawLaw_isProbability hd.2.2.1 hn + dsimp only + obtain ⟨G,hG,hp,HG⟩ := H Z hZ hd hn hmin hE he hr₀ hs hss j hrjs + have hrj : 0 < r₀*2^j.val := mul_pos hr₀ (by positivity) + refine ⟨G,hG.1,hp.trans (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ hrj.le hrjs 25) hC.le),?_⟩ + intro o ho y hy hy' + have hypos : 0 < ‖y‖ := hrj.trans_le hy + obtain ⟨hcap,HI⟩ := HG o ho y hy hy' + let P := observationLaw J (rawLaw ψ) + let rs := fun k : Fin J => r₀*2^k.val + let μ := conditionalPacketDensity P Prod.fst (tailObservation rs j.val) + Coulomb.unitWindow 1 r₀ s (tailObservation rs j.val o) + have hμ : 0 ≤ μ y := conditionalPacketDensity_nonneg P Prod.fst (tailObservation rs j.val) + Coulomb.unitWindow (by norm_num) hr₀ hs _ y + change screenedField (Z:ℝ) μ y ≤ _ ∧ |μ y-tfDensityScalar (screenedField (Z:ℝ) μ y)| ≤ _ + have hc : ‖y‖^4*screenedField (Z:ℝ) μ y ≤ physicalSpatialCap := hcap + refine ⟨(le_div_iff₀ (pow_pos hypos 4)).mpr (by simpa only [mul_comm] using hc),?_⟩ + have HE := Herror (‖y‖^6*μ y) (‖y‖^4*screenedField (Z:ℝ) μ y) + (mul_nonneg (pow_nonneg hypos.le 6) hμ) hc HI + rw [tfDensityScalar_dilate hypos,← mul_sub,abs_mul,abs_of_pos (pow_pos hypos 6)] at HE + exact (le_div_iff₀ (pow_pos hypos 6)).mpr (by simpa only [mul_comm] using HE) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/LpParameter.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/LpParameter.lean new file mode 100644 index 0000000000000000000000000000000000000000..31cc6b5cc80c1199b9f96260ce9fa445cc817e96 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/LpParameter.lean @@ -0,0 +1,241 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TfExtendNonneg +import OAI.Analysis.CoulombRadii.RandomFields.JointSlice + +namespace OAI + +noncomputable section + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Classical BigOperators Topology +namespace Coulomb + +lemma aestronglyMeasurable_of_dist {α B : Type*} [MeasurableSpace α] + {μ : Measure α} [MetricSpace B] [CompleteSpace B] [SecondCountableTopology B] + [MeasurableSpace B] [BorelSpace B] [Nonempty B] (f : α → B) + (h : ∀ b, AEMeasurable (fun x => dist (f x) b) μ) : AEStronglyMeasurable f μ := by + obtain ⟨v,hv⟩ := TopologicalSpace.exists_dense_seq B + let e : B → ℕ → ℝ := fun b n => dist b (v n) + have he : Continuous e := continuous_pi (fun n => continuous_id.dist continuous_const) + have hei : Function.Injective e := by + intro a b hab + have H : (fun z => dist a z)=(fun z => dist b z) := + Continuous.ext_on hv (continuous_const.dist continuous_id) + (continuous_const.dist continuous_id) (by + rintro _ ⟨n,rfl⟩ + exact congrFun hab n) + have HH := congrFun H b + simpa only [dist_self,dist_eq_zero] using HH + have hem := he.measurableEmbedding hei + apply (hem.aemeasurable_comp_iff.mp (AEMeasurable.of_eval (fun index => h (v index)))).aestronglyMeasurable + +lemma tfField_parameter_aestronglyMeasurable {A : Type*} [MeasurableSpace A] + {μ : Measure A} {Ω : Set Space} [IsFiniteMeasure (volume.restrict Ω)] + (W : A → TFLq (volume.restrict Ω)) (Φ : A × Space → ℝ) + (hΦ : AEStronglyMeasurable Φ (μ.prod (volume.restrict Ω))) + (hW : ∀ᵐ a ∂μ, W a =ᵐ[volume.restrict Ω] fun y => Φ (a,y)) : + AEStronglyMeasurable W μ := by + have : Fact (TFFieldExponent ≠ ∞) := ⟨by simp [TFFieldExponent]⟩ + let : MeasurableSpace (TFLq (volume.restrict Ω)) := borel _ + let : BorelSpace (TFLq (volume.restrict Ω)) := ⟨rfl⟩ + apply aestronglyMeasurable_of_dist + intro g + have hD := hΦ.sub ((Lp.aestronglyMeasurable g).comp_snd (μ := μ)) + have hI := (hD.enorm.pow_const (5/2:ℝ)).lintegral_prod_right' + have hM := (hI.pow_const (2/5:ℝ)).ennreal_toReal + apply hM.congr + filter_upwards [hW] with a ha + rw [Lp.dist_def] + have he : (⇑(W a)-⇑g) =ᵐ[volume.restrict Ω] fun y => Φ (a,y)-g y := by + filter_upwards [ha] with y hy + simp only [Pi.sub_apply,hy] + rw [eLpNorm_congr_ae he] + have hmeas := ((Lp.aestronglyMeasurable (W a)).sub (Lp.aestronglyMeasurable g)).congr he + norm_num [eLpNorm,eLpNorm',TFFieldExponent,hmeas] + +lemma coreScreenedField_memLp {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + {d : ℝ} (hd : 0 hn j x hx) + have hc : coreCoulombPotential u x≤C := coreCoulombPotential_bound u x + have hp := coreCoulombPotential_nonneg u x + have hA := attraction_nonneg S x + have hC : 0≤C := hp.trans hc + have hT : 0≤totalCharge S/d := hA.trans ha + rw [Real.norm_eq_abs] + apply abs_le.mpr + dsimp [coreScreenedField] + constructor <;> linarith + +def coreTFField {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + {d : ℝ} (hd : 0 + coreScreenedField S (u.coreSlice s z.1).normalized z.2) (volume.prod volume) := by + have H := restrictedCorePotential_normalized_slice_joint u s MeasurableSet.univ + have he (v : H1Vector k) : restrictedCorePotential v univ=coreCoulombPotential v := by + funext x + simp only [restrictedCorePotential,mem_univ,ite_true,coreCoulombPotential] + simp_rw [he] at H + exact ((attraction_measurable S).comp measurable_snd).aestronglyMeasurable.sub H + +lemma coreTFField_slice_aestronglyMeasurable {J m k : ℕ} (S : Nuclei J) + (u : H1Vector (m+k)) (s : Spins m) + {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + {d : ℝ} (hd : 0 coreTFField S (u.coreSlice s x).normalized hΩ hd hn) volume := by + apply tfField_parameter_aestronglyMeasurable _ + (fun z => coreScreenedField S (u.coreSlice s z.1).normalized z.2) + · exact (coreScreenedField_normalized_slice_joint S u s).mono_measure + (Measure.prod_mono le_rfl Measure.restrict_le_self) + · exact Eventually.of_forall (fun x => coreTFField_coe S _ hΩ hd hn) + +end Coulomb + +end +open MeasureTheory Filter Set +open scoped ENNReal NNReal Classical BigOperators Topology SchwartzMap +namespace Coulomb + +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + +lemma continuous_tfEnergy_joint (c : ℝ) : + Continuous (fun z : TFLq (volume.restrict Ω) × TFLp (volume.restrict Ω) => tfEnergy hΩ c z.1 z.2) := by + unfold tfEnergy tfFunctional + apply (((continuous_snd.norm.rpow_const (fun _ => Or.inr (by norm_num : (0:ℝ)≤5/3))).const_mul c).sub + tfFieldContinuous.continuous₂).add + exact ((tfCoulombContinuous hΩ).continuous₂.comp (continuous_snd.prodMk continuous_snd)).div_const 2 + +lemma continuous_tfMass : Continuous (fun f : TFLp (volume.restrict Ω) => ∫ x in Ω, f x) := by + let h1 : MemLp (fun _ : Space => (1:ℝ)) TFFieldExponent (volume.restrict Ω) := memLp_const 1 + let W : TFLq (volume.restrict Ω) := h1.toLp _ + have he : (fun f : TFLp (volume.restrict Ω) => ∫ x in Ω, f x) = tfFieldContinuous W := by + funext f + rw [tfFieldContinuous_apply] + apply integral_congr_ae + filter_upwards [h1.coeFn_toLp] with x hx + simp only [W,hx,one_mul] + rw [he] + exact (tfFieldContinuous W).continuous + +omit [IsFiniteMeasure (volume.restrict Ω)] in +include hΩ in +lemma integral_tfDensity [IsFiniteMeasure (volume.restrict Ω)] + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + (∫ x, tfDensity Ω f x)=∫ x in Ω, f x := by + rw [integral_congr_ae (tfDensity_ae_tfExtend hΩ hf)] + exact integral_indicator hΩ + +lemma localTFEnergy_nonpos (W : TFLq (volume.restrict Ω)) : + tfEnergy hΩ thomasFermiKineticConstant W (localTFMinimizer hΩ W)≤0 := by + have H := localTFMinimizer_minimizes hΩ W (f := 0) (by + filter_upwards [Lp.coeFn_zero ℝ TFExponent (volume.restrict Ω)] with x hx + simp only [hx,Pi.zero_apply,le_refl]) + simpa only [tfEnergy,tfFunctional,norm_zero,Real.zero_rpow (by norm_num : (5/3:ℝ)≠0), + mul_zero,map_zero,sub_zero,_root_.zero_apply,zero_div,add_zero] using H + +lemma localTFEnergy_abs_bound {D F : ℝ} (hD : 0 w x*(F x)^2) μ) + {D : ℝ} (hD : 0 w x*(∫ y, localTFDensity hΩ (W x) y)) μ ∧ + Integrable (fun x => w x*tfEnergy hΩ thomasFermiKineticConstant (W x) (localTFMinimizer hΩ (W x))) μ := by + have hf := (continuous_localTFMinimizer hΩ).comp_aestronglyMeasurable hWm + have hm : AEStronglyMeasurable (fun x => ∫ y, localTFDensity hΩ (W x) y) μ := by + have he : (fun x => ∫ y, localTFDensity hΩ (W x) y)= + (fun x => ∫ y in Ω, localTFMinimizer hΩ (W x) y) := by + funext x + exact integral_tfDensity hΩ (localTFMinimizer_nonneg hΩ (W x)) + rw [he] + exact (continuous_tfMass).comp_aestronglyMeasurable hf + have he := (continuous_tfEnergy_joint hΩ thomasFermiKineticConstant).comp_aestronglyMeasurable + (hWm.prodMk hf) + constructor + · apply ((hw.add hFi).const_mul D).mono' (hw.aestronglyMeasurable.mul hm) + filter_upwards [hw0,hF,hcap] with x hx hf hc + have H := localTFMass_bound hΩ hD hf hd (W x) hc + dsimp only [Pi.mul_apply, Pi.add_apply] + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg hx H.1)] + have HH := mul_le_mul_of_nonneg_left H.2 hx + have hsq := mul_nonneg hx (sq_nonneg (F x-1)) + have hmul := mul_nonneg hD.le hsq + nlinarith + · apply (hFi.const_mul (D/2)).mono' (hw.aestronglyMeasurable.mul he) + filter_upwards [hw0,hF,hcap] with x hx hf hc + dsimp only [Pi.mul_apply] + rw [norm_mul,Real.norm_eq_abs,abs_of_nonneg hx,Real.norm_eq_abs] + have H := mul_le_mul_of_nonneg_left (localTFEnergy_abs_bound hΩ hD hf hd (W x) hc) hx + calc + _ ≤ w x*(D*F x^2/2) := H + _ = _ := by ring + +lemma coreTF_conditional_integrable {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + (s : Spins m) {d : ℝ} (hd : 0 mass (u.coreSlice s x)*(F x)^2)) + (hcap : ∀ᵐ x, ∀ y∈Ω, coreScreenedField S (u.coreSlice s x).normalized y≤F x) : + Integrable (fun x => mass (u.coreSlice s x)*(∫ y, + localTFDensity hΩ (coreTFField S (u.coreSlice s x).normalized hΩ hd hn) y)) ∧ + Integrable (fun x => mass (u.coreSlice s x)*rawThomasFermiEnergy + (coreScreenedField S (u.coreSlice s x).normalized) + (localTFDensity hΩ (coreTFField S (u.coreSlice s x).normalized hΩ hd hn))) := by + have H := conditional_localTF_integrable hΩ _ (coreTFField_slice_aestronglyMeasurable S u s hΩ hd hn) + (fun x => mass (u.coreSlice s x)) F (mass_coreSlice_integrable u s) + (Eventually.of_forall (fun x => mass_nonneg _)) hF hFi hD hdiam (show ∀ᵐ x, + ∀ᵐ y ∂volume.restrict Ω, coreTFField S (u.coreSlice s x).normalized hΩ hd hn y≤F x from ?_) + · refine ⟨H.1,H.2.congr (Eventually.of_forall (fun x => ?_))⟩ + apply congrArg (fun E => mass (u.coreSlice s x)*E) + exact (rawThomasFermiEnergy_tfDensity hΩ _ _ (coreTFField_coe S _ hΩ hd hn) + (localTFMinimizer_nonneg hΩ _)).symm + · filter_upwards [hcap] with x hx + filter_upwards [ae_restrict_mem hΩ,coreTFField_coe S (u.coreSlice s x).normalized hΩ hd hn] with y hy he + rw [he] + exact hx y hy + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PacketFrame.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PacketFrame.lean new file mode 100644 index 0000000000000000000000000000000000000000..3fa8f38f107565490ce20bca2472edee8a5af515 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PacketFrame.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.HilbertBasisSumSqInner +import OAI.Analysis.CoulombRadii.FormDomain.PacketStateL2Norm + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set Filter +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set +open scoped BigOperators ENNReal Classical NNReal ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set +open scoped BigOperators ENNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open MeasureTheory Set Filter +open scoped ENNReal NNReal ContDiff +open scoped Classical +open scoped BigOperators ComplexConjugate +open scoped Classical +open scoped Classical +open MeasureTheory Set Filter +open scoped Classical ENNReal NNReal ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter Module Module.End TopologicalSpace Function +open scoped Classical ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap FourierTransform ComplexConjugate +namespace Coulomb +noncomputable def packetFrame (g : 𝓢(Space,ℂ)) (μ : Measure (Space × Space)) : + Lp ℂ 2 (volume : Measure Space) →L[ℂ] Lp ℂ 2 (volume : Measure Space) := + frameOperator μ (fun yp : Space × Space => (packetState g yp.1 yp.2).toLp 2 volume) + +lemma packetFrame_schwartz_quadratic_le (g h : 𝓢(Space,ℂ)) + (hg : (∫ x : Space, ‖g x‖^2) = 1) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] (hμ : μ ≤ volume.prod volume) : + (inner ℂ (h.toLp 2 volume) (packetFrame g μ (h.toLp 2 volume))).re ≤ + ‖h.toLp 2 volume‖^2 := by + rw [packetFrame, frameOperator_quadratic (packetState_toL2_memLp g μ)] + simp only [packetState_inner] + calc + _ ≤ ∫ yp : Space × Space, ‖packetAnalysis g h yp.1 yp.2‖^2 ∂volume.prod volume := + integral_mono_measure hμ (Filter.Eventually.of_forall fun _ => sq_nonneg _) + (packetAnalysis_integrable g h) + _ = ‖h.toLp 2 volume‖^2 := by + rw [packetAnalysis_resolution, hg, one_mul, schwartz_toL2_norm_sq] + +lemma packetFrame_quadratic_le (g : 𝓢(Space,ℂ)) + (hg : (∫ x : Space, ‖g x‖^2) = 1) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] (hμ : μ ≤ volume.prod volume) + (u : Lp ℂ 2 (volume : Measure Space)) : + (inner ℂ u (packetFrame g μ u)).re ≤ ‖u‖^2 := by + refine DenseRange.induction_on + (p := fun w : Lp ℂ 2 (volume : Measure Space) => + (inner ℂ w (packetFrame g μ w)).re ≤ ‖w‖^2) + (SchwartzMap.denseRange_toLpCLM (F := ℂ) (E := Space) + (p := 2) (μ := (volume : Measure Space)) (by simp)) u ?_ ?_ + · exact isClosed_le (Complex.continuous_re.comp + (continuous_id.inner (packetFrame g μ).continuous)) (continuous_norm.pow 2) + · intro h + exact packetFrame_schwartz_quadratic_le g h hg μ hμ + +lemma packetFrame_positive (g : 𝓢(Space,ℂ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + (packetFrame g μ).toLinearMap.IsPositive := + frameOperator_positive (packetState_toL2_memLp g μ) + +lemma packetFrame_complement_positive (g : 𝓢(Space,ℂ)) + (hg : (∫ x : Space, ‖g x‖^2) = 1) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] (hμ : μ ≤ volume.prod volume) : + (ContinuousLinearMap.id ℂ (Lp ℂ 2 (volume : Measure Space)) - packetFrame g μ).toLinearMap.IsPositive := by + apply id_sub_frameOperator_positive (packetState_toL2_memLp g μ) + intro u + rw [← frameOperator_quadratic (packetState_toL2_memLp g μ)] + exact packetFrame_quadratic_le g hg μ hμ u + +lemma packetFrame_compact (g : 𝓢(Space,ℂ)) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : IsCompactOperator (packetFrame g μ) := + frameOperator_compact (packetState_toL2_memLp g μ) + +lemma packetFrame_spectral_trace (g : 𝓢(Space,ℂ)) + (hg : (∫ x : Space, ‖g x‖^2) = 1) + (μ : Measure (Space × Space)) [IsFiniteMeasure μ] : + HasSum (fun i : Σ z, eigenspaceBasisSet (packetFrame g μ) z => i.1.re) (μ.real univ) := by + let : Fact ((2 : ℝ≥0∞) ≠ ⊤) := ⟨by simp⟩ + have h := frameOperator_spectral_hasSum (packetState_toL2_memLp g μ) + simpa only [packetFrame, packetState_toL2_norm, integral_const, smul_eq_mul, schwartz_toL2_norm_sq, hg, mul_one] using h +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchFieldMeans.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchFieldMeans.lean new file mode 100644 index 0000000000000000000000000000000000000000..3cc842b9f9416222911f9f97342475e13133220e --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchFieldMeans.lean @@ -0,0 +1,92 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.FreshFieldTransfer +import OAI.Analysis.CoulombRadii.FieldAnalysis.FreshMeanBounds + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical +noncomputable section +namespace Coulomb + +lemma patch_TF_center_bound {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t : ℝ} (ha : 0 patch_nucleus_separation S ha hb ht.2 y hn j x hy) + exact tfScreened_three_quarters measurableSet_ball thomasFermiKineticConstant_pos + (div_nonneg (totalCharge_nonneg S) ha.le) W hW + (localTFMinimizer_nonneg measurableSet_ball W) (fun f hf => localTFMinimizer_minimizes measurableSet_ball W hf) + (patch_continuous_field S u ha hb ht.2 y hu hn) Metric.isOpen_ball + (coreTFField_coe S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht.2 y hn)) + (patch_harmonic_field S u ha hb ht.2 y hu hn) ha (patch_inner_ball ha hb hsmall ht.1 y) + (by simpa using (Metric.mem_closedBall_self (x:=y) (show 0≤3*a by positivity))) + +theorem patch_field_mean_lower {J n : ℕ} (S : Nuclei J) (T : RecordedEnsemble n) + {a b t q L : ℝ} (ha : 0 mass ((T.vector p).coreSlice s x)* + max (-patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0)) + (hgood : ∀ p s, ∀ᵐ x, mass ((T.vector p).coreSlice s x)≠0 → + patchSliceTFGap S (T.vector p) ha hb ht.2 y hn s x≤q → + L≤patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) : + L*T.totalMass-(L/q)*(∑ p,sliceExpectation (T.vector p) (patchSliceTFGap S (T.vector p) ha hb ht.2 y hn))- + (∑ p,sliceExpectation (T.vector p) (fun s x => + max (-patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) 0))≤ + ∑ p,sliceExpectation (T.vector p) (fun s x => + patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y) := by + have hs (p : T.index) (s : Spins (T.out p)) : ∀ᵐ x, + SpatiallySupported ((T.vector p).coreSlice s x).normalized {z | t≤‖z-y‖} := + ((hcs p).coreSlice s).mono (fun _ hx => hx.normalized) + have H (p : T.index) (s : Spins (T.out p)) := NeutralAtom.weighted_field_mean_lower + (mass_coreSlice_integrable (T.vector p) s) (Eventually.of_forall (fun _ => mass_nonneg _)) + (patchTFScreenedField_weight_integrable S (T.vector p) ha hb hsmall ht y hn ha le_rfl + (by norm_num : (0:ℝ)<1) (hs p) s) + (patchSliceTFGap_weight_integrable S (T.vector p) ha hb ht.2 y hn s (hs p s)) (hneg p s) hq hL + (Eventually.of_forall (fun x => patchSliceTFGap_nonneg S (T.vector p) ha hb ht.2 y hn s x)) (hgood p s) + have HP (p : T.index) := Finset.sum_le_sum (s:=Finset.univ) (fun s _ => H p s) + simp only [Finset.sum_sub_distrib,←Finset.mul_sum,integral_mass_coreSlice] at HP + have HH := Finset.sum_le_sum (s:=Finset.univ) (fun p _ => HP p) + simpa only [Finset.sum_sub_distrib,←Finset.mul_sum,RecordedEnsemble.totalMass,sliceExpectation] using HH + +theorem patch_field_mean_upper {J n : ℕ} (S : Nuclei J) (T : RecordedEnsemble n) + {a b t q U : ℝ} (ha : 0 + patchTFScreenedField S ((T.vector p).coreSlice s x).normalized ha hb ht.2 y hn y))≤ + U*T.totalMass+((tfInteriorConstant thomasFermiKineticConstant/a^4)/q)* + (∑ p,sliceExpectation (T.vector p) (patchSliceTFGap S (T.vector p) ha hb ht.2 y hn)) := by + have hs (p : T.index) (s : Spins (T.out p)) : ∀ᵐ x, + SpatiallySupported ((T.vector p).coreSlice s x).normalized {z | t≤‖z-y‖} := + ((hcs p).coreSlice s).mono (fun _ hx => hx.normalized) + have H (p : T.index) (s : Spins (T.out p)) := NeutralAtom.weighted_field_mean_upper + (mass_coreSlice_integrable (T.vector p) s) (Eventually.of_forall (fun _ => mass_nonneg _)) + (patchTFScreenedField_weight_integrable S (T.vector p) ha hb hsmall ht y hn ha le_rfl + (by norm_num : (0:ℝ)<1) (hs p) s) + (patchSliceTFGap_weight_integrable S (T.vector p) ha hb ht.2 y hn s (hs p s)) hq hU + (div_nonneg (tfInteriorConstant_nonneg _) (pow_nonneg ha.le _)) + (Eventually.of_forall (fun x => patchSliceTFGap_nonneg S (T.vector p) ha hb ht.2 y hn s x)) + ((hs p s).mono (fun x hx _ => patch_TF_center_bound S _ ha hb hsmall ht y hx hn)) (hgood p s) + have HP (p : T.index) := Finset.sum_le_sum (s:=Finset.univ) (fun s _ => H p s) + simp only [Finset.sum_add_distrib,←Finset.mul_sum,integral_mass_coreSlice] at HP + have HH := Finset.sum_le_sum (s:=Finset.univ) (fun p _ => HP p) + simpa only [Finset.sum_add_distrib,←Finset.mul_sum,RecordedEnsemble.totalMass,sliceExpectation] using HH +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchGeometry.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..4c8e5de7fa2edefaab0fd2dc1bb470ee55772b8b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchGeometry.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PhysicalPoisson +import OAI.Analysis.CoulombRadii.ThomasFermi.TFInterior +import OAI.Analysis.CoulombRadii.ThomasFermi.LpParameter +import OAI.Analysis.CoulombRadii.ThomasFermi.TFCountTest + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology ContDiff SchwartzMap Pointwise +noncomputable section +namespace Coulomb + +instance finite_volume_ball (y : Space) (r : ℝ) : IsFiniteMeasure (volume.restrict (Metric.ball y r)) := + isFiniteMeasure_restrict.mpr ((measure_mono Metric.ball_subset_closedBall).trans_lt + (isCompact_closedBall y r).measure_lt_top).ne + +lemma patch_nucleus_separation {J : ℕ} (S : Nuclei J) {a b t : ℝ} (ha : 0 hz) ?_).mono Metric.ball_subset_closedBall + intro j hj + have hh : ‖S.position j-y‖≤t-4*b := by simpa only [Metric.mem_closedBall,dist_eq_norm] using hj + linarith [hn j] + +lemma patch_harmonic_field {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t : ℝ} (ha : 0 0) := by + apply coreScreenedField_weak_harmonic S u hu + · apply Set.disjoint_left.mpr + intro z hz hz' + have hh : ‖z-y‖ hx (scaledWindow_support unitWindow unitWindow_support hb x h)) + intro hm + have hle : ‖w‖≤b := by simpa only [Metric.mem_closedBall,dist_zero_right] using hs hm + linarith + exact hn' hw + have htri : ‖v+w-y‖≤‖v-y‖+‖w‖ := by + simpa only [show v+w-y=(v-y)+w by abel] using norm_add_le (v-y) w + change t≤‖v+w-y‖ at hz + linarith + · intro z hz x hx + have hh : ‖x-y‖ localTFMinimizer_minimizes measurableSet_ball W hg) + (patch_continuous_field S u ha hb ht.2 y hu hn) Metric.isOpen_ball + (coreTFField_coe S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht.2 y hn)) + (patch_harmonic_field S u ha hb ht.2 y hu hn) ha (patch_inner_ball ha hb hsmall ht.1 y) + have H' := tfDensity_test_bound measurableSet_ball (localTFMinimizer_nonneg measurableSet_ball W) y + (by positivity : 0<3*a/2) (by positivity [tfInteriorConstant_nonneg thomasFermiKineticConstant,thomasFermiKineticConstant_pos] : 0≤(tfInteriorConstant thomasFermiKineticConstant/(thomasFermiKineticConstant*(5/3:ℝ)))^(3/2:ℝ)/a^6) + (by simpa only [show 2*(3*a/2)=3*a by ring] using H) + apply H'.trans_eq + unfold tfInteriorCountConstant + field_simp + ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchNegativeCost.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchNegativeCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..51eaddd4298e4098eb59b8cbef1b0a9e9e07aed7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchNegativeCost.lean @@ -0,0 +1,187 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.PatchComparison +import OAI.Analysis.CoulombRadii.ThomasFermi.TFOscillation +import OAI.Analysis.CoulombRadii.ThomasFermi.TFNegativeGap +import OAI.Analysis.CoulombRadii.Screening.NegativeCost + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + +include hΩ in +lemma tf_negative_cost_integrable (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {f : TFLp (volume.restrict Ω)} {σ : Space → ℝ} + (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x=0) : + Integrable (fun x => max (tfPotential f x-Φ x) 0*σ x) := by + have : ENNReal.HolderConjugate TFFieldExponent TFExponent := + coulomb_holder_exponents.ennrealOfReal + have H : IntegrableOn (fun x => (tfPotential f x-Φ x)*σ x) Ω := + ((tfPotential_memLp hΩ f).sub ((memLp_congr_ae hW).mp (Lp.memLp W))).integrable_mul hσ + have Hi : Integrable (fun x => (tfPotential f x-Φ x)*σ x) := by + apply (H.integrable_indicator hΩ).congr + filter_upwards [] with x + by_cases hx : x∈Ω + · simp [hx] + · simp [hx,hs x hx] + apply Hi.pos_part.congr + filter_upwards [hp] with x hx + rw [max_mul_of_nonneg _ _ hx,zero_mul] + +lemma rawTF_negativeError_le_gap (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x=0) : + rawTFNegativeError Φ (localTFDensity hΩ W) σ ≤ + rawThomasFermiEnergy Φ σ-rawThomasFermiEnergy Φ (localTFDensity hΩ W) := by + have H := raw_localTF_refined_gap_density hΩ Φ W hW hσ (ae_restrict_of_ae hp) hs + have hρ : MemLp (localTFDensity hΩ W) TFExponent volume := + tfDensity_memLp hΩ (localTFMinimizer_nonneg hΩ W) + have hpQ := raw_coulomb_nonneg hΩ (hσ.sub (hρ.restrict (s := Ω))) + (fun x hx => by change σ x-localTFDensity hΩ W x=0; rw [hs x hx,show localTFDensity hΩ W x=0 from tfDensity_eq_zero _ hx,sub_self]) + change 0 ≤ coulombBilinear (fun x => σ x-localTFDensity hΩ W x) + (fun x => σ x-localTFDensity hΩ W x) at hpQ + linarith + +lemma tf_negative_center_le_gap (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x=0) + (χ : Space → ℝ) (y : Space) (θ B K m : ℝ) + (hθ : 0 ≤ θ) (hθh : θ ≤ 1/2) (hB : 0 ≤ B) (hK : 0 ≤ K) (hm : 0 < m) + (hχ : ∀ᵐ x, 0 ≤ χ x ∧ χ x ≤ K) (hi : Integrable (fun x => σ x*χ x)) + (hmass : m ≤ ∫ x, σ x*χ x) + (hosc : ∀ᵐ x, χ x≠0 → + ‖(Φ x-tfPotential (localTFMinimizer hΩ W) x)- + (Φ y-tfPotential (localTFMinimizer hΩ W) y)‖ ≤ + θ*(B+max (-(Φ y-tfPotential (localTFMinimizer hΩ W) y)) 0)) : + max (-(Φ y-tfPotential (localTFMinimizer hΩ W) y)) 0 ≤ + (2*K/m)*(rawThomasFermiEnergy Φ σ-rawThomasFermiEnergy Φ (localTFDensity hΩ W))+2*θ*B := by + have hc := tf_negative_cost_integrable hΩ Φ W hW (f := localTFMinimizer hΩ W) hσ hp hs + have he : (∫ x, max (-(Φ x-tfPotential (localTFMinimizer hΩ W) x)) 0*σ x)= + rawTFNegativeError Φ (localTFDensity hΩ W) σ := by + rw [tfPotential_eq_density hΩ (localTFMinimizer_nonneg hΩ W)] + simp only [neg_sub,NeutralAtom.potentialOf,rawTFNegativeError,localTFDensity,NeutralAtom.coulombKernel,coulombKernel] + have H := NeutralAtom.negative_center_of_test_mass + (fun x => Φ x-tfPotential (localTFMinimizer hΩ W) x) σ χ + (Φ y-tfPotential (localTFMinimizer hΩ W) y) θ B K m hθ hθh hB hK hm hp hχ hi + (by simpa only [neg_sub] using hc) hmass hosc + rw [he] at H + have Hg := mul_le_mul_of_nonneg_left (rawTF_negativeError_le_gap hΩ Φ W hW hσ hp hs) + (show 0 ≤ 2*K/m by positivity) + linarith + +omit hΩ [IsFiniteMeasure (volume.restrict Ω)] in + +theorem exists_patch_negative_center_bound : + ∃ C : ℝ, 0 < C ∧ ∀ {J k n : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t r : ℝ} (ha : 0 < a) (hb : 0 < b) (hsmall : 18*b ≤ a) + (ht : t∈Set.Icc (5*a) (6*a)) (y : Space), + SpatiallySupported u {z | t ≤ ‖z-y‖} → + ∀ (hn : ∀ j, 20*a ≤ ‖S.position j-y‖), 0 ≤ r → r ≤ a → C*(r/a) ≤ 1/2 → + ∀ (x : Configuration n) (χ : Space → ℝ) (K m : ℝ), 0 ≤ K → 0 < m → + (∀ᵐ z, 0 ≤ χ z ∧ χ z ≤ K) → + Integrable (fun z => retainedFineDensity b (patchRetained y t b x) (position x) z*χ z) → + (∀ z, χ z≠0 → ‖z-y‖ ≤ r) → + m ≤ ∫ z, retainedFineDensity b (patchRetained y t b x) (position x) z*χ z → + max (-patchTFScreenedField S u ha hb ht.2 y hn y) 0 ≤ + (2*K/m)*(rawThomasFermiEnergy (coreScreenedField S u) + (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy (coreScreenedField S u) + (localTFDensity measurableSet_ball (coreTFField S u measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn))))+2*(C*(r/a))*((a^4)⁻¹) := by + obtain ⟨C,hC,H⟩ := exists_patch_TF_oscillation + refine ⟨C,hC,?_⟩ + intro J k n S u a b t r ha hb hsmall ht y hu hn hr hra hθ x χ K m hK hm hχ hi hs hmass + let W := coreTFField S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht.2 y hn) + apply tf_negative_center_le_gap measurableSet_ball (coreScreenedField S u) W + (coreTFField_coe S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht.2 y hn)) + (retainedFineDensity_memLp hb _ _) (Eventually.of_forall (fun _ => retainedFineDensity_nonneg ..)) + (retainedFineDensity_patch_support hb y t x) χ y (C*(r/a)) ((a^4)⁻¹) K m + (by positivity) hθ (by positivity) hK hm hχ hi hmass + filter_upwards [] with z + intro hz + have hzr := hs z hz + have hza : z∈Metric.closedBall y a := by simpa [Metric.mem_closedBall,dist_eq_norm] using hzr.trans hra + have hosc := H S u ha hb hsmall ht y hu hn z hza + apply hosc.trans + exact mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right hzr ha.le) hC.le) (by positivity) + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb + +def patchSliceTFGap {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + {a b t : ℝ} (ha : 0 retainedFineDensity_nonneg b _ _ z)) + (retainedFineDensity_patch_support hb y t x) + apply le_trans _ H + exact integral_nonneg (fun z => mul_nonneg (le_max_right _ _) + (retainedFineDensity_nonneg b _ _ z)) + +lemma patchSliceTFGap_weight_integrable {J m k : ℕ} (S : Nuclei J) (u : H1Vector (m+k)) + {a b t : ℝ} (ha : 0 mass (u.coreSlice s x)*patchSliceTFGap S u ha hb ht y hn s x) := by + have hT := (coreTF_conditional_integrable measurableSet_ball S u s ha + (patch_nucleus_separation S ha hb ht y hn) (show 0<12*a by positivity) + (patch_diameter ha hb ht y) (fun _ => totalCharge S/a) + (Eventually.of_forall (fun _ => div_nonneg (totalCharge_nonneg S) ha.le)) + ((mass_coreSlice_integrable u s).mul_const ((totalCharge S/a)^2)) + (show ∀ᵐ x, ∀ z∈Metric.ball y (t-4*b), + coreScreenedField S (u.coreSlice s x).normalized z≤totalCharge S/a from ?_)).2 + · have hF : Integrable (fun x => mass (u.coreSlice s x)* + rawThomasFermiEnergy (coreScreenedField S (u.coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))) := by + apply (discreteFineTF_weight_integrable S u hb (patchRetained y t b) + (patchRetained_measurable y t b) s).congr + filter_upwards [hcs] with x hx + rw [discreteFineTF_eq_raw S u hb (patchRetained y t b) s x hx ?_ + (patch_retained_separated ha hb y x)] + intro j i hi + have hret := (patchRetained_mem ..).mp hi + have H := norm_sub_le_norm_sub_add_norm_sub (S.position j) (position x i) y + have hs : Real.sqrt 3≤2 := (Real.sqrt_le_iff).mpr ⟨by norm_num,by norm_num⟩ + nlinarith [hn j] + apply (hF.sub hT).congr + filter_upwards [] with x + simp only [patchSliceTFGap,Pi.sub_apply,mul_sub] + · filter_upwards [] with x + intro z hz + apply (sub_le_self _ (coreCoulombPotential_nonneg _ z)).trans + exact attraction_le_totalCharge_div S ha z + (fun j => patch_nucleus_separation S ha hb ht y hn j z hz) + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchResponse.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchResponse.lean new file mode 100644 index 0000000000000000000000000000000000000000..84378e73be444993c2973645c2c7f48cba1b2b56 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/PatchResponse.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TFOscillation + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace Coulomb + +def tfScalarDensity (v : ℝ) : ℝ := + (max v 0/(thomasFermiKineticConstant*(5/3:ℝ)))^(3/2:ℝ) + +lemma tfScalarDensity_nonneg (v : ℝ) : 0≤tfScalarDensity v := by + unfold tfScalarDensity + have hc := thomasFermiKineticConstant_pos + positivity + +lemma tfScalarDensity_mono : Monotone tfScalarDensity := by + intro v w hvw + have hc := thomasFermiKineticConstant_pos + apply Real.rpow_le_rpow (by positivity) _ (by norm_num) + apply div_le_div_of_nonneg_right (max_le_max_right 0 hvw) + exact mul_nonneg thomasFermiKineticConstant_pos.le (by norm_num) + +lemma localTFDensity_euler {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W=ᵐ[volume.restrict Ω] Φ) : + ∀ᵐ x, x∈Ω → localTFDensity hΩ W x= + tfScalarDensity (Φ x-tfPotential (localTFMinimizer hΩ W) x) := by + have HE := tfEuler_equation hΩ thomasFermiKineticConstant_pos W + (localTFMinimizer_nonneg hΩ W) (fun f hf => localTFMinimizer_minimizes hΩ W hf) + filter_upwards [(ae_restrict_iff' hΩ).mp HE,(ae_restrict_iff' hΩ).mp hW, + tfDensity_ae_tfExtend hΩ (localTFMinimizer_nonneg hΩ W)] with x he hw hd + intro hx + change tfDensity Ω (localTFMinimizer hΩ W) x=_ + rw [hd,tfExtend,indicator_of_mem hx,(he hx).1,hw hx] + rfl + +lemma localTFDensity_test_enclosure {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W=ᵐ[volume.restrict Ω] Φ) + (χ : Space → ℝ) (hχm : Measurable χ) (hχi : Integrable χ) + (hχp : ∀ x, 0≤χ x) (B : ℝ) (hB : ∀ x, |χ x|≤B) + (hs : ∀ x, χ x≠0 → x∈Ω) (u d : ℝ) + (hosc : ∀ x, χ x≠0 → |(Φ x-tfPotential (localTFMinimizer hΩ W) x)-u|≤d) : + tfScalarDensity (u-d)*(∫ x, χ x)≤∫ x, localTFDensity hΩ W x*χ x ∧ + (∫ x, localTFDensity hΩ W x*χ x)≤tfScalarDensity (u+d)*(∫ x, χ x) := by + have hρi : Integrable (localTFDensity hΩ W) := + (tfExtend_integrable hΩ (localTFMinimizer hΩ W)).congr + (tfDensity_ae_tfExtend hΩ (localTFMinimizer_nonneg hΩ W)).symm + have hi : Integrable (fun x => localTFDensity hΩ W x*χ x) := + hρi.mul_bdd hχm.aestronglyMeasurable (Eventually.of_forall (fun x => by + simpa only [Real.norm_eq_abs] using hB x)) + have H := localTFDensity_euler hΩ Φ W hW + have hh : ∀ᵐ x, tfScalarDensity (u-d)*χ x≤localTFDensity hΩ W x*χ x ∧ + localTFDensity hΩ W x*χ x≤tfScalarDensity (u+d)*χ x := by + filter_upwards [H] with x hx + by_cases hz : χ x=0 + · simp [hz] + rw [hx (hs x hz)] + have hr := abs_le.mp (hosc x hz) + exact ⟨mul_le_mul_of_nonneg_right (tfScalarDensity_mono (by linarith : u-d≤_)) (hχp x), + mul_le_mul_of_nonneg_right (tfScalarDensity_mono (by linarith : _≤u+d)) (hχp x)⟩ + have hl := integral_mono_ae (hχi.const_mul _) hi (hh.mono (fun _ h => h.1)) + have hu := integral_mono_ae hi (hχi.const_mul _) (hh.mono (fun _ h => h.2)) + simpa only [integral_const_mul] using And.intro hl hu + +theorem exists_patch_tested_reaction_enclosure : + ∃ C : ℝ, 0 mass (ψ.coreSlice s x)*rawThomasFermiEnergy + (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))) := by + apply (discreteFineTF_weight_integrable S ψ hb (patchRetained y t b) (patchRetained_measurable y t b) s).congr + filter_upwards [hcs] with x hx + congr 1 + exact discreteFineTF_eq_raw S ψ hb (patchRetained y t b) s x hx + (patch_retained_nucleus_separated S ha hb hsmall ht y hn x) + (patch_retained_separated ha hb y x) + +lemma physical_patch_count_gap {J n k : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t F : ℝ} (ha : 0 mul_nonneg (tfDensity_nonneg _ z) (countTest_nonneg ..)) + have Ht2 := pow_le_pow_left₀ hp HT 2 + have Hc2 := pow_le_pow_left₀ (localCount_nonneg _ _) Hcount 2 + nlinarith only [Hgap,Ht2,Hc2] + +lemma sliceExpectation_le_affine {m k : ℕ} (ψ : H1Vector (m+k)) + (H G : Spins m → Configuration m → ℝ) (A B : ℝ) + (hH : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*H s x)) + (hG : ∀ s, Integrable (fun x => mass (ψ.coreSlice s x)*G s x)) + (hbound : ∀ s, ∀ᵐ x, H s x≤A+B*G s x) : + sliceExpectation ψ H≤A*mass ψ+B*sliceExpectation ψ G := by + rw [←sliceExpectation_number ψ A] + unfold sliceExpectation + rw [Finset.mul_sum,←Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro s hs + rw [←integral_const_mul,←integral_add ((mass_coreSlice_integrable ψ s).mul_const A) ((hG s).const_mul B)] + apply integral_mono_ae (hH s) (((mass_coreSlice_integrable ψ s).mul_const A).add ((hG s).const_mul B)) + filter_upwards [hbound s] with x hx + convert mul_le_mul_of_nonneg_left hx (mass_nonneg (ψ.coreSlice s x)) using 1 + dsimp only [Pi.add_apply] + ring + +section Averaged +variable {J m k : ℕ} (S : Nuclei J) (ψ : H1Vector (m+k)) + {a b t : ℝ} (ha : 0 mass (ψ.coreSlice s x)*(F s x)^2)) + (hcap : ∀ s, ∀ᵐ x, ∀ w∈Metric.closedBall y (t+b), coreScreenedField S (ψ.coreSlice s x).normalized w≤F s x) + +include hsmall hcs F hF0 hFi hcap in +lemma physical_patch_averaged_count : + let ρ := fun s x => localTFDensity measurableSet_ball + (coreTFField S (ψ.coreSlice s x).normalized measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn)) + sliceExpectation ψ (fun _ x => (localCount (Metric.closedBall y a) x)^2)≤ + 2*(tfInteriorCountConstant/a^3)^2*mass ψ+6*a*(max countTestEnergy 0)* + sliceExpectation ψ (fun s x => + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) + (retainedFineDensity b (patchRetained y t b x) (position x))- + rawThomasFermiEnergy (coreScreenedField S (ψ.coreSlice s x).normalized) (ρ s x)) := by + dsimp only + have hcap' (s : Spins m) : ∀ᵐ x, ∀ w∈Metric.ball y (t-4*b), coreScreenedField S (ψ.coreSlice s x).normalized w≤F s x := by + filter_upwards [hcap s] with x hx + exact fun w hw => hx w (Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith)) hw) + apply sliceExpectation_le_affine + · exact fun s => sliceCount_weight_integrable ψ measurableSet_closedBall s 2 + · intro s + have hTF := coreTF_conditional_integrable measurableSet_ball S ψ s ha + (patch_nucleus_separation S ha hb ht.2 y hn) (show 0<12*a by positivity) + (patch_diameter ha hb ht.2 y) (F s) (hF0 s) (hFi s) (hcap' s) + apply ((patchFineTF_weight_integrable S ψ ha hb hsmall ht.2 y hn s (hcs s)).sub hTF.2).congr + exact Eventually.of_forall (fun x => (mul_sub ..).symm) + · intro s + filter_upwards [hcs s,hF0 s,hcap' s] with x hc hf hcap + exact physical_patch_count_gap S _ ha hb hsmall ht y hn hc hf hcap x + +end Averaged + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/QuantumProfileDatum.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/QuantumProfileDatum.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc4f532019c9425782934544a53574d9366f8d89 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/QuantumProfileDatum.lean @@ -0,0 +1,105 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.InverseDensityError +import OAI.Analysis.CoulombRadii.RadialBounds.PhysicalBarrierData +import OAI.Analysis.CoulombRadii.Propagation.RetainedGoodEvent +import OAI.Analysis.CoulombRadii.LimitTheory.NeutralCountControl + +namespace OAI + +section +open MeasureTheory Filter Set +open scoped Topology BigOperators ENNReal NNReal Classical +noncomputable section +namespace NeutralAtom + +def profileRadius (ε : ℝ) (N j : ℕ) : ℝ := initialAtomicRadius ε ((N+1:ℕ):ℝ)*2^j + +def profileDensity {N : ℕ} (ψ : Wavefunction (N+1)) [IsProbabilityMeasure (rawLaw ψ)] + (ε s : ℝ) (j : ℕ) : ObservationSample (N+1) (j+1) → Position → ℝ := + let P := observationLaw (j+1) (rawLaw ψ) + let rs := fun k : Fin (j+1) => profileRadius ε N k.val + fun o => conditionalPacketDensity P Prod.fst (tailObservation rs j) Coulomb.unitWindow 1 + (initialAtomicRadius ε ((N+1:ℕ):ℝ)) s (tailObservation rs j o) + +structure QuantumProfileDatum {N : ℕ} (ψ : Wavefunction (N+1)) [IsProbabilityMeasure (rawLaw ψ)] + (ε B C L M s q Cq : ℝ) where + j : ℕ + low : s/(2*q) ≤ profileRadius ε N j + high : profileRadius ε N j ≤ s/q + datum : PropagationDatum (observationLaw (j+1) (rawLaw ψ)) B C (profileRadius ε N j) + ((N+1:ℕ):ℝ) L (profileDensity ψ ε s j) + G : Set (ObservationSample (N+1) (j+1)) + measurable : MeasurableSet G + failure : (observationLaw (j+1) (rawLaw ψ)).real Gᶜ ≤ M*s^9+Cq*s^25 + valid : ∀ o∈G,PropagationInvariant B C (profileRadius ε N j) ((N+1:ℕ):ℝ) L + (datum.offset o) (profileDensity ψ ε s j o) (datum.error o) ∧ + Integrable (datum.error o) ∧ (∫ x,datum.error o x) ≤ 1 + band : ∀ o∈G,∀ x,profileRadius ε N j ≤ ‖x‖ → ‖x‖ ≤ q*s → + screenedField ((N+1:ℕ):ℝ) (profileDensity ψ ε s j o) x ≤ physicalSpatialCap/‖x‖^4 ∧ + |profileDensity ψ ε s j o x-tfDensityScalar (screenedField ((N+1:ℕ):ℝ) + (profileDensity ψ ε s j o) x)| ≤ (q^8)⁻¹/‖x‖^6 + +lemma profile_band_coverage {s q r : ℝ} (hq : 2 ≤ q) (hs : 0 < s) + (hl : s/(2*q) ≤ r) : q*s ≤ 4*q^2*r := by + have hqpos : 0 < q := by linarith only [hq] + have H := (div_le_iff₀ (by positivity : (0:ℝ)<2*q)).mp hl + have H' := mul_le_mul_of_nonneg_left H hqpos.le + have hr : 0 ≤ r := (div_pos hs (by positivity)).le.trans hl + nlinarith only [H',sq_nonneg q,mul_nonneg (sq_nonneg q) hr] + +theorem physical_profile_constants : ∃ ε B C L M : ℝ,0 < ε ∧ 0 < B ∧ 0 ≤ M ∧ + ∃ Zbar : ℝ → ℕ, ∀ q : ℝ,2 ≤ q → ∃ Cq : ℝ,0 < Cq ∧ + ∃ sq : ℝ,0 < sq ∧ ∀ {N : ℕ} (ψ : Wavefunction (N+1)), + ∀ hψ : IsNormalizedGroundState (N+1) ψ, ∀ s : ℝ,0 < s → s < sq → Zbar s ≤ N+1 → + initialAtomicRadius ε ((N+1:ℕ):ℝ)/s ≤ q⁻¹ → + let := rawLaw_isProbability (hψ.choose_spec.1.2.2.1) + (hψ.choose_spec.2.1) + Nonempty (QuantumProfileDatum ψ ε B C L M s q Cq) := by + obtain ⟨ε,B,C,L,M,hε,hB,hC,hM,HB⟩ := physical_barrier_data + obtain ⟨D,hD,Zmin,Henergy⟩ := physical_neutral_energy_offset + obtain ⟨sB,hsB,hsB1,HB⟩ := HB D hD + choose ZB HZB using HB + let Zbar := fun s => max Zmin (if H : 0 < s ∧ s < sB then ZB s H.1 H.2 else 0) + refine ⟨ε,B,C,L,M,hε,hB,hM,Zbar,?_⟩ + intro q hq + obtain ⟨Cq,hCq,Hinv⟩ := physical_tf_band hq + obtain ⟨sI,hsI,hsI1,Hinv⟩ := Hinv D hD + refine ⟨Cq,hCq,min sB sI,lt_min hsB hsI,?_⟩ + intro N ψ hψ s hs hss hZbar hsmall + have hZm : Zmin ≤ N+1 := (le_max_left ..).trans hZbar + have hsBs : s < sB := hss.trans_le (min_le_left ..) + have hsIs : s < sI := hss.trans_le (min_le_right ..) + have hZB : ZB s hs hsBs ≤ N+1 := by + have H := (le_max_right Zmin _).trans hZbar + simpa only [Zbar,dite_eq_left (show 0 < s ∧ s < sB from ⟨hs,hsBs⟩)] using H + obtain ⟨g,hd,hn,hmin⟩ := hψ + have := rawLaw_isProbability hd.2.2.1 hn + have hZ : 1 ≤ N+1 := by omega + have hZpos : 0 < ((N+1:ℕ):ℝ) := by positivity + have hr₀ := initialAtomicRadius_pos hε hZpos + obtain ⟨j,hjl,hju⟩ := dyadic_radius_choice hr₀ hs (by linarith only [hq]) hsmall + have hq1 : 1 ≤ q := by linarith only [hq] + have hrjs : profileRadius ε N j ≤ s := hju.trans ((div_le_self hs.le hq1)) + have he := Henergy (N+1) hZm hZ hd hn hmin + have hE := Coulomb.atom_unrestricted_bottom_real (N+1) hZ + (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) (asH1_antisymmetric hd) ((asH1_mass ..).trans hn) + obtain ⟨d,hdcost⟩ := HZB s hs hsBs (N+1) hZB hZ hd hn hmin hE.le he + (show (N+1:ℝ) ≤ 3*((N+1:ℕ):ℝ) by push_cast; nlinarith only [Nat.cast_nonneg (α:=ℝ) N]) (K:=j+1) ⟨j,by omega⟩ hrjs + obtain ⟨V,hV,hVp,HV⟩ := d.valid_event hdcost + obtain ⟨G,hG,hGp,HG⟩ := Hinv (N+1) hZ hd hn hmin hE.le he hr₀ hs hsIs + (J:=j+1) ⟨j,by omega⟩ hrjs + refine ⟨⟨j,hjl,hju,d,V∩G,hV.inter hG,?_,?_,?_⟩⟩ + · rw [compl_inter] + exact (measureReal_union_le Vᶜ Gᶜ).trans ((add_le_add hVp hGp).trans + (add_le_add (mul_le_mul_of_nonneg_left (pow_le_pow_left₀ + (mul_pos hr₀ (by positivity)).le hrjs 9) hM) le_rfl)) + · intro o ho + exact HV o ho.1 + · intro o ho x hx hxq + exact HG o ho.2 x hx (hxq.trans (profile_band_coverage hq hs hjl)) +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/Rescaling.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/Rescaling.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4d76396bcd0b09d6fd539896761e487c24f67e4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/Rescaling.lean @@ -0,0 +1,326 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RadialBounds.SpatialAnnulus +import OAI.Analysis.CoulombRadii.FieldAnalysis.Field + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open ContinuousLinearMap +open scoped Topology BigOperators ContDiff Convolution Pointwise ENNReal +namespace NeutralAtom + +def scaledDensity (D : ℝ) (σ : Position → ℝ) (x : Position) : ℝ := D^6*σ (D • x) + +theorem scaledDensity_integrable {D : ℝ} (hD : 0 < D) {σ : Position → ℝ} + (hi : Integrable σ) : Integrable (scaledDensity D σ) := + (hi.comp_smul hD.ne').const_mul _ + +theorem integral_scaledDensity {D : ℝ} (hD : 0 < D) (σ : Position → ℝ) : + (∫ x, scaledDensity D σ x) = D^3*(∫ x, σ x) := by + unfold scaledDensity + rw [integral_const_mul, Measure.integral_comp_smul_of_nonneg volume σ D (hR := hD.le)] + simp only [Position, finrank_euclideanSpace_fin, smul_eq_mul] + field_simp + +theorem coulombKernel_smul {D : ℝ} (hD : 0 < D) (x : Position) : + coulombKernel (D • x) = D⁻¹*coulombKernel x := by + simp only [coulombKernel, norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_inv_rev, mul_comm] + +theorem potentialOf_scaledDensity {D : ℝ} (hD : 0 < D) (σ : Position → ℝ) (x : Position) : + potentialOf (scaledDensity D σ) x = D^4*potentialOf σ (D • x) := by + have h := Measure.integral_comp_smul_of_nonneg volume + (fun y => coulombKernel (D • x-y)*σ y) D (hR := hD.le) + simp only [Position, finrank_euclideanSpace_fin, smul_eq_mul] at h + simp_rw [← smul_sub, coulombKernel_smul hD, mul_assoc, integral_const_mul] at h + unfold potentialOf scaledDensity + simp_rw [show ∀ y, coulombKernel (x-y)*(D^6*σ (D • y)) = + D^6*(coulombKernel (x-y)*σ (D • y)) by intro y; ring, integral_const_mul] + field_simp [hD.ne'] at h ⊢ + nlinarith [h] + +theorem screenedField_scaledDensity {D : ℝ} (hD : 0 < D) (lam : ℝ) + (σ : Position → ℝ) (x : Position) : + screenedField (D^3*lam) (scaledDensity D σ) x = + D^4*screenedField lam σ (D • x) := by + rw [screenedField, screenedField, potentialOf_scaledDensity hD, + coulombKernel_smul hD] + field_simp + +theorem WeakNuclearSubsolution.dilate {U q : Position → ℝ} {lam : ℝ} + {D : ℝ} (hD : 0 < D) (hw : WeakNuclearSubsolution U lam Set.univ q) : + WeakNuclearSubsolution (fun x => D^4*U (D • x)) (D^3*lam) Set.univ + (scaledDensity D q) := by + intro φ hφ hc _ht hφp + let e : Position ≃ₜ Position := Homeomorph.smul (Units.mk0 D⁻¹ (inv_ne_zero hD.ne')) + let ψ : Position → ℝ := fun x => φ (D⁻¹ • x) + have hψ : ContDiff ℝ ∞ ψ := hφ.comp (contDiff_id.const_smul D⁻¹) + have hψc : HasCompactSupport ψ := hc.comp_homeomorph e + have hid (x : Position) : D⁻¹ • (D • x) = x := by + rw [smul_smul, inv_mul_cancel₀ hD.ne', one_smul] + have hLap (x : Position) : coordinateLaplacian ψ (D • x) = + (D⁻¹)^2*coordinateLaplacian φ x := by + change coordinateLaplacian (fun y => φ (D⁻¹ • y)) (D • x) = _ + rw [coordinateLaplacian_comp_smul, hid] + have hleft := Measure.integral_comp_smul_of_nonneg volume + (fun x => U x*coordinateLaplacian ψ x) D (hR := hD.le) + have hright := Measure.integral_comp_smul_of_nonneg volume + (fun x => q x*ψ x) D (hR := hD.le) + simp only [Position, finrank_euclideanSpace_fin, smul_eq_mul] at hleft hright + simp_rw [hLap, show ∀ x, U (D • x)*((D⁻¹)^2*coordinateLaplacian φ x) = + (D⁻¹)^2*(U (D • x)*coordinateLaplacian φ x) by intro x; ring, + integral_const_mul] at hleft + simp only [ψ, hid] at hright + have hwe := mul_le_mul_of_nonneg_left + (hw ψ hψ hψc (Set.subset_univ _) (fun x => hφp _)) (pow_nonneg hD.le 3) + have hψ0 : ψ 0 = φ 0 := by simp [ψ] + rw [hψ0] at hwe + have hli : D^4*(∫ x, U (D • x)*coordinateLaplacian φ x) = + D^3*(∫ x, U x*coordinateLaplacian ψ x) := by + field_simp [hD.ne'] at hleft + rw [← hleft] + ring + have hri : D^6*(∫ x, q (D • x)*φ x) = D^3*(∫ x, q x*ψ x) := by + field_simp [hD.ne'] at hright + simp only [one_div] at hright + change (∫ x, q (D • x)*φ x)*D^3 = (∫ x, q x*ψ x) at hright + rw [← hright] + ring + simp only [scaledDensity, mul_assoc, integral_const_mul] + rw [hli, hri] + linarith + +theorem barrierSource_dilate {D : ℝ} (hD : 0 < D) (r : ℝ) + (U σ p : Position → ℝ) (x : Position) : + barrierSource (r/D) (fun y => D^4*U (D • y)) + (scaledDensity D σ) (scaledDensity D p) x = + scaledDensity D (barrierSource r U σ p) x := by + have hlt : ‖D • x‖ < r ↔ ‖x‖ < r/D := by + rw [lt_div_iff₀ hD, norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_comm] + have hle : r ≤ ‖D • x‖ ↔ r/D ≤ ‖x‖ := by + rw [div_le_iff₀ hD, norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_comm] + simp only [barrierSource, cutoffReaction, scaledDensity, Set.indicator_apply, + Set.mem_ofPred_eq, hlt, hle, tfReaction_dilate hD] + split_ifs <;> ring + +theorem WeakNuclearSubsolution.dilate_barrier {D : ℝ} (hD : 0 < D) + {U σ p : Position → ℝ} {lam r : ℝ} + (hw : WeakNuclearSubsolution U lam Set.univ (barrierSource r U σ p)) : + WeakNuclearSubsolution (fun x => D^4*U (D • x)) (D^3*lam) Set.univ + (barrierSource (r/D) (fun x => D^4*U (D • x)) + (scaledDensity D σ) (scaledDensity D p)) := by + simpa only [show barrierSource (r/D) (fun x => D^4*U (D • x)) + (scaledDensity D σ) (scaledDensity D p) = + scaledDensity D (barrierSource r U σ p) from funext (barrierSource_dilate hD r U σ p)] + using hw.dilate hD + +theorem scaledDensity_nonneg {D : ℝ} {σ : Position → ℝ} + (hσ : ∀ x, 0 ≤ σ x) (x : Position) : 0 ≤ scaledDensity D σ x := + mul_nonneg (by positivity) (hσ _) + +theorem scaledDensity_bound {D A : ℝ} {σ : Position → ℝ} + (hσ : ∀ x, σ x ≤ A) (x : Position) : scaledDensity D σ x ≤ D^6*A := + mul_le_mul_of_nonneg_left (hσ _) (by positivity) + +theorem scaledDensity_support {D r : ℝ} (hD : 0 < D) {p : Position → ℝ} + (hp : ∀ x, r < ‖x‖ → p x = 0) (x : Position) (hx : r/D < ‖x‖) : + scaledDensity D p x = 0 := by + have hh : r < ‖D • x‖ := by + simpa only [norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_comm] using + (div_lt_iff₀ hD).mp hx + simp only [scaledDensity, hp _ hh, mul_zero] + +theorem barrier_bounds_dilate {D r B C : ℝ} (hD : 0 < D) {U : Position → ℝ} + (hbound : ∀ y, r ≤ ‖y‖ → + B/‖y‖^4*(1-r/(8*‖y‖)) ≤ U y ∧ U y ≤ C/‖y‖^4) + (x : Position) (hx : r/D ≤ ‖x‖) : + B/‖x‖^4*(1-(r/D)/(8*‖x‖)) ≤ D^4*U (D • x) ∧ + D^4*U (D • x) ≤ C/‖x‖^4 := by + have hh : r ≤ ‖D • x‖ := by + simpa only [norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_comm] using + (div_le_iff₀ hD).mp hx + have hb := hbound _ hh + have hnorm : ‖D • x‖ = D*‖x‖ := by simp [norm_smul, abs_of_pos hD] + have hlo : D^4*(B/‖D • x‖^4*(1-r/(8*‖D • x‖))) = + B/‖x‖^4*(1-(r/D)/(8*‖x‖)) := by + rw [hnorm] + by_cases hz : ‖x‖ = 0 + · simp [hz] + · field_simp + have hup : D^4*(C/‖D • x‖^4) = C/‖x‖^4 := by + rw [hnorm, mul_pow] + field_simp + constructor + · rw [← hlo] + exact mul_le_mul_of_nonneg_left hb.1 (by positivity) + · rw [← hup] + exact mul_le_mul_of_nonneg_left hb.2 (by positivity) + +theorem tfDensityScalar_dilate {D : ℝ} (hD : 0 < D) (t : ℝ) : + tfDensityScalar (D^4*t) = D^6*tfDensityScalar t := by + have hm : max (D^4*t) 0 = D^4*max t 0 := by + rw [mul_max_of_nonneg t 0 (pow_nonneg hD.le 4), mul_zero] + have hr : (D^4)^(3/2 : ℝ) = D^6 := by + rw [← Real.rpow_natCast D 4, ← Real.rpow_mul hD.le] + norm_num + rw [tfDensityScalar, hm, Real.mul_rpow (pow_nonneg hD.le 4) (le_max_right t 0), hr, + tfDensityScalar] + ring + +theorem mul_inverse_power_dilate {D : ℝ} (hD : 0 < D) (C : ℝ) (n : ℕ) (x : Position) : + D^n*(C/‖D • x‖^n) = C/‖x‖^n := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_pow] + field_simp + +theorem screened_comparison_dilate {D r q C δ lam : ℝ} (hD : 0 < D) + {σ : Position → ℝ} + (hbound : ∀ y, r ≤ ‖y‖ → ‖y‖ ≤ q*D → + screenedField lam σ y ≤ C/‖y‖^4 ∧ + |σ y-tfDensityScalar (screenedField lam σ y)| ≤ δ/‖y‖^6) + (x : Position) (hx : r/D ≤ ‖x‖) (hxq : ‖x‖ ≤ q) : + screenedField (D^3*lam) (scaledDensity D σ) x ≤ C/‖x‖^4 ∧ + |scaledDensity D σ x-tfDensityScalar + (screenedField (D^3*lam) (scaledDensity D σ) x)| ≤ δ/‖x‖^6 := by + have hxl : r ≤ ‖D • x‖ := by + simpa only [norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_comm] using + (div_le_iff₀ hD).mp hx + have hxu : ‖D • x‖ ≤ q*D := by + simpa only [norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_comm] using + mul_le_mul_of_nonneg_left hxq hD.le + obtain ⟨hc,he⟩ := hbound _ hxl hxu + rw [screenedField_scaledDensity hD, tfDensityScalar_dilate hD] + constructor + · have hh := mul_le_mul_of_nonneg_left hc (pow_nonneg hD.le 4) + rwa [mul_inverse_power_dilate hD] at hh + · have hh := mul_le_mul_of_nonneg_left he (pow_nonneg hD.le 6) + rw [mul_inverse_power_dilate hD] at hh + simpa only [scaledDensity, ← mul_sub, abs_mul, abs_of_nonneg (pow_nonneg hD.le 6)] using hh + +theorem setIntegral_scaledDensity {D : ℝ} (hD : 0 < D) (σ : Position → ℝ) (S : Set Position) : + (∫ x in S, scaledDensity D σ x) = D^3*(∫ x in D • S, σ x) := by + unfold scaledDensity + rw [integral_const_mul, Measure.setIntegral_comp_smul_of_pos volume σ S hD] + simp only [Position, finrank_euclideanSpace_fin, smul_eq_mul] + rw [← mul_assoc] + congr 1 + field_simp + +theorem smul_spatialAnnulus {D : ℝ} (hD : 0 < D) (a b : ℝ) : + D • spatialAnnulus a b = spatialAnnulus (a*D) (b*D) := by + ext x + rw [Set.mem_smul_set_iff_inv_smul_mem₀ hD.ne'] + simp only [spatialAnnulus, Set.mem_ofPred_eq, norm_smul, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hD), ← div_eq_inv_mul] + constructor + · rintro ⟨ha,hb⟩ + exact ⟨(lt_div_iff₀ hD).mp ha, (div_lt_iff₀ hD).mp hb⟩ + · rintro ⟨ha,hb⟩ + exact ⟨(lt_div_iff₀ hD).mpr ha, (div_lt_iff₀ hD).mpr hb⟩ + +theorem annularIntegral_scaledDensity {D : ℝ} (hD : 0 < D) (σ : Position → ℝ) (a b : ℝ) : + (∫ x in spatialAnnulus a b, scaledDensity D σ x) = + D^3*(∫ x in spatialAnnulus (a*D) (b*D), σ x) := by + rw [setIntegral_scaledDensity hD, smul_spatialAnnulus hD] + +structure PhysicalRetainedFamily (Θ : ℕ → Type*) where + μ : ∀ n, Θ n → Position → ℝ + u : ∀ n, Θ n → Position → ℝ + p : ∀ n, Θ n → Position → ℝ + Z : ℕ → ℕ + s : ℕ → ℝ + r : ℕ → ℝ + q : ℕ → ℕ + Aμ : ∀ n, Θ n → ℝ + Ap : ∀ n, Θ n → ℝ + B : ℝ + Ccap : ℝ + Cinv : ℝ + Bpos : 0 < B + Cpos : 0 ≤ Ccap + sp : ∀ n, 0 < s n + rp : ∀ n, 0 < r n + slim : Tendsto s atTop (𝓝 0) + qlim : Tendsto q atTop atTop + rlo : ∀ n, 1/(2*(q n : ℝ)) ≤ r n/s n + rhi : ∀ n, r n/s n ≤ ((q n : ℝ))⁻¹ + μi : ∀ n θ, Integrable (μ n θ) + μp : ∀ n θ x, 0 ≤ μ n θ x + μb : ∀ n θ x, μ n θ x ≤ Aμ n θ + μmass : ∀ n θ, (∫ x, μ n θ x) = (Z n : ℝ) + pi : ∀ n θ, Integrable (p n θ) + pp : ∀ n θ x, 0 ≤ p n θ x + pb : ∀ n θ x, p n θ x ≤ Ap n θ + ps : ∀ n θ x, r n < ‖x‖ → p n θ x = 0 + pm : ∀ n θ, (∫ x, p n θ x) ≤ 1 + ucont : ∀ n θ, Continuous (fun x => u n θ x-(Z n : ℝ)*coulombKernel x) + ubounds : ∀ n θ x, r n ≤ ‖x‖ → + B/‖x‖^4*(1-r n/(8*‖x‖)) ≤ u n θ x ∧ u n θ x ≤ Cinv/‖x‖^4 + uweak : ∀ n θ, WeakNuclearSubsolution (u n θ) (Z n : ℝ) Set.univ + (barrierSource (r n) (u n θ) (μ n θ) (p n θ)) + band : ∀ n θ x, r n ≤ ‖x‖ → ‖x‖ ≤ (q n : ℝ)*s n → + screenedField (Z n : ℝ) (μ n θ) x ≤ Ccap/‖x‖^4 ∧ + |μ n θ x-tfDensityScalar (screenedField (Z n : ℝ) (μ n θ) x)| ≤ + (((q n : ℝ)^8)⁻¹)/‖x‖^6 + +theorem continuous_scaled_offset {D z : ℝ} (hD : 0 < D) {u : Position → ℝ} + (hu : Continuous (fun x => u x-z*coulombKernel x)) : + Continuous (fun x => D^4*u (D • x)-(D^3*z)*coulombKernel x) := by + have he : (fun x => D^4*u (D • x)-(D^3*z)*coulombKernel x) = + fun x => D^4*(u (D • x)-z*coulombKernel (D • x)) := by + funext x + simp only [coulombKernel, norm_smul, Real.norm_eq_abs, abs_of_pos hD, mul_inv_rev] + field_simp + rw [he] + exact (hu.comp (continuous_const_smul D)).const_mul _ + +def PhysicalRetainedFamily.toAnalytic {Θ : ℕ → Type*} (d : PhysicalRetainedFamily Θ) : + RetainedAnalyticFamily Θ where + σ := fun n θ => scaledDensity (d.s n) (d.μ n θ) + U := fun n θ x => d.s n^4*d.u n θ (d.s n • x) + p := fun n θ => scaledDensity (d.s n) (d.p n θ) + lam := fun n => d.s n^3*(d.Z n : ℝ) + a := fun n => d.r n/d.s n + q := fun n => (d.q n : ℝ) + ε := fun n => d.s n^3 + Aσ := fun n θ => d.s n^6*d.Aμ n θ + Ap := fun n θ => d.s n^6*d.Ap n θ + B := d.B + Ccap := d.Ccap + Cinv := d.Cinv + Bpos := d.Bpos + Cpos := d.Cpos + σi := fun n θ => scaledDensity_integrable (d.sp n) (d.μi n θ) + σp := fun n θ => scaledDensity_nonneg (d.μp n θ) + σb := fun n θ => scaledDensity_bound (d.μb n θ) + σmass := fun n θ => by rw [integral_scaledDensity (d.sp n), d.μmass] + pi := fun n θ => scaledDensity_integrable (d.sp n) (d.pi n θ) + pp := fun n θ => scaledDensity_nonneg (d.pp n θ) + pb := fun n θ => scaledDensity_bound (d.pb n θ) + ps := fun n θ => scaledDensity_support (d.sp n) (d.ps n θ) + pm := fun n θ => by + rw [integral_scaledDensity (d.sp n)] + exact (mul_le_mul_of_nonneg_left (d.pm n θ) (pow_nonneg (d.sp n).le 3)).trans_eq + (mul_one _) + εlim := by simpa using d.slim.pow 3 + apos := fun n => div_pos (d.rp n) (d.sp n) + alim := by + apply squeeze_zero (fun n => (div_pos (d.rp n) (d.sp n)).le) d.rhi + exact tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.comp d.qlim) + qlim := tendsto_natCast_atTop_atTop.comp d.qlim + aq := Eventually.of_forall d.rlo + Ucont := fun n θ => continuous_scaled_offset (d.sp n) (d.ucont n θ) + Ulower := fun n θ x hx => (barrier_bounds_dilate (d.sp n) (d.ubounds n θ) x hx).1 + Uupper := fun n θ x hx => (barrier_bounds_dilate (d.sp n) (d.ubounds n θ) x hx).2 + Uweak := fun n θ => (d.uweak n θ).dilate_barrier (d.sp n) + cap := fun n θ x hx hxq => (screened_comparison_dilate (d.sp n) (d.band n θ) x hx hxq).1 + err := fun n θ x hx hxq => by + simpa only [div_eq_mul_inv] using + (screened_comparison_dilate (d.sp n) (d.band n θ) x hx hxq).2 + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/ScaledProfile.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/ScaledProfile.lean new file mode 100644 index 0000000000000000000000000000000000000000..98b7a34213e66801117d43be9a18e3a46326b8b6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/ScaledProfile.lean @@ -0,0 +1,434 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.WeakLaplacian + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators ContDiff +namespace NeutralAtom +open scoped Convolution +open ContinuousLinearMap + +def scaledProfile (F : Position → ℝ) (x : Position) : ℝ := (‖x‖^2)^2*F x + +theorem continuousOn_scaledProfile {F : Position → ℝ} (hF : ContinuousOn F punctured) : + ContinuousOn (scaledProfile F) punctured := + ((continuous_norm.pow 2).pow 2).continuousOn.mul hF + +theorem scaled_reaction {F : Position → ℝ} {x : Position} (hF : 0 ≤ F x) (c : ℝ) : + (‖x‖^2)^3*(c*F x^(3/2 : ℝ)) = c*(scaledProfile F x)^(3/2 : ℝ) := by + have hp : ((‖x‖^2)^2)^(3/2 : ℝ) = (‖x‖^2)^3 := by + rw [← Real.rpow_natCast (‖x‖^2) 2, ← Real.rpow_mul (sq_nonneg ‖x‖)] + norm_num + rw [scaledProfile, Real.mul_rpow (sq_nonneg _) hF, hp] + ring + +theorem penalized_max_reaction_bound {F : Position → ℝ} {c δ : ℝ} {x : Position} + (hF : ContinuousOn F punctured) (hpos : ∀ y ≠ 0, 0 ≤ F y) + (hw : HasWeakLaplacian F punctured (fun y => c*F y^(3/2 : ℝ))) + (hδ : 0 < δ) (hx : x ≠ 0) + (hm : ∀ y ≠ 0, scaledProfile F y-δ*radialPenalty y ≤ scaledProfile F x-δ*radialPenalty x) : + c*(scaledProfile F x)^(3/2 : ℝ) ≤ 12*scaledProfile F x+18*(δ*radialPenalty x) := by + let a := scaledProfile F x-δ*radialPenalty x + have hbar (y : Position) (hy : y ≠ 0) : F y ≤ radialBarrier a δ y := by + apply (mul_le_mul_iff_right₀ (sq_pos_of_pos (sq_pos_of_pos (norm_pos_iff.mpr hy)))).mp + change scaledProfile F y ≤ (‖y‖^2)^2*radialBarrier a δ y + rw [radialBarrier_scaled hy] + have hh := hm y hy + dsimp [a, radialPenalty] at * + linarith + have he : F x = radialBarrier a δ x := by + apply (mul_left_cancel₀ (pow_ne_zero 2 (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)))) + change scaledProfile F x = (‖x‖^2)^2*radialBarrier a δ x + rw [radialBarrier_scaled hx] + simp [a, radialPenalty] + have hlmax : IsLocalMax (fun y => F y-radialBarrier a δ y) x := by + filter_upwards [isOpen_punctured.mem_nhds hx] with y hy + rw [he, sub_self] + exact sub_nonpos.mpr (hbar y hy) + have hq : ContinuousOn (fun y => c*F y^(3/2 : ℝ)) punctured := + continuousOn_const.mul (hF.rpow_const (fun _ _ => Or.inr (by norm_num))) + have h := weakLaplacian_le_at_local_max isOpen_punctured hx hF hq + (contDiffOn_radialBarrier a δ 2) hw hlmax + have hmul := mul_le_mul_of_nonneg_left h (pow_nonneg (sq_nonneg ‖x‖) 3) + rw [scaled_reaction (hpos x hx), laplacian_radialBarrier_scaled hx] at hmul + have hδq : 0 ≤ δ*(‖x‖^2) := mul_nonneg hδ.le (sq_nonneg ‖x‖) + dsimp [a, radialPenalty] at * + nlinarith + +theorem penalized_min_reaction_bound {F : Position → ℝ} {c δ : ℝ} {x : Position} + (hF : ContinuousOn F punctured) (hpos : ∀ y ≠ 0, 0 ≤ F y) + (hw : HasWeakLaplacian F punctured (fun y => c*F y^(3/2 : ℝ))) + (hδ : 0 < δ) (hx : x ≠ 0) + (hm : ∀ y ≠ 0, scaledProfile F x+δ*radialPenalty x ≤ scaledProfile F y+δ*radialPenalty y) : + 12*scaledProfile F x-18*(δ*radialPenalty x) ≤ c*(scaledProfile F x)^(3/2 : ℝ) := by + let a := scaledProfile F x+δ*radialPenalty x + have hbar (y : Position) (hy : y ≠ 0) : radialBarrier a (-δ) y ≤ F y := by + apply (mul_le_mul_iff_right₀ (sq_pos_of_pos (sq_pos_of_pos (norm_pos_iff.mpr hy)))).mp + change (‖y‖^2)^2*radialBarrier a (-δ) y ≤ scaledProfile F y + rw [radialBarrier_scaled hy] + have hh := hm y hy + dsimp [a, radialPenalty] at * + linarith + have he : F x = radialBarrier a (-δ) x := by + apply (mul_left_cancel₀ (pow_ne_zero 2 (pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)))) + change scaledProfile F x = (‖x‖^2)^2*radialBarrier a (-δ) x + rw [radialBarrier_scaled hx] + simp [a, radialPenalty] + have hlmin : IsLocalMin (fun y => F y-radialBarrier a (-δ) y) x := by + filter_upwards [isOpen_punctured.mem_nhds hx] with y hy + rw [he, sub_self] + exact sub_nonneg.mpr (hbar y hy) + have hq : ContinuousOn (fun y => c*F y^(3/2 : ℝ)) punctured := + continuousOn_const.mul (hF.rpow_const (fun _ _ => Or.inr (by norm_num))) + have h := weakLaplacian_ge_at_local_min isOpen_punctured hx hF hq + (contDiffOn_radialBarrier a (-δ) 2) hw hlmin + have hmul := mul_le_mul_of_nonneg_left h (pow_nonneg (sq_nonneg ‖x‖) 3) + rw [scaled_reaction (hpos x hx), laplacian_radialBarrier_scaled hx] at hmul + have hδq : 0 ≤ δ*(‖x‖^2) := mul_nonneg hδ.le (sq_nonneg ‖x‖) + dsimp [a, radialPenalty] at * + nlinarith + +theorem exists_approximate_penalized_max {V : Position → ℝ} {b ε : ℝ} + (hV : ContinuousOn V punctured) (hb : ∀ x ≠ 0, V x ≤ b) + (hnear : ∀ e > 0, ∃ x ≠ 0, b-e < V x) (hε : 0 < ε) : + ∃ δ > 0, ∃ x ≠ 0, + (∀ y ≠ 0, V y-δ*radialPenalty y ≤ V x-δ*radialPenalty x) ∧ + b-ε < V x ∧ δ*radialPenalty x < ε := by + obtain ⟨x₀, hx₀, hx₀v⟩ := hnear (ε/2) (by positivity) + let δ := (ε/2)/radialPenalty x₀ + have hδ : 0 < δ := div_pos (by positivity) (radialPenalty_pos hx₀) + have hδ₀ : δ*radialPenalty x₀ = ε/2 := div_mul_cancel₀ _ (radialPenalty_pos hx₀).ne' + obtain ⟨x, hx, hxm⟩ := exists_penalized_max hV hb hδ hx₀ + have hh := hxm x₀ hx₀ + rw [hδ₀] at hh + have hM : b-ε < V x-δ*radialPenalty x := by linarith + refine ⟨δ, hδ, x, hx, hxm, ?_, ?_⟩ + · have hp := mul_pos hδ (radialPenalty_pos hx) + linarith + · linarith [hb x hx] + +theorem exists_approximate_penalized_min {V : Position → ℝ} {b ε : ℝ} + (hV : ContinuousOn V punctured) (hb : ∀ x ≠ 0, b ≤ V x) + (hnear : ∀ e > 0, ∃ x ≠ 0, V x < b+e) (hε : 0 < ε) : + ∃ δ > 0, ∃ x ≠ 0, + (∀ y ≠ 0, V x+δ*radialPenalty x ≤ V y+δ*radialPenalty y) ∧ + V x < b+ε ∧ δ*radialPenalty x < ε := by + obtain ⟨x₀, hx₀, hx₀v⟩ := hnear (ε/2) (by positivity) + let δ := (ε/2)/radialPenalty x₀ + have hδ : 0 < δ := div_pos (by positivity) (radialPenalty_pos hx₀) + have hδ₀ : δ*radialPenalty x₀ = ε/2 := div_mul_cancel₀ _ (radialPenalty_pos hx₀).ne' + obtain ⟨x, hx, hxm⟩ := exists_penalized_min hV hb hδ hx₀ + have hh := hxm x₀ hx₀ + rw [hδ₀] at hh + have hM : V x+δ*radialPenalty x < b+ε := by linarith + refine ⟨δ, hδ, x, hx, hxm, ?_, ?_⟩ + · have hp := mul_pos hδ (radialPenalty_pos hx) + linarith + · linarith [hb x hx] + +theorem reaction_le_at_supremum {F : Position → ℝ} {c b : ℝ} + (hF : ContinuousOn F punctured) (hpos : ∀ y ≠ 0, 0 ≤ F y) + (hw : HasWeakLaplacian F punctured (fun y => c*F y^(3/2 : ℝ))) + (hb : ∀ x ≠ 0, scaledProfile F x ≤ b) + (hnear : ∀ e > 0, ∃ x ≠ 0, b-e < scaledProfile F x) : + c*b^(3/2 : ℝ) ≤ 12*b := by + have happ (ε : ℝ) (hε : 0 < ε) : + ∃ t : ℝ, b-ε < t ∧ t ≤ b ∧ c*t^(3/2 : ℝ) ≤ 12*t+18*ε := by + obtain ⟨δ, hδ, x, hx, hxm, hxb, hδx⟩ := + exists_approximate_penalized_max (continuousOn_scaledProfile hF) hb hnear hε + refine ⟨scaledProfile F x, hxb, hb x hx, ?_⟩ + linarith [penalized_max_reaction_bound hF hpos hw hδ hx hxm] + let e : ℕ → ℝ := fun n => 1/((n : ℝ)+1) + have he : Tendsto e atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + choose t htl htu htr using fun n => happ (e n) (by dsimp [e]; positivity) + have ht : Tendsto t atTop (𝓝 b) := + (show Tendsto (fun n => b-e n) atTop (𝓝 b) by simpa using tendsto_const_nhds.sub he).squeeze + tendsto_const_nhds (fun n => (htl n).le) htu + have hr : Tendsto (fun n => c*(t n)^(3/2 : ℝ)) atTop (𝓝 (c*b^(3/2 : ℝ))) := + tendsto_const_nhds.mul (ht.rpow_const (Or.inr (by norm_num))) + have hs : Tendsto (fun n => 12*t n+18*e n) atTop (𝓝 (12*b)) := by + simpa using (tendsto_const_nhds.mul ht).add (tendsto_const_nhds.mul he) + exact le_of_tendsto_of_tendsto' hr hs htr + +theorem reaction_ge_at_infimum {F : Position → ℝ} {c b : ℝ} + (hF : ContinuousOn F punctured) (hpos : ∀ y ≠ 0, 0 ≤ F y) + (hw : HasWeakLaplacian F punctured (fun y => c*F y^(3/2 : ℝ))) + (hb : ∀ x ≠ 0, b ≤ scaledProfile F x) + (hnear : ∀ e > 0, ∃ x ≠ 0, scaledProfile F x < b+e) : + 12*b ≤ c*b^(3/2 : ℝ) := by + have happ (ε : ℝ) (hε : 0 < ε) : + ∃ t : ℝ, b ≤ t ∧ t < b+ε ∧ 12*t-18*ε ≤ c*t^(3/2 : ℝ) := by + obtain ⟨δ, hδ, x, hx, hxm, hxb, hδx⟩ := + exists_approximate_penalized_min (continuousOn_scaledProfile hF) hb hnear hε + refine ⟨scaledProfile F x, hb x hx, hxb, ?_⟩ + linarith [penalized_min_reaction_bound hF hpos hw hδ hx hxm] + let e : ℕ → ℝ := fun n => 1/((n : ℝ)+1) + have he : Tendsto e atTop (𝓝 0) := tendsto_one_div_add_atTop_nhds_zero_nat + choose t htl htu htr using fun n => happ (e n) (by dsimp [e]; positivity) + have ht : Tendsto t atTop (𝓝 b) := tendsto_const_nhds.squeeze + (show Tendsto (fun n => b+e n) atTop (𝓝 b) by simpa using tendsto_const_nhds.add he) + htl (fun n => (htu n).le) + have hr : Tendsto (fun n => c*(t n)^(3/2 : ℝ)) atTop (𝓝 (c*b^(3/2 : ℝ))) := + tendsto_const_nhds.mul (ht.rpow_const (Or.inr (by norm_num))) + have hs : Tendsto (fun n => 12*t n-18*e n) atTop (𝓝 (12*b)) := by + simpa using (tendsto_const_nhds.mul ht).sub (tendsto_const_nhds.mul he) + exact le_of_tendsto_of_tendsto' hs hr htr + +theorem scalar_upper_contact {c b : ℝ} (hc : 0 < c) (hb : 0 < b) + (h : c*b^(3/2 : ℝ) ≤ 12*b) : b ≤ (12/c)^2 := by + have hr : b^(3/2 : ℝ) = b*Real.sqrt b := by + rw [Real.sqrt_eq_rpow, ← Real.rpow_one_add' hb.le (by norm_num : (1:ℝ)+1/2 ≠ 0)] + norm_num + rw [hr] at h + have hs : c*Real.sqrt b ≤ 12 := by nlinarith + have hs' : Real.sqrt b ≤ 12/c := (le_div_iff₀ hc).mpr (by nlinarith) + nlinarith [sq_nonneg (12/c-Real.sqrt b), Real.sq_sqrt hb.le, Real.sqrt_nonneg b] + +theorem scalar_lower_contact {c b : ℝ} (hc : 0 < c) (hb : 0 < b) + (h : 12*b ≤ c*b^(3/2 : ℝ)) : (12/c)^2 ≤ b := by + have hr : b^(3/2 : ℝ) = b*Real.sqrt b := by + rw [Real.sqrt_eq_rpow, ← Real.rpow_one_add' hb.le (by norm_num : (1:ℝ)+1/2 ≠ 0)] + norm_num + rw [hr] at h + have hs : 12 ≤ c*Real.sqrt b := by nlinarith + have hs' : 12/c ≤ Real.sqrt b := (div_le_iff₀ hc).mpr (by nlinarith) + have hp : 0 < 12/c := by positivity + nlinarith [Real.sq_sqrt hb.le, Real.sqrt_nonneg b] + +theorem weak_sommerfeld_rigidity {F : Position → ℝ} {c B C : ℝ} + (hc : 0 < c) (hB : 0 < B) + (hF : ContinuousOn F punctured) + (hw : HasWeakLaplacian F punctured (fun x => c*F x^(3/2 : ℝ))) + (hbounds : ∀ x ≠ 0, B ≤ scaledProfile F x ∧ scaledProfile F x ≤ C) : + ∀ x ≠ 0, F x = (12/c)^2*radialPower (-2) x := by + let S : Set ℝ := scaledProfile F '' punctured + have hx₀ : axis 0 ≠ 0 := by + intro h + have h' := congrArg (fun x : Position => x 0) h + norm_num [axis] at h' + have hS : S.Nonempty := ⟨scaledProfile F (axis 0), ⟨axis 0, hx₀, rfl⟩⟩ + have hSu : BddAbove S := ⟨C, by rintro _ ⟨x, hx, rfl⟩; exact (hbounds x hx).2⟩ + have hSl : BddBelow S := ⟨B, by rintro _ ⟨x, hx, rfl⟩; exact (hbounds x hx).1⟩ + have hmax (x : Position) (hx : x ≠ 0) : scaledProfile F x ≤ sSup S := + le_csSup hSu ⟨x, hx, rfl⟩ + have hmin (x : Position) (hx : x ≠ 0) : sInf S ≤ scaledProfile F x := + csInf_le hSl ⟨x, hx, rfl⟩ + have hpos (x : Position) (hx : x ≠ 0) : 0 ≤ F x := by + have hp : 0 ≤ scaledProfile F x := le_trans hB.le (hbounds x hx).1 + exact nonneg_of_mul_nonneg_right hp (sq_pos_of_pos (sq_pos_of_pos (norm_pos_iff.mpr hx))) + have hnearU (e : ℝ) (he : 0 < e) : ∃ x ≠ 0, sSup S-e < scaledProfile F x := by + obtain ⟨v, ⟨x, hx, rfl⟩, hv⟩ := exists_lt_of_lt_csSup hS (sub_lt_self _ he) + exact ⟨x, hx, hv⟩ + have hnearL (e : ℝ) (he : 0 < e) : ∃ x ≠ 0, scaledProfile F x < sInf S+e := by + obtain ⟨v, ⟨x, hx, rfl⟩, hv⟩ := exists_lt_of_csInf_lt hS (lt_add_of_pos_right _ he) + exact ⟨x, hx, hv⟩ + have hBp : 0 < sInf S := lt_of_lt_of_le hB (le_csInf hS (by + rintro _ ⟨x, hx, rfl⟩; exact (hbounds x hx).1)) + have hCp : 0 < sSup S := lt_of_lt_of_le + (lt_of_lt_of_le hB (hbounds (axis 0) hx₀).1) (hmax (axis 0) hx₀) + have hupper := scalar_upper_contact hc hCp (reaction_le_at_supremum hF hpos hw hmax hnearU) + have hlower := scalar_lower_contact hc hBp (reaction_ge_at_infimum hF hpos hw hmin hnearL) + intro x hx + have he : scaledProfile F x = (12/c)^2 := le_antisymm + (le_trans (hmax x hx) hupper) (le_trans hlower (hmin x hx)) + have hq : ‖x‖^2 ≠ 0 := pow_ne_zero 2 (norm_ne_zero_iff.mpr hx) + unfold scaledProfile at he + have he' : F x = (12/c)^2 / (‖x‖^2)^2 := + (eq_div_iff (pow_ne_zero 2 hq)).mpr (by nlinarith [he]) + rw [he'] + norm_num [radialPower, Real.rpow_neg_natCast, div_eq_mul_inv] + +theorem WeakLaplacianLower.add_smooth {f b : Position → ℝ} + {U : Set Position} {c d : ℝ} + (hf : ∀ x ∈ U, ContinuousAt f x) (hb : ∀ x ∈ U, ContDiffAt ℝ 2 b x) + (hw : WeakLaplacianLower f U c) + (hl : ∀ x ∈ U, d ≤ coordinateLaplacian b x) : + WeakLaplacianLower (fun x => f x+b x) U (c+d) := by + intro φ hφ hc ht hp + have hts : tsupport (coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + exact hx (coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + have hφ2 := hφ.of_le (show (2 : WithTop ℕ∞) ≤ ∞ by exact WithTop.coe_le_coe.mpr le_top) + have hφl := continuous_coordinateLaplacian hφ2 + have hφlc := hasCompactSupport_coordinateLaplacian hc + have hif : Integrable (fun x => f x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt (fun x hx => hf x (ht (hts hx))) hφl hφlc + have hib : Integrable (fun x => b x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt (fun x hx => (hb x (ht (hts hx))).continuousAt) hφl hφlc + have hib' : Integrable (fun x => coordinateLaplacian b x*φ x) := + integrable_mul_compact_of_continuousAt + (fun x hx => continuousAt_coordinateLaplacian (hb x (ht hx))) hφ.continuous hc + have hbd : d*(∫ x, φ x) ≤ ∫ x, coordinateLaplacian b x*φ x := by + rw [← integral_const_mul] + apply integral_mono ((hφ.continuous.integrable_of_hasCompactSupport hc).const_mul d) hib' + intro x + by_cases hx : x ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hl x (ht hx)) (hp x) + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, le_refl] + simp_rw [add_mul] + rw [integral_add hif hib, integral_mul_coordinateLaplacian_eq (fun x hx => hb x (ht hx)) hφ hc] + linarith [hw φ hφ hc ht hp] + +theorem weak_maximum_principle_closedBall {f : Position → ℝ} {R : ℝ} + (hR : 0 < R) (hf : ContinuousOn f (Metric.closedBall 0 R)) + (hbdy : ∀ x : Position, ‖x‖ = R → f x ≤ 0) + (hw : WeakLaplacianLower f (Metric.ball 0 R ∩ {x | 0 < f x}) 0) : + ∀ x ∈ Metric.closedBall 0 R, f x ≤ 0 := by + intro x₀ hx₀ + by_contra hn + have hp : 0 < f x₀ := lt_of_not_ge hn + let η := f x₀/(2*R^2) + have hη : 0 < η := by dsimp [η]; positivity + have hηR : η*R^2 = f x₀/2 := by dsimp [η]; field_simp + let v : Position → ℝ := fun x => f x+η*‖x‖^2 + have hq : ContDiff ℝ 2 (fun x : Position => η*‖x‖^2) := contDiff_const.mul (contDiff_norm_sq ℝ) + have hv : ContinuousOn v (Metric.closedBall 0 R) := hf.add hq.continuous.continuousOn + obtain ⟨x, hx, hxm⟩ := (isCompact_closedBall (0 : Position) R).exists_isMaxOn + ⟨x₀, hx₀⟩ hv + have hhigh : η*R^2 < v x := by + have hh := hxm hx₀ + have hq₀ := mul_nonneg hη.le (sq_nonneg ‖x₀‖) + dsimp [v] at * + linarith + have hxnorm : ‖x‖ ≤ R := by simpa only [Metric.mem_closedBall, dist_zero_right] using hx + have hxint : x ∈ Metric.ball 0 R := by + simp only [Metric.mem_ball, dist_zero_right] + by_contra hn + have he : ‖x‖ = R := le_antisymm hxnorm (le_of_not_gt hn) + have hh := hbdy x he + dsimp [v] at hhigh + rw [he] at hhigh + linarith + have hfx : 0 < f x := by + have hqle : η*‖x‖^2 ≤ η*R^2 := mul_le_mul_of_nonneg_left + (sq_le_sq₀ (norm_nonneg _) hR.le |>.mpr hxnorm) hη.le + dsimp [v] at hhigh + linarith + let U := Metric.ball (0 : Position) R ∩ {x | 0 < f x} + have hcont : ContinuousAt f x := hf.continuousAt + (mem_of_superset (Metric.isOpen_ball.mem_nhds hxint) Metric.ball_subset_closedBall) + have hun : U ∈ 𝓝 x := inter_mem (Metric.isOpen_ball.mem_nhds hxint) + (hcont.eventually (Ioi_mem_nhds hfx)) + obtain ⟨r, hr, hsub⟩ : ∃ r > 0, Metric.closedBall x r ⊆ U := + Metric.nhds_basis_closedBall.mem_iff.mp hun + have hlocal : WeakLaplacianLower v (Metric.ball x r) (6*η) := by + have hadd := hw.add_smooth + (fun y hy => hf.continuousAt (mem_of_superset + (Metric.isOpen_ball.mem_nhds hy.1) Metric.ball_subset_closedBall)) + (fun y _ => hq.contDiffAt (x := y)) + (d := 6*η) (fun y _ => by + simpa using (coordinateLaplacian_quadratic 0 y η).ge) + have hadd' : WeakLaplacianLower v U (6*η) := by simpa [v] using hadd + exact hadd'.mono (fun y hy => hsub (Metric.ball_subset_closedBall hy)) + exact no_maximum_of_strict_weakLaplacian_local hr (by positivity : 0 < 6*η) + (hv.mono (fun y hy => Metric.ball_subset_closedBall (hsub hy).1)) hlocal + (fun y hy => hxm (Metric.ball_subset_closedBall (hsub (Metric.ball_subset_closedBall hy)).1)) + +def kTF : ℝ := (2:ℝ)^(3/2 : ℝ)/(3*Real.pi^2) +def aTF : ℝ := (12/(4*Real.pi*kTF))^2 + +theorem kTF_pos : 0 < kTF := by unfold kTF; positivity + +theorem aTF_pos : 0 < aTF := by + have := kTF_pos + unfold aTF + positivity + +theorem rpow_three_halves {x : ℝ} (hx : 0 ≤ x) : + x^(3/2 : ℝ) = x*Real.sqrt x := by + rw [Real.sqrt_eq_rpow, ← Real.rpow_one_add' hx (by norm_num : (1:ℝ)+1/2 ≠ 0)] + norm_num + +theorem aTF_value : aTF = 81*Real.pi^2/8 := by + have htwo : ((2:ℝ)^(3/2 : ℝ))^2 = 8 := by + rw [rpow_three_halves (by norm_num : (0:ℝ)≤2), mul_pow, Real.sq_sqrt (by norm_num)] + norm_num + have hk : kTF^2 = 8/(9*Real.pi^4) := by + unfold kTF + rw [div_pow, htwo] + ring + unfold aTF + rw [div_pow, mul_pow, mul_pow, hk] + field_simp + ring + +theorem profile_coefficient : kTF*aTF^(3/2 : ℝ) = 3*aTF/Real.pi := by + have hk := kTF_pos + rw [rpow_three_halves aTF_pos.le] + have hs : Real.sqrt aTF = 12/(4*Real.pi*kTF) := by + unfold aTF + rw [Real.sqrt_sq (by positivity : (0:ℝ)≤12/(4*Real.pi*kTF))] + rw [hs] + field_simp [ne_of_gt hk] + ring + +theorem weak_sommerfeld_rigidity_exact {F : Position → ℝ} {B C : ℝ} + (hB : 0 < B) (hF : ContinuousOn F punctured) + (hw : HasWeakLaplacian F punctured (fun x => 4*Real.pi*kTF*F x^(3/2 : ℝ))) + (hbounds : ∀ x ≠ 0, B/‖x‖^4 ≤ F x ∧ F x ≤ C/‖x‖^4) : + ∀ x ≠ 0, F x = (81*Real.pi^2/8)/‖x‖^4 := by + have hc : 0 < 4*Real.pi*kTF := by have := kTF_pos; positivity + have hs : ∀ x ≠ 0, B ≤ scaledProfile F x ∧ scaledProfile F x ≤ C := by + intro x hx + have hp : 0 < ‖x‖^4 := pow_pos (norm_pos_iff.mpr hx) _ + have hl := (div_le_iff₀ hp).mp (hbounds x hx).1 + have hu := (le_div_iff₀ hp).mp (hbounds x hx).2 + constructor <;> dsimp [scaledProfile] <;> nlinarith + intro x hx + have he := weak_sommerfeld_rigidity hc hB hF hw hs x hx + change F x = aTF*radialPower (-2) x at he + rw [aTF_value] at he + convert he using 1 + norm_num [radialPower, Real.rpow_neg_natCast, div_eq_mul_inv, ← pow_mul] + +def WeakLaplacianGE (f : Position → ℝ) (U : Set Position) (q : Position → ℝ) : Prop := + ∀ φ : Position → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → + (∀ x, 0 ≤ φ x) → (∫ x, q x*φ x) ≤ ∫ x, f x*coordinateLaplacian φ x + +theorem WeakLaplacianGE.lower_on {f q : Position → ℝ} {U V : Set Position} {c : ℝ} + (hw : WeakLaplacianGE f U q) (hV : V ⊆ U) (hq : LocallyIntegrableOn q U) + (hl : ∀ x ∈ V, c ≤ q x) : WeakLaplacianLower f V c := by + intro φ hφ hc ht hp + have hiq : Integrable (fun x => q x*φ x) := + (integrableOn_iff_integrable_of_support_subset + ((Function.support_mul_subset_right q φ).trans (subset_tsupport φ))).mp + ((hq.integrableOn_compact_subset (ht.trans hV) hc).mul_continuousOn hφ.continuous.continuousOn hc) + apply le_trans _ (hw φ hφ hc (ht.trans hV) hp) + rw [← integral_const_mul] + apply integral_mono ((hφ.continuous.integrable_of_hasCompactSupport hc).const_mul c) hiq + intro x + by_cases hx : x ∈ tsupport φ + · exact mul_le_mul_of_nonneg_right (hl x (ht hx)) (hp x) + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, le_refl] + +theorem weak_comparison_closedBall {u F L q : Position → ℝ} {c R : ℝ} + (hR : 0 < R) (hc : 0 ≤ c) + (hcont : ContinuousOn (fun x => u x-F x-L x-c) (Metric.closedBall 0 R)) + (hL : ∀ x ∈ Metric.ball 0 R, 0 ≤ L x) + (hbdy : ∀ x : Position, ‖x‖ = R → u x-F x-L x-c ≤ 0) + (hw : WeakLaplacianGE (fun x => u x-F x-L x-c) (Metric.ball 0 R) q) + (hq : LocallyIntegrableOn q (Metric.ball 0 R)) + (hsign : ∀ x ∈ Metric.ball 0 R, F x < u x → 0 ≤ q x) : + ∀ x ∈ Metric.closedBall 0 R, u x ≤ F x+L x+c := by + have hw' : WeakLaplacianLower (fun x => u x-F x-L x-c) + (Metric.ball 0 R ∩ {x | 0 < u x-F x-L x-c}) 0 := + hw.lower_on Set.inter_subset_left hq (fun x hx => hsign x hx.1 (by + have := hL x hx.1 + have hp : 0 < u x-F x-L x-c := hx.2 + linarith)) + intro x hx + have hh := weak_maximum_principle_closedBall hR hcont hbdy hw' x hx + linarith + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFCountTest.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFCountTest.lean new file mode 100644 index 0000000000000000000000000000000000000000..b12caa9161d67bb64b1dbf746c5422c169efd5dc --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFCountTest.lean @@ -0,0 +1,117 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.ScaledTest + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology ContDiff +noncomputable section +namespace Coulomb + +lemma rawTFBregman_nonneg {ρ σ : Space → ℝ} + (hρ : ∀ᵐ x, 0≤ρ x) (hσ : ∀ᵐ x, 0≤σ x) : 0≤rawTFBregman ρ σ := by + apply mul_nonneg thomasFermiKineticConstant_pos.le + apply integral_nonneg_of_ae + filter_upwards [hρ,hσ] with x hx hy + exact tf_power_tangent hx hy + +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + +include hΩ in +lemma raw_coulomb_nonneg {σ : Space → ℝ} + (hσ : MemLp σ TFExponent (volume.restrict Ω)) (hs : ∀ x∉Ω, σ x=0) : + 0≤coulombBilinear σ σ := by + have he := tfExtend_toLp hΩ hσ hs + have H := tfCoulomb_self_nonneg hΩ (hσ.toLp σ) + rwa [show tfCoulomb Ω (hσ.toLp σ) (hσ.toLp σ)=coulombBilinear σ σ from + coulombBilinear_congr_ae he he] at H + +lemma rawTF_gap_coulomb (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x, 0≤σ x) (hs : ∀ x∉Ω, σ x=0) : + coulombBilinear (fun x => σ x-localTFDensity hΩ W x) + (fun x => σ x-localTFDensity hΩ W x) ≤ + 2*(rawThomasFermiEnergy Φ σ-rawThomasFermiEnergy Φ (localTFDensity hΩ W)) := by + have H := raw_localTF_gap_density hΩ Φ W hW hσ (ae_restrict_of_ae hp) hs + have HB := rawTFBregman_nonneg (ρ := localTFDensity hΩ W) (Eventually.of_forall (tfDensity_nonneg (localTFMinimizer hΩ W))) hp + linarith + +omit hΩ [IsFiniteMeasure (volume.restrict Ω)] in +lemma integrable_mul_countTest {f : Space → ℝ} (hf : Integrable f) (y : Space) (a : ℝ) : + Integrable (fun x => f x*countTest y a x) := + hf.mul_bdd (countTest_smooth y a).continuous.aestronglyMeasurable + (Eventually.of_forall (fun x => by rw [Real.norm_of_nonneg (countTest_nonneg y a x)]; exact countTest_le_one y a x)) + +lemma rawTF_count_test (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x, 0≤σ x) (hs : ∀ x∉Ω, σ x=0) + (y : Space) {a : ℝ} (ha : 0 by rw [hs x hx,hρs x hx,sub_self] + have H := raw_coulomb_smooth_test hΩ (countTest_smooth y a) (countTest_compact y ha) + ((countTest_support y ha).trans hb) hd hds + rw [countTest_energy y ha] at H + have hQ := raw_coulomb_nonneg hΩ hd hds + have Hgap := rawTF_gap_coulomb hΩ Φ W hW hσ hp hs + have He := mul_le_mul_of_nonneg_left (le_max_left countTestEnergy 0) (mul_nonneg ha.le hQ) + have Hg := mul_le_mul_of_nonneg_right Hgap (mul_nonneg ha.le (le_max_right countTestEnergy 0)) + have hiσ : Integrable σ := (tfExtend_integrable hΩ (hσ.toLp σ)).congr (tfExtend_toLp hΩ hσ hs) + have hiρ : Integrable ρ := (tfExtend_integrable hΩ (localTFMinimizer hΩ W)).congr + (tfDensity_ae_tfExtend hΩ (localTFMinimizer_nonneg hΩ W)).symm + have hiσχ := integrable_mul_countTest hiσ y a + have hiρχ := integrable_mul_countTest hiρ y a + have he : (∫ x, (σ x-ρ x)*countTest y a x)=(∫ x, σ x*countTest y a x)- + (∫ x, ρ x*countTest y a x) := by + simp_rw [sub_mul]; exact integral_sub hiσχ hiρχ + simp only [Pi.sub_apply,Pi.sub_def] at H hQ He + rw [he] at H + dsimp only [ρ] at H hQ He hiρχ + nlinarith only [H,He,Hg,sq_nonneg ((∫ x, σ x*countTest y a x)-2*(∫ x, localTFDensity hΩ W x*countTest y a x))] + +include hΩ in +lemma tfDensity_test_bound {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (y : Space) {a B : ℝ} (ha : 0.indicator (fun _ => B)) := by + apply integrable_indicator_iff measurableSet_closedBall |>.mpr + exact integrable_const B + have H : (∫ x, tfDensity Ω f x*countTest y a x)≤ + ∫ x in Metric.closedBall y (2*a), B := by + rw [←integral_indicator measurableSet_closedBall] + apply integral_mono_ae hi hj + filter_upwards [(ae_restrict_iff' measurableSet_closedBall).mp hbound] with x hx + by_cases h : x∈Metric.closedBall y (2*a) + · rw [indicator_of_mem h] + calc + _≤B*countTest y a x := mul_le_mul_of_nonneg_right (hx h) (countTest_nonneg y a x) + _≤B := mul_le_of_le_one_right hB (countTest_le_one y a x) + · rw [indicator_of_notMem h,countTest_zero y ha (le_of_lt (by simpa only [Metric.mem_closedBall,dist_eq_norm,not_le] using h)),mul_zero] + apply H.trans_eq + simp only [integral_const,Measure.real,Measure.restrict_apply_univ,EuclideanSpace.volume_closedBall_fin_three, + ENNReal.toReal_mul,ENNReal.toReal_pow,ENNReal.toReal_ofReal (by positivity : 0≤2*a), + ENNReal.toReal_ofReal (by positivity : 0≤Real.pi*4/3),smul_eq_mul] + ring + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFExponent.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFExponent.lean new file mode 100644 index 0000000000000000000000000000000000000000..7cc3d65e2dbfde33c0aa12b96bf020eccac1e026 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFExponent.lean @@ -0,0 +1,261 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.Gaussian + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +noncomputable abbrev TFExponent : ℝ≥0∞ := ENNReal.ofReal (5/3:ℝ) +instance : Fact (1 ≤ TFExponent) := ⟨by norm_num [TFExponent]⟩ +noncomputable abbrev TFLp {α : Type*} [MeasurableSpace α] (μ : Measure α) := Lp ℝ TFExponent μ +lemma tfLp_norm {α : Type*} [MeasurableSpace α] {μ : Measure α} (f : TFLp μ) : + ‖f‖ = (∫ x, ‖f x‖^(5/3:ℝ) ∂μ)^(3/5:ℝ) := by + rw [Lp.norm_def, toReal_eLpNorm, + lpNorm_eq_integral_norm_rpow_toReal (by norm_num [TFExponent]) (by simp) + (Lp.memLp f).aestronglyMeasurable] + norm_num [TFExponent] +lemma tfLp_norm_power {α : Type*} [MeasurableSpace α] {μ : Measure α} (f : TFLp μ) : + ‖f‖^(5/3:ℝ) = ∫ x, ‖f x‖^(5/3:ℝ) ∂μ := by + rw [tfLp_norm, ← Real.rpow_mul (integral_nonneg (fun x => Real.rpow_nonneg (norm_nonneg _) _))] + norm_num +lemma tfLp_integral_norm_le {α : Type*} [MeasurableSpace α] {μ : Measure α} + [IsFiniteMeasure μ] (f : TFLp μ) : + (∫ x, ‖f x‖ ∂μ) ≤ (μ.real univ)^(2/5:ℝ)*‖f‖ := by + have H := integral_mul_norm_le_Lp_mul_Lq coulomb_holder_exponents + (memLp_const (p := ENNReal.ofReal (5/2:ℝ)) (1:ℝ)) (Lp.memLp f) + simp only [norm_one, one_mul, Real.one_rpow, integral_const, smul_eq_mul] at H + rw [tfLp_norm] + convert H using 1; norm_num + +noncomputable def tfExtend (Ω : Set Space) (f : TFLp (volume.restrict Ω)) : Space → ℝ := + Ω.indicator f +lemma tfExtend_measurable {Ω : Set Space} (hΩ : MeasurableSet Ω) (f : TFLp (volume.restrict Ω)) : + Measurable (tfExtend Ω f) := (Lp.stronglyMeasurable f).measurable.indicator hΩ +lemma tfExtend_memLp {Ω : Set Space} (hΩ : MeasurableSet Ω) (f : TFLp (volume.restrict Ω)) : + MemLp (tfExtend Ω f) TFExponent volume := + (memLp_indicator_iff_restrict hΩ).mpr (Lp.memLp f) +lemma tfExtend_integrable {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (f : TFLp (volume.restrict Ω)) : + Integrable (tfExtend Ω f) := + (show IntegrableOn (fun x => f x) Ω volume from + (Lp.memLp f).integrable (show 1 ≤ TFExponent by norm_num [TFExponent])).integrable_indicator hΩ +lemma tfExtend_norm_integral {Ω : Set Space} (hΩ : MeasurableSet Ω) (f : TFLp (volume.restrict Ω)) : + (∫ x, ‖tfExtend Ω f x‖) = ∫ x in Ω, ‖f x‖ := by + simp only [tfExtend, norm_indicator_eq_indicator_norm, integral_indicator hΩ] +lemma tfExtend_norm_power_integral {Ω : Set Space} (hΩ : MeasurableSet Ω) (f : TFLp (volume.restrict Ω)) : + (∫ x, ‖tfExtend Ω f x‖^(5/3:ℝ)) = ‖f‖^(5/3:ℝ) := by + rw [tfLp_norm_power] + rw [← integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ Ω <;> simp [tfExtend, hx] + +noncomputable def tfCoulomb (Ω : Set Space) (f g : TFLp (volume.restrict Ω)) : ℝ := + ∫ p : Space × Space, tfExtend Ω f p.1 * tfExtend Ω g p.2 * coulombKernel (p.1-p.2) +lemma tfCoulomb_integrable {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (f g : TFLp (volume.restrict Ω)) : + Integrable (fun p : Space × Space => tfExtend Ω f p.1 * tfExtend Ω g p.2 * coulombKernel (p.1-p.2)) := + coulomb_lp_pair_integrable (tfExtend_integrable hΩ f) (tfExtend_measurable hΩ f) + (tfExtend_integrable hΩ g) (tfExtend_measurable hΩ g) (tfExtend_memLp hΩ g) +lemma tfCoulomb_self_nonneg {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (f : TFLp (volume.restrict Ω)) : + 0 ≤ tfCoulomb Ω f f := + coulomb_lp_form_nonneg (tfExtend_integrable hΩ f) (tfExtend_measurable hΩ f) (tfExtend_memLp hΩ f) +lemma tfExtend_convolution_bound {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (f : TFLp (volume.restrict Ω)) (x : Space) : + (∫ y, coulombKernel (x-y)*‖tfExtend Ω f y‖) ≤ + ((8*Real.pi)^(2/5:ℝ) + (volume.real Ω)^(2/5:ℝ))*‖f‖ := by + have H := coulomb_lp_convolution_bound (tfExtend_integrable hΩ f) (tfExtend_measurable hΩ f) + (tfExtend_memLp hΩ f) (by norm_num : (0:ℝ)<1) x + rw [tfExtend_norm_power_integral hΩ, ← Real.rpow_mul (norm_nonneg f)] at H + norm_num only [Real.one_rpow, mul_one, inv_one, one_mul, show (5/3:ℝ)*(3/5)=1 by norm_num, + Real.rpow_one] at H + rw [tfExtend_norm_integral hΩ] at H + have H1 := tfLp_integral_norm_le f + simp only [Measure.real, Measure.restrict_apply_univ] at H1 + dsimp only [Measure.real] + nlinarith +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma tf_power_strong_convex {R : ℝ} (_hR : 0 < R) : + StrongConvexOn (Icc 0 R) ((10/9:ℝ)*R^(-(1/3:ℝ))) (fun x : ℝ => x^(5/3:ℝ)) := by + rw [strongConvexOn_iff_convex] + have he : (fun x : ℝ => x^(5/3:ℝ) - ((10/9:ℝ)*R^(-(1/3:ℝ)))/2*‖x‖^2) = + (fun x : ℝ => x^(5/3:ℝ) - (5/9:ℝ)*R^(-(1/3:ℝ))*x^2) := by + ext x + rw [Real.norm_eq_abs, sq_abs] + ring + rw [he] + apply convexOn_of_hasDerivWithinAt2_nonneg (convex_Icc 0 R) + (f' := fun x => (5/3:ℝ)*x^(2/3:ℝ) - (10/9:ℝ)*R^(-(1/3:ℝ))*x) + (f'' := fun x => (10/9:ℝ)*(x^(-(1/3:ℝ))-R^(-(1/3:ℝ)))) + · exact ((Real.continuous_rpow_const (by norm_num : (0:ℝ)≤5/3)).sub + (continuous_const.mul (continuous_pow 2))).continuousOn + · intro x hx + have hd := (Real.hasDerivAt_rpow_const (x := x) (p := 5/3) (Or.inr (by norm_num))).sub + (((hasDerivAt_pow 2 x).const_mul ((5/9:ℝ)*R^(-(1/3:ℝ))))) + convert! hd.hasDerivWithinAt (s := interior (Icc (0:ℝ) R)) using 1; norm_num + all_goals first | rfl | ring + · intro x hx + rw [interior_Icc] at hx + have hd := ((Real.hasDerivAt_rpow_const (x := x) (p := 2/3) (Or.inl hx.1.ne')).const_mul (5/3:ℝ)).sub + ((hasDerivAt_id x).const_mul ((10/9:ℝ)*R^(-(1/3:ℝ)))) + convert! hd.hasDerivWithinAt (s := interior (Icc (0:ℝ) R)) using 1; norm_num + all_goals first | rfl | ring + · intro x hx + rw [interior_Icc] at hx + exact mul_nonneg (by norm_num) + (sub_nonneg.mpr (Real.rpow_le_rpow_of_nonpos hx.1 hx.2.le (by norm_num))) + +lemma tf_power_midpoint_gap {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) : + (5/36:ℝ)*(a+b+1)^(-(1/3:ℝ))*(a-b)^2 ≤ + (a^(5/3:ℝ)+b^(5/3:ℝ))/2 - ((a+b)/2)^(5/3:ℝ) := by + have H := (tf_power_strong_convex (show 0 < a+b+1 by linarith)).2 + (show a ∈ Icc 0 (a+b+1) from ⟨ha,by linarith⟩) + (show b ∈ Icc 0 (a+b+1) from ⟨hb,by linarith⟩) + (show (0:ℝ)≤1/2 by norm_num) (show (0:ℝ)≤1/2 by norm_num) (by norm_num) + simp only [smul_eq_mul, Real.norm_eq_abs, sq_abs] at H + have he : (1/2:ℝ)*a+(1/2:ℝ)*b=(a+b)/2 := by ring + rw [he] at H + nlinarith +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma tf_power_difference_factor {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) : + ‖a-b‖^(5/3:ℝ) = + ((a+b+1)^(-(1/3:ℝ))*(a-b)^2)^(5/6:ℝ) * + ((a+b+1)^(5/3:ℝ))^(1/6:ℝ) := by + have hR : 0 < a+b+1 := by linarith + rw [Real.mul_rpow (Real.rpow_nonneg hR.le _) (sq_nonneg _), + ← Real.rpow_mul hR.le, ← Real.rpow_mul hR.le] + have hs : ((a-b)^2)^(5/6:ℝ) = ‖a-b‖^(5/3:ℝ) := by + rw [← sq_abs, ← Real.rpow_natCast, ← Real.rpow_mul (abs_nonneg _)] + norm_num + rw [hs, mul_right_comm, ← Real.rpow_add hR] + norm_num + +lemma tf_midpoint_gap_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) : + 0 ≤ (a^(5/3:ℝ)+b^(5/3:ℝ))/2 - ((a+b)/2)^(5/3:ℝ) := + (mul_nonneg (mul_nonneg (by norm_num) (Real.rpow_nonneg (by linarith) _)) + (sq_nonneg _)).trans (tf_power_midpoint_gap ha hb) + +lemma integrable_rpow_of_memLp_nonneg {α : Type*} [MeasurableSpace α] {μ : Measure α} + {f : α → ℝ} {p : ℝ} (hp : 0 < p) (hf : MemLp f (ENNReal.ofReal p) μ) + (hn : ∀ᵐ x ∂μ, 0 ≤ f x) : Integrable (fun x => f x ^ p) μ := by + have H := hf.integrable_norm_rpow (by simpa using hp) (by simp) + apply H.congr + filter_upwards [hn] with x hx + simp [Real.norm_of_nonneg hx, ENNReal.toReal_ofReal hp.le] + +lemma memLp_rpow_of_integrable_nonneg {α : Type*} [MeasurableSpace α] {μ : Measure α} + {f : α → ℝ} (hf : Integrable f μ) (hn : ∀ᵐ x ∂μ, 0 ≤ f x) + {q : ℝ} (hq : 0 < q) : MemLp (fun x => f x ^ q) (ENNReal.ofReal (1/q)) μ := by + have H := (memLp_one_iff_integrable.mpr hf).norm_rpow_div (ENNReal.ofReal q) + have he : (1:ℝ≥0∞) / ENNReal.ofReal q = ENNReal.ofReal (1/q) := by + rw [ENNReal.ofReal_div_of_pos hq, ENNReal.ofReal_one] + rw [he] at H + apply H.ae_eq + filter_upwards [hn] with x hx + simp [Real.norm_of_nonneg hx, ENNReal.toReal_ofReal hq.le] + +lemma tf_integrated_midpoint_gap {α : Type*} [MeasurableSpace α] {μ : Measure α} + [IsFiniteMeasure μ] {f g : α → ℝ} + (hf : MemLp f (ENNReal.ofReal (5/3:ℝ)) μ) (hg : MemLp g (ENNReal.ofReal (5/3:ℝ)) μ) + (hf0 : ∀ᵐ x ∂μ, 0 ≤ f x) (hg0 : ∀ᵐ x ∂μ, 0 ≤ g x) : + (∫ x, ‖f x-g x‖^(5/3:ℝ) ∂μ) ≤ + ((36/5:ℝ)*((∫ x, f x^(5/3:ℝ) ∂μ)+(∫ x, g x^(5/3:ℝ) ∂μ))/2 - + (36/5:ℝ)*(∫ x, ((f x+g x)/2)^(5/3:ℝ) ∂μ))^(5/6:ℝ) * + (∫ x, (f x+g x+1)^(5/3:ℝ) ∂μ)^(1/6:ℝ) := by + let d := fun x => (f x^(5/3:ℝ)+g x^(5/3:ℝ))/2 - ((f x+g x)/2)^(5/3:ℝ) + let u := fun x => (f x+g x+1)^(-(1/3:ℝ))*(f x-g x)^2 + let v := fun x => (f x+g x+1)^(5/3:ℝ) + have hfi := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) hf hf0 + have hgi := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) hg hg0 + have hm : MemLp (fun x => (f x+g x)/2) (ENNReal.ofReal (5/3:ℝ)) μ := by + simpa only [div_eq_mul_inv, Pi.add_apply] using (hf.add hg).mul_const (2:ℝ)⁻¹ + have hmi := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) hm + (by filter_upwards [hf0,hg0] with x hx hy; positivity) + have hdi : Integrable d μ := ((hfi.add hgi).div_const 2).sub hmi + have hd0 : ∀ᵐ x ∂μ, 0 ≤ d x := by + filter_upwards [hf0,hg0] with x hx hy + exact tf_midpoint_gap_nonneg hx hy + have hu0 : ∀ᵐ x ∂μ, 0 ≤ u x := by + filter_upwards [hf0,hg0] with x hx hy + exact mul_nonneg (Real.rpow_nonneg (by linarith) _) (sq_nonneg _) + have hule : ∀ᵐ x ∂μ, u x ≤ (36/5:ℝ)*d x := by + filter_upwards [hf0,hg0] with x hx hy + have H := tf_power_midpoint_gap hx hy + dsimp [u,d] + nlinarith + have hum : AEStronglyMeasurable u μ := by + exact (((hf.aestronglyMeasurable.add hg.aestronglyMeasurable).add + aestronglyMeasurable_const).aemeasurable.pow_const _).aestronglyMeasurable.mul + ((hf.aestronglyMeasurable.sub hg.aestronglyMeasurable).pow 2) + have hui : Integrable u μ := (hdi.const_mul (36/5:ℝ)).mono' hum (by + filter_upwards [hule, hu0] with x hx hn + simpa only [Real.norm_of_nonneg hn] using hx) + have hvp := (hf.add hg).add (memLp_const (1:ℝ)) + have hv0 : ∀ᵐ x ∂μ, 0 ≤ v x := by + filter_upwards [hf0,hg0] with x hx hy + exact Real.rpow_nonneg (by linarith) _ + have hvi : Integrable v μ := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) hvp + (by filter_upwards [hf0,hg0] with x hx hy; positivity) + have hup := memLp_rpow_of_integrable_nonneg hui hu0 (by norm_num : (0:ℝ)<5/6) + have hvp' := memLp_rpow_of_integrable_nonneg hvi hv0 (by norm_num : (0:ℝ)<1/6) + have H := integral_mul_le_Lp_mul_Lq_of_nonneg + (show (6/5:ℝ).HolderConjugate 6 by constructor <;> norm_num) + (show ∀ᵐ x ∂μ, 0 ≤ u x^(5/6:ℝ) by filter_upwards [hu0] with x hx; positivity) + (show ∀ᵐ x ∂μ, 0 ≤ v x^(1/6:ℝ) by filter_upwards [hv0] with x hx; positivity) + (by convert hup using 1; norm_num) (by convert hvp' using 1; norm_num) + have hlu : (∫ x, (u x^(5/6:ℝ))^(6/5:ℝ) ∂μ) = ∫ x, u x ∂μ := by + apply integral_congr_ae + filter_upwards [hu0] with x hx + rw [← Real.rpow_mul hx] + norm_num + have hlv : (∫ x, (v x^(1/6:ℝ))^(6:ℝ) ∂μ) = ∫ x, v x ∂μ := by + apply integral_congr_ae + filter_upwards [hv0] with x hx + rw [← Real.rpow_mul hx] + norm_num + rw [hlu, hlv] at H + have hleft : (∫ x, ‖f x-g x‖^(5/3:ℝ) ∂μ) = ∫ x, u x^(5/6:ℝ)*v x^(1/6:ℝ) ∂μ := by + apply integral_congr_ae + filter_upwards [hf0,hg0] with x hx hy + exact tf_power_difference_factor hx hy + rw [hleft] + have huint : (∫ x, u x ∂μ) ≤ (36/5:ℝ)*(∫ x, d x ∂μ) := by + rw [← integral_const_mul] + exact integral_mono_ae hui (hdi.const_mul _) hule + have hdint : (36/5:ℝ)*(∫ x, d x ∂μ) = + (36/5:ℝ)*((∫ x, f x^(5/3:ℝ) ∂μ)+(∫ x, g x^(5/3:ℝ) ∂μ))/2 - + (36/5:ℝ)*(∫ x, ((f x+g x)/2)^(5/3:ℝ) ∂μ) := by + dsimp [d] + rw [integral_sub (by exact (hfi.add hgi).div_const 2) hmi, integral_div] + rw [integral_add hfi hgi] + ring + rw [← hdint] + norm_num only [show (1:ℝ)/(6/5)=5/6 by norm_num] at H + exact H.trans (mul_le_mul_of_nonneg_right + (Real.rpow_le_rpow (integral_nonneg_of_ae hu0) huint (by norm_num : (0:ℝ)≤5/6)) + (Real.rpow_nonneg (integral_nonneg_of_ae hv0) _)) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFInterior.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFInterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2281581efa7bc01fe4f6b1412883a0b2633938b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFInterior.lean @@ -0,0 +1,196 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.CorrectionDensity +import OAI.Analysis.CoulombRadii.ThomasFermi.TfExtendNonneg +import OAI.Analysis.CoulombRadii.RadialBounds.InteriorBarrier + +namespace OAI + +section +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Classical BigOperators Topology ContDiff +noncomputable section +namespace Coulomb + +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + +include hΩ +omit [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfPotential_nonneg_of_nonneg {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (x : Space) : + 0 ≤ tfPotential f x := by + apply integral_nonneg_of_ae + filter_upwards [tfExtend_nonneg hΩ hf] with y hy + exact mul_nonneg (coulombKernel_nonneg _) hy + +lemma tfDensity_bound_of_minimizes {c F : ℝ} (hc : 0 min (tfDensity Ω f x) L + have hL : 0≤L := Real.rpow_nonneg (by positivity) _ + have hρ : ρ =ᵐ[volume] tfExtend Ω f := by + filter_upwards [tfDensity_bound_of_minimizes hΩ hc hF W hW hf hm, + tfDensity_ae_tfExtend hΩ hf] with x hx he + exact (min_eq_left hx).trans he + have hi : Integrable ρ := (tfExtend_integrable hΩ f).congr hρ.symm + have hp (x) : 0≤ρ x := le_min (tfDensity_nonneg _ _) hL + have hb (x) : ρ x≤L := min_le_right _ _ + have he : tfPotential f = NeutralAtom.potentialOf ρ := by + funext x + apply integral_congr_ae + filter_upwards [hρ] with y hy + change coulombKernel (x-y)*tfExtend Ω f y=coulombKernel (x-y)*ρ y + rw [hy] + rw [he] + exact NeutralAtom.potentialOf_continuous hi hp hb + +lemma tfScreened_weak_equation {c F : ℝ} (hc : 0 0)) : + NeutralAtom.HasWeakLaplacian (fun x => Φ x-tfPotential f x) Ω + (fun x => (4*Real.pi)/(c*(5/3:ℝ))^(3/2:ℝ)*(max (Φ x-tfPotential f x) 0)^(3/2:ℝ)) := by + intro φ hφ hφc ht + have hL := NeutralAtom.continuous_coordinateLaplacian + (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLc := NeutralAtom.hasCompactSupport_coordinateLaplacian hφc + have hts : tsupport (NeutralAtom.coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + exact hx (NeutralAtom.coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + have hiΦ : Integrable (fun x => Φ x*NeutralAtom.coordinateLaplacian φ x) := + NeutralAtom.integrable_mul_compact_of_continuousAt + (fun x hx => hΦ.continuousAt (ho.mem_nhds (ht (hts hx)))) hL hLc + have hiP : Integrable (fun x => tfPotential f x*NeutralAtom.coordinateLaplacian φ x) := + NeutralAtom.integrable_mul_compact_of_continuousAt + (fun x _ => (tfPotential_continuous_of_minimizes hΩ hc hF W hW hf hm).continuousAt) hL hLc + have hP := NeutralAtom.potentialOf_weakLaplacian (tfExtend_integrable hΩ f) φ hφ hφc (subset_univ _) + change (∫ x, tfPotential f x*NeutralAtom.coordinateLaplacian φ x) = _ at hP + simp_rw [sub_mul] + rw [integral_sub hiΦ hiP,hh φ hφ hφc ht,hP] + simp only [zero_mul,integral_zero,zero_sub,←integral_neg,neg_mul,neg_neg] + apply integral_congr_ae + have hE := (ae_restrict_iff' hΩ).mp (tfEuler_equation hΩ hc W hf hm) + have hWe := (ae_restrict_iff' hΩ).mp he + filter_upwards [hE,hWe] with x hx hw + by_cases hs : x∈Ω + · simp only [tfExtend,indicator_of_mem hs] + rw [(hx hs).1,hw hs,Real.div_rpow (le_max_right _ _) (by positivity)] + ring + · have hpz : φ x=0 := image_eq_zero_of_notMem_tsupport (fun h => hs (ht h)) + simp only [hpz,mul_zero] + +theorem tfScreened_interior_upper {c F : ℝ} (hc : 0 0)) + {y : Space} {s : ℝ} (hs : 0 0)) + {y : Space} {a : ℝ} (ha : 0.mpr hz'] + have hD0 : 0<(4*a)^2-‖z-y‖^2 := (sq_pos_of_pos ha).trans_le hD + apply H.trans + have hd4 : a^8 ≤ ((4*a)^2-‖z-y‖^2)^4 := by + simpa only [←pow_mul,show 2*4=8 by norm_num] using pow_le_pow_left₀ (sq_nonneg a) hD 4 + apply (div_le_div_iff₀ (pow_pos hD0 4) (pow_pos ha 4)).mpr + have hc0 := tfInteriorConstant_nonneg c + have Hm := mul_le_mul_of_nonneg_left hd4 hc0 + calc + _ = tfInteriorConstant c*a^8 := by dsimp [tfInteriorConstant]; ring + _ ≤ _ := Hm + +lemma tfDensity_interior_bound {c F : ℝ} (hc : 0 0)) + {y : Space} {a : ℝ} (ha : 0 by simp only [hz]) + unfold rawTFNegativeError + apply integral_congr_ae + filter_upwards [hσ] with x hx + rw [hp,hx] + +lemma rawTFNegativeError_tfDensity {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {f g : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (hg : TFNonneg g) : + rawTFNegativeError Φ (tfDensity Ω f) (tfDensity Ω g)= + ∫ x in Ω, max (tfPotential f x-W x) 0*g x := by + rw [rawTFNegativeError_congr_ae Φ (tfDensity_ae_tfExtend hΩ hf) (tfDensity_ae_tfExtend hΩ hg)] + unfold rawTFNegativeError + change (∫ x, max (tfPotential f x-Φ x) 0*tfExtend Ω g x)=_ + calc + _ = ∫ x in Ω, max (tfPotential f x-Φ x) 0*g x := by + rw [←integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x∈Ω <;> simp [tfExtend,hx] + _ = _ := integral_congr_ae (hW.mono fun x hx => by rw [hx]) + +lemma raw_localTF_gap_identity {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + coulombBilinear (fun x => tfDensity Ω f x-localTFDensity hΩ W x) + (fun x => tfDensity Ω f x-localTFDensity hΩ W x)/2+ + rawTFBregman (localTFDensity hΩ W) (tfDensity Ω f)+ + rawTFNegativeError Φ (localTFDensity hΩ W) (tfDensity Ω f)= + rawThomasFermiEnergy Φ (tfDensity Ω f)-rawThomasFermiEnergy Φ (localTFDensity hΩ W) := by + unfold localTFDensity + rw [coulombBilinear_tfDensity_sub hΩ (localTFMinimizer_nonneg hΩ W) hf, + rawTFBregman_tfDensity hΩ (localTFMinimizer_nonneg hΩ W) hf, + rawTFNegativeError_tfDensity hΩ Φ W hW (localTFMinimizer_nonneg hΩ W) hf, + rawThomasFermiEnergy_tfDensity hΩ Φ W hW hf, + rawThomasFermiEnergy_tfDensity hΩ Φ W hW (localTFMinimizer_nonneg hΩ W)] + exact (tfEnergy_minimizer_expansion hΩ thomasFermiKineticConstant_pos W + (localTFMinimizer_nonneg hΩ W) (fun _ hf => localTFMinimizer_minimizes hΩ W hf)).symm + +lemma raw_localTF_gap_identity_density {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x ∂volume.restrict Ω, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x = 0) : + coulombBilinear (fun x => σ x-localTFDensity hΩ W x) + (fun x => σ x-localTFDensity hΩ W x)/2+ + rawTFBregman (localTFDensity hΩ W) σ+ + rawTFNegativeError Φ (localTFDensity hΩ W) σ= + rawThomasFermiEnergy Φ σ-rawThomasFermiEnergy Φ (localTFDensity hΩ W) := by + have he := tfDensity_rawToTFLp hΩ hσ hp hs + have hd : (fun x => tfDensity Ω (rawToTFLp σ hσ) x-localTFDensity hΩ W x) =ᵐ[volume] + (fun x => σ x-localTFDensity hΩ W x) := he.sub EventuallyEq.rfl + have H := raw_localTF_gap_identity hΩ Φ W hW (rawToTFLp_nonneg hσ hp) + rwa [coulombBilinear_congr_ae hd hd,rawTFBregman_congr_ae EventuallyEq.rfl he, + rawTFNegativeError_congr_ae Φ EventuallyEq.rfl he,rawThomasFermiEnergy_congr_ae Φ he] at H + +lemma raw_localTF_refined_gap_density {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x ∂volume.restrict Ω, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x = 0) : + coulombBilinear (fun x => σ x-localTFDensity hΩ W x) + (fun x => σ x-localTFDensity hΩ W x)/2+ + rawTFNegativeError Φ (localTFDensity hΩ W) σ ≤ + rawThomasFermiEnergy Φ σ-rawThomasFermiEnergy Φ (localTFDensity hΩ W) := by + rw [←raw_localTF_gap_identity_density hΩ Φ W hW hσ hp hs] + have he := tfDensity_rawToTFLp hΩ hσ hp hs + have hb : 0 ≤ rawTFBregman (localTFDensity hΩ W) σ := by + rw [←rawTFBregman_congr_ae EventuallyEq.rfl he] + unfold localTFDensity + rw [rawTFBregman_tfDensity hΩ (localTFMinimizer_nonneg hΩ W) (rawToTFLp_nonneg hσ hp)] + exact mul_nonneg thomasFermiKineticConstant_pos.le + (tfBregman_nonneg (localTFMinimizer_nonneg hΩ W) (rawToTFLp_nonneg hσ hp)) + linarith +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFNonneg.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFNonneg.lean new file mode 100644 index 0000000000000000000000000000000000000000..78673553da39de4b768776aa5fc066f89005f25d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFNonneg.lean @@ -0,0 +1,212 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TFExponent + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} +def TFNonneg (f : TFLp μ) : Prop := ∀ᵐ x ∂μ, 0 ≤ f x +lemma tfNonneg_zero : TFNonneg (0 : TFLp μ) := by + change ∀ᵐ x ∂μ, 0 ≤ (0 : Lp ℝ TFExponent μ) x + filter_upwards [Lp.coeFn_zero ℝ TFExponent μ] with x hx + rw [hx] + rfl +lemma TFNonneg.add {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : TFNonneg (f+g) := by + filter_upwards [hf,hg,Lp.coeFn_add f g] with x hx hy hz + simpa only [hz, Pi.add_apply] using add_nonneg hx hy +lemma TFNonneg.smul {f : TFLp μ} (hf : TFNonneg f) {c : ℝ} (hc : 0 ≤ c) : TFNonneg (c • f) := by + filter_upwards [hf,Lp.coeFn_smul c f] with x hx hz + simpa only [hz, Pi.smul_apply, smul_eq_mul] using mul_nonneg hc hx +lemma tfNonneg_closed : IsClosed {f : TFLp μ | TFNonneg f} := by + apply IsSeqClosed.isClosed + intro f g hf hfg + obtain ⟨ns, hns, hn⟩ := (tendstoInMeasure_of_tendsto_Lp hfg).exists_seq_tendsto_ae + filter_upwards [hn, ae_all_iff.mpr hf] with x hx hy + exact ge_of_tendsto hx (Filter.Eventually.of_forall (fun n => hy (ns n))) +lemma tfLp_nonneg_power {f : TFLp μ} (hf : TFNonneg f) : + (∫ x, (f x)^(5/3:ℝ) ∂μ) = ‖f‖^(5/3:ℝ) := by + rw [tfLp_norm_power] + apply integral_congr_ae + filter_upwards [hf] with x hx + rw [Real.norm_of_nonneg hx] +lemma tfLp_midpoint_power {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : + (∫ x, ((f x+g x)/2)^(5/3:ℝ) ∂μ) = ‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ) := by + rw [← tfLp_nonneg_power ((hf.add hg).smul (by norm_num : (0:ℝ)≤1/2))] + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul (1/2:ℝ) (f+g), Lp.coeFn_add f g] with x hx hy + simp only [hx,hy,Pi.smul_apply,Pi.add_apply,smul_eq_mul] + congr 1; ring +noncomputable def tfOne [IsFiniteMeasure μ] : TFLp μ := + (memLp_const (p := TFExponent) (1:ℝ)).toLp (fun _ => 1) +lemma tfOne_coe [IsFiniteMeasure μ] : (tfOne : TFLp μ) =ᵐ[μ] fun _ => 1 := + MemLp.coeFn_toLp _ +lemma tfNonneg_one [IsFiniteMeasure μ] : TFNonneg (tfOne : TFLp μ) := by + filter_upwards [tfOne_coe (μ := μ)] with x hx + simp [hx] +lemma tfLp_gap_nonneg {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : + 0 ≤ (‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2 - ‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ) := by + rw [← tfLp_nonneg_power hf, ← tfLp_nonneg_power hg, ← tfLp_midpoint_power hf hg] + have hi := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) (Lp.memLp f) hf + have hj := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) (Lp.memLp g) hg + have hk : Integrable (fun x => ((f x+g x)/2)^(5/3:ℝ)) μ := by + apply integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) + (by simpa only [TFExponent,div_eq_mul_inv, Pi.add_apply] using ((Lp.memLp f).add (Lp.memLp g)).mul_const (2:ℝ)⁻¹) + (by filter_upwards [hf,hg] with x hx hy; positivity) + rw [← integral_add hi hj, ← integral_div, ← integral_sub (by exact (hi.add hj).div_const 2) hk] + apply integral_nonneg_of_ae + filter_upwards [hf,hg] with x hx hy + exact tf_midpoint_gap_nonneg hx hy +lemma tfLp_midpoint_gap [IsFiniteMeasure μ] {f g : TFLp μ} + (hf : TFNonneg f) (hg : TFNonneg g) : + ‖f-g‖^(5/3:ℝ) ≤ + ((36/5:ℝ)*((‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2 - ‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ)))^(5/6:ℝ) * + (‖f‖+‖g‖+‖(tfOne : TFLp μ)‖)^(5/18:ℝ) := by + have H := tf_integrated_midpoint_gap (Lp.memLp f) (Lp.memLp g) hf hg + rw [tfLp_nonneg_power hf, tfLp_nonneg_power hg, tfLp_midpoint_power hf hg] at H + have he : (∫ x, ‖f x-g x‖^(5/3:ℝ) ∂μ) = ‖f-g‖^(5/3:ℝ) := by + rw [tfLp_norm_power] + apply integral_congr_ae + filter_upwards [Lp.coeFn_sub f g] with x hx + rw [hx]; rfl + rw [he] at H + have hi : (∫ x, (f x+g x+1)^(5/3:ℝ) ∂μ) = ‖f+g+tfOne‖^(5/3:ℝ) := by + rw [← tfLp_nonneg_power ((hf.add hg).add tfNonneg_one)] + apply integral_congr_ae + filter_upwards [Lp.coeFn_add (f+g) tfOne,Lp.coeFn_add f g,tfOne_coe (μ := μ)] with x hx hy hz + simp only [hx,hy,hz,Pi.add_apply] + rw [hi, ← Real.rpow_mul (norm_nonneg _)] at H + have hnorm : ‖f+g+tfOne‖ ≤ ‖f‖+‖g‖+‖(tfOne : TFLp μ)‖ := + (norm_add_le _ _).trans (add_le_add (norm_add_le f g) le_rfl) + have hnormp := Real.rpow_le_rpow (norm_nonneg _) hnorm (by norm_num : (0:ℝ)≤5/18) + have hg0 := tfLp_gap_nonneg hf hg + have hp : 0 ≤ (36/5:ℝ)*((‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2-‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ)) := + mul_nonneg (by norm_num) hg0 + have hb : (36/5:ℝ)*(‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2-(36/5:ℝ)*‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ) = + (36/5:ℝ)*((‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2-‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ)) := by ring + rw [hb, show (5/3:ℝ)*(1/6)=5/18 by norm_num] at H + exact H.trans (mul_le_mul_of_nonneg_left hnormp (Real.rpow_nonneg hp _)) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma tfExtend_add_ae {Ω : Set Space} (hΩ : MeasurableSet Ω) + (f g : TFLp (volume.restrict Ω)) : + tfExtend Ω (f+g) =ᵐ[volume] fun x => tfExtend Ω f x + tfExtend Ω g x := by + filter_upwards [(ae_restrict_iff' hΩ).mp (Lp.coeFn_add f g)] with x hx + by_cases h : x ∈ Ω + · simpa only [tfExtend, Set.indicator_of_mem h, Pi.add_apply] using hx h + · simp [tfExtend, h] +lemma tfExtend_smul_ae {Ω : Set Space} (hΩ : MeasurableSet Ω) + (c : ℝ) (f : TFLp (volume.restrict Ω)) : + tfExtend Ω (c • f) =ᵐ[volume] fun x => c * tfExtend Ω f x := by + filter_upwards [(ae_restrict_iff' hΩ).mp (Lp.coeFn_smul c f)] with x hx + by_cases h : x ∈ Ω + · simpa only [tfExtend, Set.indicator_of_mem h, Pi.smul_apply, smul_eq_mul] using hx h + · simp [tfExtend, h] +lemma tfCoulomb_symm {Ω : Set Space} (f g : TFLp (volume.restrict Ω)) : + tfCoulomb Ω f g = tfCoulomb Ω g f := by + unfold tfCoulomb + rw [Measure.volume_eq_prod] + rw [← integral_prod_swap (fun p : Space × Space => tfExtend Ω g p.1*tfExtend Ω f p.2*coulombKernel (p.1-p.2))] + apply integral_congr_ae + filter_upwards [] with p + simp only [Prod.swap, coulombKernel, norm_sub_rev] + ring +lemma tfCoulomb_add_left {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (f g h : TFLp (volume.restrict Ω)) : + tfCoulomb Ω (f+g) h = tfCoulomb Ω f h + tfCoulomb Ω g h := by + have H := (Measure.quasiMeasurePreserving_fst (μ := (volume : Measure Space)) (ν := (volume : Measure Space))).ae_eq_comp (tfExtend_add_ae hΩ f g) + change _ =ᵐ[(volume : Measure Space).prod volume] _ at H + unfold tfCoulomb + rw [← integral_add (tfCoulomb_integrable hΩ f h) (tfCoulomb_integrable hΩ g h)] + apply integral_congr_ae + filter_upwards [H] with p hp + dsimp only [Function.comp_def] at hp + rw [hp] + ring +lemma tfCoulomb_smul_left {Ω : Set Space} (hΩ : MeasurableSet Ω) + (c : ℝ) (f g : TFLp (volume.restrict Ω)) : + tfCoulomb Ω (c • f) g = c * tfCoulomb Ω f g := by + have H := (Measure.quasiMeasurePreserving_fst (μ := (volume : Measure Space)) (ν := (volume : Measure Space))).ae_eq_comp (tfExtend_smul_ae hΩ c f) + change _ =ᵐ[(volume : Measure Space).prod volume] _ at H + unfold tfCoulomb + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [H] with p hp + dsimp only [Function.comp_def] at hp + rw [hp] + ring +lemma tfCoulomb_bound {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (f g : TFLp (volume.restrict Ω)) : + ‖tfCoulomb Ω f g‖ ≤ + ((volume.real Ω)^(2/5:ℝ)*((8*Real.pi)^(2/5:ℝ)+(volume.real Ω)^(2/5:ℝ)))*‖f‖*‖g‖ := by + let A := ((8*Real.pi)^(2/5:ℝ)+(volume.real Ω)^(2/5:ℝ))*‖g‖ + have hA : 0 ≤ A := by dsimp [A]; positivity + have hi := (tfCoulomb_integrable hΩ f g).norm + have hiter : (∫ p : Space × Space, ‖tfExtend Ω f p.1*tfExtend Ω g p.2*coulombKernel (p.1-p.2)‖) = + ∫ x, ‖tfExtend Ω f x‖*(∫ y, coulombKernel (x-y)*‖tfExtend Ω g y‖) := by + rw [Measure.volume_eq_prod, integral_prod _ hi] + congr 1; funext x + simp_rw [norm_mul, Real.norm_of_nonneg (coulombKernel_nonneg _)] + simp_rw [mul_assoc, mul_comm ‖tfExtend Ω g _‖ (coulombKernel _)] + rw [integral_const_mul] + calc + _ ≤ ∫ p : Space × Space, ‖tfExtend Ω f p.1*tfExtend Ω g p.2*coulombKernel (p.1-p.2)‖ := + norm_integral_le_integral_norm _ + _ = _ := hiter + _ ≤ ∫ x, ‖tfExtend Ω f x‖*A := by + apply integral_mono + · convert hi.integral_prod_left using 1 + funext x + simp_rw [norm_mul, Real.norm_of_nonneg (coulombKernel_nonneg _)] + simp_rw [mul_assoc, mul_comm ‖tfExtend Ω g _‖ (coulombKernel _)] + rw [integral_const_mul] + · exact (tfExtend_integrable hΩ f).norm.mul_const A + · intro x + exact mul_le_mul_of_nonneg_left (tfExtend_convolution_bound hΩ g x) (norm_nonneg _) + _ = (∫ x in Ω, ‖f x‖)*A := by rw [integral_mul_const, tfExtend_norm_integral hΩ] + _ ≤ ((volume.real Ω)^(2/5:ℝ)*‖f‖)*A := by + apply mul_le_mul_of_nonneg_right _ hA + simpa only [Measure.real, Measure.restrict_apply_univ] using tfLp_integral_norm_le f + _ = _ := by dsimp [A]; ring +noncomputable def tfCoulombLinear {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] : + TFLp (volume.restrict Ω) →ₗ[ℝ] TFLp (volume.restrict Ω) →ₗ[ℝ] ℝ := + LinearMap.mk₂ ℝ (tfCoulomb Ω) (tfCoulomb_add_left hΩ) + (fun c f g => tfCoulomb_smul_left hΩ c f g) + (fun f g h => by rw [tfCoulomb_symm, tfCoulomb_add_left hΩ, tfCoulomb_symm g, tfCoulomb_symm h]) + (fun c f g => by rw [tfCoulomb_symm, tfCoulomb_smul_left hΩ, tfCoulomb_symm g]; rfl) +noncomputable def tfCoulombContinuous {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] : + TFLp (volume.restrict Ω) →L[ℝ] TFLp (volume.restrict Ω) →L[ℝ] ℝ := + (tfCoulombLinear hΩ).mkContinuous₂ + ((volume.real Ω)^(2/5:ℝ)*((8*Real.pi)^(2/5:ℝ)+(volume.real Ω)^(2/5:ℝ))) + (tfCoulomb_bound hΩ) +lemma tfCoulomb_continuous {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] : + Continuous (fun p : TFLp (volume.restrict Ω) × TFLp (volume.restrict Ω) => tfCoulomb Ω p.1 p.2) := + (tfCoulombContinuous hΩ).continuous₂ +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFOscillation.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..41529393b38cf960947bd0022c5f74c09abd2d45 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFOscillation.lean @@ -0,0 +1,177 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Packets.ScreenBox +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchGeometry +import OAI.Analysis.CoulombRadii.FieldAnalysis.ScaledOscillation + +namespace OAI + +noncomputable section + +section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Classical BigOperators Topology ContDiff +namespace Coulomb + +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] + +include hΩ + +omit [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfPotential_eq_density {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + tfPotential f=NeutralAtom.potentialOf (tfDensity Ω f) := by + funext x + apply integral_congr_ae + filter_upwards [tfDensity_ae_tfExtend hΩ hf] with z hz + change coulombKernel (x-z)*tfExtend Ω f z=coulombKernel (x-z)*tfDensity Ω f z + rw [hz] + +lemma tfPotential_ballCloud_integrable {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + {a : ℝ} (ha : 0 < a) (y : Space) : + Integrable (fun z => tfPotential f z*ballCloud y a 1 z) := by + rw [tfPotential_eq_density hΩ hf] + exact potentialOf_ballCloud_integrable ((tfExtend_integrable hΩ f).congr + (tfDensity_ae_tfExtend hΩ hf).symm) (tfDensity_measurable hΩ f) ha y + +lemma tfPotential_ballCloud_le {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + {a : ℝ} (ha : 0 < a) (y : Space) : + (∫ z, tfPotential f z*ballCloud y a 1 z) ≤ tfPotential f y := by + rw [tfPotential_eq_density hΩ hf] + have hi := (tfExtend_integrable hΩ f).congr (tfDensity_ae_tfExtend hΩ hf).symm + exact potentialOf_ballCloud_le hi (tfDensity_measurable hΩ f) (tfDensity_nonneg f) ha y + (density_coulomb_integrable _ (tfDensity_nonneg f) (tfDensity_measurable hΩ f) hi + (tfDensity_power_integrable hΩ hf) y) + +lemma tfScreened_ballCloud_submean {Φ : Space → ℝ} {f : TFLp (volume.restrict Ω)} + (hf : TFNonneg f) {a : ℝ} (ha : 0 < a) (y : Space) + (hi : Integrable (fun z => Φ z*ballCloud y a 1 z)) + (he : (∫ z, Φ z*ballCloud y a 1 z)=Φ y) : + Φ y-tfPotential f y ≤ ∫ z, (Φ z-tfPotential f z)*ballCloud y a 1 z := by + simp_rw [sub_mul] + rw [integral_sub hi (tfPotential_ballCloud_integrable hΩ hf ha y),he] + linarith [tfPotential_ballCloud_le hΩ hf ha y] + +omit hΩ [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfEulerDensity_of_cap {c a v : ℝ} (hc : 0 < c) (ha : 0 < a) + (hv : v ≤ tfInteriorConstant c/a^4) : + (max v 0/(c*(5/3:ℝ)))^(3/2:ℝ) ≤ + (tfInteriorConstant c/(c*(5/3:ℝ)))^(3/2:ℝ)/a^6 := by + have Hb : max v 0 ≤ tfInteriorConstant c/a^4 := + max_le hv (div_nonneg (tfInteriorConstant_nonneg c) (by positivity)) + have HH := Real.rpow_le_rpow (by positivity : 0 ≤ max v 0/(c*(5/3:ℝ))) + (div_le_div_of_nonneg_right Hb (by positivity : 0 ≤ c*(5/3:ℝ))) (by norm_num : (0:ℝ) ≤ 3/2) + apply HH.trans_eq + rw [show tfInteriorConstant c/a^4/(c*(5/3:ℝ))=(tfInteriorConstant c/(c*(5/3:ℝ)))/a^4 by ring, + Real.div_rpow (div_nonneg (tfInteriorConstant_nonneg c) (by positivity)) (by positivity), + ←Real.rpow_natCast,←Real.rpow_mul ha.le] + norm_num + +omit hΩ [IsFiniteMeasure (volume.restrict Ω)] in + +theorem tfScreened_interior_oscillation (c : ℝ) (hc : 0 < c) : + ∃ C : ℝ, 0 < C ∧ ∀ {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)], ∀ {F : ℝ}, 0 ≤ F → + ∀ (W : TFLq (volume.restrict Ω)), (∀ᵐ x ∂volume.restrict Ω, W x ≤ F) → + ∀ (f : TFLp (volume.restrict Ω)), TFNonneg f → + (∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g) → + ∀ (Φ : Space → ℝ), ContinuousOn Φ Ω → IsOpen Ω → + W =ᵐ[volume.restrict Ω] Φ → NeutralAtom.HasWeakLaplacian Φ Ω (fun _ => 0) → + ∀ (y : Space) (a : ℝ), 0 < a → Metric.closedBall y (4*a)⊆Ω → + Integrable (fun z => Φ z*ballCloud y (2*a) 1 z) → + (∫ z, Φ z*ballCloud y (2*a) 1 z)=Φ y → + ∀ z∈Metric.closedBall y a, + ‖(Φ z-tfPotential f z)-(Φ y-tfPotential f y)‖ ≤ + C*(‖z-y‖/a)*((a^4)⁻¹+max (-(Φ y-tfPotential f y)) 0) := by + let A := (tfInteriorConstant c/(c*(5/3:ℝ)))^(3/2:ℝ) + obtain ⟨C,hC,H⟩ := NeutralAtom.poisson_scaled_negative_oscillation + (show 0 ≤ A from Real.rpow_nonneg (div_nonneg (tfInteriorConstant_nonneg c) (by positivity)) _) (tfInteriorConstant_nonneg c) + refine ⟨C,hC,?_⟩ + intro Ω hΩ inst F hF W hW f hf hm Φ hΦ ho he hh y a ha hball hi hmean z hz + let V := fun x => Φ x-tfPotential f x + let σ := (Metric.closedBall y (3*a)).indicator (fun x => (max (V x) 0/(c*(5/3:ℝ)))^(3/2:ℝ)) + have h3 : Metric.closedBall y (3*a)⊆Ω := + (Metric.closedBall_subset_closedBall (by linarith)).trans hball + have h2 : Metric.ball y (2*a)⊆Ω := + (Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith))).trans hball + have hP := tfPotential_continuous_of_minimizes hΩ hc hF W hW hf hm + have hVc : ContinuousOn V Ω := hΦ.sub hP.continuousOn + have hσc : ContinuousOn (fun x => (max (V x) 0/(c*(5/3:ℝ)))^(3/2:ℝ)) (Metric.closedBall y (3*a)) := by + exact (((hVc.mono h3).sup continuousOn_const).div_const _).rpow_const (fun _ _ => Or.inr (by norm_num)) + have hσi : Integrable σ := (hσc.integrableOn_compact (isCompact_closedBall _ _)).integrable_indicator measurableSet_closedBall + have hσ0 (x) : 0 ≤ σ x := indicator_nonneg (fun x _ => Real.rpow_nonneg (by positivity) _) x + have hσb (x) (hx : x∈Metric.closedBall y (3*a)) : σ x ≤ A/a^6 := by + rw [show σ x=(max (V x) 0/(c*(5/3:ℝ)))^(3/2:ℝ) from indicator_of_mem hx _] + exact tfEulerDensity_of_cap hc ha (tfScreened_three_quarters hΩ hc hF W hW hf hm hΦ ho he hh ha hball hx) + have hVL : NeutralAtom.HasWeakLaplacian V (Metric.ball y (2*a)) (fun x => 4*Real.pi*σ x) := by + intro φ hφ hφc ht + have h := (tfScreened_weak_equation hΩ hc hF W hW hf hm hΦ ho he hh).mono h2 + rw [h φ hφ hφc ht] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x∈Metric.ball y (2*a) + · have hx3 : x∈Metric.closedBall y (3*a) := + (Metric.ball_subset_closedBall.trans (Metric.closedBall_subset_closedBall (by linarith))) hx + dsimp only [σ] + rw [indicator_of_mem hx3,Real.div_rpow (le_max_right _ _) (by positivity)] + dsimp only [V] + ring + · have hp0 : φ x=0 := image_eq_zero_of_notMem_tsupport (fun h => hx (ht h)) + simp only [hp0,mul_zero] + apply H V σ y a ha (hVc.mono (Metric.ball_subset_closedBall.trans h3)) hVL hσi hσ0 hσb + (fun x hx => tfScreened_three_quarters hΩ hc hF W hW hf hm hΦ ho he hh ha hball + (Metric.closedBall_subset_closedBall (by linarith) hx)) + (tfScreened_ballCloud_submean hΩ hf (by positivity) y hi hmean) z hz + +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology ContDiff +namespace Coulomb + +def patchTFScreenedField {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t : ℝ} (ha : 0 < a) (hb : 0 < b) (ht : t ≤ 6*a) (y : Space) + (hn : ∀ j, 20*a ≤ ‖S.position j-y‖) (z : Space) : ℝ := + coreScreenedField S u z-tfPotential (localTFMinimizer measurableSet_ball + (coreTFField S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht y hn))) z + +theorem exists_patch_TF_oscillation : + ∃ C : ℝ, 0 < C ∧ ∀ {J k : ℕ} (S : Nuclei J) (u : H1Vector k) + {a b t : ℝ} (ha : 0 < a) (hb : 0 < b) (_ : 18*b ≤ a) + (ht : t∈Set.Icc (5*a) (6*a)) (y : Space), + SpatiallySupported u {z | t ≤ ‖z-y‖} → + ∀ (hn : ∀ j, 20*a ≤ ‖S.position j-y‖) (z : Space), z∈Metric.closedBall y a → + ‖patchTFScreenedField S u ha hb ht.2 y hn z- + patchTFScreenedField S u ha hb ht.2 y hn y‖ ≤ + C*(‖z-y‖/a)*((a^4)⁻¹+max (-patchTFScreenedField S u ha hb ht.2 y hn y) 0) := by + obtain ⟨C,hC,H⟩ := tfScreened_interior_oscillation thomasFermiKineticConstant thomasFermiKineticConstant_pos + refine ⟨C,hC,?_⟩ + intro J k S u a b t ha hb hsmall ht y hu hn z hz + let W := coreTFField S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht.2 y hn) + have hW : ∀ᵐ x ∂volume.restrict (Metric.ball y (t-4*b)), W x ≤ totalCharge S/a := by + filter_upwards [coreTFField_coe S u measurableSet_ball ha + (patch_nucleus_separation S ha hb ht.2 y hn),ae_restrict_mem measurableSet_ball] with x hx hy + rw [hx] + apply (sub_le_self _ (coreCoulombPotential_nonneg u x)).trans + exact attraction_le_totalCharge_div S ha x (fun j => patch_nucleus_separation S ha hb ht.2 y hn j x hy) + have hi : Integrable (fun z => coreScreenedField S u z*ballCloud y (2*a) 1 z) := by + apply ((attraction_ballCloud_integrable S (by positivity : 0 < 2*a) y).sub + (coreCoulombPotential_mul_integrable u _ (ballCloud_integrable (2*a) 1 y))).congr + filter_upwards [] with z + change attraction S z*ballCloud y (2*a) 1 z-coreCoulombPotential u z*ballCloud y (2*a) 1 z = _ + rw [coreScreenedField,sub_mul] + have hm : (∫ z, coreScreenedField S u z*ballCloud y (2*a) 1 z)=coreScreenedField S u y := by + simpa only [one_mul] using coreScreenedField_ballCloud S u hu (by positivity : 0 < 2*a) zero_le_one y + (fun z hz => by change t ≤ ‖z-y‖ at hz; linarith [ht.1]) + (fun j => by linarith [hn j]) + exact H measurableSet_ball (div_nonneg (totalCharge_nonneg S) ha.le) W hW + (localTFMinimizer measurableSet_ball W) (localTFMinimizer_nonneg measurableSet_ball W) + (fun g hg => localTFMinimizer_minimizes measurableSet_ball W hg) + (coreScreenedField S u) (patch_continuous_field S u ha hb ht.2 y hu hn) Metric.isOpen_ball + (coreTFField_coe S u measurableSet_ball ha (patch_nucleus_separation S ha hb ht.2 y hn)) + (patch_harmonic_field S u ha hb ht.2 y hu hn) y a ha (patch_inner_ball ha hb hsmall ht.1 y) hi hm z hz + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFPotentialParameter.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFPotentialParameter.lean new file mode 100644 index 0000000000000000000000000000000000000000..44ea2aa252826701e9d9635e4c6434c8adc2a55d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFPotentialParameter.lean @@ -0,0 +1,72 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TfExtendNonneg + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +noncomputable section +namespace Coulomb +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) +include hΩ + +lemma tfPotential_eq_restrict [IsFiniteMeasure (volume.restrict Ω)] + (f : TFLp (volume.restrict Ω)) (y : Space) : + tfPotential f y=∫ z in Ω, coulombKernel (y-z)*f z := by + rw [←integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with z + by_cases hz : z∈Ω <;> simp [tfExtend,hz] + +variable [IsFiniteMeasure (volume.restrict Ω)] + +lemma tfPotential_add (f g : TFLp (volume.restrict Ω)) (y : Space) : + tfPotential (f+g) y=tfPotential f y+tfPotential g y := by + have he : tfPotential (f+g) y=∫ z, coulombKernel (y-z)*tfExtend Ω f z+ + coulombKernel (y-z)*tfExtend Ω g z := by + rw [tfPotential_eq_restrict hΩ,←integral_indicator hΩ] + apply integral_congr_ae + have H := ae_restrict_iff' hΩ |>.mp (Lp.coeFn_add f g) + filter_upwards [H] with z hz + by_cases hzi : z∈Ω + · simp only [Set.indicator_of_mem hzi,tfExtend,hz hzi,Pi.add_apply,mul_add] + · simp [hzi,tfExtend] + rw [he,integral_add (tfPotential_integrand hΩ f y) (tfPotential_integrand hΩ g y)] + rfl + +lemma tfPotential_smul (c : ℝ) (f : TFLp (volume.restrict Ω)) (y : Space) : + tfPotential (c • f) y=c*tfPotential f y := by + rw [tfPotential_eq_restrict hΩ,tfPotential_eq_restrict hΩ,←integral_const_mul] + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul c f] with z hz + rw [hz] + simp only [Pi.smul_apply,smul_eq_mul] + ring + +def tfPotentialEvaluation (y : Space) : TFLp (volume.restrict Ω) →L[ℝ] ℝ := + LinearMap.mkContinuous + { toFun := fun f => tfPotential f y + map_add' := fun f g => tfPotential_add hΩ f g y + map_smul' := fun c f => tfPotential_smul hΩ c f y } + ((8*Real.pi)^(2/5:ℝ)+(volume.real Ω)^(2/5:ℝ)) + (fun f => tfPotential_bound hΩ f y) + +lemma continuous_tfPotential_evaluation (y : Space) : + Continuous (fun f : TFLp (volume.restrict Ω) => tfPotential f y) := + (tfPotentialEvaluation hΩ y).continuous + +lemma aestronglyMeasurable_localTFPotential {A : Type*} [MeasurableSpace A] {μ : Measure A} + (W : A → TFLq (volume.restrict Ω)) (hW : AEStronglyMeasurable W μ) (y : Space) : + AEStronglyMeasurable (fun x => tfPotential (localTFMinimizer hΩ (W x)) y) μ := + (continuous_tfPotential_evaluation hΩ y).comp_aestronglyMeasurable + ((continuous_localTFMinimizer hΩ).comp_aestronglyMeasurable hW) + +end Coulomb +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFResponseMargins.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFResponseMargins.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6009f8c674c092314a7c23231f1ff456cf27ced --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TFResponseMargins.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.PatchResponse + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace Coulomb + +lemma tfScalarDensity_continuous : Continuous tfScalarDensity := by + unfold tfScalarDensity + exact (Real.continuous_rpow_const (by norm_num : (0:ℝ)≤3/2)).comp + ((continuous_id.max continuous_const).div_const _) + +lemma tfScalarDensity_strict {v w : ℝ} (hv : 0≤v) (hvw : v tfScalarDensity h-tfScalarDensity (h-η/2)) := + tfScalarDensity_continuous.sub (tfScalarDensity_continuous.comp (continuous_id.sub continuous_const)) + have hcontU : Continuous (fun h => tfScalarDensity (h+η/2)-tfScalarDensity h) := + (tfScalarDensity_continuous.comp (continuous_id.add continuous_const)).sub tfScalarDensity_continuous + obtain ⟨minPoint,hminPoint,Hd₁⟩ := isCompact_Icc.exists_isMinOn + (nonempty_Icc.mpr hlh) hcontL.continuousOn + let d₁ := tfScalarDensity minPoint-tfScalarDensity (minPoint-η/2) + have hd₁ : 0 sub_pos.mpr (tfScalarDensity_strict (by linarith [hh'.1]) (by linarith))) + let A := tfScalarDensity (hh+η) + have hA : 0≤A := tfScalarDensity_nonneg _ + let ε := min 1 (min (η/2) (min (d₁/(2*(A+1))) (d₂/(2*(A+1))))) + have hε : 0<ε := by dsimp [ε]; positivity + refine ⟨ε,hε,min_le_left _ _,?_⟩ + intro h θ δ e hh' hθ hθε hδ hδε he heε + have hεη : ε≤η/2 := (min_le_right _ _).trans (min_le_left _ _) + have hεd₁ : ε≤d₁/(2*(A+1)) := + (min_le_right _ _).trans ((min_le_right _ _).trans (min_le_left _ _)) + have hεd₂ : ε≤d₂/(2*(A+1)) := + (min_le_right _ _).trans ((min_le_right _ _).trans (min_le_right _ _)) + have hd₁' := (le_div_iff₀ (show 0<2*(A+1) by positivity)).mp hεd₁ + have hd₂' := (le_div_iff₀ (show 0<2*(A+1) by positivity)).mp hεd₂ + have hb₁ : tfScalarDensity (h-η+θ)≤tfScalarDensity (h-η/2) := tfScalarDensity_mono (by linarith) + have hb₂ : tfScalarDensity (h+η/2)≤tfScalarDensity (h+η-θ) := tfScalarDensity_mono (by linarith) + have hc₁ : tfScalarDensity (h-η+θ)≤A := tfScalarDensity_mono (by linarith [hh'.2]) + have hc₂ : tfScalarDensity (h+η-θ)≤A := tfScalarDensity_mono (by linarith [hh'.2]) + have herr₁ := mul_le_mul hc₁ hδε hδ hA + have herr₂ := mul_le_mul hc₂ hδε hδ hA + have hg₁ : d₁≤tfScalarDensity h-tfScalarDensity (h-η/2) := Hd₁ hh' + have hg₂ := Hd₂ h hh' + constructor <;> nlinarith +end Coulomb +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfExtendNonneg.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfExtendNonneg.lean new file mode 100644 index 0000000000000000000000000000000000000000..5cd0dd4750ff2263693fc8636ffd09f2d890f5cd --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfExtendNonneg.lean @@ -0,0 +1,380 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.RawThomasFermiEnergy +import OAI.Analysis.CoulombRadii.ThomasFermi.TfFunctionalUniformBound + +namespace OAI + +noncomputable section + +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] +include hΩ +omit [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfExtend_nonneg {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + ∀ᵐ x, 0 ≤ tfExtend Ω f x := by + filter_upwards [(ae_restrict_iff' hΩ).mp hf] with x hx + by_cases hs : x ∈ Ω + · simpa only [tfExtend,Set.indicator_of_mem hs] using hx hs + · simp [tfExtend,hs] +omit [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfPotential_nonneg {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (x : Space) : + 0 ≤ tfPotential f x := by + apply integral_nonneg_of_ae + filter_upwards [tfExtend_nonneg hΩ hf] with y hy + exact mul_nonneg (coulombKernel_nonneg _) hy +omit [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfPotential_restrict (f : TFLp (volume.restrict Ω)) (x : Space) : + tfPotential f x = ∫ y in Ω, coulombKernel (x-y)*f y := by + unfold tfPotential tfExtend + rw [←integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with y + by_cases hy : y ∈ Ω <;> simp [hy] +lemma tfPotential_restrict_integrable (f : TFLp (volume.restrict Ω)) (x : Space) : + Integrable (fun y => coulombKernel (x-y)*f y) (volume.restrict Ω) := by + apply (integrable_indicator_iff hΩ).mp + apply (tfPotential_integrand hΩ f x).congr + filter_upwards [] with y + by_cases hy : y ∈ Ω <;> simp [tfExtend,hy] +lemma tfPotential_mass_lower {D : ℝ} (_hD : 0 < D) + (hd : ∀ x ∈ Ω, ∀ y ∈ Ω, ‖x-y‖ ≤ D) {f : TFLp (volume.restrict Ω)} + (hf : TFNonneg f) {x : Space} (hx : x ∈ Ω) : + (∫ y in Ω,f y)/D ≤ tfPotential f x := by + rw [tfPotential_restrict hΩ,←integral_div] + apply integral_mono_ae ((Lp.memLp f).integrable (by norm_num [TFExponent]) |>.div_const D) + (tfPotential_restrict_integrable hΩ f x) + filter_upwards [hf,ae_restrict_mem hΩ,(volume.restrict Ω).ae_ne x] with y hy hs hn + have hk : 1/D ≤ coulombKernel (x-y) := by + rw [coulombKernel,←one_div] + apply one_div_le_one_div_of_le + · exact norm_pos_iff.mpr (sub_ne_zero.mpr (Ne.symm hn)) + · exact hd x hx y hs + simpa only [div_eq_mul_inv,one_mul,mul_comm (D⁻¹) (f y)] using mul_le_mul_of_nonneg_right hk hy +omit hΩ [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfMass_nonneg {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + 0 ≤ ∫ x in Ω,f x := integral_nonneg_of_ae hf +lemma tfCoulomb_mass_lower {D : ℝ} (hD : 0 < D) + (hd : ∀ x ∈ Ω, ∀ y ∈ Ω, ‖x-y‖ ≤ D) {f : TFLp (volume.restrict Ω)} + (hf : TFNonneg f) : + (∫ x in Ω,f x)^2/D ≤ tfCoulomb Ω f f := by + rw [tfCoulomb_eq_potential hΩ] + have hi : Integrable (fun x => f x*tfPotential f x) (volume.restrict Ω) := by + apply (tfFieldPairing_integrable (tfPotentialField hΩ f) f).congr + filter_upwards [tfPotentialField_coe hΩ f] with x hx + rw [hx,mul_comm] + calc + _ = ∫ x in Ω,f x*((∫ y in Ω,f y)/D) := by rw [integral_mul_const]; ring + _ ≤ _ := integral_mono_ae ((Lp.memLp f).integrable (by norm_num [TFExponent]) |>.mul_const _) hi + (by + filter_upwards [hf,ae_restrict_mem hΩ] with x hx hs + exact mul_le_mul_of_nonneg_left (tfPotential_mass_lower hΩ hD hd hf hs) hx) +lemma tfEnergy_mass_lower {D c F : ℝ} (hD : 0 < D) + (hd : ∀ x ∈ Ω, ∀ y ∈ Ω, ‖x-y‖ ≤ D) (W : TFLq (volume.restrict Ω)) + (hF : ∀ᵐ x ∂volume.restrict Ω,W x ≤ F) {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + c*‖f‖^(5/3:ℝ)+(∫ x in Ω,f x)^2/(2*D)-F*(∫ x in Ω,f x) ≤ tfEnergy hΩ c W f := by + have Hf : tfFieldContinuous W f ≤ F*(∫ x in Ω,f x) := by + rw [tfFieldContinuous_apply,←integral_const_mul] + apply integral_mono_ae (tfFieldPairing_integrable W f) + ((Lp.memLp f).integrable (by norm_num [TFExponent]) |>.const_mul F) + filter_upwards [hf,hF] with x hx hy + exact mul_le_mul_of_nonneg_right hy hx + have HB := tfCoulomb_mass_lower hΩ hD hd hf + change _ ≤ c*‖f‖^(5/3:ℝ)-tfFieldContinuous W f+tfCoulomb Ω f f/2 + have he : (∫ x in Ω,f x)^2/(2*D) = ((∫ x in Ω,f x)^2/D)/2 := by ring + rw [he] + linarith +lemma tfEnergy_sublevel_mass_bound {D c F : ℝ} (hD : 0 < D) (hc : 0 < c) (hF0 : 0 ≤ F) + (hd : ∀ x ∈ Ω, ∀ y ∈ Ω, ‖x-y‖ ≤ D) (W : TFLq (volume.restrict Ω)) + (hF : ∀ᵐ x ∂volume.restrict Ω,W x ≤ F) {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (he : tfEnergy hΩ c W f ≤ 0) : + (∫ x in Ω,f x) ≤ 2*D*F ∧ ‖f‖^(5/3:ℝ) ≤ D*F^2/(2*c) := by + have H := tfEnergy_mass_lower hΩ (c := c) hD hd W hF hf + have hm := tfMass_nonneg hf + have hk := Real.rpow_nonneg (norm_nonneg f) (5/3:ℝ) + have H1 : c*‖f‖^(5/3:ℝ)+(∫ x in Ω,f x)^2/(2*D)-F*(∫ x in Ω,f x) ≤ 0 := H.trans he + have H2 : 2*D*c*‖f‖^(5/3:ℝ)+(∫ x in Ω,f x)^2-2*D*F*(∫ x in Ω,f x) ≤ 0 := by + have H3 := mul_nonpos_of_nonneg_of_nonpos (show 0 ≤ 2*D by positivity) H1 + field_simp at H3 + nlinarith + refine ⟨?_,?_⟩ + · have Hkin : 0 ≤ 2*D*c*‖f‖^(5/3:ℝ) := by positivity + by_contra! hn + have hmpos : 0 < ∫ x in Ω,f x := (show 0 ≤ 2*D*F by positivity).trans_lt hn + have Hp := mul_pos hmpos (sub_pos.mpr hn) + nlinarith + · apply (le_div_iff₀ (show 0<2*c by positivity)).mpr + have Hsq := sq_nonneg ((∫ x in Ω,f x)-D*F) + nlinarith +end Coulomb + +end +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical BigOperators Topology SchwartzMap Pointwise +namespace Coulomb + +lemma coulombBilinear_congr_ae {f f' g g' : Space → ℝ} + (hf : f =ᵐ[volume] f') (hg : g =ᵐ[volume] g') : + coulombBilinear f g = coulombBilinear f' g' := by + have h1 := (Measure.quasiMeasurePreserving_fst (μ := (volume : Measure Space)) (ν := (volume : Measure Space))).ae_eq_comp hf + have h2 := (Measure.quasiMeasurePreserving_snd (μ := (volume : Measure Space)) (ν := (volume : Measure Space))).ae_eq_comp hg + unfold coulombBilinear + rw [Measure.volume_eq_prod] + apply integral_congr_ae + filter_upwards [h1,h2] with xy hx hy + simp only [Function.comp_def] at hx hy + rw [hx,hy] + +lemma rawThomasFermiEnergy_congr_ae (Φ : Space → ℝ) {f g : Space → ℝ} + (h : f =ᵐ[volume] g) : rawThomasFermiEnergy Φ f = rawThomasFermiEnergy Φ g := by + have h1 : (∫ x, f x^(5/3:ℝ)) = ∫ x, g x^(5/3:ℝ) := + integral_congr_ae (h.mono fun _ hx => congrArg (·^(5/3:ℝ)) hx) + have h2 : (∫ x, Φ x*f x) = ∫ x, Φ x*g x := + integral_congr_ae (h.mono fun x hx => congrArg (Φ x*·) hx) + simp only [rawThomasFermiEnergy, h1, h2, coulombBilinear_congr_ae h h] + +lemma rawThomasFermiEnergy_tfExtend {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + rawThomasFermiEnergy Φ (tfExtend Ω f) = tfEnergy hΩ thomasFermiKineticConstant W f := by + have hk : (∫ x, (tfExtend Ω f x)^(5/3:ℝ)) = ∫ x in Ω, (f x)^(5/3:ℝ) := by + rw [← integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ Ω <;> simp [tfExtend,hx] + have hw : (∫ x, Φ x*tfExtend Ω f x) = ∫ x in Ω, W x*f x := by + calc + _ = ∫ x in Ω, Φ x*f x := by + rw [← integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ Ω <;> simp [tfExtend,hx] + _ = _ := integral_congr_ae (hW.mono fun x hx => by rw [hx]) + rw [rawThomasFermiEnergy, hk, hw, tfEnergy_formula hΩ _ _ hf] + rfl + +def tfDensity (Ω : Set Space) (f : TFLp (volume.restrict Ω)) (x : Space) : ℝ := + max (tfExtend Ω f x) 0 + +lemma tfDensity_nonneg {Ω : Set Space} (f : TFLp (volume.restrict Ω)) (x : Space) : + 0 ≤ tfDensity Ω f x := le_max_right _ _ +lemma tfDensity_measurable {Ω : Set Space} (hΩ : MeasurableSet Ω) (f : TFLp (volume.restrict Ω)) : + Measurable (tfDensity Ω f) := (tfExtend_measurable hΩ f).max measurable_const +lemma tfDensity_eq_zero {Ω : Set Space} (f : TFLp (volume.restrict Ω)) {x : Space} (hx : x ∉ Ω) : + tfDensity Ω f x = 0 := by simp [tfDensity,tfExtend,hx] +lemma tfDensity_ae_tfExtend {Ω : Set Space} (hΩ : MeasurableSet Ω) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + tfDensity Ω f =ᵐ[volume] tfExtend Ω f := + (tfExtend_nonneg hΩ hf).mono fun _ hx => max_eq_left hx +lemma tfDensity_memLp {Ω : Set Space} (hΩ : MeasurableSet Ω) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + MemLp (tfDensity Ω f) TFExponent volume := + (memLp_congr_ae (tfDensity_ae_tfExtend hΩ hf)).mpr (tfExtend_memLp hΩ f) +lemma tfDensity_power_integrable {Ω : Set Space} (hΩ : MeasurableSet Ω) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + Integrable (fun x => (tfDensity Ω f x)^(5/3:ℝ)) := + integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) + (tfDensity_memLp hΩ hf) (Eventually.of_forall (tfDensity_nonneg f)) +lemma rawThomasFermiEnergy_tfDensity {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + rawThomasFermiEnergy Φ (tfDensity Ω f) = tfEnergy hΩ thomasFermiKineticConstant W f := by + rw [rawThomasFermiEnergy_congr_ae Φ (tfDensity_ae_tfExtend hΩ hf)] + exact rawThomasFermiEnergy_tfExtend hΩ Φ W hW hf + +lemma thomasFermiKineticConstant_pos : 0 < thomasFermiKineticConstant := by + unfold thomasFermiKineticConstant + positivity + +def localTFMinimizer {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (W : TFLq (volume.restrict Ω)) : TFLp (volume.restrict Ω) := + tfMinimizer hΩ thomasFermiKineticConstant_pos W +lemma localTFMinimizer_nonneg {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (W : TFLq (volume.restrict Ω)) : + TFNonneg (localTFMinimizer hΩ W) := + tfMinimizer_nonneg hΩ thomasFermiKineticConstant_pos W +lemma localTFMinimizer_minimizes {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + tfEnergy hΩ thomasFermiKineticConstant W (localTFMinimizer hΩ W) ≤ + tfEnergy hΩ thomasFermiKineticConstant W f := + tfMinimizer_min hΩ thomasFermiKineticConstant_pos W f hf + +lemma continuous_localTFMinimizer {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] : Continuous (localTFMinimizer hΩ) := + tfMinimizer_continuous hΩ thomasFermiKineticConstant_pos + +def localTFDensity {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (W : TFLq (volume.restrict Ω)) : Space → ℝ := + tfDensity Ω (localTFMinimizer hΩ W) + +lemma localTFDensity_hole {M k : ℕ} {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (W : TFLq (volume.restrict Ω)) + (S : Nuclei M) (u : H1Vector k) (g : 𝓢(Space,ℝ)) (R : ℝ) + (K A : Set Space) (hK : IsCompact K) (hA : IsClosed A) (hΩK : Ω ⊆ K) + (hu : SpatiallySupported u A) (hsep : Disjoint A (K+tsupport (g : Space → ℝ))) + (hcore : ∀ a ∈ A, ∀ y ∈ Ω, R ≤ ‖a-y‖) + (hnuc : ∀ j y, y ∈ Ω → R ≤ ‖S.position j-y‖) : + SourceFreeHoleDensity S u g R (localTFDensity hΩ W) K A := by + have hs (y : Space) (hy : localTFDensity hΩ W y ≠ 0) : y ∈ Ω := by + by_contra hn + exact hy (tfDensity_eq_zero _ hn) + refine ⟨tfDensity_nonneg _,tfDensity_measurable hΩ _, + tfDensity_power_integrable hΩ (localTFMinimizer_nonneg hΩ W),hK,hA,?_,hu,hsep,?_,?_⟩ + · intro y hy + exact tfDensity_eq_zero _ (fun h => hy (hΩK h)) + · intro a ha y hy + exact hcore a ha y (hs y hy) + · intro j y hy + exact hnuc j y (hs y hy) + +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal Classical BigOperators Topology SchwartzMap Pointwise +namespace Coulomb + +def rawTFBregman (ρ σ : Space → ℝ) : ℝ := + thomasFermiKineticConstant*∫ x, σ x^(5/3:ℝ)-ρ x^(5/3:ℝ)- + (5/3:ℝ)*ρ x^(2/3:ℝ)*(σ x-ρ x) + +lemma tfExtend_sub_ae {Ω : Set Space} (hΩ : MeasurableSet Ω) + (f g : TFLp (volume.restrict Ω)) : + tfExtend Ω (g-f) =ᵐ[volume] fun x => tfExtend Ω g x-tfExtend Ω f x := by + filter_upwards [(ae_restrict_iff' hΩ).mp (Lp.coeFn_sub g f)] with x hx + by_cases h : x ∈ Ω + · simpa only [tfExtend,Set.indicator_of_mem h,Pi.sub_apply] using hx h + · simp [tfExtend,h] + +lemma coulombBilinear_tfDensity_sub {Ω : Set Space} (hΩ : MeasurableSet Ω) + {f g : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (hg : TFNonneg g) : + coulombBilinear (fun x => tfDensity Ω g x-tfDensity Ω f x) + (fun x => tfDensity Ω g x-tfDensity Ω f x) = tfCoulomb Ω (g-f) (g-f) := by + have h : (fun x => tfDensity Ω g x-tfDensity Ω f x) =ᵐ[volume] tfExtend Ω (g-f) := by + filter_upwards [tfDensity_ae_tfExtend hΩ hf,tfDensity_ae_tfExtend hΩ hg,tfExtend_sub_ae hΩ f g] + with x hx hy hz + rw [hx,hy,hz] + exact coulombBilinear_congr_ae h h + +lemma rawTFBregman_congr_ae {ρ σ ρ' σ' : Space → ℝ} + (hρ : ρ =ᵐ[volume] ρ') (hσ : σ =ᵐ[volume] σ') : + rawTFBregman ρ σ = rawTFBregman ρ' σ' := by + unfold rawTFBregman + congr 1 + apply integral_congr_ae + filter_upwards [hρ,hσ] with x hx hy + rw [hx,hy] + +lemma rawTFBregman_tfDensity {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] + {f g : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (hg : TFNonneg g) : + rawTFBregman (tfDensity Ω f) (tfDensity Ω g) = thomasFermiKineticConstant*tfBregman f g := by + rw [rawTFBregman_congr_ae (tfDensity_ae_tfExtend hΩ hf) (tfDensity_ae_tfExtend hΩ hg), + rawTFBregman, tfBregman_formula hf hg, ← integral_indicator hΩ] + congr 1 + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ Ω <;> simp [tfExtend,hx] + +lemma raw_localTF_gap {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + coulombBilinear (fun x => tfDensity Ω f x-localTFDensity hΩ W x) + (fun x => tfDensity Ω f x-localTFDensity hΩ W x)/2+ + rawTFBregman (localTFDensity hΩ W) (tfDensity Ω f) ≤ + rawThomasFermiEnergy Φ (tfDensity Ω f)-rawThomasFermiEnergy Φ (localTFDensity hΩ W) := by + unfold localTFDensity + rw [coulombBilinear_tfDensity_sub hΩ (localTFMinimizer_nonneg hΩ W) hf, + rawTFBregman_tfDensity hΩ (localTFMinimizer_nonneg hΩ W) hf, + rawThomasFermiEnergy_tfDensity hΩ Φ W hW hf, + rawThomasFermiEnergy_tfDensity hΩ Φ W hW (localTFMinimizer_nonneg hΩ W)] + exact tfEnergy_gap_controls hΩ _ W (localTFMinimizer_nonneg hΩ W) hf + (fun _ hf => localTFMinimizer_minimizes hΩ W hf) + +def rawToTFLp {Ω : Set Space} (σ : Space → ℝ) (hσ : MemLp σ TFExponent (volume.restrict Ω)) : + TFLp (volume.restrict Ω) := hσ.toLp σ + +lemma rawToTFLp_nonneg {Ω : Set Space} {σ : Space → ℝ} + (hσ : MemLp σ TFExponent (volume.restrict Ω)) (hp : ∀ᵐ x ∂volume.restrict Ω, 0 ≤ σ x) : + TFNonneg (rawToTFLp σ hσ) := by + filter_upwards [hσ.coeFn_toLp,hp] with x hx hy + exact hx.symm ▸ hy + +lemma tfDensity_rawToTFLp {Ω : Set Space} (hΩ : MeasurableSet Ω) {σ : Space → ℝ} + (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x ∂volume.restrict Ω, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x = 0) : + tfDensity Ω (rawToTFLp σ hσ) =ᵐ[volume] σ := by + refine (tfDensity_ae_tfExtend hΩ (rawToTFLp_nonneg hσ hp)).trans ?_ + filter_upwards [(ae_restrict_iff' hΩ).mp hσ.coeFn_toLp] with x hx + by_cases hy : x ∈ Ω + · simpa only [tfExtend,rawToTFLp,Set.indicator_of_mem hy] using hx hy + · simp [tfExtend,hy,hs x hy] + +lemma raw_localTF_gap_density {Ω : Set Space} (hΩ : MeasurableSet Ω) + [IsFiniteMeasure (volume.restrict Ω)] (Φ : Space → ℝ) + (W : TFLq (volume.restrict Ω)) (hW : W =ᵐ[volume.restrict Ω] Φ) + {σ : Space → ℝ} (hσ : MemLp σ TFExponent (volume.restrict Ω)) + (hp : ∀ᵐ x ∂volume.restrict Ω, 0 ≤ σ x) (hs : ∀ x ∉ Ω, σ x = 0) : + coulombBilinear (fun x => σ x-localTFDensity hΩ W x) + (fun x => σ x-localTFDensity hΩ W x)/2+ + rawTFBregman (localTFDensity hΩ W) σ ≤ + rawThomasFermiEnergy Φ σ-rawThomasFermiEnergy Φ (localTFDensity hΩ W) := by + have he := tfDensity_rawToTFLp hΩ hσ hp hs + have hd : (fun x => tfDensity Ω (rawToTFLp σ hσ) x-localTFDensity hΩ W x) =ᵐ[volume] + (fun x => σ x-localTFDensity hΩ W x) := he.sub EventuallyEq.rfl + have H := raw_localTF_gap hΩ Φ W hW (rawToTFLp_nonneg hσ hp) + rwa [coulombBilinear_congr_ae hd hd,rawTFBregman_congr_ae EventuallyEq.rfl he, + rawThomasFermiEnergy_congr_ae Φ he] at H + +end Coulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctional.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctional.lean new file mode 100644 index 0000000000000000000000000000000000000000..339fd841ab21cc65ba807b28374a7ea01b46a1e9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctional.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TFNonneg + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} +noncomputable def tfFunctional (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (f : TFLp μ) : ℝ := + c * ‖f‖^(5/3:ℝ) - L f + B f f / 2 +lemma tfFunctional_continuous (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) : Continuous (tfFunctional c L B) := by + unfold tfFunctional + exact ((continuous_norm.rpow_const (fun _ => Or.inr (by norm_num : (0:ℝ) ≤ 5/3))).const_mul c).sub L.continuous |>.add + ((B.continuous₂.comp (continuous_id.prodMk continuous_id)).div_const 2) +lemma tfFunctional_midpoint (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (f g : TFLp μ) : + (tfFunctional c L B f+tfFunctional c L B g)/2 - tfFunctional c L B ((1/2:ℝ) • (f+g)) = + c*((‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2 - ‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ)) + B (f-g) (f-g)/8 := by + unfold tfFunctional + simp only [map_add,map_smul,map_sub,_root_.add_apply,_root_.smul_apply, + _root_.sub_apply,smul_eq_mul] + ring +lemma tfFunctional_midpoint_nonneg {c : ℝ} (hc : 0 ≤ c) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) + {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : + tfFunctional c L B ((1/2:ℝ) • (f+g)) ≤ (tfFunctional c L B f+tfFunctional c L B g)/2 := by + have H := tfFunctional_midpoint c L B f g + have hn := add_nonneg (mul_nonneg hc (tfLp_gap_nonneg hf hg)) (div_nonneg (hB (f-g)) (by norm_num : (0:ℝ)≤8)) + linarith +lemma tfFunctional_lower {c : ℝ} (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) (f : TFLp μ) : + c*‖f‖^(5/3:ℝ)-‖L‖*‖f‖ ≤ tfFunctional c L B f := by + have HL : L f ≤ ‖L‖*‖f‖ := (le_abs_self _).trans (L.le_opNorm f) + have HB := hB f + unfold tfFunctional + linarith +lemma tf_superlinear_bound {c K : ℝ} (hc : 0 < c) (hK : 0 ≤ K) : + ∃ R : ℝ, 0 < R ∧ ∀ s : ℝ, R ≤ s → s ≤ c*s^(5/3:ℝ)-K*s := by + let a := (K+1)/c + have ha : 0 < a := div_pos (by linarith) hc + refine ⟨a^(3/2:ℝ),Real.rpow_pos_of_pos ha _,?_⟩ + intro s hs + have hs0 : 0 < s := (Real.rpow_pos_of_pos ha _).trans_le hs + have H := Real.rpow_le_rpow (Real.rpow_nonneg ha.le _) hs (by norm_num : (0:ℝ)≤2/3) + rw [← Real.rpow_mul ha.le] at H + norm_num only [show (3/2:ℝ)*(2/3)=1 by norm_num,Real.rpow_one] at H + have Hc : K+1 ≤ c*s^(2/3:ℝ) := by + have := mul_le_mul_of_nonneg_left H hc.le + dsimp [a] at this + field_simp at this + nlinarith + have hp : s^(5/3:ℝ) = s*s^(2/3:ℝ) := by + have H := Real.rpow_add hs0 (1:ℝ) (2/3:ℝ) + norm_num at H ⊢ + exact H + rw [hp] + nlinarith +lemma tfFunctional_bddBelow {c : ℝ} (hc : 0 < c) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) (S : Set (TFLp μ)) : + BddBelow (tfFunctional c L B '' S) := by + obtain ⟨R,hR,hRb⟩ := tf_superlinear_bound hc (norm_nonneg L) + refine ⟨-‖L‖*R,?_⟩ + rintro a ⟨f,hf,rfl⟩ + have H := tfFunctional_lower (c := c) L B hB f + by_cases hs : R ≤ ‖f‖ + · have HH := hRb ‖f‖ hs + have hn : -‖L‖*R ≤ 0 := mul_nonpos_of_nonpos_of_nonneg (neg_nonpos.mpr (norm_nonneg _)) hR.le + linarith [norm_nonneg f] + · have Hp := mul_nonneg hc.le (Real.rpow_nonneg (norm_nonneg f) (5/3:ℝ)) + have Hn := mul_le_mul_of_nonneg_left (le_of_not_ge hs) (norm_nonneg L) + linarith +lemma tfFunctional_sublevel_bound {c : ℝ} (hc : 0 < c) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) (a : ℝ) : + ∃ R : ℝ, 0 < R ∧ ∀ f : TFLp μ, tfFunctional c L B f ≤ a → ‖f‖ ≤ R := by + obtain ⟨R,hR,hRb⟩ := tf_superlinear_bound hc (norm_nonneg L) + refine ⟨max R a,lt_of_lt_of_le hR (le_max_left _ _),?_⟩ + intro f hf + by_cases hs : R ≤ ‖f‖ + · exact (hRb ‖f‖ hs |>.trans (tfFunctional_lower (c := c) L B hB f) |>.trans hf).trans (le_max_right _ _) + · exact (le_of_not_ge hs).trans (le_max_left _ _) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctionalGapControl.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctionalGapControl.lean new file mode 100644 index 0000000000000000000000000000000000000000..6dd06814afb947f0b76bf58c779e975af29694f3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctionalGapControl.lean @@ -0,0 +1,194 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TfFunctional +import OAI.Analysis.CoulombRadii.FieldAnalysis.MinimizerMidpointControl + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] +lemma tfFunctional_gap_control {c : ℝ} (hc : 0 < c) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) + {R : ℝ} (hR : 0 < R) : + ∃ C : ℝ, 0 < C ∧ ∀ f, TFNonneg f → ∀ g, TFNonneg g → ‖f‖ ≤ R → ‖g‖ ≤ R → + ‖f-g‖^(5/3:ℝ) ≤ C * ((tfFunctional c L B f+tfFunctional c L B g)/2 - + tfFunctional c L B ((1/2:ℝ) • (f+g)))^(5/6:ℝ) := by + let A : ℝ := (36/5:ℝ)/c + let U : ℝ := 2*R+‖(tfOne : TFLp μ)‖ + have hA : 0 < A := div_pos (by norm_num) hc + have hU : 0 < U := by dsimp [U]; linarith [norm_nonneg (tfOne : TFLp μ)] + refine ⟨A^(5/6:ℝ)*U^(5/18:ℝ),mul_pos (Real.rpow_pos_of_pos hA _) (Real.rpow_pos_of_pos hU _),?_⟩ + intro f hf g hg hfR hgR + let d := (‖f‖^(5/3:ℝ)+‖g‖^(5/3:ℝ))/2 - ‖(1/2:ℝ) • (f+g)‖^(5/3:ℝ) + let e := (tfFunctional c L B f+tfFunctional c L B g)/2 - tfFunctional c L B ((1/2:ℝ) • (f+g)) + have hd : 0 ≤ d := tfLp_gap_nonneg hf hg + have he : 0 ≤ e := sub_nonneg.mpr (tfFunctional_midpoint_nonneg hc.le L B hB hf hg) + have hde : c*d ≤ e := by + have H := tfFunctional_midpoint c L B f g + have HB := hB (f-g) + dsimp [d,e] + linarith + have hAc : A*c = 36/5 := by dsimp [A]; field_simp + have hbase : (36/5:ℝ)*d ≤ A*e := by + have H := mul_le_mul_of_nonneg_left hde hA.le + nlinarith + have hp := Real.rpow_le_rpow (mul_nonneg (by norm_num : (0:ℝ)≤36/5) hd) hbase + (by norm_num : (0:ℝ)≤5/6) + have hn : ‖f‖+‖g‖+‖(tfOne : TFLp μ)‖ ≤ U := by dsimp [U]; linarith + have hnp := Real.rpow_le_rpow (by positivity : 0 ≤ ‖f‖+‖g‖+‖(tfOne : TFLp μ)‖) hn + (by norm_num : (0:ℝ)≤5/18) + calc + _ ≤ ((36/5:ℝ)*d)^(5/6:ℝ)*(‖f‖+‖g‖+‖(tfOne : TFLp μ)‖)^(5/18:ℝ) := tfLp_midpoint_gap hf hg + _ ≤ (A*e)^(5/6:ℝ)*U^(5/18:ℝ) := mul_le_mul hp hnp (by positivity) (by positivity) + _ = _ := by rw [Real.mul_rpow hA.le he]; ring +lemma tfFunctional_exists_minimizer {c : ℝ} (hc : 0 < c) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) : + ∃ f : TFLp μ, TFNonneg f ∧ ∀ g, TFNonneg g → tfFunctional c L B f ≤ tfFunctional c L B g := by + apply exists_minimizer_of_midpoint_control tfNonneg_closed ⟨0,tfNonneg_zero⟩ + (fun f hf g hg => (hf.add hg).smul (by norm_num : (0:ℝ)≤1/2)) + (tfFunctional_continuous c L B) (tfFunctional_bddBelow hc L B hB _) + (fun f hf g hg => tfFunctional_midpoint_nonneg hc.le L B hB hf hg) + · intro a + obtain ⟨R,hR,hRb⟩ := tfFunctional_sublevel_bound hc L B hB a + exact ⟨R,hR,fun f _ => hRb f⟩ + · exact fun R hR => tfFunctional_gap_control hc L B hB hR +lemma tfFunctional_minimizer_unique {c : ℝ} (hc : 0 < c) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) + {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) + (hfm : ∀ h, TFNonneg h → tfFunctional c L B f ≤ tfFunctional c L B h) + (hgm : ∀ h, TFNonneg h → tfFunctional c L B g ≤ tfFunctional c L B h) : f = g := by + have hfg : tfFunctional c L B f = tfFunctional c L B g := le_antisymm (hfm g hg) (hgm f hf) + have hmid := hfm ((1/2:ℝ) • (f+g)) ((hf.add hg).smul (by norm_num : (0:ℝ)≤1/2)) + have hmid' := tfFunctional_midpoint_nonneg hc.le L B hB hf hg + have he : (tfFunctional c L B f+tfFunctional c L B g)/2 - tfFunctional c L B ((1/2:ℝ) • (f+g)) = 0 := by + linarith + obtain ⟨C,hC,hCb⟩ := tfFunctional_gap_control hc L B hB + (show (0:ℝ)<‖f‖+‖g‖+1 by positivity) + have H := hCb f hf g hg (by linarith [norm_nonneg g]) (by linarith [norm_nonneg f]) + rw [he,Real.zero_rpow (by norm_num : (5/6:ℝ) ≠ 0),mul_zero] at H + have hz : ‖f-g‖^(5/3:ℝ) = 0 := le_antisymm H (Real.rpow_nonneg (norm_nonneg _) _) + have hn : ‖f-g‖ = 0 := (Real.rpow_eq_zero (norm_nonneg _) (by norm_num : (5/3:ℝ)≠0)).mp hz + exact sub_eq_zero.mp (norm_eq_zero.mp hn) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +noncomputable abbrev TFFieldExponent : ℝ≥0∞ := ENNReal.ofReal (5/2:ℝ) +instance : Fact (1 ≤ TFFieldExponent) := ⟨by norm_num [TFFieldExponent]⟩ +noncomputable abbrev TFLq {α : Type*} [MeasurableSpace α] (μ : Measure α) := Lp ℝ TFFieldExponent μ +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} +lemma tfLq_norm (W : TFLq μ) : + ‖W‖ = (∫ x, ‖W x‖^(5/2:ℝ) ∂μ)^(2/5:ℝ) := by + rw [Lp.norm_def, toReal_eLpNorm, + lpNorm_eq_integral_norm_rpow_toReal (by norm_num [TFFieldExponent]) (by simp) + (Lp.memLp W).aestronglyMeasurable] + norm_num [TFFieldExponent] +noncomputable def tfFieldPairing (W : TFLq μ) (f : TFLp μ) : ℝ := ∫ x, W x*f x ∂μ +lemma tfFieldPairing_integrable (W : TFLq μ) (f : TFLp μ) : Integrable (fun x => W x*f x) μ := by + have : ENNReal.HolderConjugate TFFieldExponent TFExponent := coulomb_holder_exponents.ennrealOfReal + exact (Lp.memLp W).integrable_mul (Lp.memLp f) +lemma tfFieldPairing_bound (W : TFLq μ) (f : TFLp μ) : ‖tfFieldPairing W f‖ ≤ ‖W‖*‖f‖ := by + have H := integral_mul_norm_le_Lp_mul_Lq coulomb_holder_exponents (Lp.memLp W) (Lp.memLp f) + rw [tfLq_norm,tfLp_norm] + calc + _ ≤ ∫ x, ‖W x*f x‖ ∂μ := norm_integral_le_integral_norm _ + _ = ∫ x, ‖W x‖*‖f x‖ ∂μ := by simp only [norm_mul] + _ ≤ _ := by convert H using 1; norm_num +lemma tfFieldPairing_add_left (U W : TFLq μ) (f : TFLp μ) : + tfFieldPairing (U+W) f = tfFieldPairing U f+tfFieldPairing W f := by + unfold tfFieldPairing + rw [← integral_add (tfFieldPairing_integrable U f) (tfFieldPairing_integrable W f)] + apply integral_congr_ae + filter_upwards [Lp.coeFn_add U W] with x hx + simp only [hx,Pi.add_apply,add_mul] +lemma tfFieldPairing_smul_left (c : ℝ) (W : TFLq μ) (f : TFLp μ) : + tfFieldPairing (c • W) f = c*tfFieldPairing W f := by + unfold tfFieldPairing + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul c W] with x hx + simp only [hx,Pi.smul_apply,smul_eq_mul,mul_assoc] +lemma tfFieldPairing_add_right (W : TFLq μ) (f g : TFLp μ) : + tfFieldPairing W (f+g) = tfFieldPairing W f+tfFieldPairing W g := by + unfold tfFieldPairing + rw [← integral_add (tfFieldPairing_integrable W f) (tfFieldPairing_integrable W g)] + apply integral_congr_ae + filter_upwards [Lp.coeFn_add f g] with x hx + simp only [hx,Pi.add_apply,mul_add] +lemma tfFieldPairing_smul_right (c : ℝ) (W : TFLq μ) (f : TFLp μ) : + tfFieldPairing W (c • f) = c*tfFieldPairing W f := by + unfold tfFieldPairing + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul c f] with x hx + simp only [hx,Pi.smul_apply,smul_eq_mul] + ring +noncomputable def tfFieldLinear : TFLq μ →ₗ[ℝ] TFLp μ →ₗ[ℝ] ℝ := + LinearMap.mk₂ ℝ tfFieldPairing tfFieldPairing_add_left tfFieldPairing_smul_left + tfFieldPairing_add_right tfFieldPairing_smul_right +noncomputable def tfFieldContinuous : TFLq μ →L[ℝ] TFLp μ →L[ℝ] ℝ := + tfFieldLinear.mkContinuous₂ 1 (fun W f => by + change ‖tfFieldPairing W f‖ ≤ 1*‖W‖*‖f‖ + simpa only [one_mul] using tfFieldPairing_bound W f) +lemma tfFieldContinuous_apply (W : TFLq μ) (f : TFLp μ) : + tfFieldContinuous W f = ∫ x, W x*f x ∂μ := rfl +lemma tfFieldContinuous_bound (W : TFLq μ) : ‖tfFieldContinuous W‖ ≤ ‖W‖ := by + refine ContinuousLinearMap.opNorm_le_bound (tfFieldContinuous W) (norm_nonneg W) (fun f => ?_) + rw [tfFieldContinuous_apply] + exact tfFieldPairing_bound W f +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] +noncomputable def tfEnergy (c : ℝ) (W : TFLq (volume.restrict Ω)) + (f : TFLp (volume.restrict Ω)) : ℝ := + tfFunctional c (tfFieldContinuous W) (tfCoulombContinuous hΩ) f +lemma tfEnergy_formula (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + tfEnergy hΩ c W f = c*(∫ x in Ω, (f x)^(5/3:ℝ)) - + (∫ x in Ω, W x*f x) + tfCoulomb Ω f f/2 := by + unfold tfEnergy tfFunctional + rw [tfLp_nonneg_power hf] + rfl +lemma tfEnergy_exists_unique_minimizer {c : ℝ} (hc : 0 < c) + (W : TFLq (volume.restrict Ω)) : + ∃! f : TFLp (volume.restrict Ω), TFNonneg f ∧ + ∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g := by + have hB : ∀ f, 0 ≤ (tfCoulombContinuous hΩ) f f := tfCoulomb_self_nonneg hΩ + obtain ⟨f,hf,hfm⟩ := tfFunctional_exists_minimizer hc (tfFieldContinuous W) (tfCoulombContinuous hΩ) hB + refine ⟨f,⟨hf,hfm⟩,?_⟩ + rintro g ⟨hg,hgm⟩ + exact tfFunctional_minimizer_unique hc _ _ hB hg hf hgm hfm +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctionalUniformBound.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctionalUniformBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ab9063df32f3b835ceb97dcb122b1db6ebbce47 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfFunctionalUniformBound.lean @@ -0,0 +1,280 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.TfGradientField + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] +omit [IsFiniteMeasure μ] in +lemma tfFunctional_uniform_bound {c K : ℝ} (hc : 0 < c) (hK : 0 ≤ K) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) : + ∃ R : ℝ, 0 < R ∧ ∀ (L : TFLp μ →L[ℝ] ℝ), ‖L‖ ≤ K → + ∀ f, tfFunctional c L B f ≤ 0 → ‖f‖ ≤ R := by + obtain ⟨R,hR,hRb⟩ := tf_superlinear_bound hc hK + refine ⟨R,hR,?_⟩ + intro L hL f hf + by_contra! hn + have H := hRb ‖f‖ hn.le + have Hl := tfFunctional_lower (c := c) L B hB f + have HK := mul_le_mul_of_nonneg_right hL (norm_nonneg f) + linarith +omit [IsFiniteMeasure μ] in +lemma tfFunctional_minimizer_gap (c : ℝ) (L L' : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) {f g : TFLp μ} + (hf : TFNonneg f) (hg : TFNonneg g) + (hmf : ∀ h, TFNonneg h → tfFunctional c L B f ≤ tfFunctional c L B h) + (hmg : ∀ h, TFNonneg h → tfFunctional c L' B g ≤ tfFunctional c L' B h) + {R : ℝ} (hfR : ‖f‖ ≤ R) (hgR : ‖g‖ ≤ R) : + (tfFunctional c L B f+tfFunctional c L B g)/2 - + tfFunctional c L B ((1/2:ℝ) • (f+g)) ≤ R*‖L'-L‖ := by + have Hm := hmf _ ((hf.add hg).smul (by norm_num : (0:ℝ)≤1/2)) + have Hg := hmg f hf + have He : tfFunctional c L B g-tfFunctional c L B f = + tfFunctional c L' B g-tfFunctional c L' B f+(L'-L) (g-f) := by + simp only [tfFunctional,map_sub,_root_.sub_apply] + ring + have Hn : (L'-L) (g-f) ≤ ‖L'-L‖*(2*R) := by + exact (le_abs_self _).trans ((L'-L).le_opNorm (g-f) |>.trans + (mul_le_mul_of_nonneg_left ((norm_sub_le g f).trans (by linarith)) (norm_nonneg _))) + nlinarith +lemma tfFunctional_minimizers_tendsto {ι : Type*} {l : Filter ι} {c : ℝ} (hc : 0 < c) + {L : TFLp μ →L[ℝ] ℝ} {Ls : ι → TFLp μ →L[ℝ] ℝ} (hL : Tendsto Ls l (𝓝 L)) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (hB : ∀ f, 0 ≤ B f f) + {f : TFLp μ} {fs : ι → TFLp μ} (hf : TFNonneg f) (hfs : ∀ i, TFNonneg (fs i)) + (hmf : ∀ g, TFNonneg g → tfFunctional c L B f ≤ tfFunctional c L B g) + (hmfs : ∀ i g, TFNonneg g → tfFunctional c (Ls i) B (fs i) ≤ tfFunctional c (Ls i) B g) : + Tendsto fs l (𝓝 f) := by + let K := ‖L‖+1 + obtain ⟨R,hR,hRb⟩ := tfFunctional_uniform_bound hc + (show (0:ℝ) ≤ K by dsimp [K]; positivity) B hB + have hmin0 (L' : TFLp μ →L[ℝ] ℝ) (f' : TFLp μ) + (hm : ∀ g, TFNonneg g → tfFunctional c L' B f' ≤ tfFunctional c L' B g) : + tfFunctional c L' B f' ≤ 0 := by + have H := hm 0 tfNonneg_zero + simpa [tfFunctional] using H + have hfR : ‖f‖ ≤ R := hRb L (by dsimp [K]; linarith) f (hmin0 _ _ hmf) + have hev : ∀ᶠ i in l, ‖fs i‖ ≤ R := by + filter_upwards [hL.norm.eventually (gt_mem_nhds (show ‖L‖ < K by dsimp [K]; linarith))] with i hi + exact hRb (Ls i) hi.le (fs i) (hmin0 _ _ (hmfs i)) + obtain ⟨C,hC,hCb⟩ := tfFunctional_gap_control hc L B hB hR + have hlimit : Tendsto (fun i => C*(R*‖Ls i-L‖)^(5/6:ℝ)) l (𝓝 0) := by + have H := (hL.sub_const L).norm + have H1 : Tendsto (fun i => R*‖Ls i-L‖) l (𝓝 (0:ℝ)) := by simpa using H.const_mul R + simpa using (H1.rpow_const (p := (5/6:ℝ)) (Or.inr (by norm_num))).const_mul C + rw [Metric.tendsto_nhds] + intro ε hε + have hεp := Real.rpow_pos_of_pos hε (5/3:ℝ) + filter_upwards [hev,hlimit.eventually (gt_mem_nhds hεp)] with i hi hlim + have H := hCb f hf (fs i) (hfs i) hfR hi + have Hgap := tfFunctional_minimizer_gap c L (Ls i) B hf (hfs i) hmf (hmfs i) hfR hi + have Hnon := sub_nonneg.mpr (tfFunctional_midpoint_nonneg hc.le L B hB hf (hfs i)) + have Hup := mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow Hnon Hgap (by norm_num : (0:ℝ)≤5/6)) hC.le + have Hd : ‖f-fs i‖ < ε := (Real.rpow_lt_rpow_iff (norm_nonneg _) hε.le (by norm_num : (0:ℝ)<5/3)).mp + (H.trans Hup |>.trans_lt hlim) + simpa only [dist_eq_norm,norm_sub_rev] using Hd +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +lemma tf_complementarity_solve {a r w : ℝ} (ha : 0 < a) (hr : 0 ≤ r) + (hg : 0 ≤ a*r^(2/3:ℝ)-w) (hc : (a*r^(2/3:ℝ)-w)*r=0) : + r = (max w 0/a)^(3/2:ℝ) ∧ a*r^(2/3:ℝ)-w = max (-w) 0 := by + by_cases hz : r=0 + · subst r + simp only [Real.zero_rpow (by norm_num : (2/3:ℝ)≠0),mul_zero,zero_sub] at hg ⊢ + have hw : w ≤ 0 := by linarith + simp [max_eq_right hw,max_eq_left hg] + · have hrp : 0 < r := lt_of_le_of_ne hr (Ne.symm hz) + have he : a*r^(2/3:ℝ)-w=0 := (mul_eq_zero.mp hc).resolve_right hz + have hw : 0 < w := by nlinarith [Real.rpow_pos_of_pos hrp (2/3:ℝ)] + have hdiv : w/a=r^(2/3:ℝ) := (div_eq_iff ha.ne').mpr (by linarith [he]) + rw [max_eq_left hw.le,hdiv,←Real.rpow_mul hr] + norm_num only [show (2/3:ℝ)*(3/2)=1 by norm_num,Real.rpow_one] + exact ⟨True.intro,by rw [he,max_eq_right (by linarith)]⟩ +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] +lemma tfEuler_equation {c : ℝ} (hc : 0 < c) (W : TFLq (volume.restrict Ω)) + {f : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W g) : + ∀ᵐ x ∂volume.restrict Ω, + f x = (max (W x-tfPotential f x) 0/(c*(5/3:ℝ)))^(3/2:ℝ) ∧ + tfGradientField hΩ c W f x = max (tfPotential f x-W x) 0 := by + filter_upwards [hf,tfEuler_complementarity hΩ c W hf hm,tfGradientField_coe hΩ c W hf] with x hx hh he + have H := tf_complementarity_solve (show 0 (f x)^(2/3:ℝ)*g x) μ := by + apply (tfFieldPairing_integrable (tfKineticField f) g).congr + filter_upwards [tfKineticField_coe f,hf] with x hx hy + rw [hx,Real.norm_of_nonneg hy] +lemma tfBregman_integrable {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : + Integrable (fun x => (g x)^(5/3:ℝ)-(f x)^(5/3:ℝ)- + (5/3:ℝ)*(f x)^(2/3:ℝ)*(g x-f x)) μ := by + have hi := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) (Lp.memLp f) hf + have hj := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) (Lp.memLp g) hg + have hk := (tfKinetic_pair_integrable hf (g-f)).const_mul (5/3:ℝ) + apply (hj.sub hi |>.sub hk).congr + filter_upwards [Lp.coeFn_sub g f] with x hx + simp only [hx,Pi.sub_apply,mul_assoc] +lemma tfBregman_formula {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : + tfBregman f g = ∫ x, (g x)^(5/3:ℝ)-(f x)^(5/3:ℝ)- + (5/3:ℝ)*(f x)^(2/3:ℝ)*(g x-f x) ∂μ := by + have hi := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) (Lp.memLp f) hf + have hj := integrable_rpow_of_memLp_nonneg (by norm_num : (0:ℝ)<5/3) (Lp.memLp g) hg + have hk := (tfKinetic_pair_integrable hf (g-f)).const_mul (5/3:ℝ) + have hij : Integrable (fun x => (g x)^(5/3:ℝ)-(f x)^(5/3:ℝ)) μ := hj.sub hi + unfold tfBregman + rw [←tfLp_nonneg_power hf,←tfLp_nonneg_power hg,tfKineticField_pair hf,←integral_const_mul, + ←integral_sub hj hi,←integral_sub hij hk] + apply integral_congr_ae + filter_upwards [Lp.coeFn_sub g f] with x hx + simp only [hx,Pi.sub_apply,mul_assoc] +lemma tfBregman_nonneg {f g : TFLp μ} (hf : TFNonneg f) (hg : TFNonneg g) : + 0 ≤ tfBregman f g := by + rw [tfBregman_formula hf hg] + apply integral_nonneg_of_ae + filter_upwards [hf,hg] with x hx hy + exact tf_power_tangent hx hy +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] +lemma tfEnergy_expansion (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f g : TFLp (volume.restrict Ω)} (hf : TFNonneg f) : + tfEnergy hΩ c W g-tfEnergy hΩ c W f = + tfCoulomb Ω (g-f) (g-f)/2+c*tfBregman f g+ + tfFieldContinuous (tfGradientField hΩ c W f) (g-f) := by + rw [tfGradientField_pair hΩ c W hf,←tfKineticField_pair hf] + change tfFunctional c (tfFieldContinuous W) (tfCoulombContinuous hΩ) g- + tfFunctional c (tfFieldContinuous W) (tfCoulombContinuous hΩ) f = _ + have he : tfCoulomb Ω (g-f) (g-f) = tfCoulomb Ω g g-tfCoulomb Ω g f- + tfCoulomb Ω f g+tfCoulomb Ω f f := by + change (tfCoulombContinuous hΩ) (g-f) (g-f) = _ + simp only [map_sub,_root_.sub_apply] + change tfCoulomb Ω g g-tfCoulomb Ω f g-(tfCoulomb Ω g f-tfCoulomb Ω f f) = _ + ring + have he' : tfCoulomb Ω (g-f) f = tfCoulomb Ω g f-tfCoulomb Ω f f := by + change (tfCoulombContinuous hΩ) (g-f) f = _ + simp only [map_sub,_root_.sub_apply] + rfl + rw [he,he',tfCoulomb_symm f g] + simp only [tfFunctional,tfBregman,map_sub] + change c*‖g‖^(5/3:ℝ)-tfFieldContinuous W g+tfCoulomb Ω g g/2 - + (c*‖f‖^(5/3:ℝ)-tfFieldContinuous W f+tfCoulomb Ω f f/2) = _ + ring +lemma tfEnergy_minimizer_expansion {c : ℝ} (hc : 0 < c) (W : TFLq (volume.restrict Ω)) + {f g : TFLp (volume.restrict Ω)} (hf : TFNonneg f) + (hm : ∀ h, TFNonneg h → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W h) : + tfEnergy hΩ c W g-tfEnergy hΩ c W f = + tfCoulomb Ω (g-f) (g-f)/2+c*tfBregman f g+ + ∫ x in Ω, max (tfPotential f x-W x) 0*g x := by + rw [tfEnergy_expansion hΩ c W hf,map_sub,tfGradientField_self hΩ c W hf hm,sub_zero, + tfFieldContinuous_apply] + congr 1 + apply integral_congr_ae + filter_upwards [tfEuler_equation hΩ hc W hf hm] with x hx + rw [hx.2] +lemma tfEnergy_gap_controls (c : ℝ) (W : TFLq (volume.restrict Ω)) + {f g : TFLp (volume.restrict Ω)} (hf : TFNonneg f) (hg : TFNonneg g) + (hm : ∀ h, TFNonneg h → tfEnergy hΩ c W f ≤ tfEnergy hΩ c W h) : + tfCoulomb Ω (g-f) (g-f)/2+c*tfBregman f g ≤ tfEnergy hΩ c W g-tfEnergy hΩ c W f := by + rw [tfEnergy_expansion hΩ c W hf,map_sub,tfGradientField_self hΩ c W hf hm,sub_zero] + apply le_add_of_nonneg_right + rw [tfFieldContinuous_apply] + apply integral_nonneg_of_ae + filter_upwards [tfGradientField_nonneg hΩ c W hf hm,hg] with x hx hy + exact mul_nonneg hx hy +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfPotential.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b3e5f73a6f32bc17a86f68006ad56545e6338ad --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfPotential.lean @@ -0,0 +1,212 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TfFunctionalGapControl + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {Ω : Set Space} (hΩ : MeasurableSet Ω) [IsFiniteMeasure (volume.restrict Ω)] +noncomputable def tfPotential (f : TFLp (volume.restrict Ω)) (x : Space) : ℝ := + ∫ y, coulombKernel (x-y)*tfExtend Ω f y +include hΩ +lemma tfPotential_integrand (f : TFLp (volume.restrict Ω)) (x : Space) : + Integrable (fun y => coulombKernel (x-y)*tfExtend Ω f y) := + coulomb_lp_convolution_integrable (tfExtend_integrable hΩ f) (tfExtend_measurable hΩ f) + (tfExtend_memLp hΩ f) x +omit [IsFiniteMeasure (volume.restrict Ω)] in +lemma tfPotential_measurable (f : TFLp (volume.restrict Ω)) : Measurable (tfPotential f) := by + have H : StronglyMeasurable (fun p : Space × Space => coulombKernel (p.1-p.2)*tfExtend Ω f p.2) := + ((coulombKernel_measurable.comp (measurable_fst.sub measurable_snd)).mul + ((tfExtend_measurable hΩ f).comp measurable_snd)).stronglyMeasurable + exact H.integral_prod_right'.measurable +lemma tfPotential_bound (f : TFLp (volume.restrict Ω)) (x : Space) : + ‖tfPotential f x‖ ≤ ((8*Real.pi)^(2/5:ℝ)+(volume.real Ω)^(2/5:ℝ))*‖f‖ := by + calc + _ ≤ ∫ y, ‖coulombKernel (x-y)*tfExtend Ω f y‖ := norm_integral_le_integral_norm _ + _ = ∫ y, coulombKernel (x-y)*‖tfExtend Ω f y‖ := by + simp only [norm_mul,Real.norm_of_nonneg (coulombKernel_nonneg _)] + _ ≤ _ := tfExtend_convolution_bound hΩ f x +lemma tfPotential_memLp (f : TFLp (volume.restrict Ω)) : + MemLp (tfPotential f) TFFieldExponent (volume.restrict Ω) := + MemLp.of_bound (tfPotential_measurable hΩ f).aestronglyMeasurable _ + (Eventually.of_forall (tfPotential_bound hΩ f)) +noncomputable def tfPotentialField (f : TFLp (volume.restrict Ω)) : TFLq (volume.restrict Ω) := + (tfPotential_memLp hΩ f).toLp (tfPotential f) +lemma tfPotentialField_coe (f : TFLp (volume.restrict Ω)) : + tfPotentialField hΩ f =ᵐ[volume.restrict Ω] tfPotential f := MemLp.coeFn_toLp _ +lemma tfCoulomb_eq_potential (f g : TFLp (volume.restrict Ω)) : + tfCoulomb Ω f g = ∫ x in Ω, f x*tfPotential g x := by + rw [tfCoulomb,Measure.volume_eq_prod,integral_prod _ (tfCoulomb_integrable hΩ f g)] + rw [← integral_indicator hΩ] + apply integral_congr_ae + filter_upwards [] with x + rw [show (∫ y, tfExtend Ω f x*tfExtend Ω g y*coulombKernel (x-y)) = + tfExtend Ω f x*tfPotential g x by + unfold tfPotential + rw [← integral_const_mul] + apply integral_congr_ae + filter_upwards [] with y + ring] + by_cases hx : x ∈ Ω <;> simp [tfExtend,hx] +lemma tfCoulomb_eq_field (f g : TFLp (volume.restrict Ω)) : + tfCoulomb Ω f g = tfFieldContinuous (tfPotentialField hΩ g) f := by + rw [tfCoulomb_eq_potential hΩ,tfFieldContinuous_apply] + apply integral_congr_ae + filter_upwards [tfPotentialField_coe hΩ g] with x hx + rw [hx,mul_comm] +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] +noncomputable def tfIndicator (s : Set α) (hs : MeasurableSet s) : TFLp μ := + ((memLp_const (p := TFExponent) (μ := μ) (1:ℝ)).indicator hs).toLp (s.indicator (fun _ => 1)) +lemma tfIndicator_coe (s : Set α) (hs : MeasurableSet s) : + (tfIndicator s hs : TFLp μ) =ᵐ[μ] s.indicator (fun _ => 1) := MemLp.coeFn_toLp _ +lemma tfIndicator_nonneg (s : Set α) (hs : MeasurableSet s) : TFNonneg (tfIndicator s hs : TFLp μ) := by + filter_upwards [tfIndicator_coe (μ := μ) s hs] with x hx + rw [hx] + exact Set.indicator_nonneg (fun _ _ => zero_le_one) x +lemma tfIndicator_bound (s : Set α) (hs : MeasurableSet s) : + ∀ᵐ x ∂μ, |(tfIndicator s hs : TFLp μ) x| ≤ 1 := by + filter_upwards [tfIndicator_coe (μ := μ) s hs] with x hx + rw [hx] + by_cases h : x ∈ s <;> simp [h] +lemma tfField_indicator (W : TFLq μ) (s : Set α) (hs : MeasurableSet s) : + tfFieldContinuous W (tfIndicator s hs) = ∫ x in s, W x ∂μ := by + rw [tfFieldContinuous_apply,←integral_indicator hs] + apply integral_congr_ae + filter_upwards [tfIndicator_coe (μ := μ) s hs] with x hx + rw [hx] + by_cases h : x ∈ s <;> simp [h] +lemma tfDual_nonneg (W : TFLq μ) + (hW : ∀ h : TFLp μ, TFNonneg h → (∀ᵐ x ∂μ, |h x| ≤ 1) → 0 ≤ tfFieldContinuous W h) : + ∀ᵐ x ∂μ, 0 ≤ W x := by + apply ae_nonneg_of_forall_setIntegral_nonneg ((Lp.memLp W).integrable (by norm_num [TFFieldExponent])) + intro s hs _ + rw [←tfField_indicator W s hs] + exact hW _ (tfIndicator_nonneg s hs) (tfIndicator_bound s hs) +omit [IsFiniteMeasure μ] in +lemma tfKineticField_memLp (f : TFLp μ) : + MemLp (fun x => ‖f x‖^(2/3:ℝ)) TFFieldExponent μ := by + have H := (Lp.memLp f).norm_rpow_div (ENNReal.ofReal (2/3:ℝ)) + have he : TFExponent / ENNReal.ofReal (2/3:ℝ) = TFFieldExponent := by + rw [TFExponent,TFFieldExponent,←ENNReal.ofReal_div_of_pos (by norm_num : (0:ℝ)<2/3)] + norm_num + rw [he] at H + norm_num only [ENNReal.toReal_ofReal (by norm_num : (0:ℝ)≤2/3)] at H + exact H +noncomputable def tfKineticField (f : TFLp μ) : TFLq μ := + (tfKineticField_memLp f).toLp (fun x => ‖f x‖^(2/3:ℝ)) +omit [IsFiniteMeasure μ] in +lemma tfKineticField_coe (f : TFLp μ) : + tfKineticField f =ᵐ[μ] (fun x => ‖f x‖^(2/3:ℝ)) := MemLp.coeFn_toLp _ +omit [IsFiniteMeasure μ] in +lemma tfKineticField_pair {f : TFLp μ} (hf : TFNonneg f) (h : TFLp μ) : + tfFieldContinuous (tfKineticField f) h = ∫ x, (f x)^(2/3:ℝ)*h x ∂μ := by + rw [tfFieldContinuous_apply] + apply integral_congr_ae + filter_upwards [tfKineticField_coe f,hf] with x hx hy + rw [hx,Real.norm_of_nonneg hy] +omit [IsFiniteMeasure μ] in +lemma tfKineticField_self {f : TFLp μ} (hf : TFNonneg f) : + tfFieldContinuous (tfKineticField f) f = ‖f‖^(5/3:ℝ) := by + rw [tfKineticField_pair hf,←tfLp_nonneg_power hf] + apply integral_congr_ae + filter_upwards [hf] with x hx + have H := Real.rpow_add_one' hx (by norm_num : (2/3:ℝ)+1≠0) + norm_num at H + exact H.symm +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] +lemma tfPower_hasDerivAt {f h : α → ℝ} (hf : MemLp f TFExponent μ) + (hh : AEStronglyMeasurable h μ) (hb : ∀ᵐ x ∂μ, |h x| ≤ 1) : + HasDerivAt (fun t : ℝ => ∫ x, (f x+t*h x)^(5/3:ℝ) ∂μ) + ((5/3:ℝ)*(∫ x, (f x)^(2/3:ℝ)*h x ∂μ)) 0 := by + let F : ℝ → α → ℝ := fun t x => (f x+t*h x)^(5/3:ℝ) + let F' : ℝ → α → ℝ := fun t x => (5/3:ℝ)*(f x+t*h x)^(2/3:ℝ)*h x + let b : α → ℝ := fun x => (5/3:ℝ)*(|f x|+1) + have hfi : Integrable f μ := hf.integrable (by norm_num [TFExponent]) + have hbi : Integrable b μ := (hfi.abs.add (integrable_const 1)).const_mul _ + have hFm : ∀ t, AEStronglyMeasurable (F t) μ := fun t => ((hf.aestronglyMeasurable.add (hh.const_mul t)).aemeasurable.pow_const _).aestronglyMeasurable + have hF'm : AEStronglyMeasurable (F' 0) μ := by + dsimp only [F'] + exact ((((hf.aestronglyMeasurable.add (hh.const_mul 0)).aemeasurable.pow_const _).aestronglyMeasurable).const_mul _).mul hh + have hF0 : Integrable (F 0) μ := by + have H := hf.integrable_norm_rpow (by norm_num [TFExponent]) (by simp) + have H' : Integrable (fun x => |f x|^(5/3:ℝ)) μ := by + norm_num [TFExponent] at H + exact H + refine H'.mono' (hFm 0) ?_ + filter_upwards [] with x + simpa [F,Real.norm_eq_abs] using Real.abs_rpow_le_abs_rpow (f x) (5/3:ℝ) + have hbound : ∀ᵐ x ∂μ, ∀ t ∈ Metric.ball (0:ℝ) 1, ‖F' t x‖ ≤ b x := by + filter_upwards [hb] with x hx t ht + have ht1 : |t| ≤ 1 := le_of_lt (by simpa [Real.dist_eq] using ht) + have hv : |f x+t*h x| ≤ |f x|+1 := + (abs_add_le _ _).trans (by rw [abs_mul]; nlinarith [abs_nonneg t, abs_nonneg (h x)]) + have hp : |(f x+t*h x)^(2/3:ℝ)| ≤ |f x|+1 := + (Real.abs_rpow_le_abs_rpow _ _).trans + ((Real.rpow_le_rpow (abs_nonneg _) hv (by norm_num)).trans + (Real.rpow_le_self_of_one_le (by linarith [abs_nonneg (f x)]) (by norm_num))) + dsimp [F',b] + rw [abs_mul,abs_mul,abs_of_pos (by norm_num : (0:ℝ)<5/3)] + calc + _ ≤ (5/3:ℝ)*(|f x|+1)*1 := mul_le_mul + (mul_le_mul_of_nonneg_left hp (by norm_num)) hx (abs_nonneg _) (by positivity) + _ = _ := mul_one _ + have hdiff : ∀ᵐ x ∂μ, ∀ t ∈ Metric.ball (0:ℝ) 1, HasDerivAt (F · x) (F' t x) t := by + filter_upwards [] with x t _ + have H := ((hasDerivAt_const t (f x)).add ((hasDerivAt_id t).mul_const (h x))).rpow_const + (p := (5/3:ℝ)) (Or.inr (by norm_num)) + convert H using 1 <;> norm_num [F,F',mul_comm,mul_left_comm] + have H := hasDerivAt_integral_of_dominated_loc_of_deriv_le (Metric.ball_mem_nhds (0:ℝ) (by norm_num : (0:ℝ)<1)) + (Eventually.of_forall hFm) hF0 hF'm hbound hbi hdiff + simpa only [F,F',zero_mul,add_zero,mul_assoc,integral_const_mul] using H.2 +lemma nonneg_deriv_of_min_on_right {F : ℝ → ℝ} {d : ℝ} (hd : HasDerivAt F d 0) + (hm : ∀ t : ℝ, 0 ≤ t → F 0 ≤ F t) : 0 ≤ d := by + apply ge_of_tendsto hd.tendsto_slope_zero_right + filter_upwards [self_mem_nhdsWithin] with t ht + simp only [mem_Ioi] at ht + simpa only [zero_add,smul_eq_mul,div_eq_mul_inv,mul_comm] using div_nonneg (sub_nonneg.mpr (hm t ht.le)) ht.le +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfRawVariation.lean b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfRawVariation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c405ddde9e5fa5666d01153e1f220ca38c9acf17 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/ThomasFermi/TfRawVariation.lean @@ -0,0 +1,120 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.TfPotential + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} [IsFiniteMeasure μ] +noncomputable def tfRawVariation (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (f h : TFLp μ) (t : ℝ) : ℝ := + c*(∫ x, (f x+t*h x)^(5/3:ℝ) ∂μ) - (L f+t*L h) + + (B f f+t*(B f h+B h f)+t^2*B h h)/2 +omit [IsFiniteMeasure μ] in +lemma tfRawVariation_eq (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) {f h : TFLp μ} + (hf : TFNonneg f) (hh : TFNonneg h) {t : ℝ} (ht : 0 ≤ t) : + tfRawVariation c L B f h t = tfFunctional c L B (f+t • h) := by + have hK : (∫ x, (f x+t*h x)^(5/3:ℝ) ∂μ) = ‖f+t • h‖^(5/3:ℝ) := by + rw [← tfLp_nonneg_power (hf.add (hh.smul ht))] + apply integral_congr_ae + filter_upwards [Lp.coeFn_add f (t • h), Lp.coeFn_smul t h] with x hx hy + simp only [hx,Pi.add_apply,hy,Pi.smul_apply,smul_eq_mul] + unfold tfRawVariation tfFunctional + rw [hK] + simp only [map_add,map_smul,_root_.add_apply,_root_.smul_apply,smul_eq_mul] + ring +lemma tfRawVariation_hasDerivAt (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (f h : TFLp μ) + (hh : ∀ᵐ x ∂μ, |h x| ≤ 1) : + HasDerivAt (tfRawVariation c L B f h) + (c*(5/3:ℝ)*(∫ x, (f x)^(2/3:ℝ)*h x ∂μ) - L h + (B f h+B h f)/2) 0 := by + have hK := tfPower_hasDerivAt (Lp.memLp f) (Lp.memLp h).aestronglyMeasurable hh + have hid := hasDerivAt_id (0:ℝ) + have hL := (hasDerivAt_const (0:ℝ) (L f)).add (hid.mul_const (L h)) + have hB := (((hasDerivAt_const (0:ℝ) (B f f)).add + (hid.mul_const (B f h+B h f))).add ((hid.pow 2).mul_const (B h h))).div_const 2 + convert ((hK.const_mul c).sub hL).add hB using 1 <;> + first | rfl | (norm_num [tfRawVariation]; ring) +lemma tfFunctional_tangent_nonneg (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) {f : TFLp μ} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfFunctional c L B f ≤ tfFunctional c L B g) + {h : TFLp μ} (hh : TFNonneg h) (hb : ∀ᵐ x ∂μ, |h x| ≤ 1) : + 0 ≤ c*(5/3:ℝ)*(∫ x, (f x)^(2/3:ℝ)*h x ∂μ) - L h + (B f h+B h f)/2 := by + apply nonneg_deriv_of_min_on_right (tfRawVariation_hasDerivAt c L B f h hb) + intro t ht + rw [tfRawVariation_eq c L B hf hh (le_refl 0), zero_smul, add_zero, + tfRawVariation_eq c L B hf hh ht] + exact hm _ (hf.add (hh.smul ht)) +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology +namespace Coulomb +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} +lemma tfFunctional_scaling_eq (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) (f : TFLp μ) {t : ℝ} (ht : 0 ≤ t) : + tfFunctional c L B (t • f) = c*t^(5/3:ℝ)*‖f‖^(5/3:ℝ) - t*L f + t^2*B f f/2 := by + unfold tfFunctional + rw [norm_smul,Real.norm_of_nonneg ht,Real.mul_rpow ht (norm_nonneg _)] + simp only [map_smul,_root_.smul_apply,smul_eq_mul] + ring +lemma tfFunctional_scaling_stationary (c : ℝ) (L : TFLp μ →L[ℝ] ℝ) + (B : TFLp μ →L[ℝ] TFLp μ →L[ℝ] ℝ) {f : TFLp μ} (hf : TFNonneg f) + (hm : ∀ g, TFNonneg g → tfFunctional c L B f ≤ tfFunctional c L B g) : + c*(5/3:ℝ)*‖f‖^(5/3:ℝ) - L f+B f f = 0 := by + let J : ℝ → ℝ := fun t => c*t^(5/3:ℝ)*‖f‖^(5/3:ℝ) - t*L f+t^2*B f f/2 + have hj : IsLocalMin J 1 := by + filter_upwards [eventually_gt_nhds (by norm_num : (0:ℝ)<1)] with t ht + have H := hm (t • f) (hf.smul ht.le) + rw [tfFunctional_scaling_eq c L B f ht.le] at H + simpa [J,tfFunctional] using H + have hid := hasDerivAt_id (1:ℝ) + have hpow := hid.rpow_const (p := (5/3:ℝ)) (Or.inl (by norm_num : (1:ℝ)≠0)) + have hd : HasDerivAt J (c*(5/3:ℝ)*‖f‖^(5/3:ℝ) - L f+B f f) 1 := by + have H := (((hpow.const_mul c).mul_const (‖f‖^(5/3:ℝ))).sub (hid.mul_const (L f))).add + (((hid.pow 2).mul_const (B f f)).div_const 2) + convert H using 1 <;> first | rfl | norm_num [J] + exact hj.hasDerivAt_eq_zero hd +end Coulomb + +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/AtomicMasterUniform.lean b/lean/OAI/Analysis/CoulombRadii/Variational/AtomicMasterUniform.lean new file mode 100644 index 0000000000000000000000000000000000000000..dd1a73eff42c907e0110bcb0930f46c2335ad175 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/AtomicMasterUniform.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Screening.AtomicMasterRelative + +namespace OAI + +section +section +open MeasureTheory Set Filter +open scoped ENNReal NNReal BigOperators Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma exists_atomic_master_uniform_error {c A ε : ℝ} (hc : 0] 0, + c*(1+packetExponent)*s^packetExponent<1/2 ∧ + 100000*c*s^packetExponent<1 ∧ + Coulomb.atomicTransferConstant*A^(1/500:ℝ)*s^(1/500:ℝ)+ + Coulomb.atomicNearConstant*(400000*c)^(1/5:ℝ)*s^(packetExponent/5)<ε := by + filter_upwards [ht.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1/2)), + hu.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1)),he.eventually (gt_mem_nhds hε)] with s hs₁ hs₂ hs₃ + exact ⟨hs₁,hs₂,hs₃⟩ + obtain ⟨s₀,hs₀,Hs₀⟩ := mem_nhdsGT_iff_exists_Ioo_subset.mp HH + refine ⟨s₀,hs₀,?_⟩ + intro s hs hss + obtain ⟨hq,hθ,herr⟩ := Hs₀ ⟨hs,hss⟩ + refine ⟨hq.le,hθ.le,?_⟩ + intro a ha hsa + have hca : 0≤Coulomb.atomicTransferConstant := Coulomb.atomicTransferConstant_nonneg + have hfirst := mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow ha.le hsa (by norm_num : (0:ℝ)≤1/500)) hca + have hpow : (4*(100000*c*s^packetExponent))^(1/5:ℝ)= + (400000*c)^(1/5:ℝ)*s^(packetExponent/5) := by + rw [show 4*(100000*c*s^packetExponent)=(400000*c)*s^packetExponent by ring, + Real.mul_rpow (by positivity : 0≤400000*c) (Real.rpow_nonneg hs.le _), + ←Real.rpow_mul hs.le] + congr 2 + ring + rw [Real.mul_rpow hA.le hs.le] at hfirst + rw [hpow] + nlinarith + +theorem exists_atomic_master_fresh_uniform_transfer {c A ε : ℝ} + (hc : 0 f x := by + filter_upwards [hm, hn] with y hy hz + exact le_antisymm hy hz + have hed : deriv f =ᶠ[𝓝 x] fun _ => 0 := by + filter_upwards [he.eventually_nhds] with y hy + have hy' : f =ᶠ[𝓝 y] fun _ => f x := hy + simpa using hy'.deriv_eq + have : deriv (deriv f) x = 0 := by simpa using hed.deriv_eq + linarith + +def axis (a : Fin 3) : Position := EuclideanSpace.single a 1 + +def coordinateLaplacian (f : Position → ℝ) (x : Position) : ℝ := + ∑ a : Fin 3, deriv (deriv (fun t : ℝ => f (x+t • axis a))) 0 + +theorem coordinateLaplacian_nonpos_of_local_max {f : Position → ℝ} {x : Position} + (hm : IsLocalMax f x) (hc : ContinuousAt f x) : coordinateLaplacian f x ≤ 0 := by + apply Finset.sum_nonpos + intro a _ + have hl : ContinuousAt (fun t : ℝ => x+t • axis a) 0 := by fun_prop + have hl' : Tendsto (fun t : ℝ => x+t • axis a) (𝓝 0) (𝓝 x) := by simpa using hl.tendsto + apply second_deriv_nonpos_of_local_max + · change ∀ᶠ t in 𝓝 0, f (x+t • axis a) ≤ f (x+0 • axis a) + simpa only [zero_smul, add_zero] using hl'.eventually hm + · simpa only [ContinuousAt, Function.comp_def, zero_smul, add_zero] using hc.tendsto.comp hl' + +theorem norm_sq_axis_shift (x : Position) (a : Fin 3) (t : ℝ) : + ‖x+t • axis a‖^2 = ‖x‖^2 + 2*t*x a + t^2 := by + rw [norm_add_sq_real] + simp [axis, inner_smul_right, EuclideanSpace.inner_single_right, norm_smul, + Real.norm_eq_abs, sq_abs] + ring + +theorem second_deriv_quadratic_rpow {q b p : ℝ} (hq : 0 < q) : + deriv (deriv (fun t : ℝ => (q+2*t*b+t^2)^p)) 0 = + p*(p-1)*q^(p-2)*(2*b)^2 + 2*p*q^(p-1) := by + let Q : ℝ → ℝ := fun t => q+2*t*b+t^2 + have hQ (t : ℝ) : HasDerivAt Q (2*b+2*t) t := by + convert (((hasDerivAt_const t q).add + (((hasDerivAt_id t).const_mul 2).mul_const b)).add + ((hasDerivAt_id t).pow 2)) using 1 + all_goals first | rfl | norm_num [Q] + have hQ0 : Q 0 = q := by simp [Q] + have hQe : ∀ᶠ t in 𝓝 (0 : ℝ), Q t ≠ 0 := + (hQ 0).continuousAt.eventually_ne (by simpa [hQ0] using ne_of_gt hq) + have hder : deriv (fun t => Q t ^ p) =ᶠ[𝓝 0] + fun t => p*Q t^(p-1)*(2*b+2*t) := by + filter_upwards [hQe] with t ht + convert ((hQ t).rpow_const (Or.inl ht)).deriv using 1 + ring + rw [hder.deriv_eq] + have hh := (((hQ 0).rpow_const (p := p-1) + (Or.inl (by simpa [hQ0] using ne_of_gt hq))).const_mul p).mul + ((hasDerivAt_const 0 (2*b)).add ((hasDerivAt_id 0).const_mul 2)) + have hh' : HasDerivAt (fun t => p*Q t^(p-1)*(2*b+2*t)) + (p*((2*b)*(p-1)*q^(p-1-1))*(2*b)+p*q^(p-1)*2) 0 := by + convert hh using 1 + all_goals first | rfl | norm_num [Q] + rw [hh'.deriv] + rw [show p-1-1 = p-2 by ring] + ring + +def radialPower (p : ℝ) (x : Position) : ℝ := (‖x‖^2)^p + +theorem coordinateLaplacian_radialPower {x : Position} (hx : x ≠ 0) (p : ℝ) : + coordinateLaplacian (radialPower p) x = 2*p*(2*p+1)*(‖x‖^2)^(p-1) := by + have hx0 : 0 < ‖x‖^2 := sq_pos_of_pos (norm_pos_iff.mpr hx) + unfold coordinateLaplacian radialPower + conv_lhs => arg 2; ext a; arg 1; arg 1; ext t; rw [norm_sq_axis_shift] + simp only [second_deriv_quadratic_rpow hx0, Finset.sum_add_distrib, + Finset.sum_const, Finset.card_fin, nsmul_eq_mul] + have hpow : (‖x‖^2)^(p-2) * (‖x‖^2) = (‖x‖^2)^(p-1) := by + rw [← Real.rpow_add_one hx0.ne'] + congr 1 + ring + calc + _ = 4*p*(p-1)*(‖x‖^2)^(p-2)*(∑ a : Fin 3, (x a)^2) + + 6*p*(‖x‖^2)^(p-1) := by + rw [Finset.mul_sum] + congr 1 + · apply Finset.sum_congr rfl + intro a _ + ring + · norm_num + ring + _ = _ := by + rw [← EuclideanSpace.real_norm_sq_eq] + calc + _ = 4*p*(p-1)*((‖x‖^2)^(p-2) * ‖x‖^2) + + 6*p*(‖x‖^2)^(p-1) := by ring + _ = _ := by rw [hpow]; ring + +theorem deriv_affine_line {f : Position → ℝ} {x v : Position} {t : ℝ} + (hf : DifferentiableAt ℝ f (x+t • v)) : + deriv (fun u : ℝ => f (x+u • v)) t = fderiv ℝ f (x+t • v) v := by + have hl : HasDerivAt (fun u : ℝ => x+u • v) v t := by + simpa using ((hasDerivAt_id t).smul_const v).const_add x + exact (hf.hasFDerivAt.comp_hasDerivAt t hl).deriv + +theorem second_deriv_affine_line {f : Position → ℝ} {x v : Position} + (hf : ContDiffAt ℝ 2 f x) : + deriv (deriv (fun u : ℝ => f (x+u • v))) 0 = + fderiv ℝ (fun y => fderiv ℝ f y v) x v := by + have hl : Tendsto (fun u : ℝ => x+u • v) (𝓝 0) (𝓝 x) := by + simpa using (show ContinuousAt (fun u : ℝ => x+u • v) 0 by fun_prop).tendsto + have he : deriv (fun u : ℝ => f (x+u • v)) =ᶠ[𝓝 0] + fun u => fderiv ℝ f (x+u • v) v := by + filter_upwards [hl.eventually (hf.eventually (by norm_num))] with u hu + exact deriv_affine_line (hu.differentiableAt (by norm_num)) + rw [he.deriv_eq] + have hd : DifferentiableAt ℝ (fun y => fderiv ℝ f y v) x := + ((hf.fderiv_right (show (1 : WithTop ℕ∞)+1 ≤ 2 by norm_num)).clm_apply contDiffAt_const).differentiableAt_one + simpa using deriv_affine_line (x := x) (v := v) (t := 0) (by simpa using hd) + +theorem coordinateLaplacian_reflect (f : Position → ℝ) (x y : Position) : + coordinateLaplacian (fun z => f (x-z)) y = coordinateLaplacian f (x-y) := by + apply Finset.sum_congr rfl + intro a _ + have he : (fun t : ℝ => f (x-(y+t • axis a))) = + (fun t : ℝ => f ((x-y)+(-t) • axis a)) := by + ext t + congr 1 + module + rw [he] + let g : ℝ → ℝ := fun t => f ((x-y)+t • axis a) + change deriv (deriv (fun t => g (-t))) 0 = deriv (deriv g) 0 + have hd : deriv (fun t => g (-t)) = fun t => -deriv g (-t) := by + ext t + exact deriv_comp_neg g t + rw [hd] + change deriv (-(fun t => deriv g (-t))) 0 = _ + rw [deriv.neg, deriv_comp_neg] + simp + +open scoped Convolution +open ContinuousLinearMap + +def dirPartial (f : Position → ℝ) (v : Position) : Position → ℝ := + fun x => fderiv ℝ f x v + +theorem contDiff_partial {f : Position → ℝ} {n : WithTop ℕ∞} + (hf : ContDiff ℝ (n+1) f) (v : Position) : ContDiff ℝ n (dirPartial f v) := by + exact (hf.fderiv_right le_rfl).clm_apply contDiff_const + +theorem hasCompactSupport_partial {f : Position → ℝ} (hf : HasCompactSupport f) + (v : Position) : HasCompactSupport (dirPartial f v) := hf.fderiv_apply ℝ v + +theorem partial_convolution {f g : Position → ℝ} + (hf : LocallyIntegrable f volume) (hg : ContDiff ℝ 1 g) + (hcg : HasCompactSupport g) (x v : Position) : + dirPartial (f ⋆[lsmul ℝ ℝ, volume] g) v x = + (f ⋆[lsmul ℝ ℝ, volume] dirPartial g v) x := by + unfold dirPartial + rw [(hcg.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hf hg x).fderiv] + exact convolution_precompR_apply (lsmul ℝ ℝ) hf (hcg.fderiv ℝ) + (hg.continuous_fderiv (by norm_num)) x v + +theorem coordinateLaplacian_eq_partials {f : Position → ℝ} {x : Position} + (hf : ContDiffAt ℝ 2 f x) : + coordinateLaplacian f x = ∑ a : Fin 3, dirPartial (dirPartial f (axis a)) (axis a) x := by + apply Finset.sum_congr rfl + intro a _ + exact second_deriv_affine_line hf + +theorem coordinateLaplacian_convolution {f g : Position → ℝ} + (hf : LocallyIntegrable f volume) (hg : ContDiff ℝ 2 g) + (hcg : HasCompactSupport g) (x : Position) : + coordinateLaplacian (f ⋆[lsmul ℝ ℝ, volume] g) x = + ∫ y, f y * coordinateLaplacian g (x-y) := by + have hg1 : ContDiff ℝ 1 g := hg.of_le (by norm_num) + have hc : ContDiff ℝ 2 (f ⋆[lsmul ℝ ℝ, volume] g) := + hcg.contDiff_convolution_right (lsmul ℝ ℝ) hf hg + rw [coordinateLaplacian_eq_partials (hc.contDiffAt)] + have hpart (a : Fin 3) : dirPartial (f ⋆[lsmul ℝ ℝ, volume] g) (axis a) = + f ⋆[lsmul ℝ ℝ, volume] dirPartial g (axis a) := by + ext y + exact partial_convolution hf hg1 hcg y (axis a) + simp_rw [hpart] + have hgpart (a : Fin 3) : ContDiff ℝ 1 (dirPartial g (axis a)) := by + exact contDiff_partial hg (axis a) + simp_rw [partial_convolution hf (hgpart _) (hasCompactSupport_partial hcg _) x] + simp only [convolution_def, lsmul_apply, smul_eq_mul] + rw [← integral_finsetSum] + · apply integral_congr_ae + filter_upwards [] with y + rw [coordinateLaplacian_eq_partials hg.contDiffAt, Finset.mul_sum] + · intro a _ + have hs := hasCompactSupport_partial (hasCompactSupport_partial hcg (axis a)) (axis a) + have hd : Continuous (dirPartial (dirPartial g (axis a)) (axis a)) := by + exact ((hgpart a).continuous_fderiv (by norm_num)).clm_apply continuous_const + exact hs.convolutionExists_right (lsmul ℝ ℝ) hf hd x + +theorem dirPartial_sub {f g : Position → ℝ} (hf : Differentiable ℝ f) + (hg : Differentiable ℝ g) (v : Position) : + dirPartial (fun x => f x-g x) v = fun x => dirPartial f v x-dirPartial g v x := by + ext x + exact congrArg (fun T : Position →L[ℝ] ℝ => T v) (fderiv_sub (hf x) (hg x)) + +theorem coordinateLaplacian_sub {f g : Position → ℝ} + (hf : ContDiff ℝ 2 f) (hg : ContDiff ℝ 2 g) (x : Position) : + coordinateLaplacian (fun y => f y-g y) x = + coordinateLaplacian f x-coordinateLaplacian g x := by + rw [coordinateLaplacian_eq_partials (hf.sub hg).contDiffAt, + coordinateLaplacian_eq_partials hf.contDiffAt, coordinateLaplacian_eq_partials hg.contDiffAt, + ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro a _ + rw [dirPartial_sub (hf.differentiable (by norm_num)) (hg.differentiable (by norm_num))] + rw [dirPartial_sub ((contDiff_partial (n := 1) hf (axis a)).differentiable (by norm_num)) + ((contDiff_partial (n := 1) hg (axis a)).differentiable (by norm_num))] + +theorem coordinateLaplacian_quadratic (z x : Position) (c : ℝ) : + coordinateLaplacian (fun y => c*‖y-z‖^2) x = 6*c := by + unfold coordinateLaplacian + have he (a : Fin 3) : (fun t : ℝ => c*‖x+t • axis a-z‖^2) = + fun t : ℝ => c*(‖x-z‖^2+2*t*(x-z) a+t^2) := by + ext t + rw [show x+t • axis a-z = (x-z)+t • axis a by module, norm_sq_axis_shift] + simp_rw [he] + have hd (a : Fin 3) : deriv (fun t : ℝ => c*(‖x-z‖^2+2*t*(x-z) a+t^2)) = + fun t => c*(2*(x-z) a+2*t) := by + ext t + convert (((hasDerivAt_const t (‖x-z‖^2)).add + (((hasDerivAt_id t).const_mul 2).mul_const ((x-z) a))).add + ((hasDerivAt_id t).pow 2)).const_mul c |>.deriv using 1 + all_goals norm_num [id_eq, Pi.add_apply] + simp_rw [hd] + have hdd (a : Fin 3) : deriv (fun t : ℝ => c*(2*(x-z) a+2*t)) 0 = 2*c := by + convert (((hasDerivAt_const 0 (2*(x-z) a)).add + ((hasDerivAt_id 0).const_mul 2)).const_mul c).deriv using 1 + all_goals norm_num [id_eq, Pi.add_apply] + ring + simp_rw [hdd] + simp + ring + +def WeakLaplacianLower (f : Position → ℝ) (U : Set Position) (c : ℝ) : Prop := + ∀ φ : Position → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + tsupport φ ⊆ U → (∀ x, 0 ≤ φ x) → + c*(∫ x, φ x) ≤ ∫ x, f x*coordinateLaplacian φ x + +theorem normed_bump_reflect_tsupport (φ : ContDiffBump (0 : Position)) (x : Position) : + tsupport (fun y => φ.normed volume (x-y)) ⊆ Metric.closedBall x φ.rOut := by + apply closure_minimal _ Metric.isClosed_closedBall + intro y hy + have hy' : x-y ∈ Function.support (φ.normed volume) := hy + rw [φ.support_normed_eq] at hy' + have hh : ‖x-y‖ < φ.rOut := by simpa using hy' + simpa only [Metric.mem_closedBall, dist_eq_norm_sub'] using hh.le + +theorem continuous_convolution_comm (f g : Position → ℝ) : + f ⋆[lsmul ℝ ℝ, volume] g = g ⋆[lsmul ℝ ℝ, volume] f := by + ext x + rw [convolution_eq_swap] + apply integral_congr_ae + filter_upwards [] with y + exact mul_comm _ _ + +theorem weakLaplacianLower_mollify {f : Position → ℝ} {U : Set Position} {c : ℝ} + (hf : LocallyIntegrable f volume) (hw : WeakLaplacianLower f U c) + (φ : ContDiffBump (0 : Position)) {x : Position} + (hx : Metric.closedBall x φ.rOut ⊆ U) : + c ≤ coordinateLaplacian (f ⋆[lsmul ℝ ℝ, volume] φ.normed volume) x := by + have ht := normed_bump_reflect_tsupport φ x + have hc : HasCompactSupport (fun y => φ.normed volume (x-y)) := + (isCompact_closedBall x φ.rOut).of_isClosed_subset (isClosed_tsupport _) ht + have hs : ContDiff ℝ ∞ (fun y => φ.normed volume (x-y)) := + φ.contDiff_normed.comp (contDiff_const.sub contDiff_id) + have hb := hw _ hs hc (ht.trans hx) (fun y => φ.nonneg_normed _) + rw [integral_sub_left_eq_self, φ.integral_normed, mul_one] at hb + rw [coordinateLaplacian_convolution hf φ.contDiff_normed φ.hasCompactSupport_normed] + simpa only [coordinateLaplacian_reflect] using hb + +theorem integrable_normed_bump_reflect (φ : ContDiffBump (0 : Position)) (x : Position) : + Integrable (fun y => φ.normed volume (x-y)) := by + have hc : HasCompactSupport (fun y => φ.normed volume (x-y)) := + (isCompact_closedBall x φ.rOut).of_isClosed_subset (isClosed_tsupport _) + (normed_bump_reflect_tsupport φ x) + exact (φ.continuous_normed.comp (continuous_const.sub continuous_id)).integrable_of_hasCompactSupport hc + +theorem mollify_le_of_bound {f : Position → ℝ} {U : Set Position} {a : ℝ} + (hf : LocallyIntegrable f volume) (hbound : ∀ y ∈ U, f y ≤ a) + (φ : ContDiffBump (0 : Position)) {x : Position} + (hx : Metric.closedBall x φ.rOut ⊆ U) : + (f ⋆[lsmul ℝ ℝ, volume] φ.normed volume) x ≤ a := by + have hi := (φ.hasCompactSupport_normed (μ := volume)).convolutionExists_right (lsmul ℝ ℝ) hf + φ.continuous_normed x + calc + _ ≤ ∫ y, a*φ.normed volume (x-y) := by + apply integral_mono hi ((integrable_normed_bump_reflect φ x).const_mul a) + intro y + by_cases hy : φ.normed volume (x-y) = 0 + · simp [hy] + · have hm : y ∈ tsupport (fun y => φ.normed volume (x-y)) := subset_closure hy + exact mul_le_mul_of_nonneg_right + (hbound y (hx (normed_bump_reflect_tsupport φ x hm))) (φ.nonneg_normed _) + _ = a := by rw [integral_const_mul, integral_sub_left_eq_self, φ.integral_normed, mul_one] + +theorem no_maximum_of_strict_weakLaplacian {f : Position → ℝ} {o : Position} {R c : ℝ} + (hf : Continuous f) (hR : 0 < R) (hc : 0 < c) + (hw : WeakLaplacianLower f (Metric.ball o R) c) + (hmax : ∀ y ∈ Metric.ball o R, f y ≤ f o) : False := by + let r := R/2 + let η := c/12 + let κ := η*r^2/2 + have hr : 0 < r := by dsimp [r]; positivity + have hη : 0 < η := by dsimp [η]; positivity + have hκ : 0 < κ := by dsimp [κ]; positivity + have he : ∀ᶠ y in 𝓝 o, dist (f y) (f o) < κ := + hf.continuousAt.eventually (Metric.ball_mem_nhds _ hκ) + obtain ⟨d, hd, hfd⟩ := Metric.mem_nhds_iff.mp he + let e := min (R/4) (d/2) + have hep : 0 < e := by dsimp [e]; positivity + let φ : ContDiffBump (0 : Position) := ⟨e/2, e, by positivity, by linarith⟩ + have hφR : φ.rOut ≤ R/4 := min_le_left _ _ + have hφd : φ.rOut < d := lt_of_le_of_lt (min_le_right _ _) (by linarith) + let u := f ⋆[lsmul ℝ ℝ, volume] φ.normed volume + have hu : ContDiff ℝ 2 u := φ.hasCompactSupport_normed.contDiff_convolution_right + (lsmul ℝ ℝ) hf.locallyIntegrable φ.contDiff_normed + have hcenter : f o-κ ≤ u o := by + have hh := φ.dist_normed_convolution_le (μ := volume) (g := f) (x₀ := o) hf.aestronglyMeasurable (fun y hy => + (hfd (lt_trans hy hφd)).le) + rw [continuous_convolution_comm] at hh + rw [Real.dist_eq] at hh + exact sub_le_iff_le_add.mpr (by linarith [(abs_le.mp hh).1]) + have hinside {x : Position} (hx : x ∈ Metric.closedBall o r) : + Metric.closedBall x φ.rOut ⊆ Metric.ball o R := by + intro y hy + apply lt_of_le_of_lt (dist_triangle y x o) + have hxy : dist y x ≤ φ.rOut := hy + have hxo : dist x o ≤ r := hx + dsimp [r] at hxo + linarith + have hub {x : Position} (hx : x ∈ Metric.closedBall o r) : u x ≤ f o := + mollify_le_of_bound hf.locallyIntegrable hmax φ (hinside hx) + let v : Position → ℝ := fun x => u x-η*‖x-o‖^2 + have hq : ContDiff ℝ 2 (fun y : Position => η*‖y-o‖^2) := + contDiff_const.mul ((contDiff_id.sub contDiff_const).norm_sq ℝ) + have hv : ContDiff ℝ 2 v := hu.sub hq + obtain ⟨x, hx, hxm⟩ := (isCompact_closedBall o r).exists_isMaxOn + ⟨o, Metric.mem_closedBall_self hr.le⟩ hv.continuous.continuousOn + have hvcenter : f o-η*r^2 < v o := by + dsimp [v] + simp only [sub_self, norm_zero, zero_pow (by decide : 2 ≠ 0), mul_zero, sub_zero] + dsimp [κ] at hcenter + nlinarith [sq_pos_of_pos hr] + have hxi : x ∈ Metric.ball o r := by + by_contra hn + have hdist : ‖x-o‖ = r := by + apply le_antisymm + · exact hx + · exact le_of_not_gt hn + have hvb : v x ≤ f o-η*r^2 := by dsimp [v]; rw [hdist]; linarith [hub hx] + have hcx : v o ≤ v x := hxm (Metric.mem_closedBall_self hr.le) + linarith + have hlmax : IsLocalMax v x := hxm.isLocalMax + (Filter.mem_of_superset (Metric.isOpen_ball.mem_nhds hxi) Metric.ball_subset_closedBall) + have hl := coordinateLaplacian_nonpos_of_local_max hlmax hv.continuous.continuousAt + have hp := weakLaplacianLower_mollify hf.locallyIntegrable hw φ (hinside hx) + change coordinateLaplacian (fun y => u y-η*‖y-o‖^2) x ≤ 0 at hl + rw [coordinateLaplacian_sub hu hq, coordinateLaplacian_quadratic] at hl + change c ≤ coordinateLaplacian u x at hp + dsimp [η] at hl + linarith + +theorem coordinateLaplacian_congr_nhds {f g : Position → ℝ} {x : Position} + (h : f =ᶠ[𝓝 x] g) : coordinateLaplacian f x = coordinateLaplacian g x := by + apply Finset.sum_congr rfl + intro a _ + have ht : Tendsto (fun t : ℝ => x+t • axis a) (𝓝 0) (𝓝 x) := by + simpa using (show ContinuousAt (fun t : ℝ => x+t • axis a) 0 by fun_prop).tendsto + have he : (fun t : ℝ => f (x+t • axis a)) =ᶠ[𝓝 0] + (fun t : ℝ => g (x+t • axis a)) := ht.eventually h + exact he.deriv.deriv_eq + +theorem coordinateLaplacian_zero (x : Position) : + coordinateLaplacian (fun _ => (0 : ℝ)) x = 0 := by + simp [coordinateLaplacian] + +theorem coordinateLaplacian_eq_zero_of_notMem_tsupport {f : Position → ℝ} {x : Position} + (h : x ∉ tsupport f) : coordinateLaplacian f x = 0 := by + rw [coordinateLaplacian_congr_nhds (notMem_tsupport_iff_eventuallyEq.mp h)] + exact coordinateLaplacian_zero x + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/ConfigurationDensity.lean b/lean/OAI/Analysis/CoulombRadii/Variational/ConfigurationDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..fec2386bbe7142de42312bbe40462615157f6679 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/ConfigurationDensity.lean @@ -0,0 +1,400 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Model + +namespace OAI + +section +section +noncomputable section + +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff + +namespace NeutralAtom + +theorem largeCharge_eq_atTop (m : ℕ) : largeCharge m = atTop := by + apply inf_eq_left.mpr + apply Filter.le_principal_iff.mpr + filter_upwards [eventually_ge_atTop m] with N hN + omega + +theorem bTF_pos : 0 < bTF := by + unfold bTF + apply Real.rpow_pos_of_pos + positivity + +theorem density_nonneg {N : ℕ} (ψ : Wavefunction (N + 1)) (x : Position) : + 0 ≤ density ψ x := by + unfold density + apply mul_nonneg (by positivity) + exact Finset.sum_nonneg fun σ _ => integral_nonneg fun y => sq_nonneg _ + +theorem exteriorMass_nonneg {N : ℕ} (ψ : Wavefunction (N + 1)) (r : ℝ) : + 0 ≤ exteriorMass ψ r := + integral_nonneg fun x => density_nonneg ψ x + +theorem radius_nonneg {N : ℕ} (ψ : Wavefunction (N + 1)) (m : ℕ) : + 0 ≤ radius ψ m := by + apply Real.sInf_nonneg + intro r hr + exact hr.1 + +theorem integrable_cons {N : ℕ} {f : Configuration (N + 1) → ℝ} + (hf : Integrable f) : + Integrable (fun p : Position × Configuration N => f (Fin.cons p.1 p.2)) := by + let e := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (N + 1) => Position) 0 + have he := (volume_preserving_piFinSuccAbove + (fun _ : Fin (N + 1) => Position) 0).symm e + have hh := (he.integrable_comp_emb e.symm.measurableEmbedding).2 hf + simpa [e, Function.comp_def, MeasurableEquiv.piFinSuccAbove_symm_apply, + Fin.insertNthEquiv, Fin.insertNth_zero] using hh + +theorem integral_cons {N : ℕ} {f : Configuration (N + 1) → ℝ} + (hf : Integrable f) : + (∫ x : Position, ∫ y : Configuration N, f (Fin.cons x y)) = ∫ z, f z := by + rw [← integral_prod _ (integrable_cons hf)] + let e := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (N + 1) => Position) 0 + have he := (volume_preserving_piFinSuccAbove + (fun _ : Fin (N + 1) => Position) 0).symm e + have hh := he.integral_comp' f + simpa [MeasureTheory.Measure.volume_eq_prod, e, MeasurableEquiv.piFinSuccAbove_symm_apply, + Fin.insertNthEquiv, Fin.insertNth_zero] using hh + +theorem integrable_density {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) : Integrable (density ψ) := by + apply Integrable.const_mul + apply integrable_finsetSum + intro σ _ + exact (integrable_cons (hψ σ).norm.integrable_sq).integral_prod_left + +theorem integral_density {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) : + (∫ x, density ψ x) = (N + 1 : ℝ) * normSquared ψ := by + unfold density normSquared + rw [integral_const_mul, integral_finsetSum] + · congr 1 + apply Finset.sum_congr rfl + intro σ _ + exact integral_cons (hψ σ).norm.integrable_sq + · intro σ _ + exact (integrable_cons (hψ σ).norm.integrable_sq).integral_prod_left + +theorem groundState_integral_density {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : IsNormalizedGroundState (N + 1) ψ) : + (∫ x, density ψ x) = N + 1 := by + obtain ⟨g, hg, hn, _⟩ := hψ + rw [integral_density hg.2.2.1, hn, mul_one] + +theorem exteriorMass_antitone {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) : Antitone (exteriorMass ψ) := by + intro r s hrs + apply setIntegral_mono_set (integrable_density hψ).integrableOn + · exact Filter.Eventually.of_forall (fun x => density_nonneg ψ x) + · exact Filter.Eventually.of_forall (fun x hx => lt_of_le_of_lt hrs hx) + +theorem exteriorMass_tendsto_zero {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) : + Tendsto (exteriorMass ψ) atTop (𝓝 0) := by + have hs : (⋂ r : ℝ, {x : Position | r < ‖x‖}) = ∅ := by + ext x + simp only [Set.mem_iInter, Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false] + intro hx + exact lt_irrefl ‖x‖ (hx ‖x‖) + have ht := tendsto_setIntegral_of_antitone + (f := density ψ) (s := fun r : ℝ => {x : Position | r < ‖x‖}) + (fun _ => measurableSet_lt measurable_const continuous_norm.measurable) + (fun _ _ hrs _ hx => lt_of_le_of_lt hrs hx) + ⟨0, (integrable_density hψ).integrableOn⟩ + change Tendsto (fun r : ℝ => ∫ x in {x : Position | r < ‖x‖}, density ψ x) + atTop (𝓝 0) + simpa [hs] using ht + +theorem radius_set_nonempty {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {m : ℕ} (hm : 0 < m) : + {r : ℝ | 0 ≤ r ∧ exteriorMass ψ r ≤ (m : ℝ)}.Nonempty := by + have hm' : (0 : ℝ) < m := by exact_mod_cast hm + have he := (exteriorMass_tendsto_zero hψ).eventually (gt_mem_nhds hm') + obtain ⟨r, hr, hmr⟩ := ((eventually_ge_atTop (0 : ℝ)).and he).exists + exact ⟨r, hr, hmr.le⟩ + +theorem radius_bracket {N : ℕ} {ψ : Wavefunction (N + 1)} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) {m : ℕ} {l u : ℝ} + (hl : (m : ℝ) < exteriorMass ψ l) (hu0 : 0 ≤ u) + (hu : exteriorMass ψ u ≤ (m : ℝ)) : + l ≤ radius ψ m ∧ radius ψ m ≤ u := by + unfold radius + constructor + · apply le_csInf (s := {r : ℝ | 0 ≤ r ∧ exteriorMass ψ r ≤ (m : ℝ)}) ⟨u, hu0, hu⟩ + intro r hr + by_contra! hrl + have hh := exteriorMass_antitone hψ hrl.le + exact (not_le_of_gt hl) (hh.trans hr.2) + · apply csInf_le ⟨0, fun r hr => hr.1⟩ + exact ⟨hu0, hu⟩ + +theorem scaled_ereal_bounds {c l u : ℝ} {x : EReal} (hc : 0 < c) + (hl : ((l / c : ℝ) : EReal) ≤ x) (hu : x ≤ ((u / c : ℝ) : EReal)) : + (l : EReal) ≤ (c : EReal) * x ∧ (c : EReal) * x ≤ (u : EReal) := by + have hxt : x ≠ ⊤ := ne_of_lt (hu.trans_lt (EReal.coe_lt_top _)) + have hxb : x ≠ ⊥ := ne_of_gt ((EReal.bot_lt_coe _).trans_le hl) + lift x to ℝ using ⟨hxt, hxb⟩ with x + rw [← EReal.coe_mul] + norm_cast at hl hu ⊢ + constructor + · simpa [mul_comm] using (div_le_iff₀ hc).mp hl + · simpa [mul_comm] using (le_div_iff₀ hc).mp hu + +theorem inner_limits_bracket (Ψ : ∀ N : ℕ, Wavefunction (N + 1)) + {m : ℕ} {c l u : ℝ} (hc : 0 < c) + (h : ∀ᶠ N in atTop, l ≤ c * radius (Ψ N) m ∧ c * radius (Ψ N) m ≤ u) : + ((l : EReal) ≤ (c : EReal) * lowerRadius Ψ m ∧ + (c : EReal) * lowerRadius Ψ m ≤ (u : EReal)) ∧ + ((l : EReal) ≤ (c : EReal) * upperRadius Ψ m ∧ + (c : EReal) * upperRadius Ψ m ≤ (u : EReal)) := by + have hlow : ((l / c : ℝ) : EReal) ≤ lowerRadius Ψ m := by + unfold lowerRadius + rw [largeCharge_eq_atTop] + refine le_liminf_of_le (h := ?_) + filter_upwards [h] with N hN + exact EReal.coe_le_coe_iff.mpr ((div_le_iff₀ hc).mpr (by simpa [mul_comm] using hN.1)) + have hupp : upperRadius Ψ m ≤ ((u / c : ℝ) : EReal) := by + unfold upperRadius + rw [largeCharge_eq_atTop] + refine limsup_le_of_le (h := ?_) + filter_upwards [h] with N hN + exact EReal.coe_le_coe_iff.mpr ((le_div_iff₀ hc).mpr (by simpa [mul_comm] using hN.2)) + have hlu : lowerRadius Ψ m ≤ upperRadius Ψ m := by + unfold lowerRadius upperRadius + rw [largeCharge_eq_atTop] + exact liminf_le_limsup + exact ⟨scaled_ereal_bounds hc hlow (hlu.trans hupp), + scaled_ereal_bounds hc (hlow.trans hlu) hupp⟩ + +theorem tendsto_ereal_of_eventual_brackets {α : Type*} {f : Filter α} + {v : α → EReal} {b : ℝ} (hb : 0 < b) + (h : ∀ l u : ℝ, 0 < l → l < b → b < u → + ∀ᶠ a in f, (l : EReal) ≤ v a ∧ v a ≤ (u : EReal)) : + Tendsto v f (𝓝 (b : EReal)) := by + apply tendsto_order.mpr + constructor + · intro a ha + obtain ⟨l, hal, hlb⟩ := EReal.exists_between_coe_real ha + have hmax : max l (b / 2) < b := max_lt (EReal.coe_lt_coe_iff.mp hlb) (by linarith) + have hpos : 0 < max l (b / 2) := lt_of_lt_of_le (by linarith) (le_max_right _ _) + filter_upwards [h (max l (b / 2)) (b + 1) hpos hmax (by linarith)] with i hi + exact (hal.trans_le (EReal.coe_le_coe_iff.mpr (le_max_left _ _))).trans_le hi.1 + · intro a ha + obtain ⟨u, hbu, hua⟩ := EReal.exists_between_coe_real ha + filter_upwards [h (b / 2) u (by linarith) (by linarith) + (EReal.coe_lt_coe_iff.mp hbu)] with i hi + exact hi.2.trans_lt hua + +theorem iterated_limits_of_radius_brackets (Ψ : ∀ N : ℕ, Wavefunction (N + 1)) + (h : ∀ l u : ℝ, 0 < l → l < bTF → bTF < u → + ∀ᶠ m : ℕ in atTop, ∀ᶠ N : ℕ in atTop, + l ≤ (m : ℝ) ^ (1 / 3 : ℝ) * radius (Ψ N) m ∧ + (m : ℝ) ^ (1 / 3 : ℝ) * radius (Ψ N) m ≤ u) : + Tendsto (fun m : ℕ => (((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) : EReal) * upperRadius Ψ m) + atTop (𝓝 (bTF : EReal)) ∧ + Tendsto (fun m : ℕ => (((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) : EReal) * lowerRadius Ψ m) + atTop (𝓝 (bTF : EReal)) := by + have hb : ∀ l u : ℝ, 0 < l → l < bTF → bTF < u → + ∀ᶠ m : ℕ in atTop, + (((l : EReal) ≤ ((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) * lowerRadius Ψ m ∧ + ((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) * lowerRadius Ψ m ≤ (u : EReal)) ∧ + ((l : EReal) ≤ ((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) * upperRadius Ψ m ∧ + ((m : ℝ) ^ (1 / 3 : ℝ) : ℝ) * upperRadius Ψ m ≤ (u : EReal))) := by + intro l u hl hlb hbu + filter_upwards [h l u hl hlb hbu, eventually_gt_atTop (0 : ℕ)] with m hm hp + apply inner_limits_bracket Ψ (Real.rpow_pos_of_pos (by exact_mod_cast hp) _) hm + constructor + · apply tendsto_ereal_of_eventual_brackets bTF_pos + intro l u hl hlb hbu + exact (hb l u hl hlb hbu).mono fun _ hi => hi.2 + · apply tendsto_ereal_of_eventual_brackets bTF_pos + intro l u hl hlb hbu + exact (hb l u hl hlb hbu).mono fun _ hi => hi.1 + +theorem inverse_comparison_inversion {t v cap low high error : ℝ} + (ht : 0 ≤ t) (hlow : 0 < low) (hlh : low < high) + (herror : 0 ≤ error) (hcap : v ≤ cap) (hhigh : cap + error < high) + (hcomp : ∀ h : ℝ, low ≤ h → h ≤ high → + (h < t → h - error ≤ v) ∧ (t < h → v ≤ h + error)) : + t < high ∧ + (low < t → |t - max v 0| ≤ error) ∧ + (t ≤ low → max v 0 ≤ low + error) ∧ + |t - max v 0| ≤ low + error := by + have hth : t < high := by + by_contra! hh + obtain ⟨h, h1, h2⟩ := exists_between (max_lt hlh hhigh) + have hlo : low < h := (le_max_left _ _).trans_lt h1 + have hc : cap + error < h := (le_max_right _ _).trans_lt h1 + have hhcomp := (hcomp h hlo.le h2.le).1 (h2.trans_le hh) + linarith + have hinterior : low < t → |t - max v 0| ≤ error := by + intro hlt + have hvlo : t - error ≤ v := by + by_contra! hv + obtain ⟨h, h1, h2⟩ := exists_between + (show max low (v + error) < t from max_lt hlt (by linarith)) + have hlo : low < h := (le_max_left _ _).trans_lt h1 + have hc : v + error < h := (le_max_right _ _).trans_lt h1 + have hhcomp := (hcomp h hlo.le (h2.trans hth).le).1 h2 + linarith + have hvhi : v ≤ t + error := by + by_contra! hv + obtain ⟨h, h1, h2⟩ := exists_between + (show t < min high (v - error) from lt_min hth (by linarith)) + have hhi : h < high := h2.trans_le (min_le_left _ _) + have hc : h < v - error := h2.trans_le (min_le_right _ _) + have hhcomp := (hcomp h (hlt.trans h1).le hhi.le).2 h1 + linarith + rw [abs_le] + have hmaxhi : max v 0 ≤ t + error := max_le hvhi (by linarith) + have hmaxlo : t - error ≤ max v 0 := hvlo.trans (le_max_left _ _) + constructor <;> linarith + have hfloor : t ≤ low → max v 0 ≤ low + error := by + intro htl + apply max_le _ (by linarith) + by_contra! hv + obtain ⟨h, h1, h2⟩ := exists_between + (show low < min high (v - error) from lt_min hlh (by linarith)) + have hhi : h < high := h2.trans_le (min_le_left _ _) + have hc : h < v - error := h2.trans_le (min_le_right _ _) + have hhcomp := (hcomp h h1.le hhi.le).2 (htl.trans_lt h1) + linarith + refine ⟨hth, hinterior, hfloor, ?_⟩ + by_cases hlt : low < t + · exact (hinterior hlt).trans (by linarith) + · have htl : t ≤ low := le_of_not_gt hlt + have hv := hfloor htl + have hp := le_max_right v (0 : ℝ) + rw [abs_le] + constructor <;> linarith + +theorem uniform_threshold_of_sequential {X : ℕ → Type*} + (P : ∀ N, X N → Prop) (Zmin : ℕ → ℕ) (f : ℕ → ∀ N : ℕ, X N → ℝ) (c : ℝ) + (hseq : ∀ (m Z : ℕ → ℕ), StrictMono m → (∀ n, Zmin (m n) ≤ Z n) → + ∀ x : ∀ n, X (Z n), (∀ n, P (Z n) (x n)) → + Tendsto (fun n => f (m n) (Z n) (x n)) atTop (𝓝 c)) : + ∀ ε : ℝ, 0 < ε → ∀ᶠ m : ℕ in atTop, + ∀ N, Zmin m ≤ N → ∀ x : X N, P N x → |f m N x - c| < ε := by + classical + intro ε hε + by_contra hnot + have hbad := frequently_atTop.mp (not_eventually.mp hnot) + obtain ⟨m, hm, hfail⟩ := Nat.exists_strictMono_subsequence (by + intro M + obtain ⟨n, hn, hbadn⟩ := hbad (M + 1) + exact ⟨n, by omega, hbadn⟩) + have hchoose : ∀ n, ∃ N, Zmin (m n) ≤ N ∧ + ∃ x : X N, P N x ∧ ε ≤ |f (m n) N x - c| := by + intro n + simpa only [not_forall, Classical.not_imp, not_lt, exists_prop] using hfail n + choose Z hZ x hx hεx using hchoose + have ht := hseq m Z hm hZ x hx + obtain ⟨n, hn⟩ := ((Metric.tendsto_nhds.mp ht) ε hε).exists + exact (not_lt_of_ge (hεx n)) (by simpa only [Real.dist_eq] using hn) + +theorem cube_root_cube (m : ℕ) : ((m : ℝ) ^ (1 / 3 : ℝ)) ^ (3 : ℕ) = m := by + simpa only [one_div, Nat.cast_ofNat] using + Real.rpow_inv_natCast_pow (x := (m : ℝ)) (n := 3) (by positivity) (by decide) + +theorem bTF_cube : bTF ^ (3 : ℕ) = 81 * Real.pi ^ 2 / 2 := by + unfold bTF + simpa only [one_div, Nat.cast_ofNat] using + Real.rpow_inv_natCast_pow (x := 81 * Real.pi ^ 2 / 2) (n := 3) + (by positivity) (by decide) + +theorem normalized_tail_scale (m : ℕ) (T : ℝ → ℝ) (a : ℝ) : + ((m : ℝ) ^ (-(1 / 3 : ℝ))) ^ (3 : ℕ) * T (a * (m : ℝ) ^ (-(1 / 3 : ℝ))) = + T (a / (m : ℝ) ^ (1 / 3 : ℝ)) / m := by + rw [Real.rpow_neg (by positivity), inv_pow, cube_root_cube] + simp only [div_eq_mul_inv, mul_comm] + +theorem inverse_comparison_fixed_accuracy {k cap high ε : ℝ} + (hk : 0 < k) (hhigh : 0 < high) (hcap : cap + 1 < high) (hε : 0 < ε) : + ∃ low error : ℝ, 0 < low ∧ low < high ∧ 0 < error ∧ error < low / 16 ∧ + error < 1 ∧ ∀ t v : ℝ, 0 ≤ t → v ≤ cap → + (∀ h : ℝ, low ≤ h → h ≤ high → + (h < t → h - error ≤ v) ∧ (t < h → v ≤ h + error)) → + k * |t ^ (3 / 2 : ℝ) - (max v 0) ^ (3 / 2 : ℝ)| < ε := by + have hcont := (isCompact_Icc : IsCompact (Set.Icc (0 : ℝ) high)).uniformContinuousOn_of_continuous + (Real.continuous_rpow_const (q := (3 / 2 : ℝ)) (by norm_num)).continuousOn + obtain ⟨δ, hδ, hδcont⟩ := Metric.uniformContinuousOn_iff.mp hcont (ε / k) (by positivity) + let low := min (high / 2) (δ / 4) + let error := min (low / 32) (min (1 / 2) (δ / 4)) + have hlpos : 0 < low := lt_min (by positivity) (by positivity) + have hlhi : low < high := (min_le_left _ _).trans_lt (by linarith) + have hld : low ≤ δ / 4 := min_le_right _ _ + have hepos : 0 < error := lt_min (by positivity) (lt_min (by norm_num) (by positivity)) + have hel : error < low / 16 := (min_le_left _ _).trans_lt (by linarith) + have heone : error < 1 := ((min_le_right _ _).trans (min_le_left _ _)).trans_lt (by norm_num) + have hed : error ≤ δ / 4 := (min_le_right _ _).trans (min_le_right _ _) + refine ⟨low, error, hlpos, hlhi, hepos, hel, heone, ?_⟩ + intro t v ht hv hcomp + have hinv := inverse_comparison_inversion ht hlpos hlhi hepos.le hv (by linarith) hcomp + have htmem : t ∈ Set.Icc (0 : ℝ) high := ⟨ht, hinv.1.le⟩ + have hvmem : max v 0 ∈ Set.Icc (0 : ℝ) high := + ⟨le_max_right _ _, max_le (hv.trans (by linarith)) hhigh.le⟩ + have hdist : dist t (max v 0) < δ := by + rw [Real.dist_eq] + exact hinv.2.2.2.trans_lt (by linarith) + have hp := hδcont t htmem (max v 0) hvmem hdist + rw [Real.dist_eq] at hp + have hh := (lt_div_iff₀ hk).mp hp + simpa only [mul_comm] using hh + +def configurationDensity {n : ℕ} (ψ : Wavefunction n) (x : Configuration n) : ℝ := + ∑ σ : Spins n, ‖ψ σ x‖ ^ 2 + +def rawExpectation {n : ℕ} (ψ : Wavefunction n) (F : Configuration n → ℝ) : ℝ := + ∫ x : Configuration n, F x * configurationDensity ψ x + +def rawCount {n : ℕ} (S : Set Position) (x : Configuration n) : ℝ := + ∑ i : Fin n, S.indicator (fun _ => (1 : ℝ)) (x i) + +theorem configurationDensity_nonneg {n : ℕ} (ψ : Wavefunction n) (x : Configuration n) : + 0 ≤ configurationDensity ψ x := Finset.sum_nonneg fun _ _ => sq_nonneg _ + +theorem integrable_configurationDensity {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) : Integrable (configurationDensity ψ) := + integrable_finsetSum _ fun σ _ => (hψ σ).norm.integrable_sq + +theorem integral_configurationDensity {n : ℕ} {ψ : Wavefunction n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) : + (∫ x, configurationDensity ψ x) = normSquared ψ := by + exact integral_finsetSum _ fun σ _ => (hψ σ).norm.integrable_sq + +theorem piCongrLeft_perm {ι α : Type*} (p : Equiv.Perm ι) (x : ι → α) : + Equiv.piCongrLeft (fun _ : ι => α) p.symm x = x ∘ p := by + funext i + simp [Equiv.piCongrLeft_apply] + +theorem configurationDensity_perm {n : ℕ} {ψ : Wavefunction n} + (hψ : IsAntisymmetric ψ) (p : Equiv.Perm (Fin n)) : + (fun x : Configuration n => configurationDensity ψ (x ∘ p)) =ᵐ[volume] + configurationDensity ψ := by + have hsign : ‖(((Equiv.Perm.sign p : ℤ) : ℂ))‖ = 1 := by + rcases Int.units_eq_one_or (Equiv.Perm.sign p) with hp | hp <;> simp [hp] + have ha : ∀ᵐ x : Configuration n ∂volume, ∀ σ : Spins n, + ψ (σ ∘ p) (x ∘ p) = (((Equiv.Perm.sign p : ℤ) : ℂ)) * ψ σ x := + (ae_all_iff).mpr (hψ p) + filter_upwards [ha] with x hx + unfold configurationDensity + have hsum := (Equiv.piCongrLeft (fun _ : Fin n => Fin 2) p.symm).sum_comp + (fun σ : Spins n => ‖ψ σ (x ∘ p)‖ ^ 2) + have hh : (∑ σ : Spins n, ‖ψ (σ ∘ p) (x ∘ p)‖ ^ 2) = + ∑ σ : Spins n, ‖ψ σ (x ∘ p)‖ ^ 2 := by + simpa only [piCongrLeft_perm] using hsum + rw [← hh] + apply Finset.sum_congr rfl + intro σ _ + rw [hx σ, norm_mul, hsign, one_mul] + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/ConfigurationSplit.lean b/lean/OAI/Analysis/CoulombRadii/Variational/ConfigurationSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..11b6638f5f44c4319c090cfb0e023e7d23feea08 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/ConfigurationSplit.lean @@ -0,0 +1,433 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.SpectralTheory.BindingBump + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +def configurationSplit (n : ℕ) : Configuration (n+1) ≃L[ℝ] Position × Configuration n := + (Fin.consEquivL ℝ (fun _ : Fin (n+1) => Position)).symm + +@[simp] theorem configurationSplit_apply (n : ℕ) (x : Configuration (n+1)) : + configurationSplit n x = (x 0, fun i => x i.succ) := rfl + + theorem configurationSplit_preserving (n : ℕ) : MeasurePreserving (configurationSplit n) := by + have h := volume_preserving_piFinSuccAbove (fun _ : Fin (n+1) => Position) 0 + convert h using 1 + funext x + change (x 0, fun i => x i.succ) = (x 0, fun i => x (Fin.succAbove 0 i)) + simp only [Fin.succAbove_zero] + +def configurationPerm {n : ℕ} (p : Equiv.Perm (Fin n)) : Configuration n ≃L[ℝ] Configuration n := + (ContinuousLinearEquiv.piCongrLeft ℝ (fun _ : Fin n => Position) p).symm + +@[simp] theorem configurationPerm_apply {n : ℕ} (p : Equiv.Perm (Fin n)) (x : Configuration n) : + configurationPerm p x = x ∘ p := rfl + + theorem configurationPerm_preserving {n : ℕ} (p : Equiv.Perm (Fin n)) : + MeasurePreserving (configurationPerm p) := + (volume_measurePreserving_piCongrLeft (fun _ : Fin n => Position) p).symm + (MeasurableEquiv.piCongrLeft (fun _ : Fin n => Position) p) + +@[simp] theorem configurationPerm_direction {n : ℕ} (p : Equiv.Perm (Fin n)) + (i : Fin n) (a : Fin 3) : + configurationPerm p (coordinateDirection i a) = coordinateDirection (p.symm i) a := by + ext j b + by_cases hj : j = p.symm i + · subst j; simp [coordinateDirection] + · have hp : p j ≠ i := fun h => hj (p.injective (by simpa using h)) + simp [coordinateDirection, hj, hp] + + theorem configurationPerm_symm_direction {n : ℕ} (p : Equiv.Perm (Fin n)) + (i : Fin n) (a : Fin 3) : + (configurationPerm p).symm (coordinateDirection (p.symm i) a) = coordinateDirection i a := by + rw [← configurationPerm_direction, ContinuousLinearEquiv.symm_apply_apply] + + def permuteWavefunction {n : ℕ} (p : Equiv.Perm (Fin n)) (ψ : Wavefunction n) : Wavefunction n := + fun σ x => ψ (σ ∘ p) (x ∘ p) + + def permuteGradient {n : ℕ} (p : Equiv.Perm (Fin n)) (g : Gradient n) : Gradient n := + fun σ i a x => g (σ ∘ p) (p.symm i) a (x ∘ p) + + theorem HasWeakGradient.permute {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : HasWeakGradient ψ g) (p : Equiv.Perm (Fin n)) : + HasWeakGradient (permuteWavefunction p ψ) (permuteGradient p g) := by + intro σ i a φ hφ hφc + have hd : WeakDirectionalDerivative (ψ (σ ∘ p)) (g (σ ∘ p) (p.symm i) a) + (coordinateDirection (p.symm i) a) := by + intro η hη hηc + simpa only [Complex.real_smul, Complex.ofReal_mul] using hg (σ ∘ p) (p.symm i) a η hη hηc + have ht := hd.comp_equiv (configurationPerm p) (configurationPerm_preserving p) + rw [configurationPerm_symm_direction] at ht + simpa only [permuteWavefunction, permuteGradient, Function.comp_apply, + configurationPerm_apply, Complex.real_smul, Complex.ofReal_mul] using ht φ hφ hφc + + theorem half_ordered_sum {n : ℕ} (F : Fin n → Fin n → ℝ) + (hF : ∀ i j, F i j = F j i) (hdiag : ∀ i, F i i = 0) : + (∑ i : Fin n, ∑ j ∈ Finset.univ.filter (fun j => i < j), F i j) = + (1/2:ℝ) * ∑ i : Fin n, ∑ j : Fin n, F i j := by + classical + have he : ∀ i j, F i j = (if i < j then F i j else 0) + (if j < i then F j i else 0) := by + intro i j + rcases lt_trichotomy i j with hij | rfl | hji + · simp [hij, not_lt.mpr hij.le] + · simp [hdiag] + · simp [hji, not_lt.mpr hji.le, hF] + have hs : (∑ i : Fin n, ∑ j : Fin n, F i j) = + 2 * (∑ i : Fin n, ∑ j : Fin n, if i < j then F i j else 0) := by + conv_lhs => arg 2; ext i; arg 2; ext j; rw [he i j] + simp_rw [Finset.sum_add_distrib] + rw [Finset.sum_comm (f := fun i j => if j < i then F j i else 0)] + ring + simp only [Finset.sum_filter] + rw [hs] + ring + + theorem coulombPotential_permute {n : ℕ} (Z : ℕ) (p : Equiv.Perm (Fin n)) + (x : Configuration n) : coulombPotential Z (x ∘ p) = coulombPotential Z x := by + have hn : (∑ i : Fin n, ‖x (p i)‖⁻¹) = ∑ i : Fin n, ‖x i‖⁻¹ := + Equiv.sum_comp p (fun i => ‖x i‖⁻¹) + have hs (y : Configuration n) : + (∑ i : Fin n, ∑ j ∈ Finset.univ.filter (fun j => i < j), ‖y i-y j‖⁻¹) = + (1/2:ℝ) * ∑ i : Fin n, ∑ j : Fin n, ‖y i-y j‖⁻¹ := + half_ordered_sum _ (fun i j => by rw [norm_sub_rev]) (fun i => by simp) + have hp : (∑ i : Fin n, ∑ j : Fin n, ‖x (p i)-x (p j)‖⁻¹) = + ∑ i : Fin n, ∑ j : Fin n, ‖x i-x j‖⁻¹ := by + calc + _ = ∑ i : Fin n, ∑ j : Fin n, ‖x (p i)-x j‖⁻¹ := by + apply Finset.sum_congr rfl + intro i _ + exact Equiv.sum_comp p (fun j => ‖x (p i)-x j‖⁻¹) + _ = _ := Equiv.sum_comp p (fun i => ∑ j : Fin n, ‖x i-x j‖⁻¹) + simp only [coulombPotential, hs, Function.comp_apply, hn, hp] + +@[simp] theorem configurationSplit_direction_zero {n : ℕ} (a : Fin 3) : + configurationSplit n (coordinateDirection 0 a) = (EuclideanSpace.single a 1, 0) := by + ext j <;> simp [coordinateDirection] + +@[simp] theorem configurationSplit_direction_succ {n : ℕ} (i : Fin n) (a : Fin 3) : + configurationSplit n (coordinateDirection i.succ a) = (0, coordinateDirection i a) := by + ext j <;> simp [coordinateDirection, Pi.single_apply] + +def insertWavefunction {n : ℕ} (f : Position → ℝ) (ψ : Wavefunction n) : Wavefunction (n+1) := + fun σ x => if σ 0 = 0 then f (x 0) • ψ (fun i => σ i.succ) (fun i => x i.succ) else 0 + +def insertGradient {n : ℕ} (f : Position → ℝ) (ψ : Wavefunction n) (g : Gradient n) : + Gradient (n+1) := + fun σ i a x => if σ 0 = 0 then + Fin.cases (fderiv ℝ f (x 0) (EuclideanSpace.single a 1) • + ψ (fun j => σ j.succ) (fun j => x j.succ)) + (fun j => f (x 0) • g (fun k => σ k.succ) j a (fun k => x k.succ)) i else 0 + + theorem HasWeakGradient.insert {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hg : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hgLp : ∀ σ i a, MemLp (g σ i a) 2 volume) {f : Position → ℝ} + (hf : ContDiff ℝ ∞ f) (hfLp : MemLp f 2 volume) + (hdfLp : ∀ a : Fin 3, MemLp (fun y => fderiv ℝ f y (EuclideanSpace.single a 1)) 2 volume) : + HasWeakGradient (insertWavefunction f ψ) (insertGradient f ψ g) := by + intro σ i a φ hφ hφc + by_cases hσ : σ 0 = 0 + · let τ : Spins n := fun j => σ j.succ + cases i using Fin.cases with + | zero => + have ht := (smooth_tensor_weak_left hf hfLp (EuclideanSpace.single a 1) (hdfLp a) + (hψ τ)).comp_equiv (configurationSplit n) (configurationSplit_preserving n) + have hv : (configurationSplit n).symm (EuclideanSpace.single a 1, 0) = + coordinateDirection 0 a := by + apply (configurationSplit n).injective + rw [ContinuousLinearEquiv.apply_symm_apply, configurationSplit_direction_zero] + rw [hv] at ht + simpa only [insertWavefunction, insertGradient, hσ, ↓reduceIte, Fin.cases_zero, + configurationSplit_apply, Function.comp_apply, Complex.real_smul] using ht φ hφ hφc + | succ i => + have hd : WeakDirectionalDerivative (ψ τ) (g τ i a) (coordinateDirection i a) := by + intro η hη hηc + simpa only [Complex.real_smul] using hg τ i a η hη hηc + have ht := (hd.tensor_right (hψ τ) (hgLp τ i a) hfLp).comp_equiv + (configurationSplit n) (configurationSplit_preserving n) + have hv : (configurationSplit n).symm (0, coordinateDirection i a) = + coordinateDirection i.succ a := by + apply (configurationSplit n).injective + rw [ContinuousLinearEquiv.apply_symm_apply, configurationSplit_direction_succ] + rw [hv] at ht + simpa only [insertWavefunction, insertGradient, hσ, ↓reduceIte, Fin.cases_succ, + configurationSplit_apply, Function.comp_apply, Complex.real_smul] using ht φ hφ hφc + · simp [insertWavefunction, insertGradient, hσ] + + theorem insertWavefunction_memLp {n : ℕ} {ψ : Wavefunction n} (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + {f : Position → ℝ} (hf : MemLp f 2 volume) (σ : Spins (n+1)) : + MemLp (insertWavefunction f ψ σ) 2 volume := by + by_cases hσ : σ 0 = 0 + · have he : insertWavefunction f ψ σ = + (fun z : Position×Configuration n => f z.1 • ψ (fun i => σ i.succ) z.2) ∘ + configurationSplit n := by + funext x + simp [insertWavefunction, hσ] + rw [he] + exact (memLp_two_real_tensor hf (hψ (fun i => σ i.succ))).comp_measurePreserving + (configurationSplit_preserving n) + · have he : insertWavefunction f ψ σ = fun _ => 0 := by + funext x + simp [insertWavefunction, hσ] + rw [he] + exact MemLp.zero' + + theorem insertGradient_memLp {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hψ : ∀ σ, MemLp (ψ σ) 2 volume) (hg : ∀ σ i a, MemLp (g σ i a) 2 volume) + {f : Position → ℝ} (hf : MemLp f 2 volume) + (hdf : ∀ a : Fin 3, MemLp (fun y => fderiv ℝ f y (EuclideanSpace.single a 1)) 2 volume) + (σ : Spins (n+1)) (i : Fin (n+1)) (a : Fin 3) : + MemLp (insertGradient f ψ g σ i a) 2 volume := by + by_cases hσ : σ 0 = 0 + · cases i using Fin.cases with + | zero => + have he : insertGradient f ψ g σ 0 a = + (fun z : Position×Configuration n => fderiv ℝ f z.1 (EuclideanSpace.single a 1) • + ψ (fun j => σ j.succ) z.2) ∘ configurationSplit n := by + funext x + simp [insertGradient, hσ] + rw [he] + exact (memLp_two_real_tensor (hdf a) (hψ (fun j => σ j.succ))).comp_measurePreserving + (configurationSplit_preserving n) + | succ i => + have he : insertGradient f ψ g σ i.succ a = + (fun z : Position×Configuration n => f z.1 • + g (fun j => σ j.succ) i a z.2) ∘ configurationSplit n := by + funext x + simp [insertGradient, hσ] + rw [he] + exact (memLp_two_real_tensor hf (hg (fun j => σ j.succ) i a)).comp_measurePreserving + (configurationSplit_preserving n) + · have he : insertGradient f ψ g σ i a = fun _ => 0 := by + funext x + simp [insertGradient, hσ] + rw [he] + exact MemLp.zero' + + theorem integral_tensor_norm {n : ℕ} (f : Position → ℝ) (ψ : Configuration n → ℂ) : + (∫ x : Configuration (n+1), ‖f (x 0) • ψ (fun i => x i.succ)‖^2) = + (∫ y : Position, (f y)^2) * ∫ x : Configuration n, ‖ψ x‖^2 := by + have he := (configurationSplit_preserving n).integral_comp + (configurationSplit n).toHomeomorph.measurableEmbedding + (fun z : Position × Configuration n => ‖f z.1 • ψ z.2‖^2) + change (∫ x : Configuration (n+1), ‖f (x 0) • ψ (fun i => x i.succ)‖^2) = + ∫ z : Position × Configuration n, ‖f z.1 • ψ z.2‖^2 at he + rw [he] + simp_rw [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] + exact integral_prod_mul (μ := volume) (ν := volume) + (fun y : Position => (f y)^2) (fun x : Configuration n => ‖ψ x‖^2) + + theorem normSquared_insert {n : ℕ} (f : Position → ℝ) (ψ : Wavefunction n) : + normSquared (insertWavefunction f ψ) = (∫ y : Position, (f y)^2) * normSquared ψ := by + classical + unfold normSquared + rw [← Equiv.sum_comp (Fin.consEquiv (fun _ : Fin (n+1) => Fin 2))] + rw [Fintype.sum_prod_type, Fin.sum_univ_two] + have h10 : (1 : Fin 2) ≠ 0 := by decide + simp only [Fin.consEquiv, Equiv.coe_fn_mk, insertWavefunction, Fin.cons_zero, + Fin.cons_succ, h10, ↓reduceIte] + simp only [norm_zero, zero_pow (by decide : 2 ≠ 0), integral_zero, + Finset.sum_const_zero, add_zero, integral_tensor_norm, Finset.mul_sum] + +def FormRegular {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) : Prop := + HasWeakGradient ψ g ∧ + (∀ σ, MemLp (ψ σ) 2 volume) ∧ + (∀ σ i a, MemLp (g σ i a) 2 volume) ∧ + (∀ σ i, Integrable (fun x : Configuration n => ‖x i‖⁻¹ * ‖ψ σ x‖ ^ 2)) ∧ + (∀ σ i j, i < j → + Integrable (fun x : Configuration n => ‖x i - x j‖⁻¹ * ‖ψ σ x‖ ^ 2)) + + theorem formDomain_iff {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) : + FormDomain ψ g ↔ IsAntisymmetric ψ ∧ FormRegular ψ g := Iff.rfl + + theorem FormRegular.pair {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular ψ g) (σ : Spins n) (i j : Fin n) : + Integrable (fun x : Configuration n => ‖x i-x j‖⁻¹ * ‖ψ σ x‖^2) := by + rcases lt_trichotomy i j with hij | rfl | hji + · exact h.2.2.2.2 σ i j hij + · simp + · simpa only [norm_sub_rev] using h.2.2.2.2 σ j i hji + + theorem FormRegular.permute {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular ψ g) (p : Equiv.Perm (Fin n)) : + FormRegular (permuteWavefunction p ψ) (permuteGradient p g) := by + refine ⟨h.1.permute p, ?_, ?_, ?_, ?_⟩ + · intro σ + exact (h.2.1 (σ ∘ p)).comp_measurePreserving (configurationPerm_preserving p) + · intro σ i a + exact (h.2.2.1 (σ ∘ p) (p.symm i) a).comp_measurePreserving (configurationPerm_preserving p) + · intro σ i + have ht := (configurationPerm_preserving p).integrable_comp_of_integrable + (h.2.2.2.1 (σ ∘ p) (p.symm i)) + simpa only [Function.comp_def, configurationPerm_apply, Equiv.apply_symm_apply, + permuteWavefunction] using ht + · intro σ i j _ + have ht := (configurationPerm_preserving p).integrable_comp_of_integrable + (h.pair (σ ∘ p) (p.symm i) (p.symm j)) + simpa only [Function.comp_def, configurationPerm_apply, Equiv.apply_symm_apply, + permuteWavefunction] using ht + + theorem WeakDirectionalDerivative.finite_sum {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] [MeasureSpace E] [BorelSpace E] + [Measure.IsAddHaarMeasure (volume : Measure E)] [FiniteDimensional ℝ E] + {ι : Type*} [Fintype ι] (c : ι → ℝ) {ψ g : ι → E → ℂ} {v : E} + (hd : ∀ i, WeakDirectionalDerivative (ψ i) (g i) v) + (hψ : ∀ i, MemLp (ψ i) 2 volume) (hg : ∀ i, MemLp (g i) 2 volume) : + WeakDirectionalDerivative (fun x => ∑ i, c i • ψ i x) (fun x => ∑ i, c i • g i x) v := by + intro φ hφ hφc + have hi (i : ι) : Integrable (fun x => fderiv ℝ φ x v • (c i • ψ i x)) := + ((hψ i).const_smul (c i)).locallyIntegrable (by norm_num) + |>.integrable_smul_left_of_hasCompactSupport + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) (hφc.fderiv_apply ℝ _) + have hi' (i : ι) : Integrable (fun x => φ x • (c i • g i x)) := + ((hg i).const_smul (c i)).locallyIntegrable (by norm_num) + |>.integrable_smul_left_of_hasCompactSupport hφ.continuous hφc + dsimp only + simp_rw [Finset.smul_sum] + rw [integral_finsetSum _ (fun i _ => hi i), integral_finsetSum _ (fun i _ => hi' i), + ← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro i _ + simp_rw [smul_comm _ (c i), integral_smul] + simpa only [smul_neg] using congrArg (fun z : ℂ => c i • z) (hd i φ hφ hφc) + + theorem integrable_weighted_norm_sum {A : Type*} [MeasurableSpace A] {μ : Measure A} + {ι : Type*} [Fintype ι] {W : A → ℝ} (hW : Measurable W) (hW0 : ∀ x, 0 ≤ W x) + (c : ι → ℝ) {f : ι → A → ℂ} (hf : ∀ i, AEStronglyMeasurable (f i) μ) + (hi : ∀ i, Integrable (fun x => W x * ‖f i x‖^2) μ) : + Integrable (fun x => W x * ‖∑ i, c i • f i x‖^2) μ := by + have hroot : Measurable (fun x => Real.sqrt (W x)) := Real.continuous_sqrt.measurable.comp hW + have he : ∀ i, MemLp (fun x => Real.sqrt (W x) • f i x) 2 μ := by + intro i + apply (memLp_two_iff_integrable_sq_norm (hroot.aestronglyMeasurable.smul (hf i))).mpr + change Integrable (fun x => ‖Real.sqrt (W x) • f i x‖^2) μ + simpa only [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs, Real.sq_sqrt (hW0 _)] using hi i + have hs := memLp_finsetSum Finset.univ (fun i _ => (he i).const_smul (c i)) + have hint := hs.norm.integrable_sq + have hx : (fun x => ‖∑ i, c i • (Real.sqrt (W x) • f i x)‖^2) = + (fun x => W x * ‖∑ i, c i • f i x‖^2) := by + funext x + simp_rw [smul_comm (c _) (Real.sqrt (W x)), ← Finset.smul_sum] + rw [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs, Real.sq_sqrt (hW0 x)] + exact hx ▸ hint + + def sumWavefunction {n : ℕ} {ι : Type*} [Fintype ι] (c : ι → ℝ) + (ψ : ι → Wavefunction n) : Wavefunction n := fun σ x => ∑ i, c i • ψ i σ x + + def sumGradient {n : ℕ} {ι : Type*} [Fintype ι] (c : ι → ℝ) + (g : ι → Gradient n) : Gradient n := fun σ i a x => ∑ j, c j • g j σ i a x + + theorem FormRegular.finite_sum {n : ℕ} {ι : Type*} [Fintype ι] (c : ι → ℝ) + {ψ : ι → Wavefunction n} {g : ι → Gradient n} (h : ∀ j, FormRegular (ψ j) (g j)) : + FormRegular (sumWavefunction c ψ) (sumGradient c g) := by + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro σ i a φ hφ hφc + have hd (j : ι) : WeakDirectionalDerivative (ψ j σ) (g j σ i a) (coordinateDirection i a) := by + intro η hη hηc + simpa only [Complex.real_smul] using (h j).1 σ i a η hη hηc + simpa only [sumWavefunction, sumGradient, Complex.real_smul] using + (WeakDirectionalDerivative.finite_sum c hd (fun j => (h j).2.1 σ) + (fun j => (h j).2.2.1 σ i a)) φ hφ hφc + · intro σ + exact memLp_finsetSum Finset.univ (fun j _ => ((h j).2.1 σ).const_smul (c j)) + · intro σ i a + exact memLp_finsetSum Finset.univ (fun j _ => ((h j).2.2.1 σ i a).const_smul (c j)) + · intro σ i + exact integrable_weighted_norm_sum (by fun_prop) (fun x => inv_nonneg.mpr (norm_nonneg _)) c + (fun j => ((h j).2.1 σ).aestronglyMeasurable) (fun j => (h j).2.2.2.1 σ i) + · intro σ i k hik + exact integrable_weighted_norm_sum (by fun_prop) (fun x => inv_nonneg.mpr (norm_nonneg _)) c + (fun j => ((h j).2.1 σ).aestronglyMeasurable) (fun j => (h j).2.2.2.2 σ i k hik) + + def permutationSign {n : ℕ} (p : Equiv.Perm (Fin n)) : ℝ := ((Equiv.Perm.sign p : ℤ) : ℝ) + +@[simp] theorem permutationSign_mul {n : ℕ} (p q : Equiv.Perm (Fin n)) : + permutationSign (p*q) = permutationSign p * permutationSign q := by + simp [permutationSign, Equiv.Perm.sign_mul] + +@[simp] theorem permutationSign_sq {n : ℕ} (p : Equiv.Perm (Fin n)) : + permutationSign p * permutationSign p = 1 := by + rcases Int.units_eq_one_or (Equiv.Perm.sign p) with h | h <;> simp [permutationSign, h] + +def antisymmetrize {n : ℕ} (ψ : Wavefunction n) : Wavefunction n := + sumWavefunction permutationSign (fun p => permuteWavefunction p ψ) + + def antisymmetrizeGradient {n : ℕ} (g : Gradient n) : Gradient n := + sumGradient permutationSign (fun p => permuteGradient p g) + + theorem antisymmetrize_antisymmetric {n : ℕ} (ψ : Wavefunction n) : + IsAntisymmetric (antisymmetrize ψ) := by + intro q σ + apply Eventually.of_forall + intro x + have he (p : Equiv.Perm (Fin n)) : + permutationSign p = permutationSign q * permutationSign (q*p) := by + rw [permutationSign_mul, ← mul_assoc, permutationSign_sq, one_mul] + change (∑ p : Equiv.Perm (Fin n), permutationSign p • ψ ((σ ∘ q) ∘ p) ((x ∘ q) ∘ p)) = + ((Equiv.Perm.sign q : ℤ) : ℂ) * ∑ p : Equiv.Perm (Fin n), + permutationSign p • ψ (σ ∘ p) (x ∘ p) + calc + _ = ∑ p : Equiv.Perm (Fin n), permutationSign q • + (permutationSign (q*p) • ψ (σ ∘ (q*p : Equiv.Perm (Fin n))) (x ∘ (q*p : Equiv.Perm (Fin n)))) := by + apply Finset.sum_congr rfl + intro p _ + rw [smul_smul, ← he p] + rfl + _ = permutationSign q • ∑ p : Equiv.Perm (Fin n), + permutationSign (q*p) • ψ (σ ∘ (q*p : Equiv.Perm (Fin n))) (x ∘ (q*p : Equiv.Perm (Fin n))) := by rw [Finset.smul_sum] + _ = permutationSign q • ∑ p : Equiv.Perm (Fin n), + permutationSign p • ψ (σ ∘ p) (x ∘ p) := by + exact congrArg (fun z : ℂ => permutationSign q • z) + (Equiv.sum_comp (Equiv.mulLeft q) + (fun p : Equiv.Perm (Fin n) => permutationSign p • ψ (σ ∘ p) (x ∘ p))) + _ = _ := by simp only [permutationSign, Complex.real_smul, Complex.ofReal_intCast] + + theorem FormRegular.antisymmetrize {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular ψ g) : FormDomain (antisymmetrize ψ) (antisymmetrizeGradient g) := + ⟨antisymmetrize_antisymmetric ψ, FormRegular.finite_sum permutationSign (fun p => h.permute p)⟩ + + theorem configurationTail_quasiPreserving (n : ℕ) : + Measure.QuasiMeasurePreserving (fun x : Configuration (n+1) => fun i : Fin n => x i.succ) + volume volume := + Measure.quasiMeasurePreserving_snd.comp (configurationSplit_preserving n).quasiMeasurePreserving + + theorem permutationSign_decompose {n : ℕ} (i : Fin (n+1)) (p : Equiv.Perm (Fin n)) : + permutationSign (Equiv.Perm.decomposeFin.symm (i,p)) = + permutationSign (Equiv.swap 0 i) * permutationSign p := by + have he := Equiv.Perm.decomposeFin_symm_of_one i + rw [← he] + by_cases hi : i = 0 + · simp [permutationSign, Equiv.Perm.decomposeFin.symm_sign, hi] + · simp [permutationSign, Equiv.Perm.decomposeFin.symm_sign, hi, Ne.symm hi] + + theorem insert_permute_decompose {n : ℕ} {ψ : Wavefunction n} (hψ : IsAntisymmetric ψ) + (f : Position → ℝ) (i : Fin (n+1)) (p : Equiv.Perm (Fin n)) (σ : Spins (n+1)) : + permuteWavefunction (Equiv.Perm.decomposeFin.symm (i,p)) (insertWavefunction f ψ) σ =ᵐ[volume] + (fun x => permutationSign p • permuteWavefunction (Equiv.swap 0 i) (insertWavefunction f ψ) σ x) := by + let τ : Spins n := fun j => σ (Equiv.swap 0 i j.succ) + have hp := (hψ p τ).comp_tendsto + ((configurationTail_quasiPreserving n).comp + (configurationPerm_preserving (Equiv.swap 0 i)).quasiMeasurePreserving).tendsto_ae + filter_upwards [hp] with x hx + change ψ (τ ∘ p) ((fun j => x (Equiv.swap 0 i j.succ)) ∘ p) = + ((Equiv.Perm.sign p : ℤ) : ℂ) * ψ τ (fun j => x (Equiv.swap 0 i j.succ)) at hx + simp only [permuteWavefunction, insertWavefunction, Function.comp_apply, + Equiv.Perm.decomposeFin_symm_apply_zero, Equiv.Perm.decomposeFin_symm_apply_succ, + Equiv.swap_apply_left] + by_cases hσ : σ i = 0 + · simp only [hσ, ↓reduceIte] + change f (x i) • ψ (τ ∘ p) ((fun j => x (Equiv.swap 0 i j.succ)) ∘ p) = _ + rw [hx] + simp only [permutationSign, Complex.real_smul, Complex.ofReal_intCast] + ring + · simp [hσ] + +end NeutralAtom +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/CorrectionDensity.lean b/lean/OAI/Analysis/CoulombRadii/Variational/CorrectionDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..579e54e35d3e535a7bd07be6fa170ffd3e9f8400 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/CorrectionDensity.lean @@ -0,0 +1,449 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.ThomasFermi.ScaledProfile +import OAI.Analysis.CoulombRadii.Packets.CoulombKernel + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators ContDiff +namespace NeutralAtom +open scoped Convolution +open ContinuousLinearMap + +theorem coulombKernel_le_one {x : Position} (hx : 1 ≤ ‖x‖) : coulombKernel x ≤ 1 := by + simpa only [coulombKernel, inv_one] using inv_anti₀ (by norm_num : (0:ℝ)<1) hx + +theorem coulombKernel_sq_integrableOn_ball (r : ℝ) : + IntegrableOn (fun x => (coulombKernel x)^2) (Metric.ball (0 : Position) r) := by + apply integrableOn_ball_of_norm_le_rpow + (by simp : 1 ≤ Module.finrank ℝ Position) + (C := 1) (α := 2) (by norm_num : (2:ℝ) < Module.finrank ℝ Position) + _ (measurable_coulombKernel.pow_const 2).aestronglyMeasurable + exact Filter.Eventually.of_forall (fun x => by + simp [coulombKernel, Real.rpow_neg (norm_nonneg x)]) + +theorem coulombKernel_sub_le {x y : Position} (hx : x ≠ 0) (hy : y ≠ 0) : + |coulombKernel x-coulombKernel y| ≤ + ‖x-y‖/2*((coulombKernel x)^2+(coulombKernel y)^2) := by + have hxp : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hyp : 0 < ‖y‖ := norm_pos_iff.mpr hy + have he : |coulombKernel x-coulombKernel y| = + |‖y‖-‖x‖| *(‖x‖⁻¹*‖y‖⁻¹) := by + rw [coulombKernel, coulombKernel, inv_sub_inv hxp.ne' hyp.ne', + abs_div, abs_mul, abs_of_pos hxp, abs_of_pos hyp] + simp only [div_eq_mul_inv, mul_inv_rev, mul_comm ‖x‖⁻¹ ‖y‖⁻¹] + rw [he] + calc + |‖y‖-‖x‖| *(‖x‖⁻¹*‖y‖⁻¹) ≤ ‖x-y‖*(‖x‖⁻¹*‖y‖⁻¹) := by + apply mul_le_mul_of_nonneg_right + · simpa only [norm_sub_rev] using abs_norm_sub_norm_le y x + · positivity + _ ≤ _ := by + have hb : 2*(‖x‖⁻¹*‖y‖⁻¹) ≤ (‖x‖⁻¹)^2+(‖y‖⁻¹)^2 := by + nlinarith [sq_nonneg (‖x‖⁻¹-‖y‖⁻¹)] + have hm := mul_le_mul_of_nonneg_left hb (norm_nonneg (x-y)) + dsimp [coulombKernel] + nlinarith + +theorem potentialOf_lipschitz_bound {ρ : Position → ℝ} {A : ℝ} + (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x) (hA : ∀ x, ρ x ≤ A) (x x' : Position) : + ‖potentialOf ρ x-potentialOf ρ x'‖ ≤ + (A*(∫ y in Metric.ball (0 : Position) 1, (coulombKernel y)^2)+(∫ y, ρ y))*‖x-x'‖ := by + have hi (z : Position) : Integrable (fun y => coulombKernel (z-y)*ρ y) := + (bounded_density_convolution measurable_coulombKernel coulombKernel_nonneg + (coulombKernel_integrableOn_ball 1) (fun _ => coulombKernel_le_one) + hρ hpos hA z).1 + have hb (z : Position) := bounded_density_convolution + (measurable_coulombKernel.pow_const 2) (fun y => sq_nonneg (coulombKernel y)) + (coulombKernel_sq_integrableOn_ball 1) + (fun y hy => by nlinarith [coulombKernel_le_one hy, coulombKernel_nonneg y]) + hρ hpos hA z + have hdomi : Integrable (fun y => ‖x-x'‖/2* + ((coulombKernel (x-y))^2*ρ y+(coulombKernel (x'-y))^2*ρ y)) := + ((hb x).1.add (hb x').1).const_mul (‖x-x'‖/2) + have hdom : ∀ᵐ y : Position ∂volume, + ‖coulombKernel (x-y)*ρ y-coulombKernel (x'-y)*ρ y‖ ≤ + ‖x-x'‖/2*((coulombKernel (x-y))^2*ρ y+(coulombKernel (x'-y))^2*ρ y) := by + filter_upwards [volume.ae_ne x, volume.ae_ne x'] with y hy hy' + rw [← sub_mul, norm_mul, Real.norm_eq_abs (ρ y), abs_of_nonneg (hpos y)] + have hh := mul_le_mul_of_nonneg_right + (coulombKernel_sub_le (sub_ne_zero.mpr hy.symm) (sub_ne_zero.mpr hy'.symm)) (hpos y) + simpa only [sub_sub_sub_cancel_right, Real.norm_eq_abs, mul_add, add_mul, mul_assoc] using hh + have hh := norm_integral_le_of_norm_le hdomi hdom + rw [integral_sub (hi x) (hi x'), integral_const_mul, + integral_add (hb x).1 (hb x').1] at hh + refine hh.trans ?_ + have hh' := add_le_add (hb x).2 (hb x').2 + nlinarith [mul_le_mul_of_nonneg_left hh' (norm_nonneg (x-x'))] + +theorem potentialOf_lipschitz {ρ : Position → ℝ} {A : ℝ} + (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x) (hA : ∀ x, ρ x ≤ A) : + ∃ C : NNReal, LipschitzWith C (potentialOf ρ) := by + let B := A*(∫ y in Metric.ball (0 : Position) 1, (coulombKernel y)^2)+(∫ y, ρ y) + have hB : 0 ≤ B := by + exact add_nonneg (mul_nonneg ((hpos 0).trans (hA 0)) + (integral_nonneg (fun y => sq_nonneg _))) (integral_nonneg hpos) + exact ⟨⟨B,hB⟩, lipschitzWith_iff_norm_sub_le.mpr (potentialOf_lipschitz_bound hρ hpos hA)⟩ + +theorem potentialOf_continuous {ρ : Position → ℝ} {A : ℝ} + (hρ : Integrable ρ) (hpos : ∀ x, 0 ≤ ρ x) (hA : ∀ x, ρ x ≤ A) : + Continuous (potentialOf ρ) := + (potentialOf_lipschitz hρ hpos hA).choose_spec.continuous + +theorem translated_kernel_indicator_eq (x : Position) (r : ℝ) : + (Metric.ball x r).indicator (fun y => coulombKernel (x-y)) = + (fun y => (Metric.ball (0 : Position) r).indicator coulombKernel (x-y)) := by + ext y + have hh : x-y ∈ Metric.ball (0 : Position) r ↔ y ∈ Metric.ball x r := by + simp only [Metric.mem_ball, dist_eq_norm, sub_zero, norm_sub_rev] + by_cases hy : y ∈ Metric.ball x r <;> simp [hh, hy] + +theorem translated_kernel_indicator_integrable (x : Position) (r : ℝ) : + Integrable ((Metric.ball x r).indicator (fun y => coulombKernel (x-y))) := by + rw [translated_kernel_indicator_eq] + exact (integrable_comp_sub_left + ((Metric.ball (0 : Position) r).indicator coulombKernel) x).mpr + ((coulombKernel_integrableOn_ball r).integrable_indicator measurableSet_ball) + +theorem translated_kernel_indicator_integral (x : Position) (r : ℝ) : + (∫ y, (Metric.ball x r).indicator (fun y => coulombKernel (x-y)) y) = + kernelBallMass r := by + rw [translated_kernel_indicator_eq, integral_sub_left_eq_self, + integral_indicator measurableSet_ball] + rfl + +theorem kernelBallMass_nonneg (r : ℝ) : 0 ≤ kernelBallMass r := + integral_nonneg (fun _ => coulombKernel_nonneg _) + +theorem potential_integrable_and_bound {ρ : Position → ℝ} {x : Position} {r A : ℝ} + (hρ : Integrable ρ) (hpos : ∀ y, 0 ≤ ρ y) (hr : 0 < r) + (hloc : ∀ y ∈ Metric.ball x r, ρ y ≤ A) : + Integrable (fun y => coulombKernel (x-y)*ρ y) ∧ + potentialOf ρ x ≤ A*kernelBallMass r+r⁻¹*(∫ y, ρ y) := by + let b : Position → ℝ := fun y => + A*((Metric.ball x r).indicator (fun y => coulombKernel (x-y))) y+r⁻¹*ρ y + have hb : Integrable b := + ((translated_kernel_indicator_integrable x r).const_mul A).add (hρ.const_mul r⁻¹) + have hdom : ∀ y, coulombKernel (x-y)*ρ y ≤ b y := by + intro y + by_cases hy : y ∈ Metric.ball x r + · simp only [b, Set.indicator_of_mem hy] + exact (mul_le_mul_of_nonneg_left (hloc y hy) (coulombKernel_nonneg _)).trans + (by nlinarith [mul_nonneg (inv_nonneg.mpr hr.le) (hpos y)]) + · simp only [b, Set.indicator_of_notMem hy, mul_zero, zero_add] + have hd : r ≤ ‖x-y‖ := by + simpa only [Metric.mem_ball, not_lt, dist_eq_norm, norm_sub_rev] using hy + exact mul_le_mul_of_nonneg_right (inv_anti₀ hr hd) (hpos y) + have hprod : AEStronglyMeasurable (fun y => coulombKernel (x-y)*ρ y) volume := + ((measurable_coulombKernel.comp (measurable_const.sub measurable_id)).aestronglyMeasurable).mul + hρ.aestronglyMeasurable + have hi : Integrable (fun y => coulombKernel (x-y)*ρ y) := hb.mono' hprod + (Filter.Eventually.of_forall (fun y => by + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (hpos y))] + exact hdom y)) + refine ⟨hi, (integral_mono hi hb hdom).trans_eq ?_⟩ + dsimp [b] + rw [integral_add ((translated_kernel_indicator_integrable x r).const_mul A) (hρ.const_mul r⁻¹), + integral_const_mul, integral_const_mul, translated_kernel_indicator_integral] + +theorem potential_le_inner_mass {ρ : Position → ℝ} {x : Position} {a : ℝ} + (hρ : Integrable ρ) (hpos : ∀ y, 0 ≤ ρ y) (hx : x ≠ 0) + (ha : a ≤ ‖x‖/2) (hsupp : ∀ y, a < ‖y‖ → ρ y = 0) : + Integrable (fun y => coulombKernel (x-y)*ρ y) ∧ + potentialOf ρ x ≤ (2/‖x‖)*(∫ y, ρ y) := by + have hxpos : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hb := hρ.const_mul (2/‖x‖) + have hdom : ∀ y, coulombKernel (x-y)*ρ y ≤ (2/‖x‖)*ρ y := by + intro y + by_cases hy : a < ‖y‖ + · simp [hsupp y hy] + · have hh : ‖x‖/2 ≤ ‖x-y‖ := by + have := norm_le_norm_sub_add x y + linarith [le_of_not_gt hy] + have hi := inv_anti₀ (half_pos hxpos) hh + have heq : (‖x‖/2)⁻¹ = 2/‖x‖ := by ring + rw [heq] at hi + exact mul_le_mul_of_nonneg_right hi (hpos y) + have hm : AEStronglyMeasurable (fun y => coulombKernel (x-y)*ρ y) volume := + ((measurable_coulombKernel.comp (measurable_const.sub measurable_id)).aestronglyMeasurable).mul + hρ.aestronglyMeasurable + have hi := hb.mono' hm (Filter.Eventually.of_forall (fun y => by + rw [Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (coulombKernel_nonneg _) (hpos y))] + exact hdom y)) + refine ⟨hi, (integral_mono hi hb hdom).trans_eq ?_⟩ + exact integral_const_mul _ _ + +theorem integral_exterior_inverse_sixth {a : ℝ} (ha : 0 < a) : + (∫ x : Position in {x | a < ‖x‖}, (‖x‖^6)⁻¹) = 4*Real.pi/(3*a^3) := by + rw [radial_integral_exterior (fun r => (r^6)⁻¹) ha.le] + have heq : (∫ r : ℝ in Set.Ioi a, r^2*(r^6)⁻¹) = + ∫ r : ℝ in Set.Ioi a, r^(-4 : ℝ) := by + apply setIntegral_congr_fun measurableSet_Ioi + intro r hr + have hr0 : 0 < r := ha.trans hr + change r^2*(r^6)⁻¹ = r^(-4 : ℝ) + norm_num [Real.rpow_neg hr0.le] + field_simp + rw [heq, integral_Ioi_rpow_of_lt (by norm_num : (-4:ℝ)< -1) ha] + norm_num + ring + +theorem integrable_exterior_inverse_sixth {a : ℝ} (ha : 0 < a) : + IntegrableOn (fun x : Position => (‖x‖^6)⁻¹) {x | a < ‖x‖} := by + rw [radial_integrable_exterior (fun r => (r^6)⁻¹) ha.le] + refine (integrableOn_Ioi_rpow_of_lt (by norm_num : (-4:ℝ)< -1) ha).congr_fun ?_ + measurableSet_Ioi + intro r hr + have hr0 : 0 < r := ha.trans hr + change r^(-4 : ℝ) = r^2*(r^6)⁻¹ + norm_num [Real.rpow_neg hr0.le] + field_simp + +theorem potentialOf_nonneg {ρ : Position → ℝ} (hρ : ∀ y, 0 ≤ ρ y) (x : Position) : + 0 ≤ potentialOf ρ x := integral_nonneg (fun y => mul_nonneg (coulombKernel_nonneg _) (hρ y)) + +theorem inner_potential_tendsto_zero {ρ : ℕ → Position → ℝ} {a : ℕ → ℝ} + (hi : ∀ n, Integrable (ρ n)) (hp : ∀ n y, 0 ≤ ρ n y) + (hsupp : ∀ n y, a n < ‖y‖ → ρ n y = 0) + (ha : Tendsto a atTop (𝓝 0)) (hmass : Tendsto (fun n => ∫ y, ρ n y) atTop (𝓝 0)) + {x : Position} (hx : x ≠ 0) : + Tendsto (fun n => potentialOf (ρ n) x) atTop (𝓝 0) := by + have he := ha.eventually (gt_mem_nhds (half_pos (norm_pos_iff.mpr hx))) + apply squeeze_zero' (Filter.Eventually.of_forall (fun n => potentialOf_nonneg (hp n) x)) + (he.mono (fun n hn => (potential_le_inner_mass (hi n) (hp n) hx hn.le (hsupp n)).2)) + simpa using hmass.const_mul (2/‖x‖) + +theorem potential_tendsto_zero_of_local_bound {ρ : ℕ → Position → ℝ} {A : ℕ → ℝ} + {x : Position} {r : ℝ} (hr : 0 < r) + (hi : ∀ n, Integrable (ρ n)) (hp : ∀ n y, 0 ≤ ρ n y) + (hloc : ∀ n y, y ∈ Metric.ball x r → ρ n y ≤ A n) + (hA : Tendsto A atTop (𝓝 0)) (hmass : Tendsto (fun n => ∫ y, ρ n y) atTop (𝓝 0)) : + Tendsto (fun n => potentialOf (ρ n) x) atTop (𝓝 0) := by + apply squeeze_zero (fun n => potentialOf_nonneg (hp n) x) + (fun n => (potential_integrable_and_bound (hi n) (hp n) hr (hloc n)).2) + simpa using (hA.mul_const (kernelBallMass r)).add (hmass.const_mul r⁻¹) + +def correctionDensity (q a S : ℝ) (x : Position) : ℝ := + {y : Position | a ≤ ‖y‖ ∧ ‖y‖ ≤ S}.indicator (fun y => (q^8)⁻¹*(‖y‖^6)⁻¹) x + +theorem correctionDensity_nonneg (q a S : ℝ) (x : Position) : + 0 ≤ correctionDensity q a S x := by + apply Set.indicator_nonneg + intro y hy + positivity + +theorem correctionDensity_measurable (q a S : ℝ) : Measurable (correctionDensity q a S) := by + apply Measurable.indicator + (measurable_const.mul ((measurable_norm.pow_const 6).inv)) + exact (isClosed_le continuous_const continuous_norm).measurableSet.inter + (isClosed_le continuous_norm continuous_const).measurableSet + +theorem correctionDensity_le_exterior {q a S : ℝ} : + correctionDensity q a S ≤ᵐ[volume] + (fun y : Position => (q^8)⁻¹*({y : Position | a < ‖y‖}.indicator (fun y => (‖y‖^6)⁻¹) y)) := by + have hsphere : ∀ᵐ y : Position, ‖y‖ ≠ a := by + rw [ae_iff] + convert Measure.addHaar_sphere volume (0 : Position) a using 1 + congr 1 + ext y + simp + filter_upwards [hsphere] with y hy + by_cases he : a ≤ ‖y‖ ∧ ‖y‖ ≤ S + · have hm : a < ‖y‖ := lt_of_le_of_ne he.1 hy.symm + simp [correctionDensity, he, hm] + · have hp : 0 ≤ ({y : Position | a < ‖y‖}.indicator (fun y => (‖y‖^6)⁻¹)) y := by + apply Set.indicator_nonneg + intro z hz + positivity + have he' : y ∉ {y : Position | a ≤ ‖y‖ ∧ ‖y‖ ≤ S} := he + rw [correctionDensity, Set.indicator_of_notMem he'] + exact mul_nonneg (by positivity : 0 ≤ (q^8)⁻¹) hp + +theorem correctionDensity_integrable_and_mass {q a S : ℝ} (ha : 0 < a) : + Integrable (correctionDensity q a S) ∧ + (∫ y, correctionDensity q a S y) ≤ (q^8)⁻¹*(4*Real.pi/(3*a^3)) := by + have hset : MeasurableSet {y : Position | a < ‖y‖} := + (isOpen_lt continuous_const continuous_norm).measurableSet + have hb := ((integrable_exterior_inverse_sixth ha).integrable_indicator hset).const_mul (q^8)⁻¹ + have hi : Integrable (correctionDensity q a S) := hb.mono' + (correctionDensity_measurable q a S).aestronglyMeasurable + (correctionDensity_le_exterior.mono (fun y hy => by + rw [Real.norm_eq_abs, abs_of_nonneg (correctionDensity_nonneg q a S y)] + exact hy)) + refine ⟨hi, (integral_mono_ae hi hb correctionDensity_le_exterior).trans_eq ?_⟩ + rw [integral_const_mul, integral_indicator hset, integral_exterior_inverse_sixth ha] + +theorem correctionDensity_mass_bound {q a S : ℝ} (hq : 0 < q) (ha : 1/(2*q) ≤ a) : + (∫ y, correctionDensity q a S y) ≤ (32*Real.pi/3)*(q^5)⁻¹ := by + have ha0 : 0 < a := (by positivity : 0 < 1/(2*q)).trans_le ha + apply (correctionDensity_integrable_and_mass ha0).2.trans + have hm : (1/(2*q))^3 ≤ a^3 := pow_le_pow_left₀ (by positivity) ha 3 + have hd : (a^3)⁻¹ ≤ ((1/(2*q))^3)⁻¹ := inv_anti₀ (by positivity) hm + have hc : 0 ≤ (q^8)⁻¹*(4*Real.pi/3) := by positivity + calc + (q^8)⁻¹*(4*Real.pi/(3*a^3)) = ((q^8)⁻¹*(4*Real.pi/3))*(a^3)⁻¹ := by ring + _ ≤ ((q^8)⁻¹*(4*Real.pi/3))*((1/(2*q))^3)⁻¹ := mul_le_mul_of_nonneg_left hd hc + _ = (32*Real.pi/3)*(q^5)⁻¹ := by field_simp; ring + +theorem correctionDensity_local_bound {q a S : ℝ} {x y : Position} (hx : x ≠ 0) + (hy : y ∈ Metric.ball x (‖x‖/4)) : + correctionDensity q a S y ≤ (q^8)⁻¹*((‖x‖/2)^6)⁻¹ := by + have hx0 : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hyd : ‖x-y‖ < ‖x‖/4 := by + simpa only [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using hy + have hyl : ‖x‖/2 ≤ ‖y‖ := by linarith [norm_le_norm_sub_add x y] + have hi : (‖y‖^6)⁻¹ ≤ ((‖x‖/2)^6)⁻¹ := + inv_anti₀ (by positivity) (pow_le_pow_left₀ (by positivity) hyl 6) + by_cases he : a ≤ ‖y‖ ∧ ‖y‖ ≤ S + · simpa [correctionDensity, he] using mul_le_mul_of_nonneg_left hi + (by positivity : 0 ≤ (q^8)⁻¹) + · have he' : y ∉ {y : Position | a ≤ ‖y‖ ∧ ‖y‖ ≤ S} := he + rw [correctionDensity, Set.indicator_of_notMem he'] + positivity + +theorem correction_potential_tendsto_zero {q a : ℕ → ℝ} (S : ℝ) + (hq : Tendsto q atTop atTop) (ha : ∀ᶠ n in atTop, 1/(2*q n) ≤ a n) + {x : Position} (hx : x ≠ 0) : + Tendsto (fun n => potentialOf (correctionDensity (q n) (a n) S) x) atTop (𝓝 0) := by + have hx0 : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hq8 : Tendsto (fun n => ((q n)^8)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp ((tendsto_pow_atTop (by decide : 8 ≠ 0)).comp hq) + have hq5 : Tendsto (fun n => ((q n)^5)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp ((tendsto_pow_atTop (by decide : 5 ≠ 0)).comp hq) + have hbound : ∀ᶠ n in atTop, potentialOf (correctionDensity (q n) (a n) S) x ≤ + ((q n)^8)⁻¹*((‖x‖/2)^6)⁻¹*kernelBallMass (‖x‖/4)+ + (‖x‖/4)⁻¹*((32*Real.pi/3)*((q n)^5)⁻¹) := by + filter_upwards [ha, hq.eventually (eventually_gt_atTop 0)] with n hn hqn + have han : 0 < a n := (by positivity : 0 < 1/(2*q n)).trans_le hn + apply (potential_integrable_and_bound (correctionDensity_integrable_and_mass han).1 + (correctionDensity_nonneg _ _ _) (by positivity) + (fun y hy => correctionDensity_local_bound hx hy)).2.trans + apply add_le_add le_rfl + exact mul_le_mul_of_nonneg_left (correctionDensity_mass_bound hqn hn) + (by positivity : 0 ≤ (‖x‖/4)⁻¹) + apply squeeze_zero' (Filter.Eventually.of_forall + (fun n => potentialOf_nonneg (correctionDensity_nonneg _ _ _) x)) hbound + simpa using ((hq8.mul_const (((‖x‖/2)^6)⁻¹)).mul_const (kernelBallMass (‖x‖/4))).add + ((hq5.const_mul (32*Real.pi/3)).const_mul (‖x‖/4)⁻¹) + +def WeakNuclearSubsolution (U : Position → ℝ) (lam : ℝ) (Ω : Set Position) + (s : Position → ℝ) : Prop := + ∀ φ : Position → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ Ω → + (∀ x, 0 ≤ φ x) → + -(4*Real.pi*lam*φ 0)+(∫ x, s x*φ x) ≤ ∫ x, U x*coordinateLaplacian φ x + +theorem integrable_mul_test_on {q φ : Position → ℝ} {Ω : Set Position} + (hq : LocallyIntegrableOn q Ω) (hφ : Continuous φ) (hc : HasCompactSupport φ) + (ht : tsupport φ ⊆ Ω) : Integrable (fun x => q x*φ x) := by + exact (integrableOn_iff_integrable_of_support_subset + ((Function.support_mul_subset_right q φ).trans (subset_tsupport φ))).mp + ((hq.integrableOn_compact_subset ht hc).mul_continuousOn hφ.continuousOn hc) + +theorem integral_coordinateLaplacian {φ : Position → ℝ} + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + (∫ x, coordinateLaplacian φ x) = 0 := by + have hh := integral_mul_coordinateLaplacian_eq + (f := fun _ => (1:ℝ)) (fun _ _ => contDiffAt_const) hφ hc + simpa [coordinateLaplacian] using hh + +theorem corrected_test_identity {U σ η φ : Position → ℝ} {lam c Aσ Aη : ℝ} + (hU : Continuous (fun x => U x-lam*coulombKernel x)) + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hη : Integrable η) (hηpos : ∀ x, 0 ≤ η x) (hηbd : ∀ x, η x ≤ Aη) + (hφ : ContDiff ℝ ∞ φ) (hc : HasCompactSupport φ) : + (∫ x, (U x-(lam*coulombKernel x-potentialOf σ x)-potentialOf η x-c)*coordinateLaplacian φ x) = + (∫ x, U x*coordinateLaplacian φ x)+4*Real.pi*lam*φ 0- + (∫ x, (4*Real.pi)*σ x*φ x)+(∫ x, (4*Real.pi)*η x*φ x) := by + have hL : Continuous (coordinateLaplacian φ) := + continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)) + have hLc := hasCompactSupport_coordinateLaplacian hc + have hiK : Integrable (fun x => coulombKernel x*coordinateLaplacian φ x) := by + simpa only [smul_eq_mul] using + locallyIntegrable_coulombKernel.integrable_smul_right_of_hasCompactSupport hL hLc + have hiUreg : Integrable (fun x => (U x-lam*coulombKernel x)*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt (fun x _ => hU.continuousAt) hL hLc + have hiU : Integrable (fun x => U x*coordinateLaplacian φ x) := by + exact (hiUreg.add (hiK.const_mul lam)).congr (Filter.Eventually.of_forall (by + intro x + simp only [Pi.add_apply] + ring)) + have hiσ : Integrable (fun x => potentialOf σ x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt + (fun _ _ => (potentialOf_continuous hσ hσpos hσbd).continuousAt) hL hLc + have hiη : Integrable (fun x => potentialOf η x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt + (fun _ _ => (potentialOf_continuous hη hηpos hηbd).continuousAt) hL hLc + have hilamK : Integrable (fun x => lam*coulombKernel x*coordinateLaplacian φ x) := by + simpa only [mul_assoc] using hiK.const_mul lam + have he : (fun x => (U x-(lam*coulombKernel x-potentialOf σ x)-potentialOf η x-c)*coordinateLaplacian φ x) = + (fun x => (((U x*coordinateLaplacian φ x-lam*coulombKernel x*coordinateLaplacian φ x)+ + potentialOf σ x*coordinateLaplacian φ x)-potentialOf η x*coordinateLaplacian φ x)-c*coordinateLaplacian φ x) := by + funext x + ring + have hii1 : Integrable (fun x => U x*coordinateLaplacian φ x- + lam*coulombKernel x*coordinateLaplacian φ x) := hiU.sub hilamK + have hii2 : Integrable (fun x => U x*coordinateLaplacian φ x- + lam*coulombKernel x*coordinateLaplacian φ x+ + potentialOf σ x*coordinateLaplacian φ x) := hii1.add hiσ + have hii3 : Integrable (fun x => U x*coordinateLaplacian φ x- + lam*coulombKernel x*coordinateLaplacian φ x+ + potentialOf σ x*coordinateLaplacian φ x- + potentialOf η x*coordinateLaplacian φ x) := hii2.sub hiη + rw [he, integral_sub hii3 + ((hL.integrable_of_hasCompactSupport hLc).const_mul c), + integral_sub hii2 hiη, integral_add hii1 hiσ, integral_sub hiU hilamK] + have hσP := potentialOf_weakLaplacian hσ φ hφ hc (Set.subset_univ _) + have hηP := potentialOf_weakLaplacian hη φ hφ hc (Set.subset_univ _) + rw [hσP, hηP] + simp_rw [show ∀ x, lam*coulombKernel x*coordinateLaplacian φ x = + lam*(coulombKernel x*coordinateLaplacian φ x) by intro x; ring, + integral_const_mul, integral_coulombKernel_laplacian hφ hc, + integral_coordinateLaplacian hφ hc] + simp only [neg_mul, integral_neg, mul_zero] + ring + +theorem cancel_nuclear_source {U σ η s q : Position → ℝ} {lam c Aσ Aη : ℝ} + {Ω : Set Position} (hU : Continuous (fun x => U x-lam*coulombKernel x)) + (hσ : Integrable σ) (hσpos : ∀ x, 0 ≤ σ x) (hσbd : ∀ x, σ x ≤ Aσ) + (hη : Integrable η) (hηpos : ∀ x, 0 ≤ η x) (hηbd : ∀ x, η x ≤ Aη) + (hs : LocallyIntegrableOn s Ω) (hq : LocallyIntegrableOn q Ω) + (hw : WeakNuclearSubsolution U lam Ω s) + (hle : ∀ x ∈ Ω, q x ≤ s x-(4*Real.pi)*σ x+(4*Real.pi)*η x) : + WeakLaplacianGE + (fun x => U x-(lam*coulombKernel x-potentialOf σ x)-potentialOf η x-c) Ω q := by + intro φ hφ hc ht hp + have his := integrable_mul_test_on hs hφ.continuous hc ht + have hiq := integrable_mul_test_on hq hφ.continuous hc ht + have hiσ : Integrable (fun x => σ x*φ x) := by + simpa only [smul_eq_mul] using + hσ.locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hiη : Integrable (fun x => η x*φ x) := by + simpa only [smul_eq_mul] using + hη.locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hiσ' : Integrable (fun x => (4*Real.pi)*σ x*φ x) := by + simpa only [mul_assoc] using hiσ.const_mul (4*Real.pi) + have hiη' : Integrable (fun x => (4*Real.pi)*η x*φ x) := by + simpa only [mul_assoc] using hiη.const_mul (4*Real.pi) + have hle' : ∀ x, q x*φ x ≤ s x*φ x-(4*Real.pi)*σ x*φ x+(4*Real.pi)*η x*φ x := by + intro x + by_cases hx : x ∈ tsupport φ + · have hh := mul_le_mul_of_nonneg_right (hle x (ht hx)) (hp x) + nlinarith + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, sub_self, add_zero, le_refl] + have hh := integral_mono hiq ((his.sub hiσ').add hiη') hle' + simp only [Pi.add_apply, Pi.sub_apply] at hh + have hisub : Integrable (fun x => s x*φ x-(4*Real.pi)*σ x*φ x) := his.sub hiσ' + rw [integral_add hisub hiη', integral_sub his hiσ'] at hh + rw [corrected_test_identity hU hσ hσpos hσbd hη hηpos hηbd hφ hc] + have hw' := hw φ hφ hc ht hp + linarith + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalBridge.lean b/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..554168b5142944f670037c308ca8276e99cc3e2c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalBridge.lean @@ -0,0 +1,263 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.LimitTheory.UniformGroundStateCountControl +import OAI.Analysis.CoulombRadii.Propagation.NuclearPotential + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +noncomputable section +namespace NeutralAtom + +def flattenConfiguration (n : ℕ) : Configuration n ≃L[ℝ] Coulomb.Configuration n := + LinearEquiv.toContinuousLinearEquiv + { toFun := fun x => WithLp.toLp 2 (fun ia => x ia.1 ia.2) + invFun := fun x i => Coulomb.position x i + map_add' := by intros; rfl + map_smul' := by intros; rfl + left_inv := by intro x; rfl + right_inv := by intro x; rfl } + +@[simp] lemma flattenConfiguration_apply (n : ℕ) (x : Configuration n) (i : Fin n) (a : Fin 3) : + flattenConfiguration n x (i,a) = x i a := rfl +@[simp] lemma flattenConfiguration_symm_apply (n : ℕ) (x : Coulomb.Configuration n) (i : Fin n) : + (flattenConfiguration n).symm x i = Coulomb.position x i := rfl + +lemma flattenConfiguration_symm_measurePreserving (n : ℕ) : + MeasurePreserving (flattenConfiguration n).symm.toHomeomorph.toMeasurableEquiv := + Coulomb.configurationMeasurableEquiv_measurePreserving n +lemma flattenConfiguration_measurePreserving (n : ℕ) : + MeasurePreserving (flattenConfiguration n).toHomeomorph.toMeasurableEquiv := + (flattenConfiguration_symm_measurePreserving n).symm + +lemma flattenConfiguration_coordinateDirection {n : ℕ} (i : Fin n) (a : Fin 3) : + flattenConfiguration n (coordinateDirection i a) = EuclideanSpace.single (i,a) 1 := by + ext ⟨j,b⟩ + simp [flattenConfiguration_apply,coordinateDirection,Pi.single_apply,PiLp.single_apply] + split_ifs <;> simp_all + +lemma flattenConfiguration_permute {n : ℕ} (p : Equiv.Perm (Fin n)) (x : Configuration n) : + flattenConfiguration n (x ∘ p) = Coulomb.permute p (flattenConfiguration n x) := rfl +lemma flattenConfiguration_symm_permute {n : ℕ} (p : Equiv.Perm (Fin n)) (x : Coulomb.Configuration n) : + (flattenConfiguration n).symm (Coulomb.permute p x) = (flattenConfiguration n).symm x ∘ p := rfl + +lemma weakDirectional_pullback {E F : Type*} + [NormedAddCommGroup E] [NormedSpace ℝ E] [MeasureSpace E] [BorelSpace E] + [NormedAddCommGroup F] [NormedSpace ℝ F] [MeasureSpace F] [BorelSpace F] + (L : E ≃L[ℝ] F) (hp : MeasurePreserving L.toHomeomorph.toMeasurableEquiv) + {u g : F → ℂ} {v : F} + (hw : ∀ (φ : F → ℝ), ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x, u x * (fderiv ℝ φ x v : ℂ)) = -(∫ x, g x * (φ x : ℂ))) + {w : E} (hL : L w = v) (φ : E → ℝ) (hφ : ContDiff ℝ ∞ φ) + (hc : HasCompactSupport φ) : + (∫ x, u (L x) * (fderiv ℝ φ x w : ℂ)) = -(∫ x, g (L x) * (φ x : ℂ)) := by + have H := hw (φ ∘ L.symm) (hφ.comp L.symm.contDiff) + (hc.comp_homeomorph L.symm.toHomeomorph) + have hd (x : F) : fderiv ℝ (φ ∘ L.symm) x v = fderiv ℝ φ (L.symm x) w := by + rw [fderiv_comp x (hφ.differentiable (by simp) _) L.symm.differentiableAt] + rw [L.symm.fderiv] + change fderiv ℝ φ (L.symm x) (L.symm v) = _ + rw [← hL, L.symm_apply_apply] + simp_rw [hd] at H + rw [← hp.integral_comp' (fun x => u x * (fderiv ℝ φ (L.symm x) w : ℂ)), + ← hp.integral_comp' (fun x => g x * ((φ ∘ L.symm) x : ℂ))] at H + change (∫ x, u (L x) * (fderiv ℝ φ (L.symm (L x)) w : ℂ)) = + -(∫ x, g (L x) * (φ (L.symm (L x)) : ℂ)) at H + simpa only [L.symm_apply_apply] using H + +def asH1 {n : ℕ} (ψ : Wavefunction n) (g : Gradient n) + (hw : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hg : ∀ σ i a, MemLp (g σ i a) 2 volume) : Coulomb.H1Vector n where + value := fun s x => ψ s ((flattenConfiguration n).symm x) + gradient := fun s ia x => g s ia.1 ia.2 ((flattenConfiguration n).symm x) + value_L2 := fun s => (hψ s).comp_measurePreserving (flattenConfiguration_symm_measurePreserving n) + partial_L2 := fun s ia => (hg s ia.1 ia.2).comp_measurePreserving + (flattenConfiguration_symm_measurePreserving n) + weak_partial := by + intro s ia φ hφ hc + apply weakDirectional_pullback (flattenConfiguration n).symm + (flattenConfiguration_symm_measurePreserving n) + (fun φ hφ hc => by simpa only [mul_comm] using hw s ia.1 ia.2 φ hφ hc) + (w := EuclideanSpace.single ia 1) _ φ hφ hc + rw [ContinuousLinearEquiv.symm_apply_eq] + exact (flattenConfiguration_coordinateDirection ia.1 ia.2).symm + +def fromH1Wave {n : ℕ} (ψ : Coulomb.H1Vector n) : Wavefunction n := + fun s x => ψ.value s (flattenConfiguration n x) +def fromH1Gradient {n : ℕ} (ψ : Coulomb.H1Vector n) : Gradient n := + fun s i a x => ψ.gradient s (i,a) (flattenConfiguration n x) + +lemma fromH1_weak {n : ℕ} (ψ : Coulomb.H1Vector n) : + HasWeakGradient (fromH1Wave ψ) (fromH1Gradient ψ) := by + intro s i a φ hφ hc + have H := weakDirectional_pullback (flattenConfiguration n) + (flattenConfiguration_measurePreserving n) (ψ.weak_partial s (i,a)) + (flattenConfiguration_coordinateDirection i a) φ hφ hc + simpa only [fromH1Wave,fromH1Gradient,mul_comm] using H + +lemma asH1_antisymmetric {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormDomain ψ g) : Coulomb.Antisymmetric (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) := by + intro p s + have H := (flattenConfiguration_symm_measurePreserving n).quasiMeasurePreserving.ae (hd.1 p s) + exact H + +lemma fromH1_domain {n : ℕ} (ψ : Coulomb.H1Vector n) (ha : Coulomb.Antisymmetric ψ) : + FormDomain (fromH1Wave ψ) (fromH1Gradient ψ) := by + refine ⟨?_, fromH1_weak ψ, ?_, ?_, ?_, ?_⟩ + · intro p s + exact (flattenConfiguration_measurePreserving n).quasiMeasurePreserving.ae (ha p s) + · intro s + exact (ψ.value_L2 s).comp_measurePreserving (flattenConfiguration_measurePreserving n) + · intro s i a + exact (ψ.partial_L2 s (i,a)).comp_measurePreserving (flattenConfiguration_measurePreserving n) + · intro s i + have H := (flattenConfiguration_measurePreserving n).integrable_comp_of_integrable + (ψ.nuclear_coulomb_integrable_bound s i 0 (by norm_num : (0:ℝ)<1)).1 + change Integrable (fun x : Configuration n => ‖x i-0‖⁻¹*‖fromH1Wave ψ s x‖^2) at H + simpa only [sub_zero] using H + · intro s i j hij + exact (flattenConfiguration_measurePreserving n).integrable_comp_of_integrable + (ψ.pair_coulomb_integrable_bound s i j hij.ne (by norm_num : (0:ℝ)<1)).1 + +lemma fromH1_mass {n : ℕ} (ψ : Coulomb.H1Vector n) : + normSquared (fromH1Wave ψ) = Coulomb.mass ψ := by + unfold normSquared Coulomb.mass fromH1Wave + apply Finset.sum_congr rfl + intro s _ + exact (flattenConfiguration_measurePreserving n).integral_comp' (fun x => ‖ψ.value s x‖^2) + +lemma asH1_mass {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hw : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hg : ∀ σ i a, MemLp (g σ i a) 2 volume) : + Coulomb.mass (asH1 ψ g hw hψ hg) = normSquared ψ := by + unfold normSquared Coulomb.mass asH1 + apply Finset.sum_congr rfl + intro s _ + exact (flattenConfiguration_symm_measurePreserving n).integral_comp' (fun x => ‖ψ s x‖^2) + +@[simp] lemma position_flattenConfiguration {n : ℕ} (x : Configuration n) (i : Fin n) : + Coulomb.position (flattenConfiguration n x) i = x i := rfl + +lemma coulombPotential_flatten {n : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) (x : Configuration n) : + coulombPotential Z x = -Coulomb.nuclearPotential (Coulomb.atom Z hZ) + (flattenConfiguration n x) + Coulomb.pairPotential (flattenConfiguration n x) := by + classical + simp [coulombPotential,Coulomb.nuclearPotential,Coulomb.pairPotential,Coulomb.attraction, + Coulomb.atom,Coulomb.coulombKernel,Finset.sum_filter,Finset.mul_sum,neg_mul] + +lemma fromH1_energy {n : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) (ψ : Coulomb.H1Vector n) : + energy Z (fromH1Wave ψ) (fromH1Gradient ψ) = Coulomb.form (Coulomb.atom Z hZ) ψ := by + have hK : (∑ s : Spins n, ∑ i : Fin n, ∑ a : Fin 3, + ∫ x : Configuration n, ‖fromH1Gradient ψ s i a x‖^2) = + ∑ s : Coulomb.Spins n, ∑ ia : Fin n × Fin 3, + ∫ x : Coulomb.Configuration n, ‖ψ.gradient s ia x‖^2 := by + simp only [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro a _ + exact (flattenConfiguration_measurePreserving n).integral_comp' (fun x => ‖ψ.gradient s (i,a) x‖^2) + have hV (s : Spins n) : + (∫ x : Configuration n, coulombPotential Z x * ‖fromH1Wave ψ s x‖^2) = + -(∫ x, Coulomb.nuclearPotential (Coulomb.atom Z hZ) x * ‖ψ.value s x‖^2) + + ∫ x, Coulomb.pairPotential x * ‖ψ.value s x‖^2 := by + simp_rw [coulombPotential_flatten Z hZ] + change (∫ x, (-Coulomb.nuclearPotential (Coulomb.atom Z hZ) (flattenConfiguration n x) + + Coulomb.pairPotential (flattenConfiguration n x)) * ‖ψ.value s (flattenConfiguration n x)‖^2) = _ + calc + _ = ∫ x, (-Coulomb.nuclearPotential (Coulomb.atom Z hZ) x + Coulomb.pairPotential x) * ‖ψ.value s x‖^2 := + (flattenConfiguration_measurePreserving n).integral_comp' + (fun x => (-Coulomb.nuclearPotential (Coulomb.atom Z hZ) x + Coulomb.pairPotential x) * ‖ψ.value s x‖^2) + _ = _ := ?_ + + simp_rw [add_mul,neg_mul] + have hn : Integrable (fun x => -(Coulomb.nuclearPotential (Coulomb.atom Z hZ) x * ‖ψ.value s x‖^2)) := + (ψ.nuclear_integrable (Coulomb.atom Z hZ) s).neg + have hp : Integrable (fun x => Coulomb.pairPotential x * ‖ψ.value s x‖^2) := ψ.pair_integrable s + rw [integral_add hn hp, integral_neg] + unfold energy Coulomb.form Coulomb.kinetic Coulomb.nuclearEnergy Coulomb.pairEnergy + rw [hK] + simp_rw [hV, Finset.sum_add_distrib,Finset.sum_neg_distrib] + unfold Coulomb.nuclearPotential Coulomb.pairPotential + ring + +lemma asH1_energy {n : ℕ} (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction n} {g : Gradient n} + (hw : HasWeakGradient ψ g) (hψ : ∀ σ, MemLp (ψ σ) 2 volume) + (hg : ∀ σ i a, MemLp (g σ i a) 2 volume) : + Coulomb.form (Coulomb.atom Z hZ) (asH1 ψ g hw hψ hg) = energy Z ψ g := by + exact (fromH1_energy Z hZ (asH1 ψ g hw hψ hg)).symm + +lemma asH1_groundState (Z : ℕ) (hZ : 1 ≤ Z) {ψ : Wavefunction Z} {g : Gradient Z} + (hd : FormDomain ψ g) (hn : normSquared ψ = 1) + (hm : ∀ (χ : Wavefunction Z) (h : Gradient Z), + FormDomain χ h → normSquared χ = 1 → energy Z ψ g ≤ energy Z χ h) : + Coulomb.GroundState (Coulomb.atom Z hZ) (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) := by + let u := asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1 + have ha : Coulomb.Antisymmetric u := asH1_antisymmetric hd + have hu : Coulomb.mass u = 1 := (asH1_mass ..).trans hn + refine ⟨ha,hu,le_antisymm ?_ (Coulomb.energy_le_form _ (by omega) u ha hu)⟩ + unfold Coulomb.energy + rw [ite_eq_right (show Z ≠ 0 by omega)] + refine le_csInf ?_ ?_ + · exact ⟨Coulomb.form (Coulomb.atom Z hZ) u, u, ha, hu, rfl⟩ + rintro e ⟨v,hv,hvm,rfl⟩ + rw [asH1_energy Z hZ] + have H := hm (fromH1Wave v) (fromH1Gradient v) (fromH1_domain v hv) + ((fromH1_mass v).trans hvm) + rwa [fromH1_energy Z hZ] at H + +lemma fromH1_groundState (Z : ℕ) (hZ : 1 ≤ Z) (ψ : Coulomb.H1Vector Z) + (hψ : Coulomb.GroundState (Coulomb.atom Z hZ) ψ) : + IsNormalizedGroundState Z (fromH1Wave ψ) := by + refine ⟨fromH1Gradient ψ, fromH1_domain ψ hψ.1, (fromH1_mass ψ).trans hψ.2.1, ?_⟩ + intro χ h hd hm + rw [fromH1_energy Z hZ] + have H := hψ.minimizes (by omega) (asH1 χ h hd.2.1 hd.2.2.1 hd.2.2.2.1) + (asH1_antisymmetric hd) ((asH1_mass ..).trans hm) + rwa [asH1_energy Z hZ] at H + +lemma fromH1_exteriorMass {N : ℕ} (ψ : Coulomb.H1Vector (N+1)) + (ha : Coulomb.Antisymmetric ψ) (r : ℝ) : + exteriorMass (fromH1Wave ψ) r = Coulomb.exteriorMass ψ r := by + have hd := fromH1_domain ψ ha + let S : Set Position := {x | r < ‖x‖} + have hS : MeasurableSet S := measurableSet_lt measurable_const continuous_norm.measurable + rw [exteriorMass, ← rawExpectation_count_eq_density hd.1 hd.2.2.1 hS] + unfold rawExpectation configurationDensity + simp_rw [Finset.mul_sum] + have hi s : Integrable (fun x => rawCount S x * ‖fromH1Wave ψ s x‖^2) := by + simp_rw [rawCount, Finset.sum_mul] + exact integrable_finsetSum _ fun i _ => + integrable_siteWeight (hd.2.2.1 s).norm.integrable_sq hS i + rw [integral_finsetSum _ (fun s _ => hi s)] + unfold Coulomb.exteriorMass + apply Finset.sum_congr rfl + intro s _ + have he (x : Configuration (N+1)) : + rawCount S x = ∑ i : Fin (N+1), if r < ‖Coulomb.position (flattenConfiguration (N+1) x) i‖ then (1:ℝ) else 0 := by + unfold rawCount + apply Finset.sum_congr rfl + intro i _ + simp only [S, Set.indicator_apply, Set.mem_ofPred_eq, position_flattenConfiguration] + rfl + simp_rw [he] + exact (flattenConfiguration_measurePreserving (N+1)).integral_comp' + (fun x => (∑ i : Fin (N+1), if r < ‖Coulomb.position x i‖ then (1:ℝ) else 0)*‖ψ.value s x‖^2) + +lemma asH1_exteriorMass {N : ℕ} {ψ : Wavefunction (N+1)} {g : Gradient (N+1)} + (hd : FormDomain ψ g) (r : ℝ) : + Coulomb.exteriorMass (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) r = exteriorMass ψ r := by + exact (fromH1_exteriorMass _ (asH1_antisymmetric hd) r).symm + +end NeutralAtom + +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalCoreMean.lean b/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalCoreMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..6c78ea1dcfa8c44ffb43bfdea2bda160b766d49d --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalCoreMean.lean @@ -0,0 +1,111 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.RadialBounds.PhysicalShellError +import OAI.Analysis.CoulombRadii.Propagation.InitialMesh +import OAI.Analysis.CoulombRadii.Propagation.PhysicalFinitePropagation + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +lemma dyadic_endpoint {r s : ℝ} (hr : 0 (mul_le_mul_of_nonneg_left (pow_le_pow_right₀ (by norm_num : (1:ℝ) ≤ 2) hj) hr.le).trans H⟩ + have HH := (div_lt_iff₀ hr).mp hJ' + rw [pow_succ] at HH + nlinarith only [HH] + +theorem physical_propagated_core_mean : ∃ a M : ℝ,0.eventually (gt_mem_nhds hs))).mono + (fun _ h => h.le) + obtain ⟨Zr,Hr⟩ := eventually_atTop.mp hsmall + refine ⟨max Zi Zr,?_⟩ + intro Z hZm hZ N ψ g hd hn hmin E hE he hnum + have hZi : Zi ≤ Z := (le_max_left _ _).trans hZm + have hZr : Zr ≤ Z := (le_max_right _ _).trans hZm + have hZpos : 0<(Z:ℝ) := by exact_mod_cast (zero_lt_one.trans_le hZ) + let r₀ := initialAtomicRadius ε (Z:ℝ) + have hr : 0 r₀*2^j.val + have hscale (j : Fin J) : rs j ≤ s := hjr j.val j.isLt.le + have hge (j : Fin J) : r₀ ≤ rs j := le_mul_of_one_le_right hr.le (one_le_pow₀ (by norm_num : (1:ℝ) ≤ 2)) + obtain ⟨G₀,hG₀,hp₀,hlo⟩ := Hi Z hZi hZ (J:=J) hd hn hmin hE he hnum + have HG' := fun j : Fin J => HG Z hZ hd hn hmin hE he hr hs hss j (hscale j) + choose G hG hp HGood using HG' + have hcost (j : Fin J) : + (∫ o in (G j)ᶜ,∫ y in {y : Position | rs j ≤ ‖y‖ ∧ ‖y‖<2*(rs j)}, + conditionalPacketDensity P Prod.fst (tailObservation rs j.val) Coulomb.unitWindow 1 r₀ s + (tailObservation rs j.val o) y ∂volume ∂P) ≤ M*Real.sqrt K*(rs j)^9 := by + exact HC Z hZ hd hn hE he hD Coulomb.unitWindow.continuous Coulomb.unitWindow_mass + Coulomb.unitWindow_support (by norm_num : (0:ℝ)<1) hr hs (hge j) ((hscale j).trans hs1) + ((mul_le_mul_of_nonneg_left (pow_le_pow_left₀ (hr.trans_le (hge j)).le (hscale j) 7) hD).trans hDs) + hq2 hK.le rs j.val (hG j).2.compl (hp j) + have HF := physical_finite_propagation Z hZ hd hn Coulomb.unitWindow_support Coulomb.unitWindow_mass + (by norm_num : (0:ℝ)<1) hε hB hBC hr hr1 hs (mul_nonneg hM (Real.sqrt_nonneg K)) hq2 + (initialAtomicRadius_cubic hZpos) hnum hBe heC hR hbar k hG₀ hp₀ hlo G + (fun j => (hG j).1) HGood hcost + rw [raw_population_asH1 hd measurableSet_ball] at HF + have hmono := Coulomb.expectedPopulation_mono (asH1 ψ g hd.2.1 hd.2.2.1 hd.2.2.2.1) + measurableSet_ball measurableSet_ball (Metric.ball_subset_ball (x:=(0:Position)) (show s/4 ≤ (r₀*2^J)/2 by linarith only [hJs'])) + apply hmono.trans (HF.trans ?_) + have hn : 0 W (x 0)*‖ψ σ x‖^2)) : + (∫ z,W z*density ψ z)=(N+1:ℝ)*rawExpectation ψ (fun x => W (x 0)) := by + have hw (σ : Spins (N+1)) := (integrable_cons (hi σ)).integral_prod_left + have he (σ : Spins (N+1)) : + (fun z => W z*(∫ x : Configuration N,‖ψ σ (Fin.cons z x)‖^2))= + fun z => ∫ x : Configuration N,W z*‖ψ σ (Fin.cons z x)‖^2 := by + funext z + rw [integral_const_mul] + have hw' (σ : Spins (N+1)) : Integrable (fun z => W z*(∫ x : Configuration N,‖ψ σ (Fin.cons z x)‖^2)) := by + rw [he] + simpa only [Fin.cons_zero] using hw σ + unfold density rawExpectation configurationDensity + simp_rw [mul_left_comm (W _) (N+1:ℝ)] + rw [integral_const_mul] + simp_rw [Finset.mul_sum] + rw [integral_finsetSum _ (fun σ _ => hw' σ), + integral_finsetSum _ (fun σ _ => hi σ)] + congr 1 + apply Finset.sum_congr rfl + intro σ _ + simp_rw [he σ] + simpa only [Fin.cons_zero] using integral_cons (hi σ) + +theorem density_weight_integrable {N : ℕ} (ψ : Wavefunction (N+1)) + (W : Position → ℝ) + (hi : ∀ σ,Integrable (fun x : Configuration (N+1) => W (x 0)*‖ψ σ x‖^2)) : + Integrable (fun z => W z*density ψ z) := by + have hw (σ : Spins (N+1)) := (integrable_cons (hi σ)).integral_prod_left + have hh : (fun z => W z*density ψ z)=fun z => (N+1:ℝ)* + ∑ σ : Spins (N+1),∫ x : Configuration N,W z*‖ψ σ (Fin.cons z x)‖^2 := by + funext z + simp only [density,integral_const_mul,←Finset.mul_sum] + ring + rw [hh] + apply Integrable.const_mul + exact integrable_finsetSum _ (fun σ _ => by simpa only [Fin.cons_zero] using hw σ) + +theorem rawExpectation_oneBody_eq_density {N : ℕ} {ψ : Wavefunction (N+1)} + (ha : IsAntisymmetric ψ) (W : Position → ℝ) + (hi : ∀ σ i,Integrable (fun x : Configuration (N+1) => W (x i)*‖ψ σ x‖^2)) : + rawExpectation ψ (fun x => ∑ i : Fin (N+1),W (x i))=∫ z,W z*density ψ z := by + have hii (i : Fin (N+1)) : Integrable (fun x => W (x i)*configurationDensity ψ x) := by + simp only [configurationDensity,Finset.mul_sum] + exact integrable_finsetSum _ (fun σ _ => hi σ i) + calc + _=∑ i : Fin (N+1),rawExpectation ψ (fun x => W (x i)) := by + unfold rawExpectation + simp_rw [Finset.sum_mul] + exact integral_finsetSum _ (fun i _ => hii i) + _=∑ _i : Fin (N+1),rawExpectation ψ (fun x => W (x 0)) := by + apply Finset.sum_congr rfl + intro i _ + simpa only [Function.comp_apply,Equiv.swap_apply_left] using + rawExpectation_perm ha (Equiv.swap 0 i) (fun x => W (x 0)) + _=_ := by rw [density_weight_eq_first_site ψ W (fun σ => hi σ 0)]; simp + +lemma fromH1_coulomb_weight_integrable {n : ℕ} (u : Coulomb.H1Vector n) + (y : Position) (σ : Spins n) (i : Fin n) : + Integrable (fun x : Configuration n => coulombKernel (y-x i)*‖fromH1Wave u σ x‖^2) := by + have H := (flattenConfiguration_measurePreserving n).integrable_comp_of_integrable + (u.nuclear_coulomb_integrable_bound σ i y (by norm_num : (0:ℝ)<1)).1 + change Integrable (fun x : Configuration n => Coulomb.coulombKernel (x i-y)*‖fromH1Wave u σ x‖^2) at H + simpa only [coulombKernel,Coulomb.coulombKernel,norm_sub_rev] using H + +lemma fromH1_coulomb_near_weight_integrable {n : ℕ} (u : Coulomb.H1Vector n) + (y : Position) (R : ℝ) (σ : Spins n) (i : Fin n) : + Integrable (fun x : Configuration n => (Metric.closedBall y R).indicator + (fun z => coulombKernel (y-z)) (x i)*‖fromH1Wave u σ x‖^2) := by + have H := (fromH1_coulomb_weight_integrable u y σ i).indicator + ((measurableSet_closedBall : MeasurableSet (Metric.closedBall y R)).preimage (measurable_pi_apply i)) + apply H.congr + exact Eventually.of_forall fun x => by + by_cases hx : x i∈Metric.closedBall y R <;> simp [hx] + +lemma rawLaw_no_fixed_particle {N : ℕ} {ψ : Wavefunction (N+1)} + (ha : IsAntisymmetric ψ) (hψ : ∀ σ,MemLp (ψ σ) 2 volume) + (hn : normSquared ψ=1) (y : Position) : + ∀ᵐ x ∂rawLaw ψ,∀ i : Fin (N+1),x i≠y := by + have := rawLaw_isProbability hψ hn + have hi := (rawCount_memLp hψ hn (hS := measurableSet_singleton y)).integrable (by norm_num) + have hz : (∫ x,rawCount {y} x ∂rawLaw ψ)=0 := by + rw [integral_rawLaw hψ,rawExpectation_count_eq_density ha hψ (measurableSet_singleton y)] + exact setIntegral_measure_zero _ (measure_singleton y) + have he : rawCount (n := N+1) {y}=ᵐ[rawLaw ψ] 0 := + (integral_eq_zero_iff_of_nonneg_ae (Eventually.of_forall (rawCount_nonneg {y})) hi).mp hz + filter_upwards [he] with x hx + intro i hiy + have hb := Finset.single_le_sum (fun j _ => show 0≤({y}:Set Position).indicator (fun _ => (1:ℝ)) (x j) from by + by_cases hj : x j=y <;> simp [hj]) (Finset.mem_univ i) + change ({y}:Set Position).indicator (fun _ => (1:ℝ)) (x i)≤rawCount {y} x at hb + simp [hiy,hx] at hb + norm_num at hb +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalOffsetMean.lean b/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalOffsetMean.lean new file mode 100644 index 0000000000000000000000000000000000000000..645a540b44ef880bd49fb1db48b2efc74ce8c040 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/PhysicalOffsetMean.lean @@ -0,0 +1,72 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.PhysicalCoreMean +import OAI.Analysis.CoulombRadii.SpectralTheory.CorePredecessor + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology +noncomputable section +namespace NeutralAtom + +theorem zero_offset_physical_core_mean : ∃ t : ℝ,0 s^3+M*s^12) (𝓝[>] 0) (𝓝 0) := by + convert ((tendsto_id.mono_left nhdsWithin_le_nhds : Tendsto (fun s : ℝ => s) (𝓝[>] 0) (𝓝 0)).pow 3).add + (((tendsto_id.mono_left nhdsWithin_le_nhds : Tendsto (fun s : ℝ => s) (𝓝[>] 0) (𝓝 0)).pow 12).const_mul M) using 1 <;> simp + have hsmall : ∀ᶠ s : ℝ in 𝓝[>] 0,0] 0,0 linarith + +theorem neutral_screened_ball_estimates {c : Position} (hc : c ≠ 0) {C A : ℝ} + (hC : 0 ≤ C) (hA : 0 ≤ A) : + ∃ D : ℝ, 0 < D ∧ ∀ (lam Aσ : ℝ) (σ : Position → ℝ), + Integrable σ → (∀ x, 0 ≤ σ x) → (∀ x, σ x ≤ Aσ) → (∫ x, σ x) = lam → + (∀ x : Position, ‖c‖/2 ≤ ‖x‖ → ‖x‖ ≤ 2*‖c‖ → + screenedField lam σ x ≤ C/‖x‖^4 ∧ σ x ≤ A) → + (∀ z ∈ Metric.closedBall c (‖c‖/8), ‖screenedField lam σ z‖ ≤ D) ∧ + (∀ z ∈ Metric.closedBall c (‖c‖/8), ∀ z' ∈ Metric.closedBall c (‖c‖/8), + ‖screenedField lam σ z-screenedField lam σ z'‖ ≤ D*‖z-z'‖) := by + let r := ‖c‖/8 + let V := {x : Position | ‖c‖/2 ≤ ‖x‖ ∧ ‖x‖ ≤ 2*‖c‖} + let M := 2*(C/(‖c‖/2)^4)*(volume V).toReal + have hn : 0 < ‖c‖ := norm_pos_iff.mpr hc + have hr : 0 < r := by dsimp [r]; positivity + have hM : 0 ≤ M := by dsimp [M]; positivity + obtain ⟨D, hD, hest⟩ := poisson_interior_estimates c hr hA hM + refine ⟨D, hD, ?_⟩ + intro lam Aσ σ hi hp hb hm hcap + have hsub : Metric.closedBall c (3*r) ⊆ V := closedBall_eighth_subset_annulus hc + have hV : V ⊆ {x : Position | x ≠ 0} := by + intro x hx hz + have hh := hx.1 + rw [hz, norm_zero] at hh + linarith + have h3 : Metric.ball c (3*r) ⊆ {x : Position | x ≠ 0} := + (Metric.ball_subset_closedBall.trans hsub).trans hV + have h2 : Metric.ball c (2*r) ⊆ {x : Position | x ≠ 0} := + (Metric.ball_subset_ball (by linarith : 2*r ≤ 3*r)).trans h3 + have hCB : Metric.closedBall c (2*r) ⊆ V := + (Metric.closedBall_subset_closedBall (by linarith : 2*r ≤ 3*r)).trans hsub + have hcont := screenedField_continuousOn hi hp hb (lam := lam) + apply hest (screenedField lam σ) σ (hcont.mono h3) + ((screenedField_weakLaplacian hi hp hb).mono h2) hi hp + (fun x hx => (hcap x (hsub hx).1 (hsub hx).2).2) + have hint : IntegrableOn (fun x => ‖screenedField lam σ x‖) V := + (hcont.mono hV).norm.integrableOn_compact (isCompact_closedNormAnnulus _ _) + calc + (∫ x in Metric.closedBall c (2*r), ‖screenedField lam σ x‖) ≤ + ∫ x in V, ‖screenedField lam σ x‖ := + setIntegral_mono_set hint (Filter.Eventually.of_forall (fun x => norm_nonneg _)) + (Filter.Eventually.of_forall hCB) + _ ≤ M := by + exact neutral_annulus_lone_bound hi hp hb hm (by positivity) hC + (fun x hxa hxb => (hcap x hxa hxb).1) + +abbrev PuncturedPosition := {x : Position // x ≠ 0} + +def extendPunctured (f : PuncturedPosition → ℝ) (x : Position) : ℝ := + if hx : x ≠ 0 then f ⟨x, hx⟩ else 0 + +@[simp] theorem extendPunctured_val (f : PuncturedPosition → ℝ) (x : PuncturedPosition) : + extendPunctured f x = f x := by simp [extendPunctured, x.property] + +theorem neutral_screened_precompact_sequence + {σ : ℕ → Position → ℝ} {lam Aσ : ℕ → ℝ} {C : ℝ} + (hσi : ∀ n, Integrable (σ n)) (hσp : ∀ n x, 0 ≤ σ n x) + (hσbd : ∀ n x, σ n x ≤ Aσ n) (hmass : ∀ n, (∫ x, σ n x) = lam n) + (hC : 0 ≤ C) + (hband : ∀ a b : ℝ, 0 < a → a < b → ∃ A : ℝ, 0 ≤ A ∧ + ∀ᶠ n in atTop, ∀ x : Position, a ≤ ‖x‖ → ‖x‖ ≤ b → + screenedField (lam n) (σ n) x ≤ C/‖x‖^4 ∧ σ n x ≤ A) : + ∃ (F : Position → ℝ) (φ : ℕ → ℕ), StrictMono φ ∧ + ContinuousOn F {x | x ≠ 0} ∧ + TendstoLocallyUniformlyOn (fun n => screenedField (lam (φ n)) (σ (φ n))) F atTop {x | x ≠ 0} ∧ + LocallyLipschitzOn Set.univ (fun x : PuncturedPosition => F x) := by + let : LocallyCompactSpace PuncturedPosition := + (isOpen_ne : IsOpen {x : Position | x ≠ 0}).locallyCompactSpace + let G : ℕ → PuncturedPosition → ℝ := fun n x => screenedField (lam n) (σ n) x + have hGc : ∀ n, Continuous (G n) := fun n => + continuousOn_iff_continuous_domRestrict.mp + (screenedField_continuousOn (hσi n) (hσp n) (hσbd n)) + have hGe : ∀ x : PuncturedPosition, ∃ (r D : ℝ) (N : ℕ), 0 < r ∧ 0 ≤ D ∧ + ∀ n, N ≤ n → ‖G n x‖ ≤ D ∧ + ∀ y ∈ Metric.ball x r, ∀ z ∈ Metric.ball x r, ‖G n y-G n z‖ ≤ D*dist y z := by + intro x + have hn : 0 < ‖x.val‖ := norm_pos_iff.mpr x.property + obtain ⟨A, hA, hEv⟩ := hband (‖x.val‖/2) (2*‖x.val‖) (by positivity) (by linarith) + obtain ⟨D, hD, hEst⟩ := neutral_screened_ball_estimates x.property hC hA + obtain ⟨N, hN⟩ := eventually_atTop.mp hEv + refine ⟨‖x.val‖/8, D, N, by positivity, hD.le, ?_⟩ + intro n hn' + obtain ⟨hv, hl⟩ := hEst (lam n) (Aσ n) (σ n) (hσi n) (hσp n) (hσbd n) (hmass n) (hN n hn') + constructor + · exact hv x (Metric.mem_closedBall_self (by positivity)) + · intro y hy z hz + have hy' : y.val ∈ Metric.closedBall x.val (‖x.val‖/8) := Metric.mem_closedBall.mpr hy.le + have hz' : z.val ∈ Metric.closedBall x.val (‖x.val‖/8) := Metric.mem_closedBall.mpr hz.le + simpa only [G, Subtype.dist_eq, dist_eq_norm] using hl y hy' z hz' + obtain ⟨f, φ, hφ, hu, hl⟩ := locallyUniform_subsequence_of_eventual_ball_estimates G hGc hGe + refine ⟨extendPunctured f, φ, hφ, ?_, ?_, ?_⟩ + · apply continuousOn_iff_continuous_domRestrict.mpr + change Continuous (fun x : PuncturedPosition => extendPunctured f x) + simpa only [extendPunctured_val] using f.continuous + · apply tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mpr + change TendstoLocallyUniformly (fun n (x : PuncturedPosition) => + screenedField (lam (φ n)) (σ (φ n)) x) + (fun x : PuncturedPosition => extendPunctured f x) atTop + simpa only [extendPunctured_val, G] using hu + · simpa only [extendPunctured_val] using hl + +theorem tendsto_integral_mul_test_of_locallyUniformlyOn + {F : ℕ → Position → ℝ} {f ψ : Position → ℝ} {U : Set Position} + (hF : ∀ n, LocallyIntegrableOn (F n) U) (hf : ContinuousOn f U) + (hu : TendstoLocallyUniformlyOn F f atTop U) + (hψ : Continuous ψ) (hc : HasCompactSupport ψ) (ht : tsupport ψ ⊆ U) : + Tendsto (fun n => ∫ x, F n x * ψ x) atTop (𝓝 (∫ x, f x * ψ x)) := by + have hu' := (tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact hc).mp (hu.mono ht) + obtain ⟨M, hM⟩ := hc.exists_bound_of_continuousOn (hf.mono ht) + have hbd : ∀ᶠ n in atTop, ∀ x ∈ tsupport ψ, ‖F n x‖ ≤ max M 0+1 := by + filter_upwards [(Metric.tendstoUniformlyOn_iff.mp hu') 1 (by norm_num)] with n hn x hx + calc + ‖F n x‖ ≤ ‖F n x-f x‖+‖f x‖ := norm_le_norm_sub_add _ _ + _ ≤ 1+M := add_le_add (by simpa only [dist_comm, dist_eq_norm] using (hn x hx).le) (hM x hx) + _ ≤ max M 0+1 := by linarith [le_max_left M 0] + apply tendsto_integral_filter_of_dominated_convergence (fun x => (max M 0+1)*‖ψ x‖) + · exact Filter.Eventually.of_forall fun n => (integrable_mul_test_on (hF n) hψ hc ht).aestronglyMeasurable + · filter_upwards [hbd] with n hn + exact Filter.Eventually.of_forall fun x => by + by_cases hx : x ∈ tsupport ψ + · simpa only [norm_mul] using mul_le_mul_of_nonneg_right (hn x hx) (norm_nonneg (ψ x)) + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, norm_zero, le_refl] + · exact (hψ.norm.integrable_of_hasCompactSupport hc.norm).const_mul _ + · exact Filter.Eventually.of_forall fun x => by + by_cases hx : x ∈ tsupport ψ + · exact (hu'.tendsto_at hx).mul_const (ψ x) + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero] + exact tendsto_const_nhds + +theorem continuous_comp_locallyUniformlyOn + {F : ℕ → Position → ℝ} {f : Position → ℝ} {U : Set Position} {g : ℝ → ℝ} + (hu : TendstoLocallyUniformlyOn F f atTop U) (hf : ContinuousOn f U) + (hg : Continuous g) : + TendstoLocallyUniformlyOn (fun n x => g (F n x)) (fun x => g (f x)) atTop U := by + rw [tendstoLocallyUniformlyOn_iff_forall_tendsto] + intro x hx + have hj : Tendsto (fun z : ℕ × Position => F z.1 z.2) + (atTop ×ˢ 𝓝[U] x) (𝓝 (f x)) := by + apply tendsto_comp_of_locally_uniform_limit_within (hf x hx) tendsto_snd + intro v hv + obtain ⟨t, ht, hFt⟩ := hu v hv x hx + exact ⟨t, ht, tendsto_fst.eventually hFt⟩ + have hf' : Tendsto (fun z : ℕ × Position => f z.2) + (atTop ×ˢ 𝓝[U] x) (𝓝 (f x)) := Filter.Tendsto.comp (hf x hx) tendsto_snd + exact ((hg.continuousAt.tendsto.comp hf').prodMk_nhds + (hg.continuousAt.tendsto.comp hj)).mono_right (nhds_le_uniformity _) + +theorem HasWeakLaplacian.locallyUniformLimit + {Fn qn : ℕ → Position → ℝ} {F q : Position → ℝ} {U : Set Position} + (hU : IsOpen U) (hFc : ∀ n, ContinuousOn (Fn n) U) + (hqc : ∀ n, LocallyIntegrableOn (qn n) U) + (hF : ContinuousOn F U) (hq : ContinuousOn q U) + (hFu : TendstoLocallyUniformlyOn Fn F atTop U) + (hqu : TendstoLocallyUniformlyOn qn q atTop U) + (hw : ∀ n, HasWeakLaplacian (Fn n) U (qn n)) : HasWeakLaplacian F U q := by + intro φ hφ hc ht + have hl := tendsto_integral_mul_test_of_locallyUniformlyOn + (fun n => (hFc n).locallyIntegrableOn hU.measurableSet) hF hFu + (continuous_coordinateLaplacian (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top))) + (hasCompactSupport_coordinateLaplacian hc) ((tsupport_coordinateLaplacian_subset φ).trans ht) + have hr := tendsto_integral_mul_test_of_locallyUniformlyOn hqc hq hqu hφ.continuous hc ht + exact tendsto_nhds_unique + (hl.congr' (Filter.Eventually.of_forall fun n => hw n φ hφ hc ht)) hr + +def tfDensityScalar (t : ℝ) : ℝ := kTF*(max t 0)^(3/2 : ℝ) + +theorem tfDensityScalar_continuous : Continuous tfDensityScalar := by + exact continuous_const.mul ((Real.continuous_rpow_const (by norm_num : (0:ℝ)≤3/2)).comp + (continuous_id.max continuous_const)) + +theorem density_locallyUniform_of_vanishing_error + {Fn σn : ℕ → Position → ℝ} {F : Position → ℝ} {U : Set Position} + (hFu : TendstoLocallyUniformlyOn Fn F atTop U) (hF : ContinuousOn F U) + (he : TendstoLocallyUniformlyOn (fun n x => σn n x-tfDensityScalar (Fn n x)) + (fun _ => 0) atTop U) : + TendstoLocallyUniformlyOn σn (fun x => tfDensityScalar (F x)) atTop U := by + have hh := he.add (continuous_comp_locallyUniformlyOn hFu hF tfDensityScalar_continuous) + change TendstoLocallyUniformlyOn (fun n x => σn n x-tfDensityScalar (Fn n x)+tfDensityScalar (Fn n x)) + (fun x => 0+tfDensityScalar (F x)) atTop U at hh + simpa only [sub_add_cancel, zero_add] using hh + +theorem screened_semilinear_limit + {σn : ℕ → Position → ℝ} {lam A : ℕ → ℝ} {F : Position → ℝ} + (hσi : ∀ n, Integrable (σn n)) (hσp : ∀ n x, 0 ≤ σn n x) + (hσbd : ∀ n x, σn n x ≤ A n) + (hF : ContinuousOn F {x | x ≠ 0}) + (hFu : TendstoLocallyUniformlyOn (fun n => screenedField (lam n) (σn n)) F atTop {x | x ≠ 0}) + (he : TendstoLocallyUniformlyOn + (fun n x => σn n x-tfDensityScalar (screenedField (lam n) (σn n) x)) + (fun _ => 0) atTop {x | x ≠ 0}) : + HasWeakLaplacian F {x | x ≠ 0} (fun x => tfReaction (F x)) := by + have hσu := density_locallyUniform_of_vanishing_error hFu hF he + have hqu := continuous_comp_locallyUniformlyOn (g := fun t : ℝ => (4*Real.pi)*t) hσu + (tfDensityScalar_continuous.comp_continuousOn hF) (continuous_const.mul continuous_id) + have hqr : TendstoLocallyUniformlyOn (fun n x => (4*Real.pi)*σn n x) + (fun x => tfReaction (F x)) atTop {x | x ≠ 0} := by + convert hqu using 1 + funext x + simp only [tfReaction, tfDensityScalar] + ring + exact HasWeakLaplacian.locallyUniformLimit isOpen_ne + (fun n => screenedField_continuousOn (hσi n) (hσp n) (hσbd n)) + (fun n => ((hσi n).const_mul (4*Real.pi)).locallyIntegrable.locallyIntegrableOn _) + hF (tfReaction_continuous.comp_continuousOn hF) hFu hqr + (fun n => screenedField_weakLaplacian (hσi n) (hσp n) (hσbd n)) + +theorem poisson_interior_estimates_uniform {r A M : ℝ} + (hr : 0 < r) (hA : 0 ≤ A) (hM : 0 ≤ M) : + ∃ C : ℝ, 0 < C ∧ ∀ (c : Position) (F σ : Position → ℝ), + ContinuousOn F (Metric.ball c (3*r)) → + HasWeakLaplacian F (Metric.ball c (2*r)) (fun x => 4*Real.pi*σ x) → + IntegrableOn σ (Metric.closedBall c (3*r)) → + (∀ x ∈ Metric.closedBall c (3*r), 0 ≤ σ x) → + (∀ x ∈ Metric.closedBall c (3*r), σ x ≤ A) → + (∫ x in Metric.closedBall c (2*r), ‖F x‖) ≤ M → + (∀ z ∈ Metric.closedBall c r, ‖F z‖ ≤ C) ∧ + (∀ z ∈ Metric.closedBall c r, ∀ z' ∈ Metric.closedBall c r, + ‖F z-F z'‖ ≤ C*‖z-z'‖) := by + obtain ⟨HC, hHC, hest⟩ := harmonic_interior_estimates_local hr + let V := (volume (Metric.closedBall (0 : Position) (3*r))).toReal + let V' := (volume (Metric.closedBall (0 : Position) (2*r))).toReal + let PB := A*(∫ y in Metric.ball (0 : Position) 1, coulombKernel y)+A*V + let LB := A*(∫ y in Metric.ball (0 : Position) 1, (coulombKernel y)^2)+A*V + have hPB : 0 ≤ PB := add_nonneg (mul_nonneg hA (integral_nonneg coulombKernel_nonneg)) + (mul_nonneg hA ENNReal.toReal_nonneg) + have hLB : 0 ≤ LB := add_nonneg (mul_nonneg hA (integral_nonneg (fun y => sq_nonneg _))) + (mul_nonneg hA ENNReal.toReal_nonneg) + let H := M+PB*V' + have hH : 0 ≤ H := add_nonneg hM (mul_nonneg hPB ENNReal.toReal_nonneg) + let C := HC*H+PB+LB+1 + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨C, hC, ?_⟩ + intro c F σ hF hpoisson hσ hσpos hσbd hIF + let W := Metric.closedBall c (3*r) + let W' := Metric.closedBall c (2*r) + have hV : (volume W).toReal = V := by + simp only [W, V, EuclideanSpace.volume_closedBall] + have hV' : (volume W').toReal = V' := by + simp only [W', V', EuclideanSpace.volume_closedBall] + let ρ := W.indicator σ + have hρ : Integrable ρ := (integrable_indicator_iff measurableSet_closedBall).mpr hσ + have hρpos : ∀ x, 0 ≤ ρ x := fun x => Set.indicator_nonneg hσpos x + have hρbd : ∀ x, ρ x ≤ A := by + intro x + by_cases hx : x ∈ W + · simpa only [ρ, Set.indicator_of_mem hx] using hσbd x hx + · simpa only [ρ, Set.indicator_of_notMem hx] using hA + have hmass : (∫ x, ρ x) ≤ A*V := by + rw [show ρ = W.indicator σ from rfl, integral_indicator measurableSet_closedBall] + calc + (∫ x in W, σ x) ≤ ∫ _ in W, A := integral_mono_ae hσ + (integrableOn_const (isCompact_closedBall c (3*r)).measure_ne_top) + ((ae_restrict_mem measurableSet_closedBall).mono (fun x hx => hσbd x hx)) + _ = A*V := by simp only [integral_const, Measure.restrict_apply_univ, smul_eq_mul, + measureReal_def, hV, mul_comm] + let P := potentialOf ρ + have hPcont : Continuous P := potentialOf_continuous hρ hρpos hρbd + have hPbd (x : Position) : ‖P x‖ ≤ PB := by + have hp : 0 ≤ P x := integral_nonneg (fun y => mul_nonneg (coulombKernel_nonneg _) (hρpos y)) + rw [Real.norm_eq_abs, abs_of_nonneg hp] + exact (bounded_density_convolution measurable_coulombKernel coulombKernel_nonneg + (coulombKernel_integrableOn_ball 1) (fun _ => coulombKernel_le_one) + hρ hρpos hρbd x).2.trans (by dsimp only [PB]; linarith) + have hPlip (x y : Position) : ‖P x-P y‖ ≤ LB*‖x-y‖ := + (potentialOf_lipschitz_bound hρ hρpos hρbd x y).trans + (mul_le_mul_of_nonneg_right (by dsimp only [LB]; linarith) (norm_nonneg _)) + have hW' : W' ⊆ Metric.ball c (3*r) := by + intro x hx + change dist x c ≤ 2*r at hx + change dist x c < 3*r + linarith + have hball : Metric.ball c (2*r) ⊆ Metric.ball c (3*r) := + Metric.ball_subset_ball (by linarith) + let h : Position → ℝ := fun x => F x+P x + have hhcont : ContinuousOn h (Metric.ball c (3*r)) := hF.add hPcont.continuousOn + have hharm : HasWeakLaplacian h (Metric.ball c (2*r)) (fun _ => 0) := + local_harmonic_part Metric.isOpen_ball (hF.mono hball) hpoisson hρ hρpos hρbd (by + intro x hx + have hxW : x ∈ W := by + change dist x c ≤ 3*r + exact (hball hx).le + exact (Set.indicator_of_mem hxW σ).symm) + have hiF : IntegrableOn (fun x => ‖F x‖) W' := + ((hF.mono hW').norm).integrableOn_compact (isCompact_closedBall c (2*r)) + have hih : IntegrableOn (fun x => ‖h x‖) W' := + ((hhcont.mono hW').norm).integrableOn_compact (isCompact_closedBall c (2*r)) + have hiPB : IntegrableOn (fun _ : Position => PB) W' := + integrableOn_const (isCompact_closedBall c (2*r)).measure_ne_top + have hIh : (∫ x in W', ‖h x‖) ≤ H := by + calc + (∫ x in W', ‖h x‖) ≤ ∫ x in W', ‖F x‖+PB := integral_mono_ae hih (hiF.add hiPB) + (Filter.Eventually.of_forall (fun x => (norm_add_le (F x) (P x)).trans + (add_le_add le_rfl (hPbd x)))) + _ = (∫ x in W', ‖F x‖)+PB*V' := by + rw [integral_add hiF hiPB, integral_const] + simp only [Measure.restrict_apply_univ, smul_eq_mul, measureReal_def, hV', mul_comm] + _ ≤ H := by dsimp only [H]; linarith + obtain ⟨hval, hdiff⟩ := hest c h hhcont hharm + have hCval : HC*H+PB ≤ C := by dsimp [C]; linarith + have hClip : HC*H+LB ≤ C := by dsimp [C]; linarith + constructor + · intro z hz + calc + ‖F z‖ = ‖h z-P z‖ := by dsimp [h]; rw [add_sub_cancel_right] + _ ≤ ‖h z‖+‖P z‖ := norm_sub_le _ _ + _ ≤ HC*(∫ x in W', ‖h x‖)+PB := add_le_add (hval z hz) (hPbd z) + _ ≤ HC*H+PB := by linarith [mul_le_mul_of_nonneg_left hIh hHC.le] + _ ≤ C := hCval + · intro z hz z' hz' + calc + ‖F z-F z'‖ = ‖(h z-h z')-(P z-P z')‖ := by congr 1; dsimp [h]; ring + _ ≤ ‖h z-h z'‖+‖P z-P z'‖ := norm_sub_le _ _ + _ ≤ HC*(∫ x in W', ‖h x‖)*‖z-z'‖+LB*‖z-z'‖ := + add_le_add (hdiff z hz z' hz') (hPlip z z') + _ ≤ (HC*H+LB)*‖z-z'‖ := by + have hb := mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_left hIh hHC.le) + (norm_nonneg (z-z')) + nlinarith + _ ≤ C*‖z-z'‖ := mul_le_mul_of_nonneg_right hClip (norm_nonneg _) + +theorem tendsto_integral_norm_on_compact_of_locallyUniformlyOn + {Fn : ℕ → Position → ℝ} {F : Position → ℝ} {U K : Set Position} + (hK : IsCompact K) (hKU : K ⊆ U) + (hFn : ∀ n, ContinuousOn (Fn n) U) (hF : ContinuousOn F U) + (hu : TendstoLocallyUniformlyOn Fn F atTop U) : + Tendsto (fun n => ∫ x in K, ‖Fn n x‖) atTop (𝓝 (∫ x in K, ‖F x‖)) := by + have hu' := (tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact hK).mp (hu.mono hKU) + obtain ⟨M, hM⟩ := hK.exists_bound_of_continuousOn (hF.mono hKU) + have hbd : ∀ᶠ n in atTop, ∀ x ∈ K, ‖Fn n x‖ ≤ max M 0+1 := by + filter_upwards [(Metric.tendstoUniformlyOn_iff.mp hu') 1 (by norm_num)] with n hn x hx + calc + ‖Fn n x‖ ≤ ‖Fn n x-F x‖+‖F x‖ := norm_le_norm_sub_add _ _ + _ ≤ 1+M := add_le_add (by simpa only [dist_comm, dist_eq_norm] using (hn x hx).le) (hM x hx) + _ ≤ max M 0+1 := by linarith [le_max_left M 0] + apply tendsto_integral_filter_of_dominated_convergence (fun _ => max M 0+1) + · exact Filter.Eventually.of_forall fun n => + ((hFn n).mono hKU).norm.aestronglyMeasurable hK.measurableSet + · filter_upwards [hbd] with n hn + exact (ae_restrict_mem hK.measurableSet).mono fun x hx => by + simpa only [norm_norm] using hn x hx + · exact integrableOn_const hK.measure_ne_top + · exact (ae_restrict_mem hK.measurableSet).mono fun x hx => (hu'.tendsto_at hx).norm + +def closedNormAnnulus (a b : ℝ) : Set Position := {x | a ≤ ‖x‖ ∧ ‖x‖ ≤ b} + +theorem smul_closedNormAnnulus {D : ℝ} (hD : 0 < D) (a b : ℝ) : + D • closedNormAnnulus a b = closedNormAnnulus (D*a) (D*b) := by + ext x + rw [Set.mem_smul_set_iff_inv_smul_mem₀ hD.ne'] + simp only [closedNormAnnulus, Set.mem_ofPred_eq, norm_smul, Real.norm_eq_abs, + abs_of_pos (inv_pos.mpr hD), ← div_eq_inv_mul] + constructor + · rintro ⟨h1,h2⟩ + exact ⟨by simpa only [mul_comm] using (le_div_iff₀ hD).mp h1, + by simpa only [mul_comm] using (div_le_iff₀ hD).mp h2⟩ + · rintro ⟨h1,h2⟩ + exact ⟨(le_div_iff₀ hD).mpr (by simpa only [mul_comm] using h1), + (div_le_iff₀ hD).mpr (by simpa only [mul_comm] using h2)⟩ + +theorem volume_closedNormAnnulus_dilate {D : ℝ} (hD : 0 < D) (a b : ℝ) : + (volume (closedNormAnnulus (D*a) (D*b))).toReal = + D^3*(volume (closedNormAnnulus a b)).toReal := by + have hh := Measure.setIntegral_comp_smul_of_pos volume (fun _ : Position => (1 : ℝ)) + (closedNormAnnulus a b) hD + simp only [smul_closedNormAnnulus hD, Position, finrank_euclideanSpace_fin, + integral_const, Measure.restrict_apply_univ, smul_eq_mul, mul_one, measureReal_def] at hh + rw [hh] + field_simp + +theorem dilate_annular_lone_bound {F : Position → ℝ} {C D a b : ℝ} + (hD : 0 < D) (ha : 0 < a) + (hL : (∫ x in closedNormAnnulus (D*a) (D*b), ‖F x‖) ≤ + 2*(C/(D*a)^4)*(volume (closedNormAnnulus (D*a) (D*b))).toReal) : + (∫ x in closedNormAnnulus a b, ‖D^4*F (D • x)‖) ≤ + 2*(C/a^4)*(volume (closedNormAnnulus a b)).toReal := by + simp_rw [norm_mul, Real.norm_eq_abs (D^4), abs_of_nonneg (pow_nonneg hD.le 4), + integral_const_mul] + rw [Measure.setIntegral_comp_smul_of_pos volume (fun x => ‖F x‖) (closedNormAnnulus a b) hD] + simp only [Position, finrank_euclideanSpace_fin, smul_eq_mul, smul_closedNormAnnulus hD] + calc + D^4*((D^3)⁻¹*(∫ x in closedNormAnnulus (D*a) (D*b), ‖F x‖)) ≤ + D^4*((D^3)⁻¹*(2*(C/(D*a)^4)*(volume (closedNormAnnulus (D*a) (D*b))).toReal)) := by + gcongr + _ = 2*(C/a^4)*(volume (closedNormAnnulus a b)).toReal := by + rw [volume_closedNormAnnulus_dilate hD] + field_simp + +theorem neutral_screened_limit_annular_lone + {σn : ℕ → Position → ℝ} {lam A : ℕ → ℝ} {F : Position → ℝ} {C a b : ℝ} + (hC : 0 ≤ C) (ha : 0 < a) + (hσi : ∀ n, Integrable (σn n)) (hσp : ∀ n x, 0 ≤ σn n x) + (hσbd : ∀ n x, σn n x ≤ A n) (hmass : ∀ n, (∫ x, σn n x) = lam n) + (hF : ContinuousOn F {x | x ≠ 0}) + (hFu : TendstoLocallyUniformlyOn (fun n => screenedField (lam n) (σn n)) F atTop {x | x ≠ 0}) + (hcap : ∀ᶠ n in atTop, ∀ x ∈ closedNormAnnulus a b, + screenedField (lam n) (σn n) x ≤ C/‖x‖^4) : + (∫ x in closedNormAnnulus a b, ‖F x‖) ≤ + 2*(C/a^4)*(volume (closedNormAnnulus a b)).toReal := by + have hK : IsCompact (closedNormAnnulus a b) := isCompact_closedNormAnnulus a b + have hKU : closedNormAnnulus a b ⊆ {x : Position | x ≠ 0} := by + intro x hx hz + have hh := hx.1 + rw [hz, norm_zero] at hh + linarith + have ht := tendsto_integral_norm_on_compact_of_locallyUniformlyOn hK hKU + (fun n => screenedField_continuousOn (hσi n) (hσp n) (hσbd n)) hF hFu + apply le_of_tendsto ht + filter_upwards [hcap] with n hn + exact neutral_annulus_lone_bound (hσi n) (hσp n) (hσbd n) (hmass n) ha hC + (fun x hxa hxb => hn x ⟨hxa,hxb⟩) + +end NeutralAtom +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/RetainedAnalyticSequence.lean b/lean/OAI/Analysis/CoulombRadii/Variational/RetainedAnalyticSequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..b49bbd0a569850a68af561c5ea2bf5513109da93 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/RetainedAnalyticSequence.lean @@ -0,0 +1,429 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.PuncturedPosition + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open ContinuousLinearMap +open scoped Topology BigOperators ContDiff Convolution Pointwise ENNReal +namespace NeutralAtom + +theorem tfDensityScalar_nonneg (t : ℝ) : 0 ≤ tfDensityScalar t := + mul_nonneg kTF_pos.le (Real.rpow_nonneg (le_max_right t 0) _) + +theorem tfDensityScalar_monotone : Monotone tfDensityScalar := by + intro s t hst + exact mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow (le_max_right s 0) (max_le_max_right 0 hst) (by norm_num)) kTF_pos.le + +theorem tfReaction_dilate {D : ℝ} (hD : 0 < D) (t : ℝ) : + tfReaction (D^4*t) = D^6*tfReaction t := by + have hm : max (D^4*t) 0 = D^4*max t 0 := by + rw [mul_max_of_nonneg t 0 (pow_nonneg hD.le 4), mul_zero] + have hr : (D^4)^(3/2 : ℝ) = D^6 := by + rw [← Real.rpow_natCast D 4, ← Real.rpow_mul hD.le] + norm_num + rw [tfReaction, hm, Real.mul_rpow (pow_nonneg hD.le 4) (le_max_right t 0), hr, tfReaction] + ring + +theorem semilinear_dilate {F : Position → ℝ} {D : ℝ} (hD : 0 < D) + (hw : HasWeakLaplacian F {x | x ≠ 0} (fun x => tfReaction (F x))) : + HasWeakLaplacian (fun x => D^4*F (D • x)) {x | x ≠ 0} + (fun x => tfReaction (D^4*F (D • x))) := by + have hh := hw.dilate hD + have hU : ((fun x : Position => D • x) ⁻¹' {x | x ≠ 0}) = {x | x ≠ 0} := by + ext x + change D • x ≠ 0 ↔ x ≠ 0 + exact ⟨fun hx => (smul_ne_zero_iff.mp hx).2, fun hx => smul_ne_zero hD.ne' hx⟩ + rw [hU] at hh + simpa only [tfReaction_dilate hD] using hh + +theorem continuousOn_dilate {F : Position → ℝ} {D : ℝ} (hD : 0 < D) + (hF : ContinuousOn F {x | x ≠ 0}) : + ContinuousOn (fun x => D^4*F (D • x)) {x | x ≠ 0} := by + apply continuousOn_const.mul + exact hF.comp (continuous_id.const_smul D).continuousOn + (fun x hx => smul_ne_zero hD.ne' hx) + +theorem dilate_cap {F : Position → ℝ} {D C : ℝ} (hD : 0 < D) + (hcap : ∀ x ≠ 0, F x ≤ C/‖x‖^4) : + ∀ x ≠ 0, D^4*F (D • x) ≤ C/‖x‖^4 := by + intro x hx + calc + D^4*F (D • x) ≤ D^4*(C/‖D • x‖^4) := + mul_le_mul_of_nonneg_left (hcap _ (smul_ne_zero hD.ne' hx)) (pow_nonneg hD.le 4) + _ = C/‖x‖^4 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos hD] + field_simp + +theorem semilinear_absolute_bound {F : Position → ℝ} {C : ℝ} + (hC : 0 ≤ C) (hF : ContinuousOn F {x | x ≠ 0}) + (hw : HasWeakLaplacian F {x | x ≠ 0} (fun x => tfReaction (F x))) + (hcap : ∀ x ≠ 0, F x ≤ C/‖x‖^4) + (hL : ∀ a b : ℝ, 0 < a → (∫ x in closedNormAnnulus a b, ‖F x‖) ≤ + 2*(C/a^4)*(volume (closedNormAnnulus a b)).toReal) : + ∃ K : ℝ, 0 < K ∧ ∀ x ≠ 0, ‖F x‖ ≤ K/‖x‖^4 := by + let V := closedNormAnnulus (1/2) 2 + let A := tfDensityScalar (C/(1/2)^4) + let M := 2*(C/(1/2)^4)*(volume V).toReal + have hA : 0 ≤ A := tfDensityScalar_nonneg _ + have hM : 0 ≤ M := by dsimp only [M]; positivity + obtain ⟨K, hK, hest⟩ := poisson_interior_estimates_uniform + (r := 1/8) (by norm_num) hA hM + have hunit : ∀ D : ℝ, 0 < D → ∀ c : Position, ‖c‖ = 1 → ‖D^4*F (D • c)‖ ≤ K := by + intro D hD c hc + let G : Position → ℝ := fun x => D^4*F (D • x) + let σ : Position → ℝ := fun x => tfDensityScalar (G x) + have hc0 : c ≠ 0 := by intro he; simp only [he, norm_zero] at hc; norm_num at hc + have hsub : Metric.closedBall c (3*(1/8)) ⊆ V := by + simpa only [hc, one_div, V, closedNormAnnulus, mul_one] using closedBall_eighth_subset_annulus hc0 + have hV : V ⊆ {x : Position | x ≠ 0} := by + intro x hx hz + have hh := hx.1 + rw [hz, norm_zero] at hh + norm_num at hh + have h3 : Metric.ball c (3*(1/8)) ⊆ {x : Position | x ≠ 0} := + (Metric.ball_subset_closedBall.trans hsub).trans hV + have h2 : Metric.ball c (2*(1/8)) ⊆ {x : Position | x ≠ 0} := + (Metric.ball_subset_ball (by norm_num : (2:ℝ)*(1/8) ≤ 3*(1/8))).trans h3 + have hCB : Metric.closedBall c (2*(1/8)) ⊆ V := + (Metric.closedBall_subset_closedBall (by norm_num : (2:ℝ)*(1/8) ≤ 3*(1/8))).trans hsub + have hGc : ContinuousOn G {x | x ≠ 0} := continuousOn_dilate hD hF + have hσc : ContinuousOn σ {x | x ≠ 0} := tfDensityScalar_continuous.comp_continuousOn hGc + have hσi : IntegrableOn σ (Metric.closedBall c (3*(1/8))) := + (hσc.mono (hsub.trans hV)).integrableOn_compact (isCompact_closedBall _ _) + have hσp : ∀ x ∈ Metric.closedBall c (3*(1/8)), 0 ≤ σ x := + fun x _ => tfDensityScalar_nonneg _ + have hσbd : ∀ x ∈ Metric.closedBall c (3*(1/8)), σ x ≤ A := by + intro x hx + apply tfDensityScalar_monotone + exact (dilate_cap hD hcap x (hV (hsub hx))).trans + (div_le_div_of_nonneg_left hC (by norm_num) + (pow_le_pow_left₀ (by norm_num : (0:ℝ) ≤ 1/2) (hsub hx).1 4)) + have hGw : HasWeakLaplacian G (Metric.ball c (2*(1/8))) (fun x => 4*Real.pi*σ x) := by + have hh := (semilinear_dilate hD hw).mono h2 + convert hh using 1 + funext x + simp only [σ, G, tfDensityScalar, tfReaction] + ring + have hIF : (∫ x in Metric.closedBall c (2*(1/8)), ‖G x‖) ≤ M := by + calc + (∫ x in Metric.closedBall c (2*(1/8)), ‖G x‖) ≤ ∫ x in V, ‖G x‖ := + setIntegral_mono_set ((hGc.mono hV).norm.integrableOn_compact + (isCompact_closedNormAnnulus _ _)) (Filter.Eventually.of_forall fun x => norm_nonneg _) + (Filter.Eventually.of_forall hCB) + _ ≤ M := dilate_annular_lone_bound hD (by norm_num : (0:ℝ)<1/2) + (hL (D*(1/2)) (D*2) (by positivity)) + exact (hest c G σ (hGc.mono h3) hGw hσi hσp hσbd hIF).1 c + (Metric.mem_closedBall_self (by norm_num)) + refine ⟨K,hK,?_⟩ + intro x hx + have hn : 0 < ‖x‖ := norm_pos_iff.mpr hx + let c : Position := ‖x‖⁻¹ • x + have hc : ‖c‖ = 1 := by + change ‖‖x‖⁻¹ • x‖ = 1 + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hn), inv_mul_cancel₀ hn.ne'] + have he : ‖x‖ • c = x := by + change ‖x‖ • (‖x‖⁻¹ • x) = x + rw [smul_smul, mul_inv_cancel₀ hn.ne', one_smul] + have hb := hunit ‖x‖ hn c hc + rw [he, norm_mul, Real.norm_eq_abs (‖x‖^4), abs_of_nonneg (pow_nonneg hn.le 4)] at hb + exact (le_div_iff₀ (pow_pos hn 4)).mpr (by simpa only [mul_comm] using hb) + +theorem eventual_barrier_boundary + {Fn Un Ln : ℕ → Position → ℝ} {F : Position → ℝ} {a : ℕ → ℝ} + {Cinv K S : ℝ} (hS : 0 < S) + (hu : TendstoLocallyUniformlyOn Fn F atTop {x | x ≠ 0}) + (ha : Tendsto a atTop (𝓝 0)) + (hF : ∀ x ≠ 0, ‖F x‖ ≤ K/‖x‖^4) + (hU : ∀ n x, a n ≤ ‖x‖ → Un n x ≤ Cinv/‖x‖^4) + (hL : ∀ n x, 0 ≤ Ln n x) : + ∀ᶠ n in atTop, ∀ x : Position, ‖x‖ = S → + Un n x-Fn n x-Ln n x-(Cinv+K+1)/S^4 ≤ 0 := by + have hsub : Metric.sphere (0 : Position) S ⊆ {x | x ≠ 0} := by + intro x hx hz + have hh : ‖x‖ = S := by simpa only [Metric.mem_sphere, dist_zero_right] using hx + subst x + simp only [norm_zero] at hh + linarith + have hu' := (tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact + (isCompact_sphere (0 : Position) S)).mp (hu.mono hsub) + filter_upwards [(Metric.tendstoUniformlyOn_iff.mp hu') (1/S^4) (by positivity), + ha.eventually (gt_mem_nhds hS)] with n hn han x hx + have hxs : x ∈ Metric.sphere (0 : Position) S := by simpa only [Metric.mem_sphere, dist_zero_right] using hx + have hx0 := hsub hxs + have he : ‖Fn n x-F x‖ ≤ 1/S^4 := by + simpa only [dist_comm, dist_eq_norm] using (hn x hxs).le + have hfn : ‖Fn n x‖ ≤ (K+1)/S^4 := by + calc + ‖Fn n x‖ ≤ ‖Fn n x-F x‖+‖F x‖ := norm_le_norm_sub_add _ _ + _ ≤ 1/S^4+K/S^4 := add_le_add he (by simpa only [hx] using hF x hx0) + _ = (K+1)/S^4 := by ring + have hus : Un n x ≤ Cinv/S^4 := by + simpa only [hx] using hU n x (by rw [hx]; exact han.le) + have hneg : -Fn n x ≤ ‖Fn n x‖ := by simpa only [Real.norm_eq_abs] using neg_le_abs (Fn n x) + have hls := hL n x + have hc : (Cinv+K+1)/S^4 = Cinv/S^4+(K+1)/S^4 := by ring + rw [hc] + linarith + +theorem barrier_lower_of_eventual_comparison + {Fn Un : ℕ → Position → ℝ} {Ln : ℝ → ℕ → Position → ℝ} + {F : Position → ℝ} {a : ℕ → ℝ} {B H : ℝ} + (ha : Tendsto a atTop (𝓝 0)) + (hF : ∀ x ≠ 0, Tendsto (fun n => Fn n x) atTop (𝓝 (F x))) + (hL : ∀ S x, x ≠ 0 → Tendsto (fun n => Ln S n x) atTop (𝓝 0)) + (hU : ∀ n x, a n ≤ ‖x‖ → B/‖x‖^4*(1-a n/(8*‖x‖)) ≤ Un n x) + (hcmp : ∀ S : ℝ, 0 < S → ∀ᶠ n in atTop, + ∀ x ∈ Metric.closedBall (0 : Position) S, Un n x ≤ Fn n x+Ln S n x+H/S^4) : + ∀ x ≠ 0, B/‖x‖^4 ≤ F x := by + intro x hx + have hn : 0 < ‖x‖ := norm_pos_iff.mpr hx + have hb : ∀ S : ℝ, ‖x‖ < S → B/‖x‖^4 ≤ F x+H/S^4 := by + intro S hS + have hal : ∀ᶠ n in atTop, a n ≤ ‖x‖ := + (ha.eventually (gt_mem_nhds hn)).mono (fun n h => h.le) + have ht1 : Tendsto (fun n => B/‖x‖^4*(1-a n/(8*‖x‖))) atTop (𝓝 (B/‖x‖^4)) := by + simpa only [zero_div, sub_zero, mul_one] using + (((tendsto_const_nhds (x := (1 : ℝ))).sub (ha.div_const (8*‖x‖))).const_mul (B/‖x‖^4)) + have ht2 : Tendsto (fun n => Fn n x+Ln S n x+H/S^4) atTop (𝓝 (F x+H/S^4)) := by + simpa only [add_zero] using ((hF x hx).add (hL S x hx)).add_const (H/S^4) + apply le_of_tendsto_of_tendsto ht1 ht2 + filter_upwards [hal, hcmp S (hn.trans hS)] with n han hcn + exact (hU n x han).trans (hcn x (by simpa only [Metric.mem_closedBall, dist_zero_right] using hS.le)) + have ht : Tendsto (fun S : ℝ => F x+H/S^4) atTop (𝓝 (F x)) := by + have hh : Tendsto (fun S : ℝ => (S^4)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_pow_atTop (by decide : 4 ≠ 0)) + simpa only [div_eq_mul_inv, mul_zero, add_zero] using (hh.const_mul H).const_add (F x) + apply ge_of_tendsto ht + exact (eventually_gt_atTop ‖x‖).mono (fun S hS => hb S hS) + +theorem correctionDensity_bound {q a S : ℝ} (ha : 0 < a) (x : Position) : + correctionDensity q a S x ≤ (q^8)⁻¹*(a^6)⁻¹ := by + by_cases hx : a ≤ ‖x‖ ∧ ‖x‖ ≤ S + · have hx' : x ∈ {y : Position | a ≤ ‖y‖ ∧ ‖y‖ ≤ S} := hx + rw [correctionDensity, Set.indicator_of_mem hx'] + exact mul_le_mul_of_nonneg_left + (inv_anti₀ (pow_pos ha 6) (pow_le_pow_left₀ ha.le hx.1 6)) (by positivity : 0 ≤ (q^8)⁻¹) + · have hx' : x ∉ {y : Position | a ≤ ‖y‖ ∧ ‖y‖ ≤ S} := hx + rw [correctionDensity, Set.indicator_of_notMem hx'] + positivity + +theorem potentialOf_add_bounded {ρ η : Position → ℝ} {A B : ℝ} + (hiρ : Integrable ρ) (hpρ : ∀ x, 0 ≤ ρ x) (hbρ : ∀ x, ρ x ≤ A) + (hiη : Integrable η) (hpη : ∀ x, 0 ≤ η x) (hbη : ∀ x, η x ≤ B) (x : Position) : + potentialOf (ρ+η) x = potentialOf ρ x+potentialOf η x := by + have hi1 := (potential_integrable_and_bound (x := x) hiρ hpρ (by norm_num : (0:ℝ)<1) + (fun y _ => hbρ y)).1 + have hi2 := (potential_integrable_and_bound (x := x) hiη hpη (by norm_num : (0:ℝ)<1) + (fun y _ => hbη y)).1 + unfold potentialOf + simp only [Pi.add_apply, mul_add] + exact integral_add hi1 hi2 + +theorem full_correction_tendsto_zero {p : ℕ → Position → ℝ} {a q Ap : ℕ → ℝ} + (hi : ∀ n, Integrable (p n)) (hp : ∀ n x, 0 ≤ p n x) + (hb : ∀ n x, p n x ≤ Ap n) (hs : ∀ n x, a n < ‖x‖ → p n x = 0) + (ha : Tendsto a atTop (𝓝 0)) (hap : ∀ n, 0 < a n) + (hm : Tendsto (fun n => ∫ x, p n x) atTop (𝓝 0)) + (hq : Tendsto q atTop atTop) (hal : ∀ᶠ n in atTop, 1/(2*q n) ≤ a n) + (S : ℝ) {x : Position} (hx : x ≠ 0) : + Tendsto (fun n => potentialOf (fun y => p n y+correctionDensity (q n) (a n) S y) x) + atTop (𝓝 0) := by + have hh := (inner_potential_tendsto_zero hi hp hs ha hm hx).add + (correction_potential_tendsto_zero S hq hal hx) + simp only [add_zero] at hh + convert hh using 1 + funext n + exact potentialOf_add_bounded (hi n) (hp n) (hb n) + (correctionDensity_integrable_and_mass (hap n)).1 (correctionDensity_nonneg _ _ _) + (correctionDensity_bound (hap n)) x + +theorem screened_limit_positive + {σ U p : ℕ → Position → ℝ} {lam a q Aσ Ap : ℕ → ℝ} + {F : Position → ℝ} {B Cinv K : ℝ} + (hσi : ∀ n, Integrable (σ n)) (hσp : ∀ n x, 0 ≤ σ n x) + (hσb : ∀ n x, σ n x ≤ Aσ n) + (hpi : ∀ n, Integrable (p n)) (hpp : ∀ n x, 0 ≤ p n x) + (hpb : ∀ n x, p n x ≤ Ap n) (hps : ∀ n x, a n < ‖x‖ → p n x = 0) + (hpm : Tendsto (fun n => ∫ x, p n x) atTop (𝓝 0)) + (hap : ∀ n, 0 < a n) (ha : Tendsto a atTop (𝓝 0)) + (hq : Tendsto q atTop atTop) (hal : ∀ᶠ n in atTop, 1/(2*q n) ≤ a n) + (hUc : ∀ n, Continuous (fun x => U n x-lam n*coulombKernel x)) + (hUl : ∀ n x, a n ≤ ‖x‖ → B/‖x‖^4*(1-a n/(8*‖x‖)) ≤ U n x) + (hUu : ∀ n x, a n ≤ ‖x‖ → U n x ≤ Cinv/‖x‖^4) + (hUw : ∀ n, WeakNuclearSubsolution (U n) (lam n) Set.univ (barrierSource (a n) (U n) (σ n) (p n))) + (hband : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → + |σ n x-tfDensityScalar (screenedField (lam n) (σ n) x)| ≤ ((q n)^8)⁻¹*(‖x‖^6)⁻¹) + (hu : TendstoLocallyUniformlyOn (fun n => screenedField (lam n) (σ n)) F atTop {x | x ≠ 0}) + (hK : 0 ≤ K) (hF : ∀ x ≠ 0, ‖F x‖ ≤ K/‖x‖^4) : + ∀ x ≠ 0, B/‖x‖^4 ≤ F x := by + let L : ℝ → ℕ → Position → ℝ := fun S n => + potentialOf (fun y => p n y+correctionDensity (q n) (a n) S y) + have hLpos : ∀ S n x, 0 ≤ L S n x := fun S n x => + potentialOf_nonneg (fun y => add_nonneg (hpp n y) (correctionDensity_nonneg _ _ _ y)) x + have hUb : ∀ n x, a n ≤ ‖x‖ → U n x ≤ max Cinv 0/‖x‖^4 := by + intro n x hx + exact (hUu n x hx).trans (div_le_div_of_nonneg_right (le_max_left _ _) (by positivity)) + apply barrier_lower_of_eventual_comparison (H := max Cinv 0+K+1) ha + (fun x hx => hu.tendsto_at hx) (fun S x hx => + full_correction_tendsto_zero hpi hpp hpb hps ha hap hpm hq hal S hx) hUl + intro S hS + have hbdy := eventual_barrier_boundary (Ln := L S) hS hu ha hF hUb (hLpos S) + filter_upwards [hbdy, hq.eventually (eventually_ge_atTop S)] with n hbn hqn + have hAU : ∀ x, a n ≤ ‖x‖ → U n x ≤ max Cinv 0/(a n)^4 := by + intro x hx + exact (hUb n x hx).trans (div_le_div_of_nonneg_left (le_max_right _ _) + (pow_pos (hap n) 4) (pow_le_pow_left₀ (hap n).le hx 4)) + have hbw : WeakNuclearSubsolution (U n) (lam n) (Metric.ball 0 S) + (barrierSource (a n) (U n) (σ n) (p n)) := by + intro φ hφ hc ht hp + exact hUw n φ hφ hc (fun _ _ => Set.mem_univ _) hp + apply positive_barrier_comparison (hap n) hS (by positivity) (hUc n) hAU + (hσi n) (hσp n) (hσb n) (hpi n) (hpp n) (hpb n) + (correctionDensity_integrable_and_mass (hap n)).1 + (correctionDensity_nonneg _ _ _) (correctionDensity_bound (hap n)) hbw + · intro x hx hax + have hxS : ‖x‖ ≤ S := by + exact (show ‖x‖ < S by simpa only [Metric.mem_ball, dist_zero_right] using hx).le + have hb := (le_abs_self _).trans (hband n x hax (hxS.trans hqn)) + have heq : correctionDensity (q n) (a n) S x = ((q n)^8)⁻¹*(‖x‖^6)⁻¹ := by + exact Set.indicator_of_mem (show x ∈ {y : Position | a n ≤ ‖y‖ ∧ ‖y‖ ≤ S} from ⟨hax,hxS⟩) _ + rw [heq] + have hh := mul_le_mul_of_nonneg_left hb (by positivity : 0 ≤ 4*Real.pi) + dsimp only [tfReaction, tfDensityScalar, screenedField, screenedPotential] at hh ⊢ + nlinarith only [hh] + · exact hbn + +theorem expanding_annular_error_locallyUniform + {e : ℕ → Position → ℝ} {a q : ℕ → ℝ} + (ha : Tendsto a atTop (𝓝 0)) (hq : Tendsto q atTop atTop) + (hband : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → |e n x| ≤ ((q n)^8)⁻¹*(‖x‖^6)⁻¹) : + TendstoLocallyUniformlyOn e (fun _ => 0) atTop {x | x ≠ 0} := by + apply Metric.tendstoLocallyUniformlyOn_iff.mpr + intro ε hε x hx + have hn : 0 < ‖x‖ := norm_pos_iff.mpr hx + refine ⟨Metric.ball x (‖x‖/4), mem_nhdsWithin_of_mem_nhds (Metric.ball_mem_nhds x (by positivity)), ?_⟩ + have hq8 : Tendsto (fun n => ((q n)^8)⁻¹*((‖x‖/2)^6)⁻¹) atTop (𝓝 0) := by + simpa only [Function.comp_def, zero_mul] using + (tendsto_inv_atTop_zero.comp ((tendsto_pow_atTop (by decide : 8 ≠ 0)).comp hq)).mul_const (((‖x‖/2)^6)⁻¹) + filter_upwards [ha.eventually (gt_mem_nhds (half_pos hn)), + hq.eventually (eventually_ge_atTop (2*‖x‖)), hq8.eventually (gt_mem_nhds hε)] with n han hqn hen y hy + have hy' : ‖x-y‖ < ‖x‖/4 := by simpa only [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using hy + have hyl : ‖x‖/2 ≤ ‖y‖ := by linarith [norm_le_norm_sub_add x y] + have hyu : ‖y‖ ≤ 2*‖x‖ := by + have hh := norm_le_norm_sub_add y x + rw [norm_sub_rev] at hh + linarith + have hh := hband n y (han.le.trans hyl) (hyu.trans hqn) + have hinv := inv_anti₀ (pow_pos (half_pos hn) 6) (pow_le_pow_left₀ (half_pos hn).le hyl 6) + have hle := hh.trans (mul_le_mul_of_nonneg_left hinv (by positivity : 0 ≤ ((q n)^8)⁻¹)) + simpa only [dist_zero_left, Real.norm_eq_abs] using hle.trans_lt hen + +theorem expanding_annular_cap_limit {Fn : ℕ → Position → ℝ} {F : Position → ℝ} + {a q : ℕ → ℝ} {C : ℝ} + (ha : Tendsto a atTop (𝓝 0)) (hq : Tendsto q atTop atTop) + (hcap : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → Fn n x ≤ C/‖x‖^4) + (hu : TendstoLocallyUniformlyOn Fn F atTop {x | x ≠ 0}) : + ∀ x ≠ 0, F x ≤ C/‖x‖^4 := by + intro x hx + apply le_of_tendsto (hu.tendsto_at hx) + filter_upwards [ha.eventually (gt_mem_nhds (norm_pos_iff.mpr hx)), + hq.eventually (eventually_ge_atTop ‖x‖)] with n han hqn + exact hcap n x han.le hqn + +theorem expanding_annular_cap_eventually {Fn : ℕ → Position → ℝ} + {a q : ℕ → ℝ} {C d r : ℝ} (hd : 0 < d) + (ha : Tendsto a atTop (𝓝 0)) (hq : Tendsto q atTop atTop) + (hcap : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → Fn n x ≤ C/‖x‖^4) : + ∀ᶠ n in atTop, ∀ x : Position, d ≤ ‖x‖ → ‖x‖ ≤ r → Fn n x ≤ C/‖x‖^4 := by + filter_upwards [ha.eventually (gt_mem_nhds hd), hq.eventually (eventually_ge_atTop r)] with n han hqn x hxd hxr + exact hcap n x (han.le.trans hxd) (hxr.trans hqn) + +theorem expanding_annular_density_bound + {Fn σ : ℕ → Position → ℝ} {a q : ℕ → ℝ} {C d r : ℝ} {f : ℝ → ℝ} + (hf : Monotone f) (hfp : ∀ t, 0 ≤ f t) (hC : 0 ≤ C) (hd : 0 < d) + (ha : Tendsto a atTop (𝓝 0)) (hq : Tendsto q atTop atTop) + (hcap : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → Fn n x ≤ C/‖x‖^4) + (herr : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → |σ n x-f (Fn n x)| ≤ ((q n)^8)⁻¹*(‖x‖^6)⁻¹) : + ∃ A : ℝ, 0 ≤ A ∧ ∀ᶠ n in atTop, ∀ x : Position, d ≤ ‖x‖ → ‖x‖ ≤ r → + Fn n x ≤ C/‖x‖^4 ∧ σ n x ≤ A := by + refine ⟨f (C/d^4)+(d^6)⁻¹, add_nonneg (hfp _) (by positivity), ?_⟩ + filter_upwards [ha.eventually (gt_mem_nhds hd), hq.eventually (eventually_ge_atTop r), + hq.eventually (eventually_ge_atTop 1)] with n han hqn hq1 x hxd hxr + have hax := han.le.trans hxd + have hxq := hxr.trans hqn + have hfc := hcap n x hax hxq + refine ⟨hfc, ?_⟩ + have hff := hf (hfc.trans (div_le_div_of_nonneg_left hC (pow_pos hd 4) + (pow_le_pow_left₀ hd.le hxd 4))) + have invq : ((q n)^8)⁻¹ ≤ 1 := by + have hh := inv_anti₀ (by norm_num : (0:ℝ)<1) (show (1:ℝ) ≤ (q n)^8 from one_le_pow₀ hq1) + simpa only [inv_one] using hh + have hinv := inv_anti₀ (pow_pos hd 6) (pow_le_pow_left₀ hd.le hxd 6) + have he := (le_abs_self _).trans (herr n x hax hxq) + have hle : ((q n)^8)⁻¹*(‖x‖^6)⁻¹ ≤ (d^6)⁻¹ := by + exact (mul_le_mul_of_nonneg_left hinv (by positivity)).trans (by nlinarith [inv_nonneg.mpr (pow_nonneg hd.le 6)]) + linarith + +theorem locallyUniform_of_subsequence + {X Y : Type*} [TopologicalSpace X] [LocallyCompactSpace X] [UniformSpace Y] + {U : Set X} (hU : IsOpen U) {f : ℕ → X → Y} {g : X → Y} + (hc : ∀ n, ContinuousOn (f n) U) (hg : ContinuousOn g U) + (hsub : ∀ u : ℕ → ℕ, Tendsto u atTop atTop → ∃ v : ℕ → ℕ, + TendstoLocallyUniformlyOn (fun n => f (u (v n))) g atTop U) : + TendstoLocallyUniformlyOn f g atTop U := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + let F : ℕ → C(U,Y) := fun n => ⟨fun x => f n x, continuousOn_iff_continuous_domRestrict.mp (hc n)⟩ + let G : C(U,Y) := ⟨fun x => g x, continuousOn_iff_continuous_domRestrict.mp hg⟩ + apply tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mpr + change TendstoLocallyUniformly (fun n x => F n x) G atTop + apply ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp + apply tendsto_of_subseq_tendsto + intro u hu + obtain ⟨v,hv⟩ := hsub u hu + refine ⟨v, ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mpr ?_⟩ + exact tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe.mp hv + +structure RetainedAnalyticSequence where + σ : ℕ → Position → ℝ + U : ℕ → Position → ℝ + p : ℕ → Position → ℝ + lam : ℕ → ℝ + a : ℕ → ℝ + q : ℕ → ℝ + Aσ : ℕ → ℝ + Ap : ℕ → ℝ + B : ℝ + Ccap : ℝ + Cinv : ℝ + Bpos : 0 < B + Cpos : 0 ≤ Ccap + σi : ∀ n, Integrable (σ n) + σp : ∀ n x, 0 ≤ σ n x + σb : ∀ n x, σ n x ≤ Aσ n + σmass : ∀ n, (∫ x, σ n x) = lam n + pi : ∀ n, Integrable (p n) + pp : ∀ n x, 0 ≤ p n x + pb : ∀ n x, p n x ≤ Ap n + ps : ∀ n x, a n < ‖x‖ → p n x = 0 + pm : Tendsto (fun n => ∫ x, p n x) atTop (𝓝 0) + apos : ∀ n, 0 < a n + alim : Tendsto a atTop (𝓝 0) + qlim : Tendsto q atTop atTop + aq : ∀ᶠ n in atTop, 1/(2*q n) ≤ a n + Ucont : ∀ n, Continuous (fun x => U n x-lam n*coulombKernel x) + Ulower : ∀ n x, a n ≤ ‖x‖ → B/‖x‖^4*(1-a n/(8*‖x‖)) ≤ U n x + Uupper : ∀ n x, a n ≤ ‖x‖ → U n x ≤ Cinv/‖x‖^4 + Uweak : ∀ n, WeakNuclearSubsolution (U n) (lam n) Set.univ (barrierSource (a n) (U n) (σ n) (p n)) + cap : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → screenedField (lam n) (σ n) x ≤ Ccap/‖x‖^4 + err : ∀ n x, a n ≤ ‖x‖ → ‖x‖ ≤ q n → + |σ n x-tfDensityScalar (screenedField (lam n) (σ n) x)| ≤ ((q n)^8)⁻¹*(‖x‖^6)⁻¹ + +end NeutralAtom +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/RetainedMasterTransfer.lean b/lean/OAI/Analysis/CoulombRadii/Variational/RetainedMasterTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..31a5966ac6b0ee2ac39997f75b582086938a896b --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/RetainedMasterTransfer.lean @@ -0,0 +1,97 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.AtomicMasterUniform +import OAI.Analysis.CoulombRadii.Packets.RetainedInverseOffset + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators ENNReal NNReal Classical Topology SchwartzMap +noncomputable section +namespace NeutralAtom + +theorem physical_retained_master_fresh_transfer {D c A ε : ℝ} + (hD : 0≤D) (hc : 0 r₀*2^k.val) j ⁻¹' B) → + ∀ (y : Position) (hy : y≠0), r₀≤‖y‖ → Coulomb.atomicCellScale y≤A*(r₀*2^j) → + ∃ u : Coulomb.H1Vector (N+1), Coulomb.Antisymmetric u ∧ Coulomb.mass u=1 ∧ + Coulomb.form (Coulomb.atom Z hZ) u≤E+retainedInverseOffset D (r₀*2^j) ∧ + (∀ F : Coulomb.Configuration (N+1) → ℝ, Coulomb.potentialForm F u= + (stateWeightedIntegral ψ (arrayEventLikelihood + (fun k : RetainedScales J j => (r₀*2^k.val.val)^(101/100:ℝ)) + (retainedTailObservation j ⁻¹' B)))⁻¹* + stateWeightedIntegral ψ (fun x => arrayEventLikelihood + (fun k : RetainedScales J j => (r₀*2^k.val.val)^(101/100:ℝ)) + (retainedTailObservation j ⁻¹' B) x*F (flattenConfiguration (N+1) x))) ∧ + ∃ t : ℝ, ∃ ht : t∈Set.Icc (5*Coulomb.atomicCellScale y) (6*Coulomb.atomicCellScale y), + ∃ T : Coulomb.AtomicBudgetHistory (Coulomb.atom Z hZ) u + (Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ))) 1, + T.ensemble.totalForm (Coulomb.atom Z hZ)≤Coulomb.form (Coulomb.atom Z hZ) u+ + Coulomb.thinIMS u y t ((Coulomb.atomicCellScale y)^(6/5:ℝ)) ∧ + T.ensemble.OutFermionic ∧ T.ensemble.CoreSupported {z | t≤‖z-y‖} ∧ + T.ensemble.OutSupported (Metric.closedBall y (t+(Coulomb.atomicCellScale y)^(6/5:ℝ))) ∧ + Coulomb.atomicPatchTFGap (Coulomb.atom Z hZ) (by intro i; rfl) T.ensemble y hy + ((Coulomb.atomicCellScale y)^(6/5:ℝ)) + (Real.rpow_pos_of_pos (Coulomb.atomicCellScale_pos hy) _) t ht.2≤ + 2*(Coulomb.atomicCellScale y)^(-349/50:ℝ) ∧ + T.ensemble.deletedSquare y t ((Coulomb.atomicCellScale y)^(6/5:ℝ))≤ + (72*Coulomb.atomicPatchCountFactor*Coulomb.atomicCountConstant)* + (Coulomb.atomicCellScale y)^(-29/5:ℝ) ∧ + ∀ (g₀ : 𝓢(Position,ℝ)), (∫ w,g₀ w^2)=1 → + (∀ w,g₀ w=g₀ (EuclideanSpace.single 0 ‖w‖)) → (∀ w,1<‖w‖ → g₀ w=0) → + |((Z:ℝ)*coulombKernel y- + potentialOf (mixturePacketDensity (rawLaw (fromH1Wave u)) g₀ c r₀ s) y)- + Coulomb.atomicPatchMeanField (Coulomb.atom Z hZ) (by intro i; rfl) T.ensemble y hy + ((Coulomb.atomicCellScale y)^(6/5:ℝ)) + (Real.rpow_pos_of_pos (Coulomb.atomicCellScale_pos hy) _) t ht.2|≤ + ε*(Coulomb.atomicCellScale y)^(-4:ℝ) := by + obtain ⟨s₁,hs₁,hs₁1,Hoff⟩ := exists_retainedInverseOffset_small hD hA + obtain ⟨s₂,hs₂,Hpatch⟩ := exists_atomic_master_fresh_uniform_transfer hc hA hε + refine ⟨min s₁ s₂,lt_min hs₁ hs₂,(min_le_left _ _).trans hs₁1,?_⟩ + intro N J Z hZ ψ g hd hn hmin E hE hbase r₀ s hr₀ hs hss j hrs B hB hprob y hy hry hya + have hr : 0 r₀*2^k.val) j ⁻¹' B)≤1 := measureReal_le_one + have hpEq := physical_retainedTailEvent_probability hd.2.2.1 hn + (fun k : Fin J => r₀*2^k.val) (fun k => by positivity) j hB + have hp0 := (pow_pos hr 42).trans_le hprob + obtain ⟨u,hu,hum,hue,hlaw⟩ := atomic_arrayEvent_state Z hZ hd hn hmin hbase + (fun k : RetainedScales J j => (r₀*2^k.val.val)^(101/100:ℝ)) + (fun k => Real.rpow_pos_of_pos (by positivity) _) + (hB.preimage (measurable_retainedTailObservation j)) + (fun p z => by simp only [mem_preimage,retainedTailObservation_permute]) + (hpEq ▸ hp0) + have hδ := retainedInverseOffset_nonneg hD hr (hrs₁.le.trans hs₁1) + have hue' : Coulomb.form (Coulomb.atom Z hZ) u≤E+retainedInverseOffset D (r₀*2^j) := by + apply hue.trans + apply add_le_add le_rfl + apply retained_event_offset_le hr₀ J j + · simpa only [←hpEq] using hprob + · simpa only [←hpEq] using hp1 + refine ⟨u,hu,hum,hue',hlaw,?_⟩ + obtain ⟨t,ht,T,hT,ho,hcs,hos,hG,hdel,hF⟩ := Hpatch (Coulomb.atom Z hZ) + (by intro i; rfl) u hu hum hE hue' hδ hr₀ hs (hss.trans_le (min_le_right _ _)) y hy hry + (hya.trans (mul_le_mul_of_nonneg_left hrs hA.le)) + (Hoff hr hrs₁ (Coulomb.atomicCellScale_pos hy) hya) + refine ⟨t,ht,T,hT,ho,hcs,hos,hG,hdel,?_⟩ + intro g₀ hgm hrad hgs + have H := hF g₀ hgm hrad hgs + simpa only [Coulomb.attraction,Coulomb.atom,Fin.sum_univ_one,zero_sub,sub_zero,norm_neg, + Coulomb.coulombKernel,coulombKernel] using H +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/SignAverage.lean b/lean/OAI/Analysis/CoulombRadii/Variational/SignAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa0bfa46bfe0d3676e9c0ed7b51781813621aae2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/SignAverage.lean @@ -0,0 +1,433 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FormDomain.ExplicitMultiplyGradient + +namespace OAI + +section +section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom +open scoped ENNReal Convolution + +theorem observationScore_weighted_pow_integrable (q : ℕ) : + Integrable (fun u : ℝ => |observationTranslationScore u|^q * + observationNoiseDensity u) := by + have hi : Integrable ((Set.Icc (-1:ℝ) 1).indicator + (fun _ => observationNoiseNormalizer * 2^q * ((2*q).factorial : ℝ))) := by + exact (integrableOn_const (by norm_num : (volume (Set.Icc (-1:ℝ) 1)) ≠ (⊤ : ℝ≥0∞))).integrable_indicator + measurableSet_Icc + apply hi.mono' ((observationTranslationScore_measurable.abs.pow_const q).mul + observationNoiseDensity_contDiff.continuous.measurable).aestronglyMeasurable + exact Filter.Eventually.of_forall fun u => by + change ‖|observationTranslationScore u|^q * observationNoiseDensity u‖ ≤ _ + rw [Real.norm_eq_abs, abs_of_nonneg + (mul_nonneg (pow_nonneg (abs_nonneg _) _) (observationNoiseDensity_nonneg u))] + exact observationScore_weighted_pow_bound q u + +theorem observationNoise_integral (f : ℝ → ℝ) : + (∫ u, f u ∂observationNoiseLaw) = + ∫ u, observationNoiseDensity u * f u := by + rw [observationNoiseLaw, integral_withDensity_eq_integral_toReal_smul] + · simp only [ENNReal.toReal_ofReal (observationNoiseDensity_nonneg _), smul_eq_mul] + · exact observationNoiseDensity_contDiff.continuous.measurable.ennreal_ofReal + · exact Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top + +theorem observationScore_pow_integrable (q : ℕ) : + Integrable (fun u => |observationTranslationScore u|^q) observationNoiseLaw := by + rw [observationNoiseLaw, integrable_withDensity_iff_integrable_smul'] + · simpa only [ENNReal.toReal_ofReal (observationNoiseDensity_nonneg _), + smul_eq_mul, mul_comm] using observationScore_weighted_pow_integrable q + · exact observationNoiseDensity_contDiff.continuous.measurable.ennreal_ofReal + · exact Filter.Eventually.of_forall fun _ => ENNReal.ofReal_lt_top + +theorem observationScore_moment_le_factorial (q : ℕ) : + (∫ u, |observationTranslationScore u|^q ∂observationNoiseLaw) ≤ + 2 * observationNoiseNormalizer * 2^q * ((2*q).factorial : ℝ) := by + classical + have hi : Integrable ((Set.Icc (-1:ℝ) 1).indicator + (fun _ => observationNoiseNormalizer * 2^q * ((2*q).factorial : ℝ))) := by + exact (integrableOn_const (by norm_num : (volume (Set.Icc (-1:ℝ) 1)) ≠ + (⊤ : ℝ≥0∞))).integrable_indicator measurableSet_Icc + rw [observationNoise_integral] + have h := integral_mono (observationScore_weighted_pow_integrable q) hi + (observationScore_weighted_pow_bound q) + rw [integral_indicator measurableSet_Icc] at h + simpa [mul_comm, mul_left_comm, mul_assoc, Measure.real, Real.volume_Icc, show (1+1:ℝ)=2 by norm_num] using h + +theorem observationScore_moment_le_pow (q : ℕ) (hq : 1 ≤ q) : + (∫ u, |observationTranslationScore u|^q ∂observationNoiseLaw) ≤ + (8 * max 1 (2 * observationNoiseNormalizer) * (q:ℝ)^2)^q := by + let B : ℝ := max 1 (2 * observationNoiseNormalizer) + have hB : 1 ≤ B := le_max_left _ _ + have hB0 : 0 ≤ B := le_trans zero_le_one hB + have hBp : 2 * observationNoiseNormalizer ≤ B^q := by + have hh : B^1 ≤ B^q := pow_le_pow_right₀ hB hq + exact (show 2 * observationNoiseNormalizer ≤ B from le_max_right _ _).trans + (by simpa only [pow_one] using hh) + have hc : 0 ≤ observationNoiseNormalizer := + inv_nonneg.mpr observationNoiseBase_integral_pos.le + have hfac : ((2*q).factorial : ℝ) ≤ (2*(q:ℝ))^(2*q) := by + exact_mod_cast Nat.factorial_le_pow (2*q) + calc + (∫ u, |observationTranslationScore u|^q ∂observationNoiseLaw) ≤ + 2 * observationNoiseNormalizer * 2^q * ((2*q).factorial : ℝ) := + observationScore_moment_le_factorial q + _ ≤ B^q * 2^q * (2*(q:ℝ))^(2*q) := + mul_le_mul (mul_le_mul_of_nonneg_right hBp (by positivity)) hfac + (by positivity) (by positivity) + _ = (8 * B * (q:ℝ)^2)^q := by + rw [pow_mul, ← mul_pow, ← mul_pow] + congr 1 + ring + +open scoped BigOperators + +def signAverage {ι : Type*} [Fintype ι] (f : (ι → Bool) → ℝ) : ℝ := + by classical exact (Fintype.card (ι → Bool) : ℝ)⁻¹ * ∑ ε, f ε + +def boolSign (b : Bool) : ℝ := if b then 1 else -1 + +theorem signAverage_const {ι : Type*} [Fintype ι] (c : ℝ) : + signAverage (ι := ι) (fun _ => c) = c := by + classical + unfold signAverage + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + rw [← mul_assoc, inv_mul_cancel₀ (by positivity), one_mul] + +theorem signAverage_nonneg {ι : Type*} [Fintype ι] {f : (ι → Bool) → ℝ} + (hf : ∀ ε, 0 ≤ f ε) : 0 ≤ signAverage f := by + classical + exact mul_nonneg (by positivity) (Finset.sum_nonneg fun ε _ => hf ε) + +theorem signAverage_mono {ι : Type*} [Fintype ι] {f g : (ι → Bool) → ℝ} + (hfg : ∀ ε, f ε ≤ g ε) : signAverage f ≤ signAverage g := by + classical + exact mul_le_mul_of_nonneg_left (Finset.sum_le_sum fun ε _ => hfg ε) (by positivity) + +theorem signAverage_add {ι : Type*} [Fintype ι] (f g : (ι → Bool) → ℝ) : + signAverage (fun ε => f ε + g ε) = signAverage f + signAverage g := by + classical + simp [signAverage, Finset.sum_add_distrib, mul_add] + +theorem signAverage_const_mul {ι : Type*} [Fintype ι] (c : ℝ) (f : (ι → Bool) → ℝ) : + signAverage (fun ε => c * f ε) = c * signAverage f := by + classical + simp [signAverage, ← Finset.mul_sum, mul_left_comm] + +theorem signAverage_prod {ι : Type*} [Fintype ι] (f : ι → Bool → ℝ) : + signAverage (fun ε => ∏ i, f i (ε i)) = + ∏ i, ((f i false + f i true) / 2) := by + classical + unfold signAverage + rw [← Fintype.prod_sum] + simp only [Fintype.card_fun, Fintype.card_bool, Nat.cast_pow, Nat.cast_ofNat, + Fintype.sum_bool, Finset.prod_div_distrib, Finset.prod_const, Finset.card_univ] + simp [div_eq_mul_inv, mul_comm, add_comm] + +theorem signAverage_exp_sum {ι : Type*} [Fintype ι] (c : ι → ℝ) (t : ℝ) : + signAverage (fun ε => Real.exp (t * ∑ i, boolSign (ε i) * c i)) ≤ + Real.exp (t^2 * (∑ i, (c i)^2) / 2) := by + classical + have he : (fun ε : ι → Bool => Real.exp (t * ∑ i, boolSign (ε i) * c i)) = + (fun ε : ι → Bool => ∏ i, Real.exp (t * (boolSign (ε i) * c i))) := by + funext ε + rw [Finset.mul_sum, Real.exp_sum] + rw [he, signAverage_prod (fun i b => Real.exp (t * (boolSign b * c i)))] + have hc : ∀ i, (Real.exp (t * (boolSign false * c i)) + + Real.exp (t * (boolSign true * c i))) / 2 = Real.cosh (t * c i) := by + intro i + simp [boolSign, Real.cosh_eq, add_comm] + simp_rw [hc] + calc + ∏ i, Real.cosh (t*c i) ≤ ∏ i, Real.exp ((t*c i)^2/2) := + Finset.prod_le_prod₀ (fun index _ => (Real.cosh_pos (t * c index)).le) + (fun index _ => Real.cosh_le_exp_half_sq (t * c index)) + _ = Real.exp (t^2 * (∑ i, (c i)^2) / 2) := by + rw [← Real.exp_sum] + congr 1 + simp_rw [mul_pow, div_eq_mul_inv, ← Finset.sum_mul, ← Finset.mul_sum] + +theorem even_pow_le_factorial_exp (x : ℝ) (k : ℕ) : + x^(2*k) ≤ ((2*k).factorial : ℝ) * (Real.exp x + Real.exp (-x)) := by + have hf : (0:ℝ) < (2*k).factorial := by positivity + by_cases hx : 0 ≤ x + · have h := (div_le_iff₀ hf).mp (Real.pow_div_factorial_le_exp x hx (2*k)) + nlinarith [Real.exp_pos (-x)] + · have h := (div_le_iff₀ hf).mp + (Real.pow_div_factorial_le_exp (-x) (by linarith) (2*k)) + rw [pow_mul, neg_sq, ← pow_mul] at h + nlinarith [Real.exp_pos x] + +theorem signAverage_scaled_even_pow_le {ι : Type*} [Fintype ι] + (f : (ι → Bool) → ℝ) {A : ℝ} + (hf : ∀ t : ℝ, signAverage (fun ε => Real.exp (t * f ε)) ≤ Real.exp (t^2*A/2)) + (t : ℝ) (k : ℕ) : + t^(2*k) * signAverage (fun ε => (f ε)^(2*k)) ≤ + 2 * ((2*k).factorial : ℝ) * Real.exp (t^2*A/2) := by + calc + t^(2*k) * signAverage (fun ε => (f ε)^(2*k)) = + signAverage (fun ε => (t * f ε)^(2*k)) := by + simp_rw [mul_pow, signAverage_const_mul] + _ ≤ signAverage (fun ε => ((2*k).factorial : ℝ) * + (Real.exp (t * f ε) + Real.exp (-(t * f ε)))) := + signAverage_mono fun ε => even_pow_le_factorial_exp (t*f ε) k + _ = ((2*k).factorial : ℝ) * + (signAverage (fun ε => Real.exp (t*f ε)) + + signAverage (fun ε => Real.exp ((-t)*f ε))) := by + rw [signAverage_const_mul, signAverage_add] + simp only [neg_mul] + _ ≤ ((2*k).factorial : ℝ) * + (Real.exp (t^2*A/2) + Real.exp ((-t)^2*A/2)) := + mul_le_mul_of_nonneg_left (add_le_add (hf t) (hf (-t))) (by positivity) + _ = 2 * ((2*k).factorial : ℝ) * Real.exp (t^2*A/2) := by rw [neg_sq]; ring + +theorem signAverage_even_pow_le_of_exp {ι : Type*} [Fintype ι] + (f : (ι → Bool) → ℝ) {A : ℝ} (hA : 0 < A) + (hf : ∀ t : ℝ, signAverage (fun ε => Real.exp (t*f ε)) ≤ Real.exp (t^2*A/2)) + (k : ℕ) (hk : 0 < k) : + signAverage (fun ε => (f ε)^(2*k)) ≤ + 2 * (2*(k:ℝ)*Real.exp 1)^k * A^k := by + have hq : 0 < 2*(k:ℝ) := by positivity + let t : ℝ := Real.sqrt (2*(k:ℝ)/A) + have ht : t^2 = 2*(k:ℝ)/A := Real.sq_sqrt (by positivity) + have hte : t^2*A/2 = (k:ℝ) := by rw [ht]; field_simp + have hr := signAverage_scaled_even_pow_le f hf t k + rw [show t^(2*k) = (2*(k:ℝ)/A)^k by rw [pow_mul, ht], hte] at hr + have hfac : ((2*k).factorial : ℝ) ≤ (2*(k:ℝ))^(2*k) := by + exact_mod_cast Nat.factorial_le_pow (2*k) + have hek : Real.exp (k:ℝ) = (Real.exp 1)^k := by + simpa only [mul_one] using Real.exp_nat_mul 1 k + apply (mul_le_mul_iff_left₀ (pow_pos hq k)).mp + calc + signAverage (fun ε => (f ε)^(2*k)) * (2*(k:ℝ))^k = + ((2*(k:ℝ)/A)^k * signAverage (fun ε => (f ε)^(2*k))) * A^k := by + rw [mul_right_comm, ← mul_pow, div_mul_cancel₀ _ hA.ne'] + ring + _ ≤ (2 * ((2*k).factorial : ℝ) * Real.exp (k:ℝ)) * A^k := + mul_le_mul_of_nonneg_right hr (pow_nonneg hA.le k) + _ ≤ (2 * (2*(k:ℝ))^(2*k) * Real.exp (k:ℝ)) * A^k := by + gcongr + _ = (2 * (2*(k:ℝ)*Real.exp 1)^k * A^k) * (2*(k:ℝ))^k := by + rw [hek, show (2*(k:ℝ))^(2*k) = ((2*(k:ℝ))^k)^2 by rw [← pow_mul]; congr 1; omega] + rw [mul_pow] + ring + +theorem signAverage_sum_even_pow {ι : Type*} [Fintype ι] + (c : ι → ℝ) (k : ℕ) (hk : 0 < k) : + signAverage (fun ε => (∑ i, boolSign (ε i) * c i)^(2*k)) ≤ + 2 * (2*(k:ℝ)*Real.exp 1)^k * (∑ i, (c i)^2)^k := by + classical + have hA : 0 ≤ ∑ i, (c i)^2 := Finset.sum_nonneg fun i _ => sq_nonneg _ + rcases hA.eq_or_lt with hzero | hpos + · have hc : ∀ i, c i = 0 := by + intro i + have hh : (c i)^2 ≤ ∑ i, (c i)^2 := + Finset.single_le_sum (fun j _ => sq_nonneg _) (Finset.mem_univ i) + rw [← hzero] at hh + nlinarith [sq_nonneg (c i)] + simp [hc, show 2*k ≠ 0 by omega, hk.ne', signAverage_const] + · exact signAverage_even_pow_le_of_exp _ hpos (signAverage_exp_sum c) k hk + +instance observationNoiseLaw_negInvariant : observationNoiseLaw.IsNegInvariant := by + constructor + ext s hs + change (Measure.map (fun u : ℝ => -u) observationNoiseLaw) s = observationNoiseLaw s + rw [Measure.map_apply measurable_neg hs] + unfold observationNoiseLaw + rw [withDensity_apply _ (measurable_neg hs), withDensity_apply _ hs, + ← lintegral_indicator (measurable_neg hs), ← lintegral_indicator hs] + have h := lintegral_neg_eq_self (μ := (volume : Measure ℝ)) + (s.indicator (fun u => ENNReal.ofReal (observationNoiseDensity u))) + convert h using 1 + congr 1 + funext u + classical + by_cases hu : -u ∈ s <;> simp [hu, observationNoiseDensity_even] + +theorem observationNoisePi_sign_preserving {ι : Type*} [Fintype ι] (ε : ι → Bool) : + MeasurePreserving (fun u : ι → ℝ => fun i => boolSign (ε i) * u i) + (Measure.pi fun _ : ι => observationNoiseLaw) + (Measure.pi fun _ : ι => observationNoiseLaw) := by + have hs (b : Bool) : MeasurePreserving (fun u : ℝ => boolSign b * u) + observationNoiseLaw observationNoiseLaw := by + cases b + · simpa [boolSign] using observationNoiseLaw.measurePreserving_neg + · convert! (MeasurePreserving.id observationNoiseLaw) using 1 + ext u + simp [boolSign] + refine ⟨Measurable.of_eval (fun index => measurable_const.mul (measurable_pi_apply index)), ?_⟩ + rw [Measure.pi_map_pi (fun i => (hs (ε i)).measurable.aemeasurable)] + simp_rw [(hs _).map_eq] + +theorem observationScore_memLp (q : ℕ) (hq : q ≠ 0) : + MemLp observationTranslationScore (q : ℝ≥0∞) observationNoiseLaw := by + apply (integrable_norm_rpow_iff + observationTranslationScore_measurable.aestronglyMeasurable + (by exact_mod_cast hq) (by simp)).mp + simpa using observationScore_pow_integrable q + +theorem observationScorePi_sum_memLp {ι : Type*} [Fintype ι] + (a : ι → ℝ) (q : ℕ) (hq : q ≠ 0) : + MemLp (fun u : ι → ℝ => ∑ i, a i * observationTranslationScore (u i)) + (q : ℝ≥0∞) (Measure.pi fun _ : ι => observationNoiseLaw) := by + classical + apply memLp_finsetSum + intro i _ + exact ((observationScore_memLp q hq).comp_measurePreserving + (measurePreserving_eval (fun _ : ι => observationNoiseLaw) i)).const_mul (a i) + +theorem observationScorePi_sum_pow_integrable {ι : Type*} [Fintype ι] + (a : ι → ℝ) (q : ℕ) (hq : q ≠ 0) : + Integrable (fun u : ι → ℝ => |∑ i, a i * observationTranslationScore (u i)|^q) + (Measure.pi fun _ : ι => observationNoiseLaw) := by + simpa only [Real.norm_eq_abs] using + (observationScorePi_sum_memLp a q hq).integrable_norm_pow hq + +theorem weighted_sum_pow_le {ι : Type*} [Fintype ι] + (w z : ι → ℝ) (hw : ∀ i, 0 ≤ w i) (hz : ∀ i, 0 ≤ z i) + (k : ℕ) (hk : 0 < k) : + (∑ i, w i * z i)^k ≤ (∑ i, w i)^(k-1) * ∑ i, w i * (z i)^k := by + classical + let A := ∑ i, w i + have hA : 0 ≤ A := Finset.sum_nonneg (fun i _ => hw i) + rcases hA.eq_or_lt with hzA | hpA + · have hw0 : ∀ i, w i = 0 := by + intro i + have hi : w i ≤ A := Finset.single_le_sum (fun j _ => hw j) (Finset.mem_univ i) + linarith [hw i] + simp [hw0, hk.ne'] + · have hs : ∑ i, w i / A = 1 := by + rw [← Finset.sum_div] + exact div_self hpA.ne' + have hj := (convexOn_pow k).map_sum_le (t := Finset.univ) + (w := fun i => w i / A) (p := z) + (fun i _ => div_nonneg (hw i) hpA.le) hs (fun i _ => hz i) + simp only [smul_eq_mul] at hj + have he (f : ι → ℝ) : ∑ i, w i / A * f i = (∑ i, w i * f i) / A := by + simp only [div_mul_eq_mul_div, Finset.sum_div] + rw [he z, he (fun i => z i ^ k), div_pow] at hj + have hj' := (div_le_div_iff₀ (pow_pos hpA k) hpA).mp hj + have hkA : A^k = A^(k-1) * A := by + rw [← pow_succ] + congr 1 + omega + rw [hkA] at hj' + exact (mul_le_mul_iff_left₀ hpA).mp (by nlinarith [hj']) + +theorem observationScore_sign (b : Bool) (u : ℝ) : + observationTranslationScore (boolSign b * u) = + boolSign b * observationTranslationScore u := by + cases b <;> simp [boolSign, observationTranslationScore_odd] + +theorem observationScorePi_signed_moment {ι : Type*} [Fintype ι] + (a : ι → ℝ) (ε : ι → Bool) (k : ℕ) : + (∫ u : ι → ℝ, (∑ i, boolSign (ε i) * (a i * observationTranslationScore (u i)))^(2*k) + ∂Measure.pi (fun _ : ι => observationNoiseLaw)) = + ∫ u : ι → ℝ, (∑ i, a i * observationTranslationScore (u i))^(2*k) + ∂Measure.pi (fun _ : ι => observationNoiseLaw) := by + classical + have hm : Measurable (fun u : ι → ℝ => + (∑ i, a i * observationTranslationScore (u i))^(2*k)) := by + apply Measurable.pow_const + exact Finset.measurable_sum _ (fun i _ => measurable_const.mul + (observationTranslationScore_measurable.comp (measurable_pi_apply i))) + have hp := observationNoisePi_sign_preserving ε + have h := integral_map (μ := Measure.pi (fun _ : ι => observationNoiseLaw)) + hp.measurable.aemeasurable hm.aestronglyMeasurable + rw [hp.map_eq] at h + simpa only [observationScore_sign, mul_left_comm (a _) (boolSign _)] using h.symm + +theorem integral_signAverage {ι Ω : Type*} [Fintype ι] [MeasurableSpace Ω] + (μ : Measure Ω) (f : (ι → Bool) → Ω → ℝ) + (hf : ∀ ε, Integrable (f ε) μ) : + (∫ u, signAverage (fun ε => f ε u) ∂μ) = + signAverage (fun ε => ∫ u, f ε u ∂μ) := by + classical + unfold signAverage + rw [integral_const_mul, integral_finsetSum _ (fun ε _ => hf ε)] + +theorem observationScorePi_moment_le {ι : Type*} [Fintype ι] + (a : ι → ℝ) (k : ℕ) (hk : 0 < k) : + (∫ u : ι → ℝ, |∑ i, a i * observationTranslationScore (u i)|^(2*k) + ∂Measure.pi (fun _ : ι => observationNoiseLaw)) ≤ + 2 * (2048 * Real.exp 1 * (max 1 (2*observationNoiseNormalizer))^2 * (k:ℝ)^5 * + (∑ i, (a i)^2))^k := by + classical + let μ := Measure.pi (fun _ : ι => observationNoiseLaw) + let A : ℝ := ∑ i, (a i)^2 + let B : ℝ := max 1 (2*observationNoiseNormalizer) + let K : ℝ := 2 * (2*(k:ℝ)*Real.exp 1)^k + have hA : 0 ≤ A := Finset.sum_nonneg (fun i _ => sq_nonneg _) + have hK : 0 ≤ K := by dsimp [K]; positivity + have hq : 2*k ≠ 0 := by omega + have heven (x : ℝ) : |x|^(2*k) = x^(2*k) := by + rw [pow_mul, sq_abs, ← pow_mul] + have hi (ε : ι → Bool) : Integrable (fun u : ι → ℝ => + (∑ i, boolSign (ε i) * (a i * observationTranslationScore (u i)))^(2*k)) μ := by + have hh := observationScorePi_sum_pow_integrable (fun i => boolSign (ε i) * a i) + (2*k) hq + simp only [heven, mul_assoc] at hh + exact hh + have havgI : Integrable (fun u : ι → ℝ => signAverage + (fun ε => (∑ i, boolSign (ε i) * (a i * observationTranslationScore (u i)))^(2*k))) μ := by + exact (integrable_finsetSum _ (fun ε _ => hi ε)).const_mul _ + have hexpI (i : ι) : Integrable (fun u : ι → ℝ => + (a i)^2 * |observationTranslationScore (u i)|^(2*k)) μ := by + exact (((measurePreserving_eval (fun _ : ι => observationNoiseLaw) i).integrable_comp + (observationScore_pow_integrable (2*k)).aestronglyMeasurable).mpr + (observationScore_pow_integrable (2*k))).const_mul _ + have hrhsI : Integrable (fun u : ι → ℝ => + K * A^(k-1) * (∑ i, (a i)^2 * |observationTranslationScore (u i)|^(2*k))) μ := + (integrable_finsetSum _ (fun i _ => hexpI i)).const_mul _ + have hpoint (u : ι → ℝ) : signAverage + (fun ε => (∑ i, boolSign (ε i) * (a i * observationTranslationScore (u i)))^(2*k)) ≤ + K * A^(k-1) * (∑ i, (a i)^2 * |observationTranslationScore (u i)|^(2*k)) := by + have hj := weighted_sum_pow_le (fun i => (a i)^2) + (fun i => (observationTranslationScore (u i))^2) (fun i => sq_nonneg _) + (fun i => sq_nonneg _) k hk + simp only [← pow_mul] at hj + simp only [heven] + have hkh := signAverage_sum_even_pow + (fun i => a i * observationTranslationScore (u i)) k hk + simp only [mul_pow] at hkh + exact hkh.trans (by simpa only [K, A, mul_pow, mul_assoc] using mul_le_mul_of_nonneg_left hj hK) + have hint := integral_mono havgI hrhsI hpoint + rw [integral_signAverage μ _ hi] at hint + dsimp [μ] at hint + simp_rw [observationScorePi_signed_moment] at hint + rw [signAverage_const, integral_const_mul, integral_finsetSum _ (fun i _ => hexpI i)] at hint + have hcoord (i : ι) : (∫ u : ι → ℝ, (a i)^2 * |observationTranslationScore (u i)|^(2*k) ∂μ) = + (a i)^2 * (∫ v : ℝ, |observationTranslationScore v|^(2*k) ∂observationNoiseLaw) := by + rw [integral_const_mul] + congr 1 + exact integral_comp_eval (μ := fun _ : ι => observationNoiseLaw) (i := i) + (observationScore_pow_integrable (2*k)).aestronglyMeasurable + simp_rw [hcoord] at hint + rw [← Finset.sum_mul] at hint + have hkA : A^(k-1) * A = A^k := by + rw [← pow_succ] + congr 1 + omega + have hbound := observationScore_moment_le_pow (2*k) (by omega) + have hbound' := mul_le_mul_of_nonneg_left hbound (mul_nonneg hK (pow_nonneg hA k)) + have hmoment : (∫ u : ι → ℝ, |∑ i, a i * observationTranslationScore (u i)|^(2*k) ∂μ) ≤ + K * A^k * (8 * B * (2*(k:ℝ))^2)^(2*k) := by + simp only [heven] + apply le_trans hint + simpa only [A, B, Nat.cast_mul, Nat.cast_ofNat, mul_assoc, ← hkA] using hbound' + refine hmoment.trans_eq ?_ + dsimp [K] + rw [show (8 * B * (2*(k:ℝ))^2)^(2*k) = ((8 * B * (2*(k:ℝ))^2)^2)^k by rw [pow_mul]] + rw [mul_assoc, ← mul_pow, mul_assoc, ← mul_pow] + congr 2 + dsimp [A, B] + ring + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/WeakAdd.lean b/lean/OAI/Analysis/CoulombRadii/Variational/WeakAdd.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bae96ec444f748412c388121dfeb2abfdd1a960 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/WeakAdd.lean @@ -0,0 +1,45 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Propagation.PropagationBarrierBounds + +namespace OAI + +section +open MeasureTheory Set Filter +open scoped BigOperators Topology ContDiff Classical +noncomputable section +namespace NeutralAtom + +lemma WeakLaplacianGE.add {f g q r : Position → ℝ} {U : Set Position} + (hf : Continuous f) (hg : Continuous g) + (hq : LocallyIntegrable q volume) (hr : LocallyIntegrable r volume) + (hwf : WeakLaplacianGE f U q) (hwg : WeakLaplacianGE g U r) : + WeakLaplacianGE (fun x => f x+g x) U (fun x => q x+r x) := by + intro φ hφ hc ht hp + have hL := (contDiff_coordinateLaplacian hφ).continuous + have hLc := hasCompactSupport_coordinateLaplacian hc + have hif := integrable_mul_compact_of_continuousAt (fun x _ => hf.continuousAt) hL hLc + have hig := integrable_mul_compact_of_continuousAt (fun x _ => hg.continuousAt) hL hLc + have hiq := integrable_mul_test_on (hq.locallyIntegrableOn U) hφ.continuous hc ht + have hir := integrable_mul_test_on (hr.locallyIntegrableOn U) hφ.continuous hc ht + simp_rw [add_mul] + rw [integral_add hiq hir,integral_add hif hig] + exact add_le_add (hwf φ hφ hc ht hp) (hwg φ hφ hc ht hp) + +lemma WeakLaplacianGE.quadratic (a : ℝ) : + WeakLaplacianGE (fun x : Position => a*‖x‖^2) univ (fun _ => 6*a) := by + apply WeakLaplacianGE.of_classical + (fun _ _ => (contDiff_const.mul (contDiff_norm_sq ℝ)).contDiffAt) + (continuous_const.locallyIntegrable.locallyIntegrableOn univ) + intro x hx + simpa only [sub_zero] using (coordinateLaplacian_quadratic (0:Position) x a).ge + +lemma WeakLaplacianGE.zero : WeakLaplacianGE (fun _ : Position => (0:ℝ)) univ (fun _ => 0) := by + intro φ hφ hc ht hp + simp + +end NeutralAtom +end + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/WeakLaplacian.lean b/lean/OAI/Analysis/CoulombRadii/Variational/WeakLaplacian.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5c332b8f7488d15cd84c89d899d648188bb140a --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/WeakLaplacian.lean @@ -0,0 +1,428 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.Axis + +namespace OAI + +section +section +noncomputable section +open MeasureTheory Filter +open scoped Topology BigOperators ContDiff +namespace NeutralAtom +open scoped Convolution +open ContinuousLinearMap + +theorem WeakLaplacianLower.congr {f g : Position → ℝ} {U : Set Position} {c : ℝ} + (h : WeakLaplacianLower f U c) (he : Set.EqOn f g U) : WeakLaplacianLower g U c := by + intro φ hφ hc ht hp + convert h φ hφ hc ht hp using 1 + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ tsupport φ + · rw [he (ht hx)] + · simp only [coordinateLaplacian_eq_zero_of_notMem_tsupport hx, mul_zero] + +theorem WeakLaplacianLower.mono {f : Position → ℝ} {U V : Set Position} {c : ℝ} + (h : WeakLaplacianLower f U c) (he : V ⊆ U) : WeakLaplacianLower f V c := by + intro φ hφ hc ht hp + exact h φ hφ hc (ht.trans he) hp + +theorem no_maximum_of_strict_weakLaplacian_local + {f : Position → ℝ} {o : Position} {R c : ℝ} (hR : 0 < R) (hc : 0 < c) + (hf : ContinuousOn f (Metric.closedBall o R)) + (hw : WeakLaplacianLower f (Metric.ball o R) c) + (hm : ∀ x ∈ Metric.ball o R, f x ≤ f o) : False := by + let f' : C(Metric.closedBall o R, ℝ) := ⟨_, hf.domRestrict⟩ + obtain ⟨g, hg⟩ := f'.exists_restrict_eq Metric.isClosed_closedBall + have he : Set.EqOn f g (Metric.closedBall o R) := by + intro x hx + exact (congrArg (fun u : C(Metric.closedBall o R, ℝ) => u ⟨x, hx⟩) hg).symm + have heb : Set.EqOn f g (Metric.ball o R) := he.mono Metric.ball_subset_closedBall + have hcenter := he (Metric.mem_closedBall_self hR.le) + exact no_maximum_of_strict_weakLaplacian g.continuous hR hc (hw.congr heb) + (by intro x hx; rw [← heb hx, ← hcenter]; exact hm x hx) + +theorem integrable_mul_compact_of_continuousAt {f g : Position → ℝ} + (hf : ∀ x ∈ tsupport g, ContinuousAt f x) (hg : Continuous g) + (hgc : HasCompactSupport g) : Integrable (fun x => f x*g x) := by + have hc : Continuous (fun x => f x*g x) := by + rw [continuous_iff_continuousAt] + intro x + by_cases hx : x ∈ tsupport g + · exact (hf x hx).mul hg.continuousAt + · have he : (fun y => f y*g y) =ᶠ[𝓝 x] fun _ => 0 := by + filter_upwards [notMem_tsupport_iff_eventuallyEq.mp hx] with y hy + change g y = 0 at hy + simp only [hy, mul_zero] + exact continuousAt_const.congr_of_eventuallyEq he + exact hc.integrable_of_hasCompactSupport (hgc.mono (Function.support_mul_subset_right f g)) + +theorem tsupport_dirPartial_subset (f : Position → ℝ) (v : Position) : + tsupport (dirPartial f v) ⊆ tsupport f := tsupport_fderiv_apply_subset ℝ v + +theorem integral_mul_coordinateLaplacian_eq {f φ : Position → ℝ} + (hf : ∀ x ∈ tsupport φ, ContDiffAt ℝ 2 f x) + (hφ : ContDiff ℝ ∞ φ) (hφc : HasCompactSupport φ) : + (∫ x, f x * coordinateLaplacian φ x) = + ∫ x, coordinateLaplacian f x * φ x := by + have hpφ (v : Position) : ContDiff ℝ ∞ (dirPartial φ v) := + contDiff_partial (by simpa using hφ) v + have hppφ (v : Position) : ContDiff ℝ ∞ (dirPartial (dirPartial φ v) v) := + contDiff_partial (by simpa using hpφ v) v + have hdφ (v : Position) := (hpφ v).differentiable (by simp) + have hiφ (v : Position) := hasCompactSupport_partial hφc v + have hpcont (v : Position) (x : Position) (hx : x ∈ tsupport φ) : + ContDiffAt ℝ 1 (dirPartial f v) x := + ((hf x hx).fderiv_right (show (1 : WithTop ℕ∞)+1 ≤ 2 by norm_num)).clm_apply + contDiffAt_const + have hppcont (v : Position) (x : Position) (hx : x ∈ tsupport φ) : + ContinuousAt (dirPartial (dirPartial f v) v) x := + (((hpcont v x hx).fderiv_right (show (0 : WithTop ℕ∞)+1 ≤ 1 by norm_num)).clm_apply + contDiffAt_const).continuousAt + have hleft (v : Position) : Integrable (fun x => f x*dirPartial (dirPartial φ v) v x) := + integrable_mul_compact_of_continuousAt + (fun x hx => (hf x ((tsupport_dirPartial_subset φ v) + (tsupport_dirPartial_subset (dirPartial φ v) v hx))).continuousAt) + (hppφ v).continuous + (hasCompactSupport_partial (hiφ v) v) + have hright (v : Position) : Integrable (fun x => dirPartial (dirPartial f v) v x*φ x) := + integrable_mul_compact_of_continuousAt (hppcont v) hφ.continuous hφc + have hcross (v : Position) : Integrable (fun x => dirPartial f v x*dirPartial φ v x) := + integrable_mul_compact_of_continuousAt + (fun x hx => (hpcont v x (tsupport_dirPartial_subset φ v hx)).continuousAt) + (hpφ v).continuous (hiφ v) + have hfg (v : Position) : Integrable (fun x => f x*dirPartial φ v x) := + integrable_mul_compact_of_continuousAt + (fun x hx => (hf x (tsupport_dirPartial_subset φ v hx)).continuousAt) + (hpφ v).continuous (hiφ v) + have hfpg (v : Position) : Integrable (fun x => dirPartial f v x*φ x) := + integrable_mul_compact_of_continuousAt (fun x hx => (hpcont v x hx).continuousAt) + hφ.continuous hφc + have hby (v : Position) : + (∫ x, f x*dirPartial (dirPartial φ v) v x) = ∫ x, dirPartial (dirPartial f v) v x*φ x := by + calc + _ = -(∫ x, dirPartial f v x*dirPartial φ v x) := + integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (hcross v) (hleft v) (hfg v) + (fun x hx => (hf x (tsupport_dirPartial_subset φ v hx)).differentiableAt (by norm_num)) + (fun x _ => hdφ v x) + _ = _ := by + have he : (∫ x, dirPartial f v x*dirPartial φ v x) = + -(∫ x, dirPartial (dirPartial f v) v x*φ x) := + integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + (hright v) (hcross v) (hfpg v) + (fun x hx => (hpcont v x hx).differentiableAt (by norm_num)) + (fun x _ => hφ.differentiable (by simp) x) + rw [he, neg_neg] + calc + _ = ∫ x, ∑ a : Fin 3, f x*dirPartial (dirPartial φ (axis a)) (axis a) x := by + apply integral_congr_ae + filter_upwards [] with x + rw [coordinateLaplacian_eq_partials (hφ.of_le (by exact WithTop.coe_le_coe.mpr le_top)).contDiffAt, Finset.mul_sum] + _ = ∑ a : Fin 3, ∫ x, f x*dirPartial (dirPartial φ (axis a)) (axis a) x := + integral_finsetSum _ (fun a _ => hleft (axis a)) + _ = ∑ a : Fin 3, ∫ x, dirPartial (dirPartial f (axis a)) (axis a) x*φ x := by + simp_rw [hby] + _ = ∫ x, ∑ a : Fin 3, dirPartial (dirPartial f (axis a)) (axis a) x*φ x := + (integral_finsetSum _ (fun a _ => hright (axis a))).symm + _ = _ := by + apply integral_congr_ae + filter_upwards [] with x + by_cases hx : x ∈ tsupport φ + · rw [coordinateLaplacian_eq_partials (hf x hx), Finset.sum_mul] + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, Finset.sum_const_zero] + +theorem continuousAt_coordinateLaplacian {f : Position → ℝ} {x : Position} + (hf : ContDiffAt ℝ 2 f x) : ContinuousAt (coordinateLaplacian f) x := by + have hp (v : Position) : ContDiffAt ℝ 1 (dirPartial f v) x := + (hf.fderiv_right (show (1 : WithTop ℕ∞)+1 ≤ 2 by norm_num)).clm_apply contDiffAt_const + have hpp (v : Position) : ContinuousAt (dirPartial (dirPartial f v) v) x := + (((hp v).fderiv_right (show (0 : WithTop ℕ∞)+1 ≤ 1 by norm_num)).clm_apply + contDiffAt_const).continuousAt + have he : coordinateLaplacian f =ᶠ[𝓝 x] + fun y => ∑ a : Fin 3, dirPartial (dirPartial f (axis a)) (axis a) y := by + filter_upwards [hf.eventually (by norm_num)] with y hy + exact coordinateLaplacian_eq_partials hy + have hsum : ContinuousAt (fun y => ∑ a : Fin 3, + dirPartial (dirPartial f (axis a)) (axis a) y) x := + tendsto_finsetSum _ (fun a _ => hpp (axis a)) + exact hsum.congr_of_eventuallyEq he + +theorem continuous_coordinateLaplacian {f : Position → ℝ} (hf : ContDiff ℝ 2 f) : + Continuous (coordinateLaplacian f) := + continuous_iff_continuousAt.mpr fun _ => continuousAt_coordinateLaplacian hf.contDiffAt + +theorem hasCompactSupport_coordinateLaplacian {f : Position → ℝ} + (hf : HasCompactSupport f) : HasCompactSupport (coordinateLaplacian f) := by + apply hf.mono' + intro x hx + by_contra hn + exact hx (coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + +def HasWeakLaplacian (f : Position → ℝ) (U : Set Position) (q : Position → ℝ) : Prop := + ∀ φ : Position → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → tsupport φ ⊆ U → + (∫ x, f x*coordinateLaplacian φ x) = ∫ x, q x*φ x + +theorem HasWeakLaplacian.mono {f q : Position → ℝ} {U V : Set Position} + (h : HasWeakLaplacian f U q) (he : V ⊆ U) : HasWeakLaplacian f V q := by + intro φ hφ hc ht + exact h φ hφ hc (ht.trans he) + +theorem HasWeakLaplacian.sub_smooth_lower {f q b : Position → ℝ} + {U : Set Position} {c : ℝ} (ho : IsOpen U) + (hf : ContinuousOn f U) (hq : ContinuousOn q U) (hb : ContDiffOn ℝ 2 b U) + (hw : HasWeakLaplacian f U q) (hl : ∀ x ∈ U, c ≤ q x-coordinateLaplacian b x) : + WeakLaplacianLower (fun x => f x-b x) U c := by + intro φ hφ hc ht hp + have hb' (x : Position) (hx : x ∈ U) := hb.contDiffAt (ho.mem_nhds hx) + have hiq : Integrable (fun x => q x*φ x) := + integrable_mul_compact_of_continuousAt + (fun x hx => hq.continuousAt (ho.mem_nhds (ht hx))) hφ.continuous hc + have hib : Integrable (fun x => coordinateLaplacian b x*φ x) := + integrable_mul_compact_of_continuousAt + (fun x hx => continuousAt_coordinateLaplacian (hb' x (ht hx))) hφ.continuous hc + have hts : tsupport (coordinateLaplacian φ) ⊆ tsupport φ := by + apply closure_minimal _ (isClosed_tsupport _) + intro x hx + by_contra hn + exact hx (coordinateLaplacian_eq_zero_of_notMem_tsupport hn) + have hφl := continuous_coordinateLaplacian (hφ.of_le (show (2 : WithTop ℕ∞) ≤ ∞ by exact WithTop.coe_le_coe.mpr le_top)) + have hφlc := hasCompactSupport_coordinateLaplacian hc + have hif : Integrable (fun x => f x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt + (fun x hx => hf.continuousAt (ho.mem_nhds (ht (hts hx)))) hφl hφlc + have hib' : Integrable (fun x => b x*coordinateLaplacian φ x) := + integrable_mul_compact_of_continuousAt + (fun x hx => (hb' x (ht (hts hx))).continuousAt) hφl hφlc + simp_rw [sub_mul] + rw [integral_sub hif hib', hw φ hφ hc ht, + integral_mul_coordinateLaplacian_eq (fun x hx => hb' x (ht hx)) hφ hc, + ← integral_sub hiq hib, ← integral_const_mul] + apply integral_mono (hφ.continuous.integrable_of_hasCompactSupport hc |>.const_mul c) + (hiq.sub hib) + intro x + change c*φ x ≤ q x*φ x-coordinateLaplacian b x*φ x + by_cases hx : x ∈ tsupport φ + · rw [← sub_mul] + exact mul_le_mul_of_nonneg_right (hl x (ht hx)) (hp x) + · simp only [image_eq_zero_of_notMem_tsupport hx, mul_zero, sub_self, le_refl] + +theorem weakLaplacian_le_at_local_max {f q b : Position → ℝ} {U : Set Position} + {o : Position} (ho : IsOpen U) (hx : o ∈ U) + (hf : ContinuousOn f U) (hq : ContinuousOn q U) (hb : ContDiffOn ℝ 2 b U) + (hw : HasWeakLaplacian f U q) (hm : IsLocalMax (fun x => f x-b x) o) : + q o ≤ coordinateLaplacian b o := by + by_contra hn + have hg : 0 < q o-coordinateLaplacian b o := sub_pos.mpr (lt_of_not_ge hn) + let c := (q o-coordinateLaplacian b o)/2 + have hc : 0 < c := by dsimp [c]; positivity + have hg' : c < q o-coordinateLaplacian b o := by dsimp [c]; linarith + have hcont : ContinuousAt (fun x => q x-coordinateLaplacian b x) o := + (hq.continuousAt (ho.mem_nhds hx)).sub + (continuousAt_coordinateLaplacian (hb.contDiffAt (ho.mem_nhds hx))) + have he : ∀ᶠ x in 𝓝 o, x ∈ U ∧ c < q x-coordinateLaplacian b x ∧ + f x-b x ≤ f o-b o := by + filter_upwards [ho.mem_nhds hx, hcont.eventually (Ioi_mem_nhds hg'), hm] with x hx hg hm + exact ⟨hx, hg, hm⟩ + obtain ⟨d, hd, hd'⟩ := Metric.mem_nhds_iff.mp he + let R := d/2 + have hR : 0 < R := by dsimp [R]; positivity + have hRd : R < d := by dsimp [R]; linarith + have hlocal (x : Position) (hx : x ∈ Metric.closedBall o R) : + x ∈ U ∧ c < q x-coordinateLaplacian b x ∧ f x-b x ≤ f o-b o := + hd' (lt_of_le_of_lt hx hRd) + have hsub : Metric.ball o R ⊆ U := + fun x hx => (hlocal x (Metric.ball_subset_closedBall hx)).1 + exact no_maximum_of_strict_weakLaplacian_local hR hc + ((hf.sub hb.continuousOn).mono (fun x hx => (hlocal x hx).1)) + ((hw.mono hsub).sub_smooth_lower Metric.isOpen_ball (hf.mono hsub) (hq.mono hsub) + (hb.mono hsub) (fun x hx => (hlocal x (Metric.ball_subset_closedBall hx)).2.1.le)) + (fun x hx => (hlocal x (Metric.ball_subset_closedBall hx)).2.2) + +theorem coordinateLaplacian_neg (f : Position → ℝ) (x : Position) : + coordinateLaplacian (fun y => -f y) x = -coordinateLaplacian f x := by + unfold coordinateLaplacian + rw [← Finset.sum_neg_distrib] + apply Finset.sum_congr rfl + intro a _ + have he : deriv (fun t : ℝ => -f (x+t • axis a)) = + -deriv (fun t : ℝ => f (x+t • axis a)) := by ext t; exact deriv.neg + rw [he, deriv.neg] + +theorem HasWeakLaplacian.neg {f q : Position → ℝ} {U : Set Position} + (h : HasWeakLaplacian f U q) : + HasWeakLaplacian (fun x => -f x) U (fun x => -q x) := by + intro φ hφ hc ht + simpa only [neg_mul, integral_neg] using congrArg Neg.neg (h φ hφ hc ht) + +theorem weakLaplacian_ge_at_local_min {f q b : Position → ℝ} {U : Set Position} + {o : Position} (ho : IsOpen U) (hx : o ∈ U) + (hf : ContinuousOn f U) (hq : ContinuousOn q U) (hb : ContDiffOn ℝ 2 b U) + (hw : HasWeakLaplacian f U q) (hm : IsLocalMin (fun x => f x-b x) o) : + coordinateLaplacian b o ≤ q o := by + have hm' : IsLocalMax (fun x => (-f x)-(-b x)) o := by + filter_upwards [hm] with x hx + linarith + have h := weakLaplacian_le_at_local_max ho hx hf.neg hq.neg hb.neg hw.neg hm' + rw [coordinateLaplacian_neg] at h + exact neg_le_neg_iff.mp h + +theorem coordinateLaplacian_add_at {f g : Position → ℝ} {x : Position} + (hf : ContDiffAt ℝ 2 f x) (hg : ContDiffAt ℝ 2 g x) : + coordinateLaplacian (fun y => f y+g y) x = coordinateLaplacian f x+coordinateLaplacian g x := by + rw [coordinateLaplacian_eq_partials (hf.add hg), coordinateLaplacian_eq_partials hf, + coordinateLaplacian_eq_partials hg, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro a _ + have he : dirPartial (fun y => f y+g y) (axis a) =ᶠ[𝓝 x] + fun y => dirPartial f (axis a) y+dirPartial g (axis a) y := by + filter_upwards [hf.eventually (by norm_num), hg.eventually (by norm_num)] with y hy hz + exact congrArg (fun T : Position →L[ℝ] ℝ => T (axis a)) + (fderiv_add (hy.differentiableAt (by norm_num)) (hz.differentiableAt (by norm_num))) + have hfd : DifferentiableAt ℝ (dirPartial f (axis a)) x := + ((hf.fderiv_right (show (1 : WithTop ℕ∞)+1 ≤ 2 by norm_num)).clm_apply + contDiffAt_const).differentiableAt_one + have hgd : DifferentiableAt ℝ (dirPartial g (axis a)) x := + ((hg.fderiv_right (show (1 : WithTop ℕ∞)+1 ≤ 2 by norm_num)).clm_apply + contDiffAt_const).differentiableAt_one + change fderiv ℝ _ x (axis a) = _ + rw [he.fderiv_eq] + exact congrArg (fun T : Position →L[ℝ] ℝ => T (axis a)) (fderiv_add hfd hgd) + +theorem coordinateLaplacian_const_mul (f : Position → ℝ) (x : Position) (c : ℝ) : + coordinateLaplacian (fun y => c*f y) x = c*coordinateLaplacian f x := by + unfold coordinateLaplacian + simp only [deriv_const_mul_field', deriv_const_mul_field, Finset.mul_sum] + +def punctured : Set Position := {x | x ≠ 0} + +theorem isOpen_punctured : IsOpen punctured := isClosed_singleton.isOpen_compl + +theorem contDiffOn_radialPower (p : ℝ) (n : WithTop ℕ∞) : + ContDiffOn ℝ n (radialPower p) punctured := by + exact (contDiff_id.norm_sq ℝ).contDiffOn.rpow_const_of_ne + (fun _ hx => pow_ne_zero 2 (norm_ne_zero_iff.mpr hx)) + +def radialBarrier (a d : ℝ) (x : Position) : ℝ := + a*radialPower (-2) x + d*(radialPower (-1) x+radialPower (-3) x) + +theorem contDiffOn_radialBarrier (a d : ℝ) (n : WithTop ℕ∞) : + ContDiffOn ℝ n (radialBarrier a d) punctured := + (contDiffOn_const.mul (contDiffOn_radialPower (-2) n)).add + (contDiffOn_const.mul ((contDiffOn_radialPower (-1) n).add (contDiffOn_radialPower (-3) n))) + +theorem radialBarrier_scaled {x : Position} (hx : x ≠ 0) (a d : ℝ) : + (‖x‖^2)^2 * radialBarrier a d x = a+d*((‖x‖^2)+(‖x‖^2)⁻¹) := by + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + norm_num [radialBarrier, radialPower, Real.rpow_neg_natCast, Real.rpow_neg_one] + field_simp + +theorem laplacian_radialBarrier_scaled {x : Position} (hx : x ≠ 0) (a d : ℝ) : + (‖x‖^2)^3 * coordinateLaplacian (radialBarrier a d) x = + 12*a+d*(2*(‖x‖^2)+30*(‖x‖^2)⁻¹) := by + have hcp (p : ℝ) : ContDiffAt ℝ 2 (radialPower p) x := + (contDiffOn_radialPower p 2).contDiffAt (isOpen_punctured.mem_nhds hx) + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + unfold radialBarrier + rw [coordinateLaplacian_add_at (contDiffAt_const.mul (hcp (-2))) + (contDiffAt_const.mul ((hcp (-1)).add (hcp (-3)))), + coordinateLaplacian_const_mul, coordinateLaplacian_const_mul, + coordinateLaplacian_add_at (hcp (-1)) (hcp (-3))] + simp only [coordinateLaplacian_radialPower hx] + norm_num [Real.rpow_neg_natCast, Real.rpow_neg_one] + field_simp + +def radialPenalty (x : Position) : ℝ := ‖x‖^2+(‖x‖^2)⁻¹ + +theorem radialPenalty_pos {x : Position} (hx : x ≠ 0) : 0 < radialPenalty x := by + unfold radialPenalty + exact add_pos (sq_pos_of_pos (norm_pos_iff.mpr hx)) (inv_pos.mpr (sq_pos_of_pos (norm_pos_iff.mpr hx))) + +theorem continuousOn_radialPenalty : ContinuousOn radialPenalty punctured := + (continuous_norm.pow 2).continuousOn.add + ((continuous_norm.pow 2).continuousOn.inv₀ (fun _ hx => pow_ne_zero 2 (norm_ne_zero_iff.mpr hx))) + +theorem exists_penalized_max {V : Position → ℝ} {C δ : ℝ} {x₀ : Position} + (hV : ContinuousOn V punctured) (hC : ∀ x ≠ 0, V x ≤ C) (hδ : 0 < δ) + (hx₀ : x₀ ≠ 0) : + ∃ x, x ≠ 0 ∧ ∀ y ≠ 0, V y-δ*radialPenalty y ≤ V x-δ*radialPenalty x := by + let T := C-(V x₀-δ*radialPenalty x₀)+1 + have hT : 0 < T := by + dsimp [T] + nlinarith [hC x₀ hx₀, mul_pos hδ (radialPenalty_pos hx₀)] + let α := min (‖x₀‖^2) (δ/T)/2 + let β := max (‖x₀‖^2) (T/δ)+1 + have hq₀ : 0 < ‖x₀‖^2 := sq_pos_of_pos (norm_pos_iff.mpr hx₀) + have hα : 0 < α := by dsimp [α]; positivity + have hβ : 0 < β := by dsimp [β]; positivity + have hαq : α ≤ ‖x₀‖^2 := by + dsimp [α] + have := min_le_left (‖x₀‖^2) (δ/T) + linarith + have hαT : α ≤ δ/T := by + dsimp [α] + have := min_le_right (‖x₀‖^2) (δ/T) + have := div_pos hδ hT + linarith + have hqβ : ‖x₀‖^2 ≤ β := by + dsimp [β] + have := le_max_left (‖x₀‖^2) (T/δ) + linarith + have hTβ : T/δ ≤ β := by + dsimp [β] + have := le_max_right (‖x₀‖^2) (T/δ) + linarith + let K : Set Position := {x | α ≤ ‖x‖^2 ∧ ‖x‖^2 ≤ β} + have hKclosed : IsClosed K := isClosed_Icc.preimage (continuous_norm.pow 2) + have hKsub : K ⊆ Metric.closedBall 0 (β+1) := by + intro x hx + simp only [Metric.mem_closedBall, dist_zero_right] + have hu := hx.2 + nlinarith [sq_nonneg (‖x‖-1)] + have hK : IsCompact K := (isCompact_closedBall (0 : Position) (β+1)).of_isClosed_subset hKclosed hKsub + have hKp : K ⊆ punctured := by + intro x hx hn + subst x + simpa using lt_of_lt_of_le hα hx.1 + have hcont : ContinuousOn (fun x => V x-δ*radialPenalty x) K := + (hV.sub (continuousOn_const.mul continuousOn_radialPenalty)).mono hKp + obtain ⟨x, hx, hxm⟩ := hK.exists_isMaxOn ⟨x₀, hαq, hqβ⟩ hcont + refine ⟨x, hKp hx, ?_⟩ + intro y hy + by_cases hyK : y ∈ K + · exact hxm hyK + have hqy : 0 < ‖y‖^2 := sq_pos_of_pos (norm_pos_iff.mpr hy) + have hYP : T < δ*radialPenalty y := by + by_cases hyl : α ≤ ‖y‖^2 + · have hyh : β < ‖y‖^2 := lt_of_not_ge (fun hn => hyK ⟨hyl, hn⟩) + have htq : T < (‖y‖^2)*δ := (div_lt_iff₀ hδ).mp (lt_of_le_of_lt hTβ hyh) + dsimp [radialPenalty] + nlinarith [mul_nonneg hδ.le (inv_nonneg.mpr hqy.le)] + · have hylo : ‖y‖^2 < δ/T := lt_of_lt_of_le (lt_of_not_ge hyl) hαT + have htq : (‖y‖^2)*T < δ := (lt_div_iff₀ hT).mp hylo + have htid : T < δ/(‖y‖^2) := (lt_div_iff₀ hqy).mpr (by nlinarith) + dsimp [radialPenalty] + rw [div_eq_mul_inv] at htid + nlinarith [mul_pos hδ hqy] + have hxm₀ : V x₀-δ*radialPenalty x₀ ≤ V x-δ*radialPenalty x := hxm ⟨hαq, hqβ⟩ + dsimp [T] at hYP + linarith [hC y hy] + +theorem exists_penalized_min {V : Position → ℝ} {B δ : ℝ} {x₀ : Position} + (hV : ContinuousOn V punctured) (hB : ∀ x ≠ 0, B ≤ V x) (hδ : 0 < δ) + (hx₀ : x₀ ≠ 0) : + ∃ x, x ≠ 0 ∧ ∀ y ≠ 0, V x+δ*radialPenalty x ≤ V y+δ*radialPenalty y := by + obtain ⟨x, hx, hxm⟩ := exists_penalized_max hV.neg (C := -B) + (fun y hy => neg_le_neg (hB y hy)) hδ hx₀ + refine ⟨x, hx, ?_⟩ + intro y hy + have hh := hxm y hy + simp only [Pi.neg_apply] at hh + linarith + +end NeutralAtom +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/WedgeInsert.lean b/lean/OAI/Analysis/CoulombRadii/Variational/WedgeInsert.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3747a1d331af3c10d856768ba7d2131cdc4df3c --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/WedgeInsert.lean @@ -0,0 +1,434 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.Variational.ConfigurationSplit + +namespace OAI + +section +noncomputable section +open MeasureTheory Filter +open scoped BigOperators Topology ContDiff +namespace NeutralAtom + +def wedgeInsert {n : ℕ} (f : Position → ℝ) (ψ : Wavefunction n) : Wavefunction (n+1) := + sumWavefunction (fun i : Fin (n+1) => permutationSign (Equiv.swap 0 i)) + (fun i => permuteWavefunction (Equiv.swap 0 i) (insertWavefunction f ψ)) + + def wedgeInsertGradient {n : ℕ} (f : Position → ℝ) (ψ : Wavefunction n) (g : Gradient n) : + Gradient (n+1) := + sumGradient (fun i : Fin (n+1) => permutationSign (Equiv.swap 0 i)) + (fun i => permuteGradient (Equiv.swap 0 i) (insertGradient f ψ g)) + + theorem antisymmetrize_insert_eq {n : ℕ} {ψ : Wavefunction n} (hψ : IsAntisymmetric ψ) + (f : Position → ℝ) (σ : Spins (n+1)) : + antisymmetrize (insertWavefunction f ψ) σ =ᵐ[volume] + (fun x => (n.factorial : ℝ) • wedgeInsert f ψ σ x) := by + classical + have hi : ∀ᵐ x : Configuration (n+1) ∂volume, ∀ i : Fin (n+1), ∀ p : Equiv.Perm (Fin n), + permutationSign (Equiv.Perm.decomposeFin.symm (i,p)) • + permuteWavefunction (Equiv.Perm.decomposeFin.symm (i,p)) (insertWavefunction f ψ) σ x = + permutationSign (Equiv.swap 0 i) • permuteWavefunction (Equiv.swap 0 i) (insertWavefunction f ψ) σ x := by + apply (ae_all_iff).mpr + intro i + apply (ae_all_iff).mpr + intro p + filter_upwards [insert_permute_decompose hψ f i p σ] with x hx + rw [hx, permutationSign_decompose, smul_smul] + simp only [mul_assoc, permutationSign_sq, mul_one] + filter_upwards [hi] with x hx + unfold antisymmetrize sumWavefunction wedgeInsert + rw [← Equiv.sum_comp Equiv.Perm.decomposeFin.symm] + rw [Fintype.sum_prod_type] + simp_rw [hx] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_perm, Fintype.card_fin, + sumWavefunction, Finset.smul_sum] + apply Finset.sum_congr rfl + intro i _ + simp only [Complex.real_smul, nsmul_eq_mul, Complex.ofReal_natCast] + + theorem HasWeakGradient.unique_of_ae_eq {n : ℕ} {ψ χ : Wavefunction n} {g h : Gradient n} + (hg : HasWeakGradient ψ g) (hh : HasWeakGradient χ h) + (he : ∀ σ, ψ σ =ᵐ[volume] χ σ) + (hgi : ∀ σ i a, MemLp (g σ i a) 2 volume) + (hhi : ∀ σ i a, MemLp (h σ i a) 2 volume) + (σ : Spins n) (i : Fin n) (a : Fin 3) : g σ i a =ᵐ[volume] h σ i a := by + apply ae_eq_of_integral_contDiff_smul_eq + ((hgi σ i a).locallyIntegrable (by norm_num)) + ((hhi σ i a).locallyIntegrable (by norm_num)) + intro φ hφ hφc + have hl : (∫ x, (fderiv ℝ φ x (coordinateDirection i a) : ℂ) * ψ σ x) = + ∫ x, (fderiv ℝ φ x (coordinateDirection i a) : ℂ) * χ σ x := + integral_congr_ae ((he σ).mono fun x hx => by dsimp; rw [hx]) + have hneg := (hg σ i a φ hφ hφc).symm.trans (hl.trans (hh σ i a φ hφ hφc)) + simpa only [Complex.real_smul] using neg_injective hneg + +def InsertionSupport {n : ℕ} (R : ℝ) (F : Wavefunction (n+1)) : Prop := + ∀ σ x, F σ x ≠ 0 → R < ‖x 0‖ ∧ ∀ i : Fin n, ‖x i.succ‖ ≤ R + + theorem insertionSupport_tensor {n : ℕ} {R : ℝ} {f : Position → ℝ} + {ψ : Wavefunction n} (hf : ∀ y, ‖y‖ ≤ R → f y = 0) + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) : + InsertionSupport R (insertWavefunction f ψ) := by + intro σ x hx + have hi : σ 0 = 0 := by + by_contra hh + exact hx (by simp [insertWavefunction, hh]) + have hf0 : f (x 0) ≠ 0 := by + intro hh + exact hx (by simp [insertWavefunction, hh]) + have hψ0 : ψ (fun i => σ i.succ) (fun i => x i.succ) ≠ 0 := by + intro hh + exact hx (by simp [insertWavefunction, hh]) + have htail : ‖fun i : Fin n => x i.succ‖ ≤ R := by + by_contra hh + exact hψ0 (hψ _ _ (lt_of_not_ge hh)) + exact ⟨lt_of_not_ge (fun hh => hf0 (hf _ hh)), fun i => (norm_le_pi_norm _ i).trans htail⟩ + + theorem InsertionSupport.swap {n : ℕ} {R : ℝ} {F : Wavefunction (n+1)} + (hF : InsertionSupport R F) {σ : Spins (n+1)} {x : Configuration (n+1)} + {i : Fin (n+1)} (hi : permuteWavefunction (Equiv.swap 0 i) F σ x ≠ 0) : + R < ‖x i‖ ∧ ∀ j, j ≠ i → ‖x j‖ ≤ R := by + have h := hF (σ ∘ Equiv.swap 0 i) (x ∘ Equiv.swap 0 i) hi + refine ⟨by simpa only [Function.comp_apply, Equiv.swap_apply_left] using h.1, ?_⟩ + intro j hji + have hne : Equiv.swap 0 i j ≠ 0 := by + intro hh + have he := congrArg (Equiv.swap 0 i) hh + exact hji (by simpa only [Equiv.swap_apply_self, Equiv.swap_apply_left] using he) + have hg : ∀ k : Fin (n+1), k ≠ 0 → ‖x (Equiv.swap 0 i k)‖ ≤ R := by + intro k hk + cases k using Fin.cases with + | zero => exact (hk rfl).elim + | succ k => exact h.2 k + simpa only [Equiv.swap_apply_self] using hg _ hne + + theorem InsertionSupport.placements_disjoint {n : ℕ} {R : ℝ} {F G : Wavefunction (n+1)} + (hF : InsertionSupport R F) (hG : InsertionSupport R G) (σ : Spins (n+1)) + (x : Configuration (n+1)) {i j : Fin (n+1)} (hij : i ≠ j) : + permuteWavefunction (Equiv.swap 0 i) F σ x = 0 ∨ + permuteWavefunction (Equiv.swap 0 j) G σ x = 0 := by + by_contra hh + have hi := hF.swap (not_or.mp hh).1 + have hj := hG.swap (not_or.mp hh).2 + exact (not_lt_of_ge (hj.2 i hij)) hi.1 + + theorem norm_sq_sum_of_disjoint {ι : Type*} [Fintype ι] (v : ι → ℂ) + (hv : ∀ i j, i ≠ j → v i = 0 ∨ v j = 0) : + ‖∑ i, v i‖^2 = ∑ i, ‖v i‖^2 := by + classical + by_cases he : ∃ i, v i ≠ 0 + · obtain ⟨i,hi⟩ := he + have hz : ∀ j, j ≠ i → v j = 0 := fun j hji => (hv j i hji).resolve_right hi + rw [Finset.sum_eq_single i, Finset.sum_eq_single i] + · intro j _ hji + simp [hz j hji] + · simp + · intro j _ hji + exact hz j hji + · simp + · have hz : ∀ i, v i = 0 := by simpa using he + simp [hz] + + def spinsPerm {n : ℕ} (p : Equiv.Perm (Fin n)) : Spins n ≃ Spins n := + (Equiv.piCongrLeft (fun _ : Fin n => Fin 2) p).symm + +@[simp] theorem spinsPerm_apply {n : ℕ} (p : Equiv.Perm (Fin n)) (σ : Spins n) : + spinsPerm p σ = σ ∘ p := rfl + + theorem normSquared_permute {n : ℕ} (p : Equiv.Perm (Fin n)) (ψ : Wavefunction n) : + normSquared (permuteWavefunction p ψ) = normSquared ψ := by + unfold normSquared permuteWavefunction + have hi (σ : Spins n) := (configurationPerm_preserving p).integral_comp + (configurationPerm p).toHomeomorph.measurableEmbedding (fun x => ‖ψ (σ ∘ p) x‖^2) + simp only [configurationPerm_apply] at hi + simp_rw [hi] + exact Equiv.sum_comp (spinsPerm p) (fun σ => ∫ x, ‖ψ σ x‖^2) + + theorem energy_permute {n : ℕ} (Z : ℕ) (p : Equiv.Perm (Fin n)) + (ψ : Wavefunction n) (g : Gradient n) : + energy Z (permuteWavefunction p ψ) (permuteGradient p g) = energy Z ψ g := by + have hi (σ : Spins n) (i : Fin n) (a : Fin 3) := + (configurationPerm_preserving p).integral_comp + (configurationPerm p).toHomeomorph.measurableEmbedding (fun x => ‖g (σ ∘ p) (p.symm i) a x‖^2) + simp only [configurationPerm_apply] at hi + have hv (σ : Spins n) := (configurationPerm_preserving p).integral_comp + (configurationPerm p).toHomeomorph.measurableEmbedding + (fun x => coulombPotential Z x * ‖ψ (σ ∘ p) x‖^2) + simp only [configurationPerm_apply, coulombPotential_permute] at hv + unfold energy permuteWavefunction permuteGradient + simp_rw [hi, hv] + congr 1 + · congr 1 + have hs (σ : Spins n) : (∑ i : Fin n, ∑ a : Fin 3, ∫ x, ‖g σ (p.symm i) a x‖^2) = + ∑ i : Fin n, ∑ a : Fin 3, ∫ x, ‖g σ i a x‖^2 := + Equiv.sum_comp p.symm (fun i => ∑ a : Fin 3, ∫ x, ‖g σ i a x‖^2) + simp_rw [hs] + exact Equiv.sum_comp (spinsPerm p) (fun σ => ∑ i : Fin n, ∑ a : Fin 3, ∫ x, ‖g σ i a x‖^2) + · exact Equiv.sum_comp (spinsPerm p) (fun σ => ∫ x, coulombPotential Z x * ‖ψ σ x‖^2) + + theorem norm_sq_sum_real_smul_of_disjoint {ι : Type*} [Fintype ι] + (c : ι → ℝ) (v : ι → ℂ) (hv : ∀ i j, i ≠ j → v i = 0 ∨ v j = 0) : + ‖∑ i, c i • v i‖^2 = ∑ i, (c i)^2 * ‖v i‖^2 := by + rw [norm_sq_sum_of_disjoint (fun i => c i • v i)] + · simp only [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] + · intro i j hij + rcases hv i j hij with hi | hj + · exact Or.inl (by rw [hi, smul_zero]) + · exact Or.inr (by rw [hj, smul_zero]) + + theorem FormRegular.integrable_potential {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (hd : FormRegular ψ g) (Z : ℕ) (σ : Spins n) : + Integrable (fun x : Configuration n => coulombPotential Z x*‖ψ σ x‖^2) := by + have hn := integrable_finsetSum Finset.univ (fun i _ => hd.2.2.2.1 σ i) + have hp := integrable_finsetSum Finset.univ (fun i _ => + integrable_finsetSum (Finset.univ.filter (fun j => i < j)) + (fun j hj => hd.2.2.2.2 σ i j (Finset.mem_filter.mp hj).2)) + apply ((hn.const_mul (-(Z:ℝ))).add hp).congr + exact Eventually.of_forall fun x => by + simp only [Pi.add_apply, coulombPotential, add_mul, Finset.sum_mul, mul_assoc] + + theorem normSquared_disjoint_sum {n : ℕ} {ι : Type*} [Fintype ι] + (c : ι → ℝ) {ψ : ι → Wavefunction n} (hψ : ∀ i σ, MemLp (ψ i σ) 2 volume) + (hd : ∀ σ x i j, i ≠ j → ψ i σ x = 0 ∨ ψ j σ x = 0) : + normSquared (sumWavefunction c ψ) = ∑ i, (c i)^2 * normSquared (ψ i) := by + unfold normSquared sumWavefunction + simp_rw [norm_sq_sum_real_smul_of_disjoint c _ (hd _ _)] + simp_rw [integral_finsetSum _ (fun i _ => ((hψ i _).norm.integrable_sq).const_mul ((c i)^2)), + integral_const_mul] + rw [Finset.sum_comm] + simp only [Finset.mul_sum] + + theorem energy_disjoint_sum {n : ℕ} {ι : Type*} [Fintype ι] + (Z : ℕ) (c : ι → ℝ) {ψ : ι → Wavefunction n} {g : ι → Gradient n} + (h : ∀ i, FormRegular (ψ i) (g i)) + (hd : ∀ σ x i j, i ≠ j → ψ i σ x = 0 ∨ ψ j σ x = 0) + (hdg : ∀ σ k a x i j, i ≠ j → g i σ k a x = 0 ∨ g j σ k a x = 0) : + energy Z (sumWavefunction c ψ) (sumGradient c g) = ∑ i, (c i)^2 * energy Z (ψ i) (g i) := by + have hk (σ : Spins n) (k : Fin n) (a : Fin 3) : + (∫ x, ‖sumGradient c g σ k a x‖^2) = + ∑ i, (c i)^2 * ∫ x, ‖g i σ k a x‖^2 := by + simp only [sumGradient] + simp_rw [norm_sq_sum_real_smul_of_disjoint c _ (hdg _ _ _ _)] + rw [integral_finsetSum _ (fun i _ => ((h i).2.2.1 σ k a).norm.integrable_sq.const_mul ((c i)^2))] + simp only [integral_const_mul] + have hv (σ : Spins n) : + (∫ x, coulombPotential Z x * ‖sumWavefunction c ψ σ x‖^2) = + ∑ i, (c i)^2 * ∫ x, coulombPotential Z x * ‖ψ i σ x‖^2 := by + simp only [sumWavefunction] + simp_rw [norm_sq_sum_real_smul_of_disjoint c _ (hd _ _), Finset.mul_sum] + simp_rw [← mul_assoc, mul_comm (coulombPotential Z _) ((c _)^2), mul_assoc] + rw [integral_finsetSum _ (fun i _ => ((h i).integrable_potential Z σ).const_mul ((c i)^2))] + simp only [integral_const_mul] + unfold energy + simp_rw [hk, hv] + have hs : (∑ σ : Spins n, ∑ k : Fin n, ∑ a : Fin 3, ∑ i, (c i)^2 * ∫ x, ‖g i σ k a x‖^2) = + ∑ i, (c i)^2 * ∑ σ : Spins n, ∑ k : Fin n, ∑ a : Fin 3, ∫ x, ‖g i σ k a x‖^2 := by + simp_rw [Finset.sum_comm (f := fun a i => (c i)^2 * ∫ x, ‖g i _ _ a x‖^2)] + simp_rw [Finset.sum_comm (f := fun k i => ∑ a : Fin 3, (c i)^2 * ∫ x, ‖g i _ k a x‖^2)] + rw [Finset.sum_comm] + simp only [Finset.mul_sum] + rw [hs, Finset.sum_comm (f := fun σ i => (c i)^2 * ∫ x, coulombPotential Z x * ‖ψ i σ x‖^2)] + rw [Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i _ + rw [← Finset.mul_sum] + ring + + theorem insertionSupport_gradient {n : ℕ} {R : ℝ} {f : Position → ℝ} + {ψ : Wavefunction n} {g : Gradient n} (hf : ∀ y, ‖y‖ ≤ R → f y = 0) + (hdf : ∀ a y, ‖y‖ ≤ R → fderiv ℝ f y (EuclideanSpace.single a 1) = 0) + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) + (hg : ∀ σ i a x, R < ‖x‖ → g σ i a x = 0) (i : Fin (n+1)) (a : Fin 3) : + InsertionSupport R (fun σ x => insertGradient f ψ g σ i a x) := by + cases i using Fin.cases with + | zero => exact insertionSupport_tensor (hdf a) hψ + | succ i => exact insertionSupport_tensor hf (fun σ x hx => hg σ i a x hx) + + theorem wedgeInsert_antisymmetric {n : ℕ} {ψ : Wavefunction n} (hψ : IsAntisymmetric ψ) + (f : Position → ℝ) : IsAntisymmetric (wedgeInsert f ψ) := by + intro p σ + have hl := (antisymmetrize_insert_eq hψ f (σ ∘ p)).comp_tendsto + (configurationPerm_preserving p).quasiMeasurePreserving.tendsto_ae + filter_upwards [hl, antisymmetrize_insert_eq hψ f σ, + antisymmetrize_antisymmetric (insertWavefunction f ψ) p σ] with x hx hy hz + change antisymmetrize (insertWavefunction f ψ) (σ ∘ p) (x ∘ p) = _ at hx + rw [hx, hy] at hz + simp only [Complex.real_smul, Complex.ofReal_natCast] at hz + have hc : (n.factorial : ℂ) ≠ 0 := by exact_mod_cast Nat.factorial_ne_zero n + apply mul_left_cancel₀ hc + simpa only [Function.comp_apply, configurationPerm_apply, + mul_left_comm ((Equiv.Perm.sign p : ℤ) : ℂ)] using hz + + theorem FormRegular.wedgeInsert {n : ℕ} {f : Position → ℝ} {ψ : Wavefunction n} {g : Gradient n} + (hψ : IsAntisymmetric ψ) (h : FormRegular (insertWavefunction f ψ) (insertGradient f ψ g)) : + FormDomain (wedgeInsert f ψ) (wedgeInsertGradient f ψ g) := + ⟨wedgeInsert_antisymmetric hψ f, + FormRegular.finite_sum (fun i => permutationSign (Equiv.swap 0 i)) + (fun i => h.permute (Equiv.swap 0 i))⟩ + + theorem normSquared_wedgeInsert {n : ℕ} {R : ℝ} {f : Position → ℝ} + {ψ : Wavefunction n} (hψLp : ∀ σ, MemLp (ψ σ) 2 volume) (hfLp : MemLp f 2 volume) + (hs : InsertionSupport R (insertWavefunction f ψ)) : + normSquared (wedgeInsert f ψ) = (n+1 : ℝ) * normSquared (insertWavefunction f ψ) := by + have hLp (i : Fin (n+1)) (σ : Spins (n+1)) : + MemLp (permuteWavefunction (Equiv.swap 0 i) (insertWavefunction f ψ) σ) 2 volume := + (insertWavefunction_memLp hψLp hfLp _).comp_measurePreserving + (configurationPerm_preserving (Equiv.swap 0 i)) + unfold wedgeInsert + rw [normSquared_disjoint_sum _ hLp (fun σ x i j hij => hs.placements_disjoint hs σ x hij)] + simp only [pow_two, permutationSign_sq, one_mul, normSquared_permute, Finset.sum_const, + Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, Nat.cast_add, Nat.cast_one] + + theorem energy_wedgeInsert {n : ℕ} (Z : ℕ) {R : ℝ} {f : Position → ℝ} + {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular (insertWavefunction f ψ) (insertGradient f ψ g)) + (hs : InsertionSupport R (insertWavefunction f ψ)) + (hsg : ∀ i a, InsertionSupport R (fun σ x => insertGradient f ψ g σ i a x)) : + energy Z (wedgeInsert f ψ) (wedgeInsertGradient f ψ g) = + (n+1 : ℝ) * energy Z (insertWavefunction f ψ) (insertGradient f ψ g) := by + unfold wedgeInsert wedgeInsertGradient + rw [energy_disjoint_sum Z _ (fun i => h.permute (Equiv.swap 0 i)) + (fun σ x i j hij => hs.placements_disjoint hs σ x hij) + (fun σ k a x i j hij => (hsg ((Equiv.swap 0 i).symm k) a).placements_disjoint + (hsg ((Equiv.swap 0 j).symm k) a) σ x hij)] + simp only [pow_two, permutationSign_sq, one_mul, energy_permute, Finset.sum_const, + Finset.card_univ, Fintype.card_fin, nsmul_eq_mul, Nat.cast_add, Nat.cast_one] + + theorem integrable_supported_weight {A : Type*} [MeasurableSpace A] {μ : Measure A} + {ψ : A → ℂ} (hψ : MemLp ψ 2 μ) {W : A → ℝ} (hW : Measurable W) + {C : ℝ} (hb : ∀ x, ψ x ≠ 0 → |W x| ≤ C) : + Integrable (fun x => W x * ‖ψ x‖^2) μ := by + apply (hψ.norm.integrable_sq.const_mul C).mono' + (hW.aestronglyMeasurable.mul (hψ.aestronglyMeasurable.norm.pow 2)) + apply Eventually.of_forall + intro x + by_cases hx : ψ x = 0 + · simp [hx] + · change ‖W x * ‖ψ x‖^2‖ ≤ C * ‖ψ x‖^2 + simpa only [Real.norm_eq_abs, abs_mul, abs_pow, abs_norm] using + mul_le_mul_of_nonneg_right (hb x hx) (sq_nonneg ‖ψ x‖) + + theorem integrable_weighted_tensor {n : ℕ} {f : Position → ℝ} (hf : MemLp f 2 volume) + {ψ : Configuration n → ℂ} {W : Configuration n → ℝ} + (hW : Integrable (fun x => W x * ‖ψ x‖^2)) : + Integrable (fun x : Configuration (n+1) => W (fun i => x i.succ) * + ‖f (x 0) • ψ (fun i => x i.succ)‖^2) := by + have hi : Integrable (fun z : Position × Configuration n => (f z.1)^2 * (W z.2 * ‖ψ z.2‖^2)) := + hf.integrable_sq.mul_prod hW + have hp := (configurationSplit_preserving n).integrable_comp_of_integrable hi + apply hp.congr + exact Eventually.of_forall fun x => by + simp only [Function.comp_apply, configurationSplit_apply, norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] + ring + + theorem integral_weighted_tensor {n : ℕ} (f : Position → ℝ) + (ψ : Configuration n → ℂ) (W : Configuration n → ℝ) : + (∫ x : Configuration (n+1), W (fun i => x i.succ) * ‖f (x 0) • ψ (fun i => x i.succ)‖^2) = + (∫ y : Position, (f y)^2) * ∫ x : Configuration n, W x * ‖ψ x‖^2 := by + have he := (configurationSplit_preserving n).integral_comp + (configurationSplit n).toHomeomorph.measurableEmbedding + (fun z : Position × Configuration n => (f z.1)^2 * (W z.2 * ‖ψ z.2‖^2)) + have hi := integral_prod_mul (μ := (volume : Measure Position)) (ν := (volume : Measure (Configuration n))) + (fun y => (f y)^2) (fun x => W x * ‖ψ x‖^2) + rw [← hi] + change _ = ∫ z : Position × Configuration n, (f z.1)^2 * (W z.2 * ‖ψ z.2‖^2) + rw [← he] + apply integral_congr_ae + exact Eventually.of_forall fun x => by + simp only [configurationSplit_apply, norm_smul, mul_pow, Real.norm_eq_abs, sq_abs] + ring + + theorem inserted_nuclear_bound {n : ℕ} {d : ℝ} (hd : 0 < d) + {f : Position → ℝ} {ψ : Wavefunction n} (hf : ∀ y, ‖y‖ ≤ d → f y = 0) + (σ : Spins (n+1)) (x : Configuration (n+1)) (hx : insertWavefunction f ψ σ x ≠ 0) : + |‖x 0‖⁻¹| ≤ d⁻¹ := by + have hdf : d < ‖x 0‖ := by + by_contra hh + have hhf := hf (x 0) (le_of_not_gt hh) + exact hx (by simp [insertWavefunction, hhf]) + simpa only [one_div, abs_of_nonneg (inv_nonneg.mpr (norm_nonneg _))] using + one_div_le_one_div_of_le hd hdf.le + + theorem inserted_pair_bound {n : ℕ} {R d : ℝ} (hRd : R < d) + {f : Position → ℝ} {ψ : Wavefunction n} (hf : ∀ y, ‖y‖ ≤ d → f y = 0) + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) + (σ : Spins (n+1)) (x : Configuration (n+1)) (i : Fin n) + (hx : insertWavefunction f ψ σ x ≠ 0) : |‖x 0-x i.succ‖⁻¹| ≤ (d-R)⁻¹ := by + have hdf : d < ‖x 0‖ := by + by_contra hh + exact hx (by simp [insertWavefunction, hf (x 0) (le_of_not_gt hh)]) + have htail := (insertionSupport_tensor (fun y hy => hf y (hy.trans hRd.le)) hψ σ x hx).2 i + have hb := norm_sub_norm_le (x 0) (x i.succ) + have hdist : d-R ≤ ‖x 0-x i.succ‖ := by linarith + simpa only [one_div, abs_of_nonneg (inv_nonneg.mpr (norm_nonneg _))] using + one_div_le_one_div_of_le (sub_pos.mpr hRd) hdist + + theorem FormRegular.insert_separated {n : ℕ} {ψ : Wavefunction n} {g : Gradient n} + (h : FormRegular ψ g) {R d : ℝ} (hd : 0 < d) (hRd : R < d) + (hψ : ∀ σ x, R < ‖x‖ → ψ σ x = 0) + {f : Position → ℝ} (hf : ContDiff ℝ ∞ f) (hfLp : MemLp f 2 volume) + (hdfLp : ∀ a, MemLp (fun y => fderiv ℝ f y (EuclideanSpace.single a 1)) 2 volume) + (hfout : ∀ y, ‖y‖ ≤ d → f y = 0) : + FormRegular (insertWavefunction f ψ) (insertGradient f ψ g) := by + refine ⟨HasWeakGradient.insert h.1 h.2.1 h.2.2.1 hf hfLp hdfLp, + insertWavefunction_memLp h.2.1 hfLp, insertGradient_memLp h.2.1 h.2.2.1 hfLp hdfLp, ?_, ?_⟩ + · intro σ i + cases i using Fin.cases with + | zero => + exact integrable_supported_weight (insertWavefunction_memLp h.2.1 hfLp σ) + (by fun_prop) (inserted_nuclear_bound hd hfout σ) + | succ i => + by_cases hσ : σ 0 = 0 + · simpa only [insertWavefunction, hσ, ↓reduceIte] using + integrable_weighted_tensor hfLp (h.2.2.2.1 (fun i => σ i.succ) i) + · simp [insertWavefunction, hσ] + · intro σ i j hij + cases i using Fin.cases with + | zero => + cases j using Fin.cases with + | zero => exact (lt_irrefl _ hij).elim + | succ j => + exact integrable_supported_weight (insertWavefunction_memLp h.2.1 hfLp σ) + (by fun_prop) (inserted_pair_bound hRd hfout hψ σ · j) + | succ i => + cases j using Fin.cases with + | zero => exact (not_lt_of_ge (Fin.zero_le _) hij).elim + | succ j => + by_cases hσ : σ 0 = 0 + · simpa only [insertWavefunction, hσ, ↓reduceIte] using + integrable_weighted_tensor hfLp (h.pair (fun i => σ i.succ) i j) + · simp [insertWavefunction, hσ] + + theorem coulombPotential_cons {n : ℕ} (Z : ℕ) (y : Position) (x : Configuration n) : + coulombPotential Z (Fin.cons y x) = coulombPotential Z x - (Z : ℝ)*‖y‖⁻¹ + + ∑ i : Fin n, ‖y-x i‖⁻¹ := by + have hs {k : ℕ} (z : Configuration k) : + (∑ i : Fin k, ∑ j ∈ Finset.univ.filter (fun j => i < j), ‖z i-z j‖⁻¹) = + (1/2:ℝ) * ∑ i : Fin k, ∑ j : Fin k, ‖z i-z j‖⁻¹ := + half_ordered_sum _ (fun i j => by rw [norm_sub_rev]) (fun i => by simp) + simp only [coulombPotential, hs, Fin.sum_univ_succ, Fin.cons_zero, Fin.cons_succ, + sub_self, norm_zero, inv_zero, zero_add, Finset.sum_add_distrib] + simp_rw [norm_sub_rev _ y] + ring + +def gradientNormSquared {n : ℕ} (g : Gradient n) : ℝ := + ∑ i : Fin n, ∑ a : Fin 3, normSquared (fun σ x => g σ i a x) + + theorem gradientNormSquared_eq {n : ℕ} (g : Gradient n) : + gradientNormSquared g = ∑ σ : Spins n, ∑ i : Fin n, ∑ a : Fin 3, ∫ x, ‖g σ i a x‖^2 := by + unfold gradientNormSquared normSquared + simp_rw [Finset.sum_comm (f := fun a σ => ∫ x, ‖g σ _ a x‖^2)] + rw [Finset.sum_comm] + + def potentialForm {n : ℕ} (Z : ℕ) (ψ : Wavefunction n) : ℝ := + ∑ σ : Spins n, ∫ x, coulombPotential Z x * ‖ψ σ x‖^2 + + theorem energy_decompose {n : ℕ} (Z : ℕ) (ψ : Wavefunction n) (g : Gradient n) : + energy Z ψ g = (1/2 : ℝ)*gradientNormSquared g + potentialForm Z ψ := by + rw [gradientNormSquared_eq] + rfl + +end NeutralAtom +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombRadii/Variational/WeightedNegative.lean b/lean/OAI/Analysis/CoulombRadii/Variational/WeightedNegative.lean new file mode 100644 index 0000000000000000000000000000000000000000..1102fc002001a4c0c2e0a5758a066d86b2b02413 --- /dev/null +++ b/lean/OAI/Analysis/CoulombRadii/Variational/WeightedNegative.lean @@ -0,0 +1,65 @@ +import Mathlib +import OAI.Analysis.CoulombRadii.FieldAnalysis.PoissonInterior + +namespace OAI + +section +section +open MeasureTheory Set Filter +noncomputable section +namespace NeutralAtom + +lemma weighted_nonneg_integrable_of_le {X : Type*} [MeasurableSpace X] {μ : Measure X} + {w Y G : X → ℝ} (hw : Integrable w μ) (hw0 : ∀ᵐ x ∂μ, 0≤w x) + (hY : AEStronglyMeasurable Y μ) (hY0 : ∀ᵐ x ∂μ, 0≤Y x) + (hGi : Integrable (fun x => w x*G x) μ) {A d : ℝ} + (hbound : ∀ᵐ x ∂μ, w x≠0 → Y x≤A*G x+d) : + Integrable (fun x => w x*Y x) μ := by + apply ((hGi.const_mul A).add (hw.const_mul d)).mono' (hw.aestronglyMeasurable.mul hY) + filter_upwards [hw0,hY0,hbound] with x hw hy hb + change ‖w x*Y x‖≤A*(w x*G x)+d*w x + rw [Real.norm_of_nonneg (mul_nonneg hw hy)] + by_cases hz : w x=0 + · simp [hz] + have H := mul_le_mul_of_nonneg_left (hb hz) hw + change w x*Y x≤A*(w x*G x)+d*w x + nlinarith + +lemma weighted_integral_le {X : Type*} [MeasurableSpace X] {μ : Measure X} + {w Y G : X → ℝ} (hw : Integrable w μ) (hw0 : ∀ᵐ x ∂μ, 0≤w x) + (hY : AEStronglyMeasurable Y μ) (hY0 : ∀ᵐ x ∂μ, 0≤Y x) + (hGi : Integrable (fun x => w x*G x) μ) {A d : ℝ} + (hbound : ∀ᵐ x ∂μ, w x≠0 → Y x≤A*G x+d) : + (∫ x, w x*Y x ∂μ)≤A*(∫ x, w x*G x ∂μ)+d*(∫ x, w x ∂μ) := by + have H := integral_mono_ae (weighted_nonneg_integrable_of_le hw hw0 hY hY0 hGi hbound) + ((hGi.const_mul A).add (hw.const_mul d)) (show ∀ᵐ x ∂μ, + w x*Y x≤A*(w x*G x)+d*w x from ?_) + · simpa only [Pi.add_apply,integral_add (hGi.const_mul A) (hw.const_mul d),integral_const_mul] using H + · filter_upwards [hw0,hbound] with x hw hb + by_cases hz : w x=0 + · simp [hz] + nlinarith [mul_le_mul_of_nonneg_left (hb hz) hw] + +lemma weighted_exception_le {X : Type*} [MeasurableSpace X] {μ : Measure X} + {w Y G : X → ℝ} (hw : Integrable w μ) (hw0 : ∀ᵐ x ∂μ, 0≤w x) + (hY : AEStronglyMeasurable Y μ) (hY0 : ∀ᵐ x ∂μ, 0≤Y x) + (hGi : Integrable (fun x => w x*G x) μ) {A d : ℝ} + (hbound : ∀ᵐ x ∂μ, w x≠0 → Y x≤A*G x+d) (B : Set X) (hB : MeasurableSet B) : + (∫ x in B, w x*Y x ∂μ)≤A*(∫ x, w x*G x ∂μ)+d*(∫ x, w x ∂μ) := by + have hi := weighted_nonneg_integrable_of_le hw hw0 hY hY0 hGi hbound + apply le_trans _ (weighted_integral_le hw hw0 hY hY0 hGi hbound) + rw [←integral_indicator hB] + apply integral_mono_ae (hi.indicator hB) hi + filter_upwards [hw0,hY0] with x hw hy + by_cases hx : x∈B + · simp only [indicator_of_mem hx,le_refl] + · simp only [indicator_of_notMem hx] + exact mul_nonneg hw hy + +end NeutralAtom +end + +end +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ActualGeometryConclusion.lean b/lean/OAI/Analysis/CoulombTransport/ActualGeometryConclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b6adc94b05382e333c85aa7c838b0ad047ae0c5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ActualGeometryConclusion.lean @@ -0,0 +1,212 @@ +import OAI.Analysis.CoulombTransport.ExistenceFromLocalGeometry +import OAI.Analysis.CoulombTransport.FiveComponentGeometry +import OAI.Analysis.CoulombTransport.CommonBranches +import OAI.Analysis.CoulombTransport.ComponentRegions +import OAI.Analysis.CoulombTransport.ContactSelection +import OAI.Analysis.CoulombTransport.FiveComponentGlobal +import OAI.Analysis.CoulombTransport.CoulombSupportSeparated + +namespace OAI + +noncomputable section +open Set Metric MeasureTheory +open scoped ENNReal InnerProductSpace + +namespace Problem356.FiveComponentGeometry + +open LocalGeometry CenterCertificate + +theorem ennreal_graph_contact {a : E3} (C : ChartsAt a) {s : E3} + (hs : s ∈ C.charts.central.source) + (hxy : 0 < dist (C.charts.central s) s) + (hxz : 0 < dist (C.charts.central s) (C.charts.opposite s)) + (hyz : 0 < dist s (C.charts.opposite s)) : + ENNReal.ofReal (((5 : ℝ) / 2 - 10 * ‖C.charts.central s‖ ^ 2) + C.value s + + ((5 : ℝ) / 4 * ⟪a, C.charts.opposite s + a⟫_ℝ - + 10 * ‖C.charts.opposite s + a‖ ^ 2)) = + coulombCost (C.charts.central s, (s, C.charts.opposite s)) := by + have ht := C.charts.mapsTo_state hs + rw [C.state_ball, ← ball_prod_same] at ht + exact (ennreal_local_certificate C (C.source_ball ▸ hs) ht.1 ht.2 hxy hxz hyz).2.mpr + ⟨rfl, rfl⟩ + +/-- The actual five-component certificate discharges every local-geometry +input, after choosing a sufficiently small common central ball. -/ +theorem fullConclusion_of_five_component_certificate + (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + (hout₁ : ∀ s ∈ C₁.charts.central.source, + s ∉ ball (0 : E3) (1 / 4) ∧ C₁.charts.opposite s ∉ ball (0 : E3) (1 / 4)) + (hout₂ : ∀ s ∈ C₂.charts.central.source, + s ∉ ball (0 : E3) (1 / 4) ∧ C₂.charts.opposite s ∉ ball (0 : E3) (1 / 4)) + {R : ℝ} (hR : 0 < R) + (hdisj : Pairwise (fun i j : Fin 5 => Disjoint (ball (point i) R) (ball (point j) R))) + {u : E3 → ℝ} (hu : Measurable u) {M : ℝ} (hM : 0 ≤ M) + (hubound : ∀ x, |u x| ≤ M) + (hueq : ∀ i x, x ∈ ball (point i) R → u x = potentials C₁ C₂ i x) + (hcert : ∀ x ∈ ⋃ i : Fin 5, ball (point i) R, + ∀ y ∈ ⋃ i : Fin 5, ball (point i) R, ∀ z ∈ ⋃ i : Fin 5, ball (point i) R, + ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) → + branchContact C₁ C₂ (x, (y, z)))) : + ∃ rho : E3 → ℝ, HasFullCoulombConclusion rho := by + let X : Fin 2 → OpenPartialHomeomorph E3 E3 := ![C₁.charts.central, C₂.charts.central] + let Z : Fin 2 → OpenPartialHomeomorph E3 E3 := ![C₁.charts.opposite, C₂.charts.opposite] + let a : Fin 2 → E3 := ![point 1, point 3] + let P : Fin 2 → Set E3 := ![ball (point 1) R, ball (point 3) R] + let Q : Fin 2 → Set E3 := ![ball (point 2) R, ball (point 4) R] + have haX : ∀ i, a i ∈ (X i).source := by + intro i; fin_cases i + · exact C₁.charts.point_mem + · exact C₂.charts.point_mem + have haZ : ∀ i, a i ∈ (Z i).source := by + intro i; fin_cases i + · exact C₁.charts.source_eq ▸ C₁.charts.point_mem + · exact C₂.charts.source_eq ▸ C₂.charts.point_mem + have hcenter : ∀ i, X i (a i) = 0 := by + intro i; fin_cases i + · exact C₁.charts.central_value + · exact C₂.charts.central_value + have hP : ∀ i, IsOpen (P i) := by intro i; fin_cases i <;> exact isOpen_ball + have hQ : ∀ i, IsOpen (Q i) := by intro i; fin_cases i <;> exact isOpen_ball + have haP : ∀ i, a i ∈ P i := by intro i; fin_cases i <;> exact mem_ball_self hR + have haQ : ∀ i, Z i (a i) ∈ Q i := by + intro i; fin_cases i + · change C₁.charts.opposite (point 1) ∈ ball (point 2) R + rw [C₁.charts.opposite_value, point_two_eq_neg] + exact mem_ball_self hR + · change C₂.charts.opposite (point 3) ∈ ball (point 4) R + rw [C₂.charts.opposite_value, point_four_eq_neg] + exact mem_ball_self hR + obtain ⟨r, hr, hsub, hlocal⟩ := CommonBranches.exists_common_central_ball_in_components + X Z a 0 haX haZ hcenter P Q hP hQ haP haQ + (isOpen_ball.inter isOpen_ball) + (show (0 : E3) ∈ ball 0 R ∩ ball 0 (1 / 4) from + ⟨mem_ball_self hR, mem_ball_self (by norm_num)⟩) + let e := CommonBranches.four X Z + have hBS : ∀ i, ball (0 : E3) r ⊆ (CommonBranches.outer (X i) (Z i)).source := + fun i x hx => (hlocal i x hx).1 + have hsource : ∀ i, ball (0 : E3) r ⊆ (e i).source := + CommonBranches.subset_four_sources X Z hBS + have hB0 : ball (0 : E3) r ⊆ ball (point 0) R := by + have hp0 : point 0 = (0 : E3) := by + ext i; fin_cases i <;> rfl + rw [hp0] + exact fun x hx => (hsub hx).1 + have himages : ∀ i, e i '' ball (0 : E3) r ⊆ ball (point i.succ) R := by + rintro i _ ⟨x, hx, rfl⟩ + fin_cases i + · exact (hlocal 0 x hx).2.1 + · exact (hlocal 0 x hx).2.2 + · exact (hlocal 1 x hx).2.1 + · exact (hlocal 1 x hx).2.2 + have he : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i) (e i).source := by + apply CommonBranches.contDiffOn_four + · intro i; fin_cases i + · exact C₁.charts.central_inverse_analytic.of_le (by simp) + · exact C₂.charts.central_inverse_analytic.of_le (by simp) + · intro i; fin_cases i + · exact C₁.charts.opposite_analytic.of_le (by simp) + · exact C₂.charts.opposite_analytic.of_le (by simp) + have he' : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i).symm (e i).target := by + apply CommonBranches.contDiffOn_four_symm + · intro i; fin_cases i + · exact C₁.charts.central_analytic.of_le (by simp) + · exact C₂.charts.central_analytic.of_le (by simp) + · intro i; fin_cases i + · exact C₁.charts.opposite_inverse_analytic.of_le (by simp) + · exact C₂.charts.opposite_inverse_analytic.of_le (by simp) + have hmem (i : Fin 4) {x : E3} (hx : x ∈ ball (0 : E3) r) : + e i x ∈ ball (point i.succ) R := himages i ⟨x, hx, rfl⟩ + have hdist {i j : Fin 5} (hij : i ≠ j) {x y : E3} + (hx : x ∈ ball (point i) R) (hy : y ∈ ball (point j) R) : 0 < dist x y := by + apply dist_pos.mpr + intro heq + exact Set.disjoint_left.mp (hdisj hij) hx (heq ▸ hy) + have hcontact (i : Fin 2) (x : E3) (hx : x ∈ ball (0 : E3) r) : + ENNReal.ofReal (u x + u ((X i).symm x) + u (CommonBranches.outer (X i) (Z i) x)) = + coulombCost (x, ((X i).symm x, CommonBranches.outer (X i) (Z i) x)) := by + have hprop := CommonBranches.outer_source_properties (X i) (Z i) (hBS i hx) + fin_cases i + · change ENNReal.ofReal (u x + u (C₁.charts.central.symm x) + + u (C₁.charts.opposite (C₁.charts.central.symm x))) = + coulombCost (x, (C₁.charts.central.symm x, C₁.charts.opposite (C₁.charts.central.symm x))) + have hy : C₁.charts.central.symm x ∈ ball (point 1) R := hmem 0 hx + have hz : C₁.charts.opposite (C₁.charts.central.symm x) ∈ ball (point 2) R := hmem 1 hx + have hinv : C₁.charts.central (C₁.charts.central.symm x) = x := hprop.2.2.2.2 + rw [hueq 0 x (hB0 hx), hueq 1 _ hy, hueq 2 _ hz] + have hc := ennreal_graph_contact C₁ (s := C₁.charts.central.symm x) hprop.2.1 + (by rw [hinv]; exact hdist (by decide : (0 : Fin 5) ≠ 1) (hB0 hx) hy) + (by rw [hinv]; exact hdist (by decide : (0 : Fin 5) ≠ 2) (hB0 hx) hz) + (hdist (by decide : (1 : Fin 5) ≠ 2) hy hz) + simpa [potentials, hinv] using hc + · change ENNReal.ofReal (u x + u (C₂.charts.central.symm x) + + u (C₂.charts.opposite (C₂.charts.central.symm x))) = + coulombCost (x, (C₂.charts.central.symm x, C₂.charts.opposite (C₂.charts.central.symm x))) + have hy : C₂.charts.central.symm x ∈ ball (point 3) R := hmem 2 hx + have hz : C₂.charts.opposite (C₂.charts.central.symm x) ∈ ball (point 4) R := hmem 3 hx + have hinv : C₂.charts.central (C₂.charts.central.symm x) = x := hprop.2.2.2.2 + rw [hueq 0 x (hB0 hx), hueq 3 _ hy, hueq 4 _ hz] + have hc := ennreal_graph_contact C₂ (s := C₂.charts.central.symm x) hprop.2.1 + (by rw [hinv]; exact hdist (by decide : (0 : Fin 5) ≠ 3) (hB0 hx) hy) + (by rw [hinv]; exact hdist (by decide : (0 : Fin 5) ≠ 4) (hB0 hx) hz) + (hdist (by decide : (3 : Fin 5) ≠ 4) hy hz) + simpa [potentials, hinv] using hc + apply exists_fullCoulombConclusion_of_local_geometry 0 hr e hsource + (SmoothBranchMarginal.componentRegion_pairwise_of_subsets hdisj hB0 himages) he he' + (MeasurableSet.iUnion fun _ => isOpen_ball.measurableSet) + (fun x hx => mem_iUnion.mpr ⟨0, hB0 hx⟩) + (fun i x hx => mem_iUnion.mpr ⟨i.succ, himages i hx⟩) + hu hM (fun x _ => abs_le.mp (hubound x)) + (fun t h1 h2 h3 => (hcert _ h1 _ h2 _ h3).1) + (hcontact 0) (hcontact 1) + intro x y z hx hy hz hc + have hc' := (hcert x (mem_iUnion.mpr ⟨0, hB0 hx⟩) y hy z hz).2 hc + rcases hc' with ⟨s, hs, hp⟩ | ⟨s, hs, hp⟩ + · have hy' := ContactSelection.second_selects_inverse_branch hp hx hs + (fun s hs => ⟨fun h => (hout₁ s hs).1 (hsub h).2, + fun h => (hout₁ s hs).2 (hsub h).2⟩) + (fun s hs => C₁.charts.central.left_inv hs) + (show ∀ w ∈ ball (0 : E3) r, + CommonBranches.outer C₁.charts.central C₁.charts.opposite w = + C₁.charts.opposite (C₁.charts.central.symm w) from fun _ _ => rfl) + rcases hy' with hy' | hy' + · exact ⟨0, hy'⟩ + · exact ⟨1, hy'⟩ + · have hy' := ContactSelection.second_selects_inverse_branch hp hx hs + (fun s hs => ⟨fun h => (hout₂ s hs).1 (hsub h).2, + fun h => (hout₂ s hs).2 (hsub h).2⟩) + (fun s hs => C₂.charts.central.left_inv hs) + (show ∀ w ∈ ball (0 : E3) r, + CommonBranches.outer C₂.charts.central C₂.charts.opposite w = + C₂.charts.opposite (C₂.charts.central.symm w) from fun _ _ => rfl) + rcases hy' with hy' | hy' + · exact ⟨2, hy'⟩ + · exact ⟨3, hy'⟩ + +/-- The unconditional witness: the actual separated local Coulomb charts +and their global certificate supply all inputs of the construction. -/ +theorem exists_full_coulomb_conclusion : + ∃ rho : E3 → ℝ, HasFullCoulombConclusion rho := by + have hp1 : point 1 = CoulombCalculus.axisVector 0 := by + ext i; fin_cases i <;> norm_num [point, CoulombCalculus.axisVector] + have hp3 : point 3 = CoulombCalculus.axisVector 1 := by + change (!₂[0, 1, 0] : E3) = CoulombCalculus.axisVector 1 + ext i; fin_cases i <;> norm_num [CoulombCalculus.axisVector] + have h₁ := CoulombSupportExistence.exists_coulombLocalSupportingCharts_separated 0 + have h₂ := CoulombSupportExistence.exists_coulombLocalSupportingCharts_separated 1 + rw [← hp1] at h₁ + rw [← hp3] at h₂ + obtain ⟨C₁, hout₁⟩ := h₁ + obtain ⟨C₂, hout₂⟩ := h₂ + obtain ⟨R, M, hR, hM, _, hdisj, hu, _, hubound, hcert⟩ := + exists_global_certificate C₁ C₂ + apply fullConclusion_of_five_component_certificate C₁ C₂ hout₁ hout₂ hR hdisj hu + hM.le hubound ?_ hcert + intro i x hx + exact ComponentPotential.glue_eq hdisj hx + +end Problem356.FiveComponentGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/All.lean b/lean/OAI/Analysis/CoulombTransport/All.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef79be97cddd098b5ca2703ae9b4c2987b65cf74 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/All.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.CoulombTransport.AnalyticCoulomb +import OAI.Analysis.CoulombTransport.AtomlessMap +import OAI.Analysis.CoulombTransport.AtomlessTransport +import OAI.Analysis.CoulombTransport.AxisHessian +import OAI.Analysis.CoulombTransport.BorelTransport +import OAI.Analysis.CoulombTransport.BranchCoupling +import OAI.Analysis.CoulombTransport.BranchDensity +import OAI.Analysis.CoulombTransport.BranchInterfaces +import OAI.Analysis.CoulombTransport.BranchOptimizer +import OAI.Analysis.CoulombTransport.BranchSeparation +import OAI.Analysis.CoulombTransport.Calibration +import OAI.Analysis.CoulombTransport.CellOscillation +import OAI.Analysis.CoulombTransport.CellTable +import OAI.Analysis.CoulombTransport.CellwiseLift +import OAI.Analysis.CoulombTransport.CenterCertificate +import OAI.Analysis.CoulombTransport.CertificateAttainment +import OAI.Analysis.CoulombTransport.CertificateDuality +import OAI.Analysis.CoulombTransport.CertificateNeighborhoods +import OAI.Analysis.CoulombTransport.CommonBranches +import OAI.Analysis.CoulombTransport.CompactLiftApproximation +import OAI.Analysis.CoulombTransport.CompactPartition +import OAI.Analysis.CoulombTransport.CompactSeparation +import OAI.Analysis.CoulombTransport.ComponentCertificate +import OAI.Analysis.CoulombTransport.ComponentPotential +import OAI.Analysis.CoulombTransport.ContactObstruction +import OAI.Analysis.CoulombTransport.ContactSelection +import OAI.Analysis.CoulombTransport.ContactSelectionAE +import OAI.Analysis.CoulombTransport.ContinuousCDF +import OAI.Analysis.CoulombTransport.CostTopology +import OAI.Analysis.CoulombTransport.CoulombBranches +import OAI.Analysis.CoulombTransport.CoulombCalculus +import OAI.Analysis.CoulombTransport.CoulombCharts +import OAI.Analysis.CoulombTransport.CoulombCoercivity +import OAI.Analysis.CoulombTransport.CoulombEstimates +import OAI.Analysis.CoulombTransport.CoulombLocalCertificate +import OAI.Analysis.CoulombTransport.CounterexampleAssembly +import OAI.Analysis.CoulombTransport.CouplingSupport +import OAI.Analysis.CoulombTransport.Model +import OAI.Analysis.CoulombTransport.Density +import OAI.Analysis.CoulombTransport.DensityMeasure +import OAI.Analysis.CoulombTransport.DensityMixture +import OAI.Analysis.CoulombTransport.DisjointSquares +import OAI.Analysis.CoulombTransport.DualCertificate +import OAI.Analysis.CoulombTransport.Endgame +import OAI.Analysis.CoulombTransport.EqualInfima +import OAI.Analysis.CoulombTransport.ExtendedPushforward +import OAI.Analysis.CoulombTransport.FiniteMassSplit +import OAI.Analysis.CoulombTransport.FirstCoordinateLift +import OAI.Analysis.CoulombTransport.GeometryJets +import OAI.Analysis.CoulombTransport.GluedCertificate +import OAI.Analysis.CoulombTransport.GoodTypePermutation +import OAI.Analysis.CoulombTransport.GraphBridge +import OAI.Analysis.CoulombTransport.HessianCLM +import OAI.Analysis.CoulombTransport.HessianCoercivity +import OAI.Analysis.CoulombTransport.HessianMatrix +import OAI.Analysis.CoulombTransport.IsometryTransport +import OAI.Analysis.CoulombTransport.JacobianSquareRoot +import OAI.Analysis.CoulombTransport.LocalBranchMeasure +import OAI.Analysis.CoulombTransport.LocalCertificate +import OAI.Analysis.CoulombTransport.LocalImplicit +import OAI.Analysis.CoulombTransport.LocalPotentialBounds +import OAI.Analysis.CoulombTransport.LocalSplitting +import OAI.Analysis.CoulombTransport.NeighborhoodCertificate +import OAI.Analysis.CoulombTransport.OptimalLocalization +import OAI.Analysis.CoulombTransport.PairEnergyFinite +import OAI.Analysis.CoulombTransport.PartitionLabel +import OAI.Analysis.CoulombTransport.PartitionTransport +import OAI.Analysis.CoulombTransport.ProductPlan +import OAI.Analysis.CoulombTransport.RealCounterexampleAssembly +import OAI.Analysis.CoulombTransport.SeparatedLiftApproximation +import OAI.Analysis.CoulombTransport.SmoothBranchMarginal +import OAI.Analysis.CoulombTransport.SmoothPushforward +import OAI.Analysis.CoulombTransport.SplitMeasure +import OAI.Analysis.CoulombTransport.Splitting +import OAI.Analysis.CoulombTransport.SplittingConstruction +import OAI.Analysis.CoulombTransport.StateDual +import OAI.Analysis.CoulombTransport.StationaryConvexity +import OAI.Analysis.CoulombTransport.StationaryEquation +import OAI.Analysis.CoulombTransport.StationaryMap +import OAI.Analysis.CoulombTransport.StrictMinimum +import OAI.Analysis.CoulombTransport.Symmetrization +import OAI.Analysis.CoulombTransport.TriplePermutation + +import OAI.Analysis.CoulombTransport.ExistenceFromLocalGeometry +import OAI.Analysis.CoulombTransport.CoulombSupportExistence + +import OAI.Analysis.CoulombTransport.FiveComponentGeometry +import OAI.Analysis.CoulombTransport.FiveComponentCanonical + +import OAI.Analysis.CoulombTransport.GluedCertificateForward +import OAI.Analysis.CoulombTransport.FiveComponentGlobal + +import OAI.Analysis.CoulombTransport.CenterAxis +import OAI.Analysis.CoulombTransport.ComponentRegions +import OAI.Analysis.CoulombTransport.ContactCommonBranches +import OAI.Analysis.CoulombTransport.CoulombSupportSeparated +import OAI.Analysis.CoulombTransport.FiveComponentSelection + +import OAI.Analysis.CoulombTransport.ActualGeometryConclusion diff --git a/lean/OAI/Analysis/CoulombTransport/AnalyticCoulomb.lean b/lean/OAI/Analysis/CoulombTransport/AnalyticCoulomb.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d3b875a430b9717bece47b129c733fd9f99a4e9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/AnalyticCoulomb.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uE uF uP uS uR + +noncomputable section + +namespace Problem356.AnalyticCoulomb + +/-- Inverse distance is real analytic off the diagonal; the statement +also supplies every finite or infinite differentiability order. -/ +theorem contDiffAt_inverseDistance {E : Type uE} {F : Type uF} + [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + {n : WithTop ENat} {f g : E → F} {x : E} + (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) + (hne : f x ≠ g x) : + ContDiffAt ℝ n (fun y => ‖f y - g y‖⁻¹) x := by + exact ((hf.sub hg).norm ℝ (sub_ne_zero.mpr hne)).inv + (norm_ne_zero_iff.mpr (sub_ne_zero.mpr hne)) + +/-- The real-valued Coulomb formula is analytic at every collision-free triple. -/ +theorem contDiffAt_cost {n : WithTop ENat} (t : Triple) + (h12 : t.1 ≠ t.2.1) (h13 : t.1 ≠ t.2.2) (h23 : t.2.1 ≠ t.2.2) : + ContDiffAt ℝ n (fun p : Triple => + ‖p.1 - p.2.1‖⁻¹ + ‖p.1 - p.2.2‖⁻¹ + ‖p.2.1 - p.2.2‖⁻¹) t := by + have h1 : ContDiffAt ℝ n (fun p : Triple => p.1) t := contDiffAt_fst + have h2 : ContDiffAt ℝ n (fun p : Triple => p.2.1) t := contDiffAt_snd.fst + have h3 : ContDiffAt ℝ n (fun p : Triple => p.2.2) t := contDiffAt_snd.snd + exact ((contDiffAt_inverseDistance h1 h2 h12).add + (contDiffAt_inverseDistance h1 h3 h13)).add + (contDiffAt_inverseDistance h2 h3 h23) + +/-- Analyticity of a parameter-dependent partial derivative. This is the +stationarity-map regularity needed by the analytic implicit-function theorem. -/ +theorem contDiffAt_partialFDeriv {P : Type uP} {S : Type uS} {R : Type uR} + [NormedAddCommGroup P] [NormedSpace ℝ P] + [NormedAddCommGroup S] [NormedSpace ℝ S] + [NormedAddCommGroup R] [NormedSpace ℝ R] + {F : P × S → R} {p : P × S} + (hF : ContDiffAt ℝ (⊤ : WithTop ENat) F p) : + ContDiffAt ℝ (⊤ : WithTop ENat) + (fun q : P × S => fderiv ℝ (fun s => F (q.1, s)) q.2) p := by + have hpair : ContDiffAt ℝ (⊤ : WithTop ENat) + (fun q : (P × S) × S => (q.1.1, q.2)) (p, p.2) := + contDiffAt_fst.fst.prodMk contDiffAt_snd + have hcomp : ContDiffAt ℝ (⊤ : WithTop ENat) + (Function.uncurry (fun (q : P × S) (s : S) => F (q.1, s))) (p, p.2) := + hF.comp _ hpair + exact hcomp.fderiv contDiffAt_snd le_top + +/-- Joint analyticity of the state Hessian, hence its continuity for the +positive-definiteness persistence step. -/ +theorem contDiffAt_partialHessian {P : Type uP} {S : Type uS} {R : Type uR} + [NormedAddCommGroup P] [NormedSpace ℝ P] + [NormedAddCommGroup S] [NormedSpace ℝ S] + [NormedAddCommGroup R] [NormedSpace ℝ R] + {F : P × S → R} {p : P × S} + (hF : ContDiffAt ℝ (⊤ : WithTop ENat) F p) : + ContDiffAt ℝ (⊤ : WithTop ENat) + (fun q : P × S => fderiv ℝ + (fun s => fderiv ℝ (fun r => F (q.1, r)) s) q.2) p := by + exact contDiffAt_partialFDeriv (contDiffAt_partialFDeriv hF) + +/-- In parameter/state coordinates `(y,(x,z))`, subtracting arbitrary analytic +central and outer potentials leaves an analytic Coulomb stationarity map. -/ +theorem contDiffAt_stationarity + (u v : E3 → ℝ) (p : E3 × (E3 × E3)) + (hu : ContDiffAt ℝ (⊤ : WithTop ENat) u p.2.1) + (hv : ContDiffAt ℝ (⊤ : WithTop ENat) v p.2.2) + (hxy : p.2.1 ≠ p.1) (hxz : p.2.1 ≠ p.2.2) (hyz : p.1 ≠ p.2.2) : + ContDiffAt ℝ (⊤ : WithTop ENat) + (fun q : E3 × (E3 × E3) => + fderiv ℝ (fun s : E3 × E3 => + ‖s.1 - q.1‖⁻¹ + ‖s.1 - s.2‖⁻¹ + ‖q.1 - s.2‖⁻¹ - u s.1 - v s.2) + q.2) p := by + apply contDiffAt_partialFDeriv (F := fun q : E3 × (E3 × E3) => + ‖q.2.1 - q.1‖⁻¹ + ‖q.2.1 - q.2.2‖⁻¹ + ‖q.1 - q.2.2‖⁻¹ - u q.2.1 - v q.2.2) + have hx : ContDiffAt ℝ (⊤ : WithTop ENat) (fun q : E3 × (E3 × E3) => q.2.1) p := + contDiffAt_snd.fst + have hy : ContDiffAt ℝ (⊤ : WithTop ENat) (fun q : E3 × (E3 × E3) => q.1) p := + contDiffAt_fst + have hz : ContDiffAt ℝ (⊤ : WithTop ENat) (fun q : E3 × (E3 × E3) => q.2.2) p := + contDiffAt_snd.snd + exact ((((contDiffAt_inverseDistance hx hy hxy).add + (contDiffAt_inverseDistance hx hz hxz)).add + (contDiffAt_inverseDistance hy hz hyz)).sub (hu.comp p hx)).sub (hv.comp p hz) + +end Problem356.AnalyticCoulomb + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/AtomlessMap.lean b/lean/OAI/Analysis/CoulombTransport/AtomlessMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..82c3569472361af8b216a70e3cb25de0b052a3d9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/AtomlessMap.lean @@ -0,0 +1,44 @@ +import Mathlib + +namespace OAI + +universe uAlpha uBeta + +/-! # Atomlessness of injective measurable pushforwards + +This supports the standard-Borel-to-real reduction in the construction of +measure-preserving maps. +-/ + +open MeasureTheory + +namespace Problem356 + +variable {α : Type uAlpha} {β : Type uBeta} [MeasurableSpace α] [MeasurableSpace β] + +/-- An injective measurable map preserves the property of having null +singletons. No probability or finiteness hypothesis is needed. -/ +theorem nullSingletonClass_map_of_injective (μ : Measure α) + [NullSingletonClass μ] [MeasurableSingletonClass β] + {f : α → β} (hf : Measurable f) (hinj : Function.Injective f) : + NullSingletonClass (Measure.map f μ) := by + constructor + intro y + rw [Measure.map_apply hf (measurableSet_singleton y)] + have hsub : (f ⁻¹' {y}).Subsingleton := by + intro x hx z hz + apply hinj + exact hx.trans hz.symm + exact hsub.countable.measure_zero μ + +/-- The real-valued measurable embedding used for standard Borel spaces +sends a singleton-null measure to a singleton-null real measure. -/ +theorem nullSingletonClass_map_embeddingReal (μ : Measure α) + [StandardBorelSpace α] [NullSingletonClass μ] : + NullSingletonClass (Measure.map (embeddingReal α) μ) := + nullSingletonClass_map_of_injective μ (measurable_embeddingReal α) + (measurableEmbedding_embeddingReal α).injective + +end Problem356 + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/AtomlessTransport.lean b/lean/OAI/Analysis/CoulombTransport/AtomlessTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..f65c012ae912097d0930de8b67de1da1958148db --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/AtomlessTransport.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.CoulombTransport.BorelTransport +import OAI.Analysis.CoulombTransport.ContinuousCDF +import OAI.Analysis.CoulombTransport.AtomlessMap + +namespace OAI + +universe uX uY + +noncomputable section + +open MeasureTheory ProbabilityTheory Set Filter Topology +open scoped ENNReal unitInterval + +namespace Problem356.Transport + +/-- Every atomless standard Borel probability admits a uniform random variable. -/ +theorem exists_uniform_map {X : Type uX} [MeasurableSpace X] + [StandardBorelSpace X] (μ : Measure X) [IsProbabilityMeasure μ] + [NullSingletonClass μ] : + ∃ f : X → I, Measurable f ∧ Measure.map f μ = volume := by + let e := embeddingReal X + have he : Measurable e := measurable_embeddingReal X + let η := Measure.map e μ + have : IsProbabilityMeasure η := inferInstance + have : NullSingletonClass η := nullSingletonClass_map_embeddingReal μ + have hc : Continuous (cdf η) := continuous_cdf_of_nullSingletonClass η + let F : ℝ → I := fun x => ⟨cdf η x, cdf_nonneg η x, cdf_le_one η x⟩ + have hF : Measurable F := hc.measurable.subtype_mk + refine ⟨F ∘ e, hF.comp he, ?_⟩ + rw [← Measure.map_map hF he] + exact map_cdf_unitInterval η hc + +/-- A singleton-null standard Borel probability can be transported measurably to +any probability on a nonempty standard Borel target. -/ +theorem exists_measurable_transport {X : Type uX} {Y : Type uY} + [MeasurableSpace X] [StandardBorelSpace X] + [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] + (μ : Measure X) (ν : Measure Y) + [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] [NullSingletonClass μ] : + ∃ Q : X → Y, Measurable Q ∧ Measure.map Q μ = ν := by + obtain ⟨f, hf, hfμ⟩ := exists_uniform_map μ + obtain ⟨g, hg, hgν⟩ := ν.exists_measurable_map_eq + refine ⟨g ∘ f, hg.comp hf, ?_⟩ + rw [← Measure.map_map hg hf, hfμ, hgν] + +/-- Equal finite masses can be transported provided the source has no point atoms. -/ +theorem exists_measurable_transport_finite {X : Type uX} {Y : Type uY} + [MeasurableSpace X] [StandardBorelSpace X] + [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] + (μ : Measure X) (ν : Measure Y) + [IsFiniteMeasure μ] [IsFiniteMeasure ν] [NullSingletonClass μ] + (hmass : μ univ = ν univ) : + ∃ Q : X → Y, Measurable Q ∧ Measure.map Q μ = ν := by + by_cases hμ : μ = 0 + · have hν : ν = 0 := by + apply Measure.measure_univ_eq_zero.mp + rw [← hmass, hμ] + simp + exact ⟨fun _ => Classical.choice inferInstance, measurable_const, by simp [hμ, hν]⟩ + · have : NeZero μ := ⟨hμ⟩ + have hν : ν ≠ 0 := by + intro hν + apply hμ + apply Measure.measure_univ_eq_zero.mp + rw [hmass, hν] + simp + have : NeZero ν := ⟨hν⟩ + have : NullSingletonClass ((μ univ)⁻¹ • μ) := ⟨fun x => by simp⟩ + obtain ⟨Q, hQ, hmap⟩ := exists_measurable_transport + ((μ univ)⁻¹ • μ) ((ν univ)⁻¹ • ν) + refine ⟨Q, hQ, ?_⟩ + have hscale := congrArg (fun m : Measure Y => μ univ • m) hmap + rw [Measure.map_smul _ hQ.aemeasurable, smul_smul, ENNReal.mul_inv_cancel + (NeZero.ne (μ univ)) (measure_ne_top μ univ), one_smul] at hscale + rw [hmass, smul_smul, ENNReal.mul_inv_cancel + (NeZero.ne (ν univ)) (measure_ne_top ν univ), one_smul] at hscale + exact hscale + +/-- A restricted atomless measure can be redistributed proportionally over any +positive-mass target cell. The input cell is allowed to have mass zero. -/ +theorem exists_measurable_transport_restrict {X : Type uX} + [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] + (μ : Measure X) [IsFiniteMeasure μ] [NullSingletonClass μ] + (A B : Set X) (hA : μ A ≠ 0) : + ∃ Q : X → X, Measurable Q ∧ + Measure.map Q (μ.restrict B) = (μ B / μ A) • μ.restrict A := by + have hmass : ((μ B / μ A) • μ.restrict A) univ = μ B := by + simp only [Measure.smul_apply, Measure.restrict_apply_univ, smul_eq_mul] + exact ENNReal.div_mul_cancel hA (measure_ne_top μ A) + have : IsFiniteMeasure ((μ B / μ A) • μ.restrict A) := + ⟨by rw [hmass]; exact measure_lt_top μ B⟩ + apply exists_measurable_transport_finite + rw [Measure.restrict_apply_univ, hmass] + +/-- The transport to a measurable target cell can be chosen to take every value +inside that cell, by resetting outputs on a source-null set. -/ +theorem exists_measurable_transport_restrict_mem {X : Type uX} + [MeasurableSpace X] [StandardBorelSpace X] [Nonempty X] + (μ : Measure X) [IsFiniteMeasure μ] [NullSingletonClass μ] + (A B : Set X) (hAm : MeasurableSet A) (hA : μ A ≠ 0) : + ∃ Q : X → X, Measurable Q ∧ + Measure.map Q (μ.restrict B) = (μ B / μ A) • μ.restrict A ∧ + ∀ x, Q x ∈ A := by + classical + obtain ⟨Q, hQ, hmap⟩ := exists_measurable_transport_restrict μ A B hA + obtain ⟨a, ha⟩ := nonempty_of_measure_ne_zero hA + let R : X → X := fun x => if Q x ∈ A then Q x else a + have hR : Measurable R := hQ.ite (hAm.preimage hQ) measurable_const + have hmem : ∀ᵐ x ∂μ.restrict B, Q x ∈ A := by + apply (ae_map_iff hQ.aemeasurable hAm).mp + rw [hmap] + exact Measure.ae_smul_measure (ae_restrict_mem hAm) _ + have heq : R =ᵐ[μ.restrict B] Q := by + filter_upwards [hmem] with x hx + simp [R, hx] + refine ⟨R, hR, (Measure.map_congr heq).trans hmap, ?_⟩ + intro x + by_cases hx : Q x ∈ A <;> simp [R, hx, ha] + +end Problem356.Transport + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/AxisHessian.lean b/lean/OAI/Analysis/CoulombTransport/AxisHessian.lean new file mode 100644 index 0000000000000000000000000000000000000000..f26d2304a285afea01bf11b2328dd8f44bc40d5d --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/AxisHessian.lean @@ -0,0 +1,172 @@ +import Mathlib + +namespace OAI + +/-! Explicit nondegeneracy algebra for the two local Coulomb branches. +The Hessian eigenvalues are 2 in the axial direction and -1 transversely. +A common regularization parameter K = 20 works in every direction. -/ + +noncomputable section + +namespace Problem356.LocalHessian + +open Matrix + +/-- Eigenvalue of the inverse-distance Hessian at a unit coordinate vector. -/ +def eigenvalue (k i : Fin 3) : ℝ := if i = k then 2 else -1 + +/-- The inverse-distance Hessian at either chosen unit coordinate vector. -/ +def pairHessian (k : Fin 3) : Matrix (Fin 3) (Fin 3) ℝ := + diagonal (eigenvalue k) + +/-- First derivative of the central stationary branch for K = 20. -/ +def centralDerivative (k : Fin 3) : Matrix (Fin 3) (Fin 3) ℝ := + diagonal fun i => if i = k then 9 / 106 else -15 / 271 + +/-- First derivative of the opposite stationary branch for K = 20. -/ +def oppositeDerivative (k : Fin 3) : Matrix (Fin 3) (Fin 3) ℝ := + diagonal fun i => if i = k then 1 / 53 else -1 / 271 + +/-- Upper diagonal block of the regularized Hessian. -/ +def upperBlock (k : Fin 3) : Matrix (Fin 3) (Fin 3) ℝ := + diagonal fun i => 20 + 2 * eigenvalue k i + +/-- Lower diagonal block of the regularized Hessian. -/ +def lowerBlock (k : Fin 3) : Matrix (Fin 3) (Fin 3) ℝ := + diagonal fun i => 20 + (9 / 8) * eigenvalue k i + +/-- Mixed block of the regularized Hessian. -/ +def mixedBlock (k : Fin 3) : Matrix (Fin 3) (Fin 3) ℝ := + diagonal fun i => -eigenvalue k i + +/-- The full six-dimensional regularized Hessian. -/ +def regularizedHessian (k : Fin 3) : + Matrix (Fin 3 ⊕ Fin 3) (Fin 3 ⊕ Fin 3) ℝ := + fromBlocks (upperBlock k) (mixedBlock k) (mixedBlock k) (lowerBlock k) + +lemma eigenvalue_cases (k i : Fin 3) : + eigenvalue k i = 2 ∨ eigenvalue k i = -1 := by + unfold eigenvalue + split_ifs <;> simp + +lemma scalar_quadratic_coercive {q x z : ℝ} + (hq : q = 2 ∨ q = -1) : + 16 * (x ^ 2 + z ^ 2) ≤ + (20 + 2 * q) * x ^ 2 - 2 * q * x * z + + (20 + (9 / 8) * q) * z ^ 2 := by + rcases hq with rfl | rfl + · nlinarith [sq_nonneg (x - z), sq_nonneg x, sq_nonneg z] + · nlinarith [sq_nonneg (x + z), sq_nonneg x, sq_nonneg z] + +lemma scalar_quadratic_positive {q x z : ℝ} + (hq : q = 2 ∨ q = -1) (hxz : x ≠ 0 ∨ z ≠ 0) : + 0 < (20 + 2 * q) * x ^ 2 - 2 * q * x * z + + (20 + (9 / 8) * q) * z ^ 2 := by + have hsum : 0 < x ^ 2 + z ^ 2 := by + rcases hxz with hx | hz + · exact add_pos_of_pos_of_nonneg (sq_pos_of_ne_zero hx) (sq_nonneg z) + · exact add_pos_of_nonneg_of_pos (sq_nonneg x) (sq_pos_of_ne_zero hz) + rcases hq with rfl | rfl + · nlinarith [sq_nonneg (x - z), sq_nonneg x, sq_nonneg z] + · nlinarith [sq_nonneg (x + z), sq_nonneg x, sq_nonneg z] + +lemma scalar_quadratic_nonnegative {q x z : ℝ} + (hq : q = 2 ∨ q = -1) : + 0 ≤ (20 + 2 * q) * x ^ 2 - 2 * q * x * z + + (20 + (9 / 8) * q) * z ^ 2 := by + by_cases hx : x = 0 + · by_cases hz : z = 0 + · simp [hx, hz] + · exact (scalar_quadratic_positive hq (Or.inr hz)).le + · exact (scalar_quadratic_positive hq (Or.inl hx)).le + +lemma centralDerivative_isUnit (k : Fin 3) : IsUnit (centralDerivative k) := by + rw [centralDerivative, Matrix.isUnit_iff_isUnit_det, Matrix.det_diagonal] + apply isUnit_iff_ne_zero.mpr + apply Finset.prod_ne_zero_iff.mpr + intro i hi + split_ifs <;> norm_num + +lemma oppositeDerivative_isUnit (k : Fin 3) : IsUnit (oppositeDerivative k) := by + rw [oppositeDerivative, Matrix.isUnit_iff_isUnit_det, Matrix.det_diagonal] + apply isUnit_iff_ne_zero.mpr + apply Finset.prod_ne_zero_iff.mpr + intro i hi + split_ifs <;> norm_num + +lemma central_stationary_equation (k : Fin 3) : + upperBlock k * centralDerivative k + mixedBlock k * oppositeDerivative k = + pairHessian k := by + simp only [upperBlock, centralDerivative, mixedBlock, oppositeDerivative, + pairHessian, diagonal_mul_diagonal, diagonal_add] + congr 1 + funext i + unfold eigenvalue + split_ifs <;> norm_num + +lemma opposite_stationary_equation (k : Fin 3) : + mixedBlock k * centralDerivative k + lowerBlock k * oppositeDerivative k = + diagonal (fun i => (eigenvalue k i) / 8) := by + simp only [mixedBlock, centralDerivative, lowerBlock, oppositeDerivative, + diagonal_mul_diagonal, diagonal_add] + congr 1 + funext i + unfold eigenvalue + split_ifs <;> norm_num + +lemma regularizedHessian_quadratic (k : Fin 3) (v : Fin 3 ⊕ Fin 3 → ℝ) : + star v ⬝ᵥ ((regularizedHessian k) *ᵥ v) = + ∑ i : Fin 3, ((20 + 2 * eigenvalue k i) * v (Sum.inl i) ^ 2 - + 2 * eigenvalue k i * v (Sum.inl i) * v (Sum.inr i) + + (20 + (9 / 8) * eigenvalue k i) * v (Sum.inr i) ^ 2) := by + simp only [regularizedHessian, fromBlocks_mulVec, dotProduct, + Fintype.sum_sum_type, Pi.star_apply, star_trivial, Sum.elim_inl, + Sum.elim_inr, Pi.add_apply, upperBlock, lowerBlock, mixedBlock, + mulVec_diagonal, Function.comp_apply] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + ring + +lemma regularizedHessian_isHermitian (k : Fin 3) : + (regularizedHessian k).IsHermitian := by + apply Matrix.IsHermitian.fromBlocks + · exact Matrix.isHermitian_diagonal _ + · exact Matrix.isHermitian_diagonal _ + · exact Matrix.isHermitian_diagonal _ + +lemma regularizedHessian_posDef (k : Fin 3) : + (regularizedHessian k).PosDef := by + apply Matrix.PosDef.of_dotProduct_mulVec_pos (regularizedHessian_isHermitian k) + intro v hv + rw [regularizedHessian_quadratic] + apply Finset.sum_pos' + · intro i hi + exact scalar_quadratic_nonnegative (eigenvalue_cases k i) + · have hex : ∃ j, v j ≠ 0 := by + contrapose! hv + ext j + exact hv j + obtain ⟨j, hj⟩ := hex + cases j with + | inl i => + exact ⟨i, Finset.mem_univ _, + scalar_quadratic_positive (eigenvalue_cases k i) (Or.inl hj)⟩ + | inr i => + exact ⟨i, Finset.mem_univ _, + scalar_quadratic_positive (eigenvalue_cases k i) (Or.inr hj)⟩ + +lemma regularizedHessian_isUnit (k : Fin 3) : IsUnit (regularizedHessian k) := + (regularizedHessian_posDef k).isUnit + +lemma stationary_equation (k : Fin 3) : + regularizedHessian k * fromRows (centralDerivative k) (oppositeDerivative k) = + fromRows (pairHessian k) (diagonal fun i => (eigenvalue k i) / 8) := by + rw [regularizedHessian, fromBlocks_mul_fromRows, + central_stationary_equation, opposite_stationary_equation] + +end Problem356.LocalHessian + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/BorelTransport.lean b/lean/OAI/Analysis/CoulombTransport/BorelTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..db90737416f35c888d0215c6a533ca20c2348db8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/BorelTransport.lean @@ -0,0 +1,73 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal Topology unitInterval + +namespace Problem356.Transport + +/-- Every probability level strictly between zero and one is achieved by a continuous CDF. -/ +theorem exists_cdf_eq_of_continuous (μ : Measure ℝ) + (hc : Continuous (cdf μ)) {u : ℝ} (hu0 : 0 < u) (hu1 : u < 1) : + ∃ x : ℝ, cdf μ x = u := by + have h := isPreconnected_univ.intermediate_value_Ioo + (l₁ := atBot) (l₂ := atTop) (by simp) (by simp) hc.continuousOn + (tendsto_cdf_atBot μ) (tendsto_cdf_atTop μ) ⟨hu0, hu1⟩ + simpa only [image_univ, mem_range] using h + +/-- The probability integral transform, expressed on CDF sublevel sets. -/ +theorem measureReal_cdf_sublevel (μ : Measure ℝ) [IsProbabilityMeasure μ] + (hc : Continuous (cdf μ)) {u : ℝ} (hu0 : 0 ≤ u) (hu1 : u ≤ 1) : + μ.real {x : ℝ | cdf μ x ≤ u} = u := by + let s : Set ℝ := {x | cdf μ x ≤ u} + have hs0 : 0 ≤ μ.real s := measureReal_nonneg + have hs1 : μ.real s ≤ 1 := measureReal_le_one + apply le_antisymm + · by_contra! h + obtain ⟨v, huv, hvs⟩ := exists_between h + obtain ⟨x, hx⟩ := exists_cdf_eq_of_continuous μ hc (hu0.trans_lt huv) (hvs.trans_le hs1) + have hsub : s ⊆ Iic x := by + intro y hy + change y ≤ x + by_contra! hxy + have hmon := monotone_cdf μ hxy.le + have hy' : cdf μ y ≤ u := hy + rw [hx] at hmon + linarith + have hle := measureReal_mono (μ := μ) hsub + rw [← cdf_eq_real μ x, hx] at hle + linarith + · by_contra! h + obtain ⟨v, hsv, hvu⟩ := exists_between h + obtain ⟨x, hx⟩ := exists_cdf_eq_of_continuous μ hc (hs0.trans_lt hsv) (hvu.trans_le hu1) + have hsub : Iic x ⊆ s := by + intro y hy + have hmon := monotone_cdf μ hy + change cdf μ y ≤ u + rw [hx] at hmon + exact hmon.trans hvu.le + have hle := measureReal_mono (μ := μ) hsub + rw [← cdf_eq_real μ x, hx] at hle + linarith + +/-- A continuous CDF sends its law to uniform probability on the unit interval. -/ +theorem map_cdf_unitInterval (μ : Measure ℝ) [IsProbabilityMeasure μ] + (hc : Continuous (cdf μ)) : + μ.map (fun x : ℝ => (⟨cdf μ x, cdf_nonneg μ x, cdf_le_one μ x⟩ : I)) = volume := by + let f : ℝ → I := fun x => ⟨cdf μ x, cdf_nonneg μ x, cdf_le_one μ x⟩ + have hf : Measurable f := hc.measurable.subtype_mk + apply Measure.ext_of_Iic + intro u + rw [Measure.map_apply hf measurableSet_Iic, unitInterval.volume_Iic] + change μ {x : ℝ | cdf μ x ≤ (u : ℝ)} = ENNReal.ofReal (u : ℝ) + rw [← ofReal_measureReal (measure_ne_top μ _), + measureReal_cdf_sublevel μ hc u.property.1 u.property.2] + +end Problem356.Transport + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/BranchCoupling.lean b/lean/OAI/Analysis/CoulombTransport/BranchCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..1bda44cc818e28da1c88e93ab0f6664710e1d468 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/BranchCoupling.lean @@ -0,0 +1,186 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- A graph with all three coordinates explicitly specified. -/ +def branchGraph (f g h : E3 → E3) : E3 → Triple := fun x => (f x, (g x, h x)) + +lemma measurable_branchGraph {f g h : E3 → E3} + (hf : Measurable f) (hg : Measurable g) (hh : Measurable h) : + Measurable (branchGraph f g h) := hf.prodMk (hg.prodMk hh) + +/-- The marginal used by the two-branch construction. -/ +def branchMarginal (nu : Measure E3) (H1 H2 H3 H4 : E3 → E3) : Measure E3 := + (1 / 3 : ℝ≥0∞) • nu + + (1 / 6 : ℝ≥0∞) • (Measure.map H1 nu + Measure.map H2 nu + + Measure.map H3 nu + Measure.map H4 nu) + +/-- Each branch is averaged over its three cyclic coordinate orderings. -/ +def branchCoupling (nu : Measure E3) (H1 H2 H3 H4 : E3 → E3) : Measure Triple := + (1 / 6 : ℝ≥0∞) • + (Measure.map (branchGraph id H1 H2) nu + + Measure.map (branchGraph H1 H2 id) nu + + Measure.map (branchGraph H2 id H1) nu + + Measure.map (branchGraph id H3 H4) nu + + Measure.map (branchGraph H3 H4 id) nu + + Measure.map (branchGraph H4 id H3) nu) + +lemma map_tripleFst_branchGraph (nu : Measure E3) {f g h : E3 → E3} + (hf : Measurable f) (hg : Measurable g) (hh : Measurable h) : + Measure.map tripleFst (Measure.map (branchGraph f g h) nu) = Measure.map f nu := by + rw [Measure.map_map (show Measurable tripleFst from measurable_fst) (measurable_branchGraph hf hg hh)] + rfl + +lemma map_tripleSnd_branchGraph (nu : Measure E3) {f g h : E3 → E3} + (hf : Measurable f) (hg : Measurable g) (hh : Measurable h) : + Measure.map tripleSnd (Measure.map (branchGraph f g h) nu) = Measure.map g nu := by + rw [Measure.map_map (show Measurable tripleSnd from measurable_fst.comp measurable_snd) + (measurable_branchGraph hf hg hh)] + rfl + +lemma map_tripleThd_branchGraph (nu : Measure E3) {f g h : E3 → E3} + (hf : Measurable f) (hg : Measurable g) (hh : Measurable h) : + Measure.map tripleThd (Measure.map (branchGraph f g h) nu) = Measure.map h nu := by + rw [Measure.map_map (show Measurable tripleThd from measurable_snd.comp measurable_snd) + (measurable_branchGraph hf hg hh)] + rfl + +lemma six_smul_group (a b c d e : Measure E3) : + (1 / 6 : ℝ≥0∞) • (a + b + c + a + d + e) = + (1 / 3 : ℝ≥0∞) • a + (1 / 6 : ℝ≥0∞) • (b + c + d + e) := by + have h : (1 / 3 : ℝ≥0∞) = 1 / 6 + 1 / 6 := by + simp only [one_div] + change ((3 : NNReal) : ℝ≥0∞)⁻¹ = ((6 : NNReal) : ℝ≥0∞)⁻¹ + + ((6 : NNReal) : ℝ≥0∞)⁻¹ + rw [← ENNReal.coe_inv (by norm_num : (3 : NNReal) ≠ 0), + ← ENNReal.coe_inv (by norm_num : (6 : NNReal) ≠ 0), ← ENNReal.coe_add] + norm_num + rw [h, add_smul] + simp only [smul_add] + ac_rfl + +lemma map_tripleFst_branchCoupling (nu : Measure E3) {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) : + Measure.map tripleFst (branchCoupling nu H1 H2 H3 H4) = + branchMarginal nu H1 H2 H3 H4 := by + have hp : Measurable tripleFst := measurable_fst + simp only [branchCoupling, Measure.map_smul _ hp.aemeasurable, Measure.map_add _ _ hp, + map_tripleFst_branchGraph nu measurable_id h1 h2, + map_tripleFst_branchGraph nu h1 h2 measurable_id, + map_tripleFst_branchGraph nu h2 measurable_id h1, + map_tripleFst_branchGraph nu measurable_id h3 h4, + map_tripleFst_branchGraph nu h3 h4 measurable_id, + map_tripleFst_branchGraph nu h4 measurable_id h3, Measure.map_id] + exact six_smul_group _ _ _ _ _ + +lemma map_tripleSnd_branchCoupling (nu : Measure E3) {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) : + Measure.map tripleSnd (branchCoupling nu H1 H2 H3 H4) = + branchMarginal nu H1 H2 H3 H4 := by + have hp : Measurable tripleSnd := measurable_fst.comp measurable_snd + simp only [branchCoupling, Measure.map_smul _ hp.aemeasurable, Measure.map_add _ _ hp, + map_tripleSnd_branchGraph nu measurable_id h1 h2, + map_tripleSnd_branchGraph nu h1 h2 measurable_id, + map_tripleSnd_branchGraph nu h2 measurable_id h1, + map_tripleSnd_branchGraph nu measurable_id h3 h4, + map_tripleSnd_branchGraph nu h3 h4 measurable_id, + map_tripleSnd_branchGraph nu h4 measurable_id h3, Measure.map_id] + unfold branchMarginal + rw [← six_smul_group] + congr 1 + ac_rfl + +lemma map_tripleThd_branchCoupling (nu : Measure E3) {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) : + Measure.map tripleThd (branchCoupling nu H1 H2 H3 H4) = + branchMarginal nu H1 H2 H3 H4 := by + have hp : Measurable tripleThd := measurable_snd.comp measurable_snd + simp only [branchCoupling, Measure.map_smul _ hp.aemeasurable, Measure.map_add _ _ hp, + map_tripleThd_branchGraph nu measurable_id h1 h2, + map_tripleThd_branchGraph nu h1 h2 measurable_id, + map_tripleThd_branchGraph nu h2 measurable_id h1, + map_tripleThd_branchGraph nu measurable_id h3 h4, + map_tripleThd_branchGraph nu h3 h4 measurable_id, + map_tripleThd_branchGraph nu h4 measurable_id h3, Measure.map_id] + unfold branchMarginal + rw [← six_smul_group] + congr 1 + ac_rfl + +lemma isProbabilityMeasure_branchCoupling (nu : Measure E3) [IsProbabilityMeasure nu] + {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) : IsProbabilityMeasure (branchCoupling nu H1 H2 H3 H4) := by + constructor + simp only [branchCoupling, Measure.smul_apply, Measure.add_apply, + Measure.map_apply (measurable_branchGraph measurable_id h1 h2) MeasurableSet.univ, + Measure.map_apply (measurable_branchGraph h1 h2 measurable_id) MeasurableSet.univ, + Measure.map_apply (measurable_branchGraph h2 measurable_id h1) MeasurableSet.univ, + Measure.map_apply (measurable_branchGraph measurable_id h3 h4) MeasurableSet.univ, + Measure.map_apply (measurable_branchGraph h3 h4 measurable_id) MeasurableSet.univ, + Measure.map_apply (measurable_branchGraph h4 measurable_id h3) MeasurableSet.univ, + Set.preimage_univ, measure_univ, smul_eq_mul] + norm_num only [one_div, show (1 + 1 + 1 + 1 + 1 + 1 : ℝ≥0∞) = 6 by norm_num] + exact ENNReal.inv_mul_cancel (by norm_num) (by norm_num) + +/-- The explicit two-branch mixture is an admissible coupling of its five-component marginal. -/ +theorem isThreeCoupling_branchCoupling (nu : Measure E3) [IsProbabilityMeasure nu] + {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) : + IsThreeCoupling (branchMarginal nu H1 H2 H3 H4) (branchCoupling nu H1 H2 H3 H4) := + ⟨isProbabilityMeasure_branchCoupling nu h1 h2 h3 h4, + map_tripleFst_branchCoupling nu h1 h2 h3 h4, + map_tripleSnd_branchCoupling nu h1 h2 h3 h4, + map_tripleThd_branchCoupling nu h1 h2 h3 h4⟩ + +lemma isProbabilityMeasure_branchMarginal (nu : Measure E3) [IsProbabilityMeasure nu] + {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) : IsProbabilityMeasure (branchMarginal nu H1 H2 H3 H4) := by + have := isProbabilityMeasure_branchCoupling nu h1 h2 h3 h4 + rw [← map_tripleFst_branchCoupling nu h1 h2 h3 h4] + infer_instance + +/-- Any measurable cyclically invariant property holding on the two branches +also holds almost everywhere for their explicit coupling. -/ +theorem ae_branchCoupling (nu : Measure E3) {H1 H2 H3 H4 : E3 → E3} + (h1 : Measurable H1) (h2 : Measurable H2) (h3 : Measurable H3) + (h4 : Measurable H4) {P : Triple → Prop} (hP : MeasurableSet {t | P t}) + (hcycle : ∀ x y z, P (x, (y, z)) → P (y, (z, x))) + (h12 : ∀ᵐ x ∂nu, P (x, (H1 x, H2 x))) + (h34 : ∀ᵐ x ∂nu, P (x, (H3 x, H4 x))) : + ∀ᵐ t ∂branchCoupling nu H1 H2 H3 H4, P t := by + have h12r : ∀ᵐ x ∂nu, P (branchGraph H1 H2 id x) := + h12.mono fun x hx => hcycle _ _ _ hx + have h12rr : ∀ᵐ x ∂nu, P (branchGraph H2 id H1 x) := + h12r.mono fun x hx => hcycle _ _ _ hx + have h34r : ∀ᵐ x ∂nu, P (branchGraph H3 H4 id x) := + h34.mono fun x hx => hcycle _ _ _ hx + have h34rr : ∀ᵐ x ∂nu, P (branchGraph H4 id H3 x) := + h34r.mono fun x hx => hcycle _ _ _ hx + unfold branchCoupling + apply Measure.ae_smul_measure + simp only [ae_add_measure_iff, + ae_map_iff (measurable_branchGraph measurable_id h1 h2).aemeasurable hP, + ae_map_iff (measurable_branchGraph h1 h2 measurable_id).aemeasurable hP, + ae_map_iff (measurable_branchGraph h2 measurable_id h1).aemeasurable hP, + ae_map_iff (measurable_branchGraph measurable_id h3 h4).aemeasurable hP, + ae_map_iff (measurable_branchGraph h3 h4 measurable_id).aemeasurable hP, + ae_map_iff (measurable_branchGraph h4 measurable_id h3).aemeasurable hP] + exact ⟨⟨⟨⟨⟨h12, h12r⟩, h12rr⟩, h34⟩, h34r⟩, h34rr⟩ + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/BranchDensity.lean b/lean/OAI/Analysis/CoulombTransport/BranchDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1153301fc712c892e2d9d09784c9fefc0f9e9679 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/BranchDensity.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.CoulombTransport.DisjointSquares +import OAI.Analysis.CoulombTransport.BranchCoupling + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal BigOperators + +namespace Problem356 + +/-- Probability of a square density gives its ordinary integral normalization. -/ +theorem integral_sq_eq_one_of_densityMeasure_probability + {g : E3 → ℝ} (hg : Measurable g) + [IsProbabilityMeasure (densityMeasure (fun x => (g x) ^ 2))] : + (∫ x : E3, (g x) ^ 2 ∂(volume : Measure E3)) = 1 := by + rw [integral_eq_lintegral_of_nonneg_ae + (Filter.Eventually.of_forall (fun x => sq_nonneg (g x))) + (hg.pow_const 2).aestronglyMeasurable] + have hmass := measure_univ (μ := densityMeasure (fun x => (g x) ^ 2)) + simp only [densityMeasure, withDensity_apply _ MeasurableSet.univ, + Measure.restrict_univ] at hmass + rw [hmass, ENNReal.toReal_one] + +/-- A smooth compact unit square defines a probability measure. -/ +theorem isProbabilityMeasure_densityMeasure_unit_sq + {g : E3 → ℝ} + (hsm : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g) + (hcs : HasCompactSupport g) + (hmass : (∫ x : E3, (g x) ^ 2 ∂(volume : Measure E3)) = 1) : + IsProbabilityMeasure (densityMeasure (fun x => (g x) ^ 2)) := by + have hcomp : HasCompactSupport (fun x => (g x) ^ 2) := by + simpa only [Function.comp_def] using + hcs.comp_left (g := fun y : ℝ => y ^ 2) (by simp) + have hint : Integrable (fun x => (g x) ^ 2) (volume : Measure E3) := + (hsm.continuous.pow 2).integrable_of_hasCompactSupport hcomp + constructor + simp only [densityMeasure, withDensity_apply _ MeasurableSet.univ, + Measure.restrict_univ] + rw [← ofReal_integral_eq_lintegral_ofReal hint + (Filter.Eventually.of_forall (fun x => sq_nonneg (g x))), hmass] + exact ENNReal.ofReal_one + +/-- The weights of the central and four outer squares. -/ +def branchDensityWeight (i : Fin 5) : ℝ := if i = 0 then 1 / 3 else 1 / 6 + +lemma branchDensityWeight_nonneg (i : Fin 5) : 0 ≤ branchDensityWeight i := by + unfold branchDensityWeight + split <;> norm_num + +lemma sum_branchDensityWeight : ∑ i : Fin 5, branchDensityWeight i = 1 := by + norm_num [branchDensityWeight, Fin.sum_univ_succ] + +/-- Five disjoint square amplitudes, with the four outer square laws obtained +by the prescribed branch pushforwards, form the exact smooth branch marginal. -/ +theorem exists_smooth_density_eq_branchMarginal + (g : Fin 5 → E3 → ℝ) (H : Fin 4 → E3 → E3) + (hgn : ∀ i x, 0 ≤ g i x) + (hgs : ∀ i, ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) (g i)) + (hgc : ∀ i, HasCompactSupport (g i)) + (hgd : Pairwise fun i j => + Disjoint (Function.support (g i)) (Function.support (g j))) + (hzero : (∫ x : E3, (g 0 x) ^ 2 ∂(volume : Measure E3)) = 1) + (hH : ∀ i, Measurable (H i)) + (hmap : ∀ i : Fin 4, + densityMeasure (fun x => (g i.succ x) ^ 2) = + Measure.map (H i) (densityMeasure (fun x => (g 0 x) ^ 2))) : + ∃ rho : E3 → ℝ, + IsSmoothCompactProbabilityDensity rho ∧ + densityMeasure rho = + branchMarginal (densityMeasure (fun x => (g 0 x) ^ 2)) + (H 0) (H 1) (H 2) (H 3) := by + have := isProbabilityMeasure_densityMeasure_unit_sq (hgs 0) (hgc 0) hzero + have hmass : ∀ i : Fin 5, (∫ x : E3, (g i x) ^ 2 ∂(volume : Measure E3)) = 1 := by + intro i + refine Fin.cases hzero (fun j => ?_) i + have hp : IsProbabilityMeasure (densityMeasure (fun x => (g j.succ x) ^ 2)) := by + rw [hmap j] + exact (Measure.isProbabilityMeasure_map_iff (hH j).aemeasurable).mpr inferInstance + have := hp + exact integral_sq_eq_one_of_densityMeasure_probability (hgs j.succ).continuous.measurable + refine ⟨fun x => ∑ i : Fin 5, branchDensityWeight i * (g i x) ^ 2, ?_, ?_⟩ + · exact isSmoothCompactProbabilityDensity_sum_normalized_disjoint_squares + Finset.univ branchDensityWeight g + (fun i _ => branchDensityWeight_nonneg i) (fun i _ => hgn i) + (fun i _ => hgs i) (fun i _ => hgc i) + (fun i _ j _ hij => hgd hij) (fun i _ => hmass i) sum_branchDensityWeight + · rw [densityMeasure_sum_weighted_squares Finset.univ branchDensityWeight g + (fun i _ => branchDensityWeight_nonneg i) + (fun i _ => (hgs i).continuous.measurable)] + simp only [Fin.sum_univ_succ, branchDensityWeight, Fin.succ_ne_zero, + ite_true, ite_false] + simp only [hmap] + unfold branchMarginal + norm_num [ENNReal.ofReal_div_of_pos, smul_add] + simp only [add_assoc] + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/BranchInterfaces.lean b/lean/OAI/Analysis/CoulombTransport/BranchInterfaces.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c2791c0be80e743b2ba061b5c823af3eafd1ca1 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/BranchInterfaces.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.CoulombTransport.BranchSeparation + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.BranchSeparation + +/-- The disjointness assumptions supplied by the local branch construction +are exactly pairwise disjointness of the five labelled components. -/ +lemma pairwise_components_of_disjoint_branches {B : Set E3} {H : Fin 4 → E3 → E3} + (hcentral : ∀ i, Disjoint B (H i '' B)) + (houter : Pairwise fun i j => Disjoint (H i '' B) (H j '' B)) : + Pairwise fun i j => Disjoint (components B H i) (components B H j) := by + intro i + refine Fin.cases ?_ (fun i => ?_) i + · intro j + refine Fin.cases ?_ (fun j => ?_) j + · intro h + exact False.elim (h rfl) + · intro _ + exact hcentral j + · intro j + refine Fin.cases ?_ (fun j => ?_) j + · intro _ + exact (hcentral i).symm + · intro h + exact houter (fun h' => h (congrArg Fin.succ h')) + +/-- Compact support and uniform separation follow directly from the local +central/outer disjointness interface used by counterexample assembly. -/ +theorem compact_support_and_separation_of_branches + {nu : Measure E3} {K B : Set E3} (hK : IsCompact K) (hKB : K ⊆ B) + (hnu : ∀ᵐ x ∂nu, x ∈ K) {H : Fin 4 → E3 → E3} + (hH : ∀ i, Measurable (H i)) (hcont : ∀ i, ContinuousOn (H i) K) + (hcentral : ∀ i, Disjoint B (H i '' B)) + (houter : Pairwise fun i j => Disjoint (H i '' B) (H j '' B)) : + (∃ S : Set E3, IsCompact S ∧ + ∀ᵐ x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3), x ∈ S) ∧ + (∃ eta : ℝ, 0 < eta ∧ + ∀ᵐ t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3), + CoulombEstimates.Separated eta t) := + compact_support_and_separation hK hnu hH hcont + (disjoint_components_mono hKB (pairwise_components_of_disjoint_branches hcentral houter)) + +end Problem356.BranchSeparation + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/BranchOptimizer.lean b/lean/OAI/Analysis/CoulombTransport/BranchOptimizer.lean new file mode 100644 index 0000000000000000000000000000000000000000..7318b88be716eae72b97a070b721e108671507fc --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/BranchOptimizer.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.CoulombTransport.RealCounterexampleAssembly + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +private lemma branchOptimizer_cost_cycle (x y z : E3) : + coulombCost (y, (z, x)) = coulombCost (x, (y, z)) := by + simp only [coulombCost, tripleFst, tripleSnd, tripleThd, invDistance] + rw [norm_sub_rev y x, norm_sub_rev z x] + ac_rfl + +private lemma branchOptimizer_potential_cycle (p : E3 → ℝ≥0∞) (x y z : E3) : + triplePotential p (y, (z, x)) = triplePotential p (x, (y, z)) := by + simp only [triplePotential, tripleFst, tripleSnd, tripleThd] + ac_rfl + +/-- The explicit six-graph branch coupling is itself a finite optimizer. +This preserves the identity of the optimizer, unlike an existential attainment +statement, so its geometric separation can be used in Monge approximation. -/ +theorem branchCoupling_optimality_of_shifted_certificate + (nu : Measure E3) [IsProbabilityMeasure nu] + (H : Fin 4 → E3 → E3) (hH : ∀ i, Measurable (H i)) + {U : Set E3} (hU : MeasurableSet U) + (hmuU : ∀ᵐ x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3), x ∈ U) + {p : E3 → ℝ≥0∞} (hp : Measurable p) + (hpfinite : (∫⁻ x, p x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ≠ ⊤) + {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hbound : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + triplePotential p t ≤ coulombCost t + C) + (hcontact01 : ∀ᵐ x ∂nu, + triplePotential p (x, (H 0 x, H 1 x)) = coulombCost (x, (H 0 x, H 1 x)) + C) + (hcontact23 : ∀ᵐ x ∂nu, + triplePotential p (x, (H 2 x, H 3 x)) = coulombCost (x, (H 2 x, H 3 x)) + C) : + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) = + kantorovichValue (branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ∧ + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) < ⊤ := by + apply certificate_optimality + (isThreeCoupling_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3)) hp hpfinite hC + · intro pi hpi + exact hpi.ae_of_support_certificate hU hmuU hbound + · apply ae_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + (measurableSet_eq_fun (measurable_triplePotential hp) + (measurable_coulombCost.add measurable_const)) + · intro x y z hxyz + change triplePotential p (y, (z, x)) = coulombCost (y, (z, x)) + C + rw [branchOptimizer_potential_cycle, branchOptimizer_cost_cycle] + exact hxyz + · exact hcontact01 + · exact hcontact23 + +/-- Signed-potential version of explicit branch optimizer certification. +The assumptions are a subset of the real counterexample assembly assumptions; +no density, injectivity, or nonattainment hypothesis is required. -/ +theorem branchCoupling_optimality_of_real_certificate + (nu : Measure E3) [IsProbabilityMeasure nu] + (H : Fin 4 → E3 → E3) (hH : ∀ i, Measurable (H i)) + {B U : Set E3} (hU : MeasurableSet U) + (hfull : ∀ᵐ x ∂nu, x ∈ B) (hBU : B ⊆ U) + (hHU : ∀ i, H i '' B ⊆ U) + {u : E3 → ℝ} (hu : Measurable u) {M : ℝ} (hM : 0 ≤ M) + (hubound : ∀ x ∈ U, -M ≤ u x ∧ u x ≤ M) + (hbound : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) ≤ + coulombCost t) + (hcontact01 : ∀ᵐ x ∂nu, + ENNReal.ofReal (u x + u (H 0 x) + u (H 1 x)) = coulombCost (x, (H 0 x, H 1 x))) + (hcontact23 : ∀ᵐ x ∂nu, + ENNReal.ofReal (u x + u (H 2 x) + u (H 3 x)) = coulombCost (x, (H 2 x, H 3 x))) : + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) = + kantorovichValue (branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ∧ + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) < ⊤ := by + have : IsProbabilityMeasure (branchMarginal nu (H 0) (H 1) (H 2) (H 3)) := + isProbabilityMeasure_branchMarginal nu (hH 0) (hH 1) (hH 2) (hH 3) + have hmuU := ae_branchMarginal_mem nu hH hU hfull hBU hHU + have hfinite : (∫⁻ x, shiftedPotential u M x + ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ≠ ⊤ := + (lintegral_shiftedPotential_lt_top_of_ae_le + (M := M) (hmuU.mono fun x hx => (hubound x hx).2)).ne + apply branchCoupling_optimality_of_shifted_certificate nu H hH hU hmuU + (measurable_shiftedPotential hu M) hfinite ENNReal.ofReal_ne_top + · intro t h1 h2 h3 + exact shiftedPotential_certificate (hubound _ h1).1 (hubound _ h2).1 + (hubound _ h3).1 (hbound t h1 h2 h3) + · filter_upwards [hfull, hcontact01] with x hx heq + apply (triplePotential_shifted_contact_iff hM + (hubound x (hBU hx)).1 + (hubound (H 0 x) (hHU 0 ⟨x, hx, rfl⟩)).1 + (hubound (H 1 x) (hHU 1 ⟨x, hx, rfl⟩)).1).mpr + exact heq + · filter_upwards [hfull, hcontact23] with x hx heq + apply (triplePotential_shifted_contact_iff hM + (hubound x (hBU hx)).1 + (hubound (H 2 x) (hHU 2 ⟨x, hx, rfl⟩)).1 + (hubound (H 3 x) (hHU 3 ⟨x, hx, rfl⟩)).1).mpr + exact heq + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/BranchSeparation.lean b/lean/OAI/Analysis/CoulombTransport/BranchSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..144dbc8bbc448917225278b17cc0acdaf262c451 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/BranchSeparation.lean @@ -0,0 +1,132 @@ +import OAI.Analysis.CoulombTransport.BranchCoupling +import OAI.Analysis.CoulombTransport.CompactSeparation +import OAI.Analysis.CoulombTransport.CoulombEstimates + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.BranchSeparation + +/-- The central compact set and its four transported copies. -/ +def components (K : Set E3) (H : Fin 4 → E3 → E3) : Fin 5 → Set E3 := + Fin.cases K (fun i => H i '' K) + +lemma compact_components {K : Set E3} (hK : IsCompact K) + {H : Fin 4 → E3 → E3} (hH : ∀ i, ContinuousOn (H i) K) : + ∀ i, IsCompact (components K H i) := by + intro i + exact Fin.cases hK (fun j => hK.image_of_continuousOn (hH j)) i + +lemma measurableSet_separated (eta : ℝ) : + MeasurableSet {t : Triple | CoulombEstimates.Separated eta t} := by + have h12 : Measurable (fun t : Triple => dist t.1 t.2.1) := + measurable_fst.dist (measurable_fst.comp measurable_snd) + have h13 : Measurable (fun t : Triple => dist t.1 t.2.2) := + measurable_fst.dist (measurable_snd.comp measurable_snd) + have h23 : Measurable (fun t : Triple => dist t.2.1 t.2.2) := + (measurable_fst.comp measurable_snd).dist (measurable_snd.comp measurable_snd) + exact (measurableSet_le measurable_const h12).inter + ((measurableSet_le measurable_const h13).inter (measurableSet_le measurable_const h23)) + +/-- Uniform separation for the actual cyclic two-branch coupling follows from +compactness and disjointness of its five component sets. -/ +theorem exists_ae_separated_branchCoupling + {nu : Measure E3} {K : Set E3} (hK : IsCompact K) + (hnu : ∀ᵐ x ∂nu, x ∈ K) {H : Fin 4 → E3 → E3} + (hH : ∀ i, Measurable (H i)) (hcont : ∀ i, ContinuousOn (H i) K) + (hdisjoint : Pairwise (fun i j => Disjoint (components K H i) (components K H j))) : + ∃ eta : ℝ, 0 < eta ∧ + ∀ᵐ t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3), + CoulombEstimates.Separated eta t := by + obtain ⟨eta, heta, hsep⟩ := exists_uniform_compact_separation + (components K H) (compact_components hK hcont) hdisjoint + have hcentral (i : Fin 4) {x : E3} (hx : x ∈ K) : eta ≤ dist x (H i x) := by + exact hsep 0 i.succ (Fin.succ_ne_zero i).symm x hx (H i x) (mem_image_of_mem _ hx) + have houter (i j : Fin 4) (hij : i ≠ j) {x : E3} (hx : x ∈ K) : + eta ≤ dist (H i x) (H j x) := by + exact hsep i.succ j.succ (by simpa using hij) (H i x) (mem_image_of_mem _ hx) + (H j x) (mem_image_of_mem _ hx) + refine ⟨eta, heta, ae_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + (measurableSet_separated eta) ?_ ?_ ?_⟩ + · intro x y z h + exact ⟨h.2.2, by simpa only [dist_comm] using h.1, + by simpa only [dist_comm] using h.2.1⟩ + · filter_upwards [hnu] with x hx + exact ⟨hcentral 0 hx, hcentral 1 hx, houter 0 1 (by decide) hx⟩ + · filter_upwards [hnu] with x hx + exact ⟨hcentral 2 hx, hcentral 3 hx, houter 2 3 (by decide) hx⟩ + +/-- The branch marginal is concentrated on the union of the central compact +set and its four images. -/ +theorem ae_mem_branchMarginal_components + {nu : Measure E3} {K : Set E3} (hK : IsCompact K) + (hnu : ∀ᵐ x ∂nu, x ∈ K) {H : Fin 4 → E3 → E3} + (hH : ∀ i, Measurable (H i)) (hcont : ∀ i, ContinuousOn (H i) K) : + ∀ᵐ x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3), + x ∈ ⋃ i, components K H i := by + have hcompact : IsCompact (⋃ i, components K H i) := + isCompact_iUnion (compact_components hK hcont) + have hcentral : ∀ᵐ x ∂nu, x ∈ ⋃ i, components K H i := by + filter_upwards [hnu] with x hx + exact mem_iUnion.mpr ⟨0, hx⟩ + have houter (i : Fin 4) : ∀ᵐ x ∂Measure.map (H i) nu, + x ∈ ⋃ j, components K H j := by + apply (ae_map_iff (hH i).aemeasurable hcompact.measurableSet).mpr + filter_upwards [hnu] with x hx + exact mem_iUnion.mpr ⟨i.succ, mem_image_of_mem _ hx⟩ + unfold branchMarginal + apply ae_add_measure_iff.mpr + constructor + · exact Measure.ae_smul_measure (c := (1 / 3 : ℝ≥0∞)) hcentral + · apply Measure.ae_smul_measure + simp only [ae_add_measure_iff] + exact ⟨⟨⟨houter 0, houter 1⟩, houter 2⟩, houter 3⟩ + +/-- The compact support and uniformly separated optimizer hypotheses needed +for finite Monge approximation hold for the explicit branch construction. -/ +theorem compact_support_and_separation + {nu : Measure E3} {K : Set E3} (hK : IsCompact K) + (hnu : ∀ᵐ x ∂nu, x ∈ K) {H : Fin 4 → E3 → E3} + (hH : ∀ i, Measurable (H i)) (hcont : ∀ i, ContinuousOn (H i) K) + (hdisjoint : Pairwise (fun i j => Disjoint (components K H i) (components K H j))) : + (∃ S : Set E3, IsCompact S ∧ + ∀ᵐ x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3), x ∈ S) ∧ + (∃ eta : ℝ, 0 < eta ∧ + ∀ᵐ t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3), + CoulombEstimates.Separated eta t) := by + exact ⟨⟨⋃ i, components K H i, isCompact_iUnion (compact_components hK hcont), + ae_mem_branchMarginal_components hK hnu hH hcont⟩, + exists_ae_separated_branchCoupling hK hnu hH hcont hdisjoint⟩ + +/-- A compact subcomponent retains disjointness of the larger local domains. -/ +lemma disjoint_components_mono {K B : Set E3} (hKB : K ⊆ B) + {H : Fin 4 → E3 → E3} + (hB : Pairwise (fun i j => Disjoint (components B H i) (components B H j))) : + Pairwise (fun i j => Disjoint (components K H i) (components K H j)) := by + have hsub : ∀ i, components K H i ⊆ components B H i := by + intro i + exact Fin.cases hKB (fun j => image_mono hKB) i + intro i j hij + exact (hB hij).mono (hsub i) (hsub j) + +/-- Under the compact disjoint-component hypotheses, the explicit candidate +already has finite cost, before applying any dual certificate. -/ +theorem finite_cost_branchCoupling + {nu : Measure E3} [IsProbabilityMeasure nu] {K : Set E3} (hK : IsCompact K) + (hnu : ∀ᵐ x ∂nu, x ∈ K) {H : Fin 4 → E3 → E3} + (hH : ∀ i, Measurable (H i)) (hcont : ∀ i, ContinuousOn (H i) K) + (hdisjoint : Pairwise (fun i j => Disjoint (components K H i) (components K H j))) : + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) < ⊤ := by + have := isProbabilityMeasure_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + obtain ⟨eta, heta, hae⟩ := exists_ae_separated_branchCoupling hK hnu hH hcont hdisjoint + exact CoulombEstimates.lintegral_coulombCost_lt_top_of_ae_separated _ heta hae + +end Problem356.BranchSeparation + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Calibration.lean b/lean/OAI/Analysis/CoulombTransport/Calibration.lean new file mode 100644 index 0000000000000000000000000000000000000000..90db6fb6ab4c0381ffe7ceeac23cadaafa15d660 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Calibration.lean @@ -0,0 +1,166 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- A bounded-below signed potential is made nonnegative by a constant shift. -/ +def shiftedPotential (u : E3 → ℝ) (M : ℝ) (x : E3) : ℝ≥0∞ := + ENNReal.ofReal (u x + M) + +lemma measurable_shiftedPotential {u : E3 → ℝ} (hu : Measurable u) (M : ℝ) : + Measurable (shiftedPotential u M) := + (hu.add_const M).ennreal_ofReal + +lemma shifted_three_sum {a b c M : ℝ} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) : + ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + ENNReal.ofReal (c + M) = + ENNReal.ofReal (a + b + c + 3 * M) := by + have ha' : 0 ≤ a + M := by linarith + have hb' : 0 ≤ b + M := by linarith + have hc' : 0 ≤ c + M := by linarith + rw [← ENNReal.ofReal_add ha' hb', ← ENNReal.ofReal_add (add_nonneg ha' hb') hc'] + congr 1 + ring + +lemma shifted_three_le {a b c M : ℝ} {z : ℝ≥0∞} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) + (h : ENNReal.ofReal (a + b + c) ≤ z) : + ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + ENNReal.ofReal (c + M) ≤ + z + ENNReal.ofReal (3 * M) := by + rw [shifted_three_sum ha hb hc] + exact ENNReal.ofReal_add_le.trans (add_le_add h le_rfl) + +lemma shifted_three_eq_of_contact {a b c M : ℝ} {z : ℝ≥0∞} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) (hM : 0 ≤ M) + (hs : 0 ≤ a + b + c) (hz : ENNReal.ofReal (a + b + c) = z) : + ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + ENNReal.ofReal (c + M) = + z + ENNReal.ofReal (3 * M) := by + rw [shifted_three_sum ha hb hc, ENNReal.ofReal_add hs (by positivity), hz] + +lemma contact_of_shifted_three_eq {a b c M : ℝ} {z : ℝ≥0∞} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) (hM : 0 ≤ M) + (h : ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + + ENNReal.ofReal (c + M) = z + ENNReal.ofReal (3 * M)) : + 0 ≤ a + b + c ∧ ENNReal.ofReal (a + b + c) = z := by + rw [shifted_three_sum ha hb hc] at h + have hz : z ≠ ⊤ := by + intro hz + simp only [hz, top_add] at h + exact ENNReal.ofReal_ne_top h + have hs : 0 ≤ a + b + c + 3 * M := by linarith + have ht := congrArg ENNReal.toReal h + rw [ENNReal.toReal_ofReal hs, ENNReal.toReal_add hz ENNReal.ofReal_ne_top, + ENNReal.toReal_ofReal (by positivity : 0 ≤ 3 * M)] at ht + have heq : a + b + c = z.toReal := by linarith + constructor + · rw [heq] + exact ENNReal.toReal_nonneg + · rw [heq, ENNReal.ofReal_toReal hz] + +lemma shifted_three_eq_iff {a b c M : ℝ} {z : ℝ≥0∞} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) (hM : 0 ≤ M) : + (ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + ENNReal.ofReal (c + M) = + z + ENNReal.ofReal (3 * M)) ↔ + 0 ≤ a + b + c ∧ ENNReal.ofReal (a + b + c) = z := by + exact ⟨contact_of_shifted_three_eq ha hb hc hM, + fun h => shifted_three_eq_of_contact ha hb hc hM h.1 h.2⟩ + +/-- The shift preserves the supporting inequality, including negative signed sums. -/ +lemma shifted_three_le_iff {a b c M : ℝ} {z : ℝ≥0∞} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) (hM : 0 ≤ M) : + (ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + ENNReal.ofReal (c + M) ≤ + z + ENNReal.ofReal (3 * M)) ↔ ENNReal.ofReal (a + b + c) ≤ z := by + constructor + · intro h + by_cases hs : 0 ≤ a + b + c + · rw [shifted_three_sum ha hb hc, ENNReal.ofReal_add hs (by positivity)] at h + exact (ENNReal.add_le_add_iff_right ENNReal.ofReal_ne_top).mp h + · rw [ENNReal.ofReal_of_nonpos (le_of_not_ge hs)] + exact bot_le + · exact shifted_three_le ha hb hc + +/-- For a positive cost, equality already forces nonnegativity of the signed sum. -/ +lemma shifted_three_eq_iff_of_pos {a b c M : ℝ} {z : ℝ≥0∞} + (ha : -M ≤ a) (hb : -M ≤ b) (hc : -M ≤ c) (hM : 0 ≤ M) + (hz : 0 < z) : + (ENNReal.ofReal (a + M) + ENNReal.ofReal (b + M) + ENNReal.ofReal (c + M) = + z + ENNReal.ofReal (3 * M)) ↔ ENNReal.ofReal (a + b + c) = z := by + rw [shifted_three_eq_iff ha hb hc hM] + constructor + · exact And.right + · intro h + refine ⟨le_of_lt (ENNReal.ofReal_pos.mp ?_), h⟩ + rw [h] + exact hz + +lemma shiftedPotential_certificate {u : E3 → ℝ} {M : ℝ} {t : Triple} + (h1 : -M ≤ u (tripleFst t)) (h2 : -M ≤ u (tripleSnd t)) + (h3 : -M ≤ u (tripleThd t)) + (h : ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) ≤ + coulombCost t) : + shiftedPotential u M (tripleFst t) + shiftedPotential u M (tripleSnd t) + + shiftedPotential u M (tripleThd t) ≤ coulombCost t + ENNReal.ofReal (3 * M) := + shifted_three_le h1 h2 h3 h + +lemma shiftedPotential_contact_iff {u : E3 → ℝ} {M : ℝ} {t : Triple} + (h1 : -M ≤ u (tripleFst t)) (h2 : -M ≤ u (tripleSnd t)) + (h3 : -M ≤ u (tripleThd t)) (hM : 0 ≤ M) : + (shiftedPotential u M (tripleFst t) + shiftedPotential u M (tripleSnd t) + + shiftedPotential u M (tripleThd t) = coulombCost t + ENNReal.ofReal (3 * M)) ↔ + 0 ≤ u (tripleFst t) + u (tripleSnd t) + u (tripleThd t) ∧ + ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) = + coulombCost t := + shifted_three_eq_iff h1 h2 h3 hM + +/-- An almost-everywhere upper bound suffices for finiteness of the shifted +potential; no signed-integrability conversion is needed. -/ +lemma lintegral_shiftedPotential_le_of_ae_le {mu : Measure E3} [IsProbabilityMeasure mu] + {u : E3 → ℝ} {M A : ℝ} (hbound : ∀ᵐ x ∂mu, u x ≤ A) : + (∫⁻ x, shiftedPotential u M x ∂mu) ≤ ENNReal.ofReal (A + M) := by + calc + (∫⁻ x, shiftedPotential u M x ∂mu) ≤ (∫⁻ _x, ENNReal.ofReal (A + M) ∂mu) := by + apply lintegral_mono_ae + exact hbound.mono fun x hx => ENNReal.ofReal_le_ofReal (by linarith) + _ = ENNReal.ofReal (A + M) := by simp + +lemma lintegral_shiftedPotential_lt_top_of_ae_le {mu : Measure E3} + [IsProbabilityMeasure mu] {u : E3 → ℝ} {M A : ℝ} + (hbound : ∀ᵐ x ∂mu, u x ≤ A) : + (∫⁻ x, shiftedPotential u M x ∂mu) < ⊤ := + (lintegral_shiftedPotential_le_of_ae_le hbound).trans_lt ENNReal.ofReal_lt_top + +lemma lintegral_shiftedPotential {mu : Measure E3} [IsProbabilityMeasure mu] + {u : E3 → ℝ} (hu : Integrable u mu) (M : ℝ) + (hbound : ∀ᵐ x ∂mu, -M ≤ u x) : + (∫⁻ x, shiftedPotential u M x ∂mu) = + ENNReal.ofReal ((∫ x, u x ∂mu) + M) := by + have hn : 0 ≤ᵐ[mu] fun x => u x + M := hbound.mono fun x hx => by + dsimp + linarith + have hi : Integrable (fun x => u x + M) mu := hu.add (integrable_const M) + calc + (∫⁻ x, shiftedPotential u M x ∂mu) = + ENNReal.ofReal (∫ x, u x + M ∂mu) := + (ofReal_integral_eq_lintegral_ofReal hi hn).symm + _ = ENNReal.ofReal ((∫ x, u x ∂mu) + M) := by + rw [integral_add hu (integrable_const M)] + simp + +lemma lintegral_shiftedPotential_lt_top {mu : Measure E3} [IsProbabilityMeasure mu] + {u : E3 → ℝ} (hu : Integrable u mu) (M : ℝ) + (hbound : ∀ᵐ x ∂mu, -M ≤ u x) : + (∫⁻ x, shiftedPotential u M x ∂mu) < ⊤ := by + rw [lintegral_shiftedPotential hu M hbound] + exact ENNReal.ofReal_lt_top + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CellOscillation.lean b/lean/OAI/Analysis/CoulombTransport/CellOscillation.lean new file mode 100644 index 0000000000000000000000000000000000000000..9731221356f4a3469bf91f64f0a6f0548aa5b7fb --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CellOscillation.lean @@ -0,0 +1,45 @@ +import Mathlib + +namespace OAI + +universe uAlpha uBeta uIndex + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- Equal cell-label laws let one compare costs using only their oscillation inside +matching cells. The target-cell condition is needed only on a full-measure set. -/ +theorem lintegral_le_of_same_cells + {α : Type uAlpha} {β : Type uBeta} {ι : Type uIndex} [MeasurableSpace α] [MeasurableSpace β] + [MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] + (μ : Measure α) (ν : Measure β) [IsProbabilityMeasure μ] + (p : α → ι) (q : β → ι) (hp : Measurable p) (hq : Measurable q) + (hlaw : Measure.map p μ = Measure.map q ν) + (f : α → ℝ≥0∞) (g : β → ℝ≥0∞) (ε : ℝ≥0∞) + (t : Set β) (ht : ∀ᵐ y ∂ν, y ∈ t) + (hosc : ∀ᵐ x ∂μ, ∀ y ∈ t, p x = q y → f x ≤ g y + ε) : + (∫⁻ x, f x ∂μ) ≤ (∫⁻ y, g y ∂ν) + ε := by + let c : ι → ℝ≥0∞ := fun i => ⨅ y ∈ t, ⨅ (_ : q y = i), g y + have hc : Measurable c := measurable_of_countable c + have hupper : f ≤ᵐ[μ] fun x => c (p x) + ε := by + filter_upwards [hosc] with x hx + simp only [c, ENNReal.iInf_add] + exact le_iInf fun y => le_iInf fun hy => le_iInf fun hi => hx y hy hi.symm + have hlower : (fun y => c (q y)) ≤ᵐ[ν] g := by + filter_upwards [ht] with y hy + exact iInf_le_of_le y (iInf_le_of_le hy (iInf_le_of_le rfl le_rfl)) + have htransport : (∫⁻ x, c (p x) ∂μ) = ∫⁻ y, c (q y) ∂ν := by + rw [← lintegral_map hc hp, hlaw, lintegral_map hc hq] + calc + (∫⁻ x, f x ∂μ) ≤ ∫⁻ x, c (p x) + ε ∂μ := lintegral_mono_ae hupper + _ = (∫⁻ x, c (p x) ∂μ) + ε := by + rw [lintegral_add_right _ measurable_const] + simp + _ = (∫⁻ y, c (q y) ∂ν) + ε := by rw [htransport] + _ ≤ (∫⁻ y, g y ∂ν) + ε := add_le_add (lintegral_mono_ae hlower) le_rfl + +end Problem356 + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CellTable.lean b/lean/OAI/Analysis/CoulombTransport/CellTable.lean new file mode 100644 index 0000000000000000000000000000000000000000..033ac32d020dbdd07a7eb0a902b02ac133eb6c9c --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CellTable.lean @@ -0,0 +1,192 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +universe uAlpha uIndex uKappa + +noncomputable section + +open MeasureTheory +open scoped ENNReal BigOperators + +namespace Problem356 + +section FiniteFibers + +variable {α : Type uAlpha} {ι : Type uIndex} {κ : Type uKappa} [MeasurableSpace α] + [Fintype ι] [Fintype κ] [MeasurableSpace ι] [MeasurableSpace κ] + [MeasurableSingletonClass ι] [MeasurableSingletonClass κ] + +lemma sum_measure_pair_fibers (μ : Measure α) {p : α → ι} {q : α → κ} + (hp : Measurable p) (hq : Measurable q) : + (∑ i, ∑ j, μ {x | p x = i ∧ q x = j}) = μ Set.univ := by + have h := sum_measure_preimage_singleton (μ := μ) (Finset.univ : Finset (ι × κ)) + (f := fun x => (p x, q x)) + (fun y _ => (hp.prodMk hq) (measurableSet_singleton y)) + simpa only [Finset.mem_univ, Finset.sum_const_zero, + Finset.coe_univ, Set.preimage_univ, Fintype.sum_prod_type, Set.preimage, Set.mem_singleton_iff, + Prod.mk.injEq, Set.mem_univ, Set.ofPred_true] using h + +lemma sum_measure_pair_fibers_on (μ : Measure α) {s : Set α} + (_hs : MeasurableSet s) {p : α → ι} {q : α → κ} + (hp : Measurable p) (hq : Measurable q) : + (∑ i, ∑ j, μ {x | x ∈ s ∧ p x = i ∧ q x = j}) = μ s := by + calc + _ = ∑ i, ∑ j, (μ.restrict s) {x | p x = i ∧ q x = j} := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + have hcell : MeasurableSet {x | p x = i ∧ q x = j} := by + convert (hp (measurableSet_singleton i)).inter (hq (measurableSet_singleton j)) using 1 + ext x + simp + rw [Measure.restrict_apply hcell] + congr 1 + ext x + simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, and_comm] + _ = (μ.restrict s) Set.univ := sum_measure_pair_fibers (μ.restrict s) hp hq + _ = μ s := by simp + +end FiniteFibers + +section CellTable + +variable {ι : Type uIndex} [Fintype ι] [MeasurableSpace ι] [MeasurableSingletonClass ι] + +/-- The joint finite-cell mass table of a triple measure. -/ +def cellTable (p : E3 → ι) (π : Measure Triple) (i j k : ι) : ℝ≥0∞ := + π {t | p (tripleFst t) = i ∧ p (tripleSnd t) = j ∧ p (tripleThd t) = k} + +lemma cellTable_sum_fst {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) (i : ι) : + (∑ j, ∑ k, cellTable p π i j k) = μ (p ⁻¹' {i}) := by + calc + _ = π {t | p (tripleFst t) = i} := + sum_measure_pair_fibers_on π ((hp.comp measurable_tripleFst) + (measurableSet_singleton i)) (hp.comp measurable_tripleSnd) + (hp.comp measurable_tripleThd) + _ = (Measure.map tripleFst π) (p ⁻¹' {i}) := by + rw [Measure.map_apply measurable_tripleFst (hp (measurableSet_singleton i))] + rfl + _ = μ (p ⁻¹' {i}) := by rw [hπ.2.1] + +lemma cellTable_sum_snd {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) (j : ι) : + (∑ i, ∑ k, cellTable p π i j k) = μ (p ⁻¹' {j}) := by + have h := sum_measure_pair_fibers_on π ((hp.comp measurable_tripleSnd) + (measurableSet_singleton j)) (hp.comp measurable_tripleFst) + (hp.comp measurable_tripleThd) + calc + _ = π {t | p (tripleSnd t) = j} := by + simpa only [cellTable, Set.preimage, Set.mem_singleton_iff, Set.mem_ofPred_eq, Function.comp_apply, + and_assoc, and_left_comm] using h + _ = (Measure.map tripleSnd π) (p ⁻¹' {j}) := by + rw [Measure.map_apply measurable_tripleSnd (hp (measurableSet_singleton j))] + rfl + _ = μ (p ⁻¹' {j}) := by rw [hπ.2.2.1] + +lemma cellTable_sum_thd {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) (k : ι) : + (∑ i, ∑ j, cellTable p π i j k) = μ (p ⁻¹' {k}) := by + have h := sum_measure_pair_fibers_on π ((hp.comp measurable_tripleThd) + (measurableSet_singleton k)) (hp.comp measurable_tripleFst) + (hp.comp measurable_tripleSnd) + calc + _ = π {t | p (tripleThd t) = k} := by + simpa only [cellTable, Set.preimage, Set.mem_singleton_iff, Set.mem_ofPred_eq, Function.comp_apply, + and_assoc, and_comm, and_left_comm] using h + _ = (Measure.map tripleThd π) (p ⁻¹' {k}) := by + rw [Measure.map_apply measurable_tripleThd (hp (measurableSet_singleton k))] + rfl + _ = μ (p ⁻¹' {k}) := by rw [hπ.2.2.2] + +lemma cellTable_le_fst {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) (i j k : ι) : + cellTable p π i j k ≤ μ (p ⁻¹' {i}) := by + calc + _ ≤ ∑ k', cellTable p π i j k' := + Finset.single_le_sum (fun _ _ => zero_le) (Finset.mem_univ k) + _ ≤ ∑ j', ∑ k', cellTable p π i j' k' := + Finset.single_le_sum (f := fun j' => ∑ k', cellTable p π i j' k') (fun _ _ => zero_le) (Finset.mem_univ j) + _ = _ := cellTable_sum_fst hπ hp i + +lemma cellTable_le_snd {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) (i j k : ι) : + cellTable p π i j k ≤ μ (p ⁻¹' {j}) := by + calc + _ ≤ ∑ k', cellTable p π i j k' := + Finset.single_le_sum (fun _ _ => zero_le) (Finset.mem_univ k) + _ ≤ ∑ i', ∑ k', cellTable p π i' j k' := + Finset.single_le_sum (f := fun i' => ∑ k', cellTable p π i' j k') (fun _ _ => zero_le) (Finset.mem_univ i) + _ = _ := cellTable_sum_snd hπ hp j + +lemma cellTable_le_thd {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) (i j k : ι) : + cellTable p π i j k ≤ μ (p ⁻¹' {k}) := by + calc + _ ≤ ∑ j', cellTable p π i j' k := + Finset.single_le_sum (fun _ _ => zero_le) (Finset.mem_univ j) + _ ≤ ∑ i', ∑ j', cellTable p π i' j' k := + Finset.single_le_sum (f := fun i' => ∑ j', cellTable p π i' j' k) (fun _ _ => zero_le) (Finset.mem_univ i) + _ = _ := cellTable_sum_thd hπ hp k + +lemma cellTable_pos_cell_masses_pos {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) {i j k : ι} + (h : 0 < cellTable p π i j k) : + 0 < μ (p ⁻¹' {i}) ∧ 0 < μ (p ⁻¹' {j}) ∧ 0 < μ (p ⁻¹' {k}) := + ⟨h.trans_le (cellTable_le_fst hπ hp i j k), + h.trans_le (cellTable_le_snd hπ hp i j k), + h.trans_le (cellTable_le_thd hπ hp i j k)⟩ + +/-- The product label map corresponding to the cell table. -/ +def tripleCellLabel (p : E3 → ι) (t : Triple) : ι × (ι × ι) := + (p (tripleFst t), (p (tripleSnd t), p (tripleThd t))) + +omit [Fintype ι] [MeasurableSingletonClass ι] in +lemma measurable_tripleCellLabel {p : E3 → ι} (hp : Measurable p) : + Measurable (tripleCellLabel p) := + (hp.comp measurable_tripleFst).prodMk + ((hp.comp measurable_tripleSnd).prodMk (hp.comp measurable_tripleThd)) + +omit [Fintype ι] in +lemma cellTable_eq_map_singleton {p : E3 → ι} (hp : Measurable p) + (π : Measure Triple) (i j k : ι) : + cellTable p π i j k = (Measure.map (tripleCellLabel p) π) {(i, (j, k))} := by + rw [cellTable, Measure.map_apply (measurable_tripleCellLabel hp) (measurableSet_singleton _)] + congr 1 + ext t + simp [tripleCellLabel, Set.mem_preimage] + +lemma tripleCellLabel_map_eq_of_table_eq {p : E3 → ι} (hp : Measurable p) + {π π' : Measure Triple} + (h : ∀ i j k, cellTable p π i j k = cellTable p π' i j k) : + Measure.map (tripleCellLabel p) π = Measure.map (tripleCellLabel p) π' := by + apply Measure.ext_of_singleton + rintro ⟨i, j, k⟩ + rw [← cellTable_eq_map_singleton hp, ← cellTable_eq_map_singleton hp] + exact h i j k + +omit [Fintype ι] [MeasurableSpace ι] [MeasurableSingletonClass ι] in +lemma cellTable_lt_top {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) (p : E3 → ι) (i j k : ι) : + cellTable p π i j k < ⊤ := by + have := hπ.1 + exact measure_lt_top π _ + +lemma cellTable_sum {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {p : E3 → ι} (hp : Measurable p) : + (∑ i, ∑ j, ∑ k, cellTable p π i j k) = 1 := by + have hsum := sum_measure_pair_fibers π (hp.comp measurable_tripleFst) + ((hp.comp measurable_tripleSnd).prodMk (hp.comp measurable_tripleThd)) + have := hπ.1 + simpa only [cellTable, Fintype.sum_prod_type, Prod.mk.injEq, + Function.comp_apply, measure_univ] using hsum + +end CellTable + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CellwiseLift.lean b/lean/OAI/Analysis/CoulombTransport/CellwiseLift.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f22641f3f9ae2507a0a68ecd2222e15f2bb18a6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CellwiseLift.lean @@ -0,0 +1,105 @@ +import OAI.Analysis.CoulombTransport.AtomlessTransport +import OAI.Analysis.CoulombTransport.PartitionTransport +import OAI.Analysis.CoulombTransport.CompactPartition +import OAI.Analysis.CoulombTransport.PartitionLabel + +namespace OAI + +universe uX uY uIndex + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.Transport + +/-- A finite atomless source admits a lift to any finite law with that source as +marginal, while preserving any prescribed countable measurable label almost everywhere. +This permits cellwise approximation without splitting a three-index mass table. -/ +theorem exists_measurable_lift_preserving_label + {X : Type uX} {Y : Type uY} {ι : Type uIndex} [MeasurableSpace X] [StandardBorelSpace X] + [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] + [MeasurableSpace ι] [MeasurableSingletonClass ι] [Countable ι] [Nonempty ι] + (μ : Measure X) (ν : Measure Y) [IsFiniteMeasure μ] [IsFiniteMeasure ν] + [NullSingletonClass μ] (f : Y → X) (hf : Measurable f) + (hmarg : ν.map f = μ) (p : X → ι) (hp : Measurable p) : + ∃ Q : X → Y, Measurable Q ∧ μ.map Q = ν ∧ + ∀ᵐ x ∂μ, p (f (Q x)) = p x := by + classical + let B : ι → Set X := fun i => p ⁻¹' {i} + have hB (i : ι) : MeasurableSet (B i) := hp (measurableSet_singleton i) + have hdisj : Pairwise fun i j => Disjoint (B i) (B j) := by + intro i j hij + apply Set.disjoint_left.mpr + intro x hxi hxj + exact hij (hxi.symm.trans hxj) + have hcover : (⋃ i, B i) = univ := by + ext x + simp [B] + have htransport (i : ι) : ∃ Q : X → Y, Measurable Q ∧ + (μ.restrict (B i)).map Q = ν.restrict (f ⁻¹' B i) := by + apply exists_measurable_transport_finite + simp only [Measure.restrict_apply_univ] + rw [← hmarg, Measure.map_apply hf (hB i)] + choose T hT hmap using htransport + obtain ⟨Q, hQ, hQT, hQmap⟩ := PartitionTransport.exists_map_eq_of_partition + μ B hB hdisj (by simp [hcover]) T hT + (fun i => ν.restrict (f ⁻¹' B i)) hmap + have hsum : Measure.sum (fun i => ν.restrict (f ⁻¹' B i)) = ν := by + rw [← Measure.restrict_iUnion] + · simp only [← preimage_iUnion, hcover, preimage_univ, Measure.restrict_univ] + · intro i j hij + exact (hdisj hij).preimage f + · intro i + exact (hB i).preimage hf + refine ⟨Q, hQ, hQmap.trans hsum, ?_⟩ + have hlabel (i : ι) : ∀ᵐ x ∂μ.restrict (B i), p (f (T i x)) = i := by + have hmem : ∀ᵐ x ∂μ.restrict (B i), f (T i x) ∈ B i := by + apply ae_of_ae_map (μ := μ.restrict (B i)) (p := fun y => f y ∈ B i) + (hT i).aemeasurable + rw [hmap i] + exact ae_restrict_mem ((hB i).preimage hf) + exact hmem + have hlabel' (i : ι) : ∀ᵐ x ∂μ, x ∈ B i → p (f (T i x)) = i := + (ae_restrict_iff' (hB i)).mp (hlabel i) + have hall : ∀ᵐ x ∂μ, ∀ i, x ∈ B i → p (f (T i x)) = i := + ae_all_iff.mpr hlabel' + filter_upwards [hall] with x hx + have hxB : x ∈ B (p x) := rfl + rw [hQT (p x) hxB] + exact hx (p x) hxB + +/-- A lift can preserve the source coordinate to arbitrary precision whenever +that source has compact support. Only the first marginal is approximated; the +entire target law is transported exactly. -/ +theorem exists_measurable_lift_close + {X : Type uX} {Y : Type uY} [MetricSpace X] [MeasurableSpace X] [BorelSpace X] + [StandardBorelSpace X] [MeasurableSpace Y] [StandardBorelSpace Y] [Nonempty Y] + (μ : Measure X) (ν : Measure Y) [IsFiniteMeasure μ] [IsFiniteMeasure ν] + [NullSingletonClass μ] (f : Y → X) (hf : Measurable f) (hmarg : ν.map f = μ) + {K : Set X} (hK : IsCompact K) (hfull : μ Kᶜ = 0) + {δ : ℝ} (hδ : 0 < δ) : + ∃ Q : X → Y, Measurable Q ∧ μ.map Q = ν ∧ + ∀ᵐ x ∂μ, dist x (f (Q x)) < δ := by + obtain ⟨n, A, hA, hdisj, hcover, _, hdiam⟩ := exists_compact_small_partition hK hδ + let : MeasurableSpace (Option (Fin n)) := ⊤ + obtain ⟨Q, hQ, hmap, hlabel⟩ := exists_measurable_lift_preserving_label + μ ν f hf hmarg (FiniteCells.cellLabel A) (FiniteCells.measurable_cellLabel hA hdisj) + refine ⟨Q, hQ, hmap, ?_⟩ + have hxK : ∀ᵐ x ∂μ, x ∈ K := ae_iff.mpr hfull + filter_upwards [hlabel, hxK] with x hx hxK + have hxA : x ∈ ⋃ i, A i := by rwa [hcover] + obtain ⟨i, hi⟩ := mem_iUnion.mp hxA + have hlabelx : FiniteCells.cellLabel A x = some i := + (FiniteCells.cellLabel_eq_some_iff hdisj x i).mpr hi + have hlabelQ : FiniteCells.cellLabel A (f (Q x)) = some i := hx.trans hlabelx + have hQi : f (Q x) ∈ A i := + (FiniteCells.cellLabel_eq_some_iff hdisj (f (Q x)) i).mp hlabelQ + exact hdiam i x hi (f (Q x)) hQi + +end Problem356.Transport + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CenterAxis.lean b/lean/OAI/Analysis/CoulombTransport/CenterAxis.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d49fff6d0ffe766427138df7123f155a2edda3b --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CenterAxis.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.CoulombTransport.CenterCertificate +import OAI.Analysis.CoulombTransport.HessianMatrix + +namespace OAI + +noncomputable section + +namespace Problem356.CenterAxis + +open CenterCertificate CoulombCalculus + +/-- The finite certificate and the analytic construction use the same central point. -/ +@[simp] theorem point_zero : point 0 = (0 : E3) := by + simp [point] + +/-- The first positive component is the first analytic axis. -/ +@[simp] theorem point_one : point 1 = axisVector 0 := by + ext i + fin_cases i <;> norm_num [point, axisVector] + +/-- The first negative component is opposite to the first analytic axis. -/ +@[simp] theorem point_two : point 2 = -axisVector 0 := by + change (!₂[-1, 0, 0] : E3) = -axisVector 0 + ext i + fin_cases i <;> norm_num [point, axisVector] + +/-- The second positive component is the second analytic axis. -/ +@[simp] theorem point_three : point 3 = axisVector 1 := by + change (!₂[0, 1, 0] : E3) = axisVector 1 + ext i + fin_cases i <;> norm_num [point, axisVector] + +/-- The second negative component is opposite to the second analytic axis. -/ +@[simp] theorem point_four : point 4 = -axisVector 1 := by + change (!₂[0, -1, 0] : E3) = -axisVector 1 + ext i + fin_cases i <;> norm_num [point, axisVector] + +/-- Each noncentral certificate point is a unit vector. -/ +theorem norm_point_of_ne_zero (i : Fin 5) (hi : i ≠ 0) : ‖point i‖ = 1 := by + fin_cases i <;> simp_all + +/-- The two canonical contact triples coincide literally with the analytic center triples. -/ +theorem canonical_center_triples : + (point 0, (point 1, point 2)) = ((0 : E3), (axisVector 0, -axisVector 0)) ∧ + (point 0, (point 3, point 4)) = ((0 : E3), (axisVector 1, -axisVector 1)) := by + simp + +end Problem356.CenterAxis + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CenterCertificate.lean b/lean/OAI/Analysis/CoulombTransport/CenterCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..8181d059d6cbfb350bc02f2fdfdb7207e510b8f9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CenterCertificate.lean @@ -0,0 +1,144 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section +open scoped ENNReal + +namespace Problem356.CenterCertificate + +/-- The center and the two opposite pairs used in the local construction. -/ +def point : Fin 5 → E3 := + ![0, !₂[1, 0, 0], !₂[-1, 0, 0], !₂[0, 1, 0], !₂[0, -1, 0]] + +theorem point_injective : Function.Injective point := by + intro i j h + have h0 := congrArg (fun x : E3 => x 0) h + have h1 := congrArg (fun x : E3 => x 1) h + clear h + fin_cases i <;> fin_cases j + all_goals norm_num [point] at h0 + all_goals norm_num [point] at h1 + all_goals rfl + +/-- The prescribed value of the supporting potential at each center. -/ +def potential (i : Fin 5) : ℝ≥0∞ := if i = 0 then 5 / 2 else 0 + +/-- A center triple belongs to one of the two intended contact families. -/ +def Good (i j k : Fin 5) : Prop := + ({i, j, k} : Finset (Fin 5)) = {0, 1, 2} ∨ + ({i, j, k} : Finset (Fin 5)) = {0, 3, 4} + +/-- The finite-set characterization matches permutation of a canonical branch. -/ +theorem good_iff_perm (i j k : Fin 5) : + Good i j k ↔ + List.Perm [i, j, k] [0, 1, 2] ∨ List.Perm [i, j, k] [0, 3, 4] := by + fin_cases i <;> fin_cases j <;> fin_cases k <;> unfold Good <;> decide + +/-- Point-valued permutation form of the good-type condition. -/ +theorem perm_points_of_good (i j k : Fin 5) (h : Good i j k) : + List.Perm [point i, point j, point k] [point 0, point 1, point 2] ∨ + List.Perm [point i, point j, point k] [point 0, point 3, point 4] := by + rcases (good_iff_perm i j k).1 h with h | h + · exact Or.inl (by simpa using h.map point) + · exact Or.inr (by simpa using h.map point) + +/-- The pairwise distances of the five centers. -/ +def distance (i j : Fin 5) : ℝ := + if i = j then 0 else + if i = 0 ∨ j = 0 then 1 else + if (i = 1 ∧ j = 2) ∨ (i = 2 ∧ j = 1) ∨ + (i = 3 ∧ j = 4) ∨ (i = 4 ∧ j = 3) then 2 else Real.sqrt 2 + +theorem norm_sub_point (i j : Fin 5) : ‖point i - point j‖ = distance i j := by + fin_cases i <;> fin_cases j <;> + norm_num [point, distance, EuclideanSpace.norm_eq, Fin.sum_univ_succ, Fin.ext_iff] + +theorem invDistance_point (i j : Fin 5) : + invDistance (point i) (point j) = (ENNReal.ofReal (distance i j))⁻¹ := by + rw [invDistance, norm_sub_point] + +theorem cross_pair_gap : + (5 / 2 : ℝ≥0∞) < 2 + (ENNReal.ofReal (Real.sqrt 2))⁻¹ := by + have hs : Real.sqrt 2 < 2 := by + nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 2 by norm_num), Real.sqrt_nonneg (2 : ℝ)] + have hsE : ENNReal.ofReal (Real.sqrt 2) < (2 : ℝ≥0∞) := by + simpa only [ENNReal.ofReal_ofNat] using + (ENNReal.ofReal_lt_ofReal_iff_of_nonneg (Real.sqrt_nonneg (2 : ℝ))).2 hs + calc + (5 / 2 : ℝ≥0∞) = 2 + (2 : ℝ≥0∞)⁻¹ := by + apply (ENNReal.toReal_eq_toReal_iff' (by finiteness) (by finiteness)).mp + norm_num [ENNReal.toReal_add] + _ < 2 + (ENNReal.ofReal (Real.sqrt 2))⁻¹ := + ENNReal.add_lt_add_left (by norm_num) (ENNReal.inv_lt_inv.2 hsE) + +theorem supporting_inequality (i j k : Fin 5) : + potential i + potential j + potential k ≤ + coulombCost (point i, (point j, point k)) := by + have hgap := cross_pair_gap.le + have harith : (5 / 2 : ℝ≥0∞) = 2 + 2⁻¹ := by + apply (ENNReal.toReal_eq_toReal_iff' (by finiteness) (by finiteness)).mp + norm_num [ENNReal.toReal_add] + have hgap' : (5 / 2 : ℝ≥0∞) ≤ 1 + (1 + (ENNReal.ofReal (Real.sqrt 2))⁻¹) := by + simpa only [← add_assoc, one_add_one_eq_two] using hgap + have harith' : (5 / 2 : ℝ≥0∞) = 1 + (1 + (2 : ℝ≥0∞)⁻¹) := by + simpa only [← add_assoc, one_add_one_eq_two] using harith + fin_cases i <;> fin_cases j <;> fin_cases k <;> + norm_num [potential, coulombCost, tripleFst, tripleSnd, tripleThd, + invDistance_point, distance, Fin.ext_iff] + all_goals first + | exact hgap + | exact harith.le + | simpa only [add_comm, add_left_comm, add_assoc] using hgap' + | simpa only [add_comm, add_left_comm, add_assoc] using harith'.le + +/-- Every undesired component type has a strict supporting gap at its centers. -/ +theorem strict_of_not_good (i j k : Fin 5) (h : ¬ Good i j k) : + potential i + potential j + potential k < + coulombCost (point i, (point j, point k)) := by + have hgap := cross_pair_gap + have hgap' : (5 / 2 : ℝ≥0∞) < 1 + (1 + (ENNReal.ofReal (Real.sqrt 2))⁻¹) := by + simpa only [← add_assoc, one_add_one_eq_two] using hgap + have hpos : 0 < (ENNReal.ofReal (Real.sqrt 2))⁻¹ := ENNReal.inv_pos.2 (by simp) + fin_cases i <;> fin_cases j <;> fin_cases k + all_goals try exact False.elim (h (by unfold Good; decide)) + all_goals norm_num [potential, coulombCost, tripleFst, tripleSnd, tripleThd, + invDistance_point, distance, Fin.ext_iff] + all_goals first + | exact hgap + | simpa only [add_comm, add_left_comm, add_assoc] using hgap' + | positivity + | finiteness + +/-- Both intended contact types attain equality at the centers. -/ +theorem equality_of_good (i j k : Fin 5) (h : Good i j k) : + coulombCost (point i, (point j, point k)) = + potential i + potential j + potential k := by + have harith : (2 + (2 : ℝ≥0∞)⁻¹) = 5 / 2 := by + apply (ENNReal.toReal_eq_toReal_iff' (by finiteness) (by finiteness)).mp + norm_num [ENNReal.toReal_add] + have harith' : 1 + (1 + (2 : ℝ≥0∞)⁻¹) = 5 / 2 := by + simpa only [← add_assoc, one_add_one_eq_two] using harith + fin_cases i <;> fin_cases j <;> fin_cases k + all_goals try (exfalso; revert h; unfold Good; decide) + all_goals norm_num [potential, coulombCost, tripleFst, tripleSnd, tripleThd, + invDistance_point, distance, Fin.ext_iff] + all_goals first + | exact harith + | simpa only [add_comm, add_left_comm, add_assoc] using harith' + +/-- The five-center supporting certificate has exactly the desired equality types. -/ +theorem equality_iff_good (i j k : Fin 5) : + coulombCost (point i, (point j, point k)) = + potential i + potential j + potential k ↔ Good i j k := by + constructor + · intro h + by_contra hn + exact (strict_of_not_good i j k hn).ne h.symm + · exact equality_of_good i j k + +end Problem356.CenterCertificate + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CertificateAttainment.lean b/lean/OAI/Analysis/CoulombTransport/CertificateAttainment.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c4bc00f171450cfdf023439314939efbf17501e --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CertificateAttainment.lean @@ -0,0 +1,133 @@ +import OAI.Analysis.CoulombTransport.DualCertificate +import OAI.Analysis.CoulombTransport.OptimalLocalization +import OAI.Analysis.CoulombTransport.Calibration + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +open DualCertificate + +namespace ShiftedCoulombCertificate + +/-- A contact candidate calibrates the common marginal potential integral. +This constructs the abstract certificate without assuming the candidate is optimal. -/ +def ofContactCandidate {mu : Measure E3} {pi0 : Measure Triple} + (hpi0 : IsThreeCoupling mu pi0) {v : E3 → ℝ≥0∞} (hv : Measurable v) + {offset : ℝ≥0∞} (hoffset : offset ≠ ⊤) + (hbound : ∀ pi, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, potentialSum v t ≤ coulombCost t + offset) + (hcontact : ∀ᵐ t ∂pi0, potentialSum v t = coulombCost t + offset) : + ShiftedCoulombCertificate mu (∫⁻ t, coulombCost t ∂pi0) where + potential := potentialSum v + shift := offset + shift_ne_top := hoffset + lower_bound := hbound + integral_eq := by + intro pi hpi + have : IsProbabilityMeasure pi0 := hpi0.1 + rw [lintegral_potentialSum hpi hv, ← lintegral_potentialSum hpi0 hv, + ← lintegral_add_offset pi0 coulombCost offset] + exact lintegral_congr_ae hcontact + +end ShiftedCoulombCertificate + +/-- Finite marginal potential integral makes every contact candidate finite. -/ +theorem candidateCost_lt_top_of_contact {mu : Measure E3} {pi0 : Measure Triple} + (hpi0 : IsThreeCoupling mu pi0) {v : E3 → ℝ≥0∞} (hv : Measurable v) + (hvfinite : (∫⁻ x, v x ∂mu) ≠ ⊤) {offset : ℝ≥0∞} + (hcontact : ∀ᵐ t ∂pi0, potentialSum v t = coulombCost t + offset) : + (∫⁻ t, coulombCost t ∂pi0) < ⊤ := by + have : IsProbabilityMeasure pi0 := hpi0.1 + have hsum : (∫⁻ t, coulombCost t ∂pi0) + offset ≠ ⊤ := by + rw [← lintegral_add_offset pi0 coulombCost offset, + ← lintegral_congr_ae hcontact, lintegral_potentialSum hpi0 hv] + exact ENNReal.add_ne_top.mpr ⟨ENNReal.add_ne_top.mpr ⟨hvfinite, hvfinite⟩, hvfinite⟩ + exact lt_top_iff_ne_top.mpr (ENNReal.add_ne_top.mp hsum).1 + +theorem attained_finite_of_contact_candidate {mu : Measure E3} {pi0 : Measure Triple} + (hpi0 : IsThreeCoupling mu pi0) {v : E3 → ℝ≥0∞} (hv : Measurable v) + (hvfinite : (∫⁻ x, v x ∂mu) ≠ ⊤) {offset : ℝ≥0∞} (hoffset : offset ≠ ⊤) + (hbound : ∀ pi, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, potentialSum v t ≤ coulombCost t + offset) + (hcontact : ∀ᵐ t ∂pi0, potentialSum v t = coulombCost t + offset) : + KantorovichAttained mu ∧ kantorovichValue mu < ⊤ ∧ + kantorovichValue mu = (∫⁻ t, coulombCost t ∂pi0) ∧ + (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) = + kantorovichValue mu + offset := by + let cert := ShiftedCoulombCertificate.ofContactCandidate hpi0 hv hoffset hbound hcontact + have hvalue := cert.value_eq hpi0 rfl + refine ⟨cert.attained hpi0 rfl, ?_, hvalue, ?_⟩ + · rw [hvalue] + exact candidateCost_lt_top_of_contact hpi0 hv hvfinite hcontact + · rw [hvalue, ← lintegral_potentialSum hpi0 hv] + exact cert.integral_eq pi0 hpi0 + +/-- The sum of the marginal potential over the three coordinates. -/ +def triplePotential (p : E3 → ℝ≥0∞) (t : Triple) : ℝ≥0∞ := + p (tripleFst t) + p (tripleSnd t) + p (tripleThd t) + +theorem measurable_triplePotential {p : E3 → ℝ≥0∞} (hp : Measurable p) : + Measurable (triplePotential p) := DualCertificate.measurable_potentialSum hp + +theorem IsThreeCoupling.ae_of_support_certificate {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) {U : Set E3} (hU : MeasurableSet U) + (hmu : ∀ᵐ x ∂mu, x ∈ U) {P : Triple → Prop} + (hP : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → P t) : + ∀ᵐ t ∂pi, P t := by + have hf : Measurable tripleFst := measurable_fst + have hs : Measurable tripleSnd := measurable_fst.comp measurable_snd + have ht : Measurable tripleThd := measurable_snd.comp measurable_snd + have h1 : ∀ᵐ t ∂pi, tripleFst t ∈ U := + (ae_map_iff hf.aemeasurable hU).mp (by rwa [hpi.2.1]) + have h2 : ∀ᵐ t ∂pi, tripleSnd t ∈ U := + (ae_map_iff hs.aemeasurable hU).mp (by rwa [hpi.2.2.1]) + have h3 : ∀ᵐ t ∂pi, tripleThd t ∈ U := + (ae_map_iff ht.aemeasurable hU).mp (by rwa [hpi.2.2.2]) + exact (h1.and (h2.and h3)).mono fun t h => hP t h.1 h.2.1 h.2.2 + +theorem certificate_optimality {mu : Measure E3} {pi0 : Measure Triple} + (hpi0 : IsThreeCoupling mu pi0) {p : E3 → ℝ≥0∞} (hp : Measurable p) + (hpfinite : (∫⁻ x, p x ∂mu) ≠ ⊤) {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hbound : ∀ pi, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, triplePotential p t ≤ coulombCost t + C) + (hcontact : ∀ᵐ t ∂pi0, triplePotential p t = coulombCost t + C) : + (∫⁻ t, coulombCost t ∂pi0) = kantorovichValue mu ∧ + (∫⁻ t, coulombCost t ∂pi0) < ⊤ := by + have h := attained_finite_of_contact_candidate hpi0 hp hpfinite hC hbound hcontact + exact ⟨h.2.2.1.symm, candidateCost_lt_top_of_contact hpi0 hp hpfinite hcontact⟩ + +theorem kantorovichAttained_of_certificate {mu : Measure E3} {pi0 : Measure Triple} + (hpi0 : IsThreeCoupling mu pi0) {p : E3 → ℝ≥0∞} (hp : Measurable p) + (hpfinite : (∫⁻ x, p x ∂mu) ≠ ⊤) {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hbound : ∀ pi, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, triplePotential p t ≤ coulombCost t + C) + (hcontact : ∀ᵐ t ∂pi0, triplePotential p t = coulombCost t + C) : + KantorovichAttained mu ∧ kantorovichValue mu < ⊤ := by + have h := attained_finite_of_contact_candidate hpi0 hp hpfinite hC hbound hcontact + exact ⟨h.1, h.2.1⟩ + +theorem certificate_contact_of_optimal {mu : Measure E3} {pi0 pi : Measure Triple} + (hpi0 : IsThreeCoupling mu pi0) (hpi : IsThreeCoupling mu pi) + {p : E3 → ℝ≥0∞} (hp : Measurable p) + (hpfinite : (∫⁻ x, p x ∂mu) ≠ ⊤) {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hcost : Measurable coulombCost) + (hbound : ∀ pi, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, triplePotential p t ≤ coulombCost t + C) + (hcontact : ∀ᵐ t ∂pi0, triplePotential p t = coulombCost t + C) + (hoptimal : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu) : + ∀ᵐ t ∂pi, triplePotential p t = coulombCost t + C := by + have h := attained_finite_of_contact_candidate hpi0 hp hpfinite hC hbound hcontact + exact DualCertificate.ae_contact_of_optimal_coupling hpi hp hC h.2.1.ne + hcost.aemeasurable (hbound pi hpi) h.2.2.2 hoptimal + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CertificateDuality.lean b/lean/OAI/Analysis/CoulombTransport/CertificateDuality.lean new file mode 100644 index 0000000000000000000000000000000000000000..d723302ee7e3748bba15aad9b7a839ad5f7f1c8c --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CertificateDuality.lean @@ -0,0 +1,175 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uAlpha + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356.Certificate + +/-- An integrable signed lower certificate bounds a nonnegative extended integral. -/ +theorem ofReal_integral_le_lintegral {α : Type uAlpha} [MeasurableSpace α] + {μ : Measure α} {f : α → ℝ} {g : α → ℝ≥0∞} + (hf : Integrable f μ) (hg : AEMeasurable g μ) + (hle : ∀ᵐ x ∂μ, ENNReal.ofReal (f x) ≤ g x) : + ENNReal.ofReal (∫ x, f x ∂μ) ≤ ∫⁻ x, g x ∂μ := by + by_cases htop : (∫⁻ x, g x ∂μ) = ⊤ + · simp [htop] + have hgfin := ae_lt_top' hg htop + have hgi := integrable_toReal_of_lintegral_ne_top hg htop + have hreal : f ≤ᵐ[μ] fun x => (g x).toReal := by + filter_upwards [hle, hgfin] with x hx hxfin + exact (ENNReal.ofReal_le_iff_le_toReal hxfin.ne).mp hx + calc + ENNReal.ofReal (∫ x, f x ∂μ) ≤ + ENNReal.ofReal (∫ x, (g x).toReal ∂μ) := + ENNReal.ofReal_le_ofReal (integral_mono_ae hf hgi hreal) + _ = ∫⁻ x, g x ∂μ := by + rw [integral_toReal hg hgfin, ENNReal.ofReal_toReal htop] + +/-- Equality with a signed lower certificate forces pointwise equality almost everywhere. -/ +theorem ae_eq_of_integral_certificate {α : Type uAlpha} [MeasurableSpace α] + {μ : Measure α} {f : α → ℝ} {g : α → ℝ≥0∞} + (hf : Integrable f μ) (hg : AEMeasurable g μ) + (hle : ∀ᵐ x ∂μ, ENNReal.ofReal (f x) ≤ g x) + (hnonneg : 0 ≤ ∫ x, f x ∂μ) + (heq : (∫⁻ x, g x ∂μ) = ENNReal.ofReal (∫ x, f x ∂μ)) : + ∀ᵐ x ∂μ, g x = ENNReal.ofReal (f x) := by + have htop : (∫⁻ x, g x ∂μ) ≠ ⊤ := by + rw [heq] + exact ENNReal.ofReal_ne_top + have hgfin := ae_lt_top' hg htop + have hgi := integrable_toReal_of_lintegral_ne_top hg htop + have hreal : f ≤ᵐ[μ] fun x => (g x).toReal := by + filter_upwards [hle, hgfin] with x hx hxfin + exact (ENNReal.ofReal_le_iff_le_toReal hxfin.ne).mp hx + have hint : (∫ x, f x ∂μ) = ∫ x, (g x).toReal ∂μ := by + rw [integral_toReal hg hgfin, heq, ENNReal.toReal_ofReal hnonneg] + have hae := (integral_eq_iff_of_ae_le hf hgi hreal).mp hint + filter_upwards [hae, hgfin] with x hx hxfin + rw [hx, ENNReal.ofReal_toReal hxfin.ne] + +/-- The signed three-coordinate dual potential associated with one marginal potential. -/ +def potentialSum (u : E3 → ℝ) (t : Triple) : ℝ := + u (tripleFst t) + u (tripleSnd t) + u (tripleThd t) + +private theorem first_measurable : Measurable tripleFst := measurable_fst +private theorem second_measurable : Measurable tripleSnd := measurable_fst.comp measurable_snd +private theorem third_measurable : Measurable tripleThd := measurable_snd.comp measurable_snd + +/-- Marginal identities transfer integrability of a signed potential to its sum. -/ +theorem integrable_potentialSum {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {u : E3 → ℝ} (hu : Integrable u μ) : + Integrable (potentialSum u) π := by + have h₁ : MeasurePreserving tripleFst π μ := ⟨first_measurable, hπ.2.1⟩ + have h₂ : MeasurePreserving tripleSnd π μ := ⟨second_measurable, hπ.2.2.1⟩ + have h₃ : MeasurePreserving tripleThd π μ := ⟨third_measurable, hπ.2.2.2⟩ + exact ((h₁.integrable_comp hu.aestronglyMeasurable).mpr hu |>.add + ((h₂.integrable_comp hu.aestronglyMeasurable).mpr hu)).add + ((h₃.integrable_comp hu.aestronglyMeasurable).mpr hu) + +/-- The integral of a common potential sum depends only on the common marginal. -/ +theorem integral_potentialSum {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {u : E3 → ℝ} (hu : Integrable u μ) : + (∫ t, potentialSum u t ∂π) = 3 * ∫ x, u x ∂μ := by + have h₁ : MeasurePreserving tripleFst π μ := ⟨first_measurable, hπ.2.1⟩ + have h₂ : MeasurePreserving tripleSnd π μ := ⟨second_measurable, hπ.2.2.1⟩ + have h₃ : MeasurePreserving tripleThd π μ := ⟨third_measurable, hπ.2.2.2⟩ + have hi₁ := (h₁.integrable_comp hu.aestronglyMeasurable).mpr hu + have hi₂ := (h₂.integrable_comp hu.aestronglyMeasurable).mpr hu + have hi₃ := (h₃.integrable_comp hu.aestronglyMeasurable).mpr hu + have he₁ : (∫ t, u (tripleFst t) ∂π) = ∫ x, u x ∂μ := by + rw [← hπ.2.1] + exact (integral_map first_measurable.aemeasurable (by rw [hπ.2.1]; exact hu.aestronglyMeasurable)).symm + have he₂ : (∫ t, u (tripleSnd t) ∂π) = ∫ x, u x ∂μ := by + rw [← hπ.2.2.1] + exact (integral_map second_measurable.aemeasurable (by rw [hπ.2.2.1]; exact hu.aestronglyMeasurable)).symm + have he₃ : (∫ t, u (tripleThd t) ∂π) = ∫ x, u x ∂μ := by + rw [← hπ.2.2.2] + exact (integral_map third_measurable.aemeasurable (by rw [hπ.2.2.2]; exact hu.aestronglyMeasurable)).symm + calc + (∫ t, potentialSum u t ∂π) = + (∫ t, u (tripleFst t) + u (tripleSnd t) ∂π) + + ∫ t, u (tripleThd t) ∂π := integral_add (hi₁.add hi₂) hi₃ + _ = ((∫ t, u (tripleFst t) ∂π) + (∫ t, u (tripleSnd t) ∂π)) + + ∫ t, u (tripleThd t) ∂π := by + congr 1 + exact integral_add hi₁ hi₂ + _ = 3 * ∫ x, u x ∂μ := by rw [he₁, he₂, he₃]; ring + +private theorem cost_measurable : Measurable coulombCost := by + unfold coulombCost invDistance tripleFst tripleSnd tripleThd + fun_prop + +/-- Every coupling is concentrated on the cube of any full-marginal-mass set. -/ +theorem coupling_ae_mem {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {U : Set E3} (hU : ∀ᵐ x ∂μ, x ∈ U) : + ∀ᵐ t ∂π, tripleFst t ∈ U ∧ tripleSnd t ∈ U ∧ tripleThd t ∈ U := by + have h₁ : ∀ᵐ t ∂π, tripleFst t ∈ U := + ae_of_ae_map first_measurable.aemeasurable (by rwa [hπ.2.1]) + have h₂ : ∀ᵐ t ∂π, tripleSnd t ∈ U := + ae_of_ae_map second_measurable.aemeasurable (by rwa [hπ.2.2.1]) + have h₃ : ∀ᵐ t ∂π, tripleThd t ∈ U := + ae_of_ae_map third_measurable.aemeasurable (by rwa [hπ.2.2.2]) + filter_upwards [h₁, h₂, h₃] with t ht₁ ht₂ ht₃ + exact ⟨ht₁, ht₂, ht₃⟩ + +/-- A signed supporting potential on a full-mass region is a Kantorovich lower bound. -/ +theorem kantorovich_lower_bound {μ : Measure E3} {u : E3 → ℝ} + (hu : Integrable u μ) {U : Set E3} (hU : ∀ᵐ x ∂μ, x ∈ U) + (hcert : ∀ t : Triple, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + ENNReal.ofReal (potentialSum u t) ≤ coulombCost t) : + ENNReal.ofReal (3 * ∫ x, u x ∂μ) ≤ kantorovichValue μ := by + apply le_iInf + intro π + apply le_iInf + intro hπ + rw [← integral_potentialSum hπ hu] + apply ofReal_integral_le_lintegral (integrable_potentialSum hπ hu) + cost_measurable.aemeasurable + filter_upwards [coupling_ae_mem hπ hU] with t ht + exact hcert t ht.1 ht.2.1 ht.2.2 + +/-- An explicit finite plan saturating a supporting potential is an optimizer. -/ +theorem optimal_plan_of_certificate {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {u : E3 → ℝ} + (hu : Integrable u μ) {U : Set E3} (hU : ∀ᵐ x ∂μ, x ∈ U) + (hcert : ∀ t : Triple, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + ENNReal.ofReal (potentialSum u t) ≤ coulombCost t) + (heq : (∫⁻ t, coulombCost t ∂π) = ENNReal.ofReal (3 * ∫ x, u x ∂μ)) : + (∫⁻ t, coulombCost t ∂π) = kantorovichValue μ ∧ + kantorovichValue μ < ⊤ ∧ KantorovichAttained μ := by + have hlower := kantorovich_lower_bound hu hU hcert + have hupper : kantorovichValue μ ≤ ∫⁻ t, coulombCost t ∂π := + iInf_le_of_le π (iInf_le_of_le hπ le_rfl) + have hvalue : (∫⁻ t, coulombCost t ∂π) = kantorovichValue μ := + le_antisymm (heq ▸ hlower) hupper + refine ⟨hvalue, ?_, ⟨π, hπ, hvalue⟩⟩ + rw [← hvalue, heq] + exact ENNReal.ofReal_lt_top + +/-- Every optimal finite plan must lie on the equality set of a supporting potential. -/ +theorem optimal_ae_contact {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {u : E3 → ℝ} + (hu : Integrable u μ) {U : Set E3} (hU : ∀ᵐ x ∂μ, x ∈ U) + (hcert : ∀ t : Triple, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + ENNReal.ofReal (potentialSum u t) ≤ coulombCost t) + (hnonneg : 0 ≤ 3 * ∫ x, u x ∂μ) + (hvalue : kantorovichValue μ = ENNReal.ofReal (3 * ∫ x, u x ∂μ)) + (hopt : (∫⁻ t, coulombCost t ∂π) = kantorovichValue μ) : + ∀ᵐ t ∂π, coulombCost t = ENNReal.ofReal (potentialSum u t) := by + apply ae_eq_of_integral_certificate (integrable_potentialSum hπ hu) + cost_measurable.aemeasurable + · filter_upwards [coupling_ae_mem hπ hU] with t ht + exact hcert t ht.1 ht.2.1 ht.2.2 + · rwa [integral_potentialSum hπ hu] + · rw [integral_potentialSum hπ hu, hopt, hvalue] + +end Problem356.Certificate + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CertificateNeighborhoods.lean b/lean/OAI/Analysis/CoulombTransport/CertificateNeighborhoods.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e8682508ccb9a17c858c5f7db952c93b2409863 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CertificateNeighborhoods.lean @@ -0,0 +1,85 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uIndex uX uY + +noncomputable section + +open Set Filter Metric +open scoped ENNReal + +namespace Problem356 + +/-- Finitely many eventual properties hold simultaneously on balls with one +common positive radius around their respective centers. -/ +theorem finite_eventual_neighborhoods {ι : Type uIndex} {X : Type uX} [PseudoMetricSpace X] + (s : Finset ι) (p : ι → X) (P : ι → X → Prop) + (hP : ∀ i ∈ s, ∀ᶠ x in nhds (p i), P i x) : + ∃ r : ℝ, 0 < r ∧ ∀ i ∈ s, ∀ x, dist x (p i) < r → P i x := by + classical + have hone : ∀ i ∈ s, ∃ r : ℝ, 0 < r ∧ + ∀ x, dist x (p i) < r → P i x := by + intro i hi + obtain ⟨r, hr, h⟩ := Metric.eventually_nhds_iff.mp (hP i hi) + exact ⟨r, hr, fun x hx => h hx⟩ + clear hP + induction s using Finset.induction_on with + | empty => exact ⟨1, zero_lt_one, by simp⟩ + | @insert i s his ih => + obtain ⟨r, hr, hri⟩ := hone i (Finset.mem_insert_self i s) + obtain ⟨q, hq, hqs⟩ := ih (fun j hj => hone j (Finset.mem_insert_of_mem hj)) + refine ⟨min r q, lt_min hr hq, ?_⟩ + intro j hj x hx + rcases Finset.mem_insert.mp hj with rfl | hj + · exact hri x (lt_of_lt_of_le hx (min_le_left _ _)) + · exact hqs j hj x (lt_of_lt_of_le hx (min_le_right _ _)) + +/-- Triple-coordinate ball version of finite eventual shrinking. -/ +theorem finite_eventual_triple_neighborhoods {ι : Type uIndex} + (s : Finset ι) (p : ι → Triple) (P : ι → Triple → Prop) + (hP : ∀ i ∈ s, ∀ᶠ t in nhds (p i), P i t) : + ∃ r : ℝ, 0 < r ∧ ∀ i ∈ s, ∀ x y z : E3, + x ∈ ball (p i).1 r → y ∈ ball (p i).2.1 r → + z ∈ ball (p i).2.2 r → P i (x, (y, z)) := by + obtain ⟨r, hr, h⟩ := finite_eventual_neighborhoods s p P hP + refine ⟨r, hr, ?_⟩ + intro i hi x y z hx hy hz + apply h i hi (x, (y, z)) + simpa only [Prod.dist_eq, max_lt_iff, Metric.mem_ball] using And.intro hx (And.intro hy hz) + +/-- Finitely many strict inequalities at their respective centers persist on +one common positive-radius neighborhood. This is the finite shrinking step +for the bad, distinct-center component types in the certificate. -/ +theorem finite_strict_neighborhoods {ι : Type uIndex} {X : Type uX} {Y : Type uY} [PseudoMetricSpace X] + [TopologicalSpace Y] [LinearOrder Y] [OrderClosedTopology Y] + (s : Finset ι) (p : ι → X) (f g : ι → X → Y) + (hf : ∀ i ∈ s, ContinuousAt (f i) (p i)) + (hg : ∀ i ∈ s, ContinuousAt (g i) (p i)) + (hgap : ∀ i ∈ s, f i (p i) < g i (p i)) : + ∃ r : ℝ, 0 < r ∧ ∀ i ∈ s, ∀ x, dist x (p i) < r → f i x < g i x := by + exact finite_eventual_neighborhoods s p (fun i x => f i x < g i x) + (fun i hi => (hf i hi).eventually_lt (hg i hi) (hgap i hi)) + +/-- Product-space version of finite shrinking, expressed by separate ball +conditions on all three coordinates. -/ +theorem finite_strict_triple_neighborhoods {ι : Type uIndex} {Y : Type uY} + [TopologicalSpace Y] [LinearOrder Y] [OrderClosedTopology Y] + (s : Finset ι) (p : ι → Triple) (f g : ι → Triple → Y) + (hf : ∀ i ∈ s, ContinuousAt (f i) (p i)) + (hg : ∀ i ∈ s, ContinuousAt (g i) (p i)) + (hgap : ∀ i ∈ s, f i (p i) < g i (p i)) : + ∃ r : ℝ, 0 < r ∧ ∀ i ∈ s, ∀ x y z : E3, + x ∈ ball (p i).1 r → y ∈ ball (p i).2.1 r → + z ∈ ball (p i).2.2 r → f i (x, (y, z)) < g i (x, (y, z)) := by + obtain ⟨r, hr, h⟩ := finite_strict_neighborhoods s p f g hf hg hgap + refine ⟨r, hr, ?_⟩ + intro i hi x y z hx hy hz + apply h i hi (x, (y, z)) + simpa only [Prod.dist_eq, max_lt_iff, Metric.mem_ball] using And.intro hx (And.intro hy hz) + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CommonBranches.lean b/lean/OAI/Analysis/CoulombTransport/CommonBranches.lean new file mode 100644 index 0000000000000000000000000000000000000000..b81b1a3e14aa3b96a3e2cab60b50460e9e42360e --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CommonBranches.lean @@ -0,0 +1,213 @@ +import Mathlib + +namespace OAI + +universe uE uM uIndex uF + +/-! +# Reparametrizing local branches by their common central component + +For local homeomorphisms `X,Z` on the parameter component, the central +parametrizations are `X.symm` and `X.symm.trans Z`. Their common source is +open, contains the central base point, and inherits both smooth inverses. +-/ + +noncomputable section +open Set Metric + +namespace Problem356.CommonBranches + +variable {E : Type uE} [TopologicalSpace E] + +/-- Reparametrization of the second outer branch by the central coordinate. -/ +def outer (X Z : OpenPartialHomeomorph E E) : OpenPartialHomeomorph E E := + X.symm.trans Z + +@[simp] theorem outer_apply (X Z : OpenPartialHomeomorph E E) (x : E) : + outer X Z x = Z (X.symm x) := rfl + +/-- Both local maps being defined at the parameter base point puts the +central image in the source of the reparametrized outer branch. -/ +theorem image_mem_outer_source (X Z : OpenPartialHomeomorph E E) {a : E} + (haX : a ∈ X.source) (haZ : a ∈ Z.source) : + X a ∈ (outer X Z).source := by + change X a ∈ X.symm.source ∩ X.symm ⁻¹' Z.source + refine ⟨X.map_source haX, ?_⟩ + change X.symm (X a) ∈ Z.source + rw [X.left_inv haX] + exact haZ + +/-- The common source permits both the inverse branch and the second outer +branch, with their expected component containment and inverse identity. -/ +theorem outer_source_properties (X Z : OpenPartialHomeomorph E E) {x : E} + (hx : x ∈ (outer X Z).source) : + x ∈ X.target ∧ X.symm x ∈ X.source ∧ X.symm x ∈ Z.source ∧ + outer X Z x ∈ Z.target ∧ X (X.symm x) = x := by + change x ∈ X.symm.source ∩ X.symm ⁻¹' Z.source at hx + exact ⟨hx.1, X.symm.map_source hx.1, hx.2, Z.map_source hx.2, + X.right_inv hx.1⟩ + +/-- Every contact predicate on the original graph transfers to the central +parametrization. This includes both supporting equality and stationarity. -/ +theorem contact_reparametrize (X Z : OpenPartialHomeomorph E E) + {C : E × (E × E) → Prop} + (hC : ∀ y ∈ X.source, C (X y, (y, Z y))) {x : E} + (hx : x ∈ (outer X Z).source) : + C (x, (X.symm x, outer X Z x)) := by + have hp := outer_source_properties X Z hx + simpa only [hp.2.2.2.2, outer_apply] using hC (X.symm x) hp.2.1 + +/-- The four ordered outer branches associated with two local families. -/ +def four (X Z : Fin 2 → OpenPartialHomeomorph E E) : + Fin 4 → OpenPartialHomeomorph E E := + ![(X 0).symm, outer (X 0) (Z 0), (X 1).symm, outer (X 1) (Z 1)] + +/-- A common domain for both composed branches is a common domain for all +four outer branches, in the indexing used by the smooth marginal construction. -/ +theorem subset_four_sources (X Z : Fin 2 → OpenPartialHomeomorph E E) + {B : Set E} (hB : ∀ i, B ⊆ (outer (X i) (Z i)).source) : + ∀ j, B ⊆ (four X Z j).source := by + intro j + fin_cases j + · intro x hx + exact (outer_source_properties (X 0) (Z 0) (hB 0 hx)).1 + · exact hB 0 + · intro x hx + exact (outer_source_properties (X 1) (Z 1) (hB 1 hx)).1 + · exact hB 1 + +/-- Image containment in the four prescribed outer components. -/ +theorem four_images_subset (X Z : Fin 2 → OpenPartialHomeomorph E E) + {B : Set E} (hB : ∀ i, B ⊆ (outer (X i) (Z i)).source) + (P Q : Fin 2 → Set E) + (hP : ∀ i, (X i).source ⊆ P i) (hQ : ∀ i, (Z i).target ⊆ Q i) : + ∀ j, four X Z j '' B ⊆ ![P 0, Q 0, P 1, Q 1] j := by + intro j y hy + obtain ⟨x, hx, rfl⟩ := hy + fin_cases j + · exact hP 0 (outer_source_properties (X 0) (Z 0) (hB 0 hx)).2.1 + · exact hQ 0 (outer_source_properties (X 0) (Z 0) (hB 0 hx)).2.2.2.1 + · exact hP 1 (outer_source_properties (X 1) (Z 1) (hB 1 hx)).2.1 + · exact hQ 1 (outer_source_properties (X 1) (Z 1) (hB 1 hx)).2.2.2.1 + +section Metric + +variable {M : Type uM} [PseudoMetricSpace M] + +/-- Finitely many pairs of local branches sharing a central base point admit +one positive-radius central ball on which all inverse parametrizations are +defined. The ball may also be kept inside any prescribed central neighborhood. -/ +theorem exists_common_central_ball {ι : Type uIndex} [Finite ι] + (X Z : ι → OpenPartialHomeomorph M M) (a : ι → M) (x : M) + (haX : ∀ i, a i ∈ (X i).source) (haZ : ∀ i, a i ∈ (Z i).source) + (hcenter : ∀ i, X i (a i) = x) + {U : Set M} (hU : IsOpen U) (hxU : x ∈ U) : + ∃ r : ℝ, 0 < r ∧ ball x r ⊆ U ∧ + ∀ i, ball x r ⊆ (outer (X i) (Z i)).source := by + have hopen : IsOpen (U ∩ ⋂ i, (outer (X i) (Z i)).source) := + hU.inter (isOpen_iInter_of_finite fun i => (outer (X i) (Z i)).open_source) + have hx : x ∈ U ∩ ⋂ i, (outer (X i) (Z i)).source := by + refine ⟨hxU, mem_iInter.mpr ?_⟩ + intro i + rw [← hcenter i] + exact image_mem_outer_source (X i) (Z i) (haX i) (haZ i) + obtain ⟨r, hr, hsub⟩ := Metric.isOpen_iff.mp hopen x hx + exact ⟨r, hr, fun y hy => (hsub hy).1, + fun i y hy => mem_iInter.mp (hsub hy).2 i⟩ + +/-- The central ball can simultaneously keep the inverse and composed +branches inside arbitrary prescribed outer neighborhoods. Thus shrinking the +global certificate components does not require changing either local chart. -/ +theorem exists_common_central_ball_in_components {ι : Type uIndex} [Finite ι] + (X Z : ι → OpenPartialHomeomorph M M) (a : ι → M) (x : M) + (haX : ∀ i, a i ∈ (X i).source) (haZ : ∀ i, a i ∈ (Z i).source) + (hcenter : ∀ i, X i (a i) = x) + (P Q : ι → Set M) (hP : ∀ i, IsOpen (P i)) (hQ : ∀ i, IsOpen (Q i)) + (haP : ∀ i, a i ∈ P i) (haQ : ∀ i, Z i (a i) ∈ Q i) + {U : Set M} (hU : IsOpen U) (hxU : x ∈ U) : + ∃ r : ℝ, 0 < r ∧ ball x r ⊆ U ∧ + ∀ i, ∀ y ∈ ball x r, + y ∈ (outer (X i) (Z i)).source ∧ + (X i).symm y ∈ P i ∧ outer (X i) (Z i) y ∈ Q i := by + have hbase : ∀ i, x ∈ (outer (X i) (Z i)).source := by + intro i + rw [← hcenter i] + exact image_mem_outer_source (X i) (Z i) (haX i) (haZ i) + have hinv : ∀ i, (X i).symm x = a i := by + intro i + rw [← hcenter i, (X i).left_inv (haX i)] + have houter : ∀ i, outer (X i) (Z i) x = Z i (a i) := by + intro i + rw [outer_apply, hinv i] + have hnear : ∀ i, ∀ᶠ y in nhds x, + y ∈ (outer (X i) (Z i)).source ∧ + (X i).symm y ∈ P i ∧ outer (X i) (Z i) y ∈ Q i := by + intro i + have hys : x ∈ (X i).symm.source := + (outer_source_properties (X i) (Z i) (hbase i)).1 + have hyP := ((X i).symm.continuousAt hys).eventually + ((hP i).mem_nhds (by rw [hinv i]; exact haP i)) + have hwQ := ((outer (X i) (Z i)).continuousAt (hbase i)).eventually + ((hQ i).mem_nhds (by rw [houter i]; exact haQ i)) + have hs : ∀ᶠ y in nhds x, y ∈ (outer (X i) (Z i)).source := + (outer (X i) (Z i)).open_source.mem_nhds (hbase i) + exact hs.and (hyP.and hwQ) + have hu : ∀ᶠ y in nhds x, y ∈ U := hU.mem_nhds hxU + have hall := hu.and (Filter.eventually_all.mpr hnear) + obtain ⟨r, hr, hball⟩ := Metric.eventually_nhds_iff_ball.mp hall + exact ⟨r, hr, fun y hy => (hball y hy).1, + fun i y hy => (hball y hy).2 i⟩ + +end Metric + +section Smooth + +variable {F : Type uF} [NormedAddCommGroup F] [NormedSpace ℝ F] + +/-- Smoothness of the inverse central branch and original outer branch +makes the reparametrized branch smooth on its actual open source. -/ +theorem contDiffOn_outer {n : WithTop ENat} (X Z : OpenPartialHomeomorph F F) + (hX : ContDiffOn ℝ n X.symm X.target) + (hZ : ContDiffOn ℝ n Z Z.source) : + ContDiffOn ℝ n (outer X Z) (outer X Z).source := by + exact hZ.comp_inter hX + +/-- The inverse of the reparametrized branch is smooth on its actual target. -/ +theorem contDiffOn_outer_symm {n : WithTop ENat} (X Z : OpenPartialHomeomorph F F) + (hX : ContDiffOn ℝ n X X.source) + (hZ : ContDiffOn ℝ n Z.symm Z.target) : + ContDiffOn ℝ n (outer X Z).symm (outer X Z).target := by + exact hX.comp_inter hZ + +/-- Forward smoothness of all four centrally parametrized branches. -/ +theorem contDiffOn_four {n : WithTop ENat} + (X Z : Fin 2 → OpenPartialHomeomorph F F) + (hX : ∀ i, ContDiffOn ℝ n (X i).symm (X i).target) + (hZ : ∀ i, ContDiffOn ℝ n (Z i) (Z i).source) : + ∀ j, ContDiffOn ℝ n (four X Z j) (four X Z j).source := by + intro j + fin_cases j + · exact hX 0 + · exact contDiffOn_outer (X 0) (Z 0) (hX 0) (hZ 0) + · exact hX 1 + · exact contDiffOn_outer (X 1) (Z 1) (hX 1) (hZ 1) + +/-- Inverse smoothness of all four centrally parametrized branches. -/ +theorem contDiffOn_four_symm {n : WithTop ENat} + (X Z : Fin 2 → OpenPartialHomeomorph F F) + (hX : ∀ i, ContDiffOn ℝ n (X i) (X i).source) + (hZ : ∀ i, ContDiffOn ℝ n (Z i).symm (Z i).target) : + ∀ j, ContDiffOn ℝ n (four X Z j).symm (four X Z j).target := by + intro j + fin_cases j + · exact hX 0 + · exact contDiffOn_outer_symm (X 0) (Z 0) (hX 0) (hZ 0) + · exact hX 1 + · exact contDiffOn_outer_symm (X 1) (Z 1) (hX 1) (hZ 1) + +end Smooth +end Problem356.CommonBranches + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CompactLiftApproximation.lean b/lean/OAI/Analysis/CoulombTransport/CompactLiftApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..87a6e98ec61f6bc70739b6ac7a186d28babb37d9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CompactLiftApproximation.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.CoulombTransport.CellwiseLift +import OAI.Analysis.CoulombTransport.SeparatedLiftApproximation +import OAI.Analysis.CoulombTransport.DensityMeasure +import OAI.Analysis.CoulombTransport.EqualInfima + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal +namespace Problem356 + +/-- A compactly supported atomless marginal and a uniformly separated optimal +coupling admit finite-cost deterministic approximations. -/ +theorem finiteMongeApproximation_of_compact_separated_optimizer + {mu : Measure E3} [IsProbabilityMeasure mu] [NullSingletonClass mu] + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) + (hoptimal : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu) + {K : Set E3} (hK : IsCompact K) (hfull : mu Kᶜ = 0) + {eta : ℝ} (heta : 0 < eta) + (hseparated : ∀ᵐ t ∂pi, CoulombEstimates.Separated eta t) : + FiniteMongeApproximation mu := by + have : IsProbabilityMeasure pi := hpi.1 + apply finiteMongeApproximation_of_near_fst_lifts hpi hoptimal heta hseparated + intro delta hdelta + obtain ⟨Q, hQ, hmap, hclose⟩ := Transport.exists_measurable_lift_close + mu pi tripleFst measurable_tripleFst hpi.2.1 hK hfull hdelta + exact ⟨Q, hQ, hmap, hclose.mono fun _ hx => hx.le⟩ + +/-- A Coulomb counterexample with a separated optimal plan and compactly supported +density has equal Monge and Kantorovich infima and finite-cost Monge approximations. -/ +theorem HasCoulombCounterexample.hasFull_of_separated_optimizer + {rho : E3 → ℝ} (hcounter : HasCoulombCounterexample rho) + {pi : Measure Triple} (hpi : IsThreeCoupling (densityMeasure rho) pi) + (hoptimal : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue (densityMeasure rho)) + {eta : ℝ} (heta : 0 < eta) + (hseparated : ∀ᵐ t ∂pi, CoulombEstimates.Separated eta t) : + HasFullCoulombConclusion rho := by + have : IsProbabilityMeasure (densityMeasure rho) := hcounter.2.1 + obtain ⟨K, hK, hfull⟩ := densityMeasure_exists_compact_conull hcounter.1.2.2.1 + have happ := finiteMongeApproximation_of_compact_separated_optimizer + hpi hoptimal hK hfull heta hseparated + exact hcounter.fullConclusion happ + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CompactPartition.lean b/lean/OAI/Analysis/CoulombTransport/CompactPartition.lean new file mode 100644 index 0000000000000000000000000000000000000000..7194f39283092e76fe84d4961dde9c5b1c630861 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CompactPartition.lean @@ -0,0 +1,106 @@ +import Mathlib + +namespace OAI + +universe uX uIndex + +noncomputable section + +open Set MeasureTheory Metric + +namespace Problem356 + +/-- Disjointification preserves measurability for finite ordered index sets. -/ +theorem measurableSet_disjointed_fin {X : Type uX} [MeasurableSpace X] + {n : ℕ} {A : Fin n → Set X} (hA : ∀ i, MeasurableSet (A i)) (i : Fin n) : + MeasurableSet (disjointed A i) := by + exact disjointedRec (fun _ _ ht => ht.diff (hA _)) (hA i) + +/-- A compact metric set admits a finite Borel partition into sets of arbitrarily +small diameter. Empty cells are permitted, so the indexing is uniform. -/ +theorem exists_compact_small_partition {X : Type uX} [MetricSpace X] + [MeasurableSpace X] [BorelSpace X] {K : Set X} (hK : IsCompact K) + {δ : ℝ} (hδ : 0 < δ) : + ∃ (n : ℕ) (A : Fin n → Set X), + (∀ i, MeasurableSet (A i)) ∧ + Pairwise (fun i j => Disjoint (A i) (A j)) ∧ + (⋃ i, A i) = K ∧ + (∀ i, A i ⊆ K) ∧ + (∀ i, ∀ x ∈ A i, ∀ y ∈ A i, dist x y < δ) := by + classical + obtain ⟨s, hs⟩ := hK.elim_finite_subcover + (fun x : X => ball x (δ / 2)) (fun _ => isOpen_ball) (by + intro x hx + exact mem_iUnion.mpr ⟨x, mem_ball_self (half_pos hδ)⟩) + let e : s ≃ Fin (Fintype.card s) := Fintype.equivFin s + let B : Fin (Fintype.card s) → Set X := fun i => K ∩ ball (e.symm i).val (δ / 2) + have hB : ∀ i, MeasurableSet (B i) := fun _ => + hK.measurableSet.inter measurableSet_ball + have hCover : (⋃ i, B i) = K := by + apply Subset.antisymm + · exact iUnion_subset fun i => inter_subset_left + · intro x hx + obtain ⟨y, hy, hxy⟩ := mem_iUnion₂.mp (hs hx) + refine mem_iUnion.mpr ⟨e ⟨y, hy⟩, hx, ?_⟩ + simpa only [Equiv.symm_apply_apply] using hxy + refine ⟨Fintype.card s, disjointed B, measurableSet_disjointed_fin hB, + disjoint_disjointed B, ?_, ?_, ?_⟩ + · rw [iUnion_disjointed, hCover] + · intro i + exact (disjointed_subset B i).trans inter_subset_left + · intro i x hx y hy + have hx' := (disjointed_subset B i hx).2 + have hy' := (disjointed_subset B i hy).2 + calc + dist x y ≤ dist x (e.symm i).val + dist (e.symm i).val y := dist_triangle _ _ _ + _ < δ / 2 + δ / 2 := add_lt_add (mem_ball.mp hx') (by simpa only [dist_comm] using (mem_ball.mp hy')) + _ = δ := by ring + +/-- The small cells may simultaneously be chosen inside a prescribed finite +family of pairwise disjoint compact components. -/ +theorem exists_compact_component_partition {X : Type uX} [MetricSpace X] + [MeasurableSpace X] [BorelSpace X] {ι : Type uIndex} [Fintype ι] + (K : ι → Set X) (hK : ∀ a, IsCompact (K a)) + (hDisjoint : Pairwise (fun a b => Disjoint (K a) (K b))) + {δ : ℝ} (hδ : 0 < δ) : + ∃ (n : ℕ) (A : ι × Fin n → Set X), + (∀ p, MeasurableSet (A p)) ∧ + Pairwise (fun p q => Disjoint (A p) (A q)) ∧ + (⋃ p, A p) = ⋃ a, K a ∧ + (∀ p, A p ⊆ K p.1) ∧ + (∀ p, ∀ x ∈ A p, ∀ y ∈ A p, dist x y < δ) := by + classical + obtain ⟨n, B, hMeas, hPair, hCover, hSub, hDist⟩ := + exists_compact_small_partition (isCompact_iUnion hK) hδ + let A : ι × Fin n → Set X := fun p => K p.1 ∩ B p.2 + refine ⟨n, A, ?_, ?_, ?_, ?_, ?_⟩ + · intro p + exact (hK p.1).measurableSet.inter (hMeas p.2) + · intro p q hpq + by_cases hfirst : p.1 = q.1 + · have hsecond : p.2 ≠ q.2 := by + intro hsecond + exact hpq (Prod.ext hfirst hsecond) + exact (hPair hsecond).mono inter_subset_right inter_subset_right + · exact (hDisjoint hfirst).mono inter_subset_left inter_subset_left + · apply Subset.antisymm + · intro x hx + obtain ⟨p, hp⟩ := mem_iUnion.mp hx + exact mem_iUnion.mpr ⟨p.1, hp.1⟩ + · intro x hx + obtain ⟨a, ha⟩ := mem_iUnion.mp hx + have hxB : x ∈ ⋃ i, B i := by + rw [hCover] + exact mem_iUnion.mpr ⟨a, ha⟩ + obtain ⟨i, hi⟩ := mem_iUnion.mp hxB + exact mem_iUnion.mpr ⟨(a, i), ha, hi⟩ + · intro p + exact inter_subset_left + · intro p x hx y hy + exact hDist p.2 x hx.2 y hy.2 + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CompactSeparation.lean b/lean/OAI/Analysis/CoulombTransport/CompactSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5075b0e752827fbdbe882d41b52ec6ae896320fe --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CompactSeparation.lean @@ -0,0 +1,43 @@ +import Mathlib + +namespace OAI + +universe uAlpha uIndex + +noncomputable section + +namespace Problem356 + +/-- Finitely many pairwise disjoint compact components in a metric space have +one positive separation bound. Empty components and an empty index type are +allowed, so no auxiliary nonemptiness assumptions are needed. -/ +theorem exists_uniform_compact_separation {α : Type uAlpha} {ι : Type uIndex} [MetricSpace α] [Finite ι] + (K : ι → Set α) (hcompact : ∀ i, IsCompact (K i)) + (hdisjoint : Pairwise (fun i j => Disjoint (K i) (K j))) : + ∃ eta : ℝ, 0 < eta ∧ + ∀ i j, i ≠ j → ∀ x ∈ K i, ∀ y ∈ K j, eta ≤ dist x y := by + let P := {p : ι × ι // p.1 ≠ p.2} + let S : Set (α × α) := ⋃ p : P, K p.val.1 ×ˢ K p.val.2 + have hS : IsCompact S := + isCompact_iUnion (fun p : P => (hcompact p.val.1).prod (hcompact p.val.2)) + have hmem (i j : ι) (hij : i ≠ j) (x y : α) (hx : x ∈ K i) (hy : y ∈ K j) : + (x, y) ∈ S := by + exact Set.mem_iUnion.mpr ⟨⟨(i, j), hij⟩, hx, hy⟩ + by_cases hne : S.Nonempty + · obtain ⟨p, hp, hpmin⟩ := hS.exists_isMinOn hne continuous_dist.continuousOn + have hpne : p.1 ≠ p.2 := by + obtain ⟨q, hq⟩ := Set.mem_iUnion.mp hp + intro heq + exact Set.disjoint_left.mp (hdisjoint q.property) hq.1 (heq ▸ hq.2) + refine ⟨dist p.1 p.2, dist_pos.mpr hpne, ?_⟩ + intro i j hij x hx y hy + exact hpmin (hmem i j hij x y hx hy) + · refine ⟨1, zero_lt_one, ?_⟩ + intro i j hij x hx y hy + exact False.elim (hne ⟨(x, y), hmem i j hij x y hx hy⟩) + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ComponentCertificate.lean b/lean/OAI/Analysis/CoulombTransport/ComponentCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..d34334ade258f934ec3302626b79a3d843865dbb --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ComponentCertificate.lean @@ -0,0 +1,147 @@ +import OAI.Analysis.CoulombTransport.CertificateNeighborhoods +import OAI.Analysis.CoulombTransport.ComponentPotential +import OAI.Analysis.CoulombTransport.CostTopology + +namespace OAI + +universe uIndex + +noncomputable section +open Set Filter Metric +open scoped ENNReal BigOperators + +namespace Problem356 + +/-- Every bad center type with a strict extended-valued cost gap retains that +gap on small component balls. The finite index set may include repeated-center +types, since extended-valued Coulomb cost is continuous at collisions. -/ +theorem finite_bad_component_neighborhoods {ι : Type uIndex} + (s : Finset (ι × (ι × ι))) (p : ι → E3) (v : ι → E3 → ℝ) + (hv : ∀ i, ContinuousAt (v i) (p i)) + (hgap : ∀ a ∈ s, + ENNReal.ofReal (v a.1 (p a.1) + v a.2.1 (p a.2.1) + v a.2.2 (p a.2.2)) < + coulombCost (p a.1, (p a.2.1, p a.2.2))) : + ∃ r : ℝ, 0 < r ∧ ∀ a ∈ s, ∀ x y z : E3, + x ∈ ball (p a.1) r → y ∈ ball (p a.2.1) r → z ∈ ball (p a.2.2) r → + ENNReal.ofReal (v a.1 x + v a.2.1 y + v a.2.2 z) < + coulombCost (x, (y, z)) := by + apply finite_strict_triple_neighborhoods s + (fun a => (p a.1, (p a.2.1, p a.2.2))) + (fun a t => ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2)) + (fun _ => coulombCost) + · intro a _ + have h₁ : ContinuousAt (fun t : Triple => v a.1 t.1) + (p a.1, (p a.2.1, p a.2.2)) := + (hv a.1).comp (f := fun t : Triple => t.1) continuousAt_fst + have h₂ : ContinuousAt (fun t : Triple => v a.2.1 t.2.1) + (p a.1, (p a.2.1, p a.2.2)) := + (hv a.2.1).comp (f := fun t : Triple => t.2.1) + (continuousAt_fst.comp continuousAt_snd) + have h₃ : ContinuousAt (fun t : Triple => v a.2.2 t.2.2) + (p a.1, (p a.2.1, p a.2.2)) := + (hv a.2.2).comp (f := fun t : Triple => t.2.2) + (continuousAt_snd.comp continuousAt_snd) + exact ENNReal.continuous_ofReal.continuousAt.comp ((h₁.add h₂).add h₃) + · intro _ _ + exact continuous_coulombCost.continuousAt + · exact hgap + +/-- Continuity of the sum of the three local potentials in one component type. -/ +theorem continuousAt_component_sum {ι : Type uIndex} (p : ι → E3) (v : ι → E3 → ℝ) + (hv : ∀ i, ContinuousAt (v i) (p i)) (a : ι × (ι × ι)) : + ContinuousAt + (fun t : Triple => ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2)) + (p a.1, (p a.2.1, p a.2.2)) := by + have h₁ : ContinuousAt (fun t : Triple => v a.1 t.1) + (p a.1, (p a.2.1, p a.2.2)) := + (hv a.1).comp (f := fun t : Triple => t.1) continuousAt_fst + have h₂ : ContinuousAt (fun t : Triple => v a.2.1 t.2.1) + (p a.1, (p a.2.1, p a.2.2)) := + (hv a.2.1).comp (f := fun t : Triple => t.2.1) + (continuousAt_fst.comp continuousAt_snd) + have h₃ : ContinuousAt (fun t : Triple => v a.2.2 t.2.2) + (p a.1, (p a.2.1, p a.2.2)) := + (hv a.2.2).comp (f := fun t : Triple => t.2.2) + (continuousAt_snd.comp continuousAt_snd) + exact ENNReal.continuous_ofReal.continuousAt.comp ((h₁.add h₂).add h₃) + +/-- The local-to-global finite-type certificate step. Local supporting +inequalities and exact contact sets are needed only at the good types; +strict gaps at every other center type are enough for all remaining types. +A single radius works for the inequalities and exact equality characterization. -/ +theorem finite_component_certificate {ι : Type uIndex} [Fintype ι] + (p : ι → E3) (v : ι → E3 → ℝ) + (Good : (ι × (ι × ι)) → Prop) + (Contact : (ι × (ι × ι)) → Triple → Prop) + (hv : ∀ i, ContinuousAt (v i) (p i)) + (hgood : ∀ a, Good a → ∀ᶠ t in nhds (p a.1, (p a.2.1, p a.2.2)), + ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) = + coulombCost t ↔ Contact a t)) + (hbad : ∀ a, ¬ Good a → + ENNReal.ofReal (v a.1 (p a.1) + v a.2.1 (p a.2.1) + v a.2.2 (p a.2.2)) < + coulombCost (p a.1, (p a.2.1, p a.2.2))) : + ∃ r : ℝ, 0 < r ∧ ∀ a, ∀ x y z : E3, + x ∈ ball (p a.1) r → y ∈ ball (p a.2.1) r → z ∈ ball (p a.2.2) r → + ENNReal.ofReal (v a.1 x + v a.2.1 y + v a.2.2 z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (v a.1 x + v a.2.1 y + v a.2.2 z) = coulombCost (x, (y, z)) ↔ + Good a ∧ Contact a (x, (y, z))) := by + classical + have hevent : ∀ a ∈ (Finset.univ : Finset (ι × (ι × ι))), + ∀ᶠ t in nhds (p a.1, (p a.2.1, p a.2.2)), + ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) = + coulombCost t ↔ Good a ∧ Contact a t) := by + intro a _ + by_cases ha : Good a + · filter_upwards [hgood a ha] with t ht + exact ⟨ht.1, by simpa [ha] using ht.2⟩ + · have he := (continuousAt_component_sum p v hv a).eventually_lt + continuous_coulombCost.continuousAt (hbad a ha) + filter_upwards [he] with t ht + exact ⟨ht.le, by simp [ha, ht.ne]⟩ + obtain ⟨r, hr, h⟩ := finite_eventual_triple_neighborhoods Finset.univ + (fun a : ι × (ι × ι) => (p a.1, (p a.2.1, p a.2.2))) _ hevent + exact ⟨r, hr, fun a => h a (Finset.mem_univ a)⟩ + +/-- Once all ordered component types have been certified, the glued potential +satisfies the supporting inequality on the entire component union. -/ +theorem componentPotential_supporting_inequality {ι : Type uIndex} [Fintype ι] + (U : ι → Set E3) (v : ι → E3 → ℝ) + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + (hlocal : ∀ i j k, ∀ x ∈ U i, ∀ y ∈ U j, ∀ z ∈ U k, + ENNReal.ofReal (v i x + v j y + v k z) ≤ coulombCost (x, (y, z))) + {x y z : E3} (hx : x ∈ ⋃ i, U i) (hy : y ∈ ⋃ i, U i) + (hz : z ∈ ⋃ i, U i) : + ENNReal.ofReal (ComponentPotential.glue U v x + ComponentPotential.glue U v y + + ComponentPotential.glue U v z) ≤ coulombCost (x, (y, z)) := by + obtain ⟨i, hi⟩ := mem_iUnion.mp hx + obtain ⟨j, hj⟩ := mem_iUnion.mp hy + obtain ⟨k, hk⟩ := mem_iUnion.mp hz + rw [ComponentPotential.glue_eq hdisj hi, ComponentPotential.glue_eq hdisj hj, + ComponentPotential.glue_eq hdisj hk] + exact hlocal i j k x hi y hj z hk + +/-- Strict inequalities on bad ordered component types exclude those types +from the contact set of the glued potential. -/ +theorem componentPotential_contact_good {ι : Type uIndex} [Fintype ι] + (U : ι → Set E3) (v : ι → E3 → ℝ) + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + (Good : ι → ι → ι → Prop) + (hbad : ∀ i j k, ¬ Good i j k → ∀ x ∈ U i, ∀ y ∈ U j, ∀ z ∈ U k, + ENNReal.ofReal (v i x + v j y + v k z) < coulombCost (x, (y, z))) + {i j k : ι} {x y z : E3} (hx : x ∈ U i) (hy : y ∈ U j) (hz : z ∈ U k) + (hcontact : ENNReal.ofReal (ComponentPotential.glue U v x + ComponentPotential.glue U v y + + ComponentPotential.glue U v z) = coulombCost (x, (y, z))) : Good i j k := by + classical + by_contra hnot + have hlt := hbad i j k hnot x hx y hy z hz + rw [ComponentPotential.glue_eq hdisj hx, ComponentPotential.glue_eq hdisj hy, + ComponentPotential.glue_eq hdisj hz] at hcontact + exact (ne_of_lt hlt) hcontact + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ComponentPotential.lean b/lean/OAI/Analysis/CoulombTransport/ComponentPotential.lean new file mode 100644 index 0000000000000000000000000000000000000000..e29ad003fca7968c5405232575108540da4e27d7 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ComponentPotential.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uIndex + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.ComponentPotential + +variable {ι : Type uIndex} [Fintype ι] + +/-- Glue local potentials on disjoint components, with value zero outside them. -/ +def glue (U : ι → Set E3) (u : ι → E3 → ℝ) (x : E3) : ℝ := + ∑ i, (U i).indicator (u i) x + +theorem glue_eq {U : ι → Set E3} {u : ι → E3 → ℝ} + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) {i : ι} {x : E3} + (hx : x ∈ U i) : glue U u x = u i x := by + classical + unfold glue + rw [Finset.sum_eq_single i] + · exact indicator_of_mem hx _ + · intro j _ hji + apply indicator_of_notMem + intro hxj + exact Set.disjoint_left.mp (hdisj hji) hxj hx + · simp + +theorem glue_eq_zero {U : ι → Set E3} {u : ι → E3 → ℝ} {x : E3} + (hx : x ∉ ⋃ i, U i) : glue U u x = 0 := by + classical + unfold glue + apply Finset.sum_eq_zero + intro i _ + apply indicator_of_notMem + intro hxi + exact hx (mem_iUnion.mpr ⟨i, hxi⟩) + +/-- Local continuity is sufficient for global Borel measurability of the extension. -/ +theorem measurable_glue {U : ι → Set E3} {u : ι → E3 → ℝ} + (hU : ∀ i, MeasurableSet (U i)) (hu : ∀ i, ContinuousOn (u i) (U i)) : + Measurable (glue U u) := by + classical + unfold glue + apply Finset.measurable_sum + intro i _ + change Measurable ((U i).piecewise (u i) (fun _ => 0)) + exact (hu i).measurable_piecewise continuousOn_const (hU i) + +/-- Gluing preserves continuity on the open union of pairwise disjoint components. -/ +theorem continuousOn_glue {U : ι → Set E3} {u : ι → E3 → ℝ} + (hU : ∀ i, IsOpen (U i)) + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + (hu : ∀ i, ContinuousOn (u i) (U i)) : + ContinuousOn (glue U u) (⋃ i, U i) := by + apply ContinuousOn.iUnion_of_isOpen _ hU + intro i + apply (hu i).congr + intro x hx + exact glue_eq hdisj hx + +/-- A common absolute bound passes to the glued potential, globally if it is nonnegative. -/ +theorem abs_glue_le {U : ι → Set E3} {u : ι → E3 → ℝ} {M : ℝ} + (hM : 0 ≤ M) (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + (hu : ∀ i, ∀ x ∈ U i, |u i x| ≤ M) (x : E3) : + |glue U u x| ≤ M := by + by_cases hx : x ∈ ⋃ i, U i + · obtain ⟨i, hxi⟩ := mem_iUnion.mp hx + rw [glue_eq hdisj hxi] + exact hu i x hxi + · rw [glue_eq_zero hx, abs_zero] + exact hM + +/-- A bounded glued potential is integrable against every finite marginal. -/ +theorem integrable_glue {U : ι → Set E3} {u : ι → E3 → ℝ} {M : ℝ} + {mu : Measure E3} [IsFiniteMeasure mu] + (hM : 0 ≤ M) (hU : ∀ i, MeasurableSet (U i)) + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + (hc : ∀ i, ContinuousOn (u i) (U i)) + (hb : ∀ i, ∀ x ∈ U i, |u i x| ≤ M) : + Integrable (glue U u) mu := by + apply Integrable.of_bound (measurable_glue hU hc).aestronglyMeasurable M + exact Filter.Eventually.of_forall fun x => by + simpa only [Real.norm_eq_abs] using abs_glue_le hM hdisj hb x + +end Problem356.ComponentPotential + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ComponentRegions.lean b/lean/OAI/Analysis/CoulombTransport/ComponentRegions.lean new file mode 100644 index 0000000000000000000000000000000000000000..964de07afb5a48af02de9dcc007de1560c2aac20 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ComponentRegions.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.CoulombTransport.SmoothBranchMarginal + +namespace OAI + +noncomputable section + +namespace Problem356.SmoothBranchMarginal + +/-- Component containment in the disjoint five certificate regions supplies +exactly the disjointness input of the smooth marginal construction. -/ +theorem componentRegion_pairwise_of_subsets + {B : Set E3} {e : Fin 4 → OpenPartialHomeomorph E3 E3} + {U : Fin 5 → Set E3} + (hU : Pairwise (fun i j => Disjoint (U i) (U j))) + (hB : B ⊆ U 0) (he : ∀ i, e i '' B ⊆ U i.succ) : + Pairwise (fun i j => Disjoint (componentRegion B e i) (componentRegion B e j)) := by + intro i j hij + cases i with + | none => + cases j with + | none => exact (hij rfl).elim + | some j => + exact (hU (Fin.succ_ne_zero j).symm).mono hB (he j) + | some i => + cases j with + | none => + exact (hU (Fin.succ_ne_zero i)).mono (he i) hB + | some j => + exact (hU (fun h => hij (congrArg some (Fin.succ_injective 4 h)))).mono (he i) (he j) + +end Problem356.SmoothBranchMarginal + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Conclusion.lean b/lean/OAI/Analysis/CoulombTransport/Conclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..f997c3fa6a19766247f0cf937a27efa3ec1c94d3 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Conclusion.lean @@ -0,0 +1,13 @@ +import OAI.Analysis.CoulombTransport.ActualGeometryConclusion + +namespace OAI + +namespace Problem356 + +theorem coulomb_counterexample_and_equal_infima : + ∃ rho : E3 → ℝ, HasFullCoulombConclusion rho := by + exact FiveComponentGeometry.exists_full_coulomb_conclusion + +end Problem356 + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ContactCommonBranches.lean b/lean/OAI/Analysis/CoulombTransport/ContactCommonBranches.lean new file mode 100644 index 0000000000000000000000000000000000000000..671d4cbfa4eed3abd8cad4d98d114d267290d838 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ContactCommonBranches.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.CoulombTransport.ContactSelection +import OAI.Analysis.CoulombTransport.CommonBranches + +namespace OAI + +universe uE + +/-! Extract the canonical four-branch selector from an original contact graph. -/ + +namespace Problem356.ContactSelection + +variable {E : Type uE} [TopologicalSpace E] + +/-- A permuted original contact graph with its first coordinate central selects +one of the four inverse-reparametrized branches, in the canonical ordering +`Y₁,W₁,Y₂,W₂`. Only the two displayed outer points need lie outside `B`. -/ +theorem second_selects_common_four + (X Z : Fin 2 → OpenPartialHomeomorph E E) + {B : Set E} {x y z s : E} {k : Fin 2} + (hperm : List.Perm [x, y, z] [X k s, s, Z k s]) + (hx : x ∈ B) (hs : s ∈ (X k).source) + (hsB : s ∉ B) (hzB : Z k s ∉ B) : + ∃ i : Fin 4, y = CommonBranches.four X Z i x := by + have hcentral := first_eq_of_perm hperm hx hsB hzB + have hinv : (X k).symm x = s := by + rw [hcentral] + exact (X k).left_inv hs + rcases second_eq_or_third_of_perm hperm hx hsB hzB with hy | hy + · fin_cases k + · exact ⟨0, hy.trans hinv.symm⟩ + · exact ⟨2, hy.trans hinv.symm⟩ + · have hz : y = Z k ((X k).symm x) := + hy.trans (congrArg (fun q => Z k q) hinv.symm) + fin_cases k + · exact ⟨1, hz⟩ + · exact ⟨3, hz⟩ + +end Problem356.ContactSelection + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ContactObstruction.lean b/lean/OAI/Analysis/CoulombTransport/ContactObstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..0998809f400d2dcf9fd9755831bac00b4db8de4a --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ContactObstruction.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- A contact condition for optimal couplings also holds along any optimal +admissible graph. This needs no measurable-set hypothesis on `Contact`. -/ +lemma ae_contact_of_graphCost_eq {mu : Measure E3} [IsProbabilityMeasure mu] + {Contact : Triple → Prop} + (hcontact : ∀ pi : Measure Triple, IsThreeCoupling mu pi → + (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu → ∀ᵐ t ∂pi, Contact t) + {T2 T3 : E3 → E3} (h2 : Preserves mu T2) (h3 : Preserves mu T3) + (hopt : graphCost mu T2 T3 = kantorovichValue mu) : + ∀ᵐ x ∂mu, Contact (graphMap T2 T3 x) := by + have hpi := graphMeasure_isThreeCoupling mu h2 h3 + have hcost : (∫⁻ t, coulombCost t ∂graphMeasure mu T2 T3) = + kantorovichValue mu := (lintegral_graphMeasure mu h2.1 h3.1).trans hopt + exact ae_of_ae_map (measurable_graphMap h2.1 h3.1).aemeasurable + (hcontact (graphMeasure mu T2 T3) hpi hcost) + +lemma noMongeOptimizer_of_contact_obstruction (mu : Measure E3) [IsProbabilityMeasure mu] + {Contact : Triple → Prop} + (hcontact : ∀ pi : Measure Triple, IsThreeCoupling mu pi → + (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu → ∀ᵐ t ∂pi, Contact t) + (hobstruction : ∀ T2 T3 : E3 → E3, Preserves mu T2 → Preserves mu T3 → + ¬ (∀ᵐ x ∂mu, Contact (graphMap T2 T3 x))) : + NoMongeOptimizer mu := by + intro T2 T3 h2 h3 + refine lt_of_le_of_ne (kantorovichValue_le_graphCost mu h2 h3) ?_ + intro heq + exact hobstruction T2 T3 h2 h3 (ae_contact_of_graphCost_eq hcontact h2 h3 heq.symm) + +/-- Abstract branch-selection endgame. A contact triple whose first coordinate +lies in `B` forces its second coordinate to satisfy `Select`. If no preserving +map can satisfy that selection almost everywhere for an absolutely continuous +submeasure, no admissible graph is optimal. -/ +lemma noMongeOptimizer_of_selection_obstruction + (mu nu : Measure E3) [IsProbabilityMeasure mu] + (hnu : nu ≪ mu) {B : Set E3} (hB : ∀ᵐ x ∂nu, x ∈ B) + {Contact : Triple → Prop} {Select : E3 → E3 → Prop} + (hcontact : ∀ pi : Measure Triple, IsThreeCoupling mu pi → + (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu → ∀ᵐ t ∂pi, Contact t) + (hselect : ∀ x y z : E3, x ∈ B → Contact (x, (y, z)) → Select x y) + (hobstruction : ∀ T : E3 → E3, Preserves mu T → + ¬ (∀ᵐ x ∂nu, Select x (T x))) : + NoMongeOptimizer mu := by + apply noMongeOptimizer_of_contact_obstruction mu hcontact + intro T2 T3 h2 h3 hgraph + apply hobstruction T2 h2 + have hgraph' : ∀ᵐ x ∂nu, Contact (graphMap T2 T3 x) := hnu.ae_le hgraph + filter_upwards [hB, hgraph'] with x hx hcx + exact hselect x (T2 x) (T3 x) hx hcx + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ContactSelection.lean b/lean/OAI/Analysis/CoulombTransport/ContactSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..67c5c5856fdbf869da04d617c03e664fee9462be --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ContactSelection.lean @@ -0,0 +1,58 @@ +import Mathlib + +namespace OAI + +universe uAlpha uIndex + +/-! The combinatorial step from a permuted contact triple to branch selection. -/ + +namespace Problem356 +namespace ContactSelection + +variable {α : Type uAlpha} {ι : Type uIndex} + +/-- If precisely the first source entry belongs to the central set, any +permutation whose first target entry is central has the same first entry. -/ +theorem first_eq_of_perm + {B : Set α} {x y z p q r : α} + (hperm : List.Perm [x, y, z] [p, q, r]) + (hx : x ∈ B) (hq : q ∉ B) (hr : r ∉ B) : x = p := by + have hm : x ∈ [p, q, r] := hperm.mem_iff.mp (by simp) + simp only [List.mem_cons, List.not_mem_nil, or_false] at hm + rcases hm with hp | hq' | hr' + · exact hp + · exact False.elim (hq (hq' ▸ hx)) + · exact False.elim (hr (hr' ▸ hx)) + +/-- After identifying the central entry, each remaining entry is one of the +other two entries of the contact triple. -/ +theorem second_eq_or_third_of_perm + {B : Set α} {x y z p q r : α} + (hperm : List.Perm [x, y, z] [p, q, r]) + (hx : x ∈ B) (hq : q ∉ B) (hr : r ∉ B) : y = q ∨ y = r := by + have hxp := first_eq_of_perm hperm hx hq hr + subst p + have hp : List.Perm [y, z] [q, r] := hperm.cons_inv + have hm : y ∈ [q, r] := hp.mem_iff.mp (by simp) + simpa only [List.mem_cons, List.not_mem_nil, or_false] using hm + +/-- A contact triple parameterized by `s`, with central branch `X`, +selects either `Y x` or `W x` once `Y` inverts `X` on the parameter domain. -/ +theorem second_selects_inverse_branch + {B P : Set α} {X Z Y W : α → α} {x y z s : α} + (hperm : List.Perm [x, y, z] [X s, s, Z s]) + (hx : x ∈ B) (hs : s ∈ P) + (hOuter : ∀ a ∈ P, a ∉ B ∧ Z a ∉ B) + (hInverse : ∀ a ∈ P, Y (X a) = a) + (hW : ∀ a ∈ B, W a = Z (Y a)) : y = Y x ∨ y = W x := by + have hout := hOuter s hs + have hcentral := first_eq_of_perm hperm hx hout.1 hout.2 + have hinv : Y x = s := by rw [hcentral]; exact hInverse s hs + rcases second_eq_or_third_of_perm hperm hx hout.1 hout.2 with hy | hy + · exact Or.inl (hy.trans hinv.symm) + · exact Or.inr (hy.trans (by rw [hW x hx, hinv])) + +end ContactSelection +end Problem356 + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ContactSelectionAE.lean b/lean/OAI/Analysis/CoulombTransport/ContactSelectionAE.lean new file mode 100644 index 0000000000000000000000000000000000000000..53fb830f225cc353183c715d5763ba21cd1b0cfd --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ContactSelectionAE.lean @@ -0,0 +1,99 @@ +import Mathlib + +namespace OAI + +universe uAlpha uIndex + +/-! +# From permuted contact triples to deterministic branch selection + +The central component is disjoint from every outer branch image. Therefore, +when a contact triple is written with its first coordinate in the central +component, its second coordinate must be an outer branch of that same point. +The statements are independent of the analytic construction of the branches. +-/ + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.ContactSelection + +variable {α : Type uAlpha} {ι : Type uIndex} + +/-- A deliberately broad contact relation: any pair of outer branches is +allowed. A more precise geometric contact set can imply this relation. -/ +def BranchContact (B : Set α) (H : ι → α → α) (t : α × (α × α)) : Prop := + ∃ x ∈ B, ∃ i j, List.Perm [t.1, t.2.1, t.2.2] [x, H i x, H j x] + +/-- Removing the unique central entry of a permuted triple leaves two outer +entries. Neither injectivity nor pairwise disjointness of the outer images +is required for this step. -/ +theorem second_eq_outer_of_perm {B : Set α} {a b c x y z : α} + (ha : a ∈ B) (hy : y ∉ B) (hz : z ∉ B) + (hp : List.Perm [a, b, c] [x, y, z]) : b = y ∨ b = z := by + have ha' : a = x ∨ a = y ∨ a = z := by + simpa only [List.mem_cons, List.not_mem_nil, or_false] using + (hp.mem_iff.mp (by simp : a ∈ [a, b, c])) + have hax : a = x := ha'.resolve_right (by + rintro (h | h) + · exact hy (h ▸ ha) + · exact hz (h ▸ ha)) + subst x + have hp' : List.Perm [b, c] [y, z] := List.Perm.cons_inv hp + simpa only [List.mem_cons, List.not_mem_nil, or_false] using + (hp'.mem_iff.mp (by simp : b ∈ [b, c])) + +theorem second_selects_of_contact {B : Set α} {H : ι → α → α} + (houter : ∀ i x, x ∈ B → H i x ∉ B) + {t : α × (α × α)} (hfirst : t.1 ∈ B) (hcontact : BranchContact B H t) : + ∃ i, t.2.1 = H i t.1 := by + rcases hcontact with ⟨x, hx, i, j, hp⟩ + have hm : t.1 = x ∨ t.1 = H i x ∨ t.1 = H j x := by + simpa only [List.mem_cons, List.not_mem_nil, or_false] using + (hp.mem_iff.mp (by simp : t.1 ∈ [t.1, t.2.1, t.2.2])) + have hcentral : t.1 = x := hm.resolve_right (by + rintro (h | h) + · exact houter i x hx (h ▸ hfirst) + · exact houter j x hx (h ▸ hfirst)) + rcases second_eq_outer_of_perm hfirst (houter i x hx) (houter j x hx) hp with h | h + · exact ⟨i, h.trans (congrArg (H i) hcentral.symm)⟩ + · exact ⟨j, h.trans (congrArg (H j) hcentral.symm)⟩ + +theorem second_selects_of_contact_disjoint {B : Set α} {H : ι → α → α} + (houter : ∀ i, Disjoint B (H i '' B)) + {t : α × (α × α)} (hfirst : t.1 ∈ B) (hcontact : BranchContact B H t) : + ∃ i, t.2.1 = H i t.1 := by + apply second_selects_of_contact (B := B) (H := H) ?_ hfirst hcontact + intro i x hx hix + exact Set.disjoint_left.mp (houter i) hix ⟨x, hx, rfl⟩ + +variable [MeasurableSpace α] + +/-- Transfer the contact relation from the marginal to a central component +measure, and then extract the branch selected by the second graph map. -/ +theorem ae_selects_of_ae_contact {μ ν : Measure α} {B : Set α} + {H : ι → α → α} {T₂ T₃ : α → α} + (hac : ν ≪ μ) (hB : ∀ᵐ x ∂ν, x ∈ B) + (houter : ∀ i, Disjoint B (H i '' B)) + (hcontact : ∀ᵐ x ∂μ, BranchContact B H (x, (T₂ x, T₃ x))) : + ∀ᵐ x ∂ν, ∃ i, T₂ x = H i x := by + filter_upwards [hB, hac.ae_le hcontact] with x hx hc + exact second_selects_of_contact_disjoint houter hx hc + +/-- A positive-weight component is absolutely continuous with respect to any +measure dominating it, including the five-component branch mixture. -/ +theorem absolutelyContinuous_of_smul_le {μ ν : Measure α} {a : ℝ≥0∞} + (ha : a ≠ 0) (hdom : a • ν ≤ μ) : ν ≪ μ := + (Measure.absolutelyContinuous_smul ha).trans hdom.absolutelyContinuous + +theorem ae_selects_of_smul_le_of_ae_contact {μ ν : Measure α} {a : ℝ≥0∞} + {B : Set α} {H : ι → α → α} {T₂ T₃ : α → α} + (ha : a ≠ 0) (hdom : a • ν ≤ μ) (hB : ∀ᵐ x ∂ν, x ∈ B) + (houter : ∀ i, Disjoint B (H i '' B)) + (hcontact : ∀ᵐ x ∂μ, BranchContact B H (x, (T₂ x, T₃ x))) : + ∀ᵐ x ∂ν, ∃ i, T₂ x = H i x := + ae_selects_of_ae_contact (absolutelyContinuous_of_smul_le ha hdom) hB houter hcontact + +end Problem356.ContactSelection + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ContinuousCDF.lean b/lean/OAI/Analysis/CoulombTransport/ContinuousCDF.lean new file mode 100644 index 0000000000000000000000000000000000000000..68c517bfa2b42c996de4cf030ada56d6ac725cde --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ContinuousCDF.lean @@ -0,0 +1,38 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory Function +open scoped Topology ENNReal + +namespace Problem356 + +/-- A Stieltjes function has no jumps when its associated measure has no point atoms. -/ +theorem continuous_stieltjesFunction_of_nullSingletonClass + (f : StieltjesFunction ℝ) [NullSingletonClass f.measure] : Continuous f := by + apply continuous_iff_continuousAt.mpr + intro x + apply f.mono.continuousAt_iff_leftLim_eq_rightLim.mpr + rw [f.rightLim_eq] + have hz : ENNReal.ofReal (f x - leftLim f x) = 0 := by + rw [← f.measure_singleton] + exact measure_singleton x + exact le_antisymm (f.mono.leftLim_le le_rfl) + (sub_nonpos.mp (ENNReal.ofReal_eq_zero.mp hz)) + +/-- The cumulative distribution function of an atomless real probability measure is continuous. -/ +theorem continuous_cdf_of_nullSingletonClass (mu : Measure ℝ) + [IsProbabilityMeasure mu] [NullSingletonClass mu] : + Continuous (ProbabilityTheory.cdf mu) := by + have : NullSingletonClass (ProbabilityTheory.cdf mu).measure := by + rw [ProbabilityTheory.measure_cdf] + infer_instance + exact continuous_stieltjesFunction_of_nullSingletonClass _ + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CostTopology.lean b/lean/OAI/Analysis/CoulombTransport/CostTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..727895591a26180d01bf8917c5ecee6c6021f5e2 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CostTopology.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +lemma invDistance_pos (x y : E3) : 0 < invDistance x y := by + simp [invDistance] + +lemma coulombCost_pos (t : Triple) : 0 < coulombCost t := by + unfold coulombCost + exact lt_of_lt_of_le (invDistance_pos _ _) + ((le_add_right le_rfl).trans (le_add_right le_rfl)) + +lemma continuous_invDistance : Continuous (fun p : E3 × E3 => invDistance p.1 p.2) := by + unfold invDistance + exact (ENNReal.continuous_ofReal.comp (continuous_fst.sub continuous_snd).norm).inv + +lemma continuous_coulombCost : Continuous coulombCost := by + unfold coulombCost + have h1 : Continuous tripleFst := continuous_fst + have h2 : Continuous tripleSnd := continuous_fst.comp continuous_snd + have h3 : Continuous tripleThd := continuous_snd.comp continuous_snd + exact ((continuous_invDistance.comp (h1.prodMk h2)).add + (continuous_invDistance.comp (h1.prodMk h3))).add + (continuous_invDistance.comp (h2.prodMk h3)) + +lemma lowerSemicontinuous_coulombCost : LowerSemicontinuous coulombCost := + continuous_coulombCost.lowerSemicontinuous + +lemma graphCost_congr_ae (mu : Measure E3) {T2 T3 S2 S3 : E3 → E3} + (h2 : T2 =ᵐ[mu] S2) (h3 : T3 =ᵐ[mu] S3) : + graphCost mu T2 T3 = graphCost mu S2 S3 := by + apply lintegral_congr_ae + filter_upwards [h2, h3] with x hx2 hx3 + simp only [hx2, hx3] + +lemma graphMeasure_congr_ae (mu : Measure E3) {T2 T3 S2 S3 : E3 → E3} + (h2 : T2 =ᵐ[mu] S2) (h3 : T3 =ᵐ[mu] S3) : + graphMeasure mu T2 T3 = graphMeasure mu S2 S3 := by + apply Measure.map_congr + filter_upwards [h2, h3] with x hx2 hx3 + simp only [graphMap, hx2, hx3] + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombBranches.lean b/lean/OAI/Analysis/CoulombTransport/CoulombBranches.lean new file mode 100644 index 0000000000000000000000000000000000000000..f630e2fd9353bfa8de9cab2a389e084d148b3cf5 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombBranches.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.CoulombTransport.Model +import OAI.Analysis.CoulombTransport.LocalImplicit +import OAI.Analysis.CoulombTransport.HessianCLM + +namespace OAI + +noncomputable section + +open scoped Topology ContDiff + +namespace Problem356.CoulombBranches + +open LocalImplicit LocalHessian + +/-- The concrete K=20 matrix certificate discharges every invertibility premise +of the local branch theorem once the two partial derivatives are identified. -/ +theorem stationary_charts_of_center_derivatives + (G : E3 × (E3 × E3) → E3 × E3) (k : Fin 3) (p : E3) (s : E3 × E3) + (hG : ContDiffAt ℝ ω G (p, s)) (hzero : G (p, s) = 0) + (hstate : fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inr ℝ E3 (E3 × E3) = + stateOperator k) + (hparameter : fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inl ℝ E3 (E3 × E3) = + parameterOperator k) : + Nonempty (AnalyticStationaryCharts G p s) := by + apply nonempty_analyticStationaryCharts G p s hG hzero + · rw [hstate] + exact stateOperator_isInvertible k + · unfold implicitDerivative + rw [hstate, hparameter] + exact central_inverse_block_isInvertible k + · unfold implicitDerivative + rw [hstate, hparameter] + exact opposite_inverse_block_isInvertible k + +end Problem356.CoulombBranches + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombCalculus.lean b/lean/OAI/Analysis/CoulombTransport/CoulombCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..5fe123706d4d436d1dc5f772ec28d41f2efbf45a --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombCalculus.lean @@ -0,0 +1,174 @@ +import Mathlib + +namespace OAI + +universe uE + +noncomputable section + +open scoped RealInnerProductSpace + +namespace Problem356.CoulombCalculus + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The real-valued radial Coulomb interaction, used only away from the origin. -/ +def pairCost (x : E) : ℝ := ‖x‖⁻¹ + +/-- The gradient of the real radial Coulomb interaction. -/ +def pairGradient (x : E) : E := -(‖x‖ ^ 3)⁻¹ • x + +lemma hasFDerivAt_norm_explicit {x : E} (hx : x ≠ 0) : + HasFDerivAt (fun y : E => ‖y‖) (‖x‖⁻¹ • innerSL ℝ x) x := by + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + have h := (hasStrictFDerivAt_norm_sq x).hasFDerivAt.sqrt (pow_ne_zero 2 hn) + simp only [Real.sqrt_sq (norm_nonneg x)] at h + convert h using 1 + · ext y + simp [Real.sqrt_sq (norm_nonneg y)] + · ext y + simp only [smul_apply, smul_eq_mul] + field_simp + simp [mul_comm] + +lemma hasFDerivAt_pairCost {x : E} (hx : x ≠ 0) : + HasFDerivAt (pairCost : E → ℝ) (-(‖x‖ ^ 3)⁻¹ • innerSL ℝ x) x := by + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + have h := (hasDerivAt_inv hn).comp_hasFDerivAt x (hasFDerivAt_norm_explicit hx) + have hs : -(‖x‖ ^ 2)⁻¹ * ‖x‖⁻¹ = -(‖x‖ ^ 3)⁻¹ := by + field_simp + convert! h using 1 + simp only [smul_smul, hs] + +lemma contDiffAt_pairCost {n : WithTop ENat} {x : E} (hx : x ≠ 0) : + ContDiffAt ℝ n (pairCost : E → ℝ) x := by + exact (contDiffAt_norm ℝ hx).inv (norm_ne_zero_iff.mpr hx) + +/-- The Hessian of the real radial Coulomb interaction. -/ +def pairHessian (x : E) : E →L[ℝ] E := + -(‖x‖ ^ 3)⁻¹ • ContinuousLinearMap.id ℝ E + + (3 * (‖x‖ ^ 5)⁻¹) • (innerSL ℝ x).smulRight x + +lemma hasFDerivAt_radialFactor {x : E} (hx : x ≠ 0) : + HasFDerivAt (fun y : E => -(‖y‖ ^ 3)⁻¹) + ((3 * (‖x‖ ^ 5)⁻¹) • innerSL ℝ x) x := by + have hn : ‖x‖ ≠ 0 := norm_ne_zero_iff.mpr hx + have h := ((hasFDerivAt_pairCost hx).pow 3).neg + convert! h using 1 + · ext y + simp [pairCost, inv_pow] + · ext y + simp only [smul_apply, smul_eq_mul, neg_apply, pairCost] + norm_num + field_simp + +lemma hasFDerivAt_pairGradient {x : E} (hx : x ≠ 0) : + HasFDerivAt (pairGradient : E → E) (pairHessian x) x := by + have h := (hasFDerivAt_radialFactor hx).smul (hasFDerivAt_id x) + convert! h using 1 + ext y + simp [pairHessian, ContinuousLinearMap.smulRight_apply, smul_smul] + +lemma contDiffAt_pairGradient {n : WithTop ENat} {x : E} (hx : x ≠ 0) : + ContDiffAt ℝ n (pairGradient : E → E) x := by + exact (((contDiffAt_norm ℝ hx).pow 3).inv + (pow_ne_zero 3 (norm_ne_zero_iff.mpr hx))).neg.smul contDiffAt_id + +omit [InnerProductSpace ℝ E] in +@[simp] lemma pairCost_neg (x : E) : pairCost (-x) = pairCost x := by + simp [pairCost] + +@[simp] lemma pairGradient_neg (x : E) : pairGradient (-x) = -pairGradient x := by + simp [pairGradient] + +@[simp] lemma pairHessian_neg (x : E) : pairHessian (-x) = pairHessian x := by + ext y + simp [pairHessian] + +lemma pairHessian_apply (x y : E) : + pairHessian x y = -(‖x‖ ^ 3)⁻¹ • y + + (3 * (‖x‖ ^ 5)⁻¹ * ⟪x, y⟫) • x := by + simp [pairHessian, smul_smul] + +lemma pairHessian_apply_self {x : E} (hx : x ≠ 0) : + pairHessian x x = (2 * (‖x‖ ^ 3)⁻¹) • x := by + rw [pairHessian_apply, real_inner_self_eq_norm_sq, ← add_smul] + congr 1 + have hn := norm_ne_zero_iff.mpr hx + field_simp + ring + +lemma pairHessian_apply_orthogonal {x y : E} (hxy : ⟪x, y⟫ = 0) : + pairHessian x y = -(‖x‖ ^ 3)⁻¹ • y := by + simp [pairHessian_apply, hxy] + +lemma pairHessian_symmetric (x y z : E) : + ⟪pairHessian x y, z⟫ = ⟪y, pairHessian x z⟫ := by + simp only [pairHessian_apply, inner_add_left, inner_add_right, + real_inner_smul_left, real_inner_smul_right] + rw [real_inner_comm y x] + ring + +lemma pairHessian_smul_pos (x : E) {r : ℝ} (hr : 0 < r) : + pairHessian (r • x) = (r ^ 3)⁻¹ • pairHessian x := by + ext y + simp only [pairHessian_apply, norm_smul, Real.norm_eq_abs, abs_of_pos hr, + real_inner_smul_left, smul_apply, smul_add, smul_smul] + congr 1 <;> congr 1 <;> field_simp + +lemma pairHessian_apply_of_norm_eq_one {x : E} (hx : ‖x‖ = 1) (y : E) : + pairHessian x y = -y + (3 * ⟪x, y⟫) • x := by + simp [pairHessian_apply, hx] + +lemma pairHessian_injective {x : E} (hx : x ≠ 0) : + Function.Injective (pairHessian x) := by + apply (injective_iff_map_eq_zero (pairHessian x)).2 + intro y hy + have hn : (‖x‖ ^ 3)⁻¹ ≠ 0 := inv_ne_zero (pow_ne_zero 3 (norm_ne_zero_iff.mpr hx)) + have hxy : ⟪x, y⟫ = 0 := by + have h := pairHessian_symmetric x x y + rw [pairHessian_apply_self hx, hy, inner_zero_right, real_inner_smul_left] at h + exact (mul_eq_zero.mp h).resolve_left (mul_ne_zero (by norm_num) hn) + rw [pairHessian_apply_orthogonal hxy] at hy + exact (smul_eq_zero.mp hy).resolve_left (neg_ne_zero.mpr hn) + +lemma pairHessian_isInvertible [FiniteDimensional ℝ E] {x : E} (hx : x ≠ 0) : + (pairHessian x).IsInvertible := by + have hi := pairHessian_injective hx + have hs : Function.Surjective (pairHessian x).toLinearMap := + LinearMap.surjective_of_injective hi + refine ⟨(LinearEquiv.ofBijective (pairHessian x).toLinearMap ⟨hi, hs⟩).toContinuousLinearEquiv, ?_⟩ + rfl + +lemma fderiv_pairCost {x : E} (hx : x ≠ 0) : + fderiv ℝ (pairCost : E → ℝ) x = innerSL ℝ (pairGradient x) := by + rw [(hasFDerivAt_pairCost hx).fderiv] + simp [pairGradient] + +lemma hasFDerivAt_fderiv_pairCost {x : E} (hx : x ≠ 0) : + HasFDerivAt (fderiv ℝ (pairCost : E → ℝ)) + ((innerSL ℝ).comp (pairHessian x)) x := by + have h := (innerSL ℝ).hasFDerivAt.comp x (hasFDerivAt_pairGradient hx) + apply h.congr_of_eventuallyEq + filter_upwards [eventually_ne_nhds hx] with y hy + exact fderiv_pairCost hy + +lemma secondFDeriv_pairCost_apply {x : E} (hx : x ≠ 0) (v w : E) : + fderiv ℝ (fderiv ℝ (pairCost : E → ℝ)) x v w = ⟪pairHessian x v, w⟫ := by + rw [(hasFDerivAt_fderiv_pairCost hx).fderiv] + rfl + +lemma pairHessian_quadratic_lower (x y : E) : + -(‖x‖ ^ 3)⁻¹ * ‖y‖ ^ 2 ≤ ⟪pairHessian x y, y⟫ := by + rw [pairHessian_apply, inner_add_left, real_inner_smul_left, + real_inner_smul_left, real_inner_self_eq_norm_sq] + apply le_add_of_nonneg_right + have hn : 0 ≤ 3 * (‖x‖ ^ 5)⁻¹ := + mul_nonneg (by norm_num) (inv_nonneg.mpr (pow_nonneg (norm_nonneg x) 5)) + nlinarith [mul_nonneg hn (sq_nonneg ⟪x, y⟫)] + +end Problem356.CoulombCalculus + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombCharts.lean b/lean/OAI/Analysis/CoulombTransport/CoulombCharts.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d3736d93b2bef0126463525ef902bcca3d01599 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombCharts.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.CoulombTransport.Model +import OAI.Analysis.CoulombTransport.LocalImplicit +import OAI.Analysis.CoulombTransport.StationaryEquation +import OAI.Analysis.CoulombTransport.HessianMatrix + +namespace OAI + +noncomputable section +open scoped ContDiff + +namespace Problem356.CoulombCharts + +open CoulombCalculus GeometryJets LocalImplicit + +/-- The computed state derivative is the coercive, invertible operator certified +by the finite-dimensional algebra, in the actual product-space coordinates. -/ +theorem centerStateHessian_axis_eq (k : Fin 3) : + centerStateHessian 20 (CoulombCalculus.pairHessian (axisVector k)) = + LocalHessian.stateOperator k := by + apply ContinuousLinearMap.ext + intro v + apply Prod.ext + · ext i + simp [centerStateHessian, LocalHessian.stateOperator_fst_apply, + pairHessian_axisVector_apply] + ring + · ext i + simp [centerStateHessian, LocalHessian.stateOperator_snd_apply, + pairHessian_axisVector_apply] + ring + +/-- The computed parameter derivative agrees with the mixed Hessian block. -/ +theorem centerParameterDerivative_axis_eq (k : Fin 3) : + centerParameterDerivative (CoulombCalculus.pairHessian (axisVector k)) = + LocalHessian.parameterOperator k := by + rw [pairHessian_axisVector] + unfold centerParameterDerivative LocalHessian.parameterOperator + dsimp + congr 1 + module + +theorem stationary_state_partial_eq (k : Fin 3) : + fderiv ℝ (stationaryEquation 20 (axisVector k)) + (axisVector k, (0, -axisVector k)) ∘L + ContinuousLinearMap.inr ℝ E3 (E3 × E3) = LocalHessian.stateOperator k := by + rw [(hasFDerivAt_stationary_center 20 (axisVector k) (norm_axisVector k)).fderiv] + have h : centerTotalDerivative 20 (CoulombCalculus.pairHessian (axisVector k)) ∘L + ContinuousLinearMap.inr ℝ E3 (E3 × E3) = + centerStateHessian 20 (CoulombCalculus.pairHessian (axisVector k)) := by + apply ContinuousLinearMap.ext + intro v + simp [centerTotalDerivative] + rw [h, centerStateHessian_axis_eq] + +/-- Identification of the actual partial parameter derivative. -/ +theorem stationary_parameter_partial_eq (k : Fin 3) : + fderiv ℝ (stationaryEquation 20 (axisVector k)) + (axisVector k, (0, -axisVector k)) ∘L + ContinuousLinearMap.inl ℝ E3 (E3 × E3) = LocalHessian.parameterOperator k := by + rw [(hasFDerivAt_stationary_center 20 (axisVector k) (norm_axisVector k)).fderiv] + have h : centerTotalDerivative 20 (CoulombCalculus.pairHessian (axisVector k)) ∘L + ContinuousLinearMap.inl ℝ E3 (E3 × E3) = + centerParameterDerivative (CoulombCalculus.pairHessian (axisVector k)) := by + apply ContinuousLinearMap.ext + intro v + simp [centerTotalDerivative] + rw [h, centerParameterDerivative_axis_eq] + +/-- Nonlinear local Coulomb branches exist at every coordinate-axis reference triple. +Both branch coordinates are analytic local diffeomorphisms on one common source. -/ +theorem nonempty_coulombCharts (k : Fin 3) : + Nonempty (AnalyticStationaryCharts + (stationaryEquation 20 (axisVector k)) (axisVector k) (0, -axisVector k)) := by + apply nonempty_analyticStationaryCharts + · exact contDiffAt_stationaryEquation_center 20 (axisVector k) (norm_axisVector k) + · exact stationaryEquation_center 20 (axisVector k) (norm_axisVector k) + · rw [stationary_state_partial_eq] + exact LocalHessian.stateOperator_isInvertible k + · unfold implicitDerivative + rw [stationary_state_partial_eq, stationary_parameter_partial_eq] + exact LocalHessian.central_inverse_block_isInvertible k + · unfold implicitDerivative + rw [stationary_state_partial_eq, stationary_parameter_partial_eq] + exact LocalHessian.opposite_inverse_block_isInvertible k + +end Problem356.CoulombCharts + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombCoercivity.lean b/lean/OAI/Analysis/CoulombTransport/CoulombCoercivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf8db363cb39c8a06b9a2a8c484b25efef80eddb --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombCoercivity.lean @@ -0,0 +1,148 @@ +import OAI.Analysis.CoulombTransport.CoulombCalculus + +namespace OAI + +universe uE + +noncomputable section + +open scoped RealInnerProductSpace + +namespace Problem356.CoulombCalculus + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- A uniform lower Hessian bound away from a Coulomb collision. -/ +theorem pairHessian_quadratic_lower_of_two_thirds {a : E} + (ha : (2 : ℝ) / 3 ≤ ‖a‖) (u : E) : + -(27 / 8 : ℝ) * ‖u‖ ^ 2 ≤ ⟪u, pairHessian a u⟫ := by + have hn : 0 < ‖a‖ := lt_of_lt_of_le (by norm_num) ha + have hp : ((2 : ℝ) / 3) ^ 3 ≤ ‖a‖ ^ 3 := + pow_le_pow_left₀ (by norm_num) ha 3 + have hi : (‖a‖ ^ 3)⁻¹ ≤ (27 / 8 : ℝ) := by + have hh := (inv_le_inv₀ (pow_pos hn 3) (by norm_num : 0 < ((2 : ℝ) / 3) ^ 3)).2 hp + norm_num at hh ⊢ + exact hh + have hm := mul_le_mul_of_nonneg_right hi (sq_nonneg ‖u‖) + have hl := pairHessian_quadratic_lower a u + rw [real_inner_comm] at hl + linarith + +/-- The explicit K=20 regularization dominates every negative Coulomb Hessian +contribution on a domain where all three pair distances are at least 2/3. -/ +theorem regularized_hessian_coercive_of_separated + {a b c : E} (ha : (2 : ℝ) / 3 ≤ ‖a‖) + (hb : (2 : ℝ) / 3 ≤ ‖b‖) (hc : (2 : ℝ) / 3 ≤ ‖c‖) (u v : E) : + (79 / 8 : ℝ) * (‖u‖ ^ 2 + ‖v‖ ^ 2) ≤ + 20 * (‖u‖ ^ 2 + ‖v‖ ^ 2) + + ⟪u, pairHessian a u⟫ + + ⟪u - v, pairHessian b (u - v)⟫ + + ⟪v, pairHessian c v⟫ := by + have h₁ := pairHessian_quadratic_lower_of_two_thirds ha u + have h₂ := pairHessian_quadratic_lower_of_two_thirds hb (u - v) + have h₃ := pairHessian_quadratic_lower_of_two_thirds hc v + have hnorm : ‖u - v‖ ^ 2 ≤ 2 * (‖u‖ ^ 2 + ‖v‖ ^ 2) := by + have hsq := pow_le_pow_left₀ (norm_nonneg (u - v)) (norm_sub_le u v) 2 + nlinarith [sq_nonneg (‖u‖ - ‖v‖)] + linarith + +/-- Strict positivity for every nonzero state direction. -/ +theorem regularized_hessian_pos_of_separated + {a b c : E} (ha : (2 : ℝ) / 3 ≤ ‖a‖) + (hb : (2 : ℝ) / 3 ≤ ‖b‖) (hc : (2 : ℝ) / 3 ≤ ‖c‖) + {u v : E} (huv : u ≠ 0 ∨ v ≠ 0) : + 0 < 20 * (‖u‖ ^ 2 + ‖v‖ ^ 2) + + ⟪u, pairHessian a u⟫ + + ⟪u - v, pairHessian b (u - v)⟫ + + ⟪v, pairHessian c v⟫ := by + have hsum : 0 < ‖u‖ ^ 2 + ‖v‖ ^ 2 := by + rcases huv with hu | hv + · exact add_pos_of_pos_of_nonneg (sq_pos_of_pos (norm_pos_iff.mpr hu)) (sq_nonneg _) + · exact add_pos_of_nonneg_of_pos (sq_nonneg _) (sq_pos_of_pos (norm_pos_iff.mpr hv)) + exact lt_of_lt_of_le (mul_pos (by norm_num) hsum) + (regularized_hessian_coercive_of_separated ha hb hc u v) + +/-- The regularized state-Jacobian, written in component form suitable for the +parameter/state stationarity equation. -/ +def regularizedStateHessian (a b c : E) : (E × E) →L[ℝ] E × E := + (((pairHessian a).comp (ContinuousLinearMap.fst ℝ E E) + + (pairHessian b).comp + (ContinuousLinearMap.fst ℝ E E - ContinuousLinearMap.snd ℝ E E)) + + (20 : ℝ) • ContinuousLinearMap.fst ℝ E E).prod + ((-((pairHessian b).comp + (ContinuousLinearMap.fst ℝ E E - ContinuousLinearMap.snd ℝ E E)) + + (pairHessian c).comp (ContinuousLinearMap.snd ℝ E E)) + + (20 : ℝ) • ContinuousLinearMap.snd ℝ E E) + +@[simp] theorem regularizedStateHessian_apply (a b c u v : E) : + regularizedStateHessian a b c (u, v) = + (pairHessian a u + pairHessian b (u - v) + (20 : ℝ) • u, + -(pairHessian b (u - v)) + pairHessian c v + (20 : ℝ) • v) := rfl + +/-- Expansion of the product-state quadratic form. -/ +theorem regularizedStateHessian_quadratic (a b c : E) (q : E × E) : + ⟪q.1, (regularizedStateHessian a b c q).1⟫ + + ⟪q.2, (regularizedStateHessian a b c q).2⟫ = + 20 * (‖q.1‖ ^ 2 + ‖q.2‖ ^ 2) + + ⟪q.1, pairHessian a q.1⟫ + + ⟪q.1 - q.2, pairHessian b (q.1 - q.2)⟫ + + ⟪q.2, pairHessian c q.2⟫ := by + rcases q with ⟨u, v⟩ + simp only [regularizedStateHessian_apply, inner_add_right, inner_neg_right, + real_inner_smul_right, real_inner_self_eq_norm_sq, inner_sub_left] + ring + +/-- Quantitative coercivity of the state-Jacobian in the actual max product norm. -/ +theorem regularizedStateHessian_coercive + {a b c : E} (ha : (2 : ℝ) / 3 ≤ ‖a‖) + (hb : (2 : ℝ) / 3 ≤ ‖b‖) (hc : (2 : ℝ) / 3 ≤ ‖c‖) (q : E × E) : + (79 / 8 : ℝ) * ‖q‖ ^ 2 ≤ + ⟪q.1, (regularizedStateHessian a b c q).1⟫ + + ⟪q.2, (regularizedStateHessian a b c q).2⟫ := by + rw [regularizedStateHessian_quadratic] + have hnorm : ‖q‖ ^ 2 ≤ ‖q.1‖ ^ 2 + ‖q.2‖ ^ 2 := by + rw [Prod.norm_def] + rcases le_total ‖q.1‖ ‖q.2‖ with h | h + · rw [max_eq_right h] + exact le_add_of_nonneg_left (sq_nonneg _) + · rw [max_eq_left h] + exact le_add_of_nonneg_right (sq_nonneg _) + exact (mul_le_mul_of_nonneg_left hnorm (by norm_num)).trans + (regularized_hessian_coercive_of_separated ha hb hc q.1 q.2) + +/-- Strict positivity in every nonzero direction. -/ +theorem regularizedStateHessian_pos + {a b c : E} (ha : (2 : ℝ) / 3 ≤ ‖a‖) + (hb : (2 : ℝ) / 3 ≤ ‖b‖) (hc : (2 : ℝ) / 3 ≤ ‖c‖) + {q : E × E} (hq : q ≠ 0) : + 0 < ⟪q.1, (regularizedStateHessian a b c q).1⟫ + + ⟪q.2, (regularizedStateHessian a b c q).2⟫ := + lt_of_lt_of_le (mul_pos (by norm_num) (sq_pos_of_pos (norm_pos_iff.mpr hq))) + (regularizedStateHessian_coercive ha hb hc q) + +/-- The explicit Jacobian of the regularized Coulomb stationarity equation. +The constant vector in the second component accommodates the chosen outer +potential and has no effect on the Hessian. -/ +theorem hasFDerivAt_regularizedStateGradient (y k : E) {s : E × E} + (hxy : s.1 - y ≠ 0) (hxz : s.1 - s.2 ≠ 0) (hzy : s.2 - y ≠ 0) : + HasFDerivAt + (fun p : E × E => + (pairGradient (p.1 - y) + pairGradient (p.1 - p.2) + (20 : ℝ) • p.1, + -pairGradient (p.1 - p.2) + pairGradient (p.2 - y) + + (20 : ℝ) • p.2 + k)) + (regularizedStateHessian (s.1 - y) (s.1 - s.2) (s.2 - y)) s := by + have hx : HasFDerivAt (fun p : E × E => p.1) (ContinuousLinearMap.fst ℝ E E) s := + (ContinuousLinearMap.fst ℝ E E).hasFDerivAt + have hz : HasFDerivAt (fun p : E × E => p.2) (ContinuousLinearMap.snd ℝ E E) s := + (ContinuousLinearMap.snd ℝ E E).hasFDerivAt + have h₁ := (hasFDerivAt_pairGradient hxy).comp s (hx.sub_const y) + have h₂ := (hasFDerivAt_pairGradient hxz).comp s (hx.sub hz) + have h₃ := (hasFDerivAt_pairGradient hzy).comp s (hz.sub_const y) + exact ((h₁.add h₂).add (hx.const_smul (20 : ℝ))).prodMk + (((h₂.neg.add h₃).add (hz.const_smul (20 : ℝ))).add_const k) + +end Problem356.CoulombCalculus + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombEstimates.lean b/lean/OAI/Analysis/CoulombTransport/CoulombEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..38e2d06ddd09a539df1c8c33a127bfc89cbe4285 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombEstimates.lean @@ -0,0 +1,214 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uE uA + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.CoulombEstimates + +/-- The reciprocal is uniformly Lipschitz away from zero. -/ +theorem abs_inv_sub_inv_le {a b eta L : ℝ} + (heta : 0 < eta) (ha : eta ≤ a) (hb : eta ≤ b) + (hL : |a - b| ≤ L) : + |a⁻¹ - b⁻¹| ≤ L / eta ^ 2 := by + have ha0 : 0 < a := heta.trans_le ha + have hb0 : 0 < b := heta.trans_le hb + have hL0 : 0 ≤ L := (abs_nonneg _).trans hL + have hab : eta ^ 2 ≤ a * b := by + nlinarith [mul_le_mul ha hb (le_of_lt heta) (le_of_lt ha0)] + have heq : a⁻¹ - b⁻¹ = (b - a) / (a * b) := by + field_simp + rw [heq, abs_div, abs_of_pos (mul_pos ha0 hb0), abs_sub_comm] + exact (div_le_div_of_nonneg_right hL (le_of_lt (mul_pos ha0 hb0))).trans + (div_le_div_of_nonneg_left hL0 (sq_pos_of_pos heta) hab) + +/-- Moving both endpoints by at most `delta` changes distance by at most `2 * delta`. -/ +theorem abs_dist_sub_dist_le {E : Type uE} [PseudoMetricSpace E] + {x y x' y' : E} {delta : ℝ} + (hx : dist x x' ≤ delta) (hy : dist y y' ≤ delta) : + |dist x y - dist x' y'| ≤ 2 * delta := by + have h := abs_dist_sub_le x x' y + have h' := abs_dist_sub_le y y' x' + calc + |dist x y - dist x' y'| ≤ + |dist x y - dist x' y| + |dist x' y - dist x' y'| := by + simpa only [sub_add_sub_cancel] using + abs_add_le (dist x y - dist x' y) (dist x' y - dist x' y') + _ ≤ dist x x' + dist y y' := by + exact add_le_add h (by simpa only [dist_comm] using h') + _ ≤ 2 * delta := by linarith + +/-- Coulomb pair interaction has a quantitative oscillation estimate on separated products. -/ +theorem abs_inv_dist_sub_inv_dist_le {E : Type uE} [PseudoMetricSpace E] + {x y x' y' : E} {eta delta : ℝ} + (heta : 0 < eta) (hxy : eta ≤ dist x y) (hxy' : eta ≤ dist x' y') + (hx : dist x x' ≤ delta) (hy : dist y y' ≤ delta) : + |(dist x y)⁻¹ - (dist x' y')⁻¹| ≤ (2 * delta) / eta ^ 2 := + abs_inv_sub_inv_le heta hxy hxy' (abs_dist_sub_dist_le hx hy) + +/-- Real-valued three-particle Coulomb cost on an arbitrary metric space. -/ +def realCost {E : Type uE} [PseudoMetricSpace E] (x y z : E) : ℝ := + (dist x y)⁻¹ + (dist x z)⁻¹ + (dist y z)⁻¹ + +/-- Uniform boundedness of the Coulomb cost on a separated triple. -/ +theorem realCost_le {E : Type uE} [PseudoMetricSpace E] + {x y z : E} {eta : ℝ} (heta : 0 < eta) + (hxy : eta ≤ dist x y) (hxz : eta ≤ dist x z) (hyz : eta ≤ dist y z) : + realCost x y z ≤ 3 / eta := by + have h1 := one_div_le_one_div_of_le heta hxy + have h2 := one_div_le_one_div_of_le heta hxz + have h3 := one_div_le_one_div_of_le heta hyz + simp only [one_div] at h1 h2 h3 + unfold realCost + rw [div_eq_mul_inv] + linarith + +/-- Oscillation of the three-particle Coulomb cost on separated, small cells. -/ +theorem abs_realCost_sub_realCost_le {E : Type uE} [PseudoMetricSpace E] + {x y z x' y' z' : E} {eta delta : ℝ} + (heta : 0 < eta) + (hxy : eta ≤ dist x y) (hxz : eta ≤ dist x z) (hyz : eta ≤ dist y z) + (hxy' : eta ≤ dist x' y') (hxz' : eta ≤ dist x' z') (hyz' : eta ≤ dist y' z') + (hx : dist x x' ≤ delta) (hy : dist y y' ≤ delta) (hz : dist z z' ≤ delta) : + |realCost x y z - realCost x' y' z'| ≤ (6 * delta) / eta ^ 2 := by + have h1 := abs_inv_dist_sub_inv_dist_le heta hxy hxy' hx hy + have h2 := abs_inv_dist_sub_inv_dist_le heta hxz hxz' hx hz + have h3 := abs_inv_dist_sub_inv_dist_le heta hyz hyz' hy hz + have habs : |realCost x y z - realCost x' y' z'| ≤ + |(dist x y)⁻¹ - (dist x' y')⁻¹| + + |(dist x z)⁻¹ - (dist x' z')⁻¹| + + |(dist y z)⁻¹ - (dist y' z')⁻¹| := by + unfold realCost + calc + _ = |((dist x y)⁻¹ - (dist x' y')⁻¹) + + ((dist x z)⁻¹ - (dist x' z')⁻¹) + + ((dist y z)⁻¹ - (dist y' z')⁻¹)| := by congr 1; ring + _ ≤ _ := abs_add_three _ _ _ + calc + _ ≤ _ := habs + _ ≤ (2 * delta) / eta ^ 2 + (2 * delta) / eta ^ 2 + + (2 * delta) / eta ^ 2 := add_le_add (add_le_add h1 h2) h3 + _ = _ := by ring + +/-- The real formula agrees with the extended-valued cost away from collisions. -/ +theorem coulombCost_eq_ofReal_realCost {x y z : E3} + (hxy : 0 < dist x y) (hxz : 0 < dist x z) (hyz : 0 < dist y z) : + coulombCost (x, (y, z)) = ENNReal.ofReal (realCost x y z) := by + unfold realCost + rw [ENNReal.ofReal_add (add_nonneg (inv_nonneg.mpr dist_nonneg) + (inv_nonneg.mpr dist_nonneg)) (inv_nonneg.mpr dist_nonneg), + ENNReal.ofReal_add (inv_nonneg.mpr dist_nonneg) (inv_nonneg.mpr dist_nonneg), + ENNReal.ofReal_inv_of_pos hxy, ENNReal.ofReal_inv_of_pos hxz, + ENNReal.ofReal_inv_of_pos hyz] + rfl + +/-- The exact extended-valued Coulomb cost is uniformly bounded on separated triples. -/ +theorem coulombCost_le_of_separated {x y z : E3} {eta : ℝ} + (heta : 0 < eta) + (hxy : eta ≤ dist x y) (hxz : eta ≤ dist x z) (hyz : eta ≤ dist y z) : + coulombCost (x, (y, z)) ≤ ENNReal.ofReal (3 / eta) := by + rw [coulombCost_eq_ofReal_realCost (heta.trans_le hxy) + (heta.trans_le hxz) (heta.trans_le hyz)] + exact ENNReal.ofReal_le_ofReal (realCost_le heta hxy hxz hyz) + +/-- Separated triples have finite Coulomb cost. -/ +theorem coulombCost_lt_top_of_separated {x y z : E3} {eta : ℝ} + (heta : 0 < eta) + (hxy : eta ≤ dist x y) (hxz : eta ≤ dist x z) (hyz : eta ≤ dist y z) : + coulombCost (x, (y, z)) < ⊤ := + (coulombCost_le_of_separated heta hxy hxz hyz).trans_lt ENNReal.ofReal_lt_top + +/-- One-sided extended-valued oscillation bound, suitable for lower integrals. -/ +theorem coulombCost_le_add_of_separated {x y z x' y' z' : E3} {eta delta : ℝ} + (heta : 0 < eta) + (hxy : eta ≤ dist x y) (hxz : eta ≤ dist x z) (hyz : eta ≤ dist y z) + (hxy' : eta ≤ dist x' y') (hxz' : eta ≤ dist x' z') (hyz' : eta ≤ dist y' z') + (hx : dist x x' ≤ delta) (hy : dist y y' ≤ delta) (hz : dist z z' ≤ delta) : + coulombCost (x, (y, z)) ≤ coulombCost (x', (y', z')) + + ENNReal.ofReal ((6 * delta) / eta ^ 2) := by + have hdelta : 0 ≤ delta := dist_nonneg.trans hx + have hcost : 0 ≤ realCost x' y' z' := by unfold realCost; positivity + have herr : 0 ≤ (6 * delta) / eta ^ 2 := by positivity + have h := (abs_sub_le_iff.mp (abs_realCost_sub_realCost_le heta + hxy hxz hyz hxy' hxz' hyz' hx hy hz)).1 + have hle : realCost x y z ≤ realCost x' y' z' + (6 * delta) / eta ^ 2 := by + linarith + rw [coulombCost_eq_ofReal_realCost (heta.trans_le hxy) + (heta.trans_le hxz) (heta.trans_le hyz), + coulombCost_eq_ofReal_realCost (heta.trans_le hxy') + (heta.trans_le hxz') (heta.trans_le hyz'), + ← ENNReal.ofReal_add hcost herr] + exact ENNReal.ofReal_le_ofReal hle + +/-- Pairwise separation of the coordinates of a triple. -/ +def Separated (eta : ℝ) (t : Triple) : Prop := + eta ≤ dist t.1 t.2.1 ∧ eta ≤ dist t.1 t.2.2 ∧ eta ≤ dist t.2.1 t.2.2 + +/-- A lower-integral bound requiring only almost-everywhere separation. -/ +theorem lintegral_coulombCost_le_of_ae_separated (mu : Measure Triple) {eta : ℝ} + (heta : 0 < eta) (hsep : ∀ᵐ t ∂mu, Separated eta t) : + (∫⁻ t, coulombCost t ∂mu) ≤ ENNReal.ofReal (3 / eta) * mu Set.univ := by + calc + _ ≤ ∫⁻ _t : Triple, ENNReal.ofReal (3 / eta) ∂mu := by + apply lintegral_mono_ae + filter_upwards [hsep] with t ht + rcases t with ⟨x, y, z⟩ + exact coulombCost_le_of_separated heta ht.1 ht.2.1 ht.2.2 + _ = _ := lintegral_const _ + +/-- On finite measures, almost-everywhere separation guarantees finite cost. -/ +theorem lintegral_coulombCost_lt_top_of_ae_separated (mu : Measure Triple) + [IsFiniteMeasure mu] {eta : ℝ} + (heta : 0 < eta) (hsep : ∀ᵐ t ∂mu, Separated eta t) : + (∫⁻ t, coulombCost t ∂mu) < ⊤ := + (lintegral_coulombCost_le_of_ae_separated mu heta hsep).trans_lt + (ENNReal.mul_lt_top ENNReal.ofReal_lt_top (measure_lt_top mu Set.univ)) + +/-- A uniform graph-cost bound; no regularity of the maps is needed for this bound. -/ +theorem graphCost_le_of_ae_separated (mu : Measure E3) {T2 T3 : E3 → E3} {eta : ℝ} + (heta : 0 < eta) (hsep : ∀ᵐ x ∂mu, Separated eta (x, (T2 x, T3 x))) : + graphCost mu T2 T3 ≤ ENNReal.ofReal (3 / eta) * mu Set.univ := by + unfold graphCost + calc + _ ≤ ∫⁻ _x : E3, ENNReal.ofReal (3 / eta) ∂mu := by + apply lintegral_mono_ae + filter_upwards [hsep] with x hx + exact coulombCost_le_of_separated heta hx.1 hx.2.1 hx.2.2 + _ = _ := lintegral_const _ + +/-- The finite-cost condition in finite Monge approximation follows from separation. -/ +theorem graphCost_lt_top_of_ae_separated (mu : Measure E3) [IsFiniteMeasure mu] + {T2 T3 : E3 → E3} {eta : ℝ} + (heta : 0 < eta) (hsep : ∀ᵐ x ∂mu, Separated eta (x, (T2 x, T3 x))) : + graphCost mu T2 T3 < ⊤ := + (graphCost_le_of_ae_separated mu heta hsep).trans_lt + (ENNReal.mul_lt_top ENNReal.ofReal_lt_top (measure_lt_top mu Set.univ)) + +/-- Integrating the pointwise oscillation bound under a common parametrization. -/ +theorem lintegral_coulombCost_le_add_of_ae_close + {A : Type uA} [MeasurableSpace A] (mu : Measure A) {P Q : A → Triple} {eta delta : ℝ} + (heta : 0 < eta) + (hsepP : ∀ᵐ a ∂mu, Separated eta (P a)) + (hsepQ : ∀ᵐ a ∂mu, Separated eta (Q a)) + (hclose : ∀ᵐ a ∂mu, dist (P a).1 (Q a).1 ≤ delta ∧ + dist (P a).2.1 (Q a).2.1 ≤ delta ∧ dist (P a).2.2 (Q a).2.2 ≤ delta) : + (∫⁻ a, coulombCost (P a) ∂mu) ≤ (∫⁻ a, coulombCost (Q a) ∂mu) + + ENNReal.ofReal ((6 * delta) / eta ^ 2) * mu Set.univ := by + calc + _ ≤ ∫⁻ a, coulombCost (Q a) + ENNReal.ofReal ((6 * delta) / eta ^ 2) ∂mu := by + apply lintegral_mono_ae + filter_upwards [hsepP, hsepQ, hclose] with a hP hQ hc + exact coulombCost_le_add_of_separated heta hP.1 hP.2.1 hP.2.2 + hQ.1 hQ.2.1 hQ.2.2 hc.1 hc.2.1 hc.2.2 + _ = _ := by rw [lintegral_add_right _ measurable_const, lintegral_const] + +end Problem356.CoulombEstimates + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombLocalCertificate.lean b/lean/OAI/Analysis/CoulombTransport/CoulombLocalCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..07e74476c245dbad155e6fd7529ea93dd669eed8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombLocalCertificate.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.CoulombTransport.LocalCertificate +import OAI.Analysis.CoulombTransport.StationaryMap + +namespace OAI + +universe uE + +noncomputable section + +open Set +open scoped Topology ContDiff RealInnerProductSpace + +namespace Problem356.LocalGeometry + +open StationaryMap CoulombCalculus + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem statePotential_center_value {a : E} (ha : ‖a‖ = 1) : + statePotential a a (0, -a) = 0 := by + have hvec : -a - a = (-2 : ℝ) • a := by module + have hnorm : ‖-a - a‖ = 2 := by rw [hvec, norm_smul, ha]; norm_num + simp [statePotential, pairCost, ha, hnorm] + norm_num + +/-- The branch value vanishes at the center, as required to glue the five +local potentials with values `5/2,0,0,0,0`. -/ +theorem localSupporting_value_center {a : E} (ha : ‖a‖ = 1) + (C : LocalSupportingCharts (jointPotential a) (stationary a) a (0, -a)) : + C.value a = 0 := by + rw [C.value_base] + exact statePotential_center_value ha + +/-- Restore the central and opposite quadratic potentials in the local +supporting inequality. This is the literal three-point Coulomb formula. -/ +theorem local_coulomb_supporting {a : E} + (C : LocalSupportingCharts (jointPotential a) (stationary a) a (0, -a)) + {x y z : E} + (hy : y ∈ Metric.ball a C.parameterRadius) + (hx : x ∈ Metric.ball (0 : E) C.stateRadius) + (hz : z ∈ Metric.ball (-a) C.stateRadius) : + ((5 : ℝ) / 2 - 10 * ‖x‖ ^ 2) + C.value y + + ((5 : ℝ) / 4 * ⟪a, z + a⟫ - 10 * ‖z + a‖ ^ 2) ≤ + ‖x - y‖⁻¹ + ‖x - z‖⁻¹ + ‖y - z‖⁻¹ := by + have hy' : y ∈ C.charts.central.source := C.source_ball ▸ hy + have hs : (x, z) ∈ C.charts.stateDomain := by + rw [C.state_ball, ← ball_prod_same] + exact ⟨hx, hz⟩ + have h := C.supporting y hy' (x, z) hs + simp only [jointPotential, statePotential, pairCost, norm_sub_rev z y] at h + linarith + +/-- Equality in the supporting inequality is exactly the stationary branch, +not merely inclusion of the branch in the contact set. -/ +theorem local_coulomb_contact {a : E} + (C : LocalSupportingCharts (jointPotential a) (stationary a) a (0, -a)) + {x y z : E} + (hy : y ∈ Metric.ball a C.parameterRadius) + (hx : x ∈ Metric.ball (0 : E) C.stateRadius) + (hz : z ∈ Metric.ball (-a) C.stateRadius) : + (‖x - y‖⁻¹ + ‖x - z‖⁻¹ + ‖y - z‖⁻¹ = + ((5 : ℝ) / 2 - 10 * ‖x‖ ^ 2) + C.value y + + ((5 : ℝ) / 4 * ⟪a, z + a⟫ - 10 * ‖z + a‖ ^ 2)) ↔ + x = C.charts.central y ∧ z = C.charts.opposite y := by + have hy' : y ∈ C.charts.central.source := C.source_ball ▸ hy + have hs : (x, z) ∈ C.charts.stateDomain := by + rw [C.state_ball, ← ball_prod_same] + exact ⟨hx, hz⟩ + have h := C.contact y hy' (x, z) hs + simp only [jointPotential, statePotential, pairCost, norm_sub_rev z y, Prod.mk.injEq] at h + rw [← h] + constructor <;> intro heq <;> linarith + +end Problem356.LocalGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombSupportExistence.lean b/lean/OAI/Analysis/CoulombTransport/CoulombSupportExistence.lean new file mode 100644 index 0000000000000000000000000000000000000000..5453919ae6ebf482df0ca6a2c2d5b86de0663872 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombSupportExistence.lean @@ -0,0 +1,114 @@ +import OAI.Analysis.CoulombTransport.CoulombCharts +import OAI.Analysis.CoulombTransport.LocalCertificate +import OAI.Analysis.CoulombTransport.StateDual +import OAI.Analysis.CoulombTransport.StationaryMap + +namespace OAI + +noncomputable section +open Filter Set +open scoped Topology ContDiff RealInnerProductSpace + +namespace Problem356.CoulombSupportExistence + +open CoulombCalculus GeometryJets LocalGeometry + +/-- The two explicit conventions for the stationary field coincide. -/ +theorem stationary_eq (a : E3) : + StationaryMap.stationary a = stationaryEquation 20 a := by + funext p + apply Prod.ext + · rfl + · simp only [StationaryMap.stationary, stationaryEquation] + have hn (x y : E3) : pairGradient (x - y) = -pairGradient (y - x) := by + rw [← neg_sub y x, pairGradient_neg] + rw [hn p.2.2 p.2.1, hn p.2.2 p.1] + module + +private def D (a y : E3) (s : E3 × E3) : (E3 × E3) →L[ℝ] ℝ := + stateDual E3 E3 (stationaryEquation 20 a (y, s)) + +private def H (a y : E3) (s : E3 × E3) : + (E3 × E3) →L[ℝ] ((E3 × E3) →L[ℝ] ℝ) := + (stateDual E3 E3).comp + ((fderiv ℝ (stationaryEquation 20 a) (y, s)).comp + (ContinuousLinearMap.inr ℝ E3 (E3 × E3))) + +private theorem D_eq (a y : E3) (s : E3 × E3) : + D a y s = StationaryMap.stateDifferential a y s := by + unfold D + rw [← stationary_eq] + rfl + +/-- The actual Coulomb stationary charts admit a local supporting potential +with exact equality precisely on the stationary branch. -/ +theorem nonempty_coulombLocalSupportingCharts (k : Fin 3) : + Nonempty (LocalSupportingCharts + (StationaryMap.jointPotential (axisVector k)) + (stationaryEquation 20 (axisVector k)) + (axisVector k) (0, -axisVector k)) := by + let a : E3 := axisVector k + have ha : ‖a‖ = 1 := norm_axisVector k + have ha0 : a ≠ 0 := axisVector_ne_zero k + have haminus : a ≠ -a := by + intro h + have hh := congrArg (fun x : E3 => x k) h + norm_num [a, axisVector] at hh + have hsep : ∀ᶠ q : E3 × (E3 × E3) in 𝓝 (a, (0, -a)), + q.2.1 ≠ q.1 ∧ q.2.1 ≠ q.2.2 ∧ q.2.2 ≠ q.1 := by + have h₁ : ∀ᶠ q : E3 × (E3 × E3) in 𝓝 (a, (0, -a)), q.2.1 ≠ q.1 := + (isOpen_ne_fun (f := fun q : E3 × (E3 × E3) => q.2.1) + (g := fun q => q.1) (by fun_prop) (by fun_prop)).mem_nhds ha0.symm + have h₂ : ∀ᶠ q : E3 × (E3 × E3) in 𝓝 (a, (0, -a)), q.2.1 ≠ q.2.2 := + (isOpen_ne_fun (f := fun q : E3 × (E3 × E3) => q.2.1) + (g := fun q => q.2.2) (by fun_prop) (by fun_prop)).mem_nhds + (neg_ne_zero.mpr ha0).symm + have h₃ : ∀ᶠ q : E3 × (E3 × E3) in 𝓝 (a, (0, -a)), q.2.2 ≠ q.1 := + (isOpen_ne_fun (f := fun q : E3 × (E3 × E3) => q.2.2) + (g := fun q => q.1) (by fun_prop) (by fun_prop)).mem_nhds haminus.symm + exact h₁.and (h₂.and h₃) + obtain ⟨C⟩ := CoulombCharts.nonempty_coulombCharts k + apply nonempty_localSupportingCharts (D := D a) (H := H a) C + · exact StationaryMap.contDiffAt_jointPotential a ha0.symm + (neg_ne_zero.mpr ha0).symm haminus.symm + · filter_upwards [hsep] with q hq + change HasFDerivAt (StationaryMap.statePotential a q.1) (D a q.1 q.2) q.2 + rw [D_eq] + exact StationaryMap.hasFDerivAt_statePotential a q.1 hq.1 hq.2.1 hq.2.2 + · filter_upwards [hsep] with q hq + have hG := (contDiffAt_stationaryEquation (n := ω) 20 a q hq.1 hq.2.1 + hq.2.2.symm).differentiableAt (by simp) + have hp : HasFDerivAt (fun z : E3 × E3 => (q.1, z)) + (ContinuousLinearMap.inr ℝ E3 (E3 × E3)) q.2 := by + exact hasFDerivAt_prodMk_right q.1 q.2 + have hpartial := hG.hasFDerivAt.comp q.2 hp + convert! hasFDerivAt_stateDual_comp E3 E3 hpartial using 1 + · have hc := (contDiffAt_stationaryEquation_center (n := ω) 20 a ha).continuousAt_fderiv + (by simp) + exact continuousAt_const.clm_comp (hc.clm_comp continuousAt_const) + · intro v hv + change 0 < ((stateDual E3 E3).comp + ((fderiv ℝ (stationaryEquation 20 (axisVector k)) + (axisVector k, (0, -axisVector k))).comp + (ContinuousLinearMap.inr ℝ E3 (E3 × E3)))) v v + rw [CoulombCharts.stationary_state_partial_eq, stateDual_comp_quadratic] + have hc := LocalHessian.stateOperator_coercive k v + have hp : 0 < (16 : ℝ) * ‖v‖ ^ 2 := by positivity + exact hp.trans_le hc + · intro q hq + simp only [D, a, Prod.eta, hq, map_zero] + +/-- The supporting charts in the scalar-potential stationary convention. -/ +theorem nonempty_coulombLocalSupportingCharts_stationary (k : Fin 3) : + Nonempty (LocalSupportingCharts + (StationaryMap.jointPotential (axisVector k)) + (StationaryMap.stationary (axisVector k)) + (axisVector k) (0, -axisVector k)) := by + rw [stationary_eq] + exact nonempty_coulombLocalSupportingCharts k + +end Problem356.CoulombSupportExistence + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CoulombSupportSeparated.lean b/lean/OAI/Analysis/CoulombTransport/CoulombSupportSeparated.lean new file mode 100644 index 0000000000000000000000000000000000000000..7dc03cf55018fdca32a4bac88e1502bb42bc5a59 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CoulombSupportSeparated.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.CoulombTransport.CoulombSupportExistence + +namespace OAI + +noncomputable section + +open Set Metric + +namespace Problem356.CoulombSupportExistence + +open LocalGeometry StationaryMap CoulombCalculus + +private theorem outside_central_ball {a y : E3} (ha : ‖a‖ = 1) + (hy : y ∈ ball a (1 / 4 : ℝ)) : y ∉ ball (0 : E3) (1 / 4 : ℝ) := by + intro hx + have htri := dist_triangle a y (0 : E3) + rw [dist_zero_right, ha, dist_comm a y] at htri + have hy' := mem_ball.mp hy + have hx' := mem_ball.mp hx + linarith + +/-- Shrink both local domains before forming the global contact predicate. +Every parameter of the entire retained graph, not just parameters in a later +component ball, has both outer coordinates outside the fixed central ball. -/ +theorem exists_separated_shrink {a : E3} (ha : ‖a‖ = 1) + (C : LocalSupportingCharts (jointPotential a) (stationary a) a (0, -a)) : + ∃ D : LocalSupportingCharts (jointPotential a) (stationary a) a (0, -a), + ∀ y ∈ D.charts.central.source, + y ∉ ball (0 : E3) (1 / 4 : ℝ) ∧ + D.charts.opposite y ∉ ball (0 : E3) (1 / 4 : ℝ) := by + obtain ⟨D, hsource, hstate, _, _, _⟩ := + C.exists_shrink (1 / 4) (1 / 4) (by norm_num) (by norm_num) + refine ⟨D, ?_⟩ + intro y hy + refine ⟨outside_central_ball ha (hsource hy).2, ?_⟩ + have hs := (hstate (D.charts.mapsTo_state hy)).2 + have hz : D.charts.opposite y ∈ ball (-a) (1 / 4 : ℝ) := by + rw [← ball_prod_same] at hs + exact hs.2 + exact outside_central_ball (by simpa only [norm_neg] using ha) hz + +/-- Unconditional actual Coulomb supporting charts with graph-wide exclusion +of both outer coordinates from a common fixed central neighborhood. -/ +theorem exists_coulombLocalSupportingCharts_separated (k : Fin 3) : + ∃ C : LocalSupportingCharts (jointPotential (axisVector k)) + (stationary (axisVector k)) (axisVector k) (0, -axisVector k), + ∀ y ∈ C.charts.central.source, + y ∉ ball (0 : E3) (1 / 4 : ℝ) ∧ + C.charts.opposite y ∉ ball (0 : E3) (1 / 4 : ℝ) := by + obtain ⟨C⟩ := nonempty_coulombLocalSupportingCharts_stationary k + exact exists_separated_shrink (norm_axisVector k) C + +end Problem356.CoulombSupportExistence + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CounterexampleAssembly.lean b/lean/OAI/Analysis/CoulombTransport/CounterexampleAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..c18ea6cd3b4e83a1a1b86dc49bd815884b1791a6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CounterexampleAssembly.lean @@ -0,0 +1,170 @@ +import OAI.Analysis.CoulombTransport.BranchCoupling +import OAI.Analysis.CoulombTransport.CouplingSupport +import OAI.Analysis.CoulombTransport.ContactObstruction +import OAI.Analysis.CoulombTransport.CertificateAttainment +import OAI.Analysis.CoulombTransport.SplittingConstruction + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- The four-map marginal is the generic finite split measure, with central +weight `1/3` and four equal outer weights `1/6`. -/ +lemma branchMarginal_eq_splitMeasure (nu : Measure E3) (H : Fin 4 → E3 → E3) : + branchMarginal nu (H 0) (H 1) (H 2) (H 3) = + Splitting.splitMeasure nu (1 / 3) (fun _ : Fin 4 => 1 / 6) H := by + simp [branchMarginal, Splitting.splitMeasure, Fin.sum_univ_succ, smul_add, add_assoc] + +/-- Support of the central measure and its four images gives support of the +five-component marginal. -/ +lemma ae_branchMarginal_mem (nu : Measure E3) {H : Fin 4 → E3 → E3} + (hH : ∀ i, Measurable (H i)) {B U : Set E3} + (hU : MeasurableSet U) (hfull : ∀ᵐ x ∂nu, x ∈ B) + (hBU : B ⊆ U) (hHU : ∀ i, H i '' B ⊆ U) : + ∀ᵐ x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3), x ∈ U := by + have hcentral : ∀ᵐ x ∂nu, x ∈ U := hfull.mono fun _ hx => hBU hx + have houter : ∀ i, ∀ᵐ x ∂Measure.map (H i) nu, x ∈ U := by + intro i + apply (ae_map_iff (hH i).aemeasurable hU).mpr + exact hfull.mono fun x hx => hHU i ⟨x, hx, rfl⟩ + unfold branchMarginal + apply ae_add_measure_iff.mpr + refine ⟨Measure.ae_smul_measure hcentral _, Measure.ae_smul_measure ?_ _⟩ + exact ae_add_measure_iff.mpr + ⟨ae_add_measure_iff.mpr ⟨ae_add_measure_iff.mpr ⟨houter 0, houter 1⟩, houter 2⟩, + houter 3⟩ + +private lemma coulombCost_cycle_assembly (x y z : E3) : + coulombCost (y, (z, x)) = coulombCost (x, (y, z)) := by + simp only [coulombCost, tripleFst, tripleSnd, tripleThd, invDistance] + rw [norm_sub_rev y x, norm_sub_rev z x] + ac_rfl + +private lemma triplePotential_cycle_assembly (p : E3 → ℝ≥0∞) (x y z : E3) : + triplePotential p (y, (z, x)) = triplePotential p (x, (y, z)) := by + simp only [triplePotential, tripleFst, tripleSnd, tripleThd] + ac_rfl + +theorem hasCoulombCounterexample_of_branches + (rho : E3 → ℝ) (hrho : IsSmoothCompactProbabilityDensity rho) + (nu : Measure E3) [IsProbabilityMeasure nu] + (H : Fin 4 → E3 → E3) (hH : ∀ i, Measurable (H i)) + (hdensity : densityMeasure rho = branchMarginal nu (H 0) (H 1) (H 2) (H 3)) + {B U : Set E3} (hB : MeasurableSet B) (hU : MeasurableSet U) + (hfull : ∀ᵐ x ∂nu, x ∈ B) (hBU : B ⊆ U) + (hHU : ∀ i, H i '' B ⊆ U) + (hInj : ∀ i, Set.InjOn (H i) B) + (himage : ∀ i S, MeasurableSet S → S ⊆ B → MeasurableSet (H i '' S)) + (hCentral : ∀ i, Disjoint B (H i '' B)) + (hPair : Pairwise fun i j => Disjoint (H i '' B) (H j '' B)) + {p : E3 → ℝ≥0∞} (hp : Measurable p) + (hpfinite : (∫⁻ x, p x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ≠ ⊤) + {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hbound : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + triplePotential p t ≤ coulombCost t + C) + (hcontact01 : ∀ᵐ x ∂nu, + triplePotential p (x, (H 0 x, H 1 x)) = coulombCost (x, (H 0 x, H 1 x)) + C) + (hcontact23 : ∀ᵐ x ∂nu, + triplePotential p (x, (H 2 x, H 3 x)) = coulombCost (x, (H 2 x, H 3 x)) + C) + (hselect : ∀ x y z : E3, x ∈ B → y ∈ U → z ∈ U → + triplePotential p (x, (y, z)) = coulombCost (x, (y, z)) + C → + ∃ i, y = H i x) : + HasCoulombCounterexample rho := by + let mu := branchMarginal nu (H 0) (H 1) (H 2) (H 3) + let pi0 := branchCoupling nu (H 0) (H 1) (H 2) (H 3) + have : IsProbabilityMeasure mu := + isProbabilityMeasure_branchMarginal nu (hH 0) (hH 1) (hH 2) (hH 3) + have hpi0 : IsThreeCoupling mu pi0 := + isThreeCoupling_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + have hmuU : ∀ᵐ x ∂mu, x ∈ U := ae_branchMarginal_mem nu hH hU hfull hBU hHU + have hboundall : ∀ pi, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, triplePotential p t ≤ coulombCost t + C := by + intro pi hpi + exact hpi.ae_of_support_certificate hU hmuU hbound + have hcontact0 : ∀ᵐ t ∂pi0, triplePotential p t = coulombCost t + C := by + apply ae_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + (measurableSet_eq_fun (measurable_triplePotential hp) + (measurable_coulombCost.add measurable_const)) + · intro x y z hxyz + change triplePotential p (y, (z, x)) = coulombCost (y, (z, x)) + C + rw [triplePotential_cycle_assembly, coulombCost_cycle_assembly] + exact hxyz + · exact hcontact01 + · exact hcontact23 + obtain ⟨hattained, hfinite⟩ := + kantorovichAttained_of_certificate hpi0 hp hpfinite hC hboundall hcontact0 + have hnu : nu ≪ mu := by + change nu ≪ branchMarginal nu (H 0) (H 1) (H 2) (H 3) + rw [branchMarginal_eq_splitMeasure] + exact Splitting.absolutelyContinuous_splitMeasure nu (1 / 3) (fun _ : Fin 4 => 1 / 6) H + (by norm_num) + have hno : NoMongeOptimizer mu := by + apply noMongeOptimizer_of_selection_obstruction mu nu hnu hfull + (Contact := fun t => tripleSnd t ∈ U ∧ tripleThd t ∈ U ∧ + triplePotential p t = coulombCost t + C) + (Select := fun x y => ∃ i, y = H i x) + · intro pi hpi hopt + have heq := certificate_contact_of_optimal hpi0 hpi hp hpfinite hC + measurable_coulombCost hboundall hcontact0 hopt + filter_upwards [hpi.ae_coordinates hmuU, heq] with t ht heq + exact ⟨ht.2.1, ht.2.2, heq⟩ + · intro x y z hx ht + exact hselect x y z hx ht.1 ht.2.1 ht.2.2 + · intro T hT hselection + have hbad := Splitting.no_preserving_splitMeasure_selection + (H := H) (c := (1 / 3 : ℝ≥0∞)) (d := (1 / 6 : ℝ≥0∞)) + (by simp : nu Set.univ ≠ 0) hB hfull hH hInj himage hCentral hPair + (by norm_num) + apply hbad + refine ⟨T, hT.1, ?_, hselection⟩ + simpa only [← branchMarginal_eq_splitMeasure] using hT.2 + change IsSmoothCompactProbabilityDensity rho ∧ + IsProbabilityMeasure (densityMeasure rho) ∧ kantorovichValue (densityMeasure rho) < ⊤ ∧ + KantorovichAttained (densityMeasure rho) ∧ NoMongeOptimizer (densityMeasure rho) + rw [hdensity] + exact ⟨hrho, inferInstanceAs (IsProbabilityMeasure mu), hfinite, hattained, hno⟩ + +/-- The concrete six-graph coupling is itself the finite optimizer. This +exposes the witness used by the counterexample assembly to the separated +support approximation argument. -/ +theorem branchCoupling_optimal_of_certificate + (nu : Measure E3) [IsProbabilityMeasure nu] + (H : Fin 4 → E3 → E3) (hH : ∀ i, Measurable (H i)) + {U : Set E3} (hU : MeasurableSet U) + (hmuU : ∀ᵐ x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3), x ∈ U) + {p : E3 → ℝ≥0∞} (hp : Measurable p) + (hpfinite : (∫⁻ x, p x ∂branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ≠ ⊤) + {C : ℝ≥0∞} (hC : C ≠ ⊤) + (hbound : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + triplePotential p t ≤ coulombCost t + C) + (hcontact01 : ∀ᵐ x ∂nu, + triplePotential p (x, (H 0 x, H 1 x)) = coulombCost (x, (H 0 x, H 1 x)) + C) + (hcontact23 : ∀ᵐ x ∂nu, + triplePotential p (x, (H 2 x, H 3 x)) = coulombCost (x, (H 2 x, H 3 x)) + C) : + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) = + kantorovichValue (branchMarginal nu (H 0) (H 1) (H 2) (H 3)) ∧ + (∫⁻ t, coulombCost t ∂branchCoupling nu (H 0) (H 1) (H 2) (H 3)) < ⊤ := by + have hpi0 := isThreeCoupling_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + apply certificate_optimality hpi0 hp hpfinite hC + · intro pi hpi + exact hpi.ae_of_support_certificate hU hmuU hbound + · apply ae_branchCoupling nu (hH 0) (hH 1) (hH 2) (hH 3) + (measurableSet_eq_fun (measurable_triplePotential hp) + (measurable_coulombCost.add measurable_const)) + · intro x y z hxyz + change triplePotential p (y, (z, x)) = coulombCost (y, (z, x)) + C + rw [triplePotential_cycle_assembly, coulombCost_cycle_assembly] + exact hxyz + · exact hcontact01 + · exact hcontact23 + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/CouplingSupport.lean b/lean/OAI/Analysis/CoulombTransport/CouplingSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..aced9e45e93e717b167affe48a3a3f77d03386d0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/CouplingSupport.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- A property holding almost everywhere for the common marginal holds in all +three coordinates of every feasible coupling. No measurability of the property +is needed for this direction of transport. -/ +lemma IsThreeCoupling.ae_coordinates {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) {p : E3 → Prop} (hp : ∀ᵐ x ∂mu, p x) : + ∀ᵐ t ∂pi, p (tripleFst t) ∧ p (tripleSnd t) ∧ p (tripleThd t) := by + have h1 : ∀ᵐ t ∂pi, p (tripleFst t) := by + apply ae_of_ae_map measurable_tripleFst.aemeasurable + simpa only [hpi.2.1] using hp + have h2 : ∀ᵐ t ∂pi, p (tripleSnd t) := by + apply ae_of_ae_map measurable_tripleSnd.aemeasurable + simpa only [hpi.2.2.1] using hp + have h3 : ∀ᵐ t ∂pi, p (tripleThd t) := by + apply ae_of_ae_map measurable_tripleThd.aemeasurable + simpa only [hpi.2.2.2] using hp + exact h1.and (h2.and h3) + +/-- Full marginal mass on a measurable set gives almost-everywhere membership. -/ +lemma ae_mem_of_probability_measure_eq_one {mu : Measure E3} [IsProbabilityMeasure mu] + {U : Set E3} (hU : MeasurableSet U) (hfull : mu U = 1) : + ∀ᵐ x ∂mu, x ∈ U := by + rw [ae_iff] + change mu Uᶜ = 0 + rw [measure_compl hU (by simp [hfull]), measure_univ, hfull, tsub_self] + +/-- Every coupling of a probability carried by `U` is carried by `U³`. -/ +lemma IsThreeCoupling.ae_mem_cube {mu : Measure E3} [IsProbabilityMeasure mu] + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) + {U : Set E3} (hU : MeasurableSet U) (hfull : mu U = 1) : + ∀ᵐ t ∂pi, tripleFst t ∈ U ∧ tripleSnd t ∈ U ∧ tripleThd t ∈ U := + hpi.ae_coordinates (ae_mem_of_probability_measure_eq_one hU hfull) + +/-- A pointwise certificate on the full-mass cube may be used almost everywhere +against any feasible coupling. -/ +lemma IsThreeCoupling.ae_of_on_cube {mu : Measure E3} [IsProbabilityMeasure mu] + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) + {U : Set E3} (hU : MeasurableSet U) (hfull : mu U = 1) + {P : Triple → Prop} + (hP : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → P t) : + ∀ᵐ t ∂pi, P t := by + filter_upwards [hpi.ae_mem_cube hU hfull] with t ht + exact hP t ht.1 ht.2.1 ht.2.2 + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Density.lean b/lean/OAI/Analysis/CoulombTransport/Density.lean new file mode 100644 index 0000000000000000000000000000000000000000..307bd52b9a129ae23ef40cc2ed482c202de8e51f --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Density.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- A nonnegative smooth compactly supported square with mass one is an +admissible density, including the extra square-root regularity. -/ +theorem isSmoothCompactProbabilityDensity_sq + {g : E3 → ℝ} + (hg_nonneg : ∀ x, 0 ≤ g x) + (hg_smooth : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g) + (hg_compact : HasCompactSupport g) + (hg_mass : (∫ x : E3, (g x) ^ 2 ∂(volume : Measure E3)) = 1) : + IsSmoothCompactProbabilityDensity (fun x => (g x) ^ 2) := by + have hsqrt : (fun x : E3 => Real.sqrt ((g x) ^ 2)) = g := by + funext x + exact Real.sqrt_sq (hg_nonneg x) + refine ⟨fun x => sq_nonneg (g x), hg_smooth.pow 2, ?_, ?_, ?_, hg_mass⟩ + · simpa only [pow_two, Pi.mul_def] using hg_compact.mul_left (f := g) + · simpa only [hsqrt] using hg_smooth + · simpa only [hsqrt] using hg_compact + +/-- Normalizing a nonnegative smooth square preserves smoothness of its square root. -/ +theorem isSmoothCompactProbabilityDensity_normalized_sq + {g : E3 → ℝ} + (hg_nonneg : ∀ x, 0 ≤ g x) + (hg_smooth : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g) + (hg_compact : HasCompactSupport g) + (hg_mass_pos : 0 < ∫ x : E3, (g x) ^ 2 ∂(volume : Measure E3)) : + IsSmoothCompactProbabilityDensity + (fun x => (g x / Real.sqrt (∫ y : E3, (g y) ^ 2 ∂(volume : Measure E3))) ^ 2) := by + apply isSmoothCompactProbabilityDensity_sq + · intro x + exact div_nonneg (hg_nonneg x) (Real.sqrt_nonneg _) + · exact hg_smooth.div_const _ + · simpa only [div_eq_mul_inv, Pi.mul_def] using + hg_compact.mul_right (f' := fun _ => + (Real.sqrt (∫ y : E3, (g y) ^ 2 ∂(volume : Measure E3)))⁻¹) + · simp_rw [div_pow] + rw [integral_div, Real.sq_sqrt hg_mass_pos.le, div_self hg_mass_pos.ne'] + +/-- A normalized nonnegative smooth square can be placed in any positive-radius ball. -/ +theorem exists_normalized_smooth_square_in_ball (c : E3) {r : ℝ} (hr : 0 < r) : + ∃ g : E3 → ℝ, + (∀ x, 0 ≤ g x) ∧ + ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g ∧ + HasCompactSupport g ∧ + tsupport g ⊆ Metric.ball c r ∧ + (∫ x : E3, (g x) ^ 2 ∂(volume : Measure E3)) = 1 := by + let b : ContDiffBump c := ⟨r / 4, r / 2, by linarith, by linarith⟩ + have hb_compact : HasCompactSupport (fun x : E3 => (b x) ^ 2) := by + simpa only [pow_two, Pi.mul_def] using + b.hasCompactSupport.mul_left (f := fun x => b x) + have hb_center : b c = 1 := by + exact b.one_of_mem_closedBall (Metric.mem_closedBall_self b.rIn_pos.le) + have hm : 0 < ∫ x : E3, (b x) ^ 2 ∂(volume : Measure E3) := by + apply (b.continuous.pow 2).integral_pos_of_hasCompactSupport_nonneg_nonzero + (x := c) hb_compact (fun x => sq_nonneg (b x)) + change (b c) ^ 2 ≠ 0 + rw [hb_center] + norm_num + let g : E3 → ℝ := fun x => b x / + Real.sqrt (∫ y : E3, (b y) ^ 2 ∂(volume : Measure E3)) + refine ⟨g, fun x => div_nonneg b.nonneg (Real.sqrt_nonneg _), + b.contDiff.div_const _, ?_, ?_, ?_⟩ + · simpa only [g, div_eq_mul_inv, Pi.mul_def] using + b.hasCompactSupport.mul_right (f' := fun _ => + (Real.sqrt (∫ y : E3, (b y) ^ 2 ∂(volume : Measure E3)))⁻¹) + · have hs : tsupport g ⊆ tsupport (fun x : E3 => b x) := by + simpa only [g, div_eq_mul_inv, Pi.mul_def] using + (tsupport_mul_subset_left (f := fun x : E3 => b x) + (g := fun _ => (Real.sqrt (∫ y : E3, (b y) ^ 2 ∂(volume : Measure E3)))⁻¹)) + apply hs.trans + rw [b.tsupport_eq] + intro x hx + apply Metric.mem_ball.mpr + have hx' := Metric.mem_closedBall.mp hx + change dist x c ≤ r / 2 at hx' + linarith + · dsimp only [g] + simp_rw [div_pow] + rw [integral_div, Real.sq_sqrt hm.le, div_self hm.ne'] + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/DensityMeasure.lean b/lean/OAI/Analysis/CoulombTransport/DensityMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..58c5f13465ef601ba88856d8d7782cdc3b35de4d --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/DensityMeasure.lean @@ -0,0 +1,42 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- Every measure obtained from a density is absolutely continuous with respect to volume. -/ +theorem densityMeasure_absolutelyContinuous (rho : E3 → ℝ) : + densityMeasure rho ≪ (volume : Measure E3) := + withDensity_absolutelyContinuous _ _ + +/-- A density measure has no point atoms, without any regularity assumption on the density. -/ +instance densityMeasure_nullSingletonClass (rho : E3 → ℝ) : + NullSingletonClass (densityMeasure rho) := by + unfold densityMeasure + infer_instance + +/-- A density measure gives no mass to the complement of its topological support. -/ +theorem densityMeasure_tsupport_compl (rho : E3 → ℝ) : + densityMeasure rho (tsupport rho)ᶜ = 0 := by + rw [densityMeasure, withDensity_apply _ (isClosed_tsupport rho).measurableSet.compl] + apply lintegral_eq_zero_of_ae_eq_zero + filter_upwards [ae_restrict_mem (isClosed_tsupport rho).measurableSet.compl] with x hx + simp only [Pi.zero_apply] + rw [image_eq_zero_of_notMem_tsupport hx, ENNReal.ofReal_zero] + +/-- Compact support of the density provides an explicit compact set of full measure. -/ +theorem densityMeasure_exists_compact_conull {rho : E3 → ℝ} + (hrho : HasCompactSupport rho) : + ∃ K : Set E3, IsCompact K ∧ densityMeasure rho Kᶜ = 0 := + ⟨tsupport rho, hrho, densityMeasure_tsupport_compl rho⟩ + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/DensityMixture.lean b/lean/OAI/Analysis/CoulombTransport/DensityMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..80c2229976c1e3c11c0f1f689188b2ba646ccefc --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/DensityMixture.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uIndex + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- The nonnegative real-density constructor respects finite scalar multiples. -/ +theorem densityMeasure_const_mul {a : ℝ} (ha : 0 ≤ a) (rho : E3 → ℝ) : + densityMeasure (fun x => a * rho x) = ENNReal.ofReal a • densityMeasure rho := by + unfold densityMeasure + simp_rw [ENNReal.ofReal_mul ha] + exact withDensity_smul' _ _ ENNReal.ofReal_ne_top + +/-- The real density constructor is additive on nonnegative densities. -/ +theorem densityMeasure_add {rho sigma : E3 → ℝ} + (hrho : ∀ x, 0 ≤ rho x) (hsigma : ∀ x, 0 ≤ sigma x) + (hm : Measurable rho) : + densityMeasure (fun x => rho x + sigma x) = + densityMeasure rho + densityMeasure sigma := by + unfold densityMeasure + simp_rw [ENNReal.ofReal_add (hrho _) (hsigma _)] + exact withDensity_add_left hm.ennreal_ofReal _ + +/-- Finite nonnegative density mixtures agree with mixtures of the induced +measures. This identifies the smooth marginal with the branch-plan marginal. -/ +theorem densityMeasure_finset_mixture {ι : Type uIndex} (s : Finset ι) + (a : ι → ℝ) (rho : ι → E3 → ℝ) + (ha : ∀ i ∈ s, 0 ≤ a i) + (hrho : ∀ i ∈ s, ∀ x, 0 ≤ rho i x) + (hm : ∀ i ∈ s, Measurable (rho i)) : + densityMeasure (fun x => ∑ i ∈ s, a i * rho i x) = + ∑ i ∈ s, ENNReal.ofReal (a i) • densityMeasure (rho i) := by + classical + induction s using Finset.induction_on with + | empty => simp [densityMeasure] + | @insert i s hi ih => + have hai : 0 ≤ a i := ha i (Finset.mem_insert_self _ _) + have hri : ∀ x, 0 ≤ rho i x := hrho i (Finset.mem_insert_self _ _) + have hmi : Measurable (rho i) := hm i (Finset.mem_insert_self _ _) + have has : ∀ j ∈ s, 0 ≤ a j := fun j hj => ha j (Finset.mem_insert_of_mem hj) + have hrs : ∀ j ∈ s, ∀ x, 0 ≤ rho j x := + fun j hj => hrho j (Finset.mem_insert_of_mem hj) + have hms : ∀ j ∈ s, Measurable (rho j) := + fun j hj => hm j (Finset.mem_insert_of_mem hj) + simp only [Finset.sum_insert hi] + rw [densityMeasure_add (fun x => mul_nonneg hai (hri x)) + (fun x => Finset.sum_nonneg (fun j hj => mul_nonneg (has j hj) (hrs j hj x))) + (measurable_const.mul hmi), densityMeasure_const_mul hai, ih has hrs hms] + +/-- Fintype form of the density-mixture identity. -/ +theorem densityMeasure_fintype_mixture {ι : Type uIndex} [Fintype ι] + (a : ι → ℝ) (rho : ι → E3 → ℝ) + (ha : ∀ i, 0 ≤ a i) (hrho : ∀ i x, 0 ≤ rho i x) + (hm : ∀ i, Measurable (rho i)) : + densityMeasure (fun x => ∑ i, a i * rho i x) = + ∑ i, ENNReal.ofReal (a i) • densityMeasure (rho i) := by + exact densityMeasure_finset_mixture Finset.univ a rho + (fun i _ => ha i) (fun i _ => hrho i) (fun i _ => hm i) + +theorem densityMeasure_five_component_mixture + (rho0 : E3 → ℝ) (rho : Fin 4 → E3 → ℝ) + (h0 : ∀ x, 0 ≤ rho0 x) (h : ∀ i x, 0 ≤ rho i x) + (hm0 : Measurable rho0) (hm : ∀ i, Measurable (rho i)) : + densityMeasure (fun x => (1 / 3 : ℝ) * rho0 x + + ∑ i, (1 / 6 : ℝ) * rho i x) = + (1 / 3 : ℝ≥0∞) • densityMeasure rho0 + + ∑ i, (1 / 6 : ℝ≥0∞) • densityMeasure (rho i) := by + rw [densityMeasure_add (fun x => mul_nonneg (by norm_num) (h0 x)) + (fun x => Finset.sum_nonneg (fun i _ => mul_nonneg (by norm_num) (h i x))) + (measurable_const.mul hm0)] + rw [densityMeasure_const_mul (by norm_num), + densityMeasure_fintype_mixture (fun _ : Fin 4 => (1 / 6 : ℝ)) rho + (fun _ => by norm_num) h hm] + norm_num [ENNReal.ofReal_div_of_pos] + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/DisjointSquares.lean b/lean/OAI/Analysis/CoulombTransport/DisjointSquares.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a0c8e21792726dac5278b0925ea769c3a826a88 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/DisjointSquares.lean @@ -0,0 +1,142 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uIndex uX + +noncomputable section + +open MeasureTheory +open scoped BigOperators + +namespace Problem356 + +/-- Disjoint nonnegative summands allow the square root of a weighted sum of +squares to be written without any nonsmooth square-root composition. -/ +theorem sqrt_sum_disjoint_squares {ι : Type uIndex} {X : Type uX} (s : Finset ι) + (a : ι → ℝ) (g : ι → X → ℝ) + (ha : ∀ i ∈ s, 0 ≤ a i) + (hg : ∀ i ∈ s, ∀ x, 0 ≤ g i x) + (hd : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → + Disjoint (Function.support (g i)) (Function.support (g j))) + (x : X) : + Real.sqrt (∑ i ∈ s, a i * (g i x) ^ 2) = + ∑ i ∈ s, Real.sqrt (a i) * g i x := by + classical + by_cases h : ∃ i ∈ s, g i x ≠ 0 + · obtain ⟨i, hi, hix⟩ := h + have hz : ∀ j ∈ s, j ≠ i → g j x = 0 := by + intro j hj hji + by_contra hjx + exact Set.disjoint_left.mp (hd i hi j hj hji.symm) hix hjx + rw [Finset.sum_eq_single i, Finset.sum_eq_single i] + · rw [Real.sqrt_mul (ha i hi), Real.sqrt_sq (hg i hi x)] + · intro j hj hji + simp [hz j hj hji] + · exact fun hni => False.elim (hni hi) + · intro j hj hji + simp [hz j hj hji] + · exact fun hni => False.elim (hni hi) + · have hz : ∀ i ∈ s, g i x = 0 := by + intro i hi + by_contra hix + exact h ⟨i, hi, hix⟩ + have hleft : (∑ i ∈ s, a i * (g i x) ^ 2) = 0 := + Finset.sum_eq_zero (fun i hi => by simp [hz i hi]) + have hright : (∑ i ∈ s, Real.sqrt (a i) * g i x) = 0 := + Finset.sum_eq_zero (fun i hi => by simp [hz i hi]) + rw [hleft, hright, Real.sqrt_zero] + +/-- A finite disjoint family of smooth compactly supported nonnegative square +roots yields a density satisfying both smoothness requirements of the target. -/ +theorem isSmoothCompactProbabilityDensity_sum_disjoint_squares {ι : Type uIndex} + (s : Finset ι) (a : ι → ℝ) (g : ι → E3 → ℝ) + (ha : ∀ i ∈ s, 0 ≤ a i) + (hg : ∀ i ∈ s, ∀ x, 0 ≤ g i x) + (hsm : ∀ i ∈ s, ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) (g i)) + (hcs : ∀ i ∈ s, HasCompactSupport (g i)) + (hd : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → + Disjoint (Function.support (g i)) (Function.support (g j))) + (hmass : (∫ x : E3, (∑ i ∈ s, a i * (g i x) ^ 2) + ∂(volume : Measure E3)) = 1) : + IsSmoothCompactProbabilityDensity (fun x => ∑ i ∈ s, a i * (g i x) ^ 2) := by + have hsqrt : (fun x => Real.sqrt (∑ i ∈ s, a i * (g i x) ^ 2)) = + (fun x => ∑ i ∈ s, Real.sqrt (a i) * g i x) := by + funext x + exact sqrt_sum_disjoint_squares s a g ha hg hd x + refine ⟨?_, ?_, ?_, ?_, ?_, hmass⟩ + · intro x + exact Finset.sum_nonneg (fun i hi => mul_nonneg (ha i hi) (sq_nonneg _)) + · exact ContDiff.sum (fun i hi => contDiff_const.mul ((hsm i hi).pow 2)) + · have hterm : ∀ i ∈ s, HasCompactSupport (fun x => a i * (g i x) ^ 2) := by + intro i hi + simpa only [Function.comp_def] using + (hcs i hi).comp_left (g := fun y : ℝ => a i * y ^ 2) (by simp) + simpa only [Finset.sum_fn] using HasCompactSupport.finset_sum hterm + · rw [hsqrt] + exact ContDiff.sum (fun i hi => contDiff_const.mul (hsm i hi)) + · rw [hsqrt] + have hterm : ∀ i ∈ s, HasCompactSupport (fun x => Real.sqrt (a i) * g i x) := by + intro i hi + simpa only [Function.comp_def] using + (hcs i hi).comp_left (g := fun y : ℝ => Real.sqrt (a i) * y) (by simp) + simpa only [Finset.sum_fn] using HasCompactSupport.finset_sum hterm + +/-- Convenient normalization form for the five component densities: every +square has unit mass, and the component weights sum to one. -/ +theorem isSmoothCompactProbabilityDensity_sum_normalized_disjoint_squares + {ι : Type uIndex} (s : Finset ι) (a : ι → ℝ) (g : ι → E3 → ℝ) + (ha : ∀ i ∈ s, 0 ≤ a i) + (hg : ∀ i ∈ s, ∀ x, 0 ≤ g i x) + (hsm : ∀ i ∈ s, ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) (g i)) + (hcs : ∀ i ∈ s, HasCompactSupport (g i)) + (hd : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → + Disjoint (Function.support (g i)) (Function.support (g j))) + (hgint : ∀ i ∈ s, (∫ x : E3, (g i x) ^ 2 ∂(volume : Measure E3)) = 1) + (haint : (∑ i ∈ s, a i) = 1) : + IsSmoothCompactProbabilityDensity (fun x => ∑ i ∈ s, a i * (g i x) ^ 2) := by + apply isSmoothCompactProbabilityDensity_sum_disjoint_squares s a g ha hg hsm hcs hd + have hint : ∀ i ∈ s, Integrable (fun x => a i * (g i x) ^ 2) + (volume : Measure E3) := by + intro i hi + have hcomp : HasCompactSupport (fun x => (g i x) ^ 2) := by + simpa only [Function.comp_def] using + (hcs i hi).comp_left (g := fun y : ℝ => y ^ 2) (by simp) + exact ((hsm i hi).continuous.pow 2).integrable_of_hasCompactSupport hcomp |>.const_mul (a i) + rw [integral_finsetSum s hint] + calc + (∑ i ∈ s, ∫ x : E3, a i * (g i x) ^ 2 ∂(volume : Measure E3)) = + ∑ i ∈ s, a i := by + apply Finset.sum_congr rfl + intro i hi + rw [integral_const_mul, hgint i hi, mul_one] + _ = 1 := haint + +/-- The density assembled from weighted squares represents the corresponding +finite mixture of component measures. No disjointness is needed here. -/ +theorem densityMeasure_sum_weighted_squares {ι : Type uIndex} + (s : Finset ι) (a : ι → ℝ) (g : ι → E3 → ℝ) + (ha : ∀ i ∈ s, 0 ≤ a i) + (hgm : ∀ i ∈ s, Measurable (g i)) : + densityMeasure (fun x => ∑ i ∈ s, a i * (g i x) ^ 2) = + ∑ i ∈ s, ENNReal.ofReal (a i) • densityMeasure (fun x => (g i x) ^ 2) := by + have hpoint : ∀ x, ENNReal.ofReal (∑ i ∈ s, a i * (g i x) ^ 2) = + ∑ i ∈ s, ENNReal.ofReal (a i) * ENNReal.ofReal ((g i x) ^ 2) := by + intro x + rw [ENNReal.ofReal_sum_of_nonneg (fun i hi => mul_nonneg (ha i hi) (sq_nonneg _))] + exact Finset.sum_congr rfl (fun i hi => ENNReal.ofReal_mul (ha i hi)) + ext A hA + simp only [Measure.finsetSum_apply, Measure.smul_apply, densityMeasure, + withDensity_apply _ hA, smul_eq_mul] + simp_rw [hpoint] + rw [lintegral_finsetSum s (f := fun i x => ENNReal.ofReal (a i) * ENNReal.ofReal ((g i x) ^ 2)) + (fun i hi => measurable_const.mul ((hgm i hi).pow_const 2).ennreal_ofReal)] + apply Finset.sum_congr rfl + intro i hi + exact lintegral_const_mul _ ((hgm i hi).pow_const 2).ennreal_ofReal + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/DualCertificate.lean b/lean/OAI/Analysis/CoulombTransport/DualCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..366ce62dc4c646608454c2ef8d3221325a909a1c --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/DualCertificate.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +universe uAlpha + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 +namespace DualCertificate + +/-- The sum of a nonnegative supporting potential over the three coordinates. +A bounded signed potential can be shifted by a constant before using this sum. -/ +def potentialSum (v : E3 → ℝ≥0∞) (t : Triple) : ℝ≥0∞ := + v (tripleFst t) + v (tripleSnd t) + v (tripleThd t) + +lemma measurable_potentialSum {v : E3 → ℝ≥0∞} (hv : Measurable v) : + Measurable (potentialSum v) := by + exact ((hv.comp measurable_fst).add + (hv.comp (measurable_fst.comp measurable_snd))).add + (hv.comp (measurable_snd.comp measurable_snd)) + +/-- The integral of a coordinate potential sum depends only on the common marginal. -/ +lemma lintegral_potentialSum {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) {v : E3 → ℝ≥0∞} (hv : Measurable v) : + (∫⁻ t, potentialSum v t ∂pi) = + (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) := by + have hf : Measurable tripleFst := measurable_fst + have hs : Measurable tripleSnd := measurable_fst.comp measurable_snd + have ht : Measurable tripleThd := measurable_snd.comp measurable_snd + simp only [potentialSum] + have hfs : Measurable (fun t : Triple => v (tripleFst t) + v (tripleSnd t)) := + (hv.comp hf).add (hv.comp hs) + have hf' : Measurable (fun t : Triple => v (tripleFst t)) := hv.comp hf + rw [lintegral_add_left hfs, + lintegral_add_left hf', + ← lintegral_map hv hf, ← lintegral_map hv hs, ← lintegral_map hv ht, + hpi.2.1, hpi.2.2.1, hpi.2.2.2] + +/-- Adding a constant to a nonnegative cost shifts its integral by that constant +under a probability measure; no measurability assumption on the cost is needed. -/ +lemma lintegral_add_offset {α : Type uAlpha} [MeasurableSpace α] + (pi : Measure α) [IsProbabilityMeasure pi] (c : α → ℝ≥0∞) (offset : ℝ≥0∞) : + (∫⁻ t, c t + offset ∂pi) = (∫⁻ t, c t ∂pi) + offset := by + rw [lintegral_add_right c measurable_const] + simp + +/-- Complementary slackness for a shifted nonnegative certificate. -/ +lemma ae_contact_of_equal_integrals {α : Type uAlpha} [MeasurableSpace α] + {pi : Measure α} [IsProbabilityMeasure pi] {p c : α → ℝ≥0∞} + {offset : ℝ≥0∞} (hc : AEMeasurable c pi) + (hbound : p ≤ᵐ[pi] fun t => c t + offset) + (hfinite : (∫⁻ t, p t ∂pi) ≠ ⊤) + (heq : (∫⁻ t, p t ∂pi) = (∫⁻ t, c t ∂pi) + offset) : + p =ᵐ[pi] fun t => c t + offset := by + apply ae_eq_of_ae_le_of_lintegral_le hbound hfinite (hc.add aemeasurable_const) + rw [lintegral_add_offset, heq] + +/-- A finite shifted dual value forces every optimal coupling onto the +contact set. The value identity is the sole input needed from dual optimality. -/ +lemma ae_contact_of_optimal_coupling {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) {v : E3 → ℝ≥0∞} (hv : Measurable v) + {offset : ℝ≥0∞} (hoffset : offset ≠ ⊤) + (hfinite : kantorovichValue mu ≠ ⊤) + (hcost : AEMeasurable coulombCost pi) + (hbound : potentialSum v ≤ᵐ[pi] fun t => coulombCost t + offset) + (hvalue : (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) = + kantorovichValue mu + offset) + (hoptimal : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu) : + potentialSum v =ᵐ[pi] fun t => coulombCost t + offset := by + have : IsProbabilityMeasure pi := hpi.1 + have hid := lintegral_potentialSum hpi hv + rw [hvalue] at hid + exact ae_contact_of_equal_integrals hcost hbound + (hid ▸ ENNReal.add_ne_top.mpr ⟨hfinite, hoffset⟩) + (by rw [hoptimal]; exact hid) + +/-- If a feasible coupling is not concentrated on contact, its cost is strictly +larger than a finite calibrated value. This is the contrapositive form needed +for the deterministic-selection obstruction. -/ +lemma cost_strictly_above_of_noncontact {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) {v : E3 → ℝ≥0∞} (hv : Measurable v) + {offset value : ℝ≥0∞} (hoffset : offset ≠ ⊤) (hfinite : value ≠ ⊤) + (hcost : AEMeasurable coulombCost pi) + (hbound : potentialSum v ≤ᵐ[pi] fun t => coulombCost t + offset) + (hvalue : (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) + (∫⁻ x, v x ∂mu) = + value + offset) + (hnoncontact : ¬ (potentialSum v =ᵐ[pi] fun t => coulombCost t + offset)) : + value < ∫⁻ t, coulombCost t ∂pi := by + have : IsProbabilityMeasure pi := hpi.1 + have hid := lintegral_potentialSum hpi hv + rw [hvalue] at hid + have hfreq : ∃ᵐ t ∂pi, potentialSum v t ≠ coulombCost t + offset := by + change ¬ (∀ᵐ t ∂pi, potentialSum v t = coulombCost t + offset) at hnoncontact + simpa only [Filter.Frequently, not_not] using hnoncontact + have hstrict := lintegral_strict_mono_of_ae_le_of_frequently_ae_lt + (hcost.add aemeasurable_const) + (hid ▸ ENNReal.add_ne_top.mpr ⟨hfinite, hoffset⟩) hbound hfreq + change (∫⁻ t, potentialSum v t ∂pi) < (∫⁻ t, coulombCost t + offset ∂pi) at hstrict + rw [hid, lintegral_add_offset] at hstrict + exact (ENNReal.add_lt_add_iff_right hoffset).mp hstrict + +end DualCertificate +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Endgame.lean b/lean/OAI/Analysis/CoulombTransport/Endgame.lean new file mode 100644 index 0000000000000000000000000000000000000000..901dfe24c864cfd4e78862f1251a6a13f1932386 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Endgame.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- Finite graph approximants give the reverse relaxation inequality, hence +identify the Monge and Kantorovich infima. -/ +theorem mongeValue_eq_kantorovichValue_of_finiteMongeApproximation + (mu : Measure E3) [IsProbabilityMeasure mu] (happrox : FiniteMongeApproximation mu) : + mongeValue mu = kantorovichValue mu := by + apply le_antisymm ?_ (kantorovichValue_le_mongeValue mu) + apply ENNReal.le_of_forall_pos_le_add + intro epsilon hepsilon _ + have hepsilon' : (0 : ℝ) < epsilon := by exact_mod_cast hepsilon + obtain ⟨T2, T3, h2, h3, _hfinite, hcost⟩ := happrox epsilon hepsilon' + have hmonge : mongeValue mu ≤ graphCost mu T2 T3 := by + unfold mongeValue + exact iInf_le_of_le T2 (iInf_le_of_le T3 + (iInf_le_of_le h2 (iInf_le_of_le h3 le_rfl))) + exact hmonge.trans (by simpa using hcost) + +/-- The final logical closure: counterexample construction plus finite Monge +approximation gives the complete qualified conclusion without changing any +of its predicates. -/ +theorem hasFullCoulombConclusion_of_counterexample_of_approximation + {rho : E3 → ℝ} (hcounter : HasCoulombCounterexample rho) + (happrox : FiniteMongeApproximation (densityMeasure rho)) : + HasFullCoulombConclusion rho := by + have : IsProbabilityMeasure (densityMeasure rho) := hcounter.2.1 + exact ⟨hcounter, + mongeValue_eq_kantorovichValue_of_finiteMongeApproximation (densityMeasure rho) happrox, + happrox⟩ + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/EqualInfima.lean b/lean/OAI/Analysis/CoulombTransport/EqualInfima.lean new file mode 100644 index 0000000000000000000000000000000000000000..79b87a77226c7dd3153f6040ba736d4c3480cacc --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/EqualInfima.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- Every feasible Monge pair bounds its defining infimum from above. -/ +theorem mongeValue_le_graphCost (mu : Measure E3) {T2 T3 : E3 → E3} + (h2 : Preserves mu T2) (h3 : Preserves mu T3) : + mongeValue mu ≤ graphCost mu T2 T3 := by + exact iInf_le_of_le T2 (iInf_le_of_le T3 (iInf_le_of_le h2 (iInf_le _ h3))) + +/-- Arbitrarily accurate finite preserving-map approximations imply equality of values. -/ +theorem FiniteMongeApproximation.equal_infima {mu : Measure E3} + [IsProbabilityMeasure mu] (h : FiniteMongeApproximation mu) : + mongeValue mu = kantorovichValue mu := by + apply le_antisymm _ (kantorovichValue_le_mongeValue mu) + apply ENNReal.le_of_forall_pos_le_add + intro epsilon hepsilon _ + obtain ⟨T2, T3, h2, h3, _, hcost⟩ := h epsilon hepsilon + exact (mongeValue_le_graphCost mu h2 h3).trans (by simpa using hcost) + +/-- Finite equality of values already supplies finite near-minimizing preserving maps. -/ +theorem finiteMongeApproximation_of_equal_infima {mu : Measure E3} + (hfinite : kantorovichValue mu < ⊤) + (heq : mongeValue mu = kantorovichValue mu) : + FiniteMongeApproximation mu := by + intro epsilon hepsilon + have hlt : mongeValue mu < kantorovichValue mu + ENNReal.ofReal epsilon := by + rw [heq] + exact ENNReal.lt_add_right hfinite.ne + (ne_of_gt (ENNReal.ofReal_pos.mpr hepsilon)) + unfold mongeValue at hlt + simp only [iInf_lt_iff] at hlt + obtain ⟨T2, T3, h2, h3, hcost⟩ := hlt + refine ⟨T2, T3, h2, h3, ?_, hcost.le⟩ + exact hcost.trans (ENNReal.add_lt_top.mpr ⟨hfinite, ENNReal.ofReal_lt_top⟩) + +/-- Under finiteness, equal infima and finite Monge approximation are equivalent. -/ +theorem finiteMongeApproximation_iff_equal_infima {mu : Measure E3} + [IsProbabilityMeasure mu] (hfinite : kantorovichValue mu < ⊤) : + FiniteMongeApproximation mu ↔ mongeValue mu = kantorovichValue mu := + ⟨FiniteMongeApproximation.equal_infima, finiteMongeApproximation_of_equal_infima hfinite⟩ + +/-- The full target conclusion follows once the counterexample and finite approximation +have been constructed for the same density. -/ +theorem HasCoulombCounterexample.fullConclusion {rho : E3 → ℝ} + (h : HasCoulombCounterexample rho) + (happrox : FiniteMongeApproximation (densityMeasure rho)) : + HasFullCoulombConclusion rho := by + have : IsProbabilityMeasure (densityMeasure rho) := h.2.1 + exact ⟨h, happrox.equal_infima, happrox⟩ + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ExistenceFromLocalGeometry.lean b/lean/OAI/Analysis/CoulombTransport/ExistenceFromLocalGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..7806e9141e63b528191e21b5ad52cb7fcddcf7a6 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ExistenceFromLocalGeometry.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.CoulombTransport.SmoothBranchMarginal +import OAI.Analysis.CoulombTransport.BranchOptimizer +import OAI.Analysis.CoulombTransport.BranchSeparation +import OAI.Analysis.CoulombTransport.CompactLiftApproximation + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +theorem exists_fullCoulombConclusion_of_local_geometry + (c : E3) {r : ℝ} (hr : 0 < r) + (e : Fin 4 → OpenPartialHomeomorph E3 E3) + (hsource : ∀ i, Metric.ball c r ⊆ (e i).source) + (hdisj : Pairwise (fun i j => Disjoint + (SmoothBranchMarginal.componentRegion (Metric.ball c r) e i) + (SmoothBranchMarginal.componentRegion (Metric.ball c r) e j))) + (he : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i) (e i).source) + (he' : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i).symm (e i).target) + {U : Set E3} (hU : MeasurableSet U) + (hBU : Metric.ball c r ⊆ U) (heU : ∀ i, e i '' Metric.ball c r ⊆ U) + {u : E3 → ℝ} (hu : Measurable u) {M : ℝ} (hM : 0 ≤ M) + (hubound : ∀ x ∈ U, -M ≤ u x ∧ u x ≤ M) + (hbound : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) ≤ + coulombCost t) + (hcontact01 : ∀ x ∈ Metric.ball c r, + ENNReal.ofReal (u x + u (e 0 x) + u (e 1 x)) = coulombCost (x, (e 0 x, e 1 x))) + (hcontact23 : ∀ x ∈ Metric.ball c r, + ENNReal.ofReal (u x + u (e 2 x) + u (e 3 x)) = coulombCost (x, (e 2 x, e 3 x))) + (hselect : ∀ x y z : E3, x ∈ Metric.ball c r → y ∈ U → z ∈ U → + ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) → + ∃ i, y = e i x) : + ∃ rho : E3 → ℝ, HasFullCoulombConclusion rho := by + obtain ⟨d, hd⟩ := SmoothBranchMarginal.exists_smoothBranchData_of_smooth_charts + c hr e hsource hdisj he he' + have : IsProbabilityMeasure d.nu := d.probability + have hfull : ∀ᵐ x ∂d.nu, x ∈ Metric.ball c r := + d.core_full.mono (fun _ hx => d.core_subset hx) + have hdensity : densityMeasure d.rho = + branchMarginal d.nu (d.branch 0) (d.branch 1) (d.branch 2) (d.branch 3) := by + simpa [branchMarginal, Fin.sum_univ_succ, smul_add, add_assoc] using d.density_eq + have hHU : ∀ i, d.branch i '' Metric.ball c r ⊆ U := by + rintro i _ ⟨x, hx, rfl⟩ + rw [hd i x hx] + exact heU i ⟨x, hx, rfl⟩ + have hCentral : ∀ i, Disjoint (Metric.ball c r) (d.branch i '' Metric.ball c r) := by + intro i + exact d.component_disjoint (show (none : Option (Fin 4)) ≠ some i by simp) + have hPair : Pairwise fun i j => + Disjoint (d.branch i '' Metric.ball c r) (d.branch j '' Metric.ball c r) := by + intro i j hij + exact d.component_disjoint (show some i ≠ some j by simpa using hij) + have hc01 : ∀ᵐ x ∂d.nu, + ENNReal.ofReal (u x + u (d.branch 0 x) + u (d.branch 1 x)) = + coulombCost (x, (d.branch 0 x, d.branch 1 x)) := by + filter_upwards [hfull] with x hx + simpa only [hd 0 x hx, hd 1 x hx] using hcontact01 x hx + have hc23 : ∀ᵐ x ∂d.nu, + ENNReal.ofReal (u x + u (d.branch 2 x) + u (d.branch 3 x)) = + coulombCost (x, (d.branch 2 x, d.branch 3 x)) := by + filter_upwards [hfull] with x hx + simpa only [hd 2 x hx, hd 3 x hx] using hcontact23 x hx + have hcounter : HasCoulombCounterexample d.rho := by + apply hasCoulombCounterexample_of_real_branches d.rho d.density_smooth d.nu + d.branch d.branch_measurable hdensity d.measurable_central hU hfull hBU hHU + d.branch_injective d.branch_image_measurable hCentral hPair + hu hM hubound hbound hc01 hc23 + intro x y z hx hy hz hc + obtain ⟨i, hi⟩ := hselect x y z hx hy hz hc + exact ⟨i, hi.trans (hd i x hx).symm⟩ + have hoptimal := branchCoupling_optimality_of_real_certificate d.nu d.branch + d.branch_measurable hU hfull hBU hHU hu hM hubound hbound hc01 hc23 + have hdisjoint : Pairwise (fun i j => + Disjoint (BranchSeparation.components d.compactCore d.branch i) + (BranchSeparation.components d.compactCore d.branch j)) := by + apply BranchSeparation.disjoint_components_mono d.core_subset + intro i j hij + induction i using Fin.cases with + | zero => + induction j using Fin.cases with + | zero => exact (hij rfl).elim + | succ j => exact hCentral j + | succ i => + induction j using Fin.cases with + | zero => exact (hCentral i).symm + | succ j => exact hPair (by simpa using hij) + obtain ⟨eta, heta, hsep⟩ := BranchSeparation.exists_ae_separated_branchCoupling + d.core_compact d.core_full d.branch_measurable d.branch_continuous hdisjoint + refine ⟨d.rho, hcounter.hasFull_of_separated_optimizer ?_ ?_ heta hsep⟩ + · rw [hdensity] + exact isThreeCoupling_branchCoupling d.nu (d.branch_measurable 0) + (d.branch_measurable 1) (d.branch_measurable 2) (d.branch_measurable 3) + · simpa only [hdensity] using hoptimal.1 + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ExtendedPushforward.lean b/lean/OAI/Analysis/CoulombTransport/ExtendedPushforward.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ffaf31da5b52da86102a5925e0bbf37180427da --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ExtendedPushforward.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.CoulombTransport.LocalBranchMeasure +import OAI.Analysis.CoulombTransport.SmoothPushforward + +namespace OAI + +/-! Square-density transport through globally measurable extensions of local branches. -/ + +noncomputable section +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356 + +/-- A square density is concentrated on every measurable set containing the amplitude's support. -/ +theorem squareDensity_ae_mem_of_tsupport_subset + (g : E3 → ℝ) {U : Set E3} (hU : MeasurableSet U) (hg : tsupport g ⊆ U) : + ∀ᵐ x ∂densityMeasure (fun x => g x ^ 2), x ∈ U := by + apply ae_iff.mpr + change densityMeasure (fun x => g x ^ 2) Uᶜ = 0 + rw [densityMeasure, withDensity_apply _ hU.compl] + apply lintegral_eq_zero_of_ae_eq_zero + filter_upwards [ae_restrict_mem hU.compl] with x hx + have hgx : g x = 0 := image_eq_zero_of_notMem_tsupport (fun ht => hx (hg ht)) + simp [hgx] + +/-- Extending a local branch by a fixed value outside its source does not affect +its transport of a square density supported strictly inside that source. -/ +theorem map_extendedBranch_squareDensity + (e : OpenPartialHomeomorph E3 E3) (z : E3) (g : E3 → ℝ) + (hg : tsupport g ⊆ e.source) : + Measure.map (LocalBranchMeasure.extendedBranch e z) + (densityMeasure (fun x => g x ^ 2)) = + Measure.map e (densityMeasure (fun x => g x ^ 2)) := + LocalBranchMeasure.map_extendedBranch e z _ + (squareDensity_ae_mem_of_tsupport_subset g e.open_source.measurableSet hg) + +/-- The exact inverse-Jacobian pushforward formula for a globally Borel branch. -/ +theorem map_squareDensity_extendedBranch + (e : OpenPartialHomeomorph E3 E3) (z : E3) (g : E3 → ℝ) + (hgs : tsupport g ⊆ e.source) + (D : E3 → E3 →L[ℝ] E3) + (hD : ∀ y ∈ e.target, HasFDerivAt e.symm (D y) y) : + Measure.map (LocalBranchMeasure.extendedBranch e z) + (densityMeasure (fun x => g x ^ 2)) = + densityMeasure (fun y => + localTransportAmplitude e g (fun t => Real.sqrt |(D t).det|) y ^ 2) := by + rw [map_extendedBranch_squareDensity e z g hgs] + exact map_squareDensity_localHomeomorph e g hgs D hD + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/FiniteMassSplit.lean b/lean/OAI/Analysis/CoulombTransport/FiniteMassSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..65edcb653da8303d91d7ab4467496249101ab0f8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/FiniteMassSplit.lean @@ -0,0 +1,156 @@ +import Mathlib + +namespace OAI + +universe uAlpha uIndex + +noncomputable section + +open MeasureTheory Set Filter +open scoped ENNReal Topology + +namespace Problem356 + +/-- The cumulative mass of a finite real measure with null singletons is continuous. -/ +theorem continuous_real_cumulative (μ : Measure ℝ) [IsFiniteMeasure μ] + [NullSingletonClass μ] : Continuous (fun t : ℝ => μ.real (Iic t)) := by + have hc : Continuous (fun t : ℝ => ∫ x in Iic t, (1 : ℝ) ∂μ) := by + rw [continuous_iff_continuousAt] + intro t + have hi : IntegrableOn (fun _ : ℝ => (1 : ℝ)) (Iic (t + 1)) μ := + (integrable_const (1 : ℝ)).integrableOn + exact hi.continuousOn_Iic_primitive_Iic.continuousAt (Iic_mem_nhds (by linarith)) + simpa using hc + +/-- Every strictly intermediate mass is the mass of a lower interval. -/ +theorem exists_real_cumulative_eq (μ : Measure ℝ) [IsFiniteMeasure μ] + [NullSingletonClass μ] {r : ℝ} (hr : 0 < r) (hrμ : r < μ.real univ) : + ∃ t : ℝ, μ.real (Iic t) = r := by + have hbot : Tendsto (fun t : ℝ => μ.real (Iic t)) atBot (𝓝 0) := by + simpa using (tendsto_integral_Iic_zero (μ := μ) (f := fun _ : ℝ => (1 : ℝ)) + (a := id) tendsto_id) + have htop : Tendsto (fun t : ℝ => μ.real (Iic t)) atTop (𝓝 (μ.real univ)) := by + exact (ENNReal.continuousAt_toReal (measure_ne_top μ univ)).tendsto.comp + (tendsto_measure_Iic_atTop μ) + exact mem_range_of_exists_le_of_exists_ge (continuous_real_cumulative μ) + ((hbot.eventually (gt_mem_nhds hr)).exists.imp (fun _ h => h.le)) + ((htop.eventually (lt_mem_nhds hrμ)).exists.imp (fun _ h => h.le)) + +/-- A finite measure with null singletons on a standard Borel space can realize +any prescribed mass inside any measurable set. -/ +theorem exists_measurable_subset_measure_eq {α : Type uAlpha} [MeasurableSpace α] + [StandardBorelSpace α] (μ : Measure α) [IsFiniteMeasure μ] + [NullSingletonClass μ] {A : Set α} (hA : MeasurableSet A) + {r : ℝ≥0∞} (hr : r ≤ μ A) : + ∃ B : Set α, MeasurableSet B ∧ B ⊆ A ∧ μ B = r := by + by_cases hzero : r = 0 + · exact ⟨∅, MeasurableSet.empty, empty_subset _, by simp [hzero]⟩ + by_cases hfull : r = μ A + · exact ⟨A, hA, Subset.rfl, hfull.symm⟩ + obtain ⟨e, he⟩ := exists_measurableEmbedding_real α + let ν : Measure ℝ := Measure.map e (μ.restrict A) + have : NullSingletonClass ν := by + constructor + intro y + rw [show ν {y} = (μ.restrict A) (e ⁻¹' {y}) from + Measure.map_apply he.measurable (measurableSet_singleton y)] + have hs : (e ⁻¹' {y}).Subsingleton := by + intro x hx z hz + exact he.injective (hx.trans hz.symm) + exact hs.measure_zero (μ.restrict A) + have hν : ν univ = μ A := by simp [ν, Measure.map_apply, he.measurable] + have hrfinite : r ≠ ⊤ := ne_top_of_le_ne_top (measure_ne_top μ A) hr + have hpos : 0 < r.toReal := ENNReal.toReal_pos hzero hrfinite + have hlt : r.toReal < ν.real univ := by + rw [measureReal_def, hν] + exact (ENNReal.toReal_lt_toReal hrfinite (measure_ne_top μ A)).2 + (lt_of_le_of_ne hr hfull) + obtain ⟨t, ht⟩ := exists_real_cumulative_eq ν hpos hlt + have hmass : ν (Iic t) = r := by + apply (ENNReal.toReal_eq_toReal_iff' (measure_ne_top ν _) hrfinite).1 + exact ht + refine ⟨e ⁻¹' Iic t ∩ A, (he.measurable measurableSet_Iic).inter hA, + inter_subset_right, ?_⟩ + simpa [ν, Measure.map_apply he.measurable measurableSet_Iic, + Measure.restrict_apply measurableSet_Iic, Measure.restrict_apply + (he.measurable measurableSet_Iic)] using hmass + +/-- Finitely many prescribed masses whose total does not exceed the mass of a +measurable set can be realized by pairwise disjoint measurable subsets. -/ +theorem exists_fin_disjoint_subsets_measure {α : Type uAlpha} [MeasurableSpace α] + [StandardBorelSpace α] (μ : Measure α) [IsFiniteMeasure μ] + [NullSingletonClass μ] {n : ℕ} (q : Fin n → ℝ≥0∞) + {A : Set α} (hA : MeasurableSet A) (hq : ∑ i, q i ≤ μ A) : + ∃ B : Fin n → Set α, + (∀ i, MeasurableSet (B i)) ∧ (∀ i, B i ⊆ A) ∧ + Pairwise (fun i j => Disjoint (B i) (B j)) ∧ (∀ i, μ (B i) = q i) := by + classical + induction n generalizing A with + | zero => + exact ⟨Fin.elim0, by simp, by simp, by simp [Pairwise], by simp⟩ + | succ n ih => + have hq0 : q 0 ≤ μ A := by + exact (Finset.single_le_sum (fun i _ => bot_le) (Finset.mem_univ 0)).trans hq + obtain ⟨B0, hm0, hs0, hmass0⟩ := exists_measurable_subset_measure_eq μ hA hq0 + have htail : ∑ i : Fin n, q i.succ ≤ μ (A \ B0) := by + rw [measure_sdiff hs0 hm0.nullMeasurableSet (measure_ne_top μ B0), hmass0] + apply ENNReal.le_sub_of_add_le_left (ne_top_of_le_ne_top (measure_ne_top μ A) hq0) + simpa [Fin.sum_univ_succ] using hq + obtain ⟨B, hm, hs, hd, hmass⟩ := ih (fun i => q i.succ) (hA.diff hm0) htail + refine ⟨Fin.cons B0 B, ?_, ?_, ?_, ?_⟩ + · intro i + exact Fin.cases hm0 hm i + · intro i + exact Fin.cases hs0 (fun i => (hs i).trans sdiff_subset) i + · intro i j hij + cases i using Fin.cases <;> cases j using Fin.cases + · exact (hij rfl).elim + · simpa using (disjoint_sdiff_right.mono_right (hs _)) + · simpa using (disjoint_sdiff_right.mono_right (hs _)).symm + · exact hd (fun h => hij (congrArg Fin.succ h)) + · intro i + exact Fin.cases hmass0 hmass i + +/-- Fintype-indexed version of finite prescribed-mass splitting. -/ +theorem exists_finite_disjoint_subsets_measure {α : Type uAlpha} {ι : Type uIndex} [MeasurableSpace α] + [StandardBorelSpace α] [Fintype ι] (μ : Measure α) [IsFiniteMeasure μ] + [NullSingletonClass μ] (q : ι → ℝ≥0∞) + {A : Set α} (hA : MeasurableSet A) (hq : ∑ i, q i ≤ μ A) : + ∃ B : ι → Set α, + (∀ i, MeasurableSet (B i)) ∧ (∀ i, B i ⊆ A) ∧ + Pairwise (fun i j => Disjoint (B i) (B j)) ∧ (∀ i, μ (B i) = q i) := by + classical + let e := Fintype.equivFin ι + have hsum : ∑ i, q (e.symm i) ≤ μ A := by + simpa only [e.symm.sum_comp] using hq + obtain ⟨B, hm, hs, hd, hmass⟩ := + exists_fin_disjoint_subsets_measure μ (fun i => q (e.symm i)) hA hsum + refine ⟨fun i => B (e i), fun i => hm (e i), fun i => hs (e i), ?_, ?_⟩ + · intro i j hij + exact hd (fun h => hij (e.injective h)) + · intro i + simpa using hmass (e i) + +/-- When prescribed masses exhaust the source mass, the disjoint subsets cover +it up to a null remainder. Empty index types are allowed. -/ +theorem exists_finite_mass_partition_ae {α : Type uAlpha} {ι : Type uIndex} [MeasurableSpace α] + [StandardBorelSpace α] [Fintype ι] (μ : Measure α) [IsFiniteMeasure μ] + [NullSingletonClass μ] (q : ι → ℝ≥0∞) + {A : Set α} (hA : MeasurableSet A) (hq : ∑ i, q i = μ A) : + ∃ B : ι → Set α, + (∀ i, MeasurableSet (B i)) ∧ (∀ i, B i ⊆ A) ∧ + Pairwise (fun i j => Disjoint (B i) (B j)) ∧ + (∀ i, μ (B i) = q i) ∧ μ (A \ ⋃ i, B i) = 0 := by + obtain ⟨B, hm, hs, hd, hmass⟩ := exists_finite_disjoint_subsets_measure μ q hA hq.le + refine ⟨B, hm, hs, hd, hmass, ?_⟩ + have hmass_union : μ (⋃ i, B i) = μ A := by + rw [measure_iUnion hd hm, tsum_fintype] + simpa only [hmass] using hq + rw [measure_sdiff (iUnion_subset hs) (MeasurableSet.iUnion hm).nullMeasurableSet + (measure_ne_top μ _), hmass_union, tsub_self] + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/FirstCoordinateLift.lean b/lean/OAI/Analysis/CoulombTransport/FirstCoordinateLift.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e01359ff4f14fb4aa79acd33662d9694de3e32d --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/FirstCoordinateLift.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.CoulombTransport.CoulombEstimates +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.FirstCoordinateLift + +open CoulombEstimates + +/-- Replacing only the first coordinate by a nearby point preserves half the +separation, without any component-label hypothesis. -/ +lemma separated_replace_first {η δ : ℝ} {t : Triple} {x : E3} + (hη : 0 < η) (ht : Separated η t) + (hclose : dist x t.1 ≤ δ) (hδ : δ ≤ η / 2) : + Separated (η / 2) (x, t.2) := by + rcases t with ⟨a, b, c⟩ + rcases ht with ⟨hab, hac, hbc⟩ + have hx : dist a x ≤ δ := by simpa only [dist_comm] using hclose + have hab' := dist_triangle a x b + have hac' := dist_triangle a x c + refine ⟨?_, ?_, ?_⟩ <;> dsimp at * <;> linarith + +/-- Weakening separation to half its value. -/ +lemma separated_half {η : ℝ} {t : Triple} (hη : 0 < η) + (ht : Separated η t) : Separated (η / 2) t := by + rcases ht with ⟨h₁, h₂, h₃⟩ + refine ⟨?_, ?_, ?_⟩ <;> linarith + +/-- The two noncentral coordinates of a measure-valued lift preserve the marginal. -/ +lemma preserves_coordinates {μ : Measure E3} {π : Measure Triple} + (hπ : IsThreeCoupling μ π) {Q : E3 → Triple} + (hQ : Measurable Q) (hmap : Measure.map Q μ = π) : + Preserves μ (tripleSnd ∘ Q) ∧ Preserves μ (tripleThd ∘ Q) := by + constructor + · refine ⟨measurable_tripleSnd.comp hQ, ?_⟩ + rw [← Measure.map_map measurable_tripleSnd hQ, hmap] + exact hπ.2.2.1 + · refine ⟨measurable_tripleThd.comp hQ, ?_⟩ + rw [← Measure.map_map measurable_tripleThd hQ, hmap] + exact hπ.2.2.2 + +/-- A lift of a separated coupling, whose first coordinate remains nearby, +gives a finite-cost preserving pair and the quantitative Coulomb estimate. -/ +theorem graph_cost_of_lift {μ : Measure E3} [IsProbabilityMeasure μ] + {π : Measure Triple} (hπ : IsThreeCoupling μ π) + {Q : E3 → Triple} (hQ : Measurable Q) (hmap : Measure.map Q μ = π) + {η δ : ℝ} (hη : 0 < η) (hδ : δ ≤ η / 2) + (hsep : ∀ᵐ t ∂π, Separated η t) + (hclose : ∀ᵐ x ∂μ, dist x (Q x).1 ≤ δ) : + Preserves μ (tripleSnd ∘ Q) ∧ Preserves μ (tripleThd ∘ Q) ∧ + graphCost μ (tripleSnd ∘ Q) (tripleThd ∘ Q) < ⊤ ∧ + graphCost μ (tripleSnd ∘ Q) (tripleThd ∘ Q) ≤ + (∫⁻ t, coulombCost t ∂π) + ENNReal.ofReal (24 * δ / η ^ 2) := by + have hsepQ : ∀ᵐ x ∂μ, Separated η (Q x) := + ae_of_ae_map hQ.aemeasurable (by rwa [hmap]) + have hsepP : ∀ᵐ x ∂μ, Separated (η / 2) (x, (Q x).2) := by + filter_upwards [hsepQ, hclose] with x hx hc + exact separated_replace_first hη hx hc hδ + have hsepQ' : ∀ᵐ x ∂μ, Separated (η / 2) (Q x) := + hsepQ.mono fun _ hx => separated_half hη hx + have hc : ∀ᵐ x ∂μ, dist (x, (Q x).2).1 (Q x).1 ≤ δ ∧ + dist (x, (Q x).2).2.1 (Q x).2.1 ≤ δ ∧ + dist (x, (Q x).2).2.2 (Q x).2.2 ≤ δ := by + filter_upwards [hclose] with x hx + have hδ0 : 0 ≤ δ := dist_nonneg.trans hx + exact ⟨hx, by simpa using hδ0, by simpa using hδ0⟩ + have hbound := lintegral_coulombCost_le_add_of_ae_close μ (half_pos hη) + hsepP hsepQ' hc + have herr : (6 * δ) / (η / 2) ^ 2 = 24 * δ / η ^ 2 := by + field_simp + ring + rw [measure_univ, mul_one, herr] at hbound + have hint : (∫⁻ x, coulombCost (Q x) ∂μ) = ∫⁻ t, coulombCost t ∂π := by + rw [← lintegral_map measurable_coulombCost hQ, hmap] + rw [hint] at hbound + exact ⟨(preserves_coordinates hπ hQ hmap).1, + (preserves_coordinates hπ hQ hmap).2, + graphCost_lt_top_of_ae_separated μ (half_pos hη) hsepP, hbound⟩ + +end Problem356.FirstCoordinateLift + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/FiveComponentCanonical.lean b/lean/OAI/Analysis/CoulombTransport/FiveComponentCanonical.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ea12738f85452724c10deda651251f713658c17 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/FiveComponentCanonical.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.CoulombTransport.FiveComponentGeometry +import OAI.Analysis.CoulombTransport.GoodTypePermutation + +namespace OAI + +noncomputable section +open Set Filter Metric +open scoped ENNReal + +namespace Problem356.FiveComponentGeometry + +open CenterCertificate GoodTypePermutation + +/-- Common component neighborhoods on which both canonical Coulomb +certificates hold, including their one-way symmetric contact localization. -/ +theorem exists_canonical_neighborhoods + (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + ∃ W : Fin 5 → Set E3, + (∀ i, W i ∈ nhds (point i)) ∧ + LocalTypeCertificate W (potentials C₁ C₂) (branchContact C₁ C₂) 0 1 2 ∧ + LocalTypeCertificate W (potentials C₁ C₂) (branchContact C₁ C₂) 0 3 4 := by + let R : Fin 5 → ℝ := + ![min C₁.stateRadius C₂.stateRadius, C₁.parameterRadius, C₁.stateRadius, + C₂.parameterRadius, C₂.stateRadius] + have hR : ∀ i, 0 < R i := by + intro i + fin_cases i + · exact lt_min C₁.stateRadius_pos C₂.stateRadius_pos + · exact C₁.parameterRadius_pos + · exact C₁.stateRadius_pos + · exact C₂.parameterRadius_pos + · exact C₂.stateRadius_pos + obtain ⟨r, hr, hsub, hdisj⟩ := Geometry.finite_disjoint_closedBalls_subset + point point_injective (fun i => ball (point i) (R i)) + (fun _ => isOpen_ball) (fun i => mem_ball_self (hR i)) + let W : Fin 5 → Set E3 := fun i => ball (point i) r + have hWsub (i : Fin 5) : W i ⊆ ball (point i) (R i) := + ball_subset_closedBall.trans (hsub i) + have hdist {i j : Fin 5} (hij : i ≠ j) {x y : E3} + (hx : x ∈ W i) (hy : y ∈ W j) : 0 < dist x y := by + apply dist_pos.mpr + intro heq + exact Set.disjoint_left.mp (hdisj hij) + (heq ▸ ball_subset_closedBall hx) (ball_subset_closedBall hy) + refine ⟨W, (fun i => ball_mem_nhds (point i) hr), ?_, ?_⟩ + · intro x hx y hy z hz + have hx' := hWsub 0 hx + change x ∈ ball (0 : E3) (min C₁.stateRadius C₂.stateRadius) at hx' + have hx₁ : x ∈ ball (0 : E3) C₁.stateRadius := + ball_subset_ball (min_le_left _ _) hx' + have hy₁ : y ∈ ball (point 1) C₁.parameterRadius := hWsub 1 hy + have hz₁ : z ∈ ball (-point 1) C₁.stateRadius := by + have hz' := hWsub 2 hz + change z ∈ ball (point 2) C₁.stateRadius at hz' + simpa only [point_two_eq_neg] using hz' + have hc := ennreal_local_certificate C₁ hy₁ hx₁ hz₁ + (hdist (by decide : (0 : Fin 5) ≠ 1) hx hy) + (hdist (by decide : (0 : Fin 5) ≠ 2) hx hz) + (hdist (by decide : (1 : Fin 5) ≠ 2) hy hz) + refine ⟨hc.1, ?_⟩ + intro heq + obtain ⟨hxc, hzc⟩ := hc.2.mp heq + apply Or.inl + refine ⟨y, ?_, ?_⟩ + · rw [C₁.source_ball] + exact hy₁ + · simpa only [hxc, hzc] using + (List.Perm.refl [C₁.charts.central y, y, C₁.charts.opposite y]) + · intro x hx y hy z hz + have hx' := hWsub 0 hx + change x ∈ ball (0 : E3) (min C₁.stateRadius C₂.stateRadius) at hx' + have hx₂ : x ∈ ball (0 : E3) C₂.stateRadius := + ball_subset_ball (min_le_right _ _) hx' + have hy₂ : y ∈ ball (point 3) C₂.parameterRadius := hWsub 3 hy + have hz₂ : z ∈ ball (-point 3) C₂.stateRadius := by + have hz' := hWsub 4 hz + change z ∈ ball (point 4) C₂.stateRadius at hz' + simpa only [point_four_eq_neg] using hz' + have hc := ennreal_local_certificate C₂ hy₂ hx₂ hz₂ + (hdist (by decide : (0 : Fin 5) ≠ 3) hx hy) + (hdist (by decide : (0 : Fin 5) ≠ 4) hx hz) + (hdist (by decide : (3 : Fin 5) ≠ 4) hy hz) + refine ⟨hc.1, ?_⟩ + intro heq + obtain ⟨hxc, hzc⟩ := hc.2.mp heq + apply Or.inr + refine ⟨y, ?_, ?_⟩ + · rw [C₂.source_ball] + exact hy₂ + · simpa only [hxc, hzc] using + (List.Perm.refl [C₂.charts.central y, y, C₂.charts.opposite y]) + +/-- The actual chart pair supplies the neighborhood hypothesis for every +good component type in the finite global gluing theorem. -/ +theorem eventually_good_certificate + (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + (i j k : Fin 5) (hg : Good i j k) : + ∀ᶠ t : Triple in nhds (point i, (point j, point k)), + ENNReal.ofReal (potentials C₁ C₂ i t.1 + potentials C₁ C₂ j t.2.1 + + potentials C₁ C₂ k t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (potentials C₁ C₂ i t.1 + potentials C₁ C₂ j t.2.1 + + potentials C₁ C₂ k t.2.2) = coulombCost t → branchContact C₁ C₂ t) := by + obtain ⟨W, hW, h012, h034⟩ := exists_canonical_neighborhoods C₁ C₂ + exact GoodTypePermutation.eventually_certificate_of_good point hW + (fun hp => (branchContact_perm C₁ C₂ hp).mp) h012 h034 i j k hg + +end Problem356.FiveComponentGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/FiveComponentGeometry.lean b/lean/OAI/Analysis/CoulombTransport/FiveComponentGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..ab03d4553c0c66c0333de58fd337b52cefc38027 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/FiveComponentGeometry.lean @@ -0,0 +1,175 @@ +import OAI.Analysis.CoulombTransport.GluedCertificate +import OAI.Analysis.CoulombTransport.CoulombLocalCertificate +import OAI.Analysis.CoulombTransport.CenterCertificate +import OAI.Analysis.CoulombTransport.CoulombEstimates + +namespace OAI + +noncomputable section +open Set Filter Metric +open scoped ENNReal InnerProductSpace + +namespace Problem356.FiveComponentGeometry + +open LocalGeometry StationaryMap CenterCertificate + +abbrev ChartsAt (a : E3) := + LocalSupportingCharts (jointPotential a) (stationary a) a (0, -a) + +/-- The actual five local potentials of the Coulomb construction, with the +same central quadratic for both branches. -/ +def potentials (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + Fin 5 → E3 → ℝ := + ![fun x => (5 : ℝ) / 2 - 10 * ‖x‖ ^ 2, + C₁.value, + fun z => (5 : ℝ) / 4 * ⟪point 1, z + point 1⟫_ℝ - 10 * ‖z + point 1‖ ^ 2, + C₂.value, + fun z => (5 : ℝ) / 4 * ⟪point 3, z + point 3⟫_ℝ - 10 * ‖z + point 3‖ ^ 2] + +/-- Preliminary domains are unrestricted for the polynomial potentials and +are the actual chart sources for the two supporting-value potentials. -/ +def domains (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : Fin 5 → Set E3 := + ![univ, C₁.charts.central.source, univ, C₂.charts.central.source, univ] + +lemma norm_point_one : ‖point 1‖ = 1 := by + change ‖(!₂[1, 0, 0] : E3)‖ = 1 + norm_num [point, EuclideanSpace.norm_eq, Fin.sum_univ_succ] + +lemma norm_point_three : ‖point 3‖ = 1 := by + change ‖(!₂[0, 1, 0] : E3)‖ = 1 + norm_num [point, EuclideanSpace.norm_eq, Fin.sum_univ_succ] + +lemma point_two_eq_neg : point 2 = -point 1 := by + change (!₂[-1, 0, 0] : E3) = -(!₂[1, 0, 0] : E3) + ext i + fin_cases i <;> norm_num [point] + +lemma point_four_eq_neg : point 4 = -point 3 := by + change (!₂[0, -1, 0] : E3) = -(!₂[0, 1, 0] : E3) + ext i + fin_cases i <;> norm_num [point] + +lemma domains_open (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + ∀ i, IsOpen (domains C₁ C₂ i) := by + intro i + fin_cases i + · exact isOpen_univ + · exact C₁.charts.central.open_source + · exact isOpen_univ + · exact C₂.charts.central.open_source + · exact isOpen_univ + +lemma point_mem_domains (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + ∀ i, point i ∈ domains C₁ C₂ i := by + intro i + fin_cases i + · exact mem_univ _ + · exact C₁.charts.point_mem + · exact mem_univ _ + · exact C₂.charts.point_mem + · exact mem_univ _ + +lemma continuousOn_potentials (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + ∀ i, ContinuousOn (potentials C₁ C₂ i) (domains C₁ C₂ i) := by + intro i + fin_cases i + · exact (by fun_prop : Continuous (fun x : E3 => (5 : ℝ) / 2 - 10 * ‖x‖ ^ 2)).continuousOn + · exact C₁.value_analytic.continuousOn + · exact (by fun_prop : Continuous (fun z : E3 => + (5 : ℝ) / 4 * ⟪point 1, z + point 1⟫_ℝ - 10 * ‖z + point 1‖ ^ 2)).continuousOn + · exact C₂.value_analytic.continuousOn + · exact (by fun_prop : Continuous (fun z : E3 => + (5 : ℝ) / 4 * ⟪point 3, z + point 3⟫_ℝ - 10 * ‖z + point 3‖ ^ 2)).continuousOn + +lemma potentials_center_values (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + ∀ i, potentials C₁ C₂ i (point i) = if i = 0 then (5 / 2 : ℝ) else 0 := by + intro i + fin_cases i + · norm_num [potentials, point] + · exact localSupporting_value_center norm_point_one C₁ + · change (5 : ℝ) / 4 * ⟪point 1, point 2 + point 1⟫_ℝ - + 10 * ‖point 2 + point 1‖ ^ 2 = 0 + rw [point_two_eq_neg] + simp + · exact localSupporting_value_center norm_point_three C₂ + · change (5 : ℝ) / 4 * ⟪point 3, point 4 + point 3⟫_ℝ - + 10 * ‖point 4 + point 3‖ ^ 2 = 0 + rw [point_four_eq_neg] + simp + +/-- The actual potentials have the strict bad-type gap supplied by the +finite center certificate. -/ +lemma strict_center_gap (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + (i j k : Fin 5) (h : ¬ Good i j k) : + ENNReal.ofReal (potentials C₁ C₂ i (point i) + + potentials C₁ C₂ j (point j) + potentials C₁ C₂ k (point k)) < + coulombCost (point i, (point j, point k)) := by + have he (l : Fin 5) : ENNReal.ofReal (potentials C₁ C₂ l (point l)) = potential l := by + rw [potentials_center_values] + by_cases hl : l = 0 + · simp only [hl, ite_eq_left, potential] + rw [ENNReal.ofReal_div_of_pos (by norm_num)] + norm_num + · simp [potential, hl] + have hn (l : Fin 5) : 0 ≤ potentials C₁ C₂ l (point l) := by + rw [potentials_center_values] + split_ifs <;> norm_num + rw [ENNReal.ofReal_add (add_nonneg (hn i) (hn j)) (hn k), + ENNReal.ofReal_add (hn i) (hn j), he i, he j, he k] + exact strict_of_not_good i j k h + +/-- The real local certificate has the exact extended-valued interpretation +on any collision-free triple in its three component balls. -/ +theorem ennreal_local_certificate {a : E3} (C : ChartsAt a) {x y z : E3} + (hy : y ∈ ball a C.parameterRadius) + (hx : x ∈ ball (0 : E3) C.stateRadius) + (hz : z ∈ ball (-a) C.stateRadius) + (hxy : 0 < dist x y) (hxz : 0 < dist x z) (hyz : 0 < dist y z) : + ENNReal.ofReal (((5 : ℝ) / 2 - 10 * ‖x‖ ^ 2) + C.value y + + ((5 : ℝ) / 4 * ⟪a, z + a⟫_ℝ - 10 * ‖z + a‖ ^ 2)) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (((5 : ℝ) / 2 - 10 * ‖x‖ ^ 2) + C.value y + + ((5 : ℝ) / 4 * ⟪a, z + a⟫_ℝ - 10 * ‖z + a‖ ^ 2)) = coulombCost (x, (y, z)) ↔ + x = C.charts.central y ∧ z = C.charts.opposite y) := by + let R : ℝ := ‖x - y‖⁻¹ + ‖x - z‖⁻¹ + ‖y - z‖⁻¹ + have hR : 0 ≤ R := by dsimp [R]; positivity + have hc : coulombCost (x, (y, z)) = ENNReal.ofReal R := by + simpa only [CoulombEstimates.realCost, dist_eq_norm] using + CoulombEstimates.coulombCost_eq_ofReal_realCost hxy hxz hyz + refine ⟨?_, ?_⟩ + · rw [hc] + exact ENNReal.ofReal_le_ofReal (local_coulomb_supporting C hy hx hz) + · constructor + · intro heq + have hs := (ENNReal.ofReal_pos.mp (heq.symm ▸ coulombCost_pos (x, (y, z)))).le + have heqR := (ENNReal.ofReal_eq_ofReal_iff hs hR).mp (heq.trans hc) + exact (local_coulomb_contact C hy hx hz).mp heqR.symm + · intro hbranch + have heqR := (local_coulomb_contact C hy hx hz).mpr hbranch + exact (congrArg ENNReal.ofReal heqR).symm.trans hc.symm + +/-- Symmetric union of the two actual local branch graphs. The parameter +remains in the corresponding chart source. -/ +def branchContact (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) (t : Triple) : Prop := + (∃ y ∈ C₁.charts.central.source, + List.Perm [t.1, t.2.1, t.2.2] [C₁.charts.central y, y, C₁.charts.opposite y]) ∨ + (∃ y ∈ C₂.charts.central.source, + List.Perm [t.1, t.2.1, t.2.2] [C₂.charts.central y, y, C₂.charts.opposite y]) + +lemma branchContact_perm (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + {x y z x' y' z' : E3} (hp : List.Perm [x, y, z] [x', y', z']) : + branchContact C₁ C₂ (x, (y, z)) ↔ branchContact C₁ C₂ (x', (y', z')) := by + constructor + · intro h + rcases h with ⟨w, hw, hperm⟩ | ⟨w, hw, hperm⟩ + · exact Or.inl ⟨w, hw, hp.symm.trans hperm⟩ + · exact Or.inr ⟨w, hw, hp.symm.trans hperm⟩ + · intro h + rcases h with ⟨w, hw, hperm⟩ | ⟨w, hw, hperm⟩ + · exact Or.inl ⟨w, hw, hp.trans hperm⟩ + · exact Or.inr ⟨w, hw, hp.trans hperm⟩ + +end Problem356.FiveComponentGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/FiveComponentGlobal.lean b/lean/OAI/Analysis/CoulombTransport/FiveComponentGlobal.lean new file mode 100644 index 0000000000000000000000000000000000000000..527d45803e63f5ecbe7dc928348dfa9fd9998012 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/FiveComponentGlobal.lean @@ -0,0 +1,134 @@ +import OAI.Analysis.CoulombTransport.FiveComponentGeometry +import OAI.Analysis.CoulombTransport.FiveComponentCanonical +import OAI.Analysis.CoulombTransport.GoodTypePermutation +import OAI.Analysis.CoulombTransport.GluedCertificateForward + +namespace OAI + +noncomputable section +open Set Filter Metric +open scoped ENNReal InnerProductSpace + +namespace Problem356.FiveComponentGeometry +open CenterCertificate GoodTypePermutation + +/-- The actual two canonical local certificates glue into one globally bounded +potential on the five disjoint component balls. -/ +theorem exists_global_certificate_of_canonical + (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + (W : Fin 5 → Set E3) (hW : ∀ i, IsOpen (W i)) + (hpW : ∀ i, point i ∈ W i) (hWD : ∀ i, W i ⊆ domains C₁ C₂ i) + (h012 : LocalTypeCertificate W (potentials C₁ C₂) (branchContact C₁ C₂) 0 1 2) + (h034 : LocalTypeCertificate W (potentials C₁ C₂) (branchContact C₁ C₂) 0 3 4) : + ∃ r M : ℝ, 0 < r ∧ 0 < M ∧ + let U := fun i => ball (point i) r + let u := ComponentPotential.glue U (potentials C₁ C₂) + (∀ i, U i ⊆ W i) ∧ + Pairwise (fun i j => Disjoint (U i) (U j)) ∧ + Measurable u ∧ ContinuousOn u (⋃ i, U i) ∧ (∀ x, |u x| ≤ M) ∧ + (∀ x ∈ ⋃ i, U i, ∀ y ∈ ⋃ i, U i, ∀ z ∈ ⋃ i, U i, + ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) → + branchContact C₁ C₂ (x, (y, z)))) := by + apply exists_glued_component_certificate_forward point point_injective W hW hpW + (potentials C₁ C₂) + (fun i => (continuousOn_potentials C₁ C₂ i).mono (hWD i)) + (fun a => Good a.1 a.2.1 a.2.2) (branchContact C₁ C₂) + · intro a ha + exact eventually_certificate_of_good point (fun i => (hW i).mem_nhds (hpW i)) + (fun hp hc => (branchContact_perm C₁ C₂ hp).mp hc) + h012 h034 a.1 a.2.1 a.2.2 ha + · intro a ha + exact strict_center_gap C₁ C₂ a.1 a.2.1 a.2.2 ha + +/-- Every collision-free raw branch triple saturates the local potential. -/ +lemma ennreal_graph_equality {a : E3} (C : ChartsAt a) {y : E3} + (hy : y ∈ C.charts.central.source) + (hxy : 0 < dist (C.charts.central y) y) + (hxz : 0 < dist (C.charts.central y) (C.charts.opposite y)) + (hyz : 0 < dist y (C.charts.opposite y)) : + ENNReal.ofReal (((5 : ℝ) / 2 - 10 * ‖C.charts.central y‖ ^ 2) + C.value y + + ((5 : ℝ) / 4 * ⟪a, C.charts.opposite y + a⟫_ℝ - + 10 * ‖C.charts.opposite y + a‖ ^ 2)) = + coulombCost (C.charts.central y, (y, C.charts.opposite y)) := by + have hs := C.charts.mapsTo_state hy + rw [C.state_ball, ← ball_prod_same] at hs + exact (ennreal_local_certificate C (C.source_ball ▸ hy) hs.1 hs.2 hxy hxz hyz).2.mpr + ⟨rfl, rfl⟩ + +private lemma ne_of_disjoint_components {U : Fin 5 → Set E3} + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + {i j : Fin 5} (hij : i ≠ j) {x y : E3} (hx : x ∈ U i) (hy : y ∈ U j) : + x ≠ y := by + intro h + subst y + exact Set.disjoint_left.mp (hdisj hij) hx hy + +/-- Saturation on the first raw branch, after gluing. -/ +theorem glued_saturation_left (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + {U : Fin 5 → Set E3} (hUD : ∀ i, U i ⊆ domains C₁ C₂ i) + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + {x y z : E3} (hx : x ∈ U 0) (hy : y ∈ U 1) (hz : z ∈ U 2) + (hX : x = C₁.charts.central y) (hZ : z = C₁.charts.opposite y) : + let u := ComponentPotential.glue U (potentials C₁ C₂) + ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) := by + dsimp only + rw [ComponentPotential.glue_eq hdisj hx, ComponentPotential.glue_eq hdisj hy, + ComponentPotential.glue_eq hdisj hz] + have hxy := dist_pos.mpr (ne_of_disjoint_components hdisj (by decide : (0 : Fin 5) ≠ 1) hx hy) + have hxz := dist_pos.mpr (ne_of_disjoint_components hdisj (by decide : (0 : Fin 5) ≠ 2) hx hz) + have hyz := dist_pos.mpr (ne_of_disjoint_components hdisj (by decide : (1 : Fin 5) ≠ 2) hy hz) + subst x + subst z + exact ennreal_graph_equality C₁ (hUD 1 hy) hxy hxz hyz + +/-- Saturation on the second raw branch, after gluing. -/ +theorem glued_saturation_right (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) + {U : Fin 5 → Set E3} (hUD : ∀ i, U i ⊆ domains C₁ C₂ i) + (hdisj : Pairwise (fun i j => Disjoint (U i) (U j))) + {x y z : E3} (hx : x ∈ U 0) (hy : y ∈ U 3) (hz : z ∈ U 4) + (hX : x = C₂.charts.central y) (hZ : z = C₂.charts.opposite y) : + let u := ComponentPotential.glue U (potentials C₁ C₂) + ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) := by + dsimp only + rw [ComponentPotential.glue_eq hdisj hx, ComponentPotential.glue_eq hdisj hy, + ComponentPotential.glue_eq hdisj hz] + have hxy := dist_pos.mpr (ne_of_disjoint_components hdisj (by decide : (0 : Fin 5) ≠ 3) hx hy) + have hxz := dist_pos.mpr (ne_of_disjoint_components hdisj (by decide : (0 : Fin 5) ≠ 4) hx hz) + have hyz := dist_pos.mpr (ne_of_disjoint_components hdisj (by decide : (3 : Fin 5) ≠ 4) hy hz) + subst x + subst z + exact ennreal_graph_equality C₂ (hUD 3 hy) hxy hxz hyz + +/-- The concrete two Coulomb charts admit a globally bounded measurable +certificate on five disjoint component balls, with contact only on their +actual symmetric graph union. -/ +theorem exists_global_certificate + (C₁ : ChartsAt (point 1)) (C₂ : ChartsAt (point 3)) : + ∃ r M : ℝ, 0 < r ∧ 0 < M ∧ + let U := fun i => ball (point i) r + let u := ComponentPotential.glue U (potentials C₁ C₂) + (∀ i, U i ⊆ domains C₁ C₂ i) ∧ + Pairwise (fun i j => Disjoint (U i) (U j)) ∧ + Measurable u ∧ ContinuousOn u (⋃ i, U i) ∧ (∀ x, |u x| ≤ M) ∧ + (∀ x ∈ ⋃ i, U i, ∀ y ∈ ⋃ i, U i, ∀ z ∈ ⋃ i, U i, + ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) → + branchContact C₁ C₂ (x, (y, z)))) := by + obtain ⟨W, hW, h012, h034⟩ := exists_canonical_neighborhoods C₁ C₂ + apply exists_glued_component_certificate_forward point point_injective + (domains C₁ C₂) (domains_open C₁ C₂) (point_mem_domains C₁ C₂) + (potentials C₁ C₂) (continuousOn_potentials C₁ C₂) + (fun a => Good a.1 a.2.1 a.2.2) (branchContact C₁ C₂) + · intro a ha + exact eventually_certificate_of_good point hW + (fun hp hc => (branchContact_perm C₁ C₂ hp).mp hc) + h012 h034 a.1 a.2.1 a.2.2 ha + · intro a ha + exact strict_center_gap C₁ C₂ a.1 a.2.1 a.2.2 ha + +end Problem356.FiveComponentGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/FiveComponentSelection.lean b/lean/OAI/Analysis/CoulombTransport/FiveComponentSelection.lean new file mode 100644 index 0000000000000000000000000000000000000000..b34e89db42d75eb1a29588d9f78293cd5a833790 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/FiveComponentSelection.lean @@ -0,0 +1,37 @@ +import OAI.Analysis.CoulombTransport.FiveComponentGeometry +import OAI.Analysis.CoulombTransport.ContactCommonBranches + +namespace OAI + +noncomputable section +open Set + +namespace Problem356.FiveComponentGeometry + +/-- The actual symmetric two-graph contact relation yields the exact selector +needed by the final construction. Graph-wide outer exclusions are supplied by +`CoulombSupportExistence.exists_separated_shrink`; the final central ball can +be any subset of the excluded central neighborhood. -/ +theorem second_selects_four_of_excluded_charts + (C₁ : ChartsAt (CenterCertificate.point 1)) + (C₂ : ChartsAt (CenterCertificate.point 3)) + {B V : Set E3} (hB : B ⊆ V) + (houter₁ : ∀ s ∈ C₁.charts.central.source, s ∉ V ∧ C₁.charts.opposite s ∉ V) + (houter₂ : ∀ s ∈ C₂.charts.central.source, s ∉ V ∧ C₂.charts.opposite s ∉ V) + {x y z : E3} (hx : x ∈ B) (hc : branchContact C₁ C₂ (x, (y, z))) : + ∃ i : Fin 4, y = CommonBranches.four + ![C₁.charts.central, C₂.charts.central] + ![C₁.charts.opposite, C₂.charts.opposite] i x := by + rcases hc with ⟨s, hs, hp⟩ | ⟨s, hs, hp⟩ + · have ho := houter₁ s hs + exact ContactSelection.second_selects_common_four _ _ (k := 0) hp hx hs + (fun h => ho.1 (hB h)) (fun h => ho.2 (hB h)) + · have ho := houter₂ s hs + exact ContactSelection.second_selects_common_four _ _ (k := 1) hp hx hs + (fun h => ho.1 (hB h)) (fun h => ho.2 (hB h)) + +end Problem356.FiveComponentGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/GeometryJets.lean b/lean/OAI/Analysis/CoulombTransport/GeometryJets.lean new file mode 100644 index 0000000000000000000000000000000000000000..347ee37d799632e6b4b0def3d87c1c935670b925 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/GeometryJets.lean @@ -0,0 +1,123 @@ +import OAI.Analysis.CoulombTransport.CoulombCalculus + +namespace OAI + +universe uE + +noncomputable section + +open scoped RealInnerProductSpace + +namespace Problem356.GeometryJets + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The derivative interface supplied by the inverse-norm calculus. -/ +def KernelDerivative : Prop := + ∀ b : E, b ≠ 0 → HasFDerivAt (fun v : E => ‖v‖⁻¹) + ((-(‖b‖ ^ 3)⁻¹) • innerSL ℝ b) b + +private theorem kernelDerivative : KernelDerivative (E := E) := by + intro b hb + exact CoulombCalculus.hasFDerivAt_pairCost hb + +omit [InnerProductSpace ℝ E] in +theorem center_nonzero {a : E} (ha : ‖a‖ = 1) : a ≠ 0 := by + intro h + simp [h] at ha + +/-- The two opposite outer centers cancel the derivative in the central coordinate. -/ +theorem hasFDerivAt_center_x + (a : E) (ha : ‖a‖ = 1) : + HasFDerivAt + (fun x : E => ‖x - a‖⁻¹ + ‖x - (-a)‖⁻¹ + ‖a - (-a)‖⁻¹) + (0 : E →L[ℝ] ℝ) (0 : E) := by + have ha0 := center_nonzero ha + have hneg : -a ≠ 0 := neg_ne_zero.mpr ha0 + have h1 := (kernelDerivative (0 - a) (by simpa using hneg)).comp (0 : E) + ((hasFDerivAt_id (0 : E)).sub_const a) + have h2 := (kernelDerivative (0 - (-a)) (by simpa using ha0)).comp (0 : E) + ((hasFDerivAt_id (0 : E)).sub_const (-a)) + have hs := (h1.add h2).add_const (‖a - (-a)‖⁻¹) + simpa [ha, innerSL, ContinuousLinearMap.comp_id] using hs + +/-- The derivative in the negative outer coordinate at an opposite unit pair. -/ +theorem hasFDerivAt_center_z + (a : E) (ha : ‖a‖ = 1) : + HasFDerivAt + (fun z : E => ‖(0 : E) - a‖⁻¹ + ‖(0 : E) - z‖⁻¹ + ‖a - z‖⁻¹) + ((5 / 4 : ℝ) • innerSL ℝ a) (-a) := by + have ha0 := center_nonzero ha + have hneg : -a ≠ 0 := neg_ne_zero.mpr ha0 + have hvec : -a - a = (-2 : ℝ) • a := by module + have hnorm : ‖-a - a‖ = 2 := by rw [hvec, norm_smul, ha]; norm_num + have hdouble : -a - a ≠ 0 := by + intro heq + simp [heq] at hnorm + have h1 := kernelDerivative (-a) hneg + have h2 := (kernelDerivative (-a - a) hdouble).comp (-a) + ((hasFDerivAt_id (-a)).sub_const a) + have hs := ((hasFDerivAt_const (‖a‖⁻¹) (-a)).add h1).add h2 + convert! hs using 1 + · ext z + simp [norm_sub_rev] + · ext v + simp [hvec, norm_smul, ha, innerSL] + ring + +/-- Joint state derivative, with the positive outer coordinate held fixed. -/ +theorem hasFDerivAt_center_state + (a : E) (ha : ‖a‖ = 1) : + HasFDerivAt + (fun p : E × E => ‖p.1 - a‖⁻¹ + ‖p.1 - p.2‖⁻¹ + ‖a - p.2‖⁻¹) + ((5 / 4 : ℝ) • (innerSL ℝ a).comp (ContinuousLinearMap.snd ℝ E E)) + (0, -a) := by + have ha0 := center_nonzero ha + have hneg : -a ≠ 0 := neg_ne_zero.mpr ha0 + have hvec : a - -a = (2 : ℝ) • a := by module + have hnorm : ‖a - -a‖ = 2 := by rw [hvec, norm_smul, ha]; norm_num + have hdouble : a - -a ≠ 0 := by + intro heq + simp [heq] at hnorm + have hf : HasFDerivAt (fun p : E × E => p.1) + (ContinuousLinearMap.fst ℝ E E) (0, -a) := hasFDerivAt_fst + have hz : HasFDerivAt (fun p : E × E => p.2) + (ContinuousLinearMap.snd ℝ E E) (0, -a) := hasFDerivAt_snd + have h1 := (kernelDerivative (0 - a) (by simpa using hneg)).comp (0, -a) + (hf.sub_const a) + have h2 := (kernelDerivative (0 - -a) (by simpa using ha0)).comp (0, -a) + (hf.sub hz) + have h3 := (kernelDerivative (a - -a) hdouble).comp (0, -a) + (hz.const_sub a) + convert! (h1.add h2).add h3 using 1 + apply ContinuousLinearMap.ext + intro p + simp [hvec, norm_smul, ha, innerSL] + ring + +/-- Subtracting the common central and negative outer potentials makes the center stationary. -/ +theorem hasFDerivAt_center_stationary + (a : E) (ha : ‖a‖ = 1) (K : ℝ) : + HasFDerivAt + (fun p : E × E => + (‖p.1 - a‖⁻¹ + ‖p.1 - p.2‖⁻¹ + ‖a - p.2‖⁻¹) - + ((5 / 2 : ℝ) - K / 2 * ‖p.1‖ ^ 2) - + ((5 / 4 : ℝ) * inner ℝ a (p.2 + a) - K / 2 * ‖p.2 + a‖ ^ 2)) + (0 : (E × E) →L[ℝ] ℝ) (0, -a) := by + have hf : HasFDerivAt (fun p : E × E => p.1) + (ContinuousLinearMap.fst ℝ E E) (0, -a) := hasFDerivAt_fst + have hz : HasFDerivAt (fun p : E × E => p.2) + (ContinuousLinearMap.snd ℝ E E) (0, -a) := hasFDerivAt_snd + have hu := (hf.norm_sq.const_mul (K / 2)).const_sub (5 / 2) + have hza := hz.add_const a + have hv1 := ((innerSL ℝ a).hasFDerivAt.comp (0, -a) hza).const_mul (5 / 4) + have hv2 := hza.norm_sq.const_mul (K / 2) + have hs := ((hasFDerivAt_center_state a ha).sub hu).sub (hv1.sub hv2) + convert! hs using 1 + simp + +end Problem356.GeometryJets + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/GluedCertificate.lean b/lean/OAI/Analysis/CoulombTransport/GluedCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6d7919af7391f80731f1b57b9b7a7cf80fd2341 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/GluedCertificate.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.CoulombTransport.ComponentCertificate +import OAI.Analysis.CoulombTransport.LocalPotentialBounds +import OAI.Analysis.CoulombTransport.NeighborhoodCertificate + +namespace OAI + +universe uIndex + +noncomputable section +open Set Filter Metric +open scoped ENNReal BigOperators + +namespace Problem356 + +/-- A contact triple on a finite union, with its ordered component labels. -/ +def componentContact {ι : Type uIndex} (U : ι → Set E3) + (Good : (ι × (ι × ι)) → Prop) + (Contact : (ι × (ι × ι)) → Triple → Prop) (t : Triple) : Prop := + ∃ a, t.1 ∈ U a.1 ∧ t.2.1 ∈ U a.2.1 ∧ t.2.2 ∈ U a.2.2 ∧ + Good a ∧ Contact a t + +/-- Local good-type certificates and strict bad-center gaps produce an actual +bounded, measurable supporting potential on disjoint small component balls, +with the precise union of the prescribed contact sets. -/ +theorem exists_glued_component_certificate {ι : Type uIndex} [Fintype ι] + (p : ι → E3) (hp : Function.Injective p) + (V : ι → Set E3) (hV : ∀ i, IsOpen (V i)) (hpV : ∀ i, p i ∈ V i) + (v : ι → E3 → ℝ) (hv : ∀ i, ContinuousOn (v i) (V i)) + (Good : (ι × (ι × ι)) → Prop) + (Contact : (ι × (ι × ι)) → Triple → Prop) + (hgood : ∀ a, Good a → ∀ᶠ t in nhds (p a.1, (p a.2.1, p a.2.2)), + ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) = + coulombCost t ↔ Contact a t)) + (hbad : ∀ a, ¬ Good a → + ENNReal.ofReal (v a.1 (p a.1) + v a.2.1 (p a.2.1) + v a.2.2 (p a.2.2)) < + coulombCost (p a.1, (p a.2.1, p a.2.2))) : + ∃ r M : ℝ, 0 < r ∧ 0 < M ∧ + let U := fun i => ball (p i) r + let u := ComponentPotential.glue U v + (∀ i, U i ⊆ V i) ∧ + Pairwise (fun i j => Disjoint (U i) (U j)) ∧ + Measurable u ∧ ContinuousOn u (⋃ i, U i) ∧ (∀ x, |u x| ≤ M) ∧ + (∀ x ∈ ⋃ i, U i, ∀ y ∈ ⋃ i, U i, ∀ z ∈ ⋃ i, U i, + ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) ↔ + componentContact U Good Contact (x, (y, z)))) := by + classical + have hvAt : ∀ i, ContinuousAt (v i) (p i) := + fun i => (hv i).continuousAt ((hV i).mem_nhds (hpV i)) + obtain ⟨rC, hrC, hcert⟩ := finite_component_certificate p v Good Contact hvAt hgood hbad + obtain ⟨M, hM, rB, hrB, hbound⟩ := exists_uniform_local_potential_bound p v hvAt + obtain ⟨rV, hrV, hsubV, hdisjV⟩ := + Geometry.finite_disjoint_closedBalls_subset p hp V hV hpV + let r : ℝ := min rC (min rB rV) + have hr : 0 < r := lt_min hrC (lt_min hrB hrV) + have hrC' : r ≤ rC := min_le_left _ _ + have hrB' : r ≤ rB := (min_le_right _ _).trans (min_le_left _ _) + have hrV' : r ≤ rV := (min_le_right _ _).trans (min_le_right _ _) + let U : ι → Set E3 := fun i => ball (p i) r + have hUV : ∀ i, U i ⊆ V i := by + intro i + exact (ball_subset_closedBall.trans (closedBall_subset_closedBall hrV')).trans (hsubV i) + have hUdisj : Pairwise (fun i j => Disjoint (U i) (U j)) := by + intro i j hij + exact (hdisjV hij).mono + (ball_subset_closedBall.trans (closedBall_subset_closedBall hrV')) + (ball_subset_closedBall.trans (closedBall_subset_closedBall hrV')) + have huCont : ∀ i, ContinuousOn (v i) (U i) := fun i => (hv i).mono (hUV i) + have hUbound : ∀ i, ∀ x ∈ U i, |v i x| ≤ M := by + intro i x hx + exact hbound i x (ball_subset_ball hrB' hx) + refine ⟨r, M, hr, hM, hUV, hUdisj, ?_, ?_, ?_, ?_⟩ + · exact ComponentPotential.measurable_glue (fun _ => isOpen_ball.measurableSet) huCont + · exact ComponentPotential.continuousOn_glue (fun _ => isOpen_ball) hUdisj huCont + · exact ComponentPotential.abs_glue_le hM.le hUdisj hUbound + · intro x hx y hy z hz + obtain ⟨i, hi⟩ := mem_iUnion.mp hx + obtain ⟨j, hj⟩ := mem_iUnion.mp hy + obtain ⟨k, hk⟩ := mem_iUnion.mp hz + have hc := hcert (i, (j, k)) x y z + (ball_subset_ball hrC' hi) (ball_subset_ball hrC' hj) (ball_subset_ball hrC' hk) + rw [ComponentPotential.glue_eq hUdisj hi, ComponentPotential.glue_eq hUdisj hj, + ComponentPotential.glue_eq hUdisj hk] + refine ⟨hc.1, ?_⟩ + constructor + · intro heq + exact ⟨(i, (j, k)), hi, hj, hk, (hc.2.mp heq).1, (hc.2.mp heq).2⟩ + · rintro ⟨a, ha₁, ha₂, ha₃, hgooda, hcontact⟩ + have heq := (hcert a x y z (ball_subset_ball hrC' ha₁) + (ball_subset_ball hrC' ha₂) (ball_subset_ball hrC' ha₃)).2.mpr ⟨hgooda, hcontact⟩ + have hxv : v a.1 x = v i x := by + rw [← ComponentPotential.glue_eq (u := v) hUdisj ha₁, ComponentPotential.glue_eq hUdisj hi] + have hyv : v a.2.1 y = v j y := by + rw [← ComponentPotential.glue_eq (u := v) hUdisj ha₂, ComponentPotential.glue_eq hUdisj hj] + have hzv : v a.2.2 z = v k z := by + rw [← ComponentPotential.glue_eq (u := v) hUdisj ha₃, ComponentPotential.glue_eq hUdisj hk] + simpa only [hxv, hyv, hzv] using heq + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/GluedCertificateForward.lean b/lean/OAI/Analysis/CoulombTransport/GluedCertificateForward.lean new file mode 100644 index 0000000000000000000000000000000000000000..493a4fbe405f359a19616b3beb5363687287528e --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/GluedCertificateForward.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.CoulombTransport.GluedCertificate + +namespace OAI + +universe uIndex + +noncomputable section +open Set Filter Metric +open scoped ENNReal BigOperators + +namespace Problem356 + +/-- The finite gluing construction only needs forward contact localization. +The explicit contact candidates may be shown saturated separately, so no +converse from the chosen global contact predicate is required here. -/ +theorem exists_glued_component_certificate_forward {ι : Type uIndex} [Fintype ι] + (p : ι → E3) (hp : Function.Injective p) + (V : ι → Set E3) (hV : ∀ i, IsOpen (V i)) (hpV : ∀ i, p i ∈ V i) + (v : ι → E3 → ℝ) (hv : ∀ i, ContinuousOn (v i) (V i)) + (Good : (ι × (ι × ι)) → Prop) (Contact : Triple → Prop) + (hgood : ∀ a, Good a → ∀ᶠ t in nhds (p a.1, (p a.2.1, p a.2.2)), + ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) = + coulombCost t → Contact t)) + (hbad : ∀ a, ¬ Good a → + ENNReal.ofReal (v a.1 (p a.1) + v a.2.1 (p a.2.1) + v a.2.2 (p a.2.2)) < + coulombCost (p a.1, (p a.2.1, p a.2.2))) : + ∃ r M : ℝ, 0 < r ∧ 0 < M ∧ + let U := fun i => ball (p i) r + let u := ComponentPotential.glue U v + (∀ i, U i ⊆ V i) ∧ + Pairwise (fun i j => Disjoint (U i) (U j)) ∧ + Measurable u ∧ ContinuousOn u (⋃ i, U i) ∧ (∀ x, |u x| ≤ M) ∧ + (∀ x ∈ ⋃ i, U i, ∀ y ∈ ⋃ i, U i, ∀ z ∈ ⋃ i, U i, + ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) → + Contact (x, (y, z)))) := by + let C : (ι × (ι × ι)) → Triple → Prop := fun a t => + ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) = coulombCost t ∧ + Contact t + have hgood' : ∀ a, Good a → ∀ᶠ t in nhds (p a.1, (p a.2.1, p a.2.2)), + ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (v a.1 t.1 + v a.2.1 t.2.1 + v a.2.2 t.2.2) = + coulombCost t ↔ C a t) := by + intro a ha + filter_upwards [hgood a ha] with t ht + exact ⟨ht.1, ⟨fun heq => ⟨heq, ht.2 heq⟩, fun hc => hc.1⟩⟩ + obtain ⟨r, M, hr, hM, hUV, hdisj, hmeas, hcont, hbound, hcert⟩ := + exists_glued_component_certificate p hp V hV hpV v hv Good C hgood' hbad + refine ⟨r, M, hr, hM, hUV, hdisj, hmeas, hcont, hbound, ?_⟩ + intro x hx y hy z hz + have hc := hcert x hx y hy z hz + refine ⟨hc.1, ?_⟩ + intro heq + obtain ⟨a, _, _, _, _, hcontact⟩ := hc.2.mp heq + exact hcontact.2 + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/GoodTypePermutation.lean b/lean/OAI/Analysis/CoulombTransport/GoodTypePermutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ffaacf72287ba82e856e95c11dac7c07f06a26b --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/GoodTypePermutation.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.CoulombTransport.CenterCertificate +import OAI.Analysis.CoulombTransport.TriplePermutation + +namespace OAI + +noncomputable section +open scoped ENNReal + +namespace Problem356.GoodTypePermutation + +/-- A supporting certificate on an ordered component product, with the +one-way contact localization needed for excluding deterministic optimizers. -/ +def LocalTypeCertificate (U : Fin 5 → Set E3) (v : Fin 5 → E3 → ℝ) + (Contact : Triple → Prop) (i j k : Fin 5) : Prop := + ∀ x ∈ U i, ∀ y ∈ U j, ∀ z ∈ U k, + ENNReal.ofReal (v i x + v j y + v k z) ≤ coulombCost (x, (y, z)) ∧ + (ENNReal.ofReal (v i x + v j y + v k z) = coulombCost (x, (y, z)) → + Contact (x, (y, z))) + +variable {U : Fin 5 → Set E3} {v : Fin 5 → E3 → ℝ} + {Contact : Triple → Prop} + +/-- Contact localization is transported along a swap of the first two entries. -/ +theorem LocalTypeCertificate.swap_first {i j k : Fin 5} + (h : LocalTypeCertificate U v Contact i j k) + (hperm : ∀ {x y z a b c : E3}, List.Perm [x, y, z] [a, b, c] → + Contact (x, (y, z)) → Contact (a, (b, c))) : + LocalTypeCertificate U v Contact j i k := by + intro x hx y hy z hz + have hc := h y hy x hx z hz + rw [add_comm (v i y) (v j x), TriplePermutation.cost_swap_first y x z] at hc + exact ⟨hc.1, fun heq => hperm (List.Perm.swap x y [z]) (hc.2 heq)⟩ + +/-- Contact localization is transported along a swap of the last two entries. -/ +theorem LocalTypeCertificate.swap_last {i j k : Fin 5} + (h : LocalTypeCertificate U v Contact i j k) + (hperm : ∀ {x y z a b c : E3}, List.Perm [x, y, z] [a, b, c] → + Contact (x, (y, z)) → Contact (a, (b, c))) : + LocalTypeCertificate U v Contact i k j := by + intro x hx y hy z hz + have hc := h x hx z hz y hy + have hsum : v i x + v j z + v k y = v i x + v k y + v j z := by ac_rfl + rw [hsum, TriplePermutation.cost_swap_last x z y] at hc + exact ⟨hc.1, fun heq => hperm ((List.Perm.swap y z []).cons x) (hc.2 heq)⟩ + +/-- The two canonical component orders supply every good component type. +No converse from the abstract contact predicate to equality is assumed. -/ +theorem certificate_of_good + (hperm : ∀ {x y z a b c : E3}, List.Perm [x, y, z] [a, b, c] → + Contact (x, (y, z)) → Contact (a, (b, c))) + (h012 : LocalTypeCertificate U v Contact 0 1 2) + (h034 : LocalTypeCertificate U v Contact 0 3 4) + (i j k : Fin 5) (hgood : CenterCertificate.Good i j k) : + LocalTypeCertificate U v Contact i j k := by + have h102 := h012.swap_first hperm + have h021 := h012.swap_last hperm + have h120 := h102.swap_last hperm + have h201 := h021.swap_first hperm + have h210 := h201.swap_last hperm + have h304 := h034.swap_first hperm + have h043 := h034.swap_last hperm + have h340 := h304.swap_last hperm + have h403 := h043.swap_first hperm + have h430 := h403.swap_last hperm + fin_cases i <;> fin_cases j <;> fin_cases k + all_goals first | assumption | (exfalso; revert hgood; unfold CenterCertificate.Good; decide) + +/-- Neighborhood form directly usable by a finite component gluing argument. -/ +theorem eventually_certificate_of_good + (p : Fin 5 → E3) (hU : ∀ i, U i ∈ nhds (p i)) + (hperm : ∀ {x y z a b c : E3}, List.Perm [x, y, z] [a, b, c] → + Contact (x, (y, z)) → Contact (a, (b, c))) + (h012 : LocalTypeCertificate U v Contact 0 1 2) + (h034 : LocalTypeCertificate U v Contact 0 3 4) + (i j k : Fin 5) (hgood : CenterCertificate.Good i j k) : + ∀ᶠ t : Triple in nhds (p i, (p j, p k)), + ENNReal.ofReal (v i t.1 + v j t.2.1 + v k t.2.2) ≤ coulombCost t ∧ + (ENNReal.ofReal (v i t.1 + v j t.2.1 + v k t.2.2) = coulombCost t → + Contact t) := by + have h1 : ∀ᶠ t : Triple in nhds (p i, (p j, p k)), t.1 ∈ U i := + (continuous_fst.tendsto _).eventually (hU i) + have h2 : ∀ᶠ t : Triple in nhds (p i, (p j, p k)), t.2.1 ∈ U j := + ((continuous_fst.comp continuous_snd).tendsto _).eventually (hU j) + have h3 : ∀ᶠ t : Triple in nhds (p i, (p j, p k)), t.2.2 ∈ U k := + ((continuous_snd.comp continuous_snd).tendsto _).eventually (hU k) + filter_upwards [h1, h2, h3] with t ht1 ht2 ht3 + exact certificate_of_good hperm h012 h034 i j k hgood + t.1 ht1 t.2.1 ht2 t.2.2 ht3 + +end Problem356.GoodTypePermutation + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/GraphBridge.lean b/lean/OAI/Analysis/CoulombTransport/GraphBridge.lean new file mode 100644 index 0000000000000000000000000000000000000000..728d91a0e60ac903befe164becf30d3dcff37abc --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/GraphBridge.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +lemma measurable_tripleFst : Measurable tripleFst := measurable_fst +lemma measurable_tripleSnd : Measurable tripleSnd := measurable_fst.comp measurable_snd +lemma measurable_tripleThd : Measurable tripleThd := measurable_snd.comp measurable_snd + +lemma measurable_invDistance : Measurable (fun p : E3 × E3 => invDistance p.1 p.2) := by + unfold invDistance + exact ((measurable_fst.sub measurable_snd).norm.ennreal_ofReal).inv + +lemma measurable_coulombCost : Measurable coulombCost := by + unfold coulombCost + exact ((measurable_invDistance.comp (measurable_tripleFst.prodMk measurable_tripleSnd)).add + (measurable_invDistance.comp (measurable_tripleFst.prodMk measurable_tripleThd))).add + (measurable_invDistance.comp (measurable_tripleSnd.prodMk measurable_tripleThd)) + +def graphMap (T2 T3 : E3 → E3) (x : E3) : Triple := (x, (T2 x, T3 x)) + +def graphMeasure (mu : Measure E3) (T2 T3 : E3 → E3) : Measure Triple := + Measure.map (graphMap T2 T3) mu + +lemma measurable_graphMap {T2 T3 : E3 → E3} (h2 : Measurable T2) (h3 : Measurable T3) : + Measurable (graphMap T2 T3) := measurable_id.prodMk (h2.prodMk h3) + +lemma graphMeasure_isThreeCoupling (mu : Measure E3) [IsProbabilityMeasure mu] + {T2 T3 : E3 → E3} (h2 : Preserves mu T2) (h3 : Preserves mu T3) : + IsThreeCoupling mu (graphMeasure mu T2 T3) := by + have hm := measurable_graphMap h2.1 h3.1 + refine ⟨(Measure.isProbabilityMeasure_map_iff hm.aemeasurable).mpr inferInstance, + ?_, ?_, ?_⟩ + · rw [graphMeasure, Measure.map_map measurable_tripleFst hm] + change Measure.map id mu = mu + exact Measure.map_id + · rw [graphMeasure, Measure.map_map measurable_tripleSnd hm] + exact h2.2 + · rw [graphMeasure, Measure.map_map measurable_tripleThd hm] + exact h3.2 + +lemma lintegral_graphMeasure (mu : Measure E3) {T2 T3 : E3 → E3} + (h2 : Measurable T2) (h3 : Measurable T3) : + (∫⁻ t, coulombCost t ∂graphMeasure mu T2 T3) = graphCost mu T2 T3 := by + exact lintegral_map measurable_coulombCost (measurable_graphMap h2 h3) + +lemma kantorovichValue_le_graphCost (mu : Measure E3) [IsProbabilityMeasure mu] + {T2 T3 : E3 → E3} (h2 : Preserves mu T2) (h3 : Preserves mu T3) : + kantorovichValue mu ≤ graphCost mu T2 T3 := by + rw [← lintegral_graphMeasure mu h2.1 h3.1] + exact iInf₂_le (graphMeasure mu T2 T3) (graphMeasure_isThreeCoupling mu h2 h3) + +lemma kantorovichValue_le_mongeValue (mu : Measure E3) [IsProbabilityMeasure mu] : + kantorovichValue mu ≤ mongeValue mu := by + unfold mongeValue + exact le_iInf fun T2 => le_iInf fun T3 => le_iInf fun h2 => le_iInf fun h3 => + kantorovichValue_le_graphCost mu h2 h3 + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/HessianCLM.lean b/lean/OAI/Analysis/CoulombTransport/HessianCLM.lean new file mode 100644 index 0000000000000000000000000000000000000000..63b37ad7af0b39a159542d4de91b0c641c83b20a --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/HessianCLM.lean @@ -0,0 +1,187 @@ +import OAI.Analysis.CoulombTransport.AxisHessian + +namespace OAI + +universe uN + +noncomputable section + +namespace Problem356.LocalHessian + +open Matrix +open scoped RealInnerProductSpace + +/-- Invertible matrices induce invertible continuous linear maps in Euclidean coordinates. -/ +lemma toEuclideanCLM_isInvertible {n : Type uN} [Fintype n] [DecidableEq n] + (A : Matrix n n ℝ) (hA : IsUnit A) : + (Matrix.toEuclideanCLM (n := n) (𝕜 := ℝ) A).IsInvertible := by + obtain ⟨u, hu⟩ := hA.map (Matrix.toEuclideanCLM (n := n) (𝕜 := ℝ)).toMonoidHom + exact ⟨ContinuousLinearEquiv.ofUnit u, hu⟩ + +abbrev AxisSpace := EuclideanSpace ℝ (Fin 3) +abbrev StateSpace := AxisSpace × AxisSpace +abbrev JointSpace := EuclideanSpace ℝ (Fin 3 ⊕ Fin 3) + +/-- Passing from sum coordinates to the product coordinates used by the implicit function theorem. -/ +def stateCoordinates : JointSpace ≃L[ℝ] StateSpace := EuclideanSpace.sumEquivProd + +/-- The regularized state derivative as a continuous linear map on product space. -/ +def stateOperator (k : Fin 3) : StateSpace →L[ℝ] StateSpace := + stateCoordinates.toContinuousLinearMap ∘L + (Matrix.toEuclideanCLM (n := Fin 3 ⊕ Fin 3) (𝕜 := ℝ) (regularizedHessian k)) ∘L + stateCoordinates.symm.toContinuousLinearMap + +lemma stateOperator_isInvertible (k : Fin 3) : (stateOperator k).IsInvertible := by + exact ContinuousLinearMap.IsInvertible.comp + (ContinuousLinearMap.isInvertible_equiv (f := stateCoordinates)) + (ContinuousLinearMap.IsInvertible.comp + (toEuclideanCLM_isInvertible _ (regularizedHessian_isUnit k)) + (ContinuousLinearMap.isInvertible_equiv (f := stateCoordinates.symm))) + +lemma centralDerivativeCLM_isInvertible (k : Fin 3) : + (Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ) (centralDerivative k)).IsInvertible := + toEuclideanCLM_isInvertible _ (centralDerivative_isUnit k) + +lemma oppositeDerivativeCLM_isInvertible (k : Fin 3) : + (Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ) (oppositeDerivative k)).IsInvertible := + toEuclideanCLM_isInvertible _ (oppositeDerivative_isUnit k) + +lemma regularizedHessian_coercive (k : Fin 3) (v : JointSpace) : + 16 * ‖v‖ ^ 2 ≤ ⟪v, Matrix.toEuclideanCLM (n := Fin 3 ⊕ Fin 3) (𝕜 := ℝ) (regularizedHessian k) v⟫ := by + rw [Matrix.inner_toEuclideanCLM] + have hq := regularizedHessian_quadratic k (WithLp.ofLp v) + simp only [star_trivial] at hq + rw [hq, EuclideanSpace.real_norm_sq_eq, Fintype.sum_sum_type, + mul_add, Finset.mul_sum, Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro i hi + simpa only [mul_add] using + (scalar_quadratic_coercive (x := v (Sum.inl i)) (z := v (Sum.inr i)) + (eigenvalue_cases k i)) + +@[simp] lemma stateCoordinates_symm_inl (v : StateSpace) (i : Fin 3) : + stateCoordinates.symm v (Sum.inl i) = v.1 i := rfl + +@[simp] lemma stateCoordinates_symm_inr (v : StateSpace) (i : Fin 3) : + stateCoordinates.symm v (Sum.inr i) = v.2 i := rfl + +lemma stateOperator_fst_apply (k : Fin 3) (v : StateSpace) (i : Fin 3) : + (stateOperator k v).1 i = + (20 + 2 * eigenvalue k i) * v.1 i - eigenvalue k i * v.2 i := by + change ((regularizedHessian k) *ᵥ (WithLp.ofLp (stateCoordinates.symm v))) + (Sum.inl i) = _ + rw [regularizedHessian, fromBlocks_mulVec] + simp [upperBlock, mixedBlock, mulVec_diagonal, sub_eq_add_neg] + +lemma stateOperator_snd_apply (k : Fin 3) (v : StateSpace) (i : Fin 3) : + (stateOperator k v).2 i = + -eigenvalue k i * v.1 i + (20 + (9 / 8) * eigenvalue k i) * v.2 i := by + change ((regularizedHessian k) *ᵥ (WithLp.ofLp (stateCoordinates.symm v))) + (Sum.inr i) = _ + rw [regularizedHessian, fromBlocks_mulVec] + simp [lowerBlock, mixedBlock, mulVec_diagonal] + +lemma stateOperator_joint_coercive (k : Fin 3) (v : StateSpace) : + 16 * (‖v.1‖ ^ 2 + ‖v.2‖ ^ 2) ≤ + ⟪v.1, (stateOperator k v).1⟫ + ⟪v.2, (stateOperator k v).2⟫ := by + simp only [EuclideanSpace.real_norm_sq_eq, EuclideanSpace.inner_eq_star_dotProduct, + dotProduct, star_trivial, stateOperator_fst_apply, stateOperator_snd_apply, + mul_add, Finset.mul_sum] + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_le_sum + intro i hi + have h := scalar_quadratic_coercive (x := v.1 i) (z := v.2 i) (eigenvalue_cases k i) + nlinarith + +lemma stateOperator_coercive (k : Fin 3) (v : StateSpace) : + 16 * ‖v‖ ^ 2 ≤ + ⟪v.1, (stateOperator k v).1⟫ + ⟪v.2, (stateOperator k v).2⟫ := by + have hn : ‖v‖ ^ 2 ≤ ‖v.1‖ ^ 2 + ‖v.2‖ ^ 2 := by + rw [Prod.norm_def] + rcases le_total ‖v.1‖ ‖v.2‖ with h | h + · rw [max_eq_right h] + nlinarith [sq_nonneg ‖v.1‖] + · rw [max_eq_left h] + nlinarith [sq_nonneg ‖v.2‖] + nlinarith [stateOperator_joint_coercive k v] + +/-- The derivative in the parameter variable at the center. -/ +def parameterOperator (k : Fin 3) : AxisSpace →L[ℝ] StateSpace := + let Q := Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ) (pairHessian k) + (-Q).prod ((-(1 / 8 : ℝ)) • Q) + +/-- The derivative of the stationary branch: central and opposite components. -/ +def branchOperator (k : Fin 3) : AxisSpace →L[ℝ] StateSpace := + (Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ) (centralDerivative k)).prod + (Matrix.toEuclideanCLM (n := Fin 3) (𝕜 := ℝ) (oppositeDerivative k)) + +@[simp] lemma branchOperator_fst_apply (k : Fin 3) (v : AxisSpace) (i : Fin 3) : + (branchOperator k v).1 i = (if i = k then 9 / 106 else -15 / 271) * v i := by + change ((centralDerivative k) *ᵥ WithLp.ofLp v) i = _ + simp [centralDerivative, mulVec_diagonal] + +@[simp] lemma branchOperator_snd_apply (k : Fin 3) (v : AxisSpace) (i : Fin 3) : + (branchOperator k v).2 i = (if i = k then 1 / 53 else -1 / 271) * v i := by + change ((oppositeDerivative k) *ᵥ WithLp.ofLp v) i = _ + simp [oppositeDerivative, mulVec_diagonal] + +@[simp] lemma parameterOperator_fst_apply (k : Fin 3) (v : AxisSpace) (i : Fin 3) : + (parameterOperator k v).1 i = -eigenvalue k i * v i := by + change -(((pairHessian k) *ᵥ WithLp.ofLp v) i) = _ + simp [pairHessian, mulVec_diagonal] + +@[simp] lemma parameterOperator_snd_apply (k : Fin 3) (v : AxisSpace) (i : Fin 3) : + (parameterOperator k v).2 i = -(eigenvalue k i * v i) / 8 := by + change (-(1 / 8 : ℝ)) * (((pairHessian k) *ᵥ WithLp.ofLp v) i) = _ + simp [pairHessian, mulVec_diagonal] + ring + +lemma stateOperator_comp_branchOperator (k : Fin 3) : + stateOperator k ∘L branchOperator k = -parameterOperator k := by + apply ContinuousLinearMap.ext + intro v + apply Prod.ext + · ext i + simp only [ContinuousLinearMap.comp_apply, stateOperator_fst_apply, + branchOperator_fst_apply, branchOperator_snd_apply, + _root_.neg_apply, Prod.fst_neg, PiLp.neg_apply, + parameterOperator_fst_apply] + unfold eigenvalue + split_ifs <;> ring + · ext i + simp only [ContinuousLinearMap.comp_apply, stateOperator_snd_apply, + branchOperator_fst_apply, branchOperator_snd_apply, + _root_.neg_apply, Prod.snd_neg, PiLp.neg_apply, + parameterOperator_snd_apply] + unfold eigenvalue + split_ifs <;> ring + +lemma neg_inverse_comp_parameterOperator (k : Fin 3) : + -((stateOperator k).inverse ∘L parameterOperator k) = branchOperator k := by + calc + -((stateOperator k).inverse ∘L parameterOperator k) = + (stateOperator k).inverse ∘L (-parameterOperator k) := by + rw [ContinuousLinearMap.comp_neg] + _ = (stateOperator k).inverse ∘L (stateOperator k ∘L branchOperator k) := by + rw [stateOperator_comp_branchOperator] + _ = branchOperator k := by + rw [← ContinuousLinearMap.comp_assoc, + (stateOperator_isInvertible k).inverse_comp_self, ContinuousLinearMap.id_comp] + +lemma central_inverse_block_isInvertible (k : Fin 3) : + ((ContinuousLinearMap.fst ℝ AxisSpace AxisSpace) ∘L + (-((stateOperator k).inverse ∘L parameterOperator k))).IsInvertible := by + rw [neg_inverse_comp_parameterOperator] + exact centralDerivativeCLM_isInvertible k + +lemma opposite_inverse_block_isInvertible (k : Fin 3) : + ((ContinuousLinearMap.snd ℝ AxisSpace AxisSpace) ∘L + (-((stateOperator k).inverse ∘L parameterOperator k))).IsInvertible := by + rw [neg_inverse_comp_parameterOperator] + exact oppositeDerivativeCLM_isInvertible k + +end Problem356.LocalHessian + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/HessianCoercivity.lean b/lean/OAI/Analysis/CoulombTransport/HessianCoercivity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6f25180faee80a5e274bfe655788401045cf89d --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/HessianCoercivity.lean @@ -0,0 +1,123 @@ +import Mathlib + +namespace OAI + +universe uE uX + +open Filter +open scoped Topology + +namespace Problem356 + +/-- A quantitative lower bound on a bilinear form survives a small operator-norm +perturbation. No finite-dimensional hypothesis is needed. -/ +theorem bilinear_coercive_of_norm_sub_le + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + (B C : E →L[ℝ] E →L[ℝ] ℝ) (a δ : ℝ) + (hB : ∀ v, a * ‖v‖ ^ 2 ≤ B v v) (hclose : ‖C - B‖ ≤ δ) : + ∀ v, (a - δ) * ‖v‖ ^ 2 ≤ C v v := by + intro v + have hv := (C - B).le_opNorm₂ v v + have hmul : ‖C - B‖ * ‖v‖ * ‖v‖ ≤ δ * ‖v‖ ^ 2 := by + calc + ‖C - B‖ * ‖v‖ * ‖v‖ = ‖C - B‖ * ‖v‖ ^ 2 := by ring + _ ≤ δ * ‖v‖ ^ 2 := mul_le_mul_of_nonneg_right hclose (sq_nonneg _) + have hdiff : |C v v - B v v| ≤ δ * ‖v‖ ^ 2 := by + simpa only [sub_apply, Real.norm_eq_abs] using hv.trans hmul + have hlo := (abs_le.mp hdiff).1 + have hb := hB v + nlinarith + +/-- A continuous family of coercive bilinear forms remains uniformly coercive +near the base point, with half the original lower-bound constant. -/ +theorem eventually_bilinear_coercive + {X : Type uX} {E : Type uE} [TopologicalSpace X] + [NormedAddCommGroup E] [NormedSpace ℝ E] + (B : X → E →L[ℝ] E →L[ℝ] ℝ) (x₀ : X) (a : ℝ) + (ha : 0 < a) (hcont : ContinuousAt B x₀) + (hbase : ∀ v, a * ‖v‖ ^ 2 ≤ B x₀ v v) : + ∀ᶠ x in 𝓝 x₀, ∀ v, (a / 2) * ‖v‖ ^ 2 ≤ B x v v := by + have hnear : ∀ᶠ x in 𝓝 x₀, dist (B x) (B x₀) < a / 2 := + (Metric.tendsto_nhds.mp hcont.tendsto) (a / 2) (half_pos ha) + filter_upwards [hnear] with x hx + have h := bilinear_coercive_of_norm_sub_le (B x₀) (B x) a (a / 2) hbase + (by rw [← dist_eq_norm (B x) (B x₀)]; exact hx.le) + have haeq : a - a / 2 = a / 2 := by ring + simpa only [haeq] using h + +/-- In finite dimension, strict positivity of a continuous bilinear form gives +one uniform positive quadratic lower bound. -/ +theorem exists_bilinear_coercivity_of_pos + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] + (B : E →L[ℝ] E →L[ℝ] ℝ) (hpos : ∀ v, v ≠ 0 → 0 < B v v) : + ∃ a : ℝ, 0 < a ∧ ∀ v, a * ‖v‖ ^ 2 ≤ B v v := by + cases subsingleton_or_nontrivial E with + | inl h => + have := h + refine ⟨1, zero_lt_one, ?_⟩ + intro v + have hv : v = 0 := Subsingleton.elim _ _ + simp [hv] + | inr h => + have := h + obtain ⟨u, hu⟩ := exists_norm_eq E (show (0 : ℝ) ≤ 1 by norm_num) + have hne : (Metric.sphere (0 : E) 1).Nonempty := ⟨u, by simpa using hu⟩ + have hcont : Continuous (fun v => B v v) := B.continuous.clm_apply continuous_id + obtain ⟨w, hw, hwmin⟩ := (isCompact_sphere (0 : E) 1).exists_isMinOn hne + hcont.continuousOn + have hwNorm : ‖w‖ = 1 := by simpa using hw + have hwne : w ≠ 0 := by intro hw0; simp [hw0] at hwNorm + refine ⟨B w w, hpos w hwne, ?_⟩ + intro v + by_cases hv : v = 0 + · simp [hv] + have hvnorm : ‖v‖ ≠ 0 := norm_ne_zero_iff.mpr hv + have hynorm : ‖(‖v‖)⁻¹ • v‖ = 1 := norm_smul_inv_norm (𝕜 := ℝ) hv + have hy : (‖v‖)⁻¹ • v ∈ Metric.sphere (0 : E) 1 := by simpa using hynorm + have hmin : B w w ≤ B ((‖v‖)⁻¹ • v) ((‖v‖)⁻¹ • v) := hwmin hy + have hscale : B ((‖v‖)⁻¹ • v) ((‖v‖)⁻¹ • v) * ‖v‖ ^ 2 = B v v := by + simp only [map_smul, smul_apply, smul_eq_mul] + field_simp + have hmul := mul_le_mul_of_nonneg_right hmin (sq_nonneg ‖v‖) + rwa [hscale] at hmul + +/-- Positive definiteness is an open condition for continuous bilinear families +on finite-dimensional real normed spaces. -/ +theorem eventually_bilinear_pos + {X : Type uX} {E : Type uE} [TopologicalSpace X] + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + (B : X → E →L[ℝ] E →L[ℝ] ℝ) (x₀ : X) + (hcont : ContinuousAt B x₀) (hpos : ∀ v, v ≠ 0 → 0 < B x₀ v v) : + ∀ᶠ x in 𝓝 x₀, ∀ v, v ≠ 0 → 0 < B x v v := by + obtain ⟨a, ha, hbase⟩ := exists_bilinear_coercivity_of_pos (B x₀) hpos + filter_upwards [eventually_bilinear_coercive B x₀ a ha hcont hbase] with x hx + intro v hv + exact lt_of_lt_of_le (mul_pos (half_pos ha) (sq_pos_of_pos (norm_pos_iff.mpr hv))) (hx v) + +/-- Metric-ball version of openness of positive definiteness. -/ +theorem exists_ball_bilinear_pos + {X : Type uX} {E : Type uE} [PseudoMetricSpace X] + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + (B : X → E →L[ℝ] E →L[ℝ] ℝ) (x₀ : X) + (hcont : ContinuousAt B x₀) (hpos : ∀ v, v ≠ 0 → 0 < B x₀ v v) : + ∃ r : ℝ, 0 < r ∧ ∀ x ∈ Metric.ball x₀ r, ∀ v, v ≠ 0 → 0 < B x v v := by + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp (eventually_bilinear_pos B x₀ hcont hpos) + exact ⟨r, hr, fun x hx => hball hx⟩ + +/-- A positive-definite Hessian at a point stays positive definite on a ball +when the function is twice continuously differentiable there. -/ +theorem exists_ball_hessian_pos + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] + (f : E → ℝ) (x₀ : E) (hf : ContDiffAt ℝ 2 f x₀) + (hpos : ∀ v, v ≠ 0 → 0 < fderiv ℝ (fderiv ℝ f) x₀ v v) : + ∃ r : ℝ, 0 < r ∧ ∀ x ∈ Metric.ball x₀ r, ∀ v, v ≠ 0 → + 0 < fderiv ℝ (fderiv ℝ f) x v v := by + have hfirst : ContDiffAt ℝ 1 (fderiv ℝ f) x₀ := hf.fderiv_right (by norm_num) + exact exists_ball_bilinear_pos (fderiv ℝ (fderiv ℝ f)) x₀ + (hfirst.continuousAt_fderiv (by norm_num)) hpos + +end Problem356 + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/HessianMatrix.lean b/lean/OAI/Analysis/CoulombTransport/HessianMatrix.lean new file mode 100644 index 0000000000000000000000000000000000000000..644aff0eb0089ae53b61866f68e2fdd9471b767e --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/HessianMatrix.lean @@ -0,0 +1,136 @@ +import OAI.Analysis.CoulombTransport.CoulombCalculus +import OAI.Analysis.CoulombTransport.HessianCLM +import OAI.Analysis.CoulombTransport.StationaryEquation + +namespace OAI + +noncomputable section +open scoped RealInnerProductSpace +open Matrix + +namespace Problem356.CoulombCalculus + +/-- Unit coordinate vector for either local Coulomb branch. -/ +def axisVector (k : Fin 3) : EuclideanSpace ℝ (Fin 3) := + EuclideanSpace.single k 1 + +@[simp] theorem norm_axisVector (k : Fin 3) : ‖axisVector k‖ = 1 := by + simp [axisVector] + +@[simp] theorem inner_axisVector (k : Fin 3) (v : EuclideanSpace ℝ (Fin 3)) : + ⟪axisVector k, v⟫ = v k := by + simp [axisVector, EuclideanSpace.inner_single_left] + +/-- The analytic Coulomb Hessian at a coordinate axis is precisely the diagonal +matrix used in the finite-dimensional local nondegeneracy calculation. -/ +theorem pairHessian_axisVector (k : Fin 3) : + pairHessian (axisVector k) = + Matrix.toEuclideanCLM (𝕜 := ℝ) (LocalHessian.pairHessian k) := by + ext v i + rw [pairHessian_apply_of_norm_eq_one (norm_axisVector k), inner_axisVector] + change (-v + (3 * v k) • axisVector k) i = + (LocalHessian.pairHessian k *ᵥ WithLp.ofLp v) i + simp only [LocalHessian.pairHessian, Matrix.mulVec_diagonal] + by_cases hi : i = k + · subst i + simp [LocalHessian.eigenvalue, axisVector] + ring + · simp [LocalHessian.eigenvalue, axisVector, hi] + +@[simp] theorem axisVector_ne_zero (k : Fin 3) : axisVector k ≠ 0 := by + intro h + have hn := norm_axisVector k + rw [h, norm_zero] at hn + norm_num at hn + +theorem pairHessian_axisVector_apply (k : Fin 3) (v : EuclideanSpace ℝ (Fin 3)) + (i : Fin 3) : + pairHessian (axisVector k) v i = LocalHessian.eigenvalue k i * v i := by + rw [pairHessian_axisVector] + change (LocalHessian.pairHessian k *ᵥ WithLp.ofLp v) i = _ + simp [LocalHessian.pairHessian, Matrix.mulVec_diagonal] + +theorem pairHessian_neg_axisVector (k : Fin 3) : + pairHessian (-axisVector k) = + Matrix.toEuclideanCLM (𝕜 := ℝ) (LocalHessian.pairHessian k) := by + rw [pairHessian_neg, pairHessian_axisVector] + +theorem pairHessian_two_axisVector (k : Fin 3) : + pairHessian ((2 : ℝ) • axisVector k) = + (1 / 8 : ℝ) • Matrix.toEuclideanCLM (𝕜 := ℝ) (LocalHessian.pairHessian k) := by + rw [pairHessian_smul_pos _ (by norm_num), pairHessian_axisVector] + norm_num + +theorem pairHessian_neg_two_axisVector (k : Fin 3) : + pairHessian (-((2 : ℝ) • axisVector k)) = + (1 / 8 : ℝ) • Matrix.toEuclideanCLM (𝕜 := ℝ) (LocalHessian.pairHessian k) := by + rw [pairHessian_neg, pairHessian_two_axisVector] + +end Problem356.CoulombCalculus + +namespace Problem356.GeometryJets + +open CoulombCalculus + +/-- Identification of the center state derivative with the positive definite +operator verified by the explicit finite matrix calculation. -/ +theorem centerStateHessian_axisVector (k : Fin 3) : + centerStateHessian 20 (pairHessian (axisVector k)) = LocalHessian.stateOperator k := by + apply ContinuousLinearMap.ext + intro v + apply Prod.ext + · ext i + change ((2 : ℝ) • pairHessian (axisVector k) v.1 + (20 : ℝ) • v.1 - + pairHessian (axisVector k) v.2) i = (LocalHessian.stateOperator k v).1 i + simp only [PiLp.sub_apply, PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, + pairHessian_axisVector_apply, LocalHessian.stateOperator_fst_apply] + ring + · ext i + change (-pairHessian (axisVector k) v.1 + + ((9 / 8 : ℝ) • pairHessian (axisVector k) v.2 + (20 : ℝ) • v.2)) i = + (LocalHessian.stateOperator k v).2 i + simp only [PiLp.neg_apply, PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, + pairHessian_axisVector_apply, LocalHessian.stateOperator_snd_apply] + ring + +theorem centerParameterDerivative_axisVector (k : Fin 3) : + centerParameterDerivative (pairHessian (axisVector k)) = + LocalHessian.parameterOperator k := by + rw [pairHessian_axisVector] + unfold centerParameterDerivative LocalHessian.parameterOperator + congr 2 + norm_num + +/-- State partial derivative of the actual stationary field at an axis center. -/ +theorem fderiv_stationary_axis_state (k : Fin 3) : + fderiv ℝ (stationaryEquation 20 (axisVector k)) + (axisVector k, (0, -axisVector k)) ∘L + ContinuousLinearMap.inr ℝ (EuclideanSpace ℝ (Fin 3)) + (EuclideanSpace ℝ (Fin 3) × EuclideanSpace ℝ (Fin 3)) = + LocalHessian.stateOperator k := by + rw [(hasFDerivAt_stationary_center 20 _ (norm_axisVector k)).fderiv] + apply ContinuousLinearMap.ext + intro v + change centerParameterDerivative (pairHessian (axisVector k)) 0 + + centerStateHessian 20 (pairHessian (axisVector k)) v = _ + simp [centerStateHessian_axisVector] + +/-- Parameter partial derivative of the actual stationary field at an axis center. -/ +theorem fderiv_stationary_axis_parameter (k : Fin 3) : + fderiv ℝ (stationaryEquation 20 (axisVector k)) + (axisVector k, (0, -axisVector k)) ∘L + ContinuousLinearMap.inl ℝ (EuclideanSpace ℝ (Fin 3)) + (EuclideanSpace ℝ (Fin 3) × EuclideanSpace ℝ (Fin 3)) = + LocalHessian.parameterOperator k := by + rw [(hasFDerivAt_stationary_center 20 _ (norm_axisVector k)).fderiv] + apply ContinuousLinearMap.ext + intro v + change centerParameterDerivative (pairHessian (axisVector k)) v + + centerStateHessian 20 (pairHessian (axisVector k)) 0 = _ + simp [centerParameterDerivative_axisVector] + +end Problem356.GeometryJets + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/IsometryTransport.lean b/lean/OAI/Analysis/CoulombTransport/IsometryTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..727c95ff3059c8201ad8bde1f90ee6246184ca74 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/IsometryTransport.lean @@ -0,0 +1,132 @@ +import OAI.Analysis.CoulombTransport.GraphBridge + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.IsometryTransport + +/-- Apply the same spatial isometry to each particle. -/ +def lift (e : E3 ≃ᵢ E3) : Triple ≃ᵐ Triple := + e.toHomeomorph.toMeasurableEquiv.prodCongr + (e.toHomeomorph.toMeasurableEquiv.prodCongr e.toHomeomorph.toMeasurableEquiv) + +@[simp] theorem lift_apply (e : E3 ≃ᵢ E3) (t : Triple) : + lift e t = (e t.1, (e t.2.1, e t.2.2)) := rfl + +@[simp] theorem invDistance_apply (e : E3 ≃ᵢ E3) (x y : E3) : + invDistance (e x) (e y) = invDistance x y := by + simp only [invDistance, ← dist_eq_norm, e.dist_eq] + +@[simp] theorem cost_lift (e : E3 ≃ᵢ E3) (t : Triple) : + coulombCost (lift e t) = coulombCost t := by + simp only [coulombCost, lift_apply, tripleFst, tripleSnd, tripleThd, + invDistance_apply] + +theorem lintegral_map_lift (e : E3 ≃ᵢ E3) (pi : Measure Triple) : + (∫⁻ t, coulombCost t ∂Measure.map (lift e) pi) = ∫⁻ t, coulombCost t ∂pi := by + rw [lintegral_map_equiv] + simp only [cost_lift] + +theorem coupling_map_lift (e : E3 ≃ᵢ E3) {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) : + IsThreeCoupling (Measure.map e mu) (Measure.map (lift e) pi) := by + have := hpi.1 + refine ⟨inferInstance, ?_, ?_, ?_⟩ + · rw [Measure.map_map measurable_tripleFst (lift e).measurable, + ← hpi.2.1, Measure.map_map e.continuous.measurable measurable_tripleFst] + rfl + · rw [Measure.map_map measurable_tripleSnd (lift e).measurable, + ← hpi.2.2.1, Measure.map_map e.continuous.measurable measurable_tripleSnd] + rfl + · rw [Measure.map_map measurable_tripleThd (lift e).measurable, + ← hpi.2.2.2, Measure.map_map e.continuous.measurable measurable_tripleThd] + rfl + +theorem kantorovichValue_map_le (e : E3 ≃ᵢ E3) (mu : Measure E3) : + kantorovichValue (Measure.map e mu) ≤ kantorovichValue mu := by + unfold kantorovichValue + refine le_iInf fun pi => le_iInf fun hpi => ?_ + calc + _ ≤ ∫⁻ t, coulombCost t ∂Measure.map (lift e) pi := + iInf₂_le _ (coupling_map_lift e hpi) + _ = _ := lintegral_map_lift e pi + +theorem kantorovichValue_map (e : E3 ≃ᵢ E3) (mu : Measure E3) : + kantorovichValue (Measure.map e mu) = kantorovichValue mu := by + apply le_antisymm (kantorovichValue_map_le e mu) + have h := kantorovichValue_map_le e.symm (Measure.map e mu) + simpa only [Measure.map_map e.symm.continuous.measurable e.continuous.measurable, + IsometryEquiv.symm_comp_self, Measure.map_id] using h + +/-- Transport a bounded-domain supporting potential without changing the cost. -/ +theorem supporting_inequality_image (e : E3 ≃ᵢ E3) (U : Set E3) (u : E3 → ℝ) + (h : ∀ x ∈ U, ∀ y ∈ U, ∀ z ∈ U, + ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z))) : + ∀ x ∈ e '' U, ∀ y ∈ e '' U, ∀ z ∈ e '' U, + ENNReal.ofReal (u (e.symm x) + u (e.symm y) + u (e.symm z)) ≤ + coulombCost (x, (y, z)) := by + rintro _ ⟨x, hx, rfl⟩ _ ⟨y, hy, rfl⟩ _ ⟨z, hz, rfl⟩ + change ENNReal.ofReal (u (e.symm (e x)) + u (e.symm (e y)) + + u (e.symm (e z))) ≤ coulombCost (lift e (x, (y, z))) + rw [cost_lift] + simpa only [e.symm_apply_apply] using h x hx y hy z hz + +theorem supporting_equality_image (e : E3 ≃ᵢ E3) (u : E3 → ℝ) (t : Triple) : + coulombCost (lift e t) = ENNReal.ofReal + (u (e.symm (tripleFst (lift e t))) + + u (e.symm (tripleSnd (lift e t))) + u (e.symm (tripleThd (lift e t)))) ↔ + coulombCost t = ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) := by + rw [cost_lift] + simp only [lift_apply, tripleFst, tripleSnd, tripleThd, e.symm_apply_apply] + +/-- Orthogonal changes of variables transport a density without a Jacobian factor. -/ +theorem map_densityMeasure (e : E3 ≃ₗᵢ[ℝ] E3) (rho : E3 → ℝ) + (hrho : Measurable rho) : + Measure.map e (densityMeasure rho) = densityMeasure (fun x => rho (e.symm x)) := by + ext s hs + rw [Measure.map_apply e.continuous.measurable hs, densityMeasure, + withDensity_apply _ (e.continuous.measurable hs), densityMeasure, + withDensity_apply _ hs] + conv_rhs => rw [← e.measurePreserving.map_eq] + have hm : Measurable (fun a : E3 => ENNReal.ofReal (rho (e.symm a))) := + (hrho.comp e.symm.continuous.measurable).ennreal_ofReal + rw [setLIntegral_map (μ := (volume : Measure E3)) hs hm e.continuous.measurable] + simp only [e.symm_apply_apply] + +theorem smoothDensity_comp_symm (e : E3 ≃ₗᵢ[ℝ] E3) {rho : E3 → ℝ} + (hrho : IsSmoothCompactProbabilityDensity rho) : + IsSmoothCompactProbabilityDensity (fun x => rho (e.symm x)) := by + refine ⟨fun x => hrho.1 _, hrho.2.1.comp e.symm.contDiff, + hrho.2.2.1.comp_homeomorph e.symm.toHomeomorph, + hrho.2.2.2.1.comp e.symm.contDiff, + hrho.2.2.2.2.1.comp_homeomorph e.symm.toHomeomorph, ?_⟩ + rw [e.symm.measurePreserving.integral_comp e.symm.toMeasurableEquiv.measurableEmbedding] + exact hrho.2.2.2.2.2 + +/-- Exchange the first and second Euclidean axes, leaving the third fixed. -/ +def axisSwap : E3 ≃ₗᵢ[ℝ] E3 := + LinearIsometryEquiv.piLpCongrLeft 2 ℝ ℝ (Equiv.swap (0 : Fin 3) 1) + +@[simp] theorem axisSwap_single (i : Fin 3) (a : ℝ) : + axisSwap (PiLp.single 2 i a) = PiLp.single 2 (Equiv.swap 0 1 i) a := by + exact LinearIsometryEquiv.piLpCongrLeft_single _ _ _ + +@[simp] theorem axisSwap_zero : axisSwap (0 : E3) = 0 := map_zero axisSwap + +@[simp] theorem axisSwap_first : + axisSwap (PiLp.single 2 (0 : Fin 3) (1 : ℝ)) = PiLp.single 2 (1 : Fin 3) (1 : ℝ) := by + simp + +@[simp] theorem axisSwap_second : + axisSwap (PiLp.single 2 (1 : Fin 3) (1 : ℝ)) = PiLp.single 2 (0 : Fin 3) (1 : ℝ) := by + simp + +end Problem356.IsometryTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/JacobianSquareRoot.lean b/lean/OAI/Analysis/CoulombTransport/JacobianSquareRoot.lean new file mode 100644 index 0000000000000000000000000000000000000000..a9e6eae88207ef6691ce62f6a7f5ba5482d01e03 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/JacobianSquareRoot.lean @@ -0,0 +1,146 @@ +import Mathlib + +namespace OAI + +universe uIndex uE uD + +noncomputable section + +open MeasureTheory Filter Topology +open scoped ContDiff Matrix.Norms.Elementwise + +namespace Problem356.JacobianSquareRoot + +/-- The determinant is a smooth polynomial in the matrix entries. -/ +theorem contDiff_matrix_det {ι : Type uIndex} [Fintype ι] [DecidableEq ι] + (n : WithTop ENat) : ContDiff ℝ n (Matrix.det : Matrix ι ι ℝ → ℝ) := by + classical + change ContDiff ℝ n (fun M : Matrix ι ι ℝ => M.det) + simp only [Matrix.det_apply'] + apply ContDiff.sum + intro σ hσ + apply contDiff_const.mul + apply contDiff_prod + intro i hi + exact contDiff_apply_apply ℝ ℝ (σ i) i + +/-- The determinant is smooth on continuous linear endomorphisms in finite dimension. -/ +theorem contDiff_clm_det {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + [FiniteDimensional ℝ E] (n : WithTop ENat) : + ContDiff ℝ n (fun A : E →L[ℝ] E => A.det) := by + let b := Module.finBasis ℝ E + have hM : ContDiff ℝ n (fun A : E →L[ℝ] E => + LinearMap.toMatrix b b (A : E →ₗ[ℝ] E)) := + (((LinearMap.toMatrix b b).toLinearMap.comp + (ContinuousLinearMap.coeLM ℝ)).toContinuousLinearMap).contDiff + simpa only [Function.comp_def, LinearMap.det_toMatrix] using + (contDiff_matrix_det n).comp hM + +/-- Nonzero determinants yield smooth absolute-Jacobian square roots. -/ +theorem contDiffOn_sqrt_abs_det + {D : Type uD} {E : Type uE} [NormedAddCommGroup D] [NormedSpace ℝ D] + [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + {n : WithTop ENat} {U : Set D} {A : D → E →L[ℝ] E} + (hA : ContDiffOn ℝ n A U) (hdet : ∀ x ∈ U, (A x).det ≠ 0) : + ContDiffOn ℝ n (fun x => Real.sqrt |(A x).det|) U := by + have hd : ContDiffOn ℝ n (fun x => (A x).det) U := + (contDiff_clm_det n).fun_comp_contDiffOn hA + have ha : ContDiffOn ℝ n (fun x => |(A x).det|) U := by + simpa only [Real.norm_eq_abs] using hd.norm ℝ hdet + exact ha.sqrt (fun x hx => abs_ne_zero.mpr (hdet x hx)) + +/-- Invertibility of an endomorphism implies its Jacobian determinant is nonzero. -/ +theorem det_ne_zero_of_isInvertible + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + {A : E →L[ℝ] E} (hA : A.IsInvertible) : A.det ≠ 0 := by + rcases hA with ⟨e, rfl⟩ + exact e.toLinearEquiv.isUnit_det'.ne_zero + +/-- Smoothness of the square root of the absolute derivative determinant on an open set. -/ +theorem contDiffOn_sqrt_abs_det_fderiv + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + {U : Set E} {F : E → E} (hU : IsOpen U) + (hF : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) F U) + (hdet : ∀ x ∈ U, (fderiv ℝ F x).det ≠ 0) : + ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) + (fun x => Real.sqrt |(fderiv ℝ F x).det|) U := by + apply contDiffOn_sqrt_abs_det + · exact ((contDiffOn_infty_iff_fderiv_of_isOpen hU).mp hF).2 + · exact hdet + +/-- Multiplication by the composed source amplitude gives the local transported amplitude. -/ +theorem contDiffOn_transportedAmplitude + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + {U : Set E} {F : E → E} {g : E → ℝ} (hU : IsOpen U) + (hF : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) F U) + (hg : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g) + (hdet : ∀ x ∈ U, (fderiv ℝ F x).det ≠ 0) : + ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) + (fun x => g (F x) * Real.sqrt |(fderiv ℝ F x).det|) U := + (hg.fun_comp_contDiffOn hF).mul (contDiffOn_sqrt_abs_det_fderiv hU hF hdet) + +/-- An eventually defined differentiable left inverse forces a nonzero derivative determinant. -/ +theorem det_fderiv_ne_zero_of_eventual_leftInverse + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + {F G : E → E} {x : E} (hF : DifferentiableAt ℝ F x) + (hG : DifferentiableAt ℝ G (F x)) + (hGF : ∀ᶠ y in nhds x, G (F y) = y) : (fderiv ℝ F x).det ≠ 0 := by + have hc : (fderiv ℝ G (F x)).comp (fderiv ℝ F x) = + ContinuousLinearMap.id ℝ E := + (hG.hasFDerivAt.comp x hF.hasFDerivAt).unique + ((hasFDerivAt_id x).congr_of_eventuallyEq hGF) + have hprod := congrArg (fun A : E →L[ℝ] E => A.det) hc + simp only [ContinuousLinearMap.det, ContinuousLinearMap.toLinearMap_comp, + LinearMap.det_comp, ContinuousLinearMap.coe_id, LinearMap.det_id] at hprod + change (fderiv ℝ G (F x)).det * (fderiv ℝ F x).det = 1 at hprod + intro hz + rw [hz, mul_zero] at hprod + exact zero_ne_one hprod + +/-- Both smooth directions of an open partial homeomorphism have nonvanishing inverse Jacobian. -/ +theorem det_fderiv_symm_ne_zero + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e e.source) + (he' : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e.symm e.target) + {y : E} (hy : y ∈ e.target) : (fderiv ℝ e.symm y).det ≠ 0 := by + apply det_fderiv_ne_zero_of_eventual_leftInverse + ((he'.contDiffAt (e.open_target.mem_nhds hy)).differentiableAt (by simp)) + ((he.contDiffAt (e.open_source.mem_nhds (e.map_target hy))).differentiableAt (by simp)) + exact e.eventually_right_inverse hy + +/-- Smooth inverse-Jacobian factor for a smooth open partial diffeomorphism. -/ +theorem contDiffOn_sqrt_abs_det_fderiv_symm + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e e.source) + (he' : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e.symm e.target) : + ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) + (fun y => Real.sqrt |(fderiv ℝ e.symm y).det|) e.target := + contDiffOn_sqrt_abs_det_fderiv e.open_target he' + (fun _ hy => det_fderiv_symm_ne_zero e he he' hy) + +/-- Local transported amplitudes are smooth, with no separate Jacobian hypothesis. -/ +theorem contDiffOn_transportedAmplitude_symm + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] [FiniteDimensional ℝ E] + (e : OpenPartialHomeomorph E E) + (he : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e e.source) + (he' : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e.symm e.target) + {g : E → ℝ} (hg : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g) : + ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) + (fun y => g (e.symm y) * Real.sqrt |(fderiv ℝ e.symm y).det|) e.target := + (hg.fun_comp_contDiffOn he').mul (contDiffOn_sqrt_abs_det_fderiv_symm e he he') + +/-- The transported amplitude squares to the Jacobian-weighted source density. -/ +theorem transportedAmplitude_sq + {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + (F : E → E) (g : E → ℝ) (y : E) : + (g (F y) * Real.sqrt |(fderiv ℝ F y).det|) ^ 2 = + |(fderiv ℝ F y).det| * (g (F y)) ^ 2 := by + rw [mul_pow, Real.sq_sqrt (abs_nonneg _), mul_comm] + +end Problem356.JacobianSquareRoot + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/LocalBranchMeasure.lean b/lean/OAI/Analysis/CoulombTransport/LocalBranchMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..e54e690be932ebb6edd53153721d4cbb97b320a4 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/LocalBranchMeasure.lean @@ -0,0 +1,99 @@ +import Mathlib + +namespace OAI + +universe uAlpha uBeta + +noncomputable section + +open MeasureTheory Set + +namespace Problem356 +namespace LocalBranchMeasure + +variable {α : Type uAlpha} {β : Type uBeta} [TopologicalSpace α] [TopologicalSpace β] + [MeasurableSpace α] [MeasurableSpace β] [BorelSpace α] [BorelSpace β] + +/-- A local branch extended by a fixed value outside its source. -/ +def extendedBranch (e : OpenPartialHomeomorph α β) (z : β) : α → β := by + classical + exact e.source.piecewise e (fun _ => z) + +omit [MeasurableSpace α] [MeasurableSpace β] [BorelSpace α] [BorelSpace β] in +@[simp] theorem extendedBranch_apply_of_mem + (e : OpenPartialHomeomorph α β) (z : β) {x : α} (hx : x ∈ e.source) : + extendedBranch e z x = e x := by + classical + simp [extendedBranch, hx] + +/-- The extension is Borel measurable even if the local map is arbitrary outside its source. -/ +theorem measurable_extendedBranch (e : OpenPartialHomeomorph α β) (z : β) : + Measurable (extendedBranch e z) := by + classical + exact e.continuousOn.measurable_piecewise continuous_const.continuousOn + e.open_source.measurableSet + +/-- Restricting the domain of a local branch to a measurable set gives a measurable image. -/ +theorem measurableSet_image (e : OpenPartialHomeomorph α β) + {S : Set α} (hS : MeasurableSet S) (hSub : S ⊆ e.source) : + MeasurableSet (e '' S) := by + have h := e.isOpenEmbedding_restrict.measurableEmbedding.measurableSet_image' + (hS.preimage measurable_subtype_coe) + simpa only [Set.image_domRestrict, Set.inter_eq_left.mpr hSub] using h + +omit [MeasurableSpace α] [MeasurableSpace β] [BorelSpace α] [BorelSpace β] in +/-- Extension preserves every image of a subset of the local source. -/ +theorem extendedBranch_image (e : OpenPartialHomeomorph α β) (z : β) + {S : Set α} (hSub : S ⊆ e.source) : + extendedBranch e z '' S = e '' S := by + apply Set.image_congr + intro x hx + exact extendedBranch_apply_of_mem e z (hSub hx) + +/-- Measurability of selected branch images required by deterministic-selection obstructions. -/ +theorem measurableSet_extendedBranch_image (e : OpenPartialHomeomorph α β) (z : β) + {S : Set α} (hS : MeasurableSet S) (hSub : S ⊆ e.source) : + MeasurableSet (extendedBranch e z '' S) := by + rw [extendedBranch_image e z hSub] + exact measurableSet_image e hS hSub + +omit [MeasurableSpace α] [MeasurableSpace β] [BorelSpace α] [BorelSpace β] in +/-- Injectivity of the extension on any subset of the source. -/ +theorem injOn_extendedBranch (e : OpenPartialHomeomorph α β) (z : β) + {B : Set α} (hB : B ⊆ e.source) : InjOn (extendedBranch e z) B := by + intro x hx y hy hxy + apply e.injOn (hB hx) (hB hy) + simpa only [extendedBranch_apply_of_mem e z (hB hx), + extendedBranch_apply_of_mem e z (hB hy)] using hxy + +omit [BorelSpace α] [BorelSpace β] in +/-- Extending outside the source does not change pushforwards of measures concentrated there. -/ +theorem map_extendedBranch (e : OpenPartialHomeomorph α β) (z : β) + (ν : Measure α) (hν : ∀ᵐ x ∂ν, x ∈ e.source) : + Measure.map (extendedBranch e z) ν = Measure.map e ν := by + apply Measure.map_congr + filter_upwards [hν] with x hx + exact extendedBranch_apply_of_mem e z hx + +/-- A measurable selector's coincidence set with an extended local branch is measurable. -/ +theorem measurableSet_selection [MeasurableEq β] + (e : OpenPartialHomeomorph α β) (z : β) {B : Set α} + (hB : MeasurableSet B) {T : α → β} (hT : Measurable T) : + MeasurableSet (B ∩ {x | T x = extendedBranch e z x}) := + hB.inter (measurableSet_eq_fun hT (measurable_extendedBranch e z)) + +/-- Selected coincidence sets have measurable branch images. -/ +theorem measurableSet_selection_image [MeasurableEq β] + (e : OpenPartialHomeomorph α β) (z : β) {B : Set α} + (hB : MeasurableSet B) (hSub : B ⊆ e.source) + {T : α → β} (hT : Measurable T) : + MeasurableSet (extendedBranch e z '' (B ∩ {x | T x = extendedBranch e z x})) := by + apply measurableSet_extendedBranch_image e z (measurableSet_selection e z hB hT) + exact inter_subset_left.trans hSub + +end LocalBranchMeasure +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/LocalCertificate.lean b/lean/OAI/Analysis/CoulombTransport/LocalCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..177d091a443785fe68389af2a650e06bb19bbbf8 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/LocalCertificate.lean @@ -0,0 +1,207 @@ +import OAI.Analysis.CoulombTransport.LocalImplicit +import OAI.Analysis.CoulombTransport.StrictMinimum +import OAI.Analysis.CoulombTransport.HessianCoercivity + +namespace OAI + +universe uE + +noncomputable section + +open Set Filter +open scoped Topology ContDiff + +namespace Problem356.LocalGeometry + +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- A local exact supporting certificate, with the stationary branches retained +as analytic local diffeomorphisms and both domains shrunk to metric balls. -/ +structure LocalSupportingCharts (F : E × (E × E) → ℝ) + (G : E × (E × E) → E × E) (p : E) (s : E × E) where + charts : LocalImplicit.AnalyticStationaryCharts G p s + parameterRadius : ℝ + parameterRadius_pos : 0 < parameterRadius + source_ball : charts.central.source = Metric.ball p parameterRadius + stateRadius : ℝ + stateRadius_pos : 0 < stateRadius + state_ball : charts.stateDomain = Metric.ball s stateRadius + value : E → ℝ + value_analytic : ContDiffOn ℝ ω value charts.central.source + value_eq : ∀ y, value y = F (y, (charts.central y, charts.opposite y)) + value_base : value p = F (p, s) + supporting : ∀ y ∈ charts.central.source, ∀ z ∈ charts.stateDomain, + value y ≤ F (y, z) + contact : ∀ y ∈ charts.central.source, ∀ z ∈ charts.stateDomain, + F (y, z) = value y ↔ z = (charts.central y, charts.opposite y) + +/-- Positive Hessian at the base point, together with separate local branch +invertibility, yields the full neighborhood-level supporting certificate. -/ +theorem nonempty_localSupportingCharts [CompleteSpace E] [FiniteDimensional ℝ E] + {F : E × (E × E) → ℝ} {G : E × (E × E) → E × E} + {D : E → (E × E) → (E × E) →L[ℝ] ℝ} + {H : E → (E × E) → (E × E) →L[ℝ] ((E × E) →L[ℝ] ℝ)} + {p : E} {s : E × E} + (C : LocalImplicit.AnalyticStationaryCharts G p s) + (hF : ContDiffAt ℝ ω F (p, s)) + (hD : ∀ᶠ q in 𝓝 (p, s), HasFDerivAt (fun z => F (q.1, z)) (D q.1 q.2) q.2) + (hH : ∀ᶠ q in 𝓝 (p, s), HasFDerivAt (D q.1) (H q.1 q.2) q.2) + (hHcont : ContinuousAt (fun q : E × (E × E) => H q.1 q.2) (p, s)) + (hHpos : ∀ v : E × E, v ≠ 0 → 0 < H p s v v) + (hcompatible : ∀ q : E × (E × E), G q = 0 → D q.1 q.2 = 0) : + Nonempty (LocalSupportingCharts F G p s) := by + let ψ : E → E × E := fun y => (C.central y, C.opposite y) + have hψsmooth : ContDiffOn ℝ ω ψ C.central.source := + C.central_analytic.prodMk (C.source_eq ▸ C.opposite_analytic) + have hψbase : ψ p = s := by simp [ψ, C.central_value, C.opposite_value] + have hHnear := eventually_bilinear_pos (fun q : E × (E × E) => H q.1 q.2) + (p, s) hHcont hHpos + have hgood : ∀ᶠ q in 𝓝 (p, s), ContDiffAt ℝ ω F q ∧ + HasFDerivAt (fun z => F (q.1, z)) (D q.1 q.2) q.2 ∧ + HasFDerivAt (D q.1) (H q.1 q.2) q.2 ∧ + ∀ v : E × E, v ≠ 0 → 0 < H q.1 q.2 v v := by + filter_upwards [hF.eventually (by simp), hD, hH, hHnear] with q h1 h2 h3 h4 + exact ⟨h1, h2, h3, h4⟩ + obtain ⟨A, hA, B, hB, hAB⟩ := mem_nhds_prod_iff.mp hgood + obtain ⟨r, hr, hrB⟩ := Metric.mem_nhds_iff.mp + (inter_mem hB (C.stateDomain_open.mem_nhds C.state_mem)) + have hψcont : ContinuousAt ψ p := + (hψsmooth.contDiffAt (C.central.open_source.mem_nhds C.point_mem)).continuousAt + have hψball : ∀ᶠ y in 𝓝 p, ψ y ∈ Metric.ball s r := by + apply hψcont.preimage_mem_nhds + rw [hψbase] + exact Metric.ball_mem_nhds s hr + have hUgood : ∀ᶠ y in 𝓝 p, + y ∈ C.central.source ∧ y ∈ A ∧ ψ y ∈ Metric.ball s r := by + filter_upwards [C.central.open_source.mem_nhds C.point_mem, hA, hψball] + with y h1 h2 h3 + exact ⟨h1, h2, h3⟩ + obtain ⟨t, ht, htU⟩ := Metric.mem_nhds_iff.mp hUgood + let U := Metric.ball p t + have hUcentral : U ⊆ C.central.source := fun _ hy => (htU hy).1 + have hUopposite : U ⊆ C.opposite.source := C.source_eq ▸ hUcentral + let X := C.central.restrOpen U Metric.isOpen_ball + let Z := C.opposite.restrOpen U Metric.isOpen_ball + have hXsource : X.source = U := inter_eq_right.mpr hUcentral + have hZsource : Z.source = U := inter_eq_right.mpr hUopposite + have hpair : (fun y => (X y, Z y)) = ψ := rfl + have hproperties : ∀ y ∈ U, ∀ z ∈ Metric.ball s r, + ContDiffAt ℝ ω F (y, z) ∧ + HasFDerivAt (fun z => F (y, z)) (D y z) z ∧ + HasFDerivAt (D y) (H y z) z ∧ + ∀ v : E × E, v ≠ 0 → 0 < H y z v v := by + intro y hy z hz + exact hAB ⟨(htU hy).2.1, (hrB hz).1⟩ + have hψU : ContDiffOn ℝ ω ψ U := hψsmooth.mono hUcentral + have hψUmap : MapsTo ψ U (Metric.ball s r) := fun _ hy => (htU hy).2.2 + have hstatU : ∀ y ∈ U, D y (ψ y) = 0 := by + intro y hy + exact hcompatible (y, ψ y) (C.stationary y (hUcentral hy)) + have hcert := stationary_family_certificate_of_positive_hessian + (fun q hq => (hproperties q.1 hq.1 q.2 hq.2).1.contDiffWithinAt) + hψU hψUmap (convex_ball s r) Metric.isOpen_ball + (fun y hy z hz => (hproperties y hy z hz).2.1) + (fun y hy z hz => (hproperties y hy z hz).2.2.1) + (fun y hy z hz => (hproperties y hy z hz).2.2.2) hstatU + let C' : LocalImplicit.AnalyticStationaryCharts G p s := { + central := X + opposite := Z + source_eq := hXsource.trans hZsource.symm + point_mem := by rw [hXsource]; exact Metric.mem_ball_self ht + central_value := C.central_value + opposite_value := C.opposite_value + stateDomain := Metric.ball s r + stateDomain_open := Metric.isOpen_ball + state_mem := Metric.mem_ball_self hr + mapsTo_state := by rw [hpair, hXsource]; exact hψUmap + stationary := fun y hy => C.stationary y hy.1 + unique_zero := fun y hy z hz => C.unique_zero y hy.1 z (hrB hz).2 + central_analytic := C.central_analytic.mono (fun _ hy => hy.1) + central_inverse_analytic := C.central_inverse_analytic.mono (fun _ hy => hy.1) + opposite_analytic := C.opposite_analytic.mono (fun _ hy => hy.1) + opposite_inverse_analytic := C.opposite_inverse_analytic.mono (fun _ hy => hy.1) } + refine ⟨{ + charts := C' + parameterRadius := t + parameterRadius_pos := ht + source_ball := hXsource + stateRadius := r + stateRadius_pos := hr + state_ball := rfl + value := fun y => F (y, ψ y) + value_analytic := ?_ + value_eq := fun _ => rfl + value_base := by rw [hψbase] + supporting := ?_ + contact := ?_ }⟩ + · change ContDiffOn ℝ ω (fun y => F (y, ψ y)) X.source + rw [hXsource] + exact hcert.1 + · intro y hy z hz + exact (hcert.2 y (hXsource ▸ hy) z hz).1 + · intro y hy z hz + exact (hcert.2 y (hXsource ▸ hy) z hz).2 + +/-- A local certificate survives arbitrary further neighborhood restrictions. +First shrink the state ball, and only then shrink the parameter ball so that +both branches still land in the new state ball. The functions and value are +unchanged, so previously established center values are preserved. -/ +theorem LocalSupportingCharts.exists_shrink [CompleteSpace E] + {F : E × (E × E) → ℝ} {G : E × (E × E) → E × E} {p : E} {s : E × E} + (C : LocalSupportingCharts F G p s) (rp rs : ℝ) (hp : 0 < rp) (hs : 0 < rs) : + ∃ D : LocalSupportingCharts F G p s, + D.charts.central.source ⊆ C.charts.central.source ∩ Metric.ball p rp ∧ + D.charts.stateDomain ⊆ C.charts.stateDomain ∩ Metric.ball s rs ∧ + (D.charts.central : E → E) = C.charts.central ∧ + (D.charts.opposite : E → E) = C.charts.opposite ∧ D.value = C.value := by + let r := min C.stateRadius rs + have hr : 0 < r := lt_min C.stateRadius_pos hs + have hball : Metric.ball s r ⊆ C.charts.stateDomain := by + rw [C.state_ball] + exact Metric.ball_subset_ball (min_le_left _ _) + obtain ⟨d, hdstate, hdsource, hdX, hdZ⟩ := C.charts.exists_restrict_state + (Metric.ball s r) Metric.isOpen_ball (Metric.mem_ball_self hr) hball + have hU : d.central.source ∩ Metric.ball p rp ∈ 𝓝 p := + inter_mem (d.central.open_source.mem_nhds d.point_mem) (Metric.ball_mem_nhds p hp) + obtain ⟨t, ht, e, hesource, heU, hestate, heX, heZ⟩ := + d.exists_restrict_ball (d.central.source ∩ Metric.ball p rp) hU + have hsource : e.central.source ⊆ C.charts.central.source := + fun _ hy => hdsource (heU hy).1 + have hstate : e.stateDomain ⊆ C.charts.stateDomain := by + rw [hestate, hdstate] + exact hball + have hsameX : (e.central : E → E) = C.charts.central := heX.trans hdX + have hsameZ : (e.opposite : E → E) = C.charts.opposite := heZ.trans hdZ + let D : LocalSupportingCharts F G p s := { + charts := e + parameterRadius := t + parameterRadius_pos := ht + source_ball := hesource + stateRadius := r + stateRadius_pos := hr + state_ball := hestate.trans hdstate + value := C.value + value_analytic := C.value_analytic.mono hsource + value_eq := by + intro y + rw [hsameX, hsameZ] + exact C.value_eq y + value_base := C.value_base + supporting := fun y hy z hz => C.supporting y (hsource hy) z (hstate hz) + contact := by + intro y hy z hz + rw [hsameX, hsameZ] + exact C.contact y (hsource hy) z (hstate hz) } + refine ⟨D, ?_, ?_, hsameX, hsameZ, rfl⟩ + · exact fun _ hy => ⟨hsource hy, (heU hy).2⟩ + · intro z hz + refine ⟨hstate hz, ?_⟩ + change z ∈ e.stateDomain at hz + rw [hestate, hdstate] at hz + exact Metric.ball_subset_ball (min_le_right _ _) hz + +end Problem356.LocalGeometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/LocalImplicit.lean b/lean/OAI/Analysis/CoulombTransport/LocalImplicit.lean new file mode 100644 index 0000000000000000000000000000000000000000..415feaa15a61982ab42b6c1c444ac5ccbf48831b --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/LocalImplicit.lean @@ -0,0 +1,298 @@ +import Mathlib + +namespace OAI + +universe uP uS + +noncomputable section + +open Filter Set +open scoped Topology ContDiff + +namespace Problem356.LocalImplicit + +variable {P : Type uP} {S : Type uS} + [NormedAddCommGroup P] [NormedSpace ℝ P] [CompleteSpace P] + [NormedAddCommGroup S] [NormedSpace ℝ S] [CompleteSpace S] + +/-- Analytic implicit-function theorem, packaged on open product neighborhoods. +The equation is normalized to zero, as for a stationary-point equation. -/ +theorem exists_analytic_implicit_branch + (G : P × S → S) (p : P) (s : S) + (hG : ContDiffAt ℝ ω G (p, s)) + (hzero : G (p, s) = 0) + (hinv : (fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inr ℝ P S).IsInvertible) : + ∃ (ψ : P → S) (U : Set P) (V : Set S), + IsOpen U ∧ p ∈ U ∧ IsOpen V ∧ s ∈ V ∧ + ContDiffOn ℝ ω ψ U ∧ MapsTo ψ U V ∧ ψ p = s ∧ + (∀ y ∈ U, G (y, ψ y) = 0) ∧ + (∀ y ∈ U, ∀ z ∈ V, G (y, z) = 0 ↔ ψ y = z) ∧ + HasStrictFDerivAt ψ + (-(fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inr ℝ P S).inverse ∘L + (fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inl ℝ P S)) p := by + let ψ : P → S := hG.implicitFunction (by simp) hinv + have hψ : ContDiffAt ℝ ω ψ p := hG.contDiffAt_implicitFunction (by simp) hinv + have hψp : ψ p = s := hG.implicitFunction_apply_self (by simp) hinv + have heq : ∀ᶠ q in 𝓝 (p, s), G q = 0 ↔ ψ q.1 = q.2 := by + simpa only [hzero] using hG.eventually_apply_eq_iff_implicitFunction (by simp) hinv + obtain ⟨U₀, hU₀, V₀, hV₀, hprod⟩ := mem_nhds_prod_iff.mp heq + obtain ⟨V, hVV₀, hVopen, hsV⟩ := mem_nhds_iff.mp hV₀ + have hmaps : ψ ⁻¹' V ∈ 𝓝 p := hψ.continuousAt.preimage_mem_nhds (by + rw [hψp] + exact hVopen.mem_nhds hsV) + have hcont : ∀ᶠ y in 𝓝 p, ContDiffAt ℝ ω ψ y := hψ.eventually (by simp) + have heqn : ∀ᶠ y in 𝓝 p, G (y, ψ y) = 0 := by + simpa only [hzero] using hG.eventually_apply_implicitFunction (by simp) hinv + obtain ⟨U, hUsub, hUopen, hpU⟩ := + mem_nhds_iff.mp (inter_mem hU₀ (inter_mem hmaps (hcont.and heqn))) + refine ⟨ψ, U, V, hUopen, hpU, hVopen, hsV, ?_, ?_, hψp, ?_, ?_, ?_⟩ + · exact hUopen.contDiffOn_iff.mpr (fun _ hy => (hUsub hy).2.2.1) + · exact fun y hy => (hUsub hy).2.1 + · exact fun y hy => (hUsub hy).2.2.2 + · intro y hy z hz + exact hprod ⟨(hUsub hy).1, hVV₀ hz⟩ + · exact hG.hasStrictFDerivAt_implicitFunction (by simp) hinv + +omit [CompleteSpace S] in +/-- A map analytic at one point with invertible derivative is analytic in both + directions on a suitable open partial homeomorphism. -/ +theorem exists_analytic_local_diffeomorph + (f : P → S) (p : P) + (hf : ContDiffAt ℝ ω f p) + (hinv : (fderiv ℝ f p).IsInvertible) : + ∃ e : OpenPartialHomeomorph P S, + (e : P → S) = f ∧ p ∈ e.source ∧ + ContDiffOn ℝ ω e e.source ∧ ContDiffOn ℝ ω e.symm e.target := by + obtain ⟨A, hA⟩ := hinv + have hderiv : HasFDerivAt f (A : P →L[ℝ] S) p := by + rw [hA] + exact (hf.differentiableAt (by simp)).hasFDerivAt + let e₀ := hf.toOpenPartialHomeomorph f hderiv (by simp) + have he₀ : (e₀ : P → S) = f := rfl + have hp₀ : p ∈ e₀.source := hf.mem_toOpenPartialHomeomorph_source hderiv (by simp) + have hfp₀ : f p ∈ e₀.target := hf.image_mem_toOpenPartialHomeomorph_target hderiv (by simp) + have hinverse : ContDiffAt ℝ ω e₀.symm (f p) := by + have hleft : e₀.symm (f p) = p := e₀.left_inv hp₀ + apply e₀.contDiffAt_symm hfp₀ + · simpa only [hleft, he₀] using hderiv + · simpa only [hleft, he₀] using hf + obtain ⟨V, hVsub, hVopen, hfpV⟩ := + mem_nhds_iff.mp (hinverse.eventually (by simp)) + have hpre : f ⁻¹' V ∈ 𝓝 p := hf.continuousAt.preimage_mem_nhds (hVopen.mem_nhds hfpV) + obtain ⟨U, hUsub, hUopen, hpU⟩ := mem_nhds_iff.mp + (inter_mem (e₀.open_source.mem_nhds hp₀) (inter_mem (hf.eventually (by simp)) hpre)) + refine ⟨e₀.restrOpen U hUopen, rfl, ⟨hp₀, hpU⟩, ?_, ?_⟩ + · apply (e₀.restrOpen U hUopen).open_source.contDiffOn_iff.mpr + intro x hx + exact (hUsub hx.2).2.1 + · apply (e₀.restrOpen U hUopen).open_target.contDiffOn_iff.mpr + intro y hy + have hx := (e₀.restrOpen U hUopen).map_target hy + have hxy := (e₀.restrOpen U hUopen).right_inv hy + apply hVsub + have hmem := (hUsub hx.2).2.2 + change f ((e₀.restrOpen U hUopen).symm y) ∈ V at hmem + change f ((e₀.restrOpen U hUopen).symm y) = y at hxy + exact hxy ▸ hmem + +omit [CompleteSpace S] in +/-- The two projections of a local branch can be made analytic diffeomorphisms +on one common source neighborhood, contained in any prescribed neighborhood. -/ +theorem exists_two_analytic_local_charts + (ψ : P → S × S) (p : P) (U : Set P) (hU : U ∈ 𝓝 p) + (hψ : ContDiffAt ℝ ω ψ p) + (hinv₁ : (fderiv ℝ (fun y => (ψ y).1) p).IsInvertible) + (hinv₂ : (fderiv ℝ (fun y => (ψ y).2) p).IsInvertible) : + ∃ e₁ e₂ : OpenPartialHomeomorph P S, + (e₁ : P → S) = (fun y => (ψ y).1) ∧ + (e₂ : P → S) = (fun y => (ψ y).2) ∧ + p ∈ e₁.source ∧ e₁.source = e₂.source ∧ e₁.source ⊆ U ∧ + ContDiffOn ℝ ω e₁ e₁.source ∧ ContDiffOn ℝ ω e₁.symm e₁.target ∧ + ContDiffOn ℝ ω e₂ e₂.source ∧ ContDiffOn ℝ ω e₂.symm e₂.target := by + obtain ⟨e₁, he₁, hp₁, hc₁, hi₁⟩ := + exists_analytic_local_diffeomorph (fun y => (ψ y).1) p hψ.fst hinv₁ + obtain ⟨e₂, he₂, hp₂, hc₂, hi₂⟩ := + exists_analytic_local_diffeomorph (fun y => (ψ y).2) p hψ.snd hinv₂ + obtain ⟨O, hOU, hOopen, hpO⟩ := mem_nhds_iff.mp hU + let W := e₁.source ∩ (e₂.source ∩ O) + have hWopen : IsOpen W := e₁.open_source.inter (e₂.open_source.inter hOopen) + have hW₁ : W ⊆ e₁.source := fun _ h => h.1 + have hW₂ : W ⊆ e₂.source := fun _ h => h.2.1 + have hs₁ : (e₁.restrOpen W hWopen).source = W := inter_eq_right.mpr hW₁ + have hs₂ : (e₂.restrOpen W hWopen).source = W := inter_eq_right.mpr hW₂ + refine ⟨e₁.restrOpen W hWopen, e₂.restrOpen W hWopen, he₁, he₂, ?_, + hs₁.trans hs₂.symm, ?_, ?_, ?_, ?_, ?_⟩ + · rw [hs₁] + exact ⟨hp₁, hp₂, hpO⟩ + · rw [hs₁] + exact fun _ h => hOU h.2.2 + · exact hc₁.mono (fun _ h => h.1) + · exact hi₁.mono (fun _ h => h.1) + · exact hc₂.mono (fun _ h => h.1) + · exact hi₂.mono (fun _ h => h.1) + +/-- The derivative supplied by the implicit-function theorem, with parameter first. -/ +def implicitDerivative (G : P × (S × S) → S × S) (p : P) (s : S × S) : + P →L[ℝ] S × S := + -(fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inr ℝ P (S × S)).inverse ∘L + (fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inl ℝ P (S × S)) + +/-- Two separately invertible coordinates of one local stationary branch. -/ +structure AnalyticStationaryCharts (G : P × (S × S) → S × S) (p : P) (s : S × S) where + central : OpenPartialHomeomorph P S + opposite : OpenPartialHomeomorph P S + source_eq : central.source = opposite.source + point_mem : p ∈ central.source + central_value : central p = s.1 + opposite_value : opposite p = s.2 + stateDomain : Set (S × S) + stateDomain_open : IsOpen stateDomain + state_mem : s ∈ stateDomain + mapsTo_state : MapsTo (fun y => (central y, opposite y)) central.source stateDomain + stationary : ∀ y ∈ central.source, G (y, (central y, opposite y)) = 0 + unique_zero : ∀ y ∈ central.source, ∀ z ∈ stateDomain, + G (y, z) = 0 ↔ (central y, opposite y) = z + central_analytic : ContDiffOn ℝ ω central central.source + central_inverse_analytic : ContDiffOn ℝ ω central.symm central.target + opposite_analytic : ContDiffOn ℝ ω opposite opposite.source + opposite_inverse_analytic : ContDiffOn ℝ ω opposite.symm opposite.target + +/-- Local stationarity plus the three invertibility checks produces two genuine +analytic charts on a common open source. -/ +theorem nonempty_analyticStationaryCharts + (G : P × (S × S) → S × S) (p : P) (s : S × S) + (hG : ContDiffAt ℝ ω G (p, s)) (hzero : G (p, s) = 0) + (hinv : (fderiv ℝ G (p, s) ∘L ContinuousLinearMap.inr ℝ P (S × S)).IsInvertible) + (hcentral : (ContinuousLinearMap.fst ℝ S S ∘L implicitDerivative G p s).IsInvertible) + (hopposite : (ContinuousLinearMap.snd ℝ S S ∘L implicitDerivative G p s).IsInvertible) : + Nonempty (AnalyticStationaryCharts G p s) := by + obtain ⟨ψ, U, V, hUopen, hpU, hVopen, hsV, hψU, hψV, hψp, heqn, huniq, hd⟩ := + exists_analytic_implicit_branch G p s hG hzero hinv + have hψ : ContDiffAt ℝ ω ψ p := hUopen.contDiffOn_iff.mp hψU hpU + have hd₁ : HasFDerivAt (fun y => (ψ y).1) + (ContinuousLinearMap.fst ℝ S S ∘L implicitDerivative G p s) p := + hd.hasFDerivAt.fst + have hd₂ : HasFDerivAt (fun y => (ψ y).2) + (ContinuousLinearMap.snd ℝ S S ∘L implicitDerivative G p s) p := + hd.hasFDerivAt.snd + obtain ⟨e₁, e₂, he₁, he₂, hp, hsource, hsub, hc₁, hi₁, hc₂, hi₂⟩ := + exists_two_analytic_local_charts ψ p U (hUopen.mem_nhds hpU) hψ + (by rw [hd₁.fderiv]; exact hcentral) (by rw [hd₂.fderiv]; exact hopposite) + refine ⟨{ + central := e₁ + opposite := e₂ + source_eq := hsource + point_mem := hp + central_value := ?_ + opposite_value := ?_ + stateDomain := V + stateDomain_open := hVopen + state_mem := hsV + mapsTo_state := ?_ + stationary := ?_ + unique_zero := ?_ + central_analytic := hc₁ + central_inverse_analytic := hi₁ + opposite_analytic := hc₂ + opposite_inverse_analytic := hi₂ }⟩ + · simp only [he₁, hψp] + · simp only [he₂, hψp] + · intro y hy + simpa only [he₁, he₂, Prod.eta] using hψV (hsub hy) + · intro y hy + simpa only [he₁, he₂, Prod.eta] using heqn y (hsub hy) + · intro y hy z hz + simpa only [he₁, he₂, Prod.eta] using huniq y (hsub hy) z hz + +namespace AnalyticStationaryCharts + +variable {G : P × (S × S) → S × S} {p : P} {s : S × S} + +omit [CompleteSpace P] [CompleteSpace S] + +/-- Restrict both parameter charts to the same additional open neighborhood. -/ +def restrictSource (c : AnalyticStationaryCharts G p s) + (U : Set P) (hU : IsOpen U) (hp : p ∈ U) : AnalyticStationaryCharts G p s where + central := c.central.restrOpen U hU + opposite := c.opposite.restrOpen U hU + source_eq := by + change c.central.source ∩ U = c.opposite.source ∩ U + rw [c.source_eq] + point_mem := ⟨c.point_mem, hp⟩ + central_value := c.central_value + opposite_value := c.opposite_value + stateDomain := c.stateDomain + stateDomain_open := c.stateDomain_open + state_mem := c.state_mem + mapsTo_state := fun _ hy => c.mapsTo_state hy.1 + stationary := fun y hy => c.stationary y hy.1 + unique_zero := fun y hy z hz => c.unique_zero y hy.1 z hz + central_analytic := c.central_analytic.mono (fun _ h => h.1) + central_inverse_analytic := c.central_inverse_analytic.mono (fun _ h => h.1) + opposite_analytic := c.opposite_analytic.mono (fun _ h => h.1) + opposite_inverse_analytic := c.opposite_inverse_analytic.mono (fun _ h => h.1) + +@[simp] theorem restrictSource_central_coe + (c : AnalyticStationaryCharts G p s) (U : Set P) (hU : IsOpen U) (hp : p ∈ U) : + ((c.restrictSource U hU hp).central : P → S) = c.central := rfl + +@[simp] theorem restrictSource_opposite_coe + (c : AnalyticStationaryCharts G p s) (U : Set P) (hU : IsOpen U) (hp : p ∈ U) : + ((c.restrictSource U hU hp).opposite : P → S) = c.opposite := rfl + +@[simp] theorem restrictSource_source + (c : AnalyticStationaryCharts G p s) (U : Set P) (hU : IsOpen U) (hp : p ∈ U) : + (c.restrictSource U hU hp).central.source = c.central.source ∩ U := rfl + +/-- Any smaller open state neighborhood can be used after shrinking the common +parameter domain. All chart functions and all uniqueness conclusions are preserved. -/ +theorem exists_restrict_state + (c : AnalyticStationaryCharts G p s) (W : Set (S × S)) + (hW : IsOpen W) (hsW : s ∈ W) (hWV : W ⊆ c.stateDomain) : + ∃ d : AnalyticStationaryCharts G p s, + d.stateDomain = W ∧ d.central.source ⊆ c.central.source ∧ + (d.central : P → S) = c.central ∧ (d.opposite : P → S) = c.opposite := by + have hp₂ : p ∈ c.opposite.source := c.source_eq ▸ c.point_mem + have hc₁ : ContinuousAt c.central p := + c.central.continuousOn.continuousAt (c.central.open_source.mem_nhds c.point_mem) + have hc₂ : ContinuousAt c.opposite p := + c.opposite.continuousOn.continuousAt (c.opposite.open_source.mem_nhds hp₂) + have hval : (c.central p, c.opposite p) = s := + Prod.ext c.central_value c.opposite_value + have hpre : (fun y => (c.central y, c.opposite y)) ⁻¹' W ∈ 𝓝 p := + (hc₁.prodMk hc₂).preimage_mem_nhds (by rw [hval]; exact hW.mem_nhds hsW) + obtain ⟨U, hUsub, hUopen, hpU⟩ := mem_nhds_iff.mp hpre + let c₀ := c.restrictSource U hUopen hpU + let d : AnalyticStationaryCharts G p s := { + c₀ with + stateDomain := W + stateDomain_open := hW + state_mem := hsW + mapsTo_state := fun _ hy => hUsub hy.2 + unique_zero := fun y hy z hz => c.unique_zero y hy.1 z (hWV hz) } + exact ⟨d, rfl, (fun _ hy => hy.1), rfl, rfl⟩ + +/-- The common source can be chosen to be a genuine positive-radius ball, +inside any prescribed parameter neighborhood, without changing either chart function. -/ +theorem exists_restrict_ball + (c : AnalyticStationaryCharts G p s) (U : Set P) (hU : U ∈ 𝓝 p) : + ∃ r : ℝ, 0 < r ∧ ∃ d : AnalyticStationaryCharts G p s, + d.central.source = Metric.ball p r ∧ d.central.source ⊆ U ∧ + d.stateDomain = c.stateDomain ∧ + (d.central : P → S) = c.central ∧ (d.opposite : P → S) = c.opposite := by + obtain ⟨r, hr, hball⟩ := Metric.mem_nhds_iff.mp + (inter_mem (c.central.open_source.mem_nhds c.point_mem) hU) + let d := c.restrictSource (Metric.ball p r) Metric.isOpen_ball (Metric.mem_ball_self hr) + have hsource : d.central.source = Metric.ball p r := + inter_eq_right.mpr (fun _ hx => (hball hx).1) + refine ⟨r, hr, d, hsource, ?_, rfl, rfl, rfl⟩ + rw [hsource] + exact fun _ hx => (hball hx).2 + +end AnalyticStationaryCharts + +end Problem356.LocalImplicit + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/LocalPotentialBounds.lean b/lean/OAI/Analysis/CoulombTransport/LocalPotentialBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..11123ea360e03834084522d0c2c1f85e0e378e4b --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/LocalPotentialBounds.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.CoulombTransport.CertificateNeighborhoods + +namespace OAI + +universe uIndex uX + +noncomputable section +open Set Filter Metric +open scoped BigOperators +namespace Problem356 + +/-- Continuity of finitely many potentials at their centers gives one +positive radius and one positive absolute bound on every component ball. -/ +theorem exists_uniform_local_potential_bound {ι : Type uIndex} {X : Type uX} [Fintype ι] + [PseudoMetricSpace X] (p : ι → X) (v : ι → X → ℝ) + (hv : ∀ i, ContinuousAt (v i) (p i)) : + ∃ M : ℝ, 0 < M ∧ ∃ r : ℝ, 0 < r ∧ + ∀ i x, x ∈ ball (p i) r → |v i x| ≤ M := by + classical + let M : ℝ := (∑ i, |v i (p i)|) + 1 + have hsum : 0 ≤ ∑ i, |v i (p i)| := Finset.sum_nonneg (fun _ _ => abs_nonneg _) + have hM : 0 < M := by dsimp [M]; linarith + have hgap : ∀ i ∈ (Finset.univ : Finset ι), |v i (p i)| < M := by + intro i _ + have hi : |v i (p i)| ≤ ∑ j, |v j (p j)| := + Finset.single_le_sum (f := fun j => |v j (p j)|) (fun _ _ => abs_nonneg _) (Finset.mem_univ i) + dsimp [M] + linarith + obtain ⟨r, hr, h⟩ := finite_strict_neighborhoods Finset.univ p + (fun i x => |v i x|) (fun _ _ => M) + (fun i _ => (hv i).abs) (fun _ _ => continuousAt_const) hgap + refine ⟨M, hM, r, hr, ?_⟩ + intro i x hx + exact (h i (Finset.mem_univ i) x hx).le + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/LocalSplitting.lean b/lean/OAI/Analysis/CoulombTransport/LocalSplitting.lean new file mode 100644 index 0000000000000000000000000000000000000000..80ca02d66282c03382b6c0f586d04eb5f6470604 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/LocalSplitting.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.CoulombTransport.LocalBranchMeasure +import OAI.Analysis.CoulombTransport.SplittingConstruction + +namespace OAI + +universe uAlpha uIndex + +/-! +# The local-homeomorphism selection obstruction + +The local branch maps need not be measurable away from their source. Extending +them by a constant, then using concentration of the reference measure, gives +the exact obstruction stated for the original maps and their pushforwards. +-/ + +noncomputable section +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.LocalSplitting + +open LocalBranchMeasure Splitting + +variable {α : Type uAlpha} {ι : Type uIndex} [TopologicalSpace α] [MeasurableSpace α] + [BorelSpace α] [MeasurableEq α] [Fintype ι] + +/-- Local homeomorphic branches on disjoint components cannot admit a +measure-preserving deterministic selector when the central weight is larger. -/ +theorem no_preserving_local_branch_selection + (z : α) (e : ι → OpenPartialHomeomorph α α) + {ν : Measure α} [IsFiniteMeasure ν] {B : Set α} {c d : ℝ≥0∞} + (hν : ν univ ≠ 0) (hB : MeasurableSet B) + (hfull : ∀ᵐ x ∂ν, x ∈ B) + (hSource : ∀ i, B ⊆ (e i).source) + (hCentral : ∀ i, Disjoint B (e i '' B)) + (hPair : Pairwise fun i j => Disjoint (e i '' B) (e j '' B)) + (hdc : d < c) : + ¬ ∃ T : α → α, Measurable T ∧ + Measure.map T (splitMeasure ν c (fun _ => d) (fun i => e i)) = + splitMeasure ν c (fun _ => d) (fun i => e i) ∧ + (∀ᵐ x ∂ν, ∃ i, T x = e i x) := by + let H : ι → α → α := fun i => extendedBranch (e i) z + have hImage : ∀ i S, S ⊆ B → H i '' S = e i '' S := by + intro i S hS + exact extendedBranch_image (e i) z (hS.trans (hSource i)) + have hMap : ∀ i, Measure.map (H i) ν = Measure.map (e i) ν := by + intro i + apply map_extendedBranch (e i) z ν + exact hfull.mono fun x hx => hSource i hx + have hMixture : splitMeasure ν c (fun _ => d) H = + splitMeasure ν c (fun _ => d) (fun i => e i) := by + unfold splitMeasure + congr 1 + apply Finset.sum_congr rfl + intro i _ + rw [hMap i] + have hNo := no_preserving_splitMeasure_selection (H := H) hν hB hfull + (fun i => measurable_extendedBranch (e i) z) + (fun i => injOn_extendedBranch (e i) z (hSource i)) + (fun i S hS hSB => measurableSet_extendedBranch_image (e i) z hS + (hSB.trans (hSource i))) + (fun i => by rw [hImage i B subset_rfl]; exact hCentral i) + (fun i j hij => by + change Disjoint (H i '' B) (H j '' B) + rw [hImage i B subset_rfl, hImage j B subset_rfl] + exact hPair hij) hdc + rintro ⟨T, hT, hPres, hSel⟩ + apply hNo + refine ⟨T, hT, ?_, ?_⟩ + · simpa only [hMixture] using hPres + · filter_upwards [hfull, hSel] with x hx hxSel + obtain ⟨i, hi⟩ := hxSel + refine ⟨i, ?_⟩ + exact hi.trans (extendedBranch_apply_of_mem (e i) z (hSource i hx)).symm + +/-- The coefficients and four branches used by the Coulomb counterexample. -/ +theorem no_preserving_four_local_branches + (z : α) (e : Fin 4 → OpenPartialHomeomorph α α) + {ν : Measure α} [IsProbabilityMeasure ν] {B : Set α} + (hB : MeasurableSet B) (hfull : ∀ᵐ x ∂ν, x ∈ B) + (hSource : ∀ i, B ⊆ (e i).source) + (hCentral : ∀ i, Disjoint B (e i '' B)) + (hPair : Pairwise fun i j => Disjoint (e i '' B) (e j '' B)) : + ¬ ∃ T : α → α, Measurable T ∧ + Measure.map T (splitMeasure ν (1 / 3) (fun _ => 1 / 6) (fun i => e i)) = + splitMeasure ν (1 / 3) (fun _ => 1 / 6) (fun i => e i) ∧ + (∀ᵐ x ∂ν, ∃ i, T x = e i x) := by + apply no_preserving_local_branch_selection z e (by simp) hB hfull hSource hCentral hPair + norm_num + +end Problem356.LocalSplitting + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Main.lean b/lean/OAI/Analysis/CoulombTransport/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..d5c10e2a8820014586710e0c3ee3bf2f1662e351 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Main.lean @@ -0,0 +1,2 @@ +import OAI.Analysis.CoulombTransport.All +import OAI.Analysis.CoulombTransport.Conclusion diff --git a/lean/OAI/Analysis/CoulombTransport/Model.lean b/lean/OAI/Analysis/CoulombTransport/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..499921a1bdae97a2918cef8fcf3a777b72eada51 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Model.lean @@ -0,0 +1,98 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +abbrev E3 := EuclideanSpace ℝ (Fin 3) + +abbrev Triple := E3 × (E3 × E3) + +def tripleFst (t : Triple) : E3 := t.1 + +def tripleSnd (t : Triple) : E3 := t.2.1 + +def tripleThd (t : Triple) : E3 := t.2.2 + +def invDistance (x y : E3) : ℝ≥0∞ := + (ENNReal.ofReal ‖x - y‖)⁻¹ + +def coulombCost (t : Triple) : ℝ≥0∞ := + invDistance (tripleFst t) (tripleSnd t) + + invDistance (tripleFst t) (tripleThd t) + + invDistance (tripleSnd t) (tripleThd t) + +def IsThreeCoupling (mu : Measure E3) (pi : Measure Triple) : Prop := + IsProbabilityMeasure pi ∧ + Measure.map tripleFst pi = mu ∧ + Measure.map tripleSnd pi = mu ∧ + Measure.map tripleThd pi = mu + +def densityMeasure (rho : E3 → ℝ) : Measure E3 := + Measure.withDensity (volume : Measure E3) (fun x => ENNReal.ofReal (rho x)) + +def Preserves (mu : Measure E3) (T : E3 → E3) : Prop := + Measurable T ∧ Measure.map T mu = mu + +def graphCost (mu : Measure E3) (T2 T3 : E3 → E3) : ℝ≥0∞ := + ∫⁻ x, coulombCost (x, (T2 x, T3 x)) ∂mu + +def kantorovichValue (mu : Measure E3) : ℝ≥0∞ := + ⨅ (pi : Measure Triple), ⨅ (_h : IsThreeCoupling mu pi), + ∫⁻ t, coulombCost t ∂pi + +def mongeValue (mu : Measure E3) : ℝ≥0∞ := + ⨅ (T2 : E3 → E3), ⨅ (T3 : E3 → E3), + ⨅ (_h2 : Preserves mu T2), ⨅ (_h3 : Preserves mu T3), + graphCost mu T2 T3 + +def IsSmoothCompactProbabilityDensity (rho : E3 → ℝ) : Prop := + (∀ x, 0 ≤ rho x) ∧ + ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) rho ∧ + HasCompactSupport rho ∧ + ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) (fun x : E3 => Real.sqrt (rho x)) ∧ + HasCompactSupport (fun x : E3 => Real.sqrt (rho x)) ∧ + (∫ x : E3, rho x ∂(volume : Measure E3)) = 1 + +def KantorovichAttained (mu : Measure E3) : Prop := + ∃ pi : Measure Triple, + IsThreeCoupling mu pi ∧ + (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu + +def NoMongeOptimizer (mu : Measure E3) : Prop := + ∀ T2 T3 : E3 → E3, + Preserves mu T2 → Preserves mu T3 → + kantorovichValue mu < graphCost mu T2 T3 + +def FiniteMongeApproximation (mu : Measure E3) : Prop := + ∀ epsilon : ℝ, 0 < epsilon → + ∃ T2 T3 : E3 → E3, + Preserves mu T2 ∧ + Preserves mu T3 ∧ + graphCost mu T2 T3 < ⊤ ∧ + graphCost mu T2 T3 ≤ + kantorovichValue mu + ENNReal.ofReal epsilon + +def HasCoulombCounterexample (rho : E3 → ℝ) : Prop := + IsSmoothCompactProbabilityDensity rho ∧ + IsProbabilityMeasure (densityMeasure rho) ∧ + kantorovichValue (densityMeasure rho) < ⊤ ∧ + KantorovichAttained (densityMeasure rho) ∧ + NoMongeOptimizer (densityMeasure rho) + +def HasFullCoulombConclusion (rho : E3 → ℝ) : Prop := + HasCoulombCounterexample rho ∧ + mongeValue (densityMeasure rho) = + kantorovichValue (densityMeasure rho) ∧ + FiniteMongeApproximation (densityMeasure rho) + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/NeighborhoodCertificate.lean b/lean/OAI/Analysis/CoulombTransport/NeighborhoodCertificate.lean new file mode 100644 index 0000000000000000000000000000000000000000..a4c4ad2c8a31bca5e02d30c427baffdb8eb40750 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/NeighborhoodCertificate.lean @@ -0,0 +1,95 @@ +import Mathlib + +namespace OAI + +universe uIndex uX + +noncomputable section + +open Filter Metric Set + +namespace Problem356.Geometry + +/-- A finite family of positive radii admits a common positive lower bound, +including when the indexing type is empty. -/ +theorem exists_uniform_positive_radius {ι : Type uIndex} [Finite ι] + (r : ι → ℝ) (hr : ∀ i, 0 < r i) : + ∃ δ : ℝ, 0 < δ ∧ ∀ i, δ ≤ r i := by + classical + let := Fintype.ofFinite ι + let s : Finset ℝ := insert 1 (Finset.univ.image r) + have hs : s.Nonempty := ⟨1, Finset.mem_insert_self _ _⟩ + refine ⟨s.min' hs, ?_, ?_⟩ + · apply (Finset.lt_min'_iff s hs).2 + intro x hx + rcases Finset.mem_insert.mp hx with rfl | hx + · norm_num + · rcases Finset.mem_image.mp hx with ⟨i, _, rfl⟩ + exact hr i + · intro i + exact Finset.min'_le s (r i) (Finset.mem_insert_of_mem + (Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩)) + +/-- A common ball around a point contained in finitely many open sets. +This applies to the open images of the local inverse branches. -/ +theorem finite_common_ball {ι : Type uIndex} {X : Type uX} [Finite ι] [PseudoMetricSpace X] + (a : X) (U : ι → Set X) (hU : ∀ i, IsOpen (U i)) + (ha : ∀ i, a ∈ U i) : + ∃ δ : ℝ, 0 < δ ∧ ∀ i, ball a δ ⊆ U i := by + have hopen : IsOpen (⋂ i, U i) := isOpen_iInter_of_finite hU + have hamem : a ∈ ⋂ i, U i := mem_iInter.mpr ha + obtain ⟨δ, hδ, hsub⟩ := Metric.isOpen_iff.mp hopen a hamem + exact ⟨δ, hδ, fun i x hx => mem_iInter.mp (hsub hx) i⟩ + +/-- Distinct finitely many centers admit a common positive radius with +pairwise disjoint closed balls. -/ +theorem finite_disjoint_closedBalls {ι : Type uIndex} {X : Type uX} [Finite ι] [MetricSpace X] + (a : ι → X) (ha : Function.Injective a) : + ∃ δ : ℝ, 0 < δ ∧ Pairwise (fun i j => + Disjoint (closedBall (a i) δ) (closedBall (a j) δ)) := by + let J := {q : ι × ι // q.1 ≠ q.2} + let r : J → ℝ := fun q => dist (a q.val.1) (a q.val.2) / 3 + have hr : ∀ q, 0 < r q := by + intro q + exact div_pos (dist_pos.mpr (ha.ne q.property)) (by norm_num) + obtain ⟨δ, hδ, hbound⟩ := exists_uniform_positive_radius r hr + refine ⟨δ, hδ, ?_⟩ + intro i j hij + apply Metric.closedBall_disjoint_closedBall + have h := hbound ⟨(i, j), hij⟩ + change δ ≤ dist (a i) (a j) / 3 at h + linarith + +/-- One radius may simultaneously separate all components and keep each +closed component ball inside a prescribed open neighborhood. -/ +theorem finite_disjoint_closedBalls_subset {ι : Type uIndex} {X : Type uX} [Finite ι] + [MetricSpace X] (a : ι → X) (ha : Function.Injective a) + (U : ι → Set X) (hU : ∀ i, IsOpen (U i)) + (haU : ∀ i, a i ∈ U i) : + ∃ δ : ℝ, 0 < δ ∧ + (∀ i, closedBall (a i) δ ⊆ U i) ∧ + Pairwise (fun i j => Disjoint (closedBall (a i) δ) (closedBall (a j) δ)) := by + have hlocal : ∀ i, ∃ r : ℝ, 0 < r ∧ ball (a i) r ⊆ U i := by + intro i + exact Metric.isOpen_iff.mp (hU i) (a i) (haU i) + choose r hr hsub using hlocal + obtain ⟨ε, hε, hεr⟩ := exists_uniform_positive_radius r hr + obtain ⟨η, hη, hdisj⟩ := finite_disjoint_closedBalls a ha + refine ⟨min (ε / 2) η, lt_min (half_pos hε) hη, ?_, ?_⟩ + · intro i x hx + apply hsub i + rw [mem_ball] + have hx' : dist x (a i) ≤ min (ε / 2) η := hx + have hsmall : min (ε / 2) η ≤ ε / 2 := min_le_left _ _ + have hri := hεr i + linarith + · intro i j hij + exact (hdisj hij).mono + (closedBall_subset_closedBall (min_le_right _ _)) + (closedBall_subset_closedBall (min_le_right _ _)) + +end Problem356.Geometry + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/OptimalLocalization.lean b/lean/OAI/Analysis/CoulombTransport/OptimalLocalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..a607724e2ea0a71217090735ebed1d9668df210d --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/OptimalLocalization.lean @@ -0,0 +1,104 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- A nonnegative dual certificate after adding a finite constant to the cost. +The shift permits a signed bounded real-valued supporting potential. -/ +structure ShiftedCoulombCertificate (mu : Measure E3) (value : ℝ≥0∞) where + potential : Triple → ℝ≥0∞ + shift : ℝ≥0∞ + shift_ne_top : shift ≠ ⊤ + lower_bound : ∀ pi : Measure Triple, IsThreeCoupling mu pi → + ∀ᵐ t ∂pi, potential t ≤ coulombCost t + shift + integral_eq : ∀ pi : Measure Triple, IsThreeCoupling mu pi → + (∫⁻ t, potential t ∂pi) = value + shift + +namespace ShiftedCoulombCertificate + +variable {mu : Measure E3} {value : ℝ≥0∞} + +private theorem measurable_coulomb : Measurable coulombCost := by + unfold coulombCost invDistance tripleFst tripleSnd tripleThd + fun_prop + +/-- A constant shift integrates to itself under any feasible coupling. -/ +theorem lintegral_cost_add (cert : ShiftedCoulombCertificate mu value) + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) : + (∫⁻ t, coulombCost t + cert.shift ∂pi) = + (∫⁻ t, coulombCost t ∂pi) + cert.shift := by + have : IsProbabilityMeasure pi := hpi.1 + rw [lintegral_add_right _ measurable_const] + simp + +/-- Every coupling has cost at least the certified value. -/ +theorem le_cost (cert : ShiftedCoulombCertificate mu value) + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) : + value ≤ ∫⁻ t, coulombCost t ∂pi := by + apply (ENNReal.add_le_add_iff_right cert.shift_ne_top).mp + rw [← cert.integral_eq pi hpi, ← cert.lintegral_cost_add hpi] + exact lintegral_mono_ae (cert.lower_bound pi hpi) + +/-- A feasible candidate matching a certificate realizes the exact infimum. -/ +theorem value_eq (cert : ShiftedCoulombCertificate mu value) + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) + (hcost : (∫⁻ t, coulombCost t ∂pi) = value) : + kantorovichValue mu = value := by + apply le_antisymm + · exact iInf_le_of_le pi (iInf_le_of_le hpi hcost.le) + · exact le_iInf fun q => le_iInf fun hq => cert.le_cost hq + +/-- A matching candidate supplies the attainment assertion. -/ +theorem attained (cert : ShiftedCoulombCertificate mu value) + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) + (hcost : (∫⁻ t, coulombCost t ∂pi) = value) : + KantorovichAttained mu := by + exact ⟨pi, hpi, hcost.trans (cert.value_eq hpi hcost).symm⟩ + +/-- Equality of the finite primal and dual integrals forces equality almost + everywhere in the supporting inequality. -/ +theorem ae_contact (cert : ShiftedCoulombCertificate mu value) + (hfinite : value ≠ ⊤) {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) + (hcost : (∫⁻ t, coulombCost t ∂pi) = value) : + ∀ᵐ t ∂pi, cert.potential t = coulombCost t + cert.shift := by + apply ae_eq_of_ae_le_of_lintegral_le (cert.lower_bound pi hpi) + · rw [cert.integral_eq pi hpi] + exact ENNReal.add_ne_top.mpr ⟨hfinite, cert.shift_ne_top⟩ + · exact (measurable_coulomb.add measurable_const).aemeasurable + · rw [cert.lintegral_cost_add hpi, cert.integral_eq pi hpi, hcost] + +/-- An optimal plan is concentrated on any prescribed set that contains the +contact locus of the supporting certificate. -/ +theorem ae_mem_of_optimal (cert : ShiftedCoulombCertificate mu value) + (hfinite : value ≠ ⊤) (hvalue : kantorovichValue mu = value) + {pi : Measure Triple} (hpi : IsThreeCoupling mu pi) + (hopt : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu) + {contact : Set Triple} + (hcontact : ∀ t, cert.potential t = coulombCost t + cert.shift → t ∈ contact) : + ∀ᵐ t ∂pi, t ∈ contact := by + exact (cert.ae_contact hfinite hpi (hopt.trans hvalue)).mono hcontact + +end ShiftedCoulombCertificate + +theorem noMongeOptimizer_of_ne + {mu : Measure E3} + (hlower : ∀ T2 T3, Preserves mu T2 → Preserves mu T3 → + kantorovichValue mu ≤ graphCost mu T2 T3) + (hne : ∀ T2 T3, Preserves mu T2 → Preserves mu T3 → + graphCost mu T2 T3 ≠ kantorovichValue mu) : + NoMongeOptimizer mu := by + intro T2 T3 h2 h3 + exact lt_of_le_of_ne (hlower T2 T3 h2 h3) (hne T2 T3 h2 h3).symm + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/PairEnergyFinite.lean b/lean/OAI/Analysis/CoulombTransport/PairEnergyFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..ddeb73e008a99f9c3adb5778bdbf03d8ed7bf173 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/PairEnergyFinite.lean @@ -0,0 +1,123 @@ +import OAI.Analysis.CoulombTransport.ProductPlan + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356 + +theorem integrableOn_inv_norm_ball (r : ℝ) : + IntegrableOn (fun x : E3 => ‖x‖⁻¹) (Metric.ball 0 r) volume := by + refine integrableOn_ball_of_norm_le_rpow (by simp [E3]) (C := 1) (α := 1) + (by norm_num [E3]) ?_ ?_ + · exact Filter.Eventually.of_forall (fun x => by + simp [Real.rpow_neg_one]) + · fun_prop + +/-- The Coulomb singularity is integrable on every bounded ball in dimension three. -/ +theorem lintegral_invDistance_zero_ball_lt_top (r : ℝ) : + (∫⁻ x in Metric.ball (0 : E3) r, invDistance 0 x ∂volume) < ⊤ := by + have heq : (fun x : E3 => invDistance 0 x) =ᵐ[ + (volume : Measure E3).restrict (Metric.ball 0 r)] + (fun x => ENNReal.ofReal (‖x‖⁻¹)) := by + filter_upwards [ae_restrict_of_ae ((volume : Measure E3).ae_ne 0)] with x hx + simp [invDistance, ENNReal.ofReal_inv_of_pos (norm_pos_iff.mpr hx)] + rw [lintegral_congr_ae heq] + exact (integrableOn_inv_norm_ball r).lintegral_lt_top + +/-- Local part of the singular kernel; the omitted tail is bounded by one. -/ +def localCoulombKernel (x : E3) : ℝ≥0∞ := + (Metric.ball (0 : E3) 1).indicator (fun x => invDistance 0 x) x + +theorem measurable_localCoulombKernel : Measurable localCoulombKernel := by + unfold localCoulombKernel + apply Measurable.indicator _ measurableSet_ball + unfold invDistance + fun_prop + +theorem lintegral_localCoulombKernel_lt_top : + (∫⁻ x : E3, localCoulombKernel x ∂volume) < ⊤ := by + simp only [localCoulombKernel, lintegral_indicator measurableSet_ball] + exact lintegral_invDistance_zero_ball_lt_top 1 + +theorem densityMeasure_le_smul_volume_of_le {rho : E3 → ℝ} {M : ℝ} + (h : ∀ x, rho x ≤ M) : + densityMeasure rho ≤ ENNReal.ofReal M • (volume : Measure E3) := by + have hb := withDensity_mono (μ := (volume : Measure E3)) + (Filter.Eventually.of_forall fun x => ENNReal.ofReal_le_ofReal (h x)) + simpa [densityMeasure, withDensity_const] using hb + +theorem invDistance_le_localCoulombKernel_add_one (x y : E3) : + invDistance x y ≤ localCoulombKernel (x - y) + 1 := by + by_cases h : x - y ∈ Metric.ball (0 : E3) 1 + · simp only [localCoulombKernel, indicator_of_mem h, invDistance, zero_sub, norm_neg] + exact le_add_of_nonneg_right zero_le_one + · simp only [localCoulombKernel, indicator_of_notMem h, zero_add] + apply ENNReal.inv_le_one.mpr + have hn : 1 ≤ ‖x - y‖ := by simpa only [Metric.mem_ball, dist_zero_right, not_lt] using h + exact_mod_cast (ENNReal.ofReal_le_ofReal hn) + +/-- Uniform control of the Coulomb potential for a probability with bounded density. -/ +theorem lintegral_invDistance_le_of_measure_le (mu : Measure E3) + [IsProbabilityMeasure mu] {C : ℝ≥0∞} + (hmu : mu ≤ C • (volume : Measure E3)) (x : E3) : + (∫⁻ y, invDistance x y ∂mu) ≤ + C * (∫⁻ y : E3, localCoulombKernel y ∂volume) + 1 := by + calc + (∫⁻ y, invDistance x y ∂mu) ≤ + ∫⁻ y, localCoulombKernel (x - y) + 1 ∂mu := + lintegral_mono (invDistance_le_localCoulombKernel_add_one x) + _ = (∫⁻ y, localCoulombKernel (x - y) ∂mu) + 1 := by + rw [lintegral_add_left (f := fun y : E3 => localCoulombKernel (x - y)) + (measurable_localCoulombKernel.comp (by fun_prop))] + simp + _ ≤ (∫⁻ y, localCoulombKernel (x - y) ∂(C • (volume : Measure E3))) + 1 := by + exact add_le_add (lintegral_mono' hmu le_rfl) le_rfl + _ = C * (∫⁻ y : E3, localCoulombKernel y ∂volume) + 1 := by + rw [lintegral_smul_measure, lintegral_sub_left_eq_self] + rfl + +theorem coulombPairEnergy_lt_top_of_measure_le (mu : Measure E3) + [IsProbabilityMeasure mu] {C : ℝ≥0∞} (hC : C < ⊤) + (hmu : mu ≤ C • (volume : Measure E3)) : + coulombPairEnergy mu < ⊤ := by + have hm : Measurable (fun p : E3 × E3 => invDistance p.1 p.2) := by + unfold invDistance + fun_prop + unfold coulombPairEnergy + rw [lintegral_prod _ hm.aemeasurable] + apply lt_of_le_of_lt (lintegral_mono (lintegral_invDistance_le_of_measure_le mu hmu)) + simp only [lintegral_const, measure_univ, mul_one] + exact ENNReal.add_lt_top.mpr ⟨ENNReal.mul_lt_top hC lintegral_localCoulombKernel_lt_top, + ENNReal.one_lt_top⟩ + +theorem coulombPairEnergy_densityMeasure_lt_top_of_bounded {rho : E3 → ℝ} + [IsProbabilityMeasure (densityMeasure rho)] {M : ℝ} (h : ∀ x, rho x ≤ M) : + coulombPairEnergy (densityMeasure rho) < ⊤ := by + exact coulombPairEnergy_lt_top_of_measure_le _ ENNReal.ofReal_lt_top + (densityMeasure_le_smul_volume_of_le h) + +theorem coulombPairEnergy_densityMeasure_lt_top {rho : E3 → ℝ} + [IsProbabilityMeasure (densityMeasure rho)] + (h : IsSmoothCompactProbabilityDensity rho) : + coulombPairEnergy (densityMeasure rho) < ⊤ := by + obtain ⟨M, hM⟩ := h.2.1.continuous.bounded_above_of_compact_support h.2.2.1 + apply coulombPairEnergy_densityMeasure_lt_top_of_bounded (M := M) + intro x + exact (le_abs_self (rho x)).trans (hM x) + +theorem kantorovichValue_densityMeasure_lt_top {rho : E3 → ℝ} + [IsProbabilityMeasure (densityMeasure rho)] + (h : IsSmoothCompactProbabilityDensity rho) : + kantorovichValue (densityMeasure rho) < ⊤ := by + exact kantorovichValue_lt_top_of_pairEnergy_lt_top _ + (coulombPairEnergy_densityMeasure_lt_top h) + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/PartitionLabel.lean b/lean/OAI/Analysis/CoulombTransport/PartitionLabel.lean new file mode 100644 index 0000000000000000000000000000000000000000..e0dcacfcd9bb9d3e62ce08a8a3828baf39fbca82 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/PartitionLabel.lean @@ -0,0 +1,96 @@ +import Mathlib + +namespace OAI + +universe uX uIndex + +noncomputable section + +open Set MeasureTheory + +namespace Problem356.FiniteCells + +/-- The exact label of a point in a disjoint family; points outside all cells +are assigned `none`, without choosing an arbitrary distinguished cell. -/ +def cellLabel {X : Type uX} {ι : Type uIndex} (A : ι → Set X) (x : X) : Option ι := + by + classical + exact if h : ∃ i, x ∈ A i then some (Classical.choose h) else none + +lemma cellLabel_eq_some_iff {X : Type uX} {ι : Type uIndex} {A : ι → Set X} + (hDisjoint : Pairwise (fun i j => Disjoint (A i) (A j))) (x : X) (i : ι) : + cellLabel A x = some i ↔ x ∈ A i := by + classical + unfold cellLabel + split_ifs with h + · constructor + · intro hi + have hi' := Option.some.inj hi + rw [← hi'] + exact Classical.choose_spec h + · intro hx + congr 1 + by_contra hne + exact Set.disjoint_left.mp (hDisjoint hne) (Classical.choose_spec h) hx + · have hi : x ∉ A i := fun hx => h ⟨i, hx⟩ + simp [hi] + +lemma cellLabel_eq_none_iff {X : Type uX} {ι : Type uIndex} (A : ι → Set X) (x : X) : + cellLabel A x = none ↔ x ∉ ⋃ i, A i := by + classical + by_cases h : ∃ i, x ∈ A i + · simp only [cellLabel, dite_eq_left h, reduceCtorEq, false_iff, not_not] + exact mem_iUnion.mpr h + · simp only [cellLabel, dite_eq_right h, true_iff] + exact fun hx => h (mem_iUnion.mp hx) + +lemma cellLabel_fiber_some {X : Type uX} {ι : Type uIndex} {A : ι → Set X} + (hDisjoint : Pairwise (fun i j => Disjoint (A i) (A j))) (i : ι) : + cellLabel A ⁻¹' {some i} = A i := by + ext x + exact cellLabel_eq_some_iff hDisjoint x i + +lemma cellLabel_fiber_none {X : Type uX} {ι : Type uIndex} (A : ι → Set X) : + cellLabel A ⁻¹' {none} = (⋃ i, A i)ᶜ := by + ext x + exact cellLabel_eq_none_iff A x + +lemma measurable_cellLabel {X : Type uX} {ι : Type uIndex} [MeasurableSpace X] + [MeasurableSpace (Option ι)] [Countable ι] {A : ι → Set X} + (hA : ∀ i, MeasurableSet (A i)) + (hDisjoint : Pairwise (fun i j => Disjoint (A i) (A j))) : + Measurable (cellLabel A) := by + apply measurable_to_countable' + intro i + cases i with + | none => + rw [cellLabel_fiber_none] + exact (MeasurableSet.iUnion hA).compl + | some i => + rw [cellLabel_fiber_some hDisjoint] + exact hA i + +/-- Equal source cell masses give equal laws of the exact label, provided +both measures are concentrated on the union of the cells. -/ +lemma map_cellLabel_eq_of_cell_masses {X : Type uX} {ι : Type uIndex} [MeasurableSpace X] + [MeasurableSpace (Option ι)] [MeasurableSingletonClass (Option ι)] [Countable ι] + {μ ν : Measure X} {A : ι → Set X} + (hA : ∀ i, MeasurableSet (A i)) + (hDisjoint : Pairwise (fun i j => Disjoint (A i) (A j))) + (hμ : μ (⋃ i, A i)ᶜ = 0) (hν : ν (⋃ i, A i)ᶜ = 0) + (hmass : ∀ i, μ (A i) = ν (A i)) : + Measure.map (cellLabel A) μ = Measure.map (cellLabel A) ν := by + have hm := measurable_cellLabel hA hDisjoint + apply Measure.ext_of_singleton + intro i + rw [Measure.map_apply hm (measurableSet_singleton i), + Measure.map_apply hm (measurableSet_singleton i)] + cases i with + | none => simp only [cellLabel_fiber_none, hμ, hν] + | some i => simpa only [cellLabel_fiber_some hDisjoint] using hmass i + +end Problem356.FiniteCells + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/PartitionTransport.lean b/lean/OAI/Analysis/CoulombTransport/PartitionTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..a82971b9e16d87f07da7e42654bcaa351f27f36c --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/PartitionTransport.lean @@ -0,0 +1,199 @@ +import Mathlib + +namespace OAI + +universe uAlpha uBeta uIndex uKappa + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.PartitionTransport + +variable {α : Type uAlpha} {β : Type uBeta} {ι : Type uIndex} [MeasurableSpace α] [MeasurableSpace β] + +/-- Gluing measurable transports on a countable measurable partition gives the +sum of their restricted pushforwards. The partition need only cover almost everywhere. -/ +theorem exists_map_eq_sum_of_partition [Countable ι] [Nonempty ι] + (μ : Measure α) (B : ι → Set α) + (hB : ∀ i, MeasurableSet (B i)) + (hdisj : Pairwise fun i j => Disjoint (B i) (B j)) + (hcover : ∀ᵐ x ∂μ, x ∈ ⋃ i, B i) + (T : ι → α → β) (hT : ∀ i, Measurable (T i)) : + ∃ f : α → β, Measurable f ∧ + (∀ i, EqOn f (T i) (B i)) ∧ + Measure.map f μ = Measure.sum (fun i => Measure.map (T i) (μ.restrict (B i))) := by + obtain ⟨f, hf, hfg⟩ := exists_measurable_piecewise B hB T hT (by + intro i j hij x hx + exact False.elim (Set.disjoint_left.mp (hdisj hij) hx.1 hx.2)) + refine ⟨f, hf, hfg, ?_⟩ + have hdecomp : μ = Measure.sum (fun i => μ.restrict (B i)) := by + rw [← Measure.restrict_iUnion hdisj hB, Measure.restrict_eq_self_of_ae_mem hcover] + calc + Measure.map f μ = Measure.map f (Measure.sum (fun i => μ.restrict (B i))) := + congrArg (Measure.map f) hdecomp + _ = Measure.sum (fun i => Measure.map f (μ.restrict (B i))) := + Measure.map_sum hf.aemeasurable + _ = _ := by + congr 1 + funext i + apply Measure.map_congr + filter_upwards [ae_restrict_mem (hB i)] with x hx + exact hfg i hx + +/-- Prescribed laws on partition pieces can be glued into a transport to their sum. -/ +theorem exists_map_eq_of_partition [Countable ι] [Nonempty ι] + (μ : Measure α) (B : ι → Set α) + (hB : ∀ i, MeasurableSet (B i)) + (hdisj : Pairwise fun i j => Disjoint (B i) (B j)) + (hcover : ∀ᵐ x ∂μ, x ∈ ⋃ i, B i) + (T : ι → α → β) (hT : ∀ i, Measurable (T i)) + (ν : ι → Measure β) + (hmap : ∀ i, Measure.map (T i) (μ.restrict (B i)) = ν i) : + ∃ f : α → β, Measurable f ∧ + (∀ i, EqOn f (T i) (B i)) ∧ Measure.map f μ = Measure.sum ν := by + obtain ⟨f, hf, hfg, hsum⟩ := + exists_map_eq_sum_of_partition μ B hB hdisj hcover T hT + refine ⟨f, hf, hfg, ?_⟩ + simpa only [hmap] using hsum + +/-- The finite form, using the usual finite sum of target measures. -/ +theorem exists_map_eq_finset_sum_of_partition [Fintype ι] [Nonempty ι] + (μ : Measure α) (B : ι → Set α) + (hB : ∀ i, MeasurableSet (B i)) + (hdisj : Pairwise fun i j => Disjoint (B i) (B j)) + (hcover : ∀ᵐ x ∂μ, x ∈ ⋃ i, B i) + (T : ι → α → β) (hT : ∀ i, Measurable (T i)) + (ν : ι → Measure β) + (hmap : ∀ i, Measure.map (T i) (μ.restrict (B i)) = ν i) : + ∃ f : α → β, Measurable f ∧ + (∀ i, EqOn f (T i) (B i)) ∧ Measure.map f μ = ∑ i, ν i := by + simpa only [Measure.sum_fintype] using + exists_map_eq_of_partition μ B hB hdisj hcover T hT ν hmap + +/-- The pushforward law of a label that is constant almost everywhere on each +partition piece is the atomic measure with those piece masses. -/ +theorem map_eq_sum_dirac_of_partition [Countable ι] + (μ : Measure α) (B : ι → Set α) + (hB : ∀ i, MeasurableSet (B i)) + (hdisj : Pairwise fun i j => Disjoint (B i) (B j)) + (hcover : ∀ᵐ x ∂μ, x ∈ ⋃ i, B i) + (L : α → β) (hL : Measurable L) (label : ι → β) + (hlabel : ∀ i, ∀ᵐ x ∂μ.restrict (B i), L x = label i) : + Measure.map L μ = Measure.sum (fun i => μ (B i) • Measure.dirac (label i)) := by + have hdecomp : μ = Measure.sum (fun i => μ.restrict (B i)) := by + rw [← Measure.restrict_iUnion hdisj hB, Measure.restrict_eq_self_of_ae_mem hcover] + calc + Measure.map L μ = Measure.map L (Measure.sum (fun i => μ.restrict (B i))) := + congrArg (Measure.map L) hdecomp + _ = Measure.sum (fun i => Measure.map L (μ.restrict (B i))) := + Measure.map_sum hL.aemeasurable + _ = _ := by + congr 1 + funext i + rw [Measure.map_congr (hlabel i), Measure.map_const] + simp + +/-- An exact agreement on a measurable piece gives equality of restricted laws. -/ +theorem map_restrict_eq_of_eqOn (μ : Measure α) {B : Set α} + (hB : MeasurableSet B) {f g : α → β} (heq : EqOn f g B) : + Measure.map f (μ.restrict B) = Measure.map g (μ.restrict B) := by + apply Measure.map_congr + filter_upwards [ae_restrict_mem hB] with x hx + exact heq hx + +/-- Glue two families of transports simultaneously. Their marginal laws and +joint finite-cell law are all explicit. This is the graph-plan step in the +cellwise approximation construction. -/ +theorem exists_pair_maps_with_label_law [Countable ι] [Nonempty ι] + {κ : Type uKappa} [MeasurableSpace κ] + (μ : Measure α) (B : ι → Set α) + (hB : ∀ i, MeasurableSet (B i)) + (hdisj : Pairwise fun i j => Disjoint (B i) (B j)) + (hcover : ∀ᵐ x ∂μ, x ∈ ⋃ i, B i) + (T₂ T₃ : ι → α → α) + (hT₂ : ∀ i, Measurable (T₂ i)) (hT₃ : ∀ i, Measurable (T₃ i)) + (ν₂ ν₃ : ι → Measure α) + (hmap₂ : ∀ i, Measure.map (T₂ i) (μ.restrict (B i)) = ν₂ i) + (hmap₃ : ∀ i, Measure.map (T₃ i) (μ.restrict (B i)) = ν₃ i) + (hsum₂ : Measure.sum ν₂ = μ) (hsum₃ : Measure.sum ν₃ = μ) + (p : α → κ) (hp : Measurable p) (l₁ l₂ l₃ : ι → κ) + (hlabel₁ : ∀ i, ∀ᵐ x ∂μ.restrict (B i), p x = l₁ i) + (hlabel₂ : ∀ i, ∀ᵐ x ∂ν₂ i, p x = l₂ i) + (hlabel₃ : ∀ i, ∀ᵐ x ∂ν₃ i, p x = l₃ i) : + ∃ f g : α → α, + Measurable f ∧ Measurable g ∧ + Measure.map f μ = μ ∧ Measure.map g μ = μ ∧ + Measure.map (fun x => (p x, (p (f x), p (g x)))) μ = + Measure.sum (fun i => μ (B i) • Measure.dirac (l₁ i, (l₂ i, l₃ i))) := by + obtain ⟨f, hf, hfB, hfmap⟩ := + exists_map_eq_of_partition μ B hB hdisj hcover T₂ hT₂ ν₂ hmap₂ + obtain ⟨g, hg, hgB, hgmap⟩ := + exists_map_eq_of_partition μ B hB hdisj hcover T₃ hT₃ ν₃ hmap₃ + refine ⟨f, g, hf, hg, hfmap.trans hsum₂, hgmap.trans hsum₃, ?_⟩ + apply map_eq_sum_dirac_of_partition μ B hB hdisj hcover + (fun x => (p x, (p (f x), p (g x)))) + (hp.prodMk ((hp.comp hf).prodMk (hp.comp hg))) + (fun i => (l₁ i, (l₂ i, l₃ i))) + intro i + have hfmapB : Measure.map f (μ.restrict (B i)) = ν₂ i := + (map_restrict_eq_of_eqOn μ (hB i) (hfB i)).trans (hmap₂ i) + have hgmapB : Measure.map g (μ.restrict (B i)) = ν₃ i := + (map_restrict_eq_of_eqOn μ (hB i) (hgB i)).trans (hmap₃ i) + have hfLabel : ∀ᵐ x ∂μ.restrict (B i), p (f x) = l₂ i := by + refine ae_of_ae_map (μ := μ.restrict (B i)) (p := fun y => p y = l₂ i) hf.aemeasurable ?_ + rw [hfmapB] + exact hlabel₂ i + have hgLabel : ∀ᵐ x ∂μ.restrict (B i), p (g x) = l₃ i := by + refine ae_of_ae_map (μ := μ.restrict (B i)) (p := fun y => p y = l₃ i) hg.aemeasurable ?_ + rw [hgmapB] + exact hlabel₃ i + filter_upwards [hlabel₁ i, hfLabel, hgLabel] with x hx hx₂ hx₃ + simp only [hx, hx₂, hx₃] + +/-- Redistributing weights to the normalized restrictions of a finite partition +preserves the measure when the weights have the prescribed marginal sums. +Zero-mass cells require no positivity assumption. -/ +theorem sum_normalized_restrict_eq [Fintype ι] + {κ : Type uKappa} [Fintype κ] [DecidableEq κ] + (μ : Measure α) [IsFiniteMeasure μ] (A : κ → Set α) + (hA : ∀ j, MeasurableSet (A j)) + (hdisj : Pairwise fun i j => Disjoint (A i) (A j)) + (hcover : ∀ᵐ x ∂μ, x ∈ ⋃ j, A j) + (label : ι → κ) (w : ι → ℝ≥0∞) + (hweights : ∀ j, ∑ i ∈ Finset.univ.filter (fun i => label i = j), w i = μ (A j)) : + (∑ i, (w i / μ (A (label i))) • μ.restrict (A (label i))) = μ := by + classical + calc + (∑ i, (w i / μ (A (label i))) • μ.restrict (A (label i))) = + ∑ j, ∑ i ∈ Finset.univ.filter (fun i => label i = j), + (w i / μ (A (label i))) • μ.restrict (A (label i)) := + (Finset.sum_fiberwise Finset.univ label _).symm + _ = ∑ j, μ.restrict (A j) := by + apply Finset.sum_congr rfl + intro j hj + calc + (∑ i ∈ Finset.univ.filter (fun i => label i = j), + (w i / μ (A (label i))) • μ.restrict (A (label i))) = + ∑ i ∈ Finset.univ.filter (fun i => label i = j), + (w i / μ (A j)) • μ.restrict (A j) := by + apply Finset.sum_congr rfl + intro i hi + rw [(Finset.mem_filter.mp hi).2] + _ = μ.restrict (A j) := by + by_cases hz : μ (A j) = 0 + · simp [Measure.restrict_eq_zero.mpr hz] + · rw [← Finset.sum_smul] + simp_rw [ENNReal.div_eq_inv_mul] + rw [← Finset.mul_sum, hweights j, + ENNReal.inv_mul_cancel hz (measure_ne_top μ (A j)), one_smul] + _ = μ := by + rw [← Measure.sum_fintype, ← Measure.restrict_iUnion hdisj hA, + Measure.restrict_eq_self_of_ae_mem hcover] + +end Problem356.PartitionTransport + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/ProductPlan.lean b/lean/OAI/Analysis/CoulombTransport/ProductPlan.lean new file mode 100644 index 0000000000000000000000000000000000000000..55cd18038c6090854b3e923b72b42c1b5498c2ea --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/ProductPlan.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- The independent triple is always an admissible coupling of a probability. -/ +theorem isThreeCoupling_prod (mu : Measure E3) [IsProbabilityMeasure mu] : + IsThreeCoupling mu (mu.prod (mu.prod mu)) := by + refine ⟨inferInstance, ?_, ?_, ?_⟩ + · change Measure.map Prod.fst (mu.prod (mu.prod mu)) = mu + simp + · change Measure.map (Prod.fst ∘ Prod.snd) (mu.prod (mu.prod mu)) = mu + rw [← Measure.map_map measurable_fst measurable_snd] + simp + · change Measure.map (Prod.snd ∘ Prod.snd) (mu.prod (mu.prod mu)) = mu + rw [← Measure.map_map measurable_snd measurable_snd] + simp + +/-- The Coulomb pair interaction is measurable, including its infinite diagonal. -/ +private theorem measurable_pairInteraction : + Measurable (fun p : E3 × E3 => invDistance p.1 p.2) := by + unfold invDistance + fun_prop + +theorem map_pair_fst_snd_prod (mu : Measure E3) [IsProbabilityMeasure mu] : + Measure.map (fun t : Triple => (t.1, t.2.1)) (mu.prod (mu.prod mu)) = + mu.prod mu := by + change Measure.map (Prod.map id Prod.fst) (mu.prod (mu.prod mu)) = mu.prod mu + rw [← Measure.map_prod_map mu (mu.prod mu) measurable_id measurable_fst] + simp + +theorem map_pair_fst_thd_prod (mu : Measure E3) [IsProbabilityMeasure mu] : + Measure.map (fun t : Triple => (t.1, t.2.2)) (mu.prod (mu.prod mu)) = + mu.prod mu := by + change Measure.map (Prod.map id Prod.snd) (mu.prod (mu.prod mu)) = mu.prod mu + rw [← Measure.map_prod_map mu (mu.prod mu) measurable_id measurable_snd] + simp + +theorem lintegral_three_pairs_prod (mu : Measure E3) [IsProbabilityMeasure mu] + (f : E3 × E3 → ℝ≥0∞) (hf : Measurable f) : + (∫⁻ t : Triple, f (t.1, t.2.1) + f (t.1, t.2.2) + f t.2 + ∂(mu.prod (mu.prod mu))) = 3 * ∫⁻ p, f p ∂(mu.prod mu) := by + have h12 : (∫⁻ t : Triple, f (t.1, t.2.1) ∂(mu.prod (mu.prod mu))) = + ∫⁻ p, f p ∂(mu.prod mu) := by + rw [← lintegral_map (g := fun t : Triple => (t.1, t.2.1)) hf (by fun_prop), + map_pair_fst_snd_prod] + have h13 : (∫⁻ t : Triple, f (t.1, t.2.2) ∂(mu.prod (mu.prod mu))) = + ∫⁻ p, f p ∂(mu.prod mu) := by + rw [← lintegral_map (g := fun t : Triple => (t.1, t.2.2)) hf (by fun_prop), + map_pair_fst_thd_prod] + have h23 : (∫⁻ t : Triple, f t.2 ∂(mu.prod (mu.prod mu))) = + ∫⁻ p, f p ∂(mu.prod mu) := by + rw [← lintegral_map hf measurable_snd] + simp + rw [lintegral_add_left (by fun_prop), lintegral_add_left (by fun_prop), h12, h13, h23] + ring + +/-- The pair interaction energy of an independently sampled pair. -/ +def coulombPairEnergy (mu : Measure E3) : ℝ≥0∞ := + ∫⁻ p : E3 × E3, invDistance p.1 p.2 ∂(mu.prod mu) + +theorem lintegral_coulombCost_prod (mu : Measure E3) [IsProbabilityMeasure mu] : + (∫⁻ t, coulombCost t ∂(mu.prod (mu.prod mu))) = 3 * coulombPairEnergy mu := by + exact lintegral_three_pairs_prod mu _ measurable_pairInteraction + +theorem kantorovichValue_le_three_pairEnergy (mu : Measure E3) + [IsProbabilityMeasure mu] : + kantorovichValue mu ≤ 3 * coulombPairEnergy mu := by + rw [← lintegral_coulombCost_prod] + exact iInf_le_of_le (mu.prod (mu.prod mu)) + (iInf_le_of_le (isThreeCoupling_prod mu) le_rfl) + +theorem kantorovichValue_lt_top_of_pairEnergy_lt_top (mu : Measure E3) + [IsProbabilityMeasure mu] (h : coulombPairEnergy mu < ⊤) : + kantorovichValue mu < ⊤ := by + apply lt_of_le_of_lt (kantorovichValue_le_three_pairEnergy mu) + exact ENNReal.mul_lt_top (by norm_num) h + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/RealCounterexampleAssembly.lean b/lean/OAI/Analysis/CoulombTransport/RealCounterexampleAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..fdd96e37eefe2dfa2fd81a7c13d0184a80eb3c9f --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/RealCounterexampleAssembly.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.CoulombTransport.CounterexampleAssembly +import OAI.Analysis.CoulombTransport.Calibration + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +private lemma coulombCost_pos_realAssembly (t : Triple) : 0 < coulombCost t := by + have hpos : 0 < invDistance (tripleFst t) (tripleSnd t) := + ENNReal.inv_pos.mpr ENNReal.ofReal_ne_top + unfold coulombCost + exact add_pos_of_pos_of_nonneg (add_pos_of_pos_of_nonneg hpos zero_le) zero_le + +/-- For the strictly positive Coulomb cost, the shifted and signed contact +conditions are equivalent; no nonnegativity assumption on the signed sum is +needed. -/ +lemma triplePotential_shifted_contact_iff {u : E3 → ℝ} {M : ℝ} {t : Triple} + (hM : 0 ≤ M) + (h1 : -M ≤ u (tripleFst t)) (h2 : -M ≤ u (tripleSnd t)) + (h3 : -M ≤ u (tripleThd t)) : + (triplePotential (shiftedPotential u M) t = + coulombCost t + ENNReal.ofReal (3 * M)) ↔ + ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) = + coulombCost t := + shifted_three_eq_iff_of_pos h1 h2 h3 hM (coulombCost_pos_realAssembly t) + +theorem hasCoulombCounterexample_of_real_branches + (rho : E3 → ℝ) (hrho : IsSmoothCompactProbabilityDensity rho) + (nu : Measure E3) [IsProbabilityMeasure nu] + (H : Fin 4 → E3 → E3) (hH : ∀ i, Measurable (H i)) + (hdensity : densityMeasure rho = branchMarginal nu (H 0) (H 1) (H 2) (H 3)) + {B U : Set E3} (hB : MeasurableSet B) (hU : MeasurableSet U) + (hfull : ∀ᵐ x ∂nu, x ∈ B) (hBU : B ⊆ U) + (hHU : ∀ i, H i '' B ⊆ U) + (hInj : ∀ i, Set.InjOn (H i) B) + (himage : ∀ i S, MeasurableSet S → S ⊆ B → MeasurableSet (H i '' S)) + (hCentral : ∀ i, Disjoint B (H i '' B)) + (hPair : Pairwise fun i j => Disjoint (H i '' B) (H j '' B)) + {u : E3 → ℝ} (hu : Measurable u) {M : ℝ} (hM : 0 ≤ M) + (hubound : ∀ x ∈ U, -M ≤ u x ∧ u x ≤ M) + (hbound : ∀ t, tripleFst t ∈ U → tripleSnd t ∈ U → tripleThd t ∈ U → + ENNReal.ofReal (u (tripleFst t) + u (tripleSnd t) + u (tripleThd t)) ≤ + coulombCost t) + (hcontact01 : ∀ᵐ x ∂nu, + ENNReal.ofReal (u x + u (H 0 x) + u (H 1 x)) = coulombCost (x, (H 0 x, H 1 x))) + (hcontact23 : ∀ᵐ x ∂nu, + ENNReal.ofReal (u x + u (H 2 x) + u (H 3 x)) = coulombCost (x, (H 2 x, H 3 x))) + (hselect : ∀ x y z : E3, x ∈ B → y ∈ U → z ∈ U → + ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z)) → + ∃ i, y = H i x) : + HasCoulombCounterexample rho := by + let mu := branchMarginal nu (H 0) (H 1) (H 2) (H 3) + have : IsProbabilityMeasure mu := + isProbabilityMeasure_branchMarginal nu (hH 0) (hH 1) (hH 2) (hH 3) + have hmuU : ∀ᵐ x ∂mu, x ∈ U := ae_branchMarginal_mem nu hH hU hfull hBU hHU + have hfinite : (∫⁻ x, shiftedPotential u M x ∂mu) ≠ ⊤ := + (lintegral_shiftedPotential_lt_top_of_ae_le + (M := M) (hmuU.mono fun x hx => (hubound x hx).2)).ne + apply hasCoulombCounterexample_of_branches rho hrho nu H hH hdensity + hB hU hfull hBU hHU hInj himage hCentral hPair + (measurable_shiftedPotential hu M) hfinite ENNReal.ofReal_ne_top + · intro t h1 h2 h3 + exact shiftedPotential_certificate (hubound _ h1).1 (hubound _ h2).1 + (hubound _ h3).1 (hbound t h1 h2 h3) + · filter_upwards [hfull, hcontact01] with x hx heq + apply (triplePotential_shifted_contact_iff hM + (hubound x (hBU hx)).1 + (hubound (H 0 x) (hHU 0 ⟨x, hx, rfl⟩)).1 + (hubound (H 1 x) (hHU 1 ⟨x, hx, rfl⟩)).1).mpr + exact heq + · filter_upwards [hfull, hcontact23] with x hx heq + apply (triplePotential_shifted_contact_iff hM + (hubound x (hBU hx)).1 + (hubound (H 2 x) (hHU 2 ⟨x, hx, rfl⟩)).1 + (hubound (H 3 x) (hHU 3 ⟨x, hx, rfl⟩)).1).mpr + exact heq + · intro x y z hx hy hz heq + apply hselect x y z hx hy hz + exact (triplePotential_shifted_contact_iff hM + (hubound x (hBU hx)).1 (hubound y hy).1 (hubound z hz).1).mp heq + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/SeparatedLiftApproximation.lean b/lean/OAI/Analysis/CoulombTransport/SeparatedLiftApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..80cbeee715f7d5f8a00c04c9e0480800ed0cc7ab --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/SeparatedLiftApproximation.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.CoulombTransport.FirstCoordinateLift + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356 + +/-- Arbitrarily small first-coordinate lifts of a uniformly separated optimal +coupling give finite Monge approximation. Only the first coordinate is adjusted +to obtain a graph, and uniform separation controls the cost of that adjustment. -/ +theorem finiteMongeApproximation_of_near_fst_lifts + {mu : Measure E3} [IsProbabilityMeasure mu] {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) + (hoptimal : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu) + {eta : ℝ} (heta : 0 < eta) + (hseparated : ∀ᵐ t ∂pi, CoulombEstimates.Separated eta t) + (hlifts : ∀ delta : ℝ, 0 < delta → + ∃ Q : E3 → Triple, Measurable Q ∧ Measure.map Q mu = pi ∧ + ∀ᵐ x ∂mu, dist x (Q x).1 ≤ delta) : + FiniteMongeApproximation mu := by + intro epsilon hepsilon + let delta : ℝ := min (eta / 2) (epsilon * eta ^ 2 / 24) + have hdelta : 0 < delta := by + dsimp [delta] + apply lt_min + · positivity + · positivity + obtain ⟨Q, hQ, hmap, hclose⟩ := hlifts delta hdelta + have hdelta_eta : delta ≤ eta / 2 := min_le_left _ _ + obtain ⟨h2, h3, hfinite, hcost⟩ := + FirstCoordinateLift.graph_cost_of_lift hpi hQ hmap heta hdelta_eta hseparated hclose + refine ⟨tripleSnd ∘ Q, tripleThd ∘ Q, h2, h3, hfinite, ?_⟩ + have herror : 24 * delta / eta ^ 2 ≤ epsilon := by + apply (div_le_iff₀ (sq_pos_of_pos heta)).2 + have hdelta_eps : delta ≤ epsilon * eta ^ 2 / 24 := min_le_right _ _ + linarith + calc + graphCost mu (tripleSnd ∘ Q) (tripleThd ∘ Q) ≤ + (∫⁻ t, coulombCost t ∂pi) + ENNReal.ofReal (24 * delta / eta ^ 2) := hcost + _ ≤ kantorovichValue mu + ENNReal.ofReal epsilon := by + rw [hoptimal] + exact add_le_add le_rfl (ENNReal.ofReal_le_ofReal herror) + +/-- A uniformly separated optimal coupling has finite value. -/ +theorem kantorovichValue_lt_top_of_separated_optimizer + {mu : Measure E3} {pi : Measure Triple} + (hpi : IsThreeCoupling mu pi) + (hoptimal : (∫⁻ t, coulombCost t ∂pi) = kantorovichValue mu) + {eta : ℝ} (heta : 0 < eta) + (hseparated : ∀ᵐ t ∂pi, CoulombEstimates.Separated eta t) : + kantorovichValue mu < ⊤ := by + have : IsProbabilityMeasure pi := hpi.1 + rw [← hoptimal] + exact CoulombEstimates.lintegral_coulombCost_lt_top_of_ae_separated pi heta hseparated + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/SmoothBranchMarginal.lean b/lean/OAI/Analysis/CoulombTransport/SmoothBranchMarginal.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5caec7dbec17d8990603ff41ee4ab714aab312f --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/SmoothBranchMarginal.lean @@ -0,0 +1,324 @@ +import OAI.Analysis.CoulombTransport.Density +import OAI.Analysis.CoulombTransport.DisjointSquares +import OAI.Analysis.CoulombTransport.SmoothPushforward +import OAI.Analysis.CoulombTransport.LocalBranchMeasure +import OAI.Analysis.CoulombTransport.JacobianSquareRoot + +namespace OAI + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356.SmoothBranchMarginal + +theorem squareDensity_probability {g : E3 → ℝ} + (hg : Continuous g) (hgc : HasCompactSupport g) + (hmass : (∫ x : E3, g x ^ 2) = 1) : + IsProbabilityMeasure (densityMeasure (fun x => g x ^ 2)) := by + have hcompact : HasCompactSupport (fun x => g x ^ 2) := by + simpa only [Function.comp_def] using + hgc.comp_left (g := fun y : ℝ => y ^ 2) (by simp) + have hint : Integrable (fun x => g x ^ 2) (volume : Measure E3) := + (hg.pow 2).integrable_of_hasCompactSupport hcompact + refine ⟨?_⟩ + rw [densityMeasure, withDensity_apply _ MeasurableSet.univ] + simp only [Measure.restrict_univ] + rw [← ofReal_integral_eq_lintegral_ofReal hint (ae_of_all _ (fun x => sq_nonneg (g x))), + hmass, ENNReal.ofReal_one] + +theorem squareDensity_ae_tsupport {g : E3 → ℝ} (hg : Measurable g) : + ∀ᵐ x ∂densityMeasure (fun x => g x ^ 2), x ∈ tsupport g := by + rw [densityMeasure, ae_withDensity_iff ((hg.pow_const 2).ennreal_ofReal)] + apply ae_of_all + intro x hx + apply subset_tsupport g + intro hgx + exact hx (by simp [hgx]) + +theorem square_integral_eq_one {g : E3 → ℝ} (hg : Continuous g) + [IsProbabilityMeasure (densityMeasure (fun x => g x ^ 2))] : + (∫ x : E3, g x ^ 2) = 1 := by + rw [integral_eq_lintegral_of_nonneg_ae + (ae_of_all _ (fun x => sq_nonneg (g x))) (hg.pow 2).aestronglyMeasurable] + have hm := measure_univ (μ := densityMeasure (fun x => g x ^ 2)) + simpa only [densityMeasure, withDensity_apply _ MeasurableSet.univ, + Measure.restrict_univ, hm, ENNReal.toReal_one] using congrArg ENNReal.toReal hm + +/-- A normalized smooth amplitude transports to another normalized smooth +amplitude. The derivative and its smooth square-root determinant are explicit +inputs, so the result is compatible with independently constructed local charts. -/ +theorem transported_square_amplitude + (e : OpenPartialHomeomorph E3 E3) {g : E3 → ℝ} + (hg0 : ∀ x, 0 ≤ g x) + (hg : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g) + (hgc : HasCompactSupport g) (hgs : tsupport g ⊆ e.source) + (hmass : (∫ x : E3, g x ^ 2) = 1) + (he : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) e.symm e.target) + (D : E3 → E3 →L[ℝ] E3) + (hD : ∀ y ∈ e.target, HasFDerivAt e.symm (D y) y) + (hJ : ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) + (fun y => Real.sqrt |(D y).det|) e.target) : + ∃ q : E3 → ℝ, + (∀ y, 0 ≤ q y) ∧ + ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) q ∧ + HasCompactSupport q ∧ + tsupport q ⊆ e '' tsupport g ∧ + (∫ y : E3, q y ^ 2) = 1 ∧ + Measure.map (LocalBranchMeasure.extendedBranch e 0) + (densityMeasure (fun x => g x ^ 2)) = densityMeasure (fun y => q y ^ 2) := by + let q := localTransportAmplitude e g (fun y => Real.sqrt |(D y).det|) + have hq : ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) q := + contDiff_localTransportAmplitude e hg hgc hgs he hJ + have hm : Measure.map (LocalBranchMeasure.extendedBranch e 0) + (densityMeasure (fun x => g x ^ 2)) = densityMeasure (fun y => q y ^ 2) := by + rw [LocalBranchMeasure.map_extendedBranch e 0 _ + ((squareDensity_ae_tsupport hg.continuous.measurable).mono (fun x hx => hgs hx))] + exact map_squareDensity_localHomeomorph e g hgs D hD + have := squareDensity_probability hg.continuous hgc hmass + have : IsProbabilityMeasure (densityMeasure (fun y => q y ^ 2)) := by + rw [← hm] + infer_instance + refine ⟨q, localTransportAmplitude_nonneg e hg0 (fun y _ => Real.sqrt_nonneg _), hq, + hasCompactSupport_localTransportAmplitude e _ hgc hgs, + tsupport_localTransportAmplitude_subset e _ hgc hgs, ?_, hm⟩ + exact square_integral_eq_one hq.continuous + +/-- The five component weights are fixed by the counterexample construction. -/ +def componentWeight : Option (Fin 4) → ℝ + | none => 1 / 3 + | some _ => 1 / 6 + +def componentAmplitude (g : E3 → ℝ) (q : Fin 4 → E3 → ℝ) : + Option (Fin 4) → E3 → ℝ + | none => g + | some i => q i + +def componentRegion (B : Set E3) (e : Fin 4 → OpenPartialHomeomorph E3 E3) : + Option (Fin 4) → Set E3 + | none => B + | some i => e i '' B + +def marginalDensity (g : E3 → ℝ) (q : Fin 4 → E3 → ℝ) (x : E3) : ℝ := + ∑ i : Option (Fin 4), componentWeight i * componentAmplitude g q i x ^ 2 + +def NormalizedAmplitude (g : E3 → ℝ) : Prop := + (∀ x, 0 ≤ g x) ∧ + ContDiff ℝ (↑(⊤ : ENat) : WithTop ENat) g ∧ + HasCompactSupport g ∧ (∫ x : E3, g x ^ 2) = 1 + +theorem marginalDensity_smooth {B : Set E3} + {e : Fin 4 → OpenPartialHomeomorph E3 E3} + {g : E3 → ℝ} {q : Fin 4 → E3 → ℝ} + (hg : NormalizedAmplitude g) (hq : ∀ i, NormalizedAmplitude (q i)) + (hgs : tsupport g ⊆ B) (hqs : ∀ i, tsupport (q i) ⊆ e i '' B) + (hdisj : Pairwise (fun i j => Disjoint (componentRegion B e i) (componentRegion B e j))) : + IsSmoothCompactProbabilityDensity (marginalDensity g q) := by + apply isSmoothCompactProbabilityDensity_sum_normalized_disjoint_squares + Finset.univ componentWeight (componentAmplitude g q) + · intro i _ + cases i <;> norm_num [componentWeight] + · intro i _ + cases i with + | none => exact hg.1 + | some i => exact (hq i).1 + · intro i _ + cases i with + | none => exact hg.2.1 + | some i => exact (hq i).2.1 + · intro i _ + cases i with + | none => exact hg.2.2.1 + | some i => exact (hq i).2.2.1 + · have hsub : ∀ i, Function.support (componentAmplitude g q i) ⊆ componentRegion B e i := by + intro i + cases i with + | none => exact (subset_tsupport g).trans hgs + | some i => exact (subset_tsupport (q i)).trans (hqs i) + intro i _ j _ hij + exact (hdisj hij).mono (hsub i) (hsub j) + · intro i _ + cases i with + | none => exact hg.2.2.2 + | some i => exact (hq i).2.2.2 + · norm_num [componentWeight, Fintype.sum_option] + +theorem marginalDensity_measure {g : E3 → ℝ} {q : Fin 4 → E3 → ℝ} + (hg : Measurable g) (hq : ∀ i, Measurable (q i)) : + densityMeasure (marginalDensity g q) = + (1 / 3 : ℝ≥0∞) • densityMeasure (fun x => g x ^ 2) + + ∑ i : Fin 4, (1 / 6 : ℝ≥0∞) • densityMeasure (fun x => q i x ^ 2) := by + unfold marginalDensity + rw [densityMeasure_sum_weighted_squares] + · simp [Fintype.sum_option, componentWeight, componentAmplitude] + · intro i _ + cases i <;> norm_num [componentWeight] + · intro i _ + cases i with + | none => exact hg + | some i => exact hq i + +/-- Construct the actual smooth five-component marginal from local branch +charts on a common ball. All square amplitudes and their exact pushforward +laws are supplied in the conclusion. -/ +theorem exists_smooth_branch_marginal + (c : E3) {r : ℝ} (hr : 0 < r) + (e : Fin 4 → OpenPartialHomeomorph E3 E3) + (hsource : ∀ i, Metric.ball c r ⊆ (e i).source) + (hdisj : Pairwise (fun i j => Disjoint + (componentRegion (Metric.ball c r) e i) (componentRegion (Metric.ball c r) e j))) + (he : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i).symm (e i).target) + (D : Fin 4 → E3 → E3 →L[ℝ] E3) + (hD : ∀ i y, y ∈ (e i).target → HasFDerivAt (e i).symm (D i y) y) + (hJ : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) + (fun y => Real.sqrt |(D i y).det|) (e i).target) : + ∃ (g : E3 → ℝ) (q : Fin 4 → E3 → ℝ), + NormalizedAmplitude g ∧ tsupport g ⊆ Metric.ball c r ∧ + (∀ i, NormalizedAmplitude (q i) ∧ tsupport (q i) ⊆ e i '' Metric.ball c r) ∧ + IsProbabilityMeasure (densityMeasure (fun x => g x ^ 2)) ∧ + IsSmoothCompactProbabilityDensity (marginalDensity g q) ∧ + densityMeasure (marginalDensity g q) = + (1 / 3 : ℝ≥0∞) • densityMeasure (fun x => g x ^ 2) + + ∑ i : Fin 4, (1 / 6 : ℝ≥0∞) • + Measure.map (LocalBranchMeasure.extendedBranch (e i) 0) + (densityMeasure (fun x => g x ^ 2)) := by + obtain ⟨g, hg0, hg, hgc, hgs, hgm⟩ := exists_normalized_smooth_square_in_ball c hr + have hqexists := fun i => transported_square_amplitude (e i) hg0 hg hgc + (hgs.trans (hsource i)) hgm (he i) (D i) (hD i) (hJ i) + choose q hq0 hq hqc hqs hqm hqmap using hqexists + have hgn : NormalizedAmplitude g := ⟨hg0, hg, hgc, hgm⟩ + have hqn : ∀ i, NormalizedAmplitude (q i) := fun i => ⟨hq0 i, hq i, hqc i, hqm i⟩ + have hqsub : ∀ i, tsupport (q i) ⊆ e i '' Metric.ball c r := fun i => + (hqs i).trans (Set.image_mono hgs) + refine ⟨g, q, hgn, hgs, fun i => ⟨hqn i, hqsub i⟩, + squareDensity_probability hg.continuous hgc hgm, + marginalDensity_smooth hgn hqn hgs hqsub hdisj, ?_⟩ + rw [marginalDensity_measure hg.continuous.measurable (fun i => (hq i).continuous.measurable)] + simp_rw [hqmap] + +/-- The preceding construction only needs smoothness in both directions of +the local charts; no determinant or change-of-variables premise remains. -/ +theorem exists_smooth_branch_marginal_of_smooth_charts + (c : E3) {r : ℝ} (hr : 0 < r) + (e : Fin 4 → OpenPartialHomeomorph E3 E3) + (hsource : ∀ i, Metric.ball c r ⊆ (e i).source) + (hdisj : Pairwise (fun i j => Disjoint + (componentRegion (Metric.ball c r) e i) (componentRegion (Metric.ball c r) e j))) + (he : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i) (e i).source) + (he' : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i).symm (e i).target) : + ∃ (g : E3 → ℝ) (q : Fin 4 → E3 → ℝ), + NormalizedAmplitude g ∧ tsupport g ⊆ Metric.ball c r ∧ + (∀ i, NormalizedAmplitude (q i) ∧ tsupport (q i) ⊆ e i '' Metric.ball c r) ∧ + IsProbabilityMeasure (densityMeasure (fun x => g x ^ 2)) ∧ + IsSmoothCompactProbabilityDensity (marginalDensity g q) ∧ + densityMeasure (marginalDensity g q) = + (1 / 3 : ℝ≥0∞) • densityMeasure (fun x => g x ^ 2) + + ∑ i : Fin 4, (1 / 6 : ℝ≥0∞) • + Measure.map (LocalBranchMeasure.extendedBranch (e i) 0) + (densityMeasure (fun x => g x ^ 2)) := by + apply exists_smooth_branch_marginal c hr e hsource hdisj he' + (fun i y => fderiv ℝ (e i).symm y) + · intro i y hy + exact (((he' i).contDiffAt ((e i).open_target.mem_nhds hy)).differentiableAt + (by simp)).hasFDerivAt + · intro i + exact JacobianSquareRoot.contDiffOn_sqrt_abs_det_fderiv_symm (e i) (he i) (he' i) + +/-- The construction data expected by the measure-level nonattainment and +separated-support approximation arguments. -/ +structure SmoothBranchData (B : Set E3) where + rho : E3 → ℝ + nu : Measure E3 + branch : Fin 4 → E3 → E3 + compactCore : Set E3 + density_smooth : IsSmoothCompactProbabilityDensity rho + probability : IsProbabilityMeasure nu + measurable_central : MeasurableSet B + core_compact : IsCompact compactCore + core_subset : compactCore ⊆ B + core_full : ∀ᵐ x ∂nu, x ∈ compactCore + branch_measurable : ∀ i, Measurable (branch i) + branch_injective : ∀ i, Set.InjOn (branch i) B + branch_image_measurable : ∀ i S, MeasurableSet S → S ⊆ B → + MeasurableSet (branch i '' S) + branch_continuous : ∀ i, ContinuousOn (branch i) compactCore + component_disjoint : Pairwise (fun i j : Option (Fin 4) => + Disjoint (i.elim B (fun k => branch k '' B)) (j.elim B (fun k => branch k '' B))) + density_eq : densityMeasure rho = + (1 / 3 : ℝ≥0∞) • nu + ∑ i : Fin 4, (1 / 6 : ℝ≥0∞) • Measure.map (branch i) nu + +theorem SmoothBranchData.central_full {B : Set E3} (d : SmoothBranchData B) : + ∀ᵐ x ∂d.nu, x ∈ B := d.core_full.mono (fun _ hx => d.core_subset hx) + +theorem SmoothBranchData.central_disjoint {B : Set E3} (d : SmoothBranchData B) (i : Fin 4) : + Disjoint B (d.branch i '' B) := + d.component_disjoint (i := none) (j := some i) (by simp) + +theorem SmoothBranchData.outer_disjoint {B : Set E3} (d : SmoothBranchData B) : + Pairwise (fun i j => Disjoint (d.branch i '' B) (d.branch j '' B)) := by + intro i j hij + exact d.component_disjoint (i := some i) (j := some j) (by simpa using hij) + +/-- The explicit four-term form is definitionally the canonical branch marginal. -/ +theorem SmoothBranchData.density_eq_four {B : Set E3} (d : SmoothBranchData B) : + densityMeasure d.rho = (1 / 3 : ℝ≥0∞) • d.nu + (1 / 6 : ℝ≥0∞) • + (Measure.map (d.branch 0) d.nu + Measure.map (d.branch 1) d.nu + + Measure.map (d.branch 2) d.nu + Measure.map (d.branch 3) d.nu) := by + rw [d.density_eq] + simp [Fin.sum_univ_succ, smul_add, add_assoc] + +/-- A measure-level packaging of the actual smooth marginal construction. +All branch extensions are globally measurable, while continuity is retained +on the compact support where it is needed. -/ +theorem exists_smoothBranchData_of_smooth_charts + (c : E3) {r : ℝ} (hr : 0 < r) + (e : Fin 4 → OpenPartialHomeomorph E3 E3) + (hsource : ∀ i, Metric.ball c r ⊆ (e i).source) + (hdisj : Pairwise (fun i j => Disjoint + (componentRegion (Metric.ball c r) e i) (componentRegion (Metric.ball c r) e j))) + (he : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i) (e i).source) + (he' : ∀ i, ContDiffOn ℝ (↑(⊤ : ENat) : WithTop ENat) (e i).symm (e i).target) : + ∃ d : SmoothBranchData (Metric.ball c r), + ∀ i x, x ∈ Metric.ball c r → d.branch i x = e i x := by + obtain ⟨g, q, hg, hgs, _, hprob, hrho, hmeasure⟩ := + exists_smooth_branch_marginal_of_smooth_charts c hr e hsource hdisj he he' + let H : Fin 4 → E3 → E3 := fun i => LocalBranchMeasure.extendedBranch (e i) 0 + have himage : ∀ i, H i '' Metric.ball c r = e i '' Metric.ball c r := + fun i => LocalBranchMeasure.extendedBranch_image (e i) 0 (hsource i) + refine ⟨{ + rho := marginalDensity g q + nu := densityMeasure (fun x => g x ^ 2) + branch := H + compactCore := tsupport g + density_smooth := hrho + probability := hprob + measurable_central := Metric.isOpen_ball.measurableSet + core_compact := hg.2.2.1 + core_subset := hgs + core_full := squareDensity_ae_tsupport hg.2.1.continuous.measurable + branch_measurable := fun i => LocalBranchMeasure.measurable_extendedBranch (e i) 0 + branch_injective := fun i => LocalBranchMeasure.injOn_extendedBranch (e i) 0 (hsource i) + branch_image_measurable := ?_ + branch_continuous := ?_ + component_disjoint := ?_ + density_eq := hmeasure + }, ?_⟩ + · intro i S hS hSB + exact LocalBranchMeasure.measurableSet_extendedBranch_image (e i) 0 hS + (hSB.trans (hsource i)) + · intro i + apply ((e i).continuousOn.mono (hgs.trans (hsource i))).congr + intro x hx + exact LocalBranchMeasure.extendedBranch_apply_of_mem (e i) 0 (hsource i (hgs hx)) + · intro i j hij + have h := hdisj hij + cases i <;> cases j <;> simpa only [Option.elim, componentRegion, himage] using h + · intro i x hx + exact LocalBranchMeasure.extendedBranch_apply_of_mem (e i) 0 (hsource i hx) + +end Problem356.SmoothBranchMarginal + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/SmoothPushforward.lean b/lean/OAI/Analysis/CoulombTransport/SmoothPushforward.lean new file mode 100644 index 0000000000000000000000000000000000000000..94ca0ccb4fc658707f23d0c8045a14bc0db74de0 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/SmoothPushforward.lean @@ -0,0 +1,165 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory Set Filter +open scoped Topology ENNReal + +namespace Problem356 + +/-- A smooth function on an open set extends smoothly by zero whenever its +closed support stays in that open set. The function is already defined +on the ambient space; the support hypothesis expresses the extension. -/ +theorem contDiff_of_contDiffOn_of_tsupport_subset + {f : E3 → ℝ} {s : Set E3} {n : WithTop ENat} + (hs : IsOpen s) (hf : ContDiffOn ℝ n f s) (hfs : tsupport f ⊆ s) : + ContDiff ℝ n f := by + rw [contDiff_iff_contDiffAt] + intro x + by_cases hx : x ∈ s + · exact hf.contDiffAt (hs.mem_nhds hx) + · have hxt : x ∉ tsupport f := fun ht => hx (hfs ht) + apply (contDiffAt_const (c := (0 : ℝ))).congr_of_eventuallyEq + filter_upwards [(isClosed_tsupport f).isOpen_compl.mem_nhds hxt] with y hy + exact image_eq_zero_of_notMem_tsupport hy + +/-- Transport of a compactly supported amplitude through a local +homeomorphism, with a prescribed Jacobian square-root factor. -/ +def localTransportAmplitude (e : OpenPartialHomeomorph E3 E3) + (g J : E3 → ℝ) : E3 → ℝ := + e.target.indicator (fun y => g (e.symm y) * J y) + +theorem localTransportAmplitude_nonneg + (e : OpenPartialHomeomorph E3 E3) {g J : E3 → ℝ} + (hg : ∀ x, 0 ≤ g x) (hJ : ∀ y ∈ e.target, 0 ≤ J y) : + ∀ y, 0 ≤ localTransportAmplitude e g J y := by + intro y + by_cases hy : y ∈ e.target + · simp only [localTransportAmplitude, indicator_of_mem hy] + exact mul_nonneg (hg _) (hJ _ hy) + · simp [localTransportAmplitude, hy] + +theorem support_localTransportAmplitude_subset + (e : OpenPartialHomeomorph E3 E3) (g J : E3 → ℝ) : + Function.support (localTransportAmplitude e g J) ⊆ e '' tsupport g := by + intro y hy + have hyt : y ∈ e.target := by + by_contra hn + exact hy (by simp [localTransportAmplitude, hn]) + refine ⟨e.symm y, ?_, e.right_inv hyt⟩ + apply subset_tsupport g + intro hz + apply hy + simp [localTransportAmplitude, hyt, hz] + +theorem tsupport_localTransportAmplitude_subset + (e : OpenPartialHomeomorph E3 E3) {g : E3 → ℝ} (J : E3 → ℝ) + (hg : HasCompactSupport g) (hgs : tsupport g ⊆ e.source) : + tsupport (localTransportAmplitude e g J) ⊆ e '' tsupport g := by + apply closure_minimal (support_localTransportAmplitude_subset e g J) + exact (hg.image_of_continuousOn (e.continuousOn.mono hgs)).isClosed + +theorem hasCompactSupport_localTransportAmplitude + (e : OpenPartialHomeomorph E3 E3) {g : E3 → ℝ} (J : E3 → ℝ) + (hg : HasCompactSupport g) (hgs : tsupport g ⊆ e.source) : + HasCompactSupport (localTransportAmplitude e g J) := by + exact (hg.image_of_continuousOn (e.continuousOn.mono hgs)).of_isClosed_subset + (isClosed_tsupport _) (tsupport_localTransportAmplitude_subset e J hg hgs) + +theorem tsupport_localTransportAmplitude_subset_target + (e : OpenPartialHomeomorph E3 E3) {g : E3 → ℝ} (J : E3 → ℝ) + (hg : HasCompactSupport g) (hgs : tsupport g ⊆ e.source) : + tsupport (localTransportAmplitude e g J) ⊆ e.target := by + intro y hy + obtain ⟨x, hx, rfl⟩ := tsupport_localTransportAmplitude_subset e J hg hgs hy + exact e.map_source (hgs hx) + +theorem contDiff_localTransportAmplitude + (e : OpenPartialHomeomorph E3 E3) {g J : E3 → ℝ} {n : WithTop ENat} + (hg : ContDiff ℝ n g) (hgc : HasCompactSupport g) + (hgs : tsupport g ⊆ e.source) + (he : ContDiffOn ℝ n e.symm e.target) + (hJ : ContDiffOn ℝ n J e.target) : + ContDiff ℝ n (localTransportAmplitude e g J) := by + apply contDiff_of_contDiffOn_of_tsupport_subset e.open_target + _ (tsupport_localTransportAmplitude_subset_target e J hgc hgs) + have hcomp : ContDiffOn ℝ n (fun y => g (e.symm y) * J y) e.target := + (hg.comp_contDiffOn he).mul hJ + refine hcomp.congr ?_ + intro y hy + simp [localTransportAmplitude, hy] + +/-- The inverse-Jacobian change-of-variables formula for a local +homeomorphism. No global behavior outside its source is required. -/ +theorem map_withDensity_localHomeomorph + (e : OpenPartialHomeomorph E3 E3) (w : E3 → ℝ≥0∞) + (D : E3 → E3 →L[ℝ] E3) + (hD : ∀ y ∈ e.target, HasFDerivAt e.symm (D y) y) : + Measure.map e (((volume : Measure E3).restrict e.source).withDensity w) = + ((volume : Measure E3).restrict e.target).withDensity + (fun y => ENNReal.ofReal |(D y).det| * w (e.symm y)) := by + have he : AEMeasurable e ((volume : Measure E3).restrict e.source) := + e.continuousOn.aemeasurable e.open_source.measurableSet + have hew : AEMeasurable e + (((volume : Measure E3).restrict e.source).withDensity w) := + he.mono_ac (withDensity_absolutelyContinuous _ _) + apply Measure.ext + intro s hs + have hpre : NullMeasurableSet (e ⁻¹' s) + ((volume : Measure E3).restrict e.source) := + he.nullMeasurableSet_preimage hs + rw [Measure.map_apply_of_aemeasurable hew hs, + withDensity_apply₀ _ hpre, withDensity_apply _ hs, + Measure.restrict_restrict₀ hpre, Measure.restrict_restrict hs] + have hset : e.symm '' (s ∩ e.target) = e ⁻¹' s ∩ e.source := by + ext x + constructor + · rintro ⟨y, ⟨hys, hyt⟩, rfl⟩ + exact ⟨by simpa only [mem_preimage, e.right_inv hyt] using hys, + e.symm.map_source hyt⟩ + · rintro ⟨hxs, hxe⟩ + exact ⟨e x, ⟨hxs, e.map_source hxe⟩, e.left_inv hxe⟩ + rw [← hset] + exact lintegral_image_eq_lintegral_abs_det_fderiv_mul volume + (hs.inter e.open_target.measurableSet) + (fun y hy => (hD y hy.2).hasFDerivWithinAt) + (e.symm.injOn.mono inter_subset_right) w + +/-- The local inverse-Jacobian formula carries a square density to a +square density, exactly as required by the five-component construction. -/ +theorem map_squareDensity_localHomeomorph + (e : OpenPartialHomeomorph E3 E3) (g : E3 → ℝ) + (hgs : tsupport g ⊆ e.source) + (D : E3 → E3 →L[ℝ] E3) + (hD : ∀ y ∈ e.target, HasFDerivAt e.symm (D y) y) : + Measure.map e (densityMeasure (fun x => g x ^ 2)) = + densityMeasure (fun y => + localTransportAmplitude e g (fun z => Real.sqrt |(D z).det|) y ^ 2) := by + have hsource : densityMeasure (fun x => g x ^ 2) = + ((volume : Measure E3).restrict e.source).withDensity + (fun x => ENNReal.ofReal (g x ^ 2)) := by + rw [densityMeasure, ← withDensity_indicator e.open_source.measurableSet] + congr 1 + ext x + by_cases hx : x ∈ e.source + · simp [hx] + · have hgx : g x = 0 := image_eq_zero_of_notMem_tsupport + (fun h => hx (hgs h)) + simp [hx, hgx] + rw [hsource, map_withDensity_localHomeomorph e _ D hD, densityMeasure, + ← withDensity_indicator e.open_target.measurableSet] + congr 1 + ext y + by_cases hy : y ∈ e.target + · simp only [indicator_of_mem hy, localTransportAmplitude, mul_pow, + Real.sq_sqrt (abs_nonneg _)] + rw [mul_comm (g (e.symm y) ^ 2), ENNReal.ofReal_mul (abs_nonneg _)] + · simp [localTransportAmplitude, hy] + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/SplitMeasure.lean b/lean/OAI/Analysis/CoulombTransport/SplitMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..8336841817477d86052dfb6222c2a417dea0de53 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/SplitMeasure.lean @@ -0,0 +1,131 @@ +import Mathlib + +namespace OAI + +universe uAlpha uIndex + +/-! Measure identities for the five-component splitting construction. -/ + +noncomputable section + +open MeasureTheory Set +open scoped ENNReal + +namespace Problem356 +namespace Splitting + +variable {α : Type uAlpha} {ι : Type uIndex} [MeasurableSpace α] + +/-- A measure supported almost everywhere on `B` vanishes on any set disjoint from `B`. -/ +theorem measure_eq_zero_of_disjoint + (ν : Measure α) {B S : Set α} + (hν : ∀ᵐ x ∂ν, x ∈ B) (hBS : Disjoint B S) : ν S = 0 := by + apply measure_mono_null (t := Bᶜ) + · intro x hx + exact fun hxB => Set.disjoint_left.mp hBS hxB hx + · exact ae_iff.mp hν + +/-- A branch pushforward vanishes away from the image of the central component. -/ +theorem map_eq_zero_of_disjoint + (ν : Measure α) {B S : Set α} {H : α → α} + (hν : ∀ᵐ x ∂ν, x ∈ B) (hH : Measurable H) + (hS : MeasurableSet S) (hBS : Disjoint (H '' B) S) : + (Measure.map H ν) S = 0 := by + rw [Measure.map_apply hH hS] + apply measure_eq_zero_of_disjoint ν hν + exact Set.disjoint_left.mpr fun x hxB hxS => + Set.disjoint_left.mp hBS ⟨x, hxB, rfl⟩ hxS + +/-- An injective branch has the original mass on the image of each central subset. -/ +theorem map_image_eq + (ν : Measure α) {B S : Set α} {H : α → α} + (hν : ∀ᵐ x ∂ν, x ∈ B) (hH : Measurable H) + (hInj : Set.InjOn H B) (hSB : S ⊆ B) + (hImage : MeasurableSet (H '' S)) : + (Measure.map H ν) (H '' S) = ν S := by + rw [Measure.map_apply hH hImage] + apply measure_congr + filter_upwards [hν] with x hx + apply propext + change H x ∈ H '' S ↔ x ∈ S + constructor + · rintro ⟨y, hy, hxy⟩ + have hyx : y = x := hInj (hSB hy) hx hxy + simpa only [hyx] using hy + · intro hxS + exact ⟨x, hxS, rfl⟩ + +variable [Fintype ι] + +/-- The central measure together with finitely many weighted branch pushforwards. -/ +def splitMeasure (ν : Measure α) (a : ℝ≥0∞) (b : ι → ℝ≥0∞) + (H : ι → α → α) : Measure α := + a • ν + ∑ i, b i • Measure.map (H i) ν + +/-- Weights adding to one produce a probability measure. -/ +theorem splitMeasure_isProbabilityMeasure + (ν : Measure α) [IsProbabilityMeasure ν] + (a : ℝ≥0∞) (b : ι → ℝ≥0∞) (H : ι → α → α) + (hH : ∀ i, Measurable (H i)) (hweight : a + ∑ i, b i = 1) : + IsProbabilityMeasure (splitMeasure ν a b H) := by + have hmass : ∀ i, (Measure.map (H i) ν) Set.univ = 1 := by + intro i + rw [Measure.map_apply (hH i) MeasurableSet.univ] + simp + constructor + simpa [splitMeasure, Measure.add_apply, Measure.smul_apply, + Measure.finsetSum_apply, hmass] using hweight + +/-- A nonzero central coefficient transfers all almost-everywhere properties +of the mixture to its central reference measure. -/ +theorem absolutelyContinuous_splitMeasure + (ν : Measure α) (a : ℝ≥0∞) (b : ι → ℝ≥0∞) (H : ι → α → α) + (ha : a ≠ 0) : ν ≪ splitMeasure ν a b H := by + exact (Measure.absolutelyContinuous_smul ha).add_right _ + +/-- On the central component, only the central summand contributes. -/ +theorem splitMeasure_apply_central + (ν : Measure α) (a : ℝ≥0∞) (b : ι → ℝ≥0∞) (H : ι → α → α) + {B S : Set α} (hν : ∀ᵐ x ∂ν, x ∈ B) + (hH : ∀ i, Measurable (H i)) (hSB : S ⊆ B) (hS : MeasurableSet S) + (hDisj : ∀ i, Disjoint B (H i '' B)) : + splitMeasure ν a b H S = a * ν S := by + have hz : ∀ i, (Measure.map (H i) ν) S = 0 := by + intro i + apply map_eq_zero_of_disjoint ν hν (hH i) hS + exact (hDisj i).symm.mono_right hSB + simp [splitMeasure, Measure.add_apply, Measure.smul_apply, Measure.finsetSum_apply, hz] + +/-- On one branch image only that branch summand contributes. -/ +theorem splitMeasure_apply_image + (ν : Measure α) (a : ℝ≥0∞) (b : ι → ℝ≥0∞) (H : ι → α → α) + {B S : Set α} (hν : ∀ᵐ x ∂ν, x ∈ B) + (hH : ∀ i, Measurable (H i)) (hInj : ∀ i, Set.InjOn (H i) B) + (hSB : S ⊆ B) (hImage : ∀ i, MeasurableSet (H i '' S)) + (hCentral : ∀ i, Disjoint B (H i '' B)) + (hPair : Pairwise fun i j => Disjoint (H i '' B) (H j '' B)) (j : ι) : + splitMeasure ν a b H (H j '' S) = b j * ν S := by + classical + have hsub : H j '' S ⊆ H j '' B := Set.image_mono hSB + have hz : ν (H j '' S) = 0 := + measure_eq_zero_of_disjoint ν hν ((hCentral j).mono_right hsub) + have hij : ∀ i, i ≠ j → (Measure.map (H i) ν) (H j '' S) = 0 := by + intro i hne + exact map_eq_zero_of_disjoint ν hν (hH i) (hImage j) + ((hPair hne).mono_right hsub) + have hj : (Measure.map (H j) ν) (H j '' S) = ν S := + map_image_eq ν hν (hH j) (hInj j) hSB (hImage j) + simp only [splitMeasure, Measure.add_apply, Measure.smul_apply, + Measure.finsetSum_apply, smul_eq_mul, hz, mul_zero, zero_add] + rw [Finset.sum_eq_single j] + · exact congrArg (b j * ·) hj + · intro i _ hne + simp [hij i hne] + · simp + +end Splitting +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Splitting.lean b/lean/OAI/Analysis/CoulombTransport/Splitting.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfaf59c54e13523c9c236b984c1ac1a2eae19bd9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Splitting.lean @@ -0,0 +1,105 @@ +import Mathlib + +namespace OAI + +universe uAlpha uIndex + +/-! +# The deterministic-selection mass obstruction + +A preserving map cannot carry a positive-mass selection set into a target +whose prescribed mass is a strictly smaller multiple of the same reference +mass. This is the measure-theoretic obstruction in the Coulomb construction. +-/ + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.Splitting + +variable {α : Type uAlpha} {ι : Type uIndex} [MeasurableSpace α] + +/-- Preservation and a strict compression of the reference mass force the +selected set to have reference measure zero. -/ +theorem reference_mass_zero_of_compression + {μ ν : Measure α} {T : α → α} {S A : Set α} {c d : ℝ≥0∞} + (hT : Measurable T) (hpres : Measure.map T μ = μ) + (hA : MeasurableSet A) (hsub : S ⊆ T ⁻¹' A) + (hsource : μ S = c * ν S) (htarget : μ A = d * ν S) + (hdc : d < c) (hfinite : ν S ≠ ⊤) : ν S = 0 := by + by_contra hne + have hle : c * ν S ≤ d * ν S := calc + c * ν S = μ S := hsource.symm + _ ≤ μ (T ⁻¹' A) := measure_mono hsub + _ = (Measure.map T μ) A := (Measure.map_apply hT hA).symm + _ = μ A := by rw [hpres] + _ = d * ν S := htarget + exact (not_lt_of_ge hle) + ((ENNReal.mul_lt_mul_iff_left hne hfinite).2 hdc) + +/-- No preserving map can implement a countable almost-everywhere selection +whose source and target masses have a uniformly strict reversed ratio. -/ +theorem not_preserving_of_countable_compression [Countable ι] + {μ ν : Measure α} [IsFiniteMeasure ν] + {T : α → α} {S A : ι → Set α} {c d : ℝ≥0∞} + (hν : ν Set.univ ≠ 0) + (hA : ∀ i, MeasurableSet (A i)) + (hsub : ∀ i, S i ⊆ T ⁻¹' A i) + (hsource : ∀ i, μ (S i) = c * ν (S i)) + (htarget : ∀ i, μ (A i) = d * ν (S i)) + (hdc : d < c) + (hcover : ∀ᵐ x ∂ν, ∃ i, x ∈ S i) : + ¬ (Measurable T ∧ Measure.map T μ = μ) := by + rintro ⟨hT, hpres⟩ + have hzero : ∀ i, ν (S i) = 0 := fun i => + reference_mass_zero_of_compression hT hpres (hA i) (hsub i) + (hsource i) (htarget i) hdc (measure_ne_top ν (S i)) + have hnull : ν (⋃ i, S i) = 0 := measure_iUnion_null hzero + have hfull : (⋃ i, S i) =ᵐ[ν] Set.univ := by + filter_upwards [hcover] with x hx + apply propext + simp only [Set.mem_iUnion, Set.mem_univ, iff_true] + exact hx + exact hν ((measure_congr hfull).symm.trans hnull) + +/-- The branch-selection formulation. The hypotheses about selected-set +masses are exactly those supplied by disjoint weighted pushforward +components. No regularity beyond measurability is imposed on the selector. -/ +theorem no_preserving_branch_selection [Countable ι] [MeasurableEq α] + {μ ν : Measure α} [IsFiniteMeasure ν] {B : Set α} + {H : ι → α → α} {c d : ℝ≥0∞} + (hν : ν Set.univ ≠ 0) (hB : MeasurableSet B) + (hfull : ∀ᵐ x ∂ν, x ∈ B) + (hH : ∀ i, Measurable (H i)) + (himage : ∀ i S, MeasurableSet S → S ⊆ B → + MeasurableSet (H i '' S)) + (hsource : ∀ S, MeasurableSet S → S ⊆ B → μ S = c * ν S) + (htarget : ∀ i S, MeasurableSet S → S ⊆ B → + μ (H i '' S) = d * ν S) + (hdc : d < c) : + ¬ ∃ T : α → α, Measurable T ∧ Measure.map T μ = μ ∧ + (∀ᵐ x ∂ν, ∃ i, T x = H i x) := by + rintro ⟨T, hT, hpres, hselect⟩ + let S : ι → Set α := fun i => B ∩ {x | T x = H i x} + have hS : ∀ i, MeasurableSet (S i) := fun i => + hB.inter (measurableSet_eq_fun hT (hH i)) + have hSB : ∀ i, S i ⊆ B := fun _ => Set.inter_subset_left + have hsub : ∀ i, S i ⊆ T ⁻¹' (H i '' S i) := by + intro i x hx + exact ⟨x, hx, hx.2.symm⟩ + have hcover : ∀ᵐ x ∂ν, ∃ i, x ∈ S i := by + filter_upwards [hfull, hselect] with x hx hsel + obtain ⟨i, hi⟩ := hsel + exact ⟨i, hx, hi⟩ + exact not_preserving_of_countable_compression hν + (fun i => himage i (S i) (hS i) (hSB i)) hsub + (fun i => hsource (S i) (hS i) (hSB i)) + (fun i => htarget i (S i) (hS i) (hSB i)) hdc hcover ⟨hT, hpres⟩ + +end Problem356.Splitting + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/SplittingConstruction.lean b/lean/OAI/Analysis/CoulombTransport/SplittingConstruction.lean new file mode 100644 index 0000000000000000000000000000000000000000..f1e9f6e0834db4d46bdaec778730af7929b7192b --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/SplittingConstruction.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.CoulombTransport.Splitting +import OAI.Analysis.CoulombTransport.SplitMeasure + +namespace OAI + +universe uAlpha uIndex + +/-! +# The disjoint-component selection obstruction + +This combines the abstract mass argument with the exact mass identities for +a finite mixture of a central measure and its injective branch pushforwards. +-/ + +noncomputable section +open MeasureTheory +open scoped ENNReal + +namespace Problem356.Splitting + +variable {α : Type uAlpha} {ι : Type uIndex} [MeasurableSpace α] [Fintype ι] + +/-- A finite family of disjoint injective branches with strictly smaller +outer coefficients cannot support any preserving deterministic selector. -/ +theorem no_preserving_splitMeasure_selection [MeasurableEq α] + {ν : Measure α} [IsFiniteMeasure ν] {B : Set α} + {H : ι → α → α} {c d : ℝ≥0∞} + (hν : ν Set.univ ≠ 0) (hB : MeasurableSet B) + (hfull : ∀ᵐ x ∂ν, x ∈ B) + (hH : ∀ i, Measurable (H i)) + (hInj : ∀ i, Set.InjOn (H i) B) + (himage : ∀ i S, MeasurableSet S → S ⊆ B → + MeasurableSet (H i '' S)) + (hCentral : ∀ i, Disjoint B (H i '' B)) + (hPair : Pairwise fun i j => Disjoint (H i '' B) (H j '' B)) + (hdc : d < c) : + ¬ ∃ T : α → α, Measurable T ∧ + Measure.map T (splitMeasure ν c (fun _ => d) H) = + splitMeasure ν c (fun _ => d) H ∧ + (∀ᵐ x ∂ν, ∃ i, T x = H i x) := by + apply no_preserving_branch_selection hν hB hfull hH himage + · intro S hS hSB + exact splitMeasure_apply_central ν c (fun _ => d) H + hfull hH hSB hS hCentral + · intro i S hS hSB + exact splitMeasure_apply_image ν c (fun _ => d) H + hfull hH hInj hSB (fun j => himage j S hS hSB) hCentral hPair i + · exact hdc + +end Problem356.Splitting + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/StateDual.lean b/lean/OAI/Analysis/CoulombTransport/StateDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..9a6811fe82e4cc6c15918c9a1774fb1ccf7fb447 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/StateDual.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.CoulombTransport.StrictMinimum + +namespace OAI + +universe uE uF uP + +noncomputable section + +open Set +open scoped InnerProductSpace + +namespace Problem356 + +variable (E : Type uE) (F : Type uF) [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + +/-- The sum of the two component inner products, bundled for the usual +(max-norm) product. No inner-product-space instance on the product is used. -/ +def stateDual : (E × F) →L[ℝ] ((E × F) →L[ℝ] ℝ) := + (((ContinuousLinearMap.compL ℝ (E × F) E ℝ).flip + (ContinuousLinearMap.fst ℝ E F)).comp + ((innerSL ℝ).comp (ContinuousLinearMap.fst ℝ E F))) + + (((ContinuousLinearMap.compL ℝ (E × F) F ℝ).flip + (ContinuousLinearMap.snd ℝ E F)).comp + ((innerSL ℝ).comp (ContinuousLinearMap.snd ℝ E F))) + +@[simp] theorem stateDual_apply (u v : E × F) : + stateDual E F u v = ⟪u.1, v.1⟫_ℝ + ⟪u.2, v.2⟫_ℝ := by + rfl + +theorem stateDual_apply_comm (u v : E × F) : + stateDual E F u v = stateDual E F v u := by + simp only [stateDual_apply, real_inner_comm] + +/-- Differentiating the scalar representative of a product-state gradient. -/ +theorem hasFDerivAt_stateDual_comp {P : Type uP} [NormedAddCommGroup P] + [NormedSpace ℝ P] {G : P → E × F} {G' : P →L[ℝ] E × F} {p : P} + (hG : HasFDerivAt G G' p) : + HasFDerivAt (fun q => stateDual E F (G q)) ((stateDual E F).comp G') p := + by + exact HasFDerivAt.comp (𝕜 := ℝ) (g := stateDual E F) p + ((stateDual E F).hasFDerivAt (x := G p)) hG + +/-- The quadratic form of the scalar Hessian agrees with the product-state +coercivity expression, with the argument order used by matrix certificates. -/ +theorem stateDual_comp_quadratic (A : (E × F) →L[ℝ] E × F) (v : E × F) : + ((stateDual E F).comp A) v v = + ⟪v.1, (A v).1⟫_ℝ + ⟪v.2, (A v).2⟫_ℝ := by + simp only [ContinuousLinearMap.comp_apply, stateDual_apply, real_inner_comm] + +/-- A gradient with positive product-state Jacobian gives strict convexity of +its scalar potential. This bridges matrix coercivity of the stationarity map +to positivity of the scalar Hessian. -/ +theorem strictConvexOn_of_positive_stateGradient + {s : Set (E × F)} {f : E × F → ℝ} {G : E × F → E × F} + {A : E × F → (E × F) →L[ℝ] E × F} + (hs : Convex ℝ s) (hsopen : IsOpen s) + (hf : ∀ z ∈ s, HasFDerivAt f (stateDual E F (G z)) z) + (hG : ∀ z ∈ s, HasFDerivAt G (A z) z) + (hpos : ∀ z ∈ s, ∀ v : E × F, v ≠ 0 → + 0 < ⟪v.1, (A z v).1⟫_ℝ + ⟪v.2, (A z v).2⟫_ℝ) : + StrictConvexOn ℝ s f := by + apply strictConvexOn_of_positive_hessian hs hsopen hf + (fun z hz => hasFDerivAt_stateDual_comp E F (hG z hz)) + intro z hz v hv + simpa only [stateDual_comp_quadratic] using hpos z hz v hv + +/-- Vanishing of the product-state gradient gives the scalar stationary +condition needed by the supporting-certificate theorems. -/ +theorem hasFDerivAt_zero_of_stateGradient_eq_zero + {f : E × F → ℝ} {G : E × F → E × F} {z : E × F} + (hf : HasFDerivAt f (stateDual E F (G z)) z) (hG : G z = 0) : + HasFDerivAt f (0 : (E × F) →L[ℝ] ℝ) z := by + simpa only [hG, map_zero] using hf + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/StationaryConvexity.lean b/lean/OAI/Analysis/CoulombTransport/StationaryConvexity.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9754f27083fa75559334216c659490b70776f7e --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/StationaryConvexity.lean @@ -0,0 +1,117 @@ +import OAI.Analysis.CoulombTransport.StationaryMap +import OAI.Analysis.CoulombTransport.CoulombCoercivity +import OAI.Analysis.CoulombTransport.StateDual + +namespace OAI + +universe uE + +noncomputable section + +open Set +open scoped RealInnerProductSpace + +namespace Problem356.StationaryMap + +open CoulombCalculus + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The concrete scalar state differential is the product-state dual of its +stationary vector field. -/ +theorem stateDifferential_eq_stateDual (a y : E) (s : E × E) : + stateDifferential a y s = stateDual E E (stationary a (y, s)) := rfl + +/-- The state derivative of the concrete stationary map is the coercive +regularized Coulomb Hessian. -/ +theorem hasFDerivAt_stateStationary (a y : E) {s : E × E} + (hxy : s.1 ≠ y) (hxz : s.1 ≠ s.2) (hzy : s.2 ≠ y) : + HasFDerivAt (fun p : E × E => stationary a (y, p)) + (regularizedStateHessian (s.1 - y) (s.1 - s.2) (s.2 - y)) s := by + have h := hasFDerivAt_regularizedStateGradient y + (-((5 / 4 : ℝ) • a) + (20 : ℝ) • a) + (sub_ne_zero.mpr hxy) (sub_ne_zero.mpr hxz) (sub_ne_zero.mpr hzy) + convert h using 1 + funext p + unfold stationary + have hp : p.2 - p.1 = -(p.1 - p.2) := by abel + rw [hp, pairGradient_neg, smul_add] + congr 1 + abel + +/-- Concrete strict convexity on every open convex state domain with the +uniform pair separation used in the local construction. -/ +theorem statePotential_strictConvexOn_of_separated (a y : E) {V : Set (E × E)} + (hV : Convex ℝ V) (hVopen : IsOpen V) + (hsep : ∀ s ∈ V, (2 : ℝ) / 3 ≤ ‖s.1 - y‖ ∧ + (2 : ℝ) / 3 ≤ ‖s.1 - s.2‖ ∧ (2 : ℝ) / 3 ≤ ‖s.2 - y‖) : + StrictConvexOn ℝ V (statePotential a y) := by + have hne : ∀ {x z : E}, (2 : ℝ) / 3 ≤ ‖x - z‖ → x ≠ z := by + intro x z h hxz + norm_num [hxz] at h + apply strictConvexOn_of_positive_stateGradient E E hV hVopen + (G := fun s => stationary a (y, s)) + (A := fun s => regularizedStateHessian (s.1 - y) (s.1 - s.2) (s.2 - y)) + · intro s hs + rw [← stateDifferential_eq_stateDual] + exact hasFDerivAt_statePotential a y + (hne (hsep s hs).1) (hne (hsep s hs).2.1) (hne (hsep s hs).2.2) + · intro s hs + exact hasFDerivAt_stateStationary a y + (hne (hsep s hs).1) (hne (hsep s hs).2.1) (hne (hsep s hs).2.2) + · intro s hs v hv + exact regularizedStateHessian_pos (hsep s hs).1 (hsep s hs).2.1 (hsep s hs).2.2 hv + +/-- A zero of the actual Coulomb stationary map is the unique minimizing state +on a separated open convex domain. -/ +theorem statePotential_minimum_and_eq_iff_of_separated (a y : E) {V : Set (E × E)} + (hV : Convex ℝ V) (hVopen : IsOpen V) + (hsep : ∀ s ∈ V, (2 : ℝ) / 3 ≤ ‖s.1 - y‖ ∧ + (2 : ℝ) / 3 ≤ ‖s.1 - s.2‖ ∧ (2 : ℝ) / 3 ≤ ‖s.2 - y‖) + {s : E × E} (hs : s ∈ V) (hzero : stationary a (y, s) = 0) + {q : E × E} (hq : q ∈ V) : + statePotential a y s ≤ statePotential a y q ∧ + (statePotential a y q = statePotential a y s ↔ q = s) := by + have hne : ∀ {x z : E}, (2 : ℝ) / 3 ≤ ‖x - z‖ → x ≠ z := by + intro x z h hxz + norm_num [hxz] at h + have hconv := statePotential_strictConvexOn_of_separated a y hV hVopen hsep + have hstat := hasFDerivAt_statePotential_zero a y + (hne (hsep s hs).1) (hne (hsep s hs).2.1) (hne (hsep s hs).2.2) hzero + exact ⟨convex_isMinOn_of_hasFDerivAt_zero hconv.convexOn hs hstat hq, + strictConvex_eq_iff_of_hasFDerivAt_zero hconv hs hstat hq⟩ + +/-- A smooth branch of zeros of the concrete Coulomb stationary equation +produces a smooth supporting value with its exact contact graph. All analytic +convexity hypotheses are discharged by the explicit distance separation. -/ +theorem smooth_stationary_branch_support (a : E) + {U : Set E} {V : Set (E × E)} {ψ : E → E × E} {n : WithTop ENat} + (hV : Convex ℝ V) (hVopen : IsOpen V) + (hsep : ∀ y ∈ U, ∀ s ∈ V, (2 : ℝ) / 3 ≤ ‖s.1 - y‖ ∧ + (2 : ℝ) / 3 ≤ ‖s.1 - s.2‖ ∧ (2 : ℝ) / 3 ≤ ‖s.2 - y‖) + (hψ : ContDiffOn ℝ n ψ U) (hψV : MapsTo ψ U V) + (hzero : ∀ y ∈ U, stationary a (y, ψ y) = 0) : + ContDiffOn ℝ n (fun y => statePotential a y (ψ y)) U ∧ + ∀ y ∈ U, ∀ s ∈ V, + statePotential a y (ψ y) ≤ statePotential a y s ∧ + (statePotential a y s = statePotential a y (ψ y) ↔ s = ψ y) := by + have hne : ∀ {x z : E}, (2 : ℝ) / 3 ≤ ‖x - z‖ → x ≠ z := by + intro x z h hxz + norm_num [hxz] at h + have hF : ContDiffOn ℝ n (jointPotential a) (U ×ˢ V) := by + intro p hp + exact (contDiffAt_jointPotential a + (hne (hsep p.1 hp.1 p.2 hp.2).1) + (hne (hsep p.1 hp.1 p.2 hp.2).2.1) + (hne (hsep p.1 hp.1 p.2 hp.2).2.2)).contDiffWithinAt + constructor + · exact hF.comp (contDiffOn_id.prodMk hψ) (fun y hy => ⟨hy, hψV hy⟩) + · intro y hy s hs + exact statePotential_minimum_and_eq_iff_of_separated a y hV hVopen + (hsep y hy) (hψV hy) (hzero y hy) hs + +end Problem356.StationaryMap + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/StationaryEquation.lean b/lean/OAI/Analysis/CoulombTransport/StationaryEquation.lean new file mode 100644 index 0000000000000000000000000000000000000000..b215bd7ba90f693a189c88c706eb65914be6d7ec --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/StationaryEquation.lean @@ -0,0 +1,169 @@ +import OAI.Analysis.CoulombTransport.GeometryJets + +namespace OAI + +universe uE + +noncomputable section + +namespace Problem356.GeometryJets + +open CoulombCalculus + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The state gradient of the regularized three-body Coulomb cost. +The input is `(parameter, (central point, negative outer point))`. -/ +def stationaryEquation (K : ℝ) (a : E) (p : E × (E × E)) : E × E := + (pairGradient (p.2.1 - p.1) + pairGradient (p.2.1 - p.2.2) + K • p.2.1, + -pairGradient (p.2.1 - p.2.2) - pairGradient (p.1 - p.2.2) - + (5 / 4 : ℝ) • a + K • (p.2.2 + a)) + +/-- The center state Hessian, expressed using the single-pair unit-center Hessian. -/ +def centerStateHessian (K : ℝ) (Q : E →L[ℝ] E) : (E × E) →L[ℝ] (E × E) := + (((2 : ℝ) • Q + K • ContinuousLinearMap.id ℝ E).comp + (ContinuousLinearMap.fst ℝ E E) - Q.comp (ContinuousLinearMap.snd ℝ E E)).prod + (-(Q.comp (ContinuousLinearMap.fst ℝ E E)) + + ((9 / 8 : ℝ) • Q + K • ContinuousLinearMap.id ℝ E).comp + (ContinuousLinearMap.snd ℝ E E)) + +/-- The center derivative with respect to the moving positive outer point. -/ +def centerParameterDerivative (Q : E →L[ℝ] E) : E →L[ℝ] (E × E) := + (-Q).prod ((-1 / 8 : ℝ) • Q) + +lemma stationaryEquation_center (K : ℝ) (a : E) (ha : ‖a‖ = 1) : + stationaryEquation K a (a, (0, -a)) = 0 := by + have hvec : a - -a = (2 : ℝ) • a := by module + simp [stationaryEquation, pairGradient, hvec, norm_smul, ha] + module + +private lemma hessian_neg_center (a : E) : pairHessian (-a) = pairHessian a := by + apply ContinuousLinearMap.ext + intro v + simp [pairHessian, innerSL, ContinuousLinearMap.smulRight_apply] + +private lemma hessian_double_center (a : E) (ha : ‖a‖ = 1) : + pairHessian ((2 : ℝ) • a) = (1 / 8 : ℝ) • pairHessian a := by + apply ContinuousLinearMap.ext + intro v + simp [pairHessian, innerSL, ContinuousLinearMap.smulRight_apply, norm_smul, ha] + module + +lemma hasFDerivAt_stationary_state_center (K : ℝ) (a : E) (ha : ‖a‖ = 1) : + HasFDerivAt (fun p : E × E => stationaryEquation K a (a, p)) + (centerStateHessian K (pairHessian a)) (0, -a) := by + have ha0 := center_nonzero ha + have hneg : -a ≠ 0 := neg_ne_zero.mpr ha0 + have hvec : a - -a = (2 : ℝ) • a := by module + have hdouble : a - -a ≠ 0 := by + rw [hvec] + exact smul_ne_zero (by norm_num) ha0 + have hf : HasFDerivAt (fun p : E × E => p.1) + (ContinuousLinearMap.fst ℝ E E) (0, -a) := hasFDerivAt_fst + have hz : HasFDerivAt (fun p : E × E => p.2) + (ContinuousLinearMap.snd ℝ E E) (0, -a) := hasFDerivAt_snd + have h1 := (hasFDerivAt_pairGradient (show (0 : E) - a ≠ 0 by simpa using hneg)).comp + (0, -a) (hf.sub_const a) + have h2 := (hasFDerivAt_pairGradient (show (0 : E) - -a ≠ 0 by simpa using ha0)).comp + (0, -a) (hf.sub hz) + have h3 := (hasFDerivAt_pairGradient hdouble).comp (0, -a) (hz.const_sub a) + have hx := (h1.add h2).add (hf.const_smul K) + have hzz := ((h2.neg.sub h3).sub_const ((5 / 4 : ℝ) • a)).add + ((hz.add_const a).const_smul K) + convert! hx.prodMk hzz using 1 + apply ContinuousLinearMap.ext + intro p + simp [centerStateHessian, hvec, hessian_double_center a ha] + constructor <;> module + +lemma hasFDerivAt_stationary_parameter_center (K : ℝ) (a : E) (ha : ‖a‖ = 1) : + HasFDerivAt (fun y : E => stationaryEquation K a (y, (0, -a))) + (centerParameterDerivative (pairHessian a)) a := by + have ha0 := center_nonzero ha + have hneg : -a ≠ 0 := neg_ne_zero.mpr ha0 + have hvec : a - -a = (2 : ℝ) • a := by module + have hdouble : a - -a ≠ 0 := by + rw [hvec] + exact smul_ne_zero (by norm_num) ha0 + have hy := hasFDerivAt_id (𝕜 := ℝ) a + have h1 := (hasFDerivAt_pairGradient (show (0 : E) - a ≠ 0 by simpa using hneg)).comp + a (hy.const_sub 0) + have h3 := (hasFDerivAt_pairGradient hdouble).comp a (hy.sub_const (-a)) + have hx := (h1.add_const (pairGradient ((0 : E) - -a))).add_const (K • (0 : E)) + have hz := ((h3.const_sub (-pairGradient ((0 : E) - -a))).sub_const + ((5 / 4 : ℝ) • a)).add_const (K • (-a + a)) + convert! hx.prodMk hz using 1 + apply ContinuousLinearMap.ext + intro p + simp [centerParameterDerivative, hvec, hessian_double_center a ha] + module + +lemma contDiffAt_stationaryEquation {n : WithTop ENat} (K : ℝ) (a : E) + (p : E × (E × E)) (hxy : p.2.1 ≠ p.1) (hxz : p.2.1 ≠ p.2.2) + (hyz : p.1 ≠ p.2.2) : ContDiffAt ℝ n (stationaryEquation K a) p := by + have hy : ContDiffAt ℝ n (fun q : E × (E × E) => q.1) p := contDiffAt_fst + have hx : ContDiffAt ℝ n (fun q : E × (E × E) => q.2.1) p := contDiffAt_snd.fst + have hz : ContDiffAt ℝ n (fun q : E × (E × E) => q.2.2) p := contDiffAt_snd.snd + have h1 := (contDiffAt_pairGradient (n := n) (sub_ne_zero.mpr hxy)).comp p (hx.sub hy) + have h2 := (contDiffAt_pairGradient (n := n) (sub_ne_zero.mpr hxz)).comp p (hx.sub hz) + have h3 := (contDiffAt_pairGradient (n := n) (sub_ne_zero.mpr hyz)).comp p (hy.sub hz) + exact ((h1.add h2).add (hx.const_smul K)).prodMk + (((h2.neg.sub h3).sub contDiffAt_const).add ((hz.add contDiffAt_const).const_smul K)) + +lemma contDiffAt_stationaryEquation_center {n : WithTop ENat} + (K : ℝ) (a : E) (ha : ‖a‖ = 1) : + ContDiffAt ℝ n (stationaryEquation K a) (a, (0, -a)) := by + have ha0 := center_nonzero ha + apply contDiffAt_stationaryEquation + · exact ha0.symm + · exact (neg_ne_zero.mpr ha0).symm + · intro h + have hnorm : ‖a - -a‖ = 2 := by + have hvec : a - -a = (2 : ℝ) • a := by module + rw [hvec, norm_smul, ha] + norm_num + change a = -a at h + rw [sub_eq_zero.mpr h, norm_zero] at hnorm + norm_num at hnorm + +/-- Total differential with the parameter block followed by the state block. -/ +def centerTotalDerivative (K : ℝ) (Q : E →L[ℝ] E) : + (E × (E × E)) →L[ℝ] (E × E) := + (centerParameterDerivative Q).comp (ContinuousLinearMap.fst ℝ E (E × E)) + + (centerStateHessian K Q).comp (ContinuousLinearMap.snd ℝ E (E × E)) + +lemma hasFDerivAt_stationary_center (K : ℝ) (a : E) (ha : ‖a‖ = 1) : + HasFDerivAt (stationaryEquation K a) + (centerTotalDerivative K (pairHessian a)) (a, (0, -a)) := by + have ha0 := center_nonzero ha + have hneg : -a ≠ 0 := neg_ne_zero.mpr ha0 + have hvec : a - -a = (2 : ℝ) • a := by module + have hdouble : a - -a ≠ 0 := by + rw [hvec] + exact smul_ne_zero (by norm_num) ha0 + have hy : HasFDerivAt (fun p : E × (E × E) => p.1) + (ContinuousLinearMap.fst ℝ E (E × E)) (a, (0, -a)) := hasFDerivAt_fst + have hs : HasFDerivAt (fun p : E × (E × E) => p.2) + (ContinuousLinearMap.snd ℝ E (E × E)) (a, (0, -a)) := hasFDerivAt_snd + have hx := hs.fst + have hz := hs.snd + have h1 := (hasFDerivAt_pairGradient (show (0 : E) - a ≠ 0 by simpa using hneg)).comp + (a, (0, -a)) (hx.sub hy) + have h2 := (hasFDerivAt_pairGradient (show (0 : E) - -a ≠ 0 by simpa using ha0)).comp + (a, (0, -a)) (hx.sub hz) + have h3 := (hasFDerivAt_pairGradient hdouble).comp (a, (0, -a)) (hy.sub hz) + have hfirst := (h1.add h2).add (hx.const_smul K) + have hsecond := ((h2.neg.sub h3).sub_const ((5 / 4 : ℝ) • a)).add + ((hz.add_const a).const_smul K) + convert! hfirst.prodMk hsecond using 1 + apply ContinuousLinearMap.ext + intro p + simp [centerTotalDerivative, centerParameterDerivative, centerStateHessian, + hvec, hessian_double_center a ha] + constructor <;> module + +end Problem356.GeometryJets + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/StationaryMap.lean b/lean/OAI/Analysis/CoulombTransport/StationaryMap.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a4b416312ba3eb4aaff2467da09663d2444a950 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/StationaryMap.lean @@ -0,0 +1,146 @@ +import OAI.Analysis.CoulombTransport.CoulombCalculus + +namespace OAI + +universe uE + +noncomputable section + +open scoped RealInnerProductSpace + +namespace Problem356.StationaryMap + +open CoulombCalculus + +variable {E : Type uE} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +/-- The state potential with the explicit common central quadratic, K = 20. -/ +def statePotential (a y : E) (s : E × E) : ℝ := + pairCost (s.1 - y) + pairCost (s.1 - s.2) + pairCost (s.2 - y) - + ((5 : ℝ) / 2 - 10 * ‖s.1‖ ^ 2) - + ((5 : ℝ) / 4 * ⟪a, s.2 + a⟫ - 10 * ‖s.2 + a‖ ^ 2) + +/-- The concrete stationary equation, with parameter first and state second. -/ +def stationary (a : E) (p : E × (E × E)) : E × E := + (pairGradient (p.2.1 - p.1) + pairGradient (p.2.1 - p.2.2) + (20 : ℝ) • p.2.1, + pairGradient (p.2.2 - p.2.1) + pairGradient (p.2.2 - p.1) - + (5 / 4 : ℝ) • a + (20 : ℝ) • (p.2.2 + a)) + +/-- Analyticity of the actual stationary equation on pairwise-distinct triples. -/ +theorem contDiffAt_stationary (a : E) {p : E × (E × E)} + (hxy : p.2.1 ≠ p.1) (hxz : p.2.1 ≠ p.2.2) (hzy : p.2.2 ≠ p.1) + {n : WithTop ENat} : ContDiffAt ℝ n (stationary a) p := by + have hY : ContDiffAt ℝ n (fun q : E × (E × E) => q.1) p := contDiffAt_fst + have hX : ContDiffAt ℝ n (fun q : E × (E × E) => q.2.1) p := + contDiffAt_snd.fst + have hZ : ContDiffAt ℝ n (fun q : E × (E × E) => q.2.2) p := + contDiffAt_snd.snd + have hXY := (contDiffAt_pairGradient (sub_ne_zero.mpr hxy)).comp p (hX.sub hY) + have hXZ := (contDiffAt_pairGradient (sub_ne_zero.mpr hxz)).comp p (hX.sub hZ) + have hZX := (contDiffAt_pairGradient (sub_ne_zero.mpr hxz.symm)).comp p (hZ.sub hX) + have hZY := (contDiffAt_pairGradient (sub_ne_zero.mpr hzy)).comp p (hZ.sub hY) + exact ((hXY.add hXZ).add (hX.const_smul (20 : ℝ))).prodMk + (((hZX.add hZY).sub contDiffAt_const).add ((hZ.add contDiffAt_const).const_smul (20 : ℝ))) + +/-- Analyticity of the state potential away from all collisions. -/ +theorem contDiffAt_statePotential (a y : E) {s : E × E} + (hxy : s.1 ≠ y) (hxz : s.1 ≠ s.2) (hzy : s.2 ≠ y) + {n : WithTop ENat} : ContDiffAt ℝ n (statePotential a y) s := by + have hX : ContDiffAt ℝ n (fun q : E × E => q.1) s := contDiffAt_fst + have hZ : ContDiffAt ℝ n (fun q : E × E => q.2) s := contDiffAt_snd + have hXY := (contDiffAt_pairCost (sub_ne_zero.mpr hxy)).comp s + (hX.sub contDiffAt_const) + have hXZ := (contDiffAt_pairCost (sub_ne_zero.mpr hxz)).comp s (hX.sub hZ) + have hZY := (contDiffAt_pairCost (sub_ne_zero.mpr hzy)).comp s + (hZ.sub contDiffAt_const) + exact (((hXY.add hXZ).add hZY).sub + (contDiffAt_const.sub (contDiffAt_const.mul (hX.norm_sq ℝ)))).sub + ((contDiffAt_const.mul (contDiffAt_const.inner ℝ (hZ.add contDiffAt_const))).sub + (contDiffAt_const.mul ((hZ.add contDiffAt_const).norm_sq ℝ))) + +/-- The scalar potential with parameter and state bundled together. -/ +def jointPotential (a : E) (p : E × (E × E)) : ℝ := statePotential a p.1 p.2 + +/-- Joint parameter/state analyticity on pairwise-distinct triples. -/ +theorem contDiffAt_jointPotential (a : E) {p : E × (E × E)} + (hxy : p.2.1 ≠ p.1) (hxz : p.2.1 ≠ p.2.2) (hzy : p.2.2 ≠ p.1) + {n : WithTop ENat} : ContDiffAt ℝ n (jointPotential a) p := by + have hY : ContDiffAt ℝ n (fun q : E × (E × E) => q.1) p := contDiffAt_fst + have hX : ContDiffAt ℝ n (fun q : E × (E × E) => q.2.1) p := contDiffAt_snd.fst + have hZ : ContDiffAt ℝ n (fun q : E × (E × E) => q.2.2) p := contDiffAt_snd.snd + have hXY := (contDiffAt_pairCost (sub_ne_zero.mpr hxy)).comp p (hX.sub hY) + have hXZ := (contDiffAt_pairCost (sub_ne_zero.mpr hxz)).comp p (hX.sub hZ) + have hZY := (contDiffAt_pairCost (sub_ne_zero.mpr hzy)).comp p (hZ.sub hY) + exact (((hXY.add hXZ).add hZY).sub + (contDiffAt_const.sub (contDiffAt_const.mul (hX.norm_sq ℝ)))).sub + ((contDiffAt_const.mul (contDiffAt_const.inner ℝ (hZ.add contDiffAt_const))).sub + (contDiffAt_const.mul ((hZ.add contDiffAt_const).norm_sq ℝ))) + +/-- The linear form represented by the two components of the stationary map. -/ +def stateDifferential (a y : E) (s : E × E) : E × E →L[ℝ] ℝ := + (innerSL ℝ (stationary a (y, s)).1).comp (ContinuousLinearMap.fst ℝ E E) + + (innerSL ℝ (stationary a (y, s)).2).comp (ContinuousLinearMap.snd ℝ E E) + +/-- The displayed stationary equation really is the state derivative of the supporting potential. -/ +theorem hasFDerivAt_statePotential (a y : E) {s : E × E} + (hxy : s.1 ≠ y) (hxz : s.1 ≠ s.2) (hzy : s.2 ≠ y) : + HasFDerivAt (statePotential a y) (stateDifferential a y s) s := by + have hX : HasFDerivAt (fun q : E × E => q.1) + (ContinuousLinearMap.fst ℝ E E) s := hasFDerivAt_fst + have hZ : HasFDerivAt (fun q : E × E => q.2) + (ContinuousLinearMap.snd ℝ E E) s := hasFDerivAt_snd + have hXY := (hasFDerivAt_pairCost (sub_ne_zero.mpr hxy)).comp s (hX.sub_const y) + have hXZ := (hasFDerivAt_pairCost (sub_ne_zero.mpr hxz)).comp s (hX.sub hZ) + have hZY := (hasFDerivAt_pairCost (sub_ne_zero.mpr hzy)).comp s (hZ.sub_const y) + have h := (((hXY.add hXZ).add hZY).sub + ((hasFDerivAt_const ((5 : ℝ) / 2) s).sub (hX.norm_sq.const_mul 10))).sub + ((((hasFDerivAt_const a s).inner ℝ (hZ.add_const a)).const_mul ((5 : ℝ) / 4)).sub + ((hZ.add_const a).norm_sq.const_mul 10)) + convert! h using 1 + apply ContinuousLinearMap.ext + intro v + simp [stateDifferential, stationary, pairGradient, mul_sub, norm_sub_rev s.2 s.1] + ring + +/-- The full parameter/state derivative of the concrete stationary equation. -/ +def stationaryDifferential (p : E × (E × E)) : + E × (E × E) →L[ℝ] E × E := + let Y := ContinuousLinearMap.fst ℝ E (E × E) + let X := (ContinuousLinearMap.fst ℝ E E).comp (ContinuousLinearMap.snd ℝ E (E × E)) + let Z := (ContinuousLinearMap.snd ℝ E E).comp (ContinuousLinearMap.snd ℝ E (E × E)) + ((pairHessian (p.2.1 - p.1)).comp (X - Y) + + (pairHessian (p.2.1 - p.2.2)).comp (X - Z) + (20 : ℝ) • X).prod + ((pairHessian (p.2.2 - p.2.1)).comp (Z - X) + + (pairHessian (p.2.2 - p.1)).comp (Z - Y) + (20 : ℝ) • Z) + +theorem hasFDerivAt_stationary (a : E) {p : E × (E × E)} + (hxy : p.2.1 ≠ p.1) (hxz : p.2.1 ≠ p.2.2) (hzy : p.2.2 ≠ p.1) : + HasFDerivAt (stationary a) (stationaryDifferential p) p := by + have hY : HasFDerivAt (fun q : E × (E × E) => q.1) + (ContinuousLinearMap.fst ℝ E (E × E)) p := hasFDerivAt_fst + have hX : HasFDerivAt (fun q : E × (E × E) => q.2.1) + ((ContinuousLinearMap.fst ℝ E E).comp (ContinuousLinearMap.snd ℝ E (E × E))) p := + (hasFDerivAt_fst (𝕜 := ℝ)).comp p (hasFDerivAt_snd (𝕜 := ℝ)) + have hZ : HasFDerivAt (fun q : E × (E × E) => q.2.2) + ((ContinuousLinearMap.snd ℝ E E).comp (ContinuousLinearMap.snd ℝ E (E × E))) p := + (hasFDerivAt_snd (𝕜 := ℝ)).comp p (hasFDerivAt_snd (𝕜 := ℝ)) + have hXY := (hasFDerivAt_pairGradient (sub_ne_zero.mpr hxy)).comp p (hX.sub hY) + have hXZ := (hasFDerivAt_pairGradient (sub_ne_zero.mpr hxz)).comp p (hX.sub hZ) + have hZX := (hasFDerivAt_pairGradient (sub_ne_zero.mpr hxz.symm)).comp p (hZ.sub hX) + have hZY := (hasFDerivAt_pairGradient (sub_ne_zero.mpr hzy)).comp p (hZ.sub hY) + exact ((hXY.add hXZ).add (hX.const_smul (20 : ℝ))).prodMk + (((hZX.add hZY).sub_const ((5 / 4 : ℝ) • a)).add ((hZ.add_const a).const_smul (20 : ℝ))) + +/-- A zero of the explicit stationary map is a stationary point of the scalar potential. -/ +theorem hasFDerivAt_statePotential_zero (a y : E) {s : E × E} + (hxy : s.1 ≠ y) (hxz : s.1 ≠ s.2) (hzy : s.2 ≠ y) + (hzero : stationary a (y, s) = 0) : + HasFDerivAt (statePotential a y) (0 : E × E →L[ℝ] ℝ) s := by + have h := hasFDerivAt_statePotential a y hxy hxz hzy + simpa [stateDifferential, hzero] using h + +end Problem356.StationaryMap + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/StrictMinimum.lean b/lean/OAI/Analysis/CoulombTransport/StrictMinimum.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc693e9e222fe21591750dc78dfc8691631970c9 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/StrictMinimum.lean @@ -0,0 +1,154 @@ +import Mathlib + +namespace OAI + +universe uE uP + +noncomputable section + +open Set Filter +open scoped Topology + +namespace Problem356 + +variable {E : Type uE} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- A stationary point of a convex differentiable function is a global minimizer +on its convexity domain. -/ +theorem convex_isMinOn_of_hasFDerivAt_zero {s : Set E} {f : E → ℝ} {x : E} + (hf : ConvexOn ℝ s f) (hx : x ∈ s) + (hd : HasFDerivAt f (0 : E →L[ℝ] ℝ) x) : IsMinOn f s x := by + intro y hy + have hline := hf.comp_affineMap (AffineMap.lineMap x y) + have hderiv : HasDerivAt (f ∘ AffineMap.lineMap x y) 0 (0 : ℝ) := by + have hd' : HasFDerivAt f (0 : E →L[ℝ] ℝ) ((AffineMap.lineMap x y) (0 : ℝ)) := by + simpa using hd + have h := hd'.comp_hasDerivAt (0 : ℝ) + (AffineMap.hasDerivAt_lineMap : HasDerivAt (AffineMap.lineMap x y) (y - x) (0 : ℝ)) + simpa using h + have hle := hline.le_slope_of_hasDerivAt + (by simpa using hx) (by simpa using hy) (by norm_num : (0 : ℝ) < 1) hderiv + simpa [slope_def_field] using hle + +/-- Strict convexity upgrades a stationary point to the unique minimum. -/ +theorem strictConvex_eq_iff_of_hasFDerivAt_zero {s : Set E} {f : E → ℝ} {x : E} + (hf : StrictConvexOn ℝ s f) (hx : x ∈ s) + (hd : HasFDerivAt f (0 : E →L[ℝ] ℝ) x) {y : E} (hy : y ∈ s) : + f y = f x ↔ y = x := by + have hmin := convex_isMinOn_of_hasFDerivAt_zero hf.convexOn hx hd + constructor + · intro heq + have hymin : IsMinOn f s y := by + intro z hz + change f y ≤ f z + rw [heq] + exact hmin hz + exact hf.eq_of_isMinOn hymin hmin hy hx + · rintro rfl + rfl + +/-- Strict positivity of second derivatives on nonconstant line segments implies +strict convexity in an arbitrary real normed space. -/ +theorem strictConvexOn_of_line_deriv2_pos {s : Set E} {f : E → ℝ} + (hs : Convex ℝ s) (hf : ContinuousOn f s) + (hpos : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → ∀ t ∈ Ioo (0 : ℝ) 1, + 0 < deriv (deriv (f ∘ AffineMap.lineMap x y)) t) : + StrictConvexOn ℝ s f := by + refine ⟨hs, ?_⟩ + intro x hx y hy hxy a b ha hb hab + have hmaps : MapsTo (AffineMap.lineMap x y) (Icc (0 : ℝ) 1) s := by + intro t ht + rw [AffineMap.lineMap_apply_module] + exact hs hx hy (sub_nonneg.mpr ht.2) ht.1 (by ring) + have hcont : ContinuousOn (f ∘ AffineMap.lineMap x y) (Icc (0 : ℝ) 1) := + hf.comp (AffineMap.lineMap x y : ℝ →ᵃ[ℝ] E).differentiable.continuous.continuousOn hmaps + have hstrict : StrictConvexOn ℝ (Icc (0 : ℝ) 1) + (f ∘ AffineMap.lineMap x y) := by + apply strictConvexOn_of_deriv2_pos (convex_Icc _ _) hcont + intro t ht + exact hpos x hx y hy hxy t (by simpa using ht) + have hh := hstrict.2 (by simp : (0 : ℝ) ∈ Icc (0 : ℝ) 1) + (by simp : (1 : ℝ) ∈ Icc (0 : ℝ) 1) (by norm_num : (0 : ℝ) ≠ 1) + ha hb hab + have ha1 : 1 - b = a := by linarith + simpa [AffineMap.lineMap_apply_module, ha1] using hh + +/-- A positive-definite second Fréchet derivative gives strict convexity on an +open convex domain. The two derivative fields are explicit, so this applies +directly to computed Hessians without rewriting `fderiv`. -/ +theorem strictConvexOn_of_positive_hessian {s : Set E} {f : E → ℝ} + {f' : E → E →L[ℝ] ℝ} {f'' : E → E →L[ℝ] E →L[ℝ] ℝ} + (hs : Convex ℝ s) (hsopen : IsOpen s) + (hf : ∀ z ∈ s, HasFDerivAt f (f' z) z) + (hf' : ∀ z ∈ s, HasFDerivAt f' (f'' z) z) + (hpos : ∀ z ∈ s, ∀ v : E, v ≠ 0 → 0 < f'' z v v) : + StrictConvexOn ℝ s f := by + apply strictConvexOn_of_line_deriv2_pos hs + (fun z hz => (hf z hz).continuousAt.continuousWithinAt) + intro x hx y hy hxy t ht + have hmaps : MapsTo (AffineMap.lineMap x y) (Icc (0 : ℝ) 1) s := by + intro u hu + rw [AffineMap.lineMap_apply_module] + exact hs hx hy (sub_nonneg.mpr hu.2) hu.1 (by ring) + have hz : AffineMap.lineMap x y t ∈ s := hmaps ⟨ht.1.le, ht.2.le⟩ + have hnear : ∀ᶠ u in 𝓝 t, AffineMap.lineMap x y u ∈ s := + AffineMap.lineMap_continuous.continuousAt.eventually_mem (hsopen.mem_nhds hz) + have hfirst : deriv (f ∘ AffineMap.lineMap x y) =ᶠ[𝓝 t] + (fun u => f' (AffineMap.lineMap x y u) (y - x)) := by + filter_upwards [hnear] with u hu + exact ((hf _ hu).comp_hasDerivAt u AffineMap.hasDerivAt_lineMap).deriv + have hsecond : HasDerivAt (fun u : ℝ => f' (AffineMap.lineMap x y u) (y - x)) + (f'' (AffineMap.lineMap x y t) (y - x) (y - x)) t := by + have hcomp := (hf' _ hz).comp_hasDerivAt t AffineMap.hasDerivAt_lineMap + simpa using hcomp.clm_apply (hasDerivAt_const t (y - x)) + rw [hfirst.deriv_eq, hsecond.deriv] + exact hpos _ hz (y - x) (sub_ne_zero.mpr hxy.symm) + +/-- A smooth stationary branch in strictly convex state slices defines a smooth +supporting value, and its graph is exactly the contact set. -/ +theorem stationary_family_certificate + {P : Type uP} [NormedAddCommGroup P] [NormedSpace ℝ P] + {U : Set P} {V : Set E} {n : WithTop ENat} + {F : P × E → ℝ} {ψ : P → E} + (hF : ContDiffOn ℝ n F (U ×ˢ V)) (hψ : ContDiffOn ℝ n ψ U) + (hψV : MapsTo ψ U V) + (hconv : ∀ p ∈ U, StrictConvexOn ℝ V (fun z => F (p, z))) + (hstat : ∀ p ∈ U, HasFDerivAt (fun z => F (p, z)) + (0 : E →L[ℝ] ℝ) (ψ p)) : + ContDiffOn ℝ n (fun p => F (p, ψ p)) U ∧ + ∀ p ∈ U, ∀ z ∈ V, + F (p, ψ p) ≤ F (p, z) ∧ (F (p, z) = F (p, ψ p) ↔ z = ψ p) := by + constructor + · exact hF.comp (contDiffOn_id.prodMk hψ) (fun p hp => ⟨hp, hψV hp⟩) + · intro p hp z hz + exact ⟨convex_isMinOn_of_hasFDerivAt_zero (hconv p hp).convexOn + (hψV hp) (hstat p hp) hz, + strictConvex_eq_iff_of_hasFDerivAt_zero (hconv p hp) (hψV hp) (hstat p hp) hz⟩ + +/-- Version of `stationary_family_certificate` using explicit positive Hessians. +This is the analytic supporting-certificate step of the local construction. -/ +theorem stationary_family_certificate_of_positive_hessian + {P : Type uP} [NormedAddCommGroup P] [NormedSpace ℝ P] + {U : Set P} {V : Set E} {n : WithTop ENat} + {F : P × E → ℝ} {ψ : P → E} + {D : P → E → E →L[ℝ] ℝ} {H : P → E → E →L[ℝ] E →L[ℝ] ℝ} + (hF : ContDiffOn ℝ n F (U ×ˢ V)) (hψ : ContDiffOn ℝ n ψ U) + (hψV : MapsTo ψ U V) (hV : Convex ℝ V) (hVopen : IsOpen V) + (hD : ∀ p ∈ U, ∀ z ∈ V, HasFDerivAt (fun z => F (p, z)) (D p z) z) + (hH : ∀ p ∈ U, ∀ z ∈ V, HasFDerivAt (D p) (H p z) z) + (hpos : ∀ p ∈ U, ∀ z ∈ V, ∀ v : E, v ≠ 0 → 0 < H p z v v) + (hstat : ∀ p ∈ U, D p (ψ p) = 0) : + ContDiffOn ℝ n (fun p => F (p, ψ p)) U ∧ + ∀ p ∈ U, ∀ z ∈ V, + F (p, ψ p) ≤ F (p, z) ∧ (F (p, z) = F (p, ψ p) ↔ z = ψ p) := by + apply stationary_family_certificate hF hψ hψV + · intro p hp + exact strictConvexOn_of_positive_hessian hV hVopen (hD p hp) (hH p hp) (hpos p hp) + · intro p hp + simpa [hstat p hp] using hD p hp (ψ p) (hψV hp) + +end Problem356 + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/Symmetrization.lean b/lean/OAI/Analysis/CoulombTransport/Symmetrization.lean new file mode 100644 index 0000000000000000000000000000000000000000..31b50322cfdc2fb742e73e65e9f597cc3e835c51 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/Symmetrization.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.Cyclic + +/-- The cyclic rotation of the three particles. -/ +def rotate : Triple ≃ᵐ Triple where + toFun t := (t.2.1, (t.2.2, t.1)) + invFun t := (t.2.2, (t.1, t.2.1)) + left_inv t := by rfl + right_inv t := by rfl + measurable_toFun := measurable_snd.fst.prodMk + (measurable_snd.snd.prodMk measurable_fst) + measurable_invFun := measurable_snd.snd.prodMk + (measurable_fst.prodMk measurable_snd.fst) + +/-- Averaging over the cyclic group already gives identical coordinate marginals. -/ +def symmetrize (pi : Measure Triple) : Measure Triple := + (3 : ℝ≥0∞)⁻¹ • (pi + Measure.map rotate pi + Measure.map rotate.symm pi) + +/-- The common marginal of the cyclic average. -/ +def averageMarginal (pi : Measure Triple) : Measure E3 := + (3 : ℝ≥0∞)⁻¹ • + (Measure.map tripleFst pi + Measure.map tripleSnd pi + Measure.map tripleThd pi) + +private theorem measurable_fst₃ : Measurable tripleFst := measurable_fst +private theorem measurable_snd₃ : Measurable tripleSnd := measurable_snd.fst +private theorem measurable_thd₃ : Measurable tripleThd := measurable_snd.snd + +theorem map_fst_symmetrize (pi : Measure Triple) : + Measure.map tripleFst (symmetrize pi) = averageMarginal pi := by + simp only [symmetrize, averageMarginal, Measure.map_smul _ measurable_fst₃.aemeasurable, + Measure.map_add _ _ measurable_fst₃, + Measure.map_map measurable_fst₃ rotate.measurable, + Measure.map_map measurable_fst₃ rotate.symm.measurable] + rfl + +theorem map_snd_symmetrize (pi : Measure Triple) : + Measure.map tripleSnd (symmetrize pi) = averageMarginal pi := by + simp only [symmetrize, averageMarginal, Measure.map_smul _ measurable_snd₃.aemeasurable, + Measure.map_add _ _ measurable_snd₃, + Measure.map_map measurable_snd₃ rotate.measurable, + Measure.map_map measurable_snd₃ rotate.symm.measurable] + change (3 : ℝ≥0∞)⁻¹ • + (Measure.map tripleSnd pi + Measure.map tripleThd pi + Measure.map tripleFst pi) = _ + ac_rfl + +theorem map_thd_symmetrize (pi : Measure Triple) : + Measure.map tripleThd (symmetrize pi) = averageMarginal pi := by + simp only [symmetrize, averageMarginal, Measure.map_smul _ measurable_thd₃.aemeasurable, + Measure.map_add _ _ measurable_thd₃, + Measure.map_map measurable_thd₃ rotate.measurable, + Measure.map_map measurable_thd₃ rotate.symm.measurable] + change (3 : ℝ≥0∞)⁻¹ • + (Measure.map tripleThd pi + Measure.map tripleFst pi + Measure.map tripleSnd pi) = _ + ac_rfl + +theorem symmetrize_probability (pi : Measure Triple) [IsProbabilityMeasure pi] : + IsProbabilityMeasure (symmetrize pi) := by + constructor + simp [symmetrize, Measure.map_apply rotate.measurable, + Measure.map_apply rotate.symm.measurable] + rw [← two_mul, ← add_one_mul] + norm_num only [Nat.reduceAdd] + exact ENNReal.mul_inv_cancel (by norm_num) (by norm_num) + +theorem symmetrize_isThreeCoupling (pi : Measure Triple) [IsProbabilityMeasure pi] : + IsThreeCoupling (averageMarginal pi) (symmetrize pi) := + ⟨symmetrize_probability pi, map_fst_symmetrize pi, + map_snd_symmetrize pi, map_thd_symmetrize pi⟩ + +/-- A cyclically invariant property holding almost everywhere survives symmetrization. +No measurability hypothesis on the property is necessary. -/ +theorem ae_symmetrize_of_rotate_invariant (pi : Measure Triple) {P : Triple → Prop} + (hP : ∀ᵐ t ∂pi, P t) (hrotate : ∀ t, P (rotate t) ↔ P t) : + ∀ᵐ t ∂symmetrize pi, P t := by + apply Measure.ae_smul_measure + rw [ae_add_measure_iff, ae_add_measure_iff] + refine ⟨⟨hP, rotate.measurableEmbedding.ae_map_iff.mpr ?_⟩, + rotate.symm.measurableEmbedding.ae_map_iff.mpr ?_⟩ + · exact hP.mono fun t ht => (hrotate t).mpr ht + · exact hP.mono fun t ht => (hrotate (rotate.symm t)).mp (by simpa using ht) + +theorem averageMarginal_probability (pi : Measure Triple) [IsProbabilityMeasure pi] : + IsProbabilityMeasure (averageMarginal pi) := by + have := symmetrize_probability pi + rw [← map_fst_symmetrize pi] + infer_instance + +private theorem invDistance_comm (x y : E3) : invDistance x y = invDistance y x := by + simp only [invDistance, norm_sub_rev] + +theorem cost_rotate (t : Triple) : coulombCost (rotate t) = coulombCost t := by + simp only [coulombCost, tripleFst, tripleSnd, tripleThd, rotate, + MeasurableEquiv.coe_mk, Equiv.coe_fn_mk] + rw [invDistance_comm t.2.1 t.1, invDistance_comm t.2.2 t.1] + ac_rfl + +theorem cost_rotate_symm (t : Triple) : coulombCost (rotate.symm t) = coulombCost t := by + simpa using (cost_rotate (rotate.symm t)).symm + +theorem lintegral_symmetrize (pi : Measure Triple) : + (∫⁻ t, coulombCost t ∂symmetrize pi) = ∫⁻ t, coulombCost t ∂pi := by + rw [symmetrize, lintegral_smul_measure, lintegral_add_measure, + lintegral_add_measure, lintegral_map_equiv, lintegral_map_equiv] + simp only [cost_rotate, cost_rotate_symm, smul_eq_mul] + rw [← two_mul, ← add_one_mul] + norm_num only [Nat.reduceAdd] + exact ENNReal.inv_mul_cancel_left (by norm_num) (by norm_num) + +end Problem356.Cyclic + +end + +end OAI diff --git a/lean/OAI/Analysis/CoulombTransport/TriplePermutation.lean b/lean/OAI/Analysis/CoulombTransport/TriplePermutation.lean new file mode 100644 index 0000000000000000000000000000000000000000..706131068d12332040a5fbe5fb47603b762f0442 --- /dev/null +++ b/lean/OAI/Analysis/CoulombTransport/TriplePermutation.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.CoulombTransport.Model + +namespace OAI + +noncomputable section + +open MeasureTheory +open scoped ENNReal + +namespace Problem356.TriplePermutation + +private lemma pair_symm (x y : E3) : invDistance x y = invDistance y x := by + simp only [invDistance, norm_sub_rev] + +lemma cost_swap_first (x y z : E3) : + coulombCost (x, (y, z)) = coulombCost (y, (x, z)) := by + simp only [coulombCost, tripleFst, tripleSnd, tripleThd] + rw [pair_symm y x] + ac_rfl + +lemma cost_swap_last (x y z : E3) : + coulombCost (x, (y, z)) = coulombCost (x, (z, y)) := by + simp only [coulombCost, tripleFst, tripleSnd, tripleThd] + rw [pair_symm z y] + ac_rfl + +lemma cost_rotate (x y z : E3) : + coulombCost (x, (y, z)) = coulombCost (z, (x, y)) := by + simp only [coulombCost, tripleFst, tripleSnd, tripleThd] + rw [pair_symm z x, pair_symm z y] + ac_rfl + +private lemma cost_eq_of_same_first {x y z b c : E3} + (h : List.Perm [x, y, z] [x, b, c]) : + coulombCost (x, (y, z)) = coulombCost (x, (b, c)) := by + have hp := List.perm_pair.mp (List.Perm.cons_inv h) + simp only [List.cons.injEq, and_true] at hp + rcases hp with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ + · rfl + · exact cost_swap_last _ _ _ + +/-- The extended Coulomb cost is invariant under every permutation, including +triples with coincident points and infinite cost. -/ +lemma cost_eq_of_perm {x y z a b c : E3} + (h : List.Perm [x, y, z] [a, b, c]) : + coulombCost (x, (y, z)) = coulombCost (a, (b, c)) := by + have ha : a ∈ [x, y, z] := h.mem_iff.mpr (by simp) + simp only [List.mem_cons, List.not_mem_nil, or_false] at ha + rcases ha with ha | ha | ha + · subst a + exact cost_eq_of_same_first h + · subst a + have hs : List.Perm [y, x, z] [x, y, z] := List.Perm.swap x y [z] + exact (cost_swap_first x y z).trans (cost_eq_of_same_first (hs.trans h)) + · subst a + have hs : List.Perm [z, x, y] [x, y, z] := by + simpa using (show List.Perm ([z] ++ [x, y]) ([x, y] ++ [z]) from List.perm_append_comm) + exact (cost_rotate x y z).trans (cost_eq_of_same_first (hs.trans h)) + +/-- A common signed potential sum is invariant under the same permutation. -/ +lemma real_sum_eq_of_perm {x y z a b c : E3} (u : E3 → ℝ) + (h : List.Perm [x, y, z] [a, b, c]) : + u x + u y + u z = u a + u b + u c := by + have hs := (h.map u).sum_eq + simpa only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, + add_zero, add_assoc] using hs + +/-- The same invariance is available after shifting to a nonnegative potential. -/ +lemma ennreal_sum_eq_of_perm {x y z a b c : E3} (u : E3 → ℝ≥0∞) + (h : List.Perm [x, y, z] [a, b, c]) : + u x + u y + u z = u a + u b + u c := by + have hs := (h.map u).sum_eq + simpa only [List.map_cons, List.map_nil, List.sum_cons, List.sum_nil, + add_zero, add_assoc] using hs + +/-- An ordered supporting certificate can be transported to any of its six orders. -/ +lemma certificate_iff_of_perm {x y z a b c : E3} (u : E3 → ℝ) + (h : List.Perm [x, y, z] [a, b, c]) : + (ENNReal.ofReal (u x + u y + u z) ≤ coulombCost (x, (y, z))) ↔ + ENNReal.ofReal (u a + u b + u c) ≤ coulombCost (a, (b, c)) := by + rw [real_sum_eq_of_perm u h, cost_eq_of_perm h] + +/-- The equality relation is transported at the same time as the inequality. -/ +lemma contact_iff_of_perm {x y z a b c : E3} (u : E3 → ℝ) + (h : List.Perm [x, y, z] [a, b, c]) : + (ENNReal.ofReal (u x + u y + u z) = coulombCost (x, (y, z))) ↔ + ENNReal.ofReal (u a + u b + u c) = coulombCost (a, (b, c)) := by + rw [real_sum_eq_of_perm u h, cost_eq_of_perm h] + +end Problem356.TriplePermutation + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Amplification.lean b/lean/OAI/Analysis/Crouzeix/Amplification.lean new file mode 100644 index 0000000000000000000000000000000000000000..948b8c9a6c4ce76ec9c5c6171efcf5f71a397edd --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Amplification.lean @@ -0,0 +1,223 @@ +import Mathlib +import OAI.Analysis.Crouzeix.FiniteCompression + +namespace OAI + +/-! Amplification. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u v + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +variable {G : Type v} [NormedAddCommGroup G] [InnerProductSpace ℂ G] + +def amplificationMap (e : H →ₗᵢ[ℂ] G) (m : ℕ) : + Amplification H m →L[ℂ] Amplification G m := + (TensorProduct.mapL e.toContinuousLinearMap + (ContinuousLinearMap.id ℂ (EuclideanSpace ℂ (Fin m)))).completion + +theorem norm_amplificationMap (e : H →ₗᵢ[ℂ] G) (m : ℕ) + (x : Amplification H m) : ‖amplificationMap e m x‖ = ‖x‖ := by + refine UniformSpace.Completion.induction_on x + (isClosed_eq (amplificationMap e m).continuous.norm continuous_norm) ?_ + intro a + simp only [amplificationMap, ContinuousLinearMap.completion_apply_coe, + UniformSpace.Completion.norm_coe, TensorProduct.mapL_apply] + exact (TensorProduct.mapIsometry e (LinearIsometry.id : + EuclideanSpace ℂ (Fin m) →ₗᵢ[ℂ] EuclideanSpace ℂ (Fin m))).norm_map a + +@[simp] +theorem amplificationMap_tmul (e : H →ₗᵢ[ℂ] G) {m : ℕ} + (x : H) (y : EuclideanSpace ℂ (Fin m)) : + amplificationMap e m (↑(x ⊗ₜ[ℂ] y)) = + (↑(e x ⊗ₜ[ℂ] y) : Amplification G m) := by + simp [amplificationMap] + +def conjugateOperator (e : H ≃ₗᵢ[ℂ] G) : Operator H ≃A[ℂ] Operator G := + e.toContinuousLinearEquiv.conjContinuousAlgEquiv + +@[simp] +theorem conjugateOperator_apply (e : H ≃ₗᵢ[ℂ] G) (A : Operator H) (x : G) : + conjugateOperator e A x = e (A (e.symm x)) := rfl + +@[simp] +theorem conjugateOperator_pow_apply (e : H ≃ₗᵢ[ℂ] G) (A : Operator H) (k : ℕ) (x : H) : + (conjugateOperator e A ^ k) (e x) = e ((A ^ k) x) := by + rw [← map_pow (conjugateOperator e) A k, conjugateOperator_apply, e.symm_apply_apply] + +theorem numericalRange_conjugateOperator (e : H ≃ₗᵢ[ℂ] G) (A : Operator H) : + numericalRange (conjugateOperator e A) = numericalRange A := by + ext z + constructor + · rintro ⟨x, hx, rfl⟩ + refine ⟨e.symm x, by simpa using hx, ?_⟩ + simpa using (e.inner_map_map (e.symm x) (A (e.symm x))).symm + · rintro ⟨x, hx, rfl⟩ + exact ⟨e x, by simpa using hx, by simp [e.inner_map_map]⟩ + +theorem polynomialEval_conjugateOperator_apply (e : H ≃ₗᵢ[ℂ] G) (A : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) (v : Amplification H m) : + polynomialEval (conjugateOperator e A) B (amplificationMap e.toLinearIsometry m v) = + amplificationMap e.toLinearIsometry m (polynomialEval A B v) := by + refine UniformSpace.Completion.induction_on v + (isClosed_eq ((polynomialEval (conjugateOperator e A) B).continuous.comp + (amplificationMap e.toLinearIsometry m).continuous) + ((amplificationMap e.toLinearIsometry m).continuous.comp + (polynomialEval A B).continuous)) ?_ + intro a + induction a using TensorProduct.inductionOn with + | tmul x y => + simp only [amplificationMap_tmul, polynomialEval_tmul, conjugateOperator_pow_apply, + map_sum, LinearIsometryEquiv.coe_toLinearIsometry] + | add a b ha hb => + simp only [UniformSpace.Completion.coe_add, map_add, ha, hb] + +theorem norm_polynomialEval_le_conjugateOperator (e : H ≃ₗᵢ[ℂ] G) (A : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval A B‖ ≤ ‖polynomialEval (conjugateOperator e A) B‖ := by + apply (polynomialEval A B).opNorm_le_bound (norm_nonneg _) + intro v + rw [← norm_amplificationMap e.toLinearIsometry m (polynomialEval A B v), + ← polynomialEval_conjugateOperator_apply] + simpa only [norm_amplificationMap] using + (polynomialEval (conjugateOperator e A) B).le_opNorm (amplificationMap e.toLinearIsometry m v) + +theorem norm_polynomialEval_conjugateOperator (e : H ≃ₗᵢ[ℂ] G) (A : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval (conjugateOperator e A) B‖ = ‖polynomialEval A B‖ := by + apply le_antisymm _ (norm_polynomialEval_le_conjugateOperator e A B) + have he : conjugateOperator e.symm (conjugateOperator e A) = A := by ext x; simp + simpa only [he] using + norm_polynomialEval_le_conjugateOperator e.symm (conjugateOperator e A) B + +open scoped Kronecker + +def matrixAmplificationCoordinates (n m : ℕ) : + Amplification (EuclideanSpace ℂ (Fin n)) m →L[ℂ] + EuclideanSpace ℂ (Fin n × Fin m) := + (((EuclideanSpace.basisFun (Fin n) ℂ).tensorProduct + (EuclideanSpace.basisFun (Fin m) ℂ)).repr.toContinuousLinearEquiv.toContinuousLinearMap).fromCompletion + +theorem norm_matrixAmplificationCoordinates (n m : ℕ) + (v : Amplification (EuclideanSpace ℂ (Fin n)) m) : + ‖matrixAmplificationCoordinates n m v‖ = ‖v‖ := by + refine UniformSpace.Completion.induction_on v + (isClosed_eq (matrixAmplificationCoordinates n m).continuous.norm continuous_norm) ?_ + intro a + simp only [matrixAmplificationCoordinates, ContinuousLinearMap.fromCompletion_apply_coe, + LinearIsometryEquiv.coe_toContinuousLinearEquiv, + ContinuousLinearEquiv.coe_coe, LinearIsometryEquiv.norm_map, + UniformSpace.Completion.norm_coe] + +@[simp] +theorem matrixAmplificationCoordinates_tmul {n m : ℕ} + (x : EuclideanSpace ℂ (Fin n)) (y : EuclideanSpace ℂ (Fin m)) (i : Fin n) (j : Fin m) : + matrixAmplificationCoordinates n m (↑(x ⊗ₜ[ℂ] y)) (i, j) = y j * x i := by + simp only [matrixAmplificationCoordinates, ContinuousLinearMap.fromCompletion_apply_coe, + LinearIsometryEquiv.coe_toContinuousLinearEquiv, ContinuousLinearEquiv.coe_coe, + OrthonormalBasis.tensorProduct_repr_tmul_apply, EuclideanSpace.basisFun_repr] + +theorem matrixAmplificationCoordinates_tensorOperator {n m : ℕ} + (M : Coeff n) (B : Coeff m) (v : Amplification (EuclideanSpace ℂ (Fin n)) m) : + matrixAmplificationCoordinates n m (tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B v) = + Matrix.toEuclideanCLM (𝕜 := ℂ) (M ⊗ₖ B) (matrixAmplificationCoordinates n m v) := by + refine UniformSpace.Completion.induction_on v + (isClosed_eq ((matrixAmplificationCoordinates n m).continuous.comp + (tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B).continuous) + ((Matrix.toEuclideanCLM (𝕜 := ℂ) (M ⊗ₖ B)).continuous.comp + (matrixAmplificationCoordinates n m).continuous)) ?_ + intro a + induction a using TensorProduct.inductionOn with + | tmul x y => + simp only [tensorOperator, ContinuousLinearMap.completion_apply_coe, TensorProduct.mapL_tmul] + apply PiLp.ext + rintro ⟨i, j⟩ + simp only [matrixAmplificationCoordinates_tmul, Matrix.ofLp_toEuclideanCLM, + Matrix.mulVec, dotProduct, Fintype.sum_prod_type, Matrix.kronecker_apply, + Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro s _ + apply Finset.sum_congr rfl + intro t _ + ring + | add a b ha hb => simp only [UniformSpace.Completion.coe_add, map_add, ha, hb] + +theorem matrixAmplificationCoordinates_polynomialEval {n m d : ℕ} + (M : Coeff n) (B : Fin (d + 1) → Coeff m) + (v : Amplification (EuclideanSpace ℂ (Fin n)) m) : + matrixAmplificationCoordinates n m (polynomialEval (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B v) = + Matrix.toEuclideanCLM (𝕜 := ℂ) (∑ k : Fin (d + 1), (M ^ (k : ℕ)) ⊗ₖ B k) + (matrixAmplificationCoordinates n m v) := by + simp only [polynomialEval, sum_apply, map_sum, ← map_pow, + matrixAmplificationCoordinates_tensorOperator] + +theorem norm_polynomialEval_eq_kronecker {n m d : ℕ} + (M : Coeff n) (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B‖ = + ‖∑ k : Fin (d + 1), (M ^ (k : ℕ)) ⊗ₖ B k‖ := by + let Q := ∑ k : Fin (d + 1), (M ^ (k : ℕ)) ⊗ₖ B k + change _ = ‖(Matrix.toEuclideanCLM (𝕜 := ℂ) Q)‖ + apply le_antisymm + · apply (polynomialEval (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B).opNorm_le_bound (norm_nonneg _) + intro v + rw [← norm_matrixAmplificationCoordinates n m (polynomialEval (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B v), + matrixAmplificationCoordinates_polynomialEval] + simpa only [norm_matrixAmplificationCoordinates] using + (Matrix.toEuclideanCLM (𝕜 := ℂ) Q).le_opNorm (matrixAmplificationCoordinates n m v) + · apply (Matrix.toEuclideanCLM (𝕜 := ℂ) Q).opNorm_le_bound (norm_nonneg _) + intro w + let a := ((EuclideanSpace.basisFun (Fin n) ℂ).tensorProduct + (EuclideanSpace.basisFun (Fin m) ℂ)).repr.symm w + have he : matrixAmplificationCoordinates n m (↑a) = w := by + simp only [matrixAmplificationCoordinates, ContinuousLinearMap.fromCompletion_apply_coe, + LinearIsometryEquiv.coe_toContinuousLinearEquiv, + ContinuousLinearEquiv.coe_coe, a, LinearIsometryEquiv.apply_symm_apply] + rw [← he, ← matrixAmplificationCoordinates_polynomialEval, + norm_matrixAmplificationCoordinates, norm_matrixAmplificationCoordinates] + exact (polynomialEval (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B).le_opNorm (↑a) + +def FiniteMatrixPolynomialBound : Prop := + ∀ (n : ℕ), 0 < n → ∀ (M : Coeff n) (m : ℕ), 0 < m → + ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + ‖polynomialEval (Matrix.toEuclideanCLM (𝕜 := ℂ) M) B‖ ≤ + 2 * supNorm (numericalRange (Matrix.toEuclideanCLM (𝕜 := ℂ) M)) (matrixPolynomial B) + +theorem finiteDimensional_polynomial_bound [FiniteDimensional ℂ H] + (hfin : FiniteMatrixPolynomialBound) (A : Operator H) + {m d : ℕ} (hm : 0 < m) (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B) := by + cases subsingleton_or_nontrivial H with + | inl h => + have := h + exact ((zeroConclusion A).2.1 m d B).2.2 + | inr h => + have := h + let e := (stdOrthonormalBasis ℂ H).repr + let M : Coeff (Module.finrank ℂ H) := + (Matrix.toEuclideanCLM (𝕜 := ℂ)).symm (conjugateOperator e A) + have he : Matrix.toEuclideanCLM (𝕜 := ℂ) M = conjugateOperator e A := + (Matrix.toEuclideanCLM (𝕜 := ℂ)).apply_symm_apply _ + have hb := hfin (Module.finrank ℂ H) Module.finrank_pos M m hm d B + simpa only [he, norm_polynomialEval_conjugateOperator, + numericalRange_conjugateOperator] using hb + +theorem polynomial_bound_of_finite_matrix_bound (hfin : FiniteMatrixPolynomialBound) + (A : Operator H) {m d : ℕ} (hm : 0 < m) (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B) := by + apply polynomial_inequality_of_finite_compressions + intro E _ + exact finiteDimensional_polynomial_bound hfin (compression A E) hm B + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/AngularMeasure.lean b/lean/OAI/Analysis/Crouzeix/AngularMeasure.lean new file mode 100644 index 0000000000000000000000000000000000000000..4ce47440d92859bfd057a2b910ce069ec34989f9 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/AngularMeasure.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Analysis.Crouzeix.AngularMoments + +namespace OAI + +/-! Angular Measure. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +open Boundary + +local instance : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +def interiorAngle : C(CircleSpace, CircleSpace) := + ⟨fun t => (AddCircle.homeomorphCircle (by norm_num : (1 : ℝ) ≠ 0)).symm + ⟨C.interiorBoundary R t, by exact mem_sphere_zero_iff_norm.mpr (C.norm_interiorBoundary R t)⟩, + (AddCircle.homeomorphCircle (by norm_num : (1 : ℝ) ≠ 0)).symm.continuous.comp + ((C.interiorBoundary R).continuous.subtype_mk _)⟩ + +lemma circleCoordinate_interiorAngle (t : CircleSpace) : + circleCoordinate (C.interiorAngle R t) = C.interiorBoundary R t := by + simp only [circleCoordinate, fourier_one] + rw [← AddCircle.homeomorphCircle_apply (by norm_num : (1 : ℝ) ≠ 0)] + exact congrArg Subtype.val ((AddCircle.homeomorphCircle (by norm_num : (1 : ℝ) ≠ 0)).apply_symm_apply _) + +lemma fourier_interiorAngle (j : ℤ) (t : CircleSpace) : + fourier j (C.interiorAngle R t) = (C.interiorBoundary R t)^j := by + rw [fourier_apply, AddCircle.toCircle_zsmul, Circle.coe_zpow] + have he := C.circleCoordinate_interiorAngle R t + simp only [circleCoordinate, fourier_one] at he + rw [he] + +def angularIntegralCLM : C(CircleSpace, ℂ) →L[ℂ] ℂ := by + have hi (f : C(CircleSpace, ℂ)) : Integrable + (fun t => C.angularJacobian R t * f (C.interiorAngle R t)) circleMeasure := + ((C.angularJacobian R).continuous.mul (f.continuous.comp (C.interiorAngle R).continuous)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + let L : C(CircleSpace, ℂ) →ₗ[ℂ] ℂ := { + toFun f := ∫ t, C.angularJacobian R t * f (C.interiorAngle R t) ∂circleMeasure + map_add' f g := by + simp only [ContinuousMap.add_apply, mul_add] + exact integral_add (hi f) (hi g) + map_smul' c f := by + simp only [ContinuousMap.smul_apply, smul_eq_mul, RingHom.id_apply] + simp_rw [mul_left_comm _ c, ← smul_eq_mul c] + exact integral_smul c _ } + refine L.mkContinuous ‖C.angularJacobian R‖ fun f => ?_ + have hb : ∀ᵐ t ∂circleMeasure, ‖C.angularJacobian R t * f (C.interiorAngle R t)‖ ≤ + ‖C.angularJacobian R‖ * ‖f‖ := Eventually.of_forall fun t => by + rw [norm_mul] + exact mul_le_mul ((C.angularJacobian R).norm_coe_le_norm t) + (f.norm_coe_le_norm _) (norm_nonneg _) (norm_nonneg _) + simpa only [L, LinearMap.coe_mk, AddHom.coe_mk, probReal_univ, one_mul, mul_one] using norm_integral_le_of_norm_le_const hb + +def circleIntegralCLM : C(CircleSpace, ℂ) →L[ℂ] ℂ := by + let L : C(CircleSpace, ℂ) →ₗ[ℂ] ℂ := { + toFun f := ∫ t, f t ∂circleMeasure + map_add' f g := integral_add + (f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + (g.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + map_smul' c f := integral_smul c _ } + refine L.mkContinuous 1 fun f => ?_ + simpa only [L, LinearMap.coe_mk, AddHom.coe_mk, probReal_univ, one_mul, mul_one] using norm_integral_le_of_norm_le_const + (Eventually.of_forall f.norm_coe_le_norm : ∀ᵐ t ∂circleMeasure, ‖f t‖ ≤ ‖f‖) + +lemma angularIntegralCLM_eq (hU : IsOpen U) (hc : Convex ℝ U) : + C.angularIntegralCLM R = circleIntegralCLM := by + apply ContinuousLinearMap.ext_on (s := range (fourier (T := (1 : ℝ)))) + · rw [dense_iff_closure_eq, ← Submodule.topologicalClosure_coe, + span_fourier_closure_eq_top, Submodule.top_coe] + · rintro f ⟨j,rfl⟩ + change (∫ t, C.angularJacobian R t * fourier j (C.interiorAngle R t) ∂circleMeasure) = + ∫ t, fourier j t ∂circleMeasure + simp_rw [C.fourier_interiorAngle] + rw [C.integral_angularJacobian_zpow R hU hc, Disk.integral_fourier] + +lemma integral_angularChange {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] (hU : IsOpen U) (hc : Convex ℝ U) (f : C(CircleSpace, E)) : + (∫ t, C.angularJacobian R t • f (C.interiorAngle R t) ∂circleMeasure) = + ∫ t, f t ∂circleMeasure := by + apply (SeparatingDual.eq_iff_forall_dual_eq (R := ℂ)).mpr + intro l + have h1 : Integrable (fun t => C.angularJacobian R t • f (C.interiorAngle R t)) circleMeasure := + ((C.angularJacobian R).continuous.smul (f.continuous.comp (C.interiorAngle R).continuous)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + have h2 : Integrable f circleMeasure := f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + rw [← l.integral_comp_comm h1, ← l.integral_comp_comm h2] + simp only [map_smul, smul_eq_mul] + exact congrArg (fun L : C(CircleSpace, ℂ) →L[ℂ] ℂ => L ⟨l ∘ f, l.continuous.comp f.continuous⟩) + (C.angularIntegralCLM_eq R hU hc) + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/AngularMoments.lean b/lean/OAI/Analysis/Crouzeix/AngularMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..687146833ca8f99a9d417192388266e05b9bb5f1 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/AngularMoments.lean @@ -0,0 +1,129 @@ +import Mathlib +import OAI.Analysis.Crouzeix.AngularTransport + +namespace OAI + +/-! Angular Moments. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +open Boundary + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +lemma interiorBoundary_ne_zero (t : CircleSpace) : C.interiorBoundary R t ≠ 0 := + norm_ne_zero_iff.mp (by rw [C.norm_interiorBoundary]; exact one_ne_zero) + +lemma integral_angularJacobian_pow_succ (hc : Convex ℝ U) (n : ℕ) : + (∫ t, C.angularJacobian R t * (C.interiorBoundary R t)^(n+1) ∂circleMeasure) = 0 := by + have hz := C.physical_integral_zero hc R.isOpen_domain R.closure_subset_domain + (R.analytic_f.deriv.differentiableOn.fun_mul (R.analytic_f.differentiableOn.pow n)) + convert hz using 1 + apply integral_congr_ae + filter_upwards [] with t + change (C.boundaryNormal t * deriv R.f (C.boundaryMap t) / C.interiorBoundary R t) * + C.interiorBoundary R t ^ (n+1) = C.boundaryNormal t * + (deriv R.f (C.boundaryMap t) * C.interiorBoundary R t ^ n) + rw [pow_succ] + field_simp [C.interiorBoundary_ne_zero R t] + +lemma integral_angularJacobian (hU : IsOpen U) (hc : Convex ℝ U) : + (∫ t, C.angularJacobian R t ∂circleMeasure) = 1 := by + let a := R.h 0 + have haU : a ∈ U := R.h_zero_mem + have ha : a ∈ R.domain := R.closure_subset_domain (subset_closure haU) + have hfa : R.f a = 0 := R.f_h_zero + let g := dslope R.f a + have hg : AnalyticOnNhd ℂ g R.domain := + ((differentiableOn_dslope (R.isOpen_domain.mem_nhds ha)).mpr + R.analytic_f.differentiableOn).analyticOnNhd R.isOpen_domain + have hgn : ∀ z ∈ R.domain, g z ≠ 0 := by + intro z hz + by_cases he : z = a + · subst z + simpa only [g, dslope_same] using deriv_ne_zero_of_injOn R.isOpen_domain R.analytic_f.differentiableOn R.injective_f ha + · dsimp only [g] + rw [dslope_of_ne _ he, slope_def_module, hfa, sub_zero, smul_eq_mul] + exact mul_ne_zero (inv_ne_zero (sub_ne_zero.mpr he)) + (fun hh => he (R.injective_f hz ha (hh.trans hfa.symm))) + have hfgg : ∀ z, (z-a) * g z = R.f z := fun z => by + simpa only [smul_eq_mul, hfa, sub_zero] using sub_smul_dslope R.f a z + have hd : ∀ z ∈ R.domain, deriv R.f z = g z + (z-a) * deriv g z := by + intro z hz + have heq : (fun w => (w-a) * g w) = R.f := funext hfgg + have ht := ((hasDerivAt_id z).sub_const a).mul (hg z hz).differentiableAt.hasDerivAt + have hd := ht.deriv + change deriv (fun w => (w-a) * g w) z = 1 * g z + (z-a) * deriv g z at hd + simpa only [heq, one_mul] using hd + let v : ℂ → ℂ := fun z => deriv g z / g z + have hv : DifferentiableOn ℂ v R.domain := hg.deriv.differentiableOn.div + hg.differentiableOn hgn + have hz := C.physical_integral_zero hc R.isOpen_domain R.closure_subset_domain hv + have hba (t : CircleSpace) : C.boundaryMap t ≠ a := fun he => + (C.boundaryMap_mem_frontier t).2 (hU.interior_eq.symm ▸ (he ▸ haU)) + have hbc (t : CircleSpace) : C.boundaryMap t ∈ R.domain := + R.closure_subset_domain (C.boundaryMap_mem_frontier t).1 + have heq (t : CircleSpace) : C.angularJacobian R t = + C.boundaryNormal t / (C.boundaryMap t-a) + C.boundaryNormal t * v (C.boundaryMap t) := by + change C.boundaryNormal t * deriv R.f (C.boundaryMap t) / R.f (C.boundaryMap t) = _ + rw [hd _ (hbc t), ← hfgg] + dsimp only [v] + field_simp [hgn _ (hbc t), sub_ne_zero.mpr (hba t)] + have hi1 : Integrable (fun t => C.boundaryNormal t / (C.boundaryMap t-a)) circleMeasure := + (C.boundaryNormal.continuous.div (C.boundaryMap.continuous.sub continuous_const) + (fun t => sub_ne_zero.mpr (hba t))).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + have hi2 : Integrable (fun t => C.boundaryNormal t * v (C.boundaryMap t)) circleMeasure := + (C.boundaryNormal.continuous.mul (hv.continuousOn.comp_continuous + C.boundaryMap.continuous hbc)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + simp_rw [heq] + rw [integral_add hi1 hi2, hz, add_zero] + have hh := C.boundaryContour_index_inside hU haU + change (2 * (Real.pi : ℂ) * I)⁻¹ • + (∫ t in (0 : ℝ)..1, deriv C.boundaryContour.path t * (C.boundaryContour.path t - a)⁻¹) = 1 at hh + rw [show (fun t : ℝ => deriv C.boundaryContour.path t * (C.boundaryContour.path t - a)⁻¹) = + fun t => deriv C.boundaryContour.path t • (C.boundaryContour.path t - a)⁻¹ from rfl, + C.boundaryContour_integral (fun w => (w-a)⁻¹)] at hh + exact hh + +lemma integral_angularJacobian_pow (hU : IsOpen U) (hc : Convex ℝ U) (n : ℕ) : + (∫ t, C.angularJacobian R t * (C.interiorBoundary R t)^n ∂circleMeasure) = + if n = 0 then 1 else 0 := by + cases n with + | zero => simp only [pow_zero, mul_one, ↓reduceIte]; exact C.integral_angularJacobian R hU hc + | succ n => simpa only [Nat.succ_ne_zero, ↓reduceIte] using C.integral_angularJacobian_pow_succ R hc n + +lemma conj_angularJacobian (t : CircleSpace) : conj (C.angularJacobian R t) = C.angularJacobian R t := by + apply Complex.ext <;> simp [(C.angularJacobian_real_nonneg R t).1] + +lemma integral_angularJacobian_zpow (hU : IsOpen U) (hc : Convex ℝ U) (j : ℤ) : + (∫ t, C.angularJacobian R t * (C.interiorBoundary R t)^j ∂circleMeasure) = + if j = 0 then 1 else 0 := by + cases j with + | ofNat n => + change (∫ t, C.angularJacobian R t * (C.interiorBoundary R t)^(n : ℤ) ∂circleMeasure) = + if (n : ℤ) = 0 then 1 else 0 + simpa only [zpow_natCast, Nat.cast_eq_zero] using C.integral_angularJacobian_pow R hU hc n + | negSucc n => + have he (t : CircleSpace) : C.angularJacobian R t * (C.interiorBoundary R t)^((Int.negSucc n)) = + conj (C.angularJacobian R t * (C.interiorBoundary R t)^(n+1)) := by + rw [zpow_negSucc, ← inv_pow, Complex.inv_eq_conj (C.norm_interiorBoundary R t), + map_mul, C.conj_angularJacobian, map_pow] + simp_rw [he] + rw [integral_conj, C.integral_angularJacobian_pow_succ R hc, map_zero] + simp + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/AngularRadius.lean b/lean/OAI/Analysis/Crouzeix/AngularRadius.lean new file mode 100644 index 0000000000000000000000000000000000000000..55f14109f55c1b5b6247ae805caf2aaec6f40083 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/AngularRadius.lean @@ -0,0 +1,82 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CircleAnalytic + +namespace OAI + +/-! Angular Radius. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex MeasureTheory + +namespace CrouzeixHilbert.Boundary + +lemma integral_scaled_circleCoordinate {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] (f : ℂ → E) (R : ℝ) : + (∫ t, f ((R : ℂ) * circleCoordinate t) ∂circleMeasure) = Real.circleAverage f 0 R := by + rw [integral_circleCoordinate_eq_circleAverage (fun z => f ((R : ℂ) * z))] + unfold Real.circleAverage + congr 1 + apply intervalIntegral.integral_congr + intro t ht + simp only [circleMap, zero_add, ofReal_one, one_mul] + +lemma integral_scaled_coordinate_cauchy {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] (f : ℂ → E) {R : ℝ} (hR : 0 < R) : + (∫ t, ((R : ℂ) * circleCoordinate t) • f ((R : ℂ) * circleCoordinate t) + ∂circleMeasure) = + (2 * (Real.pi : ℂ) * I)⁻¹ • (∮ z in C(0, R), f z) := by + rw [integral_scaled_circleCoordinate (fun z => z • f z) R, + Real.circleAverage_eq_circleIntegral hR.ne'] + congr 1 + apply circleIntegral.integral_congr hR.le + intro z hz + have hn : z ≠ 0 := norm_pos_iff.mp (by rw [mem_sphere_zero_iff_norm.mp hz]; exact hR) + simp only [sub_zero, smul_smul, inv_mul_cancel₀ hn, one_smul] + +lemma integral_scaled_deform {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] {r R : ℝ} (hr : 0 < r) (hrR : r ≤ R) {f : ℂ → E} + (hc : ContinuousOn f (closedBall 0 R \ ball 0 r)) + (hd : DifferentiableOn ℂ f (ball 0 R \ closedBall 0 r)) : + (∫ t, ((R : ℂ) * circleCoordinate t) • f ((R : ℂ) * circleCoordinate t) + ∂circleMeasure) = + ∫ t, ((r : ℂ) * circleCoordinate t) • f ((r : ℂ) * circleCoordinate t) + ∂circleMeasure := by + rw [integral_scaled_coordinate_cauchy f (hr.trans_le hrR), + integral_scaled_coordinate_cauchy f hr] + congr 1 + apply Complex.circleIntegral_eq_of_differentiable_on_annulus_off_countable hr hrR countable_empty hc + intro z hz + exact (hd z hz.1).differentiableAt ((isOpen_ball.sdiff isClosed_closedBall).mem_nhds hz.1) + +lemma integral_laurent_deform {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + {r R : ℝ} (hr : 0 < r) (hrR : r ≤ R) {f : ℂ → E} + (hc : ContinuousOn f (closedBall 0 R \ ball 0 r)) + (hd : DifferentiableOn ℂ f (ball 0 R \ closedBall 0 r)) (j : ℤ) : + (∫ t, (((R : ℂ) * circleCoordinate t)^j) • f ((R : ℂ) * circleCoordinate t) + ∂circleMeasure) = + ∫ t, (((r : ℂ) * circleCoordinate t)^j) • f ((r : ℂ) * circleCoordinate t) + ∂circleMeasure := by + have hn {z : ℂ} (hz : z ∈ closedBall 0 R \ ball 0 r) : z ≠ 0 := by + have hle : r ≤ ‖z‖ := not_lt.mp (mt mem_ball_zero_iff.mpr hz.2) + exact norm_pos_iff.mp (hr.trans_le hle) + have hh := integral_scaled_deform hr hrR + (f := fun z => z^(j-1) • f z) + ((continuousOn_id.zpow₀ (j-1) (fun z hz => Or.inl (hn hz))).smul hc) + ((((differentiableOn_id (𝕜 := ℂ)).zpow (Or.inl (fun z hz => hn ⟨ball_subset_closedBall hz.1, + fun h => hz.2 (ball_subset_closedBall h)⟩)))).smul hd) + have hs {z : ℂ} (hz : z ≠ 0) : z * z^(j-1) = z^j := by + rw [← zpow_one_add₀ hz] + congr 1 + omega + have hRz (t : CircleSpace) : (R : ℂ) * circleCoordinate t ≠ 0 := + mul_ne_zero (ofReal_ne_zero.mpr (hr.trans_le hrR).ne') (circleCoordinate_ne_zero t) + have hrz (t : CircleSpace) : (r : ℂ) * circleCoordinate t ≠ 0 := + mul_ne_zero (ofReal_ne_zero.mpr hr.ne') (circleCoordinate_ne_zero t) + simpa only [smul_smul, hs (hRz _), hs (hrz _)] using hh + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/AngularTransport.lean b/lean/OAI/Analysis/Crouzeix/AngularTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6435f8dcd834be161ae1077e7af86bd604cce01 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/AngularTransport.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Analysis.Crouzeix.InteriorCollar +import OAI.Analysis.Crouzeix.PhysicalModule + +namespace OAI + +/-! Angular Transport. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped InnerProductSpace + +namespace CrouzeixHilbert.Conformal + +open Boundary + +lemma angular_derivative_real_nonneg {g : ℂ → ℂ} {z : ℂ} (hz : ‖z‖ = 1) + (hga : DifferentiableAt ℂ g z) (hnt : ∀ w, ‖w‖ = 1 → ‖g w‖ = 1) + (hmax : IsLocalMaxOn (fun w => ‖g w‖^2) (closedBall 0 1) z) : + (z * deriv g z / g z).im = 0 ∧ 0 ≤ (z * deriv g z / g z).re := by + have hgz : ‖g z‖ = 1 := hnt z hz + have hinv : (g z)⁻¹ = conj (g z) := Complex.inv_eq_conj hgz + have hc : HasDerivAt (fun t : ℝ => g (z * circleMap 0 1 t)) ((z * I) * deriv g z) 0 := by + have hp : HasDerivAt (fun t : ℝ => z * circleMap 0 1 t) (z * I) 0 := by + simpa [circleMap_zero] using (hasDerivAt_circleMap 0 1 0).const_mul z + have hg' : HasDerivAt g (deriv g z) (z * circleMap 0 1 (0 : ℝ)) := by + simpa [circleMap_zero] using hga.hasDerivAt + simpa [Function.comp_def, mul_comm] using (hg'.hasFDerivAt.restrictScalars ℝ).comp_hasDerivAt 0 hp + have hc0 : ∀ t : ℝ, ‖g (z * circleMap 0 1 t)‖ ^ 2 = 1 := by + intro t + rw [hnt _ (by rw [norm_mul, hz]; simp), one_pow] + have hd0 := (hc.norm_sq.congr_of_eventuallyEq (Eventually.of_forall (fun t => (hc0 t).symm))).unique + (hasDerivAt_const (0 : ℝ) (1 : ℝ)) + rw [real_inner_eq_re_inner (𝕜 := ℂ), RCLike.inner_apply] at hd0 + simp only [circleMap_zero, ofReal_one, ofReal_zero, zero_mul, exp_zero, mul_one] at hd0 + have he0 : (z * deriv g z * conj (g z)).im = 0 := by + have halg : (((z * I) * deriv g z) * conj (g z)).re = + -(z * deriv g z * conj (g z)).im := by + simp only [Complex.mul_re, Complex.mul_im, I_re, I_im, mul_zero, mul_one] + ring + change 2 * (((z * I) * deriv g z) * conj (g z)).re = 0 at hd0 + rw [halg] at hd0 + linarith + have hdir := hmax.hasFDerivWithinAt_nonpos + (hga.hasDerivAt.hasFDerivAt.restrictScalars ℝ).norm_sq.hasFDerivWithinAt + (sub_mem_posTangentConeAt_of_segment_subset + ((convex_closedBall (0 : ℂ) (1 : ℝ)).segment_subset + (mem_closedBall_zero_iff.mpr hz.le) (mem_closedBall_self zero_le_one))) + simp only [ContinuousLinearMap.comp_apply, smul_apply] at hdir + simp only [innerSL_apply_apply] at hdir + rw [real_inner_eq_re_inner (𝕜 := ℂ), RCLike.inner_apply] at hdir + simp only [two_smul, zero_sub] at hdir + change (((-z) * deriv g z) * conj (g z)).re + + (((-z) * deriv g z) * conj (g z)).re ≤ 0 at hdir + simp only [neg_mul, neg_re] at hdir + rw [div_eq_mul_inv, hinv] + exact ⟨he0, by linarith⟩ + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +def interiorBoundary : C(CircleSpace, ℂ) := + C.analyticTrace R.closure_subset_domain R.f R.analytic_f.continuousOn + +lemma norm_interiorBoundary (t : CircleSpace) : ‖C.interiorBoundary R t‖ = 1 := + R.boundary_norm _ (C.boundaryMap_mem_frontier t) + +def angularJacobian : C(CircleSpace, ℂ) := + ⟨fun t => C.boundaryNormal t * deriv R.f (C.boundaryMap t) / C.interiorBoundary R t, + (C.boundaryNormal.continuous.mul (R.analytic_f.deriv.continuousOn.comp_continuous + C.boundaryMap.continuous (fun t => R.closure_subset_domain (C.boundaryMap_mem_frontier t).1))).div + (C.interiorBoundary R).continuous + (fun t => norm_ne_zero_iff.mp (by rw [C.norm_interiorBoundary]; exact one_ne_zero))⟩ + +lemma angularJacobian_real_nonneg (t : CircleSpace) : + (C.angularJacobian R t).im = 0 ∧ 0 ≤ (C.angularJacobian R t).re := by + let g := R.f ∘ C.G + have ht : C.radius < ‖circleCoordinate t‖ := by rw [norm_circleCoordinate]; exact C.radius_lt_one + have hfg : DifferentiableAt ℂ R.f (C.G (circleCoordinate t)) := + (R.analytic_f _ (R.closure_subset_domain (C.boundaryMap_mem_frontier t).1)).differentiableAt + have hg : DifferentiableAt ℂ g (circleCoordinate t) := + hfg.comp (circleCoordinate t) (C.analytic _ ht).differentiableAt + have hn : ∀ w, ‖w‖ = 1 → ‖g w‖ = 1 := fun w hw => R.boundary_norm _ + (C.boundary.mapsTo (mem_sphere_zero_iff_norm.mpr hw)) + have hmax : IsLocalMaxOn (fun w => ‖g w‖^2) (closedBall 0 1) (circleCoordinate t) := by + filter_upwards [nhdsWithin_le_nhds (C.parameter_open.mem_nhds ht), self_mem_nhdsWithin] with w hw hw1 + rw [hn _ (norm_circleCoordinate t), one_pow] + have hwle : ‖g w‖ ≤ 1 := by + rcases (mem_closedBall_zero_iff.mp hw1).eq_or_lt with h|h + · exact (hn w h).le + · exact (mem_ball_zero_iff.mp (R.bijective_f.mapsTo (C.inside ⟨hw,h⟩))).le + nlinarith [norm_nonneg (g w)] + have hp := angular_derivative_real_nonneg (norm_circleCoordinate t) hg hn hmax + have hd : deriv g (circleCoordinate t) = deriv R.f (C.G (circleCoordinate t)) * + deriv C.G (circleCoordinate t) := + deriv_comp _ (R.analytic_f _ (R.closure_subset_domain (C.boundaryMap_mem_frontier t).1)).differentiableAt + (C.analytic _ ht).differentiableAt + rw [hd] at hp + have he : C.angularJacobian R t = circleCoordinate t * + (deriv R.f (C.G (circleCoordinate t)) * deriv C.G (circleCoordinate t)) / g (circleCoordinate t) := by + change circleCoordinate t * deriv C.G (circleCoordinate t) * + deriv R.f (C.G (circleCoordinate t)) / R.f (C.G (circleCoordinate t)) = _ + dsimp only [g, Function.comp_def] + ring + rw [he] + exact hp + +lemma physical_integral_zero (hc : Convex ℝ U) {V : Set ℂ} + (hV : IsOpen V) (hUV : closure U ⊆ V) {g : ℂ → ℂ} + (hg : DifferentiableOn ℂ g V) : + (∫ t, C.boundaryNormal t * g (C.boundaryMap t) ∂circleMeasure) = 0 := by + have hs := sum_integral_eq_zero_of_null_homology (fun _ : Fin 1 => C.boundaryContour) + (fun _ => (1 : ℂ)) hV (fun _ => C.boundaryContour_trace_subset.trans + (frontier_subset_closure.trans hUV)) + (U := V) (fun (w : ℂ) (hw : w ∉ V) => by + simpa using C.boundaryContour_index_outside hc (z := w) + (fun hwc => hw (hUV hwc))) hg + simp only [Fin.sum_univ_one, one_smul] at hs + change (∫ t, C.boundaryNormal t • g (C.boundaryMap t) ∂circleMeasure) = 0 + rw [← C.boundaryContour_integral g] + exact hs + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BlockPolynomial.lean b/lean/OAI/Analysis/Crouzeix/BlockPolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..118d47310925214da222522d0e28c684a121ec81 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BlockPolynomial.lean @@ -0,0 +1,165 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Vectorization + +namespace OAI + +/-! Block Polynomial. -/ + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker TensorProduct + +namespace CrouzeixHilbert + +def blockPolynomialEval {n m : ℕ} (D : Coeff n) : + Matrix (Fin m) (Fin m) (Polynomial ℂ) →+* + Matrix (Fin n × Fin m) (Fin n × Fin m) ℂ where + toFun M i j := (Polynomial.aeval D (M i.2 j.2)) i.1 j.1 + map_zero' := by ext ⟨i,j⟩ ⟨k,l⟩; simp + map_one' := by + ext ⟨i,j⟩ ⟨k,l⟩ + change (Polynomial.aeval D (if j = l then 1 else 0)) i k = + if (i,j) = (k,l) then 1 else 0 + by_cases h : j = l + · subst l + simp only [ite_true, map_one, Matrix.one_apply, Prod.mk.injEq, and_true] + · simp only [h, ite_false, map_zero, Matrix.zero_apply, Prod.mk.injEq, and_false] + map_add' M N := by + ext ⟨i,j⟩ ⟨k,l⟩ + change (Polynomial.aeval D (M j l + N j l)) i k = _ + _ + rw [map_add] + rfl + map_mul' M N := by + ext ⟨i,j⟩ ⟨k,l⟩ + change (Polynomial.aeval D (∑ h, M j h * N h l)) i k = + ∑ h : Fin n × Fin m, (Polynomial.aeval D (M j h.2)) i h.1 * + (Polynomial.aeval D (N h.2 l)) h.1 k + simp only [map_sum, map_mul, Matrix.sum_apply, Matrix.mul_apply, + Fintype.sum_prod_type] + rw [Finset.sum_comm] + +@[simp] theorem blockPolynomialEval_apply {n m : ℕ} (D : Coeff n) + (M : Matrix (Fin m) (Fin m) (Polynomial ℂ)) (i k : Fin n) (j l : Fin m) : + blockPolynomialEval D M (i,j) (k,l) = Polynomial.aeval D (M j l) i k := rfl + +theorem blockPolynomialEval_smul_constant {n m : ℕ} (D : Coeff n) + (p : Polynomial ℂ) (B : Coeff m) : + blockPolynomialEval D (p • B.map Polynomial.C) = Polynomial.aeval D p ⊗ₖ B := by + ext ⟨i,j⟩ ⟨k,l⟩ + simp only [blockPolynomialEval_apply, Matrix.smul_apply, Matrix.map_apply, + smul_eq_mul, map_mul, Polynomial.aeval_C, Matrix.kronecker_apply, + Algebra.algebraMap_eq_smul_one, mul_smul_comm, mul_one, Matrix.smul_apply] + exact mul_comm _ _ + +@[simp] theorem blockPolynomialEval_constant {n m : ℕ} (D : Coeff n) (B : Coeff m) : + blockPolynomialEval D (B.map Polynomial.C) = 1 ⊗ₖ B := by + simpa only [one_smul, map_one] using blockPolynomialEval_smul_constant D 1 B + +theorem blockPolynomialEval_scalar {n m : ℕ} (D : Coeff n) (p : Polynomial ℂ) : + blockPolynomialEval (m := m) D (p • 1) = Polynomial.aeval D p ⊗ₖ 1 := by + have he : (1 : Coeff m).map Polynomial.C = 1 := + (Polynomial.C.mapMatrix).map_one + rw [← he, blockPolynomialEval_smul_constant] + +theorem blockPolynomialEval_commute {n m : ℕ} (D : Coeff n) (p : Polynomial ℂ) + (M : Matrix (Fin m) (Fin m) (Polynomial ℂ)) : + Commute (Polynomial.aeval D p ⊗ₖ (1 : Coeff m)) (blockPolynomialEval D M) := by + rw [← blockPolynomialEval_scalar] + apply Commute.map _ (blockPolynomialEval D) + show (p • (1 : Matrix (Fin m) (Fin m) (Polynomial ℂ))) * M = M * (p • 1) + rw [smul_mul_assoc, one_mul, mul_smul_comm, mul_one] + +theorem blockPolynomialEval_expansion {n m : ℕ} (D : Coeff n) + (P : Matrix (Fin m) (Fin m) (Polynomial ℂ)) : + blockPolynomialEval D P = + ∑ i, ∑ j, Polynomial.aeval D (P i j) ⊗ₖ Matrix.single i j 1 := by + ext ⟨i,j⟩ ⟨k,l⟩ + simp [Matrix.sum_apply, Matrix.single_apply, ite_and] + +namespace Realization + +theorem aeval_reduced_denom_isUnit {A : Type*} [Ring A] [Algebra ℂ A] + (D : A) (p q : Polynomial ℂ) (hq : IsUnit (Polynomial.aeval D q)) : + IsUnit (Polynomial.aeval D + ((algebraMap _ (RatFunc ℂ)) p / (algebraMap _ (RatFunc ℂ)) q).denom) := by + let r := (algebraMap _ (RatFunc ℂ)) p / (algebraMap _ (RatFunc ℂ)) q + obtain ⟨b, hb⟩ := RatFunc.denom_div_dvd p q + have hc := (Commute.all r.denom b).map (Polynomial.aeval D) + apply (hc.isUnit_mul_iff.mp ?_).1 + rw [← map_mul] + exact hb ▸ hq + +theorem aeval_quotient_cancel {A : Type*} [Ring A] [Algebra ℂ A] + (D : A) (p q : Polynomial ℂ) (hq0 : q ≠ 0) (hq : IsUnit (Polynomial.aeval D q)) : + Polynomial.aeval D q * + (Polynomial.aeval D ((algebraMap _ (RatFunc ℂ)) p / (algebraMap _ (RatFunc ℂ)) q).num * + Ring.inverse (Polynomial.aeval D ((algebraMap _ (RatFunc ℂ)) p / + (algebraMap _ (RatFunc ℂ)) q).denom)) = Polynomial.aeval D p := by + let r := (algebraMap _ (RatFunc ℂ)) p / (algebraMap _ (RatFunc ℂ)) q + have hd := aeval_reduced_denom_isUnit D p q hq + have he := congrArg (Polynomial.aeval D) + ((RatFunc.num_mul_eq_mul_denom_iff hq0).mpr (show r = _ from rfl)) + simp only [map_mul] at he + change Polynomial.aeval D q * (Polynomial.aeval D r.num * Ring.inverse _) = _ + rw [← mul_assoc, ((Commute.all q r.num).map (Polynomial.aeval D)).eq, + he, mul_assoc, Ring.mul_inverse_cancel _ hd, mul_one] + +theorem map_ringInverse_equiv {A B : Type*} [Ring A] [Ring B] + (e : A ≃+* B) (x : A) : e (Ring.inverse x) = Ring.inverse (e x) := by + by_cases hx : IsUnit x + · exact map_ringInverse_of_isUnit e.toRingHom hx + · have hy : ¬ IsUnit (e x) := by + intro h + apply hx + simpa only [RingEquiv.symm_apply_apply] using h.map e.symm + rw [Ring.inverse_non_unit _ hx, Ring.inverse_non_unit _ hy, map_zero] + +end Realization + +def rationalBaseMatrix {n : ℕ} (D : Coeff n) (r : RatFunc ℂ) : Coeff n := + Polynomial.aeval D r.num * Ring.inverse (Polynomial.aeval D r.denom) + +@[simp] theorem rationalEval_matrix {n : ℕ} (D : Coeff n) (r : RatFunc ℂ) : + rationalEval (Matrix.toEuclideanCLM (𝕜 := ℂ) D) r = + Matrix.toEuclideanCLM (𝕜 := ℂ) (rationalBaseMatrix D r) := by + simp only [rationalEval, rationalBaseMatrix, map_mul, + Polynomial.aeval_algHom_apply] + congr 1 + exact (Realization.map_ringInverse_equiv + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).toRingEquiv _).symm + +def blockRationalEval {n m : ℕ} (D : Coeff n) (R : RationalMatrix m) : + Matrix (Fin n × Fin m) (Fin n × Fin m) ℂ := + ∑ i, ∑ j, rationalBaseMatrix D (R i j) ⊗ₖ Matrix.single i j 1 + +theorem matrixAmplificationCoordinates_rationalEval {n m : ℕ} + (D : Coeff n) (R : RationalMatrix m) + (v : Amplification (EuclideanSpace ℂ (Fin n)) m) : + matrixAmplificationCoordinates n m + (matrixRationalEval (Matrix.toEuclideanCLM (𝕜 := ℂ) D) R v) = + Matrix.toEuclideanCLM (𝕜 := ℂ) (blockRationalEval D R) + (matrixAmplificationCoordinates n m v) := by + simp only [matrixRationalEval, blockRationalEval, sum_apply, map_sum, + rationalEval_matrix, matrixAmplificationCoordinates_tensorOperator] + +theorem blockRationalEval_denom_cancel {n m : ℕ} (D : Coeff n) + (P : Matrix (Fin m) (Fin m) (Polynomial ℂ)) (q : Polynomial ℂ) + (hq0 : q ≠ 0) (hq : IsUnit (Polynomial.aeval D q)) : + (Polynomial.aeval D q ⊗ₖ (1 : Coeff m)) * + blockRationalEval D (fun i j => (algebraMap _ (RatFunc ℂ)) (P i j) / + (algebraMap _ (RatFunc ℂ)) q) = blockPolynomialEval D P := by + unfold blockRationalEval + rw [Finset.mul_sum, blockPolynomialEval_expansion] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + rw [← Matrix.mul_kronecker_mul, one_mul] + rw [rationalBaseMatrix, Realization.aeval_quotient_cancel D (P i j) q hq0 hq] + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryChart.lean b/lean/OAI/Analysis/Crouzeix/BoundaryChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c1b0f24004e05094b40b9267387d089492ca5dd --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryChart.lean @@ -0,0 +1,110 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryModulus +import OAI.Analysis.Crouzeix.HolomorphicReflection + +namespace OAI + +/-! Boundary Chart. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex InnerProductSpace Real + +open scoped Classical ComplexConjugate + +namespace CrouzeixHilbert.Conformal + +structure BoundaryChart (U : Set ℂ) (p : ℂ) where + e : OpenPartialHomeomorph ℂ ℂ + zero_mem : (0 : ℂ) ∈ e.source + at_zero : e 0 = p + analytic : AnalyticOnNhd ℂ e e.source + inverse_analytic : AnalyticOnNhd ℂ e.symm e.target + side : ∀ z ∈ e.source, e z ∈ U ↔ 0 < z.im + closed_side : ∀ z ∈ e.source, e z ∈ closure U ↔ 0 ≤ z.im + +theorem exists_extension_at_boundary {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U (ball 0 1)) + {p : ℂ} (hp : p ∈ frontier U) (c : BoundaryChart U p) : + ∃ (r : ℝ) (g : ℂ → ℂ), 0 < r ∧ AnalyticOnNhd ℂ g (ball p r) ∧ + EqOn g f (U ∩ ball p r) ∧ deriv g p ≠ 0 := by + obtain ⟨a, ha, hfa⟩ := hbij.surjOn (mem_ball_self (by norm_num) : (0 : ℂ) ∈ ball 0 1) + have hpa : p ≠ a := by + rintro rfl + exact hp.2 (hU.interior_eq.symm ▸ ha) + have hχa : ∀ᶠ z in 𝓝 (0 : ℂ), c.e z ≠ a := + (c.analytic 0 c.zero_mem).continuousAt.preimage_mem_nhds + (isClosed_singleton.isOpen_compl.mem_nhds (by simpa only [mem_compl_iff, mem_singleton_iff, c.at_zero] using hpa)) + obtain ⟨R, hR, hball⟩ := Metric.mem_nhds_iff.mp + (Filter.inter_mem (c.e.open_source.mem_nhds c.zero_mem) hχa) + let r := R / 2 + have hr : 0 < r := half_pos hR + have hsub : closedBall (0 : ℂ) r ⊆ c.e.source := fun z hz => + (hball ((closedBall_subset_ball (by dsimp [r]; linarith)) hz)).1 + have hne : ∀ z ∈ closedBall (0 : ℂ) r, c.e z ≠ a := fun z hz => + (hball ((closedBall_subset_ball (by dsimp [r]; linarith)) hz)).2 + have hfu : ∀ z ∈ closedBall (0 : ℂ) r, 0 < z.im → f (c.e z) ≠ 0 := by + intro z hz hi he + exact hne z hz (hbij.injOn ((c.side z (hsub hz)).mpr hi) ha (he.trans hfa.symm)) + let M : ℂ → ℝ := fun z => if z ∈ U then ‖f z‖ else 1 + let u : ℂ → ℝ := fun z => Real.log (M (c.e z)) + have huEq : EqOn u (fun z => Real.log ‖f (c.e z)‖) (upperHalfBall r) := by + intro z hz + simp only [u, M, ite_eq_left ((c.side z (hsub (ball_subset_closedBall hz.1))).mpr hz.2)] + have hχU : MapsTo c.e (upperHalfBall r) U := fun z hz => + (c.side z (hsub (ball_subset_closedBall hz.1))).mpr hz.2 + have hfχ : DifferentiableOn ℂ (f ∘ c.e) (upperHalfBall r) := + hf.comp (c.analytic.differentiableOn.mono (inter_subset_left.trans (ball_subset_closedBall.trans hsub))) hχU + have hu : HarmonicOnNhd u (upperHalfBall r) := by + intro z hz + have hg := (hfχ.analyticOnNhd (isOpen_upperHalfBall r) z hz).harmonicAt_log_norm + (hfu z (ball_subset_closedBall hz.1) hz.2) + exact (harmonicAt_congr_nhds (huEq.eventuallyEq_of_mem ((isOpen_upperHalfBall r).mem_nhds hz))).mpr hg + have hχclosed : MapsTo c.e (closedUpperHalfBall r) (closure U) := fun z hz => + (c.closed_side z (hsub hz.1)).mpr hz.2 + have hMn : ∀ z ∈ closedUpperHalfBall r, M (c.e z) ≠ 0 := by + intro z hz + by_cases hi : c.e z ∈ U + · simp only [M, ite_eq_left hi] + exact norm_ne_zero_iff.mpr (hfu z hz.1 ((c.side z (hsub hz.1)).mp hi)) + · simp only [M, ite_eq_right hi, ne_eq, one_ne_zero, not_false_eq_true] + have huc : ContinuousOn u (closedUpperHalfBall r) := + ((continuousOn_closed_modulus hU hf hbij).comp + (c.analytic.continuousOn.mono (inter_subset_left.trans hsub)) hχclosed).log hMn + have hu0 : ∀ z ∈ closedBall (0 : ℂ) r, z.im = 0 → u z = 0 := by + intro z hz hi + have hn : c.e z ∉ U := fun he => (lt_irrefl (0 : ℝ)) (hi ▸ (c.side z (hsub hz)).mp he) + simp only [u, M, ite_eq_right hn, Real.log_one] + have hneg : ∀ z ∈ sphere (0 : ℂ) r, 0 < z.im → u z < 0 := by + intro z hz hi + have hzU := (c.side z (hsub (sphere_subset_closedBall hz))).mpr hi + simp only [u, M, ite_eq_left hzU] + exact Real.log_neg (norm_pos_iff.mpr (hfu z (sphere_subset_closedBall hz) hi)) + (mem_ball_zero_iff.mp (hbij.mapsTo hzU)) + obtain ⟨g, hga, hge, hgd, _⟩ := holomorphic_reflection hr hu huc hu0 hneg hfχ + (fun z hz => hfu z (ball_subset_closedBall hz.1) hz.2) huEq.symm + have hpT : p ∈ c.e.target := by simpa only [c.at_zero] using c.e.map_source c.zero_mem + have hpInv : c.e.symm p = 0 := by simpa only [c.at_zero] using c.e.left_inv c.zero_mem + have hcont := (c.inverse_analytic p hpT).continuousAt + have hnb : ∀ᶠ z in 𝓝 p, c.e.symm z ∈ ball 0 r := + hcont.preimage_mem_nhds (hpInv.symm ▸ ball_mem_nhds (0 : ℂ) hr) + obtain ⟨s, hs, hsSub⟩ := Metric.mem_nhds_iff.mp + (Filter.inter_mem (c.e.open_target.mem_nhds hpT) hnb) + refine ⟨s, g ∘ c.e.symm, hs, ?_, ?_, ?_⟩ + · intro z hz + exact (hga _ (hsSub hz).2).comp (c.inverse_analytic z (hsSub hz).1) + · intro z hz + have hzt := (hsSub hz.2).1 + have hzs := c.e.map_target hzt + have hi : 0 < (c.e.symm z).im := (c.side _ hzs).mp (by simpa only [c.e.right_inv hzt] using hz.1) + simpa only [Function.comp_apply, c.e.right_inv hzt] using hge ⟨(hsSub hz.2).2, hi⟩ + · rw [deriv_comp p (hga _ (hpInv.symm ▸ mem_ball_self hr)).differentiableAt + (c.inverse_analytic p hpT).differentiableAt, hpInv] + exact mul_ne_zero hgd (deriv_ne_zero_of_injOn c.e.open_target + c.inverse_analytic.differentiableOn c.e.symm.injOn hpT) + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryFibers.lean b/lean/OAI/Analysis/Crouzeix/BoundaryFibers.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4785e8aad3e73df62f764422cf6747a6d3e604f --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryFibers.lean @@ -0,0 +1,226 @@ +import Mathlib +import OAI.Analysis.Crouzeix.DensityCompatibility + +namespace OAI + +/-! Boundary Fibers. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace TensorProduct Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +namespace Compression + +section Fibres + +variable {α E : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] + [CompactSpace α] [SecondCountableTopology α] {μ : Measure α} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +theorem fibres_of_integral_interpolation (R M : C(α, E →L[ℂ] E)) + (hmass : ∫ t, star (R t) * R t ∂μ = 1) + (hM : ∀ t, ‖M t‖ ≤ 1) (x y : E) (hN : ‖x‖ = ‖y‖) + (hI : (∫ t, star (R t) * M t * R t ∂μ) x = y) : + ∀ᵐ t ∂μ, M t (R t x) = R t y ∧ (M t).adjoint (R t y) = R t x := by + let V := isometry R hmass + let T := fieldAction (μ := μ) M M.continuous.aestronglyMeasurable 1 zero_le_one + (Filter.Eventually.of_forall hM) + have hT : ‖T‖ ≤ 1 := norm_fieldAction_le _ _ _ _ _ + have hIV : V.toContinuousLinearMap.adjoint (T (V x)) = y := by + rw [integral_eq_compression R M hmass 1 zero_le_one hM] at hI + exact hI + obtain ⟨hf, ha⟩ := equality_in_compression V T hT x y hN hIV + let Ms : C(α, E →L[ℂ] E) := ⟨fun t => (M t).adjoint, + ContinuousLinearMap.adjoint.continuous.comp M.continuous⟩ + have hMsn : ∀ t, ‖Ms t‖ ≤ 1 := fun t => by + simpa only [Ms, ContinuousMap.coe_mk, ContinuousLinearMap.adjoint.norm_map] using hM t + have htstar : T.adjoint = fieldAction Ms Ms.continuous.aestronglyMeasurable + 1 zero_le_one (Filter.Eventually.of_forall hMsn) := + adjoint_fieldAction M Ms M.continuous.aestronglyMeasurable + Ms.continuous.aestronglyMeasurable 1 zero_le_one (Filter.Eventually.of_forall hM) + (Filter.Eventually.of_forall hMsn) (Filter.Eventually.of_forall fun _ => rfl) + rw [htstar] at ha + filter_upwards [fieldAction_apply_ae M M.continuous.aestronglyMeasurable + 1 zero_le_one (Filter.Eventually.of_forall hM) (V x), + fieldAction_apply_ae Ms Ms.continuous.aestronglyMeasurable + 1 zero_le_one (Filter.Eventually.of_forall hMsn) (V y), + lift_apply_ae R x, lift_apply_ae R y] with t hft hat hxt hyt + constructor + · rw [← hxt, ← hyt] + change M t (V x t) = V y t + rw [← hft] + exact congrArg (fun u => u t) hf + · rw [← hyt, ← hxt] + change Ms t (V y t) = V x t + rw [← hat] + exact congrArg (fun u => u t) ha + +end Fibres + +end Compression + +attribute [local instance] tensorDensityOperatorCompleteSpace + +def matrixOperatorMap (n : ℕ) : Coeff n →L[ℂ] Operator (EuclideanSpace ℂ (Fin n)) := + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).toAlgEquiv.toLinearMap.toContinuousLinearMap + +@[simp] theorem matrixOperatorMap_apply {n : ℕ} (A : Coeff n) : + matrixOperatorMap n A = Matrix.toEuclideanCLM (𝕜 := ℂ) A := rfl + +def matrixBaseField {n : ℕ} (L : C(CircleSpace, Coeff n)) : + C(CircleSpace, Operator (Amplification (EuclideanSpace ℂ (Fin n)) n)) := + ⟨fun t => tensorOperator (matrixOperatorMap n (L t)) (1 : Coeff n), + (tensorOperatorCLM (1 : Coeff n)).continuous.comp + ((matrixOperatorMap n).continuous.comp L.continuous)⟩ + +@[simp] theorem matrixBaseField_star_mul {n : ℕ} (L : C(CircleSpace, Coeff n)) + (t : CircleSpace) : + star (matrixBaseField L t) * matrixBaseField L t = + tensorOperator (matrixOperatorMap n ((L t)ᴴ * L t)) (1 : Coeff n) := by + change star (tensorOperator _ _) * tensorOperator _ _ = _ + rw [← tensorOperator_star, ← tensorOperator_mul, star_one, one_mul] + congr 1 + simp only [matrixOperatorMap_apply, ← Matrix.star_eq_conjTranspose, map_mul, map_star] + +theorem matrixBaseField_mass {n : ℕ} (L : C(CircleSpace, Coeff n)) + (hL : ∫ t, (L t)ᴴ * L t ∂circleMeasure = 1) : + ∫ t, star (matrixBaseField L t) * matrixBaseField L t ∂circleMeasure = 1 := by + let : ContinuousSMul ℂ (EuclideanSpace ℂ (Fin n)) := IsBoundedSMul.continuousSMul + let : CompleteSpace (Operator (EuclideanSpace ℂ (Fin n))) := + ContinuousLinearMap.instCompleteSpace + simp only [matrixBaseField_star_mul, ← tensorOperatorCLM_apply] + rw [(tensorOperatorCLM (H := EuclideanSpace ℂ (Fin n)) (1 : Coeff n)).integral_comp_comm, + (matrixOperatorMap n).integral_comp_comm, hL] + · simpa only [matrixOperatorMap_apply, tensorOperatorCLM_apply, map_one] using + tensorOperator_one (H := EuclideanSpace ℂ (Fin n)) n + · exact (L.continuous.star.mul L.continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · exact (matrixOperatorMap n).integrable_comp + ((L.continuous.star.mul L.continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _)) + +@[simp] theorem matrixBaseField_sandwich {n : ℕ} (L F : C(CircleSpace, Coeff n)) + (t : CircleSpace) : + star (matrixBaseField L t) * coefficientField (H := EuclideanSpace ℂ (Fin n)) F t * + matrixBaseField L t = tensorOperator (matrixOperatorMap n ((L t)ᴴ * L t)) (F t) := by + change star (tensorOperator _ _) * tensorOperator _ _ * tensorOperator _ _ = _ + rw [← tensorOperator_star, ← tensorOperator_mul, ← tensorOperator_mul, + star_one, one_mul, mul_one, mul_one] + congr 1 + simp only [matrixOperatorMap_apply, ← Matrix.star_eq_conjTranspose, map_mul, map_star] + +theorem norm_coefficientField_le_one {n : ℕ} (F : C(CircleSpace, Coeff n)) + (hF : ∀ t, ‖F t‖ ≤ 1) (t : CircleSpace) : + ‖coefficientField (H := EuclideanSpace ℂ (Fin n)) F t‖ ≤ 1 := by + change ‖tensorOperator (1 : Operator (EuclideanSpace ℂ (Fin n))) (F t)‖ ≤ 1 + exact (norm_tensorOperator_le _ _).trans (by + calc + ‖(1 : Operator (EuclideanSpace ℂ (Fin n)))‖ * ‖F t‖ ≤ 1 * 1 := + mul_le_mul ContinuousLinearMap.norm_id_le (hF t) (norm_nonneg _) zero_le_one + _ = 1 := one_mul _) + +@[simp] theorem vectorization_inj {n : ℕ} {X Y : Coeff n} : + vectorization X = vectorization Y ↔ X = Y := by + constructor + · intro h + have he := congrArg (matrixAmplificationCoordinates n n) h + rw [vectorization_coordinates, vectorization_coordinates] at he + exact congrArg ofHS he + · exact congrArg vectorization + +theorem matrix_fibres_of_integral_interpolation {n : ℕ} + (L F : C(CircleSpace, Coeff n)) + (hL : ∫ t, (L t)ᴴ * L t ∂circleMeasure = 1) + (hF : ∀ t, ‖F t‖ ≤ 1) (X Y : Coeff n) + (hN : ‖vectorization X‖ = ‖vectorization Y‖) + (hI : (∫ t, tensorOperator (matrixOperatorMap n ((L t)ᴴ * L t)) (F t) + ∂circleMeasure) (vectorization X) = vectorization Y) : + ∀ᵐ t ∂circleMeasure, + L t * Y = L t * X * (F t)ᵀ ∧ L t * X = L t * Y * (F t)ᴴᵀ := by + have h := Compression.fibres_of_integral_interpolation + (matrixBaseField L) (coefficientField (H := EuclideanSpace ℂ (Fin n)) F) + (matrixBaseField_mass L hL) (norm_coefficientField_le_one F hF) + (vectorization X) (vectorization Y) hN (by + simpa only [matrixBaseField_sandwich] using hI) + filter_upwards [h] with t ht + obtain ⟨h1, h2⟩ := ht + have he : (coefficientField (H := EuclideanSpace ℂ (Fin n)) F t).adjoint = coefficientField (H := EuclideanSpace ℂ (Fin n)) + ⟨fun t => (F t)ᴴ, F.continuous.star⟩ t := by + change star (tensorOperator (1 : Operator (EuclideanSpace ℂ (Fin n))) (F t)) = _ + rw [← tensorOperator_star, star_one] + rfl + rw [he] at h2 + change tensorOperator (1 : Operator (EuclideanSpace ℂ (Fin n))) (F t) + (tensorOperator (matrixOperatorMap n (L t)) (1 : Coeff n) (vectorization X)) = + tensorOperator (matrixOperatorMap n (L t)) (1 : Coeff n) (vectorization Y) at h1 + change tensorOperator (1 : Operator (EuclideanSpace ℂ (Fin n))) (F t)ᴴ + (tensorOperator (matrixOperatorMap n (L t)) (1 : Coeff n) (vectorization Y)) = + tensorOperator (matrixOperatorMap n (L t)) (1 : Coeff n) (vectorization X) at h2 + have hone : (1 : Operator (EuclideanSpace ℂ (Fin n))) = + Matrix.toEuclideanCLM (𝕜 := ℂ) (1 : Coeff n) := (map_one _).symm + simp only [matrixOperatorMap_apply, hone, tensorOperator_vectorization, + Matrix.transpose_one, mul_one, one_mul, vectorization_inj] at h1 h2 + exact ⟨h1.symm, h2.symm⟩ + +end CrouzeixHilbert + +namespace CrouzeixHilbert.Boundary + +def matrixDensityRoot {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).PosSemidef) : C(CircleSpace, Coeff n) := + ⟨fun t => CFC.sqrt (E t), + CFC.continuousOn_sqrt.comp_continuous E.continuous (fun t => (hE t).nonneg)⟩ + +@[simp] theorem matrixDensityRoot_star_mul {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).PosSemidef) (t : CircleSpace) : + (matrixDensityRoot E hE t)ᴴ * matrixDensityRoot E hE t = E t := by + change star (CFC.sqrt (E t)) * CFC.sqrt (E t) = _ + rw [(IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg _)).star_eq, + CFC.sqrt_mul_sqrt_self _ (hE t).nonneg] + +theorem densityLp_ordered {n : ℕ} (E F : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).PosSemidef) (hmass : ∫ t, E t ∂circleMeasure = 1) + (hF : ∀ t, ‖F t‖ ≤ 1) (X Y : Coeff n) + (hN : ‖vectorization X‖ = ‖vectorization Y‖) + (hI : (∫ t, tensorOperator (matrixOperatorMap n (E t)) (F t) + ∂circleMeasure) (vectorization X) = vectorization Y) : + ∀ᵐ t ∂circleMeasure, + ofHS (densityLp E X X t) = (F t)ᴴ * ofHS (densityLp E X Y t) ∧ + ofHS (densityLp E X Y t) = F t * ofHS (densityLp E X X t) ∧ + ofHS (densityLp E Y Y t) = ofHS (densityLp E X Y t) * (F t)ᴴ := by + let L := matrixDensityRoot E hE + have hf := matrix_fibres_of_integral_interpolation L F + (by simpa only [L, matrixDensityRoot_star_mul] using hmass) hF X Y hN + (by simpa only [L, matrixDensityRoot_star_mul] using hI) + filter_upwards [hf, densityLp_apply_ae E X X, densityLp_apply_ae E X Y, + densityLp_apply_ae E Y Y] with t ht hp hr hq + simp only [hp, hq, hr, ofHS_toHS] + have hL : (L t)ᴴ * L t = E t := matrixDensityRoot_star_mul E hE t + rw [← hL, weightedPartialTrace_factor, weightedPartialTrace_factor, + weightedPartialTrace_factor] + exact crossPartialTrace_ordered (L t * X) (L t * Y) (F t) ht.1 ht.2 + +theorem matrixMean_cross_zero {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hmass : ∫ t, E t ∂circleMeasure = 1) (X Y : Coeff n) (hXY : Xᴴ * Y = 0) : + matrixMean (densityLp E X Y) = 0 := by + rw [matrixMean_densityLp_mass_one E hmass, hXY, Matrix.transpose_zero] + +theorem trace_matrixMean_self_one {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hmass : ∫ t, E t ∂circleMeasure = 1) (X : Coeff n) + (hX : ‖vectorization X‖ = 1) : + (matrixMean (densityLp E X X)).trace = 1 := by + rw [matrixMean_densityLp_mass_one E hmass, Matrix.trace_transpose, + ← inner_vectorization, inner_self_eq_norm_sq_to_K, hX] + norm_num + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryForms.lean b/lean/OAI/Analysis/Crouzeix/BoundaryForms.lean new file mode 100644 index 0000000000000000000000000000000000000000..36fcdd6d303914ce5cb94e9501348740cecf5f17 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryForms.lean @@ -0,0 +1,779 @@ +import Mathlib + +namespace OAI + +/-! Boundary Forms. -/ + +noncomputable section + +open scoped InnerProductSpace Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +open MeasureTheory + +namespace CrouzeixHilbert.Boundary + +abbrev HS (k : ℕ) := EuclideanSpace ℂ (Fin k × Fin k) + +def toHS {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : HS k := + WithLp.toLp 2 fun ij => A ij.1 ij.2 + +def ofHS {k : ℕ} (v : HS k) : Matrix (Fin k) (Fin k) ℂ := + fun i j => v (i,j) + +@[simp] theorem ofHS_toHS {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ofHS (toHS A) = A := rfl + +@[simp] theorem toHS_ofHS {k : ℕ} (v : HS k) : toHS (ofHS v) = v := by + ext ij + rfl + +theorem norm_toHS_sq {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ‖toHS A‖ ^ 2 = ∑ i, ∑ j, ‖A i j‖ ^ 2 := by + rw [PiLp.norm_sq_eq_of_L2, Fintype.sum_prod_type] + rfl + +theorem trace_conjTranspose_mul_re {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + (Aᴴ * A).trace.re = ‖toHS A‖ ^ 2 := by + rw [norm_toHS_sq] + simp only [Matrix.trace, Matrix.diag, Matrix.mul_apply, Matrix.conjTranspose_apply, + Complex.re_sum, Complex.mul_re, Complex.star_def, Complex.conj_re, Complex.conj_im] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [← Complex.normSq_eq_norm_sq] + simp [Complex.normSq_apply] + +theorem trace_mul_nonneg {n : Type*} [Fintype n] [DecidableEq n] + {A B : Matrix n n ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) : + 0 ≤ (A * B).trace.re := by + obtain ⟨C, rfl⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hB.nonneg + have h := (hA.mul_mul_conjTranspose_same C).trace_nonneg + rw [Matrix.trace_mul_cycle] at h + simpa only [Matrix.star_eq_conjTranspose, Matrix.trace_mul_comm A] using + (Complex.nonneg_iff.mp h).1 + +theorem trace_fromBlocks {n m : Type*} [Fintype n] [Fintype m] + (A : Matrix n n ℂ) (B : Matrix n m ℂ) (C : Matrix m n ℂ) (D : Matrix m m ℂ) : + (Matrix.fromBlocks A B C D).trace = A.trace + D.trace := by + simp [Matrix.trace, Matrix.diag, Fintype.sum_sum_type] + +theorem block_posSemidef_norm_sq {k : ℕ} + (p q r : Matrix (Fin k) (Fin k) ℂ) + (h : (Matrix.fromBlocks p rᴴ r q).PosSemidef) : + 2 * ‖toHS r‖ ^ 2 ≤ ‖toHS p‖ ^ 2 + ‖toHS q‖ ^ 2 := by + let J : Matrix (Fin k ⊕ Fin k) (Fin k ⊕ Fin k) ℂ := + Matrix.fromBlocks 1 0 0 (-1) + have hp : pᴴ = p := (Matrix.isHermitian_fromBlocks_iff.mp h.isHermitian).1.eq + have hq : qᴴ = q := (Matrix.isHermitian_fromBlocks_iff.mp h.isHermitian).2.2.2.eq + have hh := trace_mul_nonneg h (h.conjTranspose_mul_mul_same J) + have hJ : Jᴴ = J := by simp [J, Matrix.fromBlocks_conjTranspose] + rw [hJ] at hh + simp only [J, Matrix.fromBlocks_multiply, mul_one, one_mul, mul_zero, zero_mul, + Matrix.mul_neg, Matrix.neg_mul, zero_add, add_zero, trace_fromBlocks, + Matrix.trace_add, Matrix.trace_neg, Complex.add_re, Complex.neg_re] at hh + have hr : (r * rᴴ).trace.re = ‖toHS r‖ ^ 2 := by + rw [Matrix.trace_mul_comm, trace_conjTranspose_mul_re] + have hpp := trace_conjTranspose_mul_re p + have hqq := trace_conjTranspose_mul_re q + rw [hp] at hpp + rw [hq] at hqq + rw [hpp, hqq] at hh + rw [trace_conjTranspose_mul_re, hr] at hh + linarith + +theorem lp_norm_sq_eq_integral {α E : Type*} [MeasurableSpace α] + {μ : Measure α} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (f : Lp E 2 μ) : ‖f‖ ^ 2 = ∫ t, ‖f t‖ ^ 2 ∂μ := by + rw [← real_inner_self_eq_norm_sq f, L2.inner_def] + simp only [real_inner_self_eq_norm_sq] + +theorem lp_block_posSemidef_norm_sq {α : Type*} [MeasurableSpace α] + {μ : Measure α} {k : ℕ} (p q r : Lp (HS k) 2 μ) + (h : ∀ᵐ t ∂μ, (Matrix.fromBlocks (ofHS (p t)) + (ofHS (r t))ᴴ (ofHS (r t)) (ofHS (q t))).PosSemidef) : + 2 * ‖r‖ ^ 2 ≤ ‖p‖ ^ 2 + ‖q‖ ^ 2 := by + have hi := integral_mono_ae (((Lp.memLp r).norm.integrable_sq).const_mul 2) + (((Lp.memLp p).norm.integrable_sq).add ((Lp.memLp q).norm.integrable_sq)) + (h.mono fun t ht => by simpa only [toHS_ofHS, Pi.add_apply] using + block_posSemidef_norm_sq (ofHS (p t)) (ofHS (q t)) (ofHS (r t)) ht) + simpa only [Pi.add_apply, integral_const_mul, integral_add (Lp.memLp p).norm.integrable_sq + (Lp.memLp q).norm.integrable_sq, ← lp_norm_sq_eq_integral] using hi + +section Splitting + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + +structure ThreeWaySplitting (E : Type*) [NormedAddCommGroup E] + [InnerProductSpace ℝ E] [CompleteSpace E] where + proj : Fin 3 → E →L[ℝ] E + self_adjoint : ∀ i, ContinuousLinearMap.adjoint (proj i) = proj i + comp : ∀ i j, (proj i).comp (proj j) = if i = j then proj i else 0 + total : proj 0 + proj 1 + proj 2 = ContinuousLinearMap.id ℝ E + +namespace ThreeWaySplitting + +variable (s : ThreeWaySplitting E) + +@[simp] theorem proj_proj (i j : Fin 3) (x : E) : + s.proj i (s.proj j x) = if i = j then s.proj i x else 0 := by + have h := congrArg (fun f : E →L[ℝ] E => f x) (s.comp i j) + by_cases hij : i = j + · subst j + simpa using h + · simpa [hij] using h + +theorem proj_orthogonal {i j : Fin 3} (hij : i ≠ j) (x y : E) : + ⟪s.proj i x, s.proj j y⟫_ℝ = 0 := by + rw [← s.self_adjoint i, ContinuousLinearMap.adjoint_inner_left, + s.proj_proj, ite_eq_right hij, inner_zero_right] + +@[simp] theorem total_apply (x : E) : s.proj 0 x + s.proj 1 x + s.proj 2 x = x := by + simpa only [add_apply, ContinuousLinearMap.id_apply] using + congrArg (fun f : E →L[ℝ] E => f x) s.total + +theorem norm_sq_decomposition (x : E) : + ‖x‖ ^ 2 = ‖s.proj 0 x‖ ^ 2 + ‖s.proj 1 x‖ ^ 2 + ‖s.proj 2 x‖ ^ 2 := by + calc + ‖x‖ ^ 2 = ‖s.proj 0 x + s.proj 1 x + s.proj 2 x‖ ^ 2 := by rw [s.total_apply] + _ = _ := by + simp only [norm_add_sq_real, inner_add_left, + s.proj_orthogonal (by decide : (0 : Fin 3) ≠ 1), + s.proj_orthogonal (by decide : (0 : Fin 3) ≠ 2), + s.proj_orthogonal (by decide : (1 : Fin 3) ≠ 2), + add_zero, mul_zero] + +theorem norm_proj_le (i : Fin 3) : ‖s.proj i‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro u + rw [one_mul] + have h := s.norm_sq_decomposition u + have h0 := sq_nonneg ‖s.proj 0 u‖ + have h1 := sq_nonneg ‖s.proj 1 u‖ + have h2 := sq_nonneg ‖s.proj 2 u‖ + have hs : ‖s.proj i u‖ ^ 2 ≤ ‖u‖ ^ 2 := by + fin_cases i + · change ‖s.proj 0 u‖ ^ 2 ≤ ‖u‖ ^ 2 + linarith only [h, h1, h2] + · change ‖s.proj 1 u‖ ^ 2 ≤ ‖u‖ ^ 2 + linarith only [h, h0, h2] + · change ‖s.proj 2 u‖ ^ 2 ≤ ‖u‖ ^ 2 + linarith only [h, h0, h1] + exact (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp hs + +def cauchyAdjoint (T : E →L[ℝ] E) : E →L[ℝ] E := + s.proj 0 + s.proj 1 + T.comp (s.proj 2) + +@[simp] theorem cauchyAdjoint_apply (T : E →L[ℝ] E) (x : E) : + s.cauchyAdjoint T x = s.proj 0 x + s.proj 1 x + T (s.proj 2 x) := rfl + +variable {s} {T : E →L[ℝ] E} + +theorem range_support (hT : (s.proj 1).comp T = T) (i : Fin 3) (x : E) : + s.proj i (T x) = if i = 1 then T x else 0 := by + have ht : s.proj 1 (T x) = T x := congrArg (fun f : E →L[ℝ] E => f x) hT + calc + s.proj i (T x) = s.proj i (s.proj 1 (T x)) := by rw [ht] + _ = _ := by + rw [s.proj_proj] + split_ifs with hi + · subst i + exact ht + · rfl + +@[simp] theorem proj0_cauchyAdjoint (hT : (s.proj 1).comp T = T) (x : E) : + s.proj 0 (s.cauchyAdjoint T x) = s.proj 0 x := by + simp [range_support hT] + +@[simp] theorem proj1_cauchyAdjoint (hT : (s.proj 1).comp T = T) (x : E) : + s.proj 1 (s.cauchyAdjoint T x) = s.proj 1 x + T (s.proj 2 x) := by + simp [range_support hT] + +@[simp] theorem proj2_cauchyAdjoint (hT : (s.proj 1).comp T = T) (x : E) : + s.proj 2 (s.cauchyAdjoint T x) = 0 := by + simp [range_support hT] + +theorem norm_cauchyAdjoint_sq (hT : (s.proj 1).comp T = T) (x : E) : + ‖s.cauchyAdjoint T x‖ ^ 2 = + ‖s.proj 0 x‖ ^ 2 + ‖s.proj 1 x + T (s.proj 2 x)‖ ^ 2 := by + rw [s.norm_sq_decomposition (s.cauchyAdjoint T x)] + simp only [proj0_cauchyAdjoint hT, proj1_cauchyAdjoint hT, + proj2_cauchyAdjoint hT, norm_zero, zero_pow (by decide : 2 ≠ 0), add_zero] + +omit [CompleteSpace E] in +theorem norm_apply_le_of_norm_le_one {L : E →L[ℝ] E} (hL : ‖L‖ ≤ 1) (x : E) : + ‖L x‖ ≤ ‖x‖ := by + calc + ‖L x‖ ≤ ‖L‖ * ‖x‖ := L.le_opNorm x + _ ≤ 1 * ‖x‖ := mul_le_mul_of_nonneg_right hL (norm_nonneg x) + _ = ‖x‖ := one_mul _ + +theorem weighted_norm_sq (hT : (s.proj 1).comp T = T) (hTnorm : ‖T‖ ≤ 1) (x : E) : + ‖s.cauchyAdjoint T x‖ ^ 2 + ‖s.proj 0 (s.cauchyAdjoint T x)‖ ^ 2 ≤ + 2 * ‖x‖ ^ 2 := by + have hn := norm_apply_le_of_norm_le_one hTnorm (s.proj 2 x) + have hnsq : ‖T (s.proj 2 x)‖ ^ 2 ≤ ‖s.proj 2 x‖ ^ 2 := + pow_le_pow_left₀ (norm_nonneg _) hn 2 + have hsum := norm_add_le (s.proj 1 x) (T (s.proj 2 x)) + have hsumsq := pow_le_pow_left₀ (norm_nonneg _) hsum 2 + rw [norm_cauchyAdjoint_sq hT, proj0_cauchyAdjoint hT, s.norm_sq_decomposition x] + nlinarith [sq_nonneg (‖s.proj 1 x‖ - ‖T (s.proj 2 x)‖)] + +structure CompatibleInvolution (s : ThreeWaySplitting E) where + op : E ≃ₗᵢ[ℝ] E + involutive : Function.Involutive op + proj_zero : ∀ x, op (s.proj 0 x) = s.proj 0 (op x) + proj_pos : ∀ x, op (s.proj 1 x) = s.proj 2 (op x) + +namespace CompatibleInvolution + +variable (j : CompatibleInvolution s) + +@[simp] theorem op_op (x : E) : j.op (j.op x) = x := j.involutive x + +theorem proj_neg (x : E) : j.op (s.proj 2 x) = s.proj 1 (j.op x) := by + have h := congrArg j.op (j.proj_pos (j.op x)) + simpa only [j.op_op] using h.symm + +theorem norm_add_op_sq (u : E) (hneg : s.proj 2 u = 0) + (h0 : j.op (s.proj 0 u) = s.proj 0 u) : + ‖u + j.op u‖ ^ 2 = 2 * (‖u‖ ^ 2 + ‖s.proj 0 u‖ ^ 2) := by + have hu : u = s.proj 0 u + s.proj 1 u := by + simpa only [hneg, add_zero] using (s.total_apply u).symm + have hju : j.op u = s.proj 0 u + s.proj 2 (j.op u) := by + calc + j.op u = j.op (s.proj 0 u + s.proj 1 u) := congrArg j.op hu + _ = _ := by rw [map_add, h0, j.proj_pos] + have hi : ⟪u, j.op u⟫_ℝ = ‖s.proj 0 u‖ ^ 2 := by + calc + ⟪u, j.op u⟫_ℝ = ⟪s.proj 0 u + s.proj 1 u, + s.proj 0 u + s.proj 2 (j.op u)⟫_ℝ := congrArg₂ (inner ℝ) hu hju + _ = _ := by + simp only [inner_add_left, inner_add_right, + s.proj_orthogonal (by decide : (0 : Fin 3) ≠ 2), + s.proj_orthogonal (by decide : (1 : Fin 3) ≠ 0), + s.proj_orthogonal (by decide : (1 : Fin 3) ≠ 2), + real_inner_self_eq_norm_sq, add_zero] + rw [norm_add_sq_real, hi, j.op.norm_map] + ring + +theorem cauchyAdjoint_add_op_sq (hT : (s.proj 1).comp T = T) (u : E) + (hu : j.op u = u) : + ‖s.cauchyAdjoint T u + j.op (s.cauchyAdjoint T u)‖ ^ 2 = + 2 * (‖s.cauchyAdjoint T u‖ ^ 2 + ‖s.proj 0 (s.cauchyAdjoint T u)‖ ^ 2) := by + apply j.norm_add_op_sq _ (proj2_cauchyAdjoint hT u) + rw [proj0_cauchyAdjoint hT, j.proj_zero, hu] + +theorem adjoint_reflected_orthogonal (hT : (s.proj 1).comp T = T) + (r : E) (hr : s.proj 0 r = 0) : + ⟪s.cauchyAdjoint T r, j.op (s.cauchyAdjoint T (j.op r))⟫_ℝ = 0 := by + let g := s.cauchyAdjoint T r + let h := s.cauchyAdjoint T (j.op r) + have hg : g = s.proj 1 g := by + have ht := s.total_apply g + simpa only [g, proj0_cauchyAdjoint hT, proj2_cauchyAdjoint hT, hr, + zero_add, add_zero] using ht.symm + have hm : s.proj 0 (j.op r) = 0 := by rw [← j.proj_zero, hr, map_zero] + have hh : h = s.proj 1 h := by + have ht := s.total_apply h + simpa only [h, proj0_cauchyAdjoint hT, proj2_cauchyAdjoint hT, hm, + zero_add, add_zero] using ht.symm + calc + ⟪g, j.op h⟫_ℝ = ⟪s.proj 1 g, s.proj 2 (j.op h)⟫_ℝ := by + have hjh : j.op h = s.proj 2 (j.op h) := by + calc + j.op h = j.op (s.proj 1 h) := congrArg j.op hh + _ = _ := j.proj_pos h + exact congrArg₂ (inner ℝ) hg hjh + _ = 0 := s.proj_orthogonal (by decide) _ _ + +theorem norm_cross_ge (hT : (s.proj 1).comp T = T) + (r : E) (hr : s.proj 0 r = 0) (κ : ℝ) : + κ ^ 2 * ‖s.cauchyAdjoint T r‖ ^ 2 ≤ + ‖κ • s.cauchyAdjoint T r + κ⁻¹ • j.op (s.cauchyAdjoint T (j.op r))‖ ^ 2 := by + rw [norm_add_sq_real, inner_smul_left, inner_smul_right, + j.adjoint_reflected_orthogonal hT r hr, mul_zero, mul_zero, mul_zero, add_zero] + simp only [norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] + exact le_add_of_nonneg_right (by positivity) + +end CompatibleInvolution + +theorem ordered_projection (L : E →L[ℝ] E) + (hL : (ContinuousLinearMap.adjoint (s.cauchyAdjoint T)).comp + (L.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) = + L.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) (r : E) : + s.cauchyAdjoint T (ContinuousLinearMap.adjoint L r) = + s.cauchyAdjoint T (ContinuousLinearMap.adjoint L (s.cauchyAdjoint T r)) := by + have h := congrArg ContinuousLinearMap.adjoint hL + simp only [ContinuousLinearMap.adjoint_comp, ContinuousLinearMap.adjoint_adjoint] at h + exact (congrArg (fun M : E →L[ℝ] E => M r) h).symm + +theorem norm_adjoint_apply_le_of_norm_le_one {L : E →L[ℝ] E} + (hL : ‖L‖ ≤ 1) (x : E) : ‖ContinuousLinearMap.adjoint L x‖ ≤ ‖x‖ := + norm_apply_le_of_norm_le_one ((ContinuousLinearMap.adjoint.norm_map L).trans_le hL) x + +theorem diagonal_estimate (j : CompatibleInvolution s) + (hT : (s.proj 1).comp T = T) (hTnorm : ‖T‖ ≤ 1) + (L : E →L[ℝ] E) (hLnorm : ‖L‖ ≤ 1) + (hL : (ContinuousLinearMap.adjoint (s.cauchyAdjoint T)).comp + (L.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) = + L.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) + (p r : E) (hp : p = ContinuousLinearMap.adjoint L r) (hpstar : j.op p = p) : + ‖s.cauchyAdjoint T p + j.op (s.cauchyAdjoint T (j.op p))‖ ^ 2 ≤ + 4 * ‖s.cauchyAdjoint T r‖ ^ 2 := by + have hd : s.cauchyAdjoint T p = + s.cauchyAdjoint T (ContinuousLinearMap.adjoint L (s.cauchyAdjoint T r)) := by + rw [hp, ordered_projection L hL r] + have hn := norm_adjoint_apply_le_of_norm_le_one hLnorm (s.cauchyAdjoint T r) + have hnsq := pow_le_pow_left₀ (norm_nonneg _) hn 2 + have hw := weighted_norm_sq hT hTnorm + (ContinuousLinearMap.adjoint L (s.cauchyAdjoint T r)) + rw [hpstar, j.cauchyAdjoint_add_op_sq hT p hpstar, hd] + linarith + +theorem ordered_comparison_of_block_norm (j : CompatibleInvolution s) + (hT : (s.proj 1).comp T = T) (hTnorm : ‖T‖ ≤ 1) + (L R : E →L[ℝ] E) (hLnorm : ‖L‖ ≤ 1) (hRnorm : ‖R‖ ≤ 1) + (hL : (ContinuousLinearMap.adjoint (s.cauchyAdjoint T)).comp + (L.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) = + L.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) + (hR : (ContinuousLinearMap.adjoint (s.cauchyAdjoint T)).comp + (R.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) = + R.comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) + (p q r : E) (hp : p = ContinuousLinearMap.adjoint L r) + (hq : q = ContinuousLinearMap.adjoint R r) + (hpstar : j.op p = p) (hqstar : j.op q = q) + (hrmean : s.proj 0 r = 0) (hpmean : s.proj 0 p ≠ 0) + (κ : ℝ) (hκ : 0 < κ) + (hblock : 2 * ‖κ • s.cauchyAdjoint T r + + κ⁻¹ • j.op (s.cauchyAdjoint T (j.op r))‖ ^ 2 ≤ + ‖s.cauchyAdjoint T p + j.op (s.cauchyAdjoint T (j.op p))‖ ^ 2 + + ‖s.cauchyAdjoint T q + j.op (s.cauchyAdjoint T (j.op q))‖ ^ 2) : κ ≤ 2 := by + have hg : s.cauchyAdjoint T r ≠ 0 := by + intro hg + have hd : s.cauchyAdjoint T p = 0 := by + rw [hp, ordered_projection L hL r, hg, map_zero, map_zero] + apply hpmean + rw [← proj0_cauchyAdjoint hT p, hd, map_zero] + have hgp : 0 < ‖s.cauchyAdjoint T r‖ ^ 2 := + sq_pos_of_pos (norm_pos_iff.mpr hg) + have hpbound := diagonal_estimate j hT hTnorm L hLnorm hL p r hp hpstar + have hqbound := diagonal_estimate j hT hTnorm R hRnorm hR q r hq hqstar + have hcross := j.norm_cross_ge hT r hrmean κ + have hm : κ ^ 2 * ‖s.cauchyAdjoint T r‖ ^ 2 ≤ + 4 * ‖s.cauchyAdjoint T r‖ ^ 2 := by linarith + have hsq : κ ^ 2 ≤ 4 := (mul_le_mul_iff_of_pos_right hgp).mp hm + nlinarith + +end ThreeWaySplitting + +end Splitting + +section FieldAction + +variable {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + +def fieldAction (L : α → E →L[ℝ] E) (hL : AEStronglyMeasurable L μ) + (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ 1) : Lp E 2 μ →L[ℝ] Lp E 2 μ := by + let mem : ∀ u : Lp E 2 μ, MemLp (fun t => L t (u t)) 2 μ := fun u => + (Lp.memLp u).mono + ((show Continuous (fun z : (E →L[ℝ] E) × E => z.1 z.2) by fun_prop).comp_aestronglyMeasurable (hL.prodMk (Lp.aestronglyMeasurable u))) + (hLn.mono fun t ht => by + calc + ‖L t (u t)‖ ≤ ‖L t‖ * ‖u t‖ := (L t).le_opNorm _ + _ ≤ 1 * ‖u t‖ := mul_le_mul_of_nonneg_right ht (norm_nonneg _) + _ = ‖u t‖ := one_mul _) + let M : Lp E 2 μ →ₗ[ℝ] Lp E 2 μ := { + toFun u := (mem u).toLp _ + map_add' u v := by + apply Lp.ext + filter_upwards [(mem (u + v)).coeFn_toLp, (mem u).coeFn_toLp, + (mem v).coeFn_toLp, Lp.coeFn_add u v, + Lp.coeFn_add ((mem u).toLp _) ((mem v).toLp _)] with t huv hu hv ha hb + simp only [huv, hb, hu, hv, ha, map_add, Pi.add_apply] + map_smul' c u := by + apply Lp.ext + filter_upwards [(mem (c • u)).coeFn_toLp, (mem u).coeFn_toLp, + Lp.coeFn_smul c u, Lp.coeFn_smul c ((mem u).toLp _)] with t hcu hu ha hb + simp only [hcu, hb, hu, ha, map_smul, Pi.smul_apply, RingHom.id_apply] } + apply M.mkContinuous 1 + intro u + rw [one_mul] + apply Lp.norm_le_norm_of_ae_le + filter_upwards [(mem u).coeFn_toLp, hLn] with t ht hn + change ‖((mem u).toLp _) t‖ ≤ ‖u t‖ + rw [ht] + exact ThreeWaySplitting.norm_apply_le_of_norm_le_one hn _ + +omit [CompleteSpace E] in +theorem fieldAction_apply_ae (L : α → E →L[ℝ] E) (hL : AEStronglyMeasurable L μ) + (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ 1) (u : Lp E 2 μ) : + fieldAction L hL hLn u =ᵐ[μ] fun t => L t (u t) := by + unfold fieldAction + dsimp only [LinearMap.mkContinuous_apply, LinearMap.coe_mk, AddHom.coe_mk] + exact MemLp.coeFn_toLp _ + +omit [CompleteSpace E] in +theorem norm_fieldAction_le (L : α → E →L[ℝ] E) (hL : AEStronglyMeasurable L μ) + (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ 1) : ‖fieldAction L hL hLn‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ (by norm_num) + intro u + rw [one_mul] + apply Lp.norm_le_norm_of_ae_le + filter_upwards [fieldAction_apply_ae L hL hLn u, hLn] with t ht hn + rw [ht] + exact ThreeWaySplitting.norm_apply_le_of_norm_le_one hn _ + +theorem adjoint_fieldAction (L M : α → E →L[ℝ] E) + (hL : AEStronglyMeasurable L μ) (hM : AEStronglyMeasurable M μ) + (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ 1) (hMn : ∀ᵐ t ∂μ, ‖M t‖ ≤ 1) + (ha : ∀ᵐ t ∂μ, ContinuousLinearMap.adjoint (L t) = M t) : + ContinuousLinearMap.adjoint (fieldAction L hL hLn) = fieldAction M hM hMn := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + simp only [L2.inner_def] + apply integral_congr_ae + filter_upwards [fieldAction_apply_ae M hM hMn u, fieldAction_apply_ae L hL hLn v, ha] + with t hu hv ht + rw [hu, hv, ← ht, ContinuousLinearMap.adjoint_inner_left] + +end FieldAction + +section MatrixMultipliers + +def hsEquiv (k : ℕ) : Matrix (Fin k) (Fin k) ℂ ≃ₗ[ℝ] HS k where + toFun := toHS + invFun := ofHS + left_inv := ofHS_toHS + right_inv := toHS_ofHS + map_add' A B := by ext ij; rfl + map_smul' c A := by ext ij; rfl + +@[simp] theorem hsEquiv_apply {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + hsEquiv k A = toHS A := rfl + +@[simp] theorem hsEquiv_symm_apply {k : ℕ} (u : HS k) : + (hsEquiv k).symm u = ofHS u := rfl + +theorem inner_toHS {k : ℕ} (A B : Matrix (Fin k) (Fin k) ℂ) : + ⟪toHS A, toHS B⟫_ℂ = (Aᴴ * B).trace := by + simp only [PiLp.inner_apply, RCLike.inner_apply, toHS, + Fintype.sum_prod_type, Matrix.trace, Matrix.diag, Matrix.mul_apply, + Matrix.conjTranspose_apply, starRingEnd_apply] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + exact mul_comm _ _ + +theorem real_inner_toHS {k : ℕ} (A B : Matrix (Fin k) (Fin k) ℂ) : + ⟪toHS A, toHS B⟫_ℝ = (Aᴴ * B).trace.re := by + rw [← inner_toHS] + simp only [PiLp.inner_apply, toHS, real_inner_eq_re_inner ℂ, + RCLike.re_to_complex, Complex.re_sum] + +theorem norm_toHS_conjTranspose {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ‖toHS Aᴴ‖ = ‖toHS A‖ := by + have h : ‖toHS Aᴴ‖ ^ 2 = ‖toHS A‖ ^ 2 := by + simp only [norm_toHS_sq, Matrix.conjTranspose_apply, norm_star] + exact Finset.sum_comm + nlinarith [norm_nonneg (toHS Aᴴ), norm_nonneg (toHS A)] + +theorem norm_toHS_mul_le {k : ℕ} (A B : Matrix (Fin k) (Fin k) ℂ) : + ‖toHS (A * B)‖ ≤ ‖A‖ * ‖toHS B‖ := by + let col : Matrix (Fin k) (Fin k) ℂ → Fin k → EuclideanSpace ℂ (Fin k) := + fun M j => WithLp.toLp 2 (fun i => M i j) + have hcol (M : Matrix (Fin k) (Fin k) ℂ) : + ‖toHS M‖ ^ 2 = ∑ j, ‖col M j‖ ^ 2 := by + rw [norm_toHS_sq] + simp only [PiLp.norm_sq_eq_of_L2, col] + change (∑ i, ∑ j, ‖M i j‖ ^ 2) = ∑ j, ∑ i, ‖M i j‖ ^ 2 + exact Finset.sum_comm + have hn (j : Fin k) : ‖col (A * B) j‖ ≤ ‖A‖ * ‖col B j‖ := by + exact Matrix.l2_opNorm_mulVec A (col B j) + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mp + rw [hcol, mul_pow, hcol, Finset.mul_sum] + apply Finset.sum_le_sum + intro j _ + simpa only [mul_pow] using pow_le_pow_left₀ (norm_nonneg _) (hn j) 2 + +theorem norm_toHS_mul_le_right {k : ℕ} (A B : Matrix (Fin k) (Fin k) ℂ) : + ‖toHS (A * B)‖ ≤ ‖toHS A‖ * ‖B‖ := by + calc + ‖toHS (A * B)‖ = ‖toHS (Bᴴ * Aᴴ)‖ := by + rw [← Matrix.conjTranspose_mul, norm_toHS_conjTranspose] + _ ≤ ‖Bᴴ‖ * ‖toHS Aᴴ‖ := norm_toHS_mul_le _ _ + _ = ‖toHS A‖ * ‖B‖ := by + rw [Matrix.l2_opNorm_conjTranspose, norm_toHS_conjTranspose, mul_comm] + +def hsLeft {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : HS k →L[ℝ] HS k := + ((hsEquiv k).toLinearMap.comp + ((LinearMap.mulLeft ℝ A).comp (hsEquiv k).symm.toLinearMap)).toContinuousLinearMap + +def hsRight {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : HS k →L[ℝ] HS k := + ((hsEquiv k).toLinearMap.comp + ((LinearMap.mulRight ℝ A).comp (hsEquiv k).symm.toLinearMap)).toContinuousLinearMap + +@[simp] theorem hsLeft_apply {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) (u : HS k) : + hsLeft A u = toHS (A * ofHS u) := rfl + +@[simp] theorem hsRight_apply {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) (u : HS k) : + hsRight A u = toHS (ofHS u * A) := rfl + +theorem norm_hsLeft_le {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ‖hsLeft A‖ ≤ ‖A‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro u + simpa only [hsLeft_apply, toHS_ofHS] using norm_toHS_mul_le A (ofHS u) + +theorem norm_hsRight_le {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ‖hsRight A‖ ≤ ‖A‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro u + simpa only [hsRight_apply, toHS_ofHS, mul_comm] using norm_toHS_mul_le_right (ofHS u) A + +@[simp] theorem adjoint_hsLeft {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ContinuousLinearMap.adjoint (hsLeft A) = hsLeft Aᴴ := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + obtain ⟨U, rfl⟩ := (hsEquiv k).surjective u + obtain ⟨V, rfl⟩ := (hsEquiv k).surjective v + simp only [hsEquiv_apply, hsLeft_apply, ofHS_toHS, + real_inner_toHS, Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, Matrix.mul_assoc] + +@[simp] theorem adjoint_hsRight {k : ℕ} (A : Matrix (Fin k) (Fin k) ℂ) : + ContinuousLinearMap.adjoint (hsRight A) = hsRight Aᴴ := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + obtain ⟨U, rfl⟩ := (hsEquiv k).surjective u + obtain ⟨V, rfl⟩ := (hsEquiv k).surjective v + simp only [hsEquiv_apply, hsRight_apply, ofHS_toHS, + real_inner_toHS, Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose] + rw [Matrix.trace_mul_cycle, Matrix.trace_mul_comm (V * A)] + +def hsLeftCoefficient (k : ℕ) : + Matrix (Fin k) (Fin k) ℂ →L[ℝ] (HS k →L[ℝ] HS k) := + ({ toFun := hsLeft + map_add' := fun A B => by + apply ContinuousLinearMap.ext + intro u + change toHS ((A + B) * ofHS u) = toHS (A * ofHS u) + toHS (B * ofHS u) + rw [add_mul] + simpa only [hsEquiv_apply] using (hsEquiv k).map_add _ _ + map_smul' := fun c A => by + apply ContinuousLinearMap.ext + intro u + change toHS ((c • A) * ofHS u) = c • toHS (A * ofHS u) + rw [Matrix.smul_mul] + simpa only [hsEquiv_apply] using (hsEquiv k).map_smul c _ } : + Matrix (Fin k) (Fin k) ℂ →ₗ[ℝ] (HS k →L[ℝ] HS k)).toContinuousLinearMap + +def hsRightCoefficient (k : ℕ) : + Matrix (Fin k) (Fin k) ℂ →L[ℝ] (HS k →L[ℝ] HS k) := + ({ toFun := hsRight + map_add' := fun A B => by + apply ContinuousLinearMap.ext + intro u + change toHS (ofHS u * (A + B)) = toHS (ofHS u * A) + toHS (ofHS u * B) + rw [mul_add] + simpa only [hsEquiv_apply] using (hsEquiv k).map_add _ _ + map_smul' := fun c A => by + apply ContinuousLinearMap.ext + intro u + change toHS (ofHS u * (c • A)) = c • toHS (ofHS u * A) + rw [Matrix.mul_smul] + simpa only [hsEquiv_apply] using (hsEquiv k).map_smul c _ } : + Matrix (Fin k) (Fin k) ℂ →ₗ[ℝ] (HS k →L[ℝ] HS k)).toContinuousLinearMap + +def hsStar (k : ℕ) : HS k ≃ₗᵢ[ℝ] HS k where + toFun u := toHS (ofHS u)ᴴ + invFun u := toHS (ofHS u)ᴴ + left_inv u := by simp + right_inv u := by simp + map_add' u v := by + change toHS ((ofHS u + ofHS v)ᴴ) = _ + rw [Matrix.conjTranspose_add] + simpa only [hsEquiv_apply] using (hsEquiv k).map_add _ _ + map_smul' c u := by + change toHS ((c • ofHS u)ᴴ) = c • toHS (ofHS u)ᴴ + rw [Matrix.conjTranspose_smul, star_trivial] + simpa only [hsEquiv_apply] using (hsEquiv k).map_smul c _ + norm_map' u := by + change ‖toHS (ofHS u)ᴴ‖ = ‖u‖ + rw [norm_toHS_conjTranspose, toHS_ofHS] + +@[simp] theorem hsStar_apply {k : ℕ} (u : HS k) : hsStar k u = toHS (ofHS u)ᴴ := rfl + +@[simp] theorem hsStar_hsStar {k : ℕ} (u : HS k) : hsStar k (hsStar k u) = u := by simp + +end MatrixMultipliers + +section L2Multipliers + +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} {k : ℕ} + +def lpStar : Lp (HS k) 2 μ ≃ₗᵢ[ℝ] Lp (HS k) 2 μ := by + let M := (hsStar k).toContinuousLinearMap.compLpL 2 μ + have hinv : Function.Involutive M := by + intro u + apply Lp.ext + filter_upwards [(hsStar k).toContinuousLinearMap.coeFn_compLpL u, + (hsStar k).toContinuousLinearMap.coeFn_compLpL (M u)] with t hu hMu + exact hMu.trans (by change hsStar k (M u t) = u t; rw [hu]; exact hsStar_hsStar _) + refine { + toLinearEquiv := { + toLinearMap := M.toLinearMap + invFun := M + left_inv := hinv + right_inv := hinv } + norm_map' := fun u => ?_ } + have hn : ∀ᵐ t ∂μ, ‖M u t‖ = ‖u t‖ := + ((hsStar k).toContinuousLinearMap.coeFn_compLpL u).mono fun t ht => by + rw [ht] + exact (hsStar k).norm_map _ + exact le_antisymm (Lp.norm_le_norm_of_ae_le (hn.mono fun _ ht => ht.le)) + (Lp.norm_le_norm_of_ae_le (hn.mono fun _ ht => ht.ge)) + +theorem lpStar_apply_ae (u : Lp (HS k) 2 μ) : + lpStar u =ᵐ[μ] fun t => toHS (ofHS (u t))ᴴ := + (hsStar k).toContinuousLinearMap.coeFn_compLpL u + +@[simp] theorem lpStar_lpStar (u : Lp (HS k) 2 μ) : lpStar (lpStar u) = u := by + apply Lp.ext + filter_upwards [lpStar_apply_ae u, lpStar_apply_ae (lpStar u)] with t hu hsu + simp only [hsu, hu, ofHS_toHS, Matrix.conjTranspose_conjTranspose, toHS_ofHS] + +def lpLeft (F : α → Matrix (Fin k) (Fin k) ℂ) (hm : AEStronglyMeasurable F μ) + (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) : Lp (HS k) 2 μ →L[ℝ] Lp (HS k) 2 μ := + fieldAction (fun t => hsLeft (F t)) + ((hsLeftCoefficient k).continuous.comp_aestronglyMeasurable hm) + (hn.mono fun _ ht => (norm_hsLeft_le _).trans ht) + +def lpRight (F : α → Matrix (Fin k) (Fin k) ℂ) (hm : AEStronglyMeasurable F μ) + (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) : Lp (HS k) 2 μ →L[ℝ] Lp (HS k) 2 μ := + fieldAction (fun t => hsRight (F t)) + ((hsRightCoefficient k).continuous.comp_aestronglyMeasurable hm) + (hn.mono fun _ ht => (norm_hsRight_le _).trans ht) + +theorem lpLeft_apply_ae (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) + (u : Lp (HS k) 2 μ) : + lpLeft F hm hn u =ᵐ[μ] fun t => toHS (F t * ofHS (u t)) := + fieldAction_apply_ae _ _ _ _ + +theorem lpRight_apply_ae (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) + (u : Lp (HS k) 2 μ) : + lpRight F hm hn u =ᵐ[μ] fun t => toHS (ofHS (u t) * F t) := + fieldAction_apply_ae _ _ _ _ + +theorem norm_lpLeft_le (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) : + ‖lpLeft F hm hn‖ ≤ 1 := norm_fieldAction_le _ _ _ + +theorem norm_lpRight_le (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) : + ‖lpRight F hm hn‖ ≤ 1 := norm_fieldAction_le _ _ _ + +theorem aestronglyMeasurable_conjTranspose (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) : AEStronglyMeasurable (fun t => (F t)ᴴ) μ := + (show Continuous (fun A : Matrix (Fin k) (Fin k) ℂ => Aᴴ) by fun_prop).comp_aestronglyMeasurable hm + +theorem lpLeft_adjoint_apply_ae (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) + (u : Lp (HS k) 2 μ) : + ContinuousLinearMap.adjoint (lpLeft F hm hn) u =ᵐ[μ] + fun t => toHS ((F t)ᴴ * ofHS (u t)) := by + have hm' := aestronglyMeasurable_conjTranspose F hm + have hn' : ∀ᵐ t ∂μ, ‖(F t)ᴴ‖ ≤ 1 := hn.mono fun t ht => by + rwa [Matrix.l2_opNorm_conjTranspose] + have h : ContinuousLinearMap.adjoint (lpLeft F hm hn) = lpLeft (fun t => (F t)ᴴ) hm' hn' := + adjoint_fieldAction _ _ _ _ _ _ (Filter.Eventually.of_forall fun t => adjoint_hsLeft _) + rw [h] + exact lpLeft_apply_ae _ _ _ _ + +theorem lpRight_adjoint_apply_ae (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) + (u : Lp (HS k) 2 μ) : + ContinuousLinearMap.adjoint (lpRight F hm hn) u =ᵐ[μ] + fun t => toHS (ofHS (u t) * (F t)ᴴ) := by + have hm' := aestronglyMeasurable_conjTranspose F hm + have hn' : ∀ᵐ t ∂μ, ‖(F t)ᴴ‖ ≤ 1 := hn.mono fun t ht => by + rwa [Matrix.l2_opNorm_conjTranspose] + have h : ContinuousLinearMap.adjoint (lpRight F hm hn) = lpRight (fun t => (F t)ᴴ) hm' hn' := + adjoint_fieldAction _ _ _ _ _ _ (Filter.Eventually.of_forall fun t => adjoint_hsRight _) + rw [h] + exact lpRight_apply_ae _ _ _ _ + +theorem lpStar_eq_self_iff (u : Lp (HS k) 2 μ) : + lpStar u = u ↔ ∀ᵐ t ∂μ, (ofHS (u t)).IsHermitian := by + constructor + · intro h + filter_upwards [lpStar_apply_ae u] with t ht + rw [h] at ht + have he := congrArg ofHS ht + exact (he.trans (ofHS_toHS _)).symm + · intro h + apply Lp.ext + filter_upwards [lpStar_apply_ae u, h] with t ht he + rw [ht, he.eq, toHS_ofHS] + +theorem lp_ordered_comparison + (s : ThreeWaySplitting (Lp (HS k) 2 μ)) + (hstar0 : ∀ u, lpStar (s.proj 0 u) = s.proj 0 (lpStar u)) + (hstar1 : ∀ u, lpStar (s.proj 1 u) = s.proj 2 (lpStar u)) + (T : Lp (HS k) 2 μ →L[ℝ] Lp (HS k) 2 μ) + (hT : (s.proj 1).comp T = T) (hTnorm : ‖T‖ ≤ 1) + (F : α → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F μ) (hn : ∀ᵐ t ∂μ, ‖F t‖ ≤ 1) + (hleft : (ContinuousLinearMap.adjoint (s.cauchyAdjoint T)).comp + ((lpLeft F hm hn).comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) = + (lpLeft F hm hn).comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) + (hright : (ContinuousLinearMap.adjoint (s.cauchyAdjoint T)).comp + ((lpRight F hm hn).comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) = + (lpRight F hm hn).comp (ContinuousLinearMap.adjoint (s.cauchyAdjoint T))) + (p q r : Lp (HS k) 2 μ) + (hpstar : ∀ᵐ t ∂μ, (ofHS (p t)).IsHermitian) + (hqstar : ∀ᵐ t ∂μ, (ofHS (q t)).IsHermitian) + (hp : ∀ᵐ t ∂μ, ofHS (p t) = (F t)ᴴ * ofHS (r t)) + (hq : ∀ᵐ t ∂μ, ofHS (q t) = ofHS (r t) * (F t)ᴴ) + (hrmean : s.proj 0 r = 0) (hpmean : s.proj 0 p ≠ 0) + (κ : ℝ) (hκ : 0 < κ) + (hblock : let D := s.cauchyAdjoint T + let pₑ := D p + lpStar (D (lpStar p)) + let qₑ := D q + lpStar (D (lpStar q)) + let rₑ := κ • D r + κ⁻¹ • lpStar (D (lpStar r)) + ∀ᵐ t ∂μ, (Matrix.fromBlocks (ofHS (pₑ t)) + (ofHS (rₑ t))ᴴ (ofHS (rₑ t)) (ofHS (qₑ t))).PosSemidef) : κ ≤ 2 := by + let j : s.CompatibleInvolution := { + op := lpStar + involutive := lpStar_lpStar + proj_zero := hstar0 + proj_pos := hstar1 } + have hp' : p = ContinuousLinearMap.adjoint (lpLeft F hm hn) r := by + apply Lp.ext + filter_upwards [hp, lpLeft_adjoint_apply_ae F hm hn r] with t ht ha + rw [ha, ← ht, toHS_ofHS] + have hq' : q = ContinuousLinearMap.adjoint (lpRight F hm hn) r := by + apply Lp.ext + filter_upwards [hq, lpRight_adjoint_apply_ae F hm hn r] with t ht ha + rw [ha, ← ht, toHS_ofHS] + exact ThreeWaySplitting.ordered_comparison_of_block_norm j hT hTnorm + (lpLeft F hm hn) (lpRight F hm hn) (norm_lpLeft_le F hm hn) + (norm_lpRight_le F hm hn) hleft hright p q r hp' hq' + ((lpStar_eq_self_iff p).mpr hpstar) ((lpStar_eq_self_iff q).mpr hqstar) + hrmean hpmean κ hκ (lp_block_posSemidef_norm_sq _ _ _ hblock) + +end L2Multipliers + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryKernel.lean b/lean/OAI/Analysis/Crouzeix/BoundaryKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..97235839aa60921629433fb48e5b136673981c81 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryKernel.lean @@ -0,0 +1,138 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CircleCoordinate +import OAI.Analysis.Crouzeix.ExteriorKernel + +namespace OAI + +/-! Boundary Kernel. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +open Boundary + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +lemma closed_unit_subset_reciprocalDisk : closedBall (0 : ℂ) 1 ⊆ C.reciprocalDisk := by + intro z hz + rw [mem_ball_zero_iff] + exact (mem_closedBall_zero_iff.mp hz).trans_lt + ((one_lt_inv₀ C.radius_pos).mpr C.radius_lt_one) + +lemma circle_inverse_mem (t : CircleSpace) : (circleCoordinate t)⁻¹ ∈ C.reciprocalDisk := + C.inverse_mem_reciprocalDisk (by rw [norm_circleCoordinate]; exact C.radius_lt_one) + +def boundaryCorrection : C(CircleSpace × CircleSpace, ℂ) where + toFun p := C.correction (circleCoordinate p.2)⁻¹ (circleCoordinate p.1)⁻¹ + continuous_toFun := C.continuousOn_correction.comp_continuous + (((circleCoordinate.continuous.comp continuous_snd).inv₀ + (fun p => circleCoordinate_ne_zero p.2)).prodMk + ((circleCoordinate.continuous.comp continuous_fst).inv₀ + (fun p => circleCoordinate_ne_zero p.1))) + (fun p => ⟨C.circle_inverse_mem p.2, C.circle_inverse_mem p.1⟩) + +def boundaryKernel : CircleKernel where + toFun p := 1 + 2 * (C.boundaryCorrection p).re + continuous_toFun := continuous_const.add + (continuous_const.mul (continuous_re.comp C.boundaryCorrection.continuous)) + +lemma circle_real_quotient {t w : ℂ} (ht : ‖t‖ = 1) (hw : ‖w‖ = 1) (hne : t ≠ w) : + 2 * (t/(t-w)).re = 1 := by + have hn : normSq (t-w) ≠ 0 := normSq_eq_zero.not.mpr (sub_ne_zero.mpr hne) + have hts : t.re * t.re + t.im * t.im = 1 := by + rw [← normSq_apply, normSq_eq_norm_sq, ht, one_pow] + have hws : w.re * w.re + w.im * w.im = 1 := by + rw [← normSq_apply, normSq_eq_norm_sq, hw, one_pow] + rw [div_re, ← add_div] + field_simp + simp only [normSq_apply, sub_re, sub_im] + nlinarith + +lemma boundaryKernel_off_diagonal (hc : Convex ℝ U) {w t : CircleSpace} (hnt : t ≠ w) : + 0 ≤ C.boundaryKernel (w,t) := by + have ht : C.radius < ‖circleCoordinate t‖ := by rw [norm_circleCoordinate]; exact C.radius_lt_one + have hw : C.radius < ‖circleCoordinate w‖ := by rw [norm_circleCoordinate]; exact C.radius_lt_one + have htw : circleCoordinate t ≠ circleCoordinate w := fun he => hnt (circleCoordinate_injective he) + have hn := C.supporting_normal hc (norm_circleCoordinate t) + (C.boundary.mapsTo (mem_sphere_zero_iff_norm.mpr (norm_circleCoordinate w))).1 + have hq : 0 ≤ (circleCoordinate t * deriv C.G (circleCoordinate t) / + (C.G (circleCoordinate t) - C.G (circleCoordinate w))).re := by + rw [div_re, ← add_div] + apply div_nonneg _ (normSq_nonneg _) + simpa only [mul_re, conj_re, conj_im, sub_neg_eq_add, neg_mul] using hn + change 0 ≤ 1 + 2 * (C.correction _ _).re + rw [C.correction_eq ht hw htw, sub_re] + have he := circle_real_quotient (norm_circleCoordinate t) (norm_circleCoordinate w) htw + linarith + +lemma boundaryKernel_nonnegative (hc : Convex ℝ U) (p : CircleSpace × CircleSpace) : + 0 ≤ C.boundaryKernel p := by + let : Nontrivial Circle := ⟨⟨1, -1, by + intro h + have h' := congrArg (fun z : Circle => (z : ℂ)) h + norm_num at h'⟩⟩ + let : Nontrivial CircleSpace := (AddCircle.homeomorphCircle (T := 1) one_ne_zero).surjective.nontrivial + apply (dense_compl_singleton p.1).induction (P := fun t => 0 ≤ C.boundaryKernel (p.1,t)) + (fun t ht => C.boundaryKernel_off_diagonal hc (by simpa using ht)) + (isClosed_le continuous_const + (C.boundaryKernel.continuous.comp (continuous_const.prodMk continuous_id))) p.2 + +lemma boundaryCorrection_integral_right (w : CircleSpace) : + (∫ t, C.boundaryCorrection (w,t) ∂circleMeasure) = 0 := by + change (∫ t, C.correction (circleCoordinate t)⁻¹ (circleCoordinate w)⁻¹ ∂circleMeasure) = 0 + rw [integral_holomorphic_inverse_circleCoordinate + ((C.differentiableOn_correction_left (C.circle_inverse_mem w)).mono C.closed_unit_subset_reciprocalDisk)] + exact C.correction_zero_left _ + +lemma boundaryCorrection_integral_left (t : CircleSpace) : + (∫ w, C.boundaryCorrection (w,t) ∂circleMeasure) = 0 := by + change (∫ w, C.correction (circleCoordinate t)⁻¹ (circleCoordinate w)⁻¹ ∂circleMeasure) = 0 + rw [integral_holomorphic_inverse_circleCoordinate + ((C.differentiableOn_correction_right (C.circle_inverse_mem t)).mono C.closed_unit_subset_reciprocalDisk)] + exact C.correction_zero_right _ + +lemma boundaryKernel_integral_right (w : CircleSpace) : + (∫ t, C.boundaryKernel (w,t) ∂circleMeasure) = 1 := by + have hi : Integrable (fun t => C.boundaryCorrection (w,t)) circleMeasure := + (C.boundaryCorrection.continuous.comp (continuous_const.prodMk continuous_id)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + change (∫ t, 1 + 2 * (C.boundaryCorrection (w,t)).re ∂circleMeasure) = 1 + have hr : Integrable (fun t => (C.boundaryCorrection (w,t)).re) circleMeasure := hi.re + rw [integral_add (integrable_const (1 : ℝ)) (hr.const_mul 2), integral_const_mul, show (∫ t, (C.boundaryCorrection (w,t)).re ∂circleMeasure) = + (∫ t, C.boundaryCorrection (w,t) ∂circleMeasure).re from Complex.reCLM.integral_comp_comm hi, + C.boundaryCorrection_integral_right, zero_re, mul_zero, add_zero, integral_const] + simp + +lemma boundaryKernel_integral_left (t : CircleSpace) : + (∫ w, C.boundaryKernel (w,t) ∂circleMeasure) = 1 := by + have hi : Integrable (fun w => C.boundaryCorrection (w,t)) circleMeasure := + (C.boundaryCorrection.continuous.comp (continuous_id.prodMk continuous_const)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + change (∫ w, 1 + 2 * (C.boundaryCorrection (w,t)).re ∂circleMeasure) = 1 + have hr : Integrable (fun w => (C.boundaryCorrection (w,t)).re) circleMeasure := hi.re + rw [integral_add (integrable_const (1 : ℝ)) (hr.const_mul 2), integral_const_mul, show (∫ w, (C.boundaryCorrection (w,t)).re ∂circleMeasure) = + (∫ w, C.boundaryCorrection (w,t) ∂circleMeasure).re from Complex.reCLM.integral_comp_comm hi, + C.boundaryCorrection_integral_left, zero_re, mul_zero, add_zero, integral_const] + simp + +def boundaryOperator (hc : Convex ℝ U) (k : ℕ) : BoundaryL2 k →L[ℝ] BoundaryL2 k := + kernelOperator C.boundaryKernel (C.boundaryKernel_nonnegative hc) + C.boundaryKernel_integral_right C.boundaryKernel_integral_left + +lemma norm_boundaryOperator_le (hc : Convex ℝ U) (k : ℕ) : + ‖C.boundaryOperator hc k‖ ≤ 1 := + norm_kernelOperator_le C.boundaryKernel (C.boundaryKernel_nonnegative hc) + C.boundaryKernel_integral_right C.boundaryKernel_integral_left + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryModulus.lean b/lean/OAI/Analysis/Crouzeix/BoundaryModulus.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e5d94a4395b22fa656fe146a85335c4b1c3ea49 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryModulus.lean @@ -0,0 +1,72 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Univalent + +namespace OAI + +/-! Boundary Modulus. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +namespace CrouzeixHilbert.Conformal + +attribute [local instance] Classical.propDecidable + +theorem isCompact_preimage_closedBall {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U (ball 0 1)) + {r : ℝ} (hr : r < 1) : IsCompact (U ∩ f ⁻¹' closedBall 0 r) := by + have hsub : closedBall (0 : ℂ) r ⊆ ball 0 1 := closedBall_subset_ball hr + have hd : DifferentiableOn ℂ (invFunOn f U) (ball 0 1) := + fun w hw => (hasStrictDerivAt_invFunOn hU hf hbij hw).hasDerivAt.differentiableAt.differentiableWithinAt + have he : U ∩ f ⁻¹' closedBall 0 r = invFunOn f U '' closedBall 0 r := by + ext z + constructor + · rintro ⟨hzu, hz⟩ + exact ⟨f z, hz, hbij.invOn_invFunOn.1 hzu⟩ + · rintro ⟨w, hw, rfl⟩ + exact ⟨(hbij.symm hbij.invOn_invFunOn.symm).mapsTo (hsub hw), + by simpa only [mem_preimage, hbij.invOn_invFunOn.2 (hsub hw)] using hw⟩ + rw [he] + exact (isCompact_closedBall 0 r).image_of_continuousOn (hd.continuousOn.mono hsub) + +theorem tendsto_norm_one_at_frontier {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U (ball 0 1)) + {p : ℂ} (hp : p ∈ frontier U) : + Tendsto (fun z => ‖f z‖) (𝓝[U] p) (𝓝 1) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + have hK := isCompact_preimage_closedBall hU hf hbij (sub_lt_self (1 : ℝ) hε) + have hpn : p ∉ U ∩ f ⁻¹' closedBall 0 (1 - ε) := by + intro he + exact hp.2 (hU.interior_eq.symm ▸ he.1) + filter_upwards [Filter.mem_inf_of_left (hK.isClosed.isOpen_compl.mem_nhds hpn), + self_mem_nhdsWithin] with z hz₁ hz₂ + have hsmall : ‖f z‖ < 1 := mem_ball_zero_iff.mp (hbij.mapsTo hz₂) + have hlarge : 1 - ε < ‖f z‖ := by + by_contra h + exact hz₁ ⟨hz₂, mem_closedBall_zero_iff.mpr (le_of_not_gt h)⟩ + rw [Real.dist_eq, abs_of_nonpos (by linarith)] + linarith + +theorem continuousOn_closed_modulus {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U (ball 0 1)) : + ContinuousOn (fun z => if z ∈ U then ‖f z‖ else 1) (closure U) := by + classical + intro p hp + by_cases hpU : p ∈ U + · apply (hf.continuousOn.norm.continuousAt (hU.mem_nhds hpU)).continuousWithinAt.congr_of_eventuallyEq + · filter_upwards [Filter.mem_inf_of_left (hU.mem_nhds hpU)] with z hz + simp only [ite_eq_left hz] + · simp only [ite_eq_left hpU] + · have hpf : p ∈ frontier U := ⟨hp, by simpa only [hU.interior_eq] using hpU⟩ + have ht := tendsto_norm_one_at_frontier hU hf hbij hpf + rw [ContinuousWithinAt, ite_eq_right hpU] + let : DecidablePred U := fun z => Classical.propDecidable _ + exact (ht.mono_left (nhdsWithin_mono p inter_subset_right)).if_nhdsWithin tendsto_const_nhds + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryMoments.lean b/lean/OAI/Analysis/Crouzeix/BoundaryMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae464d0c3dbfe5b905dcaecaaba8dd2eb35ef678 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryMoments.lean @@ -0,0 +1,230 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ResolventMoments + +namespace OAI + +/-! Boundary Moments. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +lemma tensorOperator_smul_exchange + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (A : Operator H) {m : ℕ} (c : ℂ) (B : Coeff m) : + tensorOperator A (c • B) = tensorOperator (c • A) B := by + exact ((tensorCoefficientCLM A m).map_smul c B).trans + ((tensorOperatorCLM B).map_smul c A).symm + +section + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [Nontrivial H] + +lemma matrixHolomorphicEval_scalar (A : Operator H) {V : Set ℂ} (hV : IsOpen V) + (hKV : numericalClosure A ⊆ V) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f V) + {m : ℕ} (B : Coeff m) : + matrixHolomorphicEval A V (fun z => f z • B) = tensorOperator (holomorphicEval A V f) B := by + unfold matrixHolomorphicEval + convert sum_tensorOperator_entries (holomorphicEval A V f) B using 1 + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + congr 1 + simp only [Matrix.smul_apply, smul_eq_mul] + simpa only [mul_comm] using holomorphicEval_smul A hV hKV hf (B i j) + +end + +namespace Boundary + +lemma circleCoordinate_zpow (j : ℤ) (t : CircleSpace) : + (circleCoordinate t)^j = fourier j t := by + cases j with + | ofNat k => exact circleCoordinate_pow k t + | negSucc k => + rw [zpow_negSucc, ← inv_pow, circleCoordinate_inverse_pow] + rfl + +lemma boundaryStar_matrixLaurentMonomial {n : ℕ} (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + boundaryStar (matrixLaurentMonomial a c) = + matrixLaurentMonomial (-a.1, a.2.2, a.2.1) (star c) := by + ext t i j + simp only [boundaryStar_apply, matrixLaurentMonomial, ContinuousMap.coe_mk, + Matrix.conjTranspose_smul, star_mul, Matrix.conjTranspose_single, star_one, + fourier_neg, Complex.star_def, mul_comm] + +lemma tensorOperator_matrixLaurentMonomial + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (T : Operator H) {n : ℕ} (a : ℤ × (Fin n × Fin n)) (c : ℂ) (t : CircleSpace) : + tensorOperator T (matrixLaurentMonomial a c t) = + tensorOperatorCLM (Matrix.single a.2.1 a.2.2 1) + (c • (circleCoordinate t)^a.1 • T) := by + simpa only [matrixLaurentMonomial, ContinuousMap.coe_mk, tensorOperatorCLM_apply, + mul_smul, circleCoordinate_zpow] using + tensorOperator_smul_exchange T (c * fourier a.1 t) (Matrix.single a.2.1 a.2.2 1) + +lemma integral_tensor_star {n : ℕ} (Q : C(CircleSpace, Coeff n)) (F : C(CircleSpace, Coeff n)) : + (∫ t, tensorOperator (matrixOperatorMap n ((Q t)ᴴ)) (F t) ∂circleMeasure) = + (tensorIntegral Q (boundaryStar F)).adjoint := by + rw [tensorIntegral, integral_operator_adjoint] + apply integral_congr_ae + exact Eventually.of_forall fun t => by + dsimp only + rw [← ContinuousLinearMap.star_eq_adjoint, ← tensorOperator_star] + simp only [boundaryStar_apply, Matrix.star_eq_conjTranspose, + Matrix.conjTranspose_conjTranspose, matrixOperatorMap_apply] + congr 1 + exact (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).map_star' (Q t) + +lemma tensorIntegral_add_left {n : ℕ} (P Q F : C(CircleSpace, Coeff n)) : + tensorIntegral (P+Q) F = tensorIntegral P F + tensorIntegral Q F := by + simp only [tensorIntegral, ContinuousMap.add_apply, map_add, + ← tensorOperatorCLM_apply] + exact integral_add (integrable_tensor_field P F) (integrable_tensor_field Q F) + +end Boundary + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +variable {n : ℕ} (A : Operator (EuclideanSpace ℂ (Fin n))) + (hKU : numericalClosure A ⊆ U) (hU : IsOpen U) + +def matrixResolvent : C(CircleSpace, Coeff n) := + ⟨fun t => operatorToMatrix n (C.operatorResolvent A hKU hU t), + (operatorToMatrix n).continuous.comp (C.operatorResolvent A hKU hU).continuous⟩ + +@[simp] lemma matrixResolvent_operator (t : CircleSpace) : + matrixOperatorMap n (C.matrixResolvent A hKU hU t) = C.operatorResolvent A hKU hU t := by + simp only [matrixResolvent, ContinuousMap.coe_mk, matrixOperatorMap_apply, + operatorToMatrix_apply, StarAlgEquiv.apply_symm_apply] + +def matrixResolventDensity : C(CircleSpace, Coeff n) := + C.matrixResolvent A hKU hU + boundaryStar (C.matrixResolvent A hKU hU) + +lemma matrixResolventDensity_posSemidef (hc : Convex ℝ U) (t : CircleSpace) : + (C.matrixResolventDensity A hKU hU t).PosSemidef := by + apply Matrix.nonneg_iff_posSemidef.mp + let e := (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm + let Q := C.operatorResolvent A hKU hU t + have he : e (Q + star Q) = (C.matrixResolventDensity A hKU hU t) := by + rw [map_add] + change e Q + e (star Q) = e Q + star (e Q) + exact congrArg (e Q + ·) (e.map_star' Q) + rw [← he] + exact map_nonneg e (C.operatorResolvent_add_star_nonneg A hKU hU hc t) + +variable [Nonempty (Fin n)] + +include hKU in +lemma matrixHolomorphicEval_physicalRepresentative (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + matrixHolomorphicEval A C.outerDomain (C.physicalRepresentative a c) = + tensorOperator (c • holomorphicEval A C.outerDomain (C.physicalCoefficient a.1)) + (Matrix.single a.2.1 a.2.2 1) := by + rw [show C.physicalRepresentative a c = + (fun z => (c * C.physicalCoefficient a.1 z) • Matrix.single a.2.1 a.2.2 1) from rfl, + matrixHolomorphicEval_scalar A C.isOpen_outerDomain + (hKU.trans (subset_closure.trans C.closure_subset_outerDomain)) + ((C.differentiableOn_physicalCoefficient a.1).const_mul c), + holomorphicEval_smul A C.isOpen_outerDomain + (hKU.trans (subset_closure.trans C.closure_subset_outerDomain)) + (C.differentiableOn_physicalCoefficient a.1)] + +lemma tensorIntegral_matrixResolvent_moment (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + tensorIntegral (C.matrixResolvent A hKU hU) (matrixLaurentMonomial a c) = + matrixHolomorphicEval A C.outerDomain (C.physicalRepresentative a c) := by + let : ContinuousSMul ℂ (EuclideanSpace ℂ (Fin n)) := IsBoundedSMul.continuousSMul + let : CompleteSpace (Operator (EuclideanSpace ℂ (Fin n))) := + ContinuousLinearMap.instCompleteSpace + rw [C.matrixHolomorphicEval_physicalRepresentative A hKU a c] + simp only [tensorIntegral, C.matrixResolvent_operator, + tensorOperator_matrixLaurentMonomial] + have hi : Integrable (fun t => (circleCoordinate t)^a.1 • C.operatorResolvent A hKU hU t) + circleMeasure := + ((circleCoordinate.continuous.zpow₀ a.1 (fun t => Or.inl (circleCoordinate_ne_zero t))).smul + (C.operatorResolvent A hKU hU).continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + refine ((tensorOperatorCLM (H := EuclideanSpace ℂ (Fin n)) + (Matrix.single a.2.1 a.2.2 1)).integral_comp_comm (hi.smul c)).trans ?_ + simp only [Pi.smul_apply, integral_smul, C.integral_operatorResolvent_moment A hKU hU, + tensorOperatorCLM_apply] + +lemma tensorIntegral_matrixResolventDensity (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + tensorIntegral (C.matrixResolventDensity A hKU hU) (matrixLaurentMonomial a c) = + matrixHolomorphicEval A C.outerDomain (C.physicalRepresentative a c) + + (matrixHolomorphicEval A C.outerDomain + (C.physicalRepresentative (-a.1,a.2.2,a.2.1) (star c))).adjoint := by + rw [matrixResolventDensity, tensorIntegral_add_left, + C.tensorIntegral_matrixResolvent_moment A hKU hU] + congr 1 + change (∫ t, tensorOperator (matrixOperatorMap n + ((C.matrixResolvent A hKU hU t)ᴴ)) (matrixLaurentMonomial a c t) ∂circleMeasure) = _ + rw [integral_tensor_star, boundaryStar_matrixLaurentMonomial, + C.tensorIntegral_matrixResolvent_moment A hKU hU] + +variable (R : InteriorCollar U) + +omit [Nonempty (Fin n)] in +lemma tensorIntegral_matrixDensity_trace (D : Operator (EuclideanSpace ℂ (Fin n))) + (hD : spectralRadius ℂ D < 1) {V : Set ℂ} (hUV : closure U ⊆ V) + (F : ℂ → Coeff n) (hF : ContinuousOn F V) : + tensorIntegral (C.matrixDensity R D hD) (C.matrixAnalyticTrace hUV F hF) = + ∫ t, tensorOperator (C.operatorDensity R D hD t) (F (C.boundaryMap t)) ∂circleMeasure := by + simp only [tensorIntegral, matrixDensity, matrixAnalyticTrace, ContinuousMap.coe_mk, + matrixOperatorMap_apply, operatorToMatrix_apply, StarAlgEquiv.apply_symm_apply] + +include hKU hU in +lemma physical_channel_intertwines (hc : Convex ℝ U) + (D S : Operator (EuclideanSpace ℂ (Fin n))) + (hN : ‖D‖ ≤ 1) (hD : spectralRadius ℂ D < 1) + (hI : S * holomorphicEval A R.domain R.f = D * S) + (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + tensorOperator S (1 : Coeff n) * + matrixHolomorphicEval A C.outerDomain (C.physicalRepresentative a c) = + tensorIntegral (C.matrixDensity R D hD) (c • C.physicalChannel a) * + tensorOperator S (1 : Coeff n) := by + rw [← C.physicalRepresentative_trace a c, + C.tensorIntegral_matrixDensity_trace R D hD] + exact C.physical_intertwines R hU hc A D S hKU hN hD hI + C.isOpen_outerDomain C.closure_subset_outerDomain (C.physicalRepresentative_holomorphic a c) + +lemma physical_laurent_tests (hc : Convex ℝ U) + (D S : Operator (EuclideanSpace ℂ (Fin n))) + (hN : ‖D‖ ≤ 1) (hD : spectralRadius ℂ D < 1) + (hI : S * holomorphicEval A R.domain R.f = D * S) + (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + ∃ (V W : C(CircleSpace, Coeff n)) + (B L : Operator (Amplification (EuclideanSpace ℂ (Fin n)) n)), + boundaryCauchy (C.boundaryOperator hc n) (boundaryField (matrixLaurentMonomial a c)) = boundaryField V ∧ + boundaryCauchy (C.boundaryOperator hc n) (lpStar (boundaryField (matrixLaurentMonomial a c))) = boundaryField W ∧ + tensorIntegral (C.matrixResolventDensity A hKU hU) (matrixLaurentMonomial a c) = B + L.adjoint ∧ + tensorOperator S (1 : Coeff n) * B = + tensorIntegral (C.matrixDensity R D hD) V * tensorOperator S (1 : Coeff n) ∧ + tensorOperator S (1 : Coeff n) * L = + tensorIntegral (C.matrixDensity R D hD) W * tensorOperator S (1 : Coeff n) := by + refine ⟨c • C.physicalChannel a, star c • C.physicalChannel (-a.1,a.2.2,a.2.1), + matrixHolomorphicEval A C.outerDomain (C.physicalRepresentative a c), + matrixHolomorphicEval A C.outerDomain (C.physicalRepresentative (-a.1,a.2.2,a.2.1) (star c)), + C.boundaryCauchy_matrixLaurentMonomial hU hc a c, ?_, + C.tensorIntegral_matrixResolventDensity A hKU hU a c, + C.physical_channel_intertwines A hKU hU R hc D S hN hD hI a c, + C.physical_channel_intertwines A hKU hU R hc D S hN hD hI _ _⟩ + rw [← boundaryField_star, boundaryStar_matrixLaurentMonomial] + exact C.boundaryCauchy_matrixLaurentMonomial hU hc _ _ + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryOperators.lean b/lean/OAI/Analysis/Crouzeix/BoundaryOperators.lean new file mode 100644 index 0000000000000000000000000000000000000000..f22dd9ae7583b708ab99833411aec592964fcee2 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryOperators.lean @@ -0,0 +1,307 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Fourier + +namespace OAI + +/-! Boundary Operators. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace + +namespace CrouzeixHilbert.Boundary + +local instance boundaryOperatorsFactOnePos : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +lemma norm_integral_weight_sq_le {α E : Type*} [MeasurableSpace α] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + {μ : Measure α} (w : α → ℝ) (u : α → E) + (hw0 : ∀ᵐ t ∂μ, 0 ≤ w t) (hw : Integrable w μ) + (hwu : Integrable (fun t => w t • u t) μ) + (hwu2 : Integrable (fun t => w t * ‖u t‖ ^ 2) μ) + (hw1 : ∫ t, w t ∂μ = 1) : + ‖∫ t, w t • u t ∂μ‖ ^ 2 ≤ ∫ t, w t * ‖u t‖ ^ 2 ∂μ := by + let v := ∫ t, w t • u t ∂μ + have hi := integral_mono_ae (((hwu.const_inner v)).const_mul 2) + ((hw.mul_const (‖v‖ ^ 2)).add hwu2) (hw0.mono fun t ht => by + simp only [Pi.add_apply, real_inner_smul_right] + have h := sq_nonneg ‖v - u t‖ + rw [norm_sub_sq_real] at h + nlinarith [mul_nonneg ht h]) + have hv : ∫ t, ⟪v, w t • u t⟫_ℝ ∂μ = ‖v‖ ^ 2 := by + rw [integral_inner hwu v] + exact real_inner_self_eq_norm_sq v + simp only [Pi.add_apply] at hi + rw [integral_const_mul, hv, integral_add (hw.mul_const _) hwu2, + integral_mul_const, hw1, one_mul] at hi + linarith + +abbrev CircleKernel := C(CircleSpace × CircleSpace, ℝ) + +def kernelApply {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) (x : CircleSpace) : HS k := + ∫ y, m (x,y) • u y ∂circleMeasure + +lemma boundaryLp_integrable {k : ℕ} (u : BoundaryL2 k) : Integrable u circleMeasure := + (Lp.memLp u).integrable (by norm_num) + +lemma kernel_integrable {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) (x : CircleSpace) : + Integrable (fun y => m (x,y) • u y) circleMeasure := by + have hm : AEStronglyMeasurable (fun y => m (x,y)) circleMeasure := + (m.continuous.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable + change Integrable ((fun y => m (x,y)) • (u : CircleSpace → HS k)) circleMeasure + exact Integrable.bdd_smul (𝕜 := ℝ) (boundaryLp_integrable u) ‖m‖ hm + (Filter.Eventually.of_forall fun y => m.norm_coe_le_norm (x,y)) + +lemma kernel_sq_integrable {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) (x : CircleSpace) : + Integrable (fun y => m (x,y) * ‖u y‖ ^ 2) circleMeasure := by + have hm : AEStronglyMeasurable (fun y => m (x,y)) circleMeasure := + (m.continuous.comp (continuous_const.prodMk continuous_id)).aestronglyMeasurable + exact ((Lp.memLp u).norm.integrable_sq).bdd_mul hm + (Filter.Eventually.of_forall fun y => m.norm_coe_le_norm (x,y)) + +lemma continuous_kernelApply {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) : + Continuous (kernelApply m u) := by + apply continuous_of_dominated (bound := fun y => ‖m‖ * ‖u y‖) + · intro x + exact (kernel_integrable m u x).aestronglyMeasurable + · intro x + exact Filter.Eventually.of_forall fun y => by + rw [norm_smul] + exact mul_le_mul_of_nonneg_right (m.norm_coe_le_norm (x,y)) (norm_nonneg _) + · exact (boundaryLp_integrable u).norm.const_mul _ + · exact Filter.Eventually.of_forall fun y => + (m.continuous.comp (continuous_id.prodMk continuous_const)).smul continuous_const + +def kernelLp {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) : BoundaryL2 k := + ContinuousMap.toLp 2 circleMeasure ℝ ⟨kernelApply m u, continuous_kernelApply m u⟩ + +lemma kernelLp_apply_ae {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) : + kernelLp m u =ᵐ[circleMeasure] kernelApply m u := ContinuousMap.coeFn_toLp _ _ + +lemma norm_kernelApply_sq_le {k : ℕ} (m : CircleKernel) + (hm : ∀ x, 0 ≤ m x) (hm1 : ∀ x, ∫ y, m (x,y) ∂circleMeasure = 1) + (u : BoundaryL2 k) (x : CircleSpace) : + ‖kernelApply m u x‖ ^ 2 ≤ ∫ y, m (x,y) * ‖u y‖ ^ 2 ∂circleMeasure := by + apply norm_integral_weight_sq_le (μ := circleMeasure) (fun y => m (x,y)) u + (Filter.Eventually.of_forall fun y => hm (x,y)) + · exact (m.continuous.comp (continuous_const.prodMk continuous_id)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · exact kernel_integrable m u x + · exact kernel_sq_integrable m u x + · exact hm1 x + +lemma kernel_sq_integrable_prod {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) : + Integrable (fun z : CircleSpace × CircleSpace => m z * ‖u z.2‖ ^ 2) + (circleMeasure.prod circleMeasure) := + (((Lp.memLp u).norm.integrable_sq).comp_snd circleMeasure).bdd_mul + m.continuous.aestronglyMeasurable (Filter.Eventually.of_forall m.norm_coe_le_norm) + +lemma norm_kernelLp_le {k : ℕ} (m : CircleKernel) + (hm : ∀ x, 0 ≤ m x) (hm1 : ∀ x, ∫ y, m (x,y) ∂circleMeasure = 1) + (hm2 : ∀ y, ∫ x, m (x,y) ∂circleMeasure = 1) (u : BoundaryL2 k) : + ‖kernelLp m u‖ ≤ ‖u‖ := by + have hs : ‖kernelLp m u‖ ^ 2 ≤ ‖u‖ ^ 2 := calc + _ = ∫ x, ‖kernelLp m u x‖ ^ 2 ∂circleMeasure := lp_norm_sq_eq_integral _ + _ ≤ ∫ x, ∫ y, m (x,y) * ‖u y‖ ^ 2 ∂circleMeasure ∂circleMeasure := by + apply integral_mono_ae ((Lp.memLp (kernelLp m u)).norm.integrable_sq) + (kernel_sq_integrable_prod m u).integral_prod_left + filter_upwards [kernelLp_apply_ae m u] with x hx + rw [hx] + exact norm_kernelApply_sq_le m hm hm1 u x + _ = ∫ y, ∫ x, m (x,y) * ‖u y‖ ^ 2 ∂circleMeasure ∂circleMeasure := + integral_integral_swap (kernel_sq_integrable_prod m u) + _ = ∫ y, ‖u y‖ ^ 2 ∂circleMeasure := by + apply integral_congr_ae + exact Filter.Eventually.of_forall fun y => by + change (∫ x, m (x,y) * ‖u y‖ ^ 2 ∂circleMeasure) = ‖u y‖ ^ 2 + rw [integral_mul_const, hm2, one_mul] + _ = ‖u‖ ^ 2 := (lp_norm_sq_eq_integral _).symm + exact (sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)).mp hs + +lemma kernelLp_add {k : ℕ} (m : CircleKernel) (u v : BoundaryL2 k) : + kernelLp m (u + v) = kernelLp m u + kernelLp m v := by + apply Lp.ext + filter_upwards [kernelLp_apply_ae m (u+v), kernelLp_apply_ae m u, kernelLp_apply_ae m v, + Lp.coeFn_add (kernelLp m u) (kernelLp m v)] with x huv hu hv hsum + simp only [huv, hsum, Pi.add_apply, hu, hv] + simp only [kernelApply] + calc + _ = ∫ y, m (x,y) • u y + m (x,y) • v y ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_add u v] with y hy + simp only [hy, Pi.add_apply, smul_add] + _ = _ := integral_add (kernel_integrable m u x) (kernel_integrable m v x) + +lemma kernelLp_smul {k : ℕ} (m : CircleKernel) (c : ℝ) (u : BoundaryL2 k) : + kernelLp m (c • u) = c • kernelLp m u := by + apply Lp.ext + filter_upwards [kernelLp_apply_ae m (c • u), kernelLp_apply_ae m u, + Lp.coeFn_smul c (kernelLp m u)] with x hcu hu hsmul + simp only [hcu, hsmul, Pi.smul_apply, hu] + simp only [kernelApply] + calc + _ = ∫ y, c • (m (x,y) • u y) ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul c u] with y hy + rw [hy] + change m (x,y) • (c • u y) = c • (m (x,y) • u y) + exact smul_comm _ _ _ + _ = _ := integral_smul c _ + +def kernelOperator {k : ℕ} (m : CircleKernel) + (hm : ∀ x, 0 ≤ m x) (hm1 : ∀ x, ∫ y, m (x,y) ∂circleMeasure = 1) + (hm2 : ∀ y, ∫ x, m (x,y) ∂circleMeasure = 1) : + BoundaryL2 k →L[ℝ] BoundaryL2 k := + ({ toFun := kernelLp m + map_add' := kernelLp_add m + map_smul' := kernelLp_smul m } : BoundaryL2 k →ₗ[ℝ] BoundaryL2 k).mkContinuous 1 + (fun u => by + change ‖kernelLp m u‖ ≤ 1 * ‖u‖ + simpa only [one_mul] using norm_kernelLp_le m hm hm1 hm2 u) + +lemma norm_kernelOperator_le {k : ℕ} (m : CircleKernel) + (hm : ∀ x, 0 ≤ m x) (hm1 : ∀ x, ∫ y, m (x,y) ∂circleMeasure = 1) + (hm2 : ∀ y, ∫ x, m (x,y) ∂circleMeasure = 1) : + ‖kernelOperator (k := k) m hm hm1 hm2‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro u + change ‖kernelLp m u‖ ≤ 1 * ‖u‖ + simpa only [one_mul] using norm_kernelLp_le m hm hm1 hm2 u + +def transposeKernel (m : CircleKernel) : CircleKernel := + ⟨fun z => m z.swap, m.continuous.comp continuous_swap⟩ + +@[simp] lemma transposeKernel_apply (m : CircleKernel) (x y : CircleSpace) : + transposeKernel m (x,y) = m (y,x) := rfl + +@[simp] lemma transposeKernel_transposeKernel (m : CircleKernel) : + transposeKernel (transposeKernel m) = m := by + ext z + rfl + +lemma kernel_inner_integrable {k : ℕ} (m : CircleKernel) (u v : BoundaryL2 k) : + Integrable (fun z : CircleSpace × CircleSpace => m z * ⟪u z.2, v z.1⟫_ℝ) + (circleMeasure.prod circleMeasure) := by + have hints : Integrable (fun z : CircleSpace × CircleSpace => + ‖v z.1‖ * ‖u z.2‖) (circleMeasure.prod circleMeasure) := + (boundaryLp_integrable v).norm.mul_prod (boundaryLp_integrable u).norm + have hinner : Integrable (fun z : CircleSpace × CircleSpace => ⟪u z.2, v z.1⟫_ℝ) + (circleMeasure.prod circleMeasure) := hints.mono' + (((Lp.aestronglyMeasurable u).comp_snd).inner ((Lp.aestronglyMeasurable v).comp_fst)) + (Filter.Eventually.of_forall fun z => by + simpa only [mul_comm] using norm_inner_le_norm (𝕜 := ℝ) (u z.2) (v z.1)) + exact hinner.bdd_mul m.continuous.aestronglyMeasurable + (Filter.Eventually.of_forall m.norm_coe_le_norm) + +lemma inner_kernelLp {k : ℕ} (m : CircleKernel) (u v : BoundaryL2 k) : + ⟪kernelLp m u, v⟫_ℝ = + ∫ x, ∫ y, m (x,y) * ⟪u y,v x⟫_ℝ ∂circleMeasure ∂circleMeasure := by + rw [L2.inner_def] + apply integral_congr_ae + filter_upwards [kernelLp_apply_ae m u] with x hx + rw [hx] + change ⟪∫ y, m (x,y) • u y ∂circleMeasure, v x⟫_ℝ = _ + calc + _ = ⟪v x, ∫ y, m (x,y) • u y ∂circleMeasure⟫_ℝ := real_inner_comm _ _ + _ = ∫ y, ⟪v x, m (x,y) • u y⟫_ℝ ∂circleMeasure := + (integral_inner (kernel_integrable m u x) _).symm + _ = _ := by + apply integral_congr_ae + exact Filter.Eventually.of_forall fun y => by + change ⟪v x, m (x,y) • u y⟫_ℝ = m (x,y) * ⟪u y,v x⟫_ℝ + rw [real_inner_smul_right, real_inner_comm] + +lemma inner_kernelLp_swap {k : ℕ} (m : CircleKernel) (u v : BoundaryL2 k) : + ⟪kernelLp m u, v⟫_ℝ = ⟪u, kernelLp (transposeKernel m) v⟫_ℝ := by + conv_rhs => rw [real_inner_comm] + rw [inner_kernelLp, inner_kernelLp] + calc + _ = ∫ y, ∫ x, m (x,y) * ⟪u y,v x⟫_ℝ ∂circleMeasure ∂circleMeasure := + integral_integral_swap (kernel_inner_integrable m u v) + _ = _ := by + apply integral_congr_ae + exact Filter.Eventually.of_forall fun y => by + apply integral_congr_ae + exact Filter.Eventually.of_forall fun x => by + change m (x,y) * ⟪u y,v x⟫_ℝ = transposeKernel m (y,x) * ⟪v x,u y⟫_ℝ + rw [transposeKernel_apply, real_inner_comm] + +lemma adjoint_kernelOperator {k : ℕ} (m : CircleKernel) + (hm : ∀ x, 0 ≤ m x) (hm1 : ∀ x, ∫ y, m (x,y) ∂circleMeasure = 1) + (hm2 : ∀ y, ∫ x, m (x,y) ∂circleMeasure = 1) : + ContinuousLinearMap.adjoint (kernelOperator (k := k) m hm hm1 hm2) = + kernelOperator (transposeKernel m) (fun z => hm z.swap) hm2 hm1 := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + change ⟪kernelLp (transposeKernel m) u,v⟫_ℝ = ⟪u,kernelLp m v⟫_ℝ + simpa only [transposeKernel_transposeKernel] using inner_kernelLp_swap (transposeKernel m) u v + +lemma kernelLp_star {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) : + kernelLp m (lpStar u) = lpStar (kernelLp m u) := by + apply Lp.ext + filter_upwards [kernelLp_apply_ae m (lpStar u), lpStar_apply_ae (kernelLp m u), + kernelLp_apply_ae m u] with x hmu hstar hu + rw [hmu, hstar, hu] + change (∫ y, m (x,y) • lpStar u y ∂circleMeasure) = + hsStar k (∫ y, m (x,y) • u y ∂circleMeasure) + calc + _ = ∫ y, hsStar k (m (x,y) • u y) ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [lpStar_apply_ae u] with y hy + rw [hy, map_smul] + rfl + _ = _ := (hsStar k).toContinuousLinearMap.integral_comp_comm (kernel_integrable m u x) + +lemma kernel_integrable_prod {k : ℕ} (m : CircleKernel) (u : BoundaryL2 k) : + Integrable (fun z : CircleSpace × CircleSpace => m z • u z.2) + (circleMeasure.prod circleMeasure) := by + change Integrable ((m : CircleSpace × CircleSpace → ℝ) • (fun z : CircleSpace × CircleSpace => u z.2)) + (circleMeasure.prod circleMeasure) + exact Integrable.bdd_smul (𝕜 := ℝ) ((boundaryLp_integrable u).comp_snd circleMeasure) + ‖m‖ m.continuous.aestronglyMeasurable (Filter.Eventually.of_forall m.norm_coe_le_norm) + +lemma integral_kernelLp {k : ℕ} (m : CircleKernel) + (hm2 : ∀ y, ∫ x, m (x,y) ∂circleMeasure = 1) (u : BoundaryL2 k) : + (∫ x, kernelLp m u x ∂circleMeasure) = ∫ y, u y ∂circleMeasure := by + calc + _ = ∫ x, ∫ y, m (x,y) • u y ∂circleMeasure ∂circleMeasure := + integral_congr_ae (kernelLp_apply_ae m u) + _ = ∫ y, ∫ x, m (x,y) • u y ∂circleMeasure ∂circleMeasure := + integral_integral_swap (kernel_integrable_prod m u) + _ = _ := by + apply integral_congr_ae + exact Filter.Eventually.of_forall fun y => by + change (∫ x, m (x,y) • u y ∂circleMeasure) = u y + rw [integral_smul_const, hm2, one_smul] + +lemma matrixMean_eq_integral {k : ℕ} (u : BoundaryL2 k) : + matrixMean u = ofHS (∫ t, u t ∂circleMeasure) := by + ext i j + let L : HS k →L[ℂ] ℂ := PiLp.proj 2 (fun _ : Fin k × Fin k => ℂ) (i,j) + exact L.integral_comp_comm (boundaryLp_integrable u) + +lemma matrixMean_kernelLp {k : ℕ} (m : CircleKernel) + (hm2 : ∀ y, ∫ x, m (x,y) ∂circleMeasure = 1) (u : BoundaryL2 k) : + matrixMean (kernelLp m u) = matrixMean u := by + rw [matrixMean_eq_integral, integral_kernelLp m hm2, matrixMean_eq_integral] + +lemma kernelLp_const {k : ℕ} (m : CircleKernel) + (hm1 : ∀ x, ∫ y, m (x,y) ∂circleMeasure = 1) (u : BoundaryL2 k) (v : HS k) + (hu : u =ᵐ[circleMeasure] fun _ => v) : kernelLp m u = u := by + apply Lp.ext + filter_upwards [kernelLp_apply_ae m u, hu] with x hmu hx + rw [hmu, hx] + change (∫ y, m (x,y) • u y ∂circleMeasure) = v + calc + _ = ∫ y, m (x,y) • v ∂circleMeasure := + integral_congr_ae (hu.mono fun y hy => by rw [hy]) + _ = v := by rw [integral_smul_const, hm1, one_smul] + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/BoundaryPatching.lean b/lean/OAI/Analysis/Crouzeix/BoundaryPatching.lean new file mode 100644 index 0000000000000000000000000000000000000000..162fc108c056cb46721a24933bd5cfa3418a59ff --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/BoundaryPatching.lean @@ -0,0 +1,106 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryChart + +namespace OAI + +/-! Boundary Patching. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +theorem extension_eqOn_lens {U : Set ℂ} (hU : IsOpen U) {f g₁ g₂ : ℂ → ℂ} + {p q : ℂ} (hp : p ∈ closure U) (hq : q ∈ closure U) + {r s : ℝ} (hr : 0 < r) (hs : 0 < s) + (hg₁ : AnalyticOnNhd ℂ g₁ (ball p r)) (hg₂ : AnalyticOnNhd ℂ g₂ (ball q s)) + (he₁ : EqOn g₁ f (U ∩ ball p r)) (he₂ : EqOn g₂ f (U ∩ ball q s)) + (hover : (ball p (r / 3) ∩ ball q (s / 3)).Nonempty) : + EqOn g₁ g₂ (ball p r ∩ ball q s) := by + let L := ball p r ∩ ball q s + have hL : IsOpen L := isOpen_ball.inter isOpen_ball + have hLU : (L ∩ U).Nonempty := by + obtain ⟨z, hzp, hzq⟩ := hover + have hpq : dist p q < (r + s) / 3 := by + have h := dist_triangle p z q + rw [dist_comm p z] at h + have := mem_ball.mp hzp + have := mem_ball.mp hzq + linarith + rcases le_total s r with hsr | hrs + · have hqL : q ∈ L := ⟨by rw [mem_ball, dist_comm]; linarith, mem_ball_self hs⟩ + exact (mem_closure_iff_nhds.mp hq) L (hL.mem_nhds hqL) + · have hpL : p ∈ L := ⟨mem_ball_self hr, by rw [mem_ball]; linarith⟩ + exact (mem_closure_iff_nhds.mp hp) L (hL.mem_nhds hpL) + obtain ⟨z, hzL, hzU⟩ := hLU + apply (hg₁.mono inter_subset_left).eqOn_of_preconnected_of_eventuallyEq + (hg₂.mono inter_subset_right) ((convex_ball _ _).inter (convex_ball _ _)).isPreconnected hzL + filter_upwards [(hL.inter hU).mem_nhds ⟨hzL, hzU⟩] with w hw + exact (he₁ ⟨hw.2, hw.1.1⟩).trans (he₂ ⟨hw.2, hw.1.2⟩).symm + +theorem exists_extension_to_closure {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U (ball 0 1)) + (hchart : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) : + ∃ (V : Set ℂ) (g : ℂ → ℂ), IsOpen V ∧ closure U ⊆ V ∧ + AnalyticOnNhd ℂ g V ∧ EqOn g f U ∧ + (∀ p ∈ closure U, deriv g p ≠ 0) ∧ (∀ p ∈ frontier U, ‖g p‖ = 1) := by + have hl : ∀ p : frontier U, ∃ (r : ℝ) (g : ℂ → ℂ), 0 < r ∧ + AnalyticOnNhd ℂ g (ball (p : ℂ) r) ∧ EqOn g f (U ∩ ball (p : ℂ) r) ∧ deriv g p ≠ 0 := + fun p => exists_extension_at_boundary hU hf hbij p.property (hchart p p.property).some + choose r G hr hGa hGe hGd using hl + let B : frontier U → Set ℂ := fun p => ball (p : ℂ) (r p / 3) + have hBsub : ∀ p, B p ⊆ ball (p : ℂ) (r p) := fun p => + ball_subset_ball (by have := hr p; linarith) + let V := U ∪ ⋃ p, B p + let g : ℂ → ℂ := fun z => if z ∈ U then f z else + if h : ∃ p : frontier U, z ∈ B p then G h.choose z else 0 + have hgu : EqOn g f U := by intro z hz; simp only [g, ite_eq_left hz] + have hgb : ∀ p, EqOn g (G p) (B p) := by + intro p z hz + by_cases hzu : z ∈ U + · exact (hgu hzu).trans (hGe p ⟨hzu, hBsub p hz⟩).symm + · have h : ∃ q : frontier U, z ∈ B q := ⟨p, hz⟩ + simp only [g, ite_eq_right hzu, dite_eq_left h] + exact extension_eqOn_lens hU h.choose.property.1 p.property.1 + (hr h.choose) (hr p) (hGa h.choose) (hGa p) (hGe h.choose) (hGe p) + ⟨z, h.choose_spec, hz⟩ ⟨hBsub h.choose h.choose_spec, hBsub p hz⟩ + have hVo : IsOpen V := hU.union (isOpen_iUnion (fun _ => isOpen_ball)) + have hUV : closure U ⊆ V := by + intro z hz + by_cases hzu : z ∈ U + · exact Or.inl hzu + · let p : frontier U := ⟨z, hz, by simpa only [hU.interior_eq] using hzu⟩ + exact Or.inr (mem_iUnion.mpr ⟨p, mem_ball_self (by have := hr p; positivity)⟩) + have hga : AnalyticOnNhd ℂ g V := by + intro z hz + rcases hz with hzU | hzB + · exact ((hf.analyticOnNhd hU) z hzU).congr + (hgu.eventuallyEq_of_mem (hU.mem_nhds hzU)).symm + · obtain ⟨p, hp⟩ := mem_iUnion.mp hzB + exact (hGa p z (hBsub p hp)).congr + ((hgb p).eventuallyEq_of_mem (isOpen_ball.mem_nhds hp)).symm + refine ⟨V, g, hVo, hUV, hga, hgu, ?_, ?_⟩ + · intro z hz + by_cases hzU : z ∈ U + · rw [(hgu.eventuallyEq_of_mem (hU.mem_nhds hzU)).deriv_eq] + exact deriv_ne_zero_of_injOn hU hf hbij.injOn hzU + · let p : frontier U := ⟨z, hz, by simpa only [hU.interior_eq] using hzU⟩ + have hn : B p ∈ 𝓝 z := ball_mem_nhds z (by have := hr p; positivity) + rw [((hgb p).eventuallyEq_of_mem hn).deriv_eq] + exact hGd p + · intro p hp + have : NeBot (𝓝[U] p) := mem_closure_iff_nhdsWithin_neBot.mp hp.1 + apply tendsto_nhds_unique ((hga p (hUV hp.1)).continuousAt.norm.tendsto.mono_left + (nhdsWithin_le_nhds : 𝓝[U] p ≤ 𝓝 p)) + apply (tendsto_norm_one_at_frontier hU hf hbij hp).congr' + filter_upwards [self_mem_nhdsWithin] with z hz + exact congrArg norm (hgu hz).symm + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/CauchyProjection.lean b/lean/OAI/Analysis/Crouzeix/CauchyProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..6279d11ac9965e71a5510e6e8429a117a29e84ea --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/CauchyProjection.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryFibers + +namespace OAI + +/-! Cauchy Projection. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace TensorProduct Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +section Tensor + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +def tensorBilinearCLM (m : ℕ) : Operator H →L[ℂ] Coeff m →L[ℂ] Operator (Amplification H m) := by + let L : Operator H →ₗ[ℂ] Coeff m →L[ℂ] Operator (Amplification H m) := { + toFun A := tensorCoefficientCLM A m + map_add' A D := by + ext B v + exact congrArg (fun T : Operator (Amplification H m) => T v) + ((tensorOperatorCLM B).map_add A D) + map_smul' c A := by + ext B v + exact congrArg (fun T : Operator (Amplification H m) => T v) + ((tensorOperatorCLM B).map_smul c A) } + refine LinearMap.mkContinuous (𝕜 := ℂ) (𝕜₂ := ℂ) + (E := Operator H) (F := Coeff m →L[ℂ] Operator (Amplification H m)) L 1 fun A => ?_ + rw [one_mul] + exact ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg A) + (fun B => norm_tensorOperator_le A B) + +@[simp] theorem tensorBilinearCLM_apply (m : ℕ) (A : Operator H) (B : Coeff m) : + tensorBilinearCLM m A B = tensorOperator A B := rfl + +end Tensor + +section OperatorIntegral + +variable {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +theorem inner_integral_operator_apply (T : α → E →L[ℂ] E) + (hT : Integrable T μ) (x y : E) : + ⟪y, (∫ t, T t ∂μ) x⟫_ℂ = ∫ t, ⟪y, T t x⟫_ℂ ∂μ := by + rw [ContinuousLinearMap.integral_apply hT] + have hf : Integrable (fun t => T t x) μ := + (ContinuousLinearMap.apply ℂ _ x).integrable_comp hT + exact (integral_inner (𝕜 := ℂ) hf y).symm + +end OperatorIntegral + +namespace Boundary + +def boundaryField {n : ℕ} (U : C(CircleSpace, Coeff n)) : BoundaryL2 n := + ContinuousMap.toLp 2 circleMeasure ℂ + ⟨fun t => toHS (U t), (toHSCLM n).continuous.comp U.continuous⟩ + +theorem boundaryField_apply_ae {n : ℕ} (U : C(CircleSpace, Coeff n)) : + boundaryField U =ᵐ[circleMeasure] fun t => toHS (U t) := + ContinuousMap.coeFn_toLp _ _ + +theorem integrable_tensor_field {n : ℕ} (E U : C(CircleSpace, Coeff n)) : + Integrable (fun t => tensorOperator (matrixOperatorMap n (E t)) (U t)) circleMeasure := by + have hc : Continuous (fun t => tensorOperator (matrixOperatorMap n (E t)) (U t)) := + ((tensorBilinearCLM n).continuous.comp + ((matrixOperatorMap n).continuous.comp E.continuous)).clm_apply U.continuous + exact hc.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +theorem densityLp_inner_boundaryField {n : ℕ} (E U : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).IsHermitian) (X Y : Coeff n) : + ⟪densityLp E X Y, boundaryField U⟫_ℂ = + ⟪vectorization Y, (∫ t, tensorOperator (matrixOperatorMap n (E t)) (U t) + ∂circleMeasure) (vectorization X)⟫_ℂ := by + rw [inner_integral_operator_apply _ (integrable_tensor_field E U), L2.inner_def] + apply integral_congr_ae + filter_upwards [densityLp_apply_ae E X Y, boundaryField_apply_ae U] with t he hu + rw [he, hu] + exact weightedPartialTrace_testing (E t) (hE t) X Y (U t) + +def matrixLaurentMonomial {n : ℕ} (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + C(CircleSpace, Coeff n) := + ⟨fun t => (c * fourier a.1 t) • Matrix.single a.2.1 a.2.2 (1 : ℂ), + (continuous_const.mul (fourier a.1).continuous).smul continuous_const⟩ + +theorem toHS_single {n : ℕ} (i j : Fin n) : + toHS (Matrix.single i j (1 : ℂ)) = EuclideanSpace.single (i,j) (1 : ℂ) := by + ext ⟨a,b⟩ + change (Matrix.single i j (1 : ℂ)) a b = _ + simp only [Matrix.single_apply, PiLp.single_apply] + by_cases hai : a = i <;> by_cases hbj : b = j <;> simp [hai, hbj, Prod.ext_iff, eq_comm] + +@[simp] theorem boundaryField_matrixLaurentMonomial {n : ℕ} + (a : ℤ × (Fin n × Fin n)) (c : ℂ) : + boundaryField (matrixLaurentMonomial a c) = c • matrixFourier a := by + apply Lp.ext + filter_upwards [boundaryField_apply_ae (matrixLaurentMonomial a c), + matrixFourier_apply_ae a, Lp.coeFn_smul c (matrixFourier a)] with t hu hf hs + rw [hu, hs, Pi.smul_apply, hf] + change toHS ((c * fourier a.1 t) • Matrix.single a.2.1 a.2.2 (1 : ℂ)) = _ + rw [← toHSCLM_apply, map_smul, toHSCLM_apply, toHS_single, mul_smul] + +theorem boundary_real_inner_eq_re {n : ℕ} (u v : BoundaryL2 n) : + ⟪u, v⟫_ℝ = (⟪u, v⟫_ℂ).re := boundary_real_inner u v + +theorem eq_of_inner_matrixLaurentMonomial {n : ℕ} {u v : BoundaryL2 n} + (h : ∀ (a : ℤ × (Fin n × Fin n)) (c : ℂ), + ⟪u, boundaryField (matrixLaurentMonomial a c)⟫_ℝ = + ⟪v, boundaryField (matrixLaurentMonomial a c)⟫_ℝ) : u = v := by + apply (matrixFourierBasis n).repr.injective + ext a + simp only [HilbertBasis.repr_apply_apply, matrixFourierBasis_apply] + rw [← inner_conj_symm (matrixFourier a) u, ← inner_conj_symm (matrixFourier a) v] + congr 1 + apply Complex.ext + · have hr := h a 1 + simpa only [boundaryField_matrixLaurentMonomial, one_smul, + boundary_real_inner_eq_re] using hr + · have hi := h a Complex.I + simp only [boundaryField_matrixLaurentMonomial, boundary_real_inner_eq_re, + inner_smul_right, Complex.mul_re, Complex.I_re, Complex.I_im, zero_mul, + one_mul, zero_sub] at hi + exact neg_injective hi + +end Boundary + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/CircleAnalytic.lean b/lean/OAI/Analysis/Crouzeix/CircleAnalytic.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb5c25418fc1e3a025f05edf7a2982e438f44bce --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/CircleAnalytic.lean @@ -0,0 +1,141 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CauchyProjection +import OAI.Analysis.Crouzeix.CircleCoordinate +import OAI.Analysis.Crouzeix.SeparateHolomorphic + +namespace OAI + +/-! Circle Analytic. -/ + +noncomputable section + +open Set Metric Filter Topology Complex ComplexConjugate MeasureTheory + +open scoped InnerProductSpace + +namespace CrouzeixHilbert.Boundary + +local instance circleAnalyticFactZeroLtOne : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +lemma integral_circleMeasure_eq_interval {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] (f : CircleSpace → E) : + (∫ t, f t ∂circleMeasure) = ∫ t in (0 : ℝ)..1, f (t : CircleSpace) := by + rw [AddCircle.integral_haarAddCircle, ← AddCircle.intervalIntegral_preimage 1 0] + simp only [inv_one, one_smul, zero_add] + +lemma differentiableOn_parameter_circleIntegral {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] {V : Set ℂ} (hV : IsOpen V) + {f : ℂ → CircleSpace → E} + (hf : ContinuousOn (Function.uncurry f) (V ×ˢ univ)) + (hd : ∀ t, DifferentiableOn ℂ (fun z => f z t) V) : + DifferentiableOn ℂ (fun z => ∫ t, f z t ∂circleMeasure) V := by + simp_rw [integral_circleMeasure_eq_interval] + apply differentiableOn_parameter_intervalIntegral hV + · exact hf.comp (f := fun p : ℂ × ℝ => (p.1,(p.2 : CircleSpace))) + (continuous_fst.prodMk ((AddCircle.continuous_mk' (1 : ℝ)).comp continuous_snd)).continuousOn + (fun p hp => ⟨hp.1, mem_univ _⟩) + · exact fun t _ => hd (t : CircleSpace) + +@[simp] lemma circleCoordinate_pow (n : ℕ) (t : CircleSpace) : + (circleCoordinate t)^n = fourier (n : ℤ) t := by + induction n with + | zero => simp + | succ n ih => rw [pow_succ, ih, Nat.cast_add, Nat.cast_one, fourier_add]; rfl + +@[simp] lemma circleCoordinate_inverse_pow (n : ℕ) (t : CircleSpace) : + ((circleCoordinate t)⁻¹)^n = fourier (-(n : ℤ)) t := by + rw [Complex.inv_eq_conj (norm_circleCoordinate t), ← map_pow, circleCoordinate_pow, fourier_neg] + +lemma fourierCoeff_inverse_holomorphic {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] {f : ℂ → E} + (hf : DifferentiableOn ℂ f (closedBall 0 1)) (n : ℕ) : + fourierCoeff (fun t : CircleSpace => f (circleCoordinate t)⁻¹) (n : ℤ) = + if n = 0 then f 0 else 0 := by + change (∫ t : CircleSpace, fourier (-(n : ℤ)) t • f (circleCoordinate t)⁻¹ ∂circleMeasure) = _ + simp_rw [← circleCoordinate_inverse_pow] + rw [integral_holomorphic_inverse_circleCoordinate (f := fun u => u^n • f u) + ((differentiableOn_id.pow n).smul hf)] + by_cases hn : n = 0 + · simp [hn] + · simp [hn, zero_pow hn] + +lemma repr_boundaryField {k : ℕ} (F : C(CircleSpace, Coeff k)) + (a : ℤ × (Fin k × Fin k)) : + (matrixFourierBasis k).repr (boundaryField F) a = + fourierCoeff (fun t => F t a.2.1 a.2.2) a.1 := by + rw [matrixFourierBasis_repr] + apply congrFun (fourierCoeff_congr_ae ?_) a.1 + filter_upwards [lpEntry_apply_ae a.2 (boundaryField F), boundaryField_apply_ae F] with t he hf + rw [he, hf] + rfl + +lemma fourierProj_boundaryField_inverse_zero {k : ℕ} (F : C(CircleSpace, Coeff k)) + {f : ℂ → Coeff k} (hf : EntrywiseHolomorphic (closedBall 0 1) f) (h0 : f 0 = 0) + (hF : ∀ t, F t = f (circleCoordinate t)⁻¹) : + fourierProjC k 0 (boundaryField F) = 0 ∧ fourierProjC k 1 (boundaryField F) = 0 := by + classical + have hr (a : ℤ × (Fin k × Fin k)) (ha : 0 ≤ a.1) : + (matrixFourierBasis k).repr (boundaryField F) a = 0 := by + rcases a with ⟨n,i,j⟩ + obtain ⟨m,rfl⟩ := Int.eq_ofNat_of_zero_le ha + rw [repr_boundaryField] + simp_rw [hF] + rw [fourierCoeff_inverse_holomorphic (hf i j)] + split_ifs <;> simp [h0] + constructor + · apply (matrixFourierBasis k).repr.injective + ext a + rw [repr_fourierProjC, map_zero] + change (if frequencyPart 0 a.1 then _ else 0) = 0 + split_ifs with ha + · exact hr a (le_of_eq ((frequencyPart_zero a.1).mp ha).symm) + · rfl + · apply (matrixFourierBasis k).repr.injective + ext a + rw [repr_fourierProjC, map_zero] + change (if frequencyPart 1 a.1 then _ else 0) = 0 + split_ifs with ha + · exact hr a ((frequencyPart_pos a.1).mp ha).le + · rfl + +lemma fourierProj_boundaryField_inverse_neg {k : ℕ} (F : C(CircleSpace, Coeff k)) + {f : ℂ → Coeff k} (hf : EntrywiseHolomorphic (closedBall 0 1) f) (h0 : f 0 = 0) + (hF : ∀ t, F t = f (circleCoordinate t)⁻¹) : + fourierProjC k 2 (boundaryField F) = boundaryField F := by + have hh := congrArg (fun L : BoundaryL2 k →L[ℂ] BoundaryL2 k => L (boundaryField F)) + (fourierProjC_total k) + have hz := fourierProj_boundaryField_inverse_zero F hf h0 hF + simpa only [add_apply, hz.1, hz.2, zero_add, + ContinuousLinearMap.id_apply] using hh + +lemma boundaryCauchy_inverse_zero {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) + (F : C(CircleSpace, Coeff k)) {f : ℂ → Coeff k} + (hf : EntrywiseHolomorphic (closedBall 0 1) f) (h0 : f 0 = 0) + (hF : ∀ t, F t = f (circleCoordinate t)⁻¹) : + boundaryCauchy M (boundaryField F) = 0 := by + have hz := fourierProj_boundaryField_inverse_zero F hf h0 hF + change fourierProjC k 0 (boundaryField F) + fourierProjC k 1 (boundaryField F) + + fourierProjC k 2 (M (fourierProjC k 1 (boundaryField F))) = 0 + simp only [hz.1, hz.2, map_zero, add_zero] + +open scoped Classical in + +lemma fourierProj_matrixFourier {k : ℕ} (i : Fin 3) (a : ℤ × (Fin k × Fin k)) : + fourierProjC k i (matrixFourier a) = if frequencyPart i a.1 then matrixFourier a else 0 := by + classical + apply (matrixFourierBasis k).repr.injective + ext b + rw [repr_fourierProjC] + by_cases hba : b = a + · subst b + split_ifs <;> simp only [map_zero, lp.coeFn_zero, Pi.zero_apply] + · have hz : (matrixFourierBasis k).repr (matrixFourier a) b = 0 := by + rw [← matrixFourierBasis_apply, HilbertBasis.repr_self] + simp [hba] + split_ifs <;> simp only [hz, map_zero, lp.coeFn_zero, Pi.zero_apply] + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/CircleCoordinate.lean b/lean/OAI/Analysis/Crouzeix/CircleCoordinate.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e777867e066d992f765ac2236f8bc02205fd912 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/CircleCoordinate.lean @@ -0,0 +1,76 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryOperators + +namespace OAI + +/-! Circle Coordinate. -/ + +noncomputable section + +open Set Metric Filter Topology Complex MeasureTheory + +namespace CrouzeixHilbert.Boundary + +local instance : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +def circleCoordinate : C(CircleSpace, ℂ) := fourier 1 + +@[simp] lemma norm_circleCoordinate (t : CircleSpace) : ‖circleCoordinate t‖ = 1 := by + rw [circleCoordinate, fourier_apply, Circle.norm_coe] + +lemma circleCoordinate_ne_zero (t : CircleSpace) : circleCoordinate t ≠ 0 := + norm_ne_zero_iff.mp (by rw [norm_circleCoordinate]; exact one_ne_zero) + +lemma circleCoordinate_injective : Function.Injective circleCoordinate := by + intro x y h + apply AddCircle.injective_toCircle (T := 1) one_ne_zero + apply Subtype.coe_injective + simpa only [circleCoordinate, fourier_one] using h + +@[simp] lemma circleCoordinate_neg (t : CircleSpace) : + circleCoordinate (-t) = (circleCoordinate t)⁻¹ := by + simp only [circleCoordinate, fourier_one, AddCircle.toCircle_neg, Circle.coe_inv] + +lemma circleCoordinate_coe (x : ℝ) : + circleCoordinate (x : CircleSpace) = circleMap 0 1 (2 * Real.pi * x) := by + rw [circleCoordinate, fourier_coe_apply] + simp only [Int.cast_one, mul_one, ofReal_one, div_one, circleMap, ofReal_mul, + ofReal_ofNat, zero_add, one_mul] + congr 1 + ring + +lemma integral_circleCoordinate_eq_circleAverage {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] (f : ℂ → E) : + (∫ t, f (circleCoordinate t) ∂circleMeasure) = Real.circleAverage f 0 1 := by + rw [AddCircle.integral_haarAddCircle, ← AddCircle.intervalIntegral_preimage 1 0] + simp only [inv_one, one_smul, zero_add, circleCoordinate_coe] + rw [intervalIntegral.integral_comp_mul_left (fun θ => f (circleMap 0 1 θ)) (ne_of_gt Real.two_pi_pos)] + simp only [mul_zero, mul_one, Real.circleAverage] + +lemma integral_inverse_circleCoordinate {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℝ E] (f : ℂ → E) : + (∫ t, f (circleCoordinate t)⁻¹ ∂circleMeasure) = Real.circleAverage f 0 1 := by + simp_rw [← circleCoordinate_neg] + rw [integral_neg_eq_self (fun t => f (circleCoordinate t)) circleMeasure, integral_circleCoordinate_eq_circleAverage] + +lemma integral_holomorphic_circleCoordinate {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] {f : ℂ → E} + (hf : DifferentiableOn ℂ f (closedBall 0 1)) : + (∫ t, f (circleCoordinate t) ∂circleMeasure) = f 0 := by + rw [integral_circleCoordinate_eq_circleAverage] + apply DiffContOnCl.circleAverage + apply DifferentiableOn.diffContOnCl + simpa only [abs_one, closure_ball _ (by norm_num : (1 : ℝ) ≠ 0)] using hf + +lemma integral_holomorphic_inverse_circleCoordinate {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] {f : ℂ → E} + (hf : DifferentiableOn ℂ f (closedBall 0 1)) : + (∫ t, f (circleCoordinate t)⁻¹ ∂circleMeasure) = f 0 := by + simp_rw [← circleCoordinate_neg] + rw [integral_neg_eq_self (fun t => f (circleCoordinate t)) circleMeasure, integral_holomorphic_circleCoordinate hf] + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/CollarUnivalence.lean b/lean/OAI/Analysis/Crouzeix/CollarUnivalence.lean new file mode 100644 index 0000000000000000000000000000000000000000..86ef50a4b7fc28dd6d2462907e93aa6930eac926 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/CollarUnivalence.lean @@ -0,0 +1,118 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryPatching + +namespace OAI + +/-! Collar Univalence. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +theorem inverseBranch_into_domain {U : Set ℂ} (hU : IsOpen U) {g : ℂ → ℂ} + (hg : MapsTo g U (ball 0 1)) (hfront : ∀ p ∈ frontier U, ‖g p‖ = 1) + (e : OpenPartialHomeomorph ℂ ℂ) (he : (e : ℂ → ℂ) = g) + {p : ℂ} (hp : p ∈ closure U) (hpe : p ∈ e.source) + {δ : ℝ} (hδ : 0 < δ) (hδe : ball (g p) δ ⊆ e.target) : + MapsTo e.symm (ball (g p) δ ∩ ball 0 1) U := by + let L := ball (g p) δ ∩ ball 0 1 + have hLt : L ⊆ e.target := inter_subset_left.trans hδe + have hconn : IsPreconnected (e.symm '' L) := + ((convex_ball _ _).inter (convex_ball _ _)).isPreconnected.image _ + (e.continuousOn_symm.mono hLt) + have hn : e.source ∩ g ⁻¹' ball (g p) δ ∈ 𝓝 p := + inter_mem (e.open_source.mem_nhds hpe) + ((he ▸ e.continuousAt hpe).preimage_mem_nhds (ball_mem_nhds _ hδ)) + obtain ⟨x, hxN, hxU⟩ := (mem_closure_iff_nhds.mp hp) _ hn + have hnon : (e.symm '' L ∩ U).Nonempty := by + refine ⟨x, ⟨g x, ⟨hxN.2, hg hxU⟩, ?_⟩, hxU⟩ + simpa only [he] using e.left_inv hxN.1 + have hcl : closure U ∩ e.symm '' L ⊆ U := by + rintro x ⟨hx, z, hz, rfl⟩ + by_contra hnU + have hpF : e.symm z ∈ frontier U := ⟨hx, by simpa only [hU.interior_eq] using hnU⟩ + have hmod := hfront _ hpF + have heq : g (e.symm z) = z := by simpa only [he] using e.right_inv (hLt hz) + rw [heq] at hmod + exact (ne_of_lt (mem_ball_zero_iff.mp hz.2)) hmod + exact fun z hz => (hconn.subset_of_closure_inter_subset hU hnon hcl) ⟨z, hz, rfl⟩ + +theorem injOn_closure_of_boundary_modulus {U V : Set ℂ} (hU : IsOpen U) + (hUV : closure U ⊆ V) {g : ℂ → ℂ} (hga : AnalyticOnNhd ℂ g V) + (hbij : BijOn g U (ball 0 1)) + (hgd : ∀ p ∈ closure U, deriv g p ≠ 0) + (hfront : ∀ p ∈ frontier U, ‖g p‖ = 1) : InjOn g (closure U) := by + intro p hp q hq hpq + let dp := ((hga p (hUV hp)).hasStrictDerivAt.hasStrictFDerivAt_equiv (hgd p hp)) + let dq := ((hga q (hUV hq)).hasStrictDerivAt.hasStrictFDerivAt_equiv (hgd q hq)) + let ep := dp.toOpenPartialHomeomorph g + let eq := dq.toOpenPartialHomeomorph g + have hps : p ∈ ep.source := dp.mem_toOpenPartialHomeomorph_source + have hqs : q ∈ eq.source := dq.mem_toOpenPartialHomeomorph_source + have hη : g p ∈ ep.target ∩ eq.target := + ⟨ep.map_source hps, hpq.symm ▸ eq.map_source hqs⟩ + obtain ⟨δ, hδ, hδsub⟩ := Metric.isOpen_iff.mp (ep.open_target.inter eq.open_target) (g p) hη + let L := ball (g p) δ ∩ ball 0 1 + have hpU := inverseBranch_into_domain hU hbij.mapsTo hfront ep rfl hp hps hδ + (hδsub.trans inter_subset_left) + have hqU := inverseBranch_into_domain hU hbij.mapsTo hfront eq rfl hq hqs hδ + (hpq ▸ hδsub.trans inter_subset_right) + have heqL : EqOn ep.symm eq.symm L := by + intro z hz + have hzq : z ∈ ball (g q) δ ∩ ball 0 1 := hpq ▸ hz + apply hbij.injOn (hpU hz) (hqU hzq) + exact (ep.right_inv (hδsub hz.1).1).trans (eq.right_inv (hδsub hz.1).2).symm + have hle : ‖g p‖ ≤ 1 := by + by_cases hpU : p ∈ U + · exact (mem_ball_zero_iff.mp (hbij.mapsTo hpU)).le + · exact (hfront p ⟨hp, by simpa only [hU.interior_eq] using hpU⟩).le + have hcl : g p ∈ closure L := by + have hn : ball (g p) δ ∈ 𝓝 (g p) := ball_mem_nhds _ hδ + have hc : g p ∈ closure (ball (0 : ℂ) 1) := by + rw [closure_ball _ (by norm_num : (1 : ℝ) ≠ 0), mem_closedBall_zero_iff] + exact hle + exact mem_closure_iff_nhds.mpr fun N hN => by + obtain ⟨z, hzN, hzD⟩ := mem_closure_iff_nhds.mp hc _ (inter_mem hN hn) + exact ⟨z, hzN.1, hzN.2, hzD⟩ + have : NeBot (𝓝[L] (g p)) := mem_closure_iff_nhdsWithin_neBot.mp hcl + have heq : ep.symm (g p) = eq.symm (g p) := + tendsto_nhds_unique ((ep.continuousAt_symm hη.1).continuousWithinAt.tendsto) + (((eq.continuousAt_symm hη.2).continuousWithinAt.tendsto).congr' + (heqL.eventuallyEq_of_mem self_mem_nhdsWithin).symm) + have hlp : ep.symm (g p) = p := ep.left_inv hps + have hlq : eq.symm (g q) = q := eq.left_inv hqs + rw [hlp] at heq + rw [hpq, hlq] at heq + exact heq + +theorem exists_univalent_extension {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U (ball 0 1)) + (hchart : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) : + ∃ (V : Set ℂ) (g : ℂ → ℂ), IsOpen V ∧ closure U ⊆ V ∧ + AnalyticOnNhd ℂ g V ∧ EqOn g f U ∧ InjOn g V ∧ + (∀ p ∈ frontier U, ‖g p‖ = 1) := by + obtain ⟨V, g, hV, hUV, hga, hgf, hgd, hfront⟩ := + exists_extension_to_closure hU hf hbij hchart + have hbijg : BijOn g U (ball 0 1) := hbij.congr hgf.symm + have hgi := injOn_closure_of_boundary_modulus hU hUV hga hbijg hgd hfront + have hloc : ∀ x ∈ closure U, ∃ s ∈ 𝓝 x, InjOn g s := by + intro x hx + let d := (hga x (hUV hx)).hasStrictDerivAt.hasStrictFDerivAt_equiv (hgd x hx) + let e := d.toOpenPartialHomeomorph g + have he : x ∈ e.source := d.mem_toOpenPartialHomeomorph_source + exact ⟨e.source, e.open_source.mem_nhds he, e.injOn⟩ + obtain ⟨W, hW, hUW, hgiW⟩ := hgi.exists_isOpen_superset hb.isCompact_closure + (fun x hx => (hga x (hUV hx)).continuousAt) hloc + exact ⟨V ∩ W, g, hV.inter hW, subset_inter hUV hUW, + hga.mono inter_subset_left, hgf, hgiW.mono inter_subset_right, hfront⟩ + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/CompleteFinite.lean b/lean/OAI/Analysis/Crouzeix/CompleteFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..840ec804c40e97b9da8aada9e5eaaf2af99143c3 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/CompleteFinite.lean @@ -0,0 +1,140 @@ +import Mathlib +import OAI.Analysis.Crouzeix.MetricBoundary + +namespace OAI + +/-! Complete Finite. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +lemma entrywiseHolomorphic_matrixPolynomial {m d : ℕ} (B : Fin (d + 1) → Coeff m) + (V : Set ℂ) : EntrywiseHolomorphic V (matrixPolynomial B) := by + intro i j + simp only [matrixPolynomial, Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul] + apply DifferentiableOn.fun_sum + intro k _ + exact (differentiableOn_id.pow (k : ℕ)).mul_const _ + +lemma matrixHolomorphicEval_matrixPolynomial + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [Nontrivial H] (A : Operator H) + {V : Set ℂ} (hV : IsOpen V) (hKV : numericalClosure A ⊆ V) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + matrixHolomorphicEval A V (matrixPolynomial B) = polynomialEval A B := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hV hKV + have he : matrixHolomorphicEval A V (matrixPolynomial B) = + matrixContourEval A Γ.toSmoothContour (matrixPolynomial B) := by + simp only [matrixHolomorphicEval, matrixContourEval, + holomorphicEval_eq_contourEval A hV (entrywiseHolomorphic_matrixPolynomial B V _ _) Γ] + rw [he, matrixContourEval_matrixPolynomial A Γ B] + +lemma norm_tensorOperator_one_le + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (A : Operator H) (m : ℕ) : ‖tensorOperator A (1 : Coeff m)‖ ≤ ‖A‖ := by + have h1 : ‖(1 : Coeff m)‖ ≤ 1 := by + rw [Matrix.cstar_norm_def, map_one] + exact ContinuousLinearMap.norm_id_le + exact (norm_tensorOperator_le A (1 : Coeff m)).trans + ((mul_le_mul_of_nonneg_left h1 (norm_nonneg _)).trans_eq (mul_one _)) + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +variable {n : ℕ} (hn : 0 < n) (A : Operator (EuclideanSpace ℂ (Fin n))) + (hKU : numericalClosure A ⊆ U) (hU : IsOpen U) (hc : Convex ℝ U) + (hb : Bornology.IsBounded U) + +include C R hn hKU hU hc hb + +lemma holomorphic_bound {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {m : ℕ} {F : ℂ → Coeff m} (hF : EntrywiseHolomorphic V F) : + ‖matrixHolomorphicEval A V F‖ ≤ 2 * supNorm (closure U) F := by + let : Nonempty (Fin n) := ⟨⟨0,hn⟩⟩ + obtain ⟨S,J,D,hJS,_,hcond,hN,hD,hI⟩ := C.exists_conformal_contraction R hn A hKU hU hc hb + let Λ := C.operatorDensity R D hD + let F₀ := C.matrixAnalyticTrace hUV F hF.continuousOn + let L := ∫ t, tensorOperator (Λ t) (F₀ t) ∂circleMeasure + have hs : tensorOperator S (1 : Coeff m) * matrixHolomorphicEval A V F = + L * tensorOperator S (1 : Coeff m) := + C.physical_intertwines R hU hc A D S hKU hN hD hI hV hUV hF + have hi : tensorOperator J (1 : Coeff m) * tensorOperator S (1 : Coeff m) = 1 := by + rw [← tensorOperator_mul, hJS, one_mul, tensorOperator_one] + have he : matrixHolomorphicEval A V F = + tensorOperator J (1 : Coeff m) * L * tensorOperator S (1 : Coeff m) := by + calc + _ = (tensorOperator J (1 : Coeff m) * tensorOperator S (1 : Coeff m)) * + matrixHolomorphicEval A V F := by rw [hi, one_mul] + _ = _ := by rw [mul_assoc, hs, ← mul_assoc] + have hsup := supNorm_bddAbove hb.isCompact_closure (hF.continuousOn.mono hUV) + have hc0 := supNorm_nonneg hsup + have hnL : ‖L‖ ≤ supNorm (closure U) F := + norm_integral_tensor_density_le Λ (C.operatorDensity_nonneg R D hD hN) + (C.integral_operatorDensity R D hD hU hc) F₀ _ hc0 + (fun t => norm_le_supNorm hsup (C.boundaryMap_mem_frontier t).1) + rw [he] + calc + ‖tensorOperator J (1 : Coeff m) * L * tensorOperator S (1 : Coeff m)‖ ≤ + (‖tensorOperator J (1 : Coeff m)‖ * ‖L‖) * ‖tensorOperator S (1 : Coeff m)‖ := + (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_right (norm_mul_le _ _) (norm_nonneg _)) + _ ≤ (‖J‖ * supNorm (closure U) F) * ‖S‖ := + mul_le_mul (mul_le_mul (norm_tensorOperator_one_le J m) hnL (norm_nonneg _) (norm_nonneg _)) + (norm_tensorOperator_one_le S m) (norm_nonneg _) (mul_nonneg (norm_nonneg _) hc0) + _ = (‖S‖ * ‖J‖) * supNorm (closure U) F := by ring + _ ≤ 2 * supNorm (closure U) F := mul_le_mul_of_nonneg_right hcond hc0 + +lemma polynomial_bound {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval A B‖ ≤ 2 * supNorm (closure U) (matrixPolynomial B) := by + let : Nonempty (Fin n) := ⟨⟨0,hn⟩⟩ + rw [← matrixHolomorphicEval_matrixPolynomial A isOpen_univ (subset_univ _) B] + exact C.holomorphic_bound R hn A hKU hU hc hb isOpen_univ (subset_univ _) + (entrywiseHolomorphic_matrixPolynomial B univ) + +end Conformal.ExteriorCollar + +theorem finite_matrix_polynomial_bound : FiniteMatrixPolynomialBound := by + intro n hn M m _ d B + let : Nonempty (Fin n) := ⟨⟨0,hn⟩⟩ + let A := Matrix.toEuclideanCLM (𝕜 := ℂ) M + change ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B) + rw [(polynomial_sup_eq_max A B).1] + let K := numericalClosure A + let P := matrixPolynomial B + have hK := isCompact_numericalClosure A + have hc := convex_numericalClosure A + have hne : K.Nonempty := numericalClosure_nonempty A + have hsup := supNorm_bddAbove hK (continuous_matrixPolynomial B).continuousOn + have hs0 := supNorm_nonneg hsup + apply le_of_forall_pos_le_add + intro ε hε + let V := {z : ℂ | ‖P z‖ < supNorm K P + ε / 2} + have hV : IsOpen V := isOpen_lt (continuous_matrixPolynomial B).norm continuous_const + have hKV : K ⊆ V := fun z hz => (norm_le_supNorm hsup hz).trans_lt (by dsimp only [K,P]; linarith) + obtain ⟨U,hU,hb,hcU,hKU,hUV,hchart⟩ := Conformal.exists_convex_analytic_neighborhood + hK hc hne hV hKV + obtain ⟨a,ha⟩ := hne + obtain ⟨R⟩ := Conformal.exists_interiorCollar hU hb + (Conformal.isSimplyConnected_of_convex hcU ⟨a,hKU ha⟩) ⟨a,hKU ha⟩ hchart + obtain ⟨C⟩ := Conformal.exists_exteriorCollar hU hb hcU (hKU ha) hchart + have hg := C.polynomial_bound R hn A hKU hU hcU hb B + have hs : supNorm (closure U) P ≤ supNorm K P + ε / 2 := + supNorm_le (by dsimp only [K,P]; linarith) (fun z hz => (hUV hz).le) + calc + ‖polynomialEval A B‖ ≤ 2 * supNorm (closure U) P := hg + _ ≤ 2 * (supNorm K P + ε / 2) := mul_le_mul_of_nonneg_left hs (by norm_num) + _ = 2 * supNorm (numericalClosure A) (matrixPolynomial B) + ε := by dsimp only [K,P]; ring + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Compression.lean b/lean/OAI/Analysis/Crouzeix/Compression.lean new file mode 100644 index 0000000000000000000000000000000000000000..782207d528f5fb126f06d68aa74e2ddd4cdcfc75 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Compression.lean @@ -0,0 +1,195 @@ +import Mathlib + +namespace OAI + +/-! Compression. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace + +namespace CrouzeixHilbert.Compression + +section Multiplication + +variable {α E : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +def fieldAction (L : α → E →L[ℂ] E) (hL : AEStronglyMeasurable L μ) + (C : ℝ) (hC : 0 ≤ C) (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ C) : + Lp E 2 μ →L[ℂ] Lp E 2 μ := by + let mem : ∀ u : Lp E 2 μ, MemLp (fun t => L t (u t)) 2 μ := fun u => + ((Lp.memLp u).norm.const_mul C).mono + ((show Continuous (fun z : (E →L[ℂ] E) × E => z.1 z.2) by fun_prop).comp_aestronglyMeasurable (hL.prodMk (Lp.aestronglyMeasurable u))) + (hLn.mono fun t ht => by + simp only [Real.norm_eq_abs, abs_mul, abs_of_nonneg hC, abs_norm] + exact ((L t).le_opNorm _).trans (mul_le_mul_of_nonneg_right ht (norm_nonneg _))) + let M : Lp E 2 μ →ₗ[ℂ] Lp E 2 μ := { + toFun u := (mem u).toLp _ + map_add' u v := by + apply Lp.ext + filter_upwards [(mem (u + v)).coeFn_toLp, (mem u).coeFn_toLp, + (mem v).coeFn_toLp, Lp.coeFn_add u v, + Lp.coeFn_add ((mem u).toLp _) ((mem v).toLp _)] with t huv hu hv ha hb + simp only [huv, hb, hu, hv, ha, map_add, Pi.add_apply] + map_smul' c u := by + apply Lp.ext + filter_upwards [(mem (c • u)).coeFn_toLp, (mem u).coeFn_toLp, + Lp.coeFn_smul c u, Lp.coeFn_smul c ((mem u).toLp _)] with t hcu hu ha hb + simp only [hcu, hb, hu, ha, map_smul, Pi.smul_apply, RingHom.id_apply] } + apply M.mkContinuous C + intro u + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [(mem u).coeFn_toLp, hLn] with t ht hn + change ‖((mem u).toLp _) t‖ ≤ C * ‖u t‖ + rw [ht] + exact ((L t).le_opNorm _).trans (mul_le_mul_of_nonneg_right hn (norm_nonneg _)) + +theorem fieldAction_apply_ae (L : α → E →L[ℂ] E) (hL : AEStronglyMeasurable L μ) + (C : ℝ) (hC : 0 ≤ C) (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ C) (u : Lp E 2 μ) : + fieldAction L hL C hC hLn u =ᵐ[μ] fun t => L t (u t) := by + unfold fieldAction + dsimp only [LinearMap.mkContinuous_apply, LinearMap.coe_mk, AddHom.coe_mk] + exact MemLp.coeFn_toLp _ + +theorem norm_fieldAction_le (L : α → E →L[ℂ] E) (hL : AEStronglyMeasurable L μ) + (C : ℝ) (hC : 0 ≤ C) (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ C) : + ‖fieldAction L hL C hC hLn‖ ≤ C := by + apply ContinuousLinearMap.opNorm_le_bound _ hC + intro u + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [fieldAction_apply_ae L hL C hC hLn u, hLn] with t ht hn + rw [ht] + exact ((L t).le_opNorm _).trans (mul_le_mul_of_nonneg_right hn (norm_nonneg _)) + +variable [CompleteSpace E] + +theorem adjoint_fieldAction (L M : α → E →L[ℂ] E) + (hL : AEStronglyMeasurable L μ) (hM : AEStronglyMeasurable M μ) + (C : ℝ) (hC : 0 ≤ C) + (hLn : ∀ᵐ t ∂μ, ‖L t‖ ≤ C) (hMn : ∀ᵐ t ∂μ, ‖M t‖ ≤ C) + (ha : ∀ᵐ t ∂μ, ContinuousLinearMap.adjoint (L t) = M t) : + ContinuousLinearMap.adjoint (fieldAction L hL C hC hLn) = + fieldAction M hM C hC hMn := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + simp only [L2.inner_def] + apply integral_congr_ae + filter_upwards [fieldAction_apply_ae M hM C hC hMn u, + fieldAction_apply_ae L hL C hC hLn v, ha] with t hu hv ht + rw [hu, hv, ← ht, ContinuousLinearMap.adjoint_inner_left] + +end Multiplication + +section Isometry + +variable {α E : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] + [CompactSpace α] [SecondCountableTopology α] {μ : Measure α} [IsFiniteMeasure μ] + [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +def orbit (R : C(α, E →L[ℂ] E)) : E →ₗ[ℂ] C(α, E) where + toFun x := ⟨fun t => R t x, R.continuous.clm_apply continuous_const⟩ + map_add' x y := by ext t; exact (R t).map_add x y + map_smul' c x := by ext t; exact (R t).map_smul c x + +def lift (R : C(α, E →L[ℂ] E)) : E →ₗ[ℂ] Lp E 2 μ := + (ContinuousMap.toLp 2 μ ℂ).toLinearMap.comp (orbit R) + +omit [CompleteSpace E] in +theorem lift_apply_ae (R : C(α, E →L[ℂ] E)) (x : E) : + lift (μ := μ) R x =ᵐ[μ] fun t => R t x := + ContinuousMap.coeFn_toLp μ (orbit R x) + +theorem inner_lift (R : C(α, E →L[ℂ] E)) (x y : E) : + ⟪lift (μ := μ) R x, lift (μ := μ) R y⟫_ℂ = + ⟪x, (∫ t, star (R t) * R t ∂μ) y⟫_ℂ := by + have hi : Integrable (fun t => star (R t) * R t) μ := + (R.continuous.star.mul R.continuous).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + rw [L2.inner_def, ContinuousLinearMap.integral_apply hi, + ← integral_inner (𝕜 := ℂ) (f := fun t => (star (R t) * R t) y) + ((ContinuousLinearMap.apply ℂ E y).integrable_comp hi) x] + apply integral_congr_ae + filter_upwards [lift_apply_ae R x, lift_apply_ae R y] with t hx hy + rw [hx, hy] + exact (ContinuousLinearMap.adjoint_inner_right (R t) x (R t y)).symm + +def isometry (R : C(α, E →L[ℂ] E)) (hmass : ∫ t, star (R t) * R t ∂μ = 1) : + E →ₗᵢ[ℂ] Lp E 2 μ := + (lift R).isometryOfInner fun x y => by rw [inner_lift, hmass]; rfl + +@[simp] theorem isometry_apply (R : C(α, E →L[ℂ] E)) + (hmass : ∫ t, star (R t) * R t ∂μ = 1) (x : E) : + isometry R hmass x = lift R x := rfl + +theorem integral_eq_compression (R L : C(α, E →L[ℂ] E)) + (hmass : ∫ t, star (R t) * R t ∂μ = 1) (C : ℝ) (hC : 0 ≤ C) + (hLn : ∀ t, ‖L t‖ ≤ C) : + (∫ t, star (R t) * L t * R t ∂μ) = + (isometry R hmass).toContinuousLinearMap.adjoint.comp + ((fieldAction L L.continuous.aestronglyMeasurable C hC + (Filter.Eventually.of_forall hLn)).comp (isometry R hmass).toContinuousLinearMap) := by + have hi : Integrable (fun t => star (R t) * L t * R t) μ := + ((R.continuous.star.mul L.continuous).mul R.continuous).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + ext y + apply ext_inner_left ℂ + intro x + rw [ContinuousLinearMap.integral_apply hi, + ← integral_inner (𝕜 := ℂ) (f := fun t => (star (R t) * L t * R t) y) + ((ContinuousLinearMap.apply ℂ E y).integrable_comp hi) x] + simp only [ContinuousLinearMap.comp_apply, ContinuousLinearMap.adjoint_inner_right, + LinearIsometry.coe_toContinuousLinearMap, isometry_apply, L2.inner_def] + apply integral_congr_ae + filter_upwards [lift_apply_ae R x, + fieldAction_apply_ae L L.continuous.aestronglyMeasurable C hC + (Filter.Eventually.of_forall hLn) (lift R y), lift_apply_ae R y] with t hx hL hy + rw [hx, hL, hy] + exact ContinuousLinearMap.adjoint_inner_right (R t) x (L t (R t y)) + +theorem norm_integral_le (R L : C(α, E →L[ℂ] E)) + (hmass : ∫ t, star (R t) * R t ∂μ = 1) (C : ℝ) (hC : 0 ≤ C) + (hLn : ∀ t, ‖L t‖ ≤ C) : + ‖∫ t, star (R t) * L t * R t ∂μ‖ ≤ C := by + rw [integral_eq_compression R L hmass C hC hLn] + let V := (isometry R hmass).toContinuousLinearMap + have hn : ‖V‖ ≤ 1 := (isometry R hmass).norm_toContinuousLinearMap_le + calc + _ ≤ ‖V.adjoint‖ * (‖fieldAction L L.continuous.aestronglyMeasurable C hC + (Filter.Eventually.of_forall hLn)‖ * ‖V‖) := + (ContinuousLinearMap.opNorm_comp_le _ _).trans + (mul_le_mul_of_nonneg_left (ContinuousLinearMap.opNorm_comp_le _ _) (norm_nonneg _)) + _ ≤ 1 * (C * 1) := by + rw [ContinuousLinearMap.adjoint.norm_map] + exact mul_le_mul hn (mul_le_mul (norm_fieldAction_le _ _ _ _ _) hn + (norm_nonneg V) hC) (mul_nonneg (norm_nonneg _) (norm_nonneg V)) (by norm_num) + _ = C := by ring + +def densityRoot (Λ : C(α, E →L[ℂ] E)) (hΛ : ∀ t, 0 ≤ Λ t) : C(α, E →L[ℂ] E) := + ⟨fun t => CFC.sqrt (Λ t), + CFC.continuousOn_sqrt.comp_continuous Λ.continuous (fun t => hΛ t)⟩ + +omit [MeasurableSpace α] [BorelSpace α] [CompactSpace α] [SecondCountableTopology α] in +@[simp] theorem densityRoot_star_mul (Λ : C(α, E →L[ℂ] E)) (hΛ : ∀ t, 0 ≤ Λ t) + (t : α) : star (densityRoot Λ hΛ t) * densityRoot Λ hΛ t = Λ t := by + change star (CFC.sqrt (Λ t)) * CFC.sqrt (Λ t) = _ + rw [(IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg _)).star_eq, CFC.sqrt_mul_sqrt_self _ (hΛ t)] + +def densityIsometry (Λ : C(α, E →L[ℂ] E)) (hΛ : ∀ t, 0 ≤ Λ t) + (hmass : ∫ t, Λ t ∂μ = 1) : E →ₗᵢ[ℂ] Lp E 2 μ := + isometry (densityRoot Λ hΛ) (by simpa only [densityRoot_star_mul] using hmass) + +theorem densityIsometry_apply_ae (Λ : C(α, E →L[ℂ] E)) (hΛ : ∀ t, 0 ≤ Λ t) + (hmass : ∫ t, Λ t ∂μ = 1) (x : E) : + densityIsometry Λ hΛ hmass x =ᵐ[μ] fun t => CFC.sqrt (Λ t) x := + lift_apply_ae (densityRoot Λ hΛ) x + +end Isometry + +end CrouzeixHilbert.Compression + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ConformalCollar.lean b/lean/OAI/Analysis/Crouzeix/ConformalCollar.lean new file mode 100644 index 0000000000000000000000000000000000000000..1df90080ca30c56074d800e8fb52c8b91a1b50b2 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ConformalCollar.lean @@ -0,0 +1,87 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CollarUnivalence + +namespace OAI + +/-! Conformal Collar. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +theorem isOpen_image_of_univalent {V : Set ℂ} (hV : IsOpen V) {g : ℂ → ℂ} + (hga : AnalyticOnNhd ℂ g V) (hgi : InjOn g V) : IsOpen (g '' V) := by + rw [isOpen_iff_mem_nhds] + rintro w ⟨z, hz, rfl⟩ + rw [← (hga z hz).hasStrictDerivAt.map_nhds_eq + (deriv_ne_zero_of_injOn hV hga.differentiableOn hgi hz)] + exact image_mem_map (hV.mem_nhds hz) + +theorem image_closure_eq_closedDisk {U V : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hUV : closure U ⊆ V) {g : ℂ → ℂ} + (hga : AnalyticOnNhd ℂ g V) (hbij : BijOn g U (ball 0 1)) + (hfront : ∀ p ∈ frontier U, ‖g p‖ = 1) : g '' closure U = closedBall 0 1 := by + apply Subset.antisymm + · rintro w ⟨z, hz, rfl⟩ + rw [mem_closedBall_zero_iff] + by_cases hzu : z ∈ U + · exact (mem_ball_zero_iff.mp (hbij.mapsTo hzu)).le + · exact (hfront z ⟨hz, by simpa only [hU.interior_eq] using hzu⟩).le + · rw [← closure_ball _ (by norm_num : (1 : ℝ) ≠ 0)] + apply closure_minimal _ ((hb.isCompact_closure.image_of_continuousOn + (hga.continuousOn.mono hUV)).isClosed) + exact hbij.surjOn.trans (image_mono subset_closure) + +theorem exists_conformal_collar {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hc : IsSimplyConnected U) {a : ℂ} (ha : a ∈ U) + (hchart : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) : + ∃ (V : Set ℂ) (ρ : ℝ) (f h : ℂ → ℂ), + IsOpen V ∧ closure U ⊆ V ∧ 1 < ρ ∧ + AnalyticOnNhd ℂ f V ∧ AnalyticOnNhd ℂ h (ball 0 ρ) ∧ + InjOn f V ∧ InjOn h (ball 0 ρ) ∧ + BijOn f U (ball 0 1) ∧ BijOn h (ball 0 1) U ∧ + BijOn f (closure U) (closedBall 0 1) ∧ + BijOn h (closedBall 0 1) (closure U) ∧ + InvOn h f U (ball 0 1) ∧ f a = 0 ∧ h 0 = a ∧ + (∀ z ∈ frontier U, ‖f z‖ = 1) ∧ + InvOn h f V (f '' V) ∧ ball 0 ρ ⊆ f '' V := by + obtain ⟨f₀, hf₀, _, hfb₀⟩ := riemann_mapping_bounded hU hb hc ha + obtain ⟨V, f, hV, hUV, hfa, hfe, hfi, hfront⟩ := + exists_univalent_extension hU hb hf₀.holomorphic hfb₀ hchart + have hfb : BijOn f U (ball 0 1) := hfb₀.congr hfe.symm + have hBij : BijOn f V (f '' V) := ⟨mapsTo_image _ _, hfi, surjOn_image _ _⟩ + let h := invFunOn f V + have hinv : InvOn h f V (f '' V) := hBij.invOn_invFunOn + have hWi := isOpen_image_of_univalent hV hfa hfi + have hha : AnalyticOnNhd ℂ h (f '' V) := by + apply DifferentiableOn.analyticOnNhd _ hWi + intro w hw + exact (hasStrictDerivAt_invFunOn hV hfa.differentiableOn hBij hw).hasDerivAt.differentiableAt.differentiableWithinAt + have hfc : BijOn f (closure U) (closedBall 0 1) := + ⟨by rw [← image_closure_eq_closedDisk hU hb hUV hfa hfb hfront]; exact mapsTo_image _ _, + hfi.mono hUV, + by rw [← image_closure_eq_closedDisk hU hb hUV hfa hfb hfront]; exact surjOn_image _ _⟩ + have hclosed : closedBall 0 1 ⊆ f '' V := + hfc.surjOn.trans (image_mono hUV) + have hUsub : U ⊆ V := subset_closure.trans hUV + have hdisk : ball 0 1 ⊆ f '' V := ball_subset_closedBall.trans hclosed + have hiU : InvOn h f U (ball 0 1) := ⟨hinv.1.mono hUsub, hinv.2.mono hdisk⟩ + have hiC : InvOn h f (closure U) (closedBall 0 1) := ⟨hinv.1.mono hUV, hinv.2.mono hclosed⟩ + obtain ⟨δ, hδ, hδsub⟩ := (isCompact_closedBall (0 : ℂ) 1).exists_thickening_subset_open hWi hclosed + rw [thickening_closedBall hδ zero_le_one] at hδsub + have hfa0 : f a = 0 := (hfe ha).trans hf₀.normalized + have h0 : h 0 = a := hfa0 ▸ hinv.1 (hUsub ha) + exact ⟨V, δ + 1, f, h, hV, hUV, by linarith, + hfa, hha.mono hδsub, hfi, (hBij.symm hinv.symm).injOn.mono hδsub, + hfb, hfb.symm hiU.symm, hfc, hfc.symm hiC.symm, hiU, hfa0, h0, + hfront, hinv, hδsub⟩ + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ContourExistence.lean b/lean/OAI/Analysis/Crouzeix/ContourExistence.lean new file mode 100644 index 0000000000000000000000000000000000000000..27412f097c7eab302902e850e9261c46c30e53cc --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ContourExistence.lean @@ -0,0 +1,289 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Definitions + +namespace OAI + +/-! Contour Existence. -/ + +noncomputable section + +open scoped Topology InnerProductSpace TensorProduct Matrix.Norms.L2Operator + +open Set Filter Metric + +namespace CrouzeixHilbert + +theorem sub_div_sub_mem_slitPlane {a b w : ℂ} (hw : w ∉ segment ℝ a b) : + (w - a) / (w - b) ∈ Complex.slitPlane := by + rw [Complex.mem_slitPlane_iff] + by_contra h + push Not at h + have hwb : w - b ≠ 0 := by + intro he + exact hw ((sub_eq_zero.mp he) ▸ right_mem_segment ℝ a b) + let r : ℝ := ((w - a) / (w - b)).re + have hr : r ≤ 0 := h.1 + have hrc : (r : ℂ) = (w - a) / (w - b) := by + apply Complex.ext + · rfl + · simpa only [Complex.ofReal_im] using h.2.symm + have hmul : (r : ℂ) * (w - b) = w - a := by rw [hrc, div_mul_cancel₀ _ hwb] + have hp : 0 < 1 - r := by linarith + have hpn : (1 - (r : ℂ)) ≠ 0 := by exact_mod_cast hp.ne' + apply hw + refine ⟨(1 - r)⁻¹, -r / (1 - r), inv_nonneg.mpr hp.le, + div_nonneg (neg_nonneg.mpr hr) hp.le, ?_, ?_⟩ + · field_simp + ring + · simp only [Complex.real_smul, Complex.ofReal_inv, Complex.ofReal_sub, + Complex.ofReal_one, Complex.ofReal_div, Complex.ofReal_neg] + apply (mul_right_cancel₀ hpn) + field_simp + linear_combination hmul + +theorem SmoothContour.intervalIntegrable_indexIntegrand (Γ : SmoothContour) {a : ℂ} + (ha : a ∉ Γ.path '' Icc (0 : ℝ) 1) : + IntervalIntegrable (fun t => deriv Γ.path t / (Γ.path t - a)) + MeasureTheory.volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le zero_le_one] + apply Γ.smooth.continuous_deriv_one.continuousOn.div + (Γ.smooth.continuous.sub continuous_const).continuousOn + intro t ht he + exact ha ⟨t, ht, sub_eq_zero.mp he⟩ + +theorem SmoothContour.index_eq_of_segment_avoids (Γ : SmoothContour) {a b : ℂ} + (h : ∀ t ∈ Icc (0 : ℝ) 1, Γ.path t ∉ segment ℝ a b) : + Γ.index a = Γ.index b := by + have hnza (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : Γ.path t - a ≠ 0 := by + intro he + exact h t ht ((sub_eq_zero.mp he) ▸ left_mem_segment ℝ a b) + have hnzb (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : Γ.path t - b ≠ 0 := by + intro he + exact h t ht ((sub_eq_zero.mp he) ▸ right_mem_segment ℝ a b) + have ha : a ∉ Γ.path '' Icc (0 : ℝ) 1 := by + rintro ⟨t, ht, he⟩ + exact hnza t ht (sub_eq_zero.mpr he) + have hb : b ∉ Γ.path '' Icc (0 : ℝ) 1 := by + rintro ⟨t, ht, he⟩ + exact hnzb t ht (sub_eq_zero.mpr he) + have hd (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun t => Complex.log ((Γ.path t - a) / (Γ.path t - b))) + (deriv Γ.path t / (Γ.path t - a) - deriv Γ.path t / (Γ.path t - b)) t := by + have hg := (Γ.smooth.differentiable (by norm_num) t).hasDerivAt + have he := ((hg.sub_const a).div (hg.sub_const b) (hnzb t ht)).clog_real + (sub_div_sub_mem_slitPlane (h t ht)) + simp only [Pi.div_apply] at he + convert! he using 1 + field_simp [hnza t ht, hnzb t ht] + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t ht => hd t (by simpa only [uIcc_of_le zero_le_one] using ht)) + ((Γ.intervalIntegrable_indexIntegrand ha).sub (Γ.intervalIntegrable_indexIntegrand hb)) + rw [Γ.closed, sub_self, intervalIntegral.integral_sub + (Γ.intervalIntegrable_indexIntegrand ha) (Γ.intervalIntegrable_indexIntegrand hb)] at he + unfold SmoothContour.index + rw [sub_eq_zero.mp he] + +theorem SmoothContour.index_eq_zero_of_re_pos (Γ : SmoothContour) {a c : ℂ} + (hc : c ≠ 0) (h : ∀ t ∈ Icc (0 : ℝ) 1, 0 < (c * (Γ.path t - a)).re) : + Γ.index a = 0 := by + have hnz (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : Γ.path t - a ≠ 0 := by + intro he + simpa only [he, mul_zero, Complex.zero_re, lt_self_iff_false] using h t ht + have ha : a ∉ Γ.path '' Icc (0 : ℝ) 1 := by + rintro ⟨t, ht, he⟩ + exact hnz t ht (sub_eq_zero.mpr he) + have hd (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun t => Complex.log (c * (Γ.path t - a))) + (deriv Γ.path t / (Γ.path t - a)) t := by + have he := (((Γ.smooth.differentiable (by norm_num) t).hasDerivAt.sub_const a).const_mul c).clog_real + (Complex.mem_slitPlane_iff.mpr (Or.inl (h t ht))) + simpa only [mul_div_mul_left _ _ hc] using he + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t ht => hd t (by simpa only [uIcc_of_le zero_le_one] using ht)) + (Γ.intervalIntegrable_indexIntegrand ha) + rw [Γ.closed, sub_self] at he + simp only [SmoothContour.index, he, mul_zero] + +theorem SmoothContour.index_eq_zero_of_convex (Γ : SmoothContour) {V : Set ℂ} + (hV : Convex ℝ V) (hVc : IsClosed V) (hΓ : Γ.path '' Icc (0 : ℝ) 1 ⊆ V) + {a : ℂ} (ha : a ∉ V) : + Γ.index a = 0 := by + obtain ⟨l, r, hla, hlV⟩ := + RCLike.geometric_hahn_banach_point_closed (𝕜 := ℂ) hV hVc ha + have hl (z : ℂ) : l z = l 1 * z := by + calc + l z = l (z • (1 : ℂ)) := by simp + _ = z • l 1 := l.map_smul z 1 + _ = l 1 * z := by simp [mul_comm] + have hp (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + 0 < (l 1 * (Γ.path t - a)).re := by + rw [← hl, map_sub, Complex.sub_re] + exact sub_pos.mpr (hla.trans (hlV _ (hΓ ⟨t, ht, rfl⟩))) + apply Γ.index_eq_zero_of_re_pos ?_ hp + intro he + have := hp 0 ⟨le_rfl, zero_le_one⟩ + simp only [he, zero_mul, Complex.zero_re, lt_self_iff_false] at this + +theorem exists_smooth_radial_frontier_approx {V : Set ℂ} + (hV : Convex ℝ V) (hV0 : V ∈ 𝓝 (0 : ℂ)) (hVb : Bornology.IsBounded V) + {ε : ℝ} (hε : 0 < ε) : + ∃ q : ℂ → ℝ, ContDiff ℝ 1 q ∧ (∀ z, 0 < q z) ∧ + ∀ z : ℂ, ‖z‖ = 1 → ∃ w ∈ frontier V, dist (q z • z) w < ε := by + obtain ⟨R, hR, hVR⟩ := hVb.subset_closedBall_lt 0 0 + let r : ℂ → ℝ := fun z => (max R⁻¹ (gauge V z))⁻¹ + have hrp (z : ℂ) : 0 < r z := inv_pos.mpr ((inv_pos.mpr hR).trans_le (le_max_left _ _)) + have hrc : Continuous r := + (continuous_const.max (continuous_gauge hV hV0)).inv₀ (fun z => ((inv_pos.mpr hR).trans_le (le_max_left _ _)).ne') + obtain ⟨q, hq, hqr, -⟩ := hrc.exists_contDiff_approx 1 + (continuous_const.min (hrc.div_const 2)) (fun z => lt_min hε (half_pos (hrp z))) + refine ⟨q, by simpa using hq, ?_, ?_⟩ + · intro z + have he := (abs_lt.mp (hqr z)).1 + have := min_le_right ε (r z / 2) + linarith [hrp z] + · intro z hz + have hg : R⁻¹ ≤ gauge V z := by + simpa only [hz, one_div] using + (le_gauge_of_subset_closedBall (absorbent_nhds_zero hV0) hR.le hVR (x := z)) + have hr : r z = (gauge V z)⁻¹ := inv_inj.mpr (max_eq_right hg) + have hgz : gauge V z ≠ 0 := ne_of_gt ((inv_pos.mpr hR).trans_le hg) + refine ⟨r z • z, (gauge_eq_one_iff_mem_frontier hV hV0).mp ?_, ?_⟩ + · rw [gauge_smul_of_nonneg (hrp z).le, smul_eq_mul, hr, inv_mul_cancel₀ hgz] + · calc + dist (q z • z) (r z • z) = |q z - r z| := by + rw [dist_eq_norm, ← sub_smul, norm_smul, hz, mul_one, Real.norm_eq_abs] + _ < min ε (r z / 2) := hqr z + _ ≤ ε := min_le_left _ _ + +def unitCirclePath (t : ℝ) : ℂ := circleMap 0 1 (2 * Real.pi * t) + +theorem unitCirclePath_norm (t : ℝ) : ‖unitCirclePath t‖ = 1 := by + simp only [unitCirclePath, norm_circleMap_zero, abs_one] + +theorem unitCirclePath_ne_zero (t : ℝ) : unitCirclePath t ≠ 0 := by + apply norm_ne_zero_iff.mp + rw [unitCirclePath_norm] + norm_num + +theorem unitCirclePath_smooth : ContDiff ℝ 1 unitCirclePath := + (contDiff_circleMap 0 1).comp (contDiff_const.mul contDiff_id) + +theorem unitCirclePath_closed : unitCirclePath 0 = unitCirclePath 1 := by + simpa only [unitCirclePath, mul_zero, mul_one, zero_add] using + ((periodic_circleMap 0 1) 0).symm + +theorem hasDerivAt_unitCirclePath (t : ℝ) : + HasDerivAt unitCirclePath (unitCirclePath t * (2 * (Real.pi : ℂ) * Complex.I)) t := by + convert! (hasDerivAt_circleMap 0 1 (2 * Real.pi * t)).scomp t + ((hasDerivAt_id t).const_mul (2 * Real.pi)) using 1 + simp only [unitCirclePath, mul_one, Complex.real_smul, Complex.ofReal_mul, Complex.ofReal_ofNat] + ring + +def radialContour (a : ℂ) (q : ℂ → ℝ) (hq : ContDiff ℝ 1 q) : SmoothContour where + path := fun t => a + q (unitCirclePath t) • unitCirclePath t + smooth := contDiff_const.add ((hq.comp unitCirclePath_smooth).smul unitCirclePath_smooth) + closed := by rw [unitCirclePath_closed] + +theorem radialContour_index_center (a : ℂ) (q : ℂ → ℝ) (hq : ContDiff ℝ 1 q) + (hqp : ∀ z, 0 < q z) : (radialContour a q hq).index a = 1 := by + let f : ℝ → ℝ := fun t => q (unitCirclePath t) + have hf : ContDiff ℝ 1 f := hq.comp unitCirclePath_smooth + have hfp (t : ℝ) : f t ≠ 0 := (hqp _).ne' + have hfc : f 0 = f 1 := by dsimp [f]; rw [unitCirclePath_closed] + have hdiff (t : ℝ) : HasDerivAt f (deriv f t) t := + (hf.differentiable (by norm_num) t).hasDerivAt + have hd (t : ℝ) : deriv (radialContour a q hq).path t = + f t • (unitCirclePath t * (2 * (Real.pi : ℂ) * Complex.I)) + + deriv f t • unitCirclePath t := + ((hdiff t).smul (hasDerivAt_unitCirclePath t)).const_add a |>.deriv + have hi : IntervalIntegrable (fun t => deriv f t / f t) MeasureTheory.volume (0 : ℝ) 1 := + (hf.continuous_deriv_one.div hf.continuous hfp).intervalIntegrable 0 1 + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t (_ : t ∈ uIcc (0 : ℝ) 1) => (hdiff t).log (hfp t)) hi + rw [← hfc, sub_self] at he + have heq (t : ℝ) : deriv (radialContour a q hq).path t / + ((radialContour a q hq).path t - a) = + ((deriv f t / f t : ℝ) : ℂ) + 2 * (Real.pi : ℂ) * Complex.I := by + rw [hd] + change ((f t : ℂ) * (unitCirclePath t * (2 * (Real.pi : ℂ) * Complex.I)) + + ((deriv f t : ℝ) : ℂ) * unitCirclePath t) / + (a + (f t : ℂ) * unitCirclePath t - a) = _ + rw [add_sub_cancel_left, Complex.ofReal_div] + field_simp [Complex.ofReal_ne_zero.mpr (hfp t), unitCirclePath_ne_zero t] + ring + have hic : IntervalIntegrable (fun t => ((deriv f t / f t : ℝ) : ℂ)) + MeasureTheory.volume (0 : ℝ) 1 := + (Complex.continuous_ofReal.comp (hf.continuous_deriv_one.div hf.continuous hfp)).intervalIntegrable 0 1 + simp only [SmoothContour.index, heq] + rw [intervalIntegral.integral_add hic intervalIntegrable_const, + intervalIntegral.integral_ofReal, he, Complex.ofReal_zero, zero_add, + intervalIntegral.integral_const] + simp only [sub_zero, one_smul] + apply inv_mul_cancel₀ + exact mul_ne_zero (mul_ne_zero (by norm_num) (Complex.ofReal_ne_zero.mpr Real.pi_ne_zero)) Complex.I_ne_zero + +theorem exists_calculusContour {K U : Set ℂ} (hK : IsCompact K) + (hKc : Convex ℝ K) (hKne : K.Nonempty) (hU : IsOpen U) (hKU : K ⊆ U) : + Nonempty (CalculusContour K U) := by + obtain ⟨a, ha⟩ := hKne + obtain ⟨ε, hε, hεU⟩ := hK.exists_cthickening_subset_open hU hKU + let e : ℂ ≃ₜ ℂ := Homeomorph.addLeft a + let V : Set ℂ := e ⁻¹' (cthickening (ε / 2) K) + have hV : Convex ℝ V := by + convert! (hKc.cthickening (ε / 2)).translate (-a) using 1 + ext z + constructor + · intro hz + exact ⟨a + z, hz, by simp⟩ + · rintro ⟨w, hw, rfl⟩ + change a + (-a + w) ∈ cthickening (ε / 2) K + simpa using hw + have hV0 : V ∈ 𝓝 (0 : ℂ) := by + rw [← mem_interior_iff_mem_nhds] + change 0 ∈ interior (e ⁻¹' (cthickening (ε / 2) K)) + rw [← e.preimage_interior] + change a + 0 ∈ interior (cthickening (ε / 2) K) + rw [add_zero] + exact thickening_subset_interior_cthickening _ _ (self_subset_thickening (half_pos hε) _ ha) + have hVb : Bornology.IsBounded V := (e.isCompact_preimage.mpr hK.cthickening).isBounded + obtain ⟨q, hq, hqp, hqV⟩ := exists_smooth_radial_frontier_approx hV hV0 hVb + (div_pos hε (by norm_num : (0 : ℝ) < 4)) + let Γ : SmoothContour := radialContour a q hq + have hΓ (t : ℝ) : Γ.path t ∈ cthickening ε K ∧ Γ.path t ∉ K := by + obtain ⟨w, hw, hd⟩ := hqV (unitCirclePath t) (unitCirclePath_norm t) + have hw' : a + w ∈ frontier (cthickening (ε / 2) K) := by + change w ∈ e ⁻¹' frontier (cthickening (ε / 2) K) + rw [e.preimage_frontier] + exact hw + have hiw : infDist (a + w) K = ε / 2 := by + unfold infDist + rw [frontier_cthickening_subset K hw', ENNReal.toReal_ofReal (half_pos hε).le] + have hd' : dist (Γ.path t) (a + w) < ε / 4 := by + simpa only [Γ, radialContour, dist_add_left] using hd + have hi : infDist (Γ.path t) K < ε := by + have hle := infDist_le_infDist_add_dist (s := K) (x := Γ.path t) (y := a + w) + rw [hiw] at hle + linarith + refine ⟨thickening_subset_cthickening ε K ((mem_thickening_iff_infDist_lt ⟨a, ha⟩).mpr hi), ?_⟩ + intro htK + have hle := infDist_le_infDist_add_dist (s := K) (x := a + w) (y := Γ.path t) + rw [hiw, infDist_zero_of_mem htK, zero_add, dist_comm] at hle + linarith + refine ⟨{ toSmoothContour := Γ, avoids := ?_, index_inside := ?_, index_outside := ?_ }⟩ + · intro t _ht + exact ⟨hεU (hΓ t).1, (hΓ t).2⟩ + · intro z hz + calc + Γ.index z = Γ.index a := Γ.index_eq_of_segment_avoids (fun t _ht htz => + (hΓ t).2 (hKc.segment_subset hz ha htz)) + _ = 1 := radialContour_index_center a q hq hqp + · intro z hz + exact Γ.index_eq_zero_of_convex (hKc.cthickening ε) isClosed_cthickening + (by rintro _ ⟨t, _ht, rfl⟩; exact (hΓ t).1) (fun he => hz (hεU he)) + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ContourHomotopy.lean b/lean/OAI/Analysis/Crouzeix/ContourHomotopy.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5e62d9d5b2b57f24295ec53933f243202d962ba --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ContourHomotopy.lean @@ -0,0 +1,257 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Convexity + +namespace OAI + +/-! Contour Homotopy. -/ + +noncomputable section + +open scoped InnerProductSpace Topology + +open Set Filter + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +def operatorHomotopy (A : Operator H) (a : ℂ) (s : ℝ) : Operator H := + algebraMap ℂ (Operator H) a + s • (A - algebraMap ℂ (Operator H) a) + +@[simp] theorem operatorHomotopy_zero (A : Operator H) (a : ℂ) : + operatorHomotopy A a 0 = algebraMap ℂ (Operator H) a := by simp [operatorHomotopy] + +@[simp] theorem operatorHomotopy_one (A : Operator H) (a : ℂ) : + operatorHomotopy A a 1 = A := by simp [operatorHomotopy] + +theorem numericalClosure_operatorHomotopy_subset (A : Operator H) {a : ℂ} + (ha : a ∈ numericalClosure A) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : + numericalClosure (operatorHomotopy A a s) ⊆ numericalClosure A := by + apply closure_minimal _ isClosed_closure + rintro z ⟨x, hx, rfl⟩ + have h := (convex_numericalClosure A).add_smul_sub_mem ha + (subset_closure (show ⟪x, A x⟫_ℂ ∈ numericalRange A from ⟨x, hx, rfl⟩)) hs + simpa [operatorHomotopy, ContinuousLinearMap.algebraMap_apply, + inner_self_eq_norm_sq_to_K, hx] using! h + +def homotopyResolvent (A : Operator H) (a : ℂ) (s : ℝ) (z : ℂ) : Operator H := + Ring.inverse (algebraMap ℂ (Operator H) z - operatorHomotopy A a s) + +theorem homotopy_resolvent_isUnit [CompleteSpace H] (A : Operator H) {a z : ℂ} + (ha : a ∈ numericalClosure A) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) + (hz : z ∉ numericalClosure A) : + IsUnit (algebraMap ℂ (Operator H) z - operatorHomotopy A a s) := by + change z ∈ resolventSet ℂ (operatorHomotopy A a s) + by_contra he + exact hz (numericalClosure_operatorHomotopy_subset A ha hs + (spectrum_subset_numericalClosure _ he)) + +theorem continuousOn_homotopyResolvent [CompleteSpace H] (A : Operator H) + {a : ℂ} (ha : a ∈ numericalClosure A) : + ContinuousOn (fun p : ℝ × ℂ => homotopyResolvent A a p.1 p.2) + (Icc (0 : ℝ) 1 ×ˢ (numericalClosure A)ᶜ) := by + have hc : Continuous (fun p : ℝ × ℂ => + algebraMap ℂ (Operator H) p.2 - operatorHomotopy A a p.1) := + by simp only [operatorHomotopy, Algebra.algebraMap_eq_smul_one]; fun_prop + intro p hp + exact ((differentiableAt_inverse (𝕜 := ℝ) + (homotopy_resolvent_isUnit A ha hp.1 hp.2)).continuousAt.comp + (f := fun q : ℝ × ℂ => algebraMap ℂ (Operator H) q.2 - operatorHomotopy A a q.1) + (x := p) hc.continuousAt).continuousWithinAt + +theorem commute_homotopyResolvent (A : Operator H) (a : ℂ) (s : ℝ) (z : ℂ) : + Commute (A - algebraMap ℂ (Operator H) a) (homotopyResolvent A a s z) := by + let D := A - algebraMap ℂ (Operator H) a + have hc : Commute D (algebraMap ℂ (Operator H) z - operatorHomotopy A a s) := by + apply Commute.sub_right (Algebra.commutes z D).symm + exact (show Commute D (algebraMap ℂ (Operator H) a) from (Algebra.commutes a D).symm).add_right ((Commute.refl D).smul_right s) + by_cases hu : IsUnit (algebraMap ℂ (Operator H) z - operatorHomotopy A a s) + · rcases hu with ⟨v, hv⟩ + change Commute D (Ring.inverse _) + rw [← hv, Ring.inverse_unit] + exact (show Commute D (v : Operator H) from hv.symm ▸ hc).units_inv_right + · simp only [homotopyResolvent, Ring.inverse_non_unit _ hu] + exact Commute.zero_right _ + +theorem hasDerivAt_homotopyResolvent [CompleteSpace H] (A : Operator H) + {a z : ℂ} (ha : a ∈ numericalClosure A) {s : ℝ} + (hs : s ∈ Icc (0 : ℝ) 1) (hz : z ∉ numericalClosure A) : + HasDerivAt (fun r : ℝ => homotopyResolvent A a r z) + (homotopyResolvent A a s z * (A - algebraMap ℂ (Operator H) a) * + homotopyResolvent A a s z) s := by + have hu := homotopy_resolvent_isUnit A ha hs hz + have h₁ : HasFDerivAt Ring.inverse _ + (algebraMap ℂ (Operator H) z - operatorHomotopy A a s) := + hasFDerivAt_ringInverse (𝕜 := ℝ) hu.unit + have h₂ : HasDerivAt (fun r : ℝ => algebraMap ℂ (Operator H) z - operatorHomotopy A a r) + (-(A - algebraMap ℂ (Operator H) a)) s := by + simpa only [operatorHomotopy, one_smul, zero_add, zero_sub, id_eq] using! + (((hasDerivAt_id s).smul_const (A - algebraMap ℂ (Operator H) a)).const_add + (algebraMap ℂ (Operator H) a)).const_sub (algebraMap ℂ (Operator H) z) + simpa only [homotopyResolvent, Function.comp_def, neg_apply, + ContinuousLinearMap.mulLeftRight_apply, ← Ring.inverse_unit hu.unit, hu.unit_spec, + mul_neg, neg_mul, neg_neg] using! h₁.comp_hasDerivAt s h₂ + +theorem hasDerivAt_homotopyResolvent_path [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) {s t : ℝ} + (hs : s ∈ Icc (0 : ℝ) 1) (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun r : ℝ => homotopyResolvent A a s (Γ.path r)) + (-(deriv Γ.path t) • (homotopyResolvent A a s (Γ.path t)) ^ 2) t := by + have hu := homotopy_resolvent_isUnit A ha hs (Γ.avoids t ht).2 + have h₁ := spectrum.hasDerivAt_resolvent_const_left (𝕜 := ℂ) hu + have h₂ : HasDerivAt Γ.path (deriv Γ.path t) t := + (Γ.smooth.differentiable (by norm_num) t).hasDerivAt + have h := (h₁.hasFDerivAt.restrictScalars ℝ).comp_hasDerivAt t h₂ + simpa [homotopyResolvent, resolvent, neg_smul, Function.comp_def] using! h + +theorem continuousOn_homotopyResolvent_path [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) : + ContinuousOn (fun p : ℝ × ℝ => homotopyResolvent A a p.1 (Γ.path p.2)) + (Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) 1) := + (continuousOn_homotopyResolvent A ha).comp + ((continuous_fst.prodMk (Γ.smooth.continuous.comp continuous_snd)).continuousOn) + (fun p hp => ⟨hp.1, (Γ.avoids p.2 hp.2).2⟩) + +def homotopyKernel (A : Operator H) (a : ℂ) (Γ : SmoothContour) (s t : ℝ) : Operator H := + deriv Γ.path t • (homotopyResolvent A a s (Γ.path t) * + (A - algebraMap ℂ (Operator H) a) * homotopyResolvent A a s (Γ.path t)) + +theorem continuousOn_homotopyKernel [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) : + ContinuousOn (Function.uncurry (homotopyKernel A a Γ.toSmoothContour)) + (Icc (0 : ℝ) 1 ×ˢ Icc (0 : ℝ) 1) := by + have hr := continuousOn_homotopyResolvent_path A Γ ha + exact (Γ.smooth.continuous_deriv_one.comp continuous_snd).continuousOn.smul + ((hr.mul continuousOn_const).mul hr) + +theorem intervalIntegrable_homotopyKernel_left [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + IntervalIntegrable (fun s => homotopyKernel A a Γ.toSmoothContour s t) + MeasureTheory.volume (0 : ℝ) 1 := by + have hc := (continuousOn_homotopyKernel A Γ ha).comp + (continuous_id.prodMk continuous_const).continuousOn (fun s hs => ⟨hs, ht⟩) + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one, Function.comp_def, Function.uncurry_def] using! hc + +theorem intervalIntegrable_homotopyKernel_right [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : + IntervalIntegrable (homotopyKernel A a Γ.toSmoothContour s) + MeasureTheory.volume (0 : ℝ) 1 := by + have hc := (continuousOn_homotopyKernel A Γ ha).comp + (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hs, ht⟩) + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one, Function.comp_def, Function.uncurry_def] using! hc + +theorem integral_homotopyKernel_left [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : + (∫ s in (0 : ℝ)..1, homotopyKernel A a Γ.toSmoothContour s t) = + deriv Γ.path t • homotopyResolvent A a 1 (Γ.path t) - + deriv Γ.path t • homotopyResolvent A a 0 (Γ.path t) := by + apply intervalIntegral.integral_eq_sub_of_hasDerivAt + (f := fun r => deriv Γ.path t • homotopyResolvent A a r (Γ.path t)) _ + (intervalIntegrable_homotopyKernel_left A Γ ha ht) + intro s hs + exact (hasDerivAt_homotopyResolvent A ha (by simpa using hs) (Γ.avoids t ht).2).const_smul + (deriv Γ.path t) + +theorem hasDerivAt_homotopyKernel_primitive [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) {s t : ℝ} + (hs : s ∈ Icc (0 : ℝ) 1) (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun r : ℝ => -((A - algebraMap ℂ (Operator H) a) * + homotopyResolvent A a s (Γ.path r))) + (homotopyKernel A a Γ.toSmoothContour s t) t := by + have h := (hasDerivAt_homotopyResolvent_path A Γ ha hs ht).const_mul + (A - algebraMap ℂ (Operator H) a) |>.neg + have hc := (commute_homotopyResolvent A a s (Γ.path t)).eq + simpa only [homotopyKernel, mul_smul_comm, neg_smul, mul_neg, neg_neg, + sq, ← mul_assoc, hc] using! h + +theorem integral_homotopyKernel_right [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) {s : ℝ} (hs : s ∈ Icc (0 : ℝ) 1) : + (∫ t in (0 : ℝ)..1, homotopyKernel A a Γ.toSmoothContour s t) = 0 := by + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t ht => hasDerivAt_homotopyKernel_primitive A Γ ha hs (by simpa using ht)) + (intervalIntegrable_homotopyKernel_right A Γ ha hs) + simpa only [Γ.closed, sub_self] using he + +theorem integral_integral_homotopyKernel [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) : + (∫ t in (0 : ℝ)..1, ∫ s in (0 : ℝ)..1, homotopyKernel A a Γ.toSmoothContour s t) = 0 := by + have hc := continuousOn_homotopyKernel A Γ ha + have hi := (hc.integrableOn_compact (μ := MeasureTheory.volume) (isCompact_Icc.prod isCompact_Icc)).mono_set + (Set.prod_mono Ioc_subset_Icc_self Ioc_subset_Icc_self) + have hFub := MeasureTheory.intervalIntegral_intervalIntegral_swap + (F := homotopyKernel A a Γ.toSmoothContour) + (a := (0 : ℝ)) (b := 1) (c := 0) (d := 1) (by simpa using! hi) + rw [← hFub] + calc + _ = ∫ _s in (0 : ℝ)..1, (0 : Operator H) := by + apply intervalIntegral.integral_congr + intro s hs + exact integral_homotopyKernel_right A Γ ha (by simpa using hs) + _ = 0 := by simp + +theorem integral_resolvent_homotopy [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {a : ℂ} (ha : a ∈ numericalClosure A) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t • Ring.inverse (algebraMap ℂ (Operator H) (Γ.path t) - A)) = + ∫ t in (0 : ℝ)..1, deriv Γ.path t • + Ring.inverse (algebraMap ℂ (Operator H) (Γ.path t) - algebraMap ℂ (Operator H) a) := by + have hint (s : ℝ) (hs : s ∈ Icc (0 : ℝ) 1) : + IntervalIntegrable (fun t => deriv Γ.path t • homotopyResolvent A a s (Γ.path t)) + MeasureTheory.volume (0 : ℝ) 1 := by + have hc := (continuousOn_homotopyResolvent_path A Γ ha).comp + (continuous_const.prodMk continuous_id).continuousOn (fun t ht => ⟨hs, ht⟩) + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using! + Γ.smooth.continuous_deriv_one.continuousOn.smul hc + have he : (∫ t in (0 : ℝ)..1, deriv Γ.path t • homotopyResolvent A a 1 (Γ.path t)) = + ∫ t in (0 : ℝ)..1, deriv Γ.path t • homotopyResolvent A a 0 (Γ.path t) := by + apply sub_eq_zero.mp + rw [← intervalIntegral.integral_sub (hint 1 ⟨zero_le_one, le_rfl⟩) (hint 0 ⟨le_rfl, zero_le_one⟩)] + convert integral_integral_homotopyKernel A Γ ha using 1 + apply intervalIntegral.integral_congr + intro t ht + exact (integral_homotopyKernel_left A Γ ha (by simpa using ht)).symm + simpa only [homotopyResolvent, operatorHomotopy_one, operatorHomotopy_zero] using he + +theorem ring_inverse_algebraMap (z : ℂ) : + Ring.inverse (algebraMap ℂ (Operator H) z) = z⁻¹ • (1 : Operator H) := by + by_cases hz : z = 0 + · simp [hz] + have hu : IsUnit (algebraMap ℂ (Operator H) z) := + (isUnit_iff_ne_zero.mpr hz).map (algebraMap ℂ (Operator H)) + have he := (Ring.inverse_mul_eq_iff_eq_mul (algebraMap ℂ (Operator H) z) + 1 (z⁻¹ • (1 : Operator H)) hu).mpr (by + rw [← Algebra.algebraMap_eq_smul_one, ← map_mul, mul_inv_cancel₀ hz, map_one]) + simpa only [mul_one] using he + +theorem contourEval_one [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) : + contourEval A Γ.toSmoothContour (fun _ => 1) = 1 := by + nontriviality H + obtain ⟨a, ha⟩ := numericalClosure_nonempty A + unfold contourEval + simp only [mul_one] + rw [integral_resolvent_homotopy A Γ ha] + simp only [← map_sub, ring_inverse_algebraMap, smul_smul, + intervalIntegral.integral_smul_const, smul_smul] + change Γ.toSmoothContour.index a • (1 : Operator H) = 1 + rw [Γ.index_inside a ha, one_smul] + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ContourPolynomials.lean b/lean/OAI/Analysis/Crouzeix/ContourPolynomials.lean new file mode 100644 index 0000000000000000000000000000000000000000..a70ba4efc110f810c479f09cdfa4146592f2686d --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ContourPolynomials.lean @@ -0,0 +1,249 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ContourHomotopy +import OAI.Analysis.Crouzeix.MatrixContours + +namespace OAI + +/-! Contour Polynomials. -/ + +noncomputable section + +open scoped InnerProductSpace Topology TensorProduct Matrix.Norms.L2Operator + +open Set Filter + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem SmoothContour.integral_deriv_mul_pow (Γ : SmoothContour) (n : ℕ) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t * (Γ.path t) ^ n) = 0 := by + have hn : (n + 1 : ℂ) ≠ 0 := by exact_mod_cast n.succ_ne_zero + have hder (t : ℝ) : HasDerivAt (fun r : ℝ => (n + 1 : ℂ)⁻¹ * Γ.path r ^ (n + 1)) + (deriv Γ.path t * Γ.path t ^ n) t := by + have h := ((Γ.smooth.differentiable (by norm_num) t).hasDerivAt.pow (n + 1)).const_mul + (n + 1 : ℂ)⁻¹ + convert! h using 1 + simp only [Nat.cast_add, Nat.cast_one, Nat.add_sub_cancel] + rw [← mul_assoc, ← mul_assoc, inv_mul_cancel₀ hn, one_mul, mul_comm] + have hi : IntervalIntegrable (fun t => deriv Γ.path t * Γ.path t ^ n) + MeasureTheory.volume (0 : ℝ) 1 := + (Γ.smooth.continuous_deriv_one.mul (Γ.smooth.continuous.pow n)).intervalIntegrable _ _ + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hder t) hi + simpa only [Γ.closed, sub_self] using he + +theorem smul_resolvent_eq [CompleteSpace H] (A : Operator H) {z : ℂ} + (hz : z ∉ numericalClosure A) : + z • Ring.inverse (algebraMap ℂ (Operator H) z - A) = + 1 + A * Ring.inverse (algebraMap ℂ (Operator H) z - A) := by + have hu : IsUnit (algebraMap ℂ (Operator H) z - A) := by + change z ∈ resolventSet ℂ A + by_contra he + exact hz (spectrum_subset_numericalClosure A he) + have he := Ring.mul_inverse_cancel _ hu + rw [sub_mul, Algebra.algebraMap_eq_smul_one, smul_mul_assoc, one_mul] at he + exact sub_eq_iff_eq_add.mp he + +theorem contourEval_mul_id_of_integral_eq_zero [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {f : ℂ → ℂ} + (hf : ContinuousOn f Γ.toSmoothContour.trace) + (hzero : (∫ t in (0 : ℝ)..1, deriv Γ.path t * f (Γ.path t)) = 0) : + contourEval A Γ.toSmoothContour (fun z => z * f z) = + A * contourEval A Γ.toSmoothContour f := by + let p := fun t : ℝ => f (Γ.path t) • contourKernel A Γ.toSmoothContour t + let q := fun t : ℝ => deriv Γ.path t * f (Γ.path t) + let L := ContinuousLinearMap.mul ℂ (Operator H) A + have hfc : ContinuousOn (fun t => f (Γ.path t)) (Icc (0 : ℝ) 1) := + hf.comp Γ.smooth.continuous.continuousOn (fun t ht => mem_image_of_mem _ ht) + have hp : ContinuousOn p (Icc (0 : ℝ) 1) := hfc.smul (continuousOn_contourKernel A Γ) + have hq : ContinuousOn q (Icc (0 : ℝ) 1) := Γ.smooth.continuous_deriv_one.continuousOn.mul hfc + have hip : IntervalIntegrable p MeasureTheory.volume (0 : ℝ) 1 := + intervalIntegrable_contourIntegrand A Γ hf + have hiL : IntervalIntegrable (fun t => L (p t)) MeasureTheory.volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one, Function.comp_def] using! + L.continuous.comp_continuousOn hp + have hiq : IntervalIntegrable (fun t => q t • (1 : Operator H)) + MeasureTheory.volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using! hq.smul continuousOn_const + have halg (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + (Γ.path t * f (Γ.path t)) • contourKernel A Γ.toSmoothContour t = + q t • (1 : Operator H) + L (p t) := by + have he := smul_resolvent_eq A (Γ.avoids t ht).2 + have hscalar : Γ.path t * f (Γ.path t) * deriv Γ.path t = + (deriv Γ.path t * f (Γ.path t)) * Γ.path t := by ring + dsimp only [contourKernel, p, q, L] + rw [smul_smul, hscalar, ← smul_smul, he, smul_add] + congr 1 + simp only [ContinuousLinearMap.mul_apply', mul_smul_comm, smul_smul] + rw [mul_comm (f (Γ.path t))] + rw [contourEval_eq_kernel, contourEval_eq_kernel] + have hi : (∫ t in (0 : ℝ)..1, (Γ.path t * f (Γ.path t)) • contourKernel A Γ.toSmoothContour t) = + L (∫ t in (0 : ℝ)..1, p t) := by + calc + _ = ∫ t in (0 : ℝ)..1, q t • (1 : Operator H) + L (p t) := + intervalIntegral.integral_congr (fun t ht => halg t (by simpa using ht)) + _ = (∫ t in (0 : ℝ)..1, q t) • (1 : Operator H) + L (∫ t in (0 : ℝ)..1, p t) := by + rw [intervalIntegral.integral_add hiq hiL, intervalIntegral.integral_smul_const, + L.intervalIntegral_comp_comm hip] + _ = _ := by rw [show (∫ t in (0 : ℝ)..1, q t) = 0 from hzero, zero_smul, zero_add] + rw [hi] + exact (map_smul L _ _).symm + +theorem contourEval_pow [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (n : ℕ) : + contourEval A Γ.toSmoothContour (fun z => z ^ n) = A ^ n := by + induction n with + | zero => simpa only [pow_zero] using contourEval_one A Γ + | succ n ih => + have he := contourEval_mul_id_of_integral_eq_zero A Γ + (continuous_pow n).continuousOn (Γ.toSmoothContour.integral_deriv_mul_pow n) + simpa only [pow_succ', ih] using he + +theorem contourEval_const_mul (A : Operator H) (Γ : SmoothContour) (c : ℂ) (f : ℂ → ℂ) : + contourEval A Γ (fun z => c * f z) = c • contourEval A Γ f := by + simp only [contourEval_eq_kernel, mul_smul, intervalIntegral.integral_smul] + exact smul_comm _ _ _ + +theorem contourEval_sum [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {ι : Type*} (s : Finset ι) (f : ι → ℂ → ℂ) + (hf : ∀ i ∈ s, ContinuousOn (f i) Γ.toSmoothContour.trace) : + contourEval A Γ.toSmoothContour (fun z => ∑ i ∈ s, f i z) = + ∑ i ∈ s, contourEval A Γ.toSmoothContour (f i) := by + simp only [contourEval_eq_kernel, Finset.sum_smul] + rw [intervalIntegral.integral_finsetSum (fun i hi => intervalIntegrable_contourIntegrand A Γ (hf i hi)), + Finset.smul_sum] + +theorem contourEval_pow_mul_const [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (n : ℕ) (c : ℂ) : + contourEval A Γ.toSmoothContour (fun z => z ^ n * c) = c • A ^ n := by + simp_rw [mul_comm _ c] + rw [contourEval_const_mul, contourEval_pow] + +theorem contourEval_matrixPolynomial_entry [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) (i j : Fin m) : + contourEval A Γ.toSmoothContour (fun z => matrixPolynomial B z i j) = + ∑ k : Fin (d + 1), B k i j • A ^ (k : ℕ) := by + have hc (k : Fin (d + 1)) : ContinuousOn (fun z : ℂ => z ^ (k : ℕ) * B k i j) + Γ.toSmoothContour.trace := ((continuous_pow _).mul continuous_const).continuousOn + simpa only [matrixPolynomial, Matrix.sum_apply, Matrix.smul_apply, smul_eq_mul, + contourEval_pow_mul_const] using + contourEval_sum A Γ Finset.univ (fun k : Fin (d + 1) => fun z => z ^ (k : ℕ) * B k i j) + (fun k _ => hc k) + +theorem matrixContourEval_matrixPolynomial [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + matrixContourEval A Γ.toSmoothContour (matrixPolynomial B) = polynomialEval A B := by + classical + unfold matrixContourEval polynomialEval + simp only [contourEval_matrixPolynomial_entry, ← tensorOperatorCLM_apply, map_sum] + calc + _ = ∑ i, ∑ k, ∑ j, tensorOperator (B k i j • A ^ (k : ℕ)) (Matrix.single i j 1) := by + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_comm + _ = ∑ k, ∑ i, ∑ j, tensorOperator (B k i j • A ^ (k : ℕ)) (Matrix.single i j 1) := Finset.sum_comm + _ = _ := by + apply Finset.sum_congr rfl + intro k _ + exact sum_tensorOperator_entries (A ^ (k : ℕ)) (B k) + +theorem contourEval_polynomial [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (p : Polynomial ℂ) : + contourEval A Γ.toSmoothContour p.eval = Polynomial.aeval A p := by + simp_rw [Polynomial.eval_eq_sum_range, Polynomial.aeval_eq_sum_range] + rw [contourEval_sum A Γ (Finset.range (p.natDegree + 1)) + (fun k z => p.coeff k * z ^ k) + (fun k _ => (continuous_const.mul (continuous_pow k)).continuousOn)] + apply Finset.sum_congr rfl + intro k _ + rw [contourEval_const_mul, contourEval_pow] + +theorem contour_bound_of_uniform_polynomials [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {m : ℕ} + (F : ℂ → Coeff m) (hF : ContinuousOn F (numericalClosure A)) + (hpoly : ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B)) + (degrees : ℕ → ℕ) (B : (n : ℕ) → Fin (degrees n + 1) → Coeff m) + (happrox : TendstoUniformlyOn (fun n => matrixPolynomial (B n)) F atTop + (numericalClosure A ∪ Γ.toSmoothContour.trace)) : + ‖matrixContourEval A Γ.toSmoothContour F‖ ≤ 2 * supNorm (numericalClosure A) F := + contour_bound_of_polynomial_approximation A Γ F hF hpoly + (fun _ B => matrixContourEval_matrixPolynomial A Γ B) degrees B happrox + +theorem contourEval_congr (A : Operator H) (Γ : SmoothContour) {f g : ℂ → ℂ} + (hfg : EqOn f g Γ.trace) : contourEval A Γ f = contourEval A Γ g := by + unfold contourEval + congr 1 + apply intervalIntegral.integral_congr + intro t ht + dsimp only + rw [hfg (show Γ.path t ∈ Γ.trace from + mem_image_of_mem _ (by simpa using ht))] + +theorem contourEval_mul_sub_of_integral_eq_zero [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (a : ℂ) {f : ℂ → ℂ} + (hf : ContinuousOn f Γ.toSmoothContour.trace) + (hzero : (∫ t in (0 : ℝ)..1, deriv Γ.path t * f (Γ.path t)) = 0) : + contourEval A Γ.toSmoothContour (fun z => (z - a) * f z) = + (A - algebraMap ℂ (Operator H) a) * contourEval A Γ.toSmoothContour f := by + have he : (fun z => (z - a) * f z) = (fun z => z * f z) - (fun z => a * f z) := by + ext z + exact sub_mul _ _ _ + rw [he, contourEval_sub A Γ (f := fun z => z * f z) (g := fun z => a * f z) + (continuousOn_id.mul hf) (continuousOn_const.mul hf), + contourEval_mul_id_of_integral_eq_zero A Γ hf hzero, contourEval_const_mul] + rw [sub_mul, Algebra.algebraMap_eq_smul_one, smul_mul_assoc, one_mul] + +theorem SmoothContour.integral_deriv_div_eq_zero (Γ : SmoothContour) {a : ℂ} + (ha : Γ.index a = 0) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t / (Γ.path t - a)) = 0 := by + have hc : (2 * (Real.pi : ℂ) * Complex.I)⁻¹ ≠ 0 := by + apply inv_ne_zero + exact mul_ne_zero (mul_ne_zero (by norm_num) (by exact_mod_cast Real.pi_ne_zero)) Complex.I_ne_zero + exact (mul_eq_zero.mp ha).resolve_left hc + +theorem contourEval_inv_sub [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {a : ℂ} (ha : a ∉ U) : + contourEval A Γ.toSmoothContour (fun z => (z - a)⁻¹) = + Ring.inverse (A - algebraMap ℂ (Operator H) a) := by + have hatrace (z : ℂ) (hz : z ∈ Γ.toSmoothContour.trace) : z - a ≠ 0 := by + obtain ⟨t, ht, rfl⟩ := hz + intro he + exact ha (sub_eq_zero.mp he ▸ (Γ.avoids t ht).1) + have hf : ContinuousOn (fun z : ℂ => (z - a)⁻¹) Γ.toSmoothContour.trace := + (continuous_id.sub continuous_const).continuousOn.inv₀ hatrace + have hzero : (∫ t in (0 : ℝ)..1, deriv Γ.path t * (Γ.path t - a)⁻¹) = 0 := by + simpa only [div_eq_mul_inv] using + Γ.toSmoothContour.integral_deriv_div_eq_zero (Γ.index_outside a ha) + have he := contourEval_mul_sub_of_integral_eq_zero A Γ a hf hzero + have hcongr : contourEval A Γ.toSmoothContour (fun z => (z - a) * (z - a)⁻¹) = 1 := by + calc + _ = contourEval A Γ.toSmoothContour (fun _ => 1) := + contourEval_congr A Γ.toSmoothContour (fun z hz => mul_inv_cancel₀ (hatrace z hz)) + _ = 1 := contourEval_one A Γ + have haK : a ∉ numericalClosure A := by + intro h + exact one_ne_zero ((Γ.index_inside a h).symm.trans (Γ.index_outside a ha)) + have hu : IsUnit (A - algebraMap ℂ (Operator H) a) := by + have hu0 : IsUnit (algebraMap ℂ (Operator H) a - A) := by + change a ∈ resolventSet ℂ A + by_contra h + exact haK (spectrum_subset_numericalClosure A h) + simpa only [neg_sub] using hu0.neg + have h := (Ring.inverse_mul_eq_iff_eq_mul (A - algebraMap ℂ (Operator H) a) + 1 (contourEval A Γ.toSmoothContour (fun z => (z - a)⁻¹)) hu).mpr + (hcongr.symm.trans he) + simpa only [mul_one] using h.symm + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ConvexApproximation.lean b/lean/OAI/Analysis/Crouzeix/ConvexApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c312dec666af2dedc4a7a3b1bb68aa8d53bd1eed --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ConvexApproximation.lean @@ -0,0 +1,60 @@ +import Mathlib +import OAI.Analysis.Crouzeix.DiskBoundaryChart + +namespace OAI + +/-! Convex Approximation. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +theorem isSimplyConnected_of_convex {U : Set ℂ} (hc : Convex ℝ U) (hne : U.Nonempty) : + IsSimplyConnected U := by + let _ := hc.contractibleSpace hne + change SimplyConnectedSpace U + infer_instance + +theorem exists_convex_analytic_neighborhood {K V : Set ℂ} (hK : IsCompact K) + (hconv : Convex ℝ K) (hne : K.Nonempty) (hV : IsOpen V) (hKV : K ⊆ V) : + ∃ U : Set ℂ, IsOpen U ∧ Bornology.IsBounded U ∧ Convex ℝ U ∧ + K ⊆ U ∧ closure U ⊆ V ∧ + (∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) := by + obtain ⟨δ, hδ, hδsub⟩ := hK.exists_cthickening_subset_open hV hKV + let N := thickening δ K + have hNo : IsOpen N := isOpen_thickening + have hNb : Bornology.IsBounded N := hK.isBounded.thickening + have hNc : Convex ℝ N := hconv.thickening δ + have hKN : K ⊆ N := self_subset_thickening hδ K + obtain ⟨a, ha⟩ := hne + have hNa : a ∈ N := hKN ha + obtain ⟨f, h, hf, hh, hfb, hhb, hinv, _, _, _⟩ := + riemann_biholomorphic_bounded hNo hNb (isSimplyConnected_of_convex hNc ⟨a, hNa⟩) hNa + obtain ⟨b, hb, hbmax⟩ := hK.exists_isMaxOn ⟨a, ha⟩ ((hf.continuousOn.mono hKN).norm) + obtain ⟨r, hbr, hr1⟩ := exists_between (mem_ball_zero_iff.mp (hfb.mapsTo (hKN hb))) + have hr : 0 < r := (norm_nonneg _).trans_lt hbr + have hKU : K ⊆ h '' ball 0 r := by + intro z hz + exact ⟨f z, mem_ball_zero_iff.mpr ((hbmax hz).trans_lt hbr), hinv.1 (hKN hz)⟩ + have hha := hh.analyticOnNhd isOpen_ball + have hUo := isOpen_image_of_univalent isOpen_ball (hha.mono (ball_subset_ball hr1.le)) + (hhb.injOn.mono (ball_subset_ball hr1.le)) + have hUc := convex_image_subdisk hNc hf hh hhb hinv hr1.le + have hUclosed := closure_image_subdisk hr hr1 hh.continuousOn + have hUsubN : closure (h '' ball 0 r) ⊆ N := by + rw [hUclosed] + rintro z ⟨w, hw, rfl⟩ + exact hhb.mapsTo ((closedBall_subset_ball hr1) hw) + exact ⟨h '' ball 0 r, hUo, hNb.subset (subset_closure.trans hUsubN), hUc, + hKU, hUsubN.trans ((thickening_subset_cthickening δ K).trans hδsub), + fun p hp => boundaryChart_image_subdisk hr hr1 hha hhb.injOn hp⟩ + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ConvexCoordinates.lean b/lean/OAI/Analysis/Crouzeix/ConvexCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..d7cbe84958aecc8c50aa6cd988c6b5fbda956b19 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ConvexCoordinates.lean @@ -0,0 +1,71 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ConformalCollar + +namespace OAI + +/-! Convex Coordinates. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +theorem convex_image_subdisk {U : Set ℂ} (hconv : Convex ℝ U) + {f h : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) + (hh : DifferentiableOn ℂ h (ball 0 1)) (hbij : BijOn h (ball 0 1) U) + (hinv : InvOn h f U (ball 0 1)) {r : ℝ} (hr1 : r ≤ 1) : + Convex ℝ (h '' ball 0 r) := by + rintro x ⟨v, hv, rfl⟩ y ⟨w, hw, rfl⟩ a b ha hb hab + have hvn : ‖v‖ < r := mem_ball_zero_iff.mp hv + have hwn : ‖w‖ < r := mem_ball_zero_iff.mp hw + obtain ⟨s, hslow, hsr⟩ := exists_between (max_lt hvn hwn) + have hs : 0 < s := (norm_nonneg v).trans_lt (lt_of_le_of_lt (le_max_left _ _) hslow) + have hvs : ‖v‖ < s := (le_max_left _ _).trans_lt hslow + have hws : ‖w‖ < s := (le_max_right _ _).trans_lt hslow + have hscale : ∀ z t : ℂ, ‖t‖ < s → z ∈ ball 0 1 → z * (t / (s : ℂ)) ∈ ball 0 1 := by + intro z t ht hz + rw [mem_ball_zero_iff, norm_mul, norm_div, Complex.norm_real, Real.norm_of_nonneg hs.le] + have hc : ‖t‖ / s < 1 := (div_lt_one hs).mpr ht + calc + ‖z‖ * (‖t‖ / s) ≤ ‖z‖ * 1 := mul_le_mul_of_nonneg_left hc.le (norm_nonneg _) + _ < 1 := by simpa only [mul_one] using mem_ball_zero_iff.mp hz + let p : ℂ → ℂ := fun z => a • h (z * (v / (s : ℂ))) + b • h (z * (w / (s : ℂ))) + have hpU : MapsTo p (ball 0 1) U := fun z hz => + hconv (hbij.mapsTo (hscale z v hvs hz)) (hbij.mapsTo (hscale z w hws hz)) ha hb hab + have hpD : DifferentiableOn ℂ p (ball 0 1) := by + intro z hz + have h₁ : DifferentiableAt ℂ (fun z => h (z * (v / (s : ℂ)))) z := ((hh _ (hscale z v hvs hz)).differentiableAt + (isOpen_ball.mem_nhds (hscale z v hvs hz))).comp z (differentiableAt_id.mul_const _) + have h₂ : DifferentiableAt ℂ (fun z => h (z * (w / (s : ℂ)))) z := ((hh _ (hscale z w hws hz)).differentiableAt + (isOpen_ball.mem_nhds (hscale z w hws hz))).comp z (differentiableAt_id.mul_const _) + exact ((h₁.const_smul a).add (h₂.const_smul b)).differentiableWithinAt + have hfmap : MapsTo f U (ball 0 1) := (hbij.symm hinv).mapsTo + have hφD : DifferentiableOn ℂ (f ∘ p) (ball 0 1) := hf.comp hpD hpU + have hφmap : MapsTo (f ∘ p) (ball 0 1) (closedBall 0 1) := + fun z hz => ball_subset_closedBall (hfmap (hpU hz)) + have hp0 : p 0 = h 0 := by simp only [p, zero_mul, ← add_smul, hab, one_smul] + have hφ0 : (f ∘ p) 0 = 0 := by + rw [comp_apply, hp0] + exact hinv.2 (mem_ball_self zero_lt_one) + have hs1 : ‖(s : ℂ)‖ < 1 := by + rw [Complex.norm_real, Real.norm_of_nonneg hs.le] + exact hsr.trans_le hr1 + have hn := Complex.norm_le_norm_of_mapsTo_ball hφD hφmap hφ0 hs1 + have hps : p (s : ℂ) = a • h v + b • h w := by + have hn : (s : ℂ) ≠ 0 := by exact_mod_cast hs.ne' + simp only [p, mul_div_cancel₀ _ hn] + have hpUs : a • h v + b • h w ∈ U := hps ▸ hpU (mem_ball_zero_iff.mpr hs1) + refine ⟨f (a • h v + b • h w), ?_, hinv.1 hpUs⟩ + apply mem_ball_zero_iff.mpr + have he : ‖(s : ℂ)‖ = s := by rw [Complex.norm_real, Real.norm_of_nonneg hs.le] + rw [comp_apply, hps, he] at hn + exact hn.trans_lt hsr + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ConvexNeighborhood.lean b/lean/OAI/Analysis/Crouzeix/ConvexNeighborhood.lean new file mode 100644 index 0000000000000000000000000000000000000000..3715e42eb07cbc3be5605a9001bbfb6abff1d008 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ConvexNeighborhood.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Convexity + +namespace OAI + +/-! Convex Neighborhood. -/ + +noncomputable section + +open Set Metric + +open scoped Convex InnerProductSpace + +namespace CrouzeixHilbert + +theorem convex_outward_not_mem {K : Set ℂ} (hK : Convex ℝ K) + {a x : ℂ} (ha : a ∈ K) (hx : x ∉ K) {t : ℝ} (ht : 1 ≤ t) : + a + t • (x - a) ∉ K := by + intro hy + have htp : 0 < t := lt_of_lt_of_le zero_lt_one ht + have hz := hK.add_smul_sub_mem ha hy + (show t⁻¹ ∈ Icc (0 : ℝ) 1 from + ⟨inv_nonneg.mpr htp.le, inv_le_one_of_one_le₀ ht⟩) + simp only [add_sub_cancel_left, smul_smul, inv_mul_cancel₀ htp.ne', + one_smul, add_sub_cancel] at hz + exact hx hz + +theorem segment_outward_subset_compl {K : Set ℂ} (hK : Convex ℝ K) + {a x : ℂ} (ha : a ∈ K) (hx : x ∉ K) {r : ℝ} (hr : 1 ≤ r) : + [x -[ℝ] (a + r • (x - a))] ⊆ Kᶜ := by + rw [segment_eq_image'] + rintro z ⟨t, ht, rfl⟩ + have he : x + t • (a + r • (x - a) - x) = + a + (1 + t * (r - 1)) • (x - a) := by module + dsimp only + rw [he] + exact convex_outward_not_mem hK ha hx (by nlinarith [ht.1]) + +theorem isPathConnected_compl_of_bounded_convex {K : Set ℂ} + (hK : Bornology.IsBounded K) (hc : Convex ℝ K) : IsPathConnected Kᶜ := by + rcases K.eq_empty_or_nonempty with h0 | ⟨a, ha⟩ + · rw [h0, compl_empty] + exact convex_univ.isPathConnected ⟨0, mem_univ _⟩ + have hrank : 1 < Module.rank ℝ ℂ := by simp + have hn : Kᶜ.Nonempty := by + obtain ⟨R, hR, hb⟩ := hK.subset_ball_lt 0 a + obtain ⟨z, hz⟩ := (isPathConnected_sphere hrank a hR.le).nonempty + refine ⟨z, ?_⟩ + intro hzK + have := mem_ball.mp (hb hzK) + rw [mem_sphere.mp hz] at this + exact lt_irrefl _ this + apply isPathConnected_iff.mpr + refine ⟨hn, ?_⟩ + intro x hx y hy + obtain ⟨R, hR, hb⟩ := hK.subset_ball_lt (max (dist x a) (dist y a)) a + have hRx : dist x a < R := lt_of_le_of_lt (le_max_left _ _) hR + have hRy : dist y a < R := lt_of_le_of_lt (le_max_right _ _) hR + have hRp : 0 < R := lt_of_le_of_lt dist_nonneg hRx + have hsphere : sphere a R ⊆ Kᶜ := by + intro z hz hzK + have hlt := mem_ball.mp (hb hzK) + rw [mem_sphere.mp hz] at hlt + exact lt_irrefl _ hlt + have hradial (v : ℂ) (hv : v ∈ Kᶜ) (hRv : dist v a < R) : + ∃ q ∈ sphere a R, JoinedIn Kᶜ v q := by + have hvne : v - a ≠ 0 := by + intro he + exact hv (sub_eq_zero.mp he ▸ ha) + have hnv : 0 < ‖v - a‖ := norm_pos_iff.mpr hvne + have hr : 1 ≤ R / ‖v - a‖ := by + apply (le_div_iff₀ hnv).mpr + simpa only [one_mul, dist_eq_norm] using hRv.le + refine ⟨a + (R / ‖v - a‖) • (v - a), ?_, ?_⟩ + · rw [mem_sphere_iff_norm, add_sub_cancel_left, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (div_nonneg hRp.le hnv.le), div_mul_cancel₀ _ hnv.ne'] + · exact JoinedIn.of_segment_subset (segment_outward_subset_compl hc ha hv hr) + obtain ⟨qx, hqx, jx⟩ := hradial x hx hRx + obtain ⟨qy, hqy, jy⟩ := hradial y hy hRy + exact jx.trans (((isPathConnected_sphere hrank a hRp.le).joinedIn qx hqx qy hqy).mono + hsphere |>.trans jy.symm) + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem exists_compact_convex_neighborhood (A : Operator H) {U : Set ℂ} + (hU : IsOpen U) (hKU : numericalClosure A ⊆ U) : + ∃ ε : ℝ, 0 < ε ∧ + IsCompact (cthickening ε (numericalClosure A)) ∧ + Convex ℝ (cthickening ε (numericalClosure A)) ∧ + numericalClosure A ⊆ interior (cthickening ε (numericalClosure A)) ∧ + cthickening ε (numericalClosure A) ⊆ U ∧ + IsConnected (cthickening ε (numericalClosure A))ᶜ := by + obtain ⟨ε, hε, hεU⟩ := (isCompact_numericalClosure A).exists_cthickening_subset_open hU hKU + have hcmp : IsCompact (cthickening ε (numericalClosure A)) := + (isCompact_numericalClosure A).cthickening + have hc : Convex ℝ (cthickening ε (numericalClosure A)) := + (convex_numericalRange A).closure.cthickening ε + exact ⟨ε, hε, hcmp, hc, + (self_subset_thickening hε _).trans (thickening_subset_interior_cthickening _ _), hεU, + (isPathConnected_compl_of_bounded_convex hcmp.isBounded hc).isConnected⟩ + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Convexity.lean b/lean/OAI/Analysis/Crouzeix/Convexity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1212b28b03e1273382fb47afd9ded225d5dd032a --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Convexity.lean @@ -0,0 +1,142 @@ +import Mathlib +import OAI.Analysis.Crouzeix.NumericalRange + +namespace OAI + +/-! Convexity of the numerical range and its closure. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem phase_real (u v : ℂ) : + ∃ c : ℂ, ‖c‖ = 1 ∧ (c * u + star c * v).im = 0 := by + let d : ℂ := u - star v + have him (c : ℂ) : (c * u + star c * v).im = (c * d).im := by + simp only [d, mul_sub, Complex.add_im, Complex.sub_im, Complex.mul_im, + Complex.star_def, Complex.conj_re, Complex.conj_im] + ring + by_cases hd : d = 0 + · refine ⟨1, norm_one, ?_⟩ + rw [him, hd, mul_zero, Complex.zero_im] + · refine ⟨(‖d‖ : ℂ)⁻¹ * star d, ?_, ?_⟩ + · simp [hd] + · rw [him, mul_assoc] + simp only [Complex.star_def, Complex.conj_mul', ← Complex.ofReal_inv, + ← Complex.ofReal_pow, ← Complex.ofReal_mul, Complex.ofReal_im] + +theorem unit_interval_of_quadratic_endpoints (B : Operator H) + (x y : H) (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + (hBx : ⟪x, B x⟫_ℂ = 0) (hBy : ⟪y, B y⟫_ℂ = 1) + (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + ∃ w : H, ‖w‖ = 1 ∧ ⟪w, B w⟫_ℂ = (t : ℂ) := by + obtain ⟨c, hc, hcross⟩ := phase_real ⟪x, B y⟫_ℂ ⟪y, B x⟫_ℂ + let y' : H := c • y + have hy' : ‖y'‖ = 1 := by simp [y', norm_smul, hc, hy] + have hy'B : ⟪y', B y'⟫_ℂ = 1 := by + simp only [y', map_smul, inner_smul_left, inner_smul_right, hBy, mul_one, + Complex.mul_conj', hc, Complex.ofReal_one, one_pow] + have hc' : (⟪x, B y'⟫_ℂ + ⟪y', B x⟫_ℂ).im = 0 := by + simpa only [y', map_smul, inner_smul_left, inner_smul_right, starRingEnd_apply] using hcross + let q : ℝ → H := fun s => ((1 - s : ℝ) : ℂ) • x + (s : ℂ) • y' + have hq0 (s : ℝ) : q s ≠ 0 := by + intro hz + have heq : (((1 - s : ℝ) : ℂ) • x) = -(s : ℂ) • y' := by + simpa only [neg_smul] using eq_neg_of_add_eq_zero_left hz + have hq := congrArg (fun z : H => ⟪z, B z⟫_ℂ) heq + simp only [map_smul, inner_smul_left, inner_smul_right, hBx, hy'B, mul_zero, + mul_one, map_neg, Complex.conj_ofReal, neg_mul_neg] at hq + have hs : s = 0 := by + have hh := congrArg Complex.re hq + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, mul_zero, + sub_zero, Complex.zero_re] at hh + nlinarith + simp [q, hs] at hz + rw [hz] at hx + norm_num at hx + have hq : Continuous q := by + dsimp [q] + fun_prop + have hqi (s : ℝ) : (⟪q s, B (q s)⟫_ℂ).im = 0 := by + have heq : ⟪q s, B (q s)⟫_ℂ = (s : ℂ) ^ 2 + + (s : ℂ) * (1 - (s : ℂ)) * (⟪x, B y'⟫_ℂ + ⟪y', B x⟫_ℂ) := by + simp only [q, map_add, map_smul, inner_add_left, inner_add_right, + inner_smul_left, inner_smul_right, Complex.conj_ofReal, hBx, hy'B, map_sub, map_one, + mul_zero, mul_one, zero_add, Complex.ofReal_sub, Complex.ofReal_one] + ring + rw [heq] + simp [Complex.add_im, Complex.mul_im, hc', pow_two] + let g : ℝ → H := fun s => (‖q s‖ : ℂ)⁻¹ • q s + have hg (s : ℝ) : ‖g s‖ = 1 := by + simp [g, norm_smul, hq0 s] + have hgc : Continuous g := by + apply Continuous.smul _ hq + apply Continuous.inv₀ (Complex.continuous_ofReal.comp hq.norm) + intro s + change (‖q s‖ : ℂ) ≠ 0 + exact_mod_cast norm_ne_zero_iff.mpr (hq0 s) + have hgi (s : ℝ) : (⟪g s, B (g s)⟫_ℂ).im = 0 := by + simp only [g, map_smul, inner_smul_left, inner_smul_right, ← Complex.ofReal_inv, + Complex.conj_ofReal, Complex.mul_im, Complex.ofReal_im, Complex.ofReal_re, hqi s] + ring + let f : ℝ → ℝ := fun s => (⟪g s, B (g s)⟫_ℂ).re + have hfc : Continuous f := Complex.continuous_re.comp (hgc.inner (𝕜 := ℂ) (B.continuous.comp hgc)) + have hf0 : f 0 = 0 := by simp [f, g, q, hx, hBx] + have hf1 : f 1 = 1 := by simp [f, g, q, hy', hy'B] + have hmem : t ∈ Icc (f 0) (f 1) := by simpa only [hf0, hf1] using ht + obtain ⟨s, _, hs⟩ := intermediate_value_Icc (by norm_num : (0 : ℝ) ≤ 1) hfc.continuousOn hmem + refine ⟨g s, hg s, ?_⟩ + apply Complex.ext + · exact hs + · exact hgi s + +theorem convex_numericalRange (A : Operator H) : Convex ℝ (numericalRange A) := by + intro a ha b hb α β hα hβ hsum + by_cases hab : a = b + · subst b + rw [← add_smul, hsum, one_smul] + exact ha + obtain ⟨x, hx, hAx⟩ := ha + obtain ⟨y, hy, hAy⟩ := hb + have hba : b - a ≠ 0 := sub_ne_zero.mpr (Ne.symm hab) + let B : Operator H := (b - a)⁻¹ • (A - a • 1) + have hform (v : H) (hv : ‖v‖ = 1) : + ⟪v, B v⟫_ℂ = (b - a)⁻¹ * (⟪v, A v⟫_ℂ - a) := by + simp [B, inner_self_eq_norm_sq_to_K, hv] + have hBx : ⟪x, B x⟫_ℂ = 0 := by rw [hform x hx, hAx, sub_self, mul_zero] + have hBy : ⟪y, B y⟫_ℂ = 1 := by rw [hform y hy, hAy, inv_mul_cancel₀ hba] + obtain ⟨w, hw, hwB⟩ := unit_interval_of_quadratic_endpoints B x y hx hy hBx hBy + β ⟨hβ, by linarith⟩ + refine ⟨w, hw, ?_⟩ + rw [hform w hw] at hwB + have hid := congrArg (fun z : ℂ => (b - a) * z) hwB + simp only [← mul_assoc, mul_inv_cancel₀ hba, one_mul] at hid + have hsumC : (α : ℂ) + (β : ℂ) = 1 := by exact_mod_cast hsum + calc + ⟪w, A w⟫_ℂ = (⟪w, A w⟫_ℂ - a) + a := by ring + _ = (b - a) * (β : ℂ) + a := by rw [hid] + _ = α • a + β • b := by + simp only [Complex.real_smul] + linear_combination -a * hsumC + +theorem convex_numericalClosure (A : Operator H) : Convex ℝ (numericalClosure A) := + (convex_numericalRange A).closure + +theorem hilbert_geometry [CompleteSpace H] (A : Operator H) : + IsCompact (numericalClosure A) ∧ Convex ℝ (numericalClosure A) ∧ + spectrum ℂ A ⊆ numericalClosure A := + ⟨isCompact_numericalClosure A, convex_numericalClosure A, + spectrum_subset_numericalClosure A⟩ + +end CrouzeixHilbert +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Definitions.lean b/lean/OAI/Analysis/Crouzeix/Definitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed9757254cbb037770a03d165f647051a006b36e --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Definitions.lean @@ -0,0 +1,148 @@ +import Mathlib + +namespace OAI + +/-! Numerical ranges, completed tensor amplification, and holomorphic and rational operator evaluation. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u + +abbrev Operator (H : Type u) [NormedAddCommGroup H] [NormedSpace ℂ H] := H →L[ℂ] H + +abbrev Coeff (m : ℕ) := Matrix (Fin m) (Fin m) ℂ + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +def numericalRange (A : Operator H) : Set ℂ := + {z | ∃ x : H, ‖x‖ = 1 ∧ ⟪x, A x⟫_ℂ = z} + +def numericalClosure (A : Operator H) : Set ℂ := closure (numericalRange A) + +def supNorm {E : Type*} [NormedAddCommGroup E] (S : Set ℂ) (F : ℂ → E) : ℝ := + sSup (insert 0 ((fun z => ‖F z‖) '' S)) + +abbrev Amplification (H : Type u) [NormedAddCommGroup H] [InnerProductSpace ℂ H] + (m : ℕ) := UniformSpace.Completion (H ⊗[ℂ] EuclideanSpace ℂ (Fin m)) + +def tensorOperator (A : Operator H) {m : ℕ} (B : Coeff m) : + Operator (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 : ℕ) • B k + +def polynomialEval (A : Operator H) {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + Operator (Amplification H m) := + ∑ k : Fin (d + 1), tensorOperator (A ^ (k : ℕ)) (B k) + +structure SmoothContour where + path : ℝ → ℂ + smooth : ContDiff ℝ 1 path + closed : path 0 = path 1 + +def SmoothContour.index (Γ : SmoothContour) (z : ℂ) : ℂ := + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ * + ∫ t in (0 : ℝ)..1, deriv Γ.path t / (Γ.path t - z) + +structure CalculusContour (K U : Set ℂ) extends SmoothContour where + avoids : ∀ t ∈ Icc (0 : ℝ) 1, path t ∈ U \ K + index_inside : ∀ z ∈ K, toSmoothContour.index z = 1 + index_outside : ∀ z ∉ U, toSmoothContour.index z = 0 + +def contourEval (A : Operator H) (Γ : SmoothContour) (f : ℂ → ℂ) : Operator H := + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∫ t in (0 : ℝ)..1, (deriv Γ.path t * f (Γ.path t)) • + Ring.inverse (algebraMap ℂ (Operator H) (Γ.path t) - A) + +def holomorphicEval (A : Operator H) (U : Set ℂ) (f : ℂ → ℂ) : Operator H := by + classical + exact if h : Nonempty (CalculusContour (numericalClosure A) U) then + contourEval A (Classical.choice h).toSmoothContour f + else 0 + +def matrixHolomorphicEval (A : Operator H) {m : ℕ} (U : Set ℂ) + (F : ℂ → Coeff m) : Operator (Amplification H m) := + ∑ i, ∑ j, tensorOperator (holomorphicEval A U (fun z => F z i j)) + (Matrix.single i j 1) + +def EntrywiseHolomorphic {m : ℕ} (U : Set ℂ) (F : ℂ → Coeff m) : Prop := + ∀ i j, DifferentiableOn ℂ (fun z => F z i j) U + +abbrev RationalMatrix (m : ℕ) := Matrix (Fin m) (Fin m) (RatFunc ℂ) + +def PolesOutside {m : ℕ} (K : Set ℂ) (R : RationalMatrix m) : Prop := + ∀ i j z, z ∈ K → (R i j).denom.eval z ≠ 0 + +def matrixRationalFunction {m : ℕ} (R : RationalMatrix m) (z : ℂ) : Coeff m := + fun i j => RatFunc.eval (RingHom.id ℂ) z (R i j) + +def rationalEval (A : Operator H) (r : RatFunc ℂ) : Operator H := + (Polynomial.aeval A r.num) * Ring.inverse (Polynomial.aeval A r.denom) + +def matrixRationalEval (A : Operator H) {m : ℕ} (R : RationalMatrix m) : + Operator (Amplification H m) := + ∑ i, ∑ j, tensorOperator (rationalEval A (R i j)) (Matrix.single i j 1) + +def NonzeroConclusion (A : Operator H) : Prop := + IsCompact (numericalClosure A) ∧ + Convex ℝ (numericalClosure A) ∧ + spectrum ℂ A ⊆ numericalClosure A ∧ + (∀ (m : ℕ), 0 < m → ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B) ∧ + supNorm (numericalRange A) (matrixPolynomial B) = + supNorm (numericalClosure A) (matrixPolynomial B) ∧ + ∃ z ∈ numericalClosure A, + supNorm (numericalClosure A) (matrixPolynomial B) = ‖matrixPolynomial B z‖) ∧ + (∀ (m : ℕ), 0 < m → ∀ (U : Set ℂ) (F : ℂ → Coeff m), + IsOpen U → numericalClosure A ⊆ U → EntrywiseHolomorphic U F → + Nonempty (CalculusContour (numericalClosure A) U) ∧ + (∀ Γ : CalculusContour (numericalClosure A) U, ∀ i j, + holomorphicEval A U (fun z => F z i j) = + contourEval A Γ.toSmoothContour (fun z => F z i j)) ∧ + ‖matrixHolomorphicEval A U F‖ ≤ 2 * supNorm (numericalClosure A) F ∧ + ∃ z ∈ numericalClosure A, supNorm (numericalClosure A) F = ‖F z‖) ∧ + (∀ (m : ℕ), 0 < m → ∀ (R : RationalMatrix m), + PolesOutside (numericalClosure A) R → + (∀ i j, IsUnit (Polynomial.aeval A (R i j).denom)) ∧ + ‖matrixRationalEval A R‖ ≤ + 2 * supNorm (numericalClosure A) (matrixRationalFunction R) ∧ + (∃ z ∈ numericalClosure A, + supNorm (numericalClosure A) (matrixRationalFunction R) = + ‖matrixRationalFunction R z‖) ∧ + ∃ U : Set ℂ, IsOpen U ∧ numericalClosure A ⊆ U ∧ + EntrywiseHolomorphic U (matrixRationalFunction R) ∧ + matrixRationalEval A R = matrixHolomorphicEval A U (matrixRationalFunction R)) + +def ZeroConclusion (A : Operator H) : Prop := + numericalRange A = ∅ ∧ + (∀ (m d : ℕ) (B : Fin (d + 1) → Coeff m), + polynomialEval A B = 0 ∧ + supNorm (numericalRange A) (matrixPolynomial B) = 0 ∧ + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B)) ∧ + (∀ (m : ℕ) (U : Set ℂ) (F : ℂ → Coeff m), + matrixHolomorphicEval A U F = 0 ∧ + supNorm (numericalRange A) F = 0 ∧ + ‖matrixHolomorphicEval A U F‖ ≤ 2 * supNorm (numericalRange A) F) ∧ + (∀ (m : ℕ) (R : RationalMatrix m), + matrixRationalEval A R = 0 ∧ + supNorm (numericalRange A) (matrixRationalFunction R) = 0 ∧ + ‖matrixRationalEval A R‖ ≤ + 2 * supNorm (numericalRange A) (matrixRationalFunction R)) + +def SharpConstant : Prop := + ∃ (A : Operator (EuclideanSpace ℂ (Fin 2))) (B : Fin 2 → Coeff 1), + supNorm (numericalRange A) (matrixPolynomial (d := 1) B) = 1 ∧ + ‖polynomialEval A (d := 1) B‖ = 2 + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Density.lean b/lean/OAI/Analysis/Crouzeix/Density.lean new file mode 100644 index 0000000000000000000000000000000000000000..3da29fd87480c4799cb72ea4460f983b767fdd1a --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Density.lean @@ -0,0 +1,143 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryOperators + +namespace OAI + +/-! Density. -/ + +noncomputable section + +open scoped InnerProductSpace Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +open MeasureTheory + +namespace CrouzeixHilbert.Boundary + +section Equality + +variable {E H : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem eq_of_norm_le_inner (u v : H) (hn : ‖u‖ ≤ ‖v‖) + (hi : ⟪v, u⟫_ℂ = ⟪v, v⟫_ℂ) : u = v := by + have he : RCLike.re ⟪u, v⟫_ℂ = ‖v‖ ^ 2 := by + rw [inner_re_symm, hi, ← norm_sq_eq_re_inner] + have hd := norm_sub_sq (𝕜 := ℂ) u v + rw [he] at hd + have hz : ‖u - v‖ = 0 := by + nlinarith only [hd, hn, norm_nonneg u, norm_nonneg v, norm_nonneg (u - v), sq_nonneg ‖u - v‖] + exact sub_eq_zero.mp (norm_eq_zero.mp hz) + +variable [CompleteSpace E] [CompleteSpace H] + +theorem adjoint_eq_of_contraction (M : E →L[ℂ] H) (hM : ‖M‖ ≤ 1) + (x : E) (y : H) (hxy : M x = y) (hn : ‖x‖ = ‖y‖) : + ContinuousLinearMap.adjoint M y = x := by + apply eq_of_norm_le_inner + · calc + ‖(ContinuousLinearMap.adjoint M) y‖ ≤ ‖ContinuousLinearMap.adjoint M‖ * ‖y‖ := + (ContinuousLinearMap.adjoint M).le_opNorm y + _ = ‖M‖ * ‖y‖ := by rw [ContinuousLinearMap.adjoint.norm_map] + _ ≤ 1 * ‖y‖ := mul_le_mul_of_nonneg_right hM (norm_nonneg _) + _ = ‖x‖ := by rw [one_mul, hn] + · rw [ContinuousLinearMap.adjoint_inner_right, hxy, inner_self_eq_norm_sq_to_K, + inner_self_eq_norm_sq_to_K, hn] + +theorem equality_in_compression (V : E →ₗᵢ[ℂ] H) (M : H →L[ℂ] H) + (hM : ‖M‖ ≤ 1) (x y : E) (hn : ‖x‖ = ‖y‖) + (hxy : ContinuousLinearMap.adjoint V.toContinuousLinearMap (M (V x)) = y) : + M (V x) = V y ∧ ContinuousLinearMap.adjoint M (V y) = V x := by + have hf : M (V x) = V y := by + apply eq_of_norm_le_inner + · calc + ‖M (V x)‖ ≤ ‖M‖ * ‖V x‖ := M.le_opNorm _ + _ ≤ 1 * ‖V x‖ := mul_le_mul_of_nonneg_right hM (norm_nonneg _) + _ = ‖V y‖ := by simp only [one_mul, V.norm_map, hn] + · change ⟪V.toContinuousLinearMap y, M (V x)⟫_ℂ = ⟪V y, V y⟫_ℂ + rw [← V.toContinuousLinearMap.adjoint_inner_right, hxy, V.inner_map_map] + exact ⟨hf, adjoint_eq_of_contraction M hM (V x) (V y) hf (by + simpa only [V.norm_map] using hn)⟩ + +end Equality + +section PartialTraces + +variable {n m : Type*} [Fintype n] + +def crossPartialTrace (X Y : Matrix n m ℂ) : Matrix m m ℂ := + (Xᴴ * Y)ᵀ + +theorem crossPartialTrace_apply (X Y : Matrix n m ℂ) (j k : m) : + crossPartialTrace X Y j k = ∑ a, Y a j * star (X a k) := by + simp only [crossPartialTrace, Matrix.transpose_apply, Matrix.mul_apply, + Matrix.conjTranspose_apply] + apply Finset.sum_congr rfl + intro a _ + exact mul_comm _ _ + +@[simp] theorem crossPartialTrace_conjTranspose (X Y : Matrix n m ℂ) : + (crossPartialTrace X Y)ᴴ = crossPartialTrace Y X := by + ext j k + simp only [Matrix.conjTranspose_apply, crossPartialTrace_apply, star_sum, + star_mul, star_star] + +variable [Fintype m] + +theorem crossPartialTrace_self_posSemidef (X : Matrix n m ℂ) : + (crossPartialTrace X X).PosSemidef := by + exact (Matrix.posSemidef_conjTranspose_mul_self X).transpose + +theorem crossPartialTrace_block_posSemidef (X Y : Matrix n m ℂ) : + (Matrix.fromBlocks (crossPartialTrace X X) (crossPartialTrace Y X) + (crossPartialTrace X Y) (crossPartialTrace Y Y)).PosSemidef := by + have h := (Matrix.posSemidef_conjTranspose_mul_self (Matrix.fromCols X Y)).transpose + have he : Matrix.fromBlocks (crossPartialTrace X X) (crossPartialTrace Y X) + (crossPartialTrace X Y) (crossPartialTrace Y Y) = + ((Matrix.fromCols X Y)ᴴ * Matrix.fromCols X Y)ᵀ := by + ext i j + cases i <;> cases j <;> rfl + rw [he] + exact h + +theorem crossPartialTrace_ordered (X Y : Matrix n m ℂ) (F : Matrix m m ℂ) + (hforward : Y = X * Fᵀ) (hadjoint : X = Y * (Fᴴ)ᵀ) : + crossPartialTrace X X = Fᴴ * crossPartialTrace X Y ∧ + crossPartialTrace X Y = F * crossPartialTrace X X ∧ + crossPartialTrace Y Y = crossPartialTrace X Y * Fᴴ := by + refine ⟨?_, ?_, ?_⟩ + · change (Xᴴ * X)ᵀ = Fᴴ * (Xᴴ * Y)ᵀ + nth_rw 2 [hadjoint] + rw [← Matrix.mul_assoc, Matrix.transpose_mul, Matrix.transpose_transpose] + · change (Xᴴ * Y)ᵀ = F * (Xᴴ * X)ᵀ + rw [hforward, ← Matrix.mul_assoc, Matrix.transpose_mul, Matrix.transpose_transpose] + · change (Yᴴ * Y)ᵀ = (Xᴴ * Y)ᵀ * Fᴴ + nth_rw 1 [hforward] + rw [Matrix.conjTranspose_mul, Matrix.mul_assoc, Matrix.transpose_mul] + congr 1 + +def weightedPartialTrace (E : Matrix n n ℂ) (X Y : Matrix n m ℂ) : Matrix m m ℂ := + (Xᴴ * E * Y)ᵀ + +omit [Fintype m] in +theorem weightedPartialTrace_factor (L : Matrix n n ℂ) (X Y : Matrix n m ℂ) : + weightedPartialTrace (Lᴴ * L) X Y = crossPartialTrace (L * X) (L * Y) := by + simp only [weightedPartialTrace, crossPartialTrace, Matrix.conjTranspose_mul, Matrix.mul_assoc] + +variable [DecidableEq n] + +theorem weightedPartialTrace_block_posSemidef (E : Matrix n n ℂ) + (hE : E.PosSemidef) (X Y : Matrix n m ℂ) : + (Matrix.fromBlocks (weightedPartialTrace E X X) (weightedPartialTrace E Y X) + (weightedPartialTrace E X Y) (weightedPartialTrace E Y Y)).PosSemidef := by + obtain ⟨L, hL⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hE.nonneg + rw [hL] + simpa only [Matrix.star_eq_conjTranspose, weightedPartialTrace_factor] using + crossPartialTrace_block_posSemidef (L * X) (L * Y) + +end PartialTraces + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/DensityCompatibility.lean b/lean/OAI/Analysis/Crouzeix/DensityCompatibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..7bf43bb3fbc47415c662c1ab14b2364aace3cb32 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/DensityCompatibility.lean @@ -0,0 +1,132 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Density +import OAI.Analysis.Crouzeix.DiskEndpoint +import OAI.Analysis.Crouzeix.TensorDensity + +namespace OAI + +/-! Density Compatibility. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace TensorProduct Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +namespace Boundary + +def toHSCLM (n : ℕ) : Coeff n →L[ℂ] HS n := + ({ toFun := toHS + map_add' := fun _ _ => by apply PiLp.ext; intro ij; rfl + map_smul' := fun _ _ => by apply PiLp.ext; intro ij; rfl } : + Coeff n →ₗ[ℂ] HS n).toContinuousLinearMap + +@[simp] theorem toHSCLM_apply {n : ℕ} (X : Coeff n) : toHSCLM n X = toHS X := rfl + +def weightedPartialTraceCLM {n : ℕ} (X Y : Coeff n) : Coeff n →L[ℂ] Coeff n := + ({ toFun E := weightedPartialTrace E X Y + map_add' E G := by simp [weightedPartialTrace, mul_add, add_mul] + map_smul' c E := by simp [weightedPartialTrace] } : + Coeff n →ₗ[ℂ] Coeff n).toContinuousLinearMap + +@[simp] theorem weightedPartialTraceCLM_apply {n : ℕ} (E X Y : Coeff n) : + weightedPartialTraceCLM X Y E = weightedPartialTrace E X Y := rfl + +theorem integral_weightedPartialTrace {α : Type*} [MeasurableSpace α] + {μ : Measure α} {n : ℕ} (E : α → Coeff n) (hE : Integrable E μ) (X Y : Coeff n) : + (∫ t, weightedPartialTrace (E t) X Y ∂μ) = + weightedPartialTrace (∫ t, E t ∂μ) X Y := + (weightedPartialTraceCLM X Y).integral_comp_comm hE + +def densityContinuous {n : ℕ} (E : C(CircleSpace, Coeff n)) (X Y : Coeff n) : + C(CircleSpace, HS n) := + ⟨fun t => toHS (weightedPartialTrace (E t) X Y), + (toHSCLM n).continuous.comp ((weightedPartialTraceCLM X Y).continuous.comp E.continuous)⟩ + +def densityLp {n : ℕ} (E : C(CircleSpace, Coeff n)) (X Y : Coeff n) : BoundaryL2 n := + ContinuousMap.toLp 2 circleMeasure ℂ (densityContinuous E X Y) + +theorem densityLp_apply_ae {n : ℕ} (E : C(CircleSpace, Coeff n)) (X Y : Coeff n) : + densityLp E X Y =ᵐ[circleMeasure] fun t => toHS (weightedPartialTrace (E t) X Y) := + ContinuousMap.coeFn_toLp _ _ + +theorem matrixMean_densityLp {n : ℕ} (E : C(CircleSpace, Coeff n)) (X Y : Coeff n) : + matrixMean (densityLp E X Y) = weightedPartialTrace (∫ t, E t ∂circleMeasure) X Y := by + rw [← integral_weightedPartialTrace E + (E.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _))] + ext i j + change (∫ t, densityLp E X Y t (i,j) ∂circleMeasure) = _ + have hi : Integrable (fun t => weightedPartialTrace (E t) X Y) circleMeasure := + (weightedPartialTraceCLM X Y).integrable_comp + (E.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + let e : Coeff n →L[ℂ] ℂ := + (PiLp.proj 2 (fun _ : Fin n × Fin n => ℂ) (i,j)).comp (toHSCLM n) + change (∫ t, densityLp E X Y t (i,j) ∂circleMeasure) = + e (∫ t, weightedPartialTrace (E t) X Y ∂circleMeasure) + rw [← e.integral_comp_comm hi] + apply integral_congr_ae + filter_upwards [densityLp_apply_ae E X Y] with t ht + rw [ht] + rfl + +theorem matrixMean_densityLp_mass_one {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hmass : ∫ t, E t ∂circleMeasure = 1) (X Y : Coeff n) : + matrixMean (densityLp E X Y) = (Xᴴ * Y)ᵀ := by + rw [matrixMean_densityLp, hmass, weightedPartialTrace, mul_one] + +theorem densityLp_block_posSemidef {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).PosSemidef) (X Y : Coeff n) : + ∀ᵐ t ∂circleMeasure, + (Matrix.fromBlocks (ofHS (densityLp E X X t)) + (ofHS (densityLp E X Y t))ᴴ (ofHS (densityLp E X Y t)) + (ofHS (densityLp E Y Y t))).PosSemidef := by + filter_upwards [densityLp_apply_ae E X X, densityLp_apply_ae E Y Y, + densityLp_apply_ae E X Y] with t hp hq hr + simp only [hp, hq, hr, ofHS_toHS] + have hs : (weightedPartialTrace (E t) X Y)ᴴ = weightedPartialTrace (E t) Y X := by + simp only [weightedPartialTrace, Matrix.conjTranspose_transpose_eq_transpose_conjTranspose, + Matrix.conjTranspose_mul, (hE t).isHermitian.eq, Matrix.conjTranspose_conjTranspose, + Matrix.mul_assoc] + rw [hs] + exact weightedPartialTrace_block_posSemidef (E t) (hE t) X Y + +theorem densityLp_self_hermitian {n : ℕ} (E : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).PosSemidef) (X : Coeff n) : + ∀ᵐ t ∂circleMeasure, (ofHS (densityLp E X X t)).IsHermitian := by + filter_upwards [densityLp_apply_ae E X X] with t ht + rw [ht, ofHS_toHS] + exact ((hE t).conjTranspose_mul_mul_same X).transpose.isHermitian + +end Boundary + +open Boundary + +theorem inner_vectorization {n : ℕ} (X Y : Coeff n) : + ⟪vectorization X, vectorization Y⟫_ℂ = (Xᴴ * Y).trace := by + let e : Amplification (EuclideanSpace ℂ (Fin n)) n →ₗᵢ[ℂ] + EuclideanSpace ℂ (Fin n × Fin n) := + ⟨(matrixAmplificationCoordinates n n).toLinearMap, norm_matrixAmplificationCoordinates n n⟩ + rw [← e.inner_map_map] + change ⟪matrixAmplificationCoordinates n n (vectorization X), + matrixAmplificationCoordinates n n (vectorization Y)⟫_ℂ = _ + rw [vectorization_coordinates, vectorization_coordinates, inner_toHS] + +theorem weightedPartialTrace_testing {n : ℕ} (E : Coeff n) (hE : E.IsHermitian) + (X Y U : Coeff n) : + ⟪toHS (weightedPartialTrace E X Y), toHS U⟫_ℂ = + ⟪vectorization Y, tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) E) U + (vectorization X)⟫_ℂ := by + rw [tensorOperator_vectorization, inner_vectorization, inner_toHS] + simp only [weightedPartialTrace, Matrix.conjTranspose_transpose_eq_transpose_conjTranspose, + Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, hE.eq] + rw [← Matrix.trace_transpose (_ * U), Matrix.transpose_mul, + Matrix.transpose_transpose, Matrix.trace_mul_comm Uᵀ] + simp only [Matrix.mul_assoc] + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/DiskAutomorphism.lean b/lean/OAI/Analysis/Crouzeix/DiskAutomorphism.lean new file mode 100644 index 0000000000000000000000000000000000000000..72d7bd70b3256b27eca025568b59d8b40d90b43b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/DiskAutomorphism.lean @@ -0,0 +1,99 @@ +import Mathlib + +namespace OAI + +/-! Disk Automorphism. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +open scoped ComplexConjugate + +namespace CrouzeixHilbert.Conformal + +def diskShift (w z : ℂ) : ℂ := (z - w) / (1 - conj w * z) + +theorem diskShift_den_ne {w z : ℂ} (hw : ‖w‖ < 1) (hz : ‖z‖ ≤ 1) : + 1 - conj w * z ≠ 0 := by + intro h + have he : conj w * z = 1 := (sub_eq_zero.mp h).symm + have hn : ‖conj w * z‖ < 1 := by + calc + ‖conj w * z‖ = ‖w‖ * ‖z‖ := by rw [norm_mul, Complex.norm_conj] + _ ≤ ‖w‖ * 1 := mul_le_mul_of_nonneg_left hz (norm_nonneg _) + _ < 1 := by simpa using hw + simp [he] at hn + +theorem diskShift_norm_identity (w z : ℂ) : + ‖1 - conj w * z‖ ^ 2 - ‖z - w‖ ^ 2 = (1 - ‖w‖ ^ 2) * (1 - ‖z‖ ^ 2) := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, + Complex.one_re, Complex.one_im, Complex.mul_re, Complex.mul_im, + Complex.conj_re, Complex.conj_im] + ring + +theorem diskShift_into_disk {w z : ℂ} (hw : ‖w‖ < 1) (hz : ‖z‖ < 1) : + ‖diskShift w z‖ < 1 := by + have hpos : 0 < (1 - ‖w‖ ^ 2) * (1 - ‖z‖ ^ 2) := by + apply mul_pos <;> nlinarith [norm_nonneg w, norm_nonneg z] + rw [diskShift, norm_div, div_lt_one₀ (norm_pos_iff.mpr (diskShift_den_ne hw hz.le))] + have := diskShift_norm_identity w z + nlinarith [norm_nonneg (1 - conj w * z), norm_nonneg (z - w)] + +@[simp] theorem diskShift_self (w : ℂ) : diskShift w w = 0 := by simp [diskShift] + +@[simp] theorem diskShift_zero (w : ℂ) : diskShift w 0 = -w := by simp [diskShift] + +theorem diskShift_eq_zero_iff {w z : ℂ} (hw : ‖w‖ < 1) (hz : ‖z‖ ≤ 1) : + diskShift w z = 0 ↔ z = w := by + simp [diskShift, div_eq_zero_iff, diskShift_den_ne hw hz, sub_eq_zero] + +theorem diskShift_injOn {w : ℂ} (hw : ‖w‖ < 1) : + InjOn (diskShift w) (closedBall 0 1) := by + intro z hz v hv he + have hz' : ‖z‖ ≤ 1 := mem_closedBall_zero_iff.mp hz + have hv' : ‖v‖ ≤ 1 := mem_closedBall_zero_iff.mp hv + have hm : w * conj w ≠ 1 := by + intro he' + have hh := congrArg norm he' + rw [norm_mul, Complex.norm_conj, norm_one] at hh + nlinarith [norm_nonneg w] + have he' := (div_eq_div_iff (diskShift_den_ne hw hz') (diskShift_den_ne hw hv')).mp he + have hh : (z - v) * (1 - w * conj w) = 0 := by linear_combination he' + exact sub_eq_zero.mp ((mul_eq_zero.mp hh).resolve_right (sub_ne_zero.mpr hm.symm)) + +theorem hasDerivAt_diskShift {w z : ℂ} (hw : ‖w‖ < 1) (hz : ‖z‖ ≤ 1) : + HasDerivAt (diskShift w) ((1 - conj w * w) / (1 - conj w * z) ^ 2) z := by + convert! ((hasDerivAt_id z).sub_const w).div + ((hasDerivAt_const z 1).sub ((hasDerivAt_id z).const_mul (conj w))) + (diskShift_den_ne hw hz) using 1 + congr 1 + dsimp + ring + +theorem norm_deriv_diskShift_zero {w : ℂ} (hw : ‖w‖ < 1) : + ‖deriv (diskShift w) 0‖ = 1 - ‖w‖ ^ 2 := by + rw [(hasDerivAt_diskShift hw (by simp : ‖(0 : ℂ)‖ ≤ 1)).deriv] + simp only [mul_zero, sub_zero, one_pow, div_one] + rw [mul_comm (conj w) w, Complex.mul_conj, ← Complex.ofReal_one, + ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + Complex.normSq_eq_norm_sq, abs_of_pos] + nlinarith [norm_nonneg w] + +theorem norm_deriv_diskShift_self {w : ℂ} (hw : ‖w‖ < 1) : + ‖deriv (diskShift w) w‖ = (1 - ‖w‖ ^ 2)⁻¹ := by + rw [(hasDerivAt_diskShift hw hw.le).deriv] + have he : (1 - conj w * w) / (1 - conj w * w) ^ 2 = (1 - conj w * w)⁻¹ := by + field_simp + rw [he, norm_inv] + congr 1 + rw [mul_comm (conj w) w, Complex.mul_conj, ← Complex.ofReal_one, + ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + Complex.normSq_eq_norm_sq, abs_of_pos] + nlinarith [norm_nonneg w] + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/DiskBoundaryChart.lean b/lean/OAI/Analysis/Crouzeix/DiskBoundaryChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd242f794d21c6dd08399348c65d9d35af1d5579 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/DiskBoundaryChart.lean @@ -0,0 +1,135 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ConvexCoordinates + +namespace OAI + +/-! Disk Boundary Chart. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +def localCayley (z : ℂ) : ℂ := (I - z) / (I + z) + +@[simp] theorem localCayley_zero : localCayley 0 = 1 := by simp [localCayley] + +theorem localCayley_injOn : InjOn localCayley {z | I + z ≠ 0} := by + intro z hz w hw he + have hm := (div_eq_div_iff hz hw).mp he + have he' : (z - w) * (2 * I) = 0 := by linear_combination -hm + exact sub_eq_zero.mp ((mul_eq_zero.mp he').resolve_right (mul_ne_zero (by norm_num) I_ne_zero)) + +theorem localCayley_norm_lt_one {z : ℂ} (hz : I + z ≠ 0) : + ‖localCayley z‖ < 1 ↔ 0 < z.im := by + rw [localCayley, norm_div, div_lt_one (norm_pos_iff.mpr hz)] + have he : ‖I + z‖ ^ 2 - ‖I - z‖ ^ 2 = 4 * z.im := by + simp only [Complex.sq_norm, Complex.normSq_apply, add_re, add_im, sub_re, sub_im, I_re, I_im] + ring + constructor <;> intro h <;> nlinarith [norm_nonneg (I + z), norm_nonneg (I - z)] + +theorem localCayley_norm_le_one {z : ℂ} (hz : I + z ≠ 0) : + ‖localCayley z‖ ≤ 1 ↔ 0 ≤ z.im := by + rw [localCayley, norm_div, div_le_one (norm_pos_iff.mpr hz)] + have he : ‖I + z‖ ^ 2 - ‖I - z‖ ^ 2 = 4 * z.im := by + simp only [Complex.sq_norm, Complex.normSq_apply, add_re, add_im, sub_re, sub_im, I_re, I_im] + ring + constructor <;> intro h <;> nlinarith [norm_nonneg (I + z), norm_nonneg (I - z)] + +theorem analyticAt_localCayley {z : ℂ} (hz : I + z ≠ 0) : + AnalyticAt ℂ localCayley z := + (analyticAt_const.sub analyticAt_id).div (analyticAt_const.add analyticAt_id) hz + +theorem analyticOnNhd_symm (e : OpenPartialHomeomorph ℂ ℂ) + (he : AnalyticOnNhd ℂ e e.source) : AnalyticOnNhd ℂ e.symm e.target := by + apply DifferentiableOn.analyticOnNhd _ e.open_target + intro z hz + exact (e.hasStrictDerivAt_symm hz + (deriv_ne_zero_of_injOn e.open_source he.differentiableOn e.injOn (e.map_target hz)) + (he _ (e.map_target hz)).hasStrictDerivAt).hasDerivAt.differentiableAt.differentiableWithinAt + +theorem closure_image_subdisk {h : ℂ → ℂ} {r R : ℝ} (hr : 0 < r) (hrR : r < R) + (hh : ContinuousOn h (ball 0 R)) : + closure (h '' ball 0 r) = h '' closedBall 0 r := by + have hc : ContinuousOn h (closedBall 0 r) := hh.mono (closedBall_subset_ball hrR) + apply Subset.antisymm + · apply closure_minimal (image_mono ball_subset_closedBall) + exact ((isCompact_closedBall (0 : ℂ) r).image_of_continuousOn hc).isClosed + · have hcl : closure (ball (0 : ℂ) r) = closedBall 0 r := closure_ball _ hr.ne' + rw [← hcl] at hc ⊢ + exact hc.image_closure + +theorem boundaryChart_image_subdisk {h : ℂ → ℂ} {r R : ℝ} + (hr : 0 < r) (hrR : r < R) (hh : AnalyticOnNhd ℂ h (ball 0 R)) + (hi : InjOn h (ball 0 R)) {p : ℂ} (hp : p ∈ frontier (h '' ball 0 r)) : + Nonempty (BoundaryChart (h '' ball 0 r) p) := by + have hclosed := closure_image_subdisk hr hrR hh.continuousOn + have hopen := isOpen_image_of_univalent isOpen_ball (hh.mono (ball_subset_ball hrR.le)) + (hi.mono (ball_subset_ball hrR.le)) + obtain ⟨v, hv, rfl⟩ := hclosed ▸ hp.1 + have hvn : ‖v‖ = r := by + apply le_antisymm (mem_closedBall_zero_iff.mp hv) + by_contra hn + have hvb : v ∈ ball 0 r := mem_ball_zero_iff.mpr (lt_of_not_ge hn) + exact hp.2 (by rw [hopen.interior_eq]; exact ⟨v, hvb, rfl⟩) + have hv0 : v ≠ 0 := norm_ne_zero_iff.mp (hvn ▸ hr.ne') + have hvR : v ∈ ball 0 R := (closedBall_subset_ball hrR) hv + let N : Set ℂ := {z | I + z ≠ 0} ∩ {z | v * localCayley z ∈ ball 0 R} + have hNo : IsOpen N := by + rw [isOpen_iff_mem_nhds] + intro z hz + exact inter_mem + ((continuous_const.add continuous_id).continuousAt.preimage_mem_nhds + (isClosed_singleton.isOpen_compl.mem_nhds hz.1)) + ((continuousAt_const.mul (analyticAt_localCayley hz.1).continuousAt).preimage_mem_nhds + (isOpen_ball.mem_nhds hz.2)) + have hN0 : (0 : ℂ) ∈ N := by + simp only [N, mem_inter_iff, mem_ofPred_eq, add_zero, localCayley_zero, mul_one] + exact ⟨I_ne_zero, hvR⟩ + let χ : ℂ → ℂ := fun z => h (v * localCayley z) + have hχa : AnalyticOnNhd ℂ χ N := by + intro z hz + have hc : AnalyticAt ℂ (fun w => v * localCayley w) z := + analyticAt_const.mul (analyticAt_localCayley hz.1) + exact (hh _ hz.2).comp (f := fun w => v * localCayley w) (x := z) hc + have hχi : InjOn χ N := by + intro z hz w hw he + exact localCayley_injOn hz.1 hw.1 (mul_left_cancel₀ hv0 (hi hz.2 hw.2 he)) + let d := (hχa 0 hN0).hasStrictDerivAt.hasStrictFDerivAt_equiv + (deriv_ne_zero_of_injOn hNo hχa.differentiableOn hχi hN0) + let e := (d.toOpenPartialHomeomorph χ).restrOpen N hNo + have heN : e.source ⊆ N := inter_subset_right + have hea : AnalyticOnNhd ℂ e e.source := hχa.mono heN + have he0 : (0 : ℂ) ∈ e.source := ⟨d.mem_toOpenPartialHomeomorph_source, hN0⟩ + refine ⟨⟨e, he0, ?_, hea, analyticOnNhd_symm e hea, ?_, ?_⟩⟩ + · change h (v * localCayley 0) = h v + simp only [localCayley_zero, mul_one] + · intro z hz + have hzN := heN hz + have hm : h (v * localCayley z) ∈ h '' ball 0 r ↔ v * localCayley z ∈ ball 0 r := by + constructor + · rintro ⟨w, hw, he⟩ + exact hi ((ball_subset_ball hrR.le) hw) hzN.2 he ▸ hw + · exact fun hw => ⟨_, hw, rfl⟩ + change h (v * localCayley z) ∈ h '' ball 0 r ↔ _ + rw [hm, mem_ball_zero_iff, norm_mul, hvn, mul_lt_iff_lt_one_right hr] + exact localCayley_norm_lt_one hzN.1 + · intro z hz + have hzN := heN hz + have hm : h (v * localCayley z) ∈ h '' closedBall 0 r ↔ v * localCayley z ∈ closedBall 0 r := by + constructor + · rintro ⟨w, hw, he⟩ + exact hi ((closedBall_subset_ball hrR) hw) hzN.2 he ▸ hw + · exact fun hw => ⟨_, hw, rfl⟩ + change h (v * localCayley z) ∈ closure (h '' ball 0 r) ↔ _ + rw [hclosed, hm, mem_closedBall_zero_iff, norm_mul, hvn, mul_le_iff_le_one_right hr] + exact localCayley_norm_le_one hzN.1 + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/DiskCalculus.lean b/lean/OAI/Analysis/Crouzeix/DiskCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..0bdce46206edfceeda2fca7b84de6752d3f9b9d6 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/DiskCalculus.lean @@ -0,0 +1,174 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Fourier +import OAI.Analysis.Crouzeix.Resolvent +import OAI.Analysis.Crouzeix.SteinMetric + +namespace OAI + +/-! Disk Calculus. -/ + +noncomputable section + +open MeasureTheory + +open scoped Topology + +namespace CrouzeixHilbert.Disk + +abbrev CircleSpace := AddCircle (1 : ℝ) + +local instance : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +abbrev σ : Measure CircleSpace := AddCircle.haarAddCircle + +section Series + +variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] [CompleteSpace A] + +omit [NormedAlgebra ℂ A] [CompleteSpace A] in +theorem inverse_one_sub_of_summable (a : A) (hs : Summable (fun n : ℕ => a ^ n)) : + IsUnit (1 - a) ∧ Ring.inverse (1 - a) = ∑' n : ℕ, a ^ n := by + let u : Aˣ := ⟨1 - a, ∑' n : ℕ, a ^ n, hs.one_sub_mul_tsum_pow, hs.tsum_pow_mul_one_sub⟩ + refine ⟨⟨u, rfl⟩, ?_⟩ + change Ring.inverse (u : A) = _ + rw [Ring.inverse_unit] + rfl + +lemma norm_fourier (n : ℤ) (t : CircleSpace) : ‖fourier n t‖ = 1 := Circle.norm_coe _ + +lemma fourier_one_pow (n : ℕ) (t : CircleSpace) : + (fourier 1 t) ^ n = fourier (n : ℤ) t := by + induction n with + | zero => simp + | succ n ih => rw [pow_succ, ih, Nat.cast_add, Nat.cast_one, fourier_add] + +lemma inverse_fourier_pow (n : ℕ) (t : CircleSpace) : + ((fourier 1 t)⁻¹) ^ n = fourier (-(n : ℤ)) t := by + rw [Complex.inv_eq_conj (norm_fourier _ _), ← map_pow, fourier_one_pow, fourier_neg] + +lemma summable_diskPowers (D : A) (hD : spectralRadius ℂ D < 1) (t : CircleSpace) : + Summable (fun n : ℕ => ((fourier 1 t)⁻¹ • D) ^ n) := by + apply (Metric.summable_norm_pow D hD).of_norm_bounded + intro n + simp only [smul_pow, norm_smul, norm_pow, norm_inv, norm_fourier, + inv_one, one_pow, one_mul, le_refl] + +lemma disk_inverse_series (D : A) (hD : spectralRadius ℂ D < 1) (t : CircleSpace) : + Ring.inverse (1 - (fourier 1 t)⁻¹ • D) = + ∑' n : ℕ, fourier (-(n : ℤ)) t • D ^ n := by + rw [(inverse_one_sub_of_summable _ (summable_diskPowers D hD t)).2] + simp only [smul_pow, inverse_fourier_pow] + +lemma continuous_diskInverse (D : A) (hD : spectralRadius ℂ D < 1) : + Continuous (fun t : CircleSpace => Ring.inverse (1 - (fourier 1 t)⁻¹ • D)) := by + simp_rw [disk_inverse_series D hD] + refine continuous_tsum (fun n => (fourier _).continuous.smul continuous_const) + (Metric.summable_norm_pow D hD) ?_ + intro n t + simp only [norm_smul, norm_fourier, one_mul, le_refl] + +lemma integral_fourier (n : ℤ) : ∫ t : CircleSpace, fourier n t ∂σ = if n = 0 then 1 else 0 := by + have h := congrFun (@fourierCoeff_fourier 1 _ n) 0 + simpa only [fourierCoeff, neg_zero, fourier_zero, one_smul, Pi.single_apply, + eq_comm] using h + +lemma integral_fourier_smul (a : A) (n : ℤ) : + ∫ t : CircleSpace, fourier n t • a ∂σ = if n = 0 then a else 0 := by + rw [integral_smul_const, integral_fourier] + split_ifs <;> simp + +lemma integral_fourier_series (a : ℕ → A) (ha : Summable (fun n => ‖a n‖)) (k : ℕ → ℤ) : + (∫ t : CircleSpace, ∑' n : ℕ, fourier (k n) t • a n ∂σ) = + ∑' n : ℕ, if k n = 0 then a n else 0 := by + rw [← integral_tsum_of_summable_integral_norm] + · simp only [integral_fourier_smul] + · intro n + exact ((fourier _).continuous.smul continuous_const).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · simpa only [norm_smul, norm_fourier, one_mul, integral_const, probReal_univ, one_smul] using ha + +end Series + +section Density + +variable {A : Type*} [CStarAlgebra A] + +def phi (D : A) (t : CircleSpace) : A := + Ring.inverse (1 - (fourier 1 t)⁻¹ • D) + + star (Ring.inverse (1 - (fourier 1 t)⁻¹ • D)) - 1 + +theorem continuous_phi (D : A) (hD : spectralRadius ℂ D < 1) : Continuous (phi D) := + ((continuous_diskInverse D hD).add (continuous_diskInverse D hD).star).sub continuous_const + +theorem integrable_phi (D : A) (hD : spectralRadius ℂ D < 1) : Integrable (phi D) σ := + (continuous_phi D hD).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +lemma phi_series (D : A) (hD : spectralRadius ℂ D < 1) (t : CircleSpace) : + phi D t = (∑' n : ℕ, fourier (-(n : ℤ)) t • D ^ n) + + (∑' n : ℕ, fourier (n : ℤ) t • star (D ^ n)) - 1 := by + simp only [phi, disk_inverse_series D hD, tsum_star, star_smul, fourier_neg, + starRingEnd_apply, star_star] + +theorem integral_moment (D : A) (hD : spectralRadius ℂ D < 1) (j : ℕ) : + ∫ t : CircleSpace, fourier (j : ℤ) t • phi D t ∂σ = D ^ j := by + have hc₁ := continuous_diskInverse D hD + have hi₁ : Integrable (fun t : CircleSpace => Ring.inverse (1 - (fourier 1 t)⁻¹ • D)) σ := + hc₁.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hi₂ : Integrable (fun t : CircleSpace => + star (Ring.inverse (1 - (fourier 1 t)⁻¹ • D))) σ := + hc₁.star.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hs := Metric.summable_norm_pow D hD + have hs' : Summable (fun n : ℕ => ‖star (D ^ n)‖) := by simpa only [norm_star] using hs + have hleft : (∫ t : CircleSpace, + fourier (j : ℤ) t • Ring.inverse (1 - (fourier 1 t)⁻¹ • D) ∂σ) = D ^ j := by + simp_rw [disk_inverse_series D hD, ← tsum_const_smul'', smul_smul, ← fourier_add] + rw [integral_fourier_series _ hs] + convert tsum_ite_eq j (fun n : ℕ => D ^ n) using 1 + congr 1 + ext n + simp only [add_neg_eq_zero, Nat.cast_inj, eq_comm] + have hright : (∫ t : CircleSpace, + fourier (j : ℤ) t • star (Ring.inverse (1 - (fourier 1 t)⁻¹ • D)) ∂σ) = + if j = 0 then 1 else 0 := by + simp_rw [disk_inverse_series D hD, tsum_star, star_smul, fourier_neg, + starRingEnd_apply, star_star, ← tsum_const_smul'', smul_smul, ← fourier_add] + rw [integral_fourier_series _ hs'] + by_cases hj : j = 0 + · simp [hj] + · rw [ite_eq_right hj] + have hz : ∀ n : ℕ, (if (j : ℤ) + (n : ℤ) = 0 then star (D ^ n) else 0) = 0 := by + intro n + simp only [← Nat.cast_add, Nat.cast_eq_zero, Nat.add_eq_zero_iff, + hj, false_and, ↓reduceIte] + simp only [hz, tsum_zero] + simp only [phi, smul_sub, smul_add] + have hsplit := integral_sub ((hi₁.fourier_smul (j : ℤ)).add + (hi₂.fourier_smul (j : ℤ))) ((integrable_const (1 : A)).fourier_smul (j : ℤ)) + simp only [Pi.add_apply] at hsplit + rw [hsplit, integral_add (hi₁.fourier_smul (j : ℤ)) (hi₂.fourier_smul (j : ℤ)), + hleft, hright, integral_fourier_smul] + simp only [Nat.cast_eq_zero, add_sub_cancel_right] + +theorem integral_phi (D : A) (hD : spectralRadius ℂ D < 1) : ∫ t, phi D t ∂σ = 1 := by + simpa only [Nat.cast_zero, fourier_zero, one_smul, pow_zero] using integral_moment D hD 0 + +end Density + +section OperatorPositivity + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem phi_isPositive (D : Operator H) (hn : ‖D‖ ≤ 1) (hD : spectralRadius ℂ D < 1) + (t : CircleSpace) : (phi D t).IsPositive := by + exact isPositive_diskDensity D hn (fourier 1 t) (norm_fourier _ _) + (inverse_one_sub_of_summable _ (summable_diskPowers D hD t)).1 + +end OperatorPositivity + +end CrouzeixHilbert.Disk + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/DiskEndpoint.lean b/lean/OAI/Analysis/Crouzeix/DiskEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..6f5188517fc6c52283b8f0a8e2eb81af0703aa7a --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/DiskEndpoint.lean @@ -0,0 +1,108 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ContourExistence +import OAI.Analysis.Crouzeix.EndpointInterpolation +import OAI.Analysis.Crouzeix.RationalContours + +namespace OAI + +/-! Disk Endpoint. -/ + +noncomputable section + +open Set + +open scoped TensorProduct Matrix MatrixOrder Matrix.Norms.L2Operator ComplexOrder InnerProductSpace + +namespace CrouzeixHilbert + +open Boundary Realization Endpoint + +@[simp] theorem vectorization_smul {n : ℕ} (c : ℂ) (X : Coeff n) : + vectorization (c • X) = c • vectorization X := by + let e : Amplification (EuclideanSpace ℂ (Fin n)) n →ₗᵢ[ℂ] + EuclideanSpace ℂ (Fin n × Fin n) := + ⟨(matrixAmplificationCoordinates n n).toLinearMap, norm_matrixAmplificationCoordinates n n⟩ + apply e.injective + change matrixAmplificationCoordinates n n _ = matrixAmplificationCoordinates n n _ + rw [map_smul, vectorization_coordinates, vectorization_coordinates] + apply PiLp.ext + intro ij + rfl + +theorem tensor_endpoint_of_matrix_endpoint {n : ℕ} (S X : Coeff n) + (t : ℝ) (h : S * X = t • X) : + tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) S) (1 : Coeff n) + (vectorization X) = (t : ℂ) • vectorization X := by + rw [tensorOperator_vectorization, Matrix.transpose_one, mul_one, h] + rw [← vectorization_smul] + congr 1 + +theorem trace_gram_eq_norm_vectorization_sq {n : ℕ} (X : Coeff n) : + (X * Xᴴ).trace = (‖vectorization X‖ : ℂ) ^ 2 := by + rw [Matrix.trace_mul_comm, ← inner_toHS, inner_self_eq_norm_sq_to_K, norm_vectorization] + norm_cast + +theorem disk_endpoint_extremal {n : ℕ} (hn : 0 < n) (T : Coeff n) + (hT : spectralRadius ℂ T < 1) {κ : ℝ} (hκ : 1 < κ) + (H : Coeff n) (hH : Metric.Feasible T (κ ^ 2) H) + (hmin : ∀ s J, Metric.Feasible T s J → κ ^ 2 ≤ s) : + ∃ (X Y : Coeff n) (R : RationalMatrix n) (U : Set ℂ), + (X * Xᴴ).trace = 1 ∧ (Y * Yᴴ).trace = 1 ∧ + CFC.sqrt H * X = κ • X ∧ CFC.sqrt H * Y = Y ∧ Xᴴ * Y = 0 ∧ + ‖vectorization X‖ = 1 ∧ ‖vectorization Y‖ = 1 ∧ + tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) (CFC.sqrt H)) (1 : Coeff n) + (vectorization X) = (κ : ℂ) • vectorization X ∧ + tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) (CFC.sqrt H)) (1 : Coeff n) + (vectorization Y) = vectorization Y ∧ + IsOpen U ∧ Metric.closedBall (0 : ℂ) 1 ⊆ U ∧ PolesOutside U R ∧ + EntrywiseHolomorphic U (matrixRationalFunction R) ∧ + (∀ z : ℂ, ‖z‖ ≤ 1 → ‖matrixRationalFunction R z‖ ≤ 1) ∧ + matrixRationalEval (Matrix.toEuclideanCLM (𝕜 := ℂ) + (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H))) R + (vectorization X) = vectorization Y ∧ + matrixHolomorphicEval (Matrix.toEuclideanCLM (𝕜 := ℂ) + (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H))) U + (matrixRationalFunction R) (vectorization X) = vectorization Y := by + let : Nonempty (Fin n) := ⟨⟨0, hn⟩⟩ + obtain ⟨E⟩ := endpointFactors_of_minimum T hT hκ H hH hmin + obtain ⟨C, hL, hY⟩ := E.exists_colligation + let D := CFC.sqrt H * T * Ring.inverse (CFC.sqrt H) + let e := Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) + have hD : spectralRadius ℂ D < 1 := by + simpa only [D, spectralRadius_eq_of_unital, hH.sqrt_spectrum] using hT + have ha : ‖e.symm C.a‖ ≤ 1 := by + rw [Matrix.cstar_norm_def, StarAlgEquiv.apply_symm_apply] + exact C.norm_a_le + have hi : matrixRationalEval (e D) C.diskExtremal (vectorization E.X) = + vectorization E.Y := + rational_transfer_interpolates D (e.symm C.a) (e.symm C.b) (e.symm C.c) (e.symm C.d) + (CFC.sqrt E.Q) E.X E.Y hD ha hL hY + obtain ⟨U, hU, hKU, hRU, hFU⟩ := rational_poleFree_neighborhood C.diskExtremal + C.diskExtremal_polesOutside + have hKD : numericalClosure (e D) ⊆ Metric.closedBall (0 : ℂ) 1 := + (numericalClosure_subset_closedBall (e D)).trans + (Metric.closedBall_subset_closedBall (by + have hnD := hH.sqrt_similarity.2.1 + rwa [← Matrix.cstar_norm_def])) + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure (e D)) + (convex_numericalClosure (e D)) (numericalClosure_nonempty (e D)) hU (hKD.trans hKU) + have heval := matrixHolomorphicEval_matrixRationalFunction (e D) Γ C.diskExtremal hRU + have hXn : ‖vectorization E.X‖ = 1 := by rw [norm_vectorization, E.X_norm] + have hYn : ‖vectorization E.Y‖ = 1 := by rw [norm_vectorization, E.Y_norm] + refine ⟨E.X, E.Y, C.diskExtremal, U, ?_, ?_, E.X_endpoint, E.Y_endpoint, + E.perpendicular, hXn, hYn, ?_, ?_, hU, hKU, hRU, hFU, + C.diskExtremal_extension.2, hi, ?_⟩ + · rw [trace_gram_eq_norm_vectorization_sq, hXn]; norm_num + · rw [trace_gram_eq_norm_vectorization_sq, hYn]; norm_num + · exact tensor_endpoint_of_matrix_endpoint (CFC.sqrt H) E.X κ E.X_endpoint + · simpa only [Complex.ofReal_one, one_smul] using + tensor_endpoint_of_matrix_endpoint (CFC.sqrt H) E.Y 1 + (by simpa only [one_smul] using E.Y_endpoint) + · rw [heval] + exact hi + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/DiskHolomorphic.lean b/lean/OAI/Analysis/Crouzeix/DiskHolomorphic.lean new file mode 100644 index 0000000000000000000000000000000000000000..d52be4ff711c9d9c64bdf657d3d23fdab1b98c8f --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/DiskHolomorphic.lean @@ -0,0 +1,160 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CauchyProjection +import OAI.Analysis.Crouzeix.HilbertExtension + +namespace OAI + +/-! Disk Holomorphic. -/ + +noncomputable section + +open MeasureTheory Set Filter + +open scoped Topology TensorProduct Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +universe u v + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +local instance diskHolomorphicOperatorRealNormedSpace (size : ℕ) : + NormedSpace ℝ (Operator (Amplification H size)) := + NormedSpace.restrictScalars ℝ ℂ _ + +section DensityIntegral + +variable {α : Type v} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] + [CompactSpace α] (μ : Measure α) [IsFiniteMeasure μ] + +def densityIntegralCLM (Λ : C(α, Operator H)) (m : ℕ) : + C(α, Coeff m) →L[ℂ] Operator (Amplification H m) := by + let : Module ℝ (Operator (Amplification H m)) := + (diskHolomorphicOperatorRealNormedSpace m).toModule + let : SMulCommClass ℝ ℂ (Operator (Amplification H m)) := + IsScalarTower.to_smulCommClass + have hc (F : C(α, Coeff m)) : + Continuous (fun t => tensorOperator (Λ t) (F t)) := + ((tensorBilinearCLM m).continuous.comp Λ.continuous).clm_apply F.continuous + have hi (F : C(α, Coeff m)) : + Integrable (fun t => tensorOperator (Λ t) (F t)) μ := + (hc F).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + let L : C(α, Coeff m) →ₗ[ℂ] Operator (Amplification H m) := { + toFun F := ∫ t, tensorOperator (Λ t) (F t) ∂μ + map_add' F G := by + simp only [ContinuousMap.add_apply, ← tensorCoefficientCLM_apply, map_add] + exact integral_add (hi F) (hi G) + map_smul' c F := by + simp only [ContinuousMap.smul_apply, ← tensorCoefficientCLM_apply, map_smul, + integral_smul, RingHom.id_apply] } + refine L.mkContinuous (‖Λ‖ * μ.real univ) fun F => ?_ + have hb : ∀ᵐ t ∂μ, ‖tensorOperator (Λ t) (F t)‖ ≤ ‖Λ‖ * ‖F‖ := + Eventually.of_forall fun t => (norm_tensorOperator_le _ _).trans + (mul_le_mul (Λ.norm_coe_le_norm t) (F.norm_coe_le_norm t) + (norm_nonneg _) (norm_nonneg _)) + exact (norm_integral_le_of_norm_le_const hb).trans_eq (by ring) + +@[simp] theorem densityIntegralCLM_apply (Λ : C(α, Operator H)) {m : ℕ} + (F : C(α, Coeff m)) : + densityIntegralCLM μ Λ m F = ∫ t, tensorOperator (Λ t) (F t) ∂μ := rfl + +end DensityIntegral + +namespace Disk + +local instance diskHolomorphicFactZeroLtOne : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +theorem integral_matrixHolomorphic (D : Operator H) (hN : ‖D‖ ≤ 1) + (hD : spectralRadius ℂ D < 1) {m : ℕ} {U : Set ℂ} {F : ℂ → Coeff m} + (hU : IsOpen U) (hKU : Metric.closedBall (0 : ℂ) 1 ⊆ U) + (hF : EntrywiseHolomorphic U F) : + (∫ t : CircleSpace, tensorOperator (phi D t) (F (fourier 1 t)) ∂σ) = + matrixHolomorphicEval D U F := by + let K : Set ℂ := Metric.closedBall 0 1 + have hK : IsCompact K := isCompact_closedBall _ _ + have hKc : Convex ℝ K := convex_closedBall _ _ + have hKn : K.Nonempty := ⟨0, by simp [K]⟩ + have hDK : numericalClosure D ⊆ K := + (numericalClosure_subset_closedBall D).trans (Metric.closedBall_subset_closedBall hN) + obtain ⟨ε, hε, hεU⟩ := hK.exists_cthickening_subset_open hU hKU + let L := Metric.cthickening ε K + have hKL : K ⊆ interior L := + (Metric.self_subset_thickening hε _).trans (Metric.thickening_subset_interior_cthickening _ _) + obtain ⟨Γ⟩ := exists_calculusContour hK hKc hKn isOpen_interior hKL + let Δ : CalculusContour (numericalClosure D) U := { + toSmoothContour := Γ.toSmoothContour + avoids := fun t ht => ⟨hεU (interior_subset (Γ.avoids t ht).1), + fun hz => (Γ.avoids t ht).2 (hDK hz)⟩ + index_inside := fun z hz => Γ.index_inside z (hDK hz) + index_outside := fun z hz => Γ.index_outside z + (fun he => hz (hεU (interior_subset he))) } + obtain ⟨degrees, B, happ⟩ := exists_matrixPolynomial_tendstoUniformlyOn + (show IsCompact L from hK.cthickening) (hKc.cthickening ε) hU hεU hF + have ht : Δ.toSmoothContour.trace ⊆ L := by + rintro z ⟨t, ht, rfl⟩ + exact interior_subset (Γ.avoids t ht).1 + have heval : Tendsto (fun n => polynomialEval D (B n)) atTop + (𝓝 (matrixHolomorphicEval D U F)) := by + have h := tendsto_matrixContourEval D Δ + (fun n => (continuous_matrixPolynomial (B n)).continuousOn) (happ.mono ht) + simp_rw [matrixContourEval_matrixPolynomial] at h + have he : matrixContourEval D Δ.toSmoothContour F = matrixHolomorphicEval D U F := by + unfold matrixContourEval matrixHolomorphicEval + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [holomorphicEval_eq_contourEval D hU (hF i j) Δ] + rwa [he] at h + have hcircle (t : CircleSpace) : fourier 1 t ∈ K := by + simpa only [K, Metric.mem_closedBall, dist_zero_right, norm_fourier] using (le_refl (1 : ℝ)) + let F₀ : C(CircleSpace, Coeff m) := + ⟨fun t => F (fourier 1 t), hF.continuousOn.comp_continuous (fourier 1).continuous + (fun t => hKU (hcircle t))⟩ + let Fn (n : ℕ) : C(CircleSpace, Coeff m) := + ⟨fun t => matrixPolynomial (B n) (fourier 1 t), + (continuous_matrixPolynomial (B n)).comp (fourier 1).continuous⟩ + have hFns : Tendsto Fn atTop (𝓝 F₀) := by + rw [ContinuousMap.tendsto_iff_tendstoUniformly] + apply Metric.tendstoUniformly_iff.mpr + intro δ hδ + filter_upwards [Metric.tendstoUniformlyOn_iff.mp happ δ hδ] with n hn t + exact hn _ (interior_subset (hKL (hcircle t))) + let Λ : C(CircleSpace, Operator H) := ⟨phi D, continuous_phi D hD⟩ + have hi := (densityIntegralCLM σ Λ m).continuous.tendsto F₀ |>.comp hFns + simp only [Function.comp_def, densityIntegralCLM_apply, Fn, Λ, ContinuousMap.coe_mk, + integral_matrixPolynomial D hD] at hi + let : MetricSpace (Operator (Amplification H m)) := + ContinuousLinearMap.toNormedAddCommGroup.toMetricSpace + let : T0Space (Operator (Amplification H m)) := MetricSpace.instT0Space + let : RegularSpace (Operator (Amplification H m)) := UniformSpace.to_regularSpace + let : T2Space (Operator (Amplification H m)) := + R1Space.t2Space_iff_t0Space.mpr inferInstance + exact tendsto_nhds_unique hi heval + +theorem holomorphic_bound_spectralRadius_lt_one (D : Operator H) (hN : ‖D‖ ≤ 1) + (hD : spectralRadius ℂ D < 1) {m : ℕ} {U : Set ℂ} {F : ℂ → Coeff m} + (hU : IsOpen U) (hKU : Metric.closedBall (0 : ℂ) 1 ⊆ U) + (hF : EntrywiseHolomorphic U F) : + ‖matrixHolomorphicEval D U F‖ ≤ supNorm (Metric.sphere (0 : ℂ) 1) F := by + let Λ : C(CircleSpace, Operator H) := ⟨phi D, continuous_phi D hD⟩ + have hΛ : ∀ t, 0 ≤ Λ t := fun t => + ContinuousLinearMap.nonneg_iff_isPositive.mpr (phi_isPositive D hN hD t) + have hcircle (t : CircleSpace) : fourier 1 t ∈ Metric.sphere (0 : ℂ) 1 := by + simp only [Metric.mem_sphere, dist_zero_right, norm_fourier] + let F₀ : C(CircleSpace, Coeff m) := + ⟨fun t => F (fourier 1 t), hF.continuousOn.comp_continuous (fourier 1).continuous + (fun t => hKU (Metric.sphere_subset_closedBall (hcircle t)))⟩ + have hb := supNorm_bddAbove (isCompact_sphere (0 : ℂ) 1) + (hF.continuousOn.mono (Metric.sphere_subset_closedBall.trans hKU)) + rw [← integral_matrixHolomorphic D hN hD hU hKU hF] + exact norm_integral_tensor_density_le Λ hΛ (integral_phi D hD) F₀ _ + (supNorm_nonneg hb) (fun t => norm_le_supNorm hb (hcircle t)) + +end Disk + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Endpoint.lean b/lean/OAI/Analysis/Crouzeix/Endpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..95a2b1923aabaa60ac3d41751aeddc01aaffc734 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Endpoint.lean @@ -0,0 +1,539 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryForms +import OAI.Analysis.Crouzeix.SteinMetric + +namespace OAI + +/-! Endpoint. -/ + +noncomputable section + +open Set Filter + +open scoped Topology MatrixOrder Matrix.Norms.L2Operator + +namespace CrouzeixHilbert.Endpoint + +section Cone + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +abbrev Herm (A : Type*) [CStarAlgebra A] := selfAdjoint.submodule ℝ A + +instance : PosSMulMono ℝ (Herm A) where + smul_le_smul_of_nonneg_left {r} hr {x y} h := by + change r • (x : A) ≤ r • (y : A) + exact smul_le_smul_of_nonneg_left h hr + +def unit : Herm A := ⟨1, IsSelfAdjoint.one A⟩ + +omit [PartialOrder A] [StarOrderedRing A] in +@[simp] theorem unit_val : ((unit : Herm A) : A) = 1 := rfl + +def strictCone : Set (Herm A) := + {H | ∃ ε : ℝ, 0 < ε ∧ ε • (unit : Herm A) ≤ H} + +omit [StarOrderedRing A] in +theorem unit_mem_strictCone : (unit : Herm A) ∈ strictCone := + ⟨1, zero_lt_one, by simp⟩ + +theorem strictCone_nonneg {H : Herm A} (h : H ∈ strictCone) : 0 ≤ H := by + obtain ⟨ε, hε, hH⟩ := h + apply le_trans _ hH + change 0 ≤ ε • (1 : A) + exact smul_nonneg hε.le zero_le_one + +theorem strictCone_add_nonneg {H P : Herm A} (hH : H ∈ strictCone) + (hP : 0 ≤ P) : H + P ∈ strictCone := by + obtain ⟨ε, hε, hH⟩ := hH + exact ⟨ε, hε, hH.trans (le_add_of_nonneg_right hP)⟩ + +theorem strictCone_smul {H : Herm A} (hH : H ∈ strictCone) {r : ℝ} + (hr : 0 < r) : r • H ∈ strictCone := by + obtain ⟨ε, hε, hH⟩ := hH + refine ⟨r * ε, mul_pos hr hε, ?_⟩ + rw [mul_smul] + exact smul_le_smul_of_nonneg_left hH hr.le + +theorem convex_strictCone : Convex ℝ (strictCone : Set (Herm A)) := by + intro H hH J hJ a b ha hb hab + obtain ⟨ε, hε, hH⟩ := hH + obtain ⟨δ, hδ, hJ⟩ := hJ + refine ⟨a * ε + b * δ, ?_, ?_⟩ + · have hs : 0 ≤ a * ε := mul_nonneg ha hε.le + have ht : 0 ≤ b * δ := mul_nonneg hb hδ.le + by_cases h : a = 0 + · have : b = 1 := by linarith + simp [h, this, hδ] + · exact add_pos_of_pos_of_nonneg (mul_pos (lt_of_le_of_ne ha (Ne.symm h)) hε) ht + · rw [add_smul, mul_smul, mul_smul] + exact add_le_add (smul_le_smul_of_nonneg_left hH ha) + (smul_le_smul_of_nonneg_left hJ hb) + +theorem isOpen_strictCone : IsOpen (strictCone : Set (Herm A)) := by + rw [Metric.isOpen_iff] + intro H hH + obtain ⟨ε, hε, hlower⟩ := hH + refine ⟨ε / 2, half_pos hε, ?_⟩ + intro J hJ + have hd : ‖(J - H : Herm A)‖ < ε / 2 := by + simpa only [Metric.mem_ball, dist_eq_norm] using hJ + have hlo : -(‖(J - H : Herm A)‖) • (unit : Herm A) ≤ J - H := by + change -(‖((J - H : Herm A) : A)‖) • (1 : A) ≤ ((J - H : Herm A) : A) + simpa only [Algebra.algebraMap_eq_smul_one, neg_smul] using + (J - H).property.neg_algebraMap_norm_le_self + refine ⟨ε / 2, half_pos hε, ?_⟩ + have hh := add_le_add hlower hlo + rw [← add_smul, add_sub_cancel] at hh + apply le_trans _ hh + change (ε / 2) • (1 : A) ≤ (ε + -‖(J - H : Herm A)‖) • (1 : A) + exact smul_le_smul_of_nonneg_right (by linarith) zero_le_one + +theorem orderUnit_bounds (H : Herm A) : + -(‖H‖) • (unit : Herm A) ≤ H ∧ H ≤ ‖H‖ • (unit : Herm A) := by + constructor + · change -(‖(H : A)‖) • (1 : A) ≤ (H : A) + simpa only [Algebra.algebraMap_eq_smul_one, neg_smul] using + H.property.neg_algebraMap_norm_le_self + · change (H : A) ≤ ‖(H : A)‖ • (1 : A) + simpa only [Algebra.algebraMap_eq_smul_one] using H.property.le_algebraMap_norm_self + +theorem positive_mono (f : (Herm A) →L[ℝ] ℝ) + (hf : ∀ H, 0 ≤ H → 0 ≤ f H) : Monotone f := by + intro H J hHJ + have h := hf (J - H) (sub_nonneg.mpr hHJ) + rw [map_sub] at h + linarith + +theorem positive_eq_zero (f : (Herm A) →L[ℝ] ℝ) + (hf : ∀ H, 0 ≤ H → 0 ≤ f H) (h1 : f unit = 0) : f = 0 := by + ext H + have hl := positive_mono f hf (orderUnit_bounds H).1 + have hu := positive_mono f hf (orderUnit_bounds H).2 + simp only [map_smul, smul_eq_mul, h1, mul_zero, zero_apply] at * + exact le_antisymm hu hl + +def congruence (T : A) : Herm A →ₗ[ℝ] Herm A where + toFun H := ⟨star T * H * T, by + change IsSelfAdjoint (star T * (H : A) * T) + simpa only [star_star] using H.property.conjugate (star T)⟩ + map_add' H J := by + apply Subtype.ext + simp only [Submodule.coe_add, mul_add, add_mul] + map_smul' r H := by + apply Subtype.ext + simp only [Submodule.coe_smul, mul_smul_comm, smul_mul_assoc, RingHom.id_apply] + +omit [PartialOrder A] [StarOrderedRing A] in +@[simp] theorem congruence_val (T : A) (H : Herm A) : + ((congruence T H : Herm A) : A) = star T * H * T := rfl + +end Cone + +lemma slope_nonpos {a b c : ℝ} (h : ∀ t : ℝ, 0 ≤ t → b + a * t ≤ c) : a ≤ 0 := by + by_contra ha + have ha : 0 < a := lt_of_not_ge ha + have hb := h 0 le_rfl + simp only [mul_zero, add_zero] at hb + have ht : 0 ≤ (c - b + 1) / a := div_nonneg (by linarith) ha.le + have hh := h ((c - b + 1) / a) ht + rw [mul_div_cancel₀ _ ha.ne'] at hh + linarith + +lemma slope_zero {a b c : ℝ} (h : ∀ t : ℝ, c ≤ b + a * t) : a = 0 := by + have hn : a ≤ 0 := slope_nonpos (b := -b) (c := -c) (fun t ht => by + have := h (-t) + linarith) + have hp : -a ≤ 0 := slope_nonpos (b := -b) (c := -c) (fun t ht => by + have := h t + linarith) + linarith + +section Separation + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +abbrev SlackSpace (A : Type*) [CStarAlgebra A] := ℝ × Herm A × Herm A × Herm A + +def slacks (T : A) (s : ℝ) (H : Herm A) : SlackSpace A := + (s, H - unit, s • unit - H, H - congruence T H) + +def lowerOpen (τ : ℝ) : Set (SlackSpace A) := + Iio τ ×ˢ strictCone ×ˢ strictCone ×ˢ strictCone + +theorem convex_lowerOpen (τ : ℝ) : Convex ℝ (lowerOpen (A := A) τ) := + (convex_Iio τ).prod (convex_strictCone.prod (convex_strictCone.prod convex_strictCone)) + +theorem isOpen_lowerOpen (τ : ℝ) : IsOpen (lowerOpen (A := A) τ) := + isOpen_Iio.prod (isOpen_strictCone.prod (isOpen_strictCone.prod isOpen_strictCone)) + +omit [PartialOrder A] [StarOrderedRing A] in +theorem convex_slacks (T : A) : Convex ℝ {p : SlackSpace A | ∃ s H, p = slacks T s H} := by + rintro x ⟨s, H, rfl⟩ y ⟨t, J, rfl⟩ a b ha hb hab + refine ⟨a * s + b * t, a • H + b • J, ?_⟩ + dsimp only [slacks] + ext1 + · rfl + · ext1 + · simp only [Prod.smul_mk, Prod.mk_add_mk, smul_sub] + have he : a • (unit : Herm A) + b • unit = unit := by rw [← add_smul, hab, one_smul] + calc + a • H - a • unit + (b • J - b • unit) = + a • H + b • J - (a • unit + b • unit) := by abel + _ = _ := by rw [he] + · ext1 + · simp only [Prod.smul_mk, Prod.mk_add_mk, smul_sub, add_smul, mul_smul] + module + · simp only [Prod.smul_mk, Prod.mk_add_mk, smul_sub, map_add, map_smul] + module + +def scalarPart (f : SlackSpace A →L[ℝ] ℝ) : ℝ := f (1, 0, 0, 0) + +def firstPart (f : SlackSpace A →L[ℝ] ℝ) : Herm A →L[ℝ] ℝ := + -(f.comp ((ContinuousLinearMap.inr ℝ ℝ (Herm A × Herm A × Herm A)).comp + (ContinuousLinearMap.inl ℝ (Herm A) (Herm A × Herm A)))) + +def secondPart (f : SlackSpace A →L[ℝ] ℝ) : Herm A →L[ℝ] ℝ := + -(f.comp ((ContinuousLinearMap.inr ℝ ℝ (Herm A × Herm A × Herm A)).comp + ((ContinuousLinearMap.inr ℝ (Herm A) (Herm A × Herm A)).comp + (ContinuousLinearMap.inl ℝ (Herm A) (Herm A))))) + +def thirdPart (f : SlackSpace A →L[ℝ] ℝ) : Herm A →L[ℝ] ℝ := + -(f.comp ((ContinuousLinearMap.inr ℝ ℝ (Herm A × Herm A × Herm A)).comp + ((ContinuousLinearMap.inr ℝ (Herm A) (Herm A × Herm A)).comp + (ContinuousLinearMap.inr ℝ (Herm A) (Herm A))))) + +omit [PartialOrder A] [StarOrderedRing A] in +theorem functional_decomposition (f : SlackSpace A →L[ℝ] ℝ) + (s : ℝ) (U V W : Herm A) : + f (s,U,V,W) = scalarPart f * s - firstPart f U - secondPart f V - thirdPart f W := by + have he : (s,U,V,W) = s • ((1,0,0,0) : SlackSpace A) + (0,U,0,0) + (0,0,V,0) + (0,0,0,W) := by + ext <;> simp + rw [he, map_add, map_add, map_add, map_smul] + simp [scalarPart, firstPart, secondPart, thirdPart, mul_comm] + rfl + +theorem lowerOpen_disjoint_slacks (T : A) {τ : ℝ} + (hmin : ∀ s H, Metric.Feasible T s H → τ ≤ s) : + Disjoint (lowerOpen (A := A) τ) {p : SlackSpace A | ∃ s H, p = slacks T s H} := by + rw [Set.disjoint_left] + rintro p hp ⟨s, H, rfl⟩ + obtain ⟨hs, hU, hV, hW⟩ := hp + have hH : Metric.Feasible T s (H : A) := by + constructor + · exact sub_nonneg.mp (strictCone_nonneg hU) + · have hv := strictCone_nonneg hV + change 0 ≤ s • (1 : A) - (H : A) at hv + simpa only [Algebra.algebraMap_eq_smul_one] using sub_nonneg.mp hv + · exact sub_nonneg.mp (strictCone_nonneg hW) + exact hs.not_ge (hmin s H hH) + +theorem separating_parts_nonneg (τ c : ℝ) (f : SlackSpace A →L[ℝ] ℝ) + (hf : ∀ p ∈ lowerOpen τ, f p ≤ c) : + 0 ≤ scalarPart f ∧ + (∀ H, 0 ≤ H → 0 ≤ firstPart f H) ∧ + (∀ H, 0 ≤ H → 0 ≤ secondPart f H) ∧ + (∀ H, 0 ≤ H → 0 ≤ thirdPart f H) := by + have h1 := unit_mem_strictCone (A := A) + refine ⟨?_, ?_, ?_, ?_⟩ + · have h := slope_nonpos (a := -scalarPart f) + (b := scalarPart f * (τ - 1) - firstPart f unit - secondPart f unit - thirdPart f unit) + (c := c) (fun t ht => by + have hp : (τ - 1 - t, unit, unit, unit) ∈ lowerOpen (A := A) τ := + ⟨by change τ - 1 - t < τ; linarith, h1, h1, h1⟩ + have h := hf _ hp + rw [functional_decomposition] at h + linarith) + linarith + · intro H hH + have h := slope_nonpos (a := -firstPart f H) + (b := scalarPart f * (τ - 1) - firstPart f unit - secondPart f unit - thirdPart f unit) + (c := c) (fun t ht => by + have hp : (τ - 1, unit + t • H, unit, unit) ∈ lowerOpen (A := A) τ := + ⟨by change τ - 1 < τ; linarith, strictCone_add_nonneg h1 (smul_nonneg ht hH), h1, h1⟩ + have h := hf _ hp + rw [functional_decomposition, map_add, map_smul] at h + simp only [smul_eq_mul] at h + linarith) + linarith + · intro H hH + have h := slope_nonpos (a := -secondPart f H) + (b := scalarPart f * (τ - 1) - firstPart f unit - secondPart f unit - thirdPart f unit) + (c := c) (fun t ht => by + have hp : (τ - 1, unit, unit + t • H, unit) ∈ lowerOpen (A := A) τ := + ⟨by change τ - 1 < τ; linarith, h1, strictCone_add_nonneg h1 (smul_nonneg ht hH), h1⟩ + have h := hf _ hp + rw [functional_decomposition, map_add, map_smul] at h + simp only [smul_eq_mul] at h + linarith) + linarith + · intro H hH + have h := slope_nonpos (a := -thirdPart f H) + (b := scalarPart f * (τ - 1) - firstPart f unit - secondPart f unit - thirdPart f unit) + (c := c) (fun t ht => by + have hp : (τ - 1, unit, unit, unit + t • H) ∈ lowerOpen (A := A) τ := + ⟨by change τ - 1 < τ; linarith, h1, h1, strictCone_add_nonneg h1 (smul_nonneg ht hH)⟩ + have h := hf _ hp + rw [functional_decomposition, map_add, map_smul] at h + simp only [smul_eq_mul] at h + linarith) + linarith + +theorem separating_value_lower (τ c : ℝ) (f : SlackSpace A →L[ℝ] ℝ) + (hf : ∀ p ∈ lowerOpen τ, f p ≤ c) : scalarPart f * τ ≤ c := by + let q : ℝ → ℝ := fun ε => scalarPart f * (τ - ε) - ε * firstPart f unit - + ε * secondPart f unit - ε * thirdPart f unit + have hcq : Continuous q := by dsimp [q]; fun_prop + have ht : Tendsto q (𝓝[>] (0 : ℝ)) (𝓝 (scalarPart f * τ)) := by + simpa only [q, sub_zero, zero_mul] using hcq.continuousAt.tendsto.mono_left + (show 𝓝[>] (0 : ℝ) ≤ 𝓝 0 from nhdsWithin_le_nhds) + apply le_of_tendsto ht + filter_upwards [self_mem_nhdsWithin] with ε hε + have hε : 0 < ε := hε + have hp : (τ - ε, ε • unit, ε • unit, ε • unit) ∈ lowerOpen (A := A) τ := by + have hs := strictCone_smul (unit_mem_strictCone (A := A)) hε + exact ⟨by change τ - ε < τ; linarith, hs, hs, hs⟩ + have h := hf _ hp + simpa only [q, functional_decomposition, map_smul, smul_eq_mul] using h + +omit [PartialOrder A] [StarOrderedRing A] in +theorem separating_affine_balance (T : A) (c : ℝ) (f : SlackSpace A →L[ℝ] ℝ) + (hf : ∀ s H, c ≤ f (slacks T s H)) : + secondPart f unit = scalarPart f ∧ + (∀ H, secondPart f H - firstPart f H = thirdPart f H - thirdPart f (congruence T H)) ∧ + c ≤ firstPart f unit := by + have he (s : ℝ) (H : Herm A) : + f (slacks T s H) = firstPart f unit + + (scalarPart f - secondPart f unit) * s + + (secondPart f H - firstPart f H - thirdPart f H + thirdPart f (congruence T H)) := by + simp only [slacks, functional_decomposition, map_sub, map_smul, smul_eq_mul] + ring + have hscalar := slope_zero (a := scalarPart f - secondPart f unit) + (b := firstPart f unit) (c := c) (fun t => by + have h := hf t 0 + simpa only [he, map_zero, sub_zero, add_zero, zero_sub] using h) + have hscalar : secondPart f unit = scalarPart f := by linarith + refine ⟨hscalar, ?_, ?_⟩ + · intro H + have h := slope_zero + (a := secondPart f H - firstPart f H - thirdPart f H + thirdPart f (congruence T H)) + (b := firstPart f unit) (c := c) (fun t => by + have h := hf 0 (t • H) + simp only [he, mul_zero, add_zero, map_smul, smul_eq_mul] at h + linarith) + linarith + · have h := hf 0 0 + simpa only [he, mul_zero, add_zero, map_zero, sub_zero, zero_sub] using h + +theorem exists_unit_slacks (T : A) (hT : spectralRadius ℂ T < 1) : + ∃ (s : ℝ) (H : Herm A), unit ≤ H - unit ∧ + unit ≤ s • unit - H ∧ unit ≤ H - congruence T H := by + let H₀ := Metric.steinSeries T + have h₀ : (1 : A) ≤ H₀ := Metric.one_le_steinSeries T hT + have h0 : 0 ≤ H₀ := Metric.steinSeries_nonneg T + let H : Herm A := ⟨H₀ + H₀, IsSelfAdjoint.of_nonneg (add_nonneg h0 h0)⟩ + have hup : (H : A) ≤ algebraMap ℝ A ‖(H : A)‖ := + (CStarAlgebra.norm_le_iff_le_algebraMap _ (norm_nonneg _) (add_nonneg h0 h0)).mp le_rfl + refine ⟨‖(H : A)‖ + 1, H, ?_, ?_, ?_⟩ + · change (1 : A) ≤ H₀ + H₀ - 1 + exact le_sub_iff_add_le.mpr (add_le_add h₀ h₀) + · change (1 : A) ≤ (‖(H : A)‖ + 1) • (1 : A) - (H : A) + rw [add_smul, one_smul] + apply le_sub_iff_add_le.mpr + simpa only [Algebra.algebraMap_eq_smul_one, add_comm] using add_le_add_right hup 1 + · change (1 : A) ≤ H₀ + H₀ - star T * (H₀ + H₀) * T + rw [mul_add, add_mul, add_sub_add_comm, Metric.steinSeries_sub T hT] + exact le_add_of_nonneg_right zero_le_one + +theorem separating_scalar_pos (T : A) (hT : spectralRadius ℂ T < 1) + (τ c : ℝ) (f : SlackSpace A →L[ℝ] ℝ) + (ho : ∀ p ∈ lowerOpen τ, f p < c) + (ha : ∀ s H, c ≤ f (slacks T s H)) : 0 < scalarPart f := by + have ho' : ∀ p ∈ lowerOpen τ, f p ≤ c := fun p hp => (ho p hp).le + obtain ⟨hlam, hY, hX, hZ⟩ := separating_parts_nonneg τ c f ho' + have hc := separating_value_lower τ c f ho' + by_contra hn + have hlam0 : scalarPart f = 0 := le_antisymm (le_of_not_gt hn) hlam + obtain ⟨s, H, hU, hV, hW⟩ := exists_unit_slacks T hT + have hs := ha s H + rw [slacks, functional_decomposition, hlam0, zero_mul] at hs + rw [hlam0, zero_mul] at hc + have he : (0 : Herm A) ≤ unit := (by change (0 : A) ≤ 1; exact zero_le_one) + have hYe := hY unit he + have hXe := hX unit he + have hZe := hZ unit he + have hYu := positive_mono (firstPart f) hY hU + have hXv := positive_mono (secondPart f) hX hV + have hZw := positive_mono (thirdPart f) hZ hW + have hY0 : firstPart f = 0 := positive_eq_zero _ hY (by linarith) + have hX0 : secondPart f = 0 := positive_eq_zero _ hX (by linarith) + have hZ0 : thirdPart f = 0 := positive_eq_zero _ hZ (by linarith) + have hf0 : f = 0 := by + apply ContinuousLinearMap.ext + rintro ⟨r,U,V,W⟩ + simp only [functional_decomposition, hlam0, hY0, hX0, hZ0, zero_apply, + zero_mul, sub_zero] + have h1 := unit_mem_strictCone (A := A) + have hp : (τ - 1, unit, unit, unit) ∈ lowerOpen (A := A) τ := + ⟨by change τ - 1 < τ; linarith, h1, h1, h1⟩ + have hg := ho _ hp + have ha0 := ha 0 0 + simp only [hf0, zero_apply] at hg ha0 + linarith + +structure DualCertificate (T : A) (τ : ℝ) (H : Herm A) where + X : Herm A →L[ℝ] ℝ + Y : Herm A →L[ℝ] ℝ + Z : Herm A →L[ℝ] ℝ + X_positive : ∀ J, 0 ≤ J → 0 ≤ X J + Y_positive : ∀ J, 0 ≤ J → 0 ≤ Y J + Z_positive : ∀ J, 0 ≤ J → 0 ≤ Z J + X_unit : X unit = 1 + Y_unit : Y unit = τ + balance : ∀ J, X J - Y J = Z J - Z (congruence T J) + Y_slack : Y (H - unit) = 0 + X_slack : X (τ • unit - H) = 0 + Z_slack : Z (H - congruence T H) = 0 + +theorem exists_dualCertificate (T : A) (hT : spectralRadius ℂ T < 1) + {τ : ℝ} (H : Herm A) (hH : Metric.Feasible T τ (H : A)) + (hmin : ∀ s J, Metric.Feasible T s J → τ ≤ s) : + Nonempty (DualCertificate T τ H) := by + obtain ⟨f,c,ho,ha'⟩ := geometric_hahn_banach_open + (convex_lowerOpen (A := A) τ) (isOpen_lowerOpen τ) (convex_slacks T) + (lowerOpen_disjoint_slacks T hmin) + have ha : ∀ s J, c ≤ f (slacks T s J) := fun s J => ha' _ ⟨s,J,rfl⟩ + have ho' : ∀ p ∈ lowerOpen τ, f p ≤ c := fun p hp => (ho p hp).le + have hlam := separating_scalar_pos T hT τ c f ho ha + obtain ⟨_, hY, hX, hZ⟩ := separating_parts_nonneg τ c f ho' + obtain ⟨he, hbal, hval⟩ := separating_affine_balance T c f ha + have hc := separating_value_lower τ c f ho' + have hunit : (0 : Herm A) ≤ unit := (by change (0 : A) ≤ 1; exact zero_le_one) + have hU : (0 : Herm A) ≤ H - unit := sub_nonneg.mpr hH.lower + have hV : (0 : Herm A) ≤ τ • unit - H := by + change 0 ≤ τ • (1 : A) - (H : A) + simpa only [Algebra.algebraMap_eq_smul_one] using sub_nonneg.mpr hH.upper + have hW : (0 : Herm A) ≤ H - congruence T H := sub_nonneg.mpr hH.stein + have hab : f (slacks T τ H) = firstPart f unit := by + simp only [slacks, functional_decomposition, map_sub, map_smul, smul_eq_mul] + have hb := hbal H + rw [he] + linarith + have hvalue : firstPart f unit = scalarPart f * τ - firstPart f (H - unit) - + secondPart f (τ • unit - H) - thirdPart f (H - congruence T H) := by + rw [← hab, slacks, functional_decomposition] + have hYu := hY _ hU + have hXv := hX _ hV + have hZw := hZ _ hW + have hYE : firstPart f unit = scalarPart f * τ := by linarith + have hYS : firstPart f (H - unit) = 0 := by linarith + have hXS : secondPart f (τ • unit - H) = 0 := by linarith + have hZS : thirdPart f (H - congruence T H) = 0 := by linarith + let r := (scalarPart f)⁻¹ + have hr : 0 ≤ r := (inv_pos.mpr hlam).le + refine ⟨{ + X := r • secondPart f + Y := r • firstPart f + Z := r • thirdPart f + X_positive := ?_ + Y_positive := ?_ + Z_positive := ?_ + X_unit := ?_ + Y_unit := ?_ + balance := ?_ + Y_slack := ?_ + X_slack := ?_ + Z_slack := ?_ }⟩ + · intro J hJ + exact mul_nonneg hr (hX J hJ) + · intro J hJ + exact mul_nonneg hr (hY J hJ) + · intro J hJ + exact mul_nonneg hr (hZ J hJ) + · simp only [smul_apply, smul_eq_mul, he, r, inv_mul_cancel₀ hlam.ne'] + · simp only [smul_apply, smul_eq_mul, hYE, r, ← mul_assoc, + inv_mul_cancel₀ hlam.ne', one_mul] + · intro J + simpa only [smul_apply, smul_eq_mul, mul_sub] using congrArg (r * ·) (hbal J) + · simp only [smul_apply, smul_eq_mul, hYS, mul_zero] + · simp only [smul_apply, smul_eq_mul, hXS, mul_zero] + · simp only [smul_apply, smul_eq_mul, hZS, mul_zero] + +end Separation + +section Riesz + +open scoped InnerProductSpace ComplexOrder + +open Boundary + +def hermHS (n : ℕ) : Submodule ℝ (HS n) := + LinearMap.ker ((hsStar n).toLinearEquiv.toLinearMap - LinearMap.id) + +@[simp] theorem mem_hermHS {n : ℕ} (u : HS n) : + u ∈ hermHS n ↔ (ofHS u).IsHermitian := by + simp only [hermHS, LinearMap.mem_ker, LinearMap.sub_apply, LinearMap.id_apply, + LinearEquiv.coe_coe, LinearIsometryEquiv.coe_toLinearEquiv, sub_eq_zero, + hsStar_apply, Matrix.IsHermitian] + constructor + · intro h + exact congrArg ofHS h + · intro h + rw [h, toHS_ofHS] + +def hermHSCoordinate (n : ℕ) : hermHS n →ₗ[ℝ] Herm (Matrix (Fin n) (Fin n) ℂ) where + toFun u := ⟨ofHS u, (mem_hermHS u.val).mp u.property⟩ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +theorem exists_trace_representative {n : ℕ} + (f : Herm (Matrix (Fin n) (Fin n) ℂ) →L[ℝ] ℝ) : + ∃ X : Matrix (Fin n) (Fin n) ℂ, X.IsHermitian ∧ + ∀ J : Herm (Matrix (Fin n) (Fin n) ℂ), f J = (X * J.val).trace.re := by + let F := f.comp (hermHSCoordinate n).toContinuousLinearMap + let u := (InnerProductSpace.toDual ℝ (hermHS n)).symm F + refine ⟨ofHS u.val, (mem_hermHS _).mp u.property, ?_⟩ + intro J + let v : hermHS n := ⟨toHS J.val, (mem_hermHS _).mpr J.property⟩ + have h := InnerProductSpace.toDual_symm_apply (𝕜 := ℝ) (x := v) (y := F) + have he : hermHSCoordinate n v = J := by apply Subtype.ext; rfl + change ⟪u, v⟫_ℝ = f (hermHSCoordinate n v) at h + rw [he] at h + rw [← h] + change ⟪u.val, toHS J.val⟫_ℝ = _ + nth_rw 1 [← toHS_ofHS u.val] + rw [real_inner_toHS, ((mem_hermHS _).mp u.property).eq] + +theorem trace_representative_posSemidef {n : ℕ} + (f : Herm (Matrix (Fin n) (Fin n) ℂ) →L[ℝ] ℝ) + (hf : ∀ J, 0 ≤ J → 0 ≤ f J) + (X : Matrix (Fin n) (Fin n) ℂ) (hX : X.IsHermitian) + (hrep : ∀ J : Herm (Matrix (Fin n) (Fin n) ℂ), f J = (X * J.val).trace.re) : + X.PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg hX + intro x + let J : Herm (Matrix (Fin n) (Fin n) ℂ) := + ⟨Matrix.vecMulVec x (star x), (Matrix.posSemidef_vecMulVec_self_star x).isHermitian⟩ + have hJ : (0 : Herm (Matrix (Fin n) (Fin n) ℂ)) ≤ J := + (Matrix.posSemidef_vecMulVec_self_star x).nonneg + have h := hf J hJ + rw [hrep] at h + change 0 ≤ (X * Matrix.vecMulVec x (star x)).trace.re at h + rw [Matrix.mul_vecMulVec, Matrix.trace_vecMulVec, dotProduct_comm] at h + exact Complex.nonneg_iff.mpr ⟨h, (hX.im_star_dotProduct_mulVec_self x).symm⟩ + +theorem exists_positive_trace_representative {n : ℕ} + (f : Herm (Matrix (Fin n) (Fin n) ℂ) →L[ℝ] ℝ) + (hf : ∀ J, 0 ≤ J → 0 ≤ f J) : + ∃ X : Matrix (Fin n) (Fin n) ℂ, X.PosSemidef ∧ + ∀ J : Herm (Matrix (Fin n) (Fin n) ℂ), f J = (X * J.val).trace.re := by + obtain ⟨X,hX,hrep⟩ := exists_trace_representative f + exact ⟨X, trace_representative_posSemidef f hf X hX hrep, hrep⟩ + +end Riesz + +end CrouzeixHilbert.Endpoint + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/EndpointInterpolation.lean b/lean/OAI/Analysis/Crouzeix/EndpointInterpolation.lean new file mode 100644 index 0000000000000000000000000000000000000000..e306db2a3a67a91ed404d84c27dd7cc33eb1dc05 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/EndpointInterpolation.lean @@ -0,0 +1,134 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BlockPolynomial + +namespace OAI + +/-! Endpoint Interpolation. -/ + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker TensorProduct ENNReal + +namespace CrouzeixHilbert + +open Realization Boundary + +theorem aeval_transferDenominator_isUnit {n : ℕ} (D a : Coeff n) + (hD : spectralRadius ℂ D < 1) (ha : ‖a‖ ≤ 1) : + IsUnit (Polynomial.aeval D (transferDenominator a)) := by + nontriviality (Coeff n) + rw [← spectrum.zero_notMem_iff (R := ℂ), spectrum.map_polynomial_aeval] + rintro ⟨z, hz, he⟩ + have hn : ‖z‖ < 1 := by + rw [spectralRadius_eq_of_unital] at hD + have hi : (‖z‖₊ : ℝ≥0∞) < 1 := (le_iSup₂ (α := ℝ≥0∞) z hz).trans_lt hD + exact_mod_cast hi + have hu : IsUnit (1 - z • a) := by + apply isUnit_one_sub_of_norm_lt_one + rw [norm_smul] + exact (mul_le_mul_of_nonneg_left ha (norm_nonneg z)).trans_lt (by simpa using hn) + have hh := (Matrix.isUnit_iff_isUnit_det _).mp hu + rw [← eval_transferDenominator] at hh + exact isUnit_iff_ne_zero.mp hh he + +@[simp] theorem transferDenominator_ne_zero {n : ℕ} (a : Coeff n) : + transferDenominator a ≠ 0 := by + intro h + have he := eval_transferDenominator a 0 + rw [h, Polynomial.eval_zero, zero_smul, sub_zero, Matrix.det_one] at he + exact zero_ne_one he + +theorem leftTensor_isUnit {n m : ℕ} (A : Coeff n) (hA : IsUnit A) : + IsUnit (A ⊗ₖ (1 : Coeff m)) := by + refine ⟨⟨A ⊗ₖ (1 : Coeff m), Ring.inverse A ⊗ₖ 1, ?_, ?_⟩, rfl⟩ + · rw [← Matrix.mul_kronecker_mul, mul_one, Ring.mul_inverse_cancel _ hA] + exact Matrix.one_kronecker_one + · rw [← Matrix.mul_kronecker_mul, mul_one, Ring.inverse_mul_cancel _ hA] + exact Matrix.one_kronecker_one + +theorem blockPolynomialEval_pencil_transpose {n : ℕ} (D a : Coeff n) : + blockPolynomialEval D (pencil a)ᵀ = 1 - D ⊗ₖ aᵀ := by + rw [pencil, Matrix.transpose_sub, Matrix.transpose_one, Matrix.transpose_smul, + ← Matrix.transpose_map, map_sub, map_one, blockPolynomialEval_smul_constant] + simp only [Polynomial.aeval_X] + +theorem blockPolynomialEval_adjugate_pencil {n : ℕ} (D a : Coeff n) : + blockPolynomialEval D (pencil a).adjugateᵀ * + blockPolynomialEval D (pencil a)ᵀ = + Polynomial.aeval D (transferDenominator a) ⊗ₖ (1 : Coeff n) := by + rw [← map_mul, ← Matrix.transpose_mul, Matrix.mul_adjugate, + Matrix.transpose_smul, Matrix.transpose_one, blockPolynomialEval_scalar] + rfl + +theorem blockPolynomialEval_transferNumerator_transpose {n : ℕ} (D a b c d : Coeff n) : + blockPolynomialEval D (transferNumerator a b c d)ᵀ = + Polynomial.aeval D (transferDenominator a) ⊗ₖ dᵀ + + (D ⊗ₖ bᵀ) * blockPolynomialEval D (pencil a).adjugateᵀ * (1 ⊗ₖ cᵀ) := by + simp only [transferNumerator, Matrix.transpose_add, Matrix.transpose_smul, + Matrix.transpose_mul, ← Matrix.transpose_map, map_add] + rw [← mul_assoc, ← smul_mul_assoc, ← smul_mul_assoc, map_mul, map_mul, + blockPolynomialEval_smul_constant, blockPolynomialEval_smul_constant, + blockPolynomialEval_constant, Polynomial.aeval_X] + +theorem rational_transfer_interpolates {n : ℕ} (D a b c d L X Y : Coeff n) + (hD : spectralRadius ℂ D < 1) (ha : ‖a‖ ≤ 1) + (hL : L = D * L * a + X * c) (hY : Y = D * L * b + X * d) : + matrixRationalEval (Matrix.toEuclideanCLM (𝕜 := ℂ) D) + (transferRational a b c d)ᵀ (vectorization X) = vectorization Y := by + let e := Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n × Fin n) + let E := blockPolynomialEval D (pencil a)ᵀ + let M := blockPolynomialEval D (pencil a).adjugateᵀ + let Q := Polynomial.aeval D (transferDenominator a) ⊗ₖ (1 : Coeff n) + have hME : M * E = Q := blockPolynomialEval_adjugate_pencil D a + have hrec : e E (toHS L) = e (1 ⊗ₖ cᵀ) (toHS X) := by + rw [show E = 1 - D ⊗ₖ aᵀ from blockPolynomialEval_pencil_transpose D a, + map_sub, map_one, sub_apply, one_apply_eq_self, + kronecker_toHS, kronecker_toHS, Matrix.transpose_transpose, Matrix.transpose_transpose, one_mul] + change hsEquiv n L - hsEquiv n (D * L * a) = hsEquiv n (X * c) + rw [← map_sub] + exact congrArg (hsEquiv n) (sub_eq_iff_eq_add.mpr (hL.trans (add_comm _ _))) + have hQc : Commute Q (D ⊗ₖ bᵀ) := by + simpa only [blockPolynomialEval_smul_constant, Polynomial.aeval_X] using + blockPolynomialEval_commute D (transferDenominator a) + ((Polynomial.X : Polynomial ℂ) • bᵀ.map Polynomial.C) + have hNX : e (blockPolynomialEval D (transferNumerator a b c d)ᵀ) (toHS X) = + e Q (toHS Y) := by + rw [blockPolynomialEval_transferNumerator_transpose, map_add, add_apply] + have hd : Polynomial.aeval D (transferDenominator a) ⊗ₖ dᵀ = Q * (1 ⊗ₖ dᵀ) := by + rw [← Matrix.mul_kronecker_mul, mul_one, one_mul] + have hdX : e (1 ⊗ₖ dᵀ) (toHS X) = toHS (X * d) := by + rw [kronecker_toHS, Matrix.transpose_transpose, one_mul] + have hbL : e (D ⊗ₖ bᵀ) (toHS L) = toHS (D * L * b) := by + rw [kronecker_toHS, Matrix.transpose_transpose] + rw [hd, map_mul, mul_apply_eq_comp, hdX, + map_mul, mul_apply_eq_comp, ← hrec, ← mul_apply_eq_comp, ← map_mul, + mul_assoc, hME, ← hQc.eq, map_mul, mul_apply_eq_comp, hbL, ← map_add] + congr 1 + change hsEquiv n (X * d) + hsEquiv n (D * L * b) = hsEquiv n Y + rw [← map_add] + exact congrArg (hsEquiv n) ((add_comm _ _).trans hY.symm) + have hq := aeval_transferDenominator_isUnit D a hD ha + have hQR : Q * blockRationalEval D (transferRational a b c d)ᵀ = + blockPolynomialEval D (transferNumerator a b c d)ᵀ := + blockRationalEval_denom_cancel D (transferNumerator a b c d)ᵀ _ + (transferDenominator_ne_zero a) hq + let coords : Amplification (EuclideanSpace ℂ (Fin n)) n →ₗᵢ[ℂ] + EuclideanSpace ℂ (Fin n × Fin n) := + ⟨(matrixAmplificationCoordinates n n).toLinearMap, norm_matrixAmplificationCoordinates n n⟩ + apply coords.injective + change matrixAmplificationCoordinates n n _ = matrixAmplificationCoordinates n n _ + rw [matrixAmplificationCoordinates_rationalEval, vectorization_coordinates, vectorization_coordinates] + have h0 : e Q (e (blockRationalEval D (transferRational a b c d)ᵀ) (toHS X)) = + e Q (toHS Y) := by + rw [← mul_apply_eq_comp, ← map_mul, hQR] + exact hNX + obtain ⟨u, hu⟩ := (leftTensor_isUnit (m := n) _ hq).map e + rw [← hu] at h0 + have hi := congrArg (fun v => (↑(u⁻¹) : EuclideanSpace ℂ (Fin n × Fin n) →L[ℂ] EuclideanSpace ℂ (Fin n × Fin n)) v) h0 + simpa only [← mul_apply_eq_comp, ← mul_assoc, Units.inv_mul, one_mul, one_apply_eq_self] using hi + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ExteriorBoundaryChart.lean b/lean/OAI/Analysis/Crouzeix/ExteriorBoundaryChart.lean new file mode 100644 index 0000000000000000000000000000000000000000..8454b3b7d4306386c76c53053806eb085599acf9 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ExteriorBoundaryChart.lean @@ -0,0 +1,113 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ConvexApproximation +import OAI.Analysis.Crouzeix.ExteriorRiemann + +namespace OAI + +/-! Exterior Boundary Chart. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +theorem closed_side_of_side (e : OpenPartialHomeomorph ℂ ℂ) {U : Set ℂ} + (hs : ∀ z ∈ e.source, e z ∈ U ↔ 0 < z.im) : + ∀ z ∈ e.source, e z ∈ closure U ↔ 0 ≤ z.im := by + have hi : e.IsImage {z : ℂ | 0 < z.im} U := fun _ hz => hs _ hz + intro z hz + simpa only [closure_setOfPred_lt_im, mem_ofPred_eq] using hi.closure hz + +theorem frontier_invertedExterior {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (a : ℂ) {z : ℂ} + (hz : z ∈ frontier (invertedExterior (closure U) a)) : + z ≠ 0 ∧ a + z⁻¹ ∈ frontier U := by + have hI := isOpen_invertedExterior hb.isCompact_closure a + have hzn : z ∉ invertedExterior (closure U) a := by + simpa only [hI.interior_eq] using hz.2 + have hz0 : z ≠ 0 := fun he => hzn (Or.inl he) + have hzc : a + z⁻¹ ∈ closure U := by + by_contra hn + exact hzn (Or.inr hn) + refine ⟨hz0, hzc, ?_⟩ + rw [hU.interior_eq] + intro hzu + have hn : {w : ℂ | w ≠ 0 ∧ a + w⁻¹ ∈ U} ∈ 𝓝 z := + inter_mem (isClosed_singleton.isOpen_compl.mem_nhds hz0) + ((continuousAt_const.add (continuousAt_inv₀ hz0)).preimage_mem_nhds (hU.mem_nhds hzu)) + obtain ⟨w, hw, hwI⟩ := mem_closure_iff_nhds.mp hz.1 _ hn + exact (hwI.resolve_left hw.1) (subset_closure hw.2) + +theorem boundaryChart_invertedExterior {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) {a : ℂ} (_ha : a ∈ U) + (hc : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) + {p : ℂ} (hp : p ∈ frontier (invertedExterior (closure U) a)) : + Nonempty (BoundaryChart (invertedExterior (closure U) a) p) := by + obtain ⟨hp0, hpf⟩ := frontier_invertedExterior hU hb a hp + obtain ⟨c⟩ := hc _ hpf + let N : Set ℂ := {z | -z ∈ c.e.source ∧ c.e (-z) ≠ a} + have hNo : IsOpen N := by + rw [isOpen_iff_mem_nhds] + intro z hz + exact inter_mem ((continuous_neg).continuousAt.preimage_mem_nhds + (c.e.open_source.mem_nhds hz.1)) + (((c.analytic _ hz.1).continuousAt.comp continuous_neg.continuousAt).preimage_mem_nhds + (isClosed_singleton.isOpen_compl.mem_nhds hz.2)) + have hN0 : (0 : ℂ) ∈ N := by + refine ⟨by simpa only [neg_zero] using c.zero_mem, ?_⟩ + simp only [neg_zero, c.at_zero, ne_eq, add_eq_left, inv_eq_zero] + exact hp0 + let χ : ℂ → ℂ := fun z => (c.e (-z) - a)⁻¹ + have hχa : AnalyticOnNhd ℂ χ N := by + intro z hz + exact (((c.analytic _ hz.1).comp (show AnalyticAt ℂ (fun z : ℂ => -z) z from + analyticAt_id.neg)).sub analyticAt_const).inv (sub_ne_zero.mpr hz.2) + have hχi : InjOn χ N := by + intro z hz w hw he + exact neg_injective (c.e.injOn hz.1 hw.1 + (sub_left_injective (inv_injective he))) + let d := (hχa 0 hN0).hasStrictDerivAt.hasStrictFDerivAt_equiv + (deriv_ne_zero_of_injOn hNo hχa.differentiableOn hχi hN0) + let e := (d.toOpenPartialHomeomorph χ).restrOpen N hNo + have heN : e.source ⊆ N := inter_subset_right + have hea : AnalyticOnNhd ℂ e e.source := hχa.mono heN + have he0 : (0 : ℂ) ∈ e.source := ⟨d.mem_toOpenPartialHomeomorph_source, hN0⟩ + have hs : ∀ z ∈ e.source, + e z ∈ invertedExterior (closure U) a ↔ 0 < z.im := by + intro z hz + have hzN := heN hz + change ((c.e (-z) - a)⁻¹ = 0 ∨ a + ((c.e (-z) - a)⁻¹)⁻¹ ∉ closure U) ↔ _ + simp only [inv_eq_zero, sub_eq_zero, hzN.2, false_or, inv_inv, add_sub_cancel, + c.closed_side _ hzN.1, neg_im, not_le, neg_lt_zero] + refine ⟨⟨e, he0, ?_, hea, analyticOnNhd_symm e hea, hs, closed_side_of_side e hs⟩⟩ + change (c.e (-0) - a)⁻¹ = p + simp only [neg_zero, c.at_zero, add_sub_cancel_left, inv_inv] + +theorem exists_inverted_exterior_collar {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hconv : Convex ℝ U) {a : ℂ} (ha : a ∈ U) + (hc : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) : + ∃ (V : Set ℂ) (ρ : ℝ) (f h : ℂ → ℂ), + IsOpen V ∧ closure (invertedExterior (closure U) a) ⊆ V ∧ 1 < ρ ∧ + AnalyticOnNhd ℂ f V ∧ AnalyticOnNhd ℂ h (ball 0 ρ) ∧ + InjOn f V ∧ InjOn h (ball 0 ρ) ∧ + BijOn f (invertedExterior (closure U) a) (ball 0 1) ∧ + BijOn h (ball 0 1) (invertedExterior (closure U) a) ∧ + BijOn f (closure (invertedExterior (closure U) a)) (closedBall 0 1) ∧ + BijOn h (closedBall 0 1) (closure (invertedExterior (closure U) a)) ∧ + InvOn h f (invertedExterior (closure U) a) (ball 0 1) ∧ f 0 = 0 ∧ h 0 = 0 ∧ + (∀ z ∈ frontier (invertedExterior (closure U) a), ‖f z‖ = 1) ∧ + InvOn h f V (f '' V) ∧ ball 0 ρ ⊆ f '' V := by + apply exists_conformal_collar (isOpen_invertedExterior hb.isCompact_closure a) + (isBounded_invertedExterior (interior_mono subset_closure (hU.interior_eq.symm ▸ ha))) + (isSimplyConnected_invertedExterior hconv.closure (subset_closure ha)) + (zero_mem_invertedExterior _ _) + exact fun p hp => boundaryChart_invertedExterior hU hb ha hc hp + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ExteriorCollar.lean b/lean/OAI/Analysis/Crouzeix/ExteriorCollar.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd3b1da8c4c0483462861b7d15da595af3e33a70 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ExteriorCollar.lean @@ -0,0 +1,197 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ExteriorBoundaryChart + +namespace OAI + +/-! Exterior Collar. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +open scoped Classical + +namespace CrouzeixHilbert.Conformal + +def inversionChart (a : ℂ) : OpenPartialHomeomorph ℂ ℂ where + toFun z := a + z⁻¹ + invFun z := (z - a)⁻¹ + source := {z | z ≠ 0} + target := {z | z ≠ a} + map_source' z hz := by + change a + z⁻¹ ≠ a + simpa only [ne_eq, add_eq_left, inv_eq_zero] using (show z ≠ 0 from hz) + map_target' z hz := inv_ne_zero (sub_ne_zero.mpr hz) + left_inv' z _ := by simp only [add_sub_cancel_left, inv_inv] + right_inv' z _ := by simp only [inv_inv, add_sub_cancel] + open_source := isClosed_singleton.isOpen_compl + open_target := isClosed_singleton.isOpen_compl + continuousOn_toFun z hz := (continuousAt_const.add (continuousAt_inv₀ hz)).continuousWithinAt + continuousOn_invFun z hz := ((continuousAt_id.sub continuousAt_const).inv₀ + (sub_ne_zero.mpr hz)).continuousWithinAt + +theorem mem_closure_invertedExterior {U : Set ℂ} (hU : IsOpen U) + (hc : Convex ℝ U) (hne : U.Nonempty) (a : ℂ) {z : ℂ} (hz : z ≠ 0) : + z ∈ closure (invertedExterior (closure U) a) ↔ a + z⁻¹ ∉ U := by + have hi : (inversionChart a).IsImage (invertedExterior (closure U) a) (closure U)ᶜ := by + intro w hw + change a + w⁻¹ ∉ closure U ↔ w = 0 ∨ a + w⁻¹ ∉ closure U + simp only [show w ≠ 0 from hw, false_or] + have hreg : interior (closure U) = U := + (hc.interior_closure_eq_interior_of_nonempty_interior (hU.interior_eq.symm ▸ hne)).trans hU.interior_eq + have he := (hi.closure hz).symm + change (z ∈ closure (invertedExterior (closure U) a) ↔ a + z⁻¹ ∈ closure (closure U)ᶜ) at he + simpa only [closure_compl, hreg, mem_compl_iff] using he + +structure ExteriorCollar (U : Set ℂ) where + radius : ℝ + radius_pos : 0 < radius + radius_lt_one : radius < 1 + G : ℂ → ℂ + analytic : AnalyticOnNhd ℂ G {t | radius < ‖t‖} + injective : InjOn G {t | radius < ‖t‖} + outside : BijOn G {t | 1 < ‖t‖} (closure U)ᶜ + boundary : BijOn G (sphere 0 1) (frontier U) + inside : MapsTo G {t | radius < ‖t‖ ∧ ‖t‖ < 1} U + leading : ℂ + leading_ne_zero : leading ≠ 0 + regular : ℂ → ℂ + regular_analytic : AnalyticOnNhd ℂ regular (ball 0 radius⁻¹) + laurent : ∀ t, radius < ‖t‖ → G t = leading * t + regular t⁻¹ + +theorem reciprocal_simple_pole {ρ : ℝ} (hρ : 0 < ρ) {h : ℂ → ℂ} + (hh : AnalyticOnNhd ℂ h (ball 0 ρ)) (hi : InjOn h (ball 0 ρ)) (h0 : h 0 = 0) + (a : ℂ) : + ∃ (b : ℂ) (g : ℂ → ℂ), b ≠ 0 ∧ AnalyticOnNhd ℂ g (ball 0 ρ) ∧ + ∀ t : ℂ, ρ⁻¹ < ‖t‖ → a + (h t⁻¹)⁻¹ = b * t + g t⁻¹ := by + let k := dslope h 0 + have hk : AnalyticOnNhd ℂ k (ball 0 ρ) := + ((differentiableOn_dslope (ball_mem_nhds 0 hρ)).mpr hh.differentiableOn).analyticOnNhd isOpen_ball + have hkn : ∀ z ∈ ball 0 ρ, k z ≠ 0 := by + intro z hz + by_cases hz0 : z = 0 + · subst z + simpa only [k, dslope_same] using + deriv_ne_zero_of_injOn isOpen_ball hh.differentiableOn hi (mem_ball_self hρ) + · have hn : h z ≠ 0 := fun he => hz0 (hi hz (mem_ball_self hρ) (he.trans h0.symm)) + simpa only [k, dslope_of_ne h hz0, slope_def_field, sub_zero, h0] using div_ne_zero hn hz0 + let l := fun z => (k z)⁻¹ + have hl : AnalyticOnNhd ℂ l (ball 0 ρ) := fun z hz => (hk z hz).inv (hkn z hz) + let g := fun z => a + dslope l 0 z + have hg : AnalyticOnNhd ℂ g (ball 0 ρ) := fun z hz => + analyticAt_const.add (((differentiableOn_dslope (ball_mem_nhds 0 hρ)).mpr hl.differentiableOn).analyticOnNhd isOpen_ball z hz) + refine ⟨l 0, g, inv_ne_zero (hkn 0 (mem_ball_self hρ)), hg, ?_⟩ + intro t ht + have ht0 : t ≠ 0 := norm_pos_iff.mp ((inv_pos.mpr hρ).trans ht) + have hu0 := inv_ne_zero ht0 + have hhu : h t⁻¹ ≠ 0 := by + have hu : t⁻¹ ∈ ball 0 ρ := mem_ball_zero_iff.mpr (by + rw [norm_inv]; exact (inv_lt_comm₀ (norm_pos_iff.mpr ht0) hρ).mpr ht) + exact fun he => hu0 (hi hu (mem_ball_self hρ) (he.trans h0.symm)) + simp only [g, k, l, dslope_of_ne h hu0, h0, sub_zero, slope_def_field, + dslope_of_ne (fun z => (dslope h 0 z)⁻¹) hu0] + field_simp + ring + +theorem exists_exteriorCollar {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hc : Convex ℝ U) {a : ℂ} (ha : a ∈ U) + (hchart : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) : + Nonempty (ExteriorCollar U) := by + obtain ⟨V, ρ, f, h, hV, hIV, hρ, hf, hh, hfi, hhi, hfb, hhb, hfc, hhc, + hinv, hf0, hh0, hfront, hinvV, hρV⟩ := exists_inverted_exterior_collar hU hb hc ha hchart + have hρ0 : 0 < ρ := zero_lt_one.trans hρ + let I := invertedExterior (closure U) a + let G : ℂ → ℂ := fun t => a + (h t⁻¹)⁻¹ + have ht0 : ∀ t : ℂ, ρ⁻¹ < ‖t‖ → t ≠ 0 := fun t ht => + norm_pos_iff.mp ((inv_pos.mpr hρ0).trans ht) + have hti : ∀ t : ℂ, ρ⁻¹ < ‖t‖ → t⁻¹ ∈ ball 0 ρ := by + intro t ht + rw [mem_ball_zero_iff, norm_inv] + exact (inv_lt_comm₀ (norm_pos_iff.mpr (ht0 t ht)) hρ0).mpr ht + have hhn : ∀ z ∈ ball 0 ρ, z ≠ 0 → h z ≠ 0 := + fun z hz hz0 he => hz0 (hhi hz (mem_ball_self hρ0) (he.trans hh0.symm)) + have hhiC : InvOn h f (closure I) (closedBall 0 1) := + ⟨hinvV.1.mono hIV, hinvV.2.mono ((closedBall_subset_ball hρ).trans hρV)⟩ + have hr1 : ρ⁻¹ < 1 := (inv_lt_one₀ hρ0).mpr hρ + have hGinj : InjOn G {t | ρ⁻¹ < ‖t‖} := by + intro t ht s hs he + exact inv_injective (hhi (hti t ht) (hti s hs) (inv_injective (add_left_cancel he))) + have hGe : ∀ t : ℂ, 1 ≤ ‖t‖ → t⁻¹ ∈ closedBall 0 1 := by + intro t ht + rw [mem_closedBall_zero_iff, norm_inv] + exact (inv_le_one₀ (zero_lt_one.trans_le ht)).mpr ht + have hGo : ∀ t : ℂ, 1 < ‖t‖ → t⁻¹ ∈ ball 0 1 := by + intro t ht + rw [mem_ball_zero_iff, norm_inv] + exact (inv_lt_one₀ (zero_lt_one.trans ht)).mpr ht + have hGb : BijOn G {t | 1 < ‖t‖} (closure U)ᶜ := by + refine ⟨?_, hGinj.mono (fun t ht => hr1.trans ht), ?_⟩ + · intro t ht + exact (hhb.mapsTo (hGo t ht)).resolve_left (hhn _ (hti t (hr1.trans ht)) (inv_ne_zero (ht0 t (hr1.trans ht)))) + · intro z hz + have hza : z - a ≠ 0 := fun he => hz (sub_eq_zero.mp he ▸ subset_closure ha) + have hzi : (z - a)⁻¹ ∈ I := Or.inr (by simpa only [inv_inv, add_sub_cancel, mem_compl_iff] using hz) + let v := f (z - a)⁻¹ + have hv : v ∈ ball 0 1 := hfb.mapsTo hzi + have hv0 : v ≠ 0 := fun he => inv_ne_zero hza + (hfb.injOn hzi (zero_mem_invertedExterior _ _) (he.trans hf0.symm)) + refine ⟨v⁻¹, ?_, ?_⟩ + · change 1 < ‖v⁻¹‖ + rw [norm_inv, one_lt_inv₀ (norm_pos_iff.mpr hv0)] + exact mem_ball_zero_iff.mp hv + · simp only [G, inv_inv, v, hinv.1 hzi, add_sub_cancel] + have hGf : BijOn G (sphere 0 1) (frontier U) := by + refine ⟨?_, hGinj.mono (fun t ht => by change ρ⁻¹ < ‖t‖; rwa [mem_sphere_zero_iff_norm.mp ht]), ?_⟩ + · intro t ht + have htn : ‖t‖ = 1 := mem_sphere_zero_iff_norm.mp ht + have htS : ρ⁻¹ < ‖t‖ := htn ▸ hr1 + have htvn : ‖t⁻¹‖ = 1 := by rw [norm_inv, htn, inv_one] + have hin : h t⁻¹ ∈ frontier I := by + refine ⟨hhc.mapsTo (hGe t htn.ge), ?_⟩ + rw [(isOpen_invertedExterior hb.isCompact_closure a).interior_eq] + intro he + have heq := hhiC.2 (hGe t htn.ge) + have hsmall := mem_ball_zero_iff.mp (hfb.mapsTo he) + rw [heq, htvn] at hsmall + exact (lt_irrefl 1 hsmall) + exact (frontier_invertedExterior hU hb a hin).2 + · intro z hz + have hza : z - a ≠ 0 := fun he => hz.2 (by rw [hU.interior_eq]; exact sub_eq_zero.mp he ▸ ha) + let v := (z - a)⁻¹ + have hv0 : v ≠ 0 := inv_ne_zero hza + have hvC : v ∈ closure I := (mem_closure_invertedExterior hU hc ⟨a, ha⟩ a hv0).mpr (by + simpa only [v, inv_inv, add_sub_cancel, hU.interior_eq] using hz.2) + have hvn : v ∉ I := by + intro he + have := he.resolve_left hv0 + exact this (by simpa only [v, inv_inv, add_sub_cancel] using hz.1) + have hvF : v ∈ frontier I := ⟨hvC, fun he => hvn (interior_subset he)⟩ + have hfv : ‖f v‖ = 1 := hfront _ hvF + refine ⟨(f v)⁻¹, ?_, ?_⟩ + · rw [mem_sphere_zero_iff_norm, norm_inv, hfv, inv_one] + · change a + (h ((f v)⁻¹)⁻¹)⁻¹ = z + rw [inv_inv, hhiC.1 hvC] + simp only [v, inv_inv, add_sub_cancel] + have hGin : MapsTo G {t | ρ⁻¹ < ‖t‖ ∧ ‖t‖ < 1} U := by + intro t ht + by_contra hn + have hvC : h t⁻¹ ∈ closure I := + (mem_closure_invertedExterior hU hc ⟨a, ha⟩ a + (hhn _ (hti t ht.1) (inv_ne_zero (ht0 t ht.1)))).mpr hn + obtain ⟨v, hv, he⟩ := hhc.surjOn hvC + have hvt : v = t⁻¹ := hhi ((closedBall_subset_ball hρ) hv) (hti t ht.1) he + have hle : ‖t‖⁻¹ ≤ 1 := by simpa only [hvt, norm_inv, mem_closedBall_zero_iff] using hv + exact (not_le_of_gt ht.2) ((inv_le_one₀ (norm_pos_iff.mpr (ht0 t ht.1))).mp hle) + have hGa : AnalyticOnNhd ℂ G {t | ρ⁻¹ < ‖t‖} := by + intro t ht + exact analyticAt_const.add (((hh _ (hti t ht)).comp + (analyticAt_id.inv (ht0 t ht))).inv (hhn _ (hti t ht) (inv_ne_zero (ht0 t ht)))) + obtain ⟨b, g, hbn, hga, hLaur⟩ := reciprocal_simple_pole hρ0 hh hhi hh0 a + exact ⟨⟨ρ⁻¹, inv_pos.mpr hρ0, hr1, G, hGa, hGinj, hGb, hGf, hGin, + b, hbn, g, by simpa only [inv_inv] using hga, hLaur⟩⟩ + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ExteriorContour.lean b/lean/OAI/Analysis/Crouzeix/ExteriorContour.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f7401cac174580e7a58e934c49c1ecf1211601a --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ExteriorContour.lean @@ -0,0 +1,173 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryKernel +import OAI.Analysis.Crouzeix.CircleAnalytic +import OAI.Analysis.Crouzeix.PolynomialApproximation + +namespace OAI + +/-! Exterior Contour. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +open Boundary + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +def boundaryMap : C(CircleSpace, ℂ) where + toFun t := C.G (circleCoordinate t) + continuous_toFun := C.analytic.continuousOn.comp_continuous circleCoordinate.continuous + (fun t => by change C.radius < ‖circleCoordinate t‖; rw [norm_circleCoordinate]; exact C.radius_lt_one) + +def boundaryNormal : C(CircleSpace, ℂ) where + toFun t := circleCoordinate t * deriv C.G (circleCoordinate t) + continuous_toFun := circleCoordinate.continuous.mul + (C.analytic.deriv.continuousOn.comp_continuous circleCoordinate.continuous + (fun t => by change C.radius < ‖circleCoordinate t‖; rw [norm_circleCoordinate]; exact C.radius_lt_one)) + +lemma boundaryMap_mem_frontier (t : CircleSpace) : C.boundaryMap t ∈ frontier U := + C.boundary.mapsTo (mem_sphere_zero_iff_norm.mpr (norm_circleCoordinate t)) + +def boundaryContour : SmoothContour where + path t := C.G (unitCirclePath t) + smooth := (C.analytic.contDiffOn C.parameter_open.uniqueDiffOn |>.restrict_scalars ℝ).comp_contDiff + unitCirclePath_smooth (fun t => by change C.radius < ‖unitCirclePath t‖; rw [unitCirclePath_norm]; exact C.radius_lt_one) + closed := by rw [unitCirclePath_closed] + +lemma boundaryContour_deriv (t : ℝ) : + deriv C.boundaryContour.path t = + (2 * (Real.pi : ℂ) * I) * C.boundaryNormal (t : CircleSpace) := by + have hc : C.radius < ‖unitCirclePath t‖ := by rw [unitCirclePath_norm]; exact C.radius_lt_one + have hd := ((C.analytic _ hc).differentiableAt.hasDerivAt.hasFDerivAt.restrictScalars ℝ).comp_hasDerivAt + t (hasDerivAt_unitCirclePath t) + change HasDerivAt C.boundaryContour.path _ t at hd + rw [hd.deriv] + change (unitCirclePath t * (2 * (Real.pi : ℂ) * I)) * deriv C.G (unitCirclePath t) = _ + change _ = (2 * (Real.pi : ℂ) * I) * (circleCoordinate (t : CircleSpace) * _) + rw [circleCoordinate_coe] + change (circleMap 0 1 (2 * Real.pi * t) * (2 * (Real.pi : ℂ) * I)) * _ = _ + unfold unitCirclePath + ring + +lemma boundaryContour_trace_subset : C.boundaryContour.trace ⊆ frontier U := by + rintro z ⟨t,ht,rfl⟩ + exact C.boundary.mapsTo (mem_sphere_zero_iff_norm.mpr (unitCirclePath_norm t)) + +lemma boundaryContour_integral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + (f : ℂ → E) : + (2 * (Real.pi : ℂ) * I)⁻¹ • + (∫ t in (0 : ℝ)..1, deriv C.boundaryContour.path t • f (C.boundaryContour.path t)) = + ∫ t, C.boundaryNormal t • f (C.boundaryMap t) ∂circleMeasure := by + rw [integral_circleMeasure_eq_interval, ← intervalIntegral.integral_smul] + apply intervalIntegral.integral_congr + intro t ht + dsimp only + rw [C.boundaryContour_deriv, smul_smul, inv_mul_cancel_left₀] + · congr 1 + change f (C.G (unitCirclePath t)) = f (C.G (circleCoordinate (t : CircleSpace))) + rw [circleCoordinate_coe] + rfl + · exact mul_ne_zero (mul_ne_zero (by norm_num) (ofReal_ne_zero.mpr Real.pi_ne_zero)) I_ne_zero + +lemma exterior_value_not_mem (hU : IsOpen U) {t : ℂ} (ht : 1 ≤ ‖t‖) : C.G t ∉ U := by + rcases ht.eq_or_lt with he|he + · have hb := C.boundary.mapsTo (mem_sphere_zero_iff_norm.mpr he.symm) + exact fun hz => hb.2 (hU.interior_eq.symm ▸ hz) + · exact fun h => C.outside.mapsTo he (subset_closure h) + +def reciprocalDenominator (z u : ℂ) : ℂ := C.leading + u * (C.regular u - z) + +lemma reciprocalDenominator_inverse {z t : ℂ} (ht : C.radius < ‖t‖) : + C.reciprocalDenominator z t⁻¹ = t⁻¹ * (C.G t - z) := by + rw [C.laurent t ht, reciprocalDenominator] + have hn : t ≠ 0 := norm_pos_iff.mp (C.radius_pos.trans ht) + field_simp + ring + +lemma reciprocalDenominator_ne_zero (hU : IsOpen U) {z u : ℂ} (hz : z ∈ U) + (hu : u ∈ closedBall 0 1) : C.reciprocalDenominator z u ≠ 0 := by + by_cases hu0 : u = 0 + · simpa only [hu0, reciprocalDenominator, zero_mul, add_zero] using C.leading_ne_zero + have ht : 1 ≤ ‖u⁻¹‖ := by + rw [norm_inv] + exact (one_le_inv₀ (norm_pos_iff.mpr hu0)).mpr (mem_closedBall_zero_iff.mp hu) + have he := C.reciprocalDenominator_inverse (z := z) (C.radius_lt_one.trans_le ht) + rw [inv_inv] at he + rw [he] + exact mul_ne_zero hu0 (sub_ne_zero.mpr (fun h => C.exterior_value_not_mem hU ht (h ▸ hz))) + +def reciprocalCauchy (z u : ℂ) : ℂ := + (C.leading - u^2 * deriv C.regular u) / C.reciprocalDenominator z u + +lemma differentiableOn_reciprocalCauchy (hU : IsOpen U) {z : ℂ} (hz : z ∈ U) : + DifferentiableOn ℂ (C.reciprocalCauchy z) (closedBall 0 1) := by + apply DifferentiableOn.div + · exact (differentiableOn_const _).sub ((differentiableOn_id.pow 2).mul + (C.regular_analytic.deriv.differentiableOn.mono C.closed_unit_subset_reciprocalDisk)) + · exact (differentiableOn_const _).add (differentiableOn_id.mul + ((C.regular_analytic.differentiableOn.mono C.closed_unit_subset_reciprocalDisk).sub_const z)) + · exact fun u hu => C.reciprocalDenominator_ne_zero hU hz hu + +lemma reciprocalCauchy_boundary (hU : IsOpen U) {z : ℂ} (hz : z ∈ U) (t : CircleSpace) : + C.reciprocalCauchy z (circleCoordinate t)⁻¹ = + C.boundaryNormal t / (C.boundaryMap t - z) := by + have ht : C.radius < ‖circleCoordinate t‖ := by rw [norm_circleCoordinate]; exact C.radius_lt_one + rw [reciprocalCauchy, C.reciprocalDenominator_inverse ht, ← C.deriv_laurent ht] + change deriv C.G (circleCoordinate t) / ((circleCoordinate t)⁻¹ * (C.G (circleCoordinate t) - z)) = _ + simp only [boundaryNormal, boundaryMap, ContinuousMap.coe_mk] + have hden : C.G (circleCoordinate t) - z ≠ 0 := + sub_ne_zero.mpr fun he => + C.exterior_value_not_mem hU (norm_circleCoordinate t).ge (he ▸ hz) + field_simp [hden] + +lemma boundaryContour_index_inside (hU : IsOpen U) {z : ℂ} (hz : z ∈ U) : + C.boundaryContour.index z = 1 := by + change (2 * (Real.pi : ℂ) * I)⁻¹ • + (∫ t in (0 : ℝ)..1, deriv C.boundaryContour.path t * (C.boundaryContour.path t - z)⁻¹) = 1 + rw [show (fun t : ℝ => deriv C.boundaryContour.path t * (C.boundaryContour.path t - z)⁻¹) = + fun t => deriv C.boundaryContour.path t • (C.boundaryContour.path t - z)⁻¹ from rfl, + C.boundaryContour_integral (fun w => (w - z)⁻¹)] + change (∫ t, C.boundaryNormal t / (C.boundaryMap t - z) ∂circleMeasure) = 1 + simp_rw [← C.reciprocalCauchy_boundary hU hz] + rw [integral_holomorphic_inverse_circleCoordinate (C.differentiableOn_reciprocalCauchy hU hz)] + simp [reciprocalCauchy, reciprocalDenominator, C.leading_ne_zero] + +lemma boundaryContour_index_outside (hc : Convex ℝ U) {z : ℂ} (hz : z ∉ closure U) : + C.boundaryContour.index z = 0 := + C.boundaryContour.index_eq_zero_of_convex hc.closure isClosed_closure + (C.boundaryContour_trace_subset.trans frontier_subset_closure) hz + +lemma physical_cauchy_formula (hU : IsOpen U) {V : Set ℂ} (hV : IsOpen V) + (hcV : Convex ℝ V) (hUV : closure U ⊆ V) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f V) {z : ℂ} (hz : z ∈ U) : + (∫ t, (C.boundaryNormal t / (C.boundaryMap t - z)) * f (C.boundaryMap t) + ∂circleMeasure) = f z := by + have hztrace : z ∉ C.boundaryContour.trace := by + intro he + exact (C.boundaryContour_trace_subset he).2 (hU.interior_eq.symm ▸ hz) + have he := C.boundaryContour.cauchy_formula_convex hV hcV + (C.boundaryContour_trace_subset.trans (frontier_subset_closure.trans hUV)) hf + (hUV (subset_closure hz)) hztrace + rw [C.boundaryContour_index_inside hU hz, one_mul] at he + have hi := C.boundaryContour_integral (fun w => f w / (w - z)) + simp only [smul_eq_mul] at hi + have hmul (a b c : ℂ) : a * (b / c) = a * b / c := by ring + have hmul' (a b c : ℂ) : a * (b / c) = (a / c) * b := by ring + simp_rw [hmul] at hi + rw [hi] at he + convert he using 1 + apply integral_congr_ae + exact Filter.Eventually.of_forall fun t => by ring + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ExteriorKernel.lean b/lean/OAI/Analysis/Crouzeix/ExteriorKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..574c52a09d18a414aacb2c95cf19e047be1f7dd3 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ExteriorKernel.lean @@ -0,0 +1,171 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ExteriorNormal +import OAI.Analysis.Crouzeix.SeparateHolomorphic + +namespace OAI + +/-! Exterior Kernel. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +abbrev reciprocalDisk : Set ℂ := ball 0 C.radius⁻¹ + +lemma inverse_mem_reciprocalDisk {t : ℂ} (ht : C.radius < ‖t‖) : + t⁻¹ ∈ C.reciprocalDisk := by + rw [mem_ball_zero_iff, norm_inv] + exact (inv_lt_inv₀ (C.radius_pos.trans ht) C.radius_pos).mpr ht + +lemma inverse_mem_parameter {u : ℂ} (hu : u ∈ C.reciprocalDisk) (hu0 : u ≠ 0) : + C.radius < ‖u⁻¹‖ := by + rw [norm_inv] + exact (lt_inv_comm₀ C.radius_pos (norm_pos_iff.mpr hu0)).mpr (mem_ball_zero_iff.mp hu) + +lemma deriv_laurent {t : ℂ} (ht : C.radius < ‖t‖) : + deriv C.G t = C.leading - (t⁻¹)^2 * deriv C.regular t⁻¹ := by + have ht0 : t ≠ 0 := norm_pos_iff.mp (C.radius_pos.trans ht) + have hd := ((hasDerivAt_id t).const_mul C.leading).add + ((C.regular_analytic _ (C.inverse_mem_reciprocalDisk ht)).differentiableAt.hasDerivAt.comp t + (hasDerivAt_inv ht0)) + have he : C.G =ᶠ[𝓝 t] (fun t => C.leading * t + C.regular t⁻¹) := by + filter_upwards [C.parameter_open.mem_nhds ht] with w hw + exact C.laurent w hw + dsimp only [id_eq, Pi.add_apply, comp_apply] at hd + rw [he.deriv_eq] + exact hd.deriv.trans (by rw [inv_pow]; ring) + +def dividedDenominator (u v : ℂ) : ℂ := + C.leading - u * v * dslope C.regular v u + +lemma continuousOn_dividedDenominator : + ContinuousOn (uncurry C.dividedDenominator) (C.reciprocalDisk ×ˢ C.reciprocalDisk) := by + have hd := continuousOn_dslope_pair isOpen_ball C.regular_analytic.differentiableOn + apply continuousOn_const.sub + apply (continuous_fst.mul continuous_snd).continuousOn.mul + exact hd.comp (f := Prod.swap) continuous_swap.continuousOn (fun _ h => ⟨h.2,h.1⟩) + +lemma differentiableOn_dividedDenominator_left {v : ℂ} (hv : v ∈ C.reciprocalDisk) : + DifferentiableOn ℂ (fun u => C.dividedDenominator u v) C.reciprocalDisk := by + apply (differentiableOn_const _).sub + apply (differentiableOn_id.mul_const v).mul + exact (differentiableOn_dslope (isOpen_ball.mem_nhds hv)).mpr C.regular_analytic.differentiableOn + +lemma differentiableOn_dividedDenominator_right {u : ℂ} (hu : u ∈ C.reciprocalDisk) : + DifferentiableOn ℂ (C.dividedDenominator u) C.reciprocalDisk := by + have hd : DifferentiableOn ℂ (fun v => dslope C.regular v u) C.reciprocalDisk := by + exact ((differentiableOn_dslope (isOpen_ball.mem_nhds hu)).mpr + C.regular_analytic.differentiableOn).congr (fun v _ => dslope_swap C.regular v u) + exact (differentiableOn_const _).sub ((differentiableOn_id.const_mul u).mul hd) + +lemma dividedDenominator_eq {u v : ℂ} (hu : u ∈ C.reciprocalDisk) (hv : v ∈ C.reciprocalDisk) + (hu0 : u ≠ 0) (hv0 : v ≠ 0) (huv : u ≠ v) : + C.dividedDenominator u v = (C.G u⁻¹ - C.G v⁻¹) / (u⁻¹-v⁻¹) := by + rw [C.laurent _ (C.inverse_mem_parameter hu hu0), C.laurent _ (C.inverse_mem_parameter hv hv0)] + simp only [dividedDenominator, inv_inv, dslope_of_ne _ huv, slope_def_field] + field_simp + ring + +lemma dividedDenominator_diag {u : ℂ} (hu : u ∈ C.reciprocalDisk) (hu0 : u ≠ 0) : + C.dividedDenominator u u = deriv C.G u⁻¹ := by + rw [C.deriv_laurent (C.inverse_mem_parameter hu hu0), inv_inv] + simp only [dividedDenominator, dslope_same] + ring + +lemma dividedDenominator_ne_zero {u v : ℂ} (hu : u ∈ C.reciprocalDisk) + (hv : v ∈ C.reciprocalDisk) : C.dividedDenominator u v ≠ 0 := by + by_cases hu0 : u = 0 + · simpa only [dividedDenominator, hu0, zero_mul, sub_zero] using C.leading_ne_zero + by_cases hv0 : v = 0 + · simpa only [dividedDenominator, hv0, mul_zero, zero_mul, sub_zero] using C.leading_ne_zero + by_cases huv : u = v + · subst v + rw [C.dividedDenominator_diag hu hu0] + exact C.deriv_ne_zero (C.inverse_mem_parameter hu hu0) + rw [C.dividedDenominator_eq hu hv hu0 hv0 huv] + apply div_ne_zero + · intro he + exact huv (inv_injective (C.injective (C.inverse_mem_parameter hu hu0) + (C.inverse_mem_parameter hv hv0) (sub_eq_zero.mp he))) + · exact sub_ne_zero.mpr (fun he => huv (inv_injective he)) + +def correction (u v : ℂ) : ℂ := + -u * deriv (fun z => C.dividedDenominator z v) u / C.dividedDenominator u v + +lemma continuousOn_correction : + ContinuousOn (uncurry C.correction) (C.reciprocalDisk ×ˢ C.reciprocalDisk) := by + apply ContinuousOn.div + · apply continuous_fst.neg.continuousOn.mul + exact continuousOn_first_derivative isOpen_ball isOpen_ball C.continuousOn_dividedDenominator + (fun _ hv => C.differentiableOn_dividedDenominator_left hv) + · exact C.continuousOn_dividedDenominator + · exact fun _ h => C.dividedDenominator_ne_zero h.1 h.2 + +lemma differentiableOn_correction_left {v : ℂ} (hv : v ∈ C.reciprocalDisk) : + DifferentiableOn ℂ (fun u => C.correction u v) C.reciprocalDisk := + (differentiableOn_id.neg.mul + ((C.differentiableOn_dividedDenominator_left hv).deriv isOpen_ball)).div + (C.differentiableOn_dividedDenominator_left hv) (fun _ hu => C.dividedDenominator_ne_zero hu hv) + +lemma differentiableOn_correction_right {u : ℂ} (hu : u ∈ C.reciprocalDisk) : + DifferentiableOn ℂ (C.correction u) C.reciprocalDisk := by + apply DifferentiableOn.div + · apply DifferentiableOn.const_mul + exact differentiableOn_second_first_derivative isOpen_ball isOpen_ball + C.continuousOn_dividedDenominator + (fun _ hv => C.differentiableOn_dividedDenominator_left hv) + (fun _ hu => C.differentiableOn_dividedDenominator_right hu) hu + · exact C.differentiableOn_dividedDenominator_right hu + · exact fun _ hv => C.dividedDenominator_ne_zero hu hv + +@[simp] lemma correction_zero_left (v : ℂ) : C.correction 0 v = 0 := by + simp only [correction, neg_zero, zero_mul, zero_div] + +@[simp] lemma correction_zero_right (u : ℂ) : C.correction u 0 = 0 := by + simp only [correction, dividedDenominator, mul_zero, zero_mul, sub_zero, + deriv_const, mul_zero, zero_div] + +lemma correction_eq {t w : ℂ} (ht : C.radius < ‖t‖) (hw : C.radius < ‖w‖) + (htw : t ≠ w) : + C.correction t⁻¹ w⁻¹ = t * deriv C.G t / (C.G t - C.G w) - t / (t-w) := by + have ht0 : t ≠ 0 := norm_pos_iff.mp (C.radius_pos.trans ht) + have hw0 : w ≠ 0 := norm_pos_iff.mp (C.radius_pos.trans hw) + have hg : C.G t - C.G w ≠ 0 := sub_ne_zero.mpr (fun he => htw (C.injective ht hw he)) + have htw' : t-w ≠ 0 := sub_ne_zero.mpr htw + have hQ := C.dividedDenominator_eq (C.inverse_mem_reciprocalDisk ht) + (C.inverse_mem_reciprocalDisk hw) (inv_ne_zero ht0) (inv_ne_zero hw0) + (fun he => htw (inv_injective he)) + simp only [inv_inv] at hQ + have hdQ := ((C.differentiableOn_dividedDenominator_left + (C.inverse_mem_reciprocalDisk hw)).differentiableAt + (isOpen_ball.mem_nhds (C.inverse_mem_reciprocalDisk ht))).hasDerivAt.comp t + (hasDerivAt_inv ht0) + have hdG := ((C.analytic t ht).differentiableAt.hasDerivAt.sub_const (C.G w)).div + ((hasDerivAt_id t).sub_const w) htw' + have he : (fun z => C.dividedDenominator z⁻¹ w⁻¹) =ᶠ[𝓝 t] + (fun z => (C.G z - C.G w)/(z-w)) := by + filter_upwards [C.parameter_open.mem_nhds ht, eventually_ne_nhds htw] with z hz hzw + have hz0 : z ≠ 0 := norm_pos_iff.mp (C.radius_pos.trans hz) + simpa only [inv_inv] using C.dividedDenominator_eq (C.inverse_mem_reciprocalDisk hz) + (C.inverse_mem_reciprocalDisk hw) (inv_ne_zero hz0) (inv_ne_zero hw0) + (fun he => hzw (inv_injective he)) + dsimp only [Function.comp_apply, id_eq] at hdQ hdG + have hd := (hdQ.congr_of_eventuallyEq he.symm).unique hdG + dsimp only [correction] + rw [hQ] + field_simp at hd ⊢ + exact hd + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ExteriorNormal.lean b/lean/OAI/Analysis/Crouzeix/ExteriorNormal.lean new file mode 100644 index 0000000000000000000000000000000000000000..ed7635cd19d2101e2a1dbe4935453212bc3f0384 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ExteriorNormal.lean @@ -0,0 +1,78 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ExteriorCollar + +namespace OAI + +/-! Exterior Normal. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate + +open scoped InnerProductSpace + +namespace CrouzeixHilbert.Conformal + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +lemma parameter_open : IsOpen {t : ℂ | C.radius < ‖t‖} := isOpen_lt continuous_const continuous_norm + +lemma deriv_ne_zero {t : ℂ} (ht : C.radius < ‖t‖) : deriv C.G t ≠ 0 := + deriv_ne_zero_of_injOn C.parameter_open C.analytic.differentiableOn C.injective ht + +theorem supporting_normal (hc : Convex ℝ U) {t : ℂ} (ht : ‖t‖ = 1) + {z : ℂ} (hz : z ∈ closure U) : + 0 ≤ (conj (t * deriv C.G t) * (C.G t - z)).re := by + have htC : C.radius < ‖t‖ := ht ▸ C.radius_lt_one + have hdn := C.deriv_ne_zero htC + let d := (C.analytic t htC).hasStrictDerivAt.hasStrictFDerivAt_equiv hdn + let e := (d.toOpenPartialHomeomorph C.G).restrOpen {t : ℂ | C.radius < ‖t‖} C.parameter_open + have heC : e.source ⊆ {t : ℂ | C.radius < ‖t‖} := inter_subset_right + have het : t ∈ e.source := ⟨d.mem_toOpenPartialHomeomorph_source, htC⟩ + have heG : (e : ℂ → ℂ) = C.G := rfl + have hegt : C.G t ∈ e.target := e.map_source het + have hei : e.symm (C.G t) = t := e.left_inv het + have hp : C.G t ∈ closure U := (C.boundary.mapsTo (mem_sphere_zero_iff_norm.mpr ht)).1 + have hemax : IsLocalMaxOn (fun w : ℂ => ‖e.symm w‖ ^ 2) (closure U) (C.G t) := by + filter_upwards [nhdsWithin_le_nhds (e.open_target.mem_nhds hegt), + self_mem_nhdsWithin] with w hw hwU + rw [hei, ht, one_pow] + have hwsmall : ‖e.symm w‖ ≤ 1 := by + by_contra hn + have houtside := C.outside.mapsTo (lt_of_not_ge hn) + have heq : C.G (e.symm w) = w := e.right_inv hw + exact houtside (heq.symm ▸ hwU) + nlinarith [norm_nonneg (e.symm w)] + have heder : HasDerivAt e.symm (deriv C.G t)⁻¹ (C.G t) := + e.hasDerivAt_symm hegt hdn (by rw [hei, heG]; exact (C.analytic t htC).differentiableAt.hasDerivAt) + have hdir := hemax.hasFDerivWithinAt_nonpos + (heder.hasFDerivAt.restrictScalars ℝ).norm_sq.hasFDerivWithinAt + (sub_mem_posTangentConeAt_of_segment_subset (hc.closure.segment_subset hp hz)) + simp only [ContinuousLinearMap.comp_apply, smul_apply] at hdir + simp only [innerSL_apply_apply] at hdir + rw [hei, real_inner_eq_re_inner (𝕜 := ℂ), RCLike.inner_apply] at hdir + simp only [two_smul] at hdir + change (((z - C.G t) * (deriv C.G t)⁻¹) * conj t).re + + (((z - C.G t) * (deriv C.G t)⁻¹) * conj t).re ≤ 0 at hdir + have halg : (((z - C.G t) * (deriv C.G t)⁻¹) * conj t).re = + - (conj (t * deriv C.G t) * (C.G t - z)).re / Complex.normSq (deriv C.G t) := by + rw [Complex.inv_def] + simp only [map_mul, div_eq_mul_inv, Complex.mul_re, + Complex.mul_im, Complex.conj_re, Complex.conj_im, Complex.ofReal_re, + Complex.ofReal_im, Complex.sub_re, Complex.sub_im] + ring + rw [halg] at hdir + have hpos := Complex.normSq_pos.mpr hdn + have hle : - (conj (t * deriv C.G t) * (C.G t - z)).re / + Complex.normSq (deriv C.G t) ≤ 0 := by linarith + exact neg_nonpos.mp (by simpa only [zero_mul] using (div_le_iff₀ hpos).mp hle) + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ExteriorRiemann.lean b/lean/OAI/Analysis/Crouzeix/ExteriorRiemann.lean new file mode 100644 index 0000000000000000000000000000000000000000..259975e3366ad77b4f9e32ebfdf8ecc99860916b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ExteriorRiemann.lean @@ -0,0 +1,182 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryModulus + +namespace OAI + +/-! Exterior Riemann. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +namespace CrouzeixHilbert.Conformal + +def invertedExterior (K : Set ℂ) (a : ℂ) : Set ℂ := + {z | z = 0 ∨ a + z⁻¹ ∉ K} + +@[simp] theorem zero_mem_invertedExterior (K : Set ℂ) (a : ℂ) : + 0 ∈ invertedExterior K a := Or.inl rfl + +theorem invertedExterior_mem_nhds_zero {K : Set ℂ} (hb : Bornology.IsBounded K) (a : ℂ) : + invertedExterior K a ∈ 𝓝 0 := by + obtain ⟨R, hR, hsub⟩ := hb.subset_ball_lt 0 a + apply Metric.mem_nhds_iff.mpr + refine ⟨R⁻¹, inv_pos.mpr hR, ?_⟩ + intro z hz + by_cases hz0 : z = 0 + · exact Or.inl hz0 + · apply Or.inr + intro hk + have hn := mem_ball.mp (hsub hk) + rw [dist_eq_norm, add_sub_cancel_left, norm_inv] at hn + have hnorm : 0 < ‖z‖ := norm_pos_iff.mpr hz0 + have hzr : ‖z‖ < R⁻¹ := mem_ball_zero_iff.mp hz + have hback : R < ‖z‖⁻¹ := (lt_inv_comm₀ hR hnorm).mpr hzr + exact (hback.trans hn).false + +theorem isOpen_invertedExterior {K : Set ℂ} (hK : IsCompact K) (a : ℂ) : + IsOpen (invertedExterior K a) := by + rw [isOpen_iff_mem_nhds] + intro z hz + by_cases hz0 : z = 0 + · subst z + exact invertedExterior_mem_nhds_zero hK.isBounded a + · have hzn : a + z⁻¹ ∉ K := hz.resolve_left hz0 + have hc : ContinuousAt (fun w : ℂ => a + w⁻¹) z := + continuousAt_const.add (continuousAt_inv₀ hz0) + filter_upwards [hc.preimage_mem_nhds (hK.isClosed.isOpen_compl.mem_nhds hzn)] with w hw + exact Or.inr hw + +theorem isBounded_invertedExterior {K : Set ℂ} {a : ℂ} (ha : a ∈ interior K) : + Bornology.IsBounded (invertedExterior K a) := by + obtain ⟨ε, hε, hsub⟩ := Metric.mem_nhds_iff.mp (mem_interior_iff_mem_nhds.mp ha) + apply (isBounded_closedBall (x := (0 : ℂ)) (r := ε⁻¹)).subset + intro z hz + apply mem_closedBall_zero_iff.mpr + rcases hz with rfl | hzn + · simpa only [norm_zero] using (inv_nonneg.mpr hε.le) + · by_cases hz0 : z = 0 + · simpa only [hz0, norm_zero] using (inv_nonneg.mpr hε.le) + · by_contra h + have hlarge : ε⁻¹ < ‖z‖ := lt_of_not_ge h + apply hzn + apply hsub + rw [mem_ball, dist_eq_norm, add_sub_cancel_left, norm_inv] + exact (inv_lt_comm₀ (norm_pos_iff.mpr hz0) hε).mpr hlarge + +theorem starConvex_invertedExterior {K : Set ℂ} (hK : Convex ℝ K) {a : ℂ} + (ha : a ∈ K) : StarConvex ℝ 0 (invertedExterior K a) := by + intro z hz s t hs ht hst + simp only [smul_zero, zero_add] + by_cases ht0 : t = 0 + · simp only [ht0, zero_smul, zero_mem_invertedExterior] + by_cases hz0 : z = 0 + · simp only [hz0, smul_zero, zero_mem_invertedExterior] + apply Or.inr + intro hk + have hi := hK.add_smul_sub_mem ha hk (show t ∈ Icc 0 1 by constructor <;> linarith) + have he : a + t • (a + (t • z)⁻¹ - a) = a + z⁻¹ := by + simp only [Complex.real_smul, add_sub_cancel_left, mul_inv_rev] + have htC : (t : ℂ) ≠ 0 := by exact_mod_cast ht0 + field_simp + rw [he] at hi + exact (hz.resolve_left hz0) hi + +theorem isSimplyConnected_invertedExterior {K : Set ℂ} (hK : Convex ℝ K) {a : ℂ} + (ha : a ∈ K) : IsSimplyConnected (invertedExterior K a) := by + let _ := (starConvex_invertedExterior hK ha).contractibleSpace + (show (invertedExterior K a).Nonempty from ⟨0, zero_mem_invertedExterior K a⟩) + change SimplyConnectedSpace (invertedExterior K a) + infer_instance + +theorem riemann_invertedExterior {K : Set ℂ} (hK : IsCompact K) (hconv : Convex ℝ K) + {a : ℂ} (ha : a ∈ interior K) : + ∃ f g : ℂ → ℂ, + DifferentiableOn ℂ f (invertedExterior K a) ∧ + DifferentiableOn ℂ g (ball 0 1) ∧ + BijOn f (invertedExterior K a) (ball 0 1) ∧ + BijOn g (ball 0 1) (invertedExterior K a) ∧ + InvOn g f (invertedExterior K a) (ball 0 1) ∧ f 0 = 0 ∧ g 0 = 0 ∧ + (∀ z ∈ invertedExterior K a, deriv f z ≠ 0) ∧ + (∀ w ∈ ball 0 1, deriv g w ≠ 0) := by + obtain ⟨f, g, hf, hg, hfb, hgb, hinv, hf0, hfd, hgd⟩ := + riemann_biholomorphic_bounded (isOpen_invertedExterior hK a) + (isBounded_invertedExterior ha) + (isSimplyConnected_invertedExterior hconv (interior_subset ha)) + (zero_mem_invertedExterior K a) + have hg0 : g 0 = 0 := by + simpa only [hf0] using hinv.1 (zero_mem_invertedExterior K a) + exact ⟨f, g, hf, hg, hfb, hgb, hinv, hf0, hg0, hfd, hgd⟩ + +theorem riemann_exterior {K : Set ℂ} (hK : IsCompact K) (hconv : Convex ℝ K) + {a : ℂ} (ha : a ∈ interior K) : + ∃ G Φ : ℂ → ℂ, + DifferentiableOn ℂ G {t | 1 < ‖t‖} ∧ DifferentiableOn ℂ Φ Kᶜ ∧ + BijOn G {t | 1 < ‖t‖} Kᶜ ∧ BijOn Φ Kᶜ {t | 1 < ‖t‖} ∧ + InvOn Φ G {t | 1 < ‖t‖} Kᶜ ∧ + (∀ t, 1 < ‖t‖ → deriv G t ≠ 0) ∧ (∀ z ∈ Kᶜ, deriv Φ z ≠ 0) := by + obtain ⟨f, g, hf, hg, hfb, hgb, hinv, hf0, hg0, _, _⟩ := + riemann_invertedExterior hK hconv ha + let G : ℂ → ℂ := fun t => a + (g t⁻¹)⁻¹ + let Φ : ℂ → ℂ := fun z => (f (z - a)⁻¹)⁻¹ + have ht0 : ∀ t : ℂ, 1 < ‖t‖ → t ≠ 0 := fun t ht => + norm_pos_iff.mp (zero_lt_one.trans ht) + have htinv : ∀ t : ℂ, 1 < ‖t‖ → t⁻¹ ∈ ball 0 1 := fun t ht => + mem_ball_zero_iff.mpr (by rw [norm_inv]; exact (inv_lt_one₀ (zero_lt_one.trans ht)).mpr ht) + have hgn : ∀ t, 1 < ‖t‖ → g t⁻¹ ≠ 0 := by + intro t ht he + have hi := hgb.injOn (htinv t ht) (mem_ball_self zero_lt_one) (he.trans hg0.symm) + exact inv_ne_zero (ht0 t ht) hi + have hGmap : MapsTo G {t | 1 < ‖t‖} Kᶜ := by + intro t ht + exact (hgb.mapsTo (htinv t ht)).resolve_left (hgn t ht) + have hza : ∀ z ∈ Kᶜ, z - a ≠ 0 := by + intro z hz he + exact hz (sub_eq_zero.mp he ▸ interior_subset ha) + have hzinv : ∀ z ∈ Kᶜ, (z - a)⁻¹ ∈ invertedExterior K a := by + intro z hz + apply Or.inr + simpa only [inv_inv, add_sub_cancel, mem_compl_iff] using hz + have hfn : ∀ z ∈ Kᶜ, f (z - a)⁻¹ ≠ 0 := by + intro z hz he + have hi := hfb.injOn (hzinv z hz) (zero_mem_invertedExterior K a) (he.trans hf0.symm) + exact inv_ne_zero (hza z hz) hi + have hΦmap : MapsTo Φ Kᶜ {t | 1 < ‖t‖} := by + intro z hz + change 1 < ‖(f (z - a)⁻¹)⁻¹‖ + rw [norm_inv, one_lt_inv₀ (norm_pos_iff.mpr (hfn z hz))] + exact mem_ball_zero_iff.mp (hfb.mapsTo (hzinv z hz)) + have hInv : InvOn Φ G {t | 1 < ‖t‖} Kᶜ := by + constructor + · intro t ht + simp only [Φ, G, add_sub_cancel_left, inv_inv, hinv.2 (htinv t ht)] + · intro z hz + simp only [Φ, G, inv_inv, hinv.1 (hzinv z hz), add_sub_cancel] + have hGbij : BijOn G {t | 1 < ‖t‖} Kᶜ := by + refine ⟨hGmap, ?_, ?_⟩ + · intro t ht s hs he + simpa only [hInv.1 ht, hInv.1 hs] using congrArg Φ he + · intro z hz + exact ⟨Φ z, hΦmap hz, hInv.2 hz⟩ + have hΦbij := hGbij.symm hInv.symm + have hGo : IsOpen {t : ℂ | 1 < ‖t‖} := isOpen_lt continuous_const continuous_norm + have hGhol : DifferentiableOn ℂ G {t | 1 < ‖t‖} := by + intro t ht + have hd := ((hg _ (htinv t ht)).differentiableAt (isOpen_ball.mem_nhds (htinv t ht))).comp t + (differentiableAt_inv (ht0 t ht)) + exact ((hd.inv (hgn t ht)).const_add a).differentiableWithinAt + have hΦhol : DifferentiableOn ℂ Φ Kᶜ := by + intro z hz + have hd := ((hf _ (hzinv z hz)).differentiableAt + ((isOpen_invertedExterior hK a).mem_nhds (hzinv z hz))).comp z + ((differentiableAt_id.sub_const a).inv (hza z hz)) + exact (hd.inv (hfn z hz)).differentiableWithinAt + exact ⟨G, Φ, hGhol, hΦhol, hGbij, hΦbij, hInv, + fun t ht => deriv_ne_zero_of_injOn hGo hGhol hGbij.injOn ht, + fun z hz => deriv_ne_zero_of_injOn hK.isClosed.isOpen_compl hΦhol hΦbij.injOn hz⟩ + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Faber.lean b/lean/OAI/Analysis/Crouzeix/Faber.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b4278a3f38442330c9a328e3856b4424b54c86e --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Faber.lean @@ -0,0 +1,235 @@ +import Mathlib +import OAI.Analysis.Crouzeix.AngularRadius +import OAI.Analysis.Crouzeix.ExteriorContour + +namespace OAI + +/-! Faber. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +open Boundary + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +lemma twice_coordinate_mem (t : CircleSpace) : C.radius < ‖2 * circleCoordinate t‖ := by + rw [norm_mul, norm_circleCoordinate, mul_one, norm_ofNat] + exact C.radius_lt_one.trans (by norm_num) + +def outerMap : C(CircleSpace, ℂ) := + ⟨fun t => C.G (2 * circleCoordinate t), + C.analytic.continuousOn.comp_continuous + (continuous_const.mul circleCoordinate.continuous) C.twice_coordinate_mem⟩ + +def outerDomain : Set ℂ := (range C.outerMap)ᶜ + +lemma isOpen_outerDomain : IsOpen C.outerDomain := + (isCompact_range C.outerMap.continuous).isClosed.isOpen_compl + +lemma closure_subset_outerDomain : closure U ⊆ C.outerDomain := by + rintro z hz ⟨t, rfl⟩ + exact C.outside.mapsTo (by + change 1 < ‖2 * circleCoordinate t‖ + rw [norm_mul, norm_ofNat, norm_circleCoordinate, mul_one] + norm_num) hz + +lemma outer_difference_ne_zero {z : ℂ} (hz : z ∈ C.outerDomain) (t : CircleSpace) : + C.G (2 * circleCoordinate t) - z ≠ 0 := by + intro he + exact hz ⟨t, sub_eq_zero.mp he⟩ + +def physicalCoefficient (j : ℤ) (z : ℂ) : ℂ := + ∫ t, (2 * circleCoordinate t)^j * + ((2 * circleCoordinate t * deriv C.G (2 * circleCoordinate t)) / + (C.G (2 * circleCoordinate t) - z)) ∂circleMeasure + +lemma differentiableOn_physicalCoefficient (j : ℤ) : + DifferentiableOn ℂ (C.physicalCoefficient j) C.outerDomain := by + have hq : Continuous (fun t : CircleSpace => + 2 * circleCoordinate t * deriv C.G (2 * circleCoordinate t)) := + (continuous_const.mul circleCoordinate.continuous).mul + (C.analytic.deriv.continuousOn.comp_continuous + (continuous_const.mul circleCoordinate.continuous) C.twice_coordinate_mem) + apply differentiableOn_parameter_circleIntegral C.isOpen_outerDomain + · exact ((continuous_const.mul (circleCoordinate.continuous.comp continuous_snd)).continuousOn.zpow₀ j + (fun p _ => Or.inl (mul_ne_zero (by norm_num) (circleCoordinate_ne_zero p.2)))).mul + ((hq.comp continuous_snd).continuousOn.div + ((C.outerMap.continuous.comp continuous_snd).sub continuous_fst).continuousOn + (fun p hp => C.outer_difference_ne_zero hp.1 p.2)) + · intro t + exact (differentiableOn_const _).mul + ((differentiableOn_const _).div ((differentiableOn_const _).sub differentiableOn_id) + (fun z hz => C.outer_difference_ne_zero hz t)) + +lemma physicalCoefficient_inside (hU : IsOpen U) (j : ℤ) {z : ℂ} (hz : z ∈ U) : + C.physicalCoefficient j z = + ∫ t, (circleCoordinate t)^j * (C.boundaryNormal t / + (C.boundaryMap t - z)) ∂circleMeasure := by + have hsub : closedBall (0 : ℂ) 2 \ ball 0 1 ⊆ {t | C.radius < ‖t‖} := by + intro t ht + exact C.radius_lt_one.trans_le (not_lt.mp (mt mem_ball_zero_iff.mpr ht.2)) + have hn : ∀ t ∈ closedBall (0 : ℂ) 2 \ ball 0 1, C.G t - z ≠ 0 := by + intro t ht + exact sub_ne_zero.mpr (fun he => C.exterior_value_not_mem hU + (not_lt.mp (mt mem_ball_zero_iff.mpr ht.2)) (he ▸ hz)) + have hs : ball (0 : ℂ) 2 \ closedBall 0 1 ⊆ closedBall (0 : ℂ) 2 \ ball 0 1 := + fun t ht => ⟨ball_subset_closedBall ht.1, fun he => ht.2 (ball_subset_closedBall he)⟩ + have he := integral_laurent_deform (f := fun t => t * deriv C.G t / (C.G t - z)) + (by norm_num : (0 : ℝ) < 1) (by norm_num : (1 : ℝ) ≤ 2) + ((continuousOn_id.mul (C.analytic.deriv.continuousOn.mono hsub)).div + ((C.analytic.continuousOn.mono hsub).sub continuousOn_const) hn) + ((differentiableOn_id.mul (C.analytic.deriv.differentiableOn.mono (hs.trans hsub))).div + ((C.analytic.differentiableOn.mono (hs.trans hsub)).sub_const z) + (fun t ht => hn t (hs ht))) j + simpa only [ofReal_ofNat, ofReal_one, one_mul, smul_eq_mul, physicalCoefficient, + boundaryNormal, boundaryMap, ContinuousMap.coe_mk] using he + +lemma physicalCoefficient_inside_neg (hU : IsOpen U) {z : ℂ} (hz : z ∈ U) + {n : ℕ} (hn : n ≠ 0) : C.physicalCoefficient (-(n : ℤ)) z = 0 := by + rw [C.physicalCoefficient_inside hU _ hz] + simp_rw [← C.reciprocalCauchy_boundary hU hz, zpow_neg, zpow_natCast, ← inv_pow] + rw [integral_holomorphic_inverse_circleCoordinate (f := fun u => u^n * C.reciprocalCauchy z u) + ((differentiableOn_id.pow n).mul (C.differentiableOn_reciprocalCauchy hU hz))] + simp [zero_pow hn] + +lemma physicalCoefficient_inside_zero (hU : IsOpen U) {z : ℂ} (hz : z ∈ U) : + C.physicalCoefficient 0 z = 1 := by + rw [C.physicalCoefficient_inside hU _ hz] + simp_rw [zpow_zero, one_mul, ← C.reciprocalCauchy_boundary hU hz] + rw [integral_holomorphic_inverse_circleCoordinate (C.differentiableOn_reciprocalCauchy hU hz)] + simp [reciprocalCauchy, reciprocalDenominator, C.leading_ne_zero] + +def correctionMoment (j : ℕ) (v : ℂ) : ℂ := + ∫ t, (circleCoordinate t)^j * C.correction (circleCoordinate t)⁻¹ v ∂circleMeasure + +lemma continuousOn_correctionMoment_integrand (j : ℕ) : + ContinuousOn (Function.uncurry (fun v (t : CircleSpace) => + (circleCoordinate t)^j * C.correction (circleCoordinate t)⁻¹ v)) + (C.reciprocalDisk ×ˢ univ) := by + apply ContinuousOn.mul + · exact ((circleCoordinate.continuous.comp continuous_snd).pow j).continuousOn + · have hc : Continuous (fun p : ℂ × CircleSpace => ((circleCoordinate p.2)⁻¹,p.1)) := + ((circleCoordinate.continuous.comp continuous_snd).inv₀ + (fun p => circleCoordinate_ne_zero p.2)).prodMk continuous_fst + have hi : MapsTo (fun p : ℂ × CircleSpace => ((circleCoordinate p.2)⁻¹,p.1)) + (C.reciprocalDisk ×ˢ univ) (C.reciprocalDisk ×ˢ C.reciprocalDisk) := + fun p hp => ⟨C.circle_inverse_mem p.2, hp.1⟩ + exact C.continuousOn_correction.comp + (f := fun p : ℂ × CircleSpace => ((circleCoordinate p.2)⁻¹,p.1)) hc.continuousOn hi + +lemma differentiableOn_correctionMoment_integrand (j : ℕ) (t : CircleSpace) : + DifferentiableOn ℂ (fun v => + (circleCoordinate t)^j * C.correction (circleCoordinate t)⁻¹ v) C.reciprocalDisk := by + exact (C.differentiableOn_correction_right (C.circle_inverse_mem t)).const_mul _ + +lemma differentiableOn_correctionMoment (j : ℕ) : + DifferentiableOn ℂ (C.correctionMoment j) C.reciprocalDisk := by + unfold correctionMoment + apply differentiableOn_parameter_circleIntegral (E := ℂ) isOpen_ball + · exact C.continuousOn_correctionMoment_integrand j + · exact C.differentiableOn_correctionMoment_integrand j + +@[simp] lemma correctionMoment_zero (j : ℕ) : C.correctionMoment j 0 = 0 := by + simp [correctionMoment] + +lemma correctionMoment_zero_index (v : ℂ) (hv : v ∈ C.reciprocalDisk) : + C.correctionMoment 0 v = 0 := by + simp only [correctionMoment, pow_zero, one_mul] + rw [integral_holomorphic_inverse_circleCoordinate + ((C.differentiableOn_correction_left hv).mono C.closed_unit_subset_reciprocalDisk)] + exact C.correction_zero_left v + +lemma physicalCoefficient_closed_neg (hU : IsOpen U) {z : ℂ} (hz : z ∈ closure U) + {n : ℕ} (hn : n ≠ 0) : C.physicalCoefficient (-(n : ℤ)) z = 0 := by + exact (Set.EqOn.of_subset_closure + (fun _ hy => C.physicalCoefficient_inside_neg hU hy hn) + ((C.differentiableOn_physicalCoefficient _).continuousOn.mono C.closure_subset_outerDomain) + continuousOn_const subset_closure (Subset.refl _)) hz + +lemma physicalCoefficient_closed_zero (hU : IsOpen U) {z : ℂ} (hz : z ∈ closure U) : + C.physicalCoefficient 0 z = 1 := by + exact (Set.EqOn.of_subset_closure + (fun _ hy => C.physicalCoefficient_inside_zero hU hy) + ((C.differentiableOn_physicalCoefficient _).continuousOn.mono C.closure_subset_outerDomain) + continuousOn_const subset_closure (Subset.refl _)) hz + +lemma correctionMoment_outer (j : ℕ) {v : ℂ} (hv : v ∈ C.reciprocalDisk) : + (∫ t, (2 * circleCoordinate t)^j * + C.correction (2 * circleCoordinate t)⁻¹ v ∂circleMeasure) = C.correctionMoment j v := by + have hs : closedBall (0 : ℂ) 2 \ ball 0 1 ⊆ {t | C.radius < ‖t‖} := by + intro t ht + exact C.radius_lt_one.trans_le (not_lt.mp (mt mem_ball_zero_iff.mpr ht.2)) + have hn : ∀ t ∈ closedBall (0 : ℂ) 2 \ ball 0 1, t ≠ 0 := fun t ht => + norm_pos_iff.mp (C.radius_pos.trans (hs ht)) + have hi : MapsTo (fun t : ℂ => t⁻¹) (closedBall 0 2 \ ball 0 1) C.reciprocalDisk := + fun t ht => C.inverse_mem_reciprocalDisk (hs ht) + have hd : DifferentiableOn ℂ (fun t : ℂ => C.correction t⁻¹ v) (closedBall 0 2 \ ball 0 1) := + (C.differentiableOn_correction_left hv).comp (differentiableOn_id.inv hn) hi + have he := integral_laurent_deform (by norm_num : (0 : ℝ) < 1) + (by norm_num : (1 : ℝ) ≤ 2) hd.continuousOn + (hd.mono (fun t ht => ⟨ball_subset_closedBall ht.1, fun he => ht.2 (ball_subset_closedBall he)⟩)) (j : ℤ) + simpa only [smul_eq_mul, ofReal_ofNat, ofReal_one, one_mul, zpow_natCast, correctionMoment] using he + +lemma circle_model_moment (j : ℕ) {w : ℂ} (hw : ‖w‖ < 2) : + (∫ t, (2 * circleCoordinate t)^j * + (2 * circleCoordinate t / (2 * circleCoordinate t - w)) ∂circleMeasure) = w^j := by + have hc := Complex.two_pi_I_inv_smul_circleIntegral_sub_inv_smul_of_differentiable_on_off_countable + (f := fun z : ℂ => z^j) countable_empty (mem_ball_zero_iff.mpr hw) + (continuous_id.pow j).continuousOn + (fun z _ => (differentiableAt_id.pow j)) + have he := integral_scaled_coordinate_cauchy (fun z : ℂ => (z-w)⁻¹ • z^j) + (by norm_num : (0 : ℝ) < 2) + rw [hc] at he + convert he using 1 + apply integral_congr_ae + filter_upwards [] with t + simp only [ofReal_ofNat, smul_eq_mul, div_eq_mul_inv] + ring + +lemma physicalCoefficient_boundary (j : ℕ) {w : ℂ} (hw : ‖w‖ = 1) : + C.physicalCoefficient (j : ℤ) (C.G w) = w^j + C.correctionMoment j w⁻¹ := by + have hwC : C.radius < ‖w‖ := hw.symm ▸ C.radius_lt_one + have hdiff (t : CircleSpace) : 2 * circleCoordinate t ≠ w := by + intro he + have hnorm := congrArg norm he + rw [norm_mul, norm_ofNat, norm_circleCoordinate, mul_one, hw] at hnorm + norm_num at hnorm + have hsplit (t : CircleSpace) : + (2 * circleCoordinate t)^j * + ((2 * circleCoordinate t * deriv C.G (2 * circleCoordinate t)) / + (C.G (2 * circleCoordinate t) - C.G w)) = + (2 * circleCoordinate t)^j * (2 * circleCoordinate t / (2 * circleCoordinate t - w)) + + (2 * circleCoordinate t)^j * C.correction (2 * circleCoordinate t)⁻¹ w⁻¹ := by + rw [C.correction_eq (C.twice_coordinate_mem t) hwC (hdiff t)] + ring + have hc1 : Continuous (fun t : CircleSpace => + (2 * circleCoordinate t)^j * (2 * circleCoordinate t / (2 * circleCoordinate t - w))) := + ((continuous_const.mul circleCoordinate.continuous).pow j).mul + ((continuous_const.mul circleCoordinate.continuous).div + ((continuous_const.mul circleCoordinate.continuous).sub continuous_const) + (fun t => sub_ne_zero.mpr (hdiff t))) + have hc2 : Continuous (fun t : CircleSpace => + (2 * circleCoordinate t)^j * C.correction (2 * circleCoordinate t)⁻¹ w⁻¹) := + ((continuous_const.mul circleCoordinate.continuous).pow j).mul + (C.continuousOn_correction.comp_continuous + (((continuous_const.mul circleCoordinate.continuous).inv₀ + (fun t => mul_ne_zero (by norm_num) (circleCoordinate_ne_zero t))).prodMk continuous_const) + (fun t => ⟨C.inverse_mem_reciprocalDisk (C.twice_coordinate_mem t), C.inverse_mem_reciprocalDisk hwC⟩)) + simp only [physicalCoefficient, zpow_natCast, hsplit] + rw [integral_add (hc1.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)) + (hc2.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)), + circle_model_moment j (by rw [hw]; norm_num), C.correctionMoment_outer j (C.inverse_mem_reciprocalDisk hwC)] + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/FiniteCompression.lean b/lean/OAI/Analysis/Crouzeix/FiniteCompression.lean new file mode 100644 index 0000000000000000000000000000000000000000..df50b6b7a00bcfb3dcf5e0501eca22e957959ba6 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/FiniteCompression.lean @@ -0,0 +1,173 @@ +import Mathlib +import OAI.Analysis.Crouzeix.NumericalRange + +namespace OAI + +/-! Exact polynomial compression on spans of finitely many operator iterates. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +def compression (A : Operator H) (E : Submodule ℂ H) [E.HasOrthogonalProjection] : + Operator E := E.orthogonalProjectionOnto.comp (A.comp E.subtypeL) + +theorem compression_inner (A : Operator H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] (x : E) : + ⟪x, compression A E x⟫_ℂ = ⟪(x : H), A (x : H)⟫_ℂ := + Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left x (A x) + +theorem numericalRange_compression_subset (A : Operator H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] : numericalRange (compression A E) ⊆ numericalRange A := by + rintro z ⟨x, hx, hz⟩ + exact ⟨(x : H), hx, (compression_inner A E x).symm.trans hz⟩ + +theorem coe_compression_apply (A : Operator H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] (x : E) (hx : A (x : H) ∈ E) : + (compression A E x : H) = A (x : H) := by + have hh := Submodule.orthogonalProjectionOnto_mem_subspace_eq_self (⟨A x, hx⟩ : E) + exact congrArg (fun v : E => (v : H)) hh + +theorem coe_compression_pow (A : Operator H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] (x : E) (k : ℕ) + (hx : ∀ j : ℕ, j ≤ k → (A ^ j) (x : H) ∈ E) : + (((compression A E) ^ k) x : H) = (A ^ k) (x : H) := by + induction k with + | zero => simp + | succ k ih => + have hk := ih (fun j hj => hx j (hj.trans (Nat.le_succ k))) + have hmem : A (((compression A E) ^ k) x : H) ∈ E := by + rw [hk] + simpa only [pow_succ', mul_apply_eq_comp] using hx (k + 1) le_rfl + simpa only [pow_succ', mul_apply_eq_comp] using + (coe_compression_apply A E (((compression A E) ^ k) x) hmem).trans (congrArg A hk) + +def iterateSpan (A : Operator H) (d : ℕ) {l : ℕ} (ξ : Fin l → H) : Submodule ℂ H := + Submodule.span ℂ (Set.range (fun p : Fin (d + 1) × Fin l => (A ^ (p.1 : ℕ)) (ξ p.2))) + +instance iterateSpanFiniteDimensional (A : Operator H) (d : ℕ) {l : ℕ} (ξ : Fin l → H) : + FiniteDimensional ℂ (iterateSpan A d ξ) := + FiniteDimensional.span_of_finite ℂ (Set.finite_range _) + +theorem iterate_mem_iterateSpan (A : Operator H) (d : ℕ) {l : ℕ} (ξ : Fin l → H) + (j : Fin l) (k : ℕ) (hk : k ≤ d) : (A ^ k) (ξ j) ∈ iterateSpan A d ξ := by + apply Submodule.subset_span + exact ⟨(⟨k, Nat.lt_succ_of_le hk⟩, j), rfl⟩ + +theorem mem_iterateSpan (A : Operator H) (d : ℕ) {l : ℕ} (ξ : Fin l → H) + (j : Fin l) : ξ j ∈ iterateSpan A d ξ := by + simpa using iterate_mem_iterateSpan A d ξ j 0 (Nat.zero_le _) + +def amplificationInclusion (E : Submodule ℂ H) (m : ℕ) : + Amplification E m →L[ℂ] Amplification H m := + (TensorProduct.mapL E.subtypeL (ContinuousLinearMap.id ℂ (EuclideanSpace ℂ (Fin m)))).completion + +theorem norm_amplificationInclusion (E : Submodule ℂ H) (m : ℕ) + (x : Amplification E m) : ‖amplificationInclusion E m x‖ = ‖x‖ := by + refine UniformSpace.Completion.induction_on x + (isClosed_eq (amplificationInclusion E m).continuous.norm continuous_norm) ?_ + intro a + simp only [amplificationInclusion, ContinuousLinearMap.completion_apply_coe, + UniformSpace.Completion.norm_coe] + rw [TensorProduct.mapL_apply] + change ‖TensorProduct.map E.subtypeₗᵢ.toLinearMap + (LinearIsometry.id : EuclideanSpace ℂ (Fin m) →ₗᵢ[ℂ] EuclideanSpace ℂ (Fin m)).toLinearMap a‖ = ‖a‖ + exact (TensorProduct.mapIsometry E.subtypeₗᵢ (LinearIsometry.id : + EuclideanSpace ℂ (Fin m) →ₗᵢ[ℂ] EuclideanSpace ℂ (Fin m))).norm_map a + +@[simp] +theorem amplificationInclusion_tmul (E : Submodule ℂ H) {m : ℕ} + (x : E) (y : EuclideanSpace ℂ (Fin m)) : + amplificationInclusion E m (↑(x ⊗ₜ[ℂ] y)) = + (↑((x : H) ⊗ₜ[ℂ] y) : Amplification H m) := by + simp [amplificationInclusion, ContinuousLinearMap.completion_apply_coe] + +theorem polynomialEval_tmul (A : Operator H) {m d : ℕ} (B : Fin (d + 1) → Coeff m) + (x : H) (y : EuclideanSpace ℂ (Fin m)) : + polynomialEval A B (↑(x ⊗ₜ[ℂ] y)) = + ∑ k : Fin (d + 1), (↑(((A ^ (k : ℕ)) x) ⊗ₜ[ℂ] + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin m) (B k) y)) : Amplification H m) := by + simp only [polynomialEval, sum_apply, tensorOperator, + ContinuousLinearMap.completion_apply_coe, TensorProduct.mapL_tmul] + +theorem polynomial_compression_tmul (A : Operator H) (E : Submodule ℂ H) + [E.HasOrthogonalProjection] {m d : ℕ} (B : Fin (d + 1) → Coeff m) + (x : E) (y : EuclideanSpace ℂ (Fin m)) + (hx : ∀ j : ℕ, j ≤ d → (A ^ j) (x : H) ∈ E) : + polynomialEval A B (amplificationInclusion E m (↑(x ⊗ₜ[ℂ] y))) = + amplificationInclusion E m (polynomialEval (compression A E) B (↑(x ⊗ₜ[ℂ] y))) := by + simp only [amplificationInclusion_tmul, polynomialEval_tmul, map_sum] + apply Finset.sum_congr rfl + intro k _ + rw [coe_compression_pow A E x k (fun j hj => hx j (hj.trans (Nat.le_of_lt_succ k.isLt)))] + +theorem completion_coe_finsetSum {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 polynomial_bound_of_finite_compressions (A : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) {C : ℝ} (hC : 0 ≤ C) + (hfin : ∀ (E : Submodule ℂ H) [FiniteDimensional ℂ E], + ‖polynomialEval (compression A E) B‖ ≤ C) : + ‖polynomialEval A B‖ ≤ C := by + apply (polynomialEval A B).opNorm_le_bound hC + intro x + refine UniformSpace.Completion.induction_on x + (isClosed_le (polynomialEval A B).continuous.norm (continuous_const.mul continuous_norm)) ?_ + intro a + obtain ⟨l, ξ, η, ha⟩ := TensorProduct.exists_sum_tmul_eq a + let E := iterateSpan A d ξ + let xE (j : Fin l) : E := ⟨ξ j, mem_iterateSpan A d ξ j⟩ + let v : Amplification E m := ∑ j : Fin l, (↑(xE j ⊗ₜ[ℂ] η j) : Amplification E m) + have hav : (↑a : Amplification H m) = amplificationInclusion E m v := by + rw [ha, completion_coe_finsetSum] + simp only [v, map_sum, amplificationInclusion_tmul] + rfl + have hinter : polynomialEval A B (amplificationInclusion E m v) = + amplificationInclusion E m (polynomialEval (compression A E) B v) := by + simp only [v, map_sum] + apply Finset.sum_congr rfl + intro j _ + apply polynomial_compression_tmul + intro k hk + exact iterate_mem_iterateSpan A d ξ j k hk + calc + ‖polynomialEval A B (↑a)‖ = + ‖amplificationInclusion E m (polynomialEval (compression A E) B v)‖ := by + rw [hav, hinter] + _ = ‖polynomialEval (compression A E) B v‖ := norm_amplificationInclusion E m _ + _ ≤ ‖polynomialEval (compression A E) B‖ * ‖v‖ := + (polynomialEval (compression A E) B).le_opNorm v + _ ≤ C * ‖v‖ := mul_le_mul_of_nonneg_right (hfin E) (norm_nonneg _) + _ = C * ‖(↑a : Amplification H m)‖ := by rw [hav, norm_amplificationInclusion] + +theorem polynomial_inequality_of_finite_compressions (A : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) + (hfin : ∀ (E : Submodule ℂ H) [FiniteDimensional ℂ E], + ‖polynomialEval (compression A E) B‖ ≤ + 2 * supNorm (numericalRange (compression A E)) (matrixPolynomial B)) : + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B) := by + have hbK := supNorm_bddAbove (isCompact_numericalClosure A) + (continuous_matrixPolynomial B).continuousOn + have hbW : BddAbove (insert 0 ((fun z => ‖matrixPolynomial B z‖) '' numericalRange A)) := + hbK.mono (Set.insert_subset_insert (Set.image_mono subset_closure)) + apply polynomial_bound_of_finite_compressions A B + (mul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (supNorm_nonneg hbW)) + intro E _ + exact (hfin E).trans (mul_le_mul_of_nonneg_left + (supNorm_mono (numericalRange_compression_subset A E) hbW) (by norm_num)) + +end CrouzeixHilbert +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Fourier.lean b/lean/OAI/Analysis/Crouzeix/Fourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..179b8771dedc41c07e3c429d5f613e2b5289be91 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Fourier.lean @@ -0,0 +1,442 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryForms + +namespace OAI + +/-! Fourier. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace lp Classical Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert.Boundary + +abbrev CircleSpace := AddCircle (1 : ℝ) + +local instance : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +abbrev circleMeasure : Measure CircleSpace := AddCircle.haarAddCircle + +abbrev BoundaryL2 (k : ℕ) := Lp (HS k) 2 circleMeasure + +def lpEntry {k : ℕ} (ij : Fin k × Fin k) : BoundaryL2 k →L[ℂ] Lp ℂ 2 circleMeasure := + (PiLp.proj 2 (fun _ : Fin k × Fin k => ℂ) ij).compLpL 2 circleMeasure + +lemma lpEntry_apply_ae {k : ℕ} (ij : Fin k × Fin k) (u : BoundaryL2 k) : + lpEntry ij u =ᵐ[circleMeasure] fun t => u t ij := + ContinuousLinearMap.coeFn_compLpL _ _ + +def matrixFourier {k : ℕ} (a : ℤ × (Fin k × Fin k)) : BoundaryL2 k := + ContinuousMap.toLp 2 circleMeasure ℂ + ⟨fun t => fourier a.1 t • EuclideanSpace.single a.2 (1 : ℂ), + by fun_prop⟩ + +lemma matrixFourier_apply_ae {k : ℕ} (a : ℤ × (Fin k × Fin k)) : + matrixFourier a =ᵐ[circleMeasure] + fun t => fourier a.1 t • EuclideanSpace.single a.2 (1 : ℂ) := + ContinuousMap.coeFn_toLp _ _ + +lemma inner_matrixFourier {k : ℕ} (a : ℤ × (Fin k × Fin k)) (u : BoundaryL2 k) : + ⟪matrixFourier a, u⟫_ℂ = ⟪fourierLp 2 a.1, lpEntry a.2 u⟫_ℂ := by + simp only [L2.inner_def] + apply integral_congr_ae + filter_upwards [matrixFourier_apply_ae a, lpEntry_apply_ae a.2 u, + coeFn_fourierLp 2 a.1] with t hm he hf + rw [hm, he, hf, inner_smul_left, EuclideanSpace.inner_single_left] + simp [RCLike.inner_apply, mul_comm] + +lemma lpEntry_matrixFourier {k : ℕ} (a : ℤ × (Fin k × Fin k)) (ij : Fin k × Fin k) : + lpEntry ij (matrixFourier a) = if ij = a.2 then fourierLp 2 a.1 else 0 := by + apply Lp.ext + filter_upwards [lpEntry_apply_ae ij (matrixFourier a), matrixFourier_apply_ae a, + coeFn_fourierLp 2 a.1, (Lp.coeFn_zero ℂ 2 circleMeasure)] with t he hm hf hz + rw [he, hm] + by_cases hij : ij = a.2 + · subst ij + simp only [PiLp.smul_apply, PiLp.single_apply, ite_true, smul_eq_mul, mul_one] + exact hf.symm + · simp only [ite_eq_right hij, PiLp.smul_apply, PiLp.single_apply, smul_eq_mul, mul_zero] + exact hz.symm + +lemma orthonormal_matrixFourier (k : ℕ) : + Orthonormal ℂ (@matrixFourier k) := by + rw [orthonormal_iff_ite] + intro a b + rw [inner_matrixFourier, lpEntry_matrixFourier] + by_cases hab : a.2 = b.2 + · rw [ite_eq_left hab, orthonormal_iff_ite.mp orthonormal_fourier] + simp [Prod.ext_iff, hab] + · rw [ite_eq_right hab, inner_zero_right, ite_eq_right] + exact fun h => hab (congrArg Prod.snd h) + +lemma lpEntry_ext {k : ℕ} {u v : BoundaryL2 k} + (h : ∀ ij, lpEntry ij u = lpEntry ij v) : u = v := by + apply Lp.ext + have he : ∀ᵐ t ∂circleMeasure, ∀ ij, u t ij = v t ij := by + rw [ae_all_iff] + intro ij + filter_upwards [lpEntry_apply_ae ij u, lpEntry_apply_ae ij v] with t hu hv + rw [← hu, ← hv, h ij] + exact he.mono fun t ht => by ext ij; exact ht ij + +lemma matrixFourier_orthogonal_eq_bot (k : ℕ) : + (Submodule.span ℂ (Set.range (@matrixFourier k)))ᗮ = ⊥ := by + apply le_antisymm _ bot_le + intro u hu + change u = 0 + apply lpEntry_ext + intro ij + rw [map_zero] + apply fourierBasis.repr.injective + ext n + rw [map_zero] + change _ = 0 + rw [fourierBasis.repr_apply_apply, coe_fourierBasis] + rw [← inner_matrixFourier (n,ij)] + exact (Submodule.mem_orthogonal _ _).mp hu _ (Submodule.subset_span ⟨(n,ij), rfl⟩) + +def matrixFourierBasis (k : ℕ) : + HilbertBasis (ℤ × (Fin k × Fin k)) ℂ (BoundaryL2 k) := + HilbertBasis.mkOfOrthogonalEqBot (orthonormal_matrixFourier k) (matrixFourier_orthogonal_eq_bot k) + +@[simp] lemma matrixFourierBasis_apply {k : ℕ} (a : ℤ × (Fin k × Fin k)) : + matrixFourierBasis k a = matrixFourier a := by + rw [matrixFourierBasis, HilbertBasis.coe_mkOfOrthogonalEqBot] + +lemma matrixFourierBasis_repr {k : ℕ} (u : BoundaryL2 k) (a : ℤ × (Fin k × Fin k)) : + (matrixFourierBasis k).repr u a = fourierCoeff (lpEntry a.2 u) a.1 := by + rw [HilbertBasis.repr_apply_apply, matrixFourierBasis_apply, inner_matrixFourier, + ← coe_fourierBasis, ← HilbertBasis.repr_apply_apply, fourierBasis_repr] + +def l2Mask {ι : Type*} (S : ι → Prop) : ℓ²(ι, ℂ) →L[ℂ] ℓ²(ι, ℂ) := by + classical + let M : ℓ²(ι, ℂ) →ₗ[ℂ] ℓ²(ι, ℂ) := { + toFun u := ⟨fun i => if S i then u i else 0, + (lp.memℓp u).mono' fun i => by split_ifs <;> simp⟩ + map_add' u v := by + ext i + change (if S i then u i + v i else 0) = + (if S i then u i else 0) + (if S i then v i else 0) + by_cases hi : S i <;> simp [hi] + map_smul' c u := by ext i; by_cases hi : S i <;> simp [hi] } + apply M.mkContinuous 1 + intro u + rw [one_mul] + apply lp.norm_mono (by norm_num : (2 : ENNReal) ≠ 0) + intro i + change ‖if S i then u i else 0‖ ≤ ‖u i‖ + split_ifs <;> simp + +@[simp] lemma l2Mask_apply {ι : Type*} (S : ι → Prop) (u : ℓ²(ι, ℂ)) (i : ι) : + l2Mask S u i = if S i then u i else 0 := by classical exact rfl + +lemma l2Mask_self_adjoint {ι : Type*} (S : ι → Prop) : + ContinuousLinearMap.adjoint (l2Mask S) = l2Mask S := by + classical + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + simp only [lp.inner_eq_tsum] + apply tsum_congr + intro i + by_cases hi : S i <;> simp [hi] + +def frequencyPart (i : Fin 3) (n : ℤ) : Prop := + if i = 0 then n = 0 else if i = 1 then 0 < n else n < 0 + +@[simp] lemma frequencyPart_zero (n : ℤ) : frequencyPart 0 n ↔ n = 0 := by + simp [frequencyPart] + +@[simp] lemma frequencyPart_pos (n : ℤ) : frequencyPart 1 n ↔ 0 < n := by + simp [frequencyPart] + +@[simp] lemma frequencyPart_neg (n : ℤ) : frequencyPart 2 n ↔ n < 0 := by + simp [frequencyPart] + +def fourierProjC (k : ℕ) (i : Fin 3) : BoundaryL2 k →L[ℂ] BoundaryL2 k := + ((matrixFourierBasis k).repr.symm.toContinuousLinearEquiv : + ℓ²(ℤ × (Fin k × Fin k), ℂ) →L[ℂ] BoundaryL2 k).comp + ((l2Mask (fun a => frequencyPart i a.1)).comp + (matrixFourierBasis k).repr.toContinuousLinearEquiv.toContinuousLinearMap) + +lemma repr_fourierProjC {k : ℕ} (i : Fin 3) (u : BoundaryL2 k) + (a : ℤ × (Fin k × Fin k)) : + (matrixFourierBasis k).repr (fourierProjC k i u) a = + if frequencyPart i a.1 then (matrixFourierBasis k).repr u a else 0 := by + classical + simp [fourierProjC] + +lemma fourierProjC_self_adjoint (k : ℕ) (i : Fin 3) : + ContinuousLinearMap.adjoint (fourierProjC k i) = fourierProjC k i := by + classical + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + rw [← (matrixFourierBasis k).repr.inner_map_map, lp.inner_eq_tsum] + rw [← (matrixFourierBasis k).repr.inner_map_map u, lp.inner_eq_tsum] + apply tsum_congr + intro a + rw [repr_fourierProjC, repr_fourierProjC] + by_cases ha : frequencyPart i a.1 <;> simp [ha] + +lemma fourierProjC_comp (k : ℕ) (i j : Fin 3) : + (fourierProjC k i).comp (fourierProjC k j) = + if i = j then fourierProjC k i else 0 := by + classical + apply ContinuousLinearMap.ext + intro u + apply (matrixFourierBasis k).repr.injective + ext a + dsimp only [ContinuousLinearMap.comp_apply] + rw [repr_fourierProjC, repr_fourierProjC] + by_cases hij : i = j + · subst j + rw [ite_eq_left rfl, repr_fourierProjC] + split_ifs <;> rfl + · rw [ite_eq_right hij] + simp only [zero_apply, map_zero, lp.coeFn_zero, Pi.zero_apply] + have hd : ¬ (frequencyPart i a.1 ∧ frequencyPart j a.1) := by + fin_cases i <;> fin_cases j <;> simp_all <;> omega + split_ifs <;> simp_all + +lemma fourierProjC_total (k : ℕ) : + fourierProjC k 0 + fourierProjC k 1 + fourierProjC k 2 = + ContinuousLinearMap.id ℂ (BoundaryL2 k) := by + classical + apply ContinuousLinearMap.ext + intro u + apply (matrixFourierBasis k).repr.injective + ext a + simp only [add_apply, map_add, lp.coeFn_add, Pi.add_apply, + ContinuousLinearMap.id_apply, repr_fourierProjC] + rcases lt_trichotomy a.1 0 with hn | hn | hn + · simp [hn, hn.ne, not_lt.mpr hn.le] + · simp [hn] + · simp [hn, hn.ne', not_lt.mpr hn.le] + +lemma boundary_real_inner {k : ℕ} (u v : BoundaryL2 k) : + ⟪u,v⟫_ℝ = (⟪u,v⟫_ℂ).re := by + simp only [L2.inner_def] + calc + _ = ∫ t, (⟪u t,v t⟫_ℂ).re ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [] with t + simp only [PiLp.inner_apply, Complex.re_sum] + rfl + _ = _ := integral_re (𝕜 := ℂ) (L2.integrable_inner (𝕜 := ℂ) u v) + +def fourierSplitting (k : ℕ) : ThreeWaySplitting (BoundaryL2 k) where + proj i := (fourierProjC k i).restrictScalars ℝ + self_adjoint i := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro u v + change ⟪fourierProjC k i u, v⟫_ℝ = ⟪u, fourierProjC k i v⟫_ℝ + rw [boundary_real_inner, boundary_real_inner] + have h := ContinuousLinearMap.adjoint_inner_left (fourierProjC k i) v u + rw [fourierProjC_self_adjoint] at h + exact congrArg Complex.re h + comp i j := by + apply ContinuousLinearMap.ext + intro u + have h := congrArg (fun L : BoundaryL2 k →L[ℂ] BoundaryL2 k => L u) + (fourierProjC_comp k i j) + split_ifs with hij <;> simpa [hij] using h + total := by + apply ContinuousLinearMap.ext + intro u + exact congrArg (fun L : BoundaryL2 k →L[ℂ] BoundaryL2 k => L u) (fourierProjC_total k) + +lemma repr_lpStar {k : ℕ} (u : BoundaryL2 k) (n : ℤ) (i j : Fin k) : + (matrixFourierBasis k).repr (lpStar u) (n,(i,j)) = + star ((matrixFourierBasis k).repr u (-n,(j,i))) := by + rw [matrixFourierBasis_repr, matrixFourierBasis_repr] + simp only [fourierCoeff, neg_neg, smul_eq_mul, Complex.star_def] + rw [← integral_conj] + apply integral_congr_ae + filter_upwards [lpEntry_apply_ae (i,j) (lpStar u), lpStar_apply_ae u, + lpEntry_apply_ae (j,i) u] with t he hs he' + simp only [he, hs, he', toHS, ofHS, + Matrix.conjTranspose_apply, Complex.star_def, map_mul, fourier_neg] + +lemma lpStar_fourierProj_zero {k : ℕ} (u : BoundaryL2 k) : + lpStar (fourierProjC k 0 u) = fourierProjC k 0 (lpStar u) := by + apply (matrixFourierBasis k).repr.injective + ext ⟨n,i,j⟩ + rw [repr_lpStar, repr_fourierProjC, repr_fourierProjC, repr_lpStar] + simp only [frequencyPart_zero, neg_eq_zero, apply_ite (star : ℂ → ℂ), star_zero] + +lemma lpStar_fourierProj_pos {k : ℕ} (u : BoundaryL2 k) : + lpStar (fourierProjC k 1 u) = fourierProjC k 2 (lpStar u) := by + apply (matrixFourierBasis k).repr.injective + ext ⟨n,i,j⟩ + rw [repr_lpStar, repr_fourierProjC, repr_fourierProjC, repr_lpStar] + simp only [frequencyPart_pos, frequencyPart_neg, neg_pos, + apply_ite (star : ℂ → ℂ), star_zero] + +def fourierInvolution (k : ℕ) : (fourierSplitting k).CompatibleInvolution where + op := lpStar + involutive := lpStar_lpStar + proj_zero := lpStar_fourierProj_zero + proj_pos := lpStar_fourierProj_pos + +def matrixMean {k : ℕ} (u : BoundaryL2 k) : Matrix (Fin k) (Fin k) ℂ := + fun i j => ∫ t, u t (i,j) ∂circleMeasure + +lemma repr_zero_eq_mean {k : ℕ} (u : BoundaryL2 k) (i j : Fin k) : + (matrixFourierBasis k).repr u (0,(i,j)) = matrixMean u i j := by + rw [matrixFourierBasis_repr] + simp only [fourierCoeff, neg_zero, fourier_zero, one_smul] + exact integral_congr_ae (lpEntry_apply_ae (i,j) u) + +lemma mean_eq_zero_iff {k : ℕ} (u : BoundaryL2 k) : + matrixMean u = 0 ↔ (fourierSplitting k).proj 0 u = 0 := by + constructor + · intro h + apply (matrixFourierBasis k).repr.injective + ext ⟨n,i,j⟩ + change (matrixFourierBasis k).repr (fourierProjC k 0 u) (n,(i,j)) = _ + rw [repr_fourierProjC, map_zero] + change (if frequencyPart 0 n then _ else 0) = 0 + by_cases hn : n = 0 + · subst n + simp only [frequencyPart_zero, ite_true, repr_zero_eq_mean, h, Matrix.zero_apply] + · simp only [frequencyPart_zero, ite_eq_right hn] + · intro h + ext i j + have hz := congrArg (fun v : BoundaryL2 k => (matrixFourierBasis k).repr v (0,(i,j))) h + change (matrixFourierBasis k).repr (fourierProjC k 0 u) (0,(i,j)) = _ at hz + simpa only [repr_fourierProjC, frequencyPart_zero, ite_true, repr_zero_eq_mean, + map_zero, lp.coeFn_zero, Pi.zero_apply, Matrix.zero_apply] using hz + +lemma norm_fourier_proj_le (k : ℕ) (i : Fin 3) : + ‖(fourierSplitting k).proj i‖ ≤ 1 := (fourierSplitting k).norm_proj_le i + +def upperTransfer {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + BoundaryL2 k →L[ℝ] BoundaryL2 k := + ((fourierSplitting k).proj 1).comp (ContinuousLinearMap.adjoint M) + +lemma upperTransfer_range {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + ((fourierSplitting k).proj 1).comp (upperTransfer M) = upperTransfer M := by + apply ContinuousLinearMap.ext + intro u + change (fourierSplitting k).proj 1 ((fourierSplitting k).proj 1 _) = _ + simp only [ThreeWaySplitting.proj_proj, ite_true] + rfl + +lemma norm_upperTransfer_le {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) + (hM : ‖M‖ ≤ 1) : ‖upperTransfer M‖ ≤ 1 := by + calc + _ ≤ ‖(fourierSplitting k).proj 1‖ * ‖ContinuousLinearMap.adjoint M‖ := + ContinuousLinearMap.opNorm_comp_le _ _ + _ ≤ 1 * 1 := mul_le_mul (norm_fourier_proj_le k 1) + (by simpa only [ContinuousLinearMap.adjoint.norm_map] using hM) + (norm_nonneg _) zero_le_one + _ = 1 := one_mul _ + +def boundaryCauchyAdjoint {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + BoundaryL2 k →L[ℝ] BoundaryL2 k := + (fourierSplitting k).cauchyAdjoint (upperTransfer M) + +def boundaryCauchy {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + BoundaryL2 k →L[ℝ] BoundaryL2 k := + (fourierSplitting k).proj 0 + (fourierSplitting k).proj 1 + + ((fourierSplitting k).proj 2).comp (M.comp ((fourierSplitting k).proj 1)) + +lemma adjoint_boundaryCauchy {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + ContinuousLinearMap.adjoint (boundaryCauchy M) = boundaryCauchyAdjoint M := by + simp only [boundaryCauchy, boundaryCauchyAdjoint, ThreeWaySplitting.cauchyAdjoint, + upperTransfer, map_add, ContinuousLinearMap.adjoint_comp, + ThreeWaySplitting.self_adjoint, ContinuousLinearMap.comp_assoc] + +lemma adjoint_boundaryCauchyAdjoint {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M) = boundaryCauchy M := by + rw [← adjoint_boundaryCauchy, ContinuousLinearMap.adjoint_adjoint] + +lemma boundaryCauchyAdjoint_idempotent {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + (boundaryCauchyAdjoint M).comp (boundaryCauchyAdjoint M) = boundaryCauchyAdjoint M := by + apply ContinuousLinearMap.ext + intro u + change (fourierSplitting k).cauchyAdjoint (upperTransfer M) + ((fourierSplitting k).cauchyAdjoint (upperTransfer M) u) = _ + rw [ThreeWaySplitting.cauchyAdjoint_apply, + ThreeWaySplitting.proj0_cauchyAdjoint (upperTransfer_range M), + ThreeWaySplitting.proj1_cauchyAdjoint (upperTransfer_range M), + ThreeWaySplitting.proj2_cauchyAdjoint (upperTransfer_range M), map_zero, add_zero] + simp only [boundaryCauchyAdjoint, ThreeWaySplitting.cauchyAdjoint_apply, add_assoc] + +lemma boundaryCauchy_idempotent {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) : + (boundaryCauchy M).comp (boundaryCauchy M) = boundaryCauchy M := by + apply ContinuousLinearMap.adjoint.injective + rw [ContinuousLinearMap.adjoint_comp, adjoint_boundaryCauchy, + boundaryCauchyAdjoint_idempotent] + +lemma boundaryCauchy_weighted_norm_sq {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) + (hM : ‖M‖ ≤ 1) (u : BoundaryL2 k) : + ‖boundaryCauchyAdjoint M u‖ ^ 2 + + ‖(fourierSplitting k).proj 0 (boundaryCauchyAdjoint M u)‖ ^ 2 ≤ 2 * ‖u‖ ^ 2 := + ThreeWaySplitting.weighted_norm_sq (upperTransfer_range M) (norm_upperTransfer_le M hM) u + +lemma boundaryCauchy_mean {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) (u : BoundaryL2 k) : + matrixMean (boundaryCauchy M u) = matrixMean u := by + have hp : (fourierSplitting k).proj 0 (boundaryCauchy M u) = + (fourierSplitting k).proj 0 u := by + simp only [boundaryCauchy, add_apply, ContinuousLinearMap.comp_apply, + map_add, ThreeWaySplitting.proj_proj, ite_true] + simp + ext i j + have he := congrArg (fun v : BoundaryL2 k => (matrixFourierBasis k).repr v (0,(i,j))) hp + change (matrixFourierBasis k).repr (fourierProjC k 0 _) (0,(i,j)) = + (matrixFourierBasis k).repr (fourierProjC k 0 _) (0,(i,j)) at he + simpa only [repr_fourierProjC, frequencyPart_zero, ite_true, repr_zero_eq_mean] using he + +lemma boundaryCauchyAdjoint_mean {k : ℕ} (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) + (u : BoundaryL2 k) : matrixMean (boundaryCauchyAdjoint M u) = matrixMean u := by + have hp := ThreeWaySplitting.proj0_cauchyAdjoint (upperTransfer_range M) u + change matrixMean ((fourierSplitting k).cauchyAdjoint (upperTransfer M) u) = matrixMean u + ext i j + have he := congrArg (fun v : BoundaryL2 k => (matrixFourierBasis k).repr v (0,(i,j))) hp + change (matrixFourierBasis k).repr (fourierProjC k 0 _) (0,(i,j)) = + (matrixFourierBasis k).repr (fourierProjC k 0 _) (0,(i,j)) at he + simpa only [repr_fourierProjC, frequencyPart_zero, ite_true, repr_zero_eq_mean] using he + +theorem fourier_ordered_comparison {k : ℕ} + (M : BoundaryL2 k →L[ℝ] BoundaryL2 k) (hM : ‖M‖ ≤ 1) + (F : CircleSpace → Matrix (Fin k) (Fin k) ℂ) + (hm : AEStronglyMeasurable F circleMeasure) + (hn : ∀ᵐ t ∂circleMeasure, ‖F t‖ ≤ 1) + (hleft : (ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M)).comp + ((lpLeft F hm hn).comp (ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M))) = + (lpLeft F hm hn).comp (ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M))) + (hright : (ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M)).comp + ((lpRight F hm hn).comp (ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M))) = + (lpRight F hm hn).comp (ContinuousLinearMap.adjoint (boundaryCauchyAdjoint M))) + (p q r : BoundaryL2 k) + (hpstar : ∀ᵐ t ∂circleMeasure, (ofHS (p t)).IsHermitian) + (hqstar : ∀ᵐ t ∂circleMeasure, (ofHS (q t)).IsHermitian) + (hp : ∀ᵐ t ∂circleMeasure, ofHS (p t) = (F t)ᴴ * ofHS (r t)) + (hq : ∀ᵐ t ∂circleMeasure, ofHS (q t) = ofHS (r t) * (F t)ᴴ) + (hrmean : matrixMean r = 0) (hpmean : 0 < (matrixMean p).trace.re) + (κ : ℝ) (hκ : 0 < κ) + (hblock : let D := boundaryCauchyAdjoint M + let pₑ := D p + lpStar (D (lpStar p)) + let qₑ := D q + lpStar (D (lpStar q)) + let rₑ := κ • D r + κ⁻¹ • lpStar (D (lpStar r)) + ∀ᵐ t ∂circleMeasure, (Matrix.fromBlocks (ofHS (pₑ t)) + (ofHS (rₑ t))ᴴ (ofHS (rₑ t)) (ofHS (qₑ t))).PosSemidef) : κ ≤ 2 := by + apply lp_ordered_comparison (fourierSplitting k) + lpStar_fourierProj_zero lpStar_fourierProj_pos (upperTransfer M) + (upperTransfer_range M) (norm_upperTransfer_le M hM) F hm hn + hleft hright p q r hpstar hqstar hp hq ((mean_eq_zero_iff r).mp hrmean) _ κ hκ hblock + intro h + have hz : matrixMean p = 0 := (mean_eq_zero_iff p).mpr h + simp only [hz, Matrix.trace_zero, Complex.zero_re] at hpmean + exact lt_irrefl 0 hpmean + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/FunctionalComposition.lean b/lean/OAI/Analysis/Crouzeix/FunctionalComposition.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bc52d1a93f8981876848419b4d4366c8c5db496 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/FunctionalComposition.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HolomorphicSpectrum + +namespace OAI + +/-! Functional Composition. -/ + +noncomputable section + +open Set Filter Metric Topology Complex MeasureTheory + +open scoped InnerProductSpace Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +lemma intertwines_aeval {B : Type*} [Ring B] [Algebra ℂ B] + (S T D : B) (h : S * T = D * S) (p : Polynomial ℂ) : + S * Polynomial.aeval T p = Polynomial.aeval D p * S := by + have hp (n : ℕ) : S * T^n = D^n * S := by + induction n with + | zero => simp + | succ n ih => rw [pow_succ, ← mul_assoc, ih, mul_assoc, h, ← mul_assoc, ← pow_succ] + induction p using Polynomial.induction_on' with + | add p q hq hr => simp only [map_add, mul_add, add_mul, hq, hr] + | monomial n c => + simp only [Polynomial.aeval_monomial] + rw [← mul_assoc, (Algebra.commutes c S).symm, mul_assoc, hp, ← mul_assoc] + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [Nontrivial H] + +lemma holomorphicEval_comp_intertwines (A D S : Operator H) (hN : ‖D‖ ≤ 1) + {U V : Set ℂ} (hU : IsOpen U) (hKU : numericalClosure A ⊆ U) + (hV : IsOpen V) (hKV : closedBall (0 : ℂ) 1 ⊆ V) + {f g : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hg : DifferentiableOn ℂ g V) + (hfU : MapsTo f U V) (hfK : MapsTo f (numericalClosure A) (closedBall 0 1)) + (hI : S * holomorphicEval A U f = D * S) : + S * holomorphicEval A U (g ∘ f) = holomorphicEval D V g * S := by + let K : Set ℂ := closedBall 0 1 + have hK : IsCompact K := isCompact_closedBall _ _ + have hKc : Convex ℝ K := convex_closedBall _ _ + have hDK : numericalClosure D ⊆ K := + (numericalClosure_subset_closedBall D).trans (closedBall_subset_closedBall hN) + obtain ⟨ε,hε,hεV⟩ := hK.exists_cthickening_subset_open hV hKV + let L := cthickening ε K + have hKL : K ⊆ interior L := + (self_subset_thickening hε _).trans (thickening_subset_interior_cthickening _ _) + let W := U ∩ f ⁻¹' interior L + have hW : IsOpen W := hf.continuousOn.isOpen_inter_preimage hU isOpen_interior + have hAW : numericalClosure A ⊆ W := fun z hz => ⟨hKU hz,hKL (hfK hz)⟩ + have hfW : DifferentiableOn ℂ f W := hf.mono inter_subset_left + have hAWL : MapsTo f W L := fun z hz => interior_subset hz.2 + have hWL : W ⊆ U := inter_subset_left + have hgf := hg.comp hf hfU + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hW hAW + obtain ⟨Δ₀⟩ := exists_calculusContour (isCompact_numericalClosure D) + (convex_numericalClosure D) (numericalClosure_nonempty D) isOpen_interior (hDK.trans hKL) + let Δ : CalculusContour (numericalClosure D) V := { + toSmoothContour := Δ₀.toSmoothContour + avoids := fun t ht => ⟨hεV (interior_subset (Δ₀.avoids t ht).1), (Δ₀.avoids t ht).2⟩ + index_inside := Δ₀.index_inside + index_outside := fun z hz => Δ₀.index_outside z (fun he => hz (hεV (interior_subset he))) } + have hΔL : Δ.toSmoothContour.trace ⊆ L := by + rintro z ⟨t,ht,rfl⟩ + exact interior_subset (Δ₀.avoids t ht).1 + have hΓW : Γ.toSmoothContour.trace ⊆ W := by + rintro z ⟨t,ht,rfl⟩ + exact (Γ.avoids t ht).1 + obtain ⟨p,hp⟩ := exists_polynomial_tendstoUniformlyOn hK.cthickening (hKc.cthickening ε) hV hεV hg + have hpd := tendsto_contourEval D Δ (fun n => (p n).continuous.continuousOn) (hp.mono hΔL) + simp_rw [contourEval_polynomial, ← holomorphicEval_eq_contourEval D hV hg Δ] at hpd + have hpa : Tendsto (fun n => Polynomial.aeval (holomorphicEval A U f) (p n)) atTop + (𝓝 (holomorphicEval A U (g ∘ f))) := by + have hp' : TendstoUniformlyOn (fun n z => (p n).eval (f z)) (g ∘ f) atTop Γ.toSmoothContour.trace := by + apply Metric.tendstoUniformlyOn_iff.mpr + intro δ hδ + filter_upwards [Metric.tendstoUniformlyOn_iff.mp hp δ hδ] with n hn z hz + exact hn (f z) (hAWL (hΓW hz)) + have hh := tendsto_contourEval A Γ + (fun n => (p n).continuous.comp_continuousOn (hf.continuousOn.mono (hΓW.trans hWL))) hp' + have he (n : ℕ) : contourEval A Γ.toSmoothContour (fun z => (p n).eval (f z)) = + Polynomial.aeval (holomorphicEval A U f) (p n) := by + calc + _ = holomorphicEval A W (fun z => (p n).eval (f z)) := + (holomorphicEval_eq_contourEval A hW ((p n).differentiable.comp_differentiableOn hfW) Γ).symm + _ = Polynomial.aeval (holomorphicEval A W f) (p n) := + holomorphicEval_polynomial_comp A hW hAW hfW (p n) + _ = _ := by rw [holomorphicEval_restrict A hW hU hAW hWL hf] + change Tendsto (fun n => contourEval A Γ.toSmoothContour (fun z => (p n).eval (f z))) atTop + (𝓝 (contourEval A Γ.toSmoothContour (g ∘ f))) at hh + simp_rw [he, ← holomorphicEval_eq_contourEval A hW (hgf.mono hWL) Γ, + holomorphicEval_restrict A hW hU hAW hWL hgf] at hh + exact hh + have hh := (tendsto_const_nhds (x := S)).mul hpa + have he (n : ℕ) : S * Polynomial.aeval (holomorphicEval A U f) (p n) = + Polynomial.aeval D (p n) * S := intertwines_aeval S _ D hI (p n) + simp_rw [he] at hh + exact (tendsto_nhds_unique hh (hpd.mul tendsto_const_nhds)) + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HarmonicMaximum.lean b/lean/OAI/Analysis/Crouzeix/HarmonicMaximum.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b398cec04278750feaeb98e5f9800f937b70a22 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HarmonicMaximum.lean @@ -0,0 +1,71 @@ +import Mathlib +import OAI.Analysis.Crouzeix.PoissonExtension + +namespace OAI + +/-! Harmonic Maximum. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex InnerProductSpace Real + +namespace CrouzeixHilbert.Conformal + +theorem harmonic_eventually_eq_of_isLocalMax {u : ℂ → ℝ} {p : ℂ} + (hu : HarmonicAt u p) (hm : IsLocalMax u p) : + u =ᶠ[𝓝 p] (fun _ => u p) := by + obtain ⟨r, hr, hsub⟩ := Metric.mem_nhds_iff.mp hu.eventually + obtain ⟨f, hf, he⟩ := HarmonicOnNhd.exists_analyticOnNhd_ball_re_eq + (show HarmonicOnNhd u (ball p r) from hsub) + have hp : p ∈ ball p r := mem_ball_self hr + have hfd : ∀ᶠ z in 𝓝 p, DifferentiableAt ℂ (fun w => Complex.exp (f w)) z := by + filter_upwards [ball_mem_nhds p hr] with z hz + exact (Complex.differentiable_exp.differentiableAt.comp z (hf z hz).differentiableAt) + have hfm : IsLocalMax (norm ∘ (fun w => Complex.exp (f w))) p := by + filter_upwards [hm, ball_mem_nhds p hr] with z hz hzB + simp only [Function.comp_apply, Complex.norm_exp, he hzB, he hp] + exact Real.exp_le_exp.mpr hz + have hc := Complex.norm_eventually_eq_of_isLocalMax hfd hfm + filter_upwards [hc, ball_mem_nhds p hr] with z hz hzB + have := hz + simp only [Complex.norm_exp, he hzB, he hp, Real.exp_eq_exp] at this + exact this + +theorem harmonic_eqOn_of_isLocalMax {U : Set ℂ} (hU : IsPreconnected U) + {u : ℂ → ℝ} (hu : HarmonicOnNhd u U) {p : ℂ} (hp : p ∈ U) + (hm : IsLocalMax u p) : EqOn u (fun _ => u p) U := + (show AnalyticOnNhd ℝ u U from fun z hz => _root_.HarmonicAt.analyticAt (hu z hz)) + |>.eqOn_of_preconnected_of_eventuallyEq analyticOnNhd_const hU hp + (harmonic_eventually_eq_of_isLocalMax (hu p hp) hm) + +theorem harmonic_le_of_boundary_le {U : Set ℂ} (hU : IsOpen U) + (hc : IsPreconnected U) (hb : Bornology.IsBounded U) {u : ℂ → ℝ} + (hu : HarmonicContOnCl u U) {C : ℝ} (hbd : ∀ z ∈ frontier U, u z ≤ C) : + ∀ z ∈ closure U, u z ≤ C := by + intro z hz + obtain ⟨p, hp, hmax⟩ := hb.isCompact_closure.exists_isMaxOn ⟨z, hz⟩ hu.continuousOn + suffices u p ≤ C from (hmax hz).trans this + by_cases hpi : p ∈ U + · have he := (harmonic_eqOn_of_isLocalMax hc hu.harmonicOnNhd hpi + (hmax.isLocalMax (mem_of_superset (hU.mem_nhds hpi) subset_closure))).of_subset_closure + hu.continuousOn continuousOn_const subset_closure Subset.rfl + obtain ⟨q, hq⟩ := nonempty_frontier_iff.mpr ⟨⟨p, hpi⟩, (fun he => NormedSpace.unbounded_univ ℂ ℂ (he ▸ hb))⟩ + simpa only [he (frontier_subset_closure hq)] using hbd q hq + · exact hbd p ⟨hp, by simpa only [hU.interior_eq] using hpi⟩ + +theorem harmonic_eqOn_of_boundary_eq {U : Set ℂ} (hU : IsOpen U) + (hc : IsPreconnected U) (hb : Bornology.IsBounded U) {u v : ℂ → ℝ} + (hu : HarmonicContOnCl u U) (hv : HarmonicContOnCl v U) + (he : EqOn u v (frontier U)) : EqOn u v (closure U) := by + have hle := harmonic_le_of_boundary_le hU hc hb (hu.sub hv) + (C := 0) (fun z hz => by change u z - v z ≤ 0; rw [he hz, sub_self]) + have hge := harmonic_le_of_boundary_le hU hc hb (hv.sub hu) + (C := 0) (fun z hz => by change v z - u z ≤ 0; rw [he hz, sub_self]) + intro z hz + exact le_antisymm (sub_nonpos.mp (hle z hz)) (sub_nonpos.mp (hge z hz)) + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HarmonicReflection.lean b/lean/OAI/Analysis/Crouzeix/HarmonicReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..ae9e4071d5f61f0ef0d3f31e382ef973d019ab1b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HarmonicReflection.lean @@ -0,0 +1,133 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HarmonicMaximum + +namespace OAI + +/-! Harmonic Reflection. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex InnerProductSpace Real + +open scoped Classical ComplexConjugate + +namespace CrouzeixHilbert.Conformal + +def upperHalfBall (R : ℝ) : Set ℂ := ball 0 R ∩ {z | 0 < z.im} + +def closedUpperHalfBall (R : ℝ) : Set ℂ := closedBall 0 R ∩ {z | 0 ≤ z.im} + +theorem isOpen_upperHalfBall (R : ℝ) : IsOpen (upperHalfBall R) := + isOpen_ball.inter (isOpen_lt continuous_const Complex.continuous_im) + +theorem convex_upperHalfBall (R : ℝ) : Convex ℝ (upperHalfBall R) := + (convex_ball _ _).inter ((convex_Ioi (0 : ℝ)).linear_preimage Complex.imLm) + +theorem closure_upperHalfBall_subset (R : ℝ) : + closure (upperHalfBall R) ⊆ closedUpperHalfBall R := by + apply closure_minimal + · intro z hz + exact ⟨ball_subset_closedBall hz.1, show 0 ≤ z.im from le_of_lt (show 0 < z.im from hz.2)⟩ + · exact isClosed_closedBall.inter (isClosed_le continuous_const Complex.continuous_im) + +def oddReflection (u : ℂ → ℝ) (z : ℂ) : ℝ := + if 0 ≤ z.im then u z else -u (conj z) + +theorem oddReflection_conj {R : ℝ} {u : ℂ → ℝ} + (hzero : ∀ z ∈ closedBall (0 : ℂ) R, z.im = 0 → u z = 0) + {z : ℂ} (hz : z ∈ closedBall 0 R) : oddReflection u (conj z) = -oddReflection u z := by + by_cases hi : z.im = 0 + · have hz' : conj z = z := Complex.ext (by simp) (by simp [hi]) + simp [oddReflection, hi, hz', hzero z hz hi] + · rcases lt_or_gt_of_ne hi with hneg | hpos + · simp [oddReflection, not_le.mpr hneg, (neg_pos.mpr hneg).le] + · simp [oddReflection, hpos.le, not_le.mpr (neg_neg_of_pos hpos)] + +theorem continuousOn_oddReflection {R : ℝ} {u : ℂ → ℝ} + (hu : ContinuousOn u (closedUpperHalfBall R)) + (hzero : ∀ z ∈ closedBall (0 : ℂ) R, z.im = 0 → u z = 0) : + ContinuousOn (oddReflection u) (sphere 0 R) := by + let S : Set ℂ := {z | 0 ≤ z.im} + have hS : IsClosed S := isClosed_le continuous_const Complex.continuous_im + have hfront : ∀ z ∈ frontier S, z.im = 0 := by + intro z hz + have hf := Complex.continuous_im.frontier_preimage_subset (Ici (0 : ℝ)) hz + simpa only [frontier_Ici, mem_preimage, mem_singleton_iff] using hf + have hlow : closure Sᶜ ⊆ {z : ℂ | z.im ≤ 0} := by + apply closure_minimal + · intro z hz + exact (not_le.mp (show ¬ 0 ≤ z.im from hz)).le + · exact isClosed_le Complex.continuous_im continuous_const + change ContinuousOn (S.piecewise u (fun z => -u (conj z))) (sphere 0 R) + apply ContinuousOn.piecewise + · intro z hz + have hi := hfront z hz.2 + have he : conj z = z := Complex.ext (by simp) (by simp [hi]) + rw [he, hzero z (sphere_subset_closedBall hz.1) hi, neg_zero] + · rw [hS.closure_eq] + exact hu.mono (fun z hz => ⟨sphere_subset_closedBall hz.1, hz.2⟩) + · apply ContinuousOn.neg + apply hu.comp Complex.continuous_conj.continuousOn + intro z hz + refine ⟨?_, ?_⟩ + · simpa only [mem_closedBall_zero_iff, Complex.norm_conj] using + (sphere_subset_closedBall hz.1) + · change 0 ≤ -z.im + exact neg_nonneg.mpr (show z.im ≤ 0 from hlow hz.2) + +theorem harmonic_reflection {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : HarmonicOnNhd u (upperHalfBall R)) + (huc : ContinuousOn u (closedUpperHalfBall R)) + (hzero : ∀ z ∈ closedBall (0 : ℂ) R, z.im = 0 → u z = 0) : + HarmonicOnNhd (poissonExtension R (oddReflection u)) (ball 0 R) ∧ + EqOn (poissonExtension R (oddReflection u)) u (upperHalfBall R) ∧ + (∀ z ∈ ball (0 : ℂ) R, z.im = 0 → poissonExtension R (oddReflection u) z = 0) := by + have hboundary := continuousOn_oddReflection huc hzero + have hodd : ∀ z ∈ sphere (0 : ℂ) R, + oddReflection u (conj z) = -oddReflection u z := + fun z hz => oddReflection_conj hzero (sphere_subset_closedBall hz) + have hreal : ∀ z ∈ closedBall (0 : ℂ) R, z.im = 0 → + dirichletExtension R (oddReflection u) z = 0 := by + intro z hz hi + by_cases hb : z ∈ ball (0 : ℂ) R + · rw [(dirichletExtension_eventuallyEq hb).eq_of_nhds] + have he : conj z = z := Complex.ext (by simp) (by simp [hi]) + have ho := poissonExtension_conj hR.le hodd z + rw [he] at ho + linarith + · have he : conj z = z := Complex.ext (by simp) (by simp [hi]) + simp only [dirichletExtension, piecewise_eq_of_notMem _ _ _ hb, + oddReflection, hi, le_refl, ite_true, hzero z hz hi] + have hd := harmonicContOnCl_dirichletExtension hR hboundary + have heq := harmonic_eqOn_of_boundary_eq (isOpen_upperHalfBall R) + (convex_upperHalfBall R).isPreconnected + (isBounded_ball.subset inter_subset_left) + (show HarmonicContOnCl (dirichletExtension R (oddReflection u)) (upperHalfBall R) + from hd.mono inter_subset_left) + (show HarmonicContOnCl u (upperHalfBall R) from + ⟨hu, huc.mono (closure_upperHalfBall_subset R)⟩) (by + intro z hz + have hzc := closure_upperHalfBall_subset R (frontier_subset_closure hz) + have hzn : z ∉ upperHalfBall R := by + have hn := hz.2 + simpa only [(isOpen_upperHalfBall R).interior_eq] using hn + by_cases hi : z.im = 0 + · rw [hreal z hzc.1 hi, hzero z hzc.1 hi] + · have hpos : 0 < z.im := lt_of_le_of_ne hzc.2 (Ne.symm hi) + have hs : z ∈ sphere (0 : ℂ) R := mem_sphere.mpr + (le_antisymm (mem_closedBall.mp hzc.1) + (le_of_not_gt (fun he => hzn ⟨he, hpos⟩))) + rw [dirichletExtension_eq_on_sphere hs, oddReflection, ite_eq_left hpos.le]) + refine ⟨harmonicOnNhd_poissonExtension hR.le hboundary, ?_, ?_⟩ + · intro z hz + rw [← (dirichletExtension_eventuallyEq hz.1).eq_of_nhds] + exact heq (subset_closure hz) + · intro z hz hi + rw [← (dirichletExtension_eventuallyEq hz).eq_of_nhds] + exact hreal z (ball_subset_closedBall hz) hi + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HilbertExtension.lean b/lean/OAI/Analysis/Crouzeix/HilbertExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..21e8138bd9a6c00b744662e827733ccf7d526e7f --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HilbertExtension.lean @@ -0,0 +1,93 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HomologicalCauchy +import OAI.Analysis.Crouzeix.PolynomialApproximation +import OAI.Analysis.Crouzeix.Sharpness + +namespace OAI + +/-! Hilbert Extension. -/ + +noncomputable section + +open Set Filter Metric + +open scoped Topology + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem differentiableOn_resolvent [CompleteSpace H] (A : Operator H) : + DifferentiableOn ℂ (fun z : ℂ => Ring.inverse (algebraMap ℂ (Operator H) z - A)) + (numericalClosure A)ᶜ := by + intro z hz + have hr : z ∈ resolventSet ℂ A := by + by_contra h + exact hz (spectrum_subset_numericalClosure A h) + exact (spectrum.hasDerivAt_resolvent_const_left hr).differentiableAt.differentiableWithinAt + +theorem contourEval_eq_integral (A : Operator H) (Γ : SmoothContour) (f : ℂ → ℂ) : + contourEval A Γ f = + Γ.integral (fun z => f z • Ring.inverse (algebraMap ℂ (Operator H) z - A)) := by + simp only [contourEval, SmoothContour.integral, smul_smul] + +theorem contourEval_independent [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) + (Γ Δ : CalculusContour (numericalClosure A) U) : + contourEval A Γ.toSmoothContour f = contourEval A Δ.toSmoothContour f := by + let V := U \ numericalClosure A + have hV : IsOpen V := hU.sdiff isClosed_closure + let paths : Bool → SmoothContour := fun b => if b then Γ.toSmoothContour else Δ.toSmoothContour + let c : Bool → ℂ := fun b => if b then 1 else -1 + have hp : ∀ b, (paths b).trace ⊆ V := by + intro b z hz + cases b <;> rcases hz with ⟨t, ht, rfl⟩ + · exact Δ.avoids t ht + · exact Γ.avoids t ht + have hi : ∀ z ∉ V, ∑ b, c b * (paths b).index z = 0 := by + intro z hz + simp only [Fintype.sum_bool, paths, c, Bool.false_eq_true, ite_false, ite_true, + one_mul, neg_one_mul, ← sub_eq_add_neg] + by_cases hK : z ∈ numericalClosure A + · rw [Γ.index_inside z hK, Δ.index_inside z hK, sub_self] + · have hzU : z ∉ U := fun hzU => hz ⟨hzU, hK⟩ + rw [Γ.index_outside z hzU, Δ.index_outside z hzU, sub_self] + have hd : DifferentiableOn ℂ (fun z => f z • + Ring.inverse (algebraMap ℂ (Operator H) z - A)) V := + (hf.mono (fun _ hz => hz.1)).fun_smul + ((differentiableOn_resolvent A).mono (fun _ hz => hz.2)) + have h := sum_integral_eq_zero_of_null_homology paths c hV hp hi hd + simp only [Fintype.sum_bool, paths, c, Bool.false_eq_true, ite_false, ite_true, + one_smul, neg_smul, ← sub_eq_add_neg] at h + rw [contourEval_eq_integral, contourEval_eq_integral] + exact sub_eq_zero.mp h + +theorem holomorphicEval_eq_contourEval [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) + (Γ : CalculusContour (numericalClosure A) U) : + holomorphicEval A U f = contourEval A Γ.toSmoothContour f := + holomorphicEval_eq_contourEval_of_independent A Γ f (fun Δ => contourEval_independent A hU hf Δ Γ) + +theorem nonzeroConclusion_of_finite_matrix_bound [CompleteSpace H] [Nontrivial H] + (hfin : FiniteMatrixPolynomialBound) (A : Operator H) : NonzeroConclusion A := + nonzeroConclusion_of_finite_bound_and_contour_independence A hfin + (fun _U hU _hK _f hf Γ Δ => contourEval_independent A hU hf Γ Δ) + +theorem hilbert_of_finite_matrix_bound (hfin : FiniteMatrixPolynomialBound) + (H : Type u) [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + (A : Operator H) : + (Nontrivial H → NonzeroConclusion A) ∧ + (Subsingleton H → ZeroConclusion A) ∧ SharpConstant := by + refine ⟨fun h => ?_, fun h => ?_, sharpConstant⟩ + · have := h + exact nonzeroConclusion_of_finite_matrix_bound hfin A + · have := h + exact zeroConclusion A + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HilbertInequality.lean b/lean/OAI/Analysis/Crouzeix/HilbertInequality.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ec5023a5dbbe5014009393204da74d3fac90deb --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HilbertInequality.lean @@ -0,0 +1,21 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CompleteFinite + +namespace OAI + +/-! Hilbert Inequality. -/ + +namespace CrouzeixHilbert + +universe u + +theorem hilbert (H : Type u) [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] (A : Operator H) : + (Nontrivial H → NonzeroConclusion A) ∧ + (Subsingleton H → ZeroConclusion A) ∧ SharpConstant := by + exact hilbert_of_finite_matrix_bound finite_matrix_polynomial_bound H A + +end CrouzeixHilbert + + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HolomorphicAlgebra.lean b/lean/OAI/Analysis/Crouzeix/HolomorphicAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..8997809a01a666f5534fa5ab1a497df574763855 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HolomorphicAlgebra.lean @@ -0,0 +1,144 @@ +import Mathlib +import OAI.Analysis.Crouzeix.DiskHolomorphic + +namespace OAI + +/-! Holomorphic Algebra. -/ + +noncomputable section + +open Set Filter Metric Topology Complex MeasureTheory + +open scoped InnerProductSpace Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +lemma exists_polynomial_tendstoUniformlyOn {K U : Set ℂ} + (hK : IsCompact K) (hc : Convex ℝ K) (hU : IsOpen U) (hKU : K ⊆ U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) : + ∃ p : ℕ → Polynomial ℂ, TendstoUniformlyOn (fun n z => (p n).eval z) f atTop K := by + have happrox (n : ℕ) : ∃ p : Polynomial ℂ, ∀ z ∈ K, ‖p.eval z - f z‖ < (1 : ℝ)/(n+1) := + exists_polynomial_uniform_approx hK hc hU hKU hf (by positivity) + choose p hp using happrox + refine ⟨p, Metric.tendstoUniformlyOn_iff.mpr (fun ε hε => ?_)⟩ + have ht : Tendsto (fun n : ℕ => (1 : ℝ)/(n+1)) atTop (𝓝 0) := + tendsto_one_div_add_atTop_nhds_zero_nat + filter_upwards [ht.eventually (gt_mem_nhds hε)] with n hn z hz + rw [dist_comm, dist_eq_norm] + exact (hp n z hz).trans hn + +section + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [Nontrivial H] + +variable (A : Operator H) + +lemma holomorphicEval_polynomial {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) (p : Polynomial ℂ) : + holomorphicEval A U p.eval = Polynomial.aeval A p := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hU hKU + rw [holomorphicEval_eq_contourEval A hU p.differentiable.differentiableOn Γ, + contourEval_polynomial] + +lemma holomorphicEval_const {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) (c : ℂ) : + holomorphicEval A U (fun _ => c) = algebraMap ℂ (Operator H) c := by + simpa only [Polynomial.eval_C, Polynomial.aeval_C] using + holomorphicEval_polynomial A hU hKU (Polynomial.C c) + +lemma holomorphicEval_restrict {U V : Set ℂ} (hU : IsOpen U) (hV : IsOpen V) + (hKU : numericalClosure A ⊆ U) (hUV : U ⊆ V) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f V) : + holomorphicEval A U f = holomorphicEval A V f := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hU hKU + let Δ : CalculusContour (numericalClosure A) V := { + toSmoothContour := Γ.toSmoothContour + avoids := fun t ht => ⟨hUV (Γ.avoids t ht).1, (Γ.avoids t ht).2⟩ + index_inside := Γ.index_inside + index_outside := fun z hz => Γ.index_outside z (fun h => hz (hUV h)) } + rw [holomorphicEval_eq_contourEval A hU (hf.mono hUV) Γ, + holomorphicEval_eq_contourEval A hV hf Δ] + +lemma holomorphicEval_add {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f g : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hg : DifferentiableOn ℂ g U) : + holomorphicEval A U (fun z => f z + g z) = holomorphicEval A U f + holomorphicEval A U g := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hU hKU + rw [holomorphicEval_eq_contourEval A hU (hf.fun_add hg) Γ, + holomorphicEval_eq_contourEval A hU hf Γ, holomorphicEval_eq_contourEval A hU hg Γ] + simp only [contourEval_eq_kernel, add_smul] + rw [intervalIntegral.integral_add + (intervalIntegrable_contourIntegrand A Γ (hf.continuousOn.mono (by + rintro z ⟨t,ht,rfl⟩; exact (Γ.avoids t ht).1))) + (intervalIntegrable_contourIntegrand A Γ (hg.continuousOn.mono (by + rintro z ⟨t,ht,rfl⟩; exact (Γ.avoids t ht).1))), smul_add] + +lemma holomorphicEval_smul {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (c : ℂ) : + holomorphicEval A U (fun z => c * f z) = c • holomorphicEval A U f := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hU hKU + rw [holomorphicEval_eq_contourEval A hU (hf.const_mul c) Γ, + holomorphicEval_eq_contourEval A hU hf Γ, contourEval_const_mul] + +lemma holomorphicEval_mul {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f g : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hg : DifferentiableOn ℂ g U) : + holomorphicEval A U (fun z => f z * g z) = holomorphicEval A U f * holomorphicEval A U g := by + obtain ⟨ε,hε,hεU⟩ := (isCompact_numericalClosure A).exists_cthickening_subset_open hU hKU + let K := cthickening ε (numericalClosure A) + have hK : IsCompact K := (isCompact_numericalClosure A).cthickening + have hc : Convex ℝ K := (convex_numericalClosure A).cthickening ε + have hAK : numericalClosure A ⊆ interior K := + (self_subset_thickening hε _).trans (thickening_subset_interior_cthickening _ _) + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) isOpen_interior hAK + let Δ : CalculusContour (numericalClosure A) U := { + toSmoothContour := Γ.toSmoothContour + avoids := fun t ht => ⟨hεU (interior_subset (Γ.avoids t ht).1), (Γ.avoids t ht).2⟩ + index_inside := Γ.index_inside + index_outside := fun z hz => Γ.index_outside z (fun h => hz (hεU (interior_subset h))) } + have htrace : Δ.toSmoothContour.trace ⊆ K := by + rintro z ⟨t,ht,rfl⟩ + exact interior_subset (Γ.avoids t ht).1 + obtain ⟨p,hp⟩ := exists_polynomial_tendstoUniformlyOn hK hc hU hεU hf + obtain ⟨q,hq⟩ := exists_polynomial_tendstoUniformlyOn hK hc hU hεU hg + let : CompactSpace K := isCompact_iff_compactSpace.mp hK + let fK : C(K,ℂ) := ⟨fun z => f z, (hf.continuousOn.mono hεU).domRestrict⟩ + let gK : C(K,ℂ) := ⟨fun z => g z, (hg.continuousOn.mono hεU).domRestrict⟩ + have hpK : Tendsto (fun n => (p n).toContinuousMapOn K) atTop (𝓝 fK) := by + rw [ContinuousMap.tendsto_iff_tendstoUniformly] + exact (tendstoUniformlyOn_iff_tendstoUniformly_comp_coe.mp hp) + have hqK : Tendsto (fun n => (q n).toContinuousMapOn K) atTop (𝓝 gK) := by + rw [ContinuousMap.tendsto_iff_tendstoUniformly] + exact (tendstoUniformlyOn_iff_tendstoUniformly_comp_coe.mp hq) + have hpq : TendstoUniformlyOn (fun n z => (p n * q n).eval z) + (fun z => f z * g z) atTop K := by + have hs := ContinuousMap.tendsto_iff_tendstoUniformly.mp (hpK.mul hqK) + change TendstoUniformly (fun n (z : K) => (p n).eval (z : ℂ) * (q n).eval (z : ℂ)) + (fun z : K => f z * g z) atTop at hs + rw [tendstoUniformlyOn_iff_tendstoUniformly_comp_coe] + simpa only [Function.comp_def, Polynomial.eval_mul] using hs + have hpf := tendsto_contourEval A Δ (fun n => (p n).continuous.continuousOn) (hp.mono htrace) + have hqg := tendsto_contourEval A Δ (fun n => (q n).continuous.continuousOn) (hq.mono htrace) + have hmul := tendsto_contourEval A Δ (fun n => (p n * q n).continuous.continuousOn) (hpq.mono htrace) + simp_rw [contourEval_polynomial] at hpf hqg hmul + simp only [map_mul] at hmul + have he := tendsto_nhds_unique hmul (hpf.mul hqg) + simpa only [← holomorphicEval_eq_contourEval A hU (hf.fun_mul hg) Δ, + ← holomorphicEval_eq_contourEval A hU hf Δ, ← holomorphicEval_eq_contourEval A hU hg Δ] using he + +end + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HolomorphicReflection.lean b/lean/OAI/Analysis/Crouzeix/HolomorphicReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..873b1dcfd30c9c775af4034a30c65c8239822969 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HolomorphicReflection.lean @@ -0,0 +1,80 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ReflectionDerivative + +namespace OAI + +/-! Holomorphic Reflection. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex InnerProductSpace Real + +open scoped Classical ComplexConjugate + +namespace CrouzeixHilbert.Conformal + +theorem holomorphic_reflection {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} {f : ℂ → ℂ} + (hu : HarmonicOnNhd u (upperHalfBall R)) + (huc : ContinuousOn u (closedUpperHalfBall R)) + (hzero : ∀ z ∈ closedBall (0 : ℂ) R, z.im = 0 → u z = 0) + (hneg : ∀ z ∈ sphere (0 : ℂ) R, 0 < z.im → u z < 0) + (hf : DifferentiableOn ℂ f (upperHalfBall R)) + (hfn : ∀ z ∈ upperHalfBall R, f z ≠ 0) + (hlog : EqOn (fun z => Real.log ‖f z‖) u (upperHalfBall R)) : + ∃ g : ℂ → ℂ, AnalyticOnNhd ℂ g (ball 0 R) ∧ + EqOn g f (upperHalfBall R) ∧ deriv g 0 ≠ 0 ∧ + (∀ z ∈ ball (0 : ℂ) R, z.im = 0 → ‖g z‖ = 1) := by + let H := schwarzExtension R (oddReflection u) + have hbound := continuousOn_oddReflection huc hzero + have hHa : AnalyticOnNhd ℂ H (ball 0 R) := analyticOnNhd_schwarzExtension hR.le hbound + have hHe : EqOn (fun z => (H z).re) u (upperHalfBall R) := by + intro z hz + exact (schwarzExtension_re (ContinuousOn.circleIntegrable hR.le hbound) hz.1).trans + ((harmonic_reflection hR hu huc hzero).2.1 hz) + let q : ℂ → ℂ := fun z => f z / Complex.exp (H z) + have hqd : DifferentiableOn ℂ q (upperHalfBall R) := by + apply hf.div + · intro z hz + exact ((hHa z hz.1).cexp.differentiableAt).differentiableWithinAt + · exact fun z _ => Complex.exp_ne_zero (H z) + have hqn : ∀ z ∈ upperHalfBall R, ‖q z‖ = 1 := by + intro z hz + dsimp [q] + rw [norm_div, Complex.norm_exp, show (H z).re = u z from hHe hz, ← (show Real.log ‖f z‖ = u z from hlog hz), + Real.exp_log (norm_pos_iff.mpr (hfn z hz)), div_self (norm_ne_zero_iff.mpr (hfn z hz))] + let p : ℂ := (R / 2 : ℝ) * I + have hp : p ∈ upperHalfBall R := by + constructor + · simp only [p, mem_ball_zero_iff, norm_mul, norm_I, mul_one, Complex.norm_real, + Real.norm_of_nonneg (half_pos hR).le] + linarith + · change 0 < p.im + simpa [p] using half_pos hR + have hqc : EqOn q (fun _ => q p) (upperHalfBall R) := + Complex.eqOn_of_isPreconnected_of_isMaxOn_norm (convex_upperHalfBall R).isPreconnected + (isOpen_upperHalfBall R) hqd hp (fun z hz => by + change ‖q z‖ ≤ ‖q p‖ + rw [hqn z hz, hqn p hp]) + have hqpn : q p ≠ 0 := by + intro he + simpa only [he, norm_zero, zero_ne_one] using hqn p hp + refine ⟨fun z => q p * Complex.exp (H z), ?_, ?_, ?_, ?_⟩ + · intro z hz + exact analyticAt_const.mul (hHa z hz).cexp + · intro z hz + have he := (div_eq_iff (Complex.exp_ne_zero (H z))).mp (hqc hz) + exact he.symm + · have hd := ((hHa 0 (mem_ball_self hR)).differentiableAt.hasDerivAt.cexp).const_mul (q p) + rw [hd.deriv] + exact mul_ne_zero hqpn (mul_ne_zero (Complex.exp_ne_zero _) (deriv_schwarzExtension_odd_ne_zero hR hbound hneg)) + · intro z hz hi + have hr : (H z).re = 0 := + (schwarzExtension_re (ContinuousOn.circleIntegrable hR.le hbound) hz).trans + ((harmonic_reflection hR hu huc hzero).2.2 z hz hi) + rw [norm_mul, hqn p hp, Complex.norm_exp, hr, Real.exp_zero, mul_one] + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HolomorphicSpectrum.lean b/lean/OAI/Analysis/Crouzeix/HolomorphicSpectrum.lean new file mode 100644 index 0000000000000000000000000000000000000000..4eae142ecb1d43c16e308e2354950c5e4add48c7 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HolomorphicSpectrum.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HolomorphicAlgebra + +namespace OAI + +/-! Holomorphic Spectrum. -/ + +noncomputable section + +open Set Filter Metric Topology Complex MeasureTheory + +open scoped InnerProductSpace Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [Nontrivial H] + +variable (A : Operator H) + +lemma holomorphicEval_congr {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f g : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hg : DifferentiableOn ℂ g U) (he : EqOn f g U) : + holomorphicEval A U f = holomorphicEval A U g := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hU hKU + rw [holomorphicEval_eq_contourEval A hU hf Γ, holomorphicEval_eq_contourEval A hU hg Γ] + apply contourEval_congr + rintro z ⟨t,ht,rfl⟩ + exact he (Γ.avoids t ht).1 + +lemma isUnit_holomorphicEval {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hn : ∀ z ∈ numericalClosure A, f z ≠ 0) : + IsUnit (holomorphicEval A U f) := by + let V := U ∩ {z | f z ≠ 0} + have hV : IsOpen V := hf.continuousOn.isOpen_inter_preimage hU isOpen_ne + have hKV : numericalClosure A ⊆ V := fun z hz => ⟨hKU hz,hn z hz⟩ + have hfV := hf.mono (show V ⊆ U from inter_subset_left) + have hi : DifferentiableOn ℂ (fun z => (f z)⁻¹) V := hfV.inv (fun z hz => hz.2) + rw [← holomorphicEval_restrict A hV hU hKV inter_subset_left hf] + refine (isUnit_iff_exists).mpr ⟨holomorphicEval A V (fun z => (f z)⁻¹), ?_, ?_⟩ + · rw [← holomorphicEval_mul A hV hKV hfV hi, + holomorphicEval_congr A hV hKV (hfV.fun_mul hi) (differentiableOn_const (1 : ℂ)) + (fun z hz => mul_inv_cancel₀ hz.2), holomorphicEval_const A hV hKV, map_one] + · rw [← holomorphicEval_mul A hV hKV hi hfV, + holomorphicEval_congr A hV hKV (hi.fun_mul hfV) (differentiableOn_const (1 : ℂ)) + (fun z hz => inv_mul_cancel₀ hz.2), holomorphicEval_const A hV hKV, map_one] + +lemma spectrum_holomorphicEval_subset {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) : + spectrum ℂ (holomorphicEval A U f) ⊆ f '' numericalClosure A := by + intro z hz + by_contra hn + have hnz : ∀ w ∈ numericalClosure A, z + (-1 : ℂ) * f w ≠ 0 := by + intro w hw he + apply hn + refine ⟨w,hw,?_⟩ + linear_combination -he + have hd := (differentiableOn_const (c := z)).fun_add (hf.const_mul (-1)) + have hu := isUnit_holomorphicEval A hU hKU hd hnz + rw [holomorphicEval_add A hU hKU (differentiableOn_const z) (hf.const_mul (-1)), + holomorphicEval_const A hU hKU, holomorphicEval_smul A hU hKU hf] at hu + simp only [neg_one_smul, ← sub_eq_add_neg] at hu + exact (spectrum.mem_iff.mp hz) hu + +lemma spectralRadius_holomorphicEval_lt_one {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) + (hfK : ∀ z ∈ numericalClosure A, ‖f z‖ < 1) : + spectralRadius ℂ (holomorphicEval A U f) < 1 := by + apply spectrum.spectralRadius_lt_of_forall_lt + intro z hz + obtain ⟨w,hw,rfl⟩ := spectrum_holomorphicEval_subset A hU hKU hf hz + exact hfK w hw + +lemma holomorphicEval_polynomial_comp {U : Set ℂ} (hU : IsOpen U) + (hKU : numericalClosure A ⊆ U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) + (p : Polynomial ℂ) : + holomorphicEval A U (fun z => p.eval (f z)) = Polynomial.aeval (holomorphicEval A U f) p := by + induction p using Polynomial.induction_on' with + | add p q hp hq => + simp only [Polynomial.eval_add, map_add] + rw [holomorphicEval_add A hU hKU + (show DifferentiableOn ℂ (fun z => p.eval (f z)) U from p.differentiable.comp_differentiableOn hf) + (show DifferentiableOn ℂ (fun z => q.eval (f z)) U from q.differentiable.comp_differentiableOn hf), hp, hq] + | monomial n c => + have hpow : holomorphicEval A U (fun z => f z ^ n) = holomorphicEval A U f ^ n := by + induction n with + | zero => simpa only [pow_zero, map_one] using holomorphicEval_const A hU hKU (1 : ℂ) + | succ n ih => + simp_rw [pow_succ] + rw [holomorphicEval_mul A hU hKU (f := fun z => f z^n) (hf.pow n) hf, ih] + simp only [Polynomial.eval_monomial, Polynomial.aeval_monomial] + rw [holomorphicEval_smul A hU hKU (f := fun z => f z^n) (hf.pow n), hpow, Algebra.smul_def] + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/HomologicalCauchy.lean b/lean/OAI/Analysis/Crouzeix/HomologicalCauchy.lean new file mode 100644 index 0000000000000000000000000000000000000000..b6845d47cdf23e48df10d2f8273206fb9751eed7 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/HomologicalCauchy.lean @@ -0,0 +1,406 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Definitions +import OAI.Analysis.Crouzeix.ResolventBounds +import OAI.Analysis.Crouzeix.ContourExistence + +namespace OAI + +/-! Homological Cauchy. -/ + +noncomputable section + +open Set Filter Metric MeasureTheory + +open scoped Topology + +namespace CrouzeixHilbert + +def extendCompactFunction {K : Set ℂ} {E : Type*} [TopologicalSpace E] [Zero E] + (f : C(K, E)) (z : ℂ) : E := by + classical + exact if hz : z ∈ K then f ⟨z, hz⟩ else 0 + +@[simp] +theorem extendCompactFunction_apply {K : Set ℂ} {E : Type*} + [TopologicalSpace E] [Zero E] (f : C(K, E)) {z : ℂ} (hz : z ∈ K) : + (extendCompactFunction f) z = f ⟨z, hz⟩ := by + classical + simp only [extendCompactFunction, dite_eq_left hz] + +def holomorphicContinuousFunctions (K : Set ℂ) (E : Type*) [NormedAddCommGroup E] + [NormedSpace ℂ E] : Submodule ℂ C(K, E) where + carrier := {f | DifferentiableOn ℂ (extendCompactFunction f) (interior K)} + zero_mem' := by + apply (differentiableOn_const (c := (0 : E))).congr + intro z hz + simp only [extendCompactFunction_apply _ (interior_subset hz), ContinuousMap.zero_apply] + add_mem' := by + intro f g hf hg + apply (hf.add hg).congr + intro z hz + simp only [extendCompactFunction_apply _ (interior_subset hz), ContinuousMap.add_apply, Pi.add_apply] + smul_mem' := by + intro c f hf + apply (hf.const_smul c).congr + intro z hz + simp only [extendCompactFunction_apply _ (interior_subset hz), ContinuousMap.smul_apply, Pi.smul_apply] + +theorem isClosed_holomorphicContinuousFunctions {K : Set ℂ} [CompactSpace K] + {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] : + IsClosed (holomorphicContinuousFunctions K E : Set C(K, E)) := by + apply IsSeqClosed.isClosed + intro fs f hfs hf + have ht : TendstoUniformlyOn (fun n => (extendCompactFunction (fs n))) (extendCompactFunction f) atTop (interior K) := by + apply Metric.tendstoUniformlyOn_iff.mpr + intro ε hε + filter_upwards [Metric.tendsto_nhds.mp hf ε hε] with n hn z hz + simp only [extendCompactFunction_apply _ (interior_subset hz)] + exact (ContinuousMap.dist_apply_le_dist (f := f) (g := fs n) (⟨z, interior_subset hz⟩ : K)).trans_lt (by simpa [dist_comm] using hn) + exact ht.tendstoLocallyUniformlyOn.differentiableOn + (Eventually.of_forall hfs) isOpen_interior + +theorem differentiableOn_parameter_intervalIntegral {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℝ → E} + (hf : ContinuousOn (Function.uncurry f) (U ×ˢ Icc (0 : ℝ) 1)) + (hd : ∀ t ∈ Icc (0 : ℝ) 1, DifferentiableOn ℂ (fun z => f z t) U) : + DifferentiableOn ℂ (fun z => ∫ t in (0 : ℝ)..1, f z t) U := by + classical + intro z hz + obtain ⟨r, hr, hrU⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (hU.mem_nhds hz) + let K := closedBall z r + have hKc : IsCompact K := isCompact_closedBall z r + let : CompactSpace K := isCompact_iff_compactSpace.mp hKc + let g : ℝ → C(K, E) := fun t => if ht : t ∈ Icc (0 : ℝ) 1 then + ⟨fun w => f w t, ((hd t ht).continuousOn.mono hrU).domRestrict⟩ else 0 + have hga (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) (w : K) : g t w = f w t := by + simp only [g, dite_eq_left ht] + rfl + have hg : ContinuousOn g (Icc (0 : ℝ) 1) := by + rw [continuousOn_iff_continuous_domRestrict] + apply ContinuousMap.continuous_of_continuous_uncurry + have hc : Continuous (fun p : ↥(Icc (0 : ℝ) 1) × K => + f p.2 p.1) := hf.comp_continuous + ((continuous_subtype_val.comp continuous_snd).prodMk + (continuous_subtype_val.comp continuous_fst)) + (fun p => ⟨hrU p.2.property, p.1.property⟩) + convert! hc using 1 + funext p + exact hga p.1 p.1.property p.2 + have hgi : IntervalIntegrable g volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using hg + let S := holomorphicContinuousFunctions K E + have hgm (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : g t ∈ S := by + change DifferentiableOn ℂ (extendCompactFunction (g t)) (interior K) + apply ((hd t ht).mono (interior_subset.trans hrU)).congr + intro w hw + rw [extendCompactFunction_apply _ (interior_subset hw), hga t ht] + have hmi : (∫ t in (0 : ℝ)..1, g t) ∈ S := by + have : IsProbabilityMeasure (volume.restrict (Ioc (0 : ℝ) 1)) := ⟨by simp⟩ + rw [intervalIntegral.integral_of_le zero_le_one] + exact (S.restrictScalars ℝ).convex.integral_mem isClosed_holomorphicContinuousFunctions + ((ae_restrict_mem measurableSet_Ioc).mono + (fun t ht => hgm t (Ioc_subset_Icc_self ht))) hgi.1 + have hdint : DifferentiableOn ℂ (fun w => ∫ t in (0 : ℝ)..1, f w t) (interior K) := by + apply hmi.congr + intro w hw + rw [extendCompactFunction_apply _ (interior_subset hw)] + change _ = ContinuousMap.evalCLM ℂ ⟨w, interior_subset hw⟩ (∫ t in (0 : ℝ)..1, g t) + rw [← (ContinuousMap.evalCLM ℂ ⟨w, interior_subset hw⟩).intervalIntegral_comp_comm hgi] + apply intervalIntegral.integral_congr + intro t ht + change f w t = g t ⟨w, interior_subset hw⟩ + exact (hga t (by simpa only [uIcc_of_le zero_le_one] using ht) ⟨w, interior_subset hw⟩).symm + apply (hdint.differentiableAt ?_).differentiableWithinAt + change interior (closedBall z r) ∈ 𝓝 z + rw [interior_closedBall _ hr.ne'] + exact ball_mem_nhds z hr + +theorem dslope_swap {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + (f : ℂ → E) (a b : ℂ) : dslope f a b = dslope f b a := by + by_cases he : a = b + · rw [he] + · rw [dslope_of_ne _ (Ne.symm he), dslope_of_ne _ he, slope_comm] + +theorem continuousAt_dslope_pair_of_analyticAt {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] {f : ℂ → E} {x : ℂ} + (hf : AnalyticAt ℂ f x) : + ContinuousAt (fun p : ℂ × ℂ => dslope f p.1 p.2) (x, x) := by + change Tendsto _ _ (𝓝 (dslope f x x)) + rw [dslope_same] + apply Metric.tendsto_nhds.mpr + intro ε hε + have hs := hf.hasStrictDerivAt.hasStrictFDerivAt.isLittleO + have hb := (continuous_swap.tendsto (x, x)).eventually (hs.def (half_pos hε)) + have hd : Tendsto (fun p : ℂ × ℂ => deriv f p.1) (𝓝 (x, x)) (𝓝 (deriv f x)) := + hf.deriv.continuousAt.tendsto.comp continuous_fst.continuousAt.tendsto + filter_upwards [hb, Metric.tendsto_nhds.mp hd ε hε] with p hp hpd + by_cases he : p.2 = p.1 + · simpa only [he, dslope_same] using hpd + · have hn : p.2 - p.1 ≠ 0 := sub_ne_zero.mpr he + have hp' : ‖f p.2 - f p.1 - (p.2 - p.1) • deriv f x‖ ≤ + (ε / 2) * ‖p.2 - p.1‖ := hp + have heq : dslope f p.1 p.2 - deriv f x = + (p.2 - p.1)⁻¹ • (f p.2 - f p.1 - (p.2 - p.1) • deriv f x) := by + rw [smul_sub, smul_smul, inv_mul_cancel₀ hn, one_smul, dslope_of_ne _ he] + rfl + rw [dist_eq_norm, heq, norm_smul, norm_inv] + calc + _ ≤ ‖p.2 - p.1‖⁻¹ * ((ε / 2) * ‖p.2 - p.1‖) := + mul_le_mul_of_nonneg_left hp' (by positivity) + _ = ε / 2 := by field_simp [norm_ne_zero_iff.mpr hn] + _ < ε := half_lt_self hε + +theorem continuousOn_dslope_pair {E : Type*} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → E} (hf : DifferentiableOn ℂ f U) : + ContinuousOn (fun p : ℂ × ℂ => dslope f p.1 p.2) (U ×ˢ U) := by + intro p hp + by_cases he : p.2 = p.1 + · rcases p with ⟨a, b⟩ + dsimp only at he hp ⊢ + subst b + exact (continuousAt_dslope_pair_of_analyticAt (hf.analyticOnNhd hU a hp.1)).continuousWithinAt + · have hc : ContinuousAt (fun p : ℂ × ℂ => + (p.2 - p.1)⁻¹ • (f p.2 - f p.1)) p := + ((continuous_snd.sub continuous_fst).continuousAt.inv₀ (sub_ne_zero.mpr he)).smul + (((hf.continuousOn.continuousAt (hU.mem_nhds hp.2)).comp continuous_snd.continuousAt).sub + ((hf.continuousOn.continuousAt (hU.mem_nhds hp.1)).comp continuous_fst.continuousAt)) + apply (hc.congr_of_eventuallyEq ?_).continuousWithinAt + filter_upwards [(isOpen_ne_fun continuous_snd continuous_fst).mem_nhds he] with q hq + exact dslope_of_ne f hq + +def SmoothContour.integral {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + (Γ : SmoothContour) (f : ℂ → E) : E := + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∫ t in (0 : ℝ)..1, deriv Γ.path t • f (Γ.path t) + +def SmoothContour.cauchyTransform {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + (Γ : SmoothContour) (f : ℂ → E) (w : ℂ) : E := + Γ.integral (fun z => (z - w)⁻¹ • f z) + +def SmoothContour.regularizedTransform {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + (Γ : SmoothContour) (f : ℂ → E) (w : ℂ) : E := + Γ.integral (dslope f w) + +theorem SmoothContour.intervalIntegrable_contourIntegrand {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] (Γ : SmoothContour) {f : ℂ → E} + (hf : ContinuousOn f Γ.trace) : + IntervalIntegrable (fun t => deriv Γ.path t • f (Γ.path t)) volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le zero_le_one] + exact Γ.smooth.continuous_deriv_one.continuousOn.smul + (hf.comp Γ.smooth.continuous.continuousOn (fun t ht => ⟨t, ht, rfl⟩)) + +theorem SmoothContour.differentiableOn_cauchyTransform {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : SmoothContour) {f : ℂ → E} (hf : ContinuousOn f Γ.trace) : + DifferentiableOn ℂ (Γ.cauchyTransform f) Γ.traceᶜ := by + apply DifferentiableOn.const_smul + apply differentiableOn_parameter_intervalIntegral Γ.isCompact_trace.isClosed.isOpen_compl + · have hc : Continuous (fun p : ℂ × ℝ => deriv Γ.path p.2) := + Γ.smooth.continuous_deriv_one.comp continuous_snd + apply hc.continuousOn.smul + apply ContinuousOn.smul + · apply ContinuousOn.inv₀ + · exact ((Γ.smooth.continuous.comp continuous_snd).sub continuous_fst).continuousOn + · intro p hp he + exact hp.1 ⟨p.2, hp.2, sub_eq_zero.mp he⟩ + · exact hf.comp (Γ.smooth.continuous.comp continuous_snd).continuousOn + (fun p hp => ⟨p.2, hp.2, rfl⟩) + · intro t ht + apply DifferentiableOn.const_smul + apply DifferentiableOn.smul_const + apply DifferentiableOn.inv + · exact ((differentiable_const (Γ.path t)).sub differentiable_id).differentiableOn + · intro w hw he + exact hw ⟨t, ht, sub_eq_zero.mp he⟩ + +theorem SmoothContour.differentiableOn_regularizedTransform {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : SmoothContour) {U : Set ℂ} (hU : IsOpen U) (hΓ : Γ.trace ⊆ U) + {f : ℂ → E} (hf : DifferentiableOn ℂ f U) : + DifferentiableOn ℂ (Γ.regularizedTransform f) U := by + apply DifferentiableOn.const_smul + apply differentiableOn_parameter_intervalIntegral hU + · apply (Γ.smooth.continuous_deriv_one.comp continuous_snd).continuousOn.smul + apply (continuousOn_dslope_pair hU hf).comp + (continuous_fst.prodMk (Γ.smooth.continuous.comp continuous_snd)).continuousOn + intro p hp + exact ⟨hp.1, hΓ ⟨p.2, hp.2, rfl⟩⟩ + · intro t ht + apply DifferentiableOn.const_smul + have hd := (Complex.differentiableOn_dslope (hU.mem_nhds (hΓ ⟨t, ht, rfl⟩))).mpr hf + exact hd.congr (fun w _ => dslope_swap f w (Γ.path t)) + +theorem SmoothContour.regularizedTransform_eq {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : SmoothContour) {f : ℂ → E} (hf : ContinuousOn f Γ.trace) + {w : ℂ} (hw : w ∉ Γ.trace) : + Γ.regularizedTransform f w = Γ.cauchyTransform f w - Γ.index w • f w := by + have hc : ContinuousOn (fun z : ℂ => (z - w)⁻¹) Γ.trace := + (continuous_id.sub continuous_const).continuousOn.inv₀ + (fun z hz he => hw ((show z = w from sub_eq_zero.mp he) ▸ hz)) + have hi : IntervalIntegrable (fun t => deriv Γ.path t • ((Γ.path t - w)⁻¹ • f (Γ.path t))) + volume (0 : ℝ) 1 := by + simpa only [Pi.smul_apply'] using Γ.intervalIntegrable_contourIntegrand (hc.smul hf) + have hj := (Γ.intervalIntegrable_indexIntegrand hw).smul_continuousOn + (continuousOn_const (c := f w)) + unfold SmoothContour.regularizedTransform SmoothContour.cauchyTransform SmoothContour.integral + have he : (∫ t in (0 : ℝ)..1, deriv Γ.path t • dslope f w (Γ.path t)) = + (∫ t in (0 : ℝ)..1, deriv Γ.path t • ((Γ.path t - w)⁻¹ • f (Γ.path t))) - + (∫ t in (0 : ℝ)..1, deriv Γ.path t / (Γ.path t - w)) • f w := by + rw [← intervalIntegral.integral_smul_const, ← intervalIntegral.integral_sub hi hj] + apply intervalIntegral.integral_congr + intro t ht + have hn : Γ.path t ≠ w := fun he => hw ⟨t, by simpa only [uIcc_of_le zero_le_one] using ht, he⟩ + simp only [dslope_of_ne f hn, slope, vsub_eq_sub, smul_sub, smul_smul, div_eq_mul_inv] + rw [he, smul_sub, smul_smul] + rfl + +theorem SmoothContour.eventually_index_eq (Γ : SmoothContour) {w : ℂ} + (hw : w ∉ Γ.trace) : ∀ᶠ z in 𝓝 w, Γ.index z = Γ.index w := by + obtain ⟨r, hr, hrc⟩ := Metric.mem_nhds_iff.mp + (Γ.isCompact_trace.isClosed.isOpen_compl.mem_nhds hw) + filter_upwards [isOpen_ball.mem_nhds (mem_ball_self hr)] with z hz + apply Γ.index_eq_of_segment_avoids + intro t ht he + exact hrc ((convex_ball w r).segment_subset hz (mem_ball_self hr) he) ⟨t, ht, rfl⟩ + +theorem SmoothContour.tendsto_cauchyTransform_cocompact {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : SmoothContour) {f : ℂ → E} (hf : ContinuousOn f Γ.trace) : + Tendsto (Γ.cauchyTransform f) (cocompact ℂ) (𝓝 0) := by + obtain ⟨R, hR⟩ := Γ.isCompact_trace.exists_bound_of_continuousOn continuousOn_id + have hc : ContinuousOn (fun t => deriv Γ.path t • f (Γ.path t)) (Icc (0 : ℝ) 1) := + Γ.smooth.continuous_deriv_one.continuousOn.smul + (hf.comp Γ.smooth.continuous.continuousOn (fun t ht => ⟨t, ht, rfl⟩)) + obtain ⟨M, hM⟩ := isCompact_Icc.exists_bound_of_continuousOn hc + have htop : Tendsto (fun w : ℂ => ‖w‖ - R) (cocompact ℂ) atTop := by + simpa only [sub_eq_add_neg] using + tendsto_atTop_add_const_right (cocompact ℂ) (-R) tendsto_norm_cocompact_atTop + have hb : ∀ᶠ w : ℂ in cocompact ℂ, + ‖∫ t in (0 : ℝ)..1, deriv Γ.path t • ((Γ.path t - w)⁻¹ • f (Γ.path t))‖ ≤ + (‖w‖ - R)⁻¹ * M := by + filter_upwards [htop.eventually_gt_atTop 0] with w hw + have hi := @intervalIntegral.norm_integral_le_of_norm_le_const E _ _ + 0 1 ((‖w‖ - R)⁻¹ * M) + (fun t => deriv Γ.path t • ((Γ.path t - w)⁻¹ • f (Γ.path t))) + simpa only [sub_zero, abs_one, mul_one] using hi (by + intro t ht + have htt : t ∈ Icc (0 : ℝ) 1 := + Ioc_subset_Icc_self (by simpa only [uIoc_of_le zero_le_one] using ht) + have hn : ‖w‖ - R ≤ ‖Γ.path t - w‖ := by + have hne := norm_sub_norm_le w (Γ.path t) + rw [norm_sub_rev] at hne + have hr : ‖Γ.path t‖ ≤ R := hR _ ⟨t, htt, rfl⟩ + linarith + have he : ‖deriv Γ.path t • ((Γ.path t - w)⁻¹ • f (Γ.path t))‖ = + ‖Γ.path t - w‖⁻¹ * ‖deriv Γ.path t • f (Γ.path t)‖ := by + simp only [norm_smul, norm_inv] + ring + rw [he] + exact mul_le_mul (inv_anti₀ hw hn) (hM t htt) (norm_nonneg _) (by positivity)) + have hl : Tendsto (fun w : ℂ => (‖w‖ - R)⁻¹ * M) (cocompact ℂ) (𝓝 0) := by + simpa only [Pi.inv_apply, zero_mul] using htop.inv_tendsto_atTop.mul_const M + have hi := squeeze_zero_norm' hb hl + change Tendsto (fun w : ℂ => (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∫ t in (0 : ℝ)..1, deriv Γ.path t • ((Γ.path t - w)⁻¹ • f (Γ.path t))) + (cocompact ℂ) (𝓝 0) + simpa only [smul_zero] using hi.const_smul (2 * (Real.pi : ℂ) * Complex.I)⁻¹ + +theorem SmoothContour.eventually_index_zero_cocompact (Γ : SmoothContour) : + ∀ᶠ w : ℂ in cocompact ℂ, w ∉ Γ.trace ∧ Γ.index w = 0 := by + obtain ⟨R, hR⟩ := Γ.isCompact_trace.exists_bound_of_continuousOn continuousOn_id + have hsub : Γ.trace ⊆ closedBall (0 : ℂ) R := by + intro z hz + simpa only [mem_closedBall, dist_zero_right, id_eq] using hR z hz + filter_upwards [(isCompact_closedBall (0 : ℂ) R).compl_mem_cocompact] with w hw + exact ⟨fun h => hw (hsub h), Γ.index_eq_zero_of_convex (convex_closedBall 0 R) + isClosed_closedBall hsub hw⟩ + +theorem SmoothContour.tendsto_regularizedTransform_cocompact {E : Type*} + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : SmoothContour) {f : ℂ → E} (hf : ContinuousOn f Γ.trace) : + Tendsto (Γ.regularizedTransform f) (cocompact ℂ) (𝓝 0) := by + apply (Γ.tendsto_cauchyTransform_cocompact hf).congr' + filter_upwards [Γ.eventually_index_zero_cocompact] with w hw + rw [Γ.regularizedTransform_eq hf hw.1, hw.2, zero_smul, sub_zero] + +theorem sum_regularizedTransform_eq_zero {ι E : Type*} [Fintype ι] + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : ι → SmoothContour) (c : ι → ℂ) {U : Set ℂ} (hU : IsOpen U) + (hΓ : ∀ i, (Γ i).trace ⊆ U) + (hnull : ∀ w ∉ U, ∑ i, c i * (Γ i).index w = 0) + {f : ℂ → E} (hf : DifferentiableOn ℂ f U) (w : ℂ) : + ∑ i, c i • (Γ i).regularizedTransform f w = 0 := by + let g : ℂ → E := fun z => ∑ i, c i • (Γ i).regularizedTransform f z + have hfc (i : ι) : ContinuousOn f (Γ i).trace := hf.continuousOn.mono (hΓ i) + have heq (v : ℂ) (hv : ∀ i, v ∉ (Γ i).trace) : g v = + (∑ i, c i • (Γ i).cauchyTransform f v) - (∑ i, c i * (Γ i).index v) • f v := by + dsimp only [g] + simp_rw [(Γ _).regularizedTransform_eq (hfc _) (hv _), smul_sub, smul_smul] + rw [Finset.sum_sub_distrib, Finset.sum_smul] + have hd : Differentiable ℂ g := by + intro v + by_cases hv : v ∈ U + · apply DifferentiableAt.fun_sum + intro i _ + exact ((Γ i).differentiableOn_regularizedTransform hU (hΓ i) hf + |>.differentiableAt (hU.mem_nhds hv)).const_smul (c i) + · have hvΓ (i : ι) : v ∉ (Γ i).trace := fun hi => hv (hΓ i hi) + have hc : DifferentiableAt ℂ (fun z => ∑ i, c i • (Γ i).cauchyTransform f z) v := by + apply DifferentiableAt.fun_sum + intro i _ + exact ((Γ i).differentiableOn_cauchyTransform (hfc i) + |>.differentiableAt ((Γ i).isCompact_trace.isClosed.isOpen_compl.mem_nhds (hvΓ i))).const_smul (c i) + apply hc.congr_of_eventuallyEq + have hi (i : ι) : ∀ᶠ z in 𝓝 v, z ∉ (Γ i).trace ∧ (Γ i).index z = (Γ i).index v := + (show ∀ᶠ z in 𝓝 v, z ∉ (Γ i).trace from + (Γ i).isCompact_trace.isClosed.isOpen_compl.mem_nhds (hvΓ i)).and + ((Γ i).eventually_index_eq (hvΓ i)) + filter_upwards [eventually_all.mpr hi] with z hz + rw [heq z (fun i => (hz i).1)] + have he : (∑ i, c i * (Γ i).index z) = 0 := by + simpa only [(hz _).2] using hnull v hv + rw [he, zero_smul, sub_zero] + have ht : Tendsto g (cocompact ℂ) (𝓝 0) := by + have hti (i : ι) := ((Γ i).tendsto_regularizedTransform_cocompact (hfc i)).const_smul (c i) + simpa only [g, smul_zero, Finset.sum_const_zero] using tendsto_finsetSum Finset.univ (fun i _ => hti i) + exact hd.apply_eq_of_tendsto_cocompact w ht + +theorem sum_integral_eq_zero_of_null_homology {ι E : Type*} [Fintype ι] + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (Γ : ι → SmoothContour) (c : ι → ℂ) {U : Set ℂ} (hU : IsOpen U) + (hΓ : ∀ i, (Γ i).trace ⊆ U) + (hnull : ∀ w ∉ U, ∑ i, c i * (Γ i).index w = 0) + {f : ℂ → E} (hf : DifferentiableOn ℂ f U) : + ∑ i, c i • (Γ i).integral f = 0 := by + have he := sum_regularizedTransform_eq_zero Γ c hU hΓ hnull + (differentiableOn_id.fun_smul hf) 0 + convert! he using 1 + apply Finset.sum_congr rfl + intro i _ + congr 1 + unfold SmoothContour.regularizedTransform SmoothContour.integral + congr 1 + apply intervalIntegral.integral_congr + intro t ht + change deriv (Γ i).path t • f ((Γ i).path t) = + deriv (Γ i).path t • dslope (fun z => z • f z) 0 ((Γ i).path t) + congr 1 + have htU : (Γ i).path t ∈ U := hΓ i ⟨t, by simpa only [uIcc_of_le zero_le_one] using ht, rfl⟩ + by_cases hz : (Γ i).path t = 0 + · rw [hz, dslope_same] + have hd := (hasDerivAt_id (0 : ℂ)).fun_smul + ((hf.differentiableAt (hU.mem_nhds (hz ▸ htU))).hasDerivAt) + simpa only [id_eq, one_smul, zero_smul, zero_add] using hd.deriv.symm + · rw [dslope_of_ne _ hz] + simp only [slope, vsub_eq_sub, sub_zero, zero_smul, inv_smul_smul₀ hz] + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Hurwitz.lean b/lean/OAI/Analysis/Crouzeix/Hurwitz.lean new file mode 100644 index 0000000000000000000000000000000000000000..eee357170d2771167fe487b0f4ecb191c354df0b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Hurwitz.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Montel + +namespace OAI + +/-! Hurwitz. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +namespace CrouzeixHilbert.Conformal + +theorem zero_or_ne_of_tendstoLocallyUniformlyOn {ι : Type*} {l : Filter ι} [l.NeBot] + {U : Set ℂ} (hU : IsOpen U) (hc : IsPreconnected U) + {F : ι → ℂ → ℂ} {f : ℂ → ℂ} (hlim : TendstoLocallyUniformlyOn F f l U) + (hd : ∀ i, DifferentiableOn ℂ (F i) U) + (hz : ∀ i z, z ∈ U → F i z ≠ 0) : + EqOn f 0 U ∨ ∀ z ∈ U, f z ≠ 0 := by + classical + by_cases heq : EqOn f 0 U + · exact Or.inl heq + refine Or.inr (fun a ha hfa => ?_) + have han := (hlim.differentiableOn (Eventually.of_forall hd) hU).analyticOnNhd hU + rcases (han a ha).eventually_eq_zero_or_eventually_ne_zero with he | hn + · exact heq (han.eqOn_zero_of_preconnected_of_eventuallyEq_zero hc ha he) + have hh : ∀ᶠ z in 𝓝 a, z ∈ U ∧ (z ≠ a → f z ≠ 0) := by + filter_upwards [hU.mem_nhds ha, eventually_nhdsWithin_iff.mp hn] with z hz1 hz2 + exact ⟨hz1, hz2⟩ + obtain ⟨R, hR, hRsub⟩ := Metric.mem_nhds_iff.mp hh + let r := R / 2 + have hr : 0 < r := by dsimp [r]; positivity + have hrR : r < R := by dsimp [r]; linarith + have hsU : closedBall a r ⊆ U := fun z hz => + (hRsub (closedBall_subset_ball hrR hz)).1 + have hsz : ∀ z ∈ sphere a r, f z ≠ 0 := by + intro z hz1 + apply (hRsub (closedBall_subset_ball hrR (sphere_subset_closedBall hz1))).2 + intro he + subst z + have hh : (0 : ℝ) = r := by simpa using hz1 + exact hr.ne' hh.symm + obtain ⟨b, hb, hmin⟩ := (isCompact_sphere a r).exists_isMinOn + (NormedSpace.sphere_nonempty.mpr hr.le) + (han.continuousOn.norm.mono (sphere_subset_closedBall.trans hsU)) + let δ := ‖f b‖ + have hδ : 0 < δ := norm_pos_iff.mpr (hsz b hb) + have hconv : TendstoUniformlyOn F f l (sphere a r) := + (tendstoLocallyUniformlyOn_iff_forall_isCompact hU).mp hlim (sphere a r) + (sphere_subset_closedBall.trans hsU) (isCompact_sphere a r) + have hbound : ∀ᶠ i in l, δ / 2 ≤ ‖F i a‖ := by + filter_upwards [(Metric.tendstoUniformlyOn_iff.mp hconv) (δ / 2) (by positivity)] with i hi + have hlow : ∀ z ∈ sphere a r, δ / 2 ≤ ‖F i z‖ := by + intro z hz1 + have hmi : δ ≤ ‖f z‖ := hmin hz1 + have herr : ‖f z - F i z‖ < δ / 2 := by simpa [dist_eq_norm] using hi z hz1 + have := norm_sub_norm_le (f z) (F i z) + linarith + have hi' : ‖(F i a)⁻¹‖ ≤ (δ / 2)⁻¹ := by + refine Complex.norm_le_of_forall_mem_frontier_norm_le + (f := fun z => (F i z)⁻¹) (z := a) (isBounded_ball (x := a) (r := r)) ?_ ?_ ?_ + · apply DifferentiableOn.diffContOnCl + rw [closure_ball a hr.ne'] + apply DifferentiableOn.inv + · exact (hd i).mono hsU + · exact fun z hz1 => hz i z (hsU hz1) + · intro z hz1 + rw [frontier_ball a hr.ne'] at hz1 + rw [norm_inv] + exact inv_anti₀ (by positivity) (hlow z hz1) + · exact subset_closure (mem_ball_self hr) + rw [norm_inv] at hi' + exact (inv_le_inv₀ (norm_pos_iff.mpr (hz i a ha)) (by positivity)).mp hi' + have hle := ge_of_tendsto (hlim.tendsto_at ha).norm hbound + rw [hfa, norm_zero] at hle + linarith + +theorem injOn_of_tendstoLocallyUniformlyOn {ι : Type*} {l : Filter ι} [l.NeBot] + {U : Set ℂ} (hU : IsOpen U) (hc : IsPreconnected U) + {F : ι → ℂ → ℂ} {f : ℂ → ℂ} (hlim : TendstoLocallyUniformlyOn F f l U) + (hd : ∀ i, DifferentiableOn ℂ (F i) U) (hi : ∀ i, InjOn (F i) U) + (hnc : ¬ ∃ c, EqOn f (fun _ => c) U) : InjOn f U := by + intro a ha b hb hab + by_contra hne + have hnb : a ∈ U ∩ {b}ᶜ := ⟨ha, hne⟩ + obtain ⟨r, hr, hsub⟩ := Metric.isOpen_iff.mp (hU.inter isClosed_singleton.isOpen_compl) a hnb + have hsubU : ball a r ⊆ U := fun _ hz => (hsub hz).1 + have hl : TendstoLocallyUniformlyOn (fun i z => F i z - F i b) + (fun z => f z - f b) l (ball a r) := by + have hconst := ((hlim.tendsto_at hb).tendstoUniformlyOn_const (s := ball a r)).tendstoLocallyUniformlyOn + exact (uniformContinuous_fst.sub uniformContinuous_snd).comp_tendstoLocallyUniformlyOn + ((hlim.mono hsubU).prodMk hconst) + have hdz : ∀ i, DifferentiableOn ℂ (fun z => F i z - F i b) (ball a r) := + fun i => ((hd i).mono hsubU).sub_const _ + have hzero : ∀ i z, z ∈ ball a r → F i z - F i b ≠ 0 := by + intro i z hz he + exact (hsub hz).2 (hi i (hsubU hz) hb (sub_eq_zero.mp he)) + rcases zero_or_ne_of_tendstoLocallyUniformlyOn isOpen_ball (convex_ball a r).isPreconnected + hl hdz hzero with he | hn + · apply hnc + refine ⟨f b, ?_⟩ + apply (hlim.differentiableOn (Eventually.of_forall hd) hU).analyticOnNhd hU + |>.eqOn_of_preconnected_of_eventuallyEq analyticOnNhd_const hc ha + filter_upwards [ball_mem_nhds a hr] with z hz + exact sub_eq_zero.mp (he hz) + · exact hn a (mem_ball_self hr) (sub_eq_zero.mpr hab) + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/InteriorCollar.lean b/lean/OAI/Analysis/Crouzeix/InteriorCollar.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a3778e7f3d89f2fa4733315cda37bc635574c14 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/InteriorCollar.lean @@ -0,0 +1,65 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ConformalCollar + +namespace OAI + +/-! Interior Collar. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex + +namespace CrouzeixHilbert.Conformal + +structure InteriorCollar (U : Set ℂ) where + domain : Set ℂ + isOpen_domain : IsOpen domain + closure_subset_domain : closure U ⊆ domain + radius : ℝ + one_lt_radius : 1 < radius + f : ℂ → ℂ + h : ℂ → ℂ + analytic_f : AnalyticOnNhd ℂ f domain + analytic_h : AnalyticOnNhd ℂ h (ball 0 radius) + injective_f : InjOn f domain + injective_h : InjOn h (ball 0 radius) + bijective_f : BijOn f U (ball 0 1) + bijective_h : BijOn h (ball 0 1) U + closed_f : BijOn f (closure U) (closedBall 0 1) + closed_h : BijOn h (closedBall 0 1) (closure U) + inverse : InvOn h f domain (f '' domain) + disk_subset : ball 0 radius ⊆ f '' domain + boundary_norm : ∀ z ∈ frontier U, ‖f z‖ = 1 + +theorem exists_interiorCollar {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hc : IsSimplyConnected U) (hne : U.Nonempty) + (hchart : ∀ p ∈ frontier U, Nonempty (BoundaryChart U p)) : Nonempty (InteriorCollar U) := by + obtain ⟨a,ha⟩ := hne + obtain ⟨V,ρ,f,h,hV,hUV,hρ,hfa,hha,hfi,hhi,hfb,hhb,hfc,hhc,_,_,_,hfn,hinv,hd⟩ := + exists_conformal_collar hU hb hc ha hchart + exact ⟨⟨V,hV,hUV,ρ,hρ,f,h,hfa,hha,hfi,hhi,hfb,hhb,hfc,hhc,hinv,hd,hfn⟩⟩ + +namespace InteriorCollar + +variable {U : Set ℂ} (R : InteriorCollar U) + +lemma zero_mem_disk : (0 : ℂ) ∈ ball 0 R.radius := mem_ball_zero_iff.mpr (by simpa using R.one_lt_radius.trans' zero_lt_one) + +lemma h_zero_mem : R.h 0 ∈ U := R.bijective_h.mapsTo (mem_ball_self zero_lt_one) + +lemma f_h_zero : R.f (R.h 0) = 0 := R.inverse.2 (R.disk_subset R.zero_mem_disk) + +lemma closedDisk_subset : closedBall (0 : ℂ) 1 ⊆ ball 0 R.radius := closedBall_subset_ball R.one_lt_radius + +lemma h_mem_domain {z : ℂ} (hz : z ∈ ball 0 R.radius) : R.h z ∈ R.domain := by + obtain ⟨w,hw,hwz⟩ := R.disk_subset hz + rw [← hwz, R.inverse.1 hw] + exact hw + +end InteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Iteration.lean b/lean/OAI/Analysis/Crouzeix/Iteration.lean new file mode 100644 index 0000000000000000000000000000000000000000..52449631a6f33083b5eadf2ba816240a2bc9bb92 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Iteration.lean @@ -0,0 +1,83 @@ +import Mathlib +import OAI.Analysis.Crouzeix.SteinMetric + +namespace OAI + +/-! Iteration. -/ + +noncomputable section + +open Filter + +open scoped Topology + +namespace CrouzeixHilbert.Realization + +section Iteration + +variable {A : Type*} [NormedRing A] [NormOneClass A] [NormedAlgebra ℂ A] [CompleteSpace A] + +omit [NormedAlgebra ℂ A] [CompleteSpace A] in +lemma norm_pow_contraction (a : A) (ha : ‖a‖ ≤ 1) (j : ℕ) : ‖a ^ j‖ ≤ 1 := by + exact (norm_pow_le a j).trans (by simpa only [one_pow] using pow_le_pow_left₀ (norm_nonneg a) ha j) + +theorem summable_two_sided_series (D C a : A) (hD : spectralRadius ℂ D < 1) + (ha : ‖a‖ ≤ 1) : Summable (fun j : ℕ => D ^ j * C * a ^ j) := by + apply ((Metric.summable_norm_pow D hD).mul_right ‖C‖).of_norm_bounded + intro j + calc + ‖D ^ j * C * a ^ j‖ ≤ ‖D ^ j * C‖ * ‖a ^ j‖ := norm_mul_le _ _ + _ ≤ ‖D ^ j * C‖ * 1 := mul_le_mul_of_nonneg_left (norm_pow_contraction a ha j) (norm_nonneg _) + _ ≤ ‖D ^ j‖ * ‖C‖ := by simpa only [mul_one] using norm_mul_le (D ^ j) C + +theorem tendsto_two_sided_remainder (D L a : A) (hD : spectralRadius ℂ D < 1) + (ha : ‖a‖ ≤ 1) : Tendsto (fun j : ℕ => D ^ j * L * a ^ j) atTop (𝓝 0) := by + apply tendsto_zero_iff_norm_tendsto_zero.mpr + refine squeeze_zero (fun _ => norm_nonneg _) ?_ ?_ (g := fun j => ‖D ^ j‖ * ‖L‖) + · intro j + calc + ‖D ^ j * L * a ^ j‖ ≤ ‖D ^ j * L‖ * ‖a ^ j‖ := norm_mul_le _ _ + _ ≤ ‖D ^ j * L‖ * 1 := mul_le_mul_of_nonneg_left (norm_pow_contraction a ha j) (norm_nonneg _) + _ ≤ ‖D ^ j‖ * ‖L‖ := by simpa only [mul_one] using norm_mul_le (D ^ j) L + · simpa only [zero_mul] using (Metric.summable_norm_pow D hD).tendsto_atTop_zero.mul_const ‖L‖ + +omit [NormOneClass A] [NormedAlgebra ℂ A] [CompleteSpace A] in +theorem finite_recurrence (D L C a : A) (hL : L = D * L * a + C) (N : ℕ) : + L = (∑ j ∈ Finset.range N, D ^ j * C * a ^ j) + D ^ N * L * a ^ N := by + induction N with + | zero => simp + | succ N ih => + rw [Finset.sum_range_succ, pow_succ D N, pow_succ' a N] + calc + L = (∑ j ∈ Finset.range N, D ^ j * C * a ^ j) + D ^ N * L * a ^ N := ih + _ = (∑ j ∈ Finset.range N, D ^ j * C * a ^ j) + D ^ N * (D * L * a + C) * a ^ N := by + conv_lhs => arg 2; arg 1; arg 2; rw [hL] + _ = _ := by noncomm_ring + +theorem eq_two_sided_series (D L C a : A) (hD : spectralRadius ℂ D < 1) + (ha : ‖a‖ ≤ 1) (hL : L = D * L * a + C) : + L = ∑' j : ℕ, D ^ j * C * a ^ j := by + have hs := summable_two_sided_series D C a hD ha + have ht := hs.tendsto_sum_tsum_nat.add (tendsto_two_sided_remainder D L a hD ha) + simp only [← finite_recurrence D L C a hL, add_zero] at ht + exact tendsto_nhds_unique tendsto_const_nhds ht + +theorem eq_realization_series (D L X Y a b c d : A) (hD : spectralRadius ℂ D < 1) + (ha : ‖a‖ ≤ 1) (hL : L = D * L * a + X * c) (hY : Y = D * L * b + X * d) : + Y = X * d + ∑' j : ℕ, D ^ (j + 1) * X * c * a ^ j * b := by + have hs := summable_two_sided_series D (X * c) a hD ha + rw [hY, eq_two_sided_series D L (X * c) a hD ha hL, add_comm] + congr 1 + rw [← Summable.tsum_mul_left D hs, ← Summable.tsum_mul_right b (hs.mul_left D)] + apply tsum_congr + intro j + rw [pow_succ'] + noncomm_ring + +end Iteration + +end CrouzeixHilbert.Realization + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/LaurentSplit.lean b/lean/OAI/Analysis/Crouzeix/LaurentSplit.lean new file mode 100644 index 0000000000000000000000000000000000000000..086c8e148bfcb675d17a59ae01a65aaaf753be69 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/LaurentSplit.lean @@ -0,0 +1,66 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Faber + +namespace OAI + +/-! Laurent Split. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +namespace CrouzeixHilbert.Conformal + +lemma exists_finite_principal_part {V : Set ℂ} (hV : IsOpen V) (h0V : (0 : ℂ) ∈ V) + (n : ℕ) {h : ℂ → ℂ} (hh : DifferentiableOn ℂ h V) : + ∃ (p : Polynomial ℂ) (q : ℂ → ℂ), DifferentiableOn ℂ q V ∧ q 0 = 0 ∧ + ∀ t : ℂ, t ≠ 0 → t⁻¹ ∈ V → t^n * h t⁻¹ = p.eval t + q t⁻¹ := by + induction n generalizing h with + | zero => + refine ⟨Polynomial.C (h 0), fun u => h u - h 0, hh.sub_const _, sub_self _, ?_⟩ + intro t ht htV + simp + | succ n ih => + have hd : DifferentiableOn ℂ (dslope h 0) V := + (differentiableOn_dslope (hV.mem_nhds h0V)).mpr hh + obtain ⟨p,q,hq,hq0,he⟩ := ih hd + refine ⟨Polynomial.C (h 0) * Polynomial.X^(n+1) + p, q, hq, hq0, ?_⟩ + intro t ht htV + have hh' : h t⁻¹ = h 0 + t⁻¹ * dslope h 0 t⁻¹ := by + rw [dslope_of_ne _ (inv_ne_zero ht), slope_def_field] + simp only [sub_zero] + field_simp + ring + rw [hh', mul_add, pow_succ] + have hp : t^n * t * (t⁻¹ * dslope h 0 t⁻¹) = t^n * dslope h 0 t⁻¹ := by + field_simp + rw [hp, he t ht htV] + simp only [Polynomial.eval_add, Polynomial.eval_mul, Polynomial.eval_C, + Polynomial.eval_pow, Polynomial.eval_X, pow_succ] + ring + +namespace ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +lemma power_finite_principal_part (n : ℕ) : + ∃ (p : Polynomial ℂ) (q : ℂ → ℂ), DifferentiableOn ℂ q C.reciprocalDisk ∧ q 0 = 0 ∧ + ∀ t : ℂ, C.radius < ‖t‖ → (C.G t)^n = p.eval t + q t⁻¹ := by + have hh : DifferentiableOn ℂ (fun u => (C.leading + u * C.regular u)^n) C.reciprocalDisk := + ((differentiableOn_const _).add + (differentiableOn_id.mul C.regular_analytic.differentiableOn)).pow n + obtain ⟨p,q,hq,hq0,he⟩ := exists_finite_principal_part isOpen_ball + (mem_ball_self (inv_pos.mpr C.radius_pos)) n hh + refine ⟨p,q,hq,hq0,fun t ht => ?_⟩ + have ht0 := norm_pos_iff.mp (C.radius_pos.trans ht) + rw [← he t ht0 (C.inverse_mem_reciprocalDisk ht), ← mul_pow, C.laurent t ht] + congr 1 + field_simp + +end ExteriorCollar + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Main.lean b/lean/OAI/Analysis/Crouzeix/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..5b8c7ebb301abe2ab64237d26ca6804f8d0bd3b7 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Main.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.Crouzeix.Definitions +import OAI.Analysis.Crouzeix.NumericalRange +import OAI.Analysis.Crouzeix.FiniteCompression +import OAI.Analysis.Crouzeix.RationalEvaluation +import OAI.Analysis.Crouzeix.Sharpness +import OAI.Analysis.Crouzeix.Convexity +import OAI.Analysis.Crouzeix.Amplification +import OAI.Analysis.Crouzeix.ResolventBounds +import OAI.Analysis.Crouzeix.ConvexNeighborhood +import OAI.Analysis.Crouzeix.MatrixContours +import OAI.Analysis.Crouzeix.ContourHomotopy +import OAI.Analysis.Crouzeix.ContourPolynomials +import OAI.Analysis.Crouzeix.RationalContours +import OAI.Analysis.Crouzeix.ContourExistence +import OAI.Analysis.Crouzeix.PolynomialApproximation +import OAI.Analysis.Crouzeix.HomologicalCauchy +import OAI.Analysis.Crouzeix.HilbertExtension +import OAI.Analysis.Crouzeix.PoissonExtension +import OAI.Analysis.Crouzeix.HarmonicMaximum +import OAI.Analysis.Crouzeix.HarmonicReflection +import OAI.Analysis.Crouzeix.ReflectionDerivative +import OAI.Analysis.Crouzeix.HolomorphicReflection +import OAI.Analysis.Crouzeix.Montel +import OAI.Analysis.Crouzeix.Hurwitz +import OAI.Analysis.Crouzeix.DiskAutomorphism +import OAI.Analysis.Crouzeix.Riemann +import OAI.Analysis.Crouzeix.Univalent +import OAI.Analysis.Crouzeix.BoundaryModulus +import OAI.Analysis.Crouzeix.BoundaryChart +import OAI.Analysis.Crouzeix.BoundaryPatching +import OAI.Analysis.Crouzeix.CollarUnivalence +import OAI.Analysis.Crouzeix.ConformalCollar +import OAI.Analysis.Crouzeix.InteriorCollar +import OAI.Analysis.Crouzeix.BoundaryForms +import OAI.Analysis.Crouzeix.Fourier +import OAI.Analysis.Crouzeix.BoundaryOperators +import OAI.Analysis.Crouzeix.CircleCoordinate +import OAI.Analysis.Crouzeix.SeparateHolomorphic +import OAI.Analysis.Crouzeix.SteinMetric +import OAI.Analysis.Crouzeix.Realization +import OAI.Analysis.Crouzeix.RationalTransfer +import OAI.Analysis.Crouzeix.Endpoint +import OAI.Analysis.Crouzeix.Iteration +import OAI.Analysis.Crouzeix.MatrixEndpoint +import OAI.Analysis.Crouzeix.Vectorization +import OAI.Analysis.Crouzeix.BlockPolynomial +import OAI.Analysis.Crouzeix.EndpointInterpolation +import OAI.Analysis.Crouzeix.DiskEndpoint +import OAI.Analysis.Crouzeix.Resolvent +import OAI.Analysis.Crouzeix.DiskCalculus +import OAI.Analysis.Crouzeix.Compression +import OAI.Analysis.Crouzeix.TensorDensity +import OAI.Analysis.Crouzeix.Density +import OAI.Analysis.Crouzeix.DensityCompatibility +import OAI.Analysis.Crouzeix.BoundaryFibers +import OAI.Analysis.Crouzeix.CauchyProjection +import OAI.Analysis.Crouzeix.CircleAnalytic +import OAI.Analysis.Crouzeix.AngularRadius +import OAI.Analysis.Crouzeix.ConvexCoordinates +import OAI.Analysis.Crouzeix.DiskBoundaryChart +import OAI.Analysis.Crouzeix.ConvexApproximation +import OAI.Analysis.Crouzeix.ExteriorRiemann +import OAI.Analysis.Crouzeix.ExteriorBoundaryChart +import OAI.Analysis.Crouzeix.ExteriorCollar +import OAI.Analysis.Crouzeix.ExteriorNormal +import OAI.Analysis.Crouzeix.ExteriorKernel +import OAI.Analysis.Crouzeix.BoundaryKernel +import OAI.Analysis.Crouzeix.ExteriorContour +import OAI.Analysis.Crouzeix.Faber +import OAI.Analysis.Crouzeix.LaurentSplit +import OAI.Analysis.Crouzeix.PhysicalFourier +import OAI.Analysis.Crouzeix.PhysicalProjection +import OAI.Analysis.Crouzeix.DiskHolomorphic +import OAI.Analysis.Crouzeix.HolomorphicAlgebra +import OAI.Analysis.Crouzeix.PhysicalModule +import OAI.Analysis.Crouzeix.AngularTransport +import OAI.Analysis.Crouzeix.AngularMoments +import OAI.Analysis.Crouzeix.AngularMeasure +import OAI.Analysis.Crouzeix.SimilarityRepresentation +import OAI.Analysis.Crouzeix.PhysicalComparison +import OAI.Analysis.Crouzeix.PhysicalDensity +import OAI.Analysis.Crouzeix.HolomorphicSpectrum +import OAI.Analysis.Crouzeix.FunctionalComposition +import OAI.Analysis.Crouzeix.PhysicalCalculus +import OAI.Analysis.Crouzeix.ResolventMoments +import OAI.Analysis.Crouzeix.BoundaryMoments +import OAI.Analysis.Crouzeix.MetricBoundary +import OAI.Analysis.Crouzeix.CompleteFinite +import OAI.Analysis.Crouzeix.HilbertInequality diff --git a/lean/OAI/Analysis/Crouzeix/MatrixContours.lean b/lean/OAI/Analysis/Crouzeix/MatrixContours.lean new file mode 100644 index 0000000000000000000000000000000000000000..43167c4219cf27e0e204a59f2dc14a4cac5ee8b4 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/MatrixContours.lean @@ -0,0 +1,203 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ResolventBounds + +namespace OAI + +/-! Matrix Contours. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace Topology + +open Set Filter + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +local instance matrixContourOperatorRealNormedSpace (m : ℕ) : + NormedSpace ℝ (Operator (Amplification H m)) := + NormedSpace.restrictScalars ℝ ℂ _ + +def tensorCoefficientCLM (A : Operator H) (m : ℕ) : + Coeff m →L[ℂ] Operator (Amplification H m) := by + let L : Coeff m →ₗ[ℂ] Operator (Amplification H m) := + { toFun := fun B => tensorOperator A B + map_add' := by + intro B C + apply ContinuousLinearMap.ext + intro v + refine UniformSpace.Completion.induction_on v + (isClosed_eq (tensorOperator A (B + C)).continuous + ((tensorOperator A B).continuous.add (tensorOperator A C).continuous)) ?_ + intro a + simp only [tensorOperator, map_add, TensorProduct.mapL_add_right, + ContinuousLinearMap.completion_apply_coe, add_apply, + UniformSpace.Completion.coe_add] + map_smul' := by + intro c B + apply ContinuousLinearMap.ext + intro v + refine UniformSpace.Completion.induction_on v + (isClosed_eq (tensorOperator A (c • B)).continuous + ((tensorOperator A B).continuous.const_smul c)) ?_ + intro a + simp only [tensorOperator, map_smul, TensorProduct.mapL_smul_right, + ContinuousLinearMap.completion_apply_coe, smul_apply, + UniformSpace.Completion.coe_smul, RingHom.id_apply] } + exact L.mkContinuous ‖A‖ (fun B => norm_tensorOperator_le A B) + +@[simp] +theorem tensorCoefficientCLM_apply (A : Operator H) {m : ℕ} (B : Coeff m) : + tensorCoefficientCLM A m B = tensorOperator A B := rfl + +theorem sum_tensorOperator_entries (A : Operator H) {m : ℕ} (B : Coeff m) : + (∑ i, ∑ j, tensorOperator (B i j • A) (Matrix.single i j 1)) = tensorOperator A B := by + have hsum : (∑ i, ∑ j, B i j • Matrix.single i j (1 : ℂ)) = B := by + simpa only [Matrix.smul_single, smul_eq_mul, mul_one] using (Matrix.matrix_eq_sum_single B).symm + calc + _ = ∑ i, ∑ j, B i j • tensorCoefficientCLM A m (Matrix.single i j 1) := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + exact map_smul (tensorOperatorCLM (Matrix.single i j 1)) (B i j) A + _ = tensorCoefficientCLM A m (∑ i, ∑ j, B i j • Matrix.single i j 1) := by + simp only [map_sum, map_smul] + _ = tensorOperator A B := by rw [hsum]; rfl + +theorem matrixContourEval_eq_integral [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {m : ℕ} {F : ℂ → Coeff m} + (hF : ContinuousOn F Γ.toSmoothContour.trace) : + matrixContourEval A Γ.toSmoothContour F = + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∫ t in (0 : ℝ)..1, tensorOperator (contourKernel A Γ.toSmoothContour t) (F (Γ.path t)) := by + let k := contourKernel A Γ.toSmoothContour + let g (i j : Fin m) (t : ℝ) := F (Γ.path t) i j • k t + let T (i j : Fin m) := tensorOperatorCLM (H := H) (Matrix.single i j 1) + have hg (i j : Fin m) : ContinuousOn (g i j) (Icc (0 : ℝ) 1) := + (((matrixEntryCLM i j).continuous.comp_continuousOn hF).comp + Γ.smooth.continuous.continuousOn (fun t ht => mem_image_of_mem _ ht)).smul + (continuousOn_contourKernel A Γ) + have hi (i j : Fin m) : IntervalIntegrable (g i j) MeasureTheory.volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using hg i j + have hTi (i j : Fin m) : + IntervalIntegrable (fun t => T i j (g i j t)) MeasureTheory.volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one, Function.comp_def] using! + (T i j).continuous.comp_continuousOn (hg i j) + have hTiSum (i : Fin m) : IntervalIntegrable (fun t => ∑ j, T i j (g i j t)) + MeasureTheory.volume (0 : ℝ) 1 := by + have hcc : ContinuousOn (fun t => ∑ j, T i j (g i j t)) (Icc (0 : ℝ) 1) := by + apply continuousOn_finsetSum + intro j _ + exact (T i j).continuous.comp_continuousOn (hg i j) + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using! hcc + have hsum : (∑ i, ∑ j, T i j (∫ t in (0 : ℝ)..1, g i j t)) = + ∫ t in (0 : ℝ)..1, ∑ i, ∑ j, T i j (g i j t) := by + simp_rw [← ContinuousLinearMap.intervalIntegral_comp_comm _ (hi _ _)] + rw [intervalIntegral.integral_finsetSum (fun i _ => hTiSum i)] + apply Finset.sum_congr rfl + intro i _ + exact (intervalIntegral.integral_finsetSum (fun j _ => hTi i j)).symm + calc + _ = (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∑ i, ∑ j, T i j (∫ t in (0 : ℝ)..1, g i j t) := by + unfold matrixContourEval + simp only [contourEval_eq_kernel, ← tensorOperatorCLM_apply, map_smul, + Finset.smul_sum, T, g, k] + _ = (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∫ t in (0 : ℝ)..1, ∑ i, ∑ j, T i j (g i j t) := by rw [hsum] + _ = _ := by + congr 1 + apply intervalIntegral.integral_congr + intro t _ + exact sum_tensorOperator_entries (k t) (F (Γ.path t)) + +def SmoothContour.arcLength (Γ : SmoothContour) : ℝ := + ∫ t in (0 : ℝ)..1, ‖deriv Γ.path t‖ + +theorem SmoothContour.arcLength_nonneg (Γ : SmoothContour) : 0 ≤ Γ.arcLength := + intervalIntegral.integral_nonneg zero_le_one (fun _ _ => norm_nonneg _) + +theorem norm_matrixContourEval_le [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {m : ℕ} {F : ℂ → Coeff m} + (hF : ContinuousOn F Γ.toSmoothContour.trace) : + ‖matrixContourEval A Γ.toSmoothContour F‖ ≤ + (Γ.toSmoothContour.arcLength / (2 * Real.pi)) * + supNorm Γ.toSmoothContour.trace (fun z => Ring.inverse (algebraMap ℂ (Operator H) z - A)) * + supNorm Γ.toSmoothContour.trace F := by + let res := fun z => Ring.inverse (algebraMap ℂ (Operator H) z - A) + let M := supNorm Γ.toSmoothContour.trace res + let S := supNorm Γ.toSmoothContour.trace F + have hr : ContinuousOn res Γ.toSmoothContour.trace := + (continuousOn_resolvent A).mono (by + rintro z ⟨t, ht, rfl⟩ + exact (Γ.avoids t ht).2) + have hbM := supNorm_bddAbove Γ.toSmoothContour.isCompact_trace hr + have hbS := supNorm_bddAbove Γ.toSmoothContour.isCompact_trace hF + have hm : 0 ≤ M := supNorm_nonneg hbM + have hbound : ∀ t ∈ Icc (0 : ℝ) 1, + ‖tensorOperator (contourKernel A Γ.toSmoothContour t) (F (Γ.path t))‖ ≤ + ‖deriv Γ.path t‖ * M * S := by + intro t ht + have htrace : Γ.path t ∈ Γ.toSmoothContour.trace := mem_image_of_mem _ ht + calc + _ ≤ ‖contourKernel A Γ.toSmoothContour t‖ * ‖F (Γ.path t)‖ := norm_tensorOperator_le _ _ + _ = (‖deriv Γ.path t‖ * ‖res (Γ.path t)‖) * ‖F (Γ.path t)‖ := by + rw [contourKernel, norm_smul] + _ ≤ (‖deriv Γ.path t‖ * M) * S := + mul_le_mul (mul_le_mul_of_nonneg_left (norm_le_supNorm hbM htrace) (norm_nonneg _)) + (norm_le_supNorm hbS htrace) (norm_nonneg _) (mul_nonneg (norm_nonneg _) hm) + have hi : IntervalIntegrable (fun t => ‖deriv Γ.path t‖ * M * S) + MeasureTheory.volume (0 : ℝ) 1 := + ((Γ.smooth.continuous_deriv_one.norm.mul_const M).mul_const S).intervalIntegrable _ _ + have hn := intervalIntegral.norm_integral_le_of_norm_le zero_le_one + (Filter.Eventually.of_forall (fun t ht => hbound t ⟨ht.1.le, ht.2⟩)) hi + have hn' : ‖∫ t in (0 : ℝ)..1, + tensorOperator (contourKernel A Γ.toSmoothContour t) (F (Γ.path t))‖ ≤ + Γ.toSmoothContour.arcLength * M * S := by + simpa only [intervalIntegral.integral_mul_const, SmoothContour.arcLength] using hn + have hc : ‖(2 * (Real.pi : ℂ) * Complex.I)⁻¹‖ = (2 * Real.pi)⁻¹ := by + simp + rw [matrixContourEval_eq_integral A Γ hF, norm_smul, hc] + calc + _ ≤ (2 * Real.pi)⁻¹ * (Γ.toSmoothContour.arcLength * M * S) := + mul_le_mul_of_nonneg_left hn' (inv_nonneg.mpr (by positivity)) + _ = (Γ.toSmoothContour.arcLength / (2 * Real.pi)) * M * S := by ring + +theorem matrixContourEval_sub [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {m : ℕ} {F G : ℂ → Coeff m} + (hF : ContinuousOn F Γ.toSmoothContour.trace) + (hG : ContinuousOn G Γ.toSmoothContour.trace) : + matrixContourEval A Γ.toSmoothContour (F - G) = + matrixContourEval A Γ.toSmoothContour F - matrixContourEval A Γ.toSmoothContour G := by + have he (i j : Fin m) : + contourEval A Γ.toSmoothContour (fun z => (F z - G z) i j) = + contourEval A Γ.toSmoothContour (fun z => F z i j) - + contourEval A Γ.toSmoothContour (fun z => G z i j) := + contourEval_sub A Γ ((matrixEntryCLM i j).continuous.comp_continuousOn hF) + ((matrixEntryCLM i j).continuous.comp_continuousOn hG) + simp only [matrixContourEval, Pi.sub_apply, he, ← tensorOperatorCLM_apply, + map_sub, Finset.sum_sub_distrib] + +theorem norm_matrixContourEval_sub_le [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {m : ℕ} {F G : ℂ → Coeff m} + (hF : ContinuousOn F Γ.toSmoothContour.trace) + (hG : ContinuousOn G Γ.toSmoothContour.trace) : + ‖matrixContourEval A Γ.toSmoothContour F - matrixContourEval A Γ.toSmoothContour G‖ ≤ + (Γ.toSmoothContour.arcLength / (2 * Real.pi)) * + supNorm Γ.toSmoothContour.trace (fun z => Ring.inverse (algebraMap ℂ (Operator H) z - A)) * + supNorm Γ.toSmoothContour.trace (F - G) := by + rw [← matrixContourEval_sub A Γ hF hG] + exact norm_matrixContourEval_le A Γ (hF.sub hG) + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/MatrixEndpoint.lean b/lean/OAI/Analysis/Crouzeix/MatrixEndpoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..90b3c2ecc9b67a0e949c4e273a28dd38b889506f --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/MatrixEndpoint.lean @@ -0,0 +1,251 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Endpoint +import OAI.Analysis.Crouzeix.Iteration +import OAI.Analysis.Crouzeix.Realization + +namespace OAI + +/-! Matrix Endpoint. -/ + +noncomputable section + +open Set Filter + +open scoped InnerProductSpace Matrix MatrixOrder Matrix.Norms.L2Operator ComplexOrder + +namespace CrouzeixHilbert.Endpoint + +open Boundary + +theorem eq_zero_of_trace_pair_zero {n : ℕ} (X : Matrix (Fin n) (Fin n) ℂ) + (hX : X.IsHermitian) + (h : ∀ J : Herm (Matrix (Fin n) (Fin n) ℂ), (X * J.val).trace.re = 0) : X = 0 := by + have hh := h ⟨X, hX⟩ + change (X * X).trace.re = 0 at hh + nth_rw 1 [← hX.eq] at hh + rw [trace_conjTranspose_mul_re] at hh + have hn : ‖toHS X‖ = 0 := (sq_eq_zero_iff).mp hh + have hz := norm_eq_zero.mp hn + exact congrArg ofHS hz + +structure MatrixCertificate {n : ℕ} (T : Matrix (Fin n) (Fin n) ℂ) + (τ : ℝ) (H : Matrix (Fin n) (Fin n) ℂ) where + X : Matrix (Fin n) (Fin n) ℂ + Y : Matrix (Fin n) (Fin n) ℂ + Z : Matrix (Fin n) (Fin n) ℂ + X_positive : X.PosSemidef + Y_positive : Y.PosSemidef + Z_positive : Z.PosSemidef + X_trace : X.trace.re = 1 + Y_trace : Y.trace.re = τ + balance : X - Y = Z - T * Z * Tᴴ + Y_slack : (Y * (H - 1)).trace.re = 0 + X_slack : (X * (τ • 1 - H)).trace.re = 0 + Z_slack : (Z * (H - Tᴴ * H * T)).trace.re = 0 + +theorem exists_matrixCertificate {n : ℕ} (T : Matrix (Fin n) (Fin n) ℂ) + (hT : spectralRadius ℂ T < 1) {τ : ℝ} (H : Matrix (Fin n) (Fin n) ℂ) + (hH : Metric.Feasible T τ H) + (hmin : ∀ s J, Metric.Feasible T s J → τ ≤ s) : + Nonempty (MatrixCertificate T τ H) := by + obtain ⟨C⟩ := exists_dualCertificate T hT ⟨H, hH.selfAdjoint⟩ hH hmin + obtain ⟨X, hX, hx⟩ := exists_positive_trace_representative C.X C.X_positive + obtain ⟨Y, hY, hy⟩ := exists_positive_trace_representative C.Y C.Y_positive + obtain ⟨Z, hZ, hz⟩ := exists_positive_trace_representative C.Z C.Z_positive + refine ⟨⟨X,Y,Z,hX,hY,hZ,?_,?_,?_,?_,?_,?_⟩⟩ + · simpa only [hx, unit_val, mul_one] using C.X_unit + · simpa only [hy, unit_val, mul_one] using C.Y_unit + · apply sub_eq_zero.mp + apply eq_zero_of_trace_pair_zero _ + ((hX.isHermitian.sub hY.isHermitian).sub + (hZ.isHermitian.sub (hZ.mul_mul_conjTranspose_same T).isHermitian)) + intro J + have h := C.balance J + rw [hx, hy, hz, hz] at h + change (X * J.val).trace.re - (Y * J.val).trace.re = + (Z * J.val).trace.re - (Z * (Tᴴ * J.val * T)).trace.re at h + have he : (Z * (Tᴴ * J.val * T)).trace = (T * Z * Tᴴ * J.val).trace := by + rw [Matrix.trace_mul_cycle', ← mul_assoc, ← mul_assoc] + rw [he] at h + simp only [sub_mul, Matrix.trace_sub, Complex.sub_re] + linarith + · have h := C.Y_slack + rw [hy] at h + exact h + · have h := C.X_slack + rw [hx] at h + exact h + · have h := C.Z_slack + rw [hz] at h + exact h + +theorem trace_mul_eq_norm_sqrt_sq {n : ℕ} (B C : Matrix (Fin n) (Fin n) ℂ) + (hB : B.PosSemidef) (hC : C.PosSemidef) : + (B * C).trace.re = ‖toHS (CFC.sqrt C * CFC.sqrt B)‖ ^ 2 := by + have hBS : (CFC.sqrt B)ᴴ = CFC.sqrt B := + (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg B)).isHermitian.eq + have hCS : (CFC.sqrt C)ᴴ = CFC.sqrt C := + (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg C)).isHermitian.eq + rw [← trace_conjTranspose_mul_re, Matrix.conjTranspose_mul, hBS, hCS] + have he : CFC.sqrt B * CFC.sqrt C * (CFC.sqrt C * CFC.sqrt B) = + CFC.sqrt B * C * CFC.sqrt B := by + calc + _ = CFC.sqrt B * (CFC.sqrt C * CFC.sqrt C) * CFC.sqrt B := by simp only [mul_assoc] + _ = _ := by rw [CFC.sqrt_mul_sqrt_self C hC.nonneg] + rw [he, Matrix.trace_mul_cycle, CFC.sqrt_mul_sqrt_self B hB.nonneg] + +theorem mul_sqrt_eq_zero_of_trace_mul_eq_zero {n : ℕ} + (B C : Matrix (Fin n) (Fin n) ℂ) (hB : B.PosSemidef) (hC : C.PosSemidef) + (h : (B * C).trace.re = 0) : C * CFC.sqrt B = 0 := by + rw [trace_mul_eq_norm_sqrt_sq B C hB hC] at h + have hz : CFC.sqrt C * CFC.sqrt B = 0 := by + have hn : ‖toHS (CFC.sqrt C * CFC.sqrt B)‖ = 0 := sq_eq_zero_iff.mp h + exact congrArg ofHS (norm_eq_zero.mp hn) + rw [← CFC.sqrt_mul_sqrt_self C hC.nonneg, mul_assoc, hz, mul_zero] + +theorem mul_eq_zero_of_trace_mul_eq_zero {n : ℕ} + (B C : Matrix (Fin n) (Fin n) ℂ) (hB : B.PosSemidef) (hC : C.PosSemidef) + (h : (B * C).trace.re = 0) : C * B = 0 := by + rw [← CFC.sqrt_mul_sqrt_self B hB.nonneg, ← mul_assoc, + mul_sqrt_eq_zero_of_trace_mul_eq_zero B C hB hC h, zero_mul] + +theorem sqrt_mul_eigen {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + (H X : A) (hH : 0 ≤ H) {t : ℝ} (ht : 0 < t) (hX : H * X = (t ^ 2) • X) : + CFC.sqrt H * X = t • X := by + have hu : IsUnit (CFC.sqrt H + t • (1 : A)) := + (IsStrictlyPositive.nonneg_add (CFC.sqrt_nonneg H) + (IsStrictlyPositive.smul ht isStrictlyPositive_one)).isUnit + have hz : (CFC.sqrt H + t • (1 : A)) * (CFC.sqrt H * X - t • X) = 0 := by + calc + _ = CFC.sqrt H * CFC.sqrt H * X - (t * t) • X := by + simp only [add_mul, mul_sub, mul_smul_comm, smul_mul_assoc, one_mul, mul_assoc] + module + _ = 0 := by rw [CFC.sqrt_mul_sqrt_self H hH, ← sq, hX, sub_self] + have he := congrArg (Ring.inverse (CFC.sqrt H + t • (1 : A)) * ·) hz + rw [← mul_assoc, Ring.inverse_mul_cancel _ hu, one_mul, mul_zero] at he + exact sub_eq_zero.mp he + +theorem gram_congruence {n : ℕ} (S X : Matrix (Fin n) (Fin n) ℂ) + (hS : S.IsHermitian) {t : ℝ} (hX : S * X = t • X) : + S * (X * Xᴴ) * S = (t ^ 2) • (X * Xᴴ) := by + have hXR : Xᴴ * S = t • Xᴴ := by + simpa only [Matrix.conjTranspose_mul, Matrix.conjTranspose_smul, star_trivial, hS.eq] using + congrArg Matrix.conjTranspose hX + calc + _ = (S * X) * (Xᴴ * S) := by simp only [mul_assoc] + _ = _ := by rw [hX, hXR, smul_mul_assoc, mul_smul_comm, smul_smul, sq] + +structure EndpointFactors {n : ℕ} (T : Matrix (Fin n) (Fin n) ℂ) + (κ : ℝ) (H : Matrix (Fin n) (Fin n) ℂ) where + X : Matrix (Fin n) (Fin n) ℂ + Y : Matrix (Fin n) (Fin n) ℂ + Q : Matrix (Fin n) (Fin n) ℂ + X_norm : ‖toHS X‖ = 1 + Y_norm : ‖toHS Y‖ = 1 + X_endpoint : CFC.sqrt H * X = κ • X + Y_endpoint : CFC.sqrt H * Y = Y + perpendicular : Xᴴ * Y = 0 + Q_positive : Q.PosSemidef + balance : X * Xᴴ - Y * Yᴴ = Q - + (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)) * Q * + (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H))ᴴ + +theorem exists_endpointFactors {n : ℕ} (T : Matrix (Fin n) (Fin n) ℂ) + {κ : ℝ} (hκ : 1 < κ) (H : Matrix (Fin n) (Fin n) ℂ) + (hH : Metric.Feasible T (κ ^ 2) H) (C : MatrixCertificate T (κ ^ 2) H) : + Nonempty (EndpointFactors T κ H) := by + let S := CFC.sqrt H + let R := Ring.inverse S + let X := CFC.sqrt C.X + let Y₀ := CFC.sqrt C.Y + let Y := κ⁻¹ • Y₀ + let Q := (κ⁻¹ ^ 2) • (S * C.Z * S) + have hk : 0 < κ := zero_lt_one.trans hκ + have hS : S.IsHermitian := (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg H)).isHermitian + have hX : X.IsHermitian := (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg C.X)).isHermitian + have hY : Y₀.IsHermitian := (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg C.Y)).isHermitian + have hXX : X * Xᴴ = C.X := by rw [hX.eq]; exact CFC.sqrt_mul_sqrt_self _ C.X_positive.nonneg + have hYY : Y₀ * Y₀ᴴ = C.Y := by rw [hY.eq]; exact CFC.sqrt_mul_sqrt_self _ C.Y_positive.nonneg + have hHX : H * X = κ ^ 2 • X := by + have hp : (κ ^ 2 • (1 : Matrix (Fin n) (Fin n) ℂ) - H).PosSemidef := by + apply Matrix.nonneg_iff_posSemidef.mp + apply sub_nonneg.mpr + simpa only [Algebra.algebraMap_eq_smul_one] using hH.upper + have h := mul_sqrt_eq_zero_of_trace_mul_eq_zero _ _ C.X_positive hp C.X_slack + rw [sub_mul, smul_mul_assoc, one_mul] at h + exact (sub_eq_zero.mp h).symm + have hHY : H * Y₀ = Y₀ := by + have hp : (H - 1).PosSemidef := Matrix.nonneg_iff_posSemidef.mp (sub_nonneg.mpr hH.lower) + have h := mul_sqrt_eq_zero_of_trace_mul_eq_zero _ _ C.Y_positive hp C.Y_slack + rw [sub_mul, one_mul] at h + exact sub_eq_zero.mp h + have hSX : S * X = κ • X := sqrt_mul_eigen H X hH.nonneg hk hHX + have hSY : S * Y₀ = Y₀ := by + simpa only [one_smul] using sqrt_mul_eigen H Y₀ hH.nonneg zero_lt_one + (by simpa only [one_pow, one_smul] using hHY) + have hnormX : ‖toHS X‖ ^ 2 = 1 := by + rw [← trace_conjTranspose_mul_re, hX.eq] + nth_rw 2 [← hX.eq] + rw [hXX, C.X_trace] + have hnormY₀ : ‖toHS Y₀‖ ^ 2 = κ ^ 2 := by + rw [← trace_conjTranspose_mul_re, hY.eq] + nth_rw 2 [← hY.eq] + rw [hYY, C.Y_trace] + have hnormY : ‖toHS Y‖ ^ 2 = 1 := by + change ‖hsEquiv n (κ⁻¹ • Y₀)‖ ^ 2 = 1 + rw [map_smul, norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hk.le), + mul_pow, hsEquiv_apply, hnormY₀] + field_simp + have hGramX : X * Xᴴ = (κ⁻¹ ^ 2) • (S * C.X * S) := by + rw [← hXX, gram_congruence S X hS hSX, smul_smul] + simp [hk.ne'] + have hGramY : Y * Yᴴ = (κ⁻¹ ^ 2) • (S * C.Y * S) := by + have hs : S * (Y₀ * Y₀ᴴ) * S = Y₀ * Y₀ᴴ := by + simpa only [one_smul, one_pow] using gram_congruence S Y₀ hS + (show S * Y₀ = (1 : ℝ) • Y₀ by simpa only [one_smul]) + rw [← hYY, hs] + simp only [Y, Matrix.conjTranspose_smul, star_trivial, smul_mul_assoc, + mul_smul_comm, smul_smul, sq] + have hQ : Q.PosSemidef := by + have hs := C.Z_positive.mul_mul_conjTranspose_same S + rw [hS.eq] at hs + exact Matrix.nonneg_iff_posSemidef.mp (smul_nonneg (sq_nonneg (κ⁻¹)) hs.nonneg) + have hu : IsUnit S := hH.isStrictlyPositive.isUnit_cfcSqrt H + have hRS : R * S = 1 := Ring.inverse_mul_cancel S hu + have hSR : S * R = 1 := Ring.mul_inverse_cancel S hu + have hR : R.IsHermitian := (IsSelfAdjoint.of_nonneg + ((CFC.ringInverse_nonneg_iff_nonneg_of_isUnit hu).mpr (CFC.sqrt_nonneg H))).isHermitian + have hconj : (S * T * R) * (S * C.Z * S) * (S * T * R)ᴴ = S * (T * C.Z * Tᴴ) * S := by + rw [Matrix.conjTranspose_mul, Matrix.conjTranspose_mul, hS.eq, hR.eq] + calc + _ = (S * T) * (R * S) * C.Z * (S * R) * (Tᴴ * S) := by noncomm_ring + _ = _ := by rw [hRS, hSR, mul_one, mul_one]; simp only [mul_assoc] + refine ⟨⟨X,Y,Q,?_,?_,hSX,?_,?_,hQ,?_⟩⟩ + · nlinarith [norm_nonneg (toHS X)] + · nlinarith [norm_nonneg (toHS Y)] + · change S * Y = Y + simp only [Y, mul_smul_comm, hSY] + · have hXR : Xᴴ * S = κ • Xᴴ := by + simpa only [Matrix.conjTranspose_mul, Matrix.conjTranspose_smul, star_trivial, hS.eq] using + congrArg Matrix.conjTranspose hSX + have he : (κ - 1) • (Xᴴ * Y) = 0 := by + rw [sub_smul, one_smul, ← smul_mul_assoc, ← hXR, mul_assoc] + simp only [Y, mul_smul_comm, hSY, sub_self] + exact (smul_eq_zero.mp he).resolve_left (sub_ne_zero.mpr hκ.ne') + · change X * Xᴴ - Y * Yᴴ = Q - (S * T * R) * Q * (S * T * R)ᴴ + rw [hGramX, hGramY, ← smul_sub, ← sub_mul, ← mul_sub, C.balance] + simp only [mul_sub, sub_mul, smul_sub, Q, mul_smul_comm, smul_mul_assoc, hconj] + +theorem endpointFactors_of_minimum {n : ℕ} (T : Matrix (Fin n) (Fin n) ℂ) + (hT : spectralRadius ℂ T < 1) {κ : ℝ} (hκ : 1 < κ) + (H : Matrix (Fin n) (Fin n) ℂ) (hH : Metric.Feasible T (κ ^ 2) H) + (hmin : ∀ s J, Metric.Feasible T s J → κ ^ 2 ≤ s) : + Nonempty (EndpointFactors T κ H) := by + obtain ⟨C⟩ := exists_matrixCertificate T hT H hH hmin + exact exists_endpointFactors T hκ H hH C + +end CrouzeixHilbert.Endpoint + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/MetricBoundary.lean b/lean/OAI/Analysis/Crouzeix/MetricBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..64ba0b410e1bd4733fb32089a5f16c3421c16eec --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/MetricBoundary.lean @@ -0,0 +1,156 @@ +import Mathlib +import OAI.Analysis.Crouzeix.BoundaryMoments + +namespace OAI + +/-! Metric Boundary. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +namespace Conformal.InteriorCollar + +variable {U : Set ℂ} (R : InteriorCollar U) + +lemma spectralRadius_coordinate_lt_one + {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] [Nontrivial H] (A : Operator H) (hKU : numericalClosure A ⊆ U) : + spectralRadius ℂ (holomorphicEval A R.domain R.f) < 1 := by + apply spectralRadius_holomorphicEval_lt_one A R.isOpen_domain + (hKU.trans (subset_closure.trans R.closure_subset_domain)) R.analytic_f.differentiableOn + intro z hz + exact mem_ball_zero_iff.mp (R.bijective_f.mapsTo (hKU hz)) + +end Conformal.InteriorCollar + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +variable {n : ℕ} (hn : 0 < n) (A : Operator (EuclideanSpace ℂ (Fin n))) + (hKU : numericalClosure A ⊆ U) (hU : IsOpen U) (hc : Convex ℝ U) + (hb : Bornology.IsBounded U) + +include C hn hKU hU hc hb in +lemma minimizing_metric_sqrt_le_two (κ : ℝ) (H : Coeff n) + (hH : CrouzeixHilbert.Metric.Feasible + (operatorToMatrix n (holomorphicEval A R.domain R.f)) (κ ^ 2) H) + (hmin : ∀ s J, CrouzeixHilbert.Metric.Feasible + (operatorToMatrix n (holomorphicEval A R.domain R.f)) s J → κ ^ 2 ≤ s) : + κ ≤ 2 := by + by_cases hk : κ ≤ 1 + · exact hk.trans (by norm_num) + have hκ : 1 < κ := lt_of_not_ge hk + let : Nonempty (Fin n) := ⟨⟨0,hn⟩⟩ + let e := Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) + let T : Coeff n := operatorToMatrix n (holomorphicEval A R.domain R.f) + change CrouzeixHilbert.Metric.Feasible T (κ ^ 2) H at hH + have hT : spectralRadius ℂ T < 1 := by + simpa only [T, operatorToMatrix_apply, spectralRadius_eq_of_unital, AlgEquiv.spectrum_eq] using + R.spectralRadius_coordinate_lt_one A hKU + let S := e (CFC.sqrt H) + let D := e (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)) + have hN : ‖D‖ ≤ 1 := by + rw [← Matrix.cstar_norm_def] + exact hH.sqrt_similarity.2.1 + have hD : spectralRadius ℂ D < 1 := by + simpa only [D, spectralRadius_eq_of_unital, AlgEquiv.spectrum_eq, hH.sqrt_spectrum] using hT + have hI : S * holomorphicEval A R.domain R.f = D * S := by + have he : e T = holomorphicEval A R.domain R.f := e.apply_symm_apply _ + rw [← he] + change e (CFC.sqrt H) * e T = e _ * e (CFC.sqrt H) + rw [← map_mul, ← map_mul, mul_assoc (CFC.sqrt H * T), + Ring.inverse_mul_cancel _ hH.sqrt_similarity.1, mul_one] + obtain ⟨X,Y,Q,V,_,_,_,_,hXY,hX,hY,hx,hy,hV,hKV,_,hQ,hQV,_,hQI⟩ := + disk_endpoint_extremal hn T hT hκ H hH hmin + let W := R.domain ∩ R.f ⁻¹' V + have hW : IsOpen W := R.analytic_f.continuousOn.isOpen_inter_preimage R.isOpen_domain hV + have hUW : closure U ⊆ W := fun z hz => + ⟨R.closure_subset_domain hz, hKV (R.closed_f.mapsTo hz)⟩ + have hfW : EntrywiseHolomorphic W (matrixRationalFunction Q ∘ R.f) := fun i j => + (hQ i j).comp (R.analytic_f.differentiableOn.mono inter_subset_left) (fun z hz => hz.2) + let F := C.matrixAnalyticTrace hUW (matrixRationalFunction Q ∘ R.f) hfW.continuousOn + have hF : ∀ t, ‖F t‖ ≤ 1 := by + intro t + exact hQV _ (le_of_eq (R.boundary_norm _ (C.boundaryMap_mem_frontier t))) + let F₀ : C(CircleSpace, Coeff n) := + ⟨fun t => matrixRationalFunction Q (circleCoordinate t), + hQ.continuousOn.comp_continuous circleCoordinate.continuous + (fun t => hKV (mem_closedBall_zero_iff.mpr (norm_circleCoordinate t).le))⟩ + have hF₀ : F = F₀.comp (C.interiorAngle R) := by + ext t i j + change matrixRationalFunction Q (R.f (C.boundaryMap t)) i j = + matrixRationalFunction Q (circleCoordinate (C.interiorAngle R t)) i j + rw [C.circleCoordinate_interiorAngle R] + rfl + have hInt : tensorIntegral (C.matrixDensity R D hD) F (vectorization X) = vectorization Y := by + rw [hF₀, C.tensorIntegral_matrixDensity_pullback R D hD hU hc] + change (∫ t, tensorOperator (Disk.phi D t) + (matrixRationalFunction Q (fourier 1 t)) ∂Disk.σ) (vectorization X) = _ + rw [Disk.integral_matrixHolomorphic D hN hD hV hKV hQ] + exact hQI + have hS : IsSelfAdjoint (tensorOperator S (1 : Coeff n)) := by + change star (tensorOperator S (1 : Coeff n)) = tensorOperator S (1 : Coeff n) + rw [← tensorOperator_star, star_one] + have hs : IsSelfAdjoint S := (IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg H)).map e + rw [hs.star_eq] + exact endpoint_le_two_of_physical_tests (C.boundaryOperator hc n) + (C.norm_boundaryOperator_le hc n) (C.matrixResolventDensity A hKU hU) + (C.matrixDensity R D hD) F (C.matrixResolventDensity_posSemidef A hKU hU hc) + (C.matrixDensity_posSemidef R D hD hN) (C.integral_matrixDensity R D hD hU hc) hF + (C.boundaryCauchy_left_module hU hc hb hW hUW hfW hF) + (C.boundaryCauchy_right_module hU hc hb hW hUW hfW hF) + (tensorOperator S (1 : Coeff n)) hS X Y hX hY hXY κ (zero_lt_one.trans hκ) hx hy hInt + (C.physical_laurent_tests A hKU hU R hc D S hN hD hI) + +include C hn hKU hU hc hb in +lemma exists_conformal_contraction : + ∃ S J D : Operator (EuclideanSpace ℂ (Fin n)), + J * S = 1 ∧ S * J = 1 ∧ ‖S‖ * ‖J‖ ≤ 2 ∧ ‖D‖ ≤ 1 ∧ + spectralRadius ℂ D < 1 ∧ S * holomorphicEval A R.domain R.f = D * S := by + let : Nonempty (Fin n) := ⟨⟨0,hn⟩⟩ + let e := Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) + let T : Coeff n := operatorToMatrix n (holomorphicEval A R.domain R.f) + have hT : spectralRadius ℂ T < 1 := by + simpa only [T, operatorToMatrix_apply, spectralRadius_eq_of_unital, AlgEquiv.spectrum_eq] using + R.spectralRadius_coordinate_lt_one A hKU + obtain ⟨τ,H,hH,hτ,hmin⟩ := CrouzeixHilbert.Metric.exists_minimizing_metric T hT + have hτ0 : 0 ≤ τ := zero_le_one.trans hτ + have hκ : Real.sqrt τ ≤ 2 := C.minimizing_metric_sqrt_le_two R hn A hKU hU hc hb + (Real.sqrt τ) H (by simpa only [Real.sq_sqrt hτ0] using hH) + (by simpa only [Real.sq_sqrt hτ0] using hmin) + let S := e (CFC.sqrt H) + let J := e (Ring.inverse (CFC.sqrt H)) + let D := e (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)) + refine ⟨S,J,D,?_,?_,?_,?_,?_,?_⟩ + · change e _ * e _ = 1 + rw [← map_mul, Ring.inverse_mul_cancel _ hH.sqrt_similarity.1, map_one] + · change e _ * e _ = 1 + rw [← map_mul, Ring.mul_inverse_cancel _ hH.sqrt_similarity.1, map_one] + · change ‖e _‖ * ‖e _‖ ≤ 2 + rw [← Matrix.cstar_norm_def, ← Matrix.cstar_norm_def] + exact hH.sqrt_similarity.2.2.trans hκ + · change ‖e _‖ ≤ 1 + rw [← Matrix.cstar_norm_def] + exact hH.sqrt_similarity.2.1 + · simpa only [D, spectralRadius_eq_of_unital, AlgEquiv.spectrum_eq, hH.sqrt_spectrum] using hT + · have he : e T = holomorphicEval A R.domain R.f := e.apply_symm_apply _ + rw [← he] + change e (CFC.sqrt H) * e T = e _ * e (CFC.sqrt H) + rw [← map_mul, ← map_mul, mul_assoc (CFC.sqrt H * T), + Ring.inverse_mul_cancel _ hH.sqrt_similarity.1, mul_one] + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Montel.lean b/lean/OAI/Analysis/Crouzeix/Montel.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f10e6b64b3e776ceadcbff64e6ac70faa2ce33f --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Montel.lean @@ -0,0 +1,114 @@ +import Mathlib + +namespace OAI + +/-! Montel. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +namespace CrouzeixHilbert.Conformal + +theorem norm_deriv_le_on_half_ball {f : ℂ → ℂ} {U : Set ℂ} + (_hU : IsOpen U) (hf : DifferentiableOn ℂ f U) + (hb : ∀ z ∈ U, ‖f z‖ ≤ 1) {x : ℂ} {R : ℝ} (hR : 0 < R) + (hRU : ball x R ⊆ U) {y : ℂ} (hy : y ∈ ball x (R / 2)) : + ‖deriv f y‖ ≤ 1 / (R / 2) := by + have hsub : closedBall y (R / 2) ⊆ U := by + intro z hz + apply hRU + have hy' : dist y x < R / 2 := hy + have hz' : dist z y ≤ R / 2 := hz + exact (dist_triangle z y x).trans_lt (by linarith) + apply Complex.norm_deriv_le_of_forall_mem_sphere_norm_le (by positivity) + · exact (hf.mono (by simpa [closure_ball _ (by positivity : R / 2 ≠ 0)] using hsub)).diffContOnCl + · exact fun z hz => hb z (hsub (sphere_subset_closedBall hz)) + +theorem equicontinuous_restrict_of_holomorphic_bounded {ι : Type*} + {F : ι → ℂ → ℂ} {U : Set ℂ} (hU : IsOpen U) + (hd : ∀ i, DifferentiableOn ℂ (F i) U) + (hb : ∀ i z, z ∈ U → ‖F i z‖ ≤ 1) : + Equicontinuous (fun i (z : U) => F i z) := by + intro x + obtain ⟨R, hR, hRU⟩ := Metric.isOpen_iff.mp hU x x.2 + have hR2 : 0 < R / 2 := by positivity + let C : ℝ := 1 / (R / 2) + have hC : 0 < C := by dsimp [C]; positivity + rw [Metric.equicontinuousAt_iff] + intro ε hε + refine ⟨min (R / 2) (ε / C), lt_min hR2 (div_pos hε hC), ?_⟩ + intro y hy i + have hyR : (y : ℂ) ∈ ball (x : ℂ) (R / 2) := lt_of_lt_of_le hy (min_le_left _ _) + have hbound : ‖F i y - F i x‖ ≤ C * ‖(y : ℂ) - x‖ := by + apply (convex_ball (x : ℂ) (R / 2)).norm_image_sub_le_of_norm_deriv_le + · intro z hz + exact (hd i).differentiableAt (hU.mem_nhds (hRU (Metric.ball_subset_ball (by linarith) hz))) + · intro z hz + exact norm_deriv_le_on_half_ball hU (hd i) (hb i) hR hRU hz + · exact mem_ball_self hR2 + · exact hyR + rw [dist_comm, dist_eq_norm] + apply hbound.trans_lt + apply (lt_div_iff₀' hC).1 + simpa [Subtype.dist_eq, dist_eq_norm] using (lt_of_lt_of_le hy (min_le_right _ _) : dist y x < ε / C) + +def extend (U : Set ℂ) (f : U → ℂ) (z : ℂ) : ℂ := by + classical + exact if h : z ∈ U then f ⟨z, h⟩ else 0 + +@[simp] theorem extend_apply {U : Set ℂ} (f : U → ℂ) (z : U) : + extend U f z = f z := by simp [extend, z.2] + +theorem montel {U : Set ℂ} (hU : IsOpen U) (F : ℕ → ℂ → ℂ) + (hd : ∀ n, DifferentiableOn ℂ (F n) U) + (hb : ∀ n z, z ∈ U → ‖F n z‖ ≤ 1) : + ∃ (f : ℂ → ℂ) (φ : ℕ → ℕ), StrictMono φ ∧ + TendstoLocallyUniformlyOn (F ∘ φ) f atTop U ∧ + DifferentiableOn ℂ f U ∧ ∀ z ∈ U, ‖f z‖ ≤ 1 := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + let : T2Space (UniformOnFun U ℂ {K | IsCompact K}) := + UniformOnFun.t2Space_of_covering (Set.eq_univ_iff_forall.mpr (fun x => + mem_sUnion_of_mem (mem_singleton x) isCompact_singleton)) + let S : Set C(U, ℂ) := {f | DifferentiableOn ℂ (extend U f) U ∧ ∀ z, ‖f z‖ ≤ 1} + have heq : Equicontinuous (fun (f : S) (z : U) => (f : C(U, ℂ)) z) := by + simpa using equicontinuous_restrict_of_holomorphic_bounded hU + (fun (f : S) => f.2.1) (fun (f : S) z hz => by + simpa [extend, hz] using f.2.2 ⟨z, hz⟩) + have hc : IsCompact (closure S) := by + apply ArzelaAscoli.isCompact_closure_of_isClosedEmbedding + (F := fun (f : C(U, ℂ)) => (f : U → ℂ)) (𝔖 := {K | IsCompact K}) + (fun _ hK => hK) + ContinuousMap.isUniformEmbedding_toUniformOnFunIsCompact.isClosedEmbedding + · exact fun K _ => heq.equicontinuousOn K + · intro K _ x _ + exact ⟨closedBall 0 1, isCompact_closedBall 0 1, fun f hf => by + simpa using hf.2 x⟩ + let G : ℕ → C(U, ℂ) := fun n => ⟨fun z => F n z, (hd n).continuousOn.domRestrict⟩ + have hGS : ∀ n, G n ∈ S := by + intro n + constructor + · apply (hd n).congr + intro z hz + exact extend_apply (G n) ⟨z, hz⟩ + · exact fun z => hb n z z.2 + obtain ⟨g, _, φ, hφ, hlim⟩ := hc.tendsto_subseq (fun n => subset_closure (hGS n)) + have hconv : TendstoLocallyUniformlyOn (F ∘ φ) (extend U g) atTop U := by + rw [tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe] + have hl := ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp hlim + change TendstoLocallyUniformly (fun i (z : U) => F (φ i) z) g atTop at hl + convert hl using 1 + · funext i z + rfl + · funext z + exact extend_apply g z + refine ⟨extend U g, φ, hφ, hconv, hconv.differentiableOn + (Eventually.of_forall (fun n => hd (φ n))) hU, ?_⟩ + intro z hz + exact le_of_tendsto' (hconv.tendsto_at hz).norm (fun n => hb (φ n) z hz) + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/NumericalRange.lean b/lean/OAI/Analysis/Crouzeix/NumericalRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a2e395e6d9899c37fc5c5d74b8f730fffb34f65 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/NumericalRange.lean @@ -0,0 +1,239 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Definitions + +namespace OAI + +/-! Compact numerical closure, supremum norms, and spectral containment. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem norm_le_of_mem_numericalRange (A : Operator H) {z : ℂ} + (hz : z ∈ numericalRange A) : ‖z‖ ≤ ‖A‖ := by + obtain ⟨x, hx, rfl⟩ := hz + calc + ‖⟪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 : Operator 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 : Operator H) : + numericalClosure A ⊆ Metric.closedBall 0 ‖A‖ := + closure_minimal (numericalRange_subset_closedBall A) Metric.isClosed_closedBall + +theorem isCompact_numericalClosure (A : Operator H) : IsCompact (numericalClosure A) := + (isCompact_closedBall (0 : ℂ) ‖A‖).of_isClosed_subset isClosed_closure + (numericalClosure_subset_closedBall A) + +theorem numericalRange_nonempty [Nontrivial H] (A : Operator H) : + (numericalRange A).Nonempty := by + obtain ⟨x, hx⟩ := exists_norm_eq H (show (0 : ℝ) ≤ 1 by norm_num) + exact ⟨⟪x, A x⟫_ℂ, x, hx, rfl⟩ + +theorem numericalClosure_nonempty [Nontrivial H] (A : Operator H) : + (numericalClosure A).Nonempty := + (numericalRange_nonempty A).mono subset_closure + +@[simp] +theorem numericalRange_eq_empty [Subsingleton H] (A : Operator H) : + numericalRange A = ∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + rintro z ⟨x, hx, _⟩ + have : x = 0 := Subsingleton.elim _ _ + simp [this] at hx + +@[simp] +theorem supNorm_empty {E : Type*} [NormedAddCommGroup E] (F : ℂ → E) : + supNorm ∅ F = 0 := by simp [supNorm] + +instance amplificationSubsingleton [Subsingleton H] (m : ℕ) : + Subsingleton (Amplification H m) := by + have hz (x : Amplification H m) : x = 0 := by + refine UniformSpace.Completion.induction_on x + (isClosed_eq continuous_id continuous_const) ?_ + intro a + rw [Subsingleton.elim a 0, UniformSpace.Completion.coe_zero] + exact ⟨fun x y => (hz x).trans (hz y).symm⟩ + +theorem zeroConclusion [Subsingleton H] (A : Operator H) : ZeroConclusion A := by + have hemp := numericalRange_eq_empty A + have hzero : ∀ m (T : Operator (Amplification H m)), T = 0 := by + intro m T + exact Subsingleton.elim _ _ + refine ⟨hemp, ?_, ?_, ?_⟩ + · intro m d B + rw [hzero m (polynomialEval A B), hemp, supNorm_empty] + simp + · intro m U F + rw [hzero m (matrixHolomorphicEval A U F), hemp, supNorm_empty] + simp + · intro m R + rw [hzero m (matrixRationalEval A R), hemp, supNorm_empty] + simp + +theorem supNorm_le {E : Type*} [NormedAddCommGroup E] {S : Set ℂ} + {F : ℂ → E} {C : ℝ} (hC : 0 ≤ C) (hF : ∀ z ∈ S, ‖F z‖ ≤ C) : + supNorm S F ≤ C := by + apply csSup_le ⟨0, by simp⟩ + intro b hb + rcases hb with rfl | ⟨z, hz, rfl⟩ + · exact hC + · exact hF z hz + +theorem supNorm_bddAbove {E : Type*} [NormedAddCommGroup E] {S : Set ℂ} + {F : ℂ → E} (hS : IsCompact S) (hF : ContinuousOn F S) : + BddAbove (insert 0 ((fun z => ‖F z‖) '' S)) := + (hS.bddAbove_image hF.norm).insert 0 + +theorem supNorm_nonneg {E : Type*} [NormedAddCommGroup E] {S : Set ℂ} + {F : ℂ → E} (hb : BddAbove (insert 0 ((fun z => ‖F z‖) '' S))) : + 0 ≤ supNorm S F := + le_csSup hb (by simp) + +theorem norm_le_supNorm {E : Type*} [NormedAddCommGroup E] {S : Set ℂ} + {F : ℂ → E} (hb : BddAbove (insert 0 ((fun z => ‖F z‖) '' S))) + {z : ℂ} (hz : z ∈ S) : ‖F z‖ ≤ supNorm S F := + le_csSup hb (Set.mem_insert_of_mem 0 ⟨z, hz, rfl⟩) + +theorem supNorm_mono {E : Type*} [NormedAddCommGroup E] {S T : Set ℂ} + {F : ℂ → E} (hST : S ⊆ T) + (hb : BddAbove (insert 0 ((fun z => ‖F z‖) '' T))) : + supNorm S F ≤ supNorm T F := by + apply csSup_le_csSup hb ⟨0, by simp⟩ + exact Set.insert_subset_insert (Set.image_mono hST) + +theorem supNorm_attained {E : Type*} [NormedAddCommGroup E] {S : Set ℂ} + {F : ℂ → E} (hS : IsCompact S) (hne : S.Nonempty) (hF : ContinuousOn F S) : + ∃ z ∈ S, supNorm S F = ‖F z‖ := by + obtain ⟨z, hz, hmax⟩ := hS.exists_isMaxOn hne hF.norm + refine ⟨z, hz, le_antisymm ?_ ?_⟩ + · exact supNorm_le (norm_nonneg _) hmax + · exact norm_le_supNorm (supNorm_bddAbove hS hF) hz + +theorem supNorm_closure {E : Type*} [NormedAddCommGroup E] {S : Set ℂ} + {F : ℂ → E} (hS : IsCompact (closure S)) (hF : ContinuousOn F (closure S)) : + supNorm S F = supNorm (closure S) F := by + have hbK := supNorm_bddAbove hS hF + have hsub : insert 0 ((fun z => ‖F z‖) '' S) ⊆ + insert 0 ((fun z => ‖F z‖) '' closure S) := + Set.insert_subset_insert (Set.image_mono subset_closure) + have hbS := hbK.mono hsub + apply le_antisymm (supNorm_mono subset_closure hbK) + have hc : IsClosed (closure S ∩ (fun z => ‖F z‖) ⁻¹' Iic (supNorm S F)) := + hF.norm.preimage_isClosed_of_isClosed isClosed_closure isClosed_Iic + have hs : S ⊆ closure S ∩ (fun z => ‖F z‖) ⁻¹' Iic (supNorm S F) := by + intro z hz + exact ⟨subset_closure hz, norm_le_supNorm hbS hz⟩ + apply supNorm_le (supNorm_nonneg hbS) + intro z hz + exact (closure_minimal hs hc hz).2 + +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 _).smul continuous_const + +theorem polynomial_sup_eq_max [Nontrivial H] (A : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + supNorm (numericalRange A) (matrixPolynomial B) = + supNorm (numericalClosure A) (matrixPolynomial B) ∧ + ∃ z ∈ numericalClosure A, + supNorm (numericalClosure A) (matrixPolynomial B) = ‖matrixPolynomial B z‖ := by + have hc : ContinuousOn (matrixPolynomial B) (numericalClosure A) := + (continuous_matrixPolynomial B).continuousOn + exact ⟨supNorm_closure (isCompact_numericalClosure A) hc, + supNorm_attained (isCompact_numericalClosure A) (numericalClosure_nonempty A) hc⟩ + +theorem operator_lower_bound_of_inner (T : Operator H) {δ : ℝ} + (hδ : ∀ x : H, ‖x‖ = 1 → δ ≤ ‖⟪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 v : H := (‖x‖ : ℂ)⁻¹ • x + have hv : ‖v‖ = 1 := by simp [v, norm_smul, hn] + have hb : δ ≤ ‖T v‖ := by + calc + δ ≤ ‖⟪v, T v⟫_ℂ‖ := hδ v hv + _ ≤ ‖v‖ * ‖T v‖ := norm_inner_le_norm _ _ + _ = ‖T v‖ := by rw [hv, one_mul] + calc + δ * ‖x‖ ≤ ‖T v‖ * ‖x‖ := mul_le_mul_of_nonneg_right hb (norm_nonneg _) + _ = ‖T x‖ := by + simp only [v, map_smul, norm_smul, norm_inv, Complex.norm_real, norm_norm] + rw [mul_right_comm, inv_mul_cancel₀ hn, one_mul] + +theorem isUnit_of_inner_lower_bound [CompleteSpace H] (T : Operator H) + {δ : ℝ} (hδpos : 0 < δ) (hb : ∀ x : H, ‖x‖ = 1 → δ ≤ ‖⟪x, T x⟫_ℂ‖) : + IsUnit T := by + have lower := operator_lower_bound_of_inner T hb + have lowerAdj : ∀ y, δ * ‖y‖ ≤ ‖(ContinuousLinearMap.adjoint T) y‖ := by + apply operator_lower_bound_of_inner + intro y hy + rw [T.adjoint_inner_right, norm_inner_symm] + exact hb y hy + let C : NNReal := ⟨δ⁻¹, inv_nonneg.mpr hδpos.le⟩ + have anti : AntilipschitzWith C T := by + apply T.antilipschitz_of_bound + intro x + have hh := mul_le_mul_of_nonneg_left (lower x) (inv_nonneg.mpr hδpos.le) + change ‖x‖ ≤ δ⁻¹ * ‖T x‖ + simpa only [← mul_assoc, inv_mul_cancel₀ hδpos.ne', one_mul] using hh + have hclosed : IsClosed (T.range : Set H) := + anti.isClosed_range T.uniformContinuous + have hak : (ContinuousLinearMap.adjoint T).ker = ⊥ := by + apply LinearMap.ker_eq_bot.mpr + intro x y hxy + change (ContinuousLinearMap.adjoint T) x = (ContinuousLinearMap.adjoint T) y at hxy + have hnorm := lowerAdj (x - y) + have hz : (ContinuousLinearMap.adjoint T) (x - y) = 0 := by + rw [map_sub, hxy, sub_self] + rw [hz, norm_zero] at hnorm + have : ‖x - y‖ ≤ 0 := by nlinarith + exact sub_eq_zero.mp (norm_le_zero_iff.mp this) + have hr : T.range.topologicalClosure = ⊤ := by + rw [Submodule.topologicalClosure_eq_top_iff, T.orthogonal_range, hak] + rw [hclosed.submodule_topologicalClosure_eq] at hr + exact ContinuousLinearMap.isUnit_iff_bijective.mpr + ⟨anti.injective, LinearMap.range_eq_top.mp hr⟩ + +theorem spectrum_subset_numericalClosure [CompleteSpace H] (A : Operator H) : + spectrum ℂ A ⊆ numericalClosure A := by + intro lam hspec + by_contra hlam + have hopen : IsOpen (numericalClosure A)ᶜ := isClosed_closure.isOpen_compl + obtain ⟨δ, hδ, hball⟩ := Metric.isOpen_iff.mp hopen lam hlam + have hsep : ∀ z ∈ numericalRange A, δ ≤ ‖lam - z‖ := by + intro z hz + by_contra hlt + have hb : z ∈ Metric.ball lam δ := by + simpa only [Metric.mem_ball, dist_eq_norm, norm_sub_rev] using lt_of_not_ge hlt + exact hball hb (subset_closure hz) + have hu : IsUnit (algebraMap ℂ (Operator H) lam - A) := by + apply isUnit_of_inner_lower_bound _ hδ + intro x hx + have he : ⟪x, (algebraMap ℂ (Operator H) lam - A) x⟫_ℂ = lam - ⟪x, A x⟫_ℂ := by + simp [ContinuousLinearMap.algebraMap_apply, inner_self_eq_norm_sq_to_K, hx] + rw [he] + exact hsep _ ⟨x, hx, rfl⟩ + exact (spectrum.mem_iff.mp hspec) hu + +end CrouzeixHilbert +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PhysicalCalculus.lean b/lean/OAI/Analysis/Crouzeix/PhysicalCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..a33d1446537b9b592d5f0b225f9ffd95302c0fa0 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PhysicalCalculus.lean @@ -0,0 +1,149 @@ +import Mathlib +import OAI.Analysis.Crouzeix.FunctionalComposition +import OAI.Analysis.Crouzeix.PhysicalDensity + +namespace OAI + +/-! Physical Calculus. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +namespace Conformal.InteriorCollar + +variable {U : Set ℂ} (R : InteriorCollar U) + +def pullbackDomain (V : Set ℂ) : Set ℂ := ball 0 R.radius ∩ R.h ⁻¹' V + +lemma isOpen_pullbackDomain {V : Set ℂ} (hV : IsOpen V) : IsOpen (R.pullbackDomain V) := + R.analytic_h.continuousOn.isOpen_inter_preimage isOpen_ball hV + +lemma closedDisk_subset_pullbackDomain {V : Set ℂ} (hUV : closure U ⊆ V) : + closedBall (0 : ℂ) 1 ⊆ R.pullbackDomain V := fun _ hz => + ⟨R.closedDisk_subset hz,hUV (R.closed_h.mapsTo hz)⟩ + +lemma differentiableOn_pullback {V : Set ℂ} {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f V) : + DifferentiableOn ℂ (f ∘ R.h) (R.pullbackDomain V) := + hf.comp (R.analytic_h.differentiableOn.mono inter_subset_left) (fun _ hz => hz.2) + +def diskTrace {V : Set ℂ} (hUV : closure U ⊆ V) {m : ℕ} (F : ℂ → Coeff m) + (hF : ContinuousOn F V) : C(CircleSpace, Coeff m) := + ⟨fun t => F (R.h (circleCoordinate t)), + hF.comp_continuous + (R.analytic_h.continuousOn.comp_continuous circleCoordinate.continuous + (fun t => R.closedDisk_subset (mem_closedBall_zero_iff.mpr (norm_circleCoordinate t).le))) + (fun t => hUV (R.closed_h.mapsTo (mem_closedBall_zero_iff.mpr (norm_circleCoordinate t).le)))⟩ + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] [Nontrivial H] + +lemma holomorphic_intertwines (A D S : Operator H) (hKU : numericalClosure A ⊆ U) + (hN : ‖D‖ ≤ 1) + (hI : S * holomorphicEval A R.domain R.f = D * S) + {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {g : ℂ → ℂ} (hg : DifferentiableOn ℂ g V) : + S * holomorphicEval A V g = + holomorphicEval D (R.pullbackDomain V) (g ∘ R.h) * S := by + let W := R.domain ∩ R.f ⁻¹' R.pullbackDomain V + have hW : IsOpen W := R.analytic_f.continuousOn.isOpen_inter_preimage R.isOpen_domain + (R.isOpen_pullbackDomain hV) + have hAW : numericalClosure A ⊆ W := fun z hz => + ⟨R.closure_subset_domain (subset_closure (hKU hz)), + R.closedDisk_subset_pullbackDomain hUV (R.closed_f.mapsTo (subset_closure (hKU hz)))⟩ + have hWV : W ⊆ V := fun z hz => by + have hh := hz.2.2 + change R.h (R.f z) ∈ V at hh + rwa [R.inverse.1 hz.1] at hh + have hfW := R.analytic_f.differentiableOn.mono (show W ⊆ R.domain from inter_subset_left) + have hgW : DifferentiableOn ℂ ((g ∘ R.h) ∘ R.f) W := + (R.differentiableOn_pullback hg).comp hfW (fun z hz => hz.2) + have hid : holomorphicEval A W ((g ∘ R.h) ∘ R.f) = holomorphicEval A V g := by + rw [holomorphicEval_congr A hW hAW hgW (hg.mono hWV) + (fun z hz => congrArg g (R.inverse.1 hz.1)), + holomorphicEval_restrict A hW hV hAW hWV hg] + have hiW : S * holomorphicEval A W R.f = D * S := by + rw [holomorphicEval_restrict A hW R.isOpen_domain hAW inter_subset_left R.analytic_f.differentiableOn] + exact hI + have hh := holomorphicEval_comp_intertwines A D S hN hW hAW + (R.isOpen_pullbackDomain hV) (R.closedDisk_subset_pullbackDomain hUV) + hfW (R.differentiableOn_pullback hg) (fun z hz => hz.2) + (fun z hz => R.closed_f.mapsTo (subset_closure (hKU hz))) hiW + rw [hid] at hh + exact hh + +lemma matrixHolomorphic_intertwines (A D S : Operator H) (hKU : numericalClosure A ⊆ U) + (hN : ‖D‖ ≤ 1) (hI : S * holomorphicEval A R.domain R.f = D * S) + {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {m : ℕ} {F : ℂ → Coeff m} (hF : EntrywiseHolomorphic V F) : + tensorOperator S (1 : Coeff m) * matrixHolomorphicEval A V F = + matrixHolomorphicEval D (R.pullbackDomain V) (F ∘ R.h) * tensorOperator S (1 : Coeff m) := by + unfold matrixHolomorphicEval + simp only [Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [← tensorOperator_mul, ← tensorOperator_mul, one_mul, mul_one] + exact congrArg (fun T => tensorOperator T (Matrix.single i j 1)) + (R.holomorphic_intertwines A D S hKU hN hI hV hUV (hF i j)) + +end Conformal.InteriorCollar + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma h_interiorAngle (t : CircleSpace) : + R.h (circleCoordinate (C.interiorAngle R t)) = C.boundaryMap t := by + rw [C.circleCoordinate_interiorAngle] + exact R.inverse.1 (R.closure_subset_domain (C.boundaryMap_mem_frontier t).1) + +local instance physicalCalculusOperatorRealNormedSpace (size : ℕ) : + NormedSpace ℝ (Operator (Amplification H size)) := + NormedSpace.restrictScalars ℝ ℂ _ + +lemma integral_operatorDensity_holomorphic (hU : IsOpen U) (hc : Convex ℝ U) + (D : Operator H) (hN : ‖D‖ ≤ 1) (hD : spectralRadius ℂ D < 1) + {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {m : ℕ} {F : ℂ → Coeff m} (hF : EntrywiseHolomorphic V F) : + (∫ t, tensorOperator (C.operatorDensity R D hD t) (F (C.boundaryMap t)) ∂circleMeasure) = + matrixHolomorphicEval D (R.pullbackDomain V) (F ∘ R.h) := by + let F₀ := R.diskTrace hUV F hF.continuousOn + have he (t : CircleSpace) : F (C.boundaryMap t) = F₀ (C.interiorAngle R t) := by + change _ = F (R.h (circleCoordinate (C.interiorAngle R t))) + rw [C.h_interiorAngle R] + simp_rw [he] + rw [C.integral_operatorDensity_pullback R D hD hU hc] + exact Disk.integral_matrixHolomorphic D hN hD (F := F ∘ R.h) + (R.isOpen_pullbackDomain hV) (R.closedDisk_subset_pullbackDomain hUV) + (fun i j => R.differentiableOn_pullback (hF i j)) + +variable [Nontrivial H] + +lemma physical_intertwines (hU : IsOpen U) (hc : Convex ℝ U) + (A D S : Operator H) (hKU : numericalClosure A ⊆ U) + (hN : ‖D‖ ≤ 1) (hD : spectralRadius ℂ D < 1) + (hI : S * holomorphicEval A R.domain R.f = D * S) + {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {m : ℕ} {F : ℂ → Coeff m} (hF : EntrywiseHolomorphic V F) : + tensorOperator S (1 : Coeff m) * matrixHolomorphicEval A V F = + (∫ t, tensorOperator (C.operatorDensity R D hD t) (F (C.boundaryMap t)) ∂circleMeasure) * + tensorOperator S (1 : Coeff m) := by + rw [C.integral_operatorDensity_holomorphic R hU hc D hN hD hV hUV hF] + exact R.matrixHolomorphic_intertwines A D S hKU hN hI hV hUV hF + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PhysicalComparison.lean b/lean/OAI/Analysis/Crouzeix/PhysicalComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6055c83d10a8b36afa51904fa2b612152a08e41 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PhysicalComparison.lean @@ -0,0 +1,79 @@ +import Mathlib +import OAI.Analysis.Crouzeix.SimilarityRepresentation + +namespace OAI + +/-! Physical Comparison. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace TensorProduct Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert.Boundary + +theorem endpoint_le_two_of_physical_tests {n : ℕ} + (M : BoundaryL2 n →L[ℝ] BoundaryL2 n) (hM : ‖M‖ ≤ 1) + (E Λ F : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).PosSemidef) (hΛ : ∀ t, (Λ t).PosSemidef) + (hmass : ∫ t, Λ t ∂circleMeasure = 1) (hF : ∀ t, ‖F t‖ ≤ 1) + (hleft : (boundaryCauchy M).comp + ((lpLeft F F.continuous.aestronglyMeasurable + (Filter.Eventually.of_forall hF)).comp (boundaryCauchy M)) = + (lpLeft F F.continuous.aestronglyMeasurable + (Filter.Eventually.of_forall hF)).comp (boundaryCauchy M)) + (hright : (boundaryCauchy M).comp + ((lpRight F F.continuous.aestronglyMeasurable + (Filter.Eventually.of_forall hF)).comp (boundaryCauchy M)) = + (lpRight F F.continuous.aestronglyMeasurable + (Filter.Eventually.of_forall hF)).comp (boundaryCauchy M)) + (S : Operator (Amplification (EuclideanSpace ℂ (Fin n)) n)) (hS : IsSelfAdjoint S) + (X Y : Coeff n) (hX : ‖vectorization X‖ = 1) (hY : ‖vectorization Y‖ = 1) + (hXY : Xᴴ * Y = 0) (κ : ℝ) (hκ : 0 < κ) + (hx : S (vectorization X) = (κ : ℂ) • vectorization X) + (hy : S (vectorization Y) = vectorization Y) + (hI : tensorIntegral Λ F (vectorization X) = vectorization Y) + (htest : ∀ (j : ℤ × (Fin n × Fin n)) (c : ℂ), + ∃ (V W : C(CircleSpace, Coeff n)) + (B L : Operator (Amplification (EuclideanSpace ℂ (Fin n)) n)), + boundaryCauchy M (boundaryField (matrixLaurentMonomial j c)) = boundaryField V ∧ + boundaryCauchy M (lpStar (boundaryField (matrixLaurentMonomial j c))) = + boundaryField W ∧ + tensorIntegral E (matrixLaurentMonomial j c) = B + L.adjoint ∧ + S * B = tensorIntegral Λ V * S ∧ S * L = tensorIntegral Λ W * S) : + κ ≤ 2 := by + have hy' : S (vectorization Y) = ((1 : ℝ) : ℂ) • vectorization Y := by + simpa only [Complex.ofReal_one, one_smul] using hy + have hP := projected_density_of_laurent_testing M E Λ + (fun t => (hE t).isHermitian) (fun t => (hΛ t).isHermitian) S hS + X X κ κ hκ.ne' hκ.ne' hx hx htest + simp only [div_self hκ.ne', one_smul] at hP + have hQ := projected_density_of_laurent_testing M E Λ + (fun t => (hE t).isHermitian) (fun t => (hΛ t).isHermitian) S hS + Y Y 1 1 one_ne_zero one_ne_zero hy' hy' htest + simp only [div_one, one_smul] at hQ + have hR := projected_density_of_laurent_testing M E Λ + (fun t => (hE t).isHermitian) (fun t => (hΛ t).isHermitian) S hS + X Y κ 1 hκ.ne' one_ne_zero hx hy' htest + simp only [div_one, one_div] at hR + have hord := densityLp_ordered Λ F hΛ hmass hF X Y (hX.trans hY.symm) hI + refine fourier_ordered_comparison M hM F F.continuous.aestronglyMeasurable + (Filter.Eventually.of_forall hF) ?_ ?_ + (densityLp Λ X X) (densityLp Λ Y Y) (densityLp Λ X Y) + (densityLp_self_hermitian Λ hΛ X) (densityLp_self_hermitian Λ hΛ Y) + (hord.mono fun _ ht => ht.1) (hord.mono fun _ ht => ht.2.2) + (matrixMean_cross_zero Λ hmass X Y hXY) ?_ κ hκ ?_ + · simpa only [adjoint_boundaryCauchyAdjoint] using hleft + · simpa only [adjoint_boundaryCauchyAdjoint] using hright + · rw [trace_matrixMean_self_one Λ hmass X hX, Complex.one_re] + exact zero_lt_one + · have hb := densityLp_block_posSemidef E hE X Y + rw [hP, hQ, hR] at hb + exact hb + +end CrouzeixHilbert.Boundary + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PhysicalDensity.lean b/lean/OAI/Analysis/Crouzeix/PhysicalDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..305f178a9ee587873b6b35f2e2df5ca8d6afd7ae --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PhysicalDensity.lean @@ -0,0 +1,114 @@ +import Mathlib +import OAI.Analysis.Crouzeix.AngularMeasure +import OAI.Analysis.Crouzeix.PhysicalComparison + +namespace OAI + +/-! Physical Density. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +local instance physicalDensityOperatorRealNormedSpace (size : ℕ) : + NormedSpace ℝ (Operator (Amplification H size)) := + NormedSpace.restrictScalars ℝ ℂ _ + +def operatorDensity (D : Operator H) (hD : spectralRadius ℂ D < 1) : C(CircleSpace, Operator H) := + ⟨fun t => C.angularJacobian R t • Disk.phi D (C.interiorAngle R t), + (C.angularJacobian R).continuous.smul ((Disk.continuous_phi D hD).comp (C.interiorAngle R).continuous)⟩ + +lemma operatorDensity_nonneg (D : Operator H) (hD : spectralRadius ℂ D < 1) + (hN : ‖D‖ ≤ 1) (t : CircleSpace) : 0 ≤ C.operatorDensity R D hD t := by + have he : C.angularJacobian R t = ((C.angularJacobian R t).re : ℂ) := by + apply Complex.ext <;> simp [(C.angularJacobian_real_nonneg R t).1] + change 0 ≤ C.angularJacobian R t • Disk.phi D (C.interiorAngle R t) + rw [he] + exact smul_nonneg (by simpa using (C.angularJacobian_real_nonneg R t).2) + (ContinuousLinearMap.nonneg_iff_isPositive.mpr (Disk.phi_isPositive D hN hD _)) + +lemma integral_operatorDensity (D : Operator H) (hD : spectralRadius ℂ D < 1) + (hU : IsOpen U) (hc : Convex ℝ U) : + (∫ t, C.operatorDensity R D hD t ∂circleMeasure) = 1 := by + change (∫ t, C.angularJacobian R t • Disk.phi D (C.interiorAngle R t) ∂circleMeasure) = 1 + exact (C.integral_angularChange R hU hc ⟨Disk.phi D, Disk.continuous_phi D hD⟩).trans + (Disk.integral_phi D hD) + +lemma integral_operatorDensity_pullback (D : Operator H) (hD : spectralRadius ℂ D < 1) + (hU : IsOpen U) (hc : Convex ℝ U) {m : ℕ} (F : C(CircleSpace, Coeff m)) : + (∫ t, tensorOperator (C.operatorDensity R D hD t) (F (C.interiorAngle R t)) ∂circleMeasure) = + ∫ t, tensorOperator (Disk.phi D t) (F t) ∂circleMeasure := by + let V : C(CircleSpace, Operator (Amplification H m)) := + ⟨fun t => tensorOperator (Disk.phi D t) (F t), + ((tensorBilinearCLM m).continuous.comp (Disk.continuous_phi D hD)).clm_apply F.continuous⟩ + have he (t : CircleSpace) : tensorOperator (C.operatorDensity R D hD t) (F (C.interiorAngle R t)) = + C.angularJacobian R t • V (C.interiorAngle R t) := by + change tensorOperator (C.angularJacobian R t • Disk.phi D (C.interiorAngle R t)) _ = _ + exact (tensorOperatorCLM _).map_smul _ _ + simp_rw [he] + exact C.integral_angularChange R hU hc V + +end Conformal.ExteriorCollar + +def operatorToMatrix (n : ℕ) : Operator (EuclideanSpace ℂ (Fin n)) →L[ℂ] Coeff n := + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm.toAlgEquiv.toLinearEquiv.toContinuousLinearEquiv.toContinuousLinearMap + +@[simp] lemma operatorToMatrix_apply {n : ℕ} (A : Operator (EuclideanSpace ℂ (Fin n))) : + operatorToMatrix n A = (Matrix.toEuclideanCLM (𝕜 := ℂ)).symm A := rfl + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) (R : InteriorCollar U) + +def matrixDensity {n : ℕ} (D : Operator (EuclideanSpace ℂ (Fin n))) + (hD : spectralRadius ℂ D < 1) : C(CircleSpace, Coeff n) := + ⟨fun t => operatorToMatrix n (C.operatorDensity R D hD t), + (operatorToMatrix n).continuous.comp (C.operatorDensity R D hD).continuous⟩ + +lemma matrixDensity_posSemidef {n : ℕ} (D : Operator (EuclideanSpace ℂ (Fin n))) + (hD : spectralRadius ℂ D < 1) (hN : ‖D‖ ≤ 1) (t : CircleSpace) : + (C.matrixDensity R D hD t).PosSemidef := by + apply Matrix.nonneg_iff_posSemidef.mp + exact map_nonneg (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm + (C.operatorDensity_nonneg R D hD hN t) + +lemma integral_matrixDensity {n : ℕ} (D : Operator (EuclideanSpace ℂ (Fin n))) + (hD : spectralRadius ℂ D < 1) (hU : IsOpen U) (hc : Convex ℝ U) : + (∫ t, C.matrixDensity R D hD t ∂circleMeasure) = 1 := by + let : ContinuousSMul ℂ (EuclideanSpace ℂ (Fin n)) := IsBoundedSMul.continuousSMul + let : CompleteSpace (Operator (EuclideanSpace ℂ (Fin n))) := + ContinuousLinearMap.instCompleteSpace + have hi : Integrable (C.operatorDensity R D hD) circleMeasure := + (C.operatorDensity R D hD).continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + change (∫ t, operatorToMatrix n (C.operatorDensity R D hD t) ∂circleMeasure) = 1 + rw [(operatorToMatrix n).integral_comp_comm hi, C.integral_operatorDensity R D hD hU hc] + exact map_one (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm + +lemma tensorIntegral_matrixDensity_pullback {n : ℕ} (D : Operator (EuclideanSpace ℂ (Fin n))) + (hD : spectralRadius ℂ D < 1) (hU : IsOpen U) (hc : Convex ℝ U) + (F : C(CircleSpace, Coeff n)) : + Boundary.tensorIntegral (C.matrixDensity R D hD) (F.comp (C.interiorAngle R)) = + ∫ t, tensorOperator (Disk.phi D t) (F t) ∂circleMeasure := by + change (∫ t, tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) (C.matrixDensity R D hD t)) (F (C.interiorAngle R t)) ∂circleMeasure) = _ + simp only [matrixDensity, ContinuousMap.coe_mk, operatorToMatrix_apply, StarAlgEquiv.apply_symm_apply] + exact C.integral_operatorDensity_pullback R D hD hU hc F + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PhysicalFourier.lean b/lean/OAI/Analysis/Crouzeix/PhysicalFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a1c455f96b8f7479a0f06d6fc5f2293caf99e3b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PhysicalFourier.lean @@ -0,0 +1,225 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Faber + +namespace OAI + +/-! Physical Fourier. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped InnerProductSpace Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +namespace Boundary + +lemma kernelLp_complex_smul {k : ℕ} (m : CircleKernel) (c : ℂ) (u : BoundaryL2 k) : + kernelLp m (c • u) = c • kernelLp m u := by + apply Lp.ext + filter_upwards [kernelLp_apply_ae m (c • u), kernelLp_apply_ae m u, + Lp.coeFn_smul c (kernelLp m u)] with x hcu hu hsmul + simp only [hcu, hsmul, Pi.smul_apply, hu, kernelApply] + calc + _ = ∫ y, c • (m (x,y) • u y) ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_smul c u] with y hy + rw [hy] + exact smul_comm (m (x,y)) c (u y) + _ = _ := integral_smul c _ + +@[simp] lemma boundaryField_add {k : ℕ} (F G : C(CircleSpace, Coeff k)) : + boundaryField (F+G) = boundaryField F + boundaryField G := by + apply Lp.ext + filter_upwards [boundaryField_apply_ae (F+G), boundaryField_apply_ae F, boundaryField_apply_ae G, + Lp.coeFn_add (boundaryField F) (boundaryField G)] with t hfg hf hg hsum + simp only [hfg, hsum, Pi.add_apply, hf, hg, ContinuousMap.add_apply] + exact (toHSCLM k).map_add _ _ + +@[simp] lemma boundaryField_smul {k : ℕ} (c : ℂ) (F : C(CircleSpace, Coeff k)) : + boundaryField (c • F) = c • boundaryField F := by + apply Lp.ext + filter_upwards [boundaryField_apply_ae (c • F), boundaryField_apply_ae F, + Lp.coeFn_smul c (boundaryField F)] with t hcf hf hs + simp only [hcf, hs, Pi.smul_apply, hf, ContinuousMap.smul_apply] + exact (toHSCLM k).map_smul _ _ + +@[simp] lemma boundaryField_zero {k : ℕ} : boundaryField (0 : C(CircleSpace, Coeff k)) = 0 := by + apply Lp.ext + filter_upwards [boundaryField_apply_ae (0 : C(CircleSpace, Coeff k)), Lp.coeFn_zero (E := HS k) (p := 2) circleMeasure] with t he hz + rw [he, hz] + exact (toHSCLM k).map_zero + +end Boundary + +namespace Conformal.ExteriorCollar + +open Boundary + +variable {U : Set ℂ} (C : ExteriorCollar U) + +lemma boundaryKernel_complex (w t : CircleSpace) : + (C.boundaryKernel (w,t) : ℂ) = 1 + C.boundaryCorrection (w,t) + conj (C.boundaryCorrection (w,t)) := by + change (((1 : ℝ) + 2 * (C.boundaryCorrection (w,t)).re : ℝ) : ℂ) = _ + apply Complex.ext <;> simp [add_re, add_im, mul_re, mul_im] + ring + +lemma correctionMoment_continuous_trace (j : ℕ) : + Continuous (fun w : CircleSpace => C.correctionMoment j (circleCoordinate w)⁻¹) := + (C.differentiableOn_correctionMoment j).continuousOn.comp_continuous + (circleCoordinate.continuous.inv₀ circleCoordinate_ne_zero) C.circle_inverse_mem + +lemma boundaryKernel_moment {j : ℕ} (hj : j ≠ 0) (w : CircleSpace) : + (∫ t, (C.boundaryKernel (w,t) : ℂ) * (circleCoordinate t)^j ∂circleMeasure) = + C.correctionMoment j (circleCoordinate w)⁻¹ := by + have hb : Continuous (fun t => C.boundaryCorrection (w,t)) := + C.boundaryCorrection.continuous.comp (continuous_const.prodMk continuous_id) + have hp := circleCoordinate.continuous.pow j + have hi1 : Integrable (fun t => (circleCoordinate t)^j) circleMeasure := + hp.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hi2 : Integrable (fun t => (circleCoordinate t)^j * C.boundaryCorrection (w,t)) circleMeasure := + (hp.mul hb).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hi3 : Integrable (fun t => conj (C.boundaryCorrection (w,t)) * (circleCoordinate t)^j) circleMeasure := + ((continuous_conj.comp hb).mul hp).integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + have hz : (∫ t : CircleSpace, ((circleCoordinate t)⁻¹)^j * C.boundaryCorrection (w,t) + ∂circleMeasure) = 0 := by + change (∫ t, ((circleCoordinate t)⁻¹)^j * + C.correction (circleCoordinate t)⁻¹ (circleCoordinate w)⁻¹ ∂circleMeasure) = 0 + rw [integral_holomorphic_inverse_circleCoordinate + (f := fun v => v^j * C.correction v (circleCoordinate w)⁻¹) + ((differentiableOn_id.pow j).mul + ((C.differentiableOn_correction_left (C.circle_inverse_mem w)).mono C.closed_unit_subset_reciprocalDisk))] + simp + have h3 : (∫ t, conj (C.boundaryCorrection (w,t)) * (circleCoordinate t)^j ∂circleMeasure) = 0 := by + have he := congrArg conj hz + rw [← integral_conj] at he + simp only [map_zero] at he + convert he using 1 + apply integral_congr_ae + filter_upwards [] with t + rw [map_mul, map_pow, Complex.inv_eq_conj (norm_circleCoordinate t), conj_conj] + ring + have h1 : (∫ t : CircleSpace, (circleCoordinate t)^j ∂circleMeasure) = 0 := by + rw [integral_holomorphic_circleCoordinate (f := fun z => z^j) (differentiableOn_id.pow j)] + exact zero_pow hj + have he (t : CircleSpace) : (C.boundaryKernel (w,t) : ℂ) * (circleCoordinate t)^j = + (circleCoordinate t)^j + (circleCoordinate t)^j * C.boundaryCorrection (w,t) + + conj (C.boundaryCorrection (w,t)) * (circleCoordinate t)^j := by + rw [C.boundaryKernel_complex]; ring + simp_rw [he] + have hi12 : Integrable (fun t => (circleCoordinate t)^j + (circleCoordinate t)^j * + C.boundaryCorrection (w,t)) circleMeasure := hi1.add hi2 + rw [integral_add hi12 hi3, integral_add hi1 hi2, h1, h3, zero_add, add_zero] + rfl + +lemma boundaryCauchy_complex_smul (hc : Convex ℝ U) {k : ℕ} (c : ℂ) (u : BoundaryL2 k) : + boundaryCauchy (C.boundaryOperator hc k) (c • u) = + c • boundaryCauchy (C.boundaryOperator hc k) u := by + change fourierProjC k 0 (c • u) + fourierProjC k 1 (c • u) + + fourierProjC k 2 (kernelLp C.boundaryKernel (fourierProjC k 1 (c • u))) = + c • (fourierProjC k 0 u + fourierProjC k 1 u + + fourierProjC k 2 (kernelLp C.boundaryKernel (fourierProjC k 1 u))) + simp only [map_smul, kernelLp_complex_smul, smul_add] + +def scalarChannel {k : ℕ} (i l : Fin k) (f : C(CircleSpace, ℂ)) : C(CircleSpace, Coeff k) := + ⟨fun t => f t • Matrix.single i l (1 : ℂ), f.continuous.smul continuous_const⟩ + +def correctionChannel {k : ℕ} (a : ℕ × (Fin k × Fin k)) : C(CircleSpace, Coeff k) := + scalarChannel a.2.1 a.2.2 + ⟨fun t => C.correctionMoment a.1 (circleCoordinate t)⁻¹, C.correctionMoment_continuous_trace a.1⟩ + +lemma kernelLp_fourier_pos (hc : Convex ℝ U) {k : ℕ} (j : ℕ) (hj : j ≠ 0) (i l : Fin k) : + C.boundaryOperator hc k (matrixFourier ((j : ℤ),i,l)) = + boundaryField (C.correctionChannel (j,i,l)) := by + apply Lp.ext + filter_upwards [kernelLp_apply_ae C.boundaryKernel (matrixFourier ((j : ℤ),i,l)), + boundaryField_apply_ae (C.correctionChannel (j,i,l))] with w hw hv + change kernelLp C.boundaryKernel _ w = _ + rw [hw, hv] + change (∫ t, C.boundaryKernel (w,t) • matrixFourier ((j : ℤ),i,l) t ∂circleMeasure) = + toHS (C.correctionMoment j (circleCoordinate w)⁻¹ • Matrix.single i l (1 : ℂ)) + rw [← toHSCLM_apply, map_smul, toHSCLM_apply, toHS_single] + calc + _ = ∫ t, ((C.boundaryKernel (w,t) : ℂ) * (circleCoordinate t)^j) • + EuclideanSpace.single (i,l) (1 : ℂ) ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [matrixFourier_apply_ae ((j : ℤ),i,l)] with t ht + rw [ht, circleCoordinate_pow, mul_smul] + rfl + _ = _ := by rw [integral_smul_const, C.boundaryKernel_moment hj] + +def physicalChannel {k : ℕ} (a : ℤ × (Fin k × Fin k)) : C(CircleSpace, Coeff k) := + scalarChannel a.2.1 a.2.2 + ⟨fun t => C.physicalCoefficient a.1 (C.boundaryMap t), + (C.differentiableOn_physicalCoefficient a.1).continuousOn.comp_continuous + C.boundaryMap.continuous (fun t => C.closure_subset_outerDomain + (C.boundaryMap_mem_frontier t).1)⟩ + +lemma correctionChannel_negative {k : ℕ} (a : ℕ × (Fin k × Fin k)) : + fourierProjC k 2 (boundaryField (C.correctionChannel a)) = + boundaryField (C.correctionChannel a) := by + apply fourierProj_boundaryField_inverse_neg (f := fun v => + C.correctionMoment a.1 v • Matrix.single a.2.1 a.2.2 (1 : ℂ)) + · intro i l + exact ((C.differentiableOn_correctionMoment a.1).mono + C.closed_unit_subset_reciprocalDisk).mul_const _ + · simp + · exact fun _ => rfl + +lemma boundaryCauchy_matrixFourier (hU : IsOpen U) (hc : Convex ℝ U) {k : ℕ} + (a : ℤ × (Fin k × Fin k)) : + boundaryCauchy (C.boundaryOperator hc k) (matrixFourier a) = + boundaryField (C.physicalChannel a) := by + classical + change fourierProjC k 0 (matrixFourier a) + fourierProjC k 1 (matrixFourier a) + + fourierProjC k 2 (C.boundaryOperator hc k (fourierProjC k 1 (matrixFourier a))) = _ + simp only [fourierProj_matrixFourier, frequencyPart_zero, frequencyPart_pos] + rcases a with ⟨j,i,l⟩ + rcases lt_trichotomy j 0 with hj|hj|hj + · simp only [ne_of_lt hj, not_lt_of_gt hj, ↓reduceIte, map_zero, zero_add] + have he : C.physicalChannel (j,i,l) = 0 := by + ext t a b + obtain ⟨n,hn⟩ := Int.eq_ofNat_of_zero_le (neg_nonneg.mpr hj.le) + have hjn : j = -(n : ℤ) := by omega + have hn0 : n ≠ 0 := by omega + change C.physicalCoefficient j (C.boundaryMap t) * _ = _ + rw [hjn, C.physicalCoefficient_closed_neg hU (C.boundaryMap_mem_frontier t).1 hn0] + simp + rw [he, boundaryField_zero] + · subst j + simp only [lt_self_iff_false, ↓reduceIte, map_zero, add_zero] + have he : C.physicalChannel (0,i,l) = matrixLaurentMonomial (0,i,l) 1 := by + ext t a b + change C.physicalCoefficient 0 (C.boundaryMap t) * _ = _ + rw [C.physicalCoefficient_closed_zero hU (C.boundaryMap_mem_frontier t).1] + simp [matrixLaurentMonomial] + rw [he, boundaryField_matrixLaurentMonomial, one_smul] + · obtain ⟨n,rfl⟩ := Int.eq_ofNat_of_zero_le hj.le + have hn : n ≠ 0 := by omega + simp only [ne_of_gt hj, hj, ↓reduceIte, zero_add] + rw [C.kernelLp_fourier_pos hc n hn, C.correctionChannel_negative] + have he : C.physicalChannel ((n : ℤ),i,l) = + matrixLaurentMonomial ((n : ℤ),i,l) 1 + C.correctionChannel (n,i,l) := by + ext t a b + change C.physicalCoefficient (n : ℤ) (C.G (circleCoordinate t)) * _ = _ + rw [C.physicalCoefficient_boundary n (norm_circleCoordinate t)] + simp only [ContinuousMap.add_apply, matrixLaurentMonomial, correctionChannel, + scalarChannel, ContinuousMap.coe_mk, Matrix.add_apply, Matrix.smul_apply, + smul_eq_mul, one_mul, circleCoordinate_pow, add_mul] + rw [he, boundaryField_add, boundaryField_matrixLaurentMonomial, one_smul] + +lemma boundaryCauchy_matrixLaurentMonomial (hU : IsOpen U) (hc : Convex ℝ U) {k : ℕ} + (a : ℤ × (Fin k × Fin k)) (c : ℂ) : + boundaryCauchy (C.boundaryOperator hc k) (boundaryField (matrixLaurentMonomial a c)) = + boundaryField (c • C.physicalChannel a) := by + rw [boundaryField_matrixLaurentMonomial, C.boundaryCauchy_complex_smul, + C.boundaryCauchy_matrixFourier hU hc, boundaryField_smul] + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PhysicalModule.lean b/lean/OAI/Analysis/Crouzeix/PhysicalModule.lean new file mode 100644 index 0000000000000000000000000000000000000000..eedaa28309b261c461c273881113f27abfcf8b8b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PhysicalModule.lean @@ -0,0 +1,218 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HolomorphicAlgebra +import OAI.Analysis.Crouzeix.PhysicalProjection + +namespace OAI + +/-! Physical Module. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped InnerProductSpace Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +namespace Boundary + +lemma realCLM_eq_of_matrixLaurent {k : ℕ} {L R : BoundaryL2 k →L[ℝ] BoundaryL2 k} + (h : ∀ a c, L (boundaryField (matrixLaurentMonomial a c)) = + R (boundaryField (matrixLaurentMonomial a c))) : L = R := by + have ha : L.adjoint = R.adjoint := by + apply ContinuousLinearMap.ext + intro v + apply eq_of_inner_matrixLaurentMonomial + intro a c + rw [ContinuousLinearMap.adjoint_inner_left, ContinuousLinearMap.adjoint_inner_left, h] + simpa only [ContinuousLinearMap.adjoint_adjoint] using + congrArg (fun T : BoundaryL2 k →L[ℝ] BoundaryL2 k => T.adjoint) ha + +lemma lpLeft_boundaryField {k : ℕ} (F V : C(CircleSpace, Coeff k)) + (hF : ∀ t, ‖F t‖ ≤ 1) : + lpLeft F F.continuous.aestronglyMeasurable (Eventually.of_forall hF) + (boundaryField V) = boundaryField (F*V) := by + apply Lp.ext + filter_upwards [lpLeft_apply_ae F F.continuous.aestronglyMeasurable (Eventually.of_forall hF) + (boundaryField V), boundaryField_apply_ae V, boundaryField_apply_ae (F*V)] with t ht hv hfv + rw [ht, hv, hfv, ofHS_toHS] + rfl + +lemma lpRight_boundaryField {k : ℕ} (F V : C(CircleSpace, Coeff k)) + (hF : ∀ t, ‖F t‖ ≤ 1) : + lpRight F F.continuous.aestronglyMeasurable (Eventually.of_forall hF) + (boundaryField V) = boundaryField (V*F) := by + apply Lp.ext + filter_upwards [lpRight_apply_ae F F.continuous.aestronglyMeasurable (Eventually.of_forall hF) + (boundaryField V), boundaryField_apply_ae V, boundaryField_apply_ae (V*F)] with t ht hv hfv + rw [ht, hv, hfv, ofHS_toHS] + rfl + +end Boundary + +namespace Conformal.ExteriorCollar + +open Boundary + +variable {U : Set ℂ} (C : ExteriorCollar U) + +def analyticTrace {V : Set ℂ} (hUV : closure U ⊆ V) (f : ℂ → ℂ) + (hf : ContinuousOn f V) : C(CircleSpace, ℂ) := + ⟨fun t => f (C.boundaryMap t), hf.comp_continuous C.boundaryMap.continuous + (fun t => hUV (C.boundaryMap_mem_frontier t).1)⟩ + +lemma boundaryCauchy_polynomialTrace (hU : IsOpen U) (hc : Convex ℝ U) {k : ℕ} + (p : Polynomial ℂ) (i l : Fin k) : + boundaryCauchy (C.boundaryOperator hc k) + (boundaryField (scalarChannel i l + (C.analyticTrace (subset_univ _) p.eval p.continuous.continuousOn))) = + boundaryField (scalarChannel i l + (C.analyticTrace (subset_univ _) p.eval p.continuous.continuousOn)) := by + have he : scalarChannel i l + (C.analyticTrace (subset_univ _) p.eval p.continuous.continuousOn) = + ∑ j ∈ Finset.range (p.natDegree+1), p.coeff j • scalarChannel i l (C.boundaryMap^j) := by + ext t a b + simp only [analyticTrace, scalarChannel, ContinuousMap.coe_mk, ContinuousMap.sum_apply, + Matrix.sum_apply, ContinuousMap.smul_apply, Matrix.smul_apply, ContinuousMap.pow_apply, + Polynomial.eval_eq_sum_range, Finset.sum_mul, smul_eq_mul, mul_assoc] + rw [he, boundaryField_sum, map_sum] + apply Finset.sum_congr rfl + intro j _ + rw [boundaryField_smul, C.boundaryCauchy_complex_smul, C.boundaryCauchy_physical_power hU hc] + +lemma boundaryCauchy_analyticTrace (hU : IsOpen U) (hc : Convex ℝ U) + (hb : Bornology.IsBounded U) {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f V) {k : ℕ} (i l : Fin k) : + boundaryCauchy (C.boundaryOperator hc k) + (boundaryField (scalarChannel i l (C.analyticTrace hUV f hf.continuousOn))) = + boundaryField (scalarChannel i l (C.analyticTrace hUV f hf.continuousOn)) := by + obtain ⟨p,hp⟩ := exists_polynomial_tendstoUniformlyOn hb.isCompact_closure hc.closure hV hUV hf + let Fn (n : ℕ) := scalarChannel i l + (C.analyticTrace (subset_univ _) (p n).eval (p n).continuous.continuousOn) + let F := scalarChannel i l (C.analyticTrace hUV f hf.continuousOn) + have ht : Tendsto Fn atTop (𝓝 F) := by + have hs : TendstoUniformly (fun n t => (p n).eval (C.boundaryMap t)) + (fun t => f (C.boundaryMap t)) atTop := by + have he : C.boundaryMap ⁻¹' closure U = univ := + eq_univ_of_forall (fun t => (C.boundaryMap_mem_frontier t).1) + simpa only [he, tendstoUniformlyOn_univ, Function.comp_def] using + hp.comp C.boundaryMap + have hct : Tendsto (fun n => C.analyticTrace (subset_univ _) (p n).eval + (p n).continuous.continuousOn) atTop (𝓝 (C.analyticTrace hUV f hf.continuousOn)) := + ContinuousMap.tendsto_iff_tendstoUniformly.mpr hs + let T : ℂ →L[ℂ] Coeff k := (ContinuousLinearMap.id ℂ ℂ).smulRight (Matrix.single i l 1) + exact ((ContinuousLinearMap.compLeftContinuous ℂ CircleSpace T).continuous.tendsto _).comp hct + have hlt := ((boundaryFieldCLM k).continuous.tendsto F).comp ht + have hrt := (boundaryCauchy (C.boundaryOperator hc k)).continuous.tendsto _ |>.comp hlt + have heq : ∀ n, boundaryCauchy (C.boundaryOperator hc k) (boundaryFieldCLM k (Fn n)) = + boundaryFieldCLM k (Fn n) := fun n => C.boundaryCauchy_polynomialTrace hU hc (p n) i l + simp only [Function.comp_def, heq] at hrt + exact tendsto_nhds_unique hrt hlt + +def matrixAnalyticTrace {V : Set ℂ} (hUV : closure U ⊆ V) {k : ℕ} (f : ℂ → Coeff k) + (hf : ContinuousOn f V) : C(CircleSpace, Coeff k) := + ⟨fun t => f (C.boundaryMap t), hf.comp_continuous C.boundaryMap.continuous + (fun t => hUV (C.boundaryMap_mem_frontier t).1)⟩ + +lemma boundaryCauchy_matrixAnalyticTrace (hU : IsOpen U) (hc : Convex ℝ U) + (hb : Bornology.IsBounded U) {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {k : ℕ} {f : ℂ → Coeff k} (hf : EntrywiseHolomorphic V f) : + boundaryCauchy (C.boundaryOperator hc k) + (boundaryField (C.matrixAnalyticTrace hUV f hf.continuousOn)) = + boundaryField (C.matrixAnalyticTrace hUV f hf.continuousOn) := by + classical + have he : C.matrixAnalyticTrace hUV f hf.continuousOn = + ∑ i : Fin k, ∑ l : Fin k, + scalarChannel i l (C.analyticTrace hUV (fun z => f z i l) (hf i l).continuousOn) := by + ext t a b + simp only [matrixAnalyticTrace, scalarChannel, analyticTrace, ContinuousMap.coe_mk, + ContinuousMap.sum_apply, Matrix.smul_single, smul_eq_mul, mul_one] + exact congrArg (fun M : Coeff k => M a b) (Matrix.matrix_eq_sum_single (f (C.boundaryMap t))) + rw [he, boundaryField_sum, map_sum] + apply Finset.sum_congr rfl + intro i _ + rw [boundaryField_sum, map_sum] + exact Finset.sum_congr rfl (fun l _ => C.boundaryCauchy_analyticTrace hU hc hb hV hUV (hf i l) i l) + +def physicalRepresentative {k : ℕ} (a : ℤ × (Fin k × Fin k)) (c : ℂ) (z : ℂ) : Coeff k := + (c * C.physicalCoefficient a.1 z) • Matrix.single a.2.1 a.2.2 1 + +lemma physicalRepresentative_holomorphic {k : ℕ} (a : ℤ × (Fin k × Fin k)) (c : ℂ) : + EntrywiseHolomorphic C.outerDomain (C.physicalRepresentative a c) := by + intro i j + exact ((C.differentiableOn_physicalCoefficient a.1).const_mul c).mul_const _ + +lemma physicalRepresentative_trace {k : ℕ} (a : ℤ × (Fin k × Fin k)) (c : ℂ) : + C.matrixAnalyticTrace C.closure_subset_outerDomain (C.physicalRepresentative a c) + (C.physicalRepresentative_holomorphic a c).continuousOn = c • C.physicalChannel a := by + ext t i j + simp only [matrixAnalyticTrace, physicalRepresentative, physicalChannel, scalarChannel, + ContinuousMap.coe_mk, ContinuousMap.smul_apply, Matrix.smul_apply, smul_eq_mul, mul_assoc] + +lemma boundaryCauchy_left_module (hU : IsOpen U) (hc : Convex ℝ U) + (hb : Bornology.IsBounded U) {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {k : ℕ} {f : ℂ → Coeff k} (hf : EntrywiseHolomorphic V f) + (hF : ∀ t, ‖C.matrixAnalyticTrace hUV f hf.continuousOn t‖ ≤ 1) : + let F := C.matrixAnalyticTrace hUV f hf.continuousOn + let M := C.boundaryOperator hc k + (boundaryCauchy M).comp ((lpLeft F F.continuous.aestronglyMeasurable + (Eventually.of_forall hF)).comp (boundaryCauchy M)) = + (lpLeft F F.continuous.aestronglyMeasurable (Eventually.of_forall hF)).comp (boundaryCauchy M) := by + dsimp only + apply realCLM_eq_of_matrixLaurent + intro a c + simp only [ContinuousLinearMap.comp_apply, C.boundaryCauchy_matrixLaurentMonomial hU hc] + rw [lpLeft_boundaryField (C.matrixAnalyticTrace hUV f hf.continuousOn) (c • C.physicalChannel a) hF] + let W := V ∩ C.outerDomain + have hw : closure U ⊆ W := fun z hz => ⟨hUV hz, C.closure_subset_outerDomain hz⟩ + have hprod : EntrywiseHolomorphic W (fun z => f z * C.physicalRepresentative a c z) := by + intro i j + simp only [Matrix.mul_apply] + apply DifferentiableOn.fun_sum + intro l _ + exact ((hf i l).mono inter_subset_left).fun_mul + ((C.physicalRepresentative_holomorphic a c l j).mono inter_subset_right) + have he : C.matrixAnalyticTrace hUV f hf.continuousOn * (c • C.physicalChannel a) = + C.matrixAnalyticTrace hw (fun z => f z * C.physicalRepresentative a c z) hprod.continuousOn := by + rw [← C.physicalRepresentative_trace] + rfl + rw [he] + exact C.boundaryCauchy_matrixAnalyticTrace hU hc hb (hV.inter C.isOpen_outerDomain) hw hprod + +lemma boundaryCauchy_right_module (hU : IsOpen U) (hc : Convex ℝ U) + (hb : Bornology.IsBounded U) {V : Set ℂ} (hV : IsOpen V) (hUV : closure U ⊆ V) + {k : ℕ} {f : ℂ → Coeff k} (hf : EntrywiseHolomorphic V f) + (hF : ∀ t, ‖C.matrixAnalyticTrace hUV f hf.continuousOn t‖ ≤ 1) : + let F := C.matrixAnalyticTrace hUV f hf.continuousOn + let M := C.boundaryOperator hc k + (boundaryCauchy M).comp ((lpRight F F.continuous.aestronglyMeasurable + (Eventually.of_forall hF)).comp (boundaryCauchy M)) = + (lpRight F F.continuous.aestronglyMeasurable (Eventually.of_forall hF)).comp (boundaryCauchy M) := by + dsimp only + apply realCLM_eq_of_matrixLaurent + intro a c + simp only [ContinuousLinearMap.comp_apply, C.boundaryCauchy_matrixLaurentMonomial hU hc] + rw [lpRight_boundaryField (C.matrixAnalyticTrace hUV f hf.continuousOn) (c • C.physicalChannel a) hF] + let W := V ∩ C.outerDomain + have hw : closure U ⊆ W := fun z hz => ⟨hUV hz, C.closure_subset_outerDomain hz⟩ + have hprod : EntrywiseHolomorphic W (fun z => C.physicalRepresentative a c z * f z) := by + intro i j + simp only [Matrix.mul_apply] + apply DifferentiableOn.fun_sum + intro l _ + exact ((C.physicalRepresentative_holomorphic a c i l).mono inter_subset_right).fun_mul + ((hf l j).mono inter_subset_left) + have he : (c • C.physicalChannel a) * C.matrixAnalyticTrace hUV f hf.continuousOn = + C.matrixAnalyticTrace hw (fun z => C.physicalRepresentative a c z * f z) hprod.continuousOn := by + rw [← C.physicalRepresentative_trace] + rfl + rw [he] + exact C.boundaryCauchy_matrixAnalyticTrace hU hc hb (hV.inter C.isOpen_outerDomain) hw hprod + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PhysicalProjection.lean b/lean/OAI/Analysis/Crouzeix/PhysicalProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..af44535ec4af4835bc96273e9d58c00cdad09761 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PhysicalProjection.lean @@ -0,0 +1,176 @@ +import Mathlib +import OAI.Analysis.Crouzeix.LaurentSplit +import OAI.Analysis.Crouzeix.PhysicalFourier + +namespace OAI + +/-! Physical Projection. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped InnerProductSpace Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +namespace Boundary + +def boundaryFieldCLM (k : ℕ) : C(CircleSpace, Coeff k) →L[ℂ] BoundaryL2 k := + (ContinuousMap.toLp 2 circleMeasure ℂ).comp + (ContinuousLinearMap.compLeftContinuous ℂ CircleSpace (toHSCLM k)) + +@[simp] lemma boundaryFieldCLM_apply {k : ℕ} (F : C(CircleSpace, Coeff k)) : + boundaryFieldCLM k F = boundaryField F := rfl + +lemma boundaryField_sum {k : ℕ} {ι : Type*} (s : Finset ι) (F : ι → C(CircleSpace, Coeff k)) : + boundaryField (∑ i ∈ s, F i) = ∑ i ∈ s, boundaryField (F i) := + map_sum (boundaryFieldCLM k) F s + +end Boundary + +namespace Conformal.ExteriorCollar + +open Boundary + +variable {U : Set ℂ} (C : ExteriorCollar U) + +def physicalPolynomial (p : Polynomial ℂ) (z : ℂ) : ℂ := + ∑ j ∈ Finset.range (p.natDegree+1), p.coeff j * C.physicalCoefficient (j : ℤ) z + +lemma differentiableOn_physicalPolynomial (p : Polynomial ℂ) : + DifferentiableOn ℂ (C.physicalPolynomial p) C.outerDomain := by + exact DifferentiableOn.fun_sum (fun j _ => + (C.differentiableOn_physicalCoefficient (j : ℤ)).const_mul (p.coeff j)) + +def polynomialCircle (p : Polynomial ℂ) : C(CircleSpace, ℂ) := + ⟨fun t => p.eval (circleCoordinate t), p.continuous.comp circleCoordinate.continuous⟩ + +def physicalPolynomialTrace (p : Polynomial ℂ) : C(CircleSpace, ℂ) := + ⟨fun t => C.physicalPolynomial p (C.boundaryMap t), + (C.differentiableOn_physicalPolynomial p).continuousOn.comp_continuous + C.boundaryMap.continuous (fun t => C.closure_subset_outerDomain (C.boundaryMap_mem_frontier t).1)⟩ + +lemma boundaryCauchy_polynomialCircle (hU : IsOpen U) (hc : Convex ℝ U) {k : ℕ} + (p : Polynomial ℂ) (i l : Fin k) : + boundaryCauchy (C.boundaryOperator hc k) + (boundaryField (scalarChannel i l (polynomialCircle p))) = + boundaryField (scalarChannel i l (C.physicalPolynomialTrace p)) := by + have hp : scalarChannel i l (polynomialCircle p) = + ∑ j ∈ Finset.range (p.natDegree+1), matrixLaurentMonomial ((j : ℤ),i,l) (p.coeff j) := by + ext t a b + simp only [ContinuousMap.sum_apply, Matrix.sum_apply, scalarChannel, polynomialCircle, + ContinuousMap.coe_mk, Matrix.smul_apply, smul_eq_mul, matrixLaurentMonomial, + Polynomial.eval_eq_sum_range, Finset.sum_mul, circleCoordinate_pow] + have hv : scalarChannel i l (C.physicalPolynomialTrace p) = + ∑ j ∈ Finset.range (p.natDegree+1), p.coeff j • C.physicalChannel ((j : ℤ),i,l) := by + ext t a b + simp only [ContinuousMap.sum_apply, Matrix.sum_apply, scalarChannel, physicalPolynomialTrace, + physicalPolynomial, physicalChannel, ContinuousMap.coe_mk, ContinuousMap.smul_apply, + Matrix.smul_apply, smul_eq_mul, Finset.sum_mul, mul_assoc] + rw [hp, hv, boundaryField_sum, map_sum, boundaryField_sum] + exact Finset.sum_congr rfl (fun j _ => C.boundaryCauchy_matrixLaurentMonomial hU hc _ _) + +lemma physicalPolynomial_inside (hU : IsOpen U) (p : Polynomial ℂ) {z : ℂ} (hz : z ∈ U) : + C.physicalPolynomial p z = ∫ t, p.eval (circleCoordinate t) * + (C.boundaryNormal t / (C.boundaryMap t - z)) ∂circleMeasure := by + have hd (t : CircleSpace) : C.boundaryMap t - z ≠ 0 := by + intro he + exact (C.boundaryMap_mem_frontier t).2 (hU.interior_eq.symm ▸ (sub_eq_zero.mp he ▸ hz)) + have hk : Continuous (fun t => C.boundaryNormal t / (C.boundaryMap t-z)) := + C.boundaryNormal.continuous.div (C.boundaryMap.continuous.sub continuous_const) hd + simp only [physicalPolynomial, Polynomial.eval_eq_sum_range, Finset.sum_mul] + rw [integral_finsetSum _ (fun j _ => + (show Continuous (fun t : CircleSpace => p.coeff j * circleCoordinate t ^ j * + (C.boundaryNormal t / (C.boundaryMap t-z))) from + (continuous_const.mul (circleCoordinate.continuous.pow j)).mul hk).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _))] + apply Finset.sum_congr rfl + intro j hj + rw [C.physicalCoefficient_inside hU _ hz] + simp only [zpow_natCast, mul_assoc, integral_const_mul] + +lemma cauchy_inverse_q_zero (hU : IsOpen U) {q : ℂ → ℂ} + (hq : DifferentiableOn ℂ q (closedBall 0 1)) (hq0 : q 0 = 0) + {z : ℂ} (hz : z ∈ U) : + (∫ t, q (circleCoordinate t)⁻¹ * (C.boundaryNormal t / (C.boundaryMap t-z)) + ∂circleMeasure) = 0 := by + simp_rw [← C.reciprocalCauchy_boundary hU hz] + have he := integral_holomorphic_inverse_circleCoordinate + (hq.mul (C.differentiableOn_reciprocalCauchy hU hz)) + simpa only [Pi.mul_apply, hq0, zero_mul] using he + +lemma physicalPolynomial_of_power_split (hU : IsOpen U) (p : Polynomial ℂ) (q : ℂ → ℂ) + (hq : DifferentiableOn ℂ q C.reciprocalDisk) (hq0 : q 0 = 0) (n : ℕ) + (hsplit : ∀ t, C.radius < ‖t‖ → (C.G t)^n = p.eval t + q t⁻¹) : + EqOn (C.physicalPolynomial p) (fun z => z^n) (closure U) := by + have he : EqOn (C.physicalPolynomial p) (fun z => z^n) U := by + intro z hz + have hcp := C.physical_cauchy_formula hU isOpen_univ (convex_univ : Convex ℝ (univ : Set ℂ)) + (subset_univ _) (differentiableOn_id.pow n) hz + have hd (t : CircleSpace) : C.boundaryMap t - z ≠ 0 := by + intro he + exact (C.boundaryMap_mem_frontier t).2 (hU.interior_eq.symm ▸ (sub_eq_zero.mp he ▸ hz)) + have hk : Continuous (fun t => C.boundaryNormal t / (C.boundaryMap t-z)) := + C.boundaryNormal.continuous.div (C.boundaryMap.continuous.sub continuous_const) hd + have hqc : Continuous (fun t : CircleSpace => q (circleCoordinate t)⁻¹) := + hq.continuousOn.comp_continuous + (circleCoordinate.continuous.inv₀ circleCoordinate_ne_zero) C.circle_inverse_mem + have hi1 : Integrable (fun t => p.eval (circleCoordinate t) * + (C.boundaryNormal t / (C.boundaryMap t-z))) circleMeasure := ((polynomialCircle p).continuous.fun_mul hk).integrable_of_hasCompactSupport + (μ := circleMeasure) + (HasCompactSupport.of_compactSpace _) + have hi2 := (hqc.fun_mul hk).integrable_of_hasCompactSupport (μ := circleMeasure) + (HasCompactSupport.of_compactSpace _) + have halg (t : CircleSpace) : C.boundaryNormal t / (C.boundaryMap t - z) * (C.boundaryMap t)^n = + p.eval (circleCoordinate t) * (C.boundaryNormal t / (C.boundaryMap t - z)) + + q (circleCoordinate t)⁻¹ * (C.boundaryNormal t / (C.boundaryMap t - z)) := by + change _ * (C.G (circleCoordinate t))^n = _ + rw [hsplit _ (by rw [norm_circleCoordinate]; exact C.radius_lt_one)] + ring + change (∫ t, (C.boundaryNormal t / (C.boundaryMap t-z)) * (C.boundaryMap t)^n + ∂circleMeasure) = z^n at hcp + simp_rw [halg] at hcp + rw [integral_add hi1 hi2, C.cauchy_inverse_q_zero hU + (hq.mono C.closed_unit_subset_reciprocalDisk) hq0 hz, add_zero] at hcp + exact (C.physicalPolynomial_inside hU p hz).trans hcp + exact Set.EqOn.of_subset_closure he + ((C.differentiableOn_physicalPolynomial p).continuousOn.mono C.closure_subset_outerDomain) + (continuous_id.pow n).continuousOn subset_closure (Subset.refl _) + +lemma boundaryCauchy_physical_power (hU : IsOpen U) (hc : Convex ℝ U) {k : ℕ} + (n : ℕ) (i l : Fin k) : + boundaryCauchy (C.boundaryOperator hc k) + (boundaryField (scalarChannel i l (C.boundaryMap^n))) = + boundaryField (scalarChannel i l (C.boundaryMap^n)) := by + obtain ⟨p,q,hq,hq0,hsplit⟩ := C.power_finite_principal_part n + let Q : C(CircleSpace, ℂ) := ⟨fun t => q (circleCoordinate t)⁻¹, + hq.continuousOn.comp_continuous + (circleCoordinate.continuous.inv₀ circleCoordinate_ne_zero) C.circle_inverse_mem⟩ + have hqz : boundaryCauchy (C.boundaryOperator hc k) (boundaryField (scalarChannel i l Q)) = 0 := by + apply boundaryCauchy_inverse_zero (f := fun z => q z • Matrix.single i l (1 : ℂ)) + · intro a b + exact (hq.mono C.closed_unit_subset_reciprocalDisk).mul_const _ + · simp [hq0] + · exact fun _ => rfl + have he : scalarChannel i l (C.boundaryMap^n) = + scalarChannel i l (polynomialCircle p) + scalarChannel i l Q := by + ext t a b + change (C.G (circleCoordinate t))^n * _ = _ + rw [hsplit _ (by rw [norm_circleCoordinate]; exact C.radius_lt_one)] + simp only [ContinuousMap.add_apply, scalarChannel, ContinuousMap.coe_mk, + Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, add_mul, polynomialCircle, Q] + have hpe : C.physicalPolynomialTrace p = C.boundaryMap^n := by + ext t + exact C.physicalPolynomial_of_power_split hU p q hq hq0 n hsplit + (C.boundaryMap_mem_frontier t).1 + conv_lhs => rw [he] + rw [boundaryField_add, map_add, hqz, add_zero, C.boundaryCauchy_polynomialCircle hU hc, hpe] + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PoissonExtension.lean b/lean/OAI/Analysis/Crouzeix/PoissonExtension.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c5d8cb8ec1cbb95ac3af8e18796327423311e0d --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PoissonExtension.lean @@ -0,0 +1,215 @@ +import Mathlib + +namespace OAI + +/-! Poisson Extension. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex InnerProductSpace Real + +open scoped Classical ComplexConjugate + +namespace CrouzeixHilbert.Conformal + +def poissonExtension (R : ℝ) (u : ℂ → ℝ) (w : ℂ) : ℝ := + circleAverage (fun ζ => poissonKernel 0 w ζ * u ζ) 0 R + +def schwarzExtension (R : ℝ) (u : ℂ → ℝ) (w : ℂ) : ℂ := + circleAverage (fun ζ => herglotzRieszKernel 0 w ζ * (u ζ : ℂ)) 0 R + +theorem schwarzExtension_re {R : ℝ} {u : ℂ → ℝ} (hu : CircleIntegrable u 0 R) + {w : ℂ} (hw : w ∈ ball 0 R) : (schwarzExtension R u w).re = poissonExtension R u w := by + simpa only [schwarzExtension, poissonExtension, poissonKernel_eq_re_herglotzRieszKernel, + Pi.smul_apply, smul_eq_mul, Pi.mul_apply, Pi.mul_def] using + re_circleAverage_herglotzRieszKernel_smul hu (by + rw [mem_sphere] + exact ne_of_lt ((mem_ball.mp hw).trans_le (le_abs_self R))) + +theorem analyticOnNhd_schwarzExtension {R : ℝ} {u : ℂ → ℝ} (hR : 0 ≤ R) + (hu : ContinuousOn u (sphere 0 R)) : AnalyticOnNhd ℂ (schwarzExtension R u) (ball 0 R) := by + intro w hw + exact analyticOnNhd_circleAverage_herglotzRieszKernel_smul + (ContinuousOn.circleIntegrable hR (continuous_ofReal.comp_continuousOn hu)) w (by + rw [mem_compl_iff, mem_sphere] + exact ne_of_lt ((mem_ball.mp hw).trans_le (le_abs_self R))) + +theorem harmonicOnNhd_poissonExtension {R : ℝ} {u : ℂ → ℝ} (hR : 0 ≤ R) + (hu : ContinuousOn u (sphere 0 R)) : HarmonicOnNhd (poissonExtension R u) (ball 0 R) := by + intro w hw + have he : (fun z => (schwarzExtension R u z).re) =ᶠ[𝓝 w] poissonExtension R u := by + filter_upwards [isOpen_ball.mem_nhds hw] with z hz + exact schwarzExtension_re (ContinuousOn.circleIntegrable hR hu) hz + exact (harmonicAt_congr_nhds he).mp (analyticOnNhd_schwarzExtension hR hu w hw).harmonicAt_re + +theorem poissonKernel_nonneg {R : ℝ} {w ζ : ℂ} (hw : w ∈ ball 0 R) + (hζ : ζ ∈ sphere 0 R) : 0 ≤ poissonKernel 0 w ζ := by + have hR := pos_of_mem_ball hw + have hwN := mem_ball_zero_iff.mp hw + have hζN := mem_sphere_zero_iff_norm.mp hζ + simp only [poissonKernel, sub_zero, hζN] + exact div_nonneg (by nlinarith [norm_nonneg w]) (sq_nonneg _) + +theorem continuousOn_poissonKernel {R : ℝ} {w : ℂ} (hw : w ∈ ball 0 R) : + ContinuousOn (poissonKernel 0 w) (sphere 0 |R|) := by + rw [poissonKernel_eq_re_herglotzRieszKernel] + exact continuous_re.comp_continuousOn (continuousOn_herglotzRieszKernel_sphere (by + rw [mem_sphere] + exact ne_of_lt ((mem_ball.mp hw).trans_le (le_abs_self R)))) + +theorem circleAverage_poissonKernel {R : ℝ} {w : ℂ} (hw : w ∈ ball 0 R) : + circleAverage (poissonKernel 0 w) 0 R = 1 := by + simpa only [Pi.smul_apply, smul_eq_mul, Pi.mul_apply, mul_one, Pi.one_apply, Pi.mul_def] using + (harmonicContOnCl_const (c := (1 : ℝ)) (s := ball (0 : ℂ) R)).circleAverage_poissonKernel_smul hw + +theorem tendsto_poissonExtension_at_sphere {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) {p : ℂ} (hp : p ∈ sphere 0 R) : + Tendsto (poissonExtension R u) (𝓝[ball 0 R] p) (𝓝 (u p)) := by + have hpN : ‖p‖ = R := mem_sphere_zero_iff_norm.mp hp + obtain ⟨B, hB⟩ := (isCompact_sphere (0 : ℂ) R).exists_bound_of_continuousOn + (hu.sub continuousOn_const : ContinuousOn (fun t => u t - u p) (sphere 0 R)) + have hB0 : 0 ≤ B := (norm_nonneg (u p - u p)).trans (hB p hp) + apply Metric.tendsto_nhds.mpr + intro ε hε + obtain ⟨δ, hδ, hmod⟩ := Metric.continuousWithinAt_iff.mp (hu p hp) (ε / 2) (by positivity) + let c : ℂ → ℝ := fun w => B * (R ^ 2 - ‖w‖ ^ 2) / (δ / 2) ^ 2 + have hc : Tendsto c (𝓝 p) (𝓝 0) := by + have hc' : Continuous c := by dsimp [c]; fun_prop + simpa only [c, hpN, sub_self, mul_zero, zero_div] using hc'.continuousAt.tendsto (x := p) + filter_upwards [Filter.mem_inf_of_left (ball_mem_nhds p (half_pos hδ)), + Filter.mem_inf_of_left (hc.eventually (gt_mem_nhds (half_pos hε))), + self_mem_nhdsWithin] with w hwp hcε hw + have hc0 : 0 ≤ c w := by + have hwn := mem_ball_zero_iff.mp hw + dsimp [c] + exact div_nonneg (mul_nonneg hB0 (by nlinarith [norm_nonneg w])) (sq_nonneg _) + have hPc := continuousOn_poissonKernel hw + rw [abs_of_pos hR] at hPc + have huP : ContinuousOn (fun t => poissonKernel 0 w t * (u t - u p)) (sphere 0 R) := + hPc.mul (hu.sub continuousOn_const) + have hpoint : ∀ t ∈ sphere (0 : ℂ) R, + |poissonKernel 0 w t * (u t - u p)| ≤ poissonKernel 0 w t * (ε / 2) + c w := by + intro t ht + have hPn := poissonKernel_nonneg hw ht + rw [abs_mul, abs_of_nonneg hPn] + by_cases htp : dist t p < δ + · have hm := hmod ht htp + rw [Real.dist_eq] at hm + exact (mul_le_mul_of_nonneg_left hm.le hPn).trans (le_add_of_nonneg_right hc0) + · have hdist : δ / 2 ≤ ‖t - w‖ := by + have htδ := le_of_not_gt htp + have hd := dist_triangle t w p + rw [mem_ball] at hwp + rw [dist_eq_norm t w] at hd + linarith + have hn : 0 ≤ R ^ 2 - ‖w‖ ^ 2 := by + have := mem_ball_zero_iff.mp hw + nlinarith [norm_nonneg w] + have hPK : poissonKernel 0 w t ≤ (R ^ 2 - ‖w‖ ^ 2) / (δ / 2) ^ 2 := by + simp only [poissonKernel, sub_zero, mem_sphere_zero_iff_norm.mp ht] + apply div_le_div_of_nonneg_left hn (sq_pos_of_pos (half_pos hδ)) + exact pow_le_pow_left₀ (le_of_lt (half_pos hδ)) hdist 2 + have htB : |u t - u p| ≤ B := by simpa only [Real.norm_eq_abs, Pi.sub_apply] using hB t ht + calc + _ ≤ poissonKernel 0 w t * B := mul_le_mul_of_nonneg_left htB hPn + _ ≤ (R ^ 2 - ‖w‖ ^ 2) / (δ / 2) ^ 2 * B := mul_le_mul_of_nonneg_right hPK hB0 + _ = c w := by dsimp [c]; ring + _ ≤ poissonKernel 0 w t * (ε / 2) + c w := le_add_of_nonneg_left (by positivity) + have hint : CircleIntegrable (fun t => poissonKernel 0 w t * (u t - u p)) 0 R := + ContinuousOn.circleIntegrable hR.le huP + have hiabs : CircleIntegrable (fun t => |poissonKernel 0 w t * (u t - u p)|) 0 R := + ContinuousOn.circleIntegrable hR.le huP.abs + have hiup : CircleIntegrable (fun t => poissonKernel 0 w t * (ε / 2) + c w) 0 R := + ContinuousOn.circleIntegrable hR.le ((hPc.mul_const _).add continuousOn_const) + have heq : poissonExtension R u w - u p = + circleAverage (fun t => poissonKernel 0 w t * (u t - u p)) 0 R := by + simp_rw [mul_sub] + rw [circleAverage_fun_sub (f₁ := fun t => poissonKernel 0 w t * u t) + (f₂ := fun t => poissonKernel 0 w t * u p) + (ContinuousOn.circleIntegrable hR.le (hPc.mul hu)) + (ContinuousOn.circleIntegrable hR.le (hPc.mul_const _))] + have hm : circleAverage (fun t => poissonKernel 0 w t * u p) 0 R = u p := by + simp_rw [mul_comm _ (u p), ← smul_eq_mul] + rw [circleAverage_fun_smul, circleAverage_poissonKernel hw, smul_eq_mul, mul_one] + rw [hm] + rfl + have hupeq : circleAverage (fun t => poissonKernel 0 w t * (ε / 2) + c w) 0 R = ε / 2 + c w := by + rw [circleAverage_fun_add (ContinuousOn.circleIntegrable hR.le (hPc.mul_const _)) + (ContinuousOn.circleIntegrable hR.le continuousOn_const), circleAverage_const] + simp_rw [mul_comm _ (ε / 2), ← smul_eq_mul] + rw [circleAverage_fun_smul, circleAverage_poissonKernel hw, smul_eq_mul, mul_one] + rw [Real.dist_eq, heq] + calc + _ ≤ circleAverage (fun t => |poissonKernel 0 w t * (u t - u p)|) 0 R := + abs_circleAverage_le_circleAverage_abs + _ ≤ circleAverage (fun t => poissonKernel 0 w t * (ε / 2) + c w) 0 R := + circleAverage_mono hiabs hiup (by simpa only [abs_of_pos hR] using hpoint) + _ = ε / 2 + c w := hupeq + _ < ε := by linarith + +def dirichletExtension (R : ℝ) (u : ℂ → ℝ) : ℂ → ℝ := + (ball (0 : ℂ) R).piecewise (poissonExtension R u) u + +theorem dirichletExtension_eq_on_sphere {R : ℝ} {u : ℂ → ℝ} : + EqOn (dirichletExtension R u) u (sphere 0 R) := by + intro p hp + exact piecewise_eq_of_notMem _ _ _ (not_lt.mpr (mem_sphere.mp hp).ge) + +theorem dirichletExtension_eventuallyEq {R : ℝ} {u : ℂ → ℝ} {p : ℂ} + (hp : p ∈ ball 0 R) : dirichletExtension R u =ᶠ[𝓝 p] poissonExtension R u := by + filter_upwards [isOpen_ball.mem_nhds hp] with z hz + exact piecewise_eq_of_mem _ _ _ hz + +theorem harmonicContOnCl_dirichletExtension {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) : + HarmonicContOnCl (dirichletExtension R u) (ball 0 R) := by + refine HarmonicContOnCl.mk_ball (fun p hp => ?_) ?_ + · exact (harmonicAt_congr_nhds (dirichletExtension_eventuallyEq hp)).mpr + (harmonicOnNhd_poissonExtension hR.le hu p hp) + · intro p hp + rcases lt_or_eq_of_le (mem_closedBall.mp hp) with hi | hb + · exact ((harmonicOnNhd_poissonExtension hR.le hu p hi).1.continuousAt.congr + (dirichletExtension_eventuallyEq hi).symm).continuousWithinAt + · have hs : p ∈ sphere (0 : ℂ) R := hb + have he := dirichletExtension_eq_on_sphere (u := u) hs + have hball : ContinuousWithinAt (dirichletExtension R u) (ball 0 R) p := by + rw [ContinuousWithinAt, he] + apply (tendsto_poissonExtension_at_sphere hR hu hs).congr' + filter_upwards [self_mem_nhdsWithin] with z hz + exact (piecewise_eq_of_mem _ _ _ hz).symm + have hsphere : ContinuousWithinAt (dirichletExtension R u) (sphere 0 R) p := + (hu p hs).congr dirichletExtension_eq_on_sphere he + simpa only [ball_union_sphere] using hball.union hsphere + +theorem circleAverage_comp_conj {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : ℂ → E) (R : ℝ) : circleAverage (fun z => f (conj z)) 0 R = circleAverage f 0 R := by + rw [circleAverage_eq_circleAverage_zero_one, circleAverage_eq_circleAverage_zero_one (f := f)] + calc + _ = circleAverage (fun z => f ((R : ℂ) * z⁻¹ + 0)) 0 1 := by + apply circleAverage_congr_sphere + intro z hz + have hzN : ‖z‖ = 1 := by simpa only [abs_one] using mem_sphere_zero_iff_norm.mp hz + simp only [Complex.inv_eq_conj hzN, map_add, map_mul, Complex.conj_ofReal, map_zero] + _ = _ := circleAverage_zero_one_congr_inv (f := fun z => f ((R : ℂ) * z + 0)) + +theorem poissonExtension_conj {R : ℝ} (hR : 0 ≤ R) {u : ℂ → ℝ} + (hu : ∀ z ∈ sphere 0 R, u (conj z) = -u z) (w : ℂ) : + poissonExtension R u (conj w) = -poissonExtension R u w := by + unfold poissonExtension + rw [← circleAverage_comp_conj (fun z => poissonKernel 0 (conj w) z * u z) R] + calc + _ = circleAverage (fun z => (-1 : ℝ) • (poissonKernel 0 w z * u z)) 0 R := by + apply circleAverage_congr_sphere + intro z hz + have he : poissonKernel 0 (conj w) (conj z) = poissonKernel 0 w z := by + simp only [poissonKernel, sub_zero, ← map_sub, Complex.norm_conj] + dsimp only + rw [he, hu z (by simpa only [abs_of_nonneg hR] using hz)] + simp + _ = _ := by rw [circleAverage_fun_smul, neg_one_smul] + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/PolynomialApproximation.lean b/lean/OAI/Analysis/Crouzeix/PolynomialApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6467694f8cb97ed142e2b756aebca10e6d87ed6d --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/PolynomialApproximation.lean @@ -0,0 +1,412 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Amplification +import OAI.Analysis.Crouzeix.ContourExistence +import OAI.Analysis.Crouzeix.ConvexNeighborhood +import OAI.Analysis.Crouzeix.RationalContours + +namespace OAI + +/-! Polynomial Approximation. -/ + +noncomputable section + +open scoped Topology + +open Set Filter Metric MeasureTheory + +namespace CrouzeixHilbert + +theorem SmoothContour.integral_deriv_mul_eq_zero_of_holomorphic + (Γ : SmoothContour) {U : Set ℂ} (hU : IsOpen U) (hc : Convex ℝ U) + (hΓ : Γ.trace ⊆ U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t * f (Γ.path t)) = 0 := by + obtain ⟨g, hg⟩ := hc.exists_forall_hasDerivWithinAt hf + have hd (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun t => g (Γ.path t)) (deriv Γ.path t * f (Γ.path t)) t := by + have he := ((hg _ (hΓ ⟨t, ht, rfl⟩)).hasDerivAt + (hU.mem_nhds (hΓ ⟨t, ht, rfl⟩))).hasFDerivAt.restrictScalars ℝ + convert! he.comp_hasDerivAt t (Γ.smooth.differentiable (by norm_num) t).hasDerivAt using 1 + have hi : IntervalIntegrable (fun t => deriv Γ.path t * f (Γ.path t)) + volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le zero_le_one] + exact Γ.smooth.continuous_deriv_one.continuousOn.mul + (hf.continuousOn.comp Γ.smooth.continuous.continuousOn + (fun t ht => hΓ ⟨t, ht, rfl⟩)) + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t ht => hd t (by simpa only [uIcc_of_le zero_le_one] using ht)) hi + simpa only [Γ.closed, sub_self] using he + +theorem SmoothContour.cauchy_formula_convex (Γ : SmoothContour) {U : Set ℂ} + (hU : IsOpen U) (hc : Convex ℝ U) (hΓ : Γ.trace ⊆ U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) {z : ℂ} + (hz : z ∈ U) (hzΓ : z ∉ Γ.trace) : + (2 * (Real.pi : ℂ) * Complex.I)⁻¹ * + (∫ t in (0 : ℝ)..1, deriv Γ.path t * f (Γ.path t) / (Γ.path t - z)) = + Γ.index z * f z := by + have hd : DifferentiableOn ℂ (dslope f z) U := + (Complex.differentiableOn_dslope (hU.mem_nhds hz)).mpr hf + have hi : IntervalIntegrable (fun t => deriv Γ.path t * dslope f z (Γ.path t)) + volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le zero_le_one] + exact Γ.smooth.continuous_deriv_one.continuousOn.mul + (hd.continuousOn.comp Γ.smooth.continuous.continuousOn (fun t ht => hΓ ⟨t, ht, rfl⟩)) + have he : (∫ t in (0 : ℝ)..1, deriv Γ.path t * f (Γ.path t) / (Γ.path t - z)) = + (∫ t in (0 : ℝ)..1, deriv Γ.path t * dslope f z (Γ.path t)) + + (∫ t in (0 : ℝ)..1, deriv Γ.path t / (Γ.path t - z)) * f z := by + rw [← intervalIntegral.integral_mul_const, ← intervalIntegral.integral_add hi + ((Γ.intervalIntegrable_indexIntegrand hzΓ).mul_const (f z))] + apply intervalIntegral.integral_congr + intro t ht + have hne : Γ.path t ≠ z := fun he => hzΓ ⟨t, by simpa using ht, he⟩ + dsimp only + rw [dslope_of_ne _ hne] + simp only [slope, vsub_eq_sub, smul_eq_mul] + ring + rw [he, Γ.integral_deriv_mul_eq_zero_of_holomorphic hU hc hΓ hd, zero_add] + exact (mul_assoc _ _ _).symm + +def compactCauchyKernel (K : Set ℂ) (w : ↥(Kᶜ)) : C(K, ℂ) := + ⟨fun z => ((w : ℂ) - z)⁻¹, (continuous_const.sub continuous_subtype_val).inv₀ + (by + intro z he + apply w.property + rw [show (w : ℂ) = (z : ℂ) from sub_eq_zero.mp he] + exact z.property)⟩ + +theorem continuous_compactCauchyKernel (K : Set ℂ) : Continuous (compactCauchyKernel K) := by + apply ContinuousMap.continuous_of_continuous_uncurry + apply ((continuous_subtype_val.comp continuous_fst).sub + (continuous_subtype_val.comp continuous_snd)).inv₀ + intro wz he + apply wz.1.property + rw [show (wz.1 : ℂ) = (wz.2 : ℂ) from sub_eq_zero.mp he] + exact wz.2.property + +theorem compactCauchyKernel_mem_iff_resolvent {K : Set ℂ} + (S : Subalgebra ℂ C(K, ℂ)) (x : S) (hx : ∀ z : K, (x : C(K, ℂ)) z = z) + (w : ↥(Kᶜ)) : compactCauchyKernel K w ∈ S ↔ (w : ℂ) ∈ resolventSet ℂ x := by + change _ ↔ IsUnit (algebraMap ℂ S (w : ℂ) - x) + rw [isUnit_iff_exists_inv] + constructor + · intro hw + refine ⟨⟨compactCauchyKernel K w, hw⟩, ?_⟩ + apply Subtype.ext + apply ContinuousMap.ext + intro z + change ((w : ℂ) - (x : C(K, ℂ)) z) * ((w : ℂ) - z)⁻¹ = 1 + rw [hx] + exact mul_inv_cancel₀ (fun he => w.property + ((sub_eq_zero.mp he).symm ▸ z.property)) + · rintro ⟨y, hy⟩ + have he : compactCauchyKernel K w = (y : C(K, ℂ)) := by + ext z + have hp := congrArg (fun f : S => (f : C(K, ℂ)) z) hy + change ((w : ℂ) - (x : C(K, ℂ)) z) * (y : C(K, ℂ)) z = 1 at hp + rw [hx] at hp + exact inv_eq_of_mul_eq_one_right hp + rw [he] + exact y.property + +theorem coordinate_resolventSet_subset_compl {K : Set ℂ} + (S : Subalgebra ℂ C(K, ℂ)) (x : S) (hx : ∀ z : K, (x : C(K, ℂ)) z = z) : + resolventSet ℂ x ⊆ Kᶜ := by + intro v hv hvin + obtain ⟨y, hy⟩ := isUnit_iff_exists_inv.mp hv + have he := congrArg (fun f : S => (f : C(K, ℂ)) ⟨v, hvin⟩) hy + change (v - (x : C(K, ℂ)) ⟨v, hvin⟩) * (y : C(K, ℂ)) ⟨v, hvin⟩ = 1 at he + rw [hx, sub_self, zero_mul] at he + exact zero_ne_one he + +theorem compactCauchyKernel_mem_polynomialClosure {K : Set ℂ} [CompactSpace K] + (hne : K.Nonempty) (hc : IsConnected Kᶜ) (w : ↥(Kᶜ)) : + compactCauchyKernel K w ∈ (polynomialFunctions K).topologicalClosure := by + have : Nonempty K := hne.to_subtype + let S := (polynomialFunctions K).topologicalClosure + have : IsClosed (S : Set C(K, ℂ)) := (polynomialFunctions K).isClosed_topologicalClosure + have : CompleteSpace S := IsClosed.completeSpace_coe + have : NormOneClass S := ⟨by change ‖(1 : C(K, ℂ))‖ = 1; exact norm_one⟩ + let x : S := ⟨Polynomial.X.toContinuousMapOn K, + (polynomialFunctions K).le_topologicalClosure (by + rw [← SetLike.mem_coe, polynomialFunctions_coe] + exact ⟨Polynomial.X, rfl⟩)⟩ + have hx (z : K) : (x : C(K, ℂ)) z = z := by simp [x] + have hiff := compactCauchyKernel_mem_iff_resolvent S x hx + have hsub := coordinate_resolventSet_subset_compl S x hx + have hcl : IsClopen {w : ↥(Kᶜ) | compactCauchyKernel K w ∈ S} := by + refine ⟨(show IsClosed (S : Set C(K, ℂ)) from inferInstance).preimage + (continuous_compactCauchyKernel K), ?_⟩ + have he : {w : ↥(Kᶜ) | compactCauchyKernel K w ∈ S} = + Subtype.val ⁻¹' resolventSet ℂ x := by ext w; exact hiff w + rw [he] + exact (spectrum.isOpen_resolventSet x).preimage continuous_subtype_val + have hgood : {w : ↥(Kᶜ) | compactCauchyKernel K w ∈ S}.Nonempty := by + let v : ℂ := (‖x‖ + 1 : ℝ) + have hv : v ∈ resolventSet ℂ x := by + apply spectrum.mem_resolventSet_of_norm_lt + simp only [v, Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (by positivity : (0 : ℝ) < ‖x‖ + 1)] + linarith + exact ⟨⟨v, hsub hv⟩, (hiff _).mpr hv⟩ + have : PreconnectedSpace ↥(Kᶜ) := isPreconnected_iff_preconnectedSpace.mp hc.isPreconnected + have he := Set.mem_univ w + rwa [← hcl.eq_univ hgood] at he + +def compactCauchyKernelExtension (K : Set ℂ) (w : ℂ) : C(K, ℂ) := by + classical + exact if hw : w ∈ Kᶜ then compactCauchyKernel K ⟨w, hw⟩ else 0 + +@[simp] +theorem compactCauchyKernelExtension_apply {K : Set ℂ} {w : ℂ} (hw : w ∉ K) (z : K) : + compactCauchyKernelExtension K w z = (w - z)⁻¹ := by + classical + unfold compactCauchyKernelExtension + split + · rfl + · contradiction + +theorem continuousOn_compactCauchyKernelExtension (K : Set ℂ) : + ContinuousOn (compactCauchyKernelExtension K) Kᶜ := by + rw [continuousOn_iff_continuous_domRestrict] + convert! continuous_compactCauchyKernel K using 1 + ext w z + exact compactCauchyKernelExtension_apply w.property z + +theorem intervalIntegral_mem_closedSubalgebra {E : Type*} [NormedCommRing E] + [NormedAlgebra ℂ E] [CompleteSpace E] (S : Subalgebra ℂ E) + (hS : IsClosed (S : Set E)) {g : ℝ → E} + (hg : IntervalIntegrable g volume 0 1) + (hm : ∀ t ∈ Icc (0 : ℝ) 1, g t ∈ S) : + (∫ t in (0 : ℝ)..1, g t) ∈ S := by + have : IsProbabilityMeasure (volume.restrict (Ioc (0 : ℝ) 1)) := ⟨by simp⟩ + rw [intervalIntegral.integral_of_le zero_le_one] + exact (S.toSubmodule.restrictScalars ℝ).convex.integral_mem hS + ((ae_restrict_mem measurableSet_Ioc).mono (fun t ht => hm t (Ioc_subset_Icc_self ht))) hg.1 + +theorem holomorphic_mem_polynomialClosure_of_convex_neighborhood + {K U : Set ℂ} [CompactSpace K] (hK : K.Nonempty) (hcomp : IsConnected Kᶜ) + (hU : IsOpen U) (hUc : Convex ℝ U) (hKU : K ⊆ U) + (Γ : CalculusContour K U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) : + (⟨fun z : K => f z, hf.continuousOn.mono hKU |>.domRestrict⟩ : C(K, ℂ)) ∈ + (polynomialFunctions K).topologicalClosure := by + let S := (polynomialFunctions K).topologicalClosure + let g : ℝ → C(K, ℂ) := fun t => + (deriv Γ.path t * f (Γ.path t)) • compactCauchyKernelExtension K (Γ.path t) + have hg : ContinuousOn g (Icc (0 : ℝ) 1) := by + exact (Γ.smooth.continuous_deriv_one.continuousOn.mul + (hf.continuousOn.comp Γ.smooth.continuous.continuousOn + (fun t ht => (Γ.avoids t ht).1))).smul + ((continuousOn_compactCauchyKernelExtension K).comp Γ.smooth.continuous.continuousOn + (fun t ht => (Γ.avoids t ht).2)) + have hi : IntervalIntegrable g volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using hg + have hm : ∀ t ∈ Icc (0 : ℝ) 1, g t ∈ S := by + intro t ht + apply S.smul_mem + classical + unfold compactCauchyKernelExtension + split + · exact compactCauchyKernel_mem_polynomialClosure hK hcomp _ + · rename_i he + exact (he (Γ.avoids t ht).2).elim + have he : (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • (∫ t in (0 : ℝ)..1, g t) = + (⟨fun z : K => f z, hf.continuousOn.mono hKU |>.domRestrict⟩ : C(K, ℂ)) := by + ext z + change (2 * (Real.pi : ℂ) * Complex.I)⁻¹ * + (ContinuousMap.evalCLM ℂ z (∫ t in (0 : ℝ)..1, g t)) = f z + rw [← (ContinuousMap.evalCLM ℂ z).intervalIntegral_comp_comm hi] + have he : (∫ t in (0 : ℝ)..1, ContinuousMap.evalCLM ℂ z (g t)) = + (∫ t in (0 : ℝ)..1, deriv Γ.path t * f (Γ.path t) / (Γ.path t - z)) := by + apply intervalIntegral.integral_congr + intro t ht + change (deriv Γ.path t * f (Γ.path t)) * compactCauchyKernelExtension K (Γ.path t) z = _ + dsimp only + rw [compactCauchyKernelExtension_apply (Γ.avoids t (by simpa using ht)).2, div_eq_mul_inv] + rw [he, Γ.toSmoothContour.cauchy_formula_convex hU hUc + (by rintro _ ⟨t, ht, rfl⟩; exact (Γ.avoids t ht).1) hf (hKU z.property) ?_, Γ.index_inside z z.property, one_mul] + rintro ⟨t, ht, htΓ⟩ + exact (Γ.avoids t ht).2 (htΓ.symm ▸ z.property) + rw [← he] + exact S.smul_mem (intervalIntegral_mem_closedSubalgebra S + (polynomialFunctions K).isClosed_topologicalClosure hi hm) _ + +theorem exists_polynomial_uniform_approx {K U : Set ℂ} + (hK : IsCompact K) (hc : Convex ℝ K) (hU : IsOpen U) (hKU : K ⊆ U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) {ε : ℝ} (hε : 0 < ε) : + ∃ p : Polynomial ℂ, ∀ z ∈ K, ‖p.eval z - f z‖ < ε := by + rcases K.eq_empty_or_nonempty with he | hne + · exact ⟨0, by simp [he]⟩ + have : CompactSpace K := isCompact_iff_compactSpace.mp hK + obtain ⟨δ, hδ, hδU⟩ := hK.exists_cthickening_subset_open hU hKU + let V := thickening δ K + have hVo : IsOpen V := isOpen_thickening + have hVc : Convex ℝ V := hc.thickening δ + have hKV : K ⊆ V := self_subset_thickening hδ K + have hVU : V ⊆ U := (thickening_subset_cthickening δ K).trans hδU + obtain ⟨Γ⟩ := exists_calculusContour hK hc hne hVo hKV + let g : C(K, ℂ) := ⟨fun z => f z, (hf.continuousOn.mono hKU).domRestrict⟩ + have hg : g ∈ (polynomialFunctions K).topologicalClosure := + holomorphic_mem_polynomialClosure_of_convex_neighborhood hne + (isPathConnected_compl_of_bounded_convex hK.isBounded hc).isConnected + hVo hVc hKV Γ (hf.mono hVU) + change g ∈ closure (polynomialFunctions K : Set C(K, ℂ)) at hg + obtain ⟨q, hq, hd⟩ := Metric.mem_closure_iff.mp hg ε hε + rw [polynomialFunctions_coe] at hq + obtain ⟨p, rfl⟩ := hq + refine ⟨p, fun z hz => ?_⟩ + have hle := ContinuousMap.dist_apply_le_dist (f := g) + (g := Polynomial.toContinuousMapOn p K) ⟨z, hz⟩ + rw [← dist_eq_norm, dist_comm] + exact lt_of_le_of_lt hle hd + +open scoped Matrix.Norms.L2Operator + +theorem matrix_norm_le_entry_bound {m : ℕ} (B : Coeff m) {δ : ℝ} + (hB : ∀ i j, ‖B i j‖ ≤ δ) : + ‖B‖ ≤ δ * (∑ i : Fin m, ∑ j : Fin m, ‖(Matrix.single i j (1 : ℂ) : Coeff m)‖) := by + have he : B = ∑ i, ∑ j, B i j • Matrix.single i j (1 : ℂ) := by + simpa only [Matrix.smul_single, smul_eq_mul, mul_one] using Matrix.matrix_eq_sum_single B + calc + ‖B‖ = ‖∑ i, ∑ j, B i j • Matrix.single i j (1 : ℂ)‖ := congrArg norm he + _ ≤ ∑ i, ∑ j, ‖B i j • (Matrix.single i j (1 : ℂ) : Coeff m)‖ := + (norm_sum_le _ _).trans (Finset.sum_le_sum (fun i _ => norm_sum_le _ _)) + _ ≤ ∑ i, ∑ j, δ * ‖(Matrix.single i j (1 : ℂ) : Coeff m)‖ := by + apply Finset.sum_le_sum + intro i _ + apply Finset.sum_le_sum + intro j _ + rw [norm_smul] + exact mul_le_mul_of_nonneg_right (hB i j) (norm_nonneg _) + _ = δ * (∑ i, ∑ j, ‖(Matrix.single i j (1 : ℂ) : Coeff m)‖) := by + simp only [Finset.mul_sum] + +theorem exists_matrixPolynomial_entries {m : ℕ} + (p : Fin m → Fin m → Polynomial ℂ) : + ∃ d : ℕ, ∃ B : Fin (d + 1) → Coeff m, + ∀ z i j, matrixPolynomial B z i j = (p i j).eval z := by + classical + let d := Finset.univ.sup (fun i : Fin m => Finset.univ.sup (fun j : Fin m => (p i j).natDegree)) + refine ⟨d, fun k i j => (p i j).coeff k, ?_⟩ + intro z i j + have hd : (p i j).natDegree < d + 1 := Nat.lt_succ_of_le (le_trans + (Finset.le_sup (f := fun j : Fin m => (p i j).natDegree) (Finset.mem_univ j)) + (Finset.le_sup (f := fun i : Fin m => Finset.univ.sup (fun j : Fin m => (p i j).natDegree)) + (Finset.mem_univ i))) + rw [Polynomial.eval_eq_sum_range' hd] + simp only [matrixPolynomial, Matrix.sum_apply] + rw [← Fin.sum_univ_eq_sum_range] + apply Finset.sum_congr rfl + intro k _ + exact mul_comm _ _ + +theorem exists_matrixPolynomial_uniform_approx {m : ℕ} {K U : Set ℂ} + (hK : IsCompact K) (hc : Convex ℝ K) (hU : IsOpen U) (hKU : K ⊆ U) + {F : ℂ → Coeff m} (hF : EntrywiseHolomorphic U F) {ε : ℝ} (hε : 0 < ε) : + ∃ d : ℕ, ∃ B : Fin (d + 1) → Coeff m, ∀ z ∈ K, ‖matrixPolynomial B z - F z‖ < ε := by + classical + let C : ℝ := ∑ i : Fin m, ∑ j : Fin m, ‖(Matrix.single i j (1 : ℂ) : Coeff m)‖ + have hC : 0 ≤ C := Finset.sum_nonneg (fun _ _ => Finset.sum_nonneg (fun _ _ => norm_nonneg _)) + have he : 0 < ε / (C + 1) := div_pos hε (by linarith) + have hp := fun i j => exists_polynomial_uniform_approx hK hc hU hKU (hF i j) he + choose p hp using hp + obtain ⟨d, B, hB⟩ := exists_matrixPolynomial_entries p + refine ⟨d, B, fun z hz => ?_⟩ + calc + ‖matrixPolynomial B z - F z‖ ≤ (ε / (C + 1)) * C := + matrix_norm_le_entry_bound _ (fun i j => by + simpa only [Matrix.sub_apply, hB] using (hp i j z hz).le) + _ < (ε / (C + 1)) * (C + 1) := mul_lt_mul_of_pos_left (by linarith) he + _ = ε := div_mul_cancel₀ _ (by linarith) + +theorem exists_matrixPolynomial_tendstoUniformlyOn {m : ℕ} {K U : Set ℂ} + (hK : IsCompact K) (hc : Convex ℝ K) (hU : IsOpen U) (hKU : K ⊆ U) + {F : ℂ → Coeff m} (hF : EntrywiseHolomorphic U F) : + ∃ degrees : ℕ → ℕ, ∃ B : (n : ℕ) → Fin (degrees n + 1) → Coeff m, + TendstoUniformlyOn (fun n => matrixPolynomial (B n)) F atTop K := by + have he (n : ℕ) : (0 : ℝ) < 1 / (n + 1) := by positivity + choose degrees B hB using fun n => exists_matrixPolynomial_uniform_approx hK hc hU hKU hF (he n) + refine ⟨degrees, B, Metric.tendstoUniformlyOn_iff.mpr (fun ε hε => ?_)⟩ + have ht : Tendsto (fun n : ℕ => (1 : ℝ) / (n + 1)) atTop (𝓝 0) := + tendsto_one_div_add_atTop_nhds_zero_nat + filter_upwards [ht.eventually (gt_mem_nhds hε)] with n hn z hz + rw [dist_comm, dist_eq_norm] + exact (hB n z hz).trans hn + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem exists_contour_bound_of_polynomial_bound [CompleteSpace H] [Nontrivial H] + (A : Operator H) {m : ℕ} {U : Set ℂ} (F : ℂ → Coeff m) + (hU : IsOpen U) (hKU : numericalClosure A ⊆ U) (hF : EntrywiseHolomorphic U F) + (hpoly : ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B)) : + ∃ Γ : CalculusContour (numericalClosure A) U, + ‖matrixContourEval A Γ.toSmoothContour F‖ ≤ 2 * supNorm (numericalClosure A) F := by + obtain ⟨ε, _hε, hL, hLc, hKL, hLU, _hcomp⟩ := exists_compact_convex_neighborhood A hU hKU + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) isOpen_interior hKL + let Δ : CalculusContour (numericalClosure A) U := + { toSmoothContour := Γ.toSmoothContour + avoids := fun t ht => ⟨hLU (interior_subset (Γ.avoids t ht).1), (Γ.avoids t ht).2⟩ + index_inside := Γ.index_inside + index_outside := fun z hz => Γ.index_outside z (fun he => hz (hLU (interior_subset he))) } + obtain ⟨degrees, B, happ⟩ := exists_matrixPolynomial_tendstoUniformlyOn hL hLc hU hLU hF + refine ⟨Δ, contour_bound_of_uniform_polynomials A Δ F (hF.continuousOn.mono hKU) + hpoly degrees B (happ.mono ?_)⟩ + rintro z (hz | ⟨t, ht, rfl⟩) + · exact interior_subset (hKL hz) + · exact interior_subset (Γ.avoids t ht).1 + +theorem holomorphicEval_eq_contourEval_of_independent (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (f : ℂ → ℂ) + (hind : ∀ Δ : CalculusContour (numericalClosure A) U, + contourEval A Δ.toSmoothContour f = contourEval A Γ.toSmoothContour f) : + holomorphicEval A U f = contourEval A Γ.toSmoothContour f := by + classical + rw [holomorphicEval, dite_eq_left (show Nonempty (CalculusContour (numericalClosure A) U) from ⟨Γ⟩)] + exact hind _ + +theorem nonzeroConclusion_of_finite_bound_and_contour_independence + [CompleteSpace H] [Nontrivial H] (A : Operator H) + (hfin : FiniteMatrixPolynomialBound) + (hind : ∀ (U : Set ℂ), IsOpen U → numericalClosure A ⊆ U → + ∀ (f : ℂ → ℂ), DifferentiableOn ℂ f U → + ∀ Γ Δ : CalculusContour (numericalClosure A) U, + contourEval A Γ.toSmoothContour f = contourEval A Δ.toSmoothContour f) : + NonzeroConclusion A := by + have hhol (m : ℕ) (hm : 0 < m) (U : Set ℂ) (F : ℂ → Coeff m) + (hU : IsOpen U) (hKU : numericalClosure A ⊆ U) (hF : EntrywiseHolomorphic U F) : + Nonempty (CalculusContour (numericalClosure A) U) ∧ + (∀ Γ : CalculusContour (numericalClosure A) U, ∀ i j, + holomorphicEval A U (fun z => F z i j) = + contourEval A Γ.toSmoothContour (fun z => F z i j)) ∧ + ‖matrixHolomorphicEval A U F‖ ≤ 2 * supNorm (numericalClosure A) F ∧ + ∃ z ∈ numericalClosure A, supNorm (numericalClosure A) F = ‖F z‖ := by + obtain ⟨Γ, hb⟩ := exists_contour_bound_of_polynomial_bound A F hU hKU hF + (fun _ B => polynomial_bound_of_finite_matrix_bound hfin A hm B) + have hsame (Δ : CalculusContour (numericalClosure A) U) (i j : Fin m) : + holomorphicEval A U (fun z => F z i j) = + contourEval A Δ.toSmoothContour (fun z => F z i j) := + holomorphicEval_eq_contourEval_of_independent A Δ _ + (fun Γ => hind U hU hKU _ (hF i j) Γ Δ) + refine ⟨⟨Γ⟩, hsame, ?_, holomorphic_sup_attained A hKU hF⟩ + have he : matrixHolomorphicEval A U F = matrixContourEval A Γ.toSmoothContour F := by + simp only [matrixHolomorphicEval, matrixContourEval, hsame Γ] + rwa [he] + refine ⟨isCompact_numericalClosure A, convex_numericalClosure A, + spectrum_subset_numericalClosure A, ?_, hhol, ?_⟩ + · intro m hm d B + exact ⟨polynomial_bound_of_finite_matrix_bound hfin A hm B, polynomial_sup_eq_max A B⟩ + · intro m hm R hR + exact rational_conclusion_of_holomorphic_bound A + (fun U F hU hKU hF => ⟨(hhol m hm U F hU hKU hF).1, (hhol m hm U F hU hKU hF).2.2.1⟩) + R hR + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/RationalContours.lean b/lean/OAI/Analysis/Crouzeix/RationalContours.lean new file mode 100644 index 0000000000000000000000000000000000000000..14d90038a2762247e5ac7dd542be90dc82a70670 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/RationalContours.lean @@ -0,0 +1,353 @@ +import Mathlib +import OAI.Analysis.Crouzeix.ContourPolynomials + +namespace OAI + +/-! Rational Contours. -/ + +noncomputable section + +open scoped InnerProductSpace Topology TensorProduct Matrix.Norms.L2Operator + +open Set Filter + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem SmoothContour.integral_deriv_mul_inv_pow_succ_succ (Γ : SmoothContour) + {a : ℂ} (ha : a ∉ Γ.trace) (n : ℕ) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ (n + 2)) = 0 := by + have hn : (n + 1 : ℂ) ≠ 0 := by exact_mod_cast n.succ_ne_zero + have hnz (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : Γ.path t - a ≠ 0 := by + intro he + exact ha ((sub_eq_zero.mp he) ▸ mem_image_of_mem Γ.path ht) + have hder (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : + HasDerivAt (fun r : ℝ => -(n + 1 : ℂ)⁻¹ * ((Γ.path r - a)⁻¹) ^ (n + 1)) + (deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ (n + 2)) t := by + have h := ((((Γ.smooth.differentiable (by norm_num) t).hasDerivAt.sub_const a).inv + (hnz t ht)).pow (n + 1)).const_mul (-(n + 1 : ℂ)⁻¹) + convert! h using 1 + simp only [Nat.cast_add, Nat.cast_one, Nat.add_sub_cancel] + simp only [Pi.inv_apply, div_eq_mul_inv, ← inv_pow] + have hscalar : -(n + 1 : ℂ)⁻¹ * ((n + 1) * (Γ.path t - a)⁻¹ ^ n * + (-deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ 2)) = + ((n + 1 : ℂ)⁻¹ * (n + 1)) * deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ (n + 2) := by + rw [pow_add] + ring + rw [hscalar, inv_mul_cancel₀ hn, one_mul] + have hc : ContinuousOn (fun t => (Γ.path t - a)⁻¹) (Icc (0 : ℝ) 1) := + (Γ.smooth.continuous.sub continuous_const).continuousOn.inv₀ hnz + have hi : IntervalIntegrable (fun t => deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ (n + 2)) + MeasureTheory.volume (0 : ℝ) 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using! + Γ.smooth.continuous_deriv_one.continuousOn.mul (hc.pow (n + 2)) + have he := intervalIntegral.integral_eq_sub_of_hasDerivAt + (f := fun t => -(n + 1 : ℂ)⁻¹ * ((Γ.path t - a)⁻¹) ^ (n + 1)) + (fun t ht => hder t (by simpa using ht)) hi + simpa only [Γ.closed, sub_self] using he + +theorem SmoothContour.integral_deriv_mul_inv_pow (Γ : SmoothContour) {a : ℂ} + (ha : a ∉ Γ.trace) (hind : Γ.index a = 0) (n : ℕ) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ (n + 1)) = 0 := by + cases n with + | zero => simpa only [zero_add, pow_one, div_eq_mul_inv] using + Γ.integral_deriv_div_eq_zero hind + | succ n => exact Γ.integral_deriv_mul_inv_pow_succ_succ ha n + +theorem SmoothContour.integral_deriv_mul_polynomial (Γ : SmoothContour) (p : Polynomial ℂ) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t * p.eval (Γ.path t)) = 0 := by + simp_rw [Polynomial.eval_eq_sum_range, Finset.mul_sum] + rw [intervalIntegral.integral_finsetSum] + · have he (k : ℕ) : (fun t => deriv Γ.path t * (p.coeff k * Γ.path t ^ k)) = + fun t => p.coeff k * (deriv Γ.path t * Γ.path t ^ k) := by ext t; ring + simp_rw [he, intervalIntegral.integral_const_mul, Γ.integral_deriv_mul_pow, mul_zero] + simp + · intro k _ + exact (Γ.smooth.continuous_deriv_one.mul + (continuous_const.mul (Γ.smooth.continuous.pow k))).intervalIntegrable _ _ + +theorem denominator_eq_prod (r : RatFunc ℂ) : + r.denom = ∏ a ∈ r.denom.roots.toFinset, + (Polynomial.X - Polynomial.C a) ^ r.denom.roots.count a := by + classical + exact ((IsAlgClosed.splits r.denom).eq_prod_roots_of_monic (RatFunc.monic_denom r)).trans + (Finset.prod_multiset_map_count _ _) + +theorem polynomial_quotient_partialFractions (p q : Polynomial ℂ) (hq : q.Monic) + (S : Set ℂ) (hS : ∀ z ∈ S, q.eval z ≠ 0) : + ∃ (p₀ : Polynomial ℂ) (c : (a : ℂ) → Fin (q.roots.count a) → ℂ), + ∀ z ∈ S, p.eval z / q.eval z = p₀.eval z + + ∑ a ∈ q.roots.toFinset, ∑ j : Fin (q.roots.count a), + c a j * ((z - a)⁻¹) ^ (j.1 + 1) := by + classical + let φ : Polynomial ℂ →+* (S → ℂ) := + RingHom.pi (fun z : S => Polynomial.evalRingHom (z : ℂ)) + let : Algebra (Polynomial ℂ) (S → ℂ) := φ.toAlgebra + let gi : ℂ → S → ℂ := fun a z => ((z : ℂ) - a)⁻¹ + have hmap (p : Polynomial ℂ) (z : S) : + algebraMap (Polynomial ℂ) (S → ℂ) p z = p.eval (z : ℂ) := rfl + have hgi (a : ℂ) (ha : a ∈ q.roots.toFinset) : + gi a * algebraMap (Polynomial ℂ) (S → ℂ) (Polynomial.X - Polynomial.C a) = 1 := by + ext z + change ((z : ℂ) - a)⁻¹ * ((Polynomial.X - Polynomial.C a).eval (z : ℂ)) = 1 + rw [Polynomial.eval_sub, Polynomial.eval_X, Polynomial.eval_C] + apply inv_mul_cancel₀ + intro he + exact hS z z.property ((sub_eq_zero.mp he) ▸ + ((Polynomial.mem_roots hq.ne_zero).mp (Multiset.mem_toFinset.mp ha))) + obtain ⟨p₀, r, hr, he⟩ := Polynomial.mul_prod_pow_inverse_eq_quo_add_sum_rem_mul_pow_inverse + (K := S → ℂ) (s := q.roots.toFinset) p + (g := fun a => Polynomial.X - Polynomial.C a) + (fun a _ => Polynomial.monic_X_sub_C a) + (fun _ _ _ _ hne => Polynomial.pairwise_coprime_X_sub_C Function.injective_id hne) + (fun a => q.roots.count a) hgi + have hconst (a : ℂ) (ha : a ∈ q.roots.toFinset) (j : Fin (q.roots.count a)) : + r a j = Polynomial.C ((r a j).coeff 0) := by + apply Polynomial.degree_le_zero_iff.mp + have h := hr a ha j + rw [Polynomial.degree_X_sub_C] at h + exact Order.le_of_lt_succ h + refine ⟨p₀, fun a j => (r a j).coeff 0, fun z hz => ?_⟩ + have hden : q = ∏ a ∈ q.roots.toFinset, (Polynomial.X - Polynomial.C a) ^ q.roots.count a := by + exact ((IsAlgClosed.splits q).eq_prod_roots_of_monic hq).trans + (Finset.prod_multiset_map_count _ _) + have hez := congrFun he (⟨z, hz⟩ : S) + simp only [Pi.mul_apply, Pi.pow_apply, Finset.prod_apply, + Pi.add_apply, Finset.sum_apply, hmap, gi] at hez + have hnume : ∑ a ∈ q.roots.toFinset, ∑ j : Fin (q.roots.count a), + (r a j).eval z * ((z - a)⁻¹) ^ (j.1 + 1) = + ∑ a ∈ q.roots.toFinset, ∑ j : Fin (q.roots.count a), + (r a j).coeff 0 * ((z - a)⁻¹) ^ (j.1 + 1) := by + apply Finset.sum_congr rfl + intro a ha + apply Finset.sum_congr rfl + intro j _ + rw [hconst a ha j, Polynomial.eval_C, Polynomial.coeff_C_zero] + rw [← hnume, ← hez] + conv_lhs => rw [hden] + simp only [Polynomial.eval_prod, Polynomial.eval_pow, Polynomial.eval_sub, + Polynomial.eval_X, Polynomial.eval_C, div_eq_mul_inv, Finset.prod_inv_distrib, inv_pow] + +theorem SmoothContour.integral_deriv_mul_quotient (Γ : SmoothContour) + (p q : Polynomial ℂ) (hq : q.Monic) + (hnz : ∀ z ∈ Γ.trace, q.eval z ≠ 0) + (hind : ∀ a ∈ q.roots, Γ.index a = 0) : + (∫ t in (0 : ℝ)..1, deriv Γ.path t * (p.eval (Γ.path t) / q.eval (Γ.path t))) = 0 := by + classical + obtain ⟨p₀, c, he⟩ := polynomial_quotient_partialFractions p q hq Γ.trace hnz + have ha (a : ℂ) (ha : a ∈ q.roots.toFinset) : a ∉ Γ.trace := by + intro he + exact hnz a he ((Polynomial.mem_roots hq.ne_zero).mp (Multiset.mem_toFinset.mp ha)) + have hc (a : ℂ) (ha' : a ∈ q.roots.toFinset) : + ContinuousOn (fun t : ℝ => (Γ.path t - a)⁻¹) (Icc (0 : ℝ) 1) := by + apply (Γ.smooth.continuous.sub continuous_const).continuousOn.inv₀ + intro t ht he + exact ha a ha' ⟨t, ht, sub_eq_zero.mp he⟩ + have hi (a : ℂ) (ha' : a ∈ q.roots.toFinset) (j : Fin (q.roots.count a)) : + IntervalIntegrable (fun t : ℝ => deriv Γ.path t * + (c a j * ((Γ.path t - a)⁻¹) ^ (j.1 + 1))) MeasureTheory.volume 0 1 := by + apply ContinuousOn.intervalIntegrable + simpa only [uIcc_of_le zero_le_one] using! + Γ.smooth.continuous_deriv_one.continuousOn.mul (continuousOn_const.mul ((hc a ha').pow _)) + have hiinner (a : ℂ) (ha' : a ∈ q.roots.toFinset) : + IntervalIntegrable (fun t : ℝ => ∑ j : Fin (q.roots.count a), deriv Γ.path t * + (c a j * ((Γ.path t - a)⁻¹) ^ (j.1 + 1))) MeasureTheory.volume 0 1 := by + exact IntervalIntegrable.congr (fun t _ => Finset.sum_apply t _ _) + (IntervalIntegrable.sum Finset.univ (fun j _ => hi a ha' j)) + have hisum : IntervalIntegrable (fun t : ℝ => + ∑ a ∈ q.roots.toFinset, ∑ j : Fin (q.roots.count a), deriv Γ.path t * + (c a j * ((Γ.path t - a)⁻¹) ^ (j.1 + 1))) MeasureTheory.volume 0 1 := by + exact IntervalIntegrable.congr (fun t _ => Finset.sum_apply t _ _) + (IntervalIntegrable.sum q.roots.toFinset hiinner) + have hip : IntervalIntegrable (fun t => deriv Γ.path t * p₀.eval (Γ.path t)) + MeasureTheory.volume (0 : ℝ) 1 := + (Γ.smooth.continuous_deriv_one.mul (p₀.continuous.comp Γ.smooth.continuous)).intervalIntegrable 0 1 + calc + _ = ∫ t in (0 : ℝ)..1, deriv Γ.path t * p₀.eval (Γ.path t) + + ∑ a ∈ q.roots.toFinset, ∑ j : Fin (q.roots.count a), deriv Γ.path t * + (c a j * ((Γ.path t - a)⁻¹) ^ (j.1 + 1)) := by + apply intervalIntegral.integral_congr + intro t ht + dsimp only + rw [he (Γ.path t) (mem_image_of_mem _ (by simpa using ht))] + simp only [mul_add, Finset.mul_sum] + _ = 0 := by + rw [intervalIntegral.integral_add hip hisum, Γ.integral_deriv_mul_polynomial, zero_add, + intervalIntegral.integral_finsetSum hiinner] + apply Finset.sum_eq_zero + intro a ha' + rw [intervalIntegral.integral_finsetSum (fun j _ => hi a ha' j)] + apply Finset.sum_eq_zero + intro j _ + have heq : (fun t : ℝ => deriv Γ.path t * (c a j * ((Γ.path t - a)⁻¹) ^ (j.1 + 1))) = + fun t => c a j * (deriv Γ.path t * ((Γ.path t - a)⁻¹) ^ (j.1 + 1)) := by + ext t + ring + rw [heq, intervalIntegral.integral_const_mul, + Γ.integral_deriv_mul_inv_pow (ha a ha') (hind a (Multiset.mem_toFinset.mp ha')), mul_zero] + +theorem contourEval_pow_mul_of_integral_eq_zero [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {f : ℂ → ℂ} + (hf : ContinuousOn f Γ.toSmoothContour.trace) + (hzero : ∀ n : ℕ, (∫ t in (0 : ℝ)..1, + deriv Γ.path t * (Γ.path t ^ n * f (Γ.path t))) = 0) (n : ℕ) : + contourEval A Γ.toSmoothContour (fun z => z ^ n * f z) = + A ^ n * contourEval A Γ.toSmoothContour f := by + induction n with + | zero => simp only [pow_zero, one_mul] + | succ n ih => + have he := contourEval_mul_id_of_integral_eq_zero A Γ (f := fun z => z ^ n * f z) + ((continuous_pow n).continuousOn.mul hf) (hzero n) + simpa only [← mul_assoc, ← pow_succ', ih] using he + +theorem contourEval_polynomial_mul_of_integral_eq_zero [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {f : ℂ → ℂ} + (hf : ContinuousOn f Γ.toSmoothContour.trace) + (hzero : ∀ n : ℕ, (∫ t in (0 : ℝ)..1, + deriv Γ.path t * (Γ.path t ^ n * f (Γ.path t))) = 0) (p : Polynomial ℂ) : + contourEval A Γ.toSmoothContour (fun z => p.eval z * f z) = + Polynomial.aeval A p * contourEval A Γ.toSmoothContour f := by + simp_rw [Polynomial.eval_eq_sum_range, Finset.sum_mul, Polynomial.aeval_eq_sum_range] + rw [contourEval_sum A Γ (Finset.range (p.natDegree + 1)) + (fun k z => (p.coeff k * z ^ k) * f z) + (fun k _ => (continuousOn_const.mul (continuous_pow k).continuousOn).mul hf)] + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro k _ + simp_rw [mul_assoc] + rw [contourEval_const_mul, contourEval_pow_mul_of_integral_eq_zero A Γ hf hzero, + smul_mul_assoc] + +theorem CalculusContour.inside_subset {K U : Set ℂ} (Γ : CalculusContour K U) : K ⊆ U := by + intro z hz + by_contra he + exact one_ne_zero ((Γ.index_inside z hz).symm.trans (Γ.index_outside z he)) + +theorem contourEval_quotient [CompleteSpace H] [Nontrivial H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + (p q : Polynomial ℂ) (hq : q.Monic) (hqu : ∀ z ∈ U, q.eval z ≠ 0) : + contourEval A Γ.toSmoothContour (fun z => p.eval z / q.eval z) = + Polynomial.aeval A p * Ring.inverse (Polynomial.aeval A q) := by + have hqt (z : ℂ) (hz : z ∈ Γ.toSmoothContour.trace) : q.eval z ≠ 0 := by + obtain ⟨t, ht, rfl⟩ := hz + exact hqu _ (Γ.avoids t ht).1 + have hind (a : ℂ) (ha : a ∈ q.roots) : Γ.toSmoothContour.index a = 0 := by + apply Γ.index_outside + intro hau + exact hqu a hau ((Polynomial.mem_roots hq.ne_zero).mp ha) + have hzero (n : ℕ) : (∫ t in (0 : ℝ)..1, + deriv Γ.path t * (Γ.path t ^ n * (p.eval (Γ.path t) / q.eval (Γ.path t)))) = 0 := by + have hi := Γ.toSmoothContour.integral_deriv_mul_quotient + (Polynomial.X ^ n * p) q hq hqt hind + simpa only [Polynomial.eval_mul, Polynomial.eval_pow, Polynomial.eval_X, mul_div_assoc] using hi + have hf : ContinuousOn (fun z => p.eval z / q.eval z) Γ.toSmoothContour.trace := + p.continuous.continuousOn.div q.continuous.continuousOn hqt + have he := contourEval_polynomial_mul_of_integral_eq_zero A Γ hf hzero q + have heq : contourEval A Γ.toSmoothContour (fun z => q.eval z * (p.eval z / q.eval z)) = + Polynomial.aeval A p := by + calc + _ = contourEval A Γ.toSmoothContour p.eval := by + apply contourEval_congr + intro z hz + exact mul_div_cancel₀ _ (hqt z hz) + _ = _ := contourEval_polynomial A Γ p + have hu : IsUnit (Polynomial.aeval A q) := + isUnit_polynomial_aeval A q (fun z hz => hqu z (Γ.inside_subset hz)) + apply hu.mul_left_cancel + calc + _ = Polynomial.aeval A p := he.symm.trans heq + _ = Polynomial.aeval A q * (Polynomial.aeval A p * Ring.inverse (Polynomial.aeval A q)) := by + rw [← mul_assoc, ((Commute.all q p).map (Polynomial.aeval A)).eq, + mul_assoc, Ring.mul_inverse_cancel _ hu, mul_one] + +theorem contourEval_rational [CompleteSpace H] [Nontrivial H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (r : RatFunc ℂ) + (hr : ∀ z ∈ U, r.denom.eval z ≠ 0) : + contourEval A Γ.toSmoothContour (fun z => RatFunc.eval (RingHom.id ℂ) z r) = + rationalEval A r := by + simpa only [rationalEval, RatFunc.eval, Polynomial.eval₂_id] using + contourEval_quotient A Γ r.num r.denom (RatFunc.monic_denom r) hr + +theorem matrixContourEval_matrixRationalFunction [CompleteSpace H] [Nontrivial H] + (A : Operator H) {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {m : ℕ} (R : RationalMatrix m) (hR : PolesOutside U R) : + matrixContourEval A Γ.toSmoothContour (matrixRationalFunction R) = matrixRationalEval A R := by + unfold matrixContourEval matrixRationalEval matrixRationalFunction + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [contourEval_rational A Γ (R i j) (hR i j)] + +theorem holomorphicEval_rational [CompleteSpace H] [Nontrivial H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) (r : RatFunc ℂ) + (hr : ∀ z ∈ U, r.denom.eval z ≠ 0) : + holomorphicEval A U (fun z => RatFunc.eval (RingHom.id ℂ) z r) = rationalEval A r := by + unfold holomorphicEval + rw [dite_eq_left (show Nonempty (CalculusContour (numericalClosure A) U) from ⟨Γ⟩)] + exact contourEval_rational A _ r hr + +theorem matrixHolomorphicEval_matrixRationalFunction [CompleteSpace H] [Nontrivial H] + (A : Operator H) {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {m : ℕ} (R : RationalMatrix m) (hR : PolesOutside U R) : + matrixHolomorphicEval A U (matrixRationalFunction R) = matrixRationalEval A R := by + unfold matrixHolomorphicEval matrixRationalEval matrixRationalFunction + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [holomorphicEval_rational A Γ (R i j) (hR i j)] + +theorem rational_poleFree_neighborhood {m : ℕ} {K : Set ℂ} + (R : RationalMatrix m) (hR : PolesOutside K R) : + ∃ U : Set ℂ, IsOpen U ∧ K ⊆ U ∧ PolesOutside U R ∧ + EntrywiseHolomorphic U (matrixRationalFunction R) := by + let U : Set ℂ := ⋂ i, ⋂ j, {z : ℂ | (R i j).denom.eval z ≠ 0} + have hne : PolesOutside U R := by + intro i j z hz + exact Set.mem_iInter.mp (Set.mem_iInter.mp hz i) j + refine ⟨U, ?_, ?_, hne, ?_⟩ + · apply isOpen_iInter_of_finite + intro i + apply isOpen_iInter_of_finite + intro j + exact isOpen_ne.preimage (R i j).denom.continuous + · intro z hz + exact Set.mem_iInter.mpr (fun i => Set.mem_iInter.mpr (fun j => hR i j z hz)) + · intro i j + simp only [matrixRationalFunction, RatFunc.eval, Polynomial.eval₂_id] + exact DifferentiableOn.div (𝕜 := ℂ) (𝕜' := ℂ) + (R i j).num.differentiableOn (R i j).denom.differentiableOn (hne i j) + +theorem rational_conclusion_of_holomorphic_bound [CompleteSpace H] [Nontrivial H] + (A : Operator H) {m : ℕ} + (hhol : ∀ (U : Set ℂ) (F : ℂ → Coeff m), IsOpen U → + numericalClosure A ⊆ U → EntrywiseHolomorphic U F → + Nonempty (CalculusContour (numericalClosure A) U) ∧ + ‖matrixHolomorphicEval A U F‖ ≤ 2 * supNorm (numericalClosure A) F) + (R : RationalMatrix m) (hR : PolesOutside (numericalClosure A) R) : + (∀ i j, IsUnit (Polynomial.aeval A (R i j).denom)) ∧ + ‖matrixRationalEval A R‖ ≤ + 2 * supNorm (numericalClosure A) (matrixRationalFunction R) ∧ + (∃ z ∈ numericalClosure A, + supNorm (numericalClosure A) (matrixRationalFunction R) = + ‖matrixRationalFunction R z‖) ∧ + ∃ U : Set ℂ, IsOpen U ∧ numericalClosure A ⊆ U ∧ + EntrywiseHolomorphic U (matrixRationalFunction R) ∧ + matrixRationalEval A R = matrixHolomorphicEval A U (matrixRationalFunction R) := by + obtain ⟨U, hU, hKU, hpoles, hF⟩ := rational_poleFree_neighborhood R hR + obtain ⟨⟨Γ⟩, hb⟩ := hhol U (matrixRationalFunction R) hU hKU hF + have he := matrixHolomorphicEval_matrixRationalFunction A Γ R hpoles + refine ⟨rational_denominators_isUnit A R hR, ?_, + rational_sup_attained A R hR, U, hU, hKU, hF, he.symm⟩ + rwa [he] at hb + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/RationalEvaluation.lean b/lean/OAI/Analysis/Crouzeix/RationalEvaluation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0837c5cbfffcc254633eebc0e197bc7b0c336003 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/RationalEvaluation.lean @@ -0,0 +1,102 @@ +import Mathlib +import OAI.Analysis.Crouzeix.NumericalRange + +namespace OAI + +/-! Holomorphic continuity, pole-free rational evaluation, and tensor norm bounds. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem EntrywiseHolomorphic.continuousOn {m : ℕ} {U : Set ℂ} {F : ℂ → Coeff m} + (hF : EntrywiseHolomorphic U F) : ContinuousOn F U := by + apply continuousOn_pi.mpr + intro i + apply continuousOn_pi.mpr + intro j + exact (hF i j).continuousOn + +theorem holomorphic_sup_attained [Nontrivial H] (A : Operator H) + {m : ℕ} {U : Set ℂ} {F : ℂ → Coeff m} + (hU : numericalClosure A ⊆ U) (hF : EntrywiseHolomorphic U F) : + ∃ z ∈ numericalClosure A, supNorm (numericalClosure A) F = ‖F z‖ := + supNorm_attained (isCompact_numericalClosure A) (numericalClosure_nonempty A) + (hF.continuousOn.mono hU) + +theorem isUnit_polynomial_aeval [CompleteSpace H] [Nontrivial H] + (A : Operator H) (p : Polynomial ℂ) + (hp : ∀ z ∈ numericalClosure A, p.eval z ≠ 0) : + IsUnit (Polynomial.aeval A p) := by + apply spectrum.isUnit_of_zero_notMem ℂ + rw [spectrum.map_polynomial_aeval A p] + rintro ⟨z, hz, heq⟩ + exact hp z (spectrum_subset_numericalClosure A hz) heq + +theorem rational_denominators_isUnit [CompleteSpace H] [Nontrivial H] + (A : Operator H) {m : ℕ} (R : RationalMatrix m) + (hR : PolesOutside (numericalClosure A) R) : + ∀ i j, IsUnit (Polynomial.aeval A (R i j).denom) := + fun i j => isUnit_polynomial_aeval A (R i j).denom (hR i j) + +theorem rational_holomorphic_neighborhood {m : ℕ} {K : Set ℂ} + (R : RationalMatrix m) (hR : PolesOutside K R) : + ∃ U : Set ℂ, IsOpen U ∧ K ⊆ U ∧ + EntrywiseHolomorphic U (matrixRationalFunction R) := by + let U : Set ℂ := ⋂ i, ⋂ j, {z : ℂ | (R i j).denom.eval z ≠ 0} + have hne : ∀ z ∈ U, ∀ i j, (R i j).denom.eval z ≠ 0 := by + intro z hz i j + exact Set.mem_iInter.mp (Set.mem_iInter.mp hz i) j + refine ⟨U, ?_, ?_, ?_⟩ + · apply isOpen_iInter_of_finite + intro i + apply isOpen_iInter_of_finite + intro j + exact isOpen_ne.preimage (R i j).denom.continuous + · intro z hz + exact Set.mem_iInter.mpr (fun i => Set.mem_iInter.mpr (fun j => hR i j z hz)) + · intro i j + simp only [matrixRationalFunction, RatFunc.eval, Polynomial.eval₂_id] + exact DifferentiableOn.div (𝕜 := ℂ) (𝕜' := ℂ) + (R i j).num.differentiableOn (R i j).denom.differentiableOn + (fun z hz => hne z hz i j) + +theorem rational_sup_attained [Nontrivial H] (A : Operator H) + {m : ℕ} (R : RationalMatrix m) (hR : PolesOutside (numericalClosure A) R) : + ∃ z ∈ numericalClosure A, supNorm (numericalClosure A) (matrixRationalFunction R) = + ‖matrixRationalFunction R z‖ := by + obtain ⟨U, _, hU, hF⟩ := rational_holomorphic_neighborhood R hR + exact holomorphic_sup_attained A hU hF + +theorem norm_tensorOperator_le (A : Operator H) {m : ℕ} (B : Coeff m) : + ‖tensorOperator A B‖ ≤ ‖A‖ * ‖B‖ := by + apply (tensorOperator A B).opNorm_le_bound (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + intro x + refine UniformSpace.Completion.induction_on x + (isClosed_le (tensorOperator A B).continuous.norm + (continuous_const.mul continuous_norm)) ?_ + intro a + simp only [tensorOperator, ContinuousLinearMap.completion_apply_coe, + UniformSpace.Completion.norm_coe] + exact ((TensorProduct.mapL A (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin m) B)).le_opNorm a).trans + (mul_le_mul_of_nonneg_right (TensorProduct.norm_mapL_le A (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin m) B)) + (norm_nonneg _)) + +@[simp] +theorem tensorOperator_zero_right (A : Operator H) (m : ℕ) : + tensorOperator A (0 : Coeff m) = 0 := by + apply norm_le_zero_iff.mp + simpa using norm_tensorOperator_le A (0 : Coeff m) + +end CrouzeixHilbert +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/RationalTransfer.lean b/lean/OAI/Analysis/Crouzeix/RationalTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..e96f0c4d21158dda2d1517c7b319812e9836d7ee --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/RationalTransfer.lean @@ -0,0 +1,276 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Definitions +import OAI.Analysis.Crouzeix.RationalEvaluation +import OAI.Analysis.Crouzeix.Realization + +namespace OAI + +/-! Rational Transfer. -/ + +noncomputable section + +open Set Filter + +open scoped Topology Matrix Matrix.Norms.L2Operator + +namespace CrouzeixHilbert.Realization + +theorem ratFunc_denom_ne_zero_on_closedDisk (r : RatFunc ℂ) (C : ℝ) + (h : ∀ z : ℂ, ‖z‖ < 1 → ‖RatFunc.eval (RingHom.id ℂ) z r‖ ≤ C) : + ∀ z : ℂ, ‖z‖ ≤ 1 → r.denom.eval z ≠ 0 := by + let Z : Set ℂ := {z | r.denom.eval z = 0} + have hf : Z.Finite := Polynomial.finite_setOfPred_isRoot r.denom_ne_zero + have hd : Dense (Zᶜ) := by + exact ((dense_univ (X := ℂ)).sdiff_finite hf).mono (fun _ hz => hz.2) + let S : Set ℂ := {z | ‖r.num.eval z‖ ≤ C * ‖r.denom.eval z‖} + have hS : IsClosed S := isClosed_le r.num.continuous.norm (r.denom.continuous.norm.const_mul C) + have hs : Zᶜ ∩ Metric.ball (0 : ℂ) 1 ⊆ S := by + rintro z ⟨hz, hz'⟩ + have hn : r.denom.eval z ≠ 0 := hz + have hh := h z (by simpa only [Metric.mem_ball, dist_zero_right] using hz') + simpa only [S, mem_ofPred_eq, RatFunc.eval, Polynomial.eval₂_id, norm_div, + div_le_iff₀ (norm_pos_iff.mpr hn)] using hh + have hb : Metric.ball (0 : ℂ) 1 ⊆ S := by + intro z hz + apply closure_minimal hs hS + exact Metric.isOpen_ball.closure_inter ⟨hd z, hz⟩ + have hc : Metric.closedBall (0 : ℂ) 1 ⊆ S := by + simpa only [closure_ball (0 : ℂ) one_ne_zero] using closure_minimal hb hS + intro z hz hn + have hp := hc (by simpa only [Metric.mem_closedBall, dist_zero_right] using hz) + change ‖r.num.eval z‖ ≤ C * ‖r.denom.eval z‖ at hp + rw [hn, norm_zero, mul_zero] at hp + have hp' : r.num.eval z = 0 := norm_le_zero_iff.mp hp + have he := Polynomial.aeval_ne_zero_of_isCoprime r.isCoprime_num_denom z + simp only [Polynomial.aeval_def, Algebra.algebraMap_self, Polynomial.eval₂_id, hp', hn, ne_eq, + not_true_eq_false, or_self] at he + +theorem ratFunc_eval_quotient (p q : Polynomial ℂ) {z : ℂ} (hq : q.eval z ≠ 0) : + RatFunc.eval (RingHom.id ℂ) z ((algebraMap _ (RatFunc ℂ)) p / + (algebraMap _ (RatFunc ℂ)) q) = p.eval z / q.eval z := by + let r : RatFunc ℂ := (algebraMap _ _) p / (algebraMap _ _) q + have hq' : q ≠ 0 := by rintro rfl; simp at hq + have hd : r.denom.eval z ≠ 0 := by + intro hd + obtain ⟨b, hb⟩ := RatFunc.denom_div_dvd p q + apply hq + rw [hb, Polynomial.eval_mul, hd, zero_mul] + have he := congrArg (Polynomial.eval z) + ((RatFunc.num_mul_eq_mul_denom_iff hq').mpr (show r = _ from rfl)) + simp only [Polynomial.eval_mul] at he + change r.num.eval z / r.denom.eval z = _ + exact (div_eq_div_iff hd hq).mpr he + +theorem map_ringInverse_of_isUnit {A B : Type*} [Ring A] [Ring B] + (f : A →+* B) {x : A} (hx : IsUnit x) : + f (Ring.inverse x) = Ring.inverse (f x) := by + calc + _ = (f (Ring.inverse x) * f x) * Ring.inverse (f x) := by + rw [mul_assoc, Ring.mul_inverse_cancel _ (hx.map f), mul_one] + _ = _ := by rw [← map_mul, Ring.inverse_mul_cancel _ hx, map_one, one_mul] + +section RationalMatrices + +variable {n : ℕ} + +def pencil (a : Coeff n) : Matrix (Fin n) (Fin n) (Polynomial ℂ) := + 1 - (Polynomial.X : Polynomial ℂ) • a.map Polynomial.C + +lemma mapMatrix_scalar {R S : Type*} [CommRing R] [CommRing S] + (f : R →+* S) (r : R) (M : Matrix (Fin n) (Fin n) R) : + f.mapMatrix (r • M) = f r • f.mapMatrix M := by + ext i j + exact map_mul f r (M i j) + +lemma eval_constantMatrix (z : ℂ) (M : Coeff n) : + (Polynomial.evalRingHom z).mapMatrix (M.map Polynomial.C) = M := by + ext i j + exact Polynomial.eval_C + +lemma eval_pencil (z : ℂ) (a : Coeff n) : + (Polynomial.evalRingHom z).mapMatrix (pencil a) = 1 - z • a := by + rw [pencil, map_sub, map_one, mapMatrix_scalar, eval_constantMatrix] + simp + +def transferDenominator (a : Coeff n) : Polynomial ℂ := (pencil a).det + +def transferNumerator (a b c d : Coeff n) : Matrix (Fin n) (Fin n) (Polynomial ℂ) := + transferDenominator a • d.map Polynomial.C + + (Polynomial.X : Polynomial ℂ) • (c.map Polynomial.C * (pencil a).adjugate * b.map Polynomial.C) + +def transferRational (a b c d : Coeff n) : RationalMatrix n := fun i j => + (algebraMap (Polynomial ℂ) (RatFunc ℂ)) (transferNumerator a b c d i j) / + (algebraMap (Polynomial ℂ) (RatFunc ℂ)) (transferDenominator a) + +lemma eval_transferDenominator (a : Coeff n) (z : ℂ) : + (transferDenominator a).eval z = (1 - z • a).det := by + exact ((Polynomial.evalRingHom z).map_det (pencil a)).trans + (congrArg Matrix.det (eval_pencil z a)) + +lemma eval_transferNumerator (a b c d : Coeff n) (z : ℂ) : + (Polynomial.evalRingHom z).mapMatrix (transferNumerator a b c d) = + (1 - z • a).det • d + z • (c * (1 - z • a).adjugate * b) := by + simp only [transferNumerator, map_add, mapMatrix_scalar, map_mul, + eval_constantMatrix, RingHom.map_adjugate, eval_pencil] + simp only [Polynomial.coe_evalRingHom, Polynomial.eval_X, eval_transferDenominator] + +lemma matrix_inverse_adjugate (M : Coeff n) : + Ring.inverse M = M.det⁻¹ • M.adjugate := by + rw [← Matrix.nonsing_inv_eq_ringInverse, Matrix.inv_def, Ring.inverse_eq_inv] + +theorem transferRational_eq (a b c d : Coeff n) {z : ℂ} + (hz : IsUnit (1 - z • a)) : + matrixRationalFunction (transferRational a b c d) z = + d + z • (c * Ring.inverse (1 - z • a) * b) := by + have hdet : (1 - z • a).det ≠ 0 := + isUnit_iff_ne_zero.mp ((Matrix.isUnit_iff_isUnit_det _).mp hz) + have hq : (transferDenominator a).eval z ≠ 0 := by + rwa [eval_transferDenominator] + ext i j + rw [matrixRationalFunction, transferRational, ratFunc_eval_quotient _ _ hq] + have he := congrArg (fun M : Coeff n => M i j) (eval_transferNumerator a b c d z) + change (transferNumerator a b c d i j).eval z = _ at he + rw [he, eval_transferDenominator, matrix_inverse_adjugate] + simp only [Matrix.add_apply, Matrix.smul_apply, smul_eq_mul, + mul_smul_comm, smul_mul_assoc] + field_simp + +def entryMap (i j : Fin n) : Coeff n →L[ℂ] ℂ := + LinearMap.toContinuousLinearMap + { toFun := fun M => M i j + map_add' := fun _ _ => rfl + map_smul' := fun _ _ => rfl } + +end RationalMatrices + +namespace Colligation + +variable {n : ℕ} + +def rational (C : Colligation (EuclideanSpace ℂ (Fin n))) : RationalMatrix n := + transferRational ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.a) ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.b) + ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.c) ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.d) + +theorem rational_eq_transfer (C : Colligation (EuclideanSpace ℂ (Fin n))) + {z : ℂ} (hz : ‖z‖ < 1) : + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) (matrixRationalFunction C.rational z) = C.transfer z := by + have hu : IsUnit (1 - z • (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.a) := by + simpa only [map_sub, map_one, map_smul] using + (C.one_sub_isUnit hz).map (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm + rw [rational, transferRational_eq _ _ _ _ hu] + simp only [map_add, map_smul, map_mul, StarAlgEquiv.apply_symm_apply] + have hi : (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) + (Ring.inverse (1 - z • (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.a)) = + Ring.inverse ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) + (1 - z • (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.a)) := + map_ringInverse_of_isUnit (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).toRingHom hu + rw [hi] + simp only [map_sub, map_one, map_smul, StarAlgEquiv.apply_symm_apply, transfer] + +theorem norm_rational_le_openDisk (C : Colligation (EuclideanSpace ℂ (Fin n))) + {z : ℂ} (hz : ‖z‖ < 1) : ‖matrixRationalFunction C.rational z‖ ≤ 1 := by + change ‖(Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) (matrixRationalFunction C.rational z)‖ ≤ 1 + rw [C.rational_eq_transfer hz] + exact C.norm_transfer_le hz + +theorem rational_polesOutside (C : Colligation (EuclideanSpace ℂ (Fin n))) : + PolesOutside (Metric.closedBall (0 : ℂ) 1) C.rational := by + intro i j z hz + apply ratFunc_denom_ne_zero_on_closedDisk (C.rational i j) ‖entryMap i j‖ ?_ z + (by simpa only [Metric.mem_closedBall, dist_zero_right] using hz) + intro w hw + change ‖entryMap i j (matrixRationalFunction C.rational w)‖ ≤ _ + calc + _ ≤ ‖entryMap i j‖ * ‖matrixRationalFunction C.rational w‖ := + (entryMap i j).le_opNorm _ + _ ≤ ‖entryMap i j‖ * 1 := + mul_le_mul_of_nonneg_left (C.norm_rational_le_openDisk hw) (norm_nonneg _) + _ = _ := mul_one _ + +theorem rational_extension (C : Colligation (EuclideanSpace ℂ (Fin n))) : + (∃ U : Set ℂ, IsOpen U ∧ Metric.closedBall (0 : ℂ) 1 ⊆ U ∧ + EntrywiseHolomorphic U (matrixRationalFunction C.rational)) ∧ + (∀ z : ℂ, ‖z‖ ≤ 1 → ‖matrixRationalFunction C.rational z‖ ≤ 1) := by + obtain ⟨U, hU, hK, hF⟩ := rational_holomorphic_neighborhood C.rational C.rational_polesOutside + refine ⟨⟨U,hU,hK,hF⟩, ?_⟩ + have hc : ContinuousOn (fun z => ‖matrixRationalFunction C.rational z‖) + (closure (Metric.ball (0 : ℂ) 1)) := by + rw [closure_ball (0 : ℂ) one_ne_zero] + exact (hF.continuousOn.mono hK).norm + intro z hz + apply le_on_closure (s := Metric.ball (0 : ℂ) 1) + (fun w hw => C.norm_rational_le_openDisk + (by simpa only [Metric.mem_ball, dist_zero_right] using hw)) hc continuousOn_const + simpa only [closure_ball (0 : ℂ) one_ne_zero, Metric.mem_closedBall, dist_zero_right] using hz + +end Colligation + +section Transpose + +variable {n : ℕ} + +def conjugateVector (x : EuclideanSpace ℂ (Fin n)) : EuclideanSpace ℂ (Fin n) := + WithLp.toLp 2 (fun i => star (x.ofLp i)) + +lemma norm_conjugateVector (x : EuclideanSpace ℂ (Fin n)) : + ‖conjugateVector x‖ = ‖x‖ := by + simp only [EuclideanSpace.norm_eq, conjugateVector, norm_star] + +lemma conjugate_apply (M : Coeff n) (x : EuclideanSpace ℂ (Fin n)) : + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) (M.map star) x = + conjugateVector ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) M (conjugateVector x)) := by + apply WithLp.equiv 2 (Fin n → ℂ) |>.injective + ext i + simp only [WithLp.equiv_apply, Matrix.ofLp_toEuclideanCLM, conjugateVector, + Matrix.mulVec, dotProduct, Matrix.map_apply, star_sum, star_mul, star_star] + apply Finset.sum_congr rfl + intro j _ + exact mul_comm _ _ + +lemma norm_conjugateMatrix_le (M : Coeff n) : ‖M.map star‖ ≤ ‖M‖ := by + change ‖(Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) (M.map star)‖ ≤ ‖M‖ + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg M) + intro x + rw [conjugate_apply, norm_conjugateVector] + simpa only [norm_conjugateVector, ← Matrix.cstar_norm_def] using + ((Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)) M).le_opNorm (conjugateVector x) + +theorem norm_matrix_transpose (M : Coeff n) : ‖Mᵀ‖ = ‖M‖ := by + have h (N : Coeff n) : ‖N.map star‖ = ‖N‖ := by + apply le_antisymm (norm_conjugateMatrix_le N) + have hh := norm_conjugateMatrix_le (N.map star) + have he : (N.map star).map star = N := by ext i j; exact star_star _ + rwa [he] at hh + rw [← h Mᵀ] + exact Matrix.l2_opNorm_conjTranspose M + +namespace Colligation + +def diskExtremal (C : Colligation (EuclideanSpace ℂ (Fin n))) : RationalMatrix n := + C.rationalᵀ + +theorem diskExtremal_function (C : Colligation (EuclideanSpace ℂ (Fin n))) (z : ℂ) : + matrixRationalFunction C.diskExtremal z = (matrixRationalFunction C.rational z)ᵀ := rfl + +theorem diskExtremal_polesOutside (C : Colligation (EuclideanSpace ℂ (Fin n))) : + PolesOutside (Metric.closedBall (0 : ℂ) 1) C.diskExtremal := + fun i j => C.rational_polesOutside j i + +theorem diskExtremal_extension (C : Colligation (EuclideanSpace ℂ (Fin n))) : + (∃ U : Set ℂ, IsOpen U ∧ Metric.closedBall (0 : ℂ) 1 ⊆ U ∧ + EntrywiseHolomorphic U (matrixRationalFunction C.diskExtremal)) ∧ + (∀ z : ℂ, ‖z‖ ≤ 1 → ‖matrixRationalFunction C.diskExtremal z‖ ≤ 1) := by + refine ⟨rational_holomorphic_neighborhood C.diskExtremal C.diskExtremal_polesOutside, ?_⟩ + intro z hz + rw [C.diskExtremal_function, norm_matrix_transpose] + exact C.rational_extension.2 z hz + +end Colligation + +end Transpose + +end CrouzeixHilbert.Realization + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Realization.lean b/lean/OAI/Analysis/Crouzeix/Realization.lean new file mode 100644 index 0000000000000000000000000000000000000000..5e7f0f23cad7da545fa6ca5fc5afcce947aa859d --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Realization.lean @@ -0,0 +1,261 @@ +import Mathlib +import OAI.Analysis.Crouzeix.SteinMetric + +namespace OAI + +/-! Realization. -/ + +noncomputable section + +open Set Filter + +open scoped Topology InnerProductSpace + +namespace CrouzeixHilbert.Realization + +section Gram + +variable {E V : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup V] [InnerProductSpace ℂ V] [FiniteDimensional ℂ V] + +theorem exists_isometryEquiv_of_norm_eq (A B : E →ₗ[ℂ] V) + (h : ∀ x, ‖A x‖ = ‖B x‖) : + ∃ U : V ≃ₗᵢ[ℂ] V, ∀ x, U (A x) = B x := by + have hk : A.ker ≤ B.ker := by + intro x hx + apply LinearMap.mem_ker.mpr + apply norm_eq_zero.mp + rw [← h x, LinearMap.mem_ker.mp hx, norm_zero] + let l : A.range →ₗ[ℂ] V := (A.ker.liftQ B hk).comp A.quotKerEquivRange.symm.toLinearMap + have hl (x : E) : l ⟨A x, LinearMap.mem_range_self A x⟩ = B x := by + simp [l] + let L : A.range →ₗᵢ[ℂ] V := + { toLinearMap := l + norm_map' := by + rintro ⟨y, x, rfl⟩ + rw [hl] + exact (h x).symm } + refine ⟨L.extend.toLinearIsometryEquiv rfl, ?_⟩ + intro x + change L.extend (A x) = B x + rw [show A x = (⟨A x, LinearMap.mem_range_self A x⟩ : A.range) from rfl, + LinearIsometry.extend_apply] + exact hl x + +end Gram + +section Pair + +variable {E H : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +abbrev SumSpace (H : Type*) [NormedAddCommGroup H] := WithLp 2 (H × H) + +def pairL (A B : E →L[ℂ] H) : E →L[ℂ] SumSpace H := + (WithLp.prodContinuousLinearEquiv 2 ℂ H H).symm.toContinuousLinearMap.comp (A.prod B) + +def rowL (A B : H →L[ℂ] E) : SumSpace H →L[ℂ] E := + A.comp (WithLp.fstL 2 ℂ H H) + B.comp (WithLp.sndL 2 ℂ H H) + +@[simp] theorem pairL_apply (A B : E →L[ℂ] H) (x : E) : + pairL A B x = WithLp.toLp 2 (A x, B x) := rfl + +@[simp] theorem rowL_apply (A B : H →L[ℂ] E) (x : SumSpace H) : + rowL A B x = A x.fst + B x.snd := rfl + +variable [CompleteSpace E] [CompleteSpace H] + +theorem adjoint_pairL (A B : E →L[ℂ] H) : + ContinuousLinearMap.adjoint (pairL A B) = + rowL (ContinuousLinearMap.adjoint A) (ContinuousLinearMap.adjoint B) := by + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro y x + simp only [rowL_apply, pairL_apply, inner_add_left, + ContinuousLinearMap.adjoint_inner_left, WithLp.prod_inner_apply] + rfl + +end Pair + +section Colligation + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [FiniteDimensional ℂ H] + +theorem exists_colligation (D L X Y : H →L[ℂ] H) + (h : L * star L + Y * star Y = (D * L) * star (D * L) + X * star X) : + ∃ U : SumSpace H ≃ₗᵢ[ℂ] SumSpace H, + ∀ v, rowL L Y v = rowL (D * L) X (U v) := by + let A := pairL (star (D * L)) (star X) + let B := pairL (star L) (star Y) + have hg : (ContinuousLinearMap.adjoint A).comp A = + (ContinuousLinearMap.adjoint B).comp B := by + simp only [A, B, adjoint_pairL] + ext x + simpa only [ContinuousLinearMap.comp_apply, pairL_apply, WithLp.toLp_fst, + WithLp.toLp_snd, rowL_apply, ContinuousLinearMap.adjoint_adjoint, + ContinuousLinearMap.star_eq_adjoint, add_apply, + mul_apply_eq_comp] using (DFunLike.congr_fun h x).symm + obtain ⟨U, hU⟩ := exists_isometryEquiv_of_norm_eq A.toLinearMap B.toLinearMap (fun x => by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + change ‖A x‖ ^ 2 = ‖B x‖ ^ 2 + rw [A.apply_norm_sq_eq_inner_adjoint_left, B.apply_norm_sq_eq_inner_adjoint_left, hg]) + use U.symm + have he : U.toContinuousLinearEquiv.toContinuousLinearMap.comp A = B := by + ext x + exact hU x + have he' := congrArg ContinuousLinearMap.adjoint he + rw [ContinuousLinearMap.adjoint_comp, U.adjoint_eq_symm] at he' + have he'' : (rowL (D * L) X).comp U.symm.toContinuousLinearEquiv.toContinuousLinearMap = + rowL L Y := by + simpa only [A, B, adjoint_pairL, ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_adjoint] using he' + intro v + exact (DFunLike.congr_fun he'' v).symm + +end Colligation + +section Transfer + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +structure Colligation (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℂ H] where + unitary : SumSpace H ≃ₗᵢ[ℂ] SumSpace H + +namespace Colligation + +def a (C : Colligation H) : H →L[ℂ] H := + (WithLp.fstL 2 ℂ H H).comp + (C.unitary.toContinuousLinearEquiv.toContinuousLinearMap.comp (pairL 1 0)) + +def b (C : Colligation H) : H →L[ℂ] H := + (WithLp.fstL 2 ℂ H H).comp + (C.unitary.toContinuousLinearEquiv.toContinuousLinearMap.comp (pairL 0 1)) + +def c (C : Colligation H) : H →L[ℂ] H := + (WithLp.sndL 2 ℂ H H).comp + (C.unitary.toContinuousLinearEquiv.toContinuousLinearMap.comp (pairL 1 0)) + +def d (C : Colligation H) : H →L[ℂ] H := + (WithLp.sndL 2 ℂ H H).comp + (C.unitary.toContinuousLinearEquiv.toContinuousLinearMap.comp (pairL 0 1)) + +theorem apply_pair (C : Colligation H) (v e : H) : + C.unitary (WithLp.toLp 2 (v,e)) = + WithLp.toLp 2 (C.a v + C.b e, C.c v + C.d e) := by + have he : WithLp.toLp 2 (v,e) = pairL (1 : H →L[ℂ] H) 0 v + pairL 0 1 e := by + apply WithLp.equiv 2 (H × H) |>.injective + simp only [pairL_apply, one_apply_eq_self, zero_apply, WithLp.equiv_apply, + WithLp.ofLp_add] + ext <;> simp + rw [he, map_add] + apply WithLp.equiv 2 (H × H) |>.injective + rfl + +theorem energy (C : Colligation H) (v e : H) : + ‖C.a v + C.b e‖ ^ 2 + ‖C.c v + C.d e‖ ^ 2 = ‖v‖ ^ 2 + ‖e‖ ^ 2 := by + have h := congrArg (fun r : ℝ => r ^ 2) (C.unitary.norm_map (WithLp.toLp 2 (v,e))) + rw [C.apply_pair, WithLp.prod_norm_sq_eq_of_L2, WithLp.prod_norm_sq_eq_of_L2] at h + exact h + +theorem norm_a_le (C : Colligation H) : ‖C.a‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro v + have h := C.energy v 0 + simp only [map_zero, add_zero, norm_zero, zero_pow (by norm_num : 2 ≠ 0)] at h + simp only [one_mul] + nlinarith [norm_nonneg v, norm_nonneg (C.a v), sq_nonneg ‖C.c v‖] + +theorem norm_b_le (C : Colligation H) : ‖C.b‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro v + have h := C.energy 0 v + simp only [map_zero, zero_add, norm_zero, zero_pow (by norm_num : 2 ≠ 0)] at h + simp only [one_mul] + nlinarith [norm_nonneg v, norm_nonneg (C.b v), sq_nonneg ‖C.d v‖] + +theorem norm_c_le (C : Colligation H) : ‖C.c‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro v + have h := C.energy v 0 + simp only [map_zero, add_zero, norm_zero, zero_pow (by norm_num : 2 ≠ 0)] at h + simp only [one_mul] + nlinarith [norm_nonneg v, norm_nonneg (C.c v), sq_nonneg ‖C.a v‖] + +theorem norm_d_le (C : Colligation H) : ‖C.d‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro v + have h := C.energy 0 v + simp only [map_zero, zero_add, norm_zero, zero_pow (by norm_num : 2 ≠ 0)] at h + simp only [one_mul] + nlinarith [norm_nonneg v, norm_nonneg (C.d v), sq_nonneg ‖C.b v‖] + +def transfer (C : Colligation H) (z : ℂ) : H →L[ℂ] H := + C.d + z • (C.c * Ring.inverse (1 - z • C.a) * C.b) + +variable [CompleteSpace H] + +theorem one_sub_isUnit (C : Colligation H) {z : ℂ} (hz : ‖z‖ < 1) : + IsUnit (1 - z • C.a) := by + apply isUnit_one_sub_of_norm_lt_one + rw [norm_smul] + exact (mul_le_mul_of_nonneg_left C.norm_a_le (norm_nonneg z)).trans_lt + (by simpa only [mul_one] using hz) + +theorem transfer_energy (C : Colligation H) {z : ℂ} (hz : ‖z‖ < 1) (e : H) : + ‖e‖ ^ 2 - ‖C.transfer z e‖ ^ 2 = (1 - ‖z‖ ^ 2) * + ‖Ring.inverse (1 - z • C.a) (C.b e)‖ ^ 2 := by + let v := Ring.inverse (1 - z • C.a) (C.b e) + have hv : v - z • C.a v = C.b e := by + have h := DFunLike.congr_fun + (Ring.mul_inverse_cancel (1 - z • C.a) (C.one_sub_isUnit hz)) (C.b e) + simpa only [mul_apply_eq_comp, sub_apply, one_apply_eq_self, smul_apply] using h + have ht : C.c (z • v) + C.d e = C.transfer z e := by + simp only [transfer, add_apply, smul_apply, mul_apply_eq_comp, map_smul, v, add_comm] + have h := C.energy (z • v) e + rw [ht, map_smul, show z • C.a v + C.b e = v by rw [← hv]; abel, + norm_smul, mul_pow] at h + nlinarith + +theorem norm_transfer_le (C : Colligation H) {z : ℂ} (hz : ‖z‖ < 1) : + ‖C.transfer z‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro e + have h := C.transfer_energy hz e + have hz' : 0 ≤ 1 - ‖z‖ ^ 2 := by nlinarith [norm_nonneg z] + have hpos := mul_nonneg hz' (sq_nonneg ‖Ring.inverse (1 - z • C.a) (C.b e)‖) + simp only [one_mul] + nlinarith [norm_nonneg e, norm_nonneg (C.transfer z e)] + +end Colligation + +variable [FiniteDimensional ℂ H] + +theorem exists_colligation_data (D L X Y : H →L[ℂ] H) + (h : L * star L + Y * star Y = (D * L) * star (D * L) + X * star X) : + ∃ C : Colligation H, L = D * L * C.a + X * C.c ∧ + Y = D * L * C.b + X * C.d := by + obtain ⟨U, hU⟩ := exists_colligation D L X Y h + refine ⟨⟨U⟩, ?_, ?_⟩ + · ext v + have h := hU (WithLp.toLp 2 (v,0)) + simpa only [rowL_apply, WithLp.toLp_fst, WithLp.toLp_snd, + map_zero, add_zero, add_apply, mul_apply_eq_comp, Colligation.a, Colligation.c, + ContinuousLinearMap.comp_apply, pairL_apply, one_apply_eq_self, zero_apply, + WithLp.fstL_apply, WithLp.sndL_apply, + ContinuousLinearEquiv.coe_coe, LinearIsometryEquiv.coe_toContinuousLinearEquiv] using h + · ext v + have h := hU (WithLp.toLp 2 (0,v)) + simpa only [rowL_apply, WithLp.toLp_fst, WithLp.toLp_snd, + map_zero, zero_add, add_apply, mul_apply_eq_comp, Colligation.b, Colligation.d, + ContinuousLinearMap.comp_apply, pairL_apply, one_apply_eq_self, zero_apply, + WithLp.fstL_apply, WithLp.sndL_apply, + ContinuousLinearEquiv.coe_coe, LinearIsometryEquiv.coe_toContinuousLinearEquiv] using h + +end Transfer + +end CrouzeixHilbert.Realization + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ReflectionDerivative.lean b/lean/OAI/Analysis/Crouzeix/ReflectionDerivative.lean new file mode 100644 index 0000000000000000000000000000000000000000..c71271e107ed9769fc2f69e902c28b838e62a309 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ReflectionDerivative.lean @@ -0,0 +1,112 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HarmonicReflection + +namespace OAI + +/-! Reflection Derivative. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex InnerProductSpace Real + +open scoped Classical ComplexConjugate + +namespace CrouzeixHilbert.Conformal + +theorem circleAverage_neg {R : ℝ} (hR : 0 < R) {v : ℂ → ℝ} + (hv : ContinuousOn v (sphere 0 R)) (hle : ∀ z ∈ sphere 0 R, v z ≤ 0) + (hlt : v ((R : ℂ) * I) < 0) : circleAverage v 0 R < 0 := by + have hmap : MapsTo (circleMap 0 R) (Icc 0 (2 * π)) (sphere 0 R) := + fun t _ => by simpa only [abs_of_pos hR] using circleMap_mem_sphere' 0 R t + have hc : ContinuousOn (fun t => v (circleMap 0 R t)) (Icc 0 (2 * π)) := + hv.comp (continuous_circleMap 0 R).continuousOn hmap + have hi := intervalIntegral.integral_lt_integral_of_continuousOn_of_le_of_exists_lt + (show (0 : ℝ) < 2 * π by positivity) hc continuousOn_const + (fun t ht => hle _ (hmap (Ioc_subset_Icc_self ht))) (show ∃ t ∈ Icc 0 (2 * π), v (circleMap 0 R t) < 0 from + ⟨π / 2, ⟨by positivity, by linarith [Real.pi_pos]⟩, by + simpa only [circleMap, zero_add, Complex.exp_mul_I, ← Complex.ofReal_cos, ← Complex.ofReal_sin, Real.cos_pi_div_two, + Real.sin_pi_div_two, Complex.ofReal_zero, Complex.ofReal_one, one_mul, zero_add] + using hlt⟩) + simp only [intervalIntegral.integral_zero] at hi + simpa only [circleAverage, smul_eq_mul] using + mul_neg_of_pos_of_neg (inv_pos.mpr (by positivity : 0 < 2 * π)) hi + +theorem im_deriv_schwarzExtension_zero {R : ℝ} (hR : 0 < R) {v : ℂ → ℝ} + (hv : ContinuousOn v (sphere 0 R)) : + (deriv (schwarzExtension R v) 0).im = + -2 / R ^ 2 * circleAverage (fun z => z.im * v z) 0 R := by + have hvi : CircleIntegrable (fun z => (v z : ℂ)) 0 R := + ContinuousOn.circleIntegrable hR.le (continuous_ofReal.comp_continuousOn hv) + have hd := hasDerivAt_circleAverage_herglotzRieszKernel_smul hvi + (by simpa only [mem_sphere, dist_self, abs_of_pos hR] using hR.ne : + (0 : ℂ) ∉ sphere 0 |R|) + have he : deriv (schwarzExtension R v) 0 = + circleAverage (fun ζ : ℂ => (2 / ζ) * (v ζ : ℂ)) 0 R := by + rw [show schwarzExtension R v = + (fun w => circleAverage (fun ζ => herglotzRieszKernel 0 w ζ • (v ζ : ℂ)) 0 R) by rfl, + hd.deriv] + apply circleAverage_congr_sphere + intro ζ hζ + have hz : ζ ≠ 0 := by + intro he + have hn : ‖ζ‖ = R := by simpa only [abs_of_pos hR] using mem_sphere_zero_iff_norm.mp hζ + exact hR.ne' (by simpa only [he, norm_zero] using hn.symm) + simp only [sub_zero, smul_eq_mul] + congr 1 + field_simp + have hgi : CircleIntegrable (fun ζ : ℂ => (2 / ζ) * (v ζ : ℂ)) 0 R := by + apply ContinuousOn.circleIntegrable hR.le + refine (continuousOn_const.div continuousOn_id (fun ζ hζ => ?_)).mul + (continuous_ofReal.comp_continuousOn hv) + intro he + change ζ = 0 at he + have hn := mem_sphere_zero_iff_norm.mp hζ + exact hR.ne' (by simpa only [he, norm_zero] using hn.symm) + rw [he] + change Complex.imCLM (circleAverage (fun ζ : ℂ => (2 / ζ) * (v ζ : ℂ)) 0 R) = _ + rw [← Complex.imCLM.circleAverage_comp_comm hgi] + have heq : circleAverage (Complex.imCLM ∘ (fun ζ : ℂ => (2 / ζ) * (v ζ : ℂ))) 0 R = + circleAverage (fun z => (-2 / R ^ 2) • (z.im * v z)) 0 R := by + apply circleAverage_congr_sphere + intro z hz + have hn : ‖z‖ = R := by simpa only [abs_of_pos hR] using mem_sphere_zero_iff_norm.mp hz + simp only [Function.comp_apply, Complex.imCLM_apply, Complex.mul_im, Complex.ofReal_re, + Complex.ofReal_im, mul_zero, Complex.div_im, Complex.im_ofNat, + Complex.re_ofNat, zero_mul, Complex.normSq_eq_norm_sq, hn, smul_eq_mul] + ring + rw [heq, circleAverage_fun_smul, smul_eq_mul] + +theorem deriv_schwarzExtension_odd_ne_zero {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : ContinuousOn (oddReflection u) (sphere 0 R)) + (hneg : ∀ z ∈ sphere (0 : ℂ) R, 0 < z.im → u z < 0) : + deriv (schwarzExtension R (oddReflection u)) 0 ≠ 0 := by + have hp : (R : ℂ) * I ∈ sphere (0 : ℂ) R := by + simp only [mem_sphere_zero_iff_norm, norm_mul, norm_I, mul_one, Complex.norm_real, + Real.norm_of_nonneg hR.le] + have him : ((R : ℂ) * I).im = R := by simp + have hle : ∀ z ∈ sphere (0 : ℂ) R, z.im * oddReflection u z ≤ 0 := by + intro z hz + rcases lt_trichotomy z.im 0 with hn | he | hp + · rw [oddReflection, ite_eq_right (not_le.mpr hn)] + have hconj : conj z ∈ sphere (0 : ℂ) R := by + simpa only [mem_sphere_zero_iff_norm, Complex.norm_conj] using hz + have hn' := hneg (conj z) hconj (by simpa only [conj_im] using neg_pos.mpr hn) + exact mul_nonpos_of_nonpos_of_nonneg hn.le (neg_nonneg.mpr hn'.le) + · rw [he, zero_mul] + · rw [oddReflection, ite_eq_left hp.le] + exact mul_nonpos_of_nonneg_of_nonpos hp.le (hneg z hz hp).le + have hav := circleAverage_neg hR (Complex.continuous_im.continuousOn.mul hu) hle + (show ((R : ℂ) * I).im * oddReflection u ((R : ℂ) * I) < 0 by + rw [him, oddReflection, him, ite_eq_left hR.le] + exact mul_neg_of_pos_of_neg hR (hneg _ hp (by simpa only [him] using hR))) + have hpim : 0 < (deriv (schwarzExtension R (oddReflection u)) 0).im := by + rw [im_deriv_schwarzExtension_zero hR hu] + exact mul_pos_of_neg_of_neg (div_neg_of_neg_of_pos (by norm_num) (sq_pos_of_pos hR)) hav + intro he + simp only [he, zero_im, lt_irrefl] at hpim + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Resolvent.lean b/lean/OAI/Analysis/Crouzeix/Resolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..9262d7a8c87c10a85058bd18643409dd5ab87c6a --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Resolvent.lean @@ -0,0 +1,178 @@ +import Mathlib +import OAI.Analysis.Crouzeix.NumericalRange + +namespace OAI + +/-! Resolvent. -/ + +noncomputable section + +open scoped InnerProductSpace ComplexOrder + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem nonneg_re_inner_of_unit (T : Operator H) + (h : ∀ x : H, ‖x‖ = 1 → 0 ≤ (⟪x, T x⟫_ℂ).re) (x : H) : + 0 ≤ (⟪x, T x⟫_ℂ).re := by + by_cases hx : x = 0 + · simp [hx] + have hn : 0 < ‖x‖ := norm_pos_iff.mpr hx + let v : H := (‖x‖ : ℂ)⁻¹ • x + have hv : ‖v‖ = 1 := by simp [v, norm_smul, hn.ne'] + have ht := h v hv + have he : (⟪v, T v⟫_ℂ).re = ‖x‖⁻¹ * (‖x‖⁻¹ * (⟪x, T x⟫_ℂ).re) := by + simp [v, Complex.mul_re, mul_comm] + rw [he] at ht + exact (mul_nonneg_iff_of_pos_left (inv_pos.mpr hn)).mp + ((mul_nonneg_iff_of_pos_left (inv_pos.mpr hn)).mp ht) + +variable [CompleteSpace H] + +theorem isPositive_add_adjoint_of_unit (T : Operator H) + (h : ∀ x : H, ‖x‖ = 1 → 0 ≤ (⟪x, T x⟫_ℂ).re) : + (T + star T).IsPositive := by + apply ContinuousLinearMap.isPositive_def'.mpr + refine ⟨IsSelfAdjoint.add_star_self T, fun x => ?_⟩ + have ht := nonneg_re_inner_of_unit T h x + change 0 ≤ (⟪(T + star T) x, x⟫_ℂ).re + simp only [add_apply, inner_add_left, + ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_left, + Complex.add_re] + have he : (⟪T x, x⟫_ℂ).re = (⟪x, T x⟫_ℂ).re := inner_re_symm (𝕜 := ℂ) _ _ + rw [he] + linarith only [ht] + +theorem isPositive_supporting_halfplane (A : Operator H) (z q : ℂ) + (hsupport : ∀ w ∈ numericalRange A, 0 ≤ (star q * (z - w)).re) : + (star q • (algebraMap ℂ (Operator H) z - A) + + star (star q • (algebraMap ℂ (Operator H) z - A))).IsPositive := by + apply isPositive_add_adjoint_of_unit + intro x hx + have h := hsupport ⟪x, A x⟫_ℂ ⟨x, hx, rfl⟩ + simpa [inner_smul_right, inner_sub_right, inner_self_eq_norm_sq_to_K, hx, + Algebra.algebraMap_eq_smul_one] using h + +theorem resolvent_hermitian_congruence (A : Operator H) (z q : ℂ) + (hz : IsUnit (algebraMap ℂ (Operator H) z - A)) : + let E := algebraMap ℂ (Operator H) z - A + let R := Ring.inverse E + star R * (star q • E + star (star q • E)) * R = q • R + star (q • R) := by + dsimp only + let E := algebraMap ℂ (Operator H) z - A + let R := Ring.inverse E + have hER : E * R = 1 := Ring.mul_inverse_cancel E hz + change star R * (star q • E + star (star q • E)) * R = q • R + star (q • R) + have hstar : star R * star E = 1 := by rw [← star_mul, hER, star_one] + calc + star R * (star q • E + star (star q • E)) * R = + star q • (star R * (E * R)) + q • ((star R * star E) * R) := by + simp only [star_smul, star_star, mul_add, add_mul, mul_smul_comm, + smul_mul_assoc, mul_assoc] + _ = star q • star R + q • R := by rw [hER, hstar, mul_one, one_mul] + _ = q • R + star (q • R) := by rw [star_smul, add_comm] + +theorem isPositive_original_resolvent (A : Operator H) (z q : ℂ) + (hz : IsUnit (algebraMap ℂ (Operator H) z - A)) + (hsupport : ∀ w ∈ numericalRange A, 0 ≤ (star q * (z - w)).re) : + (q • Ring.inverse (algebraMap ℂ (Operator H) z - A) + + star (q • Ring.inverse (algebraMap ℂ (Operator H) z - A))).IsPositive := by + have hp := (isPositive_supporting_halfplane A z q hsupport).adjoint_conj + (Ring.inverse (algebraMap ℂ (Operator H) z - A)) + change (star (Ring.inverse (algebraMap ℂ (Operator H) z - A)) * + (star q • (algebraMap ℂ (Operator H) z - A) + + star (star q • (algebraMap ℂ (Operator H) z - A))) * + Ring.inverse (algebraMap ℂ (Operator H) z - A)).IsPositive at hp + rwa [resolvent_hermitian_congruence A z q hz] at hp + +theorem isPositive_original_resolvent_of_not_mem (A : Operator H) (z q : ℂ) + (hz : z ∉ numericalClosure A) + (hsupport : ∀ w ∈ numericalRange A, 0 ≤ (star q * (z - w)).re) : + (q • Ring.inverse (algebraMap ℂ (Operator H) z - A) + + star (q • Ring.inverse (algebraMap ℂ (Operator H) z - A))).IsPositive := by + apply isPositive_original_resolvent A z q _ hsupport + change z ∈ resolventSet ℂ A + by_contra he + exact hz (spectrum_subset_numericalClosure A he) + +theorem isPositive_contraction_defect (T : Operator H) (hn : ‖T‖ ≤ 1) : + (1 - star T * T).IsPositive := by + apply ContinuousLinearMap.isPositive_def'.mpr + refine ⟨by simp [IsSelfAdjoint, star_mul], fun x => ?_⟩ + have ht : ‖T x‖ ≤ ‖x‖ := by + calc + ‖T x‖ ≤ ‖T‖ * ‖x‖ := T.le_opNorm x + _ ≤ 1 * ‖x‖ := mul_le_mul_of_nonneg_right hn (norm_nonneg _) + _ = ‖x‖ := one_mul _ + change 0 ≤ RCLike.re ⟪x - ContinuousLinearMap.adjoint T (T x), x⟫_ℂ + simp only [inner_sub_left, ContinuousLinearMap.adjoint_inner_left, + map_sub, ← norm_sq_eq_re_inner] + nlinarith only [ht, norm_nonneg x, norm_nonneg (T x)] + +theorem disk_resolvent_congruence (T : Operator H) (hT : IsUnit (1 - T)) : + let R := Ring.inverse (1 - T) + star R * (1 - star T * T) * R = R + star R - 1 := by + let E := 1 - T + let R := Ring.inverse E + have hER : E * R = 1 := Ring.mul_inverse_cancel E hT + have hstar : star R * star E = 1 := by rw [← star_mul, hER, star_one] + have hid : 1 - star T * T = star E + E - star E * E := by + simp only [E, star_sub, star_one] + noncomm_ring + change star R * (1 - star T * T) * R = R + star R - 1 + rw [hid] + calc + star R * (star E + E - star E * E) * R = + (star R * star E) * R + star R * (E * R) - + (star R * star E) * (E * R) := by noncomm_ring + _ = R + star R - 1 := by rw [hstar, hER, one_mul, mul_one, one_mul] + +def diskDensity (D : Operator H) (ζ : ℂ) : Operator H := + Ring.inverse (1 - ζ⁻¹ • D) + star (Ring.inverse (1 - ζ⁻¹ • D)) - 1 + +theorem isPositive_diskResolvent (T : Operator H) (hn : ‖T‖ ≤ 1) + (hu : IsUnit (1 - T)) : + (Ring.inverse (1 - T) + star (Ring.inverse (1 - T)) - 1).IsPositive := by + have hp := (isPositive_contraction_defect T hn).adjoint_conj (Ring.inverse (1 - T)) + have hp' : (star (Ring.inverse (1 - T)) * (1 - star T * T) * + Ring.inverse (1 - T)).IsPositive := by + simpa only [ContinuousLinearMap.mul_def, ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.comp_assoc] using hp + rw [disk_resolvent_congruence T hu] at hp' + exact hp' + +theorem isPositive_diskDensity (D : Operator H) (hD : ‖D‖ ≤ 1) (ζ : ℂ) + (hζ : ‖ζ‖ = 1) (hu : IsUnit (1 - ζ⁻¹ • D)) : (diskDensity D ζ).IsPositive := by + apply isPositive_diskResolvent _ _ hu + rw [norm_smul, norm_inv, hζ, inv_one, one_mul] + exact hD + +omit [CompleteSpace H] in +theorem disk_resolvent_isUnit (D : Operator H) + (hD : ∀ z ∈ spectrum ℂ D, ‖z‖ < 1) (ζ : ℂ) (hζ : ‖ζ‖ = 1) : + IsUnit (1 - ζ⁻¹ • D) := by + have hn : ζ ≠ 0 := by intro he; simp [he] at hζ + have hr : IsUnit (algebraMap ℂ (Operator H) ζ - D) := by + change ζ ∈ resolventSet ℂ D + by_contra he + have := hD ζ he + rw [hζ] at this + exact lt_irrefl _ this + have he : 1 - ζ⁻¹ • D = ζ⁻¹ • (algebraMap ℂ (Operator H) ζ - D) := by + simp [Algebra.algebraMap_eq_smul_one, smul_sub, smul_smul, hn] + rw [he, Algebra.smul_def] + exact ((isUnit_iff_ne_zero.mpr (inv_ne_zero hn)).map (algebraMap ℂ (Operator H))).mul hr + +theorem isPositive_diskDensity_of_spectrum (D : Operator H) + (hn : ‖D‖ ≤ 1) (hD : ∀ z ∈ spectrum ℂ D, ‖z‖ < 1) + (ζ : ℂ) (hζ : ‖ζ‖ = 1) : (diskDensity D ζ).IsPositive := + isPositive_diskDensity D hn ζ hζ (disk_resolvent_isUnit D hD ζ hζ) + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ResolventBounds.lean b/lean/OAI/Analysis/Crouzeix/ResolventBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca0d07271fc24dcbf5416752768516fdbfbfd177 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ResolventBounds.lean @@ -0,0 +1,306 @@ +import Mathlib +import OAI.Analysis.Crouzeix.RationalEvaluation + +namespace OAI + +/-! Resolvent Bounds. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace Topology + +open Set Filter + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem continuousOn_resolvent [CompleteSpace H] (A : Operator H) : + ContinuousOn (fun z : ℂ => Ring.inverse (algebraMap ℂ (Operator H) z - A)) + (numericalClosure A)ᶜ := by + intro z hz + have hr : z ∈ resolventSet ℂ A := by + by_contra h + exact hz (spectrum_subset_numericalClosure A h) + exact (spectrum.hasDerivAt_resolvent_const_left hr).continuousAt.continuousWithinAt + +def SmoothContour.trace (Γ : SmoothContour) : Set ℂ := Γ.path '' Icc (0 : ℝ) 1 + +theorem SmoothContour.isCompact_trace (Γ : SmoothContour) : IsCompact Γ.trace := + isCompact_Icc.image Γ.smooth.continuous + +theorem SmoothContour.trace_nonempty (Γ : SmoothContour) : Γ.trace.Nonempty := + ⟨Γ.path 0, 0, ⟨le_rfl, zero_le_one⟩, rfl⟩ + +def contourKernel (A : Operator H) (Γ : SmoothContour) (t : ℝ) : Operator H := + deriv Γ.path t • Ring.inverse (algebraMap ℂ (Operator H) (Γ.path t) - A) + +theorem continuousOn_contourKernel [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) : + ContinuousOn (contourKernel A Γ.toSmoothContour) (Icc (0 : ℝ) 1) := by + apply Γ.smooth.continuous_deriv_one.continuousOn.smul + exact (continuousOn_resolvent A).comp Γ.smooth.continuous.continuousOn + (fun t ht => (Γ.avoids t ht).2) + +theorem contourEval_eq_kernel (A : Operator H) (Γ : SmoothContour) (f : ℂ → ℂ) : + contourEval A Γ f = (2 * (Real.pi : ℂ) * Complex.I)⁻¹ • + ∫ t in (0 : ℝ)..1, f (Γ.path t) • contourKernel A Γ t := by + unfold contourEval contourKernel + simp only [smul_smul, mul_comm (f _)] + +theorem intervalIntegrable_contourIntegrand [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {f : ℂ → ℂ} + (hf : ContinuousOn f Γ.toSmoothContour.trace) : + IntervalIntegrable (fun t => f (Γ.path t) • contourKernel A Γ.toSmoothContour t) + MeasureTheory.volume (0 : ℝ) 1 := by + have hfc : ContinuousOn (fun t => f (Γ.path t)) (Icc (0 : ℝ) 1) := + hf.comp Γ.smooth.continuous.continuousOn (fun t ht => mem_image_of_mem _ ht) + have hcont := hfc.smul (continuousOn_contourKernel A Γ) + rw [← uIcc_of_le (zero_le_one : (0 : ℝ) ≤ 1)] at hcont + exact hcont.intervalIntegrable + +theorem tendsto_contourEval [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {f : ℂ → ℂ} {fs : ℕ → ℂ → ℂ} + (hc : ∀ n, ContinuousOn (fs n) Γ.toSmoothContour.trace) + (hu : TendstoUniformlyOn fs f atTop Γ.toSmoothContour.trace) : + Tendsto (fun n => contourEval A Γ.toSmoothContour (fs n)) atTop + (𝓝 (contourEval A Γ.toSmoothContour f)) := by + let k := contourKernel A Γ.toSmoothContour + have hk : ContinuousOn k (Icc (0 : ℝ) 1) := continuousOn_contourKernel A Γ + obtain ⟨C, hC⟩ := isCompact_Icc.bddAbove_image hk.norm + let M := max C 1 + have hM : 0 < M := lt_of_lt_of_le (by norm_num) (le_max_right _ _) + have hkb (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : ‖k t‖ ≤ M := + (hC (mem_image_of_mem _ ht)).trans (le_max_left _ _) + have huc : TendstoUniformlyOn (fun n t => fs n (Γ.path t) • k t) + (fun t => f (Γ.path t) • k t) atTop (Icc (0 : ℝ) 1) := by + apply Metric.tendstoUniformlyOn_iff.mpr + intro ε hε + filter_upwards [Metric.tendstoUniformlyOn_iff.mp hu (ε / M) (div_pos hε hM)] + with n hn + intro t ht + have hn' := hn (Γ.path t) (mem_image_of_mem _ ht) + calc + dist (f (Γ.path t) • k t) (fs n (Γ.path t) • k t) = + ‖f (Γ.path t) - fs n (Γ.path t)‖ * ‖k t‖ := by + rw [dist_eq_norm, ← sub_smul, norm_smul] + _ ≤ ‖f (Γ.path t) - fs n (Γ.path t)‖ * M := + mul_le_mul_of_nonneg_left (hkb t ht) (norm_nonneg _) + _ < (ε / M) * M := mul_lt_mul_of_pos_right (by simpa only [dist_eq_norm] using hn') hM + _ = ε := div_mul_cancel₀ _ hM.ne' + have hcon (n : ℕ) : ContinuousOn (fun t => fs n (Γ.path t) • k t) + (Icc (0 : ℝ) 1) := + ((hc n).comp Γ.smooth.continuous.continuousOn + (fun t ht => mem_image_of_mem _ ht)).smul hk + have hi : Tendsto (fun n => ∫ t in (0 : ℝ)..1, fs n (Γ.path t) • k t) atTop + (𝓝 (∫ t in (0 : ℝ)..1, f (Γ.path t) • k t)) := by + apply TendstoUniformlyOn.tendsto_intervalIntegral_of_continuousOn + · exact Eventually.of_forall (fun n => by simpa only [uIcc_of_le zero_le_one] using hcon n) + · simpa only [uIcc_of_le zero_le_one] using huc + simpa only [contourEval_eq_kernel] using hi.const_smul ((2 * (Real.pi : ℂ) * Complex.I)⁻¹) + +theorem exists_contourEval_bound [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ f : ℂ → ℂ, ContinuousOn f Γ.toSmoothContour.trace → + ‖contourEval A Γ.toSmoothContour f‖ ≤ C * supNorm Γ.toSmoothContour.trace f := by + obtain ⟨M, hM⟩ := isCompact_Icc.bddAbove_image + (continuousOn_contourKernel A Γ).norm + let c := (2 * (Real.pi : ℂ) * Complex.I)⁻¹ + refine ⟨‖c‖ * max M 0, mul_nonneg (norm_nonneg _) (le_max_right _ _), ?_⟩ + intro f hf + have hb := supNorm_bddAbove Γ.toSmoothContour.isCompact_trace hf + have hbound : ∀ t ∈ uIoc (0 : ℝ) 1, + ‖f (Γ.path t) • contourKernel A Γ.toSmoothContour t‖ ≤ + max M 0 * supNorm Γ.toSmoothContour.trace f := by + intro t ht + have ht' : t ∈ Icc (0 : ℝ) 1 := by + simpa only [uIcc_of_le (zero_le_one : (0 : ℝ) ≤ 1)] using uIoc_subset_uIcc ht + rw [norm_smul, mul_comm] + exact mul_le_mul + ((hM (mem_image_of_mem _ ht')).trans (le_max_left _ _)) + (norm_le_supNorm hb (mem_image_of_mem _ ht')) (norm_nonneg _) (le_max_right _ _) + have hi : ‖∫ t in (0 : ℝ)..1, f (Γ.path t) • contourKernel A Γ.toSmoothContour t‖ ≤ + max M 0 * supNorm Γ.toSmoothContour.trace f := by + simpa only [sub_zero, abs_one, mul_one] using + intervalIntegral.norm_integral_le_of_norm_le_const hbound + rw [contourEval_eq_kernel, norm_smul] + exact (mul_le_mul_of_nonneg_left hi (norm_nonneg c)).trans_eq (mul_assoc _ _ _).symm + +theorem contourEval_sub [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {f g : ℂ → ℂ} + (hf : ContinuousOn f Γ.toSmoothContour.trace) + (hg : ContinuousOn g Γ.toSmoothContour.trace) : + contourEval A Γ.toSmoothContour (f - g) = + contourEval A Γ.toSmoothContour f - contourEval A Γ.toSmoothContour g := by + simp only [contourEval_eq_kernel, Pi.sub_apply, sub_smul] + rw [intervalIntegral.integral_sub (intervalIntegrable_contourIntegrand A Γ hf) + (intervalIntegrable_contourIntegrand A Γ hg), smul_sub] + +def tensorOperatorCLM {m : ℕ} (B : Coeff m) : + Operator H →L[ℂ] Operator (Amplification H m) := by + let L : Operator H →ₗ[ℂ] Operator (Amplification H m) := + { toFun := fun A => tensorOperator A B + map_add' := by + intro A D + apply ContinuousLinearMap.ext + intro x + refine UniformSpace.Completion.induction_on x + (isClosed_eq (tensorOperator (A + D) B).continuous + ((tensorOperator A B).continuous.add (tensorOperator D B).continuous)) ?_ + intro a + simp only [tensorOperator, TensorProduct.mapL_add_left, + ContinuousLinearMap.completion_apply_coe, add_apply, + UniformSpace.Completion.coe_add] + map_smul' := by + intro c A + apply ContinuousLinearMap.ext + intro x + refine UniformSpace.Completion.induction_on x + (isClosed_eq (tensorOperator (c • A) B).continuous + ((tensorOperator A B).continuous.const_smul c)) ?_ + intro a + simp only [tensorOperator, TensorProduct.mapL_smul_left, + ContinuousLinearMap.completion_apply_coe, smul_apply, + UniformSpace.Completion.coe_smul, RingHom.id_apply] } + exact L.mkContinuous ‖B‖ (fun A => (norm_tensorOperator_le A B).trans_eq (mul_comm _ _)) + +@[simp] +theorem tensorOperatorCLM_apply {m : ℕ} (A : Operator H) (B : Coeff m) : + tensorOperatorCLM B A = tensorOperator A B := rfl + +def matrixEntryCLM {m : ℕ} (i j : Fin m) : Coeff m →L[ℂ] ℂ where + toFun M := M i j + map_add' _ _ := rfl + map_smul' _ _ := rfl + cont := (continuous_apply j).comp (continuous_apply i) + +def matrixContourEval (A : Operator H) {m : ℕ} (Γ : SmoothContour) + (F : ℂ → Coeff m) : Operator (Amplification H m) := + ∑ i, ∑ j, tensorOperator (contourEval A Γ (fun z => F z i j)) (Matrix.single i j 1) + +theorem tendsto_matrixContourEval [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) + {m : ℕ} {F : ℂ → Coeff m} {Fs : ℕ → ℂ → Coeff m} + (hc : ∀ n, ContinuousOn (Fs n) Γ.toSmoothContour.trace) + (hu : TendstoUniformlyOn Fs F atTop Γ.toSmoothContour.trace) : + Tendsto (fun n => matrixContourEval A Γ.toSmoothContour (Fs n)) atTop + (𝓝 (matrixContourEval A Γ.toSmoothContour F)) := by + unfold matrixContourEval + apply tendsto_finsetSum + intro i _ + apply tendsto_finsetSum + intro j _ + have hsc : ∀ n, ContinuousOn (fun z => Fs n z i j) Γ.toSmoothContour.trace := + fun n => (matrixEntryCLM i j).continuous.comp_continuousOn (hc n) + have hsu : TendstoUniformlyOn (fun n z => Fs n z i j) (fun z => F z i j) + atTop Γ.toSmoothContour.trace := + (matrixEntryCLM i j).uniformContinuous.comp_tendstoUniformlyOn hu + exact (tensorOperatorCLM (H := H) (Matrix.single i j 1)).continuous.continuousAt.tendsto.comp + (tendsto_contourEval A Γ hsc hsu) + +theorem supNorm_le_add_of_dist_le {E : Type*} [NormedAddCommGroup E] + {S : Set ℂ} {F G : ℂ → E} {ε : ℝ} (hε : 0 ≤ ε) + (hG : BddAbove (insert 0 ((fun z => ‖G z‖) '' S))) + (hFG : ∀ z ∈ S, dist (F z) (G z) ≤ ε) : + supNorm S F ≤ supNorm S G + ε := by + apply supNorm_le (add_nonneg (supNorm_nonneg hG) hε) + intro z hz + have h₁ := norm_sub_norm_le (F z) (G z) + have h₂ : ‖F z - G z‖ ≤ ε := by simpa only [dist_eq_norm] using hFG z hz + have h₃ := norm_le_supNorm hG hz + linarith + +theorem abs_supNorm_sub_le_of_dist_le {E : Type*} [NormedAddCommGroup E] + {S : Set ℂ} {F G : ℂ → E} {ε : ℝ} (hε : 0 ≤ ε) + (hF : BddAbove (insert 0 ((fun z => ‖F z‖) '' S))) + (hG : BddAbove (insert 0 ((fun z => ‖G z‖) '' S))) + (hFG : ∀ z ∈ S, dist (F z) (G z) ≤ ε) : + |supNorm S F - supNorm S G| ≤ ε := by + have h₁ := supNorm_le_add_of_dist_le hε hG hFG + have h₂ := supNorm_le_add_of_dist_le hε hF + (fun z hz => (dist_comm (G z) (F z)).trans_le (hFG z hz)) + exact abs_le.mpr ⟨by linarith, by linarith⟩ + +theorem tendsto_supNorm_of_uniform {E : Type*} [NormedAddCommGroup E] + {S : Set ℂ} (hS : IsCompact S) {F : ℂ → E} {Fs : ℕ → ℂ → E} + (hc : ∀ n, ContinuousOn (Fs n) S) (hF : ContinuousOn F S) + (hu : TendstoUniformlyOn Fs F atTop S) : + Tendsto (fun n => supNorm S (Fs n)) atTop (𝓝 (supNorm S F)) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + filter_upwards [Metric.tendstoUniformlyOn_iff.mp hu (ε / 2) (half_pos hε)] + with n hn + have h := abs_supNorm_sub_le_of_dist_le (half_pos hε).le + (supNorm_bddAbove hS (hc n)) (supNorm_bddAbove hS hF) + (fun z hz => (dist_comm (Fs n z) (F z)).trans_le (hn z hz).le) + have hd : dist (supNorm S (Fs n)) (supNorm S F) ≤ ε / 2 := by + simpa only [Real.dist_eq] using h + exact hd.trans_lt (by linarith) + +theorem contour_bound_of_polynomial_approximation [CompleteSpace H] (A : Operator H) + {U : Set ℂ} (Γ : CalculusContour (numericalClosure A) U) {m : ℕ} + (F : ℂ → Coeff m) + (hF : ContinuousOn F (numericalClosure A)) + (hpoly : ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + ‖polynomialEval A B‖ ≤ 2 * supNorm (numericalRange A) (matrixPolynomial B)) + (hcalc : ∀ (d : ℕ) (B : Fin (d + 1) → Coeff m), + matrixContourEval A Γ.toSmoothContour (matrixPolynomial B) = polynomialEval A B) + (degrees : ℕ → ℕ) (B : (n : ℕ) → Fin (degrees n + 1) → Coeff m) + (happrox : TendstoUniformlyOn (fun n => matrixPolynomial (B n)) F atTop + (numericalClosure A ∪ Γ.toSmoothContour.trace)) : + ‖matrixContourEval A Γ.toSmoothContour F‖ ≤ 2 * supNorm (numericalClosure A) F := by + have hev := tendsto_matrixContourEval A Γ + (fun n => (continuous_matrixPolynomial (B n)).continuousOn) + (happrox.mono subset_union_right) + have hmax := tendsto_supNorm_of_uniform (isCompact_numericalClosure A) + (fun n => (continuous_matrixPolynomial (B n)).continuousOn) hF + (happrox.mono subset_union_left) + have htwo : Tendsto (fun n => 2 * supNorm (numericalClosure A) (matrixPolynomial (B n))) + atTop (𝓝 (2 * supNorm (numericalClosure A) F)) := tendsto_const_nhds.mul hmax + apply le_of_tendsto_of_tendsto hev.norm htwo + filter_upwards [] with n + rw [hcalc] + have heq : supNorm (numericalRange A) (matrixPolynomial (B n)) = + supNorm (numericalClosure A) (matrixPolynomial (B n)) := + supNorm_closure (isCompact_numericalClosure A) (continuous_matrixPolynomial (B n)).continuousOn + rw [← heq] + exact hpoly _ _ + +theorem norm_inverse_le_of_inner_lower_bound [CompleteSpace H] (T : Operator H) + {δ : ℝ} (hδ : 0 < δ) (hb : ∀ x : H, ‖x‖ = 1 → δ ≤ ‖⟪x, T x⟫_ℂ‖) : + ‖Ring.inverse T‖ ≤ δ⁻¹ := by + have hu := isUnit_of_inner_lower_bound T hδ hb + apply (Ring.inverse T).opNorm_le_bound (inv_nonneg.mpr hδ.le) + intro x + have hl := operator_lower_bound_of_inner T hb ((Ring.inverse T) x) + have he : T ((Ring.inverse T) x) = x := by + change (T * Ring.inverse T) x = x + rw [Ring.mul_inverse_cancel T hu] + rfl + rw [he] at hl + have hh := mul_le_mul_of_nonneg_left hl (inv_nonneg.mpr hδ.le) + simpa only [← mul_assoc, inv_mul_cancel₀ hδ.ne', one_mul] using hh + +theorem norm_resolvent_le_inv_infDist [CompleteSpace H] [Nontrivial H] + (A : Operator H) {z : ℂ} (hz : z ∉ numericalClosure A) : + ‖Ring.inverse (algebraMap ℂ (Operator H) z - A)‖ ≤ + (Metric.infDist z (numericalClosure A))⁻¹ := by + have hδ : 0 < Metric.infDist z (numericalClosure A) := + IsClosed.notMem_iff_infDist_pos isClosed_closure (numericalClosure_nonempty A) |>.mp hz + apply norm_inverse_le_of_inner_lower_bound _ hδ + intro x hx + have he : ⟪x, (algebraMap ℂ (Operator H) z - A) x⟫_ℂ = z - ⟪x, A x⟫_ℂ := by + simp [ContinuousLinearMap.algebraMap_apply, inner_self_eq_norm_sq_to_K, hx] + rw [he] + simpa only [dist_eq_norm, numericalClosure] using + Metric.infDist_le_dist_of_mem (x := z) (subset_closure (show ⟪x, A x⟫_ℂ ∈ numericalRange A from + ⟨x, hx, rfl⟩)) + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/ResolventMoments.lean b/lean/OAI/Analysis/Crouzeix/ResolventMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..38c9a36879e2a498887c6fb94b4c8258b965b8d8 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/ResolventMoments.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.Analysis.Crouzeix.PhysicalCalculus + +namespace OAI + +/-! Resolvent Moments. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex ComplexConjugate MeasureTheory + +open scoped Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Boundary + +section + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma contourEval_circleIntegral (A : Operator H) {V : Set ℂ} + (Γ : CalculusContour (numericalClosure A) V) (f : CircleSpace → ℂ → ℂ) + (hf : ContinuousOn (fun p : ℝ × CircleSpace => f p.2 (Γ.path p.1)) (Icc 0 1 ×ˢ univ)) : + contourEval A Γ.toSmoothContour (fun z => ∫ t, f t z ∂circleMeasure) = + ∫ t, contourEval A Γ.toSmoothContour (f t) ∂circleMeasure := by + let k (s : ℝ) (t : CircleSpace) := f t (Γ.path s) • contourKernel A Γ.toSmoothContour s + have hc : ContinuousOn (uncurry k) (Icc 0 1 ×ˢ univ) := + hf.smul ((continuousOn_contourKernel A Γ).comp continuous_fst.continuousOn (fun p hp => hp.1)) + have hi := (hc.integrableOn_compact (μ := volume.prod circleMeasure) + (isCompact_Icc.prod isCompact_univ)).mono_set (prod_mono Ioc_subset_Icc_self (Subset.refl univ)) + have hi' : Integrable (uncurry k) ((volume.restrict (uIoc 0 1)).prod circleMeasure) := by + simpa only [IntegrableOn, ← Measure.prod_restrict, Measure.restrict_univ, + uIoc_of_le (by norm_num : (0 : ℝ) ≤ 1)] using hi + simp only [contourEval_eq_kernel] + simp_rw [← integral_smul_const] + rw [intervalIntegral_integral_swap hi', integral_smul] + +lemma ringInverse_neg {R : Type*} [Ring R] (a : R) : Ring.inverse (-a) = -Ring.inverse a := by + rw [← neg_one_mul a, Ring.inverse_mul (Or.inl isUnit_one.neg)] + have h : Ring.inverse (-1 : R) = (-1 : R) := by + rw [show (-1 : R) = ((-1 : Rˣ) : R) from rfl, Ring.inverse_unit] + simp + rw [h, mul_neg_one] + +lemma contourEval_sub_inv (A : Operator H) {V : Set ℂ} + (Γ : CalculusContour (numericalClosure A) V) {a : ℂ} (ha : a ∉ V) : + contourEval A Γ.toSmoothContour (fun z => (a - z)⁻¹) = + Ring.inverse (algebraMap ℂ (Operator H) a - A) := by + have hfun : (fun z : ℂ => (a-z)⁻¹) = (fun z => (-1 : ℂ) * (z-a)⁻¹) := by + ext z + rw [← neg_sub z a, inv_neg, neg_one_mul] + rw [hfun, contourEval_const_mul, contourEval_inv_sub A Γ ha, neg_one_smul, + ← ringInverse_neg, neg_sub] + +end + +namespace Conformal.ExteriorCollar + +variable {U : Set ℂ} (C : ExteriorCollar U) + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma boundaryMap_not_mem (hU : IsOpen U) (t : CircleSpace) : C.boundaryMap t ∉ U := + fun ht => (C.boundaryMap_mem_frontier t).2 (hU.interior_eq.symm ▸ ht) + +lemma boundary_difference_ne_zero (hU : IsOpen U) {z : ℂ} (hz : z ∈ U) (t : CircleSpace) : + C.boundaryMap t - z ≠ 0 := fun he => C.boundaryMap_not_mem hU t (sub_eq_zero.mp he ▸ hz) + +def operatorResolvent (A : Operator H) (hKU : numericalClosure A ⊆ U) (hU : IsOpen U) : + C(CircleSpace, Operator H) := + ⟨fun t => C.boundaryNormal t • Ring.inverse (algebraMap ℂ (Operator H) (C.boundaryMap t) - A), + C.boundaryNormal.continuous.smul ((continuousOn_resolvent A).comp_continuous C.boundaryMap.continuous + (fun t ht => C.boundaryMap_not_mem hU t (hKU ht)))⟩ + +lemma operatorResolvent_add_star_nonneg (A : Operator H) (hKU : numericalClosure A ⊆ U) + (hU : IsOpen U) (hc : Convex ℝ U) (t : CircleSpace) : + 0 ≤ C.operatorResolvent A hKU hU t + star (C.operatorResolvent A hKU hU t) := by + apply ContinuousLinearMap.nonneg_iff_isPositive.mpr + apply isPositive_original_resolvent_of_not_mem + · exact fun ht => C.boundaryMap_not_mem hU t (hKU ht) + · intro w hw + exact C.supporting_normal hc (norm_circleCoordinate t) (subset_closure (hKU (subset_closure hw))) + +variable [Nontrivial H] + +lemma integral_operatorResolvent_moment (A : Operator H) (hKU : numericalClosure A ⊆ U) + (hU : IsOpen U) (j : ℤ) : + (∫ t, (circleCoordinate t)^j • C.operatorResolvent A hKU hU t ∂circleMeasure) = + holomorphicEval A C.outerDomain (C.physicalCoefficient j) := by + obtain ⟨Γ⟩ := exists_calculusContour (isCompact_numericalClosure A) + (convex_numericalClosure A) (numericalClosure_nonempty A) hU hKU + have hsub : U ⊆ C.outerDomain := subset_closure.trans C.closure_subset_outerDomain + rw [← holomorphicEval_restrict A hU C.isOpen_outerDomain hKU hsub + (C.differentiableOn_physicalCoefficient j), holomorphicEval_eq_contourEval A hU + ((C.differentiableOn_physicalCoefficient j).mono hsub) Γ] + have he : contourEval A Γ.toSmoothContour (C.physicalCoefficient j) = + contourEval A Γ.toSmoothContour (fun z => ∫ t, (circleCoordinate t)^j * + (C.boundaryNormal t / (C.boundaryMap t-z)) ∂circleMeasure) := by + apply contourEval_congr + rintro z ⟨s,hs,rfl⟩ + exact C.physicalCoefficient_inside hU j (Γ.avoids s hs).1 + rw [he] + have hcont : ContinuousOn (fun p : ℝ × CircleSpace => (circleCoordinate p.2)^j * + (C.boundaryNormal p.2 / (C.boundaryMap p.2 - Γ.path p.1))) (Icc 0 1 ×ˢ univ) := by + exact ((circleCoordinate.continuous.zpow₀ j (fun t => Or.inl (circleCoordinate_ne_zero t))).comp continuous_snd).continuousOn.mul + ((C.boundaryNormal.continuous.comp continuous_snd).continuousOn.div + ((C.boundaryMap.continuous.comp continuous_snd).sub (Γ.smooth.continuous.comp continuous_fst)).continuousOn + (fun p hp => C.boundary_difference_ne_zero hU (Γ.avoids p.1 hp.1).1 p.2)) + rw [contourEval_circleIntegral A Γ _ hcont] + apply integral_congr_ae + filter_upwards [] with t + have heq : (fun z => (circleCoordinate t)^j * (C.boundaryNormal t / (C.boundaryMap t-z))) = + (fun z => ((circleCoordinate t)^j * C.boundaryNormal t) * (C.boundaryMap t-z)⁻¹) := by + ext z; simp only [div_eq_mul_inv, mul_assoc] + rw [heq, contourEval_const_mul, contourEval_sub_inv A Γ (C.boundaryMap_not_mem hU t), mul_smul] + rfl + +end Conformal.ExteriorCollar + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Riemann.lean b/lean/OAI/Analysis/Crouzeix/Riemann.lean new file mode 100644 index 0000000000000000000000000000000000000000..5d41848b77ff608d3fc54d66502a26d3a49888fa --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Riemann.lean @@ -0,0 +1,200 @@ +import Mathlib +import OAI.Analysis.Crouzeix.DiskAutomorphism +import OAI.Analysis.Crouzeix.Hurwitz + +namespace OAI + +/-! Riemann. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +namespace CrouzeixHilbert.Conformal + +structure DiskEmbedding (U : Set ℂ) (a : ℂ) (f : ℂ → ℂ) : Prop where + holomorphic : DifferentiableOn ℂ f U + injective : InjOn f U + into_disk : ∀ z ∈ U, ‖f z‖ < 1 + normalized : f a = 0 + +theorem derivative_values_bddAbove {U : Set ℂ} {a : ℂ} (hU : IsOpen U) (ha : a ∈ U) : + BddAbove {v : ℝ | ∃ f, DiskEmbedding U a f ∧ ‖deriv f a‖ = v} := by + obtain ⟨r, hr, hsub⟩ := Metric.isOpen_iff.mp hU a ha + refine ⟨1 / (r / 2), ?_⟩ + rintro v ⟨f, hf, rfl⟩ + exact norm_deriv_le_on_half_ball hU hf.holomorphic + (fun z hz => (hf.into_disk z hz).le) hr hsub (mem_ball_self (by positivity)) + +theorem exists_extremal {U : Set ℂ} {a : ℂ} (hU : IsOpen U) + (hc : IsPreconnected U) (ha : a ∈ U) {g : ℂ → ℂ} + (hg : DiskEmbedding U a g) (hgd : deriv g a ≠ 0) : + ∃ f, DiskEmbedding U a f ∧ deriv f a ≠ 0 ∧ + ∀ q, DiskEmbedding U a q → ‖deriv q a‖ ≤ ‖deriv f a‖ := by + classical + let S : Set ℝ := {v | ∃ f, DiskEmbedding U a f ∧ ‖deriv f a‖ = v} + have hS : S.Nonempty := ⟨‖deriv g a‖, g, hg, rfl⟩ + have hSb : BddAbove S := derivative_values_bddAbove hU ha + have hα : 0 < sSup S := (norm_pos_iff.mpr hgd).trans_le (le_csSup hSb ⟨g, hg, rfl⟩) + obtain ⟨v, _, hv, hvS⟩ := exists_seq_tendsto_sSup hS hSb + choose F hF hFv using hvS + obtain ⟨f, φ, hφ, hl, hd, hnorm⟩ := montel hU F (fun n => (hF n).holomorphic) + (fun n z hz => ((hF n).into_disk z hz).le) + have hderiv : ‖deriv f a‖ = sSup S := by + have hlim := ((hl.deriv (Eventually.of_forall (fun n => (hF (φ n)).holomorphic)) hU).tendsto_at ha).norm + have heq : (fun n => ‖deriv ((F ∘ φ) n) a‖) = v ∘ φ := by + funext n + exact hFv (φ n) + change Tendsto (fun n => ‖deriv ((F ∘ φ) n) a‖) atTop (𝓝 ‖deriv f a‖) at hlim + rw [heq] at hlim + exact tendsto_nhds_unique hlim (hv.comp hφ.tendsto_atTop) + have hfd : deriv f a ≠ 0 := norm_pos_iff.mp (hderiv ▸ hα) + have hnc : ¬ ∃ c, EqOn f (fun _ => c) U := by + rintro ⟨c, he⟩ + apply hfd + have hfe : f =ᶠ[𝓝 a] fun _ => c := he.eventuallyEq_of_mem (hU.mem_nhds ha) + exact hfe.deriv_eq.trans (deriv_const _ _) + have hinto : ∀ z ∈ U, ‖f z‖ < 1 := by + intro z hz + apply lt_of_le_of_ne (hnorm z hz) + intro he + apply hnc + refine ⟨f z, Complex.eqOn_of_isPreconnected_of_isMaxOn_norm hc hU hd hz ?_⟩ + intro w hw + exact (hnorm w hw).trans he.ge + have hzero : f a = 0 := by + apply tendsto_nhds_unique (hl.tendsto_at ha) + have he : (fun n => (F ∘ φ) n a) = fun _ => (0 : ℂ) := by + funext n + exact (hF (φ n)).normalized + rw [he] + exact tendsto_const_nhds + refine ⟨f, ⟨hd, injOn_of_tendstoLocallyUniformlyOn hU hc hl + (fun n => (hF (φ n)).holomorphic) (fun n => (hF (φ n)).injective) hnc, hinto, hzero⟩, + hfd, ?_⟩ + intro q hq + rw [hderiv] + exact le_csSup hSb ⟨q, hq, rfl⟩ + +theorem exists_holomorphic_square_root {U : Set ℂ} (hU : IsOpen U) + (hc : IsSimplyConnected U) {q : ℂ → ℂ} (hq : DifferentiableOn ℂ q U) + (hz : ∀ z ∈ U, q z ≠ 0) : + ∃ h : ℂ → ℂ, (∀ z, h z ^ 2 = q z) ∧ + (∀ z ∈ U, h z ≠ 0) ∧ + ∀ z ∈ U, HasDerivAt h (deriv q z / (2 * h z)) z := by + have hnot : 0 ∉ q '' U := by + rintro ⟨z, hzu, he⟩ + exact hz z hzu he + obtain ⟨h, hh, he⟩ := Complex.exists_continuousOn_pow_eq hc hU hq.continuousOn hnot two_ne_zero + have hn : ∀ z ∈ U, h z ≠ 0 := by + intro z hzu he' + apply hz z hzu + rw [← he, he', zero_pow two_ne_zero] + refine ⟨h, he, hn, ?_⟩ + intro z hzu + have hp : HasDerivAt (fun x : ℂ => x ^ 2) (2 * h z) (h z) := by + simpa using hasDerivAt_pow 2 (h z) + exact HasDerivAt.of_comp_left (hh.continuousAt (hU.mem_nhds hzu)) hp + ((hq z hzu).differentiableAt (hU.mem_nhds hzu)).hasDerivAt + (mul_ne_zero two_ne_zero (hn z hzu)) (Eventually.of_forall he) + +theorem exists_improved_of_omitted {U : Set ℂ} {a : ℂ} (hU : IsOpen U) + (hc : IsSimplyConnected U) (ha : a ∈ U) {f : ℂ → ℂ} + (hf : DiskEmbedding U a f) (hfd : deriv f a ≠ 0) + {w : ℂ} (hw : ‖w‖ < 1) (hwo : w ∉ f '' U) : + ∃ ψ, DiskEmbedding U a ψ ∧ ‖deriv f a‖ < ‖deriv ψ a‖ := by + let q := diskShift w ∘ f + have hqnorm : ∀ z ∈ U, ‖q z‖ < 1 := fun z hz => diskShift_into_disk hw (hf.into_disk z hz) + have hqhol : DifferentiableOn ℂ q U := by + intro z hz + exact ((hasDerivAt_diskShift hw (hf.into_disk z hz).le).comp z + ((hf.holomorphic z hz).differentiableAt (hU.mem_nhds hz)).hasDerivAt).differentiableAt.differentiableWithinAt + have hqinj : InjOn q U := (diskShift_injOn hw).comp hf.injective + (fun z hz => mem_closedBall_zero_iff.mpr (hf.into_disk z hz).le) + have hqzero : ∀ z ∈ U, q z ≠ 0 := by + intro z hz he + exact hwo ⟨z, hz, (diskShift_eq_zero_iff hw (hf.into_disk z hz).le).mp he⟩ + obtain ⟨h, hsq, hhn, hhd⟩ := exists_holomorphic_square_root hU hc hqhol hqzero + have hhnorm : ∀ z ∈ U, ‖h z‖ < 1 := by + intro z hz + have hn : ‖h z‖ ^ 2 < 1 := by rw [← norm_pow, hsq]; exact hqnorm z hz + nlinarith [norm_nonneg (h z)] + have hhinj : InjOn h U := by + intro z hz v hv he + apply hqinj hz hv + rw [← hsq, ← hsq, he] + let ψ := diskShift (h a) ∘ h + have hψder : HasDerivAt ψ + (deriv (diskShift (h a)) (h a) * (deriv q a / (2 * h a))) a := + (hasDerivAt_diskShift (hhnorm a ha) (hhnorm a ha).le).differentiableAt.hasDerivAt.comp a (hhd a ha) + have hψ : DiskEmbedding U a ψ := by + constructor + · intro z hz + exact ((hasDerivAt_diskShift (hhnorm a ha) (hhnorm z hz).le).comp z + (hhd z hz)).differentiableAt.differentiableWithinAt + · exact (diskShift_injOn (hhnorm a ha)).comp hhinj + (fun z hz => mem_closedBall_zero_iff.mpr (hhnorm z hz).le) + · exact fun z hz => diskShift_into_disk (hhnorm a ha) (hhnorm z hz) + · exact diskShift_self _ + refine ⟨ψ, hψ, ?_⟩ + have hqa : q a = -w := by simp [q, hf.normalized] + have hsqa : ‖h a‖ ^ 2 = ‖w‖ := by rw [← norm_pow, hsq, hqa, norm_neg] + have hqd : ‖deriv q a‖ = (1 - ‖w‖ ^ 2) * ‖deriv f a‖ := by + rw [deriv_comp a (hasDerivAt_diskShift hw (hf.into_disk a ha).le).differentiableAt + ((hf.holomorphic a ha).differentiableAt (hU.mem_nhds ha)), norm_mul, + hf.normalized, norm_deriv_diskShift_zero hw] + have hψnorm : ‖deriv ψ a‖ = (1 - ‖h a‖ ^ 2)⁻¹ * + ((1 - ‖w‖ ^ 2) * ‖deriv f a‖ / (2 * ‖h a‖)) := by + rw [hψder.deriv, norm_mul, norm_deriv_diskShift_self (hhnorm a ha), + norm_div, hqd, norm_mul] + norm_num + have hr0 : 0 < ‖h a‖ := norm_pos_iff.mpr (hhn a ha) + have hr1 : ‖h a‖ < 1 := hhnorm a ha + have ha0 : 0 < ‖deriv f a‖ := norm_pos_iff.mpr hfd + have hden : 0 < 1 - ‖h a‖ ^ 2 := by nlinarith + rw [hψnorm, ← hsqa] + have he : (1 - ‖h a‖ ^ 2)⁻¹ * + ((1 - (‖h a‖ ^ 2) ^ 2) * ‖deriv f a‖ / (2 * ‖h a‖)) = + (1 + ‖h a‖ ^ 2) * ‖deriv f a‖ / (2 * ‖h a‖) := by + field_simp + ring + rw [he, lt_div_iff₀ (by positivity)] + have hgain : 0 < (1 - ‖h a‖) ^ 2 * ‖deriv f a‖ := + mul_pos (sq_pos_of_pos (sub_pos.mpr hr1)) ha0 + nlinarith + +theorem exists_diskEmbedding_of_bounded {U : Set ℂ} (hb : Bornology.IsBounded U) (a : ℂ) : + ∃ f, DiskEmbedding U a f ∧ deriv f a ≠ 0 := by + obtain ⟨r, hr, hsub⟩ := hb.subset_ball_lt 0 a + have hrC : (r : ℂ) ≠ 0 := by exact_mod_cast hr.ne' + let f : ℂ → ℂ := fun z => (z - a) / r + have hd : ∀ z, HasDerivAt f (1 / r) z := fun z => ((hasDerivAt_id z).sub_const a).div_const (r : ℂ) + refine ⟨f, ⟨fun z _ => (hd z).differentiableAt.differentiableWithinAt, ?_, ?_, ?_⟩, ?_⟩ + · intro z _ w _ he + have he' : z - a = w - a := (div_left_inj' hrC).mp he + exact sub_left_injective he' + · intro z hz + change ‖(z - a) / (r : ℂ)‖ < 1 + rw [norm_div, Complex.norm_real, Real.norm_of_nonneg hr.le, div_lt_one₀ hr] + exact (dist_eq_norm z a) ▸ hsub hz + · simp [f] + · rw [(hd a).deriv] + exact div_ne_zero one_ne_zero hrC + +theorem riemann_mapping_bounded {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hc : IsSimplyConnected U) {a : ℂ} (ha : a ∈ U) : + ∃ f, DiskEmbedding U a f ∧ deriv f a ≠ 0 ∧ BijOn f U (ball 0 1) := by + obtain ⟨g, hg, hgd⟩ := exists_diskEmbedding_of_bounded hb a + obtain ⟨f, hf, hfd, hext⟩ := exists_extremal hU hc.isPathConnected.isConnected.isPreconnected ha hg hgd + refine ⟨f, hf, hfd, ⟨fun z hz => mem_ball_zero_iff.mpr (hf.into_disk z hz), hf.injective, ?_⟩⟩ + intro w hw + by_contra hwo + obtain ⟨ψ, hψ, hh⟩ := exists_improved_of_omitted hU hc ha hf hfd + (mem_ball_zero_iff.mp hw) hwo + exact (hext ψ hψ).not_gt hh + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/SeparateHolomorphic.lean b/lean/OAI/Analysis/Crouzeix/SeparateHolomorphic.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8bf80f5527308b99ba87bd9b64d1f581b2cf1dc --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/SeparateHolomorphic.lean @@ -0,0 +1,153 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HomologicalCauchy + +namespace OAI + +/-! Separate Holomorphic. -/ + +noncomputable section + +open Set Filter Metric Topology Function Complex MeasureTheory + +open scoped Interval + +namespace CrouzeixHilbert + +lemma differentiableOn_parameter_intervalIntegral_pos {U : Set ℂ} (hU : IsOpen U) + {T : ℝ} (hT : 0 < T) {f : ℂ → ℝ → ℂ} + (hf : ContinuousOn (uncurry f) (U ×ˢ Icc 0 T)) + (hd : ∀ t ∈ Icc 0 T, DifferentiableOn ℂ (fun z => f z t) U) : + DifferentiableOn ℂ (fun z => ∫ t in (0 : ℝ)..T, f z t) U := by + have hmap : MapsTo (fun p : ℂ × ℝ => (p.1, T * p.2)) + (U ×ˢ Icc (0 : ℝ) 1) (U ×ˢ Icc 0 T) := by + rintro ⟨z,t⟩ ⟨hz,ht⟩ + exact ⟨hz, mul_nonneg hT.le ht.1, by nlinarith [ht.2]⟩ + have hi := differentiableOn_parameter_intervalIntegral hU + (f := fun z t => f z (T * t)) + (hf.comp (f := fun p : ℂ × ℝ => (p.1, T * p.2)) (by fun_prop) hmap) + (fun t ht => hd (T * t) ⟨mul_nonneg hT.le ht.1, by nlinarith [ht.2]⟩) + have he (z : ℂ) : T • (∫ t in (0 : ℝ)..1, f z (T * t)) = + ∫ t in (0 : ℝ)..T, f z t := by + simpa only [mul_zero, mul_one] using intervalIntegral.smul_integral_comp_mul_left + (f z) (a := 0) (b := 1) T + exact (hi.const_smul T).congr (fun z _ => (he z).symm) + +lemma deriv_eq_circle_parameter {U : Set ℂ} {f : ℂ → ℂ} + (hd : DifferentiableOn ℂ f U) {u : ℂ} {R : ℝ} (hR : 0 < R) + (hRU : closedBall u R ⊆ U) : + deriv f u = (2 * (Real.pi : ℂ) * I)⁻¹ * + ∫ θ in (0 : ℝ)..(2 * Real.pi), + ((circleMap 0 R θ * I) / (circleMap 0 R θ) ^ 2) * + f (u + circleMap 0 R θ) := by + have he := (hd.mono hRU).deriv_eq_smul_circleIntegral hR + have hn : (2 * (Real.pi : ℂ) * I) ≠ 0 := by + exact mul_ne_zero (mul_ne_zero (by norm_num) (ofReal_ne_zero.mpr Real.pi_ne_zero)) I_ne_zero + calc + deriv f u = (2 * (Real.pi : ℂ) * I)⁻¹ * + (∮ w in C(u,R), (1 / (w-u)^2) • f w) := by + rw [he, smul_eq_mul, inv_mul_cancel_left₀ hn] + _ = _ := by + congr 1 + simp only [circleIntegral, deriv_circleMap, smul_eq_mul] + apply intervalIntegral.integral_congr + intro θ _ + have hm : circleMap u R θ = u + circleMap 0 R θ := by simp [circleMap] + dsimp only + rw [hm, add_sub_cancel_left] + ring + +theorem continuousOn_first_derivative {U V : Set ℂ} (hU : IsOpen U) (hV : IsOpen V) + {f : ℂ → ℂ → ℂ} (hf : ContinuousOn (uncurry f) (U ×ˢ V)) + (hd : ∀ v ∈ V, DifferentiableOn ℂ (fun u => f u v) U) : + ContinuousOn (fun p : ℂ × ℂ => deriv (fun u => f u p.2) p.1) (U ×ˢ V) := by + rintro ⟨u,v⟩ ⟨hu,hv⟩ + obtain ⟨δ,hδ,hδU⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (hU.mem_nhds hu) + let R := δ / 3 + have hR : 0 < R := div_pos hδ (by norm_num) + let P := ball u R ×ˢ V + have hP : IsOpen P := isOpen_ball.prod hV + have hp : (u,v) ∈ P := ⟨mem_ball_self hR,hv⟩ + have hshift (p : P) (θ : ℝ) : (p.1.1 + circleMap 0 R θ, p.1.2) ∈ U ×ˢ V := by + refine ⟨hδU ?_,p.2.2⟩ + rw [mem_closedBall, dist_eq_norm] + have hn := mem_ball.mp p.2.1 + rw [dist_eq_norm] at hn + have hm : ‖circleMap 0 R θ‖ = R := by rw [norm_circleMap_zero, abs_of_pos hR] + calc + ‖p.1.1 + circleMap 0 R θ - u‖ = ‖(p.1.1-u) + circleMap 0 R θ‖ := by congr 1; ring + _ ≤ ‖p.1.1-u‖ + ‖circleMap 0 R θ‖ := norm_add_le _ _ + _ ≤ δ := by rw [hm]; dsimp [R] at hn ⊢; linarith + have hcoeff : Continuous (fun θ : ℝ => (circleMap 0 R θ * I) / (circleMap 0 R θ)^2) := by + apply Continuous.div (by fun_prop) (by fun_prop) + intro θ + exact pow_ne_zero _ (by + apply norm_ne_zero_iff.mp + rw [norm_circleMap_zero, abs_of_pos hR] + exact hR.ne') + have hfamily : Continuous (fun q : P × ℝ => + ((circleMap 0 R q.2 * I) / (circleMap 0 R q.2)^2) * + f (q.1.1.1 + circleMap 0 R q.2) q.1.1.2) := by + apply (hcoeff.comp continuous_snd).mul + exact hf.comp_continuous (f := fun q : P × ℝ => + (q.1.1.1 + circleMap 0 R q.2, q.1.1.2)) (by fun_prop) (fun q => hshift q.1 q.2) + have hc := (intervalIntegral.continuous_parametric_intervalIntegral_of_continuous' (μ := volume) + (f := fun (p : P) θ => ((circleMap 0 R θ * I) / (circleMap 0 R θ)^2) * + f (p.1.1 + circleMap 0 R θ) p.1.2) hfamily 0 (2 * Real.pi)).const_mul (2 * (Real.pi : ℂ) * I)⁻¹ + have hc' : ContinuousOn (fun p : ℂ × ℂ => (2 * (Real.pi : ℂ) * I)⁻¹ * + ∫ θ in (0 : ℝ)..(2 * Real.pi), + ((circleMap 0 R θ * I) / (circleMap 0 R θ)^2) * + f (p.1 + circleMap 0 R θ) p.2) P := + continuousOn_iff_continuous_domRestrict.mpr hc + have he : EqOn (fun p : ℂ × ℂ => deriv (fun w => f w p.2) p.1) + (fun p => (2 * (Real.pi : ℂ) * I)⁻¹ * + ∫ θ in (0 : ℝ)..(2 * Real.pi), + ((circleMap 0 R θ * I) / (circleMap 0 R θ)^2) * + f (p.1 + circleMap 0 R θ) p.2) P := by + intro p hp + apply deriv_eq_circle_parameter (hd _ hp.2) hR + intro w hw + apply hδU + have hd1 := mem_ball.mp hp.1 + have hd2 := mem_closedBall.mp hw + have hd3 := dist_triangle w p.1 u + rw [mem_closedBall] + dsimp [R] at hd1 hd2 + linarith + exact ((hc'.congr he).continuousAt (hP.mem_nhds hp)).continuousWithinAt + +theorem differentiableOn_second_first_derivative {U V : Set ℂ} + (hU : IsOpen U) (hV : IsOpen V) {f : ℂ → ℂ → ℂ} + (hf : ContinuousOn (uncurry f) (U ×ˢ V)) + (hd : ∀ v ∈ V, DifferentiableOn ℂ (fun u => f u v) U) + (hv : ∀ u ∈ U, DifferentiableOn ℂ (f u) V) {u : ℂ} (hu : u ∈ U) : + DifferentiableOn ℂ (fun v => deriv (fun w => f w v) u) V := by + obtain ⟨R,hR,hRU⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (hU.mem_nhds hu) + have hshift (θ : ℝ) : u + circleMap 0 R θ ∈ U := by + apply hRU + rw [mem_closedBall, dist_eq_norm, add_sub_cancel_left, + norm_circleMap_zero, abs_of_pos hR] + have hcoeff : Continuous (fun θ : ℝ => (circleMap 0 R θ * I) / (circleMap 0 R θ)^2) := by + apply Continuous.div (by fun_prop) (by fun_prop) + intro θ + apply pow_ne_zero + apply norm_ne_zero_iff.mp + rw [norm_circleMap_zero, abs_of_pos hR] + exact hR.ne' + have hfamily : ContinuousOn (fun q : ℂ × ℝ => + ((circleMap 0 R q.2 * I) / (circleMap 0 R q.2)^2) * + f (u + circleMap 0 R q.2) q.1) (V ×ˢ Icc 0 (2*Real.pi)) := by + apply (hcoeff.comp continuous_snd).continuousOn.mul + exact hf.comp (f := fun q : ℂ × ℝ => (u + circleMap 0 R q.2, q.1)) + (by fun_prop) (fun q hq => ⟨hshift q.2,hq.1⟩) + have hh := differentiableOn_parameter_intervalIntegral_pos hV Real.two_pi_pos + (f := fun v θ => ((circleMap 0 R θ * I) / (circleMap 0 R θ)^2) * + f (u + circleMap 0 R θ) v) hfamily + (fun θ _ => (hv _ (hshift θ)).const_mul _) + exact (hh.const_mul (2 * (Real.pi : ℂ) * I)⁻¹).congr + (fun v hv => deriv_eq_circle_parameter (hd v hv) hR hRU) + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Sharpness.lean b/lean/OAI/Analysis/Crouzeix/Sharpness.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7fa42810d64d86800a2a7e16bfc3cdb6eeb7570 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Sharpness.lean @@ -0,0 +1,107 @@ +import Mathlib +import OAI.Analysis.Crouzeix.RationalEvaluation + +namespace OAI + +/-! A two-dimensional operator with sharp constant two. -/ + +noncomputable section + +open scoped TensorProduct Matrix.Norms.L2Operator InnerProductSpace + +open Set + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +def sharpOperator : Operator (EuclideanSpace ℂ (Fin 2)) := + (2 : ℂ) • InnerProductSpace.rankOne ℂ + (EuclideanSpace.single 0 1) (EuclideanSpace.single 1 1) + +def sharpCoefficients : Fin 2 → Coeff 1 := ![0, 1] + +theorem norm_sharpOperator : ‖sharpOperator‖ = 2 := by + norm_num [sharpOperator, norm_smul, InnerProductSpace.norm_rankOne, + PiLp.norm_single] + +theorem sharpOperator_apply (x : EuclideanSpace ℂ (Fin 2)) : + sharpOperator x = (2 * x 1) • EuclideanSpace.single 0 1 := by + simp [sharpOperator, InnerProductSpace.rankOne_apply, EuclideanSpace.inner_single_left, + smul_smul] + +theorem sharpOperator_inner_norm (x : EuclideanSpace ℂ (Fin 2)) : + ‖⟪x, sharpOperator x⟫_ℂ‖ = 2 * ‖x 0‖ * ‖x 1‖ := by + rw [sharpOperator_apply, inner_smul_right, EuclideanSpace.inner_single_right] + simp only [one_mul, norm_mul, Complex.norm_conj] + norm_num + ring + +theorem sharpOperator_numerical_le {z : ℂ} (hz : z ∈ numericalRange sharpOperator) : + ‖z‖ ≤ 1 := by + obtain ⟨x, hx, rfl⟩ := hz + have hs := EuclideanSpace.norm_sq_eq x + simp only [Fin.sum_univ_two, hx, one_pow] at hs + rw [sharpOperator_inner_norm] + nlinarith [sq_nonneg (‖x 0‖ - ‖x 1‖)] + +theorem sharpOperator_numerical_attains : + ∃ z ∈ numericalRange sharpOperator, ‖z‖ = 1 := by + let v : EuclideanSpace ℂ (Fin 2) := + EuclideanSpace.single 0 1 + EuclideanSpace.single 1 1 + have hv0 : v 0 = 1 := by simp [v] + have hv1 : v 1 = 1 := by simp [v] + have hv : ‖v‖ ≠ 0 := by + intro h + have hh := congrArg (fun w : EuclideanSpace ℂ (Fin 2) => w 0) (norm_eq_zero.mp h) + simp [hv0] at hh + let x : EuclideanSpace ℂ (Fin 2) := (‖v‖ : ℂ)⁻¹ • v + have hx : ‖x‖ = 1 := by simp [x, norm_smul, hv] + have heq : x 0 = x 1 := by simp [x, hv0, hv1] + refine ⟨⟪x, sharpOperator x⟫_ℂ, ⟨x, hx, rfl⟩, ?_⟩ + rw [sharpOperator_inner_norm, heq] + have hs := EuclideanSpace.norm_sq_eq x + simp only [Fin.sum_univ_two, hx, one_pow, heq] at hs + nlinarith + +@[simp] +theorem sharp_matrixPolynomial (z : ℂ) : + matrixPolynomial (d := 1) sharpCoefficients z = z • (1 : Coeff 1) := by + simp [matrixPolynomial, sharpCoefficients, Fin.sum_univ_two] + +@[simp] +theorem sharp_polynomialEval : polynomialEval sharpOperator (d := 1) sharpCoefficients = + tensorOperator sharpOperator (1 : Coeff 1) := by + simp [polynomialEval, sharpCoefficients, Fin.sum_univ_two] + +theorem sharpConstant : SharpConstant := by + refine ⟨sharpOperator, sharpCoefficients, ?_, ?_⟩ + · apply le_antisymm + · apply supNorm_le (by norm_num) + intro z hz + simpa [norm_smul] using sharpOperator_numerical_le hz + · obtain ⟨z, hz, hzn⟩ := sharpOperator_numerical_attains + have hbK := supNorm_bddAbove (isCompact_numericalClosure sharpOperator) + (continuous_matrixPolynomial (d := 1) sharpCoefficients).continuousOn + have hbW : BddAbove (insert 0 ((fun z => ‖matrixPolynomial (d := 1) sharpCoefficients z‖) '' + numericalRange sharpOperator)) := + hbK.mono (Set.insert_subset_insert (Set.image_mono subset_closure)) + simpa [norm_smul, hzn] using norm_le_supNorm hbW hz + · rw [sharp_polynomialEval] + apply le_antisymm + · simpa [norm_sharpOperator] using norm_tensorOperator_le sharpOperator (1 : Coeff 1) + · let e : EuclideanSpace ℂ (Fin 2) := EuclideanSpace.single 1 1 + let f : EuclideanSpace ℂ (Fin 1) := EuclideanSpace.single 0 1 + let w : Amplification (EuclideanSpace ℂ (Fin 2)) 1 := ↑(e ⊗ₜ[ℂ] f) + have hw : ‖w‖ ≤ 1 := by simp [w, e, f] + have hl := (tensorOperator sharpOperator (1 : Coeff 1)).unit_le_opNorm w hw + have he : ‖sharpOperator e‖ = 2 := by + simp [sharpOperator_apply, e, norm_smul] + simpa [w, f, tensorOperator, ContinuousLinearMap.completion_apply_coe, he] using hl + +end CrouzeixHilbert +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/SimilarityRepresentation.lean b/lean/OAI/Analysis/Crouzeix/SimilarityRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd961f3222661f04ea715d9302ef7d7ac724959b --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/SimilarityRepresentation.lean @@ -0,0 +1,173 @@ +import Mathlib +import OAI.Analysis.Crouzeix.CauchyProjection + +namespace OAI + +/-! Similarity Representation. -/ + +noncomputable section + +open MeasureTheory + +open scoped InnerProductSpace TensorProduct Matrix Matrix.Norms.L2Operator MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +namespace Endpoint + +section Intertwining + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +theorem intertwining_inner (S B D : E →L[ℂ] E) (hS : IsSelfAdjoint S) + (hSB : S * B = D * S) (x y : E) (a b : ℝ) (hb : b ≠ 0) + (hx : S x = (a : ℂ) • x) (hy : S y = (b : ℂ) • y) : + ⟪y, B x⟫_ℂ = ((a / b : ℝ) : ℂ) * ⟪y, D x⟫_ℂ := by + have he : (b : ℂ) * ⟪y, B x⟫_ℂ = (a : ℂ) * ⟪y, D x⟫_ℂ := by + calc + _ = ⟪S y, B x⟫_ℂ := by rw [hy, inner_smul_left]; simp + _ = ⟪y, S (B x)⟫_ℂ := by + simpa only [hS.adjoint_eq] using ContinuousLinearMap.adjoint_inner_left S (B x) y + _ = ⟪y, D (S x)⟫_ℂ := by + rw [← mul_apply_eq_comp, hSB, mul_apply_eq_comp] + _ = _ := by rw [hx, map_smul, inner_smul_right] + rw [Complex.ofReal_div, div_mul_eq_mul_div, + eq_div_iff (by exact_mod_cast hb : (b : ℂ) ≠ 0), mul_comm] + exact he + +theorem intertwining_adjoint_inner (S B D : E →L[ℂ] E) (hS : IsSelfAdjoint S) + (hSB : S * B = D * S) (x y : E) (a b : ℝ) (ha : a ≠ 0) + (hx : S x = (a : ℂ) • x) (hy : S y = (b : ℂ) • y) : + ⟪y, B.adjoint x⟫_ℂ = ((b / a : ℝ) : ℂ) * ⟪y, D.adjoint x⟫_ℂ := by + have he := congrArg (starRingEnd ℂ) (intertwining_inner S B D hS hSB y x b a ha hy hx) + simpa only [map_mul, inner_conj_symm, Complex.conj_ofReal, + ContinuousLinearMap.adjoint_inner_right] using he + +end Intertwining + +end Endpoint + +section OperatorIntegral + +variable {α V : Type*} [MeasurableSpace α] {μ : Measure α} + [NormedAddCommGroup V] [InnerProductSpace ℂ V] [CompleteSpace V] + +theorem integral_operator_adjoint (T : α → V →L[ℂ] V) : + (∫ t, T t ∂μ).adjoint = ∫ t, (T t).adjoint ∂μ := by + simpa only [starL'_apply, ContinuousLinearMap.star_eq_adjoint] using + ((starL' ℝ : (V →L[ℂ] V) ≃L[ℝ] (V →L[ℂ] V)).integral_comp_comm T).symm + +end OperatorIntegral + +namespace Boundary + +def boundaryStar {n : ℕ} (U : C(CircleSpace, Coeff n)) : C(CircleSpace, Coeff n) := + ⟨fun t => (U t)ᴴ, U.continuous.star⟩ + +@[simp] theorem boundaryStar_apply {n : ℕ} (U : C(CircleSpace, Coeff n)) (t : CircleSpace) : + boundaryStar U t = (U t)ᴴ := rfl + +@[simp] theorem boundaryField_star {n : ℕ} (U : C(CircleSpace, Coeff n)) : + boundaryField (boundaryStar U) = lpStar (boundaryField U) := by + apply Lp.ext + filter_upwards [boundaryField_apply_ae (boundaryStar U), + boundaryField_apply_ae U, lpStar_apply_ae (boundaryField U)] with t hs hu hl + rw [hs, hl, hu, ofHS_toHS] + rfl + +def tensorIntegral {n : ℕ} (E U : C(CircleSpace, Coeff n)) : + Operator (Amplification (EuclideanSpace ℂ (Fin n)) n) := + ∫ t, tensorOperator (matrixOperatorMap n (E t)) (U t) ∂circleMeasure + +@[simp] theorem tensorIntegral_star {n : ℕ} (E U : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).IsHermitian) : + tensorIntegral E (boundaryStar U) = (tensorIntegral E U).adjoint := by + rw [tensorIntegral, tensorIntegral, integral_operator_adjoint] + apply integral_congr_ae + exact Filter.Eventually.of_forall fun t => by + change tensorOperator (matrixOperatorMap n (E t)) (U t)ᴴ = + (tensorOperator (matrixOperatorMap n (E t)) (U t)).adjoint + calc + _ = tensorOperator (star (matrixOperatorMap n (E t))) (star (U t)) := by + congr 1 + simp only [matrixOperatorMap_apply, ← map_star, + Matrix.star_eq_conjTranspose, (hE t).eq] + _ = star (tensorOperator (matrixOperatorMap n (E t)) (U t)) := + tensorOperator_star _ _ + _ = _ := ContinuousLinearMap.star_eq_adjoint _ + +theorem real_inner_densityLp_field {n : ℕ} (E U : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).IsHermitian) (X Y : Coeff n) : + ⟪densityLp E X Y, boundaryField U⟫_ℝ = + (⟪vectorization Y, tensorIntegral E U (vectorization X)⟫_ℂ).re := by + rw [boundary_real_inner, densityLp_inner_boundaryField E U hE] + rfl + +theorem real_inner_densityLp_star_field {n : ℕ} (E U : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).IsHermitian) (X Y : Coeff n) : + ⟪densityLp E X Y, lpStar (boundaryField U)⟫_ℝ = + (⟪vectorization Y, (tensorIntegral E U).adjoint (vectorization X)⟫_ℂ).re := by + rw [← boundaryField_star, real_inner_densityLp_field E (boundaryStar U) hE, + tensorIntegral_star E U hE] + +theorem lpStar_inner_right {n : ℕ} (u v : BoundaryL2 n) : + ⟪u, lpStar v⟫_ℝ = ⟪lpStar u, v⟫_ℝ := by + have h := (lpStar (k := n) (μ := circleMeasure)).inner_map_map (lpStar u) v + simpa only [lpStar_lpStar] using h + +def reflectedBoundaryCauchy {n : ℕ} (M : BoundaryL2 n →L[ℝ] BoundaryL2 n) : + BoundaryL2 n →L[ℝ] BoundaryL2 n := + lpStar.toContinuousLinearEquiv.toContinuousLinearMap.comp + ((boundaryCauchy M).comp lpStar.toContinuousLinearEquiv.toContinuousLinearMap) + +theorem reflectedBoundaryCauchy_pairing {n : ℕ} + (M : BoundaryL2 n →L[ℝ] BoundaryL2 n) (r u : BoundaryL2 n) : + ⟪r, reflectedBoundaryCauchy M u⟫_ℝ = + ⟪lpStar (boundaryCauchyAdjoint M (lpStar r)), u⟫_ℝ := by + change ⟪r, lpStar (boundaryCauchy M (lpStar u))⟫_ℝ = _ + rw [lpStar_inner_right, ← ContinuousLinearMap.adjoint_inner_left, + adjoint_boundaryCauchy, lpStar_inner_right] + +theorem projected_density_of_laurent_testing {n : ℕ} + (M : BoundaryL2 n →L[ℝ] BoundaryL2 n) + (E Λ : C(CircleSpace, Coeff n)) + (hE : ∀ t, (E t).IsHermitian) (hΛ : ∀ t, (Λ t).IsHermitian) + (S : Operator (Amplification (EuclideanSpace ℂ (Fin n)) n)) (hS : IsSelfAdjoint S) + (X Y : Coeff n) (a b : ℝ) (ha : a ≠ 0) (hb : b ≠ 0) + (hx : S (vectorization X) = (a : ℂ) • vectorization X) + (hy : S (vectorization Y) = (b : ℂ) • vectorization Y) + (htest : ∀ (j : ℤ × (Fin n × Fin n)) (c : ℂ), + ∃ (V W : C(CircleSpace, Coeff n)) + (B L : Operator (Amplification (EuclideanSpace ℂ (Fin n)) n)), + boundaryCauchy M (boundaryField (matrixLaurentMonomial j c)) = boundaryField V ∧ + boundaryCauchy M (lpStar (boundaryField (matrixLaurentMonomial j c))) = boundaryField W ∧ + tensorIntegral E (matrixLaurentMonomial j c) = B + L.adjoint ∧ + S * B = tensorIntegral Λ V * S ∧ S * L = tensorIntegral Λ W * S) : + densityLp E X Y = (a / b) • boundaryCauchyAdjoint M (densityLp Λ X Y) + + (b / a) • lpStar (boundaryCauchyAdjoint M (lpStar (densityLp Λ X Y))) := by + apply eq_of_inner_matrixLaurentMonomial + intro j c + obtain ⟨V, W, B, L, hV, hW, hR, hB, hL⟩ := htest j c + have hB' := Endpoint.intertwining_inner S B (tensorIntegral Λ V) hS hB + (vectorization X) (vectorization Y) a b hb hx hy + have hL' := Endpoint.intertwining_adjoint_inner S L (tensorIntegral Λ W) hS hL + (vectorization X) (vectorization Y) a b ha hx hy + rw [real_inner_densityLp_field E _ hE, hR, add_apply, inner_add_right, + hB', hL', Complex.add_re] + simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] + rw [← real_inner_densityLp_field Λ V hΛ, + ← real_inner_densityLp_star_field Λ W hΛ, ← hV, ← hW] + rw [← ContinuousLinearMap.adjoint_inner_left, adjoint_boundaryCauchy] + have hr := reflectedBoundaryCauchy_pairing M (densityLp Λ X Y) + (boundaryField (matrixLaurentMonomial j c)) + change ⟪densityLp Λ X Y, lpStar (boundaryCauchy M + (lpStar (boundaryField (matrixLaurentMonomial j c))))⟫_ℝ = _ at hr + rw [hr, inner_add_left, real_inner_smul_left, real_inner_smul_left] + +end Boundary + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/SteinMetric.lean b/lean/OAI/Analysis/Crouzeix/SteinMetric.lean new file mode 100644 index 0000000000000000000000000000000000000000..7830608e8884da2ae335174a9ed4c72b35b73ed6 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/SteinMetric.lean @@ -0,0 +1,302 @@ +import Mathlib + +namespace OAI + +/-! Stein Metric. -/ + +noncomputable section + +open Set Filter + +open scoped Topology NNReal ENNReal MatrixOrder Matrix.Norms.L2Operator + +namespace CrouzeixHilbert.Metric + +section StablePowers + +variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] [CompleteSpace A] + +theorem eventually_norm_pow_le (a : A) (ha : spectralRadius ℂ a < 1) + {r : ℝ} (hr : (spectralRadius ℂ a).toReal < r) : + ∀ᶠ n : ℕ in atTop, ‖a ^ n‖ ≤ r ^ n := by + have ht : spectralRadius ℂ a ≠ ∞ := ne_of_lt (ha.trans (by simp)) + have hl : Tendsto (fun n : ℕ => ‖a ^ n‖ ^ (1 / (n : ℝ))) atTop + (𝓝 (spectralRadius ℂ a).toReal) := by + simpa only [Function.comp_def, + ENNReal.toReal_ofReal (Real.rpow_nonneg (norm_nonneg _) _)] using + (ENNReal.tendsto_toReal ht).comp + (spectrum.pow_norm_pow_one_div_tendsto_nhds_spectralRadius a) + filter_upwards [hl.eventually (gt_mem_nhds hr), eventually_gt_atTop (0 : ℕ)] + with n hn hn0 + have h := pow_le_pow_left₀ (Real.rpow_nonneg (norm_nonneg (a ^ n)) _) hn.le n + simpa only [one_div, Real.rpow_inv_natCast_pow (norm_nonneg (a ^ n)) + (Nat.ne_of_gt hn0)] using h + +theorem summable_norm_pow (a : A) (ha : spectralRadius ℂ a < 1) : + Summable (fun n : ℕ => ‖a ^ n‖) := by + have ht : spectralRadius ℂ a ≠ ∞ := ne_of_lt (ha.trans (by simp)) + have hlt : (spectralRadius ℂ a).toReal < 1 := by + exact (ENNReal.toReal_lt_toReal ht (by simp)).mpr ha + obtain ⟨r, hr, hr1⟩ := exists_between hlt + have hr0 : 0 ≤ r := ENNReal.toReal_nonneg.trans hr.le + apply (summable_geometric_of_lt_one hr0 hr1).of_norm_bounded_eventually + simpa only [Real.norm_of_nonneg (norm_nonneg _), Nat.cofinite_eq_atTop] using + eventually_norm_pow_le a ha hr + +end StablePowers + +section Stein + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def steinSeries (T : A) : A := ∑' j : ℕ, star (T ^ j) * T ^ j + +omit [PartialOrder A] [StarOrderedRing A] in +theorem summable_steinSeries (T : A) (hT : spectralRadius ℂ T < 1) : + Summable (fun j : ℕ => star (T ^ j) * T ^ j) := by + have hs := summable_norm_pow T hT + have hsmall : ∀ᶠ j in atTop, ‖T ^ j‖ ≤ 1 := by + exact (hs.tendsto_atTop_zero.eventually (gt_mem_nhds (by norm_num : (0 : ℝ) < 1))).mono + (fun j hj => hj.le) + apply hs.of_norm_bounded_eventually + rw [Nat.cofinite_eq_atTop] + filter_upwards [hsmall] with j hj + calc + ‖star (T ^ j) * T ^ j‖ ≤ ‖star (T ^ j)‖ * ‖T ^ j‖ := norm_mul_le _ _ + _ = ‖T ^ j‖ * ‖T ^ j‖ := by rw [norm_star] + _ ≤ ‖T ^ j‖ * 1 := mul_le_mul_of_nonneg_left hj (norm_nonneg _) + _ = ‖T ^ j‖ := mul_one _ + +theorem steinSeries_nonneg (T : A) : 0 ≤ steinSeries T := + tsum_nonneg (fun _ => star_mul_self_nonneg _) + +omit [PartialOrder A] [StarOrderedRing A] in +theorem steinSeries_eq_one_add (T : A) (hT : spectralRadius ℂ T < 1) : + steinSeries T = 1 + star T * steinSeries T * T := by + have hs := summable_steinSeries T hT + have he : (fun j : ℕ => star (T ^ (j + 1)) * T ^ (j + 1)) = + (fun j : ℕ => star T * (star (T ^ j) * T ^ j) * T) := by + funext j + rw [pow_succ, star_mul] + simp only [mul_assoc] + have hz := hs.sum_add_tsum_nat_add 1 + simp only [Finset.sum_range_one, pow_zero, star_one, mul_one] at hz + rw [he, (hs.mul_left (star T)).tsum_mul_right T, hs.tsum_mul_left (star T)] at hz + exact hz.symm + +theorem one_le_steinSeries (T : A) (hT : spectralRadius ℂ T < 1) : + 1 ≤ steinSeries T := by + rw [steinSeries_eq_one_add T hT] + exact le_add_of_nonneg_right (star_left_conjugate_nonneg (steinSeries_nonneg T) T) + +omit [PartialOrder A] [StarOrderedRing A] in +theorem steinSeries_sub (T : A) (hT : spectralRadius ℂ T < 1) : + steinSeries T - star T * steinSeries T * T = 1 := by + nth_rw 1 [steinSeries_eq_one_add T hT] + exact add_sub_cancel_right _ _ + +theorem exists_strict_stein_metric (T : A) (hT : spectralRadius ℂ T < 1) : + ∃ (τ : ℝ) (H : A), IsStrictlyPositive (H - 1) ∧ + IsStrictlyPositive (algebraMap ℝ A τ - H) ∧ + IsStrictlyPositive (H - star T * H * T) := by + let H := steinSeries T + steinSeries T + have h0 := one_le_steinSeries T hT + have h1 : (1 : A) ≤ H - 1 := by + exact le_sub_iff_add_le.mpr (add_le_add h0 h0) + have hH : 0 ≤ H := add_nonneg (steinSeries_nonneg T) (steinSeries_nonneg T) + have hu : H ≤ algebraMap ℝ A ‖H‖ := + (CStarAlgebra.norm_le_iff_le_algebraMap H (norm_nonneg _) hH).mp le_rfl + have hupper : (1 : A) ≤ algebraMap ℝ A (‖H‖ + 1) - H := by + rw [map_add, map_one] + exact le_sub_iff_add_le.mpr (by simpa only [add_comm] using add_le_add_right hu 1) + have hslack : H - star T * H * T = (1 : A) + 1 := by + dsimp only [H] + rw [mul_add, add_mul, add_sub_add_comm, steinSeries_sub T hT] + refine ⟨‖H‖ + 1, H, isStrictlyPositive_one.of_le h1, + isStrictlyPositive_one.of_le hupper, ?_⟩ + rw [hslack] + exact isStrictlyPositive_one.add_nonneg zero_le_one + +end Stein + +section Minimization + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +structure Feasible (T : A) (τ : ℝ) (H : A) : Prop where + lower : 1 ≤ H + upper : H ≤ algebraMap ℝ A τ + stein : star T * H * T ≤ H + +theorem Feasible.nonneg {T H : A} {τ : ℝ} (h : Feasible T τ H) : 0 ≤ H := + zero_le_one.trans h.lower + +theorem Feasible.selfAdjoint {T H : A} {τ : ℝ} (h : Feasible T τ H) : + IsSelfAdjoint H := .of_nonneg h.nonneg + +theorem Feasible.isStrictlyPositive {T H : A} {τ : ℝ} (h : Feasible T τ H) : + IsStrictlyPositive H := isStrictlyPositive_one.of_le h.lower + +variable [Nontrivial A] + +theorem Feasible.one_le {T H : A} {τ : ℝ} (h : Feasible T τ H) : 1 ≤ τ := by + have he : algebraMap ℝ A 1 ≤ algebraMap ℝ A τ := by simpa using h.lower.trans h.upper + exact algebraMap_le_algebraMap.mp he + +theorem Feasible.norm_le {T H : A} {τ : ℝ} (h : Feasible T τ H) : ‖H‖ ≤ τ := + (CStarAlgebra.norm_le_iff_le_algebraMap H (zero_le_one.trans h.one_le) h.nonneg).mpr h.upper + +omit [Nontrivial A] in +theorem steinSeries_feasible (T : A) (hT : spectralRadius ℂ T < 1) : + Feasible T ‖steinSeries T‖ (steinSeries T) := by + refine ⟨one_le_steinSeries T hT, ?_, ?_⟩ + · exact (CStarAlgebra.norm_le_iff_le_algebraMap _ (norm_nonneg _) + (steinSeries_nonneg T)).mp le_rfl + · exact sub_nonneg.mp (by rw [steinSeries_sub T hT]; exact zero_le_one) + +theorem exists_minimizing_metric [FiniteDimensional ℂ A] + (T : A) (hT : spectralRadius ℂ T < 1) : + ∃ (τ : ℝ) (H : A), Feasible T τ H ∧ 1 ≤ τ ∧ + ∀ (τ' : ℝ) (H' : A), Feasible T τ' H' → τ ≤ τ' := by + let : ProperSpace A := FiniteDimensional.proper ℂ A + let H₀ := steinSeries T + have h₀ := steinSeries_feasible T hT + let M : Set A := {H | 1 ≤ H ∧ star T * H * T ≤ H} + have hMc : IsClosed M := (isClosed_le continuous_const continuous_id).inter + (isClosed_le ((continuous_const.mul continuous_id).mul continuous_const) continuous_id) + let K := Metric.closedBall (0 : A) ‖H₀‖ ∩ M + have hKc : IsCompact K := (isCompact_closedBall (0 : A) ‖H₀‖).inter_right hMc + have hKne : K.Nonempty := by + refine ⟨H₀, ?_⟩ + simp only [K, mem_inter_iff, Metric.mem_closedBall, dist_zero_right] + exact ⟨le_rfl, h₀.lower, h₀.stein⟩ + obtain ⟨H, hHK, hmin⟩ := hKc.exists_isMinOn hKne continuous_norm.continuousOn + have hH0 : 0 ≤ H := zero_le_one.trans hHK.2.1 + refine ⟨‖H‖, H, ⟨hHK.2.1, ?_, hHK.2.2⟩, ?_, ?_⟩ + · exact (CStarAlgebra.norm_le_iff_le_algebraMap H (norm_nonneg H) hH0).mp le_rfl + · have h : ‖(1 : A)‖ ≤ ‖H‖ := + CStarAlgebra.norm_le_norm_of_le_of_nonneg hHK.2.1 zero_le_one + simpa only [norm_one] using h + · intro τ' H' hH' + by_cases hb : ‖H'‖ ≤ ‖H₀‖ + · have h'K : H' ∈ K := ⟨by simpa using hb, hH'.lower, hH'.stein⟩ + exact (hmin h'K).trans hH'.norm_le + · have hbound : ‖H‖ ≤ ‖H₀‖ := by simpa using hHK.1 + exact (hbound.trans (le_of_not_ge hb)).trans hH'.norm_le + +end Minimization + +section Similarity + +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +theorem norm_le_one_iff_star_mul_self_le (a : A) : + ‖a‖ ≤ 1 ↔ star a * a ≤ 1 := by + rw [← CStarAlgebra.norm_le_one_iff_of_nonneg (star a * a) + (star_mul_self_nonneg a), CStarRing.norm_star_mul_self] + constructor <;> intro h <;> nlinarith [norm_nonneg a] + +variable [Nontrivial A] + +theorem Feasible.sqrt_similarity {T H : A} {τ : ℝ} (h : Feasible T τ H) : + IsUnit (CFC.sqrt H) ∧ + ‖CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)‖ ≤ 1 ∧ + ‖CFC.sqrt H‖ * ‖Ring.inverse (CFC.sqrt H)‖ ≤ Real.sqrt τ := by + let S := CFC.sqrt H + let R := Ring.inverse S + have hS0 : 0 ≤ S := CFC.sqrt_nonneg H + have hS1 : (1 : A) ≤ S := by + simpa only [CFC.sqrt_one] using CFC.sqrt_le_sqrt (1 : A) H h.lower + have hSpos : IsStrictlyPositive S := isStrictlyPositive_one.of_le hS1 + have hu : IsUnit S := hSpos.isUnit + have hR0 : 0 ≤ R := (CFC.ringInverse_nonneg_iff_nonneg_of_isUnit hu).mpr hS0 + have hR1 : R ≤ (1 : A) := by + simpa only [Ring.inverse_one] using CStarAlgebra.ringInverse_le_ringInverse hS1 + have hRS : R * S = 1 := Ring.inverse_mul_cancel S hu + have hSR : S * R = 1 := Ring.mul_inverse_cancel S hu + have hRSa : star R = R := (IsSelfAdjoint.of_nonneg hR0).star_eq + have hSSa : star S = S := (IsSelfAdjoint.of_nonneg hS0).star_eq + have hSS : S * S = H := CFC.sqrt_mul_sqrt_self H h.nonneg + have hconj := star_left_conjugate_le_conjugate h.stein R + have hright : star R * H * R = 1 := by + rw [hRSa, ← hSS, ← mul_assoc, hRS, one_mul, hSR] + have hleft : star R * (star T * H * T) * R = + star (S * T * R) * (S * T * R) := by + rw [star_mul, star_mul, hSSa, ← hSS] + noncomm_ring + rw [hleft, hright] at hconj + refine ⟨hu, (norm_le_one_iff_star_mul_self_le _).mpr hconj, ?_⟩ + have hRn : ‖R‖ ≤ 1 := (CStarAlgebra.norm_le_one_iff_of_nonneg R hR0).mpr hR1 + change ‖S‖ * ‖R‖ ≤ Real.sqrt τ + calc + ‖S‖ * ‖R‖ ≤ ‖S‖ * 1 := mul_le_mul_of_nonneg_left hRn (norm_nonneg _) + _ = Real.sqrt ‖H‖ := by simpa only [S, mul_one] using CFC.norm_sqrt H h.nonneg + _ ≤ Real.sqrt τ := Real.sqrt_le_sqrt h.norm_le + +theorem Feasible.sqrt_spectrum {T H : A} {τ : ℝ} (h : Feasible T τ H) : + spectrum ℂ (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)) = spectrum ℂ T := by + obtain ⟨u, hu⟩ := h.sqrt_similarity.1 + rw [← hu] + simpa only [Ring.inverse_unit] using spectrum.units_conjugate (R := ℂ) (a := T) (u := u) + +omit [Nontrivial A] in +theorem feasible_of_contractive_similarity (R T : A) (hu : IsUnit R) + (hc : ‖R * T * Ring.inverse R‖ ≤ 1) : + Feasible T ((‖R‖ * ‖Ring.inverse R‖) ^ 2) + ((‖Ring.inverse R‖ ^ 2) • (star R * R)) := by + let Q := Ring.inverse R + let D := R * T * Q + have hRQ : R * Q = 1 := Ring.mul_inverse_cancel R hu + have hQR : Q * R = 1 := Ring.inverse_mul_cancel R hu + have hRn : star R * R ≤ algebraMap ℝ A (‖R‖ ^ 2) := by + apply (CStarAlgebra.norm_le_iff_le_algebraMap _ (sq_nonneg _) (star_mul_self_nonneg R)).mp + rw [CStarRing.norm_star_mul_self, sq] + have hQn : star Q * Q ≤ algebraMap ℝ A (‖Q‖ ^ 2) := by + apply (CStarAlgebra.norm_le_iff_le_algebraMap _ (sq_nonneg _) (star_mul_self_nonneg Q)).mp + rw [CStarRing.norm_star_mul_self, sq] + have hl := star_left_conjugate_le_conjugate hQn R + have hll : star R * (star Q * Q) * R = 1 := by + rw [← mul_assoc, ← star_mul, hQR, star_one, one_mul, hQR] + have hlr : star R * algebraMap ℝ A (‖Q‖ ^ 2) * R = (‖Q‖ ^ 2) • (star R * R) := by + simp only [Algebra.algebraMap_eq_smul_one, mul_smul_comm, smul_mul_assoc, mul_one] + rw [hll, hlr] at hl + have hd := (norm_le_one_iff_star_mul_self_le D).mp hc + have hs := star_left_conjugate_le_conjugate hd R + have hsl : star R * (star D * D) * R = star T * (star R * R) * T := by + have he : D * R = R * T := by simp only [D, mul_assoc, hQR, mul_one] + calc + star R * (star D * D) * R = star (D * R) * (D * R) := by + simp only [star_mul, mul_assoc] + _ = star T * (star R * R) * T := by rw [he, star_mul]; simp only [mul_assoc] + rw [hsl, mul_one] at hs + refine ⟨hl, ?_, ?_⟩ + · have h := smul_le_smul_of_nonneg_left hRn (sq_nonneg ‖Q‖) + convert h using 1 + simp only [Algebra.algebraMap_eq_smul_one, smul_smul] + congr 1 + dsimp only [Q] + ring + · simpa only [mul_smul_comm, smul_mul_assoc] using + smul_le_smul_of_nonneg_left hs (sq_nonneg ‖Q‖) + +theorem optimal_similarity {T H : A} {τ : ℝ} (h : Feasible T τ H) + (hmin : ∀ (τ' : ℝ) (H' : A), Feasible T τ' H' → τ ≤ τ') : + ‖CFC.sqrt H‖ * ‖Ring.inverse (CFC.sqrt H)‖ = Real.sqrt τ ∧ + ∀ R : A, IsUnit R → ‖R * T * Ring.inverse R‖ ≤ 1 → + Real.sqrt τ ≤ ‖R‖ * ‖Ring.inverse R‖ := by + have hbest : ∀ R : A, IsUnit R → ‖R * T * Ring.inverse R‖ ≤ 1 → + Real.sqrt τ ≤ ‖R‖ * ‖Ring.inverse R‖ := by + intro R hu hc + have hτ := hmin _ _ (feasible_of_contractive_similarity R T hu hc) + have hn : 0 ≤ ‖R‖ * ‖Ring.inverse R‖ := mul_nonneg (norm_nonneg _) (norm_nonneg _) + simpa only [Real.sqrt_sq hn] using Real.sqrt_le_sqrt hτ + exact ⟨le_antisymm h.sqrt_similarity.2.2 + (hbest _ h.sqrt_similarity.1 h.sqrt_similarity.2.1), hbest⟩ + +end Similarity + +end CrouzeixHilbert.Metric + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/TensorDensity.lean b/lean/OAI/Analysis/Crouzeix/TensorDensity.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e5a0f597fa51ae877a3d043335055ef387c33e7 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/TensorDensity.lean @@ -0,0 +1,240 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Compression +import OAI.Analysis.Crouzeix.DiskCalculus +import OAI.Analysis.Crouzeix.MatrixContours + +namespace OAI + +/-! Tensor Density. -/ + +noncomputable section + +open MeasureTheory Set Filter + +open scoped Topology InnerProductSpace TensorProduct Matrix.Norms.L2Operator + +namespace CrouzeixHilbert + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +local instance tensorDensityOperatorRealNormedSpace (size : ℕ) : + NormedSpace ℝ (Operator (Amplification H size)) := + NormedSpace.restrictScalars ℝ ℂ _ + +local instance tensorDensityOperatorCompleteSpace (size : ℕ) : + CompleteSpace (Operator (Amplification H size)) := by + let : ContinuousSMul ℂ (Amplification H size) := IsBoundedSMul.continuousSMul + exact ContinuousLinearMap.instCompleteSpace + +@[simp] theorem tensorOperator_one (m : ℕ) : + tensorOperator (1 : Operator H) (1 : Coeff m) = 1 := by + ext x + refine UniformSpace.Completion.induction_on x + (isClosed_eq (tensorOperator 1 (1 : Coeff m)).continuous continuous_id) ?_ + intro v + simp only [tensorOperator, ContinuousLinearMap.completion_apply_coe, map_one] + congr 1 + change TensorProduct.mapL (ContinuousLinearMap.id ℂ H) + (ContinuousLinearMap.id ℂ (EuclideanSpace ℂ (Fin m))) v = v + simp + +theorem tensorOperator_mul (A D : Operator H) {m : ℕ} (B C : Coeff m) : + tensorOperator (A * D) (B * C) = tensorOperator A B * tensorOperator D C := by + ext x + refine UniformSpace.Completion.induction_on x + (isClosed_eq (tensorOperator (A * D) (B * C)).continuous + ((tensorOperator A B).continuous.comp (tensorOperator D C).continuous)) ?_ + intro v + simp only [tensorOperator, map_mul, mul_apply_eq_comp, + ContinuousLinearMap.completion_apply_coe, TensorProduct.mapL_mul] + +variable [CompleteSpace H] + +theorem tensorOperator_star (A : Operator H) {m : ℕ} (B : Coeff m) : + tensorOperator (star A) (star B) = star (tensorOperator A B) := by + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro x y + refine UniformSpace.Completion.induction_on x + (isClosed_eq ((tensorOperator (star A) (star B)).continuous.inner continuous_const) + (continuous_id.inner continuous_const)) ?_ + intro a + refine UniformSpace.Completion.induction_on y + (isClosed_eq (continuous_const.inner continuous_id) + (continuous_const.inner (tensorOperator A B).continuous)) ?_ + intro b + simp only [tensorOperator, ContinuousLinearMap.completion_apply_coe, + UniformSpace.Completion.inner_coe, map_star] + induction a using TensorProduct.inductionOn with + | tmul x u => + induction b using TensorProduct.inductionOn with + | tmul y v => simp [ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_left] + | add b c hb hc => simp only [inner_add_right, map_add, hb, hc] + | add a c ha hc => simp only [inner_add_left, map_add, ha, hc] + +section PositiveDensity + +variable {α : Type*} [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] + [CompactSpace α] [SecondCountableTopology α] {μ : Measure α} [IsFiniteMeasure μ] + +def amplifiedRoot (Λ : C(α, Operator H)) (hΛ : ∀ t, 0 ≤ Λ t) (m : ℕ) : + C(α, Operator (Amplification H m)) := + ⟨fun t => tensorOperator (Compression.densityRoot Λ hΛ t) (1 : Coeff m), + (tensorOperatorCLM (1 : Coeff m)).continuous.comp + (Compression.densityRoot Λ hΛ).continuous⟩ + +def coefficientField {m : ℕ} (F : C(α, Coeff m)) : + C(α, Operator (Amplification H m)) := + ⟨fun t => tensorOperator (1 : Operator H) (F t), + (tensorCoefficientCLM (1 : Operator H) m).continuous.comp F.continuous⟩ + +omit [MeasurableSpace α] [BorelSpace α] [CompactSpace α] [SecondCountableTopology α] in +theorem amplifiedRoot_star_mul (Λ : C(α, Operator H)) (hΛ : ∀ t, 0 ≤ Λ t) + (m : ℕ) (t : α) : + star (amplifiedRoot Λ hΛ m t) * amplifiedRoot Λ hΛ m t = tensorOperator (Λ t) (1 : Coeff m) := by + change star (tensorOperator _ _) * tensorOperator _ _ = _ + rw [← tensorOperator_star, ← tensorOperator_mul, star_one, one_mul, + Compression.densityRoot_star_mul] + +omit [SecondCountableTopology α] in +theorem amplifiedRoot_mass (Λ : C(α, Operator H)) (hΛ : ∀ t, 0 ≤ Λ t) + (hmass : ∫ t, Λ t ∂μ = 1) (m : ℕ) : + ∫ t, star (amplifiedRoot Λ hΛ m t) * amplifiedRoot Λ hΛ m t ∂μ = 1 := by + simp only [amplifiedRoot_star_mul, ← tensorOperatorCLM_apply] + rw [(tensorOperatorCLM (H := H) (1 : Coeff m)).integral_comp_comm, + hmass, tensorOperatorCLM_apply, tensorOperator_one] + exact Λ.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _) + +omit [MeasurableSpace α] [BorelSpace α] [CompactSpace α] [SecondCountableTopology α] in +theorem amplifiedRoot_sandwich (Λ : C(α, Operator H)) (hΛ : ∀ t, 0 ≤ Λ t) + {m : ℕ} (F : C(α, Coeff m)) (t : α) : + star (amplifiedRoot Λ hΛ m t) * coefficientField (H := H) F t * + amplifiedRoot Λ hΛ m t = tensorOperator (Λ t) (F t) := by + change star (tensorOperator _ _) * tensorOperator _ _ * tensorOperator _ _ = _ + rw [← tensorOperator_star, ← tensorOperator_mul, ← tensorOperator_mul, + star_one, one_mul, mul_one, mul_one, Compression.densityRoot_star_mul] + +theorem norm_integral_tensor_density_le (Λ : C(α, Operator H)) (hΛ : ∀ t, 0 ≤ Λ t) + (hmass : ∫ t, Λ t ∂μ = 1) {m : ℕ} (F : C(α, Coeff m)) + (C : ℝ) (hC : 0 ≤ C) (hF : ∀ t, ‖F t‖ ≤ C) : + ‖∫ t, tensorOperator (Λ t) (F t) ∂μ‖ ≤ C := by + simp_rw [← amplifiedRoot_sandwich Λ hΛ F] + apply Compression.norm_integral_le _ _ (amplifiedRoot_mass Λ hΛ hmass m) C hC + intro t + change ‖tensorOperator (1 : Operator H) (F t)‖ ≤ C + calc + ‖tensorOperator (1 : Operator H) (F t)‖ ≤ ‖(1 : Operator H)‖ * ‖F t‖ := norm_tensorOperator_le _ _ + _ ≤ 1 * ‖F t‖ := mul_le_mul_of_nonneg_right ContinuousLinearMap.norm_id_le (norm_nonneg _) + _ ≤ C := by simpa only [one_mul] using hF t + +end PositiveDensity + +end CrouzeixHilbert + +namespace CrouzeixHilbert.Disk + +attribute [local instance] tensorDensityOperatorRealNormedSpace +attribute [local instance] tensorDensityOperatorCompleteSpace + +local instance : Fact (0 < (1 : ℝ)) := ⟨by norm_num⟩ + +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem integral_matrixPolynomial (D : Operator H) (hD : spectralRadius ℂ D < 1) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + (∫ t : CircleSpace, tensorOperator (phi D t) + (matrixPolynomial B (fourier 1 t)) ∂σ) = polynomialEval D B := by + have he (t : CircleSpace) : tensorOperator (phi D t) + (matrixPolynomial B (fourier 1 t)) = + ∑ k : Fin (d + 1), tensorOperator (fourier (k : ℤ) t • phi D t) (B k) := by + change tensorCoefficientCLM (phi D t) m (∑ k : Fin (d + 1), (fourier 1 t) ^ (k : ℕ) • B k) = _ + simp only [map_sum, map_smul, tensorCoefficientCLM_apply, ← tensorOperatorCLM_apply, + map_smul, fourier_one_pow] + simp_rw [he] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro k _ + change (∫ t : CircleSpace, tensorOperatorCLM (B k) + (fourier (k : ℤ) t • phi D t) ∂σ) = tensorOperator (D ^ (k : ℕ)) (B k) + rw [(tensorOperatorCLM (H := H) (B k)).integral_comp_comm, + integral_moment D hD] + · rfl + · exact ((fourier _).continuous.smul (continuous_phi D hD)).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + · intro k _ + exact ((tensorOperatorCLM (H := H) (B k)).continuous.comp + ((fourier _).continuous.smul (continuous_phi D hD))).integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _) + +theorem polynomial_bound_spectralRadius_lt_one (D : Operator H) (hN : ‖D‖ ≤ 1) + (hD : spectralRadius ℂ D < 1) {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval D B‖ ≤ supNorm (Metric.sphere (0 : ℂ) 1) (matrixPolynomial B) := by + let Λ : C(CircleSpace, Operator H) := ⟨phi D, continuous_phi D hD⟩ + have hΛ : ∀ t, 0 ≤ Λ t := fun t => + ContinuousLinearMap.nonneg_iff_isPositive.mpr (phi_isPositive D hN hD t) + let F : C(CircleSpace, Coeff m) := + ⟨fun t => matrixPolynomial B (fourier 1 t), (continuous_matrixPolynomial B).comp + (fourier 1).continuous⟩ + have hb := supNorm_bddAbove (isCompact_sphere (0 : ℂ) 1) + (continuous_matrixPolynomial B).continuousOn + rw [← integral_matrixPolynomial D hD B] + exact norm_integral_tensor_density_le Λ hΛ (integral_phi D hD) F _ + (supNorm_nonneg hb) (fun t => norm_le_supNorm hb (by + simpa only [Metric.mem_sphere, dist_zero_right] using norm_fourier 1 t)) + +theorem continuous_polynomialEval {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + Continuous (fun D : Operator H => polynomialEval D B) := by + apply continuous_finsetSum + intro k _ + exact (tensorOperatorCLM (B k)).continuous.comp (continuous_id.pow (k : ℕ)) + +theorem radial_tendsto_polynomialEval (D : Operator H) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + Tendsto (fun r : ℝ => ‖polynomialEval ((r : ℂ) • D) B‖) + (𝓝[<] (1 : ℝ)) (𝓝 ‖polynomialEval D B‖) := by + have hr : Tendsto (fun r : ℝ => (r : ℂ) • D) (𝓝[<] (1 : ℝ)) (𝓝 D) := by + have hc : Continuous (fun r : ℝ => (r : ℂ) • D) := + Complex.continuous_ofReal.smul continuous_const + have ht := hc.tendsto (1 : ℝ) + rw [Complex.ofReal_one, one_smul] at ht + exact ht.mono_left nhdsWithin_le_nhds + exact ((continuous_polynomialEval (H := H) B).norm.tendsto D).comp hr + +lemma spectralRadius_lt_one_of_norm_lt_one [Nontrivial H] + (D : Operator H) (h : ‖D‖ < 1) : spectralRadius ℂ D < 1 := by + apply (spectralRadius_le_nnnorm D).trans_lt + exact_mod_cast h + +theorem polynomial_bound_nontrivial [Nontrivial H] (D : Operator H) (hN : ‖D‖ ≤ 1) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval D B‖ ≤ supNorm (Metric.sphere (0 : ℂ) 1) (matrixPolynomial B) := by + apply le_of_tendsto (radial_tendsto_polynomialEval D B) + have hp : ∀ᶠ r : ℝ in 𝓝[<] (1 : ℝ), 0 < r := + (eventually_gt_nhds (by norm_num : (0 : ℝ) < 1)).filter_mono nhdsWithin_le_nhds + filter_upwards [hp, self_mem_nhdsWithin] with r hr0 hr1 + have hn : ‖(r : ℂ) • D‖ < 1 := by + rw [norm_smul, Complex.norm_real, Real.norm_of_nonneg hr0.le] + exact (mul_le_mul_of_nonneg_left hN hr0.le).trans_lt (by simpa using hr1) + exact polynomial_bound_spectralRadius_lt_one _ hn.le + (spectralRadius_lt_one_of_norm_lt_one _ hn) B + +theorem polynomial_bound (D : Operator H) (hN : ‖D‖ ≤ 1) + {m d : ℕ} (B : Fin (d + 1) → Coeff m) : + ‖polynomialEval D B‖ ≤ supNorm (Metric.sphere (0 : ℂ) 1) (matrixPolynomial B) := by + rcases subsingleton_or_nontrivial H with h | h + · have hb := supNorm_bddAbove (isCompact_sphere (0 : ℂ) 1) + (continuous_matrixPolynomial B).continuousOn + have he : polynomialEval D B = 0 := Subsingleton.elim _ _ + rw [he, norm_zero] + exact supNorm_nonneg hb + · exact polynomial_bound_nontrivial D hN B + +end CrouzeixHilbert.Disk + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Univalent.lean b/lean/OAI/Analysis/Crouzeix/Univalent.lean new file mode 100644 index 0000000000000000000000000000000000000000..f930e6f34f39268ae6d85aaf5cadb1a5e86f9b01 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Univalent.lean @@ -0,0 +1,131 @@ +import Mathlib +import OAI.Analysis.Crouzeix.HomologicalCauchy +import OAI.Analysis.Crouzeix.Riemann + +namespace OAI + +/-! Univalent. -/ + +noncomputable section + +open Set Filter Metric Topology Function + +namespace CrouzeixHilbert.Conformal + +theorem deriv_ne_zero_of_injOn {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hi : InjOn f U) {a : ℂ} (ha : a ∈ U) : + deriv f a ≠ 0 := by + obtain ⟨R, hR, hsub⟩ := Metric.isOpen_iff.mp hU a ha + let r := R / 3 + have hr : 0 < r := by dsimp [r]; positivity + have hrR : 2 * r < R := by dsimp [r]; linarith + have hK : closedBall a (2 * r) ⊆ U := (closedBall_subset_ball hrR).trans hsub + have hball : ball a r ⊆ U := (ball_subset_closedBall.trans (closedBall_subset_closedBall (by linarith))).trans hK + let δ : ℕ → ℝ := fun n => r / (n + 1) + have hδ : ∀ n, 0 < δ n := fun n => div_pos hr (by positivity) + have hδle : ∀ n, δ n ≤ r := fun n => div_le_self hr.le (by have := Nat.cast_nonneg (α := ℝ) n; linarith) + have hδ0 : Tendsto δ atTop (𝓝 0) := by + simpa only [mul_one_div, mul_zero] using + (tendsto_const_nhds.mul (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) : + Tendsto (fun n : ℕ => r * (1 / ((n : ℝ) + 1))) atTop (𝓝 (r * 0))) + have hshift : ∀ n z, z ∈ ball a r → z + (δ n : ℂ) ∈ closedBall a (2 * r) := by + intro n z hz + have hd : dist (z + (δ n : ℂ)) a ≤ dist z a + δ n := by + calc + _ = ‖z - a + (δ n : ℂ)‖ := by rw [dist_eq_norm]; congr 1; ring + _ ≤ ‖z - a‖ + ‖(δ n : ℂ)‖ := norm_add_le _ _ + _ = dist z a + δ n := by rw [← dist_eq_norm, Complex.norm_real, Real.norm_of_nonneg (hδ n).le] + exact hd.trans (by have := hδle n; have := mem_ball.mp hz; linarith) + have hzK : ∀ z ∈ ball a r, z ∈ closedBall a (2 * r) := fun z hz => + (mem_closedBall.mpr <| (mem_ball.mp hz).le.trans (by linarith)) + let F : ℕ → ℂ → ℂ := fun n z => (f (z + (δ n : ℂ)) - f z) / (δ n : ℂ) + have hFd : ∀ n, DifferentiableOn ℂ (F n) (ball a r) := by + intro n z hz + have hd₁ : DifferentiableAt ℂ (fun v => f (v + (δ n : ℂ))) z := + ((hf _ (hK (hshift n z hz))).differentiableAt + (hU.mem_nhds (hK (hshift n z hz)))).comp z (differentiableAt_id.add_const _) + have hd₂ := (hf z (hball hz)).differentiableAt (hU.mem_nhds (hball hz)) + exact ((hd₁.sub hd₂).div_const _).differentiableWithinAt + have hFn : ∀ n z, z ∈ ball a r → F n z ≠ 0 := by + intro n z hz he + have hen : f (z + (δ n : ℂ)) = f z := sub_eq_zero.mp + ((div_eq_zero_iff).mp he |>.resolve_right (by exact_mod_cast (hδ n).ne')) + have hinj := hi (hK (hshift n z hz)) (hball hz) hen + have hzero : (δ n : ℂ) = 0 := add_left_cancel (hinj.trans (add_zero z).symm) + exact (hδ n).ne' (Complex.ofReal_eq_zero.mp hzero) + have hFeq : ∀ n z, F n z = dslope f z (z + (δ n : ℂ)) := by + intro n z + have hn : z + (δ n : ℂ) ≠ z := by + simpa using (show (δ n : ℂ) ≠ 0 by exact_mod_cast (hδ n).ne') + rw [dslope_of_ne f hn] + simp only [slope, add_sub_cancel_left, smul_eq_mul, div_eq_mul_inv, vsub_eq_sub, F] + ring + have huc := ((isCompact_closedBall a (2 * r)).prod (isCompact_closedBall a (2 * r))) + |>.uniformContinuousOn_of_continuous + ((continuousOn_dslope_pair hU hf).mono (prod_mono hK hK)) + have hlim : TendstoUniformlyOn F (deriv f) atTop (ball a r) := by + rw [Metric.tendstoUniformlyOn_iff] + intro ε hε + obtain ⟨η, hη, hmod⟩ := Metric.uniformContinuousOn_iff.mp huc ε hε + filter_upwards [hδ0.eventually (gt_mem_nhds hη)] with n hn + intro z hz + have hp : dist (z, z) (z, z + (δ n : ℂ)) < η := by + rw [dist_prod_same_left, dist_self_add_right, Complex.norm_real, Real.norm_of_nonneg (hδ n).le] + exact hn + simpa only [dslope_same, ← hFeq] using + hmod (z,z) ⟨hzK z hz, hzK z hz⟩ (z, z + (δ n : ℂ)) ⟨hzK z hz, hshift n z hz⟩ hp + rcases zero_or_ne_of_tendstoLocallyUniformlyOn isOpen_ball (convex_ball a r).isPreconnected + hlim.tendstoLocallyUniformlyOn hFd hFn with he | hn + · have hc : ∀ z ∈ ball a r, fderivWithin ℂ f (ball a r) z = 0 := by + intro z hz + rw [fderivWithin_eq_fderiv (isOpen_ball.uniqueDiffWithinAt hz) + ((hf z (hball hz)).differentiableAt (hU.mem_nhds (hball hz)))] + apply ContinuousLinearMap.ext + intro v + simp only [fderiv_eq_smul_deriv, he hz, Pi.zero_apply, smul_zero, + zero_apply] + have hb : a + (r / 2 : ℝ) ∈ ball a r := by + rw [mem_ball, dist_eq_norm, add_sub_cancel_left, Complex.norm_real, Real.norm_of_nonneg (by positivity)] + linarith + have heq := (convex_ball a r).is_const_of_fderivWithin_eq_zero (hf.mono hball) hc + (mem_ball_self hr) hb + have hbad := hi ha (hball hb) heq + have hz : ((r / 2 : ℝ) : ℂ) = 0 := by linear_combination -hbad + have : r / 2 = 0 := Complex.ofReal_eq_zero.mp hz + linarith + · exact hn a (mem_ball_self hr) + +theorem hasStrictDerivAt_invFunOn {U V : Set ℂ} (hU : IsOpen U) {f : ℂ → ℂ} + (hf : DifferentiableOn ℂ f U) (hbij : BijOn f U V) {w : ℂ} (hw : w ∈ V) : + HasStrictDerivAt (invFunOn f U) (deriv f (invFunOn f U w))⁻¹ w := by + obtain ⟨z, hz, rfl⟩ := hbij.surjOn hw + have hinv := hbij.invOn_invFunOn + have he : ∀ᶠ v in 𝓝 z, invFunOn f U (f v) = v := by + filter_upwards [hU.mem_nhds hz] with v hv + exact hinv.1 hv + rw [hinv.1 hz] + exact ((hf.analyticOnNhd hU z hz).hasStrictDerivAt).to_local_left_inverse + (deriv_ne_zero_of_injOn hU hf hbij.injOn hz) he + +theorem riemann_biholomorphic_bounded {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) (hc : IsSimplyConnected U) {a : ℂ} (ha : a ∈ U) : + ∃ f g : ℂ → ℂ, + DifferentiableOn ℂ f U ∧ DifferentiableOn ℂ g (ball 0 1) ∧ + BijOn f U (ball 0 1) ∧ BijOn g (ball 0 1) U ∧ + InvOn g f U (ball 0 1) ∧ f a = 0 ∧ + (∀ z ∈ U, deriv f z ≠ 0) ∧ (∀ w ∈ ball 0 1, deriv g w ≠ 0) := by + obtain ⟨f, hf, _, hbij⟩ := riemann_mapping_bounded hU hb hc ha + let g := invFunOn f U + have hd : DifferentiableOn ℂ g (ball 0 1) := fun w hw => + (hasStrictDerivAt_invFunOn hU hf.holomorphic hbij hw).hasDerivAt.differentiableAt.differentiableWithinAt + have hinv : InvOn g f U (ball 0 1) := hbij.invOn_invFunOn + have hg : BijOn g (ball 0 1) U := hbij.symm hinv.symm + exact ⟨f, g, hf.holomorphic, hd, hbij, hg, hinv, hf.normalized, + fun z hz => deriv_ne_zero_of_injOn hU hf.holomorphic hf.injective hz, + fun w hw => deriv_ne_zero_of_injOn isOpen_ball hd hg.injOn hw⟩ + +end CrouzeixHilbert.Conformal + +end + +end OAI diff --git a/lean/OAI/Analysis/Crouzeix/Vectorization.lean b/lean/OAI/Analysis/Crouzeix/Vectorization.lean new file mode 100644 index 0000000000000000000000000000000000000000..02174cc96e57e342736891958da28ff7955b8724 --- /dev/null +++ b/lean/OAI/Analysis/Crouzeix/Vectorization.lean @@ -0,0 +1,104 @@ +import Mathlib +import OAI.Analysis.Crouzeix.Amplification +import OAI.Analysis.Crouzeix.MatrixEndpoint +import OAI.Analysis.Crouzeix.RationalTransfer + +namespace OAI + +/-! Vectorization. -/ + +noncomputable section + +open scoped TensorProduct Matrix Matrix.Norms.L2Operator Kronecker InnerProductSpace MatrixOrder ComplexOrder + +namespace CrouzeixHilbert + +open Realization + +def vectorization {n : ℕ} (X : Coeff n) : Amplification (EuclideanSpace ℂ (Fin n)) n := + ∑ j, ↑((Matrix.toEuclideanCLM (𝕜 := ℂ) X) (EuclideanSpace.basisFun (Fin n) ℂ j) ⊗ₜ[ℂ] + (EuclideanSpace.basisFun (Fin n) ℂ j)) + +@[simp] theorem vectorization_coordinates {n : ℕ} (X : Coeff n) : + matrixAmplificationCoordinates n n (vectorization X) = Boundary.toHS X := by + apply PiLp.ext + rintro ⟨i,j⟩ + simp only [vectorization, map_sum, WithLp.ofLp_sum, Finset.sum_apply, matrixAmplificationCoordinates_tmul, + Matrix.ofLp_toEuclideanCLM, Matrix.mulVec, dotProduct, + EuclideanSpace.basisFun_apply, PiLp.single_apply] + simp [Boundary.toHS] + +@[simp] theorem norm_vectorization {n : ℕ} (X : Coeff n) : + ‖vectorization X‖ = ‖Boundary.toHS X‖ := by + rw [← norm_matrixAmplificationCoordinates n n, vectorization_coordinates] + +theorem kronecker_toHS {n : ℕ} (A B X : Coeff n) : + (Matrix.toEuclideanCLM (𝕜 := ℂ) (A ⊗ₖ B)) (Boundary.toHS X) = + Boundary.toHS (A * X * Bᵀ) := by + apply PiLp.ext + rintro ⟨i,j⟩ + simp only [Matrix.ofLp_toEuclideanCLM, Matrix.mulVec, dotProduct, + Fintype.sum_prod_type, Matrix.kronecker_apply, Boundary.toHS, + WithLp.ofLp_toLp, Matrix.mul_apply, Matrix.transpose_apply, Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + ring + +theorem tensorOperator_vectorization {n : ℕ} (A B X : Coeff n) : + tensorOperator (Matrix.toEuclideanCLM (𝕜 := ℂ) A) B (vectorization X) = + vectorization (A * X * Bᵀ) := by + let e : Amplification (EuclideanSpace ℂ (Fin n)) n →ₗᵢ[ℂ] + EuclideanSpace ℂ (Fin n × Fin n) := + ⟨(matrixAmplificationCoordinates n n).toLinearMap, norm_matrixAmplificationCoordinates n n⟩ + apply e.injective + change matrixAmplificationCoordinates n n _ = matrixAmplificationCoordinates n n _ + rw [matrixAmplificationCoordinates_tensorOperator, vectorization_coordinates, + vectorization_coordinates, kronecker_toHS] + +namespace Endpoint + +open Boundary + +theorem EndpointFactors.exists_colligation {n : ℕ} {T H : Coeff n} {κ : ℝ} + (E : EndpointFactors T κ H) : + ∃ C : Realization.Colligation (EuclideanSpace ℂ (Fin n)), + CFC.sqrt E.Q = + (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)) * CFC.sqrt E.Q * + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.a + + E.X * (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.c ∧ + E.Y = (CFC.sqrt H * T * Ring.inverse (CFC.sqrt H)) * CFC.sqrt E.Q * + (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.b + + E.X * (Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n)).symm C.d := by + let e := Matrix.toEuclideanCLM (𝕜 := ℂ) (n := Fin n) + let D := CFC.sqrt H * T * Ring.inverse (CFC.sqrt H) + let L := CFC.sqrt E.Q + have hL : L * Lᴴ = E.Q := by + rw [(IsSelfAdjoint.of_nonneg (CFC.sqrt_nonneg E.Q)).isHermitian.eq] + exact CFC.sqrt_mul_sqrt_self E.Q E.Q_positive.nonneg + have hbal : L * Lᴴ + E.Y * E.Yᴴ = (D * L) * (D * L)ᴴ + E.X * E.Xᴴ := by + rw [Matrix.conjTranspose_mul] + have he : (D * L) * (Lᴴ * Dᴴ) = D * E.Q * Dᴴ := by + rw [mul_assoc D L, ← mul_assoc L, hL, ← mul_assoc] + rw [he, hL] + have h := E.balance + change E.X * E.Xᴴ - E.Y * E.Yᴴ = E.Q - D * E.Q * Dᴴ at h + apply sub_eq_sub_iff_add_eq_add.mp at h + rw [add_comm] at h + exact h.symm + obtain ⟨C, hC, hY⟩ := Realization.exists_colligation_data (e D) (e L) (e E.X) (e E.Y) + (by simpa only [← map_mul, ← map_star, ← map_add, Matrix.star_eq_conjTranspose] + using congrArg e hbal) + refine ⟨C, ?_, ?_⟩ + · simpa only [map_add, map_mul, StarAlgEquiv.symm_apply_apply] using congrArg e.symm hC + · simpa only [map_add, map_mul, StarAlgEquiv.symm_apply_apply] using congrArg e.symm hY + +end Endpoint + +end CrouzeixHilbert + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Commutative.lean b/lean/OAI/Analysis/Cuntz/Commutative.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ff3eb378e46dec98c33d0d84c0be9cf94c9108e --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Commutative.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.Cuntz.Content +import OAI.Analysis.Cuntz.RegularizedState + +namespace OAI + +noncomputable section + +/-! Commutative dimension contents and continuous positive functions. -/ + +section +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] Classical.propDecidable +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A X : Type*} [CStarAlgebra A] [TopologicalSpace X] + +/-- Transport the existing regularized dimension through a real star algebra +homomorphism. On negative functions the auxiliary value is zero and is unused. -/ +def CuntzDimensionState.continuousDimension (d : CuntzDimensionState A) {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) : PositiveDimensionFunctional X where + toFun f := if hf : 0 ≤ f then d.regularized ⟨n, CStarMatrix.ofMatrix.symm (φ f), map_nonneg φ hf⟩ else 0 + nonneg f hf := by simp only [dite_eq_left hf]; exact d.regularized_nonneg _ + mono f g hf hfg := by + simp only [dite_eq_left hf, dite_eq_left (hf.trans hfg)] + exact d.regularized_mono (cuntzLE_of_nonneg_le (map_nonneg φ hf) (OrderHomClass.mono φ hfg)) + subadd f g hf hg := by + simp only [dite_eq_left hf, dite_eq_left hg, dite_eq_left (add_nonneg hf hg), map_add] + exact d.regularized_sum_le _ _ (map_nonneg φ hf) (map_nonneg φ hg) + orthogonal f g hf hg hfg := by + simp only [dite_eq_left hf, dite_eq_left hg, dite_eq_left (add_nonneg hf hg), map_add] + apply d.regularized_orthogonal_add _ _ (map_nonneg φ hf) (map_nonneg φ hg) + rw [← map_mul, hfg, map_zero] + +@[simp] theorem CuntzDimensionState.continuousDimension_apply (d : CuntzDimensionState A) {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) (f : C(X, ℝ)) (hf : 0 ≤ f) : + (d.continuousDimension φ).toFun f = + d.regularized ⟨n, CStarMatrix.ofMatrix.symm (φ f), map_nonneg φ hf⟩ := by + simp [continuousDimension, hf] + +/-- A compact content constructed from the SAME ambient dimension state. -/ +def CuntzDimensionState.commutativeContent (d : CuntzDimensionState A) [NormalSpace X] {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) : MeasureTheory.Content X := + (d.continuousDimension φ).content + +theorem CuntzDimensionState.continuousDimension_one (d : CuntzDimensionState A) {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) : + (d.continuousDimension φ).toFun 1 = n := by + rw [d.continuousDimension_apply φ 1 zero_le_one] + rw [← d.regularized_unit n] + apply d.regularized_eq + change CuntzEquivalent (CStarMatrix.ofMatrix.symm (φ 1)) 1 + rw [map_one] + exact .refl _ + +end Kaplansky + +end + +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A X : Type*} [CStarAlgebra A] [TopologicalSpace X] +namespace CuntzDimensionState + +theorem continuousDimension_scaleInvariant (d : CuntzDimensionState A) {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) : + (d.continuousDimension φ).ScaleInvariant := by + intro f hf r hr + rw [d.continuousDimension_apply φ f hf, + d.continuousDimension_apply φ (r • f) (fun x => mul_nonneg hr.le (hf x))] + apply d.regularized_eq + change CuntzEquivalent (CStarMatrix.ofMatrix.symm (φ (r • f))) _ + rw [map_smul] + exact cuntzEquivalent_pos_smul (φ f) hr + +theorem continuousDimension_lowerSemicontinuous (d : CuntzDimensionState A) {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) (hφ : Continuous φ) : + (d.continuousDimension φ).ConeLowerSemicontinuous := by + let g : {f : C(X, ℝ) // 0 ≤ f} → {a : CStarMatrix (Fin n) (Fin n) A // 0 ≤ a} := + fun f => ⟨φ f.val, map_nonneg φ f.property⟩ + have hg : Continuous g := (hφ.comp continuous_subtype_val).subtype_mk _ + have h := (d.regularized_lowerSemicontinuous n).comp hg + change LowerSemicontinuous (fun f : {f : C(X, ℝ) // 0 ≤ f} => (d.continuousDimension φ).toFun f.val) + have he : (fun f : {f : C(X, ℝ) // 0 ≤ f} => (d.continuousDimension φ).toFun f.val) = + (fun f : {f : C(X, ℝ) // 0 ≤ f} => d.regularized ⟨n, CStarMatrix.ofMatrix.symm (φ f.val), map_nonneg φ f.property⟩) := by + funext f + exact d.continuousDimension_apply φ f.val f.property + rw [he] + exact h + +variable [CompactSpace X] [NormalSpace X] [R1Space X] [MeasurableSpace X] [BorelSpace X] + +/-- The measure of a positive support is the actual regularized ambient +Cuntz dimension of its image, with no functional or measure-existence premise. -/ +theorem continuousDimension_measure_positive_support (d : CuntzDimensionState A) {n : ℕ} + (φ : C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A) (hφ : Continuous φ) + (f : C(X, ℝ)) (hf : 0 ≤ f) : + (d.continuousDimension φ).measure {x | 0 < f x} = + ENNReal.ofReal (d.regularized ⟨n, CStarMatrix.ofMatrix.symm (φ f), map_nonneg φ hf⟩) := by + rw [← d.continuousDimension_apply φ f hf] + exact (d.continuousDimension φ).measure_positive_support + (d.continuousDimension_scaleInvariant φ) (d.continuousDimension_lowerSemicontinuous φ hφ) f hf + +end CuntzDimensionState +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Comparison.lean b/lean/OAI/Analysis/Cuntz/Comparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..17713f51af4bec4700339e3e488946880fe89b7a --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Comparison.lean @@ -0,0 +1,324 @@ +import Mathlib.Analysis.CStarAlgebra.CStarMatrix +import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +import Mathlib.Data.Matrix.Block +import Mathlib.Data.Matrix.ColumnRowPartitioned +import Mathlib.Logic.Equiv.Fin.Basic +import Mathlib.Topology.Instances.Matrix + +namespace OAI + +/-! Rectangular matrix comparison, block sums, and reindexing of positive matrices. -/ + +noncomputable section +open scoped Topology Matrix +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +variable {ι κ ν : Type*} [Fintype κ] [Fintype ν] + +/-- Rectangular Cuntz comparison: norm closure of actual conjugations. +The finite product topology here is the topology of the C*-matrix norm. -/ +def CuntzLE (a : Matrix ι ι A) (b : Matrix κ κ A) : Prop := + a ∈ closure (Set.range fun v : Matrix ι κ A => v * b * v.conjTranspose) + +namespace CuntzLE + +theorem exact (b : Matrix κ κ A) (v : Matrix ι κ A) : + CuntzLE (v * b * v.conjTranspose) b := subset_closure ⟨v, rfl⟩ + +theorem refl [Fintype ι] (a : Matrix ι ι A) : CuntzLE a a := by + classical + simpa using exact a (1 : Matrix ι ι A) + +theorem zero (b : Matrix κ κ A) : CuntzLE (0 : Matrix ι ι A) b := by + simpa using exact b (0 : Matrix ι κ A) + +theorem isClosed (b : Matrix κ κ A) : IsClosed {a : Matrix ι ι A | CuntzLE a b} := + isClosed_closure + +theorem of_mem_closure {s : Set (Matrix ι ι A)} {a : Matrix ι ι A} + {b : Matrix κ κ A} (ha : a ∈ closure s) (hs : ∀ x ∈ s, CuntzLE x b) : + CuntzLE a b := (isClosed b).closure_subset_iff.mpr hs ha + +theorem conjugate {a : Matrix κ κ A} {b : Matrix ν ν A} (h : CuntzLE a b) + (v : Matrix ι κ A) : CuntzLE (v * a * v.conjTranspose) b := by + have hc : Continuous (fun x : Matrix κ κ A => v * x * v.conjTranspose) := + (continuous_const.matrix_mul continuous_id).matrix_mul continuous_const + apply of_mem_closure ((image_closure_subset_closure_image hc) ⟨a, h, rfl⟩) + rintro _ ⟨_, ⟨w, rfl⟩, rfl⟩ + simpa only [Matrix.conjTranspose_mul, Matrix.mul_assoc] using exact b (v * w) + +theorem trans {a : Matrix ι ι A} {b : Matrix κ κ A} {c : Matrix ν ν A} + (hab : CuntzLE a b) (hbc : CuntzLE b c) : CuntzLE a c := by + apply of_mem_closure hab + rintro _ ⟨v, rfl⟩ + exact hbc.conjugate v + +theorem of_eq {a a' : Matrix ι ι A} {b b' : Matrix κ κ A} + (ha : a = a') (hb : b = b') (h : CuntzLE a' b') : CuntzLE a b := ha ▸ hb ▸ h + +theorem le_zero_iff (a : Matrix ι ι A) : CuntzLE a (0 : Matrix κ κ A) ↔ a = 0 := by + simp [CuntzLE] + +/-- Explicit norm-approximation contract, using the actual C*-matrix norm. -/ +theorem iff_approx [Fintype ι] (a : Matrix ι ι A) (b : Matrix κ κ A) : + CuntzLE a b ↔ ∀ ε : ℝ, 0 < ε → ∃ v : Matrix ι κ A, + ‖CStarMatrix.ofMatrix (a - v * b * v.conjTranspose)‖ < ε := by + change CStarMatrix.ofMatrix a ∈ closure (Set.range fun v : Matrix ι κ A => + CStarMatrix.ofMatrix (v * b * v.conjTranspose)) ↔ _ + rw [Metric.mem_closure_iff] + simp only [Set.mem_range, exists_exists_eq_and, dist_eq_norm] + rfl + +end CuntzLE + +variable [Fintype ι] + +/-- Mutual actual rectangular comparison; no order or state is assumed. -/ +def CuntzEquivalent (a : Matrix ι ι A) (b : Matrix κ κ A) : Prop := + CuntzLE a b ∧ CuntzLE b a + +namespace CuntzEquivalent + +theorem refl (a : Matrix ι ι A) : CuntzEquivalent a a := ⟨.refl a, .refl a⟩ +theorem symm {a : Matrix ι ι A} {b : Matrix κ κ A} + (h : CuntzEquivalent a b) : CuntzEquivalent b a := ⟨h.2, h.1⟩ + +theorem trans {a : Matrix ι ι A} {b : Matrix κ κ A} {c : Matrix ν ν A} + (h : CuntzEquivalent a b) (h' : CuntzEquivalent b c) : CuntzEquivalent a c := + ⟨h.1.trans h'.1, h'.2.trans h.2⟩ + +end CuntzEquivalent +end Kaplansky + +end + +noncomputable section +open scoped Topology Matrix +namespace Kaplansky +variable {A : Type*} [CStarAlgebra A] +variable {ι κ ν μ : Type*} + +/-- Block addition before passing to Cuntz classes. -/ +def cuntzBlock (a : Matrix ι ι A) (b : Matrix κ κ A) : + Matrix (ι ⊕ κ) (ι ⊕ κ) A := Matrix.fromBlocks a 0 0 b + +theorem continuous_cuntzBlock : Continuous (fun p : Matrix ι ι A × Matrix κ κ A => + cuntzBlock p.1 p.2) := by + apply continuous_matrix + intro i j + cases i <;> cases j <;> dsimp [cuntzBlock, Matrix.fromBlocks] <;> fun_prop + +variable [Fintype κ] [Fintype μ] + +theorem cuntzBlock_conjugate (a : Matrix κ κ A) (b : Matrix μ μ A) + (v : Matrix ι κ A) (w : Matrix ν μ A) : + (Matrix.fromBlocks v 0 0 w) * cuntzBlock a b * + (Matrix.fromBlocks v 0 0 w).conjTranspose = + cuntzBlock (v * a * v.conjTranspose) (w * b * w.conjTranspose) := by + simp [cuntzBlock, Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply] + +/-- Actual rectangular comparison is compatible with block addition. -/ +theorem CuntzLE.block {a : Matrix ι ι A} {b : Matrix κ κ A} + {c : Matrix ν ν A} {d : Matrix μ μ A} (hab : CuntzLE a b) (hcd : CuntzLE c d) : + CuntzLE (cuntzBlock a c) (cuntzBlock b d) := by + have hp : (a, c) ∈ closure ((Set.range fun v : Matrix ι κ A => v * b * v.conjTranspose) ×ˢ + (Set.range fun w : Matrix ν μ A => w * d * w.conjTranspose)) := by + rw [closure_prod_eq] + exact ⟨hab, hcd⟩ + apply CuntzLE.of_mem_closure ((image_closure_subset_closure_image continuous_cuntzBlock) ⟨(a,c), hp, rfl⟩) + rintro _ ⟨⟨_, _⟩, ⟨⟨v, rfl⟩, ⟨w, rfl⟩⟩, rfl⟩ + simpa only [cuntzBlock_conjugate] using + CuntzLE.exact (cuntzBlock b d) (Matrix.fromBlocks v 0 0 w) + +variable [Fintype ι] [Fintype ν] + +theorem CuntzEquivalent.block {a : Matrix ι ι A} {b : Matrix κ κ A} + {c : Matrix ν ν A} {d : Matrix μ μ A} (hab : CuntzEquivalent a b) + (hcd : CuntzEquivalent c d) : CuntzEquivalent (cuntzBlock a c) (cuntzBlock b d) := + ⟨hab.1.block hcd.1, hab.2.block hcd.2⟩ + +end Kaplansky + +end + +noncomputable section +open scoped Topology Matrix +namespace Kaplansky +variable {A : Type*} [CStarAlgebra A] +variable {ι κ ν : Type*} [Fintype ι] [Fintype ν] + +/-- Taking the same row and column submatrix is an actual rectangular conjugation. -/ +theorem CuntzLE.submatrix (a : Matrix ι ι A) (f : κ → ι) : + CuntzLE (a.submatrix f f) a := by + classical + have he : (1 : Matrix ι ι A).submatrix f id * a * + ((1 : Matrix ι ι A).submatrix f id).conjTranspose = a.submatrix f f := by + rw [Matrix.conjTranspose_submatrix] + simp only [Matrix.conjTranspose_one] + have hleft : (1 : Matrix ι ι A).submatrix f id * a = a.submatrix f id := by + simpa using Matrix.one_submatrix_mul f (Equiv.refl ι) a + rw [hleft] + simpa using Matrix.mul_submatrix_one (Equiv.refl ι) f (a.submatrix f id) + rw [← he] + exact CuntzLE.exact _ _ + +variable [Fintype κ] + +/-- Relabeling the finite coordinates preserves the actual Cuntz class. -/ +theorem cuntzEquivalent_submatrix_equiv (a : Matrix ι ι A) (e : κ ≃ ι) : + CuntzEquivalent (a.submatrix e e) a := by + refine ⟨CuntzLE.submatrix a e, ?_⟩ + simpa using CuntzLE.submatrix (a.submatrix e e) e.symm + +theorem cuntzLE_submatrix_equiv_iff (a : Matrix ι ι A) (b : Matrix ν ν A) + (e : κ ≃ ι) : CuntzLE (a.submatrix e e) b ↔ CuntzLE a b := by + have he := cuntzEquivalent_submatrix_equiv a e + exact ⟨fun h => he.2.trans h, fun h => he.1.trans h⟩ + +/-- Enlarging by an arbitrary zero corner does not change a Cuntz class. -/ +theorem cuntzEquivalent_block_zero (a : Matrix ι ι A) : + CuntzEquivalent (cuntzBlock a (0 : Matrix κ κ A)) a := by + classical + let v : Matrix (ι ⊕ κ) ι A := Matrix.fromRows 1 0 + have he : v * a * v.conjTranspose = cuntzBlock a (0 : Matrix κ κ A) := by + simp [v, cuntzBlock, Matrix.conjTranspose_fromRows_eq_fromCols_conjTranspose, + Matrix.fromRows_mul] + ext i j + cases i <;> cases j <;> rfl + refine ⟨he ▸ CuntzLE.exact a v, ?_⟩ + exact CuntzLE.submatrix (cuntzBlock a (0 : Matrix κ κ A)) Sum.inl + +/-- The permutation exchanging the blocks witnesses commutativity. -/ +theorem cuntzEquivalent_block_comm (a : Matrix ι ι A) (b : Matrix κ κ A) : + CuntzEquivalent (cuntzBlock a b) (cuntzBlock b a) := by + have h := cuntzEquivalent_submatrix_equiv (cuntzBlock b a) (Equiv.sumComm ι κ) + convert h using 1 + ext i j + cases i <;> cases j <;> rfl + +/-- Rebracketing three blocks witnesses associativity. -/ +theorem cuntzEquivalent_block_assoc (a : Matrix ι ι A) (b : Matrix κ κ A) + (c : Matrix ν ν A) : + CuntzEquivalent (cuntzBlock (cuntzBlock a b) c) (cuntzBlock a (cuntzBlock b c)) := by + have h := cuntzEquivalent_submatrix_equiv (cuntzBlock a (cuntzBlock b c)) + (Equiv.sumAssoc ι κ ν) + convert h using 1 + ext i j + rcases i with (i | i) | i <;> rcases j with (j | j) | j <;> rfl + +end Kaplansky + +end + +noncomputable section +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +variable {ι κ : Type*} [Fintype ι] [Fintype κ] + +theorem cuntzBlock_nonneg (a : Matrix ι ι A) (b : Matrix κ κ A) + (ha : 0 ≤ CStarMatrix.ofMatrix a) (hb : 0 ≤ CStarMatrix.ofMatrix b) : + 0 ≤ CStarMatrix.ofMatrix (cuntzBlock a b) := by + classical + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix ι ι A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix ι ι A) := CStarAlgebra.instNonnegSpectrumClass' + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix κ κ A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix κ κ A) := CStarAlgebra.instNonnegSpectrumClass' + obtain ⟨x, hx⟩ := (CStarAlgebra.nonneg_iff_eq_star_mul_self (a := CStarMatrix.ofMatrix a)).mp ha + obtain ⟨y, hy⟩ := (CStarAlgebra.nonneg_iff_eq_star_mul_self (a := CStarMatrix.ofMatrix b)).mp hb + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A) := CStarAlgebra.instNonnegSpectrumClass' + apply CStarAlgebra.nonneg_iff_eq_star_mul_self.mpr + refine ⟨CStarMatrix.ofMatrix (cuntzBlock (CStarMatrix.ofMatrix.symm x) (CStarMatrix.ofMatrix.symm y)), ?_⟩ + change cuntzBlock a b = + (cuntzBlock (CStarMatrix.ofMatrix.symm x) (CStarMatrix.ofMatrix.symm y)).conjTranspose * + cuntzBlock (CStarMatrix.ofMatrix.symm x) (CStarMatrix.ofMatrix.symm y) + change a = (CStarMatrix.ofMatrix.symm x).conjTranspose * CStarMatrix.ofMatrix.symm x at hx + change b = (CStarMatrix.ofMatrix.symm y).conjTranspose * CStarMatrix.ofMatrix.symm y at hy + simp only [cuntzBlock, Matrix.fromBlocks_conjTranspose, Matrix.conjTranspose_zero, + Matrix.fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add, Matrix.fromBlocks_inj] + exact ⟨hx, True.intro, True.intro, hy⟩ + +theorem cuntzSubmatrix_nonneg (a : Matrix ι ι A) (e : κ ≃ ι) + (ha : 0 ≤ CStarMatrix.ofMatrix a) : + 0 ≤ CStarMatrix.ofMatrix (a.submatrix e e) := by + classical + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix ι ι A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix ι ι A) := CStarAlgebra.instNonnegSpectrumClass' + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix κ κ A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix κ κ A) := CStarAlgebra.instNonnegSpectrumClass' + obtain ⟨x, hx⟩ := (CStarAlgebra.nonneg_iff_eq_star_mul_self (a := CStarMatrix.ofMatrix a)).mp ha + refine CStarAlgebra.nonneg_iff_eq_star_mul_self.mpr + ⟨CStarMatrix.ofMatrix ((CStarMatrix.ofMatrix.symm x).submatrix e e), ?_⟩ + change a.submatrix e e = + ((CStarMatrix.ofMatrix.symm x).submatrix e e).conjTranspose * + (CStarMatrix.ofMatrix.symm x).submatrix e e + change a = (CStarMatrix.ofMatrix.symm x).conjTranspose * CStarMatrix.ofMatrix.symm x at hx + rw [Matrix.conjTranspose_submatrix, Matrix.submatrix_mul_equiv, hx] + +/-- Every positive finite matrix is Cuntz below its own identity matrix. +The witness is its actual positive square root. -/ +theorem cuntzLE_one_of_nonneg [DecidableEq ι] (a : Matrix ι ι A) (ha : 0 ≤ CStarMatrix.ofMatrix a) : + CuntzLE a (1 : Matrix ι ι A) := by + classical + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix ι ι A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix ι ι A) := CStarAlgebra.instNonnegSpectrumClass' + let x := CFC.sqrt (CStarMatrix.ofMatrix a) + have hx : x * star x = CStarMatrix.ofMatrix a := by + rw [(CFC.sqrt_nonneg _).isSelfAdjoint.star_eq] + exact CFC.sqrt_mul_sqrt_self _ ha + change CStarMatrix.ofMatrix.symm x * (CStarMatrix.ofMatrix.symm x).conjTranspose = a at hx + have h := CuntzLE.exact (1 : Matrix ι ι A) (CStarMatrix.ofMatrix.symm x) + simpa only [Matrix.mul_one, hx] using h + +/-- An actual positive matrix with a finite, explicitly stored size. -/ +structure CuntzPositiveMatrix (A : Type*) [CStarAlgebra A] where + size : ℕ + matrix : Matrix (Fin size) (Fin size) A + nonneg : 0 ≤ CStarMatrix.ofMatrix matrix + +namespace CuntzPositiveMatrix + +def zero : CuntzPositiveMatrix A := ⟨0, 0, le_rfl⟩ + +def unit (n : ℕ) : CuntzPositiveMatrix A := ⟨n, 1, zero_le_one⟩ + +/-- Actual block addition, relabeled by the standard finite-sum equivalence. -/ +def add (a b : CuntzPositiveMatrix A) : CuntzPositiveMatrix A where + size := a.size + b.size + matrix := (cuntzBlock a.matrix b.matrix).submatrix finSumFinEquiv.symm finSumFinEquiv.symm + nonneg := cuntzSubmatrix_nonneg _ _ (cuntzBlock_nonneg _ _ a.nonneg b.nonneg) + +instance : Preorder (CuntzPositiveMatrix A) where + le a b := CuntzLE a.matrix b.matrix + le_refl a := .refl a.matrix + le_trans _ _ _ := CuntzLE.trans + +theorem add_equiv (a b : CuntzPositiveMatrix A) : + CuntzEquivalent (add a b).matrix (cuntzBlock a.matrix b.matrix) := + cuntzEquivalent_submatrix_equiv _ _ + +theorem add_le_add {a b c d : CuntzPositiveMatrix A} (hab : a ≤ b) (hcd : c ≤ d) : + add a c ≤ add b d := + (add_equiv a c).1.trans ((CuntzLE.block hab hcd).trans (add_equiv b d).2) + +theorem zero_le (a : CuntzPositiveMatrix A) : zero ≤ a := .zero a.matrix + +theorem le_unit (a : CuntzPositiveMatrix A) : a ≤ unit a.size := + cuntzLE_one_of_nonneg a.matrix a.nonneg + +end CuntzPositiveMatrix +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Content.lean b/lean/OAI/Analysis/Cuntz/Content.lean new file mode 100644 index 0000000000000000000000000000000000000000..9df889fe565be758d53fb7244dde209bd8025f0a --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Content.lean @@ -0,0 +1,400 @@ +import Mathlib.MeasureTheory.Measure.Content +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring +import Mathlib.Topology.ContinuousMap.Algebra +import Mathlib.Topology.ContinuousMap.Compact +import Mathlib.Topology.ContinuousMap.ContinuousSqrt +import Mathlib.Topology.ContinuousMap.Ordered +import Mathlib.Topology.Semicontinuity.Defs +import Mathlib.Topology.UrysohnsLemma + +namespace OAI + +/-! Compact dimension contents, their finite measures, and positive support. -/ + +section + +noncomputable section +open Set TopologicalSpace +namespace Kaplansky + +/-- The elementary dimension properties used to construct a compact content. +This is an auxiliary interface, not a quasitrace or a linearity assumption. -/ +structure PositiveDimensionFunctional (X : Type*) [TopologicalSpace X] where + toFun : C(X, ℝ) → ℝ + nonneg : ∀ f, 0 ≤ f → 0 ≤ toFun f + mono : ∀ f g, 0 ≤ f → f ≤ g → toFun f ≤ toFun g + subadd : ∀ f g, 0 ≤ f → 0 ≤ g → toFun (f+g) ≤ toFun f + toFun g + orthogonal : ∀ f g, 0 ≤ f → 0 ≤ g → f*g=0 → toFun (f+g) = toFun f + toFun g + +namespace PositiveDimensionFunctional +variable {X : Type*} [TopologicalSpace X] (D : PositiveDimensionFunctional X) + +/-- Continuous nonnegative functions majorizing one on the compact set. -/ +def majorants (K : Compacts X) : Set C(X, ℝ) := {f | 0 ≤ f ∧ ∀ x ∈ K, 1 ≤ f x} + +def compactValue (K : Compacts X) : ℝ := sInf (D.toFun '' majorants K) + +theorem majorants_nonempty (K : Compacts X) : (majorants K).Nonempty := + ⟨1, zero_le_one, fun _ _ => le_rfl⟩ + +theorem majorant_values_bddBelow (K : Compacts X) : BddBelow (D.toFun '' majorants K) := by + refine ⟨0, ?_⟩ + rintro _ ⟨f, hf, rfl⟩ + exact D.nonneg f hf.1 + +theorem compactValue_nonneg (K : Compacts X) : 0 ≤ D.compactValue K := by + apply le_csInf ((majorants_nonempty K).image D.toFun) + rintro _ ⟨f, hf, rfl⟩ + exact D.nonneg f hf.1 + +theorem compactValue_le (K : Compacts X) {f : C(X, ℝ)} (hf : f ∈ majorants K) : + D.compactValue K ≤ D.toFun f := csInf_le (D.majorant_values_bddBelow K) ⟨f, hf, rfl⟩ + +theorem le_compactValue (K : Compacts X) {r : ℝ} + (h : ∀ f ∈ majorants K, r ≤ D.toFun f) : r ≤ D.compactValue K := by + apply le_csInf ((majorants_nonempty K).image D.toFun) + rintro _ ⟨f, hf, rfl⟩ + exact h f hf + +theorem compactValue_le_one (K : Compacts X) : D.compactValue K ≤ D.toFun 1 := + D.compactValue_le K ⟨zero_le_one, fun _ _ => le_rfl⟩ + +theorem compactValue_mono (K L : Compacts X) (h : (K : Set X) ⊆ L) : + D.compactValue K ≤ D.compactValue L := by + apply D.le_compactValue + intro f hf + exact D.compactValue_le K ⟨hf.1, fun x hx => hf.2 x (h hx)⟩ + +theorem compactValue_sup_le (K L : Compacts X) : + D.compactValue (K ⊔ L) ≤ D.compactValue K + D.compactValue L := by + apply (sub_le_iff_le_add).mp + apply D.le_compactValue K + intro f hf + suffices h : D.compactValue (K ⊔ L) - D.toFun f ≤ D.compactValue L by linarith + apply D.le_compactValue L + intro g hg + have hfg : f+g ∈ majorants (K ⊔ L) := by + refine ⟨add_nonneg hf.1 hg.1, ?_⟩ + intro x hx + rcases hx with hx | hx + · exact (hf.2 x hx).trans (le_add_of_nonneg_right (hg.1 x)) + · exact (hg.2 x hx).trans (le_add_of_nonneg_left (hf.1 x)) + have h := (D.compactValue_le (K ⊔ L) hfg).trans (D.subadd f g hf.1 hg.1) + linarith + +end PositiveDimensionFunctional +end Kaplansky + +end +end + +section + +noncomputable section +open Set TopologicalSpace +namespace Kaplansky + +/-- Disjoint closed sets admit nonnegative continuous cutoffs with disjoint +supports and sum at most one. -/ +theorem exists_disjoint_compact_cutoffs {X : Type*} [TopologicalSpace X] [NormalSpace X] + (K L : Set X) (hK : IsClosed K) (hL : IsClosed L) (hKL : Disjoint K L) : + ∃ u v : C(X, ℝ), 0 ≤ u ∧ 0 ≤ v ∧ u+v ≤ 1 ∧ u*v=0 ∧ + (∀ x ∈ K, u x=1) ∧ (∀ x ∈ L, v x=1) := by + obtain ⟨f, hfK, hfL, hf⟩ := exists_continuous_zero_one_of_isClosed hK hL hKL + let u : C(X, ℝ) := ⟨fun x => max (1-3*f x) 0, by fun_prop⟩ + let v : C(X, ℝ) := ⟨fun x => max (3*f x-2) 0, by fun_prop⟩ + refine ⟨u, v, (fun x => le_max_right _ _), (fun x => le_max_right _ _), ?_, ?_, ?_, ?_⟩ + · intro x + change max (1-3*f x) 0 + max (3*f x-2) 0 ≤ 1 + have hx := hf x + rcases le_total (1-3*f x) 0 with h | h <;> + rcases le_total (3*f x-2) 0 with h' | h' + · rw [max_eq_right h, max_eq_right h']; norm_num + · rw [max_eq_right h, max_eq_left h']; linarith [hx.2] + · rw [max_eq_left h, max_eq_right h']; linarith [hx.1] + · linarith + · ext x + change max (1-3*f x) 0 * max (3*f x-2) 0 = 0 + by_cases h : 1-3*f x ≤ 0 + · rw [max_eq_right h, zero_mul] + · rw [max_eq_right (by linarith : 3*f x-2 ≤ 0), mul_zero] + · intro x hx + change max (1-3*f x) 0 = 1 + rw [hfK hx] + norm_num + · intro x hx + change max (3*f x-2) 0 = 1 + rw [hfL hx] + norm_num + +end Kaplansky + +end +end + +section + +noncomputable section +open Set TopologicalSpace +open scoped NNReal ENNReal +namespace Kaplansky +namespace PositiveDimensionFunctional +variable {X : Type*} [TopologicalSpace X] [NormalSpace X] (D : PositiveDimensionFunctional X) + +theorem compactValue_sup_disjoint (K L : Compacts X) + (hKL : Disjoint (K : Set X) L) (hK : IsClosed (K : Set X)) (hL : IsClosed (L : Set X)) : + D.compactValue (K ⊔ L) = D.compactValue K + D.compactValue L := by + apply le_antisymm (D.compactValue_sup_le K L) + apply D.le_compactValue + intro f hf + obtain ⟨u, v, hu, hv, huv, hzero, huK, hvL⟩ := + exists_disjoint_compact_cutoffs (K : Set X) L hK hL hKL + have huf : u*f ∈ majorants K := by + refine ⟨fun x => mul_nonneg (hu x) (hf.1 x), ?_⟩ + intro x hx + change 1 ≤ u x*f x + rw [huK x hx, one_mul] + exact hf.2 x (Or.inl hx) + have hvf : v*f ∈ majorants L := by + refine ⟨fun x => mul_nonneg (hv x) (hf.1 x), ?_⟩ + intro x hx + change 1 ≤ v x*f x + rw [hvL x hx, one_mul] + exact hf.2 x (Or.inr hx) + have hm : u*f+v*f ≤ f := by + intro x + change u x*f x+v x*f x ≤ f x + have h := mul_le_mul_of_nonneg_right (huv x) (hf.1 x) + change (u x+v x)*f x ≤ 1*f x at h + simpa only [add_mul, one_mul] using h + have hz : (u*f)*(v*f)=0 := by + calc + (u*f)*(v*f) = (u*v)*(f*f) := by ring + _ = 0 := by rw [hzero, zero_mul] + calc + _ ≤ D.toFun (u*f)+D.toFun (v*f) := add_le_add (D.compactValue_le K huf) (D.compactValue_le L hvf) + _ = D.toFun (u*f+v*f) := (D.orthogonal _ _ huf.1 hvf.1 hz).symm + _ ≤ D.toFun f := D.mono _ _ (add_nonneg huf.1 hvf.1) hm + +/-- An actual compact content obtained by infima of positive dimension values. -/ +def content : MeasureTheory.Content X where + toFun K := ⟨D.compactValue K, D.compactValue_nonneg K⟩ + mono' K L h := D.compactValue_mono K L h + sup_le' K L := D.compactValue_sup_le K L + sup_disjoint' K L h hK hL := NNReal.eq (D.compactValue_sup_disjoint K L h hK hL) + +@[simp] theorem content_toReal (K : Compacts X) : (D.content K).toReal = D.compactValue K := by + exact ENNReal.coe_toReal _ + +end PositiveDimensionFunctional +end Kaplansky + +end +end + +section + +noncomputable section +open Set TopologicalSpace MeasureTheory +open scoped NNReal ENNReal +namespace Kaplansky +namespace PositiveDimensionFunctional +variable {X : Type*} [TopologicalSpace X] [NormalSpace X] [R1Space X] + [MeasurableSpace X] [BorelSpace X] (D : PositiveDimensionFunctional X) + +/-- The Borel measure furnished by the proved compact content. -/ +def measure : Measure X := D.content.measure + +theorem measure_open (U : Opens X) : + D.measure (U : Set X) = D.content.innerContent U := by + rw [measure, Content.measure_apply _ U.isOpen.measurableSet, Content.outerMeasure_opens] + +theorem measure_open_eq_sup (U : Opens X) : + D.measure (U : Set X) = ⨆ (K : Compacts X) (_ : (K : Set X) ⊆ U), D.content K := + D.measure_open U + +omit [R1Space X] [MeasurableSpace X] [BorelSpace X] in +theorem content_le_one (K : Compacts X) : D.content K ≤ ENNReal.ofReal (D.toFun 1) := by + rw [← ENNReal.ofReal_toReal (show D.content K ≠ ∞ from ENNReal.coe_ne_top)] + rw [D.content_toReal K] + exact ENNReal.ofReal_le_ofReal (D.compactValue_le_one K) + +theorem measure_univ_le : D.measure Set.univ ≤ ENNReal.ofReal (D.toFun 1) := by + change D.measure ((⊤ : Opens X) : Set X) ≤ _ + rw [D.measure_open_eq_sup] + exact iSup₂_le fun K _ => D.content_le_one K + +instance measure_isFiniteMeasure : IsFiniteMeasure D.measure := + ⟨D.measure_univ_le.trans_lt ENNReal.ofReal_lt_top⟩ + +end PositiveDimensionFunctional +end Kaplansky + +end +end + +section + +noncomputable section +open Set TopologicalSpace +namespace Kaplansky +namespace PositiveDimensionFunctional +variable {X : Type*} [TopologicalSpace X] (D : PositiveDimensionFunctional X) + +theorem zero_value : D.toFun 0 = 0 := by + have h := D.orthogonal 0 0 le_rfl le_rfl (mul_zero _) + rw [add_zero] at h + linarith + +theorem compactValue_empty : D.compactValue ⊥ = 0 := by + apply le_antisymm _ (D.compactValue_nonneg _) + rw [← D.zero_value] + exact D.compactValue_le _ ⟨le_rfl, fun _ hx => False.elim hx⟩ + +/-- Positive scalar invariance is a dimension property, not spectral homogeneity. -/ +def ScaleInvariant : Prop := ∀ (f : C(X, ℝ)), 0 ≤ f → ∀ r : ℝ, 0 < r → + D.toFun (r • f) = D.toFun f + +theorem compactValue_le_of_pos (hscale : D.ScaleInvariant) (K : Compacts X) + (f : C(X, ℝ)) (hf : 0 ≤ f) (hK : ∀ x ∈ K, 0 < f x) : + D.compactValue K ≤ D.toFun f := by + by_cases hne : (K : Set X).Nonempty + · obtain ⟨x, hx, hmin⟩ := K.isCompact.exists_isMinOn hne f.continuous.continuousOn + have hp := hK x hx + rw [← hscale f hf ((f x)⁻¹) (inv_pos.mpr hp)] + apply D.compactValue_le + refine ⟨fun y => mul_nonneg (inv_nonneg.mpr hp.le) (hf y), ?_⟩ + intro y hy + change 1 ≤ (f x)⁻¹ * f y + rw [inv_mul_eq_div] + exact (le_div_iff₀ hp).mpr (by simpa using hmin hy) + · have h : K = ⊥ := by + ext x + change (x ∈ K) ↔ False + exact ⟨fun hx => hne ⟨x, hx⟩, False.elim⟩ + rw [h, D.compactValue_empty] + exact D.nonneg f hf + +variable [CompactSpace X] + +/-- A function vanishing off K has dimension at most the compact content of K. -/ +theorem value_le_compactValue_of_support (hscale : D.ScaleInvariant) (K : Compacts X) + (f : C(X, ℝ)) (hf : 0 ≤ f) (hs : ∀ x, x ∉ K → f x=0) : + D.toFun f ≤ D.compactValue K := by + apply D.le_compactValue + intro g hg + have hp : 0 < ‖f‖+1 := by linarith [norm_nonneg f] + have hle : f ≤ (‖f‖+1) • g := by + intro x + change f x ≤ (‖f‖+1)*g x + by_cases hx : x ∈ K + · have hb : f x ≤ ‖f‖+1 := (f.apply_le_norm x).trans (by linarith) + exact hb.trans (le_mul_of_one_le_right hp.le (hg.2 x hx)) + · rw [hs x hx] + exact mul_nonneg hp.le (hg.1 x) + calc + D.toFun f ≤ D.toFun ((‖f‖+1) • g) := D.mono _ _ hf hle + _ = D.toFun g := hscale g hg.1 _ hp + +end PositiveDimensionFunctional +end Kaplansky + +end +end + +section + +noncomputable section +open Set TopologicalSpace MeasureTheory +open scoped NNReal ENNReal Topology +namespace Kaplansky + +/-- Continuous scalar cutoff, used only for uniform approximation of functions. -/ +def continuousDimensionCutoff {X : Type*} [TopologicalSpace X] (f : C(X, ℝ)) (t : ℝ) : C(X, ℝ) := + ⟨fun x => max (f x-t) 0, by fun_prop⟩ + +theorem continuousDimensionCutoff_nonneg {X : Type*} [TopologicalSpace X] (f : C(X, ℝ)) (t : ℝ) : + 0 ≤ continuousDimensionCutoff f t := fun _ => le_max_right _ _ + +theorem continuousDimensionCutoff_zero {X : Type*} [TopologicalSpace X] (f : C(X, ℝ)) (hf : 0 ≤ f) : + continuousDimensionCutoff f 0 = f := by + ext x + change max (f x-0) 0 = f x + rw [sub_zero, max_eq_left (show 0 ≤ f x from hf x)] + +namespace PositiveDimensionFunctional +variable {X : Type*} [TopologicalSpace X] (D : PositiveDimensionFunctional X) + +/-- Lower semicontinuity is required only on the nonnegative cone. -/ +def ConeLowerSemicontinuous : Prop := + LowerSemicontinuous (fun f : {f : C(X, ℝ) // 0 ≤ f} => D.toFun f.val) + +theorem exists_positive_cutoff (hsc : D.ConeLowerSemicontinuous) + (f : C(X, ℝ)) (hf : 0 ≤ f) {r : ℝ} (hr : r < D.toFun f) : + ∃ t : ℝ, 0 < t ∧ r < D.toFun (continuousDimensionCutoff f t) := by + let g : ℝ → {f : C(X, ℝ) // 0 ≤ f} := + fun t => ⟨continuousDimensionCutoff f t, continuousDimensionCutoff_nonneg f t⟩ + have hg : Continuous g := by + apply Continuous.subtype_mk + apply ContinuousMap.continuous_of_continuous_uncurry + change Continuous (fun p : ℝ × X => max (f p.2-p.1) 0) + fun_prop + have h0 : r < D.toFun (g 0).val := by + simpa only [g, continuousDimensionCutoff_zero f hf] using hr + have he := (hsc.comp hg) 0 r h0 + obtain ⟨δ, hδ, hball⟩ := Metric.mem_nhds_iff.mp he + refine ⟨δ/2, half_pos hδ, hball ?_⟩ + change dist (δ/2) (0 : ℝ) < δ + rw [Real.dist_eq, sub_zero, abs_of_pos (half_pos hδ)] + linarith + +variable [CompactSpace X] [NormalSpace X] [R1Space X] [MeasurableSpace X] [BorelSpace X] + +/-- The finite measure represents dimension on every positive support. +The proof uses genuine compact contents and lower semicontinuity, not an +assumed measure representation or finite-spectrum approximation. -/ +theorem measure_positive_support (hscale : D.ScaleInvariant) (hsc : D.ConeLowerSemicontinuous) + (f : C(X, ℝ)) (hf : 0 ≤ f) : + D.measure {x | 0 < f x} = ENNReal.ofReal (D.toFun f) := by + let U : Opens X := ⟨{x | 0 < f x}, isOpen_lt continuous_const f.continuous⟩ + change D.measure (U : Set X) = _ + apply le_antisymm + · rw [D.measure_open_eq_sup] + refine iSup₂_le fun K hK => ?_ + rw [← ENNReal.ofReal_toReal (show D.content K ≠ ∞ from ENNReal.coe_ne_top), D.content_toReal] + exact ENNReal.ofReal_le_ofReal (D.compactValue_le_of_pos hscale K f hf (fun x hx => hK hx)) + · have hl : D.toFun f ≤ (D.measure (U : Set X)).toReal := by + apply le_of_forall_lt + intro r hr + obtain ⟨t, ht, hrt⟩ := D.exists_positive_cutoff hsc f hf hr + let K : Compacts X := ⟨{x | t ≤ f x}, (isClosed_le continuous_const f.continuous).isCompact⟩ + have hKU : (K : Set X) ⊆ U := fun x hx => ht.trans_le hx + have hs : ∀ x, x ∉ K → continuousDimensionCutoff f t x = 0 := by + intro x hx + change max (f x-t) 0=0 + apply max_eq_right + have hx' : ¬t ≤ f x := hx + linarith + have hle := D.value_le_compactValue_of_support hscale K + (continuousDimensionCutoff f t) (continuousDimensionCutoff_nonneg f t) hs + have hm : D.compactValue K ≤ (D.measure (U : Set X)).toReal := by + rw [← D.content_toReal K, D.measure_open] + apply ENNReal.toReal_mono + · rw [← D.measure_open] + exact measure_ne_top _ _ + · exact D.content.le_innerContent K U hKU + exact hrt.trans_le (hle.trans hm) + calc + ENNReal.ofReal (D.toFun f) ≤ ENNReal.ofReal (D.measure (U : Set X)).toReal := + ENNReal.ofReal_le_ofReal hl + _ = _ := ENNReal.ofReal_toReal (measure_ne_top _ _) + +end PositiveDimensionFunctional +end Kaplansky + +end +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Cutoff.lean b/lean/OAI/Analysis/Cuntz/Cutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..b2203d07bee1c4afb1ec0874c63300ea0f20bc0b --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Cutoff.lean @@ -0,0 +1,224 @@ +import OAI.Analysis.Cuntz.State +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric + +namespace OAI + +noncomputable section + +/-! Functional calculus cutoffs and perturbation comparison. -/ + +open scoped Matrix CStarAlgebra Topology + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- The genuine continuous spectral cutoff (a-ε)₊. -/ +def cuntzCutoff (a : A) (ε : ℝ) : A := cfc (fun t : ℝ => max (t-ε) 0) a + +theorem cuntzCutoff_nonneg (a : A) (ε : ℝ) : 0 ≤ cuntzCutoff a ε := + cfc_nonneg fun _ _ => le_max_right _ _ + +theorem cuntzCutoff_le {a : A} (ha : 0 ≤ a) {ε : ℝ} (hε : 0 ≤ ε) : + cuntzCutoff a ε ≤ a := by + have h : cfc (fun t : ℝ => max (t-ε) 0) a ≤ cfc (fun t : ℝ => t) a := + cfc_mono fun t ht => max_le (sub_le_self t hε) (spectrum_nonneg_of_nonneg ha ht) + simpa only [cuntzCutoff, cfc_id' ℝ a ha.isSelfAdjoint] using h + +theorem cuntzCutoff_antitone (a : A) : Antitone (cuntzCutoff a) := by + intro ε δ h + exact cfc_mono fun _ _ => max_le_max_right 0 (sub_le_sub_left h _) + +/-- Uniform norm control, with the actual C*-norm. -/ +theorem norm_sub_cuntzCutoff_le {a : A} (ha : 0 ≤ a) {ε : ℝ} (hε : 0 ≤ ε) : + ‖a - cuntzCutoff a ε‖ ≤ ε := by + have he : cfc (fun t : ℝ => t - max (t-ε) 0) a = a - cuntzCutoff a ε := by + rw [cfc_sub (fun t : ℝ => t) (fun t => max (t-ε) 0) a, + cfc_id' ℝ a ha.isSelfAdjoint] + rfl + rw [← he] + apply norm_cfc_le hε + intro t ht + have ht0 := spectrum_nonneg_of_nonneg ha ht + rcases le_total ε t with h | h + · rw [max_eq_left (sub_nonneg.mpr h), sub_sub_cancel, Real.norm_of_nonneg hε] + · rw [max_eq_right (sub_nonpos.mpr h), sub_zero, Real.norm_of_nonneg ht0] + exact h + +/-- Norm comparison of positives is detected by all strictly positive +spectral cutoffs. This does not assume continuity of a dimension state. -/ +theorem cuntzLE_iff_all_cutoffs {n m : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) + (b : CStarMatrix (Fin m) (Fin m) A) : + CuntzLE (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm b) ↔ + ∀ ε : ℝ, 0 < ε → CuntzLE (CStarMatrix.ofMatrix.symm (cuntzCutoff a ε)) + (CStarMatrix.ofMatrix.symm b) := by + constructor + · intro h ε hε + exact (cuntzLE_of_nonneg_le (cuntzCutoff_nonneg a ε) (cuntzCutoff_le ha hε.le)).trans h + · intro h + apply (CuntzLE.iff_approx _ _).mpr + intro ε hε + obtain ⟨v, hv⟩ := (CuntzLE.iff_approx _ _).mp (h (ε/2) (half_pos hε)) (ε/2) (half_pos hε) + refine ⟨v, ?_⟩ + let q : CStarMatrix (Fin n) (Fin n) A := CStarMatrix.ofMatrix + (v * CStarMatrix.ofMatrix.symm b * v.conjTranspose) + change ‖a - q‖ < ε + have hv' : ‖cuntzCutoff a (ε/2) - q‖ < ε/2 := hv + calc + ‖a - q‖ ≤ ‖a - cuntzCutoff a (ε/2)‖ + ‖cuntzCutoff a (ε/2) - q‖ := by + simpa only [dist_eq_norm] using dist_triangle a (cuntzCutoff a (ε/2)) q + _ ≤ ε/2 + ‖cuntzCutoff a (ε/2) - q‖ := by + have hn := norm_sub_cuntzCutoff_le ha (half_pos hε).le + linarith + _ < ε := by linarith + +/-- The cutoff remains an actual positive matrix of the same finite size. -/ +def CuntzPositiveMatrix.cutoff (a : CuntzPositiveMatrix A) (ε : ℝ) : CuntzPositiveMatrix A := + ⟨a.size, CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a.matrix) ε), + cuntzCutoff_nonneg _ _⟩ + +theorem CuntzDimensionState.cutoff_value_antitone (d : CuntzDimensionState A) + (a : CuntzPositiveMatrix A) : Antitone (fun ε => d.value (a.cutoff ε)) := by + intro ε δ h + exact d.value_mono (cuntzLE_of_nonneg_le (cuntzCutoff_nonneg _ _) (cuntzCutoff_antitone _ h)) + +theorem CuntzDimensionState.cutoff_value_le (d : CuntzDimensionState A) + (a : CuntzPositiveMatrix A) {ε : ℝ} (hε : 0 ≤ ε) : d.value (a.cutoff ε) ≤ d.value a := + d.value_mono (cuntzLE_of_nonneg_le (cuntzCutoff_nonneg _ _) (cuntzCutoff_le a.nonneg hε)) + + +/-- Positive scalar multiplication is implemented by scalar conjugation. -/ +theorem cuntzLE_smul {n : ℕ} (a : CStarMatrix (Fin n) (Fin n) A) + {r : ℝ} (hr : 0 ≤ r) : + CuntzLE (CStarMatrix.ofMatrix.symm (r • a)) (CStarMatrix.ofMatrix.symm a) := by + let v : CStarMatrix (Fin n) (Fin n) A := Real.sqrt r • 1 + have h : v * a * star v = r • a := by + simp only [v, star_smul, star_trivial, star_one, smul_mul_assoc, one_mul, + mul_smul_comm, mul_one, smul_smul, Real.mul_self_sqrt hr] + have h' := CuntzLE.exact (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm v) + change CuntzLE (CStarMatrix.ofMatrix.symm (v * a * star v)) _ at h' + rwa [h] at h' + +theorem cuntzEquivalent_pos_smul {n : ℕ} (a : CStarMatrix (Fin n) (Fin n) A) + {r : ℝ} (hr : 0 < r) : + CuntzEquivalent (CStarMatrix.ofMatrix.symm (r • a)) (CStarMatrix.ofMatrix.symm a) := by + refine ⟨cuntzLE_smul a hr.le, ?_⟩ + simpa only [smul_smul, inv_mul_cancel₀ hr.ne', one_smul] using + cuntzLE_smul (r • a) (inv_nonneg.mpr hr.le) + + +/-- A cutoff square root localized above ε. The inequality is scalar +functional calculus in a single self-adjoint element. -/ +theorem exists_cutoff_localizer {a : A} (ha : 0 ≤ a) (ε : ℝ) : + ∃ x : A, star x = x ∧ x*x = cuntzCutoff a ε ∧ + ε • cuntzCutoff a ε ≤ x*a*x := by + let f : ℝ → ℝ := fun t => Real.sqrt (max (t-ε) 0) + let x := cfc f a + have hx : star x = x := (cfc_nonneg (f := f) (a := a) + (fun t _ => Real.sqrt_nonneg _) : 0 ≤ x).isSelfAdjoint.star_eq + have hsq : x*x = cuntzCutoff a ε := by + rw [← cfc_mul f f a] + exact cfc_congr fun t _ => Real.mul_self_sqrt (le_max_right _ _) + refine ⟨x, hx, hsq, ?_⟩ + have hid := cfc_id' ℝ a ha.isSelfAdjoint + change ε • cfc (fun t : ℝ => max (t-ε) 0) a ≤ cfc f a * a * cfc f a + have he : cfc (fun t => f t * t * f t) a = cfc f a * a * cfc f a := by + rw [cfc_mul (fun t => f t * t) f a, cfc_mul f (fun t : ℝ => t) a, hid] + rw [← he, ← cfc_const_mul ε (fun t : ℝ => max (t-ε) 0) a] + refine cfc_mono (hf := by fun_prop) (hg := by dsimp [f]; fun_prop) ?_ + intro t ht + have he : f t * t * f t = t * max (t-ε) 0 := by + calc + f t * t * f t = t * (f t * f t) := by ring + _ = t * max (t-ε) 0 := by rw [show f t * f t = max (t-ε) 0 from Real.mul_self_sqrt (le_max_right _ _)] + rw [he] + rcases le_total t ε with h | h + · rw [max_eq_right (sub_nonpos.mpr h)]; simp + · exact mul_le_mul_of_nonneg_right h (le_max_right _ _) + +/-- A strict norm perturbation gives cutoff Cuntz comparison. +No operator monotonicity of the positive-part function is used. -/ +theorem cuntzLE_cutoff_of_norm_sub_lt {n : ℕ} + {a b : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) (hb : IsSelfAdjoint b) + {ε : ℝ} (h : ‖a-b‖ < ε) : + CuntzLE (CStarMatrix.ofMatrix.symm (cuntzCutoff a ε)) + (CStarMatrix.ofMatrix.symm b) := by + let δ := ‖a-b‖ + have hδ : 0 < ε-δ := sub_pos.mpr h + have hab : a ≤ b + δ • 1 := by + have he := (ha.isSelfAdjoint.sub hb).le_algebraMap_norm_self + rw [Algebra.algebraMap_eq_smul_one] at he + exact sub_le_iff_le_add'.mp he + obtain ⟨x, hx, hsq, hloc⟩ := exists_cutoff_localizer ha ε + have hc := star_left_conjugate_le_conjugate hab x + simp only [hx, mul_add, add_mul, mul_smul_comm, smul_mul_assoc, mul_one, hsq] at hc + have hbound : (ε-δ) • cuntzCutoff a ε ≤ x*b*x := by + rw [sub_smul] + exact sub_le_iff_le_add.mpr (hloc.trans hc) + have hpos : 0 ≤ (ε-δ) • cuntzCutoff a ε := smul_nonneg hδ.le (cuntzCutoff_nonneg a ε) + have hcmp := cuntzLE_of_nonneg_le hpos hbound + have hsc := cuntzEquivalent_pos_smul (cuntzCutoff a ε) hδ + have hex := CuntzLE.exact (CStarMatrix.ofMatrix.symm b) (CStarMatrix.ofMatrix.symm x) + change CuntzLE (CStarMatrix.ofMatrix.symm (x*b*star x)) _ at hex + rw [hx] at hex + exact hsc.2.trans (hcmp.trans hex) + + +/-- Every positive cutoff of a Cuntz-smaller matrix is already below a +strictly positive cutoff of the larger matrix, including unequal sizes. -/ +theorem CuntzLE.exists_cutoff {n m : ℕ} + {a : CStarMatrix (Fin n) (Fin n) A} {b : CStarMatrix (Fin m) (Fin m) A} + (ha : 0 ≤ a) (hb : 0 ≤ b) + (h : CuntzLE (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm b)) + {ε : ℝ} (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ CuntzLE (CStarMatrix.ofMatrix.symm (cuntzCutoff a ε)) + (CStarMatrix.ofMatrix.symm (cuntzCutoff b δ)) := by + obtain ⟨v, hv⟩ := (CuntzLE.iff_approx _ _).mp h (ε/2) (half_pos hε) + let g : CStarMatrix (Fin m) (Fin m) A → CStarMatrix (Fin n) (Fin n) A := + fun y => CStarMatrix.ofMatrix (v * CStarMatrix.ofMatrix.symm y * v.conjTranspose) + have hg : Continuous g := + (continuous_const.matrix_mul continuous_id).matrix_mul continuous_const + obtain ⟨η, hη, hclose⟩ := Metric.continuousAt_iff.mp hg.continuousAt (ε/2) (half_pos hε) + let δ := η/2 + have hδ : 0 < δ := half_pos hη + have hdist : dist (cuntzCutoff b δ) b < η := by + rw [dist_eq_norm, norm_sub_rev] + exact (norm_sub_cuntzCutoff_le hb hδ.le).trans_lt (half_lt_self hη) + have hgb : ‖g (cuntzCutoff b δ) - g b‖ < ε/2 := by + simpa only [dist_eq_norm] using hclose hdist + have hab : ‖a - g (cuntzCutoff b δ)‖ < ε := by + have hv' : ‖a - g b‖ < ε/2 := hv + have ht : ‖a - g (cuntzCutoff b δ)‖ ≤ ‖a - g b‖ + ‖g b - g (cuntzCutoff b δ)‖ := by + simpa only [dist_eq_norm] using dist_triangle a (g b) (g (cuntzCutoff b δ)) + rw [norm_sub_rev (g b)] at ht + linarith + have hsa : IsSelfAdjoint (g (cuntzCutoff b δ)) := by + have hs : (CStarMatrix.ofMatrix.symm (cuntzCutoff b δ)).conjTranspose = + CStarMatrix.ofMatrix.symm (cuntzCutoff b δ) := + (cuntzCutoff_nonneg b δ).isSelfAdjoint.star_eq + change (v * CStarMatrix.ofMatrix.symm (cuntzCutoff b δ) * v.conjTranspose).conjTranspose = + v * CStarMatrix.ofMatrix.symm (cuntzCutoff b δ) * v.conjTranspose + simp only [Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, hs, Matrix.mul_assoc] + refine ⟨δ, hδ, (cuntzLE_cutoff_of_norm_sub_lt ha hsa hab).trans ?_⟩ + exact CuntzLE.exact _ v + +/-- The cutoff quantifiers characterize the original norm-closure relation. -/ +theorem cuntzLE_iff_cutoff_comparison (a b : CuntzPositiveMatrix A) : + CuntzLE a.matrix b.matrix ↔ ∀ ε : ℝ, 0 < ε → ∃ δ : ℝ, 0 < δ ∧ + CuntzLE (a.cutoff ε).matrix (b.cutoff δ).matrix := by + constructor + · intro h ε hε + exact h.exists_cutoff a.nonneg b.nonneg hε + · intro h + apply (cuntzLE_iff_all_cutoffs (CStarMatrix.ofMatrix a.matrix) a.nonneg + (CStarMatrix.ofMatrix b.matrix)).mpr + intro ε hε + obtain ⟨δ, hδ, hc⟩ := h ε hε + exact hc.trans (cuntzLE_of_nonneg_le (cuntzCutoff_nonneg _ _) (cuntzCutoff_le b.nonneg hδ.le)) + +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Distribution.lean b/lean/OAI/Analysis/Cuntz/Distribution.lean new file mode 100644 index 0000000000000000000000000000000000000000..48e0988c8398215ec7945754954da683b236cc3a --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Distribution.lean @@ -0,0 +1,226 @@ +import OAI.Analysis.Cuntz.RegularizedState +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic + +namespace OAI + +noncomputable section + +/-! Spectral distributions, integrals, and scalar covariance. -/ + +open scoped Matrix CStarAlgebra +open MeasureTheory + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- A positive cutoff vanishes above the actual spectral norm bound. -/ +theorem cuntzCutoff_eq_zero_of_norm_le {a : A} (ha : 0 ≤ a) {ε : ℝ} (hε : ‖a‖ ≤ ε) : + cuntzCutoff a ε = 0 := by + nontriviality A + change cfc (fun t : ℝ => max (t-ε) 0) a = 0 + rw [← cfc_zero ℝ a] + apply cfc_congr + intro t ht + have h : t ≤ ε := by + simpa only [Real.norm_of_nonneg (spectrum_nonneg_of_nonneg ha ht)] using + (spectrum.norm_le_norm_of_mem ht).trans hε + exact max_eq_right (sub_nonpos.mpr h) + +theorem cuntzCutoff_one_of_lt {t : ℝ} (ht : t < 1) : + cuntzCutoff (1 : A) t = (1 - t) • (1 : A) := by + have h := cfc_algebraMap (A := A) (1 : ℝ) (fun x : ℝ => max (x - t) 0) + simpa only [cuntzCutoff, map_one, max_eq_left (sub_nonneg.mpr ht.le), + Algebra.algebraMap_eq_smul_one] using h + +namespace CuntzDimensionState + +theorem regularized_of_matrix_eq_zero (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + (ha : a.matrix = 0) : d.regularized a = 0 := by + rw [← d.regularized_zero] + apply d.regularized_eq + change CuntzEquivalent a.matrix (0 : Matrix (Fin 0) (Fin 0) A) + rw [ha] + exact ⟨CuntzLE.zero _, CuntzLE.zero _⟩ + +/-- The regularized spectral distribution attached to an actual positive matrix. -/ +def distribution (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) (t : ℝ) : ℝ := + d.regularized (a.cutoff t) + +theorem distribution_antitone (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + Antitone (d.distribution a) := by + intro s t h + exact d.regularized_mono (a := a.cutoff t) (b := a.cutoff s) + (cuntzLE_of_nonneg_le (cuntzCutoff_nonneg _ _) (cuntzCutoff_antitone _ h)) + +theorem distribution_nonneg (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) (t : ℝ) : + 0 ≤ d.distribution a t := d.regularized_nonneg _ + +theorem distribution_le_size (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) (t : ℝ) : + d.distribution a t ≤ a.size := d.regularized_le_size _ + +theorem distribution_eq_zero (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {t : ℝ} (ht : ‖CStarMatrix.ofMatrix a.matrix‖ ≤ t) : d.distribution a t = 0 := by + apply d.regularized_of_matrix_eq_zero + change CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a.matrix) t) = 0 + rw [cuntzCutoff_eq_zero_of_norm_le a.nonneg ht] + rfl + +theorem distribution_intervalIntegrable (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + (s t : ℝ) : IntervalIntegrable (d.distribution a) volume s t := + (d.distribution_antitone a).intervalIntegrable + +theorem distribution_add (d : CuntzDimensionState A) (a b : CuntzPositiveMatrix A) (t : ℝ) : + d.distribution (a.add b) t = d.distribution a t + d.distribution b t := by + simp only [distribution, CuntzPositiveMatrix.cutoff_add, d.regularized_add] + +/-- Finite layer-cake integral. This definition does not assert the quasitrace axioms. -/ +def spectralValue (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : ℝ := + ∫ t in (0 : ℝ)..‖CStarMatrix.ofMatrix a.matrix‖, d.distribution a t + +theorem spectralValue_nonneg (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + 0 ≤ d.spectralValue a := + intervalIntegral.integral_nonneg_of_forall (norm_nonneg _) (d.distribution_nonneg a) + +theorem spectralValue_le_norm_mul_size (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + d.spectralValue a ≤ ‖CStarMatrix.ofMatrix a.matrix‖ * a.size := by + have h := intervalIntegral.integral_mono_on (norm_nonneg (CStarMatrix.ofMatrix a.matrix)) + (d.distribution_intervalIntegrable a 0 _) intervalIntegrable_const + (fun t _ => d.distribution_le_size a t) + simpa only [spectralValue, intervalIntegral.integral_const, sub_zero, smul_eq_mul] using h + + +/-- The layer-cake integral is independent of an upper endpoint past the norm. -/ +theorem spectralValue_eq_integral (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {R : ℝ} (hR : ‖CStarMatrix.ofMatrix a.matrix‖ ≤ R) : + d.spectralValue a = ∫ t in (0 : ℝ)..R, d.distribution a t := by + have he : (∫ t in ‖CStarMatrix.ofMatrix a.matrix‖..R, d.distribution a t) = 0 := by + have h := intervalIntegral.integral_congr_Ioo_of_le (μ := volume) hR + (g := fun _ : ℝ => (0 : ℝ)) (fun t ht => d.distribution_eq_zero a ht.1.le) + simpa using h + have h := intervalIntegral.integral_add_adjacent_intervals + (d.distribution_intervalIntegrable a 0 ‖CStarMatrix.ofMatrix a.matrix‖) + (d.distribution_intervalIntegrable a ‖CStarMatrix.ofMatrix a.matrix‖ R) + rw [he, add_zero] at h + exact h + +/-- Block addition is preserved by the finite spectral integral. -/ +theorem spectralValue_add (d : CuntzDimensionState A) (a b : CuntzPositiveMatrix A) : + d.spectralValue (a.add b) = d.spectralValue a + d.spectralValue b := by + let R := ‖CStarMatrix.ofMatrix (a.add b).matrix‖ + + ‖CStarMatrix.ofMatrix a.matrix‖ + ‖CStarMatrix.ofMatrix b.matrix‖ + have ha : ‖CStarMatrix.ofMatrix a.matrix‖ ≤ R := by + dsimp [R] + linarith [norm_nonneg (CStarMatrix.ofMatrix (a.add b).matrix), + norm_nonneg (CStarMatrix.ofMatrix a.matrix), norm_nonneg (CStarMatrix.ofMatrix b.matrix)] + have hb : ‖CStarMatrix.ofMatrix b.matrix‖ ≤ R := by + dsimp [R] + linarith [norm_nonneg (CStarMatrix.ofMatrix (a.add b).matrix), + norm_nonneg (CStarMatrix.ofMatrix a.matrix), norm_nonneg (CStarMatrix.ofMatrix b.matrix)] + have hab : ‖CStarMatrix.ofMatrix (a.add b).matrix‖ ≤ R := by + dsimp [R] + linarith [norm_nonneg (CStarMatrix.ofMatrix (a.add b).matrix), + norm_nonneg (CStarMatrix.ofMatrix a.matrix), norm_nonneg (CStarMatrix.ofMatrix b.matrix)] + rw [d.spectralValue_eq_integral _ hab, d.spectralValue_eq_integral _ ha, + d.spectralValue_eq_integral _ hb] + simp_rw [d.distribution_add] + exact intervalIntegral.integral_add (d.distribution_intervalIntegrable a 0 R) + (d.distribution_intervalIntegrable b 0 R) + +/-- A normalized dimension state forces the underlying algebra to be nonzero. -/ +theorem nontrivial (d : CuntzDimensionState A) : Nontrivial A := by + rcases subsingleton_or_nontrivial A with h | h + · let := h + have he := d.regularized_of_matrix_eq_zero (.unit 1) (Subsingleton.elim _ _) + rw [d.regularized_unit] at he + norm_num at he + · exact h + +theorem distribution_unit_of_lt (d : CuntzDimensionState A) (n : ℕ) {t : ℝ} (ht : t < 1) : + d.distribution (.unit n) t = (n : ℝ) := by + have hp : 0 < 1-t := sub_pos.mpr ht + have he := cuntzCutoff_one_of_lt (A := CStarMatrix (Fin n) (Fin n) A) ht + rw [← d.regularized_unit n] + apply d.regularized_eq + change CuntzEquivalent (CStarMatrix.ofMatrix.symm + (cuntzCutoff (1 : CStarMatrix (Fin n) (Fin n) A) t)) (1 : Matrix (Fin n) (Fin n) A) + rw [he] + exact cuntzEquivalent_pos_smul 1 hp + +/-- The finite spectral integral has exactly the required matrix-unit values. -/ +theorem spectralValue_unit (d : CuntzDimensionState A) (n : ℕ) : + d.spectralValue (.unit n) = (n : ℝ) := by + by_cases hn : n = 0 + · subst n + have h := d.spectralValue_le_norm_mul_size (.unit 0) + have hp := d.spectralValue_nonneg (.unit 0) + change d.spectralValue (.unit 0) ≤ ‖CStarMatrix.ofMatrix (CuntzPositiveMatrix.unit (A := A) 0).matrix‖ * ((0 : ℕ) : ℝ) at h + rw [Nat.cast_zero, mul_zero] at h + simpa only [Nat.cast_zero] using le_antisymm h hp + · let := d.nontrivial + let : Nonempty (Fin n) := Fin.pos_iff_nonempty.mp (Nat.pos_of_ne_zero hn) + change (∫ t in (0 : ℝ)..‖(1 : CStarMatrix (Fin n) (Fin n) A)‖, + d.distribution (.unit n) t) = _ + rw [norm_one] + have he := intervalIntegral.integral_congr_Ioo_of_le (μ := volume) (by norm_num : (0 : ℝ) ≤ 1) + (f := d.distribution (.unit n)) (g := fun _ : ℝ => (n : ℝ)) + (fun t ht => d.distribution_unit_of_lt n ht.2) + simpa using he + +end CuntzDimensionState + +/-- Scaling the element rescales the spectral threshold. -/ +theorem cuntzCutoff_pos_smul {a : A} (ha : 0 ≤ a) {r : ℝ} (hr : 0 < r) (t : ℝ) : + cuntzCutoff (r • a) t = r • cuntzCutoff a (t/r) := by + unfold cuntzCutoff + rw [← cfc_comp_const_mul r (fun s : ℝ => max (s-t) 0) a (ha := ha.isSelfAdjoint), + ← cfc_const_mul r (fun s : ℝ => max (s-t/r) 0) a] + apply cfc_congr + intro s hs + dsimp only + rw [mul_max_of_nonneg _ _ hr.le, mul_zero, mul_sub, mul_div_cancel₀ _ hr.ne'] + +/-- Nonnegative scalar multiplication of a positive finite matrix. -/ +def CuntzPositiveMatrix.scale (a : CuntzPositiveMatrix A) (r : ℝ) (hr : 0 ≤ r) : + CuntzPositiveMatrix A := + ⟨a.size, CStarMatrix.ofMatrix.symm (r • CStarMatrix.ofMatrix a.matrix), + smul_nonneg hr a.nonneg⟩ + +namespace CuntzDimensionState + +theorem distribution_pos_scale (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {r : ℝ} (hr : 0 < r) (t : ℝ) : + d.distribution (a.scale r hr.le) t = d.distribution a (t/r) := by + apply d.regularized_eq + have he := cuntzCutoff_pos_smul a.nonneg hr t + have hc := cuntzEquivalent_pos_smul + (cuntzCutoff (CStarMatrix.ofMatrix a.matrix) (t / r)) hr + exact Eq.mpr (congrArg (fun c => CuntzEquivalent (CStarMatrix.ofMatrix.symm c) + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a.matrix) (t / r)))) he) hc + +/-- The integral scales with the positive scalar, including zero. -/ +theorem spectralValue_scale (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + (r : ℝ) (hr : 0 ≤ r) : + d.spectralValue (a.scale r hr) = r * d.spectralValue a := by + rcases eq_or_lt_of_le hr with h | h + · subst r + have hn : ‖CStarMatrix.ofMatrix (a.scale 0 hr).matrix‖ = 0 := by + change ‖(0 : ℝ) • CStarMatrix.ofMatrix a.matrix‖ = 0 + rw [zero_smul, norm_zero] + simp only [spectralValue, hn, intervalIntegral.integral_same, zero_mul] + · let : NormedSpace ℝ (CStarMatrix (Fin a.size) (Fin a.size) A) := + NormedSpace.restrictScalars ℝ ℂ _ + let : NormSMulClass ℝ (CStarMatrix (Fin a.size) (Fin a.size) A) := + NormedSpace.toNormSMulClass + change (∫ t in (0 : ℝ)..‖r • CStarMatrix.ofMatrix a.matrix‖, + d.distribution (a.scale r hr) t) = _ + simp_rw [d.distribution_pos_scale a h] + rw [norm_smul, Real.norm_of_nonneg hr, intervalIntegral.integral_comp_div _ h.ne'] + simp only [zero_div, mul_div_cancel_left₀ _ h.ne', smul_eq_mul, spectralValue] + +end CuntzDimensionState +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Measure.lean b/lean/OAI/Analysis/Cuntz/Measure.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c3f99b6091ebade39615ae4e7a1092c08282a38 --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Measure.lean @@ -0,0 +1,283 @@ +import OAI.Analysis.Cuntz.Commutative +import OAI.Analysis.Cuntz.Spectral +import Mathlib.MeasureTheory.Function.LocallyIntegrable +import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap +import Mathlib.MeasureTheory.Integral.Layercake + +namespace OAI + +noncomputable section + +/-! Real functional calculus and signed and complex spectral measures. -/ + +open scoped Matrix CStarAlgebra ComplexOrder +open Set MeasureTheory TopologicalSpace + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +attribute [local instance] matrixRealFunctionalCalculus matrixNonUnitalRealFunctionalCalculus matrixNonnegSpectrum +variable {X : Type*} [TopologicalSpace X] + +/-- Real continuous functions viewed inside the complex function algebra. -/ +def continuousRealInclusion : C(X, ℝ) →⋆ₐ[ℝ] C(X, ℂ) where + toFun f := ⟨fun x => (f x : ℂ), by fun_prop⟩ + map_zero' := by ext x; simp + map_one' := by ext x; simp + map_add' f g := by ext x; simp + map_mul' f g := by ext x; simp + commutes' r := by ext x; simp [Algebra.algebraMap_eq_smul_one] + map_star' f := by ext x; simp + +@[simp] theorem continuousRealInclusion_apply (f : C(X, ℝ)) (x : X) : + continuousRealInclusion f x = (f x : ℂ) := rfl + +variable [CompactSpace X] + +local instance continuousMapRealFunctionalCalculus : + ContinuousFunctionalCalculus ℝ C(X, ℂ) IsSelfAdjoint := + IsSelfAdjoint.instContinuousFunctionalCalculus + +theorem continuous_continuousRealInclusion : Continuous (continuousRealInclusion (X := X)) := by + apply ContinuousMap.continuous_of_continuous_uncurry + change Continuous (fun p : C(X, ℝ) × X => (p.1 p.2 : ℂ)) + fun_prop + +theorem continuousRealInclusion_cutoff (f : C(X, ℝ)) (hf : 0 ≤ f) (t : ℝ) : + cuntzCutoff (continuousRealInclusion f) t = + continuousRealInclusion (continuousDimensionCutoff f t) := by + ext x + have hsa : IsSelfAdjoint (continuousRealInclusion f) := (map_nonneg continuousRealInclusion hf).isSelfAdjoint + have hsax : IsSelfAdjoint (continuousRealInclusion f x) := by + change star (f x : ℂ) = (f x : ℂ) + simp + have h := (ContinuousMap.evalStarAlgHom ℂ ℂ x).map_cfc + (fun s : ℝ => max (s-t) 0) (continuousRealInclusion f) (ha := hsa) (hφa := hsax) + change (cfc (fun s : ℝ => max (s-t) 0) (continuousRealInclusion f)) x = _ at h + change (cfc (fun s : ℝ => max (s-t) 0) (continuousRealInclusion f)) x = _ + rw [h] + exact cfc_algebraMap (A := ℂ) (f x) (fun s : ℝ => max (s-t) 0) + +variable {A : Type*} [CStarAlgebra A] {n : ℕ} + +/-- The real function algebra mapped into the ambient finite matrix algebra. -/ +def realFunctionHom (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : + C(X, ℝ) →⋆ₐ[ℝ] CStarMatrix (Fin n) (Fin n) A := + (ψ.restrictScalars ℝ).comp continuousRealInclusion + +theorem realFunctionHom_continuous (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : + Continuous (realFunctionHom ψ) := by + have hψ : Continuous ψ := by fun_prop + exact hψ.comp continuous_continuousRealInclusion + +/-- Genuine CFC naturality identifies the image of a scalar cutoff. -/ +theorem realFunctionHom_cutoff (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) (hf : 0 ≤ f) (t : ℝ) : + realFunctionHom ψ (continuousDimensionCutoff f t) = cuntzCutoff (realFunctionHom ψ f) t := by + change ψ (continuousRealInclusion (continuousDimensionCutoff f t)) = _ + rw [← continuousRealInclusion_cutoff f hf t] + exact ψ.map_cfc (fun s : ℝ => max (s-t) 0) (continuousRealInclusion f) + (ha := (map_nonneg continuousRealInclusion hf).isSelfAdjoint) + (hφa := (map_nonneg ψ (map_nonneg continuousRealInclusion hf)).isSelfAdjoint) + +section Measures +variable [NormalSpace X] [R1Space X] [MeasurableSpace X] [BorelSpace X] +namespace CuntzDimensionState + +/-- The single finite Borel measure associated with a commutative representation. -/ +def spectralMeasure (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : Measure X := + (d.continuousDimension (realFunctionHom ψ)).measure + +instance spectralMeasure_finite (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : IsFiniteMeasure (d.spectralMeasure ψ) := + inferInstanceAs (IsFiniteMeasure (d.continuousDimension (realFunctionHom ψ)).measure) + +theorem spectralMeasure_lt (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) (hf : 0 ≤ f) (t : ℝ) : + d.spectralMeasure ψ {x | t < f x} = ENNReal.ofReal + (d.distribution ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ f), map_nonneg (realFunctionHom ψ) hf⟩ t) := by + have he : {x | t < f x} = {x | 0 < continuousDimensionCutoff f t x} := by + ext x + simp only [continuousDimensionCutoff, ContinuousMap.coe_mk, lt_max_iff, lt_self_iff_false, or_false] + exact (sub_pos : 0 < f x-t ↔ t < f x).symm + rw [he] + change (d.continuousDimension (realFunctionHom ψ)).measure _ = _ + rw [d.continuousDimension_measure_positive_support _ (realFunctionHom_continuous ψ) + _ (continuousDimensionCutoff_nonneg f t)] + congr 1 + apply d.regularized_eq + change CuntzEquivalent (CStarMatrix.ofMatrix.symm (realFunctionHom ψ (continuousDimensionCutoff f t))) + (CStarMatrix.ofMatrix.symm (cuntzCutoff (realFunctionHom ψ f) t)) + rw [realFunctionHom_cutoff ψ f hf] + exact .refl _ + +theorem spectralMeasure_real_lt (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) (hf : 0 ≤ f) (t : ℝ) : + (d.spectralMeasure ψ).real {x | t < f x} = + d.distribution ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ f), map_nonneg (realFunctionHom ψ) hf⟩ t := by + rw [measureReal_def, d.spectralMeasure_lt ψ f hf, ENNReal.toReal_ofReal (d.distribution_nonneg _ _)] + +/-- The original finite spectral integral equals the integral against the +constructed measure. No new choice of positive functional is made. -/ +theorem spectralValue_eq_measure_integral (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) (hf : 0 ≤ f) : + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ f), map_nonneg (realFunctionHom ψ) hf⟩ = + ∫ x, f x ∂(d.spectralMeasure ψ) := by + let p : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ f), map_nonneg (realFunctionHom ψ) hf⟩ + have hi : Integrable f (d.spectralMeasure ψ) := + f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f) + rw [hi.integral_eq_integral_meas_lt (Filter.Eventually.of_forall hf)] + simp_rw [d.spectralMeasure_real_lt ψ f hf] + change d.spectralValue p = ∫ t in Ioi 0, d.distribution p t + rw [spectralValue, intervalIntegral.integral_of_le (norm_nonneg _)] + symm + apply setIntegral_eq_of_subset_of_forall_sdiff_eq_zero measurableSet_Ioi Ioc_subset_Ioi_self + intro t ht + apply d.distribution_eq_zero + have h : ¬t ≤ ‖CStarMatrix.ofMatrix p.matrix‖ := by + intro hle + exact ht.2 ⟨ht.1, hle⟩ + exact (lt_of_not_ge h).le + +/-- Additivity of the EXISTING spectral value on positive functions in one +commutative representation, as a consequence of actual measure integration. -/ +theorem spectralValue_realFunction_add (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f g : C(X, ℝ)) (hf : 0 ≤ f) (hg : 0 ≤ g) : + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ (f+g)), map_nonneg (realFunctionHom ψ) (add_nonneg hf hg)⟩ = + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ f), map_nonneg (realFunctionHom ψ) hf⟩ + + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (realFunctionHom ψ g), map_nonneg (realFunctionHom ψ) hg⟩ := by + rw [d.spectralValue_eq_measure_integral ψ (f+g) (add_nonneg hf hg), + d.spectralValue_eq_measure_integral ψ f hf, d.spectralValue_eq_measure_integral ψ g hg] + exact integral_add + (f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f)) + (g.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace g)) + +end CuntzDimensionState +end Measures + +omit [CompactSpace X] in +/-- All real-valued functions give self-adjoint elements, regardless of sign. -/ +theorem continuousRealInclusion_selfAdjoint (f : C(X, ℝ)) : + IsSelfAdjoint (continuousRealInclusion f) := by + change star (continuousRealInclusion f) = continuousRealInclusion f + ext x + simp + +theorem continuousRealInclusion_posPart (f : C(X, ℝ)) : + (continuousRealInclusion f)⁺ = continuousRealInclusion (continuousDimensionCutoff f 0) := by + rw [CFC.posPart_def, cfcₙ_eq_cfc] + ext x + have hs := continuousRealInclusion_selfAdjoint f + have hsx : IsSelfAdjoint (continuousRealInclusion f x) := by + change star (f x : ℂ) = (f x : ℂ) + simp + have h := (ContinuousMap.evalStarAlgHom ℂ ℂ x).map_cfc (fun s : ℝ => s⁺) + (continuousRealInclusion f) (ha := hs) (hφa := hsx) + change (cfc (fun s : ℝ => s⁺) (continuousRealInclusion f)) x = _ + change (cfc (fun s : ℝ => s⁺) (continuousRealInclusion f)) x = _ at h + rw [h] + have he := cfc_algebraMap (A := ℂ) (f x) (fun s : ℝ => s⁺) + change cfc (fun s : ℝ => s⁺) (f x : ℂ) = ((max (f x-0) 0 : ℝ) : ℂ) + rw [sub_zero] + exact he + + +theorem realFunctionHom_selfAdjoint (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) : IsSelfAdjoint (realFunctionHom ψ f) := + (continuousRealInclusion_selfAdjoint f).map ψ + +theorem realFunctionHom_posPart (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) : + (realFunctionHom ψ f)⁺ = realFunctionHom ψ (continuousDimensionCutoff f 0) := by + change (ψ (continuousRealInclusion f))⁺ = ψ (continuousRealInclusion (continuousDimensionCutoff f 0)) + rw [← continuousRealInclusion_posPart f] + exact (ψ.toNonUnitalStarAlgHom.map_cfcₙ (fun s : ℝ => s⁺) (continuousRealInclusion f) + (ha := continuousRealInclusion_selfAdjoint f) (hφa := realFunctionHom_selfAdjoint ψ f)).symm + +theorem realFunctionHom_negPart (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) + (f : C(X, ℝ)) : + (realFunctionHom ψ f)⁻ = realFunctionHom ψ (continuousDimensionCutoff (-f) 0) := by + rw [← CFC.posPart_neg, ← map_neg, realFunctionHom_posPart] + +omit [CompactSpace X] in +theorem continuousDimensionCutoff_sub (f : C(X, ℝ)) : + continuousDimensionCutoff f 0 - continuousDimensionCutoff (-f) 0 = f := by + ext x + change max (f x-0) 0 - max (-f x-0) 0 = f x + simp only [sub_zero] + rcases le_total 0 (f x) with h | h + · rw [max_eq_left h, max_eq_right (neg_nonpos.mpr h), sub_zero] + · rw [max_eq_right h, max_eq_left (neg_nonneg.mpr h)] + ring + +section Measures +variable [NormalSpace X] [R1Space X] [MeasurableSpace X] [BorelSpace X] +namespace CuntzDimensionState + +/-- The canonical signed extension agrees with the same measure on all real +continuous functions, including those of mixed sign. -/ +theorem signedValue_eq_measure_integral (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) (f : C(X, ℝ)) : + d.signedValue (realFunctionHom ψ f) = ∫ x, f x ∂(d.spectralMeasure ψ) := by + unfold signedValue + simp only [realFunctionHom_posPart, realFunctionHom_negPart, positiveValue] + rw [d.spectralValue_eq_measure_integral ψ _ (continuousDimensionCutoff_nonneg f 0), + d.spectralValue_eq_measure_integral ψ _ (continuousDimensionCutoff_nonneg (-f) 0)] + rw [← integral_sub + ((continuousDimensionCutoff f 0).continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _)) + ((continuousDimensionCutoff (-f) 0).continuous.integrable_of_hasCompactSupport + (HasCompactSupport.of_compactSpace _))] + apply integral_congr_ae + exact Filter.Eventually.of_forall (fun x => congrArg (fun g : C(X, ℝ) => g x) (continuousDimensionCutoff_sub f)) + + +/-- The globally fixed complex spectral value agrees with the same finite +measure on EVERY complex continuous function in the representation. -/ +theorem complexValue_eq_measure_integral (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) (f : C(X, ℂ)) : + d.complexValue (ψ f) = ∫ x, f x ∂(d.spectralMeasure ψ) := by + let fr : C(X, ℝ) := ⟨fun x => (f x).re, by fun_prop⟩ + let fi : C(X, ℝ) := ⟨fun x => (f x).im, by fun_prop⟩ + have he : f = continuousRealInclusion fr + Complex.I • continuousRealInclusion fi := by + ext x + apply Complex.ext <;> simp [fr, fi] + have hψ : ψ f = realFunctionHom ψ fr + Complex.I • realFunctionHom ψ fi := by + conv_lhs => rw [he, map_add, map_smul] + rfl + rw [hψ, d.complexValue_real_imag _ _ (realFunctionHom_selfAdjoint ψ fr) + (realFunctionHom_selfAdjoint ψ fi), + d.complexValue_selfAdjoint (realFunctionHom_selfAdjoint ψ fr), + d.complexValue_selfAdjoint (realFunctionHom_selfAdjoint ψ fi), + d.signedValue_eq_measure_integral ψ fr, d.signedValue_eq_measure_integral ψ fi] + have hi : Integrable f (d.spectralMeasure ψ) := + f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f) + rw [mul_comm Complex.I] + exact integral_re_add_im hi + +/-- Complex linearity for the original spectral value composed with a +commutative representation. Agreement is pointwise, ensuring overlap consistency. -/ +def complexValueLinearMap (d : CuntzDimensionState A) {n : ℕ} + (ψ : C(X, ℂ) →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : C(X, ℂ) →ₗ[ℂ] ℂ where + toFun f := d.complexValue (ψ f) + map_add' f g := by + rw [d.complexValue_eq_measure_integral ψ (f+g), + d.complexValue_eq_measure_integral ψ f, d.complexValue_eq_measure_integral ψ g] + exact integral_add + (f.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f)) + (g.continuous.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace g)) + map_smul' r f := by + rw [d.complexValue_eq_measure_integral ψ (r • f), d.complexValue_eq_measure_integral ψ f] + exact integral_smul r _ + +end CuntzDimensionState +end Measures +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Monoid.lean b/lean/OAI/Analysis/Cuntz/Monoid.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d22aa08a3cbc07ba4c945c11558e80fcc9ac37c --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Monoid.lean @@ -0,0 +1,219 @@ +import OAI.Analysis.Cuntz.Comparison +import OAI.Analysis.Quasitrace.Infiniteness +import Mathlib.Algebra.Order.Monoid.Defs +import Mathlib.Analysis.Normed.Ring.Units +import Mathlib.Order.Antisymmetrization + +namespace OAI + +/-! The ordered Cuntz monoid and compression by its order unit. -/ + +noncomputable section +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- The ordered Cuntz monoid of actual positive finite matrices over A. +The order is rectangular norm comparison, not an assumed abstract relation. -/ +abbrev CuntzMonoid (A : Type*) [CStarAlgebra A] := + Antisymmetrization (CuntzPositiveMatrix A) (· ≤ ·) + +def cuntzClass (a : CuntzPositiveMatrix A) : CuntzMonoid A := + toAntisymmetrization (· ≤ ·) a + +theorem cuntzClass_le (a b : CuntzPositiveMatrix A) : + cuntzClass a ≤ cuntzClass b ↔ CuntzLE a.matrix b.matrix := + toAntisymmetrization_le_toAntisymmetrization_iff + +theorem cuntzClass_eq (a b : CuntzPositiveMatrix A) : + cuntzClass a = cuntzClass b ↔ CuntzEquivalent a.matrix b.matrix := by + rw [le_antisymm_iff, cuntzClass_le, cuntzClass_le] + rfl + +instance : Zero (CuntzMonoid A) := ⟨cuntzClass .zero⟩ +instance : Add (CuntzMonoid A) where + add := Quotient.map₂ CuntzPositiveMatrix.add (fun _ _ ha _ _ hb => + ⟨CuntzPositiveMatrix.add_le_add ha.1 hb.1, CuntzPositiveMatrix.add_le_add ha.2 hb.2⟩) + +@[simp] theorem cuntzClass_add (a b : CuntzPositiveMatrix A) : + cuntzClass (a.add b) = cuntzClass a + cuntzClass b := rfl + +instance : AddCommMonoid (CuntzMonoid A) where + add_assoc a b c := by + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => + induction c using Quotient.inductionOn with | h c => + apply (cuntzClass_eq _ _).mpr + exact (CuntzPositiveMatrix.add_equiv (a.add b) c).trans + (((CuntzPositiveMatrix.add_equiv a b).block (.refl c.matrix)).trans + ((cuntzEquivalent_block_assoc a.matrix b.matrix c.matrix).trans + (((CuntzEquivalent.refl a.matrix).block (CuntzPositiveMatrix.add_equiv b c).symm).trans + (CuntzPositiveMatrix.add_equiv a (b.add c)).symm))) + add_comm a b := by + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => + apply (cuntzClass_eq _ _).mpr + exact (CuntzPositiveMatrix.add_equiv a b).trans + ((cuntzEquivalent_block_comm a.matrix b.matrix).trans + (CuntzPositiveMatrix.add_equiv b a).symm) + add_zero a := by + induction a using Quotient.inductionOn with | h a => + apply (cuntzClass_eq _ _).mpr + exact (CuntzPositiveMatrix.add_equiv a .zero).trans (cuntzEquivalent_block_zero a.matrix) + zero_add a := by + induction a using Quotient.inductionOn with | h a => + apply (cuntzClass_eq _ _).mpr + exact (CuntzPositiveMatrix.add_equiv .zero a).trans + ((cuntzEquivalent_block_comm _ _).trans (cuntzEquivalent_block_zero a.matrix)) + nsmul := nsmulRec + +instance : IsOrderedAddMonoid (CuntzMonoid A) where + add_le_add_left a b h c := by + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => + induction c using Quotient.inductionOn with | h c => + exact (cuntzClass_le _ _).mpr + (CuntzPositiveMatrix.add_le_add ((cuntzClass_le _ _).mp h) (le_refl c)) + +theorem cuntzMonoid_nonneg (x : CuntzMonoid A) : 0 ≤ x := by + induction x using Quotient.inductionOn with | h x => + exact (cuntzClass_le _ _).mpr (CuntzPositiveMatrix.zero_le x) + +/-- Class of the n-by-n identity. -/ +def cuntzUnit (A : Type*) [CStarAlgebra A] (n : ℕ) : CuntzMonoid A := + cuntzClass (.unit n) + +theorem cuntzUnit_zero : cuntzUnit A 0 = 0 := by + apply (cuntzClass_eq _ _).mpr + have h : (CuntzPositiveMatrix.unit (A := A) 0).matrix = 0 := by + ext i + exact Fin.elim0 i + change CuntzEquivalent _ (0 : Matrix (Fin 0) (Fin 0) A) + rw [h] + exact .refl _ + +theorem cuntzUnit_add (m n : ℕ) : cuntzUnit A (m+n) = cuntzUnit A m + cuntzUnit A n := by + apply (cuntzClass_eq _ _).mpr + have h : (CuntzPositiveMatrix.add (CuntzPositiveMatrix.unit (A := A) m) + (CuntzPositiveMatrix.unit n)).matrix = (1 : Matrix (Fin (m+n)) (Fin (m+n)) A) := by + simp [CuntzPositiveMatrix.add, CuntzPositiveMatrix.unit, cuntzBlock, + Matrix.fromBlocks_one] + change CuntzEquivalent 1 _ + rw [h] + exact .refl _ + +theorem cuntzUnit_nsmul (n : ℕ) : n • cuntzUnit A 1 = cuntzUnit A n := by + induction n with + | zero => simp [cuntzUnit_zero] + | succ n ih => rw [succ_nsmul, ih, ← cuntzUnit_add] + +/-- Every class is bounded by a natural multiple of [1_A]. -/ +theorem cuntzMonoid_orderUnit (x : CuntzMonoid A) : ∃ n : ℕ, x ≤ n • cuntzUnit A 1 := by + induction x using Quotient.inductionOn with | h x => + refine ⟨x.size, ?_⟩ + rw [cuntzUnit_nsmul] + exact (cuntzClass_le _ _).mpr x.le_unit + +end Kaplansky + +end + +noncomputable section +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +/-- A coisometry supported on the first half of the columns gives two +orthogonal isometries in the undoubled algebra. -/ +theorem properlyInfinite_of_coisometry_half + (Y : CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A) (hY : Y * star Y = 1) + (hzero : ∀ i j, Y i (Sum.inr j) = 0) : + ProperlyInfinite (CStarMatrix ι ι A) := by + let s : CStarMatrix ι ι A := CStarMatrix.ofMatrix fun i j => star (Y (Sum.inl j) (Sum.inl i)) + let t : CStarMatrix ι ι A := CStarMatrix.ofMatrix fun i j => star (Y (Sum.inr j) (Sum.inl i)) + have hs (i j : ι) : s i j = star (Y (Sum.inl j) (Sum.inl i)) := rfl + have ht (i j : ι) : t i j = star (Y (Sum.inr j) (Sum.inl i)) := rfl + have he (i j : ι ⊕ ι) : (∑ k : ι, Y i (Sum.inl k) * star (Y j (Sum.inl k))) = + if i = j then 1 else 0 := by + have h := congrArg (fun M : CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A => M i j) hY + simpa [CStarMatrix.mul_apply, CStarMatrix.star_eq_conjTranspose, + CStarMatrix.conjTranspose_apply, Fintype.sum_sum_type, hzero, Matrix.one_apply, CStarMatrix.one_apply] using h + refine ⟨s, t, ?_, ?_, ?_⟩ + · ext i j + simpa [hs, CStarMatrix.mul_apply, CStarMatrix.star_eq_conjTranspose, + CStarMatrix.conjTranspose_apply, Matrix.one_apply, CStarMatrix.one_apply] using he (Sum.inl i) (Sum.inl j) + · ext i j + simpa [ht, CStarMatrix.mul_apply, CStarMatrix.star_eq_conjTranspose, + CStarMatrix.conjTranspose_apply, Matrix.one_apply, CStarMatrix.one_apply] using he (Sum.inr i) (Sum.inr j) + · ext i j + simpa [hs, ht, CStarMatrix.mul_apply, CStarMatrix.star_eq_conjTranspose, + CStarMatrix.conjTranspose_apply] using he (Sum.inl i) (Sum.inr j) + +/-- Invertible rectangular row Gram gives a genuine coisometry by inverse +square-root normalization. The zero column block is retained. -/ +theorem properlyInfinite_of_invertible_rectangular_gram + (v : Matrix (ι ⊕ ι) ι A) + (hv : IsUnit (CStarMatrix.ofMatrix (v * v.conjTranspose))) : + ProperlyInfinite (CStarMatrix ι ι A) := by + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : ContinuousFunctionalCalculus ℝ (CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A) IsSelfAdjoint := + IsSelfAdjoint.instContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A) := + CStarAlgebra.instNonnegSpectrumClass' + let X : CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A := CStarMatrix.ofMatrix (Matrix.fromCols v 0) + let Q : CStarMatrix (ι ⊕ ι) (ι ⊕ ι) A := X * star X + have hQ : Q = CStarMatrix.ofMatrix (v * v.conjTranspose) := by + apply CStarMatrix.ext + intro i j + change (∑ k : ι ⊕ ι, + (Sum.elim (v i) (fun _ => 0) k) * star (Sum.elim (v j) (fun _ => 0) k)) = + ∑ k : ι, v i k * star (v j k) + simp only [Fintype.sum_sum_type, Sum.elim_inl, Sum.elim_inr, zero_mul, + Finset.sum_const_zero, add_zero] + have hpos : IsStrictlyPositive Q := (hQ.symm ▸ hv).isStrictlyPositive (mul_star_self_nonneg X) + let L := Q ^ (-(1 / 2) : ℝ) + have hL : star L = L := (CFC.rpow_nonneg (a := Q) (y := (-(1 / 2) : ℝ))).isSelfAdjoint.star_eq + apply properlyInfinite_of_coisometry_half (L * X) + · calc + L * X * star (L * X) = L * Q * L := by simp only [star_mul, hL, Q, mul_assoc] + _ = 1 := CFC.conjugate_rpow_neg_one_half Q hpos + · intro i j + have hX (k : ι ⊕ ι) : X k (Sum.inr j) = 0 := rfl + simp only [CStarMatrix.mul_apply, hX, mul_zero, Finset.sum_const_zero] + +/-- Approximate compression of a doubled identity already forces proper +infiniteness, using the radius-one invertibility criterion. -/ +theorem properlyInfinite_of_cuntzLE_double_unit + (h : CuntzLE (1 : Matrix (ι ⊕ ι) (ι ⊕ ι) A) (1 : Matrix ι ι A)) : + ProperlyInfinite (CStarMatrix ι ι A) := by + obtain ⟨v, hv⟩ := (CuntzLE.iff_approx _ _).mp h 1 zero_lt_one + simp only [Matrix.mul_one] at hv + apply properlyInfinite_of_invertible_rectangular_gram v + let Q := CStarMatrix.ofMatrix (v * v.conjTranspose) + have hnorm : ‖1 - Q‖ < 1 := hv + have hu := (Units.oneSub (1 - Q) hnorm).isUnit + simpa only [Units.val_oneSub, sub_sub_cancel] using hu + +theorem properlyInfinite_of_cuntzUnit_compression (k : ℕ) + (h : (2*k) • cuntzUnit A 1 ≤ k • cuntzUnit A 1) : + ProperlyInfinite (CStarMatrix (Fin k) (Fin k) A) := by + rw [cuntzUnit_nsmul, cuntzUnit_nsmul] at h + have hc : CuntzLE (1 : Matrix (Fin (2*k)) (Fin (2*k)) A) (1 : Matrix (Fin k) (Fin k) A) := + (cuntzClass_le _ _).mp h + have hsum : CuntzLE (1 : Matrix (Fin k ⊕ Fin k) (Fin k ⊕ Fin k) A) + (1 : Matrix (Fin k) (Fin k) A) := by + rw [two_mul] at hc + have he := (cuntzEquivalent_submatrix_equiv + (1 : Matrix (Fin (k+k)) (Fin (k+k)) A) finSumFinEquiv).1.trans hc + simpa using he + exact properlyInfinite_of_cuntzLE_double_unit hsum + +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Quasitrace.lean b/lean/OAI/Analysis/Cuntz/Quasitrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..28b98c45119478aed6dfc740f9814fea23b59408 --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Quasitrace.lean @@ -0,0 +1,242 @@ +import OAI.Analysis.Cuntz.Measure +import OAI.Analysis.Quasitrace.Compactness +import Mathlib.Analysis.CStarAlgebra.Hom + +namespace OAI + +noncomputable section + +/-! Corner-compatible spectral quasitraces and nonunital abelian complex linearity. -/ + +open scoped Matrix CStarAlgebra ComplexStarModule ComplexOrder + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +attribute [local instance] matrixRealFunctionalCalculus matrixNonUnitalRealFunctionalCalculus matrixNonnegSpectrum +variable {A : Type*} [CStarAlgebra A] + +def spectralCornerHom {n : ℕ} (i : Fin n) : A →⋆ₙₐ[ℂ] CStarMatrix (Fin n) (Fin n) A where + toFun := corner i + map_zero' := corner_zero i + map_add' := corner_add i + map_mul' a b := (corner_mul i a b).symm + map_smul' := corner_smul i + map_star' a := (corner_star i a).symm + +theorem spectralCorner_posPart {n : ℕ} (i : Fin n) {a : A} (ha : IsSelfAdjoint a) : + (corner i a)⁺ = corner i a⁺ := by + exact ((spectralCornerHom (A := A) i).map_cfcₙ (fun t : ℝ => t⁺) a + (ha := ha) (hφa := corner_selfAdjoint i ha)).symm + +theorem spectralCorner_negPart {n : ℕ} (i : Fin n) {a : A} (ha : IsSelfAdjoint a) : + (corner i a)⁻ = corner i a⁻ := by + exact ((spectralCornerHom (A := A) i).map_cfcₙ (fun t : ℝ => t⁻) a + (ha := ha) (hφa := corner_selfAdjoint i ha)).symm + +theorem spectralCorner_realPart {n : ℕ} (i : Fin n) (a : A) : + (ℜ (corner i a) : CStarMatrix (Fin n) (Fin n) A) = corner i (ℜ a : A) := + (map_realPart (spectralCornerHom (A := A) i) a).symm + +theorem spectralCorner_imaginaryPart {n : ℕ} (i : Fin n) (a : A) : + (ℑ (corner i a) : CStarMatrix (Fin n) (Fin n) A) = corner i (ℑ a : A) := + (map_imaginaryPart (spectralCornerHom (A := A) i) a).symm + +/-- A single rectangular entry implements equality of spectral values between +any positive corner and its one-by-one matrix. -/ +theorem CuntzDimensionState.positiveValue_corner (d : CuntzDimensionState A) {n : ℕ} + (i : Fin n) {a : A} (ha : 0 ≤ a) : + d.positiveValue (corner i a) (corner_nonneg i ha) = + d.positiveValue (corner (0 : Fin 1) a) (corner_nonneg _ ha) := by + let S := CFC.sqrt a + have hS : star S = S := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + let x : Matrix (Fin n) (Fin 1) A := Matrix.single i 0 S + have hx : x*x.conjTranspose = CStarMatrix.ofMatrix.symm (corner i a) := by + dsimp only [x] + rw [Matrix.conjTranspose_single, Matrix.single_mul_single_same] + change Matrix.single i i (S*star S) = Matrix.single i i a + rw [hS, CFC.sqrt_mul_sqrt_self a ha] + have hy : x.conjTranspose*x = CStarMatrix.ofMatrix.symm (corner (0 : Fin 1) a) := by + dsimp only [x] + rw [Matrix.conjTranspose_single, Matrix.single_mul_single_same] + change Matrix.single 0 0 (star S*S) = Matrix.single 0 0 a + rw [hS, CFC.sqrt_mul_sqrt_self a ha] + have hp : 0 ≤ CStarMatrix.ofMatrix (x*x.conjTranspose) := by rw [hx]; exact corner_nonneg i ha + have hq : 0 ≤ CStarMatrix.ofMatrix (x.conjTranspose*x) := by rw [hy]; exact corner_nonneg _ ha + simpa only [hx, hy, positiveValue] using d.spectralValue_rectangular_gram x hp hq + +theorem CuntzDimensionState.signedValue_corner (d : CuntzDimensionState A) {n : ℕ} + (i : Fin n) {a : A} (ha : IsSelfAdjoint a) : + d.signedValue (corner i a) = d.signedValue (corner (0 : Fin 1) a) := by + simp only [signedValue, spectralCorner_posPart i ha, spectralCorner_negPart i ha, + spectralCorner_posPart (0 : Fin 1) ha, spectralCorner_negPart (0 : Fin 1) ha, + d.positiveValue_corner i (CFC.posPart_nonneg a), d.positiveValue_corner i (CFC.negPart_nonneg a)] + +/-- Whole-algebra corner compatibility for the same stabilized construction. -/ +theorem CuntzDimensionState.complexValue_corner (d : CuntzDimensionState A) {n : ℕ} + (i : Fin n) (a : A) : + d.complexValue (corner i a) = d.complexValue (corner (0 : Fin 1) a) := by + simp only [complexValue, spectralCorner_realPart, spectralCorner_imaginaryPart, + d.signedValue_corner i (ℜ a).property, d.signedValue_corner i (ℑ a).property] + +theorem spectralCorner_finOne (a : A) : + corner (0 : Fin 1) a = CStarMatrix.toOneByOne (Fin 1) ℂ A a := by + ext i j + have hi : i = 0 := Subsingleton.elim _ _ + have hj : j = 0 := Subsingleton.elim _ _ + subst i + subst j + simp [corner, entry, CStarMatrix.toOneByOne] + rfl + +namespace CuntzDimensionState + +/-- The same spectral construction on the original coefficient algebra. -/ +def baseValue (d : CuntzDimensionState A) (a : A) : ℂ := + d.complexValue (corner (0 : Fin 1) a) + +theorem baseValue_square_nonneg (d : CuntzDimensionState A) (x : A) : + 0 ≤ d.baseValue (star x*x) := by + simpa only [baseValue, ← corner_mul, ← corner_star] using + d.complexValue_square_nonneg (corner (0 : Fin 1) x) + +theorem baseValue_square_swap (d : CuntzDimensionState A) (x : A) : + d.baseValue (star x*x) = d.baseValue (x*star x) := by + simpa only [baseValue, ← corner_mul, ← corner_star] using + d.complexValue_square_swap (corner (0 : Fin 1) x) + +theorem baseValue_real_imag (d : CuntzDimensionState A) (h k : A) + (hh : IsSelfAdjoint h) (hk : IsSelfAdjoint k) : + d.baseValue (h+Complex.I • k) = d.baseValue h + Complex.I*d.baseValue k := by + simpa only [baseValue, corner_add, corner_smul] using d.complexValue_real_imag + (corner (0 : Fin 1) h) (corner (0 : Fin 1) k) + (corner_selfAdjoint _ hh) (corner_selfAdjoint _ hk) + +theorem baseValue_one (d : CuntzDimensionState A) : d.baseValue (1 : A) = 1 := by + unfold baseValue + have hc : corner (0 : Fin 1) (1 : A) = 1 := by + ext i j + fin_cases i + fin_cases j + simp [corner, entry] + rw [hc, d.complexValue_one] + norm_num + +theorem norm_baseValue_le (d : CuntzDimensionState A) (a : A) : + ‖d.baseValue a‖ ≤ 2*‖a‖ := by + have h := d.norm_complexValue_le (corner (0 : Fin 1) a) + have hn : ‖corner (0 : Fin 1) a‖ = ‖a‖ := + NonUnitalStarAlgHom.norm_map (spectralCornerHom (A := A) (0 : Fin 1)) + (fun x y h => congrArg (fun M : CStarMatrix (Fin 1) (Fin 1) A => M 0 0) h) a + change ‖d.complexValue (corner (0 : Fin 1) a)‖ ≤ 2 * ‖a‖ + simpa only [Nat.cast_one, hn, mul_one] using h + +/-- A single compatible base/M2 candidate, built from one dimension state. +Only the abelian linearity constraints are still missing. -/ +def spectralCandidate (d : CuntzDimensionState A) : QuasitraceCandidate A := + (d.baseValue, d.complexValue) + +theorem spectralCandidate_corner (d : CuntzDimensionState A) (a : A) : + d.spectralCandidate.2 (upperLeft a) = d.spectralCandidate.1 a := by + change d.complexValue (upperLeft a) = d.baseValue a + rw [upperLeft_eq_corner] + exact d.complexValue_corner (0 : Fin 2) a + +theorem spectralCandidate_matrix_unit (d : CuntzDimensionState A) : + d.spectralCandidate.2 1 = 2 := by + exact_mod_cast d.complexValue_one 2 + +def oneQuasitraceOfSpectralCandidate (d : CuntzDimensionState A) + (hlin : ∀ S : NonUnitalStarSubalgebra ℂ A, IsClosed (S : Set A) → + (∀ x y : S, x*y=y*x) → ∃ f : S →ₗ[ℂ] ℂ, ∀ x : S, f x = d.baseValue x) : + OneQuasitrace A where + toFun := d.baseValue + square_nonneg := d.baseValue_square_nonneg + square_swap := d.baseValue_square_swap + real_imag := d.baseValue_real_imag + abelian_linear := hlin + +theorem normalizedTwoQuasitrace_of_spectral_linearity (d : CuntzDimensionState A) + (hlin : ∀ S : NonUnitalStarSubalgebra ℂ A, IsClosed (S : Set A) → + (∀ x y : S, x*y=y*x) → ∃ f : S →ₗ[ℂ] ℂ, ∀ x : S, f x = d.baseValue x) + (hlin2 : ∀ S : NonUnitalStarSubalgebra ℂ (CStarMatrix (Fin 2) (Fin 2) A), + IsClosed (S : Set (CStarMatrix (Fin 2) (Fin 2) A)) → + (∀ x y : S, x*y=y*x) → ∃ f : S →ₗ[ℂ] ℂ, ∀ x : S, f x = d.complexValue (x : CStarMatrix (Fin 2) (Fin 2) A)) : + ∃ τ : OneQuasitrace A, τ.Normalized ∧ τ.IsTwo := by + let σ : OneQuasitrace (CStarMatrix (Fin 2) (Fin 2) A) := { + toFun := d.complexValue + square_nonneg := d.complexValue_square_nonneg + square_swap := d.complexValue_square_swap + real_imag := d.complexValue_real_imag + abelian_linear := hlin2 } + exact ⟨d.oneQuasitraceOfSpectralCandidate hlin, d.baseValue_one, + σ, d.spectralCandidate_corner⟩ + +/-- Gelfand duality transfers the proved integral linearity to any unital +commutative C*-algebra represented in a finite matrix algebra over A. -/ +def commutativeValueLinearMap (d : CuntzDimensionState A) + {B : Type*} [CommCStarAlgebra B] {n : ℕ} + (φ : B →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : B →ₗ[ℂ] ℂ := by + letI := borel (WeakDual.characterSpace ℂ B) + letI : BorelSpace (WeakDual.characterSpace ℂ B) := ⟨rfl⟩ + let ψ := φ.comp (gelfandStarTransform B).symm.toStarAlgHom + exact (d.complexValueLinearMap ψ).comp (gelfandStarTransform B).toAlgEquiv.toLinearEquiv.toLinearMap + +@[simp] theorem commutativeValueLinearMap_apply (d : CuntzDimensionState A) + {B : Type*} [CommCStarAlgebra B] {n : ℕ} + (φ : B →⋆ₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) (b : B) : + d.commutativeValueLinearMap φ b = d.complexValue (φ b) := by + change d.complexValue (φ ((gelfandStarTransform B).symm ((gelfandStarTransform B) b))) = _ + rw [StarAlgEquiv.symm_apply_apply] + +def nonunitalCommutativeValueLinearMap (d : CuntzDimensionState A) + {B : Type*} [NonUnitalCommCStarAlgebra B] {n : ℕ} + (φ : B →⋆ₙₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) : B →ₗ[ℂ] ℂ := + (d.commutativeValueLinearMap (Unitization.starLift φ)).comp + (Unitization.inrHom ℂ ℂ B) + +@[simp] theorem nonunitalCommutativeValueLinearMap_apply (d : CuntzDimensionState A) + {B : Type*} [NonUnitalCommCStarAlgebra B] {n : ℕ} + (φ : B →⋆ₙₐ[ℂ] CStarMatrix (Fin n) (Fin n) A) (b : B) : + d.nonunitalCommutativeValueLinearMap φ b = d.complexValue (φ b) := by + have he : (Unitization.starLift φ) (b : Unitization ℂ B) = φ b := + congrArg (fun ψ : B →⋆ₙₐ[ℂ] CStarMatrix (Fin n) (Fin n) A => ψ b) + (Equiv.symm_apply_apply Unitization.starLift φ) + have hc := d.commutativeValueLinearMap_apply (Unitization.starLift φ) + (b : Unitization ℂ B) + exact hc.trans (congrArg d.complexValue he) + +/-- The exact abelian-linearity axiom for the fixed matrix spectral candidate. -/ +theorem complexValue_abelian_linear (d : CuntzDimensionState A) (n : ℕ) + (S : NonUnitalStarSubalgebra ℂ (CStarMatrix (Fin n) (Fin n) A)) + (hS : IsClosed (S : Set (CStarMatrix (Fin n) (Fin n) A))) + (hcomm : ∀ x y : S, x*y=y*x) : + ∃ f : S →ₗ[ℂ] ℂ, ∀ x : S, f x = d.complexValue (x : CStarMatrix (Fin n) (Fin n) A) := by + let : IsClosed (S : Set (CStarMatrix (Fin n) (Fin n) A)) := hS + let : NonUnitalCommCStarAlgebra S := { (inferInstance : NonUnitalCStarAlgebra S) with mul_comm := hcomm } + exact ⟨d.nonunitalCommutativeValueLinearMap (NonUnitalStarSubalgebraClass.subtype S), + fun x => d.nonunitalCommutativeValueLinearMap_apply _ x⟩ + +/-- The same axiom at size one, expressed on the original coefficient algebra. -/ +theorem baseValue_abelian_linear (d : CuntzDimensionState A) + (S : NonUnitalStarSubalgebra ℂ A) (hS : IsClosed (S : Set A)) + (hcomm : ∀ x y : S, x*y=y*x) : + ∃ f : S →ₗ[ℂ] ℂ, ∀ x : S, f x = d.baseValue x := by + let : IsClosed (S : Set A) := hS + let : NonUnitalCommCStarAlgebra S := { (inferInstance : NonUnitalCStarAlgebra S) with mul_comm := hcomm } + let φ := (spectralCornerHom (A := A) (0 : Fin 1)).comp (NonUnitalStarSubalgebraClass.subtype S) + exact ⟨d.nonunitalCommutativeValueLinearMap φ, + fun x => d.nonunitalCommutativeValueLinearMap_apply φ x⟩ + +/-- A normalized two-quasitrace from a dimension state, with both original +abelian-linearity premises now discharged for the SAME spectral construction. -/ +theorem normalizedTwoQuasitrace_exists (d : CuntzDimensionState A) : + ∃ τ : OneQuasitrace A, τ.Normalized ∧ τ.IsTwo := + d.normalizedTwoQuasitrace_of_spectral_linearity d.baseValue_abelian_linear + (d.complexValue_abelian_linear 2) + +end CuntzDimensionState +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Regularization.lean b/lean/OAI/Analysis/Cuntz/Regularization.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6a16d6e1acdd73fa067542697f86890a0925647 --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Regularization.lean @@ -0,0 +1,249 @@ +import OAI.Analysis.Cuntz.Cutoff +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Pi +import Mathlib.Topology.Semicontinuity.Defs + +namespace OAI + +noncomputable section + +/-! Regularized dimensions, cutoff calculus, and topological regularization. -/ + +open scoped Matrix CStarAlgebra Topology + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +namespace CuntzDimensionState + +/-- Cutoff regularization of the constructed dimension state, as a finite real supremum. -/ +def regularized (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : ℝ := + sSup ((fun ε : ℝ => d.value (a.cutoff ε)) '' Set.Ioi 0) + +theorem cutoff_values_nonempty (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + ((fun ε : ℝ => d.value (a.cutoff ε)) '' Set.Ioi 0).Nonempty := + ⟨_, ⟨1, by norm_num, rfl⟩⟩ + +theorem cutoff_values_bddAbove (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + BddAbove ((fun ε : ℝ => d.value (a.cutoff ε)) '' Set.Ioi 0) := by + refine ⟨d.value a, ?_⟩ + rintro _ ⟨ε, hε, rfl⟩ + exact d.cutoff_value_le a hε.le + +theorem cutoff_value_le_regularized (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {ε : ℝ} (hε : 0 < ε) : d.value (a.cutoff ε) ≤ d.regularized a := + le_csSup (d.cutoff_values_bddAbove a) ⟨ε, hε, rfl⟩ + +theorem regularized_le (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {r : ℝ} (h : ∀ ε : ℝ, 0 < ε → d.value (a.cutoff ε) ≤ r) : d.regularized a ≤ r := by + apply csSup_le (d.cutoff_values_nonempty a) + rintro _ ⟨ε, hε, rfl⟩ + exact h ε hε + +theorem regularized_le_value (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + d.regularized a ≤ d.value a := d.regularized_le a fun _ hε => d.cutoff_value_le a hε.le + +theorem regularized_nonneg (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + 0 ≤ d.regularized a := + (d.value_nonneg (a.cutoff 1)).trans (d.cutoff_value_le_regularized a (by norm_num)) + +theorem regularized_le_size (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + d.regularized a ≤ a.size := (d.regularized_le_value a).trans (d.value_le_size a) + +/-- Cuntz monotonicity is proved using the two-cutoff comparison theorem. -/ +theorem regularized_mono (d : CuntzDimensionState A) {a b : CuntzPositiveMatrix A} + (h : CuntzLE a.matrix b.matrix) : d.regularized a ≤ d.regularized b := by + apply d.regularized_le a + intro ε hε + obtain ⟨δ, hδ, hc⟩ := (cuntzLE_iff_cutoff_comparison a b).mp h ε hε + exact (d.value_mono (a := a.cutoff ε) (b := b.cutoff δ) hc).trans + (d.cutoff_value_le_regularized b hδ) + +theorem regularized_eq (d : CuntzDimensionState A) {a b : CuntzPositiveMatrix A} + (h : CuntzEquivalent a.matrix b.matrix) : d.regularized a = d.regularized b := + le_antisymm (d.regularized_mono h.1) (d.regularized_mono h.2) + +theorem regularized_zero (d : CuntzDimensionState A) : d.regularized .zero = 0 := + le_antisymm ((d.regularized_le_value .zero).trans_eq d.value_zero) (d.regularized_nonneg .zero) + +/-- Every number strictly below the supremum is exceeded by one actual cutoff value. -/ +theorem exists_lt_cutoff_value (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {r : ℝ} (h : r < d.regularized a) : ∃ ε : ℝ, 0 < ε ∧ r < d.value (a.cutoff ε) := by + by_contra! hn + exact (not_le_of_gt h) (d.regularized_le a hn) + +end CuntzDimensionState + +/-- Iterated cutoffs add their thresholds. -/ +theorem cuntzCutoff_cutoff {a : A} (ha : 0 ≤ a) (ε : ℝ) {δ : ℝ} (hδ : 0 ≤ δ) : + cuntzCutoff (cuntzCutoff a ε) δ = cuntzCutoff a (ε+δ) := by + unfold cuntzCutoff + rw [← cfc_comp' (fun t : ℝ => max (t-δ) 0) (fun t : ℝ => max (t-ε) 0) a] + apply cfc_congr + intro t ht + dsimp only + rcases le_total t ε with h | h + · rw [max_eq_right (sub_nonpos.mpr h), zero_sub, max_eq_right (neg_nonpos.mpr hδ), + max_eq_right (by linarith : t-(ε+δ) ≤ 0)] + · rw [max_eq_left (sub_nonneg.mpr h)] + congr 1 + ring + +theorem CuntzPositiveMatrix.cutoff_cutoff (a : CuntzPositiveMatrix A) (ε : ℝ) + {δ : ℝ} (hδ : 0 ≤ δ) : (a.cutoff ε).cutoff δ = a.cutoff (ε+δ) := by + cases a with + | mk n a ha => + simp only [CuntzPositiveMatrix.cutoff] + congr 1 + change CStarMatrix.ofMatrix.symm (cuntzCutoff (cuntzCutoff (CStarMatrix.ofMatrix a) ε) δ) = + CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a) (ε + δ)) + rw [cuntzCutoff_cutoff ha ε hδ] + +theorem cuntzCutoff_one_half : cuntzCutoff (1 : A) (1/2) = (1/2 : ℝ) • (1 : A) := by + unfold cuntzCutoff + have he := cfc_algebraMap (A := A) (1 : ℝ) (fun t : ℝ => max (t-1/2) 0) + norm_num [Algebra.algebraMap_eq_smul_one] at he ⊢ + +/-- Regularization preserves the value of every finite identity matrix. -/ +theorem CuntzDimensionState.regularized_unit (d : CuntzDimensionState A) (n : ℕ) : + d.regularized (.unit n) = (n : ℝ) := by + apply le_antisymm ((d.regularized_le_value _).trans_eq (d.value_unit n)) + have he : d.value ((CuntzPositiveMatrix.unit (A := A) n).cutoff (1/2)) = d.value (.unit n) := by + apply d.value_eq + change CuntzEquivalent (CStarMatrix.ofMatrix.symm + (cuntzCutoff (1 : CStarMatrix (Fin n) (Fin n) A) (1/2))) (1 : Matrix (Fin n) (Fin n) A) + rw [cuntzCutoff_one_half] + exact cuntzEquivalent_pos_smul 1 (by norm_num) + rw [← d.value_unit n, ← he] + exact d.cutoff_value_le_regularized _ (by norm_num) + +/-- Applying the cutoff supremum a second time does not change its value. -/ +theorem CuntzDimensionState.regularized_idempotent (d : CuntzDimensionState A) + (a : CuntzPositiveMatrix A) : + sSup ((fun ε : ℝ => d.regularized (a.cutoff ε)) '' Set.Ioi 0) = d.regularized a := by + have hne : ((fun ε : ℝ => d.regularized (a.cutoff ε)) '' Set.Ioi 0).Nonempty := + ⟨_, ⟨1, by norm_num, rfl⟩⟩ + have hb : BddAbove ((fun ε : ℝ => d.regularized (a.cutoff ε)) '' Set.Ioi 0) := by + refine ⟨d.regularized a, ?_⟩ + rintro _ ⟨ε, hε, rfl⟩ + exact (d.regularized_le_value _).trans (d.cutoff_value_le_regularized a hε) + apply le_antisymm + · apply csSup_le hne + rintro _ ⟨ε, hε, rfl⟩ + exact (d.regularized_le_value _).trans (d.cutoff_value_le_regularized a hε) + apply d.regularized_le a + intro ε hε + have he : d.value (a.cutoff ε) ≤ d.regularized (a.cutoff (ε/2)) := by + have hc := d.cutoff_value_le_regularized (a.cutoff (ε/2)) (half_pos hε) + rw [CuntzPositiveMatrix.cutoff_cutoff a _ (half_pos hε).le] at hc + simpa only [add_halves] using hc + exact he.trans (le_csSup hb ⟨ε/2, half_pos hε, rfl⟩) + + +/-- A norm neighborhood controls one fixed cutoff by the regularized value. -/ +theorem CuntzDimensionState.cutoff_value_le_regularized_of_norm {n : ℕ} + (d : CuntzDimensionState A) {a b : CStarMatrix (Fin n) (Fin n) A} + (ha : 0 ≤ a) (hb : 0 ≤ b) {ε : ℝ} (hε : 0 < ε) (hab : ‖a-b‖ < ε/2) : + d.value ((⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ : CuntzPositiveMatrix A).cutoff ε) ≤ + d.regularized ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := by + have hn : ‖a - cuntzCutoff b (ε/2)‖ < ε := by + have ht : ‖a - cuntzCutoff b (ε/2)‖ ≤ ‖a-b‖ + ‖b - cuntzCutoff b (ε/2)‖ := by + simpa only [dist_eq_norm] using dist_triangle a b (cuntzCutoff b (ε/2)) + have he := norm_sub_cuntzCutoff_le hb (half_pos hε).le + linarith + have hc := cuntzLE_cutoff_of_norm_sub_lt ha (cuntzCutoff_nonneg b (ε/2)).isSelfAdjoint hn + exact (d.value_mono (a := (⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ : CuntzPositiveMatrix A).cutoff ε) + (b := (⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ : CuntzPositiveMatrix A).cutoff (ε/2)) hc).trans + (d.cutoff_value_le_regularized _ (half_pos hε)) + +/-- Lower semicontinuity on the full positive cone in each actual matrix norm. -/ +theorem CuntzDimensionState.regularized_lowerSemicontinuous (d : CuntzDimensionState A) + (n : ℕ) : LowerSemicontinuous (fun a : {a : CStarMatrix (Fin n) (Fin n) A // 0 ≤ a} => + d.regularized ⟨n, CStarMatrix.ofMatrix.symm a.val, a.property⟩) := by + intro a r hr + obtain ⟨ε, hε, he⟩ := d.exists_lt_cutoff_value _ hr + apply Metric.mem_nhds_iff.mpr + refine ⟨ε/2, half_pos hε, ?_⟩ + intro b hb + have hdist : ‖a.val-b.val‖ < ε/2 := by + simpa only [Metric.mem_ball, Subtype.dist_eq, dist_eq_norm, norm_sub_rev] using hb + exact he.trans_le (d.cutoff_value_le_regularized_of_norm a.property b.property hε hdist) + +variable {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +local instance matrixRealFunctionalCalculus {ν : Type*} [Fintype ν] [DecidableEq ν] : + ContinuousFunctionalCalculus ℝ (CStarMatrix ν ν A) IsSelfAdjoint := + IsSelfAdjoint.instContinuousFunctionalCalculus + +local instance productMatrixRealFunctionalCalculus : + ContinuousFunctionalCalculus ℝ (CStarMatrix ι ι A × CStarMatrix κ κ A) IsSelfAdjoint := + IsSelfAdjoint.instContinuousFunctionalCalculus + +/-- The genuine block-diagonal unital star homomorphism. -/ +def cuntzBlockHom : (CStarMatrix ι ι A × CStarMatrix κ κ A) →⋆ₐ[ℂ] + CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A where + toFun p := CStarMatrix.ofMatrix (cuntzBlock p.1 p.2) + map_zero' := by ext i j; cases i <;> cases j <;> rfl + map_one' := by exact Matrix.fromBlocks_one + map_add' p q := by + ext i j + cases i <;> cases j <;> first | rfl | exact (zero_add (0 : A)).symm + map_mul' p q := by + change cuntzBlock (CStarMatrix.ofMatrix.symm p.1 * CStarMatrix.ofMatrix.symm q.1) + (CStarMatrix.ofMatrix.symm p.2 * CStarMatrix.ofMatrix.symm q.2) = + cuntzBlock (CStarMatrix.ofMatrix.symm p.1) (CStarMatrix.ofMatrix.symm p.2) * + cuntzBlock (CStarMatrix.ofMatrix.symm q.1) (CStarMatrix.ofMatrix.symm q.2) + simp only [cuntzBlock, Matrix.fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, + add_zero, zero_add] + map_star' p := by + ext i j + cases i <;> cases j <;> first | rfl | exact (star_zero A).symm + commutes' c := by + classical + simp only [Algebra.algebraMap_eq_smul_one] + change Matrix.fromBlocks (c • (1 : Matrix ι ι A)) 0 0 (c • (1 : Matrix κ κ A)) = c • (1 : Matrix (ι ⊕ κ) (ι ⊕ κ) A) + rw [← Matrix.fromBlocks_one, Matrix.fromBlocks_smul] + simp only [smul_zero] + +theorem cuntzCutoff_block (a : CStarMatrix ι ι A) (b : CStarMatrix κ κ A) + (ha : 0 ≤ a) (hb : 0 ≤ b) (ε : ℝ) : + cuntzCutoff (CStarMatrix.ofMatrix (cuntzBlock a b)) ε = + CStarMatrix.ofMatrix (cuntzBlock (CStarMatrix.ofMatrix.symm (cuntzCutoff a ε)) (CStarMatrix.ofMatrix.symm (cuntzCutoff b ε))) := by + let φ := cuntzBlockHom (A := A) (ι := ι) (κ := κ) + have h := φ.map_cfc (fun t : ℝ => max (t-ε) 0) (a,b) + (ha := by exact Prod.ext ha.isSelfAdjoint hb.isSelfAdjoint) + (hφa := (cuntzBlock_nonneg _ _ ha hb).isSelfAdjoint) + rw [cfc_map_prod (S := ℂ) (fun t : ℝ => max (t-ε) 0) a b + (ha := ha.isSelfAdjoint) (hb := hb.isSelfAdjoint) + (hab := by exact Prod.ext ha.isSelfAdjoint hb.isSelfAdjoint)] at h + exact h.symm + +theorem cuntzCutoff_reindex (a : CStarMatrix ι ι A) (ha : 0 ≤ a) (e : κ ≃ ι) (ε : ℝ) : + cuntzCutoff (CStarMatrix.ofMatrix ((CStarMatrix.ofMatrix.symm a).submatrix e e)) ε = + CStarMatrix.ofMatrix ((CStarMatrix.ofMatrix.symm (cuntzCutoff a ε)).submatrix e e) := by + let φ := (CStarMatrix.reindexₐ ℂ A e.symm).toStarAlgHom + exact (φ.map_cfc (fun t : ℝ => max (t-ε) 0) a + (ha := ha.isSelfAdjoint) (hφa := (cuntzSubmatrix_nonneg _ e ha).isSelfAdjoint)).symm + +theorem CuntzPositiveMatrix.cutoff_add (a b : CuntzPositiveMatrix A) (ε : ℝ) : + (a.add b).cutoff ε = (a.cutoff ε).add (b.cutoff ε) := by + cases a with + | mk n a ha => + cases b with + | mk m b hb => + simp only [CuntzPositiveMatrix.add, CuntzPositiveMatrix.cutoff] + congr 1 + have he := cuntzCutoff_reindex (CStarMatrix.ofMatrix (cuntzBlock a b)) + (cuntzBlock_nonneg _ _ ha hb) finSumFinEquiv.symm ε + have hh : cuntzCutoff (CStarMatrix.ofMatrix (cuntzBlock a b)) ε = + CStarMatrix.ofMatrix (cuntzBlock + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a) ε)) + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix b) ε))) := + cuntzCutoff_block (CStarMatrix.ofMatrix a) (CStarMatrix.ofMatrix b) ha hb ε + rw [hh] at he + exact congrArg CStarMatrix.ofMatrix.symm he + +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/RegularizedState.lean b/lean/OAI/Analysis/Cuntz/RegularizedState.lean new file mode 100644 index 0000000000000000000000000000000000000000..b74f540c128de02e513ae76c373f217b2b8e622b --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/RegularizedState.lean @@ -0,0 +1,143 @@ +import OAI.Analysis.Cuntz.Regularization +import OAI.Analysis.Cuntz.Squares + +namespace OAI + +noncomputable section + +/-! Regularized dimension states and subadditivity. -/ + +section +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +namespace CuntzDimensionState + +/-- A common smaller cutoff controls two independent cutoff thresholds. -/ +theorem cutoff_value_add_le_regularized (d : CuntzDimensionState A) + (a b : CuntzPositiveMatrix A) {ε δ : ℝ} (hε : 0 < ε) (hδ : 0 < δ) : + d.value (a.cutoff ε) + d.value (b.cutoff δ) ≤ d.regularized (a.add b) := by + have hp := lt_min hε hδ + calc + _ ≤ d.value (a.cutoff (min ε δ)) + d.value (b.cutoff (min ε δ)) := + add_le_add (d.cutoff_value_antitone a (min_le_left _ _)) + (d.cutoff_value_antitone b (min_le_right _ _)) + _ = d.value ((a.add b).cutoff (min ε δ)) := by rw [CuntzPositiveMatrix.cutoff_add, d.value_add] + _ ≤ _ := d.cutoff_value_le_regularized _ hp + +theorem regularized_add (d : CuntzDimensionState A) (a b : CuntzPositiveMatrix A) : + d.regularized (a.add b) = d.regularized a + d.regularized b := by + apply le_antisymm + · apply d.regularized_le + intro ε hε + rw [CuntzPositiveMatrix.cutoff_add, d.value_add] + exact add_le_add (d.cutoff_value_le_regularized a hε) (d.cutoff_value_le_regularized b hε) + · apply (le_sub_iff_add_le).mp + apply d.regularized_le a + intro ε hε + apply (le_sub_iff_add_le).mpr + apply (le_sub_iff_add_le').mp + apply d.regularized_le b + intro δ hδ + apply (le_sub_iff_add_le').mpr + exact d.cutoff_value_add_le_regularized a b hε hδ + +/-- The regularization descends to an additive, normalized monotone state +on the actual Cuntz monoid. -/ +def regularize (d : CuntzDimensionState A) : CuntzDimensionState A where + state := { + toFun := Quotient.lift d.regularized (fun _ _ h => d.regularized_eq h) + map_zero' := d.regularized_zero + map_add' := by + intro a b + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => + exact d.regularized_add a b } + monotone := by + intro a b h + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => + exact d.regularized_mono ((cuntzClass_le a b).mp h) + normalized := by + change d.regularized (.unit 1) = 1 + exact_mod_cast d.regularized_unit 1 + +@[simp] theorem regularize_value (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + d.regularize.value a = d.regularized a := rfl + +theorem regularize_lowerSemicontinuous (d : CuntzDimensionState A) (n : ℕ) : + LowerSemicontinuous (fun a : {a : CStarMatrix (Fin n) (Fin n) A // 0 ≤ a} => + d.regularize.value ⟨n, CStarMatrix.ofMatrix.symm a.val, a.property⟩) := + d.regularized_lowerSemicontinuous n + +theorem regularize_idempotent_value (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + d.regularize.regularize.value a = d.regularize.value a := + d.regularized_idempotent a + +/-- Square swapping for the regularization follows from the proved +Cuntz equivalence, even for unequal matrix sizes. -/ +theorem regularized_rectangular_gram (d : CuntzDimensionState A) {n m : ℕ} + (v : Matrix (Fin n) (Fin m) A) + (hv : 0 ≤ CStarMatrix.ofMatrix (v*v.conjTranspose)) + (hw : 0 ≤ CStarMatrix.ofMatrix (v.conjTranspose*v)) : + d.regularized ⟨n, v*v.conjTranspose, hv⟩ = + d.regularized ⟨m, v.conjTranspose*v, hw⟩ := + d.regularized_eq (cuntzEquivalent_rectangular_gram v) + +end CuntzDimensionState +end Kaplansky + +end + +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- The row of two identities compresses the diagonal block to the ordinary sum. -/ +theorem cuntzLE_sum_block {n : ℕ} (a b : Matrix (Fin n) (Fin n) A) : + CuntzLE (a+b) (cuntzBlock a b) := by + let v := Matrix.fromCols (1 : Matrix (Fin n) (Fin n) A) (1 : Matrix (Fin n) (Fin n) A) + have h : v * cuntzBlock a b * v.conjTranspose = a+b := by + simp [v, cuntzBlock, Matrix.fromCols_mul_fromBlocks, + Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, + Matrix.fromCols_mul_fromRows] + simpa only [h] using CuntzLE.exact (cuntzBlock a b) v + +namespace CuntzDimensionState + +/-- Dimension is subadditive for positive sums, without a commutation hypothesis. -/ +theorem value_sum_le (d : CuntzDimensionState A) {n : ℕ} + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) : + d.value ⟨n, CStarMatrix.ofMatrix.symm (a+b), add_nonneg ha hb⟩ ≤ + d.value ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + + d.value ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := by + let pa : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + let pb : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ + rw [← d.value_add pa pb] + apply d.value_mono + exact (cuntzLE_sum_block _ _).trans (CuntzPositiveMatrix.add_equiv pa pb).symm.1 + +theorem regularized_sum_le (d : CuntzDimensionState A) {n : ℕ} + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) : + d.regularized ⟨n, CStarMatrix.ofMatrix.symm (a+b), add_nonneg ha hb⟩ ≤ + d.regularized ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + + d.regularized ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := + d.regularize.value_sum_le a b ha hb + +theorem regularized_orthogonal_add (d : CuntzDimensionState A) {n : ℕ} + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a*b=0) : + d.regularized ⟨n, CStarMatrix.ofMatrix.symm (a+b), add_nonneg ha hb⟩ = + d.regularized ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + + d.regularized ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := + d.regularize.value_orthogonal_add n a b ha hb hab + +end CuntzDimensionState +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Spectral.lean b/lean/OAI/Analysis/Cuntz/Spectral.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1d01a8accca04730709b6b8cb85ea6dc8cb3dfc --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Spectral.lean @@ -0,0 +1,257 @@ +import OAI.Analysis.Cuntz.SquareCutoff +import OAI.Analysis.Cuntz.Translation +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Isometric + +namespace OAI + +noncomputable section + +/-! Spectral candidates on squares, orthogonal elements, and complex elements. -/ + +open scoped Matrix CStarAlgebra ComplexStarModule ComplexOrder +open MeasureTheory + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +local instance matrixNonUnitalRealFunctionalCalculus {ν : Type*} [Fintype ν] [DecidableEq ν] : + NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix ν ν A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + +local instance matrixNonnegSpectrum {ν : Type*} [Fintype ν] [DecidableEq ν] : + NonnegSpectrumClass ℝ (CStarMatrix ν ν A) := CStarAlgebra.instNonnegSpectrumClass' + +namespace CuntzDimensionState + +/-- The spectral distributions of rectangular Gram matrices agree at +all strictly positive thresholds, not just on the uncut matrices. -/ +theorem distribution_rectangular_gram (d : CuntzDimensionState A) {n m : ℕ} + (x : Matrix (Fin n) (Fin m) A) (ha : 0 ≤ CStarMatrix.ofMatrix (x*x.conjTranspose)) + (hb : 0 ≤ CStarMatrix.ofMatrix (x.conjTranspose*x)) {t : ℝ} (ht : 0 < t) : + d.distribution ⟨n, x*x.conjTranspose, ha⟩ t = + d.distribution ⟨m, x.conjTranspose*x, hb⟩ t := + d.regularized_eq (cuntzEquivalent_cutoff_rectangular_gram x ha hb ht) + +/-- The spectral integral satisfies square swapping in unequal sizes. -/ +theorem spectralValue_rectangular_gram (d : CuntzDimensionState A) {n m : ℕ} + (x : Matrix (Fin n) (Fin m) A) (ha : 0 ≤ CStarMatrix.ofMatrix (x*x.conjTranspose)) + (hb : 0 ≤ CStarMatrix.ofMatrix (x.conjTranspose*x)) : + d.spectralValue ⟨n, x*x.conjTranspose, ha⟩ = + d.spectralValue ⟨m, x.conjTranspose*x, hb⟩ := by + let a : CuntzPositiveMatrix A := ⟨n, x*x.conjTranspose, ha⟩ + let b : CuntzPositiveMatrix A := ⟨m, x.conjTranspose*x, hb⟩ + let R := ‖CStarMatrix.ofMatrix a.matrix‖ + ‖CStarMatrix.ofMatrix b.matrix‖ + have hR : ‖CStarMatrix.ofMatrix a.matrix‖ ≤ R := le_add_of_nonneg_right (norm_nonneg _) + have hR' : ‖CStarMatrix.ofMatrix b.matrix‖ ≤ R := le_add_of_nonneg_left (norm_nonneg _) + rw [d.spectralValue_eq_integral a hR, d.spectralValue_eq_integral b hR'] + apply intervalIntegral.integral_congr_Ioo_of_le (le_trans (norm_nonneg _) hR) + intro t ht + exact d.distribution_rectangular_gram x ha hb ht.1 + +/-- In particular, the original square-swap axiom holds on the positive squares. -/ +theorem spectralValue_square_swap (d : CuntzDimensionState A) {n : ℕ} + (x : CStarMatrix (Fin n) (Fin n) A) : + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (x*star x), mul_star_self_nonneg x⟩ = + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (star x*x), star_mul_self_nonneg x⟩ := + d.spectralValue_rectangular_gram (CStarMatrix.ofMatrix.symm x) _ _ + +end CuntzDimensionState + +/-- An orthogonal positive sum and its diagonal block form are exactly the two +Gram matrices of a rectangular matrix of square roots. -/ +theorem exists_orthogonal_sum_gram {n : ℕ} + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a*b = 0) : + ∃ v : Matrix (Fin n) (Fin (n+n)) A, + v*v.conjTranspose = CStarMatrix.ofMatrix.symm (a+b) ∧ + v.conjTranspose*v = + (CuntzPositiveMatrix.add ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩).matrix := by + let S := CFC.sqrt a + let T := CFC.sqrt b + have hS : star S = S := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + have hT : star T = T := (CFC.sqrt_nonneg b).isSelfAdjoint.star_eq + have hST : S*T = 0 := sqrt_mul_sqrt_eq_zero_of_mul_eq_zero ha hb hab + have hTS : T*S = 0 := by simpa only [star_mul, hS, hT, star_zero] using congrArg star hST + let w := Matrix.fromCols (CStarMatrix.ofMatrix.symm S) (CStarMatrix.ofMatrix.symm T) + have hl : w*w.conjTranspose = CStarMatrix.ofMatrix.symm (a+b) := by + dsimp [w] + rw [Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, Matrix.fromCols_mul_fromRows] + have he : S * star S + T * star T = a + b := by + rw [hS, hT, CFC.sqrt_mul_sqrt_self a ha, CFC.sqrt_mul_sqrt_self b hb] + exact he + have hr : w.conjTranspose*w = cuntzBlock (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm b) := by + dsimp [w] + rw [Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, Matrix.fromRows_mul_fromCols] + have hSS : star S * S = a := by rw [hS]; exact CFC.sqrt_mul_sqrt_self a ha + have hTT : star T * T = b := by rw [hT]; exact CFC.sqrt_mul_sqrt_self b hb + have hST' : star S * T = 0 := by rw [hS]; exact hST + have hTS' : star T * S = 0 := by rw [hT]; exact hTS + have he := congrArg₂ (fun u v : CStarMatrix (Fin n) (Fin n) A => + Matrix.fromBlocks (CStarMatrix.ofMatrix.symm u) (0 : Matrix (Fin n) (Fin n) A) + (0 : Matrix (Fin n) (Fin n) A) (CStarMatrix.ofMatrix.symm v)) hSS hTT + change Matrix.fromBlocks (CStarMatrix.ofMatrix.symm (star S * S)) + (CStarMatrix.ofMatrix.symm (star S * T)) (CStarMatrix.ofMatrix.symm (star T * S)) + (CStarMatrix.ofMatrix.symm (star T * T)) = _ + rw [hST', hTS'] + exact he + refine ⟨w.submatrix (Equiv.refl _) finSumFinEquiv.symm, ?_, ?_⟩ + · rw [Matrix.conjTranspose_submatrix, Matrix.submatrix_mul_equiv, hl] + rfl + · rw [Matrix.conjTranspose_submatrix, Matrix.submatrix_mul_equiv, hr] + rfl + +/-- Orthogonal additivity for the spectral integral follows from its proved +rectangular square swap and block additivity. -/ +theorem CuntzDimensionState.spectralValue_orthogonal_add (d : CuntzDimensionState A) {n : ℕ} + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a*b = 0) : + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm (a+b), add_nonneg ha hb⟩ = + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := by + let pa : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + let pb : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ + obtain ⟨v, hv, hw⟩ := exists_orthogonal_sum_gram a b ha hb hab + have hp : 0 ≤ CStarMatrix.ofMatrix (v*v.conjTranspose) := by rw [hv]; exact add_nonneg ha hb + have hq : 0 ≤ CStarMatrix.ofMatrix (v.conjTranspose*v) := by rw [hw]; exact (pa.add pb).nonneg + have h := d.spectralValue_rectangular_gram v hp hq + rw [← d.spectralValue_add pa pb] + simpa only [hv, hw, pa, pb, CuntzPositiveMatrix.add] using h + +namespace CuntzDimensionState + +/-- The spectral value in a fixed matrix size, on the genuine positive cone. -/ +def positiveValue (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) : ℝ := + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + +@[simp] theorem positiveValue_zero (d : CuntzDimensionState A) (n : ℕ) : + d.positiveValue (0 : CStarMatrix (Fin n) (Fin n) A) le_rfl = 0 := by + simp [positiveValue, spectralValue] + +/-- The same positive construction gives a canonical signed value by positive +and negative parts. Additivity on general commuting elements is not assumed. -/ +def signedValue (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) : ℝ := + d.positiveValue a⁺ (CFC.posPart_nonneg a) - d.positiveValue a⁻ (CFC.negPart_nonneg a) + +theorem signedValue_of_nonneg (d : CuntzDimensionState A) {n : ℕ} + {a : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) : + d.signedValue a = d.positiveValue a ha := by + unfold signedValue + simp only [(CFC.posPart_eq_self a).mpr ha, (CFC.negPart_eq_zero_iff a ha.isSelfAdjoint).mpr ha, + d.positiveValue_zero, sub_zero] + +@[simp] theorem signedValue_zero (d : CuntzDimensionState A) (n : ℕ) : + d.signedValue (0 : CStarMatrix (Fin n) (Fin n) A) = 0 := by + rw [d.signedValue_of_nonneg le_rfl, d.positiveValue_zero] + +@[simp] theorem signedValue_neg (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) : d.signedValue (-a) = -d.signedValue a := by + simp only [signedValue, CFC.posPart_neg, CFC.negPart_neg, neg_sub] + +/-- Real scalar homogeneity holds for the signed construction. -/ +theorem signedValue_smul (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) (r : ℝ) : d.signedValue (r • a) = r*d.signedValue a := by + have hp (b : CStarMatrix (Fin n) (Fin n) A) (hb : 0 ≤ b) (s : ℝ) (hs : 0 ≤ s) : + d.positiveValue (s • b) (smul_nonneg hs hb) = s*d.positiveValue b hb := + d.spectralValue_scale ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ s hs + rcases le_total 0 r with hr | hr + · simp only [signedValue, CFC.posPart_smul_of_nonneg hr, CFC.negPart_smul_of_nonneg hr, + hp a⁺ (CFC.posPart_nonneg a) r hr, hp a⁻ (CFC.negPart_nonneg a) r hr, + mul_sub] + · simp only [signedValue, CFC.posPart_smul_of_nonpos hr, CFC.negPart_smul_of_nonpos hr, + hp a⁺ (CFC.posPart_nonneg a) (-r) (neg_nonneg.mpr hr), + hp a⁻ (CFC.negPart_nonneg a) (-r) (neg_nonneg.mpr hr)] + ring + +/-- A sharp size times norm bound, since both positive-part values lie in +[0, size times norm]. -/ +theorem abs_signedValue_le (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) : |d.signedValue a| ≤ ‖a‖ * n := by + have hp := d.spectralValue_nonneg ⟨n, CStarMatrix.ofMatrix.symm a⁺, CFC.posPart_nonneg a⟩ + have hn := d.spectralValue_nonneg ⟨n, CStarMatrix.ofMatrix.symm a⁻, CFC.negPart_nonneg a⟩ + have hp' := d.spectralValue_le_norm_mul_size ⟨n, CStarMatrix.ofMatrix.symm a⁺, CFC.posPart_nonneg a⟩ + have hn' := d.spectralValue_le_norm_mul_size ⟨n, CStarMatrix.ofMatrix.symm a⁻, CFC.negPart_nonneg a⟩ + have hpp := mul_le_mul_of_nonneg_right (CStarAlgebra.norm_posPart_le a) (Nat.cast_nonneg (α := ℝ) n) + have hnn := mul_le_mul_of_nonneg_right (CStarAlgebra.norm_negPart_le a) (Nat.cast_nonneg (α := ℝ) n) + change |d.positiveValue a⁺ _ - d.positiveValue a⁻ _| ≤ _ + change 0 ≤ d.positiveValue a⁺ _ at hp + change 0 ≤ d.positiveValue a⁻ _ at hn + change d.positiveValue a⁺ _ ≤ ‖a⁺‖ * n at hp' + change d.positiveValue a⁻ _ ≤ ‖a⁻‖ * n at hn' + apply abs_le.mpr + constructor + · simpa only [zero_sub] using sub_le_sub hp (hn'.trans hnn) + · simpa only [sub_zero] using sub_le_sub (hp'.trans hpp) hn + + +/-- A single complex-valued extension of the spectral construction in every +finite matrix size. Abelian linearity is not asserted by this definition. -/ +def complexValue (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) : ℂ := + (d.signedValue (ℜ a : CStarMatrix (Fin n) (Fin n) A) : ℂ) + + Complex.I * (d.signedValue (ℑ a : CStarMatrix (Fin n) (Fin n) A) : ℂ) + +theorem complexValue_selfAdjoint (d : CuntzDimensionState A) {n : ℕ} + {a : CStarMatrix (Fin n) (Fin n) A} (ha : IsSelfAdjoint a) : + d.complexValue a = (d.signedValue a : ℂ) := by + simp [complexValue, ha.coe_realPart, ha.imaginaryPart] + +theorem complexValue_of_nonneg (d : CuntzDimensionState A) {n : ℕ} + {a : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) : + d.complexValue a = (d.positiveValue a ha : ℂ) := by + rw [d.complexValue_selfAdjoint ha.isSelfAdjoint, d.signedValue_of_nonneg ha] + +@[simp] theorem complexValue_zero (d : CuntzDimensionState A) (n : ℕ) : + d.complexValue (0 : CStarMatrix (Fin n) (Fin n) A) = 0 := by + simp [complexValue] + +/-- The original real/imaginary axiom, without assuming that h and k commute. -/ +theorem complexValue_real_imag (d : CuntzDimensionState A) {n : ℕ} + (h k : CStarMatrix (Fin n) (Fin n) A) (hh : IsSelfAdjoint h) (hk : IsSelfAdjoint k) : + d.complexValue (h + Complex.I • k) = d.complexValue h + Complex.I * d.complexValue k := by + rw [d.complexValue_selfAdjoint hh, d.complexValue_selfAdjoint hk] + simp [complexValue, map_add, hh.coe_realPart, hh.imaginaryPart, hk.coe_realPart, hk.imaginaryPart] + +/-- Nonnegativity of squares for the single whole-matrix construction. -/ +theorem complexValue_square_nonneg (d : CuntzDimensionState A) {n : ℕ} + (x : CStarMatrix (Fin n) (Fin n) A) : 0 ≤ d.complexValue (star x*x) := by + rw [d.complexValue_of_nonneg (star_mul_self_nonneg x)] + exact_mod_cast d.spectralValue_nonneg ⟨n, CStarMatrix.ofMatrix.symm (star x*x), star_mul_self_nonneg x⟩ + +/-- Square swapping for the same whole-matrix construction. -/ +theorem complexValue_square_swap (d : CuntzDimensionState A) {n : ℕ} + (x : CStarMatrix (Fin n) (Fin n) A) : + d.complexValue (star x*x) = d.complexValue (x*star x) := by + rw [d.complexValue_of_nonneg (star_mul_self_nonneg x), d.complexValue_of_nonneg (mul_star_self_nonneg x)] + exact congrArg (fun r : ℝ => (r : ℂ)) (d.spectralValue_square_swap x).symm + +theorem complexValue_one (d : CuntzDimensionState A) (n : ℕ) : + d.complexValue (1 : CStarMatrix (Fin n) (Fin n) A) = (n : ℂ) := by + rw [d.complexValue_of_nonneg zero_le_one] + change (d.spectralValue (.unit n) : ℂ) = _ + rw [d.spectralValue_unit] + norm_cast + +/-- The uniform bound needed for compact finite-constraint candidates. -/ +theorem norm_complexValue_le (d : CuntzDimensionState A) {n : ℕ} + (a : CStarMatrix (Fin n) (Fin n) A) : ‖d.complexValue a‖ ≤ 2*‖a‖*n := by + have hr := d.abs_signedValue_le (ℜ a : CStarMatrix (Fin n) (Fin n) A) + have hi := d.abs_signedValue_le (ℑ a : CStarMatrix (Fin n) (Fin n) A) + have hr' : ‖(ℜ a : CStarMatrix (Fin n) (Fin n) A)‖ * (n : ℝ) ≤ ‖a‖ * n := + mul_le_mul_of_nonneg_right (realPart.norm_le a) (Nat.cast_nonneg n) + have hi' : ‖(ℑ a : CStarMatrix (Fin n) (Fin n) A)‖ * (n : ℝ) ≤ ‖a‖ * n := + mul_le_mul_of_nonneg_right (imaginaryPart.norm_le a) (Nat.cast_nonneg n) + have hn := norm_add_le (d.signedValue (ℜ a : CStarMatrix (Fin n) (Fin n) A) : ℂ) + (Complex.I * (d.signedValue (ℑ a : CStarMatrix (Fin n) (Fin n) A) : ℂ)) + simp only [norm_mul, Complex.norm_I, one_mul, Complex.norm_real, Real.norm_eq_abs] at hn + change ‖d.complexValue a‖ ≤ _ at hn + linarith + +end CuntzDimensionState +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/SquareCutoff.lean b/lean/OAI/Analysis/Cuntz/SquareCutoff.lean new file mode 100644 index 0000000000000000000000000000000000000000..d4c63557dfb2e8e800eec7019d5abf42bc4e6e45 --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/SquareCutoff.lean @@ -0,0 +1,147 @@ +import OAI.Analysis.Cuntz.Regularization +import OAI.Analysis.Cuntz.Squares +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Commute + +namespace OAI + +noncomputable section + +/-! Intertwining functional calculus and cutoffs of adjoint squares. -/ + +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +attribute [local instance] matrixRealFunctionalCalculus productMatrixRealFunctionalCalculus + +section Rectangular +variable {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + +/-- Real functional calculus commutes with genuine diagonal blocks. -/ +theorem cfc_cuntzBlock (a : CStarMatrix ι ι A) (b : CStarMatrix κ κ A) + (ha : 0 ≤ a) (hb : 0 ≤ b) (f : ℝ → ℝ) (hf : Continuous f) : + cfc f (CStarMatrix.ofMatrix (cuntzBlock a b)) = + CStarMatrix.ofMatrix (cuntzBlock (CStarMatrix.ofMatrix.symm (cfc f a)) + (CStarMatrix.ofMatrix.symm (cfc f b))) := by + let φ := cuntzBlockHom (A := A) (ι := ι) (κ := κ) + have h := φ.map_cfc f (a,b) (hf := hf.continuousOn) + (ha := by exact Prod.ext ha.isSelfAdjoint hb.isSelfAdjoint) + (hφa := (cuntzBlock_nonneg _ _ ha hb).isSelfAdjoint) + rw [cfc_map_prod (S := ℂ) f a b (hf := hf.continuousOn) + (ha := ha.isSelfAdjoint) (hb := hb.isSelfAdjoint) + (hab := by exact Prod.ext ha.isSelfAdjoint hb.isSelfAdjoint)] at h + exact h.symm + +/-- Intertwining positives also intertwines their continuous real functions. +The proof uses block commutation, so no polar decomposition is assumed. -/ +theorem cfc_matrix_intertwine (a : CStarMatrix ι ι A) (b : CStarMatrix κ κ A) + (x : Matrix ι κ A) (ha : 0 ≤ a) (hb : 0 ≤ b) + (hx : CStarMatrix.ofMatrix.symm a * x = x * CStarMatrix.ofMatrix.symm b) + (f : ℝ → ℝ) (hf : Continuous f) : + CStarMatrix.ofMatrix.symm (cfc f a) * x = x * CStarMatrix.ofMatrix.symm (cfc f b) := by + let D : CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A := CStarMatrix.ofMatrix (cuntzBlock a b) + let X : CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A := CStarMatrix.ofMatrix (Matrix.fromBlocks 0 x 0 0) + have hc : Commute D X := by + have hc' : + (Matrix.fromBlocks (CStarMatrix.ofMatrix.symm a) 0 0 (CStarMatrix.ofMatrix.symm b) * + Matrix.fromBlocks 0 x 0 0 : Matrix (ι ⊕ κ) (ι ⊕ κ) A) = + Matrix.fromBlocks 0 x 0 0 * + Matrix.fromBlocks (CStarMatrix.ofMatrix.symm a) 0 0 (CStarMatrix.ofMatrix.symm b) := by + simp only [Matrix.fromBlocks_multiply, Matrix.mul_zero, Matrix.zero_mul, add_zero, zero_add, hx] + exact hc' + have h := (hc.cfc_real f).eq + rw [show cfc f D = CStarMatrix.ofMatrix (cuntzBlock + (CStarMatrix.ofMatrix.symm (cfc f a)) (CStarMatrix.ofMatrix.symm (cfc f b))) from + cfc_cuntzBlock a b ha hb f hf] at h + have h' := congrArg (fun z : CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A => + (CStarMatrix.ofMatrix.symm z).submatrix Sum.inl Sum.inr) h + change (cuntzBlock (CStarMatrix.ofMatrix.symm (cfc f a)) (CStarMatrix.ofMatrix.symm (cfc f b)) * Matrix.fromBlocks 0 x 0 0).submatrix Sum.inl Sum.inr = + (Matrix.fromBlocks 0 x 0 0 * cuntzBlock (CStarMatrix.ofMatrix.symm (cfc f a)) (CStarMatrix.ofMatrix.symm (cfc f b))).submatrix Sum.inl Sum.inr at h' + ext i j + simpa [cuntzBlock, Matrix.fromBlocks_multiply, Matrix.submatrix] using congrFun (congrFun h' i) j + +end Rectangular + +/-- A continuous cutoff factor, regular at zero for a strictly positive threshold. -/ +def cutoffSquareFactor (ε t : ℝ) : ℝ := Real.sqrt (max (t-ε) 0 / max t ε) + +theorem cutoffSquareFactor_continuous {ε : ℝ} (hε : 0 < ε) : + Continuous (cutoffSquareFactor ε) := by + apply Continuous.sqrt + apply Continuous.div (by fun_prop) (by fun_prop) + intro t + exact (hε.trans_le (le_max_right t ε)).ne' + +theorem cutoffSquareFactor_identity {ε : ℝ} (hε : 0 < ε) (t : ℝ) : + cutoffSquareFactor ε t * t * cutoffSquareFactor ε t = max (t-ε) 0 := by + have hd : 0 < max t ε := hε.trans_le (le_max_right _ _) + have hs := Real.mul_self_sqrt (div_nonneg (le_max_right (t-ε) 0) hd.le) + change Real.sqrt _ * t * Real.sqrt _ = _ + rw [mul_right_comm, hs] + rcases le_total t ε with h | h + · simp [max_eq_right (sub_nonpos.mpr h)] + · rw [max_eq_left h, div_mul_cancel₀ _ (hε.trans_le h).ne'] + +/-- The actual cutoff factors as g(a) a g(a). -/ +theorem cutoffSquareFactor_cfc {a : A} (ha : 0 ≤ a) {ε : ℝ} (hε : 0 < ε) : + cfc (cutoffSquareFactor ε) a * a * cfc (cutoffSquareFactor ε) a = + cuntzCutoff a ε := by + have hf : ContinuousOn (cutoffSquareFactor ε) (spectrum ℝ a) := (cutoffSquareFactor_continuous hε).continuousOn + have he : cfc (fun t : ℝ => cutoffSquareFactor ε t * t * cutoffSquareFactor ε t) a = + cfc (cutoffSquareFactor ε) a * a * cfc (cutoffSquareFactor ε) a := by + rw [cfc_mul (fun t : ℝ => cutoffSquareFactor ε t * t) (cutoffSquareFactor ε) a + (hf.mul continuousOn_id) hf, cfc_mul (cutoffSquareFactor ε) (fun t : ℝ => t) a + hf continuousOn_id, cfc_id' ℝ a ha.isSelfAdjoint] + rw [← he] + apply cfc_congr + intro t ht + exact cutoffSquareFactor_identity hε t + +/-- Matching positive cutoffs of unequal rectangular Gram matrices are +Cuntz equivalent, proved by an exact rectangular factorization. -/ +theorem cuntzEquivalent_cutoff_rectangular_gram {ι κ : Type*} [Fintype ι] [Fintype κ] [DecidableEq ι] [DecidableEq κ] + (x : Matrix ι κ A) (ha : 0 ≤ CStarMatrix.ofMatrix (x*x.conjTranspose)) + (hb : 0 ≤ CStarMatrix.ofMatrix (x.conjTranspose*x)) {ε : ℝ} (hε : 0 < ε) : + CuntzEquivalent + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix (x*x.conjTranspose)) ε)) + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix (x.conjTranspose*x)) ε)) := by + classical + let a := CStarMatrix.ofMatrix (x*x.conjTranspose) + let b := CStarMatrix.ofMatrix (x.conjTranspose*x) + let L := cfc (cutoffSquareFactor ε) a + let R := cfc (cutoffSquareFactor ε) b + have hL : star L = L := (cfc_predicate _ _ : IsSelfAdjoint L).star_eq + have hR : star R = R := (cfc_predicate _ _ : IsSelfAdjoint R).star_eq + have hx : CStarMatrix.ofMatrix.symm L * x = x * CStarMatrix.ofMatrix.symm R := + cfc_matrix_intertwine a b x ha hb (Matrix.mul_assoc _ _ _) _ + (cutoffSquareFactor_continuous hε) + let y := CStarMatrix.ofMatrix.symm L * x + have hy : y = x * CStarMatrix.ofMatrix.symm R := hx + have hl : y*y.conjTranspose = CStarMatrix.ofMatrix.symm (cuntzCutoff a ε) := by + dsimp only [y] + rw [Matrix.conjTranspose_mul] + change CStarMatrix.ofMatrix.symm L * x * (x.conjTranspose * CStarMatrix.ofMatrix.symm (star L)) = _ + rw [hL] + have he := cutoffSquareFactor_cfc ha hε + change L * a * L = _ at he + have he' := congrArg CStarMatrix.ofMatrix.symm he + change CStarMatrix.ofMatrix.symm L * (x*x.conjTranspose) * CStarMatrix.ofMatrix.symm L = _ at he' + simpa only [Matrix.mul_assoc] using he' + have hr : y.conjTranspose*y = CStarMatrix.ofMatrix.symm (cuntzCutoff b ε) := by + rw [hy, Matrix.conjTranspose_mul] + change CStarMatrix.ofMatrix.symm (star R) * x.conjTranspose * (x * CStarMatrix.ofMatrix.symm R) = _ + rw [hR] + have he := cutoffSquareFactor_cfc hb hε + change R * b * R = _ at he + have he' := congrArg CStarMatrix.ofMatrix.symm he + change CStarMatrix.ofMatrix.symm R * (x.conjTranspose*x) * CStarMatrix.ofMatrix.symm R = _ at he' + simpa only [Matrix.mul_assoc] using he' + rw [← hl, ← hr] + exact cuntzEquivalent_rectangular_gram y + +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Squares.lean b/lean/OAI/Analysis/Cuntz/Squares.lean new file mode 100644 index 0000000000000000000000000000000000000000..56cd6cbaeae65151383c122e20bb5471a9b60189 --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Squares.lean @@ -0,0 +1,192 @@ +import OAI.Analysis.Cuntz.State +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Isometric +import Mathlib.Analysis.SpecialFunctions.Sqrt +import Mathlib.Tactic.FieldSimp + +namespace OAI + +noncomputable section + +/-! Square approximation, square swap, and orthogonal additivity. -/ + +section +open scoped CStarAlgebra +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- The scalar error estimate underlying approximate comparison of xx* and x*x. -/ +theorem squareSwap_scalar_error {t δ : ℝ} (ht : 0 ≤ t) (hδ : 0 < δ) : + |t - (Real.sqrt (t+δ))⁻¹ * t * t * (Real.sqrt (t+δ))⁻¹| ≤ δ := by + have hd : 0 < t+δ := add_pos_of_nonneg_of_pos ht hδ + have hs : Real.sqrt (t+δ) ≠ 0 := (Real.sqrt_pos.mpr hd).ne' + have he : t - (Real.sqrt (t+δ))⁻¹ * t * t * (Real.sqrt (t+δ))⁻¹ = t*δ/(t+δ) := by + field_simp + rw [Real.sq_sqrt hd.le] + ring + rw [he, abs_of_nonneg (by positivity)] + apply (div_le_iff₀ hd).mpr + nlinarith + +/-- A concrete functional-calculus approximation. No polar decomposition +or square-swap property of dimension functions is assumed. -/ +theorem exists_squareSwap_approx (x : A) (ε : ℝ) (hε : 0 < ε) : + ∃ v : A, ‖x * star x - v * (star x * x) * star v‖ < ε := by + let b := x * star x + have hb : 0 ≤ b := mul_star_self_nonneg x + have hbsa : IsSelfAdjoint b := hb.isSelfAdjoint + let δ := ε / 2 + have hδ : 0 < δ := half_pos hε + let f : ℝ → ℝ := fun t => (Real.sqrt (t+δ))⁻¹ + have hf : ContinuousOn f (spectrum ℝ b) := by + apply ContinuousOn.inv₀ ((continuousOn_id.add continuousOn_const).sqrt) + intro t ht + exact (Real.sqrt_pos.mpr (add_pos_of_nonneg_of_pos (spectrum_nonneg_of_nonneg hb ht) hδ)).ne' + let L := cfc f b + have hL : star L = L := (cfc_predicate f b : IsSelfAdjoint L).star_eq + have he : cfc (fun t => t - f t * t * t * f t) b = b - L * b * b * L := by + rw [cfc_sub (fun t : ℝ => t) (fun t => f t * t * t * f t) b continuousOn_id (((hf.mul continuousOn_id).mul continuousOn_id).mul hf)] + rw [cfc_mul (fun t => f t * t * t) f b ((hf.mul continuousOn_id).mul continuousOn_id) hf] + rw [cfc_mul (fun t => f t * t) (fun t : ℝ => t) b (hf.mul continuousOn_id) continuousOn_id] + rw [cfc_mul f (fun t : ℝ => t) b hf continuousOn_id, cfc_id' ℝ b] + refine ⟨L*x, ?_⟩ + have hn : ‖cfc (fun t => t - f t * t * t * f t) b‖ ≤ δ := by + apply norm_cfc_le hδ.le + intro t ht + exact squareSwap_scalar_error (spectrum_nonneg_of_nonneg hb ht) hδ + have he' : x * star x - (L*x) * (star x*x) * star (L*x) = b - L*b*b*L := by + simp only [star_mul, hL, b, mul_assoc] + rw [he', ← he] + exact hn.trans_lt (half_lt_self hε) + +end Kaplansky + +end + +section +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] +variable {ι κ : Type*} [Fintype ι] [Fintype κ] + +/-- Cuntz square swapping is proved by norm approximants. -/ +theorem cuntzLE_mul_star_self [DecidableEq ι] (x : CStarMatrix ι ι A) : + CuntzLE (CStarMatrix.ofMatrix.symm (x * star x)) + (CStarMatrix.ofMatrix.symm (star x * x)) := by + apply (CuntzLE.iff_approx _ _).mpr + intro ε hε + obtain ⟨v, hv⟩ := exists_squareSwap_approx x ε hε + exact ⟨CStarMatrix.ofMatrix.symm v, hv⟩ + +theorem cuntzEquivalent_square_swap [DecidableEq ι] (x : CStarMatrix ι ι A) : + CuntzEquivalent (CStarMatrix.ofMatrix.symm (x * star x)) + (CStarMatrix.ofMatrix.symm (star x * x)) := by + refine ⟨cuntzLE_mul_star_self x, ?_⟩ + simpa only [star_star] using cuntzLE_mul_star_self (star x) + +/-- Rectangular Gram matrices of different sizes have the same Cuntz class. -/ +theorem cuntzEquivalent_rectangular_gram (v : Matrix ι κ A) : + CuntzEquivalent (v * v.conjTranspose) (v.conjTranspose * v) := by + classical + let X : CStarMatrix (ι ⊕ κ) (ι ⊕ κ) A := CStarMatrix.ofMatrix (Matrix.fromBlocks 0 v 0 0) + have hleft : CStarMatrix.ofMatrix.symm (X * star X) = + cuntzBlock (v * v.conjTranspose) (0 : Matrix κ κ A) := by + change Matrix.fromBlocks 0 v 0 0 * (Matrix.fromBlocks 0 v 0 0).conjTranspose = _ + simp [cuntzBlock, Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply] + have hright : CStarMatrix.ofMatrix.symm (star X * X) = + cuntzBlock (0 : Matrix ι ι A) (v.conjTranspose * v) := by + change (Matrix.fromBlocks 0 v 0 0).conjTranspose * Matrix.fromBlocks 0 v 0 0 = _ + simp [cuntzBlock, Matrix.fromBlocks_conjTranspose, Matrix.fromBlocks_multiply] + have h := cuntzEquivalent_square_swap X + rw [hleft, hright] at h + exact (cuntzEquivalent_block_zero _).symm.trans + (h.trans ((cuntzEquivalent_block_comm _ _).trans (cuntzEquivalent_block_zero _))) + +/-- Positives formed as either square have equal values under every +constructed dimension state; this is not an assumed quasitrace axiom. -/ +theorem CuntzDimensionState.value_square_swap (d : CuntzDimensionState A) (n : ℕ) + (x : CStarMatrix (Fin n) (Fin n) A) : + d.value ⟨n, CStarMatrix.ofMatrix.symm (x * star x), mul_star_self_nonneg x⟩ = + d.value ⟨n, CStarMatrix.ofMatrix.symm (star x * x), star_mul_self_nonneg x⟩ := + d.value_eq (cuntzEquivalent_square_swap x) + +end Kaplansky + +end + +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- Orthogonality passes to actual positive square roots. -/ +theorem sqrt_mul_sqrt_eq_zero_of_mul_eq_zero {a b : A} (ha : 0 ≤ a) (hb : 0 ≤ b) + (hab : a*b = 0) : CFC.sqrt a * CFC.sqrt b = 0 := by + have hsa : star a = a := ha.isSelfAdjoint.star_eq + have hsb : star (CFC.sqrt b) = CFC.sqrt b := (CFC.sqrt_nonneg b).isSelfAdjoint.star_eq + have h1 : a * CFC.sqrt b = 0 := by + apply (CStarRing.mul_star_self_eq_zero_iff _).mp + calc + (a * CFC.sqrt b) * star (a * CFC.sqrt b) = a * b * a := by + simp only [star_mul, hsa, hsb, mul_assoc] + rw [← mul_assoc (CFC.sqrt b), CFC.sqrt_mul_sqrt_self b hb] + _ = 0 := by rw [hab, zero_mul] + apply (CStarRing.star_mul_self_eq_zero_iff _).mp + have hsa' : star (CFC.sqrt a) = CFC.sqrt a := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + calc + star (CFC.sqrt a * CFC.sqrt b) * (CFC.sqrt a * CFC.sqrt b) = CFC.sqrt b * (a * CFC.sqrt b) := by + simp only [star_mul, hsa', hsb, mul_assoc] + rw [← mul_assoc (CFC.sqrt a), CFC.sqrt_mul_sqrt_self a ha] + _ = 0 := by rw [h1, mul_zero] + +/-- Orthogonal positive addition agrees with block addition in the Cuntz monoid. -/ +theorem cuntzEquivalent_orthogonal_add {n : ℕ} + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a*b = 0) : + CuntzEquivalent (CStarMatrix.ofMatrix.symm (a+b)) + (cuntzBlock (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm b)) := by + let : NonUnitalContinuousFunctionalCalculus ℝ (CStarMatrix (Fin n) (Fin n) A) IsSelfAdjoint := + IsSelfAdjoint.instNonUnitalContinuousFunctionalCalculus + let : NonnegSpectrumClass ℝ (CStarMatrix (Fin n) (Fin n) A) := + CStarAlgebra.instNonnegSpectrumClass' + let S := CFC.sqrt a + let T := CFC.sqrt b + have hS : star S = S := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + have hT : star T = T := (CFC.sqrt_nonneg b).isSelfAdjoint.star_eq + have hST : S*T = 0 := sqrt_mul_sqrt_eq_zero_of_mul_eq_zero ha hb hab + have hTS : T*S = 0 := by simpa only [star_mul, hS, hT, star_zero] using congrArg star hST + let v := Matrix.fromCols (CStarMatrix.ofMatrix.symm S) (CStarMatrix.ofMatrix.symm T) + have hl : v * v.conjTranspose = CStarMatrix.ofMatrix.symm (a+b) := by + dsimp [v] + rw [Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, Matrix.fromCols_mul_fromRows] + change S*star S + T*star T = a+b + rw [hS, hT, CFC.sqrt_mul_sqrt_self a ha, CFC.sqrt_mul_sqrt_self b hb] + have hr : v.conjTranspose * v = + cuntzBlock (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm b) := by + dsimp [v] + rw [Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, Matrix.fromRows_mul_fromCols] + change Matrix.fromBlocks (CStarMatrix.ofMatrix.symm (star S * S)) + (CStarMatrix.ofMatrix.symm (star S * T)) (CStarMatrix.ofMatrix.symm (star T * S)) + (CStarMatrix.ofMatrix.symm (star T * T)) = _ + rw [hS, hT, hST, hTS, CFC.sqrt_mul_sqrt_self a ha, CFC.sqrt_mul_sqrt_self b hb] + rfl + simpa only [hl, hr] using cuntzEquivalent_rectangular_gram v + +theorem CuntzDimensionState.value_orthogonal_add (d : CuntzDimensionState A) (n : ℕ) + (a b : CStarMatrix (Fin n) (Fin n) A) (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a*b = 0) : + d.value ⟨n, CStarMatrix.ofMatrix.symm (a+b), add_nonneg ha hb⟩ = + d.value ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + + d.value ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := by + let pa : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + let pb : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ + rw [← d.value_add pa pb] + exact d.value_eq ((cuntzEquivalent_orthogonal_add a b ha hb hab).trans + (CuntzPositiveMatrix.add_equiv pa pb).symm) + +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/State.lean b/lean/OAI/Analysis/Cuntz/State.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbc6ac31335cff744f0a766b7a50dfd2e8b69cfd --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/State.lean @@ -0,0 +1,129 @@ +import OAI.Algebra.OrderedStates.Semigroup +import OAI.Analysis.Cuntz.Monoid + +namespace OAI + +noncomputable section + +/-! Dimension states of the Cuntz monoid and positivity. -/ + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +theorem normalizedCuntzState_exists + (hf : ∀ k : ℕ, 0 < k → ¬ ProperlyInfinite (CStarMatrix (Fin k) (Fin k) A)) : + ∃ f : CuntzMonoid A →+ ℝ, Monotone f ∧ f (cuntzUnit A 1) = 1 := by + apply positive_orderUnit_normalized_state (cuntzUnit A 1) + cuntzMonoid_nonneg cuntzMonoid_orderUnit + intro k hk h + exact hf k hk (properlyInfinite_of_cuntzUnit_compression k h) + +/-- A normalized dimension state on actual positive finite matrices. +This is a semigroup state, not yet a quasitrace or its regularization. -/ +structure CuntzDimensionState (A : Type*) [CStarAlgebra A] where + state : CuntzMonoid A →+ ℝ + monotone : Monotone state + normalized : state (cuntzUnit A 1) = 1 + +theorem cuntzDimensionState_nonempty + (hf : ∀ k : ℕ, 0 < k → ¬ ProperlyInfinite (CStarMatrix (Fin k) (Fin k) A)) : + Nonempty (CuntzDimensionState A) := by + obtain ⟨f, hm, hu⟩ := normalizedCuntzState_exists hf + exact ⟨⟨f, hm, hu⟩⟩ + +namespace CuntzDimensionState + +def value (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : ℝ := d.state (cuntzClass a) + +theorem value_mono (d : CuntzDimensionState A) {a b : CuntzPositiveMatrix A} + (h : CuntzLE a.matrix b.matrix) : d.value a ≤ d.value b := + d.monotone ((cuntzClass_le a b).mpr h) + +theorem value_eq (d : CuntzDimensionState A) {a b : CuntzPositiveMatrix A} + (h : CuntzEquivalent a.matrix b.matrix) : d.value a = d.value b := + le_antisymm (d.value_mono h.1) (d.value_mono h.2) + +theorem value_add (d : CuntzDimensionState A) (a b : CuntzPositiveMatrix A) : + d.value (a.add b) = d.value a + d.value b := by + simp only [value, cuntzClass_add, map_add] + +theorem value_unit (d : CuntzDimensionState A) (n : ℕ) : + d.value (.unit n) = (n : ℝ) := by + change d.state (cuntzUnit A n) = _ + rw [← cuntzUnit_nsmul, map_nsmul, d.normalized] + simp + +theorem value_zero (d : CuntzDimensionState A) : d.value .zero = 0 := d.state.map_zero + +theorem value_nonneg (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : 0 ≤ d.value a := by + simpa only [map_zero, value] using d.monotone (cuntzMonoid_nonneg (cuntzClass a)) + +theorem value_le_size (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) : + d.value a ≤ a.size := (d.value_mono a.le_unit).trans_eq (d.value_unit a.size) + +end CuntzDimensionState +end Kaplansky + +open scoped Matrix CStarAlgebra + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +variable {A : Type*} [CStarAlgebra A] + +/-- Positive order gives actual approximate conjugation. An inverse +square-root of b+δ1 supplies a contraction and an error bounded by δ. -/ +theorem exists_positiveOrder_approx {a b : A} (ha : 0 ≤ a) (hab : a ≤ b) + (ε : ℝ) (hε : 0 < ε) : ∃ v : A, ‖a - v*b*star v‖ < ε := by + let δ := ε / 2 + have hδ : 0 < δ := half_pos hε + have hd0 : 0 ≤ δ • (1 : A) := smul_nonneg hδ.le zero_le_one + have hd : IsStrictlyPositive (δ • (1 : A)) := by + refine ⟨hd0, ?_⟩ + simpa only [Algebra.algebraMap_eq_smul_one] using + (isUnit_iff_ne_zero.mpr hδ.ne').map (algebraMap ℝ A) + let Q := b + δ • (1 : A) + have hQ : IsStrictlyPositive Q := IsStrictlyPositive.nonneg_add (ha.trans hab) hd + let S := CFC.sqrt a + let L := Q ^ (-(1/2) : ℝ) + let v := S * L + have hS : star S = S := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + have hL : star L = L := (CFC.rpow_nonneg (a := Q) (y := (-(1/2) : ℝ))).isSelfAdjoint.star_eq + have hv : ‖v‖ ≤ 1 := (le_iff_norm_sqrt_mul_rpow a Q ha hQ).mp + (hab.trans (le_add_of_nonneg_right hd0)) + have he : v * Q * star v = a := by + calc + v * Q * star v = S * (L * Q * L) * S := by simp only [v, star_mul, hS, hL, mul_assoc] + _ = S * S := by rw [CFC.conjugate_rpow_neg_one_half Q hQ]; simp + _ = a := CFC.sqrt_mul_sqrt_self a ha + have herr : a - v*b*star v = δ • (v*star v) := by + rw [← he] + simp only [Q, mul_add, add_mul, mul_smul_comm, smul_mul_assoc, mul_one, add_sub_cancel_left] + refine ⟨v, ?_⟩ + rw [herr, norm_smul, Real.norm_of_nonneg hδ.le] + have hn := norm_nonneg v + have hsq : ‖v‖ * ‖v‖ ≤ 1 := by nlinarith + have hbound : δ * (‖v‖ * ‖v‖) ≤ δ := by nlinarith + exact (mul_le_mul_of_nonneg_left (by simpa only [norm_star] using norm_mul_le v (star v)) hδ.le).trans_lt + (hbound.trans_lt (half_lt_self hε)) + +theorem cuntzLE_of_nonneg_le {n : ℕ} {a b : CStarMatrix (Fin n) (Fin n) A} + (ha : 0 ≤ a) (hab : a ≤ b) : + CuntzLE (CStarMatrix.ofMatrix.symm a) (CStarMatrix.ofMatrix.symm b) := by + apply (CuntzLE.iff_approx _ _).mpr + intro ε hε + obtain ⟨v, hv⟩ := exists_positiveOrder_approx ha hab ε hε + exact ⟨CStarMatrix.ofMatrix.symm v, hv⟩ + +theorem CuntzDimensionState.value_mono_positive (d : CuntzDimensionState A) + (n : ℕ) (a b : CStarMatrix (Fin n) (Fin n) A) + (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a ≤ b) : + d.value ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ ≤ + d.value ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := + d.value_mono (cuntzLE_of_nonneg_le ha hab) + +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Cuntz/Translation.lean b/lean/OAI/Analysis/Cuntz/Translation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f5eebd31f23c238447e49566c3b43d59e1629288 --- /dev/null +++ b/lean/OAI/Analysis/Cuntz/Translation.lean @@ -0,0 +1,224 @@ +import OAI.Analysis.Cuntz.Distribution + +namespace OAI + +noncomputable section + +/-! Order of spectral cutoffs, translations, and continuity. -/ + +open scoped Matrix CStarAlgebra NNReal +open MeasureTheory + +namespace Kaplansky +attribute [local instance] CStarAlgebra.spectralOrder CStarAlgebra.spectralOrderedRing +attribute [local instance] matrixRealFunctionalCalculus productMatrixRealFunctionalCalculus +variable {A : Type*} [CStarAlgebra A] + +/-- One-sided order perturbation suffices for strict cutoff comparison. -/ +theorem cuntzLE_cutoff_of_le_add {n : ℕ} + {a b : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) + {δ ε : ℝ} (hδε : δ < ε) (hab : a ≤ b + δ • 1) : + CuntzLE (CStarMatrix.ofMatrix.symm (cuntzCutoff a ε)) + (CStarMatrix.ofMatrix.symm b) := by + have hδ : 0 < ε-δ := sub_pos.mpr hδε + obtain ⟨x, hx, hsq, hloc⟩ := exists_cutoff_localizer ha ε + have hc := star_left_conjugate_le_conjugate hab x + simp only [hx, mul_add, add_mul, mul_smul_comm, smul_mul_assoc, mul_one, hsq] at hc + have hbound : (ε-δ) • cuntzCutoff a ε ≤ x*b*x := by + rw [sub_smul] + exact sub_le_iff_le_add.mpr (hloc.trans hc) + have hcmp := cuntzLE_of_nonneg_le (smul_nonneg hδ.le (cuntzCutoff_nonneg a ε)) hbound + have hsc := cuntzEquivalent_pos_smul (cuntzCutoff a ε) hδ + have hex := CuntzLE.exact (CStarMatrix.ofMatrix.symm b) (CStarMatrix.ofMatrix.symm x) + change CuntzLE (CStarMatrix.ofMatrix.symm (x*b*star x)) _ at hex + rw [hx] at hex + exact hsc.2.trans (hcmp.trans hex) + +/-- The positive part plus the threshold dominates the original element. -/ +theorem le_cuntzCutoff_add {a : A} (ha : 0 ≤ a) (t : ℝ) : + a ≤ cuntzCutoff a t + t • 1 := by + have h := cfc_mono (a := a) (f := fun s : ℝ => s) + (g := fun s : ℝ => max (s-t) 0 + t) (fun s _ => by linarith [le_max_left (s-t) 0]) + rw [cfc_add (a := a) (fun s : ℝ => max (s-t) 0) (fun _ => t)] at h + simpa only [cfc_const t a ha.isSelfAdjoint, cfc_id' ℝ a ha.isSelfAdjoint, + Algebra.algebraMap_eq_smul_one, cuntzCutoff] using h + +/-- Positive order preserves matching cutoff Cuntz classes. +This is Cuntz comparison, not operator monotonicity of positive parts. -/ +theorem cuntzLE_cutoff_of_le {n : ℕ} {a b : CStarMatrix (Fin n) (Fin n) A} + (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a ≤ b) (t : ℝ) : + CuntzLE (CStarMatrix.ofMatrix.symm (cuntzCutoff a t)) + (CStarMatrix.ofMatrix.symm (cuntzCutoff b t)) := by + apply (cuntzLE_iff_all_cutoffs _ (cuntzCutoff_nonneg a t) _).mpr + intro δ hδ + rw [cuntzCutoff_cutoff ha t hδ.le] + exact cuntzLE_cutoff_of_le_add ha (by linarith : t < t+δ) + (hab.trans (le_cuntzCutoff_add hb t)) + +namespace CuntzDimensionState + +theorem distribution_mono_positive (d : CuntzDimensionState A) {n : ℕ} + {a b : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) (hb : 0 ≤ b) + (hab : a ≤ b) (t : ℝ) : + d.distribution ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ t ≤ + d.distribution ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ t := + d.regularized_mono (cuntzLE_cutoff_of_le ha hb hab t) + +/-- The actual layer-cake integral is monotone on each positive matrix cone. -/ +theorem spectralValue_mono_positive (d : CuntzDimensionState A) {n : ℕ} + {a b : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a ≤ b) : + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ ≤ + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ := by + let pa : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ + let pb : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ + have hR : ‖a‖ ≤ ‖a‖ + ‖b‖ := le_add_of_nonneg_right (norm_nonneg b) + have hR' : ‖b‖ ≤ ‖a‖ + ‖b‖ := le_add_of_nonneg_left (norm_nonneg a) + rw [d.spectralValue_eq_integral pa hR, d.spectralValue_eq_integral pb hR'] + exact intervalIntegral.integral_mono_on (add_nonneg (norm_nonneg a) (norm_nonneg b)) + (d.distribution_intervalIntegrable pa _ _) (d.distribution_intervalIntegrable pb _ _) + (fun t _ => d.distribution_mono_positive ha hb hab t) + +end CuntzDimensionState + +theorem cuntzCutoff_add_scalar {a : A} (ha : 0 ≤ a) (r t : ℝ) : + cuntzCutoff (a + r • 1) t = cuntzCutoff a (t-r) := by + have he : cfc (fun s : ℝ => s+r) a = a+r • 1 := by + rw [cfc_add (a := a) (fun s : ℝ => s) (fun _ => r), cfc_id' ℝ a ha.isSelfAdjoint, cfc_const r a ha.isSelfAdjoint, + Algebra.algebraMap_eq_smul_one] + unfold cuntzCutoff + rw [← he, ← cfc_comp' (fun s : ℝ => max (s-t) 0) (fun s : ℝ => s+r) a] + apply cfc_congr + intro s hs + dsimp only + congr 1 + ring + +/-- A negative spectral threshold contributes at least its opposite scalar. -/ +theorem neg_smul_one_le_cuntzCutoff {a : A} (ha : 0 ≤ a) (t : ℝ) : + (-t) • (1 : A) ≤ cuntzCutoff a t := by + have he : cfc (fun _ : ℝ => -t) a ≤ cfc (fun s : ℝ => max (s-t) 0) a := by + apply cfc_mono (hf := continuousOn_const) (hg := by fun_prop) + intro s hs + have hs0 := spectrum_nonneg_of_nonneg ha hs + exact (by linarith : -t ≤ s-t).trans (le_max_left _ _) + simpa only [cfc_const (-t) a ha.isSelfAdjoint, + Algebra.algebraMap_eq_smul_one, cuntzCutoff] using he + +/-- Adding a nonnegative scalar identity to an actual positive finite matrix. -/ +def CuntzPositiveMatrix.shift (a : CuntzPositiveMatrix A) (r : ℝ) (hr : 0 ≤ r) : + CuntzPositiveMatrix A := + ⟨a.size, CStarMatrix.ofMatrix.symm (CStarMatrix.ofMatrix a.matrix + r • 1), + add_nonneg a.nonneg (smul_nonneg hr zero_le_one)⟩ + +namespace CuntzDimensionState + +theorem distribution_shift (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + (r : ℝ) (hr : 0 ≤ r) (t : ℝ) : + d.distribution (a.shift r hr) t = d.distribution a (t-r) := by + unfold distribution + have he : (a.shift r hr).cutoff t = a.cutoff (t-r) := by + cases a with + | mk n a ha => + have hc := cuntzCutoff_add_scalar ha r t + change CuntzPositiveMatrix.mk n + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a + r • 1) t)) _ = + CuntzPositiveMatrix.mk n + (CStarMatrix.ofMatrix.symm (cuntzCutoff (CStarMatrix.ofMatrix a) (t-r))) _ + congr 1 + rw [he] + +/-- Below zero, every positive matrix has full normalized spectral dimension. -/ +theorem distribution_of_neg (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + {t : ℝ} (ht : t < 0) : d.distribution a t = (a.size : ℝ) := by + apply le_antisymm (d.distribution_le_size a t) + have hle := neg_smul_one_le_cuntzCutoff a.nonneg t + let p : CuntzPositiveMatrix A := ⟨a.size, + CStarMatrix.ofMatrix.symm ((-t) • (1 : CStarMatrix (Fin a.size) (Fin a.size) A)), + smul_nonneg (neg_pos.mpr ht).le zero_le_one⟩ + have hp : d.regularized p = (a.size : ℝ) := by + rw [← d.regularized_unit a.size] + exact d.regularized_eq (cuntzEquivalent_pos_smul 1 (neg_pos.mpr ht)) + rw [← hp] + exact d.regularized_mono (cuntzLE_of_nonneg_le p.nonneg hle) + +/-- Translation by a nonnegative scalar identity adds exactly size times scalar. -/ +theorem spectralValue_shift (d : CuntzDimensionState A) (a : CuntzPositiveMatrix A) + (r : ℝ) (hr : 0 ≤ r) : + d.spectralValue (a.shift r hr) = d.spectralValue a + r * a.size := by + let : NormedSpace ℝ (CStarMatrix (Fin a.size) (Fin a.size) A) := + NormedSpace.restrictScalars ℝ ℂ _ + let : NormSMulClass ℝ (CStarMatrix (Fin a.size) (Fin a.size) A) := + NormedSpace.toNormSMulClass + let R := ‖CStarMatrix.ofMatrix a.matrix‖ + r + have hR : ‖CStarMatrix.ofMatrix (a.shift r hr).matrix‖ ≤ R := by + change ‖CStarMatrix.ofMatrix a.matrix + r • 1‖ ≤ ‖CStarMatrix.ofMatrix a.matrix‖ + r + apply (norm_add_le _ _).trans + apply add_le_add_right + rw [norm_smul, Real.norm_of_nonneg hr] + have h1 : ‖(1 : CStarMatrix (Fin a.size) (Fin a.size) A)‖ ≤ 1 := by + nontriviality CStarMatrix (Fin a.size) (Fin a.size) A + simp only [norm_one, le_refl] + exact mul_le_of_le_one_right hr h1 + rw [d.spectralValue_eq_integral _ hR] + have hi := intervalIntegral.integral_add_adjacent_intervals + (d.distribution_intervalIntegrable (a.shift r hr) 0 r) + (d.distribution_intervalIntegrable (a.shift r hr) r R) + rw [← hi] + have hlow : (∫ t in (0 : ℝ)..r, d.distribution (a.shift r hr) t) = r*a.size := by + have he := intervalIntegral.integral_congr_Ioo_of_le (μ := volume) hr + (f := d.distribution (a.shift r hr)) (g := fun _ => (a.size : ℝ)) (by + intro t ht + rw [d.distribution_shift] + exact d.distribution_of_neg a (sub_neg.mpr ht.2)) + simpa using he + rw [hlow] + simp_rw [d.distribution_shift] + rw [intervalIntegral.integral_comp_sub_right] + simp only [sub_self, R, add_sub_cancel_right, spectralValue] + exact add_comm _ _ + + +/-- One-sided norm control for the actual spectral integral. -/ +theorem spectralValue_le_add_norm (d : CuntzDimensionState A) {n : ℕ} + {a b : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) (hb : 0 ≤ b) : + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ ≤ + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ + ‖a-b‖ * n := by + have hab : a ≤ b + ‖a-b‖ • 1 := by + have he := (ha.isSelfAdjoint.sub hb.isSelfAdjoint).le_algebraMap_norm_self + rw [Algebra.algebraMap_eq_smul_one] at he + exact sub_le_iff_le_add'.mp he + let pb : CuntzPositiveMatrix A := ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩ + have h := d.spectralValue_mono_positive ha (pb.shift ‖a-b‖ (norm_nonneg _)).nonneg hab + change d.spectralValue _ ≤ d.spectralValue (pb.shift ‖a-b‖ (norm_nonneg _)) at h + rwa [d.spectralValue_shift] at h + +/-- On n-by-n positives the integral is n-Lipschitz in the actual C*-norm. -/ +theorem abs_spectralValue_sub_le (d : CuntzDimensionState A) {n : ℕ} + {a b : CStarMatrix (Fin n) (Fin n) A} (ha : 0 ≤ a) (hb : 0 ≤ b) : + |d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a, ha⟩ - + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm b, hb⟩| ≤ ‖a-b‖ * n := by + have h := d.spectralValue_le_add_norm ha hb + have h' := d.spectralValue_le_add_norm hb ha + rw [norm_sub_rev b a] at h' + exact abs_le.mpr ⟨by linarith, by linarith⟩ + +theorem spectralValue_lipschitz (d : CuntzDimensionState A) (n : ℕ) : + LipschitzWith (n : ℝ≥0) (fun a : {a : CStarMatrix (Fin n) (Fin n) A // 0 ≤ a} => + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a.val, a.property⟩) := by + apply LipschitzWith.of_dist_le_mul + intro a b + simpa only [Real.dist_eq, Subtype.dist_eq, dist_eq_norm, NNReal.coe_natCast, Real.norm_eq_abs, mul_comm] + using d.abs_spectralValue_sub_le a.property b.property + +/-- Continuity on the full positive cone, without a finite-spectrum assumption. -/ +theorem spectralValue_continuous (d : CuntzDimensionState A) (n : ℕ) : + Continuous (fun a : {a : CStarMatrix (Fin n) (Fin n) A // 0 ≤ a} => + d.spectralValue ⟨n, CStarMatrix.ofMatrix.symm a.val, a.property⟩) := + (d.spectralValue_lipschitz n).continuous + +end CuntzDimensionState +end Kaplansky + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Clipping.lean b/lean/OAI/Analysis/Daugavet/Clipping.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2a41a829f792cc82c9f684b2dd8284f76089ef2 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Clipping.lean @@ -0,0 +1,356 @@ +import OAI.Analysis.Daugavet.Model + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX uY u_1 + +namespace ExactModuli + +/-- Scalar clipping, equivalently sign(a) * min(|a|,h) when h >= 0. -/ +def scalarClip (h a : ℝ) : ℝ := max (-h) (min h a) + +lemma scalarClip_bounds {h a : ℝ} (hh : 0 ≤ h) : + -h ≤ scalarClip h a ∧ scalarClip h a ≤ h := by + constructor + · exact le_max_left _ _ + · exact max_le (by linarith) (min_le_left _ _) + +lemma abs_scalarClip_le {h a : ℝ} (hh : 0 ≤ h) : |scalarClip h a| ≤ h := + abs_le.mpr (scalarClip_bounds hh) + +lemma scalarClip_eq_of_mem {h a : ℝ} (ha : -h ≤ a) (hb : a ≤ h) : + scalarClip h a = a := by + simp [scalarClip, min_eq_right hb, max_eq_right ha] + +lemma abs_sub_scalarClip {h a : ℝ} (hh : 0 ≤ h) : + |a - scalarClip h a| = |a| - |scalarClip h a| := by + by_cases ha : a < -h + · have ha0 : a ≤ 0 := by linarith + have hc : scalarClip h a = -h := by + simp [scalarClip, min_eq_right (show a ≤ h by linarith), max_eq_left ha.le] + rw [hc, abs_of_nonpos ha0, abs_of_nonpos (neg_nonpos.mpr hh), + abs_of_nonpos (show a - -h ≤ 0 by linarith)] + ring + · by_cases hb : h < a + · have hc : scalarClip h a = h := by + simp [scalarClip, min_eq_left hb.le, max_eq_right (show -h ≤ h by linarith)] + rw [hc, abs_of_nonneg (show 0 ≤ a by linarith), abs_of_nonneg hh, + abs_of_nonneg (show 0 ≤ a - h by linarith)] + · rw [scalarClip_eq_of_mem (le_of_not_gt ha) (le_of_not_gt hb)] + simp + +lemma abs_scalarClip_eq_min {h a : ℝ} (hh : 0 ≤ h) : + |scalarClip h a| = min |a| h := by + by_cases ha : a < -h + · have hc : scalarClip h a = -h := by + simp [scalarClip, min_eq_right (show a ≤ h by linarith), max_eq_left ha.le] + rw [hc, abs_neg, abs_of_nonneg hh, abs_of_nonpos (show a ≤ 0 by linarith)] + exact (min_eq_right (by linarith)).symm + · by_cases hb : h < a + · have hc : scalarClip h a = h := by + simp [scalarClip, min_eq_left hb.le, max_eq_right (show -h ≤ h by linarith)] + rw [hc, abs_of_nonneg hh, abs_of_nonneg (show 0 ≤ a by linarith)] + exact (min_eq_right hb.le).symm + · rw [scalarClip_eq_of_mem (le_of_not_gt ha) (le_of_not_gt hb)] + exact (min_eq_left (abs_le.mpr ⟨le_of_not_gt ha, le_of_not_gt hb⟩)).symm + +lemma scalarClip_mono (h : ℝ) : Monotone (scalarClip h) := by + intro a b hab + exact max_le_max_left _ (min_le_min_left _ hab) + +lemma scalarClip_sub_le {h a b : ℝ} (hab : b ≤ a) : + scalarClip h a - scalarClip h b ≤ a - b := by + unfold scalarClip + simp only [min_def, max_def] + split_ifs <;> linarith + +lemma abs_scalarClip_sub_le (h a b : ℝ) : + |scalarClip h a - scalarClip h b| ≤ |a - b| := by + rcases le_total b a with hab | hab + · rw [abs_of_nonneg (sub_nonneg.mpr (scalarClip_mono h hab)), + abs_of_nonneg (sub_nonneg.mpr hab)] + exact scalarClip_sub_le hab + · rw [abs_sub_comm, abs_sub_comm a b] + rw [abs_of_nonneg (sub_nonneg.mpr (scalarClip_mono h hab)), + abs_of_nonneg (sub_nonneg.mpr hab)] + exact scalarClip_sub_le hab + +lemma scalar_average_abs (a b : ℝ) : + (|a + b| + |a - b|) / 2 = max |a| |b| := by + rcases le_total 0 a with ha | ha <;> rcases le_total 0 b with hb | hb + · rw [abs_of_nonneg ha, abs_of_nonneg hb, abs_of_nonneg (add_nonneg ha hb)] + by_cases h : b ≤ a + · rw [abs_of_nonneg (sub_nonneg.mpr h), max_eq_left h]; ring + · rw [abs_of_nonpos (sub_nonpos.mpr (le_of_not_ge h)), max_eq_right (le_of_not_ge h)] + ring + · rw [abs_of_nonneg ha, abs_of_nonpos hb, + abs_of_nonneg (sub_nonneg.mpr (le_trans hb ha))] + by_cases h : -b ≤ a + · rw [abs_of_nonneg (by linarith : 0 ≤ a + b), max_eq_left h]; ring + · rw [abs_of_nonpos (by linarith : a + b ≤ 0), max_eq_right (le_of_not_ge h)]; ring + · rw [abs_of_nonpos ha, abs_of_nonneg hb, + abs_of_nonpos (sub_nonpos.mpr (le_trans ha hb))] + by_cases h : b ≤ -a + · rw [abs_of_nonpos (by linarith : a + b ≤ 0), max_eq_left h]; ring + · rw [abs_of_nonneg (by linarith : 0 ≤ a + b), max_eq_right (le_of_not_ge h)]; ring + · rw [abs_of_nonpos ha, abs_of_nonpos hb, abs_of_nonpos (add_nonpos ha hb)] + by_cases h : b ≤ a + · rw [abs_of_nonneg (sub_nonneg.mpr h), max_eq_right (by linarith : -a ≤ -b)]; ring + · rw [abs_of_nonpos (sub_nonpos.mpr (le_of_not_ge h)), + max_eq_left (by linarith : -b ≤ -a)]; ring + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} + +/-- Clip at a nonnegative L1 height. Clips are not required to belong to E. -/ +def clip (h y : Lp ℝ 1 μ) : Lp ℝ 1 μ := (-h) ⊔ (h ⊓ y) + +lemma coeFn_clip (h y : Lp ℝ 1 μ) : + ⇑(clip h y) =ᵐ[μ] fun ω => scalarClip (h ω) (y ω) := by + filter_upwards [Lp.coeFn_sup (-h) (h ⊓ y), Lp.coeFn_inf h y, + Lp.coeFn_neg h] with ω h₁ h₂ h₃ + simp only [clip, h₁, h₂, h₃, Pi.sup_apply, Pi.inf_apply, Pi.neg_apply, scalarClip] + +lemma norm_sub_clip (h y : Lp ℝ 1 μ) (hh : 0 ≤ h) : + ‖y - clip h y‖ = ‖y‖ - ‖clip h y‖ := by + rw [L1.norm_eq_integral_norm, L1.norm_eq_integral_norm y, + L1.norm_eq_integral_norm (clip h y), + ← integral_sub (L1.integrable_coeFn y).norm (L1.integrable_coeFn (clip h y)).norm] + apply integral_congr_ae + filter_upwards [Lp.coeFn_sub y (clip h y), coeFn_clip h y, + (Lp.coeFn_nonneg h).mpr hh] with ω hs hc hpos + simpa only [hs, hc, Pi.sub_apply, Real.norm_eq_abs] using abs_sub_scalarClip hpos + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} {Y : Type uY} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] + +lemma cofinite_ker [FiniteDimensional ℝ Y] (P : X →L[ℝ] Y) : + Cofinite P.toLinearMap.ker := by + refine ⟨P.isClosed_ker, ?_⟩ + exact FiniteDimensional.of_injective + (LinearMap.quotKerEquivRange P.toLinearMap).toLinearMap + (LinearMap.quotKerEquivRange P.toLinearMap).injective + +/-- The finite norming-functional step of the clipping argument. In L1 the + functionals can be taken to be signs; Hahn--Banach gives the same estimate. -/ +lemma finite_norming_kernel (j : X →L[ℝ] Y) (s : Finset Y) : + ∃ F : Submodule ℝ X, Cofinite F ∧ + ∀ y ∈ F, ∀ b ∈ s, ‖b‖ ≤ ‖b - j y‖ := by + classical + choose φ hφnorm hφval using fun b : s => exists_dual_vector'' ℝ (b : Y) + let P : X →L[ℝ] (s → ℝ) := ContinuousLinearMap.pi fun b => (φ b).comp j + refine ⟨P.toLinearMap.ker, cofinite_ker P, ?_⟩ + intro y hy b hb + have hy' : P y = 0 := hy + have hzero : φ ⟨b, hb⟩ (j y) = 0 := congrFun hy' ⟨b, hb⟩ + have heq : φ ⟨b, hb⟩ (b - j y) = ‖b‖ := by + rw [map_sub, hzero, sub_zero, hφval ⟨b, hb⟩] + rfl + calc + ‖b‖ = |φ ⟨b, hb⟩ (b - j y)| := by rw [heq, abs_of_nonneg (norm_nonneg _)] + _ ≤ ‖φ ⟨b, hb⟩‖ * ‖b - j y‖ := (φ ⟨b, hb⟩).le_opNorm _ + _ ≤ 1 * ‖b - j y‖ := mul_le_mul_of_nonneg_right (hφnorm _) (norm_nonneg _) + _ = ‖b - j y‖ := one_mul _ + +end ExactModuli + +namespace ExactModuli + +/-- The quantitative half-mass estimate, before the net radius tends to zero. -/ +lemma half_mass_of_norming {Y : Type uY} [NormedAddCommGroup Y] [NormedSpace ℝ Y] + {b c u : Y} {ε : ℝ} + (hunit : ‖u‖ = 1) (hres : ‖u - c‖ = ‖u‖ - ‖c‖) + (hnet : ‖c - b‖ < ε) (hker : ‖b‖ ≤ ‖b - u‖) : + ‖c‖ < 1 / 2 + ε := by + have h₁ := norm_sub_norm_le c b + have h₂ : ‖b - u‖ ≤ ‖b - c‖ + ‖c - u‖ := by + calc ‖b - u‖ = ‖(b - c) + (c - u)‖ := by congr 1; abel + _ ≤ ‖b - c‖ + ‖c - u‖ := norm_add_le _ _ + rw [norm_sub_rev b c, norm_sub_rev c u, hres, hunit] at h₂ + linarith + +end ExactModuli + +namespace ExactModuli +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} + +lemma small_set_integral_norm [IsFiniteMeasure μ] (f : Lp ℝ 1 μ) + {ε : ℝ} (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ ∀ s : Set Ω, MeasurableSet s → μ.real s ≤ δ → + (∫ ω in s, |f ω| ∂μ) ≤ ε := by + obtain ⟨η, hη, hbound⟩ := + MemLp.eLpNorm_indicator_le (p := (1 : ℝ≥0∞)) le_rfl (by norm_num) (Lp.memLp f) + (ENNReal.ofReal_pos.mpr hε) + obtain ⟨δ, _, hδ, hδη⟩ := ENNReal.lt_iff_exists_real_btwn.mp hη + have hδ : 0 < δ := ENNReal.ofReal_pos.mp hδ + refine ⟨δ, hδ, fun s hs hμs => ?_⟩ + have hs' : μ s ≤ ENNReal.ofReal δ := by + rw [← ENNReal.ofReal_toReal (measure_ne_top μ s)] + exact ENNReal.ofReal_le_ofReal hμs + have hle := ENNReal.toReal_mono ENNReal.ofReal_ne_top (hbound s hs (hs'.trans hδη.le)) + rw [ENNReal.toReal_ofReal hε.le, + eLpNorm_one_eq_lintegral_enorm ((Lp.aestronglyMeasurable f).indicator hs), + ← integral_norm_eq_lintegral_enorm ((Lp.aestronglyMeasurable f).indicator hs)] at hle + simpa only [norm_indicator_eq_indicator_norm, integral_indicator hs, Real.norm_eq_abs] using hle + +lemma measureDistance_threshold_nonempty [IsProbabilityMeasure μ] (f g : Lp ℝ 1 μ) : + {a : ℝ | 0 < a ∧ μ.real {ω | a < |f ω - g ω|} < a}.Nonempty := by + refine ⟨2, by norm_num, ?_⟩ + exact lt_of_le_of_lt measureReal_le_one (by norm_num) + +lemma measureDistance_nonneg [IsProbabilityMeasure μ] (f g : Lp ℝ 1 μ) : + 0 ≤ measureDistance μ f g := by + exact le_csInf (measureDistance_threshold_nonempty f g) (fun _ ha => ha.1.le) + +lemma tail_lt_of_measureDistance_lt [IsProbabilityMeasure μ] (f g : Lp ℝ 1 μ) + {ε : ℝ} (h : measureDistance μ f g < ε) : + μ.real {ω | ε < |f ω - g ω|} < ε := by + obtain ⟨a, ⟨ha, htail⟩, haε⟩ := + (csInf_lt_iff ⟨0, fun _ ha => ha.1.le⟩ (measureDistance_threshold_nonempty f g)).mp h + have hsub : {ω | ε < |f ω - g ω|} ⊆ {ω | a < |f ω - g ω|} := + fun _ hω => lt_trans haε hω + exact lt_trans (lt_of_le_of_lt (measureReal_mono hsub) htail) haε + +lemma scalarClip_diff_le_two {h a b : ℝ} (hh : 0 ≤ h) : + |scalarClip h a - scalarClip h b| ≤ 2 * h := by + have hab : |scalarClip h a - scalarClip h b| ≤ + |scalarClip h a| + |scalarClip h b| := by + simpa only [Real.norm_eq_abs] using norm_sub_le (scalarClip h a) (scalarClip h b) + linarith [abs_scalarClip_le (a := a) hh, abs_scalarClip_le (a := b) hh] + +/-- Uniform passage from the measure metric to the L1 norm on the clipped image. + This proves the norm-precompactness step without needing to choose subsequences. -/ +lemma clip_small_tail [IsProbabilityMeasure μ] (h : Lp ℝ 1 μ) (hh : 0 ≤ h) + {ε : ℝ} (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ ∀ f g : Lp ℝ 1 μ, + μ.real {ω | δ < |f ω - g ω|} < δ → ‖clip h f - clip h g‖ < ε := by + obtain ⟨d, hd, hsmall⟩ := small_set_integral_norm h (show 0 < ε / 4 by linarith) + let δ := min (ε / 4) (d / 2) + have hδ : 0 < δ := lt_min (by linarith) (by linarith) + have hδε : δ ≤ ε / 4 := min_le_left _ _ + have hδd : δ ≤ d := (min_le_right _ _).trans (by linarith) + refine ⟨δ, hδ, fun f g htail => ?_⟩ + let s := {ω | δ < |f ω - g ω|} + have hs : MeasurableSet s := + isOpen_Ioi.measurableSet.preimage + (((Lp.stronglyMeasurable f).measurable.sub (Lp.stronglyMeasurable g).measurable).abs) + have hsmall' : (∫ ω in s, |h ω| ∂μ) ≤ ε / 4 := + hsmall s hs (htail.le.trans hδd) + have hbound : ∀ᵐ ω ∂μ, ‖(clip h f - clip h g) ω‖ ≤ + δ + s.indicator (fun ω => 2 * |h ω|) ω := by + filter_upwards [Lp.coeFn_sub (clip h f) (clip h g), coeFn_clip h f, + coeFn_clip h g, (Lp.coeFn_nonneg h).mpr hh] with ω hsub hf hg hnonneg + simp only [hsub, Pi.sub_apply, hf, hg, Real.norm_eq_abs] + by_cases hω : ω ∈ s + · rw [Set.indicator_of_mem hω, abs_of_nonneg hnonneg] + exact (scalarClip_diff_le_two hnonneg).trans (by linarith) + · rw [Set.indicator_of_notMem hω, add_zero] + exact (abs_scalarClip_sub_le _ _ _).trans (le_of_not_gt hω) + have hbound_int := integral_mono_ae + (L1.integrable_coeFn (clip h f - clip h g)).norm + ((integrable_const δ).add (((L1.integrable_coeFn h).abs.const_mul 2).indicator hs)) hbound + simp only [Pi.add_apply] at hbound_int + rw [← L1.norm_eq_integral_norm, + integral_add (integrable_const δ) (((L1.integrable_coeFn h).abs.const_mul 2).indicator hs), + integral_indicator hs, integral_const_mul] at hbound_int + simp only [integral_const, probReal_univ, smul_eq_mul, one_mul] at hbound_int + linarith + +lemma finite_clip_net [IsProbabilityMeasure μ] (E : Submodule ℝ (Lp ℝ 1 μ)) + (hpre : MeasurePrecompactBall μ E) (h : Lp ℝ 1 μ) (hh : 0 ≤ h) + {ε : ℝ} (hε : 0 < ε) : + ∃ s : Finset (Lp ℝ 1 μ), ∀ y : E, ‖y‖ ≤ 1 → + ∃ b ∈ s, ‖clip h (y : Lp ℝ 1 μ) - b‖ < ε := by + classical + obtain ⟨δ, hδ, hclip⟩ := clip_small_tail h hh hε + obtain ⟨s, hs⟩ := hpre δ hδ + refine ⟨s.image (clip h), fun y hy => ?_⟩ + obtain ⟨b, hb, hdist⟩ := hs y hy + exact ⟨clip h b, Finset.mem_image.mpr ⟨b, hb, rfl⟩, + hclip _ _ (tail_lt_of_measureDistance_lt _ _ hdist)⟩ + +lemma finite_cokernel_half_clip [IsProbabilityMeasure μ] + (E : Submodule ℝ (Lp ℝ 1 μ)) (hpre : MeasurePrecompactBall μ E) + (h : Lp ℝ 1 μ) (hh : 0 ≤ h) {ε : ℝ} (hε : 0 < ε) : + ∃ F : Submodule ℝ E, Cofinite F ∧ ∀ y ∈ F, ‖y‖ = 1 → + ‖clip h (y : Lp ℝ 1 μ)‖ < 1 / 2 + ε := by + obtain ⟨s, hs⟩ := finite_clip_net E hpre h hh hε + obtain ⟨F, hF, hker⟩ := finite_norming_kernel E.subtypeL s + refine ⟨F, hF, fun y hy hunit => ?_⟩ + obtain ⟨b, hb, hnet⟩ := hs y hunit.le + exact half_mass_of_norming hunit (norm_sub_clip h _ hh) hnet (hker y hy b hb) + +end ExactModuli + +namespace ExactModuli + +lemma scalar_overlap (a b t : ℝ) (ht : 0 < t) : + (|a + t * b| + |a - t * b|) / 2 = + |a| + t * (|b| - |scalarClip (|a| / t) b|) := by + rw [scalar_average_abs, abs_mul, abs_of_pos ht, + abs_scalarClip_eq_min (div_nonneg (abs_nonneg _) ht.le)] + by_cases hb : |b| ≤ |a| / t + · have hb' : t * |b| ≤ |a| := by simpa [mul_comm] using (le_div_iff₀ ht).mp hb + rw [min_eq_left hb, max_eq_left hb'] + ring + · have hb' : |a| ≤ t * |b| := by + have := (div_lt_iff₀ ht).mp (lt_of_not_ge hb) + linarith + rw [min_eq_right (le_of_not_ge hb), max_eq_right hb'] + field_simp + ring + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} + +def clipHeight (x : Lp ℝ 1 μ) (t : ℝ) : Lp ℝ 1 μ := t⁻¹ • |x| + +lemma coeFn_clipHeight (x : Lp ℝ 1 μ) (t : ℝ) : + ⇑(clipHeight x t) =ᵐ[μ] fun ω => |x ω| / t := by + filter_upwards [Lp.coeFn_smul t⁻¹ |x|, Lp.coeFn_abs x] with ω h₁ h₂ + simp only [clipHeight, h₁, h₂, Pi.smul_apply, smul_eq_mul, div_eq_mul_inv, mul_comm] + +lemma clipHeight_nonneg (x : Lp ℝ 1 μ) {t : ℝ} (ht : 0 < t) : + 0 ≤ clipHeight x t := by + apply (Lp.coeFn_nonneg _).mp + filter_upwards [coeFn_clipHeight x t] with ω hω + rw [hω] + exact div_nonneg (abs_nonneg _) ht.le + +lemma overlap_identity (x y : Lp ℝ 1 μ) {t : ℝ} (ht : 0 < t) : + (‖x + t • y‖ + ‖x - t • y‖) / 2 = + ‖x‖ + t * (‖y‖ - ‖clip (clipHeight x t) y‖) := by + let c := clip (clipHeight x t) y + have hx := (L1.integrable_coeFn x).norm + have hy := (L1.integrable_coeFn y).norm + have hc := (L1.integrable_coeFn c).norm + have hplus := (L1.integrable_coeFn (x + t • y)).norm + have hminus := (L1.integrable_coeFn (x - t • y)).norm + rw [L1.norm_eq_integral_norm, L1.norm_eq_integral_norm (x - t • y), + L1.norm_eq_integral_norm x, L1.norm_eq_integral_norm y, + L1.norm_eq_integral_norm (clip (clipHeight x t) y)] + calc + ((∫ ω, ‖(x + t • y) ω‖ ∂μ) + (∫ ω, ‖(x - t • y) ω‖ ∂μ)) / 2 = + ∫ ω, (‖(x + t • y) ω‖ + ‖(x - t • y) ω‖) / 2 ∂μ := by + rw [integral_div, integral_add hplus hminus] + _ = ∫ ω, ‖x ω‖ + t * (‖y ω‖ - ‖c ω‖) ∂μ := by + apply integral_congr_ae + filter_upwards [Lp.coeFn_add x (t • y), Lp.coeFn_sub x (t • y), + Lp.coeFn_smul t y, coeFn_clip (clipHeight x t) y, + coeFn_clipHeight x t] with ω hp hm hty hclip hh + simpa only [hp, hm, hty, hclip, hh, Pi.add_apply, Pi.sub_apply, + Pi.smul_apply, smul_eq_mul, Real.norm_eq_abs, c] using scalar_overlap (x ω) (y ω) t ht + _ = (∫ ω, ‖x ω‖ ∂μ) + t * ((∫ ω, ‖y ω‖ ∂μ) - ∫ ω, ‖c ω‖ ∂μ) := by + have hdiff : Integrable (fun ω => ‖y ω‖ - ‖c ω‖) μ := hy.sub hc + rw [integral_add hx (hdiff.const_mul t), integral_const_mul, integral_sub hy hc] + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/ClosedUnion.lean b/lean/OAI/Analysis/Daugavet/ClosedUnion.lean new file mode 100644 index 0000000000000000000000000000000000000000..00ad0b7ab34119823d535b2dc2c6fb016b69854b --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/ClosedUnion.lean @@ -0,0 +1,114 @@ +import OAI.Analysis.Daugavet.Stages + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +namespace ExactModuli.KW + +lemma constructedSpace_infiniteDimensional : ¬ FiniteDimensional ℝ constructedSpace := by + intro hfinite + let : FiniteDimensional ℝ constructedSpace := hfinite + have hstrict : StrictMono (fun n => Module.finrank ℝ (stageSpace n)) := by + intro n m hnm + exact Submodule.finrank_lt_finrank_of_lt (stageSpace_strictMono hnm) + have hle := hstrict.id_le (Module.finrank ℝ constructedSpace + 1) + have hbound := Submodule.finrank_mono (stageSpace_le_constructed (Module.finrank ℝ constructedSpace + 1)) + change Module.finrank ℝ constructedSpace + 1 ≤ Module.finrank ℝ (stageSpace (Module.finrank ℝ constructedSpace + 1)) at hle + omega + +lemma constructed_union_approx {x : KWL1} (hx : x ∈ constructedSpace) + {ε : ℝ} (hε : 0 < ε) (N : ℕ) : + ∃ n : ℕ, N ≤ n ∧ ∃ y ∈ stageSpace n, ‖x-y‖ < ε := by + have hx' : x ∈ closure (unionSpace : Set KWL1) := hx + obtain ⟨y,hy,hxy⟩ := Metric.mem_closure_iff.mp hx' ε hε + obtain ⟨n,hn⟩ := (Submodule.mem_iSup_of_directed stageSpace stageSpace_mono.directed_le).mp hy + exact ⟨max n N, le_max_right _ _, y, stageSpace_mono (le_max_left _ _) hn, by simpa [dist_eq_norm] using hxy⟩ + +lemma constructed_ball_approx {x : KWL1} (hx : x ∈ constructedSpace) (hxn : ‖x‖ ≤ 1) + {ε : ℝ} (hε : 0 < ε) (N : ℕ) : + ∃ n : ℕ, N ≤ n ∧ ∃ y ∈ stageSpace n, ‖y‖ ≤ 1 ∧ ‖x-y‖ < ε := by + obtain ⟨n,hn,y,hy,hxy⟩ := constructed_union_approx hx (half_pos hε) N + refine ⟨n,hn,normalizeL1 y,normalizeL1_mem _ hy,normalizeL1_norm _,?_⟩ + exact (normalizeL1_approx x y hxn).trans_lt (by linarith) + +lemma constructed_sphere_approx {x : KWL1} (hx : x ∈ constructedSpace) (hxn : ‖x‖ = 1) + {ε : ℝ} (hε : 0 < ε) (N : ℕ) : + ∃ n : ℕ, N ≤ n ∧ ∃ y ∈ stageSpace n, ‖y‖ = 1 ∧ ‖x-y‖ < ε := by + obtain ⟨n,hn,y,hy,hxy⟩ := constructed_union_approx hx (lt_min (half_pos hε) (by norm_num : (0:ℝ)<1/2)) N + have hy0 : y ≠ 0 := by + intro hy0 + rw [hy0, sub_zero, hxn] at hxy + have hh := hxy.trans_le (min_le_right _ _) + norm_num at hh + refine ⟨n,hn,‖y‖⁻¹ • y,(stageSpace n).smul_mem _ hy,norm_smul_inv_norm hy0,?_⟩ + exact (sphere_normalize_approx x y hxn hy0).trans_lt (by linarith [hxy.trans_le (min_le_left _ _)]) + +lemma stageError_tendsto : Tendsto stageError atTop (𝓝 0) := by + have h := (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0:ℝ)≤1/2) (by norm_num : (1/2:ℝ)<1)).mul_const (1/2:ℝ) + change Tendsto (fun n : ℕ => (1/2:ℝ)^(n+1)) atTop (𝓝 0) + simpa only [zero_mul, pow_succ] using h + +lemma stageError_eventually_small {ε : ℝ} (hε : 0 < ε) : + ∃ N : ℕ, ∀ n ≥ N, stageError n < ε := + eventually_atTop.mp (stageError_tendsto.eventually_lt_const hε) + +/-- The exact telescoping finite-stage error; the remaining tail equals 2 h_b. -/ +lemma stage_ball_control (b a : ℕ) (hba : b ≤ a) : + ∀ g ∈ stageSpace a, ‖g‖ ≤ 1 → ∃ ψ ∈ stageSpace b, ‖ψ‖ ≤ 1 ∧ + measureDistance kwMeasure g ψ ≤ 2 * stageError b - 2 * stageError a := by + induction a, hba using Nat.le_induction with + | base => + intro g hg hgn + exact ⟨g,hg,hgn,by simp [measureDistance_self]⟩ + | succ a hba ih => + intro g hg hgn + obtain ⟨y,hy,hyn,hgy⟩ := (step_estimates a).wholeBall g hg hgn + obtain ⟨ψ,hψ,hψn,hyψ⟩ := ih y hy hyn + refine ⟨ψ,hψ,hψn,?_⟩ + have ht := measureDistance_triangle g y ψ + rw [stageError_succ] + linarith + +lemma stage_ball_control_uniform (b a : ℕ) (g : KWL1) (hg : g ∈ stageSpace a) (hgn : ‖g‖ ≤ 1) : + ∃ ψ ∈ stageSpace b, ‖ψ‖ ≤ 1 ∧ measureDistance kwMeasure g ψ ≤ 2 * stageError b := by + by_cases hba : b ≤ a + · obtain ⟨ψ,hψ,hψn,hgψ⟩ := stage_ball_control b a hba g hg hgn + exact ⟨ψ,hψ,hψn,hgψ.trans (by linarith [stageError_pos a])⟩ + · exact ⟨g,stageSpace_mono (le_of_not_ge hba) hg,hgn,by rw [measureDistance_self]; exact (mul_pos (by norm_num) (stageError_pos b)).le⟩ + +lemma constructed_ball_stage_control (b : ℕ) (x : KWL1) (hx : x ∈ constructedSpace) (hxn : ‖x‖ ≤ 1) + {η : ℝ} (hη : 0 < η) : + ∃ ψ ∈ stageSpace b, ‖ψ‖ ≤ 1 ∧ measureDistance kwMeasure x ψ ≤ 2 * stageError b + η := by + obtain ⟨a,ha,y,hy,hyn,hxy⟩ := constructed_ball_approx hx hxn (sq_pos_of_pos hη) 0 + obtain ⟨ψ,hψ,hψn,hyψ⟩ := stage_ball_control_uniform b a y hy hyn + refine ⟨ψ,hψ,hψn,?_⟩ + have hd := measureDistance_le_of_norm_sub_lt_sq x y hη hxy + have ht := measureDistance_triangle x y ψ + linarith + +lemma constructedSpace_measurePrecompact : MeasurePrecompactBall kwMeasure constructedSpace := by + classical + intro ε hε + obtain ⟨b,hb⟩ := stageError_eventually_small (show 0 < ε/8 by positivity) + have hb' := hb b le_rfl + obtain ⟨t,hts,htfin,hcover⟩ := (isCompact_closedBall (0 : stageSpace b) 1).finite_cover_balls + (sq_pos_of_pos (show 0 < ε/4 by positivity)) + refine ⟨htfin.toFinset.image (fun z : stageSpace b => (z : KWL1)), ?_⟩ + intro x hxn + obtain ⟨ψ,hψ,hψn,hxψ⟩ := constructed_ball_stage_control b x x.property hxn (show 0 < ε/4 by positivity) + have hcov := hcover (show (⟨ψ,hψ⟩ : stageSpace b) ∈ Metric.closedBall 0 1 by simpa using hψn) + simp only [Set.mem_iUnion, Metric.mem_ball, dist_eq_norm] at hcov + obtain ⟨z,hz,hψz⟩ := hcov + refine ⟨(z : KWL1),Finset.mem_image.mpr ⟨z,htfin.mem_toFinset.mpr hz,rfl⟩,?_⟩ + have hd := measureDistance_le_of_norm_sub_lt_sq ψ (z : KWL1) (show 0 < ε/4 by positivity) hψz + have ht := measureDistance_triangle (x : KWL1) ψ (z : KWL1) + linarith + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Diameter.lean b/lean/OAI/Analysis/Daugavet/Diameter.lean new file mode 100644 index 0000000000000000000000000000000000000000..ebce1d57a06d015594bd975217d29a1ae462fae6 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Diameter.lean @@ -0,0 +1,173 @@ +import OAI.Analysis.Daugavet.Slices + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX uY uIota + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma dual_apply_le_norm (φ : X →L[ℝ] ℝ) (hφ : ‖φ‖ ≤ 1) (z : X) : φ z ≤ ‖z‖ := by + have hb := φ.le_opNorm z + rw [Real.norm_eq_abs] at hb + have hc := mul_le_mul_of_nonneg_right hφ (norm_nonneg z) + linarith [le_abs_self (φ z)] + +/-- One induction step in the diametral argument, with additive rather than multiplicative error. -/ +lemma slice_add_almost (hsp : UnitSliceProperty X) {w₀ : X} (hw₀ : ‖w₀‖ = 1) + (ell : X →L[ℝ] ℝ) (β : ℝ) (hne : ∃ y : X, ‖y‖ ≤ 1 ∧ β < ell y) + (z : X) {a δ : ℝ} (ha : 0 ≤ a) (hδ : 0 < δ) : + ∃ y : X, ‖y‖ = 1 ∧ β < ell y ∧ ‖z‖ + a - δ ≤ ‖z + a • y‖ := by + by_cases hz : z = 0 + · obtain ⟨y, hy, hβ, _⟩ := hsp w₀ hw₀ ell β hne 1 zero_lt_one + refine ⟨y, hy, hβ, ?_⟩ + simp only [hz, norm_zero, zero_add, norm_smul, Real.norm_eq_abs, abs_of_nonneg ha, hy, mul_one] + linarith + · let u := ‖z‖⁻¹ • z + have hu : ‖u‖ = 1 := norm_smul_inv_norm hz + let ρ := δ / (‖z‖ + a + 1) + have hden : 0 < ‖z‖ + a + 1 := by positivity + have hρ : 0 < ρ := div_pos hδ hden + have hρmul : ρ * (‖z‖ + a + 1) = δ := div_mul_cancel₀ _ hden.ne' + obtain ⟨y, hy, hβ, hfar⟩ := hsp u hu ell β hne ρ hρ + obtain ⟨φ, hφ, hφsum⟩ := exists_dual_vector'' ℝ (u + y) + change φ (u + y) = ‖u + y‖ at hφsum + have hφu : φ u ≤ 1 := by simpa [hu] using dual_apply_le_norm φ hφ u + have hφy : φ y ≤ 1 := by simpa [hy] using dual_apply_le_norm φ hφ y + rw [map_add] at hφsum + have hlowu : 1 - ρ ≤ φ u := by linarith + have hlowy : 1 - ρ ≤ φ y := by linarith + have hzid : z = ‖z‖ • u := by + dsimp [u] + rw [smul_smul, mul_inv_cancel₀ (norm_ne_zero_iff.mpr hz), one_smul] + have hφz : φ z = ‖z‖ * φ u := by conv_lhs => rw [hzid]; rw [map_smul, smul_eq_mul] + have hb := dual_apply_le_norm φ hφ (z + a • y) + rw [map_add, map_smul, smul_eq_mul, hφz] at hb + have hb₁ := mul_le_mul_of_nonneg_left hlowu (norm_nonneg z) + have hb₂ := mul_le_mul_of_nonneg_left hlowy ha + exact ⟨y, hy, hβ, by nlinarith⟩ + +lemma slices_finite_sum (hsp : UnitSliceProperty X) {w₀ : X} (hw₀ : ‖w₀‖ = 1) + {ι : Type uIota} (a : ι → ℝ) (ell : ι → X →L[ℝ] ℝ) (β : ι → ℝ) + (ha : ∀ i, 0 ≤ a i) (hne : ∀ i, ∃ y : X, ‖y‖ ≤ 1 ∧ β i < ell i y) + (s : Finset ι) (z : X) {δ : ℝ} (hδ : 0 < δ) : + ∃ y : ι → X, (∀ i ∈ s, ‖y i‖ = 1 ∧ β i < ell i (y i)) ∧ + ‖z‖ + ∑ i ∈ s, a i - δ ≤ ‖z + ∑ i ∈ s, a i • y i‖ := by + classical + induction s using Finset.induction generalizing z δ with + | empty => + refine ⟨fun _ => 0, by simp, ?_⟩ + simp only [Finset.sum_empty, add_zero] + linarith + | @insert i s hi ih => + obtain ⟨y, hy, hsum⟩ := ih z (half_pos hδ) + obtain ⟨v, hv, hβv, hvfar⟩ := slice_add_almost hsp hw₀ (ell i) (β i) (hne i) + (z + ∑ j ∈ s, a j • y j) (ha i) (half_pos hδ) + let y' := Function.update y i v + have hsame : ∀ j ∈ s, y' j = y j := by + intro j hj + have hji : j ≠ i := by intro h; exact hi (h ▸ hj) + simp [y', hji] + have hins : y' i = v := by simp [y'] + have hsum' : ∑ j ∈ s, a j • y' j = ∑ j ∈ s, a j • y j := + Finset.sum_congr rfl (fun j hj => by rw [hsame j hj]) + refine ⟨y', ?_, ?_⟩ + · intro j hj + rcases Finset.mem_insert.mp hj with rfl | hj + · exact hins ▸ ⟨hv, hβv⟩ + · rw [hsame j hj] + exact hy j hj + · rw [Finset.sum_insert hi, Finset.sum_insert hi, hins, hsum'] + have hid : z + (a i • v + ∑ j ∈ s, a j • y j) = + (z + ∑ j ∈ s, a j • y j) + a i • v := by abel + rw [hid] + linarith + +variable {Y : Type uY} [NormedAddCommGroup Y] [InnerProductSpace ℝ Y] [FiniteDimensional ℝ Y] + +/-- The weak-open diametral lemma in finite-dimensional coordinates. -/ +theorem diametral_finite_image (hsp : UnitSliceProperty X) {x u : X} (hx : ‖x‖ = 1) + (hu : ‖u‖ ≤ 1) (T : X →L[ℝ] Y) {r δ : ℝ} (hr : 0 < r) (hδ : 0 < δ) : + ∃ v : X, ‖v‖ ≤ 1 ∧ ‖T v - T u‖ < r ∧ 2 - δ ≤ ‖v - x‖ := by + obtain ⟨ι, hι, a, ell, β, ha, hsum, hne, hnear⟩ := bourgain_image T hu hr + let := hι + obtain ⟨y, hy, hfar⟩ := slices_finite_sum hsp hx a ell β ha hne Finset.univ (-x) hδ + let v := ∑ i, a i • y i + have hv : ‖v‖ ≤ 1 := by + have hm := (convex_closedBall (0 : X) 1).sum_mem (fun i _ => ha i) hsum + (fun i _ => show y i ∈ Metric.closedBall (0 : X) 1 by simpa using (hy i (Finset.mem_univ i)).1.le) + simpa [v] using hm + refine ⟨v, hv, hnear y (fun i => ⟨(hy i (Finset.mem_univ i)).1.le, (hy i (Finset.mem_univ i)).2⟩), ?_⟩ + simpa only [norm_neg, hx, hsum, one_add_one_eq_two, v, sub_eq_add_neg, add_comm] using hfar + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} {Y : Type uY} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] [FiniteDimensional ℝ Y] + +lemma diametral_finite_norm (hsp : UnitSliceProperty X) {x u : X} (hx : ‖x‖ = 1) + (hu : ‖u‖ ≤ 1) (T : X →L[ℝ] Y) {r δ : ℝ} (hr : 0 < r) (hδ : 0 < δ) : + ∃ v : X, ‖v‖ ≤ 1 ∧ ‖T v - T u‖ < r ∧ 2 - δ ≤ ‖v - x‖ := by + let e : Y ≃L[ℝ] EuclideanSpace ℝ (Fin (Module.finrank ℝ Y)) := + ContinuousLinearEquiv.ofFinrankEq (by rw [finrank_euclideanSpace_fin]) + let C := ‖e.symm.toContinuousLinearMap‖ + have hC : 0 ≤ C := norm_nonneg _ + have hCp : 0 < C + 1 := by linarith + obtain ⟨v, hv, hnear, hfar⟩ := diametral_finite_image hsp hx hu + (e.toContinuousLinearMap.comp T) (div_pos hr hCp) hδ + refine ⟨v, hv, ?_, hfar⟩ + have hb := e.symm.toContinuousLinearMap.le_opNorm (e (T v) - e (T u)) + have hid : e.symm (e (T v) - e (T u)) = T v - T u := by simp only [map_sub, e.symm_apply_apply] + change ‖e.symm (e (T v) - e (T u))‖ ≤ C * ‖e (T v) - e (T u)‖ at hb + rw [hid] at hb + change ‖e (T v) - e (T u)‖ < r / (C + 1) at hnear + have hb' : ‖T v - T u‖ ≤ (C + 1) * ‖e (T v) - e (T u)‖ := by + nlinarith [norm_nonneg (e (T v) - e (T u))] + have hstrict := mul_lt_mul_of_pos_left hnear hCp + rw [mul_div_cancel₀ _ hCp.ne'] at hstrict + exact hb'.trans_lt hstrict + +/-- Finite quotient correction, retaining the small error vector for equivalent-norm estimates. -/ +lemma cofinite_diametral_correction (hsp : UnitSliceProperty X) {x : X} (hx : ‖x‖ = 1) + {F : Submodule ℝ X} (hF : Cofinite F) {ε : ℝ} (hε : 0 < ε) : + ∃ v e : X, ‖v‖ ≤ 1 ∧ ‖e‖ < ε ∧ v - x - e ∈ F ∧ 2 - ε ≤ ‖v - x‖ := by + let : IsClosed (F : Set X) := hF.1 + let : FiniteDimensional ℝ (X ⧸ F) := hF.2 + obtain ⟨v, hv, hnear, hfar⟩ := diametral_finite_norm hsp hx hx.le F.mkQL (half_pos hε) hε + obtain ⟨e, he, heNorm⟩ := Submodule.Quotient.norm_mk_lt (F.mkQL (v - x)) (half_pos hε) + have hq : ‖F.mkQL (v - x)‖ < ε / 2 := by simpa only [map_sub] using hnear + refine ⟨v, e, hv, by linarith, ?_, hfar⟩ + apply (Submodule.Quotient.mk_eq_zero F).mp + change F.mkQL (v - x - e) = 0 + rw [map_sub] + change F.mkQL (v - x) - Submodule.Quotient.mk e = 0 + rw [he, sub_self] + +lemma cofinite_antipodal_endpoint (hsp : UnitSliceProperty X) {x : X} (hx : ‖x‖ = 1) + {F : Submodule ℝ X} (hF : Cofinite F) {ε : ℝ} (hε : 0 < ε) : + ∃ z ∈ F, 2 - 2 * ε < ‖z‖ ∧ ‖z‖ ≤ 2 + ε ∧ ‖x + z‖ ≤ 1 + ε := by + obtain ⟨v, e, hv, he, hzF, hfar⟩ := cofinite_diametral_correction hsp hx hF hε + refine ⟨v - x - e, hzF, ?_, ?_, ?_⟩ + · have hb := norm_sub_le (v - x - e) (-e) + have hid : v - x - e - -e = v - x := by abel + rw [hid, norm_neg] at hb + linarith + · have hb := norm_sub_le (v - x) e + have hb' := norm_sub_le v x + rw [hx] at hb' + linarith + · have hid : x + (v - x - e) = v - e := by abel + rw [hid] + have hb := norm_sub_le v e + linarith + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Enlargement.lean b/lean/OAI/Analysis/Daugavet/Enlargement.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cfed138a1a4437054cae4be54092298d0bec865 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Enlargement.lean @@ -0,0 +1,127 @@ +import OAI.Analysis.Daugavet.Joining + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +namespace ExactModuli.KW + +structure EnlargementData {κ : Type} [Fintype κ] (G : Submodule ℝ KWL1) + (u : κ → KWL1) (h : ℝ) where + space : Submodule ℝ KWL1 + contains : G ≤ space + finiteDimensional : FiniteDimensional ℝ space + finiteCoordinates : FiniteCoordinates space + copies : ℕ + copies_pos : 0 < copies + vectors : κ → Fin copies → KWL1 + vectors_mem : ∀ k j, vectors k j ∈ space + vectors_unit : ∀ k j, ‖vectors k j‖ = 1 + additive : ∀ w ∈ G, ‖w‖ = 1 → ∀ k j, 2 - h ≤ ‖w + vectors k j‖ + averages : ∀ k, ‖u k - (copies : ℝ)⁻¹ • ∑ j, vectors k j‖ ≤ h + wholeBall : ∀ g ∈ space, ‖g‖ ≤ 1 → + ∃ ψ ∈ G, ‖ψ‖ ≤ 1 ∧ measureDistance kwMeasure g ψ ≤ h + +/-- The complete quantitative Kadets–Werner finite-dimensional enlargement. -/ +theorem finite_dimensional_enlargement {κ : Type} [Fintype κ] [Nonempty κ] + (G : Submodule ℝ KWL1) [FiniteDimensional ℝ G] (_hG : G ≠ ⊥) + (hcoords : FiniteCoordinates G) (u : κ → G) (hu : ∀ k, ‖u k‖ = 1) + {h : ℝ} (hh : 0 < h) (hh1 : h < 1) : + Nonempty (EnlargementData G (fun k => (u k : KWL1)) h) := by + classical + obtain ⟨β, hβ, c, hc, hGrange⟩ := hcoords + let : Fintype β := hβ + let M : Submodule ℝ (Lp ℝ 1 (cubeMeasure β)) := G.comap (coordinatesL1 c hc).toLinearMap + let : FiniteDimensional ℝ M := finiteDimensional_model (coordinatesL1 c hc) G + choose u₀ hu₀ using (fun k => hGrange (u k).property) + change ∀ k, coordinatesL1 c hc (u₀ k) = (u k : KWL1) at hu₀ + let um : κ → M := fun k => ⟨u₀ k, by + change coordinatesL1 c hc (u₀ k) ∈ G + rw [hu₀ k] + exact (u k).property⟩ + have hum (k : κ) : ‖um k‖ = 1 := by + change ‖u₀ k‖ = 1 + rw [← (coordinatesL1 c hc).norm_map (u₀ k), hu₀ k] + exact hu k + have hcard : (0 : ℝ) < Fintype.card κ := by exact_mod_cast Fintype.card_pos + obtain ⟨C, r, q, p, hC, hCh, hr, hq, hp, hpmax, hmq, herr, hpC, hpCh, hpq⟩ := + enlargement_parameters hcard hh hh1 + obtain ⟨n, hn, havg⟩ := multiplier_averages hp hh + obtain ⟨d, hd, hdc⟩ := extend_coordinates (κ := κ × Fin n) c hc + let J := joinedL1 d hd + let A : (M × (κ → Fin n → ℝ)) →ₗ[ℝ] (Lp ℝ 1 (cubeMeasure β) × (κ → Fin n → ℝ)) := + M.subtype.prodMap LinearMap.id + let T : (M × (κ → Fin n → ℝ)) →ₗ[ℝ] KWL1 := + J.toLinearMap.comp ((productOperator hp u₀).comp A) + let G' : Submodule ℝ KWL1 := T.range + have hcontain : G ≤ G' := by + intro x hx + obtain ⟨x₀, hx₀⟩ := hGrange hx + change coordinatesL1 c hc x₀ = x at hx₀ + have hxM : x₀ ∈ M := by change coordinatesL1 c hc x₀ ∈ G; rw [hx₀]; exact hx + refine ⟨(⟨x₀, hxM⟩, 0), ?_⟩ + change J (productOperator hp u₀ (x₀,0)) = x + rw [productOperator_zero_coeff] + exact (joinedL1_old c hc d hd hdc x₀).trans hx₀ + have hfinite : FiniteDimensional ℝ G' := by dsimp [G']; infer_instance + have hcoords' : FiniteCoordinates G' := by + refine ⟨β ⊕ (κ × Fin n), inferInstance, d, hd, ?_⟩ + rintro g ⟨z, rfl⟩ + apply joinedL1_range d hd + exact ⟨productOperator hp u₀ ((z.1 : Lp ℝ 1 (cubeMeasure β)),z.2), rfl⟩ + let v : κ → Fin n → KWL1 := fun k j => J (atomL1 hp (u₀ k) k j) + have hvMem (k : κ) (j : Fin n) : v k j ∈ G' := by + obtain ⟨a, ha⟩ := productOperator_single hp u₀ k j + refine ⟨(0,a), ?_⟩ + change J (productOperator hp u₀ (0,a)) = J (atomL1 hp (u₀ k) k j) + rw [ha] + have hvUnit (k : κ) (j : Fin n) : ‖v k j‖ = 1 := by + dsimp [v] + rw [J.norm_map, norm_atomL1] + exact hum k + have hvAdd : ∀ w ∈ G, ‖w‖ = 1 → ∀ k j, 2 - h ≤ ‖w + v k j‖ := by + intro w hw hwunit k j + obtain ⟨w₀, hw₀⟩ := hGrange hw + change coordinatesL1 c hc w₀ = w at hw₀ + have hwn : ‖w₀‖ = 1 := by rw [← (coordinatesL1 c hc).norm_map w₀, hw₀, hwunit] + calc + 2 - h ≤ ‖oldL1 w₀ + atomL1 hp (u₀ k) k j‖ := + atomL1_near_additive hp hC.le hpC.le hpCh hwn (hum k) k j + _ = ‖J (oldL1 w₀ + atomL1 hp (u₀ k) k j)‖ := (J.norm_map _).symm + _ = ‖w + v k j‖ := by + rw [map_add] + change ‖joinedL1 d hd (oldL1 w₀) + v k j‖ = _ + rw [joinedL1_old c hc d hd hdc w₀, hw₀] + have hvAvg (k : κ) : ‖(u k : KWL1) - (n : ℝ)⁻¹ • ∑ j, v k j‖ ≤ h := by + have huJ : J (oldL1 (u₀ k)) = (u k : KWL1) := (joinedL1_old c hc d hd hdc _).trans (hu₀ k) + calc + _ = ‖J (oldL1 (u₀ k) - (n : ℝ)⁻¹ • ∑ j : Fin n, atomL1 hp (u₀ k) k j)‖ := by + rw [map_sub, map_smul, map_sum, huJ] + _ = ‖oldL1 (u₀ k) - (n : ℝ)⁻¹ • ∑ j : Fin n, atomL1 hp (u₀ k) k j‖ := J.norm_map _ + _ = ∫ v : cube (Fin n), |(n : ℝ)⁻¹ * (∑ j, multiplier p (v j)) - 1| + ∂cubeMeasure (Fin n) := atoms_average_norm hp (u₀ k) (hum k) k + _ ≤ h := havg.le + have hvControl : ∀ g ∈ G', ‖g‖ ≤ 1 → + ∃ ψ ∈ G, ‖ψ‖ ≤ 1 ∧ measureDistance kwMeasure g ψ ≤ h := by + rintro g ⟨⟨x,a⟩, rfl⟩ hg + have hPg : ‖productOperator hp (fun k => (um k : Lp ℝ 1 (cubeMeasure β))) (x,a)‖ ≤ 1 := by + change ‖J (productOperator hp u₀ ((x : Lp ℝ 1 (cubeMeasure β)),a))‖ ≤ 1 at hg + rw [J.norm_map] at hg + exact hg + obtain ⟨ψ, hψnorm, hψdist⟩ := productOperator_control hp hpmax hr hq hh hmq herr hpq M x um hum a hPg + refine ⟨coordinatesL1 c hc (ψ : Lp ℝ 1 (cubeMeasure β)), ψ.property, ?_, ?_⟩ + · rw [(coordinatesL1 c hc).norm_map] + exact hψnorm + · change measureDistance kwMeasure (J (productOperator hp u₀ ((x : Lp ℝ 1 (cubeMeasure β)),a))) + (coordinatesL1 c hc (ψ : Lp ℝ 1 (cubeMeasure β))) ≤ h + rw [← joinedL1_old c hc d hd hdc (ψ : Lp ℝ 1 (cubeMeasure β))] + exact (joinedL1_measureDistance d hd _ _).symm ▸ hψdist + exact ⟨⟨G', hcontain, hfinite, hcoords', n, hn, v, hvMem, hvUnit, hvAdd, hvAvg, hvControl⟩⟩ + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/EquivalentNorm.lean b/lean/OAI/Analysis/Daugavet/EquivalentNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..a072dbc914b01e447aeef1a4863a0569a9d167a7 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/EquivalentNorm.lean @@ -0,0 +1,209 @@ +import OAI.Analysis.Daugavet.UpperBounds + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma equivalentNorm_pos {N : Seminorm ℝ X} (hN : EquivalentNorm N) {x : X} (hx : x ≠ 0) : + 0 < N x := by + obtain ⟨a, b, ha, hb, hbound⟩ := hN + exact (mul_pos ha (norm_pos_iff.mpr hx)).trans_le (hbound x).1 + +lemma seminorm_normalize (N : Seminorm ℝ X) {x : X} (hx : 0 < N x) : + N ((N x)⁻¹ • x) = 1 := by + rw [map_smul_eq_mul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hx), inv_mul_cancel₀ hx.ne'] + +lemma cofinite_has_Nunit (hinf : ¬ FiniteDimensional ℝ X) {N : Seminorm ℝ X} + (hN : EquivalentNorm N) {F : Submodule ℝ X} (hF : Cofinite F) : + ∃ y ∈ F, N y = 1 := by + obtain ⟨y, hyF, hy⟩ := cofinite_has_unit hinf hF + have hy0 : y ≠ 0 := by intro h; simp [h] at hy + refine ⟨(N y)⁻¹ • y, F.smul_mem _ hyF, seminorm_normalize N (equivalentNorm_pos hN hy0)⟩ + +def normOneSidedValues (N : Seminorm ℝ X) (x : X) (t : ℝ) (F : Submodule ℝ X) : Set ℝ := + {a | ∃ y ∈ F, N y = 1 ∧ a = N (x + t • y) - 1} + +lemma normOneSidedValues_bddBelow (N : Seminorm ℝ X) (x : X) (t : ℝ) (F : Submodule ℝ X) : + BddBelow (normOneSidedValues N x t F) := by + refine ⟨-1, ?_⟩ + rintro a ⟨y, hyF, hy, rfl⟩ + linarith [apply_nonneg N (x + t • y)] + +lemma normOneSidedValues_nonempty (hinf : ¬ FiniteDimensional ℝ X) {N : Seminorm ℝ X} + (hN : EquivalentNorm N) (x : X) (t : ℝ) {F : Submodule ℝ X} (hF : Cofinite F) : + (normOneSidedValues N x t F).Nonempty := by + obtain ⟨y, hyF, hy⟩ := cofinite_has_Nunit hinf hN hF + exact ⟨_, y, hyF, hy, rfl⟩ + +lemma normD_outer_bddAbove (hinf : ¬ FiniteDimensional ℝ X) {N : Seminorm ℝ X} + (hN : EquivalentNorm N) {x : X} (hx : N x = 1) {t : ℝ} (ht : 0 ≤ t) : + BddAbove {r | ∃ F : Submodule ℝ X, Cofinite F ∧ r = sInf (normOneSidedValues N x t F)} := by + refine ⟨t, ?_⟩ + rintro a ⟨F, hF, rfl⟩ + obtain ⟨y, hyF, hy⟩ := cofinite_has_Nunit hinf hN hF + have hinf := csInf_le (normOneSidedValues_bddBelow N x t F) ⟨y, hyF, hy, rfl⟩ + have hb := map_add_le_add N x (t • y) + rw [map_smul_eq_mul, Real.norm_eq_abs, abs_of_nonneg ht, hx, hy, mul_one] at hb + linarith + +lemma normD_ge_neg_one (hinf : ¬ FiniteDimensional ℝ X) {N : Seminorm ℝ X} + (hN : EquivalentNorm N) {x : X} (hx : N x = 1) {t : ℝ} (ht : 0 ≤ t) : -1 ≤ D N x t := by + apply le_trans (b := sInf (normOneSidedValues N x t ⊤)) + · apply le_csInf (normOneSidedValues_nonempty hinf hN x t cofinite_top) + rintro r ⟨y, _, _, rfl⟩ + linarith [apply_nonneg N (x + t • y)] + · exact le_csSup (normD_outer_bddAbove hinf hN hx ht) ⟨⊤, cofinite_top, rfl⟩ + +lemma normD_centers_bddBelow (hinf : ¬ FiniteDimensional ℝ X) {N : Seminorm ℝ X} + (hN : EquivalentNorm N) {t : ℝ} (ht : 0 ≤ t) : + BddBelow {r | ∃ x : X, N x = 1 ∧ r = D N x t} := by + refine ⟨-1, ?_⟩ + rintro r ⟨x, hx, rfl⟩ + exact normD_ge_neg_one hinf hN hx ht + +/-- Seminorm convexity with an explicit common endpoint bound. -/ +lemma seminorm_segment_le (N : Seminorm ℝ X) {x y : X} {r M : ℝ} + (hr : 0 ≤ r) (hr' : r ≤ 1) (hx : N x ≤ M) (hy : N y ≤ M) : + N ((1 - r) • x + r • y) ≤ M := by + have h := map_add_le_add N ((1 - r) • x) (r • y) + rw [map_smul_eq_mul, map_smul_eq_mul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr hr'), abs_of_nonneg hr] at h + have h₁ := mul_le_mul_of_nonneg_left hx (sub_nonneg.mpr hr') + have h₂ := mul_le_mul_of_nonneg_left hy hr + nlinarith + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma equivalentNorm_supremum (hinf : ¬ FiniteDimensional ℝ X) {N : Seminorm ℝ X} + (hN : EquivalentNorm N) : + ∃ R : ℝ, 0 < R ∧ (∀ u : X, ‖u‖ ≤ 1 → N u ≤ R) ∧ + ∀ ε : ℝ, 0 < ε → ∃ x : X, ‖x‖ = 1 ∧ R / (1 + ε) < N x := by + obtain ⟨a, b, ha, hb, hab⟩ := hN + let S : Set ℝ := {r | ∃ x : X, ‖x‖ = 1 ∧ r = N x} + obtain ⟨w, _, hw⟩ := cofinite_has_unit hinf (cofinite_top (X := X)) + have hS : S.Nonempty := ⟨N w, w, hw, rfl⟩ + have hSb : BddAbove S := by + refine ⟨b, ?_⟩ + rintro r ⟨x, hx, rfl⟩ + simpa only [hx, mul_one] using (hab x).2 + let R := sSup S + have hSR : ∀ x : X, ‖x‖ = 1 → N x ≤ R := fun x hx => le_csSup hSb ⟨x, hx, rfl⟩ + have hR : 0 < R := by + have hb := (hab w).1 + rw [hw, mul_one] at hb + exact ha.trans_le (hb.trans (hSR w hw)) + refine ⟨R, hR, ?_, ?_⟩ + · intro u hu + by_cases hu0 : u = 0 + · simpa only [hu0, map_zero] using hR.le + · have hn : 0 < ‖u‖ := norm_pos_iff.mpr hu0 + let x := ‖u‖⁻¹ • u + have hx : ‖x‖ = 1 := norm_smul_inv_norm hu0 + have hid : u = ‖u‖ • x := by dsimp [x]; rw [smul_smul, mul_inv_cancel₀ hn.ne', one_smul] + calc + N u = N (‖u‖ • x) := congrArg N hid + _ = ‖u‖ * N x := by rw [map_smul_eq_mul, Real.norm_eq_abs, abs_of_nonneg hn.le] + _ ≤ ‖u‖ * R := mul_le_mul_of_nonneg_left (hSR x hx) hn.le + _ ≤ R := by nlinarith + · intro ε hε + have hden : 0 < 1 + ε := by linarith + have hlt : R / (1 + ε) < R := (div_lt_iff₀ hden).mpr (by nlinarith) + obtain ⟨r, ⟨x, hx, rfl⟩, hr⟩ := exists_lt_of_lt_csSup hS hlt + exact ⟨x, hx, hr⟩ + +lemma seminorm_normalized_segment (N : Seminorm ℝ X) {x z : X} (hx : 0 < N x) + (hz : 0 < N z) {t M : ℝ} (ht : 0 ≤ t) (htz : t * N x ≤ N z) + (hxM : N x ≤ M) (hzM : N (x + z) ≤ M) : + N ((N x)⁻¹ • x + t • ((N z)⁻¹ • z)) ≤ M / N x := by + let r := t * N x / N z + have hr : 0 ≤ r := div_nonneg (mul_nonneg ht hx.le) hz.le + have hr' : r ≤ 1 := (div_le_one hz).mpr htz + have hid : (N x)⁻¹ • x + t • ((N z)⁻¹ • z) = + (1 - r) • ((N x)⁻¹ • x) + r • ((N x)⁻¹ • (x + z)) := by + dsimp [r] + match_scalars <;> field_simp [hx.ne', hz.ne'] + ring + rw [hid] + apply seminorm_segment_le N hr hr' + · rw [seminorm_normalize N hx] + exact (one_le_div hx).mpr hxM + · rw [map_smul_eq_mul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hx), ← div_eq_inv_mul] + exact (div_le_div_iff_of_pos_right hx).mpr hzM + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma normD_bound_at_original_unit (hsp : UnitSliceProperty X) (N : Seminorm ℝ X) + {a b R : ℝ} (ha : 0 < a) (hb : 0 < b) + (hab : ∀ u : X, a * ‖u‖ ≤ N u ∧ N u ≤ b * ‖u‖) + (hR : ∀ u : X, ‖u‖ ≤ 1 → N u ≤ R) {x : X} (hx : ‖x‖ = 1) : + D N ((N x)⁻¹ • x) (a / (4 * b)) ≤ R / N x - 1 := by + have hNx : 0 < N x := by have := (hab x).1; rw [hx, mul_one] at this; linarith + have hNxb : N x ≤ b := by simpa only [hx, mul_one] using (hab x).2 + have hNxR : N x ≤ R := hR x hx.le + let t := a / (4 * b) + have ht : 0 < t := by dsimp [t]; positivity + have htb : t * (4 * b) = a := div_mul_cancel₀ _ (by positivity) + have htb' : t * b = a / 4 := by linarith + unfold D + refine csSup_le ?_ ?_ + · exact ⟨_, ⊤, cofinite_top, rfl⟩ + rintro q ⟨F, hF, rfl⟩ + apply le_of_forall_pos_le_add + intro δ hδ + let ε := min (1 / 4 : ℝ) (δ * N x / (2 * b)) + have hε : 0 < ε := by dsimp [ε]; positivity + have hε1 : ε < 1 / 2 := (min_le_left _ _).trans_lt (by norm_num) + have hεδ : ε ≤ δ * N x / (2 * b) := min_le_right _ _ + have hεδ' : b * ε ≤ δ * N x / 2 := by + have hd := (le_div_iff₀ (show 0 < 2 * b by positivity)).mp hεδ + nlinarith + obtain ⟨v, e, hv, he, hzF, hfar⟩ := cofinite_diametral_correction hsp hx hF hε + let z := v - x - e + have hzlo : 1 < ‖z‖ := by + have hn := norm_sub_le z (-e) + have hid : z - -e = v - x := by dsimp [z]; abel + rw [hid, norm_neg] at hn + linarith + have hNz : 0 < N z := (mul_pos ha (by linarith)).trans_le (hab z).1 + have htz : t * N x ≤ N z := by + have hc := mul_le_mul_of_nonneg_left hNxb ht.le + have hd := (hab z).1 + nlinarith + have hend : N (x + z) ≤ R + b * ε := by + have hid : x + z = v - e := by dsimp [z]; abel + rw [hid] + have hc := map_sub_le_add N v e + have hb' := (hab e).2 + have hRv := hR v hv + nlinarith + have hxM : N x ≤ R + b * ε := by nlinarith + have hvalue := seminorm_normalized_segment N hNx hNz ht.le htz hxM hend + have hy : N ((N z)⁻¹ • z) = 1 := seminorm_normalize N hNz + have hyF : (N z)⁻¹ • z ∈ F := F.smul_mem _ hzF + have hinf := csInf_le (normOneSidedValues_bddBelow N ((N x)⁻¹ • x) t F) + ⟨(N z)⁻¹ • z, hyF, hy, rfl⟩ + change sInf (normOneSidedValues N ((N x)⁻¹ • x) t F) ≤ _ + have hquot : (R + b * ε) / N x ≤ R / N x + δ := by + apply (div_le_iff₀ hNx).mpr + rw [add_mul, div_mul_cancel₀ R hNx.ne'] + nlinarith + linarith + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/ExactModuli.lean b/lean/OAI/Analysis/Daugavet/ExactModuli.lean new file mode 100644 index 0000000000000000000000000000000000000000..66ec2654496ca58ff724d6676ae758fe23c562df --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/ExactModuli.lean @@ -0,0 +1,61 @@ +import OAI.Analysis.Daugavet.EquivalentNorm + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX u_1 + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- The renorming obstruction is a consequence of the weak-neighborhood geometry, not merely +of the vanishing inherited-norm one-sided modulus. -/ +theorem no_equivalent_auc (hinf : ¬ FiniteDimensional ℝ X) (hsp : UnitSliceProperty X) + (N : Seminorm ℝ X) (hN : EquivalentNorm N) : ¬ AUC N := by + obtain ⟨R, hRpos, hRball, hRapprox⟩ := equivalentNorm_supremum hinf hN + obtain ⟨a, b, ha, hb, hab⟩ := hN + have hN' : EquivalentNorm N := ⟨a, b, ha, hb, hab⟩ + let t := a / (4 * b) + have ht : 0 < t := by dsimp [t]; positivity + have hmod : oneSidedModulus N t ≤ 0 := by + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨x, hx, hopt⟩ := hRapprox ε hε + have hNx : 0 < N x := by have := (hab x).1; rw [hx, mul_one] at this; linarith + have hxN : N ((N x)⁻¹ • x) = 1 := seminorm_normalize N hNx + have hD := normD_bound_at_original_unit hsp N ha hb hab hRball hx + have hopt' : R < N x * (1 + ε) := (div_lt_iff₀ (by linarith)).mp hopt + have hquot : R / N x - 1 ≤ ε := by + have : R / N x < 1 + ε := (div_lt_iff₀ hNx).mpr (by nlinarith) + linarith + have hinf := csInf_le (normD_centers_bddBelow hinf hN' ht.le) + ⟨(N x)⁻¹ • x, hxN, rfl⟩ + change oneSidedModulus N t ≤ D N ((N x)⁻¹ • x) t at hinf + change D N ((N x)⁻¹ • x) t ≤ R / N x - 1 at hD + simpa only [zero_add] using hinf.trans (hD.trans hquot) + intro hauc + exact (hauc t ht).not_ge hmod + +theorem exact_main {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) + [IsProbabilityMeasure μ] (E : Submodule ℝ (Lp ℝ 1 μ)) + (_hclosed : IsClosed (E : Set (Lp ℝ 1 μ))) (hdim : ¬ FiniteDimensional ℝ E) + (hprecompact : MeasurePrecompactBall μ E) (hdaugavet : Daugavet E) : + (∀ (x : E), ‖x‖ = 1 → ∀ t : ℝ, 0 < t → + H (normSeminorm ℝ E) x t = max (t / 2) (t - 1) ∧ + D (normSeminorm ℝ E) x t = max 0 (t - 2)) ∧ + (∀ t : ℝ, 0 < t → + averagedModulus (normSeminorm ℝ E) t = max (t / 2) (t - 1) ∧ + oneSidedModulus (normSeminorm ℝ E) t = max 0 (t - 2)) ∧ + (∀ N : Seminorm ℝ E, EquivalentNorm N → ¬ AUC N) := by + exact ⟨fun x hx t ht => exact_pointwise E hdim hprecompact hdaugavet hx ht, + fun t ht => exact_center_infima E hdim hprecompact hdaugavet ht, + no_equivalent_auc hdim (daugavet_unitSlice hdaugavet)⟩ + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/FiniteCoordinates.lean b/lean/OAI/Analysis/Daugavet/FiniteCoordinates.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d7a4664dafc34613473b091c1a90ddcef2dd3b6 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/FiniteCoordinates.lean @@ -0,0 +1,128 @@ +import OAI.Analysis.Daugavet.Recovery + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uB uR uIota uKappa uBeta + +namespace ExactModuli.KW + +instance kwMeasure_probability : IsProbabilityMeasure kwMeasure := by + unfold kwMeasure + infer_instance + +abbrev KWL1 := Lp ℝ 1 kwMeasure + +/-- Coordinate restriction induces an actual L1 linear isometry. -/ +def coordinatesL1 {ι : Type uIota} [Fintype ι] (c : ι → ℕ) (hc : Function.Injective c) : + Lp ℝ 1 (cubeMeasure ι) →ₗᵢ[ℝ] KWL1 := + Lp.compMeasurePreservingₗᵢ ℝ _ (finite_coordinates_mp c hc) + +/-- A common finite family of coordinates determines the whole subspace. -/ +def FiniteCoordinates (G : Submodule ℝ KWL1) : Prop := + ∃ (ι : Type) (_ : Fintype ι) (c : ι → ℕ) (hc : Function.Injective c), + G ≤ (coordinatesL1 c hc).toLinearMap.range + +lemma extend_coordinates {ι : Type uIota} {κ : Type uKappa} [Fintype ι] [Fintype κ] + (c : ι → ℕ) (hc : Function.Injective c) : + ∃ d : ι ⊕ κ → ℕ, Function.Injective d ∧ ∀ i, d (Sum.inl i) = c i := by + classical + let N := (Finset.univ.sup c) + 1 + have hbound (i : ι) : c i < N := Nat.lt_succ_of_le (Finset.le_sup (Finset.mem_univ i)) + let d : ι ⊕ κ → ℕ := Sum.elim c (fun j => N + (Fintype.equivFin κ j).val) + refine ⟨d, ?_, fun i => rfl⟩ + intro i j hij + cases i with + | inl i => + cases j with + | inl j => exact congrArg Sum.inl (hc hij) + | inr j => + have := hbound i + change c i = N + (Fintype.equivFin κ j).val at hij + omega + | inr i => + cases j with + | inl j => + have := hbound j + change N + (Fintype.equivFin κ i).val = c j at hij + omega + | inr j => + apply congrArg Sum.inr + apply (Fintype.equivFin κ).injective + apply Fin.ext + exact Nat.add_left_cancel hij + +lemma curry_mp {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] : + MeasurePreserving (fun v : cube (κ × ι) => fun k j => v (k,j)) + (cubeMeasure (κ × ι)) (arrayMeasure κ ι) := by + refine ⟨by fun_prop, ?_⟩ + have h := Measure.infinitePi_map_curry (fun _ : κ => fun _ : ι => (volume : Measure unitInterval)) + simp only [Measure.infinitePi_eq_pi, MeasurableEquiv.coe_curry] at h + exact h + +def splitCoordinates {β : Type uBeta} {κ : Type uKappa} {ι : Type uIota} + (v : cube (β ⊕ (κ × ι))) : cube β × (κ → cube ι) := + (fun b => v (Sum.inl b), fun k j => v (Sum.inr (k,j))) + +lemma splitCoordinates_mp {β : Type uBeta} {κ : Type uKappa} {ι : Type uIota} + [Fintype β] [Fintype κ] [Fintype ι] : + MeasurePreserving (splitCoordinates : cube (β ⊕ (κ × ι)) → cube β × (κ → cube ι)) + (cubeMeasure (β ⊕ (κ × ι))) ((cubeMeasure β).prod (arrayMeasure κ ι)) := by + exact ((MeasurePreserving.id (cubeMeasure β)).prod curry_mp).comp + (measurePreserving_sumPiEquivProdPi (fun _ : β ⊕ (κ × ι) => (volume : Measure unitInterval))) + +section L1Tools +variable {B : Type uB} {R : Type uR} [MeasurableSpace B] [MeasurableSpace R] + {μ : Measure B} {ν : Measure R} + +def integrableL1 (f : B → ℝ) (hf : Integrable f μ) : Lp ℝ 1 μ := + (memLp_one_iff_integrable.mpr hf).toLp f + +lemma integrableL1_ae (f : B → ℝ) (hf : Integrable f μ) : + integrableL1 f hf =ᵐ[μ] f := MemLp.coeFn_toLp _ + +lemma L1_norm_of_ae (f : Lp ℝ 1 μ) {g : B → ℝ} (hg : f =ᵐ[μ] g) : + ‖f‖ = ∫ b, |g b| ∂μ := by + rw [L1.norm_eq_integral_norm] + exact integral_congr_ae (hg.fun_comp abs) + +lemma norm_integrableL1 (f : B → ℝ) (hf : Integrable f μ) : + ‖integrableL1 f hf‖ = ∫ b, |f b| ∂μ := L1_norm_of_ae _ (integrableL1_ae _ _) + +lemma coeFn_L1_sum {ι : Type uIota} (s : Finset ι) (f : ι → Lp ℝ 1 μ) : + (∑ i ∈ s, f i : Lp ℝ 1 μ) =ᵐ[μ] fun b => ∑ i ∈ s, f i b := by + classical + induction s using Finset.induction_on with + | empty => + simp only [Finset.sum_empty] + exact Lp.coeFn_zero ℝ 1 μ + | @insert i s hi ih => + simp only [Finset.sum_insert hi] + filter_upwards [Lp.coeFn_add (f i) (∑ j ∈ s, f j), ih] with b hb hb' + simpa only [Pi.add_apply, hb'] using hb + +lemma coeFn_L1_smul_sum {ι : Type uIota} [Fintype ι] (a : ι → ℝ) (f : ι → Lp ℝ 1 μ) : + (∑ i, a i • f i : Lp ℝ 1 μ) =ᵐ[μ] fun b => ∑ i, a i * f i b := by + filter_upwards [coeFn_L1_sum Finset.univ (fun i => a i • f i), + ae_all_iff.mpr (fun i => Lp.coeFn_smul (a i) (f i))] with b hb hbi + rw [hb] + exact Finset.sum_congr rfl (fun i _ => by simpa using hbi i) + +variable [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + +def oldL1 : Lp ℝ 1 μ →ₗᵢ[ℝ] Lp ℝ 1 (μ.prod ν) := + Lp.compMeasurePreservingₗᵢ ℝ Prod.fst measurePreserving_fst + +omit [IsProbabilityMeasure μ] in +lemma oldL1_ae [IsProbabilityMeasure μ] (f : Lp ℝ 1 μ) : + oldL1 (ν := ν) f =ᵐ[μ.prod ν] fun z => f z.1 := Lp.coeFn_compMeasurePreserving f _ + +end L1Tools +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/HeavyTails.lean b/lean/OAI/Analysis/Daugavet/HeavyTails.lean new file mode 100644 index 0000000000000000000000000000000000000000..839415e3da481f00d2d9ce888060b0e7dd473bd8 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/HeavyTails.lean @@ -0,0 +1,212 @@ +import OAI.Analysis.Daugavet.SignAverages + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe u_1 uIota + +namespace ExactModuli.KW + +section HeavySums +variable {ι : Type uIota} [Fintype ι] + +def coefficientNorm (p : ℝ) (a : ι → ℝ) : ℝ := (∑ j, |a j| ^ p) ^ (1 / p) + +lemma coefficientNorm_nonneg (p : ℝ) (a : ι → ℝ) : 0 ≤ coefficientNorm p a := + Real.rpow_nonneg (Finset.sum_nonneg + (fun index _ => Real.rpow_nonneg (abs_nonneg (a index)) _)) _ + +lemma coefficientNorm_rpow {p : ℝ} (hp : 0 < p) (a : ι → ℝ) : + coefficientNorm p a ^ p = ∑ j, |a j| ^ p := by + unfold coefficientNorm + rw [← Real.rpow_mul (Finset.sum_nonneg (fun j _ => Real.rpow_nonneg (abs_nonneg _) _))] + have he : (1 / p) * p = 1 := by field_simp + rw [he, Real.rpow_one] + +lemma abs_le_coefficientNorm {p : ℝ} (hp : 0 < p) (a : ι → ℝ) (j : ι) : + |a j| ≤ coefficientNorm p a := by + apply (Real.rpow_le_rpow_iff (abs_nonneg _) (coefficientNorm_nonneg p a) hp).mp + rw [coefficientNorm_rpow hp a] + exact Finset.single_le_sum (fun i _ => Real.rpow_nonneg (abs_nonneg _) p) (Finset.mem_univ j) + +lemma sum_scaled_coefficients {p s : ℝ} (hp : 0 < p) (hs : 0 ≤ s) (a : ι → ℝ) : + ∑ j, (s * |a j|) ^ p = (s * coefficientNorm p a) ^ p := by + rw [Real.mul_rpow hs (coefficientNorm_nonneg p a), coefficientNorm_rpow hp a, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j hj + exact Real.mul_rpow hs (abs_nonneg _) + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +omit [IsProbabilityMeasure μ] in +lemma difference_law_tail [IsProbabilityMeasure μ] {Y : Ω → ℝ} {p u : ℝ} + (hY : IdentDistrib Y (difference p) μ pairedMeasure) : + μ.real {ω | u < |Y ω|} = pairedMeasure.real {v | u < |difference p v|} := by + exact congrArg ENNReal.toReal (hY.measure_mem_eq + (measurableSet_lt measurable_const measurable_abs)) + +lemma scaled_difference_tail_upper {Y : Ω → ℝ} {p u : ℝ} + (hp : 1 < p) (hY : IdentDistrib Y (difference p) μ pairedMeasure) + (a : ℝ) (hu : 0 < u) : + μ.real {ω | u < |a * Y ω|} ≤ 2 * (scale p * |a|) ^ p * u ^ (-p) := by + by_cases ha : a = 0 + · subst a + simp [hu.not_gt, Real.zero_rpow (by linarith : p ≠ 0)] + have ha0 : 0 < |a| := abs_pos.mpr ha + have hevent : {ω | u < |a * Y ω|} = {ω | u / |a| < |Y ω|} := by + ext ω + simp only [Set.mem_ofPred_eq] + rw [abs_mul, div_lt_iff₀ ha0, mul_comm |a|] + rw [hevent, difference_law_tail hY] + refine (difference_tail_upper hp (div_pos hu ha0)).trans_eq ?_ + have hdiv : scale p / (u / |a|) = (scale p * |a|) / u := by field_simp + rw [hdiv, Real.div_rpow (by positivity [scale_pos hp]) hu.le, Real.rpow_neg hu.le] + ring + +lemma scaled_difference_tail_lower {Y : Ω → ℝ} {p u : ℝ} + (hp : 1 < p) (hpmax : p ≤ 3 / 2) (hY : IdentDistrib Y (difference p) μ pairedMeasure) + (a : ℝ) (hu : 0 < u) (husa : scale p * |a| ≤ u) : + (1 / 18) * (scale p * |a|) ^ p * u ^ (-p) ≤ μ.real {ω | u < |a * Y ω|} := by + by_cases ha : a = 0 + · subst a + simp [Real.zero_rpow (by linarith : p ≠ 0)] + have ha0 : 0 < |a| := abs_pos.mpr ha + have hevent : {ω | u < |a * Y ω|} = {ω | u / |a| < |Y ω|} := by + ext ω + simp only [Set.mem_ofPred_eq] + rw [abs_mul, div_lt_iff₀ ha0, mul_comm |a|] + rw [hevent, difference_law_tail hY] + have hlow := difference_tail_lower hp hpmax ((le_div_iff₀ ha0).mpr husa) + have hdiv : scale p / (u / |a|) = (scale p * |a|) / u := by field_simp + rw [hdiv, Real.div_rpow (by positivity [scale_pos hp]) hu.le] at hlow + rw [Real.rpow_neg hu.le] + convert hlow using 1 + ring + +omit [IsProbabilityMeasure μ] in +lemma scaled_difference_symmetric [IsProbabilityMeasure μ] {Y : Ω → ℝ} {p : ℝ} + (hY : IdentDistrib Y (difference p) μ pairedMeasure) (a : ℝ) : + IdentDistrib (fun ω => a * Y ω) (fun ω => -(a * Y ω)) μ μ := by + have hs := (hY.trans (difference_symmetric p)).trans hY.neg.symm + have ha := hs.const_mul a + simpa only [Pi.neg_apply, mul_neg] using ha + +theorem heavy_tail_upper (Y : ι → Ω → ℝ) (hY : ∀ j, Measurable (Y j)) + (hind : iIndepFun Y μ) {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3 / 2) + (hlaw : ∀ j, IdentDistrib (Y j) (difference p) μ pairedMeasure) + (a : ι → ℝ) {u : ℝ} (hu : 0 < u) : + μ.real {ω | u < |∑ j, a j * Y j ω|} ≤ + 10 * (scale p * coefficientNorm p a / u) ^ p := by + have hs := scale_pos hp + have hp0 : 0 < p := by linarith + have hp2 : p < 2 := by linarith + have hind' := hind.comp (fun j x => a j * x) (fun j => measurable_const.mul measurable_id) + have hb := independent_symmetric_sum_tail (fun j ω => a j * Y j ω) + (fun j => (hY j).const_mul _) hind' (fun j => scaled_difference_symmetric (hlaw j) (a j)) + hp0 hp2 (fun j => 2 * (scale p * |a j|) ^ p) (fun j => by positivity) + (fun j t ht => scaled_difference_tail_upper hp (hlaw j) (a j) ht) hu + rw [← Finset.mul_sum, sum_scaled_coefficients hp0 hs.le a] at hb + have hconst : 2 / (2 - p) ≤ 4 := (div_le_iff₀ (by linarith)).mpr (by linarith) + have hconst' : (1 + 2 / (2 - p)) * 2 ≤ 10 := by linarith + have hm := mul_le_mul_of_nonneg_right hconst' + (mul_nonneg (Real.rpow_nonneg (mul_nonneg hs.le (coefficientNorm_nonneg p a)) p) + (Real.rpow_nonneg hu.le (-p))) + rw [Real.div_rpow (mul_nonneg hs.le (coefficientNorm_nonneg p a)) hu.le] + rw [Real.rpow_neg hu.le] at hm hb + simp only [div_eq_mul_inv] at * + nlinarith + +lemma scaled_difference_max_tail (Y : ι → Ω → ℝ) (hY : ∀ j, Measurable (Y j)) + (hind : iIndepFun Y μ) {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3 / 2) + (hlaw : ∀ j, IdentDistrib (Y j) (difference p) μ pairedMeasure) + (a : ι → ℝ) {u : ℝ} (hu : 0 < u) (hud : scale p * coefficientNorm p a ≤ u) : + (1 / 36) * (scale p * coefficientNorm p a / u) ^ p ≤ + μ.real {ω | u < ‖fun j => a j * Y j ω‖} := by + have hs := scale_pos hp + have hp0 : 0 < p := by linarith + let b := fun j => (1 / 18) * (scale p * |a j|) ^ p * u ^ (-p) + have hb0 : ∀ j, 0 ≤ b j := by intro j; dsimp [b]; positivity + have hsum : ∑ j, b j = (1 / 18) * (scale p * coefficientNorm p a / u) ^ p := by + dsimp [b] + rw [← Finset.sum_mul, ← Finset.mul_sum, sum_scaled_coefficients hp0 hs.le a, + Real.div_rpow (mul_nonneg hs.le (coefficientNorm_nonneg p a)) hu.le, + Real.rpow_neg hu.le] + ring + have hb1 : ∑ j, b j ≤ 1 := by + rw [hsum] + have hr : (scale p * coefficientNorm p a / u) ^ p ≤ 1 := + Real.rpow_le_one (div_nonneg (mul_nonneg hs.le (coefficientNorm_nonneg p a)) hu.le) + ((div_le_one hu).mpr hud) hp0.le + linarith + have hind' := hind.comp (fun j x => a j * x) (fun j => measurable_const.mul measurable_id) + have hb := independent_max_tail_lower (fun j ω => a j * Y j ω) + (fun j => (hY j).const_mul _) hind' hu.le b hb0 hb1 (fun j => + scaled_difference_tail_lower hp hpmax (hlaw j) (a j) hu + ((mul_le_mul_of_nonneg_left (abs_le_coefficientNorm hp0 a j) hs.le).trans hud)) + rw [hsum] at hb + convert hb using 1 + ring + +theorem heavy_tail_lower (Y : ι → Ω → ℝ) (hY : ∀ j, Measurable (Y j)) + (hind : iIndepFun Y μ) {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3 / 2) + (hlaw : ∀ j, IdentDistrib (Y j) (difference p) μ pairedMeasure) + (a : ι → ℝ) : + coefficientNorm p a / 54 ≤ ∫ ω, |∑ j, a j * Y j ω| ∂μ := by + have hs := scale_pos hp + have hp0 : 0 < p := by linarith + have hA0 := coefficientNorm_nonneg p a + by_cases hAeq : coefficientNorm p a = 0 + · rw [hAeq, zero_div] + exact integral_nonneg (fun ω => abs_nonneg _) + have hA : 0 < coefficientNorm p a := lt_of_le_of_ne hA0 (Ne.symm hAeq) + let d := scale p * coefficientNorm p a + have hd : 0 < d := mul_pos hs hA + have hi : ∀ j, Integrable (fun ω => a j * Y j ω) μ := by + intro j + exact ((hlaw j).integrable_iff.mpr (integrable_difference hp)).const_mul _ + have hmaxi : Integrable (fun ω => ‖fun j => a j * Y j ω‖) μ := (integrable_pi_iff.mpr hi).norm + have ht : ∀ t, d ≤ t → ((1 / 36) * d ^ p) * t ^ (-p) ≤ + μ.real {ω | t < ‖fun j => a j * Y j ω‖} := by + intro t htd + have ht0 := hd.trans_le htd + have h := scaled_difference_max_tail Y hY hind hp hpmax hlaw a ht0 htd + change (1 / 36) * (d / t) ^ p ≤ _ at h + rw [Real.div_rpow hd.le ht0.le] at h + rw [Real.rpow_neg ht0.le] + convert h using 1 + ring + have hEL := expectation_lower_from_power_tail hmaxi (ae_of_all _ (fun ω => norm_nonneg _)) + hp (show 0 ≤ (1 / 36 : ℝ) * d ^ p by positivity) hd ht + have hid : ((1 / 36) * d ^ p) * d ^ (1 - p) / (p - 1) = coefficientNorm p a / (36 * p) := by + rw [mul_assoc, ← Real.rpow_add hd, show p + (1 - p) = 1 by ring, Real.rpow_one] + dsimp [d, scale] + field_simp [hp0.ne', show p - 1 ≠ 0 by linarith] + rw [hid] at hEL + have h54 : coefficientNorm p a / 54 ≤ coefficientNorm p a / (36 * p) := by + apply (div_le_div_iff₀ (by norm_num) (by positivity)).mpr + nlinarith + have hind' := hind.comp (fun j x => a j * x) (fun j => measurable_const.mul measurable_id) + exact h54.trans (hEL.trans (expected_max_le_expected_abs_sum + (fun j ω => a j * Y j ω) (fun j => (hY j).const_mul _) hi hind' + (fun j => scaled_difference_symmetric (hlaw j) (a j)))) + +theorem heavy_tail (Y : ι → Ω → ℝ) (hY : ∀ j, Measurable (Y j)) + (hind : iIndepFun Y μ) {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3 / 2) + (hlaw : ∀ j, IdentDistrib (Y j) (difference p) μ pairedMeasure) (a : ι → ℝ) : + (∫ v : unitInterval, multiplier p v = 1) ∧ + (∀ u : ℝ, 0 < u → μ.real {ω | u < |∑ j, a j * Y j ω|} ≤ + 10 * (scale p * coefficientNorm p a / u) ^ p) ∧ + coefficientNorm p a / 54 ≤ ∫ ω, |∑ j, a j * Y j ω| ∂μ := by + exact ⟨integral_multiplier hp, fun u hu => heavy_tail_upper Y hY hind hp hpmax hlaw a hu, + heavy_tail_lower Y hY hind hp hpmax hlaw a⟩ + +end HeavySums + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Joining.lean b/lean/OAI/Analysis/Daugavet/Joining.lean new file mode 100644 index 0000000000000000000000000000000000000000..f494f0c809a4e33f466e54d172e4bc80f7bcab22 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Joining.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.Daugavet.ProductApproximation + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uX uY uB uIota uKappa uBeta + +namespace ExactModuli.KW +section CoordinateJoining +variable {β : Type uBeta} {κ : Type uKappa} {ι : Type uIota} [Fintype β] [Fintype κ] [Fintype ι] + +def joinedCoordinates (d : β ⊕ (κ × ι) → ℕ) (ω : KWOmega) : cube β × (κ → cube ι) := + splitCoordinates (fun i => ω (d i)) + +lemma joinedCoordinates_mp (d : β ⊕ (κ × ι) → ℕ) (hd : Function.Injective d) : + MeasurePreserving (joinedCoordinates d) kwMeasure ((cubeMeasure β).prod (arrayMeasure κ ι)) := + splitCoordinates_mp.comp (finite_coordinates_mp d hd) + +def joinedL1 (d : β ⊕ (κ × ι) → ℕ) (hd : Function.Injective d) : + Lp ℝ 1 ((cubeMeasure β).prod (arrayMeasure κ ι)) →ₗᵢ[ℝ] KWL1 := + Lp.compMeasurePreservingₗᵢ ℝ _ (joinedCoordinates_mp d hd) + +lemma joinedL1_range (d : β ⊕ (κ × ι) → ℕ) (hd : Function.Injective d) : + (joinedL1 d hd).toLinearMap.range ≤ (coordinatesL1 d hd).toLinearMap.range := by + rintro g ⟨f, rfl⟩ + refine ⟨Lp.compMeasurePreserving splitCoordinates splitCoordinates_mp f, ?_⟩ + exact (Lp.compMeasurePreserving_comp_apply f splitCoordinates_mp (finite_coordinates_mp d hd)).symm + +lemma joinedL1_old (c : β → ℕ) (hc : Function.Injective c) + (d : β ⊕ (κ × ι) → ℕ) (hd : Function.Injective d) (hdc : ∀ b, d (Sum.inl b) = c b) + (f : Lp ℝ 1 (cubeMeasure β)) : + joinedL1 d hd (oldL1 f) = coordinatesL1 c hc f := by + change (Lp.compMeasurePreserving (joinedCoordinates d) (joinedCoordinates_mp d hd)) + ((Lp.compMeasurePreserving Prod.fst measurePreserving_fst) f) = _ + rw [← Lp.compMeasurePreserving_comp_apply f measurePreserving_fst (joinedCoordinates_mp d hd)] + have he : Prod.fst ∘ joinedCoordinates d = (fun ω : KWOmega => fun b => ω (c b)) := by + funext ω b + simp only [Function.comp_apply, joinedCoordinates, splitCoordinates, hdc] + simp only [he] + rfl + +lemma joinedL1_measureDistance (d : β ⊕ (κ × ι) → ℕ) (hd : Function.Injective d) + (f g : Lp ℝ 1 ((cubeMeasure β).prod (arrayMeasure κ ι))) : + measureDistance kwMeasure (joinedL1 d hd f) (joinedL1 d hd g) = + measureDistance ((cubeMeasure β).prod (arrayMeasure κ ι)) f g := + measureDistance_pullback (joinedCoordinates_mp d hd) f g + +end CoordinateJoining + +section Model +variable {X : Type uX} {Y : Type uY} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] + +lemma finiteDimensional_model (L : X →ₗᵢ[ℝ] Y) (G : Submodule ℝ Y) [FiniteDimensional ℝ G] : + FiniteDimensional ℝ (G.comap L.toLinearMap) := by + let T : G.comap L.toLinearMap →ₗ[ℝ] G := + (L.toLinearMap.domRestrict (G.comap L.toLinearMap)).codRestrict G (fun x => x.property) + apply FiniteDimensional.of_injective T + intro x y h + apply Subtype.ext + apply L.injective + exact congrArg Subtype.val h + +end Model + +section ProductBasis +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] + +omit [IsProbabilityMeasure μ] in +lemma productOperator_single [IsProbabilityMeasure μ] {p : ℝ} (hp : 1 < p) + (u : κ → Lp ℝ 1 μ) (k : κ) (j : ι) : + ∃ a : κ → ι → ℝ, productOperator hp u (0,a) = atomL1 hp (u k) k j := by + classical + refine ⟨fun k' j' => if k' = k then (if j' = j then 1 else 0) else 0, ?_⟩ + simp [productOperator, matrixCombination, ite_smul] + +end ProductBasis +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/LimitingSlices.lean b/lean/OAI/Analysis/Daugavet/LimitingSlices.lean new file mode 100644 index 0000000000000000000000000000000000000000..70f0679e1d9ed1d6d20648fc3af527aabba19333 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/LimitingSlices.lean @@ -0,0 +1,102 @@ +import OAI.Analysis.Daugavet.ClosedUnion + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uX + +namespace ExactModuli + +lemma unit_in_nonempty_slice {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] [Nontrivial X] + (ell : X →L[ℝ] ℝ) (α : ℝ) (hs : ∃ x : X, ‖x‖ ≤ 1 ∧ α < ell x) : + ∃ u : X, ‖u‖ = 1 ∧ α < ell u := by + obtain ⟨x,hxn,hα⟩ := hs + by_cases hxpos : 0 < ell x + · have hx0 : x ≠ 0 := by intro hx; simp [hx] at hxpos + have hnx : 0 < ‖x‖ := norm_pos_iff.mpr hx0 + refine ⟨‖x‖⁻¹ • x,norm_smul_inv_norm hx0,?_⟩ + rw [map_smul, smul_eq_mul] + exact hα.trans_le (le_mul_of_one_le_left hxpos.le ((one_le_inv₀ hnx).mpr hxn)) + · have hα0 : α < 0 := hα.trans_le (le_of_not_gt hxpos) + obtain ⟨u,hu⟩ := exists_norm_eq X (by norm_num : (0:ℝ)≤1) + by_cases hu0 : 0 ≤ ell u + · exact ⟨u,hu,hα0.trans_le hu0⟩ + · exact ⟨-u,by simpa using hu,by simpa using hα0.trans (neg_pos.mpr (lt_of_not_ge hu0))⟩ + +end ExactModuli + +namespace ExactModuli.KW + +lemma constructedSpace_unitSlice : UnitSliceProperty constructedSpace := by + classical + let : Nontrivial constructedSpace := Submodule.nontrivial_iff_ne_bot.mpr constructedSpace_nonzero + intro w hwn ell α hs ρ hρ + obtain ⟨u,hun,hα⟩ := unit_in_nonempty_slice ell α hs + let η : ℝ := min (ρ/4) ((ell u - α) / (8 * (‖ell‖ + 1))) + have hden : 0 < 8 * (‖ell‖ + 1) := by positivity + have hη : 0 < η := lt_min (by positivity) (div_pos (sub_pos.mpr hα) hden) + have hηρ : η ≤ ρ/4 := min_le_left _ _ + have hηell : η * (8 * (‖ell‖ + 1)) ≤ ell u - α := + (le_div_iff₀ hden).mp (min_le_right _ _) + obtain ⟨N,hN⟩ := stageError_eventually_small hη + obtain ⟨nu,hnu,us,hus,husn,huus⟩ := constructed_sphere_approx u.property hun hη N + obtain ⟨nw,hnw,ws,hws,hwsn,hwws⟩ := constructed_sphere_approx w.property hwn hη N + let b := max nu nw + have husb : us ∈ stageSpace b := stageSpace_mono (le_max_left _ _) hus + have hwsb : ws ∈ stageSpace b := stageSpace_mono (le_max_right _ _) hws + have hb : stageError b < η := hN b (hnu.trans (le_max_left _ _)) + obtain ⟨n,hn,v,hv,husv,hadd⟩ := (step_estimates b).averages us husb husn + let V : Fin n → constructedSpace := fun j => ⟨v j,stageSpace_le_constructed (b+1) (hv j).1⟩ + let a : constructedSpace := (n : ℝ)⁻¹ • ∑ j, V j + have haVal : (a : KWL1) = (n : ℝ)⁻¹ • ∑ j, v j := by simp [a,V] + have hua : ‖u-a‖ ≤ η + 2 * stageError b := by + change ‖(u : KWL1) - (a : KWL1)‖ ≤ _ + rw [haVal] + exact (norm_sub_le_norm_sub_add_norm_sub _ us _).trans (add_le_add huus.le husv) + have hdiff : |ell u - ell a| ≤ ‖ell‖ * (η + 2 * stageError b) := by + calc + _ = ‖ell (u-a)‖ := by rw [map_sub, Real.norm_eq_abs] + _ ≤ ‖ell‖ * ‖u-a‖ := ell.le_opNorm _ + _ ≤ ‖ell‖ * (η + 2 * stageError b) := mul_le_mul_of_nonneg_left hua (norm_nonneg ell) + have herror : ‖ell‖ * (η + 2 * stageError b) < ell u - α := by + have he := mul_le_mul_of_nonneg_left (show η + 2 * stageError b ≤ 3*η by linarith) (norm_nonneg ell) + have hLη : 0 ≤ ‖ell‖ * η := mul_nonneg (norm_nonneg ell) hη.le + nlinarith + have haα : α < ell a := by linarith [le_abs_self (ell u - ell a)] + have hnℝ : (0:ℝ) < n := by exact_mod_cast hn + have haell : ell a = (∑ j, ell (V j)) / (n:ℝ) := by + simp [a, map_sum, div_eq_mul_inv, mul_comm] + have hj : ∃ j, α < ell (V j) := by + by_contra hh + push Not at hh + have hsum : (∑ j, ell (V j)) ≤ (n:ℝ) * α := by + calc + _ ≤ ∑ j : Fin n, α := Finset.sum_le_sum (fun j _ => hh j) + _ = (n:ℝ) * α := by simp + have hale : ell a ≤ α := by + rw [haell] + exact (div_le_iff₀ hnℝ).mpr (by simpa only [mul_comm] using hsum) + linarith + obtain ⟨j,hj⟩ := hj + refine ⟨V j,(hv j).2,hj,?_⟩ + have hnear := hadd ws hwsb hwsn j + have htri : ‖ws + v j‖ ≤ ‖(w:KWL1)-ws‖ + ‖(w:KWL1)+v j‖ := by + have ht := norm_add_le (ws-(w:KWL1)) ((w:KWL1)+v j) + have heq : ws-(w:KWL1)+((w:KWL1)+v j) = ws+v j := by abel + rw [heq, norm_sub_rev] at ht + exact ht + change 2 - ρ ≤ ‖(w:KWL1)+v j‖ + linarith + +lemma constructedSpace_daugavet : Daugavet constructedSpace := by + let : Nontrivial constructedSpace := Submodule.nontrivial_iff_ne_bot.mpr constructedSpace_nonzero + exact unitSlice_daugavet constructedSpace_unitSlice + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/LowerBounds.lean b/lean/OAI/Analysis/Daugavet/LowerBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8850989e7fd1577c05f1d9da6d330663bc59a0d --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/LowerBounds.lean @@ -0,0 +1,256 @@ +import OAI.Analysis.Daugavet.Clipping + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX u_1 + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma cofinite_top : Cofinite (⊤ : Submodule ℝ X) := by + refine ⟨?_, inferInstance⟩ + simpa only [Submodule.top_coe] using isClosed_univ (X := X) + +lemma cofinite_nontrivial (hinf : ¬ FiniteDimensional ℝ X) {F : Submodule ℝ X} + (hF : Cofinite F) : Nontrivial F := by + by_contra hn + have : Subsingleton F := not_nontrivial_iff_subsingleton.mp hn + have : FiniteDimensional ℝ (X ⧸ F) := hF.2 + exact hinf (Module.Finite.of_submodule_quotient F) + +lemma cofinite_has_unit (hinf : ¬ FiniteDimensional ℝ X) {F : Submodule ℝ X} + (hF : Cofinite F) : ∃ y ∈ F, ‖y‖ = 1 := by + have : Nontrivial F := cofinite_nontrivial hinf hF + obtain ⟨y, hy⟩ := exists_norm_eq F (show (0 : ℝ) ≤ 1 by norm_num) + exact ⟨y, y.property, hy⟩ + +lemma norm_average_scale_le (x z : X) {r : ℝ} (hr₀ : 0 ≤ r) (hr₁ : r ≤ 1) : + (‖x + r • z‖ + ‖x - r • z‖) / 2 ≤ (‖x + z‖ + ‖x - z‖) / 2 := by + have h₁ : x + r • z = ((1 + r) / 2) • (x + z) + ((1 - r) / 2) • (x - z) := by + module + have h₂ : x - r • z = ((1 - r) / 2) • (x + z) + ((1 + r) / 2) • (x - z) := by + module + have hpos : 0 ≤ (1 + r) / 2 := by linarith + have hneg : 0 ≤ (1 - r) / 2 := by linarith + have hp := norm_add_le (((1 + r) / 2) • (x + z)) (((1 - r) / 2) • (x - z)) + have hm := norm_add_le (((1 - r) / 2) • (x + z)) (((1 + r) / 2) • (x - z)) + rw [← h₁, norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg hpos, abs_of_nonneg hneg] at hp + rw [← h₂, norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg hpos, abs_of_nonneg hneg] at hm + nlinarith + +lemma increment_normalize_le (x y : X) {t : ℝ} (hy : 1 ≤ ‖y‖) : + averagedIncrement (normSeminorm ℝ X) x t (‖y‖⁻¹ • y) ≤ + averagedIncrement (normSeminorm ℝ X) x t y := by + have hyn : 0 < ‖y‖ := by linarith + have hi : ‖y‖⁻¹ ≤ 1 := (inv_le_one₀ hyn).mpr hy + have h := norm_average_scale_le x (t • y) (inv_nonneg.mpr hyn.le) hi + simpa only [averagedIncrement, coe_normSeminorm, smul_smul, mul_comm t, + sub_le_sub_iff_right] using h + +lemma averagedIncrement_nonneg {x y : X} (hx : ‖x‖ = 1) (t : ℝ) : + 0 ≤ averagedIncrement (normSeminorm ℝ X) x t y := by + have h := norm_add_le (x + t • y) (x - t • y) + have heq : x + t • y + (x - t • y) = (2 : ℝ) • x := by module + rw [heq, norm_smul, hx] at h + norm_num at h + change 0 ≤ (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1 + linarith + +lemma averagedIncrement_le {x y : X} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : averagedIncrement (normSeminorm ℝ X) x t y ≤ t := by + have hp := norm_add_le x (t • y) + have hm := norm_sub_le x (t • y) + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht, hy, hx, mul_one] at hp hm + change (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1 ≤ t + linarith + +lemma averagedIncrement_ge_t_sub_one {x y : X} {t : ℝ} (ht : 0 ≤ t) (hy : 1 ≤ ‖y‖) : + t - 1 ≤ averagedIncrement (normSeminorm ℝ X) x t y := by + have h := norm_sub_le (x + t • y) (x - t • y) + have heq : x + t • y - (x - t • y) = (2 * t) • y := by module + rw [heq, norm_smul, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ 2 * t)] at h + change t - 1 ≤ (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1 + nlinarith + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Inner sets are kept explicit to make nonemptiness and conditional completeness visible. -/ +def averageValues (x : X) (t : ℝ) (F : Submodule ℝ X) : Set ℝ := + {a | ∃ y ∈ F, 1 ≤ ‖y‖ ∧ a = averagedIncrement (normSeminorm ℝ X) x t y} + +def oneSidedValues (x : X) (t : ℝ) (F : Submodule ℝ X) : Set ℝ := + {a | ∃ y ∈ F, ‖y‖ = 1 ∧ a = ‖x + t • y‖ - 1} + +lemma averageValues_nonempty (hinf : ¬ FiniteDimensional ℝ X) (x : X) (t : ℝ) + {F : Submodule ℝ X} (hF : Cofinite F) : (averageValues x t F).Nonempty := by + obtain ⟨y, hy, hny⟩ := cofinite_has_unit hinf hF + exact ⟨_, y, hy, hny.ge, rfl⟩ + +lemma averageValues_bddBelow (x : X) (t : ℝ) (F : Submodule ℝ X) : + BddBelow (averageValues x t F) := by + refine ⟨-1, ?_⟩ + rintro a ⟨y, hy, hny, rfl⟩ + change -1 ≤ (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1 + linarith [norm_nonneg (x + t • y), norm_nonneg (x - t • y)] + +lemma oneSidedValues_nonempty (hinf : ¬ FiniteDimensional ℝ X) (x : X) (t : ℝ) + {F : Submodule ℝ X} (hF : Cofinite F) : (oneSidedValues x t F).Nonempty := by + obtain ⟨y, hy, hny⟩ := cofinite_has_unit hinf hF + exact ⟨_, y, hy, hny, rfl⟩ + +lemma oneSidedValues_bddBelow (x : X) (t : ℝ) (F : Submodule ℝ X) : + BddBelow (oneSidedValues x t F) := by + refine ⟨-1, ?_⟩ + rintro a ⟨y, hy, hny, rfl⟩ + linarith [norm_nonneg (x + t • y)] + +lemma H_outer_bddAbove (hinf : ¬ FiniteDimensional ℝ X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : + BddAbove {r | ∃ F : Submodule ℝ X, Cofinite F ∧ r = sInf (averageValues x t F)} := by + refine ⟨t, ?_⟩ + rintro r ⟨F, hF, rfl⟩ + obtain ⟨y, hy, hny⟩ := cofinite_has_unit hinf hF + exact (csInf_le (averageValues_bddBelow x t F) ⟨y, hy, hny.ge, rfl⟩).trans + (averagedIncrement_le hx hny ht) + +lemma D_outer_bddAbove (hinf : ¬ FiniteDimensional ℝ X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : + BddAbove {r | ∃ F : Submodule ℝ X, Cofinite F ∧ r = sInf (oneSidedValues x t F)} := by + refine ⟨t, ?_⟩ + rintro r ⟨F, hF, rfl⟩ + obtain ⟨y, hy, hny⟩ := cofinite_has_unit hinf hF + apply (csInf_le (oneSidedValues_bddBelow x t F) ⟨y, hy, hny, rfl⟩).trans + have h := norm_add_le x (t • y) + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht, hny, mul_one, hx] at h + linarith + +lemma le_H_of_cofinite (hinf : ¬ FiniteDimensional ℝ X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) {F : Submodule ℝ X} (hF : Cofinite F) {a : ℝ} + (ha : ∀ y ∈ F, 1 ≤ ‖y‖ → a ≤ averagedIncrement (normSeminorm ℝ X) x t y) : + a ≤ H (normSeminorm ℝ X) x t := by + apply le_trans (b := sInf (averageValues x t F)) + · apply le_csInf (averageValues_nonempty hinf x t hF) + rintro r ⟨y, hy, hny, rfl⟩ + exact ha y hy hny + · exact le_csSup (H_outer_bddAbove hinf hx ht) ⟨F, hF, rfl⟩ + +lemma le_D_of_cofinite (hinf : ¬ FiniteDimensional ℝ X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) {F : Submodule ℝ X} (hF : Cofinite F) {a : ℝ} + (ha : ∀ y ∈ F, ‖y‖ = 1 → a ≤ ‖x + t • y‖ - 1) : + a ≤ D (normSeminorm ℝ X) x t := by + apply le_trans (b := sInf (oneSidedValues x t F)) + · apply le_csInf (oneSidedValues_nonempty hinf x t hF) + rintro r ⟨y, hy, hny, rfl⟩ + exact ha y hy hny + · exact le_csSup (D_outer_bddAbove hinf hx ht) ⟨F, hF, rfl⟩ + +lemma H_ge_t_sub_one (hinf : ¬ FiniteDimensional ℝ X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : t - 1 ≤ H (normSeminorm ℝ X) x t := + le_H_of_cofinite hinf hx ht cofinite_top + (fun _ _ hy => averagedIncrement_ge_t_sub_one ht hy) + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} + +/-- The sharp half-mass lower estimate from the measure-precompactness hypothesis. -/ +lemma H_ge_half [IsProbabilityMeasure μ] (E : Submodule ℝ (Lp ℝ 1 μ)) + (hinf : ¬ FiniteDimensional ℝ E) (hpre : MeasurePrecompactBall μ E) + {x : E} (hx : ‖x‖ = 1) {t : ℝ} (ht : 0 < t) : + t / 2 ≤ H (normSeminorm ℝ E) x t := by + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨F, hF, hclip⟩ := finite_cokernel_half_clip E hpre (clipHeight (x : Lp ℝ 1 μ) t) + (clipHeight_nonneg _ ht) (show 0 < ε / t by positivity) + have heps : t * (ε / t) = ε := by field_simp + have hb : t / 2 - ε ≤ H (normSeminorm ℝ E) x t := by + apply le_H_of_cofinite hinf hx ht.le hF + intro y hy hny + let u : E := ‖y‖⁻¹ • y + have hyz : y ≠ 0 := by intro h; norm_num [h] at hny + have hu : ‖u‖ = 1 := norm_smul_inv_norm hyz + have huF : u ∈ F := F.smul_mem _ hy + have hcu := hclip u huF hu + have hident := overlap_identity (x : Lp ℝ 1 μ) (u : Lp ℝ 1 μ) ht + have hxu : ‖(x : Lp ℝ 1 μ)‖ = 1 := hx + have huu : ‖(u : Lp ℝ 1 μ)‖ = 1 := hu + rw [hxu, huu] at hident + have hunitlower : t / 2 - ε ≤ averagedIncrement (normSeminorm ℝ E) x t u := by + change t / 2 - ε ≤ + (‖(x : Lp ℝ 1 μ) + t • (u : Lp ℝ 1 μ)‖ + + ‖(x : Lp ℝ 1 μ) - t • (u : Lp ℝ 1 μ)‖) / 2 - 1 + rw [hident] + nlinarith + exact hunitlower.trans (increment_normalize_le x y hny) + linarith + +theorem clipping_lower_bound [IsProbabilityMeasure μ] (E : Submodule ℝ (Lp ℝ 1 μ)) + (hinf : ¬ FiniteDimensional ℝ E) (hpre : MeasurePrecompactBall μ E) + {x : E} (hx : ‖x‖ = 1) {t : ℝ} (ht : 0 < t) : + max (t / 2) (t - 1) ≤ H (normSeminorm ℝ E) x t := by + exact max_le (H_ge_half E hinf hpre hx ht) (H_ge_t_sub_one hinf hx ht.le) + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma norm_ray_ge_t_sub_one {x y : X} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : t - 1 ≤ ‖x + t • y‖ := by + have h := norm_sub_le (x + t • y) x + have heq : x + t • y - x = t • y := by abel + rw [heq, norm_smul, Real.norm_eq_abs, abs_of_nonneg ht, hy, mul_one, hx] at h + linarith + +/-- The one-sided lower estimate needs only a norming functional. -/ +theorem oneSided_lower_bound (hinf : ¬ FiniteDimensional ℝ X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : max 0 (t - 2) ≤ D (normSeminorm ℝ X) x t := by + obtain ⟨φ, hφnorm, hφx⟩ := exists_dual_vector ℝ x (by rw [hx]; norm_num) + have hφx' : φ x = 1 := by + change φ x = ‖x‖ at hφx + simpa only [hx] using hφx + apply le_D_of_cofinite hinf hx ht (cofinite_ker φ) + intro y hy hny + have hφy : φ y = 0 := hy + have happ : φ (x + t • y) = 1 := by simp [hφx', hφy] + have hnorm := φ.le_opNorm (x + t • y) + rw [happ, hφnorm, one_mul, norm_one] at hnorm + have hrev := norm_ray_ge_t_sub_one hx hny ht + exact max_le (by linarith) (by linarith) + +/-- A single almost antipodal endpoint controls all radii, including the corner t=2. -/ +lemma norm_ray_endpoint_bound {x y : X} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + {L ε t : ℝ} (hL : 0 < L) (hε : 0 ≤ ε) (ht : 0 ≤ t) + (hend : ‖x + L • y‖ ≤ 1 + ε) : + ‖x + t • y‖ ≤ 1 + ε + max 0 (t - L) := by + by_cases htL : t ≤ L + · have hr : 0 ≤ t / L := div_nonneg ht hL.le + have hr' : t / L ≤ 1 := (div_le_one hL).mpr htL + have hid : x + t • y = (1 - t / L) • x + (t / L) • (x + L • y) := by + have hmul : t / L * L = t := div_mul_cancel₀ t hL.ne' + rw [smul_add, smul_smul, hmul] + module + rw [max_eq_left (sub_nonpos.mpr htL), add_zero, hid] + have h := norm_add_le ((1 - t / L) • x) ((t / L) • (x + L • y)) + rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr hr'), abs_of_nonneg hr, hx, mul_one] at h + nlinarith + · have hLt : L ≤ t := le_of_not_ge htL + have hid : x + t • y = (x + L • y) + (t - L) • y := by module + rw [max_eq_right (sub_nonneg.mpr hLt), hid] + have h := norm_add_le (x + L • y) ((t - L) • y) + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hLt), hy, mul_one] at h + linarith + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Main.lean b/lean/OAI/Analysis/Daugavet/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..576d539fec65c621137dc5db65acaba57713c42e --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Main.lean @@ -0,0 +1,42 @@ +import OAI.Analysis.Daugavet.LimitingSlices + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +namespace ExactModuli + +theorem kadets_werner_existence : + ∃ E : Submodule ℝ (Lp ℝ 1 kwMeasure), + IsClosed (E : Set (Lp ℝ 1 kwMeasure)) ∧ (¬ FiniteDimensional ℝ E) ∧ + MeasurePrecompactBall kwMeasure E ∧ UnitSliceProperty E ∧ Daugavet E := by + exact ⟨KW.constructedSpace, KW.constructedSpace_closed, KW.constructedSpace_infiniteDimensional, + KW.constructedSpace_measurePrecompact, KW.constructedSpace_unitSlice, KW.constructedSpace_daugavet⟩ + +end ExactModuli + +namespace ExactModuli + +theorem exact_example : + ∃ E : Submodule ℝ (Lp ℝ 1 kwMeasure), + IsClosed (E : Set (Lp ℝ 1 kwMeasure)) ∧ (¬ FiniteDimensional ℝ E) ∧ + MeasurePrecompactBall kwMeasure E ∧ UnitSliceProperty E ∧ Daugavet E ∧ + (∀ (x : E), ‖x‖ = 1 → ∀ t : ℝ, 0 < t → + H (normSeminorm ℝ E) x t = max (t / 2) (t - 1) ∧ + D (normSeminorm ℝ E) x t = max 0 (t - 2)) ∧ + (∀ t : ℝ, 0 < t → + averagedModulus (normSeminorm ℝ E) t = max (t / 2) (t - 1) ∧ + oneSidedModulus (normSeminorm ℝ E) t = max 0 (t - 2)) ∧ + (∀ N : Seminorm ℝ E, EquivalentNorm N → ¬ AUC N) := by + let := KW.kwMeasure_probability + obtain ⟨E,hclosed,hdim,hcompact,hslice,hdaugavet⟩ := kadets_werner_existence + obtain ⟨hpoint,hcenters,hrenorm⟩ := exact_main kwMeasure E hclosed hdim hcompact hdaugavet + exact ⟨E,hclosed,hdim,hcompact,hslice,hdaugavet,hpoint,hcenters,hrenorm⟩ + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/MeasureDistance.lean b/lean/OAI/Analysis/Daugavet/MeasureDistance.lean new file mode 100644 index 0000000000000000000000000000000000000000..c1b2fbd6bca5f0e6fac94012a3d1bc0becf8f989 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/MeasureDistance.lean @@ -0,0 +1,115 @@ +import OAI.Analysis.Daugavet.Enlargement + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uX u_1 uB + +namespace ExactModuli + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +lemma measureDistance_self (f : Lp ℝ 1 μ) : measureDistance μ f f = 0 := by + apply le_antisymm _ (measureDistance_nonneg f f) + apply le_of_forall_pos_le_add + intro ε hε + simpa only [zero_add] using (measureDistance_le_of_tail f f hε (by simpa [not_lt_of_ge hε.le] using hε)) + +omit [IsProbabilityMeasure μ] in +lemma measureDistance_symm [IsProbabilityMeasure μ] (f g : Lp ℝ 1 μ) : + measureDistance μ f g = measureDistance μ g f := by + simp only [measureDistance, abs_sub_comm (f _) (g _)] + +lemma measureDistance_triangle (f g k : Lp ℝ 1 μ) : + measureDistance μ f k ≤ measureDistance μ f g + measureDistance μ g k := by + apply le_of_forall_pos_le_add + intro ε hε + let a := measureDistance μ f g + ε / 2 + let b := measureDistance μ g k + ε / 2 + have ha : 0 < a := by dsimp [a]; linarith [measureDistance_nonneg f g] + have hb : 0 < b := by dsimp [b]; linarith [measureDistance_nonneg g k] + have hfa := tail_lt_of_measureDistance_lt f g (show measureDistance μ f g < a by dsimp [a]; linarith) + have hgb := tail_lt_of_measureDistance_lt g k (show measureDistance μ g k < b by dsimp [b]; linarith) + have hsub : {ω | a + b < |f ω - k ω|} ⊆ + {ω | a < |f ω - g ω|} ∪ {ω | b < |g ω - k ω|} := by + intro ω hω + by_contra hh + simp only [Set.mem_union, Set.mem_ofPred_eq, not_or, not_lt] at hh + have ht : |f ω - k ω| ≤ |f ω - g ω| + |g ω - k ω| := abs_sub_le _ _ _ + exact (not_lt_of_ge (ht.trans (add_le_add hh.1 hh.2))) hω + have htail : μ.real {ω | a + b < |f ω - k ω|} < a + b := + (measureReal_mono hsub).trans_lt ((measureReal_union_le _ _).trans_lt (add_lt_add hfa hgb)) + have hh := measureDistance_le_of_tail f k (add_pos ha hb) htail + dsimp [a,b] at hh + linarith + +/-- Markov's norm-to-measure estimate, in a form avoiding an unnecessary metric instance. -/ +lemma measureDistance_le_of_norm_sub_lt_sq (f g : Lp ℝ 1 μ) {ε : ℝ} (hε : 0 < ε) + (hfg : ‖f - g‖ < ε ^ 2) : measureDistance μ f g ≤ ε := by + have hi : Integrable (fun ω => |f ω - g ω|) μ := + ((L1.integrable_coeFn f).sub (L1.integrable_coeFn g)).abs + have hint : (∫ ω, |f ω - g ω| ∂μ) = ‖f - g‖ := by + exact (KW.L1_norm_of_ae (f-g) (Lp.coeFn_sub f g)).symm + have hm := mul_meas_ge_le_integral_of_nonneg (ae_of_all μ (fun ω => abs_nonneg (f ω-g ω))) hi ε + rw [hint] at hm + have hle : μ.real {ω | ε ≤ |f ω - g ω|} < ε := by nlinarith + apply measureDistance_le_of_tail f g hε + exact (measureReal_mono (μ := μ) (show {ω | ε < |f ω-g ω|} ⊆ {ω | ε ≤ |f ω-g ω|} from by + intro ω hω + change ε < |f ω-g ω| at hω + change ε ≤ |f ω-g ω| + exact hω.le)).trans_lt hle + +end ExactModuli + +namespace ExactModuli.KW + +lemma normalizeL1_approx {B : Type uB} [MeasurableSpace B] {μ : Measure B} + (x y : Lp ℝ 1 μ) (hx : ‖x‖ ≤ 1) : + ‖x - normalizeL1 y‖ ≤ 2 * ‖x-y‖ := by + by_cases hy : ‖y‖ ≤ 1 + · simp only [normalizeL1, max_eq_left hy, inv_one, one_smul] + linarith [norm_nonneg (x-y)] + have hyp : 0 < ‖y‖ := by linarith + have hinv : ‖y‖⁻¹ ≤ 1 := (inv_le_one₀ hyp).mpr (le_of_not_ge hy) + have hcost : ‖y - normalizeL1 y‖ = ‖y‖ - 1 := by + calc + _ = ‖(1 - ‖y‖⁻¹) • y‖ := by + rw [normalizeL1, max_eq_right (le_of_not_ge hy), sub_smul, one_smul] + _ = (1 - ‖y‖⁻¹) * ‖y‖ := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (sub_nonneg.mpr hinv)] + _ = ‖y‖ - 1 := by rw [sub_mul, one_mul, inv_mul_cancel₀ hyp.ne'] + calc + ‖x - normalizeL1 y‖ ≤ ‖x-y‖ + ‖y-normalizeL1 y‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ 2 * ‖x-y‖ := by + rw [hcost] + have ht := norm_sub_norm_le y x + rw [norm_sub_rev] at ht + linarith + +lemma sphere_normalize_approx {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + (x y : X) (hx : ‖x‖ = 1) (hy : y ≠ 0) : + ‖x - ‖y‖⁻¹ • y‖ ≤ 2 * ‖x-y‖ := by + have hyp : 0 < ‖y‖ := norm_pos_iff.mpr hy + have hcost : ‖y - ‖y‖⁻¹ • y‖ = |‖y‖ - 1| := by + calc + _ = ‖(1 - ‖y‖⁻¹) • y‖ := by rw [sub_smul, one_smul] + _ = |(1 - ‖y‖⁻¹) * ‖y‖| := by + rw [norm_smul, Real.norm_eq_abs, abs_mul, abs_of_nonneg (norm_nonneg y)] + _ = |‖y‖ - 1| := by rw [sub_mul, one_mul, inv_mul_cancel₀ hyp.ne'] + calc + ‖x - ‖y‖⁻¹ • y‖ ≤ ‖x-y‖ + ‖y-‖y‖⁻¹ • y‖ := norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ 2 * ‖x-y‖ := by + rw [hcost, ← hx] + have ht := abs_norm_sub_norm_le y x + rw [norm_sub_rev] at ht + linarith + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Model.lean b/lean/OAI/Analysis/Daugavet/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3373425c77729f52049f4c5dc40a3fd88a69635 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Model.lean @@ -0,0 +1,75 @@ +import Mathlib + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX u_1 + +namespace ExactModuli + +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Closed linear subspaces of finite codimension. -/ +def Cofinite (F : Submodule ℝ X) : Prop := + IsClosed (F : Set X) ∧ FiniteDimensional ℝ (X ⧸ F) + +/-- Averaged increment for directions of norm at least one. -/ +def averagedIncrement (N : Seminorm ℝ X) (x : X) (t : ℝ) (y : X) : ℝ := + (N (x + t • y) + N (x - t • y)) / 2 - 1 + +def H (N : Seminorm ℝ X) (x : X) (t : ℝ) : ℝ := + sSup {r | ∃ F : Submodule ℝ X, Cofinite F ∧ + r = sInf {a | ∃ y ∈ F, 1 ≤ N y ∧ a = averagedIncrement N x t y}} + +def D (N : Seminorm ℝ X) (x : X) (t : ℝ) : ℝ := + sSup {r | ∃ F : Submodule ℝ X, Cofinite F ∧ + r = sInf {a | ∃ y ∈ F, N y = 1 ∧ a = N (x + t • y) - 1}} + +def averagedModulus (N : Seminorm ℝ X) (t : ℝ) : ℝ := + sInf {r | ∃ x, N x = 1 ∧ r = H N x t} + +def oneSidedModulus (N : Seminorm ℝ X) (t : ℝ) : ℝ := + sInf {r | ∃ x, N x = 1 ∧ r = D N x t} + +/-- Two-sided comparison makes this seminorm a genuine norm equivalent to the original. -/ +def EquivalentNorm (N : Seminorm ℝ X) : Prop := + ∃ a b : ℝ, 0 < a ∧ 0 < b ∧ ∀ x, a * ‖x‖ ≤ N x ∧ N x ≤ b * ‖x‖ + +def AUC (N : Seminorm ℝ X) : Prop := + ∀ t : ℝ, 0 < t → 0 < oneSidedModulus N t + +/-- Every rank-one operator has the form `ell.smulRight v`. -/ +def Daugavet (X : Type uX) [NormedAddCommGroup X] [NormedSpace ℝ X] : Prop := + ∀ (ell : X →L[ℝ] ℝ) (v : X), + ‖ContinuousLinearMap.id ℝ X + ell.smulRight v‖ = 1 + ‖ell.smulRight v‖ + +variable {Ω : Type u_1} [MeasurableSpace Ω] (μ : Measure Ω) + +/-- Convergence-in-measure distance on L1 equivalence classes. -/ +def measureDistance (f g : Lp ℝ 1 μ) : ℝ := + sInf {a : ℝ | 0 < a ∧ μ.real {ω | a < |f ω - g ω|} < a} + +/-- Finite covers of the entire unit ball in convergence-in-measure distance. -/ +def MeasurePrecompactBall (E : Submodule ℝ (Lp ℝ 1 μ)) : Prop := + ∀ ε : ℝ, 0 < ε → ∃ s : Finset (Lp ℝ 1 μ), + ∀ y : E, ‖y‖ ≤ 1 → ∃ b ∈ s, measureDistance μ (y : Lp ℝ 1 μ) b < ε + +/-- Every nonempty unit-ball slice contains an almost antipodal unit vector. -/ +def UnitSliceProperty (X : Type uX) [NormedAddCommGroup X] [NormedSpace ℝ X] : Prop := + ∀ (w : X), ‖w‖ = 1 → ∀ (ell : X →L[ℝ] ℝ) (α : ℝ), + (∃ u : X, ‖u‖ ≤ 1 ∧ α < ell u) → + ∀ ρ : ℝ, 0 < ρ → ∃ y : X, ‖y‖ = 1 ∧ α < ell y ∧ 2 - ρ ≤ ‖w + y‖ + +/-- The countable product of unit intervals. -/ +abbrev KWOmega := ℕ → unitInterval + +def kwMeasure : Measure KWOmega := Measure.infinitePi (fun _ : ℕ => (volume : Measure unitInterval)) + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Multipliers.lean b/lean/OAI/Analysis/Daugavet/Multipliers.lean new file mode 100644 index 0000000000000000000000000000000000000000..d9196047ce6d0996a748aa610b5741a31e31479f --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Multipliers.lean @@ -0,0 +1,194 @@ +import OAI.Analysis.Daugavet.SliceCharacterization + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +namespace ExactModuli.KW + +def scale (p : ℝ) : ℝ := (p - 1) / p + +def multiplier (p : ℝ) (v : unitInterval) : ℝ := scale p * (v : ℝ) ^ (-1 / p) + +lemma scale_pos {p : ℝ} (hp : 1 < p) : 0 < scale p := by + dsimp [scale]; positivity + +lemma scale_lt_one {p : ℝ} (hp : 1 < p) : scale p < 1 := by + unfold scale + rw [div_lt_one (by linarith : 0 < p)] + linarith + +lemma multiplier_nonneg {p : ℝ} (hp : 1 < p) (v : unitInterval) : + 0 ≤ multiplier p v := mul_nonneg (scale_pos hp).le (Real.rpow_nonneg v.property.1 _) + +lemma measurable_multiplier (p : ℝ) : Measurable (multiplier p) := by + unfold multiplier + fun_prop + +lemma integrable_multiplier {p : ℝ} (hp : 1 < p) : + Integrable (multiplier p) (volume : Measure unitInterval) := by + have hp0 : 0 < p := by linarith + have hexp : -1 < -1 / p := by rw [lt_div_iff₀ hp0]; linarith + have hi : IntegrableOn (fun x : ℝ => x ^ (-1 / p)) (Icc 0 1) volume := + (integrableOn_Icc_iff_integrableOn_Ioc (μ := volume)).mpr + ((intervalIntegral.intervalIntegrable_rpow' hexp).1) + have hc := (unitInterval.measurePreserving_coe.integrable_comp hi.aestronglyMeasurable).mpr hi + exact hc.const_mul (scale p) + +lemma integral_multiplier {p : ℝ} (hp : 1 < p) : + ∫ v : unitInterval, multiplier p v = 1 := by + have hp0 : 0 < p := by linarith + have hexp : -1 < -1 / p := by rw [lt_div_iff₀ hp0]; linarith + unfold multiplier + rw [integral_const_mul] + change scale p * (∫ x : Icc (0:ℝ) 1, (x:ℝ) ^ (-1 / p)) = 1 + rw [integral_subtype measurableSet_Icc (fun x : ℝ => x ^ (-1 / p)), + integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by norm_num : (0:ℝ) ≤ 1), + integral_rpow (Or.inl hexp)] + rw [Real.one_rpow, Real.zero_rpow (by linarith : -1 / p + 1 ≠ 0)] + dsimp [scale] + field_simp [hp0.ne', show p - 1 ≠ 0 by linarith, show -1 + p ≠ 0 by linarith] + ring + +lemma multiplier_tail {p u : ℝ} (hp : 1 < p) (hu : scale p ≤ u) : + (volume : Measure unitInterval).real {v | u < multiplier p v} = (scale p / u) ^ p := by + have hs : 0 < scale p := scale_pos hp + have hu0 : 0 < u := hs.trans_le hu + have hp0 : 0 < p := by linarith + let q := (scale p / u) ^ p + have hq : 0 < q := Real.rpow_pos_of_pos (div_pos hs hu0) _ + have hq1 : q ≤ 1 := by + dsimp [q] + exact Real.rpow_le_one (by positivity) ((div_le_one hu0).mpr hu) hp0.le + let a : unitInterval := ⟨q, hq.le, hq1⟩ + have hqpow : q ^ (-1 / p) = u / scale p := by + dsimp [q] + rw [← Real.rpow_mul (div_pos hs hu0).le] + have hm : p * (-1 / p) = -1 := by field_simp + rw [hm, Real.rpow_neg_one, inv_div] + have haeq : {v : unitInterval | u < multiplier p v} =ᵐ[volume] Iio a := by + have hne : ∀ᵐ v : unitInterval, v ≠ 0 := volume.ae_ne 0 + filter_upwards [hne] with v hv + have hv0 : 0 < (v : ℝ) := lt_of_le_of_ne v.property.1 (by + intro heq; apply hv; apply Subtype.ext; exact heq.symm) + apply propext + change (u < scale p * (v : ℝ) ^ (-1 / p)) ↔ (v : ℝ) < q + have hueq : u = scale p * q ^ (-1 / p) := by rw [hqpow]; field_simp + rw [hueq, mul_lt_mul_iff_right₀ hs, + Real.rpow_lt_rpow_iff_of_neg hq hv0 (div_neg_of_neg_of_pos (by norm_num) hp0)] + rw [measureReal_congr haeq, measureReal_def, unitInterval.volume_Iio, + ENNReal.toReal_ofReal hq.le] + +lemma multiplier_tail_le {p u : ℝ} (hp : 1 < p) (hu : 0 < u) : + (volume : Measure unitInterval).real {v | u < multiplier p v} ≤ (scale p / u) ^ p := by + by_cases hs : scale p ≤ u + · exact le_of_eq (multiplier_tail hp hs) + · have hsu : 1 ≤ (scale p / u) ^ p := Real.one_le_rpow + ((le_div_iff₀ hu).mpr (by linarith : 1 * u ≤ scale p)) (by linarith) + exact (measureReal_le_one).trans hsu + +abbrev pairedMeasure : Measure (unitInterval × unitInterval) := + (volume : Measure unitInterval).prod volume + +def difference (p : ℝ) (v : unitInterval × unitInterval) : ℝ := + multiplier p v.1 - multiplier p v.2 + +lemma measurable_difference (p : ℝ) : Measurable (difference p) := + ((measurable_multiplier p).comp measurable_fst).sub + ((measurable_multiplier p).comp measurable_snd) + +lemma integrable_difference {p : ℝ} (hp : 1 < p) : + Integrable (difference p) pairedMeasure := by + exact ((measurePreserving_fst.integrable_comp + (integrable_multiplier hp).aestronglyMeasurable).mpr (integrable_multiplier hp)).sub + ((measurePreserving_snd.integrable_comp + (integrable_multiplier hp).aestronglyMeasurable).mpr (integrable_multiplier hp)) + +lemma difference_symmetric (p : ℝ) : + IdentDistrib (difference p) (fun v => -difference p v) pairedMeasure pairedMeasure := by + have hcomp : (fun v => -difference p v) = difference p ∘ Prod.swap := by + funext v + simp [difference, sub_eq_add_neg, add_comm] + refine ⟨(measurable_difference p).aemeasurable, + (measurable_difference p).neg.aemeasurable, ?_⟩ + rw [hcomp, ← Measure.map_map (measurable_difference p) measurable_swap, Measure.prod_swap] + +lemma difference_tail_upper {p u : ℝ} (hp : 1 < p) (hu : 0 < u) : + pairedMeasure.real {v | u < |difference p v|} ≤ 2 * (scale p / u) ^ p := by + let A := {v : unitInterval | u < multiplier p v} + have hsub : {v | u < |difference p v|} ⊆ (A ×ˢ univ) ∪ (univ ×ˢ A) := by + intro v hv + change u < |multiplier p v.1 - multiplier p v.2| at hv + by_contra hn + have he : multiplier p v.1 ≤ u ∧ multiplier p v.2 ≤ u := by + simpa [A] using hn + have h1 := multiplier_nonneg hp v.1 + have h2 := multiplier_nonneg hp v.2 + have hb : |multiplier p v.1 - multiplier p v.2| ≤ u := + abs_le.mpr ⟨by linarith, by linarith⟩ + linarith + calc + _ ≤ pairedMeasure.real ((A ×ˢ univ) ∪ (univ ×ˢ A)) := measureReal_mono hsub + _ ≤ pairedMeasure.real (A ×ˢ univ) + pairedMeasure.real (univ ×ˢ A) := measureReal_union_le _ _ + _ = 2 * (volume : Measure unitInterval).real A := by + rw [measureReal_prod_prod, measureReal_prod_prod] + simp + ring + _ ≤ _ := mul_le_mul_of_nonneg_left (multiplier_tail_le hp hu) (by norm_num) + +lemma difference_tail_lower {p u : ℝ} (hp : 1 < p) (hpmax : p ≤ 3 / 2) + (hu : scale p ≤ u) : + (1 / 18) * (scale p / u) ^ p ≤ pairedMeasure.real {v | u < |difference p v|} := by + have hs : 0 < scale p := scale_pos hp + have hu0 : 0 < u := hs.trans_le hu + have hp0 : 0 < p := by linarith + let B := {v : unitInterval | u + 2 * scale p < multiplier p v} + let C := {v : unitInterval | 2 * scale p < multiplier p v}ᶜ + have hsub : B ×ˢ C ⊆ {v | u < |difference p v|} := by + intro v hv + have hB : u + 2 * scale p < multiplier p v.1 := hv.1 + have hC : multiplier p v.2 ≤ 2 * scale p := le_of_not_gt hv.2 + have hdiff : u < difference p v := by dsimp [difference]; linarith + exact hdiff.trans_le (le_abs_self _) + have hB : (volume : Measure unitInterval).real B = (scale p / (u + 2 * scale p)) ^ p := + multiplier_tail hp (by linarith) + have hC : (1 / 2 : ℝ) ≤ (volume : Measure unitInterval).real C := by + have heq : scale p / (2 * scale p) = (1 / 2 : ℝ) := by field_simp + have hpow : (1 / 2 : ℝ) ^ p ≤ 1 / 2 := by + simpa using Real.rpow_le_rpow_of_exponent_ge + (by norm_num : (0:ℝ) < 1 / 2) (by norm_num : (1 / 2 : ℝ) ≤ 1) hp.le + have hvol : (volume : Measure unitInterval).real univ = 1 := by simp + dsimp [C] + rw [measureReal_compl (measurableSet_lt measurable_const (measurable_multiplier p)), + hvol, multiplier_tail hp (by linarith), heq] + linarith + have hB9 : (scale p / u) ^ p ≤ 9 * (volume : Measure unitInterval).real B := by + rw [hB] + have hd : (scale p / u) / 3 ≤ scale p / (u + 2 * scale p) := by + rw [div_div] + apply (div_le_div_iff₀ (by positivity : 0 < u * 3) (by positivity)).mpr + nlinarith + have hpow := Real.rpow_le_rpow (show 0 ≤ (scale p / u) / 3 by positivity) hd hp0.le + rw [Real.div_rpow (by positivity) (by norm_num)] at hpow + have h3 : (3:ℝ) ^ p ≤ 9 := by + have h := Real.rpow_le_rpow_of_exponent_le (by norm_num : (1:ℝ) ≤ 3) + (show p ≤ 2 by linarith) + norm_num at h + exact h + have hin := (div_le_iff₀ (Real.rpow_pos_of_pos (by norm_num : (0:ℝ) < 3) p)).mp hpow + have hmul := mul_le_mul_of_nonneg_right h3 + (Real.rpow_nonneg (by positivity : 0 ≤ scale p / (u + 2 * scale p)) p) + nlinarith + have hprod := mul_le_mul_of_nonneg_left hC + (measureReal_nonneg : 0 ≤ (volume : Measure unitInterval).real B) + have hm := measureReal_mono (μ := pairedMeasure) hsub + rw [measureReal_prod_prod] at hm + nlinarith + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/ProductApproximation.lean b/lean/OAI/Analysis/Daugavet/ProductApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..3b2ccda2e195cf5f6dba940a672b175efa5ec149 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/ProductApproximation.lean @@ -0,0 +1,149 @@ +import OAI.Analysis.Daugavet.ProductOperators + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uB uR uIota uKappa + +namespace ExactModuli +section MeasureMetric +variable {B : Type uB} {R : Type uR} [MeasurableSpace B] [MeasurableSpace R] + {μ : Measure B} {ν : Measure R} [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + +omit [IsProbabilityMeasure μ] in +lemma measureDistance_le_of_tail [IsProbabilityMeasure μ] (f g : Lp ℝ 1 μ) {h : ℝ} (hh : 0 < h) + (ht : μ.real {b | h < |f b - g b|} < h) : measureDistance μ f g ≤ h := + csInf_le ⟨0, fun _ ha => ha.1.le⟩ ⟨hh, ht⟩ + +omit [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] in +lemma measureDistance_pullback [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] + {F : B → R} (hF : MeasurePreserving F μ ν) (f g : Lp ℝ 1 ν) : + measureDistance μ (Lp.compMeasurePreserving F hF f) (Lp.compMeasurePreserving F hF g) = + measureDistance ν f g := by + have ht (h : ℝ) : + μ.real {b | h < |Lp.compMeasurePreserving F hF f b - Lp.compMeasurePreserving F hF g b|} = + ν.real {r | h < |f r - g r|} := by + have hae : {b | h < |Lp.compMeasurePreserving F hF f b - Lp.compMeasurePreserving F hF g b|} =ᵐ[μ] + F ⁻¹' {r | h < |f r - g r|} := by + filter_upwards [Lp.coeFn_compMeasurePreserving f hF, Lp.coeFn_compMeasurePreserving g hF] with b hb hb' + change (h < |Lp.compMeasurePreserving F hF f b - Lp.compMeasurePreserving F hF g b|) = + (h < |f (F b) - g (F b)|) + simp only [hb, hb', Function.comp_apply] + rw [measureReal_congr hae] + exact hF.measureReal_preimage (measurableSet_lt measurable_const + ((Lp.stronglyMeasurable f).measurable.sub (Lp.stronglyMeasurable g).measurable).abs).nullMeasurableSet + simp only [measureDistance, ht] + +end MeasureMetric +end ExactModuli + +namespace ExactModuli.KW +section ProductAverages +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] +variable {κ : Type uKappa} [Fintype κ] + +lemma atoms_average_norm {p : ℝ} (hp : 1 < p) {n : ℕ} (u : Lp ℝ 1 μ) (hu : ‖u‖ = 1) (k : κ) : + ‖oldL1 u - (n : ℝ)⁻¹ • ∑ j : Fin n, atomL1 hp u k j‖ = + ∫ v : cube (Fin n), |(n : ℝ)⁻¹ * (∑ j, multiplier p (v j)) - 1| ∂cubeMeasure (Fin n) := by + let A : (κ → cube (Fin n)) → ℝ := fun v => 1 - (n : ℝ)⁻¹ * ∑ j, multiplier p (v k j) + have hae : (oldL1 u - (n : ℝ)⁻¹ • ∑ j : Fin n, atomL1 hp u k j : Lp ℝ 1 (μ.prod (arrayMeasure κ (Fin n)))) + =ᵐ[μ.prod (arrayMeasure κ (Fin n))] fun z => u z.1 * A z.2 := by + filter_upwards [Lp.coeFn_sub (oldL1 u) ((n : ℝ)⁻¹ • ∑ j : Fin n, atomL1 hp u k j), + oldL1_ae u, Lp.coeFn_smul (n : ℝ)⁻¹ (∑ j : Fin n, atomL1 hp u k j), + coeFn_L1_sum Finset.univ (fun j : Fin n => atomL1 hp u k j), + ae_all_iff.mpr (fun j : Fin n => atomL1_ae hp u k j)] with z hz hu' hs hsum hj + simp only [Pi.sub_apply, Pi.smul_apply, smul_eq_mul, hu', hs, hsum] at hz + rw [hz] + simp only [hj, arrayMultiplier, ← Finset.mul_sum, A] + ring + rw [L1_norm_of_ae _ hae] + simp only [abs_mul] + rw [integral_prod_mul (fun b => |u b|) (fun v => |A v|)] + have hun : (∫ b, |u b| ∂μ) = 1 := (L1.norm_eq_integral_norm u).symm.trans hu + rw [hun, one_mul] + have heq := mp_integral (measurePreserving_eval (fun _ : κ => cubeMeasure (Fin n)) k) + (((integrable_rowSum hp (fun _ : Fin n => 1)).const_mul (n : ℝ)⁻¹).sub (integrable_const 1)).abs.aestronglyMeasurable + simp only [rowSum, one_mul, Pi.sub_apply] at heq + dsimp [A] + simp_rw [abs_sub_comm (1 : ℝ)] + exact heq + +end ProductAverages + +section Normalize +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} + +def normalizeL1 (f : Lp ℝ 1 μ) : Lp ℝ 1 μ := (max 1 ‖f‖)⁻¹ • f + +lemma normalizeL1_mem (G : Submodule ℝ (Lp ℝ 1 μ)) {f : Lp ℝ 1 μ} (hf : f ∈ G) : + normalizeL1 f ∈ G := G.smul_mem _ hf + +lemma normalizeL1_norm (f : Lp ℝ 1 μ) : ‖normalizeL1 f‖ ≤ 1 := by + have hm : 0 < max 1 ‖f‖ := lt_of_lt_of_le zero_lt_one (le_max_left _ _) + rw [normalizeL1, norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hm)] + rw [← div_eq_inv_mul, div_le_one hm] + exact le_max_right _ _ + +lemma normalizeL1_ae (f : Lp ℝ 1 μ) {g : B → ℝ} (hfg : f =ᵐ[μ] g) : + normalizeL1 f =ᵐ[μ] normalizeFunction μ g := by + have hn := L1_norm_of_ae f hfg + filter_upwards [Lp.coeFn_smul (max 1 ‖f‖)⁻¹ f, hfg] with b hb hb' + dsimp [normalizeL1] + rw [hb] + simp only [Pi.smul_apply, smul_eq_mul, hb', hn, normalizeFunction, div_eq_mul_inv, mul_comm] + +lemma oldCombination_ae (x : Lp ℝ 1 μ) {κ : Type uKappa} [Fintype κ] + (u : κ → Lp ℝ 1 μ) (c : κ → ℝ) : + (x + ∑ k, c k • u k : Lp ℝ 1 μ) =ᵐ[μ] oldCombination x (fun k => (u k : B → ℝ)) c := by + filter_upwards [Lp.coeFn_add x (∑ k, c k • u k), coeFn_L1_smul_sum c u] with b hb hb' + simpa only [Pi.add_apply, hb', oldCombination] using hb + +end Normalize + +section WholeBallL1 +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] + +lemma productOperator_control {p r q h : ℝ} (hp : 1 < p) (hpmax : p ≤ 3/2) + (hr : 0 < r) (hq : 0 < q) (hh : 0 < h) + (hmq : (Fintype.card κ : ℝ) * q < 1) + (herr : (Fintype.card κ : ℝ) * q + h⁻¹ * + (2 * (Fintype.card κ : ℝ) * r + (1 - (Fintype.card κ : ℝ) * q)⁻¹ - 1) < h) + (hpq : 10 * (108 * scale p / r)^p < q) + (G : Submodule ℝ (Lp ℝ 1 μ)) (x : G) (u : κ → G) (hu : ∀ k, ‖u k‖ = 1) + (a : κ → ι → ℝ) (hg : ‖productOperator hp (fun k => (u k : Lp ℝ 1 μ)) (x,a)‖ ≤ 1) : + ∃ ψ : G, ‖ψ‖ ≤ 1 ∧ + measureDistance (μ.prod (arrayMeasure κ ι)) + (productOperator hp (fun k => (u k : Lp ℝ 1 μ)) (x,a)) (oldL1 (ψ : Lp ℝ 1 μ)) ≤ h := by + classical + have he := productOperator_ae hp (x : Lp ℝ 1 μ) (fun k => (u k : Lp ℝ 1 μ)) a + have hgn : (∫ z, |enlargedFunction p (x : Lp ℝ 1 μ) (fun k => (u k : Lp ℝ 1 μ)) a z| + ∂μ.prod (arrayMeasure κ ι)) ≤ 1 := (L1_norm_of_ae _ he) ▸ hg + obtain ⟨c, hc, htail⟩ := whole_ball_approximation hp hpmax hr hq hh hmq herr hpq + (L1.integrable_coeFn (x : Lp ℝ 1 μ)) (fun k => L1.integrable_coeFn (u k : Lp ℝ 1 μ)) + (fun k => by simpa only [Real.norm_eq_abs] using (L1.norm_eq_integral_norm (u k : Lp ℝ 1 μ)).symm.trans (hu k)) a hgn + let ψ : G := ⟨normalizeL1 ((x : Lp ℝ 1 μ) + ∑ k, c k • (u k : Lp ℝ 1 μ)), + normalizeL1_mem G (G.add_mem x.property (G.sum_mem (fun k _ => G.smul_mem _ (u k).property)))⟩ + refine ⟨ψ, normalizeL1_norm _, measureDistance_le_of_tail _ _ hh ?_⟩ + have hψ : (ψ : Lp ℝ 1 μ) =ᵐ[μ] + normalizeFunction μ (oldCombination (x : Lp ℝ 1 μ) (fun k => (u k : Lp ℝ 1 μ)) c) := + normalizeL1_ae _ (oldCombination_ae _ _ _) + have hψpull := (measurePreserving_fst (μ := μ) (ν := arrayMeasure κ ι)).quasiMeasurePreserving.ae_eq_comp hψ + have hevent : {z | h < |productOperator hp (fun k => (u k : Lp ℝ 1 μ)) (x,a) z - oldL1 (ν := arrayMeasure κ ι) (ψ : Lp ℝ 1 μ) z|} + =ᵐ[μ.prod (arrayMeasure κ ι)] {z | h < |enlargedFunction p (x : Lp ℝ 1 μ) (fun k => (u k : Lp ℝ 1 μ)) a z - + normalizeFunction μ (oldCombination (x : Lp ℝ 1 μ) (fun k => (u k : Lp ℝ 1 μ)) c) z.1|} := by + filter_upwards [he, oldL1_ae (ν := arrayMeasure κ ι) (ψ : Lp ℝ 1 μ), hψpull] with z hz hz' hψz + simp only [Function.comp_apply] at hψz + rw [hz, hz', hψz] + rw [measureReal_congr hevent] + exact htail + +end WholeBallL1 +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/ProductModels.lean b/lean/OAI/Analysis/Daugavet/ProductModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f08d404cb69df9b45ba707a7be927b14d3ce6b5 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/ProductModels.lean @@ -0,0 +1,111 @@ +import OAI.Analysis.Daugavet.HeavyTails + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uIota uKappa uBeta uAlpha uGamma + +namespace ExactModuli.KW + +section ProductModels + +abbrev cube (ι : Type uIota) := ι → unitInterval +abbrev cubeMeasure (ι : Type uIota) [Fintype ι] : Measure (cube ι) := + Measure.pi (fun _ => (volume : Measure unitInterval)) +abbrev pairCubeMeasure (ι : Type uIota) [Fintype ι] : Measure (ι → unitInterval × unitInterval) := + Measure.pi (fun _ => pairedMeasure) +abbrev arrayMeasure (κ : Type uKappa) (ι : Type uIota) [Fintype κ] [Fintype ι] : + Measure (κ → cube ι) := + Measure.pi (fun _ => cubeMeasure ι) +abbrev pairedArrayMeasure (κ : Type uKappa) (ι : Type uIota) [Fintype κ] [Fintype ι] : + Measure (κ → ι → unitInterval × unitInterval) := + Measure.pi (fun _ => pairCubeMeasure ι) + +lemma mp_integral {α : Type uAlpha} {β : Type uBeta} [MeasurableSpace α] [MeasurableSpace β] + {μ : Measure α} {ν : Measure β} {f : α → β} (hf : MeasurePreserving f μ ν) + {g : β → ℝ} (hg : AEStronglyMeasurable g ν) : + (∫ x, g (f x) ∂μ) = ∫ y, g y ∂ν := by + have hm : AEStronglyMeasurable g (μ.map f) := hf.map_eq.symm ▸ hg + exact (integral_map hf.aemeasurable hm).symm.trans (congrArg (fun P => ∫ y, g y ∂P) hf.map_eq) + +lemma mp_ident {α : Type uAlpha} {β : Type uBeta} {γ : Type uGamma} + [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] + {μ : Measure α} {ν : Measure β} {f : α → β} (hf : MeasurePreserving f μ ν) + {g : β → γ} (hg : Measurable g) : IdentDistrib (g ∘ f) g μ ν := by + refine ⟨(hg.comp hf.measurable).aemeasurable, hg.aemeasurable, ?_⟩ + rw [← Measure.map_map hg hf.measurable, hf.map_eq] + +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] + +def rowSum (p : ℝ) (a : ι → ℝ) (v : cube ι) : ℝ := ∑ j, a j * multiplier p (v j) + +def diffRowSum (p : ℝ) (a : ι → ℝ) (v : ι → unitInterval × unitInterval) : ℝ := + ∑ j, a j * difference p (v j) + +lemma measurable_rowSum (p : ℝ) (a : ι → ℝ) : Measurable (rowSum p a) := by + unfold rowSum + exact Finset.measurable_sum _ (fun j _ => measurable_const.mul ((measurable_multiplier p).comp (measurable_pi_apply j))) + +lemma measurable_diffRowSum (p : ℝ) (a : ι → ℝ) : Measurable (diffRowSum p a) := by + unfold diffRowSum + exact Finset.measurable_sum _ (fun j _ => measurable_const.mul ((measurable_difference p).comp (measurable_pi_apply j))) + +lemma integrable_rowSum {p : ℝ} (hp : 1 < p) (a : ι → ℝ) : + Integrable (rowSum p a) (cubeMeasure ι) := by + apply integrable_finsetSum + intro j _ + exact ((measurePreserving_eval (fun _ : ι => (volume : Measure unitInterval)) j).integrable_comp (integrable_multiplier hp).aestronglyMeasurable + |>.mpr (integrable_multiplier hp)).const_mul _ + +lemma integrable_diffRowSum {p : ℝ} (hp : 1 < p) (a : ι → ℝ) : + Integrable (diffRowSum p a) (pairCubeMeasure ι) := by + apply integrable_finsetSum + intro j _ + exact ((measurePreserving_eval (fun _ : ι => pairedMeasure) j).integrable_comp (integrable_difference hp).aestronglyMeasurable + |>.mpr (integrable_difference hp)).const_mul _ + +lemma diffRowSum_lower {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3/2) (a : ι → ℝ) : + coefficientNorm p a / 54 ≤ ∫ v, |diffRowSum p a v| ∂pairCubeMeasure ι := by + apply heavy_tail_lower (μ := pairCubeMeasure ι) (fun j v => difference p (v j)) + (fun j => (measurable_difference p).comp (measurable_pi_apply j)) + (iIndepFun_pi (fun _ => (measurable_difference p).aemeasurable)) hp hpmax + intro j + exact mp_ident (measurePreserving_eval (fun _ : ι => pairedMeasure) j) (measurable_difference p) + +lemma diffRowSum_tail {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3/2) (a : ι → ℝ) + {r : ℝ} (hr : 0 < r) : + (pairCubeMeasure ι).real {v | r < |diffRowSum p a v|} ≤ + 10 * (scale p * coefficientNorm p a / r) ^ p := by + apply heavy_tail_upper (μ := pairCubeMeasure ι) (fun j v => difference p (v j)) + (fun j => (measurable_difference p).comp (measurable_pi_apply j)) + (iIndepFun_pi (fun _ => (measurable_difference p).aemeasurable)) hp hpmax + (fun j => mp_ident (measurePreserving_eval (fun _ : ι => pairedMeasure) j) (measurable_difference p)) a hr + +/-- Select, independently at every row, one of each pair of resampled coordinates. -/ +def selectRows (b : κ → Bool) (v : κ → ι → unitInterval × unitInterval) : κ → cube ι := + fun k j => if b k then (v k j).2 else (v k j).1 + +lemma measurePreserving_selectRows (b : κ → Bool) : + MeasurePreserving (selectRows (ι := ι) b) (pairedArrayMeasure κ ι) (arrayMeasure κ ι) := by + unfold selectRows + apply measurePreserving_pi (fun _ : κ => pairCubeMeasure ι) (fun _ : κ => cubeMeasure ι) + (f := fun k v j => if b k then (v j).2 else (v j).1) + intro k + apply measurePreserving_pi (fun _ : ι => pairedMeasure) (fun _ : ι => (volume : Measure unitInterval)) + (f := fun _ v => if b k then v.2 else v.1) + intro j + by_cases hb : b k = true + · simpa [selectRows, hb] using (measurePreserving_snd : + MeasurePreserving Prod.snd pairedMeasure (volume : Measure unitInterval)) + · simpa [selectRows, hb] using (measurePreserving_fst : + MeasurePreserving Prod.fst pairedMeasure (volume : Measure unitInterval)) + +end ProductModels +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/ProductOperators.lean b/lean/OAI/Analysis/Daugavet/ProductOperators.lean new file mode 100644 index 0000000000000000000000000000000000000000..40e6ce10b85c298dd2350ada27277086243f3199 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/ProductOperators.lean @@ -0,0 +1,138 @@ +import OAI.Analysis.Daugavet.FiniteCoordinates + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uX uB uIota uKappa + +namespace ExactModuli.KW +section ProductAtoms +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] + +def arrayMultiplier (p : ℝ) (k : κ) (j : ι) (v : κ → cube ι) : ℝ := multiplier p (v k j) + +lemma array_coordinate_mp (k : κ) (j : ι) : + MeasurePreserving (fun v : κ → cube ι => v k j) (arrayMeasure κ ι) volume := + (measurePreserving_eval (fun _ : ι => (volume : Measure unitInterval)) j).comp + (measurePreserving_eval (fun _ : κ => cubeMeasure ι) k) + +lemma integrable_arrayMultiplier {p : ℝ} (hp : 1 < p) (k : κ) (j : ι) : + Integrable (arrayMultiplier p k j) (arrayMeasure κ ι) := + ((array_coordinate_mp k j).integrable_comp (integrable_multiplier hp).aestronglyMeasurable).mpr + (integrable_multiplier hp) + +lemma integral_arrayMultiplier {p : ℝ} (hp : 1 < p) (k : κ) (j : ι) : + (∫ v, arrayMultiplier p k j v ∂arrayMeasure κ ι) = 1 := + (mp_integral (array_coordinate_mp k j) (integrable_multiplier hp).aestronglyMeasurable).trans + (integral_multiplier hp) + +omit [Fintype κ] [Fintype ι] in +lemma measurable_arrayMultiplier [Fintype κ] [Fintype ι] (p : ℝ) (k : κ) (j : ι) : + Measurable (arrayMultiplier p k j) := + (measurable_multiplier p).comp (by fun_prop) + +lemma arrayMultiplier_tail {p c : ℝ} (hp : 1 < p) (hc : scale p ≤ c) (k : κ) (j : ι) : + (arrayMeasure κ ι).real {v | c < arrayMultiplier p k j v} = (scale p / c)^p := by + have he := (array_coordinate_mp k j).measureReal_preimage + (measurableSet_lt (measurable_const (a := c)) (measurable_multiplier p)).nullMeasurableSet + exact he.trans (multiplier_tail hp hc) + +def atomL1 {p : ℝ} (hp : 1 < p) (u : Lp ℝ 1 μ) (k : κ) (j : ι) : + Lp ℝ 1 (μ.prod (arrayMeasure κ ι)) := + integrableL1 (fun z => u z.1 * arrayMultiplier p k j z.2) + ((L1.integrable_coeFn u).mul_prod (integrable_arrayMultiplier hp k j)) + +omit [IsProbabilityMeasure μ] in +lemma atomL1_ae [IsProbabilityMeasure μ] {p : ℝ} (hp : 1 < p) + (u : Lp ℝ 1 μ) (k : κ) (j : ι) : + atomL1 hp u k j =ᵐ[μ.prod (arrayMeasure κ ι)] + fun z => u z.1 * arrayMultiplier p k j z.2 := integrableL1_ae _ _ + +lemma norm_atomL1 {p : ℝ} (hp : 1 < p) (u : Lp ℝ 1 μ) (k : κ) (j : ι) : + ‖atomL1 hp u k j‖ = ‖u‖ := by + rw [L1_norm_of_ae _ (atomL1_ae hp u k j)] + simp only [abs_mul, arrayMultiplier, abs_of_nonneg (multiplier_nonneg hp _) ] + change (∫ z : B × (κ → cube ι), |u z.1| * arrayMultiplier p k j z.2 ∂μ.prod (arrayMeasure κ ι)) = ‖u‖ + rw [integral_prod_mul (fun b => |u b|) (arrayMultiplier p k j), integral_arrayMultiplier hp, + mul_one, L1.norm_eq_integral_norm] + rfl + +lemma atomL1_near_additive {p c h : ℝ} (hp : 1 < p) (hc : 0 ≤ c) (hpc : scale p ≤ c) + (herr : 2 * ((scale p / c)^p + c) < h) {w u : Lp ℝ 1 μ} + (hw : ‖w‖ = 1) (hu : ‖u‖ = 1) (k : κ) (j : ι) : + 2 - h ≤ ‖oldL1 w + atomL1 hp u k j‖ := by + have hn := near_additivity (L1.integrable_coeFn w) (L1.integrable_coeFn u) + (integrable_arrayMultiplier hp k j) (measurable_arrayMultiplier p k j) + (fun _ => multiplier_nonneg hp _) (by simpa only [Real.norm_eq_abs] using (L1.norm_eq_integral_norm w).symm.trans hw) + (by simpa only [Real.norm_eq_abs] using (L1.norm_eq_integral_norm u).symm.trans hu) + (integral_arrayMultiplier hp k j) hc + rw [arrayMultiplier_tail hp hpc k j] at hn + have hae : (oldL1 w + atomL1 hp u k j : Lp ℝ 1 (μ.prod (arrayMeasure κ ι))) =ᵐ[μ.prod (arrayMeasure κ ι)] + fun z => w z.1 + u z.1 * arrayMultiplier p k j z.2 := by + filter_upwards [Lp.coeFn_add (oldL1 w) (atomL1 hp u k j), oldL1_ae w, atomL1_ae hp u k j] with z h₁ h₂ h₃ + simpa only [Pi.add_apply, h₂, h₃] using h₁ + rw [L1_norm_of_ae _ hae] + linarith + +end ProductAtoms + +section LinearCombinations +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] + +def matrixCombination (v : κ → ι → X) : (κ → ι → ℝ) →ₗ[ℝ] X where + toFun a := ∑ k, ∑ j, a k j • v k j + map_add' a b := by simp only [Pi.add_apply, add_smul, Finset.sum_add_distrib] + map_smul' c a := by simp only [Pi.smul_apply, smul_eq_mul, mul_smul, Finset.smul_sum, RingHom.id_apply] + +end LinearCombinations + +section ProductOperator +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] + +def productOperator {p : ℝ} (hp : 1 < p) (u : κ → Lp ℝ 1 μ) : + (Lp ℝ 1 μ × (κ → ι → ℝ)) →ₗ[ℝ] Lp ℝ 1 (μ.prod (arrayMeasure κ ι)) := + oldL1.toLinearMap.coprod (matrixCombination (fun k j => atomL1 hp (u k) k j)) + +lemma productOperator_ae {p : ℝ} (hp : 1 < p) (x : Lp ℝ 1 μ) (u : κ → Lp ℝ 1 μ) (a : κ → ι → ℝ) : + productOperator hp u (x,a) =ᵐ[μ.prod (arrayMeasure κ ι)] + enlargedFunction p x (fun k => (u k : B → ℝ)) a := by + have hrows (k : κ) : (∑ j, a k j • atomL1 hp (u k) k j : Lp ℝ 1 (μ.prod (arrayMeasure κ ι))) + =ᵐ[μ.prod (arrayMeasure κ ι)] fun z => u k z.1 * rowSum p (a k) (z.2 k) := by + filter_upwards [coeFn_L1_smul_sum (a k) (fun j => atomL1 hp (u k) k j), + ae_all_iff.mpr (fun j => atomL1_ae hp (u k) k j)] with z hz hzj + rw [hz] + simp only [rowSum, Finset.mul_sum] + apply Finset.sum_congr rfl + intro j _ + rw [hzj j] + dsimp [arrayMultiplier] + ring + filter_upwards [Lp.coeFn_add (oldL1 x) (matrixCombination (fun k j => atomL1 hp (u k) k j) a), + oldL1_ae x, coeFn_L1_sum Finset.univ (fun k => ∑ j, a k j • atomL1 hp (u k) k j), + ae_all_iff.mpr hrows] with z hz hzx hzs hzrow + change (oldL1 x + matrixCombination (fun k j => atomL1 hp (u k) k j) a : Lp ℝ 1 (μ.prod (arrayMeasure κ ι))) z = _ + rw [hz] + simp only [Pi.add_apply, hzx, enlargedFunction] + congr 1 + change (∑ k, ∑ j, a k j • atomL1 hp (u k) k j : Lp ℝ 1 (μ.prod (arrayMeasure κ ι))) z = _ + rw [hzs] + exact Finset.sum_congr rfl (fun k _ => hzrow k) + +omit [IsProbabilityMeasure μ] in +lemma productOperator_zero_coeff [IsProbabilityMeasure μ] {p : ℝ} (hp : 1 < p) + (u : κ → Lp ℝ 1 μ) (x : Lp ℝ 1 μ) : + productOperator (ι := ι) hp u (x,0) = oldL1 x := by + simp [productOperator, matrixCombination] + +end ProductOperator +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/ProductSeparation.lean b/lean/OAI/Analysis/Daugavet/ProductSeparation.lean new file mode 100644 index 0000000000000000000000000000000000000000..964d4fd0aefcddd3c733e37bf3b450ba5adac815 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/ProductSeparation.lean @@ -0,0 +1,180 @@ +import OAI.Analysis.Daugavet.WholeBallCoefficients + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uB uR uIota uKappa + +namespace ExactModuli.KW + +section ProductModels +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] + +/-- Near-disjointness from every old unit vector, using only the new scalar tail. -/ +lemma near_additivity {R : Type uR} [MeasurableSpace R] {ν : Measure R} + [IsProbabilityMeasure ν] {w u : B → ℝ} {f : R → ℝ} + (hw : Integrable w μ) (hu : Integrable u μ) (hf : Integrable f ν) + (hfm : Measurable f) (hf0 : ∀ v, 0 ≤ f v) + (hw1 : ∫ b, |w b| ∂μ = 1) (hu1 : ∫ b, |u b| ∂μ = 1) + (hf1 : ∫ v, f v ∂ν = 1) {c : ℝ} (hc : 0 ≤ c) : + 2 - 2 * (ν.real {v | c < f v} + c) ≤ + ∫ z : B × R, |w z.1 + u z.1 * f z.2| ∂(μ.prod ν) := by + let S := {v | c < f v} + have hS : MeasurableSet S := measurableSet_lt measurable_const hfm + let W : B × R → ℝ := fun z => w z.1 + let V : B × R → ℝ := fun z => u z.1 * f z.2 + let A : B × R → ℝ := fun z => |w z.1| * S.indicator (1 : R → ℝ) z.2 + let C : B × R → ℝ := fun z => c * |u z.1| + have hW : Integrable W (μ.prod ν) := (measurePreserving_fst.integrable_comp hw.aestronglyMeasurable).mpr hw + have hV : Integrable V (μ.prod ν) := hu.mul_prod hf + have hA : Integrable A (μ.prod ν) := hw.abs.mul_prod ((integrable_const 1).indicator hS) + have hC : Integrable C (μ.prod ν) := + ((measurePreserving_fst.integrable_comp hu.abs.aestronglyMeasurable).mpr hu.abs).const_mul c + have hpoint (z : B × R) : |W z| + |V z| - 2 * (A z + C z) ≤ |W z + V z| := by + apply le_trans _ (abs_add_lower _ _) + have hmin : min |W z| |V z| ≤ A z + C z := by + by_cases hz : z.2 ∈ S + · simp only [A, Set.indicator_of_mem hz, Pi.one_apply, mul_one, C] + exact (min_le_left _ _).trans (le_add_of_nonneg_right (mul_nonneg hc (abs_nonneg _))) + · have hfz : f z.2 ≤ c := le_of_not_gt hz + simp only [A, Set.indicator_of_notMem hz, mul_zero, zero_add, C] + apply (min_le_right _ _).trans + dsimp [V] + rw [abs_mul, abs_of_nonneg (hf0 _), mul_comm c] + exact mul_le_mul_of_nonneg_left hfz (abs_nonneg _) + linarith + have hineq := integral_mono ((hW.abs.add hV.abs).sub ((hA.add hC).const_mul 2)) + (hW.add hV).abs hpoint + have hWi : (∫ z, |W z| ∂(μ.prod ν)) = 1 := + (mp_integral measurePreserving_fst hw.abs.aestronglyMeasurable).trans hw1 + have hVi : (∫ z, |V z| ∂(μ.prod ν)) = 1 := by + simp only [V, abs_mul, abs_of_nonneg (hf0 _)] + rw [integral_prod_mul (fun b => |u b|) f, hu1, hf1, one_mul] + have hAi : (∫ z, A z ∂(μ.prod ν)) = ν.real S := by + rw [show A = (fun z : B × R => |w z.1| * S.indicator (1 : R → ℝ) z.2) from rfl, + integral_prod_mul (fun b => |w b|) (S.indicator (1 : R → ℝ)), hw1, one_mul, integral_indicator_one hS] + have hCi : (∫ z, C z ∂(μ.prod ν)) = c := by + dsimp [C] + rw [integral_const_mul, mp_integral measurePreserving_fst hu.abs.aestronglyMeasurable, hu1, mul_one] + simp only [Pi.sub_apply, Pi.add_apply] at hineq + rw [integral_sub (f := fun z => |W z| + |V z|) (g := fun z => 2 * (A z + C z)) (hW.abs.add hV.abs) ((hA.add hC).const_mul 2), + integral_add hW.abs hV.abs, integral_const_mul, integral_add hA hC, hWi, hVi, hAi, hCi] at hineq + simpa only [W, V, S, show (1 : ℝ) + 1 = 2 by norm_num] using hineq + +/-- Radial retraction to the old L1 unit ball, pointwise on representatives. -/ +def normalizeFunction (μ : Measure B) (f : B → ℝ) (b : B) : ℝ := + f b / max 1 (∫ b, |f b| ∂μ) + +omit [IsProbabilityMeasure μ] in +lemma integrable_normalizeFunction [IsProbabilityMeasure μ] + {f : B → ℝ} (hf : Integrable f μ) : + Integrable (normalizeFunction μ f) μ := hf.div_const _ + +omit [IsProbabilityMeasure μ] in +lemma normalizeFunction_bounds [IsProbabilityMeasure μ] + {f : B → ℝ} (_hf : Integrable f μ) {R : ℝ} + (hR : 1 ≤ R) (hN : (∫ b, |f b| ∂μ) ≤ R) : + (∫ b, |normalizeFunction μ f b| ∂μ) ≤ 1 ∧ + (∫ b, |f b - normalizeFunction μ f b| ∂μ) ≤ R - 1 := by + let N := ∫ b, |f b| ∂μ + have hN0 : 0 ≤ N := integral_nonneg (fun b => abs_nonneg _) + by_cases hN1 : N ≤ 1 + · have heq : normalizeFunction μ f = f := by + funext b + change f b / max 1 N = f b + rw [max_eq_left hN1, div_one] + rw [heq] + constructor + · exact hN1 + · simp only [sub_self, abs_zero, integral_zero] + linarith + · have hNpos : 0 < N := by linarith + have hNgt : 1 < N := lt_of_not_ge hN1 + have heq : normalizeFunction μ f = fun b => f b / N := by + funext b + change f b / max 1 N = f b / N + rw [max_eq_right hNgt.le] + rw [heq] + constructor + · simp only [abs_div, abs_of_pos hNpos] + rw [integral_div] + change N / N ≤ 1 + simp [hNpos.ne'] + · have hpoint (b : B) : |f b - f b / N| = ((N - 1) / N) * |f b| := by + have he : f b - f b / N = ((N - 1) / N) * f b := by field_simp + rw [he, abs_mul, abs_of_nonneg (div_nonneg (sub_nonneg.mpr hNgt.le) hNpos.le)] + simp_rw [hpoint] + rw [integral_const_mul] + change (N - 1) / N * N ≤ R - 1 + rw [div_mul_cancel₀ _ hNpos.ne'] + exact sub_le_sub_right hN 1 + +/-- Markov's inequality after discarding a small exceptional set. -/ +lemma restricted_markov {R : Type uR} [MeasurableSpace R] {ν : Measure R} + [IsFiniteMeasure ν] {f b : R → ℝ} (hf : Integrable f ν) (hb : Integrable b ν) + (hf0 : ∀ v, 0 ≤ f v) (hb0 : ∀ v, 0 ≤ b v) + {D : Set R} (hD : MeasurableSet D) (hdom : ∀ v ∈ D, f v ≤ b v) + {h : ℝ} (hh : 0 < h) : + ν.real {v | h < f v} ≤ ν.real Dᶜ + (∫ v, b v ∂ν) / h := by + classical + let T := D.indicator f + have hT : Integrable T ν := hf.indicator hD + have hT0 : ∀ v, 0 ≤ T v := fun v => Set.indicator_nonneg (fun v _ => hf0 v) v + have hTb (v : R) : T v ≤ b v := by + by_cases hv : v ∈ D + · simpa only [T, Set.indicator_of_mem hv] using hdom v hv + · simpa only [T, Set.indicator_of_notMem hv] using hb0 v + have hbound := (mul_meas_ge_le_integral_of_nonneg (ae_of_all _ hT0) hT h).trans + (integral_mono hT hb hTb) + have hprob : ν.real {v | h ≤ T v} ≤ (∫ v, b v ∂ν) / h := by + apply (le_div_iff₀ hh).mpr + simpa only [mul_comm] using hbound + have hsub : {v | h < f v} ⊆ Dᶜ ∪ {v | h ≤ T v} := by + intro v hv + change h < f v at hv + by_cases hvD : v ∈ D + · exact Or.inr (by simpa only [Set.mem_ofPred_eq, T, Set.indicator_of_mem hvD] using hv.le) + · exact Or.inl hvD + exact (measureReal_mono (μ := ν) hsub).trans + ((measureReal_union_le _ _).trans (add_le_add le_rfl hprob)) + +/-- Fubini on the good event controls the old approximant before normalization. -/ +lemma old_norm_on_good_set {R : Type uR} [MeasurableSpace R] {ν : Measure R} + [IsProbabilityMeasure ν] {g : B × R → ℝ} {ψ U : B → ℝ} + (hg : Integrable g (μ.prod ν)) (hψ : Integrable ψ μ) (hU : Integrable U μ) + (_hU0 : ∀ b, 0 ≤ U b) {m r : ℝ} (hm : ∫ b, U b ∂μ = m) (_hr : 0 ≤ r) + (hg1 : ∫ z, |g z| ∂(μ.prod ν) ≤ 1) + {D : Set R} (hD : MeasurableSet D) (hDpos : 0 < ν.real D) + (hgood : ∀ b v, v ∈ D → |g (b, v) - ψ b| ≤ r * U b) : + (∫ b, |ψ b| ∂μ) ≤ r * m + 1 / ν.real D := by + let J := D.indicator (1 : R → ℝ) + have hJ : Integrable J ν := (integrable_const 1).indicator hD + have hA : Integrable (fun z : B × R => |ψ z.1| * J z.2) (μ.prod ν) := hψ.abs.mul_prod hJ + have hC : Integrable (fun z : B × R => (r * U z.1) * J z.2) (μ.prod ν) := (hU.const_mul r).mul_prod hJ + have hpoint (z : B × R) : |ψ z.1| * J z.2 ≤ |g z| + (r * U z.1) * J z.2 := by + by_cases hz : z.2 ∈ D + · simp only [J, Set.indicator_of_mem hz, Pi.one_apply, mul_one] + have ht : |ψ z.1| ≤ |g z| + |g z - ψ z.1| := by + simpa only [Real.norm_eq_abs, sub_sub_cancel] using norm_sub_le (g z) (g z - ψ z.1) + exact ht.trans (add_le_add le_rfl (hgood z.1 z.2 hz)) + · simp only [J, Set.indicator_of_notMem hz, mul_zero, add_zero] + exact abs_nonneg _ + have hineq := integral_mono hA (hg.abs.add hC) hpoint + simp only [Pi.add_apply] at hineq + rw [integral_prod_mul (fun b => |ψ b|) J, integral_add hg.abs hC, + integral_prod_mul (fun b => r * U b) J, integral_const_mul, hm, + show (∫ v, J v ∂ν) = ν.real D from integral_indicator_one hD] at hineq + have hlin : ((∫ b, |ψ b| ∂μ) - r * m) * ν.real D ≤ 1 := by nlinarith + have hdiv := (le_div_iff₀ hDpos).mpr hlin + linarith + +end ProductModels +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Recovery.lean b/lean/OAI/Analysis/Daugavet/Recovery.lean new file mode 100644 index 0000000000000000000000000000000000000000..60f8841c3d8332cc3a4f7fed67eccbbdead92abe --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Recovery.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.Daugavet.WholeBallConcentration + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uIota + +namespace ExactModuli.KW + +abbrev infiniteCube := ℕ → unitInterval +abbrev infiniteCubeMeasure : Measure infiniteCube := + Measure.infinitePi (fun _ : ℕ => (volume : Measure unitInterval)) + +lemma infinite_coordinate_mp (i : ℕ) : + MeasurePreserving (fun ω : infiniteCube => ω i) infiniteCubeMeasure volume := + ⟨measurable_pi_apply i, Measure.infinitePi_map_eval _ i⟩ + +lemma finite_coordinates_mp {ι : Type uIota} [Fintype ι] (c : ι → ℕ) (hc : Function.Injective c) : + MeasurePreserving (fun ω : infiniteCube => fun i => ω (c i)) infiniteCubeMeasure (cubeMeasure ι) := by + refine ⟨by fun_prop, ?_⟩ + rw [Measure.map_infinitePi_infinitePi_of_inj hc, Measure.infinitePi_eq_pi] + +/-- The number of copies can be chosen arbitrarily late, after the whole-ball parameters. + This is Mathlib's L1 strong law, applied to the exact Pareto multiplier. -/ +lemma multiplier_averages {p h : ℝ} (hp : 1 < p) (hh : 0 < h) : + ∃ n : ℕ, 0 < n ∧ + (∫ v : cube (Fin n), |(n : ℝ)⁻¹ * (∑ j, multiplier p (v j)) - 1| + ∂cubeMeasure (Fin n)) < h := by + let X : ℕ → infiniteCube → ℝ := fun i ω => multiplier p (ω i) + have hXi (i : ℕ) : Integrable (X i) infiniteCubeMeasure := + ((infinite_coordinate_mp i).integrable_comp (integrable_multiplier hp).aestronglyMeasurable).mpr + (integrable_multiplier hp) + have hdist (i : ℕ) : IdentDistrib (X i) (multiplier p) infiniteCubeMeasure volume := + mp_ident (infinite_coordinate_mp i) (measurable_multiplier p) + have hind : iIndepFun X infiniteCubeMeasure := iIndepFun_infinitePi (fun _ => measurable_multiplier p) + have hmean : (∫ ω, X 0 ω ∂infiniteCubeMeasure) = 1 := + (hdist 0).integral_eq.trans (integral_multiplier hp) + have hLLN := strong_law_Lp (by norm_num : (1 : ℝ≥0∞) ≤ 1) (by norm_num : (1 : ℝ≥0∞) ≠ ∞) + X (memLp_one_iff_integrable.mpr (hXi 0)) (fun i j hij => hind.indepFun hij) (fun i => (hdist i).trans (hdist 0).symm) + have hreal := (ENNReal.tendsto_toReal (by norm_num : (0 : ℝ≥0∞) ≠ ∞)).comp hLLN + simp only [ENNReal.toReal_zero, hmean, smul_eq_mul] at hreal + have havg (n : ℕ) : Integrable + (fun ω => (n : ℝ)⁻¹ * (∑ i ∈ Finset.range n, X i ω) - 1) infiniteCubeMeasure := + ((integrable_finsetSum _ (fun i _ => hXi i)).const_mul _).sub (integrable_const 1) + have hevent : ∀ᶠ n : ℕ in atTop, + (∫ ω, |(n : ℝ)⁻¹ * (∑ i ∈ Finset.range n, X i ω) - 1| ∂infiniteCubeMeasure) < h := by + convert hreal.eventually (Iio_mem_nhds hh) using 1 + ext n + simp only [Function.comp_apply] + rw [eLpNorm_one_eq_lintegral_enorm (havg n).aestronglyMeasurable, + ← integral_norm_eq_lintegral_enorm (havg n).aestronglyMeasurable] + rfl + obtain ⟨n, hn, hn'⟩ := ((eventually_gt_atTop 0).and hevent).exists + refine ⟨n, hn, ?_⟩ + have hmp := finite_coordinates_mp (fun j : Fin n => (j : ℕ)) Fin.val_injective + have heq := mp_integral hmp + (((integrable_rowSum hp (fun _ : Fin n => 1)).const_mul (n : ℝ)⁻¹).sub (integrable_const 1)).abs.aestronglyMeasurable + simp only [rowSum, one_mul, Pi.sub_apply] at heq + rw [← heq] + have hefin (ω : infiniteCube) : (∑ j : Fin n, multiplier p (ω j)) = + ∑ i ∈ Finset.range n, X i ω := Fin.sum_univ_eq_sum_range (fun j => multiplier p (ω j)) n + simp only [hefin] + exact hn' + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/SignAverages.lean b/lean/OAI/Analysis/Daugavet/SignAverages.lean new file mode 100644 index 0000000000000000000000000000000000000000..9da783583a7db70aacdb644db8af2fcf3403d93e --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/SignAverages.lean @@ -0,0 +1,202 @@ +import OAI.Analysis.Daugavet.TailEstimates + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe u_1 uIota + +namespace ExactModuli.KW + +section Signs +variable {ι : Type uIota} [Fintype ι] + +def signSum (ε : ι → Bool) (b : ι → ℝ) : ℝ := + ∑ j, if ε j then b j else -b j + +def signAverage (b : ι → ℝ) : ℝ := by + classical + exact (∑ ε : ι → Bool, |signSum ε b|) / Fintype.card (ι → Bool) + +lemma norm_le_signAverage (b : ι → ℝ) : ‖b‖ ≤ signAverage b := by + classical + have hcard : 0 < (Fintype.card (ι → Bool) : ℝ) := by exact_mod_cast Fintype.card_pos + have havg : 0 ≤ signAverage b := div_nonneg (Finset.sum_nonneg (fun _ _ => abs_nonneg _)) hcard.le + apply (pi_norm_le_iff_of_nonneg havg).mpr + intro j + let flipFn := fun ε : ι → Bool => Function.update ε j (!(ε j)) + have hinvol : Function.Involutive flipFn := by + intro ε + funext i + by_cases hij : i = j + · subst i; simp [flipFn] + · simp [flipFn, Function.update_of_ne hij] + let flip : (ι → Bool) ≃ (ι → Bool) := ⟨flipFn, flipFn, hinvol, hinvol⟩ + have hdiff : ∀ ε, signSum ε b - signSum (flip ε) b = 2 * (if ε j then b j else -b j) := by + intro ε + unfold signSum + rw [← Finset.sum_sub_distrib, Finset.sum_eq_single j] + · change (if ε j then b j else -b j) - (if flipFn ε j then b j else -b j) = _ + cases h : ε j <;> simp [flipFn, h] <;> ring + · intro i hi hij + change (if ε i then b i else -b i) - (if flipFn ε i then b i else -b i) = 0 + simp [flipFn, Function.update_of_ne hij] + · simp + have hpair : ∀ ε, 2 * |b j| ≤ |signSum ε b| + |signSum (flip ε) b| := by + intro ε + have he : |signSum ε b - signSum (flip ε) b| = 2 * |b j| := by + rw [hdiff ε, abs_mul] + cases ε j <;> simp + rw [← he] + simpa only [Real.norm_eq_abs] using norm_sub_le (signSum ε b) (signSum (flip ε) b) + have hs := Finset.sum_le_sum (s := Finset.univ) (fun ε _ => hpair ε) + rw [Finset.sum_add_distrib, flip.sum_comp (fun ε => |signSum ε b|)] at hs + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] at hs + change |b j| ≤ (∑ ε, |signSum ε b|) / (Fintype.card (ι → Bool) : ℝ) + apply (le_div_iff₀ hcard).mpr + nlinarith + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +omit [IsProbabilityMeasure μ] in +lemma signSum_identDistrib [IsProbabilityMeasure μ] + (X : ι → Ω → ℝ) (hX : ∀ j, Measurable (X j)) + (hind : iIndepFun X μ) (hsym : ∀ j, IdentDistrib (X j) (fun ω => -X j ω) μ μ) + (ε : ι → Bool) : + IdentDistrib (fun ω => signSum ε (fun j => X j ω)) (fun ω => ∑ j, X j ω) μ μ := by + let g := fun j (x : ℝ) => if ε j then x else -x + have hg : ∀ j, Measurable (g j) := by + intro j; dsimp [g]; cases ε j <;> simp only [Bool.false_eq_true, ite_false, ite_true] <;> fun_prop + have hdist : ∀ j, IdentDistrib (g j ∘ X j) (X j) μ μ := by + intro j + cases h : ε j + · simpa only [g, h, Bool.false_eq_true, ite_false, Function.comp_def] using (hsym j).symm + · simpa only [g, h, ite_true, Function.comp_def] using IdentDistrib.refl (hX j).aemeasurable + exact (IdentDistrib.pi hdist (hind.comp g hg) hind).comp + (show Measurable (fun b : ι → ℝ => ∑ j, b j) by fun_prop) + +lemma expected_max_le_expected_abs_sum (X : ι → Ω → ℝ) (hX : ∀ j, Measurable (X j)) + (hi : ∀ j, Integrable (X j) μ) (hind : iIndepFun X μ) + (hsym : ∀ j, IdentDistrib (X j) (fun ω => -X j ω) μ μ) : + ∫ ω, ‖fun j => X j ω‖ ∂μ ≤ ∫ ω, |∑ j, X j ω| ∂μ := by + classical + have hcard : 0 < (Fintype.card (ι → Bool) : ℝ) := by exact_mod_cast Fintype.card_pos + have hsumI : Integrable (fun ω => ∑ j, X j ω) μ := integrable_finsetSum _ (fun j _ => hi j) + have hsignI : ∀ ε : ι → Bool, Integrable (fun ω => |signSum ε (fun j => X j ω)|) μ := by + intro ε + exact ((signSum_identDistrib X hX hind hsym ε).integrable_iff.mpr hsumI).abs + have hmean : (∫ ω, signAverage (fun j => X j ω) ∂μ) = ∫ ω, |∑ j, X j ω| ∂μ := by + unfold signAverage + rw [integral_div, integral_finsetSum _ (fun ε _ => hsignI ε)] + have heq : ∀ ε : ι → Bool, (∫ ω, |signSum ε (fun j => X j ω)| ∂μ) = + ∫ ω, |∑ j, X j ω| ∂μ := by + intro ε + simpa only [Real.norm_eq_abs] using (signSum_identDistrib X hX hind hsym ε).norm.integral_eq + simp_rw [heq] + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] + field_simp + rw [← hmean] + exact integral_mono (integrable_pi_iff.mpr hi).norm + ((integrable_finsetSum _ (fun ε _ => hsignI ε)).div_const _) + (fun ω => norm_le_signAverage (fun j => X j ω)) + +lemma one_sub_exp_neg_ge_half {v : ℝ} (hv : 0 ≤ v) (hv1 : v ≤ 1) : + v / 2 ≤ 1 - Real.exp (-v) := by + rw [Real.exp_neg] + have hb : 1 / Real.exp v ≤ 1 - v / 2 := by + apply (div_le_iff₀ (Real.exp_pos v)).mpr + have hm := mul_le_mul_of_nonneg_left (Real.add_one_le_exp v) + (show 0 ≤ 1 - v / 2 by linarith) + nlinarith + rw [one_div] at hb + linarith + +lemma independent_max_tail_lower (X : ι → Ω → ℝ) (hX : ∀ j, Measurable (X j)) + (hind : iIndepFun X μ) {u : ℝ} (hu : 0 ≤ u) (b : ι → ℝ) + (hb : ∀ j, 0 ≤ b j) (hb1 : ∑ j, b j ≤ 1) + (htail : ∀ j, b j ≤ μ.real {ω | u < |X j ω|}) : + (∑ j, b j) / 2 ≤ μ.real {ω | u < ‖fun j => X j ω‖} := by + classical + have hpi : μ.real {ω | ‖fun j => X j ω‖ ≤ u} = + ∏ j, μ.real {ω | |X j ω| ≤ u} := by + have h := hind.measure_inter_preimage_eq_mul Finset.univ + (sets := fun _ => {x : ℝ | |x| ≤ u}) + (fun _ _ => measurableSet_le measurable_abs measurable_const) + have hset : {ω | ‖fun j => X j ω‖ ≤ u} = + ⋂ j ∈ (Finset.univ : Finset ι), X j ⁻¹' {x : ℝ | |x| ≤ u} := by + ext ω + simp only [Finset.mem_univ, iInter_true, mem_ofPred_eq, mem_iInter, mem_preimage] + simpa only [Real.norm_eq_abs] using pi_norm_le_iff_of_nonneg (x := fun j => X j ω) hu + rw [measureReal_def, hset, h, ENNReal.toReal_prod] + rfl + have hcomp : ∀ j, μ.real {ω | |X j ω| ≤ u} = 1 - μ.real {ω | u < |X j ω|} := by + intro j + have hset : {ω | |X j ω| ≤ u} = {ω | u < |X j ω|}ᶜ := by ext ω; simp + rw [hset, measureReal_compl (measurableSet_lt measurable_const (hX j).abs)] + simp + have hallcomp : μ.real {ω | u < ‖fun j => X j ω‖} = 1 - + μ.real {ω | ‖fun j => X j ω‖ ≤ u} := by + have hset : {ω | u < ‖fun j => X j ω‖} = {ω | ‖fun j => X j ω‖ ≤ u}ᶜ := by ext ω; simp + rw [hset, measureReal_compl (measurableSet_le + (Measurable.of_eval hX).norm measurable_const)] + simp + have hprod : (∏ j, μ.real {ω | |X j ω| ≤ u}) ≤ Real.exp (-(∑ j, b j)) := by + calc + _ ≤ ∏ j, Real.exp (-b j) := by + apply Finset.prod_le_prod₀ (fun _ _ => measureReal_nonneg) + intro j hj + rw [hcomp] + have he := Real.add_one_le_exp (-b j) + have ht := htail j + linarith + _ = _ := by rw [← Real.exp_sum, Finset.sum_neg_distrib] + rw [hallcomp, hpi] + exact (one_sub_exp_neg_ge_half (Finset.sum_nonneg (fun j _ => hb j)) hb1).trans + (sub_le_sub_left hprod 1) + +lemma integrable_real_tail {X : Ω → ℝ} (hX : Integrable X μ) (hX0 : 0 ≤ᵐ[μ] X) : + IntegrableOn (fun t : ℝ => μ.real {ω | t < X ω}) (Ioi 0) volume := by + refine ⟨(measurable_real_tail X).aestronglyMeasurable, + (hasFiniteIntegral_iff_ofReal (ae_of_all _ (fun _ => measureReal_nonneg))).mpr ?_⟩ + have heq : (∫⁻ t in Ioi (0:ℝ), ENNReal.ofReal (μ.real {ω | t < X ω})) = + ∫⁻ t in Ioi (0:ℝ), μ {ω | t < X ω} := by + apply lintegral_congr + intro t + exact ENNReal.ofReal_toReal (measure_ne_top _ _) + rw [heq, ← lintegral_eq_lintegral_meas_lt μ hX0 hX.aemeasurable] + exact hX.lintegral_lt_top + +lemma expectation_lower_from_power_tail {X : Ω → ℝ} (hX : Integrable X μ) + (hX0 : 0 ≤ᵐ[μ] X) {p c d : ℝ} (hp : 1 < p) (hc : 0 ≤ c) (hd : 0 < d) + (htail : ∀ t, d ≤ t → c * t ^ (-p) ≤ μ.real {ω | t < X ω}) : + c * d ^ (1 - p) / (p - 1) ≤ ∫ ω, X ω ∂μ := by + have hi := integrable_real_tail hX hX0 + have hsub : Ioi d ⊆ Ioi (0:ℝ) := Ioi_subset_Ioi hd.le + have hinonneg : ∀ᵐ t ∂volume.restrict (Ioi (0:ℝ)), 0 ≤ μ.real {ω | t < X ω} := + ae_of_all _ (fun _ => measureReal_nonneg) + rw [hX.integral_eq_integral_meas_lt hX0] + calc + _ = ∫ t in Ioi d, c * t ^ (-p) := by + rw [integral_const_mul, integral_Ioi_rpow_of_lt (by linarith) hd] + have he : -p + 1 = 1 - p := by ring + rw [he] + field_simp [show p - 1 ≠ 0 by linarith, show 1 - p ≠ 0 by linarith] + ring + _ ≤ ∫ t in Ioi d, μ.real {ω | t < X ω} := by + apply integral_mono_of_nonneg + · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + exact mul_nonneg hc (Real.rpow_nonneg (hd.trans ht).le _) + · exact hi.mono_set hsub + · filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + exact htail t ht.le + _ ≤ _ := setIntegral_mono_set hi hinonneg (ae_of_all _ (fun t ht => hsub ht)) + +end Signs + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/SliceCharacterization.lean b/lean/OAI/Analysis/Daugavet/SliceCharacterization.lean new file mode 100644 index 0000000000000000000000000000000000000000..a740545fd7a05d995505e93f42256a7d3ec673e7 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/SliceCharacterization.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.Daugavet.ExactModuli + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma normalized_functional_slice_nonempty (ell : X →L[ℝ] ℝ) (hell : ‖ell‖ = 1) + {η : ℝ} (hη : 0 < η) : ∃ y : X, ‖y‖ ≤ 1 ∧ 1 - η < ell y := by + obtain ⟨u, hu, hval⟩ := ell.exists_lt_apply_of_lt_opNorm + (show 1 - η < ‖ell‖ by rw [hell]; linarith) + rw [Real.norm_eq_abs] at hval + by_cases hs : 0 ≤ ell u + · exact ⟨u, hu.le, by rwa [abs_of_nonneg hs] at hval⟩ + · refine ⟨-u, by simpa using hu.le, ?_⟩ + rw [abs_of_neg (lt_of_not_ge hs)] at hval + simpa only [map_neg] using hval + +/-- Converse slice characterization, needed for the explicitly constructed example. -/ +theorem unitSlice_daugavet [Nontrivial X] (hsp : UnitSliceProperty X) : Daugavet X := by + intro ell v + by_cases he0 : ell = 0 + · simp [he0, ContinuousLinearMap.norm_id] + by_cases hv0 : v = 0 + · simp [hv0, ContinuousLinearMap.norm_id] + have he : 0 < ‖ell‖ := norm_pos_iff.mpr he0 + have hv : 0 < ‖v‖ := norm_pos_iff.mpr hv0 + let f : X →L[ℝ] ℝ := ‖ell‖⁻¹ • ell + have hf : ‖f‖ = 1 := norm_smul_inv_norm he0 + let w := ‖v‖⁻¹ • v + have hw : ‖w‖ = 1 := norm_smul_inv_norm hv0 + let a := ‖ell‖ * ‖v‖ + have ha : 0 < a := mul_pos he hv + let T : X →L[ℝ] X := ContinuousLinearMap.id ℝ X + ell.smulRight v + have hnrank : ‖ell.smulRight v‖ = a := ContinuousLinearMap.norm_smulRight_apply _ _ + apply le_antisymm + · have hb := norm_add_le (ContinuousLinearMap.id ℝ X) (ell.smulRight v) + simpa only [ContinuousLinearMap.norm_id] using hb + · rw [hnrank] + change 1 + a ≤ ‖T‖ + apply le_of_forall_pos_le_add + intro δ hδ + let η := min (1 / 2 : ℝ) (δ / (4 * (a + 1))) + have hη : 0 < η := by dsimp [η]; positivity + have hη1 : η < 1 := (min_le_left _ _).trans_lt (by norm_num) + have hηδ : η * (4 * (a + 1)) ≤ δ := + (le_div_iff₀ (by positivity)).mp (min_le_right _ _) + obtain ⟨y, hy, hfy, hfar⟩ := hsp w hw f (1 - η) + (normalized_functional_slice_nonempty f hf hη) η hη + obtain ⟨φ, hφ, hφsum⟩ := exists_dual_vector'' ℝ (w + y) + change φ (w + y) = ‖w + y‖ at hφsum + rw [map_add] at hφsum + have hφw : φ w ≤ 1 := by simpa only [hw] using dual_apply_le_norm φ hφ w + have hφy : φ y ≤ 1 := by simpa only [hy] using dual_apply_le_norm φ hφ y + have hwlo : 1 - η ≤ φ w := by linarith + have hylo : 1 - η ≤ φ y := by linarith + have hfylo : 1 - η ≤ f y := hfy.le + have hprod : (1 - η) ^ 2 ≤ f y * φ w := by + have hp := mul_le_mul hfylo hwlo (by linarith : 0 ≤ 1 - η) (by linarith : 0 ≤ f y) + nlinarith + have hmul := mul_le_mul_of_nonneg_left hprod ha.le + have heval : ell y = ‖ell‖ * f y := by + change ell y = ‖ell‖ * (‖ell‖⁻¹ * ell y) + rw [← mul_assoc, mul_inv_cancel₀ he.ne', one_mul] + have hvid : v = ‖v‖ • w := by + dsimp [w] + rw [smul_smul, mul_inv_cancel₀ hv.ne', one_smul] + have hφv : φ v = ‖v‖ * φ w := by conv_lhs => rw [hvid]; rw [map_smul, smul_eq_mul] + have hTφ : φ (T y) = φ y + a * (f y * φ w) := by + change φ (y + ell y • v) = _ + rw [map_add, map_smul, smul_eq_mul, heval, hφv] + dsimp [a] + ring + have hbound := dual_apply_le_norm φ hφ (T y) + have hop := T.le_opNorm y + rw [hy, mul_one] at hop + rw [hTφ] at hbound + nlinarith [mul_nonneg ha.le (sq_nonneg η)] + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Slices.lean b/lean/OAI/Analysis/Daugavet/Slices.lean new file mode 100644 index 0000000000000000000000000000000000000000..ccf3a3ce6d0ec94dbc3ff549d9c6055487e0af2e --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Slices.lean @@ -0,0 +1,229 @@ +import OAI.Analysis.Daugavet.LowerBounds + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX uY + +namespace ExactModuli +variable {X : Type uX} {Y : Type uY} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] + +lemma exists_unit_near_opNorm (T : X →L[ℝ] Y) {r : ℝ} (hr : 0 ≤ r) (hrT : r < ‖T‖) : + ∃ y : X, ‖y‖ = 1 ∧ r < ‖T y‖ := by + obtain ⟨u, hu, hTu⟩ := T.exists_lt_apply_of_lt_opNorm hrT + have hu0 : u ≠ 0 := by + intro heq + simp only [heq, map_zero, norm_zero] at hTu + linarith + have hnpos : 0 < ‖u‖ := norm_pos_iff.mpr hu0 + refine ⟨‖u‖⁻¹ • u, norm_smul_inv_norm hu0, ?_⟩ + rw [map_smul, norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hnpos)] + have hinv : 1 ≤ ‖u‖⁻¹ := (one_le_inv₀ hnpos).mpr hu.le + have := mul_le_mul_of_nonneg_right hinv (norm_nonneg (T u)) + exact hTu.trans_le (by simpa only [one_mul] using this) + +lemma daugavet_normalized_slice (hd : Daugavet X) {w : X} (hw : ‖w‖ = 1) + (ell : X →L[ℝ] ℝ) (hell : ‖ell‖ = 1) {α ρ : ℝ} (hα : α < 1) (hρ : 0 < ρ) : + ∃ y : X, ‖y‖ = 1 ∧ α < ell y ∧ 2 - ρ ≤ ‖w + y‖ := by + let η := min (1 - α) (min (ρ / 2) 1) / 2 + have hη : 0 < η := by dsimp [η]; positivity + have hηα : η < 1 - α := by + have := min_le_left (1 - α) (min (ρ / 2) 1) + dsimp [η] at *; linarith + have hηρ : 2 * η < ρ := by + have := (min_le_right (1 - α) (min (ρ / 2) 1)).trans (min_le_left _ _) + dsimp [η] at *; linarith + have hη1 : η < 1 := by + have := (min_le_right (1 - α) (min (ρ / 2) 1)).trans (min_le_right _ _) + dsimp [η] at *; linarith + let T : X →L[ℝ] X := ContinuousLinearMap.id ℝ X + ell.smulRight w + have hT : ‖T‖ = 2 := by + change ‖ContinuousLinearMap.id ℝ X + ell.smulRight w‖ = 2 + rw [hd ell w, ContinuousLinearMap.norm_smulRight_apply, hell, hw] + norm_num + obtain ⟨u, hu, hval⟩ := exists_unit_near_opNorm T (show 0 ≤ 2 - η by linarith) + (show 2 - η < ‖T‖ by rw [hT]; linarith) + obtain ⟨y, hy, hsign, hyval⟩ : ∃ y : X, ‖y‖ = 1 ∧ 0 ≤ ell y ∧ + 2 - η < ‖y + ell y • w‖ := by + by_cases he : 0 ≤ ell u + · exact ⟨u, hu, he, hval⟩ + · refine ⟨-u, by simpa using hu, by simpa using (neg_nonneg.mpr (le_of_not_ge he)), ?_⟩ + change 2 - η < ‖T (-u)‖ + simpa only [map_neg, norm_neg] using hval + have he1 : ell y ≤ 1 := by + have hb := ell.le_opNorm y + rw [hell, hy, one_mul, Real.norm_eq_abs] at hb + exact le_trans (le_abs_self _) hb + have hnear : 1 - η < ell y := by + have hb := norm_add_le y (ell y • w) + rw [hy, norm_smul, Real.norm_eq_abs, abs_of_nonneg hsign, hw, mul_one] at hb + linarith + refine ⟨y, hy, by linarith, ?_⟩ + have hid : y + ell y • w = (w + y) + (ell y - 1) • w := by module + have hb := norm_add_le (w + y) ((ell y - 1) • w) + rw [← hid, norm_smul, Real.norm_eq_abs, abs_of_nonpos (sub_nonpos.mpr he1), hw, + mul_one] at hb + linarith + +/-- Forward half of the actual rank-one/slice equivalence, with a unit-sphere witness. -/ +theorem daugavet_unitSlice (hd : Daugavet X) : UnitSliceProperty X := by + intro w hw ell α hne ρ hρ + obtain ⟨u, hu, hau⟩ := hne + by_cases he0 : ell = 0 + · have hα : α < 0 := by simpa [he0] using hau + refine ⟨w, hw, by simpa [he0] using hα, ?_⟩ + have htwo : ‖w + w‖ = 2 := by rw [← two_smul ℝ w, norm_smul, hw]; norm_num + rw [htwo]; linarith + · have hn : 0 < ‖ell‖ := norm_pos_iff.mpr he0 + have hα : α < ‖ell‖ := by + have hbound := ell.le_opNorm u + have := le_abs_self (ell u) + rw [Real.norm_eq_abs] at hbound + nlinarith + have hnormalized : ‖‖ell‖⁻¹ • ell‖ = 1 := norm_smul_inv_norm he0 + obtain ⟨y, hy, hslice, hfar⟩ := daugavet_normalized_slice hd hw (‖ell‖⁻¹ • ell) + hnormalized ((div_lt_one hn).mpr hα) hρ + refine ⟨y, hy, ?_, hfar⟩ + change α / ‖ell‖ < ‖ell‖⁻¹ * ell y at hslice + rw [← div_eq_inv_mul] at hslice + exact (div_lt_div_iff_of_pos_right hn).mp hslice + +end ExactModuli + +namespace ExactModuli +open scoped RealInnerProductSpace +variable {Y : Type uY} [NormedAddCommGroup Y] [InnerProductSpace ℝ Y] + +lemma exposed_support_approx {K : Set Y} (hK : IsCompact K) {q : Y} (hq : q ∈ K) + (ell : Y →L[ℝ] ℝ) {ε : ℝ} (hε : 0 < ε) : + ∃ p ∈ K.exposedPoints ℝ, ell q - ε < ell p := by + obtain ⟨M, hM⟩ := hK.isBounded.exists_norm_le + let c : ℝ := ε / (M ^ 2 + 1) + have hc : 0 < c := by dsimp [c]; positivity + have hc_eq : c * (M ^ 2 + 1) = ε := div_mul_cancel₀ _ (by positivity) + obtain ⟨p, hp, hmax⟩ := hK.exists_isMaxOn ⟨q, hq⟩ + ((ell.continuous.add (continuous_const.mul (continuous_norm.pow 2))).continuousOn : + ContinuousOn (fun z : Y => ell z + c * ‖z‖ ^ 2) K) + have hpM : ‖p‖ ^ 2 ≤ M ^ 2 := by nlinarith [hM p hp, norm_nonneg p] + refine ⟨p, ⟨hp, ell + (2 * c) • innerSL ℝ p, ?_⟩, ?_⟩ + · intro z hz + have hcomp := hmax hz + change ell z + c * ‖z‖ ^ 2 ≤ ell p + c * ‖p‖ ^ 2 at hcomp + have hsq := norm_sub_sq_real p z + change (ell z + (2 * c) * ⟪p, z⟫ ≤ ell p + (2 * c) * ⟪p, p⟫) ∧ + ((ell p + (2 * c) * ⟪p, p⟫ ≤ ell z + (2 * c) * ⟪p, z⟫) → z = p) + rw [real_inner_self_eq_norm_sq] + constructor + · nlinarith [sq_nonneg ‖p - z‖] + · intro he + have hsqc := congrArg (fun a : ℝ => c * a) hsq + have hprod : c * ‖p - z‖ ^ 2 ≤ 0 := by nlinarith only [hcomp, he, hsqc] + have hsqzero : ‖p - z‖ ^ 2 ≤ 0 := by + by_contra hn + have hh := mul_pos hc (lt_of_not_ge hn) + linarith + have hzero : ‖p - z‖ = 0 := by nlinarith [norm_nonneg (p - z)] + exact (sub_eq_zero.mp (norm_eq_zero.mp hzero)).symm + · have hcomp := hmax hq + change ell q + c * ‖q‖ ^ 2 ≤ ell p + c * ‖p‖ ^ 2 at hcomp + nlinarith [sq_nonneg ‖q‖] + +lemma closure_convexHull_exposed {K : Set Y} (hK : IsCompact K) (hconv : Convex ℝ K) : + closure (convexHull ℝ (K.exposedPoints ℝ)) = K := by + apply (closure_minimal (convexHull_min exposedPoints_subset hconv) hK.isClosed).antisymm + intro q hq + by_contra hq' + obtain ⟨ell, a, ha, haq⟩ := geometric_hahn_banach_closed_point + (convex_convexHull ℝ (K.exposedPoints ℝ)).closure isClosed_closure hq' + obtain ⟨p, hp, happ⟩ := exposed_support_approx hK hq ell (sub_pos.mpr haq) + have hb := ha p (subset_closure (subset_convexHull ℝ _ hp)) + linarith + +/-- Compactness shrinks a slice about its uniquely exposed maximizer. -/ +lemma exposed_small_slice {K : Set Y} (hK : IsCompact K) {p : Y} + (hp : p ∈ K.exposedPoints ℝ) {r : ℝ} (hr : 0 < r) : + ∃ (ell : Y →L[ℝ] ℝ) (β : ℝ), β < ell p ∧ + ∀ q ∈ K, β < ell q → ‖q - p‖ < r := by + obtain ⟨hpK, ell, hell⟩ := hp + let C := K ∩ {q : Y | r ≤ ‖q - p‖} + have hC : IsCompact C := hK.inter_right (isClosed_le continuous_const (continuous_id.sub continuous_const).norm) + by_cases hne : C.Nonempty + · obtain ⟨q, hq, hmax⟩ := hC.exists_isMaxOn hne ell.continuous.continuousOn + have hlt : ell q < ell p := by + refine lt_of_le_of_ne (hell q hq.1).1 ?_ + intro he + have hqp := (hell q hq.1).2 he.ge + have : r ≤ ‖q - p‖ := hq.2 + simp only [hqp, sub_self, norm_zero] at this + linarith + refine ⟨ell, ell q, hlt, ?_⟩ + intro z hz hβ + by_contra hdist + exact (hmax ⟨hz, le_of_not_gt hdist⟩).not_gt hβ + · refine ⟨ell, ell p - 1, by linarith, ?_⟩ + intro q hq _ + by_contra hdist + exact hne ⟨q, hq, le_of_not_gt hdist⟩ + +end ExactModuli + +namespace ExactModuli +variable {X : Type uX} {Y : Type uY} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [InnerProductSpace ℝ Y] [FiniteDimensional ℝ Y] + +/-- Bourgain's finite-dimensional slice-combination lemma, in the exact form needed for +finite-quotient neighborhoods. Zero weights are harmless and allowed. -/ +lemma bourgain_image (T : X →L[ℝ] Y) {u : X} (hu : ‖u‖ ≤ 1) {r : ℝ} (hr : 0 < r) : + ∃ (ι : Type) (_ : Fintype ι) (a : ι → ℝ) (ell : ι → X →L[ℝ] ℝ) (β : ι → ℝ), + (∀ i, 0 ≤ a i) ∧ (∑ i, a i = 1) ∧ + (∀ i, ∃ y : X, ‖y‖ ≤ 1 ∧ β i < ell i y) ∧ + ∀ y : ι → X, (∀ i, ‖y i‖ ≤ 1 ∧ β i < ell i (y i)) → + ‖T (∑ i, a i • y i) - T u‖ < r := by + let B := Metric.closedBall (0 : X) 1 + let K := closure (T '' B) + have hK : IsCompact K := Metric.isCompact_iff_isClosed_bounded.mpr + ⟨isClosed_closure, ((Metric.isBounded_closedBall (x := (0 : X)) (r := 1)).image T).closure⟩ + have hconv : Convex ℝ K := ((convex_closedBall (0 : X) 1).linear_image T.toLinearMap).closure + have hTu : T u ∈ K := subset_closure ⟨u, by simpa [B] using hu, rfl⟩ + rw [← closure_convexHull_exposed hK hconv] at hTu + obtain ⟨p, hp, hdist⟩ := Metric.mem_closure_iff.mp hTu (r / 2) (by positivity) + obtain ⟨ι, hι, a, v, ha, hsum, hv, hpv⟩ := mem_convexHull_iff_exists_fintype.mp hp + let := hι + choose ell β hβ hsmall using fun i => exposed_small_slice hK (hv i) (show 0 < r / 2 by positivity) + have hne : ∀ i, ∃ y : X, ‖y‖ ≤ 1 ∧ β i < ell i (T y) := by + intro i + have hvi : v i ∈ closure (T '' B) := (hv i).1 + obtain ⟨q, hqβ, y, hy, rfl⟩ := mem_closure_iff.mp hvi {q | β i < ell i q} + (isOpen_lt continuous_const (ell i).continuous) (hβ i) + exact ⟨y, by simpa [B] using hy, hqβ⟩ + refine ⟨ι, hι, a, fun i => (ell i).comp T, β, ha, hsum, hne, ?_⟩ + intro y hy + have hpbound : ‖T (∑ i, a i • y i) - p‖ ≤ r / 2 := by + have hid : T (∑ i, a i • y i) - p = ∑ i, a i • (T (y i) - v i) := by + rw [← hpv] + simp only [map_sum, map_smul, smul_sub, Finset.sum_sub_distrib] + rw [hid] + calc + ‖∑ i, a i • (T (y i) - v i)‖ ≤ ∑ i, ‖a i • (T (y i) - v i)‖ := norm_sum_le _ _ + _ ≤ ∑ i, a i * (r / 2) := by + apply Finset.sum_le_sum + intro i _ + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (ha i)] + apply mul_le_mul_of_nonneg_left _ (ha i) + exact (hsmall i (T (y i)) (subset_closure ⟨y i, by simpa [B] using (hy i).1, rfl⟩) + (hy i).2).le + _ = r / 2 := by rw [← Finset.sum_mul, hsum, one_mul] + have hpu : ‖p - T u‖ < r / 2 := by simpa only [dist_eq_norm, norm_sub_rev] using hdist + have hb := norm_add_le (T (∑ i, a i • y i) - p) (p - T u) + rw [sub_add_sub_cancel] at hb + linarith + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/Stages.lean b/lean/OAI/Analysis/Daugavet/Stages.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7609297dd3369b62ec908e8367b9ab0b032b5a4 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/Stages.lean @@ -0,0 +1,161 @@ +import OAI.Analysis.Daugavet.MeasureDistance + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +namespace ExactModuli.KW + +/-- One finite-coordinate stage of the construction. -/ +structure ConstructionStage where + space : Submodule ℝ KWL1 + finiteDimensional : FiniteDimensional ℝ space + finiteCoordinates : FiniteCoordinates space + nonzero : space ≠ ⊥ + +/-- All estimates propagated from one stage to the next. -/ +structure StepEstimates (G H : Submodule ℝ KWL1) (h : ℝ) : Prop where + proper : G < H + wholeBall : ∀ g ∈ H, ‖g‖ ≤ 1 → + ∃ ψ ∈ G, ‖ψ‖ ≤ 1 ∧ measureDistance kwMeasure g ψ ≤ h + averages : ∀ u ∈ G, ‖u‖ = 1 → ∃ n : ℕ, 0 < n ∧ ∃ v : Fin n → KWL1, + (∀ j, v j ∈ H ∧ ‖v j‖ = 1) ∧ + ‖u - (n : ℝ)⁻¹ • ∑ j, v j‖ ≤ 2 * h ∧ + ∀ w ∈ G, ‖w‖ = 1 → ∀ j, 2 - h ≤ ‖w + v j‖ + +lemma stage_enlargement (G : ConstructionStage) {h : ℝ} (hh : 0 < h) (hh1 : h < 1) : + ∃ H : ConstructionStage, StepEstimates G.space H.space h := by + classical + let : FiniteDimensional ℝ G.space := G.finiteDimensional + let : Nontrivial G.space := Submodule.nontrivial_iff_ne_bot.mpr G.nonzero + obtain ⟨t, hts, htfin, hcover⟩ := (isCompact_sphere (0 : G.space) 1).finite_cover_balls hh + have hex : ∃ z : G.space, ‖z‖ = 1 := exists_norm_eq G.space (by norm_num : (0:ℝ) ≤ 1) + have htne : t.Nonempty := by + obtain ⟨z,hz⟩ := hex + have hzcover := hcover (show z ∈ Metric.sphere (0:G.space) 1 by simpa using hz) + simp only [Set.mem_iUnion] at hzcover + obtain ⟨b,hb,_⟩ := hzcover + exact ⟨b,hb⟩ + let : Fintype t := htfin.fintype + let : Nonempty t := htne.to_subtype + let u : t → G.space := fun z => z.val + have hu (z : t) : ‖u z‖ = 1 := by simpa [u] using hts z.property + obtain ⟨A⟩ := finite_dimensional_enlargement G.space G.nonzero G.finiteCoordinates u hu hh hh1 + have hproper : G.space < A.space := by + apply lt_of_le_of_ne A.contains + intro heq + let k : t := Classical.choice inferInstance + let j : Fin A.copies := ⟨0,A.copies_pos⟩ + have hv : A.vectors k j ∈ G.space := by simpa only [heq] using A.vectors_mem k j + have hhfar := A.additive (-A.vectors k j) (G.space.neg_mem hv) + (by simpa using A.vectors_unit k j) k j + simp only [neg_add_cancel, norm_zero] at hhfar + linarith + let H : ConstructionStage := ⟨A.space, A.finiteDimensional, A.finiteCoordinates, + ne_bot_of_gt hproper⟩ + refine ⟨H, ⟨hproper, A.wholeBall, ?_⟩⟩ + intro x hx hxu + have hxcover := hcover (show (⟨x,hx⟩ : G.space) ∈ Metric.sphere 0 1 by simpa using hxu) + simp only [Set.mem_iUnion, Metric.mem_ball, dist_eq_norm] at hxcover + obtain ⟨b,hb,hxb⟩ := hxcover + let k : t := ⟨b,hb⟩ + refine ⟨A.copies, A.copies_pos, A.vectors k, fun j => ⟨A.vectors_mem k j, A.vectors_unit k j⟩, ?_, ?_⟩ + · have ha := A.averages k + have hxb' : ‖x - (u k : KWL1)‖ < h := hxb + calc + _ ≤ ‖x - (u k : KWL1)‖ + ‖(u k : KWL1) - (A.copies : ℝ)⁻¹ • ∑ j, A.vectors k j‖ := + norm_sub_le_norm_sub_add_norm_sub _ _ _ + _ ≤ 2 * h := by linarith + · exact fun w hw hw1 j => A.additive w hw hw1 k j + +/-- The constant-one vector, so the initial stage is literally span{1}. -/ +def oneVector : KWL1 := Lp.const 1 kwMeasure (1:ℝ) + +lemma oneVector_norm : ‖oneVector‖ = 1 := by + simp [oneVector, Lp.norm_const] + +lemma oneVector_finiteCoordinates : FiniteCoordinates (Submodule.span ℝ {oneVector}) := by + let c : Fin 0 → ℕ := Fin.elim0 + have hc : Function.Injective c := fun i => Fin.elim0 i + refine ⟨Fin 0, inferInstance, c, hc, Submodule.span_le.mpr ?_⟩ + intro x hx + have hx' : x = oneVector := Set.mem_singleton_iff.mp hx + subst x + refine ⟨Lp.const 1 (cubeMeasure (Fin 0)) (1:ℝ), ?_⟩ + apply Lp.ext + filter_upwards [Lp.coeFn_compMeasurePreserving (Lp.const 1 (cubeMeasure (Fin 0)) (1:ℝ)) + (finite_coordinates_mp c hc), + (finite_coordinates_mp c hc).quasiMeasurePreserving.ae_eq_comp (Lp.coeFn_const 1 (cubeMeasure (Fin 0)) (1:ℝ)), + Lp.coeFn_const 1 kwMeasure (1:ℝ)] with ω hω hω' hω'' + exact hω.trans (hω'.trans hω''.symm) + +def initialStage : ConstructionStage where + space := Submodule.span ℝ {oneVector} + finiteDimensional := inferInstance + finiteCoordinates := oneVector_finiteCoordinates + nonzero := by + intro heq + have hmem : oneVector ∈ (⊥ : Submodule ℝ KWL1) := heq ▸ Submodule.subset_span (Set.mem_singleton oneVector) + have hz : oneVector = 0 := hmem + have hn := oneVector_norm + rw [hz, norm_zero] at hn + norm_num at hn + +def stageError (n : ℕ) : ℝ := (1/2)^(n+1) + +lemma stageError_pos (n : ℕ) : 0 < stageError n := by unfold stageError; positivity + +lemma stageError_lt_one (n : ℕ) : stageError n < 1 := by + unfold stageError + exact pow_lt_one₀ (by norm_num) (by norm_num) (Nat.succ_ne_zero n) + +lemma stageError_succ (n : ℕ) : 2 * stageError (n+1) = stageError n := by + simp only [stageError, pow_succ] + ring + +def nextStage (n : ℕ) (G : ConstructionStage) : ConstructionStage := + Classical.choose (stage_enlargement G (stageError_pos n) (stageError_lt_one n)) + +lemma nextStage_estimates (n : ℕ) (G : ConstructionStage) : + StepEstimates G.space (nextStage n G).space (stageError n) := + Classical.choose_spec (stage_enlargement G (stageError_pos n) (stageError_lt_one n)) + +def stages : ℕ → ConstructionStage + | 0 => initialStage + | n+1 => nextStage n (stages n) + +def stageSpace (n : ℕ) : Submodule ℝ KWL1 := (stages n).space + +instance stageSpace_finite (n : ℕ) : FiniteDimensional ℝ (stageSpace n) := + (stages n).finiteDimensional + +lemma stageSpace_nonzero (n : ℕ) : stageSpace n ≠ ⊥ := (stages n).nonzero + +lemma step_estimates (n : ℕ) : StepEstimates (stageSpace n) (stageSpace (n+1)) (stageError n) := + nextStage_estimates n (stages n) + +lemma stageSpace_strictMono : StrictMono stageSpace := + strictMono_nat_of_lt_succ (fun n => (step_estimates n).proper) + +lemma stageSpace_mono : Monotone stageSpace := stageSpace_strictMono.monotone + +def unionSpace : Submodule ℝ KWL1 := ⨆ n, stageSpace n + +def constructedSpace : Submodule ℝ KWL1 := unionSpace.topologicalClosure + +lemma stageSpace_le_constructed (n : ℕ) : stageSpace n ≤ constructedSpace := + (le_iSup stageSpace n).trans unionSpace.le_topologicalClosure + +lemma constructedSpace_closed : IsClosed (constructedSpace : Set KWL1) := + unionSpace.isClosed_topologicalClosure + +lemma constructedSpace_nonzero : constructedSpace ≠ ⊥ := + ne_bot_of_le_ne_bot (stageSpace_nonzero 0) (stageSpace_le_constructed 0) + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/TailEstimates.lean b/lean/OAI/Analysis/Daugavet/TailEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..db3f77161985a402a1b6db70b63423ce5b364aff --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/TailEstimates.lean @@ -0,0 +1,226 @@ +import OAI.Analysis.Daugavet.Multipliers + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe u_1 uIota + +namespace ExactModuli.KW + +section TailMoments +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +lemma measurable_real_tail (X : Ω → ℝ) : Measurable (fun t : ℝ => μ.real {ω | t < X ω}) := by + apply Antitone.measurable + intro a b hab + exact measureReal_mono (fun _ ht => hab.trans_lt ht) + +/-- The bounded weighted layer-cake identity used for truncation variances. -/ +lemma integral_min_abs_sq {X : Ω → ℝ} (hX : Measurable X) {u : ℝ} (hu : 0 < u) : + ∫ ω, (min |X ω| u) ^ 2 ∂μ = + ∫ t in Ioc 0 u, 2 * t * μ.real {ω | t < |X ω|} := by + let m := fun ω => min |X ω| u + have hm : Measurable m := hX.abs.min measurable_const + have hm0 : ∀ ω, 0 ≤ m ω := fun ω => le_min (abs_nonneg _) hu.le + have hinner : ∀ ω, (∫ t in (0:ℝ)..m ω, 2 * t) = m ω ^ 2 := by + intro ω + rw [intervalIntegral.integral_const_mul, integral_id] + ring + have hlay := lintegral_comp_eq_lintegral_meas_lt_mul μ (ae_of_all _ hm0) hm.aemeasurable + (fun t ht => (continuous_id.intervalIntegrable 0 t).const_mul (2:ℝ)) + (show ∀ᵐ t ∂volume.restrict (Ioi (0:ℝ)), 0 ≤ 2 * t from + (ae_restrict_mem measurableSet_Ioi).mono (fun t ht => mul_nonneg (by norm_num) (le_of_lt ht))) + change (∫⁻ ω, ENNReal.ofReal (∫ t in (0:ℝ)..m ω, 2 * t) ∂μ) = _ at hlay + simp only [id_eq] at hlay + simp_rw [hinner] at hlay + have hright : (∫⁻ t in Ioi (0:ℝ), μ {ω | t < m ω} * ENNReal.ofReal (2 * t)) = + ∫⁻ t in Ioc 0 u, ENNReal.ofReal (2 * t * μ.real {ω | t < |X ω|}) := by + calc + _ = ∫⁻ t in Ioi (0:ℝ), (Iio u).indicator + (fun t => ENNReal.ofReal (2 * t * μ.real {ω | t < |X ω|})) t := by + apply setLIntegral_congr_fun measurableSet_Ioi + intro t ht + change μ {ω | t < m ω} * ENNReal.ofReal (2 * t) = _ + have ht0 : 0 < t := ht + by_cases htu : t < u + · rw [Set.indicator_of_mem (show t ∈ Iio u from htu)] + have he : {ω | t < m ω} = {ω | t < |X ω|} := by + ext ω + simp [m, htu] + rw [he, ENNReal.ofReal_mul (show 0 ≤ 2 * t by positivity), measureReal_def, + ENNReal.ofReal_toReal (measure_ne_top _ _)] + exact mul_comm _ _ + · have he : {ω | t < m ω} = ∅ := by + ext ω + simp [m, htu] + rw [he, measure_empty, zero_mul, Set.indicator_of_notMem (show t ∉ Iio u from htu)] + _ = _ := by + rw [lintegral_indicator measurableSet_Iio, Measure.restrict_restrict measurableSet_Iio, + Iio_inter_Ioi, restrict_Ioo_eq_restrict_Ioc] + rw [hright] at hlay + rw [integral_eq_lintegral_of_nonneg_ae (ae_of_all _ (fun ω => sq_nonneg (m ω))) + (hm.pow_const 2).aestronglyMeasurable] + rw [hlay] + symm + apply integral_eq_lintegral_of_nonneg_ae + · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + exact mul_nonneg (mul_nonneg (by norm_num) ht.1.le) measureReal_nonneg + · exact ((measurable_const.mul measurable_id).mul + (measurable_real_tail (fun ω => |X ω|))).aestronglyMeasurable + +/-- A truncated symmetric summand has second moment controlled using its tail. -/ +lemma integral_min_sq_tail_bound {X : Ω → ℝ} (hX : Measurable X) + {p C u : ℝ} (_hp : 0 < p) (hp2 : p < 2) (_hC : 0 ≤ C) (hu : 0 < u) + (htail : ∀ t : ℝ, 0 < t → μ.real {ω | t < |X ω|} ≤ C * t ^ (-p)) : + ∫ ω, (min |X ω| u) ^ 2 ∂μ ≤ (2 * C / (2 - p)) * u ^ (2 - p) := by + rw [integral_min_abs_sq hX hu] + have hexp : -1 < 1 - p := by linarith + have hi : IntegrableOn (fun t : ℝ => 2 * C * t ^ (1 - p)) (Ioc 0 u) volume := + (intervalIntegral.intervalIntegrable_rpow' hexp).1.const_mul _ + have hle : (∫ t in Ioc 0 u, 2 * t * μ.real {ω | t < |X ω|}) ≤ + ∫ t in Ioc 0 u, 2 * C * t ^ (1 - p) := by + apply integral_mono_of_nonneg + · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + exact mul_nonneg (mul_nonneg (by norm_num) ht.1.le) measureReal_nonneg + · exact hi + · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + have ht0 : 0 < t := ht.1 + have hbound := mul_le_mul_of_nonneg_left (htail t ht0) (show 0 ≤ 2 * t by positivity) + convert hbound using 1 + rw [Real.rpow_sub ht0, Real.rpow_one, Real.rpow_neg ht0.le] + ring + refine hle.trans_eq ?_ + rw [integral_const_mul, ← intervalIntegral.integral_of_le hu.le, + integral_rpow (Or.inl hexp), Real.zero_rpow (by linarith : 1 - p + 1 ≠ 0)] + have he : 1 - p + 1 = 2 - p := by ring + rw [he] + ring + +def hardTruncate (u x : ℝ) : ℝ := if |x| ≤ u then x else 0 + +lemma measurable_hardTruncate (u : ℝ) : Measurable (hardTruncate u) := + Measurable.ite (measurableSet_le measurable_abs measurable_const) measurable_id measurable_const + +lemma hardTruncate_neg (u x : ℝ) : hardTruncate u (-x) = -hardTruncate u x := by + simp only [hardTruncate, abs_neg] + split_ifs <;> simp + +lemma abs_hardTruncate_le {u : ℝ} (hu : 0 ≤ u) (x : ℝ) : |hardTruncate u x| ≤ u := by + unfold hardTruncate + split_ifs with h + · exact h + · simpa using hu + +lemma hardTruncate_sq_le_min_sq {u : ℝ} (_hu : 0 ≤ u) (x : ℝ) : + (hardTruncate u x) ^ 2 ≤ (min |x| u) ^ 2 := by + unfold hardTruncate + split_ifs with h + · simp [min_eq_left h, sq_abs] + · simp only [zero_pow (by norm_num : (2:ℕ) ≠ 0)] + exact sq_nonneg _ + +omit [IsProbabilityMeasure μ] in +lemma integral_hardTruncate_zero [IsProbabilityMeasure μ] {X : Ω → ℝ} {u : ℝ} + (hsym : IdentDistrib X (fun ω => -X ω) μ μ) : + ∫ ω, hardTruncate u (X ω) ∂μ = 0 := by + have h := (hsym.comp (measurable_hardTruncate u)).integral_eq + change (∫ ω, hardTruncate u (X ω) ∂μ) = ∫ ω, hardTruncate u (-X ω) ∂μ at h + simp_rw [hardTruncate_neg] at h + rw [integral_neg] at h + linarith + +lemma hardTruncate_memLp {X : Ω → ℝ} (hX : Measurable X) {u : ℝ} (hu : 0 ≤ u) : + MemLp (fun ω => hardTruncate u (X ω)) 2 μ := by + exact MemLp.of_bound ((measurable_hardTruncate u).comp hX).aestronglyMeasurable u + (ae_of_all _ (fun ω => by simpa only [Real.norm_eq_abs] using abs_hardTruncate_le hu (X ω))) + +lemma hardTruncate_variance_bound {X : Ω → ℝ} (hX : Measurable X) + {p C u : ℝ} (hp : 0 < p) (hp2 : p < 2) (hC : 0 ≤ C) (hu : 0 < u) + (htail : ∀ t : ℝ, 0 < t → μ.real {ω | t < |X ω|} ≤ C * t ^ (-p)) : + variance (fun ω => hardTruncate u (X ω)) μ ≤ (2 * C / (2 - p)) * u ^ (2 - p) := by + refine (variance_le_expectation_sq + ((measurable_hardTruncate u).comp hX).aestronglyMeasurable).trans ?_ + refine le_trans ?_ (integral_min_sq_tail_bound hX hp hp2 hC hu htail) + apply integral_mono_of_nonneg (ae_of_all _ (fun ω => sq_nonneg _)) + · refine (integrable_const (u ^ 2)).mono' ((hX.abs.min measurable_const).pow_const 2).aestronglyMeasurable ?_ + filter_upwards with ω + rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] + have hmin0 : 0 ≤ min |X ω| u := le_min (abs_nonneg _) hu.le + have hminu := min_le_right |X ω| u + nlinarith + · exact ae_of_all _ (fun ω => hardTruncate_sq_le_min_sq hu.le (X ω)) + +/-- Truncation, the union bound, and Chebyshev, uniformly in the number of summands. -/ +lemma independent_symmetric_sum_tail {ι : Type uIota} [Fintype ι] + (X : ι → Ω → ℝ) (hX : ∀ j, Measurable (X j)) (hind : iIndepFun X μ) + (hsym : ∀ j, IdentDistrib (X j) (fun ω => -X j ω) μ μ) + {p : ℝ} (hp : 0 < p) (hp2 : p < 2) (C : ι → ℝ) (hC : ∀ j, 0 ≤ C j) + (htail : ∀ j t, 0 < t → μ.real {ω | t < |X j ω|} ≤ C j * t ^ (-p)) + {u : ℝ} (hu : 0 < u) : + μ.real {ω | u < |∑ j, X j ω|} ≤ + (1 + 2 / (2 - p)) * (∑ j, C j) * u ^ (-p) := by + classical + let T := fun j ω => hardTruncate u (X j ω) + have hT : ∀ j, MemLp (T j) 2 μ := fun j => hardTruncate_memLp (hX j) hu.le + have hTi : iIndepFun T μ := hind.comp (fun _ => hardTruncate u) (fun _ => measurable_hardTruncate u) + have hTzero : ∀ j, ∫ ω, T j ω ∂μ = 0 := fun j => integral_hardTruncate_zero (hsym j) + let S := fun ω => ∑ j, T j ω + have hSmem : MemLp S 2 μ := by + exact memLp_finsetSum _ (fun j _ => hT j) + have hSzero : ∫ ω, S ω ∂μ = 0 := by + rw [show S = fun ω => ∑ j, T j ω from rfl, integral_finsetSum _ + (fun j _ => (hT j).integrable (by norm_num))] + simp [hTzero] + have hvar : variance S μ = ∑ j, variance (T j) μ := by + have hSf : S = ∑ j, T j := by ext ω; simp [S] + rw [hSf] + exact (IndepFun.variance_sum (s := Finset.univ) (fun j _ => hT j) + (fun i _ j _ hij => hTi.indepFun hij)) + have hvarbound : variance S μ ≤ (2 / (2 - p)) * (∑ j, C j) * u ^ (2 - p) := by + rw [hvar] + calc + _ ≤ ∑ j, (2 * C j / (2 - p)) * u ^ (2 - p) := + Finset.sum_le_sum (fun j _ => hardTruncate_variance_bound (hX j) hp hp2 (hC j) hu (htail j)) + _ = ∑ j, (2 / (2 - p) * C j) * u ^ (2 - p) := by + apply Finset.sum_congr rfl; intro j hj; ring + _ = _ := by rw [← Finset.sum_mul, ← Finset.mul_sum] + have hcheb : μ.real {ω | u < |S ω|} ≤ variance S μ / u ^ 2 := by + have h := meas_ge_le_variance_div_sq hSmem hu + rw [hSzero] at h + simp only [sub_zero] at h + exact (measureReal_mono (fun ω (hω : u < |S ω|) => hω.le)).trans + (ENNReal.toReal_le_of_le_ofReal (div_nonneg (variance_nonneg _ _) (sq_nonneg u)) h) + have hpow : u ^ (2 - p) / u ^ (2:ℕ) = u ^ (-p) := by + rw [Real.rpow_sub hu, Real.rpow_two, Real.rpow_neg hu.le] + field_simp + have hSbound : μ.real {ω | u < |S ω|} ≤ (2 / (2 - p)) * (∑ j, C j) * u ^ (-p) := by + refine hcheb.trans ?_ + have h := div_le_div_of_nonneg_right hvarbound (sq_nonneg u) + simpa only [mul_div_assoc, hpow] using h + have hunion : μ.real (⋃ j, {ω | u < |X j ω|}) ≤ (∑ j, C j) * u ^ (-p) := by + refine (measureReal_iUnion_fintype_le _).trans ?_ + calc + _ ≤ ∑ j, C j * u ^ (-p) := Finset.sum_le_sum (fun j _ => htail j u hu) + _ = _ := (Finset.sum_mul _ _ _).symm + have hsub : {ω | u < |∑ j, X j ω|} ⊆ (⋃ j, {ω | u < |X j ω|}) ∪ {ω | u < |S ω|} := by + intro ω hω + by_cases he : ∃ j, u < |X j ω| + · left; exact mem_iUnion.mpr he + · right + have hx : ∀ j, hardTruncate u (X j ω) = X j ω := by + intro j + exact ite_eq_left (le_of_not_gt (fun hj => he ⟨j, hj⟩)) + simpa [S, T, hx] using hω + have hb := (measureReal_mono (μ := μ) hsub).trans (measureReal_union_le _ _) + linarith + +end TailMoments + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/UpperBounds.lean b/lean/OAI/Analysis/Daugavet/UpperBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ee4bc07434795996528d229dbf6b6481a7e6d5b --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/UpperBounds.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.Daugavet.Diameter + +namespace OAI + +noncomputable section +open MeasureTheory Filter Set +open scoped ENNReal NNReal Topology + +universe uX u_1 + +namespace ExactModuli +variable {X : Type uX} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma half_envelope (t : ℝ) : (t + max 0 (t - 2)) / 2 = max (t / 2) (t - 1) := by + by_cases h : t ≤ 2 + · rw [max_eq_left (sub_nonpos.mpr h), max_eq_left (by linarith)] + ring + · rw [max_eq_right (sub_nonneg.mpr (le_of_not_ge h)), max_eq_right (by linarith)] + ring + +lemma cofinite_direction_upper (hsp : UnitSliceProperty X) {x : X} (hx : ‖x‖ = 1) + {F : Submodule ℝ X} (hF : Cofinite F) {ε t : ℝ} (hε : 0 < ε) (hε' : ε < 1 / 2) + (ht : 0 ≤ t) : + ∃ y ∈ F, ‖y‖ = 1 ∧ ‖x + t • y‖ ≤ 1 + max 0 (t - 2) + 3 * ε := by + obtain ⟨z, hzF, hzlo, hzhi, hend⟩ := cofinite_antipodal_endpoint hsp hx hF hε + have hL : 0 < ‖z‖ := by linarith + have hz : z ≠ 0 := norm_pos_iff.mp hL + let y := ‖z‖⁻¹ • z + have hy : ‖y‖ = 1 := norm_smul_inv_norm hz + have hid : ‖z‖ • y = z := by + dsimp [y] + rw [smul_smul, mul_inv_cancel₀ hL.ne', one_smul] + have hb := norm_ray_endpoint_bound hx hy hL hε.le ht (show ‖x + ‖z‖ • y‖ ≤ 1 + ε by rwa [hid]) + have hmax : max 0 (t - ‖z‖) ≤ max 0 (t - 2) + 2 * ε := by + apply max_le + · linarith [le_max_left (0 : ℝ) (t - 2)] + · linarith [le_max_right (0 : ℝ) (t - 2)] + exact ⟨y, F.smul_mem _ hzF, hy, by linarith⟩ + +/-- Matching averaged upper curve, from one family of cofinite directions. -/ +theorem averaged_upper_bound (hsp : UnitSliceProperty X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : H (normSeminorm ℝ X) x t ≤ max (t / 2) (t - 1) := by + unfold H + refine csSup_le ?_ ?_ + · exact ⟨_, ⊤, cofinite_top, rfl⟩ + rintro a ⟨F, hF, rfl⟩ + apply le_of_forall_pos_le_add + intro δ hδ + let ε := min (1 / 4 : ℝ) (δ / 6) + have hε : 0 < ε := by dsimp [ε]; positivity + have hε1 : ε < 1 / 2 := (min_le_left _ _).trans_lt (by norm_num) + have hεδ : ε ≤ δ / 6 := min_le_right _ _ + obtain ⟨y, hyF, hy, hplus⟩ := cofinite_direction_upper hsp hx hF hε hε1 ht + have hinf := csInf_le (averageValues_bddBelow x t F) ⟨y, hyF, hy.ge, rfl⟩ + have hminus := norm_sub_le x (t • y) + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg ht, hx, hy, mul_one] at hminus + change sInf (averageValues x t F) ≤ _ + change sInf (averageValues x t F) ≤ (‖x + t • y‖ + ‖x - t • y‖) / 2 - 1 at hinf + rw [← half_envelope] + linarith + +/-- Matching one-sided upper curve, including the radius-two corner. -/ +theorem oneSided_upper_bound (hsp : UnitSliceProperty X) {x : X} (hx : ‖x‖ = 1) + {t : ℝ} (ht : 0 ≤ t) : D (normSeminorm ℝ X) x t ≤ max 0 (t - 2) := by + unfold D + refine csSup_le ?_ ?_ + · exact ⟨_, ⊤, cofinite_top, rfl⟩ + rintro a ⟨F, hF, rfl⟩ + apply le_of_forall_pos_le_add + intro δ hδ + let ε := min (1 / 4 : ℝ) (δ / 6) + have hε : 0 < ε := by dsimp [ε]; positivity + have hε1 : ε < 1 / 2 := (min_le_left _ _).trans_lt (by norm_num) + have hεδ : ε ≤ δ / 6 := min_le_right _ _ + obtain ⟨y, hyF, hy, hplus⟩ := cofinite_direction_upper hsp hx hF hε hε1 ht + have hinf := csInf_le (oneSidedValues_bddBelow x t F) ⟨y, hyF, hy, rfl⟩ + change sInf (oneSidedValues x t F) ≤ _ + linarith + +variable {Ω : Type u_1} [MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] + +theorem exact_pointwise (E : Submodule ℝ (Lp ℝ 1 μ)) + (hdim : ¬ FiniteDimensional ℝ E) (hpre : MeasurePrecompactBall μ E) (hd : Daugavet E) + {x : E} (hx : ‖x‖ = 1) {t : ℝ} (ht : 0 < t) : + H (normSeminorm ℝ E) x t = max (t / 2) (t - 1) ∧ + D (normSeminorm ℝ E) x t = max 0 (t - 2) := by + exact ⟨le_antisymm (averaged_upper_bound (daugavet_unitSlice hd) hx ht.le) + (clipping_lower_bound E hdim hpre hx ht), + le_antisymm (oneSided_upper_bound (daugavet_unitSlice hd) hx ht.le) + (oneSided_lower_bound hdim hx ht.le)⟩ + +/-- The infimum over centers is a separate conclusion, not an identification of definitions. -/ +theorem exact_center_infima (E : Submodule ℝ (Lp ℝ 1 μ)) + (hdim : ¬ FiniteDimensional ℝ E) (hpre : MeasurePrecompactBall μ E) (hd : Daugavet E) + {t : ℝ} (ht : 0 < t) : + averagedModulus (normSeminorm ℝ E) t = max (t / 2) (t - 1) ∧ + oneSidedModulus (normSeminorm ℝ E) t = max 0 (t - 2) := by + obtain ⟨x, _, hx⟩ := cofinite_has_unit hdim (cofinite_top (X := E)) + have hH : {r | ∃ x : E, ‖x‖ = 1 ∧ r = H (normSeminorm ℝ E) x t} = + {max (t / 2) (t - 1)} := by + apply eq_singleton_iff_unique_mem.mpr + refine ⟨⟨x, hx, (exact_pointwise E hdim hpre hd hx ht).1.symm⟩, ?_⟩ + rintro r ⟨y, hy, rfl⟩ + exact (exact_pointwise E hdim hpre hd hy ht).1 + have hD : {r | ∃ x : E, ‖x‖ = 1 ∧ r = D (normSeminorm ℝ E) x t} = + {max 0 (t - 2)} := by + apply eq_singleton_iff_unique_mem.mpr + refine ⟨⟨x, hx, (exact_pointwise E hdim hpre hd hx ht).2.symm⟩, ?_⟩ + rintro r ⟨y, hy, rfl⟩ + exact (exact_pointwise E hdim hpre hd hy ht).2 + constructor + · change sInf {r | ∃ x : E, ‖x‖ = 1 ∧ r = H (normSeminorm ℝ E) x t} = _ + rw [hH, csInf_singleton] + · change sInf {r | ∃ x : E, ‖x‖ = 1 ∧ r = D (normSeminorm ℝ E) x t} = _ + rw [hD, csInf_singleton] + +end ExactModuli + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/WholeBallCoefficients.lean b/lean/OAI/Analysis/Daugavet/WholeBallCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..aa32fc01b36a56cee8272961ae0834d8415f6954 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/WholeBallCoefficients.lean @@ -0,0 +1,173 @@ +import OAI.Analysis.Daugavet.ProductModels + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uB uR uIota uKappa + +namespace ExactModuli.KW + +section ProductModels +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] + +/-- The representation used in the whole-ball argument. -/ +def enlargedFunction (p : ℝ) (x : B → ℝ) (u : κ → B → ℝ) (a : κ → ι → ℝ) + (z : B × (κ → cube ι)) : ℝ := + x z.1 + ∑ k, u k z.1 * rowSum p (a k) (z.2 k) + +lemma measurable_enlargedFunction (p : ℝ) {x : B → ℝ} {u : κ → B → ℝ} + (hx : Measurable x) (hu : ∀ k, Measurable (u k)) (a : κ → ι → ℝ) : + Measurable (enlargedFunction p x u a) := by + apply (hx.comp measurable_fst).add + exact Finset.measurable_sum _ (fun k _ => (hu k |>.comp measurable_fst).mul + ((measurable_rowSum p (a k)).comp ((measurable_pi_apply k).comp measurable_snd))) + +omit [IsProbabilityMeasure μ] in +lemma integrable_enlargedFunction [IsProbabilityMeasure μ] + {p : ℝ} (hp : 1 < p) {x : B → ℝ} {u : κ → B → ℝ} + (hx : Integrable x μ) (hu : ∀ k, Integrable (u k) μ) (a : κ → ι → ℝ) : + Integrable (enlargedFunction p x u a) (μ.prod (arrayMeasure κ ι)) := by + apply ((measurePreserving_fst.integrable_comp hx.aestronglyMeasurable).mpr hx).add + apply integrable_finsetSum + intro k _ + exact (hu k).mul_prod ((measurePreserving_eval (fun _ : κ => cubeMeasure ι) k).integrable_comp + (integrable_rowSum hp (a k)).aestronglyMeasurable |>.mpr (integrable_rowSum hp (a k))) + +omit [MeasurableSpace B] in +lemma resampling_difference [MeasurableSpace B] [DecidableEq κ] + (p : ℝ) (x : B → ℝ) (u : κ → B → ℝ) (a : κ → ι → ℝ) + (k : κ) (z : B × (κ → ι → unitInterval × unitInterval)) : + enlargedFunction p x u a (z.1, selectRows (fun _ => false) z.2) - + enlargedFunction p x u a (z.1, selectRows (fun l => decide (l = k)) z.2) = + u k z.1 * diffRowSum p (a k) (z.2 k) := by + classical + simp only [enlargedFunction, add_sub_add_left_eq_sub, ← Finset.sum_sub_distrib] + rw [Finset.sum_eq_single k] + · simp [selectRows, rowSum, diffRowSum, difference, Finset.mul_sum, + Finset.sum_sub_distrib, mul_sub] + · intro l _ hl + have heq : selectRows (fun _ => false) z.2 l = selectRows (fun t => decide (t = k)) z.2 l := by + funext j + simp [selectRows, hl] + rw [heq, sub_self] + · simp + +/-- Resampling controls the coefficients of EVERY representation of a point of the new unit ball. -/ +theorem coefficient_bound_108 {p : ℝ} (hp : 1 < p) (hpmax : p ≤ 3/2) + {x : B → ℝ} {u : κ → B → ℝ} (hx : Integrable x μ) + (hu : ∀ k, Integrable (u k) μ) (hun : ∀ k, ∫ b, |u k b| ∂μ = 1) + (a : κ → ι → ℝ) + (hg : ∫ z, |enlargedFunction p x u a z| ∂(μ.prod (arrayMeasure κ ι)) ≤ 1) + (k : κ) : coefficientNorm p (a k) ≤ 108 := by + classical + let g := enlargedFunction p x u a + have hgi : Integrable g (μ.prod (arrayMeasure κ ι)) := integrable_enlargedFunction hp hx hu a + let f₁ := Prod.map (id : B → B) (selectRows (ι := ι) (fun _ : κ => false)) + let f₂ := Prod.map (id : B → B) (selectRows (ι := ι) (fun l : κ => decide (l = k))) + have hm₁ : MeasurePreserving f₁ (μ.prod (pairedArrayMeasure κ ι)) (μ.prod (arrayMeasure κ ι)) := + (MeasurePreserving.id μ).prod (measurePreserving_selectRows _) + have hm₂ : MeasurePreserving f₂ (μ.prod (pairedArrayMeasure κ ι)) (μ.prod (arrayMeasure κ ι)) := + (MeasurePreserving.id μ).prod (measurePreserving_selectRows _) + have hi₁ : Integrable (fun z => g (f₁ z)) (μ.prod (pairedArrayMeasure κ ι)) := + (hm₁.integrable_comp hgi.aestronglyMeasurable).mpr hgi + have hi₂ : Integrable (fun z => g (f₂ z)) (μ.prod (pairedArrayMeasure κ ι)) := + (hm₂.integrable_comp hgi.aestronglyMeasurable).mpr hgi + have hdiff : (∫ z, |g (f₁ z) - g (f₂ z)| ∂(μ.prod (pairedArrayMeasure κ ι))) ≤ 2 := by + calc + _ ≤ ∫ z, |g (f₁ z)| + |g (f₂ z)| ∂(μ.prod (pairedArrayMeasure κ ι)) := + integral_mono (hi₁.sub hi₂).abs (hi₁.abs.add hi₂.abs) + (fun z => by simpa only [Real.norm_eq_abs, Pi.sub_apply] using norm_sub_le (g (f₁ z)) (g (f₂ z))) + _ = 2 * ∫ z, |g z| ∂(μ.prod (arrayMeasure κ ι)) := by + rw [integral_add hi₁.abs hi₂.abs, mp_integral hm₁ hgi.abs.aestronglyMeasurable, + mp_integral hm₂ hgi.abs.aestronglyMeasurable] + ring + _ ≤ 2 := by dsimp [g]; linarith + have hid : (∫ z, |g (f₁ z) - g (f₂ z)| ∂(μ.prod (pairedArrayMeasure κ ι))) = + ∫ v, |diffRowSum p (a k) v| ∂pairCubeMeasure ι := by + simp only [g, f₁, f₂, Prod.map_def, id_eq, resampling_difference, abs_mul] + rw [integral_prod_mul (μ := μ) (ν := pairedArrayMeasure κ ι) + (fun b => |u k b|) (fun v => |diffRowSum p (a k) (v k)|), hun k, one_mul] + exact mp_integral (measurePreserving_eval (fun _ : κ => pairCubeMeasure ι) k) (integrable_diffRowSum hp (a k)).abs.aestronglyMeasurable + rw [hid] at hdiff + have hl := diffRowSum_lower hp hpmax (a k) + linarith + +/-- Averaging over the resampled copy produces a deterministic center. -/ +lemma concentration_center {R : Type uR} [MeasurableSpace R] {ν : Measure R} + [IsProbabilityMeasure ν] {z : R → ℝ} (hz : Measurable z) {r q : ℝ} + (h : (ν.prod ν).real {v | r < |z v.1 - z v.2|} < q) : + ∃ c : ℝ, ν.real {v | r < |z v - c|} < q := by + let S : Set (R × R) := {v | r < |z v.1 - z v.2|} + have hS : MeasurableSet S := measurableSet_lt measurable_const + ((hz.comp measurable_fst).sub (hz.comp measurable_snd)).abs + have hi : Integrable (S.indicator (1 : R × R → ℝ)) (ν.prod ν) := + (integrable_const 1).indicator hS + have hinner (y : R) : (∫ x, S.indicator (1 : R × R → ℝ) (x, y) ∂ν) = + ν.real {x | r < |z x - z y|} := by + have heq : (fun x => S.indicator (1 : R × R → ℝ) (x, y)) = + {x | r < |z x - z y|}.indicator (1 : R → ℝ) := by + funext x + simp [S, Set.indicator_apply] + rw [heq, integral_indicator_one (measurableSet_lt measurable_const (hz.sub_const (z y)).abs)] + have htotal : (ν.prod ν).real S = ∫ y, ν.real {x | r < |z x - z y|} ∂ν := by + rw [← integral_indicator_one hS, integral_prod_symm _ hi] + simp_rw [hinner] + by_contra hn + push Not at hn + have hint : Integrable (fun y => ν.real {x | r < |z x - z y|}) ν := by + simpa only [hinner] using hi.integral_prod_right + have hq := integral_mono (integrable_const q) hint (fun y => hn (z y)) + simp only [integral_const, probReal_univ, one_smul] at hq + rw [← htotal] at hq + exact (not_lt_of_ge hq) h + +lemma diffRowSum_prod_tail (p : ℝ) (a : ι → ℝ) (r : ℝ) : + ((cubeMeasure ι).prod (cubeMeasure ι)).real {v | r < |rowSum p a v.1 - rowSum p a v.2|} = + (pairCubeMeasure ι).real {v | r < |diffRowSum p a v|} := by + let e := MeasurableEquiv.arrowProdEquivProdArrow unitInterval unitInterval ι + have he : MeasurePreserving e (pairCubeMeasure ι) ((cubeMeasure ι).prod (cubeMeasure ι)) := + measurePreserving_arrowProdEquivProdArrow _ _ _ _ _ + have heq := he.measure_preimage (s := {v | r < |rowSum p a v.1 - rowSum p a v.2|}) (measurableSet_lt measurable_const + (((measurable_rowSum p a).comp measurable_fst).sub + ((measurable_rowSum p a).comp measurable_snd)).abs).nullMeasurableSet + have hset : e ⁻¹' {v | r < |rowSum p a v.1 - rowSum p a v.2|} = + {v | r < |diffRowSum p a v|} := by + ext v + change (r < |rowSum p a (fun j => (v j).1) - rowSum p a (fun j => (v j).2)|) ↔ _ + simp [rowSum, diffRowSum, difference, Finset.sum_sub_distrib, mul_sub] + simp only [measureReal_def, ← heq, hset] + +lemma rowSum_concentration {p r q : ℝ} (hp : 1 < p) (hpmax : p ≤ 3/2) + (hr : 0 < r) (hpq : 10 * (108 * scale p / r) ^ p < q) + (a : ι → ℝ) (ha : coefficientNorm p a ≤ 108) : + ∃ c : ℝ, (cubeMeasure ι).real {v | r < |rowSum p a v - c|} < q := by + apply concentration_center (measurable_rowSum p a) + rw [diffRowSum_prod_tail] + apply lt_of_le_of_lt (diffRowSum_tail hp hpmax a hr) + apply lt_of_le_of_lt _ hpq + apply mul_le_mul_of_nonneg_left _ (by norm_num) + apply Real.rpow_le_rpow + · exact div_nonneg (mul_nonneg (scale_pos hp).le (coefficientNorm_nonneg p a)) hr.le + · apply div_le_div_of_nonneg_right _ hr.le + nlinarith [scale_pos hp] + · linarith + +lemma abs_add_lower (a b : ℝ) : |a| + |b| - 2 * min |a| |b| ≤ |a + b| := by + have h₁ : |a| ≤ |a + b| + |b| := by + simpa only [Real.norm_eq_abs, add_neg_cancel_right, abs_neg] using (norm_add_le (a + b) (-b)) + have h₂ : |b| ≤ |a| + |a + b| := by + simpa only [Real.norm_eq_abs, neg_add_cancel_left, abs_neg] using (norm_add_le (-a) (a + b)) + rcases le_total |a| |b| with h | h + · rw [min_eq_left h]; linarith + · rw [min_eq_right h]; linarith + +end ProductModels +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/Daugavet/WholeBallConcentration.lean b/lean/OAI/Analysis/Daugavet/WholeBallConcentration.lean new file mode 100644 index 0000000000000000000000000000000000000000..6414fd4d194d2a4309be8f3453822ba3b24e3830 --- /dev/null +++ b/lean/OAI/Analysis/Daugavet/WholeBallConcentration.lean @@ -0,0 +1,205 @@ +import OAI.Analysis.Daugavet.ProductSeparation + +namespace OAI + +noncomputable section +open MeasureTheory ProbabilityTheory Set Filter +open scoped ENNReal NNReal Topology BigOperators + +universe uB uR uIota uKappa + +namespace ExactModuli.KW + +section ProductModels +variable {κ : Type uKappa} {ι : Type uIota} [Fintype κ] [Fintype ι] +variable {B : Type uB} [MeasurableSpace B] {μ : Measure B} [IsProbabilityMeasure μ] + +lemma whole_ball_estimate {R : Type uR} [MeasurableSpace R] {ν : Measure R} + [IsProbabilityMeasure ν] {g : B × R → ℝ} {ψ U : B → ℝ} + (hg : Integrable g (μ.prod ν)) (hψ : Integrable ψ μ) (hU : Integrable U μ) + (hU0 : ∀ b, 0 ≤ U b) {m r q h : ℝ} (hm : ∫ b, U b ∂μ = m) + (hm0 : 0 ≤ m) (hr : 0 ≤ r) (hq : 0 ≤ q) (hmq : m * q < 1) (hh : 0 < h) + (hg1 : ∫ z, |g z| ∂(μ.prod ν) ≤ 1) + {D : Set R} (hD : MeasurableSet D) (hDprob : 1 - m * q ≤ ν.real D) + (hgood : ∀ b v, v ∈ D → |g (b, v) - ψ b| ≤ r * U b) : + (∫ b, |normalizeFunction μ ψ b| ∂μ) ≤ 1 ∧ + (μ.prod ν).real {z | h < |g z - normalizeFunction μ ψ z.1|} ≤ + m * q + h⁻¹ * (2 * m * r + (1 - m * q)⁻¹ - 1) := by + have hL : 0 < 1 - m * q := sub_pos.mpr hmq + have hDpos := hL.trans_le hDprob + have hN := old_norm_on_good_set hg hψ hU hU0 hm hr hg1 hD hDpos hgood + have hinv : 1 / ν.real D ≤ 1 / (1 - m * q) := one_div_le_one_div_of_le hL hDprob + have hR : 1 ≤ r * m + (1 - m * q)⁻¹ := by + have hinv1 : 1 ≤ (1 - m * q)⁻¹ := by + apply (one_le_inv₀ hL).mpr + nlinarith + nlinarith + have hNb : (∫ b, |ψ b| ∂μ) ≤ r * m + (1 - m * q)⁻¹ := by + simp only [one_div] at hinv hN + linarith + obtain ⟨hnorm, hcost⟩ := normalizeFunction_bounds hψ hR hNb + refine ⟨hnorm, ?_⟩ + let ψ₀ := normalizeFunction μ ψ + have hψ₀ : Integrable ψ₀ μ := integrable_normalizeFunction hψ + let f : B × R → ℝ := fun z => |g z - ψ₀ z.1| + let bnd : B × R → ℝ := fun z => r * U z.1 + |ψ z.1 - ψ₀ z.1| + have hψpull : Integrable (fun z : B × R => ψ₀ z.1) (μ.prod ν) := + (measurePreserving_fst.integrable_comp hψ₀.aestronglyMeasurable).mpr hψ₀ + have hf : Integrable f (μ.prod ν) := (hg.sub hψpull).abs + have hbi : Integrable bnd (μ.prod ν) := + ((measurePreserving_fst.integrable_comp hU.aestronglyMeasurable).mpr hU |>.const_mul r).add + ((measurePreserving_fst.integrable_comp (hψ.sub hψ₀).abs.aestronglyMeasurable).mpr (hψ.sub hψ₀).abs) + have hbint : (∫ z, bnd z ∂(μ.prod ν)) ≤ 2 * m * r + (1 - m * q)⁻¹ - 1 := by + dsimp [bnd] + rw [integral_add (f := fun z : B × R => r * U z.1) + (g := fun z => |ψ z.1 - ψ₀ z.1|) + (((measurePreserving_fst.integrable_comp hU.aestronglyMeasurable).mpr hU).const_mul r) + ((measurePreserving_fst.integrable_comp (hψ.sub hψ₀).abs.aestronglyMeasurable).mpr (hψ.sub hψ₀).abs), + integral_const_mul, mp_integral measurePreserving_fst hU.aestronglyMeasurable, hm, + mp_integral (g := fun b => |ψ b - ψ₀ b|) measurePreserving_fst (hψ.sub hψ₀).abs.aestronglyMeasurable] + dsimp [ψ₀] at * + linarith + have hmark := restricted_markov hf hbi (fun z => abs_nonneg _) + (fun z => add_nonneg (mul_nonneg hr (hU0 _)) (abs_nonneg _)) + (hD.preimage measurable_snd) (fun z hz => by + dsimp [f, bnd] + exact (abs_sub_le (g z) (ψ z.1) (ψ₀ z.1)).trans + (add_le_add (hgood z.1 z.2 hz) le_rfl)) hh + have hcompl : (μ.prod ν).real (Prod.snd ⁻¹' D)ᶜ ≤ m * q := by + rw [← Set.preimage_compl] + have heq := (measurePreserving_snd : MeasurePreserving (@Prod.snd B R) (μ.prod ν) ν).measure_preimage hD.compl.nullMeasurableSet + rw [measureReal_def, heq, ← measureReal_def, probReal_compl_eq_one_sub hD] + linarith + apply hmark.trans + have hdiv := div_le_div_of_nonneg_right hbint hh.le + apply add_le_add hcompl + simpa only [div_eq_mul_inv, mul_comm] using hdiv + +def oldCombination (x : B → ℝ) (u : κ → B → ℝ) (c : κ → ℝ) (b : B) : ℝ := + x b + ∑ k, c k * u k b + +omit [IsProbabilityMeasure μ] in +lemma integrable_oldCombination [IsProbabilityMeasure μ] {x : B → ℝ} {u : κ → B → ℝ} + (hx : Integrable x μ) (hu : ∀ k, Integrable (u k) μ) (c : κ → ℝ) : + Integrable (oldCombination x u c) μ := by + exact hx.add (integrable_finsetSum _ (fun k _ => (hu k).const_mul (c k))) + +/-- Whole-ball approximation for arbitrary coefficients, after fixing the multiplier law, + and before choosing the number of copies. -/ +theorem whole_ball_approximation {p r q h : ℝ} (hp : 1 < p) (hpmax : p ≤ 3/2) + (hr : 0 < r) (hq : 0 < q) (hh : 0 < h) + (hmq : (Fintype.card κ : ℝ) * q < 1) + (herr : (Fintype.card κ : ℝ) * q + h⁻¹ * + (2 * (Fintype.card κ : ℝ) * r + (1 - (Fintype.card κ : ℝ) * q)⁻¹ - 1) < h) + (hpq : 10 * (108 * scale p / r) ^ p < q) + {x : B → ℝ} {u : κ → B → ℝ} (hx : Integrable x μ) (hu : ∀ k, Integrable (u k) μ) + (hun : ∀ k, ∫ b, |u k b| ∂μ = 1) (a : κ → ι → ℝ) + (hg : ∫ z, |enlargedFunction p x u a z| ∂(μ.prod (arrayMeasure κ ι)) ≤ 1) : + ∃ c : κ → ℝ, + (∫ b, |normalizeFunction μ (oldCombination x u c) b| ∂μ) ≤ 1 ∧ + (μ.prod (arrayMeasure κ ι)).real + {z | h < |enlargedFunction p x u a z - normalizeFunction μ (oldCombination x u c) z.1|} < h := by + classical + have hcoeff : ∀ k, coefficientNorm p (a k) ≤ 108 := coefficient_bound_108 hp hpmax hx hu hun a hg + choose c hc using (fun k => rowSum_concentration hp hpmax hr hpq (a k) (hcoeff k)) + let D : Set (κ → cube ι) := ⋂ k, {v | |rowSum p (a k) (v k) - c k| ≤ r} + have hD : MeasurableSet D := MeasurableSet.iInter (fun k => measurableSet_le + (((measurable_rowSum p (a k)).comp (measurable_pi_apply k)).sub_const (c k)).abs measurable_const) + have htail (k : κ) : (arrayMeasure κ ι).real {v | r < |rowSum p (a k) (v k) - c k|} < q := by + have he := (measurePreserving_eval (fun _ : κ => cubeMeasure ι) k).measureReal_preimage + (measurableSet_lt (measurable_const (a := r)) ((measurable_rowSum p (a k)).sub_const (c k)).abs).nullMeasurableSet + simpa only [Set.preimage_ofPred_eq] using he.trans_lt (hc k) + have hDprob : 1 - (Fintype.card κ : ℝ) * q ≤ (arrayMeasure κ ι).real D := by + have heq : Dᶜ = ⋃ k, {v | r < |rowSum p (a k) (v k) - c k|} := by + ext v + simp only [D, Set.mem_compl_iff, Set.mem_iInter, Set.mem_ofPred_eq, Set.mem_iUnion, + not_forall, not_le] + have hb := measureReal_iUnion_fintype_le (μ := arrayMeasure κ ι) + (fun k => {v | r < |rowSum p (a k) (v k) - c k|}) + have hb' := hb.trans (Finset.sum_le_sum (fun k _ => (htail k).le)) + rw [← heq, probReal_compl_eq_one_sub hD] at hb' + simp only [Finset.sum_const, Finset.card_univ, nsmul_eq_mul] at hb' + linarith + let U : B → ℝ := fun b => ∑ k, |u k b| + have hU : Integrable U μ := integrable_finsetSum _ (fun k _ => (hu k).abs) + have hU0 : ∀ b, 0 ≤ U b := fun b => Finset.sum_nonneg (fun k _ => abs_nonneg _) + have hUm : (∫ b, U b ∂μ) = (Fintype.card κ : ℝ) := by + rw [integral_finsetSum _ (fun k _ => (hu k).abs)] + simp only [hun, Finset.sum_const, Finset.card_univ, nsmul_eq_mul, mul_one] + have hgood (b : B) (v : κ → cube ι) (hv : v ∈ D) : + |enlargedFunction p x u a (b, v) - oldCombination x u c b| ≤ r * U b := by + have heq : enlargedFunction p x u a (b, v) - oldCombination x u c b = + ∑ k, u k b * (rowSum p (a k) (v k) - c k) := by + simp only [enlargedFunction, oldCombination, add_sub_add_left_eq_sub, + mul_sub, Finset.sum_sub_distrib] + congr 1 + apply Finset.sum_congr rfl + intro k _ + ring + rw [heq] + calc + _ ≤ ∑ k, |u k b * (rowSum p (a k) (v k) - c k)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ ∑ k, |u k b| * r := Finset.sum_le_sum (fun k _ => by + rw [abs_mul] + exact mul_le_mul_of_nonneg_left (Set.mem_iInter.mp hv k) (abs_nonneg _)) + _ = r * U b := by dsimp [U]; rw [← Finset.sum_mul]; ring + obtain ⟨hn, ht⟩ := whole_ball_estimate (integrable_enlargedFunction hp hx hu a) + (integrable_oldCombination hx hu c) hU hU0 hUm (by positivity : (0:ℝ) ≤ Fintype.card κ) + hr.le hq.le hmq hh hg hD hDprob hgood + exact ⟨c, hn, ht.trans_lt herr⟩ + +lemma enlargement_parameters {m h : ℝ} (_hm : 0 < m) (hh : 0 < h) (_hh1 : h < 1) : + ∃ c r q p : ℝ, 0 < c ∧ c < h / 4 ∧ 0 < r ∧ 0 < q ∧ 1 < p ∧ p ≤ 3/2 ∧ + m * q < 1 ∧ m * q + h⁻¹ * (2 * m * r + (1 - m * q)⁻¹ - 1) < h ∧ + scale p < c ∧ 2 * ((scale p / c) ^ p + c) < h ∧ 10 * (108 * scale p / r) ^ p < q := by + let c := h / 8 + have hc : 0 < c := by dsimp [c]; positivity + have hc4 : c < h / 4 := by dsimp [c]; linarith + have hc2 : 2 * c < h := by dsimp [c]; linarith + let err := fun v : ℝ => m * v + h⁻¹ * (2 * m * v + (1 - m * v)⁻¹ - 1) + have herrc : ContinuousAt err 0 := by + dsimp [err] + fun_prop (disch := norm_num) + have herr0 : err 0 = 0 := by simp [err] + have hevent : ∀ᶠ v in 𝓝 (0 : ℝ), m * v < 1 ∧ err v < h := by + apply Filter.Eventually.and + · exact (show ContinuousAt (fun v : ℝ => m * v) 0 by fun_prop).tendsto + |>.eventually (Iio_mem_nhds (by norm_num)) + · exact herrc.tendsto.eventually (Iio_mem_nhds (by simpa only [herr0] using hh)) + obtain ⟨δ, hδ, hball⟩ := Metric.eventually_nhds_iff.mp hevent + let r := δ / 2 + have hr : 0 < r := by dsimp [r]; positivity + have hrd : dist r 0 < δ := by simpa only [Real.dist_eq, sub_zero, abs_of_pos hr] using (show r < δ by dsimp [r]; linarith) + obtain ⟨hmr, herr⟩ := hball hrd + have hs : ContinuousAt scale 1 := by unfold scale; fun_prop (disch := norm_num) + have hs1 : scale 1 = 0 := by norm_num [scale] + have hpowc : ContinuousAt (fun p : ℝ => (scale p / c) ^ p) 1 := by + apply ContinuousAt.rpow (hs.div_const c) continuousAt_id + right; norm_num + have hpowr : ContinuousAt (fun p : ℝ => (108 * scale p / r) ^ p) 1 := by + apply ContinuousAt.rpow ((hs.const_mul 108).div_const r) continuousAt_id + right; norm_num + have hpEv : ∀ᶠ p in 𝓝 (1 : ℝ), p < 3/2 ∧ scale p < c ∧ + 2 * ((scale p / c) ^ p + c) < h ∧ 10 * (108 * scale p / r) ^ p < r := by + filter_upwards [eventually_lt_nhds (by norm_num : (1 : ℝ) < 3/2), + hs.tendsto.eventually (Iio_mem_nhds (by simpa only [hs1] using hc)), + ((hpowc.add_const c).const_mul 2).tendsto.eventually (Iio_mem_nhds (by simpa [hs1] using hc2)), + (hpowr.const_mul 10).tendsto.eventually (Iio_mem_nhds (by simpa [hs1] using hr))] + with p hp₁ hp₂ hp₃ hp₄ + exact ⟨hp₁, hp₂, hp₃, hp₄⟩ + obtain ⟨ε, hε, hpball⟩ := Metric.eventually_nhds_iff.mp hpEv + let p := 1 + ε / 2 + have hp : 1 < p := by dsimp [p]; linarith + have hpd : dist p 1 < ε := by + rw [Real.dist_eq, abs_of_pos (sub_pos.mpr hp)] + dsimp [p]; linarith + obtain ⟨hpmax, hpc, hpc2, hpq⟩ := hpball hpd + exact ⟨c, r, r, p, hc, hc4, hr, hr, hp, hpmax.le, hmr, herr, hpc, hpc2, hpq⟩ + +end ProductModels + +end ExactModuli.KW + +end + +end OAI diff --git a/lean/OAI/Analysis/DiagonalForms.lean b/lean/OAI/Analysis/DiagonalForms.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c7ae09623cb72610ed34ef17755854f5048ef1d --- /dev/null +++ b/lean/OAI/Analysis/DiagonalForms.lean @@ -0,0 +1,908 @@ +import OAI.InformationTheory.PhotonNumber.Functions + +namespace OAI + +noncomputable section + +section +open scoped BigOperators ComplexConjugate ENNReal Topology +open MeasureTheory +open scoped ComplexConjugate +open scoped BigOperators ComplexConjugate + +namespace DiagonalForms.System +def logMean (X Y : ℝ) : ℝ := if X = Y then X else (Y-X) / (Real.log Y-Real.log X) +end DiagonalForms.System + +namespace QuantumCalculus +theorem integral_exp_affine_log {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : + (∫ s in (0 : ℝ)..1, Real.exp ((1-s)*Real.log p+s*Real.log q)) = + DiagonalForms.System.logMean p q := by + by_cases he : p = q + · subst q + have hh (s : ℝ) : (1-s)*Real.log p+s*Real.log p = Real.log p := by ring + simp_rw [hh, Real.exp_log hp] + simp [DiagonalForms.System.logMean] + · have hd : Real.log q - Real.log p ≠ 0 := by + intro h + exact he ((Real.log_injOn_pos hp hq) (sub_eq_zero.mp h).symm) + conv_lhs => arg 1; ext s + rw [show (1-s)*Real.log p+s*Real.log q = + (Real.log q-Real.log p)*s+Real.log p by ring] + rw [intervalIntegral.integral_comp_mul_add _ hd] + simp only [mul_zero, zero_add, mul_one, sub_add_cancel, integral_exp, + Real.exp_log hp, Real.exp_log hq] + simp [DiagonalForms.System.logMean, he, div_eq_mul_inv, mul_comm] +end QuantumCalculus + +namespace DiagonalForms.System +@[simp] theorem logMean_self (p : ℝ) : logMean p p = p := by simp [logMean] +theorem logMean_symm (p q : ℝ) : logMean p q = logMean q p := by + by_cases he : p = q + · subst q; rfl + · rw [logMean, ite_eq_right he, logMean, ite_eq_right (Ne.symm he)] + rw [show p-q = -(q-p) by ring, show Real.log p-Real.log q = -(Real.log q-Real.log p) by ring] + simp only [neg_div_neg_eq] +theorem logMean_pos {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : 0 < logMean p q := by + rcases lt_trichotomy p q with h | h | h + · rw [logMean, ite_eq_right h.ne] + exact div_pos (sub_pos.mpr h) (sub_pos.mpr (Real.strictMonoOn_log hp hq h)) + · simp [h, hq] + · rw [logMean_symm, logMean, ite_eq_right h.ne] + exact div_pos (sub_pos.mpr h) (sub_pos.mpr (Real.strictMonoOn_log hq hp h)) +theorem logMean_le_arithmetic {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : logMean p q ≤ (p+q)/2 := by + rw [← QuantumCalculus.integral_exp_affine_log hp hq] + calc + _ ≤ ∫ s in (0:ℝ)..1, ((1-s)*p+s*q) := by + apply intervalIntegral.integral_mono_on (by norm_num) + · exact Continuous.intervalIntegrable (by fun_prop) _ _ + · exact Continuous.intervalIntegrable (by fun_prop) _ _ + intro s hs + have hh := convexOn_exp.2 (Set.mem_univ (Real.log p)) (Set.mem_univ (Real.log q)) + (sub_nonneg.mpr hs.2) hs.1 (by ring : (1-s)+s=1) + simpa only [smul_eq_mul, Real.exp_log hp, Real.exp_log hq] using hh + _ = (p+q)/2 := by + rw [intervalIntegral.integral_add (by exact Continuous.intervalIntegrable (by fun_prop) _ _) (by exact Continuous.intervalIntegrable (by fun_prop) _ _), + intervalIntegral.integral_mul_const, intervalIntegral.integral_mul_const, + intervalIntegral.integral_sub (by exact Continuous.intervalIntegrable (by fun_prop) _ _) (by exact Continuous.intervalIntegrable (by fun_prop) _ _)] + simp + ring +end DiagonalForms.System + +namespace DiagonalForms.System +open EntropyPhotonNumber + +theorem logMean_exp_mul_f (u v : ℝ) : + logMean (Real.exp u) (Real.exp v)*f ((u-v)/2)=Real.exp ((u+v)/2) := by + by_cases he : u=v + · subst v + simp + · have he' : Real.exp u ≠ Real.exp v := fun h => he (Real.exp_injective h) + have hx : (u-v)/2 ≠ 0 := div_ne_zero (sub_ne_zero.mpr he) (by norm_num) + have hd : v-u ≠ 0 := sub_ne_zero.mpr (Ne.symm he) + have hu : Real.exp u=Real.exp ((u+v)/2)*Real.exp ((u-v)/2) := by + rw [← Real.exp_add] + congr 1 + ring + have hv : Real.exp v=Real.exp ((u+v)/2)*Real.exp (-((u-v)/2)) := by + rw [← Real.exp_add] + congr 1 + ring + rw [logMean, ite_eq_right he', Real.log_exp, Real.log_exp, f_of_ne_zero hx, + hu, hv, Real.sinh_eq] + have hsh : Real.exp ((u-v)/2)-Real.exp (-((u-v)/2)) ≠ 0 := by + intro hh + have hh' := Real.exp_injective (sub_eq_zero.mp hh) + apply hx + linarith + field_simp + ring + +theorem logMean_mul_f {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : + logMean p q*f ((Real.log p-Real.log q)/2)=Real.exp ((Real.log p+Real.log q)/2) := by + simpa only [Real.exp_log hp, Real.exp_log hq] using logMean_exp_mul_f (Real.log p) (Real.log q) + +theorem logMean_arithmetic_plus {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : + logMean p q*f ((Real.log p-Real.log q)/2)*Real.exp ((Real.log p-Real.log q)/2)=p := by + rw [logMean_mul_f hp hq, ← Real.exp_add] + convert Real.exp_log hp using 1 + congr 1 + ring + +theorem logMean_arithmetic_minus {p q : ℝ} (hp : 0 < p) (hq : 0 < q) : + logMean p q*f ((Real.log p-Real.log q)/2)*Real.exp (-((Real.log p-Real.log q)/2))=q := by + rw [logMean_mul_f hp hq, ← Real.exp_add] + convert Real.exp_log hq using 1 + congr 1 + ring + +theorem logMean_product {a b c d : ℝ} (ha : 0 he (mul_left_cancel₀ hc.ne' h) + rw [logMean, ite_eq_right he', Real.log_mul hc.ne' hq.ne', Real.log_mul hc.ne' hp.ne', + logMean, ite_eq_right he] + ring + +theorem logMean_mono {p q a b : ℝ} (hp : 0 Complex.normSq (z.val i)) + finite_values : ∀ z : tests, ∃ s : Finset P, ∀ i, z.val i ≠ 0 → sourceParam i ∈ s + multiplier_mem : ∀ (z : tests) (w : P → ℂ), (fun i => w (sourceParam i) * z.val i) ∈ tests + +namespace System + +variable {P I J : Type*} (D : System P I J) + +def sourceForm (w : P → ℝ) (z : D.tests) : ℝ := + ∑' i, w (D.sourceParam i) * Complex.normSq (z.val i) + +def Comparison (w : P → ℝ) : Prop := + ∀ (z : D.tests) (s : Finset J), + ∑ j ∈ s, w (D.targetParam j) * Complex.normSq (D.map z j) ≤ D.sourceForm w z + +def multiplier (w : P → ℝ) (z : D.tests) : D.tests := + ⟨fun i => (w (D.sourceParam i) : ℂ) * z.val i, D.multiplier_mem z (fun p => (w p : ℂ))⟩ + +@[simp] theorem multiplier_apply (w : P → ℝ) (z : D.tests) (i : I) : + (D.multiplier w z).val i = (w (D.sourceParam i) : ℂ) * z.val i := rfl + +theorem source_summable (w : P → ℝ) (z : D.tests) : + Summable (fun i => w (D.sourceParam i) * Complex.normSq (z.val i)) := by + classical + obtain ⟨s, hs⟩ := D.finite_values z + let B : ℝ := ∑ p ∈ s, |w p| + apply Summable.of_norm_bounded ((D.mass_summable z).mul_left B) + intro i + rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg (Complex.normSq_nonneg _)] + by_cases hz : z.val i = 0 + · simp [hz] + · exact mul_le_mul_of_nonneg_right + (Finset.single_le_sum (fun p _ => abs_nonneg (w p)) (hs i hz)) (Complex.normSq_nonneg _) + +theorem comparison_add {v w : P → ℝ} (hv : D.Comparison v) (hw : D.Comparison w) : + D.Comparison (fun p => v p + w p) := by + intro z s + simp only [add_mul, Finset.sum_add_distrib] + simp only [sourceForm, add_mul] + rw [(D.source_summable v z).tsum_add (D.source_summable w z)] + exact add_le_add (hv z s) (hw z s) + +theorem comparison_smul {w : P → ℝ} (hw : D.Comparison w) {a : ℝ} (ha : 0 ≤ a) : + D.Comparison (fun p => a * w p) := by + intro z s + simp only [mul_assoc, ← Finset.mul_sum] + simp only [sourceForm, mul_assoc, tsum_mul_left] + exact mul_le_mul_of_nonneg_left (hw z s) ha + +def parallel (x y : ℝ) : ℝ := x * y / (x + y) + +theorem parallel_pos {x y : ℝ} (hx : 0 < x) (hy : 0 < y) : 0 < parallel x y := by + unfold parallel + positivity + +theorem parallel_norm_bound {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (u v : ℂ) : + parallel x y * Complex.normSq (u + v) ≤ x * Complex.normSq u + y * Complex.normSq v := by + unfold parallel + rw [div_mul_eq_mul_div, div_le_iff₀ (add_pos hx hy)] + simp only [Complex.normSq_apply, Complex.add_re, Complex.add_im] + nlinarith [sq_nonneg (x * u.re - y * v.re), sq_nonneg (x * u.im - y * v.im)] + +theorem parallel_minimum {x y : ℝ} (hx : 0 < x) (hy : 0 < y) (z : ℂ) : + x * Complex.normSq (((y / (x + y) : ℝ) : ℂ) * z) + + y * Complex.normSq (((x / (x + y) : ℝ) : ℂ) * z) = parallel x y * Complex.normSq z := by + simp only [Complex.normSq_mul, Complex.normSq_ofReal] + unfold parallel + field_simp [ne_of_gt (add_pos hx hy)] + ring + +theorem comparison_parallel {v w : P → ℝ} (hv : D.Comparison v) (hw : D.Comparison w) + (hvp : ∀ p, 0 < v p) (hwp : ∀ p, 0 < w p) : + D.Comparison (fun p => parallel (v p) (w p)) := by + intro z s + let u := D.multiplier (fun p => w p / (v p + w p)) z + let t := D.multiplier (fun p => v p / (v p + w p)) z + have hut : u + t = z := by + apply Subtype.ext + funext i + simp only [u, t, Submodule.coe_add, Pi.add_apply, multiplier_apply, + ← add_mul, ← Complex.ofReal_add] + rw [← add_div, add_comm (w _), div_self (ne_of_gt (add_pos (hvp _) (hwp _)))] + simp + have hmap (j : J) : D.map u j + D.map t j = D.map z j := by + rw [← Pi.add_apply, ← map_add, hut] + calc + _ ≤ ∑ j ∈ s, (v (D.targetParam j) * Complex.normSq (D.map u j) + + w (D.targetParam j) * Complex.normSq (D.map t j)) := by + apply Finset.sum_le_sum + intro j _ + rw [← hmap j] + exact parallel_norm_bound (hvp _) (hwp _) _ _ + _ = (∑ j ∈ s, v (D.targetParam j) * Complex.normSq (D.map u j)) + + ∑ j ∈ s, w (D.targetParam j) * Complex.normSq (D.map t j) := Finset.sum_add_distrib + _ ≤ D.sourceForm v u + D.sourceForm w t := add_le_add (hv u s) (hw t s) + _ = D.sourceForm (fun p => parallel (v p) (w p)) z := by + simp only [sourceForm] + rw [← (D.source_summable v u).tsum_add (D.source_summable w t)] + apply tsum_congr + intro i + exact parallel_minimum (hvp _) (hwp _) (z.val i) + +theorem sourceForm_finite (z : D.tests) : + ∃ (s : Finset P) (c : P → ℝ), ∀ w : P → ℝ, + D.sourceForm w z = ∑ p ∈ s, w p * c p := by + classical + obtain ⟨s, hs⟩ := D.finite_values z + let c (p : P) : ℝ := ∑' i, if p = D.sourceParam i then Complex.normSq (z.val i) else 0 + refine ⟨s, c, ?_⟩ + intro w + have hsum (p : P) : Summable (fun i => if p = D.sourceParam i then Complex.normSq (z.val i) else 0) := by + apply Summable.of_nonneg_of_le _ _ (D.mass_summable z) + · intro i + split_ifs + · exact Complex.normSq_nonneg _ + · exact le_rfl + · intro i + split_ifs + · exact le_rfl + · exact Complex.normSq_nonneg _ + simp only [c, ← tsum_mul_left] + rw [← Summable.tsum_finsetSum (fun p _ => (hsum p).mul_left (w p))] + apply tsum_congr + intro i + simp only [mul_ite, mul_zero] + rw [Finset.sum_ite_eq'] + by_cases hz : z.val i = 0 + · simp [hz] + · simp [hs i hz] + +theorem sourceForm_tendsto {α : Type*} {l : Filter α} {w : α → P → ℝ} {v : P → ℝ} + (h : ∀ p, Tendsto (fun a => w a p) l (𝓝 (v p))) (z : D.tests) : + Tendsto (fun a => D.sourceForm (w a) z) l (𝓝 (D.sourceForm v z)) := by + obtain ⟨s, c, hc⟩ := D.sourceForm_finite z + simp_rw [hc] + exact tendsto_finsetSum s (fun p _ => (h p).mul_const (c p)) + +theorem comparison_tendsto {α : Type*} {l : Filter α} [NeBot l] + {w : α → P → ℝ} {v : P → ℝ} (hw : ∀ a, D.Comparison (w a)) + (hlim : ∀ p, Tendsto (fun a => w a p) l (𝓝 (v p))) : D.Comparison v := by + intro z s + exact le_of_tendsto_of_tendsto + (tendsto_finsetSum s (fun j _ => (hlim _).mul_const _)) + (D.sourceForm_tendsto hlim z) (Eventually.of_forall (fun a => hw a z s)) + +theorem comparison_zero : D.Comparison (fun _ => 0) := by + intro z s + simp [sourceForm] + +theorem comparison_finsetSum {K : Type*} (s : Finset K) {w : K → P → ℝ} + (hw : ∀ k ∈ s, D.Comparison (w k)) : D.Comparison (fun p => ∑ k ∈ s, w k p) := by + classical + induction s using Finset.induction_on with + | empty => simpa using D.comparison_zero + | @insert k s hk ih => + simp only [Finset.forall_mem_insert] at hw + simpa only [Finset.sum_insert hk] using D.comparison_add hw.1 (ih hw.2) + + +theorem comparison_tsum {w : P → ℝ} (hw : D.Comparison w) (hp : ∀ p, 0 ≤ w p) + (z : D.tests) : + Summable (fun j => w (D.targetParam j) * Complex.normSq (D.map z j)) ∧ + (∑' j, w (D.targetParam j) * Complex.normSq (D.map z j)) ≤ D.sourceForm w z := by + have hx (j : J) : 0 ≤ w (D.targetParam j) * Complex.normSq (D.map z j) := + mul_nonneg (hp _) (Complex.normSq_nonneg _) + exact ⟨summable_of_sum_le hx (hw z), Real.tsum_le_of_sum_le hx (hw z)⟩ + +end System + +end DiagonalForms + +namespace DiagonalForms.System +open MeasureTheory +variable {P I J : Type*} (D : DiagonalForms.System P I J) + +theorem parallel_inv {x y : ℝ} (hx : 0 < x) (hy : 0 < y) : + parallel x⁻¹ y⁻¹ = (x + y)⁻¹ := by + unfold parallel + field_simp + ring + +theorem comparison_harmonic_sum_pos {K : Type*} (s : Finset K) (hs : s.Nonempty) + {w : K → P → ℝ} {c : K → ℝ} + (hc : ∀ k ∈ s, 0 < c k) (hwp : ∀ k ∈ s, ∀ p, 0 < w k p) + (hw : ∀ k ∈ s, D.Comparison (w k)) : + D.Comparison (fun p => (∑ k ∈ s, c k / w k p)⁻¹) := by + classical + induction s using Finset.induction_on with + | empty => exact (Finset.not_nonempty_empty hs).elim + | @insert k s hk ih => + have hkpos := hc k (Finset.mem_insert_self k s) + have hkw := hwp k (Finset.mem_insert_self k s) + have hkc := hw k (Finset.mem_insert_self k s) + have hcomp : D.Comparison (fun p => (c k / w k p)⁻¹) := by + simpa only [div_eq_mul_inv, mul_inv_rev, inv_inv, mul_comm] using + D.comparison_smul hkc (le_of_lt (inv_pos.mpr hkpos)) + by_cases he : s.Nonempty + · have hcs : ∀ j ∈ s, 0 < c j := fun j hj => hc j (Finset.mem_insert_of_mem hj) + have hws : ∀ j ∈ s, ∀ p, 0 < w j p := fun j hj => hwp j (Finset.mem_insert_of_mem hj) + have hcps : ∀ j ∈ s, D.Comparison (w j) := fun j hj => hw j (Finset.mem_insert_of_mem hj) + have hsum (p : P) : 0 < ∑ j ∈ s, c j / w j p := + Finset.sum_pos (fun j hj => div_pos (hcs j hj) (hws j hj p)) he + have hh := D.comparison_parallel hcomp (ih he hcs hws hcps) + (fun p => inv_pos.mpr (div_pos hkpos (hkw p))) + (fun p => inv_pos.mpr (hsum p)) + simpa only [Finset.sum_insert hk, parallel_inv (div_pos hkpos (hkw _)) (hsum _)] using hh + · have hem : s = ∅ := Finset.not_nonempty_iff_eq_empty.mp he + simpa [hem] using hcomp + +theorem comparison_harmonic_sum {K : Type*} (s : Finset K) + {w : K → P → ℝ} {c : K → ℝ} + (hc : ∀ k ∈ s, 0 ≤ c k) (hex : ∃ k ∈ s, 0 < c k) + (hwp : ∀ k ∈ s, ∀ p, 0 < w k p) (hw : ∀ k ∈ s, D.Comparison (w k)) : + D.Comparison (fun p => (∑ k ∈ s, c k / w k p)⁻¹) := by + classical + let t := s.filter (fun k => 0 < c k) + have ht : t.Nonempty := by + obtain ⟨k, hk, hck⟩ := hex + exact ⟨k, Finset.mem_filter.mpr ⟨hk, hck⟩⟩ + have he (p : P) : (∑ k ∈ t, c k / w k p) = ∑ k ∈ s, c k / w k p := by + apply Finset.sum_subset (Finset.filter_subset _ _) + intro k hk hkt + have hck : c k = 0 := by + have : ¬ 0 < c k := fun h => hkt (Finset.mem_filter.mpr ⟨hk, h⟩) + exact le_antisymm (le_of_not_gt this) (hc k hk) + simp [hck] + have hh := D.comparison_harmonic_sum_pos t ht + (fun k hk => (Finset.mem_filter.mp hk).2) + (fun k hk => hwp k (Finset.mem_filter.mp hk).1) + (fun k hk => hw k (Finset.mem_filter.mp hk).1) + simpa only [he] using hh + + +theorem integral_comp_simpleFunc {X K : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (f : MeasureTheory.SimpleFunc X K) (g : K → ℝ) : + (∫ x, g (f x) ∂μ) = ∑ k ∈ f.range, μ.real (f ⁻¹' {k}) * g k := by + classical + have hi (k : K) : Integrable ((f ⁻¹' {k}).indicator (fun _ => g k)) μ := + (integrable_const _).indicator (f.measurableSet_fiber k) + have he (x : X) : g (f x) = ∑ k ∈ f.range, (f ⁻¹' {k}).indicator (fun _ => g k) x := by + simp only [Set.indicator_apply, Set.mem_preimage, Set.mem_singleton_iff] + rw [Finset.sum_ite_eq] + simp only [SimpleFunc.mem_range, Set.mem_range_self, ↓reduceIte] + simp_rw [he] + rw [integral_finsetSum f.range (fun k _ => hi k)] + apply Finset.sum_congr rfl + intro k _ + rw [integral_indicator (f.measurableSet_fiber k), setIntegral_const, smul_eq_mul] + +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory +variable {P I J : Type*} (D : DiagonalForms.System P I J) + +theorem comparison_harmonic_sum_add {K : Type*} (s : Finset K) + {v : P → ℝ} {w : K → P → ℝ} {c : K → ℝ} + (hv : D.Comparison v) (hvp : ∀ p, 0 < v p) + (hc : ∀ k ∈ s, 0 ≤ c k) (hwp : ∀ k ∈ s, ∀ p, 0 < w k p) + (hw : ∀ k ∈ s, D.Comparison (w k)) : + D.Comparison (fun p => ((v p)⁻¹ + ∑ k ∈ s, c k / w k p)⁻¹) := by + classical + induction s using Finset.induction_on with + | empty => simpa using hv + | @insert k s hk ih => + have hcs : ∀ j ∈ s, 0 ≤ c j := fun j hj => hc j (Finset.mem_insert_of_mem hj) + have hws : ∀ j ∈ s, ∀ p, 0 < w j p := fun j hj => hwp j (Finset.mem_insert_of_mem hj) + have hcomp := ih hcs hws (fun j hj => hw j (Finset.mem_insert_of_mem hj)) + have hk0 := hc k (Finset.mem_insert_self k s) + rcases eq_or_lt_of_le hk0 with he | hp + · simpa only [Finset.sum_insert hk, ← he, zero_div, zero_add] using hcomp + · have hsmall := D.comparison_smul (hw k (Finset.mem_insert_self k s)) + (le_of_lt (inv_pos.mpr hp)) + have hsmall' : D.Comparison (fun p => (c k / w k p)⁻¹) := by + simpa only [div_eq_mul_inv, mul_inv_rev, inv_inv, mul_comm] using hsmall + have hsum (p : P) : 0 < (v p)⁻¹ + ∑ j ∈ s, c j / w j p := + add_pos_of_pos_of_nonneg (inv_pos.mpr (hvp p)) + (Finset.sum_nonneg (fun j hj => div_nonneg (hcs j hj) (hws j hj p).le)) + have hkp (p : P) : 0 < c k / w k p := + div_pos hp (hwp k (Finset.mem_insert_self k s) p) + have h := D.comparison_parallel hsmall' hcomp + (fun p => inv_pos.mpr (hkp p)) (fun p => inv_pos.mpr (hsum p)) + simpa only [parallel_inv (hkp _) (hsum _), Finset.sum_insert hk, add_left_comm] using h + +section CompactIntegral +variable {K : Type*} [MetricSpace K] [CompactSpace K] [MeasurableSpace K] [BorelSpace K] + (μ : Measure K) [IsFiniteMeasure μ] (k₀ : K) + +def compactApprox (n : ℕ) : SimpleFunc K K := + SimpleFunc.approxOn id measurable_id Set.univ k₀ (Set.mem_univ _) n + +theorem integral_compactApprox_tendsto {g : K → ℝ} (hg : Continuous g) : + Tendsto (fun n => ∫ k, g (compactApprox k₀ n k) ∂μ) atTop (𝓝 (∫ k, g k ∂μ)) := by + obtain ⟨M, hM⟩ := isCompact_univ.exists_bound_of_continuousOn hg.continuousOn + apply tendsto_integral_of_dominated_convergence (fun _ => M) + · intro n + exact (hg.measurable.comp (compactApprox k₀ n).measurable).aestronglyMeasurable + · exact integrable_const M + · intro n + exact Filter.Eventually.of_forall (fun k => hM _ (Set.mem_univ _)) + · apply Filter.Eventually.of_forall + intro k + apply hg.continuousAt.tendsto.comp + exact SimpleFunc.tendsto_approxOn measurable_id (Set.mem_univ k₀) (by simp) + +include k₀ in +theorem comparison_integral {w : K → P → ℝ} + (hcont : ∀ p, Continuous (fun k => w k p)) (hw : ∀ k, D.Comparison (w k)) : + D.Comparison (fun p => ∫ k, w k p ∂μ) := by + apply D.comparison_tendsto (l := atTop) + (w := fun n p => ∫ k, w (compactApprox k₀ n k) p ∂μ) + · intro n + have he (p : P) := integral_comp_simpleFunc μ (compactApprox k₀ n) (fun k => w k p) + simp_rw [he] + apply D.comparison_finsetSum + intro k _ + exact D.comparison_smul (hw k) ENNReal.toReal_nonneg + · intro p + exact integral_compactApprox_tendsto μ k₀ (hcont p) + +include k₀ in +theorem comparison_inverse_integral_add {v : P → ℝ} {w : K → P → ℝ} + (hv : D.Comparison v) (hvp : ∀ p, 0 < v p) + (hcont : ∀ p, Continuous (fun k => w k p)) (hwp : ∀ k p, 0 < w k p) + (hw : ∀ k, D.Comparison (w k)) : + D.Comparison (fun p => ((v p)⁻¹ + ∫ k, (w k p)⁻¹ ∂μ)⁻¹) := by + apply D.comparison_tendsto (l := atTop) + (w := fun n p => ((v p)⁻¹ + ∫ k, (w (compactApprox k₀ n k) p)⁻¹ ∂μ)⁻¹) + · intro n + have he (p : P) := integral_comp_simpleFunc μ (compactApprox k₀ n) (fun k => (w k p)⁻¹) + simp_rw [he] + simpa only [div_eq_mul_inv, Measure.real] using D.comparison_harmonic_sum_add + (compactApprox k₀ n).range hv hvp (fun _ _ => ENNReal.toReal_nonneg) + (fun k _ => hwp k) (fun k _ => hw k) + · intro p + apply Tendsto.inv₀ + · exact tendsto_const_nhds.add (integral_compactApprox_tendsto μ k₀ + ((hcont p).inv₀ (fun k => (hwp k p).ne'))) + · exact ne_of_gt (add_pos_of_pos_of_nonneg (inv_pos.mpr (hvp p)) + (integral_nonneg (fun k => inv_nonneg.mpr (hwp k p).le))) + +end CompactIntegral +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory +variable {P I J : Type*} (D : DiagonalForms.System P I J) + +theorem comparison_harmonic_sum_nonneg {K : Type*} (s : Finset K) + {w : K → P → ℝ} {c : K → ℝ} + (hc : ∀ k ∈ s, 0 ≤ c k) (hwp : ∀ k ∈ s, ∀ p, 0 < w k p) + (hw : ∀ k ∈ s, D.Comparison (w k)) : + D.Comparison (fun p => (∑ k ∈ s, c k / w k p)⁻¹) := by + classical + by_cases h : ∃ k ∈ s, 0 < c k + · exact D.comparison_harmonic_sum s hc h hwp hw + · have hz : ∀ k ∈ s, c k = 0 := by + intro k hk + exact le_antisymm (le_of_not_gt (fun hh => h ⟨k, hk, hh⟩)) (hc k hk) + have he (p : P) : ∑ k ∈ s, c k / w k p = 0 := by + apply Finset.sum_eq_zero + intro k hk + simp [hz k hk] + simpa only [he, inv_zero] using D.comparison_zero + +theorem comparison_inverse_integral {K : Type*} [MetricSpace K] [CompactSpace K] + [MeasurableSpace K] [BorelSpace K] (μ : Measure K) [IsFiniteMeasure μ] + (k₀ : K) (hμ : μ ≠ 0) {w : K → P → ℝ} + (hcont : ∀ p, Continuous (fun k => w k p)) (hwp : ∀ k p, 0 < w k p) + (hw : ∀ k, D.Comparison (w k)) : + D.Comparison (fun p => (∫ k, (w k p)⁻¹ ∂μ)⁻¹) := by + apply D.comparison_tendsto (l := atTop) + (w := fun n p => (∫ k, (w (compactApprox k₀ n k) p)⁻¹ ∂μ)⁻¹) + · intro n + have he (p : P) := integral_comp_simpleFunc μ (compactApprox k₀ n) (fun k => (w k p)⁻¹) + simp_rw [he] + simpa only [div_eq_mul_inv, Measure.real] using D.comparison_harmonic_sum_nonneg + (compactApprox k₀ n).range (fun _ _ => ENNReal.toReal_nonneg) + (fun k _ => hwp k) (fun k _ => hw k) + · intro p + have hg : Continuous (fun k => (w k p)⁻¹) := + (hcont p).inv₀ (fun k => (hwp k p).ne') + have hs : Function.support (fun k => (w k p)⁻¹) = Set.univ := by + ext k + simp only [Function.mem_support, Set.mem_univ, iff_true] + exact inv_ne_zero (hwp k p).ne' + have hi : 0 < ∫ k, (w k p)⁻¹ ∂μ := by + rw [integral_pos_iff_support_of_nonneg + (fun k => inv_nonneg.mpr (hwp k p).le) + (hg.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace _)), hs] + exact Measure.measure_univ_pos.mpr hμ + exact (integral_compactApprox_tendsto μ k₀ hg).inv₀ hi.ne' + +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory Set +variable {P I J : Type*} (D : DiagonalForms.System P I J) +abbrev UnitInterval := Set.Icc (0 : ℝ) 1 + +theorem integral_unitInterval (f : ℝ → ℝ) : + (∫ t : UnitInterval, f t.val) = ∫ t in (0 : ℝ)..1, f t := by + rw [integral_subtype measurableSet_Icc, integral_Icc_eq_integral_Ioc, + intervalIntegral.integral_of_le (by norm_num)] + +theorem unitInterval_volume : (volume : Measure UnitInterval) Set.univ = 1 := by + simp [UnitInterval] + +theorem affine_pos {X Y : ℝ} (hX : 0 < X) (hY : 0 < Y) (t : UnitInterval) : + 0 < (1 - t.val) * X + t.val * Y := by + rcases t.property.1.eq_or_lt with ht | ht + · simp [← ht, hX] + · exact add_pos_of_nonneg_of_pos + (mul_nonneg (sub_nonneg.mpr t.property.2) hX.le) (mul_pos ht hY) +theorem integral_affine_inv {X Y : ℝ} (hX : 0 < X) (hY : 0 < Y) : + (∫ t : UnitInterval, ((1-t.val)*X+t.val*Y)⁻¹) = (logMean X Y)⁻¹ := by + rw [integral_unitInterval (fun t => ((1-t)*X+t*Y)⁻¹)] + by_cases he : X = Y + · subst Y + simp only [logMean] + conv_lhs => arg 1; ext t; rw [show (1-t)*X+t*X = X by ring] + simp + · have hd : Y-X ≠ 0 := sub_ne_zero.mpr (Ne.symm he) + conv_lhs => arg 1; ext t; rw [show (1-t)*X+t*Y = (Y-X)*t+X by ring] + rw [intervalIntegral.integral_comp_mul_add _ hd] + simp only [mul_zero, zero_add, mul_one, sub_add_cancel] + rw [integral_inv_of_pos hX hY, Real.log_div hY.ne' hX.ne'] + simp [logMean, he, div_eq_mul_inv, mul_comm] + +theorem comparison_logMean {v w : P → ℝ} + (hv : D.Comparison v) (hw : D.Comparison w) + (hvp : ∀ p, 0 < v p) (hwp : ∀ p, 0 < w p) : + D.Comparison (fun p => logMean (v p) (w p)) := by + have ha (t : UnitInterval) : D.Comparison (fun p => (1-t.val)*v p+t.val*w p) := + D.comparison_add (D.comparison_smul hv (sub_nonneg.mpr t.property.2)) + (D.comparison_smul hw t.property.1) + have hc (p : P) : Continuous (fun t : UnitInterval => (1-t.val)*v p+t.val*w p) := by + fun_prop + have hμ : (volume : Measure UnitInterval) ≠ 0 := by + intro h + have h1 := unitInterval_volume + rw [h] at h1 + simp at h1 + have hh := D.comparison_inverse_integral volume ⟨0, by norm_num⟩ hμ hc + (fun t p => affine_pos (hvp p) (hwp p) t) ha + simp_rw [integral_affine_inv (hvp _) (hwp _), inv_inv] at hh + exact hh + +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory Set +variable {P I J : Type*} (D : DiagonalForms.System P I J) + +theorem inverse_logMean_inverse {X Y : ℝ} (hX : 0 < X) (hY : 0 < Y) : + (logMean X⁻¹ Y⁻¹)⁻¹ = X*Y/logMean X Y := by + by_cases he : X = Y + · subst Y + simp [logMean, hX.ne'] + · have he' : X⁻¹ ≠ Y⁻¹ := fun h => he (inv_injective h) + have hd : Y-X ≠ 0 := sub_ne_zero.mpr (Ne.symm he) + have hl : Real.log Y - Real.log X ≠ 0 := by + apply sub_ne_zero.mpr + intro h + apply he + exact (Real.log_injOn_pos hY hX h).symm + simp only [logMean, ite_eq_right he, ite_eq_right he', Real.log_inv] + field_simp + ring + +theorem comparison_dualLogMean {v w : P → ℝ} + (hv : D.Comparison v) (hw : D.Comparison w) + (hvp : ∀ p, 0 < v p) (hwp : ∀ p, 0 < w p) : + D.Comparison (fun p => v p*w p/logMean (v p) (w p)) := by + have ha (t : UnitInterval) : + D.Comparison (fun p => ((1-t.val)/(v p)+t.val/(w p))⁻¹) := by + have hh := D.comparison_harmonic_sum_nonneg (Finset.univ : Finset (Fin 2)) + (w := fun i p => if i = 0 then v p else w p) + (c := fun i => if i = 0 then 1-t.val else t.val) + (by intro i _; split_ifs; exact sub_nonneg.mpr t.property.2; exact t.property.1) + (by intro i _ p; split_ifs; exact hvp p; exact hwp p) + (by intro i _; split_ifs; exact hv; exact hw) + simpa [Fin.sum_univ_two] using hh + have hc (p : P) : + Continuous (fun t : UnitInterval => ((1-t.val)/(v p)+t.val/(w p))⁻¹) := by + apply Continuous.inv₀ + · fun_prop + · intro t + simpa [div_eq_mul_inv] using (affine_pos (inv_pos.mpr (hvp p)) + (inv_pos.mpr (hwp p)) t).ne' + have hh := D.comparison_integral volume (⟨0, by norm_num⟩ : UnitInterval) hc ha + have he (p : P) : (∫ t : UnitInterval, ((1-t.val)/(v p)+t.val/(w p))⁻¹) = + v p*w p/logMean (v p) (w p) := by + simp only [div_eq_mul_inv] + rw [integral_affine_inv (inv_pos.mpr (hvp p)) (inv_pos.mpr (hwp p)), + inverse_logMean_inverse (hvp p) (hwp p), div_eq_mul_inv] + simp_rw [he] at hh + exact hh + +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory Set +variable {P I J : Type*} (D : DiagonalForms.System P I J) +variable {K : Type*} [MetricSpace K] [CompactSpace K] [MeasurableSpace K] [BorelSpace K] + (μ : Measure K) [IsFiniteMeasure μ] (k₀ : K) + +def resolventWeight (c : ℝ) (r : K → ℝ) (q : ℝ) : ℝ := + q⁻¹ + c + ∫ k, (1+(q-1)*r k)⁻¹ ∂μ + +theorem resolvent_kernel_pos {q r : ℝ} (hq : 0 < q) (hr : r ∈ Icc 0 1) : + 0 < 1+(q-1)*r := by + have h := affine_pos (X := 1) (Y := q) (by norm_num) hq ⟨r, hr⟩ + dsimp at h + nlinarith + +include k₀ in +theorem comparison_resolvent {m q : P → ℝ} {c : ℝ} (hc : 0 ≤ c) + {r : K → ℝ} (hrc : Continuous r) (hr : ∀ k, r k ∈ Icc 0 1) + (hm : ∀ p, 0 < m p) (hq : ∀ p, 0 < q p) + (hmcomp : D.Comparison m) (hqcomp : D.Comparison (fun p => m p*q p)) : + D.Comparison (fun p => m p / resolventWeight μ c r (q p)) := by + let v (p : P) := ((m p*q p)⁻¹+c/(m p))⁻¹ + have hv : D.Comparison v := by + have h := D.comparison_harmonic_sum_nonneg (Finset.univ : Finset (Fin 2)) + (w := fun i p => if i = 0 then m p*q p else m p) + (c := fun i => if i = 0 then 1 else c) + (by intro i _; split_ifs; norm_num; exact hc) + (by intro i _ p; split_ifs; exact mul_pos (hm p) (hq p); exact hm p) + (by intro i _; split_ifs; exact hqcomp; exact hmcomp) + simpa [v, Fin.sum_univ_two] using h + have hvp (p : P) : 0 < v p := inv_pos.mpr + (add_pos_of_pos_of_nonneg (inv_pos.mpr (mul_pos (hm p) (hq p))) + (div_nonneg hc (hm p).le)) + let w (k : K) (p : P) := m p*(1+(q p-1)*r k) + have hwp (k : K) (p : P) : 0 < w k p := + mul_pos (hm p) (resolvent_kernel_pos (hq p) (hr k)) + have hw (k : K) : D.Comparison (w k) := by + have h := D.comparison_add (D.comparison_smul hmcomp (sub_nonneg.mpr (hr k).2)) + (D.comparison_smul hqcomp (hr k).1) + convert h using 1 + funext p + dsimp [w] + ring + have hwc (p : P) : Continuous (fun k => w k p) := by + dsimp [w] + fun_prop + have h := D.comparison_inverse_integral_add μ k₀ hv hvp hwc hwp hw + convert h using 1 + funext p + dsimp [v, w, resolventWeight] + simp only [inv_inv, mul_inv_rev] + rw [integral_mul_const] + simp only [div_eq_mul_inv] + rw [show (q p)⁻¹ * (m p)⁻¹ + c*(m p)⁻¹ + + (∫ k, (1+(q p-1)*r k)⁻¹ ∂μ)*(m p)⁻¹ = + ((q p)⁻¹+c+∫ k, (1+(q p-1)*r k)⁻¹ ∂μ)*(m p)⁻¹ by ring] + simp only [mul_inv_rev, inv_inv] + +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory Set +variable {P I J : Type*} (D : DiagonalForms.System P I J) +variable {K : Type*} [MetricSpace K] [CompactSpace K] [MeasurableSpace K] [BorelSpace K] + (μ : Measure K) [IsFiniteMeasure μ] + +omit [MetricSpace K] [CompactSpace K] [BorelSpace K] [IsFiniteMeasure μ] in +theorem resolventWeight_pos {c : ℝ} (hc : 0 ≤ c) {r : K → ℝ} + (hr : ∀ k, r k ∈ Icc 0 1) {q : ℝ} (hq : 0 < q) : + 0 < resolventWeight μ c r q := by + exact add_pos_of_pos_of_nonneg (add_pos_of_pos_of_nonneg (inv_pos.mpr hq) hc) + (integral_nonneg (fun k => inv_nonneg.mpr (resolvent_kernel_pos hq (hr k)).le)) + +theorem continuous_resolvent_affine {c : ℝ} {r : K → ℝ} (hrc : Continuous r) + (hr : ∀ k, r k ∈ Icc 0 1) {s t : ℝ} (hs : 0 < s) (ht : 0 < t) : + Continuous (fun θ : UnitInterval => + resolventWeight μ c r ((1-θ.val)*s+θ.val*t)) := by + have hk : Continuous (fun z : UnitInterval × K => + (1+(((1-z.1.val)*s+z.1.val*t)-1)*r z.2)⁻¹) := by + apply Continuous.inv₀ + · fun_prop + · intro z + exact (resolvent_kernel_pos (affine_pos hs ht z.1) (hr z.2)).ne' + have hi : Continuous (fun θ : UnitInterval => + ∫ k, (1+(((1-θ.val)*s+θ.val*t)-1)*r k)⁻¹ ∂μ) := by + simpa only [setIntegral_univ] using + (continuous_parametric_integral_of_continuous (μ := μ) hk isCompact_univ) + exact ((by fun_prop : Continuous (fun θ : UnitInterval => (1-θ.val)*s+θ.val*t)).inv₀ + (fun θ => (affine_pos hs ht θ).ne') |>.add continuous_const).add hi + + + +theorem comparison_resolvent_average (k₀ : K) {m s t : P → ℝ} {c : ℝ} (hc : 0 ≤ c) + {r : K → ℝ} (hrc : Continuous r) (hr : ∀ k, r k ∈ Icc 0 1) + (hm : ∀ p, 0 < m p) (hs : ∀ p, 0 < s p) (ht : ∀ p, 0 < t p) + (hmc : D.Comparison m) (hsc : D.Comparison (fun p => m p*s p)) + (htc : D.Comparison (fun p => m p*t p)) : + D.Comparison (fun p => m p / ∫ θ : UnitInterval, + resolventWeight μ c r ((1-θ.val)*s p+θ.val*t p)) := by + let q (θ : UnitInterval) (p : P) := (1-θ.val)*s p+θ.val*t p + have hqc (θ : UnitInterval) : D.Comparison (fun p => m p*q θ p) := by + have h := D.comparison_add (D.comparison_smul hsc (sub_nonneg.mpr θ.property.2)) + (D.comparison_smul htc θ.property.1) + convert h using 1 + funext p + dsimp [q] + ring + have hqp (θ : UnitInterval) (p : P) : 0 < q θ p := affine_pos (hs p) (ht p) θ + have hw (θ : UnitInterval) : + D.Comparison (fun p => m p / resolventWeight μ c r (q θ p)) := + D.comparison_resolvent μ k₀ hc hrc hr hm (hqp θ) hmc (hqc θ) + have hwp (θ : UnitInterval) (p : P) : + 0 < m p / resolventWeight μ c r (q θ p) := + div_pos (hm p) (resolventWeight_pos μ hc hr (hqp θ p)) + have hcont (p : P) : Continuous (fun θ : UnitInterval => + m p / resolventWeight μ c r (q θ p)) := by + exact continuous_const.div (continuous_resolvent_affine μ hrc hr (hs p) (ht p)) + (fun θ => (resolventWeight_pos μ hc hr (hqp θ p)).ne') + have hμ : (volume : Measure UnitInterval) ≠ 0 := by + intro h + have h1 := unitInterval_volume + rw [h] at h1 + simp at h1 + have h := D.comparison_inverse_integral volume ⟨0, by norm_num⟩ hμ hcont hwp hw + convert h using 1 + funext p + dsimp [q] + simp only [div_eq_mul_inv, mul_inv_rev, inv_inv, integral_mul_const] + +end DiagonalForms.System + +namespace DiagonalForms.System +open MeasureTheory Set +variable {K : Type*} [MetricSpace K] [CompactSpace K] [MeasurableSpace K] [BorelSpace K] + (μ : Measure K) [IsFiniteMeasure μ] + +theorem continuous_resolvent_comp {X : Type*} [MetricSpace X] [LocallyCompactSpace X] + {c : ℝ} {r : K → ℝ} (hrc : Continuous r) (hr : ∀ k, r k ∈ Icc 0 1) + {q : X → ℝ} (hqc : Continuous q) (hqp : ∀ x, 0 < q x) : + Continuous (fun x => resolventWeight μ c r (q x)) := by + have hk : Continuous (fun z : X × K => (1+(q z.1-1)*r z.2)⁻¹) := by + apply Continuous.inv₀ + · fun_prop + · intro z + exact (resolvent_kernel_pos (hqp z.1) (hr z.2)).ne' + have hi : Continuous (fun x => ∫ k, (1+(q x-1)*r k)⁻¹ ∂μ) := by + simpa only [setIntegral_univ] using + (continuous_parametric_integral_of_continuous (μ := μ) hk isCompact_univ) + exact ((hqc.inv₀ (fun x => (hqp x).ne')).add continuous_const).add hi + +theorem continuousOn_resolventWeight {c : ℝ} {r : K → ℝ} (hrc : Continuous r) + (hr : ∀ k, r k ∈ Icc 0 1) : ContinuousOn (resolventWeight μ c r) (Ioi 0) := by + let : LocallyCompactSpace (Ioi (0 : ℝ)) := isOpen_Ioi.locallyCompactSpace + apply continuousOn_iff_continuous_domRestrict.mpr + exact continuous_resolvent_comp μ hrc hr continuous_subtype_val (fun x => x.property) + +end DiagonalForms.System + +namespace DiagonalForms.System +open Function +variable {P I J : Type*} (D : DiagonalForms.System P I J) + +def fiveQuadratic (v₀ v₁ v₂ v₃ v₄ : ℝ) (ξ φ : ℂ) : ℝ := + v₀*Complex.normSq (ξ-φ) + v₁*Complex.normSq (ξ+φ) + + v₂*Complex.normSq (ξ+φ) + v₃*Complex.normSq (ξ-φ) + v₄*Complex.normSq φ + + + + +theorem comparison_fiveQuadratic {v₀ v₁ v₂ v₃ v₄ F δ : P → ℝ} + (h₀ : D.Comparison v₀) (h₁ : D.Comparison v₁) (h₂ : D.Comparison v₂) + (h₃ : D.Comparison v₃) (h₄ : D.Comparison v₄) + (hmin : ∀ p ξ, fiveQuadratic (v₀ p) (v₁ p) (v₂ p) (v₃ p) (v₄ p) + ξ ((δ p : ℂ)*ξ) = F p*Complex.normSq ξ) + (hlower : ∀ p ξ φ, F p*Complex.normSq ξ ≤ + fiveQuadratic (v₀ p) (v₁ p) (v₂ p) (v₃ p) (v₄ p) ξ φ) : + D.Comparison F := by + intro z s + let φ := D.multiplier δ z + have hsum : HasSum (fun i => fiveQuadratic (v₀ (D.sourceParam i)) (v₁ (D.sourceParam i)) + (v₂ (D.sourceParam i)) (v₃ (D.sourceParam i)) (v₄ (D.sourceParam i)) (z.val i) (φ.val i)) + (D.sourceForm v₀ (z-φ)+D.sourceForm v₁ (z+φ)+D.sourceForm v₂ (z+φ)+ + D.sourceForm v₃ (z-φ)+D.sourceForm v₄ φ) := by + have h := (((((D.source_summable v₀ (z-φ)).hasSum.add + (D.source_summable v₁ (z+φ)).hasSum).add + (D.source_summable v₂ (z+φ)).hasSum).add + (D.source_summable v₃ (z-φ)).hasSum).add + (D.source_summable v₄ φ).hasSum) + simpa only [sourceForm, fiveQuadratic, Submodule.coe_sub, Submodule.coe_add, + Pi.sub_apply, Pi.add_apply] using h + have heq : D.sourceForm v₀ (z-φ)+D.sourceForm v₁ (z+φ)+D.sourceForm v₂ (z+φ)+ + D.sourceForm v₃ (z-φ)+D.sourceForm v₄ φ = D.sourceForm F z := by + apply hsum.unique + convert (D.source_summable F z).hasSum using 1 + · funext i + exact hmin (D.sourceParam i) (z.val i) + · rfl + calc + ∑ j ∈ s, F (D.targetParam j)*Complex.normSq (D.map z j) ≤ + ∑ j ∈ s, fiveQuadratic (v₀ (D.targetParam j)) (v₁ (D.targetParam j)) + (v₂ (D.targetParam j)) (v₃ (D.targetParam j)) (v₄ (D.targetParam j)) + (D.map z j) (D.map φ j) := + Finset.sum_le_sum (fun j _ => hlower _ _ _) + _ = (∑ j ∈ s, v₀ (D.targetParam j)*Complex.normSq (D.map (z-φ) j))+ + (∑ j ∈ s, v₁ (D.targetParam j)*Complex.normSq (D.map (z+φ) j))+ + (∑ j ∈ s, v₂ (D.targetParam j)*Complex.normSq (D.map (z+φ) j))+ + (∑ j ∈ s, v₃ (D.targetParam j)*Complex.normSq (D.map (z-φ) j))+ + (∑ j ∈ s, v₄ (D.targetParam j)*Complex.normSq (D.map φ j)) := by + simp only [fiveQuadratic, Finset.sum_add_distrib, map_sub, map_add, Pi.sub_apply, Pi.add_apply] + _ ≤ D.sourceForm v₀ (z-φ)+D.sourceForm v₁ (z+φ)+D.sourceForm v₂ (z+φ)+ + D.sourceForm v₃ (z-φ)+D.sourceForm v₄ φ := + add_le_add (add_le_add (add_le_add (add_le_add (h₀ (z-φ) s) (h₁ (z+φ) s)) + (h₂ (z+φ) s)) (h₃ (z-φ) s)) (h₄ φ s) + _ = D.sourceForm F z := heq + +end DiagonalForms.System + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/AMUC.lean b/lean/OAI/Analysis/DiamondDistortion/AMUC.lean new file mode 100644 index 0000000000000000000000000000000000000000..efb18f34c9eb9f0fd63ca8887769c7cdc9b4b091 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/AMUC.lean @@ -0,0 +1,127 @@ +import OAI.Analysis.DiamondDistortion.Transfers + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Diamond +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma old_upper {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] {k : ℕ} (f : Vertex (k+1) → X) {L : ℝ} + (hu : ∀ u v,‖f u-f v‖ ≤ L*distance (k+1) u v) : + ∀ u v,‖f (Sum.inl u)-f (Sum.inl v)‖ ≤ L*distance k u v := by + intro u v + simpa only [distance_old] using hu (Sum.inl u) (Sum.inl v) + +def FixedBoundGain (X : Type*) [NormedAddCommGroup X] (D c : ℝ) : Prop := + ∀ (x : X) (z : ℕ → X),1 ≤ ‖x‖ → ‖x‖ ≤ D → + (∀ i,‖z i‖ ≤ 2*D) → (∀ i j,i ≠ j → 1 ≤ ‖z i-z j‖) → + ∃ i,‖x‖+c < max ‖x+z i‖ ‖x-z i‖ + +lemma actual_additive_growth {D c : ℝ} (hD : 1 ≤ D) (hX : FixedBoundGain X D c) + (k : ℕ) (f : Vertex k → X) + (hl : ∀ u v,1*distance k u v ≤ ‖f u-f v‖) + (hu : ∀ u v,‖f u-f v‖ ≤ D*distance k u v) : + ∃ e : Edge k,1+(k:ℝ)*c ≤ ‖slope f e‖ ∧ + (k ≠ 0 → 1+(k:ℝ)*c < ‖slope f e‖) := by + induction k with + | zero => exact ⟨(),by simpa using slope_lower f hl (),by simp⟩ + | succ n ih => + obtain ⟨e,he,_⟩ := ih (fun v => f (Sum.inl v)) (old_lower f hl) (old_upper f hu) + have hx := slope_lower (fun v => f (Sum.inl v)) (old_lower f hl) e + have hxD := slope_upper (fun v => f (Sum.inl v)) (old_upper f hu) e + have hp : ∀ i,‖slope (fun v => f (Sum.inl v)) e+deviation f e i‖ ≤ D := by + intro i + rw [slope_plus_deviation] + exact slope_upper f hu _ + have hm : ∀ i,‖slope (fun v => f (Sum.inl v)) e-deviation f e i‖ ≤ D := by + intro i + rw [slope_minus_deviation] + exact slope_upper f hu _ + have hd : ∀ i,‖deviation f e i‖ ≤ 2*D := by + intro i + have h := norm_deviation_le (hp i) (hm i) + linarith + have hs : ∀ i j,i ≠ j → 1 ≤ ‖deviation f e i-deviation f e j‖ := by + intro i j hij + have h := deviation_separated f hl e hij + linarith + obtain ⟨i,hi⟩ := hX _ (deviation f e) hx hxD hd hs + rcases lt_max_iff.mp hi with hi | hi + · rw [slope_plus_deviation] at hi + have hh : 1+((n+1:ℕ):ℝ)*c < ‖slope f (e,i,false)‖ := by push_cast; linarith + exact ⟨(e,i,false),hh.le,fun _ => hh⟩ + · rw [slope_minus_deviation] at hi + have hh : 1+((n+1:ℕ):ℝ)*c < ‖slope f (e,i,true)‖ := by push_cast; linarith + exact ⟨(e,i,true),hh.le,fun _ => hh⟩ + +theorem fixed_bound {D c s : ℝ} (_hc : 0 < c) (hX : FixedBoundGain X D c) + (k : ℕ) (f : Vertex k → X) (hf : HasDistortion k f D s) : + 1+(k:ℝ)*c ≤ D ∧ (k ≠ 0 → 1+(k:ℝ)*c < D) := by + obtain ⟨hD,_,h⟩ := normalized_distortion f hf + have hu : ∀ u v,‖s⁻¹ • f u-s⁻¹ • f v‖ ≤ D*distance k u v := by + intro u v + simpa only [mul_one] using (h u v).2 + obtain ⟨e,he,he'⟩ := actual_additive_growth hD hX k (fun v => s⁻¹ • f v) + (fun u v => (h u v).1) hu + have hb := slope_upper (fun v => s⁻¹ • f v) hu e + exact ⟨he.trans hb,fun hk => (he' hk).trans_le hb⟩ + +/-- The unconditional segment lens supplies the fixed-distortion bounded-family + input as well, with a concrete positive choice of c_D. -/ +lemma fixed_bound_of_quadratic {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (hX : QuadraticLens X) {D : ℝ} (hD : 1 ≤ D) : + FixedBoundGain X D (1/(64*D)) := by + have hD0 : 0 < D := by linarith + let c : ℝ := 1/(64*D) + have hc : 0 < c := by dsimp [c]; positivity + have hcD : D*c=1/64 := by dsimp [c]; field_simp + have hcsmall : c ≤ 1/64 := by + have h := mul_le_mul_of_nonneg_right hD hc.le + nlinarith + intro x z hx hxD hz hs + by_contra! hn + have hp : ∀ i,‖x+z i‖ ≤ ‖x‖+c := fun i => (le_max_left _ _).trans (hn i) + have hm : ∀ i,‖x-z i‖ ≤ ‖x‖+c := fun i => (le_max_right _ _).trans (hn i) + have h := hX x z (‖x‖+c) 1 (by positivity) (by norm_num) hp hm hs + have hmul := mul_le_mul_of_nonneg_right hxD hc.le + have hsq := (sq_le_sq₀ hc.le (by norm_num : (0:ℝ) ≤ 1/64)).mpr hcsmall + nlinarith + +/-- Uniform distortion means one finite constant, with a separate map and a + separate positive scale for each depth. -/ +def UniformEmbeddings (X : Type*) [NormedAddCommGroup X] : Prop := + ∃ D : ℝ,∀ k : ℕ,∃ (f : Vertex k → X) (s : ℝ),HasDistortion k f D s + +end Diamond + +theorem atomic_distortion (k : ℕ) (f : Diamond.Vertex k → ForestDual) (D s : ℝ) + (hf : Diamond.HasDistortion k f D s) : 1+(k:ℝ)/16 ≤ D^2 := by + have h := headline.1 k f D s hf + have hk : (0:ℝ) ≤ k := by positivity + linarith + +theorem direct_atomic_obstruction : ¬ Diamond.UniformEmbeddings ForestDual := by + rintro ⟨D,h⟩ + obtain ⟨k,hk⟩ := exists_nat_gt (4*D^2) + obtain ⟨f,s,hf⟩ := h k + have hb := headline.1 k f D s hf + linarith + +theorem infinite_obstruction : ¬ Diamond.UniformEmbeddings InfinitePredual := by + rintro ⟨D,h⟩ + obtain ⟨k,hk⟩ := exists_nat_gt (4*D^2) + obtain ⟨f,s,hf⟩ := h k + have hb := headline.2 k f D s hf + linarith + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Ancestry.lean b/lean/OAI/Analysis/DiamondDistortion/Ancestry.lean new file mode 100644 index 0000000000000000000000000000000000000000..3bb237cca413cfe8b560e9401a3458e647003cd8 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Ancestry.lean @@ -0,0 +1,1336 @@ +import OAI.Analysis.DiamondDistortion.SegmentNorm + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +/-- A finite interval in an ancestral order. This keeps the root in every tree. -/ +def intervalSystem {ι : Type*} (r : ι → ι → Prop) + (hrefl : ∀ a, r a a) (hanti : ∀ a b, r a b → r b a → a = b) : SegmentSystem ι where + IsSegment s := ∃ a b, r a b ∧ ∀ v, v ∈ s ↔ r a v ∧ r v b + singleton v := by + refine ⟨v, v, hrefl v, ?_⟩ + intro w + simp only [Finset.mem_singleton] + constructor + · rintro rfl + exact ⟨hrefl _, hrefl _⟩ + · intro h + exact hanti w v h.2 h.1 + +/-- An ancestral partial order: the predecessors of any vertex form a chain. -/ +class Ancestry (ι : Type*) extends PartialOrder ι where + predecessors_total : ∀ {a b c : ι}, le a c → le b c → le a b ∨ le b a + +namespace Ancestry +open scoped Classical +variable {ι : Type*} [A : Ancestry ι] +local instance : PartialOrder ι := A.toPartialOrder + +/-- Nonempty finite intervals for an ancestral order. -/ +def segments : SegmentSystem ι := + intervalSystem (· ≤ ·) (fun _ => le_rfl) (fun _ _ => le_antisymm) + +/-- Downward closed sets are precisely ancestral heads. -/ +def Ancestral (H : Set ι) : Prop := ∀ ⦃a b : ι⦄, a ≤ b → b ∈ H → a ∈ H + +lemma ancestral_not_above (c : ι) : A.Ancestral {v | ¬ c ≤ v} := by + intro a b hab hb ha + exact hb (ha.trans hab) + +lemma interval_chain {S : Finset ι} (hS : A.segments.IsSegment S) : + ∀ a ∈ S, ∀ b ∈ S, a ≤ b ∨ b ≤ a := by + obtain ⟨l, r, _, hmem⟩ := hS + intro a ha b hb + exact A.predecessors_total ((hmem a).mp ha).2 ((hmem b).mp hb).2 + +lemma segment_filter_head {S : Finset ι} (hS : A.segments.IsSegment S) + {H : Set ι} (hH : A.Ancestral H) : + (S.filter (· ∈ H)).Nonempty → A.segments.IsSegment (S.filter (· ∈ H)) := by + classical + intro hne + obtain ⟨c, hc, hmax⟩ := Finset.exists_maximal hne + have hcS : c ∈ S := (Finset.mem_filter.mp hc).1 + have hcH : c ∈ H := (Finset.mem_filter.mp hc).2 + have hgreat : ∀ v ∈ S.filter (· ∈ H), v ≤ c := by + intro v hv + rcases A.interval_chain hS c hcS v (Finset.mem_filter.mp hv).1 with h | h + · exact hmax hv h + · exact h + obtain ⟨a, b, hab, hmem⟩ := hS + refine ⟨a, c, ((hmem c).mp hcS).1, ?_⟩ + intro v + simp only [Finset.mem_filter] + constructor + · intro hv + exact ⟨((hmem v).mp hv.1).1, hgreat v (Finset.mem_filter.mpr hv)⟩ + · intro hv + exact ⟨(hmem v).mpr ⟨hv.1, hv.2.trans ((hmem c).mp hcS).2⟩, hH hv.2 hcH⟩ + +lemma segment_filter_tail {S : Finset ι} (hS : A.segments.IsSegment S) + {H : Set ι} (hH : A.Ancestral H) : + (S.filter (· ∉ H)).Nonempty → A.segments.IsSegment (S.filter (· ∉ H)) := by + classical + intro hne + obtain ⟨c, hc, hmin⟩ := Finset.exists_minimal hne + have hcS : c ∈ S := (Finset.mem_filter.mp hc).1 + have hcH : c ∉ H := (Finset.mem_filter.mp hc).2 + have hleast : ∀ v ∈ S.filter (· ∉ H), c ≤ v := by + intro v hv + rcases A.interval_chain hS c hcS v (Finset.mem_filter.mp hv).1 with h | h + · exact h + · exact hmin hv h + obtain ⟨a, b, hab, hmem⟩ := hS + refine ⟨c, b, ((hmem c).mp hcS).2, ?_⟩ + intro v + simp only [Finset.mem_filter] + constructor + · intro hv + exact ⟨hleast v (Finset.mem_filter.mpr hv), ((hmem v).mp hv.1).2⟩ + · intro hv + refine ⟨(hmem v).mpr ⟨((hmem c).mp hcS).1.trans hv.1, hv.2⟩, ?_⟩ + exact fun hvH => hcH (hH hv.1 hvH) + +/-- Splitting each member of a disjoint family at its own ancestral cut preserves + the testing budget. This is the simultaneous, not one-gate-at-a-time, estimate. -/ +lemma split_energy_le (F : A.segments.Family) (H : Fin F.n → Set ι) + (hH : ∀ i, A.Ancestral (H i)) (u : ι →₀ ℝ) : + (∑ i, ((∑ v ∈ (F.seg i).filter (· ∈ H i), u v) ^ 2 + + (∑ v ∈ (F.seg i).filter (· ∉ H i), u v) ^ 2)) ≤ + (A.segments.primalSeminorm u) ^ 2 := by + classical + let P : Fin F.n × Bool → Finset ι := fun z => + if z.2 then (F.seg z.1).filter (· ∉ H z.1) else (F.seg z.1).filter (· ∈ H z.1) + have hp : ∀ z, (P z).Nonempty → A.segments.IsSegment (P z) := by + rintro ⟨i, b⟩ + cases b + · exact A.segment_filter_head (F.allowed i) (hH i) + · exact A.segment_filter_tail (F.allowed i) (hH i) + have hs : ∀ z, P z ⊆ F.seg z.1 := by + rintro ⟨i, b⟩ + cases b <;> exact Finset.filter_subset _ _ + have hd : Pairwise (fun z w => Disjoint (P z) (P w)) := by + intro z w hzw + by_cases h : z.1 = w.1 + · obtain ⟨i, b⟩ := z + obtain ⟨j, c⟩ := w + dsimp at h + subst j + apply Finset.disjoint_left.mpr + intro v hv hw + cases b <;> cases c + · exact hzw rfl + · simp only [P, Bool.false_eq_true, ↓reduceIte, Finset.mem_filter] at hv hw + exact hw.2 hv.2 + · simp only [P, Bool.false_eq_true, ↓reduceIte, Finset.mem_filter] at hv hw + exact hv.2 hw.2 + · exact hzw rfl + · exact (F.disjoint h).mono (hs z) (hs w) + have he := A.segments.test_energy_le_allow_empty P hp hd u + simpa only [Fintype.sum_prod_type, Fintype.sum_bool, P, Bool.false_eq_true, ↓reduceIte, + add_comm] using he + +/-- The explicit increase in the squared test after simultaneous splitting. -/ +lemma split_gain_le (F : A.segments.Family) (H : Fin F.n → Set ι) + (hH : ∀ i, A.Ancestral (H i)) (u : ι →₀ ℝ) : + (∑ i, (∑ v ∈ F.seg i, u v) ^ 2) + + 2 * (∑ i : Fin F.n, ((∑ v ∈ (F.seg i).filter (· ∉ H i), u v) ^ 2 - + (∑ v ∈ F.seg i, u v) * (∑ v ∈ (F.seg i).filter (· ∉ H i), u v))) ≤ + (A.segments.primalSeminorm u) ^ 2 := by + classical + have he := A.split_energy_le F H hH u + have hp (i : Fin F.n) : + (∑ v ∈ (F.seg i).filter (· ∈ H i), u v) + + (∑ v ∈ (F.seg i).filter (· ∉ H i), u v) = ∑ v ∈ F.seg i, u v := by + rw [Finset.sum_filter, Finset.sum_filter, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro v hv + by_cases h : v ∈ H i <;> simp [h] + convert he using 1 + rw [Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro i hi + rw [← hp i] + ring + +/-- A minimal vertex outside a head. Gates in a tree form an antichain. -/ +def Gate (H : Set ι) (g : ι) : Prop := + g ∉ H ∧ ∀ v, v < g → v ∈ H + +lemma gates_eq_of_le {H : Set ι} {g h : ι} (hg : A.Gate H g) + (hh : A.Gate H h) (hgh : g ≤ h) : g = h := by + by_contra hne + exact hg.1 (hh.2 g (lt_of_le_of_ne hgh hne)) + +lemma gates_eq_of_common_upper {H : Set ι} {g h v : ι} (hg : A.Gate H g) + (hh : A.Gate H h) (hgv : g ≤ v) (hhv : h ≤ v) : g = h := by + rcases A.predecessors_total hgv hhv with h | h + · exact A.gates_eq_of_le hg hh h + · exact (A.gates_eq_of_le hh hg h).symm + +lemma gate_unique_in_segment {H : Set ι} {S : Finset ι} + (hS : A.segments.IsSegment S) {g h : ι} (hg : A.Gate H g) + (hh : A.Gate H h) (hgS : g ∈ S) (hhS : h ∈ S) : g = h := by + rcases A.interval_chain hS g hgS h hhS with h | h + · exact A.gates_eq_of_le hg hh h + · exact (A.gates_eq_of_le hh hg h).symm + +lemma exists_gate_le {H : Set ι} {K : Finset ι} (hK : A.Ancestral (K : Set ι)) + {v : ι} (hvK : v ∈ K) (hvH : v ∉ H) : + ∃ g ∈ K, A.Gate H g ∧ g ≤ v := by + classical + let S := K.filter (fun a => a ≤ v ∧ a ∉ H) + have hvS : v ∈ S := by simp [S, hvK, hvH] + obtain ⟨g, hg, hmin⟩ := Finset.exists_minimal ⟨v, hvS⟩ + have hgK := (Finset.mem_filter.mp hg).1 + have hgv := (Finset.mem_filter.mp hg).2.1 + have hgH := (Finset.mem_filter.mp hg).2.2 + refine ⟨g, hgK, ⟨hgH, ?_⟩, hgv⟩ + intro a hag + by_contra haH + have haS : a ∈ S := by + exact Finset.mem_filter.mpr ⟨hK hag.le hgK, hag.le.trans hgv, haH⟩ + exact (not_le_of_gt hag) (hmin haS hag.le) + +/-- Canonical lower endpoint; no ordering is imposed on segment families. -/ +def first (F : A.segments.Family) (i : Fin F.n) : ι := + Classical.choose (F.allowed i) + +lemma first_spec (F : A.segments.Family) (i : Fin F.n) : + ∃ b, A.first F i ≤ b ∧ ∀ v, v ∈ F.seg i ↔ A.first F i ≤ v ∧ v ≤ b := + Classical.choose_spec (F.allowed i) + +lemma first_le_of_mem (F : A.segments.Family) (i : Fin F.n) {v : ι} + (hv : v ∈ F.seg i) : A.first F i ≤ v := by + obtain ⟨b, _, hm⟩ := A.first_spec F i + exact ((hm v).mp hv).1 + +lemma first_mem (F : A.segments.Family) (i : Fin F.n) : A.first F i ∈ F.seg i := by + obtain ⟨b, hb, hm⟩ := A.first_spec F i + exact (hm _).mpr ⟨le_rfl, hb⟩ + +/-- Two heads through a common exterior vertex are nested; cutting the longer + at the shorter's first vertex preserves exactly the shorter head sum. -/ +lemma crossing_cut_sum {H : Set ι} (hH : A.Ancestral H) (p : ι →₀ ℝ) + (hp : ∀ v, v ∉ H → p v = 0) (F G : A.segments.Family) + (i : Fin F.n) (j : Fin G.n) {g : ι} (hg : g ∉ H) + (hgF : g ∈ F.seg i) (hgG : g ∈ G.seg j) + (hfirst : A.first F i ≤ A.first G j) : + (∑ v ∈ (F.seg i).filter (fun v => A.first G j ≤ v), p v) = + ∑ v ∈ G.seg j, p v := by + classical + obtain ⟨b, hfb, hFm⟩ := A.first_spec F i + obtain ⟨d, hgd, hGm⟩ := A.first_spec G j + have hhead : ∀ S, A.segments.IsSegment S → g ∈ S → ∀ v ∈ S, v ∈ H → v ≤ g := by + intro S hS hgS v hv hvH + rcases A.interval_chain hS v hv g hgS with h | h + · exact h + · exact False.elim (hg (hH h hvH)) + have he : ((F.seg i).filter (fun v => A.first G j ≤ v)).filter (· ∈ H) = + (G.seg j).filter (· ∈ H) := by + ext v + simp only [Finset.mem_filter] + constructor + · rintro ⟨⟨hvF, hvfirst⟩, hvH⟩ + refine ⟨(hGm v).mpr ⟨hvfirst, ?_⟩, hvH⟩ + exact (hhead _ (F.allowed i) hgF v hvF hvH).trans ((hGm g).mp hgG).2 + · rintro ⟨hvG, hvH⟩ + have hvg := hhead _ (G.allowed j) hgG v hvG hvH + exact ⟨⟨(hFm v).mpr ⟨hfirst.trans ((hGm v).mp hvG).1, + hvg.trans ((hFm g).mp hgF).2⟩, ((hGm v).mp hvG).1⟩, hvH⟩ + have hf (S : Finset ι) : (∑ v ∈ S.filter (· ∈ H), p v) = ∑ v ∈ S, p v := by + apply Finset.sum_filter_of_ne + intro v _ hpv + by_contra hvH + exact hpv (hp v hvH) + rw [← hf ((F.seg i).filter (fun v => A.first G j ≤ v)), he, hf] + +/-- Zero-extension along a finite injection preserves the finite sum. -/ +lemma sum_extend_zero {κ ν : Type*} [Fintype κ] [Fintype ν] + (e : κ ↪ ν) (f : κ → ℝ) : + (∑ i, Function.extend e f (fun _ => 0) i) = ∑ a, f a := by + classical + let I := Finset.univ.image e + have hz : ∀ i ∈ Finset.univ, i ∉ I → Function.extend e f (fun _ => 0) i = 0 := by + intro i _ hi + apply Function.extend_apply' + simpa [I] using hi + rw [← Finset.sum_subset (Finset.subset_univ I) hz, + Finset.sum_image (fun _ _ _ _ h => e.injective h)] + apply Finset.sum_congr rfl + intro a _ + exact e.injective.extend_apply _ _ _ + +/-- Simultaneous splitting restricted to any injected list of original segments. -/ +lemma matched_split_gain_le {κ : Type*} [Fintype κ] + (F : A.segments.Family) (e : κ ↪ Fin F.n) (c : κ → ι) (p : ι →₀ ℝ) : + (∑ i, (∑ v ∈ F.seg i, p v) ^ 2) + + 2 * (∑ a, ((∑ v ∈ (F.seg (e a)).filter (fun v => c a ≤ v), p v) ^ 2 - + (∑ v ∈ F.seg (e a), p v) * + (∑ v ∈ (F.seg (e a)).filter (fun v => c a ≤ v), p v))) ≤ + (A.segments.primalSeminorm p) ^ 2 := by + classical + let H : Fin F.n → Set ι := Function.extend e (fun a => {v | ¬ c a ≤ v}) (fun _ => Set.univ) + have he (a : κ) : H (e a) = {v | ¬ c a ≤ v} := e.injective.extend_apply _ _ _ + have hout (i : Fin F.n) (hi : ¬ ∃ a, e a = i) : H i = Set.univ := + Function.extend_apply' _ _ _ hi + have hH : ∀ i, A.Ancestral (H i) := by + intro i + by_cases hi : ∃ a, e a = i + · obtain ⟨a, rfl⟩ := hi + rw [he] + exact A.ancestral_not_above (c a) + · rw [hout i hi] + intro a b _ _ + trivial + have hb := A.split_gain_le F H hH p + let q : κ → ℝ := fun a => + (∑ v ∈ (F.seg (e a)).filter (fun v => c a ≤ v), p v) ^ 2 - + (∑ v ∈ F.seg (e a), p v) * + (∑ v ∈ (F.seg (e a)).filter (fun v => c a ≤ v), p v) + have hid : (fun i => (∑ v ∈ (F.seg i).filter (· ∉ H i), p v) ^ 2 - + (∑ v ∈ F.seg i, p v) * (∑ v ∈ (F.seg i).filter (· ∉ H i), p v)) = + Function.extend e q (fun _ => 0) := by + funext i + by_cases hi : ∃ a, e a = i + · obtain ⟨a, rfl⟩ := hi + rw [he, e.injective.extend_apply] + simp [q] + · rw [hout i hi, Function.extend_apply' _ _ _ hi] + simp + rw [hid, sum_extend_zero] at hb + exact hb + +/-- Opposite head sums, matched injectively in both families, spend only the + combined testing deficits. This is the simultaneous boundary cancellation. -/ +lemma opposite_matching_le {κ : Type*} [Fintype κ] + {H : Set ι} (hH : A.Ancestral H) (p : ι →₀ ℝ) + (hp : ∀ v, v ∉ H → p v = 0) (F G : A.segments.Family) + (eF : κ ↪ Fin F.n) (eG : κ ↪ Fin G.n) (g : κ → ι) + (hgH : ∀ a, g a ∉ H) (hgF : ∀ a, g a ∈ F.seg (eF a)) + (hgG : ∀ a, g a ∈ G.seg (eG a)) + (hopp : ∀ a, (∑ v ∈ F.seg (eF a), p v) * (∑ v ∈ G.seg (eG a), p v) < 0) : + 2 * (∑ a, |(∑ v ∈ F.seg (eF a), p v) * (∑ v ∈ G.seg (eG a), p v)|) ≤ + ((A.segments.primalSeminorm p) ^ 2 - ∑ i, (∑ v ∈ F.seg i, p v) ^ 2) + + ((A.segments.primalSeminorm p) ^ 2 - ∑ j, (∑ v ∈ G.seg j, p v) ^ 2) := by + classical + let P : κ → Prop := fun a => A.first F (eF a) ≤ A.first G (eG a) + let L := {a : κ // P a} + let U := {a : κ // ¬ P a} + let eL : L ↪ Fin F.n := ⟨fun a => eF a.val, + fun a b h => Subtype.ext (eF.injective h)⟩ + let eU : U ↪ Fin G.n := ⟨fun a => eG a.val, + fun a b h => Subtype.ext (eG.injective h)⟩ + have hcutL (a : L) : + (∑ v ∈ (F.seg (eL a)).filter (fun v => A.first G (eG a.val) ≤ v), p v) = + ∑ v ∈ G.seg (eG a.val), p v := + A.crossing_cut_sum hH p hp F G (eF a.val) (eG a.val) + (hgH a.val) (hgF a.val) (hgG a.val) a.property + have hcutU (a : U) : + (∑ v ∈ (G.seg (eU a)).filter (fun v => A.first F (eF a.val) ≤ v), p v) = + ∑ v ∈ F.seg (eF a.val), p v := by + have hfirst : A.first G (eG a.val) ≤ A.first F (eF a.val) := by + rcases A.predecessors_total (A.first_le_of_mem F _ (hgF a.val)) + (A.first_le_of_mem G _ (hgG a.val)) with h | h + · exact False.elim (a.property h) + · exact h + exact A.crossing_cut_sum hH p hp G F (eG a.val) (eF a.val) + (hgH a.val) (hgG a.val) (hgF a.val) hfirst + have hF := A.matched_split_gain_le F eL (fun a => A.first G (eG a.val)) p + have hG := A.matched_split_gain_le G eU (fun a => A.first F (eF a.val)) p + simp_rw [hcutL] at hF + simp_rw [hcutU] at hG + have hL : (∑ a : L, |(∑ v ∈ F.seg (eF a.val), p v) * + (∑ v ∈ G.seg (eG a.val), p v)|) ≤ + ∑ a : L, ((∑ v ∈ G.seg (eG a.val), p v) ^ 2 - + (∑ v ∈ F.seg (eL a), p v) * (∑ v ∈ G.seg (eG a.val), p v)) := by + apply Finset.sum_le_sum + intro a _ + rw [abs_of_neg (hopp a.val)] + change -( (∑ v ∈ F.seg (eF a.val), p v) * (∑ v ∈ G.seg (eG a.val), p v)) ≤ + (∑ v ∈ G.seg (eG a.val), p v) ^ 2 - + (∑ v ∈ F.seg (eF a.val), p v) * (∑ v ∈ G.seg (eG a.val), p v) + nlinarith [sq_nonneg (∑ v ∈ G.seg (eG a.val), p v)] + have hU : (∑ a : U, |(∑ v ∈ F.seg (eF a.val), p v) * + (∑ v ∈ G.seg (eG a.val), p v)|) ≤ + ∑ a : U, ((∑ v ∈ F.seg (eF a.val), p v) ^ 2 - + (∑ v ∈ G.seg (eU a), p v) * (∑ v ∈ F.seg (eF a.val), p v)) := by + apply Finset.sum_le_sum + intro a _ + rw [abs_of_neg (hopp a.val)] + change -( (∑ v ∈ F.seg (eF a.val), p v) * (∑ v ∈ G.seg (eG a.val), p v)) ≤ + (∑ v ∈ F.seg (eF a.val), p v) ^ 2 - + (∑ v ∈ G.seg (eG a.val), p v) * (∑ v ∈ F.seg (eF a.val), p v) + nlinarith [sq_nonneg (∑ v ∈ F.seg (eF a.val), p v)] + have hsum := Fintype.sum_subtype_add_sum_subtype P (fun a => + |(∑ v ∈ F.seg (eF a), p v) * (∑ v ∈ G.seg (eG a), p v)|) + change (∑ a : L, _) + (∑ a : U, _) = _ at hsum + linarith + +/-- The (possibly zero) head sum carried by the unique segment at a gate. -/ +def boundaryCoeff (F : A.segments.Family) (p : ι →₀ ℝ) (g : ι) : ℝ := + ∑ i : Fin F.n, if g ∈ F.seg i then (∑ v ∈ F.seg i, p v) else 0 + +lemma boundaryCoeff_eq (F : A.segments.Family) (p : ι →₀ ℝ) + (i : Fin F.n) {g : ι} (hg : g ∈ F.seg i) : + A.boundaryCoeff F p g = ∑ v ∈ F.seg i, p v := by + classical + rw [boundaryCoeff, Finset.sum_eq_single i] + · simp [hg] + · intro j _ hji + have hj : g ∉ F.seg j := fun h => Finset.disjoint_left.mp (F.disjoint hji) h hg + simp [hj] + · simp + +lemma boundaryCoeff_nonzero_mem (F : A.segments.Family) (p : ι →₀ ℝ) + {g : ι} (h : A.boundaryCoeff F p g ≠ 0) : ∃ i, g ∈ F.seg i := by + classical + by_contra hn + have hm : ∀ i, g ∉ F.seg i := by simpa using hn + exact h (by simp [boundaryCoeff, hm]) + +/-- Exact two-family opposite-crossing estimate, written without a sign-filter + so that it can be averaged over independent finite endpoint laws. -/ +lemma opposite_crossing_le {κ : Type*} [Fintype κ] + {H : Set ι} (hH : A.Ancestral H) (p : ι →₀ ℝ) + (hp : ∀ v, v ∉ H → p v = 0) (F G : A.segments.Family) + (gate : κ ↪ ι) (hgate : ∀ a, A.Gate H (gate a)) : + (∑ a, (|A.boundaryCoeff F p (gate a)| * |A.boundaryCoeff G p (gate a)| - + A.boundaryCoeff F p (gate a) * A.boundaryCoeff G p (gate a))) ≤ + ((A.segments.primalSeminorm p) ^ 2 - ∑ i, (∑ v ∈ F.seg i, p v) ^ 2) + + ((A.segments.primalSeminorm p) ^ 2 - ∑ j, (∑ v ∈ G.seg j, p v) ^ 2) := by + classical + let P : κ → Prop := fun a => A.boundaryCoeff F p (gate a) * + A.boundaryCoeff G p (gate a) < 0 + let M := {a : κ // P a} + have hnF (a : M) : A.boundaryCoeff F p (gate a.val) ≠ 0 := by + intro he + have := a.property + change A.boundaryCoeff F p (gate a.val) * A.boundaryCoeff G p (gate a.val) < 0 at this + simp [he] at this + have hnG (a : M) : A.boundaryCoeff G p (gate a.val) ≠ 0 := by + intro he + have := a.property + change A.boundaryCoeff F p (gate a.val) * A.boundaryCoeff G p (gate a.val) < 0 at this + simp [he] at this + choose iF hiF using fun a : M => A.boundaryCoeff_nonzero_mem F p (hnF a) + choose iG hiG using fun a : M => A.boundaryCoeff_nonzero_mem G p (hnG a) + have hiFinj : Function.Injective iF := by + intro a b hab + apply Subtype.ext + apply gate.injective + exact A.gate_unique_in_segment (F.allowed (iF a)) (hgate a.val) (hgate b.val) + (hiF a) (by rw [hab]; exact hiF b) + have hiGinj : Function.Injective iG := by + intro a b hab + apply Subtype.ext + apply gate.injective + exact A.gate_unique_in_segment (G.allowed (iG a)) (hgate a.val) (hgate b.val) + (hiG a) (by rw [hab]; exact hiG b) + have hbF (a : M) := A.boundaryCoeff_eq F p (iF a) (hiF a) + have hbG (a : M) := A.boundaryCoeff_eq G p (iG a) (hiG a) + have hb := A.opposite_matching_le hH p hp F G ⟨iF, hiFinj⟩ ⟨iG, hiGinj⟩ + (fun a => gate a.val) (fun a => (hgate a.val).1) hiF hiG (by + intro a + change (∑ v ∈ F.seg (iF a), p v) * (∑ v ∈ G.seg (iG a), p v) < 0 + rw [← hbF, ← hbG] + exact a.property) + simp only [Function.Embedding.coeFn_mk, ← hbF, ← hbG] at hb + let f : κ → ℝ := fun a => |A.boundaryCoeff F p (gate a)| * + |A.boundaryCoeff G p (gate a)| - A.boundaryCoeff F p (gate a) * A.boundaryCoeff G p (gate a) + have hzero : (∑ a : {a : κ // ¬ P a}, f a.val) = 0 := by + apply Finset.sum_eq_zero + intro a _ + dsimp [f] + rw [← abs_mul, abs_of_nonneg (le_of_not_gt a.property), sub_self] + have heq : (∑ a : M, f a.val) = + 2 * ∑ a : M, |A.boundaryCoeff F p (gate a.val) * A.boundaryCoeff G p (gate a.val)| := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro a _ + dsimp [f] + rw [← abs_mul, abs_of_neg a.property] + ring + have hs := Fintype.sum_subtype_add_sum_subtype P f + rw [hzero, add_zero, heq] at hs + simpa only [hs] using hb + +lemma gate_coefficient_energy {κ : Type*} [Fintype κ] {H : Set ι} + (F : A.segments.Family) (a : Fin F.n → ℝ) + (gate : κ ↪ ι) (hg : ∀ g, A.Gate H (gate g)) : + (∑ g, (A.segments.combine F.seg a (A.segments.unitVector (gate g))) ^ 2) ≤ + ∑ i, a i ^ 2 := by + classical + let P : κ → Prop := fun g => ∃ i, gate g ∈ F.seg i + let M := {g : κ // P g} + choose idx hidx using fun g : M => g.property + have hinj : Function.Injective idx := by + intro g h he + apply Subtype.ext + apply gate.injective + exact A.gate_unique_in_segment (F.allowed (idx g)) (hg g.val) (hg h.val) + (hidx g) (by rw [he]; exact hidx h) + have hz : (∑ g : {g : κ // ¬ P g}, + (A.segments.combine F.seg a (A.segments.unitVector (gate g.val))) ^ 2) = 0 := by + apply Finset.sum_eq_zero + intro g _ + rw [SegmentSystem.combine_unit] + have hgn : ∀ i, gate g.val ∉ F.seg i := by simpa only [P, not_exists] using g.property + simp only [hgn, ↓reduceIte, Finset.sum_const_zero, zero_pow (by norm_num : 2 ≠ 0)] + have he := Fintype.sum_subtype_add_sum_subtype P + (fun g => (A.segments.combine F.seg a (A.segments.unitVector (gate g))) ^ 2) + rw [hz, add_zero] at he + rw [← he] + calc + _ = ∑ g : M, a (idx g) ^ 2 := by + apply Finset.sum_congr rfl + intro g _ + rw [A.segments.combine_unit_of_mem F a (idx g) (hidx g)] + _ = ∑ i ∈ Finset.univ.image idx, a i ^ 2 := + (Finset.sum_image (s := Finset.univ) (f := fun i : Fin F.n => a i ^ 2) + (fun _ _ _ _ h => hinj h)).symm + _ ≤ _ := Finset.sum_le_univ_sum_of_nonneg (fun i => sq_nonneg _) + +/-- The tail from the unique segment through g, or the empty segment if absent. -/ +def tailAt (F : A.segments.Family) (H : Finset ι) (g : ι) : Finset ι := + if h : ∃ i, g ∈ F.seg i then (F.seg h.choose).filter (· ∉ H) else ∅ + +lemma tailAt_eq (F : A.segments.Family) (H : Finset ι) + (i : Fin F.n) {g : ι} (hg : g ∈ F.seg i) : + A.tailAt F H g = (F.seg i).filter (· ∉ H) := by + classical + have h : ∃ i, g ∈ F.seg i := ⟨i,hg⟩ + have he : h.choose = i := by + by_contra hn + exact Finset.disjoint_left.mp (F.disjoint hn) h.choose_spec hg + simp only [tailAt, dite_eq_left h] + rw [he] + +lemma tailAt_mem {F : A.segments.Family} {H : Finset ι} {g v : ι} + (hv : v ∈ A.tailAt F H g) : ∃ i, g ∈ F.seg i ∧ v ∈ F.seg i ∧ v ∉ H := by + classical + unfold tailAt at hv + split_ifs at hv with h + · exact ⟨h.choose, h.choose_spec, (Finset.mem_filter.mp hv).1, (Finset.mem_filter.mp hv).2⟩ + · simp at hv + +lemma tailAt_outside {F : A.segments.Family} {H : Finset ι} {g v : ι} + (hv : v ∈ A.tailAt F H g) : v ∉ H := (A.tailAt_mem hv).choose_spec.2.2 + +lemma tailAt_allowed (F : A.segments.Family) {H : Finset ι} + (hH : A.Ancestral (H : Set ι)) (g : ι) (hne : (A.tailAt F H g).Nonempty) : + A.segments.IsSegment (A.tailAt F H g) := by + classical + obtain ⟨v,hv⟩ := hne + obtain ⟨i, hgi, _, _⟩ := A.tailAt_mem hv + rw [A.tailAt_eq F H i hgi] at hv ⊢ + convert A.segment_filter_tail (F.allowed i) hH ?_ using 1 + · ext w + simp only [Finset.mem_filter, Finset.mem_coe] + · simpa only [Finset.filter_nonempty_iff, Finset.mem_coe] using + (show ((F.seg i).filter (· ∉ H)).Nonempty from ⟨v,hv⟩) + +lemma tailAt_cone {F : A.segments.Family} {H : Finset ι} {g v : ι} + (hg : A.Gate (H : Set ι) g) (hv : v ∈ A.tailAt F H g) : g ≤ v := by + obtain ⟨i,hgi,hvi,hvH⟩ := A.tailAt_mem hv + rcases A.interval_chain (F.allowed i) g hgi v hvi with h | h + · exact h + · by_contra hn + have hvne : v ≠ g := fun he => hn (he ▸ le_rfl) + exact hvH (hg.2 v (lt_of_le_of_ne h hvne)) + +lemma tailAt_pairwise {κ : Type*} (F : κ → A.segments.Family) {H : Finset ι} + (gate : κ ↪ ι) (hg : ∀ a, A.Gate (H : Set ι) (gate a)) : + Pairwise (fun a b => Disjoint (A.tailAt (F a) H (gate a)) (A.tailAt (F b) H (gate b))) := by + intro a b hab + apply Finset.disjoint_left.mpr + intro v hva hvb + exact hab (gate.injective (A.gates_eq_of_common_upper (hg a) (hg b) + (A.tailAt_cone (hg a) hva) (A.tailAt_cone (hg b) hvb))) + +lemma gate_on_nonzero_segment {H K : Finset ι} (hH : A.Ancestral (H : Set ι)) + (hK : A.Ancestral (K : Set ι)) (F : A.segments.Family) + (hFK : ∀ i, F.seg i ⊆ K) (p : ι →₀ ℝ) (hp : ∀ v, v ∉ H → p v = 0) + (i : Fin F.n) (hi : (∑ v ∈ F.seg i, p v) ≠ 0) {v : ι} + (hvi : v ∈ F.seg i) (hvH : v ∉ H) : + ∃ g ∈ K, A.Gate (H : Set ι) g ∧ g ∈ F.seg i := by + classical + obtain ⟨w, hwi, hpw⟩ := Finset.exists_ne_zero_of_sum_ne_zero hi + have hwH : w ∈ H := by by_contra hn; exact hpw (hp w hn) + have hfH : A.first F i ∈ H := hH (A.first_le_of_mem F i hwi) hwH + obtain ⟨g,hgK,hg,hgv⟩ := A.exists_gate_le hK (hFK i hvi) hvH + obtain ⟨b,hfb,hm⟩ := A.first_spec F i + have hfg : A.first F i ≤ g := by + rcases A.predecessors_total (A.first_le_of_mem F i hvi) hgv with h | h + · exact h + · exact False.elim (hg.1 (hH h hfH)) + exact ⟨g,hgK,hg,(hm g).mpr ⟨hfg,hgv.trans ((hm v).mp hvi).2⟩⟩ + +/-- The represented finite set of all gates of H in K. -/ +def gateSet (H K : Finset ι) : Finset ι := K.filter (A.Gate (H : Set ι)) + +lemma mem_gateSet {H K : Finset ι} {g : ι} : + g ∈ A.gateSet H K ↔ g ∈ K ∧ A.Gate (H : Set ι) g := Finset.mem_filter + +/-- Replacement coefficients have no wholly exterior contribution. Their entire + tail is the sum of their crossing tails at the finitely represented gates. -/ +lemma replaced_tail_eq {H K : Finset ι} (hH : A.Ancestral (H : Set ι)) + (hK : A.Ancestral (K : Set ι)) (F : A.segments.Family) + (hFK : ∀ i, F.seg i ⊆ K) (p : ι →₀ ℝ) (hp : ∀ v, v ∉ H → p v = 0) : + A.segments.tailDual H (A.segments.combine F.seg (fun i => ∑ v ∈ F.seg i, p v)) = + A.segments.combine (fun g : A.gateSet H K => A.tailAt F H g.val) + (fun g : A.gateSet H K => A.boundaryCoeff F p g.val) := by + classical + apply A.segments.dual_ext + intro v + rw [SegmentSystem.tailDual_apply, sub_apply, SegmentSystem.headDual_unit] + by_cases hvH : v ∈ H + · rw [ite_eq_left hvH, sub_self, SegmentSystem.combine_unit] + symm + apply Finset.sum_eq_zero + intro g _ + rw [ite_eq_right (fun hv => A.tailAt_outside hv hvH)] + rw [ite_eq_right hvH, sub_zero] + by_cases hhas : ∃ i, v ∈ F.seg i + · obtain ⟨i,hvi⟩ := hhas + rw [A.segments.combine_unit_of_mem F _ i hvi, SegmentSystem.combine_unit] + by_cases hi : (∑ w ∈ F.seg i, p w) = 0 + · rw [hi] + symm + apply Finset.sum_eq_zero + intro g _ + split_ifs with hv + · obtain ⟨j,hgj,hvj,_⟩ := A.tailAt_mem hv + have hji : j = i := by + by_contra hn + exact Finset.disjoint_left.mp (F.disjoint hn) hvj hvi + subst j + rwa [A.boundaryCoeff_eq F p i hgj] + · rfl + obtain ⟨g,hgK,hg,hgi⟩ := A.gate_on_nonzero_segment hH hK F hFK p hp i hi hvi hvH + let g' : A.gateSet H K := ⟨g, A.mem_gateSet.mpr ⟨hgK,hg⟩⟩ + have hvJ : v ∈ A.tailAt F H g := by + rw [A.tailAt_eq F H i hgi] + exact Finset.mem_filter.mpr ⟨hvi,hvH⟩ + rw [Finset.sum_eq_single g'] + · rw [ite_eq_left hvJ, A.boundaryCoeff_eq F p i hgi] + · intro h _ hh + rw [ite_eq_right] + intro hv + have he : h.val = g := A.gates_eq_of_common_upper + (A.mem_gateSet.mp h.property).2 hg + (A.tailAt_cone (A.mem_gateSet.mp h.property).2 hv) (A.tailAt_cone hg hvJ) + exact hh (Subtype.ext he) + · simp + · have hn : ∀ i, v ∉ F.seg i := by simpa only [not_exists] using hhas + rw [SegmentSystem.combine_unit, SegmentSystem.combine_unit] + have hz : (∑ i, if v ∈ F.seg i then (∑ w ∈ F.seg i,p w) else 0) = 0 := by simp [hn] + rw [hz] + symm + apply Finset.sum_eq_zero + intro g _ + rw [ite_eq_right] + intro hv + obtain ⟨i,_,hvi,_⟩ := A.tailAt_mem hv + exact hn i hvi + +lemma primal_filter_le {H : Set ι} (hH : A.Ancestral H) (u : ι →₀ ℝ) : + A.segments.primalSeminorm (u.filter (· ∈ H)) ≤ A.segments.primalSeminorm u := by + classical + rw [SegmentSystem.primalSeminorm, + Seminorm.iSup_apply A.segments.families_bddAbove] + apply ciSup_le + intro F + have h := A.segments.test_energy_le_allow_empty + (fun i => (F.seg i).filter (· ∈ H)) + (fun i hne => A.segment_filter_head (F.allowed i) hH hne) + (fun i j hij => (F.disjoint hij).mono (Finset.filter_subset _ _) (Finset.filter_subset _ _)) u + have he : ‖F.test (u.filter (· ∈ H))‖ ^ 2 = + ∑ i, (∑ v ∈ (F.seg i).filter (· ∈ H), u v) ^ 2 := by + rw [EuclideanSpace.norm_sq_eq] + apply Finset.sum_congr rfl + intro i hi + simp only [SegmentSystem.Family.test, LinearMap.coe_mk, AddHom.coe_mk, + WithLp.ofLp_toLp, Real.norm_eq_abs, sq_abs] + congr 1 + simp [Finsupp.filter_apply, Finset.sum_filter] + rw [← he] at h + exact (sq_le_sq₀ (norm_nonneg _) (apply_nonneg _ _)).mp h + +lemma primal_filter_tail_le {H : Set ι} (hH : A.Ancestral H) (u : ι →₀ ℝ) : + A.segments.primalSeminorm (u.filter (· ∉ H)) ≤ A.segments.primalSeminorm u := by + classical + rw [SegmentSystem.primalSeminorm, + Seminorm.iSup_apply A.segments.families_bddAbove] + apply ciSup_le + intro F + have h := A.segments.test_energy_le_allow_empty + (fun i => (F.seg i).filter (· ∉ H)) + (fun i hne => A.segment_filter_tail (F.allowed i) hH hne) + (fun i j hij => (F.disjoint hij).mono (Finset.filter_subset _ _) (Finset.filter_subset _ _)) u + have he : ‖F.test (u.filter (· ∉ H))‖ ^ 2 = + ∑ i, (∑ v ∈ (F.seg i).filter (· ∉ H), u v) ^ 2 := by + rw [EuclideanSpace.norm_sq_eq] + apply Finset.sum_congr rfl + intro i hi + simp only [SegmentSystem.Family.test, LinearMap.coe_mk, AddHom.coe_mk, + WithLp.ofLp_toLp, Real.norm_eq_abs, sq_abs] + congr 1 + simp [Finsupp.filter_apply, Finset.sum_filter] + rw [← he] at h + exact (sq_le_sq₀ (norm_nonneg _) (apply_nonneg _ _)).mp h + +/-- Restricting any test family to a finite ancestral set gives one of the + finitely many local families, with exactly the same energy for supported tests. -/ +lemma localize_family_energy {K : Finset ι} (hK : A.Ancestral (K : Set ι)) + (F : A.segments.Family) (p : ι →₀ ℝ) (hp : ∀ v, v ∉ K → p v = 0) : + ∃ G : A.segments.LocalFamily K, + (∑ i, (∑ v ∈ F.seg i, p v) ^ 2) = + ∑ S : A.segments.LocalIndex G, (∑ v ∈ S.val, p v) ^ 2 := by + classical + let P : Fin F.n → Prop := fun i => ((F.seg i).filter (· ∈ K)).Nonempty + let I := {i : Fin F.n // P i} + let f : I → Finset ι := fun i => (F.seg i.val).filter (· ∈ K) + have hf : Function.Injective f := by + intro i j he + apply Subtype.ext + by_contra hne + obtain ⟨v, hv⟩ := i.property + have hvj : v ∈ f j := by rw [← he]; exact hv + exact Finset.disjoint_left.mp (F.disjoint hne) + (Finset.mem_filter.mp hv).1 (Finset.mem_filter.mp hvj).1 + let Gset := Finset.univ.image f + have hGK : Gset ∈ K.powerset.powerset := by + apply Finset.mem_powerset.mpr + intro S hS + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hS + apply Finset.mem_powerset.mpr + intro v hv + exact (Finset.mem_filter.mp hv).2 + have hGa : ∀ S ∈ Gset, A.segments.IsSegment S := by + intro S hS + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hS + convert A.segment_filter_head (F.allowed i.val) hK (by + have hi := i.property + change ((F.seg i.val).filter (fun v => v ∈ K)).Nonempty at hi + simpa only [Finset.filter_nonempty_iff, Finset.mem_coe] using hi) using 1 + ext v + simp only [f, Finset.mem_filter, Finset.mem_coe] + + have hGd : (Gset : Set (Finset ι)).Pairwise Disjoint := by + intro S hS U hU hSU + obtain ⟨i, _, rfl⟩ := Finset.mem_image.mp hS + obtain ⟨j, _, rfl⟩ := Finset.mem_image.mp hU + have hij : i.val ≠ j.val := fun h => hSU (congrArg f (Subtype.ext h)) + exact (F.disjoint hij).mono (Finset.filter_subset _ _) (Finset.filter_subset _ _) + let G : A.segments.LocalFamily K := ⟨Gset, hGK, hGa, hGd⟩ + refine ⟨G, ?_⟩ + have hsum (i : Fin F.n) : (∑ v ∈ F.seg i, p v) = + ∑ v ∈ (F.seg i).filter (· ∈ K), p v := by + symm + apply Finset.sum_filter_of_ne + intro v _ hv + by_contra hn + exact hv (hp v hn) + have hzero : (∑ i : {i : Fin F.n // ¬ P i}, + (∑ v ∈ (F.seg i.val).filter (· ∈ K), p v) ^ 2) = 0 := by + apply Finset.sum_eq_zero + intro i _ + have hi : (F.seg i.val).filter (· ∈ K) = ∅ := Finset.not_nonempty_iff_eq_empty.mp i.property + rw [hi] + simp + have he := Fintype.sum_subtype_add_sum_subtype P + (fun i => (∑ v ∈ (F.seg i).filter (· ∈ K), p v) ^ 2) + rw [hzero, add_zero] at he + simp_rw [hsum] + rw [← he] + change (∑ i : I, (∑ v ∈ f i, p v) ^ 2) = + ∑ S : ↥Gset, (∑ v ∈ S.val, p v) ^ 2 + calc + _ = ∑ S ∈ Gset, (∑ v ∈ S, p v) ^ 2 := + (Finset.sum_image (fun _ _ _ _ h => hf h)).symm + _ = _ := (Finset.sum_coe_sort Gset (fun S => (∑ v ∈ S, p v) ^ 2)).symm + +lemma primal_le_of_local_energies {K : Finset ι} (hK : A.Ancestral (K : Set ι)) + (p : ι →₀ ℝ) (hp : ∀ v, v ∉ K → p v = 0) {M : ℝ} (hM : 0 ≤ M) + (hlocal : ∀ G : A.segments.LocalFamily K, + (∑ S : A.segments.LocalIndex G, (∑ v ∈ S.val, p v) ^ 2) ≤ M ^ 2) : + A.segments.primalSeminorm p ≤ M := by + rw [SegmentSystem.primalSeminorm, Seminorm.iSup_apply A.segments.families_bddAbove] + apply ciSup_le + intro F + obtain ⟨G, he⟩ := A.localize_family_energy hK F p hp + have h := hlocal G + rw [← he] at h + have hnorm : ‖F.test p‖ ^ 2 = ∑ i, (∑ v ∈ F.seg i, p v) ^ 2 := by + rw [EuclideanSpace.norm_sq_eq] + simp only [SegmentSystem.Family.test_apply, Real.norm_eq_abs, sq_abs] + rw [← hnorm] at h + exact (sq_le_sq₀ (norm_nonneg _) hM).mp h + +/-- Finite atomic-ball formula: exact inherited dual restrictions, derived by + finite-dimensional separation rather than assumed as model data. -/ +lemma finite_atomic_representation {K : Finset ι} (hK : A.Ancestral (K : Set ι)) + (x : A.segments.Dual) (hx : ‖x‖ ≤ 1) : + ∃ c ∈ A.segments.coefficientBall K 1, + A.segments.totalMap K c = fun v : K => x (A.segments.unitVector v.val) := by + classical + let C := A.segments.totalMap K '' A.segments.coefficientBall K 1 + let z : A.segments.Coordinates K := fun v => x (A.segments.unitVector v.val) + suffices z ∈ C by exact this + by_contra hn + have hCc : Convex ℝ C := (A.segments.coefficientBall_convex K 1).linear_image _ + have hCk : IsCompact C := (A.segments.coefficientBall_compact K (by norm_num : (0:ℝ) ≤ 1)).image + (A.segments.totalMap K).continuous_of_finiteDimensional + obtain ⟨f, u, hfu, huz⟩ := geometric_hahn_banach_closed_point hCc hCk.isClosed hn + have hzC : (0 : A.segments.Coordinates K) ∈ C := by + refine ⟨0, ?_, map_zero _⟩ + change (∑ F : A.segments.LocalFamily K, ‖(0 : A.segments.Coefficients K) F‖) ≤ 1 + simp + have hu : 0 < u := by simpa only [map_zero] using hfu 0 hzC + let p := A.segments.coordinateTest K (fun w => f (Pi.single w 1)) + have hp : ∀ v, v ∉ K → p v = 0 := by + intro v hv + exact A.segments.coordinateTest_not_mem K _ hv + have hpbound : A.segments.primalSeminorm p ≤ u := by + apply A.primal_le_of_local_energies hK p hp hu.le + intro F + apply A.segments.local_energy_le_of_functional_bound F f hu.le + intro a ha + apply (hfu _ ?_).le + refine ⟨Pi.single F a, A.segments.single_mem_coefficientBall K F a ha, ?_⟩ + exact A.segments.totalMap_single K F a + have he : f z = x (A.segments.finiteEmbedding p) := by + rw [A.segments.functional_pi_formula, A.segments.coordinateTest_pairing] + apply Finset.sum_congr rfl + intro v _ + exact mul_comm _ _ + have hle : f z ≤ u := by + rw [he] + calc + x (A.segments.finiteEmbedding p) ≤ ‖x (A.segments.finiteEmbedding p)‖ := Real.le_norm_self _ + _ ≤ ‖x‖ * ‖A.segments.finiteEmbedding p‖ := x.le_opNorm _ + _ ≤ 1 * A.segments.primalSeminorm p := by + rw [A.segments.finiteEmbedding_norm] + exact mul_le_mul_of_nonneg_right hx (apply_nonneg _ _) + _ ≤ u := by simpa using hpbound + exact (not_lt_of_ge hle) huz + +lemma finite_atomic_representation_radius {K : Finset ι} (hK : A.Ancestral (K : Set ι)) + (x : A.segments.Dual) {R : ℝ} (hR : 0 ≤ R) (hx : ‖x‖ ≤ R) : + ∃ c ∈ A.segments.coefficientBall K R, + A.segments.totalMap K c = fun v : K => x (A.segments.unitVector v.val) := by + classical + rcases eq_or_lt_of_le hR with hR0 | hRpos + · have hx0 : x = 0 := norm_eq_zero.mp (le_antisymm (by simpa [← hR0] using hx) (norm_nonneg _)) + refine ⟨0, ?_, ?_⟩ + · simp [SegmentSystem.coefficientBall, ← hR0] + · rw [map_zero] + ext v + simp [hx0] + have hxn : ‖R⁻¹ • x‖ ≤ 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hRpos)] + exact (inv_mul_le_iff₀ hRpos).mpr (by simpa using hx) + obtain ⟨c, hc, hce⟩ := A.finite_atomic_representation hK (R⁻¹ • x) hxn + refine ⟨R • c, ?_, ?_⟩ + · change (∑ F, ‖R • c F‖) ≤ R + simp_rw [norm_smul, Real.norm_eq_abs, abs_of_pos hRpos] + rw [← Finset.mul_sum] + exact (mul_le_mul_of_nonneg_left hc hRpos.le).trans_eq (mul_one _) + · rw [map_smul, hce] + ext v + simp only [Pi.smul_apply, smul_apply, smul_eq_mul] + rw [← mul_assoc, mul_inv_cancel₀ hRpos.ne', one_mul] + +lemma headPrimal_norm_le {H : Finset ι} (hH : A.Ancestral (H : Set ι)) + (u : A.segments.JamesSpace) : ‖A.segments.headPrimal H u‖ ≤ ‖u‖ := by + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih u => + rw [SegmentSystem.headPrimal_coe, UniformSpace.Completion.norm_coe, + UniformSpace.Completion.norm_coe] + exact A.primal_filter_le hH u + +lemma tailPrimal_norm_le {H : Finset ι} (hH : A.Ancestral (H : Set ι)) + (u : A.segments.JamesSpace) : ‖u - A.segments.headPrimal H u‖ ≤ ‖u‖ := by + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih u => + rw [SegmentSystem.headPrimal_coe, ← UniformSpace.Completion.coe_sub, + UniformSpace.Completion.norm_coe, UniformSpace.Completion.norm_coe] + rw [SegmentSystem.sub_filterPrimal, SegmentSystem.norm_eq_primal, + SegmentSystem.norm_eq_primal, SegmentSystem.ofPrimal_filter] + convert A.primal_filter_tail_le hH (A.segments.ofPrimal u) using 1 + congr 2 + +lemma headDual_norm_le {H : Finset ι} (hH : A.Ancestral (H : Set ι)) + (x : A.segments.Dual) : ‖A.segments.headDual H x‖ ≤ ‖x‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro u + rw [SegmentSystem.headDual_apply_apply] + exact (x.le_opNorm _).trans (mul_le_mul_of_nonneg_left (A.headPrimal_norm_le hH u) + (norm_nonneg _)) + +lemma tailDual_norm_le {H : Finset ι} (hH : A.Ancestral (H : Set ι)) + (x : A.segments.Dual) : ‖A.segments.tailDual H x‖ ≤ ‖x‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro u + rw [SegmentSystem.tailDual_apply_apply] + exact (x.le_opNorm _).trans (mul_le_mul_of_nonneg_left (A.tailPrimal_norm_le hH u) + (norm_nonneg _)) + +lemma replacement_error_le {H : Finset ι} (hH : A.Ancestral (H : Set ι)) + (F : A.segments.Family) (a b : Fin F.n → ℝ) : + ‖A.segments.tailDual H (A.segments.combine F.seg a - A.segments.combine F.seg b)‖ ^ 2 ≤ + ∑ i, (a i - b i) ^ 2 := by + have hV : 0 ≤ ∑ i,(a i-b i)^2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hc := A.tailDual_norm_le hH (A.segments.combine F.seg a - A.segments.combine F.seg b) + rw [← SegmentSystem.combine_sub] at hc + have ha := A.segments.norm_combine_le F.seg (a-b) (fun i _ => F.allowed i) F.disjoint + have h := (sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).2 (hc.trans ha) + simpa only [Pi.sub_apply, Real.sq_sqrt hV, SegmentSystem.combine_sub] using h + +lemma replacement_error_gate {H : Finset ι} (F : A.segments.Family) + (a : Fin F.n → ℝ) (q : ι →₀ ℝ) {g : ι} (hg : g ∉ H) : + A.segments.tailDual H (A.segments.combine F.seg a - + A.segments.combine F.seg (fun i => ∑ v ∈ F.seg i,q v)) (A.segments.unitVector g) = + A.segments.combine F.seg a (A.segments.unitVector g) - A.boundaryCoeff F q g := by + rw [SegmentSystem.tailDual_apply, sub_apply, SegmentSystem.headDual_unit, ite_eq_right hg, + sub_zero, sub_apply] + simp only [SegmentSystem.combine_unit, boundaryCoeff] + +lemma replacement_cross (F : A.segments.Family) (a : Fin F.n → ℝ) (p : ι →₀ ℝ) (r : ℝ) : + (∑ i, a i * (∑ v ∈ F.seg i,(r • p) v)) = + r * A.segments.combine F.seg a (A.segments.finiteEmbedding p) := by + rw [SegmentSystem.finiteEmbedding_apply, SegmentSystem.combine_coe] + change (∑ i,a i*(∑ v ∈ F.seg i,(r • p) v)) = r*(∑ i,a i*(∑ v ∈ F.seg i,p v)) + simp_rw [Finsupp.smul_apply, smul_eq_mul, ← Finset.mul_sum] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring + +lemma replacement_mass_norm {Ω : Type*} [Fintype Ω] [Nonempty Ω] + {H K : Finset ι} (hH : A.Ancestral (H : Set ι)) (hK : A.Ancestral (K : Set ι)) + (F : Ω → A.segments.Family) (hFK : ∀ ω i, (F ω).seg i ⊆ K) + (q : ι →₀ ℝ) (hq : ∀ v,v ∉ H → q v=0) + (w σ : Ω → ℝ) (hw : ∀ ω,0 ≤ w ω) (hσ : ∀ ω,|σ ω|=1) : + ‖∑ ω,w ω • (σ ω • A.segments.tailDual H + (A.segments.combine (F ω).seg (fun i => ∑ v ∈ (F ω).seg i,q v)))‖ ≤ + Real.sqrt (∑ g : A.gateSet H K, (∑ ω,w ω * |A.boundaryCoeff (F ω) q g.val|)^2) := by + classical + let gate : A.gateSet H K ↪ ι := ⟨Subtype.val, Subtype.val_injective⟩ + have hg (g : A.gateSet H K) : A.Gate (H : Set ι) (gate g) := + (A.mem_gateSet.mp g.property).2 + have h := A.segments.norm_cone_mean_le + (fun ω (g : A.gateSet H K) => A.tailAt (F ω) H g.val) + (fun ω g => σ ω * A.boundaryCoeff (F ω) q g.val) w hw + (fun ω g => A.tailAt_allowed (F ω) hH g.val) (by + intro g h hgh ω ν + apply Finset.disjoint_left.mpr + intro v hvg hvh + exact hgh (gate.injective (A.gates_eq_of_common_upper (hg g) (hg h) + (A.tailAt_cone (hg g) hvg) (A.tailAt_cone (hg h) hvh)))) + simp only [abs_mul, hσ, one_mul] at h + convert h using 1 + congr 1 + apply Finset.sum_congr rfl + intro ω _ + rw [A.replaced_tail_eq hH hK (F ω) (hFK ω) q hq, SegmentSystem.combine_smul] + +/-- The finite pooled coefficient/slack bound, before taking the supremum over + head tests. No lens or convexity modulus is postulated for the space. -/ +lemma pooled_tail_test {Ω : Type*} [Fintype Ω] {H K : Finset ι} + (hH : A.Ancestral (H : Set ι)) (hK : A.Ancestral (K : Set ι)) + {R : ℝ} {x y : A.segments.Dual} (law : A.segments.BipolarLaw Ω R x y) + (hFK : ∀ ω i,(law.atom ω).family.seg i ⊆ K) + (hx : ∀ v,v ∉ H → x (A.segments.unitVector v)=0) + (p : ι →₀ ℝ) (hp : ∀ v,v ∉ H → p v=0) (hpn : A.segments.primalSeminorm p ≤ 1) : + ‖A.segments.tailDual H y‖ ≤ + 2*Real.sqrt (R^2 - (x (A.segments.finiteEmbedding p))^2) := by + classical + have : Nonempty Ω := by + by_contra hn + have : IsEmpty Ω := not_nonempty_iff.mp hn + have h := law.sum_one + simp at h + let r : ℝ := x (A.segments.finiteEmbedding p) + let q : ι →₀ ℝ := r • p + let F : Ω → A.segments.Family := fun ω => (law.atom ω).family + let a : (ω : Ω) → Fin (F ω).n → ℝ := fun ω => (law.atom ω).coeff + let β : (ω : Ω) → Fin (F ω).n → ℝ := fun ω i => ∑ v ∈ (F ω).seg i,q v + let Ac : Ω → A.segments.Dual := fun ω => A.segments.combine (F ω).seg (β ω) + let W : Ω → A.segments.Dual := fun ω => + A.segments.tailDual H ((law.atom ω).value - Ac ω) + let V : Ω → ℝ := fun ω => ∑ i,(a ω i-β ω i)^2 + let L : Ω → ℝ := fun ω => r^2-∑ i,β ω i^2 + let η : ℝ := ∑ ω,law.weight ω*V ω + let θ : ℝ := ∑ ω,law.weight ω*L ω + have hq (v : ι) (hv : v ∉ H) : q v = 0 := by simp only [q,Finsupp.smul_apply,hp v hv,smul_zero] + have hqn : A.segments.primalSeminorm q ≤ |r| := by + dsimp [q] + rw [map_smul_eq_mul, Real.norm_eq_abs] + simpa only [mul_one] using mul_le_mul_of_nonneg_left hpn (abs_nonneg r) + have hqn2 : (A.segments.primalSeminorm q)^2 ≤ r^2 := by + simpa only [sq_abs] using (sq_le_sq₀ (apply_nonneg _ _) (abs_nonneg r)).2 hqn + have hV (ω : Ω) : 0 ≤ V ω := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hL (ω : Ω) : 0 ≤ L ω := by + apply sub_nonneg.mpr + exact (A.segments.test_energy_le_allow_empty (F ω).seg + (fun i _ => (F ω).allowed i) (F ω).disjoint q).trans hqn2 + have hη : 0 ≤ η := Finset.sum_nonneg (fun ω _ => mul_nonneg (law.nonneg ω) (hV ω)) + have hθ : 0 ≤ θ := Finset.sum_nonneg (fun ω _ => mul_nonneg (law.nonneg ω) (hL ω)) + have hcross : (∑ ω,law.weight ω*(∑ i,a ω i*β ω i)) = r^2 := by + have hm := congrArg (fun z : A.segments.Dual => z (A.segments.finiteEmbedding p)) law.mean + simp only [sum_apply, smul_apply, smul_eq_mul] at hm + calc + _ = r*(∑ ω,law.weight ω*(law.atom ω).value (A.segments.finiteEmbedding p)) := by + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro ω _ + have hr := A.replacement_cross (F ω) (a ω) p r + change (∑ i,a ω i*β ω i) = r*(law.atom ω).value (A.segments.finiteEmbedding p) at hr + rw [hr] + ring + _ = r^2 := by rw [hm]; dsimp [r]; ring + have hbudget : η+θ ≤ R^2-r^2 := + FiniteAverage.joint_budget law.weight law.nonneg law.sum_one (fun ω => Fin (F ω).n) + a β (fun ω => (law.atom ω).energy_le) hcross + have hWnorm (ω : Ω) : ‖W ω‖^2 ≤ V ω := + A.replacement_error_le hH (F ω) (a ω) (β ω) + let gate : A.gateSet H K ↪ ι := ⟨Subtype.val,Subtype.val_injective⟩ + have hg (g : A.gateSet H K) : A.Gate (H : Set ι) (gate g) := + (A.mem_gateSet.mp g.property).2 + let b : Ω → A.gateSet H K → ℝ := fun ω g => A.boundaryCoeff (F ω) q g.val + let e : Ω → A.gateSet H K → ℝ := fun ω g => W ω (A.segments.unitVector g.val) + have he (ω : Ω) (g : A.gateSet H K) : + e ω g = (law.atom ω).value (A.segments.unitVector g.val) - b ω g := + A.replacement_error_gate (F ω) (a ω) q (hg g).1 + have hgateEnergy (ω : Ω) : (∑ g,e ω g^2) ≤ V ω := by + have heq (g : A.gateSet H K) : e ω g = + A.segments.combine (F ω).seg (a ω-β ω) (A.segments.unitVector g.val) := by + rw [SegmentSystem.combine_sub] + rw [sub_apply] + simpa only [SegmentSystem.Atom.value, SegmentSystem.combine_unit, b, β, + boundaryCoeff, F, a] using he ω g + simp_rw [heq] + exact A.gate_coefficient_energy (F ω) (a ω-β ω) gate hg + have hmean (g : A.gateSet H K) : + (∑ ω,law.weight ω*b ω g) = -(∑ ω,law.weight ω*e ω g) := by + have hm := congrArg (fun z : A.segments.Dual => z (A.segments.unitVector g.val)) law.mean + simp only [sum_apply,smul_apply,smul_eq_mul,hx g.val (hg g).1] at hm + have heq : (∑ ω,law.weight ω*b ω g)+(∑ ω,law.weight ω*e ω g) = + ∑ ω,law.weight ω*(law.atom ω).value (A.segments.unitVector g.val) := by + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro ω _ + rw [he] + ring + rw [hm] at heq + linarith + have hopp (ω ν : Ω) : (∑ g,(|b ω g| * |b ν g|-b ω g*b ν g)) ≤ L ω+L ν := by + have h := A.opposite_crossing_le hH q hq (F ω) (F ν) gate hg + change (∑ g,(|b ω g| * |b ν g|-b ω g*b ν g)) ≤ + ((A.segments.primalSeminorm q)^2 - ∑ i,β ω i^2) + + ((A.segments.primalSeminorm q)^2 - ∑ i,β ν i^2) at h + exact h.trans (add_le_add (sub_le_sub_right hqn2 _) (sub_le_sub_right hqn2 _)) + have hmass : (∑ g,(∑ ω,law.weight ω* |b ω g|)^2) ≤ η+2*θ := + FiniteAverage.pooled_mass law.weight law.nonneg law.sum_one b e V L hmean hgateEnergy hopp + have herr : ‖∑ ω,law.weight ω • (law.sign ω • W ω)‖ ≤ Real.sqrt η := by + apply FiniteAverage.norm_mean_le_sqrt law.weight law.nonneg law.sum_one _ hη + apply Finset.sum_le_sum + intro ω _ + rw [norm_smul,Real.norm_eq_abs,law.abs_sign,one_mul] + exact mul_le_mul_of_nonneg_left (hWnorm ω) (law.nonneg ω) + have hrec : ‖∑ ω,law.weight ω • (law.sign ω • A.segments.tailDual H (Ac ω))‖ ≤ + Real.sqrt (η+2*θ) := by + exact (A.replacement_mass_norm hH hK F hFK q hq law.weight law.sign law.nonneg law.abs_sign).trans + (Real.sqrt_le_sqrt hmass) + have hdec : A.segments.tailDual H y = + (∑ ω,law.weight ω • (law.sign ω • W ω)) + + (∑ ω,law.weight ω • (law.sign ω • A.segments.tailDual H (Ac ω))) := by + conv_lhs => rw [← law.signed_mean] + rw [map_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro ω _ + simp only [map_smul, W, map_sub, smul_sub] + module + calc + ‖A.segments.tailDual H y‖ ≤ Real.sqrt η+Real.sqrt (η+2*θ) := by + rw [hdec] + exact (norm_add_le _ _).trans (add_le_add herr hrec) + _ ≤ 2*Real.sqrt (η+θ) := FiniteAverage.sqrt_pooled hη hθ + _ ≤ _ := mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hbudget) (by norm_num) + +/-- Pair the two exact finite atomic representations, retaining their common + ancestral support and their actual endpoints. -/ +lemma finite_lens_test {H K : Finset ι} + (hH : A.Ancestral (H : Set ι)) (hK : A.Ancestral (K : Set ι)) (hHK : H ⊆ K) + {R : ℝ} (hR : 0 < R) {x y : A.segments.Dual} + (hx : ∀ v, v ∉ H → x (A.segments.unitVector v) = 0) + (hplus : ‖x+y‖ ≤ R) (hminus : ‖x-y‖ ≤ R) + (p : ι →₀ ℝ) (hp : ∀ v, v ∉ H → p v = 0) (hpn : A.segments.primalSeminorm p ≤ 1) : + ‖A.segments.tailDual H (A.segments.headDual K y)‖ ≤ + 2*Real.sqrt (R^2 - (x (A.segments.finiteEmbedding p))^2) := by + classical + obtain ⟨cp,hcp,hcep⟩ := A.finite_atomic_representation_radius hK (x+y) hR.le hplus + obtain ⟨cm,hcm,hcem⟩ := A.finite_atomic_representation_radius hK (x-y) hR.le hminus + have hxK : A.segments.headDual K x = x := + A.segments.headDual_eq_self (fun v hv => hx v (fun h => hv (hHK h))) + let Lp0 := A.segments.lawOfCoefficients (x+y) hR cp hcp hcep + let Lm0 := A.segments.lawOfCoefficients (x-y) hR cm hcm hcem + let Lp : A.segments.AtomLaw (Option (A.segments.LocalFamily K)) R + (x+A.segments.headDual K y) := + { Lp0 with mean := by rw [Lp0.mean, map_add, hxK] } + let Lm : A.segments.AtomLaw (Option (A.segments.LocalFamily K)) R + (x-A.segments.headDual K y) := + { Lm0 with mean := by rw [Lm0.mean, map_sub, hxK] } + apply A.pooled_tail_test hH hK (A.segments.pairLaws Lp Lm) _ hx p hp hpn + apply A.segments.pairLaws_subset Lp Lm K + · exact A.segments.lawOfCoefficients_subset (x+y) hR cp hcp hcep + · exact A.segments.lawOfCoefficients_subset (x-y) hR cm hcm hcem + +/-- Finite restrictions suffice for the full dual estimate: no shrinking or + reflexivity hypothesis is needed for this intrinsic finite-head bound. -/ +lemma intrinsic_tail_test + (hfin : ∀ S : Finset ι, ∃ K : Finset ι, S ⊆ K ∧ A.Ancestral (K : Set ι)) + {H : Finset ι} (hH : A.Ancestral (H : Set ι)) {R : ℝ} (hR : 0 < R) + {x y : A.segments.Dual} (hx : ∀ v, v ∉ H → x (A.segments.unitVector v) = 0) + (hplus : ‖x+y‖ ≤ R) (hminus : ‖x-y‖ ≤ R) + (p : ι →₀ ℝ) (hp : ∀ v, v ∉ H → p v = 0) (hpn : A.segments.primalSeminorm p ≤ 1) : + ‖A.segments.tailDual H y‖ ≤ + 2*Real.sqrt (R^2 - (x (A.segments.finiteEmbedding p))^2) := by + apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (by norm_num) (Real.sqrt_nonneg _)) + intro u + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih u => + obtain ⟨K,hsub,hK⟩ := hfin (H ∪ (A.segments.ofPrimal u).support) + have hHK : H ⊆ K := Finset.Subset.trans Finset.subset_union_left hsub + have huK : (A.segments.ofPrimal u).support ⊆ K := + Finset.Subset.trans Finset.subset_union_right hsub + have ht := A.finite_lens_test hH hK hHK hR hx hplus hminus p hp hpn + calc + _ = ‖A.segments.tailDual H (A.segments.headDual K y) (u : A.segments.JamesSpace)‖ := by + rw [SegmentSystem.tailDual_headDual, A.segments.headDual_finite_apply _ u huK] + _ ≤ ‖A.segments.tailDual H (A.segments.headDual K y)‖ * ‖(u : A.segments.JamesSpace)‖ := + ContinuousLinearMap.le_opNorm _ _ + _ ≤ _ := mul_le_mul_of_nonneg_right ht (norm_nonneg _) + +lemma norm_center_le {x y : A.segments.Dual} {R : ℝ} + (hplus : ‖x+y‖ ≤ R) (hminus : ‖x-y‖ ≤ R) : ‖x‖ ≤ R := by + have h := (norm_add_le (x+y) (x-y)).trans (add_le_add hplus hminus) + have he : (x+y)+(x-y) = (2:ℝ) • x := by module + rw [he, norm_smul, Real.norm_eq_abs] at h + norm_num at h + linarith + +lemma intrinsic_tail_sq + (hfin : ∀ S : Finset ι, ∃ K : Finset ι, S ⊆ K ∧ A.Ancestral (K : Set ι)) + {H : Finset ι} (hH : A.Ancestral (H : Set ι)) {R : ℝ} (hR : 0 ≤ R) + {x y : A.segments.Dual} (hx : ∀ v, v ∉ H → x (A.segments.unitVector v) = 0) + (hplus : ‖x+y‖ ≤ R) (hminus : ‖x-y‖ ≤ R) : + ‖A.segments.tailDual H y‖^2 + 4*‖x‖^2 ≤ 4*R^2 := by + have hxr := A.norm_center_le hplus hminus + rcases eq_or_lt_of_le hR with hR0 | hRpos + · have hx0 : x=0 := norm_eq_zero.mp (le_antisymm (by simpa [← hR0] using hxr) (norm_nonneg _)) + have hy0 : y=0 := norm_eq_zero.mp (le_antisymm (by simpa [← hR0,hx0] using hplus) (norm_nonneg _)) + simp [hx0,hy0,← hR0] + let t := ‖A.segments.tailDual H y‖ + have ht : 0 ≤ t := norm_nonneg _ + have htn : t ≤ 2*R := by + have h := A.intrinsic_tail_test hfin hH hRpos hx hplus hminus 0 (by simp) (by simp) + simpa only [map_zero, zero_pow (by decide : 2 ≠ 0), sub_zero, + Real.sqrt_sq_eq_abs, abs_of_nonneg hR] using h + have ht2 : t^2 ≤ (2*R)^2 := (sq_le_sq₀ ht (by positivity)).2 htn + have hrad : 0 ≤ R^2-t^2/4 := by nlinarith + have hxn : ‖x‖ ≤ Real.sqrt (R^2-t^2/4) := by + apply ContinuousLinearMap.opNorm_le_of_unit_norm (Real.sqrt_nonneg _) + intro u hu + let p := A.segments.headArray H u + have hp : ∀ v, v ∉ H → p v=0 := fun v hv => A.segments.headArray_outside H u hv + have hpn : A.segments.primalSeminorm p ≤ 1 := by + rw [← SegmentSystem.finiteEmbedding_norm, SegmentSystem.finiteEmbedding_headArray] + exact (A.headPrimal_norm_le hH u).trans hu.le + have he : x (A.segments.finiteEmbedding p) = x u := by + rw [SegmentSystem.finiteEmbedding_headArray, ← SegmentSystem.headDual_apply_apply, + A.segments.headDual_eq_self hx] + have hval : |x u| ≤ R := by + have h := x.le_opNorm u + rw [Real.norm_eq_abs, hu, mul_one] at h + exact h.trans hxr + have hval2 : (x u)^2 ≤ R^2 := by + simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg _) hR).2 hval + have h := A.intrinsic_tail_test hfin hH hRpos hx hplus hminus p hp hpn + rw [he] at h + have hsq : t^2 ≤ (2*Real.sqrt (R^2-(x u)^2))^2 := + (sq_le_sq₀ ht (by positivity)).2 h + have hs := Real.sq_sqrt (sub_nonneg.mpr hval2) + have hv2 : (x u)^2 ≤ R^2-t^2/4 := by nlinarith + rw [Real.norm_eq_abs] + apply (sq_le_sq₀ (abs_nonneg _) (Real.sqrt_nonneg _)).mp + rw [sq_abs, Real.sq_sqrt hrad] + exact hv2 + have hxn2 := (sq_le_sq₀ (norm_nonneg x) (Real.sqrt_nonneg _)).2 hxn + rw [Real.sq_sqrt hrad] at hxn2 + change t^2+4*‖x‖^2 ≤ 4*R^2 + nlinarith + +lemma finite_heads_of_predecessors + (hpred : ∀ b : ι, ({a : ι | a ≤ b} : Set ι).Finite) : + ∀ S : Finset ι, ∃ K : Finset ι, S ⊆ K ∧ A.Ancestral (K : Set ι) := by + classical + intro S + let U : Set ι := ⋃ b ∈ (S : Set ι), {a : ι | a ≤ b} + have hU : U.Finite := S.finite_toSet.biUnion (fun b _ => hpred b) + refine ⟨hU.toFinset, ?_, ?_⟩ + · intro b hb + rw [Set.Finite.mem_toFinset] + exact Set.mem_iUnion.mpr ⟨b, Set.mem_iUnion.mpr ⟨hb, le_rfl⟩⟩ + · intro a b hab hb + rw [Finset.mem_coe, Set.Finite.mem_toFinset] at hb ⊢ + obtain ⟨c,hc,hbc⟩ := Set.mem_iUnion₂.mp hb + exact Set.mem_iUnion₂.mpr ⟨c,hc,hab.trans hbc⟩ + +lemma coordinate_predual_approximation + (hfin : ∀ S : Finset ι, ∃ K : Finset ι, S ⊆ K ∧ A.Ancestral (K : Set ι)) + {x : A.segments.Dual} (hx : x ∈ A.segments.CoordinatePredual) + {ε : ℝ} (hε : 0 < ε) : + ∃ H : Finset ι, A.Ancestral (H : Set ι) ∧ ‖A.segments.tailDual H x‖ < ε := by + have hxcl : x ∈ closure (Submodule.span ℝ (Set.range A.segments.coordinate) : Set A.segments.Dual) := hx + obtain ⟨z,hz,hclose⟩ := Metric.mem_closure_iff.mp hxcl ε hε + obtain ⟨S,hS⟩ := A.segments.span_coordinates_finite_support hz + obtain ⟨H,hSH,hH⟩ := hfin S + have hPH : A.segments.headDual H z = z := + A.segments.headDual_eq_self (fun v hv => hS v (fun h => hv (hSH h))) + refine ⟨H,hH,?_⟩ + have he : A.segments.tailDual H x = A.segments.tailDual H (x-z) := by + simp only [map_sub, SegmentSystem.tailDual_apply, hPH, sub_self, sub_zero] + rw [he] + exact lt_of_le_of_lt (A.tailDual_norm_le hH (x-z)) (by simpa only [dist_eq_norm] using hclose) + +/-- Finite-dimensional compactness compares distinct members of any bounded + sequence; no maximum over the infinitely many children is asserted. -/ +lemma finite_head_pair {H : Finset ι} (hH : A.Ancestral (H : Set ι)) + (z : ℕ → A.segments.Dual) {R η : ℝ} (hz : ∀ i, ‖z i‖ ≤ R) (hη : 0 < η) : + ∃ i j : ℕ, i ≠ j ∧ ‖A.segments.headDual H ((1/2:ℝ) • (z i-z j))‖ < η := by + classical + let M := Submodule.span ℝ (A.segments.coordinate '' (H : Set ι)) + have : FiniteDimensional ℝ M := + FiniteDimensional.span_of_finite ℝ (H.finite_toSet.image A.segments.coordinate) + have hm (w : A.segments.Dual) : A.segments.headDual H w ∈ M := by + rw [SegmentSystem.headDual_apply] + apply Submodule.sum_mem + intro v hv + exact Submodule.smul_mem M _ (Submodule.subset_span ⟨v,hv,rfl⟩) + let Z : ℕ → M := fun i => ⟨A.segments.headDual H (z i),hm (z i)⟩ + have hZ (i : ℕ) : Z i ∈ Metric.closedBall (0 : M) R := by + rw [Metric.mem_closedBall] + change dist (A.segments.headDual H (z i)) 0 ≤ R + rw [dist_zero_right] + exact (A.headDual_norm_le hH (z i)).trans (hz i) + obtain ⟨a,_,φ,hφ,hconv⟩ := tendsto_subseq_of_bounded Metric.isBounded_closedBall hZ + obtain ⟨N,hN⟩ := Metric.cauchySeq_iff.mp hconv.cauchySeq (2*η) (by positivity) + have hd := hN N le_rfl (N+1) (by omega) + change dist (Z (φ N)) (Z (φ (N+1))) < 2*η at hd + change dist (A.segments.headDual H (z (φ N))) (A.segments.headDual H (z (φ (N+1)))) < 2*η at hd + rw [dist_eq_norm] at hd + change ‖A.segments.headDual H (z (φ N)) - A.segments.headDual H (z (φ (N+1)))‖ < 2*η at hd + refine ⟨φ N, φ (N+1), hφ.injective.ne (by omega), ?_⟩ + rw [map_smul,norm_smul,map_sub,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + linarith + +lemma average_lens {x : A.segments.Dual} (z : ℕ → A.segments.Dual) {R : ℝ} + (hplus : ∀ i, ‖x+z i‖ ≤ R) (hminus : ∀ i, ‖x-z i‖ ≤ R) (i j : ℕ) : + ‖x+(1/2:ℝ) • (z i-z j)‖ ≤ R ∧ ‖x-(1/2:ℝ) • (z i-z j)‖ ≤ R := by + have hp : x+(1/2:ℝ) • (z i-z j) = (1/2:ℝ) • ((x+z i)+(x-z j)) := by module + have hm : x-(1/2:ℝ) • (z i-z j) = (1/2:ℝ) • ((x-z i)+(x+z j)) := by module + constructor + · rw [hp,norm_smul,Real.norm_eq_abs] + norm_num + have h := (norm_add_le (x+z i) (x-z j)).trans (add_le_add (hplus i) (hminus j)) + linarith + · rw [hm,norm_smul,Real.norm_eq_abs] + norm_num + have h := (norm_add_le (x-z i) (x+z j)).trans (add_le_add (hminus i) (hplus j)) + linarith + +/-- Exact separated-lens consequence of the intrinsic estimate. Its only + approximation input is explicitly proved for each target model below. -/ +lemma separated_lens + (hfin : ∀ S : Finset ι, ∃ K : Finset ι, S ⊆ K ∧ A.Ancestral (K : Set ι)) + {x : A.segments.Dual} + (happrox : ∀ η > 0, ∃ H : Finset ι, A.Ancestral (H : Set ι) ∧ ‖A.segments.tailDual H x‖ < η) + (z : ℕ → A.segments.Dual) {R ε : ℝ} (hR : 0 ≤ R) (hε : 0 < ε) + (hplus : ∀ i, ‖x+z i‖ ≤ R) (hminus : ∀ i, ‖x-z i‖ ≤ R) + (hsep : ∀ i j, i ≠ j → ε ≤ ‖z i-z j‖) : + ‖x‖^2+ε^2/16 ≤ R^2 := by + have hxr : ‖x‖ ≤ R := A.norm_center_le (hplus 0) (hminus 0) + have hz (i : ℕ) : ‖z i‖ ≤ R := by + apply A.norm_center_le (x := z i) (y := x) + · simpa only [add_comm] using hplus i + · simpa only [norm_sub_rev] using hminus i + apply le_of_forall_pos_le_add + intro δ hδ + let C : ℝ := 8*R+8*‖x‖+ε+4 + have hC : 0 < C := by dsimp [C]; positivity + let η : ℝ := min (ε/4) (min 1 (δ/C)) + have hη : 0 < η := lt_min (by positivity) (lt_min (by norm_num) (div_pos hδ hC)) + have hηε : η < ε/2 := lt_of_le_of_lt (min_le_left _ _) (by linarith) + have hη1 : η ≤ 1 := (min_le_right _ _).trans (min_le_left _ _) + have hηδ : C*η ≤ δ := by + have hh : η ≤ δ/C := (min_le_right _ _).trans (min_le_right _ _) + nlinarith [(le_div_iff₀ hC).mp hh] + obtain ⟨H,hH,hclose⟩ := happrox η hη + let p := A.segments.headDual H x + have hp : ∀ v, v ∉ H → p (A.segments.unitVector v)=0 := by + intro v hv + exact (A.segments.headDual_unit H x v).trans (ite_eq_right hv) + have hpn : ‖p‖ ≤ ‖x‖ := A.headDual_norm_le hH x + have hsmall : ‖x-p‖ < η := hclose + have hplower : ‖x‖-η ≤ ‖p‖ := by + have h := norm_sub_norm_le x p + linarith + obtain ⟨i,j,hij,hhead⟩ := A.finite_head_pair hH z hz hη + let w := (1/2:ℝ) • (z i-z j) + have hw : ε/2 ≤ ‖w‖ := by + dsimp [w] + rw [norm_smul,Real.norm_eq_abs] + norm_num + linarith [hsep i j hij] + have hwl : ε/2-η ≤ ‖A.segments.tailDual H w‖ := by + have h := norm_sub_norm_le w (A.segments.headDual H w) + change ‖w‖-‖A.segments.headDual H w‖ ≤ ‖A.segments.tailDual H w‖ at h + linarith + obtain ⟨hwp,hwm⟩ := A.average_lens z hplus hminus i j + have hpp : ‖p+w‖ ≤ R+η := by + have he : p+w = (x+w)-(x-p) := by module + rw [he] + exact (norm_sub_le _ _).trans (add_le_add hwp hsmall.le) + have hpm : ‖p-w‖ ≤ R+η := by + have he : p-w = (x-w)-(x-p) := by module + rw [he] + exact (norm_sub_le _ _).trans (add_le_add hwm hsmall.le) + have hbudget := A.intrinsic_tail_sq hfin hH (add_nonneg hR hη.le) hp hpp hpm + have hpsq : ‖x‖^2 - 2*‖x‖*η ≤ ‖p‖^2 := by + nlinarith [sq_nonneg (‖x‖-‖p‖),mul_nonneg (norm_nonneg x) (sub_nonneg.mpr hplower)] + have hw2 : (ε/2)^2-ε*η ≤ ‖A.segments.tailDual H w‖^2 := by + have hh := (sq_le_sq₀ (by linarith : 0 ≤ ε/2-η) (norm_nonneg _)).2 hwl + nlinarith + have hη2 : η^2 ≤ η := by nlinarith + dsimp [C] at hηδ + nlinarith + +end Ancestry + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Backward.lean b/lean/OAI/Analysis/DiamondDistortion/Backward.lean new file mode 100644 index 0000000000000000000000000000000000000000..319a28382ffefed80f0736484e7c88196544bdd3 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Backward.lean @@ -0,0 +1,173 @@ +import OAI.Analysis.DiamondDistortion.AMUC + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Midpoint +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Symmetry and convexity along a ray, proved by the explicit two-endpoint + convex combinations. -/ +lemma lens_shrink {a R : ℝ} (ha : 0 ≤ a) (ha1 : a ≤ 1) (u v : X) + (hp : ‖u+v‖ ≤ R) (hm : ‖u-v‖ ≤ R) : + max ‖u+a • v‖ ‖u-a • v‖ ≤ R := by + have hn1 : 0 ≤ (1+a)/2 := by positivity + have hn2 : 0 ≤ (1-a)/2 := by linarith + have hn (v w : X) (hv : ‖v‖ ≤ R) (hw : ‖w‖ ≤ R) : + ‖((1+a)/2) • v+((1-a)/2) • w‖ ≤ R := by + calc + _ ≤ ‖((1+a)/2) • v‖+‖((1-a)/2) • w‖ := norm_add_le _ _ + _ = ((1+a)/2)*‖v‖+((1-a)/2)*‖w‖ := by + rw [norm_smul,norm_smul,Real.norm_of_nonneg hn1,Real.norm_of_nonneg hn2] + _ ≤ ((1+a)/2)*R+((1-a)/2)*R := add_le_add + (mul_le_mul_of_nonneg_left hv hn1) (mul_le_mul_of_nonneg_left hw hn2) + _ = R := by ring + apply max_le + · have he : u+a • v=((1+a)/2) • (u+v)+((1-a)/2) • (u-v) := by module + rw [he] + exact hn _ _ hp hm + · have he : u-a • v=((1+a)/2) • (u-v)+((1-a)/2) • (u+v) := by module + rw [he] + exact hn _ _ hm hp + +/-- The unit-sphere finite-codimensional version of the local midpoint input. -/ +def LocalQuotientGain (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] + (t g : ℝ) : Prop := + ∀ u : X,‖u‖=1 → ∃ F : Submodule ℝ X,IsClosed (F : Set X) ∧ + FiniteDimensional ℝ (X ⧸ F) ∧ + ∀ y : X,y ∈ F → ‖y‖=1 → 1+g ≤ max ‖u+t • y‖ ‖u-t • y‖ + +lemma LocalQuotientGain.large_step {t g : ℝ} (ht : 0 < t) + (h : LocalQuotientGain X t g) : QuotientGain X t g := by + intro u hu + obtain ⟨F,hclosed,hfinite,hF⟩ := h u hu + refine ⟨F,hclosed,hfinite,?_⟩ + intro v hv htv + have hv0 : 0 < ‖v‖ := ht.trans_le htv + have hunit : ‖‖v‖⁻¹ • v‖=1 := by + rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hv0.le),inv_mul_cancel₀ hv0.ne'] + have hl := hF (‖v‖⁻¹ • v) (F.smul_mem _ hv) hunit + have hle := lens_shrink (show 0 ≤ t/‖v‖ by positivity) + ((div_le_one₀ hv0).mpr htv) u v + (le_max_left ‖u+v‖ ‖u-v‖) (le_max_right ‖u+v‖ ‖u-v‖) + simp only [smul_smul,← div_eq_mul_inv] at hl + exact hl.trans hle + +/-- Closed finite-codimensional subspaces, with the two conditions separately + retained, not replaced by a coordinate-null convention. -/ +def Cof (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] := + {F : Submodule ℝ X // IsClosed (F : Set X) ∧ FiniteDimensional ℝ (X ⧸ F)} + +def maximumModulus (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] (t : ℝ) : EReal := + ⨅ u : {u : X // ‖u‖=1}, ⨆ F : Cof X, + ⨅ y : {y : X // y ∈ F.val ∧ ‖y‖=1}, + ((max ‖u.val+t • y.val‖ ‖u.val-t • y.val‖-1 : ℝ) : EReal) + +def AMUC (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] : Prop := + ∀ t : ℝ,0 < t → t < 1 → 0 < maximumModulus X t + +lemma positive_modulus_gain {t : ℝ} (h : 0 < maximumModulus X t) : + ∃ g : ℝ,0 < g ∧ LocalQuotientGain X t g := by + obtain ⟨g,hg,hgδ⟩ := EReal.exists_between_coe_real h + refine ⟨g,by exact_mod_cast hg,?_⟩ + intro u hu + let M : {w : X // ‖w‖=1} → EReal := fun w => + ⨆ F : Cof X, ⨅ y : {y : X // y ∈ F.val ∧ ‖y‖=1}, + ((max ‖w.val+t • y.val‖ ‖w.val-t • y.val‖-1 : ℝ) : EReal) + have hmu : maximumModulus X t ≤ M ⟨u,hu⟩ := + iInf_le M (⟨u,hu⟩ : {w : X // ‖w‖=1}) + have hgu := hgδ.trans_le hmu + change (g : EReal) < ⨆ F : Cof X, + ⨅ y : {y : X // y ∈ F.val ∧ ‖y‖=1}, + ((max ‖u+t • y.val‖ ‖u-t • y.val‖-1 : ℝ) : EReal) at hgu + obtain ⟨F,hF⟩ := lt_iSup_iff.mp hgu + refine ⟨F.val,F.property.1,F.property.2,?_⟩ + intro y hyF hy1 + have hvalue : (⨅ z : {z : X // z ∈ F.val ∧ ‖z‖=1}, + ((max ‖u+t • z.val‖ ‖u-t • z.val‖-1 : ℝ) : EReal)) ≤ + ((max ‖u+t • y‖ ‖u-t • y‖-1 : ℝ) : EReal) := + iInf_le (fun z : {z : X // z ∈ F.val ∧ ‖z‖=1} => + ((max ‖u+t • z.val‖ ‖u-t • z.val‖-1 : ℝ) : EReal)) + (⟨y,hyF,hy1⟩ : {z : X // z ∈ F.val ∧ ‖z‖=1}) + have hb := hF.trans_le hvalue + have hh : g < max ‖u+t • y‖ ‖u-t • y‖-1 := by exact_mod_cast hb + linarith + +end Midpoint + +namespace Diamond +variable {X Y : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] + +/-- AMUC forbids a single distortion bound for the normalized countably branching + diamonds. Finite dimensional spaces are automatically covered as well. -/ +theorem amuc_obstruction (hX : Midpoint.AMUC X) : ¬ UniformEmbeddings X := by + rintro ⟨D,h⟩ + obtain ⟨f₀,s₀,h₀⟩ := h 0 + have hD : 0 < D := lt_of_lt_of_le (by norm_num) h₀.1 + let t := 1/(2*D) + have ht : 0 < t := by dsimp [t]; positivity + have ht1 : t < 1 := (div_lt_one (by positivity : 0 < 2*D)).mpr (by linarith [h₀.1]) + obtain ⟨g,hg,hgX⟩ := Midpoint.positive_modulus_gain (hX t ht ht1) + obtain ⟨k,hk'⟩ := exists_nat_gt (D/g) + have hkg : D < (k:ℝ)*g := (div_lt_iff₀ hg).mp hk' + have hBern := one_add_mul_le_pow (by linarith : (-2:ℝ) ≤ g) k + have hk : D < (1+g)^k := by linarith + obtain ⟨f,s,hf⟩ := h k + have hh := quotient_full_gain ht hg (le_refl t) (hgX.large_step ht) k f hf + have hp : 0 < (1+g)^k := by positivity + have hpow : (1+g)^k ≤ D := by simpa only [one_mul] using (le_div_iff₀ hp).mp hh + exact (not_lt_of_ge hpow) hk + +/-- Transport of distortion under exact two-sided norm equivalence. The linear + equivalence is simply the identification of the original space with its + equivalent-norm copy; there is no change of graph or choice of scales. -/ +lemma equivalent_distortion (e : X ≃ₗ[ℝ] Y) {a b : ℝ} (ha : 0 < a) (hb : 0 < b) + (he : ∀ x : X,a*‖x‖ ≤ ‖e x‖ ∧ ‖e x‖ ≤ b*‖x‖) + {k : ℕ} (f : Vertex k → X) {D s : ℝ} (hf : HasDistortion k f D s) : + HasDistortion k (fun v => e (f v)) ((b/a)*D) (a*s) := by + have hab : a ≤ b := by + have hl := slope_lower f (fun u v => (hf.2.2 u v).1) (baseEdge k) + have hn : 0 < ‖slope f (baseEdge k)‖ := hf.2.1.trans_le hl + have h := (he (slope f (baseEdge k))).1.trans (he (slope f (baseEdge k))).2 + exact (mul_le_mul_iff_left₀ hn).mp (by simpa only [mul_comm] using h) + have hba : 1 ≤ b/a := (one_le_div ha).mpr hab + refine ⟨?_,mul_pos ha hf.2.1,?_⟩ + · nlinarith [hf.1] + · intro u v + rw [← map_sub] + constructor + · have hh := mul_le_mul_of_nonneg_left (hf.2.2 u v).1 ha.le + have hh' : (a*s)*distance k u v ≤ a*‖f u-f v‖ := by simpa only [mul_assoc] using hh + exact hh'.trans (he (f u-f v)).1 + · have hh := ((he (f u-f v)).2).trans + (mul_le_mul_of_nonneg_left (hf.2.2 u v).2 hb.le) + have hid : b*(D*s*distance k u v)=((b/a)*D)*(a*s)*distance k u v := by + field_simp + rwa [hid] at hh + +theorem equivalent_amuc [CompleteSpace X] [CompleteSpace Y] + (e : X ≃ₗ[ℝ] Y) {a b : ℝ} (ha : 0 < a) (hb : 0 < b) + (he : ∀ x : X,a*‖x‖ ≤ ‖e x‖ ∧ ‖e x‖ ≤ b*‖x‖) + (hY : Midpoint.AMUC Y) : ¬ UniformEmbeddings X := by + rintro ⟨D,h⟩ + apply amuc_obstruction hY + refine ⟨(b/a)*D,?_⟩ + intro k + obtain ⟨f,s,hf⟩ := h k + exact ⟨fun v => e (f v),a*s,equivalent_distortion e ha hb he f hf⟩ + +end Diamond + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/CoordinateDual.lean b/lean/OAI/Analysis/DiamondDistortion/CoordinateDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..88d9b8279205b6c1427e852c6144d07282b47ac9 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/CoordinateDual.lean @@ -0,0 +1,410 @@ +import OAI.Analysis.DiamondDistortion.StartModels + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace CoordinateCompletion.Data +variable {ι κ : Type*} (A : CoordinateCompletion.Data ι) +abbrev Dual := StrongDual ℝ A.Space + +def dualEmbedding : (ι →₀ ℝ) →ₗ[ℝ] A.Dual := + Finsupp.linearCombination ℝ A.coordinate +lemma dualEmbedding_apply (v : ι →₀ ℝ) (x : A.Space) : + A.dualEmbedding v x=∑ i ∈ v.support,v i*A.coordinate i x := by + simp only [dualEmbedding,Finsupp.linearCombination_apply,Finsupp.sum, + sum_apply,smul_apply,smul_eq_mul] +lemma dualEmbedding_embedding (v w : ι →₀ ℝ) : + A.dualEmbedding v (A.embedding w)=∑ i ∈ v.support,v i*w i := by + rw [A.dualEmbedding_apply] + simp only [coordinate_embedding] + +def dualProjection (S : Finset ι) : A.Dual →L[ℝ] A.Dual := + ∑ i ∈ S,(ContinuousLinearMap.apply ℝ ℝ (A.unit i)).smulRight (A.coordinate i) +lemma dualProjection_apply (S : Finset ι) (x : A.Dual) : + A.dualProjection S x=∑ i ∈ S,x (A.unit i) • A.coordinate i := by simp [dualProjection] +lemma dualProjection_unit (S : Finset ι) (x : A.Dual) (i : ι) : + A.dualProjection S x (A.unit i)=if i ∈ S then x (A.unit i) else 0 := by + rw [dualProjection_apply] + simp [coordinate_unit,mul_ite] +lemma dualProjection_idempotent (S : Finset ι) (x : A.Dual) : + A.dualProjection S (A.dualProjection S x)=A.dualProjection S x := by + rw [dualProjection_apply] + simp only [dualProjection_unit] + rw [dualProjection_apply] + apply Finset.sum_congr rfl + intro i hi + rw [ite_eq_left hi] +lemma dualProjection_fixed (v : ι →₀ ℝ) {S : Finset ι} (hS : v.support ⊆ S) : + A.dualProjection S (A.dualEmbedding v)=A.dualEmbedding v := by + have hev (i : ι) : A.dualEmbedding v (A.unit i)=v i := by + rw [unit,dualEmbedding_embedding] + simp [Finsupp.single_apply,mul_ite] + exact fun h => h.symm + rw [dualProjection_apply] + simp only [hev] + change (∑ i ∈ S,v i • A.coordinate i)=∑ i ∈ v.support,v i • A.coordinate i + exact Eq.symm (Finset.sum_subset hS (by intro i _ hi; rw [Finsupp.notMem_support_iff.mp hi,zero_smul])) + +def dualHeadMap (S : Finset ι) : (S → ℝ) →ₗ[ℝ] A.Dual where + toFun a := ∑ i : S,a i • A.coordinate i + map_add' a b := by simp [Pi.add_apply,add_smul,Finset.sum_add_distrib] + map_smul' t a := by simp [Pi.smul_apply,smul_smul,Finset.smul_sum] +lemma dualProjection_finite (S : Finset ι) : + FiniteDimensional ℝ (LinearMap.range (A.dualProjection S).toLinearMap) := by + have hle : LinearMap.range (A.dualProjection S).toLinearMap ≤ LinearMap.range (A.dualHeadMap S) := by + rintro x ⟨y,rfl⟩ + refine ⟨fun i => y (A.unit i),?_⟩ + change (∑ i : S,y (A.unit i) • A.coordinate i)=A.dualProjection S y + rw [dualProjection_apply] + exact Finset.sum_attach S (fun i => y (A.unit i) • A.coordinate i) + let : FiniteDimensional ℝ (LinearMap.range (A.dualHeadMap S)) := Module.Finite.range _ + exact Submodule.finiteDimensional_of_le hle + +lemma embedding_sum (v : ι →₀ ℝ) : A.embedding v=∑ i ∈ v.support,v i • A.unit i := by + simp only [unit,← map_smul,← map_sum] + congr 1 + ext i + simp [Finsupp.single_apply,Finset.sum_ite_eq'] +lemma pairing (x : A.Dual) (v : ι →₀ ℝ) : + x (A.embedding v)=∑ i ∈ v.support,v i*x (A.unit i) := by + rw [embedding_sum,map_sum] + simp only [map_smul,smul_eq_mul] + +lemma small_color_tail_upper (c : ι → κ) + (hblock : ∀ p q : ι →₀ ℝ,Disjoint (p.support.image c) (q.support.image c) → + (A.seminorm (p+q))^2 ≤ (A.seminorm p)^2+(A.seminorm q)^2) + (x : A.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ C : Finset κ, ∀ p : ι →₀ ℝ, (∀ v ∈ p.support, c v ∉ C) → + x (A.embedding p) ≤ ε*A.seminorm p := by + classical + by_contra hn + push Not at hn + have hchoose (C : Finset κ) : ∃ q : ι →₀ ℝ, + (∀ v ∈ q.support,c v ∉ C) ∧ A.seminorm q=1 ∧ ε < x (A.embedding q) := by + obtain ⟨p,hout,hval⟩ := hn C + have hpn0 : A.seminorm p ≠ 0 := by + intro he + have hp0 := A.separates p he + simp only [hp0,map_zero,mul_zero,lt_self_iff_false] at hval + have hpn : 0 < A.seminorm p := lt_of_le_of_ne (apply_nonneg _ _) hpn0.symm + let q := (A.seminorm p)⁻¹ • p + refine ⟨q, ?_, ?_, ?_⟩ + · intro v hv + apply hout v + apply Finsupp.mem_support_iff.mpr + intro hpv + have hqv : q v=0 := by simp [q,Finsupp.smul_apply,hpv] + exact (Finsupp.mem_support_iff.mp hv) hqv + · simp only [q,map_smul_eq_mul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hpn)] + exact inv_mul_cancel₀ hpn0 + · simp only [q,map_smul,smul_eq_mul] + rw [inv_mul_eq_div] + exact (lt_div_iff₀ hpn).mpr hval + have hblocks : ∀ n : ℕ, ∃ p : ι →₀ ℝ, + (A.seminorm p)^2 ≤ (n : ℝ) ∧ (n : ℝ)*ε ≤ x (A.embedding p) := by + intro n + induction n with + | zero => exact ⟨0,by simp only [map_zero,zero_pow (by decide : 2 ≠ 0),Nat.cast_zero,le_refl], + by simp only [map_zero,Nat.cast_zero,zero_mul,le_refl]⟩ + | succ n ih => + obtain ⟨p,hpn,hpx⟩ := ih + obtain ⟨q,hqout,hqn,hqx⟩ := hchoose (p.support.image c) + have hd : Disjoint (p.support.image c) (q.support.image c) := by + apply Finset.disjoint_left.mpr + intro a hap haq + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp haq + exact hqout v hv hap + refine ⟨p+q, ?_, ?_⟩ + · have h := hblock p q hd + rw [hqn] at h + push_cast + nlinarith + · simp only [map_add,Nat.cast_add,Nat.cast_one] + nlinarith + obtain ⟨n,hn⟩ := exists_nat_gt (‖x‖^2/ε^2) + have hn0 : (0:ℝ) < n := lt_of_le_of_lt (div_nonneg (sq_nonneg _) (sq_nonneg _)) hn + have hnε : ‖x‖^2 < (n:ℝ)*ε^2 := (div_lt_iff₀ (sq_pos_of_pos hε)).mp hn + obtain ⟨p,hpn,hpx⟩ := hblocks n + have hxb : x (A.embedding p) ≤ ‖x‖*A.seminorm p := by + calc + _ ≤ ‖x (A.embedding p)‖ := Real.le_norm_self _ + _ ≤ ‖x‖*‖A.embedding p‖ := x.le_opNorm _ + _ = _ := by rw [A.norm_embedding] + have hprod : (n:ℝ)*ε ≤ ‖x‖*A.seminorm p := hpx.trans hxb + have hsquare := (sq_le_sq₀ (mul_nonneg hn0.le hε.le) + (mul_nonneg (norm_nonneg _) (apply_nonneg _ _))).2 hprod + have hmul := mul_le_mul_of_nonneg_left hpn (sq_nonneg ‖x‖) + have hcontra := mul_pos hn0 (sub_pos.mpr hnε) + nlinarith + +lemma small_color_tail (c : ι → κ) + (hblock : ∀ p q : ι →₀ ℝ,Disjoint (p.support.image c) (q.support.image c) → + (A.seminorm (p+q))^2 ≤ (A.seminorm p)^2+(A.seminorm q)^2) + (x : A.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ C : Finset κ, ∀ p : ι →₀ ℝ, (∀ v ∈ p.support, c v ∉ C) → + |x (A.embedding p)| ≤ ε*A.seminorm p := by + obtain ⟨C,hC⟩ := A.small_color_tail_upper c hblock x hε + refine ⟨C,?_⟩ + intro p hp + apply abs_le.mpr + refine ⟨?_,hC p hp⟩ + have h := hC (-p) (by simpa only [Finsupp.support_neg] using hp) + simp only [map_neg,map_neg_eq_map] at h + linarith + +/-- Orthogonal outer blocks whose finite unions have their actual norm equivalent + to coordinate ℓ². Constants may depend on the finite union, not globally. -/ +structure HilbertBlocks (c : ι → κ) : Prop where + orthogonal : ∀ p q : ι →₀ ℝ,Disjoint (p.support.image c) (q.support.image c) → + (A.seminorm (p+q))^2 ≤ (A.seminorm p)^2+(A.seminorm q)^2 + contractive : ∀ p : ι →₀ ℝ,∀ C : Set κ, + A.seminorm (p.filter (fun i => c i ∈ C)) ≤ A.seminorm p + upper : ∀ C : Finset κ,∃ B : ℝ,0 < B ∧ ∀ p : ι →₀ ℝ, + (∀ i ∈ p.support,c i ∈ C) → + (A.seminorm p)^2 ≤ B*(∑ i ∈ p.support,p i^2) + lower : ∀ C : Finset κ,∃ L : ℝ,0 < L ∧ ∀ p : ι →₀ ℝ, + (∀ i ∈ p.support,c i ∈ C) → + (∑ i ∈ p.support,p i^2) ≤ L*(A.seminorm p)^2 + +end CoordinateCompletion.Data + +namespace FiniteCoordinates +variable {ι : Type*} +def array (S : Finset ι) (a : ι → ℝ) : ι →₀ ℝ := ∑ i ∈ S,a i • Finsupp.single i 1 +lemma array_apply (S : Finset ι) (a : ι → ℝ) (i : ι) : + array S a i=if i ∈ S then a i else 0 := by + simp [array,Finsupp.single_apply,Finset.sum_ite_eq'] +lemma array_support (S : Finset ι) (a : ι → ℝ) : (array S a).support ⊆ S := by + intro i hi + by_contra hn + exact (Finsupp.mem_support_iff.mp hi) (by rw [array_apply,ite_eq_right hn]) +lemma array_energy (S : Finset ι) (a : ι → ℝ) : + (∑ i ∈ (array S a).support,array S a i^2)=∑ i ∈ S,a i^2 := by + calc + _ = ∑ i ∈ S,array S a i^2 := by + apply Finset.sum_subset (array_support S a) + intro i _ hi + rw [Finsupp.notMem_support_iff.mp hi] + norm_num + _ = _ := by + apply Finset.sum_congr rfl + intro i hi + rw [array_apply,ite_eq_left hi] +lemma filter_energy_le (p : ι →₀ ℝ) (Q : ι → Prop) [DecidablePred Q] : + (∑ i ∈ (p.filter Q).support,(p.filter Q) i^2) ≤ ∑ i ∈ p.support,p i^2 := by + rw [Finsupp.support_filter] + calc + _ = ∑ i ∈ p.support.filter Q,p i^2 := by + apply Finset.sum_congr rfl + intro i hi + rw [Finsupp.filter_apply,ite_eq_left (Finset.mem_filter.mp hi).2] + _ ≤ _ := Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) (fun _ _ _ => sq_nonneg _) +lemma square_tails (a : ι → ℝ) {M : ℝ} + (hM : ∀ S : Finset ι,(∑ i ∈ S,a i^2) ≤ M) {δ : ℝ} (hδ : 0 < δ) : + ∃ S : Finset ι,∀ U : Finset ι,Disjoint S U → (∑ i ∈ U,a i^2) < δ := by + let E : Set ℝ := Set.range (fun S : Finset ι => ∑ i ∈ S,a i^2) + have hEb : BddAbove E := ⟨M,by rintro _ ⟨S,rfl⟩; exact hM S⟩ + have hEn : E.Nonempty := ⟨0,∅,by simp⟩ + obtain ⟨b,⟨S,rfl⟩,hS⟩ := exists_lt_of_lt_csSup hEn (sub_lt_self (sSup E) hδ) + refine ⟨S,?_⟩ + intro U hU + have h := le_csSup hEb (show (∑ i ∈ S ∪ U,a i^2) ∈ E from ⟨S ∪ U,rfl⟩) + rw [Finset.sum_union hU] at h + linarith +end FiniteCoordinates + +namespace CoordinateCompletion.Data +variable {ι κ : Type*} (A : CoordinateCompletion.Data ι) +lemma pairing_array (S : Finset ι) (a : ι → ℝ) (x : A.Dual) : + x (A.embedding (FiniteCoordinates.array S a))=∑ i ∈ S,a i*x (A.unit i) := by + simp only [FiniteCoordinates.array,map_sum,map_smul,smul_eq_mul,unit] +lemma dualEmbedding_array (S : Finset ι) (a : ι → ℝ) (p : ι →₀ ℝ) : + A.dualEmbedding (FiniteCoordinates.array S a) (A.embedding p)=∑ i ∈ S,a i*p i := by + simp only [FiniteCoordinates.array,map_sum,map_smul] + change (∑ i ∈ S,a i • A.dualEmbedding (Finsupp.single i 1)) (A.embedding p)=_ + simp only [dualEmbedding,Finsupp.linearCombination_single,one_smul, + sum_apply,smul_apply,smul_eq_mul,coordinate_embedding] + +def coefficients (c : ι → κ) (C : Finset κ) (x : A.Dual) (i : ι) : ℝ := + if c i ∈ C then x (A.unit i) else 0 +lemma coefficients_bounded (c : ι → κ) (hblocks : A.HilbertBlocks c) (C : Finset κ) (x : A.Dual) : + ∃ M : ℝ,∀ S : Finset ι,(∑ i ∈ S,A.coefficients c C x i^2) ≤ M := by + obtain ⟨B,hB,hupper⟩ := hblocks.upper C + refine ⟨B*‖x‖^2,?_⟩ + intro S + let a := A.coefficients c C x + let p := FiniteCoordinates.array S a + let E := ∑ i ∈ S,a i^2 + have hE : 0 ≤ E := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hp : ∀ i ∈ p.support,c i ∈ C := by + intro i hi + by_contra hn + have he : a i=0 := ite_eq_right hn + have hh : p i=0 := by rw [FiniteCoordinates.array_apply,he]; split_ifs <;> rfl + exact (Finsupp.mem_support_iff.mp hi) hh + have hpn := hupper p hp + rw [FiniteCoordinates.array_energy] at hpn + have he : x (A.embedding p)=E := by + rw [pairing_array] + apply Finset.sum_congr rfl + intro i _ + dsimp [a,coefficients] + split_ifs <;> ring + have hval : E ≤ ‖x‖*A.seminorm p := by + rw [← he] + exact (Real.le_norm_self _).trans (by simpa only [norm_embedding] using x.le_opNorm (A.embedding p)) + have hs := (sq_le_sq₀ hE (by positivity : 0 ≤ ‖x‖*A.seminorm p)).mpr hval + have hm := mul_le_mul_of_nonneg_left hpn (sq_nonneg ‖x‖) + change E ≤ B*‖x‖^2 + by_contra hn + have hpos : 0 < E := lt_of_le_of_lt (by positivity) (lt_of_not_ge hn) + have hc := mul_pos hpos (sub_pos.mpr (lt_of_not_ge hn)) + change (A.seminorm p)^2 ≤ B*E at hpn + change ‖x‖^2*(A.seminorm p)^2 ≤ ‖x‖^2*(B*E) at hm + nlinarith only [hs,hm,hc] + +lemma dual_approximation (c : ι → κ) (hblocks : A.HilbertBlocks c) + (x : A.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ v : ι →₀ ℝ,‖x-A.dualEmbedding v‖ < ε := by + have hε4 : 0 < ε/4 := by positivity + obtain ⟨C,hC⟩ := A.small_color_tail c hblocks.orthogonal x hε4 + obtain ⟨L,hL,hlower⟩ := hblocks.lower C + have hsL : 0 < Real.sqrt L := Real.sqrt_pos.mpr hL + let t := ε/(4*Real.sqrt L) + have ht : 0 < t := by dsimp [t]; positivity + obtain ⟨M,hM⟩ := A.coefficients_bounded c hblocks C x + obtain ⟨S,hS⟩ := FiniteCoordinates.square_tails (A.coefficients c C x) hM (sq_pos_of_pos ht) + let H := S.filter (fun i => c i ∈ C) + let v := FiniteCoordinates.array H (fun i => x (A.unit i)) + refine ⟨v,?_⟩ + have hbound : ‖x-A.dualEmbedding v‖ ≤ ε/2 := by + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + intro z + induction z using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih z => + let p := A.array z + let pc := p.filter (fun i => c i ∈ C) + let qi := pc.filter (fun i => i ∉ S) + let qo := p.filter (fun i => c i ∉ C) + let qh := p.filter (fun i => i ∈ H) + have hiC : ∀ i ∈ qi.support,c i ∈ C := by + intro i hi + rw [Finsupp.support_filter] at hi + have hh := (Finset.mem_filter.mp hi).1 + rw [Finsupp.support_filter] at hh + exact (Finset.mem_filter.mp hh).2 + have hiS : Disjoint S qi.support := by + apply Finset.disjoint_left.mpr + intro i hi hqi + rw [Finsupp.support_filter] at hqi + exact (Finset.mem_filter.mp hqi).2 hi + have hout : ∀ i ∈ qo.support,c i ∉ C := by + intro i hi + rw [Finsupp.support_filter] at hi + exact (Finset.mem_filter.mp hi).2 + have hpc : A.seminorm pc ≤ A.seminorm p := by + simpa only [pc,Finset.mem_coe] using hblocks.contractive p (C : Set κ) + have hpn : 0 ≤ A.seminorm p := apply_nonneg _ _ + have hpcl := hlower pc (by + intro i hi + rw [Finsupp.support_filter] at hi + exact (Finset.mem_filter.mp hi).2) + have henergy : (∑ i ∈ qi.support,qi i^2) ≤ L*(A.seminorm p)^2 := by + simpa only [qi] using (FiniteCoordinates.filter_energy_le pc (fun i => i ∉ S)).trans + (hpcl.trans (mul_le_mul_of_nonneg_left + ((sq_le_sq₀ (apply_nonneg _ _) hpn).mpr hpc) hL.le)) + have hroot : Real.sqrt (∑ i ∈ qi.support,qi i^2) ≤ Real.sqrt L*A.seminorm p := by + apply (Real.sqrt_le_iff).mpr + refine ⟨by positivity,?_⟩ + rw [mul_pow,Real.sq_sqrt hL.le] + exact henergy + have htail : Real.sqrt (∑ i ∈ qi.support,A.coefficients c C x i^2) ≤ t := + (Real.sqrt_le_left ht.le).mpr (hS qi.support hiS).le + have hei : x (A.embedding qi)=∑ i ∈ qi.support,qi i*A.coefficients c C x i := by + rw [pairing] + apply Finset.sum_congr rfl + intro i hi + rw [coefficients,ite_eq_left (hiC i hi)] + have hival : |x (A.embedding qi)| ≤ (ε/4)*A.seminorm p := by + rw [hei] + calc + _ ≤ ∑ i ∈ qi.support,|qi i| * |A.coefficients c C x i| := by + simpa only [abs_mul] using Finset.abs_sum_le_sum_abs + (fun i => qi i*A.coefficients c C x i) qi.support + _ ≤ Real.sqrt (∑ i ∈ qi.support,qi i^2)*Real.sqrt (∑ i ∈ qi.support,A.coefficients c C x i^2) := by + simpa only [sq_abs] using Real.sum_mul_le_sqrt_mul_sqrt qi.support + (fun i => |qi i|) (fun i => |A.coefficients c C x i|) + _ ≤ (Real.sqrt L*A.seminorm p)*t := mul_le_mul hroot htail (Real.sqrt_nonneg _) (by positivity) + _ = _ := by dsimp [t]; field_simp [ne_of_gt hsL] + have hoval : |x (A.embedding qo)| ≤ (ε/4)*A.seminorm p := by + have hh : A.seminorm qo ≤ A.seminorm p := by + convert hblocks.contractive p {a | a ∉ C} using 1 + congr 1 + ext i + simp [qo,Finsupp.filter_apply] + exact (hC qo hout).trans (mul_le_mul_of_nonneg_left hh hε4.le) + have hsum : qh+qi+qo=p := by + ext i + by_cases hc : c i ∈ C <;> by_cases hs : i ∈ S <;> + simp [qh,qi,qo,pc,H,hc,hs] + have hv : A.dualEmbedding v (A.embedding p)=x (A.embedding qh) := by + rw [dualEmbedding_array] + have hqh : qh=FiniteCoordinates.array H (fun i => p i) := by + ext i + simp [qh,Finsupp.filter_apply,FiniteCoordinates.array_apply] + rw [hqh,pairing_array] + apply Finset.sum_congr rfl + intro i _ + ring + have hd : (x-A.dualEmbedding v) (A.embedding p)=x (A.embedding qi)+x (A.embedding qo) := by + change x (A.embedding p)-A.dualEmbedding v (A.embedding p)=_ + rw [hv,← hsum,map_add,map_add,map_add,map_add] + ring + rw [UniformSpace.Completion.norm_coe] + change ‖(x-A.dualEmbedding v) (A.embedding p)‖ ≤ (ε/2)*A.seminorm p + rw [hd,Real.norm_eq_abs] + exact (abs_add_le _ _).trans ((add_le_add hival hoval).trans_eq (by ring)) + exact hbound.trans_lt (by linarith) + +lemma dual_separable [Countable ι] (c : ι → κ) (hblocks : A.HilbertBlocks c) : + TopologicalSpace.SeparableSpace A.Dual := by + let V := Submodule.span ℝ (Set.range A.coordinate) + have hdense : Dense (V : Set A.Dual) := by + intro x + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨v,hv⟩ := A.dual_approximation c hblocks x hε + refine ⟨A.dualEmbedding v,?_,?_⟩ + · change (∑ i ∈ v.support,v i • A.coordinate i) ∈ V + exact Submodule.sum_mem V (fun i _ => V.smul_mem _ (Submodule.subset_span ⟨i,rfl⟩)) + · simpa only [dist_eq_norm] using hv + apply hdense.isSeparable_iff.mp + exact (Set.countable_range A.coordinate).isSeparable.span + +lemma dualProjection_commutes (S T : Finset ι) (x : A.Dual) : + A.dualProjection S (A.dualProjection T x)=A.dualProjection T (A.dualProjection S x) := by + rw [A.dualProjection_apply S (A.dualProjection T x), + A.dualProjection_apply T (A.dualProjection S x)] + simp only [dualProjection_unit,ite_smul,zero_smul] + rw [← Finset.sum_filter,← Finset.sum_filter] + congr 1 + ext i + simp only [Finset.mem_filter,and_comm] + +end CoordinateCompletion.Data + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/CoordinateSpace.lean b/lean/OAI/Analysis/DiamondDistortion/CoordinateSpace.lean new file mode 100644 index 0000000000000000000000000000000000000000..d24644f6b0222a6c10ef68095894aa4a6c53a4c8 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/CoordinateSpace.lean @@ -0,0 +1,168 @@ +import OAI.Analysis.DiamondDistortion.PathBounds + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace CoordinateCompletion +variable {ι : Type*} + +/-- A specified coordinate norm, with individually bounded coordinate evaluations. + No bound on the norms of coordinate projections is imposed. -/ +structure Data (ι : Type*) where + seminorm : Seminorm ℝ (ι →₀ ℝ) + coordinate_bound : ∀ i,∃ C : ℝ,∀ v,|v i| ≤ C*seminorm v + +namespace Data +variable (A : Data ι) +lemma separates (v : ι →₀ ℝ) (hv : A.seminorm v=0) : v=0 := by + ext i + obtain ⟨C,hC⟩ := A.coordinate_bound i + have hh := hC v + rw [hv,mul_zero] at hh + exact abs_nonpos_iff.mp hh + +def Finite (_A : Data ι) := ι →₀ ℝ +instance : AddCommGroup A.Finite := inferInstanceAs (AddCommGroup (ι →₀ ℝ)) +instance : Module ℝ A.Finite := inferInstanceAs (Module ℝ (ι →₀ ℝ)) +instance : NormedAddCommGroup A.Finite := AddGroupNorm.toNormedAddCommGroup + { A.seminorm.toAddGroupSeminorm with eq_zero_of_map_eq_zero' := A.separates } +instance : NormedSpace ℝ A.Finite where + norm_smul_le t v := le_of_eq (A.seminorm.smul' t v) +abbrev Space := UniformSpace.Completion A.Finite + +def finite (v : ι →₀ ℝ) : A.Finite := v +def array (v : A.Finite) : ι →₀ ℝ := v +def embedding : (ι →₀ ℝ) →ₗ[ℝ] A.Space := + (UniformSpace.Completion.toComplL (S := ℝ) (α := A.Finite)).toLinearMap +@[simp] lemma norm_embedding (v : ι →₀ ℝ) : ‖A.embedding v‖=A.seminorm v := + UniformSpace.Completion.norm_coe _ + +def coordinateFinite (i : ι) : A.Finite →L[ℝ] ℝ := + (show A.Finite →ₗ[ℝ] ℝ from Finsupp.lapply i).mkContinuous + (A.coordinate_bound i).choose (by + intro v + change ‖(show ι →₀ ℝ from v) i‖ ≤ (A.coordinate_bound i).choose*A.seminorm v + simpa only [Real.norm_eq_abs] using (A.coordinate_bound i).choose_spec v) +def coordinate (i : ι) : A.Space →L[ℝ] ℝ := + (A.coordinateFinite i).extend UniformSpace.Completion.toComplL +@[simp] lemma coordinate_coe (i : ι) (v : A.Finite) : A.coordinate i (v : A.Space)=A.array v i := + ContinuousLinearMap.extend_eq _ UniformSpace.Completion.denseRange_coe + (UniformSpace.Completion.isUniformInducing_coe _) v +@[simp] lemma coordinate_embedding (i : ι) (v : ι →₀ ℝ) : A.coordinate i (A.embedding v)=v i := + A.coordinate_coe i (A.finite v) +def unit (i : ι) : A.Space := A.embedding (Finsupp.single i 1) +@[simp] lemma coordinate_unit (i j : ι) : A.coordinate i (A.unit j)=if j=i then 1 else 0 := by + simp [unit,Finsupp.single_apply] + +def projection (H : Finset ι) : A.Space →L[ℝ] A.Space := + ∑ i ∈ H,(A.coordinate i).smulRight (A.unit i) +@[simp] lemma projection_apply (H : Finset ι) (x : A.Space) : + A.projection H x=∑ i ∈ H,A.coordinate i x • A.unit i := by simp [projection] +@[simp] lemma coordinate_projection (H : Finset ι) (x : A.Space) (i : ι) : + A.coordinate i (A.projection H x)=if i ∈ H then A.coordinate i x else 0 := by + simp [projection_apply,map_sum,map_smul,smul_eq_mul,mul_ite,Finset.sum_ite_eq'] +lemma projection_idempotent (H : Finset ι) (x : A.Space) : + A.projection H (A.projection H x)=A.projection H x := by + rw [A.projection_apply H (A.projection H x)] + simp only [coordinate_projection] + rw [projection_apply] + apply Finset.sum_congr rfl + intro i hi + rw [ite_eq_left hi] +lemma projection_commutes (H K : Finset ι) (x : A.Space) : + A.projection H (A.projection K x)=A.projection K (A.projection H x) := by + rw [A.projection_apply H (A.projection K x), + A.projection_apply K (A.projection H x)] + simp only [coordinate_projection,ite_smul,zero_smul] + rw [← Finset.sum_filter,← Finset.sum_filter] + congr 1 + ext i + simp only [Finset.mem_filter,and_comm] + +def headMap (H : Finset ι) : (H → ℝ) →ₗ[ℝ] A.Space where + toFun a := ∑ i : H,a i • A.unit i + map_add' a b := by simp [Pi.add_apply,add_smul,Finset.sum_add_distrib] + map_smul' t a := by simp [Pi.smul_apply,smul_smul,Finset.smul_sum] +lemma projection_range (H : Finset ι) : LinearMap.range (A.projection H).toLinearMap ≤ + LinearMap.range (A.headMap H) := by + rintro x ⟨y,rfl⟩ + refine ⟨fun i => A.coordinate i y,?_⟩ + change (∑ i : H,A.coordinate i y • A.unit i)=A.projection H y + rw [projection_apply] + exact Finset.sum_attach H (fun i => A.coordinate i y • A.unit i) + +lemma projection_finite (H : Finset ι) : FiniteDimensional ℝ (LinearMap.range (A.projection H).toLinearMap) := by + let : FiniteDimensional ℝ (LinearMap.range (A.headMap H)) := Module.Finite.range (A.headMap H) + exact Submodule.finiteDimensional_of_le (A.projection_range H) + +lemma projection_embedding (H : Finset ι) (v : ι →₀ ℝ) : + A.projection H (A.embedding v)=A.embedding (v.filter (· ∈ H)) := by + rw [projection_apply] + simp only [coordinate_embedding,unit] + simp_rw [← map_smul] + rw [← map_sum] + congr 1 + ext i + simp [Finsupp.single_apply,Finsupp.filter_apply,Finset.sum_ite_eq'] + +lemma finite_fixed (v : ι →₀ ℝ) {H : Finset ι} (hH : v.support ⊆ H) : + A.projection H (A.embedding v)=A.embedding v := by + rw [projection_embedding] + congr 1 + ext i + rw [Finsupp.filter_apply] + split_ifs with hi + · rfl + · exact (Finsupp.notMem_support_iff.mp (fun hv => hi (hH hv))).symm + +lemma approximation (x : A.Space) {η : ℝ} (hη : 0 < η) : + ∃ v : ι →₀ ℝ,‖x-A.embedding v‖ < η := by + obtain ⟨v,hv⟩ := UniformSpace.Completion.denseRange_coe.exists_dist_lt x hη + refine ⟨A.array v,?_⟩ + change ‖x-(v : A.Space)‖ < η + simpa only [dist_eq_norm] using hv + +end Data +end CoordinateCompletion + +namespace CoordinateCompletion.Data +variable {ι κ : Type*} (A : CoordinateCompletion.Data ι) + +def heads (H : κ → Finset ι) (hcover : ∀ S : Finset ι,∃ h,S ⊆ H h) : Midpoint.Heads κ A.Space where + projection h := A.projection (H h) + idempotent h := A.projection_idempotent (H h) + finite h := A.projection_finite (H h) + approximation x η hη := by + obtain ⟨v,hv⟩ := A.approximation x hη + obtain ⟨h,hh⟩ := hcover v.support + exact ⟨h,A.embedding v,A.finite_fixed v hh,hv⟩ +lemma heads_commutes (H : κ → Finset ι) (hcover : ∀ S : Finset ι,∃ h,S ⊆ H h) : + (A.heads H hcover).Commutes := by + intro i j x + exact A.projection_commutes (H i) (H j) x + +/-- Every vector fixed by a finite head is an actual finite coordinate vector. -/ +lemma projection_eq_embedding (H : Finset ι) (x : A.Space) : + ∃ v : ι →₀ ℝ,A.projection H x=A.embedding v := by + refine ⟨∑ i ∈ H,(A.coordinate i x) • Finsupp.single i 1,?_⟩ + rw [projection_apply,map_sum] + simp only [map_smul,unit] +lemma fixed_finite {H : Finset ι} {x : A.Space} (hx : A.projection H x=x) : + ∃ v : ι →₀ ℝ,x=A.embedding v := by + obtain ⟨v,hv⟩ := A.projection_eq_embedding H x + exact ⟨v,hx ▸ hv⟩ + +end CoordinateCompletion.Data + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Descent.lean b/lean/OAI/Analysis/DiamondDistortion/Descent.lean new file mode 100644 index 0000000000000000000000000000000000000000..445f27d6c2bb813bcabfb9725cc45550d5916fa2 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Descent.lean @@ -0,0 +1,132 @@ +import OAI.Analysis.DiamondDistortion.HeadProjections + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace PathModel +open RecursiveModel DirectLayers SignCube +/-- Ancestral coordinate projections for the literal linear path cost are + contractive, jointly cofinal, and nested in both orders. -/ +theorem linear_regular : Regular linearHeads where + nonempty := head_nonempty + upper := head_upper + nested_left H K hHK x := linearData.projection_nested H.val K.val hHK x + nested_right H K hHK x := linearData.projection_nested_right H.val K.val hHK x + contractive := linear_projection_contractive + +theorem adaptive_graph (C : ℝ) (hin : SignInput linearHeads.projection C) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) + (hf : Diamond.HasDistortion k f D s) : + (k:ℝ)/16 ≤ C*(D^2+(k:ℝ)*((2:ℝ)^k)⁻¹^2) ∧ + C*(D^2+(k:ℝ)*((2:ℝ)^k)⁻¹^2) ≤ C*(D^2+1) := + DirectLayers.adaptive_graph linearHeads linear_regular hin k f hf + +theorem predictable_495_graph (hin : PredictableInput linearHeads.projection 495) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) + (hf : Diamond.HasDistortion k f D s) : (k:ℝ)/4 ≤ 495*(D+1)^2 := + DirectLayers.predictable_graph linearHeads linear_regular hin k f hf + +theorem variation_252_graph (hin : PredictableInput linearHeads.projection 252) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) + (hf : Diamond.HasDistortion k f D s) : (k:ℝ)/(16*D^2) ≤ 1008 := + DirectLayers.variation_graph linearHeads linear_regular hin k f hf + +theorem leakage_1024_graph (hin : LeakageInput linearHeads.projection) + {D s : ℝ} (k : ℕ) (hk : 1 ≤ k) (f : Diamond.Vertex k → LinearSpace) + (hf : Diamond.HasDistortion k f D s) : + (k:ℝ)/8 ≤ 1024*(D^2+(k:ℝ)*(leakageTolerance k)^2) ∧ + 1024*(D^2+(k:ℝ)*(leakageTolerance k)^2) ≤ 1024*(D^2+1) := + DirectLayers.leakage_graph linearHeads linear_regular hin k hk f hf + +theorem squared_gap_400_graph (hin : GapInput linearHeads.projection) + {D s γ : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) + (hf : Diamond.HasDistortion k f D s) (hγ : 0 < γ) + (hγa : γ < (2/D)/8) (hγk : γ < 1/((k:ℝ)+1)) : + ∃ T : Protocol LinearSpace ForestHead k, + T.Martingale ∧ T.Nested ∧ T.Anchored ∧ T.CommonHeads ∧ T.Supported linearHeads.projection ∧ + T.terminalEnergy ≤ 4 ∧ T.initialEnergy+(k:ℝ)*((2/D)/8)^2/400 ≤ T.terminalEnergy ∧ + (k:ℝ)*((2/D)/8)^2/400 ≤ T.initialEnergy+(k:ℝ)*((2/D)/8)^2/400 := + DirectLayers.gap_graph linearHeads linear_regular hin k f hf hγ hγa hγk +end PathModel + +namespace DirectSegmentApplications + +theorem deterministic_descent {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → ForestDual) + (hf : Diamond.HasDistortion k f D s) : (k:ℝ) ≤ 256*D^2 := by + have h := headline.1 k f D s hf + nlinarith [sq_nonneg D] + +theorem bin_descent {D : ℝ} (k : ℕ) (hk : 1 ≤ k) (f : Diamond.Vertex k → ForestDual) + (hl : ∀ u v,Diamond.distance k u v ≤ ‖f u-f v‖) + (hu : ∀ u v,‖f u-f v‖ ≤ D*Diamond.distance k u v) : Real.sqrt (k:ℝ)/144 < D := by + have hsl := Diamond.slope_lower f (s := 1) (by simpa only [one_mul] using hl) (Diamond.baseEdge k) + have hsu := Diamond.slope_upper f hu (Diamond.baseEdge k) + have hD : 1 ≤ D := le_trans hsl hsu + have hdist : Diamond.HasDistortion k f D 1 := ⟨hD,by norm_num,by simpa only [one_mul,mul_one] using fun u v => And.intro (hl u v) (hu u v)⟩ + have hh := headline.1 k f D 1 hdist + have hs := Real.sq_sqrt (Nat.cast_nonneg (α := ℝ) k) + have hsp := Real.sqrt_nonneg (k:ℝ) + have hk0 : (1:ℝ) ≤ k := by exact_mod_cast hk + apply (div_lt_iff₀ (by norm_num : (0:ℝ)<144)).mpr + nlinarith +end DirectSegmentApplications + +namespace Diamond +variable {X : Type*} [NormedAddCommGroup X] +/-- The redundant conventional condition D≥1 follows from the + all-pairs inequalities alone; thus HasDistortion adds no standing hypothesis. -/ +lemma hasDistortion_iff_all_pairs {k : ℕ} (f : Vertex k → X) (D s : ℝ) : + HasDistortion k f D s ↔ 0 < s ∧ ∀ u v, + s*distance k u v ≤ ‖f u-f v‖ ∧ ‖f u-f v‖ ≤ D*s*distance k u v := by + constructor + · exact fun h => h.2 + · rintro ⟨hs,h⟩ + have hh := (h (endpoint k (baseEdge k) false) (endpoint k (baseEdge k) true)).1.trans + (h (endpoint k (baseEdge k) false) (endpoint k (baseEdge k) true)).2 + rw [distance_edge] at hh + have hp : 0 < s*(1/(2:ℝ)^k) := by positivity + have hD : 1 ≤ D := (mul_le_mul_iff_left₀ hp).mp (by calc + (1:ℝ)*(s*(1/(2:ℝ)^k)) = s*(1/(2:ℝ)^k) := one_mul _ + _ ≤ D*s*(1/(2:ℝ)^k) := hh + _ = D*(s*(1/(2:ℝ)^k)) := by ring) + exact ⟨hD,hs,h⟩ +end Diamond + +theorem headline_all_pairs : + (∀ (k : ℕ) (f : Diamond.Vertex k → ForestDual) (D s : ℝ), + 0 < s → (∀ u v,s*Diamond.distance k u v ≤ ‖f u-f v‖ ∧ + ‖f u-f v‖ ≤ D*s*Diamond.distance k u v) → 1+(k:ℝ)/4 ≤ D^2) ∧ + (∀ (k : ℕ) (f : Diamond.Vertex k → InfinitePredual) (D s : ℝ), + 0 < s → (∀ u v,s*Diamond.distance k u v ≤ ‖f u-f v‖ ∧ + ‖f u-f v‖ ≤ D*s*Diamond.distance k u v) → 1+(k:ℝ)/4 ≤ D^2) := by + constructor + · intro k f D s hs h + exact headline.1 k f D s ((Diamond.hasDistortion_iff_all_pairs f D s).mpr ⟨hs,h⟩) + · intro k f D s hs h + exact headline.2 k f D s ((Diamond.hasDistortion_iff_all_pairs f D s).mpr ⟨hs,h⟩) + +theorem direct_atomic_obstruction_positive : + ¬ ∃ D : ℝ,∀ k : ℕ,1 ≤ k → ∃ (f : Diamond.Vertex k → ForestDual) (s : ℝ), + 0 < s ∧ ∀ u v,s*Diamond.distance k u v ≤ ‖f u-f v‖ ∧ + ‖f u-f v‖ ≤ D*s*Diamond.distance k u v := by + rintro ⟨D,h⟩ + obtain ⟨n,hn⟩ := exists_nat_gt (4*D^2) + obtain ⟨f,s,hs,hf⟩ := h (n+1) (by omega) + have hh := headline_all_pairs.1 (n+1) f D s hs hf + push_cast at hh + nlinarith + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/DiamondGraph.lean b/lean/OAI/Analysis/DiamondDistortion/DiamondGraph.lean new file mode 100644 index 0000000000000000000000000000000000000000..0823435c0ed5277f4bd3d1cd0569c94e0c7c2c46 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/DiamondGraph.lean @@ -0,0 +1,364 @@ +import OAI.Analysis.DiamondDistortion.ForestModels + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Diamond + +/-- Stage edges, retaining their parent, child number, and side. -/ +@[reducible] def Edge : ℕ → Type + | 0 => Unit + | n + 1 => Edge n × ℕ × Bool + +/-- At every replacement every parent edge receives countably many distinct new vertices. -/ +@[reducible] def Vertex : ℕ → Type + | 0 => Bool + | n + 1 => Vertex n ⊕ (Edge n × ℕ) + +def endpoint : (n : ℕ) → Edge n → Bool → Vertex n + | 0, _, b => b + | n + 1, (e, _, false), false => Sum.inl (endpoint n e false) + | _ + 1, (e, i, false), true => Sum.inr (e, i) + | _ + 1, (e, i, true), false => Sum.inr (e, i) + | n + 1, (e, _, true), true => Sum.inl (endpoint n e true) + +/-- The undirected replacement graph. -/ +def graph (n : ℕ) : SimpleGraph (Vertex n) := + SimpleGraph.fromRel (fun u v => ∃ e : Edge n, u = endpoint n e false ∧ v = endpoint n e true) + +def baseEdge : (n : ℕ) → Edge n + | 0 => () + | n+1 => (baseEdge n,0,false) + +lemma endpoint_ne (n : ℕ) (e : Edge n) : endpoint n e false ≠ endpoint n e true := by + cases n with + | zero => simp [endpoint] + | succ n => + rcases e with ⟨e,i,b⟩ + cases b <;> simp [endpoint] + +lemma adj_iff {n : ℕ} {u v : Vertex n} : (graph n).Adj u v ↔ + ∃ e : Edge n, (u=endpoint n e false ∧ v=endpoint n e true) ∨ + (u=endpoint n e true ∧ v=endpoint n e false) := by + rw [graph,SimpleGraph.fromRel_adj] + constructor + · rintro ⟨_,⟨e,hu,hv⟩ | ⟨e,hv,hu⟩⟩ + · exact ⟨e,Or.inl ⟨hu,hv⟩⟩ + · exact ⟨e,Or.inr ⟨hu,hv⟩⟩ + · rintro ⟨e,⟨rfl,rfl⟩ | ⟨rfl,rfl⟩⟩ + · exact ⟨endpoint_ne n e,Or.inl ⟨e,rfl,rfl⟩⟩ + · exact ⟨(endpoint_ne n e).symm,Or.inr ⟨e,rfl,rfl⟩⟩ + +lemma adj_endpoint (n : ℕ) (e : Edge n) : + (graph n).Adj (endpoint n e false) (endpoint n e true) := + adj_iff.mpr ⟨e,Or.inl ⟨rfl,rfl⟩⟩ + +lemma adj_old_mid {n : ℕ} {u : Vertex n} {e : Edge n} {i : ℕ} : + (graph (n+1)).Adj (Sum.inl u) (Sum.inr (e,i)) ↔ + u=endpoint n e false ∨ u=endpoint n e true := by + rw [adj_iff] + constructor + · rintro ⟨⟨d,j,b⟩,h⟩ + cases b <;> simp [endpoint] at h + · rcases h with ⟨hu,he,hj⟩ + subst d + exact Or.inl hu + · rcases h with ⟨hu,he,hj⟩ + subst d + exact Or.inr hu + · rintro (rfl | rfl) + · exact ⟨(e,i,false),Or.inl ⟨rfl,rfl⟩⟩ + · exact ⟨(e,i,true),Or.inr ⟨rfl,rfl⟩⟩ + +lemma not_adj_old {n : ℕ} (u v : Vertex n) : + ¬(graph (n+1)).Adj (Sum.inl u) (Sum.inl v) := by + rintro h + rcases adj_iff.mp h with ⟨⟨e,i,b⟩,h⟩ + cases b <;> simp [endpoint] at h + +lemma not_adj_new {n : ℕ} (u v : Edge n × ℕ) : + ¬(graph (n+1)).Adj (Sum.inr u) (Sum.inr v) := by + rintro h + rcases adj_iff.mp h with ⟨⟨e,i,b⟩,h⟩ + cases b <;> simp [endpoint] at h + +lemma replace_adj {n : ℕ} {u v : Vertex n} (h : (graph n).Adj u v) : + ∃ p : (graph (n+1)).Walk (Sum.inl u) (Sum.inl v), p.length=2 := by + obtain ⟨e,⟨rfl,rfl⟩ | ⟨rfl,rfl⟩⟩ := adj_iff.mp h + · exact ⟨.cons ((adj_old_mid (i := 0)).mpr (Or.inl rfl)) + (.cons (adj_old_mid.mpr (Or.inr rfl)).symm .nil),rfl⟩ + · exact ⟨.cons ((adj_old_mid (i := 0)).mpr (Or.inr rfl)) + (.cons (adj_old_mid.mpr (Or.inl rfl)).symm .nil),rfl⟩ + +lemma replace_walk {n : ℕ} {u v : Vertex n} (p : (graph n).Walk u v) : + ∃ q : (graph (n+1)).Walk (Sum.inl u) (Sum.inl v),q.length=2*p.length := by + induction p with + | nil => exact ⟨.nil,rfl⟩ + | cons h p ih => + obtain ⟨q,hq⟩ := ih + obtain ⟨r,hr⟩ := replace_adj h + refine ⟨r.append q,?_⟩ + rw [SimpleGraph.Walk.length_append,hr,hq,SimpleGraph.Walk.length_cons] + omega + +lemma connected (n : ℕ) : (graph n).Connected := by + induction n with + | zero => + have : Nonempty (Vertex 0) := ⟨false⟩ + refine ⟨?_⟩ + intro u v + cases u <;> cases v + · exact ⟨.nil⟩ + · exact (adj_endpoint 0 ()).reachable + · exact (adj_endpoint 0 ()).symm.reachable + · exact ⟨.nil⟩ + | succ n ih => + rw [SimpleGraph.connected_iff_exists_forall_reachable] + refine ⟨Sum.inl (endpoint n (baseEdge n) false),?_⟩ + intro v + cases v with + | inl v => + obtain ⟨p⟩ := ih (endpoint n (baseEdge n) false) v + obtain ⟨q,hq⟩ := replace_walk p + exact ⟨q⟩ + | inr v => + obtain ⟨e,i⟩ := v + obtain ⟨p⟩ := ih (endpoint n (baseEdge n) false) (endpoint n e false) + obtain ⟨q,hq⟩ := replace_walk p + exact ⟨q.append (adj_old_mid.mpr (Or.inl rfl)).toWalk⟩ + +lemma potential_walk {V : Type*} {G : SimpleGraph V} (φ : V → ℝ) + (hφ : ∀ u v,G.Adj u v → |φ u-φ v| ≤ 1) {u v : V} (p : G.Walk u v) : + |φ u-φ v| ≤ p.length := by + induction p with + | nil => simp + | @cons u v w h p ih => + have ht : |φ u-φ w| ≤ |φ u-φ v|+|φ v-φ w| := abs_sub_le _ _ _ + have h := hφ u v h + simp only [SimpleGraph.Walk.length_cons,Nat.cast_add,Nat.cast_one] + linarith + +lemma distance_potential (n : ℕ) (a : Vertex n) : + ∀ u v,(graph n).Adj u v → + |((graph n).dist a u : ℝ)-(graph n).dist a v| ≤ 1 := by + intro u v h + have huv := (connected n).dist_triangle (u := a) (v := u) (w := v) + have hvu := (connected n).dist_triangle (u := a) (v := v) (w := u) + rw [SimpleGraph.dist_eq_one_iff_adj.mpr h] at huv + rw [SimpleGraph.dist_eq_one_iff_adj.mpr h.symm] at hvu + have hu : ((graph n).dist a v : ℝ) ≤ (graph n).dist a u+1 := by exact_mod_cast huv + have hv : ((graph n).dist a u : ℝ) ≤ (graph n).dist a v+1 := by exact_mod_cast hvu + exact abs_le.mpr ⟨by linarith,by linarith⟩ + +def extendPotential {n : ℕ} (φ : Vertex n → ℝ) : Vertex (n+1) → ℝ + | Sum.inl u => 2*φ u + | Sum.inr (e,_) => φ (endpoint n e false)+φ (endpoint n e true) + +lemma extendPotential_adj {n : ℕ} (φ : Vertex n → ℝ) + (hφ : ∀ u v,(graph n).Adj u v → |φ u-φ v| ≤ 1) : + ∀ u v,(graph (n+1)).Adj u v → |extendPotential φ u-extendPotential φ v| ≤ 1 := by + intro u v h + rcases adj_iff.mp h with ⟨⟨e,i,b⟩,⟨rfl,rfl⟩ | ⟨rfl,rfl⟩⟩ <;> + cases b <;> dsimp [endpoint,extendPotential] + all_goals + have h := hφ _ _ (adj_endpoint n e) + have ha := (abs_le.mp h).1 + have hb := (abs_le.mp h).2 + apply abs_le.mpr + constructor <;> linarith + +/-- One subdivision doubles unweighted old-vertex distances. -/ +lemma dist_old (n : ℕ) (u v : Vertex n) : + (graph (n+1)).dist (Sum.inl u) (Sum.inl v)=2*(graph n).dist u v := by + apply le_antisymm + · obtain ⟨p,hp⟩ := (connected n).exists_walk_length_eq_dist u v + obtain ⟨q,hq⟩ := replace_walk p + exact (SimpleGraph.dist_le q).trans (by rw [hq,hp]) + · obtain ⟨p,hp⟩ := (connected (n+1)).exists_walk_length_eq_dist (Sum.inl u) (Sum.inl v) + have h := potential_walk (extendPotential (fun w => ((graph n).dist u w : ℝ))) + (extendPotential_adj _ (distance_potential n u)) p + rw [hp] at h + simp only [extendPotential,SimpleGraph.dist_self,Nat.cast_zero,mul_zero,zero_sub,abs_neg] at h + rw [abs_of_nonneg (by positivity)] at h + exact_mod_cast h + +lemma dist_siblings (n : ℕ) (e : Edge n) {i j : ℕ} (hij : i ≠ j) : + (graph (n+1)).dist (Sum.inr (e,i)) (Sum.inr (e,j))=2 := by + apply le_antisymm + · exact SimpleGraph.dist_le (.cons (adj_old_mid.mpr (Or.inl rfl)).symm + (.cons (adj_old_mid.mpr (Or.inl rfl)) .nil)) + · apply Nat.succ_le_of_lt + apply (connected (n+1)).one_lt_dist_of_ne_of_not_adj + · intro h + exact hij (Prod.mk.inj (Sum.inr.inj h)).2 + · exact not_adj_new _ _ + +theorem two_atLeastTwo : Nat.AtLeastTwo (1 + 1) := inferInstance + +/-- Final edges have length 2⁻ᵏ: this is the shortest-path metric of the normalized graph. -/ +def distance (k : ℕ) (u v : Vertex k) : ℝ := + ((graph k).dist u v : ℝ) / (Nat.cast 2 : ℝ) ^ k + +/-- The standing all-pairs distortion hypothesis, with its positive arbitrary scale. -/ +def HasDistortion {X : Type*} [NormedAddCommGroup X] + (k : ℕ) (f : Vertex k → X) (D s : ℝ) : Prop := + 1 ≤ D ∧ 0 < s ∧ ∀ u v, + s * distance k u v ≤ ‖f u - f v‖ ∧ + ‖f u - f v‖ ≤ D * s * distance k u v + +lemma distance_old (n : ℕ) (u v : Vertex n) : + distance (n+1) (Sum.inl u) (Sum.inl v)=distance n u v := by + rw [distance,distance,dist_old,Nat.cast_mul,Nat.cast_ofNat,pow_succ] + field_simp + +lemma distance_edge (n : ℕ) (e : Edge n) : + distance n (endpoint n e false) (endpoint n e true)=1/(2:ℝ)^n := by + rw [distance,SimpleGraph.dist_eq_one_iff_adj.mpr (adj_endpoint n e),Nat.cast_one,Nat.cast_ofNat] + +lemma distance_siblings (n : ℕ) (e : Edge n) {i j : ℕ} (hij : i ≠ j) : + distance (n+1) (Sum.inr (e,i)) (Sum.inr (e,j))=2/(2:ℝ)^(n+1) := by + rw [distance,dist_siblings n e hij,Nat.cast_ofNat] + +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- The oriented slope of a stage edge in the normalized metric. -/ +def slope {n : ℕ} (f : Vertex n → X) (e : Edge n) : X := + (2:ℝ)^n • (f (endpoint n e true)-f (endpoint n e false)) + +/-- Midpoint deviations normalized by the lengths of the parent edges. -/ +def deviation {n : ℕ} (f : Vertex (n+1) → X) (e : Edge n) (i : ℕ) : X := + (2:ℝ)^n • ((2:ℝ) • f (Sum.inr (e,i))- + f (Sum.inl (endpoint n e false))-f (Sum.inl (endpoint n e true))) + +lemma slope_plus_deviation {n : ℕ} (f : Vertex (n+1) → X) (e : Edge n) (i : ℕ) : + slope (fun v => f (Sum.inl v)) e+deviation f e i=slope f (e,i,false) := by + dsimp [slope,deviation,endpoint] + rw [pow_succ] + module + +lemma slope_minus_deviation {n : ℕ} (f : Vertex (n+1) → X) (e : Edge n) (i : ℕ) : + slope (fun v => f (Sum.inl v)) e-deviation f e i=slope f (e,i,true) := by + dsimp [slope,deviation,endpoint] + rw [pow_succ] + module + +lemma deviation_sub {n : ℕ} (f : Vertex (n+1) → X) (e : Edge n) (i j : ℕ) : + deviation f e i-deviation f e j= + (2:ℝ)^(n+1) • (f (Sum.inr (e,i))-f (Sum.inr (e,j))) := by + dsimp [deviation] + rw [pow_succ] + module + +lemma deviation_separated {n : ℕ} (f : Vertex (n+1) → X) {s : ℝ} + (hl : ∀ u v,s*distance (n+1) u v ≤ ‖f u-f v‖) (e : Edge n) + {i j : ℕ} (hij : i ≠ j) : 2*s ≤ ‖deviation f e i-deviation f e j‖ := by + rw [deviation_sub,norm_smul,Real.norm_eq_abs,abs_of_pos (by positivity : 0<(2:ℝ)^(n+1))] + calc + 2*s = (2:ℝ)^(n+1)*(s*distance (n+1) (Sum.inr (e,i)) (Sum.inr (e,j))) := by + rw [distance_siblings n e hij] + field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left (hl _ _) (by positivity) + +/-- An infinite separated symmetric lens with the exact quadratic constant. -/ +def QuadraticLens (X : Type*) [NormedAddCommGroup X] : Prop := + ∀ (x : X) (z : ℕ → X) (R ε : ℝ),0 ≤ R → 0 < ε → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) → ‖x‖^2+ε^2/16 ≤ R^2 + +/-- Supremum-free squared stretch-loss induction. The bound on all final-edge + slopes loses s²/4 at each backward step. No maximum child is used. -/ +lemma squared_stretch_loss (hX : QuadraticLens X) (k : ℕ) (f : Vertex k → X) + {s B : ℝ} (hs : 0 < s) + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) + (hb : ∀ e,‖slope f e‖^2 ≤ B) : s^2*(1+(k:ℝ)/4) ≤ B := by + induction k generalizing B with + | zero => + have h := hl (endpoint 0 () false) (endpoint 0 () true) + rw [distance_edge] at h + have h0 := hb () + simp only [slope,pow_zero,one_smul,norm_sub_rev] at h0 + norm_num at h ⊢ + nlinarith [sq_nonneg (s-‖f (endpoint 0 () false)-f (endpoint 0 () true)‖)] + | succ n ih => + have hB : 0 ≤ B := (sq_nonneg _).trans (hb (baseEdge (n+1))) + have hold : ∀ e,‖slope (fun v => f (Sum.inl v)) e‖^2 ≤ B-s^2/4 := by + intro e + have hp : ∀ i,‖slope (fun v => f (Sum.inl v)) e+deviation f e i‖ ≤ Real.sqrt B := by + intro i + rw [slope_plus_deviation] + exact (Real.le_sqrt (norm_nonneg _) hB).mpr (hb _) + have hm : ∀ i,‖slope (fun v => f (Sum.inl v)) e-deviation f e i‖ ≤ Real.sqrt B := by + intro i + rw [slope_minus_deviation] + exact (Real.le_sqrt (norm_nonneg _) hB).mpr (hb _) + have h := hX (slope (fun v => f (Sum.inl v)) e) (deviation f e) + (Real.sqrt B) (2*s) (Real.sqrt_nonneg _) (by positivity) hp hm + (fun _ _ hij => deviation_separated f hl e hij) + rw [Real.sq_sqrt hB] at h + nlinarith + have hlo : ∀ u v,s*distance n u v ≤ ‖f (Sum.inl u)-f (Sum.inl v)‖ := by + intro u v + simpa only [distance_old] using hl (Sum.inl u) (Sum.inl v) + have hind := ih (fun v => f (Sum.inl v)) hlo hold + push_cast + linarith + +lemma distortion_bound (hX : QuadraticLens X) (k : ℕ) (f : Vertex k → X) + (D s : ℝ) (h : HasDistortion k f D s) : 1+(k:ℝ)/4 ≤ D^2 := by + obtain ⟨hD,hs,h⟩ := h + have hbound : ∀ e,‖slope f e‖^2 ≤ (D*s)^2 := by + intro e + have he := (h (endpoint k e false) (endpoint k e true)).2 + rw [distance_edge] at he + have hh : ‖slope f e‖ ≤ D*s := by + rw [slope,norm_smul,Real.norm_eq_abs,abs_of_pos (by positivity : 0<(2:ℝ)^k),norm_sub_rev] + calc + _ ≤ (2:ℝ)^k*(D*s*(1/(2:ℝ)^k)) := mul_le_mul_of_nonneg_left he (by positivity) + _ = _ := by field_simp + exact (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (by linarith) hs.le)).mpr hh + have hb := squared_stretch_loss hX k f hs (fun u v => (h u v).1) hbound + have hp : 0 < s^2 := sq_pos_of_pos hs + have hmul : s^2*(1+(k:ℝ)/4) ≤ s^2*D^2 := by nlinarith only [hb] + exact (mul_le_mul_iff_right₀ hp).mp hmul + +end Diamond + +/-- The exact two-model unconditional headline; neither intrinsic estimate is a hypothesis. -/ +def Headline : Prop := + (∀ (k : ℕ) (f : Diamond.Vertex k → ForestDual) (D s : ℝ), + Diamond.HasDistortion k f D s → 1 + (k : ℝ) / 4 ≤ D ^ 2) ∧ + (∀ (k : ℕ) (f : Diamond.Vertex k → InfinitePredual) (D s : ℝ), + Diamond.HasDistortion k f D s → 1 + (k : ℝ) / 4 ≤ D ^ 2) + +/-- The finite forest lens property follows from the proved pooled estimate and + the proved approximation of its full dual. -/ +theorem forest_quadratic_lens : Diamond.QuadraticLens ForestDual := by + intro x z R ε hR hε hp hm hs + exact Ancestry.separated_lens (A := forestAncestry) forest_finite_heads + (fun η hη => Forest.full_dual_approximation x hη) z hR hε hp hm hs + +/-- The infinite-height assertion is only for its closed coordinate span, + not for the full infinite-height dual. -/ +theorem infinite_quadratic_lens : Diamond.QuadraticLens InfinitePredual := by + intro x z R ε hR hε hp hm hs + exact Ancestry.separated_lens (A := infiniteAncestry) infinite_finite_heads + (fun η hη => Ancestry.coordinate_predual_approximation (A := infiniteAncestry) + infinite_finite_heads x.property hη) (fun i => (z i).val) hR hε hp hm hs + +theorem headline : Headline := by + constructor + · exact fun k f D s h => Diamond.distortion_bound forest_quadratic_lens k f D s h + · exact fun k f D s h => Diamond.distortion_bound infinite_quadratic_lens k f D s h + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/DirectEnergy.lean b/lean/OAI/Analysis/DiamondDistortion/DirectEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..2da4ab50cf7ba5fcb08ffae13b4f3c90ceac756f --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/DirectEnergy.lean @@ -0,0 +1,457 @@ +import OAI.Analysis.DiamondDistortion.SignCube + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace DirectLayers + +section +open SignCube Diamond +variable {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] +def signed (x y : X) (b : Bool) : X := if b then x-y else x+y +lemma signed_average (x y : X) : (1/2:ℝ) • (signed x y false+signed x y true)=x := by + simp only [signed,Bool.false_eq_true,ite_false,ite_true] + module +lemma signed_error {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (x y x' y' : X) (b : Bool) : + ‖signed x y b-signed x' y' b‖ ≤ ‖x-x'‖+‖y-y'‖ := by + cases b + · change ‖x+y-(x'+y')‖ ≤ _ + rw [show x+y-(x'+y')=(x-x')+(y-y') by abel] + exact norm_add_le _ _ + · change ‖x-y-(x'-y')‖ ≤ _ + rw [show x-y-(x'-y')=(x-x')-(y-y') by abel] + exact norm_sub_le _ _ +lemma signed_slope {n : ℕ} (f : Vertex (n+1) → X) (e : Edge n) (j : ℕ) (b : Bool) : + signed (slope (fun u => f (.inl u)) e) (deviation f e j) b=slope f (e,j,b) := by + cases b + · exact slope_plus_deviation f e j + · exact slope_minus_deviation f e j +lemma deviation_bound {n : ℕ} (f : Vertex (n+1) → X) {L : ℝ} + (hu : ∀ u v,‖f u-f v‖ ≤ L*distance (n+1) u v) (e : Edge n) (j : ℕ) : + ‖deviation f e j‖ ≤ L := by + apply norm_deviation_le (x := slope (fun u => f (.inl u)) e) + · rw [slope_plus_deviation]; exact slope_upper f hu _ + · rw [slope_minus_deviation]; exact slope_upper f hu _ + +namespace Regular +variable {A : Midpoint.Heads I X} (hA : Regular A) +include hA +lemma signed_supported (H B : I) (hHB : H ≤ B) (x y : X) (hx : A.projection H x=x) + (hy : A.projection B y=y) (b : Bool) : A.projection B (signed x y b)=signed x y b := by + have hBx : A.projection B x=x := by rw [← hx,hA.nested_right _ _ hHB] + cases b <;> simp [signed,map_add,map_sub,hBx,hy] +lemma signed_layer (H B : I) (hHB : H ≤ B) (x y : X) (hx : A.projection H x=x) + (hy : A.projection B y=y) (b : Bool) : + ‖A.projection B (signed x y b)-A.projection H (signed x y b)‖=‖y-A.projection H y‖ := by + rw [hA.signed_supported H B hHB x y hx hy b] + cases b + · change ‖x+y-A.projection H (x+y)‖=_ + rw [map_add,hx,show x+y-(x+A.projection H y)=y-A.projection H y by abel] + · change ‖x-y-A.projection H (x-y)‖=_ + rw [map_sub,hx,show x-y-(x-A.projection H y)=-(y-A.projection H y) by abel,norm_neg] +lemma projected_layer_lower (H B : I) (hHB : H ≤ B) (z : X) {r η : ℝ} + (hr : r < ‖z-A.projection H z‖) (he : ‖z-A.projection B z‖ < η) : + r-η < ‖A.projection B z-A.projection H (A.projection B z)‖ := by + rw [hA.nested_left _ _ hHB] + have hh := norm_sub_le (z-A.projection H z) (z-A.projection B z) + rw [show (z-A.projection H z)-(z-A.projection B z)=A.projection B z-A.projection H z by abel] at hh + have hh' := norm_sub_le (A.projection B z-A.projection H z) (A.projection B z-z) + rw [show (A.projection B z-A.projection H z)-(A.projection B z-z)=z-A.projection H z by abel, + norm_sub_rev (A.projection B z) z] at hh' + linarith + +lemma supported_selection (k : ℕ) (f : Vertex k → X) {s L η r q : ℝ} + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) + (hu : ∀ u v,‖f u-f v‖ ≤ L*distance k u v) + (hη : 0 < η) (hr : r < s) (hq : 0 ≤ q) (hqr : q ≤ r-η) : + ∃ (T : Protocol X I k) (e : History k → Edge k), + T.Martingale ∧ T.Nested ∧ T.Anchored ∧ T.CommonHeads ∧ T.Supported A.projection ∧ + (∀ u,‖T.last u-slope f (e u)‖ < ((k:ℝ)+1)*η) ∧ + (k:ℝ)*q^2 ≤ T.freshSum A.projection := by + induction k with + | zero => + obtain ⟨H⟩ := hA.nonempty + obtain ⟨B,_,hB⟩ := hA.capture_one H (slope f ()) hη + refine ⟨.initial (A.projection B (slope f ())) B,fun _ => (),trivial,trivial,trivial,trivial, + A.idempotent B _,?_,?_⟩ + · intro u + simpa only [Protocol.last,Nat.cast_zero,zero_add,one_mul,norm_sub_rev] using hB + · simp only [Nat.cast_zero,zero_mul,Protocol.freshSum,le_refl] + | succ n ih => + obtain ⟨T,e,hM,hN,hAn,hC,hS,hE,hF⟩ := ih (fun u => f (.inl u)) (old_lower f hl) (old_upper f hu) + obtain ⟨H,hH⟩ := T.common_last hC + have hsel (u : History n) : ∃ j,r < ‖deviation f (e u) j-A.projection H (deviation f (e u) j)‖ := + select_tail A H _ (deviation_bound f hu (e u)) + (fun i j hij => deviation_separated f hl (e u) hij) (by linarith) + choose j hj using hsel + let z : History n → X := fun u => deviation f (e u) (j u) + obtain ⟨B,hHB,hB⟩ := hA.capture H z hη + let v : History n → X := fun u => A.projection B (z u) + let W : History (n+1) → X := fun u => signed (T.last u.1) (v u.1) u.2 + let T' : Protocol X I (n+1) := .extend T (fun _ => H) (fun _ => B) W + have hHx (u : History n) : A.projection H (T.last u)=T.last u := by + rw [← hH u]; exact T.supported_last A.projection hS u + have hv (u : History n) : A.projection B (v u)=v u := A.idempotent B _ + refine ⟨T',fun u => (e u.1,j u.1,u.2),?_,?_,?_,?_,?_,?_,?_⟩ + · exact ⟨hM,fun u => (signed_average _ _).symm⟩ + · exact ⟨hN,fun u => ⟨(hH u).le,hHB⟩⟩ + · exact ⟨hAn,fun u => (hH u).symm⟩ + · exact ⟨hC,B,fun _ => rfl⟩ + · exact ⟨hS,fun u b => hA.signed_supported H B hHB _ _ (hHx u) (hv u) b⟩ + · intro u + change ‖signed (T.last u.1) (v u.1) u.2-slope f (e u.1,j u.1,u.2)‖ < _ + rw [← signed_slope] + have he := signed_error (T.last u.1) (v u.1) + (slope (fun w => f (.inl w)) (e u.1)) (z u.1) u.2 + have hvz : ‖v u.1-z u.1‖ < η := by simpa only [v,norm_sub_rev] using hB u.1 + have he' := he.trans_lt (add_lt_add (hE u.1) hvz) + exact he'.trans_eq (by push_cast; ring) + · have hW (u : History (n+1)) : q^2 ≤ ‖A.projection B (W u)-A.projection H (W u)‖^2 := by + rw [hA.signed_layer H B hHB _ _ (hHx u.1) (hv u.1) u.2] + apply (sq_le_sq₀ hq (norm_nonneg _)).mpr + exact hqr.trans (hA.projected_layer_lower H B hHB (z u.1) (hj u.1) (hB u.1)).le + have he := mean_lower (n+1) hW + change (n+1:ℕ)*q^2 ≤ T.freshSum A.projection+Protocol.childEnergy A.projection n (fun _ => H) (fun _ => B) W + change q^2 ≤ Protocol.childEnergy A.projection n (fun _ => H) (fun _ => B) W at he + push_cast + nlinarith only [hF,he] +end Regular +end +section +open SignCube Diamond +variable {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] +variable (A : Midpoint.Heads I X) (hA : Regular A) + +lemma approximate_bound {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] {k : ℕ} (f : Vertex k → X) {L η C : ℝ} + (hu : ∀ u v,‖f u-f v‖ ≤ L*distance k u v) + (T : Protocol X I k) (e : History k → Edge k) + (he : ∀ u,‖T.last u-slope f (e u)‖ < ((k:ℝ)+1)*η) + (hC : L+((k:ℝ)+1)*η ≤ C) : ∀ u,‖T.last u‖ ≤ C := by + intro u + have hh := norm_sub_norm_le (T.last u) (slope f (e u)) + have hb := slope_upper f hu (e u) + linarith [he u] + +include hA + +theorem predictable_graph (hin : PredictableInput A.projection 495) {D t : ℝ} (k : ℕ) + (f : Vertex k → X) (hf : HasDistortion k f D t) : (k:ℝ)/4 ≤ 495*(D+1)^2 := by + have hn := (normalized_distortion f hf).2.2 + let g := fun v => t⁻¹ • f v + have hl : ∀ u v,(1:ℝ)*distance k u v ≤ ‖g u-g v‖ := fun u v => (hn u v).1 + have hu : ∀ u v,‖g u-g v‖ ≤ D*distance k u v := by simpa only [mul_one] using fun u v => (hn u v).2 + let η := 1/(8*((k:ℝ)+1)) + have hk : 0 < (k:ℝ)+1 := by positivity + have hη : 0 < η := by dsimp [η]; positivity + have heq : ((k:ℝ)+1)*η=1/8 := by dsimp [η]; field_simp + have hηb : η ≤ 1/8 := by + dsimp [η] + apply (div_le_iff₀ (by positivity)).mpr + nlinarith [Nat.cast_nonneg (α := ℝ) k] + obtain ⟨T,e,hM,hN,hAn,hC,hS,hE,hF⟩ := hA.supported_selection k g hl hu hη + (by norm_num : (3/4:ℝ)<1) (by norm_num : (0:ℝ)≤1/2) (by linarith : (1/2:ℝ)≤3/4-η) + have hb := approximate_bound g hu T e hE (C := D+1) (by rw [heq]; linarith) + have hi := hin k T hM hN hAn hS (D+1) hb + norm_num at hF + nlinarith only [hF,hi] + +theorem variation_graph (hin : PredictableInput A.projection 252) {D t : ℝ} (k : ℕ) + (f : Vertex k → X) (hf : HasDistortion k f D t) : (k:ℝ)/(16*D^2) ≤ 1008 := by + have hD : 0 < D := by linarith [hf.1] + have hn := upper_one_normalization f hf + let g := fun v => (D*t)⁻¹ • f v + have hl : ∀ u v,D⁻¹*distance k u v ≤ ‖g u-g v‖ := fun u v => (hn u v).1 + have hu : ∀ u v,‖g u-g v‖ ≤ (1:ℝ)*distance k u v := by simpa only [one_mul] using fun u v => (hn u v).2 + let η := min (1/(4*D)) (1/((k:ℝ)+1))/2 + have hk : 0 < (k:ℝ)+1 := by positivity + have hη : 0 < η := by dsimp [η]; positivity + have hηD : η ≤ 1/(8*D) := by + have hh := div_le_div_of_nonneg_right (min_le_left (1/(4*D)) (1/((k:ℝ)+1))) (by norm_num : (0:ℝ)≤2) + exact hh.trans_eq (by field_simp; ring) + have hηk : ((k:ℝ)+1)*η ≤ 1/2 := by + have hh := mul_le_mul_of_nonneg_left (div_le_div_of_nonneg_right + (min_le_right (1/(4*D)) (1/((k:ℝ)+1))) (by norm_num : (0:ℝ)≤2)) hk.le + exact hh.trans_eq (by field_simp) + have hr : 3/(4*D) < D⁻¹ := by rw [inv_eq_one_div]; apply (div_lt_div_iff₀ (by positivity) hD).mpr; nlinarith + have hqr : 1/(4*D) ≤ 3/(4*D)-η := by + have he : 3/(4*D)-1/(4*D)=4*(1/(8*D)) := by field_simp; ring + have hp : 0 ≤ 1/(8*D) := by positivity + linarith + obtain ⟨T,e,hM,hN,hAn,hC,hS,hE,hF⟩ := hA.supported_selection k g hl hu hη hr + (by positivity : (0:ℝ)≤1/(4*D)) hqr + have hb := approximate_bound g hu T e hE (C := 2) (by linarith) + have hi := hin k T hM hN hAn hS 2 hb + have he : (k:ℝ)*(1/(4*D))^2=(k:ℝ)/(16*D^2) := by field_simp; ring + rw [he] at hF + norm_num at hi + exact hF.trans hi + +/-- The fresh-gap inequality telescopes for every supported predictable dyadic + process, even when each increment contains a nonzero old-head part. -/ +lemma gap_telescope (hin : GapInput A.projection) {k : ℕ} (T : Protocol X I k) + (hM : T.Martingale) (hN : T.Nested) (hAn : T.Anchored) (hS : T.Supported A.projection) : + T.freshSum A.projection ≤ 400*(T.terminalEnergy-T.initialEnergy) := by + induction T with + | initial x H => simp [Protocol.freshSum,Protocol.terminalEnergy,Protocol.last,Protocol.initialEnergy,mean] + | @extend n T U B W ih => + have hprev := ih hM.1 hN.1 hAn.1 hS.1 + let y : History n → X := fun u => (1/2:ℝ) • (W (u,false)-W (u,true)) + have hx (u : History n) : A.projection (U u) (T.last u)=T.last u := by + rw [hAn.2 u]; exact T.supported_last _ hS.1 u + have hy (u : History n) : A.projection (B u) (y u)=y u := by + dsimp [y] + rw [map_smul,map_sub,hS.2 u false,hS.2 u true] + have hw (u : History n) (b : Bool) : signed (T.last u) (y u) b=W (u,b) := by + rw [hM.2 u] + cases b <;> dsimp [signed,y] <;> module + have hlayer (u : History n) (b : Bool) : + ‖A.projection (B u) (W (u,b))-A.projection (U u) (W (u,b))‖=‖y u-A.projection (U u) (y u)‖ := by + rw [← hw u b,hA.signed_layer _ _ (hN.2 u).2 _ _ (hx u) (hy u) b] + have hgap (u : History n) : ‖y u-A.projection (U u) (y u)‖^2 ≤ + 400*((‖W (u,false)‖^2+‖W (u,true)‖^2)/2-‖T.last u‖^2) := by + have hh := hin (U u) (B u) (hN.2 u).2 (T.last u) (y u) (hx u) (hy u) + rw [hy u] at hh + have h0 := hw u false + have h1 := hw u true + change T.last u+y u=W (u,false) at h0 + change T.last u-y u=W (u,true) at h1 + rwa [h0,h1] at hh + have heq : Protocol.childEnergy A.projection n U B W=mean n (fun u => ‖y u-A.projection (U u) (y u)‖^2) := by + change mean n (fun u => (‖A.projection (B u) (W (u,false))-A.projection (U u) (W (u,false))‖^2+ + ‖A.projection (B u) (W (u,true))-A.projection (U u) (W (u,true))‖^2)/2)=_ + simp_rw [hlayer] + congr 1 + funext u + ring + have hstep : Protocol.childEnergy A.projection n U B W ≤ + 400*((Protocol.extend T U B W).terminalEnergy-T.terminalEnergy) := by + rw [heq] + have hh := mean_mono n hgap + rw [mean_mul,mean_sub] at hh + exact hh + change T.freshSum A.projection+Protocol.childEnergy A.projection n U B W ≤ + 400*((Protocol.extend T U B W).terminalEnergy-T.initialEnergy) + linarith + +theorem gap_graph (hin : GapInput A.projection) {D t γ : ℝ} (k : ℕ) + (f : Vertex k → X) (hf : HasDistortion k f D t) (hγ : 0 < γ) + (hγa : γ < (2/D)/8) (hγk : γ < 1/((k:ℝ)+1)) : + ∃ T : Protocol X I k,T.Martingale ∧ T.Nested ∧ T.Anchored ∧ T.CommonHeads ∧ T.Supported A.projection ∧ + T.terminalEnergy ≤ 4 ∧ T.initialEnergy+(k:ℝ)*((2/D)/8)^2/400 ≤ T.terminalEnergy ∧ + (k:ℝ)*((2/D)/8)^2/400 ≤ T.initialEnergy+(k:ℝ)*((2/D)/8)^2/400 := by + have hD : 0 < D := by linarith [hf.1] + have hn := upper_one_normalization f hf + let g := fun v => (D*t)⁻¹ • f v + have hl : ∀ u v,D⁻¹*distance k u v ≤ ‖g u-g v‖ := fun u v => (hn u v).1 + have hu : ∀ u v,‖g u-g v‖ ≤ (1:ℝ)*distance k u v := by simpa only [one_mul] using fun u v => (hn u v).2 + have hr : (2/D)/4 < D⁻¹ := by rw [inv_eq_one_div]; field_simp; nlinarith + have hqr : (2/D)/8 ≤ (2/D)/4-γ := by linarith + obtain ⟨T,e,hM,hN,hAn,hC,hS,hE,hF⟩ := hA.supported_selection k g hl hu hγ hr + (by positivity : (0:ℝ)≤(2/D)/8) hqr + have hk : 0 < (k:ℝ)+1 := by positivity + have hγk' : ((k:ℝ)+1)*γ ≤ 1 := by + have hh := (lt_div_iff₀ hk).mp hγk + nlinarith + have hb := approximate_bound g hu T e hE (C := 2) (by linarith) + have htel := gap_telescope A hA hin T hM hN hAn hS + refine ⟨T,hM,hN,hAn,hC,hS,?_,?_,?_⟩ + · simpa only [show (2:ℝ)^2=4 by norm_num] using T.terminalEnergy_bound (by norm_num) hb + · linarith + · linarith [T.initialEnergy_nonneg] +end + +section +open SignCube Diamond +variable {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] +lemma norm_right_signed {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (x y : X) (b : Bool) : ‖y‖ ≤ ‖x‖+‖signed x y b‖ := by + cases b + · have hh := norm_sub_le (x+y) x + rw [show x+y-x=y by abel] at hh + change ‖y‖ ≤ ‖x‖+‖x+y‖ + linarith + · have hh := norm_sub_le x (x-y) + rw [show x-(x-y)=y by abel] at hh + exact hh +lemma signed_tail (P : X →L[ℝ] X) (x y : X) (b : Bool) : + signed x y b-P (signed x y b)=signed (x-P x) (y-P y) b := by + cases b + · dsimp [signed]; rw [map_add]; abel + · dsimp [signed]; rw [map_sub]; abel + +namespace Regular +variable {A : Midpoint.Heads I X} (hA : Regular A) +include hA +/-- Exact slopes, with a single common finite ancestral head on each level. + Choosing the parent head slightly finer also ensures both child outcomes + carry a fresh layer; this is valid for both adaptive and leakage inputs. -/ +lemma true_selection (k : ℕ) (f : Vertex k → X) {s L η r q : ℝ} + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) + (hu : ∀ u v,‖f u-f v‖ ≤ L*distance k u v) + (hη : 0 < η) (hr : r < s) (hq : 0 ≤ q) (hqr : q ≤ r-2*η) : + ∃ (T : Protocol X I k) (e : History k → Edge k), + T.Martingale ∧ T.Nested ∧ T.Anchored ∧ T.CommonHeads ∧ + (∀ u,T.last u=slope f (e u)) ∧ + (∀ u,‖T.last u-A.projection (T.lastHead u) (T.last u)‖ < η) ∧ + (k:ℝ)*q^2 ≤ T.freshSum A.projection ∧ T.leakageSum A.projection ≤ (k:ℝ)*η^2 := by + induction k with + | zero => + obtain ⟨H⟩ := hA.nonempty + obtain ⟨B,_,hB⟩ := hA.capture_one H (slope f ()) hη + refine ⟨.initial (slope f ()) B,fun _ => (),trivial,trivial,trivial,trivial, + fun _ => rfl,fun _ => hB,?_,?_⟩ <;> + simp only [Nat.cast_zero,zero_mul,Protocol.freshSum,Protocol.leakageSum,le_refl] + | succ n ih => + obtain ⟨T,e,hM,hN,hAn,hC,hE,hTail,hF,hLeak⟩ := ih (fun u => f (.inl u)) (old_lower f hl) (old_upper f hu) + obtain ⟨H,hH⟩ := T.common_last hC + have hsel (u : History n) : ∃ j,r < ‖deviation f (e u) j-A.projection H (deviation f (e u) j)‖ := + select_tail A H _ (deviation_bound f hu (e u)) + (fun i j hij => deviation_separated f hl (e u) hij) (by linarith) + choose j hj using hsel + let z : History n → X := fun u => deviation f (e u) (j u) + let W : History (n+1) → X := fun u => signed (T.last u.1) (z u.1) u.2 + obtain ⟨B,hHB,hB⟩ := hA.capture H W hη + let T' : Protocol X I (n+1) := .extend T (fun _ => H) (fun _ => B) W + have hparent (u : History n) : ‖T.last u-A.projection H (T.last u)‖ < η := by + rw [← hH u]; exact hTail u + have hWtail (u : History (n+1)) : r-η < ‖W u-A.projection H (W u)‖ := by + rw [signed_tail] + have hh := norm_right_signed (T.last u.1-A.projection H (T.last u.1)) + (z u.1-A.projection H (z u.1)) u.2 + have hz := hj u.1 + change r < ‖z u.1-A.projection H (z u.1)‖ at hz + linarith [hparent u.1] + refine ⟨T',fun u => (e u.1,j u.1,u.2),?_,?_,?_,?_,?_,?_,?_,?_⟩ + · exact ⟨hM,fun u => (signed_average _ _).symm⟩ + · exact ⟨hN,fun u => ⟨(hH u).le,hHB⟩⟩ + · exact ⟨hAn,fun u => (hH u).symm⟩ + · exact ⟨hC,B,fun _ => rfl⟩ + · intro u + change signed (T.last u.1) (z u.1) u.2=_ + rw [hE] + exact signed_slope f (e u.1) (j u.1) u.2 + · exact hB + · have hW (u : History (n+1)) : q^2 ≤ ‖A.projection B (W u)-A.projection H (W u)‖^2 := by + have hh := hA.projected_layer_lower H B hHB (W u) (hWtail u) (hB u) + rw [hA.nested_left H B hHB] at hh + apply (sq_le_sq₀ hq (norm_nonneg _)).mpr + linarith + have he := mean_lower (n+1) hW + change q^2 ≤ Protocol.childEnergy A.projection n (fun _ => H) (fun _ => B) W at he + change (n+1:ℕ)*q^2 ≤ T.freshSum A.projection+Protocol.childEnergy A.projection n (fun _ => H) (fun _ => B) W + push_cast + nlinarith only [hF,he] + · have hp (u : History n) : ‖A.projection B (T.last u)-A.projection H (T.last u)‖^2 ≤ η^2 := by + exact (sq_le_sq₀ (norm_nonneg _) hη.le).mpr ((hA.layer_parent H B hHB _).trans (hparent u).le) + have he := mean_upper n hp + change Protocol.parentEnergy A.projection n (fun _ => H) (fun _ => B) T.last ≤ η^2 at he + change T.leakageSum A.projection+Protocol.parentEnergy A.projection n (fun _ => H) (fun _ => B) T.last ≤ (n+1:ℕ)*η^2 + push_cast + nlinarith only [hLeak,he] +end Regular +end + +open SignCube Diamond +variable {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] +variable (A : Midpoint.Heads I X) (hA : Regular A) +include hA +lemma sign_constant_nonneg {C : ℝ} (hin : SignInput A.projection C) (x : X) (hx : 0 < ‖x‖) : 0 ≤ C := by + obtain ⟨H⟩ := hA.nonempty + have hh := hin 0 (.initial x H) trivial trivial + simp only [Protocol.freshSum,Protocol.leakageSum,Protocol.terminalEnergy,mean,Protocol.last,add_zero] at hh + have hp := sq_pos_of_pos hx + by_contra! hn + exact (mul_neg_of_neg_of_pos hn hp).not_ge hh + +omit hA in +lemma dyadic_budget (k : ℕ) : (k:ℝ)*((2:ℝ)^k)⁻¹^2 ≤ 1 := by + have hp : (k:ℝ)+1 ≤ (4:ℝ)^k := by + induction k with + | zero => norm_num + | succ n ih => + rw [pow_succ] + push_cast + have hn := Nat.cast_nonneg (α := ℝ) n + nlinarith + have he : ((2:ℝ)^k)^2=(4:ℝ)^k := by + rw [← pow_mul,mul_comm k 2,pow_mul] + norm_num + have hh : (k:ℝ) ≤ ((2:ℝ)^k)^2 := by rw [he]; linarith + have hd : 0 < ((2:ℝ)^k)^2 := by positivity + have hb := mul_le_mul_of_nonneg_right hh (inv_nonneg.mpr hd.le) + rw [mul_inv_cancel₀ hd.ne'] at hb + simpa only [inv_pow] using hb + +theorem adaptive_graph {C : ℝ} (hin : SignInput A.projection C) {D t : ℝ} (k : ℕ) + (f : Vertex k → X) (hf : HasDistortion k f D t) : + (k:ℝ)/16 ≤ C*(D^2+(k:ℝ)*((2:ℝ)^k)⁻¹^2) ∧ + C*(D^2+(k:ℝ)*((2:ℝ)^k)⁻¹^2) ≤ C*(D^2+1) := by + have hn := (normalized_distortion f hf).2.2 + let g := fun v => t⁻¹ • f v + have hl : ∀ u v,(1:ℝ)*distance k u v ≤ ‖g u-g v‖ := fun u v => (hn u v).1 + have hu : ∀ u v,‖g u-g v‖ ≤ D*distance k u v := by simpa only [mul_one] using fun u v => (hn u v).2 + have hC : 0 ≤ C := sign_constant_nonneg A hA hin (slope g (baseEdge k)) + (lt_of_lt_of_le (by norm_num) (slope_lower g hl _)) + let η := min (((2:ℝ)^k)⁻¹) (1/8) + have hη : 0 < η := by dsimp [η]; positivity + have hη1 : η ≤ 1/8 := min_le_right _ _ + have hη2 : η ≤ ((2:ℝ)^k)⁻¹ := min_le_left _ _ + obtain ⟨T,e,hM,hN,hAn,hCommon,hE,hTail,hF,hLeak⟩ := hA.true_selection k g hl hu hη + (by norm_num : (3/4:ℝ)<1) (by norm_num : (0:ℝ)≤1/4) (by linarith : (1/4:ℝ)≤3/4-2*η) + have ht : T.terminalEnergy ≤ D^2 := T.terminalEnergy_bound (by linarith [hf.1]) + (fun u => by rw [hE]; exact slope_upper g hu _) + have hηsq : η^2 ≤ (((2:ℝ)^k)⁻¹)^2 := (sq_le_sq₀ hη.le (by positivity)).mpr hη2 + have hlk := hLeak.trans (mul_le_mul_of_nonneg_left hηsq (Nat.cast_nonneg k)) + have hi := (hin k T hM hN).trans (mul_le_mul_of_nonneg_left (add_le_add ht hlk) hC) + constructor + · norm_num at hF + nlinarith only [hF,hi] + · exact mul_le_mul_of_nonneg_left (add_le_add (le_refl (D^2)) (dyadic_budget k)) hC + +def leakageTolerance (k : ℕ) : ℝ := min (1/8) (1/Real.sqrt (k:ℝ)) +omit hA in +lemma leakage_tolerance_properties {k : ℕ} (hk : 1 ≤ k) : + 0 < leakageTolerance k ∧ leakageTolerance k ≤ 1/8 ∧ (k:ℝ)*(leakageTolerance k)^2 ≤ 1 := by + have hk0 : 0 < (k:ℝ) := by exact_mod_cast (show 0 < k by omega) + have hs : 0 < Real.sqrt (k:ℝ) := Real.sqrt_pos.mpr hk0 + have hε : 0 < leakageTolerance k := by unfold leakageTolerance; positivity + refine ⟨hε,min_le_left _ _,?_⟩ + have hh : (leakageTolerance k)^2 ≤ (1/Real.sqrt (k:ℝ))^2 := + (sq_le_sq₀ hε.le (by positivity)).mpr (min_le_right _ _) + calc + _ ≤ (k:ℝ)*(1/Real.sqrt (k:ℝ))^2 := mul_le_mul_of_nonneg_left hh hk0.le + _ = 1 := by rw [div_pow,one_pow,Real.sq_sqrt hk0.le]; field_simp + +theorem leakage_graph (hin : LeakageInput A.projection) {D t : ℝ} (k : ℕ) (hk : 1 ≤ k) + (f : Vertex k → X) (hf : HasDistortion k f D t) : + (k:ℝ)/8 ≤ 1024*(D^2+(k:ℝ)*(leakageTolerance k)^2) ∧ + 1024*(D^2+(k:ℝ)*(leakageTolerance k)^2) ≤ 1024*(D^2+1) := by + have hn := (normalized_distortion f hf).2.2 + let g := fun v => t⁻¹ • f v + have hl : ∀ u v,(1:ℝ)*distance k u v ≤ ‖g u-g v‖ := fun u v => (hn u v).1 + have hu : ∀ u v,‖g u-g v‖ ≤ D*distance k u v := by simpa only [mul_one] using fun u v => (hn u v).2 + obtain ⟨hη,hηb,hbudget⟩ := leakage_tolerance_properties hk + obtain ⟨T,e,hM,hN,hAn,hCommon,hE,hTail,hF,hLeak⟩ := hA.true_selection k g hl hu hη + (by norm_num : (3/4:ℝ)<1) (by norm_num : (0:ℝ)≤1/2) (by linarith : (1/2:ℝ)≤3/4-2*leakageTolerance k) + have ht : T.terminalEnergy ≤ D^2 := T.terminalEnergy_bound (by linarith [hf.1]) + (fun u => by rw [hE]; exact slope_upper g hu _) + have hi := hin k T hM hN hAn hCommon + constructor + · norm_num at hF + nlinarith [Nat.cast_nonneg (α := ℝ) k] + · linarith +end DirectLayers + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/EquivalentNorm.lean b/lean/OAI/Analysis/DiamondDistortion/EquivalentNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..005b4497c6418d197ac1d3d52d7c634f1d20b41f --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/EquivalentNorm.lean @@ -0,0 +1,273 @@ +import OAI.Analysis.DiamondDistortion.ModelMaps + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace EquivalentNorm +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +structure Data (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where + seminorm : Seminorm ℝ E + lowerConstant : ℝ + upperConstant : ℝ + lower : ∀ v,‖v‖ ≤ lowerConstant*seminorm v + upper : ∀ v,seminorm v ≤ upperConstant*‖v‖ +namespace Data +variable (A : Data E) +lemma separates (v : E) (hv : A.seminorm v=0) : v=0 := by + have hh := A.lower v + rw [hv,mul_zero] at hh + exact norm_le_zero_iff.mp hh + +def Space (_A : Data E) := E +instance : AddCommGroup A.Space := inferInstanceAs (AddCommGroup E) +instance : Module ℝ A.Space := inferInstanceAs (Module ℝ E) +instance : NormedAddCommGroup A.Space := AddGroupNorm.toNormedAddCommGroup + { A.seminorm.toAddGroupSeminorm with eq_zero_of_map_eq_zero' := A.separates } +instance : NormedSpace ℝ A.Space where + norm_smul_le t v := le_of_eq (A.seminorm.smul' t v) + +def of (v : E) : A.Space := v +def val (v : A.Space) : E := v +@[simp] lemma norm_of (v : E) : ‖A.of v‖=A.seminorm v := rfl + +def algebraEquiv : A.Space ≃ₗ[ℝ] E := { LinearEquiv.refl ℝ E with } +def equiv : A.Space ≃L[ℝ] E := + A.algebraEquiv.toContinuousLinearEquivOfBounds A.lowerConstant A.upperConstant A.lower A.upper +lemma equiv_apply (v : A.Space) : A.equiv v=A.val v := rfl +lemma equiv_symm_apply (v : E) : A.equiv.symm v=A.of v := rfl +def uniformEquiv : A.Space ≃ᵤ E where + toEquiv := A.equiv.toEquiv + uniformContinuous_toFun := A.equiv.toContinuousLinearMap.uniformContinuous + uniformContinuous_invFun := A.equiv.symm.toContinuousLinearMap.uniformContinuous +instance [CompleteSpace E] : CompleteSpace A.Space := + A.uniformEquiv.completeSpace_iff.mpr inferInstance +end Data +end EquivalentNorm + +namespace PathModel +open RecursiveModel +lemma quadratic_l2 (h : ℕ) (v : L2 h) : + ‖v‖ ≤ (Real.sqrt 2*(h+1:ℝ))*cost 2 h v := by + apply (presentation 2 h).bound v (by positivity : (0:ℝ) ≤ Real.sqrt 2*(h+1:ℝ)) + intro d hd + change d.fst+path h d.snd=v at hd + rw [← hd] + have hb := (norm_add_le d.fst (path h d.snd)).trans (add_le_add le_rfl (path_norm h d.snd)) + have hhn : 1 ≤ (h+1:ℝ) := by linarith [Nat.cast_nonneg (α := ℝ) h] + have hab : ‖d.fst‖+‖d.snd‖ ≤ Real.sqrt 2*‖d‖ := by + rw [WithLp.prod_norm_eq_of_L2] + apply (sq_le_sq₀ (by positivity) (by positivity)).mp + rw [mul_pow,Real.sq_sqrt (by norm_num),Real.sq_sqrt (by positivity)] + nlinarith [sq_nonneg (‖d.fst‖-‖d.snd‖)] + have hc : ‖d.fst‖+(h+1:ℝ)*‖d.snd‖ ≤ (h+1:ℝ)*(‖d.fst‖+‖d.snd‖) := by + nlinarith [norm_nonneg d.fst] + exact (hb.trans hc).trans ((mul_le_mul_of_nonneg_left hab (by positivity)).trans_eq (by ring)) + +/-- The original underlying ℓ² space endowed with its literal infimal path cost. -/ +def linearFullData (h : ℕ) : EquivalentNorm.Data (L2 h) where + seminorm := cost 1 h + lowerConstant := h+1 + upperConstant := 1 + lower := linear_l2 h + upper v := by simpa only [one_mul] using linear_le_norm h v +def quadraticFullData (h : ℕ) : EquivalentNorm.Data (L2 h) where + seminorm := cost 2 h + lowerConstant := Real.sqrt 2*(h+1) + upperConstant := 1 + lower := quadratic_l2 h + upper v := by simpa only [one_mul] using quadratic_le_norm h v + +abbrev LinearComponent (h : ℕ) := (linearFullData h).Space +abbrev QuadraticComponent (h : ℕ) := (quadraticFullData h).Space +abbrev FullLinearSpace := lp (fun h : ℕ => LinearComponent (h+1)) 2 +abbrev FullQuadraticSpace := lp (fun h : ℕ => QuadraticComponent (h+1)) 2 +end PathModel + +namespace CoordinateCompletion.Data +variable {ι E : Type*} (A : CoordinateCompletion.Data ι) + [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + +def finiteIsometry (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) : A.Finite →ₗᵢ[ℝ] E where + toLinearMap := j + norm_map' := hj + +def completionMap (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) : A.Space →L[ℝ] E := + (A.finiteIsometry j hj).toContinuousLinearMap.extend UniformSpace.Completion.toComplL +lemma completionMap_coe (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) (v : A.Finite) : + A.completionMap j hj v=j (A.array v) := + ContinuousLinearMap.extend_eq _ UniformSpace.Completion.denseRange_coe + (UniformSpace.Completion.isUniformInducing_coe _) v +lemma completionMap_norm (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) (x : A.Space) : + ‖A.completionMap j hj x‖=‖x‖ := by + induction x using UniformSpace.Completion.induction_on with + | hp => exact isClosed_eq (A.completionMap j hj).continuous.norm continuous_norm + | ih v => rw [A.completionMap_coe,UniformSpace.Completion.norm_coe]; exact hj (A.array v) + +def completionIsometry (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) : A.Space →ₗᵢ[ℝ] E where + toLinearMap := (A.completionMap j hj).toLinearMap + norm_map' := A.completionMap_norm j hj +lemma completionMap_surjective (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) + (hdense : DenseRange j) : Function.Surjective (A.completionIsometry j hj) := by + have hclosed := (A.completionIsometry j hj).isometry.isClosedEmbedding.isClosed_range + have hsubset : Set.range j ⊆ Set.range (A.completionIsometry j hj) := by + rintro _ ⟨v,rfl⟩ + refine ⟨A.embedding v,?_⟩ + exact A.completionMap_coe j hj (A.finite v) + have hwhole : Set.univ ⊆ Set.range (A.completionIsometry j hj) := by + rw [← hdense.closure_range] + exact closure_minimal hsubset hclosed + exact fun y => hwhole (Set.mem_univ y) +def completionEquiv (j : (ι →₀ ℝ) →ₗ[ℝ] E) (hj : ∀ v,‖j v‖=A.seminorm v) + (hdense : DenseRange j) : A.Space ≃ₗᵢ[ℝ] E := + LinearIsometryEquiv.ofSurjective (A.completionIsometry j hj) (A.completionMap_surjective j hj hdense) +end CoordinateCompletion.Data + +namespace RecursiveModel +variable {E : ℕ → Type*} [∀ h,NormedAddCommGroup (E h)] [∀ h,NormedSpace ℝ (E h)] +/-- The actual outer Hilbert sum of the component embeddings. -/ +def outerEmbedding (j : ∀ h,Vec (h+1) →ₗ[ℝ] E h) : ForestVec →ₗ[ℝ] lp E 2 where + toFun v := ⟨fun h => j h (components v h),(memℓp_zero (by + apply (v.support.image Sigma.fst).finite_toSet.subset + intro h hh + change j h (components v h) ≠ 0 at hh + by_contra hn + rw [components_zero v h hn,map_zero] at hh + exact hh rfl)).of_exponent_ge bot_le⟩ + map_add' v w := by ext h; simp only [map_add,DFinsupp.add_apply,lp.coeFn_add,Pi.add_apply] + map_smul' c v := by ext h; simp only [map_smul,DFinsupp.smul_apply,lp.coeFn_smul,Pi.smul_apply,RingHom.id_apply] +lemma outerEmbedding_apply (j : ∀ h,Vec (h+1) →ₗ[ℝ] E h) (v : ForestVec) (h : ℕ) : + outerEmbedding j v h=j h (components v h) := rfl +lemma outerEmbedding_norm (j : ∀ h,Vec (h+1) →ₗ[ℝ] E h) + (s : ∀ h,Seminorm ℝ (Vec (h+1))) (hj : ∀ h v,‖j h v‖=s h v) (v : ForestVec) : + ‖outerEmbedding j v‖=outerSeminorm s v := by + change ‖outerEmbedding j v‖=‖finiteLp 2 (outerValues s v)‖ + have he (h : ℕ) : ‖outerEmbedding j v h‖=‖finiteLp 2 (outerValues s v) h‖ := by + rw [outerEmbedding_apply,hj,finiteLp_apply,outerValues_apply,Real.norm_eq_abs,abs_of_nonneg (apply_nonneg _ _)] + exact le_antisymm (lp.norm_mono (by norm_num) (fun h => (he h).le)) + (lp.norm_mono (by norm_num) (fun h => (he h).ge)) +lemma outerEmbedding_single (j : ∀ h,Vec (h+1) →ₗ[ℝ] E h) (h : ℕ) (v : Vec (h+1)) : + outerEmbedding j (components.symm (DFinsupp.single h v))=lp.single 2 h (j h v) := by + ext i + rw [outerEmbedding_apply,LinearEquiv.apply_symm_apply] + by_cases he : h=i + · subst i + rw [DFinsupp.single_eq_same,lp.single_apply_self] + · rw [DFinsupp.single_eq_of_ne (Ne.symm he),map_zero,lp.single_apply_ne _ _ _ (Ne.symm he)] +lemma outerEmbedding_dense (j : ∀ h,Vec (h+1) →ₗ[ℝ] E h) (hdense : ∀ h,DenseRange (j h)) : + DenseRange (outerEmbedding j) := by + let K := (LinearMap.range (outerEmbedding j)).topologicalClosure + have hK : IsClosed (K : Set (lp E 2)) := (LinearMap.range (outerEmbedding j)).isClosed_topologicalClosure + have hfinite (h : ℕ) (v : Vec (h+1)) : lp.single 2 h (j h v) ∈ K := by + apply subset_closure + exact ⟨components.symm (DFinsupp.single h v),outerEmbedding_single j h v⟩ + have hsingle (h : ℕ) (x : E h) : lp.single 2 h x ∈ K := by + induction x using (hdense h).induction_on with + | hp => exact hK.preimage (lp.singleContinuousLinearMap (𝕜 := ℝ) (E := E) (p := 2) h).continuous + | ih v => exact hfinite h v + intro x + change x ∈ K + apply hK.mem_of_tendsto (lp.hasSum_single (by norm_num : (2:ℝ≥0∞) ≠ ⊤) x) + exact Filter.Eventually.of_forall (fun S => K.sum_mem (fun h _ => hsingle h (x h))) +end RecursiveModel + +namespace FiniteLpDensity +variable {ι : Type*} (p : ℝ≥0∞) [Fact (1 ≤ p)] +open RecursiveModel +def embedding : (ι →₀ ℝ) →ₗ[ℝ] lp (fun _ : ι => ℝ) p where + toFun := finiteLp p + map_add' := finiteLp_add p + map_smul' := finiteLp_smul p +lemma dense (hp : p ≠ ⊤) : DenseRange (embedding (ι := ι) p) := by + let K := (LinearMap.range (embedding (ι := ι) p)).topologicalClosure + have hK : IsClosed (K : Set (lp (fun _ : ι => ℝ) p)) := (LinearMap.range (embedding (ι := ι) p)).isClosed_topologicalClosure + have hs (i : ι) (c : ℝ) : lp.single p i c ∈ K := by + apply subset_closure + refine ⟨Finsupp.single i c,?_⟩ + ext k + simp only [embedding,LinearMap.coe_mk,AddHom.coe_mk,finiteLp_apply,Finsupp.single_apply,lp.single_apply,Pi.single_apply,eq_comm] + intro x + change x ∈ K + apply hK.mem_of_tendsto (lp.hasSum_single hp x) + exact Filter.Eventually.of_forall (fun S => K.sum_mem (fun i _ => hs i (x i))) +end FiniteLpDensity + +namespace EquivalentNorm.Data +open RecursiveModel +variable {ι : Type*} {p : ℝ≥0∞} [Fact (1 ≤ p)] (A : EquivalentNorm.Data (lp (fun _ : ι => ℝ) p)) +def coordinateEmbedding : (ι →₀ ℝ) →ₗ[ℝ] A.Space := + A.algebraEquiv.symm.toLinearMap.comp (FiniteLpDensity.embedding p) +lemma coordinateEmbedding_norm (v : ι →₀ ℝ) : + ‖A.coordinateEmbedding v‖=A.seminorm (finiteLp p v) := rfl +lemma coordinateEmbedding_dense (hp : p ≠ ⊤) : DenseRange A.coordinateEmbedding := by + intro x + have hh (z : lp (fun _ : ι => ℝ) p) : A.equiv.symm z ∈ closure (range A.coordinateEmbedding) := by + induction z using (FiniteLpDensity.dense (ι := ι) p hp).induction_on with + | hp => exact isClosed_closure.preimage A.equiv.symm.continuous + | ih v => exact subset_closure ⟨v,rfl⟩ + exact hh (A.val x) +end EquivalentNorm.Data + +namespace PathModel +open RecursiveModel +def linearFullEmbedding : ForestVec →ₗ[ℝ] FullLinearSpace := + outerEmbedding (fun h => (linearFullData (h+1)).coordinateEmbedding) +def quadraticFullEmbedding : ForestVec →ₗ[ℝ] FullQuadraticSpace := + outerEmbedding (fun h => (quadraticFullData (h+1)).coordinateEmbedding) +lemma linearFullEmbedding_norm (v : ForestVec) : ‖linearFullEmbedding v‖=linearForestSeminorm v := + outerEmbedding_norm _ _ (fun h v => (linearFullData (h+1)).coordinateEmbedding_norm v) v +lemma quadraticFullEmbedding_norm (v : ForestVec) : ‖quadraticFullEmbedding v‖=quadraticForestSeminorm v := + outerEmbedding_norm _ _ (fun h v => (quadraticFullData (h+1)).coordinateEmbedding_norm v) v +lemma linearFullEmbedding_dense : DenseRange linearFullEmbedding := + outerEmbedding_dense _ (fun h => (linearFullData (h+1)).coordinateEmbedding_dense (by norm_num)) +lemma quadraticFullEmbedding_dense : DenseRange quadraticFullEmbedding := + outerEmbedding_dense _ (fun h => (quadraticFullData (h+1)).coordinateEmbedding_dense (by norm_num)) + +def linearFullEquiv : linearData.Space ≃ₗᵢ[ℝ] FullLinearSpace := + linearData.completionEquiv linearFullEmbedding linearFullEmbedding_norm linearFullEmbedding_dense +def quadraticFullEquiv : quadraticData.Space ≃ₗᵢ[ℝ] FullQuadraticSpace := + quadraticData.completionEquiv quadraticFullEmbedding quadraticFullEmbedding_norm quadraticFullEmbedding_dense +lemma linearFullEquiv_embedding (v : ForestVec) : + linearFullEquiv (linearData.embedding v)=linearFullEmbedding v := linearData.completionMap_coe _ _ _ +lemma quadraticFullEquiv_embedding (v : ForestVec) : + quadraticFullEquiv (quadraticData.embedding v)=quadraticFullEmbedding v := quadraticData.completionMap_coe _ _ _ +end PathModel + +namespace LpBoundedMap +variable {ι E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + {p : ℝ≥0∞} [Fact (1 ≤ p)] +def normVector (v : lp (fun _ : ι => E) p) : lp (fun _ : ι => ℝ) p := + ⟨fun i => ‖v i‖,v.property.norm⟩ +lemma normVector_norm {ι E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {p : ℝ≥0∞} [Fact (1 ≤ p)] (hp : p ≠ 0) (v : lp (fun _ : ι => E) p) : ‖normVector v‖=‖v‖ := by + have he (i : ι) : ‖normVector v i‖=‖v i‖ := norm_norm _ + exact le_antisymm (lp.norm_mono hp (fun i => (he i).le)) (lp.norm_mono hp (fun i => (he i).ge)) +def map (f : E → F) (C : ℝ) (hC : 0 ≤ C) (hf : ∀ x,‖f x‖ ≤ C*‖x‖) + (v : lp (fun _ : ι => E) p) : lp (fun _ : ι => F) p := + ⟨fun i => f (v i),(C • normVector v).property.mono' (fun i => by + simpa only [lp.coeFn_smul,Pi.smul_apply,smul_eq_mul,Real.norm_eq_abs,abs_mul,abs_of_nonneg hC, + normVector,abs_norm] using hf (v i))⟩ +lemma map_apply {ι E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] {p : ℝ≥0∞} [Fact (1 ≤ p)] (f : E → F) (C : ℝ) (hC : 0 ≤ C) (hf : ∀ x,‖f x‖ ≤ C*‖x‖) + (v : lp (fun _ : ι => E) p) (i : ι) : map f C hC hf v i=f (v i) := rfl +lemma map_norm {ι E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] {p : ℝ≥0∞} [Fact (1 ≤ p)] (hp : p ≠ 0) (f : E → F) (C : ℝ) (hC : 0 ≤ C) (hf : ∀ x,‖f x‖ ≤ C*‖x‖) + (v : lp (fun _ : ι => E) p) : ‖map f C hC hf v‖ ≤ C*‖v‖ := by + calc + _ ≤ ‖C • normVector v‖ := lp.norm_mono hp (fun i => by + simpa only [lp.coeFn_smul,Pi.smul_apply,smul_eq_mul,Real.norm_eq_abs,abs_mul,abs_of_nonneg hC, + normVector,abs_norm,map_apply] using hf (v i)) + _ = C*‖v‖ := by rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg hC,normVector_norm hp] +end LpBoundedMap + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/FiniteAverage.lean b/lean/OAI/Analysis/DiamondDistortion/FiniteAverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6f7b3df8d1b27fe19d23786590af381b1956719 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/FiniteAverage.lean @@ -0,0 +1,185 @@ +import Mathlib + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace FiniteAverage +variable {Ω : Type*} [Fintype Ω] + +lemma jensen_sq (w f : Ω → ℝ) (hw : ∀ ω, 0 ≤ w ω) (hs : ∑ ω, w ω = 1) : + (∑ ω, w ω * f ω) ^ 2 ≤ ∑ ω, w ω * f ω ^ 2 := by + let m := ∑ ω, w ω * f ω + have hpos : 0 ≤ ∑ ω, w ω * (f ω - m) ^ 2 := by + exact Finset.sum_nonneg (fun ω _ => mul_nonneg (hw ω) (sq_nonneg _)) + have he : (∑ ω, w ω * (f ω - m) ^ 2) = + (∑ ω, w ω * f ω ^ 2) - 2*m*(∑ ω, w ω*f ω) + m^2*(∑ ω,w ω) := by + calc + _ = ∑ ω, (w ω * f ω ^ 2 - (2*m)*(w ω*f ω) + m^2*w ω) := by + apply Finset.sum_congr rfl + intro ω _ + ring + _ = _ := by + rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, + ← Finset.mul_sum, ← Finset.mul_sum] + rw [he, hs] at hpos + dsimp [m] at hpos + nlinarith + +lemma sum_mul_sq_le (w : Ω → ℝ) (hw : ∀ ω, 0 ≤ w ω) + (hs : ∑ ω,w ω = 1) (f : Ω → ℝ) {V : ℝ} (hV : 0 ≤ V) + (hf : (∑ ω, w ω * f ω ^ 2) ≤ V) : + |∑ ω, w ω * f ω| ≤ Real.sqrt V := by + have h := (jensen_sq w f hw hs).trans hf + exact (sq_le_sq₀ (abs_nonneg _) (Real.sqrt_nonneg _)).mp (by + rw [sq_abs, Real.sq_sqrt hV] + exact h) + +lemma double_product (w f g : Ω → ℝ) : + (∑ ω, w ω * f ω) * (∑ ω, w ω * g ω) = + ∑ ω, ∑ ν, w ω * w ν * (f ω * g ν) := by + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro ω _ + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro ν _ + ring + +lemma norm_mean_le_sqrt {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (w : Ω → ℝ) (hw : ∀ ω, 0 ≤ w ω) (hs : ∑ ω,w ω = 1) + (z : Ω → E) {V : ℝ} (hV : 0 ≤ V) + (hz : (∑ ω, w ω * ‖z ω‖ ^ 2) ≤ V) : + ‖∑ ω, w ω • z ω‖ ≤ Real.sqrt V := by + calc + _ ≤ ∑ ω, ‖w ω • z ω‖ := norm_sum_le _ _ + _ = ∑ ω, w ω * ‖z ω‖ := by + apply Finset.sum_congr rfl + intro ω _ + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (hw ω)] + _ ≤ |∑ ω, w ω * ‖z ω‖| := le_abs_self _ + _ ≤ _ := sum_mul_sq_le w hw hs (fun ω => ‖z ω‖) hV hz + +/-- Averaged opposite-sign cancellation, including the error's gate energy. -/ +lemma pooled_mass {κ : Type*} [Fintype κ] + (w : Ω → ℝ) (hw : ∀ ω, 0 ≤ w ω) (hs : ∑ ω,w ω = 1) + (b W : Ω → κ → ℝ) (V L : Ω → ℝ) + (hmean : ∀ g, (∑ ω,w ω*b ω g) = -(∑ ω,w ω*W ω g)) + (hW : ∀ ω, (∑ g,W ω g ^ 2) ≤ V ω) + (hopp : ∀ ω ν, (∑ g, (|b ω g| * |b ν g| - b ω g*b ν g)) ≤ L ω + L ν) : + (∑ g, (∑ ω,w ω* |b ω g|)^2) ≤ (∑ ω,w ω*V ω) + 2*(∑ ω,w ω*L ω) := by + have hsign : (∑ g, (∑ ω,w ω*b ω g)^2) ≤ ∑ ω,w ω*V ω := by + calc + _ ≤ ∑ g, ∑ ω,w ω*(W ω g)^2 := by + apply Finset.sum_le_sum + intro g _ + rw [hmean g, neg_sq] + exact jensen_sq w (fun ω => W ω g) hw hs + _ = ∑ ω,w ω*(∑ g,W ω g^2) := by + rw [Finset.sum_comm] + simp only [Finset.mul_sum] + _ ≤ _ := Finset.sum_le_sum fun ω _ => mul_le_mul_of_nonneg_left (hW ω) (hw ω) + have hleft : (∑ g, ((∑ ω,w ω* |b ω g|)^2 - (∑ ω,w ω*b ω g)^2)) = + ∑ ω,∑ ν,w ω*w ν*(∑ g,(|b ω g| * |b ν g| - b ω g*b ν g)) := by + calc + _ = ∑ g, ∑ ω,∑ ν,w ω*w ν*(|b ω g| * |b ν g| - b ω g*b ν g) := by + apply Finset.sum_congr rfl + intro g _ + rw [sq, sq, double_product, double_product, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro ω _ + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro ν _ + ring + _ = _ := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro ω _ + rw [Finset.sum_comm] + simp only [Finset.mul_sum] + have hright : (∑ ω,∑ ν,w ω*w ν*(L ω+L ν)) = 2*(∑ ω,w ω*L ω) := by + calc + _ = (∑ ω,w ω*L ω)*(∑ ν,w ν) + (∑ ω,w ω)*(∑ ν,w ν*L ν) := by + simp only [Finset.sum_mul, Finset.mul_sum, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro ω _ + apply Finset.sum_congr rfl + intro ν _ + ring + _ = _ := by rw [hs]; ring + have hcross : (∑ ω,∑ ν,w ω*w ν*(∑ g,(|b ω g| * |b ν g| - b ω g*b ν g))) ≤ + ∑ ω,∑ ν,w ω*w ν*(L ω+L ν) := by + apply Finset.sum_le_sum + intro ω _ + apply Finset.sum_le_sum + intro ν _ + exact mul_le_mul_of_nonneg_left (hopp ω ν) (mul_nonneg (hw ω) (hw ν)) + rw [← hleft, hright, Finset.sum_sub_distrib] at hcross + linarith + +lemma joint_budget (w : Ω → ℝ) (hw : ∀ ω,0 ≤ w ω) (hs : ∑ ω,w ω=1) + (I : Ω → Type*) [∀ ω,Fintype (I ω)] (a b : ∀ ω,I ω→ℝ) {r R : ℝ} + (he : ∀ ω,(∑ i,a ω i^2) ≤ R^2) + (hc : (∑ ω,w ω*(∑ i,a ω i*b ω i)) = r^2) : + (∑ ω,w ω*(∑ i,(a ω i-b ω i)^2)) + + (∑ ω,w ω*(r^2-∑ i,b ω i^2)) ≤ R^2-r^2 := by + have hrow (ω : Ω) : (∑ i,(a ω i-b ω i)^2) + (r^2-∑ i,b ω i^2) = + (∑ i,a ω i^2) - 2*(∑ i,a ω i*b ω i) + r^2 := by + have hex : (∑ i,(a ω i-b ω i)^2) = + (∑ i,a ω i^2) - 2*(∑ i,a ω i*b ω i) + (∑ i,b ω i^2) := by + calc + _ = ∑ i,(a ω i^2 - 2*(a ω i*b ω i) + b ω i^2) := by + apply Finset.sum_congr rfl + intro i _ + ring + _ = _ := by rw [Finset.sum_add_distrib, Finset.sum_sub_distrib, ← Finset.mul_sum] + rw [hex] + ring + have hid : (∑ ω,w ω*(∑ i,(a ω i-b ω i)^2)) + + (∑ ω,w ω*(r^2-∑ i,b ω i^2)) = (∑ ω,w ω*(∑ i,a ω i^2)) - r^2 := by + rw [← Finset.sum_add_distrib] + simp_rw [← mul_add, hrow] + calc + _ = (∑ ω,w ω*(∑ i,a ω i^2)) - 2*(∑ ω,w ω*(∑ i,a ω i*b ω i)) + + r^2*(∑ ω,w ω) := by + rw [Finset.mul_sum, Finset.mul_sum, ← Finset.sum_sub_distrib, ← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro ω _ + ring + _ = _ := by rw [hc,hs]; ring + rw [hid] + apply sub_le_sub_right + calc + _ ≤ ∑ ω,w ω*R^2 := Finset.sum_le_sum fun ω _ => mul_le_mul_of_nonneg_left (he ω) (hw ω) + _ = R^2 := by rw [← Finset.sum_mul,hs,one_mul] + +lemma sqrt_pooled {η θ : ℝ} (hη : 0 ≤ η) (hθ : 0 ≤ θ) : + Real.sqrt η + Real.sqrt (η+2*θ) ≤ 2*Real.sqrt (η+θ) := by + have h2 : 0 ≤ η+2*θ := by positivity + have h1 : 0 ≤ η+θ := add_nonneg hη hθ + have he0 := Real.sq_sqrt hη + have he1 := Real.sq_sqrt h1 + have he2 := Real.sq_sqrt h2 + have hp : Real.sqrt η * Real.sqrt (η+2*θ) ≤ η+θ := by + have he : (Real.sqrt η * Real.sqrt (η+2*θ))^2 = η*(η+2*θ) := by + rw [mul_pow, he0, he2] + have hn := mul_nonneg (Real.sqrt_nonneg η) (Real.sqrt_nonneg (η+2*θ)) + nlinarith [sq_nonneg θ] + apply (sq_le_sq₀ (add_nonneg (Real.sqrt_nonneg _) (Real.sqrt_nonneg _)) + (mul_nonneg (by norm_num) (Real.sqrt_nonneg _))).mp + nlinarith + +end FiniteAverage + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/ForestModels.lean b/lean/OAI/Analysis/DiamondDistortion/ForestModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..8640363432c81ad29c86f88bc664f44d027f953a --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/ForestModels.lean @@ -0,0 +1,278 @@ +import OAI.Analysis.DiamondDistortion.Orthogonality + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +def ForestNode := {hw : ℕ × List ℕ // 1 ≤ hw.1 ∧ hw.2.length ≤ hw.1} + +def ForestAncestor (a b : ForestNode) : Prop := + a.val.1 = b.val.1 ∧ a.val.2.IsPrefix b.val.2 + +@[instance_reducible] def forestAncestry : Ancestry ForestNode where + le := ForestAncestor + lt a b := ForestAncestor a b ∧ ¬ ForestAncestor b a + le_refl a := ⟨rfl, List.prefix_refl _⟩ + le_trans _ _ _ hab hbc := ⟨hab.1.trans hbc.1, hab.2.trans hbc.2⟩ + le_antisymm a b hab hba := by + apply Subtype.ext + exact Prod.ext hab.1 (hab.2.sublist.antisymm hba.2.sublist) + predecessors_total hab hac := by + rcases List.prefix_or_prefix_of_prefix hab.2 hac.2 with h | h + · exact Or.inl ⟨hab.1.trans hac.1.symm, h⟩ + · exact Or.inr ⟨hac.1.trans hab.1.symm, h⟩ + +def forestSegments : SegmentSystem ForestNode := + Ancestry.segments (A := forestAncestry) + +/-- Prefix order on all finite words, explicitly distinct from their lexicographic order. -/ +@[instance_reducible] def infiniteAncestry : Ancestry (List ℕ) where + le := List.IsPrefix + lt a b := a.IsPrefix b ∧ ¬ b.IsPrefix a + le_refl := List.prefix_refl + le_trans _ _ _ := List.IsPrefix.trans + le_antisymm _ _ hab hba := hab.sublist.antisymm hba.sublist + predecessors_total := List.prefix_or_prefix_of_prefix + +/-- The infinite-height tree of all finite words; this includes the empty root. -/ +def infiniteSegments : SegmentSystem (List ℕ) := + Ancestry.segments (A := infiniteAncestry) + +lemma infinite_finite_heads : ∀ S : Finset (List ℕ), ∃ K : Finset (List ℕ), + S ⊆ K ∧ Ancestry.Ancestral (A := infiniteAncestry) (K : Set (List ℕ)) := by + apply Ancestry.finite_heads_of_predecessors (A := infiniteAncestry) + intro b + exact b.inits.toFinset.finite_toSet.subset (by + intro a ha + exact List.mem_toFinset.mpr ((List.mem_inits a b).mpr ha)) + +lemma forest_finite_heads : ∀ S : Finset ForestNode, ∃ K : Finset ForestNode, + S ⊆ K ∧ Ancestry.Ancestral (A := forestAncestry) (K : Set ForestNode) := by + apply Ancestry.finite_heads_of_predecessors (A := forestAncestry) + intro b + have hfin : (({b.val.1} : Set ℕ) ×ˢ (b.val.2.inits.toFinset : Set (List ℕ))).Finite := + (Set.finite_singleton _).prod b.val.2.inits.toFinset.finite_toSet + have hpre := hfin.preimage (f := (Subtype.val : ForestNode → ℕ × List ℕ)) Subtype.val_injective.injOn + apply hpre.subset + intro a ha + exact ⟨ha.1, List.mem_toFinset.mpr ((List.mem_inits _ _).mpr ha.2)⟩ + +namespace Forest + +def component (v : ForestNode) : ℕ := v.val.1 + +lemma same_component (S : Finset ForestNode) (hS : forestSegments.IsSegment S) + (u : ForestNode) (hu : u ∈ S) (v : ForestNode) (hv : v ∈ S) : + component u=component v := by + obtain ⟨a,b,_,hm⟩ := hS + exact ((hm u).mp hu).2.1.trans ((hm v).mp hv).2.1.symm + +lemma segment_card_le (S : Finset ForestNode) (hS : forestSegments.IsSegment S) + (u : ForestNode) (hu : u ∈ S) : S.card ≤ component u+1 := by + obtain ⟨a,b,_,hm⟩ := hS + have hcard : S.card ≤ (Finset.range (component b+1)).card := by + apply Finset.card_le_card_of_injOn (fun v : ForestNode => v.val.2.length) + · intro v hv + have hvb := ((hm v).mp hv).2 + apply Finset.mem_range.mpr + exact Nat.lt_succ_of_le (hvb.2.length_le.trans b.property.2) + · intro v hv w hw he + have hvb := ((hm v).mp hv).2 + have hwb := ((hm w).mp hw).2 + have hword : v.val.2=w.val.2 := by + rcases List.prefix_or_prefix_of_prefix hvb.2 hwb.2 with h | h + · exact h.eq_of_length he + · exact (h.eq_of_length he.symm).symm + exact Subtype.ext (Prod.ext (hvb.1.trans hwb.1.symm) hword) + rw [Finset.card_range] at hcard + have he : component u=component b := ((hm u).mp hu).2.1 + rwa [he] + +lemma primal_sq_bounded_components (C : Finset ℕ) (p : ForestNode →₀ ℝ) + (hp : ∀ v ∈ p.support, component v ∈ C) : + (forestSegments.primalSeminorm p)^2 ≤ (((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1)*(∑ v ∈ p.support,p v^2) := by + apply forestSegments.primal_sq_le_of_segment p (by positivity) + intro S hS + by_cases hz : (∑ v ∈ S,p v)=0 + · rw [hz,zero_pow (by decide : (2 : ℕ) ≠ 0)] + positivity + obtain ⟨u,hu,hpu⟩ := Finset.exists_ne_zero_of_sum_ne_zero hz + have hcu := hp u (Finsupp.mem_support_iff.mpr hpu) + have hcard : (S.card : ℝ) ≤ ((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1 := by + have h := (segment_card_le S hS u hu).trans (Nat.add_le_add_right (Finset.le_sup (f := id) hcu) 1) + exact_mod_cast h + exact sq_sum_le_card_mul_sum_sq.trans (mul_le_mul_of_nonneg_right hcard + (Finset.sum_nonneg (fun _ _ => sq_nonneg _))) + +def coefficients (C : Finset ℕ) (x : forestSegments.Dual) (v : ForestNode) : ℝ := + if component v ∈ C then x (forestSegments.unitVector v) else 0 + +lemma coefficients_bounded (C : Finset ℕ) (x : forestSegments.Dual) (S : Finset ForestNode) : + (∑ v ∈ S,coefficients C x v^2) ≤ (((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1)*‖x‖^2 := by + classical + let a := coefficients C x + let p := SegmentSystem.finiteArray S a + let B := ∑ v ∈ S,a v^2 + have hB : 0 ≤ B := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have hp : ∀ v ∈ p.support,component v ∈ C := by + intro v hv + by_contra hn + have hav : a v=0 := ite_eq_right hn + have hpv : p v=0 := by rw [SegmentSystem.finiteArray_apply,hav]; split_ifs <;> rfl + exact (Finsupp.mem_support_iff.mp hv) hpv + have hpenergy := primal_sq_bounded_components C p hp + rw [SegmentSystem.finiteArray_energy] at hpenergy + have he : x (forestSegments.finiteEmbedding p)=B := by + rw [forestSegments.finiteArray_pairing] + apply Finset.sum_congr rfl + intro v _ + dsimp [a,coefficients] + split_ifs <;> ring + have hval : B ≤ ‖x‖*forestSegments.primalSeminorm p := by + rw [← he] + exact (Real.le_norm_self _).trans (by + simpa only [SegmentSystem.finiteEmbedding_norm] using x.le_opNorm (forestSegments.finiteEmbedding p)) + have hsq := (sq_le_sq₀ hB + (mul_nonneg (norm_nonneg _) (apply_nonneg _ _))).2 hval + have hmul := mul_le_mul_of_nonneg_left hpenergy (sq_nonneg ‖x‖) + change B ≤ (((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1)*‖x‖^2 + by_contra hn + have hpos : 0 < B := lt_of_le_of_lt (by positivity) (lt_of_not_ge hn) + have hc := mul_pos hpos (sub_pos.mpr (lt_of_not_ge hn)) + change (forestSegments.primalSeminorm p)^2 ≤ (((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1)*B at hpenergy + change ‖x‖^2*(forestSegments.primalSeminorm p)^2 ≤ ‖x‖^2*((((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1)*B) at hmul + nlinarith only [hsq,hmul,hc] + +lemma finite_component_tail (C : Finset ℕ) (x : forestSegments.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ S : Finset ForestNode, ∀ p : ForestNode →₀ ℝ, + (∀ v ∈ p.support, component v ∈ C) → (∀ v ∈ p.support,v ∉ S) → + |x (forestSegments.finiteEmbedding p)| ≤ ε*forestSegments.primalSeminorm p := by + classical + obtain ⟨S,hS⟩ := SegmentSystem.finite_square_tails (coefficients C x) + (coefficients_bounded C x) (sq_pos_of_pos hε) + refine ⟨S,?_⟩ + intro p hp hout + have hd : Disjoint S p.support := Finset.disjoint_left.mpr (fun v hv hvs => hout v hvs hv) + have ha : Real.sqrt (∑ v ∈ p.support,coefficients C x v^2) ≤ ε := + (Real.sqrt_le_left hε.le).mpr (hS p.support hd).le + have hb : Real.sqrt (∑ v ∈ p.support,p v^2) ≤ forestSegments.primalSeminorm p := + (Real.sqrt_le_left (apply_nonneg _ _)).mpr (forestSegments.coordinate_energy_le p p.support) + have he : x (forestSegments.finiteEmbedding p) = + ∑ v ∈ p.support,p v*coefficients C x v := by + rw [SegmentSystem.finiteEmbedding_apply,SegmentSystem.dual_coe_apply] + apply Finset.sum_congr rfl + intro v hv + rw [coefficients,ite_eq_left (hp v hv)] + rfl + rw [he] + calc + _ ≤ ∑ v ∈ p.support, |p v| * |coefficients C x v| := by + simpa only [abs_mul] using Finset.abs_sum_le_sum_abs (fun v => p v*coefficients C x v) p.support + _ ≤ Real.sqrt (∑ v ∈ p.support,p v^2) * Real.sqrt (∑ v ∈ p.support,coefficients C x v^2) := by + simpa only [sq_abs] using Real.sum_mul_le_sqrt_mul_sqrt p.support + (fun v => |p v|) (fun v => |coefficients C x v|) + _ ≤ forestSegments.primalSeminorm p * ε := mul_le_mul hb ha (Real.sqrt_nonneg _) (apply_nonneg _ _) + _ = _ := mul_comm _ _ + +lemma component_set_ancestral (C : Finset ℕ) : + Ancestry.Ancestral (A := forestAncestry) {v : ForestNode | component v ∈ C} := by + intro a b hab hb + change ForestAncestor a b at hab + change component a ∈ C + change component b ∈ C at hb + have he : component a=component b := hab.1 + rwa [he] + +/-- The full finite-height forest dual really has finite ancestral head + approximation. Both the component tail and coordinate tail arguments are + proved from its disjoint-segment norm, rather than imposed as hypotheses. -/ +lemma full_dual_approximation (x : forestSegments.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ H : Finset ForestNode, Ancestry.Ancestral (A := forestAncestry) (H : Set ForestNode) ∧ + ‖forestSegments.tailDual H x‖ < ε := by + classical + have hd : 0 < ε/4 := by positivity + obtain ⟨C,hC⟩ := forestSegments.small_color_tail component same_component x hd + obtain ⟨S,hS⟩ := finite_component_tail C x hd + obtain ⟨H,hSH,hH⟩ := forest_finite_heads S + refine ⟨H,hH,?_⟩ + have hbound : ‖forestSegments.tailDual H x‖ ≤ ε/2 := by + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + intro u + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih u => + let p := forestSegments.ofPrimal u + let q := p.filter (fun v => v ∉ H) + let qi := q.filter (fun v => component v ∈ C) + let qo := q.filter (fun v => component v ∉ C) + have hqi : ∀ v ∈ qi.support,component v ∈ C := by + intro v hv + rw [Finsupp.support_filter] at hv + exact (Finset.mem_filter.mp hv).2 + have hqiS : ∀ v ∈ qi.support,v ∉ S := by + intro v hv hvs + rw [Finsupp.support_filter] at hv + have hvq := (Finset.mem_filter.mp hv).1 + rw [Finsupp.support_filter] at hvq + exact (Finset.mem_filter.mp hvq).2 (hSH hvs) + have hqo : ∀ v ∈ qo.support,component v ∉ C := by + intro v hv + rw [Finsupp.support_filter] at hv + exact (Finset.mem_filter.mp hv).2 + have hi := hS qi hqi hqiS + have ho := hC qo hqo + have hqin : forestSegments.primalSeminorm qi ≤ forestSegments.primalSeminorm q := by + change (Ancestry.segments (A := forestAncestry)).primalSeminorm qi ≤ + (Ancestry.segments (A := forestAncestry)).primalSeminorm q + convert Ancestry.primal_filter_le (A := forestAncestry) (component_set_ancestral C) q using 1 + all_goals dsimp [qi,qo]; congr + have hqon : forestSegments.primalSeminorm qo ≤ forestSegments.primalSeminorm q := by + change (Ancestry.segments (A := forestAncestry)).primalSeminorm qo ≤ + (Ancestry.segments (A := forestAncestry)).primalSeminorm q + convert Ancestry.primal_filter_tail_le (A := forestAncestry) (component_set_ancestral C) q using 1 + all_goals dsimp [qi,qo]; congr + have hqn : forestSegments.primalSeminorm q ≤ forestSegments.primalSeminorm p := by + change (Ancestry.segments (A := forestAncestry)).primalSeminorm q ≤ + (Ancestry.segments (A := forestAncestry)).primalSeminorm p + convert Ancestry.primal_filter_tail_le (A := forestAncestry) hH p using 1 + all_goals dsimp [q]; congr + have hsum : qi+qo=q := by + apply Finsupp.ext + intro v + by_cases hv : component v ∈ C <;> simp [qi,qo] + have he : forestSegments.tailDual H x (u : forestSegments.JamesSpace) = + x (forestSegments.finiteEmbedding q) := by + rw [SegmentSystem.tailDual_apply_apply,SegmentSystem.headPrimal_coe, + ← UniformSpace.Completion.coe_sub,SegmentSystem.sub_filterPrimal] + congr 2 + apply Finsupp.ext + intro v + simp [SegmentSystem.filterPrimal,q,p,SegmentSystem.ofPrimal] + congr + rw [he,Real.norm_eq_abs,UniformSpace.Completion.norm_coe,SegmentSystem.norm_eq_primal] + calc + _ = |x (forestSegments.finiteEmbedding qi)+x (forestSegments.finiteEmbedding qo)| := by + rw [← hsum,map_add,map_add] + _ ≤ |x (forestSegments.finiteEmbedding qi)|+|x (forestSegments.finiteEmbedding qo)| := abs_add_le _ _ + _ ≤ (ε/4)*forestSegments.primalSeminorm qi+(ε/4)*forestSegments.primalSeminorm qo := add_le_add hi ho + _ ≤ (ε/4)*forestSegments.primalSeminorm q+(ε/4)*forestSegments.primalSeminorm q := + add_le_add (mul_le_mul_of_nonneg_left hqin hd.le) (mul_le_mul_of_nonneg_left hqon hd.le) + _ ≤ _ := by nlinarith [mul_le_mul_of_nonneg_left hqn hd.le] + exact lt_of_le_of_lt hbound (by linarith) + +end Forest + +abbrev ForestDual := forestSegments.Dual +abbrev InfinitePredual := infiniteSegments.CoordinatePredual + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/FullDual.lean b/lean/OAI/Analysis/DiamondDistortion/FullDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..8b7561df97d986d6daee2ffd00ba006d36b2cff6 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/FullDual.lean @@ -0,0 +1,176 @@ +import OAI.Analysis.DiamondDistortion.LpDual + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +open scoped Classical +open Filter Topology + +namespace RecursiveModel +lemma exponent_real_gt_one (h : ℕ) : 1 < (exponent h).toReal := by + unfold exponent + rw [ENNReal.toReal_add ENNReal.one_ne_top (by simp),ENNReal.toReal_one,ENNReal.toReal_inv] + rw [ENNReal.toReal_add (by simp) ENNReal.one_ne_top] + simp only [ENNReal.toReal_natCast,ENNReal.toReal_one] + have hpos : 0 < (h:ℝ)+1 := by positivity + linarith [inv_pos.mpr hpos] + +instance vectorComponentDualSeparable (h : ℕ) : + TopologicalSpace.SeparableSpace (StrongDual ℝ (VectorComponent h)) := by + let : TopologicalSpace.SeparableSpace (StrongDual ℝ (Full (exponent h) (h+1))) := + LpDual.dual_separable (fun _ : Coord (h+1) => ℝ) (exponent h) (exponent_real_gt_one h) + let e := (fullData (exponent h) (exponent_real_pos h) (h+1)).equiv.symm.arrowCongr + (ContinuousLinearEquiv.refl ℝ ℝ) + exact e.surjective.denseRange.separableSpace e.continuous + +instance fullVectorDualSeparable : TopologicalSpace.SeparableSpace (StrongDual ℝ FullVectorSpace) := + LpDual.dual_separable VectorComponent 2 (by norm_num) +instance vectorDualSeparable : TopologicalSpace.SeparableSpace (StrongDual ℝ VectorSpace) := by + let e := fullVectorEquiv.symm.toContinuousLinearEquiv.arrowCongr (ContinuousLinearEquiv.refl ℝ ℝ) + exact e.surjective.denseRange.separableSpace e.continuous +end RecursiveModel + +namespace CoordinateCompletion.Data +variable {ι κ E : Type*} (A : CoordinateCompletion.Data ι) + [NormedAddCommGroup E] [NormedSpace ℝ E] +lemma coordinate_of_equiv (e : A.Space ≃ₗᵢ[ℝ] E) (i : ι) (c : E →L[ℝ] ℝ) + (hj : ∀ v,c (e (A.embedding v))=v i) (x : A.Space) : c (e x)=A.coordinate i x := by + induction x using UniformSpace.Completion.induction_on with + | hp => exact isClosed_eq (c.continuous.comp e.continuous) (A.coordinate i).continuous + | ih v => + rw [A.coordinate_coe] + change c (e (A.embedding (A.array v))) = _ + exact hj (A.array v) +lemma transported_projection_coordinate (e : A.Space ≃ₗᵢ[ℝ] E) (i : ι) (c : E →L[ℝ] ℝ) + (hj : ∀ v,c (e (A.embedding v))=v i) + (H : κ → Finset ι) (hcover : ∀ S : Finset ι,∃ h,S ⊆ H h) (h : κ) (x : E) : + c (((A.heads H hcover).transport e).projection h x)=if i ∈ H h then c x else 0 := by + change c (e (A.projection (H h) (e.symm x)))=_ + rw [A.coordinate_of_equiv e i c hj,A.coordinate_projection, + ← A.coordinate_of_equiv e i c hj,e.apply_symm_apply] +end CoordinateCompletion.Data + +namespace EquivalentNorm.Data +variable {ι : Type*} {p : ℝ≥0∞} [Fact (1 ≤ p)] + (A : EquivalentNorm.Data (lp (fun _ : ι => ℝ) p)) +def coordinate (i : ι) : A.Space →L[ℝ] ℝ := + (lp.evalCLM ℝ (fun _ : ι => ℝ) p i).comp A.equiv.toContinuousLinearMap +lemma coordinate_apply (i : ι) (x : A.Space) : A.coordinate i x=A.val x i := rfl +lemma coordinate_embedding (i : ι) (v : ι →₀ ℝ) : A.coordinate i (A.coordinateEmbedding v)=v i := rfl +end EquivalentNorm.Data + +namespace RecursiveModel +variable {E : ℕ → Type*} [∀ h,NormedAddCommGroup (E h)] [∀ h,NormedSpace ℝ (E h)] +def outerCoordinate (c : ∀ h,Coord (h+1) → E h →L[ℝ] ℝ) (i : ForestCoord) : lp E 2 →L[ℝ] ℝ := + (c i.1 i.2).comp (lp.evalCLM ℝ E 2 i.1) +lemma outerCoordinate_apply (c : ∀ h,Coord (h+1) → E h →L[ℝ] ℝ) (i : ForestCoord) (x : lp E 2) : + outerCoordinate c i x=c i.1 i.2 (x i.1) := rfl +lemma outerCoordinate_embedding (c : ∀ h,Coord (h+1) → E h →L[ℝ] ℝ) + (j : ∀ h,Vec (h+1) →ₗ[ℝ] E h) (hc : ∀ h i v,c h i (j h v)=v i) (i : ForestCoord) (v : ForestVec) : + outerCoordinate c i (outerEmbedding j v)=v i := by + rw [outerCoordinate_apply,outerEmbedding_apply,hc,components_apply] +end RecursiveModel + +namespace PathModel +open RecursiveModel +def linearFullCoordinate : ForestCoord → FullLinearSpace →L[ℝ] ℝ := + outerCoordinate (fun h => (linearFullData (h+1)).coordinate) +def quadraticFullCoordinate : ForestCoord → FullQuadraticSpace →L[ℝ] ℝ := + outerCoordinate (fun h => (quadraticFullData (h+1)).coordinate) +lemma linearFullCoordinate_equiv (i : ForestCoord) (x : LinearSpace) : + linearFullCoordinate i (linearFullEquiv x)=linearData.coordinate i x := + linearData.coordinate_of_equiv linearFullEquiv i (linearFullCoordinate i) (fun v => by + rw [linearFullEquiv_embedding] + rfl) x +lemma quadraticFullCoordinate_equiv (i : ForestCoord) (x : QuadraticSpace) : + quadraticFullCoordinate i (quadraticFullEquiv x)=quadraticData.coordinate i x := + quadraticData.coordinate_of_equiv quadraticFullEquiv i (quadraticFullCoordinate i) (fun v => by + rw [quadraticFullEquiv_embedding] + rfl) x + +lemma linearFullHeads_coordinate (H : ForestHead) (x : FullLinearSpace) (i : ForestCoord) : + linearFullCoordinate i (linearFullHeads.projection H x)=if i ∈ H.val then linearFullCoordinate i x else 0 := by + classical + convert + linearData.transported_projection_coordinate linearFullEquiv i (linearFullCoordinate i) + (fun v => by rw [linearFullEquiv_embedding]; rfl) Subtype.val + (fun S => ⟨forestHead S,forestHead_contains S⟩) H x using 1 + all_goals congr + +lemma quadraticFullHeads_coordinate (H : ForestHead) (x : FullQuadraticSpace) (i : ForestCoord) : + quadraticFullCoordinate i (quadraticFullHeads.projection H x)=if i ∈ H.val then quadraticFullCoordinate i x else 0 := by + classical + convert + quadraticData.transported_projection_coordinate quadraticFullEquiv i (quadraticFullCoordinate i) + (fun v => by rw [quadraticFullEquiv_embedding]; rfl) Subtype.val + (fun S => ⟨forestHead S,forestHead_contains S⟩) H x using 1 + all_goals congr + +end PathModel + +namespace RecursiveModel +def fullVectorCoordinate : ForestCoord → FullVectorSpace →L[ℝ] ℝ := + outerCoordinate (fun h => (fullData (exponent h) (exponent_real_pos h) (h+1)).coordinate) +lemma fullVectorCoordinate_equiv (i : ForestCoord) (x : VectorSpace) : + fullVectorCoordinate i (fullVectorEquiv x)=vectorData.coordinate i x := + vectorData.coordinate_of_equiv fullVectorEquiv i (fullVectorCoordinate i) (fun v => by + rw [fullVectorEquiv_embedding] + rfl) x +lemma fullVectorHeads_coordinate (H : ForestHead) (x : FullVectorSpace) (i : ForestCoord) : + fullVectorCoordinate i (fullVectorHeads.projection H x)=if i ∈ H.val then fullVectorCoordinate i x else 0 := by + classical + convert + vectorData.transported_projection_coordinate fullVectorEquiv i (fullVectorCoordinate i) + (fun v => by rw [fullVectorEquiv_embedding]; rfl) Subtype.val + (fun S => ⟨forestHead S,forestHead_contains S⟩) H x using 1 + all_goals congr + +end RecursiveModel + +namespace StartModel +open RecursiveModel +def componentCoordinate (h : ℕ) (r : Coord h) : FullComponent h →L[ℝ] ℝ := + (LinearMap.ker (output h)).liftQL (outputCoordinate h r) (by + intro d hd + change output h d r=0 + exact congrFun hd r) +lemma componentCoordinate_rep (h : ℕ) (r : Coord h) (d : Rep h) : + componentCoordinate h r ((LinearMap.ker (output h)).mkQ d)=output h d r := rfl +lemma componentCoordinate_embedding (h : ℕ) (r : Coord h) (v : Vec h) : + componentCoordinate h r (componentEmbedding h v)=v r := by + change output h (finiteSection h v) r=v r + exact congrFun ((relation h).section_output v) r + +def fullCoordinate : ForestCoord → FullSpace →L[ℝ] ℝ := + outerCoordinate (fun h => componentCoordinate (h+1)) +lemma fullCoordinate_embedding (i : ForestCoord) (v : ForestVec) : fullCoordinate i (fullEmbedding v)=v i := + outerCoordinate_embedding _ _ (fun h i v => componentCoordinate_embedding (h+1) i v) i v +lemma fullCoordinate_equiv (i : ForestCoord) (x : Space) : + fullCoordinate i (fullEquiv x)=data.coordinate i x := + data.coordinate_of_equiv fullEquiv i (fullCoordinate i) (fun v => by + rw [fullEquiv_embedding,fullCoordinate_embedding]) x +lemma fullHeads_coordinate (H : ForestHead) (x : FullSpace) (i : ForestCoord) : + fullCoordinate i (fullHeads.projection H x)=if i ∈ H.val then fullCoordinate i x else 0 := by + classical + convert + data.transported_projection_coordinate fullEquiv i (fullCoordinate i) + (fun v => by rw [fullEquiv_embedding,fullCoordinate_embedding]) Subtype.val + (fun S => ⟨forestHead S,forestHead_contains S⟩) H x using 1 + all_goals congr + +end StartModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/GraphBounds.lean b/lean/OAI/Analysis/DiamondDistortion/GraphBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfb76436409716eb5e5e53d1b1e10722cd32b980 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/GraphBounds.lean @@ -0,0 +1,143 @@ +import OAI.Analysis.DiamondDistortion.StartBounds + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +/-- Exact positive-rho qualitative result for the complete finite-forest dual. -/ +theorem forest_normer_first {ε : ℝ} (hε : 0 < ε) : + ∃ ρ : ℝ,0 < ρ ∧ ρ < 1 ∧ Diamond.UnitLensBound ForestDual ε ρ := + Diamond.QuadraticLens.positive_gap forest_quadratic_lens hε + +theorem forest_qualitative_backward {D : ℝ} (hD : 1 ≤ D) : + ∃ ρ : ℝ,0 < ρ ∧ ρ < 1 ∧ ∀ (k : ℕ) (f : Diamond.Vertex k → ForestDual) (s : ℝ), + Diamond.HasDistortion k f D s → D⁻¹ ≤ ρ^k := by + have hD0 : 0 < D := by linarith + have hα : 0 < D⁻¹ := inv_pos.2 hD0 + obtain ⟨ρ,hρ,hρ1,hgap⟩ := forest_normer_first hα + refine ⟨ρ,hρ,hρ1,?_⟩ + intro k f s hf + have hn := Diamond.upper_one_normalization f hf + exact Diamond.backward hα ((inv_le_one₀ hD0).mpr hD) hρ.le hρ1 + (hgap.mono_separation (by linarith)) k (fun v => (D*s)⁻¹ • f v) + (fun u v => (hn u v).1) (fun u v => (hn u v).2) + +/-- The separately stated exact radial constant C_* = sqrt 2 + sqrt 6. + The proof uses the stronger established bound on the identical norm. -/ +theorem forest_radial_deficit {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → ForestDual) + (hf : Diamond.HasDistortion k f D s) : + (k:ℝ) ≤ (Real.sqrt 2+Real.sqrt 6)^2*D*(D-1) := by + have hh := headline.1 k f D s hf + have hD : 1 ≤ D := hf.1 + have hD0 : 0 ≤ D := by linarith + have h2 := Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 2) + have h6 := Real.sq_sqrt (by norm_num : (0:ℝ) ≤ 6) + have hp := mul_nonneg (Real.sqrt_nonneg 2) (Real.sqrt_nonneg 6) + have hC : 8 ≤ (Real.sqrt 2+Real.sqrt 6)^2 := by nlinarith + have hb : (k:ℝ) ≤ 8*D*(D-1) := by nlinarith [sq_nonneg (D-1)] + have hm := mul_le_mul_of_nonneg_right hC (mul_nonneg hD0 (by linarith : 0 ≤ D-1)) + nlinarith + +namespace Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +theorem Heads.vanishing_lens_pos (A : Heads ι X) (hinput : A.TailVanishing) {ε : ℝ} + (hε : 0 < ε) : ∃ ρ : ℝ,0 < ρ ∧ ρ < 1 ∧ Diamond.UnitLensBound X ε ρ := by + obtain ⟨ρ,hρ,hρ1,hlens⟩ := A.vanishing_lens hinput hε + refine ⟨(1+ρ)/2,by linarith,by linarith,?_⟩ + exact fun x z hp hm hs => (hlens x z hp hm hs).trans (by linarith) +end Midpoint + +namespace DirectLayers.Regular +variable {X Y I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] [Preorder I] +lemma transport {A : Midpoint.Heads I X} (hA : Regular A) (e : X ≃ₗᵢ[ℝ] Y) : + Regular (A.transport e) where + nonempty := hA.nonempty + upper := hA.upper + nested_left H K hHK x := by + simp only [Midpoint.Heads.transport_projection,e.symm_apply_apply] + rw [hA.nested_left H K hHK] + nested_right H K hHK x := by + simp only [Midpoint.Heads.transport_projection,e.symm_apply_apply] + rw [hA.nested_right H K hHK] + contractive H x := by + rw [Midpoint.Heads.transport_projection,e.norm_map] + exact (hA.contractive H (e.symm x)).trans_eq (e.symm.norm_map x) +end DirectLayers.Regular + +namespace PathModel +open RecursiveModel DirectLayers SignCube +instance linearFullDualSeparable : TopologicalSpace.SeparableSpace (StrongDual ℝ FullLinearSpace) := by + let e := linearFullEquiv.toContinuousLinearEquiv.arrowCongr (ContinuousLinearEquiv.refl ℝ ℝ) + exact e.surjective.denseRange.separableSpace e.continuous + +theorem linear_full_weak_graph (hinput : PathApplications.WeakInput FullLinearSpace) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/64 ≤ D^2 := PathApplications.weak_linear hinput k f hf + +theorem linear_full_regular : Regular linearFullHeads := linear_regular.transport linearFullEquiv + +theorem full_adaptive_graph (C : ℝ) (hin : SignInput linearFullHeads.projection C) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) + (hf : Diamond.HasDistortion k f D s) : + (k:ℝ)/16 ≤ C*(D^2+(k:ℝ)*((2:ℝ)^k)⁻¹^2) ∧ + C*(D^2+(k:ℝ)*((2:ℝ)^k)⁻¹^2) ≤ C*(D^2+1) := + DirectLayers.adaptive_graph linearFullHeads linear_full_regular hin k f hf + +theorem full_predictable_495_graph (hin : PredictableInput linearFullHeads.projection 495) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) + (hf : Diamond.HasDistortion k f D s) : (k:ℝ)/4 ≤ 495*(D+1)^2 := + DirectLayers.predictable_graph linearFullHeads linear_full_regular hin k f hf + +theorem full_variation_252_graph (hin : PredictableInput linearFullHeads.projection 252) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) + (hf : Diamond.HasDistortion k f D s) : (k:ℝ)/(16*D^2) ≤ 1008 := + DirectLayers.variation_graph linearFullHeads linear_full_regular hin k f hf + +theorem full_leakage_1024_graph (hin : LeakageInput linearFullHeads.projection) + {D s : ℝ} (k : ℕ) (hk : 1 ≤ k) (f : Diamond.Vertex k → FullLinearSpace) + (hf : Diamond.HasDistortion k f D s) : + (k:ℝ)/8 ≤ 1024*(D^2+(k:ℝ)*(leakageTolerance k)^2) ∧ + 1024*(D^2+(k:ℝ)*(leakageTolerance k)^2) ≤ 1024*(D^2+1) := + DirectLayers.leakage_graph linearFullHeads linear_full_regular hin k hk f hf + +theorem full_squared_gap_400_graph (hin : GapInput linearFullHeads.projection) + {D s γ : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) + (hf : Diamond.HasDistortion k f D s) (hγ : 0 < γ) + (hγa : γ < (2/D)/8) (hγk : γ < 1/((k:ℝ)+1)) : + ∃ T : Protocol FullLinearSpace ForestHead k, + T.Martingale ∧ T.Nested ∧ T.Anchored ∧ T.CommonHeads ∧ T.Supported linearFullHeads.projection ∧ + T.terminalEnergy ≤ 4 ∧ T.initialEnergy+(k:ℝ)*((2/D)/8)^2/400 ≤ T.terminalEnergy ∧ + (k:ℝ)*((2/D)/8)^2/400 ≤ T.initialEnergy+(k:ℝ)*((2/D)/8)^2/400 := + DirectLayers.gap_graph linearFullHeads linear_full_regular hin k f hf hγ hγa hγk +end PathModel + +namespace RecursiveModel +open RecursiveApplications +/-- The weak-null clause on the literal full ℓ_p recursive-array model. -/ +theorem full_cubic_weak (hinput : CubicInput fullVectorHeads) {ε : ℝ} + (hε : 0 < ε) (hε1 : ε ≤ 1) (x : FullVectorSpace) (z : ℕ → FullVectorSpace) + (hz : Midpoint.WeaklyNull z) (hl : ∀ i,ε ≤ ‖z i‖) + (hp : ∀ i,‖x+z i‖ ≤ 1) (hm : ∀ i,‖x-z i‖ ≤ 1) : ‖x‖ ≤ theta ε := + cubic_weak_lens fullVectorHeads hinput hε hε1 z hz hl hp hm + +/-- The infinite separated-lens clause, before the graph specialization. -/ +theorem full_sixth_lens (hinput : SixthInput fullVectorHeads) {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) : + Diamond.UnitLensBound FullVectorSpace ε (q6 ε) := + sixth_lens fullVectorHeads hinput hε hε1 +end RecursiveModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/HeadProjections.lean b/lean/OAI/Analysis/DiamondDistortion/HeadProjections.lean new file mode 100644 index 0000000000000000000000000000000000000000..d632b3f2ab4a3b1d73c744eabb64ead3415d1df1 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/HeadProjections.lean @@ -0,0 +1,224 @@ +import OAI.Analysis.DiamondDistortion.DirectEnergy + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace LpCut +variable {ι : Type*} {p : ℝ≥0∞} [Fact (1 ≤ p)] +def linear (H : ι → Prop) [DecidablePred H] : lp (fun _ : ι => ℝ) p →ₗ[ℝ] lp (fun _ : ι => ℝ) p where + toFun v := ⟨fun i => if H i then v i else 0,v.property.mono' (fun i => by split_ifs <;> simp)⟩ + map_add' u v := by + ext i + change (if H i then u i+v i else 0)=(if H i then u i else 0)+(if H i then v i else 0) + by_cases h : H i <;> simp [h] + map_smul' c v := by ext i; by_cases h : H i <;> simp [h] +lemma linear_apply {ι : Type*} {p : ℝ≥0∞} [Fact (1 ≤ p)] (H : ι → Prop) [DecidablePred H] (v : lp (fun _ : ι => ℝ) p) (i : ι) : + linear H v i=if H i then v i else 0 := rfl +lemma norm_linear (H : ι → Prop) [DecidablePred H] (v : lp (fun _ : ι => ℝ) p) : ‖linear H v‖ ≤ ‖v‖ := by + apply lp.norm_mono (ne_of_gt (lt_of_lt_of_le zero_lt_one (Fact.out : 1 ≤ p))) + intro i + rw [linear_apply] + split_ifs <;> simp +def continuous (H : ι → Prop) [DecidablePred H] : lp (fun _ : ι => ℝ) p →L[ℝ] lp (fun _ : ι => ℝ) p := + (linear H).mkContinuous 1 (fun v => by simpa only [one_mul] using norm_linear H v) +lemma continuous_apply (H : ι → Prop) [DecidablePred H] (v : lp (fun _ : ι => ℝ) p) (i : ι) : + continuous H v i=if H i then v i else 0 := rfl +end LpCut + +namespace RecursiveModel +lemma ancestors_linear (h : ℕ) {a b c : Coord h} + (ha : a ∈ ancestors h c) (hb : b ∈ ancestors h c) : + a ∈ ancestors h b ∨ b ∈ ancestors h a := by + induction h with + | zero => left; exact self_mem_ancestors _ _ + | succ h ih => + cases c with + | inl u => + have hak : a=Sum.inl () := by simpa only [ancestors,Finset.mem_singleton] using ha + have hbk : b=Sum.inl () := by simpa only [ancestors,Finset.mem_singleton] using hb + subst a; subst b + exact Or.inl (self_mem_ancestors _ _) + | inr q => + rcases Finset.mem_insert.mp ha with ha|ha + · subst a + rcases Finset.mem_insert.mp hb with hb|hb + · subst b; exact Or.inl (self_mem_ancestors _ _) + · obtain ⟨b',hb',rfl⟩ := Finset.mem_image.mp hb + exact Or.inl (Finset.mem_insert_self _ _) + · obtain ⟨a',ha',rfl⟩ := Finset.mem_image.mp ha + rcases Finset.mem_insert.mp hb with hb|hb + · subst b; exact Or.inr (Finset.mem_insert_self _ _) + · obtain ⟨b',hb',rfl⟩ := Finset.mem_image.mp hb + rcases ih ha' hb' with h|h + · exact Or.inl (Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨a',h,rfl⟩)) + · exact Or.inr (Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨b',h,rfl⟩)) + +lemma ancestral_prefix (h : ℕ) (H : Coord h → Prop) [DecidablePred H] + (hH : ∀ a b,H b → a ∈ ancestors h b → H a) (s : Coord h) : + (ancestors h s).filter H=∅ ∨ ∃ t,(ancestors h s).filter H=ancestors h t := by + let S := (ancestors h s).filter H + by_cases hn : S.Nonempty + · obtain ⟨t,ht,hmax⟩ := Finset.exists_max_image S (fun t => (ancestors h t).card) hn + refine Or.inr ⟨t,?_⟩ + apply Finset.Subset.antisymm + · intro r hr + have hrs := (Finset.mem_filter.mp hr).1 + have hts := (Finset.mem_filter.mp ht).1 + rcases ancestors_linear h hrs hts with he|he + · exact he + · have hs : ancestors h t ⊆ ancestors h r := fun _ hk => ancestor_trans h hk he + have hc := hmax r hr + have heq := Finset.eq_of_subset_of_card_le hs hc + rw [heq] + exact self_mem_ancestors h r + · intro r hr + exact Finset.mem_filter.mpr ⟨ancestor_trans h hr (Finset.mem_filter.mp ht).1, + hH r t (Finset.mem_filter.mp ht).2 hr⟩ + · exact Or.inl (Finset.not_nonempty_iff_eq_empty.mp hn) +end RecursiveModel + +namespace PathModel +open RecursiveModel +lemma cut_branch (h : ℕ) (H : Coord h → Prop) [DecidablePred H] + (hH : ∀ a b,H b → a ∈ ancestors h b → H a) (s : Coord h) : + LpCut.continuous H (branch h s)=0 ∨ ∃ t,LpCut.continuous H (branch h s)=branch h t := by + rcases ancestral_prefix h H hH s with he|⟨t,he⟩ + · left + ext r + rw [LpCut.continuous_apply,branch_apply] + by_cases hr : H r + · rw [ite_eq_left hr,ite_eq_right (by + intro hh + have hk := Finset.mem_filter.mpr ⟨hh,hr⟩ + rw [he] at hk + exact Finset.notMem_empty r hk)] + rfl + · rw [ite_eq_right hr]; rfl + · right + refine ⟨t,?_⟩ + ext r + rw [LpCut.continuous_apply,branch_apply,branch_apply] + have hm : r ∈ ancestors h t ↔ r ∈ ancestors h s ∧ H r := by rw [← he,Finset.mem_filter] + by_cases h₁ : H r <;> by_cases h₂ : r ∈ ancestors h s <;> simp [h₁,h₂,hm] + +lemma branch_cost (h : ℕ) (s : Coord h) : cost 1 h (branch h s) ≤ 1 := by + have hh := (presentation 1 h).le_representation (d := WithLp.toLp 1 ((0 : L2 h),lp.single 1 s (1:ℝ))) + (show (presentation 1 h).output (WithLp.toLp 1 (0,lp.single 1 s (1:ℝ)))=branch h s by + change 0+path h (lp.single 1 s 1)=_ + rw [zero_add,path_single,one_smul]) + simpa only [WithLp.prod_norm_eq_of_L1,WithLp.fst,WithLp.snd,WithLp.ofLp_toLp,norm_zero,zero_add, + lp.norm_single (by norm_num : (0:ℝ≥0∞)<1),norm_one,cost] using hh + +lemma linear_cost_cut (h : ℕ) (H : Coord h → Prop) [DecidablePred H] + (hH : ∀ a b,H b → a ∈ ancestors h b → H a) (v : L2 h) : + cost 1 h (LpCut.continuous H v) ≤ cost 1 h v := by + let E := linearFullData h + let T : L2 h →L[ℝ] E.Space := E.equiv.symm.toContinuousLinearMap.comp (LpCut.continuous H) + have hbranch (s : Coord h) : ‖T (branch h s)‖ ≤ 1 := by + change cost 1 h (LpCut.continuous H (branch h s)) ≤ 1 + rcases cut_branch h H hH s with he|⟨t,he⟩ + · rw [he,map_zero]; norm_num + · rw [he]; exact branch_cost h t + have hp (μ : L1 h) : cost 1 h (LpCut.continuous H (path h μ)) ≤ ‖μ‖ := by + have hnorm : Summable (fun s => ‖μ s • T (branch h s)‖) := by + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ (summable_abs μ) + intro s + rw [norm_smul,Real.norm_eq_abs] + exact (mul_le_mul_of_nonneg_left (hbranch s) (abs_nonneg _)).trans_eq (mul_one _) + have hsum := (path_summable μ).hasSum.mapL T + simp_rw [map_smul] at hsum + change ‖T (path h μ)‖ ≤ ‖μ‖ + change ‖T (∑' s,μ s • branch h s)‖ ≤ ‖μ‖ + rw [← hsum.tsum_eq] + calc + _ ≤ ∑' s,‖μ s • T (branch h s)‖ := norm_tsum_le_tsum_norm hnorm + _ ≤ ∑' s,|μ s| := Summable.tsum_le_tsum (fun s => by + rw [norm_smul,Real.norm_eq_abs] + exact (mul_le_mul_of_nonneg_left (hbranch s) (abs_nonneg _)).trans_eq (mul_one _)) hnorm (summable_abs μ) + _ = ‖μ‖ := tsum_abs μ + have hb := (presentation 1 h).bound v (by norm_num : (0:ℝ) ≤ 1) (b := cost 1 h (LpCut.continuous H v)) + simp only [one_mul] at hb + apply hb + intro d hd + change d.fst+path h d.snd=v at hd + rw [← hd,map_add,WithLp.prod_norm_eq_of_L1] + exact (map_add_le_add (cost 1 h) _ _).trans (add_le_add + ((linear_le_norm _ _).trans (LpCut.norm_linear _ _)) (hp d.snd)) +end PathModel + +namespace CoordinateCompletion.Data +variable {ι : Type*} (A : CoordinateCompletion.Data ι) +lemma projection_nested (H B : Finset ι) (hHB : H ⊆ B) (x : A.Space) : + A.projection H (A.projection B x)=A.projection H x := by + rw [A.projection_apply H (A.projection B x)] + simp only [coordinate_projection] + rw [A.projection_apply H x] + apply Finset.sum_congr rfl + intro i hi + rw [ite_eq_left (hHB hi)] +lemma projection_nested_right (H B : Finset ι) (hHB : H ⊆ B) (x : A.Space) : + A.projection B (A.projection H x)=A.projection H x := by + rw [A.projection_commutes B H] + exact A.projection_nested H B hHB x +end CoordinateCompletion.Data + +namespace RecursiveModel +instance : PartialOrder ForestHead := inferInstanceAs (PartialOrder {H : Finset ForestCoord // ∀ i ∈ H,forestAncestors i ⊆ H}) +lemma head_upper (H K : ForestHead) : ∃ B : ForestHead,H ≤ B ∧ K ≤ B := by + let B : ForestHead := ⟨H.val ∪ K.val,by + intro i hi j hj + rcases Finset.mem_union.mp hi with hi|hi + · exact Finset.mem_union_left _ (H.property i hi hj) + · exact Finset.mem_union_right _ (K.property i hi hj)⟩ + exact ⟨B,Finset.subset_union_left,Finset.subset_union_right⟩ +lemma head_nonempty : Nonempty ForestHead := ⟨forestHead ∅⟩ +end RecursiveModel + +namespace PathModel +open RecursiveModel +lemma linear_forest_cut (v : ForestVec) (H : ForestHead) : + linearForestSeminorm (v.filter (· ∈ H.val)) ≤ linearForestSeminorm v := by + apply aggregate_mono 2 + · exact outerValues_nonneg _ _ + · intro h + rw [outerValues_apply,outerValues_apply] + change cost 1 (h+1) (finiteEmbedding _ (components (v.filter (· ∈ H.val)) h)) ≤ + cost 1 (h+1) (finiteEmbedding _ (components v h)) + have he : finiteEmbedding (h+1) (components (v.filter (· ∈ H.val)) h)= + LpCut.continuous (fun i : Coord (h+1) => (⟨h,i⟩ : ForestCoord) ∈ H.val) + (finiteEmbedding (h+1) (components v h)) := by + ext i + change (v.filter (· ∈ H.val)) ⟨h,i⟩=if (⟨h,i⟩ : ForestCoord) ∈ H.val then v ⟨h,i⟩ else 0 + exact Finsupp.filter_apply _ _ _ + rw [he] + apply linear_cost_cut + intro a b hb hab + exact H.property ⟨h,b⟩ hb (Finset.mem_image.mpr ⟨a,hab,rfl⟩) +lemma linear_projection_contractive (H : ForestHead) (x : linearData.Space) : + ‖linearData.projection H.val x‖ ≤ ‖x‖ := by + rcases H with ⟨H,hH⟩ + induction x using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) continuous_norm + | ih v => + change ‖linearData.projection H (linearData.embedding (linearData.array v))‖ ≤ ‖linearData.embedding (linearData.array v)‖ + rw [linearData.projection_embedding,linearData.norm_embedding,linearData.norm_embedding] + convert linear_forest_cut (linearData.array v) ⟨H,hH⟩ using 1 <;> congr 1 + ext i + simp only [Finsupp.filter_apply] + by_cases hi : i ∈ H <;> simp only [hi,ite_eq_left] +end PathModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Incomparable.lean b/lean/OAI/Analysis/DiamondDistortion/Incomparable.lean new file mode 100644 index 0000000000000000000000000000000000000000..b53467a9dbd3abc4ead10bfc6b0f07097e0b8ef2 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Incomparable.lean @@ -0,0 +1,214 @@ +import OAI.Analysis.DiamondDistortion.CoordinateDual + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace IncomparableModel +open Forest +/-- Every node of one admissible segment is incomparable with every node of + another. This is strictly more restrictive than disjointness. -/ +def Incomparable (F : forestSegments.Family) : Prop := + Pairwise (fun i j => ∀ u ∈ F.seg i,∀ v ∈ F.seg j, + ¬ ForestAncestor u v ∧ ¬ ForestAncestor v u) +def Family := {F : forestSegments.Family // Incomparable F} +instance : Nonempty Family := ⟨⟨{ + n := 0 + seg := Fin.elim0 + allowed := fun i => Fin.elim0 i + disjoint := by intro i; exact Fin.elim0 i },by intro i; exact Fin.elim0 i⟩⟩ +lemma families_bddAbove : BddAbove (Set.range (fun F : Family => F.val.seminorm)) := by + rw [Seminorm.bddAbove_range_iff] + intro p + exact ⟨forestSegments.primalSeminorm p,by rintro _ ⟨F,rfl⟩; exact forestSegments.test_le_primal F.val p⟩ +/-- The exact incomparable-segment primal norm, not its disjoint-segment analogue. -/ +def primalSeminorm : Seminorm ℝ (ForestNode →₀ ℝ) := ⨆ F : Family,F.val.seminorm +lemma test_le_primal (F : Family) (p : ForestNode →₀ ℝ) : ‖F.val.test p‖ ≤ primalSeminorm p := by + rw [primalSeminorm,Seminorm.iSup_apply families_bddAbove] + exact le_ciSup (⟨forestSegments.primalSeminorm p,by + rintro _ ⟨G,rfl⟩; exact forestSegments.test_le_primal G.val p⟩ : + BddAbove (Set.range (fun G : Family => G.val.seminorm p))) F +lemma primal_le_disjoint (p : ForestNode →₀ ℝ) : primalSeminorm p ≤ forestSegments.primalSeminorm p := by + rw [primalSeminorm,Seminorm.iSup_apply families_bddAbove] + exact ciSup_le (fun F => forestSegments.test_le_primal F.val p) +def singletonFamily (i : ForestNode) : Family := + ⟨forestSegments.singletonFamily i,by + intro j k h + have he : j=k := @Subsingleton.elim (Fin 1) inferInstance j k + exact False.elim (h he)⟩ +lemma coordinate_le_primal (p : ForestNode →₀ ℝ) (i : ForestNode) : |p i| ≤ primalSeminorm p := by + have hh := test_le_primal (singletonFamily i) p + rw [EuclideanSpace.norm_eq] at hh + change Real.sqrt (∑ _ : Fin 1,‖∑ j ∈ ({i} : Finset ForestNode),p j‖^2) ≤ _ at hh + simpa [Real.sqrt_sq_eq_abs] using hh + +def primalData : CoordinateCompletion.Data ForestNode where + seminorm := primalSeminorm + coordinate_bound i := ⟨1,fun p => by simpa only [one_mul] using coordinate_le_primal p i⟩ +abbrev PrimalSpace := primalData.Space +/-- The full Banach dual of the incomparable-segment primal completion. -/ +abbrev Space := StrongDual ℝ PrimalSpace + +lemma family_energy (F : Family) (p : ForestNode →₀ ℝ) : + (∑ i,(∑ j ∈ F.val.seg i,p j)^2) ≤ (primalSeminorm p)^2 := by + have hh := (sq_le_sq₀ (norm_nonneg _) (apply_nonneg _ _)).mpr (test_le_primal F p) + rw [EuclideanSpace.norm_sq_eq] at hh + simpa only [SegmentSystem.Family.test_apply,Real.norm_eq_abs,sq_abs] using hh +lemma primal_sq_le (p : ForestNode →₀ ℝ) {M : ℝ} (hM : 0 ≤ M) + (hF : ∀ F : Family,(∑ i,(∑ j ∈ F.val.seg i,p j)^2) ≤ M) : + (primalSeminorm p)^2 ≤ M := by + have hb : primalSeminorm p ≤ Real.sqrt M := by + rw [primalSeminorm,Seminorm.iSup_apply families_bddAbove] + apply ciSup_le + intro F + have hh := hF F + have he : ‖F.val.test p‖^2=(∑ i,(∑ j ∈ F.val.seg i,p j)^2) := by + rw [EuclideanSpace.norm_sq_eq] + simp only [SegmentSystem.Family.test_apply,Real.norm_eq_abs,sq_abs] + rw [← he,← Real.sq_sqrt hM] at hh + exact (sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mp hh + have hh := (sq_le_sq₀ (apply_nonneg _ _) (Real.sqrt_nonneg _)).mpr hb + rwa [Real.sq_sqrt hM] at hh + +def familyOfFintype {κ : Type*} [Fintype κ] (S : κ → Finset ForestNode) + (hS : ∀ i,forestSegments.IsSegment (S i)) + (hi : Pairwise (fun i j => ∀ u ∈ S i,∀ v ∈ S j,¬ ForestAncestor u v ∧ ¬ ForestAncestor v u)) : Family := by + have hd : Pairwise (fun i j => Disjoint (S i) (S j)) := by + intro i j hij + apply Finset.disjoint_left.mpr + intro v hv hw + exact (hi hij v hv v hw).1 ⟨rfl,List.prefix_refl _⟩ + refine ⟨forestSegments.familyOfFintype S hS hd,?_⟩ + intro i j hij + exact hi (fun he => hij ((Fintype.equivFin κ).symm.injective he)) +lemma test_energy {κ : Type*} [Fintype κ] (S : κ → Finset ForestNode) + (hS : ∀ i,forestSegments.IsSegment (S i)) + (hi : Pairwise (fun i j => ∀ u ∈ S i,∀ v ∈ S j,¬ ForestAncestor u v ∧ ¬ ForestAncestor v u)) + (p : ForestNode →₀ ℝ) : (∑ i,(∑ j ∈ S i,p j)^2) ≤ (primalSeminorm p)^2 := by + have hh := family_energy (familyOfFintype S hS hi) p + change (∑ i : Fin (Fintype.card κ),(∑ j ∈ S ((Fintype.equivFin κ).symm i),p j)^2) ≤ _ at hh + rwa [(Fintype.equivFin κ).symm.sum_comp (fun i : κ => (∑ j ∈ S i,p j)^2)] at hh + +lemma block_square (p q : ForestNode →₀ ℝ) + (hd : Disjoint (p.support.image component) (q.support.image component)) : + (primalSeminorm (p+q))^2 ≤ (primalSeminorm p)^2+(primalSeminorm q)^2 := by + apply primal_sq_le _ (by positivity) + intro F + have hz (i : Fin F.val.n) : (∑ v ∈ F.val.seg i,p v)*(∑ v ∈ F.val.seg i,q v)=0 := by + by_cases hp : (∑ v ∈ F.val.seg i,p v)=0 + · rw [hp,zero_mul] + by_cases hq : (∑ v ∈ F.val.seg i,q v)=0 + · rw [hq,mul_zero] + obtain ⟨u,hu,hpu⟩ := Finset.exists_ne_zero_of_sum_ne_zero hp + obtain ⟨v,hv,hqv⟩ := Finset.exists_ne_zero_of_sum_ne_zero hq + have he := same_component _ (F.val.allowed i) u hu v hv + exact False.elim (Finset.disjoint_left.mp hd + (Finset.mem_image.mpr ⟨u,Finsupp.mem_support_iff.mpr hpu,rfl⟩) + (Finset.mem_image.mpr ⟨v,Finsupp.mem_support_iff.mpr hqv,he.symm⟩)) + have he (i : Fin F.val.n) : (∑ v ∈ F.val.seg i,(p+q) v)^2= + (∑ v ∈ F.val.seg i,p v)^2+(∑ v ∈ F.val.seg i,q v)^2 := by + simp only [Finsupp.add_apply,Finset.sum_add_distrib] + nlinarith [hz i] + simp_rw [he] + rw [Finset.sum_add_distrib] + exact add_le_add (family_energy F p) (family_energy F q) + +lemma block_filter (p : ForestNode →₀ ℝ) (C : Set ℕ) : + primalSeminorm (p.filter (fun i => component i ∈ C)) ≤ primalSeminorm p := by + apply (sq_le_sq₀ (apply_nonneg _ _) (apply_nonneg _ _)).mp + apply primal_sq_le _ (sq_nonneg _) + intro F + apply le_trans _ (family_energy F p) + apply Finset.sum_le_sum + intro i _ + by_cases hc : ∃ u ∈ F.val.seg i,component u ∈ C + · obtain ⟨u,hu,hcu⟩ := hc + have he : (∑ v ∈ F.val.seg i,(p.filter (fun j => component j ∈ C)) v)=∑ v ∈ F.val.seg i,p v := by + apply Finset.sum_congr rfl + intro v hv + rw [Finsupp.filter_apply,ite_eq_left] + rwa [← same_component _ (F.val.allowed i) u hu v hv] + rw [he] + · have he : (∑ v ∈ F.val.seg i,(p.filter (fun j => component j ∈ C)) v)=0 := by + apply Finset.sum_eq_zero + intro v hv + rw [Finsupp.filter_apply,ite_eq_right (fun hh => hc ⟨v,hv,hh⟩)] + rw [he,zero_pow (by decide : 2 ≠ 0)] + positivity + +lemma singleton_test (j : ℕ) (p : ForestNode →₀ ℝ) : + (∑ v ∈ p.support.filter (fun v => v.val.2.length=j),p v^2) ≤ (primalSeminorm p)^2 := by + let S := p.support.filter (fun v => v.val.2.length=j) + have hh := test_energy (fun v : S => ({v.val} : Finset ForestNode)) + (fun v => forestSegments.singleton v.val) (by + intro u v huv a ha b hb + simp only [Finset.mem_singleton] at ha hb + subst a + subst b + have hu : u.val.val.2.length=j := (Finset.mem_filter.mp u.property).2 + have hv : v.val.val.2.length=j := (Finset.mem_filter.mp v.property).2 + constructor + · intro hab + have he : u.val=v.val := Subtype.ext (Prod.ext hab.1 (hab.2.eq_of_length (hu.trans hv.symm))) + exact huv (Subtype.ext he) + · intro hab + have he : v.val=u.val := Subtype.ext (Prod.ext hab.1 (hab.2.eq_of_length (hv.trans hu.symm))) + exact huv (Subtype.ext he.symm)) p + simp only [Finset.sum_singleton] at hh + have he := Finset.sum_coe_sort S (fun v => p v^2) + rw [he] at hh + exact hh + +lemma local_lower (C : Finset ℕ) (p : ForestNode →₀ ℝ) + (hp : ∀ v ∈ p.support,component v ∈ C) : + (∑ v ∈ p.support,p v^2) ≤ (((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1)*(primalSeminorm p)^2 := by + have hm : ∀ v ∈ p.support,v.val.2.length ∈ Finset.range (C.sup (id : ℕ → ℕ)+1) := by + intro v hv + exact Finset.mem_range.mpr (Nat.lt_succ_of_le + (v.property.2.trans (Finset.le_sup (f := id) (hp v hv)))) + rw [← Finset.sum_fiberwise_of_maps_to hm (fun v => p v^2)] + calc + _ ≤ ∑ _j ∈ Finset.range (C.sup (id : ℕ → ℕ)+1),(primalSeminorm p)^2 := + Finset.sum_le_sum (fun j _ => singleton_test j p) + _ = _ := by simp only [Finset.sum_const,Finset.card_range,nsmul_eq_mul,Nat.cast_add,Nat.cast_one] + +lemma blocks : primalData.HilbertBlocks component where + orthogonal p q hd := block_square p q (by + simpa only [Finset.disjoint_left,Finset.mem_image] using hd) + contractive := block_filter + upper C := ⟨((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1,by positivity,fun p hp => + ((sq_le_sq₀ (apply_nonneg _ _) (apply_nonneg _ _)).mpr (primal_le_disjoint p)).trans + (primal_sq_bounded_components C p hp)⟩ + lower C := ⟨((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+1,by positivity,fun p hp => local_lower C p hp⟩ + +def Head := {H : Finset ForestNode // Ancestry.Ancestral (A := forestAncestry) (H : Set ForestNode)} + +def heads : Midpoint.Heads Head Space where + projection H := primalData.dualProjection H.val + idempotent H := primalData.dualProjection_idempotent H.val + finite H := primalData.dualProjection_finite H.val + approximation x η hη := by + obtain ⟨v,hv⟩ := primalData.dual_approximation component blocks x hη + obtain ⟨H,hH,hanc⟩ := forest_finite_heads v.support + exact ⟨⟨H,hanc⟩,primalData.dualEmbedding v,primalData.dualProjection_fixed v hH,hv⟩ + +theorem graph (hinput : heads.RadialInput PathApplications.incomparableK) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → Space) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-(D⁻¹/PathApplications.incomparableK)^2)^k := + PathApplications.incomparable_segments heads hinput k f hf + +end IncomparableModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/InfimalCost.lean b/lean/OAI/Analysis/DiamondDistortion/InfimalCost.lean new file mode 100644 index 0000000000000000000000000000000000000000..2ecc503cbdb23770cb87c2ea05332b8fd8768a79 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/InfimalCost.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.DiamondDistortion.Vanishing + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace InfimalCost +variable {E F : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] + [AddCommGroup F] [Module ℝ F] + +/-- Quotient construction of the exact infimum over all linear representations. + No infimum or supremum is assumed to be attained. -/ +structure Presentation (E F : Type*) [SeminormedAddCommGroup E] [NormedSpace ℝ E] + [AddCommGroup F] [Module ℝ F] where + output : E →ₗ[ℝ] F + sectionMap : F →ₗ[ℝ] E + right_inverse : ∀ v,output (sectionMap v)=v +namespace Presentation +variable (A : Presentation E F) +def seminorm : Seminorm ℝ F := + (normSeminorm ℝ (E ⧸ LinearMap.ker A.output)).comp ((LinearMap.ker A.output).mkQ.comp A.sectionMap) +lemma representation_eq {d : E} {v : F} (hd : A.output d=v) : + (LinearMap.ker A.output).mkQ d=(LinearMap.ker A.output).mkQ (A.sectionMap v) := by + change (Submodule.Quotient.mk d : E ⧸ LinearMap.ker A.output)=Submodule.Quotient.mk (A.sectionMap v) + rw [Submodule.Quotient.eq] + change A.output (d-A.sectionMap v)=0 + rw [map_sub,hd,A.right_inverse,sub_self] +lemma le_representation {d : E} {v : F} (hd : A.output d=v) : A.seminorm v ≤ ‖d‖ := by + change ‖(LinearMap.ker A.output).mkQ (A.sectionMap v)‖ ≤ ‖d‖ + rw [← A.representation_eq hd] + exact Submodule.Quotient.norm_mk_le _ d +lemma near_representation (v : F) {ε : ℝ} (hε : 0 < ε) : + ∃ d : E,A.output d=v ∧ ‖d‖ < A.seminorm v+ε := by + obtain ⟨d,hd,hb⟩ := Submodule.Quotient.norm_mk_lt + ((LinearMap.ker A.output).mkQ (A.sectionMap v)) hε + refine ⟨d,?_,hb⟩ + have hh : d-A.sectionMap v ∈ LinearMap.ker A.output := (Submodule.Quotient.eq _).mp hd + change A.output (d-A.sectionMap v)=0 at hh + rw [map_sub,A.right_inverse,sub_eq_zero] at hh + exact hh +lemma eq_sInf (v : F) : A.seminorm v=sInf {r : ℝ | ∃ d : E,A.output d=v ∧ ‖d‖=r} := by + let costs := {r : ℝ | ∃ d : E,A.output d=v ∧ ‖d‖=r} + have hn : costs.Nonempty := ⟨‖A.sectionMap v‖,A.sectionMap v,A.right_inverse v,rfl⟩ + have hb : BddBelow costs := ⟨0,by rintro r ⟨d,hd,rfl⟩; exact norm_nonneg d⟩ + apply le_antisymm + · exact le_csInf hn (by rintro r ⟨d,hd,rfl⟩; exact A.le_representation hd) + · apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨d,hd,hh⟩ := A.near_representation v hε + exact (csInf_le hb ⟨d,hd,rfl⟩).trans hh.le +lemma bound (v : F) {C b : ℝ} (hC : 0 ≤ C) (hb : ∀ d : E,A.output d=v → b ≤ C*‖d‖) : + b ≤ C*A.seminorm v := by + by_cases hC0 : C=0 + · simpa only [hC0,zero_mul] using hb (A.sectionMap v) (A.right_inverse v) + have hCpos : 0 < C := lt_of_le_of_ne hC (Ne.symm hC0) + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨d,hd,hh⟩ := A.near_representation v (div_pos hε hCpos) + have he := (hb d hd).trans (mul_le_mul_of_nonneg_left hh.le hC) + calc + _ ≤ C*(A.seminorm v+ε/C) := he + _ = C*A.seminorm v+ε := by field_simp +end Presentation +end InfimalCost + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/IntrinsicTail.lean b/lean/OAI/Analysis/DiamondDistortion/IntrinsicTail.lean new file mode 100644 index 0000000000000000000000000000000000000000..68c6278f107d4985366b72a916fdee6d91d5987e --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/IntrinsicTail.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.DiamondDistortion.FullDual + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +open scoped Classical +open Filter Topology + +namespace Ancestry +variable {ι : Type*} [A : Ancestry ι] + +lemma intrinsic_tail + (hfin : ∀ S : Finset ι, ∃ K : Finset ι, S ⊆ K ∧ A.Ancestral (K : Set ι)) + {H : Finset ι} (hH : A.Ancestral (H : Set ι)) {R : ℝ} + {x y : A.segments.Dual} (hx : A.segments.headDual H x=x) + (hplus : ‖x+y‖ ≤ R) (hminus : ‖x-y‖ ≤ R) : + ‖A.segments.tailDual H y‖ ≤ 2*Real.sqrt (R^2-‖x‖^2) := by + have hs := A.intrinsic_tail_sq hfin hH ((norm_nonneg _).trans hplus) + (fun v hv => by + have h := congrArg (fun z : A.segments.Dual => z (A.segments.unitVector v)) hx + rw [A.segments.headDual_unit,ite_eq_right hv] at h + exact h.symm) hplus hminus + have hd : 0 ≤ R^2-‖x‖^2 := by nlinarith [sq_nonneg ‖A.segments.tailDual H y‖] + apply (sq_le_sq₀ (norm_nonneg _) (by positivity : 0 ≤ 2*Real.sqrt (R^2-‖x‖^2))).mp + nlinarith [Real.sq_sqrt hd] +end Ancestry + +/-- Exact intrinsic input for the headline, on the whole finite-forest dual. -/ +theorem forest_intrinsic_tail {H : Finset ForestNode} + (hH : Ancestry.Ancestral (A := forestAncestry) (H : Set ForestNode)) {R : ℝ} + {x y : ForestDual} (hx : forestSegments.headDual H x=x) + (hp : ‖x+y‖ ≤ R) (hm : ‖x-y‖ ≤ R) : + ‖forestSegments.tailDual H y‖ ≤ 2*Real.sqrt (R^2-‖x‖^2) := + Ancestry.intrinsic_tail (A := forestAncestry) forest_finite_heads hH hx hp hm + +/-- The intrinsic input for the infinite-height coordinate predual is proved + even in the ambient dual. Only finite-head center approximation in the graph + deduction is restricted to the closed coordinate span. -/ +theorem infinite_intrinsic_tail {H : Finset (List ℕ)} + (hH : Ancestry.Ancestral (A := infiniteAncestry) (H : Set (List ℕ))) {R : ℝ} + {x y : infiniteSegments.Dual} (hx : infiniteSegments.headDual H x=x) + (hp : ‖x+y‖ ≤ R) (hm : ‖x-y‖ ≤ R) : + ‖infiniteSegments.tailDual H y‖ ≤ 2*Real.sqrt (R^2-‖x‖^2) := + Ancestry.intrinsic_tail (A := infiniteAncestry) infinite_finite_heads hH hx hp hm + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/LpDual.lean b/lean/OAI/Analysis/DiamondDistortion/LpDual.lean new file mode 100644 index 0000000000000000000000000000000000000000..74c1b6c73e1248662b1318663227ed1f31584f77 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/LpDual.lean @@ -0,0 +1,238 @@ +import OAI.Analysis.DiamondDistortion.GraphBounds + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +open scoped ENNReal Classical +open Filter Topology +namespace LpDual +variable {ι : Type*} (E : ι → Type*) [∀ i,NormedAddCommGroup (E i)] [∀ i,NormedSpace ℝ (E i)] + (p : ℝ≥0∞) [Fact (1 ≤ p)] + +def finite : (Π₀ i,E i) →ₗ[ℝ] lp E p where + toFun v := ⟨(fun i => v i),(memℓp_zero (by + classical + have he : {i | v i ≠ 0}=(v.support : Set ι) := by ext i; simp + rw [he] + exact v.support.finite_toSet)).of_exponent_ge bot_le⟩ + map_add' v w := by ext i; rfl + map_smul' c v := by ext i; rfl +@[simp] lemma finite_apply {ι : Type*} (E : ι → Type*) [∀ i,NormedAddCommGroup (E i)] [∀ i,NormedSpace ℝ (E i)] (p : ℝ≥0∞) [Fact (1 ≤ p)] (v : Π₀ i,E i) (i : ι) : finite E p v i=v i := rfl +lemma finite_injective {ι : Type*} (E : ι → Type*) [∀ i,NormedAddCommGroup (E i)] [∀ i,NormedSpace ℝ (E i)] (p : ℝ≥0∞) [Fact (1 ≤ p)] : Function.Injective (finite E p) := by + intro v w he + ext i + exact congrArg (fun x : lp E p => x i) he +lemma finite_norm_add {ι : Type*} (E : ι → Type*) [∀ i,NormedAddCommGroup (E i)] [∀ i,NormedSpace ℝ (E i)] (p : ℝ≥0∞) [Fact (1 ≤ p)] {r : ℝ} (hr : r=p.toReal) (hp : 0 < p.toReal) (v w : Π₀ i,E i) + (hd : Disjoint v.support w.support) : + ‖finite E p (v+w)‖^r=‖finite E p v‖^r+‖finite E p w‖^r := by + classical + subst r + rw [lp.norm_rpow_eq_tsum hp,lp.norm_rpow_eq_tsum hp,lp.norm_rpow_eq_tsum hp, + ← ((finite E p v).property.summable hp).tsum_add ((finite E p w).property.summable hp)] + apply tsum_congr + intro i + simp only [finite_apply,DFinsupp.add_apply] + have hz : v i=0 ∨ w i=0 := by + by_cases h : v i=0 + · exact Or.inl h + · right + by_contra hh + exact (Finset.disjoint_left.mp hd) (DFinsupp.mem_support_iff.mpr h) (DFinsupp.mem_support_iff.mpr hh) + rcases hz with h|h <;> simp [h,Real.zero_rpow hp.ne'] + +lemma small_tail_upper (hp : 1 < p.toReal) (x : StrongDual ℝ (lp E p)) {ε : ℝ} (hε : 0 < ε) : + ∃ C : Finset ι, ∀ v : Π₀ i,E i, (∀ i ∈ v.support,i ∉ C) → + x (finite E p v) ≤ ε*‖finite E p v‖ := by + classical + have hp0 : 0 < p.toReal := lt_trans zero_lt_one hp + by_contra hn + push Not at hn + have hchoose (C : Finset ι) : ∃ q : Π₀ i,E i, + (∀ i ∈ q.support,i ∉ C) ∧ ‖finite E p q‖=1 ∧ ε < x (finite E p q) := by + obtain ⟨v,hout,hval⟩ := hn C + have hvn0 : ‖finite E p v‖ ≠ 0 := by + intro he + have hv0 : v=0 := finite_injective E p (by simpa using norm_eq_zero.mp he) + simp only [hv0,map_zero,norm_zero,mul_zero,lt_self_iff_false] at hval + have hvn : 0 < ‖finite E p v‖ := lt_of_le_of_ne (norm_nonneg _) hvn0.symm + let q := ‖finite E p v‖⁻¹ • v + refine ⟨q, ?_, ?_, ?_⟩ + · intro i hi + exact hout i (DFinsupp.support_smul _ v hi) + · simp only [q,map_smul,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hvn)] + exact inv_mul_cancel₀ hvn0 + · simp only [q,map_smul,smul_eq_mul] + rw [inv_mul_eq_div] + exact (lt_div_iff₀ hvn).mpr hval + have hblocks : ∀ n : ℕ,∃ v : Π₀ i,E i, + ‖finite E p v‖^p.toReal ≤ (n:ℝ) ∧ (n:ℝ)*ε ≤ x (finite E p v) := by + intro n + induction n with + | zero => exact ⟨0,by simp [Real.zero_rpow hp0.ne'],by simp⟩ + | succ n ih => + obtain ⟨v,hvn,hvx⟩ := ih + obtain ⟨q,hqout,hqn,hqx⟩ := hchoose v.support + have hd : Disjoint v.support q.support := by + exact Finset.disjoint_left.mpr (fun i hiv hiq => hqout i hiq hiv) + refine ⟨v+q, ?_, ?_⟩ + · rw [finite_norm_add E p rfl hp0 v q hd,hqn,Real.one_rpow] + push_cast + linarith + · simp only [map_add,Nat.cast_add,Nat.cast_one] + linarith + have ht : Tendsto (fun n : ℕ => (n:ℝ)^(p.toReal-1)) atTop atTop := + (tendsto_rpow_atTop (sub_pos.mpr hp)).comp tendsto_natCast_atTop_atTop + obtain ⟨n,hn,hn0⟩ := ((ht.eventually_gt_atTop (‖x‖^p.toReal/ε^p.toReal)).and + (eventually_gt_atTop (0:ℕ))).exists + have hnR : (0:ℝ) i ∈ C))=∑ i ∈ C,lp.single p i (v i) := by + ext i + rw [finite_apply,DFinsupp.filter_apply] + simp only [lp.coeFn_sum,Finset.sum_apply,lp.single_apply] + by_cases hi : i ∈ C + · rw [ite_eq_left hi] + symm + calc + _ = Pi.single i (v i) i := Finset.sum_eq_single i + (fun j _ hji => Pi.single_eq_of_ne hji.symm _) (fun h => (h hi).elim) + _ = _ := Pi.single_eq_same i (v i) + · rw [ite_eq_right hi] + apply Eq.symm + apply Finset.sum_eq_zero + intro j hj + exact Pi.single_eq_of_ne (ne_of_mem_of_not_mem hj hi).symm _ + +lemma finite_filter_norm (Q : ι → Prop) [DecidablePred Q] (v : Π₀ i,E i) : + ‖finite E p (v.filter Q)‖ ≤ ‖finite E p v‖ := by + apply lp.norm_mono (ne_of_gt (zero_lt_one.trans_le (Fact.out : 1 ≤ p))) + intro i + simp only [finite_apply,DFinsupp.filter_apply] + split_ifs <;> simp + +lemma dual_approximation (hp : 1 < p.toReal) (x : StrongDual ℝ (lp E p)) {ε : ℝ} (hε : 0 < ε) : + ∃ C : Finset ι, ‖x-dualHead E p C x‖ < ε := by + have hptop : p ≠ ⊤ := by intro he; norm_num [he] at hp + obtain ⟨C,hC⟩ := small_tail E p hp x (half_pos hε) + refine ⟨C,?_⟩ + have hb : ‖x-dualHead E p C x‖ ≤ ε/2 := by + apply ContinuousLinearMap.opNorm_le_bound _ (half_pos hε).le + intro v + refine (finite_dense E p hptop).induction_on (p := fun v => + ‖(x-dualHead E p C x) v‖ ≤ (ε/2)*‖v‖) v + (isClosed_le ((x-dualHead E p C x).continuous.norm) (continuous_const.mul continuous_norm)) ?_ + intro w + let wi := w.filter (fun i => i ∈ C) + let wo := w.filter (fun i => i ∉ C) + have hw : wi+wo=w := DFinsupp.filter_add_filter_not _ _ + have hh : dualHead E p C x (finite E p w)=x (finite E p wi) := by + rw [dualHead_apply] + dsimp [wi] + rw [finite_filter,map_sum] + have he : (x-dualHead E p C x) (finite E p w)=x (finite E p wo) := by + change x (finite E p w)-dualHead E p C x (finite E p w)=_ + rw [hh,← hw,map_add,map_add] + ring + have ho : ∀ i ∈ wo.support,i ∉ C := by + intro i hi hci + have hz : wo i=0 := by simp [wo,DFinsupp.filter_apply,hci] + exact (DFinsupp.mem_support_iff.mp hi) hz + rw [he,Real.norm_eq_abs] + exact (hC wo ho).trans (mul_le_mul_of_nonneg_left (finite_filter_norm E p _ w) (half_pos hε).le) + exact hb.trans_lt (half_lt_self hε) + +lemma dual_separable [Countable ι] [∀ i,TopologicalSpace.SeparableSpace (StrongDual ℝ (E i))] + (hp : 1 < p.toReal) : TopologicalSpace.SeparableSpace (StrongDual ℝ (lp E p)) := by + let S : Set (StrongDual ℝ (lp E p)) := ⋃ i,Set.range (dualInclude E p i) + let V := Submodule.span ℝ S + have hd : Dense (V : Set (StrongDual ℝ (lp E p))) := by + intro x + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨C,hC⟩ := dual_approximation E p hp x hε + refine ⟨dualHead E p C x,?_,?_⟩ + · apply Submodule.sum_mem + intro i hi + apply Submodule.subset_span + apply Set.mem_iUnion.mpr + exact ⟨i,_,rfl⟩ + · simpa only [dist_eq_norm] using hC + apply hd.isSeparable_iff.mp + apply TopologicalSpace.IsSeparable.span + exact TopologicalSpace.IsSeparable.iUnion (fun i => + TopologicalSpace.isSeparable_range (dualInclude E p i).continuous) +end LpDual + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Main.lean b/lean/OAI/Analysis/DiamondDistortion/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..88aed6ed3db84b69b1a4f7548bf261e3c6241f98 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Main.lean @@ -0,0 +1 @@ +import OAI.Analysis.DiamondDistortion.IntrinsicTail diff --git a/lean/OAI/Analysis/DiamondDistortion/MidpointHeads.lean b/lean/OAI/Analysis/DiamondDistortion/MidpointHeads.lean new file mode 100644 index 0000000000000000000000000000000000000000..70cd2450af3ea0409d7471b1553d069b6377c55e --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/MidpointHeads.lean @@ -0,0 +1,298 @@ +import OAI.Analysis.DiamondDistortion.Stretch + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Midpoint + +section +variable {X Y ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] + +/-- An actual family of allowed finite-rank coordinate heads. Approximation is + by a vector fixed by a head; no uniform bound on projection norms is imposed. -/ +structure Heads (ι : Type*) (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] where + projection : ι → X →L[ℝ] X + idempotent : ∀ H x,projection H (projection H x)=projection H x + finite : ∀ H,FiniteDimensional ℝ (LinearMap.range (projection H).toLinearMap) + approximation : ∀ (x : X) (η : ℝ),0 < η → + ∃ (H : ι) (p : X),projection H p=p ∧ ‖x-p‖ < η + +/-- Image compactness, with a finite-dimensional target and no assumption that + a supremum over a sequence is attained. -/ +lemma finite_dimensional_pair [FiniteDimensional ℝ Y] (P : X →L[ℝ] Y) + (z : ℕ → X) {R η : ℝ} (hz : ∀ i,‖z i‖ ≤ R) (hη : 0 < η) : + ∃ i j : ℕ,i ≠ j ∧ ‖P ((1/2:ℝ) • (z i-z j))‖ < η := by + have hZ (i : ℕ) : P (z i) ∈ Metric.closedBall (0 : Y) (‖P‖*R) := by + rw [Metric.mem_closedBall,dist_zero_right] + exact (P.le_opNorm _).trans (mul_le_mul_of_nonneg_left (hz i) (norm_nonneg _)) + obtain ⟨a,_,φ,hφ,hconv⟩ := tendsto_subseq_of_bounded Metric.isBounded_closedBall hZ + obtain ⟨N,hN⟩ := Metric.cauchySeq_iff.mp hconv.cauchySeq (2*η) (by positivity) + have hd := hN N le_rfl (N+1) (by omega) + change dist (P (z (φ N))) (P (z (φ (N+1)))) < 2*η at hd + rw [dist_eq_norm] at hd + refine ⟨φ N,φ (N+1),hφ.injective.ne (by omega),?_⟩ + rw [map_smul,norm_smul,map_sub,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + linarith + +lemma finite_rank_pair (P : X →L[ℝ] X) + [FiniteDimensional ℝ (LinearMap.range P.toLinearMap)] + (z : ℕ → X) {R η : ℝ} (hz : ∀ i,‖z i‖ ≤ R) (hη : 0 < η) : + ∃ i j : ℕ,i ≠ j ∧ ‖P ((1/2:ℝ) • (z i-z j))‖ < η := by + let Q : X →L[ℝ] (LinearMap.range P.toLinearMap) := + P.codRestrict _ (fun x => ⟨x,rfl⟩) + exact finite_dimensional_pair Q z hz hη + +lemma average_lens {x : X} (z : ℕ → X) {R : ℝ} + (hp : ∀ i,‖x+z i‖ ≤ R) (hm : ∀ i,‖x-z i‖ ≤ R) (i j : ℕ) : + ‖x+(1/2:ℝ) • (z i-z j)‖ ≤ R ∧ ‖x-(1/2:ℝ) • (z i-z j)‖ ≤ R := by + have he1 : x+(1/2:ℝ) • (z i-z j)=(1/2:ℝ) • ((x+z i)+(x-z j)) := by module + have he2 : x-(1/2:ℝ) • (z i-z j)=(1/2:ℝ) • ((x-z i)+(x+z j)) := by module + constructor + · rw [he1,norm_smul,Real.norm_eq_abs] + norm_num + have h := (norm_add_le (x+z i) (x-z j)).trans (add_le_add (hp i) (hm j)) + linarith + · rw [he2,norm_smul,Real.norm_eq_abs] + norm_num + have h := (norm_add_le (x-z i) (x+z j)).trans (add_le_add (hm i) (hp j)) + linarith + +lemma pair_errors (P : X →L[ℝ] X) + [FiniteDimensional ℝ (LinearMap.range P.toLinearMap)] + {x p : X} (z : ℕ → X) {R ε η : ℝ} (hη : 0 < η) + (hclose : ‖x-p‖ < η) (hp : ∀ i,‖x+z i‖ ≤ R) (hm : ∀ i,‖x-z i‖ ≤ R) + (hs : ∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) : + ∃ i j : ℕ,i ≠ j ∧ + let w := (1/2:ℝ) • (z i-z j) + let y := w-P w + ‖P w‖ < η ∧ ε/2-η ≤ ‖y‖ ∧ ‖x‖-η ≤ ‖p‖ ∧ + ‖p+y‖ ≤ R+2*η ∧ ‖p-y‖ ≤ R+2*η ∧ ‖x+w‖ ≤ R ∧ ‖x-w‖ ≤ R := by + obtain ⟨i,j,hij,hP⟩ := finite_rank_pair P z + (fun i => Diamond.norm_deviation_le (hp i) (hm i)) hη + let w := (1/2:ℝ) • (z i-z j) + have hw : ε/2 ≤ ‖w‖ := by + dsimp [w] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + linarith [hs i j hij] + have hy : ε/2-η ≤ ‖w-P w‖ := by + have h := norm_sub_norm_le w (P w) + linarith + have hpn : ‖x‖-η ≤ ‖p‖ := by linarith [norm_sub_norm_le x p] + obtain ⟨ha,hb⟩ := average_lens z hp hm i j + have hpp : ‖p+(w-P w)‖ ≤ R+2*η := by + have he : p+(w-P w)=(x+w)-(x-p)-P w := by module + rw [he] + have h := (norm_sub_le ((x+w)-(x-p)) (P w)).trans + (add_le_add (norm_sub_le (x+w) (x-p)) le_rfl) + linarith + have hpm : ‖p-(w-P w)‖ ≤ R+2*η := by + have he : p-(w-P w)=(x-w)-(x-p)+P w := by module + rw [he] + have h := (norm_add_le ((x-w)-(x-p)) (P w)).trans + (add_le_add (norm_sub_le (x-w) (x-p)) le_rfl) + linarith + exact ⟨i,j,hij,hP,hy,hpn,hpp,hpm,ha,hb⟩ + +/-- The quotient version chooses an actual nearby subspace vector, not just a + formal quotient with small norm. Closedness and true finite codimension are explicit. -/ +lemma quotient_pair (F : Submodule ℝ X) [IsClosed (F : Set X)] + [FiniteDimensional ℝ (X ⧸ F)] (z : ℕ → X) {R η : ℝ} + (hz : ∀ i,‖z i‖ ≤ R) (hη : 0 < η) : + ∃ (i j : ℕ) (v : X),i ≠ j ∧ v ∈ F ∧ ‖(1/2:ℝ) • (z i-z j)-v‖ < η := by + obtain ⟨i,j,hij,hq⟩ := finite_dimensional_pair F.mkQL z hz (half_pos hη) + let w := (1/2:ℝ) • (z i-z j) + obtain ⟨m,hm,hn⟩ := Submodule.Quotient.norm_mk_lt (F.mkQL w) (half_pos hη) + refine ⟨i,j,w-m,hij,?_,?_⟩ + · apply (Submodule.Quotient.mk_eq_zero F).mp + change F.mkQ (w-m)=0 + rw [map_sub] + change F.mkQL w-Submodule.Quotient.mk m=0 + rw [hm,sub_self] + · rw [sub_sub_cancel] + linarith + +end + +section +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma positive_limit_le (f g : ℝ → ℝ) (hf : ContinuousAt f 0) (hg : ContinuousAt g 0) + (h : ∀ η,0 < η → f η ≤ g η) : f 0 ≤ g 0 := by + have ht : Filter.Tendsto (fun n : ℕ => 1/((n:ℝ)+1)) Filter.atTop (𝓝 0) := + tendsto_one_div_add_atTop_nhds_zero_nat + exact le_of_tendsto_of_tendsto (hf.tendsto.comp ht) (hg.tendsto.comp ht) + (Filter.Eventually.of_forall (fun n => h _ (by positivity))) + +lemma Heads.pure_pair (A : Heads ι X) {x : X} (z : ℕ → X) {R ε η : ℝ} (hη : 0 < η) + (hp : ∀ i,‖x+z i‖ ≤ R) (hm : ∀ i,‖x-z i‖ ≤ R) + (hs : ∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) : + ∃ (H : ι) (p y : X),A.projection H p=p ∧ A.projection H y=0 ∧ + ‖x‖-η ≤ ‖p‖ ∧ ε/2-η ≤ ‖y‖ ∧ ‖p+y‖ ≤ R+2*η ∧ ‖p-y‖ ≤ R+2*η := by + obtain ⟨H,p,hP,hclose⟩ := A.approximation x η hη + let := A.finite H + obtain ⟨i,j,_,hpair⟩ := pair_errors (A.projection H) z hη hclose hp hm hs + refine ⟨H,p,(1/2:ℝ) • (z i-z j)-A.projection H ((1/2:ℝ) • (z i-z j)),hP,?_, + hpair.2.2.1,hpair.2.1,hpair.2.2.2.1,hpair.2.2.2.2.1⟩ + rw [map_sub,A.idempotent,sub_self] + +def Heads.SquareInput (A : Heads ι X) (a : ℝ) : Prop := + ∀ (H : ι) (p y : X) (R : ℝ),A.projection H p=p → A.projection H y=0 → + 0 ≤ R → ‖p+y‖ ≤ R → ‖p-y‖ ≤ R → ‖p‖^2+a*‖y‖^2 ≤ R^2 + +def Heads.RadialInput (A : Heads ι X) (C : ℝ) : Prop := + ∀ (H : ι) (p y : X) (R : ℝ),A.projection H p=p → A.projection H y=0 → + 0 ≤ R → ‖p+y‖ ≤ R → ‖p-y‖ ≤ R → ‖y‖^2 ≤ C^2*R*(R-‖p‖) + +theorem Heads.square_lens (A : Heads ι X) {a : ℝ} (ha : 0 < a) (hinput : A.SquareInput a) : + Diamond.SquareLens X (a/4) := by + intro x z R ε hR hε hp hm hs + have hh := positive_limit_le + (fun η => (max (‖x‖-η) 0)^2+a*(max (ε/2-η) 0)^2) + (fun η => (R+2*η)^2) (by fun_prop) (by fun_prop) (fun η hη => by + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.pure_pair z hη hp hm hs + have h := hinput H p y (R+2*η) hP hY (by positivity) hpR hmR + have hp' : max (‖x‖-η) 0 ≤ ‖p‖ := max_le hpL (norm_nonneg _) + have hy' : max (ε/2-η) 0 ≤ ‖y‖ := max_le hyL (norm_nonneg _) + have hp2 := (sq_le_sq₀ (le_max_right _ _) (norm_nonneg _)).mpr hp' + have hy2 := mul_le_mul_of_nonneg_left + ((sq_le_sq₀ (le_max_right _ _) (norm_nonneg _)).mpr hy') ha.le + linarith) + simp only [sub_zero,mul_zero,add_zero,max_eq_left (norm_nonneg x), + max_eq_left (half_pos hε).le] at hh + nlinarith only [hh] + +theorem Heads.radial_lens (A : Heads ι X) {C : ℝ} (hC : 0 < C) (hinput : A.RadialInput C) : + Diamond.RadialLens X C := by + intro x z R ε hR hε hp hm hs + have hh := positive_limit_le + (fun η => (max (ε/2-η) 0)^2) + (fun η => C^2*(R+2*η)*(R+3*η-‖x‖)) (by fun_prop) (by fun_prop) (fun η hη => by + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.pure_pair z hη hp hm hs + have h := hinput H p y (R+2*η) hP hY (by positivity) hpR hmR + have hy' : max (ε/2-η) 0 ≤ ‖y‖ := max_le hyL (norm_nonneg _) + have hy2 := (sq_le_sq₀ (le_max_right _ _) (norm_nonneg _)).mpr hy' + have hmul := mul_le_mul_of_nonneg_left + (show R+2*η-‖p‖ ≤ R+3*η-‖x‖ by linarith) + (show 0 ≤ C^2*(R+2*η) by positivity) + exact hy2.trans (h.trans hmul)) + simp only [sub_zero,mul_zero,add_zero,max_eq_left (half_pos hε).le] at hh + nlinarith only [hh] + +def Heads.ParametricInput (A : Heads ι X) (a b : ℝ) : Prop := + ∀ (H : ι) (p y : X) (lam : ℝ),A.projection H p=p → A.projection H y=0 → 0 < lam → + (‖p‖+a*lam*‖y‖)/Real.sqrt (1+b*lam^2) ≤ max ‖p+y‖ ‖p-y‖ + +theorem Heads.parametric_lens (A : Heads ι X) {a b lam : ℝ} + (ha : 0 < a) (hb : 0 < b) (hlam : 0 < lam) (hinput : A.ParametricInput a b) + {x : X} (z : ℕ → X) {R ε : ℝ} + (hp : ∀ i,‖x+z i‖ ≤ R) (hm : ∀ i,‖x-z i‖ ≤ R) + (hs : ∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) : + ‖x‖+a*lam*(ε/2) ≤ Real.sqrt (1+b*lam^2)*R := by + let Q := Real.sqrt (1+b*lam^2) + have hQ : 0 < Q := Real.sqrt_pos.mpr (by positivity) + have hh := positive_limit_le (fun _ => ‖x‖+a*lam*(ε/2)) + (fun η => Q*(R+2*η)+(1+a*lam)*η) (by fun_prop) (by fun_prop) (fun η hη => by + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.pure_pair z hη hp hm hs + have h := (hinput H p y lam hP hY hlam).trans (max_le hpR hmR) + have h' : ‖p‖+a*lam*‖y‖ ≤ (R+2*η)*Q := (div_le_iff₀ hQ).mp h + have hs := mul_le_mul_of_nonneg_left hyL (show 0 ≤ a*lam by positivity) + nlinarith only [h',hs,hpL]) + simpa only [mul_zero,add_zero] using hh + +end + +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +def QuotientGain (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] (t g : ℝ) : Prop := + ∀ u : X,‖u‖=1 → ∃ F : Submodule ℝ X,IsClosed (F : Set X) ∧ + FiniteDimensional ℝ (X ⧸ F) ∧ + ∀ y : X,y ∈ F → t ≤ ‖y‖ → 1+g ≤ max ‖u+y‖ ‖u-y‖ + +lemma quotient_parent_full_gain {t g D L : ℝ} (ht : 0 < t) (hg : 0 < g) + (hD : 1 ≤ D) (htD : t ≤ 1/(2*D)) (hX : QuotientGain X t g) + {x : X} (z : ℕ → X) (hx : 1 ≤ ‖x‖) (hxD : ‖x‖ ≤ D) + (hp : ∀ i,‖x+z i‖ ≤ L) (hm : ∀ i,‖x-z i‖ ≤ L) + (hs : ∀ i j,i ≠ j → 2 ≤ ‖z i-z j‖) : ‖x‖ ≤ L/(1+g) := by + let r := ‖x‖ + have hr : 0 < r := by dsimp [r]; linarith + have hunit : ‖r⁻¹ • x‖=1 := by + rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le),inv_mul_cancel₀ hr.ne'] + obtain ⟨F,hclosed,hfinite,hF⟩ := hX (r⁻¹ • x) hunit + let := hclosed + let := hfinite + have hfull : r*(1+g) ≤ L := by + apply le_of_forall_pos_le_add + intro η hη + let δ := min (1/2:ℝ) η + have hδ : 0 < δ := lt_min (by norm_num) hη + obtain ⟨i,j,v,hij,hvF,hclose⟩ := quotient_pair F z + (fun i => Diamond.norm_deviation_le (hp i) (hm i)) hδ + let w := (1/2:ℝ) • (z i-z j) + have hw : 1 ≤ ‖w‖ := by + dsimp [w] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + linarith [hs i j hij] + have hv : (1/2:ℝ) ≤ ‖v‖ := by + have h := norm_sub_norm_le w v + have hδhalf : δ ≤ 1/2 := min_le_left _ _ + linarith + have htr : t*r ≤ 1/2 := by + have htd : t*(2*D) ≤ 1 := (le_div_iff₀ (by linarith : 0 < 2*D)).mp htD + have hmul := mul_le_mul_of_nonneg_left hxD ht.le + change t*r ≤ t*D at hmul + nlinarith + have htv : t ≤ ‖r⁻¹ • v‖ := by + rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + calc + t = r⁻¹*(t*r) := by field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left (htr.trans hv) (inv_nonneg.mpr hr.le) + obtain ⟨hwp,hwm⟩ := average_lens z hp hm i j + have hδη : δ ≤ η := min_le_right _ _ + have hplus : ‖x+v‖ ≤ L+η := by + have he : x+v=(x+w)-(w-v) := by module + rw [he] + exact (norm_sub_le _ _).trans (by linarith) + have hminus : ‖x-v‖ ≤ L+η := by + have he : x-v=(x-w)+(w-v) := by module + rw [he] + exact (norm_add_le _ _).trans (by linarith) + have hgain := hF (r⁻¹ • v) (F.smul_mem _ hvF) htv + have hupper : max ‖r⁻¹ • x+r⁻¹ • v‖ ‖r⁻¹ • x-r⁻¹ • v‖ ≤ r⁻¹*(L+η) := by + apply max_le + · rw [← smul_add,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + exact mul_le_mul_of_nonneg_left hplus (inv_nonneg.mpr hr.le) + · rw [← smul_sub,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + exact mul_le_mul_of_nonneg_left hminus (inv_nonneg.mpr hr.le) + have h := mul_le_mul_of_nonneg_left (hgain.trans hupper) hr.le + rwa [← mul_assoc,mul_inv_cancel₀ hr.ne',one_mul] at h + exact (le_div_iff₀ (by positivity : 0 < 1+g)).mpr hfull + +/-- Approximate actual-child selection: the supremal full gain implies a + strictly larger actual child at the half-gain threshold, never a maximum. -/ +lemma quotient_actual_child {t g D : ℝ} (ht : 0 < t) (hg : 0 < g) + (hD : 1 ≤ D) (htD : t ≤ 1/(2*D)) (hX : QuotientGain X t g) + {x : X} (z : ℕ → X) (hx : 1 ≤ ‖x‖) (hxD : ‖x‖ ≤ D) + (hs : ∀ i j,i ≠ j → 2 ≤ ‖z i-z j‖) : + ∃ i,‖x‖*(1+g/2) < max ‖x+z i‖ ‖x-z i‖ := by + by_contra! hn + have hp : ∀ i,‖x+z i‖ ≤ ‖x‖*(1+g/2) := fun i => (le_max_left _ _).trans (hn i) + have hm : ∀ i,‖x-z i‖ ≤ ‖x‖*(1+g/2) := fun i => (le_max_right _ _).trans (hn i) + have h := quotient_parent_full_gain ht hg hD htD hX z hx hxD hp hm hs + have h' := (le_div_iff₀ (by positivity : 0 < 1+g)).mp h + nlinarith [mul_pos (show 0 < ‖x‖ by linarith) hg] + +end Midpoint + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/ModelMaps.lean b/lean/OAI/Analysis/DiamondDistortion/ModelMaps.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e63cadf94233f0c31fdcafa9291e4ec1b854e49 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/ModelMaps.lean @@ -0,0 +1,346 @@ +import OAI.Analysis.DiamondDistortion.Incomparable + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace RecursiveModel +instance countableCoord (h : ℕ) : Countable (Coord h) := by + induction h with + | zero => exact inferInstanceAs (Countable Unit) + | succ h ih => exact inferInstanceAs (Countable (Unit ⊕ (ℕ × Coord h))) + +lemma aggregate_sq {ι : Type*} (f : ι →₀ ℝ) : + (aggregate 2 f)^2=∑ i ∈ f.support,f i^2 := by + have hh := lp.norm_rpow_eq_tsum (p := 2) (by norm_num) (finiteLp 2 f) + have he : (aggregate 2 f)^2=∑' i,f i^2 := by + simpa only [aggregate,ENNReal.toReal_ofNat,Real.rpow_two,finiteLp_apply,Real.norm_eq_abs,sq_abs] using hh + rw [he] + exact tsum_eq_sum (fun i hi => by rw [Finsupp.notMem_support_iff.mp hi]; norm_num) + +lemma components_zero (p : ForestVec) (h : ℕ) (hh : h ∉ p.support.image Sigma.fst) : + components p h=0 := by + ext i + change p ⟨h,i⟩=0 + apply Finsupp.notMem_support_iff.mp + intro hi + exact hh (Finset.mem_image.mpr ⟨⟨h,i⟩,hi,rfl⟩) + +lemma outer_support (s : ∀ h,Seminorm ℝ (Vec (h+1))) (p : ForestVec) : + (outerValues s p).support ⊆ p.support.image Sigma.fst := by + intro h hh + by_contra hn + have he : outerValues s p h=0 := by rw [outerValues_apply,components_zero p h hn,map_zero] + exact (Finsupp.mem_support_iff.mp hh) he + +lemma outer_sq (s : ∀ h,Seminorm ℝ (Vec (h+1))) (p : ForestVec) (C : Finset ℕ) + (hC : p.support.image Sigma.fst ⊆ C) : + (outerSeminorm s p)^2=∑ h ∈ C,(s h (components p h))^2 := by + change (aggregate 2 (outerValues s p))^2=_ + rw [aggregate_sq] + apply Finset.sum_subset ((outer_support s p).trans hC) + intro h _ hh + rw [Finsupp.notMem_support_iff.mp hh] + norm_num + +lemma components_filter (p : ForestVec) (C : Set ℕ) (h : ℕ) : + components (p.filter (fun i => i.1 ∈ C)) h=if h ∈ C then components p h else 0 := by + ext i + by_cases hh : h ∈ C + · rw [ite_eq_left hh] + change (p.filter (fun i => i.1 ∈ C)) ⟨h,i⟩=p ⟨h,i⟩ + rw [Finsupp.filter_apply,ite_eq_left hh] + · rw [ite_eq_right hh] + change (p.filter (fun i => i.1 ∈ C)) ⟨h,i⟩=0 + rw [Finsupp.filter_apply,ite_eq_right hh] + +lemma outer_contractive (s : ∀ h,Seminorm ℝ (Vec (h+1))) (p : ForestVec) (C : Set ℕ) : + outerSeminorm s (p.filter (fun i => i.1 ∈ C)) ≤ outerSeminorm s p := by + apply aggregate_mono 2 + · exact outerValues_nonneg s _ + · intro h + rw [outerValues_apply,outerValues_apply,components_filter] + split_ifs + · exact le_rfl + · rw [map_zero]; exact apply_nonneg _ _ + +lemma outer_orthogonal (s : ∀ h,Seminorm ℝ (Vec (h+1))) (p q : ForestVec) + (hd : Disjoint (p.support.image Sigma.fst) (q.support.image Sigma.fst)) : + (outerSeminorm s (p+q))^2 ≤ (outerSeminorm s p)^2+(outerSeminorm s q)^2 := by + let C := p.support.image Sigma.fst ∪ q.support.image Sigma.fst + have hp : p.support.image Sigma.fst ⊆ C := Finset.subset_union_left + have hq : q.support.image Sigma.fst ⊆ C := Finset.subset_union_right + have hpq : (p+q).support.image Sigma.fst ⊆ C := by + intro h hh + obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp hh + rcases Finset.mem_union.mp (Finsupp.support_add hi) with hi | hi + · exact hp (Finset.mem_image.mpr ⟨i,hi,rfl⟩) + · exact hq (Finset.mem_image.mpr ⟨i,hi,rfl⟩) + rw [outer_sq s p C hp,outer_sq s q C hq,outer_sq s (p+q) C hpq,← Finset.sum_add_distrib] + apply le_of_eq + apply Finset.sum_congr rfl + intro h _ + rw [map_add,DFinsupp.add_apply] + by_cases hh : h ∈ p.support.image Sigma.fst + · have hhq := Finset.disjoint_left.mp hd hh + rw [components_zero q h hhq,add_zero,map_zero,zero_pow (by decide : 2 ≠ 0),add_zero] + · rw [components_zero p h hh,zero_add,map_zero,zero_pow (by decide : 2 ≠ 0),zero_add] + +lemma energy_components (p : ForestVec) (C : Finset ℕ) (hC : p.support.image Sigma.fst ⊆ C) : + (∑ i ∈ p.support,p i^2)=∑ h ∈ C,∑ i ∈ (components p h).support,(components p h i)^2 := by + have he (h : ℕ) : p.split h=components p h := by ext i; rw [Finsupp.split_apply]; rfl + have hh := p.sigma_sum (fun _ a => a^2) + simp only [Finsupp.sum,he] at hh + rw [hh] + have hes : p.splitSupport=p.support.image Sigma.fst := by + ext h + simp only [Finsupp.splitSupport,Finset.mem_image] + rw [hes] + apply Finset.sum_subset hC + intro h _ hh + have hzero := components_zero p h hh + rw [hzero,Finsupp.support_zero,Finset.sum_empty] + +end RecursiveModel + +namespace PathModel +open RecursiveModel +lemma path_norm (h : ℕ) (μ : L1 h) : ‖path h μ‖ ≤ (h+1:ℝ)*‖μ‖ := by + have hb : ‖path h‖ ≤ (h+1:ℝ) := + LinearMap.mkContinuous_norm_le _ (by positivity : (0:ℝ) ≤ h+1) _ + exact ((path h).le_opNorm μ).trans (mul_le_mul_of_nonneg_right hb (norm_nonneg _)) + +lemma linear_l2 (h : ℕ) (v : L2 h) : ‖v‖ ≤ (h+1:ℝ)*cost 1 h v := by + apply (presentation 1 h).bound v (by positivity : (0:ℝ) ≤ h+1) + intro d hd + change d.fst+path h d.snd=v at hd + rw [← hd,WithLp.prod_norm_eq_of_L1] + have hb := (norm_add_le d.fst (path h d.snd)).trans (add_le_add le_rfl (path_norm h d.snd)) + have hhn : 1 ≤ (h+1:ℝ) := by linarith [Nat.cast_nonneg (α := ℝ) h] + have hn := norm_nonneg d.fst + nlinarith + +lemma finite_l2_sq (h : ℕ) (v : Vec h) : + ‖finiteEmbedding h v‖^2=∑ i ∈ v.support,v i^2 := aggregate_sq v + +lemma linear_upper (p : ForestVec) : + (linearForestSeminorm p)^2 ≤ ∑ i ∈ p.support,p i^2 := by + let C := p.support.image Sigma.fst + rw [energy_components p C (by rfl)] + change (outerSeminorm (fun h => finiteCost 1 (h+1)) p)^2 ≤ _ + rw [outer_sq _ p C (by rfl)] + apply Finset.sum_le_sum + intro h _ + rw [← finite_l2_sq] + exact (sq_le_sq₀ (apply_nonneg _ _) (norm_nonneg _)).mpr (linear_le_norm (h+1) _) + +lemma linear_lower (C : Finset ℕ) (p : ForestVec) + (hp : ∀ i ∈ p.support,i.1 ∈ C) : + (∑ i ∈ p.support,p i^2) ≤ (((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+2)^2*(linearForestSeminorm p)^2 := by + have hC : p.support.image Sigma.fst ⊆ C := by + rintro _ hh + obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp hh + exact hp i hi + rw [energy_components p C hC] + change _ ≤ _*(outerSeminorm (fun h => finiteCost 1 (h+1)) p)^2 + rw [outer_sq _ p C hC,Finset.mul_sum] + apply Finset.sum_le_sum + intro h hh + rw [← finite_l2_sq] + have hb := linear_l2 (h+1) (finiteEmbedding _ (components p h)) + have hm : ((h+1:ℕ):ℝ)+1 ≤ ((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+2 := by + have he : (h:ℝ) ≤ ((C.sup (id : ℕ → ℕ) : ℕ) : ℝ) := by exact_mod_cast Finset.le_sup (f := id) hh + push_cast + linarith + have hpos : 0 ≤ cost 1 (h+1) (finiteEmbedding _ (components p h)) := apply_nonneg _ _ + have hb' := hb.trans (mul_le_mul_of_nonneg_right hm hpos) + have hs := (sq_le_sq₀ (norm_nonneg _) (by positivity)).mpr hb' + simpa only [mul_pow,finiteCost,Seminorm.comp_apply] using hs + +lemma linearBlocks : linearData.HilbertBlocks Sigma.fst where + orthogonal p q hd := outer_orthogonal _ p q (by + simpa only [Finset.disjoint_left,Finset.mem_image] using hd) + contractive := outer_contractive _ + upper C := ⟨1,by norm_num,fun p _ => by simpa only [linearData,one_mul] using linear_upper p⟩ + lower C := ⟨(((C.sup (id : ℕ → ℕ) : ℕ) : ℝ)+2)^2,by positivity, + fun p hp => linear_lower C p hp⟩ +instance linearDualSeparable : TopologicalSpace.SeparableSpace (StrongDual ℝ LinearSpace) := + linearData.dual_separable Sigma.fst linearBlocks +/-- The original weak-sequence input on the concrete linear path-cost space. -/ +theorem linear_weak_graph (hinput : PathApplications.WeakInput LinearSpace) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/64 ≤ D^2 := PathApplications.weak_linear hinput k f hf +end PathModel + +namespace StartModel +open RecursiveModel PathModel +namespace ContractiveMap +variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] + +def lift (f : E →ₗ[ℝ] F) (hf : ∀ x,‖f x‖ ≤ ‖x‖) : + lp (fun _ : ℕ => E) 2 →ₗ[ℝ] lp (fun _ : ℕ => F) 2 where + toFun v := ⟨fun i => f (v i),v.property.mono' (fun i => hf (v i))⟩ + map_add' v w := by ext i; exact f.map_add _ _ + map_smul' c v := by ext i; exact f.map_smul c _ +lemma lift_apply (f : E →ₗ[ℝ] F) (hf : ∀ x,‖f x‖ ≤ ‖x‖) + (v : lp (fun _ : ℕ => E) 2) (i : ℕ) : lift f hf v i=f (v i) := rfl +lemma lift_norm (f : E →ₗ[ℝ] F) (hf : ∀ x,‖f x‖ ≤ ‖x‖) + (v : lp (fun _ : ℕ => E) 2) : ‖lift f hf v‖ ≤ ‖v‖ := + lp.norm_mono (by norm_num) (fun i => hf (v i)) + +variable {G H : Type*} [NormedAddCommGroup G] [NormedSpace ℝ G] + [NormedAddCommGroup H] [NormedSpace ℝ H] +def prod₁ (f : E →ₗ[ℝ] F) (g : G →ₗ[ℝ] H) : WithLp 1 (E × G) →ₗ[ℝ] WithLp 1 (F × H) := + (WithLp.linearEquiv 1 ℝ (F × H)).symm.toLinearMap.comp + ((f.prodMap g).comp (WithLp.linearEquiv 1 ℝ (E × G)).toLinearMap) +lemma prod₁_norm (f : E →ₗ[ℝ] F) (g : G →ₗ[ℝ] H) (hf : ∀ x,‖f x‖ ≤ ‖x‖) + (hg : ∀ x,‖g x‖ ≤ ‖x‖) (d : WithLp 1 (E × G)) : ‖prod₁ f g d‖ ≤ ‖d‖ := by + change ‖WithLp.toLp 1 (f d.fst,g d.snd)‖ ≤ ‖d‖ + rw [WithLp.prod_norm_eq_of_L1,WithLp.prod_norm_eq_of_L1] + exact add_le_add (hf d.fst) (hg d.snd) +def single (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] : + {f : E →ₗ[ℝ] lp (fun _ : ℕ => E) 1 // ∀ d,‖f d‖ ≤ ‖d‖} := + ⟨lp.lsingle (𝕜 := ℝ) (E := fun _ : ℕ => E) 1 0,fun d => by + change ‖(lp.single 1 0 d : lp (fun _ : ℕ => E) 1)‖ ≤ ‖d‖ + exact (lp.norm_single (E := fun _ : ℕ => E) (p := 1) (by norm_num) 0 d).le⟩ +end ContractiveMap + +/-- Repetition labels are retained: each start node admits a countable sequence + of signed coefficient arrays over all its possible endpoints. Its mass is + the ℓ¹ sum of the ℓ¹ norms of these arrays, before any cancellation. -/ +abbrev rawRepresentationModel : ℕ → RealNormed + | 0 => ⟨lp (fun _ : ℕ => ℝ) 1⟩ + | h+1 => ⟨WithLp 1 (lp (fun _ : ℕ => L1 (h+1)) 1 × + lp (fun _ : ℕ => rawRepresentationModel h) 2)⟩ +abbrev Raw (h : ℕ) := rawRepresentationModel h + +/-- Group repetitions at every start/end pair. Triangle inequalities make this + operation contractive, rather than an unjustified equality of costs. -/ +def compression : (h : ℕ) → {f : Raw h →ₗ[ℝ] Rep h // ∀ d,‖f d‖ ≤ ‖d‖} + | 0 => ⟨(lp.tsumCLM ℝ ℕ ℝ).toLinearMap,lp.norm_tsum_le⟩ + | h+1 => + let prev := compression h + let rootMap := (lp.tsumCLM ℝ ℕ (L1 (h+1))).toLinearMap + let child := ContractiveMap.lift prev.val prev.property + ⟨ContractiveMap.prod₁ rootMap child, + ContractiveMap.prod₁_norm rootMap child lp.norm_tsum_le + (ContractiveMap.lift_norm prev.val prev.property)⟩ + +/-- A representation with no repetitions is also one of the arbitrary countable + representations, by placing all its coefficients in repetition row zero. -/ +def expansion : (h : ℕ) → {f : Rep h →ₗ[ℝ] Raw h // ∀ d,‖f d‖ ≤ ‖d‖} + | 0 => ContractiveMap.single ℝ + | h+1 => + let prev := expansion h + let rootMap := ContractiveMap.single (L1 (h+1)) + let child := ContractiveMap.lift prev.val prev.property + ⟨ContractiveMap.prod₁ rootMap.val child, + ContractiveMap.prod₁_norm rootMap.val child rootMap.property + (ContractiveMap.lift_norm prev.val prev.property)⟩ + +lemma tsum_single_zero {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] (x : E) : + lp.tsumCLM ℝ ℕ E (lp.single 1 0 x)=x := by + change ∑' i,(lp.single 1 0 x : lp (fun _ : ℕ => E) 1) i=x + rw [tsum_eq_single 0,lp.single_apply_self] + intro i hi + exact lp.single_apply_ne _ _ _ hi + +lemma compression_expansion (h : ℕ) (d : Rep h) : + (compression h).val ((expansion h).val d)=d := by + induction h with + | zero => exact tsum_single_zero d + | succ h ih => + apply WithLp.ofLp_injective + apply Prod.ext + · change lp.tsumCLM ℝ ℕ (L1 (h+1)) (lp.single 1 0 d.fst)=d.fst + exact tsum_single_zero d.fst + · ext i + exact ih (d.snd i) + +/-- Literal coordinatewise output of countably many signed segments: first sum + all rows with a common start/end, then use the absolutely summable path map. -/ +def rawOutput (h : ℕ) : Raw h →ₗ[ℝ] (Coord h → ℝ) := + (output h).comp (compression h).val + +def rawRelation (h : ℕ) : InfimalCost.Relation (Raw h) (Vec h) (Coord h → ℝ) where + output := rawOutput h + value := (relation h).value + sectionMap := (expansion h).val.comp (finiteSection h) + section_output v := by + change output h ((compression h).val ((expansion h).val (finiteSection h v)))=(relation h).value v + rw [compression_expansion] + exact (relation h).section_output v + +lemma raw_cost_eq (h : ℕ) (v : Vec h) : (rawRelation h).seminorm v=finiteCost h v := by + apply le_antisymm + · apply (relation h).bound v + intro d hd + have he : (rawRelation h).output ((expansion h).val d)=(rawRelation h).value v := by + change output h ((compression h).val ((expansion h).val d))=(relation h).value v + rw [compression_expansion] + exact hd + exact ((rawRelation h).le_representation he).trans ((expansion h).property d) + · apply (rawRelation h).bound v + intro d hd + exact ((relation h).le_representation hd).trans ((compression h).property d) + +/-- The start-cost infimum is unchanged when arbitrary repetitions are allowed. + No minimizer, finite optimal representation, or attained infimum is assumed. -/ +theorem finiteCost_eq_raw_sInf (h : ℕ) (v : Vec h) : + finiteCost h v=sInf {r : ℝ | ∃ d : Raw h,rawOutput h d=(fun s => v s) ∧ ‖d‖=r} := by + rw [← raw_cost_eq] + exact (rawRelation h).eq_sInf v + +lemma lp1_norm {ι E : Type*} [NormedAddCommGroup E] (d : lp (fun _ : ι => E) 1) : + ‖d‖=∑' i,‖d i‖ := by + simpa only [ENNReal.toReal_one,one_div,inv_one,Real.rpow_one] using + lp.norm_eq_tsum_rpow (by norm_num : (0:ℝ)<(1:ℝ≥0∞).toReal) d + +lemma raw_norm_zero (d : Raw 0) : ‖d‖=∑' j,|d j| := by + rw [lp1_norm] + simp only [Real.norm_eq_abs] +/-- The exact start masses before any grouping or cancellation. -/ +lemma raw_root_mass (h : ℕ) (d : Raw (h+1)) : + ‖d.fst‖=∑' j,∑' s : Coord (h+1),|d.fst j s| := by + rw [lp1_norm] + apply tsum_congr + intro j + rw [lp1_norm] + simp only [Real.norm_eq_abs] +lemma raw_children_cost_sq (h : ℕ) (d : Raw (h+1)) : + ‖d.snd‖^2=∑' i,‖d.snd i‖^2 := by + simpa only [ENNReal.toReal_ofNat,Real.rpow_two] using + lp.norm_rpow_eq_tsum (by norm_num : (0:ℝ)<(2:ℝ≥0∞).toReal) d.snd +lemma raw_norm_succ (h : ℕ) (d : Raw (h+1)) : + ‖d‖=(∑' j,∑' s : Coord (h+1),|d.fst j s|)+Real.sqrt (∑' i,‖d.snd i‖^2) := by + rw [WithLp.prod_norm_eq_of_L1,raw_root_mass,← raw_children_cost_sq,Real.sqrt_sq (norm_nonneg _)] + +/-- Absolute convergence of all root-start row outputs, at every coordinate. + The rest of each coordinate's output is the finite ancestral recursion. -/ +lemma raw_root_absolute (h : ℕ) (d : Raw (h+1)) (r : Coord (h+1)) : + Summable (fun j => ‖path (h+1) (d.fst j) r‖) := by + have hs : Summable (fun j => ‖d.fst j‖) := by + simpa only [ENNReal.toReal_one,Real.rpow_one] using d.fst.property.summable (by norm_num : (0:ℝ)<(1:ℝ≥0∞).toReal) + apply Summable.of_nonneg_of_le (fun j => norm_nonneg _) (fun j => ?_) hs + simpa only [Real.norm_eq_abs] using path_coordinate (h+1) (d.fst j) r +lemma raw_root_tsum (h : ℕ) (d : Raw (h+1)) : + path (h+1) (lp.tsumCLM ℝ ℕ (L1 (h+1)) d.fst)=∑' j,path (h+1) (d.fst j) := by + change path (h+1) (∑' j,d.fst j)=_ + exact (path (h+1)).map_tsum (Summable.of_norm (by + simpa only [ENNReal.toReal_one,Real.rpow_one] using d.fst.property.summable (by norm_num : (0:ℝ)<(1:ℝ≥0∞).toReal))) +end StartModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Orthogonality.lean b/lean/OAI/Analysis/DiamondDistortion/Orthogonality.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e2e43f59ee47665933fde29f83c4d6611bc05ad --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Orthogonality.lean @@ -0,0 +1,238 @@ +import OAI.Analysis.DiamondDistortion.Ancestry + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace SegmentSystem +variable {ι κ : Type*} (T : SegmentSystem ι) + +lemma primal_sq_le (p : ι →₀ ℝ) {M : ℝ} (hM : 0 ≤ M) + (hF : ∀ F : T.Family, (∑ i, (∑ v ∈ F.seg i,p v)^2) ≤ M) : + (T.primalSeminorm p)^2 ≤ M := by + have hbound : T.primalSeminorm p ≤ Real.sqrt M := by + rw [primalSeminorm, Seminorm.iSup_apply T.families_bddAbove] + apply ciSup_le + intro F + have h := hF F + have he : ‖F.test p‖^2 = (∑ i, (∑ v ∈ F.seg i,p v)^2) := by + rw [EuclideanSpace.norm_sq_eq] + simp only [Family.test_apply,Real.norm_eq_abs,sq_abs] + rw [← he, ← Real.sq_sqrt hM] at h + exact (sq_le_sq₀ (norm_nonneg _) (Real.sqrt_nonneg _)).mp h + have h := (sq_le_sq₀ (apply_nonneg _ _) (Real.sqrt_nonneg _)).2 hbound + rwa [Real.sq_sqrt hM] at h + +def colorSupport (_T : SegmentSystem ι) (c : ι → κ) (p : ι →₀ ℝ) : Finset κ := p.support.image c + +/-- Segment families in disjoint components spend orthogonal testing energies. -/ +lemma block_add_sq (c : ι → κ) + (hsame : ∀ S, T.IsSegment S → ∀ u ∈ S, ∀ v ∈ S, c u=c v) + (p q : ι →₀ ℝ) (hd : Disjoint (T.colorSupport c p) (T.colorSupport c q)) : + (T.primalSeminorm (p+q))^2 ≤ (T.primalSeminorm p)^2+(T.primalSeminorm q)^2 := by + classical + apply T.primal_sq_le (p+q) (add_nonneg (sq_nonneg _) (sq_nonneg _)) + intro F + have hz (i : Fin F.n) : (∑ v ∈ F.seg i,p v)*(∑ v ∈ F.seg i,q v)=0 := by + by_cases hp : (∑ v ∈ F.seg i,p v)=0 + · rw [hp,zero_mul] + by_cases hq : (∑ v ∈ F.seg i,q v)=0 + · rw [hq,mul_zero] + obtain ⟨u,hu,hpu⟩ := Finset.exists_ne_zero_of_sum_ne_zero hp + obtain ⟨v,hv,hqv⟩ := Finset.exists_ne_zero_of_sum_ne_zero hq + have he := hsame _ (F.allowed i) u hu v hv + exact False.elim (Finset.disjoint_left.mp hd + (Finset.mem_image.mpr ⟨u,Finsupp.mem_support_iff.mpr hpu,rfl⟩) + (Finset.mem_image.mpr ⟨v,Finsupp.mem_support_iff.mpr hqv,he.symm⟩)) + have he (i : Fin F.n) : (∑ v ∈ F.seg i,(p+q) v)^2 = + (∑ v ∈ F.seg i,p v)^2+(∑ v ∈ F.seg i,q v)^2 := by + simp only [Finsupp.add_apply,Finset.sum_add_distrib] + nlinarith [hz i] + simp_rw [he] + rw [Finset.sum_add_distrib] + exact add_le_add + (T.test_energy_le_allow_empty F.seg (fun i _ => F.allowed i) F.disjoint p) + (T.test_energy_le_allow_empty F.seg (fun i _ => F.allowed i) F.disjoint q) + +/-- A functional on an orthogonal sum is uniformly small outside finitely many + components. The proof uses finite blocks only, not a reflexivity library. -/ +lemma small_color_tail_upper (c : ι → κ) + (hsame : ∀ S, T.IsSegment S → ∀ u ∈ S, ∀ v ∈ S, c u=c v) + (x : T.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ C : Finset κ, ∀ p : ι →₀ ℝ, (∀ v ∈ p.support, c v ∉ C) → + x (T.finiteEmbedding p) ≤ ε*T.primalSeminorm p := by + classical + by_contra hn + push Not at hn + have hchoose (C : Finset κ) : ∃ q : ι →₀ ℝ, + (∀ v ∈ q.support,c v ∉ C) ∧ T.primalSeminorm q=1 ∧ ε < x (T.finiteEmbedding q) := by + obtain ⟨p,hout,hval⟩ := hn C + have hpn0 : T.primalSeminorm p ≠ 0 := by + intro he + have hp0 := (T.primal_eq_zero_iff p).mp he + simp only [hp0,map_zero,mul_zero,lt_self_iff_false] at hval + have hpn : 0 < T.primalSeminorm p := lt_of_le_of_ne (apply_nonneg _ _) hpn0.symm + let q := (T.primalSeminorm p)⁻¹ • p + refine ⟨q, ?_, ?_, ?_⟩ + · intro v hv + apply hout v + apply Finsupp.mem_support_iff.mpr + intro hpv + have hqv : q v=0 := by simp [q,Finsupp.smul_apply,hpv] + exact (Finsupp.mem_support_iff.mp hv) hqv + · simp only [q,map_smul_eq_mul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hpn)] + exact inv_mul_cancel₀ hpn0 + · simp only [q,map_smul,smul_eq_mul] + rw [inv_mul_eq_div] + exact (lt_div_iff₀ hpn).mpr hval + have hblocks : ∀ n : ℕ, ∃ p : ι →₀ ℝ, + (T.primalSeminorm p)^2 ≤ (n : ℝ) ∧ (n : ℝ)*ε ≤ x (T.finiteEmbedding p) := by + intro n + induction n with + | zero => exact ⟨0,by simp only [map_zero,zero_pow (by decide : 2 ≠ 0),Nat.cast_zero,le_refl], + by simp only [map_zero,Nat.cast_zero,zero_mul,le_refl]⟩ + | succ n ih => + obtain ⟨p,hpn,hpx⟩ := ih + obtain ⟨q,hqout,hqn,hqx⟩ := hchoose (T.colorSupport c p) + have hd : Disjoint (T.colorSupport c p) (T.colorSupport c q) := by + apply Finset.disjoint_left.mpr + intro a hap haq + obtain ⟨v,hv,rfl⟩ := Finset.mem_image.mp haq + exact hqout v hv hap + refine ⟨p+q, ?_, ?_⟩ + · have h := T.block_add_sq c hsame p q hd + rw [hqn] at h + push_cast + nlinarith + · simp only [map_add,Nat.cast_add,Nat.cast_one] + nlinarith + obtain ⟨n,hn⟩ := exists_nat_gt (‖x‖^2/ε^2) + have hn0 : (0:ℝ) < n := lt_of_le_of_lt (div_nonneg (sq_nonneg _) (sq_nonneg _)) hn + have hnε : ‖x‖^2 < (n:ℝ)*ε^2 := (div_lt_iff₀ (sq_pos_of_pos hε)).mp hn + obtain ⟨p,hpn,hpx⟩ := hblocks n + have hxb : x (T.finiteEmbedding p) ≤ ‖x‖*T.primalSeminorm p := by + calc + _ ≤ ‖x (T.finiteEmbedding p)‖ := Real.le_norm_self _ + _ ≤ ‖x‖*‖T.finiteEmbedding p‖ := x.le_opNorm _ + _ = _ := by rw [T.finiteEmbedding_norm] + have hprod : (n:ℝ)*ε ≤ ‖x‖*T.primalSeminorm p := hpx.trans hxb + have hsquare := (sq_le_sq₀ (mul_nonneg hn0.le hε.le) + (mul_nonneg (norm_nonneg _) (apply_nonneg _ _))).2 hprod + have hmul := mul_le_mul_of_nonneg_left hpn (sq_nonneg ‖x‖) + have hcontra := mul_pos hn0 (sub_pos.mpr hnε) + nlinarith + +lemma small_color_tail (c : ι → κ) + (hsame : ∀ S, T.IsSegment S → ∀ u ∈ S, ∀ v ∈ S, c u=c v) + (x : T.Dual) {ε : ℝ} (hε : 0 < ε) : + ∃ C : Finset κ, ∀ p : ι →₀ ℝ, (∀ v ∈ p.support, c v ∉ C) → + |x (T.finiteEmbedding p)| ≤ ε*T.primalSeminorm p := by + obtain ⟨C,hC⟩ := T.small_color_tail_upper c hsame x hε + refine ⟨C,?_⟩ + intro p hp + apply abs_le.mpr + refine ⟨?_,hC p hp⟩ + have h := hC (-p) (by simpa only [Finsupp.support_neg] using hp) + simp only [map_neg,map_neg_eq_map] at h + linarith + +/-- No nonzero coordinate is lost by using the actual Finsupp support. -/ +lemma sum_sq_le_support (p : ι →₀ ℝ) (S : Finset ι) : + (∑ v ∈ S,p v^2) ≤ ∑ v ∈ p.support,p v^2 := by + classical + have h : (∑ v ∈ S,p v^2) ≤ ∑ v ∈ S ∪ p.support,p v^2 := + Finset.sum_le_sum_of_subset_of_nonneg Finset.subset_union_left (fun _ _ _ => sq_nonneg _) + have he : (∑ v ∈ p.support,p v^2) = ∑ v ∈ S ∪ p.support,p v^2 := by + apply Finset.sum_subset Finset.subset_union_right + intro v _ hv + rw [Finsupp.notMem_support_iff.mp hv] + norm_num + exact h.trans_eq he.symm + +lemma coordinate_energy_le (p : ι →₀ ℝ) (S : Finset ι) : + (∑ v ∈ S,p v^2) ≤ (T.primalSeminorm p)^2 := by + classical + have h := T.test_energy_le (fun v : S => {v.val}) (fun v => T.singleton v.val) + (by + intro v w hvw + exact Finset.disjoint_singleton.mpr (fun he => hvw (Subtype.ext he))) p + simp only [Finset.sum_singleton] at h + calc + _ = ∑ v : S,p v.val^2 := (Finset.sum_coe_sort S (fun v => p v^2)).symm + _ ≤ _ := h + +lemma primal_sq_le_of_segment (p : ι →₀ ℝ) {L : ℝ} (hL : 0 ≤ L) + (hS : ∀ S, T.IsSegment S → (∑ v ∈ S,p v)^2 ≤ L*(∑ v ∈ S,p v^2)) : + (T.primalSeminorm p)^2 ≤ L*(∑ v ∈ p.support,p v^2) := by + classical + apply T.primal_sq_le p (mul_nonneg hL (Finset.sum_nonneg (fun _ _ => sq_nonneg _))) + intro F + have he : (∑ i,∑ v ∈ F.seg i,p v^2) = ∑ v ∈ Finset.univ.biUnion F.seg,p v^2 := by + symm + apply Finset.sum_biUnion + intro i _ j _ hij + exact F.disjoint hij + calc + _ ≤ ∑ i,L*(∑ v ∈ F.seg i,p v^2) := Finset.sum_le_sum (fun i _ => hS _ (F.allowed i)) + _ = L*(∑ v ∈ Finset.univ.biUnion F.seg,p v^2) := by rw [← Finset.mul_sum,he] + _ ≤ _ := mul_le_mul_of_nonneg_left (sum_sq_le_support p _) hL + +def finiteArray (S : Finset ι) (a : ι → ℝ) : ι →₀ ℝ := + ∑ v ∈ S,a v • Finsupp.single v 1 + +lemma finiteArray_apply (S : Finset ι) (a : ι → ℝ) (v : ι) : + finiteArray S a v = if v ∈ S then a v else 0 := by + classical + simp [finiteArray,Finsupp.finsetSum_apply,Finsupp.single_apply,Finset.sum_ite_eq'] + +lemma finiteArray_support (S : Finset ι) (a : ι → ℝ) : (finiteArray S a).support ⊆ S := by + intro v hv + by_contra hn + exact (Finsupp.mem_support_iff.mp hv) (by rw [finiteArray_apply,ite_eq_right hn]) + +lemma finiteArray_energy (S : Finset ι) (a : ι → ℝ) : + (∑ v ∈ (finiteArray S a).support,finiteArray S a v^2) = ∑ v ∈ S,a v^2 := by + calc + _ = ∑ v ∈ S,finiteArray S a v^2 := by + apply Finset.sum_subset (finiteArray_support S a) + intro v _ hv + rw [Finsupp.notMem_support_iff.mp hv] + norm_num + _ = _ := by + apply Finset.sum_congr rfl + intro v hv + rw [finiteArray_apply,ite_eq_left hv] + +lemma finiteArray_pairing (S : Finset ι) (a : ι → ℝ) (x : T.Dual) : + x (T.finiteEmbedding (finiteArray S a)) = ∑ v ∈ S,a v*x (T.unitVector v) := by + simp only [finiteArray,map_sum,map_smul,finiteEmbedding_single,one_smul,smul_eq_mul] + +/-- Bounded nonnegative finite square sums have uniformly small disjoint tails. + This is proved directly from a real supremum, with no countability assumption. -/ +lemma finite_square_tails (a : ι → ℝ) {M : ℝ} + (hM : ∀ S : Finset ι,(∑ v ∈ S,a v^2) ≤ M) {δ : ℝ} (hδ : 0 < δ) : + ∃ S : Finset ι, ∀ U : Finset ι, Disjoint S U → (∑ v ∈ U,a v^2) < δ := by + classical + let E : Set ℝ := Set.range (fun S : Finset ι => ∑ v ∈ S,a v^2) + have hEb : BddAbove E := ⟨M,by rintro _ ⟨S,rfl⟩; exact hM S⟩ + have hEn : E.Nonempty := ⟨0,∅,by simp⟩ + obtain ⟨b,⟨S,rfl⟩,hS⟩ := exists_lt_of_lt_csSup hEn (sub_lt_self (sSup E) hδ) + refine ⟨S,?_⟩ + intro U hU + have h := le_csSup hEb (show (∑ v ∈ S ∪ U,a v^2) ∈ E from ⟨S ∪ U,rfl⟩) + rw [Finset.sum_union hU] at h + linarith + +end SegmentSystem + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean b/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..156bbcccfd1b562b87587e93312dee65517f1a4d --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/PathBounds.lean @@ -0,0 +1,203 @@ +import OAI.Analysis.DiamondDistortion.PathLenses + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Midpoint +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Packing with one finite-rank head and a common tail bound; no head norm + estimate and no attained infinite minimum is used. -/ +lemma tail_packing (P : X →L[ℝ] X) [FiniteDimensional ℝ (LinearMap.range P.toLinearMap)] + (z : ℕ → X) {R ε T : ℝ} (hz : ∀ i,‖z i‖ ≤ R) + (hs : ∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) (ht : ∀ i,‖z i-P (z i)‖ ≤ T) : + ε/2 ≤ T := by + apply le_of_forall_pos_le_add + intro η hη + obtain ⟨i,j,hij,hP⟩ := finite_rank_pair P z hz hη + let w := (1/2:ℝ) • (z i-z j) + have hw : ε/2 ≤ ‖w‖ := by + dsimp [w] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + linarith [hs i j hij] + have he : w=P w+(1/2:ℝ) • ((z i-P (z i))-(z j-P (z j))) := by + dsimp [w] + rw [map_smul,map_sub] + module + have htail : ‖(1/2:ℝ) • ((z i-P (z i))-(z j-P (z j)))‖ ≤ T := by + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + have hh := (norm_sub_le (z i-P (z i)) (z j-P (z j))).trans (add_le_add (ht i) (ht j)) + linarith + have hnorm := norm_add_le (P w) ((1/2:ℝ) • ((z i-P (z i))-(z j-P (z j)))) + rw [← he] at hnorm + change ‖P w‖ < η at hP + linarith + +end Midpoint + +namespace PathApplications +open Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Threshold-removal uses a single head for *all* deviations at this radius. -/ +def RelativeInput (A : Heads ι X) : Prop := + ∀ (x : X),x ≠ 0 → ∀ δ : ℝ,0 < δ → δ ≤ 1 → ∃ H : ι, + ∀ y : X,‖x+y‖ ≤ (1+δ)*‖x‖ → ‖x-y‖ ≤ (1+δ)*‖x‖ → + ‖y-A.projection H y‖ ≤ 72*Real.sqrt δ*‖x‖ + +def relativeDelta (D : ℝ) : ℝ := ((200*D)⁻¹)^2 + +lemma relative_parameters {D : ℝ} (hD : 1 ≤ D) : + 0 < relativeDelta D ∧ relativeDelta D ≤ 1 ∧ 72*Real.sqrt (relativeDelta D)*D < 1 := by + have hDpos : 0 < D := by linarith + have hinv : 0 < (200*D)⁻¹ := by positivity + have hinv1 : (200*D)⁻¹ ≤ 1 := (inv_le_one₀ (by positivity)).mpr (by linarith) + have hsqrt : Real.sqrt (relativeDelta D)=(200*D)⁻¹ := by + unfold relativeDelta + exact Real.sqrt_sq hinv.le + refine ⟨by unfold relativeDelta; positivity,by unfold relativeDelta; nlinarith,?_⟩ + rw [hsqrt] + have he : 72*(200*D)⁻¹*D=72/200 := by field_simp + rw [he] + norm_num + +lemma relative_lens_impossible (A : Heads ι X) (hinput : RelativeInput A) + {D : ℝ} (hD : 1 ≤ D) {x : X} (z : ℕ → X) (hx : 1 ≤ ‖x‖) (hxD : ‖x‖ ≤ D) + (hp : ∀ i,‖x+z i‖ ≤ (1+relativeDelta D)*‖x‖) + (hm : ∀ i,‖x-z i‖ ≤ (1+relativeDelta D)*‖x‖) + (hs : ∀ i j,i ≠ j → 2 ≤ ‖z i-z j‖) : False := by + obtain ⟨hδ,hδ1,hδD⟩ := relative_parameters hD + have hx0 : x ≠ 0 := by intro h; simp only [h,norm_zero] at hx; linarith + obtain ⟨H,hH⟩ := hinput x hx0 (relativeDelta D) hδ hδ1 + let := A.finite H + have hh := tail_packing (A.projection H) z (fun i => Diamond.norm_deviation_le (hp i) (hm i)) + hs (fun i => hH (z i) (hp i) (hm i)) + have hm := mul_le_mul_of_nonneg_left hxD (show 0 ≤ 72*Real.sqrt (relativeDelta D) by positivity) + linarith + +/-- An actual original child exceeds the relative factor, rather than merely + a quotient representative or a supremum satisfying a non-strict bound. -/ +lemma relative_actual_child (A : Heads ι X) (hinput : RelativeInput A) + {D : ℝ} (hD : 1 ≤ D) {x : X} (z : ℕ → X) (hx : 1 ≤ ‖x‖) (hxD : ‖x‖ ≤ D) + (hs : ∀ i j,i ≠ j → 2 ≤ ‖z i-z j‖) : + ∃ i,(1+relativeDelta D)*‖x‖ < max ‖x+z i‖ ‖x-z i‖ := by + by_contra! hn + exact relative_lens_impossible A hinput hD z hx hxD + (fun i => (le_max_left _ _).trans (hn i)) (fun i => (le_max_right _ _).trans (hn i)) hs + +theorem relative_cost (A : Heads ι X) (hinput : RelativeInput A) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + (1+relativeDelta D)^k ≤ D := by + obtain ⟨hδ,hδ1,hδD⟩ := relative_parameters hf.1 + have hb : 0 < 1+relativeDelta D := by positivity + let c : ℝ := 1/(1+relativeDelta D) + have hc : 0 ≤ c := by dsimp [c]; positivity + have hc1 : c ≤ 1 := (div_le_one₀ hb).mpr (by linarith) + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → 1 ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*1 ≤ ‖z i-z j‖) → ‖x‖ ≤ c*R := by + intro x z R hR hRD hx hp hm hs + have hxD := (Diamond.norm_center_le (hp 0) (hm 0)).trans hRD + obtain ⟨i,hi⟩ := relative_actual_child A hinput hf.1 z hx hxD (by simpa using hs) + have hh := hi.trans_le (max_le (hp i) (hm i)) + have hnorm : ‖x‖ ≤ R/(1+relativeDelta D) := (le_div_iff₀ hb).mpr (by nlinarith) + simpa only [c,div_eq_mul_inv,one_mul,mul_comm] using hnorm + obtain ⟨_,_,hnorm⟩ := Diamond.normalized_distortion f hf + have hh := Diamond.iterate_contraction hc hc1 hstep k (fun v => s⁻¹ • f v) + (show 0 ≤ D by linarith [hf.1]) le_rfl (fun u v => (hnorm u v).1) + (fun e => Diamond.slope_upper _ (fun u v => by simpa using (hnorm u v).2) e) + have he : c^k*D=D/(1+relativeDelta D)^k := by dsimp [c]; rw [div_pow,one_pow]; ring + rw [he] at hh + exact (one_le_div (by positivity : 0 < (1+relativeDelta D)^k)).mp hh + +end PathApplications + +namespace Midpoint +open Filter +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + [TopologicalSpace.SeparableSpace (StrongDual ℝ X)] +lemma bounded_scalar_subsequence (z : ℕ → X) {R : ℝ} (hz : ∀ i,‖z i‖ ≤ R) : + ∃ n : ℕ → ℕ,StrictMono n ∧ ∀ f : StrongDual ℝ X,∃ a : ℝ, + Tendsto (fun i => f (z (n i))) atTop (𝓝 a) := by + let w (i : ℕ) : WeakDual ℝ (StrongDual ℝ X) := + StrongDual.toWeakDual (NormedSpace.inclusionInDoubleDual ℝ X (z i)) + have hw : ∀ i,w i ∈ WeakDual.toStrongDual ⁻¹' Metric.closedBall 0 R := by + intro i + change dist (NormedSpace.inclusionInDoubleDual ℝ X (z i)) 0 ≤ R + convert (NormedSpace.double_dual_bound ℝ X (z i)).trans (hz i) using 1 + exact @dist_zero_right (StrongDual ℝ (StrongDual ℝ X)) inferInstance + (NormedSpace.inclusionInDoubleDual ℝ X (z i)) + obtain ⟨a,ha,n,hn,ht⟩ := WeakDual.isSeqCompact_closedBall ℝ (StrongDual ℝ X) 0 R hw + refine ⟨n,hn,fun f => ⟨a f,?_⟩⟩ + have hh := ((WeakDual.eval_continuous f).tendsto a).comp ht + exact hh + +lemma bounded_weak_pair (z : ℕ → X) {R : ℝ} (hz : ∀ i,‖z i‖ ≤ R) : + ∃ n : ℕ → ℕ,StrictMono n ∧ ∀ f : StrongDual ℝ X, + Tendsto (fun i => f ((1/2:ℝ) • (z (n (2*i))-z (n (2*i+1))))) atTop (𝓝 0) := by + obtain ⟨n,hn,hf⟩ := bounded_scalar_subsequence z hz + refine ⟨n,hn,fun f => ?_⟩ + obtain ⟨a,ha⟩ := hf f + have ht0 : Tendsto (fun i : ℕ => 2*i) atTop atTop := tendsto_atTop_mono (by intro i; dsimp only [id]; omega) tendsto_id + have ht1 : Tendsto (fun i : ℕ => 2*i+1) atTop atTop := tendsto_atTop_mono (by intro i; dsimp only [id]; omega) tendsto_id + have hh := ((ha.comp ht0).sub (ha.comp ht1)).const_mul (1/2:ℝ) + simpa only [Function.comp_def,sub_self,mul_zero,map_smul,map_sub,smul_eq_mul] using hh +end Midpoint + +namespace PathApplications +open Midpoint Filter +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +def WeakInput (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] : Prop := + ∀ (x : X) (y : ℕ → X),(∃ M : ℝ,∀ j,‖y j‖ ≤ M) → WeaklyNull y → + Real.sqrt (‖x‖^2+(1/16:ℝ)*(liminf (fun j => ‖y j‖) atTop)^2) ≤ + liminf (fun j => max ‖x+y j‖ ‖x-y j‖) atTop + +lemma weak_lens [TopologicalSpace.SeparableSpace (StrongDual ℝ X)] (hinput : WeakInput X) : + Diamond.SquareLens X (1/64) := by + intro x z R ε hR hε hp hm hs + obtain ⟨n,hn,hweak⟩ := Midpoint.bounded_weak_pair z (fun i => Diamond.norm_deviation_le (hp i) (hm i)) + let y (i : ℕ) := (1/2:ℝ) • (z (n (2*i))-z (n (2*i+1))) + have hnull : WeaklyNull y := hweak + have hend (i : ℕ) : ‖x+y i‖ ≤ R ∧ ‖x-y i‖ ≤ R := average_lens z hp hm _ _ + have hyR (i : ℕ) : ‖y i‖ ≤ R := Diamond.norm_deviation_le (hend i).1 (hend i).2 + have hyl (i : ℕ) : ε/2 ≤ ‖y i‖ := by + have hij : n (2*i) ≠ n (2*i+1) := hn.injective.ne (by omega) + dsimp [y] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + linarith [hs _ _ hij] + have hlim : ε/2 ≤ liminf (fun i => ‖y i‖) atTop := + le_liminf_of_le (isCoboundedUnder_ge_of_le atTop hyR) (Eventually.of_forall hyl) + have hmaxL (i : ℕ) : 0 ≤ max ‖x+y i‖ ‖x-y i‖ := (norm_nonneg _).trans (le_max_left _ _) + have hmaxR (i : ℕ) : max ‖x+y i‖ ‖x-y i‖ ≤ R := max_le (hend i).1 (hend i).2 + have hlimR : liminf (fun i => max ‖x+y i‖ ‖x-y i‖) atTop ≤ R := + liminf_le_of_frequently_le (Eventually.of_forall hmaxR).frequently + (isBoundedUnder_of_eventually_ge (Eventually.of_forall hmaxL)) + have hh := (hinput x y ⟨R,hyR⟩ hnull).trans hlimR + have hsq : ‖x‖^2+(1/16:ℝ)*(liminf (fun i => ‖y i‖) atTop)^2 ≤ R^2 := by + exact (Real.sqrt_le_iff).mp hh |>.2 + have hlim0 : 0 ≤ liminf (fun i => ‖y i‖) atTop := (by positivity : 0 ≤ ε/2).trans hlim + have hl2 := (sq_le_sq₀ (by positivity : 0 ≤ ε/2) hlim0).mpr hlim + nlinarith + +theorem weak_linear [TopologicalSpace.SeparableSpace (StrongDual ℝ X)] (hinput : WeakInput X) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/64 ≤ D^2 := by + have hh := Diamond.squared_transfer (by norm_num : (0:ℝ)<1/64) (weak_lens hinput) k f D s hf + have hk : (0:ℝ) ≤ k := Nat.cast_nonneg k + linarith + +end PathApplications + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/PathLenses.lean b/lean/OAI/Analysis/DiamondDistortion/PathLenses.lean new file mode 100644 index 0000000000000000000000000000000000000000..9659107ad5d54886f53a0093f30ac03248df3c11 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/PathLenses.lean @@ -0,0 +1,280 @@ +import OAI.Analysis.DiamondDistortion.WeakLenses + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace PathApplications +open Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- The positive-flow and trimming inputs, with their distinct coefficient B. -/ +def FlowInput (A : Heads ι X) (B : ℝ) : Prop := + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → + ‖y‖^2 ≤ B*(‖p+y‖^2+‖p-y‖^2-2*‖p‖^2) + +lemma flow_square (A : Heads ι X) {B : ℝ} (hB : 0 < B) (hinput : FlowInput A B) : + A.SquareInput (1/(2*B)) := by + intro H p y R hP hY hR hp hm + have hh := hinput H p y hP hY + have hp2 := (sq_le_sq₀ (norm_nonneg _) hR).mpr hp + have hm2 := (sq_le_sq₀ (norm_nonneg _) hR).mpr hm + have hmul := mul_le_mul_of_nonneg_left (show ‖p+y‖^2+‖p-y‖^2-2*‖p‖^2 ≤ + 2*(R^2-‖p‖^2) by linarith) hB.le + have hmain : ‖y‖^2/(2*B) ≤ R^2-‖p‖^2 := (div_le_iff₀ (by positivity)).mpr (by nlinarith) + simpa only [one_div,mul_comm,div_eq_mul_inv,mul_one,one_mul] using (show ‖p‖^2+‖y‖^2/(2*B) ≤ R^2 by linarith) + +lemma square_depth (A : Heads ι X) {a : ℝ} (ha : 0 < a) (hinput : A.SquareInput a) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+a*(k:ℝ) ≤ D^2 := by + have h := Diamond.squared_transfer (show 0 < a/4 by positivity) (A.square_lens ha hinput) k f D s hf + convert h using 1; ring + +def linearC : ℝ := 6*(Real.sqrt 2+1) +lemma linearC_pos : 0 < linearC := by unfold linearC; positivity + +theorem linear_flow (A : Heads ι X) (hinput : FlowInput A (linearC^2)) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/(2*linearC^2) ≤ D^2 ∧ (k:ℝ) ≤ 2*linearC^2*D^2 := by + have hC := linearC_pos + have h := square_depth A (show 0 < 1/(2*linearC^2) by positivity) + (flow_square A (show 0 < linearC^2 by positivity) hinput) k f hf + have hh : 1+(k:ℝ)/(2*linearC^2) ≤ D^2 := by simpa only [one_div,mul_comm,div_eq_mul_inv,mul_one,one_mul] using h + refine ⟨hh,?_⟩ + have hdiv : (k:ℝ)/(2*linearC^2) ≤ D^2 := by linarith + exact (div_le_iff₀ (by positivity)).mp hdiv |>.trans_eq (mul_comm _ _) + +theorem linear_trimming (A : Heads ι X) (hinput : FlowInput A 242) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/484 ≤ D^2 := by + have h := square_depth A (by norm_num : (0:ℝ) < 1/(2*242)) + (flow_square A (by norm_num) hinput) k f hf + convert h using 1; ring + +/-- Exact arbitrary-displacement cancellation input (unlike a pure-tail assertion). -/ +def ArbitraryTailInput (A : Heads ι X) (C : ℝ) : Prop := + ∀ (H : ι) (p y : X) (R : ℝ),A.projection H p=p → 0 ≤ R → + ‖p+y‖ ≤ R → ‖p-y‖ ≤ R → ‖y-A.projection H y‖ ≤ C*Real.sqrt (R^2-‖p‖^2) + +lemma arbitrary_tail_square (A : Heads ι X) {C : ℝ} (hC : 0 < C) + (hinput : ArbitraryTailInput A C) : A.SquareInput (1/C^2) := by + intro H p y R hP hY hR hp hm + have hh := hinput H p y R hP hR hp hm + rw [hY,sub_zero] at hh + have hc := Diamond.norm_center_le hp hm + have hrad : 0 ≤ R^2-‖p‖^2 := sub_nonneg.mpr ((sq_le_sq₀ (norm_nonneg _) hR).mpr hc) + have hs := (sq_le_sq₀ (norm_nonneg _) (by positivity : 0 ≤ C*Real.sqrt (R^2-‖p‖^2))).mpr hh + rw [mul_pow,Real.sq_sqrt hrad] at hs + have hd : ‖y‖^2/C^2 ≤ R^2-‖p‖^2 := (div_le_iff₀ (by positivity)).mpr (by nlinarith) + simpa only [one_div,mul_comm,div_eq_mul_inv,mul_one,one_mul] using (show ‖p‖^2+‖y‖^2/C^2 ≤ R^2 by linarith) + +theorem quadratic_cost (A : Heads ι X) (hinput : ArbitraryTailInput A 8) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/64 ≤ D^2 := by + have h := square_depth A (by norm_num : (0:ℝ) < 1/8^2) + (arbitrary_tail_square A (by norm_num) hinput) k f hf + convert h using 1; ring + +/-- The independent stopped-flow intrinsic input, with no change to its energy average. -/ +def StoppedInput (A : Heads ι X) : Prop := + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → + ‖p‖^2+‖y‖^2/144 ≤ (‖p+y‖^2+‖p-y‖^2)/2 + +theorem stopped_flow (A : Heads ι X) (hinput : StoppedInput A) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + (k:ℝ) ≤ 144*D^2 := by + have hi : A.SquareInput (1/144) := by + intro H p y R hP hY hR hp hm + have hh := hinput H p y hP hY + have hp2 := (sq_le_sq₀ (norm_nonneg _) hR).mpr hp + have hm2 := (sq_le_sq₀ (norm_nonneg _) hR).mpr hm + linarith + have hh := square_depth A (by norm_num) hi k f hf + linarith + +def StartInput (A : Heads ι X) : Prop := + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → + ‖p‖^2+‖y‖^2/64 ≤ max (‖p+y‖^2) (‖p-y‖^2) + +lemma start_square (A : Heads ι X) (hinput : StartInput A) : A.SquareInput (1/64) := by + intro H p y R hP hY hR hp hm + have hh := (hinput H p y hP hY).trans (max_le + ((sq_le_sq₀ (norm_nonneg _) hR).mpr hp) ((sq_le_sq₀ (norm_nonneg _) hR).mpr hm)) + linarith + +theorem start_cost (A : Heads ι X) (hinput : StartInput A) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/128 ≤ D^2 := by + have hh := square_depth A (by norm_num) (start_square A hinput) k f hf + have hk : (0:ℝ) ≤ k := Nat.cast_nonneg k + linarith + +def clippingC (D : ℝ) : ℝ := 1/(8*D) +def clippingQ (D : ℝ) : ℝ := Real.sqrt (1+4*(clippingC D)^2) +def clippingGamma (D : ℝ) : ℝ := clippingC D/2-(clippingQ D-1)*D + +lemma clipping_bounds {D : ℝ} (hD : 1 ≤ D) : + 0 < clippingC D ∧ 1 ≤ clippingQ D ∧ clippingC D/4 ≤ clippingGamma D := by + have hD0 : 0 < D := by linarith + have hc : 0 < clippingC D := by unfold clippingC; positivity + have hQ0 : 0 ≤ clippingQ D := by unfold clippingQ; positivity + have hQsq : (clippingQ D)^2=1+4*(clippingC D)^2 := Real.sq_sqrt (by positivity) + have hQ1 : 1 ≤ clippingQ D := by nlinarith + have hQt : clippingQ D-1 ≤ 2*(clippingC D)^2 := by + nlinarith [sq_nonneg (clippingQ D-1)] + have hcD : clippingC D*D=1/8 := by unfold clippingC; field_simp + have hmul := mul_le_mul_of_nonneg_right hQt hD0.le + refine ⟨hc,hQ1,?_⟩ + unfold clippingGamma + nlinarith + +/-- Actual-child selection at the clipping half-gain. No infinite supremum is attained. -/ +lemma clipping_actual_child (A : Heads ι X) (hinput : A.ParametricInput (1/2) 4) + {D : ℝ} (hD : 1 ≤ D) {x : X} (z : ℕ → X) (hxD : ‖x‖ ≤ D) + (hs : ∀ i j,i ≠ j → 2 ≤ ‖z i-z j‖) : + ∃ i,‖x‖+clippingGamma D/(2*clippingQ D) < max ‖x+z i‖ ‖x-z i‖ := by + obtain ⟨hc,hQ,hg⟩ := clipping_bounds hD + have hQp : 0 < clippingQ D := by linarith + have hgp : 0 < clippingGamma D := lt_of_lt_of_le (by positivity) hg + by_contra! hn + have hp := fun i => (le_max_left ‖x+z i‖ ‖x-z i‖).trans (hn i) + have hm := fun i => (le_max_right ‖x+z i‖ ‖x-z i‖).trans (hn i) + have hh := A.parametric_lens (by norm_num : (0:ℝ)<1/2) (by norm_num : (0:ℝ)<4) hc hinput z hp hm hs + have he : clippingQ D*(clippingGamma D/(2*clippingQ D))=clippingGamma D/2 := by field_simp + change ‖x‖+1/2*clippingC D*(2/2) ≤ clippingQ D*(‖x‖+clippingGamma D/(2*clippingQ D)) at hh + rw [mul_add,he] at hh + have hm := mul_le_mul_of_nonneg_left hxD (show 0 ≤ clippingQ D-1 by linarith) + unfold clippingGamma at * + nlinarith + +theorem linear_clipping (A : Heads ι X) (hinput : A.ParametricInput (1/2) 4) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)*clippingGamma D/(2*clippingQ D) ≤ D := by + obtain ⟨hc,hQ,hg⟩ := clipping_bounds hf.1 + have hQp : 0 < clippingQ D := by linarith + have hgp : 0 < clippingGamma D := lt_of_lt_of_le (by positivity) hg + let δ := clippingGamma D/(2*clippingQ D) + have hδ : 0 < δ := by dsimp [δ]; positivity + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → 1 ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*1 ≤ ‖z i-z j‖) → ‖x‖ ≤ R-δ := by + intro x z R hR hRD hx hp hm hs + have hxD := (Diamond.norm_center_le (hp 0) (hm 0)).trans hRD + obtain ⟨i,hi⟩ := clipping_actual_child A hinput hf.1 z hxD (by simpa using hs) + have hh := hi.trans_le (max_le (hp i) (hm i)) + linarith + obtain ⟨_,_,hnorm⟩ := Diamond.normalized_distortion f hf + have hh := Diamond.iterate_additive hδ.le hstep k (fun v => s⁻¹ • f v) + (show 0 ≤ D by linarith [hf.1]) le_rfl (fun u v => (hnorm u v).1) + (fun e => Diamond.slope_upper _ (fun u v => by simpa using (hnorm u v).2) e) + simpa only [δ,mul_div_assoc] using hh + +lemma unit_from_square {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] {b α ρ : ℝ} (hX : Diamond.SquareLens X b) + (hα : 0 < α) (hρ : 0 ≤ ρ) (hgap : 1-b*(2*α)^2 ≤ ρ^2) : + Diamond.UnitLensBound X (2*α) ρ := by + intro x z hp hm hs + have hh := hX x z 1 (2*α) (by norm_num) (by positivity) hp hm hs + exact (sq_le_sq₀ (norm_nonneg _) hρ).mp (by nlinarith) + +theorem tail_seven (A : Heads ι X) (hinput : ArbitraryTailInput A 7) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-(D⁻¹)^2/2000)^k := by + have hD : 0 < D := by linarith [hf.1] + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + have hα2 : (D⁻¹)^2 ≤ 1 := by nlinarith + have hρ : 0 ≤ 1-(D⁻¹)^2/2000 := by linarith + have hρ1 : 1-(D⁻¹)^2/2000 < 1 := by nlinarith [sq_pos_of_pos hα] + have hsquare := A.square_lens (by norm_num : (0:ℝ)<1/7^2) + (arbitrary_tail_square A (by norm_num) hinput) + have hgap : 1-(1/(7:ℝ)^2/4)*(2*D⁻¹)^2 ≤ (1-(D⁻¹)^2/2000)^2 := by nlinarith [sq_nonneg ((D⁻¹)^2)] + have hlens := unit_from_square hsquare hα hρ hgap + have hnorm := Diamond.upper_one_normalization f hf + exact Diamond.backward hα hα1 hρ hρ1 hlens k (fun v => (D*s)⁻¹ • f v) + (fun u v => (hnorm u v).1) (fun u v => (hnorm u v).2) + +/-- The pruning parameter is not optimized or silently replaced by the 7-bound. -/ +theorem tail_pruning (A : Heads ι X) (hinput : ArbitraryTailInput A 9) + {D s γ : ℝ} (hγ : 0 < γ) (hγ2 : γ < 1/2) + (hparameter : 9*Real.sqrt ((1+γ)^2-(1-2*γ)^2) < 2*D⁻¹/3) + (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-γ)^k := by + have hD : 0 < D := by linarith [hf.1] + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + have hrad : 0 ≤ (1+γ)^2-(1-2*γ)^2 := by nlinarith + have hsq := (sq_lt_sq₀ (by positivity : 0 ≤ 9*Real.sqrt ((1+γ)^2-(1-2*γ)^2)) + (by positivity : 0 ≤ 2*D⁻¹/3)).mpr hparameter + rw [mul_pow,Real.sq_sqrt hrad] at hsq + have hgap : 1-(1/(9:ℝ)^2/4)*(2*D⁻¹)^2 ≤ (1-γ)^2 := by nlinarith + have hsquare := A.square_lens (by norm_num : (0:ℝ)<1/9^2) + (arbitrary_tail_square A (by norm_num) hinput) + have hlens := unit_from_square hsquare hα (show 0 ≤ 1-γ by linarith) hgap + have hnorm := Diamond.upper_one_normalization f hf + exact Diamond.backward hα hα1 (by linarith) (by linarith) hlens k + (fun v => (D*s)⁻¹ • f v) (fun u v => (hnorm u v).1) (fun u v => (hnorm u v).2) + +def incomparableK : ℝ := Real.sqrt 2+Real.sqrt 6 +lemma incomparableK_gt_one : 1 < incomparableK := by + have h2 := Real.sq_sqrt (by norm_num : (0:ℝ)≤2) + have hp := Real.sqrt_nonneg 2 + have h6 := Real.sqrt_nonneg 6 + unfold incomparableK + nlinarith + +theorem incomparable_segments (A : Heads ι X) (hinput : A.RadialInput incomparableK) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-(D⁻¹/incomparableK)^2)^k := by + have hD : 0 < D := by linarith [hf.1] + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + have hK : 0 < incomparableK := lt_trans (by norm_num) incomparableK_gt_one + have ht : 0 < D⁻¹/incomparableK := by positivity + have ht1 : D⁻¹/incomparableK < 1 := (div_lt_one hK).mpr (hα1.trans_lt incomparableK_gt_one) + have hρ : 0 ≤ 1-(D⁻¹/incomparableK)^2 := by nlinarith + have hlens : Diamond.UnitLensBound X (2*D⁻¹) (1-(D⁻¹/incomparableK)^2) := by + intro x z hp hm hs + have hh := A.radial_lens hK hinput x z 1 (2*D⁻¹) (by norm_num) (by positivity) hp hm hs + have hdiv : (D⁻¹)^2/incomparableK^2 ≤ 1-‖x‖ := by + apply (div_le_iff₀ (by positivity)).mpr + nlinarith + rw [div_pow] + linarith + have hnorm := Diamond.upper_one_normalization f hf + exact Diamond.backward hα hα1 hρ (by nlinarith [sq_pos_of_pos ht]) hlens k + (fun v => (D*s)⁻¹ • f v) (fun u v => (hnorm u v).1) (fun u v => (hnorm u v).2) + +/-- Component-to-sum finite-codimensional input, exactly at arbitrary unit centers. -/ +def ComponentSumInput (X : Type*) [NormedAddCommGroup X] [NormedSpace ℝ X] : Prop := + ∀ (e : ℝ),0 < e → e ≤ 1/16 → ∀ u : X,‖u‖=1 → + ∃ F : Submodule ℝ X,IsClosed (F : Set X) ∧ FiniteDimensional ℝ (X ⧸ F) ∧ + ∀ y : X,y ∈ F → max ‖u+y‖ ‖u-y‖ ≤ 1+e → ‖y‖ ≤ 17*(2*e)^((1:ℝ)/6) + +theorem component_sum (hinput : ComponentSumInput X) {D s e : ℝ} + (he : 0 < e) (he16 : e ≤ 1/16) (hsmall : 17*(2*e)^((1:ℝ)/6) < 1/(2*D)) + (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + (1+e/2)^k ≤ D := by + have hD : 0 < D := by linarith [hf.1] + have hg : QuotientGain X (1/(2*D)) e := by + intro u hu + obtain ⟨F,hF,hfin,h⟩ := hinput e he he16 u hu + refine ⟨F,hF,hfin,?_⟩ + intro y hy hnorm + by_contra! hn + have hh := h y hy hn.le + linarith + exact Diamond.quotient_transfer (by positivity) he le_rfl hg k f hf + +end PathApplications + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/PathModels.lean b/lean/OAI/Analysis/DiamondDistortion/PathModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3c0cba68dc6b1e4eb6fc1cebed60b47a38ea989 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/PathModels.lean @@ -0,0 +1,333 @@ +import OAI.Analysis.DiamondDistortion.InfimalCost + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace PathModel +open RecursiveModel +abbrev L1 (h : ℕ) := lp (fun _ : Coord h => ℝ) 1 +abbrev L2 (h : ℕ) := lp (fun _ : Coord h => ℝ) 2 + +def branch (h : ℕ) (s : Coord h) : L2 h := ∑ r ∈ ancestors h s,lp.single 2 r (1:ℝ) +@[simp] lemma branch_apply (h : ℕ) (s r : Coord h) : + branch h s r=if r ∈ ancestors h s then 1 else 0 := by + change (lp.evalₗ (𝕜 := ℝ) (fun _ : Coord h => ℝ) 2 r) (branch h s)=_ + rw [branch,map_sum] + simp only [lp.evalₗ_apply,lp.single_apply,Finset.sum_pi_single] +lemma ancestors_card (h : ℕ) (s : Coord h) : (ancestors h s).card ≤ h+1 := by + induction h with + | zero => simp [ancestors] + | succ h ih => + cases s with + | inl u => simp [ancestors] + | inr a => + calc + _ ≤ ((ancestors h a.2).image (fun t => Sum.inr (a.1,t))).card+1 := Finset.card_insert_le _ _ + _ ≤ (ancestors h a.2).card+1 := Nat.add_le_add_right (Finset.card_image_le) _ + _ ≤ _ := by have := ih a.2; omega +lemma branch_norm (h : ℕ) (s : Coord h) : ‖branch h s‖ ≤ (h+1:ℝ) := by + calc + _ ≤ ∑ r ∈ ancestors h s,‖(lp.single 2 r (1:ℝ) : L2 h)‖ := by + unfold branch + exact norm_sum_le (ancestors h s) (fun r => (lp.single 2 r (1:ℝ) : L2 h)) + _ = ((ancestors h s).card:ℝ) := by + simp only [lp.norm_single (by norm_num : (0:ℝ≥0∞) < 2),norm_one,Finset.sum_const, nsmul_eq_mul,mul_one] + _ ≤ _ := by exact_mod_cast ancestors_card h s + +lemma summable_abs {h : ℕ} (μ : L1 h) : Summable (fun s => |μ s|) := by + simpa only [ENNReal.toReal_one,Real.rpow_one,Real.norm_eq_abs] using (lp.memℓp μ).summable (by norm_num : 0 < (1:ℝ≥0∞).toReal) +lemma tsum_abs {h : ℕ} (μ : L1 h) : ∑' s,|μ s|=‖μ‖ := by + simpa only [ENNReal.toReal_one,Real.rpow_one,Real.norm_eq_abs,one_div_one] using (lp.norm_eq_tsum_rpow (by norm_num : 0 < (1:ℝ≥0∞).toReal) μ).symm +lemma path_summable_norm {h : ℕ} (μ : L1 h) : Summable (fun s => ‖μ s • branch h s‖) := by + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ ((summable_abs μ).mul_right (h+1:ℝ)) + intro s + rw [norm_smul,Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_left (branch_norm h s) (abs_nonneg _) +lemma path_summable {h : ℕ} (μ : L1 h) : Summable (fun s => μ s • branch h s) := + (path_summable_norm μ).of_norm + +def path (h : ℕ) : L1 h →L[ℝ] L2 h := + LinearMap.mkContinuous { + toFun μ := ∑' s,μ s • branch h s + map_add' μ ν := by + simp only [lp.coeFn_add,Pi.add_apply,add_smul] + exact (path_summable μ).tsum_add (path_summable ν) + map_smul' c μ := by + simp only [lp.coeFn_smul,Pi.smul_apply,smul_eq_mul,mul_smul] + exact (path_summable μ).tsum_const_smul c } + (h+1:ℝ) (by + intro μ + calc + _ ≤ ∑' s,‖μ s • branch h s‖ := norm_tsum_le_tsum_norm (path_summable_norm μ) + _ ≤ ∑' s,|μ s| * (h+1:ℝ) := (path_summable_norm μ).tsum_le_tsum (fun s => by + rw [norm_smul,Real.norm_eq_abs]; exact mul_le_mul_of_nonneg_left (branch_norm h s) (abs_nonneg _)) ((summable_abs μ).mul_right _) + _ = _ := by rw [tsum_mul_right,tsum_abs]; ring) +lemma path_apply (h : ℕ) (μ : L1 h) (r : Coord h) : + path h μ r=∑' s,if r ∈ ancestors h s then μ s else 0 := by + change (lp.evalCLM ℝ (fun _ : Coord h => ℝ) 2 r) (∑' s,μ s • branch h s)=_ + rw [ContinuousLinearMap.map_tsum _ (path_summable μ)] + simp only [map_smul,lp.evalCLM,LinearMap.mkContinuous_apply,lp.evalₗ_apply,branch_apply,smul_eq_mul,mul_ite,mul_one,mul_zero] +lemma path_coordinate (h : ℕ) (μ : L1 h) (r : Coord h) : |path h μ r| ≤ ‖μ‖ := by + let ev := lp.evalCLM ℝ (fun _ : Coord h => ℝ) 2 r + have hs : Summable (fun s => ev (μ s • branch h s)) := ev.summable (path_summable μ) + have hsn : Summable (fun s => ‖ev (μ s • branch h s)‖) := by + apply Summable.of_nonneg_of_le (fun _ => norm_nonneg _) _ (summable_abs μ) + intro s + change |μ s * branch h s r| ≤ |μ s| + rw [branch_apply] + split_ifs <;> simp + have he : |path h μ r|=‖∑' s,ev (μ s • branch h s)‖ := by + rw [← ContinuousLinearMap.map_tsum ev (path_summable μ)] + rfl + rw [he] + calc + _ ≤ ∑' s,‖ev (μ s • branch h s)‖ := norm_tsum_le_tsum_norm hsn + _ ≤ ∑' s,|μ s| := hsn.tsum_le_tsum (fun s => by + change |μ s * branch h s r| ≤ |μ s| + rw [branch_apply]; split_ifs <;> simp) (summable_abs μ) + _ = _ := tsum_abs μ + +/-- The admissible decompositions use full ℓ² and ℓ¹, and the norm on their + pair is exactly the linear (q=1) or quadratic (q=2) representation cost. -/ +def presentation (q : ℝ≥0∞) [Fact (1 ≤ q)] (h : ℕ) : + InfimalCost.Presentation (WithLp q (L2 h × L1 h)) (L2 h) where + output := { + toFun d := d.fst+path h d.snd + map_add' d e := by simp only [WithLp.add_fst,WithLp.add_snd,map_add]; abel + map_smul' c d := by simp only [WithLp.smul_fst,WithLp.smul_snd,map_smul,smul_add,RingHom.id_apply] } + sectionMap := { + toFun v := WithLp.toLp q (v,0) + map_add' v w := by + apply WithLp.ofLp_injective q + simp only [WithLp.ofLp_add,Prod.mk_add_mk,add_zero] + map_smul' c v := by + apply WithLp.ofLp_injective q + simp only [WithLp.ofLp_smul,RingHom.id_apply,Prod.smul_mk,smul_zero] } + right_inverse v := by simp +@[simp] lemma presentation_output (q : ℝ≥0∞) [Fact (1 ≤ q)] (h : ℕ) + (d : WithLp q (L2 h × L1 h)) : (presentation q h).output d=d.fst+path h d.snd := rfl +@[simp] lemma presentation_section (q : ℝ≥0∞) [Fact (1 ≤ q)] (h : ℕ) (v : L2 h) : + (presentation q h).sectionMap v=WithLp.toLp q (v,0) := rfl + +/-- Literal infimum over all decompositions z=h+Jμ. -/ +def cost (q : ℝ≥0∞) [Fact (1 ≤ q)] (h : ℕ) : Seminorm ℝ (L2 h) := (presentation q h).seminorm +lemma linear_cost_formula (h : ℕ) (v : L2 h) : + cost 1 h v=sInf {r : ℝ | ∃ w : L2 h,∃ μ : L1 h,w+path h μ=v ∧ ‖w‖+‖μ‖=r} := by + rw [cost,(presentation 1 h).eq_sInf] + congr 1 + ext r + constructor + · rintro ⟨d,hd,hr⟩ + exact ⟨d.fst,d.snd,hd,(WithLp.prod_norm_eq_of_L1 d).symm.trans hr⟩ + · rintro ⟨w,μ,hd,hr⟩ + exact ⟨WithLp.toLp 1 (w,μ),hd,(WithLp.prod_norm_eq_of_L1 _).trans hr⟩ +lemma quadratic_cost_formula (h : ℕ) (v : L2 h) : + cost 2 h v=sInf {r : ℝ | ∃ w : L2 h,∃ μ : L1 h,w+path h μ=v ∧ Real.sqrt (‖w‖^2+‖μ‖^2)=r} := by + rw [cost,(presentation 2 h).eq_sInf] + congr 1 + ext r + constructor + · rintro ⟨d,hd,hr⟩ + exact ⟨d.fst,d.snd,hd,(WithLp.prod_norm_eq_of_L2 d).symm.trans hr⟩ + · rintro ⟨w,μ,hd,hr⟩ + exact ⟨WithLp.toLp 2 (w,μ),hd,(WithLp.prod_norm_eq_of_L2 _).trans hr⟩ + +lemma representation_coordinate (q : ℝ≥0∞) [Fact (1 ≤ q)] (h : ℕ) + (d : WithLp q (L2 h × L1 h)) (r : Coord h) : + |(presentation q h).output d r| ≤ ‖d.fst‖+‖d.snd‖ := by + change |d.fst r+path h d.snd r| ≤ _ + exact (abs_add_le _ _).trans (add_le_add + (by simpa only [Real.norm_eq_abs] using lp.norm_apply_le_norm (by norm_num : (2:ℝ≥0∞) ≠ 0) d.fst r) + (path_coordinate h d.snd r)) +lemma linear_coordinate (h : ℕ) (v : L2 h) (r : Coord h) : |v r| ≤ cost 1 h v := by + have hh := (presentation 1 h).bound v (by norm_num : (0:ℝ) ≤ 1) (b := |v r|) (by + intro d hd + rw [← hd,one_mul,WithLp.prod_norm_eq_of_L1] + exact representation_coordinate 1 h d r) + simpa only [one_mul,cost] using hh +lemma quadratic_coordinate (h : ℕ) (v : L2 h) (r : Coord h) : |v r| ≤ Real.sqrt 2*cost 2 h v := by + apply (presentation 2 h).bound v (Real.sqrt_nonneg 2) + intro d hd + rw [← hd] + apply (representation_coordinate 2 h d r).trans + have hs := WithLp.prod_norm_sq_eq_of_L2 d + have hs2 : (Real.sqrt 2)^2=2 := Real.sq_sqrt (by norm_num) + have hnn : 0 ≤ Real.sqrt 2*‖d‖ := mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _) + have hsq : (‖d.fst‖+‖d.snd‖)^2 ≤ (Real.sqrt 2*‖d‖)^2 := by + rw [mul_pow,hs2,hs] + nlinarith [sq_nonneg (‖d.fst‖-‖d.snd‖)] + exact (sq_le_sq₀ (by positivity) hnn).mp hsq + +lemma linear_le_norm (h : ℕ) (v : L2 h) : cost 1 h v ≤ ‖v‖ := by + have hh := (presentation 1 h).le_representation ((presentation 1 h).right_inverse v) + simpa only [cost,presentation_section,WithLp.prod_norm_eq_of_L1,WithLp.fst,WithLp.snd,WithLp.ofLp_toLp,norm_zero,add_zero] using hh +lemma quadratic_le_norm (h : ℕ) (v : L2 h) : cost 2 h v ≤ ‖v‖ := by + have hh := (presentation 2 h).le_representation ((presentation 2 h).right_inverse v) + simpa only [cost,presentation_section,WithLp.prod_norm_eq_of_L2,WithLp.fst,WithLp.snd,WithLp.ofLp_toLp,norm_zero,zero_pow (by decide : 2 ≠ 0),add_zero,Real.sqrt_sq_eq_abs,abs_norm] using hh + +/-- Coordinate finite vectors inherit the same exact full-representation infimum. -/ +def finiteEmbedding (h : ℕ) : Vec h →ₗ[ℝ] L2 h where + toFun := finiteLp 2 + map_add' := finiteLp_add 2 + map_smul' c v := finiteLp_smul 2 c v +def finiteCost (q : ℝ≥0∞) [Fact (1 ≤ q)] (h : ℕ) : Seminorm ℝ (Vec h) := + (cost q h).comp (finiteEmbedding h) + +end PathModel + +namespace RecursiveModel +open scoped ENNReal +/-- The literal outer ℓ² norm of a family of finite component seminorms. -/ +def outerValues (s : ∀ h,Seminorm ℝ (Vec (h+1))) (v : ForestVec) : ℕ →₀ ℝ := + componentValues (fun h => ⟨s h,map_zero (s h)⟩) v +@[simp] lemma outerValues_apply (s : ∀ h,Seminorm ℝ (Vec (h+1))) (v : ForestVec) (h : ℕ) : + outerValues s v h=s h (components v h) := rfl +@[simp] lemma outerValues_zero (s : ∀ h,Seminorm ℝ (Vec (h+1))) : outerValues s 0=0 := componentValues_zero _ +lemma outerValues_nonneg (s : ∀ h,Seminorm ℝ (Vec (h+1))) (v : ForestVec) (h : ℕ) : + 0 ≤ outerValues s v h := apply_nonneg (s h) _ +lemma outerValues_add (s : ∀ h,Seminorm ℝ (Vec (h+1))) (v w : ForestVec) (h : ℕ) : + outerValues s (v+w) h ≤ (outerValues s v+outerValues s w) h := by + simp only [outerValues_apply,map_add,DFinsupp.add_apply,Finsupp.add_apply] + exact map_add_le_add (s h) _ _ +lemma outerValues_neg (s : ∀ h,Seminorm ℝ (Vec (h+1))) (v : ForestVec) : + outerValues s (-v)=outerValues s v := by + ext h + simp only [outerValues_apply,map_neg,DFinsupp.neg_apply,map_neg_eq_map] +lemma outerValues_smul (s : ∀ h,Seminorm ℝ (Vec (h+1))) (t : ℝ) (v : ForestVec) : + outerValues s (t • v)=|t| • outerValues s v := by + ext h + simp only [outerValues_apply,map_smul,DFinsupp.smul_apply,Finsupp.smul_apply,smul_eq_mul,map_smul_eq_mul,Real.norm_eq_abs] + +def outerSeminorm (s : ∀ h,Seminorm ℝ (Vec (h+1))) : Seminorm ℝ ForestVec where + toFun v := aggregate 2 (outerValues s v) + map_zero' := by simp + add_le' v w := + (aggregate_mono 2 _ _ (outerValues_nonneg s _) (outerValues_add s _ _)).trans (aggregate_add 2 _ _) + neg' v := by rw [outerValues_neg] + smul' t v := by rw [outerValues_smul,aggregate_smul,abs_abs,Real.norm_eq_abs] +lemma component_le_outer (s : ∀ h,Seminorm ℝ (Vec (h+1))) (v : ForestVec) (h : ℕ) : + s h (components v h) ≤ outerSeminorm s v := by + exact (le_abs_self _).trans (coordinate_le_aggregate 2 (outerValues s v) h) +end RecursiveModel + +namespace PathModel + +section +open RecursiveModel + +def linearForestSeminorm : Seminorm ℝ ForestVec := outerSeminorm (fun h => finiteCost 1 (h+1)) +def quadraticForestSeminorm : Seminorm ℝ ForestVec := outerSeminorm (fun h => finiteCost 2 (h+1)) +lemma linear_forest_coordinate (v : ForestVec) (i : ForestCoord) : |v i| ≤ linearForestSeminorm v := by + exact (linear_coordinate (i.1+1) (finiteEmbedding _ (components v i.1)) i.2).trans + (component_le_outer (fun h => finiteCost 1 (h+1)) v i.1) +lemma quadratic_forest_coordinate (v : ForestVec) (i : ForestCoord) : + |v i| ≤ Real.sqrt 2*quadraticForestSeminorm v := by + exact (quadratic_coordinate (i.1+1) (finiteEmbedding _ (components v i.1)) i.2).trans + (mul_le_mul_of_nonneg_left (component_le_outer (fun h => finiteCost 2 (h+1)) v i.1) (Real.sqrt_nonneg _)) + +/-- Original component root; this is distinct from a forest component index. -/ +def root : (h : ℕ) → Coord h + | 0 => () + | _+1 => Sum.inl () +lemma root_ancestors (h : ℕ) : ancestors h (root h)={root h} := by cases h <;> rfl +lemma branch_root (h : ℕ) : branch h (root h)=lp.single 2 (root h) (1:ℝ) := by + simp only [branch,root_ancestors,Finset.sum_singleton] +lemma path_single (h : ℕ) [DecidableEq (Coord h)] (s : Coord h) (c : ℝ) : + path h (lp.single 1 s c)=c • branch h s := by + change ∑' t,((lp.single 1 s c : L1 h) t) • branch h t = _ + rw [tsum_eq_single s] + · rw [lp.single_apply_self] + · intro t ht + rw [lp.single_apply_ne (E := fun _ : Coord h => ℝ) 1 s c ht,zero_smul] +@[simp] lemma linear_root (h : ℕ) : cost 1 h (lp.single 2 (root h) (1:ℝ))=1 := by + apply le_antisymm + · exact (linear_le_norm h _).trans_eq (by rw [lp.norm_single (by norm_num : (0:ℝ≥0∞)<2),norm_one]) + · have hh := linear_coordinate h (lp.single 2 (root h) (1:ℝ)) (root h) + simpa only [lp.single_apply_self,abs_one] using hh +@[simp] lemma quadratic_root (h : ℕ) : cost 2 h (lp.single 2 (root h) (1:ℝ))=1/Real.sqrt 2 := by + have hs : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by norm_num) + let e : L2 h := lp.single 2 (root h) 1 + let μ : L1 h := lp.single 1 (root h) 1 + have he : path h μ=e := by rw [path_single,one_smul,branch_root] + let d := WithLp.toLp 2 ((1/2:ℝ) • e,(1/2:ℝ) • μ) + have hd : (presentation 2 h).output d=e := by + change (1/2:ℝ) • e+path h ((1/2:ℝ) • μ)=e + rw [map_smul,he] + module + apply le_antisymm + · have hb := (presentation 2 h).le_representation hd + have hnorm : ‖d‖=1/Real.sqrt 2 := by + dsimp [d] + rw [WithLp.prod_norm_eq_of_L2] + change Real.sqrt (‖(1/2:ℝ) • e‖^2+‖(1/2:ℝ) • μ‖^2)=_ + simp only [norm_smul,Real.norm_eq_abs,e,μ,lp.norm_single (by norm_num : (0:ℝ≥0∞)<2),lp.norm_single (by norm_num : (0:ℝ≥0∞)<1),norm_one,mul_one] + norm_num + exact hb.trans_eq hnorm + · have hh := quadratic_coordinate h e (root h) + simp only [e,lp.single_apply_self,abs_one] at hh + exact (div_le_iff₀ hs).mpr (by simpa only [mul_comm] using hh) +end + +open RecursiveModel PathApplications +/-- Exact path-cost completions on the original finite-height components. -/ +def linearData : CoordinateCompletion.Data ForestCoord where + seminorm := linearForestSeminorm + coordinate_bound i := ⟨1,fun v => by simpa only [one_mul] using linear_forest_coordinate v i⟩ +def quadraticData : CoordinateCompletion.Data ForestCoord where + seminorm := quadraticForestSeminorm + coordinate_bound i := ⟨Real.sqrt 2,fun v => quadratic_forest_coordinate v i⟩ +abbrev LinearSpace := linearData.Space +abbrev QuadraticSpace := quadraticData.Space +def linearHeads : Midpoint.Heads ForestHead LinearSpace := + linearData.heads Subtype.val (fun S => ⟨forestHead S,forestHead_contains S⟩) +def quadraticHeads : Midpoint.Heads ForestHead QuadraticSpace := + quadraticData.heads Subtype.val (fun S => ⟨forestHead S,forestHead_contains S⟩) +lemma linearHeads_commutes : linearHeads.Commutes := linearData.heads_commutes _ _ +lemma quadraticHeads_commutes : quadraticHeads.Commutes := quadraticData.heads_commutes _ _ + +/-- Positive flow and trimming are retained as independent exact intrinsic inputs. -/ +theorem linear_flow_graph (hinput : FlowInput linearHeads (linearC^2)) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/(2*linearC^2) ≤ D^2 ∧ (k:ℝ) ≤ 2*linearC^2*D^2 := + linear_flow linearHeads hinput k f hf +theorem linear_trimming_graph (hinput : FlowInput linearHeads 242) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/484 ≤ D^2 := linear_trimming linearHeads hinput k f hf +theorem linear_clipping_graph (hinput : linearHeads.ParametricInput (1/2) 4) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → LinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)*clippingGamma D/(2*clippingQ D) ≤ D := + linear_clipping linearHeads hinput k f hf +theorem linear_vanishing_graph (hinput : linearHeads.TailVanishing) : + ¬ Diamond.UniformEmbeddings LinearSpace := linearHeads.vanishing_obstruction hinput +theorem linear_vanishing_weak (hinput : linearHeads.TailVanishing) {ε : ℝ} (hε : 0 < ε) : + ∃ ρ : ℝ,0 ≤ ρ ∧ ρ < 1 ∧ + ∀ (x : LinearSpace) (z : ℕ → LinearSpace),Midpoint.WeaklyNull z → (∀ i,ε ≤ ‖z i‖) → + (∀ i,‖x+z i‖ ≤ 1) → (∀ i,‖x-z i‖ ≤ 1) → ‖x‖ ≤ ρ := + linearHeads.vanishing_weak hinput hε + +theorem quadratic_graph (hinput : ArbitraryTailInput quadraticHeads 8) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → QuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/64 ≤ D^2 := quadratic_cost quadraticHeads hinput k f hf +theorem stopped_graph (hinput : StoppedInput quadraticHeads) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → QuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + (k:ℝ) ≤ 144*D^2 := stopped_flow quadraticHeads hinput k f hf +theorem quadratic_component_graph (hinput : ComponentSumInput QuadraticSpace) + {D s e : ℝ} (he : 0 < e) (he16 : e ≤ 1/16) (hsmall : 17*(2*e)^((1:ℝ)/6) < 1/(2*D)) + (k : ℕ) (f : Diamond.Vertex k → QuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + (1+e/2)^k ≤ D := component_sum hinput he he16 hsmall k f hf +end PathModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/RecursiveBounds.lean b/lean/OAI/Analysis/DiamondDistortion/RecursiveBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..43ca1ccb54748a4b7b59b8b14c079294dfef54c5 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/RecursiveBounds.lean @@ -0,0 +1,365 @@ +import OAI.Analysis.DiamondDistortion.UpperFunction + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace RecursiveModel + +section +variable (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) +lemma fullUpper_neg (h : ℕ) (v : Full p h) : + fullUpper p hp h (-v)=((fullUpper p hp h v).2,(fullUpper p hp h v).1) := by + induction h with + | zero => simp only [fullUpper_zero_height,lp.coeFn_neg,Pi.neg_apply,neg_neg] + | succ h ih => + have hP : fullPChildren p hp h (-v)=fullQChildren p hp h v := by + ext i; rw [fullPChildren_apply,fullQChildren_apply,child_neg,ih] + have hQ : fullQChildren p hp h (-v)=fullPChildren p hp h v := by + ext i; rw [fullQChildren_apply,fullPChildren_apply,child_neg,ih] + rw [fullUpper_succ,fullUpper_succ,hP,hQ] + change join (-v (.inl ())) _ _=(_,_) + ext <;> dsimp only [join,Prod.fst,Prod.snd] + · rw [max_comm]; congr 1; ring + · rw [max_comm]; congr 1; ring + +lemma fullUpper_add (h : ℕ) (v w : Full p h) : + (fullUpper p hp h (v+w)).1 ≤ (fullUpper p hp h v).1+(fullUpper p hp h w).1 ∧ + (fullUpper p hp h (v+w)).2 ≤ (fullUpper p hp h v).2+(fullUpper p hp h w).2 := by + induction h with + | zero => + change max (v ()+w ()) 0 ≤ max (v ()) 0+max (w ()) 0 ∧ + max (-(v ()+w ())) 0 ≤ max (-v ()) 0+max (-w ()) 0 + constructor <;> apply max_le + · exact add_le_add (le_max_left _ _) (le_max_left _ _) + · exact add_nonneg (le_max_right _ _) (le_max_right _ _) + · linarith [le_max_left (-v ()) 0,le_max_left (-w ()) 0] + · exact add_nonneg (le_max_right _ _) (le_max_right _ _) + | succ h ih => + have hP : ‖fullPChildren p hp h (v+w)‖ ≤ ‖fullPChildren p hp h v‖+‖fullPChildren p hp h w‖ := by + refine (lp.norm_mono (p_ne_zero p) (y := fullPChildren p hp h v+fullPChildren p hp h w) ?_).trans (norm_add_le _ _) + intro i + simp only [fullPChildren_apply,lp.coeFn_add,Pi.add_apply,Real.norm_eq_abs, + abs_of_nonneg (fullUpper_nonneg p hp h _).1, + abs_of_nonneg (add_nonneg (fullUpper_nonneg p hp h _).1 (fullUpper_nonneg p hp h _).1)] + rw [child_add p hp] + exact (ih _ _).1 + have hQ : ‖fullQChildren p hp h (v+w)‖ ≤ ‖fullQChildren p hp h v‖+‖fullQChildren p hp h w‖ := by + refine (lp.norm_mono (p_ne_zero p) (y := fullQChildren p hp h v+fullQChildren p hp h w) ?_).trans (norm_add_le _ _) + intro i + simp only [fullQChildren_apply,lp.coeFn_add,Pi.add_apply,Real.norm_eq_abs, + abs_of_nonneg (fullUpper_nonneg p hp h _).2, + abs_of_nonneg (add_nonneg (fullUpper_nonneg p hp h _).2 (fullUpper_nonneg p hp h _).2)] + rw [child_add p hp] + exact (ih _ _).2 + rw [fullUpper_succ,fullUpper_succ,fullUpper_succ] + have hm := join_mono (r := v (.inl ())+w (.inl ())) hP hQ + have ha := join_add (v (.inl ())) (w (.inl ())) ‖fullPChildren p hp h v‖ ‖fullQChildren p hp h v‖ + ‖fullPChildren p hp h w‖ ‖fullQChildren p hp h w‖ + exact ⟨hm.1.trans ha.1,hm.2.trans ha.2⟩ + +lemma fullUpper_smul_nonneg (h : ℕ) (v : Full p h) (t : ℝ) (ht : 0 ≤ t) : + fullUpper p hp h (t • v)=t • fullUpper p hp h v := by + induction h with + | zero => + change (max (t*v ()) 0,max (-(t*v ())) 0)=(t*max (v ()) 0,t*max (-v ()) 0) + rw [mul_max_of_nonneg _ _ ht,mul_max_of_nonneg _ _ ht,mul_zero,mul_neg] + | succ h ih => + have hP : fullPChildren p hp h (t • v)=t • fullPChildren p hp h v := by + ext i + change (fullUpper p hp h (child p hp h (t • v) i)).1=t*(fullUpper p hp h (child p hp h v i)).1 + rw [child_smul,ih]; rfl + have hQ : fullQChildren p hp h (t • v)=t • fullQChildren p hp h v := by + ext i + change (fullUpper p hp h (child p hp h (t • v) i)).2=t*(fullUpper p hp h (child p hp h v i)).2 + rw [child_smul,ih]; rfl + rw [fullUpper_succ,fullUpper_succ,hP,hQ,norm_smul,norm_smul,Real.norm_eq_abs,abs_of_nonneg ht] + exact join_smul _ _ _ _ ht + +def fullNu (h : ℕ) (v : Full p h) : ℝ := (fullUpper p hp h v).1+(fullUpper p hp h v).2 +lemma fullNu_nonneg (h : ℕ) (v : Full p h) : 0 ≤ fullNu p hp h v := + add_nonneg (fullUpper_nonneg p hp h v).1 (fullUpper_nonneg p hp h v).2 +@[simp] lemma fullNu_zero (h : ℕ) : fullNu p hp h 0=0 := by simp [fullNu] +lemma fullNu_add (h : ℕ) (v w : Full p h) : + fullNu p hp h (v+w) ≤ fullNu p hp h v+fullNu p hp h w := by + have hh := fullUpper_add p hp h v w + dsimp [fullNu] + linarith [hh.1,hh.2] +lemma fullNu_neg (h : ℕ) (v : Full p h) : fullNu p hp h (-v)=fullNu p hp h v := by + simp only [fullNu,fullUpper_neg,add_comm] +lemma fullNu_smul (h : ℕ) (v : Full p h) (t : ℝ) : + fullNu p hp h (t • v)=|t| * fullNu p hp h v := by + rcases le_total 0 t with ht|ht + · simp only [fullNu,fullUpper_smul_nonneg p hp h v t ht,Prod.smul_fst,Prod.smul_snd,smul_eq_mul,abs_of_nonneg ht] + ring + · have he : t • v=-((-t) • v) := by module + rw [he,fullNu_neg] + simp only [fullNu,fullUpper_smul_nonneg p hp h v (-t) (neg_nonneg.mpr ht), + Prod.smul_fst,Prod.smul_snd,smul_eq_mul,abs_of_nonpos ht] + ring + +def fullNuSeminorm (h : ℕ) : Seminorm ℝ (Full p h) where + toFun := fullNu p hp h + map_zero' := fullNu_zero p hp h + add_le' := fullNu_add p hp h + neg' := fullNu_neg p hp h + smul' t v := by simpa only [Real.norm_eq_abs] using fullNu_smul p hp h v t + +lemma fullNu_upper (h : ℕ) (v : Full p h) : fullNu p hp h v ≤ (2*3^h)*‖v‖ := by + have hh := fullUpper_bound p hp h v + dsimp [fullNu] + linarith [hh.1,hh.2] + +lemma full_leaf_norm (v : Full p 0) : ‖v‖=|v ()| := by + have he : v=lp.single p () (v ()) := by ext i; cases i; simp + rw [he,lp.norm_single (pos_iff_ne_zero.mpr (p_ne_zero p))] + rfl +lemma rootZero_norm (h : ℕ) (v : Full p (h+1)) (hv : v (.inl ())=0) : + ‖v‖=‖children p hp h v‖ := by + rw [lp.norm_eq_tsum_rpow hp,lp.norm_eq_tsum_rpow hp] + congr 1 + rw [Summable.tsum_sum ((v.property.summable hp).comp_injective Sum.inl_injective) + ((v.property.summable hp).comp_injective Sum.inr_injective)] + simp only [hv,norm_zero,Real.zero_rpow (ne_of_gt hp),tsum_zero,zero_add] + simp_rw [children_apply,child_sum] + exact (child_summable p hp h v).tsum_prod +lemma root_children_norm (h : ℕ) (v : Full p (h+1)) : + ‖v‖ ≤ |v (.inl ())|+‖children p hp h v‖ := by + let r : Full p (h+1) := lp.single p (Sum.inl () : Coord (h+1)) (v (.inl ())) + have hr : ‖r‖=|v (.inl ())| := lp.norm_single (pos_iff_ne_zero.mpr (p_ne_zero p)) _ _ + have hz : (v-r) (.inl ())=0 := by simp [r] + have hc : children p hp h (v-r)=children p hp h v := by + ext i s + change v (.inr (i,s))-r (.inr (i,s))=v (.inr (i,s)) + simp [r] + have hh := norm_add_le r (v-r) + rw [add_sub_cancel,hr,rootZero_norm p hp h (v-r) hz,hc] at hh + exact hh + +lemma fullNu_lower (h : ℕ) (v : Full p h) : ‖v‖ ≤ (h+1:ℝ)*fullNu p hp h v := by + induction h with + | zero => + rw [full_leaf_norm p] + norm_num only [Nat.cast_zero,zero_add,one_mul] + change |v ()| ≤ max (v ()) 0+max (-v ()) 0 + rw [abs_le]; constructor <;> linarith [le_max_left (v ()) 0,le_max_right (v ()) 0,le_max_left (-v ()) 0,le_max_right (-v ()) 0] + | succ h ih => + let P := fullPChildren p hp h v + let Q := fullQChildren p hp h v + have hl : ‖children p hp h v‖ ≤ (h+1:ℝ)*‖P+Q‖ := by + calc + _ ≤ ‖(h+1:ℝ) • (P+Q)‖ := lp.norm_mono (p_ne_zero p) (fun i => by + have hh := ih (child p hp h v i) + change ‖child p hp h v i‖ ≤ ‖(h+1:ℝ)*fullNu p hp h (child p hp h v i)‖ + rw [Real.norm_eq_abs,abs_of_nonneg (mul_nonneg (by positivity) (fullNu_nonneg p hp h _))] + exact hh) + _ = _ := by rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg (by positivity : (0:ℝ) ≤ h+1)] + have hchild : ‖children p hp h v‖ ≤ (h+1:ℝ)*fullNu p hp (h+1) v := by + refine hl.trans ((mul_le_mul_of_nonneg_left (norm_add_le P Q) (by positivity)).trans ?_) + apply mul_le_mul_of_nonneg_left _ (by positivity) + change ‖P‖+‖Q‖ ≤ (join _ ‖P‖ ‖Q‖).1+(join _ ‖P‖ ‖Q‖).2 + exact add_le_add (le_max_left _ _) (le_max_right _ _) + have hroot : |v (.inl ())| ≤ fullNu p hp (h+1) v := + join_root_bound _ _ _ (norm_nonneg P) (norm_nonneg Q) + have hh := root_children_norm p hp h v + push_cast + nlinarith +end + +lemma join_difference (r a b : ℝ) : (join r a b).1-(join r a b).2=r := by + dsimp [join] + by_cases h : a ≤ r+b + · rw [max_eq_right h,max_eq_right (by linarith : a-r ≤ b)] + ring + · rw [max_eq_left (le_of_not_ge h),max_eq_left (by linarith : b ≤ a-r)] + ring +lemma join_least {r a b P Q : ℝ} (hP : a ≤ P) (hQ : b ≤ Q) (hdiff : P-Q=r) : + (join r a b).1 ≤ P ∧ (join r a b).2 ≤ Q := by + constructor <;> apply max_le <;> linarith + +def fullRoot : (h : ℕ) → Coord h + | 0 => () + | _+1 => Sum.inl () +variable (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) +lemma fullUpper_difference (h : ℕ) (v : Full p h) : + (fullUpper p hp h v).1-(fullUpper p hp h v).2=v (fullRoot h) := by + cases h with + | zero => + have hh := join_difference (v ()) 0 0 + simpa only [join,add_zero,zero_sub,max_comm,fullUpper_zero_height,fullRoot] using hh + | succ h => exact join_difference _ _ _ + +/-- The complete least upper arrays, including every non-root coordinate. -/ +def fullArray : (h : ℕ) → Full p h → Coord h → ℝ × ℝ + | 0,v,_ => fullUpper p hp 0 v + | h+1,v,.inl _ => fullUpper p hp (h+1) v + | h+1,v,.inr (i,s) => fullArray h (child p hp h v i) s +lemma fullArray_root (h : ℕ) (v : Full p h) : fullArray p hp h v (fullRoot h)=fullUpper p hp h v := by + cases h <;> rfl +lemma fullArray_nonneg_diff (h : ℕ) (v : Full p h) (s : Coord h) : + 0 ≤ (fullArray p hp h v s).1 ∧ 0 ≤ (fullArray p hp h v s).2 ∧ + (fullArray p hp h v s).1-(fullArray p hp h v s).2=v s := by + induction h with + | zero => exact ⟨(fullUpper_nonneg p hp 0 v).1,(fullUpper_nonneg p hp 0 v).2,fullUpper_difference p hp 0 v⟩ + | succ h ih => + cases s with + | inl u => exact ⟨(fullUpper_nonneg p hp (h+1) v).1,(fullUpper_nonneg p hp (h+1) v).2,fullUpper_difference p hp (h+1) v⟩ + | inr q => exact ih (child p hp h v q.1) q.2 + +/-- Exact upper-array constraints: nonnegative values, coordinate difference v, + and each of the two arrays dominating the countable ℓp norm of its children. + At leaves the child norm is zero. -/ +def FullAdmissible : (h : ℕ) → Full p h → (Coord h → ℝ × ℝ) → Prop + | 0,v,A => 0 ≤ (A ()).1 ∧ 0 ≤ (A ()).2 ∧ (A ()).1-(A ()).2=v () + | h+1,v,A => + (0 ≤ (A (.inl ())).1 ∧ 0 ≤ (A (.inl ())).2 ∧ (A (.inl ())).1-(A (.inl ())).2=v (.inl ())) ∧ + (∃ a b : lp (fun _ : ℕ => ℝ) p, + (∀ i,a i=(A (.inr (i,fullRoot h))).1) ∧ (∀ i,b i=(A (.inr (i,fullRoot h))).2) ∧ + ‖a‖ ≤ (A (.inl ())).1 ∧ ‖b‖ ≤ (A (.inl ())).2) ∧ + ∀ i,FullAdmissible h (child p hp h v i) (fun s => A (.inr (i,s))) +lemma fullAdmissible_root (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) {v : Full p h} {A : Coord h → ℝ × ℝ} + (hA : FullAdmissible p hp h v A) : + 0 ≤ (A (fullRoot h)).1 ∧ 0 ≤ (A (fullRoot h)).2 ∧ + (A (fullRoot h)).1-(A (fullRoot h)).2=v (fullRoot h) := by + cases h with + | zero => exact hA + | succ h => exact hA.1 +lemma fullArray_admissible (h : ℕ) (v : Full p h) : + FullAdmissible p hp h v (fullArray p hp h v) := by + induction h with + | zero => exact fullArray_nonneg_diff p hp 0 v () + | succ h ih => + refine ⟨fullArray_nonneg_diff p hp (h+1) v (.inl ()),?_,fun i => ih (child p hp h v i)⟩ + refine ⟨fullPChildren p hp h v,fullQChildren p hp h v,?_,?_,le_max_left _ _,le_max_right _ _⟩ + · intro i + change (fullUpper p hp h (child p hp h v i)).1=(fullArray p hp h (child p hp h v i) (fullRoot h)).1 + rw [fullArray_root] + · intro i + change (fullUpper p hp h (child p hp h v i)).2=(fullArray p hp h (child p hp h v i) (fullRoot h)).2 + rw [fullArray_root] +lemma fullUpper_least (h : ℕ) {v : Full p h} {A : Coord h → ℝ × ℝ} + (hA : FullAdmissible p hp h v A) : + (fullUpper p hp h v).1 ≤ (A (fullRoot h)).1 ∧ + (fullUpper p hp h v).2 ≤ (A (fullRoot h)).2 := by + induction h with + | zero => + have hn := fullAdmissible_root p hp 0 hA + change max (v ()) 0 ≤ (A ()).1 ∧ max (-v ()) 0 ≤ (A ()).2 + constructor <;> apply max_le <;> linarith [hn.1,hn.2.1,hn.2.2] + | succ h ih => + obtain ⟨hr,⟨a,b,ha,hb,hna,hnb⟩,hc⟩ := hA + have hP : ‖fullPChildren p hp h v‖ ≤ ‖a‖ := by + apply lp.norm_mono (p_ne_zero p) + intro i + rw [fullPChildren_apply,Real.norm_eq_abs,abs_of_nonneg (fullUpper_nonneg p hp h _).1, + ha i,Real.norm_eq_abs,abs_of_nonneg (fullAdmissible_root p hp h (hc i)).1] + exact (ih (hc i)).1 + have hQ : ‖fullQChildren p hp h v‖ ≤ ‖b‖ := by + apply lp.norm_mono (p_ne_zero p) + intro i + rw [fullQChildren_apply,Real.norm_eq_abs,abs_of_nonneg (fullUpper_nonneg p hp h _).2, + hb i,Real.norm_eq_abs,abs_of_nonneg (fullAdmissible_root p hp h (hc i)).2.1] + exact (ih (hc i)).2 + exact join_least (hP.trans hna) (hQ.trans hnb) hr.2.2 +lemma fullArray_least (h : ℕ) {v : Full p h} {A : Coord h → ℝ × ℝ} + (hA : FullAdmissible p hp h v A) (s : Coord h) : + (fullArray p hp h v s).1 ≤ (A s).1 ∧ (fullArray p hp h v s).2 ≤ (A s).2 := by + induction h with + | zero => exact fullUpper_least p hp 0 hA + | succ h ih => + cases s with + | inl u => exact fullUpper_least p hp (h+1) hA + | inr q => exact ih (hA.2.2 q.1) q.2 +end RecursiveModel + +namespace Midpoint +namespace Heads +variable {E F ι : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [NormedAddCommGroup F] [NormedSpace ℝ F] +def transport (H : Heads ι E) (e : E ≃ₗᵢ[ℝ] F) : Heads ι F where + projection i := e.toContinuousLinearEquiv.toContinuousLinearMap.comp + ((H.projection i).comp e.symm.toContinuousLinearEquiv.toContinuousLinearMap) + idempotent i x := by + simp only [ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + LinearIsometryEquiv.coe_toContinuousLinearEquiv,LinearIsometryEquiv.symm_apply_apply,H.idempotent] + finite i := by + let P := H.projection i + let e' := e.toLinearEquiv.toLinearMap + let Q : F →ₗ[ℝ] F := e'.comp (P.toLinearMap.comp e.symm.toLinearEquiv.toLinearMap) + have : FiniteDimensional ℝ (LinearMap.range P.toLinearMap) := H.finite i + have : FiniteDimensional ℝ ((LinearMap.range P.toLinearMap).map e') := Module.Finite.map _ _ + change FiniteDimensional ℝ (LinearMap.range Q) + apply Submodule.finiteDimensional_of_le (S₂ := (LinearMap.range P.toLinearMap).map e') + rintro y ⟨x,rfl⟩ + exact ⟨P (e.symm x),⟨e.symm x,rfl⟩,rfl⟩ + approximation x η hη := by + obtain ⟨i,p,hp,hclose⟩ := H.approximation (e.symm x) η hη + refine ⟨i,e p,?_,?_⟩ + · simp only [ContinuousLinearMap.comp_apply,ContinuousLinearEquiv.coe_coe, + LinearIsometryEquiv.coe_toContinuousLinearEquiv,LinearIsometryEquiv.symm_apply_apply,hp] + · have he : x-e p=e (e.symm x-p) := by simp + rw [he,e.norm_map] + exact hclose +lemma transport_projection (H : Heads ι E) (e : E ≃ₗᵢ[ℝ] F) (i : ι) (x : F) : + (H.transport e).projection i x=e (H.projection i (e.symm x)) := rfl +end Heads + +end Midpoint + +namespace RecursiveModel +lemma exponent_ne_top (h : ℕ) : exponent h ≠ ⊤ := by + simp only [exponent,ne_eq,ENNReal.add_eq_top,ENNReal.one_ne_top,ENNReal.inv_eq_top,false_or] + positivity +lemma exponent_real_pos (h : ℕ) : 0 < (exponent h).toReal := + ENNReal.toReal_pos (p_ne_zero (exponent h)) (exponent_ne_top h) +def fullData (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) : EquivalentNorm.Data (Full p h) where + seminorm := fullNuSeminorm p hp h + lowerConstant := h+1 + upperConstant := 2*3^h + lower := fullNu_lower p hp h + upper := fullNu_upper p hp h +abbrev VectorComponent (h : ℕ) := (fullData (exponent h) (exponent_real_pos h) (h+1)).Space + +abbrev FullVectorSpace := lp VectorComponent 2 + +def fullVectorEmbedding : ForestVec →ₗ[ℝ] FullVectorSpace := + outerEmbedding (fun h => (fullData (exponent h) (exponent_real_pos h) (h+1)).coordinateEmbedding) +lemma fullVectorEmbedding_norm (v : ForestVec) : ‖fullVectorEmbedding v‖=vectorSeminorm v := by + change ‖fullVectorEmbedding v‖=‖finiteLp 2 (vectorNormValues v)‖ + have he (h : ℕ) : ‖fullVectorEmbedding v h‖=‖finiteLp 2 (vectorNormValues v) h‖ := by + change fullNu (exponent h) (exponent_real_pos h) (h+1) (finiteLp (exponent h) (components v h))=|nu (exponent h) (h+1) (components v h)| + rw [abs_of_nonneg (nu_nonneg _ _ _)] + unfold fullNu nu + rw [fullUpper_finiteLp] + exact le_antisymm (lp.norm_mono (by norm_num) (fun h => (he h).le)) + (lp.norm_mono (by norm_num) (fun h => (he h).ge)) +lemma fullVectorEmbedding_dense : DenseRange fullVectorEmbedding := + outerEmbedding_dense _ (fun h => (fullData (exponent h) (exponent_real_pos h) (h+1)).coordinateEmbedding_dense (exponent_ne_top h)) +/-- Exact full-model identification, preserving every finite coordinate. -/ +def fullVectorEquiv : VectorSpace ≃ₗᵢ[ℝ] FullVectorSpace := + vectorData.completionEquiv fullVectorEmbedding fullVectorEmbedding_norm fullVectorEmbedding_dense +lemma fullVectorEquiv_embedding (v : ForestVec) : + fullVectorEquiv (vectorData.embedding v)=fullVectorEmbedding v := vectorData.completionMap_coe _ _ _ +def fullVectorHeads : Midpoint.Heads ForestHead FullVectorSpace := vectorHeads.transport fullVectorEquiv +open RecursiveApplications +theorem full_sixth_graph (hinput : SixthInput fullVectorHeads) {D s : ℝ} (k : ℕ) + (f : Diamond.Vertex k → FullVectorSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (q6 D⁻¹)^k := sixth_depth fullVectorHeads hinput k f hf +theorem full_cubic_graph (hinput : CubicInput fullVectorHeads) {D s : ℝ} (k : ℕ) + (f : Diamond.Vertex k → FullVectorSpace) (hf : Diamond.HasDistortion k f D s) : + 1 ≤ D*(theta D⁻¹)^k := cubic_depth fullVectorHeads hinput k f hf +end RecursiveModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/RecursiveLenses.lean b/lean/OAI/Analysis/DiamondDistortion/RecursiveLenses.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb7e034d7fc70aac825093795fdbbf8afaa8f1db --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/RecursiveLenses.lean @@ -0,0 +1,257 @@ +import OAI.Analysis.DiamondDistortion.Backward + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace RecursiveApplications +open Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +def c6 : ℝ := 2*Real.exp (-(Real.exp 1-1))/(4:ℝ)^6 +def c3 : ℝ := (6*Real.exp 1)⁻¹^3 + +def q6 (ε : ℝ) : ℝ := Real.sqrt (1-c6*ε^6/512) +def theta (ε : ℝ) : ℝ := Real.sqrt (1-c3*ε^3/(2*Real.sqrt 2)) + +lemma c6_pos : 0 < c6 := by unfold c6; positivity +lemma c6_le_one : c6 ≤ 1 := by + have he : 1 ≤ Real.exp 1 := Real.one_le_exp (by norm_num) + have hl : Real.exp (-(Real.exp 1-1)) ≤ 1 := Real.exp_le_one_iff.mpr (by linarith) + simp only [neg_sub] at hl + unfold c6 + norm_num + linarith +lemma c3_pos : 0 < c3 := by unfold c3; positivity +lemma c3_le_one : c3 ≤ 1 := by + have he : 1 ≤ Real.exp 1 := Real.one_le_exp (by norm_num) + have hi : (6*Real.exp 1)⁻¹ ≤ 1 := (inv_le_one₀ (by positivity)).mpr (by linarith) + exact pow_le_one₀ (by positivity) hi + +/-- Polynomial form of the homogeneous power input, used only as an intermediate + algebraic rewrite of the displayed sixth and cubic estimates. -/ +def PowerInput (A : Heads ι X) (n m : ℕ) (c : ℝ) : Prop := + ∀ (H : ι) (p y : X) (R : ℝ),A.projection H p=p → A.projection H y=0 → + 0 < R → ‖p+y‖ ≤ R → ‖p-y‖ ≤ R → + R^m*‖p‖^2+c*‖y‖^n ≤ R^(m+2) + +lemma power_lens (A : Heads ι X) {n m : ℕ} {c ε : ℝ} (hc : 0 ≤ c) (hε : 0 < ε) + (hinput : PowerInput A n m c) : + Diamond.UnitLensBound X ε (Real.sqrt (1-c*(ε/2)^n)) := by + intro x z hp hm hs + have hh := positive_limit_le + (fun η => (1+2*η)^m*(max (‖x‖-η) 0)^2+c*(max (ε/2-η) 0)^n) + (fun η => (1+2*η)^(m+2)) (by fun_prop) (by fun_prop) (fun η hη => by + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.pure_pair z hη hp hm hs + have h := hinput H p y (1+2*η) hP hY (by positivity) hpR hmR + have hp' := (sq_le_sq₀ (le_max_right _ _) (norm_nonneg _)).mpr + (max_le hpL (norm_nonneg _)) + have hy' := pow_le_pow_left₀ (le_max_right (ε/2-η) 0) + (max_le hyL (norm_nonneg y)) n + exact (add_le_add + (mul_le_mul_of_nonneg_left hp' (by positivity : 0 ≤ (1+2*η)^m)) + (mul_le_mul_of_nonneg_left hy' hc)).trans h) + simp only [mul_zero,add_zero,sub_zero,one_pow,one_mul, + max_eq_left (norm_nonneg x),max_eq_left (half_pos hε).le] at hh + have hrad : 0 ≤ 1-c*(ε/2)^n := by nlinarith [sq_nonneg ‖x‖] + exact (Real.le_sqrt (norm_nonneg _) hrad).mpr (by linarith) + +/-- The exact finite-head sixth input. The S=0 convention is represented by + real division, for which the entire right side is zero when S=0. -/ +def SixthInput (A : Heads ι X) : Prop := + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → + let S := ‖p+y‖^2+‖p-y‖^2 + c6*‖y‖^6/S^2 ≤ S-2*‖p‖^2 + +lemma sixth_to_power (A : Heads ι X) (hinput : SixthInput A) : PowerInput A 6 4 (c6/8) := by + intro H p y R hP hY hR hp hm + let S := ‖p+y‖^2+‖p-y‖^2 + have hS : 0 ≤ S := by dsimp [S]; positivity + have hcap : S ≤ 2*R^2 := by + have hp2 := (sq_le_sq₀ (norm_nonneg _) hR.le).mpr hp + have hm2 := (sq_le_sq₀ (norm_nonneg _) hR.le).mpr hm + dsimp [S] + linarith + by_cases hzero : S=0 + · have hplus : ‖p+y‖=0 := by + have he : ‖p+y‖^2+‖p-y‖^2=0 := hzero + nlinarith [sq_nonneg ‖p-y‖,norm_nonneg (p+y)] + have hminus : ‖p-y‖=0 := by + have he : ‖p+y‖^2+‖p-y‖^2=0 := hzero + nlinarith [sq_nonneg ‖p+y‖,norm_nonneg (p-y)] + have hp0 := Diamond.norm_center_le (le_of_eq hplus) (le_of_eq hminus) + have hy0 := Diamond.norm_deviation_le (le_of_eq hplus) (le_of_eq hminus) + have hpn : ‖p‖=0 := le_antisymm hp0 (norm_nonneg _) + have hyn : ‖y‖=0 := le_antisymm hy0 (norm_nonneg _) + rw [hpn,hyn] + simpa using (pow_nonneg hR.le 6) + have hSpos : 0 < S := lt_of_le_of_ne hS (Ne.symm hzero) + have hh := hinput H p y hP hY + change c6*‖y‖^6/S^2 ≤ S-2*‖p‖^2 at hh + have henergy : c6*‖y‖^6 ≤ (S-2*‖p‖^2)*S^2 := + (div_le_iff₀ (sq_pos_of_pos hSpos)).mp hh + have hdef : 0 ≤ S-2*‖p‖^2 := + (by have := c6_pos; positivity : 0 ≤ c6*‖y‖^6/S^2).trans hh + have hS2 : S^2 ≤ (2*R^2)^2 := (sq_le_sq₀ hS (by positivity)).mpr hcap + have hmul := mul_le_mul_of_nonneg_left hS2 hdef + have hmul2 := mul_le_mul_of_nonneg_right + (show S-2*‖p‖^2 ≤ 2*R^2-2*‖p‖^2 by linarith) (sq_nonneg (2*R^2)) + have hfin := henergy.trans (hmul.trans hmul2) + norm_num + nlinarith only [hfin] + +lemma q6_range {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) : 0 ≤ q6 ε ∧ q6 ε < 1 := by + have hp : 0 < c6*ε^6/512 := by have := c6_pos; positivity + have hpow : ε^6 ≤ 1 := pow_le_one₀ hε.le hε1 + have hl : c6*ε^6 ≤ 1 := (mul_le_of_le_one_left (by positivity) c6_le_one).trans hpow + have hrad : 0 ≤ 1-c6*ε^6/512 := by linarith + have hsq := Real.sq_sqrt hrad + constructor + · exact Real.sqrt_nonneg _ + · unfold q6 + nlinarith [Real.sqrt_nonneg (1-c6*ε^6/512)] + +theorem sixth_lens (A : Heads ι X) (hinput : SixthInput A) {ε : ℝ} (hε : 0 < ε) + (_hε1 : ε ≤ 1) : Diamond.UnitLensBound X ε (q6 ε) := by + have h := power_lens A (show 0 ≤ c6/8 by have := c6_pos; positivity) hε (sixth_to_power A hinput) + have he : 1-(c6/8)*(ε/2)^6=1-c6*ε^6/512 := by ring + simpa only [he,q6] using h + +theorem sixth_depth (A : Heads ι X) (hinput : SixthInput A) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (q6 D⁻¹)^k := by + have hD : 0 < D := lt_of_lt_of_le (by norm_num) hf.1 + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + have hlens : Diamond.UnitLensBound X (2*D⁻¹) (q6 D⁻¹) := by + intro x z hp hm hs + exact sixth_lens A hinput hα hα1 x z hp hm + (fun i j hij => (by linarith : D⁻¹ ≤ 2*D⁻¹).trans (hs i j hij)) + have hnorm := Diamond.upper_one_normalization f hf + obtain ⟨hq,hq1⟩ := q6_range hα hα1 + exact Diamond.backward hα hα1 hq hq1 hlens k (fun v => (D*s)⁻¹ • f v) + (fun u v => (hnorm u v).1) (fun u v => (hnorm u v).2) + +/-- Exact finite-head cubic inequality, with its positive radius denominator. -/ +def CubicInput (A : Heads ι X) : Prop := + ∀ (H : ι) (p y : X) (R : ℝ),A.projection H p=p → A.projection H y=0 → + 0 < R → ‖p+y‖ ≤ R → ‖p-y‖ ≤ R → + ‖p‖^2+c3/(2*Real.sqrt 2*R)*‖y‖^3 ≤ R^2 + +lemma cubic_to_power (A : Heads ι X) (hinput : CubicInput A) : + PowerInput A 3 1 (c3/(2*Real.sqrt 2)) := by + intro H p y R hP hY hR hp hm + have h := mul_le_mul_of_nonneg_left (hinput H p y R hP hY hR hp hm) hR.le + have he : R*(‖p‖^2+c3/(2*Real.sqrt 2*R)*‖y‖^3)= + R*‖p‖^2+c3/(2*Real.sqrt 2)*‖y‖^3 := by field_simp + rw [he] at h + simpa only [pow_one,show (1+2:ℕ)=3 from rfl,show R*R^2=R^3 by ring] using h + +lemma theta_range {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) : 0 ≤ theta ε ∧ theta ε < 1 := by + have hsqrt : 1 ≤ Real.sqrt 2 := (Real.le_sqrt (by norm_num) (by norm_num)).mpr (by norm_num) + have hp : 0 < c3*ε^3/(2*Real.sqrt 2) := by have := c3_pos; positivity + have hpow : ε^3 ≤ 1 := pow_le_one₀ hε.le hε1 + have hl : c3*ε^3 ≤ 1 := (mul_le_of_le_one_left (by positivity) c3_le_one).trans hpow + have hratio : c3*ε^3/(2*Real.sqrt 2) ≤ 1 := + (div_le_one₀ (by positivity)).mpr (by linarith) + have hrad : 0 ≤ 1-c3*ε^3/(2*Real.sqrt 2) := by linarith + have hsq := Real.sq_sqrt hrad + constructor + · exact Real.sqrt_nonneg _ + · unfold theta + nlinarith [Real.sqrt_nonneg (1-c3*ε^3/(2*Real.sqrt 2))] + +/-- The cubic graph application can also use finite-dimensional paired tails + directly; dual separability is unnecessary for this stronger transfer from + the same displayed pure-head estimate. The weak-null clause is proved below. -/ +theorem cubic_depth (A : Heads ι X) (hinput : CubicInput A) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + 1 ≤ D*(theta D⁻¹)^k := by + have hD : 0 < D := lt_of_lt_of_le (by norm_num) hf.1 + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + have hpow := power_lens A (show 0 ≤ c3/(2*Real.sqrt 2) by have := c3_pos; positivity) + (show 0 < 2*D⁻¹ by positivity) (cubic_to_power A hinput) + have he : 1-c3/(2*Real.sqrt 2)*(2*D⁻¹/2)^3=1-c3*(D⁻¹)^3/(2*Real.sqrt 2) := by ring + have hlens : Diamond.UnitLensBound X (2*D⁻¹) (theta D⁻¹) := by simpa only [he,theta] using hpow + have hnorm := Diamond.upper_one_normalization f hf + obtain ⟨hθ,hθ1⟩ := theta_range hα hα1 + have h := Diamond.backward hα hα1 hθ hθ1 hlens k (fun v => (D*s)⁻¹ • f v) + (fun u v => (hnorm u v).1) (fun u v => (hnorm u v).2) + have hh := mul_le_mul_of_nonneg_left h hD.le + simpa only [mul_inv_cancel₀ hD.ne'] using hh + +def ZeroRootInput (A : Heads ι X) : Prop := + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → y ≠ 0 → + ‖p‖+‖y‖^3/(8*(2*‖p‖+‖y‖)^2) ≤ (‖p+y‖+‖p-y‖)/2 + +lemma zero_root_parent (A : Heads ι X) (hinput : ZeroRootInput A) + {α R : ℝ} (hα : 0 < α) (hα1 : α ≤ 1) (_hR : 0 ≤ R) (hR1 : R ≤ 1) + {x : X} (z : ℕ → X) (hp : ∀ i,‖x+z i‖ ≤ R) (hm : ∀ i,‖x-z i‖ ≤ R) + (hs : ∀ i j,i ≠ j → 2*α ≤ ‖z i-z j‖) : ‖x‖ ≤ R-α^3/4608 := by + let c : ℝ := α^3/2304 + let η : ℝ := c/6 + have hc : 0 < c := by dsimp [c]; positivity + have hη : 0 < η := by dsimp [η]; positivity + have hα2 : α^2 ≤ 1 := pow_le_one₀ hα.le hα1 + have hα3 : α^3 ≤ α := by nlinarith [mul_le_mul_of_nonneg_left hα2 hα.le] + have hηα : η ≤ α/2 := by dsimp [η,c]; nlinarith + have hηhalf : η ≤ 1/2 := hηα.trans (by linarith) + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.pure_pair z hη hp hm hs + have hy : α/2 ≤ ‖y‖ := by linarith + have hypos : 0 < ‖y‖ := (half_pos hα).trans_le hy + have hy0 : y ≠ 0 := norm_pos_iff.mp hypos + have hp2 : ‖p‖ ≤ 2 := (Diamond.norm_center_le hpR hmR).trans (by linarith) + have hy2 : ‖y‖ ≤ 2 := (Diamond.norm_deviation_le hpR hmR).trans (by linarith) + have hdenpos : 0 < 8*(2*‖p‖+‖y‖)^2 := by positivity + have hden : 8*(2*‖p‖+‖y‖)^2 ≤ 288 := by + have hsum : 2*‖p‖+‖y‖ ≤ 6 := by linarith + have hsq := (sq_le_sq₀ (by positivity : 0 ≤ 2*‖p‖+‖y‖) (by norm_num : (0:ℝ) ≤ 6)).mpr hsum + linarith + have hy3 := pow_le_pow_left₀ (half_pos hα).le hy 3 + have hgain : c ≤ ‖y‖^3/(8*(2*‖p‖+‖y‖)^2) := by + apply (le_div_iff₀ hdenpos).mpr + have hm := mul_le_mul_of_nonneg_left hden hc.le + dsimp [c] at hm ⊢ + nlinarith only [hm,hy3] + have hi := hinput H p y hP hY hy0 + have hu : (‖p+y‖+‖p-y‖)/2 ≤ R+2*η := by linarith + have hchain := hi.trans hu + dsimp [η,c] at hchain hpL hgain + linarith + +theorem zero_root_depth (A : Heads ι X) (hinput : ZeroRootInput A) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + (k:ℝ) ≤ 4608*D^3*(1-D⁻¹) := by + have hD : 0 < D := lt_of_lt_of_le (by norm_num) hf.1 + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + have hnorm := Diamond.upper_one_normalization f hf + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ 1 → D⁻¹ ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*D⁻¹ ≤ ‖z i-z j‖) → ‖x‖ ≤ R-(D⁻¹)^3/4608 := by + intro x z R hR hR1 hx hp hm hs + exact zero_root_parent A hinput hα hα1 hR hR1 z hp hm hs + have hi := Diamond.iterate_additive (show 0 ≤ (D⁻¹)^3/4608 by positivity) hstep k + (fun v => (D*s)⁻¹ • f v) (by norm_num : (0:ℝ) ≤ 1) le_rfl + (fun u v => (hnorm u v).1) + (fun e => Diamond.slope_upper _ (fun u v => by simpa using (hnorm u v).2) e) + have hfin : (k:ℝ)*(D⁻¹)^3/4608 ≤ 1-D⁻¹ := by linarith + have hm := mul_le_mul_of_nonneg_right hfin (show 0 ≤ 4608*D^3 by positivity) + have he : ((k:ℝ)*(D⁻¹)^3/4608)*(4608*D^3)=(k:ℝ) := by field_simp + rw [he] at hm + simpa only [mul_comm] using hm + +end RecursiveApplications + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/RecursiveModels.lean b/lean/OAI/Analysis/DiamondDistortion/RecursiveModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c3b8aee0f5130f92e745d87af1313739f0398b2 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/RecursiveModels.lean @@ -0,0 +1,600 @@ +import OAI.Analysis.DiamondDistortion.CoordinateSpace + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace RecursiveModel + +section +open scoped ENNReal + +/-- Coordinates on the root-including, countably branching height-h tree. -/ +abbrev Coord : ℕ → Type + | 0 => Unit + | h+1 => Unit ⊕ (ℕ × Coord h) +abbrev Vec (h : ℕ) := Coord h →₀ ℝ + +def rootChildren (h : ℕ) : Vec (h+1) ≃ₗ[ℝ] ℝ × (ℕ →₀ Vec h) := + (Finsupp.sumFinsuppLEquivProdFinsupp ℝ).trans + ((Finsupp.uniqueLinearEquiv ℝ ℝ ()).prodCongr (Finsupp.curryLinearEquiv ℝ)) + +def finiteLp {ι : Type*} (p : ℝ≥0∞) (f : ι →₀ ℝ) : lp (fun _ : ι => ℝ) p := + ⟨(fun i => f i),(memℓp_zero f.hasFiniteSupport).of_exponent_ge bot_le⟩ +@[simp] lemma finiteLp_apply {ι : Type*} (p : ℝ≥0∞) (f : ι →₀ ℝ) (i : ι) : finiteLp p f i=f i := rfl +@[simp] lemma finiteLp_zero {ι : Type*} (p : ℝ≥0∞) : finiteLp p (0 : ι →₀ ℝ)=0 := by ext i; rfl +@[simp] lemma finiteLp_add {ι : Type*} (p : ℝ≥0∞) (f g : ι →₀ ℝ) : + finiteLp p (f+g)=finiteLp p f+finiteLp p g := by ext i; rfl +@[simp] lemma finiteLp_smul {ι : Type*} (p : ℝ≥0∞) (c : ℝ) (f : ι →₀ ℝ) : + finiteLp p (c • f)=c • finiteLp p f := by ext i; rfl + +def aggregate {ι : Type*} (p : ℝ≥0∞) (f : ι →₀ ℝ) : ℝ := ‖finiteLp p f‖ +@[simp] lemma aggregate_zero {ι : Type*} (p : ℝ≥0∞) : aggregate p (0 : ι →₀ ℝ)=0 := by simp [aggregate] +lemma aggregate_nonneg {ι : Type*} (p : ℝ≥0∞) (f : ι →₀ ℝ) : 0 ≤ aggregate p f := lp.norm_nonneg' _ +lemma aggregate_add {ι : Type*} (p : ℝ≥0∞) [Fact (1 ≤ p)] (f g : ι →₀ ℝ) : + aggregate p (f+g) ≤ aggregate p f+aggregate p g := by simpa [aggregate] using norm_add_le (finiteLp p f) (finiteLp p g) +lemma aggregate_smul {ι : Type*} (p : ℝ≥0∞) [Fact (1 ≤ p)] (c : ℝ) (f : ι →₀ ℝ) : + aggregate p (c • f)=|c| * aggregate p f := by simp [aggregate,norm_smul,Real.norm_eq_abs] +lemma aggregate_mono {ι : Type*} (p : ℝ≥0∞) [Fact (1 ≤ p)] (f g : ι →₀ ℝ) + (hf : ∀ i,0 ≤ f i) (hfg : ∀ i,f i ≤ g i) : aggregate p f ≤ aggregate p g := by + apply lp.norm_mono (ne_of_gt (lt_of_lt_of_le zero_lt_one Fact.out)) + intro i + simpa only [finiteLp_apply,Real.norm_eq_abs,abs_of_nonneg (hf i),abs_of_nonneg ((hf i).trans (hfg i))] using hfg i +lemma coordinate_le_aggregate {ι : Type*} (p : ℝ≥0∞) [Fact (1 ≤ p)] (f : ι →₀ ℝ) (i : ι) : + |f i| ≤ aggregate p f := by + simpa only [finiteLp_apply,Real.norm_eq_abs,aggregate] using lp.norm_apply_le_norm (ne_of_gt (lt_of_lt_of_le zero_lt_one Fact.out)) (finiteLp p f) i + +/-- Least nonnegative upper arrays evaluated at the root. P and Q are kept + separately; changing their root combination changes the norm. -/ +def upper (p : ℝ≥0∞) : (h : ℕ) → ZeroHom (Vec h) (ℝ × ℝ) + | 0 => ⟨fun v => (max (v ()) 0,max (-v ()) 0),by simp only [Finsupp.zero_apply,neg_zero,max_self]; rfl⟩ + | h+1 => + let U := upper p h + let P (v : ℕ →₀ Vec h) := v.mapRange (fun z => (U z).1) (by simp) + let Q (v : ℕ →₀ Vec h) := v.mapRange (fun z => (U z).2) (by simp) + ⟨fun w => let v := rootChildren h w; + (max (aggregate p (P v.2)) (v.1+aggregate p (Q v.2)), + max (aggregate p (P v.2)-v.1) (aggregate p (Q v.2))),by + simp only [map_zero,Prod.fst_zero,Prod.snd_zero,P,Q,Finsupp.mapRange_zero,aggregate_zero,add_zero,sub_zero,max_self] + rfl⟩ + +@[simp] lemma upper_zero (p : ℝ≥0∞) (h : ℕ) : upper p h 0=0 := map_zero _ +lemma upper_nonneg (p : ℝ≥0∞) (h : ℕ) (v : Vec h) : + 0 ≤ (upper p h v).1 ∧ 0 ≤ (upper p h v).2 := by + cases h with + | zero => exact ⟨le_max_right _ _,le_max_right _ _⟩ + | succ h => exact ⟨(aggregate_nonneg _ _).trans (le_max_left _ _),(aggregate_nonneg _ _).trans (le_max_right _ _)⟩ + +lemma upper_neg (p : ℝ≥0∞) (h : ℕ) (v : Vec h) : + upper p h (-v)=((upper p h v).2,(upper p h v).1) := by + induction h with + | zero => simp only [upper,ZeroHom.coe_mk,Finsupp.neg_apply,neg_neg] + | succ h ih => + let w := rootChildren h v + let U := upper p h + have hP : ((-w).2.mapRange (fun z => (U z).1) (by simp))= + w.2.mapRange (fun z => (U z).2) (by simp) := by + ext i + change (upper p h (-w.2 i)).1=(upper p h (w.2 i)).2 + rw [ih] + have hQ : ((-w).2.mapRange (fun z => (U z).2) (by simp))= + w.2.mapRange (fun z => (U z).1) (by simp) := by + ext i + change (upper p h (-w.2 i)).2=(upper p h (w.2 i)).1 + rw [ih] + dsimp only [upper,ZeroHom.coe_mk] + rw [map_neg] + change (max (aggregate p _) ((-w).1+aggregate p _),max (aggregate p _-(-w).1) (aggregate p _))=_ + rw [hP,hQ] + dsimp only [Prod.fst_neg] + ext <;> dsimp only [Prod.fst,Prod.snd] + · rw [max_comm]; congr 1; ring + · rw [max_comm]; congr 1; ring + +/-- A node's two least upper values once its child arrays have norms a,b. -/ +def join (r a b : ℝ) : ℝ × ℝ := (max a (r+b),max (a-r) b) +lemma join_mono {r a b A B : ℝ} (ha : a ≤ A) (hb : b ≤ B) : + (join r a b).1 ≤ (join r A B).1 ∧ (join r a b).2 ≤ (join r A B).2 := by + exact ⟨max_le_max ha (add_le_add_right hb _),max_le_max (sub_le_sub_right ha _) hb⟩ +lemma join_add (r s a b c d : ℝ) : + (join (r+s) (a+c) (b+d)).1 ≤ (join r a b).1+(join s c d).1 ∧ + (join (r+s) (a+c) (b+d)).2 ≤ (join r a b).2+(join s c d).2 := by + dsimp [join] + constructor + · apply max_le + · exact add_le_add (le_max_left _ _) (le_max_left _ _) + · linarith [le_max_right a (r+b),le_max_right c (s+d)] + · apply max_le + · linarith [le_max_left (a-r) b,le_max_left (c-s) d] + · exact add_le_add (le_max_right _ _) (le_max_right _ _) +lemma join_smul (t r a b : ℝ) (ht : 0 ≤ t) : + join (t*r) (t*a) (t*b)=t • join r a b := by + ext <;> simp only [join,Prod.smul_fst,Prod.smul_snd,smul_eq_mul] + · rw [← mul_add,← mul_max_of_nonneg _ _ ht] + · rw [← mul_sub,← mul_max_of_nonneg _ _ ht] +lemma join_root_bound (r a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) : + |r| ≤ (join r a b).1+(join r a b).2 := by + dsimp [join] + rw [abs_le] + constructor <;> linarith [le_max_left a (r+b),le_max_right a (r+b),le_max_left (a-r) b,le_max_right (a-r) b] + +lemma upper_add (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v w : Vec h) : + (upper p h (v+w)).1 ≤ (upper p h v).1+(upper p h w).1 ∧ + (upper p h (v+w)).2 ≤ (upper p h v).2+(upper p h w).2 := by + induction h with + | zero => + change max (v ()+w ()) 0 ≤ max (v ()) 0+max (w ()) 0 ∧ + max (-(v ()+w ())) 0 ≤ max (-v ()) 0+max (-w ()) 0 + constructor <;> apply max_le + · exact add_le_add (le_max_left _ _) (le_max_left _ _) + · exact add_nonneg (le_max_right _ _) (le_max_right _ _) + · linarith [le_max_left (-v ()) 0,le_max_left (-w ()) 0] + · exact add_nonneg (le_max_right _ _) (le_max_right _ _) + | succ h ih => + let V := rootChildren h v + let W := rootChildren h w + let P (v : ℕ →₀ Vec h) := v.mapRange (fun z => (upper p h z).1) (by simp) + let Q (v : ℕ →₀ Vec h) := v.mapRange (fun z => (upper p h z).2) (by simp) + have hp : aggregate p (P (V.2+W.2)) ≤ aggregate p (P V.2)+aggregate p (P W.2) := by + refine (aggregate_mono p _ _ ?_ ?_).trans (aggregate_add p _ _) + · intro i; exact (upper_nonneg p h _).1 + · intro i; exact (ih _ _).1 + have hq : aggregate p (Q (V.2+W.2)) ≤ aggregate p (Q V.2)+aggregate p (Q W.2) := by + refine (aggregate_mono p _ _ ?_ ?_).trans (aggregate_add p _ _) + · intro i; exact (upper_nonneg p h _).2 + · intro i; exact (ih _ _).2 + have hm := join_mono (r := V.1+W.1) hp hq + have ha := join_add V.1 W.1 (aggregate p (P V.2)) (aggregate p (Q V.2)) + (aggregate p (P W.2)) (aggregate p (Q W.2)) + dsimp only [upper,ZeroHom.coe_mk] + rw [map_add] + exact ⟨hm.1.trans ha.1,hm.2.trans ha.2⟩ + +lemma upper_smul_nonneg (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v : Vec h) (t : ℝ) (ht : 0 ≤ t) : + upper p h (t • v)=t • upper p h v := by + induction h with + | zero => + dsimp only [upper,ZeroHom.coe_mk] + change (max (t*v ()) 0,max (-(t*v ())) 0)=(t*max (v ()) 0,t*max (-v ()) 0) + rw [mul_max_of_nonneg _ _ ht,mul_max_of_nonneg _ _ ht,mul_zero,mul_neg] + | succ h ih => + let V := rootChildren h v + let P (v : ℕ →₀ Vec h) := v.mapRange (fun z => (upper p h z).1) (by simp) + let Q (v : ℕ →₀ Vec h) := v.mapRange (fun z => (upper p h z).2) (by simp) + have hp : P (t • V.2)=t • P V.2 := by + ext i + change (upper p h (t • V.2 i)).1=t*(upper p h (V.2 i)).1 + rw [ih]; rfl + have hq : Q (t • V.2)=t • Q V.2 := by + ext i + change (upper p h (t • V.2 i)).2=t*(upper p h (V.2 i)).2 + rw [ih]; rfl + dsimp only [upper,ZeroHom.coe_mk] + rw [map_smul] + change join (t*V.1) (aggregate p (P (t • V.2))) (aggregate p (Q (t • V.2)))=t • join V.1 (aggregate p (P V.2)) (aggregate p (Q V.2)) + rw [hp,hq,aggregate_smul,aggregate_smul,abs_of_nonneg ht] + exact join_smul _ _ _ _ ht + +lemma upper_child_bound (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v : Vec (h+1)) (i : ℕ) : + (upper p h ((rootChildren h v).2 i)).1 ≤ (upper p (h+1) v).1 ∧ + (upper p h ((rootChildren h v).2 i)).2 ≤ (upper p (h+1) v).2 := by + let P := (rootChildren h v).2.mapRange (fun z => (upper p h z).1) (by simp) + let Q := (rootChildren h v).2.mapRange (fun z => (upper p h z).2) (by simp) + have hp := coordinate_le_aggregate p P i + have hq := coordinate_le_aggregate p Q i + constructor + · exact (le_abs_self _).trans (hp.trans (le_max_left _ _)) + · exact (le_abs_self _).trans (hq.trans (le_max_right _ _)) + +lemma upper_coordinate_bound (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v : Vec h) (i : Coord h) : + |v i| ≤ (upper p h v).1+(upper p h v).2 := by + induction h with + | zero => + have hi : i=() := Subsingleton.elim _ _ + subst i + change |v ()| ≤ max (v ()) 0+max (-v ()) 0 + rw [abs_le]; constructor <;> linarith [le_max_left (v ()) 0,le_max_right (v ()) 0,le_max_left (-v ()) 0,le_max_right (-v ()) 0] + | succ h ih => + cases i with + | inl u => + have hu : u=() := Subsingleton.elim _ _ + subst u + have hh := join_root_bound (rootChildren h v).1 + (aggregate p ((rootChildren h v).2.mapRange (fun z => (upper p h z).1) (by simp))) + (aggregate p ((rootChildren h v).2.mapRange (fun z => (upper p h z).2) (by simp))) + (aggregate_nonneg _ _) (aggregate_nonneg _ _) + exact hh + | inr a => + have hh := ih ((rootChildren h v).2 a.1) a.2 + have hb := upper_child_bound p h v a.1 + exact hh.trans (add_le_add hb.1 hb.2) + +def nu (p : ℝ≥0∞) (h : ℕ) (v : Vec h) : ℝ := (upper p h v).1+(upper p h v).2 +lemma nu_nonneg (p : ℝ≥0∞) (h : ℕ) (v : Vec h) : 0 ≤ nu p h v := + add_nonneg (upper_nonneg p h v).1 (upper_nonneg p h v).2 +@[simp] lemma nu_zero (p : ℝ≥0∞) (h : ℕ) : nu p h 0=0 := by simp [nu] +lemma nu_add (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v w : Vec h) : + nu p h (v+w) ≤ nu p h v+nu p h w := by + have ha := upper_add p h v w + dsimp [nu]; linarith [ha.1,ha.2] +lemma nu_neg (p : ℝ≥0∞) (h : ℕ) (v : Vec h) : nu p h (-v)=nu p h v := by + simp only [nu,upper_neg]; ring +lemma nu_smul (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v : Vec h) (t : ℝ) : + nu p h (t • v)=|t| * nu p h v := by + rcases le_total 0 t with ht|ht + · simp only [nu,upper_smul_nonneg p h v t ht,Prod.smul_fst,Prod.smul_snd,smul_eq_mul,abs_of_nonneg ht,mul_add] + · have he : t • v=-((-t) • v) := by module + rw [he,nu_neg] + simp only [nu,upper_smul_nonneg p h v (-t) (neg_nonneg.mpr ht),Prod.smul_fst,Prod.smul_snd,smul_eq_mul,abs_of_nonpos ht,mul_add] +lemma nu_eq_zero (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) (v : Vec h) (hv : nu p h v=0) : v=0 := by + ext i + have hi := upper_coordinate_bound p h v i + change |v i| ≤ nu p h v at hi + rw [hv] at hi + exact abs_nonpos_iff.mp hi + +def nuSeminorm (p : ℝ≥0∞) [Fact (1 ≤ p)] (h : ℕ) : Seminorm ℝ (Vec h) where + toFun := nu p h + map_zero' := nu_zero p h + add_le' := nu_add p h + neg' := nu_neg p h + smul' := fun t v => by simpa only [Real.norm_eq_abs] using nu_smul p h v t + +/-- Finite disjoint forest, one positive-height rooted tree per component. -/ +abbrev ForestCoord := Σ h : ℕ,Coord (h+1) +abbrev ForestVec := ForestCoord →₀ ℝ +def components : ForestVec ≃ₗ[ℝ] (Π₀ h : ℕ,Vec (h+1)) := sigmaFinsuppLequivDFinsupp ℝ +@[simp] lemma components_apply (v : ForestVec) (h : ℕ) (i : Coord (h+1)) : components v h i=v ⟨h,i⟩ := rfl + +def componentValues (f : ∀ h,ZeroHom (Vec (h+1)) ℝ) (v : ForestVec) : ℕ →₀ ℝ := + (DFinsupp.mapRange (fun h => f h) (fun h => (f h).map_zero) (components v)).toFinsupp +@[simp] lemma componentValues_apply (f : ∀ h,ZeroHom (Vec (h+1)) ℝ) (v : ForestVec) (h : ℕ) : + componentValues f v h=f h (components v h) := rfl +@[simp] lemma componentValues_zero (f : ∀ h,ZeroHom (Vec (h+1)) ℝ) : componentValues f 0=0 := by ext h; simp + +def exponent (h : ℕ) : ℝ≥0∞ := 1+(h+1:ℝ≥0∞)⁻¹ +instance exponent_ge_one (h : ℕ) : Fact (1 ≤ exponent h) := ⟨le_add_of_nonneg_right bot_le⟩ +def nuMap (h : ℕ) : ZeroHom (Vec (h+1)) ℝ := ⟨nu (exponent h) (h+1),nu_zero _ _⟩ +def vectorNormValues (v : ForestVec) : ℕ →₀ ℝ := componentValues nuMap v +@[simp] lemma vectorNormValues_apply (v : ForestVec) (h : ℕ) : vectorNormValues v h=nu (exponent h) (h+1) (components v h) := rfl +@[simp] lemma vectorNormValues_zero : vectorNormValues 0=0 := componentValues_zero _ +lemma vectorNormValues_nonneg (v : ForestVec) (h : ℕ) : 0 ≤ vectorNormValues v h := nu_nonneg _ _ _ +lemma vectorNormValues_add (v w : ForestVec) (h : ℕ) : vectorNormValues (v+w) h ≤ (vectorNormValues v+vectorNormValues w) h := by + simp only [vectorNormValues_apply,map_add,DFinsupp.add_apply,Finsupp.add_apply] + exact nu_add _ _ _ _ +lemma vectorNormValues_neg (v : ForestVec) : vectorNormValues (-v)=vectorNormValues v := by + ext h + simp only [vectorNormValues_apply,map_neg,DFinsupp.neg_apply] + exact nu_neg _ _ _ +lemma vectorNormValues_smul (t : ℝ) (v : ForestVec) : vectorNormValues (t • v)=|t| • vectorNormValues v := by + ext h + simp only [vectorNormValues_apply,map_smul,DFinsupp.smul_apply,Finsupp.smul_apply,smul_eq_mul] + exact nu_smul _ _ _ _ + +/-- Exactly the outer Hilbert sum of the root-sum ν_h norms with p_h=1+1/h. -/ +def vectorNorm (v : ForestVec) : ℝ := aggregate 2 (vectorNormValues v) +@[simp] lemma vectorNorm_zero : vectorNorm 0=0 := by simp [vectorNorm] +lemma vectorNorm_add (v w : ForestVec) : vectorNorm (v+w) ≤ vectorNorm v+vectorNorm w := by + exact (aggregate_mono 2 _ _ (vectorNormValues_nonneg _) (vectorNormValues_add _ _)).trans (aggregate_add 2 _ _) +lemma vectorNorm_neg (v : ForestVec) : vectorNorm (-v)=vectorNorm v := by simp only [vectorNorm,vectorNormValues_neg] +lemma vectorNorm_smul (t : ℝ) (v : ForestVec) : vectorNorm (t • v)=|t| * vectorNorm v := by + simp only [vectorNorm,vectorNormValues_smul,aggregate_smul,abs_abs] +lemma vectorNorm_coordinate (v : ForestVec) (i : ForestCoord) : |v i| ≤ vectorNorm v := by + have hh := upper_coordinate_bound (exponent i.1) (i.1+1) (components v i.1) i.2 + have hb := coordinate_le_aggregate 2 (vectorNormValues v) i.1 + exact hh.trans ((le_abs_self _).trans hb) +def vectorSeminorm : Seminorm ℝ ForestVec where + toFun := vectorNorm + map_zero' := vectorNorm_zero + add_le' := vectorNorm_add + neg' := vectorNorm_neg + smul' t v := by simpa only [Real.norm_eq_abs] using vectorNorm_smul t v + +/-- Separate Euclidean root arrays for the joined (p=2) models. -/ +def rootP (h : ℕ) : ZeroHom (Vec (h+1)) ℝ := + ⟨fun v => (upper 2 (h+1) v).1,by simp⟩ +def rootQ (h : ℕ) : ZeroHom (Vec (h+1)) ℝ := + ⟨fun v => (upper 2 (h+1) v).2,by simp⟩ +def forestP (v : ForestVec) : ℝ := aggregate 2 (componentValues rootP v) +def forestQ (v : ForestVec) : ℝ := aggregate 2 (componentValues rootQ v) +@[simp] lemma forestP_zero : forestP 0=0 := by simp [forestP] +@[simp] lemma forestQ_zero : forestQ 0=0 := by simp [forestQ] +lemma forestP_nonneg (v : ForestVec) : 0 ≤ forestP v := aggregate_nonneg _ _ +lemma forestQ_nonneg (v : ForestVec) : 0 ≤ forestQ v := aggregate_nonneg _ _ +lemma forestP_add (v w : ForestVec) : forestP (v+w) ≤ forestP v+forestP w := by + refine (aggregate_mono 2 _ _ ?_ ?_).trans (aggregate_add 2 _ _) + · intro h; exact (upper_nonneg _ _ _).1 + · intro h + change (upper 2 (h+1) (components (v+w) h)).1 ≤ (upper 2 (h+1) (components v h)).1+(upper 2 (h+1) (components w h)).1 + rw [map_add,DFinsupp.add_apply] + exact (upper_add _ _ _ _).1 +lemma forestQ_add (v w : ForestVec) : forestQ (v+w) ≤ forestQ v+forestQ w := by + refine (aggregate_mono 2 _ _ ?_ ?_).trans (aggregate_add 2 _ _) + · intro h; exact (upper_nonneg _ _ _).2 + · intro h + change (upper 2 (h+1) (components (v+w) h)).2 ≤ (upper 2 (h+1) (components v h)).2+(upper 2 (h+1) (components w h)).2 + rw [map_add,DFinsupp.add_apply] + exact (upper_add _ _ _ _).2 +lemma forestP_neg (v : ForestVec) : forestP (-v)=forestQ v := by + unfold forestP forestQ + congr 1 + ext h + change (upper 2 (h+1) (components (-v) h)).1=(upper 2 (h+1) (components v h)).2 + rw [map_neg,DFinsupp.neg_apply,upper_neg] +lemma forestQ_neg (v : ForestVec) : forestQ (-v)=forestP v := by + simpa only [neg_neg] using (forestP_neg (-v)).symm +lemma forestP_smul (t : ℝ) (ht : 0 ≤ t) (v : ForestVec) : forestP (t • v)=t*forestP v := by + have he : componentValues rootP (t • v)=t • componentValues rootP v := by + ext h + change (upper 2 (h+1) (components (t • v) h)).1=t*(upper 2 (h+1) (components v h)).1 + rw [map_smul,DFinsupp.smul_apply,upper_smul_nonneg _ _ _ _ ht]; rfl + simp only [forestP,he,aggregate_smul,abs_of_nonneg ht] +lemma forestQ_smul (t : ℝ) (ht : 0 ≤ t) (v : ForestVec) : forestQ (t • v)=t*forestQ v := by + rw [← forestP_neg,← smul_neg,forestP_smul t ht,forestP_neg] +lemma forest_coordinate (v : ForestVec) (i : ForestCoord) : |v i| ≤ forestP v+forestQ v := by + have hi := upper_coordinate_bound (2:ℝ≥0∞) (i.1+1) (components v i.1) i.2 + have hp := (le_abs_self ((upper 2 (i.1+1) (components v i.1)).1)).trans + (coordinate_le_aggregate 2 (componentValues rootP v) i.1) + have hq := (le_abs_self ((upper 2 (i.1+1) (components v i.1)).2)).trans + (coordinate_le_aggregate 2 (componentValues rootQ v) i.1) + exact hi.trans (add_le_add hp hq) + +/-- Root-zero common-root norm. The new root coordinate is absent, not free. -/ +def zeroNorm (v : ForestVec) : ℝ := max (forestP v) (forestQ v) +@[simp] lemma zeroNorm_zero : zeroNorm 0=0 := by simp [zeroNorm] +lemma zeroNorm_add (v w : ForestVec) : zeroNorm (v+w) ≤ zeroNorm v+zeroNorm w := by + apply max_le + · exact (forestP_add v w).trans (add_le_add (le_max_left _ _) (le_max_left _ _)) + · exact (forestQ_add v w).trans (add_le_add (le_max_right _ _) (le_max_right _ _)) +lemma zeroNorm_neg (v : ForestVec) : zeroNorm (-v)=zeroNorm v := by simp only [zeroNorm,forestP_neg,forestQ_neg,max_comm] +lemma zeroNorm_smul (t : ℝ) (v : ForestVec) : zeroNorm (t • v)=|t| * zeroNorm v := by + rcases le_total 0 t with ht|ht + · simp only [zeroNorm,forestP_smul t ht,forestQ_smul t ht,abs_of_nonneg ht,mul_max_of_nonneg _ _ ht] + · have he : t • v=-((-t) • v) := by module + rw [he,zeroNorm_neg] + simp only [zeroNorm,forestP_smul (-t) (neg_nonneg.mpr ht),forestQ_smul (-t) (neg_nonneg.mpr ht),abs_of_nonpos ht,mul_max_of_nonneg _ _ (neg_nonneg.mpr ht)] +lemma zeroNorm_coordinate (v : ForestVec) (i : ForestCoord) : |v i| ≤ 2*zeroNorm v := by + have hi := forest_coordinate v i + dsimp [zeroNorm] + linarith [le_max_left (forestP v) (forestQ v),le_max_right (forestP v) (forestQ v)] +def zeroSeminorm : Seminorm ℝ ForestVec where + toFun := zeroNorm + map_zero' := zeroNorm_zero + add_le' := zeroNorm_add + neg' := zeroNorm_neg + smul' t v := by simpa only [Real.norm_eq_abs] using zeroNorm_smul t v + +abbrev JoinedCoord := Unit ⊕ ForestCoord +abbrev JoinedVec := JoinedCoord →₀ ℝ +def joinedChildren : JoinedVec ≃ₗ[ℝ] ℝ × ForestVec := + (Finsupp.sumFinsuppLEquivProdFinsupp ℝ).trans + ((Finsupp.uniqueLinearEquiv ℝ ℝ ()).prodCongr (LinearEquiv.refl ℝ ForestVec)) +def joinedUpper (v : JoinedVec) : ℝ × ℝ := + join (joinedChildren v).1 (forestP (joinedChildren v).2) (forestQ (joinedChildren v).2) +/-- Free new-root sum, which is genuinely twice the common-root norm on root zero. -/ +def joinedNorm (v : JoinedVec) : ℝ := (joinedUpper v).1+(joinedUpper v).2 +@[simp] lemma joinedNorm_zero : joinedNorm 0=0 := by simp [joinedNorm,joinedUpper,join] +lemma joinedNorm_add (v w : JoinedVec) : joinedNorm (v+w) ≤ joinedNorm v+joinedNorm w := by + let V := joinedChildren v + let W := joinedChildren w + have hm := join_mono (r := V.1+W.1) (forestP_add V.2 W.2) (forestQ_add V.2 W.2) + have ha := join_add V.1 W.1 (forestP V.2) (forestQ V.2) (forestP W.2) (forestQ W.2) + unfold joinedNorm joinedUpper + rw [map_add] + exact (add_le_add (hm.1.trans ha.1) (hm.2.trans ha.2)).trans_eq (by ring) +lemma joinedNorm_neg (v : JoinedVec) : joinedNorm (-v)=joinedNorm v := by + simp only [joinedNorm,joinedUpper,join,map_neg,Prod.fst_neg,Prod.snd_neg,forestP_neg,forestQ_neg] + simp only [sub_eq_add_neg,neg_neg,add_comm,max_comm] +lemma joinedNorm_smul_nonneg (t : ℝ) (ht : 0 ≤ t) (v : JoinedVec) : joinedNorm (t • v)=t*joinedNorm v := by + simp only [joinedNorm,joinedUpper,map_smul,Prod.smul_fst,Prod.smul_snd,smul_eq_mul,forestP_smul t ht,forestQ_smul t ht,join_smul t _ _ _ ht,mul_add] +lemma joinedNorm_smul (t : ℝ) (v : JoinedVec) : joinedNorm (t • v)=|t| * joinedNorm v := by + rcases le_total 0 t with ht|ht + · rw [joinedNorm_smul_nonneg t ht,abs_of_nonneg ht] + · have he : t • v=-((-t) • v) := by module + rw [he,joinedNorm_neg,joinedNorm_smul_nonneg (-t) (neg_nonneg.mpr ht),abs_of_nonpos ht] +lemma joinedNorm_coordinate (v : JoinedVec) (i : JoinedCoord) : |v i| ≤ joinedNorm v := by + cases i with + | inl u => + have hu : u=() := Subsingleton.elim _ _ + subst u + exact join_root_bound _ _ _ (forestP_nonneg _) (forestQ_nonneg _) + | inr i => + have hh := forest_coordinate (joinedChildren v).2 i + exact hh.trans (add_le_add (le_max_left _ _) (le_max_right _ _)) +lemma joinedNorm_root_zero (v : JoinedVec) (hv : (joinedChildren v).1=0) : + joinedNorm v=2*zeroNorm (joinedChildren v).2 := by + simp only [joinedNorm,joinedUpper,join,hv,zero_add,sub_zero,zeroNorm] + ring +def joinedSeminorm : Seminorm ℝ JoinedVec where + toFun := joinedNorm + map_zero' := joinedNorm_zero + add_le' := joinedNorm_add + neg' := joinedNorm_neg + smul' t v := by simpa only [Real.norm_eq_abs] using joinedNorm_smul t v + +/-- Prefix ancestors, including both the root and the coordinate itself. -/ +def ancestors : (h : ℕ) → Coord h → Finset (Coord h) + | 0,_ => {()} + | _+1,.inl _ => {.inl ()} + | h+1,.inr (i,s) => insert (.inl ()) ((ancestors h s).image (fun t => .inr (i,t))) +lemma self_mem_ancestors (h : ℕ) (s : Coord h) : s ∈ ancestors h s := by + induction h with + | zero => simp [ancestors] + | succ h ih => + cases s with + | inl u => simp [ancestors] + | inr a => exact Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨a.2,ih _,rfl⟩) +lemma ancestor_trans (h : ℕ) {a b c : Coord h} (hab : a ∈ ancestors h b) (hbc : b ∈ ancestors h c) : + a ∈ ancestors h c := by + induction h with + | zero => exact self_mem_ancestors _ _ + | succ h ih => + cases c with + | inl u => + have hb : b=Sum.inl () := by simpa only [ancestors,Finset.mem_singleton] using hbc + subst b + simpa only [ancestors] using hab + | inr k => + rcases Finset.mem_insert.mp hbc with hb|hb + · subst b + have ha : a=Sum.inl () := by simpa only [ancestors,Finset.mem_singleton] using hab + subst a + exact Finset.mem_insert_self _ _ + · obtain ⟨b',hb',rfl⟩ := Finset.mem_image.mp hb + rcases Finset.mem_insert.mp hab with ha|ha + · subst a; exact Finset.mem_insert_self _ _ + · obtain ⟨a',ha',rfl⟩ := Finset.mem_image.mp ha + exact Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨a',ih ha' hb',rfl⟩) + +def forestAncestors (i : ForestCoord) : Finset ForestCoord := + (ancestors (i.1+1) i.2).image (Sigma.mk i.1) +lemma forest_self_mem (i : ForestCoord) : i ∈ forestAncestors i := + Finset.mem_image.mpr ⟨i.2,self_mem_ancestors _ _,rfl⟩ +lemma forest_ancestor_trans {a b c : ForestCoord} (hab : a ∈ forestAncestors b) (hbc : b ∈ forestAncestors c) : + a ∈ forestAncestors c := by + obtain ⟨b',hb',rfl⟩ := Finset.mem_image.mp hbc + obtain ⟨a',ha',rfl⟩ := Finset.mem_image.mp hab + exact Finset.mem_image.mpr ⟨a',ancestor_trans _ ha' hb',rfl⟩ + +/-- Finite heads are componentwise ancestor closed; a used component includes + its original root. There is no joined free root in this index type. -/ +def ForestHead := {H : Finset ForestCoord // ∀ i ∈ H,forestAncestors i ⊆ H} +def forestHead (S : Finset ForestCoord) : ForestHead := + ⟨S.biUnion forestAncestors,by + intro i hi j hj + obtain ⟨k,hk,hi⟩ := Finset.mem_biUnion.mp hi + exact Finset.mem_biUnion.mpr ⟨k,hk,forest_ancestor_trans hj hi⟩⟩ +lemma forestHead_contains (S : Finset ForestCoord) : S ⊆ (forestHead S).val := by + intro i hi + exact Finset.mem_biUnion.mpr ⟨i,hi,forest_self_mem i⟩ + +def joinedAncestors : JoinedCoord → Finset JoinedCoord + | .inl _ => {.inl ()} + | .inr i => insert (.inl ()) ((forestAncestors i).image Sum.inr) +lemma joined_self_mem (i : JoinedCoord) : i ∈ joinedAncestors i := by + cases i with + | inl u => simp [joinedAncestors] + | inr i => exact Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨i,forest_self_mem i,rfl⟩) +lemma joined_ancestor_trans {a b c : JoinedCoord} (hab : a ∈ joinedAncestors b) (hbc : b ∈ joinedAncestors c) : + a ∈ joinedAncestors c := by + cases c with + | inl u => + have hb : b=Sum.inl () := by simpa only [joinedAncestors,Finset.mem_singleton] using hbc + subst b + simpa only [joinedAncestors] using hab + | inr i => + rcases Finset.mem_insert.mp hbc with hb|hb + · subst b + have ha : a=Sum.inl () := by simpa only [joinedAncestors,Finset.mem_singleton] using hab + subst a; exact Finset.mem_insert_self _ _ + · obtain ⟨b',hb',rfl⟩ := Finset.mem_image.mp hb + rcases Finset.mem_insert.mp hab with ha|ha + · subst a; exact Finset.mem_insert_self _ _ + · obtain ⟨a',ha',rfl⟩ := Finset.mem_image.mp ha + exact Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨a',forest_ancestor_trans ha' hb',rfl⟩) + +/-- The joined root belongs to every allowed head, including otherwise empty heads. -/ +def JoinedHead := {H : Finset JoinedCoord // Sum.inl () ∈ H ∧ ∀ i ∈ H,joinedAncestors i ⊆ H} +def joinedHead (S : Finset JoinedCoord) : JoinedHead := + ⟨insert (Sum.inl ()) (S.biUnion joinedAncestors),Finset.mem_insert_self _ _,by + intro i hi j hj + rcases Finset.mem_insert.mp hi with hi|hi + · subst i + have hj' : j=Sum.inl () := by simpa only [joinedAncestors,Finset.mem_singleton] using hj + subst j; exact Finset.mem_insert_self _ _ + · obtain ⟨k,hk,hi⟩ := Finset.mem_biUnion.mp hi + exact Finset.mem_insert_of_mem (Finset.mem_biUnion.mpr ⟨k,hk,joined_ancestor_trans hj hi⟩)⟩ +lemma joinedHead_contains (S : Finset JoinedCoord) : S ⊆ (joinedHead S).val := by + intro i hi + exact Finset.mem_insert_of_mem (Finset.mem_biUnion.mpr ⟨i,hi,joined_self_mem i⟩) + +/-- The dense-coordinate presentations of the three distinct recursive Banach + spaces. Each space is the completion for its displayed, exact finite norm. -/ +def vectorData : CoordinateCompletion.Data ForestCoord where + seminorm := vectorSeminorm + coordinate_bound i := ⟨1,fun v => by change |v i| ≤ 1*vectorNorm v; simpa using vectorNorm_coordinate v i⟩ +def zeroData : CoordinateCompletion.Data ForestCoord where + seminorm := zeroSeminorm + coordinate_bound i := ⟨2,fun v => zeroNorm_coordinate v i⟩ +def joinedData : CoordinateCompletion.Data JoinedCoord where + seminorm := joinedSeminorm + coordinate_bound i := ⟨1,fun v => by change |v i| ≤ 1*joinedNorm v; simpa using joinedNorm_coordinate v i⟩ +abbrev VectorSpace := vectorData.Space +abbrev ZeroRootSpace := zeroData.Space +abbrev FreeRootSpace := joinedData.Space + +def vectorHeads : Midpoint.Heads ForestHead VectorSpace := + vectorData.heads Subtype.val (fun S => ⟨forestHead S,forestHead_contains S⟩) +def zeroHeads : Midpoint.Heads ForestHead ZeroRootSpace := + zeroData.heads Subtype.val (fun S => ⟨forestHead S,forestHead_contains S⟩) +def freeHeads : Midpoint.Heads JoinedHead FreeRootSpace := + joinedData.heads Subtype.val (fun S => ⟨joinedHead S,joinedHead_contains S⟩) +lemma vectorHeads_commutes : vectorHeads.Commutes := vectorData.heads_commutes _ _ +lemma zeroHeads_commutes : zeroHeads.Commutes := zeroData.heads_commutes _ _ +lemma freeHeads_commutes : freeHeads.Commutes := joinedData.heads_commutes _ _ + +@[simp] lemma vector_norm_embedding (v : ForestVec) : ‖vectorData.embedding v‖=vectorNorm v := + vectorData.norm_embedding v +@[simp] lemma zero_norm_embedding (v : ForestVec) : ‖zeroData.embedding v‖=zeroNorm v := + zeroData.norm_embedding v +@[simp] lemma free_norm_embedding (v : JoinedVec) : ‖joinedData.embedding v‖=joinedNorm v := + joinedData.norm_embedding v + +/-- The new-root coordinate vanishes on every pure tail for an allowed joined head. -/ +lemma pure_tail_new_root (H : JoinedHead) {y : FreeRootSpace} + (hy : freeHeads.projection H y=0) : joinedData.coordinate (Sum.inl ()) y=0 := by + have hh := congrArg (joinedData.coordinate (Sum.inl ())) hy + change joinedData.coordinate (Sum.inl ()) (joinedData.projection H.val y)=_ at hh + simpa only [CoordinateCompletion.Data.coordinate_projection,ite_eq_left H.property.1,map_zero] using hh + +/-- Root-zero identification retains the factor two; the root-max and root-sum + models are not silently normalized into one another. -/ +lemma free_root_zero_norm (v : JoinedVec) (hv : (joinedChildren v).1=0) : + ‖joinedData.embedding v‖=2*‖zeroData.embedding (joinedChildren v).2‖ := by + rw [free_norm_embedding,zero_norm_embedding] + exact joinedNorm_root_zero v hv + +end + +open RecursiveApplications + +theorem sixth_graph (hinput : SixthInput vectorHeads) {D s : ℝ} (k : ℕ) + (f : Diamond.Vertex k → VectorSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (q6 D⁻¹)^k := sixth_depth vectorHeads hinput k f hf + +theorem cubic_graph (hinput : CubicInput vectorHeads) {D s : ℝ} (k : ℕ) + (f : Diamond.Vertex k → VectorSpace) (hf : Diamond.HasDistortion k f D s) : + 1 ≤ D*(theta D⁻¹)^k := cubic_depth vectorHeads hinput k f hf + +theorem cubic_weak (hinput : CubicInput vectorHeads) {ε : ℝ} (hε : 0 < ε) (hε1 : ε ≤ 1) + {x : VectorSpace} (z : ℕ → VectorSpace) (hz : Midpoint.WeaklyNull z) + (hl : ∀ i,ε ≤ ‖z i‖) (hp : ∀ i,‖x+z i‖ ≤ 1) (hm : ∀ i,‖x-z i‖ ≤ 1) : + ‖x‖ ≤ theta ε := cubic_weak_lens vectorHeads hinput hε hε1 z hz hl hp hm + +theorem free_lens {γ : ℝ → ℝ → ℝ} (hinput : FreeRootInput freeHeads γ) {ε : ℝ} + (hε : 0 < ε) (_hε2 : ε ≤ 2) : + 0 < sumEta γ ε ∧ sumEta γ ε < 1 ∧ + Diamond.UnitLensBound FreeRootSpace ε (1-sumEta γ ε) := + ⟨(sumEta_range freeHeads hinput hε).1,(sumEta_range freeHeads hinput hε).2, + free_root_lens freeHeads freeHeads_commutes hinput hε⟩ + +theorem free_graph {γ : ℝ → ℝ → ℝ} (hinput : FreeRootInput freeHeads γ) {D s : ℝ} (k : ℕ) + (f : Diamond.Vertex k → FreeRootSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-sumEta γ (2/D))^k := free_root_depth freeHeads freeHeads_commutes hinput k f hf + +theorem zero_graph (hinput : ZeroRootInput zeroHeads) {D s : ℝ} (k : ℕ) + (f : Diamond.Vertex k → ZeroRootSpace) (hf : Diamond.HasDistortion k f D s) : + (k:ℝ) ≤ 4608*D^3*(1-D⁻¹) := zero_root_depth zeroHeads hinput k f hf +end RecursiveModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Relations.lean b/lean/OAI/Analysis/DiamondDistortion/Relations.lean new file mode 100644 index 0000000000000000000000000000000000000000..1435d4064e301be2e46918a2a8bbde84fb5abc03 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Relations.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.DiamondDistortion.PathModels + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace InfimalCost +variable {E F G : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E] + [AddCommGroup F] [Module ℝ F] [AddCommGroup G] [Module ℝ G] +/-- A prescribed output of finite input coordinates, allowing all countable + finite-cost representations rather than only finite ones. -/ +structure Relation (E F G : Type*) [SeminormedAddCommGroup E] [NormedSpace ℝ E] + [AddCommGroup F] [Module ℝ F] [AddCommGroup G] [Module ℝ G] where + output : E →ₗ[ℝ] G + value : F →ₗ[ℝ] G + sectionMap : F →ₗ[ℝ] E + section_output : ∀ v,output (sectionMap v)=value v +namespace Relation +variable (A : Relation E F G) +def seminorm : Seminorm ℝ F := + (normSeminorm ℝ (E ⧸ LinearMap.ker A.output)).comp ((LinearMap.ker A.output).mkQ.comp A.sectionMap) +lemma representation_eq {d : E} {v : F} (hd : A.output d=A.value v) : + (LinearMap.ker A.output).mkQ d=(LinearMap.ker A.output).mkQ (A.sectionMap v) := by + change (Submodule.Quotient.mk d : E ⧸ LinearMap.ker A.output)=Submodule.Quotient.mk (A.sectionMap v) + rw [Submodule.Quotient.eq] + change A.output (d-A.sectionMap v)=0 + rw [map_sub,hd,A.section_output,sub_self] +lemma le_representation {d : E} {v : F} (hd : A.output d=A.value v) : A.seminorm v ≤ ‖d‖ := by + change ‖(LinearMap.ker A.output).mkQ (A.sectionMap v)‖ ≤ ‖d‖ + rw [← A.representation_eq hd] + exact Submodule.Quotient.norm_mk_le _ d +lemma near_representation (v : F) {ε : ℝ} (hε : 0 < ε) : + ∃ d : E,A.output d=A.value v ∧ ‖d‖ < A.seminorm v+ε := by + obtain ⟨d,hd,hb⟩ := Submodule.Quotient.norm_mk_lt + ((LinearMap.ker A.output).mkQ (A.sectionMap v)) hε + refine ⟨d,?_,hb⟩ + have hh : d-A.sectionMap v ∈ LinearMap.ker A.output := (Submodule.Quotient.eq _).mp hd + change A.output (d-A.sectionMap v)=0 at hh + rw [map_sub,A.section_output,sub_eq_zero] at hh + exact hh +lemma eq_sInf (v : F) : A.seminorm v=sInf {r : ℝ | ∃ d : E,A.output d=A.value v ∧ ‖d‖=r} := by + let costs := {r : ℝ | ∃ d : E,A.output d=A.value v ∧ ‖d‖=r} + have hn : costs.Nonempty := ⟨‖A.sectionMap v‖,A.sectionMap v,A.section_output v,rfl⟩ + have hb : BddBelow costs := ⟨0,by rintro r ⟨d,hd,rfl⟩; exact norm_nonneg d⟩ + apply le_antisymm + · exact le_csInf hn (by rintro r ⟨d,hd,rfl⟩; exact A.le_representation hd) + · apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨d,hd,hh⟩ := A.near_representation v hε + exact (csInf_le hb ⟨d,hd,rfl⟩).trans hh.le +lemma bound (v : F) {b : ℝ} (hb : ∀ d : E,A.output d=A.value v → b ≤ ‖d‖) : + b ≤ A.seminorm v := by + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨d,hd,hh⟩ := A.near_representation v hε + exact (hb d hd).trans hh.le +end Relation +end InfimalCost + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/SegmentNorm.lean b/lean/OAI/Analysis/DiamondDistortion/SegmentNorm.lean new file mode 100644 index 0000000000000000000000000000000000000000..7da2506050eb01f7f9f4b96d6ff0eedf3dca50ce --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/SegmentNorm.lean @@ -0,0 +1,1113 @@ +import OAI.Analysis.DiamondDistortion.FiniteAverage + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +structure SegmentSystem (ι : Type*) where + IsSegment : Finset ι → Prop + singleton : ∀ v, IsSegment {v} + +namespace SegmentSystem +variable {ι : Type*} (T : SegmentSystem ι) + +/-- The represented disjoint families in the definition of the primal segment norm. -/ +structure Family where + n : ℕ + seg : Fin n → Finset ι + allowed : ∀ i, T.IsSegment (seg i) + disjoint : Pairwise (fun i j => Disjoint (seg i) (seg j)) + +instance : Nonempty T.Family := ⟨{ + n := 0 + seg := Fin.elim0 + allowed := fun i => Fin.elim0 i + disjoint := fun {i} => Fin.elim0 i }⟩ + +variable {T} + +/-- Segment testing as a Euclidean-valued linear map. -/ +def Family.test (F : T.Family) : (ι →₀ ℝ) →ₗ[ℝ] EuclideanSpace ℝ (Fin F.n) where + toFun u := WithLp.toLp 2 (fun i => ∑ v ∈ F.seg i, u v) + map_add' u v := by + ext i + simp [Finset.sum_add_distrib] + map_smul' c u := by + ext i + simp [Finset.mul_sum] + +@[simp] theorem Family.test_apply (F : T.Family) (u : ι →₀ ℝ) (i : Fin F.n) : + F.test u i = ∑ v ∈ F.seg i, u v := rfl + +def Family.seminorm (F : T.Family) : Seminorm ℝ (ι →₀ ℝ) := + (normSeminorm ℝ (EuclideanSpace ℝ (Fin F.n))).comp F.test + +@[simp] theorem Family.seminorm_apply (F : T.Family) (u : ι →₀ ℝ) : + F.seminorm u = ‖F.test u‖ := rfl + +lemma Family.test_single_le (F : T.Family) (v : ι) (r : ℝ) : + ‖F.test (Finsupp.single v r)‖ ≤ |r| := by + classical + rw [EuclideanSpace.norm_eq] + apply (Real.sqrt_le_left (abs_nonneg r)).2 + by_cases h : ∃ i, v ∈ F.seg i + · obtain ⟨i, hi⟩ := h + have hne : ∀ j, j ≠ i → v ∉ F.seg j := by + intro j hji hj + exact Finset.disjoint_left.mp (F.disjoint hji) hj hi + rw [Finset.sum_eq_single i] + · simp [Family.test, Finsupp.single_apply, hi] + · intro j _ hji + simp [Family.test, Finsupp.single_apply, hne j hji] + · simp + · have hn : ∀ i, v ∉ F.seg i := by simpa using h + simp [Family.test, Finsupp.single_apply, hn, sq_nonneg] + +lemma Family.test_le_l1 (F : T.Family) (u : ι →₀ ℝ) : + ‖F.test u‖ ≤ u.sum (fun _ r => |r|) := by + classical + calc + ‖F.test u‖ = ‖∑ v ∈ u.support, F.test (Finsupp.single v (u v))‖ := by + rw [← map_sum] + congr 2 + exact (Finsupp.sum_single u).symm + _ ≤ ∑ v ∈ u.support, ‖F.test (Finsupp.single v (u v))‖ := norm_sum_le _ _ + _ ≤ ∑ v ∈ u.support, |u v| := Finset.sum_le_sum fun v _ => F.test_single_le v (u v) + _ = u.sum (fun _ r => |r|) := rfl + +variable (T) + +lemma families_bddAbove : BddAbove (Set.range (Family.seminorm (T := T))) := by + rw [Seminorm.bddAbove_range_iff] + intro u + exact ⟨u.sum (fun _ r => |r|), by rintro _ ⟨F, rfl⟩; exact F.test_le_l1 u⟩ + +def primalSeminorm : Seminorm ℝ (ι →₀ ℝ) := ⨆ F : T.Family, F.seminorm + +lemma test_le_primal (F : T.Family) (u : ι →₀ ℝ) : + ‖F.test u‖ ≤ T.primalSeminorm u := by + rw [primalSeminorm, Seminorm.iSup_apply T.families_bddAbove] + exact le_ciSup (⟨u.sum (fun _ r => |r|), by + rintro _ ⟨G, rfl⟩; exact G.test_le_l1 u⟩ : + BddAbove (Set.range (fun G : T.Family => G.seminorm u))) F + +lemma primal_le_l1 (u : ι →₀ ℝ) : + T.primalSeminorm u ≤ u.sum (fun _ r => |r|) := by + rw [primalSeminorm, Seminorm.iSup_apply T.families_bddAbove] + apply ciSup_le + intro F + exact F.test_le_l1 u + +/-- Singleton families ensure that the segment seminorm separates points. -/ +def singletonFamily (v : ι) : T.Family where + n := 1 + seg _ := {v} + allowed _ := T.singleton v + disjoint := by intro i j h; exact False.elim (h (Subsingleton.elim _ _)) + +lemma coordinate_le_primal (u : ι →₀ ℝ) (v : ι) : |u v| ≤ T.primalSeminorm u := by + have h := T.test_le_primal (T.singletonFamily v) u + rw [EuclideanSpace.norm_eq] at h + change Real.sqrt (∑ _ : Fin 1, ‖∑ w ∈ ({v} : Finset ι), u w‖ ^ 2) ≤ _ at h + simpa [Real.sqrt_sq_eq_abs] using h + +lemma primal_eq_zero_iff (u : ι →₀ ℝ) : T.primalSeminorm u = 0 ↔ u = 0 := by + constructor + · intro h + ext v + have := T.coordinate_le_primal u v + simpa [h] using this + · rintro rfl + exact map_zero _ + +/-- Finite families with any finite index type give the same segment tests. -/ +def familyOfFintype {κ : Type*} [Fintype κ] (S : κ → Finset ι) + (hS : ∀ i, T.IsSegment (S i)) + (hd : Pairwise (fun i j => Disjoint (S i) (S j))) : T.Family where + n := Fintype.card κ + seg i := S ((Fintype.equivFin κ).symm i) + allowed i := hS _ + disjoint := by + intro i j hij + exact hd (fun he => hij ((Fintype.equivFin κ).symm.injective he)) + +lemma test_energy_le {κ : Type*} [Fintype κ] (S : κ → Finset ι) + (hS : ∀ i, T.IsSegment (S i)) + (hd : Pairwise (fun i j => Disjoint (S i) (S j))) (u : ι →₀ ℝ) : + (∑ i, (∑ v ∈ S i, u v) ^ 2) ≤ (T.primalSeminorm u) ^ 2 := by + let F := T.familyOfFintype S hS hd + have hb := pow_le_pow_left₀ (norm_nonneg (F.test u)) (T.test_le_primal F u) 2 + rw [EuclideanSpace.norm_sq_eq] at hb + change (∑ i : Fin (Fintype.card κ), + ‖∑ v ∈ S ((Fintype.equivFin κ).symm i), u v‖ ^ 2) ≤ _ at hb + rw [(Fintype.equivFin κ).symm.sum_comp (fun i : κ => ‖∑ v ∈ S i, u v‖ ^ 2)] at hb + simpa only [Real.norm_eq_abs, sq_abs] using hb + +/-- Empty pieces in a partition may be discarded; they contribute no energy. -/ +lemma test_energy_le_allow_empty {κ : Type*} [Fintype κ] (S : κ → Finset ι) + (hS : ∀ i, (S i).Nonempty → T.IsSegment (S i)) + (hd : Pairwise (fun i j => Disjoint (S i) (S j))) (u : ι →₀ ℝ) : + (∑ i, (∑ v ∈ S i, u v) ^ 2) ≤ (T.primalSeminorm u) ^ 2 := by + classical + let K := {i : κ // (S i).Nonempty} + have h := T.test_energy_le (fun i : K => S i.val) (fun i => hS _ i.property) + (by intro i j hij; exact hd (fun he => hij (Subtype.ext he))) u + have hz : (∑ i : {i : κ // ¬ (S i).Nonempty}, (∑ v ∈ S i.val, u v) ^ 2) = 0 := by + apply Finset.sum_eq_zero + intro i _ + have hi : S i.val = ∅ := Finset.not_nonempty_iff_eq_empty.mp i.property + simp [hi] + have he := Fintype.sum_subtype_add_sum_subtype + (fun i : κ => (S i).Nonempty) (fun i => (∑ v ∈ S i, u v) ^ 2) + rw [hz, add_zero] at he + rwa [← he] + +def Primal (_T : SegmentSystem ι) := ι →₀ ℝ + +/-- Explicit conversions keep the chosen norm distinct from unrelated Finsupp structures. -/ +def ofPrimal (u : T.Primal) : ι →₀ ℝ := u + +def toPrimal (u : ι →₀ ℝ) : T.Primal := u + +def filterPrimal (p : ι → Prop) (u : T.Primal) : T.Primal := + (T.ofPrimal u).filter p + +instance : AddCommGroup T.Primal := inferInstanceAs (AddCommGroup (ι →₀ ℝ)) +instance : Module ℝ T.Primal := inferInstanceAs (Module ℝ (ι →₀ ℝ)) + +attribute [-simp] Family.test_apply Family.seminorm_apply in +instance : NormedAddCommGroup T.Primal := by + have Family.test_apply (F : T.Family) (u : ι →₀ ℝ) (i : Fin F.n) : + F.test u i = ∑ v ∈ F.seg i, u v := rfl + have Family.seminorm_apply (F : T.Family) (u : ι →₀ ℝ) : + F.seminorm u = ‖F.test u‖ := rfl + have Family.test_single_le (F : T.Family) (v : ι) (r : ℝ) : + ‖F.test (Finsupp.single v r)‖ ≤ |r| := by + classical + rw [EuclideanSpace.norm_eq] + apply (Real.sqrt_le_left (abs_nonneg r)).2 + by_cases h : ∃ i, v ∈ F.seg i + · obtain ⟨i, hi⟩ := h + have hne : ∀ j, j ≠ i → v ∉ F.seg j := by + intro j hji hj + exact Finset.disjoint_left.mp (F.disjoint hji) hj hi + rw [Finset.sum_eq_single i] + · simp [Family.test, Finsupp.single_apply, hi] + · intro j _ hji + simp [Family.test, Finsupp.single_apply, hne j hji] + · simp + · have hn : ∀ i, v ∉ F.seg i := by simpa using h + simp [Family.test, Finsupp.single_apply, hn, sq_nonneg] + have Family.test_le_l1 (F : T.Family) (u : ι →₀ ℝ) : + ‖F.test u‖ ≤ u.sum (fun _ r => |r|) := by + classical + calc + ‖F.test u‖ = ‖∑ v ∈ u.support, F.test (Finsupp.single v (u v))‖ := by + rw [← map_sum] + congr 2 + exact (Finsupp.sum_single u).symm + _ ≤ ∑ v ∈ u.support, ‖F.test (Finsupp.single v (u v))‖ := norm_sum_le _ _ + _ ≤ ∑ v ∈ u.support, |u v| := Finset.sum_le_sum fun v _ => Family.test_single_le F v (u v) + _ = u.sum (fun _ r => |r|) := rfl + have families_bddAbove : BddAbove (Set.range (Family.seminorm (T := T))) := by + rw [Seminorm.bddAbove_range_iff] + intro u + exact ⟨u.sum (fun _ r => |r|), by rintro _ ⟨F, rfl⟩; exact Family.test_le_l1 F u⟩ + have test_le_primal (F : T.Family) (u : ι →₀ ℝ) : + ‖F.test u‖ ≤ T.primalSeminorm u := by + rw [primalSeminorm, Seminorm.iSup_apply families_bddAbove] + exact le_ciSup (⟨u.sum (fun _ r => |r|), by + rintro _ ⟨G, rfl⟩; exact Family.test_le_l1 G u⟩ : + BddAbove (Set.range (fun G : T.Family => G.seminorm u))) F + have coordinate_le_primal (u : ι →₀ ℝ) (v : ι) : |u v| ≤ T.primalSeminorm u := by + have h := test_le_primal (T.singletonFamily v) u + rw [EuclideanSpace.norm_eq] at h + change Real.sqrt (∑ _ : Fin 1, ‖∑ w ∈ ({v} : Finset ι), u w‖ ^ 2) ≤ _ at h + simpa [Real.sqrt_sq_eq_abs] using h + have primal_eq_zero_iff (u : ι →₀ ℝ) : T.primalSeminorm u = 0 ↔ u = 0 := by + constructor + · intro h + ext v + have := coordinate_le_primal u v + simpa [h] using this + · rintro rfl + exact map_zero _ + exact AddGroupNorm.toNormedAddCommGroup + { T.primalSeminorm.toAddGroupSeminorm with + eq_zero_of_map_eq_zero' := fun u h => (primal_eq_zero_iff u).mp h } + +instance : NormedSpace ℝ T.Primal where + norm_smul_le c u := le_of_eq (T.primalSeminorm.smul' c u) + +@[simp] lemma ofPrimal_sub (u v : T.Primal) : + T.ofPrimal (u-v) = T.ofPrimal u - T.ofPrimal v := rfl + +@[simp] lemma ofPrimal_smul (a : ℝ) (u : T.Primal) : + T.ofPrimal (a • u) = a • T.ofPrimal u := rfl + +@[simp] lemma ofPrimal_sum {κ : Type*} (s : Finset κ) (f : κ → T.Primal) : + T.ofPrimal (∑ i ∈ s, f i) = ∑ i ∈ s, T.ofPrimal (f i) := rfl + +@[simp] lemma ofPrimal_filter (p : ι → Prop) (u : T.Primal) : + T.ofPrimal (T.filterPrimal p u) = (T.ofPrimal u).filter p := rfl + +@[simp] lemma norm_eq_primal (u : T.Primal) : + ‖u‖ = T.primalSeminorm (T.ofPrimal u) := rfl + +lemma sub_filterPrimal (p : ι → Prop) (u : T.Primal) : + u - T.filterPrimal p u = T.filterPrimal (fun x => ¬ p x) u := by + apply Finsupp.ext + intro v + change T.ofPrimal (u - T.filterPrimal p u) v = + T.ofPrimal (T.filterPrimal (fun x => ¬ p x) u) v + simp only [ofPrimal_sub, ofPrimal_filter, Finsupp.sub_apply, Finsupp.filter_apply] + split_ifs <;> simp_all + +abbrev JamesSpace := UniformSpace.Completion T.Primal + +/-- Its full real continuous dual. -/ +abbrev Dual := StrongDual ℝ T.JamesSpace + +/-- Coordinate evaluation on finite arrays, bounded by the singleton test. -/ +def coordinateFinite (v : ι) : T.Primal →L[ℝ] ℝ := by + have Family.test_apply (F : T.Family) (u : ι →₀ ℝ) (i : Fin F.n) : + F.test u i = ∑ v ∈ F.seg i, u v := rfl + have Family.seminorm_apply (F : T.Family) (u : ι →₀ ℝ) : + F.seminorm u = ‖F.test u‖ := rfl + have Family.test_single_le (F : T.Family) (v : ι) (r : ℝ) : + ‖F.test (Finsupp.single v r)‖ ≤ |r| := by + classical + rw [EuclideanSpace.norm_eq] + apply (Real.sqrt_le_left (abs_nonneg r)).2 + by_cases h : ∃ i, v ∈ F.seg i + · obtain ⟨i, hi⟩ := h + have hne : ∀ j, j ≠ i → v ∉ F.seg j := by + intro j hji hj + exact Finset.disjoint_left.mp (F.disjoint hji) hj hi + rw [Finset.sum_eq_single i] + · simp [Family.test, Finsupp.single_apply, hi] + · intro j _ hji + simp [Family.test, Finsupp.single_apply, hne j hji] + · simp + · have hn : ∀ i, v ∉ F.seg i := by simpa using h + simp [Family.test, Finsupp.single_apply, hn, sq_nonneg] + have Family.test_le_l1 (F : T.Family) (u : ι →₀ ℝ) : + ‖F.test u‖ ≤ u.sum (fun _ r => |r|) := by + classical + calc + ‖F.test u‖ = ‖∑ v ∈ u.support, F.test (Finsupp.single v (u v))‖ := by + rw [← map_sum] + congr 2 + exact (Finsupp.sum_single u).symm + _ ≤ ∑ v ∈ u.support, ‖F.test (Finsupp.single v (u v))‖ := norm_sum_le _ _ + _ ≤ ∑ v ∈ u.support, |u v| := Finset.sum_le_sum fun v _ => Family.test_single_le F v (u v) + _ = u.sum (fun _ r => |r|) := rfl + have families_bddAbove : BddAbove (Set.range (Family.seminorm (T := T))) := by + rw [Seminorm.bddAbove_range_iff] + intro u + exact ⟨u.sum (fun _ r => |r|), by rintro _ ⟨F, rfl⟩; exact Family.test_le_l1 F u⟩ + have test_le_primal (F : T.Family) (u : ι →₀ ℝ) : + ‖F.test u‖ ≤ T.primalSeminorm u := by + rw [primalSeminorm, Seminorm.iSup_apply families_bddAbove] + exact le_ciSup (⟨u.sum (fun _ r => |r|), by + rintro _ ⟨G, rfl⟩; exact Family.test_le_l1 G u⟩ : + BddAbove (Set.range (fun G : T.Family => G.seminorm u))) F + have coordinate_le_primal (u : ι →₀ ℝ) (v : ι) : |u v| ≤ T.primalSeminorm u := by + have h := test_le_primal (T.singletonFamily v) u + rw [EuclideanSpace.norm_eq] at h + change Real.sqrt (∑ _ : Fin 1, ‖∑ w ∈ ({v} : Finset ι), u w‖ ^ 2) ≤ _ at h + simpa [Real.sqrt_sq_eq_abs] using h + exact (show T.Primal →ₗ[ℝ] ℝ from Finsupp.lapply v).mkContinuous 1 (by + intro u + change ‖(show ι →₀ ℝ from u) v‖ ≤ 1 * T.primalSeminorm u + simpa only [one_mul, Real.norm_eq_abs] using coordinate_le_primal u v) + +def coordinate (v : ι) : T.Dual := + (T.coordinateFinite v).extend UniformSpace.Completion.toComplL + +@[simp] lemma coordinate_coe (v : ι) (u : T.Primal) : + T.coordinate v (u : T.JamesSpace) = (show ι →₀ ℝ from u) v := by + exact ContinuousLinearMap.extend_eq _ UniformSpace.Completion.denseRange_coe + (UniformSpace.Completion.isUniformInducing_coe _) u + +/-- Primal unit coordinate and its canonical image in the completion. -/ +def unitFinite (v : ι) : T.Primal := Finsupp.single v 1 + +def unitVector (v : ι) : T.JamesSpace := (T.unitFinite v : T.JamesSpace) + +@[simp] lemma norm_unitFinite (v : ι) : ‖T.unitFinite v‖ = 1 := by + change T.primalSeminorm (Finsupp.single v 1) = 1 + apply le_antisymm + · have h := T.primal_le_l1 (Finsupp.single v 1) + simpa using h + · have h := T.coordinate_le_primal (Finsupp.single v 1) v + simpa using h + +@[simp] lemma norm_unitVector (v : ι) : ‖T.unitVector v‖ = 1 := by + rw [unitVector, UniformSpace.Completion.norm_coe, norm_unitFinite] + +@[simp] lemma coordinate_unitVector (v w : ι) : + T.coordinate v (T.unitVector w) = if w = v then 1 else 0 := by + classical + rw [unitVector, coordinate_coe] + exact Finsupp.single_apply + +/-- Finite head projection on the completed primal, defined even for nonancestral sets. -/ +def headPrimal (H : Finset ι) : T.JamesSpace →L[ℝ] T.JamesSpace := + ∑ v ∈ H, (T.coordinate v).smulRight (T.unitVector v) + +@[simp] lemma headPrimal_apply (H : Finset ι) (u : T.JamesSpace) : + T.headPrimal H u = ∑ v ∈ H, T.coordinate v u • T.unitVector v := by + simp [headPrimal] + +lemma sum_units_eq_filter (H : Finset ι) (u : T.Primal) : + (∑ v ∈ H, T.ofPrimal u v • T.unitFinite v) = T.filterPrimal (· ∈ H) u := by + classical + apply Finsupp.ext + intro w + change T.ofPrimal (∑ v ∈ H, T.ofPrimal u v • T.unitFinite v) w = + T.ofPrimal (T.filterPrimal (· ∈ H) u) w + simp only [ofPrimal_sum, ofPrimal_smul, ofPrimal_filter, Finsupp.finsetSum_apply, + Finsupp.smul_apply, smul_eq_mul] + simp [ofPrimal, unitFinite, Finsupp.single_apply, + mul_ite, Finset.sum_ite_eq'] + convert (Finsupp.filter_apply (· ∈ H) (T.ofPrimal u) w).symm using 1 + all_goals congr + +lemma headPrimal_coe (H : Finset ι) (u : T.Primal) : + T.headPrimal H (u : T.JamesSpace) = + (T.filterPrimal (· ∈ H) u : T.JamesSpace) := by + classical + rw [headPrimal_apply, ← T.sum_units_eq_filter] + simp only [coordinate_coe, unitVector] + change (∑ v ∈ H, T.ofPrimal u v • + (UniformSpace.Completion.toComplL (S := ℝ)) (T.unitFinite v)) = + (UniformSpace.Completion.toComplL (S := ℝ)) (∑ v ∈ H, T.ofPrimal u v • T.unitFinite v) + simp only [map_sum, map_smul] + +def headDual (H : Finset ι) : T.Dual →L[ℝ] T.Dual := + ∑ v ∈ H, (ContinuousLinearMap.apply ℝ ℝ (T.unitVector v)).smulRight (T.coordinate v) + +@[simp] lemma headDual_apply (H : Finset ι) (x : T.Dual) : + T.headDual H x = ∑ v ∈ H, x (T.unitVector v) • T.coordinate v := by + simp [headDual] + +lemma headDual_apply_apply (H : Finset ι) (x : T.Dual) (u : T.JamesSpace) : + T.headDual H x u = x (T.headPrimal H u) := by + simp [headDual_apply, headPrimal_apply, mul_comm] + +/-- Complementary coordinate projection, never assumed contractive without proof. -/ +def tailDual (H : Finset ι) : T.Dual →L[ℝ] T.Dual := + ContinuousLinearMap.id ℝ T.Dual - T.headDual H + +@[simp] lemma tailDual_apply (H : Finset ι) (x : T.Dual) : + T.tailDual H x = x - T.headDual H x := rfl + +lemma tailDual_apply_apply (H : Finset ι) (x : T.Dual) (u : T.JamesSpace) : + T.tailDual H x u = x (u - T.headPrimal H u) := by + simp [tailDual_apply, mul_comm] + +/-- The canonical linear embedding, presented on actual finitely supported arrays. -/ +def finiteEmbedding : (ι →₀ ℝ) →ₗ[ℝ] T.JamesSpace := + (UniformSpace.Completion.toComplL (S := ℝ) (α := T.Primal)).toLinearMap + +@[simp] lemma finiteEmbedding_apply (u : ι →₀ ℝ) : + T.finiteEmbedding u = (T.toPrimal u : T.JamesSpace) := rfl + +@[simp] lemma finiteEmbedding_single (v : ι) (a : ℝ) : + T.finiteEmbedding (Finsupp.single v a) = a • T.unitVector v := by + have he : Finsupp.single v a = a • (Finsupp.single v 1 : ι →₀ ℝ) := by + simp only [Finsupp.smul_single, smul_eq_mul, mul_one] + rw [he, map_smul] + rfl + +lemma dual_coe_apply (x : T.Dual) (u : T.Primal) : + x (u : T.JamesSpace) = ∑ v ∈ (T.ofPrimal u).support, T.ofPrimal u v * x (T.unitVector v) := by + have hu := Finsupp.sum_single (T.ofPrimal u) + have he := congrArg (fun z => x (T.finiteEmbedding z)) hu + simp only [Finsupp.sum, map_sum, finiteEmbedding_single, map_smul, smul_eq_mul] at he + change (∑ v ∈ (T.ofPrimal u).support, T.ofPrimal u v * x (T.unitVector v)) = + x (u : T.JamesSpace) at he + exact he.symm + +/-- Full dual functionals are determined by all coordinate unit vectors. -/ +lemma dual_ext {x y : T.Dual} (h : ∀ v, x (T.unitVector v) = y (T.unitVector v)) : x = y := by + apply ContinuousLinearMap.ext + intro u + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_eq (by fun_prop) (by fun_prop) + | ih u => simp only [dual_coe_apply, h] + +def segmentFunctional (S : Finset ι) : T.Dual := ∑ v ∈ S, T.coordinate v + +@[simp] lemma segmentFunctional_coe (S : Finset ι) (u : T.Primal) : + T.segmentFunctional S (u : T.JamesSpace) = ∑ v ∈ S, T.ofPrimal u v := by + simp only [segmentFunctional, sum_apply, coordinate_coe, ofPrimal] + +@[simp] lemma segmentFunctional_unit (S : Finset ι) (v : ι) : + T.segmentFunctional S (T.unitVector v) = if v ∈ S then 1 else 0 := by + classical + simp [segmentFunctional, coordinate_unitVector] + +/-- Finite represented vectors retain their segment families as data. -/ +def combine {κ : Type*} [Fintype κ] (S : κ → Finset ι) (a : κ → ℝ) : T.Dual := + ∑ i, a i • T.segmentFunctional (S i) + +@[simp] lemma combine_coe {κ : Type*} [Fintype κ] (S : κ → Finset ι) + (a : κ → ℝ) (u : T.Primal) : + T.combine S a (u : T.JamesSpace) = ∑ i, a i * (∑ v ∈ S i, T.ofPrimal u v) := by + simp only [combine, sum_apply, smul_apply, + segmentFunctional_coe, smul_eq_mul] + +@[simp] lemma combine_unit {κ : Type*} [Fintype κ] (S : κ → Finset ι) + (a : κ → ℝ) (v : ι) : + T.combine S a (T.unitVector v) = ∑ i, if v ∈ S i then a i else 0 := by + simp only [combine, sum_apply, smul_apply, + segmentFunctional_unit, smul_eq_mul, mul_ite, mul_one, mul_zero] + +lemma combine_add {κ : Type*} [Fintype κ] (S : κ → Finset ι) (a b : κ → ℝ) : + T.combine S (a+b) = T.combine S a + T.combine S b := by + simp [combine, add_smul, Finset.sum_add_distrib] + +lemma combine_sub {κ : Type*} [Fintype κ] (S : κ → Finset ι) (a b : κ → ℝ) : + T.combine S (a-b) = T.combine S a - T.combine S b := by + unfold combine + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i _ + exact sub_smul (a i) (b i) (T.segmentFunctional (S i)) + +lemma combine_unit_of_mem (F : T.Family) (a : Fin F.n → ℝ) + (i : Fin F.n) {v : ι} (hv : v ∈ F.seg i) : + T.combine F.seg a (T.unitVector v) = a i := by + classical + rw [combine_unit, Finset.sum_eq_single i] + · simp only [ite_eq_left hv] + · intro j _ hji + rw [ite_eq_right (fun h => Finset.disjoint_left.mp (F.disjoint hji) h hv)] + · simp + +/-- Cauchy--Schwarz for represented disjoint segment coefficients, with empty + pieces permitted after a projection. -/ +lemma norm_combine_le {κ : Type*} [Fintype κ] (S : κ → Finset ι) (a : κ → ℝ) + (hS : ∀ i, (S i).Nonempty → T.IsSegment (S i)) + (hd : Pairwise (fun i j => Disjoint (S i) (S j))) : + ‖T.combine S a‖ ≤ Real.sqrt (∑ i, (a i) ^ 2) := by + apply ContinuousLinearMap.opNorm_le_bound _ (Real.sqrt_nonneg _) + intro u + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih u => + rw [combine_coe, Real.norm_eq_abs, UniformSpace.Completion.norm_coe, norm_eq_primal] + have htest : Real.sqrt (∑ i, (∑ v ∈ S i, T.ofPrimal u v) ^ 2) ≤ + T.primalSeminorm (T.ofPrimal u) := by + exact (Real.sqrt_le_left (apply_nonneg _ _)).mpr + (T.test_energy_le_allow_empty S hS hd (T.ofPrimal u)) + calc + |∑ i, a i * (∑ v ∈ S i, T.ofPrimal u v)| ≤ + ∑ i, |a i * (∑ v ∈ S i, T.ofPrimal u v)| := Finset.abs_sum_le_sum_abs _ _ + _ = ∑ i, |a i| * |∑ v ∈ S i, T.ofPrimal u v| := by simp only [abs_mul] + _ ≤ Real.sqrt (∑ i, (a i) ^ 2) * + Real.sqrt (∑ i, (∑ v ∈ S i, T.ofPrimal u v) ^ 2) := by + simpa only [sq_abs] using Real.sum_mul_le_sqrt_mul_sqrt Finset.univ + (fun i => |a i|) (fun i => |∑ v ∈ S i, T.ofPrimal u v|) + _ ≤ _ := mul_le_mul_of_nonneg_left htest (Real.sqrt_nonneg _) + +/-- A finite family of disjoint cones can be tested by independently maximizing + each cone's represented segment. This is the finite dual reconstruction bound. -/ +lemma norm_cone_mean_le {Ω κ : Type*} [Fintype Ω] [Nonempty Ω] [Fintype κ] + (S : Ω → κ → Finset ι) (a : Ω → κ → ℝ) (w : Ω → ℝ) (hw : ∀ ω, 0 ≤ w ω) + (hS : ∀ ω g, (S ω g).Nonempty → T.IsSegment (S ω g)) + (hd : ∀ g h, g ≠ h → ∀ ω ν, Disjoint (S ω g) (S ν h)) : + ‖∑ ω, w ω • T.combine (S ω) (a ω)‖ ≤ + Real.sqrt (∑ g, (∑ ω, w ω * |a ω g|) ^ 2) := by + classical + apply ContinuousLinearMap.opNorm_le_bound _ (Real.sqrt_nonneg _) + intro u + induction u using UniformSpace.Completion.induction_on with + | hp => exact isClosed_le (by fun_prop) (by fun_prop) + | ih u => + rw [sum_apply] + simp only [smul_apply, smul_eq_mul, combine_coe, Real.norm_eq_abs, + UniformSpace.Completion.norm_coe, norm_eq_primal] + choose idx hidx hmax using fun g : κ => Finset.exists_max_image Finset.univ + (fun ω => |∑ v ∈ S ω g, T.ofPrimal u v|) Finset.univ_nonempty + let t : κ → ℝ := fun g => |∑ v ∈ S (idx g) g, T.ofPrimal u v| + have ht (ω : Ω) (g : κ) : |∑ v ∈ S ω g, T.ofPrimal u v| ≤ t g := + hmax g ω (Finset.mem_univ _) + have htest : Real.sqrt (∑ g, t g ^ 2) ≤ T.primalSeminorm (T.ofPrimal u) := by + apply (Real.sqrt_le_left (apply_nonneg _ _)).2 + simpa only [t, sq_abs] using T.test_energy_le_allow_empty + (fun g => S (idx g) g) (fun g => hS (idx g) g) + (fun {g h} hgh => hd g h hgh (idx g) (idx h)) (T.ofPrimal u) + calc + |∑ ω, w ω * ∑ g, a ω g * (∑ v ∈ S ω g, T.ofPrimal u v)| ≤ + ∑ ω, |w ω * ∑ g, a ω g * (∑ v ∈ S ω g, T.ofPrimal u v)| := + Finset.abs_sum_le_sum_abs _ _ + _ = ∑ ω, w ω * |∑ g, a ω g * (∑ v ∈ S ω g, T.ofPrimal u v)| := by + simp only [abs_mul, abs_of_nonneg (hw _)] + _ ≤ ∑ ω, w ω * (∑ g, |a ω g| * t g) := by + apply Finset.sum_le_sum + intro ω _ + apply mul_le_mul_of_nonneg_left _ (hw ω) + calc + _ ≤ ∑ g, |a ω g * (∑ v ∈ S ω g, T.ofPrimal u v)| := Finset.abs_sum_le_sum_abs _ _ + _ ≤ _ := by + apply Finset.sum_le_sum + intro g _ + rw [abs_mul] + exact mul_le_mul_of_nonneg_left (ht ω g) (abs_nonneg _) + _ = ∑ g, (∑ ω, w ω * |a ω g|) * t g := by + simp_rw [Finset.mul_sum, Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro g _ + apply Finset.sum_congr rfl + intro ω _ + ring + _ ≤ Real.sqrt (∑ g, (∑ ω, w ω * |a ω g|) ^ 2) * Real.sqrt (∑ g, t g ^ 2) := + Real.sum_mul_le_sqrt_mul_sqrt _ _ _ + _ ≤ _ := mul_le_mul_of_nonneg_left htest (Real.sqrt_nonneg _) + +lemma combine_smul {κ : Type*} [Fintype κ] (S : κ → Finset ι) (a : κ → ℝ) (c : ℝ) : + T.combine S (fun i => c * a i) = c • T.combine S a := by + simp only [combine, mul_smul, Finset.smul_sum] + +lemma headDual_unit (H : Finset ι) (x : T.Dual) (v : ι) : + T.headDual H x (T.unitVector v) = if v ∈ H then x (T.unitVector v) else 0 := by + classical + simp [headDual_apply, coordinate_unitVector, mul_ite, Finset.sum_ite_eq] + +lemma headDual_eq_self {H : Finset ι} {x : T.Dual} + (hx : ∀ v, v ∉ H → x (T.unitVector v) = 0) : T.headDual H x = x := by + apply T.dual_ext + intro v + rw [headDual_unit] + split_ifs with hv + · rfl + · exact (hx v hv).symm + +lemma headDual_finite_apply {H : Finset ι} (x : T.Dual) (u : T.Primal) + (hu : (T.ofPrimal u).support ⊆ H) : + T.headDual H x (u : T.JamesSpace) = x (u : T.JamesSpace) := by + rw [dual_coe_apply, dual_coe_apply] + apply Finset.sum_congr rfl + intro v hv + rw [headDual_unit, ite_eq_left (hu hv)] + +lemma headDual_commute (H K : Finset ι) (x : T.Dual) : + T.headDual H (T.headDual K x) = T.headDual K (T.headDual H x) := by + apply T.dual_ext + intro v + simp only [headDual_unit] + split_ifs <;> rfl + +lemma tailDual_headDual (H K : Finset ι) (x : T.Dual) : + T.tailDual H (T.headDual K x) = T.headDual K (T.tailDual H x) := by + rw [tailDual_apply, tailDual_apply, map_sub, headDual_commute] + +/-- The array representing an arbitrary completed vector's finite head. -/ +def headArray (H : Finset ι) (u : T.JamesSpace) : ι →₀ ℝ := + ∑ v ∈ H, T.coordinate v u • Finsupp.single v 1 + +lemma headArray_outside (H : Finset ι) (u : T.JamesSpace) {v : ι} (hv : v ∉ H) : + T.headArray H u v = 0 := by + classical + simp [headArray, Finsupp.finsetSum_apply, Finsupp.single_apply, hv, + Finset.sum_ite_eq'] + +lemma finiteEmbedding_headArray (H : Finset ι) (u : T.JamesSpace) : + T.finiteEmbedding (T.headArray H u) = T.headPrimal H u := by + simp only [headArray, map_sum, map_smul, finiteEmbedding_single, one_smul, + headPrimal_apply] + +lemma headDual_segment (H S : Finset ι) : + T.headDual H (T.segmentFunctional S) = T.segmentFunctional (S.filter (· ∈ H)) := by + apply T.dual_ext + intro v + rw [headDual_unit, segmentFunctional_unit, segmentFunctional_unit] + simp only [Finset.mem_filter] + split_ifs <;> simp_all + +lemma tailDual_segment (H S : Finset ι) : + T.tailDual H (T.segmentFunctional S) = T.segmentFunctional (S.filter (· ∉ H)) := by + apply T.dual_ext + intro v + simp only [tailDual_apply, sub_apply, headDual_unit, + segmentFunctional_unit, Finset.mem_filter] + split_ifs <;> simp_all + +lemma headDual_combine {κ : Type*} [Fintype κ] (H : Finset ι) (S : κ → Finset ι) (a : κ → ℝ) : + T.headDual H (T.combine S a) = T.combine (fun i => (S i).filter (· ∈ H)) a := by + simp only [combine, map_sum, map_smul, headDual_segment] + +lemma tailDual_combine {κ : Type*} [Fintype κ] (H : Finset ι) (S : κ → Finset ι) (a : κ → ℝ) : + T.tailDual H (T.combine S a) = T.combine (fun i => (S i).filter (· ∉ H)) a := by + simp only [combine, map_sum, map_smul, tailDual_segment] + +abbrev Coordinates (_T : SegmentSystem ι) (K : Finset ι) := K → ℝ + +def coordinateTest (K : Finset ι) (a : T.Coordinates K) : ι →₀ ℝ := + Finsupp.onFinset K (fun v => if h : v ∈ K then a ⟨v, h⟩ else 0) (by + intro v hv + by_contra h + simp only [dite_eq_right h] at hv + exact hv rfl) + +@[simp] lemma coordinateTest_mem (K : Finset ι) (a : T.Coordinates K) (v : K) : + T.coordinateTest K a v.val = a v := by simp [coordinateTest] + +lemma coordinateTest_not_mem (K : Finset ι) (a : T.Coordinates K) + {v : ι} (hv : v ∉ K) : T.coordinateTest K a v = 0 := by simp [coordinateTest, hv] + +lemma coordinateTest_sum (K S : Finset ι) (a : T.Coordinates K) (hSK : S ⊆ K) : + (∑ v ∈ S, T.coordinateTest K a v) = + ∑ v : K, if v.val ∈ S then a v else 0 := by + classical + have hfilter : K.filter (· ∈ S) = S := by ext v; simp; exact fun h => hSK h + calc + _ = ∑ v ∈ K, if v ∈ S then T.coordinateTest K a v else 0 := by + rw [← Finset.sum_filter, hfilter] + _ = ∑ v : K, if v.val ∈ S then T.coordinateTest K a v.val else 0 := + (Finset.sum_coe_sort K _).symm + _ = _ := by simp only [coordinateTest_mem] + +lemma functional_pi_formula (K : Finset ι) (f : T.Coordinates K →L[ℝ] ℝ) + (z : T.Coordinates K) : f z = ∑ v : K, z v * f (Pi.single v 1) := by + classical + have hz : z = ∑ v : K, z v • (Pi.single v 1 : T.Coordinates K) := by + ext w + simp [Pi.single_apply, Finset.sum_apply, mul_ite, Finset.sum_ite_eq] + conv_lhs => rw [hz] + simp only [map_sum, map_smul, smul_eq_mul] + +/-- All local disjoint families. This type is finite even when the tree branches + countably, because each member is a family of subsets of the fixed head K. -/ +def LocalFamily (K : Finset ι) := {F : Finset (Finset ι) // + F ∈ K.powerset.powerset ∧ (∀ S ∈ F, T.IsSegment S) ∧ (F : Set (Finset ι)).Pairwise Disjoint} + +instance localFamilyFintype (K : Finset ι) : Fintype (T.LocalFamily K) := + Fintype.subtype (K.powerset.powerset.filter + (fun F => (∀ S ∈ F, T.IsSegment S) ∧ (F : Set (Finset ι)).Pairwise Disjoint)) (by intro F; simp) + +abbrev LocalIndex {K : Finset ι} (F : T.LocalFamily K) := ↥F.val + +lemma localFamily_subset {K : Finset ι} (F : T.LocalFamily K) (S : T.LocalIndex F) : + S.val ⊆ K := + Finset.mem_powerset.mp ((Finset.mem_powerset.mp F.property.1) S.property) + +lemma localFamily_allowed {K : Finset ι} (F : T.LocalFamily K) (S : T.LocalIndex F) : + T.IsSegment S.val := F.property.2.1 _ S.property + +lemma localFamily_disjoint {K : Finset ι} (F : T.LocalFamily K) : + Pairwise (fun S U : T.LocalIndex F => Disjoint S.val U.val) := by + intro S U hne + exact F.property.2.2 S.property U.property (fun h => hne (Subtype.ext h)) + +variable {T} + +def LocalFamily.asFamily {K : Finset ι} (F : T.LocalFamily K) : T.Family where + n := Fintype.card (T.LocalIndex F) + seg i := ((Fintype.equivFin (T.LocalIndex F)).symm i).val + allowed i := T.localFamily_allowed F _ + disjoint := by + intro i j hij + apply T.localFamily_disjoint F + exact fun h => hij ((Fintype.equivFin (T.LocalIndex F)).symm.injective h) + +def LocalFamily.reindex {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) : Fin F.asFamily.n → ℝ := + fun i => a ((Fintype.equivFin (T.LocalIndex F)).symm i) + +lemma LocalFamily.reindex_energy {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) : + (∑ i, F.reindex a i ^ 2) = ‖a‖ ^ 2 := by + rw [EuclideanSpace.norm_sq_eq] + simp only [Real.norm_eq_abs, sq_abs] + exact (Fintype.equivFin (T.LocalIndex F)).symm.sum_comp (fun i => a i ^ 2) + +lemma LocalFamily.reindex_combine {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) : + T.combine F.asFamily.seg (F.reindex a) = T.combine (fun S : T.LocalIndex F => S.val) a := by + unfold combine + exact (Fintype.equivFin (T.LocalIndex F)).symm.sum_comp + (fun S => a S • T.segmentFunctional S.val) + +lemma LocalFamily.asFamily_subset {K : Finset ι} (F : T.LocalFamily K) + (i : Fin F.asFamily.n) : F.asFamily.seg i ⊆ K := + T.localFamily_subset F _ + +variable (T) + +/-- Local atoms as linear images of Euclidean blocks. -/ +def localMap {K : Finset ι} (F : T.LocalFamily K) : + EuclideanSpace ℝ (T.LocalIndex F) →ₗ[ℝ] T.Coordinates K where + toFun a v := ∑ S : T.LocalIndex F, if v.val ∈ S.val then a S else 0 + map_add' a b := by + ext v + simp only [Pi.add_apply, PiLp.add_apply] + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro S _ + split_ifs <;> simp + map_smul' a b := by + ext v + simp only [Pi.smul_apply, smul_eq_mul, RingHom.id_apply] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro S _ + split_ifs <;> simp + +lemma localMap_combine {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) (v : K) : + T.localMap F a v = T.combine (fun S : T.LocalIndex F => S.val) a (T.unitVector v.val) := by + simp [localMap, combine_unit] + +lemma functional_localMap {K : Finset ι} (F : T.LocalFamily K) + (f : T.Coordinates K →L[ℝ] ℝ) (a : EuclideanSpace ℝ (T.LocalIndex F)) : + f (T.localMap F a) = ∑ S : T.LocalIndex F, a S * + (∑ v ∈ S.val, T.coordinateTest K (fun w => f (Pi.single w 1)) v) := by + classical + rw [T.functional_pi_formula] + simp only [localMap, LinearMap.coe_mk, AddHom.coe_mk, Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro S _ + rw [T.coordinateTest_sum K S.val _ (T.localFamily_subset F S), Finset.mul_sum] + apply Finset.sum_congr rfl + intro v _ + split_ifs <;> simp + +lemma finiteEmbedding_norm (p : ι →₀ ℝ) : + ‖T.finiteEmbedding p‖ = T.primalSeminorm p := by + rw [finiteEmbedding_apply, UniformSpace.Completion.norm_coe] + rfl + +lemma coordinateTest_pairing (K : Finset ι) (a : T.Coordinates K) (x : T.Dual) : + x (T.finiteEmbedding (T.coordinateTest K a)) = + ∑ v : K, a v * x (T.unitVector v.val) := by + classical + rw [finiteEmbedding_apply, dual_coe_apply] + change (∑ v ∈ (T.coordinateTest K a).support, + T.coordinateTest K a v * x (T.unitVector v)) = _ + have hs : (T.coordinateTest K a).support ⊆ K := by + intro v hv + by_contra hn + exact Finsupp.mem_support_iff.mp hv (T.coordinateTest_not_mem K a hn) + calc + _ = ∑ v ∈ K, T.coordinateTest K a v * x (T.unitVector v) := by + apply Finset.sum_subset hs + intro v _ hv + rw [Finsupp.notMem_support_iff.mp hv, zero_mul] + _ = ∑ v : K, T.coordinateTest K a v.val * x (T.unitVector v.val) := + (Finset.sum_coe_sort K _).symm + _ = _ := by simp only [coordinateTest_mem] + +lemma local_energy_le_of_functional_bound {K : Finset ι} (F : T.LocalFamily K) + (f : T.Coordinates K →L[ℝ] ℝ) {u : ℝ} (hu : 0 ≤ u) + (hf : ∀ a : EuclideanSpace ℝ (T.LocalIndex F), ‖a‖ ≤ 1 → + f (T.localMap F a) ≤ u) : + (∑ S : T.LocalIndex F, (∑ v ∈ S.val, + T.coordinateTest K (fun w => f (Pi.single w 1)) v) ^ 2) ≤ u ^ 2 := by + classical + let b : EuclideanSpace ℝ (T.LocalIndex F) := WithLp.toLp 2 + (fun S => ∑ v ∈ S.val, T.coordinateTest K (fun w => f (Pi.single w 1)) v) + have he : (∑ S : T.LocalIndex F, (∑ v ∈ S.val, + T.coordinateTest K (fun w => f (Pi.single w 1)) v) ^ 2) = ‖b‖ ^ 2 := by + rw [EuclideanSpace.norm_sq_eq] + simp only [b, Real.norm_eq_abs, sq_abs] + rw [he] + apply (sq_le_sq₀ (norm_nonneg _) hu).2 + by_cases hb : b = 0 + · simpa only [hb, norm_zero] using hu + have hn : ‖b‖ ≠ 0 := norm_ne_zero_iff.mpr hb + have hbn : ‖‖b‖⁻¹ • b‖ ≤ 1 := by + rw [norm_smul, Real.norm_eq_abs, abs_of_nonneg (inv_nonneg.mpr (norm_nonneg _)), + inv_mul_cancel₀ hn] + have h := hf (‖b‖⁻¹ • b) hbn + rw [T.functional_localMap] at h + have hsum : (∑ S : T.LocalIndex F, (‖b‖⁻¹ • b) S * + (∑ v ∈ S.val, T.coordinateTest K (fun w => f (Pi.single w 1)) v)) = ‖b‖ := by + simp only [PiLp.smul_apply, smul_eq_mul] + change (∑ S, ‖b‖⁻¹ * b S * b S) = ‖b‖ + simp_rw [mul_assoc, ← sq] + rw [← Finset.mul_sum] + have hb2 : (∑ S, b S ^ 2) = ‖b‖ ^ 2 := by + rw [EuclideanSpace.norm_sq_eq] + simp only [Real.norm_eq_abs, sq_abs] + rw [hb2, sq, ← mul_assoc, inv_mul_cancel₀ hn, one_mul] + rwa [hsum] at h + +/-- An l1-of-Euclidean-block ball gives a compact convex parameter space for all + finite atomic combinations. No Caratheodory theorem is assumed. -/ +abbrev Coefficients (K : Finset ι) := + (F : T.LocalFamily K) → EuclideanSpace ℝ (T.LocalIndex F) + +def totalMap (K : Finset ι) : T.Coefficients K →ₗ[ℝ] T.Coordinates K where + toFun c := ∑ F, T.localMap F (c F) + map_add' c d := by simp only [Pi.add_apply, map_add, Finset.sum_add_distrib] + map_smul' a c := by simp only [Pi.smul_apply, map_smul, Finset.smul_sum, RingHom.id_apply] + +def coefficientBall (K : Finset ι) (R : ℝ) : Set (T.Coefficients K) := + {c | ∑ F, ‖c F‖ ≤ R} + +lemma coefficientBall_compact (K : Finset ι) {R : ℝ} (hR : 0 ≤ R) : + IsCompact (T.coefficientBall K R) := by + apply (isCompact_closedBall (0 : T.Coefficients K) R).of_isClosed_subset + · exact isClosed_le (by fun_prop) continuous_const + · intro c hc + simp only [Metric.mem_closedBall, dist_zero_right] + apply (pi_norm_le_iff_of_nonneg hR).mpr + intro F + exact (Finset.single_le_sum (fun G _ => norm_nonneg (c G)) (Finset.mem_univ F)).trans hc + +lemma coefficientBall_convex (K : Finset ι) (R : ℝ) : + Convex ℝ (T.coefficientBall K R) := by + intro c hc d hd a b ha hb hab + change ∑ F, ‖a • c F + b • d F‖ ≤ R + calc + _ ≤ ∑ F, (a * ‖c F‖ + b * ‖d F‖) := by + apply Finset.sum_le_sum + intro F _ + calc + ‖a • c F + b • d F‖ ≤ ‖a • c F‖ + ‖b • d F‖ := norm_add_le _ _ + _ = _ := by rw [norm_smul, norm_smul, Real.norm_eq_abs, Real.norm_eq_abs, + abs_of_nonneg ha, abs_of_nonneg hb] + _ = a * (∑ F, ‖c F‖) + b * (∑ F, ‖d F‖) := by + rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] + _ ≤ a * R + b * R := add_le_add (mul_le_mul_of_nonneg_left hc ha) + (mul_le_mul_of_nonneg_left hd hb) + _ = R := by rw [← add_mul, hab, one_mul] + +lemma totalMap_single (K : Finset ι) (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) : + T.totalMap K (Pi.single F a) = T.localMap F a := by + classical + rw [totalMap, LinearMap.coe_mk, AddHom.coe_mk, Finset.sum_eq_single F] + · rw [Pi.single_eq_same] + · intro G _ hGF + rw [Pi.single_eq_of_ne hGF, map_zero] + · simp + +lemma single_mem_coefficientBall (K : Finset ι) (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) {R : ℝ} (ha : ‖a‖ ≤ R) : + Pi.single F a ∈ T.coefficientBall K R := by + classical + change ∑ G, ‖(Pi.single F a : T.Coefficients K) G‖ ≤ R + rw [Finset.sum_eq_single F] + · simpa only [Pi.single_eq_same] using ha + · intro G _ hGF + rw [Pi.single_eq_of_ne hGF, norm_zero] + · simp + +/-- A represented atom includes its coefficients, rather than just its value. -/ +structure Atom (R : ℝ) where + family : T.Family + coeff : Fin family.n → ℝ + energy_le : (∑ i, coeff i ^ 2) ≤ R ^ 2 + +def Atom.value {T : SegmentSystem ι} {R : ℝ} (a : T.Atom R) : T.Dual := + T.combine a.family.seg a.coeff + +/-- Finite convex atom laws, with explicit probabilities and mean. -/ +structure AtomLaw (Ω : Type*) [Fintype Ω] (R : ℝ) (x : T.Dual) where + atom : Ω → T.Atom R + weight : Ω → ℝ + nonneg : ∀ ω, 0 ≤ weight ω + sum_one : ∑ ω, weight ω = 1 + mean : (∑ ω, weight ω • (atom ω).value) = x + +def zeroAtom (R : ℝ) : T.Atom R where + family := { + n := 0 + seg := Fin.elim0 + allowed := fun i => Fin.elim0 i + disjoint := fun {i} => Fin.elim0 i } + coeff := Fin.elim0 + energy_le := by simpa using sq_nonneg R + +@[simp] lemma zeroAtom_value (R : ℝ) : (T.zeroAtom R).value = 0 := by + change (∑ i : Fin 0, (Fin.elim0 i : ℝ) • T.segmentFunctional (Fin.elim0 i)) = 0 + exact Finset.sum_eq_zero (fun i _ => Fin.elim0 i) + +/-- Normalize a local block to radius R. A zero block stays zero. -/ +def blockAtom {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) {R : ℝ} (hR : 0 ≤ R) : T.Atom R where + family := F.asFamily + coeff := F.reindex ((R / ‖a‖) • a) + energy_le := by + rw [F.reindex_energy, norm_smul, Real.norm_eq_abs, + abs_of_nonneg (div_nonneg hR (norm_nonneg _))] + by_cases ha : a = 0 + · simp [ha, sq_nonneg] + · have hn : ‖a‖ ≠ 0 := norm_ne_zero_iff.mpr ha + rw [div_mul_cancel₀ _ hn] + +lemma blockAtom_value {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) {R : ℝ} (hR : 0 ≤ R) : + (T.blockAtom F a hR).value = (R / ‖a‖) • T.combine (fun S : T.LocalIndex F => S.val) a := by + rw [Atom.value, blockAtom, F.reindex_combine] + simp only [combine, PiLp.smul_apply, smul_eq_mul, mul_smul, Finset.smul_sum] + +lemma weighted_blockAtom {K : Finset ι} (F : T.LocalFamily K) + (a : EuclideanSpace ℝ (T.LocalIndex F)) {R : ℝ} (hR : 0 < R) : + (‖a‖ / R) • (T.blockAtom F a hR.le).value = + T.combine (fun S : T.LocalIndex F => S.val) a := by + rw [T.blockAtom_value, smul_smul] + by_cases ha : a = 0 + · simp [ha, combine] + · have hn : ‖a‖ ≠ 0 := norm_ne_zero_iff.mpr ha + have he : ‖a‖ / R * (R / ‖a‖) = 1 := by field_simp + rw [he, one_smul] + +lemma representation_combine {K : Finset ι} (x : T.Dual) (c : T.Coefficients K) + (hc : T.totalMap K c = fun v : K => x (T.unitVector v.val)) : + (∑ F, T.combine (fun S : T.LocalIndex F => S.val) (c F)) = T.headDual K x := by + apply T.dual_ext + intro v + simp only [sum_apply, headDual_unit] + by_cases hv : v ∈ K + · rw [ite_eq_left hv] + have he := congrFun hc ⟨v,hv⟩ + change (∑ F, T.localMap F (c F)) ⟨v,hv⟩ = _ at he + simp only [Finset.sum_apply, localMap_combine] at he + exact he + · rw [ite_eq_right hv] + apply Finset.sum_eq_zero + intro F _ + rw [combine_unit] + apply Finset.sum_eq_zero + intro S _ + rw [ite_eq_right (fun h => hv (T.localFamily_subset F S h))] + +/-- Every block decomposition is a finite probability law, with its unused mass + placed on the zero atom. -/ +def lawOfCoefficients {K : Finset ι} (x : T.Dual) {R : ℝ} (hR : 0 < R) + (c : T.Coefficients K) (hc : c ∈ T.coefficientBall K R) + (hce : T.totalMap K c = fun v : K => x (T.unitVector v.val)) : + T.AtomLaw (Option (T.LocalFamily K)) R (T.headDual K x) where + atom ω := match ω with + | none => T.zeroAtom R + | some F => T.blockAtom F (c F) hR.le + weight ω := match ω with + | none => 1 - ∑ F, ‖c F‖ / R + | some F => ‖c F‖ / R + nonneg := by + intro ω + cases ω with + | none => + dsimp + rw [← Finset.sum_div] + exact sub_nonneg.mpr ((div_le_one hR).mpr hc) + | some F => exact div_nonneg (norm_nonneg _) hR.le + sum_one := by + rw [Fintype.sum_option] + dsimp + ring + mean := by + rw [Fintype.sum_option] + simp only [zeroAtom_value, smul_zero, zero_add] + simp_rw [T.weighted_blockAtom _ _ hR] + exact T.representation_combine x c hce + +lemma lawOfCoefficients_subset {K : Finset ι} (x : T.Dual) {R : ℝ} (hR : 0 < R) + (c : T.Coefficients K) (hc : c ∈ T.coefficientBall K R) + (hce : T.totalMap K c = fun v : K => x (T.unitVector v.val)) + (ω : Option (T.LocalFamily K)) + (i : Fin ((T.lawOfCoefficients x hR c hc hce).atom ω).family.n) : + ((T.lawOfCoefficients x hR c hc hce).atom ω).family.seg i ⊆ K := by + cases ω with + | none => exact Fin.elim0 i + | some F => exact F.asFamily_subset i + +structure BipolarLaw (Ω : Type*) [Fintype Ω] (R : ℝ) (x y : T.Dual) + extends T.AtomLaw Ω R x where + sign : Ω → ℝ + abs_sign : ∀ ω, |sign ω| = 1 + signed_mean : (∑ ω, weight ω • (sign ω • (atom ω).value)) = y + +def pairLaws {Ω : Type*} [Fintype Ω] {R : ℝ} {x y : T.Dual} + (Lp : T.AtomLaw Ω R (x+y)) (Lm : T.AtomLaw Ω R (x-y)) : + T.BipolarLaw (Bool × Ω) R x y where + atom ω := if ω.1 then Lp.atom ω.2 else Lm.atom ω.2 + weight ω := (1/2 : ℝ) * (if ω.1 then Lp.weight ω.2 else Lm.weight ω.2) + nonneg := by + rintro ⟨b,ω⟩ + cases b <;> exact mul_nonneg (by norm_num) (by first | exact Lm.nonneg ω | exact Lp.nonneg ω) + sum_one := by + simp only [Fintype.sum_prod_type, Fintype.sum_bool, Bool.false_eq_true, ↓reduceIte] + rw [← Finset.mul_sum, ← Finset.mul_sum, Lp.sum_one, Lm.sum_one] + norm_num + mean := by + simp only [Fintype.sum_prod_type, Fintype.sum_bool, Bool.false_eq_true, ↓reduceIte, + mul_smul, ← Finset.smul_sum] + rw [Lp.mean, Lm.mean] + module + sign ω := if ω.1 then 1 else -1 + abs_sign := by rintro ⟨b,ω⟩; cases b <;> norm_num + signed_mean := by + apply ContinuousLinearMap.ext + intro u + have hp := congrArg (fun f : T.Dual => f u) Lp.mean + have hm := congrArg (fun f : T.Dual => f u) Lm.mean + simp only [sum_apply, smul_apply, smul_eq_mul, add_apply] at hp + simp only [sum_apply, smul_apply, smul_eq_mul, sub_apply] at hm + simp only [add_apply, sum_apply, smul_apply, smul_eq_mul, Fintype.sum_prod_type, + Fintype.sum_bool, Bool.false_eq_true, ↓reduceIte] + have hcoeff (ω : Ω) : (1/2:ℝ) * Lm.weight ω * (-1 * (Lm.atom ω).value u) = + -(1/2:ℝ) * (Lm.weight ω * (Lm.atom ω).value u) := by ring + simp_rw [hcoeff, one_mul, mul_assoc] + rw [← Finset.mul_sum, ← Finset.mul_sum, hp, hm] + ring + +lemma pairLaws_subset {Ω : Type*} [Fintype Ω] {R : ℝ} {x y : T.Dual} + (Lp : T.AtomLaw Ω R (x+y)) (Lm : T.AtomLaw Ω R (x-y)) (K : Finset ι) + (hp : ∀ ω i, (Lp.atom ω).family.seg i ⊆ K) + (hm : ∀ ω i, (Lm.atom ω).family.seg i ⊆ K) : + ∀ ω i, ((T.pairLaws Lp Lm).atom ω).family.seg i ⊆ K := by + rintro ⟨b,ω⟩ i + cases b + · exact hm ω i + · exact hp ω i + +/-- The norm-closed coordinate span, not the full infinite-tree dual. -/ +def CoordinatePredual : Submodule ℝ T.Dual := + (Submodule.span ℝ (Set.range T.coordinate)).topologicalClosure + +lemma span_coordinates_finite_support {x : T.Dual} + (hx : x ∈ Submodule.span ℝ (Set.range T.coordinate)) : + ∃ S : Finset ι, ∀ v, v ∉ S → x (T.unitVector v)=0 := by + classical + induction hx using Submodule.span_induction with + | mem x hx => + obtain ⟨v,rfl⟩ := hx + refine ⟨{v}, ?_⟩ + intro w hw + simp only [Finset.mem_singleton] at hw + simp [coordinate_unitVector,hw] + | zero => exact ⟨∅, by simp⟩ + | add x y _ _ hx hy => + obtain ⟨S,hS⟩ := hx + obtain ⟨U,hU⟩ := hy + refine ⟨S ∪ U, ?_⟩ + intro v hv + have hvS : v ∉ S := fun h => hv (Finset.mem_union_left _ h) + have hvU : v ∉ U := fun h => hv (Finset.mem_union_right _ h) + simp only [add_apply,hS v hvS,hU v hvU,add_zero] + | smul a x _ hx => + obtain ⟨S,hS⟩ := hx + exact ⟨S, fun v hv => by simp only [smul_apply,hS v hv,smul_zero]⟩ + +end SegmentSystem + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/SignCube.lean b/lean/OAI/Analysis/DiamondDistortion/SignCube.lean new file mode 100644 index 0000000000000000000000000000000000000000..380065fa44edbe4a1c40461a23bcac2c4122477a --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/SignCube.lean @@ -0,0 +1,244 @@ +import OAI.Analysis.DiamondDistortion.RecursiveBounds + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace SignCube +abbrev History : ℕ → Type + | 0 => Unit + | n+1 => History n × Bool +instance (n : ℕ) : Fintype (History n) := by induction n with | zero => infer_instance | succ n ih => exact inferInstance +instance (n : ℕ) : Nonempty (History n) := by induction n with | zero => infer_instance | succ n ih => exact inferInstance +lemma history_card (n : ℕ) : Fintype.card (History n)=2^n := by + induction n with + | zero => rfl + | succ n ih => change Fintype.card (History n × Bool)=_; rw [Fintype.card_prod,ih,Fintype.card_bool,pow_succ] + +/-- Expectation for the uniform sign probability, written as iterated fair averages. -/ +def mean : (n : ℕ) → (History n → ℝ) → ℝ + | 0,f => f () + | n+1,f => mean n (fun h => (f (h,false)+f (h,true))/2) +@[simp] lemma mean_zero (n : ℕ) : mean n (fun _ => 0)=0 := by + induction n with | zero => rfl | succ n ih => simpa only [mean,zero_add,zero_div] using ih +@[simp] lemma mean_const (n : ℕ) (c : ℝ) : mean n (fun _ => c)=c := by + induction n with + | zero => rfl + | succ n ih => simpa only [mean,show (c+c)/2=c by ring] using ih +lemma mean_mono (n : ℕ) {f g : History n → ℝ} (hfg : ∀ h,f h ≤ g h) : mean n f ≤ mean n g := by + induction n with + | zero => exact hfg () + | succ n ih => exact ih (fun h => by change (f (h,false)+f (h,true))/2 ≤ _; linarith [hfg (h,false),hfg (h,true)]) +lemma mean_nonneg (n : ℕ) {f : History n → ℝ} (hf : ∀ h,0 ≤ f h) : 0 ≤ mean n f := by + simpa only [mean_zero] using mean_mono n hf +lemma mean_lower (n : ℕ) {f : History n → ℝ} {a : ℝ} (hf : ∀ h,a ≤ f h) : a ≤ mean n f := by + simpa only [mean_const] using mean_mono n hf +lemma mean_upper (n : ℕ) {f : History n → ℝ} {a : ℝ} (hf : ∀ h,f h ≤ a) : mean n f ≤ a := by + simpa only [mean_const] using mean_mono n hf +lemma mean_add (n : ℕ) (f g : History n → ℝ) : mean n (fun h => f h+g h)=mean n f+mean n g := by + induction n with + | zero => rfl + | succ n ih => + change mean n (fun h => (f (h,false)+g (h,false)+(f (h,true)+g (h,true)))/2)=_ + simp_rw [show ∀ a b c d : ℝ,(a+b+(c+d))/2=(a+c)/2+(b+d)/2 by intros; ring] + exact ih _ _ +lemma mean_mul (n : ℕ) (c : ℝ) (f : History n → ℝ) : mean n (fun h => c*f h)=c*mean n f := by + induction n with + | zero => rfl + | succ n ih => + change mean n (fun h => (c*f (h,false)+c*f (h,true))/2)=_ + simp_rw [show ∀ a b : ℝ,(c*a+c*b)/2=c*((a+b)/2) by intros; ring] + exact ih _ +lemma mean_sub (n : ℕ) (f g : History n → ℝ) : mean n (fun h => f h-g h)=mean n f-mean n g := by + have he (h : History n) : f h-g h=f h+(-1)*g h := by ring + simp_rw [he] + rw [mean_add,mean_mul] + ring +lemma mean_last (n : ℕ) (f : History n → ℝ) : mean (n+1) (fun h => f h.1)=mean n f := by + simp only [mean,show ∀ a : ℝ,(a+a)/2=a by intro; ring] +lemma mean_uniform (n : ℕ) (f : History n → ℝ) : + mean n f=(∑ h,f h)/(Fintype.card (History n):ℝ) := by + induction n with + | zero => simp [mean] + | succ n ih => + change mean n (fun h => (f (h,false)+f (h,true))/2)=_ + rw [ih,← Finset.sum_div,Finset.sum_add_distrib] + simp only [Fintype.sum_prod_type,Fintype.sum_bool,Fintype.card_prod,Fintype.card_bool,Nat.cast_mul,Nat.cast_ofNat,Finset.sum_add_distrib] + ring + +inductive Protocol (X : Type u) (I : Type v) : ℕ → Type (max u v) + | initial (x : X) (H : I) : Protocol X I 0 + | extend {n : ℕ} (prev : Protocol X I n) (A B : History n → I) + (next : History (n+1) → X) : Protocol X I (n+1) +namespace Protocol +variable {X I : Type*} +def last : {n : ℕ} → Protocol X I n → History n → X + | 0,.initial x _,_ => x + | _+1,.extend _ _ _ W,h => W h +def lastHead : {n : ℕ} → Protocol X I n → History n → I + | 0,.initial _ H,_ => H + | _+1,.extend _ _ B _,h => B h.1 + +variable [NormedAddCommGroup X] [NormedSpace ℝ X] +/-- Fair one-step conditional expectations. Iterating gives W_i=E(W_m|F_i). -/ +def Martingale : {n : ℕ} → Protocol X I n → Prop + | 0,.initial _ _ => True + | _+1,.extend T _ _ W => Martingale T ∧ ∀ h,T.last h=(1/2:ℝ) • (W (h,false)+W (h,true)) +variable [Preorder I] +def Nested : {n : ℕ} → Protocol X I n → Prop + | 0,.initial _ _ => True + | _+1,.extend T A B _ => Nested T ∧ ∀ h,T.lastHead h ≤ A h ∧ A h ≤ B h +/-- Each layer is between consecutive support heads, not separated by a new + unrecorded head. This is imposed only for the inputs that require it. -/ +def Anchored : {n : ℕ} → Protocol X I n → Prop + | 0,.initial _ _ => True + | _+1,.extend T A _ _ => Anchored T ∧ ∀ h,A h=T.lastHead h +/-- Fixed across each level (stronger than predictability); required only by the + deterministic leakage input. -/ +def CommonHeads : {n : ℕ} → Protocol X I n → Prop + | 0,.initial _ _ => True + | _+1,.extend T _ B _ => CommonHeads T ∧ ∃ H,∀ h,B h=H + +def Supported (P : I → X →L[ℝ] X) : {n : ℕ} → Protocol X I n → Prop + | 0,.initial x H => P H x=x + | _+1,.extend T _ B W => Supported P T ∧ ∀ h b,P (B h) (W (h,b))=W (h,b) + +def childEnergy (P : I → X →L[ℝ] X) (n : ℕ) (A B : History n → I) (W : History (n+1) → X) : ℝ := + mean (n+1) (fun h => ‖P (B h.1) (W h)-P (A h.1) (W h)‖^2) +def parentEnergy (P : I → X →L[ℝ] X) (n : ℕ) (A B : History n → I) (W : History n → X) : ℝ := + mean n (fun h => ‖P (B h) (W h)-P (A h) (W h)‖^2) +def freshSum (P : I → X →L[ℝ] X) : {n : ℕ} → Protocol X I n → ℝ + | 0,.initial _ _ => 0 + | n+1,.extend T A B W => freshSum P T+childEnergy P n A B W +def leakageSum (P : I → X →L[ℝ] X) : {n : ℕ} → Protocol X I n → ℝ + | 0,.initial _ _ => 0 + | n+1,.extend T A B _ => leakageSum P T+parentEnergy P n A B T.last + +def terminalEnergy {n : ℕ} (T : Protocol X I n) : ℝ := mean n (fun h => ‖T.last h‖^2) +lemma terminalEnergy_nonneg {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] {n : ℕ} (T : Protocol X I n) : 0 ≤ T.terminalEnergy := + mean_nonneg _ (fun _ => sq_nonneg _) +lemma terminalEnergy_bound {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] {n : ℕ} (T : Protocol X I n) {D : ℝ} (hD : 0 ≤ D) + (h : ∀ u,‖T.last u‖ ≤ D) : T.terminalEnergy ≤ D^2 := + mean_upper _ (fun u => (sq_le_sq₀ (norm_nonneg _) hD).mpr (h u)) +lemma freshSum_nonneg {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] (P : I → X →L[ℝ] X) {n : ℕ} (T : Protocol X I n) : 0 ≤ T.freshSum P := by + induction T with + | initial x H => exact le_rfl + | @extend n T A B W ih => exact add_nonneg ih (mean_nonneg _ (fun _ => sq_nonneg _)) +lemma leakageSum_nonneg {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] (P : I → X →L[ℝ] X) {n : ℕ} (T : Protocol X I n) : 0 ≤ T.leakageSum P := by + induction T with + | initial x H => exact le_rfl + | @extend n T A B W ih => exact add_nonneg ih (mean_nonneg _ (fun _ => sq_nonneg _)) +end Protocol +end SignCube + +namespace DirectLayers +open SignCube +variable {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] + +def SignInput (P : I → X →L[ℝ] X) (C : ℝ) : Prop := + ∀ (m : ℕ) (T : Protocol X I m),T.Martingale → T.Nested → + T.freshSum P ≤ C*(T.terminalEnergy+T.leakageSum P) + +def PredictableInput (P : I → X →L[ℝ] X) (B : ℝ) : Prop := + ∀ (m : ℕ) (T : Protocol X I m),T.Martingale → T.Nested → T.Anchored → T.Supported P → + ∀ C : ℝ,(∀ h,‖T.last h‖ ≤ C) → T.freshSum P ≤ B*C^2 + +def LeakageInput (P : I → X →L[ℝ] X) : Prop := + ∀ (m : ℕ) (T : Protocol X I m),T.Martingale → T.Nested → T.Anchored → T.CommonHeads → + T.freshSum P ≤ 1024*(T.terminalEnergy+T.leakageSum P) +def GapInput (P : I → X →L[ℝ] X) : Prop := + ∀ (A B : I),A ≤ B → ∀ x y : X,P A x=x → P B y=y → + ‖P B y-P A y‖^2 ≤ 400*((‖x+y‖^2+‖x-y‖^2)/2-‖x‖^2) + +structure Regular (A : Midpoint.Heads I X) : Prop where + nonempty : Nonempty I + upper : ∀ H K : I,∃ J,H ≤ J ∧ K ≤ J + nested_left : ∀ H K : I,H ≤ K → ∀ x : X,A.projection H (A.projection K x)=A.projection H x + nested_right : ∀ H K : I,H ≤ K → ∀ x : X,A.projection K (A.projection H x)=A.projection H x + contractive : ∀ H : I,∀ x : X,‖A.projection H x‖ ≤ ‖x‖ +namespace Regular +variable {A : Midpoint.Heads I X} (hA : Regular A) +include hA +lemma finite_upper (S : Finset I) : ∃ B,∀ H ∈ S,H ≤ B := by + classical + induction S using Finset.induction_on with + | empty => obtain ⟨B⟩ := hA.nonempty; exact ⟨B,by simp⟩ + | @insert H S hHS ih => + obtain ⟨K,hK⟩ := ih + obtain ⟨B,hHB,hKB⟩ := hA.upper H K + refine ⟨B,?_⟩ + intro J hJ + rcases Finset.mem_insert.mp hJ with rfl|hJ + · exact hHB + · exact (hK J hJ).trans hKB +lemma tail_norm (H : I) (x : X) : ‖x-A.projection H x‖ ≤ 2*‖x‖ := by + have hh := (norm_sub_le x (A.projection H x)).trans (add_le_add (le_refl _) (hA.contractive H x)) + linarith +/-- A single larger ancestral head captures any finite family. -/ +lemma capture {κ : Type*} [Fintype κ] (H : I) (x : κ → X) {η : ℝ} (hη : 0 < η) : + ∃ B : I,H ≤ B ∧ ∀ j,‖x j-A.projection B (x j)‖ < η := by + classical + choose K p hfix hclose using fun j => A.approximation (x j) (η/2) (half_pos hη) + obtain ⟨B,hB⟩ := hA.finite_upper (insert H (Finset.univ.image K)) + refine ⟨B,hB H (Finset.mem_insert_self _ _),?_⟩ + intro j + have hKB := hB (K j) (Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨j,Finset.mem_univ _,rfl⟩)) + have hBp : A.projection B (p j)=p j := by + rw [← hfix j,hA.nested_right _ _ hKB] + have he : x j-A.projection B (x j)=(x j-p j)-A.projection B (x j-p j) := by + rw [map_sub,hBp]; abel + rw [he] + exact (hA.tail_norm B (x j-p j)).trans_lt (by linarith [hclose j]) +lemma capture_one (H : I) (x : X) {η : ℝ} (hη : 0 < η) : + ∃ B : I,H ≤ B ∧ ‖x-A.projection B x‖ < η := by + obtain ⟨B,hHB,hB⟩ := hA.capture H (fun _ : Unit => x) hη + exact ⟨B,hHB,hB ()⟩ +lemma layer_parent (H B : I) (hHB : H ≤ B) (x : X) : + ‖A.projection B x-A.projection H x‖ ≤ ‖x-A.projection H x‖ := by + calc + _ = ‖A.projection B (x-A.projection H x)‖ := by rw [map_sub,hA.nested_right H B hHB] + _ ≤ _ := hA.contractive _ _ +end Regular + +lemma select_tail {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] (A : Midpoint.Heads I X) (H : I) (z : ℕ → X) {R a r : ℝ} + (hz : ∀ j,‖z j‖ ≤ R) (hs : ∀ i j,i ≠ j → a ≤ ‖z i-z j‖) (hr : r < a/2) : + ∃ j,r < ‖z j-A.projection H (z j)‖ := by + let := A.finite H + by_contra! hn + have hh := Midpoint.tail_packing (A.projection H) z hz hs hn + linarith +end DirectLayers + +namespace SignCube.Protocol +variable {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] +def initialEnergy : {n : ℕ} → Protocol X I n → ℝ + | 0,.initial x _ => ‖x‖^2 + | _+1,.extend T _ _ _ => T.initialEnergy +lemma initialEnergy_nonneg {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] {n : ℕ} (T : Protocol X I n) : 0 ≤ T.initialEnergy := by + induction T with | initial x H => exact sq_nonneg _ | extend T A B W ih => exact ih +variable [Preorder I] +lemma common_last {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] {n : ℕ} (T : Protocol X I n) (h : T.CommonHeads) : + ∃ H,∀ u,T.lastHead u=H := by + cases T with + | initial x H => exact ⟨H,fun _ => rfl⟩ + | extend T A B W => obtain ⟨H,hH⟩ := h.2; exact ⟨H,fun u => hH u.1⟩ +lemma supported_last {X I : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] [Preorder I] (P : I → X →L[ℝ] X) {n : ℕ} (T : Protocol X I n) (h : T.Supported P) : + ∀ u,P (T.lastHead u) (T.last u)=T.last u := by + cases T with + | initial x H => exact fun _ => h + | extend T A B W => exact fun u => h.2 u.1 u.2 +end SignCube.Protocol + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/StartBounds.lean b/lean/OAI/Analysis/DiamondDistortion/StartBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..1f69b4cae737b6068adbd921cb4dacffccf2c761 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/StartBounds.lean @@ -0,0 +1,248 @@ +import OAI.Analysis.DiamondDistortion.Descent + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace StartModel + +section +open RecursiveModel PathModel +instance repComplete (h : ℕ) : CompleteSpace (Rep h) := by + induction h with + | zero => infer_instance + | succ h ih => + change CompleteSpace (WithLp 1 (L1 (h+1) × lp (fun _ : ℕ => Rep h) 2)) + infer_instance + +def outputCoordinate (h : ℕ) (r : Coord h) : Rep h →L[ℝ] ℝ := + ((LinearMap.proj r).comp (output h)).mkContinuous 1 (by + intro d + change ‖output h d r‖ ≤ 1*‖d‖ + simpa only [Real.norm_eq_abs,one_mul] using output_coordinate h d r) +def outputContinuous (h : ℕ) : Rep h →L[ℝ] (Coord h → ℝ) := + ContinuousLinearMap.pi (outputCoordinate h) +instance kernelClosed (h : ℕ) : IsClosed (LinearMap.ker (output h) : Set (Rep h)) := + (outputContinuous h).isClosed_ker + +/-- The complete infimal-cost space of *all* finite-cost coordinate outputs, + modulo representations with zero output. -/ +abbrev FullComponent (h : ℕ) := Rep h ⧸ LinearMap.ker (output h) +instance fullComponentNormed (h : ℕ) : NormedAddCommGroup (FullComponent h) := by + letI : IsClosed (LinearMap.ker (output h) : Set (Rep h)) := kernelClosed h + exact Submodule.Quotient.normedAddCommGroup _ +-- Help typeclass matching across the recursive successor representation model. +instance fullComponentNormedSucc (h : ℕ) : NormedAddCommGroup (FullComponent (h+1)) := fullComponentNormed (h+1) +instance fullComponentComplete (h : ℕ) : CompleteSpace (FullComponent h) := inferInstance +def componentEmbedding (h : ℕ) : Vec h →ₗ[ℝ] FullComponent h := + (LinearMap.ker (output h)).mkQ.comp (finiteSection h) +lemma componentEmbedding_norm (h : ℕ) (v : Vec h) : ‖componentEmbedding h v‖=finiteCost h v := rfl + +/-- The dense class of representations whose coordinate output is finite. -/ +def finiteOutputs (h : ℕ) : Submodule ℝ (Rep h) := + (LinearMap.range (relation h).value).comap (output h) + +def rootInjection (h : ℕ) : L1 (h+1) →L[ℝ] Rep (h+1) := + (WithLp.prodContinuousLinearEquiv 1 ℝ (L1 (h+1)) (lp (fun _ : ℕ => Rep h) 2)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.inl ℝ _ _) +def childrenInjection (h : ℕ) : lp (fun _ : ℕ => Rep h) 2 →L[ℝ] Rep (h+1) := + (WithLp.prodContinuousLinearEquiv 1 ℝ (L1 (h+1)) (lp (fun _ : ℕ => Rep h) 2)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.inr ℝ _ _) +def childInjection (h i : ℕ) : Rep h →L[ℝ] Rep (h+1) := + (childrenInjection h).comp (lp.singleContinuousLinearMap (𝕜 := ℝ) (E := fun _ : ℕ => Rep h) (p := 2) i) +lemma output_rootInjection (h : ℕ) (μ : L1 (h+1)) (r : Coord (h+1)) : + output (h+1) (rootInjection h μ) r=path (h+1) μ r := by + cases r with + | inl u => cases u; rfl + | inr a => + change path (h+1) μ (.inr a)+output h 0 a.2=path (h+1) μ (.inr a) + simp only [map_zero,Pi.zero_apply,add_zero] +lemma rootInjection_finite (h : ℕ) (s : Coord (h+1)) (c : ℝ) : + rootInjection h (lp.single 1 s c) ∈ finiteOutputs (h+1) := by + let v : Vec (h+1) := Finsupp.onFinset (ancestors (h+1) s) + (fun r => if r ∈ ancestors (h+1) s then c else 0) (fun r hr => by + by_contra hn + simp only [hn,ite_false,ne_eq,not_true_eq_false] at hr) + refine ⟨v,?_⟩ + ext r + change v r=output (h+1) (rootInjection h (lp.single 1 s c)) r + rw [output_rootInjection,path_single] + change (if r ∈ ancestors (h+1) s then c else 0)=c*branch (h+1) s r + rw [branch_apply] + split_ifs <;> ring +lemma childInjection_finite (h i : ℕ) (d : Rep h) (hd : d ∈ finiteOutputs h) : + childInjection h i d ∈ finiteOutputs (h+1) := by + obtain ⟨v,hv⟩ := hd + let e : Coord h ↪ Coord (h+1) := ⟨fun r => .inr (i,r),by intro a b hab; exact (Prod.mk.inj (Sum.inr.inj hab)).2⟩ + refine ⟨Finsupp.embDomain e v,?_⟩ + ext r + cases r with + | inl u => + change (Finsupp.embDomain e v) (.inl u)=path (h+1) 0 (root (h+1)) + rw [map_zero] + exact Finsupp.embDomain_of_notMem_range e v (.inl u) (by rintro ⟨a,ha⟩; cases ha) + | inr a => + change (Finsupp.embDomain e v) (.inr a)=path (h+1) 0 (.inr a)+output h ((lp.single 2 i d : lp (fun _ : ℕ => Rep h) 2) a.1) a.2 + rw [map_zero] + change _=0+_ + rw [zero_add] + by_cases hi : a.1=i + · obtain ⟨j,r⟩ := a + change j=i at hi + subst j + rw [lp.single_apply_self] + change (Finsupp.embDomain e v) (e r)=output h d r + rw [Finsupp.embDomain_apply_self] + exact congrFun hv r + · rw [lp.single_apply_ne _ _ _ hi,map_zero] + apply Finsupp.embDomain_of_notMem_range + rintro ⟨r,hr⟩ + exact hi (Prod.mk.inj (Sum.inr.inj hr)).1.symm + +lemma finiteOutputs_dense (h : ℕ) : Dense (finiteOutputs h : Set (Rep h)) := by + induction h with + | zero => + intro d + apply subset_closure + refine ⟨Finsupp.single () d,?_⟩ + ext r + cases r + change (Finsupp.single () d : Vec 0) ()=d + exact Finsupp.single_eq_same + | succ h ih => + let K := (finiteOutputs (h+1)).topologicalClosure + have hK : IsClosed (K : Set (Rep (h+1))) := (finiteOutputs (h+1)).isClosed_topologicalClosure + have hroot (μ : L1 (h+1)) : rootInjection h μ ∈ K := by + apply hK.mem_of_tendsto ((rootInjection h).hasSum (lp.hasSum_single (by norm_num : (1:ℝ≥0∞) ≠ ⊤) μ)) + exact Filter.Eventually.of_forall (fun S => K.sum_mem (fun s _ => subset_closure (rootInjection_finite h s (μ s)))) + have hchild (i : ℕ) (d : Rep h) : childInjection h i d ∈ K := by + induction d using ih.denseRange_val.induction_on with + | hp => exact hK.preimage (childInjection h i).continuous + | ih d => exact subset_closure (childInjection_finite h i d d.property) + have hchildren (w : lp (fun _ : ℕ => Rep h) 2) : childrenInjection h w ∈ K := by + apply hK.mem_of_tendsto ((childrenInjection h).hasSum (lp.hasSum_single (by norm_num : (2:ℝ≥0∞) ≠ ⊤) w)) + exact Filter.Eventually.of_forall (fun S => K.sum_mem (fun i _ => hchild i (w i))) + intro d + change d ∈ K + have he : d=rootInjection h d.fst+childrenInjection h d.snd := by + change d=WithLp.toLp 1 (d.fst,0)+WithLp.toLp 1 (0,d.snd) + apply (WithLp.equiv 1 _).injective + change (d.fst,d.snd)=(d.fst+0,0+d.snd) + rw [add_zero,zero_add] + rw [he] + exact K.add_mem (hroot d.fst) (hchildren d.snd) + +lemma componentEmbedding_dense (h : ℕ) : DenseRange (componentEmbedding h) := by + intro x + obtain ⟨d,rfl⟩ := (LinearMap.ker (output h)).mkQ_surjective x + induction d using (finiteOutputs_dense h).denseRange_val.induction_on with + | hp => exact isClosed_closure.preimage (LinearMap.ker (output h)).mkQL.continuous + | ih d => + obtain ⟨v,hv⟩ := d.property + apply subset_closure + refine ⟨v,?_⟩ + exact ((relation h).representation_eq hv.symm).symm +end + +open RecursiveModel PathApplications +/-- All countable finite-cost start outputs, componentwise quotient, outer ℓ². -/ +abbrev FullSpace := lp (fun h : ℕ => FullComponent (h+1)) 2 +def fullEmbedding : ForestVec →ₗ[ℝ] FullSpace := + outerEmbedding (fun h => componentEmbedding (h+1)) +lemma fullEmbedding_norm (v : ForestVec) : ‖fullEmbedding v‖=forestSeminorm v := + outerEmbedding_norm _ _ (fun h v => componentEmbedding_norm (h+1) v) v +lemma fullEmbedding_dense : DenseRange fullEmbedding := + outerEmbedding_dense _ (fun h => componentEmbedding_dense (h+1)) +def fullEquiv : Space ≃ₗᵢ[ℝ] FullSpace := data.completionEquiv fullEmbedding fullEmbedding_norm fullEmbedding_dense +lemma fullEquiv_embedding (v : ForestVec) : fullEquiv (data.embedding v)=fullEmbedding v := + data.completionMap_coe _ _ _ +def fullHeads : Midpoint.Heads ForestHead FullSpace := heads.transport fullEquiv + +theorem full_graph (hinput : StartInput fullHeads) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → FullSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/128 ≤ D^2 := start_cost fullHeads hinput k f hf +end StartModel + +namespace PathModel +open RecursiveModel PathApplications +def linearFullHeads : Midpoint.Heads ForestHead FullLinearSpace := linearHeads.transport linearFullEquiv +def quadraticFullHeads : Midpoint.Heads ForestHead FullQuadraticSpace := quadraticHeads.transport quadraticFullEquiv + +theorem linear_full_flow_graph (hinput : FlowInput linearFullHeads (linearC^2)) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/(2*linearC^2) ≤ D^2 ∧ (k:ℝ) ≤ 2*linearC^2*D^2 := + linear_flow linearFullHeads hinput k f hf +theorem linear_full_trimming_graph (hinput : FlowInput linearFullHeads 242) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/484 ≤ D^2 := linear_trimming linearFullHeads hinput k f hf +theorem linear_full_clipping_graph (hinput : linearFullHeads.ParametricInput (1/2) 4) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullLinearSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)*clippingGamma D/(2*clippingQ D) ≤ D := + linear_clipping linearFullHeads hinput k f hf +theorem linear_full_vanishing_graph (hinput : linearFullHeads.TailVanishing) : + ¬ Diamond.UniformEmbeddings FullLinearSpace := linearFullHeads.vanishing_obstruction hinput + +theorem quadratic_full_graph (hinput : ArbitraryTailInput quadraticFullHeads 8) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullQuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/64 ≤ D^2 := quadratic_cost quadraticFullHeads hinput k f hf + +theorem stopped_full_graph (hinput : StoppedInput quadraticFullHeads) + {D s : ℝ} (k : ℕ) (f : Diamond.Vertex k → FullQuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + (k:ℝ) ≤ 144*D^2 := stopped_flow quadraticFullHeads hinput k f hf + +theorem quadratic_full_component_graph (hinput : ComponentSumInput FullQuadraticSpace) + {D s e : ℝ} (he : 0 < e) (he16 : e ≤ 1/16) (hsmall : 17*(2*e)^((1:ℝ)/6) < 1/(2*D)) + (k : ℕ) (f : Diamond.Vertex k → FullQuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + (1+e/2)^k ≤ D := component_sum hinput he he16 hsmall k f hf + +theorem quadratic_full_relative_graph (hinput : RelativeInput quadraticFullHeads) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → FullQuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + (1+relativeDelta D)^k ≤ D := relative_cost quadraticFullHeads hinput k f hf + +theorem quadratic_full_tail_seven_graph (hinput : ArbitraryTailInput quadraticFullHeads 7) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → FullQuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-D⁻¹^2/2000)^k := tail_seven quadraticFullHeads hinput k f hf + +theorem quadratic_full_pruning_graph (hinput : ArbitraryTailInput quadraticFullHeads 9) {D s γ : ℝ} + (hγ : 0 < γ) (hγhalf : γ < 1/2) + (hsmall : 9*Real.sqrt ((1+γ)^2-(1-2*γ)^2) < 2*D⁻¹/3) + (k : ℕ) (f : Diamond.Vertex k → FullQuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-γ)^k := tail_pruning quadraticFullHeads hinput hγ hγhalf hsmall k f hf +end PathModel + +namespace Diamond +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- A larger separation can use the same unit-lens bound. -/ +lemma UnitLensBound.mono_separation {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] {ε ε' ρ : ℝ} (h : UnitLensBound X ε ρ) + (hε : ε ≤ ε') : UnitLensBound X ε' ρ := + fun x z hp hm hs => h x z hp hm (fun i j hij => hε.trans (hs i j hij)) + +lemma QuadraticLens.positive_gap {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] (hX : QuadraticLens X) {ε : ℝ} (hε : 0 < ε) : + ∃ ρ : ℝ,0 < ρ ∧ ρ < 1 ∧ UnitLensBound X ε ρ := by + let δ : ℝ := min (1/2) (ε^2/16) + have hδ : 0 < δ := lt_min (by norm_num) (by positivity) + have hδhalf : δ ≤ 1/2 := min_le_left _ _ + have hδε : δ ≤ ε^2/16 := min_le_right _ _ + refine ⟨Real.sqrt (1-δ),Real.sqrt_pos.2 (by linarith),?_,?_⟩ + · exact (Real.sqrt_lt' (by norm_num)).2 (by linarith) + · intro x z hp hm hs + have hloss := hX x z 1 ε (by norm_num) hε hp hm hs + have hsqrt := Real.sq_sqrt (show 0 ≤ 1-δ by linarith) + have hroot := Real.sqrt_nonneg (1-δ) + nlinarith [norm_nonneg x] +end Diamond + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/StartModels.lean b/lean/OAI/Analysis/DiamondDistortion/StartModels.lean new file mode 100644 index 0000000000000000000000000000000000000000..24115cb131fb56cbc7c9d66de21098c6aa87eb3d --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/StartModels.lean @@ -0,0 +1,210 @@ +import OAI.Analysis.DiamondDistortion.Relations + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace StartModel + +section +open RecursiveModel PathModel +/-- A local bundle used only to recurse over the finite tree height. -/ +structure RealNormed where + carrier : Type + [group : NormedAddCommGroup carrier] + [space : NormedSpace ℝ carrier] +attribute [instance] RealNormed.group RealNormed.space +instance : CoeSort RealNormed Type := ⟨RealNormed.carrier⟩ + +/-- At each node the root-start coefficients form ℓ¹ over the possible endpoints; + the children form ℓ² of their own representation spaces. The outer ℓ¹ pair + is exactly q_s=m_s+(Σ q_c²)^(1/2). -/ +abbrev representationModel : ℕ → RealNormed + | 0 => ⟨ℝ⟩ + | h+1 => + let M := representationModel h + ⟨WithLp 1 (L1 (h+1) × lp (fun _ : ℕ => M) 2)⟩ +abbrev Rep (h : ℕ) := representationModel h + +/-- Coordinate output, including the absolutely summable root-start paths and + the child contribution. No finite-support restriction is made on a Rep. -/ +def output : (h : ℕ) → (Rep h →ₗ[ℝ] (Coord h → ℝ)) + | 0 => { + toFun a := fun _ => a + map_add' a b := rfl + map_smul' c a := rfl } + | h+1 => { + toFun d := fun r => match r with + | .inl _ => path (h+1) d.fst (root (h+1)) + | .inr (i,s) => path (h+1) d.fst (.inr (i,s))+output h (d.snd i) s + map_add' d e := by + funext r + cases r with + | inl u => simp only [WithLp.add_fst,map_add,lp.coeFn_add,Pi.add_apply] + | inr a => simp only [WithLp.add_fst,WithLp.add_snd,map_add,lp.coeFn_add,Pi.add_apply]; ring + map_smul' c d := by + funext r + cases r with + | inl u => simp only [WithLp.smul_fst,map_smul,lp.coeFn_smul,Pi.smul_apply,RingHom.id_apply] + | inr a => simp only [WithLp.smul_fst,WithLp.smul_snd,map_smul,lp.coeFn_smul,Pi.smul_apply,RingHom.id_apply,smul_eq_mul]; ring } + +lemma output_coordinate (h : ℕ) (d : Rep h) (r : Coord h) : |output h d r| ≤ ‖d‖ := by + induction h with + | zero => exact le_rfl + | succ h ih => + change |output (h+1) d r| ≤ ‖(d : WithLp 1 (L1 (h+1) × lp (fun _ : ℕ => Rep h) 2))‖ + rw [WithLp.prod_norm_eq_of_L1] + cases r with + | inl u => + exact (path_coordinate (h+1) d.fst (root (h+1))).trans (le_add_of_nonneg_right (norm_nonneg _)) + | inr a => + change |path (h+1) d.fst (.inr a)+output h (d.snd a.1) a.2| ≤ _ + exact (abs_add_le _ _).trans (add_le_add (path_coordinate (h+1) d.fst (.inr a)) + ((ih (d.snd a.1) a.2).trans (lp.norm_apply_le_norm (by norm_num : (2:ℝ≥0∞) ≠ 0) d.snd a.1))) + +/-- Singleton segments, used only as a right inverse, not as a restriction on + the allowed representations. -/ +abbrev atom : (h : ℕ) → Coord h → (ℝ →ₗ[ℝ] Rep h) + | 0,_ => LinearMap.id + | h+1,.inl _ => + (WithLp.linearEquiv 1 ℝ (L1 (h+1) × lp (fun _ : ℕ => Rep h) 2)).symm.toLinearMap.comp + ((lp.lsingle (𝕜 := ℝ) (E := fun _ : Coord (h+1) => ℝ) 1 (root (h+1))).prod 0) + | h+1,.inr (i,s) => + (WithLp.linearEquiv 1 ℝ (L1 (h+1) × lp (fun _ : ℕ => Rep h) 2)).symm.toLinearMap.comp + ((0 : ℝ →ₗ[ℝ] L1 (h+1)).prod ((lp.lsingle (𝕜 := ℝ) (E := fun _ : ℕ => Rep h) 2 i).comp (atom h s))) + +lemma output_atom (h : ℕ) (s r : Coord h) (c : ℝ) : + output h (atom h s c) r=if s=r then c else 0 := by + induction h with + | zero => simp [output,atom] + | succ h ih => + cases s with + | inl u => + cases u + cases r with + | inl v => + cases v + rw [ite_eq_left rfl] + change (lp.evalₗ (𝕜 := ℝ) (fun _ : Coord (h+1) => ℝ) 2 (root (h+1))) + (path (h+1) (lp.single 1 (root (h+1)) c))=c + rw [path_single (h+1) (root (h+1)) c,branch_root (h+1)] + simp only [map_smul,lp.evalₗ_apply,lp.single_apply_self,smul_eq_mul,mul_one] + | inr a => + simp only [reduceCtorEq,ite_false] + change (lp.evalₗ (𝕜 := ℝ) (fun _ : Coord (h+1) => ℝ) 2 (.inr a)) + (path (h+1) (lp.single 1 (root (h+1)) c))+output h 0 a.2=0 + rw [path_single (h+1) (root (h+1)) c,branch_root (h+1),map_zero] + simp only [map_smul,lp.evalₗ_apply,lp.single_apply,root, + smul_eq_mul,Pi.zero_apply,add_zero] + simp + | inr b => + cases r with + | inl v => + simp only [reduceCtorEq,ite_false] + change path (h+1) 0 (root (h+1))=0 + rw [map_zero] + rfl + | inr a => + change path (h+1) 0 (.inr a)+output h ((lp.single 2 b.1 (atom h b.2 c) : + lp (fun _ : ℕ => Rep h) 2) a.1) a.2=_ + simp only [map_zero,lp.coeFn_zero,Pi.zero_apply,zero_add] + by_cases he : a.1=b.1 + · rw [he,lp.single_apply_self,ih] + simp [he,Prod.ext_iff] + · rw [lp.single_apply_ne (E := fun _ : ℕ => Rep h) 2 b.1 (atom h b.2 c) he] + simp [map_zero,Prod.ext_iff,Ne.symm he] + +/-- The infimum over the full nested ℓ¹/ℓ² representation space. -/ +def finiteSection (h : ℕ) : Vec h →ₗ[ℝ] Rep h := Finsupp.lsum ℝ (atom h) + +def relation (h : ℕ) : InfimalCost.Relation (Rep h) (Vec h) (Coord h → ℝ) where + output := output h + value := { + toFun v := fun s => v s + map_add' a b := rfl + map_smul' c a := rfl } + sectionMap := finiteSection h + section_output v := by + ext r + change output h (v.sum fun s a => atom h s a) r=v r + rw [Finsupp.sum, map_sum] + simp only [Finset.sum_apply,output_atom] + rw [Finset.sum_ite_eq'] + split_ifs with hr + · rfl + · exact (Finsupp.notMem_support_iff.mp hr).symm + +def finiteCost (h : ℕ) : Seminorm ℝ (Vec h) := (relation h).seminorm +lemma finiteCost_eq_sInf (h : ℕ) (v : Vec h) : + finiteCost h v=sInf {r : ℝ | ∃ d : Rep h,output h d=(fun s => v s) ∧ ‖d‖=r} := + (relation h).eq_sInf v +lemma coordinate_le_cost (h : ℕ) (v : Vec h) (r : Coord h) : |v r| ≤ finiteCost h v := by + apply (relation h).bound v + intro d hd + have he : output h d r=v r := congrFun hd r + rw [← he] + exact output_coordinate h d r + +def forestSeminorm : Seminorm ℝ ForestVec := outerSeminorm (fun h => finiteCost (h+1)) +lemma forest_coordinate (v : ForestVec) (i : ForestCoord) : |v i| ≤ forestSeminorm v := by + exact (coordinate_le_cost (i.1+1) (components v i.1) i.2).trans + (component_le_outer (fun h => finiteCost (h+1)) v i.1) + +end + +open RecursiveModel PathApplications + +def data : CoordinateCompletion.Data ForestCoord where + seminorm := forestSeminorm + coordinate_bound i := ⟨1,fun p => by simpa only [one_mul] using forest_coordinate p i⟩ +abbrev Space := data.Space +def heads : Midpoint.Heads ForestHead Space := + data.heads Subtype.val (fun S => ⟨forestHead S,forestHead_contains S⟩) + +theorem graph (hinput : StartInput heads) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → Space) (hf : Diamond.HasDistortion k f D s) : + 1+(k:ℝ)/128 ≤ D^2 := start_cost heads hinput k f hf + +lemma representation_norm_zero (d : Rep 0) : ‖d‖=|d| := rfl +lemma representation_norm_succ (h : ℕ) (d : Rep (h+1)) : + ‖d‖=‖d.fst‖+‖d.snd‖ := WithLp.prod_norm_eq_of_L1 d +lemma root_start_mass (h : ℕ) (d : Rep (h+1)) : + ‖d.fst‖=∑' s : Coord (h+1),|d.fst s| := (PathModel.tsum_abs d.fst).symm +lemma children_cost_sq (h : ℕ) (d : Rep (h+1)) : + ‖d.snd‖^2=∑' i : ℕ,‖d.snd i‖^2 := by + simpa only [ENNReal.toReal_ofNat,Real.rpow_two] using + lp.norm_rpow_eq_tsum (p := 2) (by norm_num) d.snd + +end StartModel + +namespace PathModel +open PathApplications + +theorem quadratic_relative_graph (hinput : RelativeInput quadraticHeads) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → QuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + (1+relativeDelta D)^k ≤ D := relative_cost quadraticHeads hinput k f hf + +theorem quadratic_tail_seven_graph (hinput : ArbitraryTailInput quadraticHeads 7) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → QuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-D⁻¹^2/2000)^k := tail_seven quadraticHeads hinput k f hf + +theorem quadratic_pruning_graph (hinput : ArbitraryTailInput quadraticHeads 9) {D s γ : ℝ} + (hγ : 0 < γ) (hγhalf : γ < 1/2) + (hsmall : 9*Real.sqrt ((1+γ)^2-(1-2*γ)^2) < 2*D⁻¹/3) + (k : ℕ) (f : Diamond.Vertex k → QuadraticSpace) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-γ)^k := tail_pruning quadraticHeads hinput hγ hγhalf hsmall k f hf +end PathModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Stretch.lean b/lean/OAI/Analysis/DiamondDistortion/Stretch.lean new file mode 100644 index 0000000000000000000000000000000000000000..78b5f2054a8283043ee991e1e478d8b7af5d66a8 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Stretch.lean @@ -0,0 +1,263 @@ +import OAI.Analysis.DiamondDistortion.DiamondGraph + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Diamond +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma norm_center_le {x y : X} {R : ℝ} (hp : ‖x+y‖ ≤ R) (hm : ‖x-y‖ ≤ R) : + ‖x‖ ≤ R := by + have he : x=(1/2:ℝ) • ((x+y)+(x-y)) := by module + calc + ‖x‖ = (1/2:ℝ)*‖(x+y)+(x-y)‖ := by + conv_lhs => rw [he] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos (by norm_num : (0:ℝ)<1/2)] + _ ≤ (1/2:ℝ)*(‖x+y‖+‖x-y‖) := mul_le_mul_of_nonneg_left (norm_add_le _ _) (by norm_num) + _ ≤ R := by linarith + +lemma norm_deviation_le {x y : X} {R : ℝ} (hp : ‖x+y‖ ≤ R) (hm : ‖x-y‖ ≤ R) : + ‖y‖ ≤ R := norm_center_le (x := y) (y := x) (by simpa only [add_comm] using hp) + (by simpa only [norm_sub_rev] using hm) + +lemma slope_lower {k : ℕ} (f : Vertex k → X) {s : ℝ} + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) (e : Edge k) : s ≤ ‖slope f e‖ := by + have he := hl (endpoint k e false) (endpoint k e true) + rw [distance_edge] at he + rw [slope,norm_smul,Real.norm_eq_abs,abs_of_pos (by positivity : 0<(2:ℝ)^k),norm_sub_rev] + calc + s = (2:ℝ)^k*(s*(1/(2:ℝ)^k)) := by field_simp + _ ≤ _ := mul_le_mul_of_nonneg_left he (by positivity) + +lemma slope_upper {k : ℕ} (f : Vertex k → X) {L : ℝ} + (hu : ∀ u v,‖f u-f v‖ ≤ L*distance k u v) (e : Edge k) : ‖slope f e‖ ≤ L := by + have he := hu (endpoint k e false) (endpoint k e true) + rw [distance_edge] at he + rw [slope,norm_smul,Real.norm_eq_abs,abs_of_pos (by positivity : 0<(2:ℝ)^k),norm_sub_rev] + calc + _ ≤ (2:ℝ)^k*(L*(1/(2:ℝ)^k)) := mul_le_mul_of_nonneg_left he (by positivity) + _ = _ := by field_simp + +lemma old_lower {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] {k : ℕ} (f : Vertex (k+1) → X) {s : ℝ} + (hl : ∀ u v,s*distance (k+1) u v ≤ ‖f u-f v‖) : + ∀ u v,s*distance k u v ≤ ‖f (Sum.inl u)-f (Sum.inl v)‖ := by + intro u v + simpa only [distance_old] using hl (Sum.inl u) (Sum.inl v) + +/-- Abstract multiplicative backward iteration, retaining every all-pairs lower + bound and making no assertion of an attained stage supremum. -/ +lemma iterate_contraction {s D c : ℝ} (hc : 0 ≤ c) (hc1 : c ≤ 1) + (hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → s ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*s ≤ ‖z i-z j‖) → ‖x‖ ≤ c*R) + (k : ℕ) (f : Vertex k → X) {L : ℝ} (hL : 0 ≤ L) (hLD : L ≤ D) + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) + (hb : ∀ e,‖slope f e‖ ≤ L) : s ≤ c^k*L := by + induction k generalizing L with + | zero => simpa using (slope_lower f hl ()).trans (hb ()) + | succ n ih => + have hold : ∀ e,‖slope (fun v => f (Sum.inl v)) e‖ ≤ c*L := by + intro e + apply hstep _ (deviation f e) L hL hLD (slope_lower _ (old_lower f hl) e) + · intro i + simpa only [slope_plus_deviation] using hb (e,i,false) + · intro i + simpa only [slope_minus_deviation] using hb (e,i,true) + · exact fun _ _ hij => deviation_separated f hl e hij + have hcL : c*L ≤ D := (mul_le_of_le_one_left hL hc1).trans hLD + have h := ih (fun v => f (Sum.inl v)) (mul_nonneg hc hL) hcL (old_lower f hl) hold + simpa only [pow_succ,mul_assoc] using h + +/-- Abstract additive backward iteration. The existence of old edges ensures + nonnegativity of each improved bound, including the last nonempty stage. -/ +lemma iterate_additive {s D δ : ℝ} (hδ : 0 ≤ δ) + (hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → s ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*s ≤ ‖z i-z j‖) → ‖x‖ ≤ R-δ) + (k : ℕ) (f : Vertex k → X) {L : ℝ} (hL : 0 ≤ L) (hLD : L ≤ D) + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) + (hb : ∀ e,‖slope f e‖ ≤ L) : s+(k:ℝ)*δ ≤ L := by + induction k generalizing L with + | zero => simpa using (slope_lower f hl ()).trans (hb ()) + | succ n ih => + have hold : ∀ e,‖slope (fun v => f (Sum.inl v)) e‖ ≤ L-δ := by + intro e + apply hstep _ (deviation f e) L hL hLD (slope_lower _ (old_lower f hl) e) + · intro i + simpa only [slope_plus_deviation] using hb (e,i,false) + · intro i + simpa only [slope_minus_deviation] using hb (e,i,true) + · exact fun _ _ hij => deviation_separated f hl e hij + have hnew : 0 ≤ L-δ := (norm_nonneg _).trans (hold (baseEdge n)) + have h := ih (fun v => f (Sum.inl v)) hnew (by linarith) (old_lower f hl) hold + push_cast + linarith + +def SquareLens (X : Type*) [NormedAddCommGroup X] (b : ℝ) : Prop := + ∀ (x : X) (z : ℕ → X) (R ε : ℝ),0 ≤ R → 0 < ε → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) → ‖x‖^2+b*ε^2 ≤ R^2 + +lemma squared_stretch_loss_general {b : ℝ} (hX : SquareLens X b) (k : ℕ) (f : Vertex k → X) + {s B : ℝ} (hs : 0 < s) + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) + (hb : ∀ e,‖slope f e‖^2 ≤ B) : s^2*(1+4*b*(k:ℝ)) ≤ B := by + induction k generalizing B with + | zero => + have h := slope_lower f hl () + have h0 := hb () + norm_num + nlinarith [sq_nonneg (s-‖slope f ()‖)] + | succ n ih => + have hB : 0 ≤ B := (sq_nonneg _).trans (hb (baseEdge (n+1))) + have hold : ∀ e,‖slope (fun v => f (Sum.inl v)) e‖^2 ≤ B-4*b*s^2 := by + intro e + have hp : ∀ i,‖slope (fun v => f (Sum.inl v)) e+deviation f e i‖ ≤ Real.sqrt B := by + intro i + rw [slope_plus_deviation] + exact (Real.le_sqrt (norm_nonneg _) hB).mpr (hb _) + have hm : ∀ i,‖slope (fun v => f (Sum.inl v)) e-deviation f e i‖ ≤ Real.sqrt B := by + intro i + rw [slope_minus_deviation] + exact (Real.le_sqrt (norm_nonneg _) hB).mpr (hb _) + have h := hX (slope (fun v => f (Sum.inl v)) e) (deviation f e) + (Real.sqrt B) (2*s) (Real.sqrt_nonneg _) (by positivity) hp hm + (fun _ _ hij => deviation_separated f hl e hij) + rw [Real.sq_sqrt hB] at h + nlinarith + have hind := ih (fun v => f (Sum.inl v)) (old_lower f hl) hold + push_cast + nlinarith only [hind] + +lemma squared_transfer {b : ℝ} (_hb : 0 < b) (hX : SquareLens X b) + (k : ℕ) (f : Vertex k → X) (D s : ℝ) (h : HasDistortion k f D s) : + 1+4*b*(k:ℝ) ≤ D^2 := by + obtain ⟨hD,hs,h⟩ := h + have hbound : ∀ e,‖slope f e‖^2 ≤ (D*s)^2 := by + intro e + have hh := slope_upper f (fun u v => (h u v).2) e + exact (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (by linarith) hs.le)).mpr hh + have h' := squared_stretch_loss_general hX k f hs (fun u v => (h u v).1) hbound + have hp : 0 < s^2 := sq_pos_of_pos hs + have hmul : s^2*(1+4*b*(k:ℝ)) ≤ s^2*D^2 := by nlinarith only [h'] + exact (mul_le_mul_iff_right₀ hp).mp hmul + +lemma normalized_distortion {k : ℕ} (f : Vertex k → X) {D s : ℝ} + (h : HasDistortion k f D s) : + HasDistortion k (fun v => s⁻¹ • f v) D 1 := by + obtain ⟨hD,hs,h⟩ := h + refine ⟨hD,by norm_num,?_⟩ + intro u v + rw [← smul_sub,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hs.le)] + have hl := mul_le_mul_of_nonneg_left (h u v).1 (inv_nonneg.mpr hs.le) + have hu := mul_le_mul_of_nonneg_left (h u v).2 (inv_nonneg.mpr hs.le) + have he : s⁻¹*(s*distance k u v)=distance k u v := by field_simp + have he' : s⁻¹*(D*s*distance k u v)=D*distance k u v := by field_simp + rw [he] at hl + rw [he'] at hu + simpa only [one_mul,mul_one] using And.intro hl hu + +lemma upper_one_normalization {k : ℕ} (f : Vertex k → X) {D s : ℝ} + (h : HasDistortion k f D s) : + ∀ u v,D⁻¹*distance k u v ≤ ‖(D*s)⁻¹ • f u-(D*s)⁻¹ • f v‖ ∧ + ‖(D*s)⁻¹ • f u-(D*s)⁻¹ • f v‖ ≤ distance k u v := by + obtain ⟨hD,hs,h⟩ := h + have hD0 : 0 < D := by linarith + have hDs : 0 < D*s := mul_pos hD0 hs + intro u v + rw [← smul_sub,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hDs.le)] + have hl := mul_le_mul_of_nonneg_left (h u v).1 (inv_nonneg.mpr hDs.le) + have hu := mul_le_mul_of_nonneg_left (h u v).2 (inv_nonneg.mpr hDs.le) + have he : (D*s)⁻¹*(s*distance k u v)=D⁻¹*distance k u v := by field_simp + have he' : (D*s)⁻¹*(D*s*distance k u v)=distance k u v := by field_simp + rw [he] at hl + rw [he'] at hu + exact ⟨hl,hu⟩ + +def RadialLens (X : Type*) [NormedAddCommGroup X] (C : ℝ) : Prop := + ∀ (x : X) (z : ℕ → X) (R ε : ℝ),0 ≤ R → 0 < ε → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) → ε^2/4 ≤ C^2*R*(R-‖x‖) + +theorem radial_transfer {C : ℝ} (hC : 0 < C) (hX : RadialLens X C) + (k : ℕ) (f : Vertex k → X) (D s : ℝ) (hf : HasDistortion k f D s) : + (k:ℝ) ≤ C^2*D*(D-1) := by + obtain ⟨hD,_,h⟩ := normalized_distortion f hf + have hD0 : 0 < D := by linarith + have hP : 0 < C^2*D := mul_pos (sq_pos_of_pos hC) hD0 + let δ : ℝ := 1/(C^2*D) + have hδ : 0 ≤ δ := by dsimp [δ]; positivity + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → 1 ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*1 ≤ ‖z i-z j‖) → ‖x‖ ≤ R-δ := by + intro x z R hR hRD hx hp hm hsep + have he := hX x z R 2 hR (by norm_num) hp hm (by simpa using hsep) + have hxr := norm_center_le (hp 0) (hm 0) + have hmul := mul_le_mul_of_nonneg_right + (mul_le_mul_of_nonneg_left hRD (sq_nonneg C)) (sub_nonneg.mpr hxr) + have hh : 1 ≤ C^2*D*(R-‖x‖) := by norm_num at he; exact he.trans hmul + have hh' : δ ≤ R-‖x‖ := (div_le_iff₀ hP).mpr (by nlinarith only [hh]) + linarith + have hi := iterate_additive hδ hstep k (fun v => s⁻¹ • f v) hD0.le le_rfl + (fun u v => by simpa using (h u v).1) + (fun e => slope_upper _ (fun u v => by simpa using (h u v).2) e) + have hquot : (k:ℝ)/(C^2*D) ≤ D-1 := by + dsimp [δ] at hi + rw [mul_one_div] at hi + linarith + have hmul := (div_le_iff₀ hP).mp hquot + nlinarith only [hmul] + +def UnitLensBound (X : Type*) [NormedAddCommGroup X] (ε ρ : ℝ) : Prop := + ∀ (x : X) (z : ℕ → X), (∀ i,‖x+z i‖ ≤ 1) → (∀ i,‖x-z i‖ ≤ 1) → + (∀ i j,i ≠ j → ε ≤ ‖z i-z j‖) → ‖x‖ ≤ ρ + +theorem backward {α ρ : ℝ} (hα : 0 < α) (_hα1 : α ≤ 1) (hρ : 0 ≤ ρ) (hρ1 : ρ < 1) + (hX : UnitLensBound X (2*α) ρ) (k : ℕ) (f : Vertex k → X) + (hl : ∀ u v,α*distance k u v ≤ ‖f u-f v‖) + (hu : ∀ u v,‖f u-f v‖ ≤ distance k u v) : α ≤ ρ^k := by + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ 1 → α ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*α ≤ ‖z i-z j‖) → ‖x‖ ≤ ρ*R := by + intro x z R hR hR1 hx hp hm hs + have hxr := norm_center_le (hp 0) (hm 0) + have hR0 : 0 < R := lt_of_lt_of_le hα (hx.trans hxr) + have hscale (u : X) : ‖R⁻¹ • u‖=R⁻¹*‖u‖ := by + rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hR)] + have hi : R⁻¹*R=1 := inv_mul_cancel₀ hR0.ne' + have hinv : 1 ≤ R⁻¹ := by + rw [← one_div] + exact (le_div_iff₀ hR0).mpr (by simpa using hR1) + have hb := hX (R⁻¹ • x) (fun i => R⁻¹ • z i) + (fun i => by + rw [← smul_add,hscale] + exact (mul_le_mul_of_nonneg_left (hp i) (inv_nonneg.mpr hR)).trans hi.le) + (fun i => by + rw [← smul_sub,hscale] + exact (mul_le_mul_of_nonneg_left (hm i) (inv_nonneg.mpr hR)).trans hi.le) + (fun i j hij => by + rw [← smul_sub,hscale] + exact (le_mul_of_one_le_left (by positivity : 0 ≤ 2*α) hinv).trans + (mul_le_mul_of_nonneg_left (hs i j hij) (inv_nonneg.mpr hR))) + rw [hscale] at hb + have hh := mul_le_mul_of_nonneg_left hb hR + rw [← mul_assoc,mul_inv_cancel₀ hR0.ne',one_mul] at hh + simpa only [mul_comm] using hh + have h := iterate_contraction hρ hρ1.le hstep k f (by norm_num : (0:ℝ) ≤ 1) le_rfl hl + (fun e => slope_upper f (fun u v => by simpa using hu u v) e) + simpa only [mul_one] using h + +end Diamond + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Transfers.lean b/lean/OAI/Analysis/DiamondDistortion/Transfers.lean new file mode 100644 index 0000000000000000000000000000000000000000..02bab0097197c9a8bc20f71cc6b9a08aaf79175d --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Transfers.lean @@ -0,0 +1,265 @@ +import OAI.Analysis.DiamondDistortion.MidpointHeads + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Diamond + +section +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +theorem quotient_full_gain {t g D s : ℝ} (ht : 0 < t) (hg : 0 < g) + (htD : t ≤ 1/(2*D)) (hX : Midpoint.QuotientGain X t g) + (k : ℕ) (f : Vertex k → X) (hf : HasDistortion k f D s) : + 1 ≤ D/(1+g)^k := by + obtain ⟨hD,_,h⟩ := normalized_distortion f hf + have hg1 : 0 < 1+g := by positivity + let c : ℝ := 1/(1+g) + have hc : 0 ≤ c := by dsimp [c]; positivity + have hc1 : c ≤ 1 := (div_le_one₀ hg1).mpr (by linarith) + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → 1 ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*1 ≤ ‖z i-z j‖) → ‖x‖ ≤ c*R := by + intro x z R hR hRD hx hp hm hs + have hxD := (norm_center_le (hp 0) (hm 0)).trans hRD + have h := Midpoint.quotient_parent_full_gain ht hg hD htD hX z hx hxD hp hm + (by simpa only [mul_one] using hs) + simpa only [c,div_eq_mul_inv,one_mul,mul_comm] using h + have hi := iterate_contraction hc hc1 hstep k (fun v => s⁻¹ • f v) + (show 0 ≤ D by linarith) le_rfl (fun u v => by simpa only [one_mul] using (h u v).1) + (fun e => slope_upper _ (fun u v => by simpa only [mul_one] using (h u v).2) e) + simpa only [c,div_pow,one_pow,div_eq_mul_inv,one_mul,mul_comm,inv_pow] using hi + +theorem quotient_transfer {t g D s : ℝ} (ht : 0 < t) (hg : 0 < g) + (htD : t ≤ 1/(2*D)) (hX : Midpoint.QuotientGain X t g) + (k : ℕ) (f : Vertex k → X) (hf : HasDistortion k f D s) : + (1+g/2)^k ≤ D := by + have h := quotient_full_gain ht hg htD hX k f hf + have hp : 0 < (1+g)^k := by positivity + have hpow : (1+g)^k ≤ D := by simpa only [one_mul] using (le_div_iff₀ hp).mp h + exact (pow_le_pow_left₀ (by positivity : (0:ℝ) ≤ 1+g/2) (by linarith : 1+g/2 ≤ 1+g) k).trans hpow + +/-- A parent at any of the k replacement stages, with all of its actual children + bounded by the specified multiple of its own slope. The recursion restricts + to old vertices and therefore includes every stage, not just the last one. -/ +def StableParent (c : ℝ) : (k : ℕ) → (Vertex k → X) → Prop + | 0,_ => False + | n+1,f => (∃ e : Edge n,∀ (i : ℕ) (b : Bool), + ‖slope f (e,i,b)‖ ≤ c*‖slope (fun v => f (Sum.inl v)) e‖) ∨ + StableParent c n (fun v => f (Sum.inl v)) + +lemma absence_stable_growth {c s : ℝ} (hc : 0 ≤ c) (k : ℕ) (f : Vertex k → X) + (hl : ∀ u v,s*distance k u v ≤ ‖f u-f v‖) (hn : ¬ StableParent c k f) : + ∃ e : Edge k,s*c^k ≤ ‖slope f e‖ := by + induction k with + | zero => exact ⟨(),by simpa using slope_lower f hl ()⟩ + | succ n ih => + simp only [StableParent,not_or] at hn + obtain ⟨e,he⟩ := ih (fun v => f (Sum.inl v)) (old_lower f hl) hn.2 + have hne : ¬ ∀ (i : ℕ) (b : Bool), + ‖slope f (e,i,b)‖ ≤ c*‖slope (fun v => f (Sum.inl v)) e‖ := + fun h => hn.1 ⟨e,h⟩ + push Not at hne + obtain ⟨i,b,hchild⟩ := hne + refine ⟨(e,i,b),?_⟩ + have hm := mul_le_mul_of_nonneg_left he hc + calc + s*c^(n+1) = c*(s*c^n) := by ring + _ ≤ c*‖slope (fun v => f (Sum.inl v)) e‖ := hm + _ ≤ ‖slope f (e,i,b)‖ := hchild.le + +theorem stable_parent {D δ : ℝ} (hδ : 0 < δ) (k : ℕ) (f : Vertex k → X) + (hf : HasDistortion k f D 1) (hdepth : D < (1+δ)^k) : + StableParent (1+δ) k f := by + by_contra hn + obtain ⟨e,he⟩ := absence_stable_growth (by positivity : 0 ≤ 1+δ) k f + (fun u v => (hf.2.2 u v).1) hn + have hb : ‖slope f e‖ ≤ D := slope_upper f + (fun u v => by simpa only [mul_one] using (hf.2.2 u v).2) e + simp only [one_mul] at he + linarith + +/-- Exact exclusion of infinite separated families in every enlarged unit-center + lens, retaining the radius and separation as independent parameters. -/ +def EnlargedLensExcluded (X : Type*) [NormedAddCommGroup X] (R β : ℝ) : Prop := + ∀ u : X,‖u‖=1 → ¬ ∃ z : ℕ → X, + (∀ i,max ‖u+z i‖ ‖u-z i‖ ≤ 1+β) ∧ + (∀ i j,i ≠ j → R ≤ ‖z i-z j‖) + +lemma enlarged_parent {D β L : ℝ} (_hD : 1 ≤ D) (hβ : 0 < β) + (hX : EnlargedLensExcluded X (2/D) β) {x : X} (z : ℕ → X) + (hx : 1 ≤ ‖x‖) (hxD : ‖x‖ ≤ D) + (hp : ∀ i,‖x+z i‖ ≤ L) (hm : ∀ i,‖x-z i‖ ≤ L) + (hs : ∀ i j,i ≠ j → 2 ≤ ‖z i-z j‖) : ‖x‖ < L/(1+β) := by + by_contra! hn + let r := ‖x‖ + have hr : 0 < r := by dsimp [r]; linarith + have hβ1 : 0 < 1+β := by positivity + have hL : L ≤ r*(1+β) := (div_le_iff₀ hβ1).mp hn + have hunit : ‖r⁻¹ • x‖=1 := by + rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le),inv_mul_cancel₀ hr.ne'] + apply hX (r⁻¹ • x) hunit + refine ⟨fun i => r⁻¹ • z i,?_,?_⟩ + · intro i + apply max_le + · rw [← smul_add,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + calc + r⁻¹*‖x+z i‖ ≤ r⁻¹*(r*(1+β)) := + mul_le_mul_of_nonneg_left ((hp i).trans hL) (inv_nonneg.mpr hr.le) + _ = 1+β := by rw [← mul_assoc,inv_mul_cancel₀ hr.ne',one_mul] + · rw [← smul_sub,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + calc + r⁻¹*‖x-z i‖ ≤ r⁻¹*(r*(1+β)) := + mul_le_mul_of_nonneg_left ((hm i).trans hL) (inv_nonneg.mpr hr.le) + _ = 1+β := by rw [← mul_assoc,inv_mul_cancel₀ hr.ne',one_mul] + · intro i j hij + rw [← smul_sub,norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + calc + 2/D ≤ 2/r := div_le_div_of_nonneg_left (by norm_num) hr hxD + _ = r⁻¹*2 := by ring + _ ≤ r⁻¹*‖z i-z j‖ := mul_le_mul_of_nonneg_left (hs i j hij) (inv_nonneg.mpr hr.le) + +theorem enlarged_backward {D β s : ℝ} (hβ : 0 < β) + (hX : EnlargedLensExcluded X (2/D) β) (k : ℕ) (f : Vertex k → X) + (hf : HasDistortion k f D s) : 1 ≤ D/(1+β)^k := by + obtain ⟨hD,_,h⟩ := normalized_distortion f hf + have hβ1 : 0 < 1+β := by positivity + let c : ℝ := 1/(1+β) + have hc : 0 ≤ c := by dsimp [c]; positivity + have hc1 : c ≤ 1 := (div_le_one₀ hβ1).mpr (by linarith) + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → 1 ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*1 ≤ ‖z i-z j‖) → ‖x‖ ≤ c*R := by + intro x z R hR hRD hx hp hm hs + have hxD := (norm_center_le (hp 0) (hm 0)).trans hRD + have h := (enlarged_parent hD hβ hX z hx hxD hp hm + (by simpa only [mul_one] using hs)).le + simpa only [c,div_eq_mul_inv,one_mul,mul_comm] using h + have hi := iterate_contraction hc hc1 hstep k (fun v => s⁻¹ • f v) + (show 0 ≤ D by linarith) le_rfl (fun u v => by simpa only [one_mul] using (h u v).1) + (fun e => slope_upper _ (fun u v => by simpa only [mul_one] using (h u v).2) e) + simpa only [c,div_pow,one_pow,div_eq_mul_inv,one_mul,mul_comm,inv_pow] using hi + +theorem stable_parent_obstruction {D δ s : ℝ} (hδ : 0 < δ) + (hX : EnlargedLensExcluded X (2/D) δ) (k : ℕ) (f : Vertex k → X) + (hf : HasDistortion k f D s) : (1+δ)^k ≤ D := by + have h := enlarged_backward hδ hX k f hf + simpa only [one_mul] using (le_div_iff₀ (by positivity : 0 < (1+δ)^k)).mp h + +end + +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Supremum of all edge slopes at one stage; not a maximum. -/ +def stageSup {k : ℕ} (f : Vertex k → X) : ℝ := + sSup (Set.range (fun e : Edge k => ‖slope f e‖)) + +lemma slope_le_stageSup {k : ℕ} (f : Vertex k → X) {D : ℝ} + (hb : ∀ e,‖slope f e‖ ≤ D) (e : Edge k) : ‖slope f e‖ ≤ stageSup f := by + exact le_csSup ⟨D,by rintro _ ⟨e,rfl⟩; exact hb e⟩ ⟨e,rfl⟩ + +lemma stageSup_le {k : ℕ} (f : Vertex k → X) {D : ℝ} + (hb : ∀ e,‖slope f e‖ ≤ D) : stageSup f ≤ D := by + unfold stageSup + apply csSup_le (s := Set.range (fun e : Edge k => ‖slope f e‖)) + ⟨‖slope f (baseEdge k)‖,⟨baseEdge k,rfl⟩⟩ + rintro _ ⟨e,rfl⟩ + exact hb e + +lemma parametric_Q_one {b lam : ℝ} (hb : 0 < b) : 1 ≤ Real.sqrt (1+b*lam^2) := by + have h : (1:ℝ)^2 ≤ 1+b*lam^2 := by nlinarith [mul_nonneg hb.le (sq_nonneg lam)] + exact (Real.le_sqrt (by norm_num) (by positivity)).mpr h + +theorem parametric_stage (A : Midpoint.Heads ι X) {a b lam D : ℝ} + (ha : 0 < a) (hb : 0 < b) (hlam : 0 < lam) (hinput : A.ParametricInput a b) + (n : ℕ) (f : Vertex (n+1) → X) (hf : HasDistortion (n+1) f D 1) : + let Q := Real.sqrt (1+b*lam^2) + stageSup (fun v => f (Sum.inl v)) ≤ Q*stageSup f-a*lam ∧ + Q*stageSup f-a*lam ≤ stageSup f-(a*lam-(Q-1)*D) := by + let Q := Real.sqrt (1+b*lam^2) + have hbnd : ∀ e,‖slope f e‖ ≤ D := slope_upper f + (fun u v => by simpa only [mul_one] using (hf.2.2 u v).2) + have hR : stageSup f ≤ D := stageSup_le f hbnd + have hQ : 1 ≤ Q := parametric_Q_one hb + constructor + · apply stageSup_le + intro e + have hp : ∀ i,‖slope (fun v => f (Sum.inl v)) e+deviation f e i‖ ≤ stageSup f := by + intro i + rw [slope_plus_deviation] + exact slope_le_stageSup f hbnd _ + have hm : ∀ i,‖slope (fun v => f (Sum.inl v)) e-deviation f e i‖ ≤ stageSup f := by + intro i + rw [slope_minus_deviation] + exact slope_le_stageSup f hbnd _ + have hs : ∀ i j,i ≠ j → 2 ≤ ‖deviation f e i-deviation f e j‖ := by + intro i j hij + simpa only [mul_one] using deviation_separated f (fun u v => (hf.2.2 u v).1) e hij + have h := A.parametric_lens ha hb hlam hinput (deviation f e) hp hm hs + norm_num at h + linarith + · change Q*stageSup f-a*lam ≤ stageSup f-(a*lam-(Q-1)*D) + nlinarith [mul_le_mul_of_nonneg_left hR (sub_nonneg.mpr hQ)] + +/-- The exact parameterized graph depth conclusion; no optimization performed. -/ +theorem parametric (A : Midpoint.Heads ι X) {a b lam D s : ℝ} + (ha : 0 < a) (hb : 0 < b) (hlam : 0 < lam) (hinput : A.ParametricInput a b) + (hΔ : 0 < a*lam-(Real.sqrt (1+b*lam^2)-1)*D) + (k : ℕ) (f : Vertex k → X) (hf : HasDistortion k f D s) : + 1+(k:ℝ)*(a*lam-(Real.sqrt (1+b*lam^2)-1)*D) ≤ D := by + obtain ⟨hD,_,h⟩ := normalized_distortion f hf + let Q := Real.sqrt (1+b*lam^2) + let δ := a*lam-(Q-1)*D + have hQ : 1 ≤ Q := parametric_Q_one hb + have hstep : ∀ (x : X) (z : ℕ → X) (R : ℝ),0 ≤ R → R ≤ D → 1 ≤ ‖x‖ → + (∀ i,‖x+z i‖ ≤ R) → (∀ i,‖x-z i‖ ≤ R) → + (∀ i j,i ≠ j → 2*1 ≤ ‖z i-z j‖) → ‖x‖ ≤ R-δ := by + intro x z R hR hRD hx hp hm hs + have hh := A.parametric_lens ha hb hlam hinput z hp hm hs + norm_num at hh + dsimp [δ] + change ‖x‖+a*lam ≤ Q*R at hh + nlinarith [mul_le_mul_of_nonneg_left hRD (sub_nonneg.mpr hQ)] + exact iterate_additive hΔ.le hstep k (fun v => s⁻¹ • f v) + (show 0 ≤ D by linarith) le_rfl (fun u v => by simpa only [one_mul] using (h u v).1) + (fun e => slope_upper _ (fun u v => by simpa only [mul_one] using (h u v).2) e) + +theorem parametric_twentyfour (A : Midpoint.Heads ι X) (hinput : A.ParametricInput (1/2) 3) + {D s : ℝ} (k : ℕ) (f : Vertex k → X) (hf : HasDistortion k f D s) : + 1+(k:ℝ)/(24*D) ≤ D := by + have hD : 0 < D := lt_of_lt_of_le (by norm_num) hf.1 + let lam := 1/(6*D) + have hlam : 0 < lam := by dsimp [lam]; positivity + have hQ : Real.sqrt (1+3*lam^2) ≤ 1+3*lam^2/2 := by + apply (Real.sqrt_le_left (by positivity)).mpr + nlinarith [sq_nonneg (3*lam^2/2)] + have hden : (6*D) ≠ 0 := by positivity + have hlD : lam*(6*D)=1 := by dsimp [lam]; field_simp + have hgain : 1/(24*D) ≤ (1/2)*lam-(Real.sqrt (1+3*lam^2)-1)*D := by + have hs := mul_le_mul_of_nonneg_right hQ hD.le + have he : (1/2)*lam-(3*lam^2/2)*D = 1/(24*D) := by + dsimp [lam] + field_simp + ring + linarith + have hΔ : 0 < (1/2)*lam-(Real.sqrt (1+3*lam^2)-1)*D := + lt_of_lt_of_le (by positivity) hgain + have h := parametric A (by norm_num : (0:ℝ)<1/2) (by norm_num : (0:ℝ)<3) hlam hinput hΔ k f hf + have hm := mul_le_mul_of_nonneg_left hgain (show 0 ≤ (k:ℝ) by positivity) + have he : (k:ℝ)/(24*D)=(k:ℝ)*(1/(24*D)) := by ring + linarith + +end Diamond + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean b/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ca94d8d576a09e077490641dd71dc28780bec89 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/UpperFunction.lean @@ -0,0 +1,170 @@ +import OAI.Analysis.DiamondDistortion.EquivalentNorm + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +open scoped ENNReal + +namespace RecursiveModel +variable (p : ℝ≥0∞) [Fact (1 ≤ p)] +abbrev Full (h : ℕ) := lp (fun _ : Coord h => ℝ) p +lemma p_ne_zero : p ≠ 0 := ne_of_gt (lt_of_lt_of_le (by norm_num : (0:ℝ≥0∞)<1) (Fact.out : 1 ≤ p)) +variable (hp : 0 < p.toReal) + +def child (h : ℕ) (v : Full p (h+1)) (i : ℕ) : Full p h := + ⟨fun s => v (.inr (i,s)),(memℓp_gen_iff hp).mpr ((v.property.summable hp).comp_injective (by + intro a b hh + exact (Prod.mk.inj (Sum.inr.inj hh)).2))⟩ +lemma child_apply (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (v : Full p (h+1)) (i : ℕ) (s : Coord h) : + child p hp h v i s=v (.inr (i,s)) := rfl +lemma child_sum (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (v : Full p (h+1)) (i : ℕ) : + ‖child p hp h v i‖^p.toReal=∑' s : Coord h,‖v (.inr (i,s))‖^p.toReal := + lp.norm_rpow_eq_tsum hp _ +lemma child_summable (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (v : Full p (h+1)) : + Summable (fun q : ℕ × Coord h => ‖v (.inr q)‖^p.toReal) := + (v.property.summable hp).comp_injective Sum.inr_injective + +def children (h : ℕ) (v : Full p (h+1)) : lp (fun _ : ℕ => Full p h) p := + ⟨fun i => child p hp h v i,(memℓp_gen_iff hp).mpr (by + have hh := (child_summable p hp h v).prod + simpa only [← child_sum p hp h v] using hh)⟩ +lemma children_apply (h : ℕ) (v : Full p (h+1)) (i : ℕ) : children p hp h v i=child p hp h v i := rfl +lemma children_norm (h : ℕ) (v : Full p (h+1)) : ‖children p hp h v‖ ≤ ‖v‖ := by + apply (Real.rpow_le_rpow_iff (norm_nonneg _) (norm_nonneg _) hp).mp + rw [lp.norm_rpow_eq_tsum hp,lp.norm_rpow_eq_tsum hp] + simp_rw [children_apply,child_sum] + rw [← (child_summable p hp h v).tsum_prod] + exact Summable.tsum_le_tsum_of_inj (fun q : ℕ × Coord h => (Sum.inr q : Coord (h+1))) + Sum.inr_injective (fun _ _ => by positivity) (fun _ => le_rfl) + (child_summable p hp h v) (v.property.summable hp) + +@[simp] lemma child_add (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (u v : Full p (h+1)) (i : ℕ) : + child p hp h (u+v) i=child p hp h u i+child p hp h v i := by ext s; rfl +@[simp] lemma child_neg (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (v : Full p (h+1)) (i : ℕ) : + child p hp h (-v) i=-child p hp h v i := by ext s; rfl +@[simp] lemma child_smul (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (a : ℝ) (v : Full p (h+1)) (i : ℕ) : + child p hp h (a • v) i=a • child p hp h v i := by ext s; rfl +@[simp] lemma child_zero (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (i : ℕ) : child p hp h 0 i=0 := by ext s; rfl +end RecursiveModel + +namespace UpperFunction +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] +structure Data (E : Type*) [NormedAddCommGroup E] (C : ℝ) where + value : E → ℝ × ℝ + nonneg : ∀ v,0 ≤ (value v).1 ∧ 0 ≤ (value v).2 + bound : ∀ v,(value v).1 ≤ C*‖v‖ ∧ (value v).2 ≤ C*‖v‖ +namespace Data +variable {C : ℝ} (U : Data E C) (hC : 0 ≤ C) {p : ℝ≥0∞} [Fact (1 ≤ p)] +def positiveArray (v : lp (fun _ : ℕ => E) p) : lp (fun _ : ℕ => ℝ) p := + LpBoundedMap.map (fun x => (U.value x).1) C hC (fun x => by + simpa only [Real.norm_eq_abs,abs_of_nonneg (U.nonneg x).1] using (U.bound x).1) v +def negativeArray (v : lp (fun _ : ℕ => E) p) : lp (fun _ : ℕ => ℝ) p := + LpBoundedMap.map (fun x => (U.value x).2) C hC (fun x => by + simpa only [Real.norm_eq_abs,abs_of_nonneg (U.nonneg x).2] using (U.bound x).2) v +lemma positiveArray_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {C : ℝ} (U : Data E C) (hC : 0 ≤ C) {p : ℝ≥0∞} [Fact (1 ≤ p)] (v : lp (fun _ : ℕ => E) p) (i : ℕ) : + positiveArray U hC v i=(U.value (v i)).1 := rfl +lemma negativeArray_apply {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {C : ℝ} (U : Data E C) (hC : 0 ≤ C) {p : ℝ≥0∞} [Fact (1 ≤ p)] (v : lp (fun _ : ℕ => E) p) (i : ℕ) : + negativeArray U hC v i=(U.value (v i)).2 := rfl +lemma positiveArray_norm (hp : p ≠ 0) (v : lp (fun _ : ℕ => E) p) : + ‖positiveArray U hC v‖ ≤ C*‖v‖ := LpBoundedMap.map_norm hp _ _ _ _ v +lemma negativeArray_norm (hp : p ≠ 0) (v : lp (fun _ : ℕ => E) p) : + ‖negativeArray U hC v‖ ≤ C*‖v‖ := LpBoundedMap.map_norm hp _ _ _ _ v +end Data +end UpperFunction + +namespace RecursiveModel +lemma join_upper_bound {r a b C M : ℝ} (hC : 1 ≤ C) (hM : 0 ≤ M) + (hr : |r| ≤ M) (ha : a ≤ C*M) (hb : b ≤ C*M) : + (join r a b).1 ≤ (3*C)*M ∧ (join r a b).2 ≤ (3*C)*M := by + have hCM : M ≤ C*M := by nlinarith + have hrp := (abs_le.mp hr).2 + have hrn := (abs_le.mp hr).1 + constructor <;> apply max_le <;> nlinarith + +variable (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) +/-- Least upper values on the original full ℓp component, not on a finite-support + substitute. All child sequences are genuine countable ℓp vectors. -/ +def fullUpperData : (h : ℕ) → UpperFunction.Data (Full p h) (3^h) + | 0 => { + value v := (max (v ()) 0,max (-v ()) 0) + nonneg v := ⟨le_max_right _ _,le_max_right _ _⟩ + bound v := by + simp only [pow_zero,one_mul] + have hb := lp.norm_apply_le_norm (p_ne_zero p) v () + rw [Real.norm_eq_abs] at hb + exact ⟨max_le ((le_abs_self _).trans hb) (norm_nonneg _), + max_le ((neg_le_abs _).trans hb) (norm_nonneg _)⟩ } + | h+1 => + let U := fullUpperData h + let a (v : Full p (h+1)) := ‖U.positiveArray (by positivity) (children p hp h v)‖ + let b (v : Full p (h+1)) := ‖U.negativeArray (by positivity) (children p hp h v)‖ + { value v := join (v (.inl ())) (a v) (b v) + nonneg v := ⟨(norm_nonneg _).trans (le_max_left _ _),(norm_nonneg _).trans (le_max_right _ _)⟩ + bound v := by + have ha := (U.positiveArray_norm (by positivity) (p_ne_zero p) (children p hp h v)).trans + (mul_le_mul_of_nonneg_left (children_norm p hp h v) (by positivity : (0:ℝ) ≤ 3^h)) + have hb := (U.negativeArray_norm (by positivity) (p_ne_zero p) (children p hp h v)).trans + (mul_le_mul_of_nonneg_left (children_norm p hp h v) (by positivity : (0:ℝ) ≤ 3^h)) + have hr : |v (.inl ())| ≤ ‖v‖ := by + simpa only [Real.norm_eq_abs] using lp.norm_apply_le_norm (p_ne_zero p) v (.inl ()) + have hh := join_upper_bound (one_le_pow₀ (by norm_num : (1:ℝ) ≤ 3)) (norm_nonneg v) hr ha hb + simpa only [pow_succ,show (3:ℝ)*3^h=3^h*3 by ring] using hh } + +def fullUpper (h : ℕ) (v : Full p h) : ℝ × ℝ := (fullUpperData p hp h).value v +def fullPChildren (h : ℕ) (v : Full p (h+1)) : lp (fun _ : ℕ => ℝ) p := + (fullUpperData p hp h).positiveArray (by positivity) (children p hp h v) +def fullQChildren (h : ℕ) (v : Full p (h+1)) : lp (fun _ : ℕ => ℝ) p := + (fullUpperData p hp h).negativeArray (by positivity) (children p hp h v) +lemma fullUpper_zero_height (v : Full p 0) : fullUpper p hp 0 v=(max (v ()) 0,max (-v ()) 0) := rfl +lemma fullUpper_succ (h : ℕ) (v : Full p (h+1)) : + fullUpper p hp (h+1) v=join (v (.inl ())) ‖fullPChildren p hp h v‖ ‖fullQChildren p hp h v‖ := rfl +lemma fullPChildren_apply (h : ℕ) (v : Full p (h+1)) (i : ℕ) : + fullPChildren p hp h v i=(fullUpper p hp h (child p hp h v i)).1 := rfl +lemma fullQChildren_apply (h : ℕ) (v : Full p (h+1)) (i : ℕ) : + fullQChildren p hp h v i=(fullUpper p hp h (child p hp h v i)).2 := rfl +lemma fullUpper_nonneg (h : ℕ) (v : Full p h) : + 0 ≤ (fullUpper p hp h v).1 ∧ 0 ≤ (fullUpper p hp h v).2 := (fullUpperData p hp h).nonneg v +lemma fullUpper_bound (h : ℕ) (v : Full p h) : + (fullUpper p hp h v).1 ≤ 3^h*‖v‖ ∧ (fullUpper p hp h v).2 ≤ 3^h*‖v‖ := + (fullUpperData p hp h).bound v + +@[simp] lemma fullUpper_zero (h : ℕ) : fullUpper p hp h 0=0 := by + have hn := fullUpper_nonneg p hp h 0 + have hb := fullUpper_bound p hp h 0 + simp only [norm_zero,mul_zero] at hb + exact Prod.ext (le_antisymm hb.1 hn.1) (le_antisymm hb.2 hn.2) + +lemma child_finiteLp (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp : 0 < p.toReal) (h : ℕ) (v : Vec (h+1)) (i : ℕ) : + child p hp h (finiteLp p v) i=finiteLp p ((rootChildren h v).2 i) := by ext s; rfl + +lemma fullUpper_finiteLp (h : ℕ) (v : Vec h) : fullUpper p hp h (finiteLp p v)=upper p h v := by + induction h with + | zero => rfl + | succ h ih => + let w := rootChildren h v + let P := w.2.mapRange (fun z => (upper p h z).1) (by simp) + let Q := w.2.mapRange (fun z => (upper p h z).2) (by simp) + have hP : fullPChildren p hp h (finiteLp p v)=finiteLp p P := by + ext i + rw [fullPChildren_apply,child_finiteLp,ih] + rfl + have hQ : fullQChildren p hp h (finiteLp p v)=finiteLp p Q := by + ext i + rw [fullQChildren_apply,child_finiteLp,ih] + rfl + rw [fullUpper_succ,hP,hQ] + rfl +end RecursiveModel + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/Vanishing.lean b/lean/OAI/Analysis/DiamondDistortion/Vanishing.lean new file mode 100644 index 0000000000000000000000000000000000000000..2904500b146e1a82f3d87a113aec470adf92e7da --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/Vanishing.lean @@ -0,0 +1,116 @@ +import OAI.Analysis.DiamondDistortion.RecursiveModels + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Midpoint +open Filter +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Uniform pure-tail vanishing at the unit sphere, the qualitative mass-removal + input. No power law or quantitative modulus is inserted into this hypothesis. -/ +def Heads.TailVanishing (A : Heads ι X) : Prop := + ∀ ε : ℝ,0 < ε → ∃ δ : ℝ,0 < δ ∧ + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → + ‖p+y‖ ≤ 1 → ‖p-y‖ ≤ 1 → 1-δ ≤ ‖p‖ → ‖y‖ < ε + +lemma Heads.vanishing_gap (A : Heads ι X) (hinput : A.TailVanishing) {ε : ℝ} + (hε : 0 < ε) : ∃ ρ : ℝ,0 ≤ ρ ∧ ρ < 1 ∧ + ∀ x : X,(∀ η : ℝ,0 < η → ∃ (H : ι) (p y : X), + A.projection H p=p ∧ A.projection H y=0 ∧ + ‖x‖-η ≤ ‖p‖ ∧ ε-η ≤ ‖y‖ ∧ ‖p+y‖ ≤ 1+2*η ∧ ‖p-y‖ ≤ 1+2*η) → ‖x‖ ≤ ρ := by + obtain ⟨δ,hδ,hvan⟩ := hinput (ε/4) (by positivity) + let d := min δ 1 + have hd : 0 < d := lt_min hδ (by norm_num) + have hd1 : d ≤ 1 := min_le_right _ _ + have hdδ : d ≤ δ := min_le_left _ _ + refine ⟨1-d/4,by linarith,by linarith,?_⟩ + intro x hx + by_contra hc + have hc' : 1-d/4 < ‖x‖ := lt_of_not_ge hc + let η := min (d/16) (min (ε/4) (1/4:ℝ)) + have hη : 0 < η := lt_min (by positivity) (lt_min (by positivity) (by norm_num)) + have hηd : η ≤ d/16 := min_le_left _ _ + have hηε : η ≤ ε/4 := (min_le_right _ _).trans (min_le_left _ _) + have hη1 : η ≤ 1/4 := (min_le_right _ _).trans (min_le_right _ _) + obtain ⟨H,p,y,hP,hY,hpx,hyε,hp,hm⟩ := hx η hη + let r := 1+2*η + have hr : 0 < r := by dsimp [r]; positivity + have hnorm (v : X) : ‖r⁻¹ • v‖=‖v‖/r := by + rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr hr.le)] + ring + have hp1 : ‖r⁻¹ • p+r⁻¹ • y‖ ≤ 1 := by + rw [← smul_add,hnorm] + exact (div_le_one hr).mpr hp + have hm1 : ‖r⁻¹ • p-r⁻¹ • y‖ ≤ 1 := by + rw [← smul_sub,hnorm] + exact (div_le_one hr).mpr hm + have hcenter : 1-δ ≤ ‖r⁻¹ • p‖ := by + rw [hnorm] + apply (le_div_iff₀ hr).mpr + have hmul := mul_nonneg hd.le hη.le + have hmon := mul_le_mul_of_nonneg_right (show 1-δ ≤ 1-d by linarith) hr.le + dsimp [r] at hmon ⊢ + nlinarith + have htail : ε/4 ≤ ‖r⁻¹ • y‖ := by + rw [hnorm] + apply (le_div_iff₀ hr).mpr + dsimp [r] + nlinarith + have hsmall := hvan H (r⁻¹ • p) (r⁻¹ • y) + (by rw [map_smul,hP]) (by rw [map_smul,hY,smul_zero]) hp1 hm1 hcenter + exact (not_lt_of_ge htail) hsmall + +/-- Pure-tail vanishing transfers uniformly to separated lenses at arbitrary + centers. This retains the qualitative route independently of a square input. -/ +theorem Heads.vanishing_lens (A : Heads ι X) (hinput : A.TailVanishing) {ε : ℝ} + (hε : 0 < ε) : ∃ ρ : ℝ,0 ≤ ρ ∧ ρ < 1 ∧ Diamond.UnitLensBound X ε ρ := by + obtain ⟨ρ,hρ,hρ1,hgap⟩ := A.vanishing_gap hinput (show 0 < ε/2 by positivity) + refine ⟨ρ,hρ,hρ1,?_⟩ + intro x z hp hm hs + exact hgap x (fun η hη => A.pure_pair z hη hp hm hs) + +/-- The separately stated weak-null uniformity: the same rho works for every + center and sequence with the specified positive lower norm bound. -/ +theorem Heads.vanishing_weak (A : Heads ι X) (hinput : A.TailVanishing) {ε : ℝ} + (hε : 0 < ε) : ∃ ρ : ℝ,0 ≤ ρ ∧ ρ < 1 ∧ + ∀ (x : X) (z : ℕ → X),WeaklyNull z → (∀ i,ε ≤ ‖z i‖) → + (∀ i,‖x+z i‖ ≤ 1) → (∀ i,‖x-z i‖ ≤ 1) → ‖x‖ ≤ ρ := by + obtain ⟨ρ,hρ,hρ1,hgap⟩ := A.vanishing_gap hinput hε + refine ⟨ρ,hρ,hρ1,?_⟩ + intro x z hz hl hp hm + exact hgap x (fun η hη => A.weak_pure z hz hη hl hp hm) + +/-- Bottom-up mass removal, qualitative diamond obstruction. -/ +theorem Heads.vanishing_obstruction (A : Heads ι X) (hinput : A.TailVanishing) : + ¬ Diamond.UniformEmbeddings X := by + rintro ⟨D,h⟩ + obtain ⟨f0,s0,hf0⟩ := h 0 + have hD : 0 < D := lt_of_lt_of_le (by norm_num) hf0.1 + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf0.1 + obtain ⟨ρ,hρ,hρ1,hlens⟩ := A.vanishing_lens hinput (show 0 < 2*D⁻¹ by positivity) + have ht := tendsto_pow_atTop_nhds_zero_of_lt_one hρ hρ1 + have he : ∀ᶠ k : ℕ in atTop,ρ^k < D⁻¹ := ht.eventually (gt_mem_nhds hα) + obtain ⟨k,hk⟩ := he.exists + obtain ⟨f,s,hf⟩ := h k + have hn := Diamond.upper_one_normalization f hf + have hb := Diamond.backward hα hα1 hρ hρ1 hlens k (fun v => (D*s)⁻¹ • f v) + (fun u v => (hn u v).1) (fun u v => (hn u v).2) + exact (not_lt_of_ge hb) hk +end Midpoint + +open scoped ENNReal + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DiamondDistortion/WeakLenses.lean b/lean/OAI/Analysis/DiamondDistortion/WeakLenses.lean new file mode 100644 index 0000000000000000000000000000000000000000..7850b7310f67d0f9f0c49a6b36cec04973983699 --- /dev/null +++ b/lean/OAI/Analysis/DiamondDistortion/WeakLenses.lean @@ -0,0 +1,246 @@ +import OAI.Analysis.DiamondDistortion.RecursiveLenses + +namespace OAI + +universe u v + +noncomputable section +open scoped BigOperators Classical Topology +open Set + +namespace DiamondDistortion + +namespace Midpoint +open Filter +variable {X Y ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + [NormedAddCommGroup Y] [NormedSpace ℝ Y] + +/-- Weak nullity in its exact scalar-functional form, over the real field. -/ +def WeaklyNull (z : ℕ → X) : Prop := + ∀ f : X →L[ℝ] ℝ,Tendsto (fun n => f (z n)) atTop (𝓝 0) + +lemma finite_dimensional_weak_null [FiniteDimensional ℝ Y] (P : X →L[ℝ] Y) + (z : ℕ → X) (hz : WeaklyNull z) : + Tendsto (fun n => P (z n)) atTop (𝓝 0) := by + let e := (Module.finBasis ℝ Y).equivFunL + have hc (i : Fin (Module.finrank ℝ Y)) : + Tendsto (fun n => e (P (z n)) i) atTop (𝓝 0) := by + exact hz ((ContinuousLinearMap.proj i).comp (e.toContinuousLinearMap.comp P)) + have hp : Tendsto (fun n => e (P (z n))) atTop (𝓝 0) := tendsto_pi_nhds.mpr hc + have hh := (e.symm.continuous.tendsto 0).comp hp + simpa only [Function.comp_def,e.symm_apply_apply,map_zero] using hh + +lemma finite_rank_weak_null (P : X →L[ℝ] X) + [FiniteDimensional ℝ (LinearMap.range P.toLinearMap)] + (z : ℕ → X) (hz : WeaklyNull z) : + Tendsto (fun n => ‖P (z n)‖) atTop (𝓝 0) := by + let Q : X →L[ℝ] (LinearMap.range P.toLinearMap) := + P.codRestrict _ (fun x => ⟨x,rfl⟩) + have h := (finite_dimensional_weak_null Q z hz).norm + change Tendsto (fun n => ‖P (z n)‖) atTop (𝓝 ‖(0 : LinearMap.range P.toLinearMap)‖) at h + simpa only [norm_zero] using h + +lemma Heads.weak_pure (A : Heads ι X) {x : X} (z : ℕ → X) (hz : WeaklyNull z) + {R ε η : ℝ} (hη : 0 < η) (hl : ∀ i,ε ≤ ‖z i‖) + (hp : ∀ i,‖x+z i‖ ≤ R) (hm : ∀ i,‖x-z i‖ ≤ R) : + ∃ (H : ι) (p y : X),A.projection H p=p ∧ A.projection H y=0 ∧ + ‖x‖-η ≤ ‖p‖ ∧ ε-η ≤ ‖y‖ ∧ ‖p+y‖ ≤ R+2*η ∧ ‖p-y‖ ≤ R+2*η := by + obtain ⟨H,p,hP,hclose⟩ := A.approximation x η hη + let := A.finite H + have hn := finite_rank_weak_null (A.projection H) z hz + have he : ∀ᶠ n in atTop,‖A.projection H (z n)‖ < η := + hn.eventually (gt_mem_nhds hη) + obtain ⟨n,hn⟩ := he.exists + let w := z n + let P := A.projection H + have hy : ε-η ≤ ‖w-P w‖ := by + have h := norm_sub_norm_le w (P w) + have hw := hl n + change ε ≤ ‖w‖ at hw + linarith + have hpn : ‖x‖-η ≤ ‖p‖ := by linarith [norm_sub_norm_le x p] + have hpp : ‖p+(w-P w)‖ ≤ R+2*η := by + have heq : p+(w-P w)=(x+w)-(x-p)-P w := by module + rw [heq] + have h := (norm_sub_le ((x+w)-(x-p)) (P w)).trans + (add_le_add (norm_sub_le (x+w) (x-p)) le_rfl) + have hw := hp n + change ‖x+w‖ ≤ R at hw + linarith + have hpm : ‖p-(w-P w)‖ ≤ R+2*η := by + have heq : p-(w-P w)=(x-w)-(x-p)+P w := by module + rw [heq] + have h := (norm_add_le ((x-w)-(x-p)) (P w)).trans + (add_le_add (norm_sub_le (x-w) (x-p)) le_rfl) + have hw := hm n + change ‖x-w‖ ≤ R at hw + linarith + refine ⟨H,p,w-P w,hP,?_,hpn,hy,hpp,hpm⟩ + dsimp [P] + rw [map_sub,A.idempotent,sub_self] + +end Midpoint + +namespace RecursiveApplications +open Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +lemma weak_power_lens (A : Heads ι X) {n m : ℕ} {c ε : ℝ} (hc : 0 ≤ c) (hε : 0 < ε) + (hinput : PowerInput A n m c) {x : X} (z : ℕ → X) (hz : WeaklyNull z) + (hl : ∀ i,ε ≤ ‖z i‖) (hp : ∀ i,‖x+z i‖ ≤ 1) (hm : ∀ i,‖x-z i‖ ≤ 1) : + ‖x‖ ≤ Real.sqrt (1-c*ε^n) := by + have hh := positive_limit_le + (fun η => (1+2*η)^m*(max (‖x‖-η) 0)^2+c*(max (ε-η) 0)^n) + (fun η => (1+2*η)^(m+2)) (by fun_prop) (by fun_prop) (fun η hη => by + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.weak_pure z hz hη hl hp hm + have h := hinput H p y (1+2*η) hP hY (by positivity) hpR hmR + have hp' := (sq_le_sq₀ (le_max_right _ _) (norm_nonneg _)).mpr + (max_le hpL (norm_nonneg _)) + have hy' := pow_le_pow_left₀ (le_max_right (ε-η) 0) + (max_le hyL (norm_nonneg y)) n + exact (add_le_add + (mul_le_mul_of_nonneg_left hp' (by positivity : 0 ≤ (1+2*η)^m)) + (mul_le_mul_of_nonneg_left hy' hc)).trans h) + simp only [mul_zero,add_zero,sub_zero,one_pow,one_mul, + max_eq_left (norm_nonneg x),max_eq_left hε.le] at hh + have hrad : 0 ≤ 1-c*ε^n := by nlinarith [sq_nonneg ‖x‖] + exact (Real.le_sqrt (norm_nonneg _) hrad).mpr (by linarith) + +theorem cubic_weak_lens (A : Heads ι X) (hinput : CubicInput A) {ε : ℝ} + (hε : 0 < ε) (_hε1 : ε ≤ 1) {x : X} (z : ℕ → X) (hz : WeaklyNull z) + (hl : ∀ i,ε ≤ ‖z i‖) (hp : ∀ i,‖x+z i‖ ≤ 1) (hm : ∀ i,‖x-z i‖ ≤ 1) : + ‖x‖ ≤ theta ε := by + have h := weak_power_lens A (show 0 ≤ c3/(2*Real.sqrt 2) by have := c3_pos; positivity) + hε (cubic_to_power A hinput) z hz hl hp hm + have he : 1-c3/(2*Real.sqrt 2)*ε^3=1-c3*ε^3/(2*Real.sqrt 2) := by ring + simpa only [he,theta] using h + +end RecursiveApplications + +namespace Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +/-- Exactly finite-head-supported vectors. For the coordinate models, these are + the finite coordinate vectors on the allowed ancestral heads. -/ +def Heads.FiniteVector (A : Heads ι X) (x : X) : Prop := ∃ H,A.projection H x=x + +/-- Coordinate projections commute even when their norms are not uniformly bounded. -/ +def Heads.Commutes (A : Heads ι X) : Prop := + ∀ H K x,A.projection H (A.projection K x)=A.projection K (A.projection H x) + +lemma Heads.finite_tail_approx (A : Heads ι X) (hcomm : A.Commutes) + (H : ι) {y : X} (hY : A.projection H y=0) {η : ℝ} (hη : 0 < η) : + ∃ v : X,A.FiniteVector v ∧ A.projection H v=0 ∧ ‖y-v‖ < η := by + let P := A.projection H + have hden : 0 < 1+‖P‖ := by positivity + obtain ⟨K,q,hK,hq⟩ := A.approximation y (η/(1+‖P‖)) (by positivity) + refine ⟨q-P q,⟨K,?_⟩,?_,?_⟩ + · dsimp [P] + rw [map_sub,hcomm K H q,hK] + · dsimp [P] + rw [map_sub,A.idempotent,sub_self] + · have he : y-(q-P q)=(y-q)+P (q-y) := by + rw [map_sub] + have h : P y=0 := hY + rw [h] + module + rw [he] + calc + _ ≤ ‖y-q‖+‖P (q-y)‖ := norm_add_le _ _ + _ ≤ ‖y-q‖+‖P‖*‖q-y‖ := add_le_add le_rfl (P.le_opNorm _) + _ = (1+‖P‖)*‖y-q‖ := by rw [norm_sub_rev q y]; ring + _ < (1+‖P‖)*(η/(1+‖P‖)) := mul_lt_mul_of_pos_left hq hden + _ = η := by field_simp + +end Midpoint + +namespace RecursiveApplications +open Midpoint +variable {X ι : Type*} [NormedAddCommGroup X] [NormedSpace ℝ X] + +def FreeRootInput (A : Heads ι X) (γ : ℝ → ℝ → ℝ) : Prop := + ∀ ζ : ℝ,0 < ζ → ζ ≤ 2 → 0 < γ 2 (ζ/4) ∧ + ∀ (H : ι) (p y : X),A.projection H p=p → A.projection H y=0 → + A.FiniteVector y → ‖p+y‖ ≤ 2 → ‖p-y‖ ≤ 2 → ζ ≤ ‖y‖ → + ‖p‖+2*γ 2 (ζ/4) ≤ (‖p+y‖+‖p-y‖)/2 + +/-- An admissible positive qualitative choice; + outside the possible separation range, any number in (0,1) is allowed. -/ +def sumEta (γ : ℝ → ℝ → ℝ) (ε : ℝ) : ℝ := + if ε ≤ 2 then min (γ 2 (ε/16)) (1/2) else 1/2 + +lemma sumEta_range (A : Heads ι X) {γ : ℝ → ℝ → ℝ} (hinput : FreeRootInput A γ) + {ε : ℝ} (hε : 0 < ε) : 0 < sumEta γ ε ∧ sumEta γ ε < 1 := by + by_cases hε2 : ε ≤ 2 + · have hg := (hinput (ε/4) (by positivity) (by linarith)).1 + have he : ε/4/4=ε/16 := by ring + rw [he] at hg + rw [sumEta,ite_eq_left hε2] + constructor + · exact lt_min hg (by norm_num) + · exact (min_le_right _ _).trans_lt (by norm_num) + · rw [sumEta,ite_eq_right hε2] + norm_num + +theorem free_root_lens (A : Heads ι X) (hcomm : A.Commutes) + {γ : ℝ → ℝ → ℝ} (hinput : FreeRootInput A γ) {ε : ℝ} (hε : 0 < ε) : + Diamond.UnitLensBound X ε (1-sumEta γ ε) := by + intro x z hp hm hs + by_cases hε2 : ε ≤ 2 + · have hg := hinput (ε/4) (by positivity) (by linarith) + have heγ : ε/4/4=ε/16 := by ring + rw [heγ] at hg + have hcenter : ‖x‖+2*γ 2 (ε/16) ≤ 1 := by + apply le_of_forall_pos_le_add + intro η hη + let δ := min (ε/8) (min (1/4:ℝ) (η/8)) + have hδ : 0 < δ := lt_min (by positivity) (lt_min (by norm_num) (by positivity)) + have hδε : δ ≤ ε/8 := min_le_left _ _ + have hδ1 : δ ≤ 1/4 := (min_le_right _ _).trans (min_le_left _ _) + have hδη : δ ≤ η/8 := (min_le_right _ _).trans (min_le_right _ _) + obtain ⟨H,p,y,hP,hY,hpL,hyL,hpR,hmR⟩ := A.pure_pair z hδ hp hm hs + obtain ⟨v,hfinite,hvH,hclose⟩ := A.finite_tail_approx hcomm H hY hδ + have hv : ε/4 ≤ ‖v‖ := by + have h := norm_sub_norm_le y v + linarith + have hvp : ‖p+v‖ ≤ 1+3*δ := by + have he : p+v=(p+y)-(y-v) := by module + rw [he] + exact (norm_sub_le _ _).trans (by linarith) + have hvm : ‖p-v‖ ≤ 1+3*δ := by + have he : p-v=(p-y)+(y-v) := by module + rw [he] + exact (norm_add_le _ _).trans (by linarith) + have hgain := hg.2 H p v hP hvH hfinite (hvp.trans (by linarith)) + (hvm.trans (by linarith)) hv + linarith + rw [sumEta,ite_eq_left hε2] + have hmin : min (γ 2 (ε/16)) (1/2) ≤ γ 2 (ε/16) := min_le_left _ _ + linarith [hg.1] + · have h0 := Diamond.norm_deviation_le (hp 0) (hm 0) + have h1 := Diamond.norm_deviation_le (hp 1) (hm 1) + have hdist := (norm_sub_le (z 0) (z 1)).trans (add_le_add h0 h1) + have hsep := hs 0 1 (by decide) + linarith + +theorem free_root_depth (A : Heads ι X) (hcomm : A.Commutes) + {γ : ℝ → ℝ → ℝ} (hinput : FreeRootInput A γ) {D s : ℝ} + (k : ℕ) (f : Diamond.Vertex k → X) (hf : Diamond.HasDistortion k f D s) : + D⁻¹ ≤ (1-sumEta γ (2/D))^k := by + have hD : 0 < D := lt_of_lt_of_le (by norm_num) hf.1 + have hα : 0 < D⁻¹ := inv_pos.mpr hD + have hα1 : D⁻¹ ≤ 1 := (inv_le_one₀ hD).mpr hf.1 + obtain ⟨hη,hη1⟩ := sumEta_range A hinput (show 0 < 2/D by positivity) + have hlens : Diamond.UnitLensBound X (2*D⁻¹) (1-sumEta γ (2/D)) := by + simpa only [div_eq_mul_inv] using free_root_lens A hcomm hinput (show 0 < 2/D by positivity) + have hnorm := Diamond.upper_one_normalization f hf + exact Diamond.backward hα hα1 (by linarith) (by linarith) hlens k + (fun v => (D*s)⁻¹ • f v) (fun u v => (hnorm u v).1) (fun u v => (hnorm u v).2) + +end RecursiveApplications + +end DiamondDistortion + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/AnalyticCharts.lean b/lean/OAI/Analysis/DirectCrouzeix/AnalyticCharts.lean new file mode 100644 index 0000000000000000000000000000000000000000..5bd7c14b0ddeddfc22d440e3a4b3c21b17042da5 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/AnalyticCharts.lean @@ -0,0 +1,252 @@ +import OAI.Analysis.DirectCrouzeix.ConformalCollar + +namespace OAI + +universe u_133 u_134 u_135 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +theorem analytic_inverse_chart {E : Type u_133} {F : Type u_134} [NormedAddCommGroup E] + [NormedSpace ℂ E] + [CompleteSpace E] [NormedAddCommGroup F] [NormedSpace ℂ F] [CompleteSpace F] + {f : E → F} {x : E} (ha : AnalyticAt ℂ f x) (e : E ≃L[ℂ] F) + (hd : HasFDerivAt f e.toContinuousLinearMap x) : + ∃ U : OpenPartialHomeomorph E F, (U : E → F) = f ∧ x ∈ U.source ∧ + AnalyticAt ℂ U.symm (f x) := by + have hsd : HasStrictFDerivAt f e.toContinuousLinearMap x := by + rw [← hd.fderiv] + exact ha.hasStrictFDerivAt + let U := hsd.toOpenPartialHomeomorph f + have hU : (U : E → F) = f := hsd.toOpenPartialHomeomorph_coe + have hx : x ∈ U.source := hsd.mem_toOpenPartialHomeomorph_source + refine ⟨U,hU,hx,?_⟩ + obtain ⟨p,hp⟩ := ha + have hc : p 1 = (continuousMultilinearCurryFin1 ℂ E F).symm e.toContinuousLinearMap := by + apply (continuousMultilinearCurryFin1 ℂ E F).injective + rw [LinearIsometryEquiv.apply_symm_apply] + exact hp.hasFDerivAt.unique hd + have hpU : HasFPowerSeriesAt U p x := hU ▸ hp + simpa only [hU] using (U.hasFPowerSeriesAt_symm hx hpU hc).analyticAt + +def conjugatePair (z : ℂ × ℂ) : ℂ × ℂ := (conj z.1,conj z.2) + +theorem conjugatePair_continuous : Continuous conjugatePair := + (Complex.continuous_conj.comp continuous_fst).prodMk (Complex.continuous_conj.comp continuous_snd) + +@[simp] theorem conjugatePair_zero : conjugatePair 0 = 0 := by simp [conjugatePair] + +theorem normalized_implicit_graph {F : ℂ × ℂ → ℂ} (hF : AnalyticAt ℂ F 0) + (hF0 : F 0 = 1) {b : ℝ} (hb : 0 < b) + (hd : HasFDerivAt F ((b:ℂ) • ContinuousLinearMap.snd ℂ ℂ ℂ) 0) + (hconj : ∀ z, F (conjugatePair z) = conj (F z)) : + ∃ g : ℂ → ℂ, AnalyticAt ℂ g 0 ∧ g 0 = 0 ∧ deriv g 0 = 0 ∧ + (∀ᶠ z in 𝓝 0, F (z,g z) = 1) ∧ + (∀ᶠ z in 𝓝 0, g (conj z) = conj (g z)) := by + let H := fun z : ℂ × ℂ => (z.1,F z-1) + have hH0 : H 0 = 0 := by simp [H,hF0] + have hbC : (b:ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hb + let e : (ℂ × ℂ) ≃L[ℂ] (ℂ × ℂ) := (ContinuousLinearEquiv.refl ℂ ℂ).prodCongr + (ContinuousLinearEquiv.unitsEquivAut ℂ (Units.mk0 (b:ℂ) hbC)) + have hH : AnalyticAt ℂ H 0 := analyticAt_fst.prod (hF.sub analyticAt_const) + have hHd : HasFDerivAt H e.toContinuousLinearMap 0 := by + convert! (hasFDerivAt_fst (𝕜 := ℂ) (p := (0:ℂ × ℂ))).prodMk (hd.sub_const 1) using 1 + ext <;> simp [e] + obtain ⟨U,hU,h0,hUi⟩ := analytic_inverse_chart hH e hHd + rw [hH0] at hUi + have hU0 : U 0 = 0 := by rw [hU]; exact hH0 + have hi0 : U.symm 0 = 0 := by simpa only [hU0] using U.left_inv h0 + have ht0 : (0:ℂ × ℂ) ∈ U.target := hU0 ▸ U.map_source h0 + let V := fun z : ℂ => U.symm (z,0) + have hV : AnalyticAt ℂ V 0 := hUi.comp (f := fun z : ℂ => (z,0)) (analyticAt_id.prod analyticAt_const) + have hV0 : V 0 = 0 := hi0 + let g := fun z => (V z).2 + have hg : AnalyticAt ℂ g 0 := analyticAt_snd.comp hV + have hvT : ∀ᶠ z in 𝓝 (0:ℂ), (z,0) ∈ U.target := + (continuous_id.prodMk continuous_const).continuousAt.preimage_mem_nhds (U.open_target.mem_nhds ht0) + have hvEq : ∀ᶠ z in 𝓝 (0:ℂ), H (V z) = (z,0) := by + filter_upwards [hvT] with z hz + exact hU ▸ U.right_inv hz + have hvfst : ∀ᶠ z in 𝓝 (0:ℂ), (V z).1 = z := by + filter_upwards [hvEq] with z hz + exact congrArg Prod.fst hz + have heq : ∀ᶠ z in 𝓝 (0:ℂ), F (z,g z) = 1 := by + filter_upwards [hvEq,hvfst] with z hz hzf + have hs : F (V z)-1 = 0 := congrArg Prod.snd hz + have hev : V z = (z,g z) := Prod.ext hzf rfl + simpa only [hev,sub_eq_zero] using hs + have hg0 : g 0 = 0 := congrArg Prod.snd hV0 + have hgd : deriv g 0 = 0 := by + have hdcomp := (show HasFDerivAt F ((b:ℂ) • ContinuousLinearMap.snd ℂ ℂ ℂ) (0,g 0) by simpa only [hg0,Prod.zero_eq_mk] using hd).comp 0 ((hasDerivAt_id (0:ℂ)).prodMk hg.differentiableAt.hasDerivAt).hasFDerivAt + have hdconst : HasDerivAt (fun z => F (z,g z)) (b*deriv g 0) 0 := by + convert! hdcomp.hasDerivAt using 1 ; simp [ContinuousLinearMap.comp_apply] + have heder := hdconst.congr_of_eventuallyEq (show (fun _ : ℂ => (1:ℂ)) =ᶠ[𝓝 0] (fun z => F (z,g z)) from by filter_upwards [heq] with z hz; exact hz.symm) + have hzero := heder.unique (hasDerivAt_const (0:ℂ) (1:ℂ)) + exact (mul_eq_zero.mp hzero).resolve_left hbC + have hconjH (z : ℂ × ℂ) : H (conjugatePair z) = conjugatePair (H z) := by + change (conj z.1,F (conjugatePair z)-1) = (conj z.1,conj (F z-1)) + rw [hconj]; simp + have hvSC : ∀ᶠ z in 𝓝 (0:ℂ), conjugatePair (V z) ∈ U.source := by + have hc : ContinuousAt (fun z => conjugatePair (V z)) 0 := conjugatePair_continuous.continuousAt.comp hV.continuousAt + have he0 : conjugatePair (V 0) = 0 := by rw [hV0]; simp + exact hc.preimage_mem_nhds (he0 ▸ U.open_source.mem_nhds h0) + have htconj : ∀ᶠ z in 𝓝 (0:ℂ), (conj z,0) ∈ U.target := by + have ht : Tendsto (conj : ℂ → ℂ) (𝓝 0) (𝓝 0) := by simpa using Complex.continuous_conj.tendsto (0:ℂ) + exact ht.eventually hvT + refine ⟨g,hg,hg0,hgd,heq,?_⟩ + filter_upwards [hvEq,hvSC,htconj] with z hz hzS hzT + have he : V (conj z) = conjugatePair (V z) := by + apply U.injOn (U.map_target hzT) hzS + rw [hU] + rw [hconjH,hz] + simpa [conjugatePair] using (show H (U.symm (conj z,0)) = (conj z,0) from hU ▸ U.right_inv hzT) + exact congrArg Prod.snd he + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +theorem negative_vertical_level_side {f : ℂ → ℝ} + (hf : ContDiffAt ℝ 1 f 0) (hd : fderiv ℝ f 0 Complex.I < 0) + (hreal : ∀ᶠ x : ℝ in 𝓝 0, f (x:ℂ) = 1) : + ∃ r > 0, ∀ z ∈ ball (0:ℂ) r, (f z < 1 ↔ 0 < z.im) ∧ (1 < f z ↔ z.im < 0) := by + have he : ∀ᶠ z in 𝓝 (0:ℂ), DifferentiableAt ℝ f z ∧ fderiv ℝ f z Complex.I < 0 := by + have hc : ContinuousAt (fun z => fderiv ℝ f z Complex.I) 0 := + (hf.continuousAt_fderiv (by norm_num)).clm_apply continuousAt_const + filter_upwards [hf.eventually (by norm_num),hc.eventually_lt continuousAt_const hd] with z hz hzn + exact ⟨hz.differentiableAt (by norm_num),hzn⟩ + obtain ⟨d,hd0,hdB⟩ := Metric.mem_nhds_iff.mp he + obtain ⟨e,he0,heB⟩ := Metric.mem_nhds_iff.mp hreal + let r := min (d/3) e + have hr : 0 < r := lt_min (by positivity) he0 + have hrd : 3*r ≤ d := by dsimp [r]; have := min_le_left (d/3) e; linarith + have hre : r ≤ e := min_le_right _ _ + refine ⟨r,hr,?_⟩ + intro z hz + have hzN : ‖z‖ < r := mem_ball_zero_iff.mp hz + have hx : |z.re| < r := lt_of_le_of_lt (Complex.abs_re_le_norm z) hzN + have hy : |z.im| < r := lt_of_le_of_lt (Complex.abs_im_le_norm z) hzN + have hyI : z.im ∈ Ioo (-r) r := abs_lt.mp hy + have h0I : (0:ℝ) ∈ Ioo (-r) r := ⟨by linarith,hr⟩ + let v := fun y : ℝ => (z.re:ℂ)+(y:ℂ)*Complex.I + have hvB (y : ℝ) (hy : y ∈ Ioo (-r) r) : v y ∈ ball (0:ℂ) d := by + rw [mem_ball_zero_iff] + calc + ‖v y‖ ≤ ‖(z.re:ℂ)‖+‖(y:ℂ)*Complex.I‖ := norm_add_le _ _ + _ = |z.re|+|y| := by simp [Complex.norm_real,Real.norm_eq_abs] + _ < r+r := add_lt_add hx (abs_lt.mpr hy) + _ < d := by linarith + have hvd (y : ℝ) : HasDerivAt v Complex.I y := by + simpa [v] using (Complex.ofRealCLM.hasDerivAt (x := y)).mul_const Complex.I |>.const_add (z.re:ℂ) + have hder (y : ℝ) (hy : y ∈ Ioo (-r) r) : + HasDerivAt (fun y => f (v y)) (fderiv ℝ f (v y) Complex.I) y := + (hdB (hvB y hy)).1.hasFDerivAt.comp_hasDerivAt y (hvd y) + have hanti : StrictAntiOn (fun y => f (v y)) (Ioo (-r) r) := by + apply strictAntiOn_of_deriv_neg (convex_Ioo _ _) + · intro y hy + exact (hder y hy).continuousAt.continuousWithinAt + · intro y hy + rw [(hder y (interior_subset hy)).deriv] + exact (hdB (hvB y (interior_subset hy))).2 + have hbase : f (v 0) = 1 := by + simpa [v] using heB (show z.re ∈ ball (0:ℝ) e from mem_ball_zero_iff.mpr (by simpa [Real.norm_eq_abs] using lt_of_lt_of_le hx hre)) + have hvz : v z.im = z := Complex.re_add_im z + constructor + · have hh := hanti.lt_iff_gt hyI h0I + change (f (v z.im) < f (v 0) ↔ 0 < z.im) at hh + rwa [hbase,hvz] at hh + · have hh := hanti.lt_iff_gt h0I hyI + change (f (v 0) < f (v z.im) ↔ z.im < 0) at hh + rwa [hbase,hvz] at hh + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +theorem analytic_complex_chart {f : ℂ → ℂ} (hf : AnalyticAt ℂ f 0) + (hd : deriv f 0 ≠ 0) {P : ℂ → Prop} (hP : ∀ᶠ z in 𝓝 0, P z) : + ∃ U : OpenPartialHomeomorph ℂ ℂ, (U : ℂ → ℂ) = f ∧ 0 ∈ U.source ∧ + AnalyticOnNhd ℂ U U.source ∧ AnalyticOnNhd ℂ U.symm U.target ∧ + deriv U.symm (f 0) ≠ 0 ∧ (∀ z ∈ U.source, P z) := by + let e : ℂ ≃L[ℂ] ℂ := ContinuousLinearEquiv.unitsEquivAut ℂ (Units.mk0 (deriv f 0) hd) + have hed : HasFDerivAt f e.toContinuousLinearMap 0 := by + convert! hf.differentiableAt.hasDerivAt.hasFDerivAt using 1 + obtain ⟨U,hU,h0,hi⟩ := analytic_inverse_chart hf e hed + have he : ∀ᶠ z in 𝓝 (0:ℂ), AnalyticAt ℂ f z ∧ AnalyticAt ℂ U.symm (f z) ∧ P z := by + filter_upwards [hf.eventually_analyticAt,hf.continuousAt.eventually hi.eventually_analyticAt,hP] with z hz hzi hzP + exact ⟨hz,hzi,hzP⟩ + obtain ⟨r,hr,hrB⟩ := Metric.mem_nhds_iff.mp he + let V := U.restr (ball 0 r) + have hs : V.source = U.source ∩ ball 0 r := by simp [V,isOpen_ball.interior_eq] + have ht : V.target = U.target ∩ U.symm ⁻¹' ball 0 r := by simp [V,isOpen_ball.interior_eq] + have hV : (V : ℂ → ℂ) = f := by simpa [V] using hU + have hVi : (V.symm : ℂ → ℂ) = U.symm := rfl + have ht0 : f 0 ∈ U.target := hU ▸ U.map_source h0 + have hui0 : U.symm (f 0) = 0 := by simpa only [hU] using U.left_inv h0 + have hdi := U.hasDerivAt_symm ht0 hd (show HasDerivAt U (deriv f 0) (U.symm (f 0)) by + rw [hui0,hU]; exact hf.differentiableAt.hasDerivAt) + refine ⟨V,hV,?_,?_,?_,?_,?_⟩ + · rw [hs]; exact ⟨h0,mem_ball_self hr⟩ + · intro z hz + rw [hV] + exact (hrB ((hs ▸ hz).2)).1 + · intro z hz + rw [hVi] + have hzS := U.map_target ((ht ▸ hz).1) + have hi := (hrB ((ht ▸ hz).2)).2.1 + rw [← hU,U.right_inv ((ht ▸ hz).1)] at hi + exact hi + · rw [hVi,hdi.deriv] + exact inv_ne_zero hd + · intro z hz + exact (hrB ((hs ▸ hz).2)).2.2 + +end DirectCrouzeix.Geometry + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +variable {ι : Type u_135} [Fintype ι] + +def expLevel (v : ι → ℂ) (b : ι → ℝ) (z : ℂ) : ℝ := + ∑ i, Real.exp (inner ℝ (v i) z+b i) + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/BoundaryEnergy.lean b/lean/OAI/Analysis/DirectCrouzeix/BoundaryEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..35ad5040edd4ed9d4cf11fa8012d24e02cf814e5 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/BoundaryEnergy.lean @@ -0,0 +1,139 @@ +import OAI.Analysis.DirectCrouzeix.CircleFourier + +namespace OAI + +universe u_73 u_74 u_75 u_76 u_77 u_78 u_79 u_80 u_81 u_82 u_83 u_84 u_85 u_86 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +open MeasureTheory + +theorem matrix_energy_split {ι : Type u_73} {κ : Type u_74} [Fintype ι] [Fintype κ] + [DecidableEq ι] [DecidableEq κ] + (f : BoundaryCircle → Matrix ι κ ℂ) (hf : Continuous f) : + (∫ t, hsSq (f t) ∂circleMeasure) = + (∑' n : ℕ, hsSq (fourierCoeff f (n+1))) + hsSq (fourierCoeff f 0) + + ∑' n : ℕ, hsSq (fourierCoeff f (-(n+1))) := by + have hp := matrix_circle_parseval f hf + rw [← hp.tsum_eq] + apply tsum_of_add_one_of_neg_add_one + · exact hp.summable.comp_injective (by intro i j he; exact_mod_cast (add_right_cancel he : (i : ℤ) = j)) + · exact hp.summable.comp_injective (by intro i j he; exact_mod_cast (add_right_cancel (neg_injective he) : (i : ℤ) = j)) + +@[simp] theorem hsSq_zero {ι : Type u_75} {κ : Type u_76} [Fintype ι] [Fintype κ] : + hsSq (0 : Matrix ι κ ℂ) = 0 := by simp [hsSq_eq_sum_norm_sq] + +theorem hsSq_add_self {ι : Type u_77} {κ : Type u_78} [Fintype ι] [Fintype κ] (A : Matrix ι κ ℂ) : + hsSq (A + A) = 4 * hsSq A := by + rw [← two_smul ℂ A,hsSq_smul] + norm_num + +theorem fourierCoeff_add_star {ι : Type u_79} [Fintype ι] [DecidableEq ι] + (P Q : BoundaryCircle → Matrix ι ι ℂ) (hP : Continuous P) (hQ : Continuous Q) (k : ℤ) : + fourierCoeff (fun t => P t + (Q t)ᴴ) k = + fourierCoeff P k + (fourierCoeff Q (-k))ᴴ := by + have hQstar := conjugateTransposeCLM.continuous.comp hQ + have hh := congrFun (fourierCoeff.add (continuous_integrable_compact _ hP) + (continuous_integrable_compact _ hQstar)) k + change fourierCoeff (fun t => P t + (Q t)ᴴ) k = + fourierCoeff P k + fourierCoeff (fun t => (Q t)ᴴ) k at hh + rwa [fourierCoeff_star_matrix Q hQ k] at hh + +theorem anti_matrix_energy {ι : Type u_80} [Fintype ι] [DecidableEq ι] + (P : BoundaryCircle → Matrix ι ι ℂ) (hP : Continuous P) + (hpos : ∀ k : ℤ, 0 < k → fourierCoeff P k = 0) : + (∫ t, hsSq (P t) ∂circleMeasure) = hsSq (fourierCoeff P 0) + + ∑' n : ℕ, hsSq (fourierCoeff P (-(n+1))) := by + rw [matrix_energy_split P hP] + have hp : ∀ n : ℕ, fourierCoeff P (n+1) = 0 := fun n => hpos _ (by omega) + simp only [hp,hsSq_zero,tsum_zero,zero_add] + +theorem anti_diagonal_energy {ι : Type u_81} [Fintype ι] [DecidableEq ι] + (P : BoundaryCircle → Matrix ι ι ℂ) (hP : Continuous P) + (hpos : ∀ k : ℤ, 0 < k → fourierCoeff P k = 0) + (hzero : (fourierCoeff P 0).IsHermitian) : + (∫ t, hsSq (P t + (P t)ᴴ) ∂circleMeasure) = + 4 * (hsSq (fourierCoeff P 0) + + (1/2 : ℝ) * ∑' n : ℕ, hsSq (fourierCoeff P (-(n+1)))) := by + have hcont : Continuous (fun t => P t + (P t)ᴴ) := + hP.add (conjugateTransposeCLM.continuous.comp hP) + rw [matrix_energy_split _ hcont] + have hp : ∀ n : ℕ, fourierCoeff P (n+1) = 0 := fun n => hpos _ (by omega) + simp only [fourierCoeff_add_star P P hP hP,neg_zero,hzero.eq,hp,neg_neg, + Matrix.conjTranspose_zero,zero_add,add_zero,hsSq_conjTranspose,hsSq_add_self] + ring + +theorem anti_cross_energy {ι : Type u_82} [Fintype ι] [DecidableEq ι] + (M L : BoundaryCircle → Matrix ι ι ℂ) (hM : Continuous M) (hL : Continuous L) + (hMp : ∀ k : ℤ, 0 < k → fourierCoeff M k = 0) + (hLp : ∀ k : ℤ, 0 < k → fourierCoeff L k = 0) + (hzero : (fourierCoeff L 0)ᴴ = fourierCoeff M 0) : + (∫ t, hsSq (M t) ∂circleMeasure) ≤ + ∫ t, hsSq (M t + (L t)ᴴ) ∂circleMeasure := by + have hcont : Continuous (fun t => M t + (L t)ᴴ) := + hM.add (conjugateTransposeCLM.continuous.comp hL) + rw [matrix_energy_split _ hcont,anti_matrix_energy M hM hMp] + have hpM : ∀ n : ℕ, fourierCoeff M (n+1) = 0 := fun n => hMp _ (by omega) + have hpL : ∀ n : ℕ, fourierCoeff L (n+1) = 0 := fun n => hLp _ (by omega) + simp_rw [fourierCoeff_add_star M L hM hL,neg_zero,hzero,hpM,neg_neg,hpL, + Matrix.conjTranspose_zero,zero_add,add_zero,hsSq_conjTranspose,hsSq_add_self] + have hsum : 0 ≤ ∑' n : ℕ, hsSq (fourierCoeff L (-(n+1))) := + tsum_nonneg (fun _ => hsSq_nonneg _) + nlinarith [hsSq_nonneg (fourierCoeff M 0)] + +theorem finite_negative_bessel {ι : Type u_83} {κ : Type u_84} [Fintype ι] [Fintype κ] + [DecidableEq ι] [DecidableEq κ] + (P : BoundaryCircle → Matrix ι κ ℂ) (hP : Continuous P) (N : ℕ) : + (∑ k : Fin N, hsSq (fourierCoeff P (-(k : ℤ)))) ≤ + ∫ t, hsSq (P t) ∂circleMeasure := by + classical + let σ : Fin N → ℤ := fun k => -(k : ℤ) + have hi : Function.Injective σ := by + intro i j he + apply Fin.ext + exact_mod_cast neg_injective he + have hp := matrix_circle_parseval P hP + have hh := hp.summable.sum_le_tsum (Finset.univ.image σ) (fun _ _ => hsSq_nonneg _) + rw [Finset.sum_image (fun i _ j _ he => hi he),hp.tsum_eq] at hh + exact hh + +def faberWeight (k : ℕ) : ℝ := if k = 0 then 1 else 2 + +theorem faberWeight_pos (k : ℕ) : 0 < faberWeight k := by + unfold faberWeight + split <;> norm_num + +theorem weighted_sequence_dual {ι : Type u_85} {κ : Type u_86} [Fintype ι] [Fintype κ] + (P : ℕ → Matrix ι κ ℂ) (b : ℝ) (hb : 0 ≤ b) + (h : ∀ N (C : Fin N → Matrix ι κ ℂ), + ‖∑ k : Fin N, entryPair (P k) (C k)‖ ^ 2 ≤ b * ∑ k : Fin N, faberWeight k * hsSq (C k)) : + hsSq (P 0) + (1/2 : ℝ) * ∑' n : ℕ, hsSq (P (n+1)) ≤ b := by + have hsum : ∀ N, ∑ k ∈ Finset.range N, hsSq (P k) / faberWeight k ≤ b := by + intro N + have hh := weighted_coefficient_dual (fun k : Fin N => P k) + (fun k => faberWeight k) (fun k => faberWeight_pos k) b hb (h N) + rw [← Fin.sum_univ_eq_sum_range (fun k => hsSq (P k) / faberWeight k)] + exact hh + have hnon : ∀ k, 0 ≤ hsSq (P k) / faberWeight k := + fun k => div_nonneg (hsSq_nonneg _) (faberWeight_pos k).le + have hsumm : Summable (fun k => hsSq (P k) / faberWeight k) := + summable_of_sum_range_le hnon hsum + have hh := Real.tsum_le_of_sum_range_le hnon hsum + rw [hsumm.tsum_eq_zero_add] at hh + have hw0 : faberWeight 0 = 1 := by simp [faberWeight] + have hw (n : ℕ) : faberWeight (n+1) = 2 := by simp [faberWeight] + simp only [hw0,hw,div_one] at hh + rw [tsum_div_const] at hh + convert hh using 1 ; ring + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/BoundaryKernel.lean b/lean/OAI/Analysis/DirectCrouzeix/BoundaryKernel.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd751b87eae6c89113b9816475275a4b4780063a --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/BoundaryKernel.lean @@ -0,0 +1,254 @@ +import OAI.Analysis.DirectCrouzeix.FaberPolynomials + +namespace OAI + +universe u_108 u_109 u_110 u_111 u_112 u_113 u_114 u_115 u_116 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +theorem continuous_circle_integral {α : Type u_108} {E : Type u_109} [TopologicalSpace α] + [FirstCountableTopology α] [LocallyCompactSpace α] + [NormedAddCommGroup E] [NormedSpace ℝ E] + {f : α → Angle → E} (hf : Continuous f.uncurry) : + Continuous (fun x => ∫ t, f x t ∂angularMeasure) := by + simpa using continuous_parametric_integral_of_continuous (μ := angularMeasure) hf isCompact_univ + +theorem continuous_slice_left {α : Type u_110} {β : Type u_111} {E : Type u_112} + [TopologicalSpace α] [TopologicalSpace β] + [TopologicalSpace E] (f : α → β → E) (hf : Continuous f.uncurry) (y : β) : + Continuous (fun x => f x y) := by + simpa only [Function.comp_def,Function.uncurry] using! hf.comp (continuous_id.prodMk continuous_const) + +theorem continuous_slice_right {α : Type u_113} {β : Type u_114} {E : Type u_115} + [TopologicalSpace α] [TopologicalSpace β] + [TopologicalSpace E] (f : α → β → E) (hf : Continuous f.uncurry) (x : α) : + Continuous (f x) := by + simpa only [Function.comp_def,Function.uncurry] using! hf.comp (continuous_const.prodMk continuous_id) + +theorem fourierCoeff_integral_swap {E : Type u_116} [NormedAddCommGroup E] + [NormedSpace ℂ E] [CompleteSpace E] (f : Angle → Angle → E) + (hf : Continuous f.uncurry) (k : ℤ) : + fourierCoeff (fun s => ∫ t, f t s ∂angularMeasure) k = + ∫ t, fourierCoeff (f t) k ∂angularMeasure := by + unfold fourierCoeff + simp_rw [← integral_smul] + apply (integral_integral_swap _).symm + exact integrable_of_continuous_compact _ + (((fourier (-k)).continuous.comp continuous_snd).smul hf) + +theorem fourierCoeff_conjugate (f : Angle → ℂ) (k : ℤ) : + fourierCoeff (fun t => conj (f t)) k = conj (fourierCoeff f (-k)) := by + unfold fourierCoeff + rw [← integral_conj] + apply integral_congr_ae + filter_upwards with t + simp [] + +def boundary (c : ℂ) (g : ℂ → ℂ) (t : Angle) : ℂ := exterior c g (unitPoint t) + +def boundaryCorrection (c : ℂ) (g : ℂ → ℂ) (t s : Angle) : ℂ := + correction c g ((unitPoint t)⁻¹) ((unitPoint s)⁻¹) + +def boundaryCoefficient (c : ℂ) (g : ℂ → ℂ) (k : ℕ) (s : Angle) : ℂ := + fourierCoeff (fun t => boundaryCorrection c g t s) (-(k:ℤ)) + +def boundaryKernel (c : ℂ) (g : ℂ → ℂ) (t s : Angle) : ℝ := + 1 + 2*(boundaryCorrection c g t s).re + +theorem unitPoint_ne_zero (t : Angle) : unitPoint t ≠ 0 := by + exact norm_ne_zero_iff.mp (by rw [unitPoint_norm]; norm_num) + +theorem unitPoint_inv_mem {R : ℝ} (hR : 1 < R) (t : Angle) : + (unitPoint t)⁻¹ ∈ ball (0:ℂ) R := by + simpa only [mem_ball,dist_zero_right,norm_inv,unitPoint_norm,inv_one] using hR + +theorem continuous_boundary {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) (c : ℂ) : Continuous (boundary c g) := by + have hi : Continuous (fun t => (unitPoint t)⁻¹) := unitPoint_continuous.inv₀ unitPoint_ne_zero + exact (continuous_const.mul unitPoint_continuous).add + (hg.continuousOn.comp_continuous hi (unitPoint_inv_mem hR)) + +theorem continuous_boundaryCorrection {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) : + Continuous (boundaryCorrection c g).uncurry := by + have hi : Continuous (fun t => (unitPoint t)⁻¹) := unitPoint_continuous.inv₀ unitPoint_ne_zero + let f : Angle × Angle → ℂ × ℂ := fun p => ((unitPoint p.1)⁻¹,(unitPoint p.2)⁻¹) + have hf : Continuous f := (hi.comp continuous_fst).prodMk (hi.comp continuous_snd) + have hmaps : MapsTo f univ (ball 0 R ×ˢ ball 0 R) := + fun p _ => ⟨unitPoint_inv_mem hR p.1,unitPoint_inv_mem hR p.2⟩ + have he : (boundaryCorrection c g).uncurry = (fun p : ℂ × ℂ => correction c g p.1 p.2) ∘ f := rfl + rw [he] + exact (continuousOn_correction isOpen_ball (convex_ball 0 R) hg hH).comp_continuous hf + (fun p => hmaps (mem_univ p)) + +theorem continuous_boundaryCoefficient {c : ℂ} {g : ℂ → ℂ} + (hS : Continuous (boundaryCorrection c g).uncurry) (k : ℕ) : + Continuous (boundaryCoefficient c g k) := by + have hs : Continuous (fun p : Angle × Angle => boundaryCorrection c g p.2 p.1) := by + simpa only [Function.uncurry,Function.comp_def] using! hS.comp continuous_swap + have hf : Continuous (fun p : Angle × Angle => fourier (-(-(k:ℤ))) p.2) := + (fourier (-(-(k:ℤ)))).continuous.comp continuous_snd + have hh := continuous_circle_integral (f := fun s t => fourier (-(-(k:ℤ))) t • boundaryCorrection c g t s) + (hf.smul hs) + exact hh + +theorem boundaryCorrection_left_coeff {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (s : Angle) (j : ℤ) : + fourierCoeff (fun t => boundaryCorrection c g t s) j = + if j ≤ 0 then taylorCoeff (fun u => correction c g u ((unitPoint s)⁻¹)) (-j).toNat else 0 := by + exact fourierCoeff_of_antianalytic hR + (analyticOnNhd_correction_left isOpen_ball (convex_ball 0 R) hg (unitPoint_inv_mem hR s) + (fun u hu => hH u hu _ (unitPoint_inv_mem hR s))) j + +theorem boundaryCorrection_right_coeff {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (t : Angle) (j : ℤ) : + fourierCoeff (boundaryCorrection c g t) j = + if j ≤ 0 then taylorCoeff (correction c g ((unitPoint t)⁻¹)) (-j).toNat else 0 := by + exact fourierCoeff_of_antianalytic hR + (analyticOnNhd_correction_right isOpen_ball (convex_ball 0 R) hg (unitPoint_inv_mem hR t) + (fun v hv => hH _ (unitPoint_inv_mem hR t) v hv)) j + +theorem boundaryCoefficient_eq_taylor {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (k : ℕ) (s : Angle) : + boundaryCoefficient c g k s = taylorCoeff (fun u => correction c g u ((unitPoint s)⁻¹)) k := by + simp [boundaryCoefficient,boundaryCorrection_left_coeff hR hg hH] + +theorem boundaryCoefficient_zero {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) (s : Angle) : + boundaryCoefficient c g 0 s = 0 := by + rw [boundaryCoefficient_eq_taylor hR hg hH]; simp + +theorem faberBasis_boundary {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (k : ℕ) (s : Angle) : + (faberBasis c g k).eval (boundary c g s) = fourier (k:ℤ) s + boundaryCoefficient c g k s := by + rw [boundaryCoefficient_eq_taylor hR hg hH] + have he := faberBasis_exterior (by linarith : 0 < R) hg hc (unitPoint_inv_mem hR s) + (inv_ne_zero (unitPoint_ne_zero s)) (fun u hu => hH u hu _ (unitPoint_inv_mem hR s)) k + simpa only [inv_inv,unitPoint_pow,boundary] using he + +theorem boundaryCoefficient_no_nonnegative {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (k : ℕ) (j : ℤ) (hj : 0 ≤ j) : + fourierCoeff (boundaryCoefficient c g k) j = 0 := by + have hS := continuous_boundaryCorrection hR hg hH + have hcont : Continuous (fun p : Angle × Angle => fourier (k:ℤ) p.1 * boundaryCorrection c g p.1 p.2) := + ((fourier (k:ℤ)).continuous.comp continuous_fst).mul hS + change fourierCoeff (fun s => ∫ t, fourier (-(-(k:ℤ))) t • boundaryCorrection c g t s ∂angularMeasure) j = 0 + simp only [neg_neg,smul_eq_mul] + rw [fourierCoeff_integral_swap (fun t s => fourier (k:ℤ) t * boundaryCorrection c g t s) hcont] + have hr (t : Angle) : fourierCoeff (boundaryCorrection c g t) j = 0 := by + rw [boundaryCorrection_right_coeff hR hg hH] + by_cases hj0 : j = 0 + · subst j; simp + · rw [ite_eq_right (by omega)] + have he (t : Angle) : fourierCoeff (fun s => fourier (k:ℤ) t * boundaryCorrection c g t s) j = 0 := by + simp only [fourierCoeff,smul_eq_mul] + rw [show (fun s => fourier (-j) s * (fourier (k:ℤ) t * boundaryCorrection c g t s)) = + (fun s => fourier (k:ℤ) t * (fourier (-j) s * boundaryCorrection c g t s)) by funext s; ring, + integral_const_mul] + change fourier (k:ℤ) t * fourierCoeff (boundaryCorrection c g t) j = 0 + rw [hr,mul_zero] + simp only [he,integral_zero] + +theorem continuous_boundaryKernel {c : ℂ} {g : ℂ → ℂ} + (hS : Continuous (boundaryCorrection c g).uncurry) : Continuous (boundaryKernel c g).uncurry := by + exact continuous_const.add (continuous_const.mul (Complex.continuous_re.comp hS)) + +theorem boundaryCorrection_marginals {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) : + (∀ s, ∫ t, boundaryCorrection c g t s ∂angularMeasure = 0) ∧ + (∀ t, ∫ s, boundaryCorrection c g t s ∂angularMeasure = 0) := by + constructor + · intro s + have he := boundaryCorrection_left_coeff hR hg hH s 0 + simpa [fourierCoeff] using he + · intro t + have he := boundaryCorrection_right_coeff hR hg hH t 0 + simpa [fourierCoeff] using he + +theorem boundaryKernel_marginals {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) : + (∀ s, ∫ t, boundaryKernel c g t s ∂angularMeasure = 1) ∧ + (∀ t, ∫ s, boundaryKernel c g t s ∂angularMeasure = 1) := by + have hS := continuous_boundaryCorrection hR hg hH + have hm := boundaryCorrection_marginals hR hg hH + have hint (f : Angle → ℂ) (hf : Continuous f) (hz : ∫ t, f t ∂angularMeasure = 0) : + (∫ t, (1 + 2*(f t).re) ∂angularMeasure) = 1 := by + have hfi := integrable_of_continuous_compact angularMeasure hf + change (∫ t, (1 + 2*RCLike.re (f t)) ∂angularMeasure) = 1 + rw [integral_add (integrable_const 1) (hfi.re.const_mul 2),integral_const_mul, + integral_re hfi,hz] + simp + constructor + · intro s + change (∫ t, 1+2*(boundaryCorrection c g t s).re ∂angularMeasure) = 1 + exact hint (fun t => boundaryCorrection c g t s) (continuous_slice_left _ hS s) (hm.1 s) + · intro t + change (∫ s, 1+2*(boundaryCorrection c g t s).re ∂angularMeasure) = 1 + exact hint (boundaryCorrection c g t) (continuous_slice_right _ hS t) (hm.2 t) + +theorem boundaryKernel_complex (c : ℂ) (g : ℂ → ℂ) (t s : Angle) : + (boundaryKernel c g t s : ℂ) = 1+boundaryCorrection c g t s+conj (boundaryCorrection c g t s) := by + apply Complex.ext <;> simp [boundaryKernel] ; ring + +theorem boundaryKernel_character {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (k : ℕ) (hk : k ≠ 0) (s : Angle) : + (∫ t, (boundaryKernel c g t s : ℂ) * fourier (k:ℤ) t ∂angularMeasure) = + boundaryCoefficient c g k s := by + have hS : Continuous (fun t => boundaryCorrection c g t s) := + continuous_slice_left _ (continuous_boundaryCorrection hR hg hH) s + have hf := (fourier (T := (1:ℝ)) (k:ℤ)).continuous + have h1 : (∫ t : Angle, fourier (k:ℤ) t ∂angularMeasure) = 0 := by + have he := integral_character_smul 0 (k:ℤ) (1:ℂ) + simpa [hk] using he + have h2 : (∫ t, boundaryCorrection c g t s * fourier (k:ℤ) t ∂angularMeasure) = + boundaryCoefficient c g k s := by + simp only [boundaryCoefficient,fourierCoeff,neg_neg,smul_eq_mul] + congr 1; funext t; ring + have h3 : (∫ t, conj (boundaryCorrection c g t s) * fourier (k:ℤ) t ∂angularMeasure) = 0 := by + have he := fourierCoeff_conjugate (fun t => boundaryCorrection c g t s) (-(k:ℤ)) + rw [neg_neg,boundaryCorrection_left_coeff hR hg hH,ite_eq_right (by omega)] at he + simpa only [fourierCoeff,neg_neg,smul_eq_mul,mul_comm,map_zero] using he + have hi1 : Integrable (fun t : Angle => fourier (k:ℤ) t) angularMeasure := integrable_of_continuous_compact _ hf + have hi2 : Integrable (fun t : Angle => boundaryCorrection c g t s * fourier (k:ℤ) t) angularMeasure := + integrable_of_continuous_compact _ (hS.mul hf) + have hi3 : Integrable (fun t : Angle => conj (boundaryCorrection c g t s) * fourier (k:ℤ) t) angularMeasure := by + simpa only [starRingEnd_apply] using! integrable_of_continuous_compact angularMeasure (hS.star.mul hf) + have ha := integral_add (hi1.add hi2) hi3 + have hb := integral_add hi1 hi2 + simp only [Pi.add_apply] at ha hb + simp_rw [boundaryKernel_complex,add_mul,one_mul] + rw [ha,hb,h1,h2,h3,zero_add,add_zero] + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/BoundaryParametrization.lean b/lean/OAI/Analysis/DirectCrouzeix/BoundaryParametrization.lean new file mode 100644 index 0000000000000000000000000000000000000000..adffe7dabcaec921a5936189b8aff9eea53b16ee --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/BoundaryParametrization.lean @@ -0,0 +1,155 @@ +import OAI.Analysis.DirectCrouzeix.ExponentialLevels + +namespace OAI + +universe u_137 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +variable {ι : Type u_137} [Fintype ι] + +theorem expLevel_boundary_parametrization (v : ι → ℂ) (b : ι → ℝ) {p a : ℂ} + (hp : expLevel v b p = 1) (ha : expLevel v b a < 1) : + ∃ H : ℂ → ℂ, AnalyticAt ℂ H 0 ∧ H 0 = p ∧ deriv H 0 ≠ 0 ∧ + (∀ᶠ z in 𝓝 0, (expLevel v b (H z) < 1 ↔ 0 < z.im) ∧ + (1 < expLevel v b (H z) ↔ z.im < 0)) := by + let q := expGradient v b p + have hq : q ≠ 0 := expGradient_ne_zero v b hp ha + let ξ := -Complex.I*q + have hξ : ξ ≠ 0 := mul_ne_zero (neg_ne_zero.mpr Complex.I_ne_zero) hq + have hIξ : Complex.I*ξ = q := by simp [ξ,← mul_assoc] + have hqξ : inner ℝ q ξ = 0 := by + simp [real_inner_eq_re_inner ℂ,RCLike.inner_apply,ξ,Complex.mul_re,Complex.mul_im] + ring + let α := fun i => inner ℝ (v i) ξ + let β := fun i => inner ℝ (v i) q + let γ := fun i => inner ℝ (v i) p+b i + have hα : ∑ i, Real.exp (γ i)*α i = 0 := by + rw [← hqξ] + dsimp only [q,expGradient] + rw [sum_inner] + simp only [real_inner_smul_left,α,γ] + have hβ : ∑ i, Real.exp (γ i)*β i = ‖q‖^2 := by + rw [← real_inner_self_eq_norm_sq,show q = expGradient v b p from rfl] + conv_rhs => rw [expGradient] + rw [sum_inner] + simp only [real_inner_smul_left,β,γ,q,expGradient] + have hF0 : expComplex α β γ 0 = 1 := by rw [expComplex_zero]; exact_mod_cast hp + have hFd : HasFDerivAt (expComplex α β γ) + (((‖q‖^2:ℝ):ℂ) • ContinuousLinearMap.snd ℂ ℂ ℂ) 0 := by + convert! expComplex_hasFDerivAt_zero α β γ using 1 + rw [hα,hβ] + simp only [Complex.ofReal_zero] + apply ContinuousLinearMap.ext + intro z + change _ = (0:ℂ)*z.1 + (‖q‖^2:ℝ)*z.2 + simp + obtain ⟨g,hg,hg0,hgd,hge,hgc⟩ := normalized_implicit_graph (expComplex_analytic α β γ 0) hF0 + (sq_pos_of_pos (norm_pos_iff.mpr hq)) hFd (fun z => expComplex_conj α β γ z) + let H := fun z : ℂ => p+ξ*(-z+Complex.I*g (-z)) + have hH0 : H 0 = p := by simp [H,hg0] + have hHa : AnalyticAt ℂ H 0 := by + exact analyticAt_const.add (analyticAt_const.mul (analyticAt_id.neg.add + (analyticAt_const.mul ((show AnalyticAt ℂ g (-(0:ℂ)) from by simpa using hg).comp (f := fun z : ℂ => -z) analyticAt_id.neg)))) + have hHd : HasDerivAt H (-ξ) 0 := by + have hdg : HasDerivAt (fun z : ℂ => g (-z)) 0 0 := by + convert! (show HasDerivAt g (deriv g 0) (-(0:ℂ)) from by simpa using hg.differentiableAt.hasDerivAt).comp 0 (hasDerivAt_id (0:ℂ)).neg using 1 + simp [hgd] + convert! (((hasDerivAt_id (0:ℂ)).neg.add (hdg.const_mul Complex.I)).const_mul ξ).const_add p using 1 ; simp + have hreal : ∀ᶠ x : ℝ in 𝓝 0, expLevel v b (H (x:ℂ)) = 1 := by + have ht : Tendsto (fun x : ℝ => -(x:ℂ)) (𝓝 0) (𝓝 0) := by convert! Complex.continuous_ofReal.neg.tendsto (0:ℝ) using 1 ; simp + filter_upwards [ht.eventually hge,ht.eventually hgc] with x hx hxc + have hi : (g (-(x:ℂ))).im = 0 := by + simp only [map_neg,Complex.conj_ofReal] at hxc + have hh := congrArg Complex.im hxc + simp only [Complex.conj_im] at hh + linarith + have hgR : g (-(x:ℂ)) = ((g (-(x:ℂ))).re:ℂ) := by + apply Complex.ext <;> simp [hi] + have he : (expLevel v b (H (x:ℂ)):ℂ) = expComplex α β γ (-(x:ℂ),g (-(x:ℂ))) := by + rw [hgR] + rw [show -(x:ℂ) = ((-x:ℝ):ℂ) by simp,expComplex_real] + congr 1 + apply Finset.sum_congr rfl + intro i hi + congr 1 + have hHz : H (x:ℂ) = p+(-x) • ξ+(g (-(x:ℂ))).re • q := by + dsimp only [H] + rw [hgR] + simp only [Complex.real_smul,Complex.ofReal_neg,Complex.ofReal_re] + rw [← hIξ] + ring + rw [hHz] + simp only [inner_add_right,real_inner_smul_right,α,β,γ,Complex.ofReal_neg] + ring + rw [hx] at he + exact_mod_cast he + let f := fun z => expLevel v b (H z) + have hf : ContDiffAt ℝ 1 f 0 := + ((expLevel_contDiff v b).of_le (by simp)).contDiffAt.comp 0 (hHa.contDiffAt.restrict_scalars ℝ) + have hdf : fderiv ℝ f 0 Complex.I = -‖q‖^2 := by + have hdφ : HasFDerivAt (expLevel v b) (innerSL ℝ q) (H 0) := by rw [hH0]; exact expLevel_hasFDerivAt v b p + have hdcomp := hdφ.comp 0 (hHd.hasFDerivAt.restrictScalars ℝ) + change fderiv ℝ (expLevel v b ∘ H) 0 Complex.I = _ + rw [hdcomp.fderiv] + change inner ℝ q (Complex.I*(-ξ)) = _ + have he : Complex.I*(-ξ) = -q := by rw [mul_neg,hIξ] + rw [he,inner_neg_right,real_inner_self_eq_norm_sq] + obtain ⟨r,hr,hside⟩ := negative_vertical_level_side hf (by rw [hdf]; exact neg_neg_of_pos (sq_pos_of_pos (norm_pos_iff.mpr hq))) hreal + refine ⟨H,hHa,hH0,?_,?_⟩ + · rw [hHd.deriv]; exact neg_ne_zero.mpr hξ + · exact Filter.mem_of_superset (ball_mem_nhds (0:ℂ) hr) hside + +end DirectCrouzeix.Geometry + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/CircleFourier.lean b/lean/OAI/Analysis/DirectCrouzeix/CircleFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..75b14c55d9f904813d87b28f699deecbc1ef1b15 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/CircleFourier.lean @@ -0,0 +1,181 @@ +import OAI.Analysis.DirectCrouzeix.Sharpness + +namespace OAI + +universe u_47 u_48 u_49 u_50 u_51 u_52 u_53 u_54 u_55 u_56 u_57 u_58 u_59 u_60 u_61 u_62 u_63 u_64 + u_65 u_66 u_67 u_68 u_69 u_70 u_71 u_72 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +open MeasureTheory + +theorem continuous_integrable_compact {α : Type u_47} {E : Type u_48} [TopologicalSpace α] + [MeasurableSpace α] [OpensMeasurableSpace α] [CompactSpace α] + [NormedAddCommGroup E] (μ : Measure α) [IsFiniteMeasure μ] + {f : α → E} (hf : Continuous f) : Integrable f μ := + hf.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f) + +theorem continuous_integral_compact {α : Type u_49} {β : Type u_50} {E : Type u_51} + [TopologicalSpace α] [FirstCountableTopology α] [LocallyCompactSpace α] + [TopologicalSpace β] [MeasurableSpace β] [OpensMeasurableSpace β] + [CompactSpace β] [SecondCountableTopology β] + [NormedAddCommGroup E] [NormedSpace ℝ E] + (μ : Measure β) [IsFiniteMeasure μ] {f : α → β → E} + (hf : Continuous f.uncurry) : Continuous (fun x => ∫ y, f x y ∂μ) := by + simpa using continuous_parametric_integral_of_continuous (μ := μ) hf isCompact_univ + +theorem markov_kernel_contraction {α : Type u_52} {β : Type u_53} {E : Type u_54} + [MetricSpace α] [MeasurableSpace α] [BorelSpace α] [CompactSpace α] + [SecondCountableTopology α] + [MetricSpace β] [MeasurableSpace β] [BorelSpace β] [CompactSpace β] + [SecondCountableTopology β] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + (μ : Measure α) (ν : Measure β) [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (K : α → β → ℝ) (u : α → E) + (hK : Continuous K.uncurry) (hu : Continuous u) + (hpos : ∀ x y, 0 ≤ K x y) + (hcol : ∀ y, ∫ x, K x y ∂μ = 1) + (hrow : ∀ x, ∫ y, K x y ∂ν = 1) : + (∫ y, ‖∫ x, K x y • u x ∂μ‖ ^ 2 ∂ν) ≤ ∫ x, ‖u x‖ ^ 2 ∂μ := by + have hKcol (y : β) : Continuous (fun x => K x y) := + hK.comp (continuous_id.prodMk continuous_const) + have hT : Continuous (fun y => ∫ x, K x y • u x ∂μ) := by + apply continuous_integral_compact + exact (hK.comp continuous_swap).smul (hu.comp continuous_snd) + have hs : Integrable (fun p : α × β => K p.1 p.2 * ‖u p.1‖ ^ 2) (μ.prod ν) := + continuous_integrable_compact _ (hK.mul ((hu.comp continuous_fst).norm.pow 2)) + calc + _ ≤ ∫ y, ∫ x, K x y * ‖u x‖ ^ 2 ∂μ ∂ν := by + apply integral_mono (continuous_integrable_compact _ (hT.norm.pow 2)) + hs.integral_prod_right + intro y + exact weighted_integral_norm_sq_le μ (fun x => K x y) u (fun x => hpos x y) + (continuous_integrable_compact _ (hKcol y)) + (continuous_integrable_compact _ ((hKcol y).smul hu)) + (continuous_integrable_compact _ ((hKcol y).mul (hu.norm.pow 2))) (hcol y) + _ = ∫ x, ∫ y, K x y * ‖u x‖ ^ 2 ∂ν ∂μ := (integral_integral_swap hs).symm + _ = _ := by simp_rw [integral_mul_const, hrow, one_mul] + +abbrev BoundaryCircle := AddCircle (1 : ℝ) + +abbrev circleMeasure : Measure BoundaryCircle := AddCircle.haarAddCircle + +theorem scalar_circle_parseval (f : BoundaryCircle → ℂ) (hf : Continuous f) : + HasSum (fun k : ℤ => ‖fourierCoeff f k‖ ^ 2) + (∫ t, ‖f t‖ ^ 2 ∂circleMeasure) := by + let F : C(BoundaryCircle, ℂ) := ⟨f, hf⟩ + have h := hasSum_sq_fourierCoeff (ContinuousMap.toLp 2 circleMeasure ℂ F) + simp_rw [fourierCoeff_toLp] at h + have hi : (∫ t, ‖(ContinuousMap.toLp 2 circleMeasure ℂ F) t‖ ^ 2 ∂circleMeasure) = + ∫ t, ‖f t‖ ^ 2 ∂circleMeasure := by + apply integral_congr_ae + filter_upwards [ContinuousMap.coeFn_toLp (p := (2 : ENNReal)) (𝕜 := ℂ) circleMeasure F] + with t ht + rw [ht] + rfl + rwa [hi] at h + +theorem fourierCoeff_euclidean_apply {ι : Type u_55} [Fintype ι] + (f : BoundaryCircle → EuclideanSpace ℂ ι) (hf : Continuous f) + (k : ℤ) (i : ι) : (fourierCoeff f k) i = fourierCoeff (fun t => f t i) k := by + have hi : Integrable (fun t => fourier (-k) t • f t) circleMeasure := + (continuous_integrable_compact _ hf).fourier_smul _ + exact ((EuclideanSpace.proj i).integral_comp_comm hi).symm + +theorem euclidean_circle_parseval {ι : Type u_56} [Fintype ι] + (f : BoundaryCircle → EuclideanSpace ℂ ι) (hf : Continuous f) : + HasSum (fun k : ℤ => ‖fourierCoeff f k‖ ^ 2) + (∫ t, ‖f t‖ ^ 2 ∂circleMeasure) := by + have h (i : ι) := scalar_circle_parseval (fun t => f t i) + ((PiLp.continuous_apply 2 (fun _ : ι => ℂ) i).comp hf) + have hs := hasSum_sum (s := Finset.univ) (fun i _ => h i) + simp_rw [← fourierCoeff_euclidean_apply f hf] at hs + simp_rw [EuclideanSpace.norm_sq_eq] + have hi (i : ι) : Integrable (fun t => ‖f t i‖ ^ 2) circleMeasure := + continuous_integrable_compact _ + (((PiLp.continuous_apply 2 (fun _ : ι => ℂ) i).comp hf).norm.pow 2) + rw [integral_finsetSum Finset.univ (fun i _ => hi i)] + exact hs + +def hsCLM {ι : Type u_57} {κ : Type u_58} [Fintype ι] [Fintype κ] : + Matrix ι κ ℂ →L[ℂ] EuclideanSpace ℂ (ι × κ) := + LinearMap.toContinuousLinearMap + { toFun := hsVector + map_add' := by intros; ext i; rfl + map_smul' := by intros; ext i; rfl } + +@[simp] theorem hsCLM_apply {ι : Type u_59} {κ : Type u_60} [Fintype ι] [Fintype κ] + (A : Matrix ι κ ℂ) : hsCLM A = hsVector A := rfl + +theorem continuous_hsSq {ι : Type u_61} {κ : Type u_62} [Fintype ι] [Fintype κ] : + Continuous (hsSq : Matrix ι κ ℂ → ℝ) := by + change Continuous (fun M : Matrix ι κ ℂ => hsSq M) + simp_rw [hsSq_eq_norm_hsVector_sq] + exact hsCLM.continuous.norm.pow 2 + +theorem fourierCoeff_clm {E : Type u_63} {F : Type u_64} [NormedAddCommGroup E] [NormedSpace ℂ E] + [NormedAddCommGroup F] [NormedSpace ℂ F] [CompleteSpace E] [CompleteSpace F] + (L : E →L[ℂ] F) (f : BoundaryCircle → E) (hf : Continuous f) (k : ℤ) : + fourierCoeff (fun t => L (f t)) k = L (fourierCoeff f k) := by + unfold fourierCoeff + simp_rw [← map_smul] + exact L.integral_comp_comm ((continuous_integrable_compact _ hf).fourier_smul _) + +theorem matrix_circle_parseval {ι : Type u_65} {κ : Type u_66} [Fintype ι] [Fintype κ] + [DecidableEq ι] [DecidableEq κ] + (f : BoundaryCircle → Matrix ι κ ℂ) (hf : Continuous f) : + HasSum (fun k : ℤ => hsSq (fourierCoeff f k)) + (∫ t, hsSq (f t) ∂circleMeasure) := by + have hp := euclidean_circle_parseval (fun t => hsCLM (f t)) (hsCLM.continuous.comp hf) + simp_rw [fourierCoeff_clm hsCLM f hf, hsCLM_apply, ← hsSq_eq_norm_hsVector_sq] at hp + exact hp + +def compressionCLM {n m : ℕ} (X Y : Matrix (Fin n) (Fin m) ℂ) : + Matrix (Fin n) (Fin n) ℂ →L[ℂ] Matrix (Fin m) (Fin m) ℂ := + LinearMap.toContinuousLinearMap + { toFun := fun R => Yᴴ * R * X + map_add' := by intros; simp [Matrix.mul_add,Matrix.add_mul] + map_smul' := by intros; simp [Matrix.mul_smul,Matrix.smul_mul] } + +@[simp] theorem compressionCLM_apply {n m : ℕ} (X Y : Matrix (Fin n) (Fin m) ℂ) + (R : Matrix (Fin n) (Fin n) ℂ) : compressionCLM X Y R = Yᴴ * R * X := rfl + +theorem fourierCoeff_compression {n m : ℕ} (X Y : Matrix (Fin n) (Fin m) ℂ) + (R : BoundaryCircle → Matrix (Fin n) (Fin n) ℂ) (hR : Continuous R) (k : ℤ) : + fourierCoeff (fun t => Yᴴ * R t * X) k = Yᴴ * fourierCoeff R k * X := + fourierCoeff_clm (compressionCLM X Y) R hR k + +def conjugateTransposeCLM {ι : Type u_67} {κ : Type u_68} [Fintype ι] [Fintype κ] : + Matrix ι κ ℂ →L[ℝ] Matrix κ ι ℂ := + LinearMap.toContinuousLinearMap + { toFun := Matrix.conjTranspose + map_add' := by intros; simp + map_smul' := by intros; simp } + +@[simp] theorem conjugateTransposeCLM_apply {ι : Type u_69} {κ : Type u_70} [Fintype ι] [Fintype κ] + (A : Matrix ι κ ℂ) : conjugateTransposeCLM A = Aᴴ := rfl + +theorem fourierCoeff_star_matrix {ι : Type u_71} {κ : Type u_72} [Fintype ι] [Fintype κ] + [DecidableEq ι] [DecidableEq κ] + (f : BoundaryCircle → Matrix ι κ ℂ) (hf : Continuous f) (k : ℤ) : + fourierCoeff (fun t => (f t)ᴴ) k = (fourierCoeff f (-k))ᴴ := by + unfold fourierCoeff + have hh := conjugateTransposeCLM.integral_comp_comm + ((continuous_integrable_compact _ hf).fourier_smul (-(-k))) + simp only [conjugateTransposeCLM_apply] at hh + rw [← hh] + apply integral_congr_ae + filter_upwards with t + simp only [neg_neg,Matrix.conjTranspose_smul,starRingEnd_apply,fourier_neg] + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/CompactIntegrals.lean b/lean/OAI/Analysis/DirectCrouzeix/CompactIntegrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..13097dc06f042d188302419b7a6746e103a9532a --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/CompactIntegrals.lean @@ -0,0 +1,213 @@ +import OAI.Analysis.DirectCrouzeix.DomainCore + +namespace OAI + +universe u_87 u_88 u_89 u_90 u_91 u_92 u_93 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +theorem integrable_of_continuous_compact {α : Type u_87} {E : Type u_88} [TopologicalSpace α] + [MeasurableSpace α] [OpensMeasurableSpace α] [CompactSpace α] + [NormedAddCommGroup E] (μ : Measure α) [IsFiniteMeasure μ] + {f : α → E} (hf : Continuous f) : Integrable f μ := + hf.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f) + +theorem continuousOn_integral_compact {α : Type u_89} {β : Type u_90} {E : Type u_91} + [MetricSpace α] [ProperSpace α] + [TopologicalSpace β] [MeasurableSpace β] [OpensMeasurableSpace β] + [CompactSpace β] [SecondCountableTopology β] + [NormedAddCommGroup E] [NormedSpace ℝ E] + (μ : Measure β) [IsFiniteMeasure μ] {s : Set α} (hs : IsOpen s) + {f : α → β → E} (hf : ContinuousOn f.uncurry (s ×ˢ univ)) : + ContinuousOn (fun x => ∫ t, f x t ∂μ) s := by + intro x hx + obtain ⟨ε,hε,hsub⟩ := nhds_basis_closedBall.mem_iff.mp (hs.mem_nhds hx) + have hc : Continuous (fun p : closedBall x ε × β => f p.1 p.2) := by + apply hf.comp_continuous + ((continuous_subtype_val.comp continuous_fst).prodMk continuous_snd) + intro p + exact ⟨hsub p.1.property,mem_univ _⟩ + have hi : Continuous (fun y : closedBall x ε => ∫ t, f y t ∂μ) := by + simpa using continuous_parametric_integral_of_continuous (μ := μ) hc isCompact_univ + have hi' : ContinuousOn (fun y => ∫ t, f y t ∂μ) (closedBall x ε) := + continuousOn_iff_continuous_domRestrict.mpr hi + exact (hi'.continuousAt (closedBall_mem_nhds x hε)).continuousWithinAt + +theorem hasDerivAt_integral_compact {α : Type u_92} {E : Type u_93} + [TopologicalSpace α] [MeasurableSpace α] [OpensMeasurableSpace α] + [CompactSpace α] [SecondCountableTopology α] + [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + (μ : Measure α) [IsFiniteMeasure μ] {s : Set ℂ} (hs : IsOpen s) + {f f' : ℂ → α → E} + (hf : ContinuousOn f.uncurry (s ×ˢ univ)) + (hf' : ContinuousOn f'.uncurry (s ×ˢ univ)) + (hd : ∀ z ∈ s, ∀ t, HasDerivAt (fun w => f w t) (f' z t) z) + {z : ℂ} (hz : z ∈ s) : + HasDerivAt (fun w => ∫ t, f w t ∂μ) (∫ t, f' z t ∂μ) z := by + obtain ⟨ε,hε,hsub⟩ := nhds_basis_closedBall.mem_iff.mp (hs.mem_nhds hz) + have hcf (w : ℂ) (hw : w ∈ s) : Continuous (f w) := by + exact hf.comp_continuous (continuous_const.prodMk continuous_id) (fun t => ⟨hw,mem_univ _⟩) + have hcf' (w : ℂ) (hw : w ∈ s) : Continuous (f' w) := by + exact hf'.comp_continuous (continuous_const.prodMk continuous_id) (fun t => ⟨hw,mem_univ _⟩) + obtain ⟨B,hB⟩ := ((isCompact_closedBall z ε).prod isCompact_univ).exists_bound_of_continuousOn + (hf'.mono (prod_mono hsub Subset.rfl)) + apply (hasDerivAt_integral_of_dominated_loc_of_deriv_le + (s := closedBall z ε) (bound := fun _ => B) (closedBall_mem_nhds z hε) + ?_ (integrable_of_continuous_compact μ (hcf z hz)) + (hcf' z hz).aestronglyMeasurable ?_ (integrable_const B) ?_).2 + · filter_upwards [hs.mem_nhds hz] with w hw + exact (hcf w hw).aestronglyMeasurable + · exact ae_of_all μ (fun t w hw => hB (w,t) ⟨hw,mem_univ _⟩) + · exact ae_of_all μ (fun t w hw => hd w (hsub hw) t) + +abbrev Parameter := Set.Icc (0 : ℝ) 1 + +def chord (u v : ℂ) (t : ℝ) : ℂ := (1-t) • u + t • v + +theorem chord_mem {s : Set ℂ} (hs : Convex ℝ s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) + {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : chord u v t ∈ s := + hs hu hv (sub_nonneg.mpr ht.2) ht.1 (sub_add_cancel _ _) + +theorem continuous_chord : Continuous (fun p : (ℂ × ℂ) × ℝ => chord p.1.1 p.1.2 p.2) := by + unfold chord + fun_prop + +def chordIntegral (f : ℂ → ℂ) (w : Parameter → ℂ) (u v : ℂ) : ℂ := + ∫ t : Parameter, w t * f (chord u v t) + +theorem continuousOn_chordIntegral {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : ContinuousOn f s) {w : Parameter → ℂ} (hw : Continuous w) : + ContinuousOn (fun p : ℂ × ℂ => chordIntegral f w p.1 p.2) (s ×ˢ s) := by + apply continuousOn_integral_compact volume (hs.prod hs) + apply (hw.comp continuous_snd).continuousOn.mul + apply hf.comp + · exact (continuous_chord.comp + (continuous_fst.prodMk (continuous_subtype_val.comp continuous_snd))).continuousOn + · intro p hp + exact chord_mem hconv hp.1.1 hp.1.2 p.2.property + +theorem hasDerivAt_chord_left (u v : ℂ) (t : ℝ) : + HasDerivAt (fun z => chord z v t) ((1-t : ℝ) : ℂ) u := by + simpa [chord] using ((hasDerivAt_id u).const_smul (1-t : ℝ)).add_const (t • v) + +theorem hasDerivAt_chord_right (u v : ℂ) (t : ℝ) : + HasDerivAt (fun z => chord u z t) (t : ℂ) v := by + simpa [chord] using ((hasDerivAt_id v).const_smul t).const_add ((1-t) • u) + +theorem hasDerivAt_chordIntegral_left {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : AnalyticOnNhd ℂ f s) {w : Parameter → ℂ} (hw : Continuous w) + {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + HasDerivAt (fun z => chordIntegral f w z v) + (chordIntegral (deriv f) (fun t => w t * ((1-(t : ℝ) : ℝ) : ℂ)) u v) u := by + have hc : ContinuousOn (fun p : ℂ × Parameter => chord p.1 v p.2) (s ×ˢ univ) := by + unfold chord + fun_prop + have hm : MapsTo (fun p : ℂ × Parameter => chord p.1 v p.2) (s ×ˢ univ) s := + fun p hp => chord_mem hconv hp.1 hv p.2.property + apply hasDerivAt_integral_compact volume hs + ((hw.comp continuous_snd).continuousOn.mul (hf.continuousOn.comp hc hm)) + (((hw.comp continuous_snd).continuousOn.mul + (Complex.continuous_ofReal.comp (continuous_const.sub (continuous_subtype_val.comp continuous_snd))).continuousOn).mul + (hf.deriv.continuousOn.comp hc hm)) ?_ hu + intro z hz t + have hd := ((hf _ (chord_mem hconv hz hv t.property)).differentiableAt.hasDerivAt.comp z + (hasDerivAt_chord_left z v t)).const_mul (w t) + simpa only [Function.comp_def, mul_assoc, mul_comm, mul_left_comm] using hd + +theorem hasDerivAt_chordIntegral_right {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : AnalyticOnNhd ℂ f s) {w : Parameter → ℂ} (hw : Continuous w) + {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + HasDerivAt (fun z => chordIntegral f w u z) + (chordIntegral (deriv f) (fun t => w t * ((t : ℝ) : ℂ)) u v) v := by + have hc : ContinuousOn (fun p : ℂ × Parameter => chord u p.1 p.2) (s ×ˢ univ) := by + unfold chord + fun_prop + have hm : MapsTo (fun p : ℂ × Parameter => chord u p.1 p.2) (s ×ˢ univ) s := + fun p hp => chord_mem hconv hu hp.1 p.2.property + apply hasDerivAt_integral_compact volume hs + ((hw.comp continuous_snd).continuousOn.mul (hf.continuousOn.comp hc hm)) + (((hw.comp continuous_snd).continuousOn.mul + (Complex.continuous_ofReal.comp (continuous_subtype_val.comp continuous_snd)).continuousOn).mul + (hf.deriv.continuousOn.comp hc hm)) ?_ hv + intro z hz t + have hd := ((hf _ (chord_mem hconv hu hz t.property)).differentiableAt.hasDerivAt.comp z + (hasDerivAt_chord_right u z t)).const_mul (w t) + simpa only [Function.comp_def, mul_assoc, mul_comm, mul_left_comm] using hd + +theorem chordIntegral_one_eq_interval (f : ℂ → ℂ) (u v : ℂ) : + chordIntegral f (fun _ => 1) u v = ∫ t in (0:ℝ)..1, f (chord u v t) := by + simp only [chordIntegral, one_mul] + rw [show (∫ t : Parameter, f (chord u v t)) = ∫ t in Icc (0:ℝ) 1, f (chord u v t) from + integral_subtype measurableSet_Icc (fun t : ℝ => f (chord u v t)), + integral_Icc_eq_integral_Ioc, intervalIntegral.integral_of_le zero_le_one] + +theorem hasDerivAt_chord_time (u v : ℂ) (t : ℝ) : + HasDerivAt (chord u v) (v-u) t := by + have hi : HasDerivAt (fun t : ℝ => (t : ℂ)) 1 t := by + simpa only [Complex.ofRealCLM_apply, Complex.ofReal_one] using! (Complex.ofRealCLM.hasDerivAt (x := t)) + have hd := ((hi.const_sub 1).mul_const u).add (hi.mul_const v) + change HasDerivAt (fun y => chord u v y) (v-u) t + simpa [chord, Complex.real_smul, sub_eq_add_neg, add_comm] using! hd + +theorem chordIntegral_deriv_mul {s : Set ℂ} (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : AnalyticOnNhd ℂ f s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + chordIntegral (deriv f) (fun _ => 1) u v * (v-u) = f v - f u := by + rw [chordIntegral_one_eq_interval, ← intervalIntegral.integral_mul_const] + have hc : ContinuousOn (fun t : ℝ => chord u v t) (Icc 0 1) := by unfold chord; fun_prop + have hm : MapsTo (fun t : ℝ => chord u v t) (Icc 0 1) s := fun t ht => chord_mem hconv hu hv ht + have hi : IntervalIntegrable (fun t : ℝ => deriv f (chord u v t) * (v-u)) volume 0 1 := by + apply ContinuousOn.intervalIntegrable + rw [uIcc_of_le zero_le_one] + exact (hf.deriv.continuousOn.comp hc hm).mul_const _ + have ht := intervalIntegral.integral_eq_sub_of_hasDerivAt (a := 0) (b := 1) (f := fun t => f (chord u v t)) + (f' := fun t => deriv f (chord u v t) * (v-u)) (fun t ht => by + have ht' : t ∈ Icc (0:ℝ) 1 := by simpa only [uIcc_of_le zero_le_one] using ht + simpa only [smul_eq_mul, mul_comm, Function.comp_def] using + ((hf _ (hm ht')).differentiableAt.hasDerivAt.scomp t (hasDerivAt_chord_time u v t))) hi + simpa [chord] using ht + +theorem chordIntegral_deriv_eq_dslope {s : Set ℂ} (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : AnalyticOnNhd ℂ f s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + chordIntegral (deriv f) (fun _ => 1) u v = dslope f v u := by + by_cases huv : u = v + · subst u + have he (t : ℝ) : chord v v t = v := by + rw [chord, ← add_smul, sub_add_cancel, one_smul] + simp [chordIntegral, he, dslope_same] + · rw [dslope_of_ne f huv, slope, smul_eq_mul] + simp only [vsub_eq_sub] + have hm := chordIntegral_deriv_mul hconv hf hu hv + field_simp + linear_combination -hm + +theorem analyticOnNhd_chordIntegral_left {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : AnalyticOnNhd ℂ f s) {w : Parameter → ℂ} (hw : Continuous w) + {v : ℂ} (hv : v ∈ s) : AnalyticOnNhd ℂ (fun u => chordIntegral f w u v) s := by + apply DifferentiableOn.analyticOnNhd _ hs + intro u hu + exact (hasDerivAt_chordIntegral_left hs hconv hf hw hu hv).differentiableAt.differentiableWithinAt + +theorem analyticOnNhd_chordIntegral_right {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {f : ℂ → ℂ} (hf : AnalyticOnNhd ℂ f s) {w : Parameter → ℂ} (hw : Continuous w) + {u : ℂ} (hu : u ∈ s) : AnalyticOnNhd ℂ (chordIntegral f w u) s := by + apply DifferentiableOn.analyticOnNhd _ hs + intro v hv + exact (hasDerivAt_chordIntegral_right hs hconv hf hw hu hv).differentiableAt.differentiableWithinAt + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/CompleteBound.lean b/lean/OAI/Analysis/DirectCrouzeix/CompleteBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..a504007c267984cb20e977b0e8c31c4198bad757 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/CompleteBound.lean @@ -0,0 +1,119 @@ +import OAI.Analysis.DirectCrouzeix.DomainBound + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set + +open scoped ComplexConjugate Matrix + +namespace DirectCrouzeix + +open Set Metric + +theorem convex_numericalRange {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) : + Convex ℝ (numericalRange A) := + Geometry.convex_quadratic_range (Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A).toLinearMap + +theorem complete_crouzeix : UniversalBound 2 := by + intro n m d hn hm A B + let M := rangeMaximum A B + have hM : 0 ≤ M := by + obtain ⟨z,hz,he⟩ := rangeMaximum_attained hn A B + rw [show M = ‖polynomialValue B z‖ from he.symm] + exact norm_nonneg _ + apply le_of_forall_pos_le_add + intro ε hε + let ρ := M+ε/2 + have hρ : 0 < ρ := by dsimp [ρ]; positivity + have hMρ : M < ρ := by dsimp [ρ]; linarith + let V := {z : ℂ | ‖polynomialValue B z‖ < ρ} + have hV : IsOpen V := isOpen_lt (continuous_polynomialValue B).norm continuous_const + have hWV : numericalRange A ⊆ V := by + intro z hz + exact lt_of_le_of_lt (norm_polynomialValue_le_rangeMaximum A B hz) hMρ + obtain ⟨δ,hδ,hδV⟩ := (isCompact_numericalRange A).exists_thickening_subset_open hV hWV + obtain ⟨D,v,b,hW,hc,hnear⟩ := Geometry.exists_exponential_outer (isCompact_numericalRange A) + (numericalRange_nonempty hn A) (convex_numericalRange A) hδ + have hbound : ∀ z, Geometry.expLevel v b z ≤ 1 → + ‖matrixPolynomialValue z (coefficientPolynomial B)‖ ≤ ρ := by + intro z hz + rw [matrixPolynomialValue_coefficientPolynomial] + apply le_of_lt + apply hδV + obtain ⟨w,hw,hzw⟩ := hnear z hz + exact mem_thickening_iff.mpr ⟨w,hw,by simpa only [dist_eq_norm] using hzw⟩ + have hh := expLevel_domain_bound_scaled hn hm A v b hc hW (coefficientPolynomial B) hρ hbound + rw [tensorPolynomial_coefficientPolynomial] at hh + calc + ‖tensorEvaluation A B‖ ≤ 2*ρ := hh + _ = 2*rangeMaximum A B+ε := by dsimp [ρ,M]; ring + +end DirectCrouzeix + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/ConformalCollar.lean b/lean/OAI/Analysis/DirectCrouzeix/ConformalCollar.lean new file mode 100644 index 0000000000000000000000000000000000000000..442942ce4e644e841f23a9fa68c3cfdc41c45964 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/ConformalCollar.lean @@ -0,0 +1,262 @@ +import OAI.Analysis.DirectCrouzeix.Continuation + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +open InnerProductSpace Real + +structure AnalyticBoundaryChart (U : Set ℂ) (p : ℂ) where + chart : OpenPartialHomeomorph ℂ ℂ + zero_mem : 0 ∈ chart.source + at_zero : chart 0 = p + analytic : AnalyticOnNhd ℂ chart chart.source + inverse_analytic : AnalyticOnNhd ℂ chart.symm chart.target + inverse_derivative : deriv chart.symm p ≠ 0 + side : ∀ z ∈ chart.source, chart z ∈ U ↔ 0 < z.im + +def HasAnalyticBoundary (U : Set ℂ) : Prop := + ∀ p ∈ frontier U, Nonempty (AnalyticBoundaryChart U p) + +theorem local_riemann_extension {U : Set ℂ} (hU : IsOpen U) + {a : ℂ} (ha : a ∈ U) {f : ℂ → ℂ} (hf : NormalizedEmbedding U a f) + (hs : f '' U = ball 0 1) {p : ℂ} (hp : p ∉ U) + (C : AnalyticBoundaryChart U p) : + ∃ r > 0, ∃ E : ℂ → ℂ, AnalyticOnNhd ℂ E (ball p (3*r)) ∧ + EqOn E f (ball p (3*r) ∩ U) ∧ + (∀ z ∈ ball p (3*r), ‖E z‖ < 1 ↔ z ∈ U) ∧ deriv E p ≠ 0 := by + have hphia : C.chart 0 ≠ a := by rw [C.at_zero]; intro he; exact hp (he ▸ ha) + have hcn := (C.analytic 0 C.zero_mem).continuousAt + have hav : ∀ᶠ z in 𝓝 (0 : ℂ), C.chart z ≠ a := + hcn.eventually (isClosed_singleton.isOpen_compl.mem_nhds hphia) + obtain ⟨R,hR,hRB⟩ : ∃ R > 0, closedBall (0 : ℂ) R ⊆ + C.chart.source ∩ {z | C.chart z ≠ a} := + nhds_basis_closedBall.mem_iff.mp + (inter_mem (C.chart.open_source.mem_nhds C.zero_mem) hav) + have hRU : ∀ z ∈ closedBall (0 : ℂ) R, 0 < z.im → C.chart z ∈ U := + fun z hz hi => (C.side z (hRB hz).1).mpr hi + have hfa : AnalyticOnNhd ℂ f U := hf.holomorphic.analyticOnNhd hU + have hfcomp : AnalyticOnNhd ℂ (f ∘ C.chart) (closedBall 0 R ∩ {z | 0 < z.im}) := by + intro z hz + exact (hfa _ (hRU z hz.1 hz.2)).comp (C.analytic z (hRB hz.1).1) + have hncomp : ∀ z ∈ closedBall 0 R ∩ {z : ℂ | 0 < z.im}, (f ∘ C.chart) z ≠ 0 := by + intro z hz he + exact (hRB hz.1).2 (hf.injective (hRU z hz.1 hz.2) ha (he.trans hf.normalized.symm)) + have hbcomp : ∀ z ∈ closedBall 0 R ∩ {z : ℂ | 0 < z.im}, ‖(f ∘ C.chart) z‖ < 1 := by + intro z hz + exact mem_ball_zero_iff.mp (hf.disk (hRU z hz.1 hz.2)) + have hlcomp : ∀ z ∈ closedBall 0 R, z.im = 0 → + Tendsto (fun w => ‖(f ∘ C.chart) w‖) (𝓝[{w : ℂ | 0 < w.im}] z) (𝓝 1) := by + intro z hz hi + have hzS := (hRB hz).1 + have hpU : C.chart z ∉ U := by + rw [C.side z hzS, hi] + exact lt_irrefl _ + apply (norm_tendsto_one_boundary hU hf hs hpU).comp + rw [tendsto_nhdsWithin_iff] + refine ⟨(C.analytic z hzS).continuousAt.tendsto.mono_left nhdsWithin_le_nhds,?_⟩ + filter_upwards [(nhdsWithin_le_nhds : 𝓝[{w : ℂ | 0 < w.im}] z ≤ 𝓝 z) + (C.chart.open_source.mem_nhds hzS), self_mem_nhdsWithin] with w hwS hwIm + exact (C.side w hwS).mpr hwIm + obtain ⟨G,hG,hGe,hGreal,hGd,hGside⟩ := + holomorphic_reflection_modulus hR hfcomp hncomp hbcomp hlcomp + have hpT : p ∈ C.chart.target := by + simpa only [C.at_zero] using C.chart.map_source C.zero_mem + have hInv : C.chart.symm p = 0 := + (congrArg C.chart.symm C.at_zero.symm).trans (C.chart.left_inv C.zero_mem) + have hNear : {z : ℂ | z ∈ C.chart.target ∧ C.chart.symm z ∈ ball 0 R} ∈ 𝓝 p := by + apply inter_mem (C.chart.open_target.mem_nhds hpT) + have := (C.inverse_analytic p hpT).continuousAt.preimage_mem_nhds + (ball_mem_nhds (C.chart.symm p) hR) + change C.chart.symm ⁻¹' ball (0 : ℂ) R ∈ 𝓝 p + simpa only [hInv] using this + obtain ⟨S,hS,hSB⟩ := Metric.mem_nhds_iff.mp hNear + let E : ℂ → ℂ := G ∘ C.chart.symm + have hE : AnalyticOnNhd ℂ E (ball p S) := by + intro z hz + exact (hG _ (hSB hz).2).comp (C.inverse_analytic z (hSB hz).1) + have hEs : ∀ z ∈ ball p S, ‖E z‖ < 1 ↔ z ∈ U := by + intro z hz + have ht := (hSB hz).1 + change ‖G (C.chart.symm z)‖ < 1 ↔ z ∈ U + rw [hGside _ (hSB hz).2, ← C.side _ (C.chart.map_target ht), C.chart.right_inv ht] + have hEe : EqOn E f (ball p S ∩ U) := by + intro z hz + have ht := (hSB hz.1).1 + have him : 0 < (C.chart.symm z).im := by + apply (C.side _ (C.chart.map_target ht)).mp + rw [C.chart.right_inv ht] + exact hz.2 + change G (C.chart.symm z) = f z + rw [hGe ⟨(hSB hz.1).2,him⟩] + simp only [Function.comp_apply, C.chart.right_inv ht] + have hEd : deriv E p ≠ 0 := by + have hGc := (hG 0 (mem_ball_self hR)).differentiableAt.hasDerivAt + have hiC := (C.inverse_analytic p hpT).differentiableAt.hasDerivAt + have hGc' : HasDerivAt G (deriv G 0) (C.chart.symm p) := by + simpa only [hInv] using hGc + have hh := hGc'.comp p hiC + change deriv (G ∘ C.chart.symm) p ≠ 0 + rw [hh.deriv] + exact mul_ne_zero hGd C.inverse_derivative + refine ⟨S/3,by positivity,E,?_,?_,?_,hEd⟩ + · simpa only [show 3*(S/3) = S by ring] using hE + · simpa only [show 3*(S/3) = S by ring] using hEe + · simpa only [show 3*(S/3) = S by ring] using hEs + +theorem inverse_riemann_collar {U : Set ℂ} (hU : IsOpen U) + (hUc : IsCompact (closure U)) (hUB : HasAnalyticBoundary U) + {a : ℂ} (ha : a ∈ U) {f : ℂ → ℂ} (hf : NormalizedEmbedding U a f) + (hs : f '' U = ball 0 1) : + ∃ R > 1, ∃ g : ℂ → ℂ, AnalyticOnNhd ℂ g (ball 0 R) ∧ InjOn g (ball 0 R) ∧ + g '' ball 0 1 = U ∧ g '' closedBall 0 1 = closure U ∧ g 0 = a ∧ + (∀ z ∈ ball 0 R, deriv g z ≠ 0) := by + have hloc : ∀ p ∈ closure U, ∃ r > 0, ∃ E : ℂ → ℂ, + AnalyticOnNhd ℂ E (ball p (3*r)) ∧ EqOn E f (ball p (3*r) ∩ U) ∧ + (∀ z ∈ ball p (3*r), ‖E z‖ < 1 ↔ z ∈ U) ∧ deriv E p ≠ 0 := by + intro p hp + by_cases hpin : p ∈ U + · obtain ⟨r,hr,hrU⟩ := Metric.isOpen_iff.mp hU p hpin + refine ⟨r/3,by positivity,f,?_,fun _ _ => rfl,?_,hf.derivative p hpin⟩ + · simpa only [show 3*(r/3)=r by ring] using + (hf.holomorphic.analyticOnNhd hU).mono hrU + · intro z hz + have hzU : z ∈ U := hrU (by simpa only [show 3*(r/3)=r by ring] using hz) + exact iff_of_true (mem_ball_zero_iff.mp (hf.disk hzU)) hzU + · have hpB : p ∈ frontier U := by + rw [frontier, hU.interior_eq] + exact ⟨hp,hpin⟩ + obtain ⟨C⟩ := hUB p hpB + exact local_riemann_extension hU ha hf hs hpin C + obtain ⟨V,F,hV,hUV,hF,hFf,hside,hd⟩ := patch_boundary_germs hU hloc + have hi : InjOn F U := by + intro x hx y hy he + apply hf.injective hx hy + simpa only [hFf hx,hFf hy] using he + have hm : F '' U = ball 0 1 := hFf.image_eq.trans hs + obtain ⟨W,hW,hUW,hWV,hiW,hFW,hmW⟩ := + univalent_neighborhood_of_disk_side hV hUV hUc hF hi hm hside hd + let Z := W ∩ interior {z | deriv F z ≠ 0} + have hZ : IsOpen Z := hW.inter isOpen_interior + have hUZ : closure U ⊆ Z := by + intro z hz + refine ⟨hUW hz,mem_interior_iff_mem_nhds.mpr ?_⟩ + exact ((hF z (hUV hz)).deriv.continuousAt).eventually + (isClosed_singleton.isOpen_compl.mem_nhds (hd z hz)) + have hZF : AnalyticOnNhd ℂ F Z := hFW.mono inter_subset_left + have hdZ : ∀ z ∈ Z, deriv F z ≠ 0 := fun z hz => interior_subset hz.2 + have hiZ : InjOn F Z := hiW.mono inter_subset_left + have hImage : IsOpen (F '' Z) := by + rw [isOpen_iff_mem_nhds] + rintro w ⟨z,hz,rfl⟩ + rw [← (hZF z hz).hasStrictDerivAt.map_nhds_eq (hdZ z hz)] + exact Filter.image_mem_map (hZ.mem_nhds hz) + have hSmall : closedBall (0 : ℂ) 1 ⊆ F '' Z := by + rw [← hmW] + exact image_mono hUZ + obtain ⟨δ,hδ,hδsub⟩ := (isCompact_closedBall (0 : ℂ) 1).exists_thickening_subset_open hImage hSmall + rw [thickening_closedBall hδ (by norm_num : (0 : ℝ) ≤ 1)] at hδsub + let R := δ + 1 + have hR : 1 < R := by dsimp [R]; linarith + have hball : ball (0 : ℂ) R ⊆ F '' Z := hδsub + let g := Function.invFunOn F Z + have hgr : ∀ z ∈ F '' Z, F (g z) = z := fun z hz => Function.invFunOn_eq hz + have hgl : ∀ z ∈ Z, g (F z) = z := fun z hz => hiZ.leftInvOn_invFunOn hz + have hgm : ∀ z ∈ F '' Z, g z ∈ Z := fun z hz => Function.invFunOn_mem hz + have hgder : ∀ z ∈ ball (0 : ℂ) R, + HasStrictDerivAt g (deriv F (g z))⁻¹ z := by + intro z hz + have hzI := hball hz + have hh := inverse_hasStrictDerivAt hZ hZF.differentiableOn hiZ (hgm z hzI) (hdZ _ (hgm z hzI)) + simpa only [g,hgr z hzI] using hh + have hg : AnalyticOnNhd ℂ g (ball (0 : ℂ) R) := by + apply DifferentiableOn.analyticOnNhd _ isOpen_ball + exact fun z hz => (hgder z hz).hasDerivAt.differentiableAt.differentiableWithinAt + refine ⟨R,hR,g,hg,?_,?_,?_,?_,?_⟩ + · intro x hx y hy he + calc + x = F (g x) := (hgr x (hball hx)).symm + _ = F (g y) := congrArg F he + _ = y := hgr y (hball hy) + · apply Subset.antisymm + · rintro w ⟨z,hz,rfl⟩ + have hzR := ball_subset_ball hR.le hz + have hzI := hball hzR + apply (hside _ (hWV (hgm z hzI).1)).mp + rw [hgr z hzI] + exact mem_ball_zero_iff.mp hz + · intro z hz + refine ⟨F z,?_,hgl z (hUZ (subset_closure hz))⟩ + rw [← hm] + exact mem_image_of_mem F hz + · apply Subset.antisymm + · rintro w ⟨z,hz,rfl⟩ + rw [← hmW] at hz + obtain ⟨y,hy,rfl⟩ := hz + simpa only [hgl y (hUZ hy)] using hy + · intro z hz + refine ⟨F z,?_,hgl z (hUZ hz)⟩ + rw [← hmW] + exact mem_image_of_mem F hz + · have haZ := hUZ (subset_closure ha) + have hFa : F a = 0 := (hFf ha).trans hf.normalized + simpa only [hFa] using hgl a haZ + · intro z hz + rw [(hgder z hz).hasDerivAt.deriv] + exact inv_ne_zero (hdZ _ (hgm z (hball hz))) + +theorem exists_riemann_collar {U : Set ℂ} (hU : IsOpen U) + (hUs : IsSimplyConnected U) (hproper : U ≠ univ) + (hUc : IsCompact (closure U)) (hUB : HasAnalyticBoundary U) + {a : ℂ} (ha : a ∈ U) : + ∃ R > 1, ∃ g : ℂ → ℂ, AnalyticOnNhd ℂ g (ball 0 R) ∧ InjOn g (ball 0 R) ∧ + g '' ball 0 1 = U ∧ g '' closedBall 0 1 = closure U ∧ g 0 = a ∧ + (∀ z ∈ ball 0 R, deriv g z ≠ 0) := by + obtain ⟨f,hf,hs⟩ := exists_riemannMap hU hUs hproper ha + exact inverse_riemann_collar hU hUc hUB ha hf hs + +end Conformal + +end DirectCrouzeix + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/Continuation.lean b/lean/OAI/Analysis/DirectCrouzeix/Continuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..019cae91ba3b8db44d84f442c034c77a33600ee0 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Continuation.lean @@ -0,0 +1,180 @@ +import OAI.Analysis.DirectCrouzeix.HolomorphicReflection + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +open InnerProductSpace Real + +theorem boundary_germs_compatible {U : Set ℂ} (hU : IsOpen U) + {p q z : ℂ} (hp : p ∈ closure U) (hq : q ∈ closure U) + {r s : ℝ} (hr : 0 < r) (hs : 0 < s) + (hzp : z ∈ ball p r) (hzq : z ∈ ball q s) + {E G f : ℂ → ℂ} + (hE : AnalyticOnNhd ℂ E (ball p (3*r))) + (hG : AnalyticOnNhd ℂ G (ball q (3*s))) + (he : EqOn E f (ball p (3*r) ∩ U)) + (hg : EqOn G f (ball q (3*s) ∩ U)) : E z = G z := by + let V := ball p (3*r) ∩ ball q (3*s) + have hVo : IsOpen V := isOpen_ball.inter isOpen_ball + have hmeet : (V ∩ closure U).Nonempty := by + have hd : dist p q < r + s := by + have := dist_triangle p z q + rw [dist_comm p z] at this + have hpz := mem_ball.mp hzp + have hqz := mem_ball.mp hzq + linarith + rcases le_total r s with hrs | hsr + · refine ⟨p, ⟨mem_ball_self (by positivity), ?_⟩, hp⟩ + rw [mem_ball] + linarith + · refine ⟨q, ⟨?_, mem_ball_self (by positivity)⟩, hq⟩ + rw [mem_ball, dist_comm] + linarith + obtain ⟨b, hbV, hbU⟩ := hmeet + obtain ⟨a, haV, haU⟩ := mem_closure_iff_nhds.mp hbU V (hVo.mem_nhds hbV) + have heq : E =ᶠ[𝓝 a] G := by + filter_upwards [(hVo.inter hU).mem_nhds ⟨haV, haU⟩] with w hw + exact (he ⟨hw.1.1, hw.2⟩).trans (hg ⟨hw.1.2, hw.2⟩).symm + exact (hE.mono inter_subset_left).eqOn_of_preconnected_of_eventuallyEq + (hG.mono inter_subset_right) + ((convex_ball p (3*r)).inter (convex_ball q (3*s))).isPreconnected haV heq + ⟨ball_subset_ball (by linarith) hzp, ball_subset_ball (by linarith) hzq⟩ + +theorem patch_boundary_germs {U : Set ℂ} (hU : IsOpen U) {f : ℂ → ℂ} + (hloc : ∀ p ∈ closure U, ∃ r > 0, ∃ E : ℂ → ℂ, + AnalyticOnNhd ℂ E (ball p (3*r)) ∧ EqOn E f (ball p (3*r) ∩ U) ∧ + (∀ z ∈ ball p (3*r), ‖E z‖ < 1 ↔ z ∈ U) ∧ deriv E p ≠ 0) : + ∃ V : Set ℂ, ∃ F : ℂ → ℂ, IsOpen V ∧ closure U ⊆ V ∧ + AnalyticOnNhd ℂ F V ∧ EqOn F f U ∧ + (∀ z ∈ V, ‖F z‖ < 1 ↔ z ∈ U) ∧ (∀ p ∈ closure U, deriv F p ≠ 0) := by + classical + choose r hr E hE he hside hd using hloc + let V : Set ℂ := ⋃ p : closure U, ball (p : ℂ) (r p p.property) + have hV : IsOpen V := isOpen_iUnion fun _ => isOpen_ball + have hUV : closure U ⊆ V := by + intro p hp + exact mem_iUnion.mpr ⟨⟨p,hp⟩, mem_ball_self (hr p hp)⟩ + have hchoose : ∀ z ∈ V, ∃ p : closure U, z ∈ ball (p : ℂ) (r p p.property) := by + intro z hz + exact mem_iUnion.mp hz + let F : ℂ → ℂ := fun z => if hz : z ∈ V then + E (hchoose z hz).choose (hchoose z hz).choose.property z else f z + have hFE : ∀ p : closure U, EqOn F (E p p.property) (ball (p : ℂ) (r p p.property)) := by + intro p z hz + have hzV : z ∈ V := mem_iUnion.mpr ⟨p,hz⟩ + dsimp only [F] + rw [dite_eq_left hzV] + exact boundary_germs_compatible hU (hchoose z hzV).choose.property p.property + (hr _ _) (hr _ _) (hchoose z hzV).choose_spec hz + (hE _ _) (hE _ _) (he _ _) (he _ _) + refine ⟨V,F,hV,hUV,?_,?_,?_,?_⟩ + · intro z hz + obtain ⟨p,hp⟩ := hchoose z hz + apply (hE p p.property z (ball_subset_ball (by linarith [hr p p.property]) hp)).congr + filter_upwards [isOpen_ball.mem_nhds hp] with w hw + exact (hFE p hw).symm + · intro z hz + exact (hFE ⟨z,subset_closure hz⟩ (mem_ball_self (hr _ _))).trans + (he z (subset_closure hz) ⟨mem_ball_self (by linarith [hr z (subset_closure hz)]),hz⟩) + · intro z hz + obtain ⟨p,hp⟩ := hchoose z hz + rw [hFE p hp] + exact hside p p.property z (ball_subset_ball (by linarith [hr p p.property]) hp) + · intro p hp + have hevent : F =ᶠ[𝓝 p] E p hp := by + filter_upwards [ball_mem_nhds p (hr p hp)] with z hz + exact hFE ⟨p,hp⟩ hz + rw [hevent.deriv_eq] + exact hd p hp + +theorem injective_closure_of_disk_side {U V : Set ℂ} (hV : IsOpen V) + (hUV : closure U ⊆ V) {F : ℂ → ℂ} (hF : AnalyticOnNhd ℂ F V) + (hi : InjOn F U) (hm : F '' U = ball 0 1) + (hside : ∀ z ∈ V, ‖F z‖ < 1 ↔ z ∈ U) + (hd : ∀ p ∈ closure U, deriv F p ≠ 0) : InjOn F (closure U) := by + intro p hp q hq he + by_contra hpq + obtain ⟨S,T,hS,hT,hpS,hqT,hST⟩ := t2_separation hpq + have hpN : S ∩ V ∈ 𝓝 p := (hS.inter hV).mem_nhds ⟨hpS,hUV hp⟩ + have hqN : T ∩ V ∈ 𝓝 q := (hT.inter hV).mem_nhds ⟨hqT,hUV hq⟩ + have hpI : F '' (S ∩ V) ∈ 𝓝 (F p) := by + rw [← (hF p (hUV hp)).hasStrictDerivAt.map_nhds_eq (hd p hp)] + exact Filter.image_mem_map hpN + have hqI : F '' (T ∩ V) ∈ 𝓝 (F p) := by + rw [he, ← (hF q (hUV hq)).hasStrictDerivAt.map_nhds_eq (hd q hq)] + exact Filter.image_mem_map hqN + have hpCl : F p ∈ closure (ball (0 : ℂ) 1) := by + rw [← hm] + exact mem_closure_image (hF p (hUV hp)).continuousAt hp + obtain ⟨w,hwI,hwD⟩ := mem_closure_iff_nhds.mp hpCl _ (inter_mem hpI hqI) + obtain ⟨a,haS,haw⟩ := hwI.1 + obtain ⟨b,hbT,hbw⟩ := hwI.2 + have haU : a ∈ U := (hside a haS.2).mp (by rw [haw]; exact mem_ball_zero_iff.mp hwD) + have hbU : b ∈ U := (hside b hbT.2).mp (by rw [hbw]; exact mem_ball_zero_iff.mp hwD) + have hab : a = b := hi haU hbU (haw.trans hbw.symm) + exact Set.disjoint_left.mp hST haS.1 (hab ▸ hbT.1) + +theorem univalent_neighborhood_of_disk_side {U V : Set ℂ} (hV : IsOpen V) + (hUV : closure U ⊆ V) (hUc : IsCompact (closure U)) + {F : ℂ → ℂ} (hF : AnalyticOnNhd ℂ F V) + (hi : InjOn F U) (hm : F '' U = ball 0 1) + (hside : ∀ z ∈ V, ‖F z‖ < 1 ↔ z ∈ U) + (hd : ∀ p ∈ closure U, deriv F p ≠ 0) : + ∃ W, IsOpen W ∧ closure U ⊆ W ∧ W ⊆ V ∧ + InjOn F W ∧ AnalyticOnNhd ℂ F W ∧ F '' closure U = closedBall 0 1 := by + have hic := injective_closure_of_disk_side hV hUV hF hi hm hside hd + have hlocal : ∀ p ∈ closure U, ∃ S ∈ 𝓝 p, InjOn F S := by + intro p hp + let d := (hF p (hUV hp)).hasStrictDerivAt.hasStrictFDerivAt_equiv (hd p hp) + exact ⟨(d.toOpenPartialHomeomorph F).source, + (d.toOpenPartialHomeomorph F).open_source.mem_nhds d.mem_toOpenPartialHomeomorph_source, + (d.toOpenPartialHomeomorph F).injOn⟩ + obtain ⟨W,hW,hUW,hiW⟩ := hic.exists_isOpen_superset hUc + (fun p hp => (hF p (hUV hp)).continuousAt) hlocal + refine ⟨W ∩ V,hW.inter hV,fun z hz => ⟨hUW hz,hUV hz⟩,inter_subset_right, + hiW.mono inter_subset_left,hF.mono inter_subset_right,?_⟩ + apply Subset.antisymm + · rintro w ⟨z,hz,rfl⟩ + rw [← closure_ball (0 : ℂ) (by norm_num : (1 : ℝ) ≠ 0), ← hm] + exact mem_closure_image (hF z (hUV hz)).continuousAt hz + · have hc : IsClosed (F '' closure U) := + (hUc.image_of_continuousOn (hF.continuousOn.mono hUV)).isClosed + rw [← closure_ball (0 : ℂ) (by norm_num : (1 : ℝ) ≠ 0)] + apply hc.closure_subset_iff.mpr + rw [← hm] + exact image_mono subset_closure + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/Convexity.lean b/lean/OAI/Analysis/DirectCrouzeix/Convexity.lean new file mode 100644 index 0000000000000000000000000000000000000000..1edd31ab2ee198806c5c33f368a4a51d6e07ab8a --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Convexity.lean @@ -0,0 +1,272 @@ +import OAI.Analysis.DirectCrouzeix.SupportNets + +namespace OAI + +universe u_140 u_141 u_142 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set + +open scoped ComplexConjugate Matrix + +namespace DirectCrouzeix.Geometry + +theorem sphere_lift {E : Type u_140} {F : Type u_141} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [AddCommGroup F] [Module ℝ F] (L : E →ₗ[ℝ] F) (hker : L.ker ≠ ⊥) + {x : E} (hx : ‖x‖ ≤ 1) : ∃ y : E, ‖y‖ = 1 ∧ L y = L x := by + obtain ⟨v,hv,hv0⟩ := Submodule.exists_mem_ne_zero_of_ne_bot hker + let w := ‖v‖⁻¹ • v + have hw : ‖w‖ = 1 := by simp [w,norm_smul,norm_ne_zero_iff.mpr hv0] + have hLw : L w = 0 := by simp [w,show L v = 0 from hv] + let b := inner ℝ x w + have hn : 0 ≤ b^2+1-‖x‖^2 := by nlinarith [sq_nonneg b,norm_nonneg x] + let t := -b+Real.sqrt (b^2+1-‖x‖^2) + have ht : t^2+2*b*t+‖x‖^2 = 1 := by + have hs := Real.sq_sqrt hn + dsimp [t] + nlinarith + refine ⟨x+t • w,?_,by simp [hLw]⟩ + have hsq : ‖x+t • w‖^2 = 1 := by + rw [norm_add_sq_real,inner_smul_right,norm_smul,hw,mul_one,Real.norm_eq_abs,sq_abs] + change ‖x‖^2+2*(t*b)+t^2 = 1 + nlinarith [ht] + nlinarith [norm_nonneg (x+t • w)] + +abbrev Three := EuclideanSpace ℝ (Fin 3) + +def bloch (u v : ℂ) : Three := + WithLp.toLp 2 ![2*(conj u*v).re,2*(conj u*v).im,Complex.normSq u-Complex.normSq v] + +theorem norm_sq_three (p : Three) : ‖p‖^2 = p 0^2+p 1^2+p 2^2 := by + simp [EuclideanSpace.norm_sq_eq,Fin.sum_univ_succ,Real.norm_eq_abs,sq_abs,add_assoc] + +theorem norm_bloch {u v : ℂ} (h : Complex.normSq u+Complex.normSq v = 1) : ‖bloch u v‖ = 1 := by + have hm : (conj u*v).re^2+(conj u*v).im^2 = Complex.normSq u*Complex.normSq v := by + calc + _ = Complex.normSq (conj u*v) := by simp [Complex.normSq_apply,pow_two] + _ = _ := by rw [Complex.normSq_mul,Complex.normSq_conj] + have hsq : ‖bloch u v‖^2 = 1 := by + rw [norm_sq_three] + change (2*(conj u*v).re)^2+(2*(conj u*v).im)^2+(Complex.normSq u-Complex.normSq v)^2 = 1 + nlinarith [hm] + nlinarith [norm_nonneg (bloch u v)] + +theorem bloch_surjective_sphere {p : Three} (hp : ‖p‖ = 1) : + ∃ u v : ℂ, Complex.normSq u+Complex.normSq v = 1 ∧ bloch u v = p := by + have hsq : p 0^2+p 1^2+p 2^2 = 1 := by rw [← norm_sq_three,hp]; norm_num + have hz : -1 ≤ p 2 ∧ p 2 ≤ 1 := by constructor <;> nlinarith [sq_nonneg (p 0),sq_nonneg (p 1)] + by_cases hzero : 1+p 2 = 0 + · have h2 : p 2 = -1 := by linarith + have h0 : p 0 = 0 := by nlinarith [sq_nonneg (p 1)] + have h1 : p 1 = 0 := by nlinarith [sq_nonneg (p 0)] + refine ⟨0,1,by norm_num,?_⟩ + ext i + fin_cases i <;> simp [bloch,h0,h1,h2] + · let s := (1+p 2)/2 + have hs : 0 < s := by dsimp [s]; exact div_pos (lt_of_le_of_ne (by linarith) (Ne.symm hzero)) (by norm_num) + let a := Real.sqrt s + have ha : 0 < a := Real.sqrt_pos.mpr hs + have ha0 : a ≠ 0 := ne_of_gt ha + have ha2 : a^2 = s := Real.sq_sqrt hs.le + let u : ℂ := a + let v : ℂ := ⟨p 0/(2*a),p 1/(2*a)⟩ + have hu : Complex.normSq u = s := by simp [u,Complex.normSq_apply]; nlinarith [ha2] + have hv : Complex.normSq v = 1-s := by + dsimp [v] + field_simp + dsimp [s] at * + nlinarith [hsq,ha2] + have hw : conj u*v = (⟨p 0/2,p 1/2⟩ : ℂ) := by + apply Complex.ext <;> simp [u,v,Complex.mul_re,Complex.mul_im] <;> field_simp + refine ⟨u,v,by rw [hu,hv]; ring,?_⟩ + ext i + fin_cases i <;> simp [bloch,hw,hu,hv,s] <;> ring + +def threeLinear (c : Fin 3 → ℂ) : Three →ₗ[ℝ] ℂ where + toFun p := ∑ i, (p i : ℂ)*c i + map_add' p q := by simp [add_mul,Finset.sum_add_distrib] + map_smul' a p := by simp [Complex.real_smul,Finset.mul_sum,mul_assoc] + +theorem threeLinear_ker_ne_bot (c : Fin 3 → ℂ) : (threeLinear c).ker ≠ ⊥ := by + apply LinearMap.ker_ne_bot_of_finrank_lt + simp [Complex.finrank_real_complex,finrank_euclideanSpace] + +def twoForm (a b c d u v : ℂ) : ℂ := + Complex.normSq u * a + Complex.normSq v * d + (conj u*v)*b + (conj v*u)*c + +theorem twoForm_bloch (a b c d u v : ℂ) (h : Complex.normSq u+Complex.normSq v = 1) : + twoForm a b c d u v = (a+d)/2 + + threeLinear ![(b+c)/2,Complex.I*(b-c)/2,(a-d)/2] (bloch u v) := by + have hh : (Complex.normSq u : ℂ)+(Complex.normSq v : ℂ) = 1 := by exact_mod_cast h + have hw : conj v*u = conj (conj u*v) := by simp [mul_comm] + simp only [twoForm,threeLinear,LinearMap.coe_mk,AddHom.coe_mk] + change _ = (a+d)/2 + (((2*(conj u*v).re : ℝ):ℂ)*((b+c)/2) + + (((2*(conj u*v).im : ℝ):ℂ)*(Complex.I*(b-c)/2) + + (((Complex.normSq u-Complex.normSq v : ℝ):ℂ)*((a-d)/2) + 0))) + rw [hw] + apply Complex.ext + · simp [Complex.mul_re,Complex.mul_im] + linear_combination ((a.re+d.re)/2)*h + · simp [Complex.mul_re,Complex.mul_im] + linear_combination ((a.im+d.im)/2)*h + +theorem convex_twoForm (a b c d : ℂ) : + Convex ℝ {z : ℂ | ∃ u v : ℂ, Complex.normSq u+Complex.normSq v = 1 ∧ twoForm a b c d u v = z} := by + intro x hx y hy r s hr hs hrs + obtain ⟨u,v,huv,rfl⟩ := hx + obtain ⟨w,z,hwz,rfl⟩ := hy + let L := threeLinear ![(b+c)/2,Complex.I*(b-c)/2,(a-d)/2] + have hn : ‖r • bloch u v+s • bloch w z‖ ≤ 1 := by + calc + _ ≤ ‖r • bloch u v‖+‖s • bloch w z‖ := norm_add_le _ _ + _ = r+s := by rw [norm_smul,norm_smul,norm_bloch huv,norm_bloch hwz, + Real.norm_eq_abs,Real.norm_eq_abs,abs_of_nonneg hr,abs_of_nonneg hs]; ring + _ = 1 := hrs + obtain ⟨p,hp,hLp⟩ := sphere_lift L (threeLinear_ker_ne_bot _) hn + obtain ⟨α,β,hαβ,rfl⟩ := bloch_surjective_sphere hp + refine ⟨α,β,hαβ,?_⟩ + rw [twoForm_bloch a b c d α β hαβ,twoForm_bloch a b c d u v huv,twoForm_bloch a b c d w z hwz] + change (a+d)/2+L (bloch α β) = _ + rw [hLp,map_add,map_smul,map_smul] + simp only [smul_add] + rw [add_add_add_comm (r • ((a+d)/2)) (r • L (bloch u v)),← add_smul,hrs,one_smul] + +section Inner + +variable {E : Type u_142} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +theorem orthonormal_pair_norm_sq {x y : E} (hx : ‖x‖ = 1) (hy : ‖y‖ = 1) + (hxy : inner ℂ x y = 0) (u v : ℂ) : + ‖u • x+v • y‖^2 = Complex.normSq u+Complex.normSq v := by + rw [norm_add_sq (𝕜 := ℂ),inner_smul_left,inner_smul_right,hxy,mul_zero,mul_zero] + simp only [map_zero,mul_zero,add_zero,norm_smul,hx,hy,mul_one,Complex.normSq_eq_norm_sq] + +theorem twoForm_inner {x y : E} (T : E →ₗ[ℂ] E) (u v : ℂ) : + inner ℂ (u • x+v • y) (T (u • x+v • y)) = + twoForm (inner ℂ x (T x)) (inner ℂ x (T y)) (inner ℂ y (T x)) (inner ℂ y (T y)) u v := by + simp only [map_add,map_smul,inner_add_left,inner_add_right,inner_smul_left,inner_smul_right, + twoForm] + have hu : (Complex.normSq u : ℂ) = conj u*u := by rw [Complex.conj_mul',Complex.normSq_eq_norm_sq,Complex.ofReal_pow] + have hv : (Complex.normSq v : ℂ) = conj v*v := by rw [Complex.conj_mul',Complex.normSq_eq_norm_sq,Complex.ofReal_pow] + rw [hu,hv] + ring + +theorem convex_quadratic_range (T : E →ₗ[ℂ] E) : + Convex ℝ {z : ℂ | ∃ x : E, ‖x‖ = 1 ∧ inner ℂ x (T x) = z} := by + intro z hz w hw r s hr hs hrs + obtain ⟨x,hx,rfl⟩ := hz + obtain ⟨y,hy,rfl⟩ := hw + let a := inner ℂ x y + let v := y-a • x + have hvorth : inner ℂ x v = 0 := by + simp [v,a,inner_self_eq_norm_sq_to_K,hx] + by_cases hv0 : v = 0 + · have hey : y = a • x := sub_eq_zero.mp hv0 + have han : ‖a‖ = 1 := by simpa [hey,norm_smul,hx] using hy + have heq : inner ℂ y (T y) = inner ℂ x (T x) := by + rw [hey,map_smul,inner_smul_left,inner_smul_right,← mul_assoc,Complex.conj_mul',han] + simp + refine ⟨x,hx,?_⟩ + rw [heq,← add_smul,hrs,one_smul] + · let b : ℂ := ‖v‖ + let e := b⁻¹ • v + have hb : b ≠ 0 := by dsimp [b]; exact_mod_cast norm_ne_zero_iff.mpr hv0 + have he : ‖e‖ = 1 := norm_smul_inv_norm hv0 + have hxe : inner ℂ x e = 0 := by simp [e,hvorth] + have hyeq : y = a • x+b • e := by + simp only [e,smul_smul,mul_inv_cancel₀ hb,one_smul,v] + abel + have hab : Complex.normSq a+Complex.normSq b = 1 := by + rw [← orthonormal_pair_norm_sq hx he hxe a b,← hyeq,hy] + norm_num + let A := inner ℂ x (T x) + let B := inner ℂ x (T e) + let C := inner ℂ e (T x) + let D := inner ℂ e (T e) + have hxF : ∃ u v : ℂ, Complex.normSq u+Complex.normSq v = 1 ∧ twoForm A B C D u v = inner ℂ x (T x) := by + exact ⟨1,0,by norm_num,by simp [twoForm,A]⟩ + have hyF : ∃ u v : ℂ, Complex.normSq u+Complex.normSq v = 1 ∧ twoForm A B C D u v = inner ℂ y (T y) := by + refine ⟨a,b,hab,?_⟩ + rw [hyeq,twoForm_inner] + obtain ⟨u,v,huv,hform⟩ := convex_twoForm A B C D hxF hyF hr hs hrs + refine ⟨u • x+v • e,?_,?_⟩ + · have hn := orthonormal_pair_norm_sq hx he hxe u v + rw [huv] at hn + nlinarith [norm_nonneg (u • x+v • e)] + · rw [twoForm_inner] + exact hform + +end Inner + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/DiskMapping.lean b/lean/OAI/Analysis/DirectCrouzeix/DiskMapping.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc78897fd3659856b9e4a35ac1a7ac9a7da847cc --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/DiskMapping.lean @@ -0,0 +1,289 @@ +import OAI.Analysis.DirectCrouzeix.ExtremalEmbedding + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +def diskMobius (a z : ℂ) : ℂ := (z - a) / (1 - conj a * z) + +theorem diskMobius_den_ne_zero {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ ≤ 1) : + 1 - conj a * z ≠ 0 := by + intro he + have hh := congrArg norm (sub_eq_zero.mp he) + rw [norm_one, norm_mul, norm_conj] at hh + have hp := mul_le_mul_of_nonneg_left hz (norm_nonneg a) + nlinarith + +theorem diskMobius_difference (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, Complex.sub_re, + Complex.sub_im, Complex.mul_re, Complex.mul_im, Complex.conj_re, Complex.conj_im, + Complex.one_re, Complex.one_im] + ring + +theorem diskMobius_mapsTo {a : ℂ} (ha : ‖a‖ < 1) : + MapsTo (diskMobius a) (ball 0 1) (ball 0 1) := by + intro z hz + have hz' : ‖z‖ < 1 := mem_ball_zero_iff.mp hz + rw [mem_ball_zero_iff, diskMobius, norm_div, + div_lt_one₀ (norm_pos_iff.mpr (diskMobius_den_ne_zero ha hz'.le))] + have hd := diskMobius_difference a z + have hp : 0 < (1 - ‖a‖ ^ 2) * (1 - ‖z‖ ^ 2) := mul_pos + (by nlinarith [norm_nonneg a]) (by nlinarith [norm_nonneg z]) + nlinarith [norm_nonneg (z - a), norm_nonneg (1 - conj a * z)] + +theorem diskMobius_hasDerivAt {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ ≤ 1) : + HasDerivAt (diskMobius a) ((1 - conj a * a) / (1 - conj a * z) ^ 2) z := by + have hh := ((hasDerivAt_id z).sub_const a).fun_div + ((hasDerivAt_const z (1 : ℂ)).sub ((hasDerivAt_id z).const_mul (conj a))) + (diskMobius_den_ne_zero ha hz) + change HasDerivAt (diskMobius a) + ((1 * (1 - conj a * z) - (z - a) * (0 - conj a * 1)) / (1 - conj a * z) ^ 2) z at hh + convert hh using 1 + congr 1 + ring + +theorem diskMobius_deriv_ne_zero {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ ≤ 1) : + deriv (diskMobius a) z ≠ 0 := by + rw [(diskMobius_hasDerivAt ha hz).deriv] + exact div_ne_zero (diskMobius_den_ne_zero ha ha.le) + (pow_ne_zero _ (diskMobius_den_ne_zero ha hz)) + +theorem diskMobius_injOn {a : ℂ} (ha : ‖a‖ < 1) : + InjOn (diskMobius a) (ball 0 1) := by + intro z hz w hw he + have hz' := (mem_ball_zero_iff.mp hz).le + have hw' := (mem_ball_zero_iff.mp hw).le + have hd := (div_eq_div_iff (diskMobius_den_ne_zero ha hz') + (diskMobius_den_ne_zero ha hw')).mp he + have hprod : (1 - conj a * a) * (z - w) = 0 := by + linear_combination hd + exact sub_eq_zero.mp ((mul_eq_zero.mp hprod).resolve_left (diskMobius_den_ne_zero ha ha.le)) + +@[simp] theorem diskMobius_self (a : ℂ) : diskMobius a a = 0 := by simp [diskMobius] + +@[simp] theorem diskMobius_zero (a : ℂ) : diskMobius a 0 = -a := by simp [diskMobius] + +theorem diskMobius_norm_deriv {a z : ℂ} (ha : ‖a‖ < 1) (hz : ‖z‖ ≤ 1) : + ‖deriv (diskMobius a) z‖ = (1 - ‖a‖ ^ 2) / ‖1 - conj a * z‖ ^ 2 := by + rw [(diskMobius_hasDerivAt ha hz).deriv, norm_div, norm_pow] + congr 1 + rw [mul_comm (conj a), Complex.mul_conj, Complex.normSq_eq_norm_sq, + ← Complex.ofReal_one, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (by nlinarith [norm_nonneg a] : 0 < 1 - ‖a‖ ^ 2)] + +theorem diskMobius_norm_deriv_zero {a : ℂ} (ha : ‖a‖ < 1) : + ‖deriv (diskMobius a) 0‖ = 1 - ‖a‖ ^ 2 := by + rw [diskMobius_norm_deriv ha (by simp)] + simp + +theorem diskMobius_norm_deriv_self {a : ℂ} (ha : ‖a‖ < 1) : + ‖deriv (diskMobius a) a‖ = (1 - ‖a‖ ^ 2)⁻¹ := by + rw [diskMobius_norm_deriv ha ha.le] + have hd : ‖1 - conj a * a‖ = 1 - ‖a‖ ^ 2 := by + rw [mul_comm (conj a), Complex.mul_conj, Complex.normSq_eq_norm_sq, + ← Complex.ofReal_one, ← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, + abs_of_pos (by nlinarith [norm_nonneg a] : 0 < 1 - ‖a‖ ^ 2)] + rw [hd] + field_simp + +theorem hasDerivAt_squareRoot {g F : ℂ → ℂ} {x d : ℂ} + (hg : ContinuousAt g x) (hg0 : g x ≠ 0) (hF : HasDerivAt F d x) + (he : ∀ z, g z ^ 2 = F z) : HasDerivAt g (d / (2 * g x)) x := by + have hn : g x + g x ≠ 0 := by simpa [← two_mul] using mul_ne_zero (by norm_num : (2 : ℂ) ≠ 0) hg0 + have ht := hF.tendsto_slope.div + ((hg.add_const (g x)).tendsto.mono_left nhdsWithin_le_nhds) hn + rw [hasDerivAt_iff_tendsto_slope] + convert ht.congr' ?_ using 1 + · congr 1 + ring + have hnear : ∀ᶠ z in 𝓝[≠] x, g z + g x ≠ 0 := + ((hg.add_const (g x)).eventually_ne hn).filter_mono nhdsWithin_le_nhds + filter_upwards [hnear] with z hz + simp only [Pi.div_apply, slope, smul_eq_mul, vsub_eq_sub] + rw [← he z, ← he x] + field_simp [hz] + ring + +theorem improve_embedding {U : Set ℂ} (hU : IsOpen U) + (hUc : IsSimplyConnected U) {a : ℂ} (ha : a ∈ U) + {f : ℂ → ℂ} (hf : NormalizedEmbedding U a f) + {b : ℂ} (hb : ‖b‖ < 1) (hmiss : b ∉ f '' U) : + ∃ G, NormalizedEmbedding U a G ∧ ‖deriv f a‖ < ‖deriv G a‖ := by + have hfb : ∀ z ∈ U, f z ≠ b := by + intro z hz he + exact hmiss ⟨z, hz, he⟩ + let H : ℂ → ℂ := diskMobius b ∘ f + have hH' (z : ℂ) (hz : z ∈ U) : + HasDerivAt H (deriv (diskMobius b) (f z) * deriv f z) z := + ((diskMobius_hasDerivAt hb (mem_ball_zero_iff.mp (hf.disk hz)).le).differentiableAt.hasDerivAt).comp z + (hf.holomorphic.hasDerivAt (hU.mem_nhds hz)) + have hHd : DifferentiableOn ℂ H U := fun z hz => + (hH' z hz).differentiableAt.differentiableWithinAt + have hHdisk : MapsTo H U (ball 0 1) := (diskMobius_mapsTo hb).comp hf.disk + have hHi : InjOn H U := (diskMobius_injOn hb).comp hf.injective hf.disk + have hH0 : ∀ z ∈ U, H z ≠ 0 := by + intro z hz + dsimp [H, diskMobius, Function.comp_def] + exact div_ne_zero (sub_ne_zero.mpr (hfb z hz)) + (diskMobius_den_ne_zero hb (mem_ball_zero_iff.mp (hf.disk hz)).le) + obtain ⟨g, hgc, hge⟩ := Complex.exists_continuousOn_pow_eq hUc hU hHd.continuousOn + (by rintro ⟨z, hz, he⟩; exact hH0 z hz he) (by norm_num : (2 : ℕ) ≠ 0) + have hg0 : ∀ z ∈ U, g z ≠ 0 := by + intro z hz he + have ht := hge z + simp only [he, zero_pow (by norm_num : (2 : ℕ) ≠ 0)] at ht + exact hH0 z hz ht.symm + have hgd (z : ℂ) (hz : z ∈ U) : + HasDerivAt g (deriv H z / (2 * g z)) z := + hasDerivAt_squareRoot (hgc.continuousAt (hU.mem_nhds hz)) (hg0 z hz) + (hHd.hasDerivAt (hU.mem_nhds hz)) hge + have hgi : InjOn g U := by + intro z hz w hw he + apply hHi hz hw + rw [← hge z, ← hge w, he] + have hgb : MapsTo g U (ball 0 1) := by + intro z hz + rw [mem_ball_zero_iff] + have hn := congrArg norm (hge z) + rw [norm_pow] at hn + have ht : ‖H z‖ < 1 := mem_ball_zero_iff.mp (hHdisk hz) + nlinarith [sq_nonneg (‖g z‖ - 1)] + have hgne (z : ℂ) (hz : z ∈ U) : deriv g z ≠ 0 := by + rw [(hgd z hz).deriv, (hH' z hz).deriv] + exact div_ne_zero (mul_ne_zero + (diskMobius_deriv_ne_zero hb (mem_ball_zero_iff.mp (hf.disk hz)).le) + (hf.derivative z hz)) (mul_ne_zero (by norm_num) (hg0 z hz)) + have hr : ‖g a‖ < 1 := mem_ball_zero_iff.mp (hgb ha) + have hr0 : 0 < ‖g a‖ := norm_pos_iff.mpr (hg0 a ha) + let G : ℂ → ℂ := diskMobius (g a) ∘ g + have hG' (z : ℂ) (hz : z ∈ U) : + HasDerivAt G (deriv (diskMobius (g a)) (g z) * deriv g z) z := + ((diskMobius_hasDerivAt hr (mem_ball_zero_iff.mp (hgb hz)).le).differentiableAt.hasDerivAt).comp z + (hgd z hz).differentiableAt.hasDerivAt + have hGN : NormalizedEmbedding U a G := by + refine ⟨fun z hz => (hG' z hz).differentiableAt.differentiableWithinAt, + (diskMobius_mapsTo hr).comp hgb, (diskMobius_injOn hr).comp hgi hgb, ?_, ?_⟩ + · intro z hz + rw [(hG' z hz).deriv] + exact mul_ne_zero (diskMobius_deriv_ne_zero hr (mem_ball_zero_iff.mp (hgb hz)).le) + (hgne z hz) + · exact diskMobius_self _ + refine ⟨G, hGN, ?_⟩ + have hab : ‖g a‖ ^ 2 = ‖b‖ := by + have ht := congrArg norm (hge a) + simpa only [norm_pow, H, Function.comp_apply, hf.normalized, diskMobius_zero, norm_neg] using ht + have hval : ‖deriv G a‖ = (1 - ‖g a‖ ^ 2)⁻¹ * + ((1 - ‖b‖ ^ 2) * ‖deriv f a‖ / (2 * ‖g a‖)) := by + rw [(hG' a ha).deriv, norm_mul, diskMobius_norm_deriv_self hr, + (hgd a ha).deriv, norm_div, (hH' a ha).deriv, norm_mul, hf.normalized, + diskMobius_norm_deriv_zero hb, norm_mul] + norm_num + rw [hval] + have hp : 0 < ‖deriv f a‖ := norm_pos_iff.mpr (hf.derivative a ha) + have h1 : 0 < 1 - ‖g a‖ ^ 2 := by nlinarith + have he : (1 - ‖g a‖ ^ 2)⁻¹ * + ((1 - ‖b‖ ^ 2) * ‖deriv f a‖ / (2 * ‖g a‖)) = + ((1 + ‖g a‖ ^ 2) / (2 * ‖g a‖)) * ‖deriv f a‖ := by + rw [← hab] + field_simp + ring + rw [he] + have hc : 1 < (1 + ‖g a‖ ^ 2) / (2 * ‖g a‖) := by + rw [lt_div_iff₀ (by positivity)] + nlinarith [sq_pos_of_pos (sub_pos.mpr hr)] + nlinarith + +theorem exists_riemannMap {U : Set ℂ} (hU : IsOpen U) + (hUc : IsSimplyConnected U) (hproper : U ≠ univ) {a : ℂ} (ha : a ∈ U) : + ∃ f, NormalizedEmbedding U a f ∧ f '' U = ball 0 1 := by + obtain ⟨f, hf, hmax⟩ := exists_extremalEmbedding hU hUc hproper ha + refine ⟨f, hf, Subset.antisymm (by simpa using hf.disk.image_subset) ?_⟩ + intro b hb + by_contra hmiss + obtain ⟨G, hG, hlt⟩ := improve_embedding hU hUc ha hf (mem_ball_zero_iff.mp hb) hmiss + exact (not_lt_of_ge (hmax G hG)) hlt + +theorem inverse_hasStrictDerivAt {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) (hi : InjOn f U) + {z : ℂ} (hz : z ∈ U) (hd : deriv f z ≠ 0) : + HasStrictDerivAt (Function.invFunOn f U) (deriv f z)⁻¹ (f z) := by + apply ((hf.analyticOnNhd hU) z hz).hasStrictDerivAt.to_local_left_inverse hd + filter_upwards [hU.mem_nhds hz] with w hw + exact hi.leftInvOn_invFunOn hw + +theorem inverse_holomorphic {U : Set ℂ} (hU : IsOpen U) + {a : ℂ} {f : ℂ → ℂ} (hf : NormalizedEmbedding U a f) : + DifferentiableOn ℂ (Function.invFunOn f U) (f '' U) := by + rintro y ⟨z, hz, rfl⟩ + exact (inverse_hasStrictDerivAt hU hf.holomorphic hf.injective hz (hf.derivative z hz)).hasDerivAt.differentiableAt.differentiableWithinAt + +theorem compact_inverse_disk {U : Set ℂ} (hU : IsOpen U) + {a : ℂ} {f : ℂ → ℂ} (hf : NormalizedEmbedding U a f) + (hs : f '' U = ball 0 1) {r : ℝ} (hr : r < 1) : + IsCompact (Function.invFunOn f U '' closedBall 0 r) ∧ + Function.invFunOn f U '' closedBall 0 r ⊆ U := by + have hsub : closedBall (0 : ℂ) r ⊆ f '' U := by + rw [hs] + apply closedBall_subset_ball + exact hr + refine ⟨(isCompact_closedBall (0 : ℂ) r).image_of_continuousOn + ((inverse_holomorphic hU hf).continuousOn.mono hsub), ?_⟩ + rintro z ⟨w, hw, rfl⟩ + exact Function.invFunOn_mem (hsub hw) + +theorem norm_tendsto_one_boundary {U : Set ℂ} (hU : IsOpen U) + {a : ℂ} {f : ℂ → ℂ} (hf : NormalizedEmbedding U a f) + (hs : f '' U = ball 0 1) {p : ℂ} (hp : p ∉ U) : + Tendsto (fun z => ‖f z‖) (𝓝[U] p) (𝓝 1) := by + rw [tendsto_order] + constructor + · intro r hr + have hc := compact_inverse_disk hU hf hs hr + have hpn : p ∉ Function.invFunOn f U '' closedBall 0 r := fun h => hp (hc.2 h) + have he : ∀ᶠ z in 𝓝 p, z ∉ Function.invFunOn f U '' closedBall 0 r := + hc.1.isClosed.isOpen_compl.mem_nhds hpn + filter_upwards [he.filter_mono nhdsWithin_le_nhds, self_mem_nhdsWithin] with z hz hzU + by_contra hn + apply hz + refine ⟨f z, ?_, hf.injective.leftInvOn_invFunOn hzU⟩ + simpa using le_of_not_gt hn + · intro r hr + filter_upwards [self_mem_nhdsWithin] with z hz + exact (mem_ball_zero_iff.mp (hf.disk hz)).trans hr + +open InnerProductSpace Real + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean b/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean new file mode 100644 index 0000000000000000000000000000000000000000..3dd69710d797cc743c528204aa05bc4398f21a02 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean @@ -0,0 +1,164 @@ +import OAI.Analysis.DirectCrouzeix.CompactIntegrals + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +def divided (g : ℂ → ℂ) (u v : ℂ) : ℂ := chordIntegral (deriv g) (fun _ => 1) u v + +def dividedLeft (g : ℂ → ℂ) (u v : ℂ) : ℂ := + chordIntegral (deriv (deriv g)) (fun t => (1-(t:ℝ) : ℝ)) u v + +def chordDenominator (c : ℂ) (g : ℂ → ℂ) (u v : ℂ) : ℂ := c-u*v*divided g u v + +def correction (c : ℂ) (g : ℂ → ℂ) (u v : ℂ) : ℂ := + u*v*(divided g u v+u*dividedLeft g u v) / chordDenominator c g u v + +theorem divided_eq_dslope {s : Set ℂ} (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + divided g u v = dslope g v u := chordIntegral_deriv_eq_dslope hconv hg hu hv + +theorem hasDerivAt_divided_left {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + HasDerivAt (fun z => divided g z v) (dividedLeft g u v) u := by + simpa only [divided, dividedLeft, one_mul] using + hasDerivAt_chordIntegral_left hs hconv hg.deriv (continuous_const (y := (1:ℂ))) hu hv + +theorem continuousOn_correction {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {c : ℂ} + (hH : ∀ u ∈ s, ∀ v ∈ s, chordDenominator c g u v ≠ 0) : + ContinuousOn (fun p : ℂ × ℂ => correction c g p.1 p.2) (s ×ˢ s) := by + have hD := continuousOn_chordIntegral hs hconv hg.deriv.continuousOn (continuous_const (y := (1:ℂ))) + have hE := continuousOn_chordIntegral hs hconv hg.deriv.deriv.continuousOn + (show Continuous (fun t : Parameter => ((1-(t:ℝ) : ℝ):ℂ)) by fun_prop) + exact ((continuous_fst.mul continuous_snd).continuousOn.mul + (hD.add (continuous_fst.continuousOn.mul hE))).div + (continuousOn_const.sub ((continuous_fst.mul continuous_snd).continuousOn.mul hD)) + (fun p hp => hH p.1 hp.1 p.2 hp.2) + +theorem analyticOnNhd_correction_left {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {c v : ℂ} (hv : v ∈ s) + (hH : ∀ u ∈ s, chordDenominator c g u v ≠ 0) : + AnalyticOnNhd ℂ (fun u => correction c g u v) s := by + have hD := analyticOnNhd_chordIntegral_left hs hconv hg.deriv (continuous_const (y := (1:ℂ))) hv + have hE := analyticOnNhd_chordIntegral_left hs hconv hg.deriv.deriv + (show Continuous (fun t : Parameter => ((1-(t:ℝ) : ℝ):ℂ)) by fun_prop) hv + intro u hu + exact (((analyticAt_id.mul analyticAt_const).mul ((hD u hu).add (analyticAt_id.mul (hE u hu)))).div + (analyticAt_const.sub ((analyticAt_id.mul analyticAt_const).mul (hD u hu))) (hH u hu)) + +theorem analyticOnNhd_correction_right {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {c u : ℂ} (hu : u ∈ s) + (hH : ∀ v ∈ s, chordDenominator c g u v ≠ 0) : + AnalyticOnNhd ℂ (correction c g u) s := by + have hD := analyticOnNhd_chordIntegral_right hs hconv hg.deriv (continuous_const (y := (1:ℂ))) hu + have hE := analyticOnNhd_chordIntegral_right hs hconv hg.deriv.deriv + (show Continuous (fun t : Parameter => ((1-(t:ℝ) : ℝ):ℂ)) by fun_prop) hu + intro v hv + exact (((analyticAt_const.mul analyticAt_id).mul ((hD v hv).add (analyticAt_const.mul (hE v hv)))).div + (analyticAt_const.sub ((analyticAt_const.mul analyticAt_id).mul (hD v hv))) (hH v hv)) + +@[simp] theorem correction_zero_left (c : ℂ) (g : ℂ → ℂ) (v : ℂ) : correction c g 0 v = 0 := by + simp [correction] + +@[simp] theorem correction_zero_right (c : ℂ) (g : ℂ → ℂ) (u : ℂ) : correction c g u 0 = 0 := by + simp [correction] + +def exterior (c : ℂ) (g : ℂ → ℂ) (ζ : ℂ) := c*ζ+g ζ⁻¹ + +theorem hasDerivAt_exterior {s : Set ℂ} {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) + (c : ℂ) {ζ : ℂ} (hζ : ζ ≠ 0) (hζs : ζ⁻¹ ∈ s) : + HasDerivAt (exterior c g) (c-ζ⁻¹^2*deriv g ζ⁻¹) ζ := by + have hd := ((hasDerivAt_id ζ).const_mul c).add + ((hg ζ⁻¹ hζs).differentiableAt.hasDerivAt.comp ζ (hasDerivAt_inv hζ)) + change HasDerivAt (fun z => exterior c g z) _ ζ + simpa only [exterior, Function.comp_def, id_eq, mul_one, Pi.add_apply, inv_pow, + div_eq_mul_inv, sub_eq_add_neg, mul_neg, mul_comm, mul_left_comm] using! hd + +theorem chordDenominator_off_diagonal {s : Set ℂ} (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) (c : ℂ) {u v : ℂ} + (hu : u ∈ s) (hv : v ∈ s) (hu0 : u ≠ 0) (hv0 : v ≠ 0) (huv : u ≠ v) : + chordDenominator c g u v = (exterior c g u⁻¹ - exterior c g v⁻¹) / (u⁻¹-v⁻¹) := by + rw [chordDenominator, divided_eq_dslope hconv hg hu hv, dslope_of_ne g huv] + simp only [slope, smul_eq_mul, vsub_eq_sub, exterior, inv_inv] + field_simp + ring + +theorem chordDenominator_diagonal {s : Set ℂ} (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) (c : ℂ) {u : ℂ} (hu : u ∈ s) : + chordDenominator c g u u = c-u^2*deriv g u := by + rw [chordDenominator, divided_eq_dslope hconv hg hu hu, dslope_same] + ring + +theorem chordDenominator_ne_zero {s : Set ℂ} (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {c : ℂ} (hc : c ≠ 0) + (hinj : InjOn (exterior c g) (Inv.inv ⁻¹' s \ {0})) + (hd : ∀ ζ, ζ ≠ 0 → ζ⁻¹ ∈ s → deriv (exterior c g) ζ ≠ 0) + {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : chordDenominator c g u v ≠ 0 := by + by_cases hu0 : u = 0 + · simp [chordDenominator, hu0, hc] + by_cases hv0 : v = 0 + · simp [chordDenominator, hv0, hc] + by_cases huv : u = v + · subst v + rw [chordDenominator_diagonal hconv hg c hu] + have hder := (hasDerivAt_exterior hg c (inv_ne_zero hu0) (by simpa using hu)).deriv + have hn := hd u⁻¹ (inv_ne_zero hu0) (by simpa using hu) + rwa [hder,inv_inv] at hn + · rw [chordDenominator_off_diagonal hconv hg c hu hv hu0 hv0 huv] + exact div_ne_zero (sub_ne_zero.mpr (fun he => huv (inv_injective (hinj + ⟨by simpa using hu, by simpa using hu0⟩ ⟨by simpa using hv, by simpa using hv0⟩ he)))) + (sub_ne_zero.mpr (fun he => huv (inv_injective he))) + +theorem divided_fundamental {s : Set ℂ} (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + (u-v)*divided g u v = g u-g v := by + have hh := chordIntegral_deriv_mul hconv hg hu hv + change divided g u v * (v-u) = _ at hh + linear_combination -hh + +theorem divided_derivative_relation {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) {u v : ℂ} (hu : u ∈ s) (hv : v ∈ s) : + divided g u v + (u-v)*dividedLeft g u v = deriv g u := by + have hd := ((hasDerivAt_id u).sub_const v).mul (hasDerivAt_divided_left hs hconv hg hu hv) + have he : (fun z => g z-g v) =ᶠ[𝓝 u] (fun z => (z-v)*divided g z v) := by + filter_upwards [hs.mem_nhds hu] with z hz + exact (divided_fundamental hconv hg hz hv).symm + have hid := (hd.congr_of_eventuallyEq he).unique ((hg u hu).differentiableAt.hasDerivAt.sub_const (g v)) + simpa using hid + +theorem correction_identity {s : Set ℂ} (hs : IsOpen s) (hconv : Convex ℝ s) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g s) (c : ℂ) {u v : ℂ} + (hu : u ∈ s) (hv : v ∈ s) (hv0 : v ≠ 0) (huv : u ≠ v) + (hH : chordDenominator c g u v ≠ 0) : + correction c g u v = (c-u^2*deriv g u)/(c+u*(g u-exterior c g v⁻¹)) - (1-u/v)⁻¹ := by + have hD := divided_fundamental hconv hg hu hv + have hE := divided_derivative_relation hs hconv hg hu hv + have huv' : v-u ≠ 0 := sub_ne_zero.mpr (Ne.symm huv) + have he : c+u*(g u-exterior c g v⁻¹) = chordDenominator c g u v * (v-u)/v := by + simp only [exterior,inv_inv,chordDenominator] + field_simp + linear_combination -u*v*hD + rw [he,correction] + have hd0 : chordDenominator c g u v * (v-u) / v ≠ 0 := div_ne_zero (mul_ne_zero hH huv') hv0 + field_simp + simp only [chordDenominator] + linear_combination -u^2*hE + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/DomainBound.lean b/lean/OAI/Analysis/DirectCrouzeix/DomainBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..db6e87404ed69425330844b3e187241251e8f09f --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/DomainBound.lean @@ -0,0 +1,141 @@ +import OAI.Analysis.DirectCrouzeix.OuterApproximation + +namespace OAI + +universe u_144 u_145 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set + +open scoped ComplexConjugate Matrix + +namespace DirectCrouzeix + +open Set Filter Metric + +theorem expLevel_domain_bound {n m : ℕ} (hn : 0 < n) (hm : 0 < m) + (A : Matrix (Fin n) (Fin n) ℂ) {ι : Type u_144} [Fintype ι] + (v : ι → ℂ) (b : ι → ℝ) (hc : IsCompact {z | Geometry.expLevel v b z ≤ 1}) + (hW : ∀ z ∈ numericalRange A, Geometry.expLevel v b z < 1) + (F : MatrixPolynomial m) + (hF : ∀ z, Geometry.expLevel v b z ≤ 1 → ‖matrixPolynomialValue z F‖ ≤ 1) : + ‖tensorPolynomial A F‖ ≤ 2 := by + obtain ⟨a,ha⟩ := numericalRange_nonempty hn A + obtain ⟨R,hR,c,g,hc0,hg,hinj,hder,hcircle,hout⟩ := + Geometry.exists_expLevel_exterior v b hc (hW a ha) + have hge (ζ : ℂ) (hζ : 1 ≤ ‖ζ‖) : 1 ≤ Geometry.expLevel v b (Faber.exterior c g ζ) := by + rcases eq_or_lt_of_le hζ with he|hl + · exact le_of_eq (hcircle ζ he.symm).symm + · exact le_of_lt (hout ζ hl) + have hs (t : Faber.Angle) (w : ℂ) (hw : Geometry.expLevel v b w ≤ 1) : + 0 ≤ (conj (Faber.boundaryNormal c g t)*(Faber.boundary c g t-w)).re := by + have hdt := Faber.hasDerivAt_exterior hg c (Faber.unitPoint_ne_zero t) (Faber.unitPoint_inv_mem hR t) + have hh := Geometry.expLevel_holomorphic_support v b (hW a ha) (Faber.unitPoint_norm t) + hdt.differentiableAt.hasDerivAt (hder _ (Faber.unitPoint_ne_zero t) (Faber.unitPoint_inv_mem hR t)) hcircle hge hw + have he : Faber.unitPoint t*deriv (Faber.exterior c g) (Faber.unitPoint t) = Faber.boundaryNormal c g t := by + rw [hdt.deriv]; rfl + rw [he,real_inner_eq_re_inner ℂ,RCLike.inner_apply] at hh + change 0 ≤ ((Faber.exterior c g (Faber.unitPoint t)-w)*conj (Faber.boundaryNormal c g t)).re at hh + simpa only [Faber.boundary,mul_comm] using hh + apply exterior_collar_bound hn hm A hR hg hc0 hinj hder + · intro t s + exact hs t _ (le_of_eq (hcircle _ (Faber.unitPoint_norm s))) + · intro ζ hζ hz + have h1 := hge ζ hζ + have h2 := hW _ hz + linarith + · intro t w hw + exact hs t w (le_of_lt (hW w hw)) + · intro t + exact hF _ (le_of_eq (hcircle _ (Faber.unitPoint_norm t))) + +theorem expLevel_domain_bound_scaled {n m : ℕ} (hn : 0 < n) (hm : 0 < m) + (A : Matrix (Fin n) (Fin n) ℂ) {ι : Type u_145} [Fintype ι] + (v : ι → ℂ) (b : ι → ℝ) (hc : IsCompact {z | Geometry.expLevel v b z ≤ 1}) + (hW : ∀ z ∈ numericalRange A, Geometry.expLevel v b z < 1) + (F : MatrixPolynomial m) {ρ : ℝ} (hρ : 0 < ρ) + (hF : ∀ z, Geometry.expLevel v b z ≤ 1 → ‖matrixPolynomialValue z F‖ ≤ ρ) : + ‖tensorPolynomial A F‖ ≤ 2*ρ := by + have hb := expLevel_domain_bound hn hm A v b hc hW (((ρ⁻¹:ℝ):ℂ) • F) (by + intro z hz + rw [matrixPolynomialValue_smul,norm_smul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hρ)] + exact (mul_le_mul_of_nonneg_left (hF z hz) (le_of_lt (inv_pos.mpr hρ))).trans_eq (inv_mul_cancel₀ (ne_of_gt hρ))) + rw [tensorPolynomial_smul,norm_smul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hρ)] at hb + have hh := mul_le_mul_of_nonneg_left hb (le_of_lt hρ) + rw [← mul_assoc,mul_inv_cancel₀ (ne_of_gt hρ),one_mul] at hh + simpa only [mul_comm] using hh + +end DirectCrouzeix + +namespace DirectCrouzeix + +open Set Metric + +end DirectCrouzeix + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/DomainCore.lean b/lean/OAI/Analysis/DirectCrouzeix/DomainCore.lean new file mode 100644 index 0000000000000000000000000000000000000000..7648fc2c1447cf95cbe7ead792e70455230b0cb8 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/DomainCore.lean @@ -0,0 +1,169 @@ +import OAI.Analysis.DirectCrouzeix.PolynomialEnergy + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +open MeasureTheory + +theorem analytic_domain_core {n m : ℕ} (hn : 0 < n) (hm : 0 < m) + (A : Matrix (Fin n) (Fin n) ℂ) (b : ℕ → Polynomial ℂ) (hb0 : b 0 = 1) + (h : BoundaryCircle → ℂ) (hh : Continuous h) + (hexpand : ∀ G : MatrixPolynomial m, ∃ (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + G = faberPolynomial b C) + (hlower : ∀ N (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + ∑ k, hsSq (C k) ≤ polynomialEnergy h (faberPolynomial b C)) + (hupper : ∀ N (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + polynomialEnergy h (faberPolynomial b C) ≤ ∑ k : Fin N, faberWeight k * hsSq (C k)) + (R : BoundaryCircle → Matrix (Fin n) (Fin n) ℂ) (hR : Continuous R) + (hcoeff : ∀ k : ℕ, fourierCoeff R (-(k : ℤ)) = Polynomial.aeval A (b k)) + (hposfreq : ∀ k : ℤ, 0 < k → fourierCoeff R k = 0) + (hpositive : ∀ t, (R t + (R t)ᴴ).PosSemidef) + (F : MatrixPolynomial m) (hF : ∀ t, ‖matrixPolynomialValue (h t) F‖ ≤ 1) : + ‖tensorPolynomial A F‖ ≤ 2 := by + let : NeZero n := ⟨Nat.ne_of_gt hn⟩ + let : NeZero m := ⟨Nat.ne_of_gt hm⟩ + let γ := ‖tensorPolynomial A F‖ + by_cases hγ0 : γ = 0 + · change γ ≤ 2 + rw [hγ0] + norm_num + have hγ : 0 < γ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hγ0) + let T := Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A F) + have hT : ‖T‖ = γ := Matrix.l2_opNorm_toEuclideanCLM _ + obtain ⟨x,y,hx,hy,hxy,hyx⟩ := exists_singular_pair T (hT ▸ hγ) + rw [hT] at hxy hyx + let X := matrixify x + let Y := matrixify y + have hFx : T (hsVector X) = (γ : ℂ) • hsVector Y := by simpa only [X,Y,hsVector_matrixify] using hxy + have hFy : ContinuousLinearMap.adjoint T (hsVector Y) = (γ : ℂ) • hsVector X := by + simpa only [X,Y,hsVector_matrixify] using hyx + let P := fun t => Xᴴ * R t * X + let Q := fun t => Yᴴ * R t * Y + let M := fun t => Yᴴ * R t * X + let L := fun t => Xᴴ * R t * Y + have hC (U V : Matrix (Fin n) (Fin m) ℂ) : + Continuous (fun t => Vᴴ * R t * U) := (compressionCLM U V).continuous.comp hR + have hCp (U V : Matrix (Fin n) (Fin m) ℂ) (k : ℤ) (hk : 0 < k) : + fourierCoeff (fun t => Vᴴ * R t * U) k = 0 := by + rw [fourierCoeff_compression U V R hR,hposfreq k hk] + simp + have hCc (U V : Matrix (Fin n) (Fin m) ℂ) (k : ℕ) : + fourierCoeff (fun t => Vᴴ * R t * U) (-(k : ℤ)) = Vᴴ * Polynomial.aeval A (b k) * U := by + rw [fourierCoeff_compression U V R hR,hcoeff] + have hC0 (U V : Matrix (Fin n) (Fin m) ℂ) : + fourierCoeff (fun t => Vᴴ * R t * U) 0 = Vᴴ * U := by + simpa only [Int.natCast_zero,neg_zero,hb0,map_one,Matrix.mul_one] using hCc U V 0 + let a := ∫ t, hsSq (M t) ∂circleMeasure + have ha : 0 ≤ a := integral_nonneg (fun _ => hsSq_nonneg _) + have hapos : 0 < a := by + have hv := cross_boundary_estimate A b h hexpand hlower R hR hcoeff X Y F + change ‖inner ℂ (hsVector Y) (T (hsVector X))‖^2 ≤ a * polynomialEnergy h F at hv + have hyHS : ‖hsVector Y‖ = 1 := by simpa only [Y,hsVector_matrixify] using hy + rw [hFx,inner_smul_right,inner_self_eq_norm_sq_to_K,hyHS] at hv + by_contra hnot + have ha0 : a = 0 := le_antisymm (not_lt.mp hnot) ha + rw [ha0,zero_mul] at hv + have hv' : γ^2 ≤ 0 := by simpa using hv + nlinarith [sq_pos_of_pos hγ] + have hdiag := singular_diagonal_estimates A b h hh hexpand hlower hupper R hR hcoeff F hF X Y γ hγ hFx hFy + change (_ ≤ a/γ^2) ∧ (_ ≤ a/γ^2) at hdiag + have hPE : (∫ t, hsSq (P t + (P t)ᴴ) ∂circleMeasure) ≤ 4*a/γ^2 := by + rw [anti_diagonal_energy P (hC X X) (hCp X X)] + · have hc0 := hCc X X 0 + have hcs (k : ℕ) := hCc X X (k+1) + simp only [Int.natCast_zero,neg_zero,Nat.cast_add,Nat.cast_one] at hc0 hcs + simp_rw [show P = (fun t => Xᴴ * R t * X) from rfl,hc0,hcs] + simpa only [mul_div_assoc] using mul_le_mul_of_nonneg_left hdiag.1 (by norm_num : (0 : ℝ) ≤ 4) + · rw [hC0 X X] + exact Matrix.isHermitian_conjTranspose_mul_self X + have hQE : (∫ t, hsSq (Q t + (Q t)ᴴ) ∂circleMeasure) ≤ 4*a/γ^2 := by + rw [anti_diagonal_energy Q (hC Y Y) (hCp Y Y)] + · have hc0 := hCc Y Y 0 + have hcs (k : ℕ) := hCc Y Y (k+1) + simp only [Int.natCast_zero,neg_zero,Nat.cast_add,Nat.cast_one] at hc0 hcs + simp_rw [show Q = (fun t => Yᴴ * R t * Y) from rfl,hc0,hcs] + simpa only [mul_div_assoc] using mul_le_mul_of_nonneg_left hdiag.2 (by norm_num : (0 : ℝ) ≤ 4) + · rw [hC0 Y Y] + exact Matrix.isHermitian_conjTranspose_mul_self Y + have hME : a ≤ ∫ t, hsSq (M t + (L t)ᴴ) ∂circleMeasure := by + apply anti_cross_energy M L (hC X Y) (hC Y X) (hCp X Y) (hCp Y X) + rw [hC0 Y X,hC0 X Y] + simp + have hEcont (U V U' V' : Matrix (Fin n) (Fin m) ℂ) : + Continuous (fun t => hsSq (Vᴴ * R t * U + (V'ᴴ * R t * U')ᴴ)) := + continuous_hsSq.comp ((hC U V).add (conjugateTransposeCLM.continuous.comp (hC U' V'))) + have hpi := continuous_integrable_compact circleMeasure (hEcont X X X X) + have hqi := continuous_integrable_compact circleMeasure (hEcont Y Y Y Y) + have hmi := continuous_integrable_compact circleMeasure (hEcont X Y Y X) + have hblock : 2 * (∫ t, hsSq (M t + (L t)ᴴ) ∂circleMeasure) ≤ + (∫ t, hsSq (P t + (P t)ᴴ) ∂circleMeasure) + + ∫ t, hsSq (Q t + (Q t)ᴴ) ∂circleMeasure := by + rw [← integral_const_mul,← integral_add hpi hqi] + exact integral_mono (hmi.const_mul 2) (hpi.add hqi) + (fun t => positive_block_hsSq (positive_compression_blocks (R t) X Y (hpositive t))) + have hb : 2*a ≤ 8*a/γ^2 := by + simp only [mul_div_assoc] at hPE hQE ⊢ + linarith + have hmul := (le_div_iff₀ (sq_pos_of_pos hγ)).mp hb + change γ ≤ 2 + have hg2 : γ^2 ≤ 4 := by nlinarith [hapos] + nlinarith + +theorem faber_expansion_of_degree {m : ℕ} (hm : 0 < m) + (b : ℕ → Polynomial ℂ) (hb : ∀ k, (b k).degree = k) (G : MatrixPolynomial m) : + ∃ (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ), G = faberPolynomial b C := by + classical + let : NeZero m := ⟨Nat.ne_of_gt hm⟩ + let S : Polynomial.Sequence (Matrix (Fin m) (Fin m) ℂ) := + ⟨fun k => scalarMatrixPolynomial (b k),fun k => by + rw [scalarMatrixPolynomial,Polynomial.degree_map,hb]⟩ + have hunit (k : ℕ) : IsUnit (S k).leadingCoeff := by + change IsUnit (scalarMatrixPolynomial (b k)).leadingCoeff + rw [scalarMatrixPolynomial,Polynomial.leadingCoeff_map] + apply IsUnit.map + apply isUnit_iff_ne_zero.mpr + apply Polynomial.leadingCoeff_ne_zero.mpr + apply Polynomial.degree_ne_bot.mp + rw [hb] + exact WithBot.coe_ne_bot + let N := G.natDegree+1 + have himage : Set.range (fun k : Fin N => S k) = S '' Set.Iio N := by + ext p + constructor + · rintro ⟨k,rfl⟩ + exact ⟨k,k.isLt,rfl⟩ + · rintro ⟨k,hk,rfl⟩ + exact ⟨⟨k,hk⟩,rfl⟩ + have hG : G ∈ Submodule.span (Matrix (Fin m) (Fin m) ℂ) (Set.range (fun k : Fin N => S k)) := by + rw [himage,S.span_degreeLT (fun k _ => hunit k),Polynomial.mem_degreeLT] + exact lt_of_le_of_lt G.degree_le_natDegree (by exact_mod_cast Nat.lt_succ_self G.natDegree) + obtain ⟨C,hC⟩ := (Submodule.mem_span_range_iff_exists_fun (Matrix (Fin m) (Fin m) ℂ)).mp hG + refine ⟨N,C,?_⟩ + rw [← hC] + simp only [faberPolynomial,Polynomial.smul_eq_C_mul] + rfl + +end DirectCrouzeix + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/Duality.lean b/lean/OAI/Analysis/DirectCrouzeix/Duality.lean new file mode 100644 index 0000000000000000000000000000000000000000..6023e50cc85a8415e3bd8af16f3f42fa4de8ecfb --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Duality.lean @@ -0,0 +1,85 @@ +import OAI.Analysis.DirectCrouzeix.SingularPairs + +namespace OAI + +universe u_41 u_42 u_43 u_44 u_45 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +theorem weighted_coefficient_dual {ρ : Type u_41} {ι : Type u_42} {κ : Type u_43} + [Fintype ρ] [Fintype ι] [Fintype κ] + (P : ρ → Matrix ι κ ℂ) (w : ρ → ℝ) (hw : ∀ k, 0 < w k) + (b : ℝ) (hb : 0 ≤ b) + (h : ∀ C : ρ → Matrix ι κ ℂ, + ‖∑ k, entryPair (P k) (C k)‖ ^ 2 ≤ b * ∑ k, w k * hsSq (C k)) : + (∑ k, hsSq (P k) / w k) ≤ b := by + let C : ρ → Matrix ι κ ℂ := fun k => ((w k : ℂ)⁻¹) • (P k).map star + let s : ℝ := ∑ k, hsSq (P k) / w k + have hs : 0 ≤ s := Finset.sum_nonneg (fun k _ => div_nonneg (hsSq_nonneg _) (hw k).le) + have hp : (∑ k, entryPair (P k) (C k)) = (s : ℂ) := by + simp only [C, entryPair_smul_right, entryPair_conj, s, Complex.ofReal_sum, + Complex.ofReal_div] + apply Finset.sum_congr rfl + intro k _ + simp only [div_eq_mul_inv] + ring + have he : (∑ k, w k * hsSq (C k)) = s := by + apply Finset.sum_congr rfl + intro k _ + simp only [C, hsSq_smul, hsSq_map_star, norm_inv, Complex.norm_real, + Real.norm_eq_abs, abs_of_pos (hw k)] + field_simp + have ht := h C + rw [hp, he, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hs] at ht + by_cases hs0 : s = 0 + · change s ≤ b + simpa [hs0] using hb + · have hspos : 0 < s := lt_of_le_of_ne hs (Ne.symm hs0) + change s ≤ b + apply (mul_le_mul_iff_left₀ hspos).mp + nlinarith + +open MeasureTheory + +theorem weighted_integral_norm_sq_le {α : Type u_44} {E : Type u_45} [MeasurableSpace α] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + (μ : Measure α) (k : α → ℝ) (u : α → E) + (hk : ∀ x, 0 ≤ k x) (hki : Integrable k μ) + (hui : Integrable (fun x => k x • u x) μ) + (hsqi : Integrable (fun x => k x * ‖u x‖ ^ 2) μ) + (hmass : ∫ x, k x ∂μ = 1) : + ‖∫ x, k x • u x ∂μ‖ ^ 2 ≤ ∫ x, k x * ‖u x‖ ^ 2 ∂μ := by + let v := ∫ x, k x • u x ∂μ + have hii : Integrable (fun x => inner ℝ v (k x • u x)) μ := + (innerSL ℝ v).integrable_comp hui + have hi : (∫ x, inner ℝ v (k x • u x) ∂μ) = ‖v‖ ^ 2 := by + change (∫ x, (innerSL ℝ v) (k x • u x) ∂μ) = _ + rw [(innerSL ℝ v).integral_comp_comm hui] + exact real_inner_self_eq_norm_sq v + have hn : 0 ≤ ∫ x, k x * ‖u x - v‖ ^ 2 ∂μ := + integral_nonneg (fun x => mul_nonneg (hk x) (sq_nonneg _)) + have hexp : (fun x => k x * ‖u x - v‖ ^ 2) = + fun x => (k x * ‖u x‖ ^ 2 - 2 * inner ℝ v (k x • u x)) + k x * ‖v‖ ^ 2 := by + funext x + rw [norm_sub_sq_real, inner_smul_right, real_inner_comm v (u x)] + ring + rw [hexp] at hn + have hsubi : Integrable (fun x => k x * ‖u x‖ ^ 2 - 2 * inner ℝ v (k x • u x)) μ := + hsqi.sub (hii.const_mul 2) + have hconsti : Integrable (fun x => k x * ‖v‖ ^ 2) μ := hki.mul_const _ + rw [integral_add hsubi hconsti, integral_sub hsqi (hii.const_mul 2), + integral_const_mul, integral_mul_const, hi, hmass] at hn + change ‖v‖ ^ 2 ≤ _ + linarith + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean b/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c6e2082ffc443768683b2a39bff1b194fb385e4 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean @@ -0,0 +1,177 @@ +import OAI.Analysis.DirectCrouzeix.AnalyticCharts + +namespace OAI + +universe u_135 u_136 u_137 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +variable {ι : Type u_135} [Fintype ι] + +def expGradient (v : ι → ℂ) (b : ι → ℝ) (z : ℂ) : ℂ := + ∑ i, Real.exp (inner ℝ (v i) z+b i) • v i + +theorem expLevel_contDiff (v : ι → ℂ) (b : ι → ℝ) : ContDiff ℝ ⊤ (expLevel v b) := by + apply ContDiff.sum + intro i hi + exact ((innerSL ℝ (v i)).contDiff.add contDiff_const).exp + +theorem expLevel_hasFDerivAt (v : ι → ℂ) (b : ι → ℝ) (z : ℂ) : + HasFDerivAt (expLevel v b) (innerSL ℝ (expGradient v b z)) z := by + have hh := HasFDerivAt.fun_sum (x := z) (u := Finset.univ) (fun i _ => + (((innerSL ℝ (v i)).hasFDerivAt).add_const (b i)).exp) + convert! hh using 1 + ext w + simp only [expGradient,innerSL_apply_apply,sum_inner,real_inner_smul_left,sum_apply,smul_apply,smul_eq_mul] + +theorem expLevel_first_order (v : ι → ℂ) (b : ι → ℝ) (z w : ℂ) : + expLevel v b z + inner ℝ (expGradient v b z) (w-z) ≤ expLevel v b w := by + have hh (i : ι) : + Real.exp (inner ℝ (v i) z+b i) + Real.exp (inner ℝ (v i) z+b i)*inner ℝ (v i) (w-z) ≤ + Real.exp (inner ℝ (v i) w+b i) := by + have ht := mul_le_mul_of_nonneg_left (Real.add_one_le_exp (inner ℝ (v i) (w-z))) + (Real.exp_nonneg (inner ℝ (v i) z+b i)) + rw [← Real.exp_add] at ht + have he : inner ℝ (v i) z+b i+inner ℝ (v i) (w-z) = inner ℝ (v i) w+b i := by + rw [inner_sub_right]; ring + rw [he] at ht + linarith + have hs := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hh i) + simpa only [expLevel,expGradient,sum_inner,real_inner_smul_left,Finset.sum_add_distrib] using hs + +theorem expGradient_ne_zero (v : ι → ℂ) (b : ι → ℝ) {p a : ℂ} + (hp : expLevel v b p = 1) (ha : expLevel v b a < 1) : expGradient v b p ≠ 0 := by + intro he + have hh := expLevel_first_order v b p a + rw [he,inner_zero_left,hp,add_zero] at hh + linarith + +theorem expLevel_convex (v : ι → ℂ) (b : ι → ℝ) : ConvexOn ℝ univ (expLevel v b) := by + refine ⟨convex_univ,?_⟩ + intro x hx y hy a c ha hc hac + have hh (i : ι) := convexOn_exp.2 (show inner ℝ (v i) x+b i ∈ univ from mem_univ _) + (show inner ℝ (v i) y+b i ∈ univ from mem_univ _) ha hc hac + have he (i : ι) : inner ℝ (v i) (a • x+c • y)+b i = + a*(inner ℝ (v i) x+b i)+c*(inner ℝ (v i) y+b i) := by + simp only [inner_add_right,inner_smul_right] + have hb := congrArg (fun u : ℝ => u*b i) hac + nlinarith + simp only [expLevel,he] + simpa [smul_eq_mul,Finset.sum_add_distrib,Finset.mul_sum] using + Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hh i) + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +variable {ι : Type u_136} [Fintype ι] + +def expComplex (α β γ : ι → ℝ) (z : ℂ × ℂ) : ℂ := + ∑ i, Complex.exp ((γ i:ℂ)+(α i:ℂ)*z.1+(β i:ℂ)*z.2) + +theorem expComplex_analytic (α β γ : ι → ℝ) (z : ℂ × ℂ) : AnalyticAt ℂ (expComplex α β γ) z := by + apply Finset.analyticAt_fun_sum + intro i hi + exact ((analyticAt_const.add (analyticAt_const.mul analyticAt_fst)).add + (analyticAt_const.mul analyticAt_snd)).cexp + +theorem expComplex_zero (α β γ : ι → ℝ) : expComplex α β γ 0 = (∑ i, Real.exp (γ i):ℝ) := by + simp [expComplex,Complex.ofReal_exp] + +theorem expComplex_conj (α β γ : ι → ℝ) (z : ℂ × ℂ) : + expComplex α β γ (conj z.1,conj z.2) = conj (expComplex α β γ z) := by + simp only [expComplex,map_sum] + apply Finset.sum_congr rfl + intro i hi + rw [← Complex.exp_conj] + congr 1 + simp + +theorem expComplex_real (α β γ : ι → ℝ) (x y : ℝ) : + expComplex α β γ (x,y) = (∑ i, Real.exp (γ i+α i*x+β i*y):ℝ) := by + simp [expComplex,Complex.ofReal_exp] + +theorem expComplex_hasFDerivAt_zero (α β γ : ι → ℝ) : + HasFDerivAt (expComplex α β γ) + (((∑ i, Real.exp (γ i)*α i : ℝ):ℂ) • ContinuousLinearMap.fst ℂ ℂ ℂ + + ((∑ i, Real.exp (γ i)*β i : ℝ):ℂ) • ContinuousLinearMap.snd ℂ ℂ ℂ) 0 := by + have hh := HasFDerivAt.fun_sum (x := (0:ℂ × ℂ)) (u := Finset.univ) (fun i _ => + (((hasFDerivAt_const (γ i:ℂ) (0:ℂ × ℂ)).add + ((hasFDerivAt_fst (𝕜 := ℂ) (p := (0:ℂ × ℂ))).const_mul (α i:ℂ))).add + ((hasFDerivAt_snd (𝕜 := ℂ) (p := (0:ℂ × ℂ))).const_mul (β i:ℂ))).cexp) + convert! hh using 1 + apply ContinuousLinearMap.ext + intro z + simp [Complex.ofReal_exp,Finset.sum_mul,Finset.sum_add_distrib,mul_assoc] + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +theorem closure_strict_level {f : ℂ → ℝ} (hc : Continuous f) + (hv : ConvexOn ℝ univ f) {a : ℂ} (ha : f a < 1) : + closure {z | f z < 1} = {z | f z ≤ 1} := by + apply Subset.antisymm + · apply closure_minimal + · intro z hz + exact (show f z < 1 from hz).le + · exact isClosed_le hc continuous_const + · intro z hz + let y := fun t : ℝ => (1-t) • z+t • a + have hy : Continuous y := by fun_prop + apply mem_closure_of_tendsto (b := 𝓝[>] (0:ℝ)) ((hy.tendsto' 0 z (by simp [y])).mono_left nhdsWithin_le_nhds) + filter_upwards [Ioo_mem_nhdsGT (by norm_num : (0:ℝ)<1)] with t ht + have hh := hv.2 (mem_univ z) (mem_univ a) (sub_nonneg.mpr (le_of_lt ht.2)) (le_of_lt ht.1) (sub_add_cancel 1 t) + change f (y t) ≤ (1-t)*f z+t*f a at hh + change f (y t) < 1 + have h1 := mul_le_mul_of_nonneg_left hz (sub_nonneg.mpr (le_of_lt ht.2)) + have h2 := mul_lt_mul_of_pos_left ha ht.1 + nlinarith + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +variable {ι : Type u_137} [Fintype ι] + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/ExponentialSupport.lean b/lean/OAI/Analysis/DirectCrouzeix/ExponentialSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..ceece18c23a7f6d6c073a9be4d31a875aeb476b3 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/ExponentialSupport.lean @@ -0,0 +1,175 @@ +import OAI.Analysis.DirectCrouzeix.Convexity + +namespace OAI + +universe u_143 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set + +open scoped ComplexConjugate Matrix + +namespace DirectCrouzeix.Geometry + +theorem positive_parallel_of_complex_inner {G q : ℂ} (hG : G ≠ 0) (hq : q ≠ 0) + (horth : inner ℝ G (Complex.I*q) = 0) (hpos : 0 ≤ inner ℝ G q) : + ∃ t : ℝ, 0 < t ∧ q = t • G := by + have him : (conj G*q).im = 0 := by + rw [real_inner_eq_re_inner ℂ,RCLike.inner_apply] at horth + change ((Complex.I*q)*conj G).re = 0 at horth + simp only [Complex.mul_re,Complex.mul_im,Complex.I_re,Complex.I_im,Complex.conj_re,Complex.conj_im] at horth ⊢ + nlinarith + have hre : (conj G*q).re = inner ℝ G q := by + simp [real_inner_eq_re_inner ℂ,RCLike.inner_apply,mul_comm] + have hnon : inner ℝ G q ≠ 0 := by + intro hh + have he : conj G*q = 0 := Complex.ext (by simpa [hre] using hh) (by simpa using him) + exact mul_ne_zero ((map_ne_zero (starRingEnd ℂ)).mpr hG) hq he + have hp : 0 < inner ℝ G q := lt_of_le_of_ne hpos (Ne.symm hnon) + let t := inner ℝ G q/‖G‖^2 + refine ⟨t,div_pos hp (sq_pos_of_pos (norm_pos_iff.mpr hG)),?_⟩ + have hprod : conj G*q = (inner ℝ G q:ℂ) := by + apply Complex.ext <;> simp [hre,him] + have hGG : conj G*G = ((‖G‖^2:ℝ):ℂ) := by + rw [← Complex.normSq_eq_conj_mul_self,Complex.normSq_eq_norm_sq] + apply mul_left_cancel₀ ((map_ne_zero (starRingEnd ℂ)).mpr hG : conj G ≠ 0) + rw [hprod,Complex.real_smul,mul_left_comm,hGG] + dsimp only [t] + rw [Complex.ofReal_div,Complex.ofReal_pow,div_mul_cancel₀ _ (pow_ne_zero _ (Complex.ofReal_ne_zero.mpr (norm_ne_zero_iff.mpr hG)))] + +theorem expLevel_holomorphic_support {ι : Type u_143} [Fintype ι] + (v : ι → ℂ) (b : ι → ℝ) {a : ℂ} (ha : expLevel v b a < 1) + {ψ : ℂ → ℂ} {ζ : ℂ} (hζ : ‖ζ‖ = 1) + (hd : HasDerivAt ψ (deriv ψ ζ) ζ) (hdn : deriv ψ ζ ≠ 0) + (hcircle : ∀ η : ℂ, ‖η‖ = 1 → expLevel v b (ψ η) = 1) + (hout : ∀ η : ℂ, 1 ≤ ‖η‖ → 1 ≤ expLevel v b (ψ η)) + {w : ℂ} (hw : expLevel v b w ≤ 1) : + 0 ≤ inner ℝ (ζ*deriv ψ ζ) (ψ ζ-w) := by + let G := expGradient v b (ψ ζ) + let q := ζ*deriv ψ ζ + have hζ0 : ζ ≠ 0 := by intro hh; simp [hh] at hζ + have hq : q ≠ 0 := mul_ne_zero hζ0 hdn + have hlevel : expLevel v b (ψ ζ) = 1 := hcircle ζ hζ + have hG : G ≠ 0 := expGradient_ne_zero v b hlevel ha + have hφd : HasFDerivAt (expLevel v b) (innerSL ℝ G) (ψ ζ) := expLevel_hasFDerivAt v b (ψ ζ) + have horth : inner ℝ G (Complex.I*q) = 0 := by + let e := fun t : ℝ => ζ*Complex.exp ((t:ℂ)*Complex.I) + have he0 : e 0 = ζ := by simp [e] + have hed : HasDerivAt e (ζ*Complex.I) 0 := by + have hi : HasDerivAt (fun t : ℝ => (t:ℂ)) 1 0 := by + simpa only [Complex.ofRealCLM_apply,Complex.ofReal_one] using! (Complex.ofRealCLM.hasDerivAt (x := (0:ℝ))) + convert! ((hi.mul_const Complex.I).cexp).const_mul ζ using 1 ; simp + have hψd := (show HasDerivAt ψ (deriv ψ ζ) (e 0) from he0 ▸ hd).scomp 0 hed + have hcomp := (show HasFDerivAt (expLevel v b) (innerSL ℝ G) (ψ (e 0)) from he0 ▸ hφd).comp_hasDerivAt 0 hψd + have hc : (fun t : ℝ => expLevel v b (ψ (e t))) = fun _ => 1 := by + funext t + apply hcircle + simp [e,hζ,Complex.norm_exp] + have hv : deriv (fun t : ℝ => expLevel v b (ψ (e t))) 0 = 0 := by rw [hc]; simp + have heval : inner ℝ G (Complex.I*q) = (innerSL ℝ G) ((ζ*Complex.I) • deriv ψ ζ) := by + simp only [innerSL_apply_apply,smul_eq_mul,q]; congr 1; ring + rw [heval,← hcomp.deriv] + exact hv + have hpos : 0 ≤ inner ℝ G q := by + let r := fun t : ℝ => (t:ℂ)*ζ + have hr1 : r 1 = ζ := by simp [r] + have hrd : HasDerivAt r ζ 1 := by + have hi : HasDerivAt (fun t : ℝ => (t:ℂ)) 1 1 := by + simpa only [Complex.ofRealCLM_apply,Complex.ofReal_one] using! (Complex.ofRealCLM.hasDerivAt (x := (1:ℝ))) + convert! hi.mul_const ζ using 1 ; simp + have hψd := (show HasDerivAt ψ (deriv ψ ζ) (r 1) from hr1 ▸ hd).scomp 1 hrd + have hcomp := (show HasFDerivAt (expLevel v b) (innerSL ℝ G) (ψ (r 1)) from hr1 ▸ hφd).comp_hasDerivAt 1 hψd + have hmin : IsMinOn (fun t : ℝ => expLevel v b (ψ (r t))) (Ici 1) 1 := by + intro t ht + change expLevel v b (ψ (r 1)) ≤ expLevel v b (ψ (r t)) + rw [hr1,hlevel] + apply hout + have ht0 : 0 ≤ t := le_trans (by norm_num) ht + simpa [r,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg ht0,hζ] using ht + have htan : (1:ℝ) ∈ posTangentConeAt (Ici 1) 1 := by + apply mem_posTangentConeAt_of_segment_subset + exact (convex_Ici (1:ℝ)).segment_subset (by norm_num) (by norm_num) + have hh := hmin.isLocalMinOn.hasFDerivWithinAt_nonneg hcomp.hasFDerivAt.hasFDerivWithinAt htan + simpa [q] using hh + obtain ⟨t,ht,hqeq⟩ := positive_parallel_of_complex_inner hG hq horth hpos + have hs := expLevel_first_order v b (ψ ζ) w + rw [hlevel,show expGradient v b (ψ ζ) = G from rfl] at hs + have hsupport : 0 ≤ inner ℝ G (ψ ζ-w) := by + rw [inner_sub_right] at hs ⊢ + linarith + change 0 ≤ inner ℝ q (ψ ζ-w) + rw [hqeq,real_inner_smul_left] + exact mul_nonneg (le_of_lt ht) hsupport + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/ExteriorCollar.lean b/lean/OAI/Analysis/DirectCrouzeix/ExteriorCollar.lean new file mode 100644 index 0000000000000000000000000000000000000000..84fc72e9a7afd7bc980589285aa45630c270bea0 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/ExteriorCollar.lean @@ -0,0 +1,120 @@ +import OAI.Analysis.DirectCrouzeix.FaberCalculus + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix + +open MeasureTheory Set Filter Metric + +open scoped Topology ComplexConjugate MatrixOrder ComplexOrder + +theorem faber_matrix_coefficient_bounds {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, Faber.chordDenominator c g u v ≠ 0) + (hpositive : ∀ t s, 0 ≤ Faber.boundaryKernel c g t s) + {m N : ℕ} (C : Fin N → Matrix (Fin m) (Fin m) ℂ) : + (∑ k, hsSq (C k) ≤ polynomialEnergy (Faber.boundary c g) (faberPolynomial (Faber.faberBasis c g) C)) + ∧ + (polynomialEnergy (Faber.boundary c g) (faberPolynomial (Faber.faberBasis c g) C) ≤ + ∑ k : Fin N, faberWeight k * hsSq (C k)) := by + have hh := Faber.faber_hilbert_coefficient_bounds hR hg hc hH hpositive (fun k => hsVector (C k)) + have he (t : Faber.Angle) : + Faber.faberBoundarySeries c g (fun k => hsVector (C k)) t = + hsVector (matrixPolynomialValue (Faber.boundary c g t) (faberPolynomial (Faber.faberBasis c g) C)) := by + rw [matrixPolynomialValue_faber] + ext p + simp [Faber.faberBoundarySeries,hsVector,Matrix.sum_apply,Matrix.smul_apply] + simp_rw [he,← hsSq_eq_norm_hsVector_sq] at hh + exact hh + +theorem faber_resolvent_data {n : ℕ} (hn : 0 < n) + (A : Matrix (Fin n) (Fin n) ℂ) {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + (houtside : ∀ ζ : ℂ, 1 ≤ ‖ζ‖ → Faber.exterior c g ζ ∉ numericalRange A) + (hsupport : ∀ t, ∀ w ∈ numericalRange A, + 0 ≤ (conj (Faber.boundaryNormal c g t) * (Faber.boundary c g t-w)).re) : + ∃ Q : BoundaryCircle → Matrix (Fin n) (Fin n) ℂ, + Continuous Q ∧ + (∀ k : ℕ, fourierCoeff Q (-(k:ℤ)) = Polynomial.aeval A (Faber.faberBasis c g k)) ∧ + (∀ k : ℤ, 0 < k → fourierCoeff Q k = 0) ∧ + (∀ t, (Q t+(Q t)ᴴ).PosSemidef) := by + let : NeZero n := ⟨Nat.ne_of_gt hn⟩ + let Q := fun t : Faber.Angle => Faber.algebraGenerating c g A (Faber.unitPoint t)⁻¹ + have hu : ∀ u ∈ closedBall (0:ℂ) 1, IsUnit (Faber.algebraDenominator c g A u) := by + intro u hu + by_cases hu0 : u = 0 + · subst u + simpa [Faber.algebraDenominator,Algebra.smul_def] using + (isUnit_iff_ne_zero.mpr hc).map (algebraMap ℂ (Matrix (Fin n) (Fin n) ℂ)) + · rw [Faber.algebraDenominator_exterior c g A hu0,Algebra.smul_def] + apply IsUnit.mul ((isUnit_iff_ne_zero.mpr hu0).map (algebraMap ℂ _)) + apply isUnit_resolvent_of_not_mem A + apply houtside + rw [norm_inv,one_le_inv₀ (norm_pos_iff.mpr hu0)] + simpa [mem_closedBall,dist_zero_right] using hu + have hd := Faber.algebraGenerating_fourier hR hc hg A hu + refine ⟨Q,hd.1,hd.2.1,hd.2.2,?_⟩ + intro t + have he : Q t = Faber.boundaryNormal c g t • (Faber.boundary c g t • 1-A)⁻¹ := by + change Faber.algebraGenerating c g A (Faber.unitPoint t)⁻¹ = _ + rw [Faber.algebraGenerating_exterior c g A (Faber.unitPoint_ne_zero t)] + rw [Matrix.nonsing_inv_eq_ringInverse] + rfl + rw [he] + exact positive_resolvent A _ _ (houtside _ (by rw [Faber.unitPoint_norm])) (hsupport t) + +theorem exterior_collar_bound {n m : ℕ} (hn : 0 < n) (hm : 0 < m) + (A : Matrix (Fin n) (Fin n) ℂ) {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + (hinj : InjOn (Faber.exterior c g) (Inv.inv ⁻¹' ball 0 R \ {0})) + (hder : ∀ ζ : ℂ, ζ ≠ 0 → ζ⁻¹ ∈ ball 0 R → deriv (Faber.exterior c g) ζ ≠ 0) + (hboundary : ∀ t s, 0 ≤ (conj (Faber.boundaryNormal c g t) * + (Faber.boundary c g t-Faber.boundary c g s)).re) + (houtside : ∀ ζ : ℂ, 1 ≤ ‖ζ‖ → Faber.exterior c g ζ ∉ numericalRange A) + (hsupport : ∀ t, ∀ w ∈ numericalRange A, + 0 ≤ (conj (Faber.boundaryNormal c g t) * (Faber.boundary c g t-w)).re) + (F : MatrixPolynomial m) (hF : ∀ t, ‖matrixPolynomialValue (Faber.boundary c g t) F‖ ≤ 1) : + ‖tensorPolynomial A F‖ ≤ 2 := by + have hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, Faber.chordDenominator c g u v ≠ 0 := + fun _ hu _ hv => Faber.chordDenominator_ne_zero (convex_ball 0 R) hg hc hinj hder hu hv + have hp := Faber.boundaryKernel_nonnegative hR hg hH hboundary + have hcs (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ) := faber_matrix_coefficient_bounds hR hg hc hH hp C + obtain ⟨Q,hQ,hcoeff,hpos,hPSD⟩ := faber_resolvent_data hn A hR hg hc houtside hsupport + apply analytic_domain_core hn hm A (Faber.faberBasis c g) (Faber.faberBasis_zero hc g) + (Faber.boundary c g) (Faber.continuous_boundary hR hg c) + (faber_expansion_of_degree hm _ (Faber.faberBasis_degree hc (hg 0 (mem_ball_self (by linarith))))) + (fun N C => (hcs N C).1) (fun N C => (hcs N C).2) Q hQ hcoeff hpos hPSD F hF + +end DirectCrouzeix + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/ExteriorMapping.lean b/lean/OAI/Analysis/DirectCrouzeix/ExteriorMapping.lean new file mode 100644 index 0000000000000000000000000000000000000000..28af98f3e4c6861027a98c240ce6b6a34e8578e8 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/ExteriorMapping.lean @@ -0,0 +1,227 @@ +import OAI.Analysis.DirectCrouzeix.InverseExterior + +namespace OAI + +universe u_138 u_139 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +theorem exterior_laurent_form {R : ℝ} (hR : 0 < R) {f : ℂ → ℂ} + (hf : AnalyticOnNhd ℂ f (ball 0 R)) (hinj : InjOn f (ball 0 R)) + (hf0 : f 0 = 0) (hd : ∀ u ∈ ball 0 R, deriv f u ≠ 0) (a : ℂ) : + ∃ (c : ℂ) (g : ℂ → ℂ), c ≠ 0 ∧ AnalyticOnNhd ℂ g (ball 0 R) ∧ + (∀ ζ : ℂ, ζ ≠ 0 → c*ζ+g ζ⁻¹ = a+(f ζ⁻¹)⁻¹) ∧ + InjOn (fun ζ => c*ζ+g ζ⁻¹) (Inv.inv ⁻¹' ball 0 R \ {0}) ∧ + (∀ ζ : ℂ, ζ ≠ 0 → ζ⁻¹ ∈ ball 0 R → deriv (fun ζ => c*ζ+g ζ⁻¹) ζ ≠ 0) := by + have h0 : (0:ℂ) ∈ ball 0 R := mem_ball_self hR + let J := dslope f 0 + have hJ : AnalyticOnNhd ℂ J (ball 0 R) := + (Complex.differentiableOn_dslope (ball_mem_nhds (0:ℂ) hR)).mpr hf.differentiableOn |>.analyticOnNhd isOpen_ball + have hJ0 : J 0 = deriv f 0 := dslope_same _ _ + have hfn (u : ℂ) (hu : u ∈ ball 0 R) (hu0 : u ≠ 0) : f u ≠ 0 := by + intro he + exact hu0 (hinj hu h0 (he.trans hf0.symm)) + have hJn (u : ℂ) (hu : u ∈ ball 0 R) : J u ≠ 0 := by + by_cases hu0 : u = 0 + · subst u; rw [hJ0]; exact hd 0 h0 + · dsimp only [J] + rw [dslope_of_ne _ hu0] + simp only [slope_def_field,hf0,sub_zero] + exact div_ne_zero (hfn u hu hu0) hu0 + let F := fun u => (J u)⁻¹ + have hF : AnalyticOnNhd ℂ F (ball 0 R) := fun u hu => (hJ u hu).inv (hJn u hu) + let c := F 0 + have hc : c ≠ 0 := inv_ne_zero (hJn 0 h0) + let g := fun u => a+dslope F 0 u + have hg : AnalyticOnNhd ℂ g (ball 0 R) := by + have hs : AnalyticOnNhd ℂ (dslope F 0) (ball 0 R) := + (Complex.differentiableOn_dslope (ball_mem_nhds (0:ℂ) hR)).mpr hF.differentiableOn |>.analyticOnNhd isOpen_ball + exact analyticOnNhd_const.add hs + have he (ζ : ℂ) (hζ : ζ ≠ 0) : c*ζ+g ζ⁻¹ = a+(f ζ⁻¹)⁻¹ := by + have hu : ζ⁻¹ ≠ 0 := inv_ne_zero hζ + dsimp only [g] + rw [dslope_of_ne _ hu,slope_def_field] + dsimp only [F,J,c] + rw [dslope_of_ne _ hu,slope_def_field,hf0] + simp only [sub_zero,div_inv_eq_mul] + field_simp + ring + have hder (ζ : ℂ) (hζ : ζ ≠ 0) (hu : ζ⁻¹ ∈ ball 0 R) : + HasDerivAt (fun ζ => a+(f ζ⁻¹)⁻¹) + (- (deriv f ζ⁻¹ * (-1/ζ^2))/(f ζ⁻¹)^2) ζ := by + have hi : HasDerivAt (fun ζ : ℂ => ζ⁻¹) (-1/ζ^2) ζ := by + convert! (hasDerivAt_id ζ).inv hζ using 1 + have hh := ((hf _ hu).differentiableAt.hasDerivAt.comp ζ hi).inv (hfn _ hu (inv_ne_zero hζ)) + convert! hh.const_add a using 1 + refine ⟨c,g,hc,hg,he,?_,?_⟩ + · intro ζ hζ η hη hh + have hζ0 : ζ ≠ 0 := hζ.2 + have hη0 : η ≠ 0 := hη.2 + change c*ζ+g ζ⁻¹ = c*η+g η⁻¹ at hh + rw [he ζ hζ0,he η hη0,add_right_inj] at hh + exact inv_injective (hinj hζ.1 hη.1 (inv_injective hh)) + · intro ζ hζ hu + have hev : (fun ζ => c*ζ+g ζ⁻¹) =ᶠ[𝓝 ζ] (fun ζ => a+(f ζ⁻¹)⁻¹) := by + filter_upwards [continuousAt_id.eventually_ne hζ] with z hz + exact he z hz + rw [((hder ζ hζ hu).congr_of_eventuallyEq hev).deriv] + exact div_ne_zero (neg_ne_zero.mpr (mul_ne_zero (hd _ hu) + (div_ne_zero (by norm_num) (pow_ne_zero _ hζ)))) (pow_ne_zero _ (hfn _ hu (inv_ne_zero hζ))) + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +theorem inverseExterior_analytic_boundary {ι : Type u_138} [Fintype ι] + (v : ι → ℂ) (b : ι → ℝ) (hc : IsCompact {z | expLevel v b z ≤ 1}) + {a : ℂ} (ha : expLevel v b a < 1) : + Conformal.HasAnalyticBoundary (inverseExterior (expLevel v b) a) := by + intro w hw + obtain ⟨hw0,hlevel⟩ := inverseExterior_frontier_level (expLevel_contDiff v b).continuous hc hw + obtain ⟨H,hHa,hH0,hHd,hside⟩ := expLevel_boundary_parametrization v b hlevel ha + let k := fun z : ℂ => (H (-z)-a)⁻¹ + have hpa : H 0-a ≠ 0 := by rw [hH0,add_sub_cancel_left]; exact inv_ne_zero hw0 + have hk0 : k 0 = w := by simp [k,hH0] + have hHneg : AnalyticAt ℂ (fun z : ℂ => H (-z)) 0 := by + exact (show AnalyticAt ℂ H (-(0:ℂ)) from by simpa using hHa).comp analyticAt_id.neg + have hka : AnalyticAt ℂ k 0 := (hHneg.sub analyticAt_const).inv (by simpa using hpa) + have hkder : HasDerivAt k (deriv H 0/(H 0-a)^2) 0 := by + have hdn := (show HasDerivAt H (deriv H 0) (-(0:ℂ)) from by simpa using hHa.differentiableAt.hasDerivAt).comp 0 (hasDerivAt_id (0:ℂ)).neg + convert! (hdn.sub_const a).inv (by simpa using hpa) using 1 ; simp + have hkdn : deriv k 0 ≠ 0 := by rw [hkder.deriv]; exact div_ne_zero hHd (pow_ne_zero _ hpa) + have hkP : ∀ᶠ z in 𝓝 (0:ℂ), k z ∈ inverseExterior (expLevel v b) a ↔ 0 < z.im := by + have ht : Tendsto (fun z : ℂ => -z) (𝓝 0) (𝓝 0) := by simpa using continuous_neg.tendsto (0:ℂ) + have hne : ∀ᶠ z in 𝓝 (0:ℂ), H (-z)-a ≠ 0 := + (hHneg.continuousAt.sub continuousAt_const).eventually_ne (by simpa using hpa) + filter_upwards [ht.eventually hside,hne] with z hz hzne + rw [mem_inverseExterior_iff (show k z ≠ 0 from inv_ne_zero hzne)] + dsimp only [k] + rw [inv_inv,add_sub_cancel] + simpa only [Complex.neg_im,neg_lt_zero] using hz.2 + obtain ⟨C,hC,hC0,hCa,hCi,hCd,hCP⟩ := analytic_complex_chart hka hkdn hkP + exact ⟨⟨C,hC0,by rw [hC,hk0],hCa,hCi,by rwa [hk0] at hCd,by simpa only [hC] using hCP⟩⟩ + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix.Geometry + +theorem exists_expLevel_exterior {ι : Type u_139} [Fintype ι] + (v : ι → ℂ) (b : ι → ℝ) (hc : IsCompact {z | expLevel v b z ≤ 1}) + {a : ℂ} (ha : expLevel v b a < 1) : + ∃ R > 1, ∃ (c : ℂ) (g : ℂ → ℂ), c ≠ 0 ∧ AnalyticOnNhd ℂ g (ball 0 R) ∧ + InjOn (fun ζ => c*ζ+g ζ⁻¹) (Inv.inv ⁻¹' ball 0 R \ {0}) ∧ + (∀ ζ : ℂ, ζ ≠ 0 → ζ⁻¹ ∈ ball 0 R → deriv (fun ζ => c*ζ+g ζ⁻¹) ζ ≠ 0) ∧ + (∀ ζ : ℂ, ‖ζ‖ = 1 → expLevel v b (c*ζ+g ζ⁻¹) = 1) ∧ + (∀ ζ : ℂ, 1 < ‖ζ‖ → 1 < expLevel v b (c*ζ+g ζ⁻¹)) := by + let U := inverseExterior (expLevel v b) a + have hct := (expLevel_contDiff v b).continuous + have hU : IsOpen U := inverseExterior_isOpen hct hc a + obtain ⟨R,hR,f,hfa,hfi,hopen,hclosed,hf0,hfd⟩ := Conformal.exists_riemann_collar hU + (inverseExterior_simplyConnected (expLevel_convex v b) ha) + (inverseExterior_proper hct ha) (inverseExterior_compact_closure hct ha) + (inverseExterior_analytic_boundary v b hc ha) (zero_mem_inverseExterior _ a) + obtain ⟨c,g,hc0,hg,he,hi,hd⟩ := exterior_laurent_form (by linarith : 0 < R) hfa hfi hf0 hfd a + refine ⟨R,hR,c,g,hc0,hg,hi,hd,?_,?_⟩ + · intro ζ hζ + have hζ0 : ζ ≠ 0 := by intro hh; norm_num [hh] at hζ + have hη : ‖ζ⁻¹‖ = 1 := by simp [norm_inv,hζ] + have hηR : ζ⁻¹ ∈ ball 0 R := mem_ball_zero_iff.mpr (by rw [hη]; exact hR) + have hfu : f ζ⁻¹ ∈ frontier U := by + rw [frontier,hU.interior_eq] + refine ⟨?_,?_⟩ + · rw [← hclosed] + exact mem_image_of_mem f (mem_closedBall_zero_iff.mpr (by rw [hη])) + · intro hh + rw [← hopen] at hh + obtain ⟨z,hz,hze⟩ := hh + have hzR := ball_subset_ball hR.le hz + have hez : z = ζ⁻¹ := hfi hzR hηR hze + have hzlt := mem_ball_zero_iff.mp hz + rw [hez,hη] at hzlt + exact lt_irrefl _ hzlt + obtain ⟨hfn,hfl⟩ := inverseExterior_frontier_level hct hc hfu + rw [he ζ hζ0] + exact hfl + · intro ζ hζ + have hζ0 : ζ ≠ 0 := by intro hh; norm_num [hh] at hζ + have hηB : ζ⁻¹ ∈ ball 0 1 := by + rw [mem_ball_zero_iff,norm_inv] + exact inv_lt_one_of_one_lt₀ hζ + have hηR := ball_subset_ball hR.le hηB + have hfn : f ζ⁻¹ ≠ 0 := by + intro hh + have hη0 := hfi hηR (mem_ball_self (by linarith)) (hh.trans hf0.symm) + exact (inv_ne_zero hζ0) hη0 + have hfu : f ζ⁻¹ ∈ U := by rw [← hopen]; exact mem_image_of_mem f hηB + rw [he ζ hζ0] + exact (mem_inverseExterior_iff hfn).mp hfu + +end DirectCrouzeix.Geometry + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/ExtremalEmbedding.lean b/lean/OAI/Analysis/DirectCrouzeix/ExtremalEmbedding.lean new file mode 100644 index 0000000000000000000000000000000000000000..a93a0f8e2d08d2b882da98c5604374dc5c55fdaf --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/ExtremalEmbedding.lean @@ -0,0 +1,245 @@ +/- +Portions of this file have been adapted from an external source. +The source copyright header and license information are preserved below. +-/ + +import OAI.Analysis.DirectCrouzeix.NormalFamilies + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +/- +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 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, 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] + +structure NormalizedEmbedding (U : Set ℂ) (a : ℂ) (f : ℂ → ℂ) : Prop where + holomorphic : DifferentiableOn ℂ f U + disk : MapsTo f U (ball 0 1) + injective : InjOn f U + derivative : ∀ z ∈ U, deriv f z ≠ 0 + normalized : f a = 0 + +theorem exists_normalizedEmbedding {U : Set ℂ} (hU : IsOpen U) + (hUc : IsSimplyConnected U) (hproper : U ≠ univ) {a : ℂ} (ha : a ∈ U) : + ∃ f, NormalizedEmbedding U a f := by + obtain ⟨e, hed, hei, he'⟩ := + exists_mapsTo_unitBall_injOn_deriv_ne_zero hU hUc hproper + have he : DifferentiableOn ℂ e U := fun z hz => + (differentiableAt_of_deriv_ne_zero (he' z hz)).differentiableWithinAt + let f : ℂ → ℂ := fun z => (e z - e a) / 2 + have hf' (z : ℂ) (hz : z ∈ U) : HasDerivAt f (deriv e z / 2) z := + ((he.hasDerivAt (hU.mem_nhds hz)).sub_const _).div_const _ + refine ⟨f, ⟨he.sub_const _ |>.div_const _, ?_, ?_, ?_, by simp [f]⟩⟩ + · intro z hz + rw [mem_ball_zero_iff] + dsimp [f] + rw [norm_div] + norm_num + have h1 := norm_sub_le (e z) (e a) + have h2 : ‖e z‖ < 1 := mem_ball_zero_iff.mp (hed hz) + have h3 : ‖e a‖ < 1 := mem_ball_zero_iff.mp (hed ha) + linarith + · intro z hz w hw heq + apply hei hz hw + dsimp [f] at heq + exact sub_left_injective ((div_left_inj' (by norm_num : (2 : ℂ) ≠ 0)).mp heq) + · intro z hz + rw [(hf' z hz).deriv] + exact div_ne_zero (he' z hz) (by norm_num) + +theorem extend_restrict_eventuallyEq {U : Set ℂ} (hU : IsOpen U) + {f : ℂ → ℂ} {a : ℂ} (ha : a ∈ U) : + extend U (fun z : U => f z) =ᶠ[𝓝 a] f := by + filter_upwards [hU.mem_nhds ha] with z hz + simp [extend, hz] + +theorem exists_extremalEmbedding {U : Set ℂ} (hU : IsOpen U) + (hUc : IsSimplyConnected U) (hproper : U ≠ univ) {a : ℂ} (ha : a ∈ U) : + ∃ f, NormalizedEmbedding U a f ∧ + ∀ g, NormalizedEmbedding U a g → ‖deriv g a‖ ≤ ‖deriv f a‖ := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + let S : Set C(U, ℂ) := {f | NormalizedEmbedding U a (extend U f)} + have hS : ∀ f ∈ S, DifferentiableOn ℂ (extend U f) U ∧ ∀ z : U, ‖f z‖ ≤ 1 := by + intro f hf + refine ⟨hf.holomorphic, fun z => ?_⟩ + simpa only [extend_coe] using (mem_ball_zero_iff.mp (hf.disk z.property)).le + have hCS := bounded_holomorphic_compact hU S hS + have hLS (g : C(U, ℂ)) (hg : g ∈ closure S) := bounded_holomorphic_closure hU hS hg + have hmk (f : ℂ → ℂ) (hf : NormalizedEmbedding U a f) : + (⟨fun z : U => f z, hf.holomorphic.continuousOn.domRestrict⟩ : C(U, ℂ)) ∈ S := by + let g : C(U, ℂ) := ⟨fun z : U => f z, hf.holomorphic.continuousOn.domRestrict⟩ + have heq (z : ℂ) (hz : z ∈ U) : extend U g =ᶠ[𝓝 z] f := + extend_restrict_eventuallyEq hU hz + change NormalizedEmbedding U a (extend U g) + refine ⟨?_, ?_, ?_, ?_, ?_⟩ + · intro z hz + exact ((hf.holomorphic.differentiableAt (hU.mem_nhds hz)).congr_of_eventuallyEq + (heq z hz)).differentiableWithinAt + · intro z hz + rw [(heq z hz).self_of_nhds] + exact hf.disk hz + · intro z hz w hw he + apply hf.injective hz hw + rwa [(heq z hz).self_of_nhds, (heq w hw).self_of_nhds] at he + · intro z hz + rw [(heq z hz).deriv_eq] + exact hf.derivative z hz + · rw [(heq a ha).self_of_nhds] + exact hf.normalized + obtain ⟨f₀, hf₀⟩ := exists_normalizedEmbedding hU hUc hproper ha + let F₀ : C(U, ℂ) := ⟨fun z : U => f₀ z, hf₀.holomorphic.continuousOn.domRestrict⟩ + have hF₀ : F₀ ∈ S := hmk _ hf₀ + obtain ⟨g, hg, hmax⟩ := hCS.exists_isMaxOn ⟨F₀, subset_closure hF₀⟩ + (derivative_continuousOn hU (fun f hf => (hLS _ hf).1) ha).norm + have hpos : 0 < ‖deriv (extend U g) a‖ := + (norm_pos_iff.mpr (hF₀.derivative a ha)).trans_le (hmax (subset_closure hF₀)) + obtain ⟨F, hF, hl⟩ := mem_closure_iff_seq_limit.mp hg + have hlu := continuousMap_limit hU hl + have hd := (hLS _ hg).1 + have hn : extend U g a = 0 := by + exact tendsto_nhds_unique (hlu.tendsto_at ha) + (by simpa only [(hF _).normalized] using tendsto_const_nhds (x := (0 : ℂ))) + have hi : InjOn (extend U g) U := by + apply (constant_or_injective_limit hU hUc.isPathConnected.isConnected.isPreconnected + (fun n => (hF n).holomorphic) (fun n => (hF n).injective) hlu).resolve_left + rintro ⟨c, hc⟩ + have he : extend U g =ᶠ[𝓝 a] (fun _ => c) := by + filter_upwards [hU.mem_nhds ha] with z hz + exact hc hz + have hz := he.deriv_eq + simp only [deriv_const] at hz + exact (ne_of_gt hpos) (by rw [hz, norm_zero]) + have hder : ∀ z ∈ U, deriv (extend U g) z ≠ 0 := by + have hdl := hlu.deriv (Eventually.of_forall (fun n => (hF n).holomorphic)) hU + apply (zero_or_nonvanishing_limit hU hUc.isPathConnected.isConnected.isPreconnected + (fun n => ((hF n).holomorphic.analyticOnNhd hU).deriv.differentiableOn) + (fun n => (hF n).derivative) hdl).resolve_left + intro he + exact (ne_of_gt hpos) (by rw [he ha, Pi.zero_apply, norm_zero]) + have hgN : NormalizedEmbedding U a (extend U g) := + ⟨hd, strict_bound_of_normalized hU hUc.isPathConnected.isConnected.isPreconnected hd + (fun z hz => by simpa [extend, hz] using (hLS _ hg).2 ⟨z, hz⟩) ha hn, hi, hder, hn⟩ + refine ⟨extend U g, hgN, fun f hf => ?_⟩ + have hm := hmax (subset_closure (hmk f hf)) + change ‖deriv (extend U (fun z : U => f z)) a‖ ≤ _ at hm + rwa [(extend_restrict_eventuallyEq hU ha).deriv_eq] at hm + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/FaberCalculus.lean b/lean/OAI/Analysis/DirectCrouzeix/FaberCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..bcb8270e97e65f434ddc8db00f05d23149fec37f --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/FaberCalculus.lean @@ -0,0 +1,196 @@ +import OAI.Analysis.DirectCrouzeix.FaberEnergy + +namespace OAI + +universe u_129 u_130 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +section BanachAlgebra + +variable {𝔄 : Type u_129} [NormedRing 𝔄] [NormedAlgebra ℂ 𝔄] [CompleteSpace 𝔄] + +theorem analyticAt_ringInverse {x : 𝔄} (hx : IsUnit x) : + AnalyticAt ℂ Ring.inverse x := by + rcases hx with ⟨u,rfl⟩ + exact analyticAt_inverse u + +theorem ringInverse_smul {𝔄 : Type u_129} [NormedRing 𝔄] [NormedAlgebra ℂ 𝔄] + [CompleteSpace 𝔄] {c : ℂ} (hc : c ≠ 0) (x : 𝔄) : + Ring.inverse (c • x) = c⁻¹ • Ring.inverse x := by + have hu : IsUnit (algebraMap ℂ 𝔄 c) := (isUnit_iff_ne_zero.mpr hc).map (algebraMap ℂ 𝔄) + have hi : Ring.inverse (algebraMap ℂ 𝔄 c) = algebraMap ℂ 𝔄 c⁻¹ := by + have hm : algebraMap ℂ 𝔄 c * algebraMap ℂ 𝔄 c⁻¹ = 1 := by + rw [← map_mul,mul_inv_cancel₀ hc,map_one] + calc + Ring.inverse (algebraMap ℂ 𝔄 c) = Ring.inverse (algebraMap ℂ 𝔄 c) * + (algebraMap ℂ 𝔄 c * algebraMap ℂ 𝔄 c⁻¹) := by rw [hm,mul_one] + _ = algebraMap ℂ 𝔄 c⁻¹ := by rw [← mul_assoc,Ring.inverse_mul_cancel _ hu,one_mul] + rw [Algebra.smul_def,Ring.inverse_mul (Or.inl hu),hi,Algebra.smul_def,Algebra.commutes] + +theorem ringInverse_geometric {𝔄 : Type u_129} [NormedRing 𝔄] [NormedAlgebra ℂ 𝔄] + [CompleteSpace 𝔄] (x : 𝔄) (hx : IsUnit (1-x)) (k : ℕ) : + Ring.inverse (1-x) = (∑ j ∈ Finset.range (k+1),x^j) + x^(k+1)*Ring.inverse (1-x) := by + have he := congrArg (fun y : 𝔄 => y * Ring.inverse (1-x)) (geom_sum_mul_neg x (k+1)) + rw [mul_assoc,Ring.mul_inverse_cancel _ hx,mul_one,sub_mul,one_mul] at he + exact (eq_add_of_sub_eq he.symm) + +theorem taylorCoeff_pow_smul_zero {E : Type u_130} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] {f : ℂ → E} (hf : AnalyticAt ℂ f 0) {j k : ℕ} (hjk : k < j) : + taylorCoeff (fun u => u^j • f u) k = 0 := by + have he := iteratedDerivWithin_smul (𝕜 := ℂ) (𝔸 := ℂ) (F := E) (n := k) + (x := 0) (s := univ) (f := fun u : ℂ => u^j) (g := f) + (mem_univ _) uniqueDiffOn_univ (by fun_prop) hf.contDiffAt.contDiffWithinAt + simp only [iteratedDerivWithin_univ] at he + change (k.factorial : ℂ)⁻¹ • iteratedDeriv k ((fun u : ℂ => u^j) • f) 0 = 0 + rw [he] + have hz : (∑ i ∈ Finset.range (k+1), k.choose i • + iteratedDeriv i (fun u : ℂ => u^j) 0 • iteratedDeriv (k-i) f 0) = 0 := by + apply Finset.sum_eq_zero + intro i hi + have hij : i ≠ j := by have := Finset.mem_range.mp hi; omega + simp only [iteratedDeriv_fun_pow_zero,ite_eq_right hij,Nat.cast_zero,smul_zero,zero_smul] + rw [hz,smul_zero] + +def algebraDenominator (c : ℂ) (g : ℂ → ℂ) (A : 𝔄) (u : ℂ) : 𝔄 := + (c+u*g u) • 1-u • A + +def algebraGenerating (c : ℂ) (g : ℂ → ℂ) (A : 𝔄) (u : ℂ) : 𝔄 := + (c-u^2*deriv g u) • Ring.inverse (algebraDenominator c g A u) + +theorem analyticAt_algebraDenominator {𝔄 : Type u_129} [NormedRing 𝔄] + [NormedAlgebra ℂ 𝔄] [CompleteSpace 𝔄] {c : ℂ} {g : ℂ → ℂ} {u : ℂ} + (hg : AnalyticAt ℂ g u) (A : 𝔄) : AnalyticAt ℂ (algebraDenominator c g A) u := by + exact ((analyticAt_const.add (analyticAt_id.mul hg)).smul analyticAt_const).sub + (analyticAt_id.smul analyticAt_const) + +theorem analyticAt_algebraGenerating {c : ℂ} {g : ℂ → ℂ} {u : ℂ} + (hg : AnalyticAt ℂ g u) (A : 𝔄) (hu : IsUnit (algebraDenominator c g A u)) : + AnalyticAt ℂ (algebraGenerating c g A) u := + (analyticAt_const.sub ((analyticAt_id.pow 2).mul hg.deriv)).smul + ((analyticAt_ringInverse hu).comp (analyticAt_algebraDenominator hg A)) + +theorem algebraGenerating_local {c : ℂ} {g : ℂ → ℂ} (A : 𝔄) {u : ℂ} + (h : c+u*g u ≠ 0) : + algebraGenerating c g A u = localN c g u • Ring.inverse (1-localW c g u • A) := by + have he : algebraDenominator c g A u = (c+u*g u) • (1-localW c g u • A) := by + simp only [algebraDenominator,smul_sub,smul_smul,localW,localL] + congr 1 + congr 1 + field_simp + rw [algebraGenerating,he,ringInverse_smul h,smul_smul] + rfl + +theorem algebraGenerating_coefficient {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} + (hg : AnalyticAt ℂ g 0) (A : 𝔄) (k : ℕ) : + taylorCoeff (algebraGenerating c g A) k = Polynomial.aeval A (faberBasis c g k) := by + classical + let L := localL c g + let W := localW c g + let N := localN c g + let V := fun u => Ring.inverse (1-W u • A) + have hL : AnalyticAt ℂ L 0 := analyticAt_localL hc hg + have hW : AnalyticAt ℂ W 0 := analyticAt_localW hc hg + have hN : AnalyticAt ℂ N 0 := analyticAt_localN hc hg + have hd : AnalyticAt ℂ (fun u => (1:𝔄)-W u • A) 0 := + analyticAt_const.sub (hW.smul analyticAt_const) + have hunit : IsUnit ((1:𝔄)-W 0 • A) := by simp [W] + have hV : AnalyticAt ℂ V 0 := (analyticAt_ringInverse hunit).comp (f := fun u => (1:𝔄)-W u • A) hd + have hlocal : ∀ᶠ u in 𝓝 0, c+u*g u ≠ 0 := + (analyticAt_const.add (analyticAt_id.mul hg)).continuousAt.eventually_ne (by simpa using hc) + have hu : ∀ᶠ u in 𝓝 0, IsUnit ((1:𝔄)-W u • A) := + hd.continuousAt.preimage_mem_nhds (Units.isOpen.mem_nhds hunit) + let T := fun u => (N u*L u^(k+1)) • (A^(k+1)*V u) + have hT : AnalyticAt ℂ T 0 := (hN.mul (hL.pow (k+1))).smul (analyticAt_const.mul hV) + have hs : AnalyticAt ℂ (fun u => ∑ j ∈ Finset.range (k+1), (N u*W u^j) • A^j) 0 := + Finset.analyticAt_fun_sum _ (fun j _ => (hN.mul (hW.pow j)).smul analyticAt_const) + have he : algebraGenerating c g A =ᶠ[𝓝 0] + (fun u => (∑ j ∈ Finset.range (k+1), (N u*W u^j) • A^j) + u^(k+1) • T u) := by + filter_upwards [hlocal,hu] with u hlu huu + rw [algebraGenerating_local A hlu,ringInverse_geometric (W u • A) huu k] + simp only [smul_add,Finset.smul_sum,smul_pow,smul_smul,smul_mul_assoc] + congr 1 + change (N u * W u^(k+1)) • (A^(k+1)*V u) = + u^(k+1) • ((N u*L u^(k+1)) • (A^(k+1)*V u)) + rw [smul_smul] + congr 1 + change N u * (u*L u)^(k+1) = _ + rw [mul_pow] + ring + have htail : AnalyticAt ℂ (fun u => u^(k+1) • T u) 0 := (analyticAt_id.pow (k+1)).smul hT + rw [taylorCoeff_congr he k,taylorCoeff_add hs htail, + taylorCoeff_pow_smul_zero hT (by omega : k < k+1),add_zero,taylorCoeff_sum] + · simp only [faberBasis,map_sum,Polynomial.aeval_monomial,← Algebra.smul_def] + apply Finset.sum_congr rfl + intro j hj + exact taylorCoeff_smul_const (hN.mul (hW.pow j)) (A^j) k + · exact fun j _ => (hN.mul (hW.pow j)).smul analyticAt_const + +theorem algebraGenerating_fourier {R : ℝ} (hR : 1 < R) {c : ℂ} (hc : c ≠ 0) + {g : ℂ → ℂ} (hg : AnalyticOnNhd ℂ g (ball 0 R)) (A : 𝔄) + (hunit : ∀ u ∈ closedBall 0 1, IsUnit (algebraDenominator c g A u)) : + (Continuous (fun t : Angle => algebraGenerating c g A (unitPoint t)⁻¹)) ∧ + (∀ k : ℕ, fourierCoeff (fun t : Angle => algebraGenerating c g A (unitPoint t)⁻¹) + (-(k:ℤ)) = Polynomial.aeval A (faberBasis c g k)) ∧ + (∀ k : ℤ, 0 < k → fourierCoeff (fun t : Angle => algebraGenerating c g A (unitPoint t)⁻¹) k = 0) := by + have ha : AnalyticOnNhd ℂ (algebraGenerating c g A) (closedBall 0 1) := by + intro u hu + exact analyticAt_algebraGenerating (hg u (closedBall_subset_ball hR hu)) A (hunit u hu) + obtain ⟨δ,hδ,hsub⟩ := (isCompact_closedBall (0:ℂ) 1).exists_thickening_subset_open + (isOpen_analyticAt ℂ (algebraGenerating c g A)) ha + rw [thickening_closedBall hδ (by norm_num : (0:ℝ) ≤ 1)] at hsub + have hδ1 : 1 < δ+1 := by linarith + have hsub : AnalyticOnNhd ℂ (algebraGenerating c g A) (ball 0 (δ+1)) := hsub + have he (k : ℤ) := fourierCoeff_of_antianalytic hδ1 hsub k + refine ⟨?_,?_,?_⟩ + · exact hsub.continuousOn.comp_continuous (unitPoint_continuous.inv₀ unitPoint_ne_zero) + (fun t => unitPoint_inv_mem hδ1 t) + · intro k + rw [he,ite_eq_left (by omega : -(k:ℤ) ≤ 0)] + simp only [neg_neg,Int.toNat_natCast] + exact algebraGenerating_coefficient hc (hg 0 (mem_ball_self (by linarith))) A k + · intro k hk + rw [he,ite_eq_right (by omega : ¬k ≤ 0)] + +theorem algebraDenominator_exterior {𝔄 : Type u_129} [NormedRing 𝔄] + [NormedAlgebra ℂ 𝔄] [CompleteSpace 𝔄] + (c : ℂ) (g : ℂ → ℂ) (A : 𝔄) {u : ℂ} (hu : u ≠ 0) : + algebraDenominator c g A u = u • (exterior c g u⁻¹ • 1 - A) := by + simp only [algebraDenominator,exterior,inv_inv,smul_sub,smul_smul] + congr 1 + congr 1 + field_simp + +theorem algebraGenerating_exterior (c : ℂ) (g : ℂ → ℂ) (A : 𝔄) {ζ : ℂ} (hζ : ζ ≠ 0) : + algebraGenerating c g A ζ⁻¹ = (ζ*(c-ζ⁻¹^2*deriv g ζ⁻¹)) • + Ring.inverse (exterior c g ζ • 1 - A) := by + rw [algebraGenerating,algebraDenominator_exterior c g A (inv_ne_zero hζ),inv_inv, + ringInverse_smul (inv_ne_zero hζ),inv_inv,smul_smul,mul_comm] + +end BanachAlgebra + +end DirectCrouzeix.Faber + +namespace DirectCrouzeix + +open MeasureTheory Set Filter Metric + +open scoped Topology ComplexConjugate MatrixOrder ComplexOrder + +end DirectCrouzeix + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/FaberEnergy.lean b/lean/OAI/Analysis/DirectCrouzeix/FaberEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..968cd9a5547cac6cfe965b57faabd10287254b18 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/FaberEnergy.lean @@ -0,0 +1,224 @@ +import OAI.Analysis.DirectCrouzeix.KernelContraction + +namespace OAI + +universe u_128 u_129 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +section FaberHilbert + +variable {E : Type u_128} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +def faberBoundarySeries {N : ℕ} (c : ℂ) (g : ℂ → ℂ) (C : Fin N → E) (t : Angle) : E := + ∑ k : Fin N, (faberBasis c g k).eval (boundary c g t) • C k + +def boundaryRemainder {N : ℕ} (c : ℂ) (g : ℂ → ℂ) (C : Fin N → E) (t : Angle) : E := + ∑ k : Fin N, boundaryCoefficient c g k t • C k + +def nonconstantCoefficients {N : ℕ} (C : Fin N → E) (k : Fin N) : E := + if (k:ℕ) = 0 then 0 else C k + +theorem continuous_boundaryRemainder {E : Type u_128} [NormedAddCommGroup E] + [InnerProductSpace ℂ E] [CompleteSpace E] {N : ℕ} (c : ℂ) (g : ℂ → ℂ) (C : Fin N → E) + (hS : Continuous (boundaryCorrection c g).uncurry) : Continuous (boundaryRemainder c g C) := by + exact continuous_finsetSum _ (fun k _ => (continuous_boundaryCoefficient hS k).smul continuous_const) + +theorem faberBoundarySeries_decomp {E : Type u_128} [NormedAddCommGroup E] + [InnerProductSpace ℂ E] [CompleteSpace E] {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + {N : ℕ} (C : Fin N → E) (t : Angle) : + faberBoundarySeries c g C t = positiveSeries C t + boundaryRemainder c g C t := by + simp only [faberBoundarySeries,faberBasis_boundary hR hg hc hH,add_smul, + Finset.sum_add_distrib,positiveSeries,boundaryRemainder] + +theorem boundaryRemainder_no_nonnegative {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + {N : ℕ} (C : Fin N → E) (j : ℤ) (hj : 0 ≤ j) : + fourierCoeff (boundaryRemainder c g C) j = 0 := by + have hS := continuous_boundaryCorrection hR hg hH + unfold boundaryRemainder + rw [fourierCoeff_finite_smul _ (fun k => continuous_boundaryCoefficient hS k)] + simp only [boundaryCoefficient_no_nonnegative hR hg hH _ j hj,zero_smul,Finset.sum_const_zero] + +theorem boundaryKernel_action {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + {N : ℕ} (C : Fin N → E) (s : Angle) : + (∫ t, boundaryKernel c g t s • positiveSeries (nonconstantCoefficients C) t ∂angularMeasure) = + boundaryRemainder c g C s := by + have hK := continuous_slice_left _ (continuous_boundaryKernel (continuous_boundaryCorrection hR hg hH)) s + simp only [positiveSeries,Finset.smul_sum] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro k hk + by_cases hk0 : (k:ℕ) = 0 + · simp [nonconstantCoefficients,hk0,boundaryCoefficient_zero hR hg hH] + · simp only [nonconstantCoefficients,ite_eq_right hk0] + rw [show (fun t => boundaryKernel c g t s • (fourier (k:ℤ) t • C k)) = + (fun t => ((boundaryKernel c g t s : ℂ)*fourier (k:ℤ) t) • C k) by + funext t; rw [← smul_assoc,Complex.real_smul], integral_smul_const, + boundaryKernel_character hR hg hH k hk0 s] + · intro k hk + exact integrable_of_continuous_compact _ (hK.smul ((fourier (k:ℤ)).continuous.smul continuous_const)) + +theorem faber_hilbert_coefficient_bounds {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (hpositive : ∀ t s, 0 ≤ boundaryKernel c g t s) + {N : ℕ} (C : Fin N → E) : + (∑ k, ‖C k‖^2 ≤ ∫ t, ‖faberBoundarySeries c g C t‖^2 ∂angularMeasure) ∧ + ((∫ t, ‖faberBoundarySeries c g C t‖^2 ∂angularMeasure) ≤ + ∑ k : Fin N, (if (k:ℕ) = 0 then 1 else 2)*‖C k‖^2) := by + have hS := continuous_boundaryCorrection hR hg hH + have hr := continuous_boundaryRemainder c g C hS + have he : (∫ t, ‖faberBoundarySeries c g C t‖^2 ∂angularMeasure) = + (∑ k, ‖C k‖^2) + ∫ t, ‖boundaryRemainder c g C t‖^2 ∂angularMeasure := by + simp_rw [faberBoundarySeries_decomp hR hg hc hH] + exact energy_orthogonal_positiveSeries C _ hr (boundaryRemainder_no_nonnegative hR hg hH C) + have hrnonneg : 0 ≤ ∫ t, ‖boundaryRemainder c g C t‖^2 ∂angularMeasure := + integral_nonneg (fun _ => sq_nonneg _) + have hrbound : (∫ t, ‖boundaryRemainder c g C t‖^2 ∂angularMeasure) ≤ + ∑ k, ‖nonconstantCoefficients C k‖^2 := by + let : InnerProductSpace ℝ E := InnerProductSpace.rclikeToReal ℂ E + have hm := boundaryKernel_marginals hR hg hH + have ht := markov_kernel_contraction angularMeasure angularMeasure (boundaryKernel c g) + (positiveSeries (nonconstantCoefficients C)) (continuous_boundaryKernel hS) + (continuous_positiveSeries _) hpositive hm.1 hm.2 + simp_rw [boundaryKernel_action hR hg hH C,energy_positiveSeries] at ht + exact ht + have hw : (∑ k, ‖C k‖^2) + ∑ k, ‖nonconstantCoefficients C k‖^2 = + ∑ k : Fin N, (if (k:ℕ) = 0 then 1 else 2)*‖C k‖^2 := by + rw [← Finset.sum_add_distrib] + apply Finset.sum_congr rfl + intro k hk + by_cases hk0 : (k:ℕ) = 0 <;> simp [nonconstantCoefficients,hk0] ; ring + constructor + · rw [he]; linarith + · rw [he,← hw]; linarith + +end FaberHilbert + +theorem re_circle_fraction {ζ μ : ℂ} (hζ : ‖ζ‖ = 1) (hμ : ‖μ‖ = 1) + (hne : ζ ≠ μ) : 2 * (ζ / (ζ - μ)).re = 1 := by + have hnζ : ζ.re ^ 2 + ζ.im ^ 2 = 1 := by + simpa [Complex.normSq_apply, pow_two] using + (show Complex.normSq ζ = 1 by rw [Complex.normSq_eq_norm_sq, hζ]; norm_num) + have hnμ : μ.re ^ 2 + μ.im ^ 2 = 1 := by + simpa [Complex.normSq_apply, pow_two] using + (show Complex.normSq μ = 1 by rw [Complex.normSq_eq_norm_sq, hμ]; norm_num) + have hd : Complex.normSq (ζ - μ) ≠ 0 := by + exact mt Complex.normSq_eq_zero.mp (sub_ne_zero.mpr hne) + rw [Complex.div_re] + field_simp + simp [Complex.normSq_apply, Complex.sub_re, Complex.sub_im] at * + nlinarith + +def boundaryNormal (c : ℂ) (g : ℂ → ℂ) (t : Angle) : ℂ := + unitPoint t * (c-(unitPoint t)⁻¹^2*deriv g ((unitPoint t)⁻¹)) + +theorem scalarGenerating_exterior (c : ℂ) (g : ℂ → ℂ) (z : ℂ) {ζ : ℂ} (hζ : ζ ≠ 0) : + scalarGenerating c g z ζ⁻¹ = ζ*(c-ζ⁻¹^2*deriv g ζ⁻¹)/(exterior c g ζ-z) := by + unfold scalarGenerating + have he : c+ζ⁻¹*(g ζ⁻¹-z) = ζ⁻¹*(exterior c g ζ-z) := by + simp only [exterior]; field_simp; ring + rw [he,div_mul_eq_div_div,div_inv_eq_mul] + ring + +theorem reciprocal_fraction {ζ μ : ℂ} (hζ : ζ ≠ 0) (hμ : μ ≠ 0) : + (1-ζ⁻¹/μ⁻¹)⁻¹ = ζ/(ζ-μ) := by + have hquot : ζ⁻¹/μ⁻¹ = μ/ζ := + (div_eq_iff (inv_ne_zero hμ)).2 (by field_simp) + have he : 1-ζ⁻¹/μ⁻¹ = (ζ-μ)/ζ := by rw [hquot]; field_simp + rw [he,inv_div] + +theorem unitPoint_injective : Function.Injective unitPoint := by + intro t s h + apply AddCircle.injective_toCircle (by norm_num : (1:ℝ) ≠ 0) + apply Subtype.coe_injective + simpa [unitPoint,fourier_apply] using h + +theorem boundaryCorrection_identity {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + {t s : Angle} (hts : t ≠ s) : + boundaryCorrection c g t s = boundaryNormal c g t/(boundary c g t-boundary c g s) - + unitPoint t/(unitPoint t-unitPoint s) := by + have ht := unitPoint_inv_mem hR t + have hs := unitPoint_inv_mem hR s + have hn : (unitPoint t)⁻¹ ≠ (unitPoint s)⁻¹ := + fun he => hts (unitPoint_injective (inv_injective he)) + have he := correction_identity isOpen_ball (convex_ball 0 R) hg c ht hs + (inv_ne_zero (unitPoint_ne_zero s)) hn (hH _ ht _ hs) + change correction c g ((unitPoint t)⁻¹) ((unitPoint s)⁻¹) = + scalarGenerating c g (exterior c g ((unitPoint s)⁻¹)⁻¹) ((unitPoint t)⁻¹) - _ at he + rw [inv_inv,scalarGenerating_exterior c g _ (unitPoint_ne_zero t), + reciprocal_fraction (unitPoint_ne_zero t) (unitPoint_ne_zero s)] at he + exact he + +theorem boundaryKernel_nonneg_off_diagonal {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (hsupport : ∀ t s, 0 ≤ (conj (boundaryNormal c g t)*(boundary c g t-boundary c g s)).re) + {t s : Angle} (hts : t ≠ s) : 0 ≤ boundaryKernel c g t s := by + have hfrac := re_circle_fraction (unitPoint_norm t) (unitPoint_norm s) + (fun he => hts (unitPoint_injective he)) + have hp : 0 ≤ (boundaryNormal c g t/(boundary c g t-boundary c g s)).re := by + rw [Complex.div_re,← add_div] + apply div_nonneg _ (Complex.normSq_nonneg _) + simpa [Complex.mul_re] using hsupport t s + rw [boundaryKernel,boundaryCorrection_identity hR hg hH hts,Complex.sub_re] + linarith + +theorem circle_nonneg_of_off_point (f : Angle → ℝ) (hf : Continuous f) (t : Angle) + (h : ∀ s, s ≠ t → 0 ≤ f s) : 0 ≤ f t := by + have hc : Continuous (fun x : ℝ => f (t+(x:Angle))) := hf.comp + (continuous_const.add (AddCircle.continuous_mk' (1:ℝ))) + have hlim : Tendsto (fun x : ℝ => f (t+(x:Angle))) (𝓝[>] 0) (𝓝 (f t)) := by + simpa only [QuotientAddGroup.mk_zero,add_zero] using (hc.continuousAt (x := (0:ℝ))).tendsto.mono_left nhdsWithin_le_nhds + apply le_of_tendsto_of_tendsto tendsto_const_nhds hlim + filter_upwards [Ioo_mem_nhdsGT (by norm_num : (0:ℝ) < 1)] with x hx + apply h + intro he + have hz : (x:Angle) = 0 := by simpa using add_left_cancel (he.trans (add_zero t).symm) + have hx0 := (AddCircle.coe_eq_zero_iff_of_mem_Ico (show x ∈ Ico (0:ℝ) 1 from ⟨hx.1.le,hx.2⟩)).mp hz + exact (ne_of_gt hx.1) hx0 + +theorem boundaryKernel_nonnegative {R : ℝ} (hR : 1 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} + (hH : ∀ u ∈ ball 0 R, ∀ v ∈ ball 0 R, chordDenominator c g u v ≠ 0) + (hsupport : ∀ t s, 0 ≤ (conj (boundaryNormal c g t)*(boundary c g t-boundary c g s)).re) : + ∀ t s, 0 ≤ boundaryKernel c g t s := by + intro t s + by_cases hts : t = s + · subst s + exact circle_nonneg_of_off_point _ + (continuous_slice_right _ (continuous_boundaryKernel (continuous_boundaryCorrection hR hg hH)) t) t + (fun s hst => boundaryKernel_nonneg_off_diagonal hR hg hH hsupport (Ne.symm hst)) + · exact boundaryKernel_nonneg_off_diagonal hR hg hH hsupport hts + +section BanachAlgebra + +variable {𝔄 : Type u_129} [NormedRing 𝔄] [NormedAlgebra ℂ 𝔄] [CompleteSpace 𝔄] + +end BanachAlgebra + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/FaberPolynomials.lean b/lean/OAI/Analysis/DirectCrouzeix/FaberPolynomials.lean new file mode 100644 index 0000000000000000000000000000000000000000..893fff41f6952c884606fd9bd4d5b6358b6d6ecd --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/FaberPolynomials.lean @@ -0,0 +1,207 @@ +import OAI.Analysis.DirectCrouzeix.TaylorFourier + +namespace OAI + +universe u_106 u_107 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +def localL (c : ℂ) (g : ℂ → ℂ) (u : ℂ) : ℂ := (c+u*g u)⁻¹ + +def localW (c : ℂ) (g : ℂ → ℂ) (u : ℂ) : ℂ := u*localL c g u + +def localN (c : ℂ) (g : ℂ → ℂ) (u : ℂ) : ℂ := (c-u^2*deriv g u)*localL c g u + +def faberBasis (c : ℂ) (g : ℂ → ℂ) (k : ℕ) : Polynomial ℂ := + ∑ j ∈ Finset.range (k+1), Polynomial.monomial j + (taylorCoeff (fun u => localN c g u * localW c g u ^ j) k) + +theorem analyticAt_localL {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} (hg : AnalyticAt ℂ g 0) : + AnalyticAt ℂ (localL c g) 0 := by + apply (analyticAt_const.add (analyticAt_id.mul hg)).inv + simpa using hc + +theorem analyticAt_localW {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} (hg : AnalyticAt ℂ g 0) : + AnalyticAt ℂ (localW c g) 0 := analyticAt_id.mul (analyticAt_localL hc hg) + +theorem analyticAt_localN {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} (hg : AnalyticAt ℂ g 0) : + AnalyticAt ℂ (localN c g) 0 := + (analyticAt_const.sub ((analyticAt_id.pow 2).mul hg.deriv)).mul (analyticAt_localL hc hg) + +@[simp] theorem localL_zero (c : ℂ) (g : ℂ → ℂ) : localL c g 0 = c⁻¹ := by simp [localL] + +@[simp] theorem localW_zero (c : ℂ) (g : ℂ → ℂ) : localW c g 0 = 0 := by simp [localW] + +@[simp] theorem localN_zero {c : ℂ} (hc : c ≠ 0) (g : ℂ → ℂ) : localN c g 0 = 1 := by + simp [localN,localL,hc] + +theorem faberBasis_coeff (c : ℂ) (g : ℂ → ℂ) (k j : ℕ) : + (faberBasis c g k).coeff j = + if j ≤ k then taylorCoeff (fun u => localN c g u * localW c g u^j) k else 0 := by + classical + simp [faberBasis,Polynomial.coeff_monomial,Finset.sum_ite_eq'] + +theorem faberBasis_zero {c : ℂ} (hc : c ≠ 0) (g : ℂ → ℂ) : faberBasis c g 0 = 1 := by + simp [faberBasis,hc] + +theorem faberBasis_top_coeff {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} (hg : AnalyticAt ℂ g 0) (k : ℕ) : + (faberBasis c g k).coeff k = c⁻¹ ^ k := by + rw [faberBasis_coeff, ite_eq_left le_rfl] + have he : (fun u => localN c g u * localW c g u^k) = + (fun u => u^k*(localN c g u*localL c g u^k)) := by funext u; simp only [localW,mul_pow]; ring + rw [he,taylorCoeff_pow_mul (f := fun u => localN c g u*localL c g u^k) + ((analyticAt_localN hc hg).mul ((analyticAt_localL hc hg).pow k))] + simp [hc] + +theorem faberBasis_degree {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} (hg : AnalyticAt ℂ g 0) (k : ℕ) : + (faberBasis c g k).degree = k := by + have hn : (faberBasis c g k).coeff k ≠ 0 := by rw [faberBasis_top_coeff hc hg]; exact pow_ne_zero _ (inv_ne_zero hc) + apply (Polynomial.degree_eq_iff_natDegree_eq (fun h => by simp [h] at hn)).mpr + apply Polynomial.natDegree_eq_of_le_of_coeff_ne_zero _ hn + apply Polynomial.natDegree_le_iff_coeff_eq_zero.mpr + intro j hj + rw [faberBasis_coeff,ite_eq_right (by omega)] + +theorem faberBasis_eval (c : ℂ) (g : ℂ → ℂ) (k : ℕ) (z : ℂ) : + (faberBasis c g k).eval z = ∑ j ∈ Finset.range (k+1), + taylorCoeff (fun u => localN c g u * localW c g u^j) k * z^j := by + simp [faberBasis,Polynomial.eval_finsetSum,Polynomial.eval_monomial] + +def scalarGenerating (c : ℂ) (g : ℂ → ℂ) (z u : ℂ) : ℂ := + (c-u^2*deriv g u)/(c+u*(g u-z)) + +theorem analyticAt_scalarGenerating {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} + (hg : AnalyticAt ℂ g 0) (z : ℂ) : AnalyticAt ℂ (scalarGenerating c g z) 0 := by + apply (analyticAt_const.sub ((analyticAt_id.pow 2).mul hg.deriv)).div + (analyticAt_const.add (analyticAt_id.mul (hg.sub analyticAt_const))) + simpa using hc + +theorem scalarGenerating_eq_local {c : ℂ} {g : ℂ → ℂ} {z u : ℂ} + (hu : c+u*g u ≠ 0) : scalarGenerating c g z u = localN c g u/(1-z*localW c g u) := by + simp only [scalarGenerating,localN,localW,localL] + field_simp + congr 1 ; ring + +theorem scalarGenerating_coefficient {c : ℂ} (hc : c ≠ 0) {g : ℂ → ℂ} + (hg : AnalyticAt ℂ g 0) (z : ℂ) (k : ℕ) : + taylorCoeff (scalarGenerating c g z) k = (faberBasis c g k).eval z := by + let N := localN c g + let L := localL c g + let W := localW c g + have hN : AnalyticAt ℂ N 0 := analyticAt_localN hc hg + have hL : AnalyticAt ℂ L 0 := analyticAt_localL hc hg + have hW : AnalyticAt ℂ W 0 := analyticAt_localW hc hg + let tail := fun u => N u*z^(k+1)*L u^(k+1)/(1-z*W u) + have ht : AnalyticAt ℂ tail 0 := by + apply ((hN.mul analyticAt_const).mul (hL.pow (k+1))).div + (analyticAt_const.sub (analyticAt_const.mul hW)) + simp [W] + have hsmall : ∀ᶠ u in 𝓝 (0:ℂ), c+u*g u ≠ 0 ∧ 1-z*W u ≠ 0 := by + apply Filter.Eventually.and + · exact (analyticAt_const.add (analyticAt_id.mul hg)).continuousAt.eventually_ne (by simpa using hc) + · exact (analyticAt_const.sub (analyticAt_const.mul hW)).continuousAt.eventually_ne (by simp [W]) + have he : scalarGenerating c g z =ᶠ[𝓝 0] + (fun u => (∑ j ∈ Finset.range (k+1), (N u*W u^j)*z^j) + u^(k+1)*tail u) := by + filter_upwards [hsmall] with u hu + rw [scalarGenerating_eq_local hu.1] + have hsum := geom_sum_mul_neg (z*W u) (k+1) + have hre : ∑ j ∈ Finset.range (k+1), N u * W u^j*z^j = + N u * ∑ j ∈ Finset.range (k+1), (z*W u)^j := by + rw [Finset.mul_sum]; apply Finset.sum_congr rfl; intro j hj; rw [mul_pow]; ring + rw [hre] + change N u / (1-z*W u) = _ + simp only [tail] + field_simp [hu.2] + have hw : W u = u*L u := rfl + rw [hw] at hsum ⊢ + linear_combination -N u*hsum + have hs : AnalyticAt ℂ (fun u => ∑ j ∈ Finset.range (k+1), N u*W u^j*z^j) 0 := + Finset.analyticAt_fun_sum _ (fun j hj => (hN.mul (hW.pow j)).mul analyticAt_const) + have htail : AnalyticAt ℂ (fun u => u^(k+1)*tail u) 0 := (analyticAt_id.pow (k+1)).mul ht + rw [taylorCoeff_congr he k,taylorCoeff_add hs htail,taylorCoeff_pow_mul ht, + ite_eq_right (by omega : ¬k+1 ≤ k),add_zero,taylorCoeff_sum] + · rw [faberBasis_eval] + apply Finset.sum_congr rfl + intro j hj + simp only [taylorCoeff,iteratedDeriv_mul_const_field,smul_eq_mul] + ring + · intro j hj + exact (hN.mul (hW.pow j)).mul analyticAt_const + +theorem taylorCoeff_geometric (z : ℂ) (k : ℕ) : + taylorCoeff (fun u : ℂ => (1-z*u)⁻¹) k = z^k := by + have he : (fun u : ℂ => (1-z*u)⁻¹) = scalarGenerating 1 (fun _ => 0) z := by + funext u + simp [scalarGenerating,sub_eq_add_neg,mul_comm] + rw [he,scalarGenerating_coefficient (by norm_num) analyticAt_const,faberBasis_eval] + have he' (j : ℕ) : (fun u => localN 1 (fun _ => 0) u * localW 1 (fun _ => 0) u^j) = + (fun u : ℂ => u^j) := by funext u; simp [localN,localW,localL] + simp_rw [he'] + have hfac : (k.factorial : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero k) + simp only [taylorCoeff,iteratedDeriv_fun_pow_zero,smul_eq_mul] + rw [Finset.sum_eq_single k] + · simp [hfac] + · intro j hj hjk + simp [Ne.symm hjk] + · simp + +theorem faberBasis_exterior {R : ℝ} (hR : 0 < R) {g : ℂ → ℂ} + (hg : AnalyticOnNhd ℂ g (ball 0 R)) {c : ℂ} (hc : c ≠ 0) + {v : ℂ} (hv : v ∈ ball 0 R) (hv0 : v ≠ 0) + (hH : ∀ u ∈ ball 0 R, chordDenominator c g u v ≠ 0) (k : ℕ) : + (faberBasis c g k).eval (exterior c g v⁻¹) = v⁻¹^k + + taylorCoeff (fun u => correction c g u v) k := by + have h0 : (0:ℂ) ∈ ball 0 R := mem_ball_self hR + have hgen := analyticAt_scalarGenerating hc (hg 0 h0) (exterior c g v⁻¹) + have hcorr := analyticOnNhd_correction_left isOpen_ball (convex_ball 0 R) hg hv hH + have hgeom : AnalyticAt ℂ (fun u : ℂ => (1-v⁻¹*u)⁻¹) 0 := by + exact (analyticAt_const.sub (analyticAt_const.mul analyticAt_id)).inv (by simp) + have he : scalarGenerating c g (exterior c g v⁻¹) =ᶠ[𝓝 0] + (fun u => (1-v⁻¹*u)⁻¹+correction c g u v) := by + filter_upwards [isOpen_ball.mem_nhds h0, (isOpen_ne.mem_nhds (Ne.symm hv0))] with u hu huv + have hh := correction_identity isOpen_ball (convex_ball 0 R) hg c hu hv hv0 huv (hH u hu) + change correction c g u v = scalarGenerating c g (exterior c g v⁻¹) u - _ at hh + rw [div_eq_mul_inv,mul_comm] at hh + linear_combination -hh + rw [← scalarGenerating_coefficient hc (hg 0 h0),taylorCoeff_congr he, + taylorCoeff_add hgeom (hcorr 0 h0),taylorCoeff_geometric] + +@[simp] theorem unitPoint_neg (t : Angle) : unitPoint (-t) = (unitPoint t)⁻¹ := by + simp [unitPoint,fourier_apply,AddCircle.toCircle_neg,Circle.coe_inv] + +theorem fourierCoeff_comp_neg {E : Type u_106} [NormedAddCommGroup E] [NormedSpace ℂ E] + (f : Angle → E) (k : ℤ) : + fourierCoeff (fun t => f (-t)) k = fourierCoeff f (-k) := by + unfold fourierCoeff + rw [← integral_neg_eq_self (fun t : Angle => fourier (-k) t • f (-t)) angularMeasure] + congr 1 + funext t + simp [fourier_apply,smul_neg,neg_smul] + +theorem fourierCoeff_of_antianalytic {E : Type u_107} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] {f : ℂ → E} {R : ℝ} (hR : 1 < R) + (hf : AnalyticOnNhd ℂ f (ball 0 R)) (k : ℤ) : + fourierCoeff (fun t : Angle => f ((unitPoint t)⁻¹)) k = + if k ≤ 0 then taylorCoeff f (-k).toNat else 0 := by + have he : (fun t : Angle => f ((unitPoint t)⁻¹)) = (fun t => (fun s => f (unitPoint s)) (-t)) := by + funext t; change f ((unitPoint t)⁻¹) = f (unitPoint (-t)); rw [unitPoint_neg] + rw [he,fourierCoeff_comp_neg (fun t : Angle => f (unitPoint t)) k,fourierCoeff_of_analytic hR hf] + simp only [neg_nonneg] + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/HarmonicReflection.lean b/lean/OAI/Analysis/DirectCrouzeix/HarmonicReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e491b602620d001b3afe40ff46e2be47569f53a --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/HarmonicReflection.lean @@ -0,0 +1,212 @@ +import OAI.Analysis.DirectCrouzeix.PoissonBoundary + +namespace OAI + +universe u_132 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +open InnerProductSpace Real + +theorem circleAverage_conj {E : Type u_132} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : ℂ → E) (R : ℝ) : + Real.circleAverage (fun ζ => f (conj ζ)) 0 R = Real.circleAverage f 0 R := by + conv_lhs => rw [Real.circleAverage_eq_circleAverage_zero_one] + conv_rhs => rw [Real.circleAverage_eq_circleAverage_zero_one] + calc + Real.circleAverage (fun z => f (conj ((R : ℂ) * z + 0))) 0 1 = + Real.circleAverage (fun z => f ((R : ℂ) * z⁻¹ + 0)) 0 1 := by + apply Real.circleAverage_congr_sphere + intro z hz + have hn : ‖z‖ = 1 := by simpa using hz + simp [Complex.inv_eq_conj hn] + _ = Real.circleAverage (fun z => f ((R : ℂ) * z + 0)) 0 1 := + Real.circleAverage_zero_one_congr_inv (f := fun z => f ((R : ℂ) * z + 0)) + +theorem poisson_conj (z ζ : ℂ) : + poissonKernel 0 (conj z) (conj ζ) = poissonKernel 0 z ζ := by + simp only [poissonKernel, sub_zero, Complex.norm_conj, ← map_sub] + +theorem poisson_odd {R : ℝ} {u : ℂ → ℝ} + (hu : ∀ ζ, u (conj ζ) = -u ζ) (z : ℂ) : + poissonExtension R u (conj z) = -poissonExtension R u z := by + dsimp [poissonExtension] + rw [← circleAverage_conj (fun ζ => poissonKernel 0 (conj z) ζ * u ζ) R] + simp_rw [poisson_conj, hu, mul_neg] + have he (ζ : ℂ) : -(poissonKernel 0 z ζ * u ζ) = (-1 : ℝ) • (poissonKernel 0 z ζ * u ζ) := by simp + simp_rw [he] + rw [Real.circleAverage_fun_smul, neg_one_smul] + +theorem poisson_real_zero {R : ℝ} {u : ℂ → ℝ} + (hu : ∀ ζ, u (conj ζ) = -u ζ) {z : ℂ} (hz : z.im = 0) : + poissonExtension R u z = 0 := by + have hc : conj z = z := Complex.conj_eq_iff_im.mpr hz + have hh := poisson_odd (R := R) hu z + rw [hc] at hh + linarith + +def poissonClosed (R : ℝ) (u : ℂ → ℝ) (z : ℂ) : ℝ := by + classical + exact if z ∈ ball 0 R then poissonExtension R u z else u z + +theorem poissonClosed_continuous {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) : + ContinuousOn (poissonClosed R u) (closedBall 0 R) := by + classical + unfold poissonClosed + apply ContinuousOn.if' + · intro a ha + have haS : a ∈ sphere 0 R := by + simpa only [Set.ofPred_mem_eq, frontier_ball (0 : ℂ) hR.ne'] using ha.2 + have haN : a ∉ ball 0 R := fun h => sphere_disjoint_ball.le_bot ⟨haS, h⟩ + simp only [haN, ↓reduceIte] + exact (poisson_boundary_limit hR hu haS).mono_left (nhdsWithin_mono _ inter_subset_right) + · intro a ha + have haS : a ∈ sphere 0 R := by + simpa only [Set.ofPred_mem_eq, frontier_ball (0 : ℂ) hR.ne'] using ha.2 + have haN : a ∉ ball 0 R := fun h => sphere_disjoint_ball.le_bot ⟨haS, h⟩ + simp only [haN, ↓reduceIte] + apply (hu a haS).mono + intro z hz + exact le_antisymm (mem_closedBall.mp hz.1) (not_lt.mp hz.2) + · exact (poisson_harmonic hR.le hu).continuousOn.mono inter_subset_right + · apply hu.mono + intro z hz + exact le_antisymm (mem_closedBall.mp hz.1) (not_lt.mp hz.2) + +def upperBall (R : ℝ) : Set ℂ := ball 0 R ∩ {z | 0 < z.im} + +def upperClosedBall (R : ℝ) : Set ℂ := closedBall 0 R ∩ {z | 0 ≤ z.im} + +theorem upperBall_open (R : ℝ) : IsOpen (upperBall R) := + isOpen_ball.inter (isOpen_lt continuous_const Complex.continuous_im) + +theorem upperClosedBall_closed (R : ℝ) : IsClosed (upperClosedBall R) := + isClosed_closedBall.inter (isClosed_le continuous_const Complex.continuous_im) + +theorem closure_upperBall_subset (R : ℝ) : closure (upperBall R) ⊆ upperClosedBall R := by + apply closure_minimal _ (upperClosedBall_closed R) + intro z hz + exact ⟨ball_subset_closedBall hz.1, (show 0 < z.im from hz.2).le⟩ + +def oddUpper (u : ℂ → ℝ) (z : ℂ) : ℝ := if 0 ≤ z.im then u z else -u (conj z) + +theorem oddUpper_conj {u : ℂ → ℝ} (hzero : ∀ z, z.im = 0 → u z = 0) + (z : ℂ) : oddUpper u (conj z) = -oddUpper u z := by + dsimp [oddUpper] + rw [Complex.conj_conj] + change (if 0 ≤ -z.im then u (conj z) else -u z) = -(if 0 ≤ z.im then u z else -u (conj z)) + by_cases hz : z.im = 0 + · have hc : conj z = z := Complex.conj_eq_iff_im.mpr hz + simp [hz, hc, hzero z hz] + · by_cases hh : 0 ≤ z.im + · have hn : ¬ 0 ≤ -z.im := fun he => hz (by linarith) + rw [ite_eq_right hn, ite_eq_left hh] + · rw [ite_eq_left (show 0 ≤ -z.im by linarith), ite_eq_right hh, neg_neg] + +theorem oddUpper_continuous_circle {R : ℝ} {u : ℂ → ℝ} + (hu : ContinuousOn u (upperClosedBall R)) + (hzero : ∀ z, z.im = 0 → u z = 0) : + ContinuousOn (oddUpper u) (sphere 0 R) := by + classical + apply ContinuousOn.if + · intro z hz + have hfr := Complex.continuous_im.frontier_preimage_subset (Ici (0 : ℝ)) hz.2 + have hz0 : z.im = 0 := by simpa only [frontier_Ici, mem_preimage, mem_singleton_iff] using hfr + have hc : conj z = z := Complex.conj_eq_iff_im.mpr hz0 + simp [hc, hzero z hz0] + · apply hu.mono + intro z hz + have hi : 0 ≤ z.im := by + exact (closure_minimal (by intro w hw; exact hw) + (isClosed_le continuous_const Complex.continuous_im)) hz.2 + exact ⟨sphere_subset_closedBall hz.1, hi⟩ + · apply ContinuousOn.neg + apply hu.comp Complex.continuous_conj.continuousOn + intro z hz + have hi : z.im ≤ 0 := by + exact (closure_minimal (by intro w hw; exact (le_of_not_ge hw)) + (isClosed_le Complex.continuous_im continuous_const)) hz.2 + exact ⟨by simpa only [mem_closedBall, dist_zero_right, Complex.norm_conj] using + sphere_subset_closedBall hz.1, by simpa only [mem_ofPred_eq, Complex.conj_im, neg_nonneg] using hi⟩ + +theorem harmonic_reflection {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : HarmonicOnNhd u (upperBall R)) + (huc : ContinuousOn u (upperClosedBall R)) + (hzero : ∀ z, z.im = 0 → u z = 0) : + EqOn (fun z => (herglotzExtension R (oddUpper u) z).re) u (upperBall R) := by + let v := oddUpper u + have hvc : ContinuousOn v (sphere 0 R) := oddUpper_continuous_circle huc hzero + let w := poissonClosed R v + have hwc := poissonClosed_continuous hR hvc + have he : EqOn w (poissonExtension R v) (ball 0 R) := by + intro z hz + simp [w, poissonClosed, hz] + have hwh : HarmonicOnNhd w (ball 0 R) := by + intro z hz + rw [harmonicAt_congr_nhds (he.eventuallyEq_of_mem (isOpen_ball.mem_nhds hz))] + exact poisson_harmonic hR.le hvc z hz + have hdiff : HarmonicContOnCl (u - w) (upperBall R) := by + refine ⟨hu.sub (hwh.mono inter_subset_left), ?_⟩ + exact (huc.mono (closure_upperBall_subset R)).sub + (hwc.mono ((closure_upperBall_subset R).trans inter_subset_left)) + have hbound : EqOn (u - w) 0 (frontier (upperBall R)) := by + intro z hz + have hzK := closure_upperBall_subset R hz.1 + have hn : z ∉ upperBall R := by + simpa only [(upperBall_open R).interior_eq] using hz.2 + by_cases hzB : z ∈ ball 0 R + · have hz0 : z.im = 0 := le_antisymm (le_of_not_gt (fun hi => hn ⟨hzB, hi⟩)) hzK.2 + have hw0 : w z = 0 := by + rw [he hzB] + exact poisson_real_zero (oddUpper_conj hzero) hz0 + simp [hzero z hz0, hw0] + · have hi : 0 ≤ z.im := hzK.2 + simp [w, poissonClosed, hzB, v, oddUpper, hi] + have hb : Bornology.IsBounded (upperBall R) := isBounded_ball.subset inter_subset_left + have hlo := harmonic_le_boundary (upperBall_open R) hb hdiff (M := 0) + (fun z hz => le_of_eq (hbound hz)) + have hhi := harmonic_le_boundary (upperBall_open R) hb hdiff.neg (M := 0) + (fun z hz => by simp [hbound hz]) + intro z hz + change (herglotzExtension R v z).re = u z + rw [herglotz_re hR.le hvc hz.1, ← he hz.1] + have ha := hlo z (subset_closure hz) + have hb := hhi z (subset_closure hz) + change u z - w z ≤ 0 at ha + change -(u z - w z) ≤ 0 at hb + linarith + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/HilbertSchmidt.lean b/lean/OAI/Analysis/DirectCrouzeix/HilbertSchmidt.lean new file mode 100644 index 0000000000000000000000000000000000000000..462489a4253570ebc3fd86f1980bd470430cc8fe --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/HilbertSchmidt.lean @@ -0,0 +1,120 @@ +import OAI.Analysis.DirectCrouzeix.PolynomialCalculus + +namespace OAI + +universe u_8 u_9 u_10 u_11 u_12 u_13 u_14 u_15 u_16 u_17 u_18 u_19 u_20 u_21 u_22 u_23 u_24 u_25 + u_26 u_27 u_28 u_29 u_30 u_31 u_32 u_33 u_34 u_35 u_36 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +theorem hsSq_eq_sum_norm_sq {ι : Type u_8} {κ : Type u_9} [Fintype ι] [Fintype κ] + (M : Matrix ι κ ℂ) : hsSq M = ∑ i, ∑ j, ‖M i j‖ ^ 2 := by + simp only [hsSq, Matrix.trace, Matrix.diag_apply, Matrix.mul_apply, Matrix.conjTranspose_apply, + Complex.re_sum, Complex.mul_re, Complex.star_def, Complex.conj_re, Complex.conj_im] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [← Complex.normSq_eq_norm_sq, Complex.normSq_apply] + ring + +def hsVector {ι : Type u_10} {κ : Type u_11} [Fintype ι] [Fintype κ] (M : Matrix ι κ ℂ) : + EuclideanSpace ℂ (ι × κ) := WithLp.toLp 2 (fun p => M p.1 p.2) + +theorem hsSq_eq_norm_hsVector_sq {ι : Type u_12} {κ : Type u_13} [Fintype ι] [Fintype κ] + (M : Matrix ι κ ℂ) : hsSq M = ‖hsVector M‖ ^ 2 := by + simp [hsSq_eq_sum_norm_sq, EuclideanSpace.norm_sq_eq, hsVector, Fintype.sum_prod_type] + +theorem hsSq_conjTranspose {ι : Type u_14} {κ : Type u_15} [Fintype ι] [Fintype κ] + (M : Matrix ι κ ℂ) : hsSq Mᴴ = hsSq M := by + simp only [hsSq_eq_sum_norm_sq, Matrix.conjTranspose_apply, norm_star] + exact Finset.sum_comm + +theorem hsSq_smul {ι : Type u_16} {κ : Type u_17} [Fintype ι] [Fintype κ] + (c : ℂ) (M : Matrix ι κ ℂ) : hsSq (c • M) = ‖c‖ ^ 2 * hsSq M := by + simp only [hsSq_eq_sum_norm_sq, Matrix.smul_apply, smul_eq_mul, norm_mul, + mul_pow, Finset.mul_sum] + +def entryPair {ι : Type u_18} {κ : Type u_19} [Fintype ι] [Fintype κ] + (M C : Matrix ι κ ℂ) : ℂ := ∑ i, ∑ j, M i j * C i j + +theorem entryPair_conj {ι : Type u_20} {κ : Type u_21} [Fintype ι] [Fintype κ] + (M : Matrix ι κ ℂ) : entryPair M (M.map star) = (hsSq M : ℂ) := by + simp only [entryPair, Matrix.map_apply, hsSq_eq_sum_norm_sq, Complex.ofReal_sum] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + rw [← Complex.normSq_eq_norm_sq] + exact Complex.mul_conj _ + +theorem hsSq_map_star {ι : Type u_22} {κ : Type u_23} [Fintype ι] [Fintype κ] + (M : Matrix ι κ ℂ) : hsSq (M.map star) = hsSq M := by + simp [hsSq_eq_sum_norm_sq] + +theorem hsSq_mul_le {ι : Type u_24} {κ : Type u_25} {τ : Type u_26} [Fintype ι] [Fintype κ] + [Fintype τ] + [DecidableEq κ] (F : Matrix ι κ ℂ) (G : Matrix κ τ ℂ) : + hsSq (F * G) ≤ ‖F‖ ^ 2 * hsSq G := by + have col (M : Matrix ι τ ℂ) : + hsSq M = ∑ j, ‖(WithLp.toLp 2 (fun i => M i j) : EuclideanSpace ℂ ι)‖ ^ 2 := by + simp only [EuclideanSpace.norm_sq_eq, hsSq_eq_sum_norm_sq] + exact Finset.sum_comm + have colG : hsSq G = ∑ j, + ‖(WithLp.toLp 2 (fun i => G i j) : EuclideanSpace ℂ κ)‖ ^ 2 := by + simp only [EuclideanSpace.norm_sq_eq, hsSq_eq_sum_norm_sq] + exact Finset.sum_comm + rw [col, colG, Finset.mul_sum] + apply Finset.sum_le_sum + intro j _ + have h := Matrix.l2_opNorm_mulVec F (WithLp.toLp 2 (fun i => G i j)) + have h' : ‖(WithLp.toLp 2 (fun i => (F * G) i j) : EuclideanSpace ℂ ι)‖ ≤ + ‖F‖ * ‖(WithLp.toLp 2 (fun i => G i j) : EuclideanSpace ℂ κ)‖ := h + calc + _ ≤ (‖F‖ * ‖(WithLp.toLp 2 (fun i => G i j) : EuclideanSpace ℂ κ)‖) ^ 2 := + pow_le_pow_left₀ (norm_nonneg _) h' 2 + _ = _ := mul_pow _ _ _ + +theorem hsSq_mul_le_right {ι : Type u_27} {κ : Type u_28} {τ : Type u_29} [Fintype ι] [Fintype κ] + [Fintype τ] + [DecidableEq τ] [DecidableEq κ] (F : Matrix ι κ ℂ) (G : Matrix κ τ ℂ) : + hsSq (F * G) ≤ hsSq F * ‖G‖ ^ 2 := by + simpa only [← Matrix.conjTranspose_mul, hsSq_conjTranspose, + Matrix.l2_opNorm_conjTranspose, mul_comm] using hsSq_mul_le Gᴴ Fᴴ + +theorem entryPair_eq_inner {ι : Type u_30} {κ : Type u_31} [Fintype ι] [Fintype κ] + (M C : Matrix ι κ ℂ) : + entryPair M C = inner ℂ (hsVector (M.map star)) (hsVector C) := by + simp [entryPair, hsVector, PiLp.inner_apply, Fintype.sum_prod_type, mul_comm] + +theorem norm_entryPair_sq_le {ι : Type u_32} {κ : Type u_33} [Fintype ι] [Fintype κ] + (M C : Matrix ι κ ℂ) : ‖entryPair M C‖ ^ 2 ≤ hsSq M * hsSq C := by + have h := norm_inner_le_norm (𝕜 := ℂ) (hsVector (M.map star)) (hsVector C) + have h' := pow_le_pow_left₀ (norm_nonneg _) h 2 + rw [← entryPair_eq_inner, mul_pow, ← hsSq_eq_norm_hsVector_sq, + ← hsSq_eq_norm_hsVector_sq, hsSq_map_star] at h' + exact h' + +theorem norm_sum_entryPair_sq_le {ρ : Type u_34} {ι : Type u_35} {κ : Type u_36} [Fintype ρ] + [Fintype ι] [Fintype κ] + (M C : ρ → Matrix ι κ ℂ) : + ‖∑ k, entryPair (M k) (C k)‖ ^ 2 ≤ (∑ k, hsSq (M k)) * ∑ k, hsSq (C k) := by + have h := norm_entryPair_sq_le + (fun (p : ρ × ι) (j : κ) => M p.1 p.2 j) + (fun (p : ρ × ι) (j : κ) => C p.1 p.2 j) + rw [hsSq_eq_sum_norm_sq (fun (p : ρ × ι) (j : κ) => M p.1 p.2 j), + hsSq_eq_sum_norm_sq (fun (p : ρ × ι) (j : κ) => C p.1 p.2 j)] at h + simpa only [entryPair, hsSq_eq_sum_norm_sq, Fintype.sum_prod_type] using h + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/HolomorphicReflection.lean b/lean/OAI/Analysis/DirectCrouzeix/HolomorphicReflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..1c3a4866ac22315881b776b3bd17a909b0718078 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/HolomorphicReflection.lean @@ -0,0 +1,269 @@ +import OAI.Analysis.DirectCrouzeix.HarmonicReflection + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +open InnerProductSpace Real + +def logModulusUpper (f : ℂ → ℂ) (z : ℂ) : ℝ := + if 0 < z.im then Real.log ‖f z‖ else 0 + +theorem logModulusUpper_real {f : ℂ → ℂ} {z : ℂ} (hz : z.im = 0) : + logModulusUpper f z = 0 := by simp [logModulusUpper, hz] + +theorem logModulusUpper_continuous {R : ℝ} {f : ℂ → ℂ} + (hc : ContinuousOn f (closedBall 0 R ∩ {z | 0 < z.im})) + (hn : ∀ z ∈ closedBall 0 R ∩ {z | 0 < z.im}, f z ≠ 0) + (hl : ∀ z ∈ closedBall 0 R, z.im = 0 → + Tendsto (fun w => ‖f w‖) (𝓝[{w : ℂ | 0 < w.im}] z) (𝓝 1)) : + ContinuousOn (logModulusUpper f) (upperClosedBall R) := by + unfold logModulusUpper + apply ContinuousOn.if' + · intro z hz + have hf := Complex.continuous_im.frontier_preimage_subset (Ioi (0 : ℝ)) hz.2 + have hz0 : z.im = 0 := by simpa only [frontier_Ioi, mem_preimage, mem_singleton_iff] using hf + simp only [hz0, lt_self_iff_false, ↓reduceIte] + have ht : Tendsto (fun w => Real.log ‖f w‖) (𝓝[{w : ℂ | 0 < w.im}] z) (𝓝 0) := by + simpa only [Function.comp_def, Real.log_one] using (Real.continuousAt_log one_ne_zero).tendsto.comp (hl z hz.1.1 hz0) + exact ht.mono_left (nhdsWithin_mono _ inter_subset_right) + · intro z hz + have hf := Complex.continuous_im.frontier_preimage_subset (Ioi (0 : ℝ)) hz.2 + have hz0 : z.im = 0 := by simpa only [frontier_Ioi, mem_preimage, mem_singleton_iff] using hf + simp only [hz0, lt_self_iff_false, ↓reduceIte] + exact tendsto_const_nhds + · apply (hc.norm.log (fun z hz => norm_ne_zero_iff.mpr (hn z hz))).mono + intro z hz + exact ⟨hz.1.1, hz.2⟩ + · exact continuousOn_const + +theorem upperBall_convex (R : ℝ) : Convex ℝ (upperBall R) := + (convex_ball (0 : ℂ) R).inter (convex_Ioi (0 : ℝ) |>.linear_preimage Complex.imCLM.toLinearMap) + +theorem upperBall_half_radius {R : ℝ} (hR : 0 < R) : + ((R / 2 : ℝ) : ℂ) * Complex.I ∈ upperBall R := by + constructor + · simp only [mem_ball_zero_iff, norm_mul, Complex.norm_I, mul_one, + Complex.norm_real, Real.norm_eq_abs] + rw [abs_of_pos (half_pos hR)] + linarith + · simpa using half_pos hR + +theorem circleAverage_pos_upper {R : ℝ} (hR : 0 ≤ R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) + (hn : ∀ z ∈ sphere 0 R, 0 ≤ u z) (hp : 0 < u ((R : ℂ) * Complex.I)) : + 0 < Real.circleAverage u 0 R := by + have hall (θ : ℝ) : circleMap 0 R θ ∈ sphere 0 R := by + simpa only [abs_of_nonneg hR] using circleMap_mem_sphere' (0 : ℂ) R θ + have hc : Continuous (fun θ => u (circleMap 0 R θ)) := + hu.comp_continuous (continuous_circleMap 0 R) hall + have hip : 0 < ∫ θ in (0 : ℝ)..2 * Real.pi, u (circleMap 0 R θ) := by + apply intervalIntegral.integral_pos Real.two_pi_pos hc.continuousOn + · intro θ _ + exact hn _ (hall θ) + · refine ⟨Real.pi / 2, ⟨by positivity, by nlinarith [Real.pi_pos]⟩, ?_⟩ + simpa only [circleMap_pi_div_two, zero_add] using hp + exact mul_pos (inv_pos.mpr Real.two_pi_pos) hip + +theorem herglotz_deriv_im_pos {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) + (hn : ∀ z ∈ sphere 0 R, u z * z.im ≤ 0) + (hp : u ((R : ℂ) * Complex.I) < 0) : + 0 < (deriv (herglotzExtension R u) 0).im := by + let d := fun ζ : ℂ => (2 / ζ) * (u ζ : ℂ) + have hzne : ∀ ζ ∈ sphere 0 R, ζ ≠ (0 : ℂ) := by + intro ζ hζ hz + subst ζ + exact hR.ne' (by simpa only [mem_sphere, dist_self, eq_comm] using hζ) + have hd : ContinuousOn d (sphere 0 R) := + (continuousOn_const.div continuousOn_id hzne).mul (Complex.continuous_ofReal.comp_continuousOn hu) + have hder := hasDerivAt_circleAverage_herglotzRieszKernel_smul + ((Complex.continuous_ofReal.comp_continuousOn hu).circleIntegrable hR.le) + (by simpa [abs_of_pos hR] using hR.ne : (0 : ℂ) ∉ sphere 0 |R|) + change HasDerivAt (herglotzExtension R u) _ _ at hder + have hval : deriv (herglotzExtension R u) 0 = Real.circleAverage d 0 R := by + rw [hder.deriv] + apply Real.circleAverage_congr_sphere + intro ζ hζ + have hz : ζ ≠ 0 := hzne ζ (by simpa only [abs_of_pos hR] using hζ) + dsimp [d] + simp only [sub_zero] + congr 1 + field_simp + have he (ζ : ℂ) : (d ζ).im = -2 * (u ζ * ζ.im) / Complex.normSq ζ := by + dsimp [d] + simp [Complex.mul_im, Complex.div_im] + ring + have hnon : ∀ ζ ∈ sphere 0 R, 0 ≤ (d ζ).im := by + intro ζ hζ + rw [he] + exact div_nonneg (mul_nonneg_of_nonpos_of_nonpos (by norm_num) (hn ζ hζ)) + (Complex.normSq_nonneg ζ) + have hpos : 0 < (d ((R : ℂ) * Complex.I)).im := by + rw [he] + have him : ((R : ℂ) * Complex.I).im = R := by simp + rw [him] + apply div_pos + · exact mul_pos_of_neg_of_neg (by norm_num) (mul_neg_of_neg_of_pos hp hR) + · rw [Complex.normSq_pos] + exact mul_ne_zero (Complex.ofReal_ne_zero.mpr hR.ne') Complex.I_ne_zero + rw [hval] + change 0 < Complex.imCLM (Real.circleAverage d 0 R) + rw [← Complex.imCLM.circleAverage_comp_comm (hd.circleIntegrable hR.le)] + exact circleAverage_pos_upper hR.le (Complex.continuous_im.comp_continuousOn hd) hnon hpos + +theorem holomorphic_reflection_modulus {R : ℝ} (hR : 0 < R) {f : ℂ → ℂ} + (hf : AnalyticOnNhd ℂ f (closedBall 0 R ∩ {z | 0 < z.im})) + (hn : ∀ z ∈ closedBall 0 R ∩ {z | 0 < z.im}, f z ≠ 0) + (hb : ∀ z ∈ closedBall 0 R ∩ {z | 0 < z.im}, ‖f z‖ < 1) + (hl : ∀ z ∈ closedBall 0 R, z.im = 0 → + Tendsto (fun w => ‖f w‖) (𝓝[{w : ℂ | 0 < w.im}] z) (𝓝 1)) : + ∃ F : ℂ → ℂ, AnalyticOnNhd ℂ F (ball 0 R) ∧ EqOn F f (upperBall R) ∧ + (∀ z ∈ ball 0 R, z.im = 0 → ‖F z‖ = 1) ∧ deriv F 0 ≠ 0 ∧ + (∀ z ∈ ball 0 R, ‖F z‖ < 1 ↔ 0 < z.im) := by + let u := logModulusUpper f + let v := oddUpper u + let H := herglotzExtension R v + have hu0 : ∀ z, z.im = 0 → u z = 0 := fun _ hz => logModulusUpper_real hz + have huc := logModulusUpper_continuous hf.continuousOn hn hl + have hvc : ContinuousOn v (sphere 0 R) := oddUpper_continuous_circle huc hu0 + have hH : AnalyticOnNhd ℂ H (ball 0 R) := herglotz_analytic hR.le hvc + have hu : HarmonicOnNhd u (upperBall R) := by + intro z hz + have hzK : z ∈ closedBall 0 R ∩ {z | 0 < z.im} := ⟨ball_subset_closedBall hz.1, hz.2⟩ + have he : u =ᶠ[𝓝 z] (fun w => Real.log ‖f w‖) := by + filter_upwards [(isOpen_lt continuous_const Complex.continuous_im).mem_nhds hz.2] with w hw + simp only [u, logModulusUpper, hw, ↓reduceIte] + rw [harmonicAt_congr_nhds he] + exact (hf z hzK).harmonicAt_log_norm (hn z hzK) + have hRe := harmonic_reflection hR hu huc hu0 + let k := fun z => f z * Complex.exp (-H z) + have hk : DifferentiableOn ℂ k (upperBall R) := by + apply (hf.differentiableOn.mono (by intro z hz; exact ⟨ball_subset_closedBall hz.1, hz.2⟩)).mul + exact (hH.differentiableOn.mono inter_subset_left).neg.cexp + have hkn : ∀ z ∈ upperBall R, ‖k z‖ = 1 := by + intro z hz + have hRe' : (H z).re = Real.log ‖f z‖ := by + have hh : (H z).re = u z := hRe hz + simpa only [u, logModulusUpper, ite_eq_left (show 0 < z.im from hz.2)] using hh + have hnz := hn z ⟨ball_subset_closedBall hz.1, hz.2⟩ + dsimp [k] + rw [norm_mul, Complex.norm_exp, Complex.neg_re, hRe', Real.exp_neg, + Real.exp_log (norm_pos_iff.mpr hnz), mul_inv_cancel₀ (norm_ne_zero_iff.mpr hnz)] + let c : ℂ := ((R / 2 : ℝ) : ℂ) * Complex.I + have hc : c ∈ upperBall R := upperBall_half_radius hR + have hconst := Complex.eqOn_of_isPreconnected_of_isMaxOn_norm + (upperBall_convex R).isPreconnected (upperBall_open R) hk hc + (show IsMaxOn (norm ∘ k) (upperBall R) c from + fun z hz => by + change ‖k z‖ ≤ ‖k c‖ + rw [hkn z hz, hkn c hc]) + refine ⟨fun z => k c * Complex.exp (H z), analyticOnNhd_const.mul hH.cexp, ?_, ?_, ?_, ?_⟩ + · intro z hz + have hh : k z = k c := hconst hz + rw [← hh] + simp [k, Complex.exp_neg, Complex.exp_ne_zero] + · intro z hz hz0 + have hHz : (H z).re = 0 := by + rw [show H z = herglotzExtension R v z from rfl, herglotz_re hR.le hvc hz] + exact poisson_real_zero (oddUpper_conj hu0) hz0 + rw [norm_mul, hkn c hc, Complex.norm_exp, hHz, Real.exp_zero, mul_one] + · have hvsign : ∀ z ∈ sphere 0 R, v z * z.im ≤ 0 := by + intro z hz + by_cases hi : 0 ≤ z.im + · by_cases hi0 : z.im = 0 + · simp [hi0] + · have hip : 0 < z.im := lt_of_le_of_ne hi (Ne.symm hi0) + have hzK : z ∈ closedBall 0 R ∩ {z | 0 < z.im} := ⟨sphere_subset_closedBall hz, hip⟩ + have huNeg : u z < 0 := by + simpa only [u, logModulusUpper, ite_eq_left hip] using + Real.log_neg (norm_pos_iff.mpr (hn z hzK)) (hb z hzK) + simpa only [v, oddUpper, ite_eq_left hi] using mul_nonpos_of_nonpos_of_nonneg huNeg.le hi + · have hip : 0 < (conj z).im := by simpa only [Complex.conj_im] using neg_pos.mpr (lt_of_not_ge hi) + have hzK : conj z ∈ closedBall 0 R ∩ {z | 0 < z.im} := + ⟨by simpa only [mem_closedBall, dist_zero_right, Complex.norm_conj] using sphere_subset_closedBall hz, hip⟩ + have huNeg : u (conj z) < 0 := by + simpa only [u, logModulusUpper, ite_eq_left hip] using + Real.log_neg (norm_pos_iff.mpr (hn _ hzK)) (hb _ hzK) + simpa only [v, oddUpper, ite_eq_right hi] using + mul_nonpos_of_nonneg_of_nonpos (neg_nonneg.mpr huNeg.le) (le_of_not_ge hi) + have hvpole : v ((R : ℂ) * Complex.I) < 0 := by + have hip : 0 < ((R : ℂ) * Complex.I).im := by simpa using hR + have hzK : (R : ℂ) * Complex.I ∈ closedBall 0 R ∩ {z | 0 < z.im} := + ⟨by simp [mem_closedBall, abs_of_pos hR], hip⟩ + simpa only [v, oddUpper, ite_eq_left hip.le, u, logModulusUpper, ite_eq_left hip] using + Real.log_neg (norm_pos_iff.mpr (hn _ hzK)) (hb _ hzK) + have hdpos : 0 < (deriv H 0).im := herglotz_deriv_im_pos hR hvc hvsign hvpole + have hdne : deriv H 0 ≠ 0 := by intro he; simp [he] at hdpos + have hkc : k c ≠ 0 := by intro he; simpa [he] using hkn c hc + have hderF := ((hH 0 (mem_ball_self hR)).differentiableAt.hasDerivAt.cexp).const_mul (k c) + rw [hderF.deriv] + exact mul_ne_zero hkc (mul_ne_zero (Complex.exp_ne_zero _) hdne) + · intro z hz + change ‖k c * Complex.exp (H z)‖ < 1 ↔ 0 < z.im + by_cases hi : 0 < z.im + · have hh : k z = k c := hconst ⟨hz, hi⟩ + have he : k c * Complex.exp (H z) = f z := by + rw [← hh] + simp [k, Complex.exp_neg, Complex.exp_ne_zero] + rw [he] + exact iff_of_true (hb z ⟨ball_subset_closedBall hz, hi⟩) hi + · by_cases hi0 : z.im = 0 + · have hHz : (H z).re = 0 := by + rw [show H z = herglotzExtension R v z from rfl, herglotz_re hR.le hvc hz] + exact poisson_real_zero (oddUpper_conj hu0) hi0 + simp only [norm_mul, hkn c hc, Complex.norm_exp, hHz, Real.exp_zero, mul_one, + lt_self_iff_false, hi0] + · have hic : 0 < (conj z).im := by + simpa only [Complex.conj_im] using + (neg_pos.mpr (lt_of_le_of_ne (le_of_not_gt hi) hi0)) + have hzcb : conj z ∈ ball 0 R := by simpa only [mem_ball_zero_iff, Complex.norm_conj] using hz + have hzK : conj z ∈ closedBall 0 R ∩ {z | 0 < z.im} := ⟨ball_subset_closedBall hzcb, hic⟩ + have hRc : (H (conj z)).re = Real.log ‖f (conj z)‖ := by + have hh : (H (conj z)).re = u (conj z) := hRe ⟨hzcb, hic⟩ + simpa only [u, logModulusUpper, ite_eq_left hic] using hh + have ho : (H (conj z)).re = -(H z).re := by + change (herglotzExtension R v (conj z)).re = -(herglotzExtension R v z).re + rw [herglotz_re hR.le hvc hzcb, herglotz_re hR.le hvc hz] + exact poisson_odd (oddUpper_conj hu0) z + have hpos : 0 < (H z).re := by + have hnlog := Real.log_neg (norm_pos_iff.mpr (hn _ hzK)) (hb _ hzK) + linarith + have hlarge : 1 < ‖k c * Complex.exp (H z)‖ := by + rw [norm_mul, hkn c hc, one_mul, Complex.norm_exp] + exact Real.one_lt_exp_iff.mpr hpos + exact iff_of_false (not_lt_of_ge hlarge.le) hi + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/InverseExterior.lean b/lean/OAI/Analysis/DirectCrouzeix/InverseExterior.lean new file mode 100644 index 0000000000000000000000000000000000000000..47eac88413322d3dd2e864aff6d8109709d20892 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/InverseExterior.lean @@ -0,0 +1,187 @@ +import OAI.Analysis.DirectCrouzeix.BoundaryParametrization + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +def inverseExterior (f : ℂ → ℝ) (a : ℂ) : Set ℂ := {w | w = 0 ∨ 1 < f (a+w⁻¹)} + +@[simp] theorem zero_mem_inverseExterior (f : ℂ → ℝ) (a : ℂ) : 0 ∈ inverseExterior f a := Or.inl rfl + +theorem mem_inverseExterior_iff {f : ℂ → ℝ} {a w : ℂ} (hw : w ≠ 0) : + w ∈ inverseExterior f a ↔ 1 < f (a+w⁻¹) := or_iff_right hw + +theorem inverseExterior_isOpen {f : ℂ → ℝ} (hf : Continuous f) + (hc : IsCompact {z | f z ≤ 1}) (a : ℂ) : IsOpen (inverseExterior f a) := by + obtain ⟨M,hM,hbound⟩ := hc.isBounded.exists_pos_norm_le + rw [isOpen_iff_mem_nhds] + intro w hw + by_cases hw0 : w = 0 + · subst w + let r := (M+‖a‖+1)⁻¹ + have hr : 0 < r := inv_pos.mpr (by positivity) + apply mem_of_superset (ball_mem_nhds (0:ℂ) hr) + intro w hw + by_cases hw0 : w = 0 + · exact Or.inl hw0 + apply Or.inr + by_contra hn + have hh := hbound (a+w⁻¹) (le_of_not_gt hn) + have hnorm : ‖w⁻¹‖ ≤ M+‖a‖ := by + calc + ‖w⁻¹‖ = ‖(a+w⁻¹)-a‖ := by congr 1; abel + _ ≤ ‖a+w⁻¹‖+‖a‖ := norm_sub_le _ _ + _ ≤ M+‖a‖ := add_le_add_left hh _ + have hrw : ‖w‖ < (M+‖a‖+1)⁻¹ := mem_ball_zero_iff.mp hw + have hlarge : M+‖a‖+1 < ‖w‖⁻¹ := (lt_inv_comm₀ (norm_pos_iff.mpr hw0) (by positivity)).mp hrw + rw [norm_inv] at hnorm + linarith + · have hc' : ContinuousAt (fun w : ℂ => f (a+w⁻¹)) w := + hf.continuousAt.comp (continuousAt_const.add (continuousAt_id.inv₀ hw0)) + have he : ∀ᶠ y in 𝓝 w, 1 < f (a+y⁻¹) := continuousAt_const.eventually_lt hc' ((mem_inverseExterior_iff hw0).mp hw) + exact mem_of_superset he (fun y hy => Or.inr hy) + +theorem inverseExterior_starConvex {f : ℂ → ℝ} (hf : ConvexOn ℝ univ f) + {a : ℂ} (ha : f a < 1) : StarConvex ℝ 0 (inverseExterior f a) := by + intro x hx t s ht hs hts + simp only [smul_zero,zero_add] + by_cases hs0 : s = 0 + · simp [hs0] + by_cases hx0 : x = 0 + · simp [hx0] + have hxout := (mem_inverseExterior_iff hx0).mp hx + apply Or.inr + by_contra hn + have hnew : f (a+(s • x)⁻¹) ≤ 1 := le_of_not_gt hn + have hsC : (s:ℂ) ≠ 0 := by exact_mod_cast hs0 + have hsum : (t:ℂ)+(s:ℂ)=1 := by exact_mod_cast hts + have he : t • a+s • (a+(s • x)⁻¹) = a+x⁻¹ := by + simp only [Complex.real_smul,mul_add] + rw [mul_inv_rev] + have hh : (s:ℂ)*((x⁻¹)*(s:ℂ)⁻¹) = x⁻¹ := by field_simp + rw [hh] + linear_combination a*hsum + have hconv := hf.2 (mem_univ a) (mem_univ (a+(s • x)⁻¹)) ht hs hts + rw [he] at hconv + have h1 := mul_le_mul_of_nonneg_left (le_of_lt ha) ht + have h2 := mul_le_mul_of_nonneg_left hnew hs + dsimp only [smul_eq_mul] at hconv + nlinarith + +theorem inverseExterior_simplyConnected {f : ℂ → ℝ} (hf : ConvexOn ℝ univ f) + {a : ℂ} (ha : f a < 1) : IsSimplyConnected (inverseExterior f a) := by + let : ContractibleSpace (inverseExterior f a) := + (inverseExterior_starConvex hf ha).contractibleSpace ⟨0,zero_mem_inverseExterior f a⟩ + change SimplyConnectedSpace (inverseExterior f a) + infer_instance + +theorem inverseExterior_bounded {f : ℂ → ℝ} (hf : Continuous f) + {a : ℂ} (ha : f a < 1) : ∃ L > 0, inverseExterior f a ⊆ closedBall 0 L := by + have hnh : {z | f z < 1} ∈ 𝓝 a := (isOpen_lt hf continuous_const).mem_nhds ha + obtain ⟨r,hr,hrB⟩ := Metric.mem_nhds_iff.mp hnh + refine ⟨r⁻¹,inv_pos.mpr hr,?_⟩ + intro w hw + rw [mem_closedBall_zero_iff] + by_cases hw0 : w = 0 + · subst w; simp [le_of_lt (inv_pos.mpr hr)] + by_contra hn + have hwL : r⁻¹ < ‖w‖ := lt_of_not_ge hn + have hninv : ‖w‖⁻¹ < r := (inv_lt_comm₀ hr (norm_pos_iff.mpr hw0)).mp hwL + have hball : a+w⁻¹ ∈ ball a r := by simpa [dist_eq_norm,norm_inv] using hninv + have hh : f (a+w⁻¹) < 1 := hrB hball + have hout := (mem_inverseExterior_iff hw0).mp hw + linarith + +theorem inverseExterior_compact_closure {f : ℂ → ℝ} (hf : Continuous f) + {a : ℂ} (ha : f a < 1) : IsCompact (closure (inverseExterior f a)) := by + obtain ⟨L,hL,hB⟩ := inverseExterior_bounded hf ha + exact (isCompact_closedBall (0:ℂ) L).of_isClosed_subset isClosed_closure + (closure_minimal hB isClosed_closedBall) + +theorem inverseExterior_proper {f : ℂ → ℝ} (hf : Continuous f) + {a : ℂ} (ha : f a < 1) : inverseExterior f a ≠ univ := by + obtain ⟨L,hL,hB⟩ := inverseExterior_bounded hf ha + intro he + have hh := hB (show ((L+1:ℝ):ℂ) ∈ inverseExterior f a from he ▸ mem_univ _) + rw [mem_closedBall_zero_iff,Complex.norm_real,Real.norm_eq_abs,abs_of_pos (by linarith)] at hh + linarith + +theorem inverseExterior_frontier_level {f : ℂ → ℝ} (hf : Continuous f) + (hc : IsCompact {z | f z ≤ 1}) {a w : ℂ} + (hw : w ∈ frontier (inverseExterior f a)) : w ≠ 0 ∧ f (a+w⁻¹) = 1 := by + have hU := inverseExterior_isOpen hf hc a + have hw' : w ∈ closure (inverseExterior f a) ∧ w ∉ inverseExterior f a := by + simpa only [frontier,hU.interior_eq,Set.mem_sdiff] using hw + have hw0 : w ≠ 0 := by intro he; subst w; exact hw'.2 (zero_mem_inverseExterior f a) + refine ⟨hw0,le_antisymm (le_of_not_gt (fun h => hw'.2 (Or.inr h))) ?_⟩ + by_contra hn + have hl : f (a+w⁻¹) < 1 := lt_of_not_ge hn + have hct : ContinuousAt (fun y : ℂ => f (a+y⁻¹)) w := + hf.continuousAt.comp (continuousAt_const.add (continuousAt_id.inv₀ hw0)) + have he : {y : ℂ | y ≠ 0 ∧ f (a+y⁻¹) < 1} ∈ 𝓝 w := + (continuousAt_id.eventually_ne hw0).and (hct.eventually_lt continuousAt_const hl) + obtain ⟨y,hy,hyU⟩ := mem_closure_iff_nhds.mp hw'.1 _ he + have hout := (mem_inverseExterior_iff hy.1).mp hyU + linarith [hy.2] + +end DirectCrouzeix.Geometry + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/KernelContraction.lean b/lean/OAI/Analysis/DirectCrouzeix/KernelContraction.lean new file mode 100644 index 0000000000000000000000000000000000000000..82b0e6ebe2c2e47746e97d131f52015e48e5132c --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/KernelContraction.lean @@ -0,0 +1,202 @@ +import OAI.Analysis.DirectCrouzeix.BoundaryKernel + +namespace OAI + +universe u_117 u_118 u_119 u_120 u_121 u_122 u_123 u_124 u_125 u_126 u_127 u_128 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +theorem weighted_integral_norm_sq_le {α : Type u_117} {E : Type u_118} [MeasurableSpace α] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + (μ : Measure α) (k : α → ℝ) (u : α → E) + (hk : ∀ x, 0 ≤ k x) (hki : Integrable k μ) + (hui : Integrable (fun x => k x • u x) μ) + (hsqi : Integrable (fun x => k x * ‖u x‖ ^ 2) μ) + (hmass : ∫ x, k x ∂μ = 1) : + ‖∫ x, k x • u x ∂μ‖ ^ 2 ≤ ∫ x, k x * ‖u x‖ ^ 2 ∂μ := by + let v := ∫ x, k x • u x ∂μ + have hii : Integrable (fun x => inner ℝ v (k x • u x)) μ := + (innerSL ℝ v).integrable_comp hui + have hi : (∫ x, inner ℝ v (k x • u x) ∂μ) = ‖v‖ ^ 2 := by + change (∫ x, (innerSL ℝ v) (k x • u x) ∂μ) = _ + rw [(innerSL ℝ v).integral_comp_comm hui] + exact real_inner_self_eq_norm_sq v + have hn : 0 ≤ ∫ x, k x * ‖u x - v‖ ^ 2 ∂μ := + integral_nonneg (fun x => mul_nonneg (hk x) (sq_nonneg _)) + have hexp : (fun x => k x * ‖u x - v‖ ^ 2) = + fun x => (k x * ‖u x‖ ^ 2 - 2 * inner ℝ v (k x • u x)) + k x * ‖v‖ ^ 2 := by + funext x + rw [norm_sub_sq_real, inner_smul_right, real_inner_comm v (u x)] + ring + rw [hexp] at hn + have hsubi : Integrable (fun x => k x * ‖u x‖ ^ 2 - 2 * inner ℝ v (k x • u x)) μ := + hsqi.sub (hii.const_mul 2) + have hconsti : Integrable (fun x => k x * ‖v‖ ^ 2) μ := hki.mul_const _ + rw [integral_add hsubi hconsti, integral_sub hsqi (hii.const_mul 2), + integral_const_mul, integral_mul_const, hi, hmass] at hn + change ‖v‖ ^ 2 ≤ _ + linarith + +theorem continuous_integrable_compact {α : Type u_119} {E : Type u_120} [TopologicalSpace α] + [MeasurableSpace α] [OpensMeasurableSpace α] [CompactSpace α] + [NormedAddCommGroup E] (μ : Measure α) [IsFiniteMeasure μ] + {f : α → E} (hf : Continuous f) : Integrable f μ := + hf.integrable_of_hasCompactSupport (HasCompactSupport.of_compactSpace f) + +theorem continuous_integral_compact {α : Type u_121} {β : Type u_122} {E : Type u_123} + [TopologicalSpace α] [FirstCountableTopology α] [LocallyCompactSpace α] + [TopologicalSpace β] [MeasurableSpace β] [OpensMeasurableSpace β] + [CompactSpace β] [SecondCountableTopology β] + [NormedAddCommGroup E] [NormedSpace ℝ E] + (μ : Measure β) [IsFiniteMeasure μ] {f : α → β → E} + (hf : Continuous f.uncurry) : Continuous (fun x => ∫ y, f x y ∂μ) := by + simpa using continuous_parametric_integral_of_continuous (μ := μ) hf isCompact_univ + +theorem markov_kernel_contraction {α : Type u_124} {β : Type u_125} {E : Type u_126} + [MetricSpace α] [MeasurableSpace α] [BorelSpace α] [CompactSpace α] + [SecondCountableTopology α] + [MetricSpace β] [MeasurableSpace β] [BorelSpace β] [CompactSpace β] + [SecondCountableTopology β] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] + (μ : Measure α) (ν : Measure β) [IsFiniteMeasure μ] [IsFiniteMeasure ν] + (K : α → β → ℝ) (u : α → E) + (hK : Continuous K.uncurry) (hu : Continuous u) + (hpos : ∀ x y, 0 ≤ K x y) + (hcol : ∀ y, ∫ x, K x y ∂μ = 1) + (hrow : ∀ x, ∫ y, K x y ∂ν = 1) : + (∫ y, ‖∫ x, K x y • u x ∂μ‖ ^ 2 ∂ν) ≤ ∫ x, ‖u x‖ ^ 2 ∂μ := by + have hKcol (y : β) : Continuous (fun x => K x y) := + hK.comp (continuous_id.prodMk continuous_const) + have hT : Continuous (fun y => ∫ x, K x y • u x ∂μ) := by + apply continuous_integral_compact + exact (hK.comp continuous_swap).smul (hu.comp continuous_snd) + have hs : Integrable (fun p : α × β => K p.1 p.2 * ‖u p.1‖ ^ 2) (μ.prod ν) := + continuous_integrable_compact _ (hK.mul ((hu.comp continuous_fst).norm.pow 2)) + calc + _ ≤ ∫ y, ∫ x, K x y * ‖u x‖ ^ 2 ∂μ ∂ν := by + apply integral_mono (continuous_integrable_compact _ (hT.norm.pow 2)) + hs.integral_prod_right + intro y + exact weighted_integral_norm_sq_le μ (fun x => K x y) u (fun x => hpos x y) + (continuous_integrable_compact _ (hKcol y)) + (continuous_integrable_compact _ ((hKcol y).smul hu)) + (continuous_integrable_compact _ ((hKcol y).mul (hu.norm.pow 2))) (hcol y) + _ = ∫ x, ∫ y, K x y * ‖u x‖ ^ 2 ∂ν ∂μ := (integral_integral_swap hs).symm + _ = _ := by simp_rw [integral_mul_const, hrow, one_mul] + +section Hilbert + +variable {E : Type u_127} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +def positiveSeries {N : ℕ} (C : Fin N → E) (t : Angle) : E := + ∑ k : Fin N, fourier (k:ℤ) t • C k + +theorem continuous_positiveSeries {E : Type u_127} [NormedAddCommGroup E] + [InnerProductSpace ℂ E] [CompleteSpace E] {N : ℕ} (C : Fin N → E) : + Continuous (positiveSeries C) := by + exact continuous_finsetSum _ (fun k _ => (fourier (k:ℤ)).continuous.smul continuous_const) + +theorem fourierCoeff_finite_smul {N : ℕ} (f : Fin N → Angle → ℂ) + (hf : ∀ k, Continuous (f k)) (C : Fin N → E) (j : ℤ) : + fourierCoeff (fun t => ∑ k, f k t • C k) j = ∑ k, fourierCoeff (f k) j • C k := by + unfold fourierCoeff + simp_rw [Finset.smul_sum,smul_smul] + rw [integral_finsetSum] + · simp_rw [integral_smul_const,smul_eq_mul] + · intro k hk + exact integrable_of_continuous_compact _ (((fourier (-j)).continuous.mul (hf k)).smul continuous_const) + +theorem fourierCoeff_positiveSeries {N : ℕ} (C : Fin N → E) (j : Fin N) : + fourierCoeff (positiveSeries C) (j:ℤ) = C j := by + classical + unfold positiveSeries + rw [fourierCoeff_finite_smul _ (fun k => (fourier (k:ℤ)).continuous)] + simp_rw [fourierCoeff_fourier] + simp only [Pi.single_apply,ite_smul,one_smul,zero_smul] + have hinj (k : Fin N) : (j:ℤ) = (k:ℤ) ↔ j = k := by + constructor + · intro h; apply Fin.ext; exact_mod_cast h + · intro h; rw [h] + simp_rw [hinj] + simp + +theorem integral_inner_positiveSeries {N : ℕ} (C : Fin N → E) + (f : Angle → E) (hf : Continuous f) : + (∫ t, inner ℂ (positiveSeries C t) (f t) ∂angularMeasure) = + ∑ k, inner ℂ (C k) (fourierCoeff f (k:ℤ)) := by + simp only [positiveSeries,sum_inner,inner_smul_left,← fourier_neg] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro k hk + have he : (fun t => fourier (-(k:ℤ)) t * inner ℂ (C k) (f t)) = + (fun t => inner ℂ (C k) (fourier (-(k:ℤ)) t • f t)) := by + funext t; simp only [inner_smul_right] + rw [he,integral_inner] + · rfl + · exact integrable_of_continuous_compact _ ((fourier (-(k:ℤ))).continuous.smul hf) + · intro k hk + exact integrable_of_continuous_compact _ + ((fourier (-(k:ℤ))).continuous.mul (continuous_const.inner hf)) + +theorem energy_positiveSeries {N : ℕ} (C : Fin N → E) : + (∫ t, ‖positiveSeries C t‖^2 ∂angularMeasure) = ∑ k, ‖C k‖^2 := by + have hp := continuous_positiveSeries C + have he (t : Angle) : ‖positiveSeries C t‖^2 = RCLike.re (inner ℂ (positiveSeries C t) (positiveSeries C t)) := by + simp [inner_self_eq_norm_sq_to_K,← Complex.ofReal_pow] + simp_rw [he] + rw [integral_re (integrable_of_continuous_compact _ (hp.inner hp)),integral_inner_positiveSeries C _ hp] + simp only [fourierCoeff_positiveSeries,inner_self_eq_norm_sq_to_K,map_sum] + change (∑ k, ((‖C k‖ : ℂ)^2).re) = ∑ k, ‖C k‖^2 + simp [← Complex.ofReal_pow] + +theorem energy_orthogonal_positiveSeries {N : ℕ} (C : Fin N → E) + (r : Angle → E) (hr : Continuous r) (hfreq : ∀ j : ℤ, 0 ≤ j → fourierCoeff r j = 0) : + (∫ t, ‖positiveSeries C t+r t‖^2 ∂angularMeasure) = + (∑ k, ‖C k‖^2) + ∫ t, ‖r t‖^2 ∂angularMeasure := by + have hp := continuous_positiveSeries C + have hci : Integrable (fun t => inner ℂ (positiveSeries C t) (r t)) angularMeasure := + integrable_of_continuous_compact _ (hp.inner hr) + have hcross : (∫ t, inner ℂ (positiveSeries C t) (r t) ∂angularMeasure) = 0 := by + rw [integral_inner_positiveSeries C r hr] + apply Finset.sum_eq_zero + intro k hk + rw [hfreq (k:ℤ) (by positivity),inner_zero_right] + have hcrossRe : (∫ t, RCLike.re (inner ℂ (positiveSeries C t) (r t)) ∂angularMeasure) = 0 := by + rw [integral_re hci,hcross] + rfl + have hpi : Integrable (fun t => ‖positiveSeries C t‖^2) angularMeasure := + integrable_of_continuous_compact _ (hp.norm.pow 2) + have hri : Integrable (fun t => ‖r t‖^2) angularMeasure := integrable_of_continuous_compact _ (hr.norm.pow 2) + have hcii : Integrable (fun t => 2*RCLike.re (inner ℂ (positiveSeries C t) (r t))) angularMeasure := + hci.re.const_mul 2 + simp_rw [norm_add_sq (𝕜 := ℂ)] + have ha := integral_add (hpi.add hcii) hri + have hb := integral_add hpi hcii + simp only [Pi.add_apply] at ha hb + rw [ha,hb,integral_const_mul,hcrossRe,mul_zero,add_zero,energy_positiveSeries] + +end Hilbert + +section FaberHilbert + +variable {E : Type u_128} [NormedAddCommGroup E] [InnerProductSpace ℂ E] [CompleteSpace E] + +end FaberHilbert + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/Main.lean b/lean/OAI/Analysis/DirectCrouzeix/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..23098f404746a3bf96350d6622af5765bcd814ac --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Main.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.DirectCrouzeix.Model +import OAI.Analysis.DirectCrouzeix.NumericalRange +import OAI.Analysis.DirectCrouzeix.PositiveBlocks +import OAI.Analysis.DirectCrouzeix.Resolvent +import OAI.Analysis.DirectCrouzeix.PolynomialCalculus +import OAI.Analysis.DirectCrouzeix.HilbertSchmidt +import OAI.Analysis.DirectCrouzeix.SingularPairs +import OAI.Analysis.DirectCrouzeix.Duality +import OAI.Analysis.DirectCrouzeix.Sharpness +import OAI.Analysis.DirectCrouzeix.CircleFourier +import OAI.Analysis.DirectCrouzeix.BoundaryEnergy +import OAI.Analysis.DirectCrouzeix.PolynomialEnergy +import OAI.Analysis.DirectCrouzeix.DomainCore +import OAI.Analysis.DirectCrouzeix.CompactIntegrals +import OAI.Analysis.DirectCrouzeix.DividedDifferences +import OAI.Analysis.DirectCrouzeix.TaylorFourier +import OAI.Analysis.DirectCrouzeix.FaberPolynomials +import OAI.Analysis.DirectCrouzeix.BoundaryKernel +import OAI.Analysis.DirectCrouzeix.KernelContraction +import OAI.Analysis.DirectCrouzeix.FaberEnergy +import OAI.Analysis.DirectCrouzeix.FaberCalculus +import OAI.Analysis.DirectCrouzeix.ExteriorCollar +import OAI.Analysis.DirectCrouzeix.NormalFamilies +import OAI.Analysis.DirectCrouzeix.ExtremalEmbedding +import OAI.Analysis.DirectCrouzeix.DiskMapping +import OAI.Analysis.DirectCrouzeix.PoissonBoundary +import OAI.Analysis.DirectCrouzeix.HarmonicReflection +import OAI.Analysis.DirectCrouzeix.HolomorphicReflection +import OAI.Analysis.DirectCrouzeix.Continuation +import OAI.Analysis.DirectCrouzeix.ConformalCollar +import OAI.Analysis.DirectCrouzeix.AnalyticCharts +import OAI.Analysis.DirectCrouzeix.ExponentialLevels +import OAI.Analysis.DirectCrouzeix.BoundaryParametrization +import OAI.Analysis.DirectCrouzeix.InverseExterior +import OAI.Analysis.DirectCrouzeix.ExteriorMapping +import OAI.Analysis.DirectCrouzeix.SupportNets +import OAI.Analysis.DirectCrouzeix.Convexity +import OAI.Analysis.DirectCrouzeix.ExponentialSupport +import OAI.Analysis.DirectCrouzeix.OuterApproximation +import OAI.Analysis.DirectCrouzeix.DomainBound +import OAI.Analysis.DirectCrouzeix.CompleteBound diff --git a/lean/OAI/Analysis/DirectCrouzeix/Model.lean b/lean/OAI/Analysis/DirectCrouzeix/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb0abb06d42480e15073530da46cfac0f4a7c636 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Model.lean @@ -0,0 +1,38 @@ +import Mathlib + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +def numericalRange {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) : Set ℂ := + {z | ∃ u : EuclideanSpace ℂ (Fin n), ‖u‖ = 1 ∧ + inner ℂ u (Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A u) = z} + +def polynomialValue {m d : ℕ} (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) + (z : ℂ) : Matrix (Fin m) (Fin m) ℂ := + ∑ k : Fin (d + 1), z ^ (k : ℕ) • B k + +def tensorEvaluation {n m d : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) : + Matrix (Fin n × Fin m) (Fin n × Fin m) ℂ := + ∑ k : Fin (d + 1), (A ^ (k : ℕ)) ⊗ₖ (B k) + +def rangeMaximum {n m d : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) : ℝ := + sSup ((fun z => ‖polynomialValue B z‖) '' numericalRange A) + +def UniversalBound (c : ℝ) : Prop := + ∀ (n m d : ℕ), 0 < n → 0 < m → + ∀ (A : Matrix (Fin n) (Fin n) ℂ) + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ), + ‖tensorEvaluation A B‖ ≤ c * rangeMaximum A B + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/NormalFamilies.lean b/lean/OAI/Analysis/DirectCrouzeix/NormalFamilies.lean new file mode 100644 index 0000000000000000000000000000000000000000..1cba5f4393e11dc9b8d5b23d2ed2906a3ebdc8dc --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/NormalFamilies.lean @@ -0,0 +1,259 @@ +import OAI.Analysis.DirectCrouzeix.ExteriorCollar + +namespace OAI + +universe u_131 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +theorem zero_or_nonvanishing_limit {U : Set ℂ} (hU : IsOpen U) + (hUc : IsPreconnected U) {F : ℕ → ℂ → ℂ} {g : ℂ → ℂ} + (hF : ∀ n, DifferentiableOn ℂ (F n) U) + (hFn : ∀ n z, z ∈ U → F n z ≠ 0) + (hl : TendstoLocallyUniformlyOn F g atTop U) : + EqOn g 0 U ∨ ∀ z ∈ U, g z ≠ 0 := by + have hg : AnalyticOnNhd ℂ g U := + (hl.differentiableOn (Eventually.of_forall hF) hU).analyticOnNhd hU + by_cases hz : EqOn g 0 U + · exact Or.inl hz + right + intro a ha hga + have hlocal : ¬ ∀ᶠ z in 𝓝 a, g z = 0 := by + intro he + exact hz (hg.eqOn_zero_of_preconnected_of_eventuallyEq_zero hUc ha he) + have hp := ((hg a ha).eventually_eq_zero_or_eventually_ne_zero).resolve_left hlocal + obtain ⟨r, hr, hBU, hBn⟩ : ∃ r > 0, closedBall a r ⊆ U ∧ + ∀ z ∈ closedBall a r, z ≠ a → g z ≠ 0 := by + simpa only [ofPred_and, subset_inter_iff] using! + nhds_basis_closedBall.mem_iff.mp ((show ∀ᶠ z in 𝓝 a, z ∈ U from hU.mem_nhds ha).and + (eventually_nhdsWithin_iff.mp hp)) + have hgR : ContinuousOn (fun z => ‖g z‖) (sphere a r) := + hg.continuousOn.norm.mono (sphere_subset_closedBall.trans hBU) + obtain ⟨b, hb, hmin⟩ := (isCompact_sphere a r).exists_isMinOn + (NormedSpace.sphere_nonempty.mpr hr.le) hgR + have hd : 0 < ‖g b‖ := norm_pos_iff.mpr + (hBn b (sphere_subset_closedBall hb) (ne_of_mem_sphere hb hr.ne')) + have hlu : TendstoUniformlyOn F g atTop (sphere a r) := + (tendstoLocallyUniformlyOn_iff_forall_isCompact hU).mp hl (sphere a r) + (sphere_subset_closedBall.trans hBU) (isCompact_sphere a r) + have hclose : ∀ᶠ n in atTop, ∀ z ∈ sphere a r, dist (F n z) (g z) < ‖g b‖ / 2 := + by simpa only [dist_comm] using (Metric.tendstoUniformlyOn_iff.mp hlu) _ (half_pos hd) + have hlow : ∀ᶠ n in atTop, ‖g b‖ / 2 ≤ ‖F n a‖ := by + filter_upwards [hclose] with n hn + have hinv : DiffContOnCl ℂ (fun z => (F n z)⁻¹) (ball a r) := by + apply DifferentiableOn.diffContOnCl + rw [closure_ball a hr.ne'] + exact ((hF n).inv (hFn n)).mono hBU + have hbnd : ∀ z ∈ frontier (ball a r), ‖(F n z)⁻¹‖ ≤ (‖g b‖ / 2)⁻¹ := by + intro z hz + rw [frontier_ball a hr.ne'] at hz + have hlo : ‖g b‖ / 2 ≤ ‖F n z‖ := by + have ht := norm_sub_norm_le (g z) (F n z) + rw [← dist_eq_norm, dist_comm] at ht + have hm : ‖g b‖ ≤ ‖g z‖ := hmin hz + have hc := hn z hz + linarith + rw [norm_inv] + exact (inv_le_inv₀ (lt_of_lt_of_le (half_pos hd) hlo) (half_pos hd)).mpr hlo + have hc := Complex.norm_le_of_forall_mem_frontier_norm_le (isBounded_ball : + Bornology.IsBounded (ball a r)) hinv hbnd + (show a ∈ closure (ball a r) from subset_closure (mem_ball_self hr)) + rw [norm_inv] at hc + exact (inv_le_inv₀ (norm_pos_iff.mpr (hFn n a ha)) (half_pos hd)).mp hc + have hcenter : Tendsto (fun n => ‖F n a‖) atTop (𝓝 0) := by + simpa [hga] using (hl.tendsto_at ha).norm + have hle := ge_of_tendsto hcenter hlow + exact (not_le_of_gt (half_pos hd)) hle + +theorem constant_or_injective_limit {U : Set ℂ} (hU : IsOpen U) + (hUc : IsPreconnected U) {F : ℕ → ℂ → ℂ} {g : ℂ → ℂ} + (hF : ∀ n, DifferentiableOn ℂ (F n) U) + (hFi : ∀ n, InjOn (F n) U) + (hl : TendstoLocallyUniformlyOn F g atTop U) : + (∃ c : ℂ, EqOn g (fun _ => c) U) ∨ InjOn g U := by + have hg := (hl.differentiableOn (Eventually.of_forall hF) hU).analyticOnNhd hU + by_cases hc : ∃ c : ℂ, EqOn g (fun _ => c) U + · exact Or.inl hc + right + intro a ha b hb hab + by_contra hne + have hV : IsOpen (U \ {a}) := hU.sdiff isClosed_singleton + have hbV : b ∈ U \ {a} := ⟨hb, by simpa [eq_comm] using hne⟩ + obtain ⟨r, hr, hBr⟩ := Metric.isOpen_iff.mp hV b hbV + have hBU : ball b r ⊆ U := hBr.trans sdiff_subset + have hzero : ∀ n z, z ∈ ball b r → F n z - F n a ≠ 0 := by + intro n z hz he + have hza := hBr hz + have heq := hFi n hza.1 ha (sub_eq_zero.mp he) + exact hza.2 (by simpa using heq) + have hlc : TendstoLocallyUniformlyOn (fun n z => F n z - F n a) + (fun z => g z - g a) atTop (ball b r) := by + exact (hl.sub (hl.tendsto_at ha).tendstoUniformly_const.tendstoLocallyUniformly.tendstoLocallyUniformlyOn).mono hBU + have hh := zero_or_nonvanishing_limit isOpen_ball (convex_ball b r).isPreconnected + (fun n => ((hF n).sub_const (F n a)).mono hBU) hzero hlc + have he : EqOn (fun z => g z - g a) 0 (ball b r) := hh.resolve_right (by + intro hn + exact hn b (mem_ball_self hr) (sub_eq_zero.mpr hab.symm)) + have heg : g =ᶠ[𝓝 b] (fun _ => g a) := by + filter_upwards [ball_mem_nhds b hr] with z hz + exact sub_eq_zero.mp (he hz) + exact hc ⟨g a, hg.eqOn_of_preconnected_of_eventuallyEq analyticOnNhd_const hUc hb heg⟩ + +def extend (U : Set ℂ) (f : U → ℂ) (z : ℂ) : ℂ := by + classical + exact if h : z ∈ U then f ⟨z, h⟩ else 0 + +@[simp] theorem extend_coe {U : Set ℂ} (f : U → ℂ) (z : U) : extend U f z = f z := by + simp [extend, z.property] + +theorem continuousMap_limit {U : Set ℂ} (hU : IsOpen U) + {F : ℕ → C(U, ℂ)} {g : C(U, ℂ)} (hl : Tendsto F atTop (𝓝 g)) : + TendstoLocallyUniformlyOn (fun n => extend U (F n)) (extend U g) atTop U := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + rw [tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe] + simpa only [extend_coe, Function.comp_def] using + ContinuousMap.tendsto_iff_tendstoLocallyUniformly.mp hl + +theorem bounded_holomorphic_equicontinuous {U : Set ℂ} (hU : IsOpen U) + {ι : Type u_131} (F : ι → ℂ → ℂ) + (hF : ∀ i, DifferentiableOn ℂ (F i) U) + (hbound : ∀ i z, z ∈ U → ‖F i z‖ ≤ 1) : + Equicontinuous (fun i (z : U) => F i z) := by + intro x + rw [Metric.equicontinuousAt_iff] + intro ε hε + obtain ⟨R, hR, hBR⟩ := Metric.nhds_basis_closedBall.mem_iff.mp (hU.mem_nhds x.property) + let r := R / 2 + have hr : 0 < r := half_pos hR + have hd (i : ι) (z : ℂ) (hz : z ∈ ball (x : ℂ) r) : ‖deriv (F i) z‖ ≤ 1 / r := by + have hsub : closedBall z r ⊆ U := by + intro w hw + apply hBR + have ht := dist_triangle w z (x : ℂ) + have hw' := mem_closedBall.mp hw + have hz' := mem_ball.mp hz + change dist w (x : ℂ) ≤ R + dsimp [r] at hw' hz' + linarith + apply Complex.norm_deriv_le_of_forall_mem_sphere_norm_le hr + · apply DifferentiableOn.diffContOnCl + rw [closure_ball z hr.ne'] + exact (hF i).mono hsub + · intro w hw + exact hbound i w (hsub (sphere_subset_closedBall hw)) + have hbU : ball (x : ℂ) r ⊆ U := by + intro z hz + apply hBR + exact mem_closedBall.mpr ((mem_ball.mp hz).le.trans (by dsimp [r]; linarith)) + refine ⟨min r (ε * r), lt_min hr (mul_pos hε hr), ?_⟩ + intro y hy i + have hy' : dist (y : ℂ) (x : ℂ) < r := lt_of_lt_of_le hy (min_le_left _ _) + have hxy : ‖F i y - F i x‖ ≤ (1 / r) * ‖(y : ℂ) - x‖ := + Convex.norm_image_sub_le_of_norm_deriv_le + (fun z hz => (hF i).differentiableAt (hU.mem_nhds (hbU hz))) + (hd i) (convex_ball (x : ℂ) r) (mem_ball_self hr) hy' + rw [dist_comm, dist_eq_norm] + apply lt_of_le_of_lt hxy + rw [one_div, ← div_eq_inv_mul, div_lt_iff₀ hr] + rw [← dist_eq_norm] + exact lt_of_lt_of_le hy (min_le_right _ _) + +theorem bounded_holomorphic_compact {U : Set ℂ} (hU : IsOpen U) + (S : Set C(U, ℂ)) + (hS : ∀ f ∈ S, DifferentiableOn ℂ (extend U f) U ∧ ∀ z : U, ‖f z‖ ≤ 1) : + IsCompact (closure S) := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + let : T2Space (UniformOnFun U ℂ {K | IsCompact K}) := + UniformOnFun.t2Space_of_covering (by + ext x + simp only [mem_sUnion, mem_ofPred_eq, mem_univ, iff_true] + exact ⟨{x}, isCompact_singleton, mem_singleton x⟩) + apply ArzelaAscoli.isCompact_closure_of_isClosedEmbedding + (F := fun f : C(U, ℂ) => (f : U → ℂ)) (𝔖 := {K | IsCompact K}) + (fun _ hK => hK) + ContinuousMap.isUniformEmbedding_toUniformOnFunIsCompact.isClosedEmbedding + · intro K hK + have he := bounded_holomorphic_equicontinuous hU + (fun f : S => extend U (f : C(U, ℂ))) + (fun f => (hS f f.property).1) + (fun f z hz => by simpa [extend, hz] using (hS f f.property).2 ⟨z, hz⟩) + simpa only [Function.comp_def, extend_coe] using he.equicontinuousOn K + · intro K hK z hz + exact ⟨closedBall 0 1, isCompact_closedBall _ _, fun f hf => by + simpa using (hS f hf).2 z⟩ + +theorem bounded_holomorphic_closure {U : Set ℂ} (hU : IsOpen U) + {S : Set C(U, ℂ)} + (hS : ∀ f ∈ S, DifferentiableOn ℂ (extend U f) U ∧ ∀ z : U, ‖f z‖ ≤ 1) + {g : C(U, ℂ)} (hg : g ∈ closure S) : + DifferentiableOn ℂ (extend U g) U ∧ ∀ z : U, ‖g z‖ ≤ 1 := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + obtain ⟨F, hF, hl⟩ := mem_closure_iff_seq_limit.mp hg + have hl' := continuousMap_limit hU hl + refine ⟨hl'.differentiableOn (Eventually.of_forall (fun n => (hS _ (hF n)).1)) hU, ?_⟩ + intro z + have ht := (hl'.tendsto_at z.property).norm + simpa only [extend_coe] using le_of_tendsto ht + (Eventually.of_forall (fun n => by simpa only [extend_coe] using (hS _ (hF n)).2 z)) + +theorem derivative_continuousOn {U : Set ℂ} (hU : IsOpen U) + {S : Set C(U, ℂ)} (hS : ∀ f ∈ S, DifferentiableOn ℂ (extend U f) U) + {a : ℂ} (ha : a ∈ U) : + ContinuousOn (fun f : C(U, ℂ) => deriv (extend U f) a) S := by + let : LocallyCompactSpace U := hU.locallyCompactSpace + rw [continuousOn_iff_continuous_domRestrict, continuous_iff_seqContinuous] + intro F g hl + have ht : Tendsto (fun n => (F n : C(U, ℂ))) atTop (𝓝 (g : C(U, ℂ))) := + continuous_subtype_val.continuousAt.tendsto.comp hl + have hlu := (continuousMap_limit hU ht).deriv + (Eventually.of_forall (fun n => hS _ (F n).property)) hU + exact hlu.tendsto_at ha + +theorem strict_bound_of_normalized {U : Set ℂ} (hU : IsOpen U) + (hUc : IsPreconnected U) {f : ℂ → ℂ} (hf : DifferentiableOn ℂ f U) + (hb : ∀ z ∈ U, ‖f z‖ ≤ 1) {a : ℂ} (ha : a ∈ U) (hfa : f a = 0) : + MapsTo f U (ball 0 1) := by + intro z hz + rw [mem_ball_zero_iff] + by_contra hn + have he : ‖f z‖ = 1 := le_antisymm (hb _ hz) (le_of_not_gt hn) + have hm : IsMaxOn (norm ∘ f) U z := fun w hw => by + change ‖f w‖ ≤ ‖f z‖ + rw [he] + exact hb w hw + have heq := Complex.norm_eqOn_of_isPreconnected_of_isMaxOn hUc hU hf hz hm ha + simp [hfa, he] at heq + +open Function Complex + +open scoped Pointwise + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/NumericalRange.lean b/lean/OAI/Analysis/DirectCrouzeix/NumericalRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..6ca96cec135dc598eda756e92a706fab49837caf --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/NumericalRange.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.DirectCrouzeix.Model + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +theorem numericalRange_eq_image {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) : + numericalRange A = + (fun u : EuclideanSpace ℂ (Fin n) => inner ℂ u + (Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A u)) '' Metric.sphere 0 1 := by + ext z + simp [numericalRange, Set.mem_image] + +theorem isCompact_numericalRange {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) : + IsCompact (numericalRange A) := by + rw [numericalRange_eq_image] + exact (isCompact_sphere (0 : EuclideanSpace ℂ (Fin n)) 1).image + (continuous_id.inner (Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A).continuous) + +theorem numericalRange_nonempty {n : ℕ} (hn : 0 < n) + (A : Matrix (Fin n) (Fin n) ℂ) : (numericalRange A).Nonempty := by + let : NeZero n := ⟨Nat.ne_of_gt hn⟩ + rw [numericalRange_eq_image] + exact (NormedSpace.sphere_nonempty.mpr (by norm_num : (0 : ℝ) ≤ 1)).image _ + +theorem norm_le_of_mem_numericalRange {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + {z : ℂ} (hz : z ∈ numericalRange A) : ‖z‖ ≤ ‖A‖ := by + obtain ⟨u, hu, rfl⟩ := hz + calc + ‖inner ℂ u (Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A u)‖ + ≤ ‖u‖ * ‖Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A u‖ := + norm_inner_le_norm _ _ + _ ≤ ‖u‖ * (‖Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A‖ * ‖u‖) := + mul_le_mul_of_nonneg_left (ContinuousLinearMap.le_opNorm _ _) (norm_nonneg _) + _ = ‖A‖ := by rw [hu, Matrix.l2_opNorm_toEuclideanCLM]; ring + +theorem continuous_polynomialValue {m d : ℕ} + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) : Continuous (polynomialValue B) := by + unfold polynomialValue + exact continuous_finsetSum _ (fun k _ => (continuous_id.pow _).smul continuous_const) + +theorem rangeMaximum_attained {n m d : ℕ} (hn : 0 < n) + (A : Matrix (Fin n) (Fin n) ℂ) + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) : + ∃ z ∈ numericalRange A, ‖polynomialValue B z‖ = rangeMaximum A B := by + have hc := (isCompact_numericalRange A).image (continuous_polynomialValue B).norm + have hne := (numericalRange_nonempty hn A).image (fun z => ‖polynomialValue B z‖) + obtain ⟨z, hz, he⟩ := hc.sSup_mem hne + exact ⟨z, hz, he⟩ + +theorem norm_polynomialValue_le_rangeMaximum {n m d : ℕ} + (A : Matrix (Fin n) (Fin n) ℂ) + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) + {z : ℂ} (hz : z ∈ numericalRange A) : ‖polynomialValue B z‖ ≤ rangeMaximum A B := by + apply le_csSup + · exact (isCompact_numericalRange A).bddAbove_image + (continuous_polynomialValue B).norm.continuousOn + · exact ⟨z, hz, rfl⟩ + +open scoped MatrixOrder ComplexOrder + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/OuterApproximation.lean b/lean/OAI/Analysis/DirectCrouzeix/OuterApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..90b384e860ab4d1f1dc3a068c16a747a0c341521 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/OuterApproximation.lean @@ -0,0 +1,172 @@ +import OAI.Analysis.DirectCrouzeix.ExponentialSupport + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set + +open scoped ComplexConjugate Matrix + +namespace DirectCrouzeix.Geometry + +theorem exists_exponential_outer {K : Set ℂ} (hK : IsCompact K) (hne : K.Nonempty) + (hv : Convex ℝ K) {ε : ℝ} (hε : 0 < ε) : + ∃ (D : Finset ℂ) (v : D → ℂ) (b : D → ℝ), + (∀ z ∈ K, expLevel v b z < 1) ∧ + IsCompact {z | expLevel v b z ≤ 1} ∧ + (∀ z, expLevel v b z ≤ 1 → ∃ w ∈ K, ‖z-w‖ < ε) := by + classical + obtain ⟨M,hM0,hM⟩ := hK.isBounded.exists_pos_norm_le + let L := 2*(M+1) + let C := 1+L+M + have hC : 0 < C := by dsimp [C,L]; linarith + let δ := min (1/2) (ε/(2*C)) + have hδ : 0 < δ := lt_min (by norm_num) (div_pos hε (by positivity)) + have hδ1 : δ < 1 := lt_of_le_of_lt (min_le_left _ _) (by norm_num) + have hδε : δ*C < ε := by + have hh : δ ≤ ε/(2*C) := min_le_right _ _ + have hc := (le_div_iff₀ (by positivity : 0 < 2*C)).mp hh + nlinarith + obtain ⟨D,hD,h1,hm1,hI,hmI,hnet⟩ := exists_axis_net hδ + let N : ℝ := Fintype.card D + have hN : 0 ≤ N := by dsimp [N]; positivity + let t := (N+1)/δ + have ht : 0 < t := div_pos (by linarith) hδ + have htδ : t*δ = N+1 := div_mul_cancel₀ _ (ne_of_gt hδ) + let v : D → ℂ := fun ν => t • (ν:ℂ) + let b : D → ℝ := fun ν => -t*(convexSupport K ν+δ) + have he (z : ℂ) (ν : D) : inner ℝ (v ν) z+b ν = t*(inner ℝ (ν:ℂ) z-convexSupport K ν-δ) := by + dsimp only [v,b] + rw [real_inner_smul_left] + ring + have hsumlt : N*Real.exp (-t*δ) < 1 := by + rw [neg_mul,htδ,Real.exp_neg,mul_inv_lt_iff₀ (Real.exp_pos _),one_mul] + linarith [Real.add_one_le_exp (N+1)] + have hinside (z : ℂ) (hz : z ∈ K) : expLevel v b z < 1 := by + calc + expLevel v b z ≤ ∑ _ν : D, Real.exp (-t*δ) := by + apply Finset.sum_le_sum + intro ν hν + rw [he] + apply Real.exp_le_exp.mpr + have hh := mul_le_mul_of_nonneg_left (le_convexSupport hK hz (ν:ℂ)) (le_of_lt ht) + nlinarith + _ = N*Real.exp (-t*δ) := by simp [N] + _ < 1 := hsumlt + have hsupport (z : ℂ) (hz : expLevel v b z ≤ 1) (ν : ℂ) (hν : ν ∈ D) : + inner ℝ ν z ≤ convexSupport K ν+δ := by + have hh : Real.exp (inner ℝ (v ⟨ν,hν⟩) z+b ⟨ν,hν⟩) ≤ expLevel v b z := + Finset.single_le_sum (f := fun i : D => Real.exp (inner ℝ (v i) z+b i)) + (fun i _ => Real.exp_nonneg _) (Finset.mem_univ (⟨ν,hν⟩ : D)) + have hex := (Real.exp_le_one_iff).mp (hh.trans hz) + rw [he] at hex + nlinarith + have hbound (z : ℂ) (hz : expLevel v b z ≤ 1) : ‖z‖ ≤ L := by + have hh := axis_support_bound hne hM h1 hm1 hI hmI (hsupport z hz) + dsimp [L] + linarith + refine ⟨D,v,b,hinside,?_,?_⟩ + · apply (isCompact_closedBall (0:ℂ) L).of_isClosed_subset + · exact isClosed_le (expLevel_contDiff v b).continuous continuous_const + · intro z hz + exact mem_closedBall_zero_iff.mpr (hbound z hz) + · intro z hz + obtain ⟨w,hw,hzw⟩ := direction_net_distance hK hne hv hδ hM hnet (hbound z hz) (hsupport z hz) + exact ⟨w,hw,lt_of_le_of_lt hzw hδε⟩ + +end DirectCrouzeix.Geometry + +namespace DirectCrouzeix + +@[simp] theorem matrixPolynomialValue_coefficientPolynomial {m d : ℕ} + (B : Fin (d+1) → Matrix (Fin m) (Fin m) ℂ) (z : ℂ) : + matrixPolynomialValue z (coefficientPolynomial B) = polynomialValue B z := by + simp only [coefficientPolynomial,map_sum,map_mul,map_pow,matrixPolynomialValue_C, + matrixPolynomialValue_X,smul_pow,one_pow,Matrix.mul_smul,Matrix.mul_one,polynomialValue] + +@[simp] theorem matrixPolynomialValue_smul {m : ℕ} (F : MatrixPolynomial m) (s z : ℂ) : + matrixPolynomialValue z (s • F) = s • matrixPolynomialValue z F := by + rw [← smul_one_smul (Matrix (Fin m) (Fin m) ℂ) s F,Polynomial.smul_eq_C_mul, + map_mul,matrixPolynomialValue_C,Matrix.smul_mul,Matrix.one_mul] + +@[simp] theorem tensorPolynomial_smul {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (F : MatrixPolynomial m) (s : ℂ) : + tensorPolynomial A (s • F) = s • tensorPolynomial A F := by + rw [← smul_one_smul (Matrix (Fin m) (Fin m) ℂ) s F,Polynomial.smul_eq_C_mul, + map_mul,tensorPolynomial_C,Matrix.kronecker_smul,Matrix.one_kronecker_one, + Matrix.smul_mul,Matrix.one_mul] + +end DirectCrouzeix + +namespace DirectCrouzeix + +open Set Filter Metric + +end DirectCrouzeix + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/PoissonBoundary.lean b/lean/OAI/Analysis/DirectCrouzeix/PoissonBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..cbc2d979c88f38d68f85668d750778d4d62ba7e6 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/PoissonBoundary.lean @@ -0,0 +1,245 @@ +import OAI.Analysis.DirectCrouzeix.DiskMapping + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix + +namespace Conformal + +open Function Complex + +open scoped Pointwise + +open InnerProductSpace Real + +def poissonExtension (R : ℝ) (u : ℂ → ℝ) (z : ℂ) : ℝ := + Real.circleAverage (fun ζ => poissonKernel 0 z ζ * u ζ) 0 R + +theorem poisson_continuous_circle {R : ℝ} {z : ℂ} (hz : z ∈ ball 0 R) : + ContinuousOn (poissonKernel 0 z) (sphere 0 |R|) := by + rw [poissonKernel_eq_re_herglotzRieszKernel] + exact Complex.continuous_re.comp_continuousOn + (continuousOn_herglotzRieszKernel_sphere + (by simpa using ne_of_lt ((mem_ball_zero_iff.mp hz).trans_le (le_abs_self R)))) + +theorem poisson_nonnegative_circle {R : ℝ} {z ζ : ℂ} + (hz : z ∈ ball 0 R) (hζ : ζ ∈ sphere 0 R) : 0 ≤ poissonKernel 0 z ζ := by + have hz' := mem_ball_zero_iff.mp hz + have hζ' : ‖ζ‖ = R := by simpa using hζ + dsimp [poissonKernel] + simp only [sub_zero] + apply div_nonneg _ (sq_nonneg _) + nlinarith [norm_nonneg z] + +theorem poisson_average_one {R : ℝ} {z : ℂ} (hz : z ∈ ball 0 R) : + Real.circleAverage (poissonKernel 0 z) 0 R = 1 := by + simpa only [Pi.smul_def, Pi.mul_def, smul_eq_mul, mul_one] using (harmonicContOnCl_const (c := (1 : ℝ)) + (s := ball 0 R)).circleAverage_poissonKernel_smul hz + +theorem poisson_boundary_limit {R : ℝ} (hR : 0 < R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) {p : ℂ} (hp : p ∈ sphere 0 R) : + Tendsto (poissonExtension R u) (𝓝[ball 0 R] p) (𝓝 (u p)) := by + have hp' : ‖p‖ = R := by simpa using hp + have huabs : ContinuousOn (fun ζ => |u ζ - u p|) (sphere 0 R) := + (hu.sub continuousOn_const).abs + obtain ⟨M, hM⟩ := (isCompact_sphere (0 : ℂ) R).exists_bound_of_continuousOn huabs + have hM0 : 0 ≤ M := (norm_nonneg (|u p - u p|)).trans (hM p hp) + have hbound : ∀ ζ ∈ sphere 0 R, |u ζ - u p| ≤ M := by + intro ζ hζ + simpa only [Real.norm_eq_abs, abs_abs] using hM ζ hζ + rw [Metric.tendsto_nhds] + intro ε hε + obtain ⟨δ, hδ, hd⟩ := Metric.continuousWithinAt_iff.mp (hu p hp) (ε / 2) (half_pos hε) + let C := 4 * M / δ ^ 2 + have hC : 0 ≤ C := by dsimp [C]; positivity + have hnear : ∀ᶠ z in 𝓝[ball 0 R] p, dist z p < δ / 2 := + (show ∀ᶠ z in 𝓝 p, dist z p < δ / 2 from ball_mem_nhds p (half_pos hδ)).filter_mono nhdsWithin_le_nhds + have hsmall : ∀ᶠ z in 𝓝[ball 0 R] p, C * (R ^ 2 - ‖z‖ ^ 2) < ε / 2 := by + have ht : Tendsto (fun z : ℂ => C * (R ^ 2 - ‖z‖ ^ 2)) (𝓝 p) (𝓝 0) := by + simpa only [hp', sub_self, mul_zero] using + ((show Continuous (fun z : ℂ => C * (R ^ 2 - ‖z‖ ^ 2)) from by fun_prop).tendsto p) + exact (ht.eventually (gt_mem_nhds (half_pos hε))).filter_mono nhdsWithin_le_nhds + filter_upwards [hnear, hsmall, self_mem_nhdsWithin] with z hz hzs hzU + have hP : ContinuousOn (poissonKernel 0 z) (sphere 0 R) := by + simpa only [abs_of_pos hR] using poisson_continuous_circle hzU + have hn (ζ : ℂ) (hζ : ζ ∈ sphere 0 R) := poisson_nonnegative_circle hzU hζ + have hL : 0 ≤ R ^ 2 - ‖z‖ ^ 2 := by + have hh := mem_ball_zero_iff.mp hzU + nlinarith [norm_nonneg z] + have hest : ∀ ζ ∈ sphere 0 R, + poissonKernel 0 z ζ * |u ζ - u p| ≤ + poissonKernel 0 z ζ * (ε / 2) + C * (R ^ 2 - ‖z‖ ^ 2) := by + intro ζ hζ + by_cases hclose : dist ζ p < δ + · have hd' : |u ζ - u p| < ε / 2 := by + simpa only [Real.dist_eq] using hd hζ hclose + have hh := mul_le_mul_of_nonneg_left hd'.le (hn ζ hζ) + have hh' : 0 ≤ C * (R ^ 2 - ‖z‖ ^ 2) := mul_nonneg hC hL + linarith + · have hζnorm : ‖ζ‖ = R := by simpa using hζ + have hdist : δ / 2 ≤ ‖ζ - z‖ := by + have hh := dist_triangle ζ z p + rw [dist_eq_norm ζ z] at hh + linarith [le_of_not_gt hclose] + have hden : 0 < ‖ζ - z‖ ^ 2 := sq_pos_of_pos ((half_pos hδ).trans_le hdist) + have hpk : poissonKernel 0 z ζ ≤ 4 * (R ^ 2 - ‖z‖ ^ 2) / δ ^ 2 := by + dsimp [poissonKernel] + simp only [sub_zero, hζnorm] + rw [div_le_div_iff₀ hden (sq_pos_of_pos hδ)] + have hden' : δ ^ 2 ≤ 4 * ‖ζ - z‖ ^ 2 := by nlinarith + nlinarith [mul_nonneg hL (sub_nonneg.mpr hden')] + have hh := mul_le_mul (hbound ζ hζ) hpk (hn ζ hζ) hM0 + have hright : 0 ≤ poissonKernel 0 z ζ * (ε / 2) := mul_nonneg (hn ζ hζ) (half_pos hε).le + dsimp [C] + have halg : M * (4 * (R ^ 2 - ‖z‖ ^ 2) / δ ^ 2) = + 4 * M / δ ^ 2 * (R ^ 2 - ‖z‖ ^ 2) := by ring + rw [mul_comm |u ζ - u p|, halg] at hh + linarith + have hi : CircleIntegrable (fun ζ => poissonKernel 0 z ζ * (u ζ - u p)) 0 R := + (hP.mul (hu.sub continuousOn_const)).circleIntegrable hR.le + have heq : poissonExtension R u z - u p = + Real.circleAverage (fun ζ => poissonKernel 0 z ζ * (u ζ - u p)) 0 R := by + dsimp [poissonExtension] + have ht := Real.circleAverage_fun_sub + (f₁ := fun ζ => poissonKernel 0 z ζ * u ζ) + (f₂ := fun ζ => poissonKernel 0 z ζ * u p) + ((hP.mul hu).circleIntegrable hR.le) + ((hP.mul_const (u p)).circleIntegrable hR.le) + simp_rw [mul_sub] + rw [ht] + congr 1 + simp_rw [mul_comm _ (u p), ← smul_eq_mul] + rw [Real.circleAverage_fun_smul, poisson_average_one hzU, smul_eq_mul, mul_one] + rw [Real.dist_eq, heq] + calc + |Real.circleAverage (fun ζ => poissonKernel 0 z ζ * (u ζ - u p)) 0 R| + ≤ Real.circleAverage (fun ζ => |poissonKernel 0 z ζ * (u ζ - u p)|) 0 R := + Real.abs_circleAverage_le_circleAverage_abs + _ ≤ Real.circleAverage + (fun ζ => poissonKernel 0 z ζ * (ε / 2) + C * (R ^ 2 - ‖z‖ ^ 2)) 0 R := by + apply Real.circleAverage_mono hi.abs + (((hP.mul_const (ε / 2)).add_const _).circleIntegrable hR.le) + intro ζ hζ + have hζ' : ζ ∈ sphere 0 R := by simpa only [abs_of_pos hR] using hζ + change |poissonKernel 0 z ζ * (u ζ - u p)| ≤ _ + rw [abs_mul, abs_of_nonneg (hn ζ hζ')] + exact hest ζ hζ' + _ = ε / 2 + C * (R ^ 2 - ‖z‖ ^ 2) := by + rw [Real.circleAverage_fun_add ((hP.mul_const (ε / 2)).circleIntegrable hR.le) + (by exact continuousOn_const.circleIntegrable hR.le), Real.circleAverage_const] + congr 1 + simp_rw [mul_comm _ (ε / 2), ← smul_eq_mul] + rw [Real.circleAverage_fun_smul, poisson_average_one hzU, smul_eq_mul, mul_one] + _ < ε := by linarith + +theorem harmonic_eventually_eq_of_isLocalMax {u : ℂ → ℝ} {a : ℂ} + (hu : HarmonicAt u a) (hm : IsLocalMax u a) : + u =ᶠ[𝓝 a] (fun _ => u a) := by + obtain ⟨r, hr, hB⟩ := Metric.isOpen_iff.mp (isOpen_setOfPred_harmonicAt u) a hu + obtain ⟨F, hF, hRe⟩ := (show HarmonicOnNhd u (ball a r) from hB).exists_analyticOnNhd_ball_re_eq + have hd : ∀ᶠ z in 𝓝 a, DifferentiableAt ℂ (fun z => Complex.exp (F z)) z := by + filter_upwards [ball_mem_nhds a hr] with z hz + exact (hF z hz).differentiableAt.cexp + have hmax : IsLocalMax (norm ∘ (fun z => Complex.exp (F z))) a := by + filter_upwards [hm, ball_mem_nhds a hr] with z hz hzB + simpa only [Function.comp_apply, Complex.norm_exp, hRe hzB, + hRe (mem_ball_self hr), Real.exp_le_exp] using hz + have he := Complex.norm_eventually_eq_of_isLocalMax hd hmax + filter_upwards [he, ball_mem_nhds a hr] with z hz hzB + simpa only [Complex.norm_exp, hRe hzB, hRe (mem_ball_self hr), Real.exp_eq_exp] using hz + +theorem harmonic_le_boundary {U : Set ℂ} (hU : IsOpen U) + (hb : Bornology.IsBounded U) {u : ℂ → ℝ} + (hu : HarmonicContOnCl u U) {M : ℝ} + (hM : ∀ z ∈ frontier U, u z ≤ M) : + ∀ z ∈ closure U, u z ≤ M := by + intro z hz + by_contra hle + obtain ⟨a, ha, hmax⟩ := hb.isCompact_closure.exists_isMaxOn ⟨z, hz⟩ hu.2 + have hhigh : M < u a := (lt_of_not_ge hle).trans_le (hmax hz) + let S := {x ∈ closure U | u x = u a} + have hSc : IsCompact S := by + exact hb.isCompact_closure.of_isClosed_subset + (hu.2.preimage_isClosed_of_isClosed isClosed_closure isClosed_singleton) (by intro x hx; exact hx.1) + have hSo : IsOpen S := by + rw [isOpen_iff_mem_nhds] + intro x hx + have hxU : x ∈ U := by + by_contra hn + have hf : x ∈ frontier U := by + rw [frontier, hU.interior_eq] + exact ⟨hx.1, hn⟩ + exact (not_le_of_gt hhigh) (hx.2 ▸ hM x hf) + have hxmax : IsLocalMax u x := by + filter_upwards [hU.mem_nhds hxU] with y hy + exact hx.2 ▸ hmax (subset_closure hy) + have he := harmonic_eventually_eq_of_isLocalMax (hu.1 x hxU) hxmax + filter_upwards [he, hU.mem_nhds hxU] with y hy hyU + exact ⟨subset_closure hyU, hy.trans hx.2⟩ + have hSne : S.Nonempty := ⟨a, ha, rfl⟩ + have hSun : S = univ := (show IsClopen S from ⟨hSc.isClosed, hSo⟩).eq_univ hSne + exact hSc.ne_univ hSun + +def herglotzExtension (R : ℝ) (u : ℂ → ℝ) (z : ℂ) : ℂ := + Real.circleAverage (fun ζ => herglotzRieszKernel 0 z ζ * (u ζ : ℂ)) 0 R + +theorem herglotz_analytic {R : ℝ} (hR : 0 ≤ R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) : + AnalyticOnNhd ℂ (herglotzExtension R u) (ball 0 R) := by + exact (analyticOnNhd_circleAverage_herglotzRieszKernel_smul + ((Complex.continuous_ofReal.comp_continuousOn hu).circleIntegrable hR)).mono + (by intro z hz; simpa [abs_of_nonneg hR] using ne_of_lt (mem_ball_zero_iff.mp hz)) + +theorem herglotz_re {R : ℝ} (hR : 0 ≤ R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) {z : ℂ} (hz : z ∈ ball 0 R) : + (herglotzExtension R u z).re = poissonExtension R u z := by + have hi : CircleIntegrable + (fun ζ => herglotzRieszKernel 0 z ζ * (u ζ : ℂ)) 0 R := by + exact ((continuousOn_herglotzRieszKernel_sphere + (by simpa [abs_of_nonneg hR] using ne_of_lt (mem_ball_zero_iff.mp hz))).mul + (Complex.continuous_ofReal.comp_continuousOn (by simpa only [abs_of_nonneg hR] using hu))).circleIntegrable' + change Complex.reCLM (Real.circleAverage (fun ζ => herglotzRieszKernel 0 z ζ * (u ζ : ℂ)) 0 R) = _ + rw [← Complex.reCLM.circleAverage_comp_comm hi] + dsimp [poissonExtension] + congr 1 + ext ζ + simp [poissonKernel_eq_re_herglotzRieszKernel] + +theorem poisson_harmonic {R : ℝ} (hR : 0 ≤ R) {u : ℂ → ℝ} + (hu : ContinuousOn u (sphere 0 R)) : + HarmonicOnNhd (poissonExtension R u) (ball 0 R) := by + intro z hz + have he : (poissonExtension R u) =ᶠ[𝓝 z] + (fun w => (herglotzExtension R u w).re) := by + filter_upwards [isOpen_ball.mem_nhds hz] with w hw + exact (herglotz_re hR hu hw).symm + rw [harmonicAt_congr_nhds he] + exact ((herglotz_analytic hR hu z hz).harmonicAt.comp_CLM Complex.reCLM) + +end Conformal + +end DirectCrouzeix + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/PolynomialCalculus.lean b/lean/OAI/Analysis/DirectCrouzeix/PolynomialCalculus.lean new file mode 100644 index 0000000000000000000000000000000000000000..1007f8162e45a92f70d8ff9080e2392f8a8080fb --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/PolynomialCalculus.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.DirectCrouzeix.Resolvent + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +def exteriorCorrection (h q : ℂ → ℂ) (ζ μ : ℂ) : ℂ := + q ζ / (h ζ - h μ) - ζ / (ζ - μ) + +def exteriorKernel (h q : ℂ → ℂ) (ζ μ : ℂ) : ℝ := + 1 + (exteriorCorrection h q ζ μ).re + (star (exteriorCorrection h q ζ μ)).re + +theorem re_circle_fraction {ζ μ : ℂ} (hζ : ‖ζ‖ = 1) (hμ : ‖μ‖ = 1) + (hne : ζ ≠ μ) : 2 * (ζ / (ζ - μ)).re = 1 := by + have hnζ : ζ.re ^ 2 + ζ.im ^ 2 = 1 := by + simpa [Complex.normSq_apply, pow_two] using + (show Complex.normSq ζ = 1 by rw [Complex.normSq_eq_norm_sq, hζ]; norm_num) + have hnμ : μ.re ^ 2 + μ.im ^ 2 = 1 := by + simpa [Complex.normSq_apply, pow_two] using + (show Complex.normSq μ = 1 by rw [Complex.normSq_eq_norm_sq, hμ]; norm_num) + have hd : Complex.normSq (ζ - μ) ≠ 0 := by + exact mt Complex.normSq_eq_zero.mp (sub_ne_zero.mpr hne) + rw [Complex.div_re] + field_simp + simp [Complex.normSq_apply, Complex.sub_re, Complex.sub_im] at * + nlinarith + +theorem exteriorKernel_nonneg_off_diagonal (h q : ℂ → ℂ) + {ζ μ : ℂ} (hζ : ‖ζ‖ = 1) (hμ : ‖μ‖ = 1) (hne : ζ ≠ μ) + (hs : 0 ≤ (star (q ζ) * (h ζ - h μ)).re) : + 0 ≤ exteriorKernel h q ζ μ := by + have hfrac := re_circle_fraction hζ hμ hne + have hp : 0 ≤ (q ζ / (h ζ - h μ)).re := by + rw [Complex.div_re, ← add_div] + apply div_nonneg _ (Complex.normSq_nonneg _) + simpa [Complex.mul_re] using hs + simp only [exteriorKernel, exteriorCorrection, Complex.sub_re, Complex.star_def, + Complex.conj_re] + linarith + +def coefficientEmbedding (n m : ℕ) : + Matrix (Fin m) (Fin m) ℂ →+* + Matrix (Fin n × Fin m) (Fin n × Fin m) ℂ where + toFun B := (1 : Matrix (Fin n) (Fin n) ℂ) ⊗ₖ B + map_zero' := Matrix.kronecker_zero _ + map_one' := Matrix.one_kronecker_one + map_add' B C := Matrix.kronecker_add _ B C + map_mul' B C := by + simpa using Matrix.mul_kronecker_mul + (1 : Matrix (Fin n) (Fin n) ℂ) 1 B C + +def tensorPolynomial {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) : + Polynomial (Matrix (Fin m) (Fin m) ℂ) →+* + Matrix (Fin n × Fin m) (Fin n × Fin m) ℂ := + Polynomial.eval₂RingHom' (coefficientEmbedding n m) + (A ⊗ₖ (1 : Matrix (Fin m) (Fin m) ℂ)) (by + intro B + change (1 ⊗ₖ B) * (A ⊗ₖ 1) = (A ⊗ₖ 1) * (1 ⊗ₖ B) + rw [← Matrix.mul_kronecker_mul, ← Matrix.mul_kronecker_mul] + simp) + +def coefficientPolynomial {m d : ℕ} + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) : + Polynomial (Matrix (Fin m) (Fin m) ℂ) := + ∑ k : Fin (d + 1), Polynomial.C (B k) * Polynomial.X ^ (k : ℕ) + +theorem kronecker_pow_one {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) (k : ℕ) : + (A ⊗ₖ (1 : Matrix (Fin m) (Fin m) ℂ)) ^ k = (A ^ k) ⊗ₖ 1 := by + induction k with + | zero => simp + | succ k ih => + rw [pow_succ, ih, ← Matrix.mul_kronecker_mul] + simp [pow_succ] + +@[simp] theorem tensorPolynomial_C {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (B : Matrix (Fin m) (Fin m) ℂ) : + tensorPolynomial A (Polynomial.C B) = (1 : Matrix (Fin n) (Fin n) ℂ) ⊗ₖ B := by + exact Polynomial.eval₂_C _ _ + +@[simp] theorem tensorPolynomial_X {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) : + tensorPolynomial (m := m) A Polynomial.X = A ⊗ₖ (1 : Matrix (Fin m) (Fin m) ℂ) := by + exact Polynomial.eval₂_X _ _ + +theorem tensorPolynomial_coefficientPolynomial {n m d : ℕ} + (A : Matrix (Fin n) (Fin n) ℂ) + (B : Fin (d + 1) → Matrix (Fin m) (Fin m) ℂ) : + tensorPolynomial A (coefficientPolynomial B) = tensorEvaluation A B := by + simp only [coefficientPolynomial, map_sum, map_mul, map_pow, + tensorPolynomial_C, tensorPolynomial_X, kronecker_pow_one, + ← Matrix.mul_kronecker_mul, Matrix.one_mul, Matrix.mul_one, tensorEvaluation] + +theorem tensorPolynomial_mul {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (F G : Polynomial (Matrix (Fin m) (Fin m) ℂ)) : + tensorPolynomial A (F * G) = tensorPolynomial A F * tensorPolynomial A G := + map_mul _ _ _ + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/PolynomialEnergy.lean b/lean/OAI/Analysis/DirectCrouzeix/PolynomialEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..443ca47dfbb234e50ddb3d546ad0bdbe0b649079 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/PolynomialEnergy.lean @@ -0,0 +1,225 @@ +import OAI.Analysis.DirectCrouzeix.BoundaryEnergy + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +open MeasureTheory + +abbrev MatrixPolynomial (m : ℕ) := Polynomial (Matrix (Fin m) (Fin m) ℂ) + +def matrixPolynomialValue {m : ℕ} (z : ℂ) : + MatrixPolynomial m →+* Matrix (Fin m) (Fin m) ℂ := + Polynomial.eval₂RingHom' (RingHom.id _) (z • 1) (by + intro C + change C * (z • 1) = (z • 1) * C + simp []) + +@[simp] theorem matrixPolynomialValue_C {m : ℕ} (z : ℂ) + (C : Matrix (Fin m) (Fin m) ℂ) : matrixPolynomialValue z (Polynomial.C C) = C := by + exact Polynomial.eval₂_C _ _ + +@[simp] theorem matrixPolynomialValue_X {m : ℕ} (z : ℂ) : + matrixPolynomialValue (m := m) z Polynomial.X = z • 1 := by + exact Polynomial.eval₂_X _ _ + +theorem continuous_matrixPolynomialValue {m : ℕ} (G : MatrixPolynomial m) : + Continuous (fun z => matrixPolynomialValue z G) := + (G.continuous_eval₂ (RingHom.id _)).comp (continuous_id.smul continuous_const) + +def scalarMatrixPolynomial {m : ℕ} (p : Polynomial ℂ) : MatrixPolynomial m := + p.map (algebraMap ℂ (Matrix (Fin m) (Fin m) ℂ)) + +theorem matrixPolynomialValue_scalar {m : ℕ} (p : Polynomial ℂ) (z : ℂ) : + matrixPolynomialValue (m := m) z (scalarMatrixPolynomial p) = p.eval z • 1 := by + induction p using Polynomial.induction_on' with + | add p q hp hq => + simp only [scalarMatrixPolynomial,Polynomial.map_add,map_add] at * + rw [hp,hq,Polynomial.eval_add,add_smul] + | monomial k c => + simp only [scalarMatrixPolynomial,← Polynomial.C_mul_X_pow_eq_monomial, + Polynomial.map_mul,Polynomial.map_C,Polynomial.map_pow,Polynomial.map_X,map_mul,map_pow,matrixPolynomialValue_C,matrixPolynomialValue_X,Polynomial.eval_mul, + Polynomial.eval_C,Polynomial.eval_pow,Polynomial.eval_X] + simp only [Algebra.algebraMap_eq_smul_one,smul_pow,one_pow,Matrix.smul_mul,Matrix.mul_smul, + Matrix.one_mul,smul_smul] + rw [mul_comm] + +theorem tensorPolynomial_scalar {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (p : Polynomial ℂ) : + tensorPolynomial (m := m) A (scalarMatrixPolynomial p) = (Polynomial.aeval A p) ⊗ₖ 1 := by + induction p using Polynomial.induction_on' with + | add p q hp hq => + simp only [scalarMatrixPolynomial,Polynomial.map_add,map_add] at * + rw [hp,hq,Matrix.add_kronecker] + | monomial k c => + simp only [scalarMatrixPolynomial,← Polynomial.C_mul_X_pow_eq_monomial, + Polynomial.map_mul,Polynomial.map_C,Polynomial.map_pow,Polynomial.map_X,map_mul,map_pow,tensorPolynomial_C,tensorPolynomial_X,Polynomial.aeval_C, + Polynomial.aeval_X,kronecker_pow_one,Algebra.algebraMap_eq_smul_one, + Matrix.smul_kronecker,Matrix.kronecker_smul,← Matrix.mul_kronecker_mul, + Matrix.smul_mul,Matrix.one_mul,Matrix.mul_one] + +def faberPolynomial {m N : ℕ} (b : ℕ → Polynomial ℂ) + (C : Fin N → Matrix (Fin m) (Fin m) ℂ) : MatrixPolynomial m := + ∑ k : Fin N, Polynomial.C (C k) * scalarMatrixPolynomial (b k) + +theorem matrixPolynomialValue_faber {m N : ℕ} (b : ℕ → Polynomial ℂ) + (C : Fin N → Matrix (Fin m) (Fin m) ℂ) (z : ℂ) : + matrixPolynomialValue z (faberPolynomial b C) = ∑ k : Fin N, (b k).eval z • C k := by + simp only [faberPolynomial,map_sum,map_mul,matrixPolynomialValue_C,matrixPolynomialValue_scalar, + Matrix.mul_smul,Matrix.mul_one] + +theorem tensorPolynomial_faber {n m N : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (b : ℕ → Polynomial ℂ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ) : + tensorPolynomial A (faberPolynomial b C) = ∑ k : Fin N, Polynomial.aeval A (b k) ⊗ₖ C k := by + simp only [faberPolynomial,map_sum,map_mul,tensorPolynomial_C,tensorPolynomial_scalar, + ← Matrix.mul_kronecker_mul,Matrix.one_mul,Matrix.mul_one] + +theorem faber_pairing {n m N : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (b : ℕ → Polynomial ℂ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ) + (X Y : Matrix (Fin n) (Fin m) ℂ) : + inner ℂ (hsVector Y) (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) + (tensorPolynomial A (faberPolynomial b C)) (hsVector X)) = + ∑ k : Fin N, entryPair (Yᴴ * Polynomial.aeval A (b k) * X) (C k) := by + simp only [tensorPolynomial_faber,map_sum,sum_apply,inner_sum,tensor_entryPair] + +def polynomialEnergy {m : ℕ} (h : BoundaryCircle → ℂ) (G : MatrixPolynomial m) : ℝ := + ∫ t, hsSq (matrixPolynomialValue (h t) G) ∂circleMeasure + +theorem polynomialEnergy_nonneg {m : ℕ} (h : BoundaryCircle → ℂ) (G : MatrixPolynomial m) : + 0 ≤ polynomialEnergy h G := integral_nonneg (fun _ => hsSq_nonneg _) + +theorem polynomialEnergy_mul_le {m : ℕ} (h : BoundaryCircle → ℂ) (hh : Continuous h) + (F G : MatrixPolynomial m) (hF : ∀ t, ‖matrixPolynomialValue (h t) F‖ ≤ 1) : + polynomialEnergy h (F * G) ≤ polynomialEnergy h G ∧ + polynomialEnergy h (G * F) ≤ polynomialEnergy h G := by + have hint (H : MatrixPolynomial m) : + Integrable (fun t => hsSq (matrixPolynomialValue (h t) H)) circleMeasure := + continuous_integrable_compact _ + (continuous_hsSq.comp ((continuous_matrixPolynomialValue H).comp hh)) + constructor + · apply integral_mono (hint _) (hint _) + intro t + change hsSq (matrixPolynomialValue (h t) (F * G)) ≤ _ + rw [map_mul] + exact (hsSq_mul_le _ _).trans (by + have hn := pow_le_pow_left₀ (norm_nonneg _) (hF t) 2 + simpa using mul_le_mul_of_nonneg_right hn (hsSq_nonneg (matrixPolynomialValue (h t) G))) + · apply integral_mono (hint _) (hint _) + intro t + change hsSq (matrixPolynomialValue (h t) (G * F)) ≤ _ + rw [map_mul] + exact (hsSq_mul_le_right _ _).trans (by + have hn := pow_le_pow_left₀ (norm_nonneg _) (hF t) 2 + simpa using mul_le_mul_of_nonneg_left hn (hsSq_nonneg (matrixPolynomialValue (h t) G))) + +theorem cross_boundary_estimate {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (b : ℕ → Polynomial ℂ) (h : BoundaryCircle → ℂ) + (hexpand : ∀ G : MatrixPolynomial m, ∃ (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + G = faberPolynomial b C) + (hlower : ∀ N (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + ∑ k, hsSq (C k) ≤ polynomialEnergy h (faberPolynomial b C)) + (R : BoundaryCircle → Matrix (Fin n) (Fin n) ℂ) (hR : Continuous R) + (hcoeff : ∀ k : ℕ, fourierCoeff R (-(k : ℤ)) = Polynomial.aeval A (b k)) + (X Y : Matrix (Fin n) (Fin m) ℂ) (G : MatrixPolynomial m) : + ‖inner ℂ (hsVector Y) (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) + (tensorPolynomial A G) (hsVector X))‖ ^ 2 ≤ + (∫ t, hsSq (Yᴴ * R t * X) ∂circleMeasure) * polynomialEnergy h G := by + obtain ⟨N,C,rfl⟩ := hexpand G + rw [faber_pairing] + let M := fun t => Yᴴ * R t * X + have hM : Continuous M := (compressionCLM X Y).continuous.comp hR + have hMc (k : ℕ) : fourierCoeff M (-(k : ℤ)) = Yᴴ * Polynomial.aeval A (b k) * X := by + rw [fourierCoeff_compression X Y R hR,hcoeff] + have hb := finite_negative_bessel M hM N + simp_rw [hMc] at hb + have hb0 : 0 ≤ ∫ t, hsSq (M t) ∂circleMeasure := integral_nonneg (fun _ => hsSq_nonneg _) + exact (norm_sum_entryPair_sq_le _ C).trans + ((mul_le_mul_of_nonneg_right hb (Finset.sum_nonneg (fun _ _ => hsSq_nonneg _))).trans + (mul_le_mul_of_nonneg_left (hlower N C) hb0)) + +theorem singular_ordered_pairings {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (F G : MatrixPolynomial m) (x y : EuclideanSpace ℂ (Fin n × Fin m)) (γ : ℝ) + (hFx : Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A F) x = + (γ : ℂ) • y) + (hFy : ContinuousLinearMap.adjoint + (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A F)) y = + (γ : ℂ) • x) : + inner ℂ y (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A (F * G)) x) = + (γ : ℂ) + * inner ℂ x (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A G) x) ∧ + inner ℂ y (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A (G * F)) x) = + (γ : ℂ) + * inner ℂ y (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A G) y) := by + simp only [map_mul,mul_apply_eq_comp] + constructor + · rw [← ContinuousLinearMap.adjoint_inner_left,hFy,inner_smul_left] + simp + · rw [hFx,map_smul,inner_smul_right] + +theorem singular_diagonal_estimates {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (b : ℕ → Polynomial ℂ) (h : BoundaryCircle → ℂ) (hh : Continuous h) + (hexpand : ∀ G : MatrixPolynomial m, ∃ (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + G = faberPolynomial b C) + (hlower : ∀ N (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + ∑ k, hsSq (C k) ≤ polynomialEnergy h (faberPolynomial b C)) + (hupper : ∀ N (C : Fin N → Matrix (Fin m) (Fin m) ℂ), + polynomialEnergy h (faberPolynomial b C) ≤ ∑ k : Fin N, faberWeight k * hsSq (C k)) + (R : BoundaryCircle → Matrix (Fin n) (Fin n) ℂ) (hR : Continuous R) + (hcoeff : ∀ k : ℕ, fourierCoeff R (-(k : ℤ)) = Polynomial.aeval A (b k)) + (F : MatrixPolynomial m) (hF : ∀ t, ‖matrixPolynomialValue (h t) F‖ ≤ 1) + (X Y : Matrix (Fin n) (Fin m) ℂ) (γ : ℝ) (hγ : 0 < γ) + (hFx : Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A F) (hsVector X) = + (γ : ℂ) • hsVector Y) + (hFy : ContinuousLinearMap.adjoint + (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (tensorPolynomial A F)) (hsVector Y) = + (γ : ℂ) • hsVector X) : + let a := ∫ t, hsSq (Yᴴ * R t * X) ∂circleMeasure + (hsSq (Xᴴ * Polynomial.aeval A (b 0) * X) + (1/2 : ℝ) * + ∑' k : ℕ, hsSq (Xᴴ * Polynomial.aeval A (b (k+1)) * X) ≤ a / γ^2) ∧ + (hsSq (Yᴴ * Polynomial.aeval A (b 0) * Y) + (1/2 : ℝ) * + ∑' k : ℕ, hsSq (Yᴴ * Polynomial.aeval A (b (k+1)) * Y) ≤ a / γ^2) := by + dsimp only + let a := ∫ t, hsSq (Yᴴ * R t * X) ∂circleMeasure + have ha : 0 ≤ a := integral_nonneg (fun _ => hsSq_nonneg _) + have hdiv : 0 ≤ a / γ^2 := div_nonneg ha (sq_nonneg _) + have htest (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ) := + singular_ordered_pairings A F (faberPolynomial b C) (hsVector X) (hsVector Y) γ hFx hFy + have hbound (N : ℕ) (C : Fin N → Matrix (Fin m) (Fin m) ℂ) : + (‖∑ k : Fin N, entryPair (Xᴴ * Polynomial.aeval A (b k) * X) (C k)‖^2 ≤ + (a / γ^2) * ∑ k : Fin N, faberWeight k * hsSq (C k)) ∧ + (‖∑ k : Fin N, entryPair (Yᴴ * Polynomial.aeval A (b k) * Y) (C k)‖^2 ≤ + (a / γ^2) * ∑ k : Fin N, faberWeight k * hsSq (C k)) := by + have hs := htest N C + simp only [faber_pairing] at hs + have hv := cross_boundary_estimate A b h hexpand hlower R hR hcoeff X Y + have hl := hv (F * faberPolynomial b C) + have hr := hv (faberPolynomial b C * F) + rw [hs.1,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hγ,mul_pow] at hl + rw [hs.2,norm_mul,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hγ,mul_pow] at hr + have hm := polynomialEnergy_mul_le h hh F (faberPolynomial b C) hF + have hl' := hl.trans (mul_le_mul_of_nonneg_left (hm.1.trans (hupper N C)) ha) + have hr' := hr.trans (mul_le_mul_of_nonneg_left (hm.2.trans (hupper N C)) ha) + constructor + · rw [div_mul_eq_mul_div] + apply (le_div_iff₀ (sq_pos_of_pos hγ)).mpr + convert hl' using 1 ; ring + · rw [div_mul_eq_mul_div] + apply (le_div_iff₀ (sq_pos_of_pos hγ)).mpr + convert hr' using 1 ; ring + constructor + · exact weighted_sequence_dual (fun k => Xᴴ * Polynomial.aeval A (b k) * X) + (a / γ^2) hdiv (fun N C => (hbound N C).1) + · exact weighted_sequence_dual (fun k => Yᴴ * Polynomial.aeval A (b k) * Y) + (a / γ^2) hdiv (fun N C => (hbound N C).2) + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/PositiveBlocks.lean b/lean/OAI/Analysis/DirectCrouzeix/PositiveBlocks.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7787904dedc05f3fea0e20106353b88ab7474f7 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/PositiveBlocks.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.DirectCrouzeix.NumericalRange + +namespace OAI + +universe u_1 u_2 u_3 u_4 u_5 u_6 u_7 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +def hsSq {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] (M : Matrix ι κ ℂ) : ℝ := + (Matrix.trace (Mᴴ * M)).re + +theorem hsSq_nonneg {ι : Type u_3} {κ : Type u_4} [Fintype ι] [Fintype κ] + (M : Matrix ι κ ℂ) : 0 ≤ hsSq M := by + exact (Complex.nonneg_iff.mp (Matrix.posSemidef_conjTranspose_mul_self M).trace_nonneg).1 + +theorem re_trace_mul_nonneg {ι : Type u_5} [Fintype ι] [DecidableEq ι] + {A B : Matrix ι ι ℂ} (hA : A.PosSemidef) (hB : B.PosSemidef) : + 0 ≤ (Matrix.trace (A * B)).re := by + obtain ⟨C, hC⟩ := CStarAlgebra.nonneg_iff_eq_star_mul_self.mp hA.nonneg + rw [hC, Matrix.star_eq_conjTranspose, Matrix.trace_mul_cycle, Matrix.trace_mul_cycle] + exact (Complex.nonneg_iff.mp (hB.mul_mul_conjTranspose_same C).trace_nonneg).1 + +theorem re_trace_block_comparison {ι : Type u_6} [Fintype ι] [DecidableEq ι] + (D J : Matrix ι ι ℂ) (hD : D.PosSemidef) (hJ : J.IsHermitian) : + 0 ≤ (Matrix.trace (D * J * D * J)).re := by + have hp := re_trace_mul_nonneg hD (hD.mul_mul_conjTranspose_same J) + simpa only [hJ.eq, Matrix.mul_assoc] using hp + +theorem positive_block_hsSq {ι : Type u_7} [Fintype ι] [DecidableEq ι] + {U V Z : Matrix ι ι ℂ} + (h : (Matrix.fromBlocks U Zᴴ Z V).PosSemidef) : + 2 * hsSq Z ≤ hsSq U + hsSq V := by + let D := Matrix.fromBlocks U Zᴴ Z V + let J : Matrix (Sum ι ι) (Sum ι ι) ℂ := Matrix.fromBlocks 1 0 0 (-1) + have hJ : J.IsHermitian := by + exact Matrix.IsHermitian.fromBlocks Matrix.isHermitian_one (by simp) + Matrix.isHermitian_one.neg + have hU : U.IsHermitian := by + have hh := h.isHermitian + exact hh.submatrix Sum.inl + have hV : V.IsHermitian := by + have hh := h.isHermitian + exact hh.submatrix Sum.inr + have hp := re_trace_block_comparison D J h hJ + have trace_blocks (A B C E : Matrix ι ι ℂ) : + Matrix.trace (Matrix.fromBlocks A B C E) = Matrix.trace A + Matrix.trace E := by + simp [Matrix.trace] + have he : Matrix.trace (D * J * D * J) = + Matrix.trace (U * U) + Matrix.trace (V * V) - + 2 * Matrix.trace (Zᴴ * Z) := by + simp [D, J, Matrix.fromBlocks_multiply, trace_blocks, + Matrix.trace_mul_comm Z Zᴴ] + ring + rw [he] at hp + norm_num at hp + simpa only [hsSq, hU.eq, hV.eq] using hp + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/Resolvent.lean b/lean/OAI/Analysis/DirectCrouzeix/Resolvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e8a548b2d7f073c9e8174f19d9d804e22539cb9 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Resolvent.lean @@ -0,0 +1,154 @@ +import OAI.Analysis.DirectCrouzeix.PositiveBlocks + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +def quadratic {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (u : EuclideanSpace ℂ (Fin n)) : ℂ := + inner ℂ u (Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A u) + +theorem quadratic_add {n : ℕ} (A B : Matrix (Fin n) (Fin n) ℂ) + (u : EuclideanSpace ℂ (Fin n)) : + quadratic (A + B) u = quadratic A u + quadratic B u := by + simp [quadratic] + +theorem quadratic_sub {n : ℕ} (A B : Matrix (Fin n) (Fin n) ℂ) + (u : EuclideanSpace ℂ (Fin n)) : + quadratic (A - B) u = quadratic A u - quadratic B u := by + simp [quadratic] + +theorem quadratic_smul {n : ℕ} (c : ℂ) (A : Matrix (Fin n) (Fin n) ℂ) + (u : EuclideanSpace ℂ (Fin n)) : + quadratic (c • A) u = c * quadratic A u := by + simp [quadratic] + +theorem quadratic_one {n : ℕ} (u : EuclideanSpace ℂ (Fin n)) : + quadratic 1 u = (‖u‖ : ℂ) ^ 2 := by + simp [quadratic, inner_self_eq_norm_sq_to_K] + +theorem quadratic_star {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (u : EuclideanSpace ℂ (Fin n)) : + quadratic Aᴴ u = star (quadratic A u) := by + simp only [quadratic, ← Matrix.star_eq_conjTranspose, map_star, + ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + exact (inner_conj_symm _ _).symm + +theorem quadratic_vector_smul {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (u : EuclideanSpace ℂ (Fin n)) (c : ℂ) : + quadratic A (c • u) = (star c * c) * quadratic A u := by + simp [quadratic] + ring + +theorem quadratic_toLp {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (u : Fin n → ℂ) : + quadratic A (WithLp.toLp 2 u) = star u ⬝ᵥ (A *ᵥ u) := by + simp [quadratic, EuclideanSpace.inner_eq_star_dotProduct, + dotProduct_comm] + +theorem posSemidef_of_unit_quadratic {n : ℕ} {H : Matrix (Fin n) (Fin n) ℂ} + (hH : H.IsHermitian) + (hu : ∀ u : EuclideanSpace ℂ (Fin n), ‖u‖ = 1 → 0 ≤ (quadratic H u).re) : + H.PosSemidef := by + apply Matrix.PosSemidef.of_dotProduct_mulVec_nonneg hH + intro x + refine Complex.nonneg_iff.mpr ⟨?_, (hH.im_star_dotProduct_mulVec_self x).symm⟩ + rw [← quadratic_toLp] + let v : EuclideanSpace ℂ (Fin n) := WithLp.toLp 2 x + change 0 ≤ (quadratic H v).re + by_cases hv : v = 0 + · simp [hv, quadratic] + let u : EuclideanSpace ℂ (Fin n) := ((‖v‖ : ℂ)⁻¹) • v + have hun : ‖u‖ = 1 := norm_smul_inv_norm hv + have hn : (‖v‖ : ℂ) ≠ 0 := by exact_mod_cast norm_ne_zero_iff.mpr hv + have he : (‖v‖ : ℂ) • u = v := by + simp [u, smul_smul, hn] + have hp := hu u hun + rw [← he, quadratic_vector_smul] + simpa [pow_two] using mul_nonneg (sq_nonneg ‖v‖) hp + +theorem supported_matrix_posSemidef {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (z q : ℂ) + (hs : ∀ w ∈ numericalRange A, 0 ≤ (star q * (z - w)).re) : + (star q • (z • 1 - A) + q • (z • 1 - A)ᴴ).PosSemidef := by + apply posSemidef_of_unit_quadratic + · simp [Matrix.IsHermitian, Matrix.conjTranspose_add, Matrix.conjTranspose_smul, + add_comm] + intro u hu + have hp := hs (quadratic A u) ⟨u, hu, rfl⟩ + rw [quadratic_add, quadratic_smul, quadratic_smul, quadratic_star, + quadratic_sub, quadratic_smul, quadratic_one, hu] + simp only [Complex.ofReal_one, one_pow, mul_one] + have he : (star q * (z - quadratic A u) + q * star (z - quadratic A u)).re = + 2 * (star q * (z - quadratic A u)).re := by + simp [Complex.mul_re] + ring + rw [he] + linarith + +theorem resolvent_congruence {n : ℕ} (B : Matrix (Fin n) (Fin n) ℂ) + (hB : IsUnit B) (q : ℂ) : + Bᴴ * ((q • B⁻¹) + (q • B⁻¹)ᴴ) * B = star q • B + q • Bᴴ := by + have hdet := (Matrix.isUnit_iff_isUnit_det B).mp hB + have hinv : B⁻¹ * B = 1 := Matrix.nonsing_inv_mul B hdet + have hstar : Bᴴ * (B⁻¹)ᴴ = 1 := by + rw [← Matrix.conjTranspose_mul, hinv, Matrix.conjTranspose_one] + simp only [Matrix.mul_add, Matrix.add_mul, Matrix.conjTranspose_smul, + Matrix.mul_smul, Matrix.smul_mul, Matrix.mul_assoc, hinv, Matrix.mul_one] + rw [← Matrix.mul_assoc Bᴴ, hstar, Matrix.one_mul] + exact add_comm _ _ + +theorem positive_resolvent_of_isUnit {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (z q : ℂ) (hB : IsUnit (z • 1 - A)) + (hs : ∀ w ∈ numericalRange A, 0 ≤ (star q * (z - w)).re) : + (q • (z • 1 - A)⁻¹ + (q • (z • 1 - A)⁻¹)ᴴ).PosSemidef := by + apply (Matrix.IsUnit.posSemidef_star_left_conjugate_iff hB).mp + rw [Matrix.star_eq_conjTranspose, resolvent_congruence _ hB] + exact supported_matrix_posSemidef A z q hs + +theorem mem_numericalRange_of_eigenvector {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + {z : ℂ} {x : Fin n → ℂ} (hx : x ≠ 0) (he : A *ᵥ x = z • x) : + z ∈ numericalRange A := by + let v : EuclideanSpace ℂ (Fin n) := WithLp.toLp 2 x + have hv : v ≠ 0 := by simpa [v] using hx + have he' : Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A v = z • v := by + simpa [v, Matrix.toEuclideanCLM_toLp] using congrArg (WithLp.toLp 2) he + let u : EuclideanSpace ℂ (Fin n) := (‖v‖ : ℂ)⁻¹ • v + have hu : ‖u‖ = 1 := norm_smul_inv_norm hv + have heu : Matrix.toEuclideanCLM (n := Fin n) (𝕜 := ℂ) A u = z • u := by + simp [u, he', smul_smul, mul_comm] + refine ⟨u, hu, ?_⟩ + rw [heu, inner_smul_right, inner_self_eq_norm_sq_to_K, hu] + simp + +theorem isUnit_resolvent_of_not_mem {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + {z : ℂ} (hz : z ∉ numericalRange A) : IsUnit (z • 1 - A) := by + apply Matrix.mulVec_injective_iff_isUnit.mp + intro x y hxy + by_contra hh + have hv : x - y ≠ 0 := sub_ne_zero.mpr hh + have hzero : (z • 1 - A) *ᵥ (x - y) = 0 := by + rw [Matrix.mulVec_sub, hxy, sub_self] + have he : A *ᵥ (x - y) = z • (x - y) := by + symm + apply sub_eq_zero.mp + simpa only [Matrix.sub_mulVec, Matrix.smul_mulVec, Matrix.one_mulVec] using hzero + exact hz (mem_numericalRange_of_eigenvector A hv he) + +theorem positive_resolvent {n : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (z q : ℂ) (hz : z ∉ numericalRange A) + (hs : ∀ w ∈ numericalRange A, 0 ≤ (star q * (z - w)).re) : + (q • (z • 1 - A)⁻¹ + (q • (z • 1 - A)⁻¹)ᴴ).PosSemidef := + positive_resolvent_of_isUnit A z q (isUnit_resolvent_of_not_mem A hz) hs + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/Sharpness.lean b/lean/OAI/Analysis/DirectCrouzeix/Sharpness.lean new file mode 100644 index 0000000000000000000000000000000000000000..ce4fdab0ae6bbffc28e00c45fa06975152b47d1f --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/Sharpness.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.DirectCrouzeix.Duality + +namespace OAI + +universe u_46 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +open MeasureTheory + +theorem norm_entry_le_l2_opNorm {ι : Type u_46} [Fintype ι] [DecidableEq ι] + (A : Matrix ι ι ℂ) (i j : ι) : ‖A i j‖ ≤ ‖A‖ := by + let e : EuclideanSpace ℂ ι := EuclideanSpace.single j 1 + let T := Matrix.toEuclideanCLM (n := ι) (𝕜 := ℂ) A + have he : ‖e‖ = 1 := by simp [e] + have hij : (T e) i = A i j := by + change (A *ᵥ Pi.single j 1) i = _ + rw [Matrix.mulVec_single_one] + rfl + calc + ‖A i j‖ = ‖(T e) i‖ := congrArg norm hij.symm + _ ≤ ‖T e‖ := PiLp.norm_apply_le _ _ + _ ≤ ‖T‖ * ‖e‖ := T.le_opNorm _ + _ = ‖A‖ := by simp [T, he, Matrix.l2_opNorm_toEuclideanCLM] + +def sharpnessMatrix : Matrix (Fin 2) (Fin 2) ℂ := !![0, 2; 0, 0] + +def sharpnessCoefficients : Fin 2 → Matrix (Fin 1) (Fin 1) ℂ := ![0, 1] + +theorem norm_le_one_of_mem_sharpnessRange {z : ℂ} + (hz : z ∈ numericalRange sharpnessMatrix) : ‖z‖ ≤ 1 := by + obtain ⟨u, hu, rfl⟩ := hz + have hsum : ‖u 0‖ ^ 2 + ‖u 1‖ ^ 2 = 1 := by + simpa [hu, Fin.sum_univ_two] using (EuclideanSpace.norm_sq_eq u).symm + have hev : inner ℂ u + (Matrix.toEuclideanCLM (n := Fin 2) (𝕜 := ℂ) sharpnessMatrix u) = + 2 * star (u 0) * u 1 := by + simp [sharpnessMatrix, EuclideanSpace.inner_eq_star_dotProduct, + Matrix.ofLp_toEuclideanCLM, dotProduct, Matrix.mulVec, Fin.sum_univ_two] + ring + rw [hev] + simp only [norm_mul, norm_star] + norm_num + nlinarith [sq_nonneg (‖u 0‖ - ‖u 1‖)] + +@[simp] theorem sharpness_polynomialValue (z : ℂ) : + polynomialValue (d := 1) sharpnessCoefficients z = z • 1 := by + simp [polynomialValue, sharpnessCoefficients, Fin.sum_univ_two] + +@[simp] theorem sharpness_tensorEvaluation : + tensorEvaluation (d := 1) sharpnessMatrix sharpnessCoefficients = + sharpnessMatrix ⊗ₖ (1 : Matrix (Fin 1) (Fin 1) ℂ) := by + simp [tensorEvaluation, sharpnessCoefficients, Fin.sum_univ_two] + +theorem sharpness_rangeMaximum_le_one : + rangeMaximum (d := 1) sharpnessMatrix sharpnessCoefficients ≤ 1 := by + obtain ⟨z, hz, he⟩ := rangeMaximum_attained (by norm_num : 0 < 2) + sharpnessMatrix (d := 1) sharpnessCoefficients + rw [← he, sharpness_polynomialValue, norm_smul, norm_one, mul_one] + exact norm_le_one_of_mem_sharpnessRange hz + +theorem sharpness_tensor_norm_ge_two : + 2 ≤ ‖tensorEvaluation (d := 1) sharpnessMatrix sharpnessCoefficients‖ := by + have h := norm_entry_le_l2_opNorm + (sharpnessMatrix ⊗ₖ (1 : Matrix (Fin 1) (Fin 1) ℂ)) (0, 0) (1, 0) + rw [sharpness_tensorEvaluation] + simpa [sharpnessMatrix, Matrix.kroneckerMap_apply] using h + +theorem uniform_sharpness (c : ℝ) (hc : UniversalBound c) : 2 ≤ c := by + have hmain := hc 2 1 1 (by norm_num) (by norm_num) sharpnessMatrix sharpnessCoefficients + have hmax := sharpness_rangeMaximum_le_one + have hlower := sharpness_tensor_norm_ge_two + have hnonneg : 0 ≤ rangeMaximum (d := 1) sharpnessMatrix sharpnessCoefficients := by + obtain ⟨z, hz, he⟩ := rangeMaximum_attained (by norm_num : 0 < 2) + sharpnessMatrix (d := 1) sharpnessCoefficients + rw [← he] + exact norm_nonneg _ + have hcpos : 0 ≤ c := by + by_contra hn + have := mul_nonpos_of_nonpos_of_nonneg (le_of_not_ge hn) hnonneg + linarith + have hmul := mul_le_mul_of_nonneg_left hmax hcpos + linarith + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/SingularPairs.lean b/lean/OAI/Analysis/DirectCrouzeix/SingularPairs.lean new file mode 100644 index 0000000000000000000000000000000000000000..30a999e394b4cbf3b0aacabc48b3571716133eeb --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/SingularPairs.lean @@ -0,0 +1,123 @@ +import OAI.Analysis.DirectCrouzeix.HilbertSchmidt + +namespace OAI + +universe u_37 u_38 u_39 u_40 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +namespace DirectCrouzeix + +open scoped MatrixOrder ComplexOrder + +theorem positive_compression_blocks {n m : ℕ} + (R : Matrix (Fin n) (Fin n) ℂ) + (X Y : Matrix (Fin n) (Fin m) ℂ) (hR : (R + Rᴴ).PosSemidef) : + (Matrix.fromBlocks + (Xᴴ * R * X + (Xᴴ * R * X)ᴴ) + ((Yᴴ * R * X + (Xᴴ * R * Y)ᴴ)ᴴ) + (Yᴴ * R * X + (Xᴴ * R * Y)ᴴ) + (Yᴴ * R * Y + (Yᴴ * R * Y)ᴴ)).PosSemidef := by + have h := hR.conjTranspose_mul_mul_same (Matrix.fromCols X Y) + rw [Matrix.conjTranspose_fromCols_eq_fromRows_conjTranspose, + Matrix.fromRows_mul, Matrix.fromRows_mul_fromCols] at h + simpa only [Matrix.mul_add, Matrix.add_mul, Matrix.conjTranspose_add, + Matrix.conjTranspose_mul, Matrix.conjTranspose_conjTranspose, Matrix.mul_assoc, + add_comm] using h + +theorem exists_norm_attainer {ι : Type u_37} [Fintype ι] [Nonempty ι] + (T : EuclideanSpace ℂ ι →L[ℂ] EuclideanSpace ℂ ι) : + ∃ x : EuclideanSpace ℂ ι, ‖x‖ = 1 ∧ ‖T x‖ = ‖T‖ := by + obtain ⟨x, hx, hmax⟩ := (isCompact_sphere (0 : EuclideanSpace ℂ ι) 1).exists_isMaxOn + (NormedSpace.sphere_nonempty.mpr (by norm_num : (0 : ℝ) ≤ 1)) + T.continuous.norm.continuousOn + have hx' : ‖x‖ = 1 := by simpa using hx + refine ⟨x, hx', le_antisymm ?_ ?_⟩ + · simpa [hx'] using T.le_opNorm x + · apply T.opNorm_le_bound (norm_nonneg _) + intro v + by_cases hv : v = 0 + · simp [hv] + let u : EuclideanSpace ℂ ι := (‖v‖ : ℂ)⁻¹ • v + have hu : ‖u‖ = 1 := norm_smul_inv_norm hv + have hm : ‖T u‖ ≤ ‖T x‖ := hmax (by simpa using hu) + have he : ‖T u‖ = ‖T v‖ / ‖v‖ := by + simp [u, norm_smul, div_eq_mul_inv, mul_comm] + rw [he] at hm + exact (div_le_iff₀ (norm_pos_iff.mpr hv)).mp hm + +theorem exists_singular_pair {ι : Type u_38} [Fintype ι] [Nonempty ι] + (T : EuclideanSpace ℂ ι →L[ℂ] EuclideanSpace ℂ ι) (hT : 0 < ‖T‖) : + ∃ x y : EuclideanSpace ℂ ι, ‖x‖ = 1 ∧ ‖y‖ = 1 ∧ + T x = (‖T‖ : ℂ) • y ∧ + ContinuousLinearMap.adjoint T y = (‖T‖ : ℂ) • x := by + obtain ⟨x, hx, hTx⟩ := exists_norm_attainer T + let y : EuclideanSpace ℂ ι := (‖T‖ : ℂ)⁻¹ • T x + have hn : (‖T‖ : ℂ) ≠ 0 := by exact_mod_cast hT.ne' + have hy : ‖y‖ = 1 := by + simp [y, norm_smul, hTx, ne_of_gt hT] + have hxy : T x = (‖T‖ : ℂ) • y := by simp [y, smul_smul, hn] + refine ⟨x, y, hx, hy, hxy, ?_⟩ + have ha : ‖ContinuousLinearMap.adjoint T y‖ ≤ ‖T‖ := by + simpa [hy] using (ContinuousLinearMap.adjoint T).le_opNorm y + have hi : inner ℂ (ContinuousLinearMap.adjoint T y) x = (‖T‖ : ℂ) := by + rw [ContinuousLinearMap.adjoint_inner_left, hxy, inner_smul_right, + inner_self_eq_norm_sq_to_K, hy] + simp + have hd : ‖ContinuousLinearMap.adjoint T y - (‖T‖ : ℂ) • x‖ ^ 2 = + ‖ContinuousLinearMap.adjoint T y‖ ^ 2 - ‖T‖ ^ 2 := by + rw [norm_sub_sq (𝕜 := ℂ), inner_smul_right, hi] + simp [norm_smul, hx] + ring + have he : ‖ContinuousLinearMap.adjoint T y - (‖T‖ : ℂ) • x‖ = 0 := by + have hs := pow_le_pow_left₀ (norm_nonneg _) ha 2 + nlinarith [sq_nonneg ‖ContinuousLinearMap.adjoint T y - (‖T‖ : ℂ) • x‖, + norm_nonneg (ContinuousLinearMap.adjoint T y - (‖T‖ : ℂ) • x)] + exact sub_eq_zero.mp (norm_eq_zero.mp he) + +def matrixify {n m : ℕ} (x : EuclideanSpace ℂ (Fin n × Fin m)) : + Matrix (Fin n) (Fin m) ℂ := fun i j => x (i, j) + +@[simp] theorem hsVector_matrixify {n m : ℕ} (x : EuclideanSpace ℂ (Fin n × Fin m)) : + hsVector (matrixify x) = x := by + apply WithLp.ofLp_injective + rfl + +theorem tensor_entryPair {n m : ℕ} (A : Matrix (Fin n) (Fin n) ℂ) + (C : Matrix (Fin m) (Fin m) ℂ) (X Y : Matrix (Fin n) (Fin m) ℂ) : + inner ℂ (hsVector Y) + (Matrix.toEuclideanCLM (n := Fin n × Fin m) (𝕜 := ℂ) (A ⊗ₖ C) (hsVector X)) = + entryPair (Yᴴ * A * X) C := by + simp only [hsVector, EuclideanSpace.inner_eq_star_dotProduct, + Matrix.toEuclideanCLM_toLp, dotProduct, Matrix.mulVec, + Pi.star_apply, Matrix.kroneckerMap_apply, Fintype.sum_prod_type, + entryPair, Matrix.mul_apply, Matrix.conjTranspose_apply, + Finset.sum_mul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + conv_lhs => + arg 2 + intro a + rw [Finset.sum_comm] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro b _ + apply Finset.sum_congr rfl + intro a _ + ring + +theorem entryPair_smul_right {ι : Type u_39} {κ : Type u_40} [Fintype ι] [Fintype κ] + (M C : Matrix ι κ ℂ) (c : ℂ) : entryPair M (c • C) = c * entryPair M C := by + simp [entryPair, Finset.mul_sum, mul_left_comm] + +end DirectCrouzeix + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/SupportNets.lean b/lean/OAI/Analysis/DirectCrouzeix/SupportNets.lean new file mode 100644 index 0000000000000000000000000000000000000000..f0c3dc37c8550ad0b00b75490b28b2beb9ab53bf --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/SupportNets.lean @@ -0,0 +1,190 @@ +import OAI.Analysis.DirectCrouzeix.ExteriorMapping + +namespace OAI + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +noncomputable section + +open Filter Metric Set + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +noncomputable section + +open Set Filter Metric + +open scoped Topology ComplexConjugate + +namespace DirectCrouzeix.Geometry + +theorem exists_axis_net {δ : ℝ} (hδ : 0 < δ) : + ∃ D : Finset ℂ, (∀ ν ∈ D, ‖ν‖ = 1) ∧ 1 ∈ D ∧ -1 ∈ D ∧ + Complex.I ∈ D ∧ -Complex.I ∈ D ∧ + (∀ ν : ℂ, ‖ν‖ = 1 → ∃ μ ∈ D, ‖ν-μ‖ < δ) := by + classical + obtain ⟨S,hS⟩ := (isCompact_sphere (0:ℂ) 1).elim_finite_subcover + (fun ν : sphere (0:ℂ) 1 => ball (ν:ℂ) δ) (fun _ => isOpen_ball) (by + intro ν hν + exact mem_iUnion.mpr ⟨⟨ν,hν⟩,mem_ball_self hδ⟩) + let D := S.image Subtype.val ∪ {1,-1,Complex.I,-Complex.I} + refine ⟨D,?_,?_,?_,?_,?_,?_⟩ + · intro ν hν + rcases Finset.mem_union.mp hν with hν | hν + · obtain ⟨μ,hμ,rfl⟩ := Finset.mem_image.mp hν + simpa only [mem_sphere,dist_zero_right] using μ.property + · simp only [Finset.mem_insert,Finset.mem_singleton] at hν + rcases hν with rfl | rfl | rfl | rfl <;> simp + · simp [D] + · simp [D] + · simp [D] + · simp [D] + · intro ν hν + obtain ⟨μ,hμ,hνμ⟩ := mem_iUnion₂.mp (hS (by simpa only [mem_sphere,dist_zero_right] using hν)) + refine ⟨μ,Finset.mem_union_left _ (Finset.mem_image.mpr ⟨μ,hμ,rfl⟩),?_⟩ + simpa [dist_eq_norm] using hνμ + +def convexSupport (K : Set ℂ) (ν : ℂ) : ℝ := sSup ((fun z => inner ℝ ν z) '' K) + +theorem convexSupport_attained {K : Set ℂ} (hK : IsCompact K) (hne : K.Nonempty) (ν : ℂ) : + ∃ w ∈ K, inner ℝ ν w = convexSupport K ν := by + exact (hK.image ((innerSL ℝ ν).continuous)).sSup_mem (hne.image _) + +theorem le_convexSupport {K : Set ℂ} (hK : IsCompact K) {z : ℂ} (hz : z ∈ K) (ν : ℂ) : + inner ℝ ν z ≤ convexSupport K ν := by + apply le_csSup (hK.image ((innerSL ℝ ν).continuous)).bddAbove + exact mem_image_of_mem _ hz + +theorem convexSupport_le {K : Set ℂ} (hne : K.Nonempty) {M : ℝ} + (hM : ∀ z ∈ K, ‖z‖ ≤ M) {ν : ℂ} (hν : ‖ν‖ = 1) : convexSupport K ν ≤ M := by + apply csSup_le (hne.image _) + rintro x ⟨z,hz,rfl⟩ + exact (real_inner_le_norm ν z).trans (by simpa only [hν,one_mul] using hM z hz) + +theorem direction_net_distance {K : Set ℂ} (hK : IsCompact K) (hne : K.Nonempty) + (hconv : Convex ℝ K) {D : Finset ℂ} {δ M L : ℝ} (hδ : 0 < δ) + (hM : ∀ w ∈ K, ‖w‖ ≤ M) + (hnet : ∀ ν : ℂ, ‖ν‖ = 1 → ∃ μ ∈ D, ‖ν-μ‖ < δ) + {z : ℂ} (hz : ‖z‖ ≤ L) + (hs : ∀ μ ∈ D, inner ℝ μ z ≤ convexSupport K μ+δ) : + ∃ w ∈ K, ‖z-w‖ ≤ δ*(1+L+M) := by + obtain ⟨w,hw,hwmin⟩ := exists_norm_eq_iInf_of_complete_convex hne hK.isClosed.isComplete hconv z + have hM0 : 0 ≤ M := (norm_nonneg w).trans (hM w hw) + have hL0 : 0 ≤ L := (norm_nonneg z).trans hz + refine ⟨w,hw,?_⟩ + by_cases he : z = w + · rw [he,sub_self,norm_zero] + positivity + have hn : 0 < ‖z-w‖ := norm_pos_iff.mpr (sub_ne_zero.mpr he) + let ν := (‖z-w‖⁻¹:ℝ) • (z-w) + have hν : ‖ν‖ = 1 := by simp [ν,ne_of_gt hn] + obtain ⟨μ,hμ,hνμ⟩ := hnet ν hν + obtain ⟨u,hu,hsu⟩ := convexSupport_attained hK hne μ + have hmin : inner ℝ ν (u-w) ≤ 0 := by + have hh := (norm_eq_iInf_iff_real_inner_le_zero hconv hw).mp hwmin u hu + dsimp only [ν] + rw [real_inner_smul_left] + exact mul_nonpos_of_nonneg_of_nonpos (le_of_lt (inv_pos.mpr hn)) hh + have hzw : inner ℝ ν (z-w) = ‖z-w‖ := by + dsimp only [ν] + rw [real_inner_smul_left,real_inner_self_eq_norm_sq] + field_simp + have hmain : ‖z-w‖ ≤ inner ℝ ν (z-u) := by + have heq : z-w = (z-u)+(u-w) := by abel + rw [← hzw,heq,inner_add_right] + linarith + have hμbound : inner ℝ μ (z-u) ≤ δ := by + rw [inner_sub_right,hsu] + linarith [hs μ hμ] + have hnorm : ‖z-u‖ ≤ L+M := (norm_sub_le z u).trans (add_le_add hz (hM u hu)) + have herror : inner ℝ (ν-μ) (z-u) ≤ δ*(L+M) := by + calc + inner ℝ (ν-μ) (z-u) ≤ ‖ν-μ‖*‖z-u‖ := real_inner_le_norm _ _ + _ ≤ δ*(L+M) := mul_le_mul (le_of_lt hνμ) hnorm (norm_nonneg _) (le_of_lt hδ) + have heq : inner ℝ ν (z-u) = inner ℝ μ (z-u)+inner ℝ (ν-μ) (z-u) := by + rw [inner_sub_left]; ring + rw [heq] at hmain + nlinarith + +theorem axis_support_bound {K : Set ℂ} (hne : K.Nonempty) {M δ : ℝ} + (hM : ∀ w ∈ K, ‖w‖ ≤ M) {D : Finset ℂ} + (h1 : 1 ∈ D) (hm1 : -1 ∈ D) (hI : Complex.I ∈ D) (hmI : -Complex.I ∈ D) + {z : ℂ} (hs : ∀ μ ∈ D, inner ℝ μ z ≤ convexSupport K μ+δ) : + ‖z‖ ≤ 2*(M+δ) := by + have hb (μ : ℂ) (hμ : μ ∈ D) (hμN : ‖μ‖ = 1) : inner ℝ μ z ≤ M+δ := + (hs μ hμ).trans (add_le_add_left (convexSupport_le hne hM hμN) δ) + have hr := hb 1 h1 (by simp) + have hrr := hb (-1) hm1 (by simp) + have hi := hb Complex.I hI (by simp) + have hir := hb (-Complex.I) hmI (by simp) + simp only [real_inner_eq_re_inner ℂ,RCLike.inner_apply] at hr hrr hi hir + simp at hr hrr hi hir + have ha : |z.re| ≤ M+δ := abs_le.mpr ⟨by linarith,hr⟩ + have hb : |z.im| ≤ M+δ := abs_le.mpr ⟨by linarith,hi⟩ + calc + ‖z‖ ≤ |z.re|+|z.im| := Complex.norm_le_abs_re_add_abs_im z + _ ≤ 2*(M+δ) := by linarith + +end DirectCrouzeix.Geometry + +noncomputable section + +open Set + +open scoped ComplexConjugate Matrix + +namespace DirectCrouzeix.Geometry + +end DirectCrouzeix.Geometry + +end + +end + +end + +end + +end + +end + +end + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DirectCrouzeix/TaylorFourier.lean b/lean/OAI/Analysis/DirectCrouzeix/TaylorFourier.lean new file mode 100644 index 0000000000000000000000000000000000000000..b871a3c46ef8bceb03aacb319141eed693774fd8 --- /dev/null +++ b/lean/OAI/Analysis/DirectCrouzeix/TaylorFourier.lean @@ -0,0 +1,166 @@ +import OAI.Analysis.DirectCrouzeix.DividedDifferences + +namespace OAI + +universe u_94 u_95 u_96 u_97 u_98 u_99 u_100 u_101 u_102 u_103 u_104 u_105 + +noncomputable section + +open scoped Matrix Matrix.Norms.L2Operator Kronecker + +noncomputable section + +open MeasureTheory Set Filter Metric + +open scoped Topology Interval ENNReal NNReal ComplexConjugate + +namespace DirectCrouzeix.Faber + +def taylorCoeff {E : Type u_94} [NormedAddCommGroup E] [NormedSpace ℂ E] + (f : ℂ → E) (k : ℕ) : E := (k.factorial : ℂ)⁻¹ • iteratedDeriv k f 0 + +@[simp] theorem taylorCoeff_zero {E : Type u_95} [NormedAddCommGroup E] [NormedSpace ℂ E] + (f : ℂ → E) : taylorCoeff f 0 = f 0 := by simp [taylorCoeff] + +theorem taylorCoeff_congr {E : Type u_96} [NormedAddCommGroup E] [NormedSpace ℂ E] + {f g : ℂ → E} (h : f =ᶠ[𝓝 0] g) (k : ℕ) : taylorCoeff f k = taylorCoeff g k := by + rw [taylorCoeff,taylorCoeff,h.iteratedDeriv_eq k] + +theorem taylorCoeff_add {E : Type u_97} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] + {f g : ℂ → E} (hf : AnalyticAt ℂ f 0) (hg : AnalyticAt ℂ g 0) (k : ℕ) : + taylorCoeff (fun z => f z+g z) k = taylorCoeff f k+taylorCoeff g k := by + simp only [taylorCoeff,iteratedDeriv_fun_add (n := k) hf.contDiffAt hg.contDiffAt,smul_add] + +theorem taylorCoeff_sum {E : Type u_98} {ι : Type u_99} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] + (I : Finset ι) {f : ι → ℂ → E} (hf : ∀ i ∈ I, AnalyticAt ℂ (f i) 0) (k : ℕ) : + taylorCoeff (fun z => ∑ i ∈ I, f i z) k = ∑ i ∈ I, taylorCoeff (f i) k := by + simp only [taylorCoeff, iteratedDeriv_fun_sum (fun i hi => (hf i hi).contDiffAt),Finset.smul_sum] + +theorem taylorCoeff_smul_const {E : Type u_100} [NormedAddCommGroup E] [NormedSpace ℂ E] + {f : ℂ → ℂ} (hf : AnalyticAt ℂ f 0) (v : E) (k : ℕ) : + taylorCoeff (fun z => f z • v) k = taylorCoeff f k • v := by + rw [taylorCoeff,iteratedDeriv_smul_const hf.contDiffAt,taylorCoeff,smul_smul,smul_eq_mul] + +@[simp] theorem taylorCoeff_const {E : Type u_101} [NormedAddCommGroup E] [NormedSpace ℂ E] + (v : E) (k : ℕ) : taylorCoeff (fun _ => v) k = if k = 0 then v else 0 := by + by_cases hk : k = 0 + · subst k; simp + · simp [taylorCoeff,iteratedDeriv_const,hk] + +theorem taylorCoeff_pow_mul {f : ℂ → ℂ} (hf : AnalyticAt ℂ f 0) (j k : ℕ) : + taylorCoeff (fun u => u^j*f u) k = if j ≤ k then taylorCoeff f (k-j) else 0 := by + classical + rw [taylorCoeff,iteratedDeriv_fun_mul (f := fun u : ℂ => u^j) (n := k) (by fun_prop) hf.contDiffAt] + simp only [iteratedDeriv_fun_pow_zero, Nat.cast_ite, Nat.cast_zero] + by_cases hjk : j ≤ k + · rw [Finset.sum_eq_single j] + · simp only [ite_true,smul_eq_mul,ite_eq_left hjk,taylorCoeff] + have hfac : (k.factorial : ℂ) = (k.choose j : ℂ) * (j.factorial : ℂ) * ((k-j).factorial : ℂ) := by + exact_mod_cast (Nat.choose_mul_factorial_mul_factorial hjk).symm + have hkn : (k.factorial : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero k) + have hjn : ((k-j).factorial : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero _) + field_simp + linear_combination -(iteratedDeriv (k-j) f 0)*hfac + · intro i hi hij + simp [hij] + · exact fun h => (h (Finset.mem_range.mpr (Nat.lt_succ_of_le hjk))).elim + · rw [ite_eq_right hjk] + have he : ∑ i ∈ Finset.range (k+1), (k.choose i : ℂ) * + (if i = j then (j.factorial : ℂ) else 0) * iteratedDeriv (k-i) f 0 = 0 := by + apply Finset.sum_eq_zero + intro i hi + have hij : i ≠ j := by have hik := Finset.mem_range.mp hi; omega + simp [hij] + rw [he,smul_zero] + +theorem taylorCoeff_eq_series {E : Type u_102} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] + {f : ℂ → E} {p : FormalMultilinearSeries ℂ ℂ E} {r : ℝ≥0∞} + (hp : HasFPowerSeriesOnBall f p 0 r) (k : ℕ) : taylorCoeff f k = p.coeff k := by + have hh := hp.iteratedFDeriv_eq_sum_of_completeSpace (fun _ : Fin k => (1:ℂ)) + simp only [← iteratedDeriv_eq_iteratedFDeriv,Finset.sum_const,Finset.card_univ, + Fintype.card_perm,Fintype.card_fin] at hh + change iteratedDeriv k f 0 = k.factorial • p.coeff k at hh + rw [taylorCoeff,hh,← Nat.cast_smul_eq_nsmul ℂ,smul_smul] + simp [Nat.factorial_ne_zero] + +abbrev Angle := AddCircle (1:ℝ) + +abbrev angularMeasure : Measure Angle := AddCircle.haarAddCircle + +def unitPoint (t : Angle) : ℂ := fourier 1 t + +@[simp] theorem unitPoint_norm (t : Angle) : ‖unitPoint t‖ = 1 := by + simp [unitPoint,fourier_apply,Circle.norm_coe] + +theorem unitPoint_continuous : Continuous unitPoint := (fourier 1).continuous + +theorem unitPoint_pow (t : Angle) (k : ℕ) : unitPoint t ^ k = fourier (k:ℤ) t := by + simp only [unitPoint,fourier_apply,one_zsmul,← Circle.coe_pow, + ← AddCircle.toCircle_nsmul,natCast_zsmul] + +theorem integral_character_smul {E : Type u_103} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] (a b : ℤ) (v : E) : + (∫ t : Angle, fourier (-a) t • (fourier b t • v) ∂angularMeasure) = if b = a then v else 0 := by + rw [show (fun t : Angle => fourier (-a) t • (fourier b t • v)) = + (fun t => (fourier (-a) t * fourier b t) • v) by funext t; rw [smul_smul], + integral_smul_const] + have hh := congrFun (fourierCoeff_fourier (T := (1:ℝ)) b) a + change (∫ t : Angle, fourier (-a) t * fourier b t ∂angularMeasure) = _ at hh + rw [hh] + by_cases hab : b = a + · subst b; simp + · simp [Ne.symm hab,hab] + +theorem fourierCoeff_of_powerSeries {E : Type u_104} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] {f : ℂ → E} {p : FormalMultilinearSeries ℂ ℂ E} {r : ℝ≥0∞} + (hp : HasFPowerSeriesOnBall f p 0 r) (hr : 1 < r) (k : ℤ) : + fourierCoeff (fun t : Angle => f (unitPoint t)) k = + if 0 ≤ k then taylorCoeff f k.toNat else 0 := by + have h1 : (1:ℂ) ∈ Metric.eball 0 p.radius := by + simpa [Metric.mem_eball,edist_dist] using hr.trans_le hp.r_le + have hs : Summable (fun n => ‖p.coeff n‖) := by + simpa only [FormalMultilinearSeries.apply_eq_pow_smul_coeff,one_pow,one_smul] using p.summable_norm_apply h1 + have hp' (t : Angle) : HasSum (fun n : ℕ => fourier n t • p.coeff n) (f (unitPoint t)) := by + have ht : unitPoint t ∈ Metric.eball 0 r := by + simpa [Metric.mem_eball,edist_dist] using hr + simpa only [FormalMultilinearSeries.apply_eq_pow_smul_coeff,unitPoint_pow,zero_add] using hp.hasSum ht + have hi := hasSum_integral_of_dominated_convergence + (μ := angularMeasure) (bound := fun (n : ℕ) (_ : Angle) => ‖p.coeff n‖) + (F := fun (n : ℕ) (t : Angle) => fourier (-k) t • (fourier n t • p.coeff n)) + (f := fun t => fourier (-k) t • f (unitPoint t)) + (fun n => ((fourier (-k)).continuous.smul ((fourier n).continuous.smul continuous_const)).aestronglyMeasurable) + (fun n => ae_of_all _ (fun t => by simp [norm_smul,fourier_apply,Circle.norm_coe])) + (ae_of_all _ (fun _ => hs)) (integrable_const _) + (ae_of_all _ (fun t => (hp' t).const_smul (fourier (-k) t))) + simp only [integral_character_smul] at hi + change HasSum (fun n : ℕ => if (n:ℤ) = k then p.coeff n else 0) + (fourierCoeff (fun t : Angle => f (unitPoint t)) k) at hi + rw [← hi.tsum_eq] + cases k with + | ofNat k => + simp [taylorCoeff_eq_series hp] + | negSucc k => + simp + +theorem fourierCoeff_of_analytic {E : Type u_105} [NormedAddCommGroup E] [NormedSpace ℂ E] + [CompleteSpace E] {f : ℂ → E} {R : ℝ} (hR : 1 < R) + (hf : AnalyticOnNhd ℂ f (ball 0 R)) (k : ℤ) : + fourierCoeff (fun t : Angle => f (unitPoint t)) k = + if 0 ≤ k then taylorCoeff f k.toNat else 0 := by + obtain ⟨ρ,hρ1,hρR⟩ := exists_between hR + let ρ' : ℝ≥0 := ⟨ρ,by linarith⟩ + have hd : DifferentiableOn ℂ f (closedBall 0 (ρ':ℝ)) := + hf.differentiableOn.mono (closedBall_subset_ball hρR) + have hp := hd.hasFPowerSeriesOnBall (R := ρ') (by change 0 < ρ; linarith) + apply fourierCoeff_of_powerSeries hp + exact_mod_cast hρ1 + +end DirectCrouzeix.Faber + +end + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/AbsoluteContinuity.lean b/lean/OAI/Analysis/DiskMaximal/AbsoluteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef3338364f8c64863f93cdc1640937581810dacd --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/AbsoluteContinuity.lean @@ -0,0 +1,528 @@ +import OAI.Analysis.DiskMaximal.Localization + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace SobolevBand +open WeakSobolev DiskMaximalTools DiskMoments + +lemma high_dyadic (n : ℕ) : high n=2*((2:ℝ)^(2*n)*low n) := by + have he : 2*n=n+n := by omega + rw [high,low,he,pow_add] + field_simp + +lemma small_dyadic {L n : ℕ} (hn : L≤n) : 2*low L=2*((2:ℝ)^(n-L)*low n) := by + have hp : (2:ℝ)^n=2^(n-L)*2^L := by rw [← pow_add,Nat.sub_add_cancel hn] + rw [low,low,hp] + field_simp + +lemma small_le_high (L n : ℕ) : 2*low L≤high n := by + have hl : low L≤1 := (inv_le_one₀ (by positivity : (0:ℝ)<2^L)).mpr (one_le_pow₀ (by norm_num)) + have hh : (1:ℝ)≤2^n := one_le_pow₀ (by norm_num) + unfold high + nlinarith + +lemma gradient_error_restrict {u : ℕ → ℂ → ℝ} {g : ℂ → ℂ} + (hu : ∀ n, ContDiff ℝ 1 (u n) ∧ HasCompactSupport (u n)) (hg : Integrable g) + (ht : Tendsto (fun n => ∫ x, ‖gradient (u n) x-g x‖) atTop (𝓝 0)) (S : Set ℂ) : + Tendsto (fun n => ∫ x in S, ‖gradient (u n) x‖) atTop (𝓝 (∫ x in S, ‖g x‖)) := by + have hi n : Integrable (gradient (u n)) := (continuous_gradient (hu n).1).integrable_of_hasCompactSupport (gradient_hasCompactSupport (hu n).2) + apply integral_norm_converges hg.integrableOn (fun n => (hi n).integrableOn) + apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) _ ht + intro n + exact integral_mono_measure Measure.restrict_le_self (ae_of_all _ (fun x => norm_nonneg _)) ((hi n).sub hg).norm + +lemma exists_diagonal_smooth {f : ℂ → ℝ} {g : ℂ → ℂ} + (hf : Integrable f) (hg : Integrable g) (hw : HasGradient (μ := volume) f g) : + ∃ u : ℕ → ℂ → ℝ, (∀ n, ContDiff ℝ 1 (u n) ∧ HasCompactSupport (u n)) ∧ + (∀ n, (∫ x,‖gradient (u n) x‖) ≤ (∫ x,‖g x‖)+1) ∧ + Tendsto (fun n => ∫ x,‖gradient (u n) x-g x‖) atTop (𝓝 0) ∧ + (∀ n x, ‖band (u n) (low n) (high n) x-band f (low n) (high n) x‖ ≤ 1/((n:ℝ)+1)) := by + have he (n : ℕ) : 0 < min (1/((n:ℝ)+1)) (Real.pi*(low n)^2/((n:ℝ)+1)) := by + have := low_pos n + apply lt_min <;> positivity + choose u hu hc he1 he2 using fun n => exists_smooth_compact_approx hf hg hw (he n) + have hi (n) : Integrable (u n) := (hu n).continuous.integrable_of_hasCompactSupport (hc n) + have h1 n : ContDiff ℝ 1 (u n) := (hu n).of_le (by simp) + refine ⟨u,fun n => ⟨h1 n,hc n⟩,?_,?_,?_⟩ + · intro n + apply (gradient_integral_le (h1 n) (hc n) hg).trans + gcongr + have hn : 1/((n:ℝ)+1)≤1 := (div_le_one (by positivity)).mpr (by linarith [Nat.cast_nonneg (α := ℝ) n]) + exact ((he2 n).le.trans (min_le_left _ _)).trans hn + · apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) + (fun n => (he2 n).le.trans (min_le_left _ _)) + (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) + · intro n x + rw [Real.norm_eq_abs] + apply (band_sub_le (hi n) hf (low_pos n) (low_le_high n) x).trans + have := low_pos n + apply (div_le_iff₀ (by positivity : 0 |f y|) (low n) (high n) x‖ ≤ 1/((n:ℝ)+1)) + {K : Set ℂ} (hK : IsCompact K) : + Tendsto (fun n => ∫ x in K, ‖band (u n) (low n) (high n) x-maximalComplexReal f x‖) atTop (𝓝 0) := by + let H := fun n => band (u n) (low n) (high n) + let A := fun n => band (fun y => |f y|) (low n) (high n) + have hUi n : Integrable (u n) := (hu n).1.continuous.integrable_of_hasCompactSupport (hu n).2 + have hGi n : Integrable (gradient (u n)) := (continuous_gradient (hu n).1).integrable_of_hasCompactSupport (gradient_hasCompactSupport (hu n).2) + have hH n : Continuous (H n) := (band_lipschitz (hUi n) (hGi n) (contDiff_hasGradient (hu n).1) (low_pos n) (low_le_high n)).continuous + have hA n : Continuous (A n) := (band_lipschitz hf.abs (abs_gradient_bound hf hg).1 (hw.abs hf hg) (low_pos n) (low_le_high n)).continuous + have hM := (locallyIntegrable_maximal hf hg hw).integrableOn_isCompact hK + have hHi n : IntegrableOn (H n) K := (hH n).continuousOn.integrableOn_compact hK + have hAi n : IntegrableOn (A n) K := (hA n).continuousOn.integrableOn_compact hK + have : IsFiniteMeasure (volume.restrict K) := ⟨by simpa using hK.measure_lt_top⟩ + have hb (n : ℕ) : (∫ x in K, ‖H n x-maximalComplexReal f x‖) ≤ + (1/((n:ℝ)+1))*volume.real K+(∫ x in K,‖A n x-maximalComplexReal f x‖) := by + have hcst : (∫ _ : ℂ in K,(1/((n:ℝ)+1)))=(1/((n:ℝ)+1))*volume.real K := by simp only [setIntegral_const,smul_eq_mul,mul_comm] + have hdiff : IntegrableOn (fun x => ‖A n x-maximalComplexReal f x‖) K := ((hAi n).sub hM).norm + have hconst : IntegrableOn (fun _ : ℂ => (1/((n:ℝ)+1))) K := integrable_const _ + rw [← hcst,← integral_add hconst hdiff] + apply integral_mono ((hHi n).sub hM).norm ((integrable_const _).add ((hAi n).sub hM).norm) + intro x + change ‖H n x-maximalComplexReal f x‖ ≤ 1/((n:ℝ)+1)+‖A n x-maximalComplexReal f x‖ + exact (norm_sub_le_norm_sub_add_norm_sub (H n x) (A n x) (maximalComplexReal f x)).trans (add_le_add (he n x) le_rfl) + have hlim : Tendsto (fun n : ℕ => (1/((n:ℝ)+1))*volume.real K+(∫ x in K,‖A n x-maximalComplexReal f x‖)) atTop (𝓝 0) := by + simpa only [zero_mul,zero_add] using + ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).mul_const (volume.real K)).add (diagonal_local_L1 hf hg hw hK) + exact squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) hb hlim +end SobolevBand + +namespace WeakCompact +variable {X : Type*} [TopologicalSpace X] [T2Space X] [MeasurableSpace X] [BorelSpace X] + [LocallyCompactSpace X] {μ : Measure X} +lemma densityLimit_compact_bound_limit (w : ℕ → X → ℝ) (hw : ∀ n, Integrable (w n) μ) + (h0 : ∀ n, ∀ᵐ x ∂μ,0≤w n x) {B : ℝ} (hb : ∀ n,(∫ x,w n x ∂μ)≤B) + {D : ℝ} {a : ℕ → ℝ} {K O : Set X} (hK : IsCompact K) (hO : IsOpen O) (hKO : K⊆O) + (ha : ∀ᶠ n in atTop,(∫ x in O,w n x ∂μ)≤a n) (ht : Tendsto a atTop (𝓝 D)) : + densityLimit w hw h0 hb K ≤ ENNReal.ofReal D := by + have he (ε : ℝ) (hε : 0<ε) : densityLimit w hw h0 hb K ≤ ENNReal.ofReal (D+ε) := by + apply densityLimit_compact_bound w hw h0 hb hK hO hKO + filter_upwards [ha,ht.eventually (gt_mem_nhds (by linarith : D D+1/((n:ℝ)+1)) atTop (𝓝 D) by + simpa only [add_zero] using tendsto_const_nhds.add (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)))) + exact Eventually.of_forall (fun n => he _ (by positivity)) +end WeakCompact + +namespace NullLocalization +open SobolevBand DiskMoments PhysicalCells + +lemma thickening_null_integral {K : Set ℂ} (hK : IsCompact K) (hK0 : volume K=0) + {G : ℂ → ℝ} (hG : Integrable G) : + Tendsto (fun L => ∫ x in Metric.thickening (12*(2*low L)) K,G x) atTop (𝓝 0) := by + let s := fun L => Metric.thickening (12*(2*low L)) K + have hm : Antitone s := fun i j hij => Metric.thickening_mono (by gcongr; exact low_antitone hij) K + have he : (⋂ L,s L)=K := by + apply subset_antisymm + · intro x hx + apply hK.isClosed.closure_eq ▸ (show x∈closure K from ?_) + rw [Metric.mem_closure_iff] + intro ε hε + have ht : Tendsto (fun L => 12*(2*low L)) atTop (𝓝 0) := by + simpa only [mul_zero] using (low_tendsto.const_mul 2).const_mul 12 + obtain ⟨L,hL⟩ := (ht.eventually (gt_mem_nhds hε)).exists + obtain ⟨y,hy,hxy⟩ := Metric.mem_thickening_iff.mp (mem_iInter.mp hx L) + exact ⟨y,hy,hxy.trans hL⟩ + · exact subset_iInter (fun L => Metric.self_subset_thickening (by have := low_pos L; positivity) K) + have ht := tendsto_setIntegral_of_antitone (fun L => Metric.isOpen_thickening.measurableSet) hm ⟨0,hG.integrableOn⟩ + rw [he,setIntegral_measure_zero _ hK0] at ht + exact ht + +lemma local_split_bound : ∃ C : ℝ, 0 (∫ y,‖gradient (u n) y‖)/(Real.pi*(2*low L)^2)) O := integrable_const _ + have hb := integral_mono_ae (hfi.norm.integrableOn (s := O)) (hsi.norm.integrableOn.add hcon) + (ae_restrict_of_ae (split_gradient (hu n).1 (hu n).2 (low_pos n) hat (small_le_high L n))) + simp only [Pi.add_apply] at hb + rw [integral_add hsi.norm.integrableOn hcon,setIntegral_const] at hb + simp only [smul_eq_mul,mul_comm (volume.real O)] at hb + apply hb.trans + gcongr + have hh := hlocal (hu n).1 (hu n).2 (low_pos n) (n-L) (K := K) hO + rw [← small_dyadic hn] at hh + exact hh hOK + +lemma diagonal_density_limit_ac {u : ℕ → ℂ → ℝ} {g : ℂ → ℂ} + (hu : ∀ n, ContDiff ℝ 1 (u n) ∧ HasCompactSupport (u n)) (hg : Integrable g) + (ht : Tendsto (fun n => ∫ x,‖gradient (u n) x-g x‖) atTop (𝓝 0)) + (w : ℕ → ℂ → ℝ) (hw : ∀ n, Integrable (w n)) (h0 : ∀ n,∀ᵐ x,0≤w n x) + {B A : ℝ} (hb : ∀ n,(∫ x,w n x)≤B) (hA : 0≤A) + (hdom : ∀ n,∀ᵐ x,w n x≤A*‖gradient (band (u n) (low n) (high n)) x‖) : + WeakCompact.densityLimit w hw h0 hb ≪ volume := by + have := WeakCompact.densityLimit_regular w hw h0 hb + apply WeakCompact.absolutelyContinuous_of_compact_null + intro K hK hK0 + obtain ⟨C,hC,hlocal⟩ := local_split_bound + let ν := WeakCompact.densityLimit w hw h0 hb + let V := ∫ x,‖g x‖ + have hi n : Integrable (gradient (u n)) := (continuous_gradient (hu n).1).integrable_of_hasCompactSupport (gradient_hasCompactSupport (hu n).2) + have hv := WeakSobolev.integral_norm_converges hg hi ht + have hL (L : ℕ) : ν K≤ENNReal.ofReal (A*C*(∫ x in Metric.thickening (12*(2*low L)) K,‖g x‖)) := by + have he (ε : ℝ) (hε : 0<ε) : ν K≤ENNReal.ofReal + (A*C*(∫ x in Metric.thickening (12*(2*low L)) K,‖g x‖)+A*(V/(Real.pi*(2*low L)^2))*ε) := by + obtain ⟨U,hKU,hU,hUf⟩ := K.exists_isOpen_lt_of_lt (μ := (volume : Measure ℂ)) (ENNReal.ofReal ε) (by simpa only [hK0] using ENNReal.ofReal_pos.mpr hε) + let O := U∩Metric.thickening (2*low L) K + have hO : IsOpen O := hU.inter Metric.isOpen_thickening + have hKO : K⊆O := subset_inter hKU (Metric.self_subset_thickening (by have := low_pos L; positivity) K) + have hOM : volume O≤ENNReal.ofReal ε := (measure_mono inter_subset_left).trans hUf.le + have hOf : volume O<⊤ := hOM.trans_lt ENNReal.ofReal_lt_top + have hOB : volume.real O≤ε := by + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hOM).trans_eq (ENNReal.toReal_ofReal hε.le) + have hgi n : Integrable (fun x => ‖gradient (band (u n) (low n) (high n)) x‖) := + (smooth_band_integrable_gradient (hu n).1 (hu n).2 (low_pos n) (low_le_high n)).norm + have hd n : (∫ x in O,w n x)≤A*(∫ x in O,‖gradient (band (u n) (low n) (high n)) x‖) := by + rw [← integral_const_mul] + exact integral_mono_ae (hw n).integrableOn ((hgi n).integrableOn.const_mul A) (ae_restrict_of_ae (hdom n)) + have hh : ν K≤ENNReal.ofReal (A*(C*(∫ x in Metric.thickening (12*(2*low L)) K,‖g x‖)+(V/(Real.pi*(2*low L)^2))*volume.real O)) := by + apply WeakCompact.densityLimit_compact_bound_limit w hw h0 hb hK hO hKO + (a := fun n => A*(C*(∫ x in Metric.thickening (12*(2*low L)) K,‖gradient (u n) x‖)+((∫ x,‖gradient (u n) x‖)/(Real.pi*(2*low L)^2))*volume.real O)) + · filter_upwards [hlocal hu L hO.measurableSet hOf inter_subset_right] with n hn + exact (hd n).trans (mul_le_mul_of_nonneg_left hn hA) + · exact ((gradient_error_restrict hu hg ht _).const_mul C |>.add ((hv.div_const _).mul_const _)).const_mul A + apply hh.trans (ENNReal.ofReal_le_ofReal ?_) + have hv0 : 0≤V := integral_nonneg (fun x => norm_nonneg (g x)) + have hcoef : 0≤A*(V/(Real.pi*(2*low L)^2)) := by positivity + nlinarith [mul_le_mul_of_nonneg_left hOB hcoef] + apply le_of_tendsto_of_tendsto (tendsto_const_nhds (x := ν K)) + (ENNReal.continuous_ofReal.continuousAt.tendsto.comp + (show Tendsto (fun n : ℕ => A*C*(∫ x in Metric.thickening (12*(2*low L)) K,‖g x‖)+A*(V/(Real.pi*(2*low L)^2))*(1/((n:ℝ)+1))) atTop + (𝓝 (A*C*(∫ x in Metric.thickening (12*(2*low L)) K,‖g x‖))) by + simpa only [mul_zero,add_zero] using tendsto_const_nhds.add ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul _))) + exact Eventually.of_forall (fun n => he _ (by positivity)) + apply le_antisymm _ bot_le + have ht' := ENNReal.continuous_ofReal.continuousAt.tendsto.comp ((thickening_null_integral hK hK0 hg.norm).const_mul (A*C)) + have hb' := le_of_tendsto_of_tendsto (tendsto_const_nhds (x := ν K)) ht' (Eventually.of_forall hL) + change ν K ≤ 0 + simpa only [mul_zero,ENNReal.ofReal_zero] using hb' +end NullLocalization + +namespace WeakCompact +open CompactlySupported CompactlySupportedContinuousMap + +lemma densityLimit_rn (w : ℕ → ℂ → ℝ) (hw : ∀ n,Integrable (w n)) + (h0 : ∀ n,∀ᵐ x,0≤w n x) {B D : ℝ} (hb : ∀ n,(∫ x,w n x)≤B) (hB : 0≤B) + (hac : densityLimit w hw h0 hb ≪ volume) + (hm : densityLimit w hw h0 hb univ≤ENNReal.ofReal D) (hD : 0≤D) : + ∃ d : ℂ → ℝ, Integrable d ∧ (∀ x,0≤d x) ∧ (∫ x,d x)≤D ∧ + ∀ φ : C_c(ℂ,ℝ), Tendsto (fun n => ∫ x,w n x*φ x) (hyperfilter ℕ) (𝓝 (∫ x,d x*φ x)) := by + let ν := densityLimit w hw h0 hb + have : IsFiniteMeasure ν := densityLimit_finite w hw h0 hb hB + let d := fun x => (ν.rnDeriv volume x).toReal + have hi : Integrable d := by + have h := Measure.integrableOn_toReal_rnDeriv (μ := ν) (ν := volume) (s := univ) (measure_ne_top ν univ) + simpa only [integrableOn_univ] using h + refine ⟨d,hi,fun x => ENNReal.toReal_nonneg,?_,?_⟩ + · rw [show (∫ x,d x)=ν.real univ from Measure.integral_toReal_rnDeriv hac] + exact (ENNReal.toReal_mono ENNReal.ofReal_ne_top hm).trans_eq (ENNReal.toReal_ofReal hD) + · intro φ + rw [show (∫ x,d x*φ x)=(∫ x,φ x ∂ν) from integral_toReal_rnDeriv_mul hac] + exact densityLimit_integral w hw h0 hb φ +end WeakCompact + +namespace WeakSobolev +lemma local_L1_test_converges {F : ℂ → ℝ} {u : ℕ → ℂ → ℝ} + (hF : LocallyIntegrable F) (hu : ∀ n,LocallyIntegrable (u n)) + (ht : ∀ K : Set ℂ, IsCompact K → Tendsto (fun n => ∫ x in K,‖u n x-F x‖) atTop (𝓝 0)) + {φ : ℂ → ℝ} (hφ : Continuous φ) (hc : HasCompactSupport φ) : + Tendsto (fun n => ∫ x,u n x*φ x) atTop (𝓝 (∫ x,F x*φ x)) := by + let K := tsupport φ + have hK : IsCompact K := hc + have hFm : IntegrableOn F K := hF.integrableOn_isCompact hK + have hum n : IntegrableOn (u n) K := (hu n).integrableOn_isCompact hK + obtain ⟨B,hB⟩ := hc.exists_bound_of_continuous hφ + have hlim := bounded_smul_converges hFm hum (ht K hK) hφ.aestronglyMeasurable.restrict (ae_of_all _ hB) + have hi n : IntegrableOn (fun x => φ x*u n x) K := (hum n).bdd_smul B hφ.aestronglyMeasurable.restrict (ae_of_all _ hB) + have hf : IntegrableOn (fun x => φ x*F x) K := hFm.bdd_smul B hφ.aestronglyMeasurable.restrict (ae_of_all _ hB) + have hh := integral_converges_norm hf hi hlim + have he (v : ℂ → ℝ) : (∫ x in K,φ x*v x)=(∫ x,v x*φ x) := by + rw [← integral_indicator hK.measurableSet] + apply integral_congr_ae + exact ae_of_all _ (fun x => by + by_cases hx : x∈K + · rw [indicator_of_mem hx,mul_comm] + · rw [indicator_of_notMem hx] + simp only [image_eq_zero_of_notMem_tsupport hx,mul_zero]) + simpa only [he,smul_eq_mul] using hh +end WeakSobolev + +namespace SobolevBand +open WeakSobolev WeakCompact CompactlySupported CompactlySupportedContinuousMap DiskMoments + +/-- Positive directional densities share a single ultrafilter, so their differences +retain the distributional identities. Absolute continuity is proved by local +small-radius cutoff estimates, rather than assumed as a BV compactness upgrade. -/ +lemma positive_direction_limit : ∃ C : ℝ, 0 ∫ x,‖gradient (u n) x-g x‖) atTop (𝓝 0) → + ∀ v : ℂ, ‖v‖≤1 → ∃ d : ℂ → ℝ, Integrable d ∧ (∀ x,0≤d x) ∧ + (∫ x,d x)≤2*C*(∫ x,‖g x‖) ∧ + ∀ φ : C_c(ℂ,ℝ), Tendsto + (fun n => ∫ x,(‖gradient (band (u n) (low n) (high n)) x‖+ + ⟪gradient (band (u n) (low n) (high n)) x,v⟫)*φ x) + (hyperfilter ℕ) (𝓝 (∫ x,d x*φ x)) := by + obtain ⟨C,hC,hbound⟩ := smooth_dyadic_bound + refine ⟨C,hC,?_⟩ + intro u g hu hg hV ht v hv + let q := fun n => gradient (band (u n) (low n) (high n)) + let w := fun n x => ‖q n x‖+⟪q n x,v⟫ + let V := ∫ x,‖g x‖ + have hV0 : 0≤V := integral_nonneg (fun x => norm_nonneg _) + have hqi n : Integrable (q n) := smooth_band_integrable_gradient (hu n).1 (hu n).2 (low_pos n) (low_le_high n) + have hwi n : Integrable (w n) := (hqi n).norm.add ((hqi n).inner_const (𝕜 := ℝ) v) + have hinner n x : |⟪q n x,v⟫|≤‖q n x‖ := + (abs_real_inner_le_norm (q n x) v).trans (mul_le_of_le_one_right (norm_nonneg _) hv) + have hw0 n : ∀ᵐ x,0≤w n x := ae_of_all _ (fun x => by + dsimp only [w] + have := (abs_le.mp (hinner n x)).1 + linarith) + have hdom n : ∀ᵐ x,w n x≤2*‖q n x‖ := ae_of_all _ (fun x => by + dsimp only [w] + have := (abs_le.mp (hinner n x)).2 + linarith) + have hmass n : (∫ x,w n x)≤2*C*(∫ x,‖gradient (u n) x‖) := by + have h := hbound (hu n).1 (hu n).2 (low_pos n) (2*n) + rw [← high_dyadic n] at h + calc + (∫ x,w n x) ≤ ∫ x,2*‖q n x‖ := integral_mono_ae (hwi n) ((hqi n).norm.const_mul 2) (hdom n) + _ = 2*(∫ x,‖q n x‖) := integral_const_mul _ _ + _ ≤ 2*(C*(∫ x,‖gradient (u n) x‖)) := mul_le_mul_of_nonneg_left h (by norm_num) + _ = _ := by ring + have hb n : (∫ x,w n x)≤2*C*(V+1) := + (hmass n).trans (mul_le_mul_of_nonneg_left (hV n) (by positivity)) + have hac := NullLocalization.diagonal_density_limit_ac hu hg ht w hwi hw0 hb (by norm_num : (0:ℝ)≤2) hdom + have hi n : Integrable (gradient (u n)) := (continuous_gradient (hu n).1).integrable_of_hasCompactSupport (gradient_hasCompactSupport (hu n).2) + have hsharp := densityLimit_sharp_mass w hwi hw0 hb hmass + ((integral_norm_converges hg hi ht).const_mul (2*C)) + exact densityLimit_rn w hwi hw0 hb (by positivity) hac hsharp (by positivity) +end SobolevBand + +namespace WeakSobolev +open CompactlySupported CompactlySupportedContinuousMap + +lemma direction_identity_limit {F : ℂ → ℝ} {H : ℕ → ℂ → ℝ} {q : ℕ → ℂ → ℂ} + (hF : LocallyIntegrable F) (hH : ∀ n, LocallyIntegrable (H n)) + (hqi : ∀ n, Integrable (q n)) (hw : ∀ n, HasGradient (μ := volume) (H n) (q n)) + (ht : ∀ K : Set ℂ, IsCompact K → Tendsto (fun n => ∫ x in K,‖H n x-F x‖) atTop (𝓝 0)) + {d e : ℂ → ℝ} (hd : Integrable d) (he : Integrable e) (v : ℂ) + (hv : ∀ φ : C_c(ℂ,ℝ), Tendsto (fun n => ∫ x,(‖q n x‖+⟪q n x,v⟫)*φ x) + (hyperfilter ℕ) (𝓝 (∫ x,d x*φ x))) + (h0 : ∀ φ : C_c(ℂ,ℝ), Tendsto (fun n => ∫ x,(‖q n x‖+⟪q n x,(0:ℂ)⟫)*φ x) + (hyperfilter ℕ) (𝓝 (∫ x,e x*φ x))) : + ∀ φ : ℂ → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,F x*fderiv ℝ φ x v) = -∫ x,(d x-e x)*φ x := by + intro φ hφ hc + let φ' : C_c(ℂ,ℝ) := ⟨⟨φ,hφ.continuous⟩,hc⟩ + have hn n : Integrable (fun x => ‖q n x‖*φ x) := + (hqi n).norm.locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hp n : Integrable (fun x => (‖q n x‖+⟪q n x,v⟫)*φ x) := + ((hqi n).norm.add ((hqi n).inner_const (𝕜 := ℝ) v)).locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hd' : Integrable (fun x => d x*φ x) := hd.locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have he' : Integrable (fun x => e x*φ x) := he.locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hvn n : (∫ x,(‖q n x‖+⟪q n x,v⟫)*φ x)-(∫ x,(‖q n x‖+⟪q n x,(0:ℂ)⟫)*φ x) = + ∫ x,⟪q n x,v⟫*φ x := by + simp only [inner_zero_right,add_zero] + rw [← integral_sub (hp n) (hn n)] + apply integral_congr_ae + exact ae_of_all _ (fun x => by ring) + have hde : (∫ x,d x*φ x)-(∫ x,e x*φ x) = ∫ x,(d x-e x)*φ x := by + rw [← integral_sub hd' he'] + apply integral_congr_ae + exact ae_of_all _ (fun x => by ring) + have hlim : Tendsto (fun n => ∫ x,H n x*fderiv ℝ φ x v) (hyperfilter ℕ) + (𝓝 (-∫ x,(d x-e x)*φ x)) := by + have h := ((hv φ').sub (h0 φ')).neg + change Tendsto (fun n => -((∫ x,(‖q n x‖+⟪q n x,v⟫)*φ x)-(∫ x,(‖q n x‖+⟪q n x,(0:ℂ)⟫)*φ x))) + (hyperfilter ℕ) (𝓝 (-((∫ x,d x*φ x)-(∫ x,e x*φ x)))) at h + simp only [hvn,hde,← hw _ φ hφ hc v] at h + exact h + exact tendsto_nhds_unique + ((local_L1_test_converges hF hH ht ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) + (hc.fderiv_apply ℝ v)).mono_left Nat.hyperfilter_le_atTop) hlim + +lemma complex_inner_one (z : ℂ) : ⟪z,(1:ℂ)⟫=(z.re:ℝ) := by + simp [real_inner_eq_re_inner, RCLike.inner_apply] +lemma complex_inner_I (z : ℂ) : ⟪z,Complex.I⟫=(z.im:ℝ) := by + simp [real_inner_eq_re_inner, RCLike.inner_apply] + +lemma complex_hasGradient_of_coordinates {F : ℂ → ℝ} {G : ℂ → ℂ} + (hF : LocallyIntegrable F) (hG : Integrable G) + (h1 : ∀ φ : ℂ → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,F x*fderiv ℝ φ x 1) = -∫ x,(G x).re*φ x) + (hI : ∀ φ : ℂ → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → + (∫ x,F x*fderiv ℝ φ x Complex.I) = -∫ x,(G x).im*φ x) : + HasGradient (μ := volume) F G := by + intro φ hφ hc v + have hv : v=v.re • (1:ℂ)+v.im • Complex.I := by simp only [Complex.real_smul, mul_one, Complex.re_add_im] + have hh w : Integrable (fun x => F x*fderiv ℝ φ x w) := + hF.integrable_smul_right_of_hasCompactSupport ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) (hc.fderiv_apply ℝ w) + have hg1 : Integrable (fun x => (G x).re*φ x) := + (hG.inner_const (𝕜 := ℝ) (1:ℂ)).locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc |>.congr (ae_of_all _ (fun x => by simp only [complex_inner_one,smul_eq_mul])) + have hgI : Integrable (fun x => (G x).im*φ x) := + (hG.inner_const (𝕜 := ℝ) Complex.I).locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc |>.congr (ae_of_all _ (fun x => by simp only [complex_inner_I,smul_eq_mul])) + have hfder x : F x*fderiv ℝ φ x v=v.re*(F x*fderiv ℝ φ x 1)+v.im*(F x*fderiv ℝ φ x Complex.I) := by + conv_lhs => rw [hv] + simp only [map_add,map_smul,smul_eq_mul] + ring + have hinner x : ⟪G x,v⟫*φ x=v.re*((G x).re*φ x)+v.im*((G x).im*φ x) := by + conv_lhs => rw [hv] + rw [inner_add_right,real_inner_smul_right,real_inner_smul_right,complex_inner_one,complex_inner_I] + ring + simp_rw [hfder,hinner] + rw [integral_add ((hh 1).const_mul _) ((hh Complex.I).const_mul _), + integral_add (hg1.const_mul _) (hgI.const_mul _)] + simp only [integral_const_mul,h1 φ hφ hc,hI φ hφ hc] + ring +end WeakSobolev + +namespace SobolevBand +open WeakSobolev DiskMaximalTools DiskMoments + +/-- The all-radius absolute endpoint on the isometric complex model of the plane. +No smoothness, sign, compact support, or boundedness remains on the input. -/ +lemma complex_endpoint : ∃ C : ℝ, 0 absCoefficient (f x) • g x + have ha : Integrable a := (abs_gradient_bound hf hg).1 + obtain ⟨u,hu,hV,ht,he⟩ := exists_diagonal_smooth hf.abs ha (hw.abs hf hg) + let H := fun n => band (u n) (low n) (high n) + let q := fun n => gradient (H n) + have hqi n : Integrable (q n) := smooth_band_integrable_gradient (hu n).1 (hu n).2 (low_pos n) (low_le_high n) + have hH n : LocallyIntegrable (H n) := (smooth_band_lipschitz (hu n).1 (hu n).2 (low_pos n) (low_le_high n)).continuous.locallyIntegrable + have hwH n : HasGradient (μ := volume) (H n) (q n) := + lipschitz_hasGradient (smooth_band_lipschitz (hu n).1 (hu n).2 (low_pos n) (low_le_high n)) + have hF := locallyIntegrable_maximal hf hg hw + have htH (K : Set ℂ) (hK : IsCompact K) : + Tendsto (fun n => ∫ x in K,‖H n x-maximalComplexReal f x‖) atTop (𝓝 0) := + smooth_diagonal_local_L1 hf hg hw hu he hK + obtain ⟨d0,hd0,h0pos,h0mass,h0lim⟩ := hlim hu ha hV ht 0 (by simp) + obtain ⟨d1,hd1,h1pos,h1mass,h1lim⟩ := hlim hu ha hV ht 1 (by simp) + obtain ⟨dI,hdI,hIpos,hImass,hIlim⟩ := hlim hu ha hV ht Complex.I (by simp) + let G := fun x => ((d1 x-d0 x : ℝ):ℂ)+((dI x-d0 x : ℝ):ℂ)*Complex.I + have hG : Integrable G := ((hd1.sub hd0).ofReal).add (((hdI.sub hd0).ofReal).mul_const Complex.I) + have hGre x : (G x).re=d1 x-d0 x := by simp [G] + have hGim x : (G x).im=dI x-d0 x := by simp [G] + refine ⟨hF,G,hG,?_,?_⟩ + · apply complex_hasGradient_of_coordinates hF hG + · simpa only [hGre] using direction_identity_limit hF hH hqi hwH htH hd1 hd0 1 h1lim h0lim + · simpa only [hGim] using direction_identity_limit hF hH hqi hwH htH hdI hd0 Complex.I hIlim h0lim + · have hb x : ‖G x‖≤d1 x+dI x+2*d0 x := by + have h := Complex.norm_le_abs_re_add_abs_im (G x) + rw [hGre,hGim] at h + have h1 : |d1 x-d0 x| ≤ d1 x+d0 x := by + exact abs_le.mpr ⟨by linarith [h1pos x,h0pos x],by linarith [h1pos x,h0pos x]⟩ + have hI : |dI x-d0 x| ≤ dI x+d0 x := by + exact abs_le.mpr ⟨by linarith [hIpos x,h0pos x],by linarith [hIpos x,h0pos x]⟩ + linarith + have hi := integral_mono hG.norm ((hd1.add hdI).add (hd0.const_mul 2)) hb + simp only [Pi.add_apply] at hi + rw [integral_add (f := fun x => d1 x+dI x) (hd1.add hdI) (hd0.const_mul 2),integral_add hd1 hdI,integral_const_mul] at hi + have hba : (∫ x,‖a x‖)≤∫ x,‖g x‖ := (abs_gradient_bound hf hg).2 + have hh : (∫ x,‖G x‖)≤8*C*(∫ x,‖a x‖) := by linarith + exact hh.trans (mul_le_mul_of_nonneg_left hba (by positivity)) +end SobolevBand + +namespace WeakSobolev +variable {E F : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [NormedAddCommGroup F] [InnerProductSpace ℝ F] + [FiniteDimensional ℝ E] [FiniteDimensional ℝ F] + [MeasurableSpace E] [BorelSpace E] [MeasurableSpace F] [BorelSpace F] + +lemma HasGradient.comp_isometry {f : F → ℝ} {g : F → F} + (hw : HasGradient (μ := volume) f g) (e : E ≃ₗᵢ[ℝ] F) : + HasGradient (μ := volume) (fun x => f (e x)) (fun x => e.symm (g (e x))) := by + intro φ hφ hc v + let ψ := φ ∘ e.symm + have hψ : ContDiff ℝ ∞ ψ := hφ.comp e.symm.contDiff + have hψc : HasCompactSupport ψ := hc.comp_homeomorph e.symm.toHomeomorph + have hd x : fderiv ℝ ψ (e x) (e v)=fderiv ℝ φ x v := by + rw [fderiv_comp (e x) (hφ.differentiable (by simp) _) (e.symm.differentiableAt),e.symm.fderiv] + change fderiv ℝ φ (e.symm (e x)) (e.symm (e v))=fderiv ℝ φ x v + simp only [e.symm_apply_apply] + have hi x : ⟪e.symm (g (e x)),v⟫=⟪g (e x),e v⟫ := by + simpa only [e.apply_symm_apply] using (e.inner_map_map (e.symm (g (e x))) v).symm + have h := hw ψ hψ hψc (e v) + rw [← e.measurePreserving.integral_comp e.toMeasurableEquiv.measurableEmbedding (fun y => f y*fderiv ℝ ψ y (e v)), + ← e.measurePreserving.integral_comp e.toMeasurableEquiv.measurableEmbedding (fun y => ⟪g y,e v⟫*ψ y)] at h + simpa only [hd,← hi,ψ,Function.comp_apply,e.symm_apply_apply] using h +end WeakSobolev + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Approximation.lean b/lean/OAI/Analysis/DiskMaximal/Approximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0e10046cc19dc6c103c0f6aa8a21f3d053f14f12 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Approximation.lean @@ -0,0 +1,731 @@ +import OAI.Analysis.DiskMaximal.BandBounds + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace WeakSobolev +open ContinuousLinearMap +open scoped Convolution +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +/-- Directional, coordinate-free distributional gradient. -/ +def HasGradient (f : E → ℝ) (g : E → E) : Prop := + ∀ φ : E → ℝ, ContDiff ℝ ∞ φ → HasCompactSupport φ → ∀ v : E, + (∫ x, f x * fderiv ℝ φ x v ∂μ) = -∫ x, ⟪g x,v⟫ * φ x ∂μ + +omit [FiniteDimensional ℝ E] [BorelSpace E] [μ.IsAddHaarMeasure] in +lemma HasGradient.congr_ae {f f' : E → ℝ} {g g' : E → E} + (h : HasGradient (μ := μ) f g) (hf : f =ᵐ[μ] f') (hg : g =ᵐ[μ] g') : + HasGradient (μ := μ) f' g' := by + intro φ hφ hc v + calc + _ = (∫ x, f x * fderiv ℝ φ x v ∂μ) := integral_congr_ae (hf.symm.mono (fun _ hx => by simp only [hx])) + _ = _ := h φ hφ hc v + _ = _ := by congr 1; exact integral_congr_ae (hg.mono (fun _ hx => by simp only [hx])) + +lemma contDiff_hasGradient {f : E → ℝ} (hf : ContDiff ℝ 1 f) : + HasGradient (μ := μ) f (gradient f) := by + intro φ hφ hc v + simp_rw [inner_gradient_left] + apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + · exact (((hf.continuous_fderiv one_ne_zero).clm_apply continuous_const).mul hφ.continuous).integrable_of_hasCompactSupport hc.mul_left + · exact (hf.continuous.mul ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const)).integrable_of_hasCompactSupport (hc.fderiv_apply ℝ v).mul_left + · exact (hf.continuous.mul hφ.continuous).integrable_of_hasCompactSupport hc.mul_left + · intro x _; exact hf.differentiable one_ne_zero x + · intro x _; exact hφ.differentiable (by simp) x + +omit [μ.IsAddHaarMeasure] in +lemma HasGradient.mul_contDiff {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (hw : HasGradient (μ := μ) f g) + {χ : E → ℝ} (hχ : ContDiff ℝ ∞ χ) (hc : HasCompactSupport χ) : + HasGradient (μ := μ) (fun x => χ x*f x) + (fun x => χ x • g x + f x • gradient χ x) := by + intro φ hφ hφc v + have hdχ : Continuous (fun x => fderiv ℝ χ x v) := (hχ.continuous_fderiv (by simp)).clm_apply continuous_const + have hdφ : Continuous (fun x => fderiv ℝ φ x v) := (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have h1 : Integrable (fun x => f x*(χ x*fderiv ℝ φ x v)) μ := + hf.locallyIntegrable.integrable_smul_right_of_hasCompactSupport (hχ.continuous.mul hdφ) hc.mul_right + have h2 : Integrable (fun x => f x*(φ x*fderiv ℝ χ x v)) μ := + hf.locallyIntegrable.integrable_smul_right_of_hasCompactSupport (hφ.continuous.mul hdχ) hφc.mul_right + have h3 : Integrable (fun x => ⟪g x,v⟫*(χ x*φ x)) μ := + (hg.inner_const (𝕜 := ℝ) v).locallyIntegrable.integrable_smul_right_of_hasCompactSupport (hχ.continuous.mul hφ.continuous) hc.mul_right + have h := hw (χ*φ) (hχ.mul hφ) (hc.mul_right) v + have he (x) : fderiv ℝ (χ*φ) x v = χ x*fderiv ℝ φ x v+φ x*fderiv ℝ χ x v := by + rw [fderiv_mul (hχ.differentiable (by simp) x) (hφ.differentiable (by simp) x)] + rfl + simp_rw [he,mul_add] at h + rw [integral_add h1 h2] at h + have he2 (x) : ⟪χ x • g x + f x • gradient χ x,v⟫ * φ x = + ⟪g x,v⟫*(χ x*φ x)+f x*(φ x*fderiv ℝ χ x v) := by + rw [inner_add_left,real_inner_smul_left,real_inner_smul_left,inner_gradient_left] + ring + simp_rw [he2] + rw [integral_add h3 h2] + have hi : (∫ x, χ x*f x*fderiv ℝ φ x v ∂μ) = ∫ x, f x*(χ x*fderiv ℝ φ x v) ∂μ := by + congr 1; ext x; ring + rw [hi] + simp only [Pi.mul_apply] at h + linarith + +lemma gradient_convolution {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (hw : HasGradient (μ := μ) f g) + {K : E → ℝ} (hK : ContDiff ℝ ∞ K) (hc : HasCompactSupport K) (x : E) : + gradient (f ⋆[lsmul ℝ ℝ,μ] K) x = (K ⋆[lsmul ℝ ℝ,μ] g) x := by + apply ext_inner_right ℝ + intro v + rw [inner_gradient_left,(hc.hasFDerivAt_convolution_right (lsmul ℝ ℝ) hf.locallyIntegrable (hK.of_le (by simp)) x).fderiv] + rw [convolution_precompR_apply _ hf.locallyIntegrable (hc.fderiv ℝ) (hK.continuous_fderiv (by simp))] + let ψ : E → ℝ := fun y => K (x-y) + have hψ : ContDiff ℝ ∞ ψ := hK.comp (contDiff_const.sub contDiff_id) + have hcψ : HasCompactSupport ψ := hc.comp_homeomorph (Homeomorph.subLeft x) + have hd (y) : fderiv ℝ ψ y v = -(fderiv ℝ K (x-y) v) := by + have he := (hK.differentiable (by simp) (x-y)).hasFDerivAt.comp y + ((hasFDerivAt_const x y).sub (hasFDerivAt_id y)) + change fderiv ℝ (K ∘ (fun y => x-y)) y v = _ + rw [he.fderiv] + simp + have he := hw ψ hψ hcψ v + simp_rw [hd,mul_neg] at he + rw [integral_neg,neg_inj] at he + have hi := (hc.convolutionExists_left (lsmul ℝ ℝ) hK.continuous hg.locallyIntegrable x).integrable_swap + change Integrable (fun y => K (x-y) • g y) μ at hi + calc + _ = ∫ y, ⟪g y,v⟫ * K (x-y) ∂μ := he + _ = ⟪∫ y, K (x-y) • g y ∂μ,v⟫ := by + rw [real_inner_comm,← integral_inner (𝕜 := ℝ) hi] + apply integral_congr_ae + exact ae_of_all _ (fun y => by simp only [real_inner_smul_right,real_inner_comm]; ring) + _ = _ := by rw [convolution_eq_swap]; rfl + +lemma norm_convolution_le {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + {K : E → ℝ} {g : E → F} + (hK : Integrable K μ) (hg : Integrable g μ) : + (∫ x, ‖(K ⋆[lsmul ℝ ℝ,μ] g) x‖ ∂μ) ≤ (∫ x, |K x| ∂μ)*(∫ x, ‖g x‖ ∂μ) := by + have hi := hK.norm.integrable_convolution (lsmul ℝ ℝ) hg.norm + calc + _ ≤ ∫ x, ( (fun y => ‖K y‖) ⋆[lsmul ℝ ℝ,μ] (fun y => ‖g y‖)) x ∂μ := by + apply integral_mono_ae (hK.integrable_convolution (lsmul ℝ ℝ) hg).norm hi + filter_upwards [hK.norm.ae_convolution_exists (lsmul ℝ ℝ) hg.norm] with x hx + simp only [convolution_def,lsmul_apply,smul_eq_mul] at hx ⊢ + exact norm_integral_le_of_norm_le hx (ae_of_all _ (fun y => by rw [norm_smul])) + _ = _ := by rw [integral_convolution _ hK.norm hg.norm]; simp only [lsmul_apply,smul_eq_mul,Real.norm_eq_abs] + +end WeakSobolev + +namespace WeakSobolev +open ContinuousLinearMap +open scoped Convolution + +/-- Scheffe's argument for vector-valued L1 functions, without an a priori +pointwise dominating function for the approximating sequence. -/ +lemma norm_sub_tendsto_zero {α F : Type*} [MeasurableSpace α] + [NormedAddCommGroup F] {μ : Measure α} {f : α → F} {u : ℕ → α → F} + (hf : Integrable f μ) (hu : ∀ n, Integrable (u n) μ) + (hlim : ∀ᵐ x ∂μ, Tendsto (fun n => u n x) atTop (𝓝 (f x))) + (hbound : ∀ n, (∫ x, ‖u n x‖ ∂μ) ≤ ∫ x, ‖f x‖ ∂μ) : + Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0) := by + let d := fun n x => ‖u n x‖+‖f x‖-‖u n x-f x‖ + have hd0 (n x) : 0 ≤ d n x := sub_nonneg.mpr (norm_sub_le _ _) + have hd2 (n x) : d n x ≤ 2*‖f x‖ := by + have hn := norm_le_norm_sub_add (u n x) (f x) + dsimp [d]; linarith + have hdint (n) : Integrable (d n) μ := ((hu n).norm.add hf.norm).sub ((hu n).sub hf).norm + have hdt : Tendsto (fun n => ∫ x, d n x ∂μ) atTop (𝓝 (2*∫ x, ‖f x‖ ∂μ)) := by + rw [← integral_const_mul] + apply tendsto_integral_of_dominated_convergence (fun x => 2*‖f x‖) + · intro n; exact (hdint n).aestronglyMeasurable + · exact hf.norm.const_mul 2 + · intro n; exact ae_of_all _ (fun x => by rw [Real.norm_eq_abs,abs_of_nonneg (hd0 n x)]; exact hd2 n x) + · filter_upwards [hlim] with x hx + have he := (hx.norm.add (tendsto_const_nhds (x := ‖f x‖))).sub ((hx.sub (tendsto_const_nhds (x := f x))).norm) + simpa only [sub_self,norm_zero,sub_zero,two_mul,d] using he + have hle (n) : (∫ x, ‖u n x-f x‖ ∂μ) ≤ 2*(∫ x, ‖f x‖ ∂μ)-(∫ x, d n x ∂μ) := by + have he : (∫ x, d n x ∂μ) = (∫ x, ‖u n x‖ ∂μ)+(∫ x, ‖f x‖ ∂μ)-(∫ x, ‖u n x-f x‖ ∂μ) := by + exact (integral_sub ((hu n).norm.add hf.norm) ((hu n).sub hf).norm).trans (by simp only [Pi.add_apply, Pi.sub_apply]; rw [integral_add (hu n).norm hf.norm]) + rw [he] + linarith [hbound n] + apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) hle + simpa only [sub_self] using (tendsto_const_nhds (x := 2*∫ x, ‖f x‖ ∂μ)).sub hdt + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +/-- A concrete normalized smooth approximate identity; all integrals retain the +ambient Haar measure, rather than changing normalization. -/ +def mollifier (n : ℕ) : ContDiffBump (0 : E) where + rIn := 1/((n:ℝ)+1) + rOut := 2/((n:ℝ)+1) + rIn_pos := by positivity + rIn_lt_rOut := div_lt_div_of_pos_right (by norm_num) (by positivity) + +omit [InnerProductSpace ℝ E] [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] in +lemma mollifier_radius_tendsto : Tendsto (fun n => (mollifier (E := E) n).rOut) atTop (𝓝 0) := by + have h := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul 2 + simpa only [mollifier,← mul_div_assoc,mul_one,mul_zero] using h + +def smooth (f : E → ℝ) (n : ℕ) : E → ℝ := (mollifier n).normed μ ⋆[lsmul ℝ ℝ,μ] f + +def smoothVector {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] (f : E → F) (n : ℕ) : E → F := + (mollifier n).normed μ ⋆[lsmul ℝ ℝ,μ] f + +lemma smoothVector_integrable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + {f : E → F} (hf : Integrable f μ) (n : ℕ) : Integrable (smoothVector (μ := μ) f n) μ := + (mollifier n).integrable_normed.integrable_convolution (lsmul ℝ ℝ) hf + +lemma smoothVector_contDiff {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + {f : E → F} (hf : Integrable f μ) (n : ℕ) : ContDiff ℝ ∞ (smoothVector (μ := μ) f n) := + (mollifier n).hasCompactSupport_normed.contDiff_convolution_left (lsmul ℝ ℝ) (mollifier n).contDiff_normed hf.locallyIntegrable + +lemma smoothVector_norm_le {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + {f : E → F} (hf : Integrable f μ) (n : ℕ) : + (∫ x, ‖smoothVector (μ := μ) f n x‖ ∂μ) ≤ ∫ x, ‖f x‖ ∂μ := by + have h := norm_convolution_le (mollifier n).integrable_normed hf + simpa only [smoothVector,abs_of_nonneg ((mollifier n).nonneg_normed (μ := μ) _),(mollifier n).integral_normed,mul_one,one_mul] using h + +lemma smoothVector_converges {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] [CompleteSpace F] + {f : E → F} (hf : Integrable f μ) : + Tendsto (fun n => ∫ x, ‖smoothVector (μ := μ) f n x-f x‖ ∂μ) atTop (𝓝 0) := by + apply norm_sub_tendsto_zero hf (smoothVector_integrable hf) + · exact ContDiffBump.ae_convolution_tendsto_right_of_locallyIntegrable mollifier_radius_tendsto + (Eventually.of_forall (fun n => (by dsimp [mollifier]; ring_nf; rfl : (mollifier (E := E) n).rOut ≤ 2*(mollifier n).rIn))) hf.locallyIntegrable + · exact smoothVector_norm_le hf + +lemma smooth_gradient {f : E → ℝ} {g : E → E} (hf : Integrable f μ) (hg : Integrable g μ) + (hw : HasGradient (μ := μ) f g) (n : ℕ) : + gradient (smooth (μ := μ) f n) = smoothVector (μ := μ) g n := by + ext x + have h := gradient_convolution hf hg hw ((mollifier n).contDiff_normed (μ := μ)) ((mollifier n).hasCompactSupport_normed (μ := μ)) x + have he : f ⋆[lsmul ℝ ℝ,μ] (mollifier n).normed μ = (mollifier n).normed μ ⋆[lsmul ℝ ℝ,μ] f := by + ext z + rw [convolution_def, convolution_def] + simp only [lsmul_apply, smul_eq_mul] + rw [← integral_sub_left_eq_self (fun y => f y * (mollifier n).normed μ (z-y)) μ z] + simp only [sub_sub_cancel] + apply integral_congr_ae + exact ae_of_all _ (fun y => mul_comm _ _) + simpa only [smooth,smoothVector,he] using h + +end WeakSobolev + +namespace WeakSobolev +open ContinuousLinearMap +open scoped Convolution +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +def cutoff (n : ℕ) (x : E) : ℝ := (mollifier (E := E) 0) (((n:ℝ)+1)⁻¹ • x) + +omit [MeasurableSpace E] [BorelSpace E] in +lemma cutoff_contDiff (n : ℕ) : ContDiff ℝ ∞ (cutoff (E := E) n) := + (mollifier 0).contDiff.comp (contDiff_const.smul contDiff_id) + +omit [MeasurableSpace E] [BorelSpace E] in +lemma cutoff_compact (n : ℕ) : HasCompactSupport (cutoff (E := E) n) := + (mollifier 0).hasCompactSupport.comp_smul (by positivity) + +omit [MeasurableSpace E] [BorelSpace E] in +lemma cutoff_bound (n : ℕ) (x : E) : 0 ≤ cutoff n x ∧ cutoff n x ≤ 1 := + ⟨(mollifier 0).nonneg, (mollifier 0).le_one⟩ + +omit [MeasurableSpace E] [BorelSpace E] in +lemma cutoff_tendsto (x : E) : Tendsto (fun n => cutoff n x) atTop (𝓝 1) := by + have ht : Tendsto (fun n : ℕ => ((n:ℝ)+1)⁻¹ • x) atTop (𝓝 0) := by + simpa only [one_div,zero_smul] using ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).smul_const x) + have h := ((mollifier (E := E) 0).continuous.tendsto 0).comp ht + have he : (mollifier (E := E) 0) (0:E) = 1 := (mollifier 0).one_of_mem_closedBall (mem_closedBall_self (mollifier 0).rIn_pos.le) + rw [he] at h + convert h using 1 + rfl + +omit [MeasurableSpace E] [BorelSpace E] in +lemma norm_gradient_fderiv (f : E → ℝ) (x : E) : ‖gradient f x‖ = ‖fderiv ℝ f x‖ := by + exact (InnerProductSpace.toDual ℝ E).symm.norm_map _ + +omit [MeasurableSpace E] [BorelSpace E] in +lemma cutoff_gradient_bound : ∃ L : ℝ, 0 ≤ L ∧ ∀ n x, + ‖gradient (cutoff (E := E) n) x‖ ≤ L/((n:ℝ)+1) := by + obtain ⟨L,hL⟩ := ((mollifier (E := E) 0).contDiff (n := (1:ℕ∞))).lipschitzWith_of_hasCompactSupport + (mollifier 0).hasCompactSupport one_ne_zero + refine ⟨L,L.coe_nonneg,?_⟩ + intro n x + have he : LipschitzWith (L*‖((n:ℝ)+1)⁻¹‖₊) (cutoff (E := E) n) := + hL.comp (show LipschitzWith ‖((n:ℝ)+1)⁻¹‖₊ (fun x : E => ((n:ℝ)+1)⁻¹ • x) from + lipschitzWith_smul (((n:ℝ)+1)⁻¹)) + rw [norm_gradient_fderiv] + have hb := norm_fderiv_le_of_lipschitz ℝ he (x₀ := x) + simpa only [NNReal.coe_mul, coe_nnnorm, Real.norm_eq_abs, abs_of_nonneg (by positivity : 0 ≤ ((n:ℝ)+1)⁻¹), div_eq_mul_inv] using hb + +omit [μ.IsAddHaarMeasure] in +lemma cutoff_smul_integrable {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + {f : E → F} (hf : Integrable f μ) (n : ℕ) : Integrable (fun x => cutoff n x • f x) μ := by + apply hf.bdd_smul 1 (cutoff_contDiff n).continuous.aestronglyMeasurable + exact ae_of_all _ (fun x => by rw [Real.norm_eq_abs,abs_of_nonneg (cutoff_bound n x).1]; exact (cutoff_bound n x).2) + +omit [μ.IsAddHaarMeasure] in +lemma cutoff_smul_converges {F : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F] + {f : E → F} (hf : Integrable f μ) : + Tendsto (fun n => ∫ x, ‖cutoff n x • f x-f x‖ ∂μ) atTop (𝓝 0) := by + have ht : Tendsto (fun n => ∫ x, ‖cutoff n x • f x-f x‖ ∂μ) atTop (𝓝 (∫ x, (0:ℝ) ∂μ)) := by + apply tendsto_integral_of_dominated_convergence (fun x => ‖f x‖) + · intro n; exact ((cutoff_smul_integrable hf n).sub hf).norm.aestronglyMeasurable + · exact hf.norm + · intro n + exact ae_of_all _ (fun x => by + rw [Real.norm_of_nonneg (norm_nonneg _), show cutoff n x • f x-f x = (cutoff n x-1) • f x by rw [sub_smul,one_smul], norm_smul, Real.norm_eq_abs, + abs_of_nonpos (sub_nonpos.mpr (cutoff_bound n x).2)] + nlinarith [(cutoff_bound n x).1,norm_nonneg (f x)]) + · exact ae_of_all _ (fun x => by + have hh := ((cutoff_tendsto x).smul_const (f x)).sub (tendsto_const_nhds (x := f x)) |>.norm + simpa only [one_smul,sub_self,norm_zero] using hh) + simpa only [integral_zero] using ht + +omit [μ.IsAddHaarMeasure] in +lemma cutoff_gradient_integrable {f : E → ℝ} (hf : Integrable f μ) (n : ℕ) : + Integrable (fun x => f x • gradient (cutoff (E := E) n) x) μ := by + exact hf.locallyIntegrable.integrable_smul_right_of_hasCompactSupport + ((InnerProductSpace.toDual ℝ E).symm.continuous.comp ((cutoff_contDiff n).continuous_fderiv (by simp))) + (by + apply (cutoff_compact (E := E) n).fderiv ℝ |>.comp_left + exact (InnerProductSpace.toDual ℝ E).symm.map_zero) + +omit [μ.IsAddHaarMeasure] in +lemma cutoff_gradient_converges {f : E → ℝ} (hf : Integrable f μ) : + Tendsto (fun n => ∫ x, ‖f x • gradient (cutoff (E := E) n) x‖ ∂μ) atTop (𝓝 0) := by + obtain ⟨L,hL,hb⟩ := cutoff_gradient_bound (E := E) + have ht : Tendsto (fun n : ℕ => (L/((n:ℝ)+1)) * ∫ x, ‖f x‖ ∂μ) atTop (𝓝 0) := by + have hh := ((tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).const_mul L).mul_const (∫ x, ‖f x‖ ∂μ) + simpa only [mul_zero,zero_mul,mul_one_div] using hh + apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) _ ht + intro n + rw [← integral_const_mul] + apply integral_mono (cutoff_gradient_integrable hf n).norm (hf.norm.const_mul _) + intro x + dsimp only + rw [norm_smul, mul_comm] + exact mul_le_mul_of_nonneg_right (hb n x) (norm_nonneg _) + +end WeakSobolev + +namespace WeakSobolev +open ContinuousLinearMap +open scoped Convolution + +lemma integral_norm_sub_triangle {α F : Type*} [MeasurableSpace α] [NormedAddCommGroup F] + {μ : Measure α} {f g h : α → F} (hf : Integrable f μ) (hg : Integrable g μ) (hh : Integrable h μ) : + (∫ x, ‖f x-h x‖ ∂μ) ≤ (∫ x, ‖f x-g x‖ ∂μ)+(∫ x, ‖g x-h x‖ ∂μ) := by + have he := integral_add (hf.sub hg).norm (hg.sub hh).norm + simp only [Pi.sub_apply] at he + rw [← he] + exact integral_mono (hf.sub hh).norm ((hf.sub hg).norm.add (hg.sub hh).norm) (fun x => norm_sub_le_norm_sub_add_norm_sub _ _ _) + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +def cutGradient (f : E → ℝ) (g : E → E) (n : ℕ) (x : E) : E := + cutoff n x • g x + f x • gradient (cutoff (E := E) n) x + +omit [μ.IsAddHaarMeasure] in +lemma cutGradient_integrable {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (n : ℕ) : + Integrable (cutGradient f g n) μ := + (cutoff_smul_integrable hg n).add (cutoff_gradient_integrable hf n) + +omit [μ.IsAddHaarMeasure] in +lemma cutGradient_converges {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) : + Tendsto (fun n => ∫ x, ‖cutGradient f g n x-g x‖ ∂μ) atTop (𝓝 0) := by + have ht := (cutoff_smul_converges hg).add (cutoff_gradient_converges hf) + apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) _ (by simpa only [zero_add] using ht) + intro n + have he := integral_add ((cutoff_smul_integrable hg n).sub hg).norm (cutoff_gradient_integrable hf n).norm + simp only [Pi.sub_apply] at he + rw [← he] + apply integral_mono ((cutGradient_integrable hf hg n).sub hg).norm (((cutoff_smul_integrable hg n).sub hg).norm.add (cutoff_gradient_integrable hf n).norm) + intro x + change ‖cutoff n x • g x + f x • gradient (cutoff n) x - g x‖ ≤ ‖cutoff n x • g x - g x‖+‖f x • gradient (cutoff n) x‖ + simpa only [add_sub_right_comm] using norm_add_le (cutoff n x • g x-g x) (f x • gradient (cutoff n) x) + +/-- Strong W11 density obtained by truncation and normalized mollification. +Both approximations are genuine functions, not distributions defined by a new axiom. -/ +theorem exists_smooth_compact_approx {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (hw : HasGradient (μ := μ) f g) + {ε : ℝ} (hε : 0 < ε) : + ∃ u : E → ℝ, ContDiff ℝ ∞ u ∧ HasCompactSupport u ∧ + (∫ x, ‖u x-f x‖ ∂μ) < ε ∧ (∫ x, ‖gradient u x-g x‖ ∂μ) < ε := by + have h1 := (cutoff_smul_converges hf).eventually (gt_mem_nhds (half_pos hε)) + have h2 := (cutGradient_converges hf hg).eventually (gt_mem_nhds (half_pos hε)) + obtain ⟨n,hn1,hn2⟩ := (h1.and h2).exists + let f' : E → ℝ := fun x => cutoff n x*f x + let g' : E → E := cutGradient f g n + have hf' : Integrable f' μ := cutoff_smul_integrable hf n + have hg' : Integrable g' μ := cutGradient_integrable hf hg n + have hw' : HasGradient (μ := μ) f' g' := hw.mul_contDiff hf hg (cutoff_contDiff n) (cutoff_compact n) + have hk1 := (smoothVector_converges hf').eventually (gt_mem_nhds (half_pos hε)) + have hk2 := (smoothVector_converges hg').eventually (gt_mem_nhds (half_pos hε)) + obtain ⟨k,hk1,hk2⟩ := (hk1.and hk2).exists + refine ⟨smooth (μ := μ) f' k, smoothVector_contDiff hf' k, ?_, ?_, ?_⟩ + · exact (mollifier k).hasCompactSupport_normed.convolution (lsmul ℝ ℝ) (cutoff_compact n).mul_right + · have hi := integral_norm_sub_triangle (smoothVector_integrable hf' k) hf' hf + change (∫ x, ‖f' x-f x‖ ∂μ) < ε/2 at hn1 + change (∫ x, ‖smoothVector (μ := μ) f' k x-f x‖ ∂μ) < ε + linarith + · rw [smooth_gradient hf' hg' hw'] + have hi := integral_norm_sub_triangle (smoothVector_integrable hg' k) hg' hg + change (∫ x, ‖g' x-g x‖ ∂μ) < ε/2 at hn2 + linarith + +end WeakSobolev + +namespace WeakSobolev +section L1 +variable {α F : Type*} [MeasurableSpace α] [NormedAddCommGroup F] {μ : Measure α} + {f : α → F} {u : ℕ → α → F} + +lemma tendsto_eLpNorm_one (hf : Integrable f μ) (hu : ∀ n, Integrable (u n) μ) + (hlim : Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0)) : + Tendsto (fun n => eLpNorm (u n-f) 1 μ) atTop (𝓝 0) := by + have he (n) : eLpNorm (u n-f) 1 μ = ENNReal.ofReal (∫ x, ‖u n x-f x‖ ∂μ) := by + rw [eLpNorm_one_eq_lintegral_enorm ((hu n).sub hf).aestronglyMeasurable, + ← ofReal_integral_norm_eq_lintegral_enorm ((hu n).sub hf)] + rfl + simp_rw [he] + simpa only [ENNReal.ofReal_zero] using ENNReal.tendsto_ofReal hlim + +lemma integral_converges_norm [NormedSpace ℝ F] + (hf : Integrable f μ) (hu : ∀ n, Integrable (u n) μ) + (hlim : Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0)) : + Tendsto (fun n => ∫ x, u n x ∂μ) atTop (𝓝 (∫ x, f x ∂μ)) := + tendsto_integral_of_L1' f (Eventually.of_forall hu) (tendsto_eLpNorm_one hf hu hlim) + +lemma exists_ae_subseq (hf : Integrable f μ) (hu : ∀ n, Integrable (u n) μ) + (hlim : Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0)) : + ∃ s : ℕ → ℕ, StrictMono s ∧ ∀ᵐ x ∂μ, Tendsto (fun n => u (s n) x) atTop (𝓝 (f x)) := + (tendstoInMeasure_of_tendsto_eLpNorm (by norm_num : (1:ℝ≥0∞) ≠ 0) + (tendsto_eLpNorm_one hf hu hlim)).exists_seq_tendsto_ae + +lemma bounded_smul_converges [NormedSpace ℝ F] + (hf : Integrable f μ) (hu : ∀ n, Integrable (u n) μ) + (hlim : Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0)) + {φ : α → ℝ} (hφ : AEStronglyMeasurable φ μ) {K : ℝ} (hK : ∀ᵐ x ∂μ, ‖φ x‖ ≤ K) : + Tendsto (fun n => ∫ x, ‖φ x • u n x - φ x • f x‖ ∂μ) atTop (𝓝 0) := by + have ht := hlim.const_mul K + apply squeeze_zero' (Eventually.of_forall (fun n => integral_nonneg (fun x => norm_nonneg _))) _ (by simpa only [mul_zero] using ht) + exact Eventually.of_forall (fun n => by + rw [← integral_const_mul] + apply integral_mono_ae (( (hu n).bdd_smul K hφ hK).sub (hf.bdd_smul K hφ hK)).norm (((hu n).sub hf).norm.const_mul K) + filter_upwards [hK] with x hx + change ‖φ x • u n x-φ x • f x‖ ≤ K*‖u n x-f x‖ + rw [← smul_sub,norm_smul] + exact mul_le_mul_of_nonneg_right hx (norm_nonneg _)) +end L1 + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} + +omit [BorelSpace E] in +lemma integral_inner_mul {φ : E → ℝ} {g : E → E} + (hi : Integrable (fun x => φ x • g x) μ) (v : E) : + (∫ x, ⟪g x,v⟫*φ x ∂μ) = ⟪∫ x, φ x • g x ∂μ,v⟫ := by + rw [real_inner_comm,← integral_inner (𝕜 := ℝ) hi] + apply integral_congr_ae + exact ae_of_all _ (fun x => by dsimp only; rw [real_inner_smul_right,real_inner_comm]; ring) + +/-- The distributional identity is closed under strong L1 convergence of both +functions and their genuine gradients. -/ +lemma HasGradient.limit {f : E → ℝ} {g : E → E} {u : ℕ → E → ℝ} {v : ℕ → E → E} + (hf : Integrable f μ) (hg : Integrable g μ) + (hu : ∀ n, Integrable (u n) μ) (hv : ∀ n, Integrable (v n) μ) + (hw : ∀ n, HasGradient (μ := μ) (u n) (v n)) + (huf : Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0)) + (hvg : Tendsto (fun n => ∫ x, ‖v n x-g x‖ ∂μ) atTop (𝓝 0)) : + HasGradient (μ := μ) f g := by + intro φ hφ hc e + let d : E → ℝ := fun x => fderiv ℝ φ x e + have hd : Continuous d := (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hdc : HasCompactSupport d := hc.fderiv_apply ℝ e + obtain ⟨D,hD⟩ := hd.norm.bddAbove_range_of_hasCompactSupport hdc.norm + obtain ⟨K,hK⟩ := hφ.continuous.norm.bddAbove_range_of_hasCompactSupport hc.norm + have hDb : ∀ᵐ x ∂μ, ‖d x‖ ≤ D := ae_of_all _ (fun x => hD (mem_range_self x)) + have hKb : ∀ᵐ x ∂μ, ‖φ x‖ ≤ K := ae_of_all _ (fun x => hK (mem_range_self x)) + have ht1 := integral_converges_norm (hf.bdd_smul D hd.aestronglyMeasurable hDb) + (fun n => (hu n).bdd_smul D hd.aestronglyMeasurable hDb) + (bounded_smul_converges hf hu huf hd.aestronglyMeasurable hDb) + have ht2 := integral_converges_norm (hg.bdd_smul K hφ.continuous.aestronglyMeasurable hKb) + (fun n => (hv n).bdd_smul K hφ.continuous.aestronglyMeasurable hKb) + (bounded_smul_converges hg hv hvg hφ.continuous.aestronglyMeasurable hKb) + have he (n : ℕ) : (∫ x, d x • u n x ∂μ) = -⟪∫ x, φ x • v n x ∂μ,e⟫ := by + rw [← integral_inner_mul ((hv n).bdd_smul K hφ.continuous.aestronglyMeasurable hKb)] + simpa only [d,smul_eq_mul,mul_comm] using hw n φ hφ hc e + have ht3 := (ht2.inner (𝕜 := ℝ) (tendsto_const_nhds (x := e))).neg + have h := tendsto_nhds_unique ht1 (ht3.congr (fun n => (he n).symm)) + change (∫ x, d x • f x ∂μ) = -⟪∫ x, φ x • g x ∂μ,e⟫ at h + rw [← integral_inner_mul (hg.bdd_smul K hφ.continuous.aestronglyMeasurable hKb)] at h + simpa only [d,smul_eq_mul,mul_comm] using h + +end WeakSobolev + +namespace WeakSobolev +section Coefficients +variable {α F : Type*} [MeasurableSpace α] [NormedAddCommGroup F] [NormedSpace ℝ F] + {μ : Measure α} {g : α → F} {v : ℕ → α → F} +lemma varying_smul_converges + (hg : Integrable g μ) (hv : ∀ n, Integrable (v n) μ) + (hvg : Tendsto (fun n => ∫ x, ‖v n x-g x‖ ∂μ) atTop (𝓝 0)) + {c : α → ℝ} {d : ℕ → α → ℝ} {K : ℝ} (_hK : 0 ≤ K) + (hc : AEStronglyMeasurable c μ) (hd : ∀ n, AEStronglyMeasurable (d n) μ) + (hcb : ∀ᵐ x ∂μ, ‖c x‖ ≤ K) (hdb : ∀ n, ∀ᵐ x ∂μ, ‖d n x‖ ≤ K) + (hlim : ∀ᵐ x ∂μ, Tendsto (fun n => d n x) atTop (𝓝 (c x))) : + Tendsto (fun n => ∫ x, ‖d n x • v n x-c x • g x‖ ∂μ) atTop (𝓝 0) := by + have hi (n) : Integrable (fun x => ‖(d n x-c x) • g x‖) μ := + ((hg.bdd_smul K (hd n) (hdb n)).sub (hg.bdd_smul K hc hcb)).norm.congr + (ae_of_all _ (fun x => by dsimp only; rw [sub_smul]; rfl)) + have ht1 : Tendsto (fun n => ∫ x, ‖(d n x-c x) • g x‖ ∂μ) atTop (𝓝 0) := by + have ht := tendsto_integral_of_dominated_convergence (fun x => 2*K*‖g x‖) + (fun n => (hi n).aestronglyMeasurable) (hg.norm.const_mul (2*K)) + (fun n => by + filter_upwards [hdb n,hcb] with x hx hy + rw [norm_norm,norm_smul] + exact mul_le_mul_of_nonneg_right ((norm_sub_le _ _).trans (by linarith)) (norm_nonneg _)) + (hlim.mono (fun x hx => by simpa using ((hx.sub tendsto_const_nhds).smul_const (g x)).norm)) + simpa using ht + have ht2 : Tendsto (fun n => K*(∫ x, ‖v n x-g x‖ ∂μ)) atTop (𝓝 0) := by + simpa only [mul_zero] using hvg.const_mul K + apply squeeze_zero' (Eventually.of_forall (fun n => integral_nonneg (fun x => norm_nonneg _))) _ (by simpa only [zero_add] using ht1.add ht2) + exact Eventually.of_forall (fun n => by + have he := integral_add (hi n) (((hv n).sub hg).norm.const_mul K) + simp only [Pi.sub_apply] at he + rw [← integral_const_mul,← he] + apply integral_mono_ae (((hv n).bdd_smul K (hd n) (hdb n)).sub (hg.bdd_smul K hc hcb)).norm + ((hi n).add (((hv n).sub hg).norm.const_mul K)) + filter_upwards [hdb n] with x hx + change ‖d n x • v n x-c x • g x‖ ≤ ‖(d n x-c x) • g x‖+K*‖v n x-g x‖ + calc + _ = ‖(d n x-c x) • g x+d n x • (v n x-g x)‖ := by congr 1; module + _ ≤ ‖(d n x-c x) • g x‖+‖d n x • (v n x-g x)‖ := norm_add_le _ _ + _ ≤ _ := by + have hh : ‖d n x • (v n x-g x)‖ ≤ K*‖v n x-g x‖ := by + rw [norm_smul] + exact mul_le_mul_of_nonneg_right hx (norm_nonneg _) + exact add_le_add le_rfl hh) +end Coefficients + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +lemma exists_smooth_sequence {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (hw : HasGradient (μ := μ) f g) : + ∃ u : ℕ → E → ℝ, (∀ n, ContDiff ℝ ∞ (u n) ∧ HasCompactSupport (u n)) ∧ + Tendsto (fun n => ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0) ∧ + Tendsto (fun n => ∫ x, ‖gradient (u n) x-g x‖ ∂μ) atTop (𝓝 0) ∧ + (∀ᵐ x ∂μ, Tendsto (fun n => u n x) atTop (𝓝 (f x))) := by + have hex (n : ℕ) := exists_smooth_compact_approx hf hg hw (by positivity : 0 < 1/((n:ℝ)+1)) + choose u hu hc hf' hg' using hex + have ht : Tendsto (fun n : ℕ => 1/((n:ℝ)+1)) atTop (𝓝 0) := by + exact tendsto_one_div_add_atTop_nhds_zero_nat + have ht1 := squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) (fun n => (hf' n).le) ht + have ht2 := squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) (fun n => (hg' n).le) ht + have hi (n) : Integrable (u n) μ := (hu n).continuous.integrable_of_hasCompactSupport (hc n) + obtain ⟨s,hs,ha⟩ := exists_ae_subseq hf hi ht1 + exact ⟨fun n => u (s n),fun n => ⟨hu _,hc _⟩,ht1.comp hs.tendsto_atTop,ht2.comp hs.tendsto_atTop,ha⟩ + +omit [MeasurableSpace E] [BorelSpace E] in +lemma gradient_scalar_comp {u : E → ℝ} {Φ : ℝ → ℝ} + (hu : Differentiable ℝ u) (hΦ : Differentiable ℝ Φ) (x : E) : + gradient (Φ ∘ u) x = deriv Φ (u x) • gradient u x := by + apply ext_inner_right ℝ + intro v + rw [inner_gradient_left,real_inner_smul_left,inner_gradient_left] + rw [fderiv_comp x (hΦ _) (hu _)] + simp only [ContinuousLinearMap.comp_apply] + rw [(hΦ _).hasDerivAt.hasFDerivAt.fderiv] + change fderiv ℝ u x v * deriv Φ (u x) = deriv Φ (u x) * fderiv ℝ u x v + ring + +lemma HasGradient.scalar_comp {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (hw : HasGradient (μ := μ) f g) + {Φ : ℝ → ℝ} (hΦ : ContDiff ℝ 1 Φ) {K : ℝ≥0} (hK : LipschitzWith K Φ) (h0 : Φ 0 = 0) : + HasGradient (μ := μ) (Φ ∘ f) (fun x => deriv Φ (f x) • g x) := by + obtain ⟨u,hu,huf,hvg,ha⟩ := exists_smooth_sequence hf hg hw + have hi (n) : Integrable (u n) μ := (hu n).1.continuous.integrable_of_hasCompactSupport (hu n).2 + have hgi (n) : Integrable (gradient (u n)) μ := + ((InnerProductSpace.toDual ℝ E).symm.continuous.comp ((hu n).1.continuous_fderiv (by simp))).integrable_of_hasCompactSupport + (((hu n).2.fderiv ℝ).comp_left (map_zero _)) + have hid : Integrable (Φ ∘ f) μ := memLp_one_iff_integrable.mp (hK.comp_memLp h0 (memLp_one_iff_integrable.mpr hf)) + have hδ := hΦ.continuous_deriv le_rfl + have hδb (x : ℝ) : ‖deriv Φ x‖ ≤ (K:ℝ) := norm_deriv_le_of_lipschitz hK + have hgrad : Integrable (fun x => deriv Φ (f x) • g x) μ := + hg.bdd_smul K (hδ.comp_aestronglyMeasurable hf.aestronglyMeasurable) (ae_of_all _ (fun x => hδb _)) + have hvi (n) : Integrable (fun x => deriv Φ (u n x) • gradient (u n) x) μ := + (hgi n).bdd_smul K ((hδ.comp (hu n).1.continuous).aestronglyMeasurable) (ae_of_all _ (fun x => hδb _)) + apply HasGradient.limit (u := fun n => Φ ∘ u n) (v := fun n x => deriv Φ (u n x) • gradient (u n) x) hid hgrad (fun n => memLp_one_iff_integrable.mp (hK.comp_memLp h0 (memLp_one_iff_integrable.mpr (hi n)))) hvi + · intro n + exact (contDiff_hasGradient (μ := μ) (hΦ.comp ((hu n).1.of_le (by simp)))).congr_ae + (EventuallyEq.rfl) (ae_of_all _ (fun x => gradient_scalar_comp ((hu n).1.differentiable (by simp)) (hΦ.differentiable one_ne_zero) x)) + · apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) _ (by simpa only [mul_zero] using huf.const_mul (K:ℝ)) + intro n + rw [← integral_const_mul] + exact integral_mono ((memLp_one_iff_integrable.mp (hK.comp_memLp h0 (memLp_one_iff_integrable.mpr (hi n)))).sub hid).norm + (((hi n).sub hf).norm.const_mul (K:ℝ)) (fun x => hK.norm_sub_le _ _) + · exact varying_smul_converges hg hgi hvg K.coe_nonneg + (hδ.comp_aestronglyMeasurable hf.aestronglyMeasurable) + (fun n => (hδ.comp (hu n).1.continuous).aestronglyMeasurable) + (ae_of_all _ (fun x => hδb _)) (fun n => ae_of_all _ (fun x => hδb _)) + (ha.mono (fun x hx => (hδ.tendsto _).comp hx)) +end WeakSobolev + +namespace WeakSobolev +/-- Smooth absolute-value approximation with zero preserved. -/ +def smoothAbs (ε x : ℝ) : ℝ := Real.sqrt (x^2+ε^2)-ε +lemma smoothAbs_contDiff {ε : ℝ} (hε : 0 < ε) : ContDiff ℝ 1 (smoothAbs ε) := by + exact ((contDiff_id.pow 2).add contDiff_const).sqrt (fun x => ne_of_gt (by positivity)) |>.sub contDiff_const +lemma smoothAbs_hasDerivAt {ε : ℝ} (hε : 0 < ε) (x : ℝ) : + HasDerivAt (smoothAbs ε) (x/Real.sqrt (x^2+ε^2)) x := by + have he : x^2+ε^2 ≠ 0 := ne_of_gt (by positivity) + have hd := ((((hasDerivAt_id x).pow 2).add_const (ε^2)).sqrt he).sub_const ε + change HasDerivAt (fun y => Real.sqrt (y^2+ε^2)-ε) _ x + simpa [mul_div_mul_left x (Real.sqrt (x^2+ε^2)) (by norm_num : (2:ℝ) ≠ 0)] using hd +lemma smoothAbs_deriv {ε : ℝ} (hε : 0 < ε) (x : ℝ) : + deriv (smoothAbs ε) x = x/Real.sqrt (x^2+ε^2) := (smoothAbs_hasDerivAt hε x).deriv +lemma smoothAbs_deriv_bound {ε : ℝ} (hε : 0 < ε) (x : ℝ) : + ‖deriv (smoothAbs ε) x‖ ≤ 1 := by + rw [smoothAbs_deriv hε,Real.norm_eq_abs,abs_div,abs_of_nonneg (Real.sqrt_nonneg _)] + apply (div_le_iff₀ (Real.sqrt_pos.2 (by positivity))).2 + rw [one_mul] + have h := Real.sqrt_le_sqrt (le_add_of_nonneg_right (sq_nonneg ε) : x^2 ≤ x^2+ε^2) + simpa only [Real.sqrt_sq_eq_abs] using h +lemma smoothAbs_lipschitz {ε : ℝ} (hε : 0 < ε) : LipschitzWith 1 (smoothAbs ε) := + lipschitzWith_of_nnnorm_deriv_le (fun x => (smoothAbs_hasDerivAt hε x).differentiableAt) + (fun x => by exact_mod_cast smoothAbs_deriv_bound hε x) +lemma smoothAbs_zero {ε : ℝ} (hε : 0 ≤ ε) : smoothAbs ε 0 = 0 := by + simp [smoothAbs,Real.sqrt_sq,hε] +lemma smoothAbs_bound {ε : ℝ} (hε : 0 < ε) (x : ℝ) : ‖smoothAbs ε x‖ ≤ ‖x‖ := by + simpa only [smoothAbs_zero hε.le,sub_zero,NNReal.coe_one,one_mul] using (smoothAbs_lipschitz hε).norm_sub_le x 0 +lemma smoothAbs_tendsto (x : ℝ) : + Tendsto (fun n : ℕ => smoothAbs (1/((n:ℝ)+1)) x) atTop (𝓝 |x|) := by + have h := tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ) + have ht := ((tendsto_const_nhds (x := x^2)).add (h.pow 2)).sqrt |>.sub h + simpa only [smoothAbs,zero_pow (by norm_num : (2:ℕ) ≠ 0),add_zero,sub_zero,Real.sqrt_sq_eq_abs] using ht + +def absCoefficient (x : ℝ) : ℝ := x/|x| +lemma absCoefficient_bound (x : ℝ) : ‖absCoefficient x‖ ≤ 1 := by + by_cases hx : x=0 + · simp [absCoefficient,hx] + · simp [absCoefficient,Real.norm_eq_abs,abs_abs,abs_ne_zero.mpr hx] +lemma absCoefficient_measurable : Measurable absCoefficient := measurable_id.div measurable_id.abs +lemma smoothAbs_deriv_tendsto (x : ℝ) : + Tendsto (fun n : ℕ => deriv (smoothAbs (1/((n:ℝ)+1))) x) atTop (𝓝 (absCoefficient x)) := by + have he (n : ℕ) : deriv (smoothAbs (1/((n:ℝ)+1))) x = x/Real.sqrt (x^2+(1/((n:ℝ)+1))^2) := smoothAbs_deriv (by positivity) x + simp_rw [he] + by_cases hx : x=0 + · simp [hx,absCoefficient] + · have h := tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ) + have ht := (tendsto_const_nhds (x := x)).div (((tendsto_const_nhds (x := x^2)).add (h.pow 2)).sqrt) + (by simpa only [zero_pow (by norm_num : (2:ℕ) ≠0),add_zero,Real.sqrt_sq_eq_abs] using abs_ne_zero.mpr hx) + change Tendsto (fun n : ℕ => x / Real.sqrt (x^2+(1/((n:ℝ)+1))^2)) atTop + (𝓝 (x / Real.sqrt (x^2+0^2))) at ht + simpa only [zero_pow (by norm_num : (2:ℕ) ≠0),add_zero,Real.sqrt_sq_eq_abs,absCoefficient] using ht + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +lemma HasGradient.abs {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) (hw : HasGradient (μ := μ) f g) : + HasGradient (μ := μ) (fun x => |f x|) (fun x => absCoefficient (f x) • g x) := by + let ε : ℕ → ℝ := fun n => 1/((n:ℝ)+1) + have hε (n) : 0 < ε n := by dsimp [ε]; positivity + have hc : AEStronglyMeasurable (fun x => absCoefficient (f x)) μ := + (absCoefficient_measurable.comp_aemeasurable hf.aemeasurable).aestronglyMeasurable + have hcb : ∀ᵐ x ∂μ, ‖absCoefficient (f x)‖ ≤ (1:ℝ) := ae_of_all _ (fun x => absCoefficient_bound _) + have hi (n) : Integrable (smoothAbs (ε n) ∘ f) μ := + memLp_one_iff_integrable.mp ((smoothAbs_lipschitz (hε n)).comp_memLp (smoothAbs_zero (hε n).le) (memLp_one_iff_integrable.mpr hf)) + have hv (n) : Integrable (fun x => deriv (smoothAbs (ε n)) (f x) • g x) μ := + hg.bdd_smul 1 (((smoothAbs_contDiff (hε n)).continuous_deriv le_rfl).comp_aestronglyMeasurable hf.aestronglyMeasurable) + (ae_of_all _ (fun x => smoothAbs_deriv_bound (hε n) _)) + apply HasGradient.limit (u := fun n => smoothAbs (ε n) ∘ f) + (v := fun n x => deriv (smoothAbs (ε n)) (f x) • g x) hf.abs (hg.bdd_smul 1 hc hcb) hi hv + · intro n + exact hw.scalar_comp hf hg (smoothAbs_contDiff (hε n)) (smoothAbs_lipschitz (hε n)) (smoothAbs_zero (hε n).le) + · have ht := tendsto_integral_of_dominated_convergence (fun x => 2*‖f x‖) + (fun n => ((hi n).sub hf.abs).norm.aestronglyMeasurable) (hf.norm.const_mul 2) + (fun n => ae_of_all _ (fun x => by + change ‖‖smoothAbs (ε n) (f x)-|f x|‖‖ ≤ 2*‖f x‖ + rw [norm_norm] + exact (norm_sub_le _ _).trans (by simpa only [Real.norm_eq_abs,abs_abs,two_mul] using add_le_add (smoothAbs_bound (hε n) (f x)) (le_refl |f x|)))) + (ae_of_all _ (fun x => by simpa only [ε,Function.comp_apply,Pi.sub_apply,sub_self,norm_zero] using ((smoothAbs_tendsto (f x)).sub (tendsto_const_nhds (x := |f x|))).norm)) + simpa using ht + · apply varying_smul_converges hg (fun _ => hg) (by simp) zero_le_one hc + (fun n => ((smoothAbs_contDiff (hε n)).continuous_deriv le_rfl).comp_aestronglyMeasurable hf.aestronglyMeasurable) + hcb (fun n => ae_of_all _ (fun x => smoothAbs_deriv_bound (hε n) _)) + exact ae_of_all _ (fun x => smoothAbs_deriv_tendsto (f x)) + +omit [μ.IsAddHaarMeasure] [FiniteDimensional ℝ E] [BorelSpace E] in +lemma abs_gradient_bound {f : E → ℝ} {g : E → E} + (hf : Integrable f μ) (hg : Integrable g μ) : + Integrable (fun x => absCoefficient (f x) • g x) μ ∧ + (∫ x, ‖absCoefficient (f x) • g x‖ ∂μ) ≤ ∫ x, ‖g x‖ ∂μ := by + have hi := hg.bdd_smul 1 ((absCoefficient_measurable.comp_aemeasurable hf.aemeasurable).aestronglyMeasurable) + (ae_of_all _ (fun x => absCoefficient_bound (f x))) + refine ⟨hi,integral_mono hi.norm hg.norm (fun x => ?_)⟩ + rw [norm_smul] + simpa only [one_mul] using mul_le_mul_of_nonneg_right (absCoefficient_bound (f x)) (norm_nonneg (g x)) +end WeakSobolev + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/BandBounds.lean b/lean/OAI/Analysis/DiskMaximal/BandBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..55ffee24d98306034499389fdaff172c3bf24519 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/BandBounds.lean @@ -0,0 +1,711 @@ +import OAI.Analysis.DiskMaximal.SpatialBudgets + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace ActualLabels +open DyadicHats PhysicalCells CommonPrices ActualMarkTrees Finset FiniteLabels + +def spatialPriceConstant : ℝ := 1681*packingConstant+costLimit*priceConstant +lemma spatialPriceConstant_pos : 0 < spatialPriceConstant := by + unfold spatialPriceConstant + have := packingConstant_pos + have := costLimit_pos + have := priceConstant_nonneg + positivity + +def directPriceConstant : ℝ := 1000000*1681*(576*(4097:ℝ)^2)+priceConstant +lemma directPriceConstant_pos : 0 < directPriceConstant := by + unfold directPriceConstant + have := priceConstant_nonneg + positivity + +lemma pointCost_total_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) : + (∑ j ∈ range (m+1), ∑ p ∈ P j, + cellSup (fun x => pointCost h (geometricRadii base m) x m (m-j)) (scale base j) p* + (rootMass h base j (cellRoots N p)+cellPrice N base h j (cellRoots N p))) ≤ + spatialPriceConstant*(∫ y, ‖h y‖) := by + simp only [mul_add,sum_add_distrib] + have h1 := pointCost_mass_budget hb hR hN hh hsupp m P + have h2 := pointCost_price_budget hb hR hN hh hsupp m P + unfold spatialPriceConstant + nlinarith only [h1,h2] + +lemma marginal_total_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) (n : Label) : + (∑ j ∈ range (m+1), ∑ p ∈ P j, + localSup (fun x => marginal h (geometricRadii base m) (m-j) x n) (scale base j) p* + (badPrice h base j (cellRoots N p) n+cellPrice N base h j (cellRoots N p))) ≤ + directPriceConstant*(∫ y, ‖h y‖) := by + simp only [mul_add,sum_add_distrib] + have h1 := marginal_bad_budget hb hR hN hh hsupp m P n + have h2 := marginal_price_budget hb hR hN hh hsupp m P n + unfold directPriceConstant + nlinarith only [h1,h2] +end ActualLabels + +namespace CommonPrices +open DyadicHats Finset +lemma cellPrice_level_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (j : ℕ) (P : Finset (ℤ × ℤ)) : + (∑ p ∈ P, cellPrice N base h j (cellRoots N p)) ≤ priceConstant*(∫ y, ‖h y‖) := by + have hi := single_le_sum (s := range (j+1)) + (f := fun k => ∑ p ∈ P, cellPrice N base h k (cellRoots N p)) + (fun k _ => sum_nonneg (fun p _ => cellPrice_nonneg hb hR hN hh hsupp k _)) + (by simp : j ∈ range (j+1)) + exact hi.trans (cellPrice_budget hb hR hN hh hsupp j (fun _ => P)) + +lemma total_level_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (j : ℕ) (P : Finset (ℤ × ℤ)) : + (∑ p ∈ P, (rootMass h base j (cellRoots N p)+cellPrice N base h j (cellRoots N p))) ≤ + (1681+priceConstant)*(∫ y, ‖h y‖) := by + rw [sum_add_distrib,add_mul] + exact add_le_add (rootMass_cell_budget hh base j P) (cellPrice_level_budget hb hR hN hh hsupp j P) +end CommonPrices + +namespace ActualLabels +open DyadicHats GeometricFilter PhysicalCells FiniteLabels Finset +lemma gradient_measurable (f : ℂ → ℝ) : Measurable (gradient f) := + (InnerProductSpace.toDual ℝ ℂ).symm.continuous.measurable.comp (measurable_fderiv ℝ f) + +lemma marginal_continuous (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) (k : ℕ) (n : Label) : + Continuous (fun x => marginal h r k x n) := by + induction k generalizing n with + | zero => exact (observation_lipschitz h r 0 (hr 0) n n).continuous + | succ k ih => + change Continuous (fun x => ∑ j : Label, marginal h r k x j*row h (r (k+1)) x j n) + apply continuous_finsetSum + intro j _ + exact (ih j).mul (observation_lipschitz h r (k+1) (hr (k+1)) j n).continuous + +lemma rate_continuous (h : ℂ → ℂ) {r : ℝ} (hr : 0 < r) (n : Label) : + Continuous (fun x => rate h r x n) := by + exact (interpolate_lipschitz hr (by norm_num : (0:ℝ) ≤ 1) (fun p => by + rw [abs_of_nonneg (switchChance_nonneg h r n p)] + exact switchChance_le_one h r n p)).continuous + +lemma switchCost_continuous (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) (k : ℕ) : + Continuous (fun x => switchCost h r x k) := by + cases k with + | zero => exact continuous_const + | succ k => + change Continuous (fun x => ∑ j : Label, marginal h r k x j*rate h (r (k+1)) x j) + exact continuous_finsetSum _ (fun j _ => (marginal_continuous h r hr k j).mul (rate_continuous h (hr (k+1)) j)) + +lemma derivativeCost_measurable (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) (k : ℕ) : + Measurable (fun x => derivativeCost h r x k) := by + cases k with + | zero => + change Measurable (fun x => r 0*∑ j : Label, ‖gradient (fun y => initial h (r 0) y j) x‖) + exact measurable_const.mul (Finset.measurable_fun_sum _ (fun j _ => (gradient_measurable _).norm)) + | succ k => + change Measurable (fun x => ∑ n : Label, marginal h r k x n*(r (k+1)* + ∑ j : Label, ‖gradient (fun y => row h (r (k+1)) y n j) x‖)) + apply Finset.measurable_fun_sum + intro n _ + exact (marginal_continuous h r hr k n).measurable.mul + (measurable_const.mul (Finset.measurable_fun_sum _ (fun j _ => (gradient_measurable _).norm))) + +lemma filt_measurable {f : ℂ → ℕ → ℝ} (hf : ∀ i, Measurable (fun x => f x i)) (k : ℕ) : + Measurable (fun x => filt (f x) k) := by + induction k with + | zero => exact hf 0 + | succ k ih => exact (hf (k+1)).add (ih.div_const 2) + +lemma pointCost_measurable (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) (m k : ℕ) : + Measurable (fun x => pointCost h r x m k) := by + unfold pointCost boundaryCost + apply Measurable.add + · apply Measurable.add (switchCost_continuous h r hr k).measurable + split_ifs + · exact measurable_const + · exact (switchCost_continuous h r hr (k+1)).measurable + · exact filt_measurable (derivativeCost_measurable h r hr) k +end ActualLabels + +namespace PhysicalCells +open Finset +lemma sum_tsum_ofReal_le {ι κ : Type*} (s : Finset ι) (B : ι → κ → ℝ) + (hB : ∀ i ∈ s, ∀ p, 0 ≤ B i p) (A : ℝ) + (hbudget : ∀ P : Finset κ, ∑ i ∈ s, ∑ p ∈ P, B i p ≤ A) : + (∑ i ∈ s, ∑' p, ENNReal.ofReal (B i p)) ≤ ENNReal.ofReal A := by + rw [← Summable.tsum_finsetSum (fun _ _ => ENNReal.summable)] + simp_rw [← ENNReal.ofReal_sum_of_nonneg (fun i hi => hB i hi _)] + apply tsum_ofReal_le _ (fun p => sum_nonneg (fun i hi => hB i hi p)) + intro P + rw [Finset.sum_comm] + exact hbudget P + +lemma integrated_weighted_patches {ι : Type*} + (s : Finset ι) (r : ι → ℝ) (F : ι → (ℤ × ℤ) → ℂ → ℝ≥0∞) + (hF : ∀ i ∈ s, ∀ p, Measurable (F i p)) + (W : ι → ℂ → ℝ≥0∞) (hW : ∀ i ∈ s, Measurable (W i)) + (A B : ι → (ℤ × ℤ) → ℝ) (hA : ∀ i ∈ s, ∀ p, 0 ≤ A i p) + (hB : ∀ i ∈ s, ∀ p, 0 ≤ B i p) + (hcell : ∀ i ∈ s, ∀ p, (∫⁻ x in cell (DyadicHats.point (r i) p) (r i), F i p x) ≤ ENNReal.ofReal (B i p)) + (hWB : ∀ i ∈ s, ∀ p x, x ∈ cell (DyadicHats.point (r i) p) (r i) → W i x ≤ ENNReal.ofReal (A i p)) + (C : ℝ) (hbudget : ∀ P : Finset (ℤ × ℤ), ∑ i ∈ s, ∑ p ∈ P, A i p*B i p ≤ C) : + (∑ i ∈ s, ∫⁻ x, W i x*patch (r i) (F i) x) ≤ ENNReal.ofReal C := by + apply le_trans (sum_le_sum (fun i hi => weighted_patch_bound (r i) (F i) (hF i hi) + (W i) (hW i hi) (A i) (B i) (hA i hi) (hB i hi) (hcell i hi) (hWB i hi))) + exact sum_tsum_ofReal_le s _ (fun i hi p => mul_nonneg (hA i hi p) (hB i hi p)) C hbudget +end PhysicalCells + +namespace GeometricFilter +open Finset +lemma radius_convolution {r : ℕ → ℝ} (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (c J : ℕ → ℝ) (m : ℕ) : + (∑ k ∈ range m, c k/r k*(∑ l ∈ Ico k m, r l*J l)) = + ∑ l ∈ range m, filt c l*J l := by + simp only [mul_sum] + rw [← Nat.Ico_zero_eq_range,Finset.sum_Ico_Ico_comm] + simp only [Nat.Ico_zero_eq_range] + apply sum_congr rfl + intro l _ + rw [← sum_mul] + have he := radius_sum (r := r) (c := c) l (fun i _ => hr i) (fun i _ => (hstep i).symm) + rw [← he] + ring +end GeometricFilter + +namespace SignedRuns +open ActualLabels FiniteLabels Finset DiskMoments PhysicalCells SignedAssembly GeometricFilter + +lemma total_divergence_integrable (g : ℂ → ℝ) (h : ℂ → ℂ) (r : ℕ → ℝ) + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (old : Label) (m : ℕ) : + Integrable (fun x => leafSum (fun q => weight h r old x q*divergence (fun y => potential g r y q) x) m []) := by + apply leafSum_integrable + intro q + obtain ⟨K,hK⟩ := weight_lipschitz h r hr old q + apply weighted_divergence_integrable hK _ (potential_regular hg hc hr hstep q) + intro x + rw [Real.norm_eq_abs,abs_of_nonneg (weight_nonneg h r old x q)] + exact weight_le_one h r old x q + +lemma total_flux_integrable (g : ℂ → ℝ) (h : ℂ → ℂ) (r : ℕ → ℝ) + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (old : Label) (m : ℕ) : + Integrable (fun x => leafSum (fun q => inner ℝ (gradient (fun y => weight h r old y q) x) + (potential g r x q)) m []) := by + apply leafSum_integrable + intro q + obtain ⟨K,hK⟩ := weight_lipschitz h r hr old q + exact potential_flux_integrable hK (potential_regular hg hc hr hstep q) + +lemma band_gradient_integrable {g : ℂ → ℝ} {r : ℕ → ℝ} + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (m : ℕ) : Integrable (gradient (runEnvelope g r 0 m)) := by + have hab : r m ≤ 2*r 0 := by + have hh := radius_antitone r hr hstep (Nat.zero_le m) + linarith [hr 0] + obtain ⟨L,hL⟩ := run_envelope_lipschitz hg hc (hr m) hab + exact _root_.OAI.LipschitzWith.integrable_gradient hL (run_envelope_hasCompactSupport hg hc (hr m) hab) + +/-- Integration of the signed master, with its actual history law. The only +remaining inputs here are actual analytic majorants and their integrals; no +unsigned sum of run gradients is introduced. -/ +theorem integrated_signed_master {g : ℂ → ℝ} (h : ℂ → ℂ) {r : ℕ → ℝ} + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (H : ℕ → Label → ℂ → ℝ) (J : ℕ → ℂ → ℝ) + (hH : ∀ k n x, 0 ≤ H k n x) (hJ : ∀ k x, 0 ≤ J k x) + (old : Label) (m : ℕ) + (hinterior : ∀ᵐ x, ∀ k n t, PhysicalNeighborhoodRadius g (r k) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H k n x) + (hend : ∀ᵐ x, ∀ k t, PhysicalEndpointRadius g (r k) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J k x) + (hvalue : ∀ᵐ x, ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |signedAverage g x t-signedAverage g x t'| ≤ r k*J k x) + (hHi : ∀ k, k ≤ m → ∀ n, Integrable (H k n)) + (hJi : ∀ k, k ≤ m → Integrable (J k)) : + (∫ x, ‖gradient (runEnvelope g r 0 m) x‖) ≤ + 12*((∑ k ∈ range (m+1), ∫ x, expect (marginal h r k x) (fun n => H k n x))+ + 4*(∑ k ∈ range (m+1), ∫ x, pointCost h r x m k*J k x)) := by + have hdi (k : ℕ) (hk : k ≤ m) : + Integrable (fun x => expect (marginal h r k x) (fun n => H k n x)) := by + apply integrable_finsetSum + intro n _ + apply (hHi k hk n).bdd_mul (marginal_continuous h r hr k n).measurable.aestronglyMeasurable + exact ae_of_all _ (fun x => by + rw [Real.norm_eq_abs,abs_of_nonneg ((marginal h r k x).nonneg n)] + exact law_le_one _ _) + have hbi (k : ℕ) (hk : k ≤ m) : Integrable (fun x => pointCost h r x m k*J k x) := by + apply (hJi k hk).bdd_mul (pointCost_measurable h r hr m k).aestronglyMeasurable + exact ae_of_all _ (fun x => by + rw [Real.norm_eq_abs,abs_of_nonneg (pointCost_nonneg h r hr x m k)] + exact pointCost_le h r hr x m k) + let D := fun x => ∑ k ∈ range (m+1), expect (marginal h r k x) (fun n => H k n x) + let B := fun x => ∑ k ∈ range (m+1), pointCost h r x m k*J k x + have hDi : Integrable D := integrable_finsetSum _ (fun k hk => hdi k (by have := mem_range.mp hk; omega)) + have hBi : Integrable B := integrable_finsetSum _ (fun k hk => hbi k (by have := mem_range.mp hk; omega)) + let div := fun x => leafSum (fun q => weight h r old x q*divergence (fun y => potential g r y q) x) (m+1) [] + let flux := fun x => leafSum (fun q => inner ℝ (gradient (fun y => weight h r old y q) x) (potential g r x q)) (m+1) [] + have hdivi : Integrable div := total_divergence_integrable g h r hg hc hr hstep old (m+1) + have hfluxi : Integrable flux := total_flux_integrable g h r hg hc hr hstep old (m+1) + have hb (x : ℂ) : (∑ k ∈ range (m+1), boundaryCost h r x m k*J k x) ≤ B x := by + apply sum_le_sum + intro k _ + apply mul_le_mul_of_nonneg_right _ (hJ k x) + dsimp [pointCost] + linarith [filt_nonneg (fun i => derivativeCost_nonneg h r x i (hr i).le) k] + have hmaster : ∀ᵐ x, ‖gradient (runEnvelope g r 0 m) x‖ ≤ 12*(div x+D x+3*B x) := by + filter_upwards [runs_ae_diff hg hc hr hstep,hinterior,hend] with x hd hi he + have hh := pointwise_signed_master h hg hc hr hstep (fun k n => H k n x) (fun k => J k x) + (fun k n => hH k n x) (fun k => hJ k x) old m x hd hi he + change ‖gradient (runEnvelope g r 0 m) x‖ ≤ 12*(div x+D x+3*_) at hh + linarith [hb x] + have hf : ∀ᵐ x, -flux x ≤ B x := by + filter_upwards [observation_ae_diff h r hr,hvalue] with x hd hv + have ht := actual_signed_flux_bound g h r hg hr hstep old x hd (fun k => r k*J k x) hv (m+1) + rw [radius_convolution hr hstep] at ht + have hle : (∑ k ∈ range (m+1), filt (fun i => derivativeCost h r x i) k*J k x) ≤ B x := by + apply sum_le_sum + intro k _ + apply mul_le_mul_of_nonneg_right _ (hJ k x) + dsimp [pointCost] + linarith [boundaryCost_nonneg h r x m k] + exact (neg_le_abs (flux x)).trans (ht.trans hle) + have hi := integral_mono_ae (band_gradient_integrable hg hc hr hstep m).norm + ((hdivi.add hDi).add (hBi.const_mul 3) |>.const_mul 12) hmaster + simp only [Pi.add_apply] at hi + rw [integral_const_mul,integral_add (f := fun x => div x+D x) (g := fun x => 3*B x) (hdivi.add hDi) (hBi.const_mul 3),integral_add hdivi hDi, + integral_const_mul] at hi + have hip : (∫ x, div x) = -∫ x, flux x := history_weighted_ibp g h r hg hc hr hstep old (m+1) + have hfi := integral_mono_ae hfluxi.neg hBi hf + simp only [Pi.neg_apply,integral_neg] at hfi + have hDint : (∫ x, D x) = ∑ k ∈ range (m+1), ∫ x, expect (marginal h r k x) (fun n => H k n x) := + integral_finsetSum _ (fun k hk => hdi k (by have := mem_range.mp hk; omega)) + have hBint : (∫ x, B x) = ∑ k ∈ range (m+1), ∫ x, pointCost h r x m k*J k x := + integral_finsetSum _ (fun k hk => hbi k (by have := mem_range.mp hk; omega)) + rw [hip] at hi + rw [← hDint,← hBint] + linarith +end SignedRuns + +namespace CommonPrices +open DyadicHats ConeCoordinates Finset DiskMoments PhysicalCells SignedRuns FiniteLabels ActualLabels + +/-- Combine the two actual signed directional prices; the labels are unchanged. -/ +theorem physical_unfavorable_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → ∀ (k : ℕ) (p : ℤ × ℤ) (n : Label), + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ y in cell (point (scale r k) p) (scale r k), F y) ≤ ENNReal.ofReal + (C*(badPrice (gradient g) r k (cellRoots N p) n+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ y ∈ cell (point (scale r k) p) (scale r k), ∀ t, + PhysicalNeighborhoodRadius g (scale r k) y t → + ENNReal.ofReal (unfavorable n (gradient (fun z => signedAverage g z t) y)) ≤ F y := by + obtain ⟨C,hC,hp⟩ := physical_directional_price + refine ⟨2*C,by positivity,?_⟩ + intro N r R hr hR hN g hg hh hs hd k p n + obtain ⟨F,hFm,hFi,hFb⟩ := hp hr hR hN hg hh hs hd k p n.property (Or.inl rfl : (1:ℝ)=1 ∨ (1:ℝ)=-1) + obtain ⟨G,hGm,hGi,hGb⟩ := hp hr hR hN hg hh hs hd k p n.property (Or.inr rfl : (-1:ℝ)=1 ∨ (-1:ℝ)=-1) + have hn : 0 ≤ C*(badPrice (gradient g) r k (cellRoots N p) n+cellPrice N r (gradient g) k (cellRoots N p)) := + mul_nonneg hC.le (add_nonneg (badPrice_nonneg _ _ _ _ _) (cellPrice_nonneg hr hR hN hh hs k _)) + refine ⟨fun y => F y+G y,hFm.add hGm,?_,?_⟩ + · rw [lintegral_add_left hFm] + calc + _ ≤ ENNReal.ofReal (C*(_+_))+ENNReal.ofReal (C*(_+_)) := add_le_add hFi hGi + _ = _ := by rw [← ENNReal.ofReal_add hn hn]; congr 1; ring + · intro y hy t ht + rw [unfavorable,ENNReal.ofReal_add (le_max_left _ _) (le_max_left _ _)] + exact add_le_add (hFb y hy t ht) (hGb y hy t ht) + +/-- A single actual endpoint price pays both the gradient and the normalized +oscillation. It is introduced before any spatial supremum is taken. -/ +theorem physical_joint_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → ∀ (k : ℕ) (p : ℤ × ℤ) (n : Label), + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ y in cell (point (scale r k) p) (scale r k), F y) ≤ ENNReal.ofReal + (C*(rootMass (gradient g) r k (cellRoots N p)+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + (∀ y ∈ cell (point (scale r k) p) (scale r k), ∀ t, + PhysicalEndpointRadius g (scale r k) y t → + ENNReal.ofReal ‖gradient (fun z => signedAverage g z t) y‖ ≤ F y) ∧ + (∀ y ∈ cell (point (scale r k) p) (scale r k), ∀ t t', + 0 < t → t ≤ 4*scale r k → 0 < t' → t' ≤ 4*scale r k → + ENNReal.ofReal (|signedAverage g y t-signedAverage g y t'|/scale r k) ≤ F y) := by + obtain ⟨Cs,hCs,hp⟩ := physical_size_price + obtain ⟨Cv,hCv,hq⟩ := physical_value_price + refine ⟨Cs+Cv,add_pos hCs hCv,?_⟩ + intro N r R hr hR hN g hg hh hs hd k p n + obtain ⟨F,hFm,hFi,hFb⟩ := hp hr hR hN hg hh hs hd k p n.property + obtain ⟨G,hGm,hGi,hGb⟩ := hq hr hR hN hg hh hs hd k p n.property + have hrk := scale_pos hr k + let B := rootMass (gradient g) r k (cellRoots N p)+cellPrice N r (gradient g) k (cellRoots N p) + have hB : 0 ≤ B := add_nonneg (rootMass_nonneg _ _ _ _) (cellPrice_nonneg hr hR hN hh hs k _) + have hG : (∫⁻ y in cell (point (scale r k) p) (scale r k), ENNReal.ofReal (scale r k)⁻¹*G y) ≤ ENNReal.ofReal (Cv*B) := by + rw [lintegral_const_mul _ hGm] + calc + _ ≤ ENNReal.ofReal (scale r k)⁻¹*ENNReal.ofReal (Cv*scale r k*B) := mul_le_mul' le_rfl hGi + _ = _ := by rw [← ENNReal.ofReal_mul (inv_nonneg.mpr hrk.le)]; congr 1; field_simp + refine ⟨fun y => F y+ENNReal.ofReal (scale r k)⁻¹*G y, + hFm.add (measurable_const.mul hGm),?_,?_,?_⟩ + · rw [lintegral_add_left hFm] + calc + _ ≤ ENNReal.ofReal (Cs*B)+ENNReal.ofReal (Cv*B) := add_le_add hFi hG + _ = _ := by rw [← ENNReal.ofReal_add (mul_nonneg hCs.le hB) (mul_nonneg hCv.le hB),← add_mul] + · intro y hy t ht + exact (hFb y hy t ht).trans le_self_add + · intro y hy t t' ht hb ht' hb' + have hgg := mul_le_mul' (le_refl (ENNReal.ofReal (scale r k)⁻¹)) (hGb y hy t t' ht hb ht' hb') + rw [← ENNReal.ofReal_mul (inv_nonneg.mpr hrk.le),inv_mul_eq_div] at hgg + exact hgg.trans le_add_self +end CommonPrices + +namespace PhysicalCells +open Finset + +lemma real_weighted_patches {ι : Type*} (s : Finset ι) + (r : ι → ℝ) (F : ι → (ℤ × ℤ) → ℂ → ℝ≥0∞) + (hFi : ∀ i ∈ s, Integrable (fun x => (patch (r i) (F i) x).toReal)) + (W : ι → ℂ → ℝ) (hW : ∀ i ∈ s, Measurable (W i)) + (hW0 : ∀ i ∈ s, ∀ x, 0 ≤ W i x) (M : ℝ) + (hWM : ∀ i ∈ s, ∀ x, W i x ≤ M) {C : ℝ} (hC : 0 ≤ C) + (hf : (∑ i ∈ s, ∫⁻ x, ENNReal.ofReal (W i x)*patch (r i) (F i) x) ≤ ENNReal.ofReal C) : + (∑ i ∈ s, ∫ x, W i x*(patch (r i) (F i) x).toReal) ≤ C := by + have hi (i : ι) (hi : i ∈ s) : Integrable (fun x => W i x*(patch (r i) (F i) x).toReal) := by + apply (hFi i hi).bdd_mul (hW i hi).aestronglyMeasurable + exact ae_of_all _ (fun x => by rw [Real.norm_eq_abs,abs_of_nonneg (hW0 i hi x)]; exact hWM i hi x) + apply (ENNReal.ofReal_le_ofReal_iff hC).mp + rw [ENNReal.ofReal_sum_of_nonneg (fun i hi => integral_nonneg (fun x => mul_nonneg (hW0 i hi x) ENNReal.toReal_nonneg))] + apply le_trans _ hf + apply sum_le_sum + intro i his + rw [ofReal_integral_eq_lintegral_ofReal (hi i his) (ae_of_all _ (fun x => mul_nonneg (hW0 i his x) ENNReal.toReal_nonneg))] + apply lintegral_mono + intro x + change ENNReal.ofReal (W i x * (patch (r i) (F i) x).toReal) ≤ ENNReal.ofReal (W i x) * patch (r i) (F i) x + rw [ENNReal.ofReal_mul (hW0 i his x)] + exact mul_le_mul' le_rfl ENNReal.ofReal_toReal_le +end PhysicalCells + +namespace CommonPrices +open DyadicHats ConeCoordinates Finset DiskMoments PhysicalCells SignedRuns FiniteLabels ActualLabels + +lemma bad_total_level_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (j : ℕ) (P : Finset (ℤ × ℤ)) (n : Label) : + (∑ p ∈ P, (badPrice h base j (cellRoots N p) n+cellPrice N base h j (cellRoots N p))) ≤ + (1681+priceConstant)*(∫ y, ‖h y‖) := by + apply le_trans _ (total_level_budget hb hR hN hh hsupp j P) + apply sum_le_sum + intro p hp + exact add_le_add (badPrice_le_rootMass h base j (cellRoots N p) n) le_rfl + +/-- Actual full-lattice unfavorable prices, with the genuine marginal law. -/ +theorem patched_unfavorable : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) (hN : R/base+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → + ∃ H : ℕ → Label → ℂ → ℝ, + (∀ j n x, 0 ≤ H j n x) ∧ (∀ j n, Integrable (H j n)) ∧ + (∀ᵐ x, ∀ j n t, PhysicalNeighborhoodRadius g (scale base j) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H j n x) ∧ + (∀ m n, (∑ j ∈ range (m+1), ∫ x, marginal (gradient g) (geometricRadii base m) (m-j) x n*H j n x) ≤ + C*(∫ y, ‖gradient g y‖)) := by + obtain ⟨c,hc,hp⟩ := physical_unfavorable_price + refine ⟨c*directPriceConstant,mul_pos hc directPriceConstant_pos,?_⟩ + intro N base R hb hR hN g hg hh hs hd + choose F hFm hFi hFb using fun j n p => hp hb hR hN hg hh hs hd j p n + let B := fun j p n => badPrice (gradient g) base j (cellRoots N p) n+cellPrice N base (gradient g) j (cellRoots N p) + have hB (j p n) : 0 ≤ B j p n := add_nonneg (badPrice_nonneg _ _ _ _ _) (cellPrice_nonneg hb hR hN hh hs j _) + have hpi (j n) : (∫⁻ x, patch (scale base j) (F j n) x) ≤ + ENNReal.ofReal (c*((1681+priceConstant)*(∫ y, ‖gradient g y‖))) := by + apply lintegral_patch_budget _ _ (hFm j n) (fun p => c*B j p n) (fun p => mul_nonneg hc.le (hB j p n)) _ (hFi j n) + intro P + rw [← mul_sum] + exact mul_le_mul_of_nonneg_left (bad_total_level_budget hb hR hN hh hs j P n) hc.le + let H := fun j n x => (patch (scale base j) (F j n) x).toReal + have hHi (j n) : Integrable (H j n) := patch_integrable _ _ (hFm j n) (hpi j n) + refine ⟨H,fun _ _ _ => ENNReal.toReal_nonneg,hHi,?_,?_⟩ + · have hfin : ∀ᵐ x, ∀ j n, patch (scale base j) (F j n) x ≠ ⊤ := + (ae_all_iff).mpr (fun j => (ae_all_iff).mpr (fun n => patch_finite _ _ (hFm j n) (hpi j n))) + filter_upwards [hfin] with x hx + intro j n t ht + exact real_le_patch (F j n) (gridIndex (scale base j) x) (mem_index_cell (scale_pos hb j) x) (hx j n) + (hFb j n _ x (mem_index_cell (scale_pos hb j) x) t ht) + · intro m n + let W := fun j x => marginal (gradient g) (geometricRadii base m) (m-j) x n + let A := fun j p => localSup (W j) (scale base j) p + have hA (j) (hj : j ∈ range (m+1)) (p) : 0 ≤ A j p := by + have hjm : j ≤ m := by have := mem_range.mp hj; omega + dsimp [A,W] + rw [← geometricRadii_reverse base hjm] + exact marginal_localSup_nonneg _ _ _ (geometricRadii_pos hb m (m-j)) p n + have hwm (j) : Measurable (W j) := (marginal_continuous _ _ (geometricRadii_pos hb m) (m-j) n).measurable + have hWB (j) (hj : j ∈ range (m+1)) (p x) (hx : x ∈ cell (point (scale base j) p) (scale base j)) : + ENNReal.ofReal (W j x) ≤ ENNReal.ofReal (A j p) := by + apply ENNReal.ofReal_le_ofReal + apply le_localSup p (fun y _ => law_le_one _ _) + change DyadicHats.boxNorm (x-point (scale base j) p) ≤ 25*scale base j + have ht := mem_cell_box (scale_pos hb j) hx + linarith [scale_pos hb j] + have hwt := integrated_weighted_patches (range (m+1)) (scale base) (fun j => F j n) + (fun j _ => hFm j n) (fun j x => ENNReal.ofReal (W j x)) (fun j _ => (hwm j).ennreal_ofReal) + A (fun j p => c*B j p n) hA (fun j _ p => mul_nonneg hc.le (hB j p n)) + (fun j _ => hFi j n) hWB (c*directPriceConstant*(∫ y, ‖gradient g y‖)) (by + intro P + have hbgt := mul_le_mul_of_nonneg_left (marginal_total_budget hb hR hN hh hs m (fun _ => P) n) hc.le + simpa only [A,W,B,mul_sum,mul_assoc,mul_left_comm] using hbgt) + exact real_weighted_patches (range (m+1)) (scale base) (fun j => F j n) (fun j _ => hHi j n) + W (fun j _ => hwm j) (fun j _ x => (marginal _ _ _ x).nonneg n) 1 (fun j _ x => law_le_one _ _) + (mul_nonneg (mul_nonneg hc.le directPriceConstant_pos.le) (integral_nonneg (fun y => norm_nonneg _))) hwt +end CommonPrices + +namespace CommonPrices +open DyadicHats ConeCoordinates Finset DiskMoments PhysicalCells SignedRuns FiniteLabels ActualLabels + +/-- Actual endpoint/value weights charged simultaneously at every level. -/ +theorem patched_joint : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) (hN : R/base+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → + ∃ J : ℕ → ℂ → ℝ, + (∀ j x, 0 ≤ J j x) ∧ (∀ j, Integrable (J j)) ∧ + (∀ᵐ x, ∀ j t, PhysicalEndpointRadius g (scale base j) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J j x) ∧ + (∀ᵐ x, ∀ j t t', 0 < t → t ≤ 4*scale base j → 0 < t' → t' ≤ 4*scale base j → + |signedAverage g x t-signedAverage g x t'| ≤ scale base j*J j x) ∧ + (∀ m, (∑ j ∈ range (m+1), ∫ x, pointCost (gradient g) (geometricRadii base m) x m (m-j)*J j x) ≤ + C*(∫ y, ‖gradient g y‖)) := by + obtain ⟨c,hc,hp⟩ := physical_joint_price + refine ⟨c*spatialPriceConstant,mul_pos hc spatialPriceConstant_pos,?_⟩ + intro N base R hb hR hN g hg hh hs hd + let n : Label := target (gradient g) base (0,0) + choose F hFm hFi hFb hFv using fun j p => hp hb hR hN hg hh hs hd j p n + let B := fun j p => rootMass (gradient g) base j (cellRoots N p)+cellPrice N base (gradient g) j (cellRoots N p) + have hB (j p) : 0 ≤ B j p := add_nonneg (rootMass_nonneg _ _ _ _) (cellPrice_nonneg hb hR hN hh hs j _) + have hpi (j) : (∫⁻ x, patch (scale base j) (F j) x) ≤ + ENNReal.ofReal (c*((1681+priceConstant)*(∫ y, ‖gradient g y‖))) := by + apply lintegral_patch_budget _ _ (hFm j) (fun p => c*B j p) (fun p => mul_nonneg hc.le (hB j p)) _ (hFi j) + intro P + rw [← mul_sum] + exact mul_le_mul_of_nonneg_left (total_level_budget hb hR hN hh hs j P) hc.le + let J := fun j x => (patch (scale base j) (F j) x).toReal + have hJi (j) : Integrable (J j) := patch_integrable _ _ (hFm j) (hpi j) + have hfin : ∀ᵐ x, ∀ j, patch (scale base j) (F j) x ≠ ⊤ := + (ae_all_iff).mpr (fun j => patch_finite _ _ (hFm j) (hpi j)) + refine ⟨J,fun _ _ => ENNReal.toReal_nonneg,hJi,?_,?_,?_⟩ + · filter_upwards [hfin] with x hx + intro j t ht + exact real_le_patch (F j) (gridIndex (scale base j) x) (mem_index_cell (scale_pos hb j) x) (hx j) + (hFb j _ x (mem_index_cell (scale_pos hb j) x) t ht) + · filter_upwards [hfin] with x hx + intro j t t' ht hb' ht' hb'' + have ht := real_le_patch (F j) (gridIndex (scale base j) x) (mem_index_cell (scale_pos hb j) x) (hx j) + (hFv j _ x (mem_index_cell (scale_pos hb j) x) t t' ht hb' ht' hb'') + exact (div_le_iff₀ (scale_pos hb j)).mp ht |>.trans_eq (mul_comm _ _) + · intro m + let W := fun j x => pointCost (gradient g) (geometricRadii base m) x m (m-j) + let A := fun j p => cellSup (W j) (scale base j) p + have hwm (j) : Measurable (W j) := pointCost_measurable _ _ (geometricRadii_pos hb m) m (m-j) + have hw0 (j x) : 0 ≤ W j x := pointCost_nonneg _ _ (geometricRadii_pos hb m) x m (m-j) + have hwM (j x) : W j x ≤ costLimit := pointCost_le _ _ (geometricRadii_pos hb m) x m (m-j) + have hA (j p) : 0 ≤ A j p := cellSup_nonneg p (hw0 j) (fun x _ => hwM j x) + have hWB (j p x) (hx : x ∈ cell (point (scale base j) p) (scale base j)) : + ENNReal.ofReal (W j x) ≤ ENNReal.ofReal (A j p) := + ENNReal.ofReal_le_ofReal (le_cellSup p (fun y _ => hwM j y) hx) + have hwt := integrated_weighted_patches (range (m+1)) (scale base) F + (fun j _ => hFm j) (fun j x => ENNReal.ofReal (W j x)) (fun j _ => (hwm j).ennreal_ofReal) + A (fun j p => c*B j p) (fun j _ => hA j) (fun j _ p => mul_nonneg hc.le (hB j p)) + (fun j _ => hFi j) (fun j _ => hWB j) (c*spatialPriceConstant*(∫ y, ‖gradient g y‖)) (by + intro P + have hbgt := mul_le_mul_of_nonneg_left (pointCost_total_budget hb hR hN hh hs m (fun _ => P)) hc.le + simpa only [A,W,B,mul_sum,mul_assoc,mul_left_comm] using hbgt) + exact real_weighted_patches (range (m+1)) (scale base) F (fun j _ => hJi j) + W (fun j _ => hwm j) (fun j _ => hw0 j) costLimit (fun j _ => hwM j) + (mul_nonneg (mul_nonneg hc.le spatialPriceConstant_pos.le) (integral_nonneg (fun y => norm_nonneg _))) hwt +end CommonPrices + +namespace SignedRuns +open ActualLabels FiniteLabels Finset DiskMoments PhysicalCells SignedAssembly GeometricFilter CommonPrices DyadicHats + +/-- Reverse the spatial scale index and fill unused indices with genuine global +Lipschitz bounds. Only the physical prices at indices at most m are integrated. -/ +lemma master_from_patches {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) + {base : ℝ} (hb : 0 < base) (m : ℕ) + (H : ℕ → Label → ℂ → ℝ) (J : ℕ → ℂ → ℝ) + (hH : ∀ j n x, 0 ≤ H j n x) (hJ : ∀ j x, 0 ≤ J j x) + (hHi : ∀ j n, Integrable (H j n)) (hJi : ∀ j, Integrable (J j)) + (hinterior : ∀ᵐ x, ∀ j n t, PhysicalNeighborhoodRadius g (scale base j) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H j n x) + (hend : ∀ᵐ x, ∀ j t, PhysicalEndpointRadius g (scale base j) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J j x) + (hvalue : ∀ᵐ x, ∀ j t t', 0 < t → t ≤ 4*scale base j → 0 < t' → t' ≤ 4*scale base j → + |signedAverage g x t-signedAverage g x t'| ≤ scale base j*J j x) : + (∫ x, ‖gradient (runEnvelope g (geometricRadii base m) 0 m) x‖) ≤ + 12*((∑ j ∈ range (m+1), ∫ x, expect (marginal (gradient g) (geometricRadii base m) (m-j) x) (fun n => H j n x))+ + 4*(∑ j ∈ range (m+1), ∫ x, pointCost (gradient g) (geometricRadii base m) x m (m-j)*J j x)) := by + classical + let r := geometricRadii base m + have hr := geometricRadii_pos hb m + obtain ⟨L,hL⟩ := hg.lipschitzWith_of_hasCompactSupport hc one_ne_zero + obtain ⟨M,hM⟩ := hc.exists_bound_of_continuous hg.continuous + have hM0 : 0 ≤ M := (norm_nonneg (g 0)).trans (hM 0) + have hMa (y) : |g y| ≤ M := by simpa only [Real.norm_eq_abs] using hM y + let H' := fun k n x => if k ≤ m then H (m-k) n x else 2*(L:ℝ) + let J' := fun k x => if k ≤ m then J (m-k) x else (L:ℝ)+2*M/r k + have hH' (k n x) : 0 ≤ H' k n x := by dsimp [H']; split_ifs; exact hH _ _ _; positivity + have hJ' (k x) : 0 ≤ J' k x := by + dsimp [J']; split_ifs + · exact hJ _ _ + · exact add_nonneg L.coe_nonneg (div_nonneg (mul_nonneg (by norm_num) hM0) (hr k).le) + have hHi' (k) (hk : k ≤ m) (n) : Integrable (H' k n) := by simpa only [H',ite_eq_left hk] using hHi (m-k) n + have hJi' (k) (hk : k ≤ m) : Integrable (J' k) := by simpa only [J',ite_eq_left hk] using hJi (m-k) + have hint' : ∀ᵐ x, ∀ k n t, PhysicalNeighborhoodRadius g (r k) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H' k n x := by + filter_upwards [hinterior] with x hx + intro k n t ht + dsimp [H'] + split_ifs with hk + · apply hx + simpa only [r,geometricRadii_eq base hk] using ht + · exact (unfavorable_le_norm n _).trans (mul_le_mul_of_nonneg_left + (gradient_norm_le (signedAverage_lipschitz hL ((hr k).trans_le ht.1.1)) x) (by norm_num)) + have hend' : ∀ᵐ x, ∀ k t, PhysicalEndpointRadius g (r k) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J' k x := by + filter_upwards [hend] with x hx + intro k t ht + dsimp [J'] + split_ifs with hk + · apply hx + simpa only [r,geometricRadii_eq base hk] using ht + · have he := gradient_norm_le (signedAverage_lipschitz hL ((hr k).trans_le ht.1.1)) x + have hpos : 0 ≤ 2*M/r k := div_nonneg (mul_nonneg (by norm_num) hM0) (hr k).le + linarith + have hval' : ∀ᵐ x, ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |signedAverage g x t-signedAverage g x t'| ≤ r k*J' k x := by + filter_upwards [hvalue] with x hx + intro k t t' ht hbt ht' hbt' + dsimp [J'] + split_ifs with hk + · simpa only [r,geometricRadii_eq base hk] using hx (m-k) t t' ht + (by simpa only [r,geometricRadii_eq base hk] using hbt) ht' + (by simpa only [r,geometricRadii_eq base hk] using hbt') + · have he := abs_sub (signedAverage g x t) (signedAverage g x t') + have he1 := signedAverage_abs_le hMa x ht + have he2 := signedAverage_abs_le hMa x ht' + rw [mul_add,mul_div_cancel₀ _ (hr k).ne'] + have hp : 0 ≤ r k*(L:ℝ) := mul_nonneg (hr k).le L.coe_nonneg + linarith + have hi := integrated_signed_master (gradient g) hg hc hr (geometricRadii_step base m) + H' J' hH' hJ' (target (gradient g) base (0,0)) m hint' hend' hval' hHi' hJi' + have hd : (∑ k ∈ range (m+1), ∫ x, expect (marginal (gradient g) r k x) (fun n => H' k n x)) = + ∑ j ∈ range (m+1), ∫ x, expect (marginal (gradient g) r (m-j) x) (fun n => H j n x) := by + rw [← sum_range_reflect (fun k => ∫ x, expect (marginal (gradient g) r k x) (fun n => H' k n x)) (m+1)] + apply sum_congr rfl + intro j hj + have hjm : j ≤ m := by have := mem_range.mp hj; omega + simp only [Nat.add_sub_cancel,H',ite_eq_left (Nat.sub_le m j),Nat.sub_sub_self hjm] + have he : (∑ k ∈ range (m+1), ∫ x, pointCost (gradient g) r x m k*J' k x) = + ∑ j ∈ range (m+1), ∫ x, pointCost (gradient g) r x m (m-j)*J j x := by + rw [← sum_range_reflect (fun k => ∫ x, pointCost (gradient g) r x m k*J' k x) (m+1)] + apply sum_congr rfl + intro j hj + have hjm : j ≤ m := by have := mem_range.mp hj; omega + simp only [Nat.add_sub_cancel,J',ite_eq_left (Nat.sub_le m j),Nat.sub_sub_self hjm] + rw [hd,he] at hi + exact hi + +/-- The genuine smooth signed dyadic finite-band estimate. No probability, +common-price, local analytic estimate, or total variation bound is assumed. -/ +theorem smooth_compact_dyadic_band : ∃ C : ℝ, 0 < C ∧ + ∀ {g : ℂ → ℝ}, ContDiff ℝ 1 g → HasCompactSupport g → + ∀ {base : ℝ}, 0 < base → ∀ m : ℕ, + (∫ x, ‖gradient (runEnvelope g (geometricRadii base m) 0 m) x‖) ≤ C*(∫ x, ‖gradient g x‖) := by + obtain ⟨Cd,hCd,hpd⟩ := patched_unfavorable + obtain ⟨Cj,hCj,hpj⟩ := patched_joint + refine ⟨12*((Fintype.card Label:ℝ)*Cd+4*Cj),by positivity,?_⟩ + intro g hg hc base hb m + have hh : Integrable (gradient g) := (continuous_gradient hg).integrable_of_hasCompactSupport (gradient_hasCompactSupport hc) + obtain ⟨R0,hR0⟩ := (gradient_hasCompactSupport hc).isBounded.subset_closedBall (0:ℂ) + let R := max 0 R0 + have hR : 0 ≤ R := le_max_left _ _ + have hs : ∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R := by + intro y hy + have he : ‖y‖ ≤ R0 := by simpa only [Metric.mem_closedBall,dist_zero_right] using hR0 (subset_tsupport (gradient g) hy) + exact he.trans (le_max_right _ _) + obtain ⟨N,hN⟩ := exists_nat_ge (R/base+1) + obtain ⟨L,hL⟩ := hg.lipschitzWith_of_hasCompactSupport hc one_ne_zero + have hd : ∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D := ⟨L,fun _ => norm_fderiv_le_of_lipschitz ℝ hL⟩ + obtain ⟨H,hH,hHi,hHd,hHb⟩ := hpd hb hR hN hg hh hs hd + obtain ⟨J,hJ,hJi,hJe,hJv,hJb⟩ := hpj hb hR hN hg hh hs hd + have hi := master_from_patches hg hc hb m H J hH hJ hHi hJi hHd hJe hJv + have hdi (j : ℕ) (n : Label) : Integrable (fun x => marginal (gradient g) (geometricRadii base m) (m-j) x n*H j n x) := by + apply (hHi j n).bdd_mul (marginal_continuous _ _ (geometricRadii_pos hb m) (m-j) n).measurable.aestronglyMeasurable + exact ae_of_all _ (fun x => by rw [Real.norm_eq_abs,abs_of_nonneg ((marginal _ _ _ x).nonneg n)]; exact law_le_one _ _) + have hD : (∑ j ∈ range (m+1), ∫ x, expect (marginal (gradient g) (geometricRadii base m) (m-j) x) (fun n => H j n x)) ≤ + (Fintype.card Label:ℝ)*Cd*(∫ y, ‖gradient g y‖) := by + simp only [FiniteLabels.expect] + simp_rw [integral_finsetSum univ (fun n _ => hdi _ n)] + rw [Finset.sum_comm] + have he := sum_le_sum (s := univ) (fun n _ => hHb m n) + simpa only [sum_const,card_univ,nsmul_eq_mul,mul_assoc] using he + have hB := hJb m + nlinarith only [hi,hD,hB] +end SignedRuns + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Basic.lean b/lean/OAI/Analysis/DiskMaximal/Basic.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c61ee0a7f9aa65bc7fc1ecf38058245c9dcaf27 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Basic.lean @@ -0,0 +1,244 @@ +import OAI.Analysis.DiskMaximal.Model + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff + +noncomputable section + +namespace CenteredDiskEndpoint + +/-- The normalization is precisely planar Lebesgue disk area. -/ +theorem volume_disk (x : Plane) {r : ℝ} (hr : 0 ≤ r) : + volume (Metric.ball x r) = ENNReal.ofReal (Real.pi * r ^ 2) := by + rw [EuclideanSpace.volume_ball_fin_two, ENNReal.ofReal_mul Real.pi_nonneg, + ENNReal.ofReal_pow hr] + exact mul_comm _ _ + +/-- For every admissible input and positive radius the extended average agrees +with the real absolute-value average, rather than a signed average. -/ +theorem absoluteDiskAverage_eq_ofReal {f : Plane → ℝ} {x : Plane} {r : ℝ} + (hf : IntegrableOn f (Metric.ball x r)) (hr : 0 < r) : + absoluteDiskAverage f x r = ENNReal.ofReal (diskAverage (fun y => |f y|) x r) := by + have hden : 0 < Real.pi * r ^ 2 := mul_pos Real.pi_pos (sq_pos_of_pos hr) + rw [absoluteDiskAverage, diskAverage, ENNReal.ofReal_div_of_pos hden, + ofReal_integral_eq_lintegral_ofReal hf.abs (Filter.Eventually.of_forall (fun y => abs_nonneg (f y)))] + +theorem absoluteDiskAverage_ne_top {f : Plane → ℝ} {x : Plane} {r : ℝ} + (hf : IntegrableOn f (Metric.ball x r)) (hr : 0 < r) : + absoluteDiskAverage f x r ≠ ⊤ := by + rw [absoluteDiskAverage_eq_ofReal hf hr] + exact ENNReal.ofReal_ne_top + +theorem absoluteDiskAverage_le_maximal (f : Plane → ℝ) (x : Plane) {r : ℝ} + (hr : 0 < r) : absoluteDiskAverage f x r ≤ maximal f x := by + exact le_iSup_of_le r (le_iSup_of_le hr le_rfl) + +theorem maximal_abs (f : Plane → ℝ) : maximal (fun y => |f y|) = maximal f := by + funext x + simp only [maximal, absoluteDiskAverage, abs_abs] + +theorem inW11_of_gradient {f : Plane → ℝ} {g : Plane → Plane} + (hf : Integrable f) (hg : Integrable g) (hw : HasWeakGradient f g) : InW11 f := + ⟨hf, g, hg, hw⟩ + +theorem inW11Loc_of_gradient {f : Plane → ℝ} {g : Plane → Plane} + (hf : LocallyIntegrable f) (hg : Integrable g) (hw : HasWeakGradient f g) : InW11Loc f := + ⟨hf, g, hg.locallyIntegrable, hw⟩ + +theorem integral_smul_sub_const {α E : Type*} [MeasurableSpace α] + [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + {μ : Measure α} {b : α → E} {K : α → ℝ} + (hb : Integrable b μ) (hK : Integrable (fun y => K y • b y) μ) + (hzero : ∫ y, b y ∂μ = 0) (c : ℝ) : + (∫ y, (K y - c) • b y ∂μ) = ∫ y, K y • b y ∂μ := by + simp_rw [sub_smul] + have hc : Integrable (fun y => c • b y) μ := hb.smul c + rw [integral_sub hK hc, integral_smul, hzero, smul_zero, sub_zero] + +/-- The small-support zero-mass discount for actual integrable vector densities. +The kernel need only be Lipschitz; no smoothness or unproved moment estimate is +assumed. -/ +theorem localized_cancellation {b : Plane → Plane} {K : Plane → ℝ} + (hb : Integrable b) (hzero : ∫ y, b y = 0) + {L : ℝ≥0} (hK : LipschitzWith L K) (z : Plane) {s : ℝ} + (hsupp : ∀ᵐ y, b y ≠ 0 → ‖y - z‖ ≤ s) : + ‖∫ y, K y • b y‖ ≤ (L : ℝ) * s * ∫ y, ‖b y‖ := by + have hbound : ∀ᵐ y, ‖(K y - K z) • b y‖ ≤ ((L : ℝ) * s) * ‖b y‖ := by + filter_upwards [hsupp] with y hy + by_cases hby : b y = 0 + · simp [hby] + · rw [norm_smul] + exact mul_le_mul_of_nonneg_right + ((hK.norm_sub_le y z).trans (mul_le_mul_of_nonneg_left (hy hby) L.coe_nonneg)) + (norm_nonneg _) + have hdiff : Integrable (fun y => (K y - K z) • b y) := + (hb.norm.smul ((L : ℝ) * s)).mono' + ((hK.continuous.sub continuous_const).aestronglyMeasurable.smul hb.aestronglyMeasurable) + hbound + have hprod : Integrable (fun y => K y • b y) := by + have h := hdiff.add (hb.smul (K z)) + change Integrable (fun y => (K y - K z) • b y + K z • b y) at h + simpa only [← add_smul, sub_add_cancel] using h + rw [← integral_smul_sub_const hb hprod hzero (K z)] + calc + ‖∫ y, (K y - K z) • b y‖ ≤ ∫ y, ((L : ℝ) * s) * ‖b y‖ := + norm_integral_le_of_norm_le (hb.norm.smul ((L : ℝ) * s)) hbound + _ = (L : ℝ) * s * ∫ y, ‖b y‖ := integral_const_mul _ _ + +end CenteredDiskEndpoint + +namespace CenteredDiskEndpoint +open InnerProductSpace +open scoped RealInnerProductSpace + +/-- A change of representatives on null sets does not change weak derivatives. -/ +theorem HasWeakGradient.congr_ae {f f' : Plane → ℝ} {g g' : Plane → Plane} + (h : HasWeakGradient f g) (hf : f =ᵐ[volume] f') (hg : g =ᵐ[volume] g') : + HasWeakGradient f' g' := by + intro φ hφ hφc i + calc + (∫ x, f' x * testPartial φ i x) = ∫ x, f x * testPartial φ i x := by + apply integral_congr_ae + filter_upwards [hf] with x hx + rw [hx] + _ = -∫ x, g x i * φ x := h φ hφ hφc i + _ = -∫ x, g' x i * φ x := by + congr 1 + apply integral_congr_ae + filter_upwards [hg] with x hx + rw [hx] + +theorem HasWeakGradient.ae_unique {f : Plane → ℝ} {g g' : Plane → Plane} + (h : HasWeakGradient f g) (h' : HasWeakGradient f g') + (hg : LocallyIntegrable g) (hg' : LocallyIntegrable g') : g =ᵐ[volume] g' := by + have hcoord (i : Fin 2) : ∀ᵐ x, g x i = g' x i := by + have hgi : LocallyIntegrable (fun x => g x i) := fun x => + (EuclideanSpace.proj (𝕜 := ℝ) i).integrableAtFilter_comp (hg x) + have hgi' : LocallyIntegrable (fun x => g' x i) := fun x => + (EuclideanSpace.proj (𝕜 := ℝ) i).integrableAtFilter_comp (hg' x) + apply ae_eq_of_integral_contDiff_smul_eq hgi hgi' + intro φ hφ hφc + have heq := (h φ hφ hφc i).symm.trans (h' φ hφ hφc i) + simpa only [neg_inj, smul_eq_mul, mul_comm] using heq + filter_upwards [ae_all_iff.mpr hcoord] with x hx + ext i + exact hx i + +/-- Coordinate convention agreement with Mathlib's classical Euclidean gradient. -/ +theorem classicalGradient_apply (f : Plane → ℝ) (x : Plane) (i : Fin 2) : + gradient f x i = testPartial f i x := by + simpa only [EuclideanSpace.inner_single_right, RCLike.conj_to_real, one_mul, testPartial] using + (inner_gradient_left (f := f) (x := x) (y := EuclideanSpace.single i 1)) + +/-- No integrability hypothesis is smuggled into the definition of the weak +identity: every C¹ function satisfies it when tested against compact support. -/ +theorem contDiff_hasWeakGradient {f : Plane → ℝ} (hf : ContDiff ℝ 1 f) : + HasWeakGradient f (gradient f) := by + intro φ hφ hφc i + have hfd : Continuous (fun x => fderiv ℝ f x (EuclideanSpace.single i 1)) := + (hf.continuous_fderiv one_ne_zero).clm_apply continuous_const + have hφd : Continuous (fun x => fderiv ℝ φ x (EuclideanSpace.single i 1)) := + (hφ.continuous_fderiv (by simp)).clm_apply continuous_const + have hφds : HasCompactSupport (fun x => fderiv ℝ φ x (EuclideanSpace.single i 1)) := + hφc.fderiv_apply ℝ (EuclideanSpace.single i 1) + simp_rw [classicalGradient_apply, testPartial] + apply integral_mul_fderiv_eq_neg_fderiv_mul_of_integrable + · exact (hfd.mul hφ.continuous).integrable_of_hasCompactSupport hφc.mul_left + · exact (hf.continuous.mul hφd).integrable_of_hasCompactSupport hφds.mul_left + · exact (hf.continuous.mul hφ.continuous).integrable_of_hasCompactSupport hφc.mul_left + · intro x _ + exact hf.differentiable one_ne_zero x + · intro x _ + exact hφ.differentiable (by simp) x + +end CenteredDiskEndpoint + +open scoped RealInnerProductSpace + +namespace CenteredDiskEndpoint +open Filter + +/-- Spherical boundaries are null, so the choice of an open disk does not alter +Lebesgue differentiation averages. -/ +theorem disk_ae_eq_closedDisk (x : Plane) (r : ℝ) : + Metric.ball x r =ᵐ[volume] Metric.closedBall x r := by + apply ae_eq_of_subset_of_measure_ge Metric.ball_subset_closedBall + · exact (Measure.addHaar_closedBall_eq_addHaar_ball volume x r).le + · exact measurableSet_ball.nullMeasurableSet + · exact measure_closedBall_lt_top.ne + +theorem average_closedDisk_eq (f : Plane → ℝ) (x : Plane) {r : ℝ} (hr : 0 ≤ r) : + (⨍ y in Metric.closedBall x r, f y) = diskAverage f x r := by + rw [← setAverage_congr (disk_ae_eq_closedDisk x r), setAverage_eq, + diskAverage, measureReal_def, volume_disk x hr, ENNReal.toReal_ofReal (by positivity)] + simp only [smul_eq_mul, div_eq_inv_mul] + +/-- Almost every point is a Lebesgue point for absolute disk averages. -/ +theorem ae_tendsto_diskAverage_abs {f : Plane → ℝ} (hf : Integrable f) : + ∀ᵐ x, Tendsto (fun r => diskAverage (fun y => |f y|) x r) + (𝓝[>] (0 : ℝ)) (𝓝 |f x|) := by + filter_upwards [IsUnifLocDoublingMeasure.ae_tendsto_average volume hf.abs.locallyIntegrable 0] + with x hx + have h := hx (fun _ : ℝ => x) (fun r : ℝ => r) tendsto_id + (Eventually.of_forall (fun r => by simp)) + apply h.congr' + filter_upwards [self_mem_nhdsWithin] with r hr + exact average_closedDisk_eq (fun y => |f y|) x hr.le + +/-- Away from zero the denominator alone bounds all absolute averages. -/ +theorem diskAverage_abs_le_of_radius_le {f : Plane → ℝ} (hf : Integrable f) + (x : Plane) {a r : ℝ} (ha : 0 < a) (har : a ≤ r) : + diskAverage (fun y => |f y|) x r ≤ (∫ y, |f y|) / (Real.pi * a ^ 2) := by + have hr : 0 < r := ha.trans_le har + have hnum : (∫ y in Metric.ball x r, |f y|) ≤ ∫ y, |f y| := + integral_mono_measure Measure.restrict_le_self + (Eventually.of_forall (fun y => abs_nonneg (f y))) hf.abs + have hden : Real.pi * a ^ 2 ≤ Real.pi * r ^ 2 := + mul_le_mul_of_nonneg_left ((sq_le_sq₀ ha.le hr.le).2 har) Real.pi_nonneg + dsimp [diskAverage] + calc + (∫ y in Metric.ball x r, |f y|) / (Real.pi * r ^ 2) ≤ + (∫ y, |f y|) / (Real.pi * r ^ 2) := + div_le_div_of_nonneg_right hnum (by positivity) + _ ≤ (∫ y, |f y|) / (Real.pi * a ^ 2) := + div_le_div_of_nonneg_left (integral_nonneg (fun y => abs_nonneg (f y))) + (by positivity) hden + +/-- A genuine clause of the endpoint, in fact valid for every L¹ input. No +maximal bound, gradient hypothesis, or selected radius is used here. -/ +theorem ae_maximal_ne_top {f : Plane → ℝ} (hf : Integrable f) : + ∀ᵐ x, maximal f x ≠ ⊤ := by + filter_upwards [ae_tendsto_diskAverage_abs hf] with x hx + obtain ⟨C, hC⟩ := hx.isBoundedUnder_le + obtain ⟨a, ha, haC⟩ := mem_nhdsGT_iff_exists_Ioc_subset.mp hC + have hbound (r : ℝ) (hr : 0 < r) : + diskAverage (fun y => |f y|) x r ≤ max C ((∫ y, |f y|) / (Real.pi * a ^ 2)) := by + by_cases hra : r ≤ a + · exact (haC ⟨hr, hra⟩).trans (le_max_left _ _) + · exact (diskAverage_abs_le_of_radius_le hf x ha (le_of_not_ge hra)).trans + (le_max_right _ _) + have hmax : maximal f x ≤ ENNReal.ofReal + (max C ((∫ y, |f y|) / (Real.pi * a ^ 2))) := by + apply iSup_le + intro r + apply iSup_le + intro hr + rw [absoluteDiskAverage_eq_ofReal hf.integrableOn hr] + exact ENNReal.ofReal_le_ofReal (hbound r hr) + exact ne_top_of_le_ne_top ENNReal.ofReal_ne_top hmax + +end CenteredDiskEndpoint + +open MeasureTheory Set Filter +open scoped Topology ENNReal + +noncomputable section + +open scoped Real RealInnerProductSpace + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Cancellation.lean b/lean/OAI/Analysis/DiskMaximal/Cancellation.lean new file mode 100644 index 0000000000000000000000000000000000000000..8a3ed37e0ed0d4864ba4cd45940e38bcc07f16a1 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Cancellation.lean @@ -0,0 +1,806 @@ +import OAI.Analysis.DiskMaximal.Moments + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal + +noncomputable section + +namespace LocalCancellation + +lemma integrable_lip_mul {b F : ℂ → ℂ} (hb : Integrable b) + {L : ℝ≥0} (hF : LipschitzWith L F) (z : ℂ) {s : ℝ} + (hsupp : ∀ᵐ y, b y ≠ 0 → ‖y-z‖ ≤ s) : Integrable (fun y => F y * b y) := by + have hbound : ∀ᵐ y, ‖(F y - F z) * b y‖ ≤ ((L : ℝ) * s) * ‖b y‖ := by + filter_upwards [hsupp] with y hy + by_cases hby : b y = 0 + · simp [hby] + · rw [norm_mul] + exact mul_le_mul_of_nonneg_right + ((hF.norm_sub_le y z).trans (mul_le_mul_of_nonneg_left (hy hby) L.coe_nonneg)) + (norm_nonneg _) + have hdiff : Integrable (fun y => (F y - F z) * b y) := + (hb.norm.smul ((L : ℝ) * s)).mono' + ((hF.continuous.sub continuous_const).aestronglyMeasurable.mul hb.aestronglyMeasurable) hbound + have h := hdiff.add (hb.const_mul (F z)) + change Integrable (fun y => (F y-F z)*b y + F z * b y) at h + simpa only [← add_mul, sub_add_cancel] using h + +/-- Cancellation against the actual integrable complex error density. -/ +lemma lip_cancellation {b F : ℂ → ℂ} (hb : Integrable b) (hzero : ∫ y, b y = 0) + {L : ℝ≥0} (hF : LipschitzWith L F) (z : ℂ) {s : ℝ} + (hsupp : ∀ᵐ y, b y ≠ 0 → ‖y-z‖ ≤ s) : + ‖∫ y, F y * b y‖ ≤ (L : ℝ) * s * ∫ y, ‖b y‖ := by + have hprod := integrable_lip_mul hb hF z hsupp + have he : (∫ y, (F y - F z) * b y) = ∫ y, F y * b y := by + simp_rw [sub_mul] + rw [integral_sub hprod (hb.const_mul (F z)), integral_const_mul, hzero, mul_zero, sub_zero] + rw [← he] + calc + ‖∫ y, (F y-F z) * b y‖ ≤ ∫ y, ((L : ℝ) * s) * ‖b y‖ := by + apply norm_integral_le_of_norm_le (hb.norm.smul ((L : ℝ) * s)) + filter_upwards [hsupp] with y hy + by_cases hby : b y = 0 + · simp [hby] + · rw [norm_mul] + exact mul_le_mul_of_nonneg_right + ((hF.norm_sub_le y z).trans (mul_le_mul_of_nonneg_left (hy hby) L.coe_nonneg)) + (norm_nonneg _) + _ = (L : ℝ) * s * ∫ y, ‖b y‖ := integral_const_mul _ _ + +lemma bounded_pairing {b F : ℂ → ℂ} (hb : Integrable b) {M : ℝ} + (hF : ∀ y, ‖F y‖ ≤ M) : ‖∫ y, F y * b y‖ ≤ M * ∫ y, ‖b y‖ := by + calc + ‖∫ y, F y * b y‖ ≤ ∫ y, M * ‖b y‖ := by + apply norm_integral_le_of_norm_le (hb.norm.const_mul M) + exact Eventually.of_forall (fun y => by rw [norm_mul]; exact mul_le_mul_of_nonneg_right (hF y) (norm_nonneg _)) + _ = M * ∫ y, ‖b y‖ := integral_const_mul _ _ + +lemma min_one_le_rpow {a α : ℝ} (ha : 0 ≤ a) (hα0 : 0 ≤ α) (hα1 : α ≤ 1) : + min 1 a ≤ a ^ α := by + by_cases ha1 : a ≤ 1 + · rw [min_eq_right ha1] + by_cases hz : a = 0 + · rw [hz] + exact Real.rpow_nonneg (by norm_num) _ + · simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_ge (lt_of_le_of_ne ha (Ne.symm hz)) ha1 hα1 + · rw [min_eq_left (le_of_not_ge ha1)] + exact Real.one_le_rpow (le_of_not_ge ha1) hα0 + +structure ErrorPiece (Cs : ℝ) where + density : ℂ → ℂ + integrable : Integrable density + size : ℝ + size_pos : 0 < size + size_le_one : size ≤ 1 + center : ℂ + zero_mass : size < 1 → ∫ y, density y = 0 + support : size < 1 → ∀ᵐ y, density y ≠ 0 → ‖y-center‖ ≤ Cs * size + +def ErrorPiece.mass {Cs : ℝ} (b : ErrorPiece Cs) : ℝ := ∫ y, ‖b.density y‖ + +lemma ErrorPiece.mass_nonneg {Cs : ℝ} (b : ErrorPiece Cs) : 0 ≤ b.mass := + integral_nonneg (fun _ => norm_nonneg _) + +/-- The single-piece interpolation discount, with no smoothness assumed on the density. -/ +lemma piece_discount {Cs α δ C : ℝ} (b : ErrorPiece Cs) + (hα0 : 0 ≤ α) (hα1 : α ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hC : 1 ≤ C) {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hLC : (L : ℝ) * Cs ≤ C / δ) : + ‖∫ y, F y * b.density y‖ ≤ C * (b.size / δ) ^ α * b.mass := by + have hr : ‖∫ y, F y * b.density y‖ ≤ b.mass := by + convert! bounded_pairing b.integrable hFb using 1 + simp only [one_mul, ErrorPiece.mass] + have hCm : 0 ≤ C * b.mass := mul_nonneg (by linarith) b.mass_nonneg + have hm : ‖∫ y, F y * b.density y‖ ≤ C * min 1 (b.size/δ) * b.mass := by + by_cases hs : b.size < 1 + · have hl := lip_cancellation b.integrable (b.zero_mass hs) hF b.center (b.support hs) + have hl' : ‖∫ y, F y * b.density y‖ ≤ C * (b.size/δ) * b.mass := by + have hh := mul_le_mul_of_nonneg_right hLC (mul_nonneg b.size_pos.le b.mass_nonneg) + calc + _ ≤ (L : ℝ) * (Cs * b.size) * b.mass := hl + _ ≤ C * (b.size/δ) * b.mass := by convert! hh using 1 <;> ring + have hr' : ‖∫ y, F y * b.density y‖ ≤ C * 1 * b.mass := by nlinarith [b.mass_nonneg] + by_cases hh : 1 ≤ b.size/δ + · simpa only [min_eq_left hh] using hr' + · simpa only [min_eq_right (le_of_not_ge hh)] using hl' + · have hs1 : b.size = 1 := le_antisymm b.size_le_one (le_of_not_gt hs) + have hh : 1 ≤ b.size / δ := by rw [hs1]; exact (one_le_div hδ).mpr hδ1 + rw [min_eq_left hh] + nlinarith [b.mass_nonneg] + calc + _ ≤ C * min 1 (b.size/δ) * b.mass := hm + _ ≤ C * (b.size/δ)^α * b.mass := by + nlinarith [mul_le_mul_of_nonneg_left + (min_one_le_rpow (div_nonneg b.size_pos.le hδ.le) hα0 hα1) hCm] + +end LocalCancellation + +namespace LocalCancellation + +/-- Multiplication by the position keeps a bounded-support Lipschitz test Lipschitz. -/ +lemma position_lipschitz {F : ℂ → ℂ} {L M R : ℝ≥0} (hF : LipschitzWith L F) + (hM : ∀ y, ‖F y‖ ≤ M) (x : ℂ) + (hR : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ R) : + LipschitzWith (R*L+M) (fun y => star (y-x) * F y) := by + apply LipschitzWith.of_dist_le_mul + intro y z + rw [dist_eq_norm, dist_eq_norm] + change ‖star (y-x)*F y - star (z-x)*F z‖ ≤ ((R : ℝ)*(L : ℝ)+(M : ℝ))*‖y-z‖ + by_cases hz : F z = 0 + · rw [hz, mul_zero, sub_zero] + by_cases hy : F y = 0 + · simp only [hy, mul_zero, norm_zero] + positivity + · have hFy : ‖F y‖ ≤ (L : ℝ)*‖y-z‖ := by simpa only [hz, sub_zero] using hF.norm_sub_le y z + rw [norm_mul, norm_star] + have hh := mul_le_mul (hR y hy) hFy (norm_nonneg _) R.coe_nonneg + nlinarith [mul_nonneg M.coe_nonneg (norm_nonneg (y-z))] + · have he : star (y-x)*F y-star (z-x)*F z = + star (z-x)*(F y-F z)+star (y-z)*F y := by + simp only [star_sub] + ring + rw [he] + calc + _ ≤ ‖star (z-x)*(F y-F z)‖+‖star (y-z)*F y‖ := norm_add_le _ _ + _ = ‖z-x‖*‖F y-F z‖+‖y-z‖*‖F y‖ := by rw [norm_mul, norm_mul, norm_star, norm_star] + _ ≤ (R : ℝ)*((L : ℝ)*‖y-z‖)+‖y-z‖*(M : ℝ) := + add_le_add (mul_le_mul (hR z hz) (hF.norm_sub_le y z) (norm_nonneg _) R.coe_nonneg) + (mul_le_mul_of_nonneg_left (hM y) (norm_nonneg _)) + _ = _ := by ring + +def correction (x z y : ℂ) : ℂ := 1 - star (y-x) / star (z-x) + +lemma correction_eq {x z y : ℂ} (hz : z ≠ x) : + correction x z y = star (z-y) / star (z-x) := by + have hzx : star (z-x) ≠ 0 := star_ne_zero.mpr (sub_ne_zero.mpr hz) + have he : star (z-x)-star (y-x) = star (z-y) := by simp only [star_sub]; ring + calc + correction x z y = (star (z-x)-star (y-x))/star (z-x) := by + rw [sub_div, div_self hzx] + rfl + _ = star (z-y)/star (z-x) := by rw [he] + +lemma norm_correction {x z y : ℂ} (hz : z ≠ x) : + ‖correction x z y‖ = ‖y-z‖ / ‖z-x‖ := by + rw [correction_eq hz, norm_div, norm_star, norm_star, norm_sub_rev z y] + +lemma correction_cap_bound {x z y : ℂ} {ρ : ℝ} + (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hy : ‖y-z‖ ≤ ρ) : + ‖correction x z y‖ ≤ 2*ρ := by + have hzx : 0 < ‖z-x‖ := by linarith + have hne : z ≠ x := sub_ne_zero.mp (norm_pos_iff.mp hzx) + rw [norm_correction hne] + have hρ : 0 ≤ ρ := (norm_nonneg _).trans hy + apply (div_le_iff₀ hzx).mpr + nlinarith + +lemma correction_bounded {x z y : ℂ} (hz : (1 : ℝ)/2 ≤ ‖z-x‖) + (hy : ‖y-x‖ ≤ 3) : ‖correction x z y‖ ≤ 7 := by + have hzx : 0 < ‖z-x‖ := by linarith + calc + ‖correction x z y‖ ≤ 1+‖y-x‖/‖z-x‖ := by + simpa only [correction, norm_one, norm_div, norm_star] using norm_sub_le (1 : ℂ) (star (y-x)/star (z-x)) + _ ≤ 7 := by + have : ‖y-x‖/‖z-x‖ ≤ 6 := (div_le_iff₀ hzx).mpr (by linarith) + linarith + +/-- Global Lipschitz control of the corrected increment test. -/ +lemma corrected_lipschitz {F : ℂ → ℂ} {L M R H : ℝ≥0} (hF : LipschitzWith L F) + (hM : ∀ y, ‖F y‖ ≤ M) (x z : ℂ) + (hR : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ R) (hH : ‖(star (z-x))⁻¹‖ ≤ H) : + LipschitzWith (L+H*(R*L+M)) (fun y => correction x z y * F y) := by + have hp := position_lipschitz hF hM x hR + apply LipschitzWith.of_dist_le_mul + intro y w + have he : correction x z y*F y-correction x z w*F w = + (F y-F w)-(star (z-x))⁻¹*(star (y-x)*F y-star (w-x)*F w) := by + simp only [correction, div_eq_mul_inv] + ring + rw [dist_eq_norm, he, dist_eq_norm] + calc + _ ≤ ‖F y-F w‖+‖(star (z-x))⁻¹*(star (y-x)*F y-star (w-x)*F w)‖ := norm_sub_le _ _ + _ ≤ (L : ℝ)*‖y-w‖+(H : ℝ)*(((R : ℝ)*(L : ℝ)+(M : ℝ))*‖y-w‖) := by + apply add_le_add (hF.norm_sub_le y w) + rw [norm_mul] + exact mul_le_mul hH (hp.norm_sub_le y w) (norm_nonneg _) H.coe_nonneg + _ = _ := by simp only [NNReal.coe_add, NNReal.coe_mul]; ring + +end LocalCancellation + +namespace LocalCancellation + +variable {ι : Type*} [Fintype ι] + +def errorPrice {Cs : ℝ} (b : ι → ErrorPiece Cs) (α : ℝ) : ℝ := + ∑ d, (b d).size ^ α * (b d).mass + +lemma errorPrice_nonneg {Cs : ℝ} (b : ι → ErrorPiece Cs) (α : ℝ) : + 0 ≤ errorPrice b α := Finset.sum_nonneg (fun d _ => + mul_nonneg (Real.rpow_nonneg (b d).size_pos.le _) (b d).mass_nonneg) + +lemma square_rpow {δ : ℝ} (hδ : 0 ≤ δ) (α : ℝ) : + (δ^2)^α = δ^(2*α) := by + rw [Real.rpow_mul hδ, Real.rpow_two] + +lemma coarse_mass_mul_le {Cs α δ : ℝ} (b : ι → ErrorPiece Cs) (hα : 0 ≤ α) + (hδ : 0 ≤ δ) : + δ^(2*α) * (∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), (b d).mass) ≤ + errorPrice b α := by + classical + rw [Finset.mul_sum] + have hp : δ^(2*α) = (δ^2)^α := (square_rpow hδ α).symm + calc + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), (b d).size^α*(b d).mass := by + apply Finset.sum_le_sum + intro d hd + rw [hp] + exact mul_le_mul_of_nonneg_right + (Real.rpow_le_rpow (sq_nonneg δ) (Finset.mem_filter.mp hd).2 hα) (b d).mass_nonneg + _ ≤ errorPrice b α := Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + (fun d _ _ => mul_nonneg (Real.rpow_nonneg (b d).size_pos.le _) (b d).mass_nonneg) + +lemma fine_size_sum_le {Cs α δ : ℝ} (b : ι → ErrorPiece Cs) (hα : α ≤ 1) + (hδ : 0 ≤ δ) : + (∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), (b d).size*(b d).mass) ≤ + δ^(2*(1-α))*errorPrice b α := by + classical + calc + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), + δ^(2*(1-α))*((b d).size^α*(b d).mass) := by + apply Finset.sum_le_sum + intro d hd + have hs : (b d).size < δ^2 := (Finset.mem_filter.mp hd).2 + have he : (b d).size = (b d).size^α*(b d).size^(1-α) := by + rw [← Real.rpow_add (b d).size_pos] + simp + have hh := Real.rpow_le_rpow (b d).size_pos.le hs.le (sub_nonneg.mpr hα) + rw [square_rpow hδ] at hh + calc + _ = ((b d).size^α*(b d).size^(1-α))*(b d).mass := congrArg (fun v => v*(b d).mass) he + _ = (b d).size^(1-α)*((b d).size^α*(b d).mass) := by ring + _ ≤ _ := mul_le_mul_of_nonneg_right hh + (mul_nonneg (Real.rpow_nonneg (b d).size_pos.le _) (b d).mass_nonneg) + _ = δ^(2*(1-α)) * (∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), + (b d).size^α*(b d).mass) := (Finset.mul_sum ..).symm + _ ≤ δ^(2*(1-α))*errorPrice b α := mul_le_mul_of_nonneg_left + (Finset.sum_le_sum_of_subset_of_nonneg (Finset.filter_subset _ _) + (fun d _ _ => mul_nonneg (Real.rpow_nonneg (b d).size_pos.le _) (b d).mass_nonneg)) + (Real.rpow_nonneg hδ _) + +lemma total_pairing_discount {Cs α δ C : ℝ} (b : ι → ErrorPiece Cs) + (hα0 : 0 ≤ α) (hα1 : α ≤ 1) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hC : 1 ≤ C) {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hLC : (L : ℝ)*Cs ≤ C/δ) : + ‖∑ d, ∫ y, F y*(b d).density y‖ ≤ C/δ^α*errorPrice b α := by + calc + _ ≤ ∑ d, ‖∫ y, F y*(b d).density y‖ := norm_sum_le _ _ + _ ≤ ∑ d, C*((b d).size/δ)^α*(b d).mass := Finset.sum_le_sum + (fun d _ => piece_discount (b d) hα0 hα1 hδ hδ1 hC hF hFb hLC) + _ = C/δ^α*errorPrice b α := by + rw [errorPrice, Finset.mul_sum] + apply Finset.sum_congr rfl + intro d _ + rw [Real.div_rpow (b d).size_pos.le hδ.le] + ring + +/-- All fine errors together retain the stronger, summable power of the width. -/ +lemma fine_pairing_bound {Cs α δ : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hα : α ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) : + ‖∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), ∫ y, F y*(b d).density y‖ ≤ + (L : ℝ)*Cs*δ^(2*(1-α))*errorPrice b α := by + classical + calc + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), ‖∫ y, F y*(b d).density y‖ := norm_sum_le _ _ + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), + (L : ℝ)*Cs*((b d).size*(b d).mass) := by + apply Finset.sum_le_sum + intro d hd + have hs : (b d).size < 1 := lt_of_lt_of_le (Finset.mem_filter.mp hd).2 (by nlinarith) + have hh := lip_cancellation (b d).integrable ((b d).zero_mass hs) hF (b d).center ((b d).support hs) + convert! hh using 1 + dsimp only [ErrorPiece.mass] + ring + _ = (L : ℝ)*Cs*(∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), + (b d).size*(b d).mass) := (Finset.mul_sum ..).symm + _ ≤ (L : ℝ)*Cs*(δ^(2*(1-α))*errorPrice b α) := + mul_le_mul_of_nonneg_left (fine_size_sum_le b hα hδ) (mul_nonneg L.coe_nonneg hCs) + _ = _ := by ring + +end LocalCancellation + +open MeasureTheory Set Filter +open scoped Topology NNReal Real + +noncomputable section +namespace LocalCancellation + +/-- Norm total-variation measure of an actual complex density. -/ +def densityMeasure (b : ℂ → ℂ) : Measure ℂ := volume.withDensity (fun y => ENNReal.ofReal ‖b y‖) + +lemma densityMeasure_apply {b : ℂ → ℂ} (hb : Integrable b) {D : Set ℂ} + (hD : MeasurableSet D) : densityMeasure b D = ENNReal.ofReal (∫ y in D, ‖b y‖) := by + rw [densityMeasure, withDensity_apply _ hD] + exact (ofReal_integral_eq_lintegral_ofReal hb.integrableOn.norm + (Eventually.of_forall (fun _ => norm_nonneg _))).symm + +lemma densityMeasure_univ {b : ℂ → ℂ} (hb : Integrable b) : + densityMeasure b univ = ENNReal.ofReal (∫ y, ‖b y‖) := by + rw [densityMeasure_apply hb MeasurableSet.univ, Measure.restrict_univ] + +lemma densityMeasure_finite {b : ℂ → ℂ} (hb : Integrable b) : IsFiniteMeasure (densityMeasure b) := by + constructor + rw [densityMeasure_univ hb] + exact ENNReal.ofReal_lt_top + +/-- A cap decomposition bound, with all integrals over genuine densities. -/ +lemma pairing_majorant {b F : ℂ → ℂ} (hb : Integrable b) {A : Set ℂ} + (hA : MeasurableSet A) (c d : ℝ) + (hF : ∀ y, ‖F y‖ ≤ c + d*A.indicator (fun _ => (1 : ℝ)) y) : + ‖∫ y, F y*b y‖ ≤ c*(∫ y, ‖b y‖)+d*(∫ y in A, ‖b y‖) := by + have hi : Integrable (fun y => c*‖b y‖+d*A.indicator (fun y => ‖b y‖) y) := + (hb.norm.const_mul c).add ((hb.norm.indicator hA).const_mul d) + calc + _ ≤ ∫ y, c*‖b y‖+d*A.indicator (fun y => ‖b y‖) y := by + apply norm_integral_le_of_norm_le hi + filter_upwards with y + rw [norm_mul] + have hh := mul_le_mul_of_nonneg_right (hF y) (norm_nonneg (b y)) + convert! hh using 1 + by_cases hy : y ∈ A + · simp only [Set.indicator_of_mem hy, mul_one] + ring + · simp only [Set.indicator_of_notMem hy, mul_zero, add_zero] + _ = _ := by + rw [integral_add (hb.norm.const_mul c) ((hb.norm.indicator hA).const_mul d), + integral_const_mul, integral_const_mul, integral_indicator hA] + +/-- Cancellation of an exact complex moment allows an off-center correction. -/ +lemma moment_correction {b F : ℂ → ℂ} (x z : ℂ) + (hF : Integrable (fun y => F y*b y)) + (hM : Integrable (fun y => star (y-x)*F y*b y)) + (hzero : ∫ y, star (y-x)*F y*b y = 0) : + (∫ y, F y*b y) = ∫ y, (1-star (y-x)/star (z-x))*F y*b y := by + have he : (fun y => (1-star (y-x)/star (z-x))*F y*b y) = + fun y => F y*b y-(star (z-x))⁻¹*(star (y-x)*F y*b y) := by + funext y + simp only [div_eq_mul_inv] + ring + rw [he, integral_sub hF (hM.const_mul _), integral_const_mul, hzero, mul_zero, sub_zero] + +end LocalCancellation + +namespace LocalCancellation + +lemma corrected_pairing_cap {b F : ℂ → ℂ} (hb : Integrable b) {D : Set ℂ} + (hD : MeasurableSet D) (hFb : ∀ y, ‖F y‖ ≤ 1) + (hFD : ∀ y, F y ≠ 0 → y ∈ D) (x z : ℂ) {ρ : ℝ} (hρ : 0 ≤ ρ) + (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) : + ‖∫ y, correction x z y*F y*b y‖ ≤ + 2*ρ*(∫ y, ‖b y‖)+7*(∫ y in D \ Metric.ball z ρ, ‖b y‖) := by + apply pairing_majorant hb (hD.diff measurableSet_ball) (2*ρ) 7 + intro y + by_cases hFy : F y = 0 + · simp only [hFy, mul_zero, norm_zero] + exact add_nonneg (mul_nonneg (by norm_num) hρ) + (mul_nonneg (by norm_num) (Set.indicator_nonneg (fun _ _ => zero_le_one) y)) + · have hyD := hFD y hFy + by_cases hyB : y ∈ Metric.ball z ρ + · have hc := correction_cap_bound hz (show ‖y-z‖ ≤ ρ from by simpa only [dist_eq_norm] using (Metric.mem_ball.mp hyB).le) + rw [Set.indicator_of_notMem (show y ∉ D \ Metric.ball z ρ from fun h => h.2 hyB), mul_zero, add_zero] + rw [norm_mul] + simpa only [mul_one] using mul_le_mul hc (hFb y) (norm_nonneg _) (mul_nonneg (by norm_num) hρ) + · rw [Set.indicator_of_mem (show y ∈ D \ Metric.ball z ρ from ⟨hyD,hyB⟩), mul_one] + have hc := correction_bounded hz (hD3 y hyD) + rw [norm_mul] + have hh := mul_le_mul hc (hFb y) (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 7) + nlinarith + +lemma supported_pairing {b F : ℂ → ℂ} (hb : Integrable b) {D : Set ℂ} + (hD : MeasurableSet D) (hFb : ∀ y, ‖F y‖ ≤ 1) + (hFD : ∀ y, F y ≠ 0 → y ∈ D) : + ‖∫ y, F y*b y‖ ≤ ∫ y in D, ‖b y‖ := by + have hh := pairing_majorant hb hD 0 1 (show ∀ y, ‖F y‖ ≤ 0+1*D.indicator (fun _ => (1 : ℝ)) y from by + intro y + by_cases hy : y ∈ D + · simpa only [Set.indicator_of_mem hy, mul_one, zero_add] using hFb y + · have hf : F y = 0 := by by_contra h; exact hy (hFD y h) + simp only [hf, norm_zero, Set.indicator_of_notMem hy, mul_zero, zero_add, le_refl]) + simpa only [zero_mul, one_mul, zero_add] using hh + +variable {ι : Type*} [Fintype ι] + +def coarseMeasure {Cs : ℝ} (b : ι → ErrorPiece Cs) (δ : ℝ) : Measure ℂ := + ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), densityMeasure (b d).density + +def coarseMass {Cs : ℝ} (b : ι → ErrorPiece Cs) (δ : ℝ) (D : Set ℂ) : ℝ := + ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), ∫ y in D, ‖(b d).density y‖ + +lemma coarseMass_nonneg {Cs : ℝ} (b : ι → ErrorPiece Cs) (δ : ℝ) (D : Set ℂ) : + 0 ≤ coarseMass b δ D := Finset.sum_nonneg (fun _ _ => integral_nonneg (fun _ => norm_nonneg _)) + +lemma coarseMeasure_apply {Cs : ℝ} (b : ι → ErrorPiece Cs) (δ : ℝ) {D : Set ℂ} + (hD : MeasurableSet D) : coarseMeasure b δ D = ENNReal.ofReal (coarseMass b δ D) := by + classical + simp only [coarseMeasure, Measure.finsetSum_apply, densityMeasure_apply (b _).integrable hD, + coarseMass] + rw [ENNReal.ofReal_sum_of_nonneg (fun d _ => integral_nonneg (fun _ => norm_nonneg _))] + +instance coarseMeasure_finite {Cs : ℝ} (b : ι → ErrorPiece Cs) (δ : ℝ) : + IsFiniteMeasure (coarseMeasure b δ) := by + constructor + rw [coarseMeasure_apply b δ MeasurableSet.univ] + exact ENNReal.ofReal_lt_top + +lemma coarseMass_univ {Cs : ℝ} (b : ι → ErrorPiece Cs) (δ : ℝ) : + coarseMass b δ univ = ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), (b d).mass := by + simp only [coarseMass, ErrorPiece.mass, Measure.restrict_univ] + +lemma coarseMass_bound {Cs α δ : ℝ} (b : ι → ErrorPiece Cs) (hα : 0 ≤ α) + (hδ : 0 < δ) : coarseMass b δ univ ≤ errorPrice b α / δ^(2*α) := by + rw [le_div_iff₀ (Real.rpow_pos_of_pos hδ _), mul_comm, coarseMass_univ] + exact coarse_mass_mul_le b hα hδ.le + +/-- The uncorrected increment costs only shell mass plus the fine-error discount. -/ +lemma increment_bound {Cs α δ : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hα : α ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) : + ‖∑ d, ∫ y, F y*(b d).density y‖ ≤ + coarseMass b δ D+(L : ℝ)*Cs*δ^(2*(1-α))*errorPrice b α := by + classical + have he : (∑ d, ∫ y, F y*(b d).density y) = + (∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), ∫ y, F y*(b d).density y)+ + (∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), ∫ y, F y*(b d).density y) := by + simpa only [not_le] using (Finset.sum_filter_add_sum_filter_not Finset.univ + (fun d => δ^2 ≤ (b d).size) (fun d => ∫ y, F y*(b d).density y)).symm + rw [he] + apply (norm_add_le _ _).trans + apply add_le_add + · apply (norm_sum_le _ _).trans + exact Finset.sum_le_sum (fun d _ => supported_pairing (b d).integrable hD hFb hFD) + · exact fine_pairing_bound b hCs hα hδ hδ1 hF + +end LocalCancellation + +namespace LocalCancellation + +lemma integrable_bounded_pairing {b F : ℂ → ℂ} (hb : Integrable b) + (hF : AEStronglyMeasurable F) {M : ℝ} (hM : ∀ y, ‖F y‖ ≤ M) : + Integrable (fun y => F y*b y) := by + apply (hb.norm.const_mul M).mono' (hF.mul hb.aestronglyMeasurable) + filter_upwards with y + change ‖F y * b y‖ ≤ M * ‖b y‖ + rw [norm_mul] + exact mul_le_mul_of_nonneg_right (hM y) (norm_nonneg _) + +lemma position_bound {F : ℂ → ℂ} (hF : ∀ y, ‖F y‖ ≤ 1) (x : ℂ) + {R : ℝ} (hR0 : 0 ≤ R) (hR : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ R) : + ∀ y, ‖star (y-x)*F y‖ ≤ R := by + intro y + by_cases hy : F y = 0 + · simpa only [hy, mul_zero, norm_zero] using hR0 + · rw [norm_mul, norm_star] + simpa only [mul_one] using mul_le_mul (hR y hy) (hF y) (norm_nonneg _) hR0 + +variable {ι : Type*} [Fintype ι] + +/-- The decisive corrected active increment, prior to substitution of the dyadic powers. +The zero moment is the exact one furnished by two balanced kernels, not a bound. -/ +lemma corrected_increment_bound {Cs α δ ρ : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hα : α ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hρ : 0 ≤ ρ) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) (x z : ℂ) + (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) + (hzero : ∑ d, ∫ y, star (y-x)*F y*(b d).density y = 0) : + ‖∑ d, ∫ y, F y*(b d).density y‖ ≤ + 2*ρ*coarseMass b δ univ+7*coarseMass b δ (D \ Metric.ball z ρ)+ + ((L : ℝ)+2*(3*(L : ℝ)+1))*Cs*δ^(2*(1-α))*errorPrice b α := by + classical + have hnorm : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ (3 : ℝ) := fun y hy => hD3 y (hFD y hy) + have hH : ‖(star (z-x))⁻¹‖ ≤ (2 : ℝ) := by + rw [norm_inv, norm_star] + have hn : 0 < ‖z-x‖ := by linarith + rw [inv_eq_one_div, div_le_iff₀ hn] + linarith + have hcorr : LipschitzWith (L+2*(3*L+1)) (fun y => correction x z y*F y) := + corrected_lipschitz (M := 1) (R := 3) (H := 2) hF hFb x z hnorm hH + have he (d : ι) : (∫ y, correction x z y*F y*(b d).density y) = + (∫ y, F y*(b d).density y) - (star (z-x))⁻¹*(∫ y, star (y-x)*F y*(b d).density y) := by + have hf := integrable_bounded_pairing (b d).integrable hF.continuous.aestronglyMeasurable hFb + have hm : Integrable (fun y => star (y-x)*F y*(b d).density y) := + integrable_bounded_pairing (b d).integrable + ((by fun_prop : Continuous (fun y : ℂ => star (y-x))).mul hF.continuous).aestronglyMeasurable + (position_bound hFb x (by norm_num) hnorm) + have hid : (fun y => correction x z y*F y*(b d).density y) = + fun y => F y*(b d).density y - (star (z-x))⁻¹*(star (y-x)*F y*(b d).density y) := by + funext y + simp only [correction, div_eq_mul_inv] + ring + rw [hid, integral_sub hf (hm.const_mul _), integral_const_mul] + have hall : (∑ d, ∫ y, correction x z y*F y*(b d).density y) = + ∑ d, ∫ y, F y*(b d).density y := by + simp_rw [he] + rw [Finset.sum_sub_distrib, ← Finset.mul_sum, hzero, mul_zero, sub_zero] + rw [← hall] + have hsplit : (∑ d, ∫ y, correction x z y*F y*(b d).density y) = + (∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), ∫ y, correction x z y*F y*(b d).density y)+ + (∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), ∫ y, correction x z y*F y*(b d).density y) := by + simpa only [not_le] using (Finset.sum_filter_add_sum_filter_not Finset.univ + (fun d => δ^2 ≤ (b d).size) (fun d => ∫ y, correction x z y*F y*(b d).density y)).symm + rw [hsplit] + apply (norm_add_le _ _).trans + apply add_le_add + · calc + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), + ‖∫ y, correction x z y*F y*(b d).density y‖ := norm_sum_le _ _ + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), + (2*ρ*(∫ y, ‖(b d).density y‖)+7*(∫ y in D \ Metric.ball z ρ, ‖(b d).density y‖)) := + Finset.sum_le_sum (fun d _ => corrected_pairing_cap (b d).integrable hD hFb hFD x z hρ hz hD3) + _ = _ := by + rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] + simp only [coarseMass, Measure.restrict_univ] + · exact fine_pairing_bound b hCs hα hδ hδ1 hcorr + +end LocalCancellation + +namespace DiskKernels + +lemma kernel_nonneg {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x y : ℂ) : + 0 ≤ kernel k x y := tail_nonneg k _ + +lemma kernel_le_one {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x y : ℂ) : + kernel k x y ≤ 1 := tail_le_one k _ + +lemma complex_kernel_lipschitz {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x : ℂ) : + LipschitzWith M (fun y => (kernel k x y : ℂ)) := by + simpa only [one_mul, Function.comp_def] using Complex.isometry_ofReal.lipschitzWith.comp (kernel_lipschitz k x) + +lemma complex_kernel_bound {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x y : ℂ) : + ‖(kernel k x y : ℂ)‖ ≤ 1 := by + simpa only [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (kernel_nonneg k x y)] using kernel_le_one k x y + +lemma difference_bound {a b c d : ℝ} {M N : ℝ≥0} + (k : RadiusDensity a b M) (l : RadiusDensity c d N) (x y : ℂ) : + ‖((kernel l x y : ℂ) - kernel k x y)‖ ≤ 1 := by + rw [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs, abs_le] + constructor <;> linarith [kernel_nonneg k x y, kernel_nonneg l x y, kernel_le_one k x y, kernel_le_one l x y] + +lemma difference_support {r δ ε : ℝ} {M N : ℝ≥0} + (k : RadiusDensity (r-δ) (r+δ) M) (l : RadiusDensity (r-ε) (r+ε) N) + (hεδ : ε ≤ δ) (x y : ℂ) (h : (kernel l x y : ℂ) - kernel k x y ≠ 0) : + |‖y-x‖-r| ≤ δ := by + by_cases hlo : ‖y-x‖ < r-δ + · have hk : kernel k x y = 1 := kernel_one k x (by simpa only [Metric.mem_ball, dist_eq_norm] using hlo) + have hl : kernel l x y = 1 := kernel_one l x (by + simp only [Metric.mem_ball, dist_eq_norm] + linarith) + exact False.elim (h (by simp only [hk, hl, sub_self])) + · by_cases hup : r+δ ≤ ‖y-x‖ + · have hk : kernel k x y = 0 := kernel_zero k x (by + simpa only [Metric.mem_ball, dist_eq_norm, not_lt] using hup) + have hl : kernel l x y = 0 := kernel_zero l x (by + simp only [Metric.mem_ball, dist_eq_norm, not_lt] + linarith) + exact False.elim (h (by simp only [hk, hl, sub_self])) + · rw [abs_le] + constructor <;> linarith + +end DiskKernels + +namespace DiskKernels + +/-- At every point away from the boundary circle, all such mixtures tend to + the actual sharp disk. No convergence of the chosen radius densities is assumed. -/ +lemma tendsto_kernel {r : ℝ} {δ : ℕ → ℝ} {M : ℕ → ℝ≥0} + (k : ∀ n, RadiusDensity (r-δ n) (r+δ n) (M n)) + (hδ : Tendsto δ atTop (𝓝 0)) (x y : ℂ) (hy : ‖y-x‖ ≠ r) : + Tendsto (fun n => kernel (k n) x y) atTop + (𝓝 ((Metric.ball x r).indicator (fun _ => (1 : ℝ)) y)) := by + by_cases h : ‖y-x‖ < r + · have he : ∀ᶠ n in atTop, kernel (k n) x y = 1 := by + filter_upwards [hδ.eventually_lt_const (sub_pos.mpr h)] with n hn + exact kernel_one (k n) x (by + simp only [Metric.mem_ball, dist_eq_norm] + linarith) + have hmem : y ∈ Metric.ball x r := by simpa only [Metric.mem_ball, dist_eq_norm] using h + rw [indicator_of_mem hmem] + exact tendsto_const_nhds.congr' (he.mono fun _ hn => hn.symm) + · have hh : r < ‖y-x‖ := lt_of_le_of_ne (le_of_not_gt h) (Ne.symm hy) + have he : ∀ᶠ n in atTop, kernel (k n) x y = 0 := by + filter_upwards [hδ.eventually_lt_const (sub_pos.mpr hh)] with n hn + exact kernel_zero (k n) x (by + simp only [Metric.mem_ball, dist_eq_norm, not_lt] + linarith) + have hmem : y ∉ Metric.ball x r := by simpa only [Metric.mem_ball, dist_eq_norm] using h + rw [indicator_of_notMem hmem] + exact tendsto_const_nhds.congr' (he.mono fun _ hn => hn.symm) + +/-- Dominated convergence of an arbitrary sequence of mixtures against each + actual absolutely continuous finite vector measure. -/ +lemma tendsto_kernel_pairing {r : ℝ} {δ : ℕ → ℝ} {M : ℕ → ℝ≥0} + (k : ∀ n, RadiusDensity (r-δ n) (r+δ n) (M n)) + (hδ : Tendsto δ atTop (𝓝 0)) (x : ℂ) {b : ℂ → ℂ} (hb : Integrable b) : + Tendsto (fun n => ∫ y, (kernel (k n) x y : ℂ)*b y) atTop + (𝓝 (∫ y in Metric.ball x r, b y)) := by + rw [← integral_indicator measurableSet_ball] + apply tendsto_integral_of_dominated_convergence (fun y => ‖b y‖) + · intro n + exact (complex_kernel_lipschitz (k n) x).continuous.aestronglyMeasurable.mul hb.aestronglyMeasurable + · exact hb.norm + · intro n + filter_upwards with y + change ‖(kernel (k n) x y : ℂ)*b y‖ ≤ ‖b y‖ + rw [norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) (complex_kernel_bound (k n) x y) + · have hcircle : ∀ᵐ y : ℂ, ‖y-x‖ ≠ r := by + simpa only [Metric.mem_sphere, dist_eq_norm] using (measure_eq_zero_iff_ae_notMem.mp (Measure.addHaar_sphere volume x r)) + filter_upwards [hcircle] with y hy + have h := (Complex.continuous_ofReal.tendsto _).comp (tendsto_kernel k hδ x y hy) + have hm := h.mul_const (b y) + convert! hm using 1 + by_cases hmem : y ∈ Metric.ball x r + · simp only [indicator_of_mem hmem, Complex.ofReal_one, one_mul] + · simp only [indicator_of_notMem hmem, Complex.ofReal_zero, zero_mul] + +end DiskKernels + +namespace LocalCancellation +open DiskGeometry + +variable {ι : Type*} [Fintype ι] + +theorem size_step {Cs α δ ρ U : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hα : α ≤ 1) (hδ : 0 < δ) + (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) (hδρ : δ ≤ ρ^2/1600) (hU : 0 < U) : + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ + (ENNReal.ofReal U)⁻¹ ^ 2 * + (ENNReal.ofReal (156*δ/ρ)*ENNReal.ofReal (coarseMass b δ univ)*ENNReal.ofReal (coarseMass b δ univ)) + + (ENNReal.ofReal U)⁻¹ * + ((ENNReal.ofReal (6*Real.pi)*ENNReal.ofReal (2*(200*δ/ρ^2)))*ENNReal.ofReal (coarseMass b δ univ)) ∧ + ∀ x ∉ E, ∀ r ∈ Icc (1 : ℝ) 2, ∀ (L : ℝ≥0) (F : ℂ → ℂ), + LipschitzWith L F → (∀ y, ‖F y‖ ≤ 1) → + (∀ y, F y ≠ 0 → y ∈ thinShell x r δ) → + (U ≤ coarseMass b δ (thinShell x r δ) → + (∑ d, ∫ y, star (y-x)*F y*(b d).density y) = 0) → + ‖∑ d, ∫ y, F y*(b d).density y‖ ≤ + 2*ρ*coarseMass b δ univ+14*U+ + ((L : ℝ)+2*(3*(L : ℝ)+1))*Cs*δ^(2*(1-α))*errorPrice b α := by + obtain ⟨E, hE, hEv, hcap⟩ := shell_concentration (coarseMeasure b δ) (0 : Measure ℂ) + hρ hρ1 hδ hδρ (le_refl 0) hU + refine ⟨E, hE, ?_, ?_⟩ + · simpa only [coarseMeasure_apply b δ MeasurableSet.univ, zero_div, add_zero, mul_one] using hEv + · intro x hx r hr L F hF hFb hFD hzero + have hδ1 : δ ≤ 1 := by nlinarith [sq_nonneg (ρ-1)] + have hδq : δ ≤ 1/4 := by nlinarith [sq_nonneg (ρ-1)] + have hM0 : 0 ≤ coarseMass b δ univ := by + rw [coarseMass_univ] + exact Finset.sum_nonneg (fun d _ => (b d).mass_nonneg) + have hf0 : 0 ≤ Cs*δ^(2*(1-α))*errorPrice b α := + mul_nonneg (mul_nonneg hCs (Real.rpow_nonneg hδ.le _)) (errorPrice_nonneg b α) + by_cases hactive : U ≤ coarseMass b δ (thinShell x r δ) + · have hact : ENNReal.ofReal U ≤ coarseMeasure b δ (thinShell x r δ) := by + rw [coarseMeasure_apply b δ (measurableSet_thinShell x r δ)] + exact ENNReal.ofReal_le_ofReal hactive + obtain ⟨z, hz, hzc⟩ := hcap x hx r hr hact (by simp) + have hzc' : coarseMass b δ (thinShell x r δ \ Metric.ball z ρ) ≤ 2*U := by + rw [zero_add, coarseMeasure_apply b δ ((measurableSet_thinShell x r δ).diff measurableSet_ball)] at hzc + exact (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp hzc + have hzbound : 1/2 ≤ ‖z-x‖ := by + simpa only [norm_sub_rev] using (shell_center_bounds hr hδq hz).1 + have hD3 : ∀ y ∈ thinShell x r δ, ‖y-x‖ ≤ 3 := by + intro y hy + simpa only [norm_sub_rev] using (shell_center_bounds hr hδq hy).2 + have hc := corrected_increment_bound b hCs hα hδ.le hδ1 hρ.le hF + (measurableSet_thinShell x r δ) hFb hFD x z hzbound hD3 (hzero hactive) + nlinarith + · have hi := increment_bound b hCs hα hδ.le hδ1 hF + (measurableSet_thinShell x r δ) hFb hFD + have hx0 : 0 ≤ 2*ρ*coarseMass b δ univ := by positivity + have hL : (L : ℝ) ≤ (L : ℝ)+2*(3*(L : ℝ)+1) := by linarith [L.coe_nonneg] + have hh := mul_le_mul_of_nonneg_right hL hf0 + nlinarith + +end LocalCancellation + +namespace DiskGeometry + +lemma thinShell_eq_diff {x : ℂ} {r δ : ℝ} : + thinShell x r δ = Metric.closedBall x (r+δ) \ Metric.ball x (r-δ) := by + ext y + simp only [thinShell, mem_ofPred_eq, abs_le, Set.mem_sdiff, Metric.mem_closedBall, + Metric.mem_ball, dist_eq_norm, not_lt] + constructor <;> intro h <;> constructor <;> linarith [h.1, h.2] + +/-- Exact area of an annulus, including the inner and outer circles. -/ +lemma volume_thinShell (x : ℂ) {r δ : ℝ} (hδ : 0 ≤ δ) (hr : δ ≤ r) : + volume (thinShell x r δ) = ENNReal.ofReal (4*Real.pi*r*δ) := by + have hi : 0 ≤ r-δ := sub_nonneg.mpr hr + have ho : 0 ≤ r+δ := by linarith + rw [thinShell_eq_diff, measure_sdiff (fun y hy => Metric.ball_subset_closedBall + (Metric.ball_subset_ball (by linarith) hy)) measurableSet_ball.nullMeasurableSet measure_ball_lt_top.ne, + Complex.volume_closedBall, Complex.volume_ball] + rw [← ENNReal.ofReal_pow ho, ← ENNReal.ofReal_pow hi] + rw [← (ENNReal.ofReal_coe_nnreal : ENNReal.ofReal (NNReal.pi : ℝ) = (NNReal.pi : ℝ≥0∞))] + change ENNReal.ofReal ((r+δ)^2) * ENNReal.ofReal Real.pi - + ENNReal.ofReal ((r-δ)^2) * ENNReal.ofReal Real.pi = ENNReal.ofReal (4*Real.pi*r*δ) + rw [← ENNReal.ofReal_mul (sq_nonneg _), ← ENNReal.ofReal_mul (sq_nonneg _), + ← ENNReal.ofReal_sub _ (mul_nonneg (sq_nonneg _) Real.pi_pos.le)] + congr 1 + ring + +lemma measurableSet_shellPairs (r δ : ℝ) : + MeasurableSet {p : ℂ × ℂ | p.2 ∈ thinShell p.1 r δ} := by + exact measurableSet_le (by fun_prop : Measurable (fun p : ℂ × ℂ => |‖p.2-p.1‖-r|)) measurable_const + +def shellMass (ν : Measure ℂ) (r δ : ℝ) (x : ℂ) : ℝ≥0∞ := ν (thinShell x r δ) + +lemma measurable_shellMass (ν : Measure ℂ) [IsFiniteMeasure ν] (r δ : ℝ) : + Measurable (shellMass ν r δ) := + measurable_measure_prodMk_left (measurableSet_shellPairs r δ) + +lemma shell_symm (x y : ℂ) (r δ : ℝ) : y ∈ thinShell x r δ ↔ x ∈ thinShell y r δ := by + simp only [thinShell, mem_ofPred_eq, norm_sub_rev x y] + +/-- The integrated shell mass is its exact area times the total input mass. -/ +lemma lintegral_shellMass (ν : Measure ℂ) [IsFiniteMeasure ν] {r δ : ℝ} + (hδ : 0 ≤ δ) (hr : δ ≤ r) : + (∫⁻ x, shellMass ν r δ x) = ENNReal.ofReal (4*Real.pi*r*δ)*ν univ := by + let A : Set (ℂ × ℂ) := {p | p.2 ∈ thinShell p.1 r δ} + have hA : MeasurableSet A := measurableSet_shellPairs r δ + have he (x : ℂ) : shellMass ν r δ x = ∫⁻ y, A.indicator 1 (x,y) ∂ν := by + rw [show (fun y : ℂ => A.indicator 1 (x,y)) = (thinShell x r δ).indicator 1 by + ext y; exact (indicator_comp_right (fun y : ℂ => (x,y))).symm] + exact (lintegral_indicator_one (measurableSet_thinShell x r δ)).symm + simp_rw [he] + rw [lintegral_lintegral_swap (f := fun x y : ℂ => A.indicator 1 (x,y)) + (measurable_const.indicator hA).aemeasurable] + have hei (y : ℂ) : (fun x : ℂ => A.indicator (1 : ℂ × ℂ → ℝ≥0∞) (x,y)) = + (thinShell y r δ).indicator 1 := by + ext x + by_cases h : y ∈ thinShell x r δ + · rw [indicator_of_mem (show (x,y) ∈ A from h), indicator_of_mem ((shell_symm x y r δ).mp h)] + rfl + · rw [indicator_of_notMem (show (x,y) ∉ A from h), indicator_of_notMem (fun hx => h ((shell_symm x y r δ).mpr hx))] + simp_rw [hei, lintegral_indicator_one (measurableSet_thinShell _ r δ), volume_thinShell _ hδ hr] + exact lintegral_const _ + +lemma shellMass_exception (ν : Measure ℂ) [IsFiniteMeasure ν] {r δ U : ℝ} + (hδ : 0 ≤ δ) (hr : δ ≤ r) (hU : 0 < U) : + MeasurableSet {x | ENNReal.ofReal U ≤ shellMass ν r δ x} ∧ + volume {x | ENNReal.ofReal U ≤ shellMass ν r δ x} ≤ + ENNReal.ofReal (4*Real.pi*r*δ)*ν univ / ENNReal.ofReal U := by + refine ⟨measurableSet_le measurable_const (measurable_shellMass ν r δ), ?_⟩ + have h := meas_ge_le_lintegral_div (μ := (volume : Measure ℂ)) + (measurable_shellMass ν r δ).aemeasurable (ENNReal.ofReal_pos.mpr hU).ne' ENNReal.ofReal_ne_top + rwa [lintegral_shellMass ν hδ hr] at h + +/-- A shell whose radius is sufficiently close to an endpoint is contained + in the endpoint annulus; this covers forced endpoint radii as well. -/ +lemma thinShell_subset_endpoint {x : ℂ} {r a δ : ℝ} (hra : |r-a| ≤ δ) : + thinShell x r δ ⊆ thinShell x a (2*δ) := by + intro y hy + change |‖y-x‖-r| ≤ δ at hy + change |‖y-x‖-a| ≤ 2*δ + calc + _ = |(‖y-x‖-r)+(r-a)| := by congr 1; ring + _ ≤ |‖y-x‖-r|+|r-a| := abs_add_le _ _ + _ ≤ 2*δ := by linarith + +end DiskGeometry + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/DirectionEstimates.lean b/lean/OAI/Analysis/DiskMaximal/DirectionEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..831e80e71aaa3310d18de0a8028edd691fea4e3f --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/DirectionEstimates.lean @@ -0,0 +1,571 @@ +import OAI.Analysis.DiskMaximal.DirectionLaws + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology + +noncomputable section + +namespace DirectionNeighbors +open DyadicHats Finset + +/-- The complete fixed grid window. No spatial observation enters the choices. -/ +def window (d : ℕ) (q : ℤ × ℤ) : Finset (ℤ × ℤ) := + (Finset.Icc (q.1-d) (q.1+d)).product (Finset.Icc (q.2-d) (q.2+d)) + +lemma self_mem_window (d : ℕ) (q : ℤ × ℤ) : q ∈ window d q := by + exact Finset.mem_product.mpr ⟨Finset.mem_Icc.mpr ⟨by omega,by omega⟩, + Finset.mem_Icc.mpr ⟨by omega,by omega⟩⟩ + +lemma mem_window_iff {r : ℝ} (hr : 0 < r) (d : ℕ) (q z : ℤ × ℤ) : + z ∈ window d q ↔ boxNorm (point r z-point r q) ≤ (d:ℝ)*r := by + have hh (a b : ℤ) : |r*a-r*b| ≤ (d:ℝ)*r ↔ b-(d:ℤ) ≤ a ∧ a ≤ b+d := by + rw [← mul_sub,abs_mul,abs_of_pos hr,mul_comm (d:ℝ) r,mul_le_mul_iff_right₀ hr] + have hc : |(a:ℝ)-(b:ℝ)| ≤ (d:ℝ) ↔ |a-b| ≤ (d:ℤ) := by + exact_mod_cast Iff.rfl + rw [hc,abs_le] + omega + change (_ ∈ ((Finset.Icc _ _) ×ˢ (Finset.Icc _ _))) ↔ max _ _ ≤ _ + rw [Finset.mem_product,Finset.mem_Icc,Finset.mem_Icc,max_le_iff] + exact (hh _ _).symm.and (hh _ _).symm + +private lemma max_exists (f : ℤ × ℤ → ℝ) (d : ℕ) (q : ℤ × ℤ) : + ∃ z ∈ window d q, ∀ z' ∈ window d q, f z' ≤ f z := + Finset.exists_max_image (window d q) f ⟨q,self_mem_window d q⟩ + +def maxVertex (f : ℤ × ℤ → ℝ) (d : ℕ) (q : ℤ × ℤ) : ℤ × ℤ := + Classical.choose (max_exists f d q) +lemma maxVertex_mem (f : ℤ × ℤ → ℝ) (d : ℕ) (q : ℤ × ℤ) : + maxVertex f d q ∈ window d q := (Classical.choose_spec (max_exists f d q)).1 +lemma le_maxVertex (f : ℤ × ℤ → ℝ) (d : ℕ) (q : ℤ × ℤ) {z : ℤ × ℤ} + (hz : z ∈ window d q) : f z ≤ f (maxVertex f d q) := + (Classical.choose_spec (max_exists f d q)).2 z hz + +def chosen (h : ℂ → ℂ) (r : ℝ) : ℤ × ℤ → ℤ × ℤ := maxVertex (scalarMass h r) 300 + +def theta (h : ℂ → ℂ) (r : ℝ) (q : ℤ × ℤ) : ℂ := + IntrinsicMarks.direction 1 (vectorMass h r q) +def Theta (h : ℂ → ℂ) (r : ℝ) (z : ℤ × ℤ) : ℂ := theta h r (chosen h r z) + +def worstVertex (h : ℂ → ℂ) (r : ℝ) (q : ℤ × ℤ) : ℤ × ℤ := + maxVertex (fun z => ‖Theta h r z-theta h r q‖^2) 200 q + +def energy (h : ℂ → ℂ) (r : ℝ) (q : ℤ × ℤ) : ℝ := + ‖Theta h r (worstVertex h r q)-theta h r q‖^2 + +lemma norm_theta (h : ℂ → ℂ) (r : ℝ) (q : ℤ × ℤ) : ‖theta h r q‖ = 1 := + IntrinsicMarks.norm_direction (by norm_num) _ +lemma energy_nonneg (h : ℂ → ℂ) (r : ℝ) (q : ℤ × ℤ) : 0 ≤ energy h r q := sq_nonneg _ +lemma energy_le_four (h : ℂ → ℂ) (r : ℝ) (q : ℤ × ℤ) : energy h r q ≤ 4 := by + have hn := norm_sub_le (Theta h r (worstVertex h r q)) (theta h r q) + simp only [Theta,norm_theta] at hn + change ‖theta h r (chosen h r (worstVertex h r q))-theta h r q‖^2 ≤ 4 + nlinarith [norm_nonneg (theta h r (chosen h r (worstVertex h r q))-theta h r q)] + +lemma energy_controls {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q z : ℤ × ℤ) + (hz : boxNorm (point r z-point r q) ≤ 200*r) : + ‖Theta h r z-theta h r q‖^2 ≤ energy h r q := by + apply le_maxVertex (fun z => ‖Theta h r z-theta h r q‖^2) 200 q + exact (mem_window_iff hr 200 q z).mpr (by simpa using hz) + +lemma worstVertex_near {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) : + boxNorm (point r (worstVertex h r q)-point r q) ≤ 200*r := by + have hm := maxVertex_mem (fun z => ‖Theta h r z-theta h r q‖^2) 200 q + simpa only [worstVertex,Nat.cast_ofNat] using (mem_window_iff hr 200 q _).mp hm + +lemma chosen_near {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (z : ℤ × ℤ) : + boxNorm (point r (chosen h r z)-point r z) ≤ 300*r := by + simpa only [chosen,Nat.cast_ofNat] using + (mem_window_iff hr 300 z _).mp (maxVertex_mem (scalarMass h r) 300 z) + +/-- The actual chosen neighbor supplies at least the root's mass and is within +500 fine-grid units, precisely the inputs spent by the coarse triangle defect. -/ +lemma worst_chosen_spec {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) : + scalarMass h r q ≤ scalarMass h r (chosen h r (worstVertex h r q)) ∧ + boxNorm (point r (chosen h r (worstVertex h r q))-point r q) ≤ 500*r := by + let z := worstVertex h r q + have hz : boxNorm (point r z-point r q) ≤ 200*r := worstVertex_near hr h q + have hz' : boxNorm (point r q-point r z) ≤ 300*r := by + rw [boxNorm_sub_comm] + linarith + have ha := le_maxVertex (scalarMass h r) 300 z ((mem_window_iff hr 300 z q).mpr (by simpa using hz')) + have hw := chosen_near hr h z + have ht := boxNorm_add_le (point r (chosen h r z)-point r z) (point r z-point r q) + rw [sub_add_sub_cancel] at ht + exact ⟨ha,by linarith⟩ + +end DirectionNeighbors + +namespace DirectionNeighbors +open DyadicHats + +lemma vectorMass_mem_grid {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + {q : ℤ × ℤ} (hq : vectorMass h r q ≠ 0) : q ∈ indexBox N := by + by_contra hn + apply hq + apply integral_eq_zero_of_ae + filter_upwards with y + by_cases hy : h y=0 + · simp only [hy,smul_zero,Pi.zero_apply] + · have hh : hat r q y=0 := by + by_contra hz + exact hn (mem_indexBox_of_le hr hN (hs y hy) hz) + simp only [hh,zero_smul,Pi.zero_apply] + +/-- The literal triangle defect over twelve positive refinements. -/ +def coarseDefect (N : ℕ) (h : ℂ → ℂ) (r : ℝ) (d : ℕ) (p : Grid N) : ℝ := + (∑ q : Grid N, coeff N d p q*scalarMass h r q)-scalarMass h (scale r d) p + +lemma direction_refine {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (d : ℕ) (p : Grid N) : + scalarMass h (scale r d) p • theta h (scale r d) p = + ∑ q : Grid N, (coeff N d p q*scalarMass h r q) • theta h r q := by + rw [show scalarMass h (scale r d) p • theta h (scale r d) p = + vectorMass h (scale r d) p from IntrinsicMarks.mass_direction 1 _] + rw [vectorMass_coeff hr hR hN hh hs] + apply Finset.sum_congr rfl + intro q _ + rw [mul_smul] + congr 1 + exact (IntrinsicMarks.mass_direction 1 _).symm + +lemma coarseDefect_nonneg {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (d : ℕ) (p : Grid N) : + 0 ≤ coarseDefect N h r d p := by + have he := VectorRefinement.quadratic_defect (coeff N d p) (fun q : Grid N => scalarMass h r q) + (fun q : Grid N => theta h r q) (theta h (scale r d) p) (scalarMass h (scale r d) p) + (norm_theta _ _ _) (fun _ => norm_theta _ _ _) (direction_refine hr hR hN hh hs d p) + rw [coarseDefect,he] + apply mul_nonneg (by norm_num) + exact Finset.sum_nonneg fun q _ => + mul_nonneg (mul_nonneg (coeff_nonneg _ _ _ _) (norm_nonneg _)) (sq_nonneg _) + +lemma coarseDefect_sum (N : ℕ) (h : ℂ → ℂ) (r : ℝ) (d : ℕ) : + (∑ p : Grid N, coarseDefect N h r d p) = + (∑ q : Grid N, scalarMass h r q)-(∑ p : Grid N, scalarMass h (scale r d) p) := by + simp only [coarseDefect,Finset.sum_sub_distrib] + congr 1 + rw [Finset.sum_comm] + simp_rw [← Finset.sum_mul,coeff_column,one_mul] + +def parent (N : ℕ) (q : Grid N) : Grid N := ⟨nearParent q,nearParent_mem q.property⟩ + +/-- The actual maximally differing neighbor spends true vector cancellation, +not an independently postulated directional budget. -/ +lemma neighbor_charge {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (q : Grid N) : + scalarMass h r q*energy h r q ≤ 48*coarseDefect N h r 12 (parent N q) := by + by_cases hq : scalarMass h r q=0 + · rw [hq,zero_mul] + exact mul_nonneg (by norm_num) (coarseDefect_nonneg hr hR hN hh hs 12 _) + have hqpos : 0 < scalarMass h r q := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hq) + let z := chosen h r (worstVertex h r q) + have hz := worst_chosen_spec hr h q + have hzpos : 0 < scalarMass h r z := hqpos.trans_le hz.1 + have hzmem : z ∈ indexBox N := vectorMass_mem_grid hr hN hs (norm_ne_zero_iff.mp (ne_of_gt hzpos)) + let s : Grid N := ⟨z,hzmem⟩ + have hweights := nearParent_hat_lower hr q z hz.2 + have hwq : 1/4 ≤ coeff N 12 (parent N q) q := by + rw [coeff_eq_hat hr] + exact hweights.1 + have hws : 9/64 ≤ coeff N 12 (parent N q) s := by + rw [coeff_eq_hat hr] + exact hweights.2 + have he := VectorRefinement.pair_defect_bound (coeff N 12 (parent N q)) + (fun p : Grid N => scalarMass h r p) (fun p : Grid N => theta h r p) + (theta h (scale r 12) (parent N q)) (scalarMass h (scale r 12) (parent N q)) + (fun p => coeff_nonneg N 12 _ p) (fun _ => norm_nonneg _) + (norm_theta _ _ _) (fun _ => norm_theta _ _ _) + (direction_refine hr hR hN hh hs 12 _) hwq hws hz.1 + change scalarMass h r q*‖theta h r z-theta h r q‖^2 ≤ _ + rw [norm_sub_rev] + exact he + +lemma parent_fiber_card (N : ℕ) (p : Grid N) : + (Finset.univ.filter (fun q : Grid N => parent N q=p)).card ≤ 4097^2 := by + let F := Finset.univ.filter (fun q : Grid N => parent N q=p) + let e : Grid N ↪ ℤ × ℤ := ⟨Subtype.val,Subtype.val_injective⟩ + have hm : F.map e ⊆ (indexBox N).filter (fun q => nearParent q=p.val) := by + intro q hq + obtain ⟨s,hs,rfl⟩ := Finset.mem_map.mp hq + apply Finset.mem_filter.mpr + exact ⟨s.property,congrArg Subtype.val (Finset.mem_filter.mp hs).2⟩ + calc + _ = (F.map e).card := (Finset.card_map e).symm + _ ≤ ((indexBox N).filter (fun q => nearParent q=p.val)).card := Finset.card_le_card hm + _ ≤ 4097^2 := nearParent_fiber_card _ _ + +lemma parent_sum_bound (N : ℕ) (a : Grid N → ℝ) (ha : ∀ p, 0 ≤ a p) : + (∑ q : Grid N, a (parent N q)) ≤ (4097:ℝ)^2*∑ p : Grid N, a p := by + rw [← Finset.sum_fiberwise Finset.univ (parent N) (fun q => a (parent N q)),Finset.mul_sum] + apply Finset.sum_le_sum + intro p _ + calc + _ = ∑ q ∈ Finset.univ.filter (fun q => parent N q=p), a p := by + apply Finset.sum_congr rfl + intro q hq + rw [(Finset.mem_filter.mp hq).2] + _ = ((Finset.univ.filter (fun q => parent N q=p)).card:ℝ)*a p := by simp + _ ≤ (4097:ℝ)^2*a p := by + apply mul_le_mul_of_nonneg_right _ (ha p) + exact_mod_cast parent_fiber_card N p + +/-- Uniform one-scale neighbor energy bound by the actual twelve-scale mass drop. -/ +theorem level_energy_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) : + (∑ q : Grid N, scalarMass h r q*energy h r q) ≤ + (48*(4097:ℝ)^2)*((∑ q : Grid N, scalarMass h r q)- + ∑ p : Grid N, scalarMass h (scale r 12) p) := by + have h1 := Finset.sum_le_sum (fun q (_ : q ∈ (Finset.univ : Finset (Grid N))) => + neighbor_charge hr hR hN hh hs q) + have h2 := parent_sum_bound N (coarseDefect N h r 12) + (fun p => coarseDefect_nonneg hr hR hN hh hs 12 p) + rw [← Finset.mul_sum] at h1 + have h3 := h1.trans (mul_le_mul_of_nonneg_left h2 (by norm_num : (0:ℝ) ≤ 48)) + rw [coarseDefect_sum] at h3 + simpa only [mul_assoc] using h3 + +end DirectionNeighbors + +namespace DirectionNeighbors +open DyadicHats +lemma scale_scale (r : ℝ) (k d : ℕ) : scale (scale r k) d = scale r (k+d) := by + simp only [scale,pow_add] + ring + +lemma shifted_mass_bound (A : ℕ → ℝ) {V : ℝ} (h0 : ∀ k, 0 ≤ A k) + (hV : ∀ k, A k ≤ V) (m d : ℕ) : + (∑ k ∈ Finset.range m, (A k-A (k+d))) ≤ d*V := by + have he : (∑ k ∈ Finset.range m, A k)+(∑ k ∈ Finset.range d, A (k+m)) = + (∑ k ∈ Finset.range d, A k)+(∑ k ∈ Finset.range m, A (k+d)) := by + calc + _ = ∑ k ∈ Finset.range (m+d), A k := by + simpa only [Nat.add_comm] using (Finset.sum_range_add A m d).symm + _ = ∑ k ∈ Finset.range (d+m), A k := by rw [Nat.add_comm m d] + _ = _ := by simpa only [Nat.add_comm] using Finset.sum_range_add A d m + have hprefix : (∑ k ∈ Finset.range d, A k) ≤ d*V := by + calc + _ ≤ ∑ _k ∈ Finset.range d, V := Finset.sum_le_sum (fun k _ => hV k) + _ = _ := by simp + have htail : 0 ≤ ∑ k ∈ Finset.range d, A (k+m) := Finset.sum_nonneg (fun k _ => h0 _) + rw [Finset.sum_sub_distrib] + linarith + +theorem neighbor_energy_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) : + (∑ k ∈ Finset.range m, ∑ q : Grid N, + scalarMass h (scale r k) q*energy h (scale r k) q) ≤ + (576*(4097:ℝ)^2)*(∫ y, ‖h y‖) := by + let A := fun k => ∑ q : Grid N, scalarMass h (scale r k) q + have he (k : ℕ) : + (∑ q : Grid N, scalarMass h (scale r k) q*energy h (scale r k) q) ≤ + (48*(4097:ℝ)^2)*(A k-A (k+12)) := by + simpa only [scale_scale] using level_energy_budget (scale_pos hr k) hR + (scale_index_bound hr hR hN k) hh hs + have hsum := Finset.sum_le_sum (fun k (_ : k ∈ Finset.range m) => he k) + rw [← Finset.mul_sum] at hsum + have hA0 (k : ℕ) : 0 ≤ A k := Finset.sum_nonneg (fun _ _ => norm_nonneg _) + have hAV (k : ℕ) : A k ≤ ∫ y, ‖h y‖ := sum_scalarMass_grid_le hh _ + have hb := shifted_mass_bound A hA0 hAV m 12 + have hf := hsum.trans (mul_le_mul_of_nonneg_left hb (by positivity : (0:ℝ) ≤ 48*(4097:ℝ)^2)) + norm_num at hf ⊢ + nlinarith only [hf] +end DirectionNeighbors + +/-! Actual fixed palette and literal cone coordinates. -/ + +open MeasureTheory Set +open scoped RealInnerProductSpace +noncomputable section +namespace ConeCoordinates + +def axis (n : ℂ) (s : ℝ) : ℂ := (Real.sqrt 3/2) • n + (s/2) • (Complex.I*n) +def coordinate (n : ℂ) (s : ℝ) : ℂ →L[ℝ] ℝ := + (1 / Real.sqrt 3) • innerSL ℝ n + s • innerSL ℝ (Complex.I*n) + +lemma sqrt3_pos : 0 < Real.sqrt 3 := Real.sqrt_pos.2 (by norm_num) +lemma sqrt3_sq : (Real.sqrt 3)^2 = 3 := Real.sq_sqrt (by norm_num) +lemma sqrt3_bounds : 3/2 ≤ Real.sqrt 3 ∧ Real.sqrt 3 ≤ 2 := by + have := sqrt3_sq + have := sqrt3_pos + constructor <;> nlinarith +lemma inner_re (n z : ℂ) : inner ℝ n z = (star n*z).re := by + simp [real_inner_eq_re_inner ℂ, RCLike.inner_apply, Complex.mul_re] + ring +lemma inner_im (n z : ℂ) : inner ℝ (Complex.I*n) z = (star n*z).im := by + simp [real_inner_eq_re_inner ℂ, RCLike.inner_apply, Complex.mul_re, Complex.mul_im] + ring +lemma mul_star_of_unit {n : ℂ} (hn : ‖n‖ = 1) : n * star n = 1 := by + simpa [Complex.normSq_eq_norm_sq, hn] using Complex.mul_conj n +lemma coordinate_apply (n z : ℂ) (s : ℝ) : + coordinate n s z = (star n*z).re / Real.sqrt 3 + s*(star n*z).im := by + change (1/Real.sqrt 3)*inner ℝ n z + s*inner ℝ (Complex.I*n) z = _ + rw [inner_re,inner_im] + ring +lemma expansion {n : ℂ} (hn : ‖n‖ = 1) (z : ℂ) : + coordinate n 1 z • axis n 1 + coordinate n (-1) z • axis n (-1) = z := by + have hs : Real.sqrt 3 ≠ 0 := ne_of_gt sqrt3_pos + have hz : n*(star n*z) = z := by rw [← mul_assoc,mul_star_of_unit hn,one_mul] + have he : coordinate n 1 z • axis n 1 + coordinate n (-1) z • axis n (-1) = + n*(star n*z) := by + apply Complex.ext <;> simp [axis,coordinate_apply,Complex.mul_re,Complex.mul_im] <;> field_simp <;> ring + exact he.trans hz +lemma axis_norm {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s^2 = 1) : + ‖axis n s‖ = 1 := by + have he : axis n s = (↑(Real.sqrt 3/2)+(↑s/2)*Complex.I)*n := by + apply Complex.ext <;> simp [axis,Complex.mul_re,Complex.mul_im]; ring + rw [he,norm_mul,hn,mul_one] + have hsq := sqrt3_sq + have h : Complex.normSq (↑(Real.sqrt 3/2)+(↑s/2)*Complex.I) = 1 := by + simp [Complex.normSq_apply,Complex.mul_re,Complex.mul_im] + nlinarith + have hn0 := norm_nonneg (↑(Real.sqrt 3/2)+(↑s/2)*Complex.I : ℂ) + rw [Complex.normSq_eq_norm_sq] at h + nlinarith +lemma inner_axis (n z : ℂ) (s : ℝ) : + inner ℝ (axis n s) z = Real.sqrt 3/2 * inner ℝ n z + s/2*inner ℝ (Complex.I*n) z := by + simp only [axis,inner_add_left,real_inner_smul_left] +lemma coordinate_norm_le {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : |s| ≤ 1) (z : ℂ) : + |coordinate n s z| ≤ 2 * ‖z‖ := by + have ha : |inner ℝ n z| ≤ ‖z‖ := by simpa [hn] using abs_real_inner_le_norm n z + have hb : |inner ℝ (Complex.I*n) z| ≤ ‖z‖ := by + simpa [norm_mul,hn] using abs_real_inner_le_norm (Complex.I*n) z + have hr : 1 / Real.sqrt 3 ≤ 1 := by rw [div_le_one sqrt3_pos]; linarith [sqrt3_bounds] + have hnon : 0 ≤ 1 / Real.sqrt 3 := (div_pos (by norm_num) sqrt3_pos).le + calc + |coordinate n s z| ≤ (1/Real.sqrt 3)*|inner ℝ n z| + |s| *|inner ℝ (Complex.I*n) z| := by + change |(1/Real.sqrt 3)*inner ℝ n z + s*inner ℝ (Complex.I*n) z| ≤ _ + simpa only [abs_mul,abs_of_nonneg hnon] using + abs_add_le ((1/Real.sqrt 3)*inner ℝ n z) (s*inner ℝ (Complex.I*n) z) + _ ≤ 1*‖z‖+1*‖z‖ := add_le_add (mul_le_mul hr ha (abs_nonneg _) (by norm_num)) + (mul_le_mul hs hb (abs_nonneg _) (by norm_num)) + _ = 2*‖z‖ := by ring + +/-- Closed sector between the literal two palette axes. -/ +def Good (n z : ℂ) : Prop := 0 ≤ coordinate n 1 z ∧ 0 ≤ coordinate n (-1) z + +lemma good_of_close {n z : ℂ} (hn : ‖n‖ = 1) (hclose : ‖z-n‖ ≤ 1/10) : Good n z := by + have ha : |inner ℝ n (z-n)| ≤ 1/10 := by + have h := abs_real_inner_le_norm n (z-n) + simp only [hn,one_mul] at h + exact h.trans hclose + have hb : |inner ℝ (Complex.I*n) (z-n)| ≤ 1/10 := by + have h := abs_real_inner_le_norm (Complex.I*n) (z-n) + simp only [norm_mul,Complex.norm_I,hn,one_mul] at h + exact h.trans hclose + have hin : inner ℝ n n = 1 := by simp [hn] + have hip : inner ℝ (Complex.I*n) n = 0 := by + rw [inner_im,show star n*n = 1 by simpa [mul_comm] using mul_star_of_unit hn] + simp + simp only [inner_sub_right,hin,hip,sub_zero] at ha hb + have hab := (abs_le.mp ha).1 + have hbb := abs_le.mp hb + have hs := sqrt3_bounds + have ha' : 1/10 ≤ inner ℝ n z / Real.sqrt 3 := by + apply (le_div_iff₀ sqrt3_pos).2 + nlinarith + change 0 ≤ (1/Real.sqrt 3)*inner ℝ n z + 1*inner ℝ (Complex.I*n) z ∧ + 0 ≤ (1/Real.sqrt 3)*inner ℝ n z + (-1)*inner ℝ (Complex.I*n) z + have hei : (1/Real.sqrt 3)*inner ℝ n z = inner ℝ n z / Real.sqrt 3 := by ring + rw [hei] + constructor <;> nlinarith + +lemma inner_quarter_self {n : ℂ} (hn : ‖n‖ = 1) : inner ℝ (Complex.I*n) n = 0 := by + rw [inner_im,show star n*n = 1 by simpa [mul_comm] using mul_star_of_unit hn] + simp +lemma axes_inner {n : ℂ} (hn : ‖n‖ = 1) : inner ℝ (axis n 1) (axis n (-1)) = 1/2 := by + rw [inner_axis] + simp only [axis,inner_add_right,real_inner_smul_right] + have hnn : inner ℝ n n = 1 := by simp [hn] + have hnp : inner ℝ n (Complex.I*n) = 0 := by rw [real_inner_comm]; exact inner_quarter_self hn + have hpn := inner_quarter_self hn + have hpp : inner ℝ (Complex.I*n) (Complex.I*n) = 1 := by simp [hn] + rw [hnn,hnp,hpn,hpp] + nlinarith [sqrt3_sq] +lemma norm_le_coords {n : ℂ} (hn : ‖n‖ = 1) (z : ℂ) : + ‖z‖ ≤ |inner ℝ n z|+|inner ℝ (Complex.I*n) z| := by + have hnorm : ‖star n*z‖ = ‖z‖ := by simp [hn] + rw [inner_re,inner_im,← hnorm] + exact Complex.norm_le_abs_re_add_abs_im _ + +theorem cone_algebra {n : ℂ} (hn : ‖n‖ = 1) (z : ℂ) : + ‖z‖ ≤ 12*(inner ℝ n z + max 0 (-inner ℝ (axis n 1) z) + + max 0 (-inner ℝ (axis n (-1)) z)) := by + let a := inner ℝ n z + let b := inner ℝ (Complex.I*n) z + let u := max 0 (-inner ℝ (axis n 1) z) + let v := max 0 (-inner ℝ (axis n (-1)) z) + have hu0 : 0 ≤ u := le_max_left _ _ + have hv0 : 0 ≤ v := le_max_left _ _ + have hu : -(Real.sqrt 3/2*a+1/2*b) ≤ u := by simpa only [u,v,a,b,inner_axis] using le_max_right 0 (-inner ℝ (axis n 1) z) + have hv : -(Real.sqrt 3/2*a+(-1)/2*b) ≤ v := by simpa only [u,v,a,b,inner_axis] using le_max_right 0 (-inner ℝ (axis n (-1)) z) + have hs := sqrt3_bounds + have ha : |a| ≤ 2*(a+u+v) := by + by_cases h : 0 ≤ a + · rw [abs_of_nonneg h]; linarith + · rw [abs_of_neg (lt_of_not_ge h)] + have hmul := mul_le_mul_of_nonpos_right hs.1 (le_of_not_ge h) + nlinarith + have hb : |b| ≤ 2*(u+v)+2*|a| := by + have haa : Real.sqrt 3*a ≤ 2*|a| := + (mul_le_mul_of_nonneg_left (le_abs_self a) sqrt3_pos.le).trans + (mul_le_mul_of_nonneg_right hs.2 (abs_nonneg a)) + apply abs_le.2 + constructor <;> linarith + have hz := norm_le_coords hn z + change ‖z‖ ≤ 12*(a+u+v) + change ‖z‖ ≤ |a|+|b| at hz + have := neg_le_abs a + linarith + +/-- A finite fixed palette, all members genuinely on the unit circle. -/ +structure Palette where + labels : Finset ℂ + unit : ∀ n ∈ labels, ‖n‖ = 1 + cover : ∀ z : ℂ, ‖z‖ = 1 → ∃ n ∈ labels, ‖z-n‖ < 1/2000 + +lemma exists_palette : Nonempty Palette := by + classical + let S := Metric.sphere (0 : ℂ) 1 + have hc : IsCompact S := isCompact_sphere 0 1 + obtain ⟨t,hts,htfin,ht⟩ := hc.elim_finite_subcover_image (fun n (_ : n ∈ S) => Metric.isOpen_ball (x := n) (ε := (1/2000:ℝ))) (by + intro z hz + exact Set.mem_iUnion₂.2 ⟨z,hz,by simp⟩) + refine ⟨⟨htfin.toFinset,?_,?_⟩⟩ + · intro n hn + simpa [S,Metric.mem_sphere,dist_zero_right] using hts (htfin.mem_toFinset.mp hn) + · intro z hz + have hzS : z ∈ S := by simpa [S,Metric.mem_sphere,dist_zero_right] using hz + obtain ⟨n,hn,hzn⟩ := Set.mem_iUnion₂.mp (ht hzS) + exact ⟨n,htfin.mem_toFinset.mpr hn,by simpa [Metric.mem_ball,dist_eq_norm] using hzn⟩ + +def fixedPalette : Palette := Classical.choice exists_palette + +def quantize (z : ℂ) (hz : ‖z‖ = 1) : {n : ℂ // n ∈ fixedPalette.labels} := + ⟨Classical.choose (fixedPalette.cover z hz), (Classical.choose_spec (fixedPalette.cover z hz)).1⟩ +lemma quantize_close (z : ℂ) (hz : ‖z‖ = 1) : ‖z-(quantize z hz : ℂ)‖ < 1/2000 := + (Classical.choose_spec (fixedPalette.cover z hz)).2 + +end ConeCoordinates + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks Finset + +def tree {N : ℕ} (v : Grid N → ℂ) : ℕ → ℝ → Grid N → Tree (Grid N) ℂ + | 0,b,p => .leaf (b • v p) + | k+1,b,p => .branch (fun q => tree v k (b*step p q) q) + +lemma vector_tree {N : ℕ} (v : Grid N → ℂ) (k : ℕ) (b : ℝ) (p : Grid N) : + vector (tree v k b p) = b • ∑ q : Grid N, coeff N k p q • v q := by + induction k generalizing b p with + | zero => simp [tree,vector,coeff] + | succ k ih => + simp only [tree,vector,ih,coeff,smul_sum,sum_smul,smul_smul] + rw [Finset.sum_comm] + apply sum_congr rfl + intro q hq + apply sum_congr rfl + intro a ha + congr 1 + ring + +lemma terminalMass_tree {N : ℕ} (v : Grid N → ℂ) (k : ℕ) {b : ℝ} (hb : 0 ≤ b) (p : Grid N) : + terminalMass (tree v k b p) = b * ∑ q : Grid N, coeff N k p q * ‖v q‖ := by + induction k generalizing b p with + | zero => simp [tree,terminalMass,coeff,Real.norm_eq_abs,abs_of_nonneg hb] + | succ k ih => + simp only [tree,terminalMass] + simp_rw [ih (mul_nonneg hb (step_nonneg _ _)),coeff,mul_sum,sum_mul] + rw [Finset.sum_comm] + apply sum_congr rfl + intro q hq + rw [mul_sum] + apply sum_congr rfl + intro a ha + ring + +lemma sum_terminalMass {N : ℕ} (v : Grid N → ℂ) (k : ℕ) : + (∑ p : Grid N, terminalMass (tree v k 1 p)) = ∑ q : Grid N, ‖v q‖ := by + simp_rw [terminalMass_tree v k (by norm_num : (0:ℝ) ≤ 1),one_mul] + rw [Finset.sum_comm] + simp_rw [← sum_mul,coeff_column,one_mul] + +lemma vector_actual {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (b : ℝ) (p : Grid N) : + vector (tree (fun q : Grid N => vectorMass h r q) k b p) = + b • vectorMass h (scale r k) p := by + rw [vector_tree,← vectorMass_coeff hr hR hN hh hs] + +/-- The actual finite dyadic vector forest satisfies the intrinsic mark budget. +The roots, terminal masses and every intermediate vector are their true hat +integrals; no abstract mark budget is supplied as a hypothesis. -/ +theorem mark_budget {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) (k : ℕ) + {δ : ℝ} (hδ : 0 < δ) : + (∑ p : Grid N, costWithRoot (1:ℂ) δ + (tree (fun q : Grid N => vectorMass h r q) k 1 p)) ≤ + (1+2/δ^2)*(∫ y, ‖h y‖) := by + calc + _ ≤ ∑ p : Grid N, (1+2/δ^2)*terminalMass + (tree (fun q : Grid N => vectorMass h r q) k 1 p) := + sum_le_sum (fun _ _ => costWithRoot_le (by simp) hδ _) + _ = (1+2/δ^2)*(∑ q : Grid N, scalarMass h r q) := by + rw [← mul_sum,sum_terminalMass] + rfl + _ ≤ _ := mul_le_mul_of_nonneg_left (sum_scalarMass_grid_le hh r) (by positivity) + +end ActualMarkTrees + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/DirectionLaws.lean b/lean/OAI/Analysis/DiskMaximal/DirectionLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f87bc8a0af82b839d976857f4768adfbb8d0996 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/DirectionLaws.lean @@ -0,0 +1,977 @@ +import OAI.Analysis.DiskMaximal.Refinement + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology + +noncomputable section + +namespace DyadicHats +open scoped BigOperators + +lemma step_support {r : ℝ} (_hr : 0 < r) {p q : ℤ × ℤ} (hw : step p q ≠ 0) : + Function.support (hat r q) ⊆ Function.support (hat (2*r) p) := by + have hq : q ∈ children p := by + by_contra hn + exact hw (step_zero_of_not_child hn) + intro x hx + have hpos : 0 < step p q*hat r q x := mul_pos + (lt_of_le_of_ne (step_nonneg p q) (Ne.symm hw)) + (lt_of_le_of_ne (hat_nonneg r q x) (Ne.symm hx)) + have hle : step p q*hat r q x ≤ hat (2*r) p x := by + rw [hat_refine_finite] + exact Finset.single_le_sum (fun s _ => mul_nonneg (step_nonneg p s) (hat_nonneg r s x)) hq + exact ne_of_gt (hpos.trans_le hle) + +variable {N : ℕ} +def weights (N : ℕ) : ℕ → Grid N → Grid N → ℝ := fun _ p q => step p q +def pieces (N : ℕ) (r : ℝ) (h : ℂ → ℝ) : Grid N → ℂ → ℝ := fun q x => hat r q x*h x + +def densityRoot (N : ℕ) (r : ℝ) (h : ℂ → ℝ) := + ScalarCancellation.roots volume (weights N) (pieces N r h) +def densityError (N : ℕ) (r : ℝ) (h : ℂ → ℝ) := + ScalarCancellation.errors volume (weights N) (pieces N r h) + +lemma pieces_integrable {h : ℂ → ℝ} (hh : Integrable h) (r : ℝ) (q : Grid N) : + Integrable (pieces N r h q) := integrable_hat_mul hh r q + +lemma refined_eq_density {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + (k : ℕ) (q : Grid N) (x : ℂ) : + ScalarCancellation.refined (weights N) (pieces N r h) k q x = hat (scale r k) q x*h x := by + induction k generalizing q with + | zero => simp only [ScalarCancellation.refined,pieces,scale,pow_zero,one_mul] + | succ k ih => + simp only [ScalarCancellation.refined,weights,ih,scale_succ] + exact (density_refine_grid (scale_pos hr k) (scale_index_bound hr hR hN k) hs q x).symm + +lemma densityRoot_integrable {h : ℂ → ℝ} (hh : Integrable h) (r : ℝ) (k : ℕ) (q : Grid N) : + Integrable (densityRoot N r h k q) := + ScalarCancellation.roots_integrable _ (pieces_integrable hh r) k q +lemma densityError_integrable {h : ℂ → ℝ} (hh : Integrable h) (r : ℝ) (k : ℕ) (q : Grid N) : + Integrable (densityError N r h k q) := + ScalarCancellation.errors_integrable _ (pieces_integrable hh r) k q +lemma densityError_zero_mass {h : ℂ → ℝ} (hh : Integrable h) (r : ℝ) (k : ℕ) (q : Grid N) : + (∫ x, densityError N r h k q x) = 0 := + ScalarCancellation.errors_zero_mass _ (pieces_integrable hh r) k q + +lemma densityRoot_mass {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + (∫ x, densityRoot N r h k q x) = ∫ x, hat (scale r k) q x*h x := by + have he := ScalarCancellation.roots_mass (weights N) (pieces_integrable hh r) k q + simpa only [densityRoot,refined_eq_density hr hR hN hs] using he + +lemma densityRoot_abs_mass {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + (∫ x, |densityRoot N r h k q x|) = |∫ x, hat (scale r k) q x*h x| := by + have he := ScalarCancellation.roots_abs_mass (weights N) (pieces_integrable hh r) k q + simpa only [densityRoot,refined_eq_density hr hR hN hs] using he + +lemma density_support {r : ℝ} (hr : 0 < r) {h : ℂ → ℝ} (hh : Integrable h) + (k : ℕ) (q : Grid N) (x : ℂ) (hx : hat (scale r k) q x = 0) : + densityRoot N r h k q x = 0 ∧ densityError N r h k q x = 0 := by + apply ScalarCancellation.roots_errors_support (weights N) (pieces_integrable hh r) + (fun k q => Function.support (hat (scale r k) q)) ?_ ?_ k q x (by simpa using hx) + · intro q y hy + have hz : hat r q y = 0 := by simpa [scale] using hy + simp only [pieces,hz,zero_mul] + · intro k p q hw + rw [scale_succ] + exact step_support (scale_pos hr k) hw + +def densityDefect (N : ℕ) (r : ℝ) (h : ℂ → ℝ) : ℕ → Grid N → ℝ + | 0,q => ((∫ x, hat r q x*|h x|)-|∫ x, hat r q x*h x|)/2 + | k+1,q => ((∑ s : Grid N, step q s*|∫ x, hat (scale r k) s x*h x|)- + |∫ x, hat (scale r (k+1)) q x*h x|)/2 + +lemma densityError_cost {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + (∫ x, |densityError N r h k q x|) ≤ 2*densityDefect N r h k q := by + cases k with + | zero => + have he := ScalarCancellation.errors_terminal_cost (weights N) (pieces_integrable hh r) q + simp only [pieces,abs_mul,abs_of_nonneg (hat_nonneg r q _)] at he + rw [densityDefect] + change (∫ x, |ScalarCancellation.errors volume (weights N) (pieces N r h) 0 q x|) ≤ _ + rw [he] + linarith + | succ k => + have he := ScalarCancellation.errors_cost (weights N) (fun _ p s => step_nonneg p s) + (pieces_integrable hh r) k q + simp only [refined_eq_density hr hR hN hs,weights] at he + change (∫ x, |ScalarCancellation.errors volume (weights N) (pieces N r h) (k+1) q x|) ≤ _ + rw [densityDefect] + linarith + +lemma densityError_total_cost {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (n : ℕ) : + (∑ k ∈ Finset.range (n+1), ∑ q : Grid N, ∫ x, |densityError N r h k q x|) ≤ ∫ x, |h x| := by + have he := ScalarCancellation.errors_total_cost_le (weights N) (fun _ p s => step_nonneg p s) + (fun _ q => grid_step_column N q) (pieces_integrable hh r) n + have hi : (∑ q : Grid N, ∫ x, |pieces N r h q x|) = ∫ x, |h x| := by + rw [← integral_finsetSum _ (fun q _ => (pieces_integrable hh r q).abs)] + apply integral_congr_ae + apply ae_of_all + intro x + simp only [pieces,abs_mul,abs_of_nonneg (hat_nonneg r _ x)] + apply density_partition_grid hr hN + intro y hy + exact hs y (fun hz => hy (by rw [hz,abs_zero])) + exact he.trans_eq hi + +end DyadicHats + +namespace DyadicHats +open Finset + +/-- Coherent refinement coefficients, evaluated by exact positive matrix +composition on the finite box. These are not row-stochastic transitions. -/ +def coeff (N : ℕ) : ℕ → Grid N → Grid N → ℝ + | 0,p,q => if p=q then 1 else 0 + | d+1,p,q => ∑ a : Grid N, step p a*coeff N d a q + +lemma coeff_nonneg (N d : ℕ) (p q : Grid N) : 0 ≤ coeff N d p q := by + induction d generalizing p with + | zero => simp only [coeff]; split_ifs <;> norm_num + | succ d ih => exact sum_nonneg fun a _ => mul_nonneg (step_nonneg p a) (ih a) + +lemma coeff_column (N d : ℕ) (q : Grid N) : (∑ p : Grid N, coeff N d p q) = 1 := by + induction d with + | zero => simp [coeff] + | succ d ih => + simp only [coeff] + rw [Finset.sum_comm] + simp_rw [← sum_mul,grid_step_column,one_mul] + exact ih + +/-- All lower-level error densities, with their actual coherent coefficients, +reconstruct the genuine coarse hat density exactly. -/ +theorem density_decomposition {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + (k : ℕ) (q : Grid N) (x : ℂ) : + hat (scale r k) q x*h x = densityRoot N r h k q x+ + ∑ j ∈ range (k+1), ∑ s : Grid N, coeff N (k-j) q s*densityError N r h j s x := by + rw [← refined_eq_density hr hR hN hs] + apply ScalarCancellation.telescoped_decomposition (weights N) (pieces N r h) + (fun k j p s => coeff N (k-j) p s) + · intro j p s + simp only [Nat.sub_self,coeff] + · intro k j p s hj + rw [show k+1-j = k-j+1 by omega,coeff] + rfl + +lemma terminal_abs_sum {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) : + (∑ q : Grid N, ∫ x, hat r q x*|h x|) = ∫ x, |h x| := by + rw [← integral_finsetSum (Finset.univ : Finset (Grid N)) (fun q _ => integrable_hat_mul hh.abs r q)] + apply integral_congr_ae + apply ae_of_all + intro x + apply density_partition_grid hr hN + intro y hy + exact hs y (fun hz => hy (by rw [hz,abs_zero])) + +lemma densityDefect_sum_succ (N : ℕ) (r : ℝ) (h : ℂ → ℝ) (k : ℕ) : + (∑ q : Grid N, densityDefect N r h (k+1) q) = + ((∑ q : Grid N, |∫ x, hat (scale r k) q x*h x|)- + (∑ q : Grid N, |∫ x, hat (scale r (k+1)) q x*h x|))/2 := by + simp only [densityDefect] + rw [← sum_div,sum_sub_distrib] + congr 2 + rw [Finset.sum_comm] + simp_rw [← sum_mul,grid_step_column,one_mul] + +/-- Exact telescoping of the literal scalar defects, including the finest +terminal split. No depth-dependent or terminal remainder is discarded. -/ +theorem densityDefect_budget_eq {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (n : ℕ) : + (∑ k ∈ range (n+1), ∑ q : Grid N, densityDefect N r h k q) = + ((∫ x, |h x|)-(∑ q : Grid N, |∫ x, hat (scale r n) q x*h x|))/2 := by + induction n with + | zero => + simp only [Nat.zero_add,range_one,sum_singleton,densityDefect, + scale,pow_zero,one_mul] + rw [← sum_div,sum_sub_distrib] + rw [terminal_abs_sum hr hN hh hs] + | succ n ih => + rw [sum_range_succ,ih,densityDefect_sum_succ] + ring + +lemma densityDefect_nonneg {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + 0 ≤ densityDefect N r h k q := by + have he := densityError_cost hr hR hN hh hs k q + have hn : 0 ≤ ∫ x, |densityError N r h k q x| := integral_nonneg (fun x => abs_nonneg _) + linarith + +lemma densityDefect_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (n : ℕ) : + (∑ k ∈ range (n+1), ∑ q : Grid N, densityDefect N r h k q) ≤ (∫ x, |h x|)/2 := by + rw [densityDefect_budget_eq hr hN hh hs] + have he : 0 ≤ ∑ q : Grid N, |∫ x, hat (scale r n) q x*h x| := sum_nonneg fun _ _ => abs_nonneg _ + linarith + +/-- The common scalar price assigned to a root. The geometric discount is +applied at the actual birth scale of each zero-mass error. -/ +def scalarPrice (N : ℕ) (r : ℝ) (h : ℂ → ℝ) (ρ : ℝ) (k : ℕ) (q : Grid N) : ℝ := + ∑ j ∈ range (k+1), ρ^(k-j)*∑ s : Grid N, coeff N (k-j) q s*densityDefect N r h j s + +lemma scalarPrice_sum (N : ℕ) (r : ℝ) (h : ℂ → ℝ) (ρ : ℝ) (k : ℕ) : + (∑ q : Grid N, scalarPrice N r h ρ k q) = + ∑ j ∈ range (k+1), ρ^(k-j)*∑ s : Grid N, densityDefect N r h j s := by + simp only [scalarPrice] + rw [Finset.sum_comm] + apply sum_congr rfl + intro j _ + rw [← mul_sum,Finset.sum_comm] + congr 1 + simp_rw [← sum_mul,coeff_column,one_mul] + +end DyadicHats + +namespace DyadicHats +open Finset + +lemma discount_recurrence (ρ : ℝ) (a : ℕ → ℝ) (k : ℕ) : + (∑ j ∈ range (k+2), ρ^(k+1-j)*a j) = + a (k+1)+ρ*(∑ j ∈ range (k+1), ρ^(k-j)*a j) := by + rw [sum_range_succ] + simp only [Nat.sub_self,pow_zero,one_mul,mul_sum] + rw [add_comm] + congr 1 + apply sum_congr rfl + intro j hj + rw [show k+1-j = (k-j)+1 by have := mem_range.mp hj; omega,pow_succ] + ring + +lemma triangle_discount_bound {ρ : ℝ} (hρ : 0 ≤ ρ) (hρ1 : ρ < 1) + {a : ℕ → ℝ} (ha : ∀ j, 0 ≤ a j) (n : ℕ) : + (∑ k ∈ range (n+1), ∑ j ∈ range (k+1), ρ^(k-j)*a j) ≤ + (1-ρ)⁻¹*∑ j ∈ range (n+1), a j := by + let b : ℕ → ℝ := fun k => ∑ j ∈ range (k+1), ρ^(k-j)*a j + have hb : ∀ k, 0 ≤ b k := fun k => sum_nonneg fun j _ => mul_nonneg (pow_nonneg hρ _) (ha j) + have hi : ∀ n, (1-ρ)*(∑ k ∈ range (n+1), b k) = + (∑ j ∈ range (n+1), a j)-ρ*b n := by + intro n + induction n with + | zero => simp [b]; ring + | succ n ih => + rw [sum_range_succ (f := b) (n := n+1),sum_range_succ (f := a) (n := n+1),mul_add,ih] + have he : b (n+1) = a (n+1)+ρ*b n := discount_recurrence ρ a n + rw [he] + ring + have hle : (1-ρ)*(∑ k ∈ range (n+1), b k) ≤ ∑ j ∈ range (n+1), a j := by + rw [hi] + exact sub_le_self _ (mul_nonneg hρ (hb n)) + rw [inv_mul_eq_div] + exact (le_div_iff₀ (sub_pos.mpr hρ1)).mpr (by rwa [mul_comm]) + +theorem scalarPrice_budget {N : ℕ} {r R ρ : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (hρ : 0 ≤ ρ) (hρ1 : ρ < 1) (n : ℕ) : + (∑ k ∈ range (n+1), ∑ q : Grid N, scalarPrice N r h ρ k q) ≤ + (1-ρ)⁻¹*((∫ x, |h x|)/2) := by + simp_rw [scalarPrice_sum] + apply (triangle_discount_bound hρ hρ1 + (fun j => sum_nonneg fun q _ => densityDefect_nonneg hr hR hN hh hs j q) n).trans + exact mul_le_mul_of_nonneg_left (densityDefect_budget hr hN hh hs n) + (inv_nonneg.mpr (sub_nonneg.mpr hρ1.le)) + +end DyadicHats + +namespace DyadicHats +open Finset + +def activeIndices (r : ℝ) (x : ℂ) : Finset (ℤ × ℤ) := + ({⌊x.re/r⌋,⌊x.re/r⌋+1} : Finset ℤ).product {⌊x.im/r⌋,⌊x.im/r⌋+1} + +lemma hat_zero_of_not_active (r : ℝ) (x : ℂ) {p : ℤ × ℤ} (hp : p ∉ activeIndices r x) : + hat r p x = 0 := by + have hp' : ¬(p.1 ∈ ({⌊x.re/r⌋,⌊x.re/r⌋+1} : Finset ℤ) ∧ + p.2 ∈ ({⌊x.im/r⌋,⌊x.im/r⌋+1} : Finset ℤ)) := fun hn => hp (mem_product.mpr hn) + rw [not_and_or] at hp' + rcases hp' with h|h + · simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at h + rw [hat,tent_eq_zero_of_ne_floor h.1 h.2,zero_mul] + · simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at h + rw [hat,tent_eq_zero_of_ne_floor h.1 h.2,mul_zero] + +lemma activeIndices_card (r : ℝ) (x : ℂ) : (activeIndices r x).card ≤ 4 := by + change (({⌊x.re/r⌋,⌊x.re/r⌋+1} : Finset ℤ) ×ˢ + ({⌊x.im/r⌋,⌊x.im/r⌋+1} : Finset ℤ)).card ≤ 4 + rw [Finset.card_product] + exact (Nat.mul_le_mul (card_insert_le ..) (card_insert_le ..)).trans (by simp) + +lemma summable_weighted_hat (r : ℝ) (x : ℂ) (f : ℤ × ℤ → ℝ) : + Summable (fun p => hat r p x*f p) := by + apply summable_of_ne_finset_zero (s := activeIndices r x) + intro p hp + rw [hat_zero_of_not_active r x hp,zero_mul] + +/-- The literal locally finite tent interpolation, indexed by the whole grid. -/ +def interpolate (r : ℝ) (f : ℤ × ℤ → ℝ) (x : ℂ) : ℝ := ∑' p, hat r p x*f p + +lemma interpolate_eq_sum (r : ℝ) (f : ℤ × ℤ → ℝ) (x : ℂ) + (S : Finset (ℤ × ℤ)) (hS : activeIndices r x ⊆ S) : + interpolate r f x = ∑ p ∈ S, hat r p x*f p := by + apply tsum_eq_sum + intro p hp + rw [hat_zero_of_not_active r x (fun hn => hp (hS hn)),zero_mul] + +lemma interpolate_add (r : ℝ) (f g : ℤ × ℤ → ℝ) (x : ℂ) : + interpolate r (fun p => f p+g p) x = interpolate r f x+interpolate r g x := by + simp only [interpolate,mul_add] + exact (summable_weighted_hat r x f).tsum_add (summable_weighted_hat r x g) +lemma interpolate_sub (r : ℝ) (f g : ℤ × ℤ → ℝ) (x : ℂ) : + interpolate r (fun p => f p-g p) x = interpolate r f x-interpolate r g x := by + simp only [interpolate,mul_sub] + exact (summable_weighted_hat r x f).tsum_sub (summable_weighted_hat r x g) +lemma interpolate_mul_const (r : ℝ) (f : ℤ × ℤ → ℝ) (x : ℂ) (c : ℝ) : + interpolate r (fun p => f p*c) x = interpolate r f x*c := by + simp only [interpolate,← mul_assoc,tsum_mul_right] +lemma interpolate_const (r : ℝ) (x : ℂ) (c : ℝ) : interpolate r (fun _ => c) x = c := by + rw [interpolate,tsum_mul_right,tsum_hat,one_mul] +lemma interpolate_nonneg (r : ℝ) (x : ℂ) {f : ℤ × ℤ → ℝ} (hf : ∀ p, 0 ≤ f p) : + 0 ≤ interpolate r f x := tsum_nonneg fun p => mul_nonneg (hat_nonneg r p x) (hf p) +lemma interpolate_mono (r : ℝ) (x : ℂ) {f g : ℤ × ℤ → ℝ} (h : ∀ p, f p ≤ g p) : + interpolate r f x ≤ interpolate r g x := by + exact Summable.tsum_le_tsum (fun p => mul_le_mul_of_nonneg_left (h p) (hat_nonneg r p x)) + (summable_weighted_hat r x f) (summable_weighted_hat r x g) +lemma interpolate_le_const (r : ℝ) (x : ℂ) {f : ℤ × ℤ → ℝ} {c : ℝ} (hf : ∀ p, f p ≤ c) : + interpolate r f x ≤ c := (interpolate_mono r x hf).trans_eq (interpolate_const r x c) + +lemma interpolate_finset_sum {ι : Type*} (s : Finset ι) (r : ℝ) + (f : ι → ℤ × ℤ → ℝ) (x : ℂ) : + interpolate r (fun p => ∑ i ∈ s, f i p) x = ∑ i ∈ s, interpolate r (f i) x := by + simp only [interpolate,mul_sum] + exact Summable.tsum_finsetSum (fun i _ => summable_weighted_hat r x (f i)) + +/-- Only eight tents can contribute to a difference of two interpolated values. +This is the quantitative global Lipschitz bound with no grid cardinality loss. -/ +theorem interpolate_lipschitz {r B : ℝ} (hr : 0 < r) (hB : 0 ≤ B) + {f : ℤ × ℤ → ℝ} (hf : ∀ p, |f p| ≤ B) : + LipschitzWith (Real.toNNReal (16*B/r)) (interpolate r f) := by + rw [lipschitzWith_iff_dist_le_mul] + intro x y + let S := activeIndices r x ∪ activeIndices r y + have hcard : S.card ≤ 8 := (Finset.card_union_le (activeIndices r x) (activeIndices r y)).trans + (by have := activeIndices_card r x; have := activeIndices_card r y; omega) + have hsum : |interpolate r f x-interpolate r f y| ≤ + (S.card:ℝ)*((2/r)*‖x-y‖*B) := by + rw [interpolate_eq_sum r f x S subset_union_left,interpolate_eq_sum r f y S subset_union_right, + ← sum_sub_distrib] + calc + _ ≤ ∑ p ∈ S, |hat r p x*f p-hat r p y*f p| := abs_sum_le_sum_abs _ _ + _ ≤ ∑ _p ∈ S, (2/r)*‖x-y‖*B := by + apply sum_le_sum + intro p _ + rw [← sub_mul,abs_mul] + have hb := (lipschitz_hat hr p).dist_le_mul x y + rw [Real.dist_eq,Real.coe_toNNReal (2/r) (by positivity),dist_eq_norm] at hb + exact mul_le_mul hb (hf p) (abs_nonneg _) (by positivity) + _ = _ := by rw [sum_const,nsmul_eq_mul] + rw [Real.dist_eq,Real.coe_toNNReal (16*B/r) (by positivity),dist_eq_norm] + have hcard' : (S.card:ℝ) ≤ 8 := by exact_mod_cast hcard + calc + _ ≤ (8:ℝ)*((2/r)*‖x-y‖*B) := hsum.trans (mul_le_mul_of_nonneg_right hcard' (by positivity)) + _ = _ := by ring + +end DyadicHats + +namespace FiniteLabels +open DyadicHats +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +lemma delta_diff_le_one (i j k : ι) : |delta i k-delta j k| ≤ 1 := by + exact abs_sub_le_iff.mpr ⟨by linarith [(delta i).nonneg k,law_le_one (delta i) k,(delta j).nonneg k], + by linarith [(delta j).nonneg k,law_le_one (delta j) k,(delta i).nonneg k]⟩ + +/-- The actual locally finite transition row on the entire spatial grid. -/ +def spatialRow (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (r : ℝ) (x : ℂ) : Law ι where + mass j := delta old j+interpolate r (fun z => p z*(delta (target z) j-delta old j)) x + nonneg j := by + simp only [mul_sub,interpolate_sub,interpolate_mul_const] + have h0 := interpolate_nonneg r x hp0 + have h1 := interpolate_le_const r x hp1 + have h2 := interpolate_nonneg r x (fun z => mul_nonneg (hp0 z) ((delta (target z)).nonneg j)) + have hd := (delta old).nonneg j + nlinarith + total := by + rw [sum_add_distrib,(delta old).total,← interpolate_finset_sum] + have he : (fun z => ∑ j : ι, p z*(delta (target z) j-delta old j)) = fun _ => 0 := by + funext z + rw [← mul_sum,sum_sub_distrib,(delta _).total,(delta _).total,sub_self,mul_zero] + rw [he,interpolate_const,add_zero] + +lemma spatialRow_formula (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (r : ℝ) (x : ℂ) (j : ι) : + spatialRow old target p hp0 hp1 r x j = + delta old j+interpolate r (fun z => p z*(delta (target z) j-delta old j)) x := rfl + +lemma spatialRow_component_lipschitz (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) {r B : ℝ} (hr : 0 < r) (hB : 0 ≤ B) + (hpB : ∀ z, p z ≤ B) (j : ι) : + LipschitzWith (Real.toNNReal (16*B/r)) (fun x => spatialRow old target p hp0 hp1 r x j) := by + have hl := interpolate_lipschitz hr hB (f := fun z => p z*(delta (target z) j-delta old j)) + (fun z => by rw [abs_mul,abs_of_nonneg (hp0 z)]; exact + (mul_le_mul_of_nonneg_left (delta_diff_le_one _ _ _) (hp0 z)).trans (by simpa using hpB z)) + change LipschitzWith (Real.toNNReal (16*B/r)) + (fun x => delta old j+interpolate r (fun z => p z*(delta (target z) j-delta old j)) x) + simpa only [zero_add] using (LipschitzWith.const (delta old j)).add hl + +lemma spatialRow_distance (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) {r B : ℝ} (hr : 0 < r) (hB : 0 ≤ B) + (hpB : ∀ z, p z ≤ B) (x y : ℂ) : + l1dist (spatialRow old target p hp0 hp1 r x) (spatialRow old target p hp0 hp1 r y) ≤ + (Fintype.card ι:ℝ)*(16*B/r)*‖x-y‖ := by + unfold l1dist + calc + _ ≤ ∑ _j : ι, (16*B/r)*‖x-y‖ := by + apply sum_le_sum + intro j _ + have hl := (spatialRow_component_lipschitz old target p hp0 hp1 hr hB hpB j).dist_le_mul x y + rw [Real.dist_eq,Real.coe_toNNReal (16*B/r) (by positivity),dist_eq_norm] at hl + exact hl + _ = _ := by rw [sum_const,card_univ,nsmul_eq_mul,mul_assoc] + +end FiniteLabels + +namespace DyadicHats +open Finset Filter + +lemma interpolate_congr_on (r : ℝ) (x : ℂ) {f g : ℤ × ℤ → ℝ} + (h : ∀ p, hat r p x ≠ 0 → f p = g p) : interpolate r f x = interpolate r g x := by + apply tsum_congr + intro p + by_cases hp : hat r p x = 0 + · simp only [hp,zero_mul] + · rw [h p hp] + +lemma interpolate_mono_on (r : ℝ) (x : ℂ) {f g : ℤ × ℤ → ℝ} + (h : ∀ p, hat r p x ≠ 0 → f p ≤ g p) : interpolate r f x ≤ interpolate r g x := by + apply Summable.tsum_le_tsum _ (summable_weighted_hat r x f) (summable_weighted_hat r x g) + intro p + by_cases hp : hat r p x = 0 + · simp only [hp,zero_mul,le_refl] + · exact mul_le_mul_of_nonneg_left (h p hp) (hat_nonneg r p x) + +lemma hat_vertex_local {r : ℝ} (hr : 0 < r) {x q : ℂ} + (hx : boxNorm (x-q) < 199*r) {p : ℤ × ℤ} (hp : hat r p x ≠ 0) : + boxNorm (point r p-q) ≤ 200*r := by + have hd := (hat_ne_zero_iff hr p x).mp hp + have ht := boxNorm_add_le (point r p-x) (x-q) + rw [sub_add_sub_cancel,boxNorm_sub_comm (point r p) x] at ht + linarith + +lemma continuous_boxNorm : Continuous boxNorm := + (Complex.continuous_re.abs).max (Complex.continuous_im.abs) + +lemma local_neighborhood {r : ℝ} {q x : ℂ} (hx : boxNorm (x-q) < 199*r) : + ∀ᶠ y in 𝓝 x, boxNorm (y-q) < 199*r := by + exact ((continuous_boxNorm.comp (continuous_id.sub continuous_const)).continuousAt.eventually + (eventually_lt_nhds hx)) + +def truncate (r : ℝ) (q : ℂ) (p : ℤ × ℤ → ℝ) (z : ℤ × ℤ) : ℝ := + if boxNorm (point r z-q) ≤ 200*r then p z else 0 + +lemma truncate_nonneg (r : ℝ) (q : ℂ) {p : ℤ × ℤ → ℝ} (hp : ∀ z, 0 ≤ p z) (z : ℤ × ℤ) : + 0 ≤ truncate r q p z := by unfold truncate; split_ifs <;> simp [hp] +lemma truncate_le {r B : ℝ} {q : ℂ} {p : ℤ × ℤ → ℝ} (hB : 0 ≤ B) + (hp : ∀ z, boxNorm (point r z-q) ≤ 200*r → p z ≤ B) (z : ℤ × ℤ) : + truncate r q p z ≤ B := by unfold truncate; split_ifs with h; exact hp z h; exact hB +lemma interpolate_truncate {r : ℝ} (hr : 0 < r) {q x : ℂ} + (hx : boxNorm (x-q) < 199*r) (p : ℤ × ℤ → ℝ) : + interpolate r (truncate r q p) x = interpolate r p x := by + apply interpolate_congr_on + intro z hz + exact ite_eq_left (hat_vertex_local hr hx hz) + +end DyadicHats + +namespace FiniteLabels +open DyadicHats Finset Filter +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +lemma spatialRow_truncate (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) {r : ℝ} (hr : 0 < r) {q x : ℂ} + (hx : boxNorm (x-q) < 199*r) (j : ι) : + spatialRow old target (truncate r q p) (truncate_nonneg r q hp0) + (truncate_le (by norm_num) (fun z _ => hp1 z)) r x j = + spatialRow old target p hp0 hp1 r x j := by + rw [spatialRow_formula,spatialRow_formula] + congr 1 + apply interpolate_congr_on + intro z hz + rw [truncate,ite_eq_left (hat_vertex_local hr hx hz)] + +lemma spatialRow_local_distance (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) {r B : ℝ} (hr : 0 < r) (hB : 0 ≤ B) + {q x y : ℂ} (hx : boxNorm (x-q) < 199*r) (hy : boxNorm (y-q) < 199*r) + (hpB : ∀ z, boxNorm (point r z-q) ≤ 200*r → p z ≤ B) : + l1dist (spatialRow old target p hp0 hp1 r x) (spatialRow old target p hp0 hp1 r y) ≤ + (Fintype.card ι:ℝ)*(16*B/r)*‖x-y‖ := by + have h := spatialRow_distance old target (truncate r q p) (truncate_nonneg r q hp0) + (truncate_le (by norm_num) (fun z _ => hp1 z)) hr hB (truncate_le hB hpB) x y + simpa only [l1dist,spatialRow_truncate old target p hp0 hp1 hr hx, + spatialRow_truncate old target p hp0 hp1 hr hy] using h + +/-- The derivative cost is bounded by the local switched mass, with a constant +fixed by the finite palette, rather than by the number of scales or vertices. -/ +lemma spatialRow_local_derivative (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) {r B : ℝ} (hr : 0 < r) (hB : 0 ≤ B) + {q x : ℂ} (hx : boxNorm (x-q) < 199*r) + (hpB : ∀ z, boxNorm (point r z-q) ≤ 200*r → p z ≤ B) : + r*∑ j : ι, ‖gradient (fun y => spatialRow old target p hp0 hp1 r y j) x‖ ≤ + 16*(Fintype.card ι:ℝ)*B := by + have hb (j : ι) : ‖gradient (fun y => spatialRow old target p hp0 hp1 r y j) x‖ ≤ 16*B/r := by + have he : (fun y => spatialRow old target (truncate r q p) (truncate_nonneg r q hp0) + (truncate_le (by norm_num) (fun z _ => hp1 z)) r y j) =ᶠ[𝓝 x] + (fun y => spatialRow old target p hp0 hp1 r y j) := by + filter_upwards [local_neighborhood hx] with y hy + exact spatialRow_truncate old target p hp0 hp1 hr hy j + have hl := spatialRow_component_lipschitz old target (truncate r q p) (truncate_nonneg r q hp0) + (truncate_le (by norm_num) (fun z _ => hp1 z)) hr hB (truncate_le hB hpB) j + have hd := he.fderiv_eq (𝕜 := ℝ) + have hn := norm_fderiv_le_of_lipschitz ℝ (x₀ := x) hl + rw [hd,Real.coe_toNNReal (16*B/r) (by positivity)] at hn + simpa only [gradient,(InnerProductSpace.toDual ℝ ℂ).symm.norm_map] using hn + calc + _ ≤ r*∑ _j : ι, 16*B/r := mul_le_mul_of_nonneg_left (sum_le_sum (fun j _ => hb j)) hr.le + _ = _ := by rw [sum_const,card_univ,nsmul_eq_mul]; field_simp + +end FiniteLabels + +namespace FiniteLabels + +def probability (τ d : ℝ) : ℝ := min 1 ((τ⁻¹*max (d-τ) 0)^2) +def amplitude (τ d : ℝ) : ℝ := min 1 (τ⁻¹*max (d-τ) 0) + +lemma probability_formula (τ d : ℝ) : + probability τ d = min 1 (τ^(-2:ℤ)*max (d-τ) 0^2) := by + simp only [probability,mul_pow,zpow_neg,zpow_ofNat,inv_pow] + +lemma amplitude_nonneg {τ : ℝ} (hτ : 0 ≤ τ) (d : ℝ) : 0 ≤ amplitude τ d := + le_min (by norm_num) (mul_nonneg (inv_nonneg.mpr hτ) (le_max_right _ _)) +lemma amplitude_le_one (τ d : ℝ) : amplitude τ d ≤ 1 := min_le_left _ _ +lemma probability_nonneg (τ d : ℝ) : 0 ≤ probability τ d := le_min (by norm_num) (sq_nonneg _) +lemma probability_le_one (τ d : ℝ) : probability τ d ≤ 1 := min_le_left _ _ + +lemma probability_eq_square {τ : ℝ} (hτ : 0 ≤ τ) (d : ℝ) : + probability τ d = amplitude τ d^2 := by + have hx : 0 ≤ τ⁻¹*max (d-τ) 0 := mul_nonneg (inv_nonneg.mpr hτ) (le_max_right _ _) + unfold probability amplitude + by_cases h : τ⁻¹*max (d-τ) 0 ≤ 1 + · rw [min_eq_right h,min_eq_right (by nlinarith)] + · rw [min_eq_left (le_of_not_ge h),min_eq_left (by nlinarith)] + norm_num + +lemma amplitude_lipschitz {τ : ℝ} (hτ : 0 < τ) : + LipschitzWith (Real.toNNReal τ⁻¹) (amplitude τ) := by + have hid : LipschitzWith 1 (fun d : ℝ => d-τ) := by + rw [lipschitzWith_iff_dist_le_mul] + intro x y + simp only [NNReal.coe_one,one_mul,Real.dist_eq,sub_sub_sub_cancel_right,le_refl] + have hmax : LipschitzWith 1 (fun d : ℝ => max (d-τ) 0) := by + simpa only [max_eq_left (by norm_num : (0:ℝ≥0) ≤ 1)] using hid.max (LipschitzWith.const 0) + have hm : LipschitzWith (Real.toNNReal τ⁻¹) (fun d : ℝ => τ⁻¹*max (d-τ) 0) := by + rw [lipschitzWith_iff_dist_le_mul] + intro d d' + rw [Real.dist_eq,Real.dist_eq,← mul_sub,abs_mul, + abs_of_nonneg (inv_nonneg.mpr hτ.le),Real.coe_toNNReal _ (inv_nonneg.mpr hτ.le)] + have hl := hmax.dist_le_mul d d' + simp only [Real.dist_eq,NNReal.coe_one,one_mul] at hl + exact mul_le_mul_of_nonneg_left hl (inv_nonneg.mpr hτ.le) + rw [lipschitzWith_iff_dist_le_mul] + intro x y + change dist (min 1 (τ⁻¹*max (x-τ) 0)) (min 1 (τ⁻¹*max (y-τ) 0)) ≤ _ + simpa only [max_eq_right (by positivity : (0:ℝ≥0) ≤ Real.toNNReal τ⁻¹)] using + ((LipschitzWith.const (1:ℝ)).min hm).dist_le_mul x y + +lemma probability_compare {τ : ℝ} (hτ : 0 < τ) (d d' : ℝ) : + probability τ d ≤ 2*probability τ d'+2*τ⁻¹^2*|d-d'|^2 := by + rw [probability_eq_square hτ.le,probability_eq_square hτ.le] + have hl := (amplitude_lipschitz hτ).dist_le_mul d d' + rw [Real.dist_eq,Real.dist_eq,Real.coe_toNNReal _ (inv_nonneg.mpr hτ.le)] at hl + have hdiff : (amplitude τ d-amplitude τ d')^2 ≤ (τ⁻¹*|d-d'|)^2 := by + nlinarith [sq_abs (amplitude τ d-amplitude τ d'),abs_nonneg (amplitude τ d-amplitude τ d'), + mul_nonneg (inv_nonneg.mpr hτ.le) (abs_nonneg (d-d'))] + nlinarith [sq_nonneg (amplitude τ d-2*amplitude τ d')] + +lemma probability_norm_compare {E : Type*} [NormedAddCommGroup E] {τ : ℝ} + (hτ : 0 < τ) (n θ θ' : E) : + probability τ ‖n-θ‖ ≤ 2*probability τ ‖n-θ'‖+2*τ⁻¹^2*‖θ-θ'‖^2 := by + apply (probability_compare hτ ‖n-θ‖ ‖n-θ'‖).trans + have hd : |‖n-θ‖-‖n-θ'‖| ≤ ‖θ-θ'‖ := by + simpa only [sub_sub_sub_cancel_left,norm_sub_rev θ' θ] using abs_norm_sub_norm_le (n-θ) (n-θ') + have hs : |‖n-θ‖-‖n-θ'‖|^2 ≤ ‖θ-θ'‖^2 := by + nlinarith [abs_nonneg (‖n-θ‖-‖n-θ'‖),norm_nonneg (θ-θ')] + have hh := mul_le_mul_of_nonneg_left hs (show 0 ≤ 2*τ⁻¹^2 by positivity) + linarith + +lemma probability_eq_zero {τ d : ℝ} (hd : d ≤ τ) : probability τ d = 0 := by + rw [probability,max_eq_right (sub_nonpos.mpr hd)] + norm_num + +lemma probability_lt_one_iff {τ d : ℝ} (hτ : 0 < τ) : probability τ d < 1 ↔ d < 2*τ := by + rw [probability,min_lt_iff] + constructor + · intro h + rcases h with h|h + · exact (lt_irrefl _ h).elim + have hm := le_max_left (d-τ) 0 + have hn : 0 ≤ τ⁻¹*max (d-τ) 0 := by positivity + have ht : τ⁻¹*max (d-τ) 0 < 1 := by nlinarith + rw [inv_mul_eq_div,div_lt_one hτ] at ht + linarith + · intro h + right + have hm : max (d-τ) 0 < τ := max_lt (by linarith) hτ + have hn : 0 ≤ τ⁻¹*max (d-τ) 0 := by positivity + have ht : τ⁻¹*max (d-τ) 0 < 1 := by rw [inv_mul_eq_div,div_lt_one hτ]; exact hm + nlinarith + +end FiniteLabels + +namespace FiniteLabels +open DyadicHats + +lemma interpolate_const_mul (r : ℝ) (f : ℤ × ℤ → ℝ) (x : ℂ) (c : ℝ) : + interpolate r (fun p => c*f p) x = c*interpolate r f x := by + simp only [mul_comm c,interpolate_mul_const] + +lemma norm_sub_sq_le_four {E : Type*} [NormedAddCommGroup E] (u v w : E) {A : ℝ} + (hu : ‖u-w‖^2 ≤ A) (hv : ‖v-w‖^2 ≤ A) : ‖u-v‖^2 ≤ 4*A := by + have ht : ‖u-v‖ ≤ ‖u-w‖+‖v-w‖ := by + simpa only [sub_add_sub_cancel,norm_sub_rev w v] using norm_add_le (u-w) (w-v) + nlinarith [norm_nonneg (u-v),norm_nonneg (u-w),norm_nonneg (v-w), + sq_nonneg (‖u-w‖-‖v-w‖)] + +def switchRate (τ r : ℝ) (Θ : ℤ × ℤ → ℂ) (n x : ℂ) : ℝ := + interpolate r (fun z => probability τ ‖n-Θ z‖) x + +lemma switchRate_nonneg (τ r : ℝ) (Θ : ℤ × ℤ → ℂ) (n x : ℂ) : + 0 ≤ switchRate τ r Θ n x := interpolate_nonneg r x (fun _ => probability_nonneg _ _) +lemma switchRate_le_one (τ r : ℝ) (Θ : ℤ × ℤ → ℂ) (n x : ℂ) : + switchRate τ r Θ n x ≤ 1 := interpolate_le_const r x (fun _ => probability_le_one _ _) + +/-- The row-rate comparison is produced from the literal quadratic probability +and the actual partition of unity, uniformly over all nearby grid vertices. -/ +lemma probability_le_rate_energy {τ r E : ℝ} (hτ : 0 < τ) (hr : 0 < r) + (Θ : ℤ × ℤ → ℂ) (n θ q y : ℂ) (hy : boxNorm (y-q) < 199*r) + (hE : ∀ z, boxNorm (point r z-q) ≤ 200*r → ‖Θ z-θ‖^2 ≤ E) + (z : ℤ × ℤ) (hz : boxNorm (point r z-q) ≤ 200*r) : + probability τ ‖n-Θ z‖ ≤ 2*switchRate τ r Θ n y+8*τ⁻¹^2*E := by + have hp (z' : ℤ × ℤ) (hz' : hat r z' y ≠ 0) : + probability τ ‖n-Θ z‖ ≤ 2*probability τ ‖n-Θ z'‖+8*τ⁻¹^2*E := by + have he := norm_sub_sq_le_four (Θ z) (Θ z') θ (hE z hz) (hE z' (hat_vertex_local hr hy hz')) + have hh := probability_norm_compare hτ n (Θ z) (Θ z') + have hm := mul_le_mul_of_nonneg_left he (show 0 ≤ 2*τ⁻¹^2 by positivity) + nlinarith + calc + _ = interpolate r (fun _ => probability τ ‖n-Θ z‖) y := (interpolate_const _ _ _).symm + _ ≤ interpolate r (fun z' => 2*probability τ ‖n-Θ z'‖+8*τ⁻¹^2*E) y := + interpolate_mono_on r y hp + _ = _ := by rw [interpolate_add,interpolate_const_mul,interpolate_const]; rfl + +lemma switchRate_local_compare {τ r E : ℝ} (hτ : 0 < τ) (hr : 0 < r) + (Θ : ℤ × ℤ → ℂ) (n θ q x y : ℂ) + (hx : boxNorm (x-q) < 199*r) (hy : boxNorm (y-q) < 199*r) + (hE : ∀ z, boxNorm (point r z-q) ≤ 200*r → ‖Θ z-θ‖^2 ≤ E) : + switchRate τ r Θ n x ≤ 2*switchRate τ r Θ n y+8*τ⁻¹^2*E := by + change interpolate r _ x ≤ _ + calc + _ ≤ interpolate r (fun _ => 2*switchRate τ r Θ n y+8*τ⁻¹^2*E) x := by + apply interpolate_mono_on + intro z hz + exact probability_le_rate_energy hτ hr Θ n θ q y hy hE z (hat_vertex_local hr hx hz) + _ = _ := interpolate_const _ _ _ + +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +def spatialSwitchRow (τ r : ℝ) (label : ι → ℂ) (Θ : ℤ × ℤ → ℂ) + (target : ℤ × ℤ → ι) (old : ι) (x : ℂ) : Law ι := + spatialRow old target (fun z => probability τ ‖label old-Θ z‖) + (fun _ => probability_nonneg _ _) (fun _ => probability_le_one _ _) r x + +lemma spatialSwitchRow_local_distance {τ r E : ℝ} (hτ : 0 < τ) (hr : 0 < r) (hE0 : 0 ≤ E) + (label : ι → ℂ) (Θ : ℤ × ℤ → ℂ) (target : ℤ × ℤ → ι) (old : ι) + (θ q x y : ℂ) (hx : boxNorm (x-q) < 199*r) (hy : boxNorm (y-q) < 199*r) + (hE : ∀ z, boxNorm (point r z-q) ≤ 200*r → ‖Θ z-θ‖^2 ≤ E) : + l1dist (spatialSwitchRow τ r label Θ target old x) (spatialSwitchRow τ r label Θ target old y) ≤ + (Fintype.card ι:ℝ)* + (16*(2*switchRate τ r Θ (label old) y+8*τ⁻¹^2*E)/r)*‖x-y‖ := by + apply spatialRow_local_distance old target _ _ _ hr + (by have h := switchRate_nonneg τ r Θ (label old) y; positivity) hx hy + intro z hz + exact probability_le_rate_energy hτ hr Θ (label old) θ q y hy hE z hz + +lemma spatialSwitchRow_local_derivative {τ r E : ℝ} (hτ : 0 < τ) (hr : 0 < r) (hE0 : 0 ≤ E) + (label : ι → ℂ) (Θ : ℤ × ℤ → ℂ) (target : ℤ × ℤ → ι) (old : ι) + (θ q x y : ℂ) (hx : boxNorm (x-q) < 199*r) (hy : boxNorm (y-q) < 199*r) + (hE : ∀ z, boxNorm (point r z-q) ≤ 200*r → ‖Θ z-θ‖^2 ≤ E) : + r*∑ j : ι, ‖gradient (fun x => spatialSwitchRow τ r label Θ target old x j) x‖ ≤ + 16*(Fintype.card ι:ℝ)*(2*switchRate τ r Θ (label old) y+8*τ⁻¹^2*E) := by + apply spatialRow_local_derivative old target _ _ _ hr + (by have h := switchRate_nonneg τ r Θ (label old) y; positivity) hx + intro z hz + exact probability_le_rate_energy hτ hr Θ (label old) θ q y hy hE z hz + +end FiniteLabels + +namespace DyadicHats +open Finset + +lemma hat_at_point {r : ℝ} (hr : r ≠ 0) (p q : ℤ × ℤ) : + hat r p (point r q) = if p=q then 1 else 0 := by + have ht (a b : ℤ) : tent ((b:ℝ)-(a:ℝ)) = if a=b then 1 else 0 := by + by_cases h : a=b + · simp [h,tent] + · rw [ite_eq_right h] + apply tent_eq_zero_of_one_le + have hi : (1:ℤ) ≤ |b-a| := Int.one_le_abs (sub_ne_zero.mpr (Ne.symm h)) + exact_mod_cast hi + simp only [hat,point,mul_div_cancel_left₀ _ hr,ht] + split_ifs <;> simp_all [Prod.ext_iff] + +lemma hat_vertex_bound {r : ℝ} (hr : 0 < r) {N : ℕ} {x : ℂ} + (hx1 : |x.re| ≤ r*N) (hx2 : |x.im| ≤ r*N) + {p : ℤ × ℤ} (hp : hat r p x ≠ 0) : p ∈ indexBox N := by + have h := (hat_ne_zero_iff hr p x).mp hp + have h1 := lt_of_le_of_lt (le_max_left |(x-point r p).re| |(x-point r p).im|) h + have h2 := lt_of_le_of_lt (le_max_right |(x-point r p).re| |(x-point r p).im|) h + simp only [Complex.sub_re,Complex.sub_im,point] at h1 h2 + have hb (t : ℝ) (j : ℤ) (ht : |t| ≤ r*N) (hj : |t-r*j| < r) : + j ∈ Finset.Icc (-(N:ℤ)) N := by + have ht' := abs_le.mp ht + have hj' := abs_lt.mp hj + have hlo : -(N:ℝ)-1 < (j:ℝ) := by nlinarith + have hhi : (j:ℝ) < (N:ℝ)+1 := by nlinarith + have hlo' : -(N:ℤ)-1 < j := by exact_mod_cast hlo + have hhi' : j < (N:ℤ)+1 := by exact_mod_cast hhi + exact Finset.mem_Icc.mpr ⟨by omega,by omega⟩ + exact Finset.mem_product.mpr ⟨hb _ _ hx1 h1,hb _ _ hx2 h2⟩ + +lemma velocity_bound_on_grid {N : ℕ} {r : ℝ} (hr : 0 < r) (k : ℕ) (q : Grid N) : + |(point r q).re| ≤ scale r k*N ∧ |(point r q).im| ≤ scale r k*N := by + have h1 := Finset.mem_Icc.mp (Finset.mem_product.mp q.property).1 + have h2 := Finset.mem_Icc.mp (Finset.mem_product.mp q.property).2 + have hh (j : ℤ) (hj : -(N:ℤ) ≤ j ∧ j ≤ N) : |r*j| ≤ scale r k*N := by + have hj' : |(j:ℝ)| ≤ N := abs_le.mpr ⟨by exact_mod_cast hj.1,by exact_mod_cast hj.2⟩ + rw [abs_mul,abs_of_pos hr] + exact (mul_le_mul_of_nonneg_left hj' hr.le).trans + (mul_le_mul_of_nonneg_right (le_scale hr.le k) (Nat.cast_nonneg N)) + exact ⟨hh q.val.1 h1,hh q.val.2 h2⟩ + +end DyadicHats + +namespace DyadicHats + +lemma coeff_eq_hat {N : ℕ} {r : ℝ} (hr : 0 < r) (k : ℕ) (p q : Grid N) : + coeff N k p q = hat (scale r k) p (point r q) := by + induction k generalizing p with + | zero => + simp only [coeff,scale,pow_zero,one_mul,hat_at_point hr.ne'] + by_cases hpq : p=q + · rw [ite_eq_left hpq,ite_eq_left (congrArg Subtype.val hpq)] + · rw [ite_eq_right hpq,ite_eq_right (fun h => hpq (Subtype.ext h))] + | succ k ih => + rw [coeff,scale_succ,hat_refine,tsum_eq_sum (s := indexBox N)] + · rw [← sum_coe_sort (indexBox N) (fun j => step p j*hat (scale r k) j (point r q))] + apply sum_congr rfl + intro j hj + rw [ih] + · intro j hj + have hz : hat (scale r k) j (point r q) = 0 := by + by_contra hn + have hb := velocity_bound_on_grid hr k q + exact hj (hat_vertex_bound (scale_pos hr k) hb.1 hb.2 hn) + rw [hz,mul_zero] + +lemma hat_refine_grid_at {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {x : ℂ} (hx : ‖x‖ ≤ R) (p : Grid N) : + hat (2*r) p x = ∑ q : Grid N, step p q*hat r q x := by + rw [hat_refine,tsum_eq_sum (s := indexBox N)] + · exact (sum_coe_sort (indexBox N) (fun q => step p q*hat r q x)).symm + · intro q hq + have hz : hat r q x = 0 := by + by_contra hn + exact hq (mem_indexBox_of_le hr hN hx hn) + rw [hz,mul_zero] + +lemma vectorMass_grid_refine {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (p : Grid N) : + vectorMass h (2*r) p = ∑ q : Grid N, step p q • vectorMass h r q := by + let f := fun y => ∑ q : Grid N, step p q • (hat r q y • h y) + have hf : (fun y => hat (2*r) p y • h y) = f := by + funext y + by_cases hy : h y=0 + · simp only [f,hy,smul_zero,sum_const_zero] + · rw [hat_refine_grid_at hr hN (hs y hy) p,sum_smul] + simp only [f,smul_smul] + rw [vectorMass,hf] + dsimp only [f] + have hi (q : Grid N) : Integrable (fun y => step p q • (hat r q y • h y)) := + Integrable.smul (step p q) (integrable_hat_smul hh r q) + rw [integral_finsetSum Finset.univ (fun q _ => hi q)] + apply sum_congr rfl + intro q hq + rw [integral_smul] + rfl + +lemma vectorMass_coeff {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : Grid N) : + vectorMass h (scale r k) p = ∑ q : Grid N, coeff N k p q • vectorMass h r q := by + induction k generalizing p with + | zero => simp [coeff,scale] + | succ k ih => + rw [scale_succ,vectorMass_grid_refine (scale_pos hr k) (scale_index_bound hr hR hN k) hh hs] + simp only [ih,smul_sum,smul_smul,coeff,sum_smul] + exact Finset.sum_comm + +lemma sum_scalarMass_grid_le {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) : + (∑ q : Grid N, scalarMass h r q) ≤ ∫ y, ‖h y‖ := by + rw [sum_coe_sort (indexBox N) (fun q => scalarMass h r q)] + exact sum_scalarMass_le hh r (indexBox N) + +end DyadicHats + +namespace DyadicHats +open Finset + +lemma hat_lower {r a : ℝ} (hr : 0 < r) (ha : a ≤ 1) (p : ℤ × ℤ) (x : ℂ) + (hx : boxNorm (x-point r p) ≤ a*r) : (1-a)^2 ≤ hat r p x := by + have h1 := (le_max_left |(x-point r p).re| |(x-point r p).im|).trans hx + have h2 := (le_max_right |(x-point r p).re| |(x-point r p).im|).trans hx + simp only [Complex.sub_re,Complex.sub_im,point] at h1 h2 + have hh (t : ℝ) (j : ℤ) (h : |t-r*j| ≤ a*r) : 1-a ≤ tent (t/r-j) := by + have he : t/r-j = (t-r*j)/r := by field_simp + rw [he,tent,abs_div,abs_of_pos hr] + have hd : |t-r*j|/r ≤ a := (div_le_iff₀ hr).mpr h + exact (sub_le_sub_left hd 1).trans (le_max_left _ _) + calc + (1-a)^2 = (1-a)*(1-a) := by ring + _ ≤ tent (x.re/r-p.1)*tent (x.im/r-p.2) := + mul_le_mul (hh _ _ h1) (hh _ _ h2) (sub_nonneg.mpr ha) (tent_nonneg _) + _ = _ := rfl + +def nearParent (q : ℤ × ℤ) : ℤ × ℤ := ((q.1+2048)/4096,(q.2+2048)/4096) + +lemma nearParent_int_bound (j : ℤ) : |j-4096*((j+2048)/4096)| ≤ 2048 := by + rw [abs_le] + omega + +lemma nearParent_box {r : ℝ} (hr : 0 < r) (q : ℤ × ℤ) : + boxNorm (point r q-point (4096*r) (nearParent q)) ≤ (1/2 : ℝ)*(4096*r) := by + have hh (j : ℤ) : |r*j-(4096*r)*((j+2048)/4096:ℤ)| ≤ (1/2:ℝ)*(4096*r) := by + have hi : |(j:ℝ)-4096*((j+2048)/4096:ℤ)| ≤ 2048 := by exact_mod_cast nearParent_int_bound j + have he : r*j-(4096*r)*((j+2048)/4096:ℤ) = r*((j:ℝ)-4096*((j+2048)/4096:ℤ)) := by ring + rw [he,abs_mul,abs_of_pos hr] + nlinarith + exact max_le (hh q.1) (hh q.2) + +lemma nearParent_mem {N : ℕ} {q : ℤ × ℤ} (hq : q ∈ indexBox N) : nearParent q ∈ indexBox N := by + have h1 := Finset.mem_Icc.mp (Finset.mem_product.mp hq).1 + have h2 := Finset.mem_Icc.mp (Finset.mem_product.mp hq).2 + apply Finset.mem_product.mpr + constructor <;> apply Finset.mem_Icc.mpr <;> dsimp only [nearParent] <;> constructor <;> omega + +lemma nearParent_hat_lower {r : ℝ} (hr : 0 < r) (q w : ℤ × ℤ) + (hw : boxNorm (point r w-point r q) ≤ 500*r) : + 1/4 ≤ hat (scale r 12) (nearParent q) (point r q) ∧ + 9/64 ≤ hat (scale r 12) (nearParent q) (point r w) := by + have hs : scale r 12 = 4096*r := by norm_num [scale] + have hq := nearParent_box hr q + have ht := boxNorm_add_le (point r w-point r q) (point r q-point (4096*r) (nearParent q)) + rw [sub_add_sub_cancel] at ht + have hw' : boxNorm (point r w-point (4096*r) (nearParent q)) ≤ (5/8:ℝ)*(4096*r) := by + linarith + have h1 := hat_lower (by positivity : 0 < 4096*r) (by norm_num : (1/2:ℝ) ≤ 1) (nearParent q) (point r q) hq + have h2 := hat_lower (by positivity : 0 < 4096*r) (by norm_num : (5/8:ℝ) ≤ 1) (nearParent q) (point r w) hw' + rw [hs] + norm_num at h1 h2 ⊢ + exact ⟨h1,h2⟩ + +lemma nearParent_fiber_card (S : Finset (ℤ × ℤ)) (p : ℤ × ℤ) : + (S.filter (fun q => nearParent q=p)).card ≤ 4097^2 := by + let T := (Finset.Icc (4096*p.1-2048) (4096*p.1+2048)).product + (Finset.Icc (4096*p.2-2048) (4096*p.2+2048)) + have hsub : S.filter (fun q => nearParent q=p) ⊆ T := by + intro q hq + have he := (Finset.mem_filter.mp hq).2 + have h1 := nearParent_int_bound q.1 + have h2 := nearParent_int_bound q.2 + have he1 : (q.1+2048)/4096=p.1 := congrArg Prod.fst he + have he2 : (q.2+2048)/4096=p.2 := congrArg Prod.snd he + rw [he1,abs_le] at h1 + rw [he2,abs_le] at h2 + exact Finset.mem_product.mpr ⟨Finset.mem_Icc.mpr ⟨by omega,by omega⟩, + Finset.mem_Icc.mpr ⟨by omega,by omega⟩⟩ + apply (Finset.card_le_card hsub).trans + dsimp only [T] + change ((Finset.Icc (4096*p.1-2048) (4096*p.1+2048)) ×ˢ + (Finset.Icc (4096*p.2-2048) (4096*p.2+2048))).card ≤ 4097^2 + rw [Finset.card_product,Int.card_Icc,Int.card_Icc] + have he (j : ℤ) : 4096*j+2048+1-(4096*j-2048)=4097 := by ring + rw [he,he] + change (4097:ℕ)*4097 ≤ 4097^2 + norm_num + +end DyadicHats + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Envelopes.lean b/lean/OAI/Analysis/DiskMaximal/Envelopes.lean new file mode 100644 index 0000000000000000000000000000000000000000..240dc2addd98fdfe820df248aa5e0d6074a215e4 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Envelopes.lean @@ -0,0 +1,601 @@ +import OAI.Analysis.DiskMaximal.Packing + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace GeometricFilter +open Finset +/-- Causal dyadic averaging, with both the present and the complete past. -/ +def filt (c : ℕ → ℝ) : ℕ → ℝ + | 0 => c 0 + | i+1 => c (i+1)+filt c i/2 +lemma filt_nonneg {c : ℕ → ℝ} (hc : ∀ i, 0 ≤ c i) (i : ℕ) : 0 ≤ filt c i := by + induction i with + | zero => exact hc 0 + | succ i ih => exact add_nonneg (hc _) (div_nonneg ih (by norm_num)) +lemma le_filt {c : ℕ → ℝ} (hc : ∀ i, 0 ≤ c i) (i : ℕ) : c i ≤ filt c i := by + cases i with + | zero => exact le_rfl + | succ i => dsimp only [filt]; linarith [filt_nonneg hc i] +lemma filt_le {c : ℕ → ℝ} {A : ℝ} (hA : 0 ≤ A) (hc : ∀ i, c i ≤ A) (i : ℕ) : filt c i ≤ 2*A := by + induction i with + | zero => exact (hc 0).trans (by linarith) + | succ i ih => dsimp only [filt]; linarith [hc (i+1)] +lemma filt_mono {c d : ℕ → ℝ} (h : ∀ i, c i ≤ d i) (i : ℕ) : filt c i ≤ filt d i := by + induction i with + | zero => exact h 0 + | succ i ih => dsimp only [filt]; linarith [h (i+1)] +lemma filt_mul (c : ℕ → ℝ) (a : ℝ) (i : ℕ) : filt (fun j => a*c j) i = a*filt c i := by + induction i with + | zero => rfl + | succ i ih => simp only [filt,ih]; ring +lemma filt_sum (c : ℕ → ℝ) (i : ℕ) : + filt c i = ∑ j ∈ range (i+1), (1/2:ℝ)^(i-j)*c j := by + induction i with + | zero => simp [filt] + | succ i ih => + rw [filt,ih] + conv_rhs => rw [sum_range_succ] + simp only [Nat.sub_self,pow_zero,one_mul] + rw [add_comm] + congr 1 + rw [div_eq_mul_inv,sum_mul] + apply sum_congr rfl + intro j hj + have hj' : j ≤ i := by have := mem_range.mp hj; omega + rw [show i+1-j = (i-j)+1 by omega,pow_succ] + ring + +lemma filt_tail_strong {c : ℕ → ℝ} (hc0 : ∀ i, 0 ≤ c i) {b m : ℕ} (hbm : b ≤ m) : + (∑ i ∈ Ico b (m+1), filt c i) ≤ 2*∑ i ∈ Ico b (m+1), c i+2*filt c b := by + have hid : (∑ i ∈ Ico (b+1) (m+1), filt c i) = + (∑ i ∈ Ico (b+1) (m+1), c i)+(∑ i ∈ Ico b m, filt c i)/2 := by + rw [← sum_Ico_add' (fun i => filt c i) b m 1, + ← sum_Ico_add' (fun i => c i) b m 1] + simp only [filt,sum_add_distrib,sum_div] + have hsplit := sum_eq_sum_Ico_succ_bot (f := filt c) (by omega : b < m+1) + have hcsplit := sum_eq_sum_Ico_succ_bot (f := c) (by omega : b < m+1) + have he : (∑ i ∈ Ico b m, filt c i) ≤ ∑ i ∈ Ico b (m+1), filt c i := by + apply sum_le_sum_of_subset_of_nonneg (Ico_subset_Ico_right (by omega)) + intro i _ _ + exact filt_nonneg hc0 i + rw [hsplit,hid] at he + rw [hsplit,hid,hcsplit] + linarith [hc0 b] + +/-- The complete pre-birth history costs a fixed amount, not the birth index. -/ +theorem filt_tail {c : ℕ → ℝ} {A : ℝ} (hA : 0 ≤ A) (hc0 : ∀ i, 0 ≤ c i) + (hcA : ∀ i, c i ≤ A) {b m : ℕ} (hbm : b ≤ m) : + (∑ i ∈ Ico b (m+1), filt c i) ≤ 2*∑ i ∈ Ico b (m+1), c i+4*A := by + have h1 := filt_tail_strong hc0 hbm + have h2 := filt_le hA hcA b + linarith + +/-- Two geometric convolutions are summable on every occupied lifetime. -/ +theorem double_tail {c : ℕ → ℝ} {A : ℝ} (hA : 0 ≤ A) (hc0 : ∀ i, 0 ≤ c i) + (hcA : ∀ i, c i ≤ A) {b m : ℕ} (hbm : b ≤ m) : + (∑ i ∈ Ico b (m+1), filt (filt c) i) ≤ 4*∑ i ∈ Ico b (m+1), c i+16*A := by + have h1 := filt_tail hA hc0 hcA hbm + have h2 := filt_tail (by positivity : 0 ≤ 2*A) (filt_nonneg hc0) (filt_le hA hcA) hbm + linarith +end GeometricFilter + +namespace GeometricFilter +open Finset +lemma radius_sum {r c : ℕ → ℝ} (j : ℕ) (hr : ∀ i ≤ j, 0 < r i) + (hstep : ∀ i < j, r i = 2*r (i+1)) : + r j*(∑ i ∈ range (j+1), c i/r i) = filt c j := by + induction j with + | zero => simp only [Nat.zero_add,sum_range_one,filt]; field_simp [(hr 0 le_rfl).ne'] + | succ j ih => + have hs := ih (fun i hi => hr i (by omega)) (fun i hi => hstep i (by omega)) + rw [sum_range_succ,mul_add,filt] + have he : r (j+1)*(c (j+1)/r (j+1)) = c (j+1) := by field_simp [(hr (j+1) le_rfl).ne'] + rw [he,add_comm] + congr 1 + rw [← hs,hstep j (by omega)] + ring +end GeometricFilter + +namespace ActualLabels +open FiniteLabels ConeCoordinates DirectionNeighbors DyadicHats Finset GeometricFilter + +def spatialConstant : ℝ := 208*comparisonConstant^2 +lemma spatialConstant_pos : 0 < spatialConstant := by + dsimp [spatialConstant] + have := comparisonConstant_pos + positivity +lemma spatialConstant_ge : 2*comparisonConstant ≤ spatialConstant := by + dsimp [spatialConstant] + nlinarith [comparisonConstant_one] + +lemma scaled_marginal_distance (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) + (x y : ℂ) (j : ℕ) (hr : ∀ i ≤ j, 0 < r i) + (hstep : ∀ i < j, r i = 2*r (i+1)) + (hx : ∀ i ≤ j, boxNorm (x-point (r i) (q i)) < 199*r i) + (hy : ∀ i ≤ j, boxNorm (y-point (r i) (q i)) < 199*r i) : + r j*l1dist (marginal h r j x) (marginal h r j y) ≤ + comparisonConstant*‖x-y‖*filt (energyRate h r q y) j := by + have hd := mul_le_mul_of_nonneg_left (marginal_spatial_distance h r q x y j hr hx hy) (hr j le_rfl).le + have he := radius_sum (c := energyRate h r q y) j hr hstep + calc + _ ≤ r j*(comparisonConstant*‖x-y‖*∑ i ∈ range (j+1), energyRate h r q y i/r i) := hd + _ = _ := by rw [← mul_assoc,mul_comm (r j),mul_assoc,he] + +/-- Actual spatial comparison at every point of the neighborhood. The gradient +versions are pointwise bounded; differentiability is only needed later for IBP. -/ +theorem filtered_spatial_cost (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) + (x y : ℂ) (j : ℕ) (hr : ∀ i ≤ j, 0 < r i) + (hstep : ∀ i < j, r i = 2*r (i+1)) + (hx : ∀ i ≤ j, boxNorm (x-point (r i) (q i)) < 199*r i) + (hy : ∀ i ≤ j, boxNorm (y-point (r i) (q i)) < 199*r i) + (hdist : ‖x-y‖ ≤ 104*r j) : + switchCost h r x j+derivativeCost h r x j ≤ + spatialConstant*filt (energyRate h r q y) j := by + let c := energyRate h r q y + have hc0 : ∀ i, 0 ≤ c i := energyRate_nonneg h r q y + have hC := comparisonConstant_one + have hC0 := comparisonConstant_pos.le + cases j with + | zero => + have he : 1 ≤ c 0 := by dsimp [c,energyRate,switchCost]; linarith [energy_nonneg h (r 0) (q 0)] + have ht := derivativeCost_uniform h r x 0 (hr 0 le_rfl) + have hbound : 1+16*(Fintype.card Label:ℝ) ≤ 2*comparisonConstant := by + dsimp [comparisonConstant] + nlinarith [Nat.cast_nonneg (α := ℝ) (Fintype.card Label)] + have hh := mul_le_mul_of_nonneg_left he spatialConstant_pos.le + dsimp only [switchCost,filt] + change _ ≤ spatialConstant*c 0 + nlinarith [spatialConstant_ge] + | succ j => + have hm := scaled_marginal_distance h r q x y j + (fun i hi => hr i (by omega)) (fun i hi => hstep i (by omega)) + (fun i hi => hx i (by omega)) (fun i hi => hy i (by omega)) + have hd : ‖x-y‖ ≤ 52*r j := by rw [hstep j (by omega)]; linarith + have hmag := mul_le_mul_of_nonneg_right hd (mul_nonneg hC0 (filt_nonneg hc0 j)) + have hd' : l1dist (marginal h r j x) (marginal h r j y) ≤ + 52*comparisonConstant*filt c j := by + have hrj := hr j (by omega) + change r j*l1dist (marginal h r j x) (marginal h r j y) ≤ + comparisonConstant*‖x-y‖*filt c j at hm + nlinarith + have hs := switchCost_spatial h r (q (j+1)) x y j (hr (j+1) le_rfl) + (hx (j+1) le_rfl) (hy (j+1) le_rfl) + have ht := derivativeCost_spatial h r (q (j+1)) x y j (hr (j+1) le_rfl) + (hx (j+1) le_rfl) (hy (j+1) le_rfl) + change switchCost h r x (j+1) ≤ comparisonConstant*c (j+1)+_ at hs + change derivativeCost h r x (j+1) ≤ comparisonConstant*c (j+1)+_ at ht + have hdC := mul_le_mul_of_nonneg_left hd' hC0 + have hcoef : (52*comparisonConstant+52*comparisonConstant^2)*filt c j ≤ + (104*comparisonConstant^2)*filt c j := by + apply mul_le_mul_of_nonneg_right _ (filt_nonneg hc0 j) + nlinarith + have hcC := mul_le_mul_of_nonneg_right spatialConstant_ge (hc0 (j+1)) + change _ ≤ spatialConstant*filt c (j+1) + rw [filt] + dsimp [spatialConstant] at hcC ⊢ + nlinarith +end ActualLabels + +namespace DyadicHats +lemma scale_mono {r : ℝ} (hr : 0 ≤ r) {i j : ℕ} (hij : i ≤ j) : scale r i ≤ scale r j := by + exact mul_le_mul_of_nonneg_right (pow_le_pow_right₀ (by norm_num : (1:ℝ) ≤ 2) hij) hr +lemma descending_step (r : ℝ) {m i : ℕ} (hi : i < m) : + scale r (m-i) = 2*scale r (m-(i+1)) := by + rw [show m-i = (m-(i+1))+1 by omega,scale_succ] +lemma descending_compare {r : ℝ} (hr : 0 ≤ r) {m l i : ℕ} (hi : i ≤ l+1) : + scale r (m-l) ≤ 2*scale r (m-i) := by + rw [← scale_succ] + exact scale_mono hr (by omega) + +def neighborhood (r : ℝ) (q : ℤ × ℤ) : Set ℂ := {x | boxNorm (x-point r q) ≤ 25*r} +lemma point_mem_neighborhood {r : ℝ} (hr : 0 ≤ r) (q : ℤ × ℤ) : point r q ∈ neighborhood r q := by + change boxNorm (point r q-point r q) ≤ _ + simp only [sub_self,boxNorm] + simpa using (mul_nonneg (by norm_num : (0:ℝ) ≤ 25) hr) +end DyadicHats + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks + +def pathVertex {N : ℕ} (q : Grid N) (p : List (Grid N)) (i : ℕ) : ℤ × ℤ := lastVertex q (p.take i) + +lemma terminal_path_locality {N : ℕ} (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {m : ℕ} {q : Grid N} {p : List (Grid N)} (hp : activePath (tree v m 1 q) p) + {i : ℕ} (hi : i ≤ m) : + boxNorm (point r (lastVertex q p)-point (scale r (m-i)) (pathVertex q p i)) < scale r (m-i) := by + have hlen := active_length v hp + have hp' : activePath (tree v m 1 q) (p.take i++p.drop i) := by simpa only [List.take_append_drop] using hp + have hl := active_prefix_locality v hr hp' (x := point r (lastVertex q p)) (by + rw [List.take_append_drop,hat_at_point hr.ne'] + norm_num) + simpa only [List.length_take,show min i p.length = i by omega,pathVertex] using hl + +/-- The neighborhoods used by assembly remain within the actual 200-neighbor +energy window at every earlier row, including the complete pre-birth history. -/ +lemma path_neighborhood_geometry {N : ℕ} (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {m : ℕ} {q : Grid N} {p : List (Grid N)} (hp : activePath (tree v m 1 q) p) + {l : ℕ} (hl : l ≤ m) {x : ℂ} + (hx : x ∈ neighborhood (scale r (m-l)) (pathVertex q p l)) + {i : ℕ} (hi : i ≤ m) (hil : i ≤ l+1) : + ‖x-point r (lastVertex q p)‖ ≤ 104*scale r (m-i) ∧ + boxNorm (x-point (scale r (m-i)) (pathVertex q p i)) < 199*scale r (m-i) ∧ + boxNorm (point r (lastVertex q p)-point (scale r (m-i)) (pathVertex q p i)) < 199*scale r (m-i) := by + let y := point r (lastVertex q p) + have hy := terminal_path_locality v hr hp hl + have hyi := terminal_path_locality v hr hp hi + have hxy := boxNorm_add_le (x-point (scale r (m-l)) (pathVertex q p l)) + (point (scale r (m-l)) (pathVertex q p l)-y) + rw [sub_add_sub_cancel,boxNorm_sub_comm (point _ _)] at hxy + change boxNorm (x-point (scale r (m-l)) (pathVertex q p l)) ≤ 25*scale r (m-l) at hx + have hd : boxNorm (x-y) ≤ 26*scale r (m-l) := by change boxNorm (y-_) < _ at hy; linarith + have hrel := descending_compare hr.le (m := m) hil + have hrp := scale_pos hr (m-i) + have hnorm := norm_le_two_boxNorm (x-y) + have hxi := boxNorm_add_le (x-y) (y-point (scale r (m-i)) (pathVertex q p i)) + rw [sub_add_sub_cancel] at hxi + change boxNorm (y-point (scale r (m-i)) (pathVertex q p i)) < scale r (m-i) at hyi + exact ⟨by dsimp only [y] at hnorm hd; linarith,by linarith,by linarith⟩ +end ActualMarkTrees + +namespace GeometricFilter +open Finset +lemma filt_mono_on {c d : ℕ → ℝ} (j : ℕ) (h : ∀ i ≤ j, c i ≤ d i) : filt c j ≤ filt d j := by + rw [filt_sum,filt_sum] + exact sum_le_sum (fun i hi => mul_le_mul_of_nonneg_left (h i (by have := mem_range.mp hi; omega)) (by positivity)) + +lemma shifted_tail {c : ℕ → ℝ} {A : ℝ} (hA : 0 ≤ A) (hc0 : ∀ i, 0 ≤ c i) + (hcA : ∀ i, c i ≤ A) {b m : ℕ} (hbm : b ≤ m) : + (∑ i ∈ Ico b (m+1), filt c (i+1)) ≤ 2*∑ i ∈ Ico b (m+1), c i+6*A := by + have he := sum_Ico_sub (filt c) (by omega : b ≤ m+1) + rw [sum_sub_distrib] at he + have h1 := filt_tail hA hc0 hcA hbm + linarith [filt_le hA hcA (m+1),filt_nonneg hc0 b] +end GeometricFilter + +namespace DyadicHats +noncomputable def localSup (f : ℂ → ℝ) (r : ℝ) (q : ℤ × ℤ) : ℝ := + sSup (f '' neighborhood r q) +lemma localSup_le {f : ℂ → ℝ} {r A : ℝ} (hr : 0 ≤ r) (q : ℤ × ℤ) + (h : ∀ x ∈ neighborhood r q, f x ≤ A) : localSup f r q ≤ A := by + apply csSup_le (Set.Nonempty.image f ⟨point r q,point_mem_neighborhood hr q⟩) + rintro z ⟨x,hx,rfl⟩ + exact h x hx +lemma le_localSup {f : ℂ → ℝ} {r A : ℝ} (q : ℤ × ℤ) + (h : ∀ x ∈ neighborhood r q, f x ≤ A) {x : ℂ} (hx : x ∈ neighborhood r q) : + f x ≤ localSup f r q := le_csSup ⟨A,by rintro z ⟨y,hy,rfl⟩; exact h y hy⟩ ⟨x,hx,rfl⟩ +lemma localSup_nonneg {f : ℂ → ℝ} {r A : ℝ} (hr : 0 ≤ r) (q : ℤ × ℤ) + (h0 : ∀ x, 0 ≤ f x) (h : ∀ x ∈ neighborhood r q, f x ≤ A) : 0 ≤ localSup f r q := + (h0 (point r q)).trans (le_localSup q h (point_mem_neighborhood hr q)) +end DyadicHats + +namespace ActualLabels +open DyadicHats GeometricFilter FiniteLabels Finset +lemma derivativeCost_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (i : ℕ) (hr : 0 ≤ r i) : + 0 ≤ derivativeCost h r x i := by + cases i with + | zero => exact mul_nonneg hr (sum_nonneg (fun _ _ => norm_nonneg _)) + | succ i => exact FiniteLabels.expect_nonneg _ (rowDerivative_nonneg h hr x) + +def cellCost (h : ℂ → ℂ) (r : ℕ → ℝ) (m l : ℕ) (q : ℤ × ℤ) : ℝ := + localSup (fun x => switchCost h r x l) (r l) q+ + (if l=m then 1 else localSup (fun x => switchCost h r x (l+1)) (r l) q)+ + filt (fun i => localSup (fun x => derivativeCost h r x i) (r l) q) l + +lemma cellCost_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (m l : ℕ) (q : ℤ × ℤ) : + 0 ≤ cellCost h r m l q := by + have hs (i : ℕ) : 0 ≤ localSup (fun x => switchCost h r x i) (r l) q := + localSup_nonneg (hr l).le q (fun x => switchCost_nonneg h r x i) (fun x _ => switchCost_le_one h r x i) + have ht (i : ℕ) : 0 ≤ localSup (fun x => derivativeCost h r x i) (r l) q := + localSup_nonneg (hr l).le q (fun x => derivativeCost_nonneg h r x i (hr i).le) + (fun x _ => derivativeCost_uniform h r x i (hr i)) + dsimp only [cellCost] + exact add_nonneg (add_nonneg (hs _) (by split_ifs; exact zero_le_one; exact hs _)) (filt_nonneg ht l) +end ActualLabels + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks ActualLabels GeometricFilter Finset + +lemma path_filtered_cost {N : ℕ} (h : ℂ → ℂ) (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {m : ℕ} {q : Grid N} {p : List (Grid N)} (hp : activePath (tree v m 1 q) p) + {l : ℕ} (hl : l ≤ m) {x : ℂ} (hx : x ∈ neighborhood (scale r (m-l)) (pathVertex q p l)) + {i : ℕ} (hi : i ≤ m) (hil : i ≤ l+1) : + switchCost h (fun j => scale r (m-j)) x i+derivativeCost h (fun j => scale r (m-j)) x i ≤ + spatialConstant*filt (energyRate h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p))) i := by + apply filtered_spatial_cost h _ _ x _ i (fun j _ => scale_pos hr (m-j)) + (fun j hj => descending_step r (by omega)) + · intro j hj + exact (path_neighborhood_geometry v hr hp hl hx (by omega : j ≤ m) (by omega)).2.1 + · intro j hj + exact (path_neighborhood_geometry v hr hp hl hx (by omega : j ≤ m) (by omega)).2.2 + · exact (path_neighborhood_geometry v hr hp hl hx hi hil).1 + +lemma path_cellCost {N : ℕ} (h : ℂ → ℂ) (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {m : ℕ} {q : Grid N} {p : List (Grid N)} (hp : activePath (tree v m 1 q) p) + {l : ℕ} (hl : l ≤ m) : + cellCost h (fun j => scale r (m-j)) m l (pathVertex q p l) ≤ + spatialConstant*(filt (energyRate h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p))) l+ + filt (energyRate h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p))) (l+1)+ + filt (filt (energyRate h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p)))) l)+ + (if l=m then 1 else 0) := by + let rs := fun j => scale r (m-j) + let c := energyRate h rs (pathVertex q p) (point r (lastVertex q p)) + have hs (i : ℕ) (hi : i ≤ m) (hil : i ≤ l+1) : + localSup (fun x => switchCost h rs x i) (rs l) (pathVertex q p l) ≤ spatialConstant*filt c i := by + apply localSup_le (scale_pos hr _).le + intro x hx + have hh := path_filtered_cost h v hr hp hl hx hi hil + change switchCost h rs x i+derivativeCost h rs x i ≤ spatialConstant*filt c i at hh + linarith [derivativeCost_nonneg h rs x i (scale_pos hr _).le] + have ht (i : ℕ) (hi : i ≤ l) : + localSup (fun x => derivativeCost h rs x i) (rs l) (pathVertex q p l) ≤ spatialConstant*filt c i := by + apply localSup_le (scale_pos hr _).le + intro x hx + have hh := path_filtered_cost h v hr hp hl hx (show i ≤ m by omega) (show i ≤ l+1 by omega) + change switchCost h rs x i+derivativeCost h rs x i ≤ spatialConstant*filt c i at hh + linarith [switchCost_nonneg h rs x i] + have hT := filt_mono_on l ht + rw [filt_mul] at hT + have hnext : (if l=m then 1 else localSup (fun x => switchCost h rs x (l+1)) (rs l) (pathVertex q p l)) ≤ + spatialConstant*filt c (l+1)+(if l=m then 1 else 0) := by + split_ifs with he + · have hh := mul_nonneg spatialConstant_pos.le (filt_nonneg (energyRate_nonneg h rs (pathVertex q p) (point r (lastVertex q p))) (l+1)) + linarith + · simpa only [add_zero] using hs (l+1) (by omega) le_rfl + have hcur := hs l hl (by omega) + change cellCost h rs m l (pathVertex q p l) ≤ _ + dsimp only [cellCost] + change _ ≤ spatialConstant*(filt c l+filt c (l+1)+filt (filt c) l)+(if l=m then 1 else 0) + linarith + +lemma path_cellCost_sum {N : ℕ} (h : ℂ → ℂ) (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {m : ℕ} {q : Grid N} {p : List (Grid N)} (hp : activePath (tree v m 1 q) p) + {b : ℕ} (hb : b ≤ m) : + (∑ l ∈ Ico b (m+1), cellCost h (fun j => scale r (m-j)) m l (pathVertex q p l)) ≤ + spatialConstant*(8*∑ i ∈ Ico b (m+1), + energyRate h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p)) i+130)+1 := by + let c := energyRate h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p)) + have hc0 := energyRate_nonneg h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p)) + have hcA := energyRate_le_five h (fun j => scale r (m-j)) (pathVertex q p) (point r (lastVertex q p)) + have h1 := filt_tail (by norm_num : (0:ℝ) ≤ 5) hc0 hcA hb + have h2 := shifted_tail (by norm_num : (0:ℝ) ≤ 5) hc0 hcA hb + have h3 := double_tail (by norm_num : (0:ℝ) ≤ 5) hc0 hcA hb + have hs := sum_le_sum (fun l (hl : l ∈ Finset.Ico b (m+1)) => path_cellCost h v hr hp (show l ≤ m by have := Finset.mem_Ico.mp hl; omega)) + change _ ≤ ∑ l ∈ Ico b (m+1), (spatialConstant*(filt c l+filt c (l+1)+filt (filt c) l)+(if l=m then 1 else 0)) at hs + simp only [sum_add_distrib,← mul_sum] at hs + have he : (∑ l ∈ Ico b (m+1), if l=m then (1:ℝ) else 0) = 1 := by simp [hb] + rw [he] at hs + change _ ≤ spatialConstant*(8*∑ i ∈ Ico b (m+1), c i+130)+1 + have hh : (∑ i ∈ Ico b (m+1), filt c i)+(∑ i ∈ Ico b (m+1), filt c (i+1))+ + (∑ i ∈ Ico b (m+1), filt (filt c) i) ≤ 8*∑ i ∈ Ico b (m+1), c i+130 := by linarith + exact hs.trans (by nlinarith [mul_le_mul_of_nonneg_left hh spatialConstant_pos.le]) +end ActualMarkTrees + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks ActualLabels GeometricFilter DirectionNeighbors Finset + +def packingCharge {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (m : ℕ) (q : Grid N) : List (Grid N) → ℝ := + spatialCharge (fun j z => cellCost h (fun i => scale r (m-i)) m (m-j) z) m q + +lemma packingCharge_path {N : ℕ} (h : ℂ → ℂ) (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {m : ℕ} {q : Grid N} {p : List (Grid N)} (hp : activePath (tree v m 1 q) p) + {b : ℕ} (hb : b ≤ p.length) : + pathCharge (packingCharge h r m q) p b ≤ + 8*spatialConstant*particleSwitches h r m q p b+ + 8*spatialConstant*pathCharge (pathEnergy h r m q) p b+(130*spatialConstant+1) := by + have hlen := active_length v hp + have hs := path_cellCost_sum h v hr hp (show b ≤ m by omega) + have hC : pathCharge (packingCharge h r m q) p b = + ∑ i ∈ Ico b (m+1), cellCost h (fun j => scale r (m-j)) m i (pathVertex q p i) := by + rw [pathCharge_sum,hlen] + apply sum_congr rfl + intro i hi + have hi' : i ≤ m := by have := Finset.mem_Ico.mp hi; omega + simp only [packingCharge,spatialCharge,List.length_take,hlen,min_eq_left hi', + Nat.sub_sub_self hi',pathVertex] + have hE : (∑ i ∈ Ico b (m+1), energyRate h (fun j => scale r (m-j)) (pathVertex q p) + (point r (lastVertex q p)) i) = + particleSwitches h r m q p b+pathCharge (pathEnergy h r m q) p b := by + rw [pathCharge_sum] + simp only [particleSwitches,pathSwitches,hlen,energyRate,sum_add_distrib] + congr 1 + apply sum_congr rfl + intro i hi + have hi' : i ≤ m := by have := Finset.mem_Ico.mp hi; omega + simp only [pathEnergy,List.length_take,hlen,min_eq_left hi',pathVertex] + rw [hC] + rw [hE] at hs + linarith + +lemma tree_packing_bound {N : ℕ} (h : ℂ → ℂ) (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + (m : ℕ) (q : Grid N) : + nodeCharge (tree v m 1 q) (packingCharge h r m q) ≤ + 8*spatialConstant*particleEval (tree v m 1 q) (particleSwitches h r m q)+ + 8*spatialConstant*nodeCharge (tree v m 1 q) (pathEnergy h r m q)+ + (130*spatialConstant+1)*terminalMass (tree v m 1 q) := by + have hs := particleEval_mono_active (tree v m 1 q) + (F := pathCharge (packingCharge h r m q)) + (fun p b hp hb => packingCharge_path h v hr hp hb) + simp only [particleEval_add,particleEval_smul,particleEval_const,particle_occupancy] at hs + nlinarith only [hs] + +def packingConstant : ℝ := + 8*spatialConstant*(2560004+2000000*(576*(4097:ℝ)^2))+ + 8*spatialConstant*(576*(4097:ℝ)^2)+(130*spatialConstant+1) +lemma packingConstant_pos : 0 < packingConstant := by + dsimp [packingConstant] + have := spatialConstant_pos + positivity + +theorem spatial_packing {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) : + (∑ j ∈ range (m+1), ∑ q : Grid N, scalarMass h (scale r j) q* + cellCost h (fun i => scale r (m-i)) m (m-j) q) ≤ + packingConstant*(∫ y, ‖h y‖) := by + have hs := sum_le_sum (fun q (_ : q ∈ (univ : Finset (Grid N))) => + tree_packing_bound h (fun q => vectorMass h r q) hr m q) + simp only [sum_add_distrib,← mul_sum] at hs + have hleft : (∑ q : Grid N, nodeCharge (tree (fun q => vectorMass h r q) m 1 q) + (packingCharge h r m q)) = + ∑ j ∈ range (m+1), ∑ q : Grid N, scalarMass h (scale r j) q* + cellCost h (fun i => scale r (m-i)) m (m-j) q := by + unfold packingCharge + rw [sum_nodeCharge] + apply sum_congr rfl + intro j hj + apply sum_congr rfl + intro q hq + rw [← vectorMass_coeff hr hR hN hh hsupp] + rfl + rw [hleft,sum_energyCharge hr hR hN hh hsupp,sum_terminalMass] at hs + have hS := forest_switch_budget hr hR hN hh hsupp m + have hE := neighbor_energy_budget hr hR hN hh hsupp (m+1) + have hM := sum_scalarMass_grid_le (N := N) hh r + change (∑ q : Grid N, ‖vectorMass h r q‖) ≤ ∫ y, ‖h y‖ at hM + have hcoef : 0 ≤ 8*spatialConstant := by have := spatialConstant_pos; positivity + have hcoef' : 0 ≤ 130*spatialConstant+1 := by have := spatialConstant_pos; positivity + dsimp only [packingConstant] + nlinarith only [hs,mul_le_mul_of_nonneg_left hS hcoef, + mul_le_mul_of_nonneg_left hE hcoef,mul_le_mul_of_nonneg_left hM hcoef'] +end ActualMarkTrees + +namespace CommonPrices +open DyadicHats ConeCoordinates ConeScalar LocalCancellation AffineDensities DirectionNeighbors Finset DiskMoments PricePieces + +def rootMass {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) : ℝ := + ∑ q ∈ S, scalarMass h (scale r k) q +lemma rootMass_nonneg {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) : + 0 ≤ rootMass h r k S := sum_nonneg (fun _ _ => norm_nonneg _) + +def sizeErrors {N : ℕ} {r : ℝ} (hr : 0 < r) {h : ℂ → ℂ} (hh : Integrable h) + (k : ℕ) (p : ℂ) (S : Finset (Grid N)) (n : ℂ) : Option (ErrorIndex N k) → ErrorPiece 2 + | none => unitPiece (rescale p (scale r k) (rootSum h r k S n)) + (integrable_rescale (rootSum_integrable hh r k S n) p (scale_pos hr k).ne') 2 + | some i => smallPiece hh hr k p S n i + +lemma sizeErrors_price {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : n ∈ fixedPalette.labels) : + errorPrice (sizeErrors hr hh k p S n) (1/100) ≤ + (scale r k)⁻¹*(4*rootMass h r k S+2*cellPrice N r h k S) := by + have hb : (sizeErrors hr hh k p S n none).mass ≤ (scale r k)⁻¹*4*rootMass h r k S := by + change (∫ X, ‖rescale p (scale r k) (rootSum h r k S n) X‖) ≤ _ + rw [mass_rescale _ _ (scale_pos hr k)] + simpa only [mul_assoc,rootMass] using mul_le_mul_of_nonneg_left + (rootSum_mass hr hR hN hh hsupp k S (fixedPalette.unit n hn)) (inv_nonneg.mpr (scale_pos hr k).le) + have hs := smallPiece_common_price hr hR hN hh hsupp k p S hn + change (∑ i, (smallPiece hh hr k p S n i).size^(1/100:ℝ)* + (smallPiece hh hr k p S n i).mass) ≤ _ at hs + simp only [errorPrice,Fintype.sum_option,show (sizeErrors hr hh k p S n none).size = 1 from rfl, + Real.one_rpow,one_mul] + change (sizeErrors hr hh k p S n none).mass + (∑ i, (smallPiece hh hr k p S n i).size^(1/100:ℝ)*(smallPiece hh hr k p S n i).mass) ≤ _ + linarith + +lemma sizeErrors_gradient {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {g : ℂ → ℝ} (hg : Differentiable ℝ g) + (hh : Integrable (gradient g)) (hsupp : ∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) + (k : ℕ) (p : ℤ × ℤ) {n : ℂ} (hn : ‖n‖ = 1) (X : ℂ) (hX : ‖X‖ ≤ 12) : + (∑ i, (sizeErrors hr hh k (point (scale r k) p) (cellRoots N p) n i).density X) = + gradient (fun Y => g (point (scale r k) p+scale r k • Y)) X := by + rw [Fintype.sum_option] + change rescale _ _ (rootSum _ _ _ _ _) X+ + (∑ i : ErrorIndex N k, (smallPiece hh hr k _ _ n i).density X) = _ + rw [smallPiece_sum,gradient_affine hg] + simp only [rescale,← smul_add,rootSum,← sum_add_distrib] + have he := sum_congr rfl (fun q (_ : q ∈ cellRoots N p) => + (vector_decomposition hr hR hN hsupp k q hn (point (scale r k) p+scale r k • X)).symm) + rw [he,← sum_smul,cell_partition (scale_pos hr k) (scale_index_bound hr hR hN k) hsupp p X hX] + +/-- The endpoint-bin gradient price, with all root terms retained rather than +silently using the cone estimate at one-sided maximizing radii. -/ +theorem size_cell_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → ∀ (k : ℕ) (p : ℤ × ℤ) + {n : ℂ}, n ∈ fixedPalette.labels → ∀ Q : Set ℂ, volume Q ≤ ENNReal.ofReal 1 → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ X in Q, F X) ≤ ENNReal.ofReal (C*(scale r k)⁻¹* + (rootMass (gradient g) r k (cellRoots N p)+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ X, ‖X‖ ≤ 2 → ∀ t, + EndpointRadius (fun Y => g (point (scale r k) p+scale r k • Y)) X t → + ENNReal.ofReal ‖∫ Y in Metric.ball X t, + gradient (fun Z => g (point (scale r k) p+scale r k • Z)) Y‖ ≤ F X := by + obtain ⟨C,hC,hmajor⟩ := size_majorant (by norm_num : (0:ℝ) ≤ 2) + refine ⟨4*C,by positivity,?_⟩ + intro N r R hr hR hN g hg hh hsupp k p n hn Q hQ + let b := sizeErrors hr hh k (point (scale r k) p) (cellRoots N p) n + have hg' : ContDiff ℝ 1 (fun Y => g (point (scale r k) p+scale r k • Y)) := hg.comp (by fun_prop) + obtain ⟨F,hFm,hFi,hFb⟩ := hmajor b _ hg' Q hQ + refine ⟨F,hFm,?_,?_⟩ + · apply hFi.trans + apply ENNReal.ofReal_le_ofReal + have hb := sizeErrors_price hr hR hN hh hsupp k (point (scale r k) p) (cellRoots N p) hn + have hD : 0 ≤ cellPrice N r (gradient g) k (cellRoots N p) := + sum_nonneg (fun q _ => rootPrice_nonneg hr hR hN hh hsupp k q) + change errorPrice b (1/100) ≤ _ at hb + have hrk := scale_pos hr k + nlinarith [mul_le_mul_of_nonneg_left hb hC.le,inv_nonneg.mpr hrk.le, + mul_nonneg (inv_nonneg.mpr hrk.le) hD] + · intro X hX t ht + apply hFb X _ t ht + filter_upwards with Y hY + apply sizeErrors_gradient hr hR hN (hg.differentiable one_ne_zero) hh hsupp k p (fixedPalette.unit n hn) + have hy : ‖Y-X‖ < 3 := by simpa only [Metric.mem_ball,dist_eq_norm] using hY + have htri := norm_add_le (Y-X) X + rw [sub_add_cancel] at htri + linarith +end CommonPrices + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Geometry.lean b/lean/OAI/Analysis/DiskMaximal/Geometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..17be0aa206dec2b7f1975761eca5c12be09ca74b --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Geometry.lean @@ -0,0 +1,904 @@ +import OAI.Analysis.DiskMaximal.Basic + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace + +noncomputable section + +namespace DiskGeometry +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +theorem mem_tangent_ball_iff {z y θ : E} (hθ : ‖θ‖ = 1) {L : ℝ} (hL : 0 < L) : + y ∈ Metric.ball (z + L • θ) L ↔ ‖y - z‖ ^ 2 < 2 * L * ⟪y - z, θ⟫ := by + rw [Metric.mem_ball, dist_eq_norm] + have hv : y - (z + L • θ) = (y - z) - L • θ := by abel + rw [hv, ← sq_lt_sq₀ (norm_nonneg _) hL.le, norm_sub_sq_real, + norm_smul, Real.norm_eq_abs, abs_of_pos hL, hθ, mul_one, real_inner_smul_right] + constructor <;> intro h <;> nlinarith + +theorem tangent_ball_mono {z θ : E} (hθ : ‖θ‖ = 1) {L L' : ℝ} + (hL : 0 < L) (hLL' : L ≤ L') : + Metric.ball (z + L • θ) L ⊆ Metric.ball (z + L' • θ) L' := by + intro y hy + rw [mem_tangent_ball_iff hθ hL] at hy + rw [mem_tangent_ball_iff hθ (hL.trans_le hLL')] + have hinner : 0 < ⟪y - z, θ⟫ := by + by_contra hh + have hh' : ⟪y - z, θ⟫ ≤ 0 := le_of_not_gt hh + have := mul_nonpos_of_nonneg_of_nonpos (show 0 ≤ 2 * L by positivity) hh' + nlinarith [sq_nonneg ‖y - z‖] + exact hy.trans_le (mul_le_mul_of_nonneg_right (by linarith) hinner.le) + +def entryParameter (z y θ : E) : ℝ := ‖y - z‖ ^ 2 / (2 * ⟪y - z, θ⟫) + +theorem mem_tangent_ball_iff_entry {z y θ : E} (hθ : ‖θ‖ = 1) + {L : ℝ} (hL : 0 < L) (ha : 0 < ⟪y - z, θ⟫) : + y ∈ Metric.ball (z + L • θ) L ↔ entryParameter z y θ < L := by + rw [mem_tangent_ball_iff hθ hL, entryParameter, div_lt_iff₀ (by positivity)] + ring_nf + +/-- Uniform estimate on the affine difference of squared distances in a thin shell. -/ +theorem shell_square_error {l δ d : ℝ} (hl : 0 ≤ l) (hl3 : l ≤ 3) + (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1 / 4) (hd : 0 ≤ d) (hclose : |d - l| ≤ 2 * δ) : + |d ^ 2 - l ^ 2| ≤ 13 * δ := by + have hd_upper : d ≤ l + 2 * δ := (abs_le.mp hclose).2 |> fun h => by linarith + have hsum : 0 ≤ d + l := add_nonneg hd hl + calc + |d ^ 2 - l ^ 2| = |d - l| * (d + l) := by + rw [show d ^ 2 - l ^ 2 = (d - l) * (d + l) by ring, abs_mul, abs_of_nonneg hsum] + _ ≤ (2 * δ) * (d + l) := mul_le_mul_of_nonneg_right hclose hsum + _ ≤ 13 * δ := by nlinarith + +/-- A shell point separated from the tangency point has positive radial projection. -/ +theorem shell_projection_lower {ρ δ l a w2 : ℝ} + (hρ : 0 < ρ) (hl : 0 < l) (hl3 : l ≤ 3) + (hδ : δ ≤ ρ ^ 2 / 1600) (hw : ρ ^ 2 ≤ w2) + (herr : |w2 - 2 * l * a| ≤ 13 * δ) : + ρ ^ 2 / 12 ≤ a := by + have hr2 : 0 < ρ ^ 2 := sq_pos_of_pos hρ + have he := (abs_le.mp herr).2 + have hla : 0 < a := by nlinarith + nlinarith + +theorem entry_window {ρ δ l a w2 : ℝ} + (hρ : 0 < ρ) (hδ : 0 ≤ δ) (ha : ρ ^ 2 / 12 ≤ a) + (herr : |w2 - 2 * l * a| ≤ 13 * δ) : + |w2 / (2 * a) - l| ≤ 78 * δ / ρ ^ 2 := by + have hr2 : 0 < ρ ^ 2 := sq_pos_of_pos hρ + have ha0 : 0 < a := lt_of_lt_of_le (by positivity) ha + have h2a : 0 < 2 * a := by positivity + rw [show w2 / (2 * a) - l = (w2 - 2 * l * a) / (2 * a) by field_simp, + abs_div, abs_of_pos h2a] + calc + |w2 - 2 * l * a| / (2 * a) ≤ 13 * δ / (2 * a) := + div_le_div_of_nonneg_right herr h2a.le + _ ≤ 78 * δ / ρ ^ 2 := by + apply (div_le_div_iff₀ h2a hr2).2 + nlinarith [mul_le_mul_of_nonneg_right ha hδ] + +/-- Bound for the entry parameter for an actual shell near a tangent disk. -/ +theorem shell_entry_window {z y θ : E} (hθ : ‖θ‖ = 1) {l ρ δ : ℝ} + (hl : 1 / 2 ≤ l) (hl3 : l ≤ 3) (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) + (hδ : 0 < δ) (hδρ : δ ≤ ρ ^ 2 / 1600) + (hsep : ρ ≤ ‖y - z‖) + (hclose : |dist y (z + l • θ) - l| ≤ 2 * δ) : + ρ ^ 2 / 12 ≤ ⟪y - z, θ⟫ ∧ + |entryParameter z y θ - l| ≤ 78 * δ / ρ ^ 2 := by + have hl0 : 0 < l := by linarith + have hδ1 : δ ≤ 1 / 4 := by nlinarith + have hsq : ρ ^ 2 ≤ ‖y - z‖ ^ 2 := + (sq_le_sq₀ hρ.le (norm_nonneg _)).2 hsep + have hd := shell_square_error hl0.le hl3 hδ.le hδ1 (dist_nonneg (x := y)) hclose + have hv : y - (z + l • θ) = (y - z) - l • θ := by abel + have herr : |‖y - z‖ ^ 2 - 2 * l * ⟪y - z, θ⟫| ≤ 13 * δ := by + rw [dist_eq_norm, hv, norm_sub_sq_real, real_inner_smul_right, norm_smul, + Real.norm_eq_abs, abs_of_pos hl0, hθ, mul_one] at hd + convert hd using 1 + congr 1 + ring + have ha := shell_projection_lower hρ hl0 hl3 hδρ hsq herr + exact ⟨ha, entry_window hρ hδ.le ha herr⟩ + +theorem earlier_tangent_disk_subset {z θ : E} (hθ : ‖θ‖ = 1) {l ρ δ : ℝ} + (hl : 1 / 2 ≤ l) (hl3 : l ≤ 3) (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) + (hδ : 0 < δ) (hδρ : δ ≤ ρ ^ 2 / 1600) : + {y : E | ρ ≤ ‖y - z‖} ∩ + Metric.ball (z + (l - 200 * δ / ρ ^ 2) • θ) (l - 200 * δ / ρ ^ 2) ⊆ + Metric.ball (z + l • θ) (l - 2 * δ) := by + let v : ℝ := 200 * δ / ρ ^ 2 + have hr2 : 0 < ρ ^ 2 := sq_pos_of_pos hρ + have hvpos : 0 < v := by dsimp [v]; positivity + have hvsmall : v ≤ 1 / 8 := by + dsimp [v] + apply (div_le_iff₀ hr2).2 + linarith + have hv_eq : v * ρ ^ 2 = 200 * δ := by + dsimp [v]; exact div_mul_cancel₀ _ hr2.ne' + have hl0 : 0 < l := by linarith + have hlv : 0 < l - v := by linarith + have hδquarter : δ ≤ 1 / 4 := by nlinarith + have hrad : 0 < l - 2 * δ := by nlinarith + rintro y ⟨hsep, hy⟩ + change y ∈ Metric.ball (z + (l - v) • θ) (l - v) at hy + rw [mem_tangent_ball_iff hθ hlv] at hy + have hnorm : ρ ^ 2 ≤ ‖y - z‖ ^ 2 := + (sq_le_sq₀ hρ.le (norm_nonneg _)).2 hsep + have hapos : 0 < ⟪y - z, θ⟫ := by + by_contra ha + have hmul := mul_nonpos_of_nonneg_of_nonpos + (show 0 ≤ 2 * (l - v) by positivity) (le_of_not_gt ha) + nlinarith + have halower : ρ ^ 2 / 6 < ⟪y - z, θ⟫ := by nlinarith + have hva := mul_lt_mul_of_pos_left halower hvpos + have hsqdist : dist y (z + l • θ) ^ 2 < (l - 2 * δ) ^ 2 := by + rw [dist_eq_norm, show y - (z + l • θ) = (y - z) - l • θ by abel, + norm_sub_sq_real, real_inner_smul_right, norm_smul, Real.norm_eq_abs, + abs_of_pos hl0, hθ, mul_one] + nlinarith [mul_le_mul_of_nonneg_right hl3 hδ.le] + exact (sq_lt_sq₀ dist_nonneg hrad.le).1 hsqdist + +end DiskGeometry + +namespace DiskGeometry + +/-- Cancellation of translated monotone integrals on a finite interval. -/ +theorem monotone_increment_interval {G : ℝ → ℝ} (hG : Monotone G) + {C v : ℝ} (h0 : ∀ x, 0 ≤ G x) (hC : ∀ x, G x ≤ C) (hv : 0 ≤ v) + (a b : ℝ) : + (∫ l in a..b, (G (l + v) - G (l - v))) ≤ 2 * v * C := by + have hp : Monotone (fun l => G (l + v)) := hG.comp (by intro x y h; dsimp; linarith) + have hm : Monotone (fun l => G (l - v)) := hG.comp (fun _ _ h => sub_le_sub_right h v) + rw [intervalIntegral.integral_sub hp.intervalIntegrable hm.intervalIntegrable, + intervalIntegral.integral_comp_add_right, intervalIntegral.integral_comp_sub_right, + intervalIntegral.integral_interval_sub_interval_comm' hG.intervalIntegrable + hG.intervalIntegrable hG.intervalIntegrable] + have hn : 0 ≤ ∫ l in a - v..a + v, G l := + intervalIntegral.integral_nonneg_of_forall (by linarith) h0 + have hb : (∫ l in b - v..b + v, G l) ≤ 2 * v * C := by + calc + (∫ l in b - v..b + v, G l) ≤ ∫ l in b - v..b + v, C := + intervalIntegral.integral_mono (by linarith) hG.intervalIntegrable + intervalIntegrable_const hC + _ = 2 * v * C := by + rw [intervalIntegral.integral_const] + change ((b + v) - (b - v)) * C = _ + ring + linarith + +theorem monotone_increment_integrable {G : ℝ → ℝ} (hG : Monotone G) + {C v : ℝ} (h0 : ∀ x, 0 ≤ G x) (hC : ∀ x, G x ≤ C) (hv : 0 ≤ v) : + Integrable (fun l => G (l + v) - G (l - v)) ∧ + (∫ l, (G (l + v) - G (l - v))) ≤ 2 * v * C := by + have hp : Monotone (fun l => G (l + v)) := hG.comp (by intro x y h; dsimp; linarith) + have hm : Monotone (fun l => G (l - v)) := hG.comp (fun _ _ h => sub_le_sub_right h v) + have hn (l : ℝ) : 0 ≤ G (l + v) - G (l - v) := sub_nonneg.mpr (hG (by linarith)) + have hi (a b : ℝ) : IntervalIntegrable (fun l => G (l + v) - G (l - v)) volume a b := + hp.intervalIntegrable.sub hm.intervalIntegrable + have htop : Tendsto (fun n : ℕ => (n : ℝ)) atTop atTop := tendsto_natCast_atTop_atTop + have hbot : Tendsto (fun n : ℕ => -(n : ℝ)) atTop atBot := tendsto_neg_atTop_atBot.comp htop + have hint : Integrable (fun l => G (l + v) - G (l - v)) := by + apply integrable_of_intervalIntegral_norm_bounded (2 * v * C) + (fun n : ℕ => (hi (-(n : ℝ)) n).1) hbot htop + exact Eventually.of_forall (fun n => by + simp_rw [Real.norm_of_nonneg (hn _)] + exact monotone_increment_interval hG h0 hC hv _ _) + refine ⟨hint, ?_⟩ + exact le_of_tendsto (intervalIntegral_tendsto_integral hint hbot htop) + (Eventually.of_forall (fun n => monotone_increment_interval hG h0 hC hv (-(n : ℝ)) n)) + +/-- The permitted jump times have uniformly bounded length, independent of the +size of the original positive measure. Only its truncated distribution is used. -/ +theorem monotone_jump_window_measure {H : ℝ → ℝ} (hH : Monotone H) + (hH0 : ∀ l, 0 ≤ H l) {T U v : ℝ} (hT : 0 ≤ T) (hU : 0 < U) (hv : 0 ≤ v) : + volume {l | H (l - v) ≤ T ∧ U ≤ H (l + v) - H (l - v)} ≤ + ENNReal.ofReal (2 * v * (1 + T / U)) := by + let G : ℝ → ℝ := fun l => min (H l) (T + U) + have hG : Monotone G := hH.min monotone_const + have hG0 : ∀ l, 0 ≤ G l := fun l => le_min (hH0 l) (by positivity) + have hGC : ∀ l, G l ≤ T + U := fun l => min_le_right _ _ + obtain ⟨hi, hb⟩ := monotone_increment_integrable hG hG0 hGC hv + have hn (l : ℝ) : 0 ≤ G (l + v) - G (l - v) := sub_nonneg.mpr (hG (by linarith)) + have hmi : Integrable (fun l => (G (l + v) - G (l - v)) / U) := hi.div_const U + have hm := hmi.measure_le_integral + (Eventually.of_forall (fun l => div_nonneg (hn l) hU.le)) + (s := {l | H (l - v) ≤ T ∧ U ≤ H (l + v) - H (l - v)}) (by + intro l hl + rw [le_div_iff₀ hU, one_mul] + have hd : G (l - v) = H (l - v) := min_eq_left (by linarith [hl.1]) + rw [hd] + change U ≤ min (H (l + v)) (T + U) - H (l - v) + rw [le_sub_iff_add_le, le_min_iff] + exact ⟨by linarith [hl.2], by linarith [hl.1]⟩) + calc + volume {l | H (l - v) ≤ T ∧ U ≤ H (l + v) - H (l - v)} ≤ + ENNReal.ofReal (∫ l, (G (l + v) - G (l - v)) / U) := hm + _ ≤ ENNReal.ofReal (2 * v * (1 + T / U)) := by + apply ENNReal.ofReal_le_ofReal + rw [integral_div] + calc + (∫ l, G (l + v) - G (l - v)) / U ≤ (2 * v * (T + U)) / U := + div_le_div_of_nonneg_right hb hU.le + _ = 2 * v * (1 + T / U) := by field_simp; ring + +end DiskGeometry + +namespace DiskGeometry + +/-- A polar-coordinate area bound from uniform lengths of radial sections. -/ +theorem volume_le_radial_sections {s : Set ℂ} (hs : MeasurableSet s) + (z : ℂ) {R : ℝ} (hR : 0 ≤ R) {B : ℝ≥0∞} + (hbound : ∀ x ∈ s, ‖x - z‖ ≤ R) + (hsections : ∀ θ : ℝ, volume {r : ℝ | 0 < r ∧ + z + (r : ℂ) * ((Real.cos θ : ℂ) + (Real.sin θ : ℂ) * Complex.I) ∈ s} ≤ B) : + volume s ≤ ENNReal.ofReal (2 * Real.pi * R) * B := by + classical + let f : ℂ → ℝ≥0∞ := s.indicator 1 + have hf : Measurable f := measurable_const.indicator hs + have hfc : Measurable (fun p : ℝ × ℝ => f (z + Complex.polarCoord.symm p)) := by + apply hf.comp + simp only [Complex.polarCoord_symm_apply] + fun_prop + have hpolar : volume s = ∫⁻ p in polarCoord.target, + ENNReal.ofReal p.1 * f (z + Complex.polarCoord.symm p) := by + rw [← lintegral_indicator_one hs] + change (∫⁻ x, f x) = _ + rw [← lintegral_add_left_eq_self f z, + ← Complex.lintegral_comp_polarCoord_symm (fun x => f (z + x))] + rfl + have hinner (θ : ℝ) : (∫⁻ r in Ioi (0 : ℝ), f (z + Complex.polarCoord.symm (r, θ))) ≤ B := by + let A : Set ℝ := {r | 0 < r ∧ + z + (r : ℂ) * ((Real.cos θ : ℂ) + (Real.sin θ : ℂ) * Complex.I) ∈ s} + have hA : MeasurableSet A := measurableSet_Ioi.inter (hs.preimage (by fun_prop)) + calc + _ = ∫⁻ r, A.indicator 1 r := by + rw [← lintegral_indicator measurableSet_Ioi] + apply lintegral_congr + intro r + by_cases hr : 0 < r <;> + by_cases hx : z + (r : ℂ) * ((Real.cos θ : ℂ) + (Real.sin θ : ℂ) * Complex.I) ∈ s <;> + simp only [f, A, Complex.polarCoord_symm_apply, Set.indicator_apply, + mem_Ioi, mem_ofPred_eq, Pi.one_apply, hr, hx, + and_true, and_false, ite_true, ite_false] + _ = volume A := lintegral_indicator_one hA + _ ≤ B := hsections θ + calc + volume s = ∫⁻ p in polarCoord.target, + ENNReal.ofReal p.1 * f (z + Complex.polarCoord.symm p) := hpolar + _ ≤ ∫⁻ p in polarCoord.target, + ENNReal.ofReal R * f (z + Complex.polarCoord.symm p) := by + apply setLIntegral_mono' polarCoord.open_target.measurableSet + intro p hp + by_cases hx : z + Complex.polarCoord.symm p ∈ s + · gcongr + have hn := hbound _ hx + rw [add_sub_cancel_left, Complex.norm_polarCoord_symm, abs_of_pos hp.1] at hn + exact hn + · simp only [f, indicator_of_notMem hx, mul_zero, le_refl] + _ = ENNReal.ofReal R * ∫⁻ θ in Ioo (-Real.pi) Real.pi, + ∫⁻ r in Ioi (0 : ℝ), f (z + Complex.polarCoord.symm (r, θ)) := by + rw [lintegral_const_mul _ hfc] + congr 1 + exact setLIntegral_prod_symm _ hfc.aemeasurable + _ ≤ ENNReal.ofReal R * ∫⁻ θ in Ioo (-Real.pi) Real.pi, B := by + gcongr with θ + exact hinner θ + _ = ENNReal.ofReal (2 * Real.pi * R) * B := by + rw [lintegral_const, Measure.restrict_apply_univ, Real.volume_Ioo] + rw [show Real.pi - -Real.pi = 2 * Real.pi by ring] + rw [mul_comm (2 * Real.pi) R, ENNReal.ofReal_mul hR] + ac_rfl + +end DiskGeometry + +namespace DiskGeometry + +/-- Mass in the increasing family of tangent disks, away from its tangency cap. -/ +def tangentMass (S : Measure ℂ) (ρ : ℝ) (z θ : ℂ) (L : ℝ) : ℝ := + (S ({y : ℂ | ρ ≤ ‖y - z‖} ∩ Metric.ball (z + L • θ) L)).toReal + +theorem tangentMass_nonneg (S : Measure ℂ) (ρ : ℝ) (z θ : ℂ) (L : ℝ) : + 0 ≤ tangentMass S ρ z θ L := ENNReal.toReal_nonneg + +theorem tangentMass_mono (S : Measure ℂ) [IsFiniteMeasure S] (ρ : ℝ) + (z θ : ℂ) (hθ : ‖θ‖ = 1) : Monotone (tangentMass S ρ z θ) := by + intro L L' hLL' + by_cases hL : 0 < L + · apply ENNReal.toReal_mono (measure_ne_top S _) + exact measure_mono (inter_subset_inter_right _ (tangent_ball_mono hθ hL hLL')) + · have hball : Metric.ball (z + L • θ) L = ∅ := Metric.ball_eq_empty.mpr (le_of_not_gt hL) + simp only [tangentMass, hball, inter_empty, measure_empty, ENNReal.toReal_zero] + exact ENNReal.toReal_nonneg + +theorem measurable_tangentMass (S : Measure ℂ) [IsFiniteMeasure S] (ρ : ℝ) + {α : Type*} [MeasurableSpace α] {z θ : α → ℂ} {L : α → ℝ} + (hz : Measurable z) (hθ : Measurable θ) (hL : Measurable L) : + Measurable (fun a => tangentMass S ρ (z a) (θ a) (L a)) := by + have hm : MeasurableSet {p : α × ℂ | ρ ≤ ‖p.2 - z p.1‖ ∧ + dist p.2 (z p.1 + L p.1 • θ p.1) < L p.1} := by + exact (measurableSet_le measurable_const ((measurable_snd.sub (hz.comp measurable_fst)).norm)).inter + (measurableSet_lt (measurable_snd.dist ((hz.comp measurable_fst).add + ((hL.comp measurable_fst).smul (hθ.comp measurable_fst)))) (hL.comp measurable_fst)) + exact (measurable_measure_prodMk_left (ν := S) hm).ennreal_toReal + +/-- The measurable condition whose planar cost is bounded by the ray-length estimate. -/ +def rayCondition (S : Measure ℂ) (ρ T U v : ℝ) (x z : ℂ) : Prop := + 1 / 2 ≤ ‖x - z‖ ∧ ‖x - z‖ ≤ 3 ∧ + tangentMass S ρ z (‖x - z‖⁻¹ • (x - z)) (‖x - z‖ - v) ≤ T ∧ + U ≤ tangentMass S ρ z (‖x - z‖⁻¹ • (x - z)) (‖x - z‖ + v) - + tangentMass S ρ z (‖x - z‖⁻¹ • (x - z)) (‖x - z‖ - v) + +theorem measurableSet_rayCondition (S : Measure ℂ) [IsFiniteMeasure S] + (ρ T U v : ℝ) : MeasurableSet {p : ℂ × ℂ | rayCondition S ρ T U v p.1 p.2} := by + have hn : Measurable (fun p : ℂ × ℂ => ‖p.1 - p.2‖) := by fun_prop + have hdir : Measurable (fun p : ℂ × ℂ => ‖p.1 - p.2‖⁻¹ • (p.1 - p.2)) := by fun_prop + have hm := measurable_tangentMass S ρ measurable_snd hdir (hn.sub_const v) + have hp := measurable_tangentMass S ρ measurable_snd hdir (hn.add_const v) + exact (measurableSet_le measurable_const hn).inter + ((measurableSet_le hn measurable_const).inter + ((measurableSet_le hm measurable_const).inter (measurableSet_le measurable_const (hp.sub hm)))) + +/-- Full two-dimensional ray-condition estimate, independent of the chosen radius. -/ +theorem volume_rayCondition (S : Measure ℂ) [IsFiniteMeasure S] (ρ : ℝ) + {T U v : ℝ} (hT : 0 ≤ T) (hU : 0 < U) (hv : 0 ≤ v) (z : ℂ) : + volume {x : ℂ | rayCondition S ρ T U v x z} ≤ + ENNReal.ofReal (6 * Real.pi) * ENNReal.ofReal (2 * v * (1 + T / U)) := by + have hs : MeasurableSet {x : ℂ | rayCondition S ρ T U v x z} := + (measurableSet_rayCondition S ρ T U v).preimage + (show Measurable (fun x : ℂ => (x, z)) by fun_prop) + have hbound : ∀ x ∈ {x : ℂ | rayCondition S ρ T U v x z}, ‖x - z‖ ≤ 3 := + fun _ h => h.2.1 + have hsections (a : ℝ) : volume {r : ℝ | 0 < r ∧ + z + (r : ℂ) * ((Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I) ∈ + {x : ℂ | rayCondition S ρ T U v x z}} ≤ + ENNReal.ofReal (2 * v * (1 + T / U)) := by + let θ : ℂ := (Real.cos a : ℂ) + (Real.sin a : ℂ) * Complex.I + have hθ : ‖θ‖ = 1 := by + simpa only [θ, Complex.ofReal_cos, Complex.ofReal_sin] using Complex.norm_cos_add_sin_mul_I a + apply le_trans (measure_mono (t := {l : ℝ | tangentMass S ρ z θ (l - v) ≤ T ∧ + U ≤ tangentMass S ρ z θ (l + v) - tangentMass S ρ z θ (l - v)}) ?_) + (monotone_jump_window_measure (tangentMass_mono S ρ z θ hθ) + (tangentMass_nonneg S ρ z θ) hT hU hv) + rintro r ⟨hr, hx⟩ + have hnorm : ‖z + (r : ℂ) * θ - z‖ = r := by + rw [add_sub_cancel_left, norm_mul, Complex.norm_real, Real.norm_eq_abs, abs_of_pos hr, hθ, mul_one] + have hdir : ‖z + (r : ℂ) * θ - z‖⁻¹ • (z + (r : ℂ) * θ - z) = θ := by + rw [hnorm, add_sub_cancel_left, ← Complex.real_smul, smul_smul, inv_mul_cancel₀ hr.ne', one_smul] + change rayCondition S ρ T U v (z + (r : ℂ) * θ) z at hx + rw [rayCondition] at hx + rw [hdir, hnorm] at hx + exact hx.2.2 + simpa only [show (2 : ℝ) * Real.pi * 3 = 6 * Real.pi by ring] using + volume_le_radial_sections hs z (by norm_num : (0 : ℝ) ≤ 3) hbound hsections + +end DiskGeometry + +namespace DiskGeometry + +def thinShell (x : ℂ) (r δ : ℝ) : Set ℂ := {y | |‖y - x‖ - r| ≤ δ} + +theorem measurableSet_thinShell (x : ℂ) (r δ : ℝ) : MeasurableSet (thinShell x r δ) := by + exact measurableSet_le (by fun_prop) measurable_const + +theorem shell_center_bounds {x z : ℂ} {r δ : ℝ} (hr : r ∈ Icc (1 : ℝ) 2) + (hδ : δ ≤ 1 / 4) (hz : z ∈ thinShell x r δ) : + 1 / 2 ≤ ‖x - z‖ ∧ ‖x - z‖ ≤ 3 := by + change |‖z - x‖ - r| ≤ δ at hz + have hh := abs_le.mp hz + rw [norm_sub_rev z x] at hh + constructor <;> linarith [hr.1, hr.2] + +theorem shell_pair_close {x y z : ℂ} {r δ : ℝ} + (hy : y ∈ thinShell x r δ) (hz : z ∈ thinShell x r δ) : + |‖y - x‖ - ‖x - z‖| ≤ 2 * δ := by + change |‖y - x‖ - r| ≤ δ at hy + change |‖z - x‖ - r| ≤ δ at hz + have hy' := abs_le.mp hy + have hz' := abs_le.mp hz + rw [norm_sub_rev z x] at hz' + exact abs_le.mpr ⟨by linarith [hy'.1, hz'.2], by linarith [hy'.2, hz'.1]⟩ + +/-- Every distant point of the thin shell crosses the tangent disks in the short window. -/ +theorem shell_subset_tangent_difference {z θ : ℂ} (hθ : ‖θ‖ = 1) {l ρ δ : ℝ} + (hl : 1 / 2 ≤ l) (hl3 : l ≤ 3) (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) + (hδ : 0 < δ) (hδρ : δ ≤ ρ ^ 2 / 1600) : + {y : ℂ | ρ ≤ ‖y - z‖ ∧ |‖y - (z + l • θ)‖ - l| ≤ 2 * δ} ⊆ + ({y : ℂ | ρ ≤ ‖y - z‖} ∩ + Metric.ball (z + (l + 200 * δ / ρ ^ 2) • θ) (l + 200 * δ / ρ ^ 2)) \ + ({y : ℂ | ρ ≤ ‖y - z‖} ∩ + Metric.ball (z + (l - 200 * δ / ρ ^ 2) • θ) (l - 200 * δ / ρ ^ 2)) := by + let v : ℝ := 200 * δ / ρ ^ 2 + have hr2 : 0 < ρ ^ 2 := sq_pos_of_pos hρ + have hvp : 0 < v := by dsimp [v]; positivity + have hvs : v ≤ 1 / 8 := by + dsimp [v] + apply (div_le_iff₀ hr2).2 + linarith + have hlm : 0 < l - v := by linarith + have hlp : 0 < l + v := by linarith + have h78 : 78 * δ / ρ ^ 2 < v := by + dsimp [v] + exact (div_lt_div_iff_of_pos_right hr2).2 (by linarith) + rintro y ⟨hsep, hclose⟩ + obtain ⟨ha, hw⟩ := shell_entry_window hθ hl hl3 hρ hρ1 hδ hδρ hsep (by + simpa only [dist_eq_norm] using hclose) + have ha0 : 0 < ⟪y - z, θ⟫ := lt_of_lt_of_le (by positivity) ha + have hentrylo : l - v < entryParameter z y θ := by linarith [(abs_le.mp hw).1] + have hentryhi : entryParameter z y θ < l + v := by linarith [(abs_le.mp hw).2] + refine ⟨⟨hsep, (mem_tangent_ball_iff_entry hθ hlp ha0).2 hentryhi⟩, ?_⟩ + rintro ⟨_, hm⟩ + have hm' := (mem_tangent_ball_iff_entry hθ hlm ha0).1 hm + linarith + +/-- The shell mass away from a cap is bounded by the one-dimensional tangent-mass jump. -/ +theorem shell_mass_le_jump (S : Measure ℂ) [IsFiniteMeasure S] + {x z : ℂ} {r ρ δ : ℝ} (hr : r ∈ Icc (1 : ℝ) 2) (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) + (hδ : 0 < δ) (hδρ : δ ≤ ρ ^ 2 / 1600) (hz : z ∈ thinShell x r δ) : + (S (thinShell x r δ \ Metric.ball z ρ)).toReal ≤ + tangentMass S ρ z (‖x - z‖⁻¹ • (x - z)) (‖x - z‖ + 200 * δ / ρ ^ 2) - + tangentMass S ρ z (‖x - z‖⁻¹ • (x - z)) (‖x - z‖ - 200 * δ / ρ ^ 2) := by + let l : ℝ := ‖x - z‖ + let θ : ℂ := l⁻¹ • (x - z) + have hδquarter : δ ≤ 1 / 4 := by nlinarith + obtain ⟨hl, hl3⟩ := shell_center_bounds hr hδquarter hz + have hl0 : 0 < l := by dsimp [l]; linarith + have hθ : ‖θ‖ = 1 := by + dsimp only [θ] + rw [norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hl0.le)] + exact inv_mul_cancel₀ hl0.ne' + have hx : z + l • θ = x := by + dsimp only [θ] + rw [smul_smul, mul_inv_cancel₀ hl0.ne', one_smul] + abel + let A := {y : ℂ | ρ ≤ ‖y - z‖} ∩ + Metric.ball (z + (l - 200 * δ / ρ ^ 2) • θ) (l - 200 * δ / ρ ^ 2) + let B := {y : ℂ | ρ ≤ ‖y - z‖} ∩ + Metric.ball (z + (l + 200 * δ / ρ ^ 2) • θ) (l + 200 * δ / ρ ^ 2) + have hAm : MeasurableSet A := (measurableSet_le measurable_const (by fun_prop)).inter + Metric.isOpen_ball.measurableSet + have hsub : thinShell x r δ \ Metric.ball z ρ ⊆ B \ A := by + apply subset_trans _ (shell_subset_tangent_difference hθ hl hl3 hρ hρ1 hδ hδρ) + rintro y ⟨hy, hyz⟩ + exact ⟨le_of_not_gt (by simpa only [Metric.mem_ball, dist_eq_norm] using hyz), + by rw [hx]; exact shell_pair_close hy hz⟩ + have hAB : A ⊆ B := by + apply inter_subset_inter_right + apply tangent_ball_mono hθ + · have : 200 * δ / ρ ^ 2 ≤ 1 / 8 := by + apply (div_le_iff₀ (sq_pos_of_pos hρ)).2 + linarith + change 0 < l - 200 * δ / ρ ^ 2 + linarith + · have : 0 ≤ 200 * δ / ρ ^ 2 := by positivity + linarith + have hmass := ENNReal.toReal_mono (measure_ne_top S (B \ A)) (measure_mono hsub) + rw [measure_sdiff hAB hAm.nullMeasurableSet (measure_ne_top S A), + ENNReal.toReal_sub_of_le (measure_mono hAB) (measure_ne_top S B)] at hmass + exact hmass + +/-- The earlier tangent-disk mass is controlled by the concentric interior mass. -/ +theorem earlier_mass_le_interior (S : Measure ℂ) [IsFiniteMeasure S] + {x z : ℂ} {r ρ δ : ℝ} (hr : r ∈ Icc (1 : ℝ) 2) (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) + (hδ : 0 < δ) (hδρ : δ ≤ ρ ^ 2 / 1600) (hz : z ∈ thinShell x r δ) : + tangentMass S ρ z (‖x - z‖⁻¹ • (x - z)) (‖x - z‖ - 200 * δ / ρ ^ 2) ≤ + (S (Metric.ball x (r - δ))).toReal := by + let l : ℝ := ‖x - z‖ + let θ : ℂ := l⁻¹ • (x - z) + have hδquarter : δ ≤ 1 / 4 := by nlinarith + obtain ⟨hl, hl3⟩ := shell_center_bounds hr hδquarter hz + have hl0 : 0 < l := by dsimp [l]; linarith + have hθ : ‖θ‖ = 1 := by + dsimp only [θ] + rw [norm_smul, Real.norm_of_nonneg (inv_nonneg.mpr hl0.le)] + exact inv_mul_cancel₀ hl0.ne' + have hx : z + l • θ = x := by + dsimp only [θ] + rw [smul_smul, mul_inv_cancel₀ hl0.ne', one_smul] + abel + apply ENNReal.toReal_mono (measure_ne_top S _) + apply measure_mono + apply (earlier_tangent_disk_subset hθ hl hl3 hρ hρ1 hδ hδρ).trans + rw [hx] + apply Metric.ball_subset_ball + change |‖z - x‖ - r| ≤ δ at hz + have hh := (abs_le.mp hz).2 + rw [norm_sub_rev z x] at hh + change l - 2 * δ ≤ r - δ + dsimp [l] + linarith + +end DiskGeometry + +namespace DiskGeometry + +/-- Area of a strip with continuously moving interval fibers. -/ +theorem volume_interval_fibers (c : ℝ → ℝ) (hc : Continuous c) + (lo hi w : ℝ) : + volume {p : ℝ × ℝ | p.2 ∈ Icc lo hi ∧ + p.1 ∈ Icc (c p.2 - w) (c p.2 + w)} = + ENNReal.ofReal (hi - lo) * ENNReal.ofReal (2 * w) := by + have hs : MeasurableSet {p : ℝ × ℝ | p.2 ∈ Icc lo hi ∧ + p.1 ∈ Icc (c p.2 - w) (c p.2 + w)} := by + exact (measurableSet_Icc.preimage continuous_snd.measurable).inter + ((isClosed_le (hc.comp continuous_snd |>.sub continuous_const) continuous_fst).measurableSet.inter + (isClosed_le continuous_fst (hc.comp continuous_snd |>.add continuous_const)).measurableSet) + change (volume.prod volume) _ = _ + rw [Measure.prod_apply_symm hs] + have hf (y : ℝ) : + volume ((fun x : ℝ => (x, y)) ⁻¹' {p : ℝ × ℝ | p.2 ∈ Icc lo hi ∧ + p.1 ∈ Icc (c p.2 - w) (c p.2 + w)}) = + (Icc lo hi).indicator (fun _ => ENNReal.ofReal (2 * w)) y := by + by_cases hy : y ∈ Icc lo hi + · simp only [preimage_ofPred_eq, hy, true_and, indicator_of_mem hy] + change volume (Icc (c y - w) (c y + w)) = _ + rw [Real.volume_Icc] + congr 1 + ring + · simp only [preimage_ofPred_eq, hy, false_and, ofPred_false, measure_empty, indicator_of_notMem hy] + simp_rw [hf] + rw [lintegral_indicator measurableSet_Icc, lintegral_const, Measure.restrict_apply_univ, + Real.volume_Icc, mul_comm] + +/-- A nonvertical affine strip cut off in the second coordinate. -/ +theorem volume_affine_strip {a : ℝ} (ha : a ≠ 0) (b c d R w : ℝ) : + volume {p : ℝ × ℝ | |p.2 - d| ≤ R ∧ |a * p.1 + b * p.2 + c| ≤ w} = + ENNReal.ofReal (2 * R) * ENNReal.ofReal (2 * (w / |a|)) := by + have hs : {p : ℝ × ℝ | |p.2 - d| ≤ R ∧ |a * p.1 + b * p.2 + c| ≤ w} = + {p : ℝ × ℝ | p.2 ∈ Icc (d - R) (d + R) ∧ + p.1 ∈ Icc (-(b * p.2 + c) / a - w / |a|) + (-(b * p.2 + c) / a + w / |a|)} := by + ext p + simp only [mem_ofPred_eq, mem_Icc] + have heq : a * p.1 + b * p.2 + c = a * (p.1 - -(b * p.2 + c) / a) := by + field_simp + ring + rw [heq, abs_mul, ← le_div_iff₀' (abs_pos.mpr ha)] + simp only [abs_le] + constructor <;> rintro ⟨⟨h1, h2⟩, h3, h4⟩ <;> constructor <;> constructor <;> linarith + rw [hs] + rw [volume_interval_fibers (fun y => -(b * y + c) / a) (by fun_prop)] + congr 2 + ring + +/-- At least one coordinate sees half the Euclidean separation. -/ +theorem complex_coordinate_separation {z : ℂ} {ρ : ℝ} (hz : ρ ≤ ‖z‖) : + ρ / 2 ≤ |z.re| ∨ ρ / 2 ≤ |z.im| := by + by_contra h + push Not at h + have hnorm : ‖z‖ ≤ |z.re| + |z.im| := Complex.norm_le_abs_re_add_abs_im z + linarith + +/-- The centers of two separated points lying on an almost common circle form +an affine strip of small area. No selected radius occurs here. -/ +theorem volume_two_point_strip {y z : ℂ} {ρ δ : ℝ} (hρ : 0 < ρ) (hδ : 0 ≤ δ) + (hyz : ρ ≤ ‖y - z‖) : + volume {x : ℂ | ‖x - z‖ ≤ 3 ∧ |‖x - y‖ ^ 2 - ‖x - z‖ ^ 2| ≤ 13 * δ} ≤ + ENNReal.ofReal (156 * δ / ρ) := by + let a : ℝ := 2 * (z.re - y.re) + let b : ℝ := 2 * (z.im - y.im) + let c : ℝ := ‖y‖ ^ 2 - ‖z‖ ^ 2 + have halg (x : ℂ) : ‖x - y‖ ^ 2 - ‖x - z‖ ^ 2 = a * x.re + b * x.im + c := by + simp only [Complex.sq_norm, Complex.normSq_apply, Complex.sub_re, Complex.sub_im, a, b, c] + ring + have hsplit := complex_coordinate_separation hyz + have hmain (a b c d : ℝ) (ha : ρ ≤ |a|) : + volume {p : ℝ × ℝ | |p.2 - d| ≤ 3 ∧ |a * p.1 + b * p.2 + c| ≤ 13 * δ} ≤ + ENNReal.ofReal (156 * δ / ρ) := by + have hap : 0 < |a| := hρ.trans_le ha + rw [volume_affine_strip (abs_pos.mp hap)] + rw [← ENNReal.ofReal_mul (by norm_num)] + apply ENNReal.ofReal_le_ofReal + calc + (2 * 3) * (2 * (13 * δ / |a|)) = 156 * δ / |a| := by ring + _ ≤ 156 * δ / ρ := div_le_div_of_nonneg_left (by positivity) hρ ha + rcases hsplit with hre | him + · have ha : ρ ≤ |a| := by + dsimp [a] + rw [abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2), abs_sub_comm] + simpa only [Complex.sub_re] using (show ρ ≤ 2 * |(y - z).re| by linarith) + let s : Set (ℝ × ℝ) := {p | |p.2 - z.im| ≤ 3 ∧ |a * p.1 + b * p.2 + c| ≤ 13 * δ} + have hsub : {x : ℂ | ‖x - z‖ ≤ 3 ∧ |‖x - y‖ ^ 2 - ‖x - z‖ ^ 2| ≤ 13 * δ} ⊆ + Complex.measurableEquivRealProd ⁻¹' s := by + intro x hx + exact ⟨(Complex.abs_im_le_norm (x - z)).trans hx.1, by simpa [halg x] using hx.2⟩ + have hs : MeasurableSet s := by + exact (isClosed_le (show Continuous (fun p : ℝ × ℝ => |p.2 - z.im|) from by fun_prop) + continuous_const).measurableSet.inter + (isClosed_le (show Continuous (fun p : ℝ × ℝ => |a * p.1 + b * p.2 + c|) from by fun_prop) + continuous_const).measurableSet + calc + _ ≤ volume (Complex.measurableEquivRealProd ⁻¹' s) := measure_mono hsub + _ = volume s := Complex.volume_preserving_equiv_real_prod.measure_preimage hs.nullMeasurableSet + _ ≤ _ := hmain a b c z.im ha + · have hb : ρ ≤ |b| := by + dsimp [b] + rw [abs_mul, abs_of_pos (by norm_num : (0 : ℝ) < 2), abs_sub_comm] + simpa only [Complex.sub_im] using (show ρ ≤ 2 * |(y - z).im| by linarith) + let s : Set (ℝ × ℝ) := {p | |p.2 - z.re| ≤ 3 ∧ |b * p.1 + a * p.2 + c| ≤ 13 * δ} + have hmp : MeasurePreserving (fun x : ℂ => (x.im, x.re)) := + Measure.measurePreserving_swap.comp Complex.volume_preserving_equiv_real_prod + have hsub : {x : ℂ | ‖x - z‖ ≤ 3 ∧ |‖x - y‖ ^ 2 - ‖x - z‖ ^ 2| ≤ 13 * δ} ⊆ + (fun x : ℂ => (x.im, x.re)) ⁻¹' s := by + intro x hx + refine ⟨(Complex.abs_re_le_norm (x - z)).trans hx.1, ?_⟩ + simpa only [halg x, add_comm (a * x.re) (b * x.im)] using hx.2 + have hs : MeasurableSet s := by + exact (isClosed_le (show Continuous (fun p : ℝ × ℝ => |p.2 - z.re|) from by fun_prop) + continuous_const).measurableSet.inter + (isClosed_le (show Continuous (fun p : ℝ × ℝ => |b * p.1 + a * p.2 + c|) from by fun_prop) + continuous_const).measurableSet + calc + _ ≤ volume ((fun x : ℂ => (x.im, x.re)) ⁻¹' s) := measure_mono hsub + _ = volume s := hmp.measure_preimage hs.nullMeasurableSet + _ ≤ _ := hmain b a c z.re hb + +end DiskGeometry + +namespace DiskGeometry + +def pairCondition (ρ δ : ℝ) (x z y : ℂ) : Prop := + 1 / 2 ≤ ‖x - z‖ ∧ ‖x - z‖ ≤ 3 ∧ + |‖y - x‖ - ‖x - z‖| ≤ 2 * δ ∧ ρ ≤ ‖y - z‖ + +theorem measurableSet_pairCondition (ρ δ : ℝ) : + MeasurableSet {p : (ℂ × ℂ) × ℂ | pairCondition ρ δ p.1.1 p.1.2 p.2} := by + have hn : Measurable (fun p : (ℂ × ℂ) × ℂ => ‖p.1.1 - p.1.2‖) := by fun_prop + have hc : Measurable (fun p : (ℂ × ℂ) × ℂ => |‖p.2 - p.1.1‖ - ‖p.1.1 - p.1.2‖|) := by fun_prop + have hs : Measurable (fun p : (ℂ × ℂ) × ℂ => ‖p.2 - p.1.2‖) := by fun_prop + exact (measurableSet_le measurable_const hn).inter + ((measurableSet_le hn measurable_const).inter + ((measurableSet_le hc measurable_const).inter (measurableSet_le measurable_const hs))) + +theorem volume_pairCondition {ρ δ : ℝ} (hρ : 0 < ρ) + (hδ : 0 ≤ δ) (hδquarter : δ ≤ 1 / 4) (z y : ℂ) : + volume {x : ℂ | pairCondition ρ δ x z y} ≤ ENNReal.ofReal (156 * δ / ρ) := by + by_cases hsep : ρ ≤ ‖y - z‖ + · apply le_trans (measure_mono (t := {x : ℂ | ‖x - z‖ ≤ 3 ∧ + |‖x - y‖ ^ 2 - ‖x - z‖ ^ 2| ≤ 13 * δ}) ?_) + (volume_two_point_strip hρ hδ hsep) + intro x hx + obtain ⟨hl, hl3, hc, _⟩ := hx + refine ⟨hl3, ?_⟩ + rw [norm_sub_rev x y] + exact shell_square_error (norm_nonneg _) hl3 hδ hδquarter (norm_nonneg _) hc + · have he : {x : ℂ | pairCondition ρ δ x z y} = ∅ := by + ext x + simp only [mem_ofPred_eq, mem_empty_iff_false, iff_false] + exact fun h => hsep h.2.2.2 + rw [he, measure_empty] + exact bot_le + +def pairMass (ν : Measure ℂ) (ρ δ : ℝ) (x z : ℂ) : ℝ≥0∞ := + ν {y : ℂ | pairCondition ρ δ x z y} + +theorem measurable_pairMass (ν : Measure ℂ) [IsFiniteMeasure ν] (ρ δ : ℝ) : + Measurable (fun p : ℂ × ℂ => pairMass ν ρ δ p.1 p.2) := + measurable_measure_prodMk_left (measurableSet_pairCondition ρ δ) + +def rayIndicator (S : Measure ℂ) (ρ T U v : ℝ) (x z : ℂ) : ℝ≥0∞ := + {p : ℂ × ℂ | rayCondition S ρ T U v p.1 p.2}.indicator 1 (x, z) + +theorem measurable_rayIndicator (S : Measure ℂ) [IsFiniteMeasure S] (ρ T U v : ℝ) : + Measurable (fun p : ℂ × ℂ => rayIndicator S ρ T U v p.1 p.2) := + measurable_const.indicator (measurableSet_rayCondition S ρ T U v) + +/-- The first contribution to the Borel majorant is controlled by the two-point strip. -/ +theorem lintegral_pairMass (ν : Measure ℂ) [IsFiniteMeasure ν] {ρ δ : ℝ} + (hρ : 0 < ρ) (hδ : 0 ≤ δ) (hδquarter : δ ≤ 1 / 4) : + (∫⁻ x : ℂ, ∫⁻ z : ℂ, pairMass ν ρ δ x z ∂ν) ≤ + ENNReal.ofReal (156 * δ / ρ) * ν univ * ν univ := by + rw [lintegral_lintegral_swap (measurable_pairMass ν ρ δ).aemeasurable] + apply le_trans (lintegral_mono (fun z => ?_)) + (by rw [lintegral_const]) + let A : Set (ℂ × ℂ) := {p | pairCondition ρ δ p.1 z p.2} + have hA : MeasurableSet A := (measurableSet_pairCondition ρ δ).preimage + (show Measurable (fun p : ℂ × ℂ => ((p.1, z), p.2)) by fun_prop) + have he (x : ℂ) : pairMass ν ρ δ x z = ∫⁻ y : ℂ, A.indicator 1 (x, y) ∂ν := by + rw [show (fun y : ℂ => A.indicator 1 (x, y)) = + {y : ℂ | pairCondition ρ δ x z y}.indicator 1 by + ext y; exact (indicator_comp_right (fun y : ℂ => (x, y))).symm] + exact (lintegral_indicator_one ((measurableSet_pairCondition ρ δ).preimage + (show Measurable (fun y : ℂ => ((x, z), y)) by fun_prop))).symm + simp_rw [he] + rw [lintegral_lintegral_swap (f := fun x y : ℂ => A.indicator 1 (x, y)) + (measurable_const.indicator hA).aemeasurable] + calc + _ ≤ ∫⁻ y : ℂ, ENNReal.ofReal (156 * δ / ρ) ∂ν := by + apply lintegral_mono + intro y + have hei : (fun x : ℂ => A.indicator (1 : ℂ × ℂ → ℝ≥0∞) (x, y)) = + {x : ℂ | pairCondition ρ δ x z y}.indicator 1 := by + ext x + exact (indicator_comp_right (fun x : ℂ => (x, y))).symm + dsimp only + rw [hei] + have hsm : MeasurableSet {x : ℂ | pairCondition ρ δ x z y} := + (measurableSet_pairCondition ρ δ).preimage + (show Measurable (fun x : ℂ => ((x, z), y)) by fun_prop) + exact (lintegral_indicator_one hsm).le.trans (volume_pairCondition hρ hδ hδquarter z y) + _ = _ := lintegral_const _ + +/-- The second contribution is controlled by monotone ray jumps and polar coordinates. -/ +theorem lintegral_rayIndicator (ν S : Measure ℂ) [IsFiniteMeasure ν] [IsFiniteMeasure S] + (ρ : ℝ) {T U v : ℝ} (hT : 0 ≤ T) (hU : 0 < U) (hv : 0 ≤ v) : + (∫⁻ x : ℂ, ∫⁻ z : ℂ, rayIndicator S ρ T U v x z ∂ν) ≤ + (ENNReal.ofReal (6 * Real.pi) * ENNReal.ofReal (2 * v * (1 + T / U))) * ν univ := by + rw [lintegral_lintegral_swap (measurable_rayIndicator S ρ T U v).aemeasurable] + calc + _ ≤ ∫⁻ _z : ℂ, + ENNReal.ofReal (6 * Real.pi) * ENNReal.ofReal (2 * v * (1 + T / U)) ∂ν := by + apply lintegral_mono + intro z + have he : (fun x : ℂ => rayIndicator S ρ T U v x z) = + {x : ℂ | rayCondition S ρ T U v x z}.indicator 1 := by + ext x + exact (indicator_comp_right (fun x : ℂ => (x, z))).symm + dsimp only + rw [he] + have hsm : MeasurableSet {x : ℂ | rayCondition S ρ T U v x z} := + (measurableSet_rayCondition S ρ T U v).preimage + (show Measurable (fun x : ℂ => (x, z)) by fun_prop) + exact (lintegral_indicator_one hsm).le.trans (volume_rayCondition S ρ hT hU hv z) + _ = _ := lintegral_const _ + +end DiskGeometry + +namespace DiskGeometry + +/-- Failure of every cap forces the majorant bracket to be at least one. -/ +theorem bad_cap_bracket (S ν : Measure ℂ) [IsFiniteMeasure S] [IsFiniteMeasure ν] + {x z : ℂ} {r ρ δ T U : ℝ} (hr : r ∈ Icc (1 : ℝ) 2) + (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) (hδ : 0 < δ) (hδρ : δ ≤ ρ ^ 2 / 1600) + (hT : 0 ≤ T) (hU : 0 < U) (hz : z ∈ thinShell x r δ) + (hi : S (Metric.ball x (r - δ)) ≤ ENNReal.ofReal T) + (hb : ENNReal.ofReal (2 * U) < (S + ν) (thinShell x r δ \ Metric.ball z ρ)) : + 1 ≤ (ENNReal.ofReal U)⁻¹ * pairMass ν ρ δ x z + + rayIndicator S ρ T U (200 * δ / ρ ^ 2) x z := by + have hδquarter : δ ≤ 1 / 4 := by nlinarith + obtain ⟨hl, hl3⟩ := shell_center_bounds hr hδquarter hz + have hcases : ENNReal.ofReal U ≤ ν (thinShell x r δ \ Metric.ball z ρ) ∨ + ENNReal.ofReal U ≤ S (thinShell x r δ \ Metric.ball z ρ) := by + by_contra h + push Not at h + have he2 : ENNReal.ofReal (2 * U) = ENNReal.ofReal U + ENNReal.ofReal U := by + rw [two_mul, ENNReal.ofReal_add hU.le hU.le] + have hm : (S + ν) (thinShell x r δ \ Metric.ball z ρ) ≤ ENNReal.ofReal (2 * U) := by + rw [Measure.add_apply, he2] + exact add_le_add h.2.le h.1.le + exact (not_le_of_gt hb) hm + rcases hcases with hν | hS + · have hp : ENNReal.ofReal U ≤ pairMass ν ρ δ x z := by + apply hν.trans (measure_mono ?_) + rintro y ⟨hy, hsep⟩ + exact ⟨hl, hl3, shell_pair_close hy hz, + le_of_not_gt (by simpa only [Metric.mem_ball, dist_eq_norm] using hsep)⟩ + calc + 1 = (ENNReal.ofReal U)⁻¹ * ENNReal.ofReal U := + (ENNReal.inv_mul_cancel (ENNReal.ofReal_pos.mpr hU).ne' ENNReal.ofReal_ne_top).symm + _ ≤ (ENNReal.ofReal U)⁻¹ * pairMass ν ρ δ x z := mul_le_mul_right hp _ + _ ≤ _ := le_self_add + · have hi' : (S (Metric.ball x (r - δ))).toReal ≤ T := by + have := ENNReal.toReal_mono ENNReal.ofReal_ne_top hi + simpa only [ENNReal.toReal_ofReal hT] using this + have hS' : U ≤ (S (thinShell x r δ \ Metric.ball z ρ)).toReal := + (ENNReal.ofReal_le_iff_le_toReal (measure_ne_top S _)).1 hS + have hc : rayCondition S ρ T U (200 * δ / ρ ^ 2) x z := + ⟨hl, hl3, (earlier_mass_le_interior S hr hρ hρ1 hδ hδρ hz).trans hi', + hS'.trans (shell_mass_le_jump S hr hρ hρ1 hδ hδρ hz)⟩ + have hone : rayIndicator S ρ T U (200 * δ / ρ ^ 2) x z = 1 := + indicator_of_mem hc 1 + rw [hone] + exact le_add_self + +/-- A radius-independent Borel majorant combining separated shell pairs and ray jumps. -/ +def shellMajorant (ν S : Measure ℂ) (ρ δ T U : ℝ) (x : ℂ) : ℝ≥0∞ := + (ENNReal.ofReal U)⁻¹ ^ 2 * (∫⁻ z, pairMass ν ρ δ x z ∂ν) + + (ENNReal.ofReal U)⁻¹ * (∫⁻ z, rayIndicator S ρ T U (200 * δ / ρ ^ 2) x z ∂ν) + +theorem measurable_shellMajorant (ν S : Measure ℂ) [IsFiniteMeasure ν] [IsFiniteMeasure S] + (ρ δ T U : ℝ) : Measurable (shellMajorant ν S ρ δ T U) := by + exact ((measurable_pairMass ν ρ δ).lintegral_prod_right.const_mul _).add + ((measurable_rayIndicator S ρ T U (200 * δ / ρ ^ 2)).lintegral_prod_right.const_mul _) + +theorem shellMajorant_eq_bracket (ν S : Measure ℂ) [IsFiniteMeasure ν] [IsFiniteMeasure S] + (ρ δ T U : ℝ) (x : ℂ) : + shellMajorant ν S ρ δ T U x = (ENNReal.ofReal U)⁻¹ * ∫⁻ z, + ((ENNReal.ofReal U)⁻¹ * pairMass ν ρ δ x z + + rayIndicator S ρ T U (200 * δ / ρ ^ 2) x z) ∂ν := by + have hp : Measurable (fun z : ℂ => pairMass ν ρ δ x z) := + (measurable_pairMass ν ρ δ).comp (measurable_const.prodMk measurable_id) + rw [lintegral_add_left (hp.const_mul _), lintegral_const_mul _ hp] + unfold shellMajorant + ring + +/-- The majorant is integrable uniformly over all radii. -/ +theorem lintegral_shellMajorant (ν S : Measure ℂ) [IsFiniteMeasure ν] [IsFiniteMeasure S] + {ρ δ T U : ℝ} (hρ : 0 < ρ) (hδ : 0 ≤ δ) (hδquarter : δ ≤ 1 / 4) + (hT : 0 ≤ T) (hU : 0 < U) : + (∫⁻ x, shellMajorant ν S ρ δ T U x) ≤ + (ENNReal.ofReal U)⁻¹ ^ 2 * (ENNReal.ofReal (156 * δ / ρ) * ν univ * ν univ) + + (ENNReal.ofReal U)⁻¹ * ((ENNReal.ofReal (6 * Real.pi) * + ENNReal.ofReal (2 * (200 * δ / ρ ^ 2) * (1 + T / U))) * ν univ) := by + have hp : Measurable (fun x : ℂ => ∫⁻ z, pairMass ν ρ δ x z ∂ν) := + (measurable_pairMass ν ρ δ).lintegral_prod_right + have hr : Measurable (fun x : ℂ => ∫⁻ z, rayIndicator S ρ T U (200 * δ / ρ ^ 2) x z ∂ν) := + (measurable_rayIndicator S ρ T U (200 * δ / ρ ^ 2)).lintegral_prod_right + simp only [shellMajorant] + rw [lintegral_add_left (hp.const_mul _), lintegral_const_mul _ hp, lintegral_const_mul _ hr] + exact add_le_add + (mul_le_mul_right (lintegral_pairMass ν hρ hδ hδquarter) _) + (mul_le_mul_right (lintegral_rayIndicator ν S ρ hT hU (by positivity)) _) + +/-- The majorant detects simultaneous failure of concentration at every cap. -/ +theorem one_le_majorant_of_no_cap (ν S : Measure ℂ) [IsFiniteMeasure ν] [IsFiniteMeasure S] + {ρ δ T U : ℝ} (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) (hδ : 0 < δ) + (hδρ : δ ≤ ρ ^ 2 / 1600) (hT : 0 ≤ T) (hU : 0 < U) + {x : ℂ} {r : ℝ} (hr : r ∈ Icc (1 : ℝ) 2) + (hν : ENNReal.ofReal U ≤ ν (thinShell x r δ)) + (hS : S (Metric.ball x (r - δ)) ≤ ENNReal.ofReal T) + (hbad : ∀ z ∈ thinShell x r δ, + ENNReal.ofReal (2 * U) < (S + ν) (thinShell x r δ \ Metric.ball z ρ)) : + 1 ≤ shellMajorant ν S ρ δ T U x := by + have hu0 : ENNReal.ofReal U ≠ 0 := (ENNReal.ofReal_pos.mpr hU).ne' + rw [shellMajorant_eq_bracket] + calc + 1 = (ENNReal.ofReal U)⁻¹ * ENNReal.ofReal U := + (ENNReal.inv_mul_cancel hu0 ENNReal.ofReal_ne_top).symm + _ ≤ (ENNReal.ofReal U)⁻¹ * ν (thinShell x r δ) := mul_le_mul_right hν _ + _ = (ENNReal.ofReal U)⁻¹ * (∫⁻ z, (thinShell x r δ).indicator 1 z ∂ν) := by + rw [lintegral_indicator_one (measurableSet_thinShell x r δ)] + _ ≤ _ := by + apply mul_le_mul_right + apply lintegral_mono + intro z + by_cases hz : z ∈ thinShell x r δ + · rw [indicator_of_mem hz] + exact bad_cap_bracket S ν hr hρ hρ1 hδ hδρ hT hU hz hS (hbad z hz) + · rw [indicator_of_notMem hz] + exact bot_le + +/-- Full radius-independent shell concentration, with explicit absolute constants. -/ +theorem shell_concentration (ν S : Measure ℂ) [IsFiniteMeasure ν] [IsFiniteMeasure S] + {ρ δ T U : ℝ} (hρ : 0 < ρ) (hρ1 : ρ ≤ 1) (hδ : 0 < δ) + (hδρ : δ ≤ ρ ^ 2 / 1600) (hT : 0 ≤ T) (hU : 0 < U) : + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ + (ENNReal.ofReal U)⁻¹ ^ 2 * (ENNReal.ofReal (156 * δ / ρ) * ν univ * ν univ) + + (ENNReal.ofReal U)⁻¹ * ((ENNReal.ofReal (6 * Real.pi) * + ENNReal.ofReal (2 * (200 * δ / ρ ^ 2) * (1 + T / U))) * ν univ) ∧ + ∀ x ∉ E, ∀ r ∈ Icc (1 : ℝ) 2, + ENNReal.ofReal U ≤ ν (thinShell x r δ) → + S (Metric.ball x (r - δ)) ≤ ENNReal.ofReal T → + ∃ z ∈ thinShell x r δ, + (S + ν) (thinShell x r δ \ Metric.ball z ρ) ≤ ENNReal.ofReal (2 * U) := by + let E : Set ℂ := {x | 1 ≤ shellMajorant ν S ρ δ T U x} + have hE : MeasurableSet E := measurableSet_le measurable_const + (measurable_shellMajorant ν S ρ δ T U) + refine ⟨E, hE, ?_, ?_⟩ + · have hm := meas_ge_le_lintegral_div (μ := (volume : Measure ℂ)) + (measurable_shellMajorant ν S ρ δ T U).aemeasurable one_ne_zero ENNReal.one_ne_top + simp only [div_one] at hm + refine hm.trans (lintegral_shellMajorant ν S hρ hδ.le ?_ hT hU) + have hρsq : ρ ^ 2 ≤ 1 := by nlinarith + linarith + · intro x hx r hr hν hS + by_contra h + push Not at h + exact hx (one_le_majorant_of_no_cap ν S hρ hρ1 hδ hδρ hT hU hr hν hS h) + +end DiskGeometry + +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff + +noncomputable section + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/GreenBounds.lean b/lean/OAI/Analysis/DiskMaximal/GreenBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..f6dbbdd6ae954b531bd0978120ffec8193ef4a1d --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/GreenBounds.lean @@ -0,0 +1,588 @@ +import OAI.Analysis.DiskMaximal.Kernels + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology + +noncomputable section + +namespace PlanePotential + +lemma integral_affine (F : ℂ → ℝ) (x : ℂ) (t : ℝ) : + (∫ z : ℂ, F (x+t • (z-x))) = (t^2)⁻¹ * ∫ y : ℂ, F y := by + calc + _ = ∫ w : ℂ, F (x+t • w) := by + simpa only [sub_eq_add_neg] using + integral_add_right_eq_self (fun w : ℂ => F (x+t • w)) (-x) + _ = |(t^2)⁻¹| * ∫ y, F (x+y) := by + simpa only [Complex.finrank_real_complex,smul_eq_mul] using + Measure.integral_comp_smul volume (fun y : ℂ => F (x+y)) t + _ = _ := by rw [abs_of_nonneg (inv_nonneg.mpr (sq_nonneg t)),integral_add_left_eq_self] + +lemma integrable_affine_iff (F : ℂ → ℝ) (x : ℂ) {t : ℝ} (ht : t ≠ 0) : + Integrable (fun z : ℂ => F (x+t • (z-x))) ↔ Integrable F := by + constructor + · intro h + have h1 : Integrable (fun z : ℂ => F (x+t • z)) := by + simpa only [add_sub_cancel_right] using h.comp_add_right x + have h2 := (integrable_comp_smul_iff volume (fun z : ℂ => F (x+z)) ht).mp h1 + simpa only [add_neg_cancel_left] using h2.comp_add_left (-x) + · intro h + simpa only [sub_eq_add_neg] using ((h.comp_add_left x).comp_smul ht).comp_add_right (-x) + +lemma integral_affine_reverse (F : ℂ → ℝ) (x : ℂ) {t : ℝ} (ht : t ≠ 0) : + (∫ y : ℂ, F y) = t^2 * ∫ z : ℂ, F (x+t • (z-x)) := by + rw [integral_affine] + field_simp + +lemma segment_ftc {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x z : ℂ) : + (∫ t in Ioc (0:ℝ) 1, fderiv ℝ g (x+t • (z-x)) (z-x)) = g z-g x := by + have hd (t : ℝ) : HasDerivAt (fun s : ℝ => g (x+s • (z-x))) + (fderiv ℝ g (x+t • (z-x)) (z-x)) t := by + have hline : HasDerivAt (fun s : ℝ => x+s • (z-x)) (z-x) t := by + simpa only [one_smul,id_eq] using ((hasDerivAt_id t).smul_const (z-x)).const_add x + exact ((hg.differentiable (by norm_num) _).hasFDerivAt).comp_hasDerivAt t hline + have hc : Continuous (fun t : ℝ => fderiv ℝ g (x+t • (z-x)) (z-x)) := by + exact ((hg.continuous_fderiv (by norm_num)).comp (by fun_prop)).clm_apply continuous_const + simpa only [intervalIntegral.integral_of_le (by norm_num : (0:ℝ) ≤ 1),one_smul, + add_sub_cancel,zero_smul,add_zero] using + intervalIntegral.integral_eq_sub_of_hasDerivAt (fun t _ => hd t) (hc.intervalIntegrable 0 1) + +def segmentForm (ψ g : ℂ → ℝ) (x : ℂ) (t : ℝ) (z : ℂ) : ℝ := + ψ z*fderiv ℝ g (x+t • (z-x)) (z-x) +def pullbackForm (ψ g : ℂ → ℝ) (x : ℂ) (t : ℝ) (y : ℂ) : ℝ := + ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ)*fderiv ℝ g y (y-x) + +lemma pullback_identity (ψ g : ℂ → ℝ) (x z : ℂ) {t : ℝ} (ht : 0 < t) : + pullbackForm ψ g x t (x+t • (z-x)) = (t^2)⁻¹*segmentForm ψ g x t z := by + have ha : x+t⁻¹ • (x+t • (z-x)-x) = z := by simp [ht.ne'] + unfold pullbackForm segmentForm + rw [ha,add_sub_cancel_left,map_smul,smul_eq_mul] + have hp : t^(-3:ℝ) = (t^3)⁻¹ := by + rw [show (-3:ℝ) = ((-3:ℤ):ℝ) by norm_num,Real.rpow_intCast,zpow_neg,zpow_ofNat] + rw [hp] + field_simp + +lemma segmentForm_continuous {ψ g : ℂ → ℝ} (hψ : Continuous ψ) (hg : ContDiff ℝ 1 g) (x : ℂ) : + Continuous (fun p : ℝ × ℂ => segmentForm ψ g x p.1 p.2) := by + unfold segmentForm + exact (hψ.comp continuous_snd).mul + (((hg.continuous_fderiv (by norm_num)).comp (by fun_prop)).clm_apply (by fun_prop)) + +lemma segmentForm_integrable_column {ψ g : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (hg : ContDiff ℝ 1 g) (x : ℂ) (t : ℝ) : + Integrable (segmentForm ψ g x t) := by + apply ((segmentForm_continuous hψ hg x).comp (continuous_const.prodMk continuous_id)).integrable_of_hasCompactSupport + exact hψc.mul_right + +lemma pullbackForm_measurable {ψ g : ℂ → ℝ} (hψ : Continuous ψ) (hg : ContDiff ℝ 1 g) (x : ℂ) : + Measurable (fun p : ℝ × ℂ => pullbackForm ψ g x p.1 p.2) := by + unfold pullbackForm + have ha : Measurable (fun p : ℝ × ℂ => x+p.1⁻¹ • (p.2-x)) := by measurability + exact ((hψ.measurable.comp ha).mul (measurable_fst.pow_const _)).mul + ((((hg.continuous_fderiv (by norm_num)).comp continuous_snd).clm_apply (by fun_prop)).measurable) + +lemma pullbackForm_integrable_column {ψ g : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (hg : ContDiff ℝ 1 g) (x : ℂ) {t : ℝ} (ht : 0 < t) : + Integrable (pullbackForm ψ g x t) := by + apply (integrable_affine_iff _ x ht.ne').mp + simpa only [pullback_identity ψ g x _ ht] using + (segmentForm_integrable_column hψ hψc hg x t).const_mul ((t^2)⁻¹) + +lemma pullback_column_integral (ψ g : ℂ → ℝ) (x : ℂ) {t : ℝ} (ht : 0 < t) : + (∫ y, pullbackForm ψ g x t y) = ∫ z, segmentForm ψ g x t z := by + rw [integral_affine_reverse _ x ht.ne'] + simp_rw [pullback_identity ψ g x _ ht] + rw [integral_const_mul] + field_simp + +lemma pullback_column_norm (ψ g : ℂ → ℝ) (x : ℂ) {t : ℝ} (ht : 0 < t) : + (∫ y, ‖pullbackForm ψ g x t y‖) = ∫ z, ‖segmentForm ψ g x t z‖ := by + rw [integral_affine_reverse _ x ht.ne'] + simp_rw [pullback_identity ψ g x _ ht,norm_mul,Real.norm_eq_abs, + abs_of_nonneg (inv_nonneg.mpr (sq_nonneg t))] + rw [integral_const_mul] + field_simp + +lemma segmentForm_bound {ψ g : ℂ → ℝ} {D : ℝ} (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) + (x : ℂ) (t : ℝ) (z : ℂ) : + ‖segmentForm ψ g x t z‖ ≤ |ψ z| *D*‖z-x‖ := by + rw [segmentForm,norm_mul,Real.norm_eq_abs] + calc + _ ≤ |ψ z| *(‖fderiv ℝ g (x+t • (z-x))‖*‖z-x‖) := + mul_le_mul_of_nonneg_left ((fderiv ℝ g _).le_opNorm _) (abs_nonneg _) + _ ≤ |ψ z| *(D*‖z-x‖) := mul_le_mul_of_nonneg_left + (mul_le_mul_of_nonneg_right (hD _) (norm_nonneg _)) (abs_nonneg _) + _ = _ := by ring + +lemma segment_weight_integrable {ψ : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (x : ℂ) (D : ℝ) : + Integrable (fun z : ℂ => |ψ z| *D*‖z-x‖) := by + apply (show Continuous (fun z : ℂ => |ψ z| *D*‖z-x‖) by fun_prop).integrable_of_hasCompactSupport + exact (hψc.norm.mul_right).mul_right + +/-- Absolute integrability justifies the double integral even at t approaching zero. -/ +theorem pullbackForm_integrable {ψ g : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (x : ℂ) : + Integrable (fun p : ℝ × ℂ => pullbackForm ψ g x p.1 p.2) + ((volume.restrict (Ioc (0:ℝ) 1)).prod volume) := by + have hm := (pullbackForm_measurable hψ hg x).stronglyMeasurable + rw [integrable_prod_iff hm.aestronglyMeasurable] + constructor + · filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + exact pullbackForm_integrable_column hψ hψc hg x ht.1 + · have hweight := segment_weight_integrable hψ hψc x D + let C := ∫ z : ℂ, |ψ z| *D*‖z-x‖ + apply (integrable_const C).mono' hm.norm.integral_prod_right'.aestronglyMeasurable + filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + rw [pullback_column_norm ψ g x ht.1,Real.norm_eq_abs,abs_of_nonneg (integral_nonneg (fun _ => norm_nonneg _))] + exact integral_mono (segmentForm_integrable_column hψ hψc hg x t).norm hweight + (segmentForm_bound hD x t) + +lemma segmentForm_integrable {ψ g : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (x : ℂ) : + Integrable (fun p : ℝ × ℂ => segmentForm ψ g x p.1 p.2) + ((volume.restrict (Ioc (0:ℝ) 1)).prod volume) := by + have hm := (segmentForm_continuous hψ hg x).stronglyMeasurable + rw [integrable_prod_iff hm.aestronglyMeasurable] + constructor + · exact ae_of_all _ (fun t => segmentForm_integrable_column hψ hψc hg x t) + · have hweight := segment_weight_integrable hψ hψc x D + let C := ∫ z : ℂ, |ψ z| * D*‖z-x‖ + apply (integrable_const C).mono' hm.norm.integral_prod_right'.aestronglyMeasurable + filter_upwards with t + rw [Real.norm_eq_abs,abs_of_nonneg (integral_nonneg (fun _ => norm_nonneg _))] + exact integral_mono (segmentForm_integrable_column hψ hψc hg x t).norm hweight + (segmentForm_bound hD x t) + +lemma green_pullback (ψ g : ℂ → ℝ) (x y : ℂ) : + fderiv ℝ g y (green ψ x y) = -∫ t in Ioc (0:ℝ) 1, pullbackForm ψ g x t y := by + simp only [green,map_smul,smul_eq_mul,greenScalar,pullbackForm,integral_mul_const,neg_mul] + +/-- The true segment-kernel representation, with Fubini justified absolutely. -/ +theorem green_representation {ψ g : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (hψ1 : ∫ z, ψ z = 1) (x : ℂ) : + (∫ y, fderiv ℝ g y (green ψ x y)) = g x-∫ z, ψ z*g z := by + have hseg := segmentForm_integrable hψ hψc hg hD x + have hpull := pullbackForm_integrable hψ hψc hg hD x + have hψi : Integrable ψ := hψ.integrable_of_hasCompactSupport hψc + have hψgi : Integrable (fun z => ψ z*g z) := + (hψ.mul hg.continuous).integrable_of_hasCompactSupport hψc.mul_right + calc + _ = -(∫ y, ∫ t in Ioc (0:ℝ) 1, pullbackForm ψ g x t y) := by + simp_rw [green_pullback]; rw [integral_neg] + _ = -(∫ t in Ioc (0:ℝ) 1, ∫ y, pullbackForm ψ g x t y) := by + rw [← integral_integral_swap hpull] + _ = -(∫ t in Ioc (0:ℝ) 1, ∫ z, segmentForm ψ g x t z) := by + congr 1 + apply integral_congr_ae + filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + exact pullback_column_integral ψ g x ht.1 + _ = -(∫ z, ∫ t in Ioc (0:ℝ) 1, segmentForm ψ g x t z) := by + rw [integral_integral_swap hseg] + _ = -(∫ z, ψ z*(g z-g x)) := by + simp_rw [segmentForm,integral_const_mul,segment_ftc hg] + _ = _ := by + simp_rw [mul_sub] + rw [integral_sub hψgi (hψi.mul_const _),integral_mul_const,hψ1] + ring + +end PlanePotential + +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace + +namespace PlanePotential +lemma lintegral_norm_rpow_near {a r : ℝ} (ha : -2 < a) (hr : 0 < r) : + (∫⁻ x in ball (0:ℂ) r, ENNReal.ofReal (‖x‖^a)) = + ENNReal.ofReal (2*Real.pi*(r^(a+2)/(a+2))) := by + rw [← ofReal_integral_eq_lintegral_ofReal (integrable_norm_rpow_near ha hr) + (ae_of_all _ (fun x => Real.rpow_nonneg (norm_nonneg x) a)),integral_norm_rpow_near ha hr] + +lemma lintegral_norm_rpow_far {a r : ℝ} (ha : a < -2) (hr : 0 < r) : + (∫⁻ x : ℂ in {x | r < ‖x‖}, ENNReal.ofReal (‖x‖^a)) = + ENNReal.ofReal (2*Real.pi*(-r^(a+2)/(a+2))) := by + rw [← ofReal_integral_eq_lintegral_ofReal (integrable_norm_rpow_far ha hr) + (ae_of_all _ (fun x => Real.rpow_nonneg (norm_nonneg x) a)),integral_norm_rpow_far ha hr] + +lemma lintegral_translated_near {a r : ℝ} (ha : -2 < a) (hr : 0 < r) (y : ℂ) : + (∫⁻ x in ball y r, ENNReal.ofReal (‖x-y‖^a)) = + ENNReal.ofReal (2*Real.pi*(r^(a+2)/(a+2))) := by + rw [← lintegral_norm_rpow_near ha hr,← lintegral_indicator measurableSet_ball, + ← lintegral_indicator measurableSet_ball] + have heq : (ball y r).indicator (fun x => ENNReal.ofReal (‖x-y‖^a)) = + fun x => (ball (0:ℂ) r).indicator (fun w => ENNReal.ofReal (‖w‖^a)) (x-y) := by + funext x + simp only [indicator,mem_ball,dist_eq_norm,sub_zero] + rw [heq] + exact lintegral_add_right_eq_self (fun x : ℂ => (ball 0 r).indicator + (fun w => ENNReal.ofReal (‖w‖^a)) x) (-y) + +lemma lintegral_translated_far {a r : ℝ} (ha : a < -2) (hr : 0 < r) (y : ℂ) : + (∫⁻ x : ℂ in {x | r < ‖x-y‖}, ENNReal.ofReal (‖x-y‖^a)) = + ENNReal.ofReal (2*Real.pi*(-r^(a+2)/(a+2))) := by + rw [← lintegral_norm_rpow_far ha hr, + ← lintegral_indicator (show MeasurableSet {x : ℂ | r < ‖x-y‖} from measurableSet_lt measurable_const (by fun_prop)), + ← lintegral_indicator (measurableSet_lt measurable_const measurable_norm)] + exact lintegral_add_right_eq_self (fun x : ℂ => ({x | r < ‖x‖}).indicator + (fun w => ENNReal.ofReal (‖w‖^a)) x) (-y) + +lemma norm_power_bound {F : ℂ → ℂ} {C q : ℝ} (hC : 0 ≤ C) (x y : ℂ) + (hF : ‖F x‖ ≤ C*‖x-y‖^q) : + (ENNReal.ofReal ‖F x‖)^(3/2:ℝ) ≤ + ENNReal.ofReal (C^(3/2:ℝ))*ENNReal.ofReal (‖x-y‖^(q*(3/2:ℝ))) := by + calc + _ = ENNReal.ofReal (‖F x‖^(3/2:ℝ)) := + ENNReal.ofReal_rpow_of_nonneg (norm_nonneg _) (by norm_num) + _ ≤ ENNReal.ofReal ((C*‖x-y‖^q)^(3/2:ℝ)) := + ENNReal.ofReal_le_ofReal (Real.rpow_le_rpow (norm_nonneg _) hF (by norm_num)) + _ = _ := by + rw [Real.mul_rpow hC (Real.rpow_nonneg (norm_nonneg _) _),← Real.rpow_mul (norm_nonneg _), + ENNReal.ofReal_mul (Real.rpow_nonneg hC _)] + +lemma kernel_near_three_halves {F : ℂ → ℂ} {E : Set ℂ} {C r : ℝ} (hC : 0 ≤ C) + (hr : 0 < r) (y : ℂ) (hE : E ⊆ ball y r) + (hF : ∀ x ∈ E, ‖F x‖ ≤ C*‖x-y‖^(-1:ℝ)) : + (∫⁻ x in E, (ENNReal.ofReal ‖F x‖)^(3/2:ℝ)) ≤ + ENNReal.ofReal (C^(3/2:ℝ)*(4*Real.pi*r^(1/2:ℝ))) := by + calc + _ ≤ ∫⁻ x in E, ENNReal.ofReal (C^(3/2:ℝ))*ENNReal.ofReal (‖x-y‖^(-3/2:ℝ)) := by + apply setLIntegral_mono (by fun_prop) + intro x hx + convert norm_power_bound hC x y (hF x hx) using 1 + norm_num + _ ≤ ∫⁻ x in ball y r, ENNReal.ofReal (C^(3/2:ℝ))*ENNReal.ofReal (‖x-y‖^(-3/2:ℝ)) := + lintegral_mono_set hE + _ = _ := by + rw [lintegral_const_mul _ (by fun_prop),lintegral_translated_near (by norm_num : (-2:ℝ) < -3/2) hr y, + ← ENNReal.ofReal_mul (Real.rpow_nonneg hC _)] + congr 1 + norm_num + exact Or.inl (by ring) + +lemma kernel_far_three_halves {F : ℂ → ℂ} {E : Set ℂ} {C r : ℝ} (hC : 0 ≤ C) + (hr : 0 < r) (y : ℂ) (hE : E ⊆ {x | r < ‖x-y‖}) + (hF : ∀ x ∈ E, ‖F x‖ ≤ C*‖x-y‖^(-2:ℝ)) : + (∫⁻ x in E, (ENNReal.ofReal ‖F x‖)^(3/2:ℝ)) ≤ + ENNReal.ofReal (C^(3/2:ℝ)*(2*Real.pi/r)) := by + calc + _ ≤ ∫⁻ x in E, ENNReal.ofReal (C^(3/2:ℝ))*ENNReal.ofReal (‖x-y‖^(-3:ℝ)) := by + apply setLIntegral_mono (by fun_prop) + intro x hx + convert norm_power_bound hC x y (hF x hx) using 1 + norm_num + _ ≤ ∫⁻ x : ℂ in {x | r < ‖x-y‖}, ENNReal.ofReal (C^(3/2:ℝ))*ENNReal.ofReal (‖x-y‖^(-3:ℝ)) := + lintegral_mono_set hE + _ = _ := by + rw [lintegral_const_mul _ (by fun_prop),lintegral_translated_far (by norm_num : (-3:ℝ) < -2) hr y, + ← ENNReal.ofReal_mul (Real.rpow_nonneg hC _)] + congr 1 + norm_num [Real.rpow_neg_one] + exact Or.inl (by ring) + +end PlanePotential + +open scoped RealInnerProductSpace +namespace PlanePotential + +lemma green_diagonal (ψ : ℂ → ℝ) (x : ℂ) : green ψ x x = 0 := by + simp [green] + +lemma green_size_all {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) {x y : ℂ} (hx : ‖x‖ ≤ X) : + ‖green ψ x y‖ ≤ (2*B*(R+X)^2)*‖x-y‖^(-1:ℝ) := by + by_cases hxy : y = x + · subst y + simp [green_diagonal] + · simpa only [Real.rpow_neg_one,div_eq_mul_inv,norm_sub_rev] using + green_norm_bound hψm hψs hψB hM hB hx hxy + +lemma green_near_column {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B a : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) (ha : 0 < a) (z y : ℂ) (hy : ‖y-z‖ ≤ a) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X ∧ ‖x-z‖ ≤ 2*a}, + (ENNReal.ofReal ‖green ψ x y‖)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(4*a)^(1/2:ℝ))) := by + apply kernel_near_three_halves (by positivity) (by positivity : 0 < 4*a) y + · intro x hx + rw [mem_ball,dist_eq_norm] + have ht := norm_sub_le (x-z) (y-z) + rw [sub_sub_sub_cancel_right] at ht + linarith [hx.2] + · intro x hx + exact green_size_all hψm hψs hψB hM hB hx.1 + +lemma green_far_column {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B L a : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hψL : ∀ u v, |ψ u-ψ v| ≤ L*‖u-v‖) + (hM : 0 < R+X) (hB : 0 ≤ B) (hL : 0 ≤ L) (ha : 0 < a) + (z y : ℂ) (hy : ‖y-z‖ ≤ a) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X ∧ 2*a < ‖x-z‖}, + (ENNReal.ofReal ‖green ψ x y-green ψ x z‖)^(3/2:ℝ)) ≤ + ENNReal.ofReal (((8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)*a)^(3/2:ℝ) * + (2*Real.pi/(2*a))) := by + apply kernel_far_three_halves (by positivity) (by positivity : 0 < 2*a) z + · exact fun _ hx => hx.2 + · intro x hx + have hzx : z ≠ x := by + intro h + have hh := hx.2 + rw [← h,sub_self,norm_zero] at hh + linarith + have hn : ‖z-x‖ = ‖x-z‖ := norm_sub_rev z x + have h := green_difference_bound (x := x) (y := y) (z := z) hψm hψs hψB hψL hM hB hL hx.1 hzx (by + rw [hn] + linarith [hx.2]) + rw [hn] at h + calc + _ ≤ (8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)*a/‖x-z‖^2 := + h.trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hy (by positivity)) (sq_nonneg _)) + _ = _ := by + rw [show ‖x-z‖^(-2:ℝ) = ‖x-z‖^(-2:ℤ) by norm_num [Real.rpow_intCast],zpow_neg,zpow_ofNat] + rfl + +/-- The center is subtracted only off the near region, so this measurable +kernel retains integrability at the center and realizes zero-mass cancellation. -/ +def cancelledGreen (ψ : ℂ → ℝ) (z : ℂ) (a : ℝ) (x y : ℂ) : ℂ := + if ‖x-z‖ ≤ 2*a then green ψ x y else green ψ x y-green ψ x z + +lemma cancelledGreen_measurable {ψ : ℂ → ℝ} (hψ : Measurable ψ) (z : ℂ) (a : ℝ) : + Measurable (fun p : ℂ × ℂ => cancelledGreen ψ z a p.1 p.2) := by + apply Measurable.ite + · exact measurableSet_le (by fun_prop) measurable_const + · exact green_measurable ψ hψ + · exact (green_measurable ψ hψ).sub + ((green_measurable ψ hψ).comp (measurable_fst.prodMk measurable_const)) + +lemma green_piece_column {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B L a : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hψL : ∀ u v, |ψ u-ψ v| ≤ L*‖u-v‖) + (hM : 0 < R+X) (hB : 0 ≤ B) (hL : 0 ≤ L) (ha : 0 < a) + (z y : ℂ) (hy : ‖y-z‖ ≤ a) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, + (ENNReal.ofReal ‖cancelledGreen ψ z a x y‖)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(4*a)^(1/2:ℝ))) + + ENNReal.ofReal (((8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)*a)^(3/2:ℝ) * + (2*Real.pi/(2*a))) := by + let E := {x : ℂ | ‖x‖ ≤ X} + let N := {x : ℂ | ‖x-z‖ ≤ 2*a} + have hN : MeasurableSet N := measurableSet_le (by fun_prop) measurable_const + have hE : MeasurableSet E := measurableSet_le measurable_norm measurable_const + have hsplit := lintegral_add_compl (μ := volume.restrict E) + (fun x => (ENNReal.ofReal ‖cancelledGreen ψ z a x y‖)^(3/2:ℝ)) hN + rw [← hsplit] + have hn : (∫⁻ x in N, (ENNReal.ofReal ‖cancelledGreen ψ z a x y‖)^(3/2:ℝ) ∂volume.restrict E) = + ∫⁻ x in {x : ℂ | ‖x‖ ≤ X ∧ ‖x-z‖ ≤ 2*a}, (ENNReal.ofReal ‖green ψ x y‖)^(3/2:ℝ) := by + rw [Measure.restrict_restrict hN,inter_comm] + apply setLIntegral_congr_fun (hE.inter hN) + intro x hx + have hxN : ‖x-z‖ ≤ 2*a := hx.2 + simp only [cancelledGreen,ite_eq_left hxN] + have hf : (∫⁻ x in Nᶜ, (ENNReal.ofReal ‖cancelledGreen ψ z a x y‖)^(3/2:ℝ) ∂volume.restrict E) = + ∫⁻ x in {x : ℂ | ‖x‖ ≤ X ∧ 2*a < ‖x-z‖}, (ENNReal.ofReal ‖green ψ x y-green ψ x z‖)^(3/2:ℝ) := by + rw [Measure.restrict_restrict hN.compl,inter_comm] + have he : E ∩ Nᶜ = {x : ℂ | ‖x‖ ≤ X ∧ 2*a < ‖x-z‖} := by ext x; simp [E,N] + rw [he] + apply setLIntegral_congr_fun ((measurableSet_le measurable_norm measurable_const).inter + (measurableSet_lt measurable_const ((measurable_id.sub_const z).norm))) + intro x hx + have hxF : 2*a < ‖x-z‖ := hx.2 + simp only [cancelledGreen,ite_eq_right (not_le.mpr hxF)] + rw [hn,hf] + exact add_le_add (green_near_column hψm hψs hψB hM hB ha z y hy) + (green_far_column hψm hψs hψB hψL hM hB hL ha z y hy) + +end PlanePotential + +namespace PlanePotential + +theorem kernel_column_lp {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] + (μ : Measure α) (ν : Measure β) [SFinite μ] [SFinite ν] + {K : α × β → ℝ≥0∞} (hK : Measurable K) {C : ℝ≥0∞} + (hC : ∀ᵐ y ∂ν, (∫⁻ x, (K (x,y))^(3/2:ℝ) ∂μ) ≤ C) : + (∫⁻ x, (∫⁻ y, K (x,y) ∂ν)^(3/2:ℝ) ∂μ) ≤ C*(ν univ)^(3/2:ℝ) := by + have hpq : Real.HolderConjugate (3/2) 3 := by rw [Real.holderConjugate_iff]; norm_num + have hpoint (x : α) : (∫⁻ y, K (x,y) ∂ν)^(3/2:ℝ) ≤ + (∫⁻ y, K (x,y)^(3/2:ℝ) ∂ν)*(ν univ)^(1/2:ℝ) := by + have h := ENNReal.lintegral_mul_le_Lp_mul_Lq ν hpq (f := fun y => K (x,y)) (g := fun _ => 1) + ((hK.comp (measurable_const.prodMk measurable_id)).aemeasurable) + (aemeasurable_const (b := (1:ℝ≥0∞))) + simp only [Pi.mul_apply,mul_one,ENNReal.one_rpow,lintegral_const,one_mul] at h + have h' := ENNReal.rpow_le_rpow h (by norm_num : (0:ℝ) ≤ 3/2) + simpa only [ENNReal.mul_rpow_of_nonneg _ _ (by norm_num : (0:ℝ) ≤ 3/2),← ENNReal.rpow_mul, + show (1/(3/2:ℝ))*(3/2)=1 by norm_num, + show (1/(3:ℝ))*(3/2)=1/2 by norm_num,ENNReal.rpow_one,one_mul] using h' + calc + _ ≤ ∫⁻ x, (∫⁻ y, K (x,y)^(3/2:ℝ) ∂ν)*(ν univ)^(1/2:ℝ) ∂μ := + lintegral_mono hpoint + _ = (∫⁻ y, ∫⁻ x, K (x,y)^(3/2:ℝ) ∂μ ∂ν)*(ν univ)^(1/2:ℝ) := by + rw [lintegral_mul_const _ (hK.pow_const _).lintegral_prod_right, + lintegral_lintegral_swap (hK.pow_const _).aemeasurable] + _ ≤ (C*ν univ)*(ν univ)^(1/2:ℝ) := + mul_le_mul_left ((lintegral_mono_ae hC).trans_eq (lintegral_const _)) _ + _ = _ := by + rw [mul_assoc] + congr 1 + calc + _ = (ν univ)^(1:ℝ)*(ν univ)^(1/2:ℝ) := by rw [ENNReal.rpow_one] + _ = (ν univ)^((1:ℝ)+1/2) := + (ENNReal.rpow_add_of_nonneg 1 (1/2) (by norm_num) (by norm_num)).symm + _ = _ := by norm_num + +/-- No pointwise integrability assertion for the singular kernel is needed +in this domination: the Bochner integral is bounded by the nonnegative integral. -/ +lemma potential_domination {L : ℂ → ℂ} (hL : Measurable L) {b : ℂ → ℂ} + (hb : Integrable b) : + ENNReal.ofReal |∫ y, ⟪L y,b y⟫| ≤ + ∫⁻ y, ENNReal.ofReal ‖L y‖ ∂volume.withDensity (fun y => ENNReal.ofReal ‖b y‖) := by + rw [lintegral_withDensity_eq_lintegral_mul₀' hb.aestronglyMeasurable.norm.aemeasurable.ennreal_ofReal + hL.norm.ennreal_ofReal.aemeasurable] + calc + _ = ‖∫ y, ⟪L y,b y⟫‖ₑ := by rw [← ofReal_norm,Real.norm_eq_abs] + _ ≤ ∫⁻ y, ‖⟪L y,b y⟫‖ₑ := enorm_integral_le_lintegral_enorm _ + _ ≤ _ := by + apply lintegral_mono + intro y + dsimp only [Pi.mul_apply] + rw [← ofReal_norm] + change ENNReal.ofReal ‖⟪L y,b y⟫‖ ≤ ENNReal.ofReal ‖b y‖ * ENNReal.ofReal ‖L y‖ + rw [← ENNReal.ofReal_mul (norm_nonneg _)] + exact ENNReal.ofReal_le_ofReal ((norm_inner_le_norm _ _).trans_eq (mul_comm _ _)) + +theorem cancelled_potential_lp {ψ : ℂ → ℝ} {β : ℂ → ℂ} + (hψm : Measurable ψ) {R X B L a : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hψL : ∀ u v, |ψ u-ψ v| ≤ L*‖u-v‖) + (hM : 0 < R+X) (hB : 0 ≤ B) (hL : 0 ≤ L) (ha : 0 < a) + (z : ℂ) (hβ : Integrable β) (hβs : ∀ y, β y ≠ 0 → ‖y-z‖ ≤ a) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, + (ENNReal.ofReal |∫ y, ⟪cancelledGreen ψ z a x y,β y⟫|)^(3/2:ℝ)) ≤ + (ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(4*a)^(1/2:ℝ))) + + ENNReal.ofReal (((8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)*a)^(3/2:ℝ) * + (2*Real.pi/(2*a)))) * (ENNReal.ofReal (∫ y, ‖β y‖))^(3/2:ℝ) := by + let ν := volume.withDensity (fun y => ENNReal.ofReal ‖β y‖) + have hν : ν univ = ENNReal.ofReal (∫ y, ‖β y‖) := by + dsimp only [ν] + rw [withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ] + exact (ofReal_integral_eq_lintegral_ofReal hβ.norm + (Filter.Eventually.of_forall (fun _ => norm_nonneg _))).symm + have : IsFiniteMeasure ν := ⟨by rw [hν]; exact ENNReal.ofReal_lt_top⟩ + have hm := cancelledGreen_measurable hψm z a + have hcol := kernel_column_lp (volume.restrict {x : ℂ | ‖x‖ ≤ X}) ν hm.norm.ennreal_ofReal + (C := ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(4*a)^(1/2:ℝ))) + + ENNReal.ofReal (((8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)*a)^(3/2:ℝ)*(2*Real.pi/(2*a)))) + (by + rw [ae_withDensity_iff' hβ.aestronglyMeasurable.norm.aemeasurable.ennreal_ofReal] + filter_upwards with y hy + apply green_piece_column hψm hψs hψB hψL hM hB hL ha z y + apply hβs y + intro hy0 + simp [hy0] at hy) + rw [hν] at hcol + apply le_trans _ hcol + apply lintegral_mono + intro x + exact ENNReal.rpow_le_rpow (potential_domination + (hm.comp (measurable_const.prodMk measurable_id)) hβ) (by norm_num) + +lemma zero_mass_kernel_shift {L : ℂ → ℂ} {β : ℂ → ℂ} (hβ : Integrable β) + (hzero : ∫ y, β y = 0) (c : ℂ) : + (∫ y, ⟪L y,β y⟫) = ∫ y, ⟪L y-c,β y⟫ := by + have hc : Integrable (fun y => ⟪c,β y⟫) := hβ.const_inner c + have hci : (∫ y, ⟪c,β y⟫) = 0 := by rw [integral_inner hβ,hzero,inner_zero_right] + simp only [inner_sub_left] + by_cases hi : Integrable (fun y => ⟪L y,β y⟫) + · rw [integral_sub hi hc,hci,sub_zero] + · rw [integral_undef hi,integral_undef] + intro hs + have hh := hs.add hc + change Integrable (fun y => (⟪L y,β y⟫-⟪c,β y⟫)+⟪c,β y⟫) at hh + simp only [sub_add_cancel] at hh + exact hi hh + +lemma cancelled_potential_eq {ψ : ℂ → ℝ} {β : ℂ → ℂ} (hβ : Integrable β) + (hzero : ∫ y, β y = 0) (z : ℂ) (a : ℝ) (x : ℂ) : + (∫ y, ⟪green ψ x y,β y⟫) = ∫ y, ⟪cancelledGreen ψ z a x y,β y⟫ := by + by_cases hx : ‖x-z‖ ≤ 2*a + · simp only [cancelledGreen,ite_eq_left hx] + · simp only [cancelledGreen,ite_eq_right hx] + exact zero_mass_kernel_shift hβ hzero _ + +/-- Uniform scaling of the exact p-th power column constant: in dimension two +and at p=3/2 its radius dependence is precisely a^(1/2). -/ +lemma column_scaling {K D a : ℝ} (hD : 0 ≤ D) (ha : 0 < a) : + K^(3/2:ℝ)*(4*Real.pi*(4*a)^(1/2:ℝ)) + + (D*a)^(3/2:ℝ)*(2*Real.pi/(2*a)) = + (8*Real.pi*K^(3/2:ℝ)+Real.pi*D^(3/2:ℝ))*a^(1/2:ℝ) := by + rw [Real.mul_rpow (by norm_num : (0:ℝ) ≤ 4) ha.le,Real.mul_rpow hD ha.le] + have hfour : (4:ℝ)^(1/2:ℝ) = 2 := by norm_num [← Real.sqrt_eq_rpow] + have hpow : a^(3/2:ℝ)/a = a^(1/2:ℝ) := by + rw [← Real.rpow_sub_one ha.ne'] + norm_num + rw [hfour] + calc + _ = 8*Real.pi*K^(3/2:ℝ)*a^(1/2:ℝ)+Real.pi*D^(3/2:ℝ)*(a^(3/2:ℝ)/a) := by ring + _ = _ := by rw [hpow]; ring + +theorem green_zero_piece_lp {ψ : ℂ → ℝ} {β : ℂ → ℂ} + (hψm : Measurable ψ) {R X B L a : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hψL : ∀ u v, |ψ u-ψ v| ≤ L*‖u-v‖) + (hM : 0 < R+X) (hB : 0 ≤ B) (hL : 0 ≤ L) (ha : 0 < a) + (z : ℂ) (hβ : Integrable β) (hzero : ∫ y, β y = 0) + (hβs : ∀ y, β y ≠ 0 → ‖y-z‖ ≤ a) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, + (ENNReal.ofReal |∫ y, ⟪green ψ x y,β y⟫|)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((8*Real.pi*(2*B*(R+X)^2)^(3/2:ℝ)+ + Real.pi*(8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)^(3/2:ℝ))*a^(1/2:ℝ)) * + (ENNReal.ofReal (∫ y, ‖β y‖))^(3/2:ℝ) := by + simp_rw [cancelled_potential_eq hβ hzero z a] + have h := cancelled_potential_lp hψm hψs hψB hψL hM hB hL ha z hβ hβs + rw [← ENNReal.ofReal_add (by positivity) (by positivity), + column_scaling (by positivity) ha] at h + exact h + +end PlanePotential + +open scoped RealInnerProductSpace +noncomputable section + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Kernels.lean b/lean/OAI/Analysis/DiskMaximal/Kernels.lean new file mode 100644 index 0000000000000000000000000000000000000000..63b23dc895213bd64338bac1ef457b51d372b6d3 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Kernels.lean @@ -0,0 +1,841 @@ +import OAI.Analysis.DiskMaximal.ScalarTrees + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology + +noncomputable section + +namespace DyadicHats + +def tent (x : ℝ) : ℝ := max (1-|x|) 0 + +lemma tent_nonneg (x : ℝ) : 0 ≤ tent x := le_max_right _ _ +lemma tent_le_one (x : ℝ) : tent x ≤ 1 := max_le (by linarith [abs_nonneg x]) (by norm_num) +lemma tent_pos_iff (x : ℝ) : 0 < tent x ↔ |x| < 1 := by + unfold tent + rw [lt_max_iff] + constructor + · intro h; rcases h with h|h <;> linarith + · intro h; exact Or.inl (by linarith) +lemma tent_eq_zero_of_one_le {x : ℝ} (hx : 1 ≤ |x|) : tent x = 0 := by + exact max_eq_right (by linarith) +lemma tent_of_nonneg {x : ℝ} (hx : 0 ≤ x) (hx1 : x ≤ 1) : tent x = 1-x := by + simp only [tent, abs_of_nonneg hx, max_eq_left (sub_nonneg.mpr hx1)] +lemma tent_of_nonpos {x : ℝ} (hx : x ≤ 0) (hx1 : -1 ≤ x) : tent x = 1+x := by + rw [tent,abs_of_nonpos hx,max_eq_left (by linarith)] + ring +lemma tent_neg (x : ℝ) : tent (-x) = tent x := by simp only [tent,abs_neg] + +lemma lipschitz_tent : LipschitzWith 1 tent := by + have hn : LipschitzWith 1 (fun x : ℝ => |x|) := by + change LipschitzWith 1 (norm : ℝ → ℝ) + exact lipschitzWith_one_norm + have h : LipschitzWith 1 (fun x : ℝ => 1-|x|) := by + simpa only [zero_add] using (LipschitzWith.const (1:ℝ)).sub hn + change LipschitzWith 1 (fun x : ℝ => max (1-|x|) 0) + simpa only [max_eq_left (by norm_num : (0:ℝ≥0) ≤ 1)] using h.max (LipschitzWith.const (0:ℝ)) + +theorem tent_refine (x : ℝ) : + tent x = (1/2)*tent (2*x+1)+tent (2*x)+(1/2)*tent (2*x-1) := by + wlog hx : 0 ≤ x generalizing x + · have h := this (-x) (by linarith) + rw [tent_neg] at h + have heq1 : 2*(-x)+1 = -(2*x-1) := by ring + have heq2 : 2*(-x) = -(2*x) := by ring + have heq3 : 2*(-x)-1 = -(2*x+1) := by ring + rw [heq1,heq3,heq2,tent_neg,tent_neg,tent_neg] at h + linarith + have hplus : tent (2*x+1) = 0 := tent_eq_zero_of_one_le (by rw [abs_of_nonneg (by linarith)]; linarith) + rw [hplus,mul_zero,zero_add] + by_cases hx1 : x ≤ 1/2 + · rw [tent_of_nonneg hx (by linarith),tent_of_nonneg (by linarith) (by linarith), + tent_of_nonpos (by linarith) (by linarith)] + ring + · by_cases hx2 : x ≤ 1 + · rw [tent_of_nonneg hx hx2,tent_eq_zero_of_one_le (by rw [abs_of_nonneg (by linarith)]; linarith), + tent_of_nonneg (by linarith) (by linarith)] + ring + · rw [tent_eq_zero_of_one_le (by rw [abs_of_nonneg hx]; linarith), + tent_eq_zero_of_one_le (by rw [abs_of_nonneg (by linarith)]; linarith), + tent_eq_zero_of_one_le (by rw [abs_of_nonneg (by linarith)]; linarith)] + ring + +lemma tent_floor (x : ℝ) : tent (x-⌊x⌋) = 1-(x-⌊x⌋) := + tent_of_nonneg (sub_nonneg.mpr (Int.floor_le x)) (by linarith [Int.lt_floor_add_one x]) +lemma tent_floor_succ (x : ℝ) : tent (x-(⌊x⌋+1)) = x-⌊x⌋ := by + rw [tent_of_nonpos (by linarith [Int.lt_floor_add_one x]) (by linarith [Int.floor_le x])] + ring +lemma tent_floor_partition (x : ℝ) : tent (x-⌊x⌋)+tent (x-(⌊x⌋+1)) = 1 := by + rw [tent_floor,tent_floor_succ]; ring + +lemma tent_eq_zero_of_ne_floor {x : ℝ} {j : ℤ} + (hj : j ≠ ⌊x⌋) (hj' : j ≠ ⌊x⌋+1) : tent (x-j) = 0 := by + apply tent_eq_zero_of_one_le + have hcases : j < ⌊x⌋ ∨ ⌊x⌋+1 < j := by omega + rcases hcases with h|h + · have hjle : (j:ℝ)+1 ≤ ⌊x⌋ := by exact_mod_cast h + rw [abs_of_nonneg (by linarith [Int.floor_le x])] + linarith [Int.floor_le x] + · have hjle : (⌊x⌋:ℝ)+2 ≤ j := by exact_mod_cast (show ⌊x⌋+2 ≤ j by omega) + rw [abs_of_nonpos (by linarith [Int.lt_floor_add_one x])] + linarith [Int.lt_floor_add_one x] + +lemma summable_tent (x : ℝ) : Summable (fun j : ℤ => tent (x-j)) := by + apply summable_of_ne_finset_zero (s := {⌊x⌋,⌊x⌋+1}) + intro j hj + simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at hj + exact tent_eq_zero_of_ne_floor hj.1 hj.2 + +/-- Partition of unity on the complete integer grid, including grid boundaries. -/ +theorem tsum_tent (x : ℝ) : (∑' j : ℤ, tent (x-j)) = 1 := by + rw [tsum_eq_sum (s := {⌊x⌋,⌊x⌋+1}) (fun j hj => by + simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at hj + exact tent_eq_zero_of_ne_floor hj.1 hj.2)] + rw [Finset.sum_insert (by simp),Finset.sum_singleton] + simpa only [Int.cast_add,Int.cast_one] using tent_floor_partition x + +/-- Actual Euclidean-plane product hats at a positive physical scale. -/ +def hat (r : ℝ) (p : ℤ × ℤ) (x : ℂ) : ℝ := + tent (x.re/r-p.1)*tent (x.im/r-p.2) +lemma hat_nonneg (r : ℝ) (p : ℤ × ℤ) (x : ℂ) : 0 ≤ hat r p x := + mul_nonneg (tent_nonneg _) (tent_nonneg _) +lemma hat_le_one (r : ℝ) (p : ℤ × ℤ) (x : ℂ) : hat r p x ≤ 1 := by + calc + _ ≤ 1*1 := mul_le_mul (tent_le_one _) (tent_le_one _) (tent_nonneg _) (by norm_num) + _ = _ := one_mul _ +lemma continuous_hat (r : ℝ) (p : ℤ × ℤ) : Continuous (hat r p) := by + unfold hat + exact (lipschitz_tent.continuous.comp (by fun_prop)).mul + (lipschitz_tent.continuous.comp (by fun_prop)) + +lemma summable_hat (r : ℝ) (x : ℂ) : Summable (fun p : ℤ × ℤ => hat r p x) := + (summable_tent (x.re/r)).mul_of_nonneg (summable_tent (x.im/r)) + (fun _ => tent_nonneg _) (fun _ => tent_nonneg _) + +theorem tsum_hat (r : ℝ) (x : ℂ) : (∑' p : ℤ × ℤ, hat r p x) = 1 := by + rw [Summable.tsum_prod (summable_hat r x)] + simp_rw [hat,tsum_mul_left,tsum_tent,mul_one] + exact tsum_tent _ + +/-- One-dimensional refinement written with the actual interpolation weights. -/ +lemma tent_half_integer {j : ℤ} (hj : j ∉ Finset.Icc (-1) 1) : tent ((j:ℝ)/2) = 0 := by + apply tent_eq_zero_of_one_le + simp only [Finset.mem_Icc,not_and_or,not_le] at hj + rcases hj with hj|hj + · have h : (j:ℝ) ≤ -2 := by exact_mod_cast (show j ≤ -2 by omega) + rw [abs_of_nonpos (by linarith)] + linarith + · have h : (2:ℝ) ≤ j := by exact_mod_cast (show 2 ≤ j by omega) + rw [abs_of_nonneg (by linarith)] + linarith + +lemma tent_half_refine (x : ℝ) : + tent (x/2) = ∑ j ∈ Finset.Icc (-1:ℤ) 1, tent ((j:ℝ)/2)*tent (x-j) := by + rw [show Finset.Icc (-1:ℤ) 1 = {-1,0,1} by decide] + simp only [Finset.sum_insert,Finset.sum_singleton,Finset.mem_insert, + Finset.mem_singleton,Int.reduceEq,or_self,not_false_eq_true, + Int.cast_neg,Int.cast_one,Int.cast_zero,sub_neg_eq_add,sub_zero] + norm_num [tent] at ⊢ + have h := tent_refine (x/2) + unfold tent at h + convert h using 1 + ring_nf + +lemma tent_half_tsum_refine (x : ℝ) (p : ℤ) : + tent (x/2-p) = ∑' j : ℤ, tent ((j:ℝ)/2-p)*tent (x-j) := by + have heq : (∑' j : ℤ, tent ((j:ℝ)/2-p)*tent (x-j)) = + ∑' j : ℤ, tent ((j:ℝ)/2)*tent ((x-2*p)-j) := by + rw [← (Equiv.addRight (2*p)).tsum_eq] + apply tsum_congr + intro j + simp only [Equiv.coe_addRight,Int.cast_add,Int.cast_mul,Int.cast_ofNat] + congr 2 <;> ring + rw [heq,tsum_eq_sum (s := Finset.Icc (-1:ℤ) 1)] + · convert tent_half_refine (x-2*p) using 1 + congr 1 + ring + · intro j hj + rw [tent_half_integer hj,zero_mul] + +lemma summable_tent_weight (x : ℝ) (a : ℤ → ℝ) : + Summable (fun j : ℤ => a j*tent (x-j)) := by + apply summable_of_ne_finset_zero (s := {⌊x⌋,⌊x⌋+1}) + intro j hj + simp only [Finset.mem_insert,Finset.mem_singleton,not_or] at hj + rw [tent_eq_zero_of_ne_floor hj.1 hj.2,mul_zero] + +/-- Positive interpolation coefficients, indexed by coarse and fine grid indices. -/ +def step (p q : ℤ × ℤ) : ℝ := + tent ((q.1:ℝ)/2-p.1)*tent ((q.2:ℝ)/2-p.2) +lemma step_nonneg (p q : ℤ × ℤ) : 0 ≤ step p q := + mul_nonneg (tent_nonneg _) (tent_nonneg _) +lemma step_column (q : ℤ × ℤ) : (∑' p : ℤ × ℤ, step p q) = 1 := by + calc + _ = ∑' p, hat 1 p (((q.1:ℝ)/2 : ℂ)+((q.2:ℝ)/2 : ℂ)*Complex.I) := by + apply tsum_congr + intro p + simp [step,hat] + _ = 1 := tsum_hat _ _ + +lemma summable_step_hat (p : ℤ × ℤ) (r : ℝ) (x : ℂ) : + Summable (fun q : ℤ × ℤ => step p q*hat r q x) := by + have h1 := summable_tent_weight (x.re/r) (fun j => tent ((j:ℝ)/2-p.1)) + have h2 := summable_tent_weight (x.im/r) (fun j => tent ((j:ℝ)/2-p.2)) + convert h1.mul_of_nonneg h2 (fun j => mul_nonneg (tent_nonneg _) (tent_nonneg _)) + (fun j => mul_nonneg (tent_nonneg _) (tent_nonneg _)) using 1 + funext q + simp only [step,hat] + ring + +/-- Exact planar hat refinement; no grid truncation is hidden in the identity. -/ +theorem hat_refine (r : ℝ) (p : ℤ × ℤ) (x : ℂ) : + hat (2*r) p x = ∑' q : ℤ × ℤ, step p q*hat r q x := by + rw [Summable.tsum_prod (summable_step_hat p r x)] + have heq : (fun j : ℤ => ∑' k : ℤ, + step p (j,k)*hat r (j,k) x) = fun j : ℤ => + (tent ((j:ℝ)/2-p.1)*tent (x.re/r-j))* + ∑' k : ℤ, tent ((k:ℝ)/2-p.2)*tent (x.im/r-k) := by + funext j + rw [← tsum_mul_left] + apply tsum_congr + intro k + simp only [step,hat] + ring + rw [heq,tsum_mul_right,← tent_half_tsum_refine,← tent_half_tsum_refine] + unfold hat + congr 2 <;> ring + +end DyadicHats + +open MeasureTheory Set Metric +open scoped ENNReal NNReal +noncomputable section +namespace PlanePotential + +lemma dim_complex : Module.finrank ℝ ℂ = 2 := Complex.finrank_real_complex + +lemma volume_real_unit_ball : volume.real (ball (0:ℂ) 1) = Real.pi := by + rw [measureReal_def,Complex.volume_ball] + simp + +lemma integral_radial (f : ℝ → ℝ) : + (∫ x : ℂ, f ‖x‖) = 2*Real.pi * ∫ r in Ioi (0:ℝ), r*f r := by + rw [integral_fun_norm_addHaar volume f] + simp only [dim_complex,show (2:ℕ)-1=1 by rfl,pow_one,smul_eq_mul,volume_real_unit_ball, + nsmul_eq_mul,Nat.cast_ofNat] + ring + +lemma integrable_radial_iff (f : ℝ → ℝ) : + Integrable (fun x : ℂ => f ‖x‖) ↔ IntegrableOn (fun r => r*f r) (Ioi (0:ℝ)) := by + simpa only [dim_complex,show (2:ℕ)-1=1 by rfl,pow_one,smul_eq_mul] using + integrable_fun_norm_addHaar (E := ℂ) volume (f := f) + +lemma radial_near_identity (a r : ℝ) {t : ℝ} (ht : 0 < t) : + t * (Iio r).indicator (fun u : ℝ => u^a) t = (Ioo 0 r).indicator (fun u : ℝ => u^(a+1)) t := by + by_cases htr : t < r + · simp only [indicator_of_mem (show t ∈ Iio r from htr),indicator_of_mem (show t ∈ Ioo 0 r from ⟨ht,htr⟩)] + rw [Real.rpow_add ht,Real.rpow_one,mul_comm] + · simp only [indicator_of_notMem (show t ∉ Iio r from htr),indicator_of_notMem (show t ∉ Ioo 0 r by simp [htr]),mul_zero] + +lemma integrable_norm_rpow_near {a r : ℝ} (ha : -2 < a) (hr : 0 < r) : + IntegrableOn (fun x : ℂ => ‖x‖^a) (ball 0 r) := by + rw [integrableOn_fun_norm_addHaar volume (f := fun t : ℝ => t^a)] + simp only [dim_complex,show (2:ℕ)-1=1 by rfl,pow_one,smul_eq_mul] + have hi : IntegrableOn (fun t : ℝ => t^(a+1)) (Ioo 0 r) := + (intervalIntegral.integrableOn_Ioo_rpow_iff hr).mpr (by linarith) + apply hi.congr_fun _ measurableSet_Ioo + intro t ht + change t^(a+1) = t*t^a + rw [Real.rpow_add ht.1,Real.rpow_one,mul_comm] + +/-- Exact planar singular-kernel integral; the center point is not excluded by +an unproved integrability convention. -/ +theorem integral_norm_rpow_near {a r : ℝ} (ha : -2 < a) (hr : 0 < r) : + (∫ x in ball (0:ℂ) r, ‖x‖^a) = 2*Real.pi * (r^(a+2)/(a+2)) := by + have heq : (ball (0:ℂ) r).indicator (fun x => ‖x‖^a) = + fun x : ℂ => (Iio r).indicator (fun t : ℝ => t^a) ‖x‖ := by + funext x + by_cases hx : ‖x‖ < r <;> simp [indicator,hx] + rw [← integral_indicator measurableSet_ball,heq,integral_radial] + have hinner : (∫ t in Ioi (0:ℝ), t*(Iio r).indicator (fun u : ℝ => u^a) t) = + ∫ t in Ioo 0 r, t^(a+1) := by + rw [setIntegral_congr_fun measurableSet_Ioi (fun t ht => radial_near_identity a r ht)] + rw [integral_indicator measurableSet_Ioo,Measure.restrict_restrict measurableSet_Ioo, + inter_eq_left.mpr (Ioo_subset_Ioi_self)] + rw [hinner,← integral_Ioc_eq_integral_Ioo,← intervalIntegral.integral_of_le hr.le, + integral_rpow (Or.inl (by linarith : -1 < a+1))] + rw [show a+1+1=a+2 by ring,Real.zero_rpow (by linarith : a+2 ≠ 0),sub_zero] + +lemma radial_far_identity (a r : ℝ) {t : ℝ} (ht : 0 < t) : + t*(Ioi r).indicator (fun u : ℝ => u^a) t = (Ioi r).indicator (fun u : ℝ => u^(a+1)) t := by + by_cases htr : r < t + · simp only [indicator_of_mem (show t ∈ Ioi r from htr)] + rw [Real.rpow_add ht,Real.rpow_one,mul_comm] + · simp only [indicator_of_notMem (show t ∉ Ioi r from htr),mul_zero] + +lemma integrable_norm_rpow_far {a r : ℝ} (ha : a < -2) (hr : 0 < r) : + IntegrableOn (fun x : ℂ => ‖x‖^a) {x | r < ‖x‖} := by + rw [← integrable_indicator_iff (measurableSet_lt measurable_const measurable_norm)] + have heq : ({x : ℂ | r < ‖x‖}).indicator (fun x => ‖x‖^a) = + fun x : ℂ => (Ioi r).indicator (fun t : ℝ => t^a) ‖x‖ := by rfl + rw [heq,integrable_radial_iff] + have hi : IntegrableOn (fun t : ℝ => t^(a+1)) (Ioi r) := + integrableOn_Ioi_rpow_of_lt (by linarith) hr + have hi' : Integrable ((Ioi r).indicator (fun t : ℝ => t^(a+1))) := + (integrable_indicator_iff measurableSet_Ioi).mpr hi + apply hi'.integrableOn.congr_fun _ measurableSet_Ioi + intro t ht + exact (radial_far_identity a r ht).symm + +theorem integral_norm_rpow_far {a r : ℝ} (ha : a < -2) (hr : 0 < r) : + (∫ x : ℂ in {x | r < ‖x‖}, ‖x‖^a) = 2*Real.pi * (-r^(a+2)/(a+2)) := by + have heq : ({x : ℂ | r < ‖x‖}).indicator (fun x => ‖x‖^a) = + fun x : ℂ => (Ioi r).indicator (fun t : ℝ => t^a) ‖x‖ := by rfl + rw [← integral_indicator (measurableSet_lt measurable_const measurable_norm),heq,integral_radial] + rw [setIntegral_congr_fun measurableSet_Ioi (fun t ht => radial_far_identity a r ht)] + rw [integral_indicator measurableSet_Ioi,Measure.restrict_restrict measurableSet_Ioi, + inter_eq_left.mpr (Ioi_subset_Ioi hr.le),integral_Ioi_rpow_of_lt (by linarith : a+1 < -1) hr] + congr 2 + rw [show a+1+1 = a+2 by ring] + ring + +end PlanePotential + +open MeasureTheory Set +open scoped ENNReal NNReal +noncomputable section +namespace PlanePotential + +/-- Hölder followed by Tonelli gives the integral-kernel Minkowski estimate at +p=3/2. Both measures and the actual joint kernel remain explicit. -/ +theorem kernel_lp_three_halves {α β : Type*} [MeasurableSpace α] [MeasurableSpace β] + (μ : Measure α) (ν : Measure β) [SFinite μ] [SFinite ν] + {K : α × β → ℝ≥0∞} (hK : Measurable K) {C : ℝ≥0∞} + (hC : ∀ y, (∫⁻ x, (K (x,y))^(3/2:ℝ) ∂μ) ≤ C^(3/2:ℝ)) : + (∫⁻ x, (∫⁻ y, K (x,y) ∂ν)^(3/2:ℝ) ∂μ) ≤ (C*ν univ)^(3/2:ℝ) := by + have hpq : Real.HolderConjugate (3/2) 3 := by + rw [Real.holderConjugate_iff] + norm_num + have hpoint (x : α) : (∫⁻ y, K (x,y) ∂ν)^(3/2:ℝ) ≤ + (∫⁻ y, K (x,y)^(3/2:ℝ) ∂ν)*(ν univ)^(1/2:ℝ) := by + have h := ENNReal.lintegral_mul_le_Lp_mul_Lq ν hpq (f := fun y => K (x,y)) (g := fun _ => 1) + ((hK.comp (measurable_const.prodMk measurable_id)).aemeasurable) + (aemeasurable_const (b := (1:ℝ≥0∞))) + simp only [Pi.mul_apply,mul_one,ENNReal.one_rpow,lintegral_const,one_mul] at h + have h' := ENNReal.rpow_le_rpow h (by norm_num : (0:ℝ) ≤ 3/2) + simpa only [ENNReal.mul_rpow_of_nonneg _ _ (by norm_num : (0:ℝ) ≤ 3/2),← ENNReal.rpow_mul, + show (1/(3/2:ℝ))*(3/2)=1 by norm_num, + show (1/(3:ℝ))*(3/2)=1/2 by norm_num,ENNReal.rpow_one,one_mul] using h' + calc + _ ≤ ∫⁻ x, (∫⁻ y, K (x,y)^(3/2:ℝ) ∂ν)*(ν univ)^(1/2:ℝ) ∂μ := + lintegral_mono (fun x => hpoint x) + _ = (∫⁻ y, ∫⁻ x, K (x,y)^(3/2:ℝ) ∂μ ∂ν)*(ν univ)^(1/2:ℝ) := by + rw [lintegral_mul_const _ (hK.pow_const _).lintegral_prod_right, + lintegral_lintegral_swap (hK.pow_const _).aemeasurable] + _ ≤ (C^(3/2:ℝ)*ν univ)*(ν univ)^(1/2:ℝ) := by + apply mul_le_mul_left + exact (lintegral_mono hC).trans_eq (lintegral_const _) + _ = _ := by + rw [ENNReal.mul_rpow_of_nonneg _ _ (by norm_num : (0:ℝ) ≤ 3/2),mul_assoc] + congr 1 + calc + _ = (ν univ)^(1:ℝ)*(ν univ)^(1/2:ℝ) := by rw [ENNReal.rpow_one] + _ = (ν univ)^((1:ℝ)+1/2) := (ENNReal.rpow_add_of_nonneg 1 (1/2) (by norm_num) (by norm_num)).symm + _ = _ := by norm_num + +end PlanePotential + +open Finset +open scoped RealInnerProductSpace +noncomputable section +namespace FiniteLabels +variable {ι κ : Type*} [Fintype ι] [Fintype κ] + +structure Law (ι : Type*) [Fintype ι] where + mass : ι → ℝ + nonneg : ∀ i, 0 ≤ mass i + total : ∑ i, mass i = 1 + +instance : CoeFun (Law ι) (fun _ => ι → ℝ) := ⟨Law.mass⟩ + +def delta [DecidableEq ι] (i : ι) : Law ι where + mass j := if j=i then 1 else 0 + nonneg j := by split_ifs <;> norm_num + total := by simp + +lemma law_le_one (μ : Law ι) (i : ι) : μ i ≤ 1 := by + rw [← μ.total] + exact single_le_sum (fun j _ => μ.nonneg j) (mem_univ i) + +def move (μ : Law ι) (P : ι → Law κ) : Law κ where + mass j := ∑ i, μ i*P i j + nonneg j := sum_nonneg fun i _ => mul_nonneg (μ.nonneg i) ((P i).nonneg j) + total := by + rw [sum_comm] + simp_rw [← mul_sum,(P _).total,mul_one] + exact μ.total + +lemma move_apply (μ : Law ι) (P : ι → Law κ) (j : κ) : + move μ P j = ∑ i, μ i*P i j := rfl + +def l1dist (a b : ι → ℝ) : ℝ := ∑ i, |a i-b i| +lemma l1dist_nonneg (a b : ι → ℝ) : 0 ≤ l1dist a b := sum_nonneg (fun _ _ => abs_nonneg _) +lemma l1dist_triangle (a b c : ι → ℝ) : l1dist a c ≤ l1dist a b+l1dist b c := by + unfold l1dist + rw [← sum_add_distrib] + exact sum_le_sum fun i _ => abs_sub_le (a i) (b i) (c i) + +/-- Stochastic matrices contract the l1 norm of every signed row difference. -/ +theorem move_contract (μ ν : Law ι) (P : ι → Law κ) : + l1dist (move μ P) (move ν P) ≤ l1dist μ ν := by + unfold l1dist + calc + _ = ∑ j, |∑ i, (μ i-ν i)*P i j| := by + apply sum_congr rfl + intro j _ + congr 1 + simp only [move_apply,sub_mul,sum_sub_distrib] + _ ≤ ∑ j, ∑ i, |μ i-ν i| *P i j := by + apply sum_le_sum + intro j _ + calc + _ ≤ ∑ i, |(μ i-ν i)*P i j| := abs_sum_le_sum_abs _ _ + _ = _ := by simp only [abs_mul,abs_of_nonneg ((P _).nonneg _)] + _ = _ := by + rw [sum_comm] + simp_rw [← mul_sum,(P _).total,mul_one] + +lemma move_rows (μ : Law ι) (P Q : ι → Law κ) : + l1dist (move μ P) (move μ Q) ≤ ∑ i, μ i*l1dist (P i) (Q i) := by + unfold l1dist + calc + _ = ∑ j, |∑ i, μ i*(P i j-Q i j)| := by + apply sum_congr rfl + intro j _ + congr 1 + simp only [move_apply,mul_sub,sum_sub_distrib] + _ ≤ ∑ j, ∑ i, μ i*|P i j-Q i j| := by + apply sum_le_sum + intro j _ + calc + _ ≤ ∑ i, |μ i*(P i j-Q i j)| := abs_sum_le_sum_abs _ _ + _ = _ := by simp only [abs_mul,abs_of_nonneg (μ.nonneg _)] + _ = _ := by rw [sum_comm]; simp_rw [mul_sum] + +lemma move_compare (μ ν : Law ι) (P Q : ι → Law κ) : + l1dist (move μ P) (move ν Q) ≤ l1dist μ ν+∑ i, ν i*l1dist (P i) (Q i) := by + exact (l1dist_triangle _ (move ν P) _).trans (add_le_add (move_contract μ ν P) (move_rows ν P Q)) + +lemma expectation_difference (μ ν : Law ι) {a : ι → ℝ} {C : ℝ} + (ha : ∀ i, |a i| ≤ C) : + |(∑ i, μ i*a i)-(∑ i, ν i*a i)| ≤ C*l1dist μ ν := by + rw [← sum_sub_distrib] + simp_rw [← sub_mul] + calc + _ ≤ ∑ i, |(μ i-ν i)*a i| := abs_sum_le_sum_abs _ _ + _ ≤ ∑ i, C*|μ i-ν i| := sum_le_sum fun i _ => by + rw [abs_mul,mul_comm C] + exact mul_le_mul_of_nonneg_left (ha i) (abs_nonneg _) + _ = _ := by rw [← mul_sum]; rfl + +def switchRow [DecidableEq ι] (old : ι) (sample : Law κ) (target : κ → ι) + (p : κ → ℝ) (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) : Law ι where + mass j := (1-∑ z, sample z*p z)*(delta old j)+∑ z, sample z*p z*(delta (target z) j) + nonneg j := by + apply add_nonneg + · apply mul_nonneg _ ((delta old).nonneg j) + apply sub_nonneg.mpr + calc + _ ≤ ∑ z, sample z*1 := sum_le_sum fun z _ => mul_le_mul_of_nonneg_left (hp1 z) (sample.nonneg z) + _ = 1 := by simp only [mul_one]; exact sample.total + · exact sum_nonneg fun z _ => mul_nonneg (mul_nonneg (sample.nonneg z) (hp0 z)) ((delta _).nonneg j) + total := by + rw [sum_add_distrib,← mul_sum,(delta old).total,sum_comm] + simp_rw [← mul_sum,(delta _).total,mul_one] + ring + +lemma switchRow_formula [DecidableEq ι] (old : ι) (sample : Law κ) (target : κ → ι) + (p : κ → ℝ) (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (j : ι) : + switchRow old sample target p hp0 hp1 j = + delta old j+∑ z, sample z*p z*(delta (target z) j-delta old j) := by + change (_-_) * _ + _ = _ + simp only [mul_sub,sum_sub_distrib,← sum_mul] + ring + +lemma delta_distance [DecidableEq ι] (i j : ι) : l1dist (delta i) (delta j) ≤ 2 := by + unfold l1dist + calc + _ ≤ ∑ k, (delta i k+delta j k) := sum_le_sum fun k _ => by + exact abs_sub_le_iff.mpr ⟨by linarith [(delta j).nonneg k],by linarith [(delta i).nonneg k]⟩ + _ = 2 := by rw [sum_add_distrib,(delta i).total,(delta j).total]; norm_num + +/-- The row difference is paid by the actual switched mass, not by a bare +Lipschitz constant. This is essential to the spatial comparison argument. -/ +theorem switchRow_distance [DecidableEq ι] (old : ι) (sample sample' : Law κ) + (target : κ → ι) (p : κ → ℝ) (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) : + l1dist (switchRow old sample target p hp0 hp1) (switchRow old sample' target p hp0 hp1) + ≤ 2*∑ z, |sample z-sample' z| *p z := by + unfold l1dist + simp_rw [switchRow_formula,add_sub_add_left_eq_sub,← sum_sub_distrib] + calc + _ = ∑ j, |∑ z, (sample z-sample' z)*p z*(delta (target z) j-delta old j)| := by + apply sum_congr rfl + intro j _ + congr 1 + apply sum_congr rfl + intro z _ + ring + _ ≤ ∑ j, ∑ z, |sample z-sample' z| *p z*|delta (target z) j-delta old j| := by + apply sum_le_sum + intro j _ + calc + _ ≤ ∑ z, |(sample z-sample' z)*p z*(delta (target z) j-delta old j)| := abs_sum_le_sum_abs _ _ + _ = _ := by simp only [abs_mul,abs_of_nonneg (hp0 _)] + _ = ∑ z, (|sample z-sample' z| *p z)*l1dist (delta (target z)) (delta old) := by + rw [sum_comm] + simp only [l1dist,mul_sum] + _ ≤ ∑ z, (|sample z-sample' z| *p z)*2 := sum_le_sum fun z _ => + mul_le_mul_of_nonneg_left (delta_distance _ _) (mul_nonneg (abs_nonneg _) (hp0 z)) + _ = _ := by rw [← sum_mul,mul_comm] + +end FiniteLabels + +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +noncomputable section +namespace PlanePotential + +def greenScalar (ψ : ℂ → ℝ) (x y : ℂ) : ℝ := + ∫ t in Ioc (0:ℝ) 1, ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ) +def green (ψ : ℂ → ℝ) (x y : ℂ) : ℂ := -greenScalar ψ x y • (y-x) + +lemma segment_support {ψ : ℂ → ℝ} {R X : ℝ} + (hψ : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) {x y : ℂ} (hx : ‖x‖ ≤ X) + {t : ℝ} (ht : 0 < t) (hn : ψ (x+t⁻¹ • (y-x)) ≠ 0) : + ‖y-x‖ ≤ t*(R+X) := by + have heq : y-x = t • ((x+t⁻¹ • (y-x))-x) := by + simp [ht.ne'] + calc + ‖y-x‖ = t*‖(x+t⁻¹ • (y-x))-x‖ := by + conv_lhs => rw [heq] + rw [norm_smul,Real.norm_eq_abs,abs_of_pos ht] + _ ≤ t*(‖x+t⁻¹ • (y-x)‖+‖x‖) := + mul_le_mul_of_nonneg_left (norm_sub_le _ _) ht.le + _ ≤ t*(R+X) := mul_le_mul_of_nonneg_left (add_le_add (hψ _ hn) hx) ht.le + +lemma integrable_power_cutoff {q δ B : ℝ} (hq : q < -1) (hδ : 0 < δ) : + Integrable ((Ioi δ).indicator (fun t : ℝ => B*t^q)) := by + apply (integrable_indicator_iff measurableSet_Ioi).mpr + exact (integrableOn_Ioi_rpow_of_lt hq hδ).const_mul B + +lemma integral_power_cutoff {q δ B : ℝ} (hq : q < -1) (hδ : 0 < δ) : + (∫ t : ℝ, (Ioi δ).indicator (fun t : ℝ => B*t^q) t) = B*(-δ^(q+1)/(q+1)) := by + rw [integral_indicator measurableSet_Ioi,integral_const_mul,integral_Ioi_rpow_of_lt hq hδ] + +/-- A singular segment integral is genuinely integrable because of its geometric +lower cutoff. The bound retains the exact power, rather than a supremum times 1. -/ +lemma singular_integral_bound {F : ℝ → ℝ} (hFm : Measurable F) + {q δ B : ℝ} (hq : q < -1) (hδ : 0 < δ) (hB : 0 ≤ B) + (hzero : ∀ t ∈ Ioc (0:ℝ) 1, t < δ → F t = 0) + (hbound : ∀ t ∈ Ioc (0:ℝ) 1, |F t| ≤ B*t^q) : + IntegrableOn F (Ioc (0:ℝ) 1) ∧ + |∫ t in Ioc (0:ℝ) 1, F t| ≤ B*(-(δ/2)^(q+1)/(q+1)) := by + let H := (Ioi (δ/2)).indicator (fun t : ℝ => B*t^q) + have hH : Integrable H := integrable_power_cutoff hq (by linarith) + have hH0 (t : ℝ) : 0 ≤ H t := by + unfold H + apply indicator_nonneg + intro t ht + exact mul_nonneg hB (Real.rpow_nonneg (by change δ/2 < t at ht; linarith) _) + have hle : ∀ t ∈ Ioc (0:ℝ) 1, |F t| ≤ H t := by + intro t ht + by_cases hd : t < δ + · rw [hzero t ht hd] + simpa only [abs_zero] using hH0 t + · have htδ : t ∈ Ioi (δ/2) := by change δ/2 < t; linarith + change |F t| ≤ (Ioi (δ/2)).indicator (fun t : ℝ => B*t^q) t + rw [indicator_of_mem htδ] + exact hbound t ht + have hFi : IntegrableOn F (Ioc (0:ℝ) 1) := by + apply hH.integrableOn.mono' hFm.aestronglyMeasurable + filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht + simpa only [Real.norm_eq_abs] using hle t ht + refine ⟨hFi,?_⟩ + calc + _ ≤ ∫ t in Ioc (0:ℝ) 1, |F t| := abs_integral_le_integral_abs + _ ≤ ∫ t in Ioc (0:ℝ) 1, H t := integral_mono_ae hFi.abs hH.integrableOn (by + filter_upwards [ae_restrict_mem measurableSet_Ioc] with t ht using hle t ht) + _ ≤ ∫ t, H t := integral_mono_measure Measure.restrict_le_self (ae_of_all _ hH0) hH + _ = _ := integral_power_cutoff hq (by linarith) + +lemma greenScalar_measurable (ψ : ℂ → ℝ) (hψ : Measurable ψ) : + Measurable (fun p : ℂ × ℂ => greenScalar ψ p.1 p.2) := by + unfold greenScalar + apply StronglyMeasurable.measurable + apply StronglyMeasurable.integral_prod_right + have harg : Measurable (fun p : (ℂ × ℂ) × ℝ => p.1.1+p.2⁻¹ • (p.1.2-p.1.1)) := by measurability + exact ((hψ.comp harg).mul (measurable_snd.pow_const _)).stronglyMeasurable + +lemma green_measurable (ψ : ℂ → ℝ) (hψ : Measurable ψ) : + Measurable (fun p : ℂ × ℂ => green ψ p.1 p.2) := by + exact (greenScalar_measurable ψ hψ).neg.smul (measurable_snd.sub measurable_fst) + +/-- Quantitative kernel size on every observation ball, with an explicit constant. -/ +theorem green_norm_bound {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) {x y : ℂ} (hx : ‖x‖ ≤ X) (hxy : y ≠ x) : + ‖green ψ x y‖ ≤ 2*B*(R+X)^2/‖y-x‖ := by + have hd : 0 < ‖y-x‖ := norm_pos_iff.mpr (sub_ne_zero.mpr hxy) + let δ := ‖y-x‖/(R+X) + have hδ : 0 < δ := div_pos hd hM + have hFm : Measurable (fun t : ℝ => ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ)) := by + apply Measurable.mul + · apply hψm.comp + measurability + · exact measurable_id.pow_const _ + have hzero : ∀ t ∈ Ioc (0:ℝ) 1, t < δ → ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ) = 0 := by + intro t ht hlt + have hψ0 : ψ (x+t⁻¹ • (y-x)) = 0 := by + by_contra hn + have hs := segment_support hψs hx ht.1 hn + have : t*(R+X) < ‖y-x‖ := (lt_div_iff₀ hM).mp hlt + linarith + rw [hψ0,zero_mul] + have hb : ∀ t ∈ Ioc (0:ℝ) 1, + |ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ)| ≤ B*t^(-3:ℝ) := by + intro t ht + rw [abs_mul,abs_of_nonneg (Real.rpow_nonneg ht.1.le _)] + exact mul_le_mul_of_nonneg_right (hψB _) (Real.rpow_nonneg ht.1.le _) + have h := (singular_integral_bound hFm (by norm_num : (-3:ℝ) < -1) hδ hB hzero hb).2 + change |greenScalar ψ x y| ≤ _ at h + have hrpow : (δ/2)^((-3:ℝ)+1) = (δ/2)^(-2:ℤ) := by norm_num [Real.rpow_intCast] + rw [hrpow,zpow_neg,zpow_ofNat] at h + have hs : |greenScalar ψ x y| ≤ 2*B*(R+X)^2/‖y-x‖^2 := by + convert h using 1 + dsimp [δ] + field_simp + ring + rw [green,norm_smul,Real.norm_eq_abs,abs_neg] + calc + _ ≤ (2*B*(R+X)^2/‖y-x‖^2)*‖y-x‖ := mul_le_mul_of_nonneg_right hs hd.le + _ = _ := by field_simp + +lemma segment_integrand_measurable {ψ : ℂ → ℝ} (hψ : Measurable ψ) (x y : ℂ) : + Measurable (fun t : ℝ => ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ)) := by + apply Measurable.mul + · apply hψ.comp + measurability + · exact measurable_id.pow_const _ + +lemma scalar_data {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B δ : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) (hδ : 0 < δ) + {x y : ℂ} (hx : ‖x‖ ≤ X) (hd : δ*(R+X) ≤ ‖y-x‖) : + IntegrableOn (fun t : ℝ => ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ)) (Ioc (0:ℝ) 1) ∧ + |greenScalar ψ x y| ≤ 2*B/δ^2 := by + have hz : ∀ t ∈ Ioc (0:ℝ) 1, t < δ → ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ) = 0 := by + intro t ht hlt + have : ψ (x+t⁻¹ • (y-x)) = 0 := by + by_contra hn + have hs := segment_support hψs hx ht.1 hn + have := mul_lt_mul_of_pos_right hlt hM + linarith + rw [this,zero_mul] + have hb : ∀ t ∈ Ioc (0:ℝ) 1, + |ψ (x+t⁻¹ • (y-x))*t^(-3:ℝ)| ≤ B*t^(-3:ℝ) := by + intro t ht + rw [abs_mul,abs_of_nonneg (Real.rpow_nonneg ht.1.le _)] + exact mul_le_mul_of_nonneg_right (hψB _) (Real.rpow_nonneg ht.1.le _) + obtain ⟨hi,h⟩ := singular_integral_bound (segment_integrand_measurable hψm x y) + (by norm_num : (-3:ℝ) < -1) hδ hB hz hb + refine ⟨hi, h.trans_eq ?_⟩ + rw [show (-3:ℝ)+1 = -2 by norm_num, show (δ/2)^(-2:ℝ) = (δ/2)^(-2:ℤ) by norm_num [Real.rpow_intCast],zpow_neg,zpow_ofNat] + norm_num + field_simp + +/-- A difference bound proves the needed cancellation estimate without hiding +any differentiation under the singular integral. -/ +theorem green_difference_bound {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X B L : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hψL : ∀ u v, |ψ u-ψ v| ≤ L*‖u-v‖) + (hM : 0 < R+X) (hB : 0 ≤ B) (hL : 0 ≤ L) + {x y z : ℂ} (hx : ‖x‖ ≤ X) (hzx : z ≠ x) (hyz : ‖y-z‖ ≤ ‖z-x‖/2) : + ‖green ψ x y-green ψ x z‖ ≤ + (8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)*‖y-z‖/‖z-x‖^2 := by + let d := ‖z-x‖ + let a := ‖y-z‖ + let M := R+X + let δ := d/(2*M) + have hd : 0 < d := norm_pos_iff.mpr (sub_ne_zero.mpr hzx) + have ha : 0 ≤ a := norm_nonneg _ + have hδ : 0 < δ := div_pos hd (mul_pos (by norm_num) hM) + have hnear : d/2 ≤ ‖y-x‖ := by + have ht := norm_sub_le_norm_sub_add_norm_sub z y x + rw [norm_sub_rev z y] at ht + dsimp [d] at * + linarith + have hcut : δ*M = d/2 := by dsimp [δ]; field_simp [show M ≠ 0 from hM.ne'] + have hdy : δ*(R+X) ≤ ‖y-x‖ := by change δ*M ≤ _; rw [hcut]; exact hnear + have hdz : δ*(R+X) ≤ ‖z-x‖ := by change δ*M ≤ d; rw [hcut]; linarith + obtain ⟨hIy,hKy⟩ := scalar_data hψm hψs hψB hM hB hδ hx hdy + obtain ⟨hIz,_⟩ := scalar_data hψm hψs hψB hM hB hδ hx hdz + let F := fun t : ℝ => (ψ (x+t⁻¹ • (y-x))-ψ (x+t⁻¹ • (z-x)))*t^(-3:ℝ) + have hFm : Measurable F := by + change Measurable (fun t : ℝ => _) + have hm (v : ℂ) : Measurable (fun t : ℝ => ψ (x+t⁻¹ • (v-x))) := by + apply hψm.comp + measurability + exact ((hm y).sub (hm z)).mul (measurable_id.pow_const _) + have hzero : ∀ t ∈ Ioc (0:ℝ) 1, t < δ → F t = 0 := by + intro t ht htδ + have h0 (v : ℂ) (hv : δ*M ≤ ‖v-x‖) : ψ (x+t⁻¹ • (v-x)) = 0 := by + by_contra hn + have hs := segment_support hψs hx ht.1 hn + have := mul_lt_mul_of_pos_right htδ hM + dsimp [M] at hv + linarith + change (ψ (x+t⁻¹ • (y-x))-ψ (x+t⁻¹ • (z-x)))*t^(-3:ℝ) = 0 + rw [h0 y hdy,h0 z hdz,sub_self,zero_mul] + have hbound : ∀ t ∈ Ioc (0:ℝ) 1, |F t| ≤ (L*a)*t^(-4:ℝ) := by + intro t ht + have harg : (x+t⁻¹ • (y-x))-(x+t⁻¹ • (z-x)) = t⁻¹ • (y-z) := by module + have hLip := hψL (x+t⁻¹ • (y-x)) (x+t⁻¹ • (z-x)) + rw [harg,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ht.1)] at hLip + calc + |F t| = |ψ (x+t⁻¹ • (y-x))-ψ (x+t⁻¹ • (z-x))| *t^(-3:ℝ) := by + change |(ψ (x+t⁻¹ • (y-x))-ψ (x+t⁻¹ • (z-x)))*t^(-3:ℝ)| = _ + rw [abs_mul,abs_of_nonneg (Real.rpow_nonneg ht.1.le _)] + _ ≤ (L*(t⁻¹*a))*t^(-3:ℝ) := mul_le_mul_of_nonneg_right hLip (Real.rpow_nonneg ht.1.le _) + _ = (L*a)*t^(-4:ℝ) := by + rw [← Real.rpow_neg_one t] + calc + _ = (L*a)*(t^(-1:ℝ)*t^(-3:ℝ)) := by ring + _ = _ := by rw [← Real.rpow_add ht.1]; norm_num + have hdiff := (singular_integral_bound hFm (by norm_num : (-4:ℝ) < -1) + hδ (mul_nonneg hL ha) hzero hbound).2 + have hIF : (∫ t in Ioc (0:ℝ) 1, F t) = greenScalar ψ x y-greenScalar ψ x z := by + simp only [F,sub_mul,greenScalar] + exact integral_sub hIy hIz + rw [hIF] at hdiff + have hKd : |greenScalar ψ x y-greenScalar ψ x z| ≤ (64/3:ℝ)*L*a*M^3/d^3 := by + refine hdiff.trans_eq ?_ + rw [show (-4:ℝ)+1 = -3 by norm_num, show (δ/2)^(-3:ℝ) = (δ/2)^(-3:ℤ) by norm_num [Real.rpow_intCast],zpow_neg,zpow_ofNat] + dsimp [δ] + field_simp + ring + have hKy' : |greenScalar ψ x y| ≤ 8*B*M^2/d^2 := by + refine hKy.trans_eq ?_ + dsimp [δ] + field_simp + ring + have heq : green ψ x y-green ψ x z = + (-greenScalar ψ x y) • (y-z) - (greenScalar ψ x y-greenScalar ψ x z) • (z-x) := by + unfold green + module + rw [heq] + calc + _ ≤ ‖(-greenScalar ψ x y) • (y-z)‖ + + ‖(greenScalar ψ x y-greenScalar ψ x z) • (z-x)‖ := norm_sub_le _ _ + _ = |greenScalar ψ x y| *a + |greenScalar ψ x y-greenScalar ψ x z| *d := by + simp only [norm_smul,Real.norm_eq_abs,abs_neg,a,d] + _ ≤ (8*B*M^2/d^2)*a + ((64/3:ℝ)*L*a*M^3/d^3)*d := + add_le_add (mul_le_mul_of_nonneg_right hKy' ha) (mul_le_mul_of_nonneg_right hKd hd.le) + _ = _ := by change _ = (8*B*M^2+(64/3:ℝ)*L*M^3)*a/d^2; field_simp + +end PlanePotential + +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +noncomputable section +namespace VectorRefinement + +/-- Exact quadratic defect of a positive vector refinement, including zero parent mass. -/ +theorem quadratic_defect {ι E : Type*} [Fintype ι] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (w a : ι → ℝ) (θ : ι → E) (n : E) (A : ℝ) + (hn : ‖n‖ = 1) (hθ : ∀ i, ‖θ i‖ = 1) + (href : A • n = ∑ i, (w i*a i) • θ i) : + (∑ i, w i*a i)-A = (1/2:ℝ)*∑ i, w i*a i*‖θ i-n‖^2 := by + have hinner : A = ∑ i, w i*a i*⟪θ i,n⟫ := by + have h := congrArg (fun v : E => ⟪v,n⟫) href + simpa only [real_inner_smul_left,sum_inner,real_inner_self_eq_norm_sq,hn,one_pow,mul_one] using h + rw [hinner,← Finset.sum_sub_distrib,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + rw [norm_sub_sq_real,hθ i,hn] + ring + +lemma sq_norm_triangle {E : Type*} [SeminormedAddCommGroup E] (x y z : E) : + ‖x-z‖^2 ≤ 2*(‖x-y‖^2+‖z-y‖^2) := by + have h := norm_sub_le_norm_sub_add_norm_sub x y z + rw [norm_sub_rev y z] at h + have hsq := (sq_le_sq₀ (norm_nonneg _) (by positivity)).mpr h + nlinarith [sq_nonneg (‖x-y‖-‖z-y‖)] + +/-- Two sufficiently represented children cannot have a large angular disagreement +without spending the actual parent's triangle defect. -/ +theorem pair_defect_bound {ι E : Type*} [Fintype ι] [DecidableEq ι] + [NormedAddCommGroup E] [InnerProductSpace ℝ E] + (w a : ι → ℝ) (θ : ι → E) (n : E) (A : ℝ) + (hw : ∀ i, 0 ≤ w i) (ha : ∀ i, 0 ≤ a i) + (hn : ‖n‖ = 1) (hθ : ∀ i, ‖θ i‖ = 1) + (href : A • n = ∑ i, (w i*a i) • θ i) + {q s : ι} (hwaq : 1/4 ≤ w q) (hwas : 9/64 ≤ w s) (has : a q ≤ a s) : + a q*‖θ q-θ s‖^2 ≤ 48*((∑ i, w i*a i)-A) := by + let D := (∑ i, w i*a i)-A + have hD := quadratic_defect w a θ n A hn hθ href + have hi (i : ι) : w i*a i*‖θ i-n‖^2 ≤ 2*D := by + have hs : w i*a i*‖θ i-n‖^2 ≤ ∑ j, w j*a j*‖θ j-n‖^2 := + Finset.single_le_sum (fun j _ => mul_nonneg (mul_nonneg (hw j) (ha j)) (sq_nonneg ‖θ j-n‖)) (Finset.mem_univ i) + dsimp [D] + linarith + have hD0 : 0 ≤ D := by + have hs : 0 ≤ ∑ i, w i*a i*‖θ i-n‖^2 := Finset.sum_nonneg fun i _ => + mul_nonneg (mul_nonneg (hw i) (ha i)) (sq_nonneg _) + dsimp [D]; linarith + have hq : a q*‖θ q-n‖^2 ≤ 8*D := by + have hm := mul_le_mul_of_nonneg_right hwaq (mul_nonneg (ha q) (sq_nonneg ‖θ q-n‖)) + nlinarith [hi q] + have hs : a q*‖θ s-n‖^2 ≤ (128/9:ℝ)*D := by + have hm := mul_le_mul_of_nonneg_right hwas (mul_nonneg (ha s) (sq_nonneg ‖θ s-n‖)) + have hmas := mul_le_mul_of_nonneg_right has (sq_nonneg ‖θ s-n‖) + nlinarith [hi s] + have ht := mul_le_mul_of_nonneg_left (sq_norm_triangle (θ q) n (θ s)) (ha q) + change _ ≤ 48*D + nlinarith + +end VectorRefinement + +open MeasureTheory Set +open scoped ENNReal NNReal Topology +noncomputable section + +end +end +end +end +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/LocalPrices.lean b/lean/OAI/Analysis/DiskMaximal/LocalPrices.lean new file mode 100644 index 0000000000000000000000000000000000000000..eb19893ec2b0881021a782ff7dceeed4c9c815c6 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/LocalPrices.lean @@ -0,0 +1,703 @@ +import OAI.Analysis.DiskMaximal.Scales + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real + +noncomputable section + +namespace DyadicMajorant +variable {X : Type*} [MeasurableSpace X] + +/-- A Borel price built from exceptions, rather than a measurability-dependent +selection of maximizing radii. -/ +def price (t : ℝ) (E : ℕ → Set X) (x : X) : ℝ≥0∞ := + ENNReal.ofReal t + ∑' n : ℕ, (E n).indicator (fun _ => ENNReal.ofReal (t*2^(n+1))) x + +lemma measurable_price (t : ℝ) {E : ℕ → Set X} (hE : ∀ n, MeasurableSet (E n)) : + Measurable (price t E) := by + unfold price + have hs : Measurable (fun x => ∑' n : ℕ, (E n).indicator (fun _ => ENNReal.ofReal (t*2^(n+1))) x) := Measurable.tsum (fun n => + (measurable_const : Measurable (fun _ : X => ENNReal.ofReal (t*2^(n+1)))).indicator (hE n)) + exact measurable_const.add hs + +omit [MeasurableSpace X] in +lemma majorizes {t v : ℝ} (ht : 0 < t) {E : ℕ → Set X} {x : X} + (hv : ∀ n : ℕ, x ∉ E n → v ≤ t*2^n) : + ENNReal.ofReal v ≤ price t E x := by + by_cases hvt : v ≤ t + · exact (ENNReal.ofReal_le_ofReal hvt).trans le_self_add + · have he : ∃ n : ℕ, v ≤ t*2^n := by + obtain ⟨n,hn⟩ := pow_unbounded_of_one_lt (v/t) (by norm_num : (1 : ℝ) < 2) + exact ⟨n, le_of_lt ((div_lt_iff₀ ht).mp hn |> fun h => by simpa only [mul_comm] using h)⟩ + let n := Nat.find he + have hn : v ≤ t*2^n := Nat.find_spec he + have hn0 : n ≠ 0 := by + intro hz + have : v ≤ t := by simpa only [hz, pow_zero, mul_one] using hn + exact hvt this + obtain ⟨j,hj⟩ := Nat.exists_eq_succ_of_ne_zero hn0 + have hjn : j < n := by omega + have hmem : x ∈ E j := by + by_contra h + exact Nat.find_min he hjn (hv j h) + have hp : ENNReal.ofReal (t*2^(j+1)) ≤ price t E x := by + have hs := ENNReal.le_tsum j (f := fun n : ℕ => (E n).indicator (fun _ => ENNReal.ofReal (t*2^(n+1))) x) + rw [indicator_of_mem hmem] at hs + exact hs.trans le_add_self + apply le_trans (ENNReal.ofReal_le_ofReal hn) + simpa only [hj, Nat.succ_eq_add_one] using hp + +lemma lintegral_price (μ : Measure X) {Q : Set X} + (t : ℝ) {E : ℕ → Set X} (hE : ∀ n, MeasurableSet (E n)) : + (∫⁻ x in Q, price t E x ∂μ) ≤ + ENNReal.ofReal t*μ Q + ∑' n : ℕ, ENNReal.ofReal (t*2^(n+1))*μ (E n) := by + simp only [price] + rw [lintegral_add_left measurable_const, lintegral_const, Measure.restrict_apply_univ, + lintegral_tsum (fun n => (measurable_const.indicator (hE n)).aemeasurable)] + apply add_le_add le_rfl + apply ENNReal.tsum_le_tsum + intro n + rw [lintegral_indicator (hE n), lintegral_const, Measure.restrict_apply_univ, + Measure.restrict_apply (hE n)] + exact mul_le_mul_right (measure_mono inter_subset_left) _ + +end DyadicMajorant + +namespace DyadicMajorant + +lemma weighted_geometric_sum {t K c : ℝ} (ht : 0 ≤ t) (hK : 0 ≤ K) + (hc : 0 ≤ c) (hc1 : 2*c < 1) : + (∑' n : ℕ, ENNReal.ofReal (t*2^(n+1))*ENNReal.ofReal (K*c^n)) = + ENNReal.ofReal (2*t*K/(1-2*c)) := by + have he (n : ℕ) : ENNReal.ofReal (t*2^(n+1))*ENNReal.ofReal (K*c^n) = + ENNReal.ofReal (2*t*K*(2*c)^n) := by + rw [← ENNReal.ofReal_mul (by positivity)] + congr 1 + rw [mul_pow, pow_succ] + ring + simp_rw [he] + have hc' : ‖2*c‖ < 1 := by rw [Real.norm_eq_abs, abs_of_nonneg (by positivity)]; exact hc1 + rw [← ENNReal.ofReal_tsum_of_nonneg (fun n => by positivity) + ((summable_geometric_of_norm_lt_one hc').mul_left (2*t*K)), + tsum_mul_left, tsum_geometric_of_norm_lt_one hc'] + rfl + +variable {X : Type*} [MeasurableSpace X] + +lemma lintegral_price_geometric (μ : Measure X) {Q : Set X} {q t K c : ℝ} + (hq : 0 ≤ q) (hQ : μ Q ≤ ENNReal.ofReal q) (ht : 0 ≤ t) + (hK : 0 ≤ K) (hc : 0 ≤ c) (hc1 : 2*c < 1) + {E : ℕ → Set X} (hE : ∀ n, MeasurableSet (E n)) + (hEv : ∀ n : ℕ, μ (E n) ≤ ENNReal.ofReal (K*c^n)) : + (∫⁻ x in Q, price t E x ∂μ) ≤ + ENNReal.ofReal (t*(q+2*K/(1-2*c))) := by + apply (lintegral_price μ t hE).trans + calc + _ ≤ ENNReal.ofReal t*ENNReal.ofReal q+ + ∑' n : ℕ, ENNReal.ofReal (t*2^(n+1))*ENNReal.ofReal (K*c^n) := + add_le_add (mul_le_mul_right hQ _) (ENNReal.tsum_le_tsum fun n => mul_le_mul_right (hEv n) _) + _ = ENNReal.ofReal (t*q)+ENNReal.ofReal (2*t*K/(1-2*c)) := by + rw [← ENNReal.ofReal_mul ht, weighted_geometric_sum ht hK hc hc1] + _ = _ := by + rw [← ENNReal.ofReal_add (mul_nonneg ht hq) (by positivity [sub_pos.mpr hc1])] + congr 1 + ring + +end DyadicMajorant + +namespace LocalCancellation +open DiskScales DiskMoments + +lemma errorPrice_zero {ι : Type*} [Fintype ι] {Cs α : ℝ} (b : ι → ErrorPiece Cs) + (hA : errorPrice b α = 0) : ∀ j, (b j).density =ᵐ[volume] 0 := by + intro j + have hterm : (b j).size^α*(b j).mass ≤ errorPrice b α := + Finset.single_le_sum (fun k _ => mul_nonneg (Real.rpow_nonneg (b k).size_pos.le _) (b k).mass_nonneg) (Finset.mem_univ j) + have hm : (b j).mass = 0 := by + have hp := Real.rpow_pos_of_pos (b j).size_pos α + rw [hA] at hterm + nlinarith [(b j).mass_nonneg] + have hz := (integral_eq_zero_iff_of_nonneg (fun y => norm_nonneg ((b j).density y)) (b j).integrable.norm).mp hm + filter_upwards [hz] with y hy + exact norm_eq_zero.mp hy + +lemma dyadic_ratio {A L : ℝ} (hA : 0 < A) (hL : 1 ≤ L) (n : ℕ) : + A/(L*A*2^n) ≤ (1/2 : ℝ)^n := by + have hLA : 0 < L*A := mul_pos (by linarith) hA + have hn : 0 < (2 : ℝ)^n := by positivity + calc + _ ≤ (L*A)/(L*A*2^n) := div_le_div_of_nonneg_right (le_mul_of_one_le_left hA.le hL) (mul_nonneg hLA.le hn.le) + _ = (1/2 : ℝ)^n := by rw [div_pow]; field_simp; simp + +/-- A simultaneous Borel integrable price for every admissible disk gradient. +The constant is independent of the number of pieces. -/ +theorem size_majorant {Cs : ℝ} (hCs : 0 ≤ Cs) : + ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type*} [Fintype ι] (b : ι → ErrorPiece Cs) + (g : ℂ → ℝ), ContDiff ℝ 1 g → ∀ Q : Set ℂ, volume Q ≤ ENNReal.ofReal 1 → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ x in Q, F x) ≤ ENNReal.ofReal (C*errorPrice b (1/100)) ∧ + ∀ x, (∀ᵐ y, y ∈ Metric.ball x 3 → ∑ j, (b j).density y = gradient g y) → + ∀ r, EndpointRadius g x r → + ENNReal.ofReal ‖∫ y in Metric.ball x r, gradient g y‖ ≤ F x := by + obtain ⟨L,hL,hsize⟩ := size_tail hCs + let c : ℝ := (1/2 : ℝ)^(34/25 : ℝ) + have hc : 0 ≤ c := Real.rpow_nonneg (by norm_num) _ + have hc1 : 2*c < 1 := by + have hh := Real.rpow_lt_rpow_of_exponent_gt (by norm_num : (0 : ℝ) < 1/2) + (by norm_num : (1/2 : ℝ) < 1) (by norm_num : (1 : ℝ) < 34/25) + norm_num at hh + linarith + let C := L*(1+2*sizeTailConstant/(1-2*c)) + have hC : 0 < C := mul_pos (by linarith) (by + have := sizeTailConstant_pos + have := sub_pos.mpr hc1 + positivity) + refine ⟨C,hC,?_⟩ + intro ι _ b g hg Q hQ + let A := errorPrice b (1/100) + by_cases hAz : A = 0 + · refine ⟨0,measurable_const,?_,?_⟩ + · simp only [Pi.zero_apply, lintegral_zero, A, hAz, mul_zero, ENNReal.ofReal_zero, le_refl] + · intro x hh r hr + have hz := errorPrice_zero b hAz + have hs : (∑ j, ∫ y in Metric.ball x r, (b j).density y) = 0 := by + apply Finset.sum_eq_zero + intro j _ + exact integral_eq_zero_of_ae ((ae_restrict_of_ae (hz j))) + have he := ball_pairing_decomposition b x (by linarith [hr.1.2] : r ≤ 3) hh + rw [← he,hs,norm_zero,ENNReal.ofReal_zero] + exact le_refl _ + · have hA : 0 < A := lt_of_le_of_ne (errorPrice_nonneg b _) (Ne.symm hAz) + have ht : 0 < L*A := mul_pos (by linarith) hA + have hts (n : ℕ) : L*A ≤ L*A*2^n := le_mul_of_one_le_right ht.le (one_le_pow₀ (by norm_num)) + choose E hE hEv hbound using fun n : ℕ => hsize b hA (L*A*2^n) (hts n) g hg + refine ⟨DyadicMajorant.price (L*A) E, DyadicMajorant.measurable_price _ hE,?_,?_⟩ + · have htail (n : ℕ) : volume (E n) ≤ ENNReal.ofReal (sizeTailConstant*c^n) := by + apply (hEv n).trans + apply ENNReal.ofReal_le_ofReal + apply mul_le_mul_of_nonneg_left _ sizeTailConstant_pos.le + calc + _ ≤ ((1/2 : ℝ)^n)^(34/25 : ℝ) := Real.rpow_le_rpow (by positivity) (dyadic_ratio hA hL n) (by norm_num) + _ = c^n := by + rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num), mul_comm (n : ℝ), + Real.rpow_mul (by norm_num), Real.rpow_natCast] + have hi := DyadicMajorant.lintegral_price_geometric volume (by norm_num : (0 : ℝ) ≤ 1) hQ ht.le + sizeTailConstant_pos.le hc hc1 hE htail + convert hi using 1 + congr 1 + dsimp [C,A] + ring + · intro x hh r hr + apply DyadicMajorant.majorizes ht + intro n hn + exact hbound n x hn hh r hr + +end LocalCancellation + +namespace LocalCancellation +open DiskKernels DiskGeometry + +/-- An integrable aggregate of vectors in a fixed acute cone. It covers the +positive pieces by taking their sum; no direction is imposed on errors. -/ +structure ConeDensity (e : ℂ) (κ : ℝ) where + density : ℂ → ℂ + integrable : Integrable density + cone : ∀ᵐ y, κ*‖density y‖ ≤ inner ℝ e (density y) + +lemma inner_unit_bound {e p : ℂ} (he : ‖e‖ = 1) : |inner ℝ e p| ≤ ‖p‖ := by + simpa only [he,one_mul] using abs_real_inner_le_norm e p + +lemma negative_projection_le_norm {e p : ℂ} (he : ‖e‖ = 1) : + max 0 (-inner ℝ e p) ≤ ‖p‖ := by + exact max_le (norm_nonneg _) ((neg_le_abs _).trans (inner_unit_bound he)) + +lemma negative_projection_change (e p q : ℂ) (he : ‖e‖ = 1) : + max 0 (-inner ℝ e q) ≤ max 0 (-inner ℝ e p)+‖q-p‖ := by + have h := inner_unit_bound (p := q-p) he + rw [inner_sub_right] at h + apply max_le + · positivity + · have hh := neg_le_abs (inner ℝ e q-inner ℝ e p) + have hm := le_max_right (0 : ℝ) (-inner ℝ e p) + linarith + +lemma cone_pairing {e : ℂ} {κ : ℝ} (a : ConeDensity e κ) + {K : ℂ → ℝ} (hK : AEStronglyMeasurable K) (hK0 : ∀ y, 0 ≤ K y) + (hK1 : ∀ y, K y ≤ 1) : + κ*(∫ y, K y*‖a.density y‖) ≤ inner ℝ e (∫ y, (K y : ℂ)*a.density y) := by + have hKn (y : ℂ) : ‖K y‖ ≤ 1 := by rw [Real.norm_eq_abs, abs_of_nonneg (hK0 y)]; exact hK1 y + have hi : Integrable (fun y => K y*‖a.density y‖) := a.integrable.norm.bdd_mul hK (ae_of_all _ hKn) + have hia : Integrable (fun y => (K y : ℂ)*a.density y) := + a.integrable.bdd_mul (Complex.continuous_ofReal.comp_aestronglyMeasurable hK) + (ae_of_all _ (fun y => by simpa only [Complex.norm_real] using hKn y)) + rw [← integral_const_mul, ← integral_inner hia e] + apply integral_mono_ae (hi.const_mul κ) ((innerSL ℝ e).integrable_comp hia) + filter_upwards [a.cone] with y hy + change κ*(K y*‖a.density y‖) ≤ inner ℝ e ((K y : ℂ)*a.density y) + rw [← Complex.real_smul, inner_smul_right] + nlinarith [mul_le_mul_of_nonneg_left hy (hK0 y)] + +/-- Nonpositive total projection bounds the weighted good mass by the error. -/ +lemma cone_mass_of_nonpositive {e : ℂ} {κ : ℝ} (a : ConeDensity e κ) + (he : ‖e‖ = 1) (hκ : 0 < κ) {K : ℂ → ℝ} (hK : AEStronglyMeasurable K) + (hK0 : ∀ y, 0 ≤ K y) (hK1 : ∀ y, K y ≤ 1) {p : ℂ} + (hp : inner ℝ e ((∫ y, (K y : ℂ)*a.density y)+p) ≤ 0) : + (∫ y, K y*‖a.density y‖) ≤ ‖p‖/κ := by + apply (le_div_iff₀ hκ).mpr + have hh := cone_pairing a hK hK0 hK1 + have hb := inner_unit_bound (p := p) he + rw [inner_add_right] at hp + have hn := neg_le_abs (inner ℝ e p) + nlinarith + +/-- Crossing the zero projection selects a genuine convex kernel, not an +arbitrary discontinuous truncation. -/ +lemma crossing_interpolation (e p q : ℂ) (hq : inner ℝ e q < 0) : + ∃ θ : ℝ, 0 ≤ θ ∧ θ ≤ 1 ∧ + inner ℝ e (θ • p+(1-θ) • q) ≤ 0 ∧ + max 0 (-inner ℝ e (θ • p+(1-θ) • q)) = max 0 (-inner ℝ e p) := by + by_cases hp : inner ℝ e p ≤ 0 + · refine ⟨1,zero_le_one,le_rfl,?_,?_⟩ + · simpa using hp + · simp + · obtain ⟨θ,hθ0,hθ1,hzero⟩ := convex_zero (le_of_not_ge hp) hq.le + refine ⟨θ,hθ0,hθ1,?_,?_⟩ + · simp only [inner_add_right, inner_smul_right, hzero, le_refl] + · rw [inner_add_right, inner_smul_right, inner_smul_right, hzero, + neg_zero, max_self, max_eq_left (by linarith : -inner ℝ e p ≤ 0)] + +/-- The cap cost of the good density is weighted interior mass, not its +possibly enormous total mass. -/ +lemma cone_corrected_cap {a : ℂ → ℂ} (ha : Integrable a) + {K L : ℂ → ℝ} (hK : AEStronglyMeasurable K) (hL : AEStronglyMeasurable L) + (hK0 : ∀ y, 0 ≤ K y) (hK1 : ∀ y, K y ≤ 1) + (hL0 : ∀ y, 0 ≤ L y) (hL1 : ∀ y, L y ≤ 1) + {D : Set ℂ} (hD : MeasurableSet D) (hsupp : ∀ y, L y-K y ≠ 0 → y ∈ D) + (x z : ℂ) {ρ : ℝ} (hρ : 0 ≤ ρ) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) + (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) : + ‖∫ y, correction x z y*((L y : ℂ)-K y)*a y‖ ≤ + 2*ρ*(∫ y, (L y+K y)*‖a y‖)+7*(∫ y in D \ Metric.ball z ρ, ‖a y‖) := by + have hi : Integrable (fun y => (L y+K y)*‖a y‖) := + ha.norm.bdd_mul (c := 2) (hL.add hK) (ae_of_all _ (fun y => by + rw [Real.norm_eq_abs, abs_of_nonneg (add_nonneg (hL0 y) (hK0 y))] + linarith [hK1 y,hL1 y])) + let B := D \ Metric.ball z ρ + have hB : MeasurableSet B := hD.diff measurableSet_ball + have hbi : Integrable (B.indicator (fun y => ‖a y‖)) := ha.norm.indicator hB + have hmaj : ‖∫ y, correction x z y*((L y : ℂ)-K y)*a y‖ ≤ + ∫ y, 2*ρ*((L y+K y)*‖a y‖)+7*B.indicator (fun y => ‖a y‖) y := by + apply norm_integral_le_of_norm_le ((hi.const_mul _).add (hbi.const_mul _)) + filter_upwards with y + change ‖correction x z y*((L y : ℂ)-K y)*a y‖ ≤ 2*ρ*((L y+K y)*‖a y‖)+7*B.indicator (fun y => ‖a y‖) y + have hk := hK0 y + have hl := hL0 y + have hb : 0 ≤ B.indicator (fun y => ‖a y‖) y := Set.indicator_nonneg (fun _ _ => norm_nonneg _) y + have hf : ‖((L y : ℂ)-K y)‖ = |L y-K y| := by + rw [← Complex.ofReal_sub, Complex.norm_real, Real.norm_eq_abs] + have hsum : |L y-K y| ≤ L y+K y := abs_le.mpr ⟨by linarith [hL0 y], by linarith [hK0 y]⟩ + have hone : |L y-K y| ≤ 1 := abs_le.mpr ⟨by linarith [hL0 y,hK1 y],by linarith [hL1 y,hK0 y]⟩ + by_cases hzero : L y-K y = 0 + · have hc : (L y : ℂ)-K y = 0 := by exact_mod_cast hzero + rw [hc, mul_zero, zero_mul, norm_zero] + positivity + · have hyD := hsupp y hzero + by_cases hyB : y ∈ Metric.ball z ρ + · have hc := correction_cap_bound hz (show ‖y-z‖ ≤ ρ from by simpa only [dist_eq_norm] using (Metric.mem_ball.mp hyB).le) + rw [indicator_of_notMem (show y ∉ B from fun h => h.2 hyB), mul_zero, add_zero, + norm_mul, norm_mul, hf] + have hh := mul_le_mul hc hsum (abs_nonneg _) (by positivity : 0 ≤ 2*ρ) + nlinarith [mul_le_mul_of_nonneg_right hh (norm_nonneg (a y))] + · rw [indicator_of_mem (show y ∈ B from ⟨hyD,hyB⟩),norm_mul,norm_mul,hf] + have hc := mul_le_mul (correction_bounded hz (hD3 y hyD)) hone (abs_nonneg _) (by norm_num : (0 : ℝ) ≤ 7) + have hh := mul_le_mul_of_nonneg_right hc (norm_nonneg (a y)) + have hn : 0 ≤ 2*ρ*((L y+K y)*‖a y‖) := by positivity + nlinarith + rw [integral_add (hi.const_mul _) (hbi.const_mul _), integral_const_mul, + integral_const_mul, integral_indicator hB] at hmaj + exact hmaj + +end LocalCancellation + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +/-- The error contribution to the corrected first active step; no moment +cancellation for the errors alone is presumed. -/ +lemma corrected_error_bound {Cs α δ ρ : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hα : α ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) (hρ : 0 ≤ ρ) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) (x z : ℂ) + (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) : + ‖∑ d, ∫ y, correction x z y*F y*(b d).density y‖ ≤ + 2*ρ*coarseMass b δ univ+7*coarseMass b δ (D \ Metric.ball z ρ)+ + ((L : ℝ)+2*(3*(L : ℝ)+1))*Cs*δ^(2*(1-α))*errorPrice b α := by + classical + have hnorm : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ (3 : ℝ) := fun y hy => hD3 y (hFD y hy) + have hH : ‖(star (z-x))⁻¹‖ ≤ (2 : ℝ) := by + rw [norm_inv, norm_star] + have hn : 0 < ‖z-x‖ := by linarith + rw [inv_eq_one_div, div_le_iff₀ hn] + linarith + have hcorr : LipschitzWith (L+2*(3*L+1)) (fun y => correction x z y*F y) := + corrected_lipschitz (M := 1) (R := 3) (H := 2) hF hFb x z hnorm hH + have hsplit : (∑ d, ∫ y, correction x z y*F y*(b d).density y) = + (∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), ∫ y, correction x z y*F y*(b d).density y)+ + (∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), ∫ y, correction x z y*F y*(b d).density y) := by + simpa only [not_le] using (Finset.sum_filter_add_sum_filter_not Finset.univ + (fun d => δ^2 ≤ (b d).size) (fun d => ∫ y, correction x z y*F y*(b d).density y)).symm + rw [hsplit] + apply (norm_add_le _ _).trans + apply add_le_add + · calc + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), + ‖∫ y, correction x z y*F y*(b d).density y‖ := norm_sum_le _ _ + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), + (2*ρ*(∫ y, ‖(b d).density y‖)+7*(∫ y in D \ Metric.ball z ρ, ‖(b d).density y‖)) := + Finset.sum_le_sum (fun d _ => corrected_pairing_cap (b d).integrable hD hFb hFD x z hρ hz hD3) + _ = _ := by + rw [Finset.sum_add_distrib, ← Finset.mul_sum, ← Finset.mul_sum] + simp only [coarseMass, Measure.restrict_univ] + · exact fine_pairing_bound b hCs hα hδ hδ1 hcorr + +end LocalCancellation + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +lemma increment_bound_general {Cs α δ M : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hα : α ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ M) (hFD : ∀ y, F y ≠ 0 → y ∈ D) : + ‖∑ d, ∫ y, F y*(b d).density y‖ ≤ + M*coarseMass b δ D+(L : ℝ)*Cs*δ^(2*(1-α))*errorPrice b α := by + classical + have he : (∑ d, ∫ y, F y*(b d).density y) = + (∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), ∫ y, F y*(b d).density y)+ + (∑ d ∈ Finset.univ.filter (fun d => (b d).size < δ^2), ∫ y, F y*(b d).density y) := by + simpa only [not_le] using (Finset.sum_filter_add_sum_filter_not Finset.univ + (fun d => δ^2 ≤ (b d).size) (fun d => ∫ y, F y*(b d).density y)).symm + rw [he] + apply (norm_add_le _ _).trans + apply add_le_add + · calc + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), ‖∫ y, F y*(b d).density y‖ := norm_sum_le _ _ + _ ≤ ∑ d ∈ Finset.univ.filter (fun d => δ^2 ≤ (b d).size), M*(∫ y in D, ‖(b d).density y‖) := by + apply Finset.sum_le_sum + intro d _ + have hh := pairing_majorant (b d).integrable hD 0 M (fun y => by + by_cases hy : y ∈ D + · simpa only [indicator_of_mem hy, mul_one, zero_add] using hFb y + · have hf : F y = 0 := by by_contra h; exact hy (hFD y h) + simp only [hf,norm_zero,indicator_of_notMem hy,mul_zero,add_zero,le_refl]) + simpa only [zero_mul,zero_add] using hh + _ = _ := by rw [← Finset.mul_sum]; rfl + · exact fine_pairing_bound b hCs hα hδ hδ1 hF + +lemma correction_kernel_bound {F : ℂ → ℂ} (hFb : ∀ y, ‖F y‖ ≤ 1) + (x z : ℂ) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ 3) : + ∀ y, ‖correction x z y*F y‖ ≤ 7 := by + intro y + by_cases hy : F y = 0 + · simp only [hy,mul_zero,norm_zero]; norm_num + · rw [norm_mul] + simpa only [mul_one] using mul_le_mul (correction_bounded hz (hD3 y hy)) (hFb y) (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 7) + +lemma corrected_inactive_bound {Cs α δ : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hα : α ≤ 1) (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) (x z : ℂ) + (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) : + ‖∑ d, ∫ y, correction x z y*F y*(b d).density y‖ ≤ + 7*coarseMass b δ D+((L : ℝ)+2*(3*(L : ℝ)+1))*Cs*δ^(2*(1-α))*errorPrice b α := by + have hnorm : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ (3 : ℝ) := fun y hy => hD3 y (hFD y hy) + have hH : ‖(star (z-x))⁻¹‖ ≤ (2 : ℝ) := by + rw [norm_inv, norm_star] + have hn : 0 < ‖z-x‖ := by linarith + rw [inv_eq_one_div, div_le_iff₀ hn] + linarith + have hcorr : LipschitzWith (L+2*(3*L+1)) (fun y => correction x z y*F y) := + corrected_lipschitz (M := 1) (R := 3) (H := 2) hF hFb x z hnorm hH + exact increment_bound_general b hCs hα hδ hδ1 hcorr hD (correction_kernel_bound hFb x z hz hnorm) + (fun y hy => hFD y (fun h => hy (by rw [h,mul_zero]))) + +end LocalCancellation + +/-- A finite last-active-index induction. Its hypotheses are local gaps, not +an assumed global estimate, and no infinite list of active indices is chosen. -/ +lemma last_active_bound (active : ℕ → Prop) (N a : ℕ → ℝ) (B : ℝ) + (ha : ∀ i, 0 ≤ a i) + (hfirst : ∀ n, (∀ i < n, ¬active i) → N n ≤ B+∑ i ∈ Finset.range n, a i) + (hgap : ∀ j n, j < n → active j → (∀ i, j < i → i < n → ¬active i) → + N n ≤ N j+a j) : ∀ n, N n ≤ B+∑ i ∈ Finset.range n, a i := by + classical + intro n + induction n using Nat.strong_induction_on with + | h n ih => + let S := (Finset.range n).filter active + by_cases hS : S.Nonempty + · let j := S.max' hS + have hjmem : j ∈ S := Finset.max'_mem S hS + have hjn : j < n := Finset.mem_range.mp (Finset.mem_filter.mp hjmem).1 + have hjact : active j := (Finset.mem_filter.mp hjmem).2 + have hng : ∀ i, j < i → i < n → ¬active i := by + intro i hji hin hi + have his : i ∈ S := Finset.mem_filter.mpr ⟨Finset.mem_range.mpr hin,hi⟩ + exact (not_lt_of_ge (Finset.le_max' S i his)) hji + have hh := hgap j n hjn hjact hng + have hb := ih j hjn + have hs : (∑ i ∈ Finset.range (j+1), a i) ≤ ∑ i ∈ Finset.range n, a i := + Finset.sum_le_sum_of_subset_of_nonneg (Finset.range_mono (Nat.succ_le_of_lt hjn)) (fun i _ _ => ha i) + rw [Finset.sum_range_succ] at hs + linarith + · apply hfirst n + intro i hi hai + exact hS ⟨i,Finset.mem_filter.mpr ⟨Finset.mem_range.mpr hi,hai⟩⟩ + +lemma last_active_limit (active : ℕ → Prop) (N a : ℕ → ℝ) (B Z : ℝ) + (ha : ∀ i, 0 ≤ a i) (hsm : Summable a) (hN : Tendsto N atTop (𝓝 Z)) + (hfirst : ∀ n, (∀ i < n, ¬active i) → N n ≤ B+∑ i ∈ Finset.range n, a i) + (hgap : ∀ j n, j < n → active j → (∀ i, j < i → i < n → ¬active i) → + N n ≤ N j+a j) : Z ≤ B+∑' i, a i := by + apply le_of_tendsto hN + filter_upwards with n + exact (last_active_bound active N a B ha hfirst hgap n).trans + (add_le_add le_rfl (hsm.sum_le_tsum (Finset.range n) (fun i _ => ha i))) + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales + +lemma real_weight_integrable {a : ℂ → ℂ} (ha : Integrable a) {K : ℂ → ℝ} + (hK : AEStronglyMeasurable K) (hK0 : ∀ y, 0 ≤ K y) (hK1 : ∀ y, K y ≤ 1) : + Integrable (fun y => (K y : ℂ)*a y) := + integrable_bounded_pairing ha (Complex.continuous_ofReal.comp_aestronglyMeasurable hK) + (fun y => by rw [Complex.norm_real,Real.norm_eq_abs,abs_of_nonneg (hK0 y)]; exact hK1 y) + +lemma real_weight_norm_integrable {a : ℂ → ℂ} (ha : Integrable a) {K : ℂ → ℝ} + (hK : AEStronglyMeasurable K) (hK0 : ∀ y, 0 ≤ K y) (hK1 : ∀ y, K y ≤ 1) : + Integrable (fun y => K y*‖a y‖) := + ha.norm.bdd_mul hK (ae_of_all _ fun y => by + rw [Real.norm_eq_abs,abs_of_nonneg (hK0 y)]; exact hK1 y) + +lemma convex_pairing {a : ℂ → ℂ} {K L : ℂ → ℝ} + (hiK : Integrable (fun y => (K y : ℂ)*a y)) + (hiL : Integrable (fun y => (L y : ℂ)*a y)) (θ : ℝ) : + (∫ y, ((θ*K y+(1-θ)*L y : ℝ) : ℂ)*a y) = + θ • (∫ y, (K y : ℂ)*a y)+(1-θ) • (∫ y, (L y : ℂ)*a y) := by + have he : (fun y => ((θ*K y+(1-θ)*L y : ℝ) : ℂ)*a y) = + (fun y => θ • ((K y : ℂ)*a y)+(1-θ) • ((L y : ℂ)*a y)) := by + ext y + simp only [Complex.ofReal_add,Complex.ofReal_mul,Complex.real_smul] + ring + rw [he] + calc + _ = (∫ y, θ • ((K y : ℂ)*a y))+(∫ y, (1-θ) • ((L y : ℂ)*a y)) := + integral_add (hiK.smul θ) (hiL.smul (1-θ)) + _ = _ := by rw [integral_smul,integral_smul] + +/-- Analytic comparison of two balanced mixtures at a negative later +projection. The only error term is their fixed-correction difference. -/ +lemma negative_gap_cap {e : ℂ} {κ B ρ H : ℝ} (a : ConeDensity e κ) + (he : ‖e‖ = 1) (hκ : 0 < κ) (hρ : 0 ≤ ρ) + {K L : ℂ → ℝ} (hK : AEStronglyMeasurable K) (hL : AEStronglyMeasurable L) + (hK0 : ∀ y, 0 ≤ K y) (hK1 : ∀ y, K y ≤ 1) + (hL0 : ∀ y, 0 ≤ L y) (hL1 : ∀ y, L y ≤ 1) + {D : Set ℂ} (hD : MeasurableSet D) (hsupp : ∀ y, L y-K y ≠ 0 → y ∈ D) + (x z : ℂ) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) + (hcap : (∫ y in D \ Metric.ball z ρ, ‖a.density y‖) ≤ H) + {p q R : ℂ} (hp : ‖p‖ ≤ B) (hq : ‖q‖ ≤ B) + (hneg : inner ℝ e ((∫ y, (L y : ℂ)*a.density y)+q) < 0) + (hcor : ((∫ y, (L y : ℂ)*a.density y)+q)-((∫ y, (K y : ℂ)*a.density y)+p) = + (∫ y, correction x z y*((L y : ℂ)-K y)*a.density y)+R) : + max 0 (-inner ℝ e ((∫ y, (L y : ℂ)*a.density y)+q)) ≤ + max 0 (-inner ℝ e ((∫ y, (K y : ℂ)*a.density y)+p))+ + 4*ρ*(B/κ)+7*H+‖R‖ := by + let P := (∫ y, (K y : ℂ)*a.density y)+p + let Q := (∫ y, (L y : ℂ)*a.density y)+q + obtain ⟨θ,hθ0,hθ1,hθneg,hθeq⟩ := crossing_interpolation e P Q hneg + let J (y : ℂ) := θ*K y+(1-θ)*L y + have hJ0 (y : ℂ) : 0 ≤ J y := add_nonneg (mul_nonneg hθ0 (hK0 y)) (mul_nonneg (sub_nonneg.mpr hθ1) (hL0 y)) + have hJ1 (y : ℂ) : J y ≤ 1 := by + have h1 := mul_le_mul_of_nonneg_left (hK1 y) hθ0 + have h2 := mul_le_mul_of_nonneg_left (hL1 y) (sub_nonneg.mpr hθ1) + dsimp [J] + nlinarith + have hJ : AEStronglyMeasurable J := (hK.const_mul θ).add (hL.const_mul (1-θ)) + have hiK := real_weight_integrable a.integrable hK hK0 hK1 + have hiL := real_weight_integrable a.integrable hL hL0 hL1 + let pstar := θ • p+(1-θ) • q + have hpstar : ‖pstar‖ ≤ B := by + calc + ‖pstar‖ ≤ ‖θ • p‖+‖(1-θ) • q‖ := norm_add_le _ _ + _ = θ*‖p‖+(1-θ)*‖q‖ := by + rw [norm_smul,norm_smul,Real.norm_eq_abs,Real.norm_eq_abs, + abs_of_nonneg hθ0,abs_of_nonneg (sub_nonneg.mpr hθ1)] + _ ≤ θ*B+(1-θ)*B := add_le_add (mul_le_mul_of_nonneg_left hp hθ0) + (mul_le_mul_of_nonneg_left hq (sub_nonneg.mpr hθ1)) + _ = B := by ring + have hstar : (∫ y, (J y : ℂ)*a.density y)+pstar = θ • P+(1-θ) • Q := by + rw [show (∫ y, (J y : ℂ)*a.density y) = _ from convex_pairing hiK hiL θ] + dsimp [P,Q,pstar] + ring + have hsmass := cone_mass_of_nonpositive a he hκ hJ hJ0 hJ1 + (show inner ℝ e ((∫ y, (J y : ℂ)*a.density y)+pstar) ≤ 0 by rw [hstar]; exact hθneg) + have hlmass := cone_mass_of_nonpositive a he hκ hL hL0 hL1 hneg.le + have hweighted : (∫ y, (L y+J y)*‖a.density y‖) ≤ 2*(B/κ) := by + have hiLn := real_weight_norm_integrable a.integrable hL hL0 hL1 + have hiJn := real_weight_norm_integrable a.integrable hJ hJ0 hJ1 + simp_rw [add_mul] + rw [integral_add hiLn hiJn] + have hs := hsmass.trans (div_le_div_of_nonneg_right hpstar hκ.le) + have hl := hlmass.trans (div_le_div_of_nonneg_right hq hκ.le) + linarith + have hJdiff (y : ℂ) : L y-J y = θ*(L y-K y) := by dsimp [J]; ring + have hJDs : ∀ y, L y-J y ≠ 0 → y ∈ D := by + intro y hy + apply hsupp y + intro h + exact hy (by rw [hJdiff,h,mul_zero]) + let G := ∫ y, correction x z y*((L y : ℂ)-J y)*a.density y + have hG : ‖G‖ ≤ 4*ρ*(B/κ)+7*H := by + have hh := cone_corrected_cap a.integrable hJ hL hJ0 hJ1 hL0 hL1 hD hJDs x z hρ hz hD3 + change ‖G‖ ≤ _ at hh + have hg := mul_le_mul_of_nonneg_left hweighted (by positivity : 0 ≤ 2*ρ) + have hc := mul_le_mul_of_nonneg_left hcap (by norm_num : (0 : ℝ) ≤ 7) + nlinarith + have hGid : G = θ • (∫ y, correction x z y*((L y : ℂ)-K y)*a.density y) := by + rw [← integral_smul] + apply integral_congr_ae + filter_upwards with y + change correction x z y*((L y : ℂ)-(θ*K y+(1-θ)*L y : ℝ))*a.density y = + θ • (correction x z y*((L y : ℂ)-K y)*a.density y) + simp only [Complex.ofReal_add,Complex.ofReal_mul,Complex.ofReal_sub,Complex.ofReal_one,Complex.real_smul] + ring + have hdiff : Q-(θ • P+(1-θ) • Q) = G+θ • R := by + have hh : Q-P = (∫ y, correction x z y*((L y : ℂ)-K y)*a.density y)+R := hcor + rw [hGid, ← smul_add, ← hh] + simp only [sub_smul,one_smul,smul_sub] + abel + have hR : ‖θ • R‖ ≤ ‖R‖ := by + rw [norm_smul,Real.norm_eq_abs,abs_of_nonneg hθ0] + exact mul_le_of_le_one_left (norm_nonneg _) hθ1 + have hn := negative_projection_change e (θ • P+(1-θ) • Q) Q he + rw [hθeq,hdiff] at hn + have hh := (norm_add_le G (θ • R)).trans (add_le_add hG hR) + change max 0 (-inner ℝ e Q) ≤ max 0 (-inner ℝ e P)+4*ρ*(B/κ)+7*H+‖R‖ + linarith + +end LocalCancellation + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales + +lemma cone_negative_le_error {e : ℂ} {κ : ℝ} (a : ConeDensity e κ) + (he : ‖e‖ = 1) (hκ : 0 ≤ κ) {K : ℂ → ℝ} + (hK : AEStronglyMeasurable K) (hK0 : ∀ y, 0 ≤ K y) (hK1 : ∀ y, K y ≤ 1) (p : ℂ) : + max 0 (-inner ℝ e ((∫ y, (K y : ℂ)*a.density y)+p)) ≤ ‖p‖ := by + have hh := cone_pairing a hK hK0 hK1 + have hi : 0 ≤ ∫ y, K y*‖a.density y‖ := integral_nonneg (fun y => mul_nonneg (hK0 y) (norm_nonneg _)) + have hproj : 0 ≤ inner ℝ e (∫ y, (K y : ℂ)*a.density y) := (mul_nonneg hκ hi).trans hh + rw [inner_add_right] + exact max_le (norm_nonneg _) (by linarith [(abs_le.mp (inner_unit_bound (p := p) he)).1]) + +lemma general_moment_integrable {a : ℂ → ℂ} (ha : Integrable a) + {r δ : ℝ} {M : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) (x : ℂ) (hr : r+δ ≤ 3) : + Integrable (fun y => star (y-x)*(kernel k x y : ℂ)*a y) := by + apply integrable_bounded_pairing ha + ((by fun_prop : Continuous (fun y : ℂ => star (y-x))).mul + (complex_kernel_lipschitz k x).continuous).aestronglyMeasurable + apply position_bound (complex_kernel_bound k x) x (by norm_num : (0 : ℝ) ≤ 3) + intro y hy + have hyb : y ∈ Metric.ball x (r+δ) := by + by_contra hh + exact hy (by rw [kernel_zero k x hh, Complex.ofReal_zero]) + exact (show ‖y-x‖ < r+δ by simpa only [Metric.mem_ball, dist_eq_norm] using hyb).le.trans hr + +lemma correcting_pairing {a F : ℂ → ℂ} (ha : Integrable a) + (hF : AEStronglyMeasurable F) (hFb : ∀ y, ‖F y‖ ≤ 1) (x z : ℂ) + (hsupp : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ 3) : + (∫ y, correction x z y*F y*a y) = (∫ y, F y*a y) - + (star (z-x))⁻¹*(∫ y, star (y-x)*F y*a y) := by + have hi := integrable_bounded_pairing ha hF hFb + have him : Integrable (fun y => star (y-x)*F y*a y) := + integrable_bounded_pairing ha + ((by fun_prop : Continuous (fun y : ℂ => star (y-x))).aestronglyMeasurable.mul hF) + (position_bound hFb x (by norm_num : (0 : ℝ) ≤ 3) hsupp) + have he : (fun y => correction x z y*F y*a y) = + fun y => F y*a y-(star (z-x))⁻¹*(star (y-x)*F y*a y) := by + ext y + simp only [correction,div_eq_mul_inv] + ring + rw [he,integral_sub hi (him.const_mul _),integral_const_mul] + +lemma general_kernel_pairing_sub {a : ℂ → ℂ} (ha : Integrable a) + {u v u' v' : ℝ} {M N : ℝ≥0} (k : RadiusDensity u v M) (l : RadiusDensity u' v' N) (x : ℂ) : + (∫ y, (kernel l x y : ℂ)*a y)-(∫ y, (kernel k x y : ℂ)*a y) = + ∫ y, ((kernel l x y : ℂ)-kernel k x y)*a y := by + rw [← integral_sub + (integrable_bounded_pairing ha (complex_kernel_lipschitz l x).continuous.aestronglyMeasurable (complex_kernel_bound l x)) + (integrable_bounded_pairing ha (complex_kernel_lipschitz k x).continuous.aestronglyMeasurable (complex_kernel_bound k x))] + congr 1 + ext y + ring + +lemma corrected_kernel_integrable {a : ℂ → ℂ} (ha : Integrable a) + {r δ : ℝ} {M : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) (x z : ℂ) + (hr : r+δ ≤ 3) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) : + Integrable (fun y => correction x z y*(kernel k x y : ℂ)*a y) := by + apply integrable_bounded_pairing ha + ((by unfold correction; fun_prop : Continuous (correction x z)).mul (complex_kernel_lipschitz k x).continuous).aestronglyMeasurable + apply correction_kernel_bound (complex_kernel_bound k x) x z hz + intro y hy + have hyb : y ∈ Metric.ball x (r+δ) := by + by_contra hh + exact hy (by rw [kernel_zero k x hh,Complex.ofReal_zero]) + exact (show ‖y-x‖ < r+δ by simpa only [Metric.mem_ball,dist_eq_norm] using hyb).le.trans hr + +lemma corrected_kernel_pairing_sub {a : ℂ → ℂ} (ha : Integrable a) + {r δ ε : ℝ} {M N : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) + (l : RadiusDensity (r-ε) (r+ε) N) (x z : ℂ) + (hrδ : r+δ ≤ 3) (hrε : r+ε ≤ 3) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) : + (∫ y, correction x z y*(kernel l x y : ℂ)*a y)- + (∫ y, correction x z y*(kernel k x y : ℂ)*a y) = + ∫ y, correction x z y*((kernel l x y : ℂ)-kernel k x y)*a y := by + rw [← integral_sub (corrected_kernel_integrable ha l x z hrε hz) + (corrected_kernel_integrable ha k x z hrδ hz)] + congr 1 + ext y + ring + +lemma interior_mass_le_kernel {a : ℂ → ℂ} (ha : Integrable a) + {r δ ε : ℝ} {M : ℝ≥0} (k : RadiusDensity (r-ε) (r+ε) M) (x : ℂ) (hεδ : ε ≤ δ) : + (∫ y in Metric.ball x (r-δ), ‖a y‖) ≤ ∫ y, kernel k x y*‖a y‖ := by + rw [← integral_indicator measurableSet_ball] + apply integral_mono_ae (ha.norm.indicator measurableSet_ball) + (ha.norm.bdd_mul (kernel_lipschitz k x).continuous.aestronglyMeasurable + (ae_of_all _ (fun y => by rw [Real.norm_eq_abs,abs_of_nonneg (kernel_nonneg k x y)]; exact kernel_le_one k x y))) + filter_upwards with y + by_cases hy : y ∈ Metric.ball x (r-δ) + · have hk : kernel k x y = 1 := kernel_one k x (by + simp only [Metric.mem_ball] at hy ⊢ + linarith) + simp only [indicator_of_mem hy,hk,one_mul,le_refl] + · simp only [indicator_of_notMem hy] + exact mul_nonneg (kernel_nonneg k x y) (norm_nonneg _) + +end LocalCancellation + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Localization.lean b/lean/OAI/Analysis/DiskMaximal/Localization.lean new file mode 100644 index 0000000000000000000000000000000000000000..e9bd7bc09121cd58184ef47c2707e1d0eec5cb62 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Localization.lean @@ -0,0 +1,496 @@ +import OAI.Analysis.DiskMaximal.WeakLimits + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace NullLocalization +open PlanePotential DiskMoments + +def unitRegion : Set ℂ := {x | ‖x‖ ≤ 8} +lemma unitRegion_compact : IsCompact unitRegion := by + simpa only [unitRegion,Metric.closedBall,dist_zero_right] using isCompact_closedBall (0:ℂ) 8 +lemma unitRegion_measurable : MeasurableSet unitRegion := unitRegion_compact.measurableSet +lemma unitRegion_finite : volume unitRegion < ⊤ := unitRegion_compact.measure_lt_top + +/-- A fixed-radius Poincare inequality derived from the proved Green kernel, +not added as a Sobolev axiom. The subsequent cutoff is one on the radius-four disk. -/ +lemma unit_poincare : ∃ P : ℝ, 0 ≤ P ∧ ∀ {g : ℂ → ℝ}, + ContDiff ℝ 1 g → HasCompactSupport g → ∃ c : ℝ, + (∫ x in unitRegion, ‖g x-c‖) ≤ P*(∫ x in unitRegion, ‖gradient g x‖) := by + obtain ⟨ψ,B,L,hB,hL,hψ,hψc,hψ1,hψs,hψB,hψL⟩ := exists_kernel_cutoff + let A : ℝ≥0∞ := ENNReal.ofReal ((2*B*(1+8)^2)^(3/2:ℝ)*(4*Real.pi*(32:ℝ)^(1/2:ℝ))) + let Z : ℝ≥0∞ := A^(2/3:ℝ)*(volume unitRegion)^(1/3:ℝ) + have hZ : Z ≠ ⊤ := ENNReal.mul_ne_top + (ENNReal.rpow_ne_top_of_nonneg (by norm_num) ENNReal.ofReal_ne_top) + (ENNReal.rpow_ne_top_of_nonneg (by norm_num) unitRegion_finite.ne) + refine ⟨Z.toReal,ENNReal.toReal_nonneg,?_⟩ + intro g hg hc + let c := ∫ z,ψ z*g z + refine ⟨c,?_⟩ + let β := unitRegion.indicator (gradient g) + have hgi : Integrable (gradient g) := (continuous_gradient hg).integrable_of_hasCompactSupport (gradient_hasCompactSupport hc) + have hβ : Integrable β := hgi.indicator unitRegion_measurable + have hβs : ∀ y, β y≠0 → ‖y‖ ≤ 8 := by + intro y hy + by_contra hh + change y∉unitRegion at hh + exact hy (indicator_of_notMem hh _) + have hβv : (∫ y,‖β y‖) = ∫ y in unitRegion,‖gradient g y‖ := by + rw [← integral_indicator unitRegion_measurable] + congr 1 + ext y + exact norm_indicator_eq_indicator_norm _ _ + obtain ⟨D,hD⟩ := hg.lipschitzWith_of_hasCompactSupport hc one_ne_zero + have hp := green_root_lp hψ.continuous.measurable hψs hψB + (by norm_num : (0:ℝ)<1+8) hB (by norm_num : (0:ℝ)<8+8) hβ hβs + have hex : (fun x => ∫ y,inner ℝ (green ψ x y) (β y)) =ᵐ[volume.restrict unitRegion] (fun x => g x-c) := by + filter_upwards [ae_restrict_mem unitRegion_measurable] with x hx + calc + _ = ∫ y,inner ℝ (green ψ x y) (gradient g y) := by + apply integral_congr_ae + exact ae_of_all _ (green_restrict_density hψs (by norm_num : (1:ℝ)≤8) _ hx) + _ = _ := green_gradient_representation hψ.continuous hψc hg + (fun y => norm_fderiv_le_of_lipschitz ℝ hD (x₀ := y)) hψ1 x + have hs : eLpNorm (fun x => g x-c) (3/2) (volume.restrict unitRegion) ≤ + A^(2/3:ℝ)*ENNReal.ofReal (∫ y in unitRegion,‖gradient g y‖) := by + rw [← eLpNorm_congr_ae hex,← hβv] + rw [eLpNorm_eq_eLpNorm' (by norm_num : (3/2:ℝ≥0∞) ≠ 0) + (ENNReal.div_ne_top (by norm_num) (by norm_num)) + (potential_aestronglyMeasurable _ (green_measurable ψ hψ.continuous.measurable) hβ)] + convert eLpNorm_three_halves_bound _ hp using 1 <;> norm_num [A,unitRegion] + have hl := eLpNorm_le_eLpNorm_mul_rpow_measure_univ + (f := fun x => g x-c) (μ := volume.restrict unitRegion) + (show (1:ℝ≥0∞)≤3/2 by rw [ENNReal.le_div_iff_mul_le (by norm_num) (by norm_num)]; norm_num) (hg.continuous.sub continuous_const).aestronglyMeasurable + have he : eLpNorm (fun x => g x-c) 1 (volume.restrict unitRegion) ≤ + Z*ENNReal.ofReal (∫ y in unitRegion,‖gradient g y‖) := by + apply hl.trans + have hexp : 1/(1:ℝ≥0∞).toReal-1/(3/2:ℝ≥0∞).toReal=(1/3:ℝ) := by norm_num + rw [hexp,Measure.restrict_apply_univ] + have hh := mul_le_mul_right hs ((volume unitRegion)^(1/3:ℝ)) + simpa only [Z,mul_assoc,mul_left_comm,mul_comm] using hh + have hin : IntegrableOn (fun x => g x-c) unitRegion := + (hg.continuous.sub continuous_const).continuousOn.integrableOn_compact unitRegion_compact + rw [eLpNorm_one_eq_lintegral_enorm hin.aestronglyMeasurable, + ← ofReal_integral_norm_eq_lintegral_enorm hin] at he + have ht := ENNReal.toReal_mono (ENNReal.mul_ne_top hZ ENNReal.ofReal_ne_top) he + simpa only [ENNReal.toReal_mul,ENNReal.toReal_ofReal (integral_nonneg (fun x => norm_nonneg _))] using ht +end NullLocalization + +namespace NullLocalization +open DiskMoments WeakSobolev + +def unitCutoff : ContDiffBump (0:ℂ) := ⟨4,8,by norm_num,by norm_num⟩ + +lemma unit_localization : ∃ D : ℝ, 0≤D ∧ ∀ {g : ℂ → ℝ}, ContDiff ℝ 1 g → + HasCompactSupport g → ∃ (h : ℂ → ℝ) (c : ℝ), ContDiff ℝ 1 h ∧ HasCompactSupport h ∧ + (∀ x, ‖x‖≤4 → h x=g x-c) ∧ + (∫ x,‖gradient h x‖) ≤ D*(∫ x in unitRegion,‖gradient g x‖) := by + obtain ⟨P,hP,hpoi⟩ := unit_poincare + obtain ⟨L,hL⟩ := (unitCutoff.contDiff (n := (1:ℕ∞))).lipschitzWith_of_hasCompactSupport unitCutoff.hasCompactSupport one_ne_zero + refine ⟨1+L*P,by positivity,?_⟩ + intro g hg hc + obtain ⟨c,hc'⟩ := hpoi hg hc + let h := fun x => unitCutoff x*(g x-c) + have hd : ContDiff ℝ 1 h := unitCutoff.contDiff.mul (hg.sub contDiff_const) + have hs : HasCompactSupport h := unitCutoff.hasCompactSupport.mul_right + refine ⟨h,c,hd,hs,?_,?_⟩ + · intro x hx + have he : unitCutoff x=1 := unitCutoff.one_of_mem_closedBall (by simpa only [Metric.mem_closedBall,dist_zero_right,unitCutoff] using hx) + simp only [h,he,one_mul] + · have hi : Integrable (gradient h) := (continuous_gradient hd).integrable_of_hasCompactSupport (gradient_hasCompactSupport hs) + have his : Function.support (fun x => ‖gradient h x‖) ⊆ unitRegion := by + intro x hx + have ht : x∈tsupport h := support_fderiv_subset ℝ (by + intro he + apply hx + change ‖gradient h x‖=0 + rw [norm_gradient_fderiv,he,norm_zero]) + have hh : tsupport h ⊆ tsupport (unitCutoff : ℂ → ℝ) := tsupport_mul_subset_left + have hx' := hh ht + rw [unitCutoff.tsupport_eq] at hx' + change ‖x‖≤8 + simpa only [Metric.mem_closedBall,dist_zero_right,unitCutoff] using hx' + rw [← setIntegral_eq_integral_of_forall_compl_eq_zero (fun x hx => Function.notMem_support.mp (fun hh => hx (his hh)))] + have hig : IntegrableOn (fun x => ‖gradient g x‖) unitRegion := + ((continuous_gradient hg).norm).continuousOn.integrableOn_compact unitRegion_compact + have hid : IntegrableOn (fun x => ‖g x-c‖) unitRegion := + (hg.continuous.sub continuous_const).norm.continuousOn.integrableOn_compact unitRegion_compact + have hb (x : ℂ) : ‖gradient h x‖ ≤ ‖gradient g x‖+L*‖g x-c‖ := by + rw [norm_gradient_fderiv] + have he := fderiv_mul ((unitCutoff.contDiff (n := (1:ℕ∞))).differentiable one_ne_zero x) + ((hg.differentiable one_ne_zero x).sub_const c) + change fderiv ℝ h x = _ at he + rw [he] + have hχ : ‖unitCutoff x‖≤1 := by rw [Real.norm_of_nonneg unitCutoff.nonneg]; exact unitCutoff.le_one + have hχd := norm_fderiv_le_of_lipschitz ℝ hL (x₀ := x) + calc + _ ≤ ‖unitCutoff x • fderiv ℝ (fun x => g x-c) x‖+‖(g x-c) • fderiv ℝ (unitCutoff : ℂ → ℝ) x‖ := norm_add_le _ _ + _ ≤ 1*‖fderiv ℝ g x‖+‖g x-c‖*L := by + rw [norm_smul,norm_smul,fderiv_sub_const] + exact add_le_add (mul_le_mul_of_nonneg_right hχ (norm_nonneg _)) (mul_le_mul_of_nonneg_left hχd (norm_nonneg _)) + _ = _ := by rw [one_mul,← norm_gradient_fderiv]; ring + have hm := integral_mono hi.norm.integrableOn (hig.add (hid.const_mul (L:ℝ))) hb + simp only [Pi.add_apply] at hm + rw [integral_add hig (hid.const_mul (L:ℝ)),integral_const_mul] at hm + nlinarith [mul_le_mul_of_nonneg_left hc' L.coe_nonneg] +end NullLocalization + +namespace NullLocalization +open DiskMoments PhysicalCells WeakSobolev + +def region (p : ℂ) (t : ℝ) : Set ℂ := {x | ‖x-p‖≤8*t} +lemma region_measurable (p : ℂ) (t : ℝ) : MeasurableSet (region p t) := + measurableSet_le (continuous_norm.comp (continuous_id.sub continuous_const)).measurable measurable_const + +lemma integral_stretch (F : ℂ → ℝ) (p : ℂ) (t : ℝ) : + (∫ x,F (p+t • x)) = (t^2)⁻¹*(∫ x,F x) := by + have h := Measure.integral_comp_smul volume (fun x : ℂ => F (p+x)) t + simpa only [Complex.finrank_real_complex,abs_of_nonneg (inv_nonneg.mpr (sq_nonneg t)),smul_eq_mul, + integral_add_left_eq_self] using h + +lemma norm_toUnit (p x : ℂ) {t : ℝ} (ht : 0 g (p+t • x)) := by + exact hc.comp_homeomorph ((Homeomorph.smulOfNeZero t ht).trans (Homeomorph.addLeft p)) + +lemma comp_toUnit_compact {g : ℂ → ℝ} (hc : HasCompactSupport g) (p : ℂ) {t : ℝ} (ht : t≠0) : + HasCompactSupport (fun x => g (toUnit p t x)) := by + exact hc.comp_homeomorph ((Homeomorph.subRight p).trans (Homeomorph.smulOfNeZero t⁻¹ (inv_ne_zero ht))) + +lemma gradient_toUnit {g : ℂ → ℝ} (hg : Differentiable ℝ g) (p x : ℂ) (t : ℝ) : + gradient (fun y => g (toUnit p t y)) x=t⁻¹ • gradient g (toUnit p t x) := by + have he : (fun y => g (toUnit p t y)) = (fun y => g (-(t⁻¹ • p)+t⁻¹ • y)) := by + ext y; congr 1; simp only [toUnit,smul_sub]; abel + rw [he,AffineDensities.gradient_affine hg] + change t⁻¹ • gradient g (-(t⁻¹ • p)+t⁻¹ • x)=_ + congr 2 + simp only [toUnit,smul_sub]; abel + +lemma integral_gradient_toUnit {g : ℂ → ℝ} (hg : Differentiable ℝ g) (p : ℂ) {t : ℝ} (ht : 0 g (toUnit p t y)) x‖)=t*(∫ x,‖gradient g x‖) := by + simp_rw [gradient_toUnit hg,norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr ht)] + rw [integral_const_mul] + have he : (∫ x, ‖gradient g (toUnit p t x)‖) = t^2*(∫ x,‖gradient g x‖) := by + rw [show (fun x => ‖gradient g (toUnit p t x)‖) = + (fun x => ‖gradient g (-(t⁻¹ • p)+t⁻¹ • x)‖) by ext x; congr 2; simp only [toUnit,smul_sub]; abel] + rw [integral_stretch (fun z => ‖gradient g z‖) (-(t⁻¹ • p)) t⁻¹,inv_pow,inv_inv] + rw [he] + field_simp + +lemma local_integral_gradient_stretch {g : ℂ → ℝ} (hg : Differentiable ℝ g) + (p : ℂ) {t : ℝ} (ht : 0 g (p+t • y)) x‖)= + t⁻¹*(∫ x in region p t,‖gradient g x‖) := by + simp_rw [AffineDensities.gradient_affine hg,AffineDensities.rescale,norm_smul, + Real.norm_eq_abs,abs_of_pos ht] + rw [integral_const_mul,← integral_indicator unitRegion_measurable, + ← integral_indicator (region_measurable p t)] + have he : unitRegion.indicator (fun x => ‖gradient g (p+t • x)‖) = + (fun x => (region p t).indicator (fun z => ‖gradient g z‖) (p+t • x)) := by + ext x + have hx : p+t • x∈region p t ↔ x∈unitRegion := by + change ‖p+t • x-p‖≤8*t ↔ ‖x‖≤8 + rw [add_sub_cancel_left,norm_smul,Real.norm_eq_abs,abs_of_pos ht] + constructor <;> intro hh <;> nlinarith + by_cases h : x∈unitRegion + · rw [Set.indicator_of_mem h,Set.indicator_of_mem (hx.mpr h)] + · rw [Set.indicator_of_notMem h,Set.indicator_of_notMem (fun hh => h (hx.mp hh))] + rw [he,integral_stretch] + field_simp + +lemma physical_localization : ∃ D : ℝ, 0≤D ∧ ∀ {g : ℂ → ℝ}, ContDiff ℝ 1 g → + HasCompactSupport g → ∀ (p : ℂ) {t : ℝ}, 0 g (p+t • x) + have ha : ContDiff ℝ 1 (fun x : ℂ => p+t • x) := contDiff_const.add (contDiff_id.const_smul t) + have hG : ContDiff ℝ 1 G := hg.comp ha + have hmap : ContDiff ℝ 1 (toUnit p t) := (contDiff_id.sub contDiff_const).const_smul t⁻¹ + obtain ⟨h,c,hd,hs,hh,hb⟩ := he hG (comp_stretch_compact hc p ht.ne') + refine ⟨fun x => h (toUnit p t x),c,hd.comp hmap, + comp_toUnit_compact hs p ht.ne',?_,?_⟩ + · intro x hx + have hx' : ‖toUnit p t x‖≤4 := by rw [norm_toUnit p x ht]; exact (div_le_iff₀ ht).mpr hx + simpa only [G,affine_toUnit p ht.ne'] using hh _ hx' + · rw [integral_gradient_toUnit (hd.differentiable one_ne_zero) p ht] + have he' := mul_le_mul_of_nonneg_left hb ht.le + rw [local_integral_gradient_stretch (hg.differentiable one_ne_zero) p ht] at he' + convert he' using 1 + first | rfl | field_simp +end NullLocalization + +namespace NullLocalization +open SobolevBand DiskMoments PhysicalCells DyadicHats RadiusEnvelope + +lemma band_sub_local {g h : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (hh : ContDiff ℝ 1 h) + (hgc : HasCompactSupport g) (hhc : HasCompactSupport h) {a t : ℝ} + (ha : 0 signedAverage g x r) hat x (signedAverage_radius_continuousOn hg x ha) + rw [show band g a t x=signedAverage g x r from he,← hav r hr] + exact average_le_band hi' ha hr x + +lemma gradient_band_local {g h : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (hh : ContDiff ℝ 1 h) + (hgc : HasCompactSupport g) (hhc : HasCompactSupport h) {a t : ℝ} + (ha : 0 band g a t y-c) := by + have hn : ‖x-p‖<3*t := by linarith + filter_upwards [(isOpen_lt (continuous_norm.comp (continuous_id.sub continuous_const)) continuous_const).mem_nhds hn] with y hy + exact band_sub_local hg hh hgc hhc ha hat hlocal hy + apply congrArg (InnerProductSpace.toDual ℝ ℂ).symm + exact he.fderiv_eq.trans (fderiv_sub_const c) + +lemma mem_cell_norm {t : ℝ} (ht : 0 norm_nonneg _)) hbi.norm + _ ≤ C*(∫ x,‖gradient h x‖) := hbound hd hs ha m + _ ≤ C*(D*(∫ x in region p t,‖gradient g x‖)) := mul_le_mul_of_nonneg_left hb hC.le + _ ≤ C*(D+1)*(∫ x in region p t,‖gradient g x‖) := by + have h0 : 0 ≤ (∫ x in region p t, ‖gradient g x‖) := integral_nonneg (fun x => norm_nonneg (gradient g x)) + nlinarith +end NullLocalization + +namespace NullLocalization +open scoped Classical +open PhysicalCells DyadicHats DirectionNeighbors Finset + +lemma region_indices {t : ℝ} (ht : 0 y∈region (point t p) t) ⊆ window 10 (gridIndex t y) := by + intro p hp; exact region_indices ht y (Finset.mem_filter.mp hp).2 + have h := Finset.card_le_card hs + rw [card_window] at h + exact_mod_cast h + +def touches (O : Set ℂ) (t : ℝ) (p : ℤ×ℤ) : Prop := (O∩cell (point t p) t).Nonempty + +def usedRegion (O : Set ℂ) (t : ℝ) (p : ℤ×ℤ) : Set ℂ := by + classical + exact if touches O t p then region (point t p) t else ∅ + +lemma usedRegion_measurable (O : Set ℂ) (t : ℝ) (p : ℤ×ℤ) : MeasurableSet (usedRegion O t p) := by + unfold usedRegion + split_ifs + · exact region_measurable _ _ + · exact MeasurableSet.empty + +lemma usedRegion_subset {O K : Set ℂ} {t : ℝ} (ht : 0 hi p),← integral_indicator hT,← integral_const_mul] + apply integral_mono (integrable_finsetSum S (fun p _ => hi p)) ((hF.indicator hT).const_mul 441) + intro y + dsimp only + by_cases hy : y∈T + · rw [Set.indicator_of_mem hy] + calc + _ ≤ ∑ p∈S,(if y∈region (point t p) t then (1:ℝ) else 0)*F y := by + apply Finset.sum_le_sum + intro p _ + unfold usedRegion + by_cases hp : touches O t p + · simp only [ite_eq_left hp,Set.indicator_apply] + split_ifs <;> simp + · simp only [ite_eq_right hp,Set.indicator_empty] + split_ifs + · simpa using h0 y + · simp + _ = (∑ p∈S,if y∈region (point t p) t then (1:ℝ) else 0)*F y := (Finset.sum_mul _ _ _).symm + _ ≤ 441*F y := mul_le_mul_of_nonneg_right (regions_overlap ht S y) (h0 y) + · rw [Set.indicator_of_notMem hy,mul_zero] + apply le_of_eq + apply Finset.sum_eq_zero + intro p _ + exact Set.indicator_of_notMem (fun hp => hy (usedRegion_subset ht hO p hp)) F +end NullLocalization + +namespace NullLocalization +open SobolevBand DiskMoments PhysicalCells DyadicHats + +lemma smooth_small_local_budget : ∃ C : ℝ, 0 ‖gradient (band g a t) x‖ + let G := fun x => ‖gradient g x‖ + have hF : Integrable F := (smooth_band_integrable_gradient hg hc ha hat).norm + have hG : Integrable G := ((continuous_gradient hg).integrable_of_hasCompactSupport (gradient_hasCompactSupport hc)).norm + have hF0 x : 0≤F x := norm_nonneg _ + have hG0 x : 0≤G x := norm_nonneg _ + have hi : Integrable (O.indicator F) := hF.indicator hO + have hi0 x : 0≤O.indicator F x := Set.indicator_nonneg (fun x _ => hF0 x) x + let B := fun p : ℤ×ℤ => C*(∫ x in usedRegion O t p,G x) + have hB p : 0≤B p := mul_nonneg hC.le (integral_nonneg hG0) + have hcell p : (∫⁻ x in cell (point t p) t, ENNReal.ofReal (O.indicator F x)) ≤ ENNReal.ofReal (B p) := by + rw [← ofReal_integral_eq_lintegral_ofReal hi.integrableOn (ae_of_all _ hi0)] + apply ENNReal.ofReal_le_ofReal + by_cases hp : touches O t p + · change _ ≤ C*(∫ x in usedRegion O t p,G x) + rw [usedRegion,ite_eq_left hp] + apply (integral_mono hi.integrableOn hF.integrableOn (fun x => ?_)).trans (hlocal hg hc ha m (point t p)) + exact Set.indicator_le_self' (fun x _ => hF0 x) x + · have he : ∀ x∈cell (point t p) t, O.indicator F x=0 := by + intro x hx + apply Set.indicator_of_notMem + intro hxO + exact hp ⟨x,hxO,hx⟩ + rw [setIntegral_eq_zero_of_forall_eq_zero he] + exact hB p + have hbudget (S : Finset (ℤ×ℤ)) : (∑ p∈S,B p) ≤ C*441*(∫ x in Metric.thickening (12*t) K,G x) := by + simp only [B,← Finset.mul_sum] + exact (mul_le_mul_of_nonneg_left (usedRegion_budget ht hOK hG hG0 S) hC.le).trans_eq (by ring) + have hb := integral_cell_budget ht (fun x => ENNReal.ofReal (O.indicator F x)) B hB _ hcell hbudget + rw [← ofReal_integral_eq_lintegral_ofReal hi (ae_of_all _ hi0),integral_indicator hO] at hb + exact (ENNReal.ofReal_le_ofReal_iff (by positivity)).mp hb + +end NullLocalization + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Main.lean b/lean/OAI/Analysis/DiskMaximal/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..f4d88e76418655d765acc511326e95b2ae1050c8 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Main.lean @@ -0,0 +1,173 @@ +import OAI.Analysis.DiskMaximal.AbsoluteContinuity + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace CenteredDiskEndpoint +open WeakSobolev + +lemma hasGradient_iff_hasWeakGradient {f : Plane → ℝ} {g : Plane → Plane} + (hf : LocallyIntegrable f) (hg : Integrable g) : + HasGradient (μ := volume) f g ↔ HasWeakGradient f g := by + constructor + · intro hw φ hφ hc i + simpa only [testPartial,EuclideanSpace.inner_single_right,RCLike.conj_to_real,one_mul] + using hw φ hφ hc (EuclideanSpace.single i 1) + · intro hw φ hφ hc v + have hv : v=∑ i : Fin 2,v i • EuclideanSpace.single i 1 := by + simpa only [EuclideanSpace.basisFun_repr,EuclideanSpace.basisFun_apply] using + ((EuclideanSpace.basisFun (Fin 2) ℝ).sum_repr v).symm + have hleft i : Integrable (fun x => f x*testPartial φ i x) := + hf.integrable_smul_right_of_hasCompactSupport + ((hφ.continuous_fderiv (by simp)).clm_apply continuous_const) (hc.fderiv_apply ℝ _) + have hright i : Integrable (fun x => g x i*φ x) := + ((EuclideanSpace.proj (𝕜 := ℝ) i).integrable_comp hg).locallyIntegrable.integrable_smul_right_of_hasCompactSupport hφ.continuous hc + have hd x : f x*fderiv ℝ φ x v=∑ i : Fin 2,v i*(f x*testPartial φ i x) := by + conv_lhs => rw [hv] + simp only [_root_.map_sum,map_smul,smul_eq_mul,Finset.mul_sum,testPartial] + apply Finset.sum_congr rfl + intro i _ + ring + have hi x : ⟪g x,v⟫*φ x=∑ i : Fin 2,v i*(g x i*φ x) := by + conv_lhs => rw [hv] + simp only [inner_sum,real_inner_smul_right,EuclideanSpace.inner_single_right,RCLike.conj_to_real,one_mul,Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + ring + simp_rw [hd,hi] + rw [integral_finsetSum _ (fun i _ => (hleft i).const_mul _), + integral_finsetSum _ (fun i _ => (hright i).const_mul _)] + simp only [integral_const_mul,hw φ hφ hc,Finset.sum_neg_distrib,mul_neg] + +/-- The coordinate isometry preserves Euclidean, not max-product, norms. -/ +def complexPlane : ℂ ≃ₗᵢ[ℝ] Plane := Complex.orthonormalBasisOneI.repr + +lemma integrable_comp_complexPlane {F : Type*} [NormedAddCommGroup F] {f : Plane → F} : + Integrable (fun z => f (complexPlane z)) ↔ Integrable f := + complexPlane.measurePreserving.integrable_comp_emb complexPlane.toMeasurableEquiv.measurableEmbedding + +lemma integrable_comp_complexPlane_symm {F : Type*} [NormedAddCommGroup F] {f : ℂ → F} : + Integrable (fun x => f (complexPlane.symm x)) ↔ Integrable f := + complexPlane.symm.measurePreserving.integrable_comp_emb complexPlane.symm.toMeasurableEquiv.measurableEmbedding + +lemma locallyIntegrable_comp_complexPlane {f : Plane → ℝ} : + LocallyIntegrable (fun z => f (complexPlane z)) ↔ LocallyIntegrable f := by + have h := locallyIntegrable_map_homeomorph complexPlane.toHomeomorph (f := f) (μ := volume) + change LocallyIntegrable f (Measure.map complexPlane volume) ↔ LocallyIntegrable (fun z => f (complexPlane z)) at h + rw [complexPlane.measurePreserving.map_eq] at h + exact h.symm + +lemma gradientNorm_comp_complexPlane (g : Plane → Plane) : + (∫ z,‖complexPlane.symm (g (complexPlane z))‖)=gradientNorm g := by + simp only [LinearIsometryEquiv.norm_map,gradientNorm] + exact complexPlane.measurePreserving.integral_comp complexPlane.toMeasurableEquiv.measurableEmbedding (fun x => ‖g x‖) + +lemma gradientNorm_comp_complexPlane_symm (G : ℂ → ℂ) : + gradientNorm (fun x => complexPlane (G (complexPlane.symm x)))=∫ z,‖G z‖ := by + simp only [LinearIsometryEquiv.norm_map,gradientNorm] + exact complexPlane.symm.measurePreserving.integral_comp complexPlane.symm.toMeasurableEquiv.measurableEmbedding (fun z => ‖G z‖) +end CenteredDiskEndpoint + +namespace CenteredDiskEndpoint +open WeakSobolev DiskMaximalTools + +/-- Equality of the actual all-real-radius operators, including the normalization +and absolute values. This bridge has no regularity assumption on the input. -/ +lemma maximalComplex_comp_complexPlane (f : Plane → ℝ) (z : ℂ) : + maximalComplex (fun w => f (complexPlane w)) z=maximal f (complexPlane z) := by + rw [maximalComplex_eq_all_radii,maximal] + apply iSup_congr + intro r + apply iSup_congr + intro hr + rw [absoluteDiskAverage,absoluteMeasure,withDensity_apply _ measurableSet_ball, + volume_disk_real z hr.le] + congr 1 + have h := complexPlane.measurePreserving.setLIntegral_comp_emb + complexPlane.toMeasurableEquiv.measurableEmbedding (fun x => ENNReal.ofReal |f x|) (Metric.ball z r) + rw [complexPlane.image_ball] at h + exact h + +lemma maximalComplexReal_comp_complexPlane (f : Plane → ℝ) : + DiskMaximalTools.maximalComplexReal (fun w => f (complexPlane w)) = fun z => maximalReal f (complexPlane z) := by + funext z + exact congrArg ENNReal.toReal (maximalComplex_comp_complexPlane f z) + +theorem main_endpoint : EndpointStatement := by + obtain ⟨C,hC,hendpoint⟩ := SobolevBand.complex_endpoint + refine ⟨C,hC.le,?_⟩ + intro f g hf hg hw + let f' := fun z => f (complexPlane z) + let g' := fun z => complexPlane.symm (g (complexPlane z)) + have hf' : Integrable f' := integrable_comp_complexPlane.mpr hf + have hg0 : Integrable (fun z => g (complexPlane z)) := integrable_comp_complexPlane.mpr hg + have hg' : Integrable g' := complexPlane.symm.toContinuousLinearEquiv.toContinuousLinearMap.integrable_comp hg0 + have hw0 : HasGradient (μ := volume) f g := (hasGradient_iff_hasWeakGradient hf.locallyIntegrable hg).mpr hw + have hw' : HasGradient (μ := volume) f' g' := hw0.comp_isometry complexPlane + obtain ⟨hM',G',hG'i,hwG',hbound⟩ := hendpoint f' g' hf' hg' hw' + have he : maximalComplexReal f'=fun z => maximalReal f (complexPlane z) := maximalComplexReal_comp_complexPlane f + rw [he] at hM' + have hM : LocallyIntegrable (maximalReal f) := locallyIntegrable_comp_complexPlane.mp hM' + let G := fun x => complexPlane (G' (complexPlane.symm x)) + have hG0 : Integrable (fun x => G' (complexPlane.symm x)) := integrable_comp_complexPlane_symm.mpr hG'i + have hG : Integrable G := complexPlane.toContinuousLinearEquiv.toContinuousLinearMap.integrable_comp hG0 + have hwG0 := hwG'.comp_isometry complexPlane.symm + have hwG : HasWeakGradient (maximalReal f) G := by + apply (hasGradient_iff_hasWeakGradient hM hG).mp + simpa only [he,complexPlane.apply_symm_apply,LinearIsometryEquiv.symm_symm] using hwG0 + refine ⟨ae_maximal_ne_top hf,hM,inW11Loc_of_gradient hM hG hwG,G,hG,hwG,?_⟩ + rw [show gradientNorm G=∫ z,‖G' z‖ from gradientNorm_comp_complexPlane_symm G'] + exact hbound.trans_eq (congrArg (fun v => C*v) (gradientNorm_comp_complexPlane g)) +end CenteredDiskEndpoint + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Marks.lean b/lean/OAI/Analysis/DiskMaximal/Marks.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a24109850270ca2232d9f6556cf168d8079e3a1 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Marks.lean @@ -0,0 +1,727 @@ +import OAI.Analysis.DiskMaximal.GreenBounds + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace + +noncomputable section + +namespace IntrinsicMarks + +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def direction (e v : E) : E := by + classical + exact if v = 0 then e else ‖v‖⁻¹ • v + +lemma norm_direction {e : E} (he : ‖e‖ = 1) (v : E) : ‖direction e v‖ = 1 := by + by_cases hv : v = 0 + · simp [direction,hv,he] + · rw [direction,ite_eq_right hv,norm_smul,Real.norm_eq_abs,abs_of_nonneg (inv_nonneg.mpr (norm_nonneg _))] + exact inv_mul_cancel₀ (norm_ne_zero_iff.mpr hv) + +lemma mass_direction (e v : E) : ‖v‖ • direction e v = v := by + by_cases hv : v = 0 + · simp [hv] + · simp [direction,hv,smul_smul,norm_ne_zero_iff.mpr hv] + +lemma debt_identity {e n : E} (he : ‖e‖ = 1) (hn : ‖n‖ = 1) (v : E) : + 2*(‖v‖-⟪v,n⟫) = ‖v‖*‖direction e v-n‖^2 := by + have hi : ‖v‖*⟪direction e v,n⟫ = ⟪v,n⟫ := by + rw [← real_inner_smul_left,mass_direction] + rw [norm_sub_sq_real,norm_direction he,hn] + nlinarith + +lemma marked_mass_le {e n : E} (he : ‖e‖ = 1) (hn : ‖n‖ = 1) + (v : E) {δ : ℝ} (hδ : 0 < δ) (hmark : δ < ‖direction e v-n‖) : + ‖v‖ ≤ (2/δ^2)*(‖v‖-⟪v,n⟫) := by + have hs : δ^2 ≤ ‖direction e v-n‖^2 := + (sq_le_sq₀ hδ.le (norm_nonneg _)).mpr hmark.le + have hm := mul_le_mul_of_nonneg_left hs (norm_nonneg v) + have hid := debt_identity he hn v + have hd : 0 < δ^2 := sq_pos_of_pos hδ + rw [div_mul_eq_mul_div,le_div_iff₀ hd] + nlinarith + +/-- Finite uniform branching includes each finite positive-refinement path forest +by padding absent children with zero vectors. No triangle defect is assumed. -/ +inductive Tree (ι : Type*) (E : Type*) where + | leaf : E → Tree ι E + | branch : (ι → Tree ι E) → Tree ι E + +variable {ι : Type*} [Fintype ι] + +def vector : Tree ι E → E + | .leaf v => v + | .branch t => ∑ i, vector (t i) + +def terminalMass : Tree ι E → ℝ + | .leaf v => ‖v‖ + | .branch t => ∑ i, terminalMass (t i) + +omit [InnerProductSpace ℝ E] in +lemma norm_vector_le_terminalMass (t : Tree ι E) : ‖vector t‖ ≤ terminalMass t := by + induction t with + | leaf v => exact le_rfl + | branch t ih => + exact (norm_sum_le _ _).trans (Finset.sum_le_sum fun i _ => ih i) + +/-- Only the first crossing from the most recent marked direction is counted; +a crossing resets the anchor before descending further. -/ +def markedCost (e : E) (δ : ℝ) : Tree ι E → E → ℝ + | .leaf v, n => if δ < ‖direction e v-n‖ then ‖v‖ else 0 + | .branch t, n => + let v := ∑ i, vector (t i) + if δ < ‖direction e v-n‖ then + ‖v‖ + ∑ i, markedCost e δ (t i) (direction e v) + else ∑ i, markedCost e δ (t i) n + +theorem markedCost_le {e : E} (he : ‖e‖ = 1) {δ : ℝ} (hδ : 0 < δ) + (t : Tree ι E) {n : E} (hn : ‖n‖ = 1) : + markedCost e δ t n ≤ (2/δ^2)*(terminalMass t-⟪vector t,n⟫) := by + induction t generalizing n with + | leaf v => + dsimp [markedCost,terminalMass,vector] + split_ifs with hm + · exact marked_mass_le he hn v hδ hm + · have hi : ⟪v,n⟫ ≤ ‖v‖ := by simpa only [hn,mul_one] using real_inner_le_norm v n + exact mul_nonneg (by positivity) (sub_nonneg.mpr hi) + | branch t ih => + let v := ∑ i, vector (t i) + have hs (u : E) (hu : ‖u‖ = 1) : + (∑ i, markedCost e δ (t i) u) ≤ + (2/δ^2)*((∑ i, terminalMass (t i))-⟪v,u⟫) := by + calc + _ ≤ ∑ i, (2/δ^2)*(terminalMass (t i)-⟪vector (t i),u⟫) := + Finset.sum_le_sum (fun i _ => ih i hu) + _ = _ := by simp only [Finset.mul_sum,Finset.sum_sub_distrib,sum_inner,v,mul_sub] + have hv := norm_direction he v + change (if δ < ‖direction e v-n‖ then + ‖v‖ + ∑ i, markedCost e δ (t i) (direction e v) + else ∑ i, markedCost e δ (t i) n) ≤ _ + split_ifs with hm + · have hms := marked_mass_le he hn v hδ hm + have hss := hs (direction e v) hv + have hinner : ⟪v,direction e v⟫ = ‖v‖ := by + calc + _ = ⟪‖v‖ • direction e v,direction e v⟫ := congrArg (fun w => ⟪w,direction e v⟫) (mass_direction e v).symm + _ = _ := by rw [real_inner_smul_left,real_inner_self_eq_norm_sq,hv]; ring + rw [hinner] at hss + change _ ≤ (2/δ^2)*((∑ i, terminalMass (t i))-⟪v,n⟫) + nlinarith + · exact hs n hn + +def costWithRoot (e : E) (δ : ℝ) : Tree ι E → ℝ + | .leaf v => ‖v‖ + | .branch t => + let v := ∑ i, vector (t i) + ‖v‖+∑ i, markedCost e δ (t i) (direction e v) + +theorem costWithRoot_le {e : E} (he : ‖e‖ = 1) {δ : ℝ} (hδ : 0 < δ) + (t : Tree ι E) : costWithRoot e δ t ≤ (1+2/δ^2)*terminalMass t := by + cases t with + | leaf v => + change ‖v‖ ≤ (1+2/δ^2)*‖v‖ + nlinarith [mul_nonneg (show 0 ≤ 2/δ^2 by positivity) (norm_nonneg v)] + | branch t => + let v := ∑ i, vector (t i) + have hv := norm_direction he v + have hinner : ⟪v,direction e v⟫ = ‖v‖ := by + calc + _ = ⟪‖v‖ • direction e v,direction e v⟫ := congrArg (fun w => ⟪w,direction e v⟫) (mass_direction e v).symm + _ = _ := by rw [real_inner_smul_left,real_inner_self_eq_norm_sq,hv]; ring + have hs : (∑ i, markedCost e δ (t i) (direction e v)) ≤ + (2/δ^2)*((∑ i, terminalMass (t i))-‖v‖) := by + calc + _ ≤ ∑ i, (2/δ^2)*(terminalMass (t i)-⟪vector (t i),direction e v⟫) := + Finset.sum_le_sum (fun i _ => markedCost_le he hδ (t i) hv) + _ = _ := by rw [← Finset.mul_sum,Finset.sum_sub_distrib,← sum_inner,hinner] + have hn : ‖v‖ ≤ ∑ i, terminalMass (t i) := norm_vector_le_terminalMass (.branch t) + change ‖v‖+∑ i, markedCost e δ (t i) (direction e v) ≤ + (1+2/δ^2)*(∑ i, terminalMass (t i)) + nlinarith [mul_nonneg (show 0 ≤ 2/δ^2 by positivity) (norm_nonneg v)] + +end IntrinsicMarks + +namespace IntrinsicMarks +variable {ι E : Type*} [Fintype ι] [NormedAddCommGroup E] + +/-- The fraction of the child capacity occupied by particles already alive. -/ +def survival (t : ι → Tree ι E) : ℝ := + ‖∑ i, vector (t i)‖ / ∑ i, ‖vector (t i)‖ + +lemma survival_nonneg (t : ι → Tree ι E) : 0 ≤ survival t := by + unfold survival + positivity + +lemma survival_le_one (t : ι → Tree ι E) : survival t ≤ 1 := by + unfold survival + exact div_le_one_of_le₀ (norm_sum_le _ _) (Finset.sum_nonneg (fun _ _ => norm_nonneg _)) + +lemma survival_capacity (t : ι → Tree ι E) : + survival t * (∑ i, ‖vector (t i)‖) = ‖∑ i, vector (t i)‖ := by + unfold survival + by_cases h : (∑ i, ‖vector (t i)‖) = 0 + · have hn : ‖∑ i, vector (t i)‖ = 0 := by + apply le_antisymm _ (norm_nonneg _) + simpa only [h] using norm_sum_le Finset.univ (fun i => vector (t i)) + simp [h,hn] + · exact div_mul_cancel₀ _ h + +/-- Explicit finite weighted evaluation on terminal paths, for the population +born at the current root. Every branching has its true capacity ratio. -/ +def rootEval : Tree ι E → (List ι → ℝ) → ℝ + | .leaf v, F => ‖v‖ * F [] + | .branch t, F => survival t * ∑ i, rootEval (t i) (fun p => F (i::p)) + +/-- Explicit finite evaluation of populations born strictly below this root. +The complete prefix is retained, including the part before birth. -/ +def lateEval : Tree ι E → (List ι → ℕ → ℝ) → ℝ + | .leaf _, _ => 0 + | .branch t, F => + (1-survival t) * (∑ i, rootEval (t i) (fun p => F (i::p) 1)) + + ∑ i, lateEval (t i) (fun p b => F (i::p) (b+1)) + +def particleEval (t : Tree ι E) (F : List ι → ℕ → ℝ) : ℝ := + rootEval t (fun p => F p 0) + lateEval t F + +lemma rootEval_nonneg (t : Tree ι E) {F : List ι → ℝ} (hF : ∀ p, 0 ≤ F p) : + 0 ≤ rootEval t F := by + induction t generalizing F with + | leaf v => exact mul_nonneg (norm_nonneg _) (hF _) + | branch t ih => + exact mul_nonneg (survival_nonneg t) (Finset.sum_nonneg fun i _ => ih i (fun p => hF (i::p))) + +lemma lateEval_nonneg (t : Tree ι E) {F : List ι → ℕ → ℝ} (hF : ∀ p b, 0 ≤ F p b) : + 0 ≤ lateEval t F := by + induction t generalizing F with + | leaf v => exact le_rfl + | branch t ih => + exact add_nonneg (mul_nonneg (sub_nonneg.mpr (survival_le_one t)) + (Finset.sum_nonneg (fun i _ => rootEval_nonneg (t i) (fun p => hF (i::p) 1)))) + (Finset.sum_nonneg (fun i _ => ih i (fun p b => hF (i::p) (b+1)))) + +lemma particleEval_nonneg (t : Tree ι E) {F : List ι → ℕ → ℝ} (hF : ∀ p b, 0 ≤ F p b) : + 0 ≤ particleEval t F := add_nonneg (rootEval_nonneg t (fun p => hF p 0)) (lateEval_nonneg t hF) + +lemma rootEval_const (t : Tree ι E) (c : ℝ) : + rootEval t (fun _ => c) = ‖vector t‖*c := by + induction t with + | leaf _ => rfl + | branch t ih => + change survival t * (∑ i, rootEval (t i) (fun _ => c)) = _ + simp only [ih,← Finset.sum_mul] + rw [← mul_assoc,survival_capacity] + rfl + +lemma rootEval_add (t : Tree ι E) (F G : List ι → ℝ) : + rootEval t (fun p => F p+G p) = rootEval t F+rootEval t G := by + induction t generalizing F G with + | leaf _ => exact mul_add _ _ _ + | branch t ih => simp only [rootEval,ih,Finset.sum_add_distrib,mul_add] + +lemma rootEval_smul (t : Tree ι E) (c : ℝ) (F : List ι → ℝ) : + rootEval t (fun p => c*F p) = c*rootEval t F := by + induction t generalizing F with + | leaf _ => dsimp [rootEval]; ring + | branch t ih => simp only [rootEval,ih,← Finset.mul_sum]; ring + +lemma lateEval_const (t : Tree ι E) (c : ℝ) : + lateEval t (fun _ _ => c) = (terminalMass t-‖vector t‖)*c := by + induction t with + | leaf _ => simp [lateEval,terminalMass,vector] + | branch t ih => + change (1-survival t)*(∑ i, rootEval (t i) (fun _ => c)) + + (∑ i, lateEval (t i) (fun _ _ => c)) = _ + simp only [ih,rootEval_const,← Finset.sum_mul,Finset.sum_sub_distrib] + rw [sub_mul,one_mul,← mul_assoc,survival_capacity] + simp only [terminalMass,vector] + ring + +lemma particleEval_const (t : Tree ι E) (c : ℝ) : + particleEval t (fun _ _ => c) = terminalMass t*c := by + rw [particleEval,rootEval_const,lateEval_const] + ring + +lemma lateEval_add (t : Tree ι E) (F G : List ι → ℕ → ℝ) : + lateEval t (fun p b => F p b+G p b) = lateEval t F+lateEval t G := by + induction t generalizing F G with + | leaf _ => simp [lateEval] + | branch t ih => simp only [lateEval,rootEval_add,ih,Finset.sum_add_distrib,mul_add]; ring + +lemma lateEval_smul (t : Tree ι E) (c : ℝ) (F : List ι → ℕ → ℝ) : + lateEval t (fun p b => c*F p b) = c*lateEval t F := by + induction t generalizing F with + | leaf _ => simp [lateEval] + | branch t ih => simp only [lateEval,rootEval_smul,ih,← Finset.mul_sum]; ring + +lemma particleEval_add (t : Tree ι E) (F G : List ι → ℕ → ℝ) : + particleEval t (fun p b => F p b+G p b) = particleEval t F+particleEval t G := by + simp only [particleEval,rootEval_add,lateEval_add] + ring + +lemma particleEval_smul (t : Tree ι E) (c : ℝ) (F : List ι → ℕ → ℝ) : + particleEval t (fun p b => c*F p b) = c*particleEval t F := by + simp only [particleEval,rootEval_smul,lateEval_smul,mul_add] + +lemma particleEval_mono (t : Tree ι E) {F G : List ι → ℕ → ℝ} + (hFG : ∀ p b, F p b ≤ G p b) : particleEval t F ≤ particleEval t G := by + have hn := particleEval_nonneg t (F := fun p b => G p b-F p b) (fun p b => sub_nonneg.mpr (hFG p b)) + have h := particleEval_add t G (fun p b => -1*F p b) + simp only [neg_one_mul] at h + have hn' : particleEval t (fun p b => G p b-F p b) = particleEval t G-particleEval t F := by + calc + _ = particleEval t G+particleEval t (fun p b => -1*F p b) := by simpa only [neg_one_mul,sub_eq_add_neg] using h + _ = _ := by rw [particleEval_smul]; ring + rw [hn'] at hn + linarith + +/-- Sum a node charge only at and after the particle's birth. -/ +def pathCharge (C : List ι → ℝ) : List ι → ℕ → ℝ + | [], 0 => C [] + | [], _+1 => 0 + | i::p, 0 => C [] + pathCharge (fun q => C (i::q)) p 0 + | i::p, b+1 => pathCharge (fun q => C (i::q)) p b + +def nodeCharge : Tree ι E → (List ι → ℝ) → ℝ + | .leaf v, C => ‖v‖*C [] + | .branch t, C => ‖∑ i, vector (t i)‖*C [] + ∑ i, nodeCharge (t i) (fun p => C (i::p)) + +/-- Exact occupancy identity for every node charge. This includes all levels, +not only the terminal mass; populations created later are not charged earlier. -/ +theorem particle_occupancy (t : Tree ι E) (C : List ι → ℝ) : + particleEval t (pathCharge C) = nodeCharge t C := by + induction t generalizing C with + | leaf v => simp [particleEval,rootEval,lateEval,pathCharge,nodeCharge] + | branch t ih => + simp only [particleEval,rootEval,lateEval,pathCharge,rootEval_add,rootEval_const, + Finset.sum_add_distrib] + have hs : (∑ i, particleEval (t i) (pathCharge (fun q => C (i::q)))) = + ∑ i, nodeCharge (t i) (fun q => C (i::q)) := + Finset.sum_congr rfl (fun i _ => ih i _) + simp only [particleEval,Finset.sum_add_distrib] at hs + rw [← Finset.sum_mul,mul_add,← mul_assoc,survival_capacity] + change _ = ‖∑ i, vector (t i)‖*C []+∑ i, nodeCharge (t i) (fun q => C (i::q)) + linarith + +end IntrinsicMarks + +namespace IntrinsicMarks +open Finset +variable {E ι : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [Fintype ι] + +def validPath : Tree ι E → List ι → Prop + | .leaf _, p => p = [] + | .branch _, [] => False + | .branch t, i::p => validPath (t i) p + +omit [InnerProductSpace ℝ E] in +lemma rootEval_mono_on (t : Tree ι E) {F G : List ι → ℝ} + (h : ∀ p, validPath t p → F p ≤ G p) : rootEval t F ≤ rootEval t G := by + induction t generalizing F G with + | leaf v => exact mul_le_mul_of_nonneg_left (h [] rfl) (norm_nonneg _) + | branch t ih => + apply mul_le_mul_of_nonneg_left _ (survival_nonneg t) + exact sum_le_sum fun i _ => ih i (fun p hp => h (i::p) hp) + +omit [InnerProductSpace ℝ E] in +lemma lateEval_mono_on (t : Tree ι E) {F G : List ι → ℕ → ℝ} + (h : ∀ p b, validPath t p → b ≤ p.length → F p b ≤ G p b) : + lateEval t F ≤ lateEval t G := by + induction t generalizing F G with + | leaf v => rfl + | branch t ih => + unfold lateEval + apply add_le_add + · apply mul_le_mul_of_nonneg_left _ (sub_nonneg.mpr (survival_le_one t)) + exact sum_le_sum fun i _ => rootEval_mono_on (t i) (fun p hp => h (i::p) 1 hp (by simp)) + · exact sum_le_sum fun i _ => ih i (fun p b hp hb => h (i::p) (b+1) hp (by simpa using Nat.succ_le_succ hb)) + +omit [InnerProductSpace ℝ E] in +/-- Particle monotonicity requires bounds only on genuine terminal paths and +legal birth times; the explicit construction has no mass elsewhere. -/ +theorem particleEval_mono_on (t : Tree ι E) {F G : List ι → ℕ → ℝ} + (h : ∀ p b, validPath t p → b ≤ p.length → F p b ≤ G p b) : + particleEval t F ≤ particleEval t G := by + exact add_le_add (rootEval_mono_on t (fun p hp => h p 0 hp (Nat.zero_le _))) + (lateEval_mono_on t h) + +/-- Intrinsic marks as an actual function on prefixes, with first-crossing +reset. Prefixes outside the tree have zero charge. -/ +def markIndicator (e : E) (δ : ℝ) : Tree ι E → E → List ι → ℝ + | .leaf v, n, [] => if δ < ‖direction e v-n‖ then 1 else 0 + | .leaf _, _, _::_ => 0 + | .branch t, n, [] => if δ < ‖direction e (∑ i, vector (t i))-n‖ then 1 else 0 + | .branch t, n, i::p => + let v := ∑ j, vector (t j) + markIndicator e δ (t i) (if δ < ‖direction e v-n‖ then direction e v else n) p + +def rootMarkIndicator (e : E) (δ : ℝ) : Tree ι E → List ι → ℝ + | _, [] => 1 + | .leaf _, _::_ => 0 + | .branch t, i::p => markIndicator e δ (t i) (direction e (∑ j, vector (t j))) p + +lemma marked_occupancy (e : E) (δ : ℝ) (t : Tree ι E) (n : E) : + nodeCharge t (markIndicator e δ t n) = markedCost e δ t n := by + induction t generalizing n with + | leaf v => simp only [nodeCharge,markIndicator,markedCost]; split_ifs <;> simp + | branch t ih => + simp only [nodeCharge,markIndicator,markedCost] + split_ifs with h + · simp only [mul_one] + congr 1 + exact sum_congr rfl (fun i _ => ih i _) + · simp only [mul_zero,zero_add] + exact sum_congr rfl (fun i _ => ih i _) + +lemma root_marked_occupancy (e : E) (δ : ℝ) (t : Tree ι E) : + nodeCharge t (rootMarkIndicator e δ t) = costWithRoot e δ t := by + cases t with + | leaf v => simp [nodeCharge,rootMarkIndicator,costWithRoot] + | branch t => simp only [nodeCharge,rootMarkIndicator,costWithRoot,mul_one,marked_occupancy] + +theorem particle_mark_budget {e : E} (he : ‖e‖ = 1) {δ : ℝ} (hδ : 0 < δ) + (t : Tree ι E) : + particleEval t (pathCharge (rootMarkIndicator e δ t)) ≤ + (1+2/δ^2)*terminalMass t := by + rw [particle_occupancy,root_marked_occupancy] + exact costWithRoot_le he hδ t + +/-- Turning a genuine pathwise switch bound into the global budget uses exact +occupancy, rather than a false assumption that every particle is born at a root. -/ +theorem particle_switch_budget {e : E} (he : ‖e‖ = 1) {δ c : ℝ} (hδ : 0 < δ) + (t : Tree ι E) (energy : List ι → ℝ) (switches : List ι → ℕ → ℝ) + (hpath : ∀ p b, validPath t p → b ≤ p.length → switches p b ≤ + 1+2*pathCharge (rootMarkIndicator e δ t) p b+c*pathCharge energy p b) : + particleEval t switches ≤ (3+4/δ^2)*terminalMass t+c*nodeCharge t energy := by + have h := particleEval_mono_on t hpath + simp only [particleEval_add,particleEval_smul,particleEval_const,particle_occupancy, + root_marked_occupancy] at h + have hm := costWithRoot_le he hδ t + calc + _ ≤ terminalMass t*1 + 2*((1+2/δ^2)*terminalMass t)+c*nodeCharge t energy := + h.trans (by gcongr) + _ = _ := by ring + +end IntrinsicMarks + +namespace SignedAssembly +open Finset +open scoped RealInnerProductSpace +variable {ι E : Type*} [Fintype ι] [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +structure RowJet (ι E : Type*) [Fintype ι] [NormedAddCommGroup E] [InnerProductSpace ℝ E] where + law : FiniteLabels.Law ι + grad : ι → E + total_grad : ∑ i, grad i = 0 + +inductive JetTree (ι E : Type*) [Fintype ι] [NormedAddCommGroup E] [InnerProductSpace ℝ E] where + | leaf : E → JetTree ι E + | branch : RowJet ι E → E → ℝ → (ι → JetTree ι E) → JetTree ι E + +def mean : JetTree ι E → E + | .leaf v => v + | .branch row _ _ t => ∑ i, row.law i • mean (t i) + +def flux : JetTree ι E → ℝ + | .leaf _ => 0 + | .branch row _ _ t => ∑ i, ⟪row.grad i,mean (t i)⟫ + ∑ i, row.law i*flux (t i) + +/-- Product-rule expansion over all terminal label histories. The carried mass +and its derivative are updated by the exact Leibniz rule. -/ +def pathFlux : JetTree ι E → ℝ → E → ℝ + | .leaf v, _, G => ⟪G,v⟫ + | .branch row _ _ t, q, G => + ∑ i, pathFlux (t i) (q*row.law i) (q • row.grad i+row.law i • G) + +lemma pathFlux_eq (t : JetTree ι E) (q : ℝ) (G : E) : + pathFlux t q G = ⟪G,mean t⟫+q*flux t := by + induction t generalizing q G with + | leaf v => simp [pathFlux,mean,flux] + | branch row c B t ih => + simp only [pathFlux,ih,inner_add_left,real_inner_smul_left,sum_add_distrib, + ← mul_sum,mean,flux,inner_sum,real_inner_smul_right] + simp only [mul_assoc, ← mul_sum] + ring + +lemma terminal_flux (t : JetTree ι E) : pathFlux t 1 0 = flux t := by + rw [pathFlux_eq,inner_zero_left,one_mul,zero_add] + +/-- Every terminal continuation is within B of the same closed-prefix value. -/ +def TerminalBound : JetTree ι E → E → ℝ → Prop + | .leaf v, c, B => ‖v-c‖ ≤ B + | .branch _ _ _ t, c, B => ∀ i, TerminalBound (t i) c B + +lemma mean_bound (t : JetTree ι E) (c : E) (B : ℝ) (h : TerminalBound t c B) : + ‖mean t-c‖ ≤ B := by + induction t with + | leaf v => exact h + | branch row _ _ t ih => + have he : mean (.branch row (0:E) 0 t)-c = ∑ i, row.law i • (mean (t i)-c) := by + simp only [mean,smul_sub,sum_sub_distrib,← sum_smul,row.law.total,one_smul] + change ‖mean (.branch row (0:E) 0 t)-c‖ ≤ B + rw [he] + calc + _ ≤ ∑ i, ‖row.law i • (mean (t i)-c)‖ := norm_sum_le _ _ + _ = ∑ i, row.law i*‖mean (t i)-c‖ := by + simp only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (row.law.nonneg _)] + _ ≤ ∑ i, row.law i*B := sum_le_sum fun i _ => + mul_le_mul_of_nonneg_left (ih i (h i)) (row.law.nonneg i) + _ = B := by rw [← sum_mul,row.law.total,one_mul] + +/-- This is the exact zero-row-sum cancellation. No unsigned path-potential +bound is used and the parent prefix may be arbitrarily large. -/ +lemma prefix_cancellation (row : RowJet ι E) (v : ι → E) (c : E) : + (∑ i, ⟪row.grad i,v i⟫) = ∑ i, ⟪row.grad i,v i-c⟫ := by + simp only [inner_sub_right,sum_sub_distrib,← sum_inner,row.total_grad,inner_zero_left,sub_zero] + +lemma row_flux_bound (row : RowJet ι E) (v : ι → E) (c : E) (B : ℝ) + (h : ∀ i, ‖v i-c‖ ≤ B) : + |∑ i, ⟪row.grad i,v i⟫| ≤ (∑ i, ‖row.grad i‖)*B := by + rw [prefix_cancellation row v c] + calc + _ ≤ ∑ i, |⟪row.grad i,v i-c⟫| := abs_sum_le_sum_abs _ _ + _ ≤ ∑ i, ‖row.grad i‖*B := sum_le_sum fun i _ => + (abs_real_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_left (h i) (norm_nonneg _)) + _ = _ := by rw [← sum_mul] + +def Controlled : JetTree ι E → Prop + | .leaf _ => True + | .branch _ c B t => (∀ i, TerminalBound (t i) c B) ∧ ∀ i, Controlled (t i) + +def cost : JetTree ι E → ℝ + | .leaf _ => 0 + | .branch row _ B t => (∑ i, ‖row.grad i‖)*B+∑ i, row.law i*cost (t i) + +/-- Full finite-history signed flux estimate, with all stochastic prefix +weights kept. The node bound is the tail oscillation, not the old envelope. -/ +theorem signed_flux_bound (t : JetTree ι E) (ht : Controlled t) : + |pathFlux t 1 0| ≤ cost t := by + rw [terminal_flux] + induction t with + | leaf v => simp [flux,cost] + | branch row c B t ih => + change |(∑ i, ⟪row.grad i,mean (t i)⟫)+∑ i, row.law i*flux (t i)| ≤ _ + calc + _ ≤ |∑ i, ⟪row.grad i,mean (t i)⟫|+|∑ i, row.law i*flux (t i)| := abs_add_le _ _ + _ ≤ (∑ i, ‖row.grad i‖)*B+∑ i, row.law i*cost (t i) := by + apply add_le_add (row_flux_bound row (fun i => mean (t i)) c B + (fun i => mean_bound (t i) c B (ht.1 i))) + calc + _ ≤ ∑ i, |row.law i*flux (t i)| := abs_sum_le_sum_abs _ _ + _ = ∑ i, row.law i*|flux (t i)| := by + simp only [abs_mul,abs_of_nonneg (row.law.nonneg _)] + _ ≤ _ := sum_le_sum fun i _ => mul_le_mul_of_nonneg_left (ih i (ht.2 i)) (row.law.nonneg i) + _ = _ := rfl + +end SignedAssembly + +open scoped ContDiff +namespace PlanePotential +lemma potential_norm_lintegral {L : ℂ → ℂ} (hL : Measurable L) {b : ℂ → ℂ} + (hb : Integrable b) : + (∫⁻ y, ‖⟪L y,b y⟫‖ₑ) ≤ + ∫⁻ y, ENNReal.ofReal ‖L y‖ ∂volume.withDensity (fun y => ENNReal.ofReal ‖b y‖) := by + rw [lintegral_withDensity_eq_lintegral_mul₀' hb.aestronglyMeasurable.norm.aemeasurable.ennreal_ofReal + hL.norm.ennreal_ofReal.aemeasurable] + apply lintegral_mono + intro y + dsimp only [Pi.mul_apply] + rw [← ofReal_norm] + change ENNReal.ofReal ‖⟪L y,b y⟫‖ ≤ ENNReal.ofReal ‖b y‖ * ENNReal.ofReal ‖L y‖ + rw [← ENNReal.ofReal_mul (norm_nonneg _)] + exact ENNReal.ofReal_le_ofReal ((norm_inner_le_norm _ _).trans_eq (mul_comm _ _)) + +lemma potential_integrable_of_density {L : ℂ → ℂ} (hL : Measurable L) {b : ℂ → ℂ} + (hb : Integrable b) + (hfinite : (∫⁻ y, ENNReal.ofReal ‖L y‖ ∂volume.withDensity (fun y => ENNReal.ofReal ‖b y‖)) < ⊤) : + Integrable (fun y => ⟪L y,b y⟫) := by + refine ⟨hL.aestronglyMeasurable.inner hb.aestronglyMeasurable,?_⟩ + rw [hasFiniteIntegral_iff_enorm] + exact (potential_norm_lintegral hL hb).trans_lt hfinite + +/-- Finiteness of the genuine singular integrals, obtained from the column +estimate itself. This justifies insertion of the finite vector decomposition. -/ +theorem kernel_potential_ae_integrable (μ : Measure ℂ) [SFinite μ] + {K : ℂ × ℂ → ℂ} (hK : Measurable K) {b : ℂ → ℂ} (hb : Integrable b) + {C : ℝ≥0∞} (hC : C < ⊤) + (hcol : ∀ᵐ y ∂volume.withDensity (fun y => ENNReal.ofReal ‖b y‖), + (∫⁻ x, (ENNReal.ofReal ‖K (x,y)‖)^(3/2:ℝ) ∂μ) ≤ C) : + ∀ᵐ x ∂μ, Integrable (fun y => ⟪K (x,y),b y⟫) := by + let ν := volume.withDensity (fun y => ENNReal.ofReal ‖b y‖) + have hm : ν univ = ENNReal.ofReal (∫ y, ‖b y‖) := by + dsimp only [ν] + rw [withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ] + exact (ofReal_integral_eq_lintegral_ofReal hb.norm + (ae_of_all _ (fun _ => norm_nonneg _))).symm + have hν : ν univ < ⊤ := by rw [hm]; exact ENNReal.ofReal_lt_top + have : IsFiniteMeasure ν := ⟨hν⟩ + have hlp := kernel_column_lp μ ν hK.norm.ennreal_ofReal hcol + have hfinite : (∫⁻ x, (∫⁻ y, ENNReal.ofReal ‖K (x,y)‖ ∂ν)^(3/2:ℝ) ∂μ) ≠ ⊤ := + ne_of_lt (hlp.trans_lt (ENNReal.mul_lt_top hC (ENNReal.rpow_lt_top_of_nonneg (by norm_num) hν.ne))) + have hae := ae_lt_top (hK.norm.ennreal_ofReal.lintegral_prod_right.pow_const _) hfinite + filter_upwards [hae] with x hx + apply potential_integrable_of_density (hK.comp (measurable_const.prodMk measurable_id)) hb + apply lt_top_iff_ne_top.mpr + intro htop + change (∫⁻ y, ENNReal.ofReal ‖K (x,y)‖ ∂ν) = ⊤ at htop + rw [htop,ENNReal.top_rpow_of_pos (by norm_num : (0:ℝ) < 3/2)] at hx + exact (lt_irrefl _ hx) + +lemma green_root_column {ψ : ℂ → ℝ} (hψm : Measurable ψ) {R X Y B : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) (hXY : 0 < X+Y) {y : ℂ} (hy : ‖y‖ ≤ Y) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, (ENNReal.ofReal ‖green ψ x y‖)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(2*(X+Y))^(1/2:ℝ))) := by + apply kernel_near_three_halves (by positivity) (by positivity : 0 < 2*(X+Y)) y + · intro x hx + rw [mem_ball,dist_eq_norm] + have hn := norm_sub_le x y + change ‖x‖ ≤ X at hx + linarith + · intro x hx + exact green_size_all hψm hψs hψB hM hB hx + +lemma green_ae_integrable {ψ : ℂ → ℝ} {β : ℂ → ℂ} + (hψm : Measurable ψ) {R X Y B : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) (hXY : 0 < X+Y) + (hβ : Integrable β) (hβs : ∀ y, β y ≠ 0 → ‖y‖ ≤ Y) : + ∀ᵐ x ∂volume.restrict {x : ℂ | ‖x‖ ≤ X}, Integrable (fun y => ⟪green ψ x y,β y⟫) := by + apply kernel_potential_ae_integrable _ (green_measurable ψ hψm) hβ ENNReal.ofReal_lt_top + rw [ae_withDensity_iff' hβ.aestronglyMeasurable.norm.aemeasurable.ennreal_ofReal] + filter_upwards with y hy + apply green_root_column hψm hψs hψB hM hB hXY + apply hβs y + intro hy0 + simp [hy0] at hy + +lemma green_root_lp {ψ : ℂ → ℝ} {β : ℂ → ℂ} + (hψm : Measurable ψ) {R X Y B : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hM : 0 < R+X) (hB : 0 ≤ B) (hXY : 0 < X+Y) + (hβ : Integrable β) (hβs : ∀ y, β y ≠ 0 → ‖y‖ ≤ Y) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, (ENNReal.ofReal |∫ y, ⟪green ψ x y,β y⟫|)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(2*(X+Y))^(1/2:ℝ))) * + (ENNReal.ofReal (∫ y, ‖β y‖))^(3/2:ℝ) := by + let ν := volume.withDensity (fun y => ENNReal.ofReal ‖β y‖) + have hν : ν univ = ENNReal.ofReal (∫ y, ‖β y‖) := by + dsimp only [ν] + rw [withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ] + exact (ofReal_integral_eq_lintegral_ofReal hβ.norm + (ae_of_all _ (fun _ => norm_nonneg _))).symm + have : IsFiniteMeasure ν := ⟨by rw [hν]; exact ENNReal.ofReal_lt_top⟩ + have hm := green_measurable ψ hψm + have hcol := kernel_column_lp (volume.restrict {x : ℂ | ‖x‖ ≤ X}) ν hm.norm.ennreal_ofReal + (C := ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(2*(X+Y))^(1/2:ℝ)))) (by + rw [ae_withDensity_iff' hβ.aestronglyMeasurable.norm.aemeasurable.ennreal_ofReal] + filter_upwards with y hy + apply green_root_column hψm hψs hψB hM hB hXY + apply hβs y + intro hy0 + simp [hy0] at hy) + rw [hν] at hcol + apply le_trans _ hcol + apply lintegral_mono + intro x + exact ENNReal.rpow_le_rpow (potential_domination + (hm.comp (measurable_const.prodMk measurable_id)) hβ) (by norm_num) + +end PlanePotential + +namespace PlanePotential +lemma eLpNorm_three_halves_bound (μ : Measure ℂ) {F : ℂ → ℝ} {K m : ℝ≥0∞} + (h : (∫⁻ x, (ENNReal.ofReal |F x|)^(3/2:ℝ) ∂μ) ≤ K*m^(3/2:ℝ)) : + eLpNorm' F (3/2) μ ≤ K^(2/3:ℝ)*m := by + rw [eLpNorm'_eq_lintegral_enorm] + norm_num only [one_div_div] + have hpow := ENNReal.rpow_le_rpow h (by norm_num : (0:ℝ) ≤ 2/3) + rw [ENNReal.mul_rpow_of_nonneg _ _ (by norm_num : (0:ℝ) ≤ 2/3),← ENNReal.rpow_mul] at hpow + norm_num only [show (3/2:ℝ)*(2/3)=1 by norm_num,ENNReal.rpow_one] at hpow + simpa only [← ofReal_norm,Real.norm_eq_abs] using hpow + +lemma potential_aestronglyMeasurable (μ : Measure ℂ) {K : ℂ × ℂ → ℂ} + (hK : Measurable K) {β : ℂ → ℂ} (hβ : Integrable β) : + AEStronglyMeasurable (fun x => ∫ y, ⟪K (x,y),β y⟫) μ := by + have h : AEStronglyMeasurable (fun z : ℂ × ℂ => @inner ℝ ℂ _ (K z) (β z.2)) (μ.prod volume) := + hK.aestronglyMeasurable.inner hβ.aestronglyMeasurable.comp_snd + exact h.integral_prod_right' + +lemma potential_memLp_of_bound (μ : Measure ℂ) {K : ℂ × ℂ → ℂ} + (hK : Measurable K) {β : ℂ → ℂ} (hβ : Integrable β) {C m : ℝ≥0∞} + (hC : C < ⊤) (hm : m < ⊤) + (h : (∫⁻ x, (ENNReal.ofReal |∫ y, ⟪K (x,y),β y⟫|)^(3/2:ℝ) ∂μ) ≤ C*m^(3/2:ℝ)) : + MemLp (fun x => ∫ y, ⟪K (x,y),β y⟫) (3/2) μ := by + rw [memLp_iff, eLpNorm_eq_eLpNorm' (by norm_num : (3/2:ℝ≥0∞) ≠ 0) + (ENNReal.div_ne_top (by norm_num) (by norm_num)) (potential_aestronglyMeasurable μ hK hβ)] + norm_num only [ENNReal.toReal_div, ENNReal.toReal_ofNat] + exact (eLpNorm_three_halves_bound μ h).trans_lt + (ENNReal.mul_lt_top (ENNReal.rpow_lt_top_of_nonneg (by norm_num) hC.ne) hm) + +/-- A genuine fixed smooth probability cutoff. Its finite size and Lipschitz +constants depend on no input, no dyadic level and no number of scales. -/ +theorem exists_kernel_cutoff : ∃ (ψ : ℂ → ℝ) (B L : ℝ), + 0 ≤ B ∧ 0 ≤ L ∧ ContDiff ℝ ∞ ψ ∧ HasCompactSupport ψ ∧ + (∫ x, ψ x) = 1 ∧ (∀ x, ψ x ≠ 0 → ‖x‖ ≤ 1) ∧ + (∀ x, |ψ x| ≤ B) ∧ (∀ x y, |ψ x-ψ y| ≤ L*‖x-y‖) := by + let φ : ContDiffBump (0:ℂ) := ⟨1/2,1,by norm_num,by norm_num⟩ + let ψ := φ.normed volume + have hc : HasCompactSupport ψ := φ.hasCompactSupport_normed + have hd : ContDiff ℝ ∞ ψ := φ.contDiff_normed + obtain ⟨B,hB⟩ := hc.exists_bound_of_continuous hd.continuous + obtain ⟨L,hL⟩ := hd.lipschitzWith_of_hasCompactSupport hc (by simp) + refine ⟨ψ,B,L,le_trans (norm_nonneg (ψ 0)) (hB 0),L.coe_nonneg,hd,hc, + φ.integral_normed,?_,?_,?_⟩ + · intro x hx + have hs : x ∈ Function.support ψ := hx + rw [φ.support_normed_eq] at hs + exact (show ‖x‖ < 1 by simpa only [mem_ball,dist_zero_right] using hs).le + · intro x + simpa only [Real.norm_eq_abs] using hB x + · intro x y + simpa only [Real.norm_eq_abs] using hL.norm_sub_le x y + +end PlanePotential + +open Finset +noncomputable section + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/MaximalEstimates.lean b/lean/OAI/Analysis/DiskMaximal/MaximalEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..0f69609cf7dcfb25ad25132cc607d080a5a034fc --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/MaximalEstimates.lean @@ -0,0 +1,466 @@ +import OAI.Analysis.DiskMaximal.Telescoping + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology + +noncomputable section + +namespace DiskMaximalTools + +lemma volume_dilate_five (x : ℂ) (r : ℝ) : + volume (ball x (5*r)) = 25 * volume (ball x r) := by + rw [Complex.volume_ball, Complex.volume_ball, ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 5)] + norm_num [mul_pow] + ring + +/-- The actual Vitali weak-(1,1) estimate, with no assumed maximal inequality. -/ +theorem weak_bound_bounded_family {ι : Type*} (t : Set ι) (x : ι → ℂ) (r : ι → ℝ) + (ν : Measure ℂ) {R a : ℝ} (ha : 0 < a) + (hr : ∀ i ∈ t, 0 < r i) (hR : ∀ i ∈ t, r i ≤ R) + (hav : ∀ i ∈ t, ENNReal.ofReal a * volume (ball (x i) (r i)) ≤ ν (ball (x i) (r i))) : + volume (⋃ i ∈ t, ball (x i) (r i)) ≤ (25 / ENNReal.ofReal a) * ν univ := by + obtain ⟨u,hut,hdisj,hcover⟩ := Vitali.exists_disjoint_subfamily_covering_enlargement_ball + t x r R hR 5 (by norm_num) + have huc : u.Countable := hdisj.countable_of_isOpen (fun _ _ => isOpen_ball) + (fun i hi => ⟨x i,mem_ball_self (hr i (hut hi))⟩) + have : Countable u := huc.to_subtype + have hsub : (⋃ i ∈ t, ball (x i) (r i)) ⊆ ⋃ i : u, ball (x i) (5*r i) := by + intro y hy + obtain ⟨i,hi,hy⟩ := mem_iUnion₂.mp hy + obtain ⟨j,hj,hij⟩ := hcover i hi + exact mem_iUnion.mpr ⟨⟨j,hj⟩,hij hy⟩ + have hmass : (∑' i : u, ν (ball (x i) (r i))) ≤ ν univ := by + rw [← measure_iUnion (fun (i j : u) hij => hdisj i.property j.property (fun h => hij (Subtype.ext h))) + (fun _ => measurableSet_ball)] + exact measure_mono (subset_univ _) + calc + _ ≤ volume (⋃ i : u, ball (x i) (5*r i)) := measure_mono hsub + _ ≤ ∑' i : u, volume (ball (x i) (5*r i)) := measure_iUnion_le _ + _ = ∑' i : u, 25 * volume (ball (x i) (r i)) := by simp_rw [volume_dilate_five] + _ ≤ ∑' i : u, (25 / ENNReal.ofReal a) * ν (ball (x i) (r i)) := by + apply ENNReal.tsum_le_tsum + intro i + have hb := hav i (hut i.property) + calc + _ = (25 / ENNReal.ofReal a) * (ENNReal.ofReal a * volume (ball (x i) (r i))) := by + rw [← mul_assoc, ENNReal.div_mul_cancel (ne_of_gt (ENNReal.ofReal_pos.mpr ha)) ENNReal.ofReal_ne_top] + _ ≤ _ := by gcongr + _ = (25 / ENNReal.ofReal a) * ∑' i : u, ν (ball (x i) (r i)) := by rw [ENNReal.tsum_mul_left] + _ ≤ _ := by gcongr + +lemma volume_disk_real (x : ℂ) {r : ℝ} (hr : 0 ≤ r) : + volume (ball x r) = ENNReal.ofReal (Real.pi*r^2) := by + rw [Complex.volume_ball,ENNReal.ofReal_mul Real.pi_nonneg,ENNReal.ofReal_pow hr] + rw [← (ENNReal.ofReal_coe_nnreal : ENNReal.ofReal (NNReal.pi : ℝ) = (NNReal.pi : ℝ≥0∞))] + exact mul_comm _ _ + +/-- All high-average balls of a finite measure have a common finite radius +bound; the bounded-family Vitali argument therefore controls every radius. -/ +theorem weak_bound {ν : Measure ℂ} [IsFiniteMeasure ν] {a : ℝ} (ha : 0 < a) : + volume {x : ℂ | ∃ r : ℝ, 0 < r ∧ + ENNReal.ofReal a * volume (ball x r) ≤ ν (ball x r)} ≤ + (25 / ENNReal.ofReal a) * ν univ := by + let t : Set (ℂ × ℝ) := {p | 0 < p.2 ∧ + ENNReal.ofReal a * volume (ball p.1 p.2) ≤ ν (ball p.1 p.2)} + let B : ℝ := (ν univ).toReal/(a*Real.pi) + have hB : 0 ≤ B := div_nonneg ENNReal.toReal_nonneg (mul_pos ha Real.pi_pos).le + have hR : ∀ p ∈ t, p.2 ≤ B+1 := by + intro p hp + have hh := hp.2.trans (measure_mono (subset_univ _)) + rw [volume_disk_real _ hp.1.le,← ENNReal.ofReal_mul ha.le] at hh + have hh' : a*(Real.pi*p.2^2) ≤ (ν univ).toReal := by + exact (ENNReal.ofReal_le_iff_le_toReal (measure_ne_top _ _)).mp hh + have hs : p.2^2 ≤ B := (le_div_iff₀ (mul_pos ha Real.pi_pos)).mpr (by nlinarith) + nlinarith [sq_nonneg (p.2-1)] + have hweak := weak_bound_bounded_family t Prod.fst Prod.snd ν ha + (fun _ hp => hp.1) hR (fun _ hp => hp.2) + apply le_trans (measure_mono ?_) hweak + intro x hx + obtain ⟨r,hr,havg⟩ := hx + exact mem_iUnion₂.mpr ⟨(x,r),⟨hr,havg⟩,mem_ball_self hr⟩ + +/-- A countable measurable envelope, sufficiently rich for every actual disk. -/ +def rationalMaximal (ν : Measure ℂ) (x : ℂ) : ℝ≥0∞ := + ⨆ (q : ℚ) (_ : 0 < q), ν (ball x q) / volume (ball x q) + +lemma measurable_ball_mass (ν : Measure ℂ) [SFinite ν] (r : ℝ) : + Measurable (fun x : ℂ => ν (ball x r)) := by + have hm : MeasurableSet {p : ℂ × ℂ | dist p.2 p.1 < r} := + isOpen_lt (continuous_snd.dist continuous_fst) continuous_const |>.measurableSet + exact measurable_measure_prodMk_left hm + +lemma measurable_rationalMaximal (ν : Measure ℂ) [SFinite ν] : + Measurable (rationalMaximal ν) := by + unfold rationalMaximal + apply Measurable.iSup + intro q + apply Measurable.iSup + intro _ + have hd : Measurable (fun x : ℂ => volume (ball x (q:ℝ))) := by + simp only [Complex.volume_ball] + exact measurable_const + exact (measurable_ball_mass ν (q:ℝ)).div hd + +lemma weak_rationalMaximal {ν : Measure ℂ} [IsFiniteMeasure ν] {a : ℝ} (ha : 0 < a) : + volume {x | ENNReal.ofReal a < rationalMaximal ν x} ≤ + (25 / ENNReal.ofReal a) * ν univ := by + apply le_trans (measure_mono ?_) (weak_bound ha) + intro x hx + change ENNReal.ofReal a < ⨆ (q : ℚ) (_ : 0 < q), ν (ball x q) / volume (ball x q) at hx + obtain ⟨q,hh⟩ := lt_iSup_iff.mp hx + obtain ⟨hq,hh⟩ := lt_iSup_iff.mp hh + have hq' : (0:ℝ) < q := by exact_mod_cast hq + refine ⟨q,hq',?_⟩ + have hv0 : volume (ball x (q:ℝ)) ≠ 0 := by + rw [volume_disk_real _ hq'.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hq'))) + exact ((ENNReal.lt_div_iff_mul_lt (Or.inl hv0) (Or.inl measure_ball_lt_top.ne)).mp hh).le + +lemma disk_average_le_rationalMaximal (ν : Measure ℂ) (x : ℂ) {r : ℝ} (hr : 0 < r) : + ν (ball x r) / volume (ball x r) ≤ 4*rationalMaximal ν x := by + obtain ⟨q,hqr,hrq⟩ := exists_rat_btwn (show r < 2*r by linarith) + have hq : (0 : ℝ) < q := hr.trans hqr + have hqRat : (0:ℚ) < q := by exact_mod_cast hq + have hd : volume (ball x (q:ℝ)) ≤ 4*volume (ball x r) := by + rw [volume_disk_real _ hq.le,volume_disk_real _ hr.le, + ← show ENNReal.ofReal (4:ℝ) = 4 by norm_num,← ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 4)] + apply ENNReal.ofReal_le_ofReal + have hs : (q:ℝ)^2 ≤ 4*r^2 := by nlinarith + nlinarith [mul_le_mul_of_nonneg_left hs Real.pi_nonneg] + have hv0 : volume (ball x r) ≠ 0 := by + rw [volume_disk_real _ hr.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hr))) + have hvq0 : volume (ball x (q:ℝ)) ≠ 0 := by + rw [volume_disk_real _ hq.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hq))) + have hav : ν (ball x (q:ℝ)) / volume (ball x (q:ℝ)) ≤ rationalMaximal ν x := + le_iSup_of_le q (le_iSup_of_le hqRat le_rfl) + have hnum : ν (ball x r) ≤ rationalMaximal ν x * (4*volume (ball x r)) := by + calc + _ ≤ ν (ball x (q:ℝ)) := measure_mono (ball_subset_ball hqr.le) + _ ≤ rationalMaximal ν x * volume (ball x (q:ℝ)) := + (ENNReal.div_le_iff hvq0 measure_ball_lt_top.ne).mp hav + _ ≤ _ := by gcongr + apply (ENNReal.div_le_iff hv0 measure_ball_lt_top.ne).mpr + convert hnum using 1 + ring + +/-- Truncating an input below half the testing height sharpens weak type by +charging only its large values. This is the interpolation mechanism. -/ +lemma weak_split {ν η : Measure ℂ} [IsFiniteMeasure η] {a : ℝ} (ha : 0 < a) + (hsplit : ∀ x r, 0 < r → ν (ball x r) ≤ η (ball x r)+ + ENNReal.ofReal (a/2)*volume (ball x r)) : + volume {x | ENNReal.ofReal a < rationalMaximal ν x} ≤ + (25 / ENNReal.ofReal (a/2)) * η univ := by + apply le_trans (measure_mono ?_) (weak_bound (by linarith : 0 < a/2)) + intro x hx + change ENNReal.ofReal a < ⨆ (q : ℚ) (_ : 0 < q), ν (ball x q) / volume (ball x q) at hx + obtain ⟨q,hh⟩ := lt_iSup_iff.mp hx + obtain ⟨hq,hh⟩ := lt_iSup_iff.mp hh + have hq' : (0:ℝ) < q := by exact_mod_cast hq + have hv0 : volume (ball x (q:ℝ)) ≠ 0 := by + rw [volume_disk_real _ hq'.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hq'))) + have hh' := (ENNReal.lt_div_iff_mul_lt (Or.inl hv0) (Or.inl measure_ball_lt_top.ne)).mp hh + refine ⟨q,hq',?_⟩ + by_contra h + have hη : η (ball x (q:ℝ)) ≤ ENNReal.ofReal (a/2)*volume (ball x (q:ℝ)) := (lt_of_not_ge h).le + have hfull := (hsplit x q hq').trans (add_le_add hη le_rfl) + have hsum : ENNReal.ofReal (a/2)+ENNReal.ofReal (a/2) = ENNReal.ofReal a := by + rw [← ENNReal.ofReal_add (by linarith : 0 ≤ a/2) (by linarith : 0 ≤ a/2)] + congr 1 + ring + rw [← add_mul,hsum] at hfull + exact (not_lt_of_ge hfull) hh' + +lemma weak_truncated {f : ℂ → ℝ≥0∞} (hf : Measurable f) + [IsFiniteMeasure (volume.withDensity f)] {a : ℝ} (ha : 0 < a) : + volume {x | ENNReal.ofReal a < rationalMaximal (volume.withDensity f) x} ≤ + (25 / ENNReal.ofReal (a/2)) * + ∫⁻ x, {x | ENNReal.ofReal (a/2) < f x}.indicator f x := by + let H := {x | ENNReal.ofReal (a/2) < f x} + let η := volume.withDensity (H.indicator f) + have hle : η ≤ volume.withDensity f := withDensity_mono (ae_of_all _ (indicator_le_self _ _)) + have : IsFiniteMeasure η := isFiniteMeasure_of_le _ hle + have hweak := weak_split (ν := volume.withDensity f) (η := η) ha ?_ + · simpa only [η,withDensity_apply _ MeasurableSet.univ,setLIntegral_univ] using hweak + · intro x r _ + rw [withDensity_apply _ measurableSet_ball,show η = volume.withDensity (H.indicator f) from rfl, + withDensity_apply _ measurableSet_ball] + calc + _ ≤ ∫⁻ y in ball x r, H.indicator f y+ENNReal.ofReal (a/2) := by + apply lintegral_mono + intro y + dsimp only + by_cases hy : y ∈ H + · rw [indicator_of_mem hy] + exact le_add_right le_rfl + · rw [indicator_of_notMem hy,zero_add] + exact le_of_not_gt hy + _ = _ := by + rw [lintegral_add_left (hf.indicator (measurableSet_lt measurable_const hf))] + simp only [lintegral_const,Measure.restrict_apply_univ] + rfl + +end DiskMaximalTools + +open MeasureTheory Set +open scoped ENNReal NNReal +noncomputable section +namespace DiskMaximalTools + +lemma lintegral_rpow_Ioo {b s : ℝ} (hb : 0 ≤ b) (hs : -1 < s) : + (∫⁻ t in Ioo 0 b, ENNReal.ofReal (t^s)) = ENNReal.ofReal (b^(s+1)/(s+1)) := by + rcases eq_or_lt_of_le hb with rfl | hb + · simp [Real.zero_rpow (by linarith : s+1 ≠ 0)] + · have hi : IntegrableOn (fun t : ℝ => t^s) (Ioo 0 b) := + (intervalIntegral.integrableOn_Ioo_rpow_iff hb).mpr hs + rw [← ofReal_integral_eq_lintegral_ofReal hi] + · rw [← integral_Ioc_eq_integral_Ioo,← intervalIntegral.integral_of_le hb.le, + integral_rpow (Or.inl hs)] + simp [Real.zero_rpow (by linarith : s+1 ≠ 0)] + · filter_upwards [self_mem_ae_restrict measurableSet_Ioo] with t ht + exact Real.rpow_nonneg ht.1.le _ + +lemma truncation_layer_single {b p : ℝ} (hb : 0 ≤ b) (hp : 1 < p) : + (∫⁻ t in Ioi 0, (if t < 2*b then ENNReal.ofReal b else 0)*ENNReal.ofReal (t^(p-2))) = + ENNReal.ofReal (2^(p-1)/(p-1))*ENNReal.ofReal (b^p) := by + have heq : (fun t : ℝ => (if t < 2*b then ENNReal.ofReal b else 0)*ENNReal.ofReal (t^(p-2))) = + (Iio (2*b)).indicator (fun t => ENNReal.ofReal b * ENNReal.ofReal (t^(p-2))) := by + funext t + by_cases ht : t < 2*b <;> simp [ht] + rw [heq,lintegral_indicator measurableSet_Iio,Measure.restrict_restrict measurableSet_Iio] + have hi : Iio (2*b) ∩ Ioi (0:ℝ) = Ioo 0 (2*b) := by ext t; simp [and_comm] + rw [hi,lintegral_const_mul'' _ (by fun_prop)] + rw [lintegral_rpow_Ioo (by positivity : 0 ≤ 2*b) (by linarith : -1 < p-2)] + have hpp : p-2+1 = p-1 := by ring + rw [hpp] + have h2 : 0 ≤ (2:ℝ)^(p-1)/(p-1) := div_nonneg (Real.rpow_nonneg (by norm_num) _) (by linarith) + rw [← ENNReal.ofReal_mul hb,← ENNReal.ofReal_mul h2] + congr 1 + rw [Real.mul_rpow (by norm_num : (0:ℝ) ≤ 2) hb] + have hp0 : 0 < p-1 := by linarith + have hpow : b*b^(p-1) = b^p := by + rcases eq_or_lt_of_le hb with rfl | hb + · simp [Real.zero_rpow hp0.ne',Real.zero_rpow (by linarith : p ≠ 0)] + · calc + b*b^(p-1) = b^(1:ℝ)*b^(p-1) := by rw [Real.rpow_one] + _ = b^(1+(p-1)) := (Real.rpow_add hb _ _).symm + _ = b^p := by congr 1; ring + calc + b * (2^(p-1)*b^(p-1)/(p-1)) = (2^(p-1)/(p-1))*(b*b^(p-1)) := by ring + _ = _ := by rw [hpow] + +/-- Exact Tonelli computation behind strong maximal interpolation, for every +p > 1. The singularity at testing height zero is actually integrated. -/ +theorem truncation_layer_integral {α : Type*} [MeasurableSpace α] {μ : Measure α} + [SFinite μ] {f : α → ℝ} (hf : Measurable f) (hf0 : ∀ x, 0 ≤ f x) {p : ℝ} (hp : 1 < p) : + (∫⁻ t in Ioi 0, + (∫⁻ x, if t < 2*f x then ENNReal.ofReal (f x) else 0 ∂μ)*ENNReal.ofReal (t^(p-2))) = + ENNReal.ofReal (2^(p-1)/(p-1))*(∫⁻ x, ENNReal.ofReal ((f x)^p) ∂μ) := by + have hm : Measurable (fun z : ℝ × α => + (if z.1 < 2*f z.2 then ENNReal.ofReal (f z.2) else 0)*ENNReal.ofReal (z.1^(p-2))) := by + apply Measurable.mul + · exact ((hf.comp measurable_snd).ennreal_ofReal).ite + (measurableSet_lt measurable_fst ((hf.comp measurable_snd).const_mul 2)) measurable_const + · exact (measurable_fst.pow_const _).ennreal_ofReal + calc + _ = ∫⁻ t in Ioi 0, ∫⁻ x, + (if t < 2*f x then ENNReal.ofReal (f x) else 0)*ENNReal.ofReal (t^(p-2)) ∂μ := by + apply lintegral_congr + intro t + rw [lintegral_mul_const' _ _ ENNReal.ofReal_ne_top] + _ = ∫⁻ x, (∫⁻ t in Ioi 0, + (if t < 2*f x then ENNReal.ofReal (f x) else 0)*ENNReal.ofReal (t^(p-2))) ∂μ := + lintegral_lintegral_swap hm.aemeasurable + _ = ∫⁻ x, ENNReal.ofReal (2^(p-1)/(p-1))*ENNReal.ofReal ((f x)^p) ∂μ := by + apply lintegral_congr + intro x + exact truncation_layer_single (hf0 x) hp + _ = _ := lintegral_const_mul'' _ ((hf.pow_const _).ennreal_ofReal.aemeasurable) + +end DiskMaximalTools + +namespace DiskMaximalTools + +lemma maximal_layer_coefficient {t p : ℝ} (ht : 0 < t) : + (25 / ENNReal.ofReal (t/2))*ENNReal.ofReal (t^(p-1)) = + ENNReal.ofReal 50*ENNReal.ofReal (t^(p-2)) := by + rw [← show ENNReal.ofReal (25:ℝ) = 25 by norm_num, + ← ENNReal.ofReal_div_of_pos (by linarith : 0 < t/2), + ← ENNReal.ofReal_mul (by positivity : 0 ≤ (25:ℝ)/(t/2)), + ← ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 50)] + congr 1 + have hpow : t^(p-1) = t*t^(p-2) := by + calc + _ = t^(1+(p-2)) := by congr 1; ring + _ = t^(1:ℝ)*t^(p-2) := Real.rpow_add ht _ _ + _ = _ := by rw [Real.rpow_one] + rw [hpow] + field_simp + ring + +/-- A full strong p estimate from Vitali, truncation and Tonelli. No maximal +inequality is supplied as an assumption. The real representative is controlled +even before a separate almost-everywhere finiteness argument. -/ +theorem strong_rationalMaximal {f : ℂ → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) [IsFiniteMeasure (volume.withDensity (fun x => ENNReal.ofReal (f x)))] + {p : ℝ} (hp : 1 < p) : + (∫⁻ x, ENNReal.ofReal ((rationalMaximal (volume.withDensity (fun x => ENNReal.ofReal (f x))) x).toReal^p)) ≤ + ENNReal.ofReal (50*p*2^(p-1)/(p-1)) * (∫⁻ x, ENNReal.ofReal ((f x)^p)) := by + let M := rationalMaximal (volume.withDensity (fun x => ENNReal.ofReal (f x))) + have hM : Measurable M := measurable_rationalMaximal _ + have htail (t : ℝ) (ht : 0 < t) : volume {x | t < (M x).toReal} ≤ + (25/ENNReal.ofReal (t/2)) * ∫⁻ x, if t < 2*f x then ENNReal.ofReal (f x) else 0 := by + have hsub : {x | t < (M x).toReal} ⊆ {x | ENNReal.ofReal t < M x} := by + intro x hx + exact (ENNReal.ofReal_lt_ofReal_iff_of_nonneg ht.le).mpr hx |>.trans_le ENNReal.ofReal_toReal_le + apply le_trans (measure_mono hsub) + have hweak := weak_truncated hf.ennreal_ofReal ht + apply hweak.trans_eq + congr 1 + apply lintegral_congr + intro x + have heq : ENNReal.ofReal (t/2) < ENNReal.ofReal (f x) ↔ t < 2*f x := by + rw [ENNReal.ofReal_lt_ofReal_iff_of_nonneg (by linarith : 0 ≤ t/2)] + constructor <;> intro h <;> linarith + simp only [Set.indicator,Set.mem_ofPred_eq,heq] + rw [lintegral_rpow_eq_lintegral_meas_lt_mul volume (ae_of_all _ (fun _ => ENNReal.toReal_nonneg)) + hM.ennreal_toReal.aemeasurable (by linarith : 0 < p)] + have hlayer : (∫⁻ t in Ioi 0, volume {x | t < (M x).toReal}*ENNReal.ofReal (t^(p-1))) ≤ + ENNReal.ofReal 50 * (∫⁻ t in Ioi 0, + (∫⁻ x, if t < 2*f x then ENNReal.ofReal (f x) else 0)*ENNReal.ofReal (t^(p-2))) := by + calc + _ ≤ ∫⁻ t in Ioi 0, ENNReal.ofReal 50 * + ((∫⁻ x, if t < 2*f x then ENNReal.ofReal (f x) else 0)*ENNReal.ofReal (t^(p-2))) := by + apply lintegral_mono_ae + filter_upwards [self_mem_ae_restrict measurableSet_Ioi] with t ht + calc + _ ≤ ((25/ENNReal.ofReal (t/2)) * ∫⁻ x, if t < 2*f x then ENNReal.ofReal (f x) else 0)* + ENNReal.ofReal (t^(p-1)) := by gcongr; exact htail t ht + _ = _ := by + rw [mul_right_comm, maximal_layer_coefficient ht] + ring + _ = _ := lintegral_const_mul' _ _ ENNReal.ofReal_ne_top + calc + _ ≤ ENNReal.ofReal p*(ENNReal.ofReal 50 * (∫⁻ t in Ioi 0, + (∫⁻ x, if t < 2*f x then ENNReal.ofReal (f x) else 0)*ENNReal.ofReal (t^(p-2)))) := by + gcongr + _ = _ := by + rw [truncation_layer_integral hf hf0 hp] + have hc : ENNReal.ofReal p*(ENNReal.ofReal 50 * ENNReal.ofReal (2^(p-1)/(p-1))) = + ENNReal.ofReal (50*p*2^(p-1)/(p-1)) := by + rw [← ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 50), + ← ENNReal.ofReal_mul (by linarith : 0 ≤ p)] + congr 1 + ring + simpa only [mul_assoc] using congrArg + (fun c => c*(∫⁻ x, ENNReal.ofReal ((f x)^p))) hc + +end DiskMaximalTools + +namespace DiskMaximalTools + +lemma disk_average_le_rationalMaximal_exact (ν : Measure ℂ) (x : ℂ) {r : ℝ} (hr : 0 < r) : + ν (ball x r) / volume (ball x r) ≤ rationalMaximal ν x := by + let I := {q : ℚ // 0 < q ∧ (q:ℝ) < r} + have hdir : Directed (· ⊆ ·) (fun q : I => ball x (q:ℚ)) := by + intro i j + refine ⟨⟨max i.val j.val,?_,?_⟩,?_,?_⟩ + · exact lt_max_of_lt_left i.property.1 + · exact_mod_cast max_lt i.property.2 j.property.2 + · exact ball_subset_ball (by exact_mod_cast le_max_left i.val j.val) + · exact ball_subset_ball (by exact_mod_cast le_max_right i.val j.val) + have heq : (⋃ q : I, ball x (q:ℚ)) = ball x r := by + ext y + constructor + · intro hy + obtain ⟨q,hq⟩ := mem_iUnion.mp hy + exact (ball_subset_ball q.property.2.le) hq + · intro hy + have hd : dist y x < r := hy + obtain ⟨q,hq0,hqr⟩ := exists_rat_btwn (show max 0 (dist y x) < r by exact max_lt hr hd) + have hq : 0 < (q:ℝ) := lt_of_le_of_lt (le_max_left _ _) hq0 + have hqRat : (0:ℚ) < q := by exact_mod_cast hq + refine mem_iUnion.mpr ⟨⟨q,hqRat,hqr⟩,?_⟩ + exact lt_of_le_of_lt (le_max_right _ _) hq0 + have hv0 : volume (ball x r) ≠ 0 := by + rw [volume_disk_real _ hr.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hr))) + apply (ENNReal.div_le_iff hv0 measure_ball_lt_top.ne).mpr + rw [← heq,hdir.measure_iUnion] + apply iSup_le + intro q + have hq0 : 0 < (q.val:ℝ) := by exact_mod_cast q.property.1 + have hqv : volume (ball x (q.val:ℝ)) ≠ 0 := by + rw [volume_disk_real _ hq0.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hq0))) + have hav : ν (ball x (q.val:ℝ)) / volume (ball x (q.val:ℝ)) ≤ rationalMaximal ν x := + le_iSup_of_le q.val (le_iSup_of_le q.property.1 le_rfl) + calc + _ ≤ rationalMaximal ν x * volume (ball x (q.val:ℝ)) := + (ENNReal.div_le_iff hqv measure_ball_lt_top.ne).mp hav + _ ≤ _ := by + gcongr + exact subset_iUnion (fun q : I => ball x (q:ℚ)) q + +/-- Countability loses neither radii nor high values: the rational expression is +exactly the centered disk maximal function of the measure. -/ +theorem all_radii_eq_rational (ν : Measure ℂ) (x : ℂ) : + (⨆ (r : ℝ) (_ : 0 < r), ν (ball x r)/volume (ball x r)) = rationalMaximal ν x := by + apply le_antisymm + · apply iSup_le + intro r + apply iSup_le + intro hr + exact disk_average_le_rationalMaximal_exact ν x hr + · unfold rationalMaximal + apply iSup_le + intro q + apply iSup_le + intro hq + have hq' : 0 < (q:ℝ) := by exact_mod_cast hq + exact le_iSup_of_le (q:ℝ) (le_iSup_of_le hq' le_rfl) + +lemma rationalMaximal_le_of_density_le {f : ℂ → ℝ≥0∞} {B : ℝ≥0∞} (hf : ∀ x, f x ≤ B) (x : ℂ) : + rationalMaximal (volume.withDensity f) x ≤ B := by + unfold rationalMaximal + apply iSup_le + intro q + apply iSup_le + intro hq + have hq' : 0 < (q:ℝ) := by exact_mod_cast hq + have hv0 : volume (ball x (q:ℝ)) ≠ 0 := by + rw [volume_disk_real _ hq'.le] + exact ne_of_gt (ENNReal.ofReal_pos.mpr (mul_pos Real.pi_pos (sq_pos_of_pos hq'))) + apply (ENNReal.div_le_iff hv0 measure_ball_lt_top.ne).mpr + rw [withDensity_apply _ measurableSet_ball] + calc + _ ≤ ∫⁻ y in ball x (q:ℝ), B := lintegral_mono hf + _ = _ := by simp + +end DiskMaximalTools + +open MeasureTheory Set +open scoped ENNReal NNReal +noncomputable section + +end +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Model.lean b/lean/OAI/Analysis/DiskMaximal/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..f2759c6c988f9f351ce8b6df4085dc86417b8b57 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Model.lean @@ -0,0 +1,67 @@ +import Mathlib + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff + +noncomputable section +namespace CenteredDiskEndpoint + +/-- The Euclidean plane, not the product space with its max norm. -/ +abbrev Plane := EuclideanSpace ℝ (Fin 2) + +/-- Absolute disk average, retaining possible infinite values. -/ +def absoluteDiskAverage (f : Plane → ℝ) (x : Plane) (r : ℝ) : ℝ≥0∞ := + (∫⁻ y in Metric.ball x r, ENNReal.ofReal |f y|) / + ENNReal.ofReal (Real.pi * r ^ 2) + +/-- The actual centered disk maximal function, over every positive real radius. -/ +def maximal (f : Plane → ℝ) (x : Plane) : ℝ≥0∞ := + ⨆ (r : ℝ) (_ : 0 < r), absoluteDiskAverage f x r + +/-- Real representative; the endpoint also asserts that `maximal f` is finite a.e. -/ +def maximalReal (f : Plane → ℝ) (x : Plane) : ℝ := (maximal f x).toReal + +/-- The i-th coordinate derivative of a smooth test function. -/ +def testPartial (φ : Plane → ℝ) (i : Fin 2) (x : Plane) : ℝ := + fderiv ℝ φ x (EuclideanSpace.single i 1) + +/-- Distributional first derivatives represented by a vector-valued function. -/ +def HasWeakGradient (f : Plane → ℝ) (g : Plane → Plane) : Prop := + ∀ (φ : Plane → ℝ), ContDiff ℝ ∞ φ → HasCompactSupport φ → + ∀ i : Fin 2, (∫ x, f x * testPartial φ i x) = -∫ x, g x i * φ x + +/-- Local W^(1,1), expressed using the same distributional gradient convention. -/ +def InW11Loc (f : Plane → ℝ) : Prop := + LocallyIntegrable f ∧ + ∃ g : Plane → Plane, LocallyIntegrable g ∧ HasWeakGradient f g + +/-- The gradient L1 norm in Euclidean norm. -/ +def gradientNorm (g : Plane → Plane) : ℝ := ∫ x, ‖g x‖ + +/-- Exact endpoint, including finiteness before passing to the real representative. +Quantifying the input gradient makes the norm bound independent of a choice of +representative of its weak derivatives. -/ +def EndpointStatement : Prop := + ∃ C : ℝ, 0 ≤ C ∧ + ∀ (f : Plane → ℝ) (g : Plane → Plane), + Integrable f → Integrable g → HasWeakGradient f g → + (∀ᵐ x, maximal f x ≠ ⊤) ∧ + LocallyIntegrable (maximalReal f) ∧ + InW11Loc (maximalReal f) ∧ + ∃ G : Plane → Plane, Integrable G ∧ + HasWeakGradient (maximalReal f) G ∧ gradientNorm G ≤ C * gradientNorm g + +def diskAverage (f : Plane → ℝ) (x : Plane) (r : ℝ) : ℝ := + (∫ y in Metric.ball x r, f y) / (Real.pi * r ^ 2) + +/-- Real inhomogeneous W^(1,1) on the whole plane. -/ +def InW11 (f : Plane → ℝ) : Prop := + Integrable f ∧ ∃ g : Plane → Plane, Integrable g ∧ HasWeakGradient f g + +end CenteredDiskEndpoint + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Moments.lean b/lean/OAI/Analysis/DiskMaximal/Moments.lean new file mode 100644 index 0000000000000000000000000000000000000000..86a364ea14fef157839563dcc315786a51d92647 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Moments.lean @@ -0,0 +1,680 @@ +import OAI.Analysis.DiskMaximal.Geometry + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff + +noncomputable section + +namespace DiskMoments + +local instance : Fact (Module.finrank ℝ ℂ = 2) := ⟨Complex.finrank_real_complex⟩ + +def rotation (t : ℝ) : ℂ ≃ₗᵢ[ℝ] ℂ := Complex.orientation.rotation (t : Real.Angle) + +lemma rotation_apply (t : ℝ) (z : ℂ) : + rotation t z = ((Real.cos t : ℂ) + (Real.sin t : ℂ) * Complex.I) * z := by + simp only [rotation, Complex.rotation, Real.Angle.coe_toCircle, Real.Angle.cos_coe, Real.Angle.sin_coe] + +lemma rotation_zero (z : ℂ) : rotation 0 z = z := by simp [rotation_apply] + +lemma rotation_norm (t : ℝ) (z : ℂ) : ‖rotation t z‖ = ‖z‖ := + (rotation t).norm_map z + +lemma integral_rotation (g : ℂ → ℝ) (x : ℂ) (r t : ℝ) : + (∫ z in Metric.ball 0 r, g (x + rotation t z)) = + ∫ z in Metric.ball 0 r, g (x + z) := by + have hpre : (rotation t) ⁻¹' Metric.ball (0 : ℂ) r = Metric.ball 0 r := by + ext z + simp [Metric.mem_ball, dist_zero_right] + have h := (rotation t).measurePreserving.setIntegral_preimage_emb + (rotation t).toHomeomorph.measurableEmbedding (fun z => g (x + z)) (Metric.ball 0 r) + rw [hpre] at h + exact h + +lemma hasDerivAt_rotation (t : ℝ) (z : ℂ) : + HasDerivAt (fun a : ℝ => rotation a z) (Complex.I * rotation t z) t := by + simp only [rotation_apply] + convert! (((Real.hasDerivAt_cos t).ofReal_comp.add + ((Real.hasDerivAt_sin t).ofReal_comp.mul_const Complex.I )).mul_const z) using 1; try rfl + simp only [Complex.ofReal_neg] + ring_nf + simp [sub_eq_add_neg] + +/-- The circulation moment of a smooth gradient on a disk vanishes. -/ +theorem rotational_moment_zero {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (x : ℂ) (r : ℝ) : + (∫ z in Metric.ball 0 r, (fderiv ℝ g (x + z)) (Complex.I * z)) = 0 := by + let F : ℝ → ℂ → ℝ := fun t z => g (x + rotation t z) + let F' : ℝ → ℂ → ℝ := fun t z => + (fderiv ℝ g (x + rotation t z)) (Complex.I * rotation t z) + have hdc : Continuous (fderiv ℝ g) := hg.continuous_fderiv one_ne_zero + obtain ⟨C, hC⟩ := (isCompact_closedBall x r).exists_bound_of_continuousOn hdc.continuousOn + have hFm (t : ℝ) : Continuous (F t) := hg.continuous.comp (by fun_prop) + have hF'm (t : ℝ) : Continuous (F' t) := by + unfold F' + exact (hdc.comp (by fun_prop)).clm_apply (by fun_prop) + have hFi : IntegrableOn (F 0) (Metric.ball 0 r) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 r) (hFm 0).continuousOn).mono_set + Metric.ball_subset_closedBall + have hdiff (z : ℂ) (t : ℝ) : HasDerivAt (fun t => F t z) (F' t z) t := by + exact ((hg.differentiable one_ne_zero).differentiableAt.hasFDerivAt.comp_hasDerivAt t + ((hasDerivAt_rotation t z).const_add x)) + have hbound : ∀ᵐ z ∂volume.restrict (Metric.ball (0 : ℂ) r), ∀ t ∈ (univ : Set ℝ), + ‖F' t z‖ ≤ max C 0 * r := by + filter_upwards [ae_restrict_mem measurableSet_ball] with z hz t _ + have hz' : ‖z‖ ≤ r := by simpa [Metric.mem_ball, dist_zero_right] using (show ‖z‖ < r by simpa [Metric.mem_ball, dist_zero_right] using hz).le + have hpos : x + rotation t z ∈ Metric.closedBall x r := by + simpa [Metric.mem_closedBall, dist_eq_norm, rotation_norm] using hz' + exact ((fderiv ℝ g (x + rotation t z)).le_opNorm _).trans + (mul_le_mul ((hC _ hpos).trans (le_max_left _ _)) + (by simpa [norm_mul, rotation_norm] using hz') (norm_nonneg _) (le_max_right _ _)) + have hb : IntegrableOn (fun _ : ℂ => max C 0 * r) (Metric.ball 0 r) := by + exact integrableOn_const (by finiteness) + have hd := (hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := volume.restrict (Metric.ball (0 : ℂ) r)) + (x₀ := (0 : ℝ)) (s := univ) (F := F) (F' := F') (bound := fun _ => max C 0 * r) + Filter.univ_mem (Filter.Eventually.of_forall (fun t => (hFm t).aestronglyMeasurable)) + hFi (hF'm 0).aestronglyMeasurable hbound hb + (Filter.Eventually.of_forall (fun z t _ => hdiff z t))).2 + have hconst : (fun t => ∫ z in Metric.ball 0 r, F t z) = + fun _ => ∫ z in Metric.ball 0 r, g (x + z) := by + funext t + exact integral_rotation g x r t + rw [hconst] at hd + have he := hd.unique (hasDerivAt_const 0 (∫ z in Metric.ball 0 r, g (x + z))) + simpa only [F', rotation_zero] using he + +lemma integral_translate_ball {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : ℂ → E) (x : ℂ) (r : ℝ) : + (∫ z in Metric.ball 0 r, f (x + z)) = ∫ y in Metric.ball x r, f y := by + have hpre : (fun z : ℂ => x + z) ⁻¹' Metric.ball x r = Metric.ball 0 r := by + ext z + simp [Metric.mem_ball, dist_eq_norm] + have h := (measurePreserving_add_left volume x).setIntegral_preimage_emb + (Homeomorph.addLeft x).measurableEmbedding f (Metric.ball x r) + rwa [hpre] at h + +lemma continuous_gradient {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) : + Continuous (gradient g) := + (InnerProductSpace.toDual ℝ ℂ).symm.continuous.comp (hg.continuous_fderiv one_ne_zero) + +lemma real_moment_integrand (g : ℂ → ℝ) (x z : ℂ) : + (star z * gradient g x).re = (fderiv ℝ g x) z := by + rw [← inner_gradient_left, Complex.inner] + simp [mul_comm] + +lemma imaginary_moment_integrand (g : ℂ → ℝ) (x z : ℂ) : + (star z * gradient g x).im = (fderiv ℝ g x) (Complex.I * z) := by + rw [← inner_gradient_left, Complex.inner] + simp [Complex.mul_re, Complex.mul_im] + ring + +/-- The imaginary part of the actual complex disk moment is zero. -/ +theorem imaginary_moment_zero {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (x : ℂ) (r : ℝ) : + (∫ y in Metric.ball x r, star (y - x) * gradient g y).im = 0 := by + have ht := (integral_translate_ball (fun y => star (y-x) * gradient g y) x r).symm + rw [ht] + have hi : IntegrableOn (fun z => star ((x+z)-x) * gradient g (x+z)) (Metric.ball 0 r) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 r) + ((by fun_prop : Continuous (fun z : ℂ => star ((x+z)-x))).mul + ((continuous_gradient hg).comp (by fun_prop))).continuousOn).mono_set + Metric.ball_subset_closedBall + change Complex.imCLM (∫ z in Metric.ball 0 r, star ((x+z)-x) * gradient g (x+z)) = 0 + rw [← Complex.imCLM.integral_comp_comm hi] + convert rotational_moment_zero hg x r using 1 + congr 1 + funext z + simpa using imaginary_moment_integrand g (x+z) z + +/-- Differentiate a disk average on its fixed unit-disk model. -/ +theorem hasDerivAt_integral_unitDisk {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (x : ℂ) (t : ℝ) : + HasDerivAt (fun s : ℝ => ∫ z in Metric.ball (0 : ℂ) 1, g (x + s • z)) + (∫ z in Metric.ball (0 : ℂ) 1, (fderiv ℝ g (x + t • z)) z) t := by + let F : ℝ → ℂ → ℝ := fun s z => g (x + s • z) + let F' : ℝ → ℂ → ℝ := fun s z => (fderiv ℝ g (x + s • z)) z + have hdc : Continuous (fderiv ℝ g) := hg.continuous_fderiv one_ne_zero + obtain ⟨C, hC⟩ := (isCompact_closedBall x (|t|+1)).exists_bound_of_continuousOn hdc.continuousOn + have hFm (s : ℝ) : Continuous (F s) := hg.continuous.comp (by fun_prop) + have hF'm (s : ℝ) : Continuous (F' s) := by + unfold F' + exact (hdc.comp (by fun_prop)).clm_apply continuous_id + have hFi : IntegrableOn (F t) (Metric.ball 0 1) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) (hFm t).continuousOn).mono_set + Metric.ball_subset_closedBall + have hdiff (z : ℂ) (s : ℝ) : HasDerivAt (fun s => F s z) (F' s z) s := by + convert! ((hg.differentiable one_ne_zero).differentiableAt.hasFDerivAt.comp_hasDerivAt s + (((hasDerivAt_id s).smul_const z).const_add x)) using 1 + simp [F', id_eq] + have hbound : ∀ᵐ z ∂volume.restrict (Metric.ball (0 : ℂ) 1), + ∀ s ∈ Metric.ball t 1, ‖F' s z‖ ≤ max C 0 := by + filter_upwards [ae_restrict_mem measurableSet_ball] with z hz s hs + have hz' : ‖z‖ ≤ 1 := by simpa [Metric.mem_ball, dist_zero_right] using + (show ‖z‖ < 1 by simpa [Metric.mem_ball, dist_zero_right] using hz).le + have hs' : |s| ≤ |t| + 1 := by + have hh : |s-t| < 1 := by simpa [Metric.mem_ball, Real.dist_eq] using hs + have hh' := abs_add_le (s-t) t + rw [sub_add_cancel] at hh' + linarith + have hpos : x + s • z ∈ Metric.closedBall x (|t|+1) := by + simp only [Metric.mem_closedBall, dist_eq_norm, add_sub_cancel_left, norm_smul, Real.norm_eq_abs] + exact (mul_le_mul_of_nonneg_left hz' (abs_nonneg s)).trans (by simpa using hs') + exact ((fderiv ℝ g (x+s•z)).le_opNorm _).trans + (by simpa only [mul_one] using (mul_le_mul ((hC _ hpos).trans (le_max_left C 0)) hz' + (norm_nonneg _) (le_max_right C 0))) + exact (hasDerivAt_integral_of_dominated_loc_of_deriv_le (μ := volume.restrict (Metric.ball (0 : ℂ) 1)) + (x₀ := t) (s := Metric.ball t 1) (F := F) (F' := F') (bound := fun _ => max C 0) + (Metric.ball_mem_nhds _ zero_lt_one) (Filter.Eventually.of_forall (fun s => (hFm s).aestronglyMeasurable)) + hFi (hF'm t).aestronglyMeasurable hbound (integrableOn_const (by finiteness)) + (Filter.Eventually.of_forall (fun z s _ => hdiff z s))).2 + +lemma integral_scale_ball {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (f : ℂ → E) {t : ℝ} (ht : 0 < t) : + (∫ z in Metric.ball (0 : ℂ) 1, f (t • z)) = + (t^2)⁻¹ • ∫ z in Metric.ball (0 : ℂ) t, f z := by + convert Measure.setIntegral_comp_smul_of_pos volume f (Metric.ball 0 1) ht using 1 + rw [Complex.finrank_real_complex, smul_ball ht.ne', smul_zero, Real.norm_eq_abs, abs_of_pos ht, mul_one] + +/-- Signed normalized average on a centered Euclidean disk in the complex plane. -/ +def signedAverage (g : ℂ → ℝ) (x : ℂ) (t : ℝ) : ℝ := + (∫ y in Metric.ball x t, g y) / (Real.pi * t^2) + +lemma signedAverage_fixedDomain (g : ℂ → ℝ) (x : ℂ) {t : ℝ} (ht : 0 < t) : + signedAverage g x t = (∫ z in Metric.ball (0 : ℂ) 1, g (x + t • z)) / Real.pi := by + rw [integral_scale_ball (fun z => g (x+z)) ht, integral_translate_ball] + simp only [signedAverage, smul_eq_mul] + ring + +lemma integral_fderiv_scale (g : ℂ → ℝ) (x : ℂ) {t : ℝ} (ht : 0 < t) : + (∫ z in Metric.ball (0 : ℂ) 1, (fderiv ℝ g (x+t•z)) z) = + (t^3)⁻¹ * ∫ y in Metric.ball x t, (fderiv ℝ g y) (y-x) := by + have hi (z : ℂ) : (fderiv ℝ g (x+t•z)) z = + t⁻¹ * (fderiv ℝ g (x+t•z)) (t•z) := by + rw [map_smul, smul_eq_mul, ← mul_assoc, inv_mul_cancel₀ ht.ne', one_mul] + simp_rw [hi] + rw [integral_const_mul, integral_scale_ball (fun z => (fderiv ℝ g (x+z)) z) ht] + have hh : (∫ z in Metric.ball (0 : ℂ) t, (fderiv ℝ g (x+z)) z) = + ∫ y in Metric.ball x t, (fderiv ℝ g y) (y-x) := by + simpa using integral_translate_ball (fun y => (fderiv ℝ g y) (y-x)) x t + rw [hh] + simp only [smul_eq_mul] + ring + +lemma integral_fderiv_moment_real {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) (t : ℝ) : + (∫ y in Metric.ball x t, (fderiv ℝ g y) (y-x)) = + (∫ y in Metric.ball x t, star (y-x) * gradient g y).re := by + have hi : IntegrableOn (fun y => star (y-x) * gradient g y) (Metric.ball x t) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall x t) + ((by fun_prop : Continuous (fun y : ℂ => star (y-x))).mul + (continuous_gradient hg)).continuousOn).mono_set Metric.ball_subset_closedBall + change _ = Complex.reCLM _ + rw [← Complex.reCLM.integral_comp_comm hi] + congr 1 + funext y + exact (real_moment_integrand g y (y-x)).symm + +/-- The radial disk derivative is the real part of its complex moment. -/ +theorem hasDerivAt_signedAverage {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (x : ℂ) {t : ℝ} (ht : 0 < t) : + HasDerivAt (signedAverage g x) + ((∫ y in Metric.ball x t, star (y-x) * gradient g y).re / (Real.pi * t^3)) t := by + have hd := (hasDerivAt_integral_unitDisk hg x t).div_const Real.pi + rw [integral_fderiv_scale g x ht, integral_fderiv_moment_real hg x t] at hd + have he : (fun s => (∫ z in Metric.ball (0 : ℂ) 1, g (x+s•z)) / Real.pi) + =ᶠ[𝓝 t] signedAverage g x := by + filter_upwards [eventually_gt_nhds ht] with s hs + exact (signedAverage_fixedDomain g x hs).symm + convert! hd.congr_of_eventuallyEq he.symm using 1; try rfl + ring + +lemma ball_ae_closedBall (x : ℂ) (r : ℝ) : + Metric.ball x r =ᵐ[volume] Metric.closedBall x r := by + apply ae_eq_of_subset_of_measure_ge Metric.ball_subset_closedBall + · exact (Measure.addHaar_closedBall_eq_addHaar_ball volume x r).le + · exact measurableSet_ball.nullMeasurableSet + · exact measure_closedBall_lt_top.ne + +lemma continuous_integral_fderiv_unit {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) : + Continuous (fun t : ℝ => ∫ z in Metric.ball (0 : ℂ) 1, (fderiv ℝ g (x+t•z)) z) := by + have he (t : ℝ) : (∫ z in Metric.ball (0 : ℂ) 1, (fderiv ℝ g (x+t•z)) z) = + ∫ z in Metric.closedBall (0 : ℂ) 1, (fderiv ℝ g (x+t•z)) z := + setIntegral_congr_set (ball_ae_closedBall 0 1) + simp_rw [he] + apply continuous_parametric_integral_of_continuous _ (isCompact_closedBall 0 1) + exact ((hg.continuous_fderiv one_ne_zero).comp (by fun_prop)).clm_apply continuous_snd + +end DiskMoments + +open MeasureTheory Set Filter +open scoped Topology Interval NNReal + +noncomputable section +namespace DiskKernels + +/-- An ordinary nonnegative probability density supported on a radius interval. -/ +structure RadiusDensity (a b : ℝ) (M : ℝ≥0) where + toFun : ℝ → ℝ + integrable : Integrable toFun + nonneg : ∀ t, 0 ≤ toFun t + integral_one : ∫ t, toFun t = 1 + bound : ∀ t, toFun t ≤ M + support : ∀ t, t ∉ Icc a b → toFun t = 0 + +instance {a b : ℝ} {M : ℝ≥0} : CoeFun (RadiusDensity a b M) (fun _ => ℝ → ℝ) := + ⟨RadiusDensity.toFun⟩ + +def tail {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (u : ℝ) : ℝ := + ∫ t in Ioi u, k t + +lemma tail_nonneg {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (u : ℝ) : + 0 ≤ tail k u := integral_nonneg k.nonneg + +lemma tail_le_one {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (u : ℝ) : + tail k u ≤ 1 := by + rw [← k.integral_one] + exact setIntegral_le_integral k.integrable (Eventually.of_forall k.nonneg) + +lemma tail_one {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) {u : ℝ} (hu : u < a) : + tail k u = 1 := by + rw [tail, setIntegral_eq_integral_of_forall_compl_eq_zero, k.integral_one] + intro t ht + apply k.support + simp only [mem_Ioi, not_lt] at ht + intro h + linarith [h.1] + +lemma tail_zero {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) {u : ℝ} (hu : b ≤ u) : + tail k u = 0 := by + apply integral_eq_zero_of_ae + filter_upwards [ae_restrict_mem measurableSet_Ioi] with t ht + apply k.support + intro h + have := ht + simp only [mem_Ioi] at this + linarith [h.2] + +lemma tail_lipschitz {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) : + LipschitzWith M (tail k) := by + apply LipschitzWith.of_dist_le_mul + intro u v + rw [Real.dist_eq, ← Real.norm_eq_abs, tail, tail, + intervalIntegral.integral_Ioi_sub_Ioi' k.integrable.integrableOn k.integrable.integrableOn] + have h := intervalIntegral.norm_integral_le_of_norm_le_const + (a := u) (b := v) (f := k) (C := (M : ℝ)) (fun t _ => by + rw [Real.norm_eq_abs, abs_of_nonneg (k.nonneg t)] + exact k.bound t) + simpa only [Real.dist_eq, abs_sub_comm v u] using h + +def kernel {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x y : ℂ) : ℝ := + tail k (dist y x) + +lemma kernel_lipschitz {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x : ℂ) : + LipschitzWith M (kernel k x) := by + apply LipschitzWith.of_dist_le_mul + intro y z + exact ((tail_lipschitz k).dist_le_mul (dist y x) (dist z x)).trans + (mul_le_mul_of_nonneg_left (dist_dist_dist_le_left y z x) M.coe_nonneg) + +lemma kernel_one {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x : ℂ) + {y : ℂ} (hy : y ∈ Metric.ball x a) : kernel k x y = 1 := tail_one k hy + +lemma kernel_zero {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x : ℂ) + {y : ℂ} (hy : y ∉ Metric.ball x b) : kernel k x y = 0 := + tail_zero k (not_lt.mp hy) + +/-- The radial tail is exactly the positive average of disk indicators. -/ +lemma kernel_eq_integral {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x y : ℂ) : + kernel k x y = ∫ t, k t * (Metric.ball x t).indicator (fun _ => (1 : ℝ)) y := by + rw [kernel, tail, ← integral_indicator measurableSet_Ioi] + congr 1 + funext t + by_cases ht : dist y x < t + · simp [Set.indicator_of_mem, ht, Metric.mem_ball] + · simp [Set.indicator_of_notMem, ht, Metric.mem_ball] + +/-- Convex combinations preserve all density and support bounds. -/ +def mix {a b : ℝ} {M : ℝ≥0} (k l : RadiusDensity a b M) + (w : ℝ) (hw0 : 0 ≤ w) (hw1 : w ≤ 1) : RadiusDensity a b M where + toFun t := w * k t + (1-w) * l t + integrable := (k.integrable.const_mul w).add (l.integrable.const_mul (1-w)) + nonneg t := add_nonneg (mul_nonneg hw0 (k.nonneg t)) (mul_nonneg (sub_nonneg.mpr hw1) (l.nonneg t)) + integral_one := by + rw [integral_add (k.integrable.const_mul w) (l.integrable.const_mul (1-w)), + integral_const_mul, integral_const_mul, k.integral_one, l.integral_one] + ring + bound t := by + have h₁ := mul_le_mul_of_nonneg_left (k.bound t) hw0 + have h₂ := mul_le_mul_of_nonneg_left (l.bound t) (sub_nonneg.mpr hw1) + nlinarith + support t ht := by rw [k.support t ht, l.support t ht]; ring + +/-- Two oppositely signed moments admit an explicit convex zero. -/ +lemma convex_zero {A B : ℝ} (hA : 0 ≤ A) (hB : B ≤ 0) : + ∃ w : ℝ, 0 ≤ w ∧ w ≤ 1 ∧ w*A+(1-w)*B = 0 := by + by_cases h : A-B=0 + · refine ⟨1, zero_le_one, le_rfl, ?_⟩ + have : A = 0 := by linarith + simp [this] + · have hp : 0 < A-B := lt_of_le_of_ne (by linarith) (Ne.symm h) + refine ⟨-B/(A-B), div_nonneg (neg_nonneg.mpr hB) hp.le, ?_, ?_⟩ + · apply (div_le_one hp).mpr + linarith + · field_simp + ring + +def inverseCube (t : ℝ) : ℝ := (t^3)⁻¹ + +def cubeMass (a b : ℝ) : ℝ := ∫ t in Icc a b, inverseCube t + +lemma inverseCube_bounds {t : ℝ} (ht : t ∈ Icc ((1 : ℝ)/2) 3) : + (1 : ℝ)/27 ≤ inverseCube t ∧ inverseCube t ≤ 8 := by + have ht0 : 0 < t := by linarith [ht.1] + have hl : (1 : ℝ)/8 ≤ t^3 := by + have := pow_le_pow_left₀ (by norm_num : (0 : ℝ) ≤ 1/2) ht.1 3 + norm_num at this + exact this + have hu : t^3 ≤ 27 := by + have := pow_le_pow_left₀ ht0.le ht.2 3 + norm_num at this + exact this + constructor + · simpa [inverseCube, one_div] using one_div_le_one_div_of_le (pow_pos ht0 3) hu + · simpa [inverseCube, one_div] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 1/8) hl + +lemma continuousOn_inverseCube {a b : ℝ} (ha : 0 < a) : + ContinuousOn inverseCube (Icc a b) := by + apply (continuous_id.pow 3).continuousOn.inv₀ + intro t ht + exact pow_ne_zero 3 (ne_of_gt (lt_of_lt_of_le ha ht.1)) + +lemma cubeMass_lower {a b : ℝ} (ha : (1 : ℝ)/2 ≤ a) (hb : b ≤ 3) : + (b-a)/27 ≤ cubeMass a b := by + by_cases hab : a ≤ b + · have hi := (continuousOn_inverseCube (b := b) (show 0 < a by linarith)).integrableOn_Icc (μ := volume) + have h := setIntegral_mono_on (f := fun _ : ℝ => (1 : ℝ)/27) + (integrableOn_const isCompact_Icc.measure_ne_top) hi measurableSet_Icc + (fun t ht => (inverseCube_bounds ⟨ha.trans ht.1, ht.2.trans hb⟩).1) + simp only [setIntegral_const, measureReal_def, Real.volume_Icc, + ENNReal.toReal_ofReal (sub_nonneg.mpr hab), smul_eq_mul] at h + simpa only [cubeMass, div_eq_mul_inv, one_mul] using h + · have he : Icc a b = ∅ := Icc_eq_empty hab + have hx : cubeMass a b = 0 := by simp [cubeMass, he] + rw [hx] + exact div_nonpos_of_nonpos_of_nonneg (sub_nonpos.mpr (le_of_not_ge hab)) (by norm_num) + +lemma cubeMass_pos {a b : ℝ} (ha : (1 : ℝ)/2 ≤ a) (hb : b ≤ 3) (hab : a < b) : + 0 < cubeMass a b := (div_pos (sub_pos.mpr hab) (by norm_num)).trans_le (cubeMass_lower ha hb) + +def cubeDensity (a b t : ℝ) : ℝ := + (Icc a b).indicator (fun t => inverseCube t / cubeMass a b) t + +lemma cubeDensity_integrable {a b : ℝ} (ha : 0 < a) : Integrable (cubeDensity a b) := + ((continuousOn_inverseCube ha).div_const (cubeMass a b)).integrableOn_Icc.integrable_indicator + measurableSet_Icc + +lemma cubeDensity_integral {a b : ℝ} (ha : (1 : ℝ)/2 ≤ a) (hb : b ≤ 3) (hab : a < b) : + (∫ t, cubeDensity a b t) = 1 := by + simp only [cubeDensity] + rw [integral_indicator measurableSet_Icc, integral_div, ← cubeMass, + div_self (cubeMass_pos ha hb hab).ne'] + +lemma cubeDensity_nonneg {a b : ℝ} (ha : (1 : ℝ)/2 ≤ a) (hb : b ≤ 3) (hab : a < b) + (t : ℝ) : 0 ≤ cubeDensity a b t := by + apply Set.indicator_nonneg + intro t ht + exact div_nonneg ((by norm_num : (0 : ℝ) ≤ 1/27).trans + (inverseCube_bounds ⟨ha.trans ht.1, ht.2.trans hb⟩).1) (cubeMass_pos ha hb hab).le + +lemma cubeDensity_bound {a b : ℝ} (ha : (1 : ℝ)/2 ≤ a) (hb : b ≤ 3) (hab : a < b) + (t : ℝ) : cubeDensity a b t ≤ 216/(b-a) := by + by_cases ht : t ∈ Icc a b + · rw [cubeDensity, Set.indicator_of_mem ht] + have hM := cubeMass_pos ha hb hab + have hl := cubeMass_lower ha hb + have hbnd := (inverseCube_bounds ⟨ha.trans ht.1, ht.2.trans hb⟩).2 + apply (div_le_iff₀ hM).mpr + have hD : 0 < b-a := sub_pos.mpr hab + have hl' : 8 ≤ 216/(b-a) * cubeMass a b := by + rw [div_mul_eq_mul_div] + apply (le_div_iff₀ hD).mpr + linarith + exact hbnd.trans hl' + · simp only [cubeDensity, Set.indicator_of_notMem ht] + positivity + +/-- The concrete normalized inverse-cube density, with an absolute width bound. -/ +def inverseCubeDensity (a b : ℝ) (ha : (1 : ℝ)/2 ≤ a) (hb : b ≤ 3) (hab : a < b) : + RadiusDensity a b ⟨216/(b-a), by positivity⟩ where + toFun := cubeDensity a b + integrable := cubeDensity_integrable (by linarith) + nonneg := cubeDensity_nonneg ha hb hab + integral_one := cubeDensity_integral ha hb hab + bound := cubeDensity_bound ha hb hab + support t ht := Set.indicator_of_notMem ht _ + +def enlarge {a b a' b' : ℝ} {M N : ℝ≥0} (k : RadiusDensity a b M) + (ha : a' ≤ a) (hb : b ≤ b') (hM : M ≤ N) : RadiusDensity a' b' N where + toFun := k + integrable := k.integrable + nonneg := k.nonneg + integral_one := k.integral_one + bound t := (k.bound t).trans hM + support t ht := k.support t (fun h => ht ⟨ha.trans h.1, h.2.trans hb⟩) + +/-- Fubini identifies a radial kernel pairing with the average of disk pairings. -/ +theorem kernel_pairing {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] + {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x : ℂ) + {f : ℂ → E} (hf : Integrable f) : + (∫ y, kernel k x y • f y) = ∫ t, k t • ∫ y in Metric.ball x t, f y := by + let A : Set (ℝ × ℂ) := {p | dist p.2 x < p.1} + have hA : MeasurableSet A := measurableSet_lt (by fun_prop) measurable_fst + let F : ℝ × ℂ → E := A.indicator (fun p => k p.1 • f p.2) + have hF : Integrable F (volume.prod volume) := (k.integrable.smul_prod hf).indicator hA + have hleft (t : ℝ) : (∫ y, F (t,y)) = k t • ∫ y in Metric.ball x t, f y := by + have he : (fun y => F (t,y)) = fun y => k t • (Metric.ball x t).indicator f y := by + funext y + by_cases h : dist y x < t + · simp [F, A, Metric.mem_ball, h] + · simp [F, A, Metric.mem_ball, h] + rw [he, integral_smul, integral_indicator measurableSet_ball] + have hright (y : ℂ) : (∫ t, F (t,y)) = kernel k x y • f y := by + have he : (fun t => F (t,y)) = fun t => (Ioi (dist y x)).indicator k t • f y := by + funext t + by_cases h : dist y x < t + · simp [F, A, h] + · simp [F, A, h] + rw [he, integral_smul_const, integral_indicator measurableSet_Ioi] + rfl + have hh := integral_integral_swap (f := fun t y => F (t,y)) hF + simp_rw [hleft, hright] at hh + exact hh.symm + +end DiskKernels + +namespace DiskMoments +open DiskKernels + +def moment (g : ℂ → ℝ) (x : ℂ) (t : ℝ) : ℂ := + ∫ y in Metric.ball x t, star (y-x) * gradient g y + +def radialDerivative (g : ℂ → ℝ) (x : ℂ) (t : ℝ) : ℝ := + (∫ z in Metric.ball (0 : ℂ) 1, (fderiv ℝ g (x+t•z)) z) / Real.pi + +lemma continuous_radialDerivative {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) : + Continuous (radialDerivative g x) := (continuous_integral_fderiv_unit hg x).div_const Real.pi + +lemma moment_coefficient {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) + {t : ℝ} (ht : 0 < t) : (moment g x t).re / (Real.pi * t^3) = radialDerivative g x t := by + rw [radialDerivative, integral_fderiv_scale g x ht, integral_fderiv_moment_real hg] + simp only [moment] + ring + +lemma hasDerivAt_signedAverage_fixed {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (x : ℂ) {t : ℝ} (ht : 0 < t) : + HasDerivAt (signedAverage g x) (radialDerivative g x t) t := by + rw [← moment_coefficient hg x ht] + exact hasDerivAt_signedAverage hg x ht + +lemma moment_eq {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) + {t : ℝ} (ht : 0 < t) : + moment g x t = ((Real.pi * t^3 * radialDerivative g x t : ℝ) : ℂ) := by + apply Complex.ext + · simp only [Complex.ofReal_re] + have hh := moment_coefficient hg x ht + have hp : Real.pi * t^3 ≠ 0 := mul_ne_zero Real.pi_ne_zero (pow_ne_zero 3 ht.ne') + exact (div_eq_iff hp).mp hh |>.trans (mul_comm _ _) + · simpa only [moment, Complex.ofReal_im] using imaginary_moment_zero hg x t + +lemma integral_radialDerivative {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) + {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + (∫ t in Icc a b, radialDerivative g x t) = signedAverage g x b - signedAverage g x a := by + rw [integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le hab] + apply intervalIntegral.integral_eq_sub_of_hasDerivAt _ ((continuous_radialDerivative hg x).intervalIntegrable a b) + intro t ht + rw [uIcc_of_le hab] at ht + exact hasDerivAt_signedAverage_fixed hg x (lt_of_lt_of_le ha ht.1) + +lemma cubeDensity_moment_integrable {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) + {a b : ℝ} (ha : 0 < a) : + Integrable (fun t => cubeDensity a b t • moment g x t) := by + have he : (fun t => cubeDensity a b t • moment g x t) = + (Icc a b).indicator (fun t => + (((Real.pi / cubeMass a b) * radialDerivative g x t : ℝ) : ℂ)) := by + funext t + by_cases ht : t ∈ Icc a b + · have ht0 := lt_of_lt_of_le ha ht.1 + rw [cubeDensity, Set.indicator_of_mem ht, Set.indicator_of_mem ht, moment_eq hg x ht0] + apply Complex.ext <;> simp only [Complex.smul_re, Complex.smul_im, Complex.ofReal_re, + Complex.ofReal_im, smul_eq_mul, mul_zero] + simp only [inverseCube] + field_simp + · simp [cubeDensity, Set.indicator_of_notMem ht] + rw [he] + exact (Complex.continuous_ofReal.comp ((continuous_radialDerivative hg x).const_mul _)).continuousOn.integrableOn_Icc.integrable_indicator measurableSet_Icc + +lemma cubeDensity_moment_integral {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) + {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + (∫ t, cubeDensity a b t • moment g x t) = + (((Real.pi / cubeMass a b) * (signedAverage g x b - signedAverage g x a) : ℝ) : ℂ) := by + have he : (fun t => cubeDensity a b t • moment g x t) = + (Icc a b).indicator (fun t => + (((Real.pi / cubeMass a b) * radialDerivative g x t : ℝ) : ℂ)) := by + funext t + by_cases ht : t ∈ Icc a b + · have ht0 := lt_of_lt_of_le ha ht.1 + rw [cubeDensity, Set.indicator_of_mem ht, Set.indicator_of_mem ht, moment_eq hg x ht0] + apply Complex.ext <;> simp only [Complex.smul_re, Complex.smul_im, Complex.ofReal_re, + Complex.ofReal_im, smul_eq_mul, mul_zero] + simp only [inverseCube] + field_simp + · simp [cubeDensity, Set.indicator_of_notMem ht] + rw [he, integral_indicator measurableSet_Icc] + change (∫ t in Icc a b, Complex.ofRealCLM ((Real.pi / cubeMass a b) * radialDerivative g x t)) = _ + rw [Complex.ofRealCLM.integral_comp_comm + ((continuous_radialDerivative hg x).const_mul _).continuousOn.integrableOn_Icc, + integral_const_mul, integral_radialDerivative hg x ha hab] + rfl + +lemma gradient_hasCompactSupport {g : ℂ → ℝ} (hc : HasCompactSupport g) : + HasCompactSupport (gradient g) := (hc.fderiv ℝ).comp_left (map_zero _) + +lemma moment_density_integrable {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) (x : ℂ) : + Integrable (fun y => star (y-x) * gradient g y) := + ((by fun_prop : Continuous (fun y : ℂ => star (y-x))).mul (continuous_gradient hg)).integrable_of_hasCompactSupport + (gradient_hasCompactSupport hc).mul_left + +end DiskMoments + +namespace DiskKernels + +/-- Only integrability over the largest supporting disk is required. -/ +theorem kernel_pairing_local {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + [CompleteSpace E] {a b : ℝ} {M : ℝ≥0} (k : RadiusDensity a b M) (x : ℂ) + {f : ℂ → E} (hf : IntegrableOn f (Metric.ball x b)) : + (∫ y, kernel k x y • f y) = ∫ t, k t • ∫ y in Metric.ball x t, f y := by + have hh := kernel_pairing k x (hf.integrable_indicator measurableSet_ball) + have hleft : (fun y => kernel k x y • (Metric.ball x b).indicator f y) = + fun y => kernel k x y • f y := by + funext y + by_cases hy : y ∈ Metric.ball x b + · rw [Set.indicator_of_mem hy] + · rw [Set.indicator_of_notMem hy, kernel_zero k x hy, zero_smul, zero_smul] + rw [hleft] at hh + rw [hh] + apply integral_congr_ae + filter_upwards with t + by_cases ht : t ∈ Icc a b + · congr 1 + apply setIntegral_congr_fun measurableSet_ball + intro y hy + exact Set.indicator_of_mem (show y ∈ Metric.ball x b from lt_of_lt_of_le hy ht.2) f + · rw [k.support t ht, zero_smul, zero_smul] + +end DiskKernels + +namespace DiskMoments +open DiskKernels + +/-- A faithful balanced disk-mixture kernel, with an explicit absolute bound. -/ +theorem balanced_kernel {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (x : ℂ) + {r δ : ℝ} (hr : r ∈ Icc (1 : ℝ) 2) (hδ : 0 < δ) (hδ' : δ ≤ 1/4) + (hm : signedAverage g x (r-δ) ≤ signedAverage g x r) + (hp : signedAverage g x (r+δ) ≤ signedAverage g x r) : + ∃ k : RadiusDensity (r-δ) (r+δ) ⟨216/δ, by positivity⟩, + (∫ y, kernel k x y • (star (y-x) * gradient g y)) = 0 := by + have ha : (1 : ℝ)/2 ≤ r-δ := by linarith [hr.1] + have hb : r+δ ≤ (3 : ℝ) := by linarith [hr.2] + have hrh : (1 : ℝ)/2 ≤ r := by linarith [hr.1] + have hrb : r ≤ (3 : ℝ) := by linarith [hr.2] + have hmr : r-δ < r := by linarith + have hpr : r < r+δ := by linarith + let km : RadiusDensity (r-δ) (r+δ) ⟨216/δ, by positivity⟩ := + enlarge (inverseCubeDensity (r-δ) r ha hrb hmr) le_rfl hpr.le (by + change 216/(r-(r-δ)) ≤ 216/δ + simp) + let kp : RadiusDensity (r-δ) (r+δ) ⟨216/δ, by positivity⟩ := + enlarge (inverseCubeDensity r (r+δ) hrh hb hpr) hmr.le le_rfl (by + change 216/(r+δ-r) ≤ 216/δ + simp) + let A := Real.pi / cubeMass (r-δ) r * (signedAverage g x r - signedAverage g x (r-δ)) + let B := Real.pi / cubeMass r (r+δ) * (signedAverage g x (r+δ) - signedAverage g x r) + have hA : 0 ≤ A := mul_nonneg (div_nonneg Real.pi_pos.le (cubeMass_pos ha hrb hmr).le) + (sub_nonneg.mpr hm) + have hB : B ≤ 0 := mul_nonpos_of_nonneg_of_nonpos + (div_nonneg Real.pi_pos.le (cubeMass_pos hrh hb hpr).le) (sub_nonpos.mpr hp) + obtain ⟨w, hw0, hw1, hw⟩ := convex_zero hA hB + let k := mix km kp w hw0 hw1 + refine ⟨k, ?_⟩ + have hfi : IntegrableOn (fun y => star (y-x) * gradient g y) (Metric.ball x (r+δ)) := + (((by fun_prop : Continuous (fun y : ℂ => star (y-x))).mul (continuous_gradient hg)).continuousOn.integrableOn_compact (isCompact_closedBall x (r+δ))).mono_set Metric.ball_subset_closedBall + rw [kernel_pairing_local k x hfi] + change (∫ t, (w * cubeDensity (r-δ) r t + (1-w) * cubeDensity r (r+δ) t) • moment g x t) = 0 + simp_rw [add_smul, mul_smul] + have him : Integrable (fun t : ℝ => w • (cubeDensity (r-δ) r t • moment g x t)) := by + convert! (cubeDensity_moment_integrable hg x (a := r-δ) (b := r) (by linarith [ha])).smul w + have hip : Integrable (fun t : ℝ => (1-w) • (cubeDensity r (r+δ) t • moment g x t)) := by + convert! (cubeDensity_moment_integrable hg x (a := r) (b := r+δ) (by linarith [hr.1])).smul (1-w) + rw [integral_add him hip, + integral_smul, integral_smul, + cubeDensity_moment_integral hg x (by linarith [ha]) hmr.le, + cubeDensity_moment_integral hg x (by linarith [hr.1]) hpr.le] + change w • (A : ℂ) + (1-w) • (B : ℂ) = 0 + apply Complex.ext <;> simp only [Complex.smul_re, Complex.smul_im, Complex.ofReal_re, + Complex.ofReal_im, Complex.add_re, Complex.add_im, Complex.zero_re, Complex.zero_im, + smul_eq_mul, mul_zero, add_zero] + exact hw + +end DiskMoments + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Packing.lean b/lean/OAI/Analysis/DiskMaximal/Packing.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ed413ebc3ba78e4d1ef7c1586e00947ba441963 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Packing.lean @@ -0,0 +1,798 @@ +import OAI.Analysis.DiskMaximal.SpatialLaws + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace CommonPrices +open DyadicHats ConeCoordinates ConeScalar Finset PricePieces LocalCancellation AffineDensities + +def sign (b : Bool) : ℝ := if b then 1 else -1 +lemma sign_cases (b : Bool) : sign b = 1 ∨ sign b = -1 := by cases b <;> simp [sign] +lemma sign_sq (b : Bool) : sign b^2 = 1 := by cases b <;> norm_num [sign] + +def cellPrice (N : ℕ) (r : ℝ) (h : ℂ → ℂ) (k : ℕ) (S : Finset (Grid N)) : ℝ := + ∑ q ∈ S, rootPrice N r h k q + +def rootWeight {N : ℕ} (S : Finset (Grid N)) (k j : ℕ) (s : Grid N) : ℝ := + ∑ q ∈ S, coeff N (k-j) q s +lemma rootWeight_nonneg {N : ℕ} (S : Finset (Grid N)) (k j : ℕ) (s : Grid N) : + 0 ≤ rootWeight S k j s := sum_nonneg (fun q _ => coeff_nonneg N (k-j) q s) + +abbrev ErrorIndex (N k : ℕ) := Fin (k+1) × Grid N × Bool + +def smallPiece {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) {r : ℝ} (hr : 0 < r) + (k : ℕ) (p : ℂ) (S : Finset (Grid N)) (n : ℂ) (i : ErrorIndex N k) : ErrorPiece 2 := + (errorPiece hh hr k i.1 (Nat.le_of_lt_succ i.1.isLt) p i.2.1 n (sign i.2.2)).weight + (rootWeight S k i.1 i.2.1) + +lemma smallPiece_mass {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) (i : ErrorIndex N k) : + (smallPiece hh hr k p S n i).mass ≤ (scale r k)⁻¹*2* + (rootWeight S k i.1 i.2.1*densityDefect N r (fun x => coordinate n (sign i.2.2) (h x)) i.1 i.2.1) := by + rw [smallPiece,ErrorPiece.mass_weight _ (rootWeight_nonneg ..)] + calc + _ ≤ rootWeight S k i.1 i.2.1*((scale r k)⁻¹* + (2*densityDefect N r (fun x => coordinate n (sign i.2.2) (h x)) i.1 i.2.1)) := + mul_le_mul_of_nonneg_left (errorPiece_mass hr hR hN hh hsupp k i.1 + (Nat.le_of_lt_succ i.1.isLt) p i.2.1 hn (sign_sq _)) (rootWeight_nonneg ..) + _ = _ := by ring + +lemma discounted_smallPiece_mass {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) (i : ErrorIndex N k) : + (smallPiece hh hr k p S n i).size^(1/100:ℝ)*(smallPiece hh hr k p S n i).mass ≤ + (scale r k)⁻¹*2*(rho^(k-i.1)* + (rootWeight S k i.1 i.2.1*densityDefect N r (fun x => coordinate n (sign i.2.2) (h x)) i.1 i.2.1)) := by + have hs : (smallPiece hh hr k p S n i).size^(1/100:ℝ) = rho^(k-i.1) := + scale_discount hr (Nat.le_of_lt_succ i.1.isLt) + rw [hs] + calc + _ ≤ rho^(k-i.1)*((scale r k)⁻¹*2* + (rootWeight S k i.1 i.2.1*densityDefect N r (fun x => coordinate n (sign i.2.2) (h x)) i.1 i.2.1)) := + mul_le_mul_of_nonneg_left (smallPiece_mass hr hR hN hh hsupp k p S hn i) (pow_nonneg rho_pos.le _) + _ = _ := by ring + +lemma weighted_defect_sum {N : ℕ} (r : ℝ) (h : ℂ → ℝ) (k : ℕ) (S : Finset (Grid N)) : + (∑ j : Fin (k+1), ∑ s : Grid N, rho^(k-j.val)*(rootWeight S k j s*densityDefect N r h j s)) = + ∑ q ∈ S, scalarPrice N r h rho k q := by + simp only [rootWeight,sum_mul,mul_sum] + simp_rw [Finset.sum_comm (s := univ) (t := S)] + apply sum_congr rfl + intro q _ + unfold scalarPrice + rw [← Fin.sum_univ_eq_sum_range] + apply sum_congr rfl + intro j _ + rw [mul_sum] + +lemma smallPiece_price {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) : + errorPrice (smallPiece hh hr k p S n) (1/100) ≤ (scale r k)⁻¹*2* + ∑ q ∈ S, (scalarPrice N r (fun x => coordinate n 1 (h x)) rho k q+ + scalarPrice N r (fun x => coordinate n (-1) (h x)) rho k q) := by + apply (sum_le_sum (fun i _ => discounted_smallPiece_mass hr hR hN hh hsupp k p S hn i)).trans_eq + rw [← mul_sum] + congr 1 + simp only [Fintype.sum_prod_type,Fintype.sum_bool,sign,Bool.false_eq_true, + ite_false,ite_true,sum_add_distrib] + rw [weighted_defect_sum,weighted_defect_sum,← sum_add_distrib] + +lemma smallPiece_common_price {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : n ∈ fixedPalette.labels) : + errorPrice (smallPiece hh hr k p S n) (1/100) ≤ (scale r k)⁻¹*2*cellPrice N r h k S := by + apply (smallPiece_price hr hR hN hh hsupp k p S (fixedPalette.unit n hn)).trans + apply mul_le_mul_of_nonneg_left _ (mul_nonneg (inv_nonneg.mpr (scale_pos hr k).le) (by norm_num)) + apply sum_le_sum + intro q _ + apply single_le_sum _ hn + intro n _ + exact add_nonneg + (scalarPrice_nonneg hr hR hN (scalar_integrable hh _) (scalar_support hsupp _) k q) + (scalarPrice_nonneg hr hR hN (scalar_integrable hh _) (scalar_support hsupp _) k q) + +end CommonPrices + +namespace CommonPrices +open DyadicHats ConeCoordinates ConeScalar Finset PricePieces LocalCancellation AffineDensities + +def goodRoots {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) : Finset (Grid N) := + by classical exact S.filter (fun q => Good n (DirectionNeighbors.theta h (scale r k) q)) +def badRoots {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) : Finset (Grid N) := + by classical exact S.filter (fun q => ¬Good n (DirectionNeighbors.theta h (scale r k) q)) + +def rootSum {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) (y : ℂ) : ℂ := + ∑ q ∈ S, rootVector N r h k q n y + +lemma rootSum_integrable {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) + (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) : Integrable (rootSum h r k S n) := + integrable_finsetSum S (fun _ _ => rootVector_integrable hh r k _ n) + +lemma rootSum_partition {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) (y : ℂ) : + rootSum h r k (goodRoots h r k S n) n y+rootSum h r k (badRoots h r k S n) n y = rootSum h r k S n y := by + classical + exact sum_filter_add_sum_filter_not S (fun q => Good n (DirectionNeighbors.theta h (scale r k) q)) _ + +lemma rootSum_mass {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) : + (∫ y, ‖rootSum h r k S n y‖) ≤ 4*∑ q ∈ S, scalarMass h (scale r k) q := by + calc + _ ≤ ∫ y, ∑ q ∈ S, ‖rootVector N r h k q n y‖ := + integral_mono (rootSum_integrable hh r k S n).norm + (integrable_finsetSum S (fun _ _ => (rootVector_integrable hh r k _ n).norm)) + (fun y => norm_sum_le _ _) + _ = ∑ q ∈ S, ∫ y, ‖rootVector N r h k q n y‖ := + integral_finsetSum S (fun _ _ => (rootVector_integrable hh r k _ n).norm) + _ ≤ _ := by rw [mul_sum]; exact sum_le_sum (fun q _ => rootVector_mass hr hR hN hh hsupp k q hn) + +/-- The actual normalized positive-cone part on one cell. -/ +def goodCone {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s = 1 ∨ s = -1) : ConeDensity (axis n s) (1/2) where + density := rescale p (scale r k) (rootSum h r k (goodRoots h r k S n) n) + integrable := integrable_rescale (rootSum_integrable hh r k _ n) p (scale_pos hr k).ne' + cone := by + classical + apply ae_of_all + intro X + have hc := cone_sum (by norm_num : (0:ℝ) ≤ 1/2) (goodRoots h r k S n) + (fun q => rootVector N r h k q n (p+scale r k • X)) (by + intro q hq + have hg : Good n (DirectionNeighbors.theta h (scale r k) q) := (mem_filter.mp hq).2 + exact rootVector_cone hr hR hN hh hsupp k q hn hg hs _) + simp only [rescale,norm_smul,Real.norm_eq_abs,abs_of_pos (scale_pos hr k),real_inner_smul_right] + change (1/2:ℝ)*(scale r k*‖rootSum h r k (goodRoots h r k S n) n (p+scale r k • X)‖) ≤ _ + dsimp only [rootSum] + nlinarith [mul_le_mul_of_nonneg_left hc (scale_pos hr k).le] + +def badPrice {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) : ℝ := + ∑ q ∈ badRoots h r k S n, scalarMass h (scale r k) q + +/-- Bad cone roots are exactly the unrestricted size-one part. -/ +def badPiece {N : ℕ} {r : ℝ} (hr : 0 < r) {h : ℂ → ℂ} (hh : Integrable h) + (k : ℕ) (p : ℂ) (S : Finset (Grid N)) (n : ℂ) : ErrorPiece 2 := + unitPiece (rescale p (scale r k) (rootSum h r k (badRoots h r k S n) n)) + (integrable_rescale (rootSum_integrable hh r k _ n) p (scale_pos hr k).ne') 2 + +lemma badPiece_mass {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) : + (badPiece hr hh k p S n).mass ≤ (scale r k)⁻¹*4*badPrice h r k S n := by + change (∫ X, ‖rescale p (scale r k) (rootSum h r k (badRoots h r k S n) n) X‖) ≤ _ + rw [mass_rescale _ _ (scale_pos hr k)] + simpa only [mul_assoc,badPrice] using mul_le_mul_of_nonneg_left + (rootSum_mass hr hR hN hh hsupp k (badRoots h r k S n) hn) (inv_nonneg.mpr (scale_pos hr k).le) + +def cellErrors {N : ℕ} {r : ℝ} (hr : 0 < r) {h : ℂ → ℂ} (hh : Integrable h) + (k : ℕ) (p : ℂ) (S : Finset (Grid N)) (n : ℂ) : Option (ErrorIndex N k) → ErrorPiece 2 + | none => badPiece hr hh k p S n + | some i => smallPiece hh hr k p S n i + +lemma cellErrors_price {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : n ∈ fixedPalette.labels) : + errorPrice (cellErrors hr hh k p S n) (1/100) ≤ + (scale r k)⁻¹*(4*badPrice h r k S n+2*cellPrice N r h k S) := by + simp only [errorPrice,Fintype.sum_option,cellErrors,show (badPiece hr hh k p S n).size = 1 from rfl, + Real.one_rpow,one_mul] + have h1 := badPiece_mass hr hR hN hh hsupp k p S (fixedPalette.unit n hn) + have h2 := smallPiece_common_price hr hR hN hh hsupp k p S hn + unfold errorPrice at h2 + linarith + +end CommonPrices + +namespace CommonPrices +open DyadicHats ConeCoordinates ConeScalar Finset PricePieces LocalCancellation AffineDensities + +lemma smallPiece_pair_sum {N : ℕ} {r : ℝ} (hr : 0 < r) {h : ℂ → ℂ} (hh : Integrable h) + (k : ℕ) (p : ℂ) (S : Finset (Grid N)) (n : ℂ) (j : Fin (k+1)) (q : Grid N) (X : ℂ) : + (∑ b : Bool, (smallPiece hh hr k p S n (j,q,b)).density X) = + rootWeight S k j q • rescale p (scale r k) (errorVector N r h j q n) X := by + simp only [Fintype.sum_bool,smallPiece,ErrorPiece.weight,errorPiece,sign, + Bool.false_eq_true,ite_false,ite_true,rescale,errorVector] + module + +lemma smallPiece_sum {N : ℕ} {r : ℝ} (hr : 0 < r) {h : ℂ → ℂ} (hh : Integrable h) + (k : ℕ) (p : ℂ) (S : Finset (Grid N)) (n : ℂ) (X : ℂ) : + (∑ i : ErrorIndex N k, (smallPiece hh hr k p S n i).density X) = + rescale p (scale r k) (fun y => ∑ q ∈ S, ∑ j ∈ range (k+1), + ∑ s : Grid N, coeff N (k-j) q s • errorVector N r h j s n y) X := by + simp only [Fintype.sum_prod_type,smallPiece_pair_sum,rootWeight,sum_smul,rescale,smul_sum] + simp_rw [Finset.sum_comm (s := univ) (t := S)] + apply sum_congr rfl + intro q _ + rw [← Fin.sum_univ_eq_sum_range] + apply sum_congr rfl + intro j _ + apply sum_congr rfl + intro s _ + module + +/-- Exact cell decomposition before imposing the local partition-of-unity +region. Both its scalar coordinates and all error densities are the actual +finite dyadic construction. -/ +theorem cell_decomposition {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (p : ℂ) (S : Finset (Grid N)) + {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s = 1 ∨ s = -1) (X : ℂ) : + (goodCone hr hR hN hh hsupp k p S hn hs).density X+ + (∑ i, (cellErrors hr hh k p S n i).density X) = + rescale p (scale r k) (fun y => (∑ q ∈ S, hat (scale r k) q y) • h y) X := by + rw [Fintype.sum_option] + change rescale p (scale r k) (rootSum h r k (goodRoots h r k S n) n) X+ + (rescale p (scale r k) (rootSum h r k (badRoots h r k S n) n) X+ + ∑ i : ErrorIndex N k, (smallPiece hh hr k p S n i).density X) = _ + rw [smallPiece_sum] + simp only [rescale,← smul_add,← add_assoc,rootSum_partition] + rw [sum_smul] + congr 1 + simp only [rootSum,← sum_add_distrib] + exact sum_congr rfl (fun q _ => (vector_decomposition hr hR hN hsupp k q hn _).symm) + +end CommonPrices + +namespace DirectionNeighbors +open DyadicHats +lemma mem_window_comm (d : ℕ) (p q : ℤ × ℤ) : p ∈ window d q ↔ q ∈ window d p := by + rw [mem_window_iff (by norm_num : (0:ℝ) < 1),mem_window_iff (by norm_num : (0:ℝ) < 1),boxNorm_sub_comm] + +lemma card_window (d : ℕ) (q : ℤ × ℤ) : (window d q).card = (2*d+1)^2 := by + change ((Finset.Icc (q.1-(d:ℤ)) (q.1+d)) ×ˢ + (Finset.Icc (q.2-(d:ℤ)) (q.2+d))).card = _ + rw [Finset.card_product,Int.card_Icc,Int.card_Icc] + have hq (z : ℤ) : (z+(d:ℤ)+1-(z-d)).toNat = 2*d+1 := by omega + rw [hq,hq,pow_two] + +end DirectionNeighbors + +namespace CommonPrices +open DyadicHats ConeCoordinates Finset DirectionNeighbors + +def cellRoots (N : ℕ) (p : ℤ × ℤ) : Finset (Grid N) := + univ.filter (fun q => (q : ℤ × ℤ) ∈ window 20 p) + +lemma cellPrice_spatial {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (P : Finset (ℤ × ℤ)) : + (∑ p ∈ P, cellPrice N r h k (cellRoots N p)) ≤ 1681*∑ q : Grid N, rootPrice N r h k q := by + simp only [cellPrice,cellRoots,sum_filter] + rw [Finset.sum_comm] + rw [mul_sum] + apply sum_le_sum + intro q _ + have hn := rootPrice_nonneg hr hR hN hh hsupp k q + have hs : P.filter (fun p => (q:ℤ×ℤ) ∈ window 20 p) ⊆ window 20 q := by + intro p hp + exact (mem_window_comm 20 _ _).mp (mem_filter.mp hp).2 + have hc : ((P.filter (fun p => (q:ℤ×ℤ) ∈ window 20 p)).card : ℝ) ≤ 1681 := by + have hc := Finset.card_le_card hs + rw [card_window] at hc + exact_mod_cast hc + rw [← sum_filter,sum_const,nsmul_eq_mul] + exact mul_le_mul_of_nonneg_right hc hn + +/-- The common geometric price has a genuine uniform spatial-and-scale +budget, including every desired finite set of observation cells. -/ +theorem cellPrice_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) : + (∑ k ∈ range (m+1), ∑ p ∈ P k, cellPrice N r h k (cellRoots N p)) ≤ + 1681*((fixedPalette.labels.card:ℝ)*2/(1-rho))*(∫ y, ‖h y‖) := by + calc + _ ≤ ∑ k ∈ range (m+1), 1681*∑ q : Grid N, rootPrice N r h k q := + sum_le_sum (fun k _ => cellPrice_spatial hr hR hN hh hsupp k (P k)) + _ = 1681*(∑ k ∈ range (m+1), ∑ q : Grid N, rootPrice N r h k q) := by rw [mul_sum] + _ ≤ _ := by + have ht := mul_le_mul_of_nonneg_left (rootPrice_budget hr hR hN hh hsupp m) (by norm_num : (0:ℝ) ≤ 1681) + have he : 1681*(2*(fixedPalette.labels.card:ℝ)*(1-rho)⁻¹*(∫ y, ‖h y‖)) = + 1681*((fixedPalette.labels.card:ℝ)*2/(1-rho))*(∫ y, ‖h y‖) := by ring + exact ht.trans_eq he + +end CommonPrices + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks Finset DirectionNeighbors + +lemma nodeCharge_scale {N : ℕ} (v : Grid N → ℂ) (k : ℕ) {b : ℝ} (hb : 0 ≤ b) + (q : Grid N) (C : List (Grid N) → ℝ) : + nodeCharge (tree v k b q) C = b*nodeCharge (tree v k 1 q) C := by + induction k generalizing b q C with + | zero => simp [tree,nodeCharge,Real.norm_eq_abs,abs_of_nonneg hb,mul_assoc] + | succ k ih => + change ‖vector (tree v (k+1) b q)‖*C []+ + (∑ a : Grid N, nodeCharge (tree v k (b*step q a) a) (fun p => C (a::p))) = + b*(‖vector (tree v (k+1) 1 q)‖*C []+ + (∑ a : Grid N, nodeCharge (tree v k (1*step q a) a) (fun p => C (a::p)))) + simp only [vector_tree,norm_smul,Real.norm_eq_abs,abs_of_nonneg hb, + abs_one,one_mul] + simp_rw [ih (mul_nonneg hb (step_nonneg _ _)),ih (step_nonneg _ _)] + rw [mul_add,mul_sum] + congr 1 + · ring + · apply sum_congr rfl + intro a ha + ring + +def spatialCharge {N : ℕ} (C : ℕ → Grid N → ℝ) (k : ℕ) (q : Grid N) + (p : List (Grid N)) : ℝ := C (k-p.length) (lastVertex q p) + +lemma spatialCharge_cons {N : ℕ} (C : ℕ → Grid N → ℝ) (k : ℕ) (q a : Grid N) + (p : List (Grid N)) : spatialCharge C (k+1) q (a::p) = spatialCharge C k a p := by + simp [spatialCharge,List.length_cons,lastVertex] + +lemma sum_nodeCharge {N : ℕ} (v : Grid N → ℂ) (k : ℕ) (C : ℕ → Grid N → ℝ) : + (∑ q, nodeCharge (tree v k 1 q) (spatialCharge C k q)) = + ∑ j ∈ range (k+1), ∑ a : Grid N, + ‖∑ z : Grid N, coeff N j a z • v z‖*C j a := by + induction k with + | zero => + have hv (a : Grid N) : (∑ z : Grid N, coeff N 0 a z • v z) = v a := by + simpa only [tree,vector,one_smul] using (vector_tree v 0 1 a).symm + simp only [tree,nodeCharge,one_smul,spatialCharge,List.length_nil,Nat.sub_zero, + lastVertex,Nat.zero_add,sum_range_one,hv] + | succ k ih => + have hrec (q : Grid N) : nodeCharge (tree v (k+1) 1 q) (spatialCharge C (k+1) q) = + ‖∑ z : Grid N, coeff N (k+1) q z • v z‖*C (k+1) q+ + ∑ a : Grid N, step q a*nodeCharge (tree v k 1 a) (spatialCharge C k a) := by + change ‖vector (tree v (k+1) 1 q)‖*spatialCharge C (k+1) q []+_ = _ + simp only [vector_tree,one_smul,spatialCharge,List.length_nil,Nat.sub_zero,lastVertex, + one_mul,List.length_cons,Nat.add_sub_add_right] + congr 1 + apply sum_congr rfl + intro a ha + exact nodeCharge_scale v k (step_nonneg q a) a _ + simp_rw [hrec] + rw [sum_add_distrib,Finset.sum_comm (f := fun (q a : Grid N) => step q a* + nodeCharge (tree v k 1 a) (spatialCharge C k a))] + simp_rw [← sum_mul,grid_step_column,one_mul] + rw [ih] + conv_rhs => rw [sum_range_succ] + exact add_comm _ _ + +lemma sum_energyCharge {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) : + (∑ q : Grid N, nodeCharge (tree (fun q => vectorMass h r q) k 1 q) + (pathEnergy h r k q)) = + ∑ j ∈ range (k+1), ∑ q : Grid N, scalarMass h (scale r j) q*energy h (scale r j) q := by + change (∑ q : Grid N, nodeCharge (tree (fun q => vectorMass h r q) k 1 q) + (spatialCharge (fun j q => energy h (scale r j) q) k q)) = _ + rw [sum_nodeCharge] + apply sum_congr rfl + intro j hj + apply sum_congr rfl + intro q hq + rw [← vectorMass_coeff hr hR hN hh hsupp] + rfl + +/-- Particle observations use the prescribed terminal vertex, not a hat-density +surrogate. This is the frozen spatial location carried throughout the process. -/ +def particleSwitches {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (q : Grid N) + (p : List (Grid N)) (b : ℕ) : ℝ := + pathSwitches h r k (point r (lastVertex q p)) p b + +theorem particle_switch_bound {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + particleEval (tree (fun q => vectorMass h r q) k 1 q) (particleSwitches h r k q) ≤ + 2560004*terminalMass (tree (fun q => vectorMass h r q) k 1 q)+ + 2000000*nodeCharge (tree (fun q => vectorMass h r q) k 1 q) (pathEnergy h r k q) := by + have hp := particleEval_mono_active (tree (fun q => vectorMass h r q) k 1 q) + (F := particleSwitches h r k q) + (fun p b hp hb => path_switch_bound hr hR hN hh hsupp k q hp hb (x := point r (lastVertex q p)) (by + rw [hat_at_point hr.ne'] + norm_num)) + simp only [particleEval_add,particleEval_smul,particleEval_const,particle_occupancy, + root_marked_occupancy] at hp + have hm := costWithRoot_le (by simp : ‖(1:ℂ)‖ = 1) + (by norm_num : (0:ℝ) < 1/800) (tree (fun q => vectorMass h r q) k 1 q) + norm_num at hm + change particleEval _ (particleSwitches h r k q) ≤ _ at hp + linarith + +/-- The switch budget for the actual finite spatial forest, with every birth +population included and frozen terminal positions observed. -/ +theorem forest_switch_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) : + (∑ q : Grid N, particleEval (tree (fun q => vectorMass h r q) k 1 q) + (particleSwitches h r k q)) ≤ + (2560004+2000000*(576*(4097:ℝ)^2))*(∫ y, ‖h y‖) := by + have hs := sum_le_sum (fun q (_ : q ∈ (univ : Finset (Grid N))) => + particle_switch_bound hr hR hN hh hsupp k q) + simp only [sum_add_distrib,← mul_sum] at hs + rw [sum_terminalMass,sum_energyCharge hr hR hN hh hsupp] at hs + have ht := sum_scalarMass_grid_le (N := N) hh r + have he := neighbor_energy_budget hr hR hN hh hsupp (k+1) + change (∑ q : Grid N, ‖vectorMass h r q‖) ≤ ∫ y, ‖h y‖ at ht + nlinarith only [hs,ht,he] + +end ActualMarkTrees + +namespace FiniteLabels +variable {ι : Type*} [Fintype ι] +lemma expect_const (μ : Law ι) (c : ℝ) : expect μ (fun _ => c) = c := by + rw [expect,← Finset.sum_mul,μ.total,one_mul] +lemma expect_mul (μ : Law ι) (f : ι → ℝ) (c : ℝ) : + expect μ (fun i => c*f i) = c*expect μ f := by + simp only [expect,Finset.mul_sum,mul_left_comm] +lemma expect_mono (μ : Law ι) {f g : ι → ℝ} (h : ∀ i, f i ≤ g i) : + expect μ f ≤ expect μ g := Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (h i) (μ.nonneg i)) +lemma expect_le_const (μ : Law ι) {f : ι → ℝ} {c : ℝ} (h : ∀ i, f i ≤ c) : + expect μ f ≤ c := (expect_mono μ h).trans_eq (expect_const μ c) +lemma expect_compare (μ ν : Law ι) {f : ι → ℝ} {c : ℝ} (h : ∀ i, |f i| ≤ c) : + expect μ f ≤ expect ν f+c*l1dist μ ν := by + have he := expectation_difference μ ν h + change |expect μ f-expect ν f| ≤ c*l1dist μ ν at he + have hl := le_abs_self (expect μ f-expect ν f) + linarith +end FiniteLabels + +namespace ActualLabels +open FiniteLabels ConeCoordinates DirectionNeighbors DyadicHats Finset + +def comparisonConstant : ℝ := 1280000*((Fintype.card Label:ℝ)+1) +lemma comparisonConstant_ge : 1280000 ≤ comparisonConstant := by + dsimp [comparisonConstant] + nlinarith [Nat.cast_nonneg (α := ℝ) (Fintype.card Label)] +lemma comparisonConstant_pos : 0 < comparisonConstant := lt_of_lt_of_le (by norm_num) comparisonConstant_ge +lemma comparisonConstant_one : 1 ≤ comparisonConstant := by linarith [comparisonConstant_ge] + +def rowDerivative (h : ℂ → ℂ) (r : ℝ) (x : ℂ) (n : Label) : ℝ := + r*∑ j : Label, ‖gradient (fun y => row h r y n j) x‖ +def derivativeCost (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) : ℕ → ℝ + | 0 => r 0*∑ j : Label, ‖gradient (fun y => initial h (r 0) y j) x‖ + | i+1 => expect (marginal h r i x) (rowDerivative h (r (i+1)) x) + +lemma rowDerivative_nonneg (h : ℂ → ℂ) {r : ℝ} (hr : 0 ≤ r) (x : ℂ) (n : Label) : + 0 ≤ rowDerivative h r x n := mul_nonneg hr (sum_nonneg (fun _ _ => norm_nonneg _)) +lemma rowDerivative_uniform (h : ℂ → ℂ) {r : ℝ} (hr : 0 < r) (x : ℂ) (n : Label) : + rowDerivative h r x n ≤ 16*(Fintype.card Label:ℝ) := by + have hh := spatialRow_local_derivative n (target h r) (switchChance h r n) + (switchChance_nonneg h r n) (switchChance_le_one h r n) hr (by norm_num : (0:ℝ) ≤ 1) + (q := x) (x := x) (by simp only [sub_self,boxNorm]; norm_num; positivity) + (fun z _ => switchChance_le_one h r n z) + change rowDerivative h r x n ≤ 16*(Fintype.card Label:ℝ)*1 at hh + simpa only [mul_one] using hh +lemma initial_distance (h : ℂ → ℂ) {r : ℝ} (hr : 0 < r) (x y : ℂ) : + l1dist (initial h r x) (initial h r y) ≤ comparisonConstant/r*‖x-y‖ := by + have he := spatialRow_distance (quantize 1 (by norm_num)) (target h r) (fun _ => 1) + (fun _ => zero_le_one) (fun _ => le_rfl) hr (by norm_num : (0:ℝ) ≤ 1) + (fun _ => le_rfl) x y + apply he.trans + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + rw [← mul_div_assoc] + apply div_le_div_of_nonneg_right _ hr.le + dsimp [comparisonConstant] + nlinarith [Nat.cast_nonneg (α := ℝ) (Fintype.card Label)] +lemma derivativeCost_uniform (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (i : ℕ) (hr : 0 < r i) : + derivativeCost h r x i ≤ 16*(Fintype.card Label:ℝ) := by + cases i with + | zero => + have hh := spatialRow_local_derivative (quantize 1 (by norm_num)) (target h (r 0)) (fun _ => 1) + (fun _ => zero_le_one) (fun _ => le_rfl) hr (by norm_num : (0:ℝ) ≤ 1) + (q := x) (x := x) (by simp only [sub_self,boxNorm]; norm_num; positivity) (fun _ _ => le_rfl) + change derivativeCost h r x 0 ≤ 16*(Fintype.card Label:ℝ)*1 at hh + simpa only [mul_one] using hh + | succ i => exact expect_le_const _ (rowDerivative_uniform h hr x) + +lemma rate_local (h : ℂ → ℂ) {r : ℝ} (hr : 0 < r) (q : ℤ × ℤ) (x y : ℂ) + (hx : boxNorm (x-point r q) < 199*r) (hy : boxNorm (y-point r q) < 199*r) (n : Label) : + rate h r x n ≤ comparisonConstant*(rate h r y n+energy h r q) := by + have he := switchRate_local_compare (by norm_num : (0:ℝ) < 1/100) hr (Theta h r) + (n:ℂ) (theta h r q) (point r q) x y hx hy (energy_controls hr h q) + change rate h r x n ≤ 2*rate h r y n+8*((1/100:ℝ)⁻¹)^2*energy h r q at he + norm_num at he + have h0 := rate_nonneg h r y n + have h1 := energy_nonneg h r q + have hC := comparisonConstant_ge + nlinarith + +lemma row_local_distance (h : ℂ → ℂ) {r : ℝ} (hr : 0 < r) (q : ℤ × ℤ) (x y : ℂ) + (hx : boxNorm (x-point r q) < 199*r) (hy : boxNorm (y-point r q) < 199*r) (n : Label) : + l1dist (row h r x n) (row h r y n) ≤ + comparisonConstant*‖x-y‖/r*(rate h r y n+energy h r q) := by + have he := spatialSwitchRow_local_distance (by norm_num : (0:ℝ) < 1/100) hr (energy_nonneg h r q) + (fun n : Label => (n:ℂ)) (Theta h r) (target h r) n (theta h r q) (point r q) x y hx hy + (energy_controls hr h q) + change l1dist (row h r x n) (row h r y n) ≤ + (Fintype.card Label:ℝ)*(16*(2*rate h r y n+8*((1/100:ℝ)⁻¹)^2*energy h r q)/r)*‖x-y‖ at he + apply he.trans + have h0 := rate_nonneg h r y n + have h1 := energy_nonneg h r q + have hb : (Fintype.card Label:ℝ)*(16*(2*rate h r y n+8*((1/100:ℝ)⁻¹)^2*energy h r q)) ≤ + comparisonConstant*(rate h r y n+energy h r q) := by + dsimp [comparisonConstant] + norm_num + nlinarith [mul_nonneg (Nat.cast_nonneg (α := ℝ) (Fintype.card Label)) h0, + mul_nonneg (Nat.cast_nonneg (α := ℝ) (Fintype.card Label)) h1] + have hb' := mul_le_mul_of_nonneg_right (div_le_div_of_nonneg_right hb hr.le) (norm_nonneg (x-y)) + convert hb' using 1 <;> ring + +lemma row_local_derivative (h : ℂ → ℂ) {r : ℝ} (hr : 0 < r) (q : ℤ × ℤ) (x y : ℂ) + (hx : boxNorm (x-point r q) < 199*r) (hy : boxNorm (y-point r q) < 199*r) (n : Label) : + rowDerivative h r x n ≤ comparisonConstant*(rate h r y n+energy h r q) := by + have he := spatialSwitchRow_local_derivative (by norm_num : (0:ℝ) < 1/100) hr (energy_nonneg h r q) + (fun n : Label => (n:ℂ)) (Theta h r) (target h r) n (theta h r q) (point r q) x y hx hy + (energy_controls hr h q) + change rowDerivative h r x n ≤ + 16*(Fintype.card Label:ℝ)*(2*rate h r y n+8*((1/100:ℝ)⁻¹)^2*energy h r q) at he + apply he.trans + have h0 := rate_nonneg h r y n + have h1 := energy_nonneg h r q + dsimp [comparisonConstant] + norm_num + nlinarith [mul_nonneg (Nat.cast_nonneg (α := ℝ) (Fintype.card Label)) h0, + mul_nonneg (Nat.cast_nonneg (α := ℝ) (Fintype.card Label)) h1] + +end ActualLabels + +namespace AffineDensities +lemma gradient_affine {g : ℂ → ℝ} (hg : Differentiable ℝ g) (p : ℂ) (r : ℝ) (X : ℂ) : + gradient (fun Y => g (p+r • Y)) X = rescale p r (gradient g) X := by + have hA : HasFDerivAt (fun Y : ℂ => p+r • Y) (r • ContinuousLinearMap.id ℝ ℂ) X := + ((hasFDerivAt_id X).const_smul r).const_add p + have hc := (hg (p+r • X)).hasFDerivAt.comp X hA + change HasFDerivAt (fun Y => g (p+r • Y)) _ X at hc + apply (InnerProductSpace.toDual ℝ ℂ).injective + simp only [toDual_gradient,rescale,map_smul] + rw [hc.fderiv] + ext z + simp +end AffineDensities + +namespace DyadicHats +open Finset +lemma vector_partition_grid {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (x : ℂ) : + (∑ p : Grid N, hat r p x) • h x = h x := by + by_cases hx : h x = 0 + · simp only [hx,smul_zero] + · have he := density_partition_grid hr hN (h := fun y => ‖h y‖) + (fun y hy => hs y (fun hh => hy (by rw [hh,norm_zero]))) x + rw [← sum_mul] at he + have hsum : (∑ p : Grid N, hat r p x) = 1 := by + apply mul_right_cancel₀ (norm_ne_zero_iff.mpr hx) + simpa only [one_mul] using he + rw [hsum,one_smul] +end DyadicHats + +namespace CommonPrices +open DyadicHats ConeCoordinates ConeScalar LocalCancellation AffineDensities DirectionNeighbors Finset DiskMoments + +lemma hat_mem_cellRoots {N : ℕ} {r : ℝ} (hr : 0 < r) (p : ℤ × ℤ) (X : ℂ) (hX : ‖X‖ ≤ 12) + (q : Grid N) (hq : hat r q (point r p+r • X) ≠ 0) : q ∈ cellRoots N p := by + have hl := (hat_ne_zero_iff hr q (point r p+r • X)).mp hq + have hnorm : boxNorm (r • X) ≤ 12*r := by + apply (boxNorm_le_norm _).trans + rw [norm_smul,Real.norm_eq_abs,abs_of_pos hr] + nlinarith + have hh := boxNorm_add_le (point r q-(point r p+r • X)) (r • X) + rw [boxNorm_sub_comm (point r q)] at hh + have hie : point r q-(point r p+r • X)+r • X = point r q-point r p := by abel + rw [hie] at hh + apply mem_filter.mpr + refine ⟨mem_univ _,?_⟩ + rw [mem_window_iff hr 20] + norm_num + linarith + +lemma cell_partition {N : ℕ} {r R : ℝ} (hr : 0 < r) (hN : R/r+1 ≤ (N:ℝ)) + {h : ℂ → ℂ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (p : ℤ × ℤ) (X : ℂ) (hX : ‖X‖ ≤ 12) : + (∑ q ∈ cellRoots N p, hat r q (point r p+r • X)) • h (point r p+r • X) = h (point r p+r • X) := by + have he : (∑ q ∈ cellRoots N p, hat r q (point r p+r • X)) = + ∑ q : Grid N, hat r q (point r p+r • X) := by + apply sum_subset (subset_univ _) + intro q _ hq + by_contra hh + exact hq (hat_mem_cellRoots hr p X hX q hh) + rw [he] + exact vector_partition_grid hr hN hs _ + +lemma cell_decomposition_gradient {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {g : ℂ → ℝ} (hg : Differentiable ℝ g) + (hh : Integrable (gradient g)) (hsupp : ∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) + (k : ℕ) (p : ℤ × ℤ) {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s = 1 ∨ s = -1) + (X : ℂ) (hX : ‖X‖ ≤ 12) : + (goodCone hr hR hN hh hsupp k (point (scale r k) p) (cellRoots N p) hn hs).density X+ + (∑ i, (cellErrors hr hh k (point (scale r k) p) (cellRoots N p) n i).density X) = + gradient (fun Y => g (point (scale r k) p+scale r k • Y)) X := by + rw [cell_decomposition hr hR hN hh hsupp k _ _ hn hs,gradient_affine hg] + simp only [rescale] + rw [cell_partition (scale_pos hr k) (scale_index_bound hr hR hN k) hsupp p X hX] + +/-- The hard directional local price, instantiated with the actual common-price +cone decomposition on the actual neighboring grid roots. -/ +theorem directional_cell_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → ∀ (k : ℕ) (p : ℤ × ℤ) + {n : ℂ}, n ∈ fixedPalette.labels → ∀ {s : ℝ}, (s = 1 ∨ s = -1) → + ∀ Q : Set ℂ, volume Q ≤ ENNReal.ofReal 1 → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ X in Q, F X) ≤ ENNReal.ofReal (C*(scale r k)⁻¹* + (badPrice (gradient g) r k (cellRoots N p) n+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ X, ‖X‖ ≤ 2 → ∀ t, + NeighborhoodRadius (fun Y => g (point (scale r k) p+scale r k • Y)) X t → + ENNReal.ofReal (max 0 (-inner ℝ (axis n s) + (∫ Y in Metric.ball X t, gradient (fun Z => g (point (scale r k) p+scale r k • Z)) Y))) ≤ F X := by + obtain ⟨C,hC,hmajor⟩ := direction_majorant (by norm_num : (0:ℝ) ≤ 2) (by norm_num : (0:ℝ) < 1/2) + refine ⟨4*C,by positivity,?_⟩ + intro N r R hr hR hN g hg hh hsupp k p n hn s hs Q hQ + have hnu := fixedPalette.unit n hn + let a := goodCone hr hR hN hh hsupp k (point (scale r k) p) (cellRoots N p) hnu hs + let b := cellErrors hr hh k (point (scale r k) p) (cellRoots N p) n + have hg' : ContDiff ℝ 1 (fun Y => g (point (scale r k) p+scale r k • Y)) := hg.comp (by fun_prop) + obtain ⟨F,hFm,hFi,hFb⟩ := hmajor a b (axis_norm hnu (by rcases hs with rfl | rfl <;> norm_num)) _ hg' Q hQ + refine ⟨F,hFm,?_,?_⟩ + · apply hFi.trans + apply ENNReal.ofReal_le_ofReal + have hb := cellErrors_price hr hR hN hh hsupp k (point (scale r k) p) (cellRoots N p) hn + have hD : 0 ≤ cellPrice N r (gradient g) k (cellRoots N p) := + sum_nonneg (fun q _ => rootPrice_nonneg hr hR hN hh hsupp k q) + change errorPrice b (1/100) ≤ _ at hb + have hrk := scale_pos hr k + nlinarith [mul_le_mul_of_nonneg_left hb hC.le,inv_nonneg.mpr hrk.le, + mul_nonneg (inv_nonneg.mpr hrk.le) hD] + · intro X hX t ht + apply hFb X _ t ht + filter_upwards with Y hY + apply cell_decomposition_gradient hr hR hN (hg.differentiable one_ne_zero) hh hsupp k p hnu hs + have hy : ‖Y-X‖ < 3 := by simpa only [Metric.mem_ball,dist_eq_norm] using hY + have htri := norm_add_le (Y-X) X + rw [sub_add_cancel] at htri + linarith + +end CommonPrices + +namespace ActualLabels +open FiniteLabels ConeCoordinates DirectionNeighbors DyadicHats Finset + +def energyRate (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) (y : ℂ) (i : ℕ) : ℝ := + switchCost h r y i+energy h (r i) (q i) +lemma energyRate_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) (y : ℂ) (i : ℕ) : + 0 ≤ energyRate h r q y i := add_nonneg (switchCost_nonneg h r y i) (energy_nonneg h (r i) (q i)) +lemma energyRate_le_five (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) (y : ℂ) (i : ℕ) : + energyRate h r q y i ≤ 5 := by + have h1 := switchCost_le_one h r y i + have h2 := energy_le_four h (r i) (q i) + dsimp [energyRate] + linarith + +/-- Spatial comparison of the actual marginal laws. No independent coupling or +pointwise uniform distribution of labels is assumed. -/ +theorem marginal_spatial_distance (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) + (x y : ℂ) (j : ℕ) (hr : ∀ i ≤ j, 0 < r i) + (hx : ∀ i ≤ j, boxNorm (x-point (r i) (q i)) < 199*r i) + (hy : ∀ i ≤ j, boxNorm (y-point (r i) (q i)) < 199*r i) : + l1dist (marginal h r j x) (marginal h r j y) ≤ + comparisonConstant*‖x-y‖*∑ i ∈ range (j+1), energyRate h r q y i/r i := by + induction j with + | zero => + have he := initial_distance h (hr 0 le_rfl) x y + have hc : 1 ≤ energyRate h r q y 0 := by + dsimp [energyRate,switchCost] + linarith [energy_nonneg h (r 0) (q 0)] + have ht := mul_le_mul_of_nonneg_left + (div_le_div_of_nonneg_right hc (hr 0 le_rfl).le) + (mul_nonneg comparisonConstant_pos.le (norm_nonneg (x-y))) + simp only [Nat.zero_add,sum_range_one,marginal] + apply he.trans + convert ht using 1 + ring + | succ j ih => + have hd := ih (fun i hi => hr i (by omega)) (fun i hi => hx i (by omega)) (fun i hi => hy i (by omega)) + have hm := move_compare (marginal h r j x) (marginal h r j y) + (row h (r (j+1)) x) (row h (r (j+1)) y) + have hrow : (∑ n, marginal h r j y n*l1dist (row h (r (j+1)) x n) (row h (r (j+1)) y n)) ≤ + comparisonConstant*‖x-y‖/r (j+1)*energyRate h r q y (j+1) := by + calc + _ ≤ expect (marginal h r j y) (fun n => comparisonConstant*‖x-y‖/r (j+1)* + (rate h (r (j+1)) y n+energy h (r (j+1)) (q (j+1)))) := by + exact expect_mono _ (row_local_distance h (hr (j+1) le_rfl) (q (j+1)) x y + (hx (j+1) le_rfl) (hy (j+1) le_rfl)) + _ = _ := by rw [FiniteLabels.expect_mul,FiniteLabels.expect_add,FiniteLabels.expect_const]; rfl + change l1dist (marginal h r (j+1) x) (marginal h r (j+1) y) ≤ _ at hm + rw [sum_range_succ,mul_add] + have hterm : comparisonConstant*‖x-y‖/r (j+1)*energyRate h r q y (j+1) = + comparisonConstant*‖x-y‖*(energyRate h r q y (j+1)/r (j+1)) := by ring + rw [hterm] at hrow + linarith + +lemma switchCost_spatial (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℤ × ℤ) (x y : ℂ) (i : ℕ) + (hr : 0 < r (i+1)) (hx : boxNorm (x-point (r (i+1)) q) < 199*r (i+1)) + (hy : boxNorm (y-point (r (i+1)) q) < 199*r (i+1)) : + switchCost h r x (i+1) ≤ comparisonConstant*(switchCost h r y (i+1)+energy h (r (i+1)) q)+ + l1dist (marginal h r i x) (marginal h r i y) := by + have he := expect_compare (marginal h r i x) (marginal h r i y) + (fun n => by rw [abs_of_nonneg (rate_nonneg h (r (i+1)) x n)]; exact rate_le_one h (r (i+1)) x n) + have hrw := expect_mono (marginal h r i y) (rate_local h hr q x y hx hy) + rw [FiniteLabels.expect_mul,FiniteLabels.expect_add,FiniteLabels.expect_const] at hrw + change expect (marginal h r i y) (rate h (r (i+1)) x) ≤ + comparisonConstant*(switchCost h r y (i+1)+energy h (r (i+1)) q) at hrw + change expect (marginal h r i x) (rate h (r (i+1)) x) ≤ _ + linarith + +lemma derivativeCost_spatial (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℤ × ℤ) (x y : ℂ) (i : ℕ) + (hr : 0 < r (i+1)) (hx : boxNorm (x-point (r (i+1)) q) < 199*r (i+1)) + (hy : boxNorm (y-point (r (i+1)) q) < 199*r (i+1)) : + derivativeCost h r x (i+1) ≤ comparisonConstant*(switchCost h r y (i+1)+energy h (r (i+1)) q)+ + comparisonConstant*l1dist (marginal h r i x) (marginal h r i y) := by + have he := expect_compare (marginal h r i x) (marginal h r i y) + (fun n => by rw [abs_of_nonneg (rowDerivative_nonneg h hr.le x n)]; exact rowDerivative_uniform h hr x n) + have hrw := expect_mono (marginal h r i y) (row_local_derivative h hr q x y hx hy) + rw [FiniteLabels.expect_mul,FiniteLabels.expect_add,FiniteLabels.expect_const] at hrw + have hcoef : 16*(Fintype.card Label:ℝ) ≤ comparisonConstant := by + dsimp [comparisonConstant] + nlinarith [Nat.cast_nonneg (α := ℝ) (Fintype.card Label)] + have hm := mul_le_mul_of_nonneg_right hcoef (l1dist_nonneg (marginal h r i x) (marginal h r i y)) + change derivativeCost h r x (i+1) ≤ _ at he + change expect (marginal h r i y) (rowDerivative h (r (i+1)) x) ≤ + comparisonConstant*(switchCost h r y (i+1)+energy h (r (i+1)) q) at hrw + linarith + +end ActualLabels + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Potentials.lean b/lean/OAI/Analysis/DiskMaximal/Potentials.lean new file mode 100644 index 0000000000000000000000000000000000000000..5f3ecb89ccbee3799bbc662856015713b9dc84cf --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Potentials.lean @@ -0,0 +1,830 @@ +import OAI.Analysis.DiskMaximal.Envelopes + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace PlanePotential +open LocalCancellation + +lemma green_restrict_density {ψ : ℂ → ℝ} {R X : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hRX : R ≤ X) + (β : ℂ → ℂ) {x : ℂ} (hx : ‖x‖ ≤ X) (y : ℂ) : + ⟪green ψ x y, ({y : ℂ | ‖y‖ ≤ X}.indicator β) y⟫ = ⟪green ψ x y,β y⟫ := by + by_cases hy : ‖y‖ ≤ X + · simp [hy] + · rw [green_eq_zero_of_outside hψs hRX hx (lt_of_not_ge hy)] + simp + +lemma green_root_lp_local {ψ : ℂ → ℝ} {β : ℂ → ℂ} + (hψm : Measurable ψ) {R X B : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hRX : R ≤ X) (hM : 0 < R+X) (hB : 0 ≤ B) (hX : 0 < X) + (hβ : Integrable β) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, (ENNReal.ofReal |∫ y, ⟪green ψ x y,β y⟫|)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((2*B*(R+X)^2)^(3/2:ℝ)*(4*Real.pi*(4*X)^(1/2:ℝ))) * + (ENNReal.ofReal (∫ y, ‖β y‖))^(3/2:ℝ) := by + let β' := {y : ℂ | ‖y‖ ≤ X}.indicator β + have hi : Integrable β' := hβ.indicator (measurableSet_le measurable_norm measurable_const) + have hs : ∀ y, β' y ≠ 0 → ‖y‖ ≤ X := by + intro y hy + by_contra hn + exact hy (by simp [β',hn]) + have h := green_root_lp hψm hψs hψB hM hB (show 0 < X+X by linarith) hi hs + have he : (fun x => (ENNReal.ofReal |∫ y, ⟪green ψ x y,β' y⟫|)^(3/2:ℝ)) =ᵐ[volume.restrict {x : ℂ | ‖x‖ ≤ X}] + (fun x => (ENNReal.ofReal |∫ y, ⟪green ψ x y,β y⟫|)^(3/2:ℝ)) := by + filter_upwards [ae_restrict_mem (measurableSet_le measurable_norm measurable_const)] with x hx + congr 3 + exact integral_congr_ae (ae_of_all _ (green_restrict_density hψs hRX β hx)) + rw [lintegral_congr_ae he] at h + have hm : (∫ y, ‖β' y‖) ≤ ∫ y, ‖β y‖ := + integral_mono hi.norm hβ.norm (fun y => norm_indicator_le_norm_self β y) + have hm' := ENNReal.rpow_le_rpow (ENNReal.ofReal_le_ofReal hm) (by norm_num : (0:ℝ) ≤ 3/2) + have h' := h.trans (mul_le_mul_right hm' _) + simpa only [show 2*(X+X)=4*X by ring] using h' + +lemma green_zero_piece_lp_ae {ψ : ℂ → ℝ} {β : ℂ → ℂ} + (hψm : Measurable ψ) {R X B L a : ℝ} + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hψL : ∀ u v, |ψ u-ψ v| ≤ L*‖u-v‖) + (hM : 0 < R+X) (hB : 0 ≤ B) (hL : 0 ≤ L) (ha : 0 < a) + (z : ℂ) (hβ : Integrable β) (hzero : ∫ y, β y = 0) + (hβs : ∀ᵐ y, β y ≠ 0 → ‖y-z‖ ≤ a) : + (∫⁻ x in {x : ℂ | ‖x‖ ≤ X}, + (ENNReal.ofReal |∫ y, ⟪green ψ x y,β y⟫|)^(3/2:ℝ)) ≤ + ENNReal.ofReal ((8*Real.pi*(2*B*(R+X)^2)^(3/2:ℝ)+ + Real.pi*(8*B*(R+X)^2+(64/3:ℝ)*L*(R+X)^3)^(3/2:ℝ))*a^(1/2:ℝ)) * + (ENNReal.ofReal (∫ y, ‖β y‖))^(3/2:ℝ) := by + let β' := {y : ℂ | ‖y-z‖ ≤ a}.indicator β + have he : β' =ᵐ[volume] β := by + filter_upwards [hβs] with y hy + by_cases hs : ‖y-z‖ ≤ a + · simp [β',hs] + · have hz : β y = 0 := by by_contra hn; exact hs (hy hn) + simp [β',hs,hz] + have hi : Integrable β' := hβ.congr he.symm + have hz : ∫ y, β' y = 0 := (integral_congr_ae he).trans hzero + have hs : ∀ y, β' y ≠ 0 → ‖y-z‖ ≤ a := by + intro y hy + by_contra hn + exact hy (by simp [β',hn]) + have hp (x : ℂ) : (∫ y, ⟪green ψ x y,β' y⟫) = ∫ y, ⟪green ψ x y,β y⟫ := + integral_congr_ae (he.mono (fun y hy => by simpa only using congrArg (fun z => ⟪green ψ x y,z⟫) hy)) + have hm : (∫ y, ‖β' y‖) = ∫ y, ‖β y‖ := integral_congr_ae (he.mono (fun y hy => by simpa only using congrArg norm hy)) + simpa only [hp,hm] using green_zero_piece_lp hψm hψs hψB hψL hM hB hL ha z hi hz hs + +/-- The local decomposition theorem does not demand artificial bounded support +of the original densities: the actual Green kernel vanishes outside the +observation ball. -/ +theorem green_decomposition_norm_local {ι : Type*} [Fintype ι] + {ψ g : ℂ → ℝ} (hψ : Continuous ψ) (hψc : HasCompactSupport ψ) + (hg : ContDiff ℝ 1 g) {D R X B : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (hψ1 : ∫ z, ψ z = 1) + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hRX : R ≤ X) (hM : 0 < R+X) (hB : 0 ≤ B) (hX : 0 < X) + (β : ι → ℂ → ℂ) (hβ : ∀ i, Integrable (β i)) + (hdecomp : ∀ᵐ y, ‖y‖ ≤ X → gradient g y = ∑ i, β i y) : + eLpNorm (fun x => g x-∫ z, ψ z*g z) (3/2) (volume.restrict {x : ℂ | ‖x‖ ≤ X}) ≤ + ∑ i, eLpNorm (fun x => ∫ y, ⟪green ψ x y,β i y⟫) (3/2) + (volume.restrict {x : ℂ | ‖x‖ ≤ X}) := by + let β' := fun i => {y : ℂ | ‖y‖ ≤ X}.indicator (β i) + have hi (i : ι) : Integrable (β' i) := (hβ i).indicator (measurableSet_le measurable_norm measurable_const) + have hs (i : ι) (y : ℂ) (hy : β' i y ≠ 0) : ‖y‖ ≤ X := by + by_contra hn + exact hy (by simp [β',hn]) + have hd : ∀ᵐ y, ‖y‖ ≤ X → gradient g y = ∑ i, β' i y := by + filter_upwards [hdecomp] with y hy hY + simpa [β',hY] using hy hY + have h := green_decomposition_norm hψ hψc hg hD hψ1 hψs hψB hRX hM hB + (show 0 < X+X by linarith) β' hi hs hd + apply h.trans_eq + apply Finset.sum_congr rfl + intro i _ + apply eLpNorm_congr_ae + filter_upwards [ae_restrict_mem (measurableSet_le measurable_norm measurable_const)] with x hx + exact integral_congr_ae (ae_of_all _ (green_restrict_density hψs hRX (β i) hx)) + +/-- Uniform fractional small-support gain expressed in the common price +exponent 1/100, including the unrestricted unit-size terms. -/ +theorem exists_green_price : ∃ (ψ : ℂ → ℝ) (C : ℝ), 0 < C ∧ + ContDiff ℝ ∞ ψ ∧ HasCompactSupport ψ ∧ (∫ z, ψ z) = 1 ∧ + (∀ z, ψ z ≠ 0 → ‖z‖ ≤ 1) ∧ + ∀ b : ErrorPiece 2, + eLpNorm (fun x => ∫ y, ⟪green ψ x y,b.density y⟫) (3/2) + (volume.restrict {x : ℂ | ‖x‖ ≤ 8}) ≤ + ENNReal.ofReal (C*b.size^(1/100:ℝ)*b.mass) := by + obtain ⟨ψ,B,L,hB,hL,hψ,hψc,hψ1,hψs,hψB,hψL⟩ := exists_kernel_cutoff + let A : ℝ := (2*B*(1+8)^2)^(3/2:ℝ)*(4*Real.pi*(4*8)^(1/2:ℝ)) + let Z : ℝ := 8*Real.pi*(2*B*(1+8)^2)^(3/2:ℝ)+ + Real.pi*(8*B*(1+8)^2+(64/3:ℝ)*L*(1+8)^3)^(3/2:ℝ) + have hA : 0 ≤ A := by dsimp [A]; positivity + have hZ : 0 ≤ Z := by dsimp [Z]; positivity + let C : ℝ := A^(2/3:ℝ)+Z^(2/3:ℝ)*2^(1/3:ℝ)+1 + have hC : 0 < C := by dsimp [C]; positivity + refine ⟨ψ,C,hC,hψ,hψc,hψ1,hψs,?_⟩ + intro b + have hb0 := b.size_pos.le + have hm0 := b.mass_nonneg + rw [eLpNorm_eq_eLpNorm' (by norm_num : (3/2:ℝ≥0∞) ≠ 0) + (ENNReal.div_ne_top (by norm_num) (by norm_num)) + (potential_aestronglyMeasurable _ (green_measurable ψ hψ.continuous.measurable) b.integrable)] + norm_num only [ENNReal.toReal_div, ENNReal.toReal_ofNat] + by_cases hb : b.size < 1 + · have ha : 0 < 2*b.size := mul_pos (by norm_num) b.size_pos + have hp := green_zero_piece_lp_ae hψ.continuous.measurable hψs hψB hψL (by norm_num : (0:ℝ) < 1+8) + hB hL ha b.center b.integrable (b.zero_mass hb) (b.support hb) + have hn := eLpNorm_three_halves_bound _ hp + change _ ≤ (ENNReal.ofReal (Z*(2*b.size)^(1/2:ℝ)))^(2/3:ℝ)*ENNReal.ofReal b.mass at hn + have he : (ENNReal.ofReal (Z*(2*b.size)^(1/2:ℝ)))^(2/3:ℝ)*ENNReal.ofReal b.mass = + ENNReal.ofReal (Z^(2/3:ℝ)*2^(1/3:ℝ)*b.size^(1/3:ℝ)*b.mass) := by + rw [ENNReal.ofReal_rpow_of_nonneg (by positivity) (by norm_num),← ENNReal.ofReal_mul (by positivity)] + congr 1 + rw [Real.mul_rpow hZ (by positivity),← Real.rpow_mul (by positivity),show (1/2:ℝ)*(2/3)=1/3 by norm_num, + Real.mul_rpow (by norm_num : (0:ℝ) ≤ 2) b.size_pos.le] + ring + rw [he] at hn + apply hn.trans (ENNReal.ofReal_le_ofReal _) + have hbpow : b.size^(1/3:ℝ) ≤ b.size^(1/100:ℝ) := + Real.rpow_le_rpow_of_exponent_ge b.size_pos b.size_le_one (by norm_num) + have hZC : Z^(2/3:ℝ)*2^(1/3:ℝ) ≤ C := by dsimp [C]; linarith [Real.rpow_nonneg hA (2/3)] + exact mul_le_mul_of_nonneg_right + (le_trans (mul_le_mul_of_nonneg_left hbpow (by positivity)) + (mul_le_mul_of_nonneg_right hZC (by positivity))) b.mass_nonneg + · have hb1 : b.size = 1 := le_antisymm b.size_le_one (le_of_not_gt hb) + have hp := green_root_lp_local hψ.continuous.measurable hψs hψB (by norm_num : (1:ℝ) ≤ 8) + (by norm_num : (0:ℝ) < 1+8) hB (by norm_num : (0:ℝ) < 8) b.integrable + have hn := eLpNorm_three_halves_bound _ hp + change _ ≤ (ENNReal.ofReal A)^(2/3:ℝ)*ENNReal.ofReal b.mass at hn + rw [ENNReal.ofReal_rpow_of_nonneg hA (by norm_num),← ENNReal.ofReal_mul (by positivity)] at hn + simp only [hb1,Real.one_rpow,mul_one] + apply hn.trans (ENNReal.ofReal_le_ofReal _) + apply mul_le_mul_of_nonneg_right _ b.mass_nonneg + dsimp [C] + linarith [mul_nonneg (Real.rpow_nonneg hZ (2/3)) (Real.rpow_nonneg (by norm_num : (0:ℝ) ≤ 2) (1/3))] +end PlanePotential + +namespace DiskMaximalTools + +lemma strong_three_halves_norm {f : ℂ → ℝ} (hf : Measurable f) + (hf0 : ∀ x, 0 ≤ f x) [IsFiniteMeasure (volume.withDensity (fun x => ENNReal.ofReal (f x)))] : + eLpNorm (fun x => (rationalMaximal (volume.withDensity (fun x => ENNReal.ofReal (f x))) x).toReal) + (3/2) volume ≤ ENNReal.ofReal ((150*2^(1/2:ℝ))^(2/3:ℝ))*eLpNorm f (3/2) volume := by + have h := strong_rationalMaximal hf hf0 (by norm_num : (1:ℝ) < 3/2) + have hs := ENNReal.rpow_le_rpow h (by norm_num : (0:ℝ) ≤ 2/3) + rw [ENNReal.mul_rpow_of_nonneg _ _ (by norm_num : (0:ℝ) ≤ 2/3)] at hs + have hp : (50*(3/2:ℝ)*2^((3/2:ℝ)-1)/((3/2:ℝ)-1)) = 150*2^(1/2:ℝ) := by + norm_num + ring + rw [hp,ENNReal.ofReal_rpow_of_nonneg (by positivity) (by norm_num)] at hs + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal (by norm_num : (3/2:ℝ≥0∞) ≠ 0) + (ENNReal.div_ne_top (by norm_num) (by norm_num)) + (measurable_rationalMaximal _).ennreal_toReal.aestronglyMeasurable, + eLpNorm_eq_lintegral_rpow_enorm_toReal (by norm_num : (3/2:ℝ≥0∞) ≠ 0) + (ENNReal.div_ne_top (by norm_num) (by norm_num)) hf.aestronglyMeasurable] + norm_num only [ENNReal.toReal_div,ENNReal.toReal_ofNat,one_div_div] + simp only [← ofReal_norm,Real.norm_eq_abs,abs_of_nonneg ENNReal.toReal_nonneg, + abs_of_nonneg (hf0 _),ENNReal.ofReal_rpow_of_nonneg (hf0 _) (by norm_num : (0:ℝ) ≤ 3/2), + ENNReal.ofReal_rpow_of_nonneg ENNReal.toReal_nonneg (by norm_num : (0:ℝ) ≤ 3/2)] at hs ⊢ + exact hs + +lemma lintegral_le_three_halves_norm {f : ℂ → ℝ} (hf : AEStronglyMeasurable f volume) + (hf0 : ∀ x, 0 ≤ f x) {Q : Set ℂ} (hQ : volume Q ≤ 1) : + (∫⁻ x in Q, ENNReal.ofReal (f x)) ≤ eLpNorm f (3/2) volume := by + have h := eLpNorm_le_eLpNorm_mul_rpow_measure_univ + (show (1:ℝ≥0∞) ≤ 3/2 by rw [ENNReal.le_div_iff_mul_le (by norm_num) (by norm_num)]; norm_num) hf.restrict (μ := volume.restrict Q) + have he : (1 / ENNReal.toReal 1 - 1 / ENNReal.toReal (3/2)) = (1/3:ℝ) := by norm_num + rw [he,Measure.restrict_apply_univ] at h + have hpow : (volume Q)^(1/3:ℝ) ≤ 1 := by + simpa using ENNReal.rpow_le_rpow hQ (by norm_num : (0:ℝ) ≤ 1/3) + calc + _ = eLpNorm f 1 (volume.restrict Q) := by + rw [eLpNorm_one_eq_lintegral_enorm hf.restrict] + simp only [← ofReal_norm,Real.norm_eq_abs,abs_of_nonneg (hf0 _)] + _ ≤ eLpNorm f (3/2) (volume.restrict Q)*(volume Q)^(1/3:ℝ) := h + _ ≤ eLpNorm f (3/2) (volume.restrict Q) := by simpa using mul_le_mul_right hpow _ + _ ≤ _ := eLpNorm_mono_measure _ Measure.restrict_le_self +end DiskMaximalTools + +namespace PlanePotential +open LocalCancellation + +/-- The complete local L^(3/2) value estimate for a genuine finite vector +cancellation decomposition, with the common 1/100 price. -/ +theorem local_value_lp : ∃ C : ℝ, 0 < C ∧ + ∀ {ι : Type} [Fintype ι] (b : ι → ErrorPiece 2) {g : ℂ → ℝ}, + ContDiff ℝ 1 g → (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → + (∀ᵐ y, ‖y‖ ≤ 8 → gradient g y = ∑ i, (b i).density y) → + ∃ c : ℝ, eLpNorm (fun x => g x-c) (3/2) (volume.restrict {x : ℂ | ‖x‖ ≤ 8}) ≤ + ENNReal.ofReal (C * errorPrice b (1/100)) := by + obtain ⟨ψ,C,hC,hψ,hψc,hψ1,hψs,hprice⟩ := exists_green_price + obtain ⟨B,hB⟩ := hψc.exists_bound_of_continuous hψ.continuous + have hB0 : 0 ≤ B := (norm_nonneg (ψ 0)).trans (hB 0) + have hψB (z : ℂ) : |ψ z| ≤ B := by simpa only [Real.norm_eq_abs] using hB z + refine ⟨C,hC,?_⟩ + intro ι _ b g hg hD hdecomp + obtain ⟨D,hD⟩ := hD + refine ⟨∫ z, ψ z*g z,?_⟩ + apply (green_decomposition_norm_local hψ.continuous hψc hg hD hψ1 hψs hψB + (by norm_num : (1:ℝ) ≤ 8) (by norm_num : (0:ℝ) < 1+8) hB0 (by norm_num : (0:ℝ) < 8) + (fun i => (b i).density) (fun i => (b i).integrable) hdecomp).trans + apply (Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => hprice (b i))).trans_eq + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => mul_nonneg (mul_nonneg hC.le (Real.rpow_nonneg (b i).size_pos.le _)) (b i).mass_nonneg)] + congr 1 + rw [errorPrice,Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + ring +end PlanePotential + +namespace DiskMoments +open DiskMaximalTools + +lemma signedAverage_sub_const {g : ℂ → ℝ} (hg : Continuous g) (c : ℝ) (x : ℂ) {t : ℝ} (ht : 0 < t) : + signedAverage (fun y => g y-c) x t = signedAverage g x t-c := by + have hi : IntegrableOn g (Metric.ball x t) := + (hg.continuousOn.integrableOn_compact (isCompact_closedBall x t)).mono_set Metric.ball_subset_closedBall + have hc : IntegrableOn (fun _ : ℂ => c) (Metric.ball x t) := integrableOn_const measure_ball_lt_top.ne + unfold signedAverage + rw [integral_sub hi hc,integral_const] + have hv : (volume (Metric.ball x t)).toReal = Real.pi*t^2 := by + rw [volume_disk_real x ht.le,ENNReal.toReal_ofReal (by positivity)] + simp only [Measure.real,Measure.restrict_apply_univ,hv,smul_eq_mul] + field_simp + +/-- A true disk average of a continuous function is controlled by the local +absolute-density maximal function. No maximizing-radius selection is used. -/ +lemma local_average_le {g : ℂ → ℝ} (hg : Continuous g) (c : ℝ) + {x : ℂ} (hx : ‖x‖ ≤ 2) {t : ℝ} (ht : 0 < t) (ht4 : t ≤ 4) : + ENNReal.ofReal |signedAverage g x t-c| ≤ + rationalMaximal (volume.withDensity (fun y => ENNReal.ofReal + (({y : ℂ | ‖y‖ ≤ 8}.indicator (fun y => |g y-c|)) y))) x := by + let f : ℂ → ℝ := {y : ℂ | ‖y‖ ≤ 8}.indicator (fun y => |g y-c|) + have hf : Measurable f := ((hg.measurable.sub measurable_const).abs).indicator + (measurableSet_le measurable_norm measurable_const) + have hfi : Integrable f := by + apply IntegrableOn.integrable_indicator _ (measurableSet_le measurable_norm measurable_const) + apply ContinuousOn.integrableOn_compact + (show IsCompact {y : ℂ | ‖y‖ ≤ 8} by simpa only [Metric.closedBall,dist_zero_right] using isCompact_closedBall (0:ℂ) 8) + exact (hg.sub continuous_const).abs.continuousOn + have hsub (y : ℂ) (hy : y ∈ Metric.ball x t) : ‖y‖ ≤ 8 := by + have hy' : ‖y-x‖ < t := by simpa only [Metric.mem_ball,dist_eq_norm] using hy + have hh := norm_add_le (y-x) x + rw [sub_add_cancel] at hh + linarith + have he : (∫ y in Metric.ball x t, f y) = ∫ y in Metric.ball x t, |g y-c| := by + apply setIntegral_congr_fun measurableSet_ball + intro y hy + simp [f,hsub y hy] + have hav : |signedAverage g x t-c| ≤ (∫ y in Metric.ball x t, f y)/(Real.pi*t^2) := by + rw [← signedAverage_sub_const hg c x ht,signedAverage,abs_div,abs_of_pos (by positivity : 0 < Real.pi*t^2),he] + apply div_le_div_of_nonneg_right _ (by positivity) + simpa only [Real.norm_eq_abs] using norm_integral_le_integral_norm (fun y => g y-c) (μ := volume.restrict (Metric.ball x t)) + have hν : (volume.withDensity (fun y => ENNReal.ofReal (f y))) (Metric.ball x t) = + ENNReal.ofReal (∫ y in Metric.ball x t, f y) := by + rw [withDensity_apply _ measurableSet_ball] + exact (ofReal_integral_eq_lintegral_ofReal hfi.integrableOn + (ae_of_all _ (fun y => by dsimp [f]; exact Set.indicator_nonneg (fun _ _ => abs_nonneg _ ) y))).symm + apply (ENNReal.ofReal_le_ofReal hav).trans + rw [ENNReal.ofReal_div_of_pos (by positivity : 0 < Real.pi*t^2),← hν,← volume_disk_real x ht.le] + exact disk_average_le_rationalMaximal_exact _ x ht +end DiskMoments + +namespace PlanePotential +open LocalCancellation DiskMaximalTools DiskMoments + +/-- Full local value-oscillation price, for every pair of positive radii at +most four. The measurable majorant is an actual centered Euclidean disk +maximal function, not an assumed analytic input. -/ +theorem local_value_majorant : ∃ C : ℝ, 0 < C ∧ + ∀ {ι : Type} [Fintype ι] (b : ι → ErrorPiece 2) {g : ℂ → ℝ}, + ContDiff ℝ 1 g → (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → + (∀ᵐ y, ‖y‖ ≤ 8 → gradient g y = ∑ i, (b i).density y) → + ∀ Q : Set ℂ, volume Q ≤ ENNReal.ofReal 1 → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ x in Q, F x) ≤ ENNReal.ofReal (C*errorPrice b (1/100)) ∧ + ∀ x, ‖x‖ ≤ 2 → ∀ t t', 0 < t → t ≤ 4 → 0 < t' → t' ≤ 4 → + ENNReal.ofReal |signedAverage g x t-signedAverage g x t'| ≤ F x := by + obtain ⟨C,hC,hlocal⟩ := local_value_lp + let K : ℝ := (150*2^(1/2:ℝ))^(2/3:ℝ) + have hK : 0 < K := by dsimp [K]; positivity + refine ⟨2*K*C,by positivity,?_⟩ + intro ι _ b g hg hD hdecomp Q hQ + obtain ⟨c,hc⟩ := hlocal b hg hD hdecomp + let f : ℂ → ℝ := {y : ℂ | ‖y‖ ≤ 8}.indicator (fun y => |g y-c|) + have hf : Measurable f := ((hg.continuous.measurable.sub measurable_const).abs).indicator + (measurableSet_le measurable_norm measurable_const) + have hf0 (y : ℂ) : 0 ≤ f y := Set.indicator_nonneg (fun _ _ => abs_nonneg _) y + have hfi : Integrable f := by + apply IntegrableOn.integrable_indicator _ (measurableSet_le measurable_norm measurable_const) + apply ContinuousOn.integrableOn_compact + (show IsCompact {y : ℂ | ‖y‖ ≤ 8} by simpa only [Metric.closedBall,dist_zero_right] using isCompact_closedBall (0:ℂ) 8) + exact (hg.continuous.sub continuous_const).abs.continuousOn + let ν := volume.withDensity (fun y => ENNReal.ofReal (f y)) + have hν : ν univ = ENNReal.ofReal (∫ y, f y) := by + rw [withDensity_apply _ MeasurableSet.univ,Measure.restrict_univ] + exact (ofReal_integral_eq_lintegral_ofReal hfi (ae_of_all _ hf0)).symm + have : IsFiniteMeasure ν := ⟨by rw [hν]; exact ENNReal.ofReal_lt_top⟩ + let M : ℂ → ℝ := fun x => (rationalMaximal ν x).toReal + have hM : Measurable M := (measurable_rationalMaximal ν).ennreal_toReal + have hMf : ∀ x, rationalMaximal ν x ≠ ⊤ := by + obtain ⟨B,hB⟩ := (isCompact_closedBall (0:ℂ) 8).exists_bound_of_continuousOn + (hg.continuous.sub (continuous_const (y := c))).continuousOn + have hbnd (y : ℂ) : f y ≤ max B 0 := by + by_cases hy : ‖y‖ ≤ 8 + · have hby := hB y (by simpa only [Metric.mem_closedBall,dist_zero_right] using hy) + simpa [f, hy, Real.norm_eq_abs] using hby.trans (le_max_left B 0) + · simp [f, hy] + intro x + exact ne_of_lt ((rationalMaximal_le_of_density_le (fun y => ENNReal.ofReal_le_ofReal (hbnd y)) x).trans_lt ENNReal.ofReal_lt_top) + have hfnorm : eLpNorm f (3/2) volume = eLpNorm (fun x => g x-c) (3/2) (volume.restrict {x : ℂ | ‖x‖ ≤ 8}) := by + rw [eLpNorm_indicator_eq_eLpNorm_restrict (measurableSet_le measurable_norm measurable_const)] + simpa only [Real.norm_eq_abs] using eLpNorm_norm (fun x => g x-c) (p := (3/2:ℝ≥0∞)) (μ := volume.restrict {x : ℂ | ‖x‖ ≤ 8}) + (hg.continuous.measurable.sub measurable_const).aestronglyMeasurable + have hn : eLpNorm M (3/2) volume ≤ ENNReal.ofReal K*ENNReal.ofReal (C*errorPrice b (1/100)) := by + apply (strong_three_halves_norm hf hf0).trans + apply mul_le_mul_right _ _ + simpa only [hfnorm] using hc + refine ⟨fun x => ENNReal.ofReal 2*ENNReal.ofReal (M x),measurable_const.mul hM.ennreal_ofReal,?_,?_⟩ + · rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top] + apply (mul_le_mul_right (lintegral_le_three_halves_norm hM.aestronglyMeasurable + (fun _ => ENNReal.toReal_nonneg) (by simpa using hQ)) _).trans + apply (mul_le_mul_right hn _).trans_eq + rw [← ENNReal.ofReal_mul hK.le,← ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 2)] + congr 1 + ring + · intro x hx t t' ht ht4 ht' ht4' + have ha : |signedAverage g x t-c| ≤ M x := + (ENNReal.ofReal_le_iff_le_toReal (hMf x)).mp (local_average_le hg.continuous c hx ht ht4) + have hb : |signedAverage g x t'-c| ≤ M x := + (ENNReal.ofReal_le_iff_le_toReal (hMf x)).mp (local_average_le hg.continuous c hx ht' ht4') + change ENNReal.ofReal _ ≤ ENNReal.ofReal 2 * ENNReal.ofReal (M x) + rw [← ENNReal.ofReal_mul (by norm_num : (0:ℝ) ≤ 2)] + apply ENNReal.ofReal_le_ofReal + have hh := abs_sub_le (signedAverage g x t) c (signedAverage g x t') + rw [abs_sub_comm c] at hh + linarith +end PlanePotential + +namespace AffineDensities +lemma fderiv_affine_bound {g : ℂ → ℝ} (hg : Differentiable ℝ g) (p : ℂ) (r : ℝ) + {D : ℝ} (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) : + ∃ B : ℝ, ∀ X, ‖fderiv ℝ (fun Y => g (p+r • Y)) X‖ ≤ B := by + refine ⟨D*|r|,?_⟩ + intro X + have hA : HasFDerivAt (fun Y : ℂ => p+r • Y) + (r • ContinuousLinearMap.id ℝ ℂ) X := by + simpa using ((hasFDerivAt_id X).const_smul r).const_add p + have hd := (hg (p+r • X)).hasFDerivAt.comp X hA + simp only [Function.comp_def] at hd + rw [hd.fderiv] + apply (ContinuousLinearMap.opNorm_comp_le _ _).trans + simp only [norm_smul,Real.norm_eq_abs,ContinuousLinearMap.norm_id, mul_one] + exact mul_le_mul_of_nonneg_right (hD _) (abs_nonneg _) +end AffineDensities + +namespace CommonPrices +open DyadicHats ConeCoordinates LocalCancellation AffineDensities DirectionNeighbors Finset DiskMoments PricePieces + +/-- The actual common-price value estimate, including every terminal error and +all roots. This is the third local analytic input to signed run assembly. -/ +theorem value_cell_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → ∀ (k : ℕ) (p : ℤ × ℤ) + {n : ℂ}, n ∈ fixedPalette.labels → ∀ Q : Set ℂ, volume Q ≤ ENNReal.ofReal 1 → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ X in Q, F X) ≤ ENNReal.ofReal (C*(scale r k)⁻¹* + (rootMass (gradient g) r k (cellRoots N p)+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ X, ‖X‖ ≤ 2 → ∀ t t', 0 < t → t ≤ 4 → 0 < t' → t' ≤ 4 → + ENNReal.ofReal |signedAverage (fun Y => g (point (scale r k) p+scale r k • Y)) X t- + signedAverage (fun Y => g (point (scale r k) p+scale r k • Y)) X t'| ≤ F X := by + obtain ⟨C,hC,hmajor⟩ := PlanePotential.local_value_majorant + refine ⟨4*C,by positivity,?_⟩ + intro N r R hr hR hN g hg hh hsupp hD k p n hn Q hQ + let b := sizeErrors hr hh k (point (scale r k) p) (cellRoots N p) n + have hg' : ContDiff ℝ 1 (fun Y => g (point (scale r k) p+scale r k • Y)) := hg.comp (by fun_prop) + obtain ⟨D,hD⟩ := hD + have hD' := fderiv_affine_bound (hg.differentiable one_ne_zero) (point (scale r k) p) (scale r k) hD + have hd : ∀ᵐ X, ‖X‖ ≤ 8 → + gradient (fun Y => g (point (scale r k) p+scale r k • Y)) X = ∑ i, (b i).density X := by + filter_upwards with X hX + exact (sizeErrors_gradient hr hR hN (hg.differentiable one_ne_zero) hh hsupp k p + (fixedPalette.unit n hn) X (by linarith)).symm + obtain ⟨F,hFm,hFi,hFb⟩ := hmajor b hg' hD' hd Q hQ + refine ⟨F,hFm,?_,hFb⟩ + apply hFi.trans + apply ENNReal.ofReal_le_ofReal + have hb := sizeErrors_price hr hR hN hh hsupp k (point (scale r k) p) (cellRoots N p) hn + have hDp : 0 ≤ cellPrice N r (gradient g) k (cellRoots N p) := + sum_nonneg (fun q _ => rootPrice_nonneg hr hR hN hh hsupp k q) + change errorPrice b (1/100) ≤ _ at hb + have hrk := scale_pos hr k + nlinarith [mul_le_mul_of_nonneg_left hb hC.le,inv_nonneg.mpr hrk.le, + mul_nonneg (inv_nonneg.mpr hrk.le) hDp] +end CommonPrices + +namespace PhysicalCells +open MeasureTheory Set + +def unitCell : Set ℂ := {X | X.re ∈ Ico (0:ℝ) 1 ∧ X.im ∈ Ico (0:ℝ) 1} +def toUnit (p : ℂ) (r : ℝ) (y : ℂ) : ℂ := r⁻¹ • (y-p) +def cell (p : ℂ) (r : ℝ) : Set ℂ := toUnit p r ⁻¹' unitCell + +lemma unitCell_measurable : MeasurableSet unitCell := + (Complex.measurable_re measurableSet_Ico).inter (Complex.measurable_im measurableSet_Ico) +lemma toUnit_continuous (p : ℂ) (r : ℝ) : Continuous (toUnit p r) := by unfold toUnit; fun_prop +lemma cell_measurable (p : ℂ) (r : ℝ) : MeasurableSet (cell p r) := + (toUnit_continuous p r).measurable unitCell_measurable +lemma volume_unitCell : volume unitCell = 1 := by + have he := Complex.volume_preserving_equiv_real_prod.measure_preimage + (s := Ico (0:ℝ) 1 ×ˢ Ico (0:ℝ) 1) (measurableSet_Ico.prod measurableSet_Ico).nullMeasurableSet + change volume unitCell = _ at he + rw [he] + change (volume.prod volume) (Ico (0:ℝ) 1 ×ˢ Ico (0:ℝ) 1) = 1 + rw [Measure.prod_prod] + norm_num +lemma norm_unitCell {X : ℂ} (hX : X ∈ unitCell) : ‖X‖ ≤ 2 := by + have h := Complex.norm_le_abs_re_add_abs_im X + rw [abs_of_nonneg hX.1.1,abs_of_nonneg hX.2.1] at h + linarith [hX.1.2,hX.2.2] +lemma toUnit_affine (p : ℂ) {r : ℝ} (hr : r ≠ 0) (X : ℂ) : toUnit p r (p+r • X) = X := by + simp [toUnit,hr] +lemma affine_toUnit (p : ℂ) {r : ℝ} (hr : r ≠ 0) (y : ℂ) : p+r • toUnit p r y = y := by + simp [toUnit,hr] + +lemma lintegral_smul (F : ℂ → ℝ≥0∞) {r : ℝ} (hr : r ≠ 0) : + (∫⁻ X : ℂ, F (r • X)) = ENNReal.ofReal ((r^2)⁻¹)*(∫⁻ y, F y) := by + have he := (lintegral_map_equiv (μ := volume) F + (Homeomorph.smul (isUnit_iff_ne_zero.mpr hr).unit).toMeasurableEquiv).symm + change (∫⁻ X : ℂ, F (r • X)) = ∫⁻ y, F y ∂Measure.map (fun X : ℂ => r • X) volume at he + rw [he,Measure.map_addHaar_smul volume hr,lintegral_smul_measure] + simp only [Complex.finrank_real_complex,abs_of_nonneg (inv_nonneg.mpr (sq_nonneg r)),smul_eq_mul] + +lemma lintegral_toUnit (F : ℂ → ℝ≥0∞) (p : ℂ) {r : ℝ} (hr : r ≠ 0) : + (∫⁻ y : ℂ, F (toUnit p r y)) = ENNReal.ofReal (r^2)*(∫⁻ X, F X) := by + calc + (∫⁻ y : ℂ, F (r⁻¹ • (y-p))) = ∫⁻ y : ℂ, F (r⁻¹ • y) := + lintegral_sub_right_eq_self (μ := (volume : Measure ℂ)) (fun y : ℂ => F (r⁻¹ • y)) p + _ = _ := by rw [lintegral_smul _ (inv_ne_zero hr),inv_pow,inv_inv] + +/-- Exact physical-space change of variables, with the two-dimensional volume +factor and no integrability or measurability assumptions on the majorant. -/ +lemma lintegral_cell (F : ℂ → ℝ≥0∞) (p : ℂ) {r : ℝ} (hr : r ≠ 0) : + (∫⁻ y in cell p r, F y) = ENNReal.ofReal (r^2)*∫⁻ X in unitCell, F (p+r • X) := by + rw [← lintegral_indicator (cell_measurable p r),← lintegral_indicator unitCell_measurable] + have he (y : ℂ) : (cell p r).indicator F y = + unitCell.indicator (fun X => F (p+r • X)) (toUnit p r y) := by + by_cases hy : y ∈ cell p r + · rw [Set.indicator_of_mem hy,Set.indicator_of_mem (show toUnit p r y ∈ unitCell from hy),affine_toUnit p hr] + · rw [Set.indicator_of_notMem hy,Set.indicator_of_notMem (show toUnit p r y ∉ unitCell from hy)] + simp_rw [he] + exact lintegral_toUnit _ p hr + +lemma cell_majorant {F : ℂ → ℝ≥0∞} (p : ℂ) {r : ℝ} (hr : r ≠ 0) : + (∫⁻ y in cell p r, F (toUnit p r y)) = ENNReal.ofReal (r^2)*∫⁻ X in unitCell, F X := by + rw [lintegral_cell _ p hr] + simp only [toUnit_affine p hr] +end PhysicalCells + +namespace DiskMoments +lemma signedAverage_affine (g : ℂ → ℝ) (p X : ℂ) {r t : ℝ} (hr : 0 < r) (ht : 0 < t) : + signedAverage (fun Y => g (p+r • Y)) X t = signedAverage g (p+r • X) (r*t) := by + rw [signedAverage_fixedDomain _ _ ht,signedAverage_fixedDomain _ _ (mul_pos hr ht)] + congr 1 + apply setIntegral_congr_fun measurableSet_ball + intro Z _ + change g (p+r • (X+t • Z)) = g (p+r • X+(r*t) • Z) + congr 1 + rw [smul_add,smul_smul] + abel + +lemma gradient_signedAverage {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (x : ℂ) {t : ℝ} (ht : 0 < t) : + gradient (fun y => signedAverage g y t) x = + (Real.pi*t^2)⁻¹ • ∫ y in Metric.ball x t, gradient g y := by + have hi : IntegrableOn (fun z : ℂ => fderiv ℝ g (x+t • z)) (Metric.ball 0 1) := + (((hg.continuous_fderiv one_ne_zero).comp (by fun_prop)).continuousOn.integrableOn_compact + (isCompact_closedBall (0:ℂ) 1)).mono_set Metric.ball_subset_closedBall + rw [gradient,(hasFDerivAt_signedAverage hg hD x ht).fderiv,map_smul] + have he := (InnerProductSpace.toDual ℝ ℂ).symm.toContinuousLinearMap.integral_comp_comm hi + change (∫ z in Metric.ball (0:ℂ) 1, (InnerProductSpace.toDual ℝ ℂ).symm (fderiv ℝ g (x+t • z))) = + (InnerProductSpace.toDual ℝ ℂ).symm (∫ z in Metric.ball (0:ℂ) 1, fderiv ℝ g (x+t • z)) at he + rw [← he] + change (1/Real.pi) • (∫ z in Metric.ball (0:ℂ) 1, gradient g (x+t • z)) = _ + rw [integral_scale_ball (fun z => gradient g (x+z)) ht,integral_translate_ball,smul_smul] + congr 1 + ring + +lemma gradient_average_affine {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (p X : ℂ) {r t : ℝ} (hr : 0 < r) (ht : 0 < t) : + gradient (fun Y => signedAverage (fun Z => g (p+r • Z)) Y t) X = + r • gradient (fun y => signedAverage g y (r*t)) (p+r • X) := by + have he : (fun Y => signedAverage (fun Z => g (p+r • Z)) Y t) = + (fun Y => signedAverage g (p+r • Y) (r*t)) := by + funext Y + exact signedAverage_affine g p Y hr ht + rw [he] + exact AffineDensities.gradient_affine (fun y => + (hasFDerivAt_signedAverage hg hD y (mul_pos hr ht)).differentiableAt) p r X + +def PhysicalNeighborhoodRadius (g : ℂ → ℝ) (r : ℝ) (x : ℂ) (t : ℝ) : Prop := + t ∈ Icc r (2*r) ∧ ∀ s, 0 < s → |s-t| ≤ r/4 → signedAverage g x s ≤ signedAverage g x t + +def PhysicalEndpointRadius (g : ℂ → ℝ) (r : ℝ) (x : ℂ) (t : ℝ) : Prop := + t ∈ Icc r (2*r) ∧ (t = r ∨ t = 2*r ∨ ∀ s ∈ Icc r (2*r), signedAverage g x s ≤ signedAverage g x t) + +lemma neighborhoodRadius_affine {g : ℂ → ℝ} (p X : ℂ) {r t : ℝ} (hr : 0 < r) + (ht : PhysicalNeighborhoodRadius g r (p+r • X) (r*t)) : + NeighborhoodRadius (fun Y => g (p+r • Y)) X t := by + have ht1 : 1 ≤ t := (le_of_mul_le_mul_left (by simpa only [mul_one] using ht.1.1) hr) + have ht2 : t ≤ 2 := (le_of_mul_le_mul_left (by simpa only [mul_comm 2 r] using ht.1.2) hr) + refine ⟨⟨ht1,ht2⟩,?_⟩ + intro s hs habs + rw [signedAverage_affine _ _ _ hr hs,signedAverage_affine _ _ _ hr (by linarith)] + apply ht.2 (r*s) (mul_pos hr hs) + rw [← mul_sub,abs_mul,abs_of_pos hr] + nlinarith + +lemma endpointRadius_affine {g : ℂ → ℝ} (p X : ℂ) {r t : ℝ} (hr : 0 < r) + (ht : PhysicalEndpointRadius g r (p+r • X) (r*t)) : + EndpointRadius (fun Y => g (p+r • Y)) X t := by + have ht1 : 1 ≤ t := (le_of_mul_le_mul_left (by simpa only [mul_one] using ht.1.1) hr) + have ht2 : t ≤ 2 := (le_of_mul_le_mul_left (by simpa only [mul_comm 2 r] using ht.1.2) hr) + refine ⟨⟨ht1,ht2⟩,?_⟩ + rcases ht.2 with he | he | he + · left + nlinarith + · right; left + nlinarith + · right; right + intro s hs + rw [signedAverage_affine _ _ _ hr (by linarith [hs.1]),signedAverage_affine _ _ _ hr (by linarith)] + exact he (r*s) ⟨by nlinarith [hs.1],by nlinarith [hs.2]⟩ +end DiskMoments + +namespace PhysicalCells +lemma derivative_majorant_integral {F : ℂ → ℝ≥0∞} {C P : ℝ} (p : ℂ) {r : ℝ} + (hr : 0 < r) (hF : (∫⁻ X in unitCell, F X) ≤ ENNReal.ofReal (C*r⁻¹*P)) : + (∫⁻ y in cell p r, ENNReal.ofReal r⁻¹*F (toUnit p r y)) ≤ ENNReal.ofReal (C*P) := by + rw [lintegral_const_mul' _ _ ENNReal.ofReal_ne_top,cell_majorant p hr.ne'] + apply (mul_le_mul' le_rfl (mul_le_mul' le_rfl hF)).trans_eq + rw [← ENNReal.ofReal_mul (sq_nonneg r),← ENNReal.ofReal_mul (inv_nonneg.mpr hr.le)] + congr 1 + field_simp + +lemma value_majorant_integral {F : ℂ → ℝ≥0∞} {C P : ℝ} (p : ℂ) {r : ℝ} + (hr : 0 < r) (hF : (∫⁻ X in unitCell, F X) ≤ ENNReal.ofReal (C*r⁻¹*P)) : + (∫⁻ y in cell p r, F (toUnit p r y)) ≤ ENNReal.ofReal (C*r*P) := by + rw [cell_majorant p hr.ne'] + apply (mul_le_mul' le_rfl hF).trans_eq + rw [← ENNReal.ofReal_mul (sq_nonneg r)] + congr 1 + field_simp +end PhysicalCells + +namespace DiskMoments +lemma average_gradient_norm_le {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (x : ℂ) {t : ℝ} (ht : 1 ≤ t) : + ‖gradient (fun y => signedAverage g y t) x‖ ≤ ‖∫ y in Metric.ball x t, gradient g y‖ := by + have hp : 0 < Real.pi*t^2 := mul_pos Real.pi_pos (sq_pos_of_pos (by linarith)) + have h1 : 1 ≤ Real.pi*t^2 := by nlinarith [Real.pi_gt_three,sq_nonneg (t-1)] + rw [gradient_signedAverage hg hD x (by linarith),norm_smul,Real.norm_eq_abs,abs_of_pos (inv_pos.mpr hp)] + exact mul_le_of_le_one_left (norm_nonneg _) ((inv_le_one₀ hp).mpr h1) + +lemma average_gradient_negative_le {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (x n : ℂ) {t : ℝ} (ht : 1 ≤ t) : + max 0 (-inner ℝ n (gradient (fun y => signedAverage g y t) x)) ≤ + max 0 (-inner ℝ n (∫ y in Metric.ball x t, gradient g y)) := by + have hp : 0 < Real.pi*t^2 := mul_pos Real.pi_pos (sq_pos_of_pos (by linarith)) + have h1 : 1 ≤ Real.pi*t^2 := by nlinarith [Real.pi_gt_three,sq_nonneg (t-1)] + rw [gradient_signedAverage hg hD x (by linarith),inner_smul_right,← mul_neg, + ← mul_zero (Real.pi*t^2)⁻¹,← mul_max_of_nonneg _ _ (inv_nonneg.mpr hp.le)] + simp only [mul_zero] + exact mul_le_of_le_one_left (le_max_left _ _) ((inv_le_one₀ hp).mpr h1) + +lemma physical_gradient_norm_majorant {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (p X : ℂ) {r t : ℝ} (hr : 0 < r) (ht : 0 < t) + {F : ℝ≥0∞} + (hF : ENNReal.ofReal ‖gradient (fun Y => signedAverage (fun Z => g (p+r • Z)) Y t) X‖ ≤ F) : + ENNReal.ofReal ‖gradient (fun y => signedAverage g y (r*t)) (p+r • X)‖ ≤ + ENNReal.ofReal r⁻¹*F := by + have h : ENNReal.ofReal r⁻¹*_ ≤ ENNReal.ofReal r⁻¹*F := mul_le_mul' le_rfl hF + rw [gradient_average_affine hg hD p X hr ht,norm_smul,Real.norm_eq_abs,abs_of_pos hr, + ← ENNReal.ofReal_mul (inv_nonneg.mpr hr.le),inv_mul_cancel_left₀ hr.ne'] at h + exact h + +lemma physical_gradient_negative_majorant {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (p X n : ℂ) {r t : ℝ} (hr : 0 < r) (ht : 0 < t) + {F : ℝ≥0∞} + (hF : ENNReal.ofReal (max 0 (-inner ℝ n + (gradient (fun Y => signedAverage (fun Z => g (p+r • Z)) Y t) X))) ≤ F) : + ENNReal.ofReal (max 0 (-inner ℝ n (gradient (fun y => signedAverage g y (r*t)) (p+r • X)))) ≤ + ENNReal.ofReal r⁻¹*F := by + have h : ENNReal.ofReal r⁻¹*_ ≤ ENNReal.ofReal r⁻¹*F := mul_le_mul' le_rfl hF + rw [gradient_average_affine hg hD p X hr ht,inner_smul_right,← mul_neg, + ← mul_zero r,← mul_max_of_nonneg _ _ hr.le, + ← ENNReal.ofReal_mul (inv_nonneg.mpr hr.le),inv_mul_cancel_left₀ hr.ne'] at h + simpa only [mul_zero] using h +end DiskMoments + +namespace CommonPrices +open DyadicHats ConeCoordinates LocalCancellation AffineDensities DirectionNeighbors Finset DiskMoments PricePieces PhysicalCells + +theorem physical_directional_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → ∀ (k : ℕ) (p : ℤ × ℤ) + {n : ℂ}, n ∈ fixedPalette.labels → ∀ {s : ℝ}, (s = 1 ∨ s = -1) → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ y in cell (point (scale r k) p) (scale r k), F y) ≤ ENNReal.ofReal + (C*(badPrice (gradient g) r k (cellRoots N p) n+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ y ∈ cell (point (scale r k) p) (scale r k), ∀ t, + PhysicalNeighborhoodRadius g (scale r k) y t → + ENNReal.ofReal (max 0 (-inner ℝ (axis n s) (gradient (fun z => signedAverage g z t) y))) ≤ F y := by + obtain ⟨C,hC,hmajor⟩ := directional_cell_price + refine ⟨C,hC,?_⟩ + intro N r R hr hR hN g hg hh hsupp hD k p n hn s hs + obtain ⟨D,hD⟩ := hD + obtain ⟨D',hD'⟩ := fderiv_affine_bound (hg.differentiable one_ne_zero) (point (scale r k) p) (scale r k) hD + obtain ⟨F,hFm,hFi,hFb⟩ := hmajor hr hR hN hg hh hsupp k p hn hs unitCell (by rw [volume_unitCell]; norm_num) + refine ⟨fun y => ENNReal.ofReal (scale r k)⁻¹*F (toUnit (point (scale r k) p) (scale r k) y), + measurable_const.mul (hFm.comp (toUnit_continuous _ _).measurable), + derivative_majorant_integral _ (scale_pos hr k) hFi,?_⟩ + intro y hy t ht + let X := toUnit (point (scale r k) p) (scale r k) y + have hX : ‖X‖ ≤ 2 := norm_unitCell hy + have he : point (scale r k) p+scale r k • X = y := affine_toUnit _ (scale_pos hr k).ne' y + have ht' : PhysicalNeighborhoodRadius g (scale r k) + (point (scale r k) p+scale r k • X) (scale r k*(t/scale r k)) := by + simpa only [he,mul_div_cancel₀ _ (scale_pos hr k).ne'] using ht + have htn := neighborhoodRadius_affine _ X (scale_pos hr k) ht' + have hg' : ContDiff ℝ 1 (fun Z => g (point (scale r k) p+scale r k • Z)) := hg.comp (by fun_prop) + have hb := (ENNReal.ofReal_le_ofReal (average_gradient_negative_le hg' hD' X (axis n s) htn.1.1)).trans + (hFb X hX _ htn) + have hf := physical_gradient_negative_majorant hg hD (point (scale r k) p) X (axis n s) + (scale_pos hr k) (by linarith [htn.1.1]) hb + simpa only [he,mul_div_cancel₀ _ (scale_pos hr k).ne'] using hf + +theorem physical_size_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → ∀ (k : ℕ) (p : ℤ × ℤ) + {n : ℂ}, n ∈ fixedPalette.labels → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ y in cell (point (scale r k) p) (scale r k), F y) ≤ ENNReal.ofReal + (C*(rootMass (gradient g) r k (cellRoots N p)+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ y ∈ cell (point (scale r k) p) (scale r k), ∀ t, + PhysicalEndpointRadius g (scale r k) y t → + ENNReal.ofReal ‖gradient (fun z => signedAverage g z t) y‖ ≤ F y := by + obtain ⟨C,hC,hmajor⟩ := size_cell_price + refine ⟨C,hC,?_⟩ + intro N r R hr hR hN g hg hh hsupp hD k p n hn + obtain ⟨D,hD⟩ := hD + obtain ⟨D',hD'⟩ := fderiv_affine_bound (hg.differentiable one_ne_zero) (point (scale r k) p) (scale r k) hD + obtain ⟨F,hFm,hFi,hFb⟩ := hmajor hr hR hN hg hh hsupp k p hn unitCell (by rw [volume_unitCell]; norm_num) + refine ⟨fun y => ENNReal.ofReal (scale r k)⁻¹*F (toUnit (point (scale r k) p) (scale r k) y), + measurable_const.mul (hFm.comp (toUnit_continuous _ _).measurable), + derivative_majorant_integral _ (scale_pos hr k) hFi,?_⟩ + intro y hy t ht + let X := toUnit (point (scale r k) p) (scale r k) y + have hX : ‖X‖ ≤ 2 := norm_unitCell hy + have he : point (scale r k) p+scale r k • X = y := affine_toUnit _ (scale_pos hr k).ne' y + have ht' : PhysicalEndpointRadius g (scale r k) + (point (scale r k) p+scale r k • X) (scale r k*(t/scale r k)) := by + simpa only [he,mul_div_cancel₀ _ (scale_pos hr k).ne'] using ht + have htn := endpointRadius_affine _ X (scale_pos hr k) ht' + have hg' : ContDiff ℝ 1 (fun Z => g (point (scale r k) p+scale r k • Z)) := hg.comp (by fun_prop) + have hb := (ENNReal.ofReal_le_ofReal (average_gradient_norm_le hg' hD' X htn.1.1)).trans + (hFb X hX _ htn) + have hf := physical_gradient_norm_majorant hg hD (point (scale r k) p) X + (scale_pos hr k) (by linarith [htn.1.1]) hb + simpa only [he,mul_div_cancel₀ _ (scale_pos hr k).ne'] using hf + +theorem physical_value_price : ∃ C : ℝ, 0 < C ∧ + ∀ {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) (hN : R/r+1 ≤ (N:ℝ)) + {g : ℂ → ℝ}, ContDiff ℝ 1 g → Integrable (gradient g) → + (∀ y, gradient g y ≠ 0 → ‖y‖ ≤ R) → + (∃ D : ℝ, ∀ y, ‖fderiv ℝ g y‖ ≤ D) → ∀ (k : ℕ) (p : ℤ × ℤ) + {n : ℂ}, n ∈ fixedPalette.labels → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ y in cell (point (scale r k) p) (scale r k), F y) ≤ ENNReal.ofReal + (C*scale r k*(rootMass (gradient g) r k (cellRoots N p)+cellPrice N r (gradient g) k (cellRoots N p))) ∧ + ∀ y ∈ cell (point (scale r k) p) (scale r k), ∀ t t', + 0 < t → t ≤ 4*scale r k → 0 < t' → t' ≤ 4*scale r k → + ENNReal.ofReal |signedAverage g y t-signedAverage g y t'| ≤ F y := by + obtain ⟨C,hC,hmajor⟩ := value_cell_price + refine ⟨C,hC,?_⟩ + intro N r R hr hR hN g hg hh hsupp hD k p n hn + obtain ⟨F,hFm,hFi,hFb⟩ := hmajor hr hR hN hg hh hsupp hD k p hn unitCell (by rw [volume_unitCell]; norm_num) + refine ⟨fun y => F (toUnit (point (scale r k) p) (scale r k) y), + hFm.comp (toUnit_continuous _ _).measurable, + value_majorant_integral _ (scale_pos hr k) hFi,?_⟩ + intro y hy t t' ht hb ht' hb' + let X := toUnit (point (scale r k) p) (scale r k) y + have he : point (scale r k) p+scale r k • X = y := affine_toUnit _ (scale_pos hr k).ne' y + have hrk := scale_pos hr k + have hf := hFb X (norm_unitCell hy) (t/scale r k) (t'/scale r k) + (div_pos ht hrk) ((div_le_iff₀ hrk).mpr hb) (div_pos ht' hrk) ((div_le_iff₀ hrk).mpr hb') + simpa only [signedAverage_affine _ _ _ hrk (div_pos ht hrk), + signedAverage_affine _ _ _ hrk (div_pos ht' hrk),he,mul_div_cancel₀ _ hrk.ne'] using hf +end CommonPrices + +namespace DiskMoments +lemma signedAverage_abs_le {g : ℂ → ℝ} {M : ℝ} (hM : ∀ y, |g y| ≤ M) + (x : ℂ) {t : ℝ} (ht : 0 < t) : |signedAverage g x t| ≤ M := by + rw [signedAverage_fixedDomain g x ht,abs_div,abs_of_pos Real.pi_pos] + have : IsFiniteMeasure (volume.restrict (Metric.ball (0:ℂ) 1)) := ⟨by simp⟩ + have hi := norm_integral_le_of_norm_le_const (μ := volume.restrict (Metric.ball (0:ℂ) 1)) + (C := M) (f := fun z : ℂ => g (x+t • z)) (ae_of_all _ (fun z => by simpa only [Real.norm_eq_abs] using hM (x+t • z))) + have hv : (volume.restrict (Metric.ball (0:ℂ) 1)).real univ = Real.pi := by + simp [measureReal_def,Complex.volume_ball] + rw [hv,Real.norm_eq_abs] at hi + exact (div_le_iff₀ Real.pi_pos).mpr hi + +def oscillationSet (g : ℂ → ℝ) (r : ℝ) (x : ℂ) : Set ℝ := + {a | ∃ t t', 0 < t ∧ t ≤ 4*r ∧ 0 < t' ∧ t' ≤ 4*r ∧ a = |signedAverage g x t-signedAverage g x t'|} +def oscillation (g : ℂ → ℝ) (r : ℝ) (x : ℂ) : ℝ := sSup (oscillationSet g r x) + +lemma oscillationSet_zero (g : ℂ → ℝ) {r : ℝ} (hr : 0 < r) (x : ℂ) : + 0 ∈ oscillationSet g r x := ⟨r,r,hr,by linarith,hr,by linarith,by simp⟩ +lemma oscillationSet_bdd {g : ℂ → ℝ} (hg : Continuous g) (hc : HasCompactSupport g) (r : ℝ) (x : ℂ) : + BddAbove (oscillationSet g r x) := by + obtain ⟨M,hM⟩ := hc.exists_bound_of_continuous hg + refine ⟨2*M,?_⟩ + rintro a ⟨t,t',ht,_,ht',_,rfl⟩ + have hb : ∀ y, |g y| ≤ M := by simpa only [Real.norm_eq_abs] using hM + have h1 := signedAverage_abs_le hb x ht + have h2 := signedAverage_abs_le hb x ht' + linarith [abs_sub (signedAverage g x t) (signedAverage g x t')] +lemma oscillation_nonneg {g : ℂ → ℝ} (hg : Continuous g) (hc : HasCompactSupport g) {r : ℝ} + (hr : 0 < r) (x : ℂ) : 0 ≤ oscillation g r x := + le_csSup (oscillationSet_bdd hg hc r x) (oscillationSet_zero g hr x) +lemma le_oscillation {g : ℂ → ℝ} (hg : Continuous g) (hc : HasCompactSupport g) {r : ℝ} + (x : ℂ) {t t' : ℝ} (ht : 0 < t) (hb : t ≤ 4*r) (ht' : 0 < t') (hb' : t' ≤ 4*r) : + |signedAverage g x t-signedAverage g x t'| ≤ oscillation g r x := + le_csSup (oscillationSet_bdd hg hc r x) ⟨t,t',ht,hb,ht',hb',rfl⟩ +lemma oscillation_majorant {g : ℂ → ℝ} {r : ℝ} (hr : 0 < r) (x : ℂ) {F : ℝ≥0∞} + (hF : ∀ t t', 0 < t → t ≤ 4*r → 0 < t' → t' ≤ 4*r → + ENNReal.ofReal |signedAverage g x t-signedAverage g x t'| ≤ F) : + ENNReal.ofReal (oscillation g r x) ≤ F := by + by_cases htop : F = ⊤ + · simp only [htop,le_top] + · apply (ENNReal.ofReal_le_iff_le_toReal htop).mpr + apply csSup_le ⟨0,oscillationSet_zero g hr x⟩ + rintro a ⟨t,t',ht,hb,ht',hb',rfl⟩ + exact (ENNReal.ofReal_le_iff_le_toReal htop).mp (hF t t' ht hb ht' hb') +end DiskMoments + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Prices.lean b/lean/OAI/Analysis/DiskMaximal/Prices.lean new file mode 100644 index 0000000000000000000000000000000000000000..5dd16f1c5b72c6a1d0263c8c8304a92cb7021a48 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Prices.lean @@ -0,0 +1,436 @@ +import OAI.Analysis.DiskMaximal.DirectionEstimates + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace ScalarCancellation +variable {α ι : Type*} [MeasurableSpace α] {μ : Measure α} [Fintype ι] +lemma roots_nonneg_of_mass (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) + (hm : 0 ≤ ∫ x, refined w f k q x ∂μ) : ∀ x, 0 ≤ roots μ w f k q x := by + cases k with + | zero => exact (root_spec (hf q)).2.2.2.2.1 hm + | succ k => + have hi := integrable_finsetSum Finset.univ + (fun s _ => (roots_integrable w hf k s).const_mul (w k q s)) + have hs := root_spec hi + have he := roots_mass w hf (k+1) q + change (∫ x, root μ _ x ∂μ) = _ at he + rw [hs.2.1] at he + exact hs.2.2.2.2.1 (by rw [he]; exact hm) +end ScalarCancellation + +namespace ConeScalar +open ConeCoordinates DyadicHats IntrinsicMarks + +lemma scalar_integrable {h : ℂ → ℂ} (hh : Integrable h) (c : ℂ →L[ℝ] ℝ) : + Integrable (fun x => c (h x)) := c.integrable_comp hh +lemma scalar_support {h : ℂ → ℂ} {R : ℝ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + (c : ℂ →L[ℝ] ℝ) : ∀ y, c (h y) ≠ 0 → ‖y‖ ≤ R := by + intro y hy + exact hs y (fun h => hy (by simp [h])) +lemma scalar_mass {h : ℂ → ℂ} (hh : Integrable h) (c : ℂ →L[ℝ] ℝ) (r : ℝ) (q : ℤ × ℤ) : + (∫ y, hat r q y*c (h y)) = c (vectorMass h r q) := by + have he := c.integral_comp_comm (integrable_hat_smul hh r q) + simpa only [map_smul,smul_eq_mul,vectorMass] using he + +lemma coordinate_mass_nonneg {n v : ℂ} + (hg : Good n (direction 1 v)) {s : ℝ} (hs : s = 1 ∨ s = -1) : + 0 ≤ coordinate n s v := by + have he := congrArg (coordinate n s) (mass_direction (1:ℂ) v) + rw [map_smul,smul_eq_mul] at he + rw [← he] + exact mul_nonneg (norm_nonneg _) (hs.elim (fun h => h ▸ hg.1) (fun h => h ▸ hg.2)) + +lemma good_root_nonneg {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) {n : ℂ} + (hg : Good n (direction 1 (vectorMass h (scale r k) q))) {s : ℝ} + (hs : s = 1 ∨ s = -1) (y : ℂ) : + 0 ≤ densityRoot N r (fun x => coordinate n s (h x)) k q y := by + apply ScalarCancellation.roots_nonneg_of_mass (weights N) + (pieces_integrable (scalar_integrable hh _) r) k q _ y + simp_rw [refined_eq_density hr hR hN (scalar_support hsupp _),scalar_mass hh] + exact coordinate_mass_nonneg hg hs + +lemma root_mass_norm {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) + {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s^2 = 1) : + (∫ y, ‖densityRoot N r (fun x => coordinate n s (h x)) k q y • axis n s‖) = + |coordinate n s (vectorMass h (scale r k) q)| := by + simp only [norm_smul,axis_norm hn hs,Real.norm_eq_abs,mul_one] + rw [densityRoot_abs_mass hr hR hN (scalar_integrable hh _) (scalar_support hsupp _),scalar_mass hh] + +lemma root_vector_integrable {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) + (r : ℝ) (k : ℕ) (q : Grid N) (n : ℂ) (s : ℝ) : + Integrable (fun y => densityRoot N r (fun x => coordinate n s (h x)) k q y • axis n s) := + (densityRoot_integrable (scalar_integrable hh _) r k q).smul_const _ + +lemma root_bound {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) + {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s^2 = 1) : + (∫ y, ‖densityRoot N r (fun x => coordinate n s (h x)) k q y • axis n s‖) ≤ + 2*scalarMass h (scale r k) q := by + rw [root_mass_norm hr hR hN hh hsupp k q hn hs] + apply coordinate_norm_le hn + exact (abs_le_one_iff_mul_self_le_one).mpr (by nlinarith) + +lemma pair_cone {n : ℂ} (hn : ‖n‖ = 1) {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) + {s : ℝ} (hs : s = 1 ∨ s = -1) : + (1/2:ℝ)*‖a • axis n 1+b • axis n (-1)‖ ≤ inner ℝ (axis n s) + (a • axis n 1+b • axis n (-1)) := by + have hnorm : ‖a • axis n 1+b • axis n (-1)‖ ≤ a+b := by + convert norm_add_le (a • axis n 1) (b • axis n (-1)) using 1 + simp only [norm_smul,Real.norm_eq_abs,abs_of_nonneg ha,abs_of_nonneg hb, + axis_norm hn (by norm_num : (1:ℝ)^2=1),axis_norm hn (by norm_num : (-1:ℝ)^2=1),mul_one] + have hp : inner ℝ (axis n 1) (axis n 1) = 1 := by simp [axis_norm hn (by norm_num : (1:ℝ)^2=1)] + have hm : inner ℝ (axis n (-1)) (axis n (-1)) = 1 := by simp [axis_norm hn (by norm_num : (-1:ℝ)^2=1)] + have hpm := axes_inner hn + have hmp : inner ℝ (axis n (-1)) (axis n 1) = 1/2 := by rw [real_inner_comm]; exact hpm + rcases hs with rfl | rfl <;> simp only [inner_add_right,real_inner_smul_right,hp,hm,hpm,hmp] <;> linarith + +end ConeScalar + +namespace AffineDensities + +def rescale (p : ℂ) (r : ℝ) (h : ℂ → ℂ) (X : ℂ) : ℂ := r • h (p+r • X) + +lemma integrable_rescale {h : ℂ → ℂ} (hh : Integrable h) (p : ℂ) {r : ℝ} (hr : r ≠ 0) : + Integrable (rescale p r h) := ((hh.comp_add_left p).comp_smul hr).smul r + +lemma integral_affine (h : ℂ → ℂ) (p : ℂ) (r : ℝ) : + (∫ X : ℂ, h (p+r • X)) = (r^2)⁻¹ • ∫ y, h y := by + have he := Measure.integral_comp_smul volume (fun y : ℂ => h (p+y)) r + simpa only [Complex.finrank_real_complex,abs_of_nonneg (inv_nonneg.mpr (sq_nonneg r)), + integral_add_left_eq_self] using he + +lemma integral_rescale (h : ℂ → ℂ) (p : ℂ) {r : ℝ} (hr : r ≠ 0) : + (∫ X, rescale p r h X) = r⁻¹ • ∫ y, h y := by + simp only [rescale,integral_smul,integral_affine,smul_smul] + congr 1 + field_simp + +lemma mass_rescale (h : ℂ → ℂ) (p : ℂ) {r : ℝ} (hr : 0 < r) : + (∫ X, ‖rescale p r h X‖) = r⁻¹*(∫ y, ‖h y‖) := by + simp only [rescale,norm_smul,Real.norm_eq_abs,abs_of_nonneg hr.le,integral_const_mul] + have he := Measure.integral_comp_smul volume (fun y : ℂ => ‖h (p+y)‖) r + simp only [Complex.finrank_real_complex,smul_eq_mul, + abs_of_nonneg (inv_nonneg.mpr (sq_nonneg r))] at he + rw [he, integral_add_left_eq_self (fun y : ℂ => ‖h y‖)] + field_simp + +lemma rescale_support {h : ℂ → ℂ} {p z : ℂ} {r t : ℝ} (hr : 0 < r) + (hs : ∀ y, h y ≠ 0 → ‖y-z‖ ≤ t) (X : ℂ) (hX : rescale p r h X ≠ 0) : + ‖X-r⁻¹ • (z-p)‖ ≤ t/r := by + have hh : h (p+r • X) ≠ 0 := fun h => hX (by change r • _ = 0; rw [h,smul_zero]) + have hi := hs (p+r • X) hh + have he : p+r • X-z = r • (X-r⁻¹ • (z-p)) := by + rw [smul_sub,smul_smul,mul_inv_cancel₀ hr.ne',one_smul] + abel + rw [he,norm_smul,Real.norm_eq_abs,abs_of_nonneg hr.le] at hi + exact (le_div_iff₀ hr).mpr (by simpa only [mul_comm] using hi) + +end AffineDensities + +namespace PricePieces +open DyadicHats ConeCoordinates ConeScalar LocalCancellation AffineDensities + +lemma error_support {N : ℕ} {h : ℂ → ℝ} (hh : Integrable h) {r : ℝ} (hr : 0 < r) + (j : ℕ) (q : Grid N) (y : ℂ) (hy : densityError N r h j q y ≠ 0) : + ‖y-point (scale r j) q‖ ≤ 2*scale r j := by + have hn : hat (scale r j) q y ≠ 0 := fun hn => hy ((density_support hr hh j q y hn).2) + simpa only [Metric.mem_closedBall,dist_eq_norm] using support_hat_subset (scale_pos hr j) q hn + +lemma scale_le {r : ℝ} (hr : 0 < r) {j k : ℕ} (hj : j ≤ k) : scale r j ≤ scale r k := by + apply mul_le_mul_of_nonneg_right _ hr.le + exact pow_le_pow_right₀ (by norm_num : (1:ℝ) ≤ 2) hj + +def errorPiece {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) {r : ℝ} (hr : 0 < r) + (k j : ℕ) (hj : j ≤ k) (p : ℂ) (q : Grid N) (n : ℂ) (s : ℝ) : ErrorPiece 2 where + density := rescale p (scale r k) + (fun y => densityError N r (fun x => coordinate n s (h x)) j q y • axis n s) + integrable := integrable_rescale + ((densityError_integrable (scalar_integrable hh _) r j q).smul_const _) p (scale_pos hr k).ne' + size := scale r j / scale r k + size_pos := div_pos (scale_pos hr j) (scale_pos hr k) + size_le_one := (div_le_one (scale_pos hr k)).mpr (scale_le hr hj) + center := (scale r k)⁻¹ • (point (scale r j) q-p) + zero_mass := by + intro _ + rw [integral_rescale _ _ (scale_pos hr k).ne',integral_smul_const, + densityError_zero_mass (scalar_integrable hh _),zero_smul,smul_zero] + support := by + intro _ + apply ae_of_all + intro X hX + have hs : ∀ y, densityError N r (fun x => coordinate n s (h x)) j q y • axis n s ≠ 0 → + ‖y-point (scale r j) q‖ ≤ 2*scale r j := by + intro y hy + apply error_support (scalar_integrable hh _) hr j q y + exact fun h => hy (by rw [h,zero_smul]) + simpa only [mul_div_assoc] using rescale_support (scale_pos hr k) hs X hX + +lemma errorPiece_mass {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k j : ℕ) (hj : j ≤ k) (p : ℂ) (q : Grid N) + {n : ℂ} (hn : ‖n‖ = 1) {s : ℝ} (hs : s^2 = 1) : + (errorPiece hh hr k j hj p q n s).mass ≤ (scale r k)⁻¹* + (2*densityDefect N r (fun x => coordinate n s (h x)) j q) := by + change (∫ X, ‖rescale _ _ _ X‖) ≤ _ + rw [mass_rescale _ _ (scale_pos hr k)] + simp only [norm_smul,axis_norm hn hs,mul_one,Real.norm_eq_abs] + exact mul_le_mul_of_nonneg_left + (densityError_cost hr hR hN (scalar_integrable hh _) (scalar_support hsupp _) j q) + (inv_nonneg.mpr (scale_pos hr k).le) + +end PricePieces + +namespace LocalCancellation + +/-- Multiplication of an error density by a nonnegative path coefficient. +Zero coefficients are retained as genuine zero-density pieces. -/ +def ErrorPiece.weight {Cs : ℝ} (b : ErrorPiece Cs) (w : ℝ) : ErrorPiece Cs where + density := fun y => w • b.density y + integrable := b.integrable.smul w + size := b.size + size_pos := b.size_pos + size_le_one := b.size_le_one + center := b.center + zero_mass := by intro hs; rw [integral_smul,b.zero_mass hs,smul_zero] + support := by + intro hs + filter_upwards [b.support hs] with y hy h + exact hy (fun hz => h (by rw [hz,smul_zero])) + +lemma ErrorPiece.mass_weight {Cs : ℝ} (b : ErrorPiece Cs) {w : ℝ} (hw : 0 ≤ w) : + (b.weight w).mass = w*b.mass := by + simp only [ErrorPiece.mass,ErrorPiece.weight,norm_smul,Real.norm_eq_abs,abs_of_nonneg hw, + integral_const_mul] + +/-- An unrestricted integrable root term is a legitimate size-one piece. -/ +def unitPiece (h : ℂ → ℂ) (hh : Integrable h) (Cs : ℝ) : ErrorPiece Cs where + density := h + integrable := hh + size := 1 + size_pos := zero_lt_one + size_le_one := le_rfl + center := 0 + zero_mass := by intro hs; exact (lt_irrefl (1:ℝ) hs).elim + support := by intro hs; exact (lt_irrefl (1:ℝ) hs).elim + +lemma cone_sum {ι : Type*} {e : ℂ} {κ : ℝ} (hκ : 0 ≤ κ) (s : Finset ι) (v : ι → ℂ) + (hv : ∀ i ∈ s, κ*‖v i‖ ≤ inner ℝ e (v i)) : + κ*‖∑ i ∈ s, v i‖ ≤ inner ℝ e (∑ i ∈ s, v i) := by + calc + _ ≤ κ*∑ i ∈ s, ‖v i‖ := mul_le_mul_of_nonneg_left (norm_sum_le _ _) hκ + _ = ∑ i ∈ s, κ*‖v i‖ := Finset.mul_sum _ _ _ + _ ≤ ∑ i ∈ s, inner ℝ e (v i) := Finset.sum_le_sum hv + _ = _ := (inner_sum _ _ _).symm + +end LocalCancellation + +namespace PricePieces +open DyadicHats ConeCoordinates ConeScalar LocalCancellation AffineDensities + +/-- The vector root comprises the two actual signed scalar surviving roots. -/ +def rootVector (N : ℕ) (r : ℝ) (h : ℂ → ℂ) (k : ℕ) (q : Grid N) (n : ℂ) (y : ℂ) : ℂ := + densityRoot N r (fun x => coordinate n 1 (h x)) k q y • axis n 1+ + densityRoot N r (fun x => coordinate n (-1) (h x)) k q y • axis n (-1) + +def errorVector (N : ℕ) (r : ℝ) (h : ℂ → ℂ) (j : ℕ) (q : Grid N) (n : ℂ) (y : ℂ) : ℂ := + densityError N r (fun x => coordinate n 1 (h x)) j q y • axis n 1+ + densityError N r (fun x => coordinate n (-1) (h x)) j q y • axis n (-1) + +lemma vector_decomposition {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + (k : ℕ) (q : Grid N) {n : ℂ} (hn : ‖n‖ = 1) (y : ℂ) : + hat (scale r k) q y • h y = rootVector N r h k q n y+ + ∑ j ∈ Finset.range (k+1), ∑ s : Grid N, coeff N (k-j) q s • errorVector N r h j s n y := by + have hp := density_decomposition hr hR hN (scalar_support hsupp (coordinate n 1)) k q y + have hm := density_decomposition hr hR hN (scalar_support hsupp (coordinate n (-1))) k q y + have hx := congrArg (fun z : ℂ => hat (scale r k) q y • z) (expansion hn (h y)) + rw [smul_add,smul_smul,smul_smul,hp,hm,add_smul,add_smul] at hx + simp only [rootVector,errorVector,smul_add,smul_smul,Finset.sum_add_distrib] + rw [← hx] + simp only [Finset.sum_smul] + abel + +lemma rootVector_integrable {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) + (r : ℝ) (k : ℕ) (q : Grid N) (n : ℂ) : Integrable (rootVector N r h k q n) := + (root_vector_integrable hh r k q n 1).add (root_vector_integrable hh r k q n (-1)) + +lemma rootVector_cone {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) {n : ℂ} (hn : ‖n‖ = 1) + (hg : Good n (IntrinsicMarks.direction 1 (vectorMass h (scale r k) q))) + {s : ℝ} (hs : s = 1 ∨ s = -1) (y : ℂ) : + (1/2:ℝ)*‖rootVector N r h k q n y‖ ≤ inner ℝ (axis n s) (rootVector N r h k q n y) := + pair_cone hn (good_root_nonneg hr hR hN hh hsupp k q hg (Or.inl rfl) y) + (good_root_nonneg hr hR hN hh hsupp k q hg (Or.inr rfl) y) hs + +lemma rootVector_mass {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) {n : ℂ} (hn : ‖n‖ = 1) : + (∫ y, ‖rootVector N r h k q n y‖) ≤ 4*scalarMass h (scale r k) q := by + calc + _ ≤ (∫ y, ‖densityRoot N r (fun x => coordinate n 1 (h x)) k q y • axis n 1‖)+ + (∫ y, ‖densityRoot N r (fun x => coordinate n (-1) (h x)) k q y • axis n (-1)‖) := + by + rw [← integral_add (root_vector_integrable hh r k q n 1).norm + (root_vector_integrable hh r k q n (-1)).norm] + exact integral_mono (rootVector_integrable hh r k q n).norm + ((root_vector_integrable hh r k q n 1).norm.add + (root_vector_integrable hh r k q n (-1)).norm) (fun y => norm_add_le _ _) + _ ≤ 2*scalarMass h (scale r k) q+2*scalarMass h (scale r k) q := + add_le_add (root_bound hr hR hN hh hsupp k q hn (by norm_num)) + (root_bound hr hR hN hh hsupp k q hn (by norm_num)) + _ = _ := by ring + +end PricePieces + +namespace CommonPrices +open DyadicHats ConeCoordinates ConeScalar Finset + +def rho : ℝ := (1/2:ℝ)^(1/100:ℝ) +lemma rho_pos : 0 < rho := Real.rpow_pos_of_pos (by norm_num) _ +lemma rho_lt_one : rho < 1 := Real.rpow_lt_one (by norm_num) (by norm_num) (by norm_num) + +lemma scale_ratio {r : ℝ} (hr : 0 < r) {j k : ℕ} (hj : j ≤ k) : + scale r j / scale r k = (1/2:ℝ)^(k-j) := by + dsimp [scale] + rw [mul_div_mul_right _ _ hr.ne'] + have hk : k = j+(k-j) := (Nat.add_sub_of_le hj).symm + conv_lhs => rw [hk,pow_add] + simp only [div_pow,one_pow] + field_simp + +lemma scale_discount {r : ℝ} (hr : 0 < r) {j k : ℕ} (hj : j ≤ k) : + (scale r j / scale r k)^(1/100:ℝ) = rho^(k-j) := by + rw [scale_ratio hr hj] + unfold rho + rw [← Real.rpow_natCast,← Real.rpow_mul (by norm_num),mul_comm ((k-j:ℕ):ℝ), + Real.rpow_mul (by norm_num),Real.rpow_natCast] + +/-- A common root price sums the two exact coordinate defects for every +member of one fixed finite palette; it does not depend on the active label. -/ +def rootPrice (N : ℕ) (r : ℝ) (h : ℂ → ℂ) (k : ℕ) (q : Grid N) : ℝ := + ∑ n ∈ fixedPalette.labels, + (scalarPrice N r (fun x => coordinate n 1 (h x)) rho k q+ + scalarPrice N r (fun x => coordinate n (-1) (h x)) rho k q) + +lemma scalarPrice_nonneg {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + 0 ≤ scalarPrice N r h rho k q := by + apply sum_nonneg + intro j _ + apply mul_nonneg (pow_nonneg rho_pos.le _) + exact sum_nonneg (fun s _ => mul_nonneg (coeff_nonneg N (k-j) q s) + (densityDefect_nonneg hr hR hN hh hsupp j s)) + +lemma rootPrice_nonneg {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) : + 0 ≤ rootPrice N r h k q := by + apply sum_nonneg + intro n _ + exact add_nonneg + (scalarPrice_nonneg hr hR hN (scalar_integrable hh _) (scalar_support hsupp _) k q) + (scalarPrice_nonneg hr hR hN (scalar_integrable hh _) (scalar_support hsupp _) k q) + +lemma coordinate_total_le {h : ℂ → ℂ} (hh : Integrable h) {n : ℂ} (hn : ‖n‖ = 1) + {s : ℝ} (hs : |s| ≤ 1) : (∫ x, |coordinate n s (h x)|) ≤ 2*(∫ x, ‖h x‖) := by + rw [← integral_const_mul] + exact integral_mono (scalar_integrable hh _).abs (hh.norm.const_mul 2) + (fun x => coordinate_norm_le hn hs _) + +lemma coordinate_price_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) {n : ℂ} (hn : ‖n‖ = 1) + {s : ℝ} (hs : |s| ≤ 1) (m : ℕ) : + (∑ k ∈ range (m+1), ∑ q : Grid N, + scalarPrice N r (fun x => coordinate n s (h x)) rho k q) ≤ + (1-rho)⁻¹*(∫ x, ‖h x‖) := by + apply (scalarPrice_budget hr hR hN (scalar_integrable hh _) (scalar_support hsupp _) + rho_pos.le rho_lt_one m).trans + apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr (by linarith [rho_lt_one])) + have he := coordinate_total_le hh hn hs + linarith + +/-- The genuine all-label root price has a uniform total budget, including +the terminal scalar splits at the finest scale. -/ +theorem rootPrice_budget {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) : + (∑ k ∈ range (m+1), ∑ q : Grid N, rootPrice N r h k q) ≤ + (2*(fixedPalette.labels.card:ℝ)*(1-rho)⁻¹)*(∫ x, ‖h x‖) := by + unfold rootPrice + simp_rw [Finset.sum_comm (s := univ) (t := fixedPalette.labels)] + rw [Finset.sum_comm] + calc + _ ≤ ∑ _n ∈ fixedPalette.labels, 2*((1-rho)⁻¹*(∫ x, ‖h x‖)) := by + apply sum_le_sum + intro n hn + simp_rw [sum_add_distrib] + have hp := coordinate_price_budget hr hR hN hh hsupp (fixedPalette.unit n hn) + (by norm_num : |(1:ℝ)| ≤ 1) m + have hm := coordinate_price_budget hr hR hN hh hsupp (fixedPalette.unit n hn) + (by norm_num : |(-1:ℝ)| ≤ 1) m + linarith + _ = _ := by rw [sum_const,nsmul_eq_mul]; ring + +end CommonPrices + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Refinement.lean b/lean/OAI/Analysis/DiskMaximal/Refinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..ad3f0a9f6eefa2c6fca29f2708950c4ca98fc8d4 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Refinement.lean @@ -0,0 +1,843 @@ +import OAI.Analysis.DiskMaximal.Marks + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset + +noncomputable section + +namespace LabelSwitches + +/-- Whether a switch has occurred since the most recent exceptional level. -/ +def active (bad sw : ℕ → Bool) : ℕ → Bool + | 0 => false + | n+1 => if bad n then false else active bad sw n || sw n + +def count (p : ℕ → Bool) (n : ℕ) : ℕ := ∑ i ∈ range n, if p i then 1 else 0 + +lemma active_witness (bad sw : ℕ → Bool) (n : ℕ) (h : active bad sw n = true) : + ∃ i < n, sw i = true ∧ ∀ j, i ≤ j → j < n → bad j = false := by + induction n with + | zero => simp [active] at h + | succ n ih => + by_cases hb : bad n = true + · simp [active,hb] at h + · have hb' : bad n = false := by cases hbn : bad n <;> simp_all + simp only [active,hb',Bool.false_eq_true,↓reduceIte,Bool.or_eq_true] at h + rcases h with h | h + · obtain ⟨i,hi,hs,hn⟩ := ih h + refine ⟨i,Nat.lt_succ_of_lt hi,hs,?_⟩ + intro j hij hj + by_cases hjn : j < n + · exact hn j hij hjn + · have : j = n := by omega + simpa [this] using hb' + · refine ⟨n,Nat.lt_succ_self n,h,?_⟩ + intro j hj hj' + have : j=n := by omega + simpa [this] using hb' + +theorem count_le (bad sw : ℕ → Bool) (n : ℕ) + (hsep : ∀ i j, i < j → j < n → sw i = true → sw j = true → + ∃ k, i ≤ k ∧ k ≤ j ∧ bad k = true) : + count sw n ≤ 1+2*count bad n := by + have hns (j : ℕ) (hj : j < n) (ha : active bad sw j = true) (hb : bad j = false) : + sw j = false := by + obtain ⟨i,hi,hs,hb0⟩ := active_witness bad sw j ha + cases hv : sw j with + | false => rfl + | true => + obtain ⟨k,hik,hkj,hbk⟩ := hsep i j hi hj hs hv + by_cases hkj' : k < j + · have := hb0 k hik hkj' + simp_all + · have : k=j := by omega + simp_all + have aux : ∀ m ≤ n, count sw m ≤ 2*count bad m + if active bad sw m then 1 else 0 := by + intro m hm + induction m with + | zero => simp [count,active] + | succ m ih => + have ih' := ih (Nat.le_trans (Nat.le_succ m) hm) + have hstep := hns m (by omega) + simp only [count,sum_range_succ] at ih' ⊢ + simp only [active] + by_cases hb : bad m = true <;> by_cases hs : sw m = true <;> + by_cases ha : active bad sw m = true <;> simp_all <;> omega + have h := aux n le_rfl + split_ifs at h <;> omega + +/-- Quantitative energy version. The exceptional set is the union of marks +and levels with energy exceeding c. This includes an arbitrary birth offset. -/ +theorem count_energy (mark sw : ℕ → Bool) (E : ℕ → ℝ) (n : ℕ) {c : ℝ} + (hc : 0 < c) (hE : ∀ i < n, 0 ≤ E i) + (hsep : ∀ i j, i < j → j < n → sw i = true → sw j = true → + ∃ k, i ≤ k ∧ k ≤ j ∧ (mark k = true ∨ c < E k)) : + ((count sw n : ℕ) : ℝ) ≤ 1+2*((count mark n : ℕ) : ℝ)+(2/c)*∑ i ∈ range n, E i := by + let bad : ℕ → Bool := fun i => decide (mark i = true ∨ c < E i) + have hb := count_le bad sw n (by + intro i j hij hj hi hj' + obtain ⟨k,hik,hkj,hk⟩ := hsep i j hij hj hi hj' + exact ⟨k,hik,hkj,by simpa [bad] using hk⟩) + have henergy : ((count bad n : ℕ) : ℝ) ≤ ((count mark n : ℕ) : ℝ)+(1/c)*∑ i ∈ range n, E i := by + simp only [count,Nat.cast_sum,Nat.cast_ite,Nat.cast_one,Nat.cast_zero,mul_sum,← sum_add_distrib] + apply sum_le_sum + intro i hi + have hi' : i < n := mem_range.mp hi + have he := hE i hi' + have hec : 0 ≤ (1/c)*E i := mul_nonneg (by positivity) he + by_cases hm : mark i = true + · simp only [bad,hm,true_or,decide_true,↓reduceIte] + linarith + · by_cases hce : c < E i + · have he1 : 1 ≤ (1/c)*E i := by + rw [one_div,mul_comm,← div_eq_mul_inv,le_div_iff₀ hc] + simpa using hce.le + simpa [bad,hm,hce] using he1 + · simpa [bad,hm,hce] using hec + have hb' : ((count sw n : ℕ) : ℝ) ≤ 1+2*((count bad n : ℕ) : ℝ) := by exact_mod_cast hb + calc + _ ≤ 1+2*(((count mark n : ℕ) : ℝ)+(1/c)*∑ i ∈ range n, E i) := by linarith + _ = _ := by ring + +end LabelSwitches + +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology + +namespace PlanePotential + +/-- The global segment kernel vanishes off the region on which the actual +finite density decomposition is valid. -/ +lemma green_eq_zero_of_outside {ψ : ℂ → ℝ} {R X : ℝ} + (hs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hRX : R ≤ X) {x y : ℂ} + (hx : ‖x‖ ≤ X) (hy : X < ‖y‖) : green ψ x y = 0 := by + have hz (t : ℝ) (ht : t ∈ Ioc (0:ℝ) 1) : ψ (x+t⁻¹ • (y-x)) = 0 := by + by_contra hh + have hw := hs _ hh + have heq : y = (1-t) • x+t • (x+t⁻¹ • (y-x)) := by + rw [smul_add,smul_smul,mul_inv_cancel₀ ht.1.ne',one_smul] + module + have hn := norm_add_le ((1-t) • x) (t • (x+t⁻¹ • (y-x))) + rw [← heq,norm_smul,norm_smul,Real.norm_eq_abs,Real.norm_eq_abs, + abs_of_nonneg (sub_nonneg.mpr ht.2),abs_of_pos ht.1] at hn + have hle := add_le_add (mul_le_mul_of_nonneg_left hx (sub_nonneg.mpr ht.2)) + (mul_le_mul_of_nonneg_left (hw.trans hRX) ht.1.le) + nlinarith + have hi : greenScalar ψ x y = 0 := by + unfold greenScalar + apply setIntegral_eq_zero_of_forall_eq_zero + intro t ht + simp only [hz t ht,zero_mul] + simp only [green,hi,neg_zero,zero_smul] + +lemma green_gradient_representation {ψ g : ℂ → ℝ} (hψ : Continuous ψ) + (hψc : HasCompactSupport ψ) (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (hψ1 : ∫ z, ψ z = 1) (x : ℂ) : + (∫ y, ⟪green ψ x y,gradient g y⟫) = g x-∫ z, ψ z*g z := by + simpa only [inner_gradient_right,RCLike.conj_to_real] using + green_representation hψ hψc hg hD hψ1 x + +theorem green_finite_decomposition {ι : Type*} [Fintype ι] + {ψ g : ℂ → ℝ} (hψ : Continuous ψ) (hψc : HasCompactSupport ψ) + (hg : ContDiff ℝ 1 g) {D R X Y B : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (hψ1 : ∫ z, ψ z = 1) + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hRX : R ≤ X) (hM : 0 < R+X) (hB : 0 ≤ B) (hXY : 0 < X+Y) + (β : ι → ℂ → ℂ) (hβ : ∀ i, Integrable (β i)) + (hβs : ∀ i y, β i y ≠ 0 → ‖y‖ ≤ Y) + (hdecomp : ∀ᵐ y, ‖y‖ ≤ X → gradient g y = ∑ i, β i y) : + ∀ᵐ x ∂volume.restrict {x : ℂ | ‖x‖ ≤ X}, + g x-∫ z, ψ z*g z = ∑ i, ∫ y, ⟪green ψ x y,β i y⟫ := by + have hall := ae_all_iff.mpr (fun i => green_ae_integrable hψ.measurable hψs hψB hM hB hXY + (hβ i) (hβs i)) + filter_upwards [hall,ae_restrict_mem (measurableSet_le measurable_norm measurable_const)] with x hi hx + rw [← green_gradient_representation hψ hψc hg hD hψ1 x,← integral_finsetSum _ (fun i _ => hi i)] + apply integral_congr_ae + filter_upwards [hdecomp] with y hy + by_cases hyX : ‖y‖ ≤ X + · rw [hy hyX,inner_sum] + · rw [green_eq_zero_of_outside hψs hRX hx (lt_of_not_ge hyX)] + simp + +/-- The complete finite Minkowski step, after genuine kernel insertion. -/ +theorem green_decomposition_norm {ι : Type*} [Fintype ι] + {ψ g : ℂ → ℝ} (hψ : Continuous ψ) (hψc : HasCompactSupport ψ) + (hg : ContDiff ℝ 1 g) {D R X Y B : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (hψ1 : ∫ z, ψ z = 1) + (hψs : ∀ z, ψ z ≠ 0 → ‖z‖ ≤ R) (hψB : ∀ z, |ψ z| ≤ B) + (hRX : R ≤ X) (hM : 0 < R+X) (hB : 0 ≤ B) (hXY : 0 < X+Y) + (β : ι → ℂ → ℂ) (hβ : ∀ i, Integrable (β i)) + (hβs : ∀ i y, β i y ≠ 0 → ‖y‖ ≤ Y) + (hdecomp : ∀ᵐ y, ‖y‖ ≤ X → gradient g y = ∑ i, β i y) : + eLpNorm (fun x => g x-∫ z, ψ z*g z) (3/2) (volume.restrict {x : ℂ | ‖x‖ ≤ X}) ≤ + ∑ i, eLpNorm (fun x => ∫ y, ⟪green ψ x y,β i y⟫) (3/2) + (volume.restrict {x : ℂ | ‖x‖ ≤ X}) := by + let μ := volume.restrict {x : ℂ | ‖x‖ ≤ X} + let F : ι → ℂ → ℝ := fun i x => ∫ y, ⟪green ψ x y,β i y⟫ + have hmeas : ∀ i, AEStronglyMeasurable (F i) μ := fun i => + potential_aestronglyMeasurable _ (green_measurable ψ hψ.measurable) (hβ i) + have heq : (fun x => g x-∫ z, ψ z*g z) =ᵐ[μ] fun x => ∑ i, F i x := + green_finite_decomposition hψ hψc hg hD hψ1 hψs hψB hRX hM hB hXY β hβ hβs hdecomp + have hsum : eLpNorm (∑ i, F i) (3/2) μ ≤ ∑ i, eLpNorm (F i) (3/2) μ := + eLpNorm_sum_le (by + rw [ENNReal.le_div_iff_mul_le (by norm_num) (by norm_num)] + norm_num) + rw [eLpNorm_congr_ae heq] + have hfun : (∑ i, F i) = fun x => ∑ i, F i x := by ext x; simp + rw [hfun] at hsum + exact hsum + +end PlanePotential + +namespace RadiusEnvelope +variable {E : Type*} + +/-- The signed envelope over the entire compact real-radius interval. -/ +def envelope (u : ℝ → E → ℝ) (a b : ℝ) (x : E) : ℝ := + sSup ((fun r => u r x) '' Icc a b) + +lemma attains {u : ℝ → E → ℝ} {a b : ℝ} (hab : a ≤ b) (x : E) + (hc : ContinuousOn (fun r => u r x) (Icc a b)) : + ∃ r ∈ Icc a b, envelope u a b x = u r x ∧ ∀ t ∈ Icc a b, u t x ≤ u r x := by + obtain ⟨r,hr,hm⟩ := isCompact_Icc.exists_isMaxOn (Set.nonempty_Icc.mpr hab) hc + refine ⟨r,hr,?_,hm⟩ + apply le_antisymm + · apply csSup_le ((Set.nonempty_Icc.mpr hab).image _) + rintro _ ⟨t,ht,rfl⟩ + exact hm ht + · apply le_csSup (isCompact_Icc.image_of_continuousOn hc).bddAbove + exact mem_image_of_mem _ hr + +lemma le_envelope {u : ℝ → E → ℝ} {a b r : ℝ} (hr : r ∈ Icc a b) (x : E) + (hc : ContinuousOn (fun r => u r x) (Icc a b)) : u r x ≤ envelope u a b x := by + obtain ⟨t,ht,he,hm⟩ := attains (hr.1.trans hr.2) x hc + rw [he] + exact hm r hr + +lemma lipschitz [NormedAddCommGroup E] {u : ℝ → E → ℝ} {a b : ℝ} {L : ℝ≥0} (hab : a ≤ b) + (hc : ∀ x, ContinuousOn (fun r => u r x) (Icc a b)) + (hL : ∀ r ∈ Icc a b, LipschitzWith L (u r)) : + LipschitzWith L (envelope u a b) := by + rw [lipschitzWith_iff_dist_le_mul] + intro x y + obtain ⟨r,hr,her,hmr⟩ := attains hab x (hc x) + obtain ⟨t,ht,het,hmt⟩ := attains hab y (hc y) + rw [Real.dist_eq,abs_le] + constructor + · have h := (hL t ht).dist_le_mul x y + rw [Real.dist_eq] at h + rw [het] + have hx := le_envelope ht x (hc x) + have ha := (abs_le.mp h).1 + linarith + · have h := (hL r hr).dist_le_mul x y + rw [Real.dist_eq] at h + rw [her] + have hy := le_envelope hr y (hc y) + have ha := (abs_le.mp h).2 + linarith + +lemma zero_of_all_zero {u : ℝ → E → ℝ} {a b : ℝ} (hab : a ≤ b) {x : E} + (hc : ContinuousOn (fun r => u r x) (Icc a b)) + (hz : ∀ r ∈ Icc a b, u r x = 0) : envelope u a b x = 0 := by + obtain ⟨r,hr,he,_⟩ := attains hab x hc + exact he.trans (hz r hr) + +/-- Differentiable touching holds for every attaining radius; no derivative of +an argmax selector is taken. -/ +theorem fderiv_touching [NormedAddCommGroup E] [NormedSpace ℝ E] {u : ℝ → E → ℝ} {a b r : ℝ} {x : E} + (hr : r ∈ Icc a b) (hc : ∀ y, ContinuousOn (fun t => u t y) (Icc a b)) + (he : envelope u a b x = u r x) + (hd : DifferentiableAt ℝ (envelope u a b) x) (hu : DifferentiableAt ℝ (u r) x) : + fderiv ℝ (envelope u a b) x = fderiv ℝ (u r) x := by + have hm : IsLocalMin (fun y => envelope u a b y-u r y) x := by + apply IsMinOn.isLocalMin (s := univ) _ univ_mem + intro y _ + change envelope u a b x-u r x ≤ envelope u a b y-u r y + rw [he,sub_self] + exact sub_nonneg.mpr (le_envelope hr y (hc y)) + have hz := hm.hasFDerivAt_eq_zero (hd.hasFDerivAt.sub hu.hasFDerivAt) + exact sub_eq_zero.mp hz + +end RadiusEnvelope + +namespace DiskMoments + +lemma signedAverage_lipschitz {g : ℂ → ℝ} {L : ℝ≥0} (hg : LipschitzWith L g) + {t : ℝ} (ht : 0 < t) : LipschitzWith L (fun x => signedAverage g x t) := by + rw [lipschitzWith_iff_dist_le_mul] + intro x y + rw [signedAverage_fixedDomain g x ht,signedAverage_fixedDomain g y ht,Real.dist_eq, + ← sub_div,abs_div,abs_of_pos Real.pi_pos] + have hxi : IntegrableOn (fun z : ℂ => g (x+t • z)) (Metric.ball 0 1) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) + (hg.continuous.comp (by fun_prop)).continuousOn).mono_set Metric.ball_subset_closedBall + have hyi : IntegrableOn (fun z : ℂ => g (y+t • z)) (Metric.ball 0 1) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) + (hg.continuous.comp (by fun_prop)).continuousOn).mono_set Metric.ball_subset_closedBall + rw [← integral_sub hxi hyi] + have : IsFiniteMeasure (volume.restrict (Metric.ball (0:ℂ) 1)) := + ⟨by simp⟩ + have hi := norm_integral_le_of_norm_le_const (μ := volume.restrict (Metric.ball (0:ℂ) 1)) + (C := (L:ℝ)*dist x y) (f := fun z : ℂ => g (x+t • z)-g (y+t • z)) (by + filter_upwards with z + simpa only [Real.norm_eq_abs,← Real.dist_eq,dist_add_right] using hg.dist_le_mul (x+t • z) (y+t • z)) + have hv : (volume.restrict (Metric.ball (0:ℂ) 1)).real univ = Real.pi := by + simp [measureReal_def,Complex.volume_ball] + rw [hv,Real.norm_eq_abs] at hi + exact (div_le_iff₀ Real.pi_pos).mpr hi + +lemma signedAverage_radius_continuousOn {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (x : ℂ) {a b : ℝ} (ha : 0 < a) : + ContinuousOn (fun t => signedAverage g x t) (Icc a b) := by + intro t ht + exact (hasDerivAt_signedAverage hg x (ha.trans_le ht.1)).continuousAt.continuousWithinAt + +lemma hasFDerivAt_signedAverage {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {D : ℝ} + (hD : ∀ y, ‖fderiv ℝ g y‖ ≤ D) (x : ℂ) {t : ℝ} (ht : 0 < t) : + HasFDerivAt (fun x => signedAverage g x t) + ((1/Real.pi) • ∫ z in Metric.ball 0 1, fderiv ℝ g (x+t • z)) x := by + let F : ℂ → ℂ → ℝ := fun x z => g (x+t • z) + have hFi : IntegrableOn (F x) (Metric.ball 0 1) := + (ContinuousOn.integrableOn_compact (isCompact_closedBall 0 1) + (hg.continuous.comp (by fun_prop)).continuousOn).mono_set Metric.ball_subset_closedBall + have hd := hasFDerivAt_integral_of_dominated_of_fderiv_le + (μ := volume.restrict (Metric.ball (0:ℂ) 1)) (F := F) + (F' := fun x z => fderiv ℝ g (x+t • z)) (bound := fun _ => D) + (s := univ) (x₀ := x) univ_mem + (Eventually.of_forall (fun x => (hg.continuous.comp (by fun_prop)).aestronglyMeasurable)) + hFi ((hg.continuous_fderiv one_ne_zero).comp (by fun_prop)).aestronglyMeasurable + (ae_of_all _ (fun z x _ => hD (x+t • z))) (integrableOn_const (by finiteness)) + (ae_of_all _ (fun z x _ => by + simpa only [ContinuousLinearMap.comp_id,Function.comp_def,id_eq,F] using + (hg.differentiable one_ne_zero (x+t • z)).hasFDerivAt.comp x ((hasFDerivAt_id x).add_const (t • z)))) + convert! hd.const_mul (1/Real.pi) using 1 + · funext y + simpa only [F,div_eq_mul_inv,one_div,mul_comm,mul_one] using signedAverage_fixedDomain g y ht + +/-- Actual signed run envelopes: locally differentiable almost everywhere, over +all radii in their compact interval. -/ +theorem run_envelope_lipschitz {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + ∃ L : ℝ≥0, LipschitzWith L (RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b) := by + obtain ⟨L,hL⟩ := hg.lipschitzWith_of_hasCompactSupport hgc one_ne_zero + exact ⟨L,RadiusEnvelope.lipschitz hab (fun x => signedAverage_radius_continuousOn hg x ha) + (fun r hr => signedAverage_lipschitz hL (ha.trans_le hr.1))⟩ + +end DiskMoments + +namespace DiskMoments + +lemma signedAverage_eq_zero_of_outside {g : ℂ → ℝ} {R : ℝ} + (hs : ∀ y, g y ≠ 0 → ‖y‖ ≤ R) {x : ℂ} {t : ℝ} (hx : R+t ≤ ‖x‖) : + signedAverage g x t = 0 := by + unfold signedAverage + have hz : (∫ y in Metric.ball x t, g y) = 0 := by + apply setIntegral_eq_zero_of_forall_eq_zero + intro y hy + by_contra hny + have hn := hs y hny + have hd : ‖x-y‖ < t := by simpa only [Metric.mem_ball,dist_eq_norm,norm_sub_rev] using hy + have hh : ‖x‖ ≤ ‖x-y‖+‖y‖ := by simpa only [sub_add_cancel] using norm_add_le (x-y) y + linarith + rw [hz,zero_div] + +/-- Every radius in the run is retained, but a common compact spatial support +still exists. -/ +theorem run_envelope_hasCompactSupport {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + HasCompactSupport (RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b) := by + obtain ⟨R,hR⟩ := hgc.isBounded.subset_closedBall (0:ℂ) + have hs : ∀ y, g y ≠ 0 → ‖y‖ ≤ R := by + intro y hy + simpa only [Metric.mem_closedBall,dist_zero_right] using hR (subset_tsupport g hy) + apply IsCompact.of_isClosed_subset (isCompact_closedBall (0:ℂ) (R+b)) isClosed_closure + apply closure_minimal _ Metric.isClosed_closedBall + intro x hx + rw [Metric.mem_closedBall,dist_zero_right] + by_contra hn + have hz : RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b x = 0 := by + apply RadiusEnvelope.zero_of_all_zero hab (signedAverage_radius_continuousOn hg x ha) + intro r hr + exact signedAverage_eq_zero_of_outside hs (by linarith [hr.2]) + exact hx hz + +/-- AE differentiability and universal touching of actual run gradients. -/ +theorem run_envelope_ae_touching {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) {a b : ℝ} (ha : 0 < a) (hab : a ≤ b) : + ∀ᵐ x, ∀ r ∈ Icc a b, + RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b x = signedAverage g x r → + fderiv ℝ (RadiusEnvelope.envelope (fun r x => signedAverage g x r) a b) x = + (1/Real.pi) • ∫ z in Metric.ball 0 1, fderiv ℝ g (x+r • z) := by + obtain ⟨L,hL⟩ := run_envelope_lipschitz hg hgc ha hab + obtain ⟨K,hK⟩ := hg.lipschitzWith_of_hasCompactSupport hgc one_ne_zero + filter_upwards [hL.ae_differentiableAt] with x hx + intro r hr he + have hd := hasFDerivAt_signedAverage hg (fun y => norm_fderiv_le_of_lipschitz ℝ hK) x + (ha.trans_le hr.1) + exact (RadiusEnvelope.fderiv_touching hr (fun y => signedAverage_radius_continuousOn hg y ha) + he hx hd.differentiableAt).trans hd.fderiv + +end DiskMoments + +namespace DyadicHats + +def point (r : ℝ) (p : ℤ × ℤ) : ℂ := ⟨r*p.1,r*p.2⟩ +def boxNorm (x : ℂ) : ℝ := max |x.re| |x.im| + +lemma boxNorm_nonneg (x : ℂ) : 0 ≤ boxNorm x := le_trans (abs_nonneg _) (le_max_left _ _) +lemma boxNorm_le_norm (x : ℂ) : boxNorm x ≤ ‖x‖ := + max_le (Complex.abs_re_le_norm _) (Complex.abs_im_le_norm _) +lemma norm_le_two_boxNorm (x : ℂ) : ‖x‖ ≤ 2*boxNorm x := by + have h := Complex.norm_le_abs_re_add_abs_im x + have hr : |x.re| ≤ boxNorm x := le_max_left _ _ + have hi : |x.im| ≤ boxNorm x := le_max_right _ _ + linarith +lemma boxNorm_add_le (x y : ℂ) : boxNorm (x+y) ≤ boxNorm x+boxNorm y := by + apply max_le + · exact (abs_add_le _ _).trans (add_le_add (le_max_left _ _) (le_max_left _ _)) + · exact (abs_add_le _ _).trans (add_le_add (le_max_right _ _) (le_max_right _ _)) +lemma boxNorm_neg (x : ℂ) : boxNorm (-x) = boxNorm x := by simp [boxNorm] +lemma boxNorm_sub_comm (x y : ℂ) : boxNorm (x-y) = boxNorm (y-x) := by + rw [← neg_sub y x,boxNorm_neg] + +lemma hat_pos_iff {r : ℝ} (hr : 0 < r) (p : ℤ × ℤ) (x : ℂ) : + 0 < hat r p x ↔ boxNorm (x-point r p) < r := by + have hp : 0 < hat r p x ↔ 0 < tent (x.re/r-p.1) ∧ 0 < tent (x.im/r-p.2) := by + constructor + · intro h + exact ⟨pos_of_mul_pos_left h (tent_nonneg _),pos_of_mul_pos_right h (tent_nonneg _)⟩ + · intro h + exact mul_pos h.1 h.2 + rw [hp,tent_pos_iff,tent_pos_iff] + have hr0 : r ≠ 0 := ne_of_gt hr + have h1 : x.re/r-p.1 = (x.re-r*p.1)/r := by field_simp + have h2 : x.im/r-p.2 = (x.im-r*p.2)/r := by field_simp + rw [h1,h2,abs_div,abs_div,abs_of_pos hr,div_lt_one hr,div_lt_one hr] + simp only [boxNorm,Complex.sub_re,Complex.sub_im,point,max_lt_iff] + +lemma hat_ne_zero_iff {r : ℝ} (hr : 0 < r) (p : ℤ × ℤ) (x : ℂ) : + hat r p x ≠ 0 ↔ boxNorm (x-point r p) < r := by + constructor + · intro h + exact (hat_pos_iff hr p x).mp (lt_of_le_of_ne (hat_nonneg r p x) (Ne.symm h)) + · intro h + exact ne_of_gt ((hat_pos_iff hr p x).mpr h) + +lemma support_hat_subset {r : ℝ} (hr : 0 < r) (p : ℤ × ℤ) : + Function.support (hat r p) ⊆ Metric.closedBall (point r p) (2*r) := by + intro x hx + rw [Metric.mem_closedBall,dist_eq_norm] + exact (norm_le_two_boxNorm _).trans (mul_le_mul_of_nonneg_left ((hat_ne_zero_iff hr p x).mp hx).le (by norm_num)) + +lemma hasCompactSupport_hat {r : ℝ} (hr : 0 < r) (p : ℤ × ℤ) : + HasCompactSupport (hat r p) := by + apply IsCompact.of_isClosed_subset (isCompact_closedBall (point r p) (2*r)) isClosed_closure + exact closure_minimal (support_hat_subset hr p) Metric.isClosed_closedBall + +/-- Globally uniform spatial Lipschitz bound for the literal bilinear hats. -/ +lemma lipschitz_hat {r : ℝ} (hr : 0 < r) (p : ℤ × ℤ) : + LipschitzWith (Real.toNNReal (2/r)) (hat r p) := by + rw [lipschitzWith_iff_dist_le_mul] + intro x y + let a := tent (x.re/r-p.1) + let b := tent (x.im/r-p.2) + let c := tent (y.re/r-p.1) + let d := tent (y.im/r-p.2) + have h1 : |a-c| ≤ ‖x-y‖/r := by + have h := lipschitz_tent.dist_le_mul (x.re/r-p.1) (y.re/r-p.1) + simp only [Real.dist_eq,NNReal.coe_one,one_mul,sub_sub_sub_cancel_right,← sub_div, + abs_div,abs_of_pos hr] at h + exact h.trans (div_le_div_of_nonneg_right (Complex.abs_re_le_norm (x-y)) hr.le) + have h2 : |b-d| ≤ ‖x-y‖/r := by + have h := lipschitz_tent.dist_le_mul (x.im/r-p.2) (y.im/r-p.2) + simp only [Real.dist_eq,NNReal.coe_one,one_mul,sub_sub_sub_cancel_right,← sub_div, + abs_div,abs_of_pos hr] at h + exact h.trans (div_le_div_of_nonneg_right (Complex.abs_im_le_norm (x-y)) hr.le) + have hab : |a*b-c*d| ≤ |a-c|+|b-d| := by + calc + _ = |(a-c)*b+c*(b-d)| := by congr 1; ring + _ ≤ |(a-c)*b|+|c*(b-d)| := abs_add_le _ _ + _ = |a-c| *b+c*|b-d| := by rw [abs_mul,abs_mul,abs_of_nonneg (tent_nonneg _),abs_of_nonneg (tent_nonneg _)] + _ ≤ |a-c| *1+1*|b-d| := add_le_add + (mul_le_mul_of_nonneg_left (tent_le_one _) (abs_nonneg _)) + (mul_le_mul_of_nonneg_right (tent_le_one _) (abs_nonneg _)) + _ = _ := by ring + change |a*b-c*d| ≤ _ + rw [Real.coe_toNNReal (2/r) (by positivity),dist_eq_norm] + calc + _ ≤ ‖x-y‖/r+‖x-y‖/r := hab.trans (add_le_add h1 h2) + _ = _ := by ring + +lemma step_locality {p q : ℤ × ℤ} (hpq : 0 < step p q) {r : ℝ} (hr : 0 < r) : + boxNorm (point (r/2) q-point r p) ≤ r/2 := by + have h1 : |(q.1:ℝ)/2-p.1| < 1 := (tent_pos_iff _).mp + (pos_of_mul_pos_left hpq (tent_nonneg _)) + have h2 : |(q.2:ℝ)/2-p.2| < 1 := (tent_pos_iff _).mp + (pos_of_mul_pos_right hpq (tent_nonneg _)) + have hbound (j k : ℤ) (h : |(j:ℝ)/2-k| < 1) : |(j:ℝ)/2-k| ≤ 1/2 := by + have habs := abs_lt.mp h + have hlow : 2*k-1 ≤ j := by + have : (2*k-2:ℝ) < j := by linarith + have : 2*k-2 < j := by exact_mod_cast this + omega + have hhigh : j ≤ 2*k+1 := by + have : (j:ℝ) < 2*k+2 := by linarith + have : j < 2*k+2 := by exact_mod_cast this + omega + have hlo : (2:ℝ)*k-1 ≤ j := by exact_mod_cast hlow + have hhi : (j:ℝ) ≤ 2*k+1 := by exact_mod_cast hhigh + rw [abs_le] + constructor <;> linarith + have h1' := hbound q.1 p.1 h1 + have h2' := hbound q.2 p.2 h2 + change max |r/2*q.1-r*p.1| |r/2*q.2-r*p.2| ≤ r/2 + have hm (j k : ℤ) (h : |(j:ℝ)/2-k| ≤ 1/2) : |r/2*j-r*k| ≤ r/2 := by + rw [show r/2*j-r*k = r*((j:ℝ)/2-k) by ring,abs_mul,abs_of_pos hr] + nlinarith + exact max_le (hm _ _ h1') (hm _ _ h2') + +end DyadicHats + +namespace DyadicHats +open scoped BigOperators + +/-- Literal nine-child support of an adjacent dyadic refinement row. -/ +def children (p : ℤ × ℤ) : Finset (ℤ × ℤ) := + (Finset.Icc (2*p.1-1) (2*p.1+1)).product (Finset.Icc (2*p.2-1) (2*p.2+1)) + +lemma tent_half_zero {j k : ℤ} (h : j ∉ Finset.Icc (2*k-1) (2*k+1)) : + tent ((j:ℝ)/2-k) = 0 := by + have ht : j-2*k ∉ Finset.Icc (-1) 1 := by + simp only [Finset.mem_Icc] at * + omega + convert tent_half_integer ht using 1 + push_cast + congr 1 + ring + +lemma step_zero_of_not_child {p q : ℤ × ℤ} (hq : q ∉ children p) : step p q = 0 := by + have hq' : ¬(q.1 ∈ Finset.Icc (2*p.1-1) (2*p.1+1) ∧ q.2 ∈ Finset.Icc (2*p.2-1) (2*p.2+1)) := by + exact fun hn => hq (Finset.mem_product.mpr hn) + rw [not_and_or] at hq' + rcases hq' with hq | hq + · rw [step,tent_half_zero hq,zero_mul] + · rw [step,tent_half_zero hq,mul_zero] + +lemma hat_refine_finite (r : ℝ) (p : ℤ × ℤ) (x : ℂ) : + hat (2*r) p x = ∑ q ∈ children p, step p q*hat r q x := by + rw [hat_refine,tsum_eq_sum (s := children p)] + intro q hq + rw [step_zero_of_not_child hq,zero_mul] + +/-- The vector mass of the actual density, not an abstract additive tree. -/ +def vectorMass (h : ℂ → ℂ) (r : ℝ) (p : ℤ × ℤ) : ℂ := ∫ y, hat r p y • h y + +def scalarMass (h : ℂ → ℂ) (r : ℝ) (p : ℤ × ℤ) : ℝ := ‖vectorMass h r p‖ + +lemma integrable_hat_smul {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) (p : ℤ × ℤ) : + Integrable (fun y => hat r p y • h y) := by + apply hh.bdd_smul 1 (continuous_hat r p).aestronglyMeasurable + filter_upwards with y + simpa only [Real.norm_eq_abs,abs_of_nonneg (hat_nonneg r p y)] using hat_le_one r p y + +lemma vectorMass_refine {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) (p : ℤ × ℤ) : + vectorMass h (2*r) p = ∑ q ∈ children p, step p q • vectorMass h r q := by + unfold vectorMass + simp_rw [hat_refine_finite,Finset.sum_smul,mul_smul] + rw [integral_finsetSum] + · apply Finset.sum_congr rfl + intro q hq + exact integral_smul _ _ + · intro q hq + exact (integrable_hat_smul hh r q).smul _ + +lemma scalarMass_le_integral {h : ℂ → ℂ} (r : ℝ) (p : ℤ × ℤ) : + scalarMass h r p ≤ ∫ y, hat r p y * ‖h y‖ := by + unfold scalarMass vectorMass + simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (hat_nonneg _ _ _)] using + norm_integral_le_integral_norm (fun y => hat r p y • h y) + +/-- Any finite set of roots carries at most the total L1 density, uniformly +in the scale. This proves the full-grid mass budget once finite support is used. -/ +lemma sum_scalarMass_le {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) (S : Finset (ℤ × ℤ)) : + ∑ p ∈ S, scalarMass h r p ≤ ∫ y, ‖h y‖ := by + have hi (p : ℤ × ℤ) : Integrable (fun y => hat r p y * ‖h y‖) := by + simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (hat_nonneg _ _ _)] using + (integrable_hat_smul hh r p).norm + calc + _ ≤ ∑ p ∈ S, ∫ y, hat r p y * ‖h y‖ := Finset.sum_le_sum (fun p _ => scalarMass_le_integral r p) + _ = ∫ y, ∑ p ∈ S, hat r p y * ‖h y‖ := (integral_finsetSum _ (fun p _ => hi p)).symm + _ ≤ ∫ y, ‖h y‖ := by + apply integral_mono (integrable_finsetSum _ (fun p _ => hi p)) hh.norm + intro y + change (∑ p ∈ S, hat r p y * ‖h y‖) ≤ ‖h y‖ + rw [← Finset.sum_mul] + have hs := Summable.sum_le_tsum S (fun p _ => hat_nonneg r p y) (summable_hat r y) + rw [tsum_hat] at hs + simpa only [one_mul] using mul_le_mul_of_nonneg_right hs (norm_nonneg (h y)) + +lemma scalarMass_refine_le {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) (p : ℤ × ℤ) : + scalarMass h (2*r) p ≤ ∑ q ∈ children p, step p q*scalarMass h r q := by + unfold scalarMass + rw [vectorMass_refine hh] + simpa only [norm_smul,Real.norm_eq_abs,abs_of_nonneg (step_nonneg _ _)] using + norm_sum_le (children p) (fun q => step p q • vectorMass h r q) + +/-- A finite index set that contains every hat meeting a fixed bounded region. -/ +def boundedIndices (r R : ℝ) : Finset (ℤ × ℤ) := + (Finset.Icc (-⌈R/r+1⌉) ⌈R/r+1⌉).product (Finset.Icc (-⌈R/r+1⌉) ⌈R/r+1⌉) + +lemma mem_boundedIndices {r R : ℝ} (hr : 0 < r) {x : ℂ} (hx : ‖x‖ ≤ R) + {p : ℤ × ℤ} (hp : hat r p x ≠ 0) : p ∈ boundedIndices r R := by + have hpos : 0 < hat r p x := lt_of_le_of_ne (hat_nonneg r p x) (Ne.symm hp) + have h1 := (tent_pos_iff _).mp (pos_of_mul_pos_left hpos (tent_nonneg _)) + have h2 := (tent_pos_iff _).mp (pos_of_mul_pos_right hpos (tent_nonneg _)) + have hbound (a : ℝ) (j : ℤ) (ha : |a| ≤ R) (hj : |a/r-j| < 1) : + j ∈ Finset.Icc (-⌈R/r+1⌉) ⌈R/r+1⌉ := by + have hq : |a/r| ≤ R/r := by rw [abs_div,abs_of_pos hr]; exact div_le_div_of_nonneg_right ha hr.le + have hja : |(j:ℝ)| ≤ R/r+1 := by + calc + _ = |a/r-(a/r-j)| := by congr 1; ring + _ ≤ |a/r|+|a/r-j| := abs_sub _ _ + _ ≤ R/r+1 := add_le_add hq hj.le + have hlo := (abs_le.mp hja).1 + have hhi := (abs_le.mp hja).2 + have hc := Int.le_ceil (R/r+1) + simp only [Finset.mem_Icc] + constructor + · have : (-(⌈R/r+1⌉:ℝ)) ≤ j := by linarith + exact_mod_cast this + · have : (j:ℝ) ≤ ⌈R/r+1⌉ := hhi.trans hc + exact_mod_cast this + exact Finset.mem_product.mpr ⟨hbound x.re p.1 ((Complex.abs_re_le_norm x).trans hx) h1, + hbound x.im p.2 ((Complex.abs_im_le_norm x).trans hx) h2⟩ + +lemma vectorMass_zero_of_not_index {h : ℂ → ℂ} {r R : ℝ} (hr : 0 < r) + (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) {p : ℤ × ℤ} (hp : p ∉ boundedIndices r R) : + vectorMass h r p = 0 := by + apply integral_eq_zero_of_ae + filter_upwards with y + by_cases hy : h y = 0 + · simp only [hy,smul_zero,Pi.zero_apply] + · have hh : hat r p y = 0 := by + by_contra hn + exact hp (mem_boundedIndices hr (hs y hy) hn) + simp only [hh,zero_smul,Pi.zero_apply] + +/-- Compactly supported actual densities have finitely many nonzero vector +masses at each positive scale. -/ +lemma finite_vectorMass_support {h : ℂ → ℂ} (hc : HasCompactSupport h) {r : ℝ} (hr : 0 < r) : + (Function.support (vectorMass h r)).Finite := by + obtain ⟨R,hR⟩ := hc.isBounded.subset_closedBall (0:ℂ) + apply (boundedIndices r R).finite_toSet.subset + intro p hp + by_contra hn + exact hp (vectorMass_zero_of_not_index hr (fun y hy => by + simpa only [Metric.mem_closedBall,dist_zero_right] using hR (subset_tsupport h hy)) hn) + +end DyadicHats + +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +noncomputable section + +namespace LipschitzWith +open scoped _root_.LipschitzWith +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [IsAddHaarMeasure μ] {f g : E → ℝ} {L K : ℝ≥0} + +/-- Genuine integration by parts for Lipschitz weights and compact Lipschitz +potentials. Differentiability is required only almost everywhere, and follows +from Rademacher rather than being a new premise. -/ +theorem integral_fderiv_mul_eq_neg (hf : LipschitzWith L f) (hg : LipschitzWith K g) + (hgc : HasCompactSupport g) (v : E) : + (∫ x, fderiv ℝ f x v * g x ∂μ) = -∫ x, fderiv ℝ g x v * f x ∂μ := by + have h1 : (fun x => fderiv ℝ f x v*g x) =ᵐ[μ] fun x => lineDeriv ℝ f x v*g x := by + filter_upwards [hf.ae_differentiableAt (μ := μ)] with x hx + rw [hx.lineDeriv_eq_fderiv] + have h2 : (fun x => lineDeriv ℝ g x (-v)*f x) =ᵐ[μ] fun x => -(fderiv ℝ g x v*f x) := by + filter_upwards [hg.ae_differentiableAt (μ := μ)] with x hx + rw [hx.lineDeriv_eq_fderiv,map_neg,neg_mul] + rw [integral_congr_ae h1,hf.integral_lineDeriv_mul_eq hg hgc v,integral_congr_ae h2,integral_neg] + +/-- The total gradient version obtained from Riesz and measurable fderiv is +locally integrable, including on the nondifferentiability set. -/ +theorem locallyIntegrable_gradient (hf : LipschitzWith L f) : + LocallyIntegrable (gradient f) μ := by + have hm : AEStronglyMeasurable (gradient f) μ := + ((InnerProductSpace.toDual ℝ E).symm.continuous.measurable.comp + (measurable_fderiv ℝ f)).aestronglyMeasurable + have hb : ∀ x, ‖gradient f x‖ ≤ (L:ℝ) := by + intro x + simpa only [gradient,(InnerProductSpace.toDual ℝ E).symm.norm_map] using + (norm_fderiv_le_of_lipschitz ℝ hf : ‖fderiv ℝ f x‖ ≤ (L:ℝ)) + exact (memLp_top_of_bound hm (L:ℝ) (ae_of_all _ hb)).locallyIntegrable le_top + +theorem integrable_gradient (hf : LipschitzWith L f) (hc : HasCompactSupport f) : + Integrable (gradient f) μ := by + have hs : HasCompactSupport (gradient f) := + (hc.fderiv ℝ).comp_left (map_zero (InnerProductSpace.toDual ℝ E).symm) + exact (integrableOn_iff_integrable_of_support_subset (subset_tsupport (gradient f))).mp + ((_root_.OAI.LipschitzWith.locallyIntegrable_gradient (μ := μ) hf).integrableOn_isCompact hs) + +theorem integral_mul_fderiv_eq_neg (hf : LipschitzWith L f) (hg : LipschitzWith K g) + (hgc : HasCompactSupport g) (v : E) : + (∫ x, f x * fderiv ℝ g x v ∂μ) = -∫ x, inner ℝ (gradient f x) v * g x ∂μ := by + simp only [gradient,InnerProductSpace.toDual_symm_apply] + have h := _root_.OAI.LipschitzWith.integral_fderiv_mul_eq_neg (μ := μ) hf hg hgc v + rw [show (fun x => f x * fderiv ℝ g x v) = (fun x => fderiv ℝ g x v * f x) by + funext x; exact mul_comm _ _] + linarith + +end LipschitzWith + +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology + +namespace DyadicHats + +def indexBox (N : ℕ) : Finset (ℤ × ℤ) := + (Finset.Icc (-(N:ℤ)) N).product (Finset.Icc (-(N:ℤ)) N) +abbrev Grid (N : ℕ) := {p : ℤ × ℤ // p ∈ indexBox N} + +lemma parent_in_box {N : ℕ} {p q : ℤ × ℤ} (hq : q ∈ indexBox N) (hpq : step p q ≠ 0) : + p ∈ indexBox N := by + have hq1 : -(N:ℤ) ≤ q.1 ∧ q.1 ≤ N := Finset.mem_Icc.mp (Finset.mem_product.mp hq).1 + have hq2 : -(N:ℤ) ≤ q.2 ∧ q.2 ≤ N := Finset.mem_Icc.mp (Finset.mem_product.mp hq).2 + have hh : 0 < step p q := lt_of_le_of_ne (step_nonneg p q) (Ne.symm hpq) + have h1 := (tent_pos_iff _).mp (pos_of_mul_pos_left hh (tent_nonneg _)) + have h2 := (tent_pos_iff _).mp (pos_of_mul_pos_right hh (tent_nonneg _)) + have hbound (j k : ℤ) (hk : -(N:ℤ) ≤ k ∧ k ≤ N) (ha : |(k:ℝ)/2-j| < 1) : + j ∈ Finset.Icc (-(N:ℤ)) N := by + have hlo : -(N:ℝ) ≤ k := by exact_mod_cast hk.1 + have hhi : (k:ℝ) ≤ N := by exact_mod_cast hk.2 + have hj := abs_lt.mp ha + simp only [Finset.mem_Icc] + constructor + · by_contra hn + have : j ≤ -(N:ℤ)-1 := by omega + have : (j:ℝ) ≤ -(N:ℝ)-1 := by exact_mod_cast this + nlinarith [Nat.cast_nonneg (α := ℝ) N] + · by_contra hn + have : (N:ℤ)+1 ≤ j := by omega + have : (N:ℝ)+1 ≤ j := by exact_mod_cast this + nlinarith [Nat.cast_nonneg (α := ℝ) N] + exact Finset.mem_product.mpr ⟨hbound _ _ hq1 h1,hbound _ _ hq2 h2⟩ + +/-- Restriction to a finite box retains the exact column normalization of the +positive dyadic refinement matrix; it does not normalize its rows. -/ +lemma grid_step_column (N : ℕ) (q : Grid N) : (∑ p : Grid N, step p q) = 1 := by + have he := step_column q.val + rw [tsum_eq_sum (s := indexBox N)] at he + · exact (Finset.sum_coe_sort (indexBox N) (fun p => step p q)).trans he + · intro p hp + by_contra hn + exact hp (parent_in_box q.property hn) + +lemma mem_indexBox_of_le {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {x : ℂ} (hx : ‖x‖ ≤ R) {p : ℤ × ℤ} (hp : hat r p x ≠ 0) : + p ∈ indexBox N := by + have hm := mem_boundedIndices hr hx hp + have hc : ⌈R/r+1⌉ ≤ (N:ℤ) := Int.ceil_le.mpr (by simpa only [Int.cast_natCast] using hN) + have h1 := Finset.mem_Icc.mp (Finset.mem_product.mp hm).1 + have h2 := Finset.mem_Icc.mp (Finset.mem_product.mp hm).2 + apply Finset.mem_product.mpr + constructor <;> apply Finset.mem_Icc.mpr <;> constructor <;> omega + +lemma hat_mul_zero_outside {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + {p : ℤ × ℤ} (hp : p ∉ indexBox N) (x : ℂ) : hat r p x*h x = 0 := by + by_cases hx : h x = 0 + · rw [hx,mul_zero] + · have ht : hat r p x = 0 := by + by_contra hn + exact hp (mem_indexBox_of_le hr hN (hs x hx) hn) + rw [ht,zero_mul] + +lemma density_partition_grid {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (x : ℂ) : + (∑ p : Grid N, hat r p x*h x) = h x := by + have he : (∑' p : ℤ × ℤ, hat r p x*h x) = ∑ p ∈ indexBox N, hat r p x*h x := + tsum_eq_sum (fun p hp => hat_mul_zero_outside hr hN hs hp x) + rw [Finset.sum_coe_sort (indexBox N) (fun p => hat r p x*h x),← he, + tsum_mul_right,tsum_hat,one_mul] + +lemma density_refine_grid {N : ℕ} {r R : ℝ} (hr : 0 < r) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℝ} (hs : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) + (p : Grid N) (x : ℂ) : + hat (2*r) p x*h x = ∑ q : Grid N, step p q*(hat r q x*h x) := by + rw [hat_refine,← tsum_mul_right,tsum_eq_sum (s := indexBox N)] + · rw [Finset.sum_coe_sort (indexBox N) (fun q => step p q*(hat r q x*h x))] + apply Finset.sum_congr rfl + intro q hq + ring + · intro q hq + rw [mul_assoc,hat_mul_zero_outside hr hN hs hq x,mul_zero] + +lemma integrable_hat_mul {h : ℂ → ℝ} (hh : Integrable h) (r : ℝ) (p : ℤ × ℤ) : + Integrable (fun y => hat r p y*h y) := by + exact hh.bdd_smul 1 (continuous_hat r p).aestronglyMeasurable + (ae_of_all _ (fun y => by + simpa only [Real.norm_eq_abs,abs_of_nonneg (hat_nonneg r p y)] using hat_le_one r p y)) + +def scale (r : ℝ) (k : ℕ) : ℝ := (2:ℝ)^k*r +lemma scale_pos {r : ℝ} (hr : 0 < r) (k : ℕ) : 0 < scale r k := by unfold scale; positivity +lemma scale_succ (r : ℝ) (k : ℕ) : scale r (k+1) = 2*scale r k := by + unfold scale + rw [pow_succ] + ring +lemma le_scale {r : ℝ} (hr : 0 ≤ r) (k : ℕ) : r ≤ scale r k := by + have hp : (1:ℝ) ≤ 2^k := one_le_pow₀ (by norm_num) + simpa only [one_mul,scale] using mul_le_mul_of_nonneg_right hp hr + +lemma scale_index_bound {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) (k : ℕ) : R/scale r k+1 ≤ (N:ℝ) := by + have hd : R / scale r k ≤ R / r := div_le_div_of_nonneg_left hR hr (le_scale hr.le k) + linarith + +end DyadicHats + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/RunCancellation.lean b/lean/OAI/Analysis/DiskMaximal/RunCancellation.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ec27d4faf4c3c6e4af6696b836bc8e008ffbded --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/RunCancellation.lean @@ -0,0 +1,658 @@ +import OAI.Analysis.DiskMaximal.Runs + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace SignedRuns +open DiskMoments ActualLabels + +def Regular (f : ℂ → ℂ) : Prop := HasCompactSupport f ∧ ∃ L : ℝ≥0, LipschitzWith L f + +lemma regular_zero : Regular (fun _ : ℂ => (0:ℂ)) := + ⟨HasCompactSupport.zero,0,LipschitzWith.const 0⟩ + +lemma regular_add {f g : ℂ → ℂ} (hf : Regular f) (hg : Regular g) : + Regular (fun x => f x+g x) := by + obtain ⟨hfC,L,hfL⟩ := hf + obtain ⟨hgC,K,hgL⟩ := hg + exact ⟨hfC.add hgC,L+K,hfL.add hgL⟩ + +lemma regular_scalar {f : ℂ → ℝ} (hc : HasCompactSupport f) {L : ℝ≥0} + (hf : LipschitzWith L f) (n : Label) : Regular (fun x => f x • (n:ℂ)) := by + refine ⟨hc.smul_right,L,?_⟩ + rw [lipschitzWith_iff_norm_sub_le] at hf ⊢ + intro x y + simpa only [← sub_smul,norm_smul,label_unit,mul_one] using hf x y + +lemma regular_listSum {α : Type*} (l : List α) (f : α → ℂ → ℂ) + (hf : ∀ a ∈ l, Regular (f a)) : Regular (fun x => (l.map fun a => f a x).sum) := by + induction l with + | nil => exact regular_zero + | cons a l ih => + exact regular_add (hf a (by simp)) (ih (fun b hb => hf b (by simp [hb]))) + +lemma runTerm_regular {g : ℂ → ℝ} {r : ℕ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (a : Run) (ha : a.first ≤ a.last) : + Regular (fun x => (runEnvelope g r a.first a.last x-signedAverage g x (r a.first)) • (a.dir:ℂ)) := by + have hab : r a.last ≤ 2*r a.first := by + have := radius_antitone r hr hstep ha + linarith [hr a.first] + obtain ⟨L,hL⟩ := run_envelope_lipschitz hg hgc (hr a.last) hab + obtain ⟨K,hK⟩ := hg.lipschitzWith_of_hasCompactSupport hgc one_ne_zero + apply regular_scalar + ((run_envelope_hasCompactSupport hg hgc (hr a.last) hab).sub (signedAverage_hasCompactSupport hg hgc (hr a.first))) + (hL.sub (signedAverage_lipschitz hK (hr a.first))) + +/-- Every exact history potential is compactly supported and Lipschitz, as +needed for signed weighted integration by parts. -/ +theorem potential_regular {g : ℂ → ℝ} {r : ℕ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (p : List Label) : Regular (fun x => potential g r x p) := by + cases p with + | nil => exact regular_zero + | cons n p => + simp_rw [potential_eq_runs] + exact regular_listSum (runs (n::p)) _ (fun a ha => + runTerm_regular hg hgc hr hstep a (runs_bounds n p a ha).1) +end SignedRuns + +namespace SignedRuns +open Complex + +def divergence (V : ℂ → ℂ) (x : ℂ) : ℝ := + fderiv ℝ (fun y => (V y).re) x 1+fderiv ℝ (fun y => (V y).im) x I + +lemma inner_coordinates (z w : ℂ) : + inner ℝ z w = inner ℝ z (1:ℂ)*w.re+inner ℝ z I*w.im := by + conv_lhs => rw [← Complex.re_add_im w] + rw [inner_add_right] + have hre : (w.re:ℂ) = w.re • (1:ℂ) := by simp + have him : (w.im:ℂ)*I = w.im • I := by rw [Complex.real_smul] + rw [hre,him,real_inner_smul_right,real_inner_smul_right] + ring + +lemma gradient_aestronglyMeasurable (f : ℂ → ℝ) : AEStronglyMeasurable (gradient f) := + ((InnerProductSpace.toDual ℝ ℂ).symm.continuous.measurable.comp + (measurable_fderiv ℝ f)).aestronglyMeasurable + +lemma gradient_norm_le {f : ℂ → ℝ} {L : ℝ≥0} (hf : LipschitzWith L f) (x : ℂ) : + ‖gradient f x‖ ≤ (L:ℝ) := by + simpa only [gradient,(InnerProductSpace.toDual ℝ ℂ).symm.norm_map] using + (norm_fderiv_le_of_lipschitz ℝ hf : ‖fderiv ℝ f x‖ ≤ (L:ℝ)) + +lemma integrable_fderiv_apply {f : ℂ → ℝ} {L : ℝ≥0} (hf : LipschitzWith L f) + (hc : HasCompactSupport f) (v : ℂ) : Integrable (fun x => fderiv ℝ f x v) := by + have hi := (innerSL ℝ v).integrable_comp (_root_.OAI.LipschitzWith.integrable_gradient (μ := volume) hf hc) + apply hi.congr + filter_upwards with x + change inner ℝ v (gradient f x) = _ + rw [real_inner_comm,gradient,InnerProductSpace.toDual_symm_apply] + +lemma integrable_gradient_mul {f g : ℂ → ℝ} {L : ℝ≥0} (hf : LipschitzWith L f) + (hg : Integrable g) (v : ℂ) : Integrable (fun x => inner ℝ (gradient f x) v*g x) := by + apply hg.bdd_mul ((gradient_aestronglyMeasurable f).inner aestronglyMeasurable_const) + filter_upwards with x + exact (norm_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_right (gradient_norm_le hf x) (norm_nonneg v)) + +lemma regular_integrable (V : ℂ → ℂ) (hV : Regular V) : Integrable V := by + obtain ⟨hc,L,hL⟩ := hV + exact hL.continuous.integrable_of_hasCompactSupport hc + +lemma weighted_divergence_integrable {w : ℂ → ℝ} {K : ℝ≥0} (hw : LipschitzWith K w) + (hb : ∀ x, ‖w x‖ ≤ 1) {V : ℂ → ℂ} (hV : Regular V) : + Integrable (fun x => w x*divergence V x) := by + obtain ⟨hc,L,hL⟩ := hV + have hr := integrable_fderiv_apply (Complex.reCLM.lipschitzWith.comp hL) + (hc.comp_left (map_zero Complex.reCLM)) (1:ℂ) + have hi := integrable_fderiv_apply (Complex.imCLM.lipschitzWith.comp hL) + (hc.comp_left (map_zero Complex.imCLM)) I + exact (hr.add hi).bdd_mul hw.continuous.aestronglyMeasurable (ae_of_all _ hb) + +lemma potential_flux_integrable {w : ℂ → ℝ} {K : ℝ≥0} (hw : LipschitzWith K w) + {V : ℂ → ℂ} (hV : Regular V) : + Integrable (fun x => inner ℝ (gradient w x) (V x)) := by + have hi := regular_integrable V hV + apply (hi.norm.const_mul (K:ℝ)).mono' + ((gradient_aestronglyMeasurable w).inner hi.aestronglyMeasurable) + filter_upwards with x + exact (norm_inner_le_norm _ _).trans (mul_le_mul_of_nonneg_right (gradient_norm_le hw x) (norm_nonneg _)) + +/-- Weighted vector integration by parts for the actual class of compact +Lipschitz path potentials and bounded Lipschitz spatial history weights. -/ +theorem vector_weighted_ibp {w : ℂ → ℝ} {K : ℝ≥0} (hw : LipschitzWith K w) + (hb : ∀ x, ‖w x‖ ≤ 1) {V : ℂ → ℂ} (hV : Regular V) : + (∫ x, w x*divergence V x) = -∫ x, inner ℝ (gradient w x) (V x) := by + obtain ⟨hc,L,hL⟩ := hV + have hrL := Complex.reCLM.lipschitzWith.comp hL + have hiL := Complex.imCLM.lipschitzWith.comp hL + have hrC := hc.comp_left (map_zero Complex.reCLM) + have hiC := hc.comp_left (map_zero Complex.imCLM) + have hr := (integrable_fderiv_apply hrL hrC (1:ℂ)).bdd_mul + hw.continuous.aestronglyMeasurable (ae_of_all _ hb) + have hi := (integrable_fderiv_apply hiL hiC I).bdd_mul + hw.continuous.aestronglyMeasurable (ae_of_all _ hb) + have hrr := integrable_gradient_mul hw (hrL.continuous.integrable_of_hasCompactSupport hrC) (1:ℂ) + have hir := integrable_gradient_mul hw (hiL.continuous.integrable_of_hasCompactSupport hiC) I + change (∫ x, w x*(fderiv ℝ (Complex.reCLM ∘ V) x 1+fderiv ℝ (Complex.imCLM ∘ V) x I)) = _ + simp only [mul_add] + rw [integral_add hr hi,_root_.OAI.LipschitzWith.integral_mul_fderiv_eq_neg (μ := volume) hw hrL hrC (1:ℂ), + _root_.OAI.LipschitzWith.integral_mul_fderiv_eq_neg (μ := volume) hw hiL hiC I,← neg_add,← integral_add hrr hir] + congr 1 + apply integral_congr_ae + filter_upwards with x + exact (inner_coordinates _ _).symm +end SignedRuns + +namespace SignedRuns +open ActualLabels FiniteLabels SignedAssembly Finset DiskMoments + +lemma leafSum_add (f g : List Label → ℝ) (d : ℕ) (p : List Label) : + leafSum (fun q => f q+g q) d p = leafSum f d p+leafSum g d p := by + induction d generalizing p with + | zero => rfl + | succ d ih => simp only [leafSum,ih,sum_add_distrib] + +lemma leafSum_mul_const (f : List Label → ℝ) (c : ℝ) (d : ℕ) (p : List Label) : + leafSum (fun q => f q*c) d p = leafSum f d p*c := by + induction d generalizing p with + | zero => rfl + | succ d ih => simp only [leafSum,ih,sum_mul] + +lemma leafSum_const_mul (f : List Label → ℝ) (c : ℝ) (d : ℕ) (p : List Label) : + leafSum (fun q => c*f q) d p = c*leafSum f d p := by + simpa only [mul_comm] using leafSum_mul_const f c d p + +lemma leafSum_neg (f : List Label → ℝ) (d : ℕ) (p : List Label) : + leafSum (fun q => -(f q)) d p = -leafSum f d p := by + simpa only [neg_one_mul] using leafSum_const_mul f (-1) d p + +lemma leafSum_mono (f g : List Label → ℝ) (d : ℕ) (p : List Label) + (hle : ∀ q, q.length = p.length+d → f q ≤ g q) : leafSum f d p ≤ leafSum g d p := by + induction d generalizing p with + | zero => exact hle p (by simp) + | succ d ih => + apply sum_le_sum + intro n _ + apply ih + intro q hq + apply hle q + simp only [List.length_cons] at hq + omega + +lemma leafSum_congr (f g : List Label → ℝ) (d : ℕ) (p : List Label) + (he : ∀ q, q.length = p.length+d → f q = g q) : leafSum f d p = leafSum g d p := + le_antisymm (leafSum_mono f g d p (fun q hq => (he q hq).le)) + (leafSum_mono g f d p (fun q hq => (he q hq).ge)) + +lemma leafSum_weight (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) (d : ℕ) (p : List Label) : + leafSum (weight h r old x) d p = weight h r old x p := by + induction d generalizing p with + | zero => rfl + | succ d ih => + simp only [leafSum,ih,weight,← mul_sum,(observation h r p.length x (p.headD old)).total,mul_one] + +lemma leafSum_integrable (f : List Label → ℂ → ℝ) (hf : ∀ q, Integrable (f q)) + (d : ℕ) (p : List Label) : Integrable (fun x => leafSum (fun q => f q x) d p) := by + induction d generalizing p with + | zero => exact hf p + | succ d ih => exact integrable_finsetSum _ (fun n _ => ih (n::p)) + +lemma integral_leafSum (f : List Label → ℂ → ℝ) (hf : ∀ q, Integrable (f q)) + (d : ℕ) (p : List Label) : + (∫ x, leafSum (fun q => f q x) d p) = leafSum (fun q => ∫ x, f q x) d p := by + induction d generalizing p with + | zero => rfl + | succ d ih => + simp only [leafSum] + rw [integral_finsetSum _ (fun n _ => leafSum_integrable f hf d (n::p))] + exact sum_congr rfl (fun n _ => ih (n::p)) + +theorem history_weighted_ibp (g : ℂ → ℝ) (h : ℂ → ℂ) (r : ℕ → ℝ) + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (old : Label) (m : ℕ) : + (∫ x, leafSum (fun q => weight h r old x q*divergence (fun y => potential g r y q) x) m []) = + -∫ x, leafSum (fun q => inner ℝ (gradient (fun y => weight h r old y q) x) (potential g r x q)) m [] := by + have hreg (q : List Label) := potential_regular hg hc hr hstep q + have hint (q : List Label) : Integrable (fun x => weight h r old x q*divergence (fun y => potential g r y q) x) := by + obtain ⟨K,hK⟩ := weight_lipschitz h r hr old q + apply weighted_divergence_integrable hK _ (hreg q) + intro x + rw [Real.norm_eq_abs,abs_of_nonneg (weight_nonneg h r old x q)] + exact weight_le_one h r old x q + have hflux (q : List Label) : Integrable (fun x => inner ℝ (gradient (fun y => weight h r old y q) x) (potential g r x q)) := by + obtain ⟨K,hK⟩ := weight_lipschitz h r hr old q + exact potential_flux_integrable hK (hreg q) + rw [integral_leafSum _ hint,integral_leafSum _ hflux,← leafSum_neg] + apply leafSum_congr + intro q _ + obtain ⟨K,hK⟩ := weight_lipschitz h r hr old q + apply vector_weighted_ibp hK _ (hreg q) + intro x + rw [Real.norm_eq_abs,abs_of_nonneg (weight_nonneg h r old x q)] + exact weight_le_one h r old x q + +/-- Averaging preserves the complete signed run-master inequality; finite +history weights sum to one at every observation point. -/ +theorem expected_run_master (g : ℂ → ℝ) (h : ℂ → ℂ) (r : ℕ → ℝ) + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (old : Label) (m : ℕ) (x : ℂ) + (hd : ∀ i j, i ≤ j → DifferentiableAt ℝ (runEnvelope g r i j) x) : + ‖gradient (runEnvelope g r 0 m) x‖ ≤ + 12*leafSum (fun q => weight h r old x q*((runs q).map fun a => coneContribution a.dir + (gradient (runEnvelope g r a.first a.last) x)).sum) (m+1) [] := by + have hh := leafSum_mono + (fun q => weight h r old x q*‖gradient (runEnvelope g r 0 m) x‖) + (fun q => weight h r old x q*(12*((runs q).map fun a => coneContribution a.dir + (gradient (runEnvelope g r a.first a.last) x)).sum)) (m+1) [] (by + intro q hq + cases q with + | nil => simp at hq + | cons n p => + have hp : p.length = m := by simpa using hq + apply mul_le_mul_of_nonneg_left _ (weight_nonneg h r old x (n::p)) + simpa only [hp] using run_master hg hc hr hstep n p x hd) + rw [leafSum_mul_const,leafSum_weight,weight,one_mul] at hh + have he : (fun q => weight h r old x q*(12*((runs q).map fun a => coneContribution a.dir + (gradient (runEnvelope g r a.first a.last) x)).sum)) = + (fun q => 12*(weight h r old x q*((runs q).map fun a => coneContribution a.dir + (gradient (runEnvelope g r a.first a.last) x)).sum)) := by funext q; ring + rw [he,leafSum_const_mul] at hh + exact hh +end SignedRuns + +namespace SignedRuns +open DiskMoments ActualLabels Complex + +lemma divergence_add {U V : ℂ → ℂ} {x : ℂ} + (hU : DifferentiableAt ℝ U x) (hV : DifferentiableAt ℝ V x) : + divergence (fun y => U y+V y) x = divergence U x+divergence V x := by + have hUr : DifferentiableAt ℝ (fun y => (U y).re) x := Complex.reCLM.differentiableAt.comp x hU + have hVr : DifferentiableAt ℝ (fun y => (V y).re) x := Complex.reCLM.differentiableAt.comp x hV + have hUi : DifferentiableAt ℝ (fun y => (U y).im) x := Complex.imCLM.differentiableAt.comp x hU + have hVi : DifferentiableAt ℝ (fun y => (V y).im) x := Complex.imCLM.differentiableAt.comp x hV + simp only [divergence,Complex.add_re,Complex.add_im] + rw [fderiv_fun_add hUr hVr,fderiv_fun_add hUi hVi] + simp only [_root_.add_apply] + ring + +lemma divergence_scalar {f : ℂ → ℝ} {x : ℂ} (hf : DifferentiableAt ℝ f x) (n : ℂ) : + divergence (fun y => f y • n) x = inner ℝ n (gradient f x) := by + simp only [divergence,Complex.real_smul,Complex.mul_re,Complex.mul_im, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero,add_zero] + rw [fderiv_mul_const hf n.re,fderiv_mul_const hf n.im] + simp only [_root_.smul_apply,smul_eq_mul] + rw [real_inner_comm,inner_coordinates] + simp only [gradient,InnerProductSpace.toDual_symm_apply] + ring + +lemma listSum_diff {α : Type*} (l : List α) (V : α → ℂ → ℂ) {x : ℂ} + (hd : ∀ a ∈ l, DifferentiableAt ℝ (V a) x) : + DifferentiableAt ℝ (fun y => (l.map fun a => V a y).sum) x := by + induction l with + | nil => exact differentiableAt_const 0 + | cons a l ih => + exact (hd a (by simp)).add (ih (fun a ha => hd a (by simp [ha]))) + +lemma divergence_listSum {α : Type*} (l : List α) (V : α → ℂ → ℂ) {x : ℂ} + (hd : ∀ a ∈ l, DifferentiableAt ℝ (V a) x) : + divergence (fun y => (l.map fun a => V a y).sum) x = (l.map fun a => divergence (V a) x).sum := by + induction l with + | nil => simp [divergence] + | cons a l ih => + have hs := listSum_diff l V (fun b hb => hd b (by simp [hb])) + simp only [List.map_cons,List.sum_cons] + rw [divergence_add (hd a (by simp)) hs,ih (fun b hb => hd b (by simp [hb]))] + +lemma average_diff {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) + (x : ℂ) {t : ℝ} (ht : 0 < t) : DifferentiableAt ℝ (fun y => signedAverage g y t) x := by + obtain ⟨K,hK⟩ := hg.lipschitzWith_of_hasCompactSupport hc one_ne_zero + exact (hasFDerivAt_signedAverage hg (fun y => norm_fderiv_le_of_lipschitz ℝ hK) x ht).differentiableAt + +/-- The divergence of the exact path potential is the complete signed sum +of run gradients, with precisely the starting-baseline gradients removed. -/ +lemma potential_divergence {g : ℂ → ℝ} {r : ℕ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) (hr : ∀ k, 0 < r k) (p : List Label) (x : ℂ) + (hd : ∀ i j, i ≤ j → DifferentiableAt ℝ (runEnvelope g r i j) x) : + divergence (fun y => potential g r y p) x = + ((runs p).map fun a => inner ℝ (a.dir:ℂ) + (gradient (runEnvelope g r a.first a.last) x-gradient (fun y => signedAverage g y (r a.first)) x)).sum := by + cases p with + | nil => simp [potential,runs,divergence] + | cons n p => + simp_rw [potential_eq_runs] + have hd' (a : Run) (ha : a ∈ runs (n::p)) : + DifferentiableAt ℝ (fun y => runEnvelope g r a.first a.last y-signedAverage g y (r a.first)) x := + (hd a.first a.last (runs_bounds n p a ha).1).sub (average_diff hg hgc x (hr a.first)) + rw [divergence_listSum _ _ (fun a ha => (hd' a ha).smul_const (a.dir:ℂ))] + apply congrArg List.sum + apply List.map_congr_left + intro a ha + rw [divergence_scalar (hd' a ha)] + congr 1 + simp only [gradient] + rw [fderiv_fun_sub (hd a.first a.last (runs_bounds n p a ha).1) (average_diff hg hgc x (hr a.first)),map_sub] +end SignedRuns + +namespace SignedRuns +open DiskMoments ActualLabels Finset ConeCoordinates + +lemma radius_in_run_bin (r : ℕ → ℝ) (hstep : ∀ k, 2*r (k+1) = r k) + {i j : ℕ} (hij : i ≤ j) {t : ℝ} (ht : t ∈ Icc (r j) (2*r i)) : + ∃ k ∈ Set.Icc i j, t ∈ Icc (r k) (2*r k) := by + obtain ⟨l,hl,htl⟩ := radius_in_bin (fun k => r (i+k)) + (fun k => by simpa [Nat.add_assoc] using hstep (i+k)) (j-i) + (by simpa only [Nat.add_sub_of_le hij,Nat.add_zero] using ht) + exact ⟨i+l,⟨by omega,by omega⟩,htl⟩ + +lemma attaining_endpoint {g : ℂ → ℝ} {r : ℕ → ℝ} + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + {i j k : ℕ} (hik : i ≤ k) (hkj : k ≤ j) {x : ℂ} {t : ℝ} + (ht : t ∈ Icc (r k) (2*r k)) + (hmax : ∀ s ∈ Icc (r j) (2*r i), signedAverage g x s ≤ signedAverage g x t) : + PhysicalEndpointRadius g (r k) x t := by + refine ⟨ht,Or.inr (Or.inr ?_)⟩ + intro s hs + apply hmax + constructor + · exact (radius_antitone r hr hstep hkj).trans hs.1 + · have := radius_antitone r hr hstep hik + linarith [hs.2] + +lemma attaining_interior {g : ℂ → ℝ} {r : ℕ → ℝ} + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + {i j k : ℕ} (hik : i < k) (hkj : k < j) {x : ℂ} {t : ℝ} + (ht : t ∈ Icc (r k) (2*r k)) + (hmax : ∀ s ∈ Icc (r j) (2*r i), signedAverage g x s ≤ signedAverage g x t) : + PhysicalNeighborhoodRadius g (r k) x t := by + refine ⟨ht,?_⟩ + intro s _ hs + apply hmax + have hs' := abs_le.mp hs + have hlow := radius_antitone r hr hstep (show k+1 ≤ j by omega) + have hhigh := radius_antitone r hr hstep (show i+1 ≤ k by omega) + constructor <;> linarith [hstep k,hstep i,hr k,ht.1,ht.2] + +def unfavorable (n : Label) (z : ℂ) : ℝ := + max 0 (-inner ℝ (axis n 1) z)+max 0 (-inner ℝ (axis n (-1)) z) + +lemma unfavorable_nonneg (n : Label) (z : ℂ) : 0 ≤ unfavorable n z := + add_nonneg (le_max_left _ _) (le_max_left _ _) + +lemma unfavorable_le_norm (n : Label) (z : ℂ) : unfavorable n z ≤ 2*‖z‖ := by + have h (s : ℝ) (hs : s^2 = 1) : max 0 (-inner ℝ (axis n s) z) ≤ ‖z‖ := by + apply max_le (norm_nonneg _) + have hh := abs_real_inner_le_norm (axis (n:ℂ) s) z + rw [axis_norm (label_unit n) hs,one_mul] at hh + exact (neg_le_abs _).trans hh + have hp := h 1 (by norm_num) + have hm := h (-1) (by norm_num) + unfold unfavorable + linarith + +/-- The exact unfavorable run term is charged either to one interior bin or +one of its two end bins; padding by nonnegative costs permits summing runs. -/ +lemma run_unfavorable_bound {g : ℂ → ℝ} {r : ℕ → ℝ} + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (H : ℕ → Label → ℝ) (J : ℕ → ℝ) (hH : ∀ k n, 0 ≤ H k n) (hJ : ∀ k, 0 ≤ J k) + (x : ℂ) (n : Label) {i j : ℕ} (hij : i ≤ j) + (hd : DifferentiableAt ℝ (runEnvelope g r i j) x) + (hinterior : ∀ k t, PhysicalNeighborhoodRadius g (r k) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H k n) + (hend : ∀ k t, PhysicalEndpointRadius g (r k) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J k) : + unfavorable n (gradient (runEnvelope g r i j) x) ≤ + (∑ k ∈ Icc i j, H k n)+2*(J i+J j) := by + obtain ⟨t,ht,he,hm⟩ := runEnvelope_attains g r hg hr hstep hij x + rw [run_gradient_touching hg hc hr hd ht he] + obtain ⟨k,hk,hkt⟩ := radius_in_run_bin r hstep hij ht + have hs : 0 ≤ ∑ k ∈ Icc i j, H k n := sum_nonneg (fun _ _ => hH _ _) + by_cases hki : k = i + · subst k + have hb := (unfavorable_le_norm n _).trans (mul_le_mul_of_nonneg_left + (hend i t (attaining_endpoint hr hstep le_rfl hij hkt hm)) (by norm_num : (0:ℝ) ≤ 2)) + linarith [hJ j] + by_cases hkj : k = j + · subst k + have hb := (unfavorable_le_norm n _).trans (mul_le_mul_of_nonneg_left + (hend j t (attaining_endpoint hr hstep hij le_rfl hkt hm)) (by norm_num : (0:ℝ) ≤ 2)) + linarith [hJ i] + have hik := hk.1 + have hkj' := hk.2 + have hb := hinterior k t (attaining_interior hr hstep (by omega) (by omega) hkt hm) + have hsum : H k n ≤ ∑ l ∈ Icc i j, H l n := single_le_sum (fun l _ => hH l n) (Finset.mem_Icc.mpr hk) + linarith [hJ i,hJ j] +end SignedRuns + +namespace SignedRuns +open ActualLabels FiniteLabels Finset + +lemma leafSum_succ_last {E : Type*} [AddCommMonoid E] (f : List Label → E) + (m : ℕ) (p : List Label) : + leafSum f (m+1) p = leafSum (fun q => ∑ n, f (n::q)) m p := by + induction m generalizing p with + | zero => rfl + | succ m ih => + change (∑ n, leafSum f (m+1) (n::p)) = + ∑ n, leafSum (fun q => ∑ j, f (j::q)) m (n::p) + simp_rw [ih] + +lemma leafSum_sum {E : Type*} [AddCommMonoid E] {ι : Type*} + (s : Finset ι) (f : ι → List Label → E) (m : ℕ) (p : List Label) : + leafSum (fun q => ∑ i ∈ s, f i q) m p = ∑ i ∈ s, leafSum (f i) m p := by + induction m generalizing p with + | zero => rfl + | succ m ih => simp only [leafSum,ih]; exact sum_comm + +/-- The exact head law obtained from the genuine finite-history products. -/ +lemma leafSum_headLaw (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (m : ℕ) (F : Label → ℝ) : + leafSum (fun q => weight h r old x q*F (q.headD old)) m [] = + expect (before h r old x m) F := by + induction m generalizing F with + | zero => simp only [leafSum,weight,List.headD_nil,one_mul,before,expect_delta] + | succ m ih => + rw [leafSum_succ_last,before_move,expect_move] + have he (q : List Label) : + (∑ n, weight h r old x (n::q)*F ((n::q).headD old)) = + weight h r old x q*expect (observation h r q.length x (q.headD old)) F := by + simp only [weight,List.headD_cons,FiniteLabels.expect,mul_assoc,mul_sum] + simp_rw [he] + have hc := leafSum_congr + (fun q => weight h r old x q*expect (observation h r q.length x (q.headD old)) F) + (fun q => weight h r old x q*expect (observation h r m x (q.headD old)) F) m [] + (by + intro q hq + have hqm : q.length = m := by simpa using hq + rw [hqm]) + rw [hc] + exact ih (fun n => FiniteLabels.expect (observation h r m x n) F) + +/-- Additive reward along a reversed history, with its true previous state. -/ +def pathReward (old : Label) (A : ℕ → Label → Label → ℝ) : List Label → ℝ + | [] => 0 + | n::p => pathReward old A p+A p.length (p.headD old) n + +lemma leafSum_pathReward (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (A : ℕ → Label → Label → ℝ) (m : ℕ) : + leafSum (fun q => weight h r old x q*pathReward old A q) m [] = + ∑ k ∈ range m, expect (before h r old x k) + (fun n => expect (observation h r k x n) (A k n)) := by + induction m with + | zero => simp [leafSum,pathReward] + | succ m ih => + rw [leafSum_succ_last,sum_range_succ] + have he (q : List Label) : + (∑ n, weight h r old x (n::q)*pathReward old A (n::q)) = + weight h r old x q*pathReward old A q+ + weight h r old x q*expect (observation h r q.length x (q.headD old)) (A q.length (q.headD old)) := by + simp only [weight,pathReward,mul_add,sum_add_distrib,← sum_mul,← mul_sum,FiniteLabels.expect,mul_assoc] + rw [(observation h r q.length x (q.headD old)).total,one_mul] + simp_rw [he] + rw [leafSum_add,ih] + congr 1 + have hc := leafSum_congr + (fun q => weight h r old x q*expect (observation h r q.length x (q.headD old)) (A q.length (q.headD old))) + (fun q => weight h r old x q*expect (observation h r m x (q.headD old)) (A m (q.headD old))) m [] + (by + intro q hq + have hqm : q.length = m := by simpa using hq + rw [hqm]) + rw [hc] + exact leafSum_headLaw h r old x m (fun n => FiniteLabels.expect (observation h r m x n) (A m n)) + +lemma pathReward_add (old : Label) (A B : ℕ → Label → Label → ℝ) (q : List Label) : + pathReward old (fun k n j => A k n j+B k n j) q = + pathReward old A q+pathReward old B q := by + induction q with + | nil => simp [pathReward] + | cons n p ih => simp only [pathReward,ih]; ring + +lemma pathReward_nonneg (old : Label) (A : ℕ → Label → Label → ℝ) + (hA : ∀ k n j, 0 ≤ A k n j) (q : List Label) : 0 ≤ pathReward old A q := by + induction q with + | nil => exact le_rfl + | cons n p ih => exact add_nonneg ih (hA _ _ _) + +end SignedRuns + +namespace SignedRuns +open ActualLabels FiniteLabels Finset + +lemma run_span_sum (H : ℕ → Label → ℝ) (old : Label) (p : List Label) : + ((runs p).map fun a => ∑ k ∈ Icc a.first a.last, H k a.dir).sum = + pathReward old (fun k _ n => H k n) p := by + cases p with + | nil => rfl + | cons n p => + induction p generalizing n with + | nil => simp [runs,closedRuns,activeStart,pathReward] + | cons n' p ih => + by_cases hn : n = n' + · subst n + have hsum : (∑ k ∈ Icc (activeStart (n'::p)) (p.length+1), H k n') = + (∑ k ∈ Icc (activeStart (n'::p)) p.length, H k n')+H (p.length+1) n' := by + exact sum_Icc_succ_top ((activeStart_le n' p).trans (Nat.le_succ _)) _ + have hh := ih n' + simp only [runs,List.map_cons,List.sum_cons] at hh + simp only [runs,closedRuns,activeStart,ite_true,List.length_cons,List.map_cons,List.sum_cons,pathReward] + rw [hsum] + simp only [pathReward] at hh + linarith + · have hh := ih n' + simp only [runs,List.map_cons,List.sum_cons] at hh + simp only [runs,closedRuns,activeStart,hn,ite_false,List.length_cons,List.map_cons,List.sum_cons,pathReward, + Finset.Icc_self,sum_singleton] + simp only [pathReward] at hh + linarith + +def startReward (J : ℕ → ℝ) : ℕ → Label → Label → ℝ + | 0,_,_ => J 0 + | k+1,n,j => if j = n then 0 else J (k+1) + +def boundaryReward (J : ℕ → ℝ) : ℕ → Label → Label → ℝ + | 0,_,_ => J 0 + | k+1,n,j => if j = n then 0 else J k+J (k+1) + +lemma run_start_sum (J : ℕ → ℝ) (old : Label) (p : List Label) : + ((runs p).map fun a => J a.first).sum = pathReward old (startReward J) p := by + cases p with + | nil => rfl + | cons n p => + induction p generalizing n with + | nil => simp [runs,activeStart,closedRuns,pathReward,startReward] + | cons n' p ih => + have hh := ih n' + simp only [runs,List.map_cons,List.sum_cons] at hh + simp only [pathReward,startReward] at hh + by_cases hn : n = n' + · subst n + simpa only [runs,closedRuns,activeStart,ite_true,List.length_cons,List.map_cons,List.sum_cons, + pathReward,startReward,List.headD_cons,add_zero] using hh + · simp only [runs,closedRuns,activeStart,hn,ite_false,List.length_cons,List.map_cons,List.sum_cons, + pathReward,startReward,List.headD_cons] + linarith + +lemma run_boundary_sum (J : ℕ → ℝ) (old n : Label) (p : List Label) : + ((runs (n::p)).map fun a => J a.first+J a.last).sum = + pathReward old (boundaryReward J) (n::p)+J p.length := by + induction p generalizing n with + | nil => simp [runs,activeStart,closedRuns,pathReward,boundaryReward] + | cons n' p ih => + have hh := ih n' + simp only [runs,List.map_cons,List.sum_cons,pathReward,boundaryReward] at hh + by_cases hn : n = n' + · subst n + simp only [runs,closedRuns,activeStart,ite_true,List.length_cons,List.map_cons,List.sum_cons, + pathReward,boundaryReward,List.headD_cons] + linarith + · simp only [runs,closedRuns,activeStart,hn,ite_false,List.length_cons,List.map_cons,List.sum_cons, + pathReward,boundaryReward,List.headD_cons] + linarith + +lemma startReward_nonneg (J : ℕ → ℝ) (hJ : ∀ k, 0 ≤ J k) (k : ℕ) (n j : Label) : + 0 ≤ startReward J k n j := by + cases k with + | zero => exact hJ 0 + | succ k => simp only [startReward]; split_ifs <;> first | exact le_rfl | exact hJ _ + +lemma boundaryReward_nonneg (J : ℕ → ℝ) (hJ : ∀ k, 0 ≤ J k) (k : ℕ) (n j : Label) : + 0 ≤ boundaryReward J k n j := by + cases k with + | zero => exact hJ 0 + | succ k => simp only [boundaryReward]; split_ifs <;> first | exact le_rfl | exact add_nonneg (hJ _) (hJ _) + +end SignedRuns + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Runs.lean b/lean/OAI/Analysis/DiskMaximal/Runs.lean new file mode 100644 index 0000000000000000000000000000000000000000..8f7cad97cb10be61b6cf36fb98a573c4732425c4 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Runs.lean @@ -0,0 +1,692 @@ +import OAI.Analysis.DiskMaximal.Potentials + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace SignedRuns +open DiskMoments RadiusEnvelope ActualLabels Finset + +variable (g : ℂ → ℝ) (r : ℕ → ℝ) +def runEnvelope (i j : ℕ) (x : ℂ) : ℝ := + envelope (fun t y => signedAverage g y t) (r j) (2*r i) x + +lemma radius_antitone (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) : Antitone r := by + apply antitone_nat_of_succ_le + intro k + have := hr (k+1) + linarith [hstep k] + +lemma runEnvelope_attains (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) {i j : ℕ} (hij : i ≤ j) (x : ℂ) : + ∃ t ∈ Icc (r j) (2*r i), runEnvelope g r i j x = signedAverage g x t ∧ + ∀ s ∈ Icc (r j) (2*r i), signedAverage g x s ≤ signedAverage g x t := by + apply attains _ x (signedAverage_radius_continuousOn hg x (hr j)) + have := radius_antitone r hr hstep hij + linarith [hr i] + +lemma runEnvelope_le_next (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) {i j : ℕ} (hij : i ≤ j) (x : ℂ) : + runEnvelope g r i j x ≤ runEnvelope g r i (j+1) x := by + obtain ⟨t,ht,he,_⟩ := runEnvelope_attains g r hg hr hstep hij x + rw [he] + apply le_envelope ⟨(radius_antitone r hr hstep (Nat.le_succ j)).trans ht.1,ht.2⟩ x + (signedAverage_radius_continuousOn hg x (hr (j+1))) + +lemma runEnvelope_extension_bound (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) {i j : ℕ} (hij : i ≤ j) (x : ℂ) {V : ℝ} + (hV : ∀ t t', 0 < t → t ≤ 4*r (j+1) → 0 < t' → t' ≤ 4*r (j+1) → + |signedAverage g x t-signedAverage g x t'| ≤ V) : + |runEnvelope g r i (j+1) x-runEnvelope g r i j x| ≤ V := by + have hV0 : 0 ≤ V := by + have hh := hr (j+1) + simpa using hV (r (j+1)) (r (j+1)) hh (by linarith) hh (by linarith) + have h0 := runEnvelope_le_next g r hg hr hstep hij x + rw [abs_of_nonneg (sub_nonneg.mpr h0)] + obtain ⟨t,ht,he,_⟩ := runEnvelope_attains g r hg hr hstep (hij.trans (Nat.le_succ j)) x + rw [he] + by_cases htj : r j ≤ t + · have hh := le_envelope (u := fun t y => signedAverage g y t) ⟨htj,ht.2⟩ x + (signedAverage_radius_continuousOn hg x (hr j)) + change signedAverage g x t ≤ runEnvelope g r i j x at hh + linarith + · have hb : signedAverage g x (r j) ≤ runEnvelope g r i j x := by + change signedAverage g x (r j) ≤ envelope (fun t y => signedAverage g y t) (r j) (2*r i) x + apply le_envelope (u := fun t y => signedAverage g y t) (a := r j) (b := 2*r i) (r := r j) ⟨le_rfl,?_⟩ x (signedAverage_radius_continuousOn hg x (hr j)) + have := radius_antitone r hr hstep hij + linarith [hr i] + have hh := hV t (r j) ((hr (j+1)).trans_le ht.1) + (by linarith [hstep j,hr (j+1)]) (hr j) (by linarith [hstep j,hr (j+1)]) + linarith [le_abs_self (signedAverage g x t-signedAverage g x (r j))] + +lemma runEnvelope_new_bound (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (j : ℕ) (x : ℂ) {V : ℝ} + (hV : ∀ t t', 0 < t → t ≤ 4*r j → 0 < t' → t' ≤ 4*r j → + |signedAverage g x t-signedAverage g x t'| ≤ V) : + |runEnvelope g r j j x-signedAverage g x (r j)| ≤ V := by + obtain ⟨t,ht,he,_⟩ := runEnvelope_attains g r hg hr hstep le_rfl x + rw [he] + exact hV t (r j) ((hr j).trans_le ht.1) (by linarith [hr j,ht.2]) (hr j) (by linarith [hr j]) + +/-- Reversed chronological histories. The active run's start is retained when +its new label agrees, and is reset to the new time at a switch. -/ +def activeStart : List Label → ℕ + | [] => 0 + | [_] => 0 + | n::old::p => if n = old then activeStart (old::p) else (old::p).length + +lemma activeStart_le (n : Label) (p : List Label) : activeStart (n::p) ≤ p.length := by + induction p generalizing n with + | nil => simp [activeStart] + | cons old p ih => + dsimp only [activeStart] + split_ifs + · exact (ih old).trans (by simp) + · rfl + +/-- The exact closed-prefix vector potential, updated without ever taking the +absolute size of an old large-radius envelope. -/ +def potential (x : ℂ) : List Label → ℂ + | [] => 0 + | [n] => (runEnvelope g r 0 0 x-signedAverage g x (r 0)) • (n:ℂ) + | n::old::p => potential x (old::p)+ + (if n = old then (runEnvelope g r (activeStart (old::p)) (p.length+1) x- + runEnvelope g r (activeStart (old::p)) p.length x) • (n:ℂ) + else (runEnvelope g r (p.length+1) (p.length+1) x- + signedAverage g x (r (p.length+1))) • (n:ℂ)) + +lemma potential_increment (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (x : ℂ) (v : ℕ → ℝ) + (hv : ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |signedAverage g x t-signedAverage g x t'| ≤ v k) + (n : Label) (p : List Label) : ‖potential g r x (n::p)-potential g r x p‖ ≤ v p.length := by + cases p with + | nil => + simp only [potential,List.length_nil,sub_zero,norm_smul,Real.norm_eq_abs,label_unit,mul_one] + exact runEnvelope_new_bound g r hg hr hstep 0 x (hv 0) + | cons old p => + simp only [potential,add_sub_cancel_left,List.length_cons] + split_ifs + · simp only [norm_smul,Real.norm_eq_abs,label_unit,mul_one] + exact runEnvelope_extension_bound g r hg hr hstep (activeStart_le old p) x (hv (p.length+1)) + · simp only [norm_smul,Real.norm_eq_abs,label_unit,mul_one] + exact runEnvelope_new_bound g r hg hr hstep (p.length+1) x (hv (p.length+1)) + +theorem potential_continuation_bound (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (x : ℂ) (v : ℕ → ℝ) + (hv : ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |signedAverage g x t-signedAverage g x t'| ≤ v k) + (p q : List Label) : ‖potential g r x (q++p)-potential g r x p‖ ≤ + ∑ k ∈ Ico p.length (p.length+q.length), v k := by + induction q with + | nil => simp + | cons n q ih => + have htri : ‖potential g r x ((n::q)++p)-potential g r x p‖ ≤ + ‖potential g r x (n::(q++p))-potential g r x (q++p)‖+ + ‖potential g r x (q++p)-potential g r x p‖ := by + simpa only [sub_add_sub_cancel,List.cons_append] using norm_add_le + (potential g r x (n::(q++p))-potential g r x (q++p)) + (potential g r x (q++p)-potential g r x p) + have hi := potential_increment g r hg hr hstep x v hv n (q++p) + apply htri.trans + rw [List.length_cons,Nat.add_succ,sum_Ico_succ_top (by omega : p.length ≤ p.length+q.length)] + simpa only [List.length_append,Nat.add_comm,add_comm] using add_le_add hi ih +end SignedRuns + +namespace SignedRuns +open SignedAssembly FiniteLabels ActualLabels Finset + +variable (g : ℂ → ℝ) (r : ℕ → ℝ) (x : ℂ) +variable (J : ℕ → Label → RowJet Label ℂ) (v : ℕ → ℝ) + +/-- The actual closed-prefix potentials at the leaves, with the stochastic +row jet at every observation time. -/ +def jet : ℕ → List Label → Label → JetTree Label ℂ + | 0,p,_ => .leaf (potential g r x p) + | d+1,p,n => .branch (J p.length n) (potential g r x p) + (∑ k ∈ Ico p.length (p.length+d+1), v k) (fun a => jet d (a::p) a) + +lemma jet_terminalBound (d : ℕ) (p : List Label) (old : Label) (c : ℂ) (B : ℝ) + (h : ∀ q : List Label, q.length = d → ‖potential g r x (q++p)-c‖ ≤ B) : + TerminalBound (jet g r x J v d p old) c B := by + induction d generalizing p old with + | zero => simpa only [jet,TerminalBound,List.nil_append] using h [] rfl + | succ d ih => + intro n + apply ih + intro q hq + have hh := h (q++[n]) (by simp only [List.length_append,List.length_singleton,hq]) + simpa only [List.append_assoc,List.singleton_append] using hh + +lemma jet_controlled (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) + (hv : ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |DiskMoments.signedAverage g x t-DiskMoments.signedAverage g x t'| ≤ v k) + (d : ℕ) (p : List Label) (old : Label) : Controlled (jet g r x J v d p old) := by + induction d generalizing p old with + | zero => trivial + | succ d ih => + constructor + · intro n + apply jet_terminalBound + intro q hq + have hh := potential_continuation_bound g r hg hr hstep x v hv p (q++[n]) + simpa only [List.append_assoc,List.singleton_append,List.length_append,List.length_singleton,hq,Nat.add_assoc] using hh + · intro n + exact ih (n::p) n + +/-- Backward expected reward for an arbitrary time-dependent finite Markov law. -/ +def rewardCost (reward : ℕ → Label → ℝ) : ℕ → ℕ → Label → ℝ + | _,0,_ => 0 + | k,d+1,n => reward k n+expect (J k n).law (fun a => rewardCost reward (k+1) d a) + +lemma jet_cost (d : ℕ) (p : List Label) (old : Label) (m : ℕ) (hm : p.length+d = m) : + cost (jet g r x J v d p old) = rewardCost J + (fun k n => (∑ a, ‖(J k n).grad a‖)*(∑ l ∈ Ico k m, v l)) p.length d old := by + induction d generalizing p old with + | zero => rfl + | succ d ih => + simp only [jet,cost,rewardCost] + have htop : p.length+d+1 = m := by omega + rw [htop] + congr 1 + apply sum_congr rfl + intro a _ + rw [ih (a::p) a (by simp only [List.length_cons]; omega)] + rfl + +lemma expect_rewardCost (reward : ℕ → Label → ℝ) (μ : ℕ → Law Label) + (hμ : ∀ k, μ (k+1) = move (μ k) (fun n => (J k n).law)) (d k : ℕ) : + expect (μ k) (rewardCost J reward k d) = + ∑ i ∈ Ico k (k+d), expect (μ i) (reward i) := by + induction d generalizing k with + | zero => simp [rewardCost,FiniteLabels.expect] + | succ d ih => + change expect (μ k) (fun n => reward k n+expect (J k n).law (fun a => rewardCost J reward (k+1) d a)) = _ + rw [expect_add,← expect_move,← hμ k,ih] + rw [sum_Ico_eq_sum_range,sum_Ico_eq_sum_range] + simp only [Nat.add_sub_cancel_left,Nat.add_assoc,Nat.add_sub_cancel_left] + rw [sum_range_succ'] + simp only [Nat.add_zero,Nat.add_left_comm,add_comm,Nat.add_sub_cancel_right] + +/-- Signed finite-history flux with the actual run potential and the exact +forward stochastic marginal law. No old large-radius envelope is priced. -/ +theorem run_signed_flux_bound (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) + (hv : ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |DiskMoments.signedAverage g x t-DiskMoments.signedAverage g x t'| ≤ v k) + (m : ℕ) (old : Label) (μ : ℕ → Law Label) (hμ0 : μ 0 = delta old) + (hμ : ∀ k, μ (k+1) = move (μ k) (fun n => (J k n).law)) : + |pathFlux (jet g r x J v m [] old) 1 0| ≤ + ∑ k ∈ range m, expect (μ k) (fun n => ∑ a, ‖(J k n).grad a‖)* + (∑ l ∈ Ico k m, v l) := by + have hh := signed_flux_bound _ (jet_controlled g r x J v hg hr hstep hv m [] old) + rw [jet_cost g r x J v m [] old m (by simp)] at hh + have he := expect_rewardCost J + (fun k n => (∑ a, ‖(J k n).grad a‖)*(∑ l ∈ Ico k m, v l)) μ hμ m 0 + rw [hμ0,expect_delta] at he + simp only [Nat.zero_add,Nat.Ico_zero_eq_range] at he + simp only [List.length_nil] at hh + rw [he] at hh + simpa only [FiniteLabels.expect,← mul_assoc,← sum_mul] using hh +end SignedRuns + +namespace SignedRuns +open DiskMoments RadiusEnvelope ActualLabels ConeCoordinates + +structure Run where + dir : Label + first : ℕ + last : ℕ + +/-- Completed runs, in reverse chronological order. -/ +def closedRuns : List Label → List Run + | [] => [] + | [_] => [] + | n::old::p => if n = old then closedRuns (old::p) + else ⟨old,activeStart (old::p),p.length⟩::closedRuns (old::p) + +def runs : List Label → List Run + | [] => [] + | n::p => ⟨n,activeStart (n::p),p.length⟩::closedRuns (n::p) + +lemma closedRuns_bounds (n : Label) (p : List Label) : + ∀ a ∈ closedRuns (n::p), a.first ≤ a.last ∧ a.last < p.length := by + induction p generalizing n with + | nil => simp [closedRuns] + | cons old p ih => + simp only [closedRuns] + split_ifs with h + · intro a ha + exact ⟨(ih old a ha).1,(ih old a ha).2.trans (by simp)⟩ + · intro a ha + rcases List.mem_cons.mp ha with ha | ha + · subst a + exact ⟨activeStart_le old p,by simp⟩ + · exact ⟨(ih old a ha).1,(ih old a ha).2.trans (by simp)⟩ + +lemma runs_bounds (n : Label) (p : List Label) : + ∀ a ∈ runs (n::p), a.first ≤ a.last ∧ a.last ≤ p.length := by + intro a ha + rcases List.mem_cons.mp ha with ha | ha + · subst a + exact ⟨activeStart_le n p,le_rfl⟩ + · exact ⟨(closedRuns_bounds n p a ha).1,(closedRuns_bounds n p a ha).2.le⟩ + +lemma runs_cover (n : Label) (p : List Label) (k : ℕ) (hk : k ≤ p.length) : + ∃ a ∈ runs (n::p), a.first ≤ k ∧ k ≤ a.last := by + induction p generalizing n k with + | nil => + have hk0 : k = 0 := by simpa using hk + subst k + exact ⟨⟨n,0,0⟩,by simp [runs,activeStart],le_rfl,le_rfl⟩ + | cons old p ih => + by_cases h : n = old + · subst n + by_cases hs : activeStart (old::p) ≤ k + · refine ⟨⟨old,activeStart (old::p),p.length+1⟩,?_,hs,?_⟩ + · simp [runs,activeStart] + · simpa using hk + · have hk' : k ≤ p.length := (le_of_not_ge hs).trans (activeStart_le old p) + obtain ⟨a,ha,hak,hka⟩ := ih old k hk' + have hac : a ∈ closedRuns (old::p) := by + rcases List.mem_cons.mp ha with ha | ha + · subst a + exact False.elim (hs hak) + · exact ha + exact ⟨a,by simp [runs,closedRuns,hac],hak,hka⟩ + · by_cases hk' : k ≤ p.length + · obtain ⟨a,ha,hak,hka⟩ := ih old k hk' + exact ⟨a,by simpa only [runs,closedRuns,h,ite_false,List.mem_cons] using Or.inr ha,hak,hka⟩ + · have he : k = p.length+1 := by simp only [List.length_cons] at hk; omega + subst k + exact ⟨⟨n,p.length+1,p.length+1⟩,by simp [runs,activeStart,h],le_rfl,le_rfl⟩ + +lemma potential_eq_runs (g : ℂ → ℝ) (r : ℕ → ℝ) (x : ℂ) (n : Label) (p : List Label) : + potential g r x (n::p) = ((runs (n::p)).map fun a => + (runEnvelope g r a.first a.last x-signedAverage g x (r a.first)) • (a.dir:ℂ)).sum := by + induction p generalizing n with + | nil => simp [potential,runs,closedRuns,activeStart] + | cons old p ih => + rw [potential,ih] + by_cases h : n = old + · subst n + simp only [runs,closedRuns,activeStart,ite_true,List.length_cons,List.map_cons,List.sum_cons] + module + · simp only [runs,closedRuns,activeStart,h,ite_false,List.length_cons,List.map_cons,List.sum_cons] + abel + +lemma radius_in_bin (r : ℕ → ℝ) + (hstep : ∀ k, 2*r (k+1) = r k) (j : ℕ) {t : ℝ} (ht : t ∈ Icc (r j) (2*r 0)) : + ∃ k ≤ j, t ∈ Icc (r k) (2*r k) := by + induction j with + | zero => exact ⟨0,le_rfl,ht⟩ + | succ j ih => + by_cases h : r j ≤ t + · obtain ⟨k,hk,hkt⟩ := ih ⟨h,ht.2⟩ + exact ⟨k,hk.trans (Nat.le_succ j),hkt⟩ + · exact ⟨j+1,le_rfl,ht.1,by linarith [hstep j]⟩ + +lemma runs_cover_radius (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) + (hstep : ∀ k, 2*r (k+1) = r k) (n : Label) (p : List Label) {t : ℝ} + (ht : t ∈ Icc (r p.length) (2*r 0)) : + ∃ a ∈ runs (n::p), t ∈ Icc (r a.last) (2*r a.first) := by + obtain ⟨k,hk,hkt⟩ := radius_in_bin r hstep p.length ht + obtain ⟨a,ha,hi,hj⟩ := runs_cover n p k hk + refine ⟨a,ha,?_,?_⟩ + · exact (radius_antitone r hr hstep hj).trans hkt.1 + · have hh := radius_antitone r hr hstep hi + linarith [hkt.2] + +/-- Every history has an actually attaining winning run. No radius selection +is differentiated. -/ +lemma winning_run (g : ℂ → ℝ) (r : ℕ → ℝ) (hg : ContDiff ℝ 1 g) + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (n : Label) (p : List Label) (x : ℂ) : + ∃ a ∈ runs (n::p), ∃ t ∈ Icc (r a.last) (2*r a.first), + runEnvelope g r 0 p.length x = signedAverage g x t ∧ + runEnvelope g r a.first a.last x = signedAverage g x t := by + obtain ⟨t,ht,he,hmax⟩ := runEnvelope_attains g r hg hr hstep (Nat.zero_le _) x + obtain ⟨a,ha,hat⟩ := runs_cover_radius r hr hstep n p ht + refine ⟨a,ha,t,hat,he,le_antisymm ?_ ?_⟩ + · obtain ⟨s,hs,hsval,_⟩ := runEnvelope_attains g r hg hr hstep (runs_bounds n p a ha).1 x + rw [hsval] + apply hmax + constructor + · exact (radius_antitone r hr hstep (runs_bounds n p a ha).2).trans hs.1 + · have hh := radius_antitone r hr hstep (Nat.zero_le a.first) + linarith [hs.2] + · exact le_envelope (u := fun t y => signedAverage g y t) hat x (signedAverage_radius_continuousOn hg x (hr a.last)) + +end SignedRuns + +namespace FiniteLabels +lemma Law.ext_mass {ι : Type*} [Fintype ι] {μ ν : Law ι} (h : μ.mass = ν.mass) : μ = ν := by + cases μ + cases ν + cases h + rfl +end FiniteLabels + +namespace SignedAssembly +open Finset FiniteLabels +variable {ι : Type*} [Fintype ι] + +/-- The zero row-sum is obtained by differentiating the actual stochastic +partition of unity, not postulated for the row derivatives. -/ +def RowJet.ofLawAt (P : ℂ → Law ι) (x : ℂ) + (hd : ∀ i, DifferentiableAt ℝ (fun y => P y i) x) : RowJet ι ℂ where + law := P x + grad i := gradient (fun y => P y i) x + total_grad := by + have ht : (fun y => ∑ i, P y i) = fun _ => (1:ℝ) := funext fun y => (P y).total + have hs : (∑ i, fderiv ℝ (fun y => P y i) x) = 0 := by + rw [← fderiv_fun_sum (fun i _ => hd i),ht] + exact fderiv_const_apply (1:ℝ) + simp only [gradient,← _root_.map_sum,hs,map_zero] +end SignedAssembly + +namespace ActualLabels +open FiniteLabels SignedAssembly Finset ConeCoordinates + +/-- Observation time zero is the true initial spatial row. Subsequent times +are the true state-dependent spatial switch rows. -/ +def observation (h : ℂ → ℂ) (r : ℕ → ℝ) : ℕ → ℂ → Label → Law Label + | 0,x,_ => initial h (r 0) x + | k+1,x,n => row h (r (k+1)) x n + +def before (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) : ℕ → Law Label + | 0 => delta old + | k+1 => marginal h r k x + +lemma before_move (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) (k : ℕ) : + before h r old x (k+1) = move (before h r old x k) (observation h r k x) := by + cases k with + | zero => + apply Law.ext_mass + funext j + change initial h (r 0) x j = ∑ n, delta old n*initial h (r 0) x j + rw [← sum_mul,(delta old).total,one_mul] + | succ k => rfl + +lemma observation_lipschitz (h : ℂ → ℂ) (r : ℕ → ℝ) (k : ℕ) (hr : 0 < r k) + (n j : Label) : LipschitzWith (Real.toNNReal (16/r k)) (fun x => observation h r k x n j) := by + cases k with + | zero => + simpa only [mul_one,observation,initial,row] using spatialRow_component_lipschitz (quantize 1 (by norm_num)) + (target h (r 0)) (fun _ => 1) (fun _ => zero_le_one) (fun _ => le_rfl) hr + (by norm_num : (0:ℝ) ≤ 1) (fun _ => le_rfl) j + | succ k => + simpa only [mul_one,observation,initial,row] using spatialRow_component_lipschitz n (target h (r (k+1))) + (switchChance h (r (k+1)) n) (switchChance_nonneg h (r (k+1)) n) + (switchChance_le_one h (r (k+1)) n) hr (by norm_num : (0:ℝ) ≤ 1) + (switchChance_le_one h (r (k+1)) n) j + +lemma observation_ae_diff (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) : + ∀ᵐ x, ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x := by + simp only [ae_all_iff] + intro k n j + exact (observation_lipschitz h r k (hr k) n j).ae_differentiableAt + +def observationJet (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) + (hd : ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x) + (k : ℕ) (n : Label) : RowJet Label ℂ := + RowJet.ofLawAt (fun y => observation h r k y n) x (hd k n) + +/-- The jet's expected absolute row derivative is exactly T_k/r_k from the +physical spatial packing theorem. -/ +lemma observationJet_cost (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (hd : ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x) + (k : ℕ) (hr : 0 < r k) : + expect (before h r old x k) (fun n => ∑ j, ‖(observationJet h r x hd k n).grad j‖) = + derivativeCost h r x k/r k := by + cases k with + | zero => + change expect (delta old) (fun _ => ∑ j, ‖gradient (fun y => initial h (r 0) y j) x‖) = _ + rw [FiniteLabels.expect_const,derivativeCost,mul_div_cancel_left₀ _ hr.ne'] + | succ k => + simp only [observationJet,RowJet.ofLawAt,observation,before,derivativeCost,rowDerivative,FiniteLabels.expect] + rw [Finset.sum_div] + apply sum_congr rfl + intro n _ + field_simp +end ActualLabels + +namespace SignedRuns +open ActualLabels FiniteLabels SignedAssembly Finset + +def weight (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) : List Label → ℝ + | [] => 1 + | n::p => weight h r old x p*observation h r p.length x (p.headD old) n + +lemma weight_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) (p : List Label) : + 0 ≤ weight h r old x p := by + induction p with + | nil => exact zero_le_one + | cons n p ih => exact mul_nonneg ih ((observation h r p.length x (p.headD old)).nonneg n) + +lemma weight_le_one (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) (p : List Label) : + weight h r old x p ≤ 1 := by + induction p with + | nil => exact le_rfl + | cons n p ih => + apply (mul_le_mul ih (law_le_one (observation h r p.length x (p.headD old)) n) + ((observation h r p.length x (p.headD old)).nonneg n) zero_le_one).trans_eq + exact one_mul 1 + +lemma lipschitz_bounded_mul {f g : ℂ → ℝ} {K L : ℝ≥0} (hf : LipschitzWith K f) + (hg : LipschitzWith L g) (hfb : ∀ x, ‖f x‖ ≤ 1) (hgb : ∀ x, ‖g x‖ ≤ 1) : + LipschitzWith (K+L) (fun x => f x*g x) := by + rw [lipschitzWith_iff_norm_sub_le] at hf hg ⊢ + intro x y + calc + ‖f x*g x-f y*g y‖ = ‖f x*(g x-g y)+g y*(f x-f y)‖ := by congr 1; ring + _ ≤ ‖f x*(g x-g y)‖+‖g y*(f x-f y)‖ := norm_add_le _ _ + _ = ‖f x‖*‖g x-g y‖+‖g y‖*‖f x-f y‖ := by rw [norm_mul,norm_mul] + _ ≤ 1*((L:ℝ)*‖x-y‖)+1*((K:ℝ)*‖x-y‖) := by + gcongr + · exact hfb x + · exact hg x y + · exact hgb y + · exact hf x y + _ = ((K+L:ℝ≥0):ℝ)*‖x-y‖ := by push_cast; ring + +lemma weight_lipschitz (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ k, 0 < r k) + (old : Label) (p : List Label) : ∃ K, LipschitzWith K (fun x => weight h r old x p) := by + induction p with + | nil => exact ⟨0,LipschitzWith.const 1⟩ + | cons n p ih => + obtain ⟨K,hK⟩ := ih + refine ⟨_,lipschitz_bounded_mul hK (observation_lipschitz h r p.length (hr _) _ n) ?_ ?_⟩ + · intro x + rw [Real.norm_eq_abs,abs_of_nonneg (weight_nonneg h r old x p)] + exact weight_le_one h r old x p + · intro x + rw [Real.norm_eq_abs,abs_of_nonneg ((observation h r p.length x (p.headD old)).nonneg n)] + exact law_le_one (observation h r p.length x (p.headD old)) n + +lemma weight_diff (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (hd : ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x) + (p : List Label) : DifferentiableAt ℝ (fun y => weight h r old y p) x := by + induction p with + | nil => exact differentiableAt_const 1 + | cons n p ih => exact ih.mul (hd p.length (p.headD old) n) + +lemma gradient_weight_cons (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (hd : ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x) + (n : Label) (p : List Label) : + gradient (fun y => weight h r old y (n::p)) x = + weight h r old x p • (observationJet h r x hd p.length (p.headD old)).grad n+ + observation h r p.length x (p.headD old) n • gradient (fun y => weight h r old y p) x := by + simp only [weight,observationJet,RowJet.ofLawAt,gradient] + rw [fderiv_fun_mul (weight_diff h r old x hd p) (hd p.length (p.headD old) n)] + simp only [map_add,map_smul] + +/-- Unweighted finite sum over every possible terminal continuation. -/ +def leafSum {E : Type*} [AddCommMonoid E] (f : List Label → E) : ℕ → List Label → E + | 0,p => f p + | d+1,p => ∑ n, leafSum f d (n::p) + +lemma flux_eq_weightedLeaves (g : ℂ → ℝ) (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) + (x : ℂ) (hd : ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x) + (v : ℕ → ℝ) (d : ℕ) (p : List Label) : + pathFlux (jet g r x (observationJet h r x hd) v d p (p.headD old)) + (weight h r old x p) (gradient (fun y => weight h r old y p) x) = + leafSum (fun q => inner ℝ (gradient (fun y => weight h r old y q) x) (potential g r x q)) d p := by + induction d generalizing p with + | zero => rfl + | succ d ih => + simp only [jet,pathFlux,leafSum] + apply sum_congr rfl + intro n _ + change pathFlux _ (weight h r old x (n::p)) + (weight h r old x p • (observationJet h r x hd p.length (p.headD old)).grad n+ + observation h r p.length x (p.headD old) n • gradient (fun y => weight h r old y p) x) = _ + rw [← gradient_weight_cons h r old x hd n p] + exact ih (n::p) + +/-- The signed flux bound for derivatives of the actual spatial history +weights, with the true initial row and forward marginal derivatives. -/ +theorem actual_signed_flux_bound (g : ℂ → ℝ) (h : ℂ → ℂ) (r : ℕ → ℝ) + (hg : ContDiff ℝ 1 g) (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (old : Label) (x : ℂ) + (hd : ∀ k n j, DifferentiableAt ℝ (fun y => observation h r k y n j) x) + (v : ℕ → ℝ) + (hv : ∀ k t t', 0 < t → t ≤ 4*r k → 0 < t' → t' ≤ 4*r k → + |DiskMoments.signedAverage g x t-DiskMoments.signedAverage g x t'| ≤ v k) + (m : ℕ) : + |leafSum (fun q => inner ℝ (gradient (fun y => weight h r old y q) x) (potential g r x q)) m []| ≤ + ∑ k ∈ range m, (derivativeCost h r x k/r k)*(∑ l ∈ Ico k m, v l) := by + have hh := run_signed_flux_bound g r x (observationJet h r x hd) v hg hr hstep hv m old + (before h r old x) rfl (before_move h r old x) + have he := flux_eq_weightedLeaves g h r old x hd v m [] + simp only [List.headD_nil,weight] at he + rw [show gradient (fun _ : ℂ => (1:ℝ)) x = 0 from gradient_const x 1] at he + rw [he] at hh + simpa only [observationJet_cost h r old x hd _ (hr _)] using hh +end SignedRuns + +namespace SignedRuns +open DiskMoments RadiusEnvelope ActualLabels ConeCoordinates + +lemma run_gradient_touching {g : ℂ → ℝ} {r : ℕ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) (hr : ∀ k, 0 < r k) {i j : ℕ} {x : ℂ} + (hd : DifferentiableAt ℝ (runEnvelope g r i j) x) {t : ℝ} + (ht : t ∈ Icc (r j) (2*r i)) (he : runEnvelope g r i j x = signedAverage g x t) : + gradient (runEnvelope g r i j) x = gradient (fun y => signedAverage g y t) x := by + obtain ⟨K,hK⟩ := hg.lipschitzWith_of_hasCompactSupport hgc one_ne_zero + have hu := hasFDerivAt_signedAverage hg (fun y => norm_fderiv_le_of_lipschitz ℝ hK) x + ((hr j).trans_le ht.1) + unfold gradient runEnvelope + rw [RadiusEnvelope.fderiv_touching ht (fun y => signedAverage_radius_continuousOn hg y (hr j)) he hd hu.differentiableAt] + +lemma runs_ae_diff {g : ℂ → ℝ} {r : ℕ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) : + ∀ᵐ x, ∀ i j, i ≤ j → DifferentiableAt ℝ (runEnvelope g r i j) x := by + simp only [ae_all_iff] + intro i j hij + have hab : r j ≤ 2*r i := by + have := radius_antitone r hr hstep hij + linarith [hr i] + obtain ⟨L,hL⟩ := run_envelope_lipschitz hg hgc (hr j) hab + exact hL.ae_differentiableAt + +def coneContribution (n : Label) (z : ℂ) : ℝ := + inner ℝ (n:ℂ) z+max 0 (-inner ℝ (axis n 1) z)+max 0 (-inner ℝ (axis n (-1)) z) + +lemma coneContribution_nonneg (n : Label) (z : ℂ) : 0 ≤ coneContribution n z := by + have hc := cone_algebra (label_unit n) z + change ‖z‖ ≤ 12*coneContribution n z at hc + linarith [norm_nonneg z] + +theorem run_master {g : ℂ → ℝ} {r : ℕ → ℝ} (hg : ContDiff ℝ 1 g) + (hgc : HasCompactSupport g) (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (n : Label) (p : List Label) (x : ℂ) + (hd : ∀ i j, i ≤ j → DifferentiableAt ℝ (runEnvelope g r i j) x) : + ‖gradient (runEnvelope g r 0 p.length) x‖ ≤ + 12*((runs (n::p)).map fun a => coneContribution a.dir + (gradient (runEnvelope g r a.first a.last) x)).sum := by + obtain ⟨a,ha,t,ht,hgval,haval⟩ := winning_run g r hg hr hstep n p x + have hab := runs_bounds n p a ha + have htg : t ∈ Icc (r p.length) (2*r 0) := by + constructor + · exact (radius_antitone r hr hstep hab.2).trans ht.1 + · have hh := radius_antitone r hr hstep (Nat.zero_le a.first) + linarith [ht.2] + have he : gradient (runEnvelope g r 0 p.length) x = gradient (runEnvelope g r a.first a.last) x := + (run_gradient_touching hg hgc hr (hd 0 p.length (Nat.zero_le _)) htg hgval).trans + (run_gradient_touching hg hgc hr (hd a.first a.last hab.1) ht haval).symm + rw [he] + apply (cone_algebra (label_unit a.dir) _).trans + apply mul_le_mul_of_nonneg_left _ (by norm_num : (0:ℝ) ≤ 12) + apply List.single_le_sum + · intro z hz + obtain ⟨b,_,rfl⟩ := List.mem_map.mp hz + exact coneContribution_nonneg b.dir _ + · exact List.mem_map.mpr ⟨a,ha,rfl⟩ +end SignedRuns + +namespace DiskMoments +lemma signedAverage_hasCompactSupport {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) + (hc : HasCompactSupport g) {t : ℝ} (ht : 0 < t) : + HasCompactSupport (fun x => signedAverage g x t) := by + have he : RadiusEnvelope.envelope (fun s x => signedAverage g x s) t t = + fun x => signedAverage g x t := by + funext x + obtain ⟨s,hs,he,_⟩ := RadiusEnvelope.attains (u := fun s x => signedAverage g x s) (a := t) (b := t) le_rfl x (signedAverage_radius_continuousOn hg x ht) + have hst : s = t := le_antisymm hs.2 hs.1 + simpa only [hst] using he + rw [← he] + exact run_envelope_hasCompactSupport hg hc ht le_rfl +end DiskMoments + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/ScalarTrees.lean b/lean/OAI/Analysis/DiskMaximal/ScalarTrees.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee8971abbb3de80d6f281def591ef5058998c253 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/ScalarTrees.lean @@ -0,0 +1,423 @@ +import OAI.Analysis.DiskMaximal.MaximalEstimates + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal + +noncomputable section + +namespace ScalarCancellation + +/-- A nonnegative scalar residual retaining exactly the net mass. Its removal +has the exact cancellation defect as L1 cost. -/ +theorem positive_residual {α : Type*} [MeasurableSpace α] {μ : Measure α} + {h : α → ℝ} (hh : Integrable h μ) (hc : 0 ≤ ∫ x, h x ∂μ) : + ∃ ρ : α → ℝ, Integrable ρ μ ∧ (∀ x, 0 ≤ ρ x) ∧ + (∀ x, ρ x ≤ max (h x) 0) ∧ (∫ x, ρ x ∂μ) = ∫ x, h x ∂μ ∧ + (∫ x, |h x-ρ x| ∂μ) = (∫ x, |h x| ∂μ) - ∫ x, h x ∂μ ∧ + (∀ x, h x = 0 → ρ x = 0) := by + let p : α → ℝ := fun x => max (h x) 0 + have hp : Integrable p μ := by + convert (hh.add hh.abs).div_const 2 using 1 + funext x + by_cases hx : 0 ≤ h x + · simp only [p,max_eq_left hx,abs_of_nonneg hx,Pi.add_apply] + ring + · simp only [p,max_eq_right (le_of_not_ge hx),abs_of_nonpos (le_of_not_ge hx),Pi.add_apply] + ring + have hp0 : 0 ≤ ∫ x, p x ∂μ := integral_nonneg (fun x => le_max_right _ _) + have hcp : (∫ x, h x ∂μ) ≤ ∫ x, p x ∂μ := integral_mono hh hp (fun x => le_max_left _ _) + by_cases hP : (∫ x, p x ∂μ) = 0 + · have hc0 : (∫ x, h x ∂μ) = 0 := le_antisymm (hP ▸ hcp) hc + refine ⟨0,integrable_zero _ _ _,fun _ => le_rfl,fun x => le_max_right _ _,?_,?_,fun _ _ => rfl⟩ + · simp [hc0] + · simp [hc0] + · have hPpos : 0 < ∫ x, p x ∂μ := lt_of_le_of_ne hp0 (Ne.symm hP) + let q := (∫ x, h x ∂μ)/(∫ x, p x ∂μ) + have hq0 : 0 ≤ q := div_nonneg hc hp0 + have hq1 : q ≤ 1 := (div_le_one hPpos).mpr hcp + let ρ : α → ℝ := fun x => q*p x + have hρ : Integrable ρ μ := hp.const_mul q + have hρ0 : ∀ x, 0 ≤ ρ x := fun x => mul_nonneg hq0 (le_max_right _ _) + have hρp : ∀ x, ρ x ≤ p x := fun x => mul_le_of_le_one_left (le_max_right _ _) hq1 + have hi : (∫ x, ρ x ∂μ) = ∫ x, h x ∂μ := by + rw [show ρ = fun x => q*p x from rfl,integral_const_mul] + exact div_mul_cancel₀ _ hP + have habs : ∀ x, |h x-ρ x| = |h x|-ρ x := by + intro x + by_cases hhx : 0 ≤ h x + · rw [abs_of_nonneg hhx,abs_of_nonneg] + simpa only [p,max_eq_left hhx] using sub_nonneg.mpr (hρp x) + · have hx0 : h x ≤ 0 := (lt_of_not_ge hhx).le + have : ρ x = 0 := by simp [ρ,p,max_eq_right hx0] + simp [this] + refine ⟨ρ,hρ,hρ0,hρp,hi,?_,?_⟩ + · simp_rw [habs] + rw [integral_sub hh.abs hρ,hi] + · intro x hx + simp [ρ,p,hx] + +/-- Every integrable scalar density splits into a constant-sign root and a +zero-mass error, without replacing the actual terminal density by its mass. -/ +theorem residual_split {α : Type*} [MeasurableSpace α] {μ : Measure α} + {h : α → ℝ} (hh : Integrable h μ) : + ∃ ρ β : α → ℝ, Integrable ρ μ ∧ Integrable β μ ∧ + (∀ x, h x = ρ x+β x) ∧ (∫ x, ρ x ∂μ) = ∫ x, h x ∂μ ∧ + (∫ x, β x ∂μ) = 0 ∧ (∫ x, |ρ x| ∂μ) = |∫ x, h x ∂μ| ∧ + (∫ x, |β x| ∂μ) = (∫ x, |h x| ∂μ)-|∫ x, h x ∂μ| ∧ + ((0 ≤ ∫ x, h x ∂μ) → ∀ x, 0 ≤ ρ x) ∧ + ((∫ x, h x ∂μ) < 0 → ∀ x, ρ x ≤ 0) ∧ + (∀ x, h x = 0 → ρ x = 0 ∧ β x = 0) := by + by_cases hc : 0 ≤ ∫ x, h x ∂μ + · obtain ⟨ρ,hρ,hρ0,_,hi,hcost,hzero⟩ := positive_residual hh hc + refine ⟨ρ,fun x => h x-ρ x,hρ,hh.sub hρ,fun x => by ring,hi,?_,?_,?_, + fun _ => hρ0,fun hn => (not_lt_of_ge hc hn).elim,?_⟩ + · rw [integral_sub hh hρ,hi,sub_self] + · simp_rw [abs_of_nonneg (hρ0 _)] + rw [hi,abs_of_nonneg hc] + · rwa [abs_of_nonneg hc] + · intro x hx + simp [hx,hzero x hx] + · have hc' : (∫ x, h x ∂μ) < 0 := lt_of_not_ge hc + have hn : 0 ≤ ∫ x, -h x ∂μ := by rw [integral_neg]; linarith + obtain ⟨ρ,hρ,hρ0,_,hi,hcost,hzero⟩ := positive_residual hh.neg hn + have hi' : (∫ x, ρ x ∂μ) = -(∫ x, h x ∂μ) := by simpa only [Pi.neg_apply,integral_neg] using hi + refine ⟨fun x => -ρ x,fun x => h x+ρ x,hρ.neg,hh.add hρ,fun x => by ring,?_,?_,?_,?_, + fun hn => (not_le_of_gt hc' hn).elim,fun _ x => neg_nonpos.mpr (hρ0 x),?_⟩ + · rw [integral_neg,hi',neg_neg] + · rw [integral_add hh hρ,hi',add_neg_cancel] + · simp_rw [abs_neg,abs_of_nonneg (hρ0 _)] + rw [hi',abs_of_neg hc'] + · have heq : (fun x => |-h x-ρ x|) = fun x => |h x+ρ x| := by + funext x + rw [show -h x-ρ x = -(h x+ρ x) by ring,abs_neg] + simp only [Pi.neg_apply] at hcost + rw [heq] at hcost + simpa only [abs_neg,integral_neg,abs_of_neg hc',sub_neg_eq_add] using hcost + · intro x hx + have hz := hzero x (by simp [hx]) + simp [hx,hz] + +/-- One backward refinement step. The new cancelling piece has cost no larger +than the scalar norm defect of the children; overlap can only lower this cost. -/ +theorem refinement_residual {α ι : Type*} [MeasurableSpace α] {μ : Measure α} + [Fintype ι] (w : ι → ℝ) (hw : ∀ i, 0 ≤ w i) (ρ : ι → α → ℝ) + (hρ : ∀ i, Integrable (ρ i) μ) : + ∃ R β : α → ℝ, Integrable R μ ∧ Integrable β μ ∧ + (∀ x, (∑ i, w i*ρ i x) = R x+β x) ∧ + (∫ x, R x ∂μ) = ∑ i, w i*(∫ x, ρ i x ∂μ) ∧ + (∫ x, β x ∂μ) = 0 ∧ + (∫ x, |R x| ∂μ) = |∑ i, w i*(∫ x, ρ i x ∂μ)| ∧ + (∫ x, |β x| ∂μ) ≤ + (∑ i, w i*(∫ x, |ρ i x| ∂μ))-|∑ i, w i*(∫ x, ρ i x ∂μ)| ∧ + ((0 ≤ ∑ i, w i*(∫ x, ρ i x ∂μ)) → ∀ x, 0 ≤ R x) ∧ + (∀ x, (∀ i, w i*ρ i x = 0) → R x = 0 ∧ β x = 0) := by + classical + let f : α → ℝ := fun x => ∑ i, w i*ρ i x + have hf : Integrable f μ := integrable_finsetSum _ (fun i _ => (hρ i).const_mul _) + have hfi : (∫ x, f x ∂μ) = ∑ i, w i*(∫ x, ρ i x ∂μ) := by + rw [show f = fun x => ∑ i, w i*ρ i x from rfl,integral_finsetSum] + · simp only [integral_const_mul] + · exact fun i _ => (hρ i).const_mul _ + have hcost : (∫ x, |f x| ∂μ) ≤ ∑ i, w i*(∫ x, |ρ i x| ∂μ) := by + calc + _ ≤ ∫ x, ∑ i, w i*|ρ i x| ∂μ := by + apply integral_mono hf.abs (integrable_finsetSum _ (fun i _ => (hρ i).abs.const_mul _)) + intro x + calc + _ ≤ ∑ i, |w i*ρ i x| := Finset.abs_sum_le_sum_abs _ _ + _ = _ := by simp_rw [abs_mul,abs_of_nonneg (hw _)] + _ = _ := by + rw [integral_finsetSum _ (fun i _ => (hρ i).abs.const_mul _)] + simp only [integral_const_mul] + obtain ⟨R,β,hR,hβ,hdec,hi,hzero,habs,hβcost,hpos,_,hsupp⟩ := residual_split hf + refine ⟨R,β,hR,hβ,hdec,hi.trans hfi,hzero,?_,?_,?_,?_⟩ + · rwa [hfi] at habs + · rw [hβcost,hfi] + exact sub_le_sub_right hcost _ + · intro hp + apply hpos + rwa [hfi] + · intro x hx + apply hsupp + exact Finset.sum_eq_zero (fun i _ => hx i) + +end ScalarCancellation + +namespace ScalarCancellation +variable {α : Type*} [MeasurableSpace α] {μ : Measure α} + +/-- Canonical positive/negative root selected from the proved scalar splitting, +not an assumed decomposition. -/ +def root (μ : Measure α) (f : α → ℝ) : α → ℝ := by + classical + exact if h : Integrable f μ then (residual_split h).choose else 0 + +lemma root_spec {f : α → ℝ} (hf : Integrable f μ) : + Integrable (root μ f) μ ∧ + (∫ x, root μ f x ∂μ) = ∫ x, f x ∂μ ∧ + (∫ x, |root μ f x| ∂μ) = |∫ x, f x ∂μ| ∧ + (∫ x, |f x-root μ f x| ∂μ) = (∫ x, |f x| ∂μ)-|∫ x, f x ∂μ| ∧ + ((0 ≤ ∫ x, f x ∂μ) → ∀ x, 0 ≤ root μ f x) ∧ + ((∫ x, f x ∂μ) < 0 → ∀ x, root μ f x ≤ 0) ∧ + (∀ x, f x = 0 → root μ f x = 0) := by + rw [root,dite_eq_left hf] + obtain ⟨β,hR,_,hdec,hi,_,habs,hcost,hpos,hneg,hsupp⟩ := (residual_split hf).choose_spec + refine ⟨hR,hi,habs,?_,hpos,hneg,fun x hx => (hsupp x hx).1⟩ + convert hcost using 1 + apply integral_congr_ae + exact ae_of_all _ (fun x => by dsimp only; rw [hdec x]; congr 1; ring) + +variable {ι : Type*} [Fintype ι] + +def refined (w : ℕ → ι → ι → ℝ) (f : ι → α → ℝ) : ℕ → ι → α → ℝ + | 0,q => f q + | k+1,q => fun x => ∑ s, w k q s*refined w f k s x + +def roots (μ : Measure α) (w : ℕ → ι → ι → ℝ) (f : ι → α → ℝ) : ℕ → ι → α → ℝ + | 0,q => root μ (f q) + | k+1,q => root μ (fun x => ∑ s, w k q s*roots μ w f k s x) + +def errors (μ : Measure α) (w : ℕ → ι → ι → ℝ) (f : ι → α → ℝ) : ℕ → ι → α → ℝ + | 0,q => fun x => f q x-roots μ w f 0 q x + | k+1,q => fun x => (∑ s, w k q s*roots μ w f k s x)-roots μ w f (k+1) q x + +lemma refined_integrable (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + Integrable (refined w f k q) μ := by + induction k generalizing q with + | zero => exact hf q + | succ k ih => exact integrable_finsetSum _ (fun s _ => (ih s).const_mul _) + +lemma roots_integrable (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + Integrable (roots μ w f k q) μ := by + induction k generalizing q with + | zero => exact (root_spec (hf q)).1 + | succ k ih => exact (root_spec (integrable_finsetSum _ (fun s _ => (ih s).const_mul _))).1 + +lemma roots_mass (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + (∫ x, roots μ w f k q x ∂μ) = ∫ x, refined w f k q x ∂μ := by + induction k generalizing q with + | zero => exact (root_spec (hf q)).2.1 + | succ k ih => + rw [roots,(root_spec (integrable_finsetSum _ (fun s _ => (roots_integrable w hf k s).const_mul _))).2.1, + refined,integral_finsetSum _ (fun s _ => (roots_integrable w hf k s).const_mul _), + integral_finsetSum _ (fun s _ => (refined_integrable w hf k s).const_mul _)] + simp_rw [integral_const_mul,ih] + +lemma roots_abs_mass (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + (∫ x, |roots μ w f k q x| ∂μ) = |∫ x, refined w f k q x ∂μ| := by + cases k with + | zero => exact (root_spec (hf q)).2.2.1 + | succ k => + have hs := root_spec (integrable_finsetSum Finset.univ + (fun s _ => (roots_integrable w hf k s).const_mul (w k q s))) + change (∫ x, |root μ _ x| ∂μ) = _ + rw [hs.2.2.1,← hs.2.1] + exact congrArg abs (roots_mass w hf (k+1) q) + +lemma errors_integrable (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + Integrable (errors μ w f k q) μ := by + cases k with + | zero => exact (hf q).sub (roots_integrable w hf 0 q) + | succ k => + exact (integrable_finsetSum _ (fun s _ => (roots_integrable w hf k s).const_mul _)).sub + (roots_integrable w hf (k+1) q) + +lemma errors_zero_mass (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + (∫ x, errors μ w f k q x ∂μ) = 0 := by + cases k with + | zero => + rw [errors,integral_sub (hf q) (roots_integrable w hf 0 q),roots_mass] + exact sub_self _ + exact hf + | succ k => + rw [errors,integral_sub + (integrable_finsetSum _ (fun s _ => (roots_integrable w hf k s).const_mul _)) + (roots_integrable w hf (k+1) q),roots, + (root_spec (integrable_finsetSum _ (fun s _ => (roots_integrable w hf k s).const_mul _))).2.1, + sub_self] + +/-- The whole scalar cancellation tree is built by backward splitting. Each +nonterminal zero-mass piece costs at most its positive refinement norm defect. -/ +theorem errors_cost (w : ℕ → ι → ι → ℝ) (hw : ∀ k q s, 0 ≤ w k q s) + {f : ι → α → ℝ} (hf : ∀ q, Integrable (f q) μ) (k : ℕ) (q : ι) : + (∫ x, |errors μ w f (k+1) q x| ∂μ) ≤ + (∑ s, w k q s*|∫ x, refined w f k s x ∂μ|)-|∫ x, refined w f (k+1) q x ∂μ| := by + have hi : Integrable (fun x => ∑ s, w k q s*roots μ w f k s x) μ := + integrable_finsetSum _ (fun s _ => (roots_integrable w hf k s).const_mul _) + have hs := root_spec hi + change (∫ x, |(∑ s, w k q s*roots μ w f k s x)-root μ _ x| ∂μ) ≤ _ + rw [hs.2.2.2.1] + have hm : (∫ x, ∑ s, w k q s*roots μ w f k s x ∂μ) = ∫ x, refined w f (k+1) q x ∂μ := by + rw [← hs.2.1] + exact roots_mass w hf (k+1) q + rw [hm] + apply sub_le_sub_right + calc + _ ≤ ∫ x, ∑ s, w k q s*|roots μ w f k s x| ∂μ := by + apply integral_mono hi.abs (integrable_finsetSum _ (fun s _ => (roots_integrable w hf k s).abs.const_mul _)) + intro x + calc + _ ≤ ∑ s, |w k q s*roots μ w f k s x| := Finset.abs_sum_le_sum_abs _ _ + _ = _ := by simp_rw [abs_mul,abs_of_nonneg (hw k q _)] + _ = _ := by + rw [integral_finsetSum _ (fun s _ => (roots_integrable w hf k s).abs.const_mul _)] + simp_rw [integral_const_mul,roots_abs_mass w hf] + +lemma errors_terminal_cost (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (q : ι) : + (∫ x, |errors μ w f 0 q x| ∂μ) = (∫ x, |f q x| ∂μ)-|∫ x, f q x ∂μ| := + (root_spec (hf q)).2.2.2.1 + +lemma error_recurrence (w : ℕ → ι → ι → ℝ) (f : ι → α → ℝ) (k : ℕ) (q : ι) (x : α) : + refined w f (k+1) q x-roots μ w f (k+1) q x = errors μ w f (k+1) q x+ + ∑ s, w k q s*(refined w f k s x-roots μ w f k s x) := by + simp only [refined,errors,mul_sub,Finset.sum_sub_distrib] + ring + +/-- Support nesting is preserved by the new construction, even when child +scalar masses vanish or overlapping densities cancel each other. -/ +theorem roots_errors_support (w : ℕ → ι → ι → ℝ) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (S : ℕ → ι → Set α) + (hfS : ∀ q x, x ∉ S 0 q → f q x = 0) + (hS : ∀ k q s, w k q s ≠ 0 → S k s ⊆ S (k+1) q) : + ∀ k q x, x ∉ S k q → roots μ w f k q x = 0 ∧ errors μ w f k q x = 0 := by + intro k + induction k with + | zero => + intro q x hx + have hf0 := hfS q x hx + have hR0 := (root_spec (hf q)).2.2.2.2.2.2 x hf0 + exact ⟨hR0,by simp only [errors,roots,hf0,hR0,sub_self]⟩ + | succ k ih => + intro q x hx + have hz : (∑ s, w k q s*roots μ w f k s x) = 0 := by + apply Finset.sum_eq_zero + intro s _ + by_cases hw : w k q s = 0 + · simp [hw] + · have hs : x ∉ S k s := fun h => hx (hS k q s hw h) + rw [(ih s x hs).1,mul_zero] + have hR0 := (root_spec (integrable_finsetSum Finset.univ + (fun s _ => (roots_integrable w hf k s).const_mul (w k q s)))).2.2.2.2.2.2 x hz + exact ⟨hR0,by simp only [errors,roots,hz,hR0,sub_self]⟩ + +end ScalarCancellation + +namespace ScalarCancellation +open Finset +variable {α ι : Type*} [MeasurableSpace α] {μ : Measure α} [Fintype ι] + +lemma scalar_defect_sum (w : ℕ → ι → ι → ℝ) (hw : ∀ k q s, 0 ≤ w k q s) + (hcol : ∀ k s, ∑ q, w k q s = 1) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (k : ℕ) : + (∑ q, ∫ x, |errors μ w f (k+1) q x| ∂μ) ≤ + (∑ q, |∫ x, refined w f k q x ∂μ|)-(∑ q, |∫ x, refined w f (k+1) q x ∂μ|) := by + calc + _ ≤ ∑ q, ((∑ s, w k q s*|∫ x, refined w f k s x ∂μ|)-|∫ x, refined w f (k+1) q x ∂μ|) := + sum_le_sum (fun q _ => errors_cost w hw hf k q) + _ = _ := by + rw [sum_sub_distrib,sum_comm] + congr 1 + apply sum_congr rfl + intro s _ + rw [← sum_mul,hcol,one_mul] + +/-- The total cancellation cost of all levels is bounded by the actual scalar +input mass, independently of the number of refinement levels. -/ +theorem errors_total_cost (w : ℕ → ι → ι → ℝ) (hw : ∀ k q s, 0 ≤ w k q s) + (hcol : ∀ k s, ∑ q, w k q s = 1) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (n : ℕ) : + (∑ k ∈ range (n+1), ∑ q, ∫ x, |errors μ w f k q x| ∂μ) + + (∑ q, |∫ x, refined w f n q x ∂μ|) ≤ ∑ q, ∫ x, |f q x| ∂μ := by + induction n with + | zero => + simp only [Nat.zero_add,range_one,sum_singleton,errors_terminal_cost w hf,refined,sum_sub_distrib] + exact (sub_add_cancel _ _).le + | succ n ih => + rw [sum_range_succ] + have hstep := scalar_defect_sum w hw hcol hf n + linarith + +lemma errors_total_cost_le (w : ℕ → ι → ι → ℝ) (hw : ∀ k q s, 0 ≤ w k q s) + (hcol : ∀ k s, ∑ q, w k q s = 1) {f : ι → α → ℝ} + (hf : ∀ q, Integrable (f q) μ) (n : ℕ) : + (∑ k ∈ range (n+1), ∑ q, ∫ x, |errors μ w f k q x| ∂μ) ≤ ∑ q, ∫ x, |f q x| ∂μ := by + have h := errors_total_cost w hw hcol hf n + have hx : 0 ≤ ∑ q, |∫ x, refined w f n q x ∂μ| := sum_nonneg (fun _ _ => abs_nonneg _) + linarith + +/-- Exact expansion in a coherent family of refinement coefficients. The +finite zero-mass pieces are the explicitly constructed `errors`, not merely +scalar mass certificates. -/ +theorem telescoped_decomposition [DecidableEq ι] (w : ℕ → ι → ι → ℝ) (f : ι → α → ℝ) + (Λ : ℕ → ℕ → ι → ι → ℝ) + (hdiag : ∀ k q s, Λ k k q s = if q = s then 1 else 0) + (hstep : ∀ k j q s, j ≤ k → Λ (k+1) j q s = ∑ a, w k q a*Λ k j a s) + (k : ℕ) (q : ι) (x : α) : + refined w f k q x = roots μ w f k q x + + ∑ j ∈ range (k+1), ∑ s, Λ k j q s*errors μ w f j s x := by + classical + induction k generalizing q with + | zero => + simp only [Nat.zero_add,Finset.range_one,sum_singleton,hdiag,ite_mul,one_mul,zero_mul] + rw [sum_ite_eq univ q] + simp only [Finset.mem_univ,ite_true,errors,refined] + ring + | succ k ih => + rw [sum_range_succ] + have hlast : (∑ s, Λ (k+1) (k+1) q s*errors μ w f (k+1) s x) = errors μ w f (k+1) q x := by + simp only [hdiag,ite_mul,one_mul,zero_mul] + simp + rw [hlast,errors,refined] + simp_rw [ih] + simp only [mul_add,sum_add_distrib] + have hsum : (∑ a, w k q a*(∑ j ∈ range (k+1), ∑ s, Λ k j a s*errors μ w f j s x)) = + ∑ j ∈ range (k+1), ∑ s, Λ (k+1) j q s*errors μ w f j s x := by + simp_rw [mul_sum] + rw [sum_comm] + apply sum_congr rfl + intro j hj + rw [sum_comm] + apply sum_congr rfl + intro s _ + rw [hstep k j q s (Nat.le_of_lt_succ (mem_range.mp hj)),sum_mul] + apply sum_congr rfl + intro a _ + ring + rw [hsum] + ring + +end ScalarCancellation + +open MeasureTheory Set +open scoped ENNReal NNReal Topology +noncomputable section + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Scales.lean b/lean/OAI/Analysis/DiskMaximal/Scales.lean new file mode 100644 index 0000000000000000000000000000000000000000..87fa033bd01fde17a01b41442442253a0908dae4 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Scales.lean @@ -0,0 +1,712 @@ +import OAI.Analysis.DiskMaximal.Cancellation + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real + +noncomputable section + +namespace DiskScales + +def width (δ : ℝ) (n : ℕ) : ℝ := δ*(1/2 : ℝ)^n + +lemma width_pos {δ : ℝ} (hδ : 0 < δ) (n : ℕ) : 0 < width δ n := by + unfold width + positivity + +lemma width_le {δ : ℝ} (hδ : 0 ≤ δ) (n : ℕ) : width δ n ≤ δ := by + unfold width + exact mul_le_of_le_one_right hδ (pow_le_one₀ (by norm_num) (by norm_num)) + +lemma width_succ (δ : ℝ) (n : ℕ) : width δ (n+1) = width δ n / 2 := by + simp only [width, pow_succ] + ring + +lemma width_antitone {δ : ℝ} (hδ : 0 ≤ δ) : Antitone (width δ) := by + apply antitone_nat_of_succ_le + intro n + rw [width_succ] + have : 0 ≤ width δ n := mul_nonneg hδ (pow_nonneg (by norm_num) _) + linarith + +lemma tendsto_width (δ : ℝ) : Tendsto (width δ) atTop (𝓝 0) := by + change Tendsto (fun n => δ*(1/2 : ℝ)^n) atTop (𝓝 0) + simpa only [mul_zero] using + (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) + (by norm_num : (1/2 : ℝ) < 1)).const_mul δ + +lemma width_rpow {δ : ℝ} (hδ : 0 ≤ δ) (p : ℝ) (n : ℕ) : + (width δ n)^p = δ^p*((1/2 : ℝ)^p)^n := by + rw [width, Real.mul_rpow hδ (pow_nonneg (by norm_num) n)] + congr 1 + rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num), + mul_comm (n : ℝ) p, Real.rpow_mul (by norm_num), Real.rpow_natCast] + +lemma ratio_norm_lt {p : ℝ} (hp : 0 < p) : ‖(1/2 : ℝ)^p‖ < 1 := by + rw [Real.norm_eq_abs, abs_of_nonneg (Real.rpow_nonneg (by norm_num) _)] + exact Real.rpow_lt_one (by norm_num) (by norm_num) hp + +lemma summable_width_rpow {δ p : ℝ} (hδ : 0 ≤ δ) (hp : 0 < p) : + Summable (fun n => (width δ n)^p) := by + simp_rw [width_rpow hδ] + exact (summable_geometric_of_norm_lt_one (ratio_norm_lt hp)).mul_left _ + +lemma tsum_width_rpow {δ p : ℝ} (hδ : 0 ≤ δ) (hp : 0 < p) : + (∑' n, (width δ n)^p) = δ^p / (1-(1/2 : ℝ)^p) := by + simp_rw [width_rpow hδ] + rw [tsum_mul_left, tsum_geometric_of_norm_lt_one (ratio_norm_lt hp)] + rfl + +lemma scaled_increment {Cs A t δ M L : ℝ} (hCs : 0 ≤ Cs) (hA : 0 ≤ A) + (hAt : A ≤ t) (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hM : M ≤ A*δ^(-(1/50 : ℝ))) (hL : L ≤ 648/δ) : + 2*δ^(1/5 : ℝ)*M+14*(t*δ^(1/10 : ℝ))+ + (L+2*(3*L+1))*Cs*δ^(2*(1-(1/100 : ℝ)))*A ≤ + (16+4538*Cs)*t*δ^(1/10 : ℝ) := by + have ht : 0 ≤ t := hA.trans hAt + have hc : L+2*(3*L+1) ≤ 4538/δ := by + have hh : L*δ ≤ 648 := (le_div_iff₀ hδ).mp hL + apply (le_div_iff₀ hδ).mpr + nlinarith + have he1 : δ^(1/5 : ℝ)*δ^(-(1/50 : ℝ)) = δ^(9/50 : ℝ) := by + rw [← Real.rpow_add hδ] + norm_num + have he2 : δ⁻¹*δ^(2*(1-(1/100 : ℝ))) = δ^(49/50 : ℝ) := by + rw [← Real.rpow_neg_one, ← Real.rpow_add hδ] + norm_num + have hb1 : δ^(9/50 : ℝ) ≤ δ^(1/10 : ℝ) := + Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num) + have hb2 : δ^(49/50 : ℝ) ≤ δ^(1/10 : ℝ) := + Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num) + have hm : 2*δ^(1/5 : ℝ)*M ≤ 2*t*δ^(1/10 : ℝ) := by + calc + _ ≤ 2*δ^(1/5 : ℝ)*(A*δ^(-(1/50 : ℝ))) := + mul_le_mul_of_nonneg_left hM (by positivity) + _ = 2*A*δ^(9/50 : ℝ) := by rw [← he1]; ring + _ ≤ 2*t*δ^(1/10 : ℝ) := mul_le_mul (by linarith) hb1 + (Real.rpow_nonneg hδ.le _) (by positivity) + have hf : (L+2*(3*L+1))*Cs*δ^(2*(1-(1/100 : ℝ)))*A ≤ + 4538*Cs*t*δ^(1/10 : ℝ) := by + calc + _ ≤ (4538/δ)*Cs*δ^(2*(1-(1/100 : ℝ)))*A := by gcongr + _ = 4538*Cs*A*δ^(49/50 : ℝ) := by rw [← he2]; ring + _ ≤ 4538*Cs*t*δ^(1/10 : ℝ) := mul_le_mul (by gcongr) hb2 + (Real.rpow_nonneg hδ.le _) (by positivity) + nlinarith + +/-- A single small width works for both shell geometry and every smaller width. -/ +lemma exists_admissible_width : ∃ δ₀ : ℝ, 0 < δ₀ ∧ δ₀ ≤ 1/4 ∧ + ∀ δ : ℝ, 0 < δ → δ ≤ δ₀ → δ ≤ (δ^(1/5 : ℝ))^2/1600 := by + have ht : Tendsto (fun δ : ℝ => δ^(3/5 : ℝ)) (𝓝 0) (𝓝 0) := by + simpa using (Real.continuous_rpow_const (by norm_num : (0 : ℝ) ≤ 3/5)).tendsto 0 + have hev := ht.eventually_lt_const (by norm_num : (0 : ℝ) < 1/1600) + obtain ⟨l,u,hu,hs⟩ := mem_nhds_iff_exists_Ioo_subset.mp hev + let d := min (u/2) (1/4) + have hd : 0 < d := lt_min (by linarith [hu.2]) (by norm_num) + refine ⟨d, hd, min_le_right _ _, fun δ hδ hδd => ?_⟩ + have hdltu : d < u := lt_of_le_of_lt (min_le_left _ _) (by linarith [hu.2]) + have hp : δ^(3/5 : ℝ) < 1/1600 := hs ⟨lt_trans hu.1 hδ, lt_of_le_of_lt hδd hdltu⟩ + have he : δ = δ^(3/5 : ℝ)*(δ^(1/5 : ℝ))^2 := by + rw [← Real.rpow_natCast, ← Real.rpow_mul hδ.le, ← Real.rpow_add hδ] + norm_num + calc + δ = δ^(3/5 : ℝ)*(δ^(1/5 : ℝ))^2 := he + _ ≤ (δ^(1/5 : ℝ))^2/1600 := + (mul_le_mul_of_nonneg_right hp.le (sq_nonneg _)).trans_eq (by ring) + +end DiskScales + +namespace LocalCancellation +open DiskGeometry DiskKernels DiskScales +variable {ι : Type*} [Fintype ι] + +/-- Uniform exceptional sets controlling a whole decreasing sequence of disk +mixtures. Only active increments require the exact balanced moment. -/ +theorem size_sequence {Cs d t : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hdq : d ≤ 1/4) + (hgeom : ∀ δ : ℝ, 0 < δ → δ ≤ d → δ ≤ (δ^(1/5 : ℝ))^2/1600) + (ht : 0 < t) (hAt : errorPrice b (1/100) ≤ t) : + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ ∑' n : ℕ, ( + (ENNReal.ofReal (t*(width d n)^(1/10 : ℝ)))⁻¹ ^ 2 * + (ENNReal.ofReal (156*width d n/(width d n)^(1/5 : ℝ))* + ENNReal.ofReal (coarseMass b (width d n) univ)*ENNReal.ofReal (coarseMass b (width d n) univ)) + + (ENNReal.ofReal (t*(width d n)^(1/10 : ℝ)))⁻¹ * + ((ENNReal.ofReal (6*Real.pi)*ENNReal.ofReal (2*(200*width d n/((width d n)^(1/5 : ℝ))^2)))* + ENNReal.ofReal (coarseMass b (width d n) univ))) ∧ + ∀ x ∉ E, ∀ r ∈ Icc (1 : ℝ) 2, + ∀ k : ∀ n : ℕ, RadiusDensity (r-width d n) (r+width d n) + ⟨216/width d n, div_nonneg (by norm_num) (width_pos hd n).le⟩, + (∀ n, t*(width d n)^(1/10 : ℝ) ≤ coarseMass b (width d n) (thinShell x r (width d n)) → + (∑ j, ∫ y, star (y-x)*((kernel (k (n+1)) x y : ℂ)-kernel (k n) x y)*(b j).density y) = 0) → + ‖∑ j, ∫ y in Metric.ball x r, (b j).density y‖ ≤ + (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100)+ + (16+4538*Cs)*t*d^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by + have hd1 : d ≤ 1 := by linarith + have hwp (n : ℕ) : 0 < width d n := width_pos hd n + have hw1 (n : ℕ) : width d n ≤ 1 := (width_le hd.le n).trans hd1 + have hρ (n : ℕ) : 0 < (width d n)^(1/5 : ℝ) := Real.rpow_pos_of_pos (hwp n) _ + have hρ1 (n : ℕ) : (width d n)^(1/5 : ℝ) ≤ 1 := + Real.rpow_le_one (hwp n).le (hw1 n) (by norm_num) + have hs (n : ℕ) := size_step b hCs (by norm_num : (1/100 : ℝ) ≤ 1) + (hwp n) (hρ n) (hρ1 n) (hgeom _ (hwp n) (width_le hd.le n)) + (mul_pos ht (Real.rpow_pos_of_pos (hwp n) (1/10 : ℝ))) + choose E hE hEv hEst using hs + refine ⟨⋃ n, E n, MeasurableSet.iUnion hE, + (measure_iUnion_le E).trans (ENNReal.tsum_le_tsum hEv), ?_⟩ + intro x hx r hr k hz + have hxE (n : ℕ) : x ∉ E n := fun hn => hx (mem_iUnion.mpr ⟨n,hn⟩) + let P (n : ℕ) : ℂ := ∑ j, ∫ y, (kernel (k n) x y : ℂ)*(b j).density y + let B : ℂ := ∑ j, ∫ y in Metric.ball x r, (b j).density y + have hPi (n : ℕ) (j : ι) : Integrable (fun y => (kernel (k n) x y : ℂ)*(b j).density y) := + integrable_bounded_pairing (b j).integrable (complex_kernel_lipschitz (k n) x).continuous.aestronglyMeasurable (complex_kernel_bound (k n) x) + have hdist (n : ℕ) : dist (P n) (P (n+1)) ≤ + (16+4538*Cs)*t*(width d n)^(1/10 : ℝ) := by + let F (y : ℂ) : ℂ := (kernel (k (n+1)) x y : ℂ)-kernel (k n) x y + have hL : 216/width d (n+1)+216/width d n ≤ 648/width d n := by + rw [width_succ] + apply le_of_eq + ring + have hF := (complex_kernel_lipschitz (k (n+1)) x).sub (complex_kernel_lipschitz (k n) x) + have hbnd := hEst n x (hxE n) r hr _ F hF + (difference_bound (k n) (k (n+1)) x) + (difference_support (k n) (k (n+1)) (width_antitone hd.le (Nat.le_succ n)) x) + (hz n) + have hM : coarseMass b (width d n) univ ≤ + errorPrice b (1/100)*(width d n)^(-(1/50 : ℝ)) := by + have hh := coarseMass_bound b (by norm_num : (0 : ℝ) ≤ 1/100) (hwp n) + norm_num at hh + simpa only [Real.rpow_neg (hwp n).le, div_eq_mul_inv] using hh + have hstep := scaled_increment hCs (errorPrice_nonneg b (1/100)) hAt (hwp n) (hw1 n) hM hL + have he : P (n+1)-P n = ∑ j, ∫ y, F y*(b j).density y := by + change (∑ j, ∫ y, (kernel (k (n+1)) x y : ℂ)*(b j).density y) - + (∑ j, ∫ y, (kernel (k n) x y : ℂ)*(b j).density y) = _ + rw [← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro j _ + rw [← integral_sub (hPi (n+1) j) (hPi n j)] + congr 1 + ext y + simp only [F, sub_mul] + rw [dist_eq_norm, norm_sub_rev, he] + exact hbnd.trans hstep + have hlim : Tendsto P atTop (𝓝 B) := + tendsto_finsetSum Finset.univ (fun j _ => tendsto_kernel_pairing k (tendsto_width d) x (b j).integrable) + have hsm : Summable (fun n => (16+4538*Cs)*t*(width d n)^(1/10 : ℝ)) := + (summable_width_rpow hd.le (by norm_num : (0 : ℝ) < 1/10)).mul_left _ + have htail := dist_le_tsum_of_dist_le_of_tendsto₀ _ hdist hsm hlim + rw [tsum_mul_left, tsum_width_rpow hd.le (by norm_num : (0 : ℝ) < 1/10)] at htail + have hstart : ‖P 0‖ ≤ (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100) := by + have hh := total_pairing_discount b (by norm_num : (0 : ℝ) ≤ 1/100) + (by norm_num : (1/100 : ℝ) ≤ 1) (hwp 0) (hw1 0) + (show 1 ≤ 1+216*Cs by linarith) + (complex_kernel_lipschitz (k 0) x) (complex_kernel_bound (k 0) x) + (show (216/width d 0)*Cs ≤ (1+216*Cs)/width d 0 by + apply (le_div_iff₀ (hwp 0)).mpr + field_simp [(hwp 0).ne'] + linarith) + simpa only [P, width, pow_zero, mul_one] using hh + calc + ‖B‖ = ‖P 0+(B-P 0)‖ := by congr 1; ring + _ ≤ ‖P 0‖+‖B-P 0‖ := norm_add_le _ _ + _ = ‖P 0‖+dist (P 0) B := by rw [dist_eq_norm, norm_sub_rev] + _ ≤ (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100)+ + (16+4538*Cs)*t*(d^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) := + add_le_add hstart htail + _ = _ := by ring + +end LocalCancellation + +namespace DiskGeometry + +def endpointFailure (ν : Measure ℂ) (δ U : ℝ) : Set ℂ := + {x | ENNReal.ofReal U ≤ shellMass ν 1 (2*δ) x} ∪ + {x | ENNReal.ofReal U ≤ shellMass ν 2 (2*δ) x} + +lemma endpoint_failure_bound (ν : Measure ℂ) [IsFiniteMeasure ν] + {δ U : ℝ} (hδ : 0 ≤ δ) (hδq : δ ≤ 1/4) (hU : 0 < U) : + MeasurableSet (endpointFailure ν δ U) ∧ + volume (endpointFailure ν δ U) ≤ ENNReal.ofReal (24*Real.pi*δ)*ν univ/ENNReal.ofReal U := by + obtain ⟨h1,hb1⟩ := shellMass_exception ν (show 0 ≤ 2*δ by positivity) + (show 2*δ ≤ 1 by linarith) hU + obtain ⟨h2,hb2⟩ := shellMass_exception ν (show 0 ≤ 2*δ by positivity) + (show 2*δ ≤ 2 by linarith) hU + refine ⟨h1.union h2, (measure_union_le _ _).trans ((add_le_add hb1 hb2).trans_eq ?_)⟩ + simp only [div_eq_mul_inv] + rw [← add_mul, ← add_mul, ← ENNReal.ofReal_add (by positivity) (by positivity)] + congr 3 + ring + +lemma active_away_from_endpoints (ν : Measure ℂ) {x : ℂ} {δ U r : ℝ} + (hx : x ∉ endpointFailure ν δ U) (hr : r ∈ Icc (1 : ℝ) 2) + (ha : ENNReal.ofReal U ≤ ν (thinShell x r δ)) : + 1+δ ≤ r ∧ r+δ ≤ 2 := by + constructor + · by_contra hh + have he : |r-1| ≤ δ := by rw [abs_of_nonneg (by linarith [hr.1])]; linarith + exact hx (Or.inl (ha.trans (measure_mono (thinShell_subset_endpoint he)))) + · by_contra hh + have he : |r-2| ≤ δ := by rw [abs_of_nonpos (by linarith [hr.2])]; linarith + exact hx (Or.inr (ha.trans (measure_mono (thinShell_subset_endpoint he)))) + +end DiskGeometry + +namespace DiskMoments +open DiskKernels DiskGeometry + +def EndpointRadius (g : ℂ → ℝ) (x : ℂ) (r : ℝ) : Prop := + r ∈ Icc (1 : ℝ) 2 ∧ (r = 1 ∨ r = 2 ∨ + ∀ t ∈ Icc (1 : ℝ) 2, signedAverage g x t ≤ signedAverage g x r) + +/-- Every band-maximizing or forced-endpoint radius has honest mixtures; +balancing is imposed exactly when its width stays inside the band. -/ +lemma endpoint_kernel {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {x : ℂ} {r δ : ℝ} + (hr : EndpointRadius g x r) (hδ : 0 < δ) (hδq : δ ≤ 1/4) : + ∃ k : RadiusDensity (r-δ) (r+δ) ⟨216/δ, by positivity⟩, + (1+δ ≤ r ∧ r+δ ≤ 2 → + (∫ y, kernel k x y • (star (y-x)*gradient g y)) = 0) := by + by_cases hi : 1+δ ≤ r ∧ r+δ ≤ 2 + · have hm : ∀ t ∈ Icc (1 : ℝ) 2, signedAverage g x t ≤ signedAverage g x r := by + rcases hr.2 with h | h | h + · linarith [hi.1] + · linarith [hi.2] + · exact h + obtain ⟨k,hk⟩ := balanced_kernel hg x hr.1 hδ hδq + (hm _ ⟨by linarith [hi.1], by linarith [hr.1.2]⟩) + (hm _ ⟨by linarith [hr.1.1], hi.2⟩) + exact ⟨k, fun _ => hk⟩ + · have ha : (1 : ℝ)/2 ≤ r-δ := by linarith [hr.1.1] + have hb : r+δ ≤ (3 : ℝ) := by linarith [hr.1.2] + have hab : r-δ < r+δ := by linarith + let k := inverseCubeDensity (r-δ) (r+δ) ha hb hab + refine ⟨enlarge k le_rfl le_rfl ?_, fun h => (hi h).elim⟩ + change 216/(r+δ-(r-δ)) ≤ 216/δ + apply div_le_div_of_nonneg_left (by norm_num) hδ + linarith + +end DiskMoments + +namespace LocalCancellation +open DiskKernels DiskMoments DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +lemma moment_pairing_integrable {Cs r δ : ℝ} (b : ErrorPiece Cs) + {M : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) (x : ℂ) (hr : r+δ ≤ 3) : + Integrable (fun y => star (y-x)*(kernel k x y : ℂ)*b.density y) := by + apply integrable_bounded_pairing b.integrable + ((by fun_prop : Continuous (fun y : ℂ => star (y-x))).mul + (complex_kernel_lipschitz k x).continuous).aestronglyMeasurable + apply position_bound (complex_kernel_bound k x) x (by norm_num : (0 : ℝ) ≤ 3) + intro y hy + have hyb : y ∈ Metric.ball x (r+δ) := by + by_contra hh + exact hy (by rw [kernel_zero k x hh, Complex.ofReal_zero]) + exact (show ‖y-x‖ < r+δ by simpa only [Metric.mem_ball, dist_eq_norm] using hyb).le.trans hr + +/-- A local equality of genuine densities suffices for all supported moments. -/ +lemma moment_pairing_decomposition {Cs r δ : ℝ} (b : ι → ErrorPiece Cs) + {M : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) (x : ℂ) {h : ℂ → ℂ} + (hr : r+δ ≤ 3) (hh : ∀ᵐ y, y ∈ Metric.ball x 3 → ∑ j, (b j).density y = h y) : + (∑ j, ∫ y, star (y-x)*(kernel k x y : ℂ)*(b j).density y) = + ∫ y, kernel k x y • (star (y-x)*h y) := by + rw [← integral_finsetSum _ (fun j _ => moment_pairing_integrable (b j) k x hr)] + apply integral_congr_ae + filter_upwards [hh] with y hy + simp only [← Finset.mul_sum] + by_cases hmem : y ∈ Metric.ball x 3 + · rw [hy hmem, Complex.real_smul] + ring + · have hk : kernel k x y = 0 := kernel_zero k x + (fun hb => hmem (lt_of_lt_of_le hb hr)) + rw [hk, Complex.ofReal_zero, mul_zero, zero_mul, zero_smul] + +lemma moment_difference_decomposition {Cs r δ ε : ℝ} (b : ι → ErrorPiece Cs) + {M N : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) + (l : RadiusDensity (r-ε) (r+ε) N) (x : ℂ) {h : ℂ → ℂ} + (hrδ : r+δ ≤ 3) (hrε : r+ε ≤ 3) + (hh : ∀ᵐ y, y ∈ Metric.ball x 3 → ∑ j, (b j).density y = h y) + (hk : (∫ y, kernel k x y • (star (y-x)*h y)) = 0) + (hl : (∫ y, kernel l x y • (star (y-x)*h y)) = 0) : + (∑ j, ∫ y, star (y-x)*((kernel l x y : ℂ)-kernel k x y)*(b j).density y) = 0 := by + have he : ∀ j, (∫ y, star (y-x)*((kernel l x y : ℂ)-kernel k x y)*(b j).density y) = + (∫ y, star (y-x)*(kernel l x y : ℂ)*(b j).density y) - + (∫ y, star (y-x)*(kernel k x y : ℂ)*(b j).density y) := by + intro j + rw [← integral_sub (moment_pairing_integrable (b j) l x hrε) + (moment_pairing_integrable (b j) k x hrδ)] + congr 1 + ext y + ring + simp_rw [he] + rw [Finset.sum_sub_distrib, moment_pairing_decomposition b l x hrε hh, + moment_pairing_decomposition b k x hrδ hh, hk, hl, sub_self] + +lemma ball_pairing_decomposition {Cs r : ℝ} (b : ι → ErrorPiece Cs) + (x : ℂ) {h : ℂ → ℂ} (hr : r ≤ 3) + (hh : ∀ᵐ y, y ∈ Metric.ball x 3 → ∑ j, (b j).density y = h y) : + (∑ j, ∫ y in Metric.ball x r, (b j).density y) = ∫ y in Metric.ball x r, h y := by + rw [← integral_finsetSum _ (fun j _ => (b j).integrable.integrableOn)] + apply setIntegral_congr_ae measurableSet_ball + filter_upwards [hh] with y hy hyb + exact hy (lt_of_lt_of_le hyb hr) + +/-- The full raw band-endpoint size estimate. All maxima and both forced radii +are simultaneous, with no measurable radius selection required. -/ +theorem size_endpoint_raw {Cs d t : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hdq : d ≤ 1/4) + (hgeom : ∀ δ : ℝ, 0 < δ → δ ≤ d → δ ≤ (δ^(1/5 : ℝ))^2/1600) + (ht : 0 < t) (hAt : errorPrice b (1/100) ≤ t) + {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) : + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ ∑' n : ℕ, ( + (ENNReal.ofReal (t*(width d n)^(1/10 : ℝ)))⁻¹ ^ 2 * + (ENNReal.ofReal (156*width d n/(width d n)^(1/5 : ℝ))* + ENNReal.ofReal (coarseMass b (width d n) univ)*ENNReal.ofReal (coarseMass b (width d n) univ)) + + (ENNReal.ofReal (t*(width d n)^(1/10 : ℝ)))⁻¹ * + ((ENNReal.ofReal (6*Real.pi)*ENNReal.ofReal (2*(200*width d n/((width d n)^(1/5 : ℝ))^2)))* + ENNReal.ofReal (coarseMass b (width d n) univ)) + + ENNReal.ofReal (24*Real.pi*width d n)*ENNReal.ofReal (coarseMass b (width d n) univ)/ + ENNReal.ofReal (t*(width d n)^(1/10 : ℝ))) ∧ + ∀ x ∉ E, + (∀ᵐ y, y ∈ Metric.ball x 3 → ∑ j, (b j).density y = gradient g y) → + ∀ r, EndpointRadius g x r → + ‖∫ y in Metric.ball x r, gradient g y‖ ≤ + (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100)+ + (16+4538*Cs)*t*d^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by + have hwp (n : ℕ) : 0 < width d n := width_pos hd n + have hwq (n : ℕ) : width d n ≤ 1/4 := (width_le hd.le n).trans hdq + let F (n : ℕ) := endpointFailure (coarseMeasure b (width d n)) (width d n) + (t*(width d n)^(1/10 : ℝ)) + have hF (n : ℕ) := endpoint_failure_bound (coarseMeasure b (width d n)) + (hwp n).le (hwq n) (mul_pos ht (Real.rpow_pos_of_pos (hwp n) (1/10 : ℝ))) + obtain ⟨E,hE,hEv,hEst⟩ := size_sequence b hCs hd hdq hgeom ht hAt + refine ⟨E ∪ ⋃ n, F n, hE.union (MeasurableSet.iUnion fun n => (hF n).1), ?_, ?_⟩ + · apply (measure_union_le _ _).trans + apply (add_le_add hEv ((measure_iUnion_le F).trans (ENNReal.tsum_le_tsum (fun n => (hF n).2)))).trans_eq + rw [← ENNReal.tsum_add] + congr 1 + funext n + rw [coarseMeasure_apply b (width d n) MeasurableSet.univ] + · intro x hx hh r hr + have hxE : x ∉ E := fun h => hx (Or.inl h) + have hxF (n : ℕ) : x ∉ F n := fun h => hx (Or.inr (mem_iUnion.mpr ⟨n,h⟩)) + choose k hk using fun n => endpoint_kernel hg hr (hwp n) (hwq n) + rw [← ball_pairing_decomposition b x (by linarith [hr.1.2]) hh] + apply hEst x hxE r hr.1 k + intro n ha + have haway : 1+width d n ≤ r ∧ r+width d n ≤ 2 := by + apply active_away_from_endpoints (coarseMeasure b (width d n)) (hxF n) hr.1 + rw [coarseMeasure_apply b (width d n) (measurableSet_thinShell x r (width d n))] + exact ENNReal.ofReal_le_ofReal ha + have haway' : 1+width d (n+1) ≤ r ∧ r+width d (n+1) ≤ 2 := by + have hw := width_antitone hd.le (Nat.le_succ n) + constructor <;> linarith [haway.1,haway.2] + exact moment_difference_decomposition b (k n) (k (n+1)) x + (by linarith [hr.1.2,hwq n]) (by linarith [hr.1.2,hwq (n+1)]) hh + (hk n haway) (hk (n+1) haway') + +end LocalCancellation + +namespace DiskScales + +lemma first_power_identity {δ : ℝ} (hδ : 0 < δ) : + (δ^(1/10 : ℝ))⁻¹^2 * (δ / δ^(1/5 : ℝ) * δ^(-(1/50 : ℝ)) * δ^(-(1/50 : ℝ))) = + δ^(14/25 : ℝ) := by + rw [← Real.rpow_neg hδ.le, ← Real.rpow_natCast, ← Real.rpow_mul hδ.le] + have he (a : ℝ) : δ / δ^a = δ^(1-a) := by + rw [Real.rpow_sub hδ, Real.rpow_one] + rw [he] + rw [← mul_assoc, ← mul_assoc, ← Real.rpow_add hδ, ← Real.rpow_add hδ, ← Real.rpow_add hδ] + norm_num + +lemma second_power_identity {δ : ℝ} (hδ : 0 < δ) : + (δ^(1/10 : ℝ))⁻¹ * (δ / (δ^(1/5 : ℝ))^2 * δ^(-(1/50 : ℝ))) = + δ^(12/25 : ℝ) := by + rw [← Real.rpow_neg hδ.le, ← Real.rpow_natCast, ← Real.rpow_mul hδ.le] + have he (a : ℝ) : δ / δ^a = δ^(1-a) := by + rw [Real.rpow_sub hδ, Real.rpow_one] + rw [he] + rw [← mul_assoc, ← Real.rpow_add hδ, ← Real.rpow_add hδ] + norm_num + +lemma endpoint_power_identity {δ : ℝ} (hδ : 0 < δ) : + δ * δ^(-(1/50 : ℝ)) / δ^(1/10 : ℝ) = δ^(22/25 : ℝ) := by + have he : δ * δ^(-(1/50 : ℝ)) = δ^(1-(1/50 : ℝ)) := by + simp only [Real.rpow_sub hδ, Real.rpow_one, Real.rpow_neg hδ.le, div_eq_mul_inv] + rw [he, ← Real.rpow_sub hδ] + norm_num + +/-- The two geometric failure mechanisms have integrable superlevel powers. -/ +lemma shell_tail_scaled {A t δ M : ℝ} (hA : 0 ≤ A) (ht : 0 < t) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hM0 : 0 ≤ M) + (hM : M ≤ A*δ^(-(1/50 : ℝ))) : + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ ^ 2 * + (ENNReal.ofReal (156*δ/δ^(1/5 : ℝ))*ENNReal.ofReal M*ENNReal.ofReal M) + + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ * + ((ENNReal.ofReal (6*Real.pi)*ENNReal.ofReal (2*(200*δ/(δ^(1/5 : ℝ))^2)))*ENNReal.ofReal M) ≤ + ENNReal.ofReal (156*(A/t)^2*δ^(14/25 : ℝ)+2400*Real.pi*(A/t)*δ^(9/25 : ℝ)) := by + have hU : 0 < t*δ^(1/10 : ℝ) := mul_pos ht (Real.rpow_pos_of_pos hδ _) + rw [← ENNReal.ofReal_inv_of_pos hU, ← ENNReal.ofReal_pow (inv_nonneg.mpr hU.le)] + have hp : 0 ≤ 156*δ/δ^(1/5 : ℝ) := by positivity + have hp' : 0 ≤ 2*(200*δ/(δ^(1/5 : ℝ))^2) := by positivity + rw [← ENNReal.ofReal_mul hp, ← ENNReal.ofReal_mul (mul_nonneg hp hM0), + ← ENNReal.ofReal_mul (sq_nonneg _), + ← ENNReal.ofReal_mul (show (0 : ℝ) ≤ 6*Real.pi by positivity), + ← ENNReal.ofReal_mul (mul_nonneg (by positivity) hp'), + ← ENNReal.ofReal_mul (inv_nonneg.mpr hU.le), + ← ENNReal.ofReal_add (by positivity) (by positivity)] + apply ENNReal.ofReal_le_ofReal + have hfirst : (t*δ^(1/10 : ℝ))⁻¹^2 * (156*δ/δ^(1/5 : ℝ)*M*M) ≤ + 156*(A/t)^2*δ^(14/25 : ℝ) := by + calc + _ ≤ (t*δ^(1/10 : ℝ))⁻¹^2 * + (156*δ/δ^(1/5 : ℝ)*(A*δ^(-(1/50 : ℝ)))*(A*δ^(-(1/50 : ℝ)))) := by gcongr + _ = 156*(A/t)^2*δ^(14/25 : ℝ) := by + rw [← first_power_identity hδ] + simp only [mul_inv_rev] + ring + have hsecond : (t*δ^(1/10 : ℝ))⁻¹ * + (6*Real.pi*(2*(200*δ/(δ^(1/5 : ℝ))^2))*M) ≤ + 2400*Real.pi*(A/t)*δ^(9/25 : ℝ) := by + calc + _ ≤ (t*δ^(1/10 : ℝ))⁻¹ * + (6*Real.pi*(2*(200*δ/(δ^(1/5 : ℝ))^2))*(A*δ^(-(1/50 : ℝ)))) := by gcongr + _ = 2400*Real.pi*(A/t)*δ^(12/25 : ℝ) := by + rw [← second_power_identity hδ] + simp only [mul_inv_rev] + ring + _ ≤ 2400*Real.pi*(A/t)*δ^(9/25 : ℝ) := + mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num)) (by positivity) + exact add_le_add hfirst hsecond + +lemma endpoint_tail_scaled {A t δ M : ℝ} (hA : 0 ≤ A) (ht : 0 < t) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (hM : M ≤ A*δ^(-(1/50 : ℝ))) : + ENNReal.ofReal (24*Real.pi*δ)*ENNReal.ofReal M / ENNReal.ofReal (t*δ^(1/10 : ℝ)) ≤ + ENNReal.ofReal (24*Real.pi*(A/t)*δ^(9/25 : ℝ)) := by + rw [← ENNReal.ofReal_mul (by positivity), ← ENNReal.ofReal_div_of_pos (by positivity)] + apply ENNReal.ofReal_le_ofReal + calc + _ ≤ (24*Real.pi*δ)*(A*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ)) := by gcongr + _ = 24*Real.pi*(A/t)*δ^(22/25 : ℝ) := by + rw [← endpoint_power_identity hδ] + ring + _ ≤ 24*Real.pi*(A/t)*δ^(9/25 : ℝ) := + mul_le_mul_of_nonneg_left (Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num)) (by positivity) + +end DiskScales + +namespace DiskScales + +lemma norm_geometric_rpow_lt {p : ℝ} (hp : 0 < p) : (1/2 : ℝ)^p < 1 := + Real.rpow_lt_one (by norm_num) (by norm_num) hp + +lemma raw_endpoint_tail_scaled {A t δ M : ℝ} (hA : 0 ≤ A) (ht : 0 < t) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hM0 : 0 ≤ M) + (hM : M ≤ A*δ^(-(1/50 : ℝ))) : + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ ^ 2 * + (ENNReal.ofReal (156*δ/δ^(1/5 : ℝ))*ENNReal.ofReal M*ENNReal.ofReal M) + + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ * + ((ENNReal.ofReal (6*Real.pi)*ENNReal.ofReal (2*(200*δ/(δ^(1/5 : ℝ))^2)))*ENNReal.ofReal M) + + ENNReal.ofReal (24*Real.pi*δ)*ENNReal.ofReal M/ENNReal.ofReal (t*δ^(1/10 : ℝ)) ≤ + ENNReal.ofReal (156*(A/t)^2*δ^(14/25 : ℝ)+2424*Real.pi*(A/t)*δ^(9/25 : ℝ)) := by + calc + _ ≤ ENNReal.ofReal (156*(A/t)^2*δ^(14/25 : ℝ)+2400*Real.pi*(A/t)*δ^(9/25 : ℝ)) + + ENNReal.ofReal (24*Real.pi*(A/t)*δ^(9/25 : ℝ)) := + add_le_add (shell_tail_scaled hA ht hδ hδ1 hM0 hM) + (endpoint_tail_scaled hA ht hδ hδ1 hM) + _ = _ := by + rw [← ENNReal.ofReal_add (by positivity) (by positivity)] + congr 1 + ring + +lemma geometric_tail_sum {A t d : ℝ} (hA : 0 ≤ A) (ht : 0 < t) (hd : 0 ≤ d) : + (∑' n : ℕ, ENNReal.ofReal + (156*(A/t)^2*(width d n)^(14/25 : ℝ)+2424*Real.pi*(A/t)*(width d n)^(9/25 : ℝ))) = + ENNReal.ofReal (156*(A/t)^2*d^(14/25 : ℝ)/(1-(1/2 : ℝ)^(14/25 : ℝ))+ + 2424*Real.pi*(A/t)*d^(9/25 : ℝ)/(1-(1/2 : ℝ)^(9/25 : ℝ))) := by + have h1 := (summable_width_rpow hd (by norm_num : (0 : ℝ) < 14/25)).mul_left (156*(A/t)^2) + have h2 := (summable_width_rpow hd (by norm_num : (0 : ℝ) < 9/25)).mul_left (2424*Real.pi*(A/t)) + have hn (n : ℕ) : 0 ≤ width d n := mul_nonneg hd (pow_nonneg (by norm_num) n) + have hc1 : 0 ≤ 156*(A/t)^2 := by positivity + have hc2 : 0 ≤ 2424*Real.pi*(A/t) := by positivity + rw [← ENNReal.ofReal_tsum_of_nonneg (fun n => add_nonneg + (mul_nonneg hc1 (Real.rpow_nonneg (hn n) _)) + (mul_nonneg hc2 (Real.rpow_nonneg (hn n) _))) (h1.add h2), + Summable.tsum_add h1 h2, tsum_mul_left, tsum_mul_left, + tsum_width_rpow hd (by norm_num : (0 : ℝ) < 14/25), + tsum_width_rpow hd (by norm_num : (0 : ℝ) < 9/25)] + congr 1 + ring + +/-- After the initial-width choice d=A/t, the failure exponents are strictly +larger than one, rather than the nonintegrable weak-(1,1) exponent. -/ +lemma starting_width_tail {A t : ℝ} (hA : 0 < A) (ht : 0 < t) : + 156*(A/t)^2*(A/t)^(14/25 : ℝ)/(1-(1/2 : ℝ)^(14/25 : ℝ))+ + 2424*Real.pi*(A/t)*(A/t)^(9/25 : ℝ)/(1-(1/2 : ℝ)^(9/25 : ℝ)) = + (156/(1-(1/2 : ℝ)^(14/25 : ℝ)))*(A/t)^(64/25 : ℝ)+ + (2424*Real.pi/(1-(1/2 : ℝ)^(9/25 : ℝ)))*(A/t)^(34/25 : ℝ) := by + have hq : 0 < A/t := div_pos hA ht + have he1 : (A/t)^2*(A/t)^(14/25 : ℝ) = (A/t)^(64/25 : ℝ) := by + rw [← Real.rpow_natCast, ← Real.rpow_add hq] + norm_num + have he2 : (A/t)*(A/t)^(9/25 : ℝ) = (A/t)^(34/25 : ℝ) := by + conv_lhs => lhs; rw [← Real.rpow_one (A/t)] + rw [← Real.rpow_add hq] + norm_num + calc + _ = (156/(1-(1/2 : ℝ)^(14/25 : ℝ)))*((A/t)^2*(A/t)^(14/25 : ℝ))+ + (2424*Real.pi/(1-(1/2 : ℝ)^(9/25 : ℝ)))*((A/t)*(A/t)^(9/25 : ℝ)) := by ring + _ = _ := by rw [he1,he2] + +end DiskScales + +namespace DiskScales + +lemma size_start_identity {Cs A t : ℝ} (hA : 0 < A) (ht : 0 < t) : + (1+216*Cs)/(A/t)^(1/100 : ℝ)*A+ + (16+4538*Cs)*t*(A/t)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) = + t*((1+216*Cs)*(A/t)^(99/100 : ℝ)+ + (16+4538*Cs)*(A/t)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) := by + have hq : 0 < A/t := div_pos hA ht + have he : (A/t)/(A/t)^(1/100 : ℝ) = (A/t)^(99/100 : ℝ) := by + have hh := Real.rpow_sub hq (1 : ℝ) (1/100 : ℝ) + norm_num at hh + exact hh.symm + have hAt : t*(A/t) = A := by field_simp + calc + _ = t*((1+216*Cs)*((A/t)/(A/t)^(1/100 : ℝ))+ + (16+4538*Cs)*(A/t)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) := by + rw [mul_add] + congr 1 + · calc + _ = (1+216*Cs)/(A/t)^(1/100 : ℝ)*(t*(A/t)) := by rw [hAt] + _ = _ := by ring + · ring + _ = _ := by rw [he] + +/-- One fixed small-width cutoff enforces geometry and the strict endpoint +size threshold at every smaller positive width. -/ +lemma exists_size_parameters (Cs : ℝ) : + ∃ d₀ : ℝ, 0 < d₀ ∧ d₀ ≤ 1/4 ∧ + (∀ δ : ℝ, 0 < δ → δ ≤ d₀ → δ ≤ (δ^(1/5 : ℝ))^2/1600) ∧ + (∀ δ : ℝ, 0 < δ → δ ≤ d₀ → + (1+216*Cs)*δ^(99/100 : ℝ)+ + (16+4538*Cs)*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) ≤ 1) := by + obtain ⟨d,hd,hdq,hgeom⟩ := exists_admissible_width + have ht : Tendsto (fun δ : ℝ => (1+216*Cs)*δ^(99/100 : ℝ)+ + (16+4538*Cs)*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) (𝓝 0) (𝓝 0) := by + have h1 := (Real.continuous_rpow_const (by norm_num : (0 : ℝ) ≤ 99/100)).tendsto 0 + have h2 := (Real.continuous_rpow_const (by norm_num : (0 : ℝ) ≤ 1/10)).tendsto 0 + simpa using (h1.const_mul (1+216*Cs)).add ((h2.const_mul (16+4538*Cs)).div_const _) + obtain ⟨l,u,hu,hs⟩ := mem_nhds_iff_exists_Ioo_subset.mp + (ht.eventually_lt_const (by norm_num : (0 : ℝ) < 1)) + let d₀ := min d (u/2) + have hd0 : 0 < d₀ := lt_min hd (by linarith [hu.2]) + refine ⟨d₀,hd0,(min_le_left _ _).trans hdq,fun δ hδ hδd => hgeom δ hδ (hδd.trans (min_le_left _ _)), ?_⟩ + intro δ hδ hδd + apply le_of_lt + apply hs + exact ⟨lt_trans hu.1 hδ, lt_of_le_of_lt hδd ((min_le_right _ _).trans_lt (by linarith [hu.2]))⟩ + +end DiskScales + +namespace DiskScales + +def sizeTailConstant : ℝ := + 156/(1-(1/2 : ℝ)^(14/25 : ℝ))+2424*Real.pi/(1-(1/2 : ℝ)^(9/25 : ℝ)) + +lemma sizeTailConstant_pos : 0 < sizeTailConstant := by + have h1 : 0 < 1-(1/2 : ℝ)^(14/25 : ℝ) := sub_pos.mpr (norm_geometric_rpow_lt (by norm_num)) + have h2 : 0 < 1-(1/2 : ℝ)^(9/25 : ℝ) := sub_pos.mpr (norm_geometric_rpow_lt (by norm_num)) + unfold sizeTailConstant + positivity + +lemma collapse_size_tail {q : ℝ} (hq : 0 < q) (hq1 : q ≤ 1) : + (156/(1-(1/2 : ℝ)^(14/25 : ℝ)))*q^(64/25 : ℝ)+ + (2424*Real.pi/(1-(1/2 : ℝ)^(9/25 : ℝ)))*q^(34/25 : ℝ) ≤ + sizeTailConstant*q^(34/25 : ℝ) := by + have hc : 0 ≤ 156/(1-(1/2 : ℝ)^(14/25 : ℝ)) := + div_nonneg (by norm_num) (sub_nonneg.mpr ((norm_geometric_rpow_lt (by norm_num)).le)) + have he := mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_exponent_ge hq hq1 (by norm_num : (34/25 : ℝ) ≤ 64/25)) hc + unfold sizeTailConstant + nlinarith + +end DiskScales + +namespace LocalCancellation +open DiskKernels DiskMoments DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +/-- The uniform integrable superlevel tail, with both forced band endpoints. +The only decomposition assumption is equality of the specified densities on +each observation disk. No direction positivity is needed for this size bound. -/ +theorem size_tail {Cs : ℝ} (hCs : 0 ≤ Cs) : + ∃ L : ℝ, 1 ≤ L ∧ ∀ {ι : Type*} [Fintype ι] (b : ι → ErrorPiece Cs), + 0 < errorPrice b (1/100) → ∀ t : ℝ, L*errorPrice b (1/100) ≤ t → + ∀ g : ℂ → ℝ, ContDiff ℝ 1 g → + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ ENNReal.ofReal (sizeTailConstant*(errorPrice b (1/100)/t)^(34/25 : ℝ)) ∧ + ∀ x ∉ E, + (∀ᵐ y, y ∈ Metric.ball x 3 → ∑ j, (b j).density y = gradient g y) → + ∀ r, EndpointRadius g x r → ‖∫ y in Metric.ball x r, gradient g y‖ ≤ t := by + obtain ⟨d₀,hd0,hdq,hgeom,hsmall⟩ := exists_size_parameters Cs + have hL : 1 ≤ (1 : ℝ)/d₀ := (le_div_iff₀ hd0).mpr (by linarith) + refine ⟨1/d₀,hL,?_⟩ + intro ι _ b hA t ht g hg + let A := errorPrice b (1/100) + have hAt : A ≤ t := (le_mul_of_one_le_left hA.le hL).trans ht + have ht0 : 0 < t := lt_of_lt_of_le hA hAt + have hqd : A/t ≤ d₀ := by + apply (div_le_iff₀ ht0).mpr + have hh : A/d₀ ≤ t := by simpa only [A,one_div, div_eq_mul_inv, mul_comm, mul_one] using ht + have hh' := (div_le_iff₀ hd0).mp hh + linarith + have hq0 : 0 < A/t := div_pos hA ht0 + have hq1 : A/t ≤ 1 := by linarith + have hqq : A/t ≤ 1/4 := hqd.trans hdq + obtain ⟨E,hE,hEv,hEst⟩ := size_endpoint_raw b hCs hq0 hqq + (fun δ hδ hδq => hgeom δ hδ (hδq.trans hqd)) ht0 hAt hg + refine ⟨E,hE,?_,?_⟩ + · apply hEv.trans + calc + _ ≤ ∑' n : ℕ, ENNReal.ofReal + (156*(A/t)^2*(width (A/t) n)^(14/25 : ℝ)+ + 2424*Real.pi*(A/t)*(width (A/t) n)^(9/25 : ℝ)) := by + apply ENNReal.tsum_le_tsum + intro n + have hw0 : 0 < width (A/t) n := width_pos hq0 n + have hw1 : width (A/t) n ≤ 1 := (width_le hq0.le n).trans hq1 + apply raw_endpoint_tail_scaled hA.le ht0 hw0 hw1 (coarseMass_nonneg b _ _) + have hh := coarseMass_bound b (by norm_num : (0 : ℝ) ≤ 1/100) hw0 + norm_num at hh + rw [Real.rpow_neg hw0.le] + exact hh + _ = ENNReal.ofReal + ((156/(1-(1/2 : ℝ)^(14/25 : ℝ)))*(A/t)^(64/25 : ℝ)+ + (2424*Real.pi/(1-(1/2 : ℝ)^(9/25 : ℝ)))*(A/t)^(34/25 : ℝ)) := by + rw [geometric_tail_sum hA.le ht0 hq0.le, starting_width_tail hA ht0] + _ ≤ ENNReal.ofReal (sizeTailConstant*(A/t)^(34/25 : ℝ)) := + ENNReal.ofReal_le_ofReal (collapse_size_tail hq0 hq1) + · intro x hx hh r hr + apply (hEst x hx hh r hr).trans + rw [size_start_identity hA ht0] + exact (mul_le_mul_of_nonneg_left (hsmall _ hq0 hqd) ht0.le).trans_eq (mul_one t) + +end LocalCancellation + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/SpatialBudgets.lean b/lean/OAI/Analysis/DiskMaximal/SpatialBudgets.lean new file mode 100644 index 0000000000000000000000000000000000000000..236290f8963cf6f22eed4e5aada092b265d933b9 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/SpatialBudgets.lean @@ -0,0 +1,788 @@ +import OAI.Analysis.DiskMaximal.RunCancellation + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace ActualLabels +open FiniteLabels DyadicHats Finset + +lemma row_change_le_rate (h : ℂ → ℂ) (r : ℝ) (x : ℂ) (n : Label) : + expect (row h r x n) (fun j => if j = n then 0 else 1) ≤ rate h r x n := by + rw [row,spatialRow_expect] + simp only [ite_true,sub_zero,zero_add] + apply interpolate_mono + intro z + split_ifs <;> simp [switchChance_nonneg] + +lemma observation_startReward_le (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (J : ℕ → ℝ) (hJ : ∀ k, 0 ≤ J k) (k : ℕ) : + expect (before h r old x k) + (fun n => expect (observation h r k x n) (SignedRuns.startReward J k n)) ≤ + switchCost h r x k*J k := by + cases k with + | zero => + change (expect (delta old) fun _ => expect (initial h (r 0) x) (fun _ => J 0)) ≤ 1*J 0 + rw [FiniteLabels.expect_const,FiniteLabels.expect_const,one_mul] + | succ k => + change expect (marginal h r k x) (fun n => expect (row h (r (k+1)) x n) + (fun j => if j = n then 0 else J (k+1))) ≤ _ + have he (n : Label) : (fun j : Label => if j = n then (0:ℝ) else J (k+1)) = + fun j => J (k+1)*(if j = n then 0 else 1) := by funext j; split_ifs <;> simp + simp_rw [he,FiniteLabels.expect_mul] + rw [switchCost,mul_comm _ (J (k+1))] + apply mul_le_mul_of_nonneg_left _ (hJ _) + exact expect_mono _ (fun n => row_change_le_rate h (r (k+1)) x n) + +end ActualLabels + +namespace ActualLabels +open FiniteLabels Finset + +def boundaryCost (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (m k : ℕ) : ℝ := + switchCost h r x k+(if k=m then 1 else switchCost h r x (k+1)) + +lemma boundaryCost_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (m k : ℕ) : + 0 ≤ boundaryCost h r x m k := by + unfold boundaryCost + apply add_nonneg (switchCost_nonneg h r x k) + split_ifs + · exact zero_le_one + · exact switchCost_nonneg h r x (k+1) + +lemma observation_boundaryReward_le (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (J : ℕ → ℝ) (hJ : ∀ k, 0 ≤ J k) (k : ℕ) : + expect (before h r old x k) + (fun n => expect (observation h r k x n) (SignedRuns.boundaryReward J k n)) ≤ + (match k with | 0 => J 0 | l+1 => switchCost h r x (l+1)*(J l+J (l+1))) := by + cases k with + | zero => + change (expect (delta old) fun _ => expect (initial h (r 0) x) (fun _ => J 0)) ≤ J 0 + rw [FiniteLabels.expect_const,FiniteLabels.expect_const] + | succ k => + change expect (marginal h r k x) (fun n => expect (row h (r (k+1)) x n) + (fun j => if j = n then 0 else J k+J (k+1))) ≤ _ + have he (n : Label) : (fun j : Label => if j = n then (0:ℝ) else J k+J (k+1)) = + fun j => (J k+J (k+1))*(if j = n then 0 else 1) := by funext j; split_ifs <;> simp + simp_rw [he,FiniteLabels.expect_mul] + rw [switchCost,mul_comm _ (J k+J (k+1))] + apply mul_le_mul_of_nonneg_left _ (add_nonneg (hJ _) (hJ _)) + exact expect_mono _ (fun n => row_change_le_rate h (r (k+1)) x n) + +lemma boundary_reward_sum (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (J : ℕ → ℝ) (m : ℕ) : + (∑ k ∈ range (m+1), (match k with | 0 => J 0 | l+1 => switchCost h r x (l+1)*(J l+J (l+1))))+J m = + ∑ k ∈ range (m+1), boundaryCost h r x m k*J k := by + induction m with + | zero => simp [boundaryCost,switchCost]; ring + | succ m ih => + conv_lhs => rw [sum_range_succ] + conv_rhs => rw [sum_range_succ] + have he : (∑ k ∈ range (m+1), boundaryCost h r x (m+1) k*J k) = + (∑ k ∈ range (m+1), boundaryCost h r x m k*J k)+ + (switchCost h r x (m+1)-1)*J m := by + conv_lhs => rw [sum_range_succ] + conv_rhs => rw [sum_range_succ] + have hh : (∑ k ∈ range m, boundaryCost h r x (m+1) k*J k) = + ∑ k ∈ range m, boundaryCost h r x m k*J k := by + apply sum_congr rfl + intro k hk + have hk' := mem_range.mp hk + simp only [boundaryCost,ite_eq_right (by omega : k ≠ m+1),ite_eq_right (by omega : k ≠ m)] + rw [hh] + simp only [boundaryCost,ite_eq_right (by omega : m ≠ m+1),ite_true] + ring + rw [he,← ih] + simp only [boundaryCost,ite_true] + ring +end ActualLabels + +namespace SignedRuns +open ActualLabels FiniteLabels Finset + +lemma expected_start_sum_bound (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (J : ℕ → ℝ) (hJ : ∀ k, 0 ≤ J k) (m : ℕ) : + leafSum (fun q => weight h r old x q*((runs q).map fun a => J a.first).sum) (m+1) [] ≤ + ∑ k ∈ range (m+1), switchCost h r x k*J k := by + simp_rw [run_start_sum J old] + rw [leafSum_pathReward] + exact sum_le_sum (fun k _ => observation_startReward_le h r old x J hJ k) + +lemma expected_boundary_sum_bound (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (J : ℕ → ℝ) (hJ : ∀ k, 0 ≤ J k) (m : ℕ) : + leafSum (fun q => weight h r old x q*((runs q).map fun a => J a.first+J a.last).sum) (m+1) [] ≤ + ∑ k ∈ range (m+1), boundaryCost h r x m k*J k := by + have he := leafSum_congr + (fun q => weight h r old x q*((runs q).map fun a => J a.first+J a.last).sum) + (fun q => weight h r old x q*pathReward old (boundaryReward J) q+weight h r old x q*J m) + (m+1) [] (by + intro q hq + cases q with + | nil => simp at hq + | cons n p => + have hp : p.length = m := by simpa using hq + rw [run_boundary_sum J old, hp,mul_add]) + rw [he,leafSum_add,leafSum_pathReward,leafSum_mul_const,leafSum_weight,weight,one_mul] + rw [← boundary_reward_sum] + exact add_le_add (sum_le_sum (fun k _ => observation_boundaryReward_le h r old x J hJ k)) le_rfl + +lemma expected_span_sum (h : ℂ → ℂ) (r : ℕ → ℝ) (old : Label) (x : ℂ) + (H : ℕ → Label → ℝ) (m : ℕ) : + leafSum (fun q => weight h r old x q*((runs q).map fun a => ∑ k ∈ Icc a.first a.last, H k a.dir).sum) (m+1) [] = + ∑ k ∈ range (m+1), expect (marginal h r k x) (H k) := by + simp_rw [run_span_sum H old] + rw [leafSum_pathReward] + apply sum_congr rfl + intro k _ + rw [← expect_move,← before_move] + rfl + +end SignedRuns + +namespace PhysicalCells +open DyadicHats DirectionNeighbors CommonPrices Finset + +def gridIndex (r : ℝ) (y : ℂ) : ℤ × ℤ := (⌊y.re/r⌋,⌊y.im/r⌋) + +lemma toUnit_point_re (r : ℝ) (hr : r ≠ 0) (p : ℤ × ℤ) (y : ℂ) : + (toUnit (point r p) r y).re = y.re/r-p.1 := by + simp only [toUnit,Complex.smul_re,Complex.sub_re,point,smul_eq_mul] + field_simp + +lemma toUnit_point_im (r : ℝ) (hr : r ≠ 0) (p : ℤ × ℤ) (y : ℂ) : + (toUnit (point r p) r y).im = y.im/r-p.2 := by + simp only [toUnit,Complex.smul_im,Complex.sub_im,point,smul_eq_mul] + field_simp + +lemma mem_index_cell {r : ℝ} (hr : 0 < r) (y : ℂ) : + y ∈ cell (point r (gridIndex r y)) r := by + change (toUnit _ r y).re ∈ Set.Ico (0:ℝ) 1 ∧ (toUnit _ r y).im ∈ Set.Ico (0:ℝ) 1 + rw [toUnit_point_re r hr.ne',toUnit_point_im r hr.ne'] + refine ⟨⟨?_,?_⟩,⟨?_,?_⟩⟩ + · exact sub_nonneg.mpr (Int.floor_le _) + · dsimp only [gridIndex]; linarith [Int.lt_floor_add_one (y.re/r)] + · exact sub_nonneg.mpr (Int.floor_le _) + · dsimp only [gridIndex]; linarith [Int.lt_floor_add_one (y.im/r)] + +lemma cells_cover {r : ℝ} (hr : 0 < r) : (⋃ p : ℤ × ℤ, cell (point r p) r) = Set.univ := by + apply Set.eq_univ_of_forall + intro y + exact Set.mem_iUnion.mpr ⟨gridIndex r y,mem_index_cell hr y⟩ + +lemma mem_cell_box {r : ℝ} (hr : 0 < r) {p : ℤ × ℤ} {y : ℂ} + (hy : y ∈ cell (point r p) r) : boxNorm (y-point r p) ≤ r := by + change (toUnit _ r y).re ∈ Set.Ico (0:ℝ) 1 ∧ (toUnit _ r y).im ∈ Set.Ico (0:ℝ) 1 at hy + rw [toUnit_point_re r hr.ne',toUnit_point_im r hr.ne'] at hy + have h (a : ℝ) (b : ℤ) (hab : a/r-b ∈ Set.Ico (0:ℝ) 1) : |a-r*b| ≤ r := by + have hl : (b:ℝ) ≤ a/r := by linarith [hab.1] + have hu : a/r < (b:ℝ)+1 := by linarith [hab.2] + have hl' := (le_div_iff₀ hr).mp hl + have hu' := (div_lt_iff₀ hr).mp hu + apply abs_le.mpr + constructor <;> nlinarith + exact max_le (h y.re p.1 hy.1) (h y.im p.2 hy.2) + +lemma cell_subset_root_neighborhood {N : ℕ} {r : ℝ} (hr : 0 < r) + (p : ℤ × ℤ) (q : Grid N) (hq : q ∈ cellRoots N p) : + cell (point r p) r ⊆ neighborhood r q := by + intro y hy + have hqp : boxNorm (point r p-point r q) ≤ 20*r := by + rw [boxNorm_sub_comm] + exact (mem_window_iff hr 20 p q).mp (mem_filter.mp hq).2 + have hb := boxNorm_add_le (y-point r p) (point r p-point r q) + rw [sub_add_sub_cancel] at hb + have hc := mem_cell_box hr hy + change boxNorm (y-point r q) ≤ 25*r + linarith + +lemma lintegral_le_cells {r : ℝ} (hr : 0 < r) (F : ℂ → ℝ≥0∞) : + (∫⁻ y, F y) ≤ ∑' p : ℤ × ℤ, ∫⁻ y in cell (point r p) r, F y := by + have h := lintegral_iUnion_le (μ := (volume : Measure ℂ)) (fun p : ℤ × ℤ => cell (point r p) r) F + simpa only [cells_cover hr,Measure.restrict_univ] using h + +lemma tsum_ofReal_le {ι : Type*} (B : ι → ℝ) (hB : ∀ i, 0 ≤ B i) (A : ℝ) + (hbudget : ∀ s : Finset ι, ∑ i ∈ s, B i ≤ A) : + (∑' i, ENNReal.ofReal (B i)) ≤ ENNReal.ofReal A := by + rw [ENNReal.tsum_eq_iSup_sum] + apply iSup_le + intro s + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => hB i)] + exact ENNReal.ofReal_le_ofReal (hbudget s) + +/-- Global integration over the actual full lattice. The budget is tested on +arbitrary finite sets, so neither support cutoffs nor omitted cells enter. -/ +lemma integral_cell_budget {r : ℝ} (hr : 0 < r) (F : ℂ → ℝ≥0∞) + (B : (ℤ × ℤ) → ℝ) (hB : ∀ p, 0 ≤ B p) (A : ℝ) + (hcell : ∀ p, (∫⁻ y in cell (point r p) r, F y) ≤ ENNReal.ofReal (B p)) + (hbudget : ∀ s : Finset (ℤ × ℤ), ∑ p ∈ s, B p ≤ A) : + (∫⁻ y, F y) ≤ ENNReal.ofReal A := + (lintegral_le_cells hr F).trans ((ENNReal.tsum_le_tsum hcell).trans (tsum_ofReal_le B hB A hbudget)) + +end PhysicalCells + +namespace CommonPrices +open DyadicHats DirectionNeighbors Finset ConeCoordinates + +lemma cellRoots_budget {N : ℕ} (B : Grid N → ℝ) (hB : ∀ q, 0 ≤ B q) + (P : Finset (ℤ × ℤ)) : + (∑ p ∈ P, ∑ q ∈ cellRoots N p, B q) ≤ 1681*∑ q, B q := by + simp only [cellRoots,sum_filter] + rw [Finset.sum_comm,Finset.mul_sum] + apply sum_le_sum + intro q _ + have hs : P.filter (fun p => (q:ℤ×ℤ) ∈ window 20 p) ⊆ window 20 q := by + intro p hp + exact (mem_window_comm 20 _ _).mp (mem_filter.mp hp).2 + have hc : ((P.filter (fun p => (q:ℤ×ℤ) ∈ window 20 p)).card : ℝ) ≤ 1681 := by + have hc := Finset.card_le_card hs + rw [card_window] at hc + exact_mod_cast hc + rw [← sum_filter,sum_const,nsmul_eq_mul] + exact mul_le_mul_of_nonneg_right hc (hB q) + +lemma badPrice_nonneg {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) : + 0 ≤ badPrice h r k S n := sum_nonneg (fun _ _ => norm_nonneg _) + +lemma badPrice_le_rootMass {N : ℕ} (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (S : Finset (Grid N)) (n : ℂ) : + badPrice h r k S n ≤ rootMass h r k S := by + classical + exact sum_le_sum_of_subset_of_nonneg (filter_subset _ _) (fun _ _ _ => norm_nonneg _) +end CommonPrices + +namespace ActualLabels +open DyadicHats DirectionNeighbors FiniteLabels CommonPrices ConeCoordinates Finset + +lemma marginal_localSup_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (k : ℕ) (hr : 0 < r k) + (p : ℤ × ℤ) (n : Label) : 0 ≤ localSup (fun x => marginal h r k x n) (r k) p := + localSup_nonneg hr.le p (fun x => (marginal h r k x).nonneg n) (fun _ _ => law_le_one _ _) + +lemma marginal_localSup_le_one (h : ℂ → ℂ) (r : ℕ → ℝ) (k : ℕ) (hr : 0 < r k) + (p : ℤ × ℤ) (n : Label) : localSup (fun x => marginal h r k x n) (r k) p ≤ 1 := + localSup_le hr.le p (fun _ _ => law_le_one _ _) + +lemma marginal_localSup_bad_zero {N : ℕ} (h : ℂ → ℂ) (r : ℕ → ℝ) (k : ℕ) (hr : 0 < r k) + (p : ℤ × ℤ) (q : Grid N) (hq : q ∈ cellRoots N p) + (hE : energy h (r k) q ≤ (1/1000:ℝ)^2) (n : Label) + (hn : ¬Good (n:ℂ) (theta h (r k) q)) : localSup (fun x => marginal h r k x n) (r k) p = 0 := by + apply le_antisymm _ (marginal_localSup_nonneg h r k hr p n) + apply localSup_le hr.le p + intro y hy + have hqp : boxNorm (point (r k) p-point (r k) q) ≤ 20*r k := by + rw [boxNorm_sub_comm] + exact (mem_window_iff hr 20 p q).mp (mem_filter.mp hq).2 + have hb := boxNorm_add_le (y-point (r k) p) (point (r k) p-point (r k) q) + rw [sub_add_sub_cancel] at hb + have hy' : boxNorm (y-point (r k) p) ≤ 25*r k := hy + rw [marginal_bad_zero h r k hr q (by linarith) hE n hn] + +/-- The actual bad-root charge is paid by geometric energy, not a separately +assumed probability budget. -/ +lemma marginal_badPrice_bound {N : ℕ} (h : ℂ → ℂ) (r : ℕ → ℝ) (base : ℝ) + (k j : ℕ) (hr : 0 < r k) (hrj : r k = scale base j) (p : ℤ × ℤ) (n : Label) : + localSup (fun x => marginal h r k x n) (r k) p*badPrice h base j (cellRoots N p) n ≤ + 1000000*∑ q ∈ cellRoots N p, scalarMass h (r k) q*energy h (r k) q := by + classical + have hp0 := marginal_localSup_nonneg h r k hr p n + have hp1 := marginal_localSup_le_one h r k hr p n + unfold badPrice + rw [mul_sum] + calc + _ ≤ ∑ q ∈ badRoots h base j (cellRoots N p) n, + 1000000*(scalarMass h (r k) q*energy h (r k) q) := by + apply sum_le_sum + intro q hq + have hqp := (mem_filter.mp hq).1 + have hbad : ¬Good (n:ℂ) (theta h (r k) q) := by + simpa only [hrj] using (mem_filter.mp hq).2 + rw [← hrj] + by_cases hE : energy h (r k) q ≤ (1/1000:ℝ)^2 + · rw [marginal_localSup_bad_zero h r k hr p q hqp hE n hbad,zero_mul] + exact mul_nonneg (by norm_num) (mul_nonneg (norm_nonneg _) (energy_nonneg _ _ _)) + · have he : 1 ≤ 1000000*energy h (r k) q := by norm_num at hE; linarith + have hb := mul_le_mul_of_nonneg_right hp1 (norm_nonneg (vectorMass h (r k) q)) + have hc := mul_le_mul_of_nonneg_right he (norm_nonneg (vectorMass h (r k) q)) + dsimp only [scalarMass] at ⊢ + nlinarith + _ ≤ _ := by + rw [mul_sum] + exact sum_le_sum_of_subset_of_nonneg (filter_subset _ _) (fun q _ _ => + mul_nonneg (by norm_num) (mul_nonneg (norm_nonneg _) (energy_nonneg _ _ _))) +end ActualLabels + +namespace PhysicalCells +open DyadicHats Finset + +/-- Measurable full-lattice patch; no choice of maximizing radius occurs. -/ +def patch (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (x : ℂ) : ℝ≥0∞ := + ∑' p, (cell (point r p) r).indicator (F p) x + +lemma patch_measurable (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (hF : ∀ p, Measurable (F p)) : + Measurable (patch r F) := + Measurable.tsum (fun p => (hF p).indicator (cell_measurable _ _)) + +lemma le_patch (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (p : ℤ × ℤ) {x : ℂ} + (hx : x ∈ cell (point r p) r) : F p x ≤ patch r F x := by + have he := ENNReal.le_tsum (f := fun q => (cell (point r q) r).indicator (F q) x) p + simpa only [patch,Set.indicator_of_mem hx] using he + +lemma lintegral_patch (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (hF : ∀ p, Measurable (F p)) : + (∫⁻ x, patch r F x) = ∑' p, ∫⁻ x in cell (point r p) r, F p x := by + simp only [patch] + rw [lintegral_tsum (f := fun p x => (cell (point r p) r).indicator (F p) x) (fun p => ((hF p).indicator (cell_measurable _ _)).aemeasurable)] + simp_rw [lintegral_indicator (cell_measurable _ _)] + +lemma lintegral_patch_budget (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (hF : ∀ p, Measurable (F p)) + (B : (ℤ × ℤ) → ℝ) (hB : ∀ p, 0 ≤ B p) (A : ℝ) + (hcell : ∀ p, (∫⁻ x in cell (point r p) r, F p x) ≤ ENNReal.ofReal (B p)) + (hbudget : ∀ P : Finset (ℤ × ℤ), ∑ p ∈ P, B p ≤ A) : + (∫⁻ x, patch r F x) ≤ ENNReal.ofReal A := by + rw [lintegral_patch r F hF] + exact (ENNReal.tsum_le_tsum hcell).trans (tsum_ofReal_le B hB A hbudget) + +lemma patch_finite (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (hF : ∀ p, Measurable (F p)) + {A : ℝ} (hi : (∫⁻ x, patch r F x) ≤ ENNReal.ofReal A) : + ∀ᵐ x, patch r F x ≠ ⊤ := by + exact (ae_lt_top (patch_measurable r F hF) (ne_top_of_le_ne_top ENNReal.ofReal_ne_top hi)).mono + (fun _ hx => hx.ne) + +lemma patch_integrable (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (hF : ∀ p, Measurable (F p)) + {A : ℝ} (hi : (∫⁻ x, patch r F x) ≤ ENNReal.ofReal A) : + Integrable (fun x => (patch r F x).toReal) := + integrable_toReal_of_lintegral_ne_top (patch_measurable r F hF).aemeasurable + (ne_top_of_le_ne_top ENNReal.ofReal_ne_top hi) + +lemma real_le_patch {r : ℝ} (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (p : ℤ × ℤ) {x : ℂ} + (hx : x ∈ cell (point r p) r) (hf : patch r F x ≠ ⊤) {a : ℝ} + (hb : ENNReal.ofReal a ≤ F p x) : a ≤ (patch r F x).toReal := by + exact (le_max_left a 0).trans (by + rw [← ENNReal.toReal_ofReal'] + exact (ENNReal.toReal_le_toReal ENNReal.ofReal_ne_top hf).mpr (hb.trans (le_patch r F p hx))) + +/-- Take the cell supremum of a weight only after the local price has been +proved. This is the common production rule for all three spatial budgets. -/ +lemma weighted_patch_bound (r : ℝ) (F : (ℤ × ℤ) → ℂ → ℝ≥0∞) (hF : ∀ p, Measurable (F p)) + (W : ℂ → ℝ≥0∞) (hW : Measurable W) (A B : (ℤ × ℤ) → ℝ) + (hA : ∀ p, 0 ≤ A p) (_hB : ∀ p, 0 ≤ B p) + (hcell : ∀ p, (∫⁻ x in cell (point r p) r, F p x) ≤ ENNReal.ofReal (B p)) + (hWB : ∀ p x, x ∈ cell (point r p) r → W x ≤ ENNReal.ofReal (A p)) : + (∫⁻ x, W x*patch r F x) ≤ ∑' p, ENNReal.ofReal (A p*B p) := by + simp only [patch,← ENNReal.tsum_mul_left] + rw [lintegral_tsum (f := fun p x => W x*(cell (point r p) r).indicator (F p) x) (fun p => (hW.mul ((hF p).indicator (cell_measurable _ _))).aemeasurable)] + apply ENNReal.tsum_le_tsum + intro p + have he : (fun x => W x*(cell (point r p) r).indicator (F p) x) = + (cell (point r p) r).indicator (fun x => W x*F p x) := by + funext x + by_cases hx : x ∈ cell (point r p) r <;> simp [hx] + rw [he,lintegral_indicator (cell_measurable _ _)] + calc + _ ≤ ∫⁻ x in cell (point r p) r, ENNReal.ofReal (A p)*F p x := by + apply lintegral_mono_ae + filter_upwards [ae_restrict_mem (cell_measurable (point r p) r)] with x hx + exact mul_le_mul' (hWB p x hx) le_rfl + _ = ENNReal.ofReal (A p)*(∫⁻ x in cell (point r p) r, F p x) := + lintegral_const_mul _ (hF p) + _ ≤ ENNReal.ofReal (A p)*ENNReal.ofReal (B p) := mul_le_mul' le_rfl (hcell p) + _ = _ := (ENNReal.ofReal_mul (hA p)).symm +end PhysicalCells + +namespace ActualLabels +open DyadicHats FiniteLabels GeometricFilter Finset + +/-- Global geometric extension of the finite descending radius grid. -/ +def geometricRadii (base : ℝ) (m : ℕ) (k : ℕ) : ℝ := scale base m/(2:ℝ)^k +lemma geometricRadii_pos {base : ℝ} (hb : 0 < base) (m k : ℕ) : + 0 < geometricRadii base m k := div_pos (scale_pos hb m) (by positivity) +lemma geometricRadii_step (base : ℝ) (m k : ℕ) : + 2*geometricRadii base m (k+1) = geometricRadii base m k := by + unfold geometricRadii + rw [pow_succ] + field_simp +lemma geometricRadii_eq (base : ℝ) {m k : ℕ} (hk : k ≤ m) : + geometricRadii base m k = scale base (m-k) := by + unfold geometricRadii scale + rw [show m = (m-k)+k by omega,pow_add] + field_simp + rw [show m-k+k-k = m-k by omega] + ring + +lemma marginal_congr (h : ℂ → ℂ) (r s : ℕ → ℝ) (k : ℕ) + (hrs : ∀ i, i ≤ k → r i = s i) (x : ℂ) : marginal h r k x = marginal h s k x := by + induction k with + | zero => simp only [marginal,hrs 0 le_rfl] + | succ k ih => + simp only [marginal,hrs (k+1) le_rfl,ih (fun i hi => hrs i (by omega))] + +lemma switchCost_congr (h : ℂ → ℂ) (r s : ℕ → ℝ) (k : ℕ) + (hrs : ∀ i, i ≤ k → r i = s i) (x : ℂ) : switchCost h r x k = switchCost h s x k := by + cases k with + | zero => rfl + | succ k => + simp only [switchCost,hrs (k+1) le_rfl,marginal_congr h r s k (fun i hi => hrs i (by omega)) x] + +lemma derivativeCost_congr (h : ℂ → ℂ) (r s : ℕ → ℝ) (k : ℕ) + (hrs : ∀ i, i ≤ k → r i = s i) (x : ℂ) : derivativeCost h r x k = derivativeCost h s x k := by + cases k with + | zero => simp only [derivativeCost,hrs 0 le_rfl] + | succ k => + simp only [derivativeCost,hrs (k+1) le_rfl,marginal_congr h r s k (fun i hi => hrs i (by omega)) x] + +lemma cellCost_congr (h : ℂ → ℂ) (r s : ℕ → ℝ) (m l : ℕ) (hl : l ≤ m) + (hrs : ∀ i, i ≤ m → r i = s i) (q : ℤ × ℤ) : cellCost h r m l q = cellCost h s m l q := by + have hsw (i : ℕ) (hi : i ≤ m) : (fun x => switchCost h r x i) = fun x => switchCost h s x i := by + funext x + exact switchCost_congr h r s i (fun j hj => hrs j (by omega)) x + have hdc (i : ℕ) (hi : i ≤ m) : (fun x => derivativeCost h r x i) = fun x => derivativeCost h s x i := by + funext x + exact derivativeCost_congr h r s i (fun j hj => hrs j (by omega)) x + unfold cellCost + rw [hrs l hl,hsw l hl] + congr 1 + · split_ifs with he + · rfl + · rw [hsw (l+1) (by omega)] + · rw [filt_sum,filt_sum] + apply sum_congr rfl + intro i hi + rw [hdc i (by have := mem_range.mp hi; omega)] +end ActualLabels + +namespace SignedRuns +open ActualLabels FiniteLabels Finset DiskMoments PhysicalCells SignedAssembly + +lemma run_cone_bound {g : ℂ → ℝ} {r : ℕ → ℝ} + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (H : ℕ → Label → ℝ) (J : ℕ → ℝ) (hH : ∀ k n, 0 ≤ H k n) (hJ : ∀ k, 0 ≤ J k) + (x : ℂ) (n : Label) (p : List Label) + (hd : ∀ i j, i ≤ j → DifferentiableAt ℝ (runEnvelope g r i j) x) + (hinterior : ∀ k n t, PhysicalNeighborhoodRadius g (r k) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H k n) + (hend : ∀ k t, PhysicalEndpointRadius g (r k) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J k) : + ((runs (n::p)).map fun a => coneContribution a.dir (gradient (runEnvelope g r a.first a.last) x)).sum ≤ + divergence (fun y => potential g r y (n::p)) x+ + ((runs (n::p)).map fun a => J a.first).sum+ + ((runs (n::p)).map fun a => ∑ k ∈ Icc a.first a.last, H k a.dir).sum+ + 2*((runs (n::p)).map fun a => J a.first+J a.last).sum := by + rw [potential_divergence hg hc hr (n::p) x hd] + rw [← List.sum_map_mul_left,← List.sum_map_add,← List.sum_map_add,← List.sum_map_add] + apply List.sum_le_sum + intro a ha + have hab := runs_bounds n p a ha + have hu := run_unfavorable_bound hg hc hr hstep H J hH hJ x a.dir hab.1 + (hd _ _ hab.1) (hinterior · a.dir ·) hend + have hb := hend a.first (r a.first) ⟨⟨le_rfl,by linarith [hr a.first]⟩,Or.inl rfl⟩ + have hi := real_inner_le_norm (a.dir:ℂ) (gradient (fun y => signedAverage g y (r a.first)) x) + rw [label_unit,one_mul] at hi + simp only [inner_sub_right] + unfold coneContribution unfavorable at * + linarith + +/-- Complete pointwise signed assembly, still retaining the divergence term. +The remaining terms are exactly the direct directional and boundary costs. -/ +theorem pointwise_signed_master {g : ℂ → ℝ} (h : ℂ → ℂ) {r : ℕ → ℝ} + (hg : ContDiff ℝ 1 g) (hc : HasCompactSupport g) + (hr : ∀ k, 0 < r k) (hstep : ∀ k, 2*r (k+1) = r k) + (H : ℕ → Label → ℝ) (J : ℕ → ℝ) (hH : ∀ k n, 0 ≤ H k n) (hJ : ∀ k, 0 ≤ J k) + (old : Label) (m : ℕ) (x : ℂ) + (hd : ∀ i j, i ≤ j → DifferentiableAt ℝ (runEnvelope g r i j) x) + (hinterior : ∀ k n t, PhysicalNeighborhoodRadius g (r k) x t → + unfavorable n (gradient (fun y => signedAverage g y t) x) ≤ H k n) + (hend : ∀ k t, PhysicalEndpointRadius g (r k) x t → + ‖gradient (fun y => signedAverage g y t) x‖ ≤ J k) : + ‖gradient (runEnvelope g r 0 m) x‖ ≤ 12*( + leafSum (fun q => weight h r old x q*divergence (fun y => potential g r y q) x) (m+1) []+ + (∑ k ∈ range (m+1), expect (marginal h r k x) (H k))+ + 3*(∑ k ∈ range (m+1), boundaryCost h r x m k*J k)) := by + have hh := leafSum_mono + (fun q => weight h r old x q*((runs q).map fun a => coneContribution a.dir + (gradient (runEnvelope g r a.first a.last) x)).sum) + (fun q => weight h r old x q*divergence (fun y => potential g r y q) x+ + weight h r old x q*((runs q).map fun a => J a.first).sum+ + weight h r old x q*((runs q).map fun a => ∑ k ∈ Icc a.first a.last, H k a.dir).sum+ + 2*(weight h r old x q*((runs q).map fun a => J a.first+J a.last).sum)) (m+1) [] (by + intro q hq + cases q with + | nil => simp at hq + | cons n p => + have hh := mul_le_mul_of_nonneg_left + (run_cone_bound hg hc hr hstep H J hH hJ x n p hd hinterior hend) + (weight_nonneg h r old x (n::p)) + nlinarith only [hh]) + rw [leafSum_add,leafSum_add,leafSum_add,leafSum_const_mul,expected_span_sum] at hh + have hb := expected_boundary_sum_bound h r old x J hJ m + have hs := expected_start_sum_bound h r old x J hJ m + have hsb : (∑ k ∈ range (m+1), switchCost h r x k*J k) ≤ + ∑ k ∈ range (m+1), boundaryCost h r x m k*J k := by + apply sum_le_sum + intro k _ + apply mul_le_mul_of_nonneg_right _ (hJ k) + unfold boundaryCost + have hn : 0 ≤ if k=m then (1:ℝ) else switchCost h r x (k+1) := by + split_ifs + · exact zero_le_one + · exact switchCost_nonneg h r x (k+1) + linarith + have hm := expected_run_master g h r hg hc hr hstep old m x hd + linarith +end SignedRuns + +namespace PhysicalCells +open DyadicHats +lemma center_mem_cell (p : ℂ) (r : ℝ) : p ∈ cell p r := by + simp [cell,toUnit,unitCell] +noncomputable def cellSup (f : ℂ → ℝ) (r : ℝ) (p : ℤ × ℤ) : ℝ := + sSup (f '' cell (point r p) r) +lemma cellSup_le {f : ℂ → ℝ} {r A : ℝ} (p : ℤ × ℤ) + (h : ∀ x ∈ cell (point r p) r, f x ≤ A) : cellSup f r p ≤ A := by + apply csSup_le (Set.Nonempty.image f ⟨point r p,center_mem_cell _ _⟩) + rintro z ⟨x,hx,rfl⟩ + exact h x hx +lemma le_cellSup {f : ℂ → ℝ} {r A : ℝ} (p : ℤ × ℤ) + (h : ∀ x ∈ cell (point r p) r, f x ≤ A) {x : ℂ} (hx : x ∈ cell (point r p) r) : + f x ≤ cellSup f r p := le_csSup ⟨A,by rintro z ⟨y,hy,rfl⟩; exact h y hy⟩ ⟨x,hx,rfl⟩ +lemma cellSup_nonneg {f : ℂ → ℝ} {r A : ℝ} (p : ℤ × ℤ) + (h0 : ∀ x, 0 ≤ f x) (h : ∀ x ∈ cell (point r p) r, f x ≤ A) : 0 ≤ cellSup f r p := + (h0 (point r p)).trans (le_cellSup p h (center_mem_cell _ _)) +end PhysicalCells + +namespace ActualLabels +open DyadicHats GeometricFilter PhysicalCells CommonPrices DirectionNeighbors FiniteLabels Finset + +def pointCost (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (m k : ℕ) : ℝ := + boundaryCost h r x m k+filt (fun i => derivativeCost h r x i) k + +def costLimit : ℝ := 2+32*(Fintype.card Label:ℝ) +lemma costLimit_pos : 0 < costLimit := by dsimp [costLimit]; positivity +lemma pointCost_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (x : ℂ) (m k : ℕ) : + 0 ≤ pointCost h r x m k := add_nonneg (boundaryCost_nonneg h r x m k) + (filt_nonneg (fun i => derivativeCost_nonneg h r x i (hr i).le) k) +lemma pointCost_le (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) (x : ℂ) (m k : ℕ) : + pointCost h r x m k ≤ costLimit := by + have hs0 := switchCost_le_one h r x k + have hs1 := switchCost_le_one h r x (k+1) + have ht := filt_le (by positivity : (0:ℝ) ≤ 16*(Fintype.card Label:ℝ)) + (fun i => derivativeCost_uniform h r x i (hr i)) k + dsimp [pointCost,boundaryCost,costLimit] + split_ifs <;> linarith + +lemma pointCost_le_cellCost (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) + (m k : ℕ) (q : ℤ × ℤ) (x : ℂ) (hx : x ∈ neighborhood (r k) q) : + pointCost h r x m k ≤ cellCost h r m k q := by + have hs (i : ℕ) : switchCost h r x i ≤ localSup (fun y => switchCost h r y i) (r k) q := + le_localSup q (fun y _ => switchCost_le_one h r y i) hx + have ht (i : ℕ) : derivativeCost h r x i ≤ localSup (fun y => derivativeCost h r y i) (r k) q := + le_localSup q (fun y _ => derivativeCost_uniform h r y i (hr i)) hx + have hf := filt_mono ht k + dsimp [pointCost,boundaryCost,cellCost] + split_ifs <;> linarith [hs k,hs (k+1)] + +lemma cellSup_pointCost_le {N : ℕ} (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) + (m k : ℕ) (p : ℤ × ℤ) (q : Grid N) (hq : q ∈ cellRoots N p) : + cellSup (fun x => pointCost h r x m k) (r k) p ≤ cellCost h r m k q := by + apply cellSup_le p + intro x hx + exact pointCost_le_cellCost h r hr m k q x (cell_subset_root_neighborhood (hr k) p q hq hx) + +lemma cellSup_pointCost_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) + (m k : ℕ) (p : ℤ × ℤ) : 0 ≤ cellSup (fun x => pointCost h r x m k) (r k) p := + cellSup_nonneg p (fun x => pointCost_nonneg h r hr x m k) (fun x _ => pointCost_le h r hr x m k) +lemma cellSup_pointCost_uniform (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) + (m k : ℕ) (p : ℤ × ℤ) : cellSup (fun x => pointCost h r x m k) (r k) p ≤ costLimit := + cellSup_le p (fun x _ => pointCost_le h r hr x m k) + +lemma pointCost_cell_budget {N : ℕ} (h : ℂ → ℂ) (r : ℕ → ℝ) (hr : ∀ i, 0 < r i) + (base : ℝ) (m k j : ℕ) (hrj : r k = scale base j) (P : Finset (ℤ × ℤ)) : + (∑ p ∈ P, cellSup (fun x => pointCost h r x m k) (r k) p* + rootMass h base j (cellRoots N p)) ≤ + 1681*∑ q : Grid N, scalarMass h (r k) q*cellCost h r m k q := by + calc + _ ≤ ∑ p ∈ P, ∑ q ∈ cellRoots N p, scalarMass h (r k) q*cellCost h r m k q := by + apply sum_le_sum + intro p _ + unfold rootMass + rw [mul_sum] + apply sum_le_sum + intro q hq + rw [← hrj,mul_comm] + exact mul_le_mul_of_nonneg_left (cellSup_pointCost_le h r hr m k p q hq) (norm_nonneg _) + _ ≤ _ := cellRoots_budget _ (fun q => mul_nonneg (norm_nonneg _) (cellCost_nonneg h r hr m k q)) P +end ActualLabels + +namespace CommonPrices +open DyadicHats ConeCoordinates Finset + +def priceConstant : ℝ := 1681*((fixedPalette.labels.card:ℝ)*2/(1-rho)) +lemma priceConstant_nonneg : 0 ≤ priceConstant := by + unfold priceConstant + exact mul_nonneg (by norm_num) (div_nonneg (by positivity) (by linarith [rho_lt_one])) +lemma cellPrice_nonneg {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (S : Finset (Grid N)) : + 0 ≤ cellPrice N r h k S := sum_nonneg (fun q _ => rootPrice_nonneg hr hR hN hh hsupp k q) +lemma rootMass_cell_budget {N : ℕ} {h : ℂ → ℂ} (hh : Integrable h) (r : ℝ) + (k : ℕ) (P : Finset (ℤ × ℤ)) : + (∑ p ∈ P, rootMass h r k (cellRoots N p)) ≤ 1681*(∫ y, ‖h y‖) := by + exact (cellRoots_budget _ (fun q => norm_nonneg (vectorMass h (scale r k) q)) P).trans + (mul_le_mul_of_nonneg_left (sum_scalarMass_grid_le hh _) (by norm_num)) +end CommonPrices + +namespace ActualLabels +open DyadicHats GeometricFilter PhysicalCells CommonPrices DirectionNeighbors FiniteLabels Finset ActualMarkTrees + +lemma geometricRadii_reverse (base : ℝ) {m j : ℕ} (hj : j ≤ m) : + geometricRadii base m (m-j) = scale base j := by + rw [geometricRadii_eq base (Nat.sub_le m j),Nat.sub_sub_self hj] + +lemma pointCost_mass_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) : + (∑ j ∈ range (m+1), ∑ p ∈ P j, + cellSup (fun x => pointCost h (geometricRadii base m) x m (m-j)) (scale base j) p* + rootMass h base j (cellRoots N p)) ≤ 1681*packingConstant*(∫ y, ‖h y‖) := by + have he : (∑ j ∈ range (m+1), ∑ q : Grid N, scalarMass h (scale base j) q* + cellCost h (geometricRadii base m) m (m-j) q) = + ∑ j ∈ range (m+1), ∑ q : Grid N, scalarMass h (scale base j) q* + cellCost h (fun i => scale base (m-i)) m (m-j) q := by + apply sum_congr rfl + intro j _ + apply sum_congr rfl + intro q _ + rw [cellCost_congr h _ _ m (m-j) (Nat.sub_le m j) + (fun i hi => geometricRadii_eq base hi)] + calc + _ ≤ ∑ j ∈ range (m+1), 1681*∑ q : Grid N, scalarMass h (scale base j) q* + cellCost h (geometricRadii base m) m (m-j) q := by + apply sum_le_sum + intro j hj + have hjm : j ≤ m := by have := mem_range.mp hj; omega + have ht := pointCost_cell_budget (N := N) h (geometricRadii base m) (geometricRadii_pos hb m) + base m (m-j) j (geometricRadii_reverse base hjm) (P j) + simpa only [geometricRadii_reverse base hjm] using ht + _ = 1681*(∑ j ∈ range (m+1), ∑ q : Grid N, scalarMass h (scale base j) q* + cellCost h (geometricRadii base m) m (m-j) q) := by rw [mul_sum] + _ ≤ _ := by + rw [he,mul_assoc] + exact mul_le_mul_of_nonneg_left (spatial_packing hb hR hN hh hsupp m) (by norm_num) + +lemma pointCost_price_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) : + (∑ j ∈ range (m+1), ∑ p ∈ P j, + cellSup (fun x => pointCost h (geometricRadii base m) x m (m-j)) (scale base j) p* + cellPrice N base h j (cellRoots N p)) ≤ costLimit*priceConstant*(∫ y, ‖h y‖) := by + calc + _ ≤ ∑ j ∈ range (m+1), ∑ p ∈ P j, costLimit*cellPrice N base h j (cellRoots N p) := by + apply sum_le_sum + intro j hj + have hjm : j ≤ m := by have := mem_range.mp hj; omega + apply sum_le_sum + intro p _ + apply mul_le_mul_of_nonneg_right _ (cellPrice_nonneg hb hR hN hh hsupp j _) + rw [← geometricRadii_reverse base hjm] + exact cellSup_pointCost_uniform h _ (geometricRadii_pos hb m) m (m-j) p + _ = costLimit*(∑ j ∈ range (m+1), ∑ p ∈ P j, cellPrice N base h j (cellRoots N p)) := by + simp only [mul_sum] + _ ≤ _ := by + rw [mul_assoc] + exact mul_le_mul_of_nonneg_left (cellPrice_budget hb hR hN hh hsupp m P) costLimit_pos.le + +lemma marginal_bad_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) (n : Label) : + (∑ j ∈ range (m+1), ∑ p ∈ P j, + localSup (fun x => marginal h (geometricRadii base m) (m-j) x n) (scale base j) p* + badPrice h base j (cellRoots N p) n) ≤ + (1000000*1681*(576*(4097:ℝ)^2))*(∫ y, ‖h y‖) := by + calc + _ ≤ ∑ j ∈ range (m+1), 1000000*1681*∑ q : Grid N, + scalarMass h (scale base j) q*energy h (scale base j) q := by + apply sum_le_sum + intro j hj + have hjm : j ≤ m := by have := mem_range.mp hj; omega + calc + _ ≤ ∑ p ∈ P j, 1000000*∑ q ∈ cellRoots N p, + scalarMass h (scale base j) q*energy h (scale base j) q := by + apply sum_le_sum + intro p _ + have ht := marginal_badPrice_bound (N := N) h (geometricRadii base m) base (m-j) j + (geometricRadii_pos hb m (m-j)) (geometricRadii_reverse base hjm) p n + simpa only [geometricRadii_reverse base hjm] using ht + _ ≤ _ := by + rw [← mul_sum,mul_assoc] + exact mul_le_mul_of_nonneg_left (cellRoots_budget _ + (fun q => mul_nonneg (norm_nonneg _) (energy_nonneg _ _ _)) (P j)) (by norm_num) + _ ≤ _ := by + rw [← mul_sum] + have ht := mul_le_mul_of_nonneg_left (neighbor_energy_budget hb hR hN hh hsupp (m+1)) + (by norm_num : (0:ℝ) ≤ 1000000*1681) + nlinarith only [ht] + +lemma marginal_price_budget {N : ℕ} {base R : ℝ} (hb : 0 < base) (hR : 0 ≤ R) + (hN : R/base+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (m : ℕ) (P : ℕ → Finset (ℤ × ℤ)) (n : Label) : + (∑ j ∈ range (m+1), ∑ p ∈ P j, + localSup (fun x => marginal h (geometricRadii base m) (m-j) x n) (scale base j) p* + cellPrice N base h j (cellRoots N p)) ≤ priceConstant*(∫ y, ‖h y‖) := by + apply le_trans _ (cellPrice_budget hb hR hN hh hsupp m P) + apply sum_le_sum + intro j hj + have hjm : j ≤ m := by have := mem_range.mp hj; omega + apply sum_le_sum + intro p _ + have hbnd : localSup (fun x => marginal h (geometricRadii base m) (m-j) x n) (scale base j) p ≤ 1 := by + rw [← geometricRadii_reverse base hjm] + exact marginal_localSup_le_one h _ (m-j) (geometricRadii_pos hb m (m-j)) p n + simpa only [one_mul] using mul_le_mul_of_nonneg_right hbnd (cellPrice_nonneg hb hR hN hh hsupp j _) +end ActualLabels + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/SpatialLaws.lean b/lean/OAI/Analysis/DiskMaximal/SpatialLaws.lean new file mode 100644 index 0000000000000000000000000000000000000000..c6556f80676b6bfd6961dbb647da6f550094f365 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/SpatialLaws.lean @@ -0,0 +1,754 @@ +import OAI.Analysis.DiskMaximal.Prices + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace FiniteLabels +open DyadicHats +variable {ι : Type*} [Fintype ι] [DecidableEq ι] + +lemma spatialRow_mixture (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (r : ℝ) (x : ℂ) (j : ι) : + spatialRow old target p hp0 hp1 r x j = + interpolate r (fun z => (1-p z)*delta old j+p z*delta (target z) j) x := by + have he (z : ℤ × ℤ) : (1-p z)*delta old j+p z*delta (target z) j = + delta old j+p z*(delta (target z) j-delta old j) := by ring + simp_rw [he] + rw [interpolate_add,interpolate_const] + rfl + +lemma spatialRow_vanish (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (r : ℝ) (x : ℂ) (j : ι) + (hj : ∀ z, hat r z x ≠ 0 → (1-p z)*delta old j+p z*delta (target z) j = 0) : + spatialRow old target p hp0 hp1 r x j = 0 := by + rw [spatialRow_mixture] + have he : interpolate r (fun z => (1-p z)*delta old j+p z*delta (target z) j) x = + interpolate r (fun _ => 0) x := interpolate_congr_on r x hj + rw [he,interpolate_const] + +end FiniteLabels + +namespace ActualLabels +open FiniteLabels ConeCoordinates DirectionNeighbors DyadicHats + +abbrev Label := {n : ℂ // n ∈ fixedPalette.labels} +instance : Fintype Label := Finset.fintypeCoeSort fixedPalette.labels +instance : DecidableEq Label := Classical.decEq _ + +lemma label_unit (n : Label) : ‖(n:ℂ)‖ = 1 := fixedPalette.unit n n.property + +def target (h : ℂ → ℂ) (r : ℝ) (z : ℤ × ℤ) : Label := + quantize (Theta h r z) (norm_theta h r (chosen h r z)) +lemma target_close (h : ℂ → ℂ) (r : ℝ) (z : ℤ × ℤ) : + ‖Theta h r z-(target h r z:ℂ)‖ < 1/2000 := quantize_close _ _ + +def switchChance (h : ℂ → ℂ) (r : ℝ) (n : Label) (z : ℤ × ℤ) : ℝ := + probability (1/100) ‖(n:ℂ)-Theta h r z‖ +lemma switchChance_nonneg (h : ℂ → ℂ) (r : ℝ) (n : Label) (z : ℤ × ℤ) : + 0 ≤ switchChance h r n z := probability_nonneg _ _ +lemma switchChance_le_one (h : ℂ → ℂ) (r : ℝ) (n : Label) (z : ℤ × ℤ) : + switchChance h r n z ≤ 1 := probability_le_one _ _ + +def row (h : ℂ → ℂ) (r : ℝ) (x : ℂ) (n : Label) : Law Label := + spatialRow n (target h r) (switchChance h r n) (switchChance_nonneg h r n) + (switchChance_le_one h r n) r x + +def initial (h : ℂ → ℂ) (r : ℝ) (x : ℂ) : Law Label := + spatialRow (quantize 1 (by norm_num)) (target h r) (fun _ => 1) + (fun _ => zero_le_one) (fun _ => le_rfl) r x + +lemma nearby_sample_close {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) (z : ℤ × ℤ) (hz : hat r z x ≠ 0) : + ‖Theta h r z-theta h r q‖ ≤ 1/1000 := by + have hloc : boxNorm (point r z-point r q) ≤ 200*r := + hat_vertex_local hr (by linarith) hz + have he := energy_controls hr h q z hloc + nlinarith [norm_nonneg (Theta h r z-theta h r q)] + +lemma sampled_good {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) (z : ℤ × ℤ) (hz : hat r z x ≠ 0) : + Good (target h r z) (theta h r q) := by + apply good_of_close (label_unit _) + have he := nearby_sample_close hr h q hx hE z hz + have ht := target_close h r z + have hn : ‖theta h r q-(target h r z:ℂ)‖ ≤ ‖theta h r q-Theta h r z‖+‖Theta h r z-(target h r z:ℂ)‖ := by + simpa only [dist_eq_norm] using dist_triangle (theta h r q) (Theta h r z) (target h r z:ℂ) + have he' : ‖theta h r q-Theta h r z‖ ≤ 1/1000 := by simpa only [norm_sub_rev] using he + linarith + +lemma retained_good {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) (z : ℤ × ℤ) (hz : hat r z x ≠ 0) + (n : Label) (hp : switchChance h r n z < 1) : Good (n:ℂ) (theta h r q) := by + have hd := (probability_lt_one_iff (by norm_num : (0:ℝ)<1/100)).mp hp + have he := nearby_sample_close hr h q hx hE z hz + apply good_of_close (label_unit n) + have hn : ‖theta h r q-(n:ℂ)‖ ≤ ‖theta h r q-Theta h r z‖+‖Theta h r z-(n:ℂ)‖ := by + simpa only [dist_eq_norm] using dist_triangle (theta h r q) (Theta h r z) (n:ℂ) + have he' : ‖theta h r q-Theta h r z‖ ≤ 1/1000 := by simpa only [norm_sub_rev] using he + have hd' : ‖Theta h r z-(n:ℂ)‖ < 2*(1/100:ℝ) := by simpa only [norm_sub_rev] using hd + linarith + +lemma initial_bad_zero {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) (n : Label) + (hn : ¬Good (n:ℂ) (theta h r q)) : initial h r x n = 0 := by + apply spatialRow_vanish + intro z hz + have ht : n ≠ target h r z := fun ht => hn (ht ▸ sampled_good hr h q hx hE z hz) + simp [delta,ht] + +lemma row_bad_zero {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) (old n : Label) + (hn : ¬Good (n:ℂ) (theta h r q)) : row h r x old n = 0 := by + apply spatialRow_vanish + intro z hz + have ht : n ≠ target h r z := fun ht => hn (ht ▸ sampled_good hr h q hx hE z hz) + by_cases ho : n = old + · subst n + have hp : switchChance h r old z = 1 := le_antisymm (switchChance_le_one h r old z) + (le_of_not_gt (fun hp => hn (retained_good hr h q hx hE z hz old hp))) + simp [hp,delta,ht] + · simp [delta,ho,ht] + +/-- The actual finite-state label marginal, with its scale-dependent spatial +rows. This definition introduces no geometric or probabilistic hypothesis. -/ +def marginal (h : ℂ → ℂ) (r : ℕ → ℝ) : ℕ → ℂ → Law Label + | 0,x => initial h (r 0) x + | k+1,x => move (marginal h r k x) (row h (r (k+1)) x) + +theorem marginal_bad_zero (h : ℂ → ℂ) (r : ℕ → ℝ) (k : ℕ) (hr : 0 < r k) + (q : ℤ × ℤ) {x : ℂ} (hx : boxNorm (x-point (r k) q) ≤ 50*r k) + (hE : energy h (r k) q ≤ (1/1000:ℝ)^2) (n : Label) + (hn : ¬Good (n:ℂ) (theta h (r k) q)) : marginal h r k x n = 0 := by + cases k with + | zero => exact initial_bad_zero hr h q hx hE n hn + | succ k => + simp only [marginal,move_apply,row_bad_zero hr h q hx hE _ n hn,mul_zero,Finset.sum_const_zero] + +end ActualLabels + +namespace FiniteLabels +open DyadicHats Finset +variable {ι κ : Type*} [Fintype ι] [Fintype κ] + +def expect (μ : Law ι) (f : ι → ℝ) : ℝ := ∑ i, μ i*f i + +lemma expect_nonneg (μ : Law ι) {f : ι → ℝ} (hf : ∀ i, 0 ≤ f i) : 0 ≤ expect μ f := + sum_nonneg (fun i _ => mul_nonneg (μ.nonneg i) (hf i)) +lemma expect_le_one (μ : Law ι) {f : ι → ℝ} (hf : ∀ i, f i ≤ 1) : expect μ f ≤ 1 := by + calc + _ ≤ ∑ i, μ i*1 := sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left (hf i) (μ.nonneg i)) + _ = _ := by simp only [mul_one,μ.total] +lemma expect_add (μ : Law ι) (f g : ι → ℝ) : + expect μ (fun i => f i+g i) = expect μ f+expect μ g := by + simp only [expect,mul_add,sum_add_distrib] +lemma expect_sub (μ : Law ι) (f g : ι → ℝ) : + expect μ (fun i => f i-g i) = expect μ f-expect μ g := by + simp only [expect,mul_sub,sum_sub_distrib] +lemma expect_move (μ : Law ι) (P : ι → Law κ) (f : κ → ℝ) : + expect (move μ P) f = expect μ (fun i => expect (P i) f) := by + simp only [expect,move_apply,sum_mul,mul_sum,mul_assoc] + rw [Finset.sum_comm] + +variable [DecidableEq ι] +lemma expect_delta (i : ι) (f : ι → ℝ) : expect (delta i) f = f i := by + simp [expect,delta] + +lemma spatialRow_expect (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (r : ℝ) (x : ℂ) (f : ι → ℝ) : + expect (spatialRow old target p hp0 hp1 r x) f = + f old+interpolate r (fun z => p z*(f (target z)-f old)) x := by + simp only [expect,spatialRow_formula,add_mul,sum_add_distrib] + rw [show (∑ i : ι, delta old i*f i) = f old from expect_delta old f] + congr 1 + simp_rw [← interpolate_mul_const] + rw [← interpolate_finset_sum] + congr 1 + funext z + simp only [mul_sub,sub_mul,sum_sub_distrib,mul_assoc,← mul_sum] + rw [show (∑ i : ι, delta (target z) i*f i) = f (target z) from expect_delta _ _, + show (∑ i : ι, delta old i*f i) = f old from expect_delta _ _] + +/-- An absorbing finite set gives exact drift equal to the off-diagonal +switch rate. Conditions concern only tents that actually meet the point. -/ +lemma spatialRow_absorbing (old : ι) (target : ℤ × ℤ → ι) (p : ℤ × ℤ → ℝ) + (hp0 : ∀ z, 0 ≤ p z) (hp1 : ∀ z, p z ≤ 1) (r : ℝ) (x : ℂ) + (b : ι → ℝ) (hb : b old = 0 ∨ b old = 1) + (ht : ∀ z, hat r z x ≠ 0 → b (target z) = 0) + (hz : b old = 0 → ∀ z, hat r z x ≠ 0 → p z = 0) : + expect (spatialRow old target p hp0 hp1 r x) b+interpolate r p x = b old := by + rw [spatialRow_expect] + rcases hb with hb|hb + · have he : interpolate r p x = 0 := by + rw [interpolate_congr_on r x (hz hb),interpolate_const] + have he' : interpolate r (fun z => p z*(b (target z)-b old)) x = 0 := by + have hc : ∀ z, hat r z x ≠ 0 → p z*(b (target z)-b old) = 0 := by + intro z h; rw [ht z h,hb]; ring + rw [interpolate_congr_on r x hc,interpolate_const] + rw [he,he']; ring + · have hi : interpolate r (fun z => p z*(b (target z)-b old)) x = + interpolate r (fun z => p z*(-1)) x := by + apply interpolate_congr_on + intro z h; rw [ht z h,hb]; ring + rw [hi,interpolate_mul_const]; ring + +end FiniteLabels + +namespace ActualLabels +open FiniteLabels DyadicHats DirectionNeighbors ConeCoordinates + +def badWeight (anchor : ℂ) (n : Label) : ℝ := + if ‖(n:ℂ)-anchor‖ ≤ (1/200:ℝ) then 0 else 1 +lemma badWeight_cases (a : ℂ) (n : Label) : badWeight a n = 0 ∨ badWeight a n = 1 := by + unfold badWeight; split_ifs <;> simp +lemma badWeight_nonneg (a : ℂ) (n : Label) : 0 ≤ badWeight a n := by + rcases badWeight_cases a n with h|h <;> linarith +lemma badWeight_le_one (a : ℂ) (n : Label) : badWeight a n ≤ 1 := by + rcases badWeight_cases a n with h|h <;> linarith + +def rate (h : ℂ → ℂ) (r : ℝ) (x : ℂ) (n : Label) : ℝ := + interpolate r (switchChance h r n) x +lemma rate_nonneg (h : ℂ → ℂ) (r : ℝ) (x : ℂ) (n : Label) : 0 ≤ rate h r x n := + interpolate_nonneg r x (switchChance_nonneg h r n) +lemma rate_le_one (h : ℂ → ℂ) (r : ℝ) (x : ℂ) (n : Label) : rate h r x n ≤ 1 := + interpolate_le_const r x (switchChance_le_one h r n) + +theorem row_drift {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) {anchor : ℂ} + (ha : ‖theta h r q-anchor‖ ≤ 1/800) (old : Label) : + expect (row h r x old) (badWeight anchor)+rate h r x old = badWeight anchor old := by + apply spatialRow_absorbing _ _ _ _ _ _ _ _ (badWeight_cases _ _) + · intro z hz + have he := nearby_sample_close hr h q hx hE z hz + have ht := target_close h r z + have hn : ‖(target h r z:ℂ)-anchor‖ ≤ + ‖(target h r z:ℂ)-Theta h r z‖+‖Theta h r z-theta h r q‖+‖theta h r q-anchor‖ := by + simpa only [dist_eq_norm] using dist_triangle4 (target h r z:ℂ) (Theta h r z) (theta h r q) anchor + have ht' : ‖(target h r z:ℂ)-Theta h r z‖ < 1/2000 := by simpa only [norm_sub_rev] using ht + exact ite_eq_left (by linarith) + · intro hb z hz + have hba : ‖(old:ℂ)-anchor‖ ≤ 1/200 := by + by_contra hn + unfold badWeight at hb + rw [ite_eq_right hn] at hb + norm_num at hb + have he := nearby_sample_close hr h q hx hE z hz + apply probability_eq_zero + have hn : ‖(old:ℂ)-Theta h r z‖ ≤ + ‖(old:ℂ)-anchor‖+‖anchor-theta h r q‖+‖theta h r q-Theta h r z‖ := by + simpa only [dist_eq_norm] using dist_triangle4 (old:ℂ) anchor (theta h r q) (Theta h r z) + have he' : ‖theta h r q-Theta h r z‖ ≤ 1/1000 := by simpa only [norm_sub_rev] using he + have ha' : ‖anchor-theta h r q‖ ≤ 1/800 := by simpa only [norm_sub_rev] using ha + linarith + +lemma law_drift {r : ℝ} (hr : 0 < r) (h : ℂ → ℂ) (q : ℤ × ℤ) + {x : ℂ} (hx : boxNorm (x-point r q) ≤ 50*r) + (hE : energy h r q ≤ (1/1000:ℝ)^2) {anchor : ℂ} + (ha : ‖theta h r q-anchor‖ ≤ 1/800) (μ : Law Label) : + expect (move μ (row h r x)) (badWeight anchor)+expect μ (rate h r x) = + expect μ (badWeight anchor) := by + rw [expect_move,← expect_add] + congr 1 + funext old + exact row_drift hr h q hx hE ha old + +end ActualLabels + +namespace ActualLabels +open FiniteLabels DyadicHats DirectionNeighbors Finset + +def switchCost (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) : ℕ → ℝ + | 0 => 1 + | k+1 => expect (marginal h r k x) (rate h (r (k+1)) x) + +lemma switchCost_nonneg (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (k : ℕ) : + 0 ≤ switchCost h r x k := by + cases k with + | zero => exact zero_le_one + | succ k => exact FiniteLabels.expect_nonneg _ (rate_nonneg h (r (k+1)) x) +lemma switchCost_le_one (h : ℂ → ℂ) (r : ℕ → ℝ) (x : ℂ) (k : ℕ) : + switchCost h r x k ≤ 1 := by + cases k with + | zero => exact le_rfl + | succ k => exact expect_le_one _ (rate_le_one h (r (k+1)) x) + +/-- A telescoping estimate between arbitrary birth and death times. These are +geometric low-energy assumptions on a path, not a switch-budget premise. -/ +theorem switchCost_sum (h : ℂ → ℂ) (r : ℕ → ℝ) (q : ℕ → ℤ × ℤ) (x : ℂ) + (anchor : ℕ → ℂ) (exceptional : ℕ → Bool) {b m : ℕ} (hbm : b ≤ m) + (hr : ∀ k ∈ Finset.Ico b m, 0 < r (k+1)) + (hx : ∀ k ∈ Finset.Ico b m, boxNorm (x-point (r (k+1)) (q (k+1))) ≤ 50*r (k+1)) + (hE : ∀ k ∈ Finset.Ico b m, exceptional (k+1) = false → + energy h (r (k+1)) (q (k+1)) ≤ (1/1000:ℝ)^2) + (ha : ∀ k ∈ Finset.Ico b m, exceptional (k+1) = false → + anchor (k+1) = anchor k ∧ ‖theta h (r (k+1)) (q (k+1))-anchor k‖ ≤ 1/800) : + (∑ k ∈ Finset.Ico b m, switchCost h r x (k+1)) ≤ + 1+2*∑ k ∈ Finset.Ico b m, if exceptional (k+1) then (1:ℝ) else 0 := by + let v : ℕ → ℝ := fun k => expect (marginal h r k x) (badWeight (anchor k)) + have hv0 (k : ℕ) : 0 ≤ v k := FiniteLabels.expect_nonneg _ (badWeight_nonneg _) + have hv1 (k : ℕ) : v k ≤ 1 := expect_le_one _ (badWeight_le_one _) + have hs (k : ℕ) (hk : k ∈ Finset.Ico b m) : switchCost h r x (k+1) ≤ + v k-v (k+1)+2*(if exceptional (k+1) then (1:ℝ) else 0) := by + cases he : exceptional (k+1) with + | false => + obtain ⟨heq,hclose⟩ := ha k hk he + have hd := law_drift (hr k hk) h (q (k+1)) (hx k hk) (hE k hk he) hclose (marginal h r k x) + have hd' : v (k+1)+switchCost h r x (k+1) = v k := by + simpa only [v,marginal,switchCost,heq] using hd + simp only [Bool.false_eq_true,ite_false,mul_zero,add_zero] + linarith + | true => + simp only [ite_true,mul_one] + linarith [switchCost_le_one h r x (k+1),hv0 k,hv1 (k+1)] + have hall := sum_le_sum hs + rw [sum_add_distrib,← mul_sum] at hall + have ht : (∑ k ∈ Finset.Ico b m, (v k-v (k+1))) = v b-v m := by + have hh := Finset.sum_Ico_sub (fun k => -v k) hbm + simpa only [neg_sub_neg] using hh + rw [ht] at hall + linarith [hv1 b,hv0 m] + +end ActualLabels + +namespace IntrinsicMarks +variable {ι E : Type*} [Fintype ι] [NormedAddCommGroup E] + +/-- Only paths ending in a nonzero terminal vector can carry particles. -/ +def activePath : Tree ι E → List ι → Prop + | .leaf v, [] => v ≠ 0 + | .leaf _, _::_ => False + | .branch _, [] => False + | .branch t, i::p => activePath (t i) p + +omit [Fintype ι] in +lemma activePath_valid {t : Tree ι E} {p : List ι} (h : activePath t p) : validPath t p := by + induction p generalizing t with + | nil => cases t <;> simp_all [activePath,validPath] + | cons i p ih => cases t with + | leaf v => exact h.elim + | branch t => exact ih h + +lemma rootEval_mono_active (t : Tree ι E) {F G : List ι → ℝ} + (h : ∀ p, activePath t p → F p ≤ G p) : rootEval t F ≤ rootEval t G := by + induction t generalizing F G with + | leaf v => + by_cases hv : v = 0 + · simp [rootEval,hv] + · exact mul_le_mul_of_nonneg_left (h [] hv) (norm_nonneg v) + | branch t ih => + apply mul_le_mul_of_nonneg_left _ (survival_nonneg t) + exact Finset.sum_le_sum fun i _ => ih i (fun p hp => h (i::p) hp) + +lemma lateEval_mono_active (t : Tree ι E) {F G : List ι → ℕ → ℝ} + (h : ∀ p b, activePath t p → b ≤ p.length → F p b ≤ G p b) : lateEval t F ≤ lateEval t G := by + induction t generalizing F G with + | leaf v => rfl + | branch t ih => + unfold lateEval + apply add_le_add + · apply mul_le_mul_of_nonneg_left _ (sub_nonneg.mpr (survival_le_one t)) + exact Finset.sum_le_sum fun i _ => rootEval_mono_active (t i) (fun p hp => h (i::p) 1 hp (by simp)) + · exact Finset.sum_le_sum fun i _ => ih i (fun p b hp hb => h (i::p) (b+1) hp (by simpa using Nat.succ_le_succ hb)) + +lemma particleEval_mono_active (t : Tree ι E) {F G : List ι → ℕ → ℝ} + (h : ∀ p b, activePath t p → b ≤ p.length → F p b ≤ G p b) : particleEval t F ≤ particleEval t G := + add_le_add (rootEval_mono_active t (fun p hp => h p 0 hp (Nat.zero_le _))) + (lateEval_mono_active t h) + +/-- The subtree at a prefix (values beyond terminal nodes are immaterial). -/ +def atPath : Tree ι E → List ι → Tree ι E + | t, [] => t + | .leaf v, _::_ => .leaf v + | .branch t, i::p => atPath (t i) p + +omit [Fintype ι] in +lemma active_append {t : Tree ι E} {p q : List ι} (h : activePath t (p++q)) : + activePath (atPath t p) q := by + induction p generalizing t with + | nil => simpa only [atPath,List.nil_append] using h + | cons i p ih => + cases t with + | leaf v => exact h.elim + | branch t => exact ih h + +end IntrinsicMarks + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks + +def lastVertex {N : ℕ} (q : Grid N) : List (Grid N) → Grid N + | [] => q + | s::p => lastVertex s p + +def pathWeight {N : ℕ} (q : Grid N) : List (Grid N) → ℝ + | [] => 1 + | s::p => step q s*pathWeight s p + +lemma pathWeight_nonneg {N : ℕ} (q : Grid N) (p : List (Grid N)) : 0 ≤ pathWeight q p := by + induction p generalizing q with + | nil => exact zero_le_one + | cons s p ih => exact mul_nonneg (step_nonneg q s) (ih s) + +lemma active_length {N : ℕ} (v : Grid N → ℂ) {k : ℕ} {b : ℝ} {q : Grid N} + {p : List (Grid N)} (h : activePath (tree v k b q) p) : p.length = k := by + induction k generalizing b q p with + | zero => cases p with + | nil => rfl + | cons i p => exact h.elim + | succ k ih => cases p with + | nil => exact h.elim + | cons i p => exact congrArg Nat.succ (ih h) + +lemma active_ne_zero {N : ℕ} (v : Grid N → ℂ) {k : ℕ} {b : ℝ} {q : Grid N} + {p : List (Grid N)} (h : activePath (tree v k b q) p) : b ≠ 0 := by + induction k generalizing b q p with + | zero => cases p with + | nil => + intro hb + simp [tree,activePath,hb] at h + | cons i p => exact h.elim + | succ k ih => cases p with + | nil => exact h.elim + | cons i p => exact (mul_ne_zero_iff.mp (ih h)).1 + +lemma atPath_tree {N : ℕ} (v : Grid N → ℂ) {k : ℕ} (b : ℝ) (q : Grid N) + (p : List (Grid N)) (hp : p.length ≤ k) : + atPath (tree v k b q) p = tree v (k-p.length) (b*pathWeight q p) (lastVertex q p) := by + induction p generalizing k b q with + | nil => simp [atPath,pathWeight,lastVertex] + | cons i p ih => + cases k with + | zero => simp at hp + | succ k => + simp only [tree,atPath] + rw [ih (b*step q i) i (by simpa using hp)] + simp only [List.length_cons,Nat.succ_sub_succ_eq_sub,pathWeight,lastVertex,mul_assoc] + +lemma active_hat_support {N : ℕ} (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {k : ℕ} {b : ℝ} {q : Grid N} {p : List (Grid N)} + (h : activePath (tree v k b q) p) {x : ℂ} (hx : hat r (lastVertex q p) x ≠ 0) : + hat (scale r k) q x ≠ 0 := by + induction k generalizing b q p with + | zero => cases p with + | nil => simpa [lastVertex,scale] using hx + | cons i p => exact h.elim + | succ k ih => cases p with + | nil => exact h.elim + | cons i p => + have hi := ih h hx + have hs := (mul_ne_zero_iff.mp (active_ne_zero v h)).2 + rw [scale_succ] + exact step_support (scale_pos hr k) hs hi + +lemma lastVertex_append {N : ℕ} (q : Grid N) (p s : List (Grid N)) : + lastVertex q (p++s) = lastVertex (lastVertex q p) s := by + induction p generalizing q with + | nil => rfl + | cons i p ih => exact ih i + +/-- Actual spatial locality, at every prefix of every positive-mass particle +path, for every terminal position in the genuine finest hat support. -/ +theorem active_prefix_locality {N : ℕ} (v : Grid N → ℂ) {r : ℝ} (hr : 0 < r) + {k : ℕ} {b : ℝ} {q : Grid N} {p s : List (Grid N)} + (h : activePath (tree v k b q) (p++s)) {x : ℂ} + (hx : hat r (lastVertex q (p++s)) x ≠ 0) : + boxNorm (x-point (scale r (k-p.length)) (lastVertex q p)) < scale r (k-p.length) := by + have hp : p.length ≤ k := by have := active_length v h; simp only [List.length_append] at this; omega + have hh := active_append h + rw [atPath_tree v b q p hp] at hh + rw [lastVertex_append] at hx + exact (hat_ne_zero_iff (scale_pos hr _) _ _).mp (active_hat_support v hr hh hx) + +end ActualMarkTrees + +namespace IntrinsicMarks +variable {ι E : Type*} [Fintype ι] [NormedAddCommGroup E] [InnerProductSpace ℝ E] + +def reset (δ : ℝ) (v n : E) : E := if δ < ‖v-n‖ then v else n + +def anchor (e : E) (δ : ℝ) : Tree ι E → E → List ι → E + | .leaf v,n,_ => reset δ (direction e v) n + | .branch t,n,[] => reset δ (direction e (∑ i,vector (t i))) n + | .branch t,n,i::p => anchor e δ (t i) (reset δ (direction e (∑ j,vector (t j))) n) p + +def rootAnchor (e : E) (δ : ℝ) (t : Tree ι E) : List ι → E := + anchor e δ t (direction e (vector t)) + +lemma anchor_zero (e : E) (δ : ℝ) (t : Tree ι E) (n : E) + (hm : markIndicator e δ t n [] = 0) : + anchor e δ t n [] = n ∧ ‖direction e (vector t)-n‖ ≤ δ := by + cases t with + | leaf v => + have hc : ¬δ < ‖direction e v-n‖ := by + intro hc + simp [markIndicator,hc] at hm + exact ⟨by simp [anchor,reset,hc],le_of_not_gt hc⟩ + | branch t => + have hc : ¬δ < ‖direction e (∑ i,vector (t i))-n‖ := by + intro hc + simp [markIndicator,hc] at hm + exact ⟨by simp [anchor,reset,hc],le_of_not_gt hc⟩ + +lemma anchor_step (e : E) (δ : ℝ) (t : Tree ι E) (n : E) (p : List ι) + (hp : validPath t p) {s : ℕ} (hs : s < p.length) + (hm : markIndicator e δ t n (p.take (s+1)) = 0) : + anchor e δ t n (p.take (s+1)) = anchor e δ t n (p.take s) ∧ + ‖direction e (vector (atPath t (p.take (s+1))))-anchor e δ t n (p.take s)‖ ≤ δ := by + induction p generalizing t n s with + | nil => simp at hs + | cons i p ih => + cases t with + | leaf v => simp [validPath] at hp + | branch t => + cases s with + | zero => + have hm' : markIndicator e δ (t i) (reset δ (direction e (∑ j,vector (t j))) n) [] = 0 := by + simpa only [List.take_succ_cons,List.take_zero,markIndicator,reset] using hm + simpa only [List.take_succ_cons,List.take_zero,anchor,atPath] using + anchor_zero e δ (t i) (reset δ (direction e (∑ j,vector (t j))) n) hm' + | succ s => + simp only [List.length_cons,Nat.succ_lt_succ_iff] at hs + simpa only [List.take_succ_cons,anchor,atPath] using + ih (t i) (reset δ (direction e (∑ j,vector (t j))) n) hp hs hm + +lemma rootMark_cons (e : E) {δ : ℝ} (hδ : 0 ≤ δ) (t : Tree ι E) (i : ι) (p : List ι) : + rootMarkIndicator e δ t (i::p) = markIndicator e δ t (direction e (vector t)) (i::p) := by + cases t <;> simp [rootMarkIndicator,markIndicator,vector,not_lt_of_ge hδ] + +lemma rootAnchor_step (e : E) {δ : ℝ} (hδ : 0 ≤ δ) (t : Tree ι E) (p : List ι) + (hp : validPath t p) {s : ℕ} (hs : s < p.length) + (hm : rootMarkIndicator e δ t (p.take (s+1)) = 0) : + rootAnchor e δ t (p.take (s+1)) = rootAnchor e δ t (p.take s) ∧ + ‖direction e (vector (atPath t (p.take (s+1))))-rootAnchor e δ t (p.take s)‖ ≤ δ := by + apply anchor_step e δ t (direction e (vector t)) p hp hs + cases p with + | nil => simp at hs + | cons i p => simpa only [List.take_succ_cons,rootMark_cons e hδ] using hm + +lemma markIndicator_cases (e : E) (δ : ℝ) (t : Tree ι E) (n : E) (p : List ι) : + markIndicator e δ t n p = 0 ∨ markIndicator e δ t n p = 1 := by + induction p generalizing t n with + | nil => cases t <;> simp only [markIndicator] <;> split_ifs <;> simp + | cons i p ih => + cases t with + | leaf v => exact Or.inl rfl + | branch t => exact ih _ _ + +lemma rootMarkIndicator_cases (e : E) (δ : ℝ) (t : Tree ι E) (p : List ι) : + rootMarkIndicator e δ t p = 0 ∨ rootMarkIndicator e δ t p = 1 := by + cases p with + | nil => cases t <;> exact Or.inr rfl + | cons i p => cases t with + | leaf v => exact Or.inl rfl + | branch t => exact markIndicator_cases e δ (t i) _ p + +lemma direction_smul_pos (e v : E) {b : ℝ} (hb : 0 < b) : direction e (b • v) = direction e v := by + by_cases hv : v = 0 + · simp [hv,direction] + · have hb0 := hb.ne' + simp only [direction,smul_eq_zero,hb0,hv,or_self,ite_false,norm_smul, + Real.norm_eq_abs,abs_of_pos hb,mul_inv_rev,smul_smul] + congr 1 + field_simp + +omit [Fintype ι] [InnerProductSpace ℝ E] in +lemma pathCharge_sum (C : List ι → ℝ) (p : List ι) (b : ℕ) : + pathCharge C p b = ∑ s ∈ Finset.Ico b (p.length+1), C (p.take s) := by + induction p generalizing C b with + | nil => cases b <;> simp [pathCharge] + | cons i p ih => + cases b with + | zero => + simp only [pathCharge,ih,List.length_cons,Nat.Ico_zero_eq_range] + rw [Finset.sum_range_succ' (fun s => C ((i::p).take s)) (p.length+1)] + simp only [List.take_succ_cons,List.take_zero] + exact add_comm _ _ + | succ b => + simp only [pathCharge,ih,List.length_cons] + rw [← Finset.sum_Ico_add' (fun s => C ((i::p).take s)) b (p.length+1) 1] + simp only [List.take_succ_cons] + +end IntrinsicMarks + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks + +theorem direction_at_prefix {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) {k : ℕ} {b : ℝ} (hb : 0 ≤ b) + {q : Grid N} {p s : List (Grid N)} + (hp : activePath (tree (fun q => vectorMass h r q) k b q) (p++s)) : + direction (1:ℂ) (vector (atPath (tree (fun q => vectorMass h r q) k b q) p)) = + DirectionNeighbors.theta h (scale r (k-p.length)) (lastVertex q p) := by + have hlen : p.length ≤ k := by have := active_length _ hp; simp only [List.length_append] at this; omega + rw [atPath_tree _ b q p hlen,vector_actual hr hR hN hh hsupp] + have hpa := active_append hp + rw [atPath_tree _ b q p hlen] at hpa + have hpos : 0 < b*pathWeight q p := lt_of_le_of_ne + (mul_nonneg hb (pathWeight_nonneg q p)) (Ne.symm (active_ne_zero _ hpa)) + exact direction_smul_pos _ _ hpos + +end ActualMarkTrees + +namespace ActualMarkTrees +open DyadicHats IntrinsicMarks Finset DirectionNeighbors ActualLabels + +def pathEnergy (h : ℂ → ℂ) (r : ℝ) (k : ℕ) {N : ℕ} (q : Grid N) + (p : List (Grid N)) : ℝ := energy h (scale r (k-p.length)) (lastVertex q p) + +def pathSwitches (h : ℂ → ℂ) (r : ℝ) (k : ℕ) (x : ℂ) + {N : ℕ} (p : List (Grid N)) (b : ℕ) : ℝ := + ∑ i ∈ Ico b (p.length+1), switchCost h (fun j => scale r (k-j)) x i + +lemma mark_nonneg {ι : Type*} [Fintype ι] (t : Tree ι ℂ) (p : List ι) : + 0 ≤ rootMarkIndicator (1:ℂ) (1/800) t p := by + rcases rootMarkIndicator_cases (1:ℂ) (1/800) t p with h | h + · exact h.symm.le + · exact h.symm ▸ zero_le_one + +/-- The switch bound on every genuinely occupied path, using its complete +intrinsic history, even before the particle's birth. -/ +theorem path_switch_bound {N : ℕ} {r R : ℝ} (hr : 0 < r) (hR : 0 ≤ R) + (hN : R/r+1 ≤ (N:ℝ)) {h : ℂ → ℂ} (hh : Integrable h) + (hsupp : ∀ y, h y ≠ 0 → ‖y‖ ≤ R) (k : ℕ) (q : Grid N) + {p : List (Grid N)} (hp : activePath (tree (fun q => vectorMass h r q) k 1 q) p) + {b : ℕ} (hb : b ≤ p.length) {x : ℂ} (hx : hat r (lastVertex q p) x ≠ 0) : + pathSwitches h r k x p b ≤ 2+ + 2*pathCharge (rootMarkIndicator (1:ℂ) (1/800) (tree (fun q => vectorMass h r q) k 1 q)) p b+ + 2000000*pathCharge (pathEnergy h r k q) p b := by + classical + let t := tree (fun q => vectorMass h r q) k 1 q + let M := rootMarkIndicator (1:ℂ) (1/800) t + let rs : ℕ → ℝ := fun i => scale r (k-i) + let qs : ℕ → ℤ × ℤ := fun i => lastVertex q (p.take i) + let E : ℕ → ℝ := fun i => energy h (rs i) (qs i) + let A : ℕ → ℂ := fun i => rootAnchor (1:ℂ) (1/800) t (p.take i) + let bad : ℕ → Bool := fun i => decide (M (p.take i) ≠ 0 ∨ (1/1000:ℝ)^2 < E i) + have hlen : p.length = k := active_length _ hp + have hpos (i : ℕ) : 0 < rs i := scale_pos hr _ + have he0 (i : ℕ) : 0 ≤ E i := energy_nonneg h _ _ + have hpref (i : ℕ) : activePath t (p.take i++p.drop i) := by + simpa only [List.take_append_drop] using hp + have hloc (i : ℕ) (hi : i ≤ p.length) : boxNorm (x-point (rs i) (qs i)) ≤ 50*rs i := by + have hl := active_prefix_locality (fun q => vectorMass h r q) hr (hpref i) + (by simpa only [List.take_append_drop] using hx) + have hli : (p.take i).length = i := by simp only [List.length_take,min_eq_left hi] + simp only [hli] at hl + exact hl.le.trans (by dsimp only [rs,qs]; nlinarith [scale_pos hr (k-i)]) + have hdir (i : ℕ) (hi : i ≤ p.length) : + direction (1:ℂ) (vector (atPath t (p.take i))) = theta h (rs i) (qs i) := by + have hd := direction_at_prefix hr hR hN hh hsupp (by norm_num : (0:ℝ) ≤ 1) (hpref i) + simpa only [List.length_take,min_eq_left hi] using hd + have hbad (i : ℕ) : bad i = false → M (p.take i) = 0 ∧ E i ≤ (1/1000:ℝ)^2 := by + simp only [bad,decide_eq_false_iff_not,not_or,not_not,not_lt] + exact id + have hs := switchCost_sum h rs qs x A bad (by omega : b ≤ k) + (fun i _ => hpos (i+1)) + (fun i hi => hloc (i+1) (by simp only [Finset.mem_Ico] at hi; omega)) + (fun i _ hi => (hbad (i+1) hi).2) + (fun i hi he => by + have hil : i < p.length := by simp only [Finset.mem_Ico] at hi; omega + have ha := rootAnchor_step (1:ℂ) (by norm_num : (0:ℝ) ≤ 1/800) t p + (activePath_valid hp) hil (hbad (i+1) he).1 + rw [hdir (i+1) (by omega)] at ha + exact ha) + have hind (i : ℕ) : (if bad i then (1:ℝ) else 0) ≤ M (p.take i)+1000000*E i := by + rcases rootMarkIndicator_cases (1:ℂ) (1/800) t (p.take i) with hm | hm + · change M (p.take i) = 0 at hm + by_cases he : (1/1000:ℝ)^2 < E i + · simp only [bad,hm,ne_eq,not_true_eq_false,false_or,he,decide_true,ite_true] + nlinarith + · simp only [bad,hm,ne_eq,not_true_eq_false,false_or,he,decide_false,Bool.false_eq_true,ite_false] + nlinarith [he0 i] + · change M (p.take i) = 1 at hm + have hh0 := he0 i + by_cases he : bad i = true <;> simp [he,show M (p.take i) = 1 from hm] <;> nlinarith + have hterm : (∑ i ∈ Ico b k, if bad (i+1) then (1:ℝ) else 0) ≤ + pathCharge M p b+1000000*pathCharge (pathEnergy h r k q) p b := by + calc + _ ≤ ∑ i ∈ Ico b k, (M (p.take (i+1))+1000000*E (i+1)) := + sum_le_sum (fun i _ => hind (i+1)) + _ = ∑ i ∈ Ico (b+1) (k+1), (M (p.take i)+1000000*E i) := by + exact sum_Ico_add' (fun i => M (p.take i)+1000000*E i) b k 1 + _ ≤ ∑ i ∈ Ico b (p.length+1), (M (p.take i)+1000000*E i) := by + apply sum_le_sum_of_subset_of_nonneg + · intro i hi + simp only [Finset.mem_Ico] at hi ⊢ + omega + · intro i _ _ + exact add_nonneg (mark_nonneg t _) (mul_nonneg (by norm_num) (he0 i)) + _ = _ := by + rw [pathCharge_sum,pathCharge_sum,sum_add_distrib,mul_sum] + congr 1 + apply sum_congr rfl + intro i hi + congr 1 + have hil : i ≤ p.length := by have := (Finset.mem_Ico.mp hi).2; omega + simp only [E,rs,qs,pathEnergy,List.length_take,min_eq_left hil] + have hsum : pathSwitches h r k x p b = switchCost h rs x b+ + ∑ i ∈ Ico b k, switchCost h rs x (i+1) := by + change (∑ i ∈ Ico b (p.length+1), switchCost h rs x i) = _ + rw [hlen,Finset.sum_eq_sum_Ico_succ_bot (by omega : b < k+1),Finset.sum_Ico_add'] + rw [hsum] + have h1 := switchCost_le_one h rs x b + change _ ≤ 2+2*pathCharge M p b+2000000*pathCharge (pathEnergy h r k q) p b + linarith + +end ActualMarkTrees + +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/Telescoping.lean b/lean/OAI/Analysis/DiskMaximal/Telescoping.lean new file mode 100644 index 0000000000000000000000000000000000000000..fca1857d6092ff84bb749771df3b7c5e0f2b07b6 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/Telescoping.lean @@ -0,0 +1,941 @@ +import OAI.Analysis.DiskMaximal.LocalPrices + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real + +noncomputable section + +namespace DiskScales + +lemma width_add (d : ℝ) (j n : ℕ) : width d (j+n) = width (width d j) n := by + simp only [width,pow_add] + ring + +lemma sum_width_tail {d p : ℝ} (hd : 0 ≤ d) (hp : 0 < p) (j n : ℕ) : + (∑ i ∈ Finset.Ico j n, (width d i)^p) ≤ (width d j)^p/(1-(1/2 : ℝ)^p) := by + rw [Finset.sum_Ico_eq_sum_range] + have hs : Summable (fun i => (width (width d j) i)^p) := + summable_width_rpow (by dsimp [width]; positivity) hp + have hh := hs.sum_le_tsum (Finset.range (n-j)) (fun i _ => Real.rpow_nonneg (by dsimp [width]; positivity) p) + simp_rw [width_add] + exact hh.trans_eq (tsum_width_rpow (by dsimp [width]; positivity) hp) + +lemma dist_width_tail {α : Type*} [PseudoMetricSpace α] {d p C : ℝ} (hd : 0 ≤ d) + (hp : 0 < p) (hC : 0 ≤ C) {f : ℕ → α} {j n : ℕ} (hjn : j ≤ n) + (hincr : ∀ i, j ≤ i → i < n → dist (f i) (f (i+1)) ≤ C*(width d i)^p) : + dist (f j) (f n) ≤ C*(width d j)^p/(1-(1/2 : ℝ)^p) := by + have hh := dist_le_Ico_sum_of_dist_le hjn (fun {i} hi hin => hincr i hi hin) + rw [← Finset.mul_sum] at hh + exact hh.trans (by simpa only [mul_div_assoc] using + mul_le_mul_of_nonneg_left (sum_width_tail hd hp j n) hC) + +end DiskScales + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +lemma moment_kernel_pairing_sub {a : ℂ → ℂ} (ha : Integrable a) + {r δ ε : ℝ} {M N : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) + (l : RadiusDensity (r-ε) (r+ε) N) (x : ℂ) (hrδ : r+δ ≤ 3) (hrε : r+ε ≤ 3) : + (∫ y, star (y-x)*(kernel l x y : ℂ)*a y)- + (∫ y, star (y-x)*(kernel k x y : ℂ)*a y) = + ∫ y, star (y-x)*((kernel l x y : ℂ)-kernel k x y)*a y := by + rw [← integral_sub (general_moment_integrable ha l x hrε) (general_moment_integrable ha k x hrδ)] + congr 1 + ext y + ring + +lemma total_correction {Cs : ℝ} (b : ι → ErrorPiece Cs) {a F : ℂ → ℂ} (ha : Integrable a) + (hF : AEStronglyMeasurable F) (hFb : ∀ y, ‖F y‖ ≤ 1) (x z : ℂ) + (hsupp : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ 3) + (hzero : (∫ y, star (y-x)*F y*a y)+(∑ j, ∫ y, star (y-x)*F y*(b j).density y) = 0) : + (∫ y, F y*a y)+(∑ j, ∫ y, F y*(b j).density y) = + (∫ y, correction x z y*F y*a y)+(∑ j, ∫ y, correction x z y*F y*(b j).density y) := by + rw [correcting_pairing ha hF hFb x z hsupp] + simp_rw [correcting_pairing (b _).integrable hF hFb x z hsupp] + rw [Finset.sum_sub_distrib, ← Finset.mul_sum] + linear_combination (star (z-x))⁻¹*hzero + +lemma balanced_kernel_gap_identity {Cs : ℝ} (b : ι → ErrorPiece Cs) {a : ℂ → ℂ} + (ha : Integrable a) {r δ ε : ℝ} {M N : ℝ≥0} + (k : RadiusDensity (r-δ) (r+δ) M) (l : RadiusDensity (r-ε) (r+ε) N) + (x z : ℂ) (hrδ : r+δ ≤ 3) (hrε : r+ε ≤ 3) (hεδ : ε ≤ δ) + (hMk : (∫ y, star (y-x)*(kernel k x y : ℂ)*a y)+ + (∑ j, ∫ y, star (y-x)*(kernel k x y : ℂ)*(b j).density y) = 0) + (hMl : (∫ y, star (y-x)*(kernel l x y : ℂ)*a y)+ + (∑ j, ∫ y, star (y-x)*(kernel l x y : ℂ)*(b j).density y) = 0) : + ((∫ y, (kernel l x y : ℂ)*a y)+(∑ j, ∫ y, (kernel l x y : ℂ)*(b j).density y))- + ((∫ y, (kernel k x y : ℂ)*a y)+(∑ j, ∫ y, (kernel k x y : ℂ)*(b j).density y)) = + (∫ y, correction x z y*((kernel l x y : ℂ)-kernel k x y)*a y)+ + (∑ j, ∫ y, correction x z y*((kernel l x y : ℂ)-kernel k x y)*(b j).density y) := by + let F (y : ℂ) := (kernel l x y : ℂ)-kernel k x y + have hsupp : ∀ y, F y ≠ 0 → ‖y-x‖ ≤ 3 := by + intro y hy + have hh := (abs_le.mp (difference_support k l hεδ x y hy)).2 + linarith + have hzero : (∫ y, star (y-x)*F y*a y)+ + (∑ j, ∫ y, star (y-x)*F y*(b j).density y) = 0 := by + simp_rw [F, ← moment_kernel_pairing_sub ha k l x hrδ hrε, + ← moment_kernel_pairing_sub (b _).integrable k l x hrδ hrε] + rw [Finset.sum_sub_distrib] + linear_combination hMl-hMk + have hcorr := total_correction b ha + ((complex_kernel_lipschitz l x).continuous.sub (complex_kernel_lipschitz k x).continuous).aestronglyMeasurable + (difference_bound k l x) x z hsupp hzero + calc + _ = ((∫ y, (kernel l x y : ℂ)*a y)-(∫ y, (kernel k x y : ℂ)*a y))+ + ((∑ j, ∫ y, (kernel l x y : ℂ)*(b j).density y)- + (∑ j, ∫ y, (kernel k x y : ℂ)*(b j).density y)) := by abel + _ = (∫ y, F y*a y)+(∑ j, ∫ y, F y*(b j).density y) := by + rw [general_kernel_pairing_sub ha k l x, ← Finset.sum_sub_distrib] + simp_rw [general_kernel_pairing_sub (b _).integrable k l x] + rfl + _ = _ := hcorr + +end LocalCancellation + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +lemma kernel_error_bound {Cs δ r : ℝ} (b : ι → ErrorPiece Cs) (hCs : 0 ≤ Cs) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) + (k : RadiusDensity (r-δ) (r+δ) ⟨216/δ, by positivity⟩) (x : ℂ) : + ‖∑ j, ∫ y, (kernel k x y : ℂ)*(b j).density y‖ ≤ + (1+216*Cs)/δ^(1/100 : ℝ)*errorPrice b (1/100) := by + exact total_pairing_discount b (by norm_num : (0 : ℝ) ≤ 1/100) + (by norm_num : (1/100 : ℝ) ≤ 1) hδ hδ1 (by linarith) + (complex_kernel_lipschitz k x) (complex_kernel_bound k x) + (by change (216/δ)*Cs ≤ (1+216*Cs)/δ + apply (le_div_iff₀ hδ).mpr + field_simp [hδ.ne'] + linarith) + +lemma coarse_bound_scaled {Cs δ : ℝ} (b : ι → ErrorPiece Cs) (hδ : 0 < δ) : + coarseMass b δ univ ≤ errorPrice b (1/100)*δ^(-(1/50 : ℝ)) := by + have hh := coarseMass_bound b (by norm_num : (0 : ℝ) ≤ 1/100) hδ + norm_num at hh + simpa only [Real.rpow_neg hδ.le,div_eq_mul_inv] using hh + +lemma scaled_ordinary_inactive {Cs δ t : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hAt : errorPrice b (1/100) ≤ t) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) + (hL : (L : ℝ) ≤ 648/δ) (hsmall : coarseMass b δ D ≤ t*δ^(1/10 : ℝ)) : + ‖∑ j, ∫ y, F y*(b j).density y‖ ≤ (16+4538*Cs)*t*δ^(1/10 : ℝ) := by + have hi := increment_bound b hCs (by norm_num : (1/100 : ℝ) ≤ 1) hδ.le hδ1 hF hD hFb hFD + have hs := scaled_increment hCs (errorPrice_nonneg b (1/100)) hAt hδ hδ1 (coarse_bound_scaled b hδ) hL + have hM : 0 ≤ 2*δ^(1/5 : ℝ)*coarseMass b δ univ := by + exact mul_nonneg (by positivity) (coarseMass_nonneg b δ univ) + have hC : 0 ≤ 2*(3*(L : ℝ)+1)*Cs*δ^(2*(1-(1/100 : ℝ)))*errorPrice b (1/100) := by + exact mul_nonneg (by positivity) (errorPrice_nonneg b (1/100)) + have hU : 0 ≤ t*δ^(1/10 : ℝ) := mul_nonneg ((errorPrice_nonneg b (1/100)).trans hAt) (by positivity) + nlinarith + +lemma scaled_corrected_inactive {Cs δ t : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hAt : errorPrice b (1/100) ≤ t) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) + (hL : (L : ℝ) ≤ 648/δ) (hsmall : coarseMass b δ D ≤ t*δ^(1/10 : ℝ)) + (x z : ℂ) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) : + ‖∑ j, ∫ y, correction x z y*F y*(b j).density y‖ ≤ + (16+4538*Cs)*t*δ^(1/10 : ℝ) := by + have hi := corrected_inactive_bound b hCs (by norm_num : (1/100 : ℝ) ≤ 1) hδ.le hδ1 hF hD hFb hFD x z hz hD3 + have hs := scaled_increment hCs (errorPrice_nonneg b (1/100)) hAt hδ hδ1 (coarse_bound_scaled b hδ) hL + have hM : 0 ≤ 2*δ^(1/5 : ℝ)*coarseMass b δ univ := + mul_nonneg (by positivity) (coarseMass_nonneg b δ univ) + have hU : 0 ≤ t*δ^(1/10 : ℝ) := mul_nonneg ((errorPrice_nonneg b (1/100)).trans hAt) (by positivity) + nlinarith + +lemma scaled_corrected_active {Cs δ t : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hAt : errorPrice b (1/100) ≤ t) + {L : ℝ≥0} {F : ℂ → ℂ} (hF : LipschitzWith L F) {D : Set ℂ} (hD : MeasurableSet D) + (hFb : ∀ y, ‖F y‖ ≤ 1) (hFD : ∀ y, F y ≠ 0 → y ∈ D) + (hL : (L : ℝ) ≤ 648/δ) (x z : ℂ) (hz : (1 : ℝ)/2 ≤ ‖z-x‖) + (hD3 : ∀ y ∈ D, ‖y-x‖ ≤ 3) + (hcap : coarseMass b δ (D \ Metric.ball z (δ^(1/5 : ℝ))) ≤ 2*(t*δ^(1/10 : ℝ))) : + ‖∑ j, ∫ y, correction x z y*F y*(b j).density y‖ ≤ + (16+4538*Cs)*t*δ^(1/10 : ℝ) := by + have hi := corrected_error_bound b hCs (by norm_num : (1/100 : ℝ) ≤ 1) hδ.le hδ1 + (Real.rpow_nonneg hδ.le (1/5)) hF hD hFb hFD x z hz hD3 + have hs := scaled_increment hCs (errorPrice_nonneg b (1/100)) hAt hδ hδ1 (coarse_bound_scaled b hδ) hL + linarith + +end LocalCancellation + +namespace DiskScales + +lemma successor_discount {δ : ℝ} (hδ : 0 < δ) : + (δ/2)⁻¹^(1/100 : ℝ) ≤ 2*δ⁻¹^(1/100 : ℝ) := by + rw [inv_div,Real.div_rpow (by norm_num : (0 : ℝ) ≤ 2) hδ.le,Real.inv_rpow hδ.le] + have hh : (2 : ℝ)^(1/100 : ℝ) ≤ 2 := by + simpa only [Real.rpow_one] using Real.rpow_le_rpow_of_exponent_le (by norm_num : (1 : ℝ) ≤ 2) + (by norm_num : (1/100 : ℝ) ≤ 1) + exact div_le_div_of_nonneg_right hh (by positivity) + +lemma geometric_den_pos {p : ℝ} (hp : 0 < p) : 0 < 1-(1/2 : ℝ)^p := by + linarith [norm_geometric_rpow_lt hp] + +lemma coarse_error_scale {Cs A t δ : ℝ} (hCs : 0 ≤ Cs) (hA : 0 ≤ A) + (hAt : A ≤ t) (hδ : 0 < δ) (hδ1 : δ ≤ 1) : + 2*((1+216*Cs)/δ^(1/100 : ℝ)*A) + + (16+4538*Cs)*t*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) ≤ + (2*(1+216*Cs)+(16+4538*Cs)/(1-(1/2 : ℝ)^(1/10 : ℝ)))*t*δ^(-(1/50 : ℝ)) := by + have ht : 0 ≤ t := hA.trans hAt + have hp1 : δ^(-(1/100 : ℝ)) ≤ δ^(-(1/50 : ℝ)) := + Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num) + have hp2 : δ^(1/10 : ℝ) ≤ δ^(-(1/50 : ℝ)) := + Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num) + have h1 : 2*((1+216*Cs)/δ^(1/100 : ℝ)*A) ≤ 2*(1+216*Cs)*t*δ^(-(1/50 : ℝ)) := by + rw [Real.rpow_neg hδ.le] at hp1 + calc + _ = 2*(1+216*Cs)*A*(δ^(1/100 : ℝ))⁻¹ := by ring + _ ≤ 2*(1+216*Cs)*t*δ^(-(1/50 : ℝ)) := mul_le_mul (by gcongr) hp1 (by positivity) (by positivity) + have hd := geometric_den_pos (by norm_num : (0 : ℝ) < 1/10) + have h2 := mul_le_mul_of_nonneg_left hp2 + (by positivity : 0 ≤ (16+4538*Cs)*t/(1-(1/2 : ℝ)^(1/10 : ℝ))) + have h2' : (16+4538*Cs)*t*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) ≤ + ((16+4538*Cs)/(1-(1/2 : ℝ)^(1/10 : ℝ)))*t*δ^(-(1/50 : ℝ)) := by + calc + _ = ((16+4538*Cs)*t/(1-(1/2 : ℝ)^(1/10 : ℝ)))*δ^(1/10 : ℝ) := by ring + _ ≤ ((16+4538*Cs)*t/(1-(1/2 : ℝ)^(1/10 : ℝ)))*δ^(-(1/50 : ℝ)) := h2 + _ = _ := by ring + linarith + +end DiskScales + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +lemma inactive_kernel_distance {Cs d t r : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hd1 : d ≤ 1) (hAt : errorPrice b (1/100) ≤ t) + (k : ∀ n : ℕ, RadiusDensity (r-width d n) (r+width d n) + ⟨216/width d n, div_nonneg (by norm_num) (width_pos hd n).le⟩) (x : ℂ) (n : ℕ) + (hsmall : coarseMass b (width d n) (thinShell x r (width d n)) ≤ t*(width d n)^(1/10 : ℝ)) : + dist (∑ j, ∫ y, (kernel (k n) x y : ℂ)*(b j).density y) + (∑ j, ∫ y, (kernel (k (n+1)) x y : ℂ)*(b j).density y) ≤ + (16+4538*Cs)*t*(width d n)^(1/10 : ℝ) := by + rw [dist_eq_norm,norm_sub_rev,← Finset.sum_sub_distrib] + simp_rw [general_kernel_pairing_sub (b _).integrable (k n) (k (n+1)) x] + apply scaled_ordinary_inactive b hCs (width_pos hd n) ((width_le hd.le n).trans hd1) hAt + ((complex_kernel_lipschitz (k (n+1)) x).sub (complex_kernel_lipschitz (k n) x)) + (measurableSet_thinShell x r (width d n)) (difference_bound (k n) (k (n+1)) x) + (difference_support (k n) (k (n+1)) (width_antitone hd.le (Nat.le_succ n)) x) ?_ hsmall + change 216/width d (n+1)+216/width d n ≤ 648/width d n + rw [width_succ] + exact le_of_eq (by ring) + +lemma kernel_gap_errors {Cs d t r : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hd1 : d ≤ 1) (hAt : errorPrice b (1/100) ≤ t) + (k : ∀ n : ℕ, RadiusDensity (r-width d n) (r+width d n) + ⟨216/width d n, div_nonneg (by norm_num) (width_pos hd n).le⟩) (x : ℂ) {j n : ℕ} (hjn : j < n) + (hsmall : ∀ i, j < i → i < n → coarseMass b (width d i) (thinShell x r (width d i)) ≤ + t*(width d i)^(1/10 : ℝ)) : + let B := (2*(1+216*Cs)+(16+4538*Cs)/(1-(1/2 : ℝ)^(1/10 : ℝ)))*t*(width d j)^(-(1/50 : ℝ)) + ‖∑ v, ∫ y, (kernel (k j) x y : ℂ)*(b v).density y‖ ≤ B ∧ + ‖∑ v, ∫ y, (kernel (k n) x y : ℂ)*(b v).density y‖ ≤ B := by + have ht : 0 ≤ t := (errorPrice_nonneg b (1/100)).trans hAt + have hwp (i : ℕ) := width_pos hd i + have hw1 (i : ℕ) := (width_le hd.le i).trans hd1 + have hjpos : 0 < width d j := hwp j + let P (i : ℕ) := ∑ v, ∫ y, (kernel (k i) x y : ℂ)*(b v).density y + have hind (i : ℕ) : ‖P i‖ ≤ (1+216*Cs)/(width d i)^(1/100 : ℝ)*errorPrice b (1/100) := + kernel_error_bound b hCs (hwp i) (hw1 i) (k i) x + have hsuc : ‖P (j+1)‖ ≤ 2*((1+216*Cs)/(width d j)^(1/100 : ℝ)*errorPrice b (1/100)) := by + have hh := successor_discount (hwp j) + have hi := hind (j+1) + rw [width_succ] at hi + have ha := mul_le_mul_of_nonneg_left hh + (mul_nonneg (show 0 ≤ 1+216*Cs by linarith) (errorPrice_nonneg b (1/100))) + simp only [Real.inv_rpow (hwp j).le,Real.inv_rpow (by positivity : 0 ≤ width d j/2)] at ha + exact hi.trans (by convert ha using 1 <;> ring) + have htail := dist_width_tail hd.le (by norm_num : (0 : ℝ) < 1/10) + (by positivity : 0 ≤ (16+4538*Cs)*t) (Nat.succ_le_of_lt hjn) + (fun i hji hin => inactive_kernel_distance b hCs hd hd1 hAt k x i (hsmall i (by omega) hin)) + have hpow : (width d (j+1))^(1/10 : ℝ) ≤ (width d j)^(1/10 : ℝ) := + Real.rpow_le_rpow (hwp (j+1)).le (width_antitone hd.le (Nat.le_succ j)) (by norm_num) + have hdg := geometric_den_pos (by norm_num : (0 : ℝ) < 1/10) + have htail' : dist (P (j+1)) (P n) ≤ + (16+4538*Cs)*t*(width d j)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := + htail.trans (div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hpow (by positivity)) hdg.le) + have hn : ‖P n‖ ≤ ‖P (j+1)‖+dist (P (j+1)) (P n) := by + calc + ‖P n‖ = ‖P (j+1)+(P n-P (j+1))‖ := by congr 1; abel + _ ≤ ‖P (j+1)‖+‖P n-P (j+1)‖ := norm_add_le _ _ + _ = _ := by rw [dist_eq_norm,norm_sub_rev] + have hscale := coarse_error_scale hCs (errorPrice_nonneg b (1/100)) hAt (hwp j) (hw1 j) + constructor + · have hnon : 0 ≤ (1+216*Cs)/(width d j)^(1/100 : ℝ)*errorPrice b (1/100) := + mul_nonneg (by positivity) (errorPrice_nonneg b (1/100)) + have htailnon : 0 ≤ (16+4538*Cs)*t*(width d j)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by positivity + exact (hind j).trans (by linarith) + · change ‖P n‖ ≤ _ + linarith + +lemma corrected_kernel_gap {Cs d t r : ℝ} (b : ι → ErrorPiece Cs) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hdq : d ≤ 1/4) (hr : r ∈ Icc (1 : ℝ) 2) + (hAt : errorPrice b (1/100) ≤ t) + (k : ∀ n : ℕ, RadiusDensity (r-width d n) (r+width d n) + ⟨216/width d n, div_nonneg (by norm_num) (width_pos hd n).le⟩) (x z : ℂ) {j n : ℕ} (hjn : j < n) + (hz : (1 : ℝ)/2 ≤ ‖z-x‖) + (hcap : coarseMass b (width d j) (thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ))) ≤ + 2*(t*(width d j)^(1/10 : ℝ))) + (hsmall : ∀ i, j < i → i < n → coarseMass b (width d i) (thinShell x r (width d i)) ≤ + t*(width d i)^(1/10 : ℝ)) : + ‖∑ v, ∫ y, correction x z y*((kernel (k n) x y : ℂ)-kernel (k j) x y)*(b v).density y‖ ≤ + (16+4538*Cs)*t*(width d j)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by + have ht : 0 ≤ t := (errorPrice_nonneg b (1/100)).trans hAt + have hd1 : d ≤ 1 := by linarith + have hwp (i : ℕ) := width_pos hd i + have hw1 (i : ℕ) := (width_le hd.le i).trans hd1 + have hrw (i : ℕ) : r+width d i ≤ 3 := by linarith [width_le hd.le i,hr.2] + let R (i : ℕ) := ∑ v, ∫ y, correction x z y*(kernel (k i) x y : ℂ)*(b v).density y + have hid (i l : ℕ) : R l-R i = + ∑ v, ∫ y, correction x z y*((kernel (k l) x y : ℂ)-kernel (k i) x y)*(b v).density y := by + dsimp only [R] + rw [← Finset.sum_sub_distrib] + simp_rw [corrected_kernel_pairing_sub (b _).integrable (k i) (k l) x z (hrw i) (hrw l) hz] + have hincr (i : ℕ) (hji : j ≤ i) (hin : i < n) : + dist (R i) (R (i+1)) ≤ (16+4538*Cs)*t*(width d i)^(1/10 : ℝ) := by + rw [dist_eq_norm,norm_sub_rev,hid] + have hD3 : ∀ y ∈ thinShell x r (width d i), ‖y-x‖ ≤ 3 := by + intro y hy + have hh := (abs_le.mp (show |‖y-x‖-r| ≤ width d i from hy)).2 + linarith [hrw i] + have hL : (216/width d (i+1)+216/width d i : ℝ) ≤ 648/width d i := by rw [width_succ]; exact le_of_eq (by ring) + have hF := (complex_kernel_lipschitz (k (i+1)) x).sub (complex_kernel_lipschitz (k i) x) + have hs := difference_support (k i) (k (i+1)) (width_antitone hd.le (Nat.le_succ i)) x + by_cases hij : i = j + · subst i + exact scaled_corrected_active b hCs (hwp j) (hw1 j) hAt hF + (measurableSet_thinShell x r (width d j)) (difference_bound (k j) (k (j+1)) x) hs hL x z hz hD3 hcap + · exact scaled_corrected_inactive b hCs (hwp i) (hw1 i) hAt hF + (measurableSet_thinShell x r (width d i)) (difference_bound (k i) (k (i+1)) x) hs hL + (hsmall i (by omega) hin) x z hz hD3 + have hh := dist_width_tail hd.le (by norm_num : (0 : ℝ) < 1/10) + (by positivity : 0 ≤ (16+4538*Cs)*t) hjn.le hincr + rw [dist_eq_norm,norm_sub_rev,hid] at hh + exact hh + +end LocalCancellation + +namespace DiskScales + +def errorGapConstant (Cs : ℝ) : ℝ := + 2*(1+216*Cs)+(16+4538*Cs)/(1-(1/2 : ℝ)^(1/10 : ℝ)) + +def directionGapConstant (Cs κ : ℝ) : ℝ := + (16+4538*Cs)+4*(errorGapConstant Cs/κ)+14+(16+4538*Cs)/(1-(1/2 : ℝ)^(1/10 : ℝ)) + +lemma errorGapConstant_pos {Cs : ℝ} (hCs : 0 ≤ Cs) : 0 < errorGapConstant Cs := by + have hden : 0 < 1-(1/2 : ℝ)^(1/10 : ℝ) := by linarith [norm_geometric_rpow_lt (by norm_num : (0 : ℝ) < 1/10)] + unfold errorGapConstant + positivity + +lemma directionGapConstant_ge {Cs κ : ℝ} (hCs : 0 ≤ Cs) (hκ : 0 < κ) : + 16+4538*Cs ≤ directionGapConstant Cs κ := by + have hden : 0 < 1-(1/2 : ℝ)^(1/10 : ℝ) := by linarith [norm_geometric_rpow_lt (by norm_num : (0 : ℝ) < 1/10)] + have he : 0 ≤ errorGapConstant Cs/κ := div_nonneg (errorGapConstant_pos hCs).le hκ.le + have hn : 0 ≤ (16+4538*Cs)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by positivity + unfold directionGapConstant + linarith + +lemma directionGapConstant_pos {Cs κ : ℝ} (hCs : 0 ≤ Cs) (hκ : 0 < κ) : + 0 < directionGapConstant Cs κ := by + have hh := directionGapConstant_ge hCs hκ + linarith + +lemma direction_cap_scale {Cs κ δ t : ℝ} (hCs : 0 ≤ Cs) (hκ : 0 < κ) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (ht : 0 ≤ t) : + 4*δ^(1/5 : ℝ)*((errorGapConstant Cs*t*δ^(-(1/50 : ℝ)))/κ)+14*(t*δ^(1/10 : ℝ))+ + (16+4538*Cs)*t*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) ≤ + directionGapConstant Cs κ*t*δ^(1/10 : ℝ) := by + have hp : δ^(1/5 : ℝ)*δ^(-(1/50 : ℝ)) ≤ δ^(1/10 : ℝ) := by + rw [← Real.rpow_add hδ] + exact Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num) + have hb := mul_le_mul_of_nonneg_left hp + (by exact mul_nonneg (mul_nonneg (by norm_num) (div_nonneg (errorGapConstant_pos hCs).le hκ.le)) ht : + 0 ≤ 4*(errorGapConstant Cs/κ)*t) + have hb' : 4*δ^(1/5 : ℝ)*((errorGapConstant Cs*t*δ^(-(1/50 : ℝ)))/κ) ≤ + 4*(errorGapConstant Cs/κ)*t*δ^(1/10 : ℝ) := by + calc + _ = 4*(errorGapConstant Cs/κ)*t*(δ^(1/5 : ℝ)*δ^(-(1/50 : ℝ))) := by ring + _ ≤ _ := hb + have hnon : 0 ≤ (16+4538*Cs)*t*δ^(1/10 : ℝ) := by positivity + calc + _ ≤ 4*(errorGapConstant Cs/κ)*t*δ^(1/10 : ℝ)+14*(t*δ^(1/10 : ℝ))+ + (16+4538*Cs)*t*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by linarith + _ ≤ (16+4538*Cs)*t*δ^(1/10 : ℝ)+ + (4*(errorGapConstant Cs/κ)*t*δ^(1/10 : ℝ)+14*(t*δ^(1/10 : ℝ))+ + (16+4538*Cs)*t*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) := le_add_of_nonneg_left hnon + _ = _ := by unfold directionGapConstant; ring + +end DiskScales + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +/-- The full finite/infinite active-width argument at a fixed center. The cap +premise is exactly the already proved shell concentration output, not a radius +selection or a projection estimate. -/ +lemma direction_sequence_point {Cs κ d t r : ℝ} {e : ℂ} (a : ConeDensity e κ) + (b : ι → ErrorPiece Cs) (he : ‖e‖ = 1) (hκ : 0 < κ) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hdq : d ≤ 1/4) (hr : r ∈ Icc (1 : ℝ) 2) + (hAt : errorPrice b (1/100) ≤ t) + (k : ∀ n : ℕ, RadiusDensity (r-width d n) (r+width d n) + ⟨216/width d n, div_nonneg (by norm_num) (width_pos hd n).le⟩) (x : ℂ) + (hM : ∀ n, (∫ y, star (y-x)*(kernel (k n) x y : ℂ)*a.density y)+ + (∑ v, ∫ y, star (y-x)*(kernel (k n) x y : ℂ)*(b v).density y) = 0) + (hcap : ∀ j, t*(width d j)^(1/10 : ℝ) ≤ coarseMass b (width d j) (thinShell x r (width d j)) → + (∫ y in Metric.ball x (r-width d j), ‖a.density y‖) ≤ + (errorGapConstant Cs/κ)*t*(width d j)^(-(1/50 : ℝ)) → + ∃ z ∈ thinShell x r (width d j), + (∫ y in thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ)), ‖a.density y‖)+ + coarseMass b (width d j) (thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ))) ≤ + 2*(t*(width d j)^(1/10 : ℝ))) : + max 0 (-inner ℝ e ((∫ y in Metric.ball x r, a.density y)+(∑ v, ∫ y in Metric.ball x r, (b v).density y))) ≤ + (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100)+ + directionGapConstant Cs κ*t*d^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by + classical + have ht : 0 ≤ t := (errorPrice_nonneg b (1/100)).trans hAt + have hd1 : d ≤ 1 := by linarith + have hwp (i : ℕ) := width_pos hd i + have hwq (i : ℕ) := (width_le hd.le i).trans hdq + have hw1 (i : ℕ) := (width_le hd.le i).trans hd1 + have hrw (i : ℕ) : r+width d i ≤ 3 := by linarith [hwq i,hr.2] + have hgpos := directionGapConstant_pos hCs hκ + have hgle := directionGapConstant_ge hCs hκ + let p (i : ℕ) := ∑ v, ∫ y, (kernel (k i) x y : ℂ)*(b v).density y + let P (i : ℕ) := (∫ y, (kernel (k i) x y : ℂ)*a.density y)+p i + let N (i : ℕ) := max 0 (-inner ℝ e (P i)) + let active (i : ℕ) := t*(width d i)^(1/10 : ℝ) ≤ coarseMass b (width d i) (thinShell x r (width d i)) + let inc (i : ℕ) := directionGapConstant Cs κ*t*(width d i)^(1/10 : ℝ) + let B := (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100) + have hi0 (i : ℕ) : 0 ≤ inc i := mul_nonneg (mul_nonneg hgpos.le ht) (Real.rpow_nonneg (hwp i).le _) + have hN0 (i : ℕ) : 0 ≤ N i := le_max_left _ _ + have hNerr (i : ℕ) : N i ≤ ‖p i‖ := cone_negative_le_error a he hκ.le + (kernel_lipschitz (k i) x).continuous.aestronglyMeasurable + (kernel_nonneg (k i) x) (kernel_le_one (k i) x) (p i) + have hfirst (n : ℕ) (hn : ∀ i < n, ¬active i) : N n ≤ B+∑ i ∈ Finset.range n, inc i := by + have hincr (i : ℕ) (hin : i < n) : dist (p i) (p (i+1)) ≤ inc i := by + have hs : coarseMass b (width d i) (thinShell x r (width d i)) ≤ t*(width d i)^(1/10 : ℝ) := + le_of_lt (lt_of_not_ge (hn i hin)) + exact (inactive_kernel_distance b hCs hd hd1 hAt k x i hs).trans + (mul_le_mul_of_nonneg_right (mul_le_mul_of_nonneg_right hgle ht) (Real.rpow_nonneg (hwp i).le _)) + have hh := dist_le_range_sum_of_dist_le n (fun {i} hin => hincr i hin) + have hp0 : ‖p 0‖ ≤ B := by + have h := kernel_error_bound b hCs (hwp 0) (hw1 0) (k 0) x + simpa only [p,B,width,pow_zero,mul_one] using h + have hp : ‖p n‖ ≤ ‖p 0‖+dist (p 0) (p n) := by + calc + ‖p n‖ = ‖p 0+(p n-p 0)‖ := by congr 1; abel + _ ≤ ‖p 0‖+‖p n-p 0‖ := norm_add_le _ _ + _ = _ := by rw [dist_eq_norm,norm_sub_rev] + linarith [hNerr n] + have hgap (j n : ℕ) (hjn : j < n) (ha : active j) + (hn : ∀ i, j < i → i < n → ¬active i) : N n ≤ N j+inc j := by + by_cases hnn : N n ≤ N j + · exact hnn.trans (le_add_of_nonneg_right (hi0 j)) + have hsmall (i : ℕ) (hji : j < i) (hin : i < n) : + coarseMass b (width d i) (thinShell x r (width d i)) ≤ t*(width d i)^(1/10 : ℝ) := + le_of_lt (lt_of_not_ge (hn i hji hin)) + obtain ⟨hpj,hpn⟩ := kernel_gap_errors b hCs hd hd1 hAt k x hjn hsmall + change ‖p j‖ ≤ errorGapConstant Cs*t*(width d j)^(-(1/50 : ℝ)) at hpj + change ‖p n‖ ≤ errorGapConstant Cs*t*(width d j)^(-(1/50 : ℝ)) at hpn + have hneg : inner ℝ e (P n) < 0 := by + by_contra hh + have hh' : N n = 0 := max_eq_left (by linarith [le_of_not_gt hh]) + exact hnn (by rw [hh']; exact hN0 j) + have hmass := cone_mass_of_nonpositive a he hκ + (kernel_lipschitz (k n) x).continuous.aestronglyMeasurable + (kernel_nonneg (k n) x) (kernel_le_one (k n) x) hneg.le + have hinterior : (∫ y in Metric.ball x (r-width d j), ‖a.density y‖) ≤ + (errorGapConstant Cs/κ)*t*(width d j)^(-(1/50 : ℝ)) := by + calc + _ ≤ ∫ y, kernel (k n) x y*‖a.density y‖ := + interior_mass_le_kernel a.integrable (k n) x (width_antitone hd.le hjn.le) + _ ≤ ‖p n‖/κ := hmass + _ ≤ (errorGapConstant Cs*t*(width d j)^(-(1/50 : ℝ)))/κ := div_le_div_of_nonneg_right hpn hκ.le + _ = _ := by ring + obtain ⟨z,hz,hzc⟩ := hcap j ha hinterior + have hzlo : (1 : ℝ)/2 ≤ ‖z-x‖ := by + have hh := (abs_le.mp (show |‖z-x‖-r| ≤ width d j from hz)).1 + linarith [hr.1,hwq j] + have hD3 : ∀ y ∈ thinShell x r (width d j), ‖y-x‖ ≤ 3 := by + intro y hy + have hh := (abs_le.mp (show |‖y-x‖-r| ≤ width d j from hy)).2 + linarith [hrw j] + have hcapb : coarseMass b (width d j) (thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ))) ≤ + 2*(t*(width d j)^(1/10 : ℝ)) := by + have hn : 0 ≤ ∫ y in thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ)), ‖a.density y‖ := + integral_nonneg (fun y => norm_nonneg _) + linarith + have hcapa : (∫ y in thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ)), ‖a.density y‖) ≤ + 2*(t*(width d j)^(1/10 : ℝ)) := by + linarith [coarseMass_nonneg b (width d j) (thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ)))] + let R := ∑ v, ∫ y, correction x z y*((kernel (k n) x y : ℂ)-kernel (k j) x y)*(b v).density y + have hR : ‖R‖ ≤ (16+4538*Cs)*t*(width d j)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := + corrected_kernel_gap b hCs hd hdq hr hAt k x z hjn hzlo hcapb hsmall + have hsupp : ∀ y, kernel (k n) x y-kernel (k j) x y ≠ 0 → y ∈ thinShell x r (width d j) := by + intro y hy + apply difference_support (k j) (k n) (width_antitone hd.le hjn.le) x y + simpa only [← Complex.ofReal_sub,ne_eq,Complex.ofReal_eq_zero] using hy + have hcor : P n-P j = + (∫ y, correction x z y*((kernel (k n) x y : ℂ)-kernel (k j) x y)*a.density y)+R := + balanced_kernel_gap_identity b a.integrable (k j) (k n) x z (hrw j) (hrw n) + (width_antitone hd.le hjn.le) (hM j) (hM n) + have hh := negative_gap_cap a he hκ (Real.rpow_nonneg (hwp j).le (1/5)) + (kernel_lipschitz (k j) x).continuous.aestronglyMeasurable + (kernel_lipschitz (k n) x).continuous.aestronglyMeasurable + (kernel_nonneg (k j) x) (kernel_le_one (k j) x) + (kernel_nonneg (k n) x) (kernel_le_one (k n) x) + (measurableSet_thinShell x r (width d j)) hsupp x z hzlo hD3 hcapa hpj hpn hneg hcor + change N n ≤ N j+4*(width d j)^(1/5 : ℝ)*((errorGapConstant Cs*t*(width d j)^(-(1/50 : ℝ)))/κ)+ + 7*(2*(t*(width d j)^(1/10 : ℝ)))+‖R‖ at hh + have hscale := direction_cap_scale hCs hκ (hwp j) (hw1 j) ht + dsimp only [inc] + linarith + let Z := (∫ y in Metric.ball x r, a.density y)+(∑ v, ∫ y in Metric.ball x r, (b v).density y) + have hlimP : Tendsto P atTop (𝓝 Z) := + (tendsto_kernel_pairing k (tendsto_width d) x a.integrable).add + (tendsto_finsetSum Finset.univ (fun v _ => tendsto_kernel_pairing k (tendsto_width d) x (b v).integrable)) + have hlimN : Tendsto N atTop (𝓝 (max 0 (-inner ℝ e Z))) := + tendsto_const_nhds.max ((tendsto_const_nhds.inner hlimP).neg) + have hsm : Summable inc := (summable_width_rpow hd.le (by norm_num : (0 : ℝ) < 1/10)).mul_left _ + have hh := last_active_limit active N inc B _ hi0 hsm hlimN hfirst hgap + dsimp only [inc] at hh + rw [tsum_mul_left,tsum_width_rpow hd.le (by norm_num : (0 : ℝ) < 1/10)] at hh + convert hh using 1; dsimp only [B,Z]; ring + +end LocalCancellation + +namespace LocalCancellation +open DiskKernels DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +def directionShellBound {Cs : ℝ} (b : ι → ErrorPiece Cs) (κ t δ : ℝ) : ℝ≥0∞ := + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ ^ 2 * + (ENNReal.ofReal (156*δ/δ^(1/5 : ℝ))* + ENNReal.ofReal (coarseMass b δ univ)*ENNReal.ofReal (coarseMass b δ univ)) + + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ * + ((ENNReal.ofReal (6*Real.pi)* + ENNReal.ofReal (2*(200*δ/(δ^(1/5 : ℝ))^2)* + (1+((errorGapConstant Cs/κ)*t*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ)))))* + ENNReal.ofReal (coarseMass b δ univ)) + +/-- Radius-independent exceptional union for the full directional sequence. +The cap property is produced by shell concentration for the actual densities. -/ +theorem direction_sequence {e : ℂ} {κ Cs d t : ℝ} (a : ConeDensity e κ) + (b : ι → ErrorPiece Cs) (he : ‖e‖ = 1) (hκ : 0 < κ) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hdq : d ≤ 1/4) + (hgeom : ∀ δ : ℝ, 0 < δ → δ ≤ d → δ ≤ (δ^(1/5 : ℝ))^2/1600) + (ht : 0 < t) (hAt : errorPrice b (1/100) ≤ t) : + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ ∑' n : ℕ, directionShellBound b κ t (width d n) ∧ + ∀ x ∉ E, ∀ r ∈ Icc (1 : ℝ) 2, + ∀ k : ∀ n : ℕ, RadiusDensity (r-width d n) (r+width d n) + ⟨216/width d n, div_nonneg (by norm_num) (width_pos hd n).le⟩, + (∀ n, (∫ y, star (y-x)*(kernel (k n) x y : ℂ)*a.density y)+ + (∑ v, ∫ y, star (y-x)*(kernel (k n) x y : ℂ)*(b v).density y) = 0) → + max 0 (-inner ℝ e ((∫ y in Metric.ball x r, a.density y)+ + (∑ v, ∫ y in Metric.ball x r, (b v).density y))) ≤ + (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100)+ + directionGapConstant Cs κ*t*d^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by + have : IsFiniteMeasure (densityMeasure a.density) := densityMeasure_finite a.integrable + have hd1 : d ≤ 1 := by linarith + have hwp (n : ℕ) := width_pos hd n + have hw1 (n : ℕ) := (width_le hd.le n).trans hd1 + have hρ (n : ℕ) : 0 < (width d n)^(1/5 : ℝ) := Real.rpow_pos_of_pos (hwp n) _ + have hρ1 (n : ℕ) : (width d n)^(1/5 : ℝ) ≤ 1 := + Real.rpow_le_one (hwp n).le (hw1 n) (by norm_num) + have hs (n : ℕ) := shell_concentration (coarseMeasure b (width d n)) (densityMeasure a.density) + (hρ n) (hρ1 n) (hwp n) (hgeom _ (hwp n) (width_le hd.le n)) + (mul_nonneg (mul_nonneg (div_nonneg (errorGapConstant_pos hCs).le hκ.le) ht.le) + (Real.rpow_nonneg (hwp n).le (-(1/50 : ℝ)))) + (mul_pos ht (Real.rpow_pos_of_pos (hwp n) (1/10 : ℝ))) + choose E hE hEv hEst using hs + refine ⟨⋃ n, E n, MeasurableSet.iUnion hE, + (measure_iUnion_le E).trans (ENNReal.tsum_le_tsum ?_), ?_⟩ + · intro n + simpa only [directionShellBound,coarseMeasure_apply b (width d n) MeasurableSet.univ] using hEv n + · intro x hx r hr k hM + apply direction_sequence_point a b he hκ hCs hd hdq hr hAt k x hM + intro j ha hi + have hxE : x ∉ E j := fun hh => hx (mem_iUnion.mpr ⟨j,hh⟩) + obtain ⟨z,hz,hcap⟩ := hEst j x hxE r hr + (by rw [coarseMeasure_apply b (width d j) (measurableSet_thinShell x r (width d j))]; exact ENNReal.ofReal_le_ofReal ha) + (by rw [densityMeasure_apply a.integrable measurableSet_ball]; exact ENNReal.ofReal_le_ofReal hi) + refine ⟨z,hz,?_⟩ + have hD : MeasurableSet (thinShell x r (width d j) \ Metric.ball z ((width d j)^(1/5 : ℝ))) := + (measurableSet_thinShell x r (width d j)).diff measurableSet_ball + rw [Measure.add_apply, densityMeasure_apply a.integrable hD, + coarseMeasure_apply b (width d j) hD, ← ENNReal.ofReal_add + (integral_nonneg (fun _ => norm_nonneg _)) (coarseMass_nonneg b (width d j) _)] at hcap + exact (ENNReal.ofReal_le_ofReal_iff (mul_nonneg (by norm_num) + (mul_nonneg ht.le (Real.rpow_nonneg (hwp j).le _)))).mp hcap + +end LocalCancellation + +namespace DiskMoments +open DiskKernels + +def NeighborhoodRadius (g : ℂ → ℝ) (x : ℂ) (r : ℝ) : Prop := + r ∈ Icc (1 : ℝ) 2 ∧ ∀ t : ℝ, 0 < t → |t-r| ≤ 1/4 → + signedAverage g x t ≤ signedAverage g x r + +lemma neighborhood_kernel {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) {x : ℂ} {r δ : ℝ} + (hr : NeighborhoodRadius g x r) (hδ : 0 < δ) (hδq : δ ≤ 1/4) : + ∃ k : RadiusDensity (r-δ) (r+δ) ⟨216/δ, by positivity⟩, + (∫ y, kernel k x y • (star (y-x)*gradient g y)) = 0 := by + apply balanced_kernel hg x hr.1 hδ hδq + · apply hr.2 _ (by linarith [hr.1.1]) + rw [abs_le] + constructor <;> linarith + · apply hr.2 _ (by linarith [hr.1.1]) + rw [abs_le] + constructor <;> linarith + +end DiskMoments + +namespace LocalCancellation +open DiskKernels DiskMoments DiskGeometry DiskScales +variable {ι : Type*} [Fintype ι] + +lemma mixed_moment_pairing_decomposition {Cs r δ : ℝ} (b : ι → ErrorPiece Cs) + {a : ℂ → ℂ} (ha : Integrable a) {M : ℝ≥0} (k : RadiusDensity (r-δ) (r+δ) M) + (x : ℂ) {h : ℂ → ℂ} (hr : r+δ ≤ 3) + (hh : ∀ᵐ y, y ∈ Metric.ball x 3 → a y+∑ j, (b j).density y = h y) : + (∫ y, star (y-x)*(kernel k x y : ℂ)*a y)+ + (∑ j, ∫ y, star (y-x)*(kernel k x y : ℂ)*(b j).density y) = + ∫ y, kernel k x y • (star (y-x)*h y) := by + rw [← integral_finsetSum _ (fun j _ => moment_pairing_integrable (b j) k x hr), + ← integral_add (general_moment_integrable ha k x hr) + (integrable_finsetSum _ (fun j _ => moment_pairing_integrable (b j) k x hr))] + apply integral_congr_ae + filter_upwards [hh] with y hy + simp only [← Finset.mul_sum, ← mul_add] + by_cases hmem : y ∈ Metric.ball x 3 + · rw [hy hmem, Complex.real_smul] + ring + · have hk : kernel k x y = 0 := kernel_zero k x (fun hb => hmem (lt_of_lt_of_le hb hr)) + rw [hk, Complex.ofReal_zero, mul_zero, zero_mul, zero_smul] + +lemma mixed_ball_pairing_decomposition {Cs r : ℝ} (b : ι → ErrorPiece Cs) + {a : ℂ → ℂ} (ha : Integrable a) (x : ℂ) {h : ℂ → ℂ} (hr : r ≤ 3) + (hh : ∀ᵐ y, y ∈ Metric.ball x 3 → a y+∑ j, (b j).density y = h y) : + (∫ y in Metric.ball x r, a y)+(∑ j, ∫ y in Metric.ball x r, (b j).density y) = + ∫ y in Metric.ball x r, h y := by + rw [← integral_finsetSum _ (fun j _ => (b j).integrable.integrableOn), + ← integral_add ha.integrableOn (integrable_finsetSum _ (fun j _ => (b j).integrable.integrableOn))] + apply setIntegral_congr_ae measurableSet_ball + filter_upwards [hh] with y hy hyb + exact hy (lt_of_lt_of_le hyb hr) + +/-- Directional estimate at all genuine neighborhood-maximizing radii, +with only the original local density equality. -/ +theorem direction_raw {e : ℂ} {κ Cs d t : ℝ} (a : ConeDensity e κ) + (b : ι → ErrorPiece Cs) (he : ‖e‖ = 1) (hκ : 0 < κ) + (hCs : 0 ≤ Cs) (hd : 0 < d) (hdq : d ≤ 1/4) + (hgeom : ∀ δ : ℝ, 0 < δ → δ ≤ d → δ ≤ (δ^(1/5 : ℝ))^2/1600) + (ht : 0 < t) (hAt : errorPrice b (1/100) ≤ t) + {g : ℂ → ℝ} (hg : ContDiff ℝ 1 g) : + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ ∑' n : ℕ, directionShellBound b κ t (width d n) ∧ + ∀ x ∉ E, + (∀ᵐ y, y ∈ Metric.ball x 3 → a.density y+∑ j, (b j).density y = gradient g y) → + ∀ r, NeighborhoodRadius g x r → + max 0 (-inner ℝ e (∫ y in Metric.ball x r, gradient g y)) ≤ + (1+216*Cs)/d^(1/100 : ℝ)*errorPrice b (1/100)+ + directionGapConstant Cs κ*t*d^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) := by + obtain ⟨E,hE,hEv,hEst⟩ := direction_sequence a b he hκ hCs hd hdq hgeom ht hAt + refine ⟨E,hE,hEv,?_⟩ + intro x hx hh r hr + choose k hk using fun n => neighborhood_kernel hg hr (width_pos hd n) ((width_le hd.le n).trans hdq) + rw [← mixed_ball_pairing_decomposition b a.integrable x (by linarith [hr.1.2]) hh] + apply hEst x hx r hr.1 k + intro n + rw [mixed_moment_pairing_decomposition b a.integrable (k n) x + (by linarith [hr.1.2,(width_le hd.le n).trans hdq]) hh] + exact hk n + +end LocalCancellation + +namespace DiskScales + +lemma third_power_identity {δ : ℝ} (hδ : 0 < δ) : + ((δ^(1/10 : ℝ))⁻¹ * (δ / (δ^(1/5 : ℝ))^2 * δ^(-(1/50 : ℝ)))) * + (δ^(-(1/50 : ℝ))/δ^(1/10 : ℝ)) = δ^(9/25 : ℝ) := by + rw [second_power_identity hδ, ← Real.rpow_sub hδ, ← Real.rpow_add hδ] + norm_num + +lemma direction_shell_tail_scaled {A t δ M H : ℝ} (hA : 0 ≤ A) (ht : 0 < t) + (hδ : 0 < δ) (hδ1 : δ ≤ 1) (hM0 : 0 ≤ M) (hH : 0 ≤ H) + (hM : M ≤ A*δ^(-(1/50 : ℝ))) : + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ ^ 2 * + (ENNReal.ofReal (156*δ/δ^(1/5 : ℝ))*ENNReal.ofReal M*ENNReal.ofReal M) + + (ENNReal.ofReal (t*δ^(1/10 : ℝ)))⁻¹ * + ((ENNReal.ofReal (6*Real.pi)*ENNReal.ofReal + (2*(200*δ/(δ^(1/5 : ℝ))^2)*(1+(H*t*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ)))))*ENNReal.ofReal M) ≤ + ENNReal.ofReal ((1+H)*(156*(A/t)^2*δ^(14/25 : ℝ)+2424*Real.pi*(A/t)*δ^(9/25 : ℝ))) := by + have hU : 0 < t*δ^(1/10 : ℝ) := mul_pos ht (Real.rpow_pos_of_pos hδ _) + rw [← ENNReal.ofReal_inv_of_pos hU, ← ENNReal.ofReal_pow (inv_nonneg.mpr hU.le)] + have hp : 0 ≤ 156*δ/δ^(1/5 : ℝ) := by positivity + have hp' : 0 ≤ 2*(200*δ/(δ^(1/5 : ℝ))^2)*(1+(H*t*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ))) := by positivity + rw [← ENNReal.ofReal_mul hp, ← ENNReal.ofReal_mul (mul_nonneg hp hM0), + ← ENNReal.ofReal_mul (sq_nonneg _), + ← ENNReal.ofReal_mul (show (0 : ℝ) ≤ 6*Real.pi by positivity), + ← ENNReal.ofReal_mul (mul_nonneg (by positivity) hp'), + ← ENNReal.ofReal_mul (inv_nonneg.mpr hU.le), + ← ENNReal.ofReal_add (by positivity) (by positivity)] + apply ENNReal.ofReal_le_ofReal + have hfirst : (t*δ^(1/10 : ℝ))⁻¹^2 * (156*δ/δ^(1/5 : ℝ)*M*M) ≤ + 156*(A/t)^2*δ^(14/25 : ℝ) := by + calc + _ ≤ (t*δ^(1/10 : ℝ))⁻¹^2 * + (156*δ/δ^(1/5 : ℝ)*(A*δ^(-(1/50 : ℝ)))*(A*δ^(-(1/50 : ℝ)))) := by gcongr + _ = _ := by rw [← first_power_identity hδ]; simp only [mul_inv_rev]; ring + have hratio : (H*t*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ)) = H*(δ^(-(1/50 : ℝ))/δ^(1/10 : ℝ)) := by + field_simp + have hsecond : (t*δ^(1/10 : ℝ))⁻¹ * + (6*Real.pi*(2*(200*δ/(δ^(1/5 : ℝ))^2)*(1+(H*t*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ))))*M) ≤ + (1+H)*(2400*Real.pi*(A/t)*δ^(9/25 : ℝ)) := by + calc + _ ≤ (t*δ^(1/10 : ℝ))⁻¹ * + (6*Real.pi*(2*(200*δ/(δ^(1/5 : ℝ))^2)*(1+(H*t*δ^(-(1/50 : ℝ)))/(t*δ^(1/10 : ℝ))))*(A*δ^(-(1/50 : ℝ)))) := by gcongr + _ = 2400*Real.pi*(A/t)*δ^(12/25 : ℝ)+H*(2400*Real.pi*(A/t)*δ^(9/25 : ℝ)) := by + rw [hratio, ← third_power_identity hδ, ← second_power_identity hδ] + simp only [mul_inv_rev] + ring + _ ≤ 2400*Real.pi*(A/t)*δ^(9/25 : ℝ)+H*(2400*Real.pi*(A/t)*δ^(9/25 : ℝ)) := + add_le_add (mul_le_mul_of_nonneg_left + (Real.rpow_le_rpow_of_exponent_ge hδ hδ1 (by norm_num : (9/25 : ℝ) ≤ 12/25)) + (by positivity : 0 ≤ 2400*Real.pi*(A/t))) le_rfl + _ = _ := by ring + have hfirst' : 156*(A/t)^2*δ^(14/25 : ℝ) ≤ (1+H)*(156*(A/t)^2*δ^(14/25 : ℝ)) := + le_mul_of_one_le_left (by positivity) (by linarith) + have hextra : (1+H)*(2400*Real.pi*(A/t)*δ^(9/25 : ℝ)) ≤ + (1+H)*(2424*Real.pi*(A/t)*δ^(9/25 : ℝ)) := by gcongr; norm_num + calc + _ ≤ (1+H)*(156*(A/t)^2*δ^(14/25 : ℝ))+(1+H)*(2424*Real.pi*(A/t)*δ^(9/25 : ℝ)) := + add_le_add (hfirst.trans hfirst') (hsecond.trans hextra) + _ = _ := by ring + +lemma direction_start_identity {Cs κ A t : ℝ} (hA : 0 < A) (ht : 0 < t) : + (1+216*Cs)/(A/t)^(1/100 : ℝ)*A+ + directionGapConstant Cs κ*t*(A/t)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) = + t*((1+216*Cs)*(A/t)^(99/100 : ℝ)+ + directionGapConstant Cs κ*(A/t)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) := by + have hq : 0 < A/t := div_pos hA ht + have he : (A/t)/(A/t)^(1/100 : ℝ) = (A/t)^(99/100 : ℝ) := by + have hh := Real.rpow_sub hq (1 : ℝ) (1/100 : ℝ) + norm_num at hh + exact hh.symm + have hAt : t*(A/t) = A := by field_simp + calc + _ = t*((1+216*Cs)*((A/t)/(A/t)^(1/100 : ℝ))+ + directionGapConstant Cs κ*(A/t)^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) := by + rw [mul_add] + congr 1 + · calc + _ = (1+216*Cs)/(A/t)^(1/100 : ℝ)*(t*(A/t)) := by rw [hAt] + _ = _ := by ring + · ring + _ = _ := by rw [he] + +lemma exists_direction_parameters (Cs κ : ℝ) : + ∃ d₀ : ℝ, 0 < d₀ ∧ d₀ ≤ 1/4 ∧ + (∀ δ : ℝ, 0 < δ → δ ≤ d₀ → δ ≤ (δ^(1/5 : ℝ))^2/1600) ∧ + (∀ δ : ℝ, 0 < δ → δ ≤ d₀ → + (1+216*Cs)*δ^(99/100 : ℝ)+ + directionGapConstant Cs κ*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ)) ≤ 1) := by + obtain ⟨d,hd,hdq,hgeom⟩ := exists_admissible_width + have ht : Tendsto (fun δ : ℝ => (1+216*Cs)*δ^(99/100 : ℝ)+ + directionGapConstant Cs κ*δ^(1/10 : ℝ)/(1-(1/2 : ℝ)^(1/10 : ℝ))) (𝓝 0) (𝓝 0) := by + have h1 := (Real.continuous_rpow_const (by norm_num : (0 : ℝ) ≤ 99/100)).tendsto 0 + have h2 := (Real.continuous_rpow_const (by norm_num : (0 : ℝ) ≤ 1/10)).tendsto 0 + simpa using (h1.const_mul (1+216*Cs)).add ((h2.const_mul (directionGapConstant Cs κ)).div_const _) + obtain ⟨l,u,hu,hs⟩ := mem_nhds_iff_exists_Ioo_subset.mp + (ht.eventually_lt_const (by norm_num : (0 : ℝ) < 1)) + let d₀ := min d (u/2) + have hd0 : 0 < d₀ := lt_min hd (by linarith [hu.2]) + refine ⟨d₀,hd0,(min_le_left _ _).trans hdq,fun δ hδ hδd => hgeom δ hδ (hδd.trans (min_le_left _ _)), ?_⟩ + intro δ hδ hδd + apply le_of_lt + apply hs + exact ⟨lt_trans hu.1 hδ, lt_of_le_of_lt hδd ((min_le_right _ _).trans_lt (by linarith [hu.2]))⟩ + +end DiskScales + +namespace DiskScales + +def directionTailConstant (Cs κ : ℝ) : ℝ := (1+errorGapConstant Cs/κ)*sizeTailConstant + +lemma directionTailConstant_pos {Cs κ : ℝ} (hCs : 0 ≤ Cs) (hκ : 0 < κ) : + 0 < directionTailConstant Cs κ := by + unfold directionTailConstant + have hh := errorGapConstant_pos hCs + exact mul_pos (by positivity) sizeTailConstant_pos + +end DiskScales + +namespace LocalCancellation +open DiskKernels DiskMoments DiskGeometry DiskScales + +/-- A genuine superlevel bound with exponent 34/25 > 1 for all neighborhood +maxima, independent of the number of positive or cancelling pieces. -/ +theorem direction_tail {Cs κ : ℝ} (hCs : 0 ≤ Cs) (hκ : 0 < κ) : + ∃ L : ℝ, 1 ≤ L ∧ ∀ {ι : Type*} [Fintype ι] {e : ℂ} (a : ConeDensity e κ) + (b : ι → ErrorPiece Cs), ‖e‖ = 1 → + 0 < errorPrice b (1/100) → ∀ t : ℝ, L*errorPrice b (1/100) ≤ t → + ∀ g : ℂ → ℝ, ContDiff ℝ 1 g → + ∃ E : Set ℂ, MeasurableSet E ∧ + volume E ≤ ENNReal.ofReal (directionTailConstant Cs κ*(errorPrice b (1/100)/t)^(34/25 : ℝ)) ∧ + ∀ x ∉ E, + (∀ᵐ y, y ∈ Metric.ball x 3 → a.density y+∑ j, (b j).density y = gradient g y) → + ∀ r, NeighborhoodRadius g x r → + max 0 (-inner ℝ e (∫ y in Metric.ball x r, gradient g y)) ≤ t := by + obtain ⟨d₀,hd0,hdq,hgeom,hsmall⟩ := exists_direction_parameters Cs κ + have hL : 1 ≤ (1 : ℝ)/d₀ := (le_div_iff₀ hd0).mpr (by linarith) + refine ⟨1/d₀,hL,?_⟩ + intro ι _ e a b he hA t ht g hg + let A := errorPrice b (1/100) + let H := errorGapConstant Cs/κ + have hH : 0 ≤ H := div_nonneg (errorGapConstant_pos hCs).le hκ.le + have hH1 : 0 ≤ 1+H := by linarith + have hAt : A ≤ t := (le_mul_of_one_le_left hA.le hL).trans ht + have ht0 : 0 < t := lt_of_lt_of_le hA hAt + have hqd : A/t ≤ d₀ := by + apply (div_le_iff₀ ht0).mpr + have hh : A/d₀ ≤ t := by simpa only [A,one_div, div_eq_mul_inv, mul_comm, mul_one] using ht + have hh' := (div_le_iff₀ hd0).mp hh + linarith + have hq0 : 0 < A/t := div_pos hA ht0 + have hq1 : A/t ≤ 1 := by linarith + have hqq : A/t ≤ 1/4 := hqd.trans hdq + obtain ⟨E,hE,hEv,hEst⟩ := direction_raw a b he hκ hCs hq0 hqq + (fun δ hδ hδq => hgeom δ hδ (hδq.trans hqd)) ht0 hAt hg + refine ⟨E,hE,?_,?_⟩ + · apply hEv.trans + calc + _ ≤ ∑' n : ℕ, ENNReal.ofReal (1+H)*ENNReal.ofReal + (156*(A/t)^2*(width (A/t) n)^(14/25 : ℝ)+ + 2424*Real.pi*(A/t)*(width (A/t) n)^(9/25 : ℝ)) := by + apply ENNReal.tsum_le_tsum + intro n + rw [← ENNReal.ofReal_mul hH1] + apply direction_shell_tail_scaled hA.le ht0 (width_pos hq0 n) + ((width_le hq0.le n).trans hq1) (coarseMass_nonneg b _ _) hH + have hw0 := width_pos hq0 n + have hh := coarseMass_bound b (by norm_num : (0 : ℝ) ≤ 1/100) hw0 + norm_num at hh + rw [Real.rpow_neg hw0.le] + exact hh + _ = ENNReal.ofReal (1+H)*ENNReal.ofReal + ((156/(1-(1/2 : ℝ)^(14/25 : ℝ)))*(A/t)^(64/25 : ℝ)+ + (2424*Real.pi/(1-(1/2 : ℝ)^(9/25 : ℝ)))*(A/t)^(34/25 : ℝ)) := by + rw [ENNReal.tsum_mul_left,geometric_tail_sum hA.le ht0 hq0.le, starting_width_tail hA ht0] + _ ≤ ENNReal.ofReal (1+H)*ENNReal.ofReal (sizeTailConstant*(A/t)^(34/25 : ℝ)) := by + gcongr + exact collapse_size_tail hq0 hq1 + _ = _ := by rw [← ENNReal.ofReal_mul hH1]; congr 1; dsimp only [directionTailConstant,H,A]; ring + · intro x hx hh r hr + apply (hEst x hx hh r hr).trans + rw [direction_start_identity hA ht0] + exact (mul_le_mul_of_nonneg_left (hsmall _ hq0 hqd) ht0.le).trans_eq (mul_one t) + +lemma cone_ball_nonneg {e : ℂ} {κ : ℝ} (a : ConeDensity e κ) (hκ : 0 ≤ κ) (x : ℂ) (r : ℝ) : + 0 ≤ inner ℝ e (∫ y in Metric.ball x r, a.density y) := by + rw [← integral_inner a.integrable.integrableOn e] + apply integral_nonneg_of_ae + filter_upwards [ae_restrict_of_ae a.cone] with y hy + exact (mul_nonneg hκ (norm_nonneg _)).trans hy + +/-- Full Borel integrable directional price. This is the hard local +cancellation estimate, not an assumed maximal-operator endpoint. -/ +theorem direction_majorant {Cs κ : ℝ} (hCs : 0 ≤ Cs) (hκ : 0 < κ) : + ∃ C : ℝ, 0 < C ∧ ∀ {ι : Type*} [Fintype ι] {e : ℂ} (a : ConeDensity e κ) + (b : ι → ErrorPiece Cs), ‖e‖ = 1 → + ∀ g : ℂ → ℝ, ContDiff ℝ 1 g → ∀ Q : Set ℂ, volume Q ≤ ENNReal.ofReal 1 → + ∃ F : ℂ → ℝ≥0∞, Measurable F ∧ + (∫⁻ x in Q, F x) ≤ ENNReal.ofReal (C*errorPrice b (1/100)) ∧ + ∀ x, (∀ᵐ y, y ∈ Metric.ball x 3 → a.density y+∑ j, (b j).density y = gradient g y) → + ∀ r, NeighborhoodRadius g x r → + ENNReal.ofReal (max 0 (-inner ℝ e (∫ y in Metric.ball x r, gradient g y))) ≤ F x := by + obtain ⟨L,hL,hdir⟩ := direction_tail hCs hκ + let c : ℝ := (1/2 : ℝ)^(34/25 : ℝ) + have hc : 0 ≤ c := Real.rpow_nonneg (by norm_num) _ + have hc1 : 2*c < 1 := by + have hh := Real.rpow_lt_rpow_of_exponent_gt (by norm_num : (0 : ℝ) < 1/2) + (by norm_num : (1/2 : ℝ) < 1) (by norm_num : (1 : ℝ) < 34/25) + norm_num at hh + linarith + let C := L*(1+2*directionTailConstant Cs κ/(1-2*c)) + have hD := directionTailConstant_pos hCs hκ + have hC : 0 < C := mul_pos (by linarith) (by + have := sub_pos.mpr hc1 + positivity) + refine ⟨C,hC,?_⟩ + intro ι _ e a b he g hg Q hQ + let A := errorPrice b (1/100) + by_cases hAz : A = 0 + · refine ⟨0,measurable_const,?_,?_⟩ + · simp only [Pi.zero_apply, lintegral_zero, A, hAz, mul_zero, ENNReal.ofReal_zero, le_refl] + · intro x hh r hr + have hz := errorPrice_zero b hAz + have hs : (∑ j, ∫ y in Metric.ball x r, (b j).density y) = 0 := by + apply Finset.sum_eq_zero + intro j _ + exact integral_eq_zero_of_ae (ae_restrict_of_ae (hz j)) + have hb := mixed_ball_pairing_decomposition b a.integrable x (by linarith [hr.1.2] : r ≤ 3) hh + rw [← hb,hs,add_zero,max_eq_left (neg_nonpos.mpr (cone_ball_nonneg a hκ.le x r)),ENNReal.ofReal_zero] + exact le_refl _ + · have hA : 0 < A := lt_of_le_of_ne (errorPrice_nonneg b _) (Ne.symm hAz) + have ht : 0 < L*A := mul_pos (by linarith) hA + have hts (n : ℕ) : L*A ≤ L*A*2^n := le_mul_of_one_le_right ht.le (one_le_pow₀ (by norm_num)) + choose E hE hEv hbound using fun n : ℕ => hdir a b he hA (L*A*2^n) (hts n) g hg + refine ⟨DyadicMajorant.price (L*A) E, DyadicMajorant.measurable_price _ hE,?_,?_⟩ + · have htail (n : ℕ) : volume (E n) ≤ ENNReal.ofReal (directionTailConstant Cs κ*c^n) := by + apply (hEv n).trans + apply ENNReal.ofReal_le_ofReal + apply mul_le_mul_of_nonneg_left _ hD.le + calc + _ ≤ ((1/2 : ℝ)^n)^(34/25 : ℝ) := Real.rpow_le_rpow (by positivity) (dyadic_ratio hA hL n) (by norm_num) + _ = c^n := by + rw [← Real.rpow_natCast, ← Real.rpow_mul (by norm_num), mul_comm (n : ℝ), + Real.rpow_mul (by norm_num), Real.rpow_natCast] + have hi := DyadicMajorant.lintegral_price_geometric volume (by norm_num : (0 : ℝ) ≤ 1) hQ ht.le + hD.le hc hc1 hE htail + convert hi using 1 + congr 1 + dsimp [C,A] + ring + · intro x hh r hr + apply DyadicMajorant.majorizes ht + intro n hn + exact hbound n x hn hh r hr + +end LocalCancellation + +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +noncomputable section + +end +end + +end OAI diff --git a/lean/OAI/Analysis/DiskMaximal/WeakLimits.lean b/lean/OAI/Analysis/DiskMaximal/WeakLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..ecc169ead8eb3e6dc498e7c838262eff964dbc50 --- /dev/null +++ b/lean/OAI/Analysis/DiskMaximal/WeakLimits.lean @@ -0,0 +1,708 @@ +import OAI.Analysis.DiskMaximal.Approximation + +namespace OAI + +open MeasureTheory Set +open scoped ENNReal NNReal Topology ContDiff +open scoped RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology ENNReal +open scoped Real RealInnerProductSpace +open MeasureTheory Set Filter +open scoped Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Filter +open scoped Topology Interval NNReal +open MeasureTheory Set Filter +open scoped Topology NNReal Real +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal +open MeasureTheory Set +open scoped ENNReal NNReal +open Finset +open scoped RealInnerProductSpace +open MeasureTheory Set Metric +open scoped ENNReal NNReal Topology +open MeasureTheory Set +open scoped ENNReal NNReal RealInnerProductSpace +open MeasureTheory Set +open scoped ENNReal NNReal Topology +open MeasureTheory Set Metric +open scoped ENNReal NNReal RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped RealInnerProductSpace +open scoped ContDiff +open Finset +open MeasureTheory Set Metric Filter +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory MeasureTheory.Measure Set Filter +open scoped ENNReal NNReal Topology RealInnerProductSpace ContDiff +open MeasureTheory Set Metric Filter Finset +open scoped ENNReal NNReal RealInnerProductSpace ContDiff Topology +open MeasureTheory Set +open scoped RealInnerProductSpace + +noncomputable section + +namespace WeakCompact +open CompactlySupported CompactlySupportedContinuousMap + +/-- A single free ultrafilter furnishes simultaneous weak limits; no sequence +of gradients or a Radon representation is being added as an assumption. -/ +lemma bounded_tendsto {a : ℕ → ℝ} {B : ℝ} (hb : ∀ n, |a n| ≤ B) : + Tendsto a (hyperfilter ℕ) (𝓝 (limUnder (hyperfilter ℕ) a)) := by + apply tendsto_nhds_limUnder + obtain ⟨x,hx,hj⟩ := isCompact_Icc.ultrafilter_le_nhds + ((hyperfilter ℕ).map a) (by + change Filter.map a (hyperfilter ℕ) ≤ 𝓟 (Icc (-B) B) + rw [le_principal_iff] + change ∀ᶠ n : ℕ in hyperfilter ℕ, a n ∈ Icc (-B) B + exact Eventually.of_forall (fun n => abs_le.mp (hb n))) + exact ⟨x,hj⟩ + +variable {X : Type*} [TopologicalSpace X] + (Λ : ℕ → (C_c(X, ℝ) →ₚ[ℝ] ℝ)) {B : ℝ} + (hb : ∀ n (f : C_c(X, ℝ)), |Λ n f| ≤ B*‖f.toBoundedContinuousFunction‖) + +def limitValue (f : C_c(X, ℝ)) : ℝ := limUnder (hyperfilter ℕ) (fun n => Λ n f) + +include hb + +lemma limit_tendsto (f : C_c(X, ℝ)) : + Tendsto (fun n => Λ n f) (hyperfilter ℕ) (𝓝 (limitValue Λ f)) := bounded_tendsto (fun n => hb n f) + +def limitPositive : C_c(X, ℝ) →ₚ[ℝ] ℝ where + toFun := limitValue Λ + map_add' f g := tendsto_nhds_unique (limit_tendsto Λ hb (f+g)) + (by simpa only [map_add] using (limit_tendsto Λ hb f).add (limit_tendsto Λ hb g)) + map_smul' c f := tendsto_nhds_unique (limit_tendsto Λ hb (c • f)) + (by simpa only [map_smul, smul_eq_mul, RingHom.id_apply] using (limit_tendsto Λ hb f).const_mul c) + monotone' := by + intro f g hfg + exact le_of_tendsto_of_tendsto (limit_tendsto Λ hb f) (limit_tendsto Λ hb g) + (Eventually.of_forall (fun n => (Λ n).mono hfg)) + +lemma limit_bound (f : C_c(X, ℝ)) : |limitPositive Λ hb f| ≤ B*‖f.toBoundedContinuousFunction‖ := + le_of_tendsto (limit_tendsto Λ hb f).abs (Eventually.of_forall (fun n => hb n f)) + +variable [T2Space X] [MeasurableSpace X] [BorelSpace X] [LocallyCompactSpace X] + +def limitMeasure : Measure X := RealRMK.rieszMeasure (limitPositive Λ hb) + +lemma integral_limitMeasure (f : C_c(X, ℝ)) : + Tendsto (fun n => Λ n f) (hyperfilter ℕ) (𝓝 (∫ x, f x ∂limitMeasure Λ hb)) := by + rw [limitMeasure,RealRMK.integral_rieszMeasure] + exact limit_tendsto Λ hb f + +lemma limitMeasure_compact_bound (hB : 0 ≤ B) {K : Set X} (hK : IsCompact K) : + limitMeasure Λ hb K ≤ ENNReal.ofReal B := by + obtain ⟨f,hf1,hfc,-,hf⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen hK isOpen_univ (subset_univ K) + let f' : C_c(X, ℝ) := ⟨f,hfc⟩ + have hm := RealRMK.rieszMeasure_le_of_eq_one (limitPositive Λ hb) (f := f') (fun x => (hf x).1) hK hf1 + have hn : ‖f'.toBoundedContinuousFunction‖ ≤ 1 := by + apply (BoundedContinuousFunction.norm_le (by norm_num)).mpr + intro x + change ‖f x‖ ≤ 1 + rw [Real.norm_eq_abs,abs_of_nonneg (hf x).1] + exact (hf x).2 + have he : limitPositive Λ hb f' ≤ B := + (le_abs_self _).trans ((limit_bound Λ hb f').trans ((mul_le_mul_of_nonneg_left hn hB).trans_eq (mul_one B))) + exact hm.trans (ENNReal.ofReal_le_ofReal he) + +lemma limitMeasure_finite_bound (hB : 0 ≤ B) : limitMeasure Λ hb univ ≤ ENNReal.ofReal B := by + have : (limitMeasure Λ hb).Regular := RealRMK.regular_rieszMeasure _ + rw [isOpen_univ.measure_eq_iSup_isCompact] + exact iSup_le (fun K => iSup_le (fun _ => iSup_le (fun hK => limitMeasure_compact_bound Λ hb hB hK))) + +end WeakCompact + +namespace WeakSobolev +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] + [FiniteDimensional ℝ E] [MeasurableSpace E] [BorelSpace E] + {μ : Measure E} [μ.IsAddHaarMeasure] + +lemma gradient_l1_eq {u : E → ℝ} (hu : ContDiff ℝ 1 u) (hc : HasCompactSupport u) : + eLpNorm (fderiv ℝ u) 1 μ = ENNReal.ofReal (∫ x, ‖gradient u x‖ ∂μ) := by + rw [eLpNorm_one_eq_lintegral_enorm (hu.continuous_fderiv one_ne_zero).aestronglyMeasurable, + ← ofReal_integral_norm_eq_lintegral_enorm + ((hu.continuous_fderiv one_ne_zero).integrable_of_hasCompactSupport (hc.fderiv ℝ))] + simp only [gradient,(InnerProductSpace.toDual ℝ E).symm.norm_map] + +lemma smooth_sobolev_two (hd : Module.finrank ℝ E = 2) + {u : E → ℝ} (hu : ContDiff ℝ 1 u) (hc : HasCompactSupport u) : + eLpNorm u 2 μ ≤ (MeasureTheory.eLpNormLESNormFDerivOneConst μ 2 : ℝ≥0∞) * + ENNReal.ofReal (∫ x, ‖gradient u x‖ ∂μ) := by + have hp : NNReal.HolderConjugate (Module.finrank ℝ E) 2 := by + rw [hd] + exact NNReal.HolderConjugate.two_two + simpa only [gradient_l1_eq hu hc,ENNReal.coe_ofNat,NNReal.coe_ofNat] using + MeasureTheory.eLpNorm_le_eLpNorm_fderiv_one μ hu hc hp + +lemma gradient_integral_le {u : E → ℝ} {g : E → E} + (hu : ContDiff ℝ 1 u) (hc : HasCompactSupport u) (hg : Integrable g μ) : + (∫ x, ‖gradient u x‖ ∂μ) ≤ (∫ x, ‖g x‖ ∂μ)+(∫ x, ‖gradient u x-g x‖ ∂μ) := by + have hi : Integrable (gradient u) μ := + ((InnerProductSpace.toDual ℝ E).symm.toContinuousLinearMap.integrable_comp + ((hu.continuous_fderiv one_ne_zero).integrable_of_hasCompactSupport (hc.fderiv ℝ))) + have he := integral_add hg.norm (hi.sub hg).norm + simp only [Pi.sub_apply] at he + rw [← he] + exact integral_mono hi.norm (hg.norm.add (hi.sub hg).norm) (fun x => by + simpa only [norm_sub_rev] using norm_le_norm_add_norm_sub (g x) (gradient u x)) + +/-- The planar Sobolev embedding extended by genuine strong W11 density. +The harmless slack one is used only for finiteness/local convergence. -/ +lemma sobolev_two_le (hd : Module.finrank ℝ E = 2) + {f : E → ℝ} {g : E → E} (hf : Integrable f μ) (hg : Integrable g μ) + (hw : HasGradient (μ := μ) f g) : + eLpNorm f 2 μ ≤ (MeasureTheory.eLpNormLESNormFDerivOneConst μ 2 : ℝ≥0∞) * + ENNReal.ofReal ((∫ x, ‖g x‖ ∂μ)+1) := by + obtain ⟨u,hu,-,ht,ha⟩ := exists_smooth_sequence hf hg hw + apply Lp.eLpNorm_le_of_ae_tendsto _ (fun n => (hu n).1.continuous.aestronglyMeasurable) + hf.aestronglyMeasurable ha + filter_upwards [ht.eventually (gt_mem_nhds (by norm_num : (0:ℝ)<1))] with n hn + apply (smooth_sobolev_two hd ((hu n).1.of_le (by simp)) (hu n).2).trans + apply mul_le_mul' le_rfl + apply ENNReal.ofReal_le_ofReal + exact (gradient_integral_le ((hu n).1.of_le (by simp)) (hu n).2 hg).trans (by linarith) + +lemma memLp_two (hd : Module.finrank ℝ E = 2) + {f : E → ℝ} {g : E → E} (hf : Integrable f μ) (hg : Integrable g μ) + (hw : HasGradient (μ := μ) f g) : MemLp f 2 μ := + (sobolev_two_le hd hf hg hw).trans_lt (by finiteness) + +lemma lipschitz_hasGradient {f : E → ℝ} {L : ℝ≥0} (hf : LipschitzWith L f) : + HasGradient (μ := μ) f (gradient f) := by + intro φ hφ hc v + obtain ⟨K,hK⟩ := hφ.lipschitzWith_of_hasCompactSupport hc (by simp) + exact _root_.OAI.LipschitzWith.integral_mul_fderiv_eq_neg hf hK hc v +end WeakSobolev + +namespace DiskMaximalTools +lemma rationalMaximal_ae_finite (ν : Measure ℂ) [IsFiniteMeasure ν] : + ∀ᵐ x, rationalMaximal ν x ≠ ⊤ := by + rw [ae_iff] + simp only [not_not] + change volume {x | rationalMaximal ν x = ⊤} = 0 + apply le_antisymm _ (bot_le) + have ht := ENNReal.Tendsto.const_mul ENNReal.tendsto_inv_nat_nhds_zero + (a := (25:ℝ≥0∞)) (Or.inr (by norm_num)) + have ht' := ENNReal.Tendsto.mul_const ht (b := ν univ) (Or.inr (measure_ne_top _ _)) + simp only [mul_zero,zero_mul] at ht' + apply le_of_tendsto_of_tendsto tendsto_const_nhds ht' + filter_upwards [eventually_gt_atTop (0:ℕ)] with n hn + have h := weak_rationalMaximal (ν := ν) (by exact_mod_cast hn : (0:ℝ) ENNReal.ofReal |f y|) + +lemma absoluteMeasure_finite {f : ℂ → ℝ} (hf : Integrable f) : IsFiniteMeasure (absoluteMeasure f) := by + apply isFiniteMeasure_withDensity + rw [← ofReal_integral_eq_lintegral_ofReal hf.abs (ae_of_all _ (fun x => abs_nonneg (f x)))] + exact ENNReal.ofReal_ne_top + +lemma absoluteMeasure_congr {f g : ℂ → ℝ} (h : f =ᵐ[volume] g) : absoluteMeasure f = absoluteMeasure g := + withDensity_congr_ae (h.mono (fun x hx => by simp only [hx])) + +def maximalComplex (f : ℂ → ℝ) (x : ℂ) : ℝ≥0∞ := rationalMaximal (absoluteMeasure f) x +def maximalComplexReal (f : ℂ → ℝ) (x : ℂ) : ℝ := (maximalComplex f x).toReal + +lemma memLp_maximalComplexReal_of_measurable {f : ℂ → ℝ} (hm : Measurable f) + (hf : Integrable f) (hp : MemLp f 2) : MemLp (maximalComplexReal f) 2 := by + let _ := absoluteMeasure_finite hf + have hmax : AEStronglyMeasurable (maximalComplexReal f) volume := + (measurable_rationalMaximal _).ennreal_toReal.aestronglyMeasurable + rw [memLp_iff, eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top + (by norm_num : (2:ℝ≥0∞) ≠ 0) (by norm_num) hmax] + let _ : IsFiniteMeasure (volume.withDensity (fun x => ENNReal.ofReal |f x|)) := absoluteMeasure_finite hf + have h := strong_rationalMaximal hm.abs (fun x => abs_nonneg (f x)) (by norm_num : (1:ℝ)<2) + have hi := lintegral_rpow_enorm_lt_top_of_eLpNorm_lt_top (by norm_num : (2:ℝ≥0∞) ≠ 0) (by norm_num) hp.eLpNorm_lt_top + simp only [ENNReal.toReal_ofNat, ← ofReal_norm,Real.norm_eq_abs, + ] at hi + have hi' : ∫⁻ x, ENNReal.ofReal (|f x| ^ (2:ℝ)) < (⊤:ℝ≥0∞) := by + simpa only [ENNReal.ofReal_rpow_of_nonneg (abs_nonneg _) (by norm_num : (0:ℝ)≤2)] using hi + have ht := h.trans_lt (ENNReal.mul_lt_top ENNReal.ofReal_lt_top hi') + simpa only [maximalComplexReal,maximalComplex,absoluteMeasure,ENNReal.toReal_ofNat, + ← ofReal_norm,Real.norm_eq_abs,abs_of_nonneg ENNReal.toReal_nonneg, + ← ENNReal.ofReal_rpow_of_nonneg ENNReal.toReal_nonneg (by norm_num : (0:ℝ)≤2)] using ht + +lemma memLp_maximalComplexReal {f : ℂ → ℝ} (hf : Integrable f) (hp : MemLp f 2) : + MemLp (maximalComplexReal f) 2 := by + let g := hf.aestronglyMeasurable.mk f + have he : f =ᵐ[volume] g := hf.aestronglyMeasurable.ae_eq_mk + have hm : Measurable g := hf.aestronglyMeasurable.stronglyMeasurable_mk.measurable + have h := memLp_maximalComplexReal_of_measurable hm (hf.congr he) (hp.ae_eq he) + have heM : maximalComplexReal f = maximalComplexReal g := by + unfold maximalComplexReal maximalComplex + rw [absoluteMeasure_congr he] + rwa [heM] + +lemma maximalComplex_ae_finite {f : ℂ → ℝ} (hf : Integrable f) : + ∀ᵐ x, maximalComplex f x ≠ ⊤ := by + let _ := absoluteMeasure_finite hf + exact rationalMaximal_ae_finite _ + +lemma maximalComplex_eq_all_radii (f : ℂ → ℝ) (x : ℂ) : + maximalComplex f x = ⨆ (r : ℝ) (_ : 0 ∫ x, ‖u n x-f x‖ ∂μ) atTop (𝓝 0)) : + Tendsto (fun n => ∫ x, ‖u n x‖ ∂μ) atTop (𝓝 (∫ x, ‖f x‖ ∂μ)) := by + apply integral_converges_norm hf.norm (fun n => (hu n).norm) + apply squeeze_zero (fun n => integral_nonneg (fun x => norm_nonneg _)) _ ht + intro n + apply integral_mono ((hu n).norm.sub hf.norm).norm ((hu n).sub hf).norm + intro x + simpa only [Real.norm_eq_abs,Pi.sub_apply] using abs_norm_sub_norm_le (u n x) (f x) +end WeakSobolev + +namespace SobolevBand +open DiskMoments RadiusEnvelope + +def band (f : ℂ → ℝ) (a b : ℝ) := envelope (fun r x => signedAverage f x r) a b + +lemma average_abs_le {f : ℂ → ℝ} (hf : Integrable f) {a t : ℝ} + (ha : 0 < a) (hat : a ≤ t) (x : ℂ) : + |signedAverage f x t| ≤ (∫ y, ‖f y‖)/(Real.pi*a^2) := by + have ht : 0 < t := ha.trans_le hat + have hden : 0 < Real.pi*a^2 := mul_pos Real.pi_pos (sq_pos_of_pos ha) + rw [signedAverage,abs_div,abs_of_pos (mul_pos Real.pi_pos (sq_pos_of_pos ht))] + have he : |∫ y in Metric.ball x t, f y| ≤ ∫ y, ‖f y‖ := by + simpa only [Real.norm_eq_abs] using (norm_integral_le_integral_norm f).trans + (setIntegral_le_integral hf.norm (ae_of_all _ (fun y => norm_nonneg (f y)))) + apply (div_le_div_of_nonneg_right he (by positivity : 0≤Real.pi*t^2)).trans + exact div_le_div_of_nonneg_left (integral_nonneg (fun y => norm_nonneg (f y))) hden + (mul_le_mul_of_nonneg_left (sq_le_sq₀ ha.le ht.le |>.mpr hat) Real.pi_pos.le) + +lemma average_sub {f h : ℂ → ℝ} (hf : Integrable f) (hh : Integrable h) (x : ℂ) (t : ℝ) : + signedAverage f x t-signedAverage h x t = signedAverage (f-h) x t := by + simp only [signedAverage,Pi.sub_apply,integral_sub hf.integrableOn hh.integrableOn,sub_div] + +lemma values_bdd {f : ℂ → ℝ} (hf : Integrable f) {a b : ℝ} (ha : 0 < a) (x : ℂ) : + BddAbove ((fun r => signedAverage f x r) '' Icc a b) := by + refine ⟨(∫ y, ‖f y‖)/(Real.pi*a^2),?_⟩ + rintro _ ⟨r,hr,rfl⟩ + exact (le_abs_self _).trans (average_abs_le hf ha hr.1 x) + +lemma average_le_band {f : ℂ → ℝ} (hf : Integrable f) {a b r : ℝ} + (ha : 0 signedAverage f x t) := by + obtain ⟨L,hL⟩ := hf.lipschitzWith_of_hasCompactSupport hc one_ne_zero + have hD := fun y => norm_fderiv_le_of_lipschitz ℝ hL (x₀ := y) + have hi : Integrable (gradient f) := (continuous_gradient hf).integrable_of_hasCompactSupport (gradient_hasCompactSupport hc) + have ht := ha.trans_le hat + apply lipschitzWith_of_nnnorm_fderiv_le (fun x => (hasFDerivAt_signedAverage hf hD x ht).differentiableAt) + intro x + change ‖fderiv ℝ (fun x => signedAverage f x t) x‖ ≤ _ + rw [← (InnerProductSpace.toDual ℝ ℂ).symm.norm_map] + change ‖gradient (fun x => signedAverage f x t) x‖ ≤ _ + rw [gradient_signedAverage hf hD x ht,norm_smul,Real.norm_eq_abs,abs_of_pos (by positivity : 0<(Real.pi*t^2)⁻¹)] + have he : ‖∫ y in Metric.ball x t, gradient f y‖ ≤ ∫ y, ‖gradient f y‖ := + (norm_integral_le_integral_norm _).trans (setIntegral_le_integral hi.norm (ae_of_all _ (fun y => norm_nonneg _))) + rw [← div_eq_inv_mul] + exact (div_le_div_of_nonneg_right he (by positivity)).trans + (div_le_div_of_nonneg_left (integral_nonneg (fun y => norm_nonneg _)) (by positivity) + (mul_le_mul_of_nonneg_left (sq_le_sq₀ ha.le ht.le |>.mpr hat) Real.pi_pos.le)) + +lemma smooth_band_lipschitz {f : ℂ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + {a b : ℝ} (ha : 0 signedAverage_radius_continuousOn hf x ha) + (fun _ hr => smooth_average_lipschitz hf hc ha hr.1) + +lemma band_converges {f : ℂ → ℝ} {u : ℕ → ℂ → ℝ} (hf : Integrable f) (hu : ∀ n, Integrable (u n)) + (ht : Tendsto (fun n => ∫ x, ‖u n x-f x‖) atTop (𝓝 0)) + {a b : ℝ} (ha : 0 band (u n) a b x) atTop (𝓝 (band f a b x)) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + apply squeeze_zero (fun _ => norm_nonneg _) + (fun n => by simpa only [Real.norm_eq_abs] using band_sub_le (hu n) hf ha hab x) + simpa only [zero_div,Real.norm_eq_abs] using ht.div_const (Real.pi*a^2) + +lemma band_lipschitz {f : ℂ → ℝ} {g : ℂ → ℂ} (hf : Integrable f) (hg : Integrable g) + (hw : WeakSobolev.HasGradient (μ := volume) f g) {a b : ℝ} (ha : 0 (smooth_band_lipschitz ((hu n).1.of_le (by simp)) (hu n).2 ha hab).dist_le_mul x y) +end SobolevBand + +namespace WeakCompact +open CompactlySupported CompactlySupportedContinuousMap +variable {X : Type*} [TopologicalSpace X] [T2Space X] [MeasurableSpace X] [BorelSpace X] + [LocallyCompactSpace X] {μ : Measure X} + +omit [T2Space X] [LocallyCompactSpace X] in +lemma density_test_integrable {w : X → ℝ} (hw : Integrable w μ) (φ : C_c(X,ℝ)) : + Integrable (fun x => w x*φ x) μ := by + apply hw.mul_bdd φ.continuous.aestronglyMeasurable + exact ae_of_all _ (fun x => φ.toBoundedContinuousFunction.norm_coe_le_norm x) + +def densityPositive {w : X → ℝ} (hw : Integrable w μ) (h0 : ∀ᵐ x ∂μ, 0≤w x) : C_c(X,ℝ) →ₚ[ℝ] ℝ where + toFun φ := ∫ x, w x*φ x ∂μ + map_add' φ ψ := by + simp only [CompactlySupportedContinuousMap.coe_add,Pi.add_apply,mul_add] + exact integral_add (density_test_integrable hw φ) (density_test_integrable hw ψ) + map_smul' c φ := by + simp only [CompactlySupportedContinuousMap.coe_smul,Pi.smul_apply,smul_eq_mul,RingHom.id_apply] + simp_rw [← mul_assoc,mul_comm (w _) c,mul_assoc] + exact integral_const_mul c _ + monotone' := by + intro φ ψ hφψ + apply integral_mono_ae (density_test_integrable hw φ) (density_test_integrable hw ψ) + filter_upwards [h0] with x hx + exact mul_le_mul_of_nonneg_left (hφψ x) hx + +omit [T2Space X] [LocallyCompactSpace X] in +lemma densityPositive_bound {w : X → ℝ} (hw : Integrable w μ) (h0 : ∀ᵐ x ∂μ, 0≤w x) (φ : C_c(X,ℝ)) : + |densityPositive hw h0 φ| ≤ (∫ x,w x ∂μ)*‖φ.toBoundedContinuousFunction‖ := by + apply (show |∫ x,w x*φ x ∂μ| ≤ ∫ x,‖w x*φ x‖ ∂μ by exact norm_integral_le_integral_norm (fun x => w x*φ x)).trans + rw [← integral_mul_const] + apply integral_mono_ae (density_test_integrable hw φ).norm (hw.mul_const _) + filter_upwards [h0] with x hx + rw [norm_mul,Real.norm_eq_abs,abs_of_nonneg hx] + exact mul_le_mul_of_nonneg_left (φ.toBoundedContinuousFunction.norm_coe_le_norm x) hx + +omit [T2Space X] [LocallyCompactSpace X] in +lemma densityPositive_norm_bound {w : X → ℝ} (hw : Integrable w μ) (h0 : ∀ᵐ x ∂μ, 0≤w x) + {B : ℝ} (hB : (∫ x,w x ∂μ) ≤ B) (φ : C_c(X,ℝ)) : + |densityPositive hw h0 φ| ≤ B*‖φ.toBoundedContinuousFunction‖ := + (densityPositive_bound hw h0 φ).trans (mul_le_mul_of_nonneg_right hB (norm_nonneg _)) + +omit [T2Space X] [LocallyCompactSpace X] in +lemma density_test_le_set {w : X → ℝ} (hw : Integrable w μ) (h0 : ∀ᵐ x ∂μ, 0≤w x) + (φ : C_c(X,ℝ)) {O : Set X} (hO : MeasurableSet O) (hs : tsupport φ ⊆ O) + (hφ : ∀ x, φ x≤1) : (∫ x,w x*φ x ∂μ) ≤ ∫ x in O,w x ∂μ := by + rw [← integral_indicator hO] + apply integral_mono_ae (density_test_integrable hw φ) (hw.indicator hO) + filter_upwards [h0] with x hx + by_cases hxo : x∈O + · rw [indicator_of_mem hxo] + exact mul_le_of_le_one_right hx (hφ x) + · rw [indicator_of_notMem hxo,image_eq_zero_of_notMem_tsupport (fun h => hxo (hs h)),mul_zero] + +variable (w : ℕ → X → ℝ) (hw : ∀ n, Integrable (w n) μ) (h0 : ∀ n, ∀ᵐ x ∂μ, 0≤w n x) + {B : ℝ} (hb : ∀ n, (∫ x,w n x ∂μ) ≤ B) + +def densityLimit : Measure X := limitMeasure (fun n => densityPositive (hw n) (h0 n)) + (fun n φ => densityPositive_norm_bound (hw n) (h0 n) (hb n) φ) + +lemma densityLimit_integral (φ : C_c(X,ℝ)) : + Tendsto (fun n => ∫ x,w n x*φ x ∂μ) (hyperfilter ℕ) (𝓝 (∫ x,φ x ∂densityLimit w hw h0 hb)) := + integral_limitMeasure _ _ φ + +lemma densityLimit_mass (hB : 0≤B) : densityLimit w hw h0 hb univ ≤ ENNReal.ofReal B := + limitMeasure_finite_bound _ _ hB + +lemma densityLimit_regular : (densityLimit w hw h0 hb).Regular := RealRMK.regular_rieszMeasure _ +lemma densityLimit_finite (hB : 0≤B) : IsFiniteMeasure (densityLimit w hw h0 hb) := + ⟨(densityLimit_mass w hw h0 hb hB).trans_lt ENNReal.ofReal_lt_top⟩ + +/-- The local lower-semicontinuity estimate needed for null-set localization. +Only eventual bounds are required, so large-radius splitting may start late. -/ +lemma densityLimit_compact_bound {D : ℝ} {K O : Set X} (hK : IsCompact K) (hO : IsOpen O) + (hKO : K ⊆ O) (hD : ∀ᶠ n in atTop, (∫ x in O,w n x ∂μ) ≤ D) : + densityLimit w hw h0 hb K ≤ ENNReal.ofReal D := by + obtain ⟨φ,hφ1,hφc,hφs,hφ⟩ := exists_continuousMap_one_of_isCompact_subset_isOpen hK hO hKO + let φ' : C_c(X,ℝ) := ⟨φ,hφc⟩ + have hm := RealRMK.rieszMeasure_le_of_eq_one + (limitPositive (fun n => densityPositive (hw n) (h0 n)) + (fun n ψ => densityPositive_norm_bound (hw n) (h0 n) (hb n) ψ)) + (f := φ') (fun x => (hφ x).1) hK hφ1 + have he : limitPositive (fun n => densityPositive (hw n) (h0 n)) + (fun n ψ => densityPositive_norm_bound (hw n) (h0 n) (hb n) ψ) φ' ≤ D := by + apply le_of_tendsto (limit_tendsto (fun n => densityPositive (hw n) (h0 n)) + (fun n ψ => densityPositive_norm_bound (hw n) (h0 n) (hb n) ψ) φ') + filter_upwards [Nat.hyperfilter_le_atTop hD] with n hn + exact (density_test_le_set (hw n) (h0 n) φ' hO.measurableSet hφs (fun x => (hφ x).2)).trans hn + exact hm.trans (ENNReal.ofReal_le_ofReal he) +end WeakCompact + +namespace WeakCompact +variable {X : Type*} [TopologicalSpace X] [T2Space X] [MeasurableSpace X] [BorelSpace X] + [LocallyCompactSpace X] {μ : Measure X} +variable (w : ℕ → X → ℝ) (hw : ∀ n, Integrable (w n) μ) (h0 : ∀ n, ∀ᵐ x ∂μ, 0≤w n x) + {B : ℝ} (hb : ∀ n, (∫ x,w n x ∂μ) ≤ B) + +lemma densityLimit_sharp_mass {D : ℝ} {a : ℕ → ℝ} + (ha : ∀ n, (∫ x,w n x ∂μ) ≤ a n) (ht : Tendsto a atTop (𝓝 D)) : + densityLimit w hw h0 hb Set.univ ≤ ENNReal.ofReal D := by + have := densityLimit_regular w hw h0 hb + rw [isOpen_univ.measure_eq_iSup_isCompact] + apply iSup_le + intro K + apply iSup_le + intro _ + apply iSup_le + intro hK + have he (ε : ℝ) (hε : 0<ε) : densityLimit w hw h0 hb K ≤ ENNReal.ofReal (D+ε) := by + apply densityLimit_compact_bound w hw h0 hb hK isOpen_univ (subset_univ K) + filter_upwards [ht.eventually (gt_mem_nhds (by linarith : D D+1/((n:ℝ)+1)) atTop (𝓝 D) by + simpa only [add_zero] using tendsto_const_nhds.add (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)))) + exact Eventually.of_forall (fun n => he _ (by positivity)) + +omit [T2Space X] [BorelSpace X] [LocallyCompactSpace X] in +lemma absolutelyContinuous_of_compact_null {ν : Measure X} [ν.InnerRegular] + (h : ∀ K : Set X, IsCompact K → μ K=0 → ν K=0) : ν ≪ μ := by + apply Measure.AbsolutelyContinuous.mk + intro s hs hμ + rw [hs.measure_eq_iSup_isCompact] + apply le_antisymm _ bot_le + apply iSup_le + intro K + apply iSup_le + intro hKs + apply iSup_le + intro hK + exact (h K hK (measure_mono_null hKs hμ)).le +end WeakCompact + +namespace SobolevBand +open DiskMoments DiskMaximalTools + +def low (n : ℕ) : ℝ := ((2:ℝ)^n)⁻¹ +def high (n : ℕ) : ℝ := 2*(2:ℝ)^n +lemma low_pos (n : ℕ) : 0 ((2:ℝ)^n)⁻¹) atTop (𝓝 0) + simpa only [inv_pow] using tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0:ℝ)≤2⁻¹) (by norm_num : (2⁻¹:ℝ)<1) +lemma high_tendsto : Tendsto high atTop atTop := by + exact (tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1:ℝ)<2)).const_mul_atTop (by norm_num) +lemma eventually_mem_band {r : ℝ} (hr : 0 |f y|) x r) := by + rw [absoluteMeasure,withDensity_apply _ measurableSet_ball,volume_disk_real x hr.le,signedAverage, + ENNReal.ofReal_div_of_pos (mul_pos Real.pi_pos (sq_pos_of_pos hr)), + ofReal_integral_eq_lintegral_ofReal hf.abs.integrableOn (ae_of_all _ (fun y => abs_nonneg (f y)))] + +lemma abs_average_nonneg (f : ℂ → ℝ) (x : ℂ) {r : ℝ} (hr : 0 |f y|) x r := by + unfold signedAverage + exact div_nonneg (integral_nonneg (fun _ => abs_nonneg _)) (by positivity) + +lemma abs_band_nonneg {f : ℂ → ℝ} (hf : Integrable f) {a b : ℝ} + (ha : 0 |f y|) a b x := + (abs_average_nonneg f x ha).trans (average_le_band hf.abs ha ⟨le_rfl,hab⟩ x) + +lemma abs_band_le_maximal {f : ℂ → ℝ} (hf : Integrable f) {a b : ℝ} + (ha : 0 |f y|) a b x ≤ maximalComplexReal f x := by + apply band_le hab x + intro r hr + apply (ENNReal.ofReal_le_iff_le_toReal hx).mp + rw [← absolute_average_eq hf x (ha.trans_le hr.1)] + exact disk_average_le_rationalMaximal_exact _ x (ha.trans_le hr.1) + +lemma band_mono_interval {f : ℂ → ℝ} (hf : Integrable f) {a b c d : ℝ} + (ha : 0 band f (low n) (high n) x) := by + intro n m hnm + exact band_mono_interval hf (low_pos m) (low_antitone hnm) (low_le_high n) (high_monotone hnm) x + +lemma diagonal_tendsto {f : ℂ → ℝ} (hf : Integrable f) {x : ℂ} (hx : maximalComplex f x≠⊤) : + Tendsto (fun n => band (fun y => |f y|) (low n) (high n) x) atTop (𝓝 (maximalComplexReal f x)) := by + let v := fun n => band (fun y => |f y|) (low n) (high n) x + have hb : BddAbove (range v) := ⟨maximalComplexReal f x,by + rintro _ ⟨n,rfl⟩; exact abs_band_le_maximal hf (low_pos n) (low_le_high n) hx⟩ + have hs0 : 0≤⨆ n,v n := (abs_band_nonneg hf (low_pos 0) (low_le_high 0) x).trans (le_ciSup hb 0) + have hs : (⨆ n,v n) = maximalComplexReal f x := by + apply le_antisymm + · apply ciSup_le + intro n + exact abs_band_le_maximal hf (low_pos n) (low_le_high n) hx + · have he : maximalComplex f x ≤ ENNReal.ofReal (⨆ n,v n) := by + rw [maximalComplex_eq_all_radii] + apply iSup_le + intro r + apply iSup_le + intro hr + obtain ⟨n,hn⟩ := (eventually_mem_band hr).exists + rw [absolute_average_eq hf x hr] + exact ENNReal.ofReal_le_ofReal ((average_le_band hf.abs (low_pos n) hn x).trans (le_ciSup hb n)) + simpa only [maximalComplexReal,ENNReal.toReal_ofReal hs0] using ENNReal.toReal_mono ENNReal.ofReal_ne_top he + rw [← hs] + exact tendsto_atTop_ciSup (diagonal_monotone hf.abs x) hb + +lemma locallyIntegrable_maximal {f : ℂ → ℝ} {g : ℂ → ℂ} + (hf : Integrable f) (hg : Integrable g) (hw : WeakSobolev.HasGradient (μ := volume) f g) : + LocallyIntegrable (maximalComplexReal f) := + (memLp_maximalComplexReal hf (WeakSobolev.memLp_two Complex.finrank_real_complex hf hg hw)).locallyIntegrable (by norm_num) + +lemma diagonal_local_L1 {f : ℂ → ℝ} {g : ℂ → ℂ} + (hf : Integrable f) (hg : Integrable g) (hw : WeakSobolev.HasGradient (μ := volume) f g) + {K : Set ℂ} (hK : IsCompact K) : + Tendsto (fun n => ∫ x in K, ‖band (fun y => |f y|) (low n) (high n) x-maximalComplexReal f x‖) atTop (𝓝 0) := by + let _ := absoluteMeasure_finite hf + have hg' := (WeakSobolev.abs_gradient_bound hf hg).1 + have hw' := hw.abs hf hg + have hL n := band_lipschitz hf.abs hg' hw' (low_pos n) (low_le_high n) + have hM := locallyIntegrable_maximal hf hg hw + have ht := tendsto_integral_of_dominated_convergence (f := fun _ : ℂ => (0:ℝ)) + (fun x => 2*maximalComplexReal f x) + (fun n => (((hL n).continuous.aestronglyMeasurable).sub ((measurable_rationalMaximal (absoluteMeasure f)).ennreal_toReal.aestronglyMeasurable)).norm.restrict) + ((hM.integrableOn_isCompact hK).const_mul 2) + (fun n => ?_) (?_) + · simpa only [integral_zero,Pi.sub_apply,maximalComplexReal,maximalComplex] using ht + · filter_upwards [ae_restrict_of_ae (maximalComplex_ae_finite hf)] with x hx + have h0 := abs_band_nonneg hf (low_pos n) (low_le_high n) x + have h1 := abs_band_le_maximal hf (low_pos n) (low_le_high n) hx + change ‖‖band (fun y => |f y|) (low n) (high n) x-maximalComplexReal f x‖‖ ≤ _ + rw [Real.norm_of_nonneg (norm_nonneg _),Real.norm_eq_abs,abs_of_nonpos (sub_nonpos.mpr h1)] + have h2 : 0 ≤ maximalComplexReal f x := ENNReal.toReal_nonneg + linarith + · filter_upwards [ae_restrict_of_ae (maximalComplex_ae_finite hf)] with x hx + simpa only [sub_self,norm_zero,Pi.sub_apply,maximalComplexReal,maximalComplex] using ((diagonal_tendsto hf hx).sub (tendsto_const_nhds (x := maximalComplexReal f x))).norm +end SobolevBand + +namespace SobolevBand +open DiskMoments RadiusEnvelope SignedRuns GeometricFilter DyadicHats ActualLabels + +lemma geometric_band_eq (f : ℂ → ℝ) (a : ℝ) (m : ℕ) : + runEnvelope f (geometricRadii a m) 0 m = band f a (2*((2:ℝ)^m*a)) := by + unfold runEnvelope band + rw [geometricRadii_eq a (le_refl m),geometricRadii_eq a (Nat.zero_le m)] + simp only [Nat.sub_self,Nat.sub_zero,scale,pow_zero,one_mul] + +lemma smooth_band_integrable_gradient {f : ℂ → ℝ} (hf : ContDiff ℝ 1 f) + (hc : HasCompactSupport f) {a b : ℝ} (ha : 0 signedAverage f y r) x := by + obtain ⟨L,hL⟩ := hf.lipschitzWith_of_hasCompactSupport hc one_ne_zero + filter_upwards [(smooth_band_lipschitz hf hc ha hab).ae_differentiableAt] with x hx + intro r hr he + have hd := (hasFDerivAt_signedAverage hf (fun y => norm_fderiv_le_of_lipschitz ℝ hL (x₀ := y)) x (ha.trans_le hr.1)).differentiableAt + exact congrArg (InnerProductSpace.toDual ℝ ℂ).symm + (fderiv_touching hr (fun y => signedAverage_radius_continuousOn hf y ha) he hx hd) + +/-- Quantitative large-radius truncation; small radii are the only term needing +localization. Differentiable touching avoids any unproved max-chain rule. -/ +lemma split_gradient {f : ℂ → ℝ} (hf : ContDiff ℝ 1 f) (hc : HasCompactSupport f) + {a t b : ℝ} (ha : 0 signedAverage f x r) (hat.trans htb) x (signedAverage_radius_continuousOn hf x ha) + have htouch := hx r hr he + by_cases hrt : r≤t + · have hs : band f a t x=signedAverage f x r := by + apply le_antisymm + · apply band_le hat x + intro s hs + exact hm s ⟨hs.1,hs.2.trans htb⟩ + · exact average_le_band hfi ha ⟨hr.1,hrt⟩ x + rw [htouch,← hx' r ⟨hr.1,hrt⟩ hs] + exact le_add_of_nonneg_right (by positivity) + · rw [htouch] + have hnorm := norm_fderiv_le_of_lipschitz ℝ (smooth_average_lipschitz hf hc (ha.trans_le hat) (le_of_not_ge hrt)) (x₀ := x) + rw [← WeakSobolev.norm_gradient_fderiv] at hnorm + exact hnorm.trans (le_add_of_nonneg_left (norm_nonneg _)) +end SobolevBand + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/AmplificationEncoding.lean b/lean/OAI/Analysis/FactorGeneration/AmplificationEncoding.lean new file mode 100644 index 0000000000000000000000000000000000000000..38ade91067361da938282cb6862d52c73f8b2e81 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/AmplificationEncoding.lean @@ -0,0 +1,185 @@ +import Mathlib.LinearAlgebra.Complex.Module +import OAI.Analysis.FactorGeneration.MatrixEncoding +import OAI.Analysis.FactorGeneration.MatrixSequence +import OAI.Analysis.FactorGeneration.ProjectionEncoding + +namespace OAI + +noncomputable section + +namespace Generator + +/-! One arbitrary operator and a pair of self-adjoint operators generate the same weakly closed star algebra. -/ +open scoped ComplexStarModule +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +local notation "Op" => H →L[ℂ] H + +theorem realPart_mem (S : StarSubalgebra ℂ Op) {x : Op} (hx : x ∈ S) : + (ℜ x : Op) ∈ S := by + rw [realPart_apply_coe, ← Complex.coe_smul] + exact S.smul_mem (add_mem hx (star_mem hx)) _ + +theorem imaginaryPart_mem (S : StarSubalgebra ℂ Op) {x : Op} (hx : x ∈ S) : + (ℑ x : Op) ∈ S := by + rw [imaginaryPart_apply_coe, ← Complex.coe_smul] + exact S.smul_mem (S.smul_mem (sub_mem hx (star_mem hx)) _) _ + +theorem mem_iff_parts_mem (S : StarSubalgebra ℂ Op) (x : Op) : + x ∈ S ↔ (ℜ x : Op) ∈ S ∧ (ℑ x : Op) ∈ S := by + refine ⟨fun hx => ⟨realPart_mem S hx, imaginaryPart_mem S hx⟩, ?_⟩ + rintro ⟨hr, hi⟩ + rw [← realPart_add_I_smul_imaginaryPart x] + exact add_mem hr (S.smul_mem hi _) + +theorem wstar_singleton_eq_parts (x : Op) : + wstar {x} = wstar {(ℜ x : Op), (ℑ x : Op)} := by + apply le_antisymm + · apply wstar_le (wstar_closed _) + intro y hy + have hyx : y = x := Set.mem_singleton_iff.mp hy + subst y + apply (mem_iff_parts_mem _ x).mpr + exact ⟨subset_wstar _ (by simp), subset_wstar _ (by simp)⟩ + · apply wstar_le (wstar_closed _) + intro y hy + have hx := subset_wstar {x} (Set.mem_singleton x) + rcases Set.mem_insert_iff.mp hy with rfl | hy + · exact realPart_mem _ hx + · rcases Set.mem_singleton_iff.mp hy with rfl + exact imaginaryPart_mem _ hx + +theorem realPart_pack {a b : Op} (ha : IsSelfAdjoint a) (hb : IsSelfAdjoint b) : + (ℜ (a + Complex.I • b) : Op) = a := by + simp only [map_add, realPart_I_smul, hb.imaginaryPart, neg_zero, add_zero] + exact ha.coe_realPart + +theorem imaginaryPart_pack {a b : Op} (ha : IsSelfAdjoint a) (hb : IsSelfAdjoint b) : + (ℑ (a + Complex.I • b) : Op) = b := by + simp only [map_add, ha.imaginaryPart, imaginaryPart_I_smul, zero_add] + exact hb.coe_realPart + +theorem wstar_pack {a b : Op} (ha : IsSelfAdjoint a) (hb : IsSelfAdjoint b) : + wstar {a + Complex.I • b} = wstar {a, b} := by + rw [wstar_singleton_eq_parts, realPart_pack ha hb, imaginaryPart_pack ha hb] + +/-- Exact equivalence in thm:main, without proving either side for II1 factors. -/ +theorem singlyGenerated_iff_two_selfAdjoint (S : StarSubalgebra ℂ Op) : + SinglyGenerated S ↔ ∃ a ∈ S, ∃ b ∈ S, + IsSelfAdjoint a ∧ IsSelfAdjoint b ∧ wstar {a, b} = S := by + constructor + · rintro ⟨x, hx, hgen⟩ + exact ⟨ℜ x, realPart_mem S hx, ℑ x, imaginaryPart_mem S hx, + (ℜ x).property, (ℑ x).property, (wstar_singleton_eq_parts x).symm.trans hgen⟩ + · rintro ⟨a, ha, b, hb, hsa, hsb, hgen⟩ + exact ⟨a + Complex.I • b, add_mem ha (S.smul_mem hb _), + (wstar_pack hsa hsb).trans hgen⟩ + +end + +/-! Two self-adjoint generators for an actual two-by-two amplification +whose actual commutant has four self-adjoint generators. Spectral separation +is proved, and the final generation uses the surjective coefficient map. -/ +open scoped BigOperators +namespace MatrixUnitSystem +open MatrixEncoding +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (E : MatrixUnitSystem (Fin 2) M.toStarSubalgebra) + +def concreteCoefficientHom : Matrix (Fin 2) (Fin 2) E.commutant →⋆ₐ[ℂ] (H →L[ℂ] H) := + M.toStarSubalgebra.subtype.comp E.coefficientHom + +theorem coefficient_corner (a : E.commutant) : + E.concreteCoefficientHom (corner a)=a.val.val*(E.entry 0 0).val := by + have he : corner a=Matrix.single 0 0 a := by ext i j; fin_cases i <;> fin_cases j <;> simp [corner,Matrix.single] + change (E.coefficientHom (corner a)).val=_ + rw [he,E.coefficientHom_single] + rfl + +theorem coefficient_diagonal (a : E.commutant) : + E.concreteCoefficientHom (corner a+E21*corner a*E12)=a.val.val := by + have he : corner a+E21*corner a*E12=Matrix.diagonal (fun _ : Fin 2 => a) := by + ext i j + fin_cases i <;> fin_cases j <;> simp [corner,E21,E12,Matrix.diagonal] + rw [he] + change (E.coefficientEval (Matrix.diagonal (fun _ : Fin 2 => a))).val=a.val.val + congr 1 + simp [coefficientEval,Matrix.diagonal,apply_ite,ite_mul,← Finset.mul_sum,E.total] + +theorem two_generators_of_four_commutant_generators (a₁ a₂ a₃ a₄ : E.commutant) + (h₁ : IsSelfAdjoint a₁) (h₂ : IsSelfAdjoint a₂) + (h₃ : IsSelfAdjoint a₃) (h₄ : IsSelfAdjoint a₄) + (hgen : wstar {a₁.val.val,a₂.val.val,a₃.val.val,a₄.val.val}=E.relativeVonNeumann.toStarSubalgebra) : + ∃ A ∈ M,∃ B ∈ M,IsSelfAdjoint A ∧ IsSelfAdjoint B ∧ wstar {A,B}=M.toStarSubalgebra := by + let f := E.concreteCoefficientHom + let t := f (encodeA a₁ a₂ 0) + let q := f E22 + let C : ℝ := 2*‖t‖+1 + let A := f (encodeA a₁ a₂ (algebraMap ℂ E.commutant (C : ℂ))) + let B := f (encodeB a₃ a₄) + have hA : A ∈ M := (E.coefficientHom _).property + have hB : B ∈ M := (E.coefficientHom _).property + have hsa : IsSelfAdjoint A := + (encodeA_selfAdjoint h₁ h₂ (scalar_shift_selfAdjoint C)).map f + have hsb : IsSelfAdjoint B := (encodeB_selfAdjoint h₃ h₄).map f + have hq : q*q=q := + (map_mul f E22 E22).symm.trans (congrArg f E22_idempotent) + have hqt : Commute q t := (E22_commute_encodeA a₁ a₂).map f + have hsplit : A=C • q+t := by + change f _=C • f E22+f (encodeA a₁ a₂ 0) + exact (congrArg f (encodeA_scalar_shift a₁ a₂ C)).trans + ((map_add f _ _).trans (congrArg (fun x => x + f (encodeA a₁ a₂ 0)) + ((map_smul f (C : ℂ) E22).trans (Complex.coe_smul C (f E22))))) + let Q := wstar {A,B} + let S := Q.comap f + have hAm : encodeA a₁ a₂ (algebraMap ℂ E.commutant (C : ℂ)) ∈ S := subset_wstar _ (by simp [A]) + have hBm : encodeB a₃ a₄ ∈ S := subset_wstar _ (by simp [B]) + have h22 : (E22 : Matrix (Fin 2) (Fin 2) E.commutant) ∈ S := by + change q ∈ wstar {A,B} + apply (wstar_mono (s := {A}) (t := {A,B}) (by simp)) + rw [hsplit] + exact idempotent_mem_wstar_of_gap q t hq hqt C (by dsimp [C]; linarith) + have h11 : (E11 : Matrix (Fin 2) (Fin 2) E.commutant) ∈ S := by + have he : (1 : Matrix (Fin 2) (Fin 2) E.commutant)-E22=E11 := by rw [← complement]; abel + rw [← he] + exact S.sub_mem S.one_mem h22 + obtain ⟨_,h12,h21⟩ := matrix_units_mem S h11 hBm + obtain ⟨hc₁,hc₂,hc₃,hc₄⟩ := encoded_corners_mem_scalar S (C : ℂ) h11 hAm hBm + have hcoeff (a : E.commutant) (ha : corner a ∈ S) : a.val.val ∈ Q := by + rw [← E.coefficient_diagonal a] + exact S.add_mem ha (S.mul_mem (S.mul_mem h21 ha) h12) + have hN : E.relativeVonNeumann.toStarSubalgebra ≤ Q := by + rw [← hgen] + exact wstar_le (wstar_closed _) (by + rintro _ (rfl | rfl | rfl | rfl) + · exact hcoeff a₁ hc₁ + · exact hcoeff a₂ hc₂ + · exact hcoeff a₃ hc₃ + · exact hcoeff a₄ hc₄) + have hcorner (a : E.commutant) : corner a ∈ S := by + change f (corner a) ∈ Q + rw [E.coefficient_corner a] + apply Q.mul_mem (hN ⟨a,rfl⟩) + have hp := E.coefficient_corner (1 : E.commutant) + have he : corner (1 : E.commutant)=E11 := rfl + rw [he] at hp + have hp' : f E11=(E.entry 0 0).val := by simpa using hp + have hh : f E11 ∈ Q := h11 + rwa [hp'] at hh + have htop : S=⊤ := eq_top_of_corner_and_units S hcorner h12 h21 + refine ⟨A,hA,B,hB,hsa,hsb,le_antisymm ?_ ?_⟩ + · exact wstar_le (Tracial.vonNeumann_wotClosed M) (by rintro _ (rfl | rfl) <;> assumption) + · intro x hx + obtain ⟨a,ha⟩ := E.coefficientHom_surjective 0 ⟨x,hx⟩ + have hm : a ∈ S := by rw [htop]; trivial + change (E.coefficientHom a).val ∈ Q at hm + rwa [ha] at hm + +end MatrixUnitSystem + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Bicommutant.lean b/lean/OAI/Analysis/FactorGeneration/Bicommutant.lean new file mode 100644 index 0000000000000000000000000000000000000000..0633a7b7380e824f3dedd30ccaf73662f04bea4e --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Bicommutant.lean @@ -0,0 +1,259 @@ +import Mathlib.Algebra.Group.Submonoid.Membership +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Analysis.InnerProductSpace.PiL2 +import Mathlib.Analysis.InnerProductSpace.Projection.Basic +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Order.Filter.AtTopBot.Prod +import Mathlib.Topology.Algebra.Module.Basic +import Mathlib.Topology.Instances.Complex +import OAI.Analysis.FactorGeneration.Target + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Finite diagonal amplification and the projection onto a simultaneous +operator orbit. These are the analytic ingredients of the bicommutant theorem. -/ +section +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {ι : Type*} [Fintype ι] + +abbrev FiniteHilbert (ι : Type*) (H : Type*) := PiLp 2 (fun _ : ι => H) + +def diagonalOperator (T : H →L[ℂ] H) : FiniteHilbert ι H →L[ℂ] FiniteHilbert ι 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 diagonalOperator_apply (T : H →L[ℂ] H) (x : FiniteHilbert ι H) (i : ι) : + diagonalOperator T x i=T (x i) := rfl + +theorem diagonalOperator_star (T : H →L[ℂ] H) : + diagonalOperator (ι := ι) (star T)=star (diagonalOperator (ι := ι) T) := by + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + simp only [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + simp only [PiLp.inner_apply,diagonalOperator_apply, + ContinuousLinearMap.adjoint_inner_right] + +def tupleOrbitMap (S : StarSubalgebra ℂ (H →L[ℂ] H)) (x : FiniteHilbert ι H) : + S →ₗ[ℂ] FiniteHilbert ι H where + toFun a := diagonalOperator a.val x + map_add' a b := by ext i; rfl + map_smul' c a := by ext i; rfl + +def tupleOrbitClosure (S : StarSubalgebra ℂ (H →L[ℂ] H)) (x : FiniteHilbert ι H) : + Submodule ℂ (FiniteHilbert ι H) := (tupleOrbitMap S x).range.topologicalClosure + +instance tupleOrbitClosure_complete (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (x : FiniteHilbert ι H) : CompleteSpace (tupleOrbitClosure S x) := + inferInstanceAs (CompleteSpace (tupleOrbitMap S x).range.topologicalClosure) + +theorem mem_tupleOrbitClosure (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (x : FiniteHilbert ι H) : x ∈ tupleOrbitClosure S x := by + apply Submodule.le_topologicalClosure + refine ⟨1,?_⟩ + ext i + rfl + +theorem tupleOrbitClosure_invariant (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (x : FiniteHilbert ι H) (a : S) {y : FiniteHilbert ι H} + (hy : y ∈ tupleOrbitClosure S x) : diagonalOperator a.val y ∈ tupleOrbitClosure S x := by + have h : (tupleOrbitMap S x).range.topologicalClosure ≤ + (tupleOrbitClosure S x).comap (diagonalOperator a.val).toLinearMap := by + apply Submodule.topologicalClosure_minimal + · rintro z ⟨b,rfl⟩ + apply Submodule.le_topologicalClosure + refine ⟨a*b,?_⟩ + ext i + rfl + · exact (Submodule.isClosed_topologicalClosure _).preimage (diagonalOperator a.val).continuous + exact h hy + +theorem starProjection_commutes_of_invariant (K : Submodule ℂ H) [K.HasOrthogonalProjection] + (T : H →L[ℂ] H) (hT : ∀ x ∈ K,T x ∈ K) (hstar : ∀ x ∈ K,star T x ∈ K) : + K.starProjection*T=T*K.starProjection := by + ext x + apply K.eq_starProjection_of_mem_of_inner_eq_zero + · exact hT _ (K.starProjection_apply_mem x) + · intro y hy + change inner ℂ (T x-T (K.starProjection x)) y=0 + rw [← map_sub] + rw [← ContinuousLinearMap.adjoint_inner_right] + exact K.starProjection_inner_eq_zero x _ (hstar y hy) + +theorem tupleOrbitProjection_commutes (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (x : FiniteHilbert ι H) (a : S) : + (tupleOrbitClosure S x).starProjection*diagonalOperator a.val= + diagonalOperator a.val*(tupleOrbitClosure S x).starProjection := by + apply starProjection_commutes_of_invariant + · exact fun y hy => tupleOrbitClosure_invariant S x a hy + · rw [← diagonalOperator_star] + exact fun y hy => tupleOrbitClosure_invariant S x (star a) hy + +variable [DecidableEq ι] + +def tupleSingle (i : ι) : H →L[ℂ] FiniteHilbert ι H := + (PiLp.continuousLinearEquiv 2 ℂ (fun _ : ι => H)).symm.toContinuousLinearMap.comp + (ContinuousLinearMap.single ℂ (fun _ : ι => H) i) + +omit [CompleteSpace H] [Fintype ι] in +@[simp] theorem tupleSingle_apply (i j : ι) (x : H) : + tupleSingle i x j=(Pi.single i x : ι → H) j := rfl + +omit [CompleteSpace H] in +theorem tuple_eq_sum_single (x : FiniteHilbert ι H) : + x=∑ i,tupleSingle i (x i) := by + ext j + simp [WithLp.ofLp_sum,tupleSingle_apply,Pi.single_apply] + +omit [CompleteSpace H] [Fintype ι] in +theorem diagonalOperator_single (T : H →L[ℂ] H) (i : ι) (x : H) : + diagonalOperator T (tupleSingle i x)=tupleSingle i (T x) := by + ext j + by_cases h : j=i <;> simp [h] + +def operatorEntry (Q : FiniteHilbert ι H →L[ℂ] FiniteHilbert ι H) (i j : ι) : H →L[ℂ] H := + (PiLp.proj 2 (fun _ : ι => H) i).comp (Q.comp (tupleSingle j)) + +omit [Fintype ι] in +theorem operatorEntry_mem_centralizer (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (Q : FiniteHilbert ι H →L[ℂ] FiniteHilbert ι H) + (hQ : ∀ a : S,Q*diagonalOperator a.val=diagonalOperator a.val*Q) (i j : ι) : + operatorEntry Q i j ∈ Set.centralizer (S : Set (H →L[ℂ] H)) := by + intro a ha + ext z + change a (Q (tupleSingle j z) i)=Q (tupleSingle j (a z)) i + have h := congrArg (fun T : FiniteHilbert ι H →L[ℂ] FiniteHilbert ι H => + T (tupleSingle j z) i) (hQ ⟨a,ha⟩) + simpa only [mul_apply_eq_comp,diagonalOperator_apply, + diagonalOperator_single] using h.symm + +omit [CompleteSpace H] in +theorem diagonalOperator_commutes_of_entries (T : H →L[ℂ] H) + (Q : FiniteHilbert ι H →L[ℂ] FiniteHilbert ι H) + (h : ∀ i j,operatorEntry Q i j*T=T*operatorEntry Q i j) : + Q*diagonalOperator T=diagonalOperator T*Q := by + ext x i + rw [tuple_eq_sum_single x] + simp only [map_sum,mul_apply_eq_comp,diagonalOperator_single] + simp only [WithLp.ofLp_sum,Finset.sum_apply,diagonalOperator_apply] + apply Finset.sum_congr rfl + intro j _ + exact congrArg (fun a : H →L[ℂ] H => a (x j)) (h i j) + +theorem bicommutant_tuple_mem_closure (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (T : H →L[ℂ] H) (hT : T ∈ Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H)))) + (x : FiniteHilbert ι H) : diagonalOperator T x ∈ tupleOrbitClosure S x := by + let Q := (tupleOrbitClosure S x).starProjection + have hcomm : Q*diagonalOperator T=diagonalOperator T*Q := + diagonalOperator_commutes_of_entries T Q (fun i j => hT _ + (operatorEntry_mem_centralizer S Q (tupleOrbitProjection_commutes S x) i j)) + apply Submodule.starProjection_eq_self_iff.mp + have h := congrArg (fun a : FiniteHilbert ι H →L[ℂ] FiniteHilbert ι H => a x) hcomm + change Q (diagonalOperator T x)=diagonalOperator T (Q x) at h + rw [show Q x=x from Submodule.starProjection_eq_self_iff.mpr (mem_tupleOrbitClosure S x)] at h + exact h + +end + +/-! The double commutant theorem for actual unital star subalgebras of B(H). +Finite simultaneous strong approximation constructs a WOT-convergent net. +No bounded approximation or separable-predual theorem is claimed here. -/ +section +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem bicommutant_finite_strong_approximation (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (T : H →L[ℂ] H) (hT : T ∈ Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H)))) + (s : Finset H) (ε : ℝ) (hε : 0 < ε) : + ∃ a : S,∀ x ∈ s,‖T x-a.val x‖ < ε := by + classical + let x : FiniteHilbert s H := WithLp.toLp 2 (fun i : s => i.val) + have h := bicommutant_tuple_mem_closure S T hT x + obtain ⟨z,⟨a,rfl⟩,ha⟩ := Metric.mem_closure_iff.mp h ε hε + refine ⟨a,?_⟩ + intro y hy + have hb := PiLp.norm_apply_le (diagonalOperator T x-tupleOrbitMap S x a) (⟨y,hy⟩ : s) + exact hb.trans_lt (by simpa only [dist_eq_norm] using ha) + +theorem bicommutant_exists_strong_net (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (T : H →L[ℂ] H) (hT : T ∈ Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H)))) : + ∃ a : Finset H × ℕ → S,∀ x : H, + Tendsto (fun d => (a d).val x) atTop (𝓝 (T x)) := by + classical + have hex (d : Finset H × ℕ) := bicommutant_finite_strong_approximation S T hT d.1 + (1/((d.2 : ℝ)+1)) (by positivity) + choose a ha using hex + refine ⟨a,?_⟩ + intro x + apply (tendsto_iff_dist_tendsto_zero).mpr + have hsnd : Tendsto (fun d : Finset H × ℕ => d.2) atTop atTop := by + rw [← prod_atTop_atTop_eq] + exact tendsto_snd + apply squeeze_zero' (Eventually.of_forall (fun d => dist_nonneg)) ?_ + (tendsto_one_div_add_atTop_nhds_zero_nat.comp hsnd) + filter_upwards [eventually_ge_atTop (({x} : Finset H),0)] with d hd + rw [dist_comm,dist_eq_norm] + exact (ha d x (hd.1 (Finset.mem_singleton_self x))).le + +theorem wotClosed_bicommutant (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : WOTClosed S) : + Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H)))=S := by + classical + apply Set.Subset.antisymm + · intro T hT + obtain ⟨a,ha⟩ := bicommutant_exists_strong_net S T hT + have hw : Tendsto (fun d => ContinuousLinearMapWOT.ofCLM (a d).val) atTop + (𝓝 (ContinuousLinearMapWOT.ofCLM T)) := by + apply ContinuousLinearMapWOT.tendsto_iff_forall_inner_apply_tendsto.mpr + intro x y + exact (continuous_const.inner continuous_id).continuousAt.tendsto.comp (ha x) + exact hS.mem_of_tendsto hw (Eventually.of_forall (fun d => (a d).property)) + · intro T hT a ha + exact (ha T hT).symm + +def vonNeumannOfWOTClosed (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : WOTClosed S) : + VonNeumannAlgebra H where + toStarSubalgebra := S + centralizer_centralizer' := wotClosed_bicommutant S hS + +theorem wotClosed_normClosed (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : WOTClosed S) : + IsClosed (S : Set (H →L[ℂ] H)) := + hS.preimage ContinuousLinearMapWOT.continuous_ofCLM + +end + +/-! Countable algebraic generators give a separable star algebra using only +continuous addition and scalar multiplication. No multiplication continuity is +required, so the result applies to the two-norm on a tracial quotient. -/ + +theorem countable_monoid_closure {A : Type*} [Monoid A] {s : Set A} + (hs : s.Countable) : (Submonoid.closure s : Set A).Countable := by + let : Countable s := hs.to_subtype + let : Countable (FreeMonoid s) := inferInstanceAs (Countable (List s)) + rw [Submonoid.closure_eq_mrange, MonoidHom.coe_mrange] + exact Set.countable_range _ + +theorem separable_countable_star_adjoin {A : Type*} [Ring A] [StarRing A] + [Algebra ℂ A] [StarModule ℂ A] [TopologicalSpace A] + [ContinuousAdd A] [ContinuousSMul ℂ A] {s : Set A} (hs : s.Countable) : + TopologicalSpace.IsSeparable (StarAlgebra.adjoin ℂ s : Set A) := by + change TopologicalSpace.IsSeparable + ((StarAlgebra.adjoin ℂ s).toSubalgebra.toSubmodule : Set A) + rw [StarAlgebra.adjoin_eq_span] + apply TopologicalSpace.IsSeparable.span + apply Set.Countable.isSeparable + apply countable_monoid_closure + exact hs.union (by simpa only [Set.image_star] using hs.image star) + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Coefficients.lean b/lean/OAI/Analysis/FactorGeneration/Coefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f472ffad043948b1df566dbde52f68859af272a --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Coefficients.lean @@ -0,0 +1,128 @@ +import Mathlib.Algebra.MonoidAlgebra.Defs +import Mathlib.Algebra.Order.Ring.Basic +import Mathlib.Analysis.Complex.Basic +import Mathlib.Data.Finsupp.Order + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Coefficientwise absolute-value product comparison, retaining all convolution terms contributing to the same group element. -/ +section +open scoped BigOperators +variable {G : Type*} [Monoid G] + +def normCoefficients (f : MonoidAlgebra ℂ G) : MonoidAlgebra ℝ G := + .ofCoeff (f.coeff.mapRange (fun z => ‖z‖) norm_zero) + +omit [Monoid G] in +@[simp] theorem normCoefficients_apply (f : MonoidAlgebra ℂ G) (g : G) : + (normCoefficients f).coeff g = ‖f.coeff g‖ := rfl + +omit [Monoid G] in +@[simp] theorem normCoefficients_support (f : MonoidAlgebra ℂ G) : + (normCoefficients f).coeff.support = f.coeff.support := by + ext g + simp only [Finsupp.mem_support_iff, normCoefficients_apply, ne_eq, norm_eq_zero] + +omit [Monoid G] in +theorem normCoefficients_nonnegative (f : MonoidAlgebra ℂ G) (g : G) : + 0 ≤ (normCoefficients f).coeff g := by + simpa only [normCoefficients_apply] using norm_nonneg (f.coeff g) + +/-- Exact source inequality |fg|(w) ≤ (|f| |g|)(w), including cancellations. -/ +theorem normCoefficients_mul_le (f g : MonoidAlgebra ℂ G) (w : G) : + (normCoefficients (f * g)).coeff w ≤ + (normCoefficients f * normCoefficients g).coeff w := by + classical + rw [normCoefficients_apply, MonoidAlgebra.coeff_mul, MonoidAlgebra.coeff_mul] + simp only [Finsupp.sum, normCoefficients_support, normCoefficients_apply] + calc + _ ≤ ∑ a ∈ f.coeff.support, + ‖∑ b ∈ g.coeff.support, if a * b = w then f.coeff a * g.coeff b else 0‖ := + norm_sum_le _ _ + _ ≤ ∑ a ∈ f.coeff.support, ∑ b ∈ g.coeff.support, + ‖if a * b = w then f.coeff a * g.coeff b else 0‖ := + Finset.sum_le_sum fun _ _ => norm_sum_le _ _ + _ = _ := by + apply Finset.sum_congr rfl + intro a _ + apply Finset.sum_congr rfl + intro b _ + split_ifs <;> simp + +/-- The corresponding additive coefficient comparison. -/ +theorem normCoefficients_add_le (f g : MonoidAlgebra ℂ G) (w : G) : + (normCoefficients (f + g)).coeff w ≤ + (normCoefficients f + normCoefficients g).coeff w := + by simpa only [normCoefficients_apply, MonoidAlgebra.coeff_add, Finsupp.add_apply] using + norm_add_le (f.coeff w) (g.coeff w) + +end + +/-! The coefficientwise ordered ring of real finite group-ring sums. +The multiplication is actual collected convolution. -/ +open scoped BigOperators +namespace CoefficientOrder +variable {G : Type*} [Monoid G] + +instance coefficientPartialOrder : PartialOrder (MonoidAlgebra ℝ G) := + PartialOrder.lift MonoidAlgebra.coeff MonoidAlgebra.coeff_injective + +omit [Monoid G] in +@[simp] theorem le_iff (f g : MonoidAlgebra ℝ G) : f ≤ g ↔ ∀ w, f.coeff w ≤ g.coeff w := Iff.rfl + +instance coefficientOrderedAdd : IsOrderedAddMonoid (MonoidAlgebra ℝ G) where + add_le_add_left _f _g h _a w := add_le_add (h w) le_rfl + +instance coefficientZeroLEOne : ZeroLEOneClass (MonoidAlgebra ℝ G) where + zero_le_one := by + intro w + classical + simp only [MonoidAlgebra.one_def, MonoidAlgebra.coeff_single, Finsupp.single_apply] + split_ifs <;> norm_num + +theorem mul_nonnegative {f g : MonoidAlgebra ℝ G} (hf : 0 ≤ f) (hg : 0 ≤ g) : 0 ≤ f * g := by + classical + intro w + rw [MonoidAlgebra.coeff_mul] + apply Finset.sum_nonneg + intro a _ + apply Finset.sum_nonneg + intro b _ + dsimp only + split_ifs + · exact mul_nonneg (hf a) (hg b) + · exact le_refl _ + +theorem mul_le_left {f g : MonoidAlgebra ℝ G} (h : f ≤ g) + (a : MonoidAlgebra ℝ G) (ha : 0 ≤ a) : a * f ≤ a * g := by + have hd : 0 ≤ g - f := fun w => sub_nonneg.mpr (h w) + have hm := mul_nonnegative ha hd + rw [mul_sub] at hm + exact fun w => sub_nonneg.mp (hm w) + +theorem mul_le_right {f g : MonoidAlgebra ℝ G} (h : f ≤ g) + (a : MonoidAlgebra ℝ G) (ha : 0 ≤ a) : f * a ≤ g * a := by + have hd : 0 ≤ g - f := fun w => sub_nonneg.mpr (h w) + have hm := mul_nonnegative hd ha + rw [sub_mul] at hm + exact fun w => sub_nonneg.mp (hm w) + +instance coefficientOrderedRing : IsOrderedRing (MonoidAlgebra ℝ G) where + mul_le_mul_of_nonneg_left := by + intro a ha b c h + exact mul_le_left h a ha + mul_le_mul_of_nonneg_right := by + intro a ha b c h + exact mul_le_right h a ha + +end CoefficientOrder + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Convolution.lean b/lean/OAI/Analysis/FactorGeneration/Convolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..392481e7ac107ee61cb1b1f361319436424881c0 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Convolution.lean @@ -0,0 +1,506 @@ +import Mathlib.Algebra.MonoidAlgebra.Basic +import Mathlib.Analysis.InnerProductSpace.Orthonormal +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.Real.Sqrt +import Mathlib.GroupTheory.FreeGroup.Reduce +import OAI.Analysis.FactorGeneration.FreeWords + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Coordinate masks and permutations on the actual complex square-summable space. +These implement the Hilbert-space operations used in lem:length-one-convolution. -/ +section +open scoped BigOperators InnerProductSpace ENNReal +attribute [local instance] Classical.propDecidable +abbrev SquareSpace (X : Type*) := lp (fun _ : X => ℂ) 2 + +variable {X I : Type*} + +theorem squareSpace_norm_sq (f : SquareSpace X) : + ‖f‖ ^ 2 = ∑' x, ‖f x‖ ^ 2 := by + simpa using lp.norm_rpow_eq_tsum (p := 2) (by norm_num) f + +def coordinateMask (s : Set X) (f : SquareSpace X) : SquareSpace X := + ⟨s.indicator f, f.property.mono' (fun x => by + by_cases hx : x ∈ s <;> simp [Set.indicator, hx])⟩ + +@[simp] theorem coordinateMask_apply (s : Set X) (f : SquareSpace X) (x : X) : + coordinateMask s f x = if x ∈ s then f x else 0 := rfl + +theorem coordinateMask_norm_le (s : Set X) (f : SquareSpace X) : + ‖coordinateMask s f‖ ≤ ‖f‖ := by + apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro x + by_cases hx : x ∈ s <;> simp [hx] + +theorem coordinateMask_add_compl (s : Set X) (f : SquareSpace X) : + coordinateMask s f + coordinateMask sᶜ f = f := by + ext x + change coordinateMask s f x + coordinateMask sᶜ f x = f x + by_cases hx : x ∈ s <;> simp [hx] + +def coordinatePermute (e : X ≃ X) (f : SquareSpace X) : SquareSpace X := + ⟨fun x => f (e x), memℓp_gen ((e.summable_iff).2 (f.property.summable (by norm_num)))⟩ + +@[simp] theorem coordinatePermute_apply (e : X ≃ X) (f : SquareSpace X) (x : X) : + coordinatePermute e f x = f (e x) := rfl + +theorem coordinatePermute_norm (e : X ≃ X) (f : SquareSpace X) : + ‖coordinatePermute e f‖ = ‖f‖ := by + have h : ‖coordinatePermute e f‖ ^ 2 = ‖f‖ ^ 2 := by + rw [squareSpace_norm_sq, squareSpace_norm_sq] + exact e.tsum_eq (fun x => ‖f x‖ ^ 2) + nlinarith [norm_nonneg (coordinatePermute e f), norm_nonneg f] + +/-- Reindexing by a permutation, as a bounded complex linear operator. -/ +def coordinatePermuteCLM (e : X ≃ X) : SquareSpace X →L[ℂ] SquareSpace X := + LinearMap.mkContinuous + { toFun := coordinatePermute e + map_add' := by intros; ext x; rfl + map_smul' := by intros; ext x; rfl } + 1 (fun f => by simpa using (coordinatePermute_norm e f).le) + +@[simp] theorem coordinatePermuteCLM_apply (e : X ≃ X) (f : SquareSpace X) (x : X) : + coordinatePermuteCLM e f x = f (e x) := rfl + +/-- Disjoint coordinate support implies genuine Hilbert orthogonality. -/ +theorem squareSpace_inner_zero {f g : SquareSpace X} + (h : ∀ x, f x = 0 ∨ g x = 0) : inner ℂ f g = 0 := by + change (∑' x, inner ℂ (f x) (g x)) = 0 + have hz : ∀ x, inner ℂ (f x) (g x) = 0 := by + intro x + rcases h x with hx | hx <;> simp [hx] + simp only [hz, tsum_zero] + +/-- Pythagoras for a finite family with disjoint supports. -/ +theorem squareSpace_sum_norm_sq (s : Finset I) (f : I → SquareSpace X) + (h : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ∀ x, f i x = 0 ∨ f j x = 0) : + ‖∑ i ∈ s, f i‖ ^ 2 = ∑ i ∈ s, ‖f i‖ ^ 2 := by + have hc : inner ℂ (∑ i ∈ s, f i) (∑ i ∈ s, f i) = + ∑ i ∈ s, inner ℂ (f i) (f i) := by + rw [sum_inner] + apply Finset.sum_congr rfl + intro i hi + rw [inner_sum] + exact Finset.sum_eq_single i + (fun j hj hji => squareSpace_inner_zero (h i hi j hj hji.symm)) + (fun hn => (hn hi).elim) + have hr := congrArg (RCLike.re : ℂ → ℝ) hc + simpa only [map_sum, inner_self_eq_norm_sq] using hr + +/-- The projections onto finitely many disjoint coordinate sets have total +squared mass at most that of the original vector. -/ +theorem coordinateMask_sum_sq_le (s : Finset I) (U : I → Set X) + (hU : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → Disjoint (U i) (U j)) + (f : SquareSpace X) : + ∑ i ∈ s, ‖coordinateMask (U i) f‖ ^ 2 ≤ ‖f‖ ^ 2 := by + have horth : ∀ i ∈ s, ∀ j ∈ s, i ≠ j → ∀ x, + coordinateMask (U i) f x = 0 ∨ coordinateMask (U j) f x = 0 := by + intro i hi j hj hij x + by_cases hx : x ∈ U i + · right + have hn : x ∉ U j := fun hxj => Set.disjoint_left.mp (hU i hi j hj hij) hx hxj + simp [hn] + · left; simp [hx] + rw [← squareSpace_sum_norm_sq s _ horth] + have hnorm : ‖∑ i ∈ s, coordinateMask (U i) f‖ ≤ ‖f‖ := by + apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro x + simp only [lp.coeFn_sum, Finset.sum_apply] + by_cases hex : ∃ i ∈ s, x ∈ U i + · obtain ⟨i, hi, hxi⟩ := hex + rw [Finset.sum_eq_single i] + · simp [hxi] + · intro j hj hji + have hn : x ∉ U j := fun hxj => + Set.disjoint_left.mp (hU i hi j hj hji.symm) hxi hxj + simp [hn] + · exact fun hn => (hn hi).elim + · have hz : ∀ i ∈ s, coordinateMask (U i) f x = 0 := by + intro i hi + simp [show x ∉ U i from fun hx => hex ⟨i, hi, hx⟩] + rw [Finset.sum_eq_zero hz, norm_zero] + exact norm_nonneg _ + nlinarith [norm_nonneg (∑ i ∈ s, coordinateMask (U i) f), norm_nonneg f] + +end + +/-! Length-one convolution bounds for the left regular representation of a free group on an arbitrary basis. -/ +section +open scoped BigOperators InnerProductSpace +attribute [local instance] Classical.propDecidable Classical.decEq +namespace FreeConvolution +variable {A : Type*} +abbrev Letter (A : Type*) := A × Bool + +def inverseLetter (a : Letter A) : Letter A := (a.1, !a.2) +def letter (a : Letter A) : FreeGroup A := FreeGroup.mk [a] +def begins (a : Letter A) (w : FreeGroup A) : Prop := w.toWord.head? = some a + +@[simp] theorem inverseLetter_inverse (a : Letter A) : inverseLetter (inverseLetter a) = a := by + cases a; simp [inverseLetter] + +theorem inverseLetter_injective : Function.Injective (inverseLetter : Letter A → Letter A) := + Function.Involutive.injective inverseLetter_inverse + +@[simp] theorem letter_toWord (a : Letter A) : (letter a).toWord = [a] := by + simp [letter] + +@[simp] theorem letter_inverse (a : Letter A) : letter (inverseLetter a) = (letter a)⁻¹ := by + simp [letter, FreeGroup.inv_mk, FreeGroup.invRev, inverseLetter] + +@[simp] theorem letter_true (a : A) : letter (a, true) = FreeGroup.of a := rfl + +theorem letter_false (a : A) : letter (a, false) = (FreeGroup.of a)⁻¹ := by + simpa [inverseLetter] using letter_inverse (a, true) + +theorem letter_injective : Function.Injective (letter : Letter A → FreeGroup A) := by + intro a b h + have hw := congrArg FreeGroup.toWord h + simpa only [letter_toWord, List.singleton_inj] using hw + +/-- A noncancelling left multiplication creates its signed letter as the head. -/ +theorem begins_letter_mul (a : Letter A) (w : FreeGroup A) + (h : ¬ begins (inverseLetter a) w) : begins a (letter a * w) := by + unfold begins at * + rw [FreeGroup.toWord_mul, letter_toWord, List.singleton_append, + FreeGroup.reduce.cons, FreeGroup.reduce_toWord] + cases hw : w.toWord with + | nil => simp + | cons b bs => + have hn : ¬ (a.1 = b.1 ∧ a.2 = !b.2) := by + intro he + apply h + simp only [hw, List.head?_cons, Option.some.injEq] + apply Prod.ext + · exact he.1.symm + · simpa [inverseLetter] using congrArg Bool.not he.2.symm + simp [hn] + +/-- The actual left regular translation λ(g)η(x)=η(g⁻¹x). -/ +def leftRegular (g : FreeGroup A) : SquareSpace (FreeGroup A) →L[ℂ] SquareSpace (FreeGroup A) := + coordinatePermuteCLM (Equiv.mulLeft g⁻¹) + +@[simp] theorem leftRegular_apply (g : FreeGroup A) (f : SquareSpace (FreeGroup A)) + (x : FreeGroup A) : leftRegular g f x = f (g⁻¹ * x) := rfl + +@[simp] theorem leftRegular_norm (g : FreeGroup A) (f : SquareSpace (FreeGroup A)) : + ‖leftRegular g f‖ = ‖f‖ := coordinatePermute_norm _ _ + +def creation (a : Letter A) (f : SquareSpace (FreeGroup A)) : SquareSpace (FreeGroup A) := + leftRegular (letter a) (coordinateMask {w | ¬ begins (inverseLetter a) w} f) + +def cancellation (a : Letter A) (f : SquareSpace (FreeGroup A)) : SquareSpace (FreeGroup A) := + leftRegular (letter a) (coordinateMask {w | begins (inverseLetter a) w} f) + +theorem creation_add_cancellation (a : Letter A) (f : SquareSpace (FreeGroup A)) : + creation a f + cancellation a f = leftRegular (letter a) f := by + rw [creation, cancellation, ← map_add] + congr 1 + ext x + change coordinateMask {w | ¬ begins (inverseLetter a) w} f x + + coordinateMask {w | begins (inverseLetter a) w} f x = f x + by_cases hx : begins (inverseLetter a) x <;> simp [hx] + +theorem creation_support (a : Letter A) (f : SquareSpace (FreeGroup A)) (x : FreeGroup A) + (hx : ¬ begins a x) : creation a f x = 0 := by + simp only [creation, leftRegular_apply, coordinateMask_apply, Set.mem_ofPred_eq] + rw [ite_eq_right] + intro hn + apply hx + simpa using begins_letter_mul a ((letter a)⁻¹ * x) hn + +theorem begins_disjoint {a b : Letter A} (hab : a ≠ b) : + Disjoint {w : FreeGroup A | begins a w} {w | begins b w} := by + apply Set.disjoint_left.mpr + intro w ha hb + exact hab (Option.some.inj (ha.symm.trans hb)) + +theorem creation_norm_le (a : Letter A) (f : SquareSpace (FreeGroup A)) : + ‖creation a f‖ ≤ ‖f‖ := by + rw [creation, leftRegular_norm] + exact coordinateMask_norm_le _ _ + +theorem creation_sum_bound (s : Finset (Letter A)) (b : Letter A → ℂ) + (f : SquareSpace (FreeGroup A)) : + ‖∑ a ∈ s, b a • creation a f‖ ≤ Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2) * ‖f‖ := by + have horth : ∀ a ∈ s, ∀ c ∈ s, a ≠ c → ∀ x, + (b a • creation a f) x = 0 ∨ (b c • creation c f) x = 0 := by + intro a _ c _ hac x + by_cases hx : begins a x + · right + have hn : ¬ begins c x := fun hc => Set.disjoint_left.mp (begins_disjoint hac) hx hc + simp [lp.coeFn_smul, creation_support c f x hn] + · left; simp [lp.coeFn_smul, creation_support a f x hx] + have hsq : ‖∑ a ∈ s, b a • creation a f‖ ^ 2 ≤ + (∑ a ∈ s, ‖b a‖ ^ 2) * ‖f‖ ^ 2 := by + rw [squareSpace_sum_norm_sq s _ horth, Finset.sum_mul] + apply Finset.sum_le_sum + intro a _ + rw [norm_smul, mul_pow] + apply mul_le_mul_of_nonneg_left _ (sq_nonneg _) + exact sq_le_sq₀ (norm_nonneg _) (norm_nonneg _) |>.mpr (creation_norm_le a f) + have hS : 0 ≤ ∑ a ∈ s, ‖b a‖ ^ 2 := Finset.sum_nonneg (fun _ _ => sq_nonneg _) + have he : (Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2) * ‖f‖) ^ 2 = + (∑ a ∈ s, ‖b a‖ ^ 2) * ‖f‖ ^ 2 := by rw [mul_pow, Real.sq_sqrt hS] + exact (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mp + (hsq.trans_eq he.symm) + +theorem cancellation_sum_bound (s : Finset (Letter A)) (b : Letter A → ℂ) + (f : SquareSpace (FreeGroup A)) : + ‖∑ a ∈ s, b a • cancellation a f‖ ≤ Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2) * ‖f‖ := by + have hmass : ∑ a ∈ s, ‖cancellation a f‖ ^ 2 ≤ ‖f‖ ^ 2 := by + simp only [cancellation, leftRegular_norm] + exact coordinateMask_sum_sq_le s _ + (fun a _ c _ hac => begins_disjoint (fun h => hac (inverseLetter_injective h))) f + calc + _ ≤ ∑ a ∈ s, ‖b a‖ * ‖cancellation a f‖ := by + simpa only [norm_smul] using norm_sum_le s (fun a => b a • cancellation a f) + _ ≤ Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2) * + Real.sqrt (∑ a ∈ s, ‖cancellation a f‖ ^ 2) := Real.sum_mul_le_sqrt_mul_sqrt _ _ _ + _ ≤ Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2) * Real.sqrt (‖f‖ ^ 2) := + mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt hmass) (Real.sqrt_nonneg _) + _ = _ := by rw [Real.sqrt_sq (norm_nonneg f)] + +/-- The manuscript's length-one bound on every vector of ℓ²(FreeGroup A). -/ +theorem length_one_convolution_vector_bound (s : Finset (Letter A)) (b : Letter A → ℂ) + (f : SquareSpace (FreeGroup A)) : + ‖(∑ a ∈ s, b a • leftRegular (letter a)) f‖ ≤ + (2 * Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2)) * ‖f‖ := by + have he : (∑ a ∈ s, b a • leftRegular (letter a)) f = + (∑ a ∈ s, b a • creation a f) + (∑ a ∈ s, b a • cancellation a f) := by + simp only [sum_apply, smul_apply, + ← creation_add_cancellation, smul_add, Finset.sum_add_distrib] + rw [he] + have ht := norm_add_le (∑ a ∈ s, b a • creation a f) (∑ a ∈ s, b a • cancellation a f) + have hc := creation_sum_bound s b f + have hd := cancellation_sum_bound s b f + linarith + +/-- The length-one convolution estimate for the operator norm of the left regular action. -/ +theorem length_one_convolution_operator_bound (s : Finset (Letter A)) (b : Letter A → ℂ) : + ‖∑ a ∈ s, b a • leftRegular (letter a)‖ ≤ + 2 * Real.sqrt (∑ a ∈ s, ‖b a‖ ^ 2) := by + apply ContinuousLinearMap.opNorm_le_bound _ (by positivity) + exact length_one_convolution_vector_bound s b + +end FreeConvolution + +end + +/-! Group-ring action on ℓ² and the coefficient-vector identity. -/ +section +open scoped BigOperators ENNReal +attribute [local instance] Classical.propDecidable Classical.decEq +namespace FreeConvolution +variable {A : Type*} +local notation "H" => SquareSpace (FreeGroup A) +local notation "Op" => H →L[ℂ] H + +def leftRegularHom : FreeGroup A →* Op where + toFun := leftRegular + map_one' := by ext f x; simp + map_mul' g h := by ext f x; simp [mul_inv_rev, mul_assoc] + +def regular : MonoidAlgebra ℂ (FreeGroup A) →ₐ[ℂ] Op := + MonoidAlgebra.lift ℂ Op (FreeGroup A) leftRegularHom + +def realRegular : MonoidAlgebra ℝ (FreeGroup A) →ₐ[ℝ] Op := + MonoidAlgebra.lift ℝ Op (FreeGroup A) leftRegularHom + +def delta : H := lp.single 2 1 1 + +@[simp] theorem delta_apply (x : FreeGroup A) : (delta : H) x = if x = 1 then 1 else 0 := by + by_cases hx : x = 1 <;> simp [delta, lp.single_apply, hx] + +@[simp] theorem delta_norm : ‖(delta : H)‖ = 1 := by + simp [delta, lp.norm_single (by norm_num : (0 : ℝ≥0∞) < 2)] + +@[simp] theorem leftRegular_delta_apply (g x : FreeGroup A) : + leftRegular g (delta : H) x = if x = g then 1 else 0 := by + simp [inv_mul_eq_one, eq_comm] + +/-- Applying the actual convolution operator to δ₁ recovers every coefficient. -/ +theorem regular_delta_apply (f : MonoidAlgebra ℂ (FreeGroup A)) (x : FreeGroup A) : + regular f delta x = f.coeff x := by + simp only [regular, MonoidAlgebra.lift_apply, Finsupp.sum, sum_apply, smul_apply, + leftRegularHom] + simp only [lp.coeFn_sum, Finset.sum_apply, lp.coeFn_smul, Pi.smul_apply] + simp [inv_mul_eq_one, eq_comm, Finsupp.mem_support_iff] + +theorem realRegular_delta_apply (f : MonoidAlgebra ℝ (FreeGroup A)) (x : FreeGroup A) : + realRegular f delta x = (f.coeff x : ℂ) := by + simp only [realRegular, MonoidAlgebra.lift_apply, Finsupp.sum, sum_apply, smul_apply, + leftRegularHom] + simp only [lp.coeFn_sum, Finset.sum_apply, lp.coeFn_smul, Pi.smul_apply] + simp [inv_mul_eq_one, eq_comm, Finsupp.mem_support_iff] + intro h + simp [← h] + +theorem regular_single_delta (g : FreeGroup A) : + regular (MonoidAlgebra.single g 1) delta = lp.single 2 g 1 := by + ext x + rw [regular_delta_apply] + by_cases hx : x = g <;> simp [MonoidAlgebra.coeff_single, lp.single_apply, hx] + +theorem regular_delta_orthonormal : + Orthonormal ℂ (fun g : FreeGroup A => regular (MonoidAlgebra.single g 1) delta) := by + rw [orthonormal_iff_ite] + intro g h + simp only [regular_single_delta] + by_cases hgh : g = h + · subst h + simp [inner_self_eq_norm_sq_to_K, lp.norm_single (by norm_num : (0 : ℝ≥0∞) < 2)] + · rw [ite_eq_right hgh] + apply squareSpace_inner_zero + intro x + by_cases hx : x = g + · right + have hx' : x ≠ h := by simpa [hx] using hgh + simp [lp.single_apply, hx'] + · left; simp [lp.single_apply, hx] + +/-- Exact finite coefficient L² isometry in the regular representation. -/ +theorem regular_coefficient_isometry (f : MonoidAlgebra ℂ (FreeGroup A)) : + ‖regular f delta‖ ^ 2 = ∑ x ∈ f.coeff.support, ‖f.coeff x‖ ^ 2 := by + rw [squareSpace_norm_sq] + simp only [regular_delta_apply] + apply tsum_eq_sum + intro x hx + simp [Finsupp.notMem_support_iff.mp hx] + +/-- Coefficient domination implies the ℓ² inequality; no comparison between +operator norms in distinct representations is used. -/ +theorem regular_delta_norm_le {f : MonoidAlgebra ℂ (FreeGroup A)} + {a : MonoidAlgebra ℝ (FreeGroup A)} (h : ∀ x, ‖f.coeff x‖ ≤ a.coeff x) : + ‖regular f delta‖ ≤ ‖realRegular a delta‖ := by + apply lp.norm_mono (by norm_num : (2 : ℝ≥0∞) ≠ 0) + intro x + rw [regular_delta_apply, realRegular_delta_apply, Complex.norm_real] + exact (h x).trans (le_abs_self _) + +/-- Actual coefficient-vector power estimate. -/ +theorem realRegular_pow_delta_norm_le (a : MonoidAlgebra ℝ (FreeGroup A)) (d : ℕ) : + ‖realRegular (a ^ d) delta‖ ≤ ‖realRegular a‖ ^ d := by + rw [map_pow] + induction d with + | zero => simp + | succ d ih => + rw [pow_succ', pow_succ'] + exact (ContinuousLinearMap.le_opNorm (realRegular a) _).trans + (mul_le_mul_of_nonneg_left ih (norm_nonneg _)) + +end FreeConvolution + +end + +/-! The finite coefficient L² identity from orthonormality of reduced-word images. -/ +section +open scoped BigOperators InnerProductSpace +variable {G E : Type*} [Monoid G] [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +/-- Linear images of a group-ring sum are its literal finite coefficient combination. -/ +theorem groupRing_linear_combination (Ψ : MonoidAlgebra ℂ G →ₗ[ℂ] E) + (f : MonoidAlgebra ℂ G) : + Ψ f = ∑ g ∈ f.coeff.support, f.coeff g • Ψ (MonoidAlgebra.single g 1) := by + conv_lhs => rw [← MonoidAlgebra.sum_coeff_single f] + simp only [Finsupp.sum, map_sum] + apply Finset.sum_congr rfl + intro g _ + rw [← map_smul] + congr 1 + simp + +/-- The source's coefficient isometry from actual orthonormal word images. -/ +theorem groupRing_coefficient_isometry (Ψ : MonoidAlgebra ℂ G →ₗ[ℂ] E) + (hΨ : Orthonormal ℂ (fun g => Ψ (MonoidAlgebra.single g 1))) + (f : MonoidAlgebra ℂ G) : + ‖Ψ f‖ ^ 2 = ∑ g ∈ f.coeff.support, ‖f.coeff g‖ ^ 2 := by + rw [groupRing_linear_combination Ψ f, ← inner_self_eq_norm_sq (𝕜 := ℂ), hΨ.inner_sum] + rw [map_sum] + apply Finset.sum_congr rfl + intro g _ + rw [mul_comm] + exact inner_self_eq_norm_sq (𝕜 := ℂ) (f.coeff g) + +/-- Two orthonormal realizations have exactly the same coefficient norm. -/ +theorem groupRing_norm_eq_of_orthonormal {E' : Type*} [NormedAddCommGroup E'] + [InnerProductSpace ℂ E'] (Ψ : MonoidAlgebra ℂ G →ₗ[ℂ] E) + (Θ : MonoidAlgebra ℂ G →ₗ[ℂ] E') + (hΨ : Orthonormal ℂ (fun g => Ψ (MonoidAlgebra.single g 1))) + (hΘ : Orthonormal ℂ (fun g => Θ (MonoidAlgebra.single g 1))) + (f : MonoidAlgebra ℂ G) : ‖Ψ f‖ = ‖Θ f‖ := by + exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + ((groupRing_coefficient_isometry Ψ hΨ f).trans + (groupRing_coefficient_isometry Θ hΘ f).symm) + +/-- For orthonormal word images, the finite coefficient norm agrees with the regular representation norm. -/ +theorem groupRing_norm_eq_regular {A : Type*} + (Ψ : MonoidAlgebra ℂ (FreeGroup A) →ₗ[ℂ] E) + (hΨ : Orthonormal ℂ (fun g => Ψ (MonoidAlgebra.single g 1))) + (f : MonoidAlgebra ℂ (FreeGroup A)) : + ‖Ψ f‖ = ‖FreeConvolution.regular f FreeConvolution.delta‖ := by + have h := (groupRing_coefficient_isometry Ψ hΨ f).trans + (FreeConvolution.regular_coefficient_isometry f).symm + exact (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp h + +end + +/-! Multiplicity-weighted length-one convolution bounds. -/ +open scoped BigOperators +open Generator.FreeConvolution + +def prefixLetterSupport (n : ℕ) : Finset (Letter (FreeGroup ℕ)) := + (ratioLabels n).product Finset.univ + +def prefixWeight (n : ℕ) (α : ℝ) (a : Letter (FreeGroup ℕ)) : ℝ := + α / (2 * n) * multiplicity n a.1 + +/-- The exact collected multiplicities imply the required square-coefficient budget. -/ +theorem prefixWeight_square_sum_le (n : ℕ) (hn : 0 < n) (α : ℝ) : + ∑ a ∈ prefixLetterSupport n, ‖(prefixWeight n α a : ℂ)‖ ^ 2 ≤ α ^ 2 := by + have hm : ∑ p ∈ ratioLabels n, (multiplicity n p : ℝ) ^ 2 ≤ 2 * (n : ℝ) ^ 2 := by + have hNat : ∑ p ∈ ratioLabels n, multiplicity n p ^ 2 ≤ 2 * n ^ 2 := by + rw [multiplicity_square_sum] + exact Nat.sub_le _ _ + exact_mod_cast hNat + have he : (∑ a ∈ prefixLetterSupport n, ‖(prefixWeight n α a : ℂ)‖ ^ 2) = + 2 * (α / (2 * n)) ^ 2 * ∑ p ∈ ratioLabels n, (multiplicity n p : ℝ) ^ 2 := by + unfold prefixLetterSupport + rw [Finset.product_eq_sprod, Finset.sum_product] + simp only [prefixWeight, Complex.norm_real, + Real.norm_eq_abs, sq_abs, mul_pow] + simp only [Fintype.sum_bool] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro p _ + ring + rw [he] + have hn' : (n : ℝ) ≠ 0 := by exact_mod_cast hn.ne' + calc + _ ≤ 2 * (α / (2 * n)) ^ 2 * (2 * (n : ℝ) ^ 2) := + mul_le_mul_of_nonneg_left hm (by positivity) + _ = α ^ 2 := by field_simp [hn'] + +/-- The manuscript's actual coefficient family has convolution norm at most 2α. -/ +theorem prefix_convolution_operator_bound (n : ℕ) (hn : 0 < n) + (α : ℝ) (hα : 0 ≤ α) : + ‖∑ a ∈ prefixLetterSupport n, (prefixWeight n α a : ℂ) • leftRegular (letter a)‖ ≤ + 2 * α := by + calc + _ ≤ 2 * Real.sqrt (∑ a ∈ prefixLetterSupport n, ‖(prefixWeight n α a : ℂ)‖ ^ 2) := + length_one_convolution_operator_bound _ _ + _ ≤ 2 * Real.sqrt (α ^ 2) := by + gcongr + exact prefixWeight_square_sum_le n hn α + _ = _ := by rw [Real.sqrt_sq hα] + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/CoordinatePerturbation.lean b/lean/OAI/Analysis/FactorGeneration/CoordinatePerturbation.lean new file mode 100644 index 0000000000000000000000000000000000000000..a1f174eb0d7bbf4fa5dff1ce3ff7d1ac215dc7dd --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/CoordinatePerturbation.lean @@ -0,0 +1,551 @@ +import OAI.Analysis.FactorGeneration.FreeGroupMoments +import OAI.Analysis.FactorGeneration.LongWords + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Group-ring maps from actual bounded unitary coordinates, with quotient +transport and coordinate Gram limits. -/ +section +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def boundedToSequence (b : Bounded M) : Sequences M := + Classical.choose (boundedMap_surjective b) + +theorem boundedToSequence_map (b : Bounded M) : boundedMap (boundedToSequence b)=b := + Classical.choose_spec (boundedMap_surjective b) + +theorem boundedToSequence_apply (b : Bounded M) (k : ℕ) : boundedToSequence b k=b.val k := + congrArg (fun a : Bounded M => a.val k) (boundedToSequence_map b) + +def boundedUnitarySequence (b : Bounded M) (hb : ∀ k,b.val k ∈ unitary M.toStarSubalgebra) : + unitary (Sequences M) := + ⟨boundedToSequence b,by + apply Unitary.mem_iff.mpr + constructor <;> apply BoundedContinuousFunction.ext <;> intro k + · change star (boundedToSequence b k)*boundedToSequence b k=1 + rw [boundedToSequence_apply] + exact Unitary.star_mul_self_of_mem (hb k) + · change boundedToSequence b k*star (boundedToSequence b k)=1 + rw [boundedToSequence_apply] + exact Unitary.mul_star_self_of_mem (hb k)⟩ + +def sequenceUnitaryQuotient : unitary (Sequences M) →* unitary (Q τ ω) where + toFun u := ⟨sequenceQuotient τ ω (u : Sequences M),Unitary.map_mem (sequenceQuotient τ ω) u.property⟩ + map_one' := Subtype.ext (map_one (sequenceQuotient τ ω)) + map_mul' a b := Subtype.ext (map_mul (sequenceQuotient τ ω) (a : Sequences M) (b : Sequences M)) + +theorem sequenceUnitaryQuotient_bounded (b : Bounded M) + (hb : ∀ k,b.val k ∈ unitary M.toStarSubalgebra) : + (sequenceUnitaryQuotient τ ω (boundedUnitarySequence b hb) : Q τ ω)= + quotientMap τ (ω : Filter ℕ) b := by + change quotientMap τ (ω : Filter ℕ) (boundedMap (boundedToSequence b))=_ + rw [boundedToSequence_map] + +def coordinateGroupRing {A : Type*} (v : A → unitary (Sequences M)) : + MonoidAlgebra ℂ (FreeGroup A) →ₐ[ℂ] Sequences M := + MonoidAlgebra.lift ℂ (Sequences M) (FreeGroup A) + ((unitary (Sequences M)).subtype.comp (FreeGroup.lift v)) + +theorem coordinateGroupRing_single {A : Type*} (v : A → unitary (Sequences M)) + (g : FreeGroup A) : coordinateGroupRing v (MonoidAlgebra.single g 1)=(FreeGroup.lift v g : Sequences M) := by + simp [coordinateGroupRing] + +theorem freeGroup_quotient {A : Type*} (v : A → unitary (Sequences M)) + (q : A → unitary (Q τ ω)) (hv : ∀ a,sequenceUnitaryQuotient τ ω (v a)=q a) + (g : FreeGroup A) : sequenceUnitaryQuotient τ ω (FreeGroup.lift v g)= + unitaryRepresentation τ ω q g := by + exact FreeGroup.lift_unique ((sequenceUnitaryQuotient τ ω).comp (FreeGroup.lift v)) + (fun a => by simpa only [MonoidHom.comp_apply,FreeGroup.lift_apply_of] using hv a) + +theorem coordinateGroupRing_quotient_single {A : Type*} (v : A → unitary (Sequences M)) + (q : A → unitary (Q τ ω)) (hv : ∀ a,sequenceUnitaryQuotient τ ω (v a)=q a) + (g : FreeGroup A) : sequenceQuotient τ ω (coordinateGroupRing v (MonoidAlgebra.single g 1))= + (unitaryRepresentation τ ω q g : Q τ ω) := by + rw [coordinateGroupRing_single] + exact congrArg Subtype.val (freeGroup_quotient τ ω v q hv g) + +theorem coordinateGroupRing_gram_limits {A : Type*} [DecidableEq A] + (v : A → unitary (Sequences M)) (q : A → unitary (Q τ ω)) + (hv : ∀ a,sequenceUnitaryQuotient τ ω (v a)=q a) + (hzero : ∀ g : FreeGroup A,g ≠ 1 → + quotientTrace τ ω (unitaryRepresentation τ ω q g : Q τ ω)=0) + (g h : FreeGroup A) : + Tendsto (fun k => τ.trace (star (coordinateGroupRing v (MonoidAlgebra.single g 1) k)* + coordinateGroupRing v (MonoidAlgebra.single h 1) k)) (ω : Filter ℕ) + (𝓝 (if g=h then 1 else 0)) := by + have ht := sequence_inner_tendsto τ ω (coordinateGroupRing v (MonoidAlgebra.single g 1)) + (coordinateGroupRing v (MonoidAlgebra.single h 1)) + simpa only [sequenceInclusion_apply,inclusion_inner, + coordinateGroupRing_quotient_single τ ω v q hv,unitaryRepresentation_gram τ ω q hzero] using ht + +theorem coordinateGroupRing_orthonormal {A : Type*} [DecidableEq A] + (v : A → unitary (Sequences M)) (q : A → unitary (Q τ ω)) + (hv : ∀ a,sequenceUnitaryQuotient τ ω (v a)=q a) + (hzero : ∀ g : FreeGroup A,g ≠ 1 → + quotientTrace τ ω (unitaryRepresentation τ ω q g : Q τ ω)=0) : + Orthonormal ℂ (fun g => sequenceInclusion τ ω (coordinateGroupRing v (MonoidAlgebra.single g 1))) := by + rw [orthonormal_iff_ite] + intro g h + simp only [sequenceInclusion_apply,inclusion_inner, + coordinateGroupRing_quotient_single τ ω v q hv,unitaryRepresentation_gram τ ω q hzero] + +theorem coordinateGroupRing_isometry {A : Type*} [DecidableEq A] + (v : A → unitary (Sequences M)) (q : A → unitary (Q τ ω)) + (hv : ∀ a,sequenceUnitaryQuotient τ ω (v a)=q a) + (hzero : ∀ g : FreeGroup A,g ≠ 1 → + quotientTrace τ ω (unitaryRepresentation τ ω q g : Q τ ω)=0) + (f : MonoidAlgebra ℂ (FreeGroup A)) : + ‖sequenceQuotient τ ω (coordinateGroupRing v f)‖^2= + ∑ g ∈ f.coeff.support,‖f.coeff g‖^2 := by + have h := groupRing_coefficient_isometry + ((sequenceInclusion τ ω).toLinearMap.comp (coordinateGroupRing v).toLinearMap) + (coordinateGroupRing_orthonormal τ ω v q hv hzero) f + simpa only [LinearMap.comp_apply,ContinuousLinearMap.coe_coe,AlgHom.toLinearMap_apply, + sequenceInclusion_apply,LinearIsometry.norm_map] using h + +end + +/-! Prefix labels and conjugate-word Gram identities for free-group perturbations. -/ +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem unitaryRepresentation_prefix (u : unitary (Q τ ω)) + (t : ℕ → unitary (Q τ ω)) (k : ℕ) : + unitaryRepresentation τ ω (prefixVariable τ ω u t) (freePrefix k)= + prefixProduct τ ω u t k := by + induction k with + | zero => exact map_one _ + | succ k ih => + rw [freePrefix,(unitaryRepresentation τ ω (prefixVariable τ ω u t)).map_mul,ih] + change prefixProduct τ ω u t k*FreeGroup.lift (prefixVariable τ ω u t) (FreeGroup.of k)=_ + rw [FreeGroup.lift_apply_of] + rfl + +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +def SuccessiveCoordinateHaar.labelUnitary (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (ell : ℕ) (p : PrefixLabel ell) : unitary (Q τ ω) := + unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) p.val + +def SuccessiveCoordinateHaar.targetUnitary (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (ell : ℕ) : unitary (Q τ ω) := + z*(prefixProduct τ ω u (fun k => (F.step k).t) (ell+1))⁻¹ + +def SuccessiveCoordinateHaar.conjugateUnitary (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (ell : ℕ) : PrefixLabel ell → unitary (Q τ ω) := + conjugateVariables τ ω (F.labelUnitary τ ω u ell) (F.targetUnitary τ ω u z ell) + +theorem SuccessiveCoordinateHaar.label_mem (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (ell : ℕ) (p : PrefixLabel ell) : + (F.labelUnitary τ ω u ell p : Q τ ω) ∈ F.algebra ell := by + classical + have hp := p.property + change p.val ∈ ratioLabels ell at hp + simp only [ratioLabels,Finset.mem_insert,Finset.mem_image] at hp + rcases hp with he | ⟨ij,_,he⟩ + · change (unitaryRepresentation τ ω _ p.val : Q τ ω) ∈ _ + rw [he,map_one] + exact (F.algebra ell).one_mem + · change (unitaryRepresentation τ ω _ p.val : Q τ ω) ∈ _ + let f := unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) + have hright := (f.map_inv (freePrefix (ij.2.val+1))).trans + (congrArg Inv.inv (unitaryRepresentation_prefix τ ω u (fun k => (F.step k).t) (ij.2.val+1))) + have hratio := (congrArg f he.symm).trans + ((f.map_mul (freePrefix (ij.1.val+1)) ((freePrefix (ij.2.val+1))⁻¹)).trans + (congrArg₂ (fun a b => a*b) + (unitaryRepresentation_prefix τ ω u (fun k => (F.step k).t) (ij.1.val+1)) hright)) + have hj : star (prefixProduct τ ω u (fun k => (F.step k).t) (ij.2.val+1) : Q τ ω) ∈ F.algebra ell := + star_mem (F.prefix_mem τ ω u hu (by omega)) + exact (congrArg (fun a : unitary (Q τ ω) => (a : Q τ ω) ∈ F.algebra ell) hratio).mpr + ((F.algebra ell).mul_mem (F.prefix_mem τ ω u hu (by omega)) hj) + +theorem SuccessiveCoordinateHaar.label_ratio_zero (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (ell : ℕ) + (p q : PrefixLabel ell) (hpq : p ≠ q) : + quotientTrace τ ω (↑((F.labelUnitary τ ω u ell p)⁻¹*F.labelUnitary τ ω u ell q) : Q τ ω)=0 := by + change quotientTrace τ ω (↑((unitaryRepresentation τ ω _ p.val)⁻¹* + unitaryRepresentation τ ω _ q.val) : Q τ ω)=0 + let f := unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) + rw [← f.map_inv,← f.map_mul] + apply F.freeGroup_trace τ ω u hu + exact fun h => hpq (Subtype.ext (_root_.inv_mul_eq_one.mp h)) + +theorem SuccessiveCoordinateHaar.conjugate_trace (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) + (ell : ℕ) (g : FreeGroup (PrefixLabel ell)) (hg : g ≠ 1) : + quotientTrace τ ω (unitaryRepresentation τ ω (F.conjugateUnitary τ ω u z ell) g : Q τ ω)=0 := by + classical + exact conjugate_freeGroup_trace τ ω _ (F.algebra ell) (F.label_mem τ ω u hu ell) + (F.label_ratio_zero τ ω u hu ell) _ (F.target_endpoints τ ω u z hu hz ell) g hg + +theorem SuccessiveCoordinateHaar.conjugate_injective (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (ell : ℕ) : + Function.Injective (unitaryRepresentation τ ω (F.conjugateUnitary τ ω u z ell)) := + unitaryRepresentation_injective τ ω _ (F.conjugate_trace τ ω u z hu hz ell) + +theorem SuccessiveCoordinateHaar.conjugate_gram (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) + (ell : ℕ) (g h : FreeGroup (PrefixLabel ell)) : + quotientTrace τ ω + (star (unitaryRepresentation τ ω (F.conjugateUnitary τ ω u z ell) g : Q τ ω)* + (unitaryRepresentation τ ω (F.conjugateUnitary τ ω u z ell) h : Q τ ω))= + if g=h then 1 else 0 := by + classical + exact unitaryRepresentation_gram τ ω _ (F.conjugate_trace τ ω u z hu hz ell) g h + +theorem SuccessiveCoordinateHaar.conjugate_orthonormal + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (ell : ℕ) : + Orthonormal ℂ (fun g : FreeGroup (PrefixLabel ell) => inclusion τ ω + (unitaryRepresentation τ ω (F.conjugateUnitary τ ω u z ell) g : Q τ ω)) := by + classical + rw [orthonormal_iff_ite] + intro g h + rw [inclusion_inner] + exact F.conjugate_gram τ ω u z hu hz ell g h + +end + +section + +/-! The finite-prefix analytic bound in the actual bounded-sequence/tracial +quotient realization. Word moments remain explicit premises: no free-Haar +existence or perturbation construction is asserted by this transport theorem. -/ +open Filter +open scoped Topology +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem orthonormal_of_coordinate_moments {G : Type*} [Monoid G] + (Φ : MonoidAlgebra ℂ G →ₐ[ℂ] Sequences M) + (hmom : ∀ g h : G, + Tendsto (fun k => τ.trace (star (Φ (MonoidAlgebra.single g 1) k)* + Φ (MonoidAlgebra.single h 1) k)) (ω : Filter ℕ) + (𝓝 (if g = h then 1 else 0))) : + Orthonormal ℂ (fun g => sequenceInclusion τ ω (Φ (MonoidAlgebra.single g 1))) := by + classical + rw [orthonormal_iff_ite] + intro g h + exact tendsto_nhds_unique (sequence_inner_tendsto τ ω + (Φ (MonoidAlgebra.single g 1)) (Φ (MonoidAlgebra.single h 1))) (hmom g h) + +def remainderSequence (n : ℕ) (α : ℝ) + (Φ : MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) →ₐ[ℂ] Sequences M) : Sequences M := + ((finitePerturbationRows n α).map (fun r => NormedSpace.exp (Φ r))).prod - + 1 - ((finitePerturbationRows n α).map Φ).sum + +/-- The actual quotient two-norm estimate from coordinate word moments. -/ +theorem tracial_remainder_of_coordinate_moments (n : ℕ) (hn : 0 < n) + (Φ : MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) →ₐ[ℂ] Sequences M) + (hmom : ∀ g h : FreeGroup (PrefixLabel n), + Tendsto (fun k => τ.trace (star (Φ (MonoidAlgebra.single g 1) k)* + Φ (MonoidAlgebra.single h 1) k)) (ω : Filter ℕ) + (𝓝 (if g = h then 1 else 0))) + (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) : + ‖sequenceQuotient τ ω (remainderSequence n α Φ)‖ ≤ 4*α^2/(1-2*α) := by + have h := finite_prefix_remainder_transfer (B := Sequences M) (E := L2 τ ω) n hn Φ (sequenceInclusion τ ω) + (orthonormal_of_coordinate_moments τ ω Φ (by + intro g h + by_cases hgh : g = h + · simpa only [ite_eq_left hgh] using hmom g h + · simpa only [ite_eq_right hgh] using hmom g h)) α hα hhalf + simpa only [remainderSequence, sequenceInclusion_apply, LinearIsometry.norm_map] using h + +/-- The remainder bound holds with any positive slack on an ultrafilter-large +set of actual coordinates, once the displayed word moments are constructed. -/ +theorem coordinate_remainder_eventually (n : ℕ) (hn : 0 < n) + (Φ : MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) →ₐ[ℂ] Sequences M) + (hmom : ∀ g h : FreeGroup (PrefixLabel n), + Tendsto (fun k => τ.trace (star (Φ (MonoidAlgebra.single g 1) k)* + Φ (MonoidAlgebra.single h 1) k)) (ω : Filter ℕ) + (𝓝 (if g = h then 1 else 0))) + (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ k in (ω : Filter ℕ), τ.norm₂ (remainderSequence n α Φ k) < 4*α^2/(1-2*α)+ε := by + have hb := tracial_remainder_of_coordinate_moments τ ω n hn Φ hmom α hα hhalf + exact (sequence_norm_tendsto τ ω (remainderSequence n α Φ)) + (Iio_mem_nhds (lt_of_le_of_lt hb (lt_add_of_pos_right _ hε))) + +end + +/-! The literal bounded coordinate model of the finite-prefix free group. +The t_j sequences are the witnesses retained by the successive construction. -/ +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def constantSequenceUnitary (u : unitary M.toStarSubalgebra) : unitary (Sequences M) := + ⟨constantSequence (u : M.toStarSubalgebra),Unitary.map_mem constantSequence u.property⟩ + +def constantQuotientUnitary (u : unitary M.toStarSubalgebra) : unitary (Q τ ω) := + sequenceUnitaryQuotient τ ω (constantSequenceUnitary u) + +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +def SuccessiveCoordinateHaar.haarSequence (F : SuccessiveCoordinateHaar τ ω hNM seed) + (j : ℕ) : unitary (Sequences M) := + boundedUnitarySequence (boundedInclusion hNM (F.step j).coordinates) + (fun k => Unitary.map_mem (coordinateInclusion hNM) ((F.step j).unitary_coordinates k)) + +theorem SuccessiveCoordinateHaar.haarSequence_apply (F : SuccessiveCoordinateHaar τ ω hNM seed) + (j k : ℕ) : (F.haarSequence τ ω j : Sequences M) k= + coordinateInclusion hNM ((F.step j).coordinates.val k) := + boundedToSequence_apply _ k + +theorem SuccessiveCoordinateHaar.haarSequence_quotient (F : SuccessiveCoordinateHaar τ ω hNM seed) + (j : ℕ) : sequenceUnitaryQuotient τ ω (F.haarSequence τ ω j)=(F.step j).t := by + apply Subtype.ext + exact (sequenceUnitaryQuotient_bounded τ ω + (boundedInclusion hNM (F.step j).coordinates) + (fun k => Unitary.map_mem (coordinateInclusion hNM) ((F.step j).unitary_coordinates k))).trans + (F.step j).represents + +def SuccessiveCoordinateHaar.coordinateVariables (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary M.toStarSubalgebra) : ℕ → unitary (Sequences M) + | 0 => F.haarSequence τ ω 0 + | j+1 => constantSequenceUnitary u*F.haarSequence τ ω (j+1) + +theorem SuccessiveCoordinateHaar.coordinateVariables_quotient + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u : unitary M.toStarSubalgebra) (j : ℕ) : + sequenceUnitaryQuotient τ ω (F.coordinateVariables τ ω u j)= + prefixVariable τ ω (constantQuotientUnitary τ ω u) (fun k => (F.step k).t) j := by + cases j with + | zero => exact F.haarSequence_quotient τ ω 0 + | succ j => + change sequenceUnitaryQuotient τ ω (constantSequenceUnitary u*F.haarSequence τ ω (j+1))=_ + rw [(sequenceUnitaryQuotient τ ω).map_mul,F.haarSequence_quotient] + rfl + +def SuccessiveCoordinateHaar.coordinateLabels (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary M.toStarSubalgebra) (ell : ℕ) (p : PrefixLabel ell) : unitary (Sequences M) := + FreeGroup.lift (F.coordinateVariables τ ω u) p.val + +def SuccessiveCoordinateHaar.coordinateTarget (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) : unitary (Sequences M) := + constantSequenceUnitary z*(FreeGroup.lift (F.coordinateVariables τ ω u) (freePrefix (ell+1)))⁻¹ + +def SuccessiveCoordinateHaar.coordinateConjugates (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (p : PrefixLabel ell) : unitary (Sequences M) := + F.coordinateLabels τ ω u ell p*F.coordinateTarget τ ω u z ell*(F.coordinateLabels τ ω u ell p)⁻¹ + +theorem SuccessiveCoordinateHaar.coordinateLabels_quotient + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u : unitary M.toStarSubalgebra) + (ell : ℕ) (p : PrefixLabel ell) : + sequenceUnitaryQuotient τ ω (F.coordinateLabels τ ω u ell p)= + F.labelUnitary τ ω (constantQuotientUnitary τ ω u) ell p := + freeGroup_quotient τ ω _ _ (F.coordinateVariables_quotient τ ω u) p.val + +theorem SuccessiveCoordinateHaar.coordinateTarget_quotient + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) (ell : ℕ) : + sequenceUnitaryQuotient τ ω (F.coordinateTarget τ ω u z ell)= + F.targetUnitary τ ω (constantQuotientUnitary τ ω u) (constantQuotientUnitary τ ω z) ell := by + let q := sequenceUnitaryQuotient τ ω + let a := FreeGroup.lift (F.coordinateVariables τ ω u) (freePrefix (ell+1)) + have hp := (freeGroup_quotient τ ω _ _ (F.coordinateVariables_quotient τ ω u) + (freePrefix (ell+1))).trans + (unitaryRepresentation_prefix τ ω (constantQuotientUnitary τ ω u) + (fun k => (F.step k).t) (ell+1)) + exact (q.map_mul (constantSequenceUnitary z) a⁻¹).trans + (congrArg (fun b => constantQuotientUnitary τ ω z*b) + ((q.map_inv a).trans (congrArg Inv.inv hp))) + +theorem SuccessiveCoordinateHaar.coordinateConjugates_quotient + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (ell : ℕ) (p : PrefixLabel ell) : + sequenceUnitaryQuotient τ ω (F.coordinateConjugates τ ω u z ell p)= + F.conjugateUnitary τ ω (constantQuotientUnitary τ ω u) (constantQuotientUnitary τ ω z) ell p := by + let q := sequenceUnitaryQuotient τ ω + let a := F.coordinateLabels τ ω u ell p + let b := F.coordinateTarget τ ω u z ell + have ha := F.coordinateLabels_quotient τ ω u ell p + have hb := F.coordinateTarget_quotient τ ω u z ell + exact (q.map_mul (a*b) a⁻¹).trans + (congrArg₂ (fun x y => x*y) + ((q.map_mul a b).trans (congrArg₂ (fun x y => x*y) ha hb)) + ((q.map_inv a).trans (congrArg Inv.inv ha))) + +def SuccessiveCoordinateHaar.perturbationMap (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) : + MonoidAlgebra ℂ (FreeGroup (PrefixLabel ell)) →ₐ[ℂ] Sequences M := + coordinateGroupRing (F.coordinateConjugates τ ω u z ell) + +theorem SuccessiveCoordinateHaar.perturbationMap_gram + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) + (ell : ℕ) (g h : FreeGroup (PrefixLabel ell)) : + Tendsto (fun k => τ.trace (star (F.perturbationMap τ ω u z ell (MonoidAlgebra.single g 1) k)* + F.perturbationMap τ ω u z ell (MonoidAlgebra.single h 1) k)) (ω : Filter ℕ) + (𝓝 (if g=h then 1 else 0)) := by + classical + exact coordinateGroupRing_gram_limits τ ω _ _ (F.coordinateConjugates_quotient τ ω u z ell) + (F.conjugate_trace τ ω _ _ hu hz ell) g h + +theorem SuccessiveCoordinateHaar.perturbationMap_isometry + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) + (ell : ℕ) (f : MonoidAlgebra ℂ (FreeGroup (PrefixLabel ell))) : + ‖sequenceQuotient τ ω (F.perturbationMap τ ω u z ell f)‖^2= + ∑ g ∈ f.coeff.support,‖f.coeff g‖^2 := by + classical + exact coordinateGroupRing_isometry τ ω _ _ (F.coordinateConjugates_quotient τ ω u z ell) + (F.conjugate_trace τ ω _ _ hu hz ell) f + +theorem SuccessiveCoordinateHaar.perturbation_remainder + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) : + ‖sequenceQuotient τ ω (remainderSequence ell α (F.perturbationMap τ ω u z ell))‖ ≤ + 4*α^2/(1-2*α) := + tracial_remainder_of_coordinate_moments τ ω ell hell _ + (F.perturbationMap_gram τ ω u z hu hz ell) α hα hhalf + +theorem SuccessiveCoordinateHaar.coordinate_remainder + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) + (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ k in (ω : Filter ℕ),τ.norm₂ (remainderSequence ell α (F.perturbationMap τ ω u z ell) k)< + 4*α^2/(1-2*α)+ε := + coordinate_remainder_eventually τ ω ell hell _ + (F.perturbationMap_gram τ ω u z hu hz ell) α hα hhalf ε hε + +end + +/-! The one literal bounded skew-adjoint perturbation K = i h. Every formal +row is its conjugate by the corresponding actual coordinate prefix. -/ +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +def SuccessiveCoordinateHaar.coordinatePrefix (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary M.toStarSubalgebra) (k : ℕ) : unitary (Sequences M) := + FreeGroup.lift (F.coordinateVariables τ ω u) (freePrefix k) + +def SuccessiveCoordinateHaar.commonPerturbation (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : Sequences M := + (α/(2*ell)) • ∑ j : Fin ell, + let a : Sequences M := ↑((F.coordinatePrefix τ ω u (j.val+1))⁻¹ * + F.coordinateTarget τ ω u z ell * F.coordinatePrefix τ ω u (j.val+1)) + a-star a + +theorem SuccessiveCoordinateHaar.commonPerturbation_skew + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : + star (F.commonPerturbation τ ω u z ell α) = -F.commonPerturbation τ ω u z ell α := by + let A : Sequences M := ∑ j : Fin ell, + let a : Sequences M := ↑((F.coordinatePrefix τ ω u (j.val+1))⁻¹ * + F.coordinateTarget τ ω u z ell * F.coordinatePrefix τ ω u (j.val+1)) + a-star a + have hA : star A = -A := by + unfold A + rw [star_sum] + calc + _ = ∑ j : Fin ell, -(let a : Sequences M := ↑((F.coordinatePrefix τ ω u (j.val+1))⁻¹ * + F.coordinateTarget τ ω u z ell * F.coordinatePrefix τ ω u (j.val+1)); a-star a) := by + apply Finset.sum_congr rfl + intro j _ + dsimp only + rw [star_sub,star_star,neg_sub] + _ = _ := Finset.sum_neg_distrib _ + change star ((α/(2*ell) : ℝ) • A) = -((α/(2*ell) : ℝ) • A) + calc + _ = (α/(2*ell) : ℝ) • star A := by rw [star_smul,star_trivial] + _ = (α/(2*ell) : ℝ) • (-A) := congrArg ((α/(2*ell) : ℝ) • ·) hA + _ = _ := smul_neg _ _ + +theorem SuccessiveCoordinateHaar.coordinateLabels_pair + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary M.toStarSubalgebra) {ell : ℕ} (k j : Fin ell) : + F.coordinateLabels τ ω u ell (pairLabel k j)= + F.coordinatePrefix τ ω u (k.val+1)*(F.coordinatePrefix τ ω u (j.val+1))⁻¹ := by + change FreeGroup.lift _ (freePrefix _*(freePrefix _)⁻¹)=_ + rw [(FreeGroup.lift (F.coordinateVariables τ ω u)).map_mul, + (FreeGroup.lift (F.coordinateVariables τ ω u)).map_inv] + rfl + +theorem SuccessiveCoordinateHaar.perturbationMap_row + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) {ell : ℕ} (α : ℝ) (k : Fin ell) : + F.perturbationMap τ ω u z ell (finitePerturbationRow α k)= + (F.coordinatePrefix τ ω u (k.val+1) : Sequences M)* + F.commonPerturbation τ ω u z ell α* + star (F.coordinatePrefix τ ω u (k.val+1) : Sequences M) := by + let Φ := F.perturbationMap τ ω u z ell + have hs (r : ℝ) (a : MonoidAlgebra ℂ (FreeGroup (PrefixLabel ell))) : Φ (r • a)=r • Φ a := + map_smul (Φ.restrictScalars ℝ).toLinearMap r a + have hgen (p : PrefixLabel ell) : Φ (MonoidAlgebra.single (FreeGroup.of p) 1)= + (F.coordinateConjugates τ ω u z ell p : Sequences M) := by + change coordinateGroupRing _ _=_ + rw [coordinateGroupRing_single,FreeGroup.lift_apply_of] + have hinv (p : PrefixLabel ell) : Φ (MonoidAlgebra.single ((FreeGroup.of p)⁻¹) 1)= + star (F.coordinateConjugates τ ω u z ell p : Sequences M) := by + change coordinateGroupRing _ _=_ + rw [coordinateGroupRing_single,map_inv,FreeGroup.lift_apply_of] + rfl + change Φ (finitePerturbationRow α k)=_ + rw [finitePerturbationRow,hs,commonPerturbation] + simp only [map_sum,map_sub,hgen,hinv,mul_smul_comm,smul_mul_assoc, + Finset.mul_sum,Finset.sum_mul] + congr 1 + apply Finset.sum_congr rfl + intro j _ + rw [coordinateConjugates,coordinateLabels_pair] + simp only [← Unitary.star_eq_inv,Submonoid.coe_mul,Unitary.coe_star] + simp only [star_mul,star_star,mul_sub,sub_mul,mul_assoc] + +def SuccessiveCoordinateHaar.perturbingUnitary (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : unitary (Sequences M) := + ⟨NormedSpace.exp (F.commonPerturbation τ ω u z ell α), + NormedSpace.exp_mem_unitary_of_mem_skewAdjoint + (show F.commonPerturbation τ ω u z ell α ∈ skewAdjoint (Sequences M) from + skewAdjoint.mem_iff.mpr (F.commonPerturbation_skew τ ω u z ell α))⟩ + +def SuccessiveCoordinateHaar.perturbedUnitary (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : unitary (Sequences M) := + F.perturbingUnitary τ ω u z ell α*constantSequenceUnitary u + +theorem sequence_exp_conjugate (g : unitary (Sequences M)) (a : Sequences M) : + NormedSpace.exp ((g : Sequences M)*a*star (g : Sequences M))= + (g : Sequences M)*NormedSpace.exp a*star (g : Sequences M) := by + have h : SemiconjBy (g : Sequences M) a ((g : Sequences M)*a*star (g : Sequences M)) := by + unfold SemiconjBy + simp only [mul_assoc,Unitary.coe_star_mul_self,mul_one] + have he := congrArg (fun b : Sequences M => b*star (g : Sequences M)) h.exp_right + have hg : (g : Sequences M)*star (g : Sequences M)=1 := g.property.2 + simpa only [mul_assoc,hg,mul_one] using he.symm + +theorem SuccessiveCoordinateHaar.exponential_row + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) {ell : ℕ} (α : ℝ) (k : Fin ell) : + NormedSpace.exp (F.perturbationMap τ ω u z ell (finitePerturbationRow α k))= + (↑(F.coordinatePrefix τ ω u (k.val+1)*F.perturbingUnitary τ ω u z ell α* + (F.coordinatePrefix τ ω u (k.val+1))⁻¹) : Sequences M) := by + rw [F.perturbationMap_row,sequence_exp_conjugate] + rfl + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/CoordinateUnitaries.lean b/lean/OAI/Analysis/FactorGeneration/CoordinateUnitaries.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2eef46a176bbbe6b45274a1b35db68e2259436b --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/CoordinateUnitaries.lean @@ -0,0 +1,250 @@ +import OAI.Analysis.FactorGeneration.LaurentMoments + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Complete each supported partial unitary by the identity on its orthogonal +complement. If the quotient support is one, the quotient value is unchanged. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def PartialUnitary.completed (v : PartialUnitary M) : M.toStarSubalgebra := + v.val+(1-v.support.val) + +theorem PartialUnitary.completed_unitary (v : PartialUnitary M) : + v.completed ∈ _root_.unitary M.toStarSubalgebra := by + have hp := v.support.property.isIdempotentElem.eq + have hs := v.support.property.isSelfAdjoint.star_eq + have hi := v.unitary.initial + have hf := v.unitary.final + have hleft := v.unitary.support_mul + have hright := v.unitary.mul_support + have hleft' := v.unitary.adjoint.support_mul + have hright' := v.unitary.adjoint.mul_support + dsimp only [CornerUnitary.adjoint] at hleft' hright' + constructor <;> + simp only [PartialUnitary.completed,star_add,star_sub,star_one,hs,add_mul,mul_add, + sub_mul,mul_sub,one_mul,mul_one,hi,hf,hleft,hright,hleft',hright',hp] <;> abel + +theorem PartialUnitary.completed_mem (v : PartialUnitary M) + (hv : v.val.val ∈ N) : v.completed.val ∈ N := by + have hp : v.support.val.val ∈ N := by + rw [← v.unitary.initial] + have hstar : star v.val.val ∈ N := star_mem hv + exact N.mul_mem hstar hv + exact N.add_mem hv (N.sub_mem N.one_mem hp) + +def boundedCompletedUnitary (u : ℕ → PartialUnitary M) : Bounded M := + boundedPartialUnitary u+(1-boundedPartialSupport u) + +@[simp] theorem boundedCompletedUnitary_apply (u : ℕ → PartialUnitary M) (j : ℕ) : + (boundedCompletedUnitary u).val j=(u j).completed := rfl + +theorem boundedCompletedUnitary_unitary (u : ℕ → PartialUnitary M) (j : ℕ) : + (boundedCompletedUnitary u).val j ∈ _root_.unitary M.toStarSubalgebra := + (u j).completed_unitary + +theorem quotient_completed_eq (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + (u : ℕ → PartialUnitary M) + (hi : star (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u))* + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)=1) : + quotientMap τ (ω : Filter ℕ) (boundedCompletedUnitary u)= + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u) := by + have hp : quotientMap τ (ω : Filter ℕ) (boundedPartialSupport u)=1 := by + rw [← boundedPartialUnitary_initial,map_mul,quotientMap_star] + exact hi + let q := quotientMap τ (ω : Filter ℕ) + have hs : q (1-boundedPartialSupport u)=0 := + (map_sub q 1 (boundedPartialSupport u)).trans + ((congrArg₂ (fun a b => a-b) (map_one q) hp).trans (sub_self _)) + exact (map_add q (boundedPartialUnitary u) (1-boundedPartialSupport u)).trans + ((congrArg (fun b => q (boundedPartialUnitary u)+b) hs).trans (add_zero _)) + +theorem bounded_unitary_of_coordinates (a : Bounded M) + (ha : ∀ j,a.val j ∈ _root_.unitary M.toStarSubalgebra) : a ∈ _root_.unitary (Bounded M) := by + constructor + · apply Subtype.ext; funext j; exact (ha j).1 + · apply Subtype.ext; funext j; exact (ha j).2 + +theorem quotient_unitary_of_coordinates (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + (a : Bounded M) (ha : ∀ j,a.val j ∈ _root_.unitary M.toStarSubalgebra) : + quotientMap τ (ω : Filter ℕ) a ∈ _root_.unitary (Q τ ω) := by + have hu := bounded_unitary_of_coordinates a ha + constructor + · rw [← quotientMap_star,← map_mul,hu.1,map_one] + · rw [← quotientMap_star,← map_mul,hu.2,map_one] + +theorem bounded_coordinate_unitaries_inclusion (hNM : N ≤ M) (a : Bounded M) + (ha : ∀ j,a.val j ∈ _root_.unitary M.toStarSubalgebra ∧ (a.val j).val ∈ N) : + ∃ b : Bounded N,(∀ j,b.val j ∈ _root_.unitary N.toStarSubalgebra) ∧ boundedInclusion hNM b=a := by + let b : Bounded N := ⟨fun j => ⟨(a.val j).val,(ha j).2⟩,a.property⟩ + refine ⟨b,?_,rfl⟩ + intro j + constructor + · apply Subtype.ext + change star (a.val j).val*(a.val j).val=1 + exact congrArg (fun x : M.toStarSubalgebra => x.val) (ha j).1.1 + · apply Subtype.ext + change (a.val j).val*star (a.val j).val=1 + exact congrArg (fun x : M.toStarSubalgebra => x.val) (ha j).1.2 + +end + +/-! Ordered independence with actual coordinate unitaries in the included +algebra, obtained by completing the constructed partial-unitary coordinates. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_coordinate_ordered_unitary + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) : + ∃ b : Bounded M, + (∀ j,b.val j ∈ unitary M.toStarSubalgebra ∧ (b.val j).val ∈ N) ∧ + ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) b) x := by + obtain ⟨u,hu,hi,hf,hm⟩ := exists_full_support_ordered_independence τ hNM + hfactor hdiff hirr hsep ω hω x hx + refine ⟨boundedCompletedUnitary u,?_,?_⟩ + · intro j + exact ⟨boundedCompletedUnitary_unitary u j,(u j).completed_mem (hu j)⟩ + · rwa [quotient_completed_eq τ ω u hi] + +end + +/-! Two coordinate-unitary witnesses produce the reduced-moment Haar precursor +while retaining actual unitary coordinates in the included algebra. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_coordinate_reduced_unitary + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) : + ∃ a : Bounded M, + (∀ j,a.val j ∈ unitary M.toStarSubalgebra ∧ (a.val j).val ∈ N) ∧ + ReducedOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) a) x := by + obtain ⟨a,ha,ham⟩ := exists_coordinate_ordered_unitary τ hNM hfactor hdiff hirr hsep ω hω x hx + let u := quotientMap τ (ω : Filter ℕ) a + have hu : u ∈ unitary (Q τ ω) := quotient_unitary_of_coordinates τ ω a (fun j => (ha j).1) + obtain ⟨b,hb,hbm⟩ := exists_coordinate_ordered_unitary τ hNM hfactor hdiff hirr hsep ω hω + (productCenteredFamily τ ω u x) (productCenteredFamily_centered τ ω u x hu.2 hx ham) + refine ⟨a*b,?_,?_⟩ + · intro j + exact ⟨(unitary M.toStarSubalgebra).mul_mem (ha j).1 (hb j).1,N.mul_mem (ha j).2 (hb j).2⟩ + · rw [map_mul] + intro c d sign xs hxs + exact product_reduced_moment τ ω u (quotientMap τ (ω : Filter ℕ) b) x hbm c d sign xs hxs + +end + +/-! Full integer endpoint moments and an actual included coordinate-unitary +Haar witness, before imposing an operator topology on generated algebras. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +omit hfactor hdiff hirr hsep in +private theorem coordinate_haar_endpoints_of_coordinates + (D : Subalgebra ℂ (Q τ ω)) (x : ℕ → Q τ ω) + (hdense : ∀ d ∈ D,quotientTrace τ ω d=0 → d ∈ closure (Set.range x)) + (a : Bounded M) + (ha : ∀ j,a.val j ∈ unitary M.toStarSubalgebra ∧ (a.val j).val ∈ N) + (hm : ReducedOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) a) x) : + ∃ t : unitary (Q τ ω), + (∃ b : Bounded N,(∀ j,b.val j ∈ unitary N.toStarSubalgebra) ∧ + quotientInclusion τ hNM (ω : Filter ℕ) + (quotientMap (restrictedTrace τ hNM) (ω : Filter ℕ) b)=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + ∀ c ∈ D,∀ d ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (c*integerValueWord τ ω t n xs d)=0 := by + let t : unitary (Q τ ω) := ⟨quotientMap τ (ω : Filter ℕ) a, + quotient_unitary_of_coordinates τ ω a (fun j => (ha j).1)⟩ + obtain ⟨b,hb⟩ := bounded_coordinate_unitaries_inclusion hNM a ha + have hhaar := reducedOrderedMoments_haar τ ω t x hm + refine ⟨t,⟨b,hb.1,?_⟩,hhaar,?_⟩ + · change quotientMap τ (ω : Filter ℕ) (boundedInclusion hNM b)=quotientMap τ (ω : Filter ℕ) a + exact congrArg (quotientMap τ (ω : Filter ℕ)) hb.2 + · intro c hc d hd n hn xs hxs + apply reduced_integer_moment_closedSpan τ ω t x hm c d + (subalgebra_mem_centered_closedSpan τ ω D x hdense c hc) + (subalgebra_mem_centered_closedSpan τ ω D x hdense d hd) n hn xs + intro z hz + exact ⟨Submodule.closure_subset_topologicalClosure_span _ + (hdense z.1 (hxs z hz).1 (hxs z hz).2.1),(hxs z hz).2.2⟩ + +private theorem coordinate_haar_endpoints_of_dense_family (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (x : ℕ → Q τ ω) + (hx : ∀ i,x i ∈ D ∧ quotientTrace τ ω (x i)=0) + (hdense : ∀ d ∈ D,quotientTrace τ ω d=0 → d ∈ closure (Set.range x)) : + ∃ t : unitary (Q τ ω), + (∃ b : Bounded N,(∀ j,b.val j ∈ unitary N.toStarSubalgebra) ∧ + quotientInclusion τ hNM (ω : Filter ℕ) + (quotientMap (restrictedTrace τ hNM) (ω : Filter ℕ) b)=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + ∀ c ∈ D,∀ d ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (c*integerValueWord τ ω t n xs d)=0 := by + obtain ⟨a,ha⟩ := exists_coordinate_reduced_unitary (H := H) (N := N) (M := M) τ hNM hfactor hdiff hirr hsep + ω hω x (fun i => (hx i).2) + exact coordinate_haar_endpoints_of_coordinates τ ω hNM D x hdense a ha.1 ha.2 + +theorem exists_coordinate_haar_endpoints (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (hD : TopologicalSpace.IsSeparable (D : Set (Q τ ω))) : + ∃ t : unitary (Q τ ω), + (∃ b : Bounded N,(∀ j,b.val j ∈ unitary N.toStarSubalgebra) ∧ + quotientInclusion τ hNM (ω : Filter ℕ) + (quotientMap (restrictedTrace τ hNM) (ω : Filter ℕ) b)=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + ∀ c ∈ D,∀ d ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (c*integerValueWord τ ω t n xs d)=0 := by + obtain ⟨x,hx⟩ := exists_centered_dense_quotient_family (H := H) (M := M) τ ω D hD + exact coordinate_haar_endpoints_of_dense_family τ ω hNM hfactor hdiff hirr hsep + hω D x hx.1 hx.2 + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/CornerIndependence.lean b/lean/OAI/Analysis/FactorGeneration/CornerIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..35a2478445ff49afc877c90c23d12a5da5490923 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/CornerIndependence.lean @@ -0,0 +1,385 @@ +import OAI.Analysis.FactorGeneration.HaarPatches + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Extension of actual partial unitaries and ordered words from pH. +The empty word maps to p, so word transport retains a final p. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (p : AlgebraProjection M) + +def PartialUnitary.fromRepresentedCorner (v : PartialUnitary (representedCorner p)) : + PartialUnitary M where + support := ⟨cornerEmbedding p v.support.val,v.support.property.map (cornerEmbedding p)⟩ + unitary := ⟨cornerEmbedding p v.val, by + exact (congrArg (fun x => x * cornerEmbedding p v.val) + (map_star (cornerEmbedding p) v.val).symm).trans + ((map_mul (cornerEmbedding p) (star v.val) v.val).symm.trans + (congrArg (cornerEmbedding p) v.unitary.initial)), by + exact (congrArg (fun x => cornerEmbedding p v.val * x) + (map_star (cornerEmbedding p) v.val).symm).trans + ((map_mul (cornerEmbedding p) v.val (star v.val)).symm.trans + (congrArg (cornerEmbedding p) v.unitary.final))⟩ + +theorem PartialUnitary.fromRepresentedCorner_support_le + (v : PartialUnitary (representedCorner p)) : (v.fromRepresentedCorner p).support ≤ p := + cornerEmbedding_left p v.support.val + +theorem cornerEmbedding_signedLetter (v : (representedCorner p).toStarSubalgebra) (s : Bool) : + cornerEmbedding p (signedLetter v s)=signedLetter (cornerEmbedding p v) s := by + cases s with + | false => rfl + | true => exact map_star (cornerEmbedding p) v + +theorem cornerEmbedding_patchingWord (v : (representedCorner p).toStarSubalgebra) + (xs : List (Bool × (representedCorner p).toStarSubalgebra)) : + cornerEmbedding p (patchingWord v xs)= + patchingWord (cornerEmbedding p v) (xs.map (fun a => (a.1,cornerEmbedding p a.2)))*p.val := by + induction xs with + | nil => simp [patchingWord] + | cons a xs ih => + simp only [patchingWord,List.map_cons,map_mul,cornerEmbedding_signedLetter,ih,mul_assoc] + +theorem cornerEmbedding_patchingWord_nonempty (v : (representedCorner p).toStarSubalgebra) + (xs : List (Bool × (representedCorner p).toStarSubalgebra)) (hx : xs ≠ []) : + cornerEmbedding p (patchingWord v xs)= + patchingWord (cornerEmbedding p v) (xs.map (fun a => (a.1,cornerEmbedding p a.2))) := by + induction xs with + | nil => exact (hx rfl).elim + | cons a xs ih => + cases xs with + | nil => simp [patchingWord,cornerEmbedding_signedLetter] + | cons b ys => + change cornerEmbedding p (signedLetter v a.1*a.2*patchingWord v (b::ys)) = + signedLetter (cornerEmbedding p v) a.1*cornerEmbedding p a.2* + patchingWord (cornerEmbedding p v) ((b::ys).map (fun c => (c.1,cornerEmbedding p c.2))) + exact (map_mul (cornerEmbedding p) (signedLetter v a.1 * a.2) + (patchingWord v (b :: ys))).trans + (congrArg₂ (fun x y : M.toStarSubalgebra => x * y) + ((map_mul (cornerEmbedding p) (signedLetter v a.1) a.2).trans + (congrArg (fun x => x * cornerEmbedding p a.2) + (cornerEmbedding_signedLetter p v a.1))) + (ih (by simp))) + +theorem cornerEmbedding_trace (τ : TracialRepresentation M) (hp : p.val ≠ 0) + (a : (representedCorner p).toStarSubalgebra) : + τ.trace (cornerEmbedding p a)=τ.trace p.val*(representedCornerTrace τ p hp).trace a := by + rw [representedCornerTrace_trace] + have ht : τ.trace p.val ≠ 0 := by + intro h + have := projection_trace_pos τ p.val p.property hp + simp [h] at this + exact (mul_div_cancel₀ _ ht).symm + +theorem cornerEmbedding_trace_re (τ : TracialRepresentation M) (hp : p.val ≠ 0) + (a : (representedCorner p).toStarSubalgebra) : + (τ.trace (cornerEmbedding p a)).re= + (τ.trace p.val).re*((representedCornerTrace τ p hp).trace a).re := by + rw [cornerEmbedding_trace p τ hp,projection_trace_real τ p,Complex.mul_re] + simp + +end + +/-! Finite partial independence in every nonzero represented subcorner, +with actual ambient support, membership and trace estimates. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_represented_corner_partial_independence + (p : AlgebraProjection M) (hpN : p.val.val ∈ N) (hp : p.val ≠ 0) + (F : Finset (representedCorner p).toStarSubalgebra) + (hF : ∀ x ∈ F,‖x‖ ≤ 1) (hc : ∀ x ∈ F,τ.trace (cornerEmbedding p x)=0) + (n : ℕ) (ε : ℝ) (hε : 0 < ε) : + ∃ v : PartialUnitary M,v.val.val ∈ N ∧ v.support ≤ p ∧ + (τ.trace p.val).re/4 < (τ.trace v.support.val).re ∧ + ∀ x₀ ∈ (F : Set (representedCorner p).toStarSubalgebra) ∪ {1}, + ∀ xs : List (Bool × (representedCorner p).toStarSubalgebra), + 1 ≤ xs.length → xs.length ≤ n → + patchingCoefficients (F : Set (representedCorner p).toStarSubalgebra) xs → + ‖τ.trace (cornerEmbedding p x₀ * + patchingWord v.val (xs.map (fun a => (a.1,cornerEmbedding p a.2))))‖ ≤ + (τ.trace p.val).re*ε := by + let σ := representedCornerTrace τ p hp + have hf := representedCorner_factor (restrictedTrace τ hNM) + (projectionInSubalgebra p hpN) hfactor + have hd := representedCorner_diffuse (projectionInSubalgebra p hpN) hdiff + have hi := representedCorner_irreducible τ p hpN hNM hirr + have hs := representedCorner_separable τ p hp hsep + have hcenter : ∀ x ∈ F,σ.trace x=0 := by + intro x hx + rw [representedCornerTrace_trace,hc x hx,zero_div] + obtain ⟨u,hu,ht,hw⟩ := exists_finite_partial_independence σ + (representedSubcorner_le p hpN hNM) hf hd hi hs F hF hcenter n ε hε + refine ⟨u.fromRepresentedCorner p,hu,u.fromRepresentedCorner_support_le p,?_,?_⟩ + · change (τ.trace p.val).re/4 < (τ.trace (cornerEmbedding p u.support.val)).re + rw [cornerEmbedding_trace_re p τ hp] + have hpos := projection_trace_pos τ p.val p.property hp + have h := mul_lt_mul_of_pos_left ht hpos + dsimp [σ] at h + linarith + · intro x₀ hx₀ xs hlen hn hcoeff + have hne : xs ≠ [] := by intro h; simp [h] at hlen + have he : cornerEmbedding p x₀ * + patchingWord (u.fromRepresentedCorner p).val + (xs.map (fun a => (a.1,cornerEmbedding p a.2))) = + cornerEmbedding p (x₀*patchingWord u.val xs) := by + rw [map_mul,cornerEmbedding_patchingWord_nonempty p _ _ hne] + rfl + rw [he,cornerEmbedding_trace p τ hp,norm_mul,projection_trace_real τ p, + Complex.norm_real,Real.norm_of_nonneg ((projection_trace_pos τ p.val p.property hp).le)] + exact mul_le_mul_of_nonneg_left (hw x₀ hx₀ xs hlen hn hcoeff) + ((projection_trace_pos τ p.val p.property hp).le) + +end + +/-! Ordered-word transport with ambient unit endpoints, and contractive +compression of supported centered coefficients. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (p : AlgebraProjection M) + +theorem cornerCompress_norm_le (a : M.toStarSubalgebra) : ‖cornerCompress p a‖ ≤ ‖a‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg _) + intro y + change ‖p.val.val (a.val y.val)‖ ≤ ‖a‖*‖y‖ + exact ((p.val.val.le_opNorm _).trans + (mul_le_of_le_one_left (norm_nonneg _) p.property.norm_le)).trans (a.val.le_opNorm y.val) + +theorem cornerCompress_supported (a : M.toStarSubalgebra) + (hl : p.val*a=a) (hr : a*p.val=a) : cornerEmbedding p (cornerCompress p a)=a := by + rw [cornerEmbedding_compress,hl,hr] + +theorem cornerEmbedding_ordered_tail (v : (representedCorner p).toStarSubalgebra) + (x : ℕ → (representedCorner p).toStarSubalgebra) (xs : List (Bool × ℕ)) + (s : Bool) (last : Option ℕ) : + cornerEmbedding p (patchingWord v + (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]))= + patchingWord (cornerEmbedding p v) + (xs.map (fun a => (a.1,cornerEmbedding p (x a.2))) ++ + [(s,optionalCoefficient (fun i => cornerEmbedding p (x i)) last)]) := by + induction xs with + | nil => + cases last <;> + simp only [List.map_nil,List.nil_append,patchingWord,mul_one,optionalCoefficient, + map_mul,← cornerEmbedding_signedLetter] + | cons a xs ih => + change cornerEmbedding p (signedLetter v a.1*x a.2*patchingWord v + (xs.map (fun b => (b.1,x b.2)) ++ [(s,optionalCoefficient x last)])) = _ + exact (map_mul (cornerEmbedding p) (signedLetter v a.1 * x a.2) _).trans + (congrArg₂ (fun y z : M.toStarSubalgebra => y * z) + ((map_mul (cornerEmbedding p) (signedLetter v a.1) (x a.2)).trans + (congrArg (fun y => y * cornerEmbedding p (x a.2)) + (cornerEmbedding_signedLetter p v a.1))) ih) + +theorem cornerEmbedding_ordered_moment (v : (representedCorner p).toStarSubalgebra) + (x : ℕ → (representedCorner p).toStarSubalgebra) (first last : Option ℕ) + (xs : List (Bool × ℕ)) (s : Bool) : + cornerEmbedding p (optionalCoefficient x first * patchingWord v + (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]))= + optionalCoefficient (fun i => cornerEmbedding p (x i)) first * + patchingWord (cornerEmbedding p v) + (xs.map (fun a => (a.1,cornerEmbedding p (x a.2))) ++ + [(s,optionalCoefficient (fun i => cornerEmbedding p (x i)) last)]) := by + cases first with + | none => simpa only [optionalCoefficient,one_mul] using + cornerEmbedding_ordered_tail p v x xs s last + | some i => + rw [map_mul,cornerEmbedding_ordered_tail] + rfl + +end + +/-! Diagonal partial independence in genuinely varying Hilbert-space corners. +The result retains an actual ambient partial-unitary sequence. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_varying_corner_partial_independence + (p : ℕ → AlgebraProjection M) (hpN : ∀ j,(p j).val.val ∈ N) + (hp : ∀ j,(p j).val ≠ 0) + (x : (j : ℕ) → ℕ → (representedCorner (p j)).toStarSubalgebra) + (hx : ∀ j i,‖x j i‖ ≤ 1) + (hc : ∀ j i,τ.trace (cornerEmbedding (p j) (x j i))=0) : + ∃ v : ℕ → PartialUnitary M, + (∀ j,(v j).val.val ∈ N) ∧ (∀ j,(v j).support ≤ p j) ∧ + (∀ j,(τ.trace (p j).val).re/4 < (τ.trace (v j).support.val).re) ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + Tendsto (fun j => τ.trace ( + optionalCoefficient (fun i => cornerEmbedding (p j) (x j i)) first * + patchingWord (v j).val + (xs.map (fun a => (a.1,cornerEmbedding (p j) (x j a.2))) ++ + [(s,optionalCoefficient (fun i => cornerEmbedding (p j) (x j i)) last)]))) + atTop (𝓝 0) := by + classical + let σ := fun j => representedCornerTrace τ (p j) (hp j) + let F := fun j => (Finset.range (j+1)).image (x j) + have hstage (j : ℕ) := exists_finite_partial_independence (σ j) + (representedSubcorner_le (p j) (hpN j) hNM) + (representedCorner_factor (restrictedTrace τ hNM) + (projectionInSubalgebra (p j) (hpN j)) hfactor) + (representedCorner_diffuse (projectionInSubalgebra (p j) (hpN j)) hdiff) + (representedCorner_irreducible τ (p j) (hpN j) hNM hirr) + (representedCorner_separable τ (p j) (hp j) hsep) + (F j) (by + intro a ha + obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp ha + exact hx j i) (by + intro a ha + obtain ⟨i,_,rfl⟩ := Finset.mem_image.mp ha + rw [representedCornerTrace_trace,hc j i,zero_div]) + (j+1) (1/((j : ℝ)+1)) (by positivity) + choose u hu ht hw using hstage + let v := fun j => (u j).fromRepresentedCorner (p j) + refine ⟨v,hu,fun j => (u j).fromRepresentedCorner_support_le (p j),?_,?_⟩ + · intro j + change (τ.trace (p j).val).re/4 < (τ.trace (cornerEmbedding (p j) (u j).support.val)).re + rw [cornerEmbedding_trace_re (p j) τ (hp j)] + have h := mul_lt_mul_of_pos_left (ht j) + (projection_trace_pos τ (p j).val (p j).property (hp j)) + dsimp [σ] at h + linarith + · intro first last xs s + apply tendsto_iff_norm_sub_tendsto_zero.mpr + simp only [sub_zero] + apply squeeze_zero' (Eventually.of_forall (fun _ => norm_nonneg _)) ?_ + tendsto_one_div_add_atTop_nhds_zero_nat + have hopt (i : Option ℕ) : ∀ᶠ j : ℕ in atTop, + optionalCoefficient (x j) i ∈ (F j : Set _) ∪ {1} := by + cases i with + | none => exact Eventually.of_forall (fun _ => Or.inr rfl) + | some i => + filter_upwards [eventually_ge_atTop i] with j hj + exact Or.inl (Finset.mem_image.mpr ⟨i,Finset.mem_range.mpr (by omega),rfl⟩) + filter_upwards [eventually_list_indices (xs.map Prod.snd),eventually_ge_atTop xs.length, + hopt first,hopt last] with j hj hlen hfirst hlast + have he := cornerEmbedding_ordered_moment (p j) (u j).val (x j) first last xs s + change ‖τ.trace (optionalCoefficient (fun i => cornerEmbedding (p j) (x j i)) first * + patchingWord (cornerEmbedding (p j) (u j).val) _)‖ ≤ _ + rw [← he,cornerEmbedding_trace (p j) τ (hp j),norm_mul] + have hb : ‖(σ j).trace (optionalCoefficient (x j) first * + patchingWord (u j).val (xs.map (fun a => (a.1,x j a.2)) ++ + [(s,optionalCoefficient (x j) last)]))‖ ≤ 1/((j : ℝ)+1) := by + apply hw j _ hfirst _ (by simp) (by simpa using Nat.add_le_add_right hlen 1) + apply patchingCoefficients_append_endpoint _ _ ?_ (s,optionalCoefficient (x j) last) hlast + intro a ha + obtain ⟨b,hb,rfl⟩ := List.mem_map.mp ha + exact Finset.mem_image.mpr ⟨b.2,Finset.mem_range.mpr (by + have hh := hj b.2 (List.mem_map.mpr ⟨b,hb,rfl⟩) + omega),rfl⟩ + have htrace : ‖τ.trace (p j).val‖ ≤ 1 := + ((τ.norm_trace_le_norm₂ _).trans (τ.norm₂_le_norm _)).trans (p j).property.norm_le + exact (mul_le_of_le_one_left (norm_nonneg _) htrace).trans hb + +end + +/-! Actual coordinate partial-unitary witnesses in supported corners, followed +by exact quotient moments and the ambient quarter-support bound. -/ +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_supported_corner_partial_sequence + (p : ℕ → AlgebraProjection M) (hpN : ∀ j,(p j).val.val ∈ N) + (hp : ∀ j,(p j).val ≠ 0) + (x : ℕ → ℕ → M.toStarSubalgebra) (hx : ∀ i j,‖x i j‖ ≤ 1) + (hc : ∀ i j,τ.trace (x i j)=0) + (hl : ∀ i j,(p j).val*x i j=x i j) (hr : ∀ i j,x i j*(p j).val=x i j) : + ∃ v : ℕ → PartialUnitary M, + (∀ j,(v j).val.val ∈ N) ∧ (∀ j,(v j).support ≤ p j) ∧ + (∀ j,(τ.trace (p j).val).re/4 < (τ.trace (v j).support.val).re) ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + Tendsto (fun j => τ.trace (indexedCoefficient x j first * + patchingWord (v j).val (xs.map (fun a => (a.1,x a.2 j)) ++ + [(s,indexedCoefficient x j last)]))) atTop (𝓝 0) := by + let y := fun j i => cornerCompress (p j) (x i j) + have he (j i : ℕ) : cornerEmbedding (p j) (y j i)=x i j := + cornerCompress_supported (p j) (x i j) (hl i j) (hr i j) + obtain ⟨v,hv,hs,ht,hw⟩ := exists_varying_corner_partial_independence τ hNM hfactor hdiff hirr hsep + p hpN hp y (fun j i => (cornerCompress_norm_le (p j) (x i j)).trans (hx i j)) + (fun j i => by rw [he]; exact hc i j) + refine ⟨v,hv,hs,ht,?_⟩ + intro first last xs s + have hh := hw first last xs s + cases first <;> cases last <;> + simpa only [he,optionalCoefficient,indexedCoefficient] using hh + +theorem exists_quotient_corner_partial_sequence + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (g : Bounded M) (hg : ∀ j,IsStarProjection (g.val j)) + (hgN : ∀ j,(g.val j).val ∈ N) (hg0 : ∀ j,g.val j ≠ 0) + (x : ℕ → Bounded M) (hx : ∀ i j,‖(x i).val j‖ ≤ 1) + (hc : ∀ i j,τ.trace ((x i).val j)=0) + (hl : ∀ i,g*x i=x i) (hr : ∀ i,x i*g=x i) : + ∃ v : ℕ → PartialUnitary M, + (∀ j,(v j).val.val ∈ N) ∧ (∀ j,g.val j*(v j).support.val=(v j).support.val) ∧ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) g)).re/4 ≤ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport v))).re ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω (optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (x i)) first * + algebraPatchingWord (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) + (xs.map (fun a => (a.1,quotientMap τ (ω : Filter ℕ) (x a.2))) ++ + [(s,optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (x i)) last)]))=0 := by + let p := fun j => (⟨g.val j,hg j⟩ : AlgebraProjection M) + obtain ⟨v,hv,hs,ht,hw⟩ := exists_supported_corner_partial_sequence τ hNM hfactor hdiff hirr hsep + p hgN hg0 (fun i => (x i).val) hx hc + (fun i j => congrArg (fun a : Bounded M => a.val j) (hl i)) + (fun i j => congrArg (fun a : Bounded M => a.val j) (hr i)) + refine ⟨v,hv,hs,?_,?_⟩ + · apply le_of_tendsto_of_tendsto + ((Complex.continuous_re.continuousAt.tendsto.comp (traceRep_tendsto τ ω g)).div_const 4) + (Complex.continuous_re.continuousAt.tendsto.comp (traceRep_tendsto τ ω (boundedPartialSupport v))) + exact Eventually.of_forall (fun j => (ht j).le) + · intro first last xs s + exact quotient_ordered_moment_zero τ ω hω v x first last xs s (hw first last xs s) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/CornerTrace.lean b/lean/OAI/Analysis/FactorGeneration/CornerTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e7f173ed0e4fd3a972ee7ef99171ff515c7b0e4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/CornerTrace.lean @@ -0,0 +1,299 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +import OAI.Analysis.FactorGeneration.ProjectionLimits +import OAI.Analysis.FactorGeneration.TracialInclusion + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Trace estimates in the actual ambient algebra. The corner scalar uses +its normalized trace. These estimates do not assume or assert the existence +of a local-quantizing projection. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem cornerTrace_add (x y : M.toStarSubalgebra) : + τ.trace (x+y) = τ.trace x + τ.trace y := inner_add_right _ _ _ + +theorem trace_sub (x y : M.toStarSubalgebra) : + τ.trace (x-y) = τ.trace x - τ.trace y := inner_sub_right _ _ _ + +theorem cornerTrace_smul (c : ℂ) (x : M.toStarSubalgebra) : + τ.trace (c • x) = c * τ.trace x := inner_smul_right _ _ _ + +theorem norm_trace_mul_le (x y : M.toStarSubalgebra) : + ‖τ.trace (x*y)‖ ≤ τ.norm₂ x * τ.norm₂ y := by + have he := norm_inner_le_norm (𝕜 := ℂ) + (((star x : M.toStarSubalgebra) : H →L[ℂ] H) τ.vector) + ((y : H →L[ℂ] H) τ.vector) + have hi : inner ℂ (((star x : M.toStarSubalgebra) : H →L[ℂ] H) τ.vector) + ((y : H →L[ℂ] H) τ.vector) = τ.trace (x*y) := by + change inner ℂ (star (x : H →L[ℂ] H) τ.vector) ((y : H →L[ℂ] H) τ.vector) = _ + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left] + rfl + rw [hi] at he + change ‖τ.trace (x*y)‖ ≤ τ.norm₂ (star x)*τ.norm₂ y at he + simpa only [τ.norm₂_star] using he + +/-- The scalar conditional expectation in pMp, expressed in ambient coordinates. -/ +def cornerScalar (p : AlgebraProjection M) (x : M.toStarSubalgebra) : ℂ := + τ.trace (p.val*x*p.val) / τ.trace p.val + +def cornerCentered (p : AlgebraProjection M) (x : M.toStarSubalgebra) : M.toStarSubalgebra := + p.val*x*p.val - cornerScalar τ p x • p.val + +theorem cornerCentered_support (p : AlgebraProjection M) (x : M.toStarSubalgebra) : + p.val * cornerCentered τ p x = cornerCentered τ p x ∧ + cornerCentered τ p x * p.val = cornerCentered τ p x := by + constructor + · simp [cornerCentered,mul_sub,← mul_assoc,p.property.isIdempotentElem.eq] + · simp [cornerCentered,sub_mul,mul_assoc,p.property.isIdempotentElem.eq] + +theorem cornerCentered_trace (p : AlgebraProjection M) (hp : p.val ≠ 0) + (x : M.toStarSubalgebra) : τ.trace (cornerCentered τ p x) = 0 := by + have hn : τ.trace p.val ≠ 0 := by + intro h + have hh := projection_trace_pos τ p.val p.property hp + rw [h,Complex.zero_re] at hh + exact (lt_irrefl _ hh) + rw [cornerCentered,trace_sub,cornerTrace_smul,cornerScalar,div_mul_cancel₀ _ hn,sub_self] + +theorem compress_cornerCentered {p q : AlgebraProjection M} (hqp : q ≤ p) + (x : M.toStarSubalgebra) : + q.val*cornerCentered τ p x*q.val = q.val*x*q.val-cornerScalar τ p x • q.val := by + simp only [cornerCentered,mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc] + have hl : p.val*q.val=q.val := hqp + have hr := projection_mul_of_le hqp + simp only [← mul_assoc,hr] + simp only [mul_assoc,hl,q.property.isIdempotentElem.eq] + +/-- A supported compression has the trace scale sqrt(trace(q)), even against +an arbitrary bounded ambient test operator. -/ +theorem supported_trace_test_le (q : AlgebraProjection M) (x y : M.toStarSubalgebra) + (hx : x*q.val=x) : + ‖τ.trace (x*y)‖ ≤ τ.norm₂ x * (τ.norm₂ q.val * ‖y‖) := by + calc ‖τ.trace (x*y)‖ = ‖τ.trace (x*(q.val*y))‖ := by rw [← mul_assoc,hx] + _ ≤ τ.norm₂ x * τ.norm₂ (q.val*y) := norm_trace_mul_le τ _ _ + _ ≤ τ.norm₂ x * (τ.norm₂ q.val * ‖y‖) := + mul_le_mul_of_nonneg_left (τ.norm₂_mul_le_right _ _) (norm_nonneg _) + +theorem compression_trace_test_le (q : AlgebraProjection M) (x y : M.toStarSubalgebra) + (hy : ‖y‖ ≤ 1) : + ‖τ.trace ((q.val*x*q.val)*y)‖ ≤ τ.norm₂ (q.val*x*q.val) * τ.norm₂ q.val := by + have hx : (q.val*x*q.val)*q.val=q.val*x*q.val := by + rw [mul_assoc,q.property.isIdempotentElem.eq] + exact (supported_trace_test_le τ q _ y hx).trans + (mul_le_mul_of_nonneg_left (by nlinarith [show 0 ≤ τ.norm₂ q.val from norm_nonneg _]) + (norm_nonneg _)) + +end + +/-! Actual noncommutative L1 on the coordinate algebra: trace(sqrt(x* x)). +The supported L2-to-L1 estimate retains the square root of the support trace. +No quantizing projection or conditional expectation theorem is assumed. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance : CStarAlgebra M.toStarSubalgebra := {} +local instance : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (τ : TracialRepresentation M) + +def traceAbs (x : M.toStarSubalgebra) : M.toStarSubalgebra := CFC.sqrt (star x*x) +def norm₁ (x : M.toStarSubalgebra) : ℝ := (τ.trace (traceAbs x)).re + +theorem traceAbs_selfAdjoint (x : M.toStarSubalgebra) : IsSelfAdjoint (traceAbs x) := + (CFC.sqrt_nonneg _).isSelfAdjoint + +theorem traceAbs_sq (x : M.toStarSubalgebra) : traceAbs x * traceAbs x = star x*x := + CFC.sqrt_mul_sqrt_self _ (star_mul_self_nonneg x) + +theorem traceAbs_norm₂ (x : M.toStarSubalgebra) : τ.norm₂ (traceAbs x) = τ.norm₂ x := by + have h := congrArg Complex.re (τ.trace_star_mul (traceAbs x)) + rw [(traceAbs_selfAdjoint x).star_eq,traceAbs_sq,τ.trace_star_mul] at h + simp only [← Complex.ofReal_pow,Complex.ofReal_re] at h + nlinarith [show 0 ≤ τ.norm₂ x from norm_nonneg _, + show 0 ≤ τ.norm₂ (traceAbs x) from norm_nonneg _] + +theorem trace_nonneg_of_nonneg (a : M.toStarSubalgebra) (ha : 0 ≤ a) : + 0 ≤ (τ.trace a).re := by + have hs := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + have h := congrArg Complex.re (τ.trace_star_mul (CFC.sqrt a)) + rw [hs,CFC.sqrt_mul_sqrt_self a ha] at h + rw [h] + simp only [← Complex.ofReal_pow,Complex.ofReal_re] + positivity + +theorem norm₁_nonneg (x : M.toStarSubalgebra) : 0 ≤ norm₁ τ x := + trace_nonneg_of_nonneg τ _ (CFC.sqrt_nonneg _) + +theorem norm₁_le_norm₂ (x : M.toStarSubalgebra) : norm₁ τ x ≤ τ.norm₂ x := by + exact (Complex.re_le_norm _).trans ((τ.norm_trace_le_norm₂ _).trans_eq (traceAbs_norm₂ τ x)) + +/-- Right support passes to the positive square root without a polar decomposition. -/ +theorem traceAbs_support (q : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : x*q.val=x) : traceAbs x*q.val=traceAbs x := by + have he : star (traceAbs x*(1-q.val))*(traceAbs x*(1-q.val))=0 := by + rw [star_mul,star_sub,star_one,q.property.isSelfAdjoint.star_eq, + (traceAbs_selfAdjoint x).star_eq] + calc (1-q.val)*traceAbs x*(traceAbs x*(1-q.val)) = + (1-q.val)*(traceAbs x*traceAbs x)*(1-q.val) := by simp only [mul_assoc] + _ = 0 := by + rw [traceAbs_sq] + simp only [mul_assoc,mul_sub,mul_one,hx,sub_self] + have hz := (CStarRing.star_mul_self_eq_zero_iff _).mp he + rw [mul_sub,mul_one,sub_eq_zero] at hz + exact hz.symm + +/-- The trace scale needed in corner local quantization. -/ +theorem norm₁_le_support_norm₂ (q : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : x*q.val=x) : norm₁ τ x ≤ τ.norm₂ x * τ.norm₂ q.val := by + calc norm₁ τ x ≤ ‖τ.trace (traceAbs x)‖ := Complex.re_le_norm _ + _ = ‖τ.trace (traceAbs x*q.val)‖ := by rw [traceAbs_support q x hx] + _ ≤ τ.norm₂ (traceAbs x) * τ.norm₂ q.val := norm_trace_mul_le τ _ _ + _ = τ.norm₂ x * τ.norm₂ q.val := by rw [traceAbs_norm₂] + +theorem compression_norm₁_le (q : AlgebraProjection M) (x : M.toStarSubalgebra) : + norm₁ τ (q.val*x*q.val) ≤ τ.norm₂ (q.val*x*q.val)*τ.norm₂ q.val := by + apply norm₁_le_support_norm₂ + rw [mul_assoc,q.property.isIdempotentElem.eq] + +/-- A strict corner L2 estimate supplies the manuscript's actual L1 estimate. -/ +theorem compression_norm₁_lt_of_norm₂ (q : AlgebraProjection M) (hq : q.val ≠ 0) + (x : M.toStarSubalgebra) (ε : ℝ) + (h : τ.norm₂ (q.val*x*q.val) < ε*τ.norm₂ q.val) : + norm₁ τ (q.val*x*q.val) < ε*(τ.trace q.val).re := by + have hp : 0 < τ.norm₂ q.val := lt_of_le_of_ne (norm_nonneg _) + (fun h => hq ((τ.norm₂_eq_zero_iff q.val).mp h.symm)) + have he := projection_trace_sq τ q.val q.property + calc norm₁ τ (q.val*x*q.val) ≤ τ.norm₂ (q.val*x*q.val)*τ.norm₂ q.val := + compression_norm₁_le τ q x + _ < (ε*τ.norm₂ q.val)*τ.norm₂ q.val := mul_lt_mul_of_pos_right h hp + _ = ε*(τ.trace q.val).re := by rw [he]; ring + +end + +/-! A finite compression-energy estimate yields a nonzero corner projection with simultaneous L1 control. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_small_energy_piece {I J : Type*} (s : Finset I) (F : Finset J) + (t : I → ℝ) (a : I → J → ℝ) (ε : ℝ) + (ht : ∀ i ∈ s, 0 ≤ t i) (ha : ∀ i ∈ s, ∀ j ∈ F, 0 ≤ a i j) + (h : ∑ i ∈ s, ∑ j ∈ F, a i j < ε * ∑ i ∈ s, t i) : + ∃ i ∈ s, 0 < t i ∧ ∀ j ∈ F, a i j < ε*t i := by + classical + have hex : ∃ i ∈ s, (∑ j ∈ F, a i j) < ε*t i := by + by_contra hn + push Not at hn + have he := Finset.sum_le_sum hn + rw [← Finset.mul_sum] at he + exact (not_lt_of_ge he) h + obtain ⟨i,hi,he⟩ := hex + have htpos : 0 < t i := by + by_contra hn + have hz : t i=0 := le_antisymm (le_of_not_gt hn) (ht i hi) + rw [hz,mul_zero] at he + exact (not_lt_of_ge (Finset.sum_nonneg (ha i hi))) he + refine ⟨i,hi,htpos,fun j hj => ?_⟩ + exact (Finset.single_le_sum (ha i hi) hj).trans_lt he + +/-- The aggregate squared L2 budget has exactly the trace weighting required +for simultaneous strict L1 estimates on a nonzero subprojection. -/ +theorem exists_corner_L1_of_partition_energy {I : Type*} + (s : Finset I) (p : AlgebraProjection M) (q : I → AlgebraProjection M) + (hq : ∀ i ∈ s, q i ≤ p) (F : Finset M.toStarSubalgebra) + (ε : ℝ) (hε : 0 < ε) + (henergy : ∑ i ∈ s, ∑ x ∈ F, + τ.norm₂ ((q i).val*cornerCentered τ p x*(q i).val)^2 < + ε^2 * ∑ i ∈ s, (τ.trace (q i).val).re) : + ∃ r : AlgebraProjection M, r ≤ p ∧ r.val ≠ 0 ∧ (∃ i ∈ s, r=q i) ∧ ∀ x ∈ F, + norm₁ τ (r.val*cornerCentered τ p x*r.val) < ε*(τ.trace r.val).re := by + obtain ⟨i,hi,ht,he⟩ := exists_small_energy_piece s F + (fun i => (τ.trace (q i).val).re) + (fun i x => τ.norm₂ ((q i).val*cornerCentered τ p x*(q i).val)^2) (ε^2) + (fun i hi => by rw [projection_trace_sq τ _ (q i).property]; positivity) + (fun i hi x hx => sq_nonneg _) henergy + have hn : (q i).val ≠ 0 := by + intro hz + have hzero : τ.trace (q i).val=0 := by rw [hz]; exact inner_zero_right _ + rw [hzero,Complex.zero_re] at ht + exact (lt_irrefl _ ht) + refine ⟨q i,hq i hi,hn,⟨i,hi,rfl⟩,fun x hx => ?_⟩ + apply compression_norm₁_lt_of_norm₂ τ (q i) hn + have h := he x hx + rw [projection_trace_sq τ _ (q i).property] at h + have hnq : 0 ≤ τ.norm₂ (q i).val := norm_nonneg _ + have hnx : 0 ≤ τ.norm₂ ((q i).val*cornerCentered τ p x*(q i).val) := norm_nonneg _ + nlinarith [mul_nonneg hε.le hnq] + +end + +/-! The scalar trace estimate for a term with two supported patch letters. +It reduces to the actual compressed middle coefficient and keeps trace(q), +not trace(p), as the scale of the error. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +namespace CornerUnitary + +theorem norm₂_eq_support {q : AlgebraProjection M} (v : CornerUnitary q) : + τ.norm₂ v.val=τ.norm₂ q.val := by + have he := v.trace_norm_sq τ + rw [projection_trace_sq τ _ q.property] at he + nlinarith [show 0 ≤ τ.norm₂ v.val from norm_nonneg _,show 0 ≤ τ.norm₂ q.val from norm_nonneg _] + +end CornerUnitary + +theorem two_patch_trace_le (q : AlgebraProjection M) (v w : CornerUnitary q) + (a x b : M.toStarSubalgebra) (ha : ‖a‖ ≤ 1) (hb : ‖b‖ ≤ 1) : + ‖τ.trace (a*v.val*x*w.val*b)‖ ≤ τ.norm₂ (q.val*x*q.val)*τ.norm₂ q.val := by + have he : a*v.val*x*w.val*b = (a*v.val)*(q.val*x*q.val)*(w.val*b) := by + simp only [← mul_assoc] + rw [mul_assoc a v.val q.val,v.mul_support] + simp only [mul_assoc] + rw [← mul_assoc q.val w.val b,w.support_mul] + have hr : τ.trace ((a*v.val)*(q.val*x*q.val)*(w.val*b)) = + τ.trace ((q.val*x*q.val)*(w.val*b*a*v.val)) := by + rw [mul_assoc (a*v.val) (q.val*x*q.val) (w.val*b),τ.trace_mul_comm (a*v.val)] + simp only [mul_assoc] + have hnorm : ‖w.val*b*a‖ ≤ 1 := by + have hw : ‖w.val*b‖ ≤ 1 := (norm_mul_le _ _).trans + (by nlinarith [w.norm_le_one,norm_nonneg w.val,norm_nonneg b]) + exact (norm_mul_le _ _).trans (by nlinarith [norm_nonneg (w.val*b),norm_nonneg a]) + rw [he,hr] + have hn : τ.norm₂ (w.val*b*a*v.val) ≤ τ.norm₂ q.val := by + exact ((τ.norm₂_mul_le _ _).trans (mul_le_of_le_one_left (norm_nonneg _) hnorm)).trans_eq + (v.norm₂_eq_support τ) + exact (norm_trace_mul_le τ _ _).trans (mul_le_mul_of_nonneg_left hn (norm_nonneg _)) + +/-- The middle compression may be corner-centered with respect to a larger +residual support. This is the scalar version of the multiple-patch estimate. -/ +theorem two_patch_centered_trace_lt (p q : AlgebraProjection M) (hq : q.val ≠ 0) + (v w : CornerUnitary q) (a x b : M.toStarSubalgebra) (ha : ‖a‖ ≤ 1) (hb : ‖b‖ ≤ 1) + (ε : ℝ) (h : τ.norm₂ (q.val*cornerCentered τ p x*q.val) < ε*τ.norm₂ q.val) : + ‖τ.trace (a*v.val*cornerCentered τ p x*w.val*b)‖ < ε*(τ.trace q.val).re := by + have hpos : 0 < τ.norm₂ q.val := lt_of_le_of_ne (norm_nonneg _) + (fun hz => hq ((τ.norm₂_eq_zero_iff _).mp hz.symm)) + calc _ ≤ τ.norm₂ (q.val*cornerCentered τ p x*q.val)*τ.norm₂ q.val := + two_patch_trace_le τ q v w a _ b ha hb + _ < (ε*τ.norm₂ q.val)*τ.norm₂ q.val := mul_lt_mul_of_pos_right h hpos + _ = ε*(τ.trace q.val).re := by rw [projection_trace_sq τ _ q.property]; ring + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Correlation.lean b/lean/OAI/Analysis/FactorGeneration/Correlation.lean new file mode 100644 index 0000000000000000000000000000000000000000..1b24a6ac0666b42bedbe4277337813bbdab5ba8b --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Correlation.lean @@ -0,0 +1,71 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Topology.MetricSpace.Pseudo.Defs + +namespace OAI + +namespace Generator + +/-! Scalar error budgets and lower bounds for perturbation correlation. -/ + +theorem exists_correlation_parameter {s : ℝ} (hs : 0 < s) : + ∃ α : ℝ, 0 < α ∧ α < 1 / 4 ∧ α < s / 32 := by + refine ⟨min (1 / 8) (s / 64), lt_min (by norm_num) (by positivity), ?_, ?_⟩ + · exact lt_of_le_of_lt (min_le_left _ _) (by norm_num) + · exact lt_of_le_of_lt (min_le_right _ _) (by linarith) + +/-- The strict nonlinear error budget in the manuscript, with its original constants. -/ +theorem correlation_error_budget {s α : ℝ} (hs : 0 < s) (hα : 0 < α) + (hquarter : α < 1 / 4) (hsmall : α < s / 32) : + s * (4 * α ^ 2 / (1 - 2 * α)) < α * s ^ 2 / 4 := by + have hden : 0 < 1 - 2 * α := by linarith + have hnum : 0 < 4 * α ^ 2 := by positivity + have hquot : 4 * α ^ 2 / (1 - 2 * α) < 8 * α ^ 2 := by + apply (div_lt_iff₀ hden).mpr + nlinarith [mul_pos hnum (show 0 < 1 - 4 * α by linarith)] + have hfirst := mul_lt_mul_of_pos_left hquot hs + have hsecond : 8 * s * α ^ 2 < α * s ^ 2 / 4 := by + have hp : 0 < α * s := mul_pos hα hs + nlinarith [mul_pos hp (show 0 < s - 32 * α by linarith)] + nlinarith + +/-- Triangle-inequality step converting the correlation error into a lower bound. -/ +theorem correlation_lower_bound {s α δ : ℝ} (hs : 0 < s) (hα : 0 < α) + (hquarter : α < 1 / 4) (hsmall : α < s / 32) {c : ℂ} + (hc : ‖c - ((α * s ^ 2 / 2 : ℝ) : ℂ)‖ ≤ + s * (4 * α ^ 2 / (1 - 2 * α)) + δ) : + α * s ^ 2 / 4 - δ ≤ ‖c‖ := by + have he := correlation_error_budget hs hα hquarter hsmall + have hcenter : 0 ≤ α * s ^ 2 / 2 := by positivity + have ht := norm_sub_le c (c - ((α * s ^ 2 / 2 : ℝ) : ℂ)) + rw [sub_sub_cancel, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hcenter] at ht + linarith + +/-! The numerical and topological contradiction for a continuous correlated sequence. -/ +open Filter Topology + +theorem no_continuous_correlated_sequence {X : Type*} [TopologicalSpace X] + (F : X → ℝ) {x : X} (hF : ContinuousAt F x) (hzero : F x = 0) + (u : ℕ → X) (hu : Tendsto u atTop (𝓝 x)) + (δ : ℕ → ℝ) (hδ : Tendsto δ atTop (𝓝 0)) (c : ℕ → ℂ) + {s α : ℝ} (hs : 0 < s) (hα : 0 < α) (hq : α < 1 / 4) (hsmall : α < s / 32) + (hc : ∀ n, ‖c n - ((α * s ^ 2 / 2 : ℝ) : ℂ)‖ ≤ + s * (4 * α ^ 2 / (1 - 2 * α)) + δ n) + (hproj : ∀ n, ‖c n‖ ≤ F (u n)) : False := by + have hFu : Tendsto (fun n => F (u n)) atTop (𝓝 0) := by + simpa only [hzero, Function.comp_def] using hF.tendsto.comp hu + have hpos : 0 < α * s ^ 2 / 8 := by positivity + have hnearF := Metric.tendsto_nhds.mp hFu (α * s ^ 2 / 8) hpos + have hnearδ := Metric.tendsto_nhds.mp hδ (α * s ^ 2 / 8) hpos + obtain ⟨n, hnF, hnδ⟩ := (hnearF.and hnearδ).exists + rw [Real.dist_eq, sub_zero] at hnF hnδ + have hlow := correlation_lower_bound hs hα hq hsmall (hc n) + have hupp := hproj n + have hFlt := (abs_lt.mp hnF).2 + have hδlt := (abs_lt.mp hnδ).2 + linarith + +end Generator + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/CyclicPredual.lean b/lean/OAI/Analysis/FactorGeneration/CyclicPredual.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbadca8b6276dc78b155093d302ca74e94016a52 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/CyclicPredual.lean @@ -0,0 +1,454 @@ +import Mathlib.Analysis.LocallyConvex.SeparatingDual +import Mathlib.Analysis.LocallyConvex.Separation +import Mathlib.Analysis.LocallyConvex.WeakDual +import Mathlib.Analysis.Normed.Group.Quotient +import Mathlib.Analysis.Normed.Module.RCLike.Extend +import Mathlib.Topology.Algebra.Module.ContinuousLinearMap.Quotient +import Mathlib.Topology.UniformSpace.UniformApproximation +import OAI.Analysis.FactorGeneration.HilbertLimits + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! A concrete candidate predual: the norm-closed complex span of vector +functionals from the faithful cyclic trace representation, with completeness, +separability, and an isometric evaluation map. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- Name the existing operator-norm structure to keep the norm topology +explicit through the nested dual and submodule constructions. -/ +instance algebraDualNormed (M : VonNeumannAlgebra H) : + NormedAddCommGroup (StrongDual ℂ M.toStarSubalgebra) := inferInstance + +def traceCyclicLinearIsometry : M.toStarSubalgebra →ₗᵢ[ℂ] + (traceCyclicSpace τ →L[ℂ] traceCyclicSpace τ) := + { (traceCyclicHom τ).toLinearMap with norm_map' := traceCyclicHom_norm τ } + +def cyclicCoefficient (ξ η : traceCyclicSpace τ) : StrongDual ℂ M.toStarSubalgebra := + (innerSL ℂ ξ).comp ((ContinuousLinearMap.apply ℂ (traceCyclicSpace τ) η).comp + (traceCyclicLinearIsometry τ).toContinuousLinearMap) + +@[simp] theorem cyclicCoefficient_apply (ξ η : traceCyclicSpace τ) (a : M.toStarSubalgebra) : + cyclicCoefficient τ ξ η a=inner ℂ ξ (traceCyclicHom τ a η) := rfl + +theorem cyclicCoefficient_norm_le (ξ η : traceCyclicSpace τ) : + ‖cyclicCoefficient τ ξ η‖ ≤ ‖ξ‖*‖η‖ := by + apply (cyclicCoefficient τ ξ η).opNorm_le_bound (M := ‖ξ‖*‖η‖) (mul_nonneg (norm_nonneg ξ) (norm_nonneg η)) + intro a + calc + ‖cyclicCoefficient τ ξ η a‖ ≤ ‖ξ‖*‖traceCyclicHom τ a η‖ := norm_inner_le_norm _ _ + _ ≤ ‖ξ‖*(‖traceCyclicHom τ a‖*‖η‖) := + mul_le_mul_of_nonneg_left ((traceCyclicHom τ a).le_opNorm η) (norm_nonneg _) + _ = (‖ξ‖*‖η‖)*‖a‖ := by rw [traceCyclicHom_norm]; ring + +theorem cyclicCoefficient_continuous : + Continuous (fun p : traceCyclicSpace τ × traceCyclicSpace τ => cyclicCoefficient τ p.1 p.2) := by + unfold cyclicCoefficient + fun_prop + +abbrev cyclicPredual : Submodule ℂ (StrongDual ℂ M.toStarSubalgebra) := + (Submodule.span ℂ (Set.range (fun p : traceCyclicSpace τ × traceCyclicSpace τ => + cyclicCoefficient τ p.1 p.2))).topologicalClosure + +instance cyclicPredual_normed : NormedAddCommGroup (cyclicPredual τ) := inferInstance + +instance cyclicPredual_normedSpace : NormedSpace ℂ (cyclicPredual τ) := inferInstance + +instance cyclicPredual_complete : CompleteSpace (cyclicPredual τ) := + inferInstanceAs (CompleteSpace (Submodule.span ℂ (Set.range + (fun p : traceCyclicSpace τ × traceCyclicSpace τ => cyclicCoefficient τ p.1 p.2))).topologicalClosure) + +theorem cyclicCoefficient_mem (ξ η : traceCyclicSpace τ) : + cyclicCoefficient τ ξ η ∈ cyclicPredual τ := + Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨(ξ,η),rfl⟩) + +theorem cyclicPredual_separable [TopologicalSpace.SeparableSpace (traceCyclicSpace τ)] : + TopologicalSpace.SeparableSpace (cyclicPredual τ) := + (TopologicalSpace.isSeparable_range (cyclicCoefficient_continuous τ)).span.closure.separableSpace + +def cyclicPredualEvaluation (a : M.toStarSubalgebra) : StrongDual ℂ (cyclicPredual τ) := + (ContinuousLinearMap.apply ℂ ℂ a).domRestrict (cyclicPredual τ) + +@[simp] theorem cyclicPredualEvaluation_apply (a : M.toStarSubalgebra) (f : cyclicPredual τ) : + cyclicPredualEvaluation τ a f=f.val a := rfl + +theorem cyclicPredualEvaluation_norm_le (a : M.toStarSubalgebra) : + ‖cyclicPredualEvaluation τ a‖ ≤ ‖a‖ := by + apply (cyclicPredualEvaluation τ a).opNorm_le_bound (M := ‖a‖) (norm_nonneg a) + intro f + exact (f.val.le_opNorm a).trans_eq (mul_comm _ _) + +theorem cyclicPredualEvaluation_norm (a : M.toStarSubalgebra) : + ‖cyclicPredualEvaluation τ a‖=‖a‖ := by + apply le_antisymm (cyclicPredualEvaluation_norm_le τ a) + rw [← traceCyclicHom_norm τ a] + apply (traceCyclicHom τ a).opNorm_le_bound + (M := ‖cyclicPredualEvaluation τ a‖) (ContinuousLinearMap.opNorm_nonneg _) + intro η + let ξ := traceCyclicHom τ a η + let f : cyclicPredual τ := ⟨cyclicCoefficient τ ξ η,cyclicCoefficient_mem τ ξ η⟩ + have h : ‖inner ℂ ξ ξ‖ ≤ ‖cyclicPredualEvaluation τ a‖*(‖ξ‖*‖η‖) := + ((cyclicPredualEvaluation τ a).le_opNorm f).trans + (mul_le_mul_of_nonneg_left (cyclicCoefficient_norm_le τ ξ η) (norm_nonneg _)) + have hs : ‖inner ℂ ξ ξ‖=‖ξ‖^2 := by + rw [inner_self_eq_norm_sq_to_K,norm_pow] + simp + rw [hs] at h + change ‖ξ‖ ≤ ‖cyclicPredualEvaluation τ a‖*‖η‖ + by_cases hz : ‖ξ‖=0 + · rw [hz]; positivity + · have hp : 0 < ‖ξ‖ := lt_of_le_of_ne (norm_nonneg _) (Ne.symm hz) + nlinarith + +def cyclicPredualEvaluationIsometry : M.toStarSubalgebra →ₗᵢ[ℂ] StrongDual ℂ (cyclicPredual τ) where + toFun := cyclicPredualEvaluation τ + map_add' _ _ := by ext f; exact map_add f.val _ _ + map_smul' _ _ := by ext f; exact map_smul f.val _ _ + norm_map' := cyclicPredualEvaluation_norm τ + +end + +/-! Every functional in the constructed norm-closed vector-functional space is +weak-operator continuous on each bounded ball of the original algebra. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def ballContinuousFunctionals (M : VonNeumannAlgebra H) (C : ℝ) : + Submodule ℂ (StrongDual ℂ M.toStarSubalgebra) where + carrier := {f | Continuous (fun T : weakOperatorBall M C => f ⟨T.val.toCLM,T.property.1⟩)} + zero_mem' := by exact continuous_const + add_mem' hf hg := hf.add hg + smul_mem' c f hf := hf.const_smul c + +theorem ballContinuousFunctionals_isClosed (M : VonNeumannAlgebra H) (C : ℝ) : + IsClosed (ballContinuousFunctionals M C : Set (StrongDual ℂ M.toStarSubalgebra)) := by + apply IsSeqClosed.isClosed + intro f g hf hfg + have hbound : Tendsto (fun n => ‖g-f n‖*(|C|+1)) atTop (𝓝 0) := by + simpa using (((tendsto_const_nhds (x := g)).sub hfg).norm.mul_const (|C|+1)) + have hu : TendstoUniformly + (fun n (T : weakOperatorBall M C) => f n ⟨T.val.toCLM,T.property.1⟩) + (fun T : weakOperatorBall M C => g ⟨T.val.toCLM,T.property.1⟩) atTop := by + apply Metric.tendstoUniformly_iff.mpr + intro ε hε + filter_upwards [Metric.tendsto_nhds.mp hbound ε hε] with n hn + intro T + have hT : ‖T.val.toCLM‖ ≤ |C|+1 := + T.property.2.trans ((le_abs_self C).trans (le_add_of_nonneg_right zero_le_one)) + rw [dist_eq_norm] + change ‖(g-f n) ⟨T.val.toCLM,T.property.1⟩‖ < ε + have h := ((g-f n).le_opNorm ⟨T.val.toCLM,T.property.1⟩).trans + (mul_le_mul_of_nonneg_left hT (norm_nonneg _)) + have hnn : 0 ≤ ‖g-f n‖*(|C|+1) := mul_nonneg (norm_nonneg _) (by positivity) + exact h.trans_lt (by simpa only [Real.dist_eq,sub_zero,abs_of_nonneg hnn] using hn) + exact hu.continuous (Eventually.of_forall hf).frequently + +include τ in + theorem cyclicPredual_le_ballContinuousFunctionals (C : ℝ) : + cyclicPredual τ ≤ ballContinuousFunctionals M C := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro f ⟨⟨ξ,η⟩,rfl⟩ + change Continuous (fun T : weakOperatorBall M C => inner ℂ ξ.val (T.val η.val)) + exact ContinuousLinearMapWOT.continuous_inner_apply continuous_subtype_val η.val ξ.val + · exact ballContinuousFunctionals_isClosed M C + +theorem cyclicPredual_ball_continuous (C : ℝ) (f : cyclicPredual τ) : + Continuous (fun T : weakOperatorBall M C => f.val ⟨T.val.toCLM,T.property.1⟩) := + cyclicPredual_le_ballContinuousFunctionals τ C f.property + +end + +/-! Recover every functional on the constructed predual from an actual algebra +element, using compact bounded balls and weak-dual Hahn--Banach separation. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +instance predualWeakScalarTower : IsScalarTower ℝ ℂ (WeakDual ℂ (cyclicPredual τ)) := + inferInstanceAs (IsScalarTower ℝ ℂ (StrongDual ℂ (cyclicPredual τ))) + +instance predualWeakLocallyConvex : LocallyConvexSpace ℝ (WeakDual ℂ (cyclicPredual τ)) := + inferInstanceAs (LocallyConvexSpace ℝ (WeakBilin (topDualPairing ℂ (cyclicPredual τ)))) + +def predualWeakEvaluation : M.toStarSubalgebra →ₗ[ℂ] WeakDual ℂ (cyclicPredual τ) := + StrongDual.toWeakDual.toLinearMap.comp (cyclicPredualEvaluationIsometry τ).toLinearMap + +def predualWeakBall (C : ℝ) : Set (WeakDual ℂ (cyclicPredual τ)) := + predualWeakEvaluation τ '' {a | ‖a‖ ≤ C} + +theorem predualWeakBall_isCompact (C : ℝ) : IsCompact (predualWeakBall τ C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + let f : weakOperatorBall M C → WeakDual ℂ (cyclicPredual τ) := + fun T => predualWeakEvaluation τ ⟨T.val.toCLM,T.property.1⟩ + have hf : Continuous f := by + apply WeakBilin.continuous_of_continuous_eval + intro z + exact cyclicPredual_ball_continuous τ C z + have he : predualWeakBall τ C=Set.range f := by + ext T + constructor + · rintro ⟨a,ha,rfl⟩ + exact ⟨⟨ContinuousLinearMapWOT.ofCLM a.val,⟨a.property,ha⟩⟩,rfl⟩ + · rintro ⟨a,rfl⟩ + exact ⟨⟨a.val.toCLM,a.property.1⟩,a.property.2,rfl⟩ + rw [he] + exact isCompact_range hf + +theorem predualWeakBall_convex (C : ℝ) : Convex ℝ (predualWeakBall τ C) := by + have h : Convex ℝ {a : M.toStarSubalgebra | ‖a‖ ≤ C} := by + simpa only [Metric.closedBall,dist_zero_right] using convex_closedBall (0 : M.toStarSubalgebra) C + exact h.linear_image ((predualWeakEvaluation τ).restrictScalars ℝ) + +theorem dual_norm_le_of_re_unitBall (f : StrongDual ℂ M.toStarSubalgebra) (C : ℝ) + (hC : 0 ≤ C) (hf : ∀ a : M.toStarSubalgebra,‖a‖ ≤ 1 → (f a).re ≤ C) : ‖f‖ ≤ C := by + let r : StrongDual ℝ M.toStarSubalgebra := (StrongDual.extendRCLikeₗᵢ (𝕜 := ℂ)).symm f + have hr : ‖r‖=‖f‖ := (StrongDual.extendRCLikeₗᵢ (𝕜 := ℂ)).symm.norm_map f + rw [← hr] + apply ContinuousLinearMap.opNorm_le_of_unit_norm hC + intro a ha + change |(f a).re| ≤ C + apply abs_le.mpr + refine ⟨?_,hf a ha.le⟩ + have hn := hf (-a) (by simpa only [norm_neg] using ha.le) + simpa only [map_neg,Complex.neg_re,neg_le] using hn + +private theorem weakDual_separation {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + {s : Set (WeakDual ℂ E)} {x : WeakDual ℂ E} + (hs : Convex ℝ s) (hclosed : IsClosed s) (hx : x ∉ s) : + ∃ (g : StrongDual ℂ (WeakDual ℂ E)) (u : ℝ), + (∀ a ∈ s, (g a).re < u) ∧ u < (g x).re := by + let : AddCommGroup (WeakDual ℂ E) := inferInstance + let : Module ℝ (WeakDual ℂ E) := inferInstanceAs (Module ℝ (StrongDual ℂ E)) + let : Module ℂ (WeakDual ℂ E) := inferInstanceAs (Module ℂ (StrongDual ℂ E)) + let : IsScalarTower ℝ ℂ (WeakDual ℂ E) := + inferInstanceAs (IsScalarTower ℝ ℂ (StrongDual ℂ E)) + let : LocallyConvexSpace ℝ (WeakDual ℂ E) := + inferInstanceAs (LocallyConvexSpace ℝ (WeakBilin (topDualPairing ℂ E))) + exact RCLike.geometric_hahn_banach_closed_point (𝕜 := ℂ) hs hclosed hx + +theorem cyclicPredualEvaluation_unitBall_surjective + (φ : StrongDual ℂ (cyclicPredual τ)) (hφ : ‖φ‖ ≤ 1) : + ∃ a : M.toStarSubalgebra,‖a‖ ≤ 1 ∧ cyclicPredualEvaluation τ a=φ := by + have hm : StrongDual.toWeakDual φ ∈ predualWeakBall τ 1 := by + by_contra hnot + obtain ⟨g,u,hgu,hug⟩ := weakDual_separation + (predualWeakBall_convex τ 1) (predualWeakBall_isCompact τ 1).isClosed hnot + obtain ⟨f,hf⟩ := LinearMap.dualEmbedding_surjective + (topDualPairing ℂ (cyclicPredual τ)) g + have he (a : M.toStarSubalgebra) : g (predualWeakEvaluation τ a)=f.val a := by + rw [← hf] + rfl + have heφ : g (StrongDual.toWeakDual φ)=φ f := by + rw [← hf] + rfl + have hu : 0 < u := by + have h := hgu (predualWeakEvaluation τ 0) ⟨0,by simp,rfl⟩ + simpa only [he,map_zero,Complex.zero_re] using h + have hn : ‖f.val‖ ≤ u := dual_norm_le_of_re_unitBall f.val u hu.le (fun a ha => by + have hh := (hgu (predualWeakEvaluation τ a) ⟨a,ha,rfl⟩).le + rw [he] at hh + exact hh) + have hb : (φ f).re ≤ u := by + calc + (φ f).re ≤ ‖φ f‖ := Complex.re_le_norm _ + _ ≤ ‖φ‖*‖f‖ := φ.le_opNorm f + _ ≤ 1*‖f‖ := mul_le_mul_of_nonneg_right hφ (norm_nonneg f) + _ = ‖f‖ := one_mul _ + _ ≤ u := hn + rw [heφ] at hug + exact (not_lt_of_ge hb) hug + obtain ⟨a,ha,he⟩ := hm + exact ⟨a,ha,congrArg WeakDual.toStrongDual he⟩ + +end + +/-! Evaluation surjectivity for any subspace of bounded-unit-ball WOT-continuous +functionals. Compactness and Hahn--Banach supply actual algebra elements. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (F : Submodule ℂ (StrongDual ℂ M.toStarSubalgebra)) + +instance functionalSubspaceNormed : NormedAddCommGroup F := inferInstance + +instance functionalSubspaceNormedSpace : NormedSpace ℂ F := inferInstance + +def functionalSubspaceEvaluation (a : M.toStarSubalgebra) : StrongDual ℂ F := + (ContinuousLinearMap.apply ℂ ℂ a).domRestrict F + +@[simp] theorem functionalSubspaceEvaluation_apply (a : M.toStarSubalgebra) (f : F) : + functionalSubspaceEvaluation F a f = f.val a := rfl + +def functionalSubspaceEvaluationLinear : M.toStarSubalgebra →ₗ[ℂ] StrongDual ℂ F where + toFun := functionalSubspaceEvaluation F + map_add' a b := by ext f; exact map_add f.val a b + map_smul' c a := by ext f; exact map_smul f.val c a + +instance functionalSubspaceWeakScalarTower : IsScalarTower ℝ ℂ (WeakDual ℂ F) := + inferInstanceAs (IsScalarTower ℝ ℂ (StrongDual ℂ F)) + +instance functionalSubspaceWeakLocallyConvex : LocallyConvexSpace ℝ (WeakDual ℂ F) := + inferInstanceAs (LocallyConvexSpace ℝ (WeakBilin (topDualPairing ℂ F))) + +def functionalSubspaceWeakEvaluation : M.toStarSubalgebra →ₗ[ℂ] WeakDual ℂ F := + StrongDual.toWeakDual.toLinearMap.comp (functionalSubspaceEvaluationLinear F) + +def functionalSubspaceWeakBall (C : ℝ) : Set (WeakDual ℂ F) := + functionalSubspaceWeakEvaluation F '' {a | ‖a‖ ≤ C} + +theorem functionalSubspaceWeakBall_isCompact (C : ℝ) + (hF : F ≤ ballContinuousFunctionals M C) : IsCompact (functionalSubspaceWeakBall F C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + let f : weakOperatorBall M C → WeakDual ℂ F := + fun T => functionalSubspaceWeakEvaluation F ⟨T.val.toCLM,T.property.1⟩ + have hf : Continuous f := by + apply WeakBilin.continuous_of_continuous_eval + intro z + exact hF z.property + have he : functionalSubspaceWeakBall F C=Set.range f := by + ext T + constructor + · rintro ⟨a,ha,rfl⟩ + exact ⟨⟨ContinuousLinearMapWOT.ofCLM a.val,⟨a.property,ha⟩⟩,rfl⟩ + · rintro ⟨a,rfl⟩ + exact ⟨⟨a.val.toCLM,a.property.1⟩,a.property.2,rfl⟩ + rw [he] + exact isCompact_range hf + +theorem functionalSubspaceWeakBall_convex (C : ℝ) : Convex ℝ (functionalSubspaceWeakBall F C) := by + have h : Convex ℝ {a : M.toStarSubalgebra | ‖a‖ ≤ C} := by + simpa only [Metric.closedBall,dist_zero_right] using convex_closedBall (0 : M.toStarSubalgebra) C + exact h.linear_image ((functionalSubspaceWeakEvaluation F).restrictScalars ℝ) + +theorem functionalSubspaceEvaluation_unitBall_surjective + (hF : F ≤ ballContinuousFunctionals M 1) + (φ : StrongDual ℂ F) (hφ : ‖φ‖ ≤ 1) : + ∃ a : M.toStarSubalgebra,‖a‖ ≤ 1 ∧ functionalSubspaceEvaluation F a=φ := by + have hm : StrongDual.toWeakDual φ ∈ functionalSubspaceWeakBall F 1 := by + by_contra hnot + obtain ⟨g,u,hgu,hug⟩ := weakDual_separation + (functionalSubspaceWeakBall_convex F 1) (functionalSubspaceWeakBall_isCompact F 1 hF).isClosed hnot + obtain ⟨f,hf⟩ := LinearMap.dualEmbedding_surjective + (topDualPairing ℂ F) g + have he (a : M.toStarSubalgebra) : g (functionalSubspaceWeakEvaluation F a)=f.val a := by + rw [← hf] + rfl + have heφ : g (StrongDual.toWeakDual φ)=φ f := by + rw [← hf] + rfl + have hu : 0 < u := by + have h := hgu (functionalSubspaceWeakEvaluation F 0) ⟨0,by simp,rfl⟩ + simpa only [he,map_zero,Complex.zero_re] using h + have hn : ‖f.val‖ ≤ u := dual_norm_le_of_re_unitBall f.val u hu.le (fun a ha => by + have hh := (hgu (functionalSubspaceWeakEvaluation F a) ⟨a,ha,rfl⟩).le + rw [he] at hh + exact hh) + have hb : (φ f).re ≤ u := by + calc + (φ f).re ≤ ‖φ f‖ := Complex.re_le_norm _ + _ ≤ ‖φ‖*‖f‖ := φ.le_opNorm f + _ ≤ 1*‖f‖ := mul_le_mul_of_nonneg_right hφ (norm_nonneg f) + _ = ‖f‖ := one_mul _ + _ ≤ u := hn + rw [heφ] at hug + exact (not_lt_of_ge hb) hug + obtain ⟨a,ha,he⟩ := hm + exact ⟨a,ha,congrArg WeakDual.toStrongDual he⟩ + +/-- Unit-ball surjectivity extends by rescaling to the whole dual. -/ +theorem functionalSubspaceEvaluation_surjective + (hF : F ≤ ballContinuousFunctionals M 1) : + Function.Surjective (functionalSubspaceEvaluation F) := by + intro φ + let c : ℂ := (‖φ‖ + 1 : ℝ) + have hc : c ≠ 0 := by dsimp [c]; exact_mod_cast ne_of_gt (by positivity : 0 < ‖φ‖ + 1) + have hnorm : ‖c⁻¹ • φ‖ ≤ 1 := by + rw [norm_smul, norm_inv] + have hn : ‖c‖ = ‖φ‖ + 1 := by + dsimp [c] + rw [Complex.norm_real, Real.norm_of_nonneg (by positivity)] + rw [hn] + exact (inv_mul_le_one₀ (by positivity : 0 < ‖φ‖ + 1)).mpr (by linarith) + obtain ⟨a, _, ha⟩ := functionalSubspaceEvaluation_unitBall_surjective F hF (c⁻¹ • φ) hnorm + refine ⟨c • a, ?_⟩ + change functionalSubspaceEvaluationLinear F (c • a) = φ + rw [map_smul] + change c • functionalSubspaceEvaluation F a = φ + rw [ha, smul_smul, mul_inv_cancel₀ hc, one_smul] + +end + +/-! Exact characterization of the cyclic predual by WOT continuity on the +unit ball. No continuity of an arbitrary given-predual evaluation is assumed +or asserted here. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem ballContinuousFunctionals_eq_cyclicPredual : + ballContinuousFunctionals M 1 = cyclicPredual τ := by + apply le_antisymm + · intro f hf + let F := ballContinuousFunctionals M 1 + let K : Submodule ℂ F := (cyclicPredual τ).comap F.subtype + let : IsClosed (K : Set F) := + (Submodule.isClosed_topologicalClosure _).preimage continuous_subtype_val + let z : F := ⟨f, hf⟩ + by_contra hz + have hq : K.mkQ z ≠ 0 := by + intro heq + exact hz ((Submodule.Quotient.mk_eq_zero K).mp heq) + obtain ⟨g, hg⟩ := SeparatingDual.exists_ne_zero (R := ℂ) hq + obtain ⟨a, ha⟩ := functionalSubspaceEvaluation_surjective F le_rfl (g.comp K.mkQL) + have ha0 : a = 0 := by + apply norm_eq_zero.mp + rw [← cyclicPredualEvaluation_norm τ] + apply norm_eq_zero.mpr + ext q + change q.val a = 0 + let q' : F := ⟨q.val, cyclicPredual_le_ballContinuousFunctionals τ 1 q.property⟩ + have hk : K.mkQ q' = 0 := (Submodule.Quotient.mk_eq_zero K).mpr q.property + have h := congrArg (fun ψ : StrongDual ℂ F => ψ q') ha + change q.val a = g (K.mkQ q') at h + simpa only [hk, map_zero] using h + apply hg + have h := congrArg (fun ψ : StrongDual ℂ F => ψ z) ha + change f a = g (K.mkQ z) at h + simpa only [ha0, map_zero] using h.symm + · exact cyclicPredual_le_ballContinuousFunctionals τ 1 + +theorem mem_cyclicPredual_iff_unitBall_continuous (f : StrongDual ℂ M.toStarSubalgebra) : + f ∈ cyclicPredual τ ↔ + Continuous (fun T : weakOperatorBall M 1 => f ⟨T.val.toCLM, T.property.1⟩) := by + rw [← ballContinuousFunctionals_eq_cyclicPredual τ] + rfl + +theorem mem_cyclicPredual_of_unitBall_continuous (f : StrongDual ℂ M.toStarSubalgebra) + (hf : Continuous (fun T : weakOperatorBall M 1 => f ⟨T.val.toCLM, T.property.1⟩)) : + f ∈ cyclicPredual τ := + (mem_cyclicPredual_iff_unitBall_continuous τ f).mpr hf + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Dimension.lean b/lean/OAI/Analysis/FactorGeneration/Dimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a3e69186d46264cd27e6b1324fa1ec0d0146f45 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Dimension.lean @@ -0,0 +1,881 @@ +import Mathlib.Data.Finset.Max +import OAI.Analysis.FactorGeneration.DyadicComparison + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Archimedean comparison for the constructed dyadic reference projections. +Orthogonal sibling corners supply copies for the finite-algebra shift argument. -/ +section +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- Follow the false child at every level of the actual coherent dyadic system. -/ +def dyadicFalseIndex : (n : ℕ) → DyadicIndex n + | 0 => () + | n+1 => (dyadicFalseIndex n,false) + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + +def traceFreeDyadicReference (p : AlgebraProjection M) (n : ℕ) : AlgebraProjection M := + ((traceFreeDyadicPartition hfactor hdiff p n).leg (dyadicFalseIndex n)).target + +def traceFreeDyadicSibling (p : AlgebraProjection M) (n : ℕ) : AlgebraProjection M := + ((traceFreeDyadicPartition hfactor hdiff p (n+1)).leg (dyadicFalseIndex n,true)).target + +theorem traceFreeDyadicReference_zero (p : AlgebraProjection M) : + traceFreeDyadicReference hfactor hdiff p 0=p := + PartialIsometry.onProjection_target p + +theorem traceFreeDyadic_child_le (p : AlgebraProjection M) (n : ℕ) + (i : DyadicIndex n) (b : Bool) : + ((traceFreeDyadicPartition hfactor hdiff p (n+1)).leg (i,b)).target ≤ + ((traceFreeDyadicPartition hfactor hdiff p n).leg i).target := + PartialIsometry.compose_target_le _ _ (by + rw [EquivalentPartition.initial] + exact EquivalentPartition.bound _ b) + +theorem traceFreeDyadicReference_antitone (p : AlgebraProjection M) : + Antitone (traceFreeDyadicReference hfactor hdiff p) := by + apply antitone_nat_of_succ_le + intro n + exact traceFreeDyadic_child_le hfactor hdiff p n (dyadicFalseIndex n) false + +theorem traceFreeDyadicSibling_le (p : AlgebraProjection M) (n : ℕ) : + traceFreeDyadicSibling hfactor hdiff p n ≤ traceFreeDyadicReference hfactor hdiff p n := + traceFreeDyadic_child_le hfactor hdiff p n (dyadicFalseIndex n) true + +theorem traceFreeDyadicReference_sibling_orthogonal (p : AlgebraProjection M) (n : ℕ) : + (traceFreeDyadicReference hfactor hdiff p (n+1)).val* + (traceFreeDyadicSibling hfactor hdiff p n).val=0 := by + apply EquivalentPartition.orthogonal + exact fun h => Bool.false_ne_true (congrArg Prod.snd h) + +theorem traceFreeDyadicSibling_orthogonal (p : AlgebraProjection M) (i j : ℕ) (hij : i≠j) : + (traceFreeDyadicSibling hfactor hdiff p i).val* + (traceFreeDyadicSibling hfactor hdiff p j).val=0 := by + have hlt (i j : ℕ) (h : i ?_⟩ + exact AlgebraProjection.subequivalent_trans (AlgebraProjection.subequivalent_of_le + (traceFreeDyadicReference_antitone hfactor hdiff p hm)) he + +end Tracial + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- The unchanged original finite diffuse factor has a decreasing sequence +of nonzero dyadic reference projections satisfying Archimedean comparison. -/ +theorem isII1Factor_archimedean_reference + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) : + ∃ e : ℕ → Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed), + (e 0).val=1 ∧ Antitone e ∧ (∀ n, (e n).val≠0) ∧ + ∀ r : Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed), + (∀ n, r.Subequivalent (e n)) → r.val=0 := by + let M := vonNeumannOfWOTClosed S hS.weaklyClosed + have hf : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + let p : Tracial.AlgebraProjection M := ⟨1,IsStarProjection.one _⟩ + refine ⟨Tracial.traceFreeDyadicReference hf hS.diffuse p,?_, + Tracial.traceFreeDyadicReference_antitone hf hS.diffuse p,?_,?_⟩ + · exact congrArg Subtype.val (Tracial.traceFreeDyadicReference_zero hf hS.diffuse p) + · intro n + apply Tracial.traceFreeDyadicReference_ne_zero hf hS.diffuse p _ n + intro h + exact hS.nonzero (congrArg Subtype.val h).symm + · intro r hr + exact Tracial.traceFree_dyadic_archimedean hf hS.diffuse hS.finite p r hr + +end + +/-! Finite rounding by actual subset projections. A maximal fitting subset +leaves a remainder smaller in comparison than any unused equivalent piece. -/ +namespace Tracial + +section +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace EquivalentPartition +variable {p : AlgebraProjection M} {ι : Type*} [Fintype ι] + +theorem exists_maximal_fitting_subset (E : EquivalentPartition p ι) (q : AlgebraProjection M) : + ∃ s : Finset ι, (E.subset s).Subequivalent q ∧ + ∀ t : Finset ι, (E.subset t).Subequivalent q → t.card ≤ s.card := by + classical + let F : Finset (Finset ι) := Finset.univ.filter (fun s => (E.subset s).Subequivalent q) + have h0 : (E.subset ∅).Subequivalent q := AlgebraProjection.subequivalent_of_le (by + change q.val*(E.subset ∅).val=(E.subset ∅).val + rw [E.subset_empty,mul_zero]) + have hF : F.Nonempty := ⟨∅,Finset.mem_filter.mpr ⟨Finset.mem_univ _,h0⟩⟩ + obtain ⟨s,hs,hmax⟩ := F.exists_max_image Finset.card hF + exact ⟨s,(Finset.mem_filter.mp hs).2,fun t ht => + hmax t (Finset.mem_filter.mpr ⟨Finset.mem_univ _,ht⟩)⟩ + +/-- A further piece in the remainder would enlarge the fitting subset. -/ +theorem maximal_remainder_not_subequivalent (E : EquivalentPartition p ι) + (q : AlgebraProjection M) (s : Finset ι) + (hmax : ∀ t : Finset ι, (E.subset t).Subequivalent q → t.card ≤ s.card) + (v : PartialIsometry M) (hv : v.support=E.subset s) (ht : v.target ≤ q) + (i : ι) (hi : i ∉ s) : + ¬(E.leg i).target.Subequivalent (AlgebraProjection.remainder v.target q ht) := by + classical + intro h + obtain ⟨w,hw,hwr⟩ := h + have ho₁ : v.support.val*w.support.val=0 := by + rw [hv,hw] + exact E.subset_mul_piece_of_not_mem s i hi + have ho₂ : v.target.val*w.target.val=0 := + projection_orthogonal_of_le (AlgebraProjection.remainder_orthogonal v.target q ht) + le_rfl hwr + let u := v.patch w ho₁ ho₂ + have hus : u.support=E.subset (insert i s) := Subtype.ext (by + change v.support.val+w.support.val=_ + rw [hv,hw,E.subset_insert s i hi]) + have hut : u.target ≤ q := by + have he : u.target=orthogonalSum v.target w.target ho₂ := + Subtype.ext (v.patch_target w ho₁ ho₂) + rw [he] + exact orthogonalSum_le ho₂ ht (hwr.trans (AlgebraProjection.remainder_le _ _ ht)) + have hc := hmax (insert i s) ⟨u,hus,hut⟩ + rw [Finset.card_insert_of_notMem hi] at hc + omega + +/-- Every projection inside the partition unit lies between subset sums whose +cardinalities differ by at most one. This is operator comparison, not a trace +estimate and not an assumed dimension rounding law. -/ +theorem exists_subset_rounding + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (E : EquivalentPartition p ι) (q : AlgebraProjection M) (hqp : q ≤ p) : + ∃ s t : Finset ι, s ⊆ t ∧ t.card ≤ s.card+1 ∧ + (E.subset s).Subequivalent q ∧ q.Subequivalent (E.subset t) ∧ + ∀ a : Finset ι, (E.subset a).Subequivalent q → a.card ≤ s.card := by + classical + obtain ⟨s,hs,hmax⟩ := E.exists_maximal_fitting_subset q + by_cases hsall : s=Finset.univ + · refine ⟨s,s,Finset.Subset.refl _,Nat.le_succ _,hs,?_,hmax⟩ + rw [hsall,E.subset_univ] + exact AlgebraProjection.subequivalent_of_le hqp + · obtain ⟨i,hi⟩ : ∃ i : ι, i ∉ s := by + by_contra h + apply hsall + ext i + simp only [Finset.mem_univ,iff_true] + exact Classical.not_not.mp (fun hi => h ⟨i,hi⟩) + obtain ⟨v,hv,ht⟩ := hs + let r := AlgebraProjection.remainder v.target q ht + have hr : r.Subequivalent (E.leg i).target := + (AlgebraProjection.subequivalent_total hfactor (E.leg i).target r).resolve_left + (E.maximal_remainder_not_subequivalent q s hmax v hv ht i hi) + have hv' : v.target.Equivalent (E.subset s) := ⟨v.adjoint,rfl,v.adjoint_target.trans hv⟩ + have ho := E.subset_mul_piece_of_not_mem s i hi + have hupper := AlgebraProjection.subequivalent_orthogonalSum + (AlgebraProjection.remainder_orthogonal v.target q ht) ho hv'.subequivalent hr + rw [AlgebraProjection.orthogonalSum_remainder] at hupper + have he : orthogonalSum (E.subset s) (E.leg i).target ho=E.subset (insert i s) := + Subtype.ext (E.subset_insert s i hi).symm + rw [he] at hupper + exact ⟨s,insert i s,Finset.subset_insert _ _,by rw [Finset.card_insert_of_notMem hi], + ⟨v,hv,ht⟩,hupper,hmax⟩ + +end EquivalentPartition + +/-! The dyadic lower cut on projections below p and its normalized faithful monotone supremum, capped at one. -/ + +def dyadicWeight (n : ℕ) (s : Finset (DyadicIndex n)) : ℝ := (s.card : ℝ)/2^n + +theorem dyadicWeight_nonneg (n : ℕ) (s : Finset (DyadicIndex n)) : 0 ≤ dyadicWeight n s := + div_nonneg (Nat.cast_nonneg _) (le_of_lt (pow_pos (by norm_num) _)) + +theorem dyadicWeight_le_one (n : ℕ) (s : Finset (DyadicIndex n)) : dyadicWeight n s ≤ 1 := by + apply (div_le_one (pow_pos (by norm_num : (0 : ℝ)<2) n)).mpr + have h : s.card ≤ 2^n := (Finset.card_le_univ s).trans_eq (card_dyadicIndex n) + exact_mod_cast h + +theorem dyadicWeight_univ (n : ℕ) : dyadicWeight n Finset.univ=1 := by + unfold dyadicWeight + rw [Finset.card_univ,card_dyadicIndex,Nat.cast_pow,Nat.cast_ofNat] + exact div_self (ne_of_gt (pow_pos (by norm_num : (0 : ℝ)<2) n)) + +theorem dyadicWeight_children (n : ℕ) (s : Finset (DyadicIndex n)) : + dyadicWeight (n+1) (s ×ˢ (Finset.univ : Finset Bool))=dyadicWeight n s := by + change ((s ×ˢ (Finset.univ : Finset Bool)).card : ℝ)/2^(n+1)=(s.card : ℝ)/2^n + rw [Finset.card_product,Finset.card_univ,Fintype.card_bool,Nat.cast_mul,Nat.cast_ofNat,pow_succ] + exact mul_div_mul_right _ _ (by norm_num : (2 : ℝ)≠0) + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + +/-- Membership contains an actual partial-isometry witness through Subequivalent. -/ +def traceFreeDyadicCut (p q : AlgebraProjection M) : Set ℝ := + {x | ∃ n, ∃ s : Finset (DyadicIndex n), + ((traceFreeDyadicPartition hfactor hdiff p n).subset s).Subequivalent q ∧ + x=dyadicWeight n s} + +def traceFreeDyadicSup (p q : AlgebraProjection M) : ℝ := + sSup (traceFreeDyadicCut hfactor hdiff p q) + +theorem traceFreeDyadicCut_zero_mem (p q : AlgebraProjection M) : + 0 ∈ traceFreeDyadicCut hfactor hdiff p q := by + refine ⟨0,∅,AlgebraProjection.subequivalent_of_le ?_,?_⟩ + · change q.val*((traceFreeDyadicPartition hfactor hdiff p 0).subset ∅).val=_ + rw [EquivalentPartition.subset_empty,mul_zero] + · simp only [dyadicWeight,Finset.card_empty,Nat.cast_zero,zero_div] + +theorem traceFreeDyadicCut_bddAbove (p q : AlgebraProjection M) : + BddAbove (traceFreeDyadicCut hfactor hdiff p q) := by + refine ⟨1,?_⟩ + rintro x ⟨n,s,_,rfl⟩ + exact dyadicWeight_le_one n s + +theorem traceFreeDyadicSup_nonneg (p q : AlgebraProjection M) : + 0 ≤ traceFreeDyadicSup hfactor hdiff p q := + le_csSup (traceFreeDyadicCut_bddAbove hfactor hdiff p q) + (traceFreeDyadicCut_zero_mem hfactor hdiff p q) + +theorem traceFreeDyadicSup_le_one (p q : AlgebraProjection M) : + traceFreeDyadicSup hfactor hdiff p q ≤ 1 := by + apply csSup_le ⟨0,traceFreeDyadicCut_zero_mem hfactor hdiff p q⟩ + rintro x ⟨n,s,_,rfl⟩ + exact dyadicWeight_le_one n s + +theorem traceFreeDyadicSup_lower_bound (p q : AlgebraProjection M) (n : ℕ) + (s : Finset (DyadicIndex n)) + (h : ((traceFreeDyadicPartition hfactor hdiff p n).subset s).Subequivalent q) : + dyadicWeight n s ≤ traceFreeDyadicSup hfactor hdiff p q := + le_csSup (traceFreeDyadicCut_bddAbove hfactor hdiff p q) ⟨n,s,h,rfl⟩ + +theorem traceFreeDyadicCut_mono (p : AlgebraProjection M) {q r : AlgebraProjection M} + (h : q.Subequivalent r) : + traceFreeDyadicCut hfactor hdiff p q ⊆ traceFreeDyadicCut hfactor hdiff p r := by + rintro x ⟨n,s,hs,hx⟩ + exact ⟨n,s,AlgebraProjection.subequivalent_trans hs h,hx⟩ + +theorem traceFreeDyadicSup_mono (p : AlgebraProjection M) {q r : AlgebraProjection M} + (h : q.Subequivalent r) : + traceFreeDyadicSup hfactor hdiff p q ≤ traceFreeDyadicSup hfactor hdiff p r := + csSup_le_csSup (traceFreeDyadicCut_bddAbove hfactor hdiff p r) + ⟨0,traceFreeDyadicCut_zero_mem hfactor hdiff p q⟩ + (traceFreeDyadicCut_mono hfactor hdiff p h) + +theorem traceFreeDyadicSup_equivalent (p : AlgebraProjection M) {q r : AlgebraProjection M} + (h : q.Equivalent r) : + traceFreeDyadicSup hfactor hdiff p q=traceFreeDyadicSup hfactor hdiff p r := + le_antisymm (traceFreeDyadicSup_mono hfactor hdiff p h.subequivalent) + (traceFreeDyadicSup_mono hfactor hdiff p (AlgebraProjection.equivalent_symm h).subequivalent) + +theorem traceFreeDyadicSup_self (p : AlgebraProjection M) : + traceFreeDyadicSup hfactor hdiff p p=1 := by + apply le_antisymm (traceFreeDyadicSup_le_one hfactor hdiff p p) + rw [← dyadicWeight_univ 0] + apply traceFreeDyadicSup_lower_bound hfactor hdiff p p 0 Finset.univ + rw [EquivalentPartition.subset_univ] + exact AlgebraProjection.subequivalent_refl p + +/-- Refining to all children preserves both the actual projection and weight. -/ +theorem traceFreeDyadicCut_refine (p q : AlgebraProjection M) (n : ℕ) + (s : Finset (DyadicIndex n)) + (h : ((traceFreeDyadicPartition hfactor hdiff p n).subset s).Subequivalent q) : + ((traceFreeDyadicPartition hfactor hdiff p (n+1)).subset + (s ×ˢ (Finset.univ : Finset Bool))).Subequivalent q ∧ + dyadicWeight (n+1) (s ×ˢ (Finset.univ : Finset Bool))=dyadicWeight n s := by + refine ⟨?_,dyadicWeight_children n s⟩ + change (((traceFreeDyadicPartition hfactor hdiff p n).refine _).subset _).Subequivalent q + rw [EquivalentPartition.subset_refine] + exact h + +theorem traceFreeDyadicSup_zero (p q : AlgebraProjection M) (hp : p.val≠0) (hq : q.val=0) : + traceFreeDyadicSup hfactor hdiff p q=0 := by + apply le_antisymm ?_ (traceFreeDyadicSup_nonneg hfactor hdiff p q) + apply csSup_le ⟨0,traceFreeDyadicCut_zero_mem hfactor hdiff p q⟩ + rintro x ⟨n,s,⟨v,hv,ht⟩,rfl⟩ + have htz : v.target.val=0 := by + change q.val*v.target.val=v.target.val at ht + rw [hq,zero_mul] at ht + exact ht.symm + have hvz : v.val=0 := by + have h := v.target_mul + rw [htz,zero_mul] at h + exact h.symm + have hsz : ((traceFreeDyadicPartition hfactor hdiff p n).subset s).val=0 := by + rw [← hv,← v.initial,hvz,star_zero,zero_mul] + have hs : s ⊆ ∅ := + ((traceFreeDyadicPartition hfactor hdiff p n).subset_le_subset_iff hp s ∅).mp (by + change ((traceFreeDyadicPartition hfactor hdiff p n).subset ∅).val* + ((traceFreeDyadicPartition hfactor hdiff p n).subset s).val=_ + rw [hsz,mul_zero]) + have he : s=∅ := Finset.eq_empty_iff_forall_notMem.mpr (fun i hi => Finset.notMem_empty i (hs hi)) + simp only [he,dyadicWeight,Finset.card_empty,Nat.cast_zero,zero_div,le_refl] + +/-- Archimedean comparison makes the supremum strictly positive on nonzero projections. -/ +theorem traceFreeDyadicSup_pos + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (p q : AlgebraProjection M) (hq : q.val≠0) : + 0 < traceFreeDyadicSup hfactor hdiff p q := by + obtain ⟨n,hn⟩ := traceFree_eventually_dyadic_subequivalent hfactor hdiff hfinite p q hq + have h := hn n le_rfl + have he : ((traceFreeDyadicPartition hfactor hdiff p n).subset {dyadicFalseIndex n}).Subequivalent q := by + rw [EquivalentPartition.subset_singleton] + exact h + apply lt_of_lt_of_le ?_ (traceFreeDyadicSup_lower_bound hfactor hdiff p q n _ he) + simp only [dyadicWeight,Finset.card_singleton,Nat.cast_one] + exact div_pos zero_lt_one (pow_pos (by norm_num) _) + +theorem traceFreeDyadicSup_eq_zero_iff + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (p q : AlgebraProjection M) (hp : p.val≠0) : + traceFreeDyadicSup hfactor hdiff p q=0 ↔ q.val=0 := by + constructor + · intro h + by_contra hq + have hh := traceFreeDyadicSup_pos hfactor hdiff hfinite p q hq + rw [h] at hh + exact lt_irrefl _ hh + · exact traceFreeDyadicSup_zero hfactor hdiff p q hp + +end + +/-! Common refinements compare arbitrary dyadic levels. The supremum takes +the exact dyadic value on every reference subset projection, and finite +rounding bounds every projection with an explicit error at each level. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem dyadicWeight_le_iff (n : ℕ) (s t : Finset (DyadicIndex n)) : + dyadicWeight n s ≤ dyadicWeight n t ↔ s.card ≤ t.card := by + unfold dyadicWeight + rw [div_le_div_iff_of_pos_right (pow_pos (by norm_num : (0 : ℝ)<2) n)] + exact Nat.cast_le + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + +theorem traceFreeDyadic_exists_refined_subset (p : AlgebraProjection M) (n m : ℕ) + (hnm : n ≤ m) (s : Finset (DyadicIndex n)) : + ∃ t : Finset (DyadicIndex m), + (traceFreeDyadicPartition hfactor hdiff p m).subset t= + (traceFreeDyadicPartition hfactor hdiff p n).subset s ∧ + dyadicWeight m t=dyadicWeight n s := by + induction m, hnm using Nat.le_induction with + | base => exact ⟨s,rfl,rfl⟩ + | succ m _ ih => + obtain ⟨t,ht,hw⟩ := ih + refine ⟨t ×ˢ (Finset.univ : Finset Bool),?_,(dyadicWeight_children m t).trans hw⟩ + change ((traceFreeDyadicPartition hfactor hdiff p m).refine _).subset _=_ + rw [EquivalentPartition.subset_refine,ht] + +/-- Comparison between any two levels agrees with the real dyadic weights. -/ +theorem traceFreeDyadic_comparison_iff_weight + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (p : AlgebraProjection M) (hp : p.val≠0) (n m : ℕ) + (s : Finset (DyadicIndex n)) (t : Finset (DyadicIndex m)) : + ((traceFreeDyadicPartition hfactor hdiff p n).subset s).Subequivalent + ((traceFreeDyadicPartition hfactor hdiff p m).subset t) ↔ + dyadicWeight n s ≤ dyadicWeight m t := by + obtain ⟨s',hs',hws⟩ := traceFreeDyadic_exists_refined_subset hfactor hdiff p n (max n m) + (le_max_left _ _) s + obtain ⟨t',ht',hwt⟩ := traceFreeDyadic_exists_refined_subset hfactor hdiff p m (max n m) + (le_max_right _ _) t + rw [← hs',← ht',← hws,← hwt] + rw [EquivalentPartition.subset_subequivalent_iff_card_le hfinite _ hp,dyadicWeight_le_iff] + +theorem traceFreeDyadicSup_subset + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (p : AlgebraProjection M) (hp : p.val≠0) (n : ℕ) (s : Finset (DyadicIndex n)) : + traceFreeDyadicSup hfactor hdiff p ((traceFreeDyadicPartition hfactor hdiff p n).subset s)= + dyadicWeight n s := by + apply le_antisymm ?_ (traceFreeDyadicSup_lower_bound hfactor hdiff p _ n s + (AlgebraProjection.subequivalent_refl _)) + apply csSup_le ⟨0,traceFreeDyadicCut_zero_mem hfactor hdiff p _⟩ + rintro x ⟨m,t,h,rfl⟩ + exact (traceFreeDyadic_comparison_iff_weight hfactor hdiff hfinite p hp m n t s).mp h + +/-- At every level the cut supremum has actual lower and upper operator +witnesses, with a numerical gap at most 2^(-n). -/ +theorem traceFreeDyadicSup_rounding + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (p q : AlgebraProjection M) (hp : p.val≠0) (hq : q ≤ p) (n : ℕ) : + ∃ s t : Finset (DyadicIndex n), s ⊆ t ∧ t.card ≤ s.card+1 ∧ + ((traceFreeDyadicPartition hfactor hdiff p n).subset s).Subequivalent q ∧ + q.Subequivalent ((traceFreeDyadicPartition hfactor hdiff p n).subset t) ∧ + dyadicWeight n s ≤ traceFreeDyadicSup hfactor hdiff p q ∧ + traceFreeDyadicSup hfactor hdiff p q ≤ dyadicWeight n t ∧ + dyadicWeight n t ≤ dyadicWeight n s+1/2^n := by + obtain ⟨s,t,hst,hcard,hs,ht,_⟩ := + (traceFreeDyadicPartition hfactor hdiff p n).exists_subset_rounding hfactor q hq + refine ⟨s,t,hst,hcard,hs,ht,traceFreeDyadicSup_lower_bound hfactor hdiff p q n s hs,?_,?_⟩ + · have h := traceFreeDyadicSup_mono hfactor hdiff p ht + rwa [traceFreeDyadicSup_subset hfactor hdiff hfinite p hp] at h + · change (t.card : ℝ)/2^n ≤ (s.card : ℝ)/2^n+1/2^n + rw [← add_div] + apply (div_le_div_iff_of_pos_right (pow_pos (by norm_num : (0 : ℝ)<2) n)).mpr + exact_mod_cast hcard + +end + +/-! Orthogonal lower approximants fit disjoint collections of the reference +pieces. Equivalent complements and finite cancellation enforce the capacity. -/ +section +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace EquivalentPartition +variable {p : AlgebraProjection M} {ι : Type*} [Fintype ι] + +theorem subset_complement [DecidableEq ι] (E : EquivalentPartition p ι) (s : Finset ι) : + E.subset (Finset.univ \ s)=AlgebraProjection.remainder (E.subset s) p (E.subset_le s) := by + classical + apply Subtype.ext + change (∑ i ∈ Finset.univ \ s, (E.leg i).target.val)=p.val-(E.subset s).val + rw [Finset.sum_sdiff_eq_sub (Finset.subset_univ s),E.total] + rfl + +theorem exists_disjoint_card (s t : Finset ι) (h : s.card+t.card ≤ Fintype.card ι) : + ∃ u : Finset ι, Disjoint s u ∧ u.card=t.card := by + classical + have hc : t.card ≤ (Finset.univ \ s).card := by + rw [Finset.card_sdiff_of_subset (Finset.subset_univ s),Finset.card_univ] + omega + obtain ⟨u,hu,huc⟩ := Finset.exists_subset_card_eq hc + refine ⟨u,Finset.disjoint_left.mpr ?_,huc⟩ + intro i hi hui + exact (Finset.mem_sdiff.mp (hu hui)).2 hi + +/-- Two orthogonal fitting projections cannot use more pieces than the unit. -/ +theorem orthogonal_fitting_card_bound + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (E : EquivalentPartition p ι) (hp : p.val≠0) + (q r : AlgebraProjection M) (hqp : q ≤ p) (hrp : r ≤ p) (ho : q.val*r.val=0) + (s t : Finset ι) (hs : (E.subset s).Subequivalent q) (ht : (E.subset t).Subequivalent r) : + s.card+t.card ≤ Fintype.card ι := by + classical + obtain ⟨v,hv,hvr⟩ := ht + have hvp := hvr.trans hrp + have hqv : q.val*v.target.val=0 := projection_orthogonal_of_le ho le_rfl hvr + have hqr : q ≤ AlgebraProjection.remainder v.target p hvp := by + change (p.val-v.target.val)*q.val=q.val + rw [sub_mul,hqp,PartialIsometry.orthogonal_reverse _ _ hqv,sub_zero] + have he : v.target.Equivalent (E.subset t) := ⟨v.adjoint,rfl,v.adjoint_target.trans hv⟩ + have hc := AlgebraProjection.remainder_equivalent hfinite hfactor hvp (E.subset_le t) + he (AlgebraProjection.equivalent_refl p) + rw [← E.subset_complement t] at hc + have hh : (E.subset s).Subequivalent (E.subset (Finset.univ \ t)) := + AlgebraProjection.subequivalent_trans hs (AlgebraProjection.subequivalent_trans + (AlgebraProjection.subequivalent_of_le hqr) hc.subequivalent) + have hn := (E.subset_subequivalent_iff_card_le hfinite hp s _).mp hh + have hcard := Finset.card_sdiff_add_card_eq_card (Finset.subset_univ t) + rw [Finset.card_univ] at hcard + omega + +/-- Disjoint replacement of one collection lets the actual witnesses be added. -/ +theorem orthogonal_fitting_union + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (E : EquivalentPartition p ι) (hp : p.val≠0) + (q r : AlgebraProjection M) (hqp : q ≤ p) (hrp : r ≤ p) (ho : q.val*r.val=0) + (s t : Finset ι) (hs : (E.subset s).Subequivalent q) (ht : (E.subset t).Subequivalent r) : + ∃ u : Finset ι, u.card=s.card+t.card ∧ + (E.subset u).Subequivalent (orthogonalSum q r ho) := by + classical + obtain ⟨t',hst,hct⟩ := exists_disjoint_card s t + (E.orthogonal_fitting_card_bound hfinite hfactor hp q r hqp hrp ho s t hs ht) + have ht' : (E.subset t').Subequivalent r := AlgebraProjection.subequivalent_trans + (E.subset_equivalent_of_card_eq t' t hct).subequivalent ht + refine ⟨s ∪ t',by rw [Finset.card_union_of_disjoint hst,hct],?_⟩ + rw [E.subset_union s t' hst] + exact AlgebraProjection.subequivalent_orthogonalSum + (E.subset_orthogonal_of_disjoint s t' hst) ho hs ht' + +theorem orthogonal_upper_union + (E : EquivalentPartition p ι) (q r : AlgebraProjection M) (ho : q.val*r.val=0) + (s t : Finset ι) (hs : q.Subequivalent (E.subset s)) (ht : r.Subequivalent (E.subset t)) + (hcard : s.card+t.card ≤ Fintype.card ι) : + ∃ u : Finset ι, u.card=s.card+t.card ∧ + (orthogonalSum q r ho).Subequivalent (E.subset u) := by + classical + obtain ⟨t',hst,hct⟩ := exists_disjoint_card s t hcard + have ht' : r.Subequivalent (E.subset t') := AlgebraProjection.subequivalent_trans ht + (E.subset_equivalent_of_card_eq t t' hct.symm).subequivalent + refine ⟨s ∪ t',by rw [Finset.card_union_of_disjoint hst,hct],?_⟩ + rw [E.subset_union s t' hst] + exact AlgebraProjection.subequivalent_orthogonalSum ho + (E.subset_orthogonal_of_disjoint s t' hst) hs ht' + +end EquivalentPartition +end + +/-! Orthogonal additivity of the constructed dyadic dimension. Numerical +rounding errors tend to zero; every lower and upper bound uses actual +partial-isometry witnesses in the original finite diffuse factor. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem eq_of_all_dyadic_errors (a b : ℝ) (h : ∀ n : ℕ, |a-b| ≤ 2/2^n) : a=b := by + by_contra hab + have hp : 0 < |a-b|/2 := div_pos (abs_pos.mpr (sub_ne_zero.mpr hab)) (by norm_num) + obtain ⟨n,hn⟩ := exists_pow_lt_of_lt_one hp (by norm_num : (1/2 : ℝ)<1) + rw [one_div_pow] at hn + have hh := h n + rw [show (2 : ℝ)/2^n=2*(1/2^n) by ring] at hh + linarith + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +theorem traceFreeDyadicSup_lower_add + (p q r : AlgebraProjection M) (hp : p.val≠0) (hqp : q ≤ p) (hrp : r ≤ p) + (ho : q.val*r.val=0) (n : ℕ) (s t : Finset (DyadicIndex n)) + (hs : ((traceFreeDyadicPartition hfactor hdiff p n).subset s).Subequivalent q) + (ht : ((traceFreeDyadicPartition hfactor hdiff p n).subset t).Subequivalent r) : + dyadicWeight n s+dyadicWeight n t ≤ + traceFreeDyadicSup hfactor hdiff p (orthogonalSum q r ho) := by + obtain ⟨u,huc,hu⟩ := (traceFreeDyadicPartition hfactor hdiff p n).orthogonal_fitting_union + hfinite hfactor hp q r hqp hrp ho s t hs ht + have h := traceFreeDyadicSup_lower_bound hfactor hdiff p _ n u hu + simpa only [dyadicWeight,huc,Nat.cast_add,add_div] using h + +include hfinite in +theorem traceFreeDyadicSup_upper_add + (p q r : AlgebraProjection M) (hp : p.val≠0) (ho : q.val*r.val=0) + (n : ℕ) (s t : Finset (DyadicIndex n)) + (hs : q.Subequivalent ((traceFreeDyadicPartition hfactor hdiff p n).subset s)) + (ht : r.Subequivalent ((traceFreeDyadicPartition hfactor hdiff p n).subset t)) : + traceFreeDyadicSup hfactor hdiff p (orthogonalSum q r ho) ≤ + dyadicWeight n s+dyadicWeight n t := by + by_cases hc : s.card+t.card ≤ Fintype.card (DyadicIndex n) + · obtain ⟨u,huc,hu⟩ := (traceFreeDyadicPartition hfactor hdiff p n).orthogonal_upper_union + q r ho s t hs ht hc + have h := traceFreeDyadicSup_mono hfactor hdiff p hu + rw [traceFreeDyadicSup_subset hfactor hdiff hfinite p hp] at h + simpa only [dyadicWeight,huc,Nat.cast_add,add_div] using h + · apply le_trans (traceFreeDyadicSup_le_one hfactor hdiff p _) + have hn : 2^n ≤ s.card+t.card := by rw [card_dyadicIndex] at hc; omega + change 1 ≤ (s.card : ℝ)/2^n+(t.card : ℝ)/2^n + rw [← add_div] + apply (le_div_iff₀ (pow_pos (by norm_num : (0 : ℝ)<2) n)).mpr + simp only [one_mul] + exact_mod_cast hn + +include hfinite in +/-- The dyadic supremum is additive on actual orthogonal projections below p. -/ +theorem traceFreeDyadicSup_orthogonal_add + (p q r : AlgebraProjection M) (hp : p.val≠0) (hqp : q ≤ p) (hrp : r ≤ p) + (ho : q.val*r.val=0) : + traceFreeDyadicSup hfactor hdiff p (orthogonalSum q r ho)= + traceFreeDyadicSup hfactor hdiff p q+traceFreeDyadicSup hfactor hdiff p r := by + apply eq_of_all_dyadic_errors + intro n + obtain ⟨s,t,_,_,hs,ht,hql,hqu,hqe⟩ := + traceFreeDyadicSup_rounding hfactor hdiff hfinite p q hp hqp n + obtain ⟨a,b,_,_,ha,hb,hrl,hru,hre⟩ := + traceFreeDyadicSup_rounding hfactor hdiff hfinite p r hp hrp n + have hlo := traceFreeDyadicSup_lower_add hfactor hdiff hfinite p q r hp hqp hrp ho n s a hs ha + have hhi := traceFreeDyadicSup_upper_add hfactor hdiff hfinite p q r hp ho n t b ht hb + rw [show (2 : ℝ)/2^n=2*(1/2^n) by ring] + apply abs_le.mpr + constructor <;> linarith + +include hfinite in +theorem traceFreeDyadicSup_remainder + (p q : AlgebraProjection M) (hp : p.val≠0) (hq : q ≤ p) : + traceFreeDyadicSup hfactor hdiff p (AlgebraProjection.remainder q p hq)= + 1-traceFreeDyadicSup hfactor hdiff p q := by + have h := traceFreeDyadicSup_orthogonal_add hfactor hdiff hfinite p q + (AlgebraProjection.remainder q p hq) hp hq (AlgebraProjection.remainder_le q p hq) + (AlgebraProjection.remainder_orthogonal q p hq) + rw [AlgebraProjection.orthogonalSum_remainder,traceFreeDyadicSup_self] at h + linarith + +include hfinite in +/-- Faithfulness and additivity give strict increase along proper inclusion. -/ +theorem traceFreeDyadicSup_strictMono + (p q r : AlgebraProjection M) (hp : p.val≠0) (hrp : r ≤ p) (hqr : q < r) : + traceFreeDyadicSup hfactor hdiff p q < traceFreeDyadicSup hfactor hdiff p r := by + have hle : q ≤ r := le_of_lt hqr + let s := AlgebraProjection.remainder q r hle + have hs : s.val≠0 := by + change r.val-q.val≠0 + intro h + exact (ne_of_lt hqr) (Subtype.ext (sub_eq_zero.mp h).symm) + have hpos := traceFreeDyadicSup_pos hfactor hdiff hfinite p s hs + have he := traceFreeDyadicSup_orthogonal_add hfactor hdiff hfinite p q s hp + (hle.trans hrp) ((AlgebraProjection.remainder_le q r hle).trans hrp) + (AlgebraProjection.remainder_orthogonal q r hle) + rw [AlgebraProjection.orthogonalSum_remainder] at he + linarith + +end Tracial + +/-! Classification of projection comparison by the constructed finite +dimension, and a wrapper for exactly the original IsII1Factor predicate. +No normality or trace-extension claim is made here. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +namespace Tracial +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +theorem traceFree_target_eq_of_dimension_le + (p q : AlgebraProjection M) (hp : p.val≠0) (hqp : q ≤ p) + (v : PartialIsometry M) (ht : v.target ≤ q) + (hd : traceFreeDyadicSup hfactor hdiff p q ≤ traceFreeDyadicSup hfactor hdiff p v.support) : + v.target=q := by + by_contra he + have hlt := traceFreeDyadicSup_strictMono hfactor hdiff hfinite p v.target q hp hqp + (lt_of_le_of_ne ht he) + have heq := traceFreeDyadicSup_equivalent hfactor hdiff p + (show v.support.Equivalent v.target from ⟨v,rfl,rfl⟩) + linarith + +include hfinite in +/-- Real-valued comparison is exactly witnessed projection subequivalence. -/ +theorem traceFreeDyadicSup_le_iff_subequivalent + (p q r : AlgebraProjection M) (hp : p.val≠0) (hqp : q ≤ p) : + traceFreeDyadicSup hfactor hdiff p q ≤ traceFreeDyadicSup hfactor hdiff p r ↔ + q.Subequivalent r := by + refine ⟨fun hd => ?_,traceFreeDyadicSup_mono hfactor hdiff p⟩ + rcases AlgebraProjection.subequivalent_total hfactor q r with h | h + · exact h + · obtain ⟨v,hv,ht⟩ := h + have he : v.target=q := traceFree_target_eq_of_dimension_le hfactor hdiff hfinite + p q hp hqp v ht (by rw [hv]; exact hd) + exact ⟨v.adjoint,he,le_of_eq (v.adjoint_target.trans hv)⟩ + +include hfinite in +theorem traceFreeDyadicSup_eq_iff_equivalent + (p q r : AlgebraProjection M) (hp : p.val≠0) (hqp : q ≤ p) (hrp : r ≤ p) : + traceFreeDyadicSup hfactor hdiff p q=traceFreeDyadicSup hfactor hdiff p r ↔ + q.Equivalent r := by + constructor + · intro h + exact AlgebraProjection.equivalent_of_mutual_subequivalent hfinite + ((traceFreeDyadicSup_le_iff_subequivalent hfactor hdiff hfinite p q r hp hqp).mp (le_of_eq h)) + ((traceFreeDyadicSup_le_iff_subequivalent hfactor hdiff hfinite p r q hp hrp).mp (le_of_eq h.symm)) + · exact traceFreeDyadicSup_equivalent hfactor hdiff p + +/-- The same constructed lower cut, now normalized at the algebra identity. -/ +def traceFreeDimension (q : AlgebraProjection M) : ℝ := + traceFreeDyadicSup hfactor hdiff ⟨1,IsStarProjection.one _⟩ q + +end Tracial + +/-- The original nonzero finite diffuse factor has a normalized faithful +finitely additive dimension on its actual projections. The comparison +equivalences use actual partial isometries, not a supplied dimension oracle. -/ +theorem isII1Factor_projection_dimension + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) : + ∃ D : Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed) → ℝ, + D ⟨1,IsStarProjection.one _⟩=1 ∧ + (∀ q, 0 ≤ D q ∧ D q ≤ 1) ∧ + (∀ q, D q=0 ↔ q.val=0) ∧ + (∀ q r, D q ≤ D r ↔ q.Subequivalent r) ∧ + (∀ q r, D q=D r ↔ q.Equivalent r) ∧ + (∀ q r (ho : q.val*r.val=0), D (Tracial.orthogonalSum q r ho)=D q+D r) := by + let M := vonNeumannOfWOTClosed S hS.weaklyClosed + have hf : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + let p : Tracial.AlgebraProjection M := ⟨1,IsStarProjection.one _⟩ + have hp : p.val≠0 := by + intro h + exact hS.nonzero (congrArg Subtype.val h).symm + have hle (q : Tracial.AlgebraProjection M) : q ≤ p := by + change 1*q.val=q.val + exact one_mul _ + refine ⟨Tracial.traceFreeDimension hf hS.diffuse,?_,?_,?_,?_,?_,?_⟩ + · exact Tracial.traceFreeDyadicSup_self hf hS.diffuse p + · intro q + exact ⟨Tracial.traceFreeDyadicSup_nonneg hf hS.diffuse p q, + Tracial.traceFreeDyadicSup_le_one hf hS.diffuse p q⟩ + · intro q + exact Tracial.traceFreeDyadicSup_eq_zero_iff hf hS.diffuse hS.finite p q hp + · intro q r + exact Tracial.traceFreeDyadicSup_le_iff_subequivalent hf hS.diffuse hS.finite p q r hp (hle q) + · intro q r + exact Tracial.traceFreeDyadicSup_eq_iff_equivalent hf hS.diffuse hS.finite p q r hp (hle q) (hle r) + · intro q r ho + exact Tracial.traceFreeDyadicSup_orthogonal_add hf hS.diffuse hS.finite p q r hp (hle q) (hle r) ho + +end + +/-! Bounds and concrete dyadic upper approximants for the constructed +projection dimension. These finite estimates do not assume continuity. -/ +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem traceFreeDimension_nonneg (q : AlgebraProjection M) : + 0 ≤ traceFreeDimension hfactor hdiff q := + traceFreeDyadicSup_nonneg hfactor hdiff _ q + +theorem traceFreeDimension_le_one (q : AlgebraProjection M) : + traceFreeDimension hfactor hdiff q ≤ 1 := + traceFreeDyadicSup_le_one hfactor hdiff _ q + +theorem traceFreeDimension_subequivalent {q r : AlgebraProjection M} + (h : q.Subequivalent r) : + traceFreeDimension hfactor hdiff q ≤ traceFreeDimension hfactor hdiff r := + traceFreeDyadicSup_mono hfactor hdiff _ h + +theorem traceFreeDimension_mono : Monotone (traceFreeDimension hfactor hdiff) := + fun _ _ h => traceFreeDimension_subequivalent hfactor hdiff + (AlgebraProjection.subequivalent_of_le h) + +include hfinite in +theorem traceFreeDimension_le_iff_subequivalent + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (q r : AlgebraProjection M) : + traceFreeDimension hfactor hdiff q ≤ traceFreeDimension hfactor hdiff r ↔ + q.Subequivalent r := + traceFreeDyadicSup_le_iff_subequivalent hfactor hdiff hfinite _ q r hunit (one_mul _) + +include hfinite in +theorem traceFreeDimension_strictMono (hunit : (1 : M.toStarSubalgebra) ≠ 0) : + StrictMono (traceFreeDimension hfactor hdiff) := + fun _ _ h => traceFreeDyadicSup_strictMono hfactor hdiff hfinite _ _ _ hunit (one_mul _) h + +/-- A subset of the n-th reference partition with weight in [c,c+2^(-n)]. -/ +theorem exists_dyadicWeight_upper (c : ℝ) (hc : 0 ≤ c) (hc1 : c ≤ 1) (n : ℕ) : + ∃ s : Finset (DyadicIndex n), c ≤ dyadicWeight n s ∧ dyadicWeight n s ≤ c+1/2^n := by + classical + have hn : (0 : ℝ)<2^n := pow_pos (by norm_num) n + have hk : Nat.ceil (c*2^n) ≤ Fintype.card (DyadicIndex n) := by + rw [card_dyadicIndex,Nat.ceil_le] + push_cast + nlinarith + obtain ⟨s,_,hs⟩ := Finset.exists_subset_card_eq + (s := (Finset.univ : Finset (DyadicIndex n))) (n := Nat.ceil (c*2^n)) + (by simpa only [Finset.card_univ] using hk) + refine ⟨s,?_,?_⟩ + · change c ≤ (s.card : ℝ)/2^n + rw [hs,le_div_iff₀ hn] + exact Nat.le_ceil _ + · change (s.card : ℝ)/2^n ≤ c+1/2^n + rw [hs,div_le_iff₀ hn] + have h := (Nat.ceil_lt_add_one (mul_nonneg hc hn.le)).le + calc (Nat.ceil (c*2^n) : ℝ) ≤ c*2^n+1 := h + _ = (c+1/2^n)*2^n := by field_simp + +include hfinite in +/-- Actual projection upper approximants for every real c in [0,1]. -/ +theorem traceFreeDimension_exists_upper + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (c : ℝ) (hc : 0 ≤ c) (hc1 : c ≤ 1) (n : ℕ) : + ∃ r : AlgebraProjection M, c ≤ traceFreeDimension hfactor hdiff r ∧ + traceFreeDimension hfactor hdiff r ≤ c+1/2^n := by + obtain ⟨s,hs,ht⟩ := exists_dyadicWeight_upper c hc hc1 n + refine ⟨(traceFreeDyadicPartition hfactor hdiff ⟨1,IsStarProjection.one _⟩ n).subset s,?_,?_⟩ + · simpa only [traceFreeDimension,traceFreeDyadicSup_subset hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ hunit] using hs + · simpa only [traceFreeDimension,traceFreeDyadicSup_subset hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ hunit] using ht + +theorem le_of_all_dyadic_errors (a b : ℝ) (h : ∀ n : ℕ, a ≤ b+1/2^n) : a ≤ b := by + by_contra hab + have hp : 0 < a-b := sub_pos.mpr (lt_of_not_ge hab) + obtain ⟨n,hn⟩ := exists_pow_lt_of_lt_one hp (by norm_num : (1/2 : ℝ)<1) + rw [one_div_pow] at hn + have hh := h n + linarith + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/DyadicComparison.lean b/lean/OAI/Analysis/FactorGeneration/DyadicComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..b3844a385ac625aed64bf526b0be9c24b0a476cb --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/DyadicComparison.lean @@ -0,0 +1,1020 @@ +import Mathlib.Data.Fintype.EquivFin +import OAI.Analysis.FactorGeneration.FiniteComparison +import OAI.Analysis.FactorGeneration.MatrixUnits + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Halving every projection in a diffuse factor without a trace. +Maximality leaves no residual corner: a diffuse residual splits into two +nonzero orthogonal projections, and a polar link gives a strict extension. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +namespace Tracial +variable {M : VonNeumannAlgebra H} + +/-- The sum of two orthogonal projections, in the original algebra. -/ +def orthogonalSum (p q : AlgebraProjection M) (h : p.val*q.val=0) : AlgebraProjection M := + ⟨p.val+q.val,p.property.add q.property h⟩ + +theorem le_orthogonalSum_left (p q : AlgebraProjection M) (h : p.val*q.val=0) : + p ≤ orthogonalSum p q h := by + change (p.val+q.val)*p.val=p.val + rw [add_mul,p.property.isIdempotentElem.eq,PartialIsometry.orthogonal_reverse _ _ h,add_zero] + +theorem le_orthogonalSum_right (p q : AlgebraProjection M) (h : p.val*q.val=0) : + q ≤ orthogonalSum p q h := by + change (p.val+q.val)*q.val=q.val + rw [add_mul,h,q.property.isIdempotentElem.eq,zero_add] + +theorem orthogonalSum_le {p q r : AlgebraProjection M} (h : p.val*q.val=0) + (hp : p ≤ r) (hq : q ≤ r) : orthogonalSum p q h ≤ r := by + change r.val*(p.val+q.val)=p.val+q.val + rw [mul_add,hp,hq] + +/-- A proper diffuse subprojection splits a nonzero corner into orthogonal pieces. -/ +theorem traceFree_exists_orthogonal_split + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (p : AlgebraProjection M) (hp : p.val≠0) : + ∃ q r : AlgebraProjection M, q ≤ p ∧ r ≤ p ∧ q.val≠0 ∧ r.val≠0 ∧ + q.val*r.val=0 ∧ q.val+r.val=p.val := by + obtain ⟨q,hq,hq0,hqp,hpq,hqp'⟩ := hdiff p.val p.property hp + let r : AlgebraProjection M := ⟨p.val-q,hq.sub_of_mul_eq_right p.property hpq⟩ + refine ⟨⟨q,hq⟩,r,hpq,?_,hq0,sub_ne_zero.mpr hqp.symm,?_,?_⟩ + · change p.val*(p.val-q)=p.val-q + rw [mul_sub,p.property.isIdempotentElem.eq,hpq] + · change q*(p.val-q)=0 + rw [mul_sub,hqp',hq.isIdempotentElem.eq,sub_self] + · change q+(p.val-q)=p.val + abel + +/-- The two equivalent halves are constructed by an actual partial isometry. +No trace, finite-isometry property, or separability is needed for this lemma. -/ +theorem traceFree_exists_halving + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (p : AlgebraProjection M) : + ∃ v : PartialIsometry M, v.support.val*v.target.val=0 ∧ + v.support.val+v.target.val=p.val := by + obtain ⟨v,hvp,hvq,hvo,hmax⟩ := PartialIsometry.traceFree_exists_maximal_orthogonal p + let t := orthogonalSum v.support v.target hvo + have htp : t ≤ p := orthogonalSum_le hvo hvp hvq + let r : AlgebraProjection M := ⟨p.val-t.val,t.property.sub_of_mul_eq_right p.property htp⟩ + have hrp : r ≤ p := by + change p.val*(p.val-t.val)=p.val-t.val + rw [mul_sub,p.property.isIdempotentElem.eq,htp] + have htr : t.val*r.val=0 := by + change t.val*(p.val-t.val)=0 + rw [mul_sub,projection_mul_of_le htp,t.property.isIdempotentElem.eq,sub_self] + have hr0 : r.val=0 := by + by_contra hr + obtain ⟨q,s,hqr,hsr,hq0,hs0,hqs,_⟩ := traceFree_exists_orthogonal_split hdiff r hr + obtain ⟨w,hwq,hws,hw0⟩ := + traceFree_exists_nonzero_partialIsometry_between_projections hfactor q s hq0 hs0 + have hwr : w.support ≤ r := hwq.trans hqr + have hwtr : w.target ≤ r := hws.trans hsr + have hvt : v.support ≤ t := le_orthogonalSum_left _ _ hvo + have hvtt : v.target ≤ t := le_orthogonalSum_right _ _ hvo + have hpw := projection_orthogonal_of_le htr hvt hwr + have hqw := projection_orthogonal_of_le htr hvtt hwtr + have hcross := projection_orthogonal_of_le htr hvt hwtr + have hcross' := PartialIsometry.orthogonal_reverse _ _ + (projection_orthogonal_of_le htr hvtt hwr) + have hwo := projection_orthogonal_of_le hqs hwq hws + let u := v.patch w hpw hqw + have hup : u.support ≤ p := orthogonalSum_le hpw hvp (hwr.trans hrp) + have huq : u.target ≤ p := by + change p.val*u.target.val=u.target.val + rw [PartialIsometry.patch_target] + rw [mul_add,hvq,show p.val*w.target.val=w.target.val from hwtr.trans hrp] + have huo : u.support.val*u.target.val=0 := by + rw [PartialIsometry.patch_target] + change (v.support.val+w.support.val)*(v.target.val+w.target.val)=0 + rw [add_mul,mul_add,mul_add,hvo,hcross,hcross',hwo,add_zero,zero_add] + have hvu : v ≤ u := v.le_patch w hpw hqw + exact (v.patch_ne w hpw hqw hw0) (le_antisymm (hmax u hup huq huo hvu) hvu) + exact ⟨v,hvo,(sub_eq_zero.mp hr0).symm⟩ + +end Tracial + +/-- Halving in exactly the original concrete factor; the bicommutant packaging +does not change its operators, projection predicates, or algebra operations. -/ +theorem isII1Factor_halving + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) + (p : Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed)) : + ∃ v : Tracial.PartialIsometry (vonNeumannOfWOTClosed S hS.weaklyClosed), + v.support.val*v.target.val=0 ∧ v.support.val+v.target.val=p.val := by + apply Tracial.traceFree_exists_halving _ hS.diffuse p + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + +end + +/-! Finite partitions with explicit equivalence witnesses and compatible binary +refinement. The common initial projection is halved once and its two pieces +are transported to every old piece, so all new pieces remain equivalent. -/ +section +open scoped BigOperators +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +/-- Composition with range contained in the initial projection. -/ +def compose (v w : PartialIsometry M) (h : w.target ≤ v.support) : PartialIsometry M where + support := w.support + val := v.val*w.val + initial := by + calc star (v.val*w.val)*(v.val*w.val) = star w.val*(star v.val*v.val)*w.val := by + simp only [star_mul,mul_assoc] + _ = star w.val*w.val := by + rw [v.initial,mul_assoc,(w.target_le_iff_mul v.support).mp h] + _ = w.support.val := w.initial + +theorem compose_target (v w : PartialIsometry M) (h : w.target ≤ v.support) : + (compose v w h).target.val=v.val*w.target.val*star v.val := by + change (v.val*w.val)*star (v.val*w.val)=v.val*(w.val*star w.val)*star v.val + simp only [star_mul,mul_assoc] + +theorem compose_target_le (v w : PartialIsometry M) (h : w.target ≤ v.support) : + (compose v w h).target ≤ v.target := by + apply ((compose v w h).target_le_iff_mul v.target).mpr + change v.target.val*(v.val*w.val)=v.val*w.val + rw [← mul_assoc,v.target_mul] + +end PartialIsometry + +/-- A partition of p with actual partial isometries from a common projection. +The cross identities encode orthogonality. This structure is constructed below. -/ +structure EquivalentPartition (p : AlgebraProjection M) (ι : Type*) [Fintype ι] where + base : AlgebraProjection M + leg : ι → PartialIsometry M + initial : ∀ i, (leg i).support=base + cross : ∀ i j, i≠j → star (leg i).val*(leg j).val=0 + total : ∑ i, (leg i).target.val=p.val + bound : ∀ i, (leg i).target ≤ p + +namespace EquivalentPartition +variable {p : AlgebraProjection M} {ι κ : Type*} [Fintype ι] [Fintype κ] + +theorem orthogonal (E : EquivalentPartition p ι) (i j : ι) (hij : i≠j) : + (E.leg i).target.val*(E.leg j).target.val=0 := by + change ((E.leg i).val*star (E.leg i).val)*((E.leg j).val*star (E.leg j).val)=0 + calc _ = (E.leg i).val*(star (E.leg i).val*(E.leg j).val)*star (E.leg j).val := by + simp only [mul_assoc] + _ = 0 := by rw [E.cross i j hij,mul_zero,zero_mul] + +/-- Every ordered pair of pieces has a displayed equivalence witness. -/ +def link (E : EquivalentPartition p ι) (i j : ι) : PartialIsometry M := + (E.leg j).compose (E.leg i).adjoint (by + have h : (E.leg i).adjoint.target=(E.leg i).support := by + apply Subtype.ext + change star (E.leg i).val*star (star (E.leg i).val)=(E.leg i).support.val + rw [star_star,(E.leg i).initial] + rw [h,E.initial,E.initial]) + +theorem link_support (E : EquivalentPartition p ι) (i j : ι) : + (E.link i j).support=(E.leg i).target := rfl + +theorem link_target (E : EquivalentPartition p ι) (i j : ι) : + (E.link i j).target=(E.leg j).target := by + apply Subtype.ext + change ((E.leg j).val*star (E.leg i).val)*star ((E.leg j).val*star (E.leg i).val)=_ + calc _ = (E.leg j).val*(star (E.leg i).val*(E.leg i).val)*star (E.leg j).val := by + simp only [star_mul,star_star,mul_assoc] + _ = (E.leg j).val*star (E.leg j).val := by + rw [(E.leg i).initial,E.initial,← E.initial j,(E.leg j).mul_support] + _ = _ := rfl + +/-- Refinement is performed on the common initial corner and transported. -/ +def refine (E : EquivalentPartition p ι) (F : EquivalentPartition E.base κ) : + EquivalentPartition p (ι × κ) where + base := F.base + leg a := (E.leg a.1).compose (F.leg a.2) (by rw [E.initial]; exact F.bound a.2) + initial a := F.initial a.2 + cross a b hab := by + change star ((E.leg a.1).val*(F.leg a.2).val)* + ((E.leg b.1).val*(F.leg b.2).val)=0 + rw [star_mul] + have hr : (star (F.leg a.2).val*star (E.leg a.1).val)* + ((E.leg b.1).val*(F.leg b.2).val)= + star (F.leg a.2).val*(star (E.leg a.1).val*(E.leg b.1).val)*(F.leg b.2).val := by + simp only [mul_assoc] + rw [hr] + by_cases h : a.1=b.1 + · rw [h,(E.leg b.1).initial,E.initial,mul_assoc, + ((F.leg b.2).target_le_iff_mul E.base).mp (F.bound b.2)] + exact F.cross a.2 b.2 (fun hh => hab (Prod.ext h hh)) + · rw [E.cross a.1 b.1 h,mul_zero,zero_mul] + total := by + rw [Fintype.sum_prod_type] + simp only [PartialIsometry.compose_target,← Finset.sum_mul,← Finset.mul_sum,F.total] + have h (i : ι) : (E.leg i).val*E.base.val=(E.leg i).val := by + rw [← E.initial i,(E.leg i).mul_support] + simp only [h] + exact E.total + bound a := ((E.leg a.1).compose_target_le (F.leg a.2) _).trans (E.bound a.1) + +theorem refine_parent (E : EquivalentPartition p ι) (F : EquivalentPartition E.base κ) (i : ι) : + (∑ j, ((E.refine F).leg (i,j)).target.val)=(E.leg i).target.val := by + change (∑ j, ((E.leg i).compose (F.leg j) (by rw [E.initial]; exact F.bound j)).target.val)=_ + simp only [PartialIsometry.compose_target,← Finset.sum_mul,← Finset.mul_sum,F.total] + rw [← E.initial i,(E.leg i).mul_support] + rfl + +/-- Depth zero consists of the original projection itself. -/ +def singleton (p : AlgebraProjection M) : EquivalentPartition p Unit where + base := p + leg _ := PartialIsometry.onProjection p + initial _ := rfl + cross i j hij := (hij (Subsingleton.elim _ _)).elim + total := by simp only [PartialIsometry.onProjection_target,Fintype.sum_unique] + bound _ := by rw [PartialIsometry.onProjection_target] + +/-- Two equivalent orthogonal halves, as a family with a common initial corner. -/ +def ofHalving (v : PartialIsometry M) (ho : v.support.val*v.target.val=0) + (hp : v.support.val+v.target.val=p.val) : EquivalentPartition p Bool where + base := v.support + leg b := if b then v else PartialIsometry.onProjection v.support + initial b := by cases b <;> rfl + cross b c hbc := by + have h : v.support.val*v.val=0 := by + calc _ = v.support.val*(v.target.val*v.val) := by rw [v.target_mul] + _ = 0 := by rw [← mul_assoc,ho,zero_mul] + cases b <;> cases c + · exact (hbc rfl).elim + · simpa only [Bool.false_eq_true,ite_false,ite_true,PartialIsometry.onProjection, + v.support.property.isSelfAdjoint.star_eq] using h + · simpa only [Bool.false_eq_true,ite_false,ite_true,PartialIsometry.onProjection, + star_mul,star_zero,v.support.property.isSelfAdjoint.star_eq] using congrArg star h + · exact (hbc rfl).elim + total := by + simp only [Fintype.sum_bool,ite_true,Bool.false_eq_true,ite_false, + PartialIsometry.onProjection_target] + exact (add_comm _ _).trans hp + bound b := by + have he : orthogonalSum v.support v.target ho=p := Subtype.ext hp + cases b + · simpa only [Bool.false_eq_true,ite_false,PartialIsometry.onProjection_target,he] + using le_orthogonalSum_left v.support v.target ho + · simpa only [ite_true,he] using le_orthogonalSum_right v.support v.target ho + +end EquivalentPartition +end Tracial + +/-! Coherent dyadic equivalent partitions and matrix units, constructed from +scalar center and diffuseness without a trace. DyadicIndex is reused as a +finite binary index type; no tracial partition construction is used. -/ +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +namespace Tracial +variable {M : VonNeumannAlgebra H} +namespace EquivalentPartition +variable {p : AlgebraProjection M} {ι κ : Type*} [Fintype ι] [Fintype κ] + +/-- The matrix entries associated to the explicit common-source legs. -/ +def entry (E : EquivalentPartition p ι) (i j : ι) : M.toStarSubalgebra := + (E.leg i).val*star (E.leg j).val + +theorem entry_diagonal (E : EquivalentPartition p ι) (i : ι) : + E.entry i i=(E.leg i).target.val := rfl + +theorem entry_star (E : EquivalentPartition p ι) (i j : ι) : + star (E.entry i j)=E.entry j i := by simp only [entry,star_mul,star_star] + +theorem entry_mul [DecidableEq ι] (E : EquivalentPartition p ι) (i j k l : ι) : + E.entry i j*E.entry k l=if j=k then E.entry i l else 0 := by + change ((E.leg i).val*star (E.leg j).val)*((E.leg k).val*star (E.leg l).val)=_ + have hr : ((E.leg i).val*star (E.leg j).val)*((E.leg k).val*star (E.leg l).val)= + (E.leg i).val*(star (E.leg j).val*(E.leg k).val)*star (E.leg l).val := by + simp only [mul_assoc] + rw [hr] + by_cases h : j=k + · subst k + rw [ite_eq_left rfl,(E.leg j).initial,E.initial,← E.initial i,(E.leg i).mul_support] + rfl + · rw [ite_eq_right h,E.cross j k h,mul_zero,zero_mul] + +/-- Every old matrix entry is exactly the sum of its corresponding child entries. -/ +theorem refine_entry (E : EquivalentPartition p ι) (F : EquivalentPartition E.base κ) + (i j : ι) : (∑ b, (E.refine F).entry (i,b) (j,b))=E.entry i j := by + have he (b : κ) : (E.refine F).entry (i,b) (j,b)= + (E.leg i).val*(F.leg b).target.val*star (E.leg j).val := by + change ((E.leg i).val*(F.leg b).val)*star ((E.leg j).val*(F.leg b).val)=_ + simp only [star_mul,PartialIsometry.target,mul_assoc] + rw [show (∑ b, (E.refine F).entry (i,b) (j,b))= + ∑ b, (E.leg i).val*(F.leg b).target.val*star (E.leg j).val from Finset.sum_congr rfl (fun b _ => he b)] + rw [← Finset.sum_mul,← Finset.mul_sum,F.total,← E.initial i,(E.leg i).mul_support] + rfl + +/-- A partition of the identity yields a unital full matrix-unit system. -/ +def matrixUnits [DecidableEq ι] (E : EquivalentPartition p ι) (hp : p.val=1) : + MatrixUnitSystem ι M.toStarSubalgebra where + entry := E.entry + star_entry := E.entry_star + mul_entry := E.entry_mul + total := E.total.trans hp + +/-- A partition of a nonzero projection has no zero piece, since every +piece is equivalent to every other piece by the displayed links. -/ +theorem target_ne_zero (E : EquivalentPartition p ι) (hp : p.val≠0) (i : ι) : + (E.leg i).target.val≠0 := by + intro hi + have hz (j : ι) : (E.leg j).target.val=0 := by + have hw : (E.link i j).val=0 := by + have hm := (E.link i j).mul_support + rw [E.link_support,hi,mul_zero] at hm + exact hm.symm + rw [← E.link_target i j] + change (E.link i j).val*star (E.link i j).val=0 + rw [hw,zero_mul] + have ht := E.total + simp only [hz,Finset.sum_const_zero] at ht + exact hp ht.symm + +end EquivalentPartition + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + +/-- Choose the actual two-leg partition supplied by trace-free halving. -/ +def traceFreeBinaryPartition (p : AlgebraProjection M) : EquivalentPartition p Bool := + let h := traceFree_exists_halving hfactor hdiff p + EquivalentPartition.ofHalving h.choose h.choose_spec.1 h.choose_spec.2 + +/-- A coherent family: each successor halves the previous common initial +projection once and transports that halving to all its equivalent pieces. -/ +def traceFreeDyadicPartition (p : AlgebraProjection M) : + (n : ℕ) → EquivalentPartition p (DyadicIndex n) + | 0 => EquivalentPartition.singleton p + | n+1 => + let E := traceFreeDyadicPartition p n + E.refine (traceFreeBinaryPartition hfactor hdiff E.base) + +theorem traceFreeDyadicPartition_parent (p : AlgebraProjection M) (n : ℕ) (i : DyadicIndex n) : + (∑ b : Bool, ((traceFreeDyadicPartition hfactor hdiff p (n+1)).leg (i,b)).target.val)= + ((traceFreeDyadicPartition hfactor hdiff p n).leg i).target.val := + EquivalentPartition.refine_parent _ _ i + +theorem traceFreeDyadicPartition_entry (p : AlgebraProjection M) (n : ℕ) + (i j : DyadicIndex n) : + (∑ b : Bool, (traceFreeDyadicPartition hfactor hdiff p (n+1)).entry (i,b) (j,b))= + (traceFreeDyadicPartition hfactor hdiff p n).entry i j := + EquivalentPartition.refine_entry _ _ i j + +/-- Actual matrix units of sizes 2^n, with coherent inclusions. -/ +def traceFreeDyadicMatrixUnits (n : ℕ) : MatrixUnitSystem (DyadicIndex n) M.toStarSubalgebra := + (traceFreeDyadicPartition hfactor hdiff ⟨1,IsStarProjection.one _⟩ n).matrixUnits rfl + +theorem traceFreeDyadicMatrixUnits_compatible (n : ℕ) (i j : DyadicIndex n) : + (∑ b : Bool, (traceFreeDyadicMatrixUnits hfactor hdiff (n+1)).entry (i,b) (j,b))= + (traceFreeDyadicMatrixUnits hfactor hdiff n).entry i j := + traceFreeDyadicPartition_entry hfactor hdiff _ n i j + +end Tracial + +/-- Coherent dyadic matrix units in the unchanged original concrete factor. -/ +theorem isII1Factor_dyadic_matrixUnits + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) : + ∃ E : (n : ℕ) → MatrixUnitSystem (Tracial.DyadicIndex n) S, + ∀ (n : ℕ) (i j : Tracial.DyadicIndex n), + (∑ b : Bool, (E (n+1)).entry (i,b) (j,b))=(E n).entry i j := by + let M := vonNeumannOfWOTClosed S hS.weaklyClosed + have hf : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + exact ⟨Tracial.traceFreeDyadicMatrixUnits hf hS.diffuse, + Tracial.traceFreeDyadicMatrixUnits_compatible hf hS.diffuse⟩ + +end + +/-! Actual sums of countable orthogonal partial isometries, including least +initial/final support identities. No trace or countable-cofinality premise. -/ +namespace Tracial + +section +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +variable (a : ℕ → PartialIsometry M) +variable (hp : ∀ i j, i ≠ j → (a i).support.val*(a j).support.val=0) +variable (hq : ∀ i j, i ≠ j → (a i).target.val*(a j).target.val=0) + +include hp hq in +theorem exists_orthogonalPartialSum (n : ℕ) : + ∃ v : PartialIsometry M, v.val=∑ i ∈ Finset.range n, (a i).val ∧ + v.support.val=∑ i ∈ Finset.range n, (a i).support.val ∧ + v.target.val=∑ i ∈ Finset.range n, (a i).target.val := by + induction n with + | zero => exact ⟨zero, by simp [zero], by simp [zero], by simp [zero,target]⟩ + | succ n ih => + obtain ⟨v,hv,hs,ht⟩ := ih + have ho₁ : v.support.val*(a n).support.val=0 := by + rw [hs,Finset.sum_mul] + exact Finset.sum_eq_zero (fun i hi => hp i n (Nat.ne_of_lt (Finset.mem_range.mp hi))) + have ho₂ : v.target.val*(a n).target.val=0 := by + rw [ht,Finset.sum_mul] + exact Finset.sum_eq_zero (fun i hi => hq i n (Nat.ne_of_lt (Finset.mem_range.mp hi))) + refine ⟨patch v (a n) ho₁ ho₂, ?_, ?_, ?_⟩ + · change v.val+(a n).val=_ + rw [hv,Finset.sum_range_succ] + · change v.support.val+(a n).support.val=_ + rw [hs,Finset.sum_range_succ] + · rw [patch_target,ht,Finset.sum_range_succ] + +def orthogonalPartialSum (n : ℕ) : PartialIsometry M := + (exists_orthogonalPartialSum a hp hq n).choose + +theorem orthogonalPartialSum_val (n : ℕ) : + (orthogonalPartialSum a hp hq n).val=∑ i ∈ Finset.range n, (a i).val := + (exists_orthogonalPartialSum a hp hq n).choose_spec.1 + +theorem orthogonalPartialSum_support (n : ℕ) : + (orthogonalPartialSum a hp hq n).support.val=∑ i ∈ Finset.range n, (a i).support.val := + (exists_orthogonalPartialSum a hp hq n).choose_spec.2.1 + +theorem orthogonalPartialSum_target (n : ℕ) : + (orthogonalPartialSum a hp hq n).target.val=∑ i ∈ Finset.range n, (a i).target.val := + (exists_orthogonalPartialSum a hp hq n).choose_spec.2.2 + +theorem le_orthogonalPartialSum (i n : ℕ) (hin : i < n) : + a i ≤ orthogonalPartialSum a hp hq n := by + change (orthogonalPartialSum a hp hq n).val*(a i).support.val=(a i).val + rw [orthogonalPartialSum_val,Finset.sum_mul] + apply Finset.sum_eq_single_of_mem i (Finset.mem_range.mpr hin) _ |>.trans (a i).mul_support + intro j _ hji + calc (a j).val*(a i).support.val = ((a j).val*(a j).support.val)*(a i).support.val := by + rw [(a j).mul_support] + _ = 0 := by rw [mul_assoc,hp j i hji,mul_zero] + +theorem orthogonalPartialSum_monotone : Monotone (orthogonalPartialSum a hp hq) := by + apply monotone_nat_of_le_succ + intro n + let v := orthogonalPartialSum a hp hq n + have ho₁ : v.support.val*(a n).support.val=0 := by + rw [orthogonalPartialSum_support,Finset.sum_mul] + exact Finset.sum_eq_zero (fun i hi => hp i n (Nat.ne_of_lt (Finset.mem_range.mp hi))) + have ho₂ : v.target.val*(a n).target.val=0 := by + rw [orthogonalPartialSum_target,Finset.sum_mul] + exact Finset.sum_eq_zero (fun i hi => hq i n (Nat.ne_of_lt (Finset.mem_range.mp hi))) + have he : orthogonalPartialSum a hp hq (n+1)=patch v (a n) ho₁ ho₂ := by + apply ext + change (orthogonalPartialSum a hp hq (n+1)).val=v.val+(a n).val + rw [orthogonalPartialSum_val,show v.val=∑ i ∈ Finset.range n, (a i).val from + orthogonalPartialSum_val a hp hq n,Finset.sum_range_succ] + rw [he] + exact v.le_patch (a n) ho₁ ho₂ + +include hp hq in +/-- An actual infinite orthogonal sum, with least upper bound characterizations +for both support projections. It may be used to construct a shift. -/ +theorem traceFree_orthogonal_sum : + ∃ v : PartialIsometry M, (∀ i, a i ≤ v) ∧ + (∀ p : AlgebraProjection M, v.support ≤ p ↔ ∀ i, (a i).support ≤ p) ∧ + (∀ q : AlgebraProjection M, v.target ≤ q ↔ ∀ i, (a i).target ≤ q) := by + obtain ⟨v,hv,hs,ht⟩ := traceFree_monotone_least_supports + (orthogonalPartialSum a hp hq) (orthogonalPartialSum_monotone a hp hq) + have hav (i : ℕ) : a i ≤ v := + (le_orthogonalPartialSum a hp hq i (i+1) (Nat.lt_succ_self i)).trans (hv (i+1)) + refine ⟨v,hav,?_,?_⟩ + · intro p + refine ⟨fun h i => (support_mono (hav i)).trans h, fun h => hs p ?_⟩ + intro n + change p.val*(orthogonalPartialSum a hp hq n).support.val=_ + rw [orthogonalPartialSum_support,Finset.mul_sum] + exact Finset.sum_congr rfl (fun i _ => h i) + · intro q + refine ⟨fun h i => (target_mono (hav i)).trans h, fun h => ht q ?_⟩ + intro n + change q.val*(orthogonalPartialSum a hp hq n).target.val=_ + rw [orthogonalPartialSum_target,Finset.mul_sum] + exact Finset.sum_congr rfl (fun i _ => h i) + +end PartialIsometry +end + +/-! Projection equivalence and subequivalence are witnessed by actual partial +isometries in the original algebra. No dimension or trace oracle is used. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +theorem adjoint_target (v : PartialIsometry M) : v.adjoint.target=v.support := by + apply Subtype.ext + change star v.val*star (star v.val)=v.support.val + rw [star_star,v.initial] + +theorem compose_target_of_eq (v w : PartialIsometry M) (h : w.target=v.support) : + (v.compose w (le_of_eq h)).target=v.target := by + apply Subtype.ext + rw [compose_target,h,v.mul_support] + rfl + +/-- Link two ranges whose displayed partial isometries have the same source. -/ +def rangeLink (v w : PartialIsometry M) (h : v.support=w.support) : PartialIsometry M := + w.compose v.adjoint (by rw [adjoint_target,h]) + +theorem rangeLink_support (v w : PartialIsometry M) (h : v.support=w.support) : + (rangeLink v w h).support=v.target := rfl + +theorem rangeLink_target (v w : PartialIsometry M) (h : v.support=w.support) : + (rangeLink v w h).target=w.target := + compose_target_of_eq w v.adjoint ((adjoint_target v).trans h) + +end PartialIsometry +namespace AlgebraProjection + +def Subequivalent (p q : AlgebraProjection M) : Prop := + ∃ v : PartialIsometry M, v.support=p ∧ v.target ≤ q + +def Equivalent (p q : AlgebraProjection M) : Prop := + ∃ v : PartialIsometry M, v.support=p ∧ v.target=q + +theorem subequivalent_refl (p : AlgebraProjection M) : p.Subequivalent p := + ⟨PartialIsometry.onProjection p,rfl,le_of_eq (PartialIsometry.onProjection_target p)⟩ + +theorem subequivalent_of_le {p q : AlgebraProjection M} (h : p ≤ q) : + p.Subequivalent q := + ⟨PartialIsometry.onProjection p,rfl,(le_of_eq (PartialIsometry.onProjection_target p)).trans h⟩ + +theorem subequivalent_trans {p q r : AlgebraProjection M} + (h : p.Subequivalent q) (k : q.Subequivalent r) : p.Subequivalent r := by + obtain ⟨v,hv,hvq⟩ := h + obtain ⟨w,hw,hwr⟩ := k + have hc : v.target ≤ w.support := by rw [hw]; exact hvq + exact ⟨w.compose v hc,hv,(w.compose_target_le v hc).trans hwr⟩ + +theorem equivalent_refl (p : AlgebraProjection M) : p.Equivalent p := + ⟨PartialIsometry.onProjection p,rfl,PartialIsometry.onProjection_target p⟩ + +theorem equivalent_symm {p q : AlgebraProjection M} (h : p.Equivalent q) : q.Equivalent p := by + obtain ⟨v,hv,hvq⟩ := h + exact ⟨v.adjoint,hvq,v.adjoint_target.trans hv⟩ + +theorem equivalent_trans {p q r : AlgebraProjection M} + (h : p.Equivalent q) (k : q.Equivalent r) : p.Equivalent r := by + obtain ⟨v,hv,hvq⟩ := h + obtain ⟨w,hw,hwr⟩ := k + have hc : v.target=w.support := hvq.trans hw.symm + exact ⟨w.compose v (le_of_eq hc),hv,(w.compose_target_of_eq v hc).trans hwr⟩ + +theorem Equivalent.subequivalent {p q : AlgebraProjection M} (h : p.Equivalent q) : + p.Subequivalent q := by + obtain ⟨v,hv,hvq⟩ := h + exact ⟨v,hv,le_of_eq hvq⟩ + +/-- Scalar-center comparison gives totality of actual subequivalence. -/ +theorem subequivalent_total + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (p q : AlgebraProjection M) : p.Subequivalent q ∨ q.Subequivalent p := by + obtain ⟨v,hp,hq,h⟩ := traceFree_exists_partialIsometry_comparison hfactor p q + rcases h with h | h + · exact Or.inl ⟨v,h,hq⟩ + · exact Or.inr ⟨v.adjoint,h,by rw [v.adjoint_target]; exact hp⟩ + +end AlgebraProjection + +/-! Finiteness excludes an infinite family of nonzero equivalent orthogonal +projections. The shift and both of its least supports are constructed. -/ + +/-- The infinite shift omits the first range. Finiteness then forces that +range, and hence the common source projection, to be zero. -/ +theorem traceFree_finite_orthogonal_copies_eq_zero + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (r : AlgebraProjection M) (a : ℕ → PartialIsometry M) + (hs : ∀ i, (a i).support=r) + (ho : ∀ i j, i≠j → (a i).target.val*(a j).target.val=0) : r.val=0 := by + let w (i : ℕ) := PartialIsometry.rangeLink (a i) (a (i+1)) ((hs i).trans (hs (i+1)).symm) + have hw₁ (i : ℕ) : (w i).support=(a i).target := rfl + have hw₂ (i : ℕ) : (w i).target=(a (i+1)).target := PartialIsometry.rangeLink_target _ _ _ + obtain ⟨v,hv,hvp,hvq⟩ := PartialIsometry.traceFree_orthogonal_sum w + (by intro i j h; rw [hw₁,hw₁]; exact ho i j h) + (by intro i j h; rw [hw₂,hw₂]; exact ho (i+1) (j+1) (by omega)) + have hle : v.target ≤ v.support := by + apply (hvq v.support).mpr + intro i + rw [hw₂,← hw₁ (i+1)] + exact PartialIsometry.support_mono (hv (i+1)) + have he : v.target=v.support := v.target_eq_support_of_finite hfinite hle + let c : AlgebraProjection M := ⟨1-(a 0).target.val,(a 0).target.property.one_sub⟩ + have hc : v.target ≤ c := by + apply (hvq c).mpr + intro i + rw [hw₂] + change (1-(a 0).target.val)*(a (i+1)).target.val=(a (i+1)).target.val + rw [sub_mul,one_mul,ho 0 (i+1) (by omega),sub_zero] + have h0 : (a 0).target ≤ c := by + apply (PartialIsometry.support_mono (hv 0)).trans + rw [← he] + exact hc + have hz : (a 0).target.val=0 := by + change (1-(a 0).target.val)*(a 0).target.val=(a 0).target.val at h0 + rw [sub_mul,one_mul,(a 0).target.property.isIdempotentElem.eq,sub_self] at h0 + exact h0.symm + have ha : (a 0).val=0 := by + have h := (a 0).target_mul + rw [hz,zero_mul] at h + exact h.symm + rw [← hs 0,← (a 0).initial,ha,star_zero,zero_mul] + +/-- Subequivalence into every member of an orthogonal sequence is impossible +for a nonzero projection in a finite algebra. -/ +theorem traceFree_finite_subequivalent_orthogonal_eq_zero + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (r : AlgebraProjection M) (q : ℕ → AlgebraProjection M) + (ho : ∀ i j, i≠j → (q i).val*(q j).val=0) + (h : ∀ i, r.Subequivalent (q i)) : r.val=0 := by + choose a hs ht using h + exact traceFree_finite_orthogonal_copies_eq_zero hfinite r a hs (by + intro i j hij + exact projection_orthogonal_of_le (ho i j hij) (ht i) (ht j)) + +/-! Finite comparison and cancellation with actual partial isometries. +No trace, dimension, or representation is assumed. -/ +namespace AlgebraProjection + +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +/-- Mutual subequivalence is equivalence in a finite algebra. -/ +theorem equivalent_of_mutual_subequivalent {p q : AlgebraProjection M} + (hpq : p.Subequivalent q) (hqp : q.Subequivalent p) : p.Equivalent q := by + obtain ⟨v,hv,hvq⟩ := hpq + obtain ⟨w,hw,hwp⟩ := hqp + have hc : v.target ≤ w.support := by rw [hw]; exact hvq + let u := w.compose v hc + have hu : u.target ≤ u.support := by + change u.target ≤ v.support + rw [hv] + exact (w.compose_target_le v hc).trans hwp + have he : u.target=p := (u.target_eq_support_of_finite hfinite hu).trans hv + have hw' : w.target=p := le_antisymm hwp (by + rw [← he]; exact w.compose_target_le v hc) + exact ⟨w.adjoint,hw',w.adjoint_target.trans hw⟩ + +include hfinite in +/-- Equivalent comparable projections in a finite algebra coincide. -/ +theorem eq_of_equivalent_of_le {p q : AlgebraProjection M} + (he : p.Equivalent q) (hle : p ≤ q) : p=q := by + obtain ⟨v,hv,ht⟩ := he + exact ht.symm.trans ((v.target_eq_support_of_finite_of_le hfinite (by + rw [hv,ht]; exact hle)).trans hv) |>.symm + +include hfinite in +/-- Any embedding onto a subprojection of an equivalent projection is onto. -/ +theorem target_eq_of_equivalent (v : PartialIsometry M) (q : AlgebraProjection M) + (he : v.support.Equivalent q) (hle : v.target ≤ q) : v.target=q := by + have hv : v.target.Equivalent v.support := ⟨v.adjoint,rfl,v.adjoint_target⟩ + exact eq_of_equivalent_of_le hfinite (equivalent_trans hv he) hle + +theorem subequivalent_orthogonalSum {p q r s : AlgebraProjection M} + (hp : p.val*r.val=0) (hq : q.val*s.val=0) + (h₁ : p.Subequivalent q) (h₂ : r.Subequivalent s) : + (orthogonalSum p r hp).Subequivalent (orthogonalSum q s hq) := by + obtain ⟨v,hv,hvq⟩ := h₁ + obtain ⟨w,hw,hws⟩ := h₂ + have hi : v.support.val*w.support.val=0 := by rw [hv,hw]; exact hp + have ht := projection_orthogonal_of_le hq hvq hws + refine ⟨v.patch w hi ht,Subtype.ext (by + change v.support.val+w.support.val=_ + rw [hv,hw] + rfl),?_⟩ + have he : (v.patch w hi ht).target=orthogonalSum v.target w.target ht := + Subtype.ext (v.patch_target w hi ht) + rw [he] + exact orthogonalSum_le ht (hvq.trans (le_orthogonalSum_left _ _ hq)) + (hws.trans (le_orthogonalSum_right _ _ hq)) + +theorem equivalent_orthogonalSum {p q r s : AlgebraProjection M} + (hp : p.val*r.val=0) (hq : q.val*s.val=0) + (h₁ : p.Equivalent q) (h₂ : r.Equivalent s) : + (orthogonalSum p r hp).Equivalent (orthogonalSum q s hq) := by + obtain ⟨v,hv,hvq⟩ := h₁ + obtain ⟨w,hw,hws⟩ := h₂ + have hi : v.support.val*w.support.val=0 := by rw [hv,hw]; exact hp + have ht : v.target.val*w.target.val=0 := by rw [hvq,hws]; exact hq + refine ⟨v.patch w hi ht,Subtype.ext (by + change v.support.val+w.support.val=_ + rw [hv,hw] + rfl),Subtype.ext ?_⟩ + rw [PartialIsometry.patch_target,hvq,hws] + rfl + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + +include hfinite hfactor in +/-- Cancel equivalent orthogonal pieces from a subequivalence. -/ +theorem subequivalent_cancel {p q r s : AlgebraProjection M} + (hp : p.val*r.val=0) (hq : q.val*s.val=0) (he : p.Equivalent q) + (h : (orthogonalSum p r hp).Subequivalent (orthogonalSum q s hq)) : + r.Subequivalent s := by + rcases subequivalent_total hfactor r s with hgood | hrev + · exact hgood + · obtain ⟨v,hv,ht⟩ := equivalent_symm he + obtain ⟨w,hw,hwr⟩ := hrev + have hi : v.support.val*w.support.val=0 := by rw [hv,hw]; exact hq + have ho : v.target.val*w.target.val=0 := by + rw [ht]; exact projection_orthogonal_of_le hp le_rfl hwr + let u := v.patch w hi ho + have hus : u.support=orthogonalSum q s hq := Subtype.ext (by + change v.support.val+w.support.val=_; rw [hv,hw]; rfl) + have hut : u.target ≤ orthogonalSum p r hp := by + have hu : u.target=orthogonalSum v.target w.target ho := + Subtype.ext (v.patch_target w hi ho) + rw [hu] + exact orthogonalSum_le ho (by rw [ht]; exact le_orthogonalSum_left _ _ hp) + (hwr.trans (le_orthogonalSum_right _ _ hp)) + have heq : u.support.Equivalent (orthogonalSum p r hp) := by + rw [hus] + exact equivalent_of_mutual_subequivalent hfinite ⟨u,hus,hut⟩ h + have hu := congrArg Subtype.val (target_eq_of_equivalent hfinite u _ heq hut) + rw [PartialIsometry.patch_target,ht] at hu + change p.val+w.target.val=p.val+r.val at hu + have hw' : w.target=r := Subtype.ext (add_left_cancel hu) + exact (equivalent_symm (show s.Equivalent r from ⟨w,hw,hw'⟩)).subequivalent + +include hfinite hfactor in +theorem equivalent_cancel {p q r s : AlgebraProjection M} + (hp : p.val*r.val=0) (hq : q.val*s.val=0) (he : p.Equivalent q) + (h : (orthogonalSum p r hp).Equivalent (orthogonalSum q s hq)) : + r.Equivalent s := + equivalent_of_mutual_subequivalent hfinite + (subequivalent_cancel hfinite hfactor hp hq he h.subequivalent) + (subequivalent_cancel hfinite hfactor hq hp (equivalent_symm he) + (equivalent_symm h).subequivalent) + +/-- The relative complement is the actual difference of the operators. -/ +def remainder (p q : AlgebraProjection M) (h : p ≤ q) : AlgebraProjection M := + ⟨q.val-p.val,p.property.sub_of_mul_eq_right q.property h⟩ + +theorem remainder_orthogonal (p q : AlgebraProjection M) (h : p ≤ q) : + p.val*(remainder p q h).val=0 := by + change p.val*(q.val-p.val)=0 + rw [mul_sub,projection_mul_of_le h,p.property.isIdempotentElem.eq,sub_self] + +theorem orthogonalSum_remainder (p q : AlgebraProjection M) (h : p ≤ q) : + orthogonalSum p (remainder p q h) (remainder_orthogonal p q h)=q := + Subtype.ext (by change p.val+(q.val-p.val)=q.val; abel) + +theorem remainder_le (p q : AlgebraProjection M) (h : p ≤ q) : remainder p q h ≤ q := by + change q.val*(q.val-p.val)=q.val-p.val + rw [mul_sub,q.property.isIdempotentElem.eq,h] + +include hfinite hfactor in +/-- Comparison respects subtraction of equivalent pieces. -/ +theorem remainder_subequivalent {p q P Q : AlgebraProjection M} + (hp : p ≤ P) (hq : q ≤ Q) (he : p.Equivalent q) (h : P.Subequivalent Q) : + (remainder p P hp).Subequivalent (remainder q Q hq) := by + apply subequivalent_cancel hfinite hfactor + (remainder_orthogonal p P hp) (remainder_orthogonal q Q hq) he + simpa only [orthogonalSum_remainder] using h + +include hfinite hfactor in +theorem remainder_equivalent {p q P Q : AlgebraProjection M} + (hp : p ≤ P) (hq : q ≤ Q) (he : p.Equivalent q) (h : P.Equivalent Q) : + (remainder p P hp).Equivalent (remainder q Q hq) := by + apply equivalent_cancel hfinite hfactor + (remainder_orthogonal p P hp) (remainder_orthogonal q Q hq) he + simpa only [orthogonalSum_remainder] using h + +end AlgebraProjection +end Tracial + +/-! Actual finite sums of orthogonal partial isometries and finite subsets of +equivalent partitions. The finite subset is arbitrary, without an index order. -/ +open scoped BigOperators +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +theorem exists_finsetSum {ι : Type*} (a : ι → PartialIsometry M) (s : Finset ι) + (hp : ∀ i ∈ s, ∀ j ∈ s, i≠j → (a i).support.val*(a j).support.val=0) + (hq : ∀ i ∈ s, ∀ j ∈ s, i≠j → (a i).target.val*(a j).target.val=0) : + ∃ v : PartialIsometry M, v.val=∑ i ∈ s, (a i).val ∧ + v.support.val=∑ i ∈ s, (a i).support.val ∧ + v.target.val=∑ i ∈ s, (a i).target.val := by + classical + induction s using Finset.induction_on with + | empty => exact ⟨zero,by simp [zero],by simp [zero],by simp [zero,target]⟩ + | @insert i s hi ih => + obtain ⟨v,hv,hs,ht⟩ := ih + (fun j hj k hk => hp j (Finset.mem_insert_of_mem hj) k (Finset.mem_insert_of_mem hk)) + (fun j hj k hk => hq j (Finset.mem_insert_of_mem hj) k (Finset.mem_insert_of_mem hk)) + have ho₁ : (a i).support.val*v.support.val=0 := by + rw [hs,Finset.mul_sum] + exact Finset.sum_eq_zero (fun j hj => hp i (Finset.mem_insert_self _ _) j + (Finset.mem_insert_of_mem hj) (fun h => hi (h.symm ▸ hj))) + have ho₂ : (a i).target.val*v.target.val=0 := by + rw [ht,Finset.mul_sum] + exact Finset.sum_eq_zero (fun j hj => hq i (Finset.mem_insert_self _ _) j + (Finset.mem_insert_of_mem hj) (fun h => hi (h.symm ▸ hj))) + refine ⟨(a i).patch v ho₁ ho₂,?_,?_,?_⟩ + · change (a i).val+v.val=_ + rw [hv,Finset.sum_insert hi] + · change (a i).support.val+v.support.val=_ + rw [hs,Finset.sum_insert hi] + · rw [patch_target,ht,Finset.sum_insert hi] + +end PartialIsometry +namespace AlgebraProjection + +theorem isStarProjection_sum {ι : Type*} (a : ι → AlgebraProjection M) (s : Finset ι) + (ho : ∀ i ∈ s, ∀ j ∈ s, i≠j → (a i).val*(a j).val=0) : + IsStarProjection (∑ i ∈ s, (a i).val) := by + obtain ⟨v,_,hs,_⟩ := PartialIsometry.exists_finsetSum + (fun i => PartialIsometry.onProjection (a i)) s ho + (by simpa only [PartialIsometry.onProjection_target] using ho) + change v.support.val=(∑ i ∈ s, (a i).val) at hs + exact hs ▸ v.support.property + +def finsetSum {ι : Type*} (a : ι → AlgebraProjection M) (s : Finset ι) + (ho : ∀ i ∈ s, ∀ j ∈ s, i≠j → (a i).val*(a j).val=0) : AlgebraProjection M := + ⟨∑ i ∈ s, (a i).val,isStarProjection_sum a s ho⟩ + +theorem finsetSum_le_iff {ι : Type*} (a : ι → AlgebraProjection M) (s : Finset ι) + (ho : ∀ i ∈ s, ∀ j ∈ s, i≠j → (a i).val*(a j).val=0) (p : AlgebraProjection M) : + finsetSum a s ho ≤ p ↔ ∀ i ∈ s, a i ≤ p := by + classical + constructor + · intro h i hi + apply le_trans ?_ h + change (∑ j ∈ s, (a j).val)*(a i).val=(a i).val + rw [Finset.sum_mul] + exact (Finset.sum_eq_single_of_mem i hi + (fun j hj hji => ho j hj i hi hji)).trans (a i).property.isIdempotentElem.eq + · intro h + change p.val*(∑ i ∈ s, (a i).val)=∑ i ∈ s, (a i).val + rw [Finset.mul_sum] + exact Finset.sum_congr rfl h + +end AlgebraProjection +namespace EquivalentPartition +variable {p : AlgebraProjection M} {ι : Type*} [Fintype ι] + +def subset (E : EquivalentPartition p ι) (s : Finset ι) : AlgebraProjection M := + AlgebraProjection.finsetSum (fun i => (E.leg i).target) s + (fun i _ j _ => E.orthogonal i j) + +theorem subset_val (E : EquivalentPartition p ι) (s : Finset ι) : + (E.subset s).val=∑ i ∈ s, (E.leg i).target.val := rfl + +theorem subset_le_iff (E : EquivalentPartition p ι) (s : Finset ι) (q : AlgebraProjection M) : + E.subset s ≤ q ↔ ∀ i ∈ s, (E.leg i).target ≤ q := + AlgebraProjection.finsetSum_le_iff _ _ _ _ + +theorem subset_le (E : EquivalentPartition p ι) (s : Finset ι) : E.subset s ≤ p := + (E.subset_le_iff s p).mpr (fun i _ => E.bound i) + +theorem subset_mono (E : EquivalentPartition p ι) {s t : Finset ι} (h : s ⊆ t) : + E.subset s ≤ E.subset t := + (E.subset_le_iff s _).mpr (fun i hi => (E.subset_le_iff t _).mp le_rfl i (h hi)) + +theorem subset_univ (E : EquivalentPartition p ι) : E.subset Finset.univ=p := + Subtype.ext E.total + +theorem subset_empty (E : EquivalentPartition p ι) : (E.subset ∅).val=0 := by + simp only [subset_val,Finset.sum_empty] + +theorem subset_singleton [DecidableEq ι] (E : EquivalentPartition p ι) (i : ι) : + E.subset {i}=(E.leg i).target := Subtype.ext (by simp only [subset_val,Finset.sum_singleton]) + +/-- A bijection of subsets gives a sum of explicit matrix-unit links. -/ +theorem subset_equivalent_of_equiv (E : EquivalentPartition p ι) (s t : Finset ι) + (e : s ≃ t) : (E.subset s).Equivalent (E.subset t) := by + let a (i : s) := E.link i.val (e i).val + obtain ⟨v,_,hs,ht⟩ := PartialIsometry.exists_finsetSum a Finset.univ + (by + intro i _ j _ hij + exact E.orthogonal i.val j.val (fun h => hij (Subtype.ext h))) + (by + intro i _ j _ hij + change (E.link i.val (e i).val).target.val*(E.link j.val (e j).val).target.val=0 + rw [E.link_target,E.link_target] + exact E.orthogonal _ _ (fun h => hij (e.injective (Subtype.ext h)))) + refine ⟨v,Subtype.ext ?_,Subtype.ext ?_⟩ + · rw [hs] + change (∑ i : s, (E.leg i.val).target.val)=∑ i ∈ s, (E.leg i).target.val + simpa only [Finset.attach_eq_univ] using + (Finset.sum_attach s (fun i => (E.leg i).target.val)) + · rw [ht] + change (∑ i : s, (E.link i.val (e i).val).target.val)=_ + simp only [E.link_target] + rw [e.sum_comp (fun i : t => (E.leg i.val).target.val)] + change (∑ i : t, (E.leg i.val).target.val)=∑ i ∈ t, (E.leg i).target.val + simpa only [Finset.attach_eq_univ] using + (Finset.sum_attach t (fun i => (E.leg i).target.val)) + +theorem subset_equivalent_of_card_eq (E : EquivalentPartition p ι) (s t : Finset ι) + (h : s.card=t.card) : (E.subset s).Equivalent (E.subset t) := + E.subset_equivalent_of_equiv s t (Finset.equivOfCardEq h) + +/-- Subset sums stay compatible with refinement to all children. -/ +theorem subset_refine {κ : Type*} [Fintype κ] (E : EquivalentPartition p ι) + (F : EquivalentPartition E.base κ) (s : Finset ι) : + (E.refine F).subset (s ×ˢ Finset.univ)=E.subset s := by + apply Subtype.ext + rw [subset_val,Finset.sum_product] + exact Finset.sum_congr rfl (fun i _ => E.refine_parent F i) + +/-! Exact finite cardinal comparison of sums of equivalent nonzero projections. +Finiteness prevents a larger collection from embedding in a smaller one. -/ + +theorem subset_mul_piece_of_not_mem (E : EquivalentPartition p ι) (s : Finset ι) + (i : ι) (hi : i ∉ s) : (E.subset s).val*(E.leg i).target.val=0 := by + rw [subset_val,Finset.sum_mul] + exact Finset.sum_eq_zero (fun j hj => E.orthogonal j i (fun h => hi (h ▸ hj))) + +theorem subset_le_subset_iff (E : EquivalentPartition p ι) (hp : p.val≠0) + (s t : Finset ι) : E.subset s ≤ E.subset t ↔ s ⊆ t := by + constructor + · intro h i hi + by_contra hit + have hh := (E.subset_le_iff s _).mp h i hi + change (E.subset t).val*(E.leg i).target.val=(E.leg i).target.val at hh + rw [E.subset_mul_piece_of_not_mem t i hit] at hh + exact E.target_ne_zero hp i hh.symm + · exact E.subset_mono + +theorem subset_subequivalent_of_card_le (E : EquivalentPartition p ι) + (s t : Finset ι) (h : s.card ≤ t.card) : (E.subset s).Subequivalent (E.subset t) := by + obtain ⟨u,hut,hu⟩ := Finset.exists_subset_card_eq h + exact AlgebraProjection.subequivalent_trans + (E.subset_equivalent_of_card_eq s u hu.symm).subequivalent + (AlgebraProjection.subequivalent_of_le (E.subset_mono hut)) + +/-- The witness-based comparison agrees exactly with cardinal comparison. -/ +theorem subset_subequivalent_iff_card_le + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (E : EquivalentPartition p ι) (hp : p.val≠0) (s t : Finset ι) : + (E.subset s).Subequivalent (E.subset t) ↔ s.card ≤ t.card := by + refine ⟨fun h => ?_,E.subset_subequivalent_of_card_le s t⟩ + by_contra hn + have hlt : t.card < s.card := Nat.lt_of_not_ge hn + obtain ⟨u,hus,hu⟩ := Finset.exists_subset_card_eq (Nat.le_of_lt hlt) + have hsu : (E.subset s).Subequivalent (E.subset u) := + AlgebraProjection.subequivalent_trans h + (E.subset_equivalent_of_card_eq t u hu.symm).subequivalent + have hle : E.subset u ≤ E.subset s := E.subset_mono hus + have he : E.subset u=E.subset s := AlgebraProjection.eq_of_equivalent_of_le hfinite + (AlgebraProjection.equivalent_of_mutual_subequivalent hfinite + (AlgebraProjection.subequivalent_of_le hle) hsu) hle + have hs : s ⊆ u := (E.subset_le_subset_iff hp s u).mp (le_of_eq he.symm) + have hc := Finset.card_le_card hs + omega + +theorem subset_equivalent_iff_card_eq + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (E : EquivalentPartition p ι) (hp : p.val≠0) (s t : Finset ι) : + (E.subset s).Equivalent (E.subset t) ↔ s.card=t.card := by + constructor + · intro h + exact Nat.le_antisymm ((E.subset_subequivalent_iff_card_le hfinite hp s t).mp h.subequivalent) + ((E.subset_subequivalent_iff_card_le hfinite hp t s).mp + (AlgebraProjection.equivalent_symm h).subequivalent) + · exact E.subset_equivalent_of_card_eq s t + +theorem subset_orthogonal_of_disjoint (E : EquivalentPartition p ι) + (s t : Finset ι) (h : Disjoint s t) : (E.subset s).val*(E.subset t).val=0 := by + rw [subset_val,subset_val,Finset.sum_mul] + apply Finset.sum_eq_zero + intro i hi + rw [Finset.mul_sum] + exact Finset.sum_eq_zero (fun j hj => E.orthogonal i j (fun he => + Finset.disjoint_left.mp h hi (he.symm ▸ hj))) + +theorem subset_union [DecidableEq ι] (E : EquivalentPartition p ι) + (s t : Finset ι) (h : Disjoint s t) : + E.subset (s ∪ t)=orthogonalSum (E.subset s) (E.subset t) + (E.subset_orthogonal_of_disjoint s t h) := + Subtype.ext (Finset.sum_union h) + +theorem subset_insert [DecidableEq ι] (E : EquivalentPartition p ι) + (s : Finset ι) (i : ι) (hi : i ∉ s) : + (E.subset (insert i s)).val=(E.subset s).val+(E.leg i).target.val := by + rw [subset_val,Finset.sum_insert hi,add_comm] + rfl + +end EquivalentPartition +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/EnergyDescent.lean b/lean/OAI/Analysis/FactorGeneration/EnergyDescent.lean new file mode 100644 index 0000000000000000000000000000000000000000..f06e32c370e0f01e9e446859b58b983f4ed15c1f --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/EnergyDescent.lean @@ -0,0 +1,523 @@ +import OAI.Analysis.FactorGeneration.Subfactors + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Quantitative descent for a finite spectral pinching, and actual unitary +displacement from irreducibility. A compatible spectral partition in a +residual corner is not postulated as a local-quantization theorem. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- Irreducibility supplies displacement for every nonzero centered operator, +without any orthogonality-to-P premise. -/ +theorem exists_centered_unitary_displacement + (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P, (a : M.toStarSubalgebra)*c = c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c = z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (hx : x ≠ 0) (ht : τ.trace x = 0) + (r : ℝ) (hr : r < 1) : + ∃ u : subalgebraUnitaries P, r*τ.norm₂ x < τ.norm₂ (conjugateLinear u.val x-x) := by + by_contra hn + push Not at hn + have h := trace_distance_le_unitary_displacement τ P hirr x (r*τ.norm₂ x) hn + rw [ht, zero_smul, sub_zero] at h + have hxpos : 0 < τ.norm₂ x := lt_of_le_of_ne (norm_nonneg _) + (fun hz => hx ((τ.norm₂_eq_zero_iff x).mp hz.symm)) + nlinarith + +/-- The strict displacement used before finite spectral approximation in +Popa A.1.1, Step 1, in the scalar-commutant case. -/ +theorem exists_strict_centered_displacement + (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P, (a : M.toStarSubalgebra)*c = c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c = z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (hx : x ≠ 0) (ht : τ.trace x = 0) : + ∃ u : subalgebraUnitaries P, τ.norm₂ x < τ.norm₂ (conjugateLinear u.val x-x) := by + by_contra hn + push Not at hn + let K : Set H := {ξ | τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) ξ).re} + have hclosed : IsClosed K := isClosed_le continuous_const + (Complex.continuous_re.comp (continuous_const.inner continuous_id)) + have hconv : Convex ℝ K := by + intro ξ hξ η hη s t hs ht' hst + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) (s • ξ+t • η)).re + simp only [inner_add_right, inner_smul_right_eq_smul, Complex.add_re, Complex.smul_re, + smul_eq_mul] + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) ξ).re at hξ + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) η).re at hη + nlinarith [mul_le_mul_of_nonneg_left hξ hs, mul_le_mul_of_nonneg_left hη ht'] + have horbit : baseVector τ '' algebraOrbit (subalgebraUnitaries P) x ⊆ K := by + rintro ξ ⟨a,⟨u,rfl⟩,rfl⟩ + have hsq := pow_le_pow_left₀ (norm_nonneg _) (hn u) 2 + change τ.norm₂ (conjugateLinear u.val x-x)^2 ≤ τ.norm₂ x^2 at hsq + have hid := norm_sub_sq (𝕜 := ℂ) (baseVector τ (conjugateLinear u.val x)) (baseVector τ x) + change τ.norm₂ (conjugateLinear u.val x-x)^2 = τ.norm₂ (conjugateLinear u.val x)^2 - + 2*(inner ℂ (baseVector τ (conjugateLinear u.val x)) (baseVector τ x)).re + τ.norm₂ x^2 at hid + rw [conjugate_norm₂] at hid + have hisym : (inner ℂ (baseVector τ (conjugateLinear u.val x)) (baseVector τ x)).re = + (inner ℂ (baseVector τ x) (baseVector τ (conjugateLinear u.val x))).re := + inner_re_symm (𝕜 := ℂ) _ _ + rw [hisym] at hid + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) (baseVector τ (conjugateLinear u.val x))).re + linarith + have hz : (0 : H) ∈ traceOrbitHull τ (subalgebraUnitaries P) x := by + simpa only [ht, zero_smul, map_zero] using scalar_mem_traceOrbitHull τ P hirr x + have hzero := (closure_minimal (convexHull_min horbit hconv) hclosed) hz + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) 0).re at hzero + rw [inner_zero_right, Complex.zero_re] at hzero + have hpos : 0 < τ.norm₂ x^2 := sq_pos_of_ne_zero (fun he => hx ((τ.norm₂_eq_zero_iff x).mp he)) + linarith + +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) + +theorem pinch_commutes_diagonal (u : M.toStarSubalgebra) (c : Fin Q.size → ℂ) + (hl : ∀ i, u*(Q.piece i).val = c i • (Q.piece i).val) + (hr : ∀ i, (Q.piece i).val*u = c i • (Q.piece i).val) (x : M.toStarSubalgebra) : + u*Q.pinch x = Q.pinch x*u := by + simp only [pinch, Finset.mul_sum, Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + simp only [← mul_assoc, hl] + simp only [mul_assoc, hr, smul_mul_assoc, mul_smul_comm] + +theorem pinch_fixed_of_commutes (u : unitary M.toStarSubalgebra) (x : M.toStarSubalgebra) + (h : (u : M.toStarSubalgebra)*Q.pinch x = Q.pinch x*(u : M.toStarSubalgebra)) : + conjugateLinear u (Q.pinch x) = Q.pinch x := by + change (u : M.toStarSubalgebra)*Q.pinch x*star (u : M.toStarSubalgebra) = _ + rw [h, mul_assoc, u.property.2, mul_one] + +theorem displacement_le_twice_residual (u : unitary M.toStarSubalgebra) + (x : M.toStarSubalgebra) (hfixed : conjugateLinear u (Q.pinch x) = Q.pinch x) : + τ.norm₂ (conjugateLinear u x-x) ≤ 2*τ.norm₂ (x-Q.pinch x) := by + have he : conjugateLinear u x-x = + conjugateLinear u (x-Q.pinch x)-(x-Q.pinch x) := by + rw [map_sub,hfixed] + abel + rw [he] + have h := norm_sub_le (baseVector τ (conjugateLinear u (x-Q.pinch x))) + (baseVector τ (x-Q.pinch x)) + change τ.norm₂ (conjugateLinear u (x-Q.pinch x)-(x-Q.pinch x)) ≤ + τ.norm₂ (conjugateLinear u (x-Q.pinch x)) + τ.norm₂ (x-Q.pinch x) at h + rw [conjugate_norm₂] at h + linarith + +/-- The exact squared displacement bound behind the partition descent. -/ +theorem displacement_energy_bound (u : unitary M.toStarSubalgebra) + (x : M.toStarSubalgebra) (hfixed : conjugateLinear u (Q.pinch x) = Q.pinch x) : + τ.norm₂ (conjugateLinear u x-x)^2 ≤ 4*(τ.norm₂ x^2-τ.norm₂ (Q.pinch x)^2) := by + have h := Q.displacement_le_twice_residual τ u x hfixed + have hp := Q.pinch_pythagoras τ x + nlinarith [show 0 ≤ τ.norm₂ (conjugateLinear u x-x) from norm_nonneg _, + show 0 ≤ τ.norm₂ (x-Q.pinch x) from norm_nonneg _] + +/-- The factor 3/4 in Popa A.1.1, Step 2, for the actual finite spectral +pinching and its displayed displacement estimate. -/ +theorem three_quarters_energy (u : unitary M.toStarSubalgebra) + (x : M.toStarSubalgebra) (hfixed : conjugateLinear u (Q.pinch x) = Q.pinch x) + (hdisplace : τ.norm₂ x ≤ τ.norm₂ (conjugateLinear u x-x)) : + (∑ i, τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2) ≤ (3/4 : ℝ)*τ.norm₂ x^2 := by + rw [← Q.pinch_energy τ] + have h := Q.displacement_energy_bound τ u x hfixed + have hsq := pow_le_pow_left₀ (norm_nonneg _) hdisplace 2 + change τ.norm₂ x^2 ≤ τ.norm₂ (conjugateLinear u x-x)^2 at hsq + nlinarith + +/-! Finite spectral approximation yields an actual energy-decreasing partition. +The displacement premise is explicit; no small-energy partition is assumed. -/ + +theorem spectral_sum_commutes_pinch (c : Fin Q.size → ℂ) (x : M.toStarSubalgebra) : + projectionSum Q.piece c * Q.pinch x = Q.pinch x * projectionSum Q.piece c := by + simp only [projectionSum, Finset.sum_mul, Finset.mul_sum, smul_mul_assoc, + mul_smul_comm, Q.pinch_left, Q.pinch_right] + +theorem commutator_le_residual (v x : M.toStarSubalgebra) + (hc : v*Q.pinch x=Q.pinch x*v) : + τ.norm₂ (v*x-x*v) ≤ 2*‖v‖*τ.norm₂ (x-Q.pinch x) := by + have he : v*x-x*v=v*(x-Q.pinch x)-(x-Q.pinch x)*v := by + simp only [mul_sub,sub_mul] + rw [hc] + abel + rw [he] + have h := norm_sub_le (baseVector τ (v*(x-Q.pinch x))) + (baseVector τ ((x-Q.pinch x)*v)) + change τ.norm₂ (v*(x-Q.pinch x)-(x-Q.pinch x)*v) ≤ + τ.norm₂ (v*(x-Q.pinch x))+τ.norm₂ ((x-Q.pinch x)*v) at h + have hl := τ.norm₂_mul_le v (x-Q.pinch x) + have hr := τ.norm₂_mul_le_right (x-Q.pinch x) v + nlinarith + +end CornerPartition + +theorem commutator_perturbation (u v x : M.toStarSubalgebra) : + τ.norm₂ (u*x-x*u) ≤ τ.norm₂ (v*x-x*v)+2*‖u-v‖*τ.norm₂ x := by + have he : u*x-x*u=(v*x-x*v)+((u-v)*x-x*(u-v)) := by noncomm_ring + rw [he] + have h := τ.norm₂_add_le (v*x-x*v) ((u-v)*x-x*(u-v)) + have h' := norm_sub_le (baseVector τ ((u-v)*x)) (baseVector τ (x*(u-v))) + change τ.norm₂ ((u-v)*x-x*(u-v)) ≤ τ.norm₂ ((u-v)*x)+τ.norm₂ (x*(u-v)) at h' + have hl := τ.norm₂_mul_le (u-v) x + have hr := τ.norm₂_mul_le_right x (u-v) + nlinarith + +theorem displacement_le_commutator (u : unitary M.toStarSubalgebra) + (x : M.toStarSubalgebra) : + τ.norm₂ (conjugateLinear u x-x) ≤ τ.norm₂ ((u : M.toStarSubalgebra)*x-x*(u : M.toStarSubalgebra)) := by + have he : conjugateLinear u x-x= + ((u : M.toStarSubalgebra)*x-x*(u : M.toStarSubalgebra))*star (u : M.toStarSubalgebra) := by + change (u : M.toStarSubalgebra)*x*star (u : M.toStarSubalgebra)-x=_ + rw [sub_mul,mul_assoc x,u.property.2,mul_one] + rw [he] + exact (τ.norm₂_mul_le_right _ _).trans + (mul_le_of_le_one_right (norm_nonneg _) + (unitary_norm_le _ (by simp))) + +/-- Energy decrease from a spectral approximation, with the actual +partition and approximation error exposed. -/ +theorem CornerPartition.energy_descent_of_spectral_approximation + {p : AlgebraProjection M} (Q : CornerPartition p) + (u : unitary M.toStarSubalgebra) (x : M.toStarSubalgebra) (c : Fin Q.size → ℂ) + (hd : τ.norm₂ x ≤ τ.norm₂ (conjugateLinear u x-x)) + (hclose : ‖(u : M.toStarSubalgebra)-∑ i,c i • (Q.piece i).val‖ < 1/4) : + (∑ i,τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2) ≤ + (63/64 : ℝ)*τ.norm₂ x^2 := by + let v := projectionSum Q.piece c + change ‖(u : M.toStarSubalgebra)-v‖ < 1/4 at hclose + have hv : ‖v‖ ≤ 2 := by + have h := norm_sub_le (u : M.toStarSubalgebra) ((u : M.toStarSubalgebra)-v) + rw [sub_sub_cancel] at h + have hu := unitary_norm_le (u : M.toStarSubalgebra) (by simp) + linarith + have he := Q.commutator_le_residual τ v x (Q.spectral_sum_commutes_pinch c x) + have hp := commutator_perturbation τ (u : M.toStarSubalgebra) v x + have hd' := displacement_le_commutator τ u x + have hn : 0 ≤ τ.norm₂ x := norm_nonneg _ + have hr : 0 ≤ τ.norm₂ (x-Q.pinch x) := norm_nonneg _ + have hres : τ.norm₂ x/8 ≤ τ.norm₂ (x-Q.pinch x) := by + have hv' := mul_le_mul_of_nonneg_right hv hr + have hc' := mul_le_mul_of_nonneg_right hclose.le hn + nlinarith + rw [← Q.pinch_energy τ] + have hpy := Q.pinch_pythagoras τ x + nlinarith [sq_nonneg (τ.norm₂ (x-Q.pinch x)-τ.norm₂ x/8)] + +/-- A displaced operator has a genuinely constructed finite partition with +energy at most 63/64 of its original energy. This is one step, not iteration. -/ +theorem exists_partition_energy_descent (u : unitary M.toStarSubalgebra) + (x : M.toStarSubalgebra) + (hd : τ.norm₂ x ≤ τ.norm₂ (conjugateLinear u x-x)) : + ∃ Q : CornerPartition (identityProjection M), + (∑ i, τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2) ≤ + (63/64 : ℝ)*τ.norm₂ x^2 := by + obtain ⟨Q,c,hclose⟩ := exists_unitary_spectral_approximation u (1/4) (by norm_num) + exact ⟨Q,Q.energy_descent_of_spectral_approximation τ u x c hd hclose⟩ + +end + +/-! The one-step energy decrease has pieces in the prescribed von Neumann +subalgebra. Irreducibility supplies the unitary, not an assumed energy budget. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_subalgebra_partition_energy_descent (h : N ≤ M) + (u : unitary M.toStarSubalgebra) (hu : (u : M.toStarSubalgebra).val ∈ N) + (x : M.toStarSubalgebra) (hd : τ.norm₂ x ≤ τ.norm₂ (conjugateLinear u x-x)) : + ∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ N) ∧ + (∑ i,τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2) ≤ + (63/64 : ℝ)*τ.norm₂ x^2 := by + obtain ⟨Q,c,hQ,hc⟩ := exists_unitary_subalgebra_spectral_approximation h u hu (1/4) (by norm_num) + exact ⟨Q,hQ,Q.energy_descent_of_spectral_approximation τ u x c hd hc⟩ + +/-- One actual finite partition decreases every given nonzero centered +operator's energy. This does not assert an arbitrary target budget or permit +iteration through uncentered residual blocks. -/ +theorem exists_irreducible_partition_energy_descent (h : N ≤ M) + (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] + (hP : ∀ a : M.toStarSubalgebra,a ∈ P ↔ a.val ∈ N) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P,(a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (hx : x ≠ 0) (ht : τ.trace x=0) : + ∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val ∈ P) ∧ + (∑ i,τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2) < τ.norm₂ x^2 := by + obtain ⟨u,hu⟩ := exists_strict_centered_displacement τ P hirr x hx ht + obtain ⟨Q,hQ,he⟩ := exists_subalgebra_partition_energy_descent τ h u.val + ((hP _).mp u.property) x hu.le + refine ⟨Q,fun i => (hP _).mpr (hQ i),?_⟩ + have hp : 0 < τ.norm₂ x^2 := sq_pos_of_ne_zero + (fun hz => hx ((τ.norm₂_eq_zero_iff x).mp hz)) + linarith + +end + +/-! Strict displacement from zero in the actual closed convex orbit hull, +without imposing a scalar commutant on a block diagonal algebra. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_strict_displacement_of_zero_orbitHull + (G : Subgroup (unitary M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (hx : x ≠ 0) + (hzero : (0 : H) ∈ traceOrbitHull τ G x) : + ∃ u : G, τ.norm₂ x < τ.norm₂ (conjugateLinear u.val x-x) := by + by_contra hn + push Not at hn + let K : Set H := {ξ | τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) ξ).re} + have hclosed : IsClosed K := isClosed_le continuous_const + (Complex.continuous_re.comp (continuous_const.inner continuous_id)) + have hconv : Convex ℝ K := by + intro ξ hξ η hη s t hs ht' hst + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) (s • ξ+t • η)).re + simp only [inner_add_right, inner_smul_right_eq_smul, Complex.add_re, Complex.smul_re, + smul_eq_mul] + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) ξ).re at hξ + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) η).re at hη + nlinarith [mul_le_mul_of_nonneg_left hξ hs, mul_le_mul_of_nonneg_left hη ht'] + have horbit : baseVector τ '' algebraOrbit G x ⊆ K := by + rintro ξ ⟨a,⟨u,rfl⟩,rfl⟩ + have hsq := pow_le_pow_left₀ (norm_nonneg _) (hn u) 2 + change τ.norm₂ (conjugateLinear u.val x-x)^2 ≤ τ.norm₂ x^2 at hsq + have hid := norm_sub_sq (𝕜 := ℂ) (baseVector τ (conjugateLinear u.val x)) (baseVector τ x) + change τ.norm₂ (conjugateLinear u.val x-x)^2 = τ.norm₂ (conjugateLinear u.val x)^2 - + 2*(inner ℂ (baseVector τ (conjugateLinear u.val x)) (baseVector τ x)).re + τ.norm₂ x^2 at hid + rw [conjugate_norm₂] at hid + have hisym : (inner ℂ (baseVector τ (conjugateLinear u.val x)) (baseVector τ x)).re = + (inner ℂ (baseVector τ x) (baseVector τ (conjugateLinear u.val x))).re := + inner_re_symm (𝕜 := ℂ) _ _ + rw [hisym] at hid + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) (baseVector τ (conjugateLinear u.val x))).re + linarith + have hzero := (closure_minimal (convexHull_min horbit hconv) hclosed) hzero + change τ.norm₂ x^2/2 ≤ (inner ℂ (baseVector τ x) 0).re at hzero + rw [inner_zero_right, Complex.zero_re] at hzero + have hpos : 0 < τ.norm₂ x^2 := sq_pos_of_ne_zero (fun he => hx ((τ.norm₂_eq_zero_iff x).mp he)) + linarith + +end + +/-! Actual compatible 63/64 descent for the orthogonal component of Popa +A.1.1 in an irreducible inclusion. Both displacement and finite spectral +partitions are constructed, and all pieces remain in the prescribed N. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace CornerPartition +variable (Q : CornerPartition (identityProjection M)) + +theorem exists_compatible_orthogonal_descent (hNM : N ≤ M) + (hN : ∀ i,(Q.piece i).val.val ∈ N) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (hx : TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) x) : + ∃ R : CornerPartition (identityProjection M), Q.Refines R ∧ + (∀ i,(R.piece i).val.val ∈ N) ∧ + τ.norm₂ (R.pinch x)^2 ≤ (63/64 : ℝ)*τ.norm₂ (Q.pinch x)^2 := by + by_cases hz : Q.pinch x=0 + · refine ⟨Q,Q.refines_refl,hN,?_⟩ + rw [hz] + change ‖(0 : H)‖^2 ≤ (63/64 : ℝ)*‖(0 : H)‖^2 + simp + let B := Q.blockVonNeumann N + let P := insideAlgebra (M := M) (P := N) + let D := insideAlgebra (M := M) (P := B) + have hDP : ∀ a : M.toStarSubalgebra,a ∈ D → a ∈ P := + fun a ha => (Q.blockVonNeumann_le N) ha + have hzero : (0 : H) ∈ traceOrbitHull τ (subalgebraUnitaries D) (Q.pinch x) := by + apply zero_mem_orbitHull_of_orthogonal τ P (subalgebraUnitaries D) + (fun u => hDP _ u.property) + · intro c hc + exact Q.block_commutant_mem_subalgebra τ hN hirr c + (commutes_of_fixed_unitaries D c hc) + · exact hx.pinch τ Q hN + obtain ⟨u,hu⟩ := exists_strict_displacement_of_zero_orbitHull τ + (subalgebraUnitaries D) (Q.pinch x) hz hzero + obtain ⟨S,hS,he⟩ := exists_subalgebra_partition_energy_descent τ + ((Q.blockVonNeumann_le N).trans hNM) u.val u.property (Q.pinch x) hu.le + have hcross (i : Fin Q.size) (j : Fin S.size) : + Commute (Q.piece i).val (S.piece j).val := + ((Q.blockVonNeumann_mem_iff N _).mp (hS j)).2 i + let R := Q.joint S hcross + have hQR : Q.Refines R := Q.joint_refines_left S hcross + have hSR : S.Refines R := Q.joint_refines_right S hcross + refine ⟨R,hQR,?_,?_⟩ + · intro i + let a := (Fintype.equivFin (Fin Q.size × Fin S.size)).symm i + change ((Q.piece a.1).val*(S.piece a.2).val).val ∈ N + exact N.mul_mem (hN a.1) ((Q.blockVonNeumann_le N) (hS a.2)) + · have hh := S.refinement_energy_le τ R hSR (Q.pinch x) + rw [← R.pinch_energy τ,← S.pinch_energy τ,Q.pinch_refinement R hQR] at hh + rw [← S.pinch_energy τ] at he + exact hh.trans he + +end CornerPartition + +end + +/-! Geometric iteration and finite-family small-energy partitions for the +orthogonal component. No energy budget or block displacement is assumed. -/ +section +open scoped BigOperators Topology +open Filter +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace CornerPartition +variable (hNM : N ≤ M) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +include hNM hirr + +theorem exists_orthogonal_geometric_refinement + (Q : CornerPartition (identityProjection M)) + (hN : ∀ i,(Q.piece i).val.val ∈ N) + (x : M.toStarSubalgebra) (hx : TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) x) + (n : ℕ) : + ∃ R : CornerPartition (identityProjection M), Q.Refines R ∧ + (∀ i,(R.piece i).val.val ∈ N) ∧ + τ.norm₂ (R.pinch x)^2 ≤ (63/64 : ℝ)^n*τ.norm₂ (Q.pinch x)^2 := by + induction n with + | zero => exact ⟨Q,Q.refines_refl,hN,by simp⟩ + | succ n ih => + obtain ⟨R,hQR,hR,hE⟩ := ih + obtain ⟨S,hRS,hS,hSenergy⟩ := R.exists_compatible_orthogonal_descent τ hNM hR hirr x hx + refine ⟨S,Q.refines_trans hQR hRS,hS,?_⟩ + calc τ.norm₂ (S.pinch x)^2 ≤ (63/64 : ℝ)*τ.norm₂ (R.pinch x)^2 := hSenergy + _ ≤ (63/64 : ℝ)*((63/64 : ℝ)^n*τ.norm₂ (Q.pinch x)^2) := + mul_le_mul_of_nonneg_left hE (by norm_num) + _ = (63/64 : ℝ)^(n+1)*τ.norm₂ (Q.pinch x)^2 := by ring + +theorem exists_orthogonal_refinement_budget + (Q : CornerPartition (identityProjection M)) + (hN : ∀ i,(Q.piece i).val.val ∈ N) + (x : M.toStarSubalgebra) (hx : TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) x) + (b : ℝ) (hb : 0 < b) : + ∃ R : CornerPartition (identityProjection M), Q.Refines R ∧ + (∀ i,(R.piece i).val.val ∈ N) ∧ τ.norm₂ (R.pinch x)^2 < b := by + have ht : Tendsto (fun n : ℕ => (63/64 : ℝ)^n*τ.norm₂ (Q.pinch x)^2) atTop (𝓝 0) := by + simpa only [zero_mul] using + (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0 : ℝ) ≤ 63/64) + (by norm_num : (63/64 : ℝ) < 1)).mul_const (τ.norm₂ (Q.pinch x)^2) + obtain ⟨n,hn⟩ := (ht.eventually (Iio_mem_nhds hb)).exists + obtain ⟨R,hQR,hR,hE⟩ := exists_orthogonal_geometric_refinement τ hNM hirr Q hN x hx n + exact ⟨R,hQR,hR,hE.trans_lt hn⟩ + +/-- One actual finite compatible partition gives an arbitrarily small SUM +of energies for the whole finite orthogonal family. -/ +theorem exists_finite_orthogonal_refinement_budget + (Q : CornerPartition (identityProjection M)) + (hN : ∀ i,(Q.piece i).val.val ∈ N) + (F : Finset M.toStarSubalgebra) + (hF : ∀ x ∈ F,TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) x) + (b : ℝ) (hb : 0 < b) : + ∃ R : CornerPartition (identityProjection M), Q.Refines R ∧ + (∀ i,(R.piece i).val.val ∈ N) ∧ (∑ x ∈ F,τ.norm₂ (R.pinch x)^2) < b := by + classical + induction F using Finset.induction_on generalizing Q b with + | empty => exact ⟨Q,Q.refines_refl,hN,by simpa using hb⟩ + | @insert x F hxF ih => + obtain ⟨R,hQR,hR,hx⟩ := exists_orthogonal_refinement_budget τ hNM hirr Q hN x + (hF x (Finset.mem_insert_self x F)) (b/2) (half_pos hb) + obtain ⟨S,hRS,hS,hFS⟩ := ih R hR + (fun y hy => hF y (Finset.mem_insert_of_mem hy)) (b/2) (half_pos hb) + refine ⟨S,Q.refines_trans hQR hRS,hS,?_⟩ + have hxS := R.refinement_energy_le τ S hRS x + rw [← R.pinch_energy τ,← S.pinch_energy τ] at hxS + rw [Finset.sum_insert hxF] + linarith + +theorem exists_indexed_orthogonal_refinement_budget + (Q : CornerPartition (identityProjection M)) + (hN : ∀ i,(Q.piece i).val.val ∈ N) + {ι : Type*} (F : Finset ι) (v : ι → M.toStarSubalgebra) + (hF : ∀ x ∈ F,TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) (v x)) + (b : ℝ) (hb : 0 < b) : + ∃ R : CornerPartition (identityProjection M), Q.Refines R ∧ + (∀ i,(R.piece i).val.val ∈ N) ∧ (∑ x ∈ F,τ.norm₂ (R.pinch (v x))^2) < b := by + classical + induction F using Finset.induction_on generalizing Q b with + | empty => exact ⟨Q,Q.refines_refl,hN,by simpa using hb⟩ + | @insert x F hxF ih => + obtain ⟨R,hQR,hR,hx⟩ := exists_orthogonal_refinement_budget τ hNM hirr Q hN (v x) + (hF x (Finset.mem_insert_self x F)) (b/2) (half_pos hb) + obtain ⟨S,hRS,hS,hFS⟩ := ih R hR + (fun y hy => hF y (Finset.mem_insert_of_mem hy)) (b/2) (half_pos hb) + refine ⟨S,Q.refines_trans hQR hRS,hS,?_⟩ + have hxS := R.refinement_energy_le τ S hRS (v x) + rw [← R.pinch_energy τ,← S.pinch_energy τ] at hxS + rw [Finset.sum_insert hxF] + linarith + +end CornerPartition + +end + +/-! Assembly of the orthogonal budget with an explicitly controlled +subalgebra component. This constructs the further refinement; constructing +the initial subalgebra-component budget is not asserted here. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- Any previously established coarse component budget survives the actual +finite-family quantization of the orthogonal residual. -/ +theorem exists_component_controlled_refinement (hNM : N ≤ M) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (Q : CornerPartition (identityProjection M)) + (hQ : ∀ i,(Q.piece i).val.val ∈ N) + {ι : Type*} (F : Finset ι) (x y : ι → M.toStarSubalgebra) + (hy : ∀ i ∈ F,(y i).val ∈ N) + (hxy : ∀ i ∈ F,TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) (x i-y i)) + (b η : ℝ) (hη : 0 < η) (hb : (∑ i ∈ F,τ.norm₂ (Q.pinch (y i))^2) ≤ b) : + ∃ R : CornerPartition (identityProjection M),Q.Refines R ∧ + (∀ i,(R.piece i).val.val ∈ N) ∧ + (∑ i ∈ F,τ.norm₂ (R.pinch (x i))^2) < b+η ∧ + ∀ i ∈ F,R.scalarEnergy τ (x i) ≤ τ.norm₂ (Q.pinch (y i))^2 := by + obtain ⟨R,hQR,hR,hE⟩ := CornerPartition.exists_indexed_orthogonal_refinement_budget τ hNM hirr + Q hQ F (fun i => x i-y i) hxy η hη + refine ⟨R,hQR,hR,?_,fun i hi => Q.refinement_scalarEnergy_le_component τ + (insideAlgebra (M := M) (P := N)) R hR hQR (x i) (y i) (hxy i hi)⟩ + have hid : (∑ i ∈ F,τ.norm₂ (R.pinch (x i))^2)= + (∑ i ∈ F,τ.norm₂ (R.pinch (x i-y i))^2)+(∑ i ∈ F,τ.norm₂ (R.pinch (y i))^2) := by + rw [← Finset.sum_add_distrib] + exact Finset.sum_congr rfl (fun i hi => R.orthogonal_component_energy τ + (insideAlgebra (M := M) (P := N)) hR (x i) (y i) (hy i hi) (hxy i hi)) + have hcomp : (∑ i ∈ F,τ.norm₂ (R.pinch (y i))^2) ≤ + ∑ i ∈ F,τ.norm₂ (Q.pinch (y i))^2 := by + apply Finset.sum_le_sum + intro i hi + have h := Q.refinement_energy_le τ R hQR (y i) + rwa [← Q.pinch_energy τ,← R.pinch_energy τ] at h + rw [hid] + linarith + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Expectations.lean b/lean/OAI/Analysis/FactorGeneration/Expectations.lean new file mode 100644 index 0000000000000000000000000000000000000000..753f3aa0c8d7e3832985bf3298b44b94299ed977 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Expectations.lean @@ -0,0 +1,533 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Range +import OAI.Analysis.FactorGeneration.SpectralTruncation +import OAI.Analysis.FactorGeneration.Subfactors + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! The orthogonal subalgebra representative of a self-adjoint ambient +operator is constructed, with its operator norm bound. -/ +section +open scoped ComplexStarModule +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem selfAdjoint_pairing_im (τ : TracialRepresentation M) + (a b : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (hb : IsSelfAdjoint b) : + (τ.trace (a*b)).im=0 := by + apply Complex.conj_eq_iff_im.mp + have hi := inner_conj_symm (𝕜 := ℂ) (baseVector τ a) (baseVector τ b) + rw [baseVector_inner_trace,baseVector_inner_trace,ha.star_eq,hb.star_eq] at hi + simpa only [τ.trace_mul_comm b a] using hi + +theorem exists_selfAdjoint_expectation (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + ∃ c : N.toStarSubalgebra, IsSelfAdjoint c ∧ ‖c‖ ≤ ‖x‖ ∧ + TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) (x-coordinateInclusion hNM c) := by + obtain ⟨c,hc,hcR,hmin,hvar⟩ := exists_selfAdjoint_ball_variational τ hNM x (‖x‖+1) + (by positivity) + have hcn := selfAdjoint_ball_minimum_norm τ hNM x hx (‖x‖+1) c hc hcR hmin + let r := x-coordinateInclusion hNM c + have hr : IsSelfAdjoint r := hx.sub (included_selfAdjoint hNM c hc) + have hreal (a : N.toStarSubalgebra) (ha : IsSelfAdjoint a) : + (τ.trace (coordinateInclusion hNM a*r)).re=0 := by + let t : ℝ := 1/(‖a‖+1) + have ht : 0 t⁻) hc + +theorem conditionalExpectation_nonneg (hNM : N ≤ M) (x : M.toStarSubalgebra) (hx : 0 ≤ x) : + 0 ≤ conditionalExpectation τ hNM x := by + let c := conditionalExpectation τ hNM x + have hc : IsSelfAdjoint c := (conditionalExpectation_selfAdjoint τ hNM x hx.isSelfAdjoint).1 + have hd := CFC.negPart_nonneg c + have hmem := negPart_mem_inside c (conditionalExpectation_mem τ hNM x) + have ho := conditionalExpectation_orthogonal τ hNM x ⟨c⁻,hmem⟩ + change τ.trace (c⁻*(x-c))=0 at ho + rw [mul_sub,trace_sub,sub_eq_zero] at ho + have hprod : c⁻*c= -(c⁻*c⁻) := by + nth_rw 2 [← CFC.posPart_sub_negPart c hc] + rw [mul_sub,CFC.negPart_mul_posPart,zero_sub] + have hp := trace_mul_nonneg τ c⁻ x hd hx + rw [ho,hprod] at hp + have htrace : τ.trace (-(c⁻*c⁻))= -τ.trace (c⁻*c⁻) := map_neg (coordinateTraceLinear τ) _ + have hsq : (τ.trace (c⁻*c⁻)).re=τ.norm₂ c⁻^2 := by + rw [norm₂_sq_trace τ,hd.isSelfAdjoint.star_eq] + rw [htrace,Complex.neg_re,hsq] at hp + have hz := (τ.norm₂_eq_zero_iff c⁻).mp (sq_eq_zero_iff.mp (by nlinarith [sq_nonneg (τ.norm₂ c⁻)])) + exact (CFC.negPart_eq_zero_iff c hc).mp hz + +theorem conditionalExpectation_mono (hNM : N ≤ M) (x y : M.toStarSubalgebra) (hxy : x ≤ y) : + conditionalExpectation τ hNM x ≤ conditionalExpectation τ hNM y := by + have h := conditionalExpectation_nonneg τ hNM (y-x) (sub_nonneg.mpr hxy) + change 0 ≤ conditionalExpectationCLM τ hNM (y-x) at h + rw [map_sub] at h + exact sub_nonneg.mp h + +end + +/-! The constructed expectation satisfies the Schwarz inequality and is +contractive in operator norm. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +local instance expectationContractiveCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance expectationContractiveOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance expectationContractivePreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance expectationContractiveLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance expectationContractiveStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem conditionalExpectation_schwarz (hNM : N ≤ M) (x : M.toStarSubalgebra) : + star (conditionalExpectation τ hNM x)*conditionalExpectation τ hNM x ≤ + conditionalExpectation τ hNM (star x*x) := by + let y := conditionalExpectation τ hNM x + have hy : y.val ∈ N := conditionalExpectation_mem τ hNM x + have hys : (star y).val ∈ N := star_mem hy + have hp := conditionalExpectation_nonneg τ hNM (star (x-y)*(x-y)) (star_mul_self_nonneg _) + have he : conditionalExpectation τ hNM (star (x-y)*(x-y))= + conditionalExpectation τ hNM (star x*x)-star y*y := by + simp only [star_sub,sub_mul,mul_sub] + change conditionalExpectationCLM τ hNM _= _ + rw [map_sub,map_sub,map_sub] + change conditionalExpectation τ hNM (star x*x)-conditionalExpectation τ hNM (star y*x)- + (conditionalExpectation τ hNM (star x*y)-conditionalExpectation τ hNM (star y*y))= _ + rw [conditionalExpectation_mul_right τ hNM y (star x) hy, + conditionalExpectation_star τ hNM, + conditionalExpectation_mul_left τ hNM (star y) x hys, + conditionalExpectation_fixed τ hNM (star y*y) (N.mul_mem hys hy)] + change conditionalExpectation τ hNM (star x*x)-star y*y-(star y*y-star y*y)= + conditionalExpectation τ hNM (star x*x)-star y*y + abel + rw [he] at hp + exact sub_nonneg.mp hp + +theorem conditionalExpectation_norm_le (hNM : N ≤ M) (x : M.toStarSubalgebra) : + ‖conditionalExpectation τ hNM x‖ ≤ ‖x‖ := by + have h := CStarAlgebra.norm_le_norm_of_le_of_nonneg + (conditionalExpectation_schwarz τ hNM x) (star_mul_self_nonneg (conditionalExpectation τ hNM x)) + have hn := (conditionalExpectation_selfAdjoint τ hNM (star x*x) + (star_mul_self_nonneg x).isSelfAdjoint).2 + rw [CStarRing.norm_star_mul_self] at h hn + nlinarith [norm_nonneg x,norm_nonneg (conditionalExpectation τ hNM x)] + +theorem conditionalExpectation_opNorm_le (hNM : N ≤ M) : + ‖conditionalExpectationCLM τ hNM‖ ≤ 1 := by + apply (conditionalExpectationCLM τ hNM).opNorm_le_bound (by norm_num : (0 : ℝ) ≤ 1) + intro x + change ‖conditionalExpectation τ hNM x‖ ≤ 1*‖x‖ + rw [one_mul] + exact conditionalExpectation_norm_le τ hNM x + +theorem conditionalExpectation_idempotent (hNM : N ≤ M) (x : M.toStarSubalgebra) : + conditionalExpectation τ hNM (conditionalExpectation τ hNM x)=conditionalExpectation τ hNM x := + conditionalExpectation_fixed τ hNM _ (conditionalExpectation_mem τ hNM x) + +end + +/-! Actual nested subalgebras satisfy the expectation tower identity. +The resulting energy identity is the decreasing-subfactor step of A.1.2. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N P M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem conditionalExpectation_tower (hNM : N ≤ M) (hPM : P ≤ M) (hNP : N ≤ P) + (x : M.toStarSubalgebra) : + conditionalExpectation τ hNM (conditionalExpectation τ hPM x)=conditionalExpectation τ hNM x := by + apply conditionalExpectation_eq_of_orthogonal τ hNM + · exact conditionalExpectation_mem τ hNM x + · have hP : TraceOrthogonal τ (insideAlgebra (M := M) (P := N)) + (x-conditionalExpectation τ hPM x) := by + intro a + exact conditionalExpectation_orthogonal τ hPM x + ⟨(a : M.toStarSubalgebra),hNP a.property⟩ + have h := (conditionalExpectation_orthogonal τ hNM x).sub τ hP + convert h using 1 + abel + +theorem conditionalExpectation_nested_energy (hNM : N ≤ M) (hPM : P ≤ M) (hNP : N ≤ P) + (x : M.toStarSubalgebra) : + τ.norm₂ (conditionalExpectation τ hNM x)^2+ + τ.norm₂ (conditionalExpectation τ hPM x-conditionalExpectation τ hNM x)^2= + τ.norm₂ (conditionalExpectation τ hPM x)^2 := by + have h := conditionalExpectation_pythagoras τ hNM (conditionalExpectation τ hPM x) + rwa [conditionalExpectation_tower τ hNM hPM hNP x] at h + +theorem conditionalExpectation_nested_norm₂ (hNM : N ≤ M) (hPM : P ≤ M) (hNP : N ≤ P) + (x : M.toStarSubalgebra) : + τ.norm₂ (conditionalExpectation τ hNM x) ≤ τ.norm₂ (conditionalExpectation τ hPM x) := by + rw [← conditionalExpectation_tower τ hNM hPM hNP x] + exact conditionalExpectation_norm₂_le τ hNM _ + +end + +/-! Conditional expectations onto a decreasing sequence of actual +subalgebras converge in L2. This supplies the limiting argument in A.1.2; +it does not construct that source's decreasing subfactors. -/ +open Filter +open scoped Topology BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem bounded_trace_limit_inside (hNM : N ≤ M) (a : ℕ → M.toStarSubalgebra) + (C : ℝ) (hC : 0 ≤ C) (ha : ∀ n,‖a n‖ ≤ C) + (hN : ∀ᶠ n in atTop,(a n).val ∈ N) (ξ : H) + (hξ : Tendsto (fun n => baseVector τ (a n)) atTop (𝓝 ξ)) : + ∃ b : M.toStarSubalgebra,b.val ∈ N ∧ ‖b‖ ≤ C ∧ baseVector τ b=ξ := by + classical + let aN : ℕ → N.toStarSubalgebra := fun n => if h : (a n).val ∈ N then ⟨(a n).val,h⟩ else 0 + have hb : ∀ n,‖aN n‖ ≤ C := by + intro n + dsimp [aN] + split_ifs with h + · exact ha n + · change ‖(0 : H →L[ℂ] H)‖ ≤ C + simpa only [norm_zero] using hC + have he : ∀ᶠ n in atTop,baseVector (restrictedTrace τ hNM) (aN n)=baseVector τ (a n) := by + filter_upwards [hN] with n hn + simp only [aN,dite_eq_left hn] + rfl + obtain ⟨b,hb,hbe⟩ := bounded_trace_limit (restrictedTrace τ hNM) aN C hC hb ξ + (hξ.congr' (by filter_upwards [he] with n hn; exact hn.symm)) + exact ⟨coordinateInclusion hNM b,b.property,hb,hbe⟩ + +theorem decreasing_expectations_converge (A : ℕ → VonNeumannAlgebra H) + (hAM : ∀ n,A n ≤ M) (hA : Antitone A) (x : M.toStarSubalgebra) : + ∃ c : M.toStarSubalgebra,(∀ n,c.val ∈ A n) ∧ ‖c‖ ≤ ‖x‖ ∧ τ.trace c=τ.trace x ∧ + Tendsto (fun n => τ.norm₂ (conditionalExpectation τ (hAM n) x-c)) atTop (𝓝 0) := by + let e : ℕ → M.toStarSubalgebra := fun n => conditionalExpectation τ (hAM n) x + let f : ℕ → ℝ := fun n => τ.norm₂ (e n)^2 + have hf : Antitone f := by + intro m n hmn + have h := conditionalExpectation_nested_energy τ (hAM n) (hAM m) (hA hmn) x + change f n+τ.norm₂ (e m-e n)^2=f m at h + linarith [sq_nonneg (τ.norm₂ (e m-e n))] + have hft : Tendsto f atTop (𝓝 (⨅ n,f n)) := tendsto_atTop_ciInf hf + ⟨0,by rintro _ ⟨n,rfl⟩; exact sq_nonneg _⟩ + have hfc := hft.cauchySeq + have hcv : CauchySeq (fun n => baseVector τ (e n)) := by + rw [Metric.cauchySeq_iff] at hfc ⊢ + intro ε hε + obtain ⟨k,hk⟩ := hfc (ε^2) (sq_pos_of_pos hε) + have hb (m n : ℕ) (hm : k ≤ m) (hn : k ≤ n) (hmn : m ≤ n) : + dist (baseVector τ (e m)) (baseVector τ (e n)) < ε := by + have hdist := hk m hm n hn + have hid := conditionalExpectation_nested_energy τ (hAM n) (hAM m) (hA hmn) x + change f n+τ.norm₂ (e m-e n)^2=f m at hid + rw [Real.dist_eq] at hdist + rw [dist_eq_norm,← map_sub] + change τ.norm₂ (e m-e n)<ε + nlinarith [le_abs_self (f m-f n),show 0 ≤ τ.norm₂ (e m-e n) from norm_nonneg _] + refine ⟨k,fun m hm n hn => ?_⟩ + rcases le_total m n with h | h + · exact hb m n hm hn h + · simpa only [dist_comm] using hb n m hn hm h + obtain ⟨ξ,hξ⟩ := cauchySeq_tendsto_of_complete hcv + obtain ⟨c,hcn,hcξ⟩ := bounded_trace_limit τ e ‖x‖ (norm_nonneg x) + (fun n => conditionalExpectation_norm_le τ (hAM n) x) ξ hξ + have hcN (n : ℕ) : c.val ∈ A n := by + have hmem : ∀ᶠ k in atTop,(e k).val ∈ A n := by + filter_upwards [eventually_ge_atTop n] with k hk + exact hA hk (conditionalExpectation_mem τ (hAM k) x) + obtain ⟨b,hb,_,hbξ⟩ := bounded_trace_limit_inside τ (hAM n) e ‖x‖ (norm_nonneg _) + (fun k => conditionalExpectation_norm_le τ (hAM k) x) hmem ξ hξ + have he : c=b := baseVector_injective τ (hcξ.trans hbξ.symm) + rw [he] + exact hb + have hlim : Tendsto (fun n => τ.norm₂ (e n-c)) atTop (𝓝 0) := + (tendsto_vector_iff_norm₂ τ atTop e c).mp (by rw [hcξ]; exact hξ) + refine ⟨c,hcN,hcn,?_,hlim⟩ + have ht := norm₂_limit_trace τ e c hlim + have he : ∀ n,τ.trace (e n)=τ.trace x := fun n => conditionalExpectation_trace τ (hAM n) x + simp only [he] at ht + exact tendsto_nhds_unique ht tendsto_const_nhds + +theorem decreasing_expectations_scalar_limit (A : ℕ → VonNeumannAlgebra H) + (hAM : ∀ n,A n ≤ M) (hA : Antitone A) + (hscalar : ∀ c : M.toStarSubalgebra,(∀ n,c.val ∈ A n) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) (x : M.toStarSubalgebra) : + Tendsto (fun n => τ.norm₂ (conditionalExpectation τ (hAM n) x- + τ.trace x • (1 : M.toStarSubalgebra))) atTop (𝓝 0) := by + obtain ⟨c,hc,_,htrace,hlim⟩ := decreasing_expectations_converge τ A hAM hA x + obtain ⟨z,hz⟩ := hscalar c hc + rw [hz,cornerTrace_smul,τ.trace_one,mul_one] at htrace + simpa only [hz,htrace] using hlim + +theorem decreasing_expectations_finite_centered_budget (A : ℕ → VonNeumannAlgebra H) + (hAM : ∀ n,A n ≤ M) (hA : Antitone A) + (hscalar : ∀ c : M.toStarSubalgebra,(∀ n,c.val ∈ A n) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ n,(∑ i ∈ F,τ.norm₂ (conditionalExpectation τ (hAM n) (x i))^2) < ε := by + have hi (i : ι) (hi : i ∈ F) : + Tendsto (fun n => τ.norm₂ (conditionalExpectation τ (hAM n) (x i))^2) atTop (𝓝 0) := by + have h := decreasing_expectations_scalar_limit τ A hAM hA hscalar (x i) + rw [hx i hi] at h + simpa only [zero_smul,sub_zero,zero_pow (by decide : 2 ≠ 0)] using h.pow 2 + have ht : Tendsto (fun n => ∑ i ∈ F,τ.norm₂ (conditionalExpectation τ (hAM n) (x i))^2) + atTop (𝓝 0) := by + simpa only [Finset.sum_const_zero] using tendsto_finsetSum F hi + exact (ht.eventually (gt_mem_nhds hε)).exists + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Exponential.lean b/lean/OAI/Analysis/FactorGeneration/Exponential.lean new file mode 100644 index 0000000000000000000000000000000000000000..7e4c9478d26bfa908da6bbd8e5328305d48ab173 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Exponential.lean @@ -0,0 +1,104 @@ +import Mathlib.Analysis.Normed.Algebra.Exponential +import Mathlib.Analysis.Normed.Group.InfiniteSum +import Mathlib.Analysis.Normed.Ring.InfiniteSum +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace Generator + +/-! The homogeneous expansion of an ordered exponential product, +with factorial weights and multiplication order retained. -/ +noncomputable section +open scoped BigOperators +section Algebra +variable {R : Type*} [Ring R] [Algebra ℝ R] + +def exponentialDegree : List R → ℕ → R + | [], d => if d = 0 then 1 else 0 + | a :: as, d => ∑ k ∈ Finset.range (d + 1), + ((k.factorial : ℝ)⁻¹ • a ^ k) * exponentialDegree as (d - k) + +@[simp] theorem exponentialDegree_zero (xs : List R) : exponentialDegree xs 0 = 1 := by + induction xs with + | nil => simp [exponentialDegree] + | cons a as ih => simp [exponentialDegree, ih] + +@[simp] theorem exponentialDegree_one (xs : List R) : exponentialDegree xs 1 = xs.sum := by + induction xs with + | nil => simp [exponentialDegree] + | cons a as ih => + simp [exponentialDegree, Finset.sum_range_succ, ih, add_comm] + +/-- Transport the finite original-degree polynomial through an algebra map. -/ +theorem exponentialDegree_map {S : Type*} [Ring S] [Algebra ℝ S] + (φ : R →ₐ[ℝ] S) (xs : List R) (d : ℕ) : + φ (exponentialDegree xs d) = exponentialDegree (xs.map φ) d := by + induction xs generalizing d with + | nil => by_cases hd : d = 0 <;> simp [exponentialDegree, hd] + | cons a as ih => simp [exponentialDegree, ih] + +end Algebra + +variable {R : Type*} [NormedRing R] [NormedAlgebra ℝ R] + +/-- Absolute convergence for fixed row count. This is not the uniform bound. -/ +theorem exponentialDegree_summable_norm (xs : List R) : + Summable (fun d => ‖exponentialDegree xs d‖) := by + induction xs with + | nil => + have he : (fun d => ‖exponentialDegree ([] : List R) d‖) = + (fun d : ℕ => if d = 0 then ‖(1 : R)‖ else 0) := by + funext d + by_cases hd : d = 0 <;> simp [exponentialDegree, hd] + rw [he] + exact (hasSum_ite_eq (0 : ℕ) ‖(1 : R)‖).summable + | cons a as ih => + exact summable_norm_sum_mul_range_of_summable_norm + (NormedSpace.norm_expSeries_summable' (𝕂 := ℝ) a) ih + +variable [CompleteSpace R] + +/-- The series sums to the ordered product, without requiring commuting rows. -/ +theorem exponentialDegree_hasSum (xs : List R) : + HasSum (exponentialDegree xs) ((xs.map NormedSpace.exp).prod) := by + induction xs with + | nil => simpa [exponentialDegree] using (hasSum_ite_eq (0 : ℕ) (1 : R)) + | cons a as ih => + have h := hasSum_sum_range_mul_of_summable_norm + (NormedSpace.norm_expSeries_summable' (𝕂 := ℝ) a) + (exponentialDegree_summable_norm as) + rw [(NormedSpace.exp_series_hasSum_exp' (𝕂 := ℝ) a).tsum_eq, ih.tsum_eq] at h + exact h + +end + +/-! Summation of homogeneous-degree remainder bounds, given the expansion and its coefficient estimates. -/ +variable {E : Type*} [NormedAddCommGroup E] + +theorem geometric_second_order_remainder {q : ℝ} (hq0 : 0 ≤ q) (hq1 : q < 1) + (f : ℕ → E) {S : E} (hs : HasSum f S) + (hb : ∀ n : ℕ, ‖f (n + 2)‖ ≤ q ^ (n + 2)) : + ‖S - f 0 - f 1‖ ≤ q ^ 2 / (1 - q) := by + have hg : HasSum (fun n : ℕ => q ^ (n + 2)) (q ^ 2 / (1 - q)) := by + simpa only [pow_add, div_eq_mul_inv, mul_comm] using + (hasSum_geometric_of_lt_one hq0 hq1).mul_right (q ^ 2) + have ht : HasSum (fun n : ℕ => f (n + 2)) (S - f 0 - f 1) := by + simpa [Finset.sum_range_succ, sub_add_eq_sub_sub] using (hasSum_nat_add_iff' 2).mpr hs + exact ht.norm_le_of_bounded hg hb + +/-- The source's 4α²/(1−2α) expression, with precisely 0 < α < 1/2. -/ +theorem perturbation_remainder_from_degree_bounds {α : ℝ} (hα : 0 < α) (hhalf : α < 1 / 2) + (f : ℕ → E) {S : E} (hs : HasSum f S) + (hb : ∀ n : ℕ, ‖f (n + 2)‖ ≤ (2 * α) ^ (n + 2)) : + ‖S - f 0 - f 1‖ ≤ 4 * α ^ 2 / (1 - 2 * α) := by + have h := geometric_second_order_remainder (by linarith : 0 ≤ 2 * α) + (by linarith : 2 * α < 1) f hs hb + convert h using 1 + ring + +end Generator + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/FiniteComparison.lean b/lean/OAI/Analysis/FactorGeneration/FiniteComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2948a2d73cae237a87404b1b8ff2b46a8d89217 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/FiniteComparison.lean @@ -0,0 +1,715 @@ +import OAI.Analysis.FactorGeneration.ProjectionComparison + +namespace OAI + +noncomputable section + +namespace Generator + +/-! The closed span of algebra translates of a projection range gives its +central support. All operators act on the original Hilbert space; no trace, +cyclic vector, separability, finiteness, or comparison theorem is assumed. -/ +namespace Tracial + +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def projectionOrbitVectors (p : AlgebraProjection M) : Set H := + {y | ∃ a : M.toStarSubalgebra, ∃ x : H, y=a.val (p.val.val x)} + +def projectionOrbitClosure (p : AlgebraProjection M) : Submodule ℂ H := + (Submodule.span ℂ (projectionOrbitVectors p)).topologicalClosure + +instance projectionOrbitClosure_complete (p : AlgebraProjection M) : + CompleteSpace (projectionOrbitClosure p) := + inferInstanceAs (CompleteSpace (Submodule.span ℂ (projectionOrbitVectors p)).topologicalClosure) + +theorem projectionOrbitClosure_invariant_of_vectors (p : AlgebraProjection M) + (T : H →L[ℂ] H) + (hT : ∀ y ∈ projectionOrbitVectors p, T y ∈ projectionOrbitVectors p) : + ∀ y ∈ projectionOrbitClosure p, T y ∈ projectionOrbitClosure p := by + have h : projectionOrbitClosure p ≤ (projectionOrbitClosure p).comap T.toLinearMap := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + intro y hy + exact Submodule.le_topologicalClosure _ (Submodule.subset_span (hT y hy)) + · exact (Submodule.isClosed_topologicalClosure _).preimage T.continuous + exact fun y hy => h hy + +theorem projectionOrbitClosure_invariant (p : AlgebraProjection M) (a : M.toStarSubalgebra) : + ∀ y ∈ projectionOrbitClosure p, a.val y ∈ projectionOrbitClosure p := by + apply projectionOrbitClosure_invariant_of_vectors + rintro y ⟨b,x,rfl⟩ + exact ⟨a*b,x,rfl⟩ + +theorem projectionOrbitClosure_commutant_invariant (p : AlgebraProjection M) + (T : H →L[ℂ] H) (hT : T ∈ M.commutant) : + ∀ y ∈ projectionOrbitClosure p, T y ∈ projectionOrbitClosure p := by + apply projectionOrbitClosure_invariant_of_vectors + rintro y ⟨a,x,rfl⟩ + refine ⟨a,T x,?_⟩ + have ha := VonNeumannAlgebra.mem_commutant_iff.mp hT a.val a.property + have hp := VonNeumannAlgebra.mem_commutant_iff.mp hT p.val.val p.val.property + have hea := congrArg (fun R : H →L[ℂ] H => R (p.val.val x)) ha + have hep := congrArg (fun R : H →L[ℂ] H => R x) hp + change a.val (T (p.val.val x))=T (a.val (p.val.val x)) at hea + change p.val.val (T x)=T (p.val.val x) at hep + exact hea.symm.trans (congrArg a.val hep.symm) + +theorem projectionOrbitProjection_mem (p : AlgebraProjection M) : + (projectionOrbitClosure p).starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro T hT + rw [Submodule.range_starProjection] + exact projectionOrbitClosure_commutant_invariant p T hT + +def centralSupport (p : AlgebraProjection M) : AlgebraProjection M := + ⟨⟨(projectionOrbitClosure p).starProjection, projectionOrbitProjection_mem p⟩, by + constructor + · apply Subtype.ext + exact (isStarProjection_starProjection (U := projectionOrbitClosure p)).isIdempotentElem.eq + · apply Subtype.ext + exact (isStarProjection_starProjection (U := projectionOrbitClosure p)).isSelfAdjoint.star_eq⟩ + +theorem centralSupport_commutes (p : AlgebraProjection M) (a : M.toStarSubalgebra) : + a*(centralSupport p).val=(centralSupport p).val*a := by + apply Subtype.ext + exact (Generator.starProjection_commutes_of_invariant (projectionOrbitClosure p) a.val + (projectionOrbitClosure_invariant p a) + (projectionOrbitClosure_invariant p (star a))).symm + +theorem le_centralSupport (p : AlgebraProjection M) : p ≤ centralSupport p := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply Submodule.starProjection_eq_self_iff.mpr + apply Submodule.le_topologicalClosure + exact Submodule.subset_span ⟨1,x,rfl⟩ + +theorem centralSupport_le (p q : AlgebraProjection M) + (hcomm : ∀ a : M.toStarSubalgebra, a*q.val=q.val*a) (hpq : p ≤ q) : + centralSupport p ≤ q := by + have hK : projectionOrbitClosure p ≤ (q.val.val-1).ker := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro y ⟨a,x,rfl⟩ + change q.val.val (a.val (p.val.val x))-a.val (p.val.val x)=0 + have he : q.val*a*p.val=a*p.val := by + rw [← hcomm a, mul_assoc, hpq] + exact sub_eq_zero.mpr (congrArg (fun R : M.toStarSubalgebra => R.val x) he) + · exact (q.val.val-1).isClosed_ker + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + exact sub_eq_zero.mp (hK ((projectionOrbitClosure p).starProjection_apply_mem x)) + +theorem mul_centralSupport_eq_zero_of_no_links (p q : AlgebraProjection M) + (hlink : ∀ a : M.toStarSubalgebra, q.val*a*p.val=0) : + q.val*(centralSupport p).val=0 := by + have hK : projectionOrbitClosure p ≤ q.val.val.ker := by + apply Submodule.topologicalClosure_minimal + · apply Submodule.span_le.mpr + rintro y ⟨a,x,rfl⟩ + exact congrArg (fun R : M.toStarSubalgebra => R.val x) (hlink a) + · exact q.val.val.isClosed_ker + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + exact hK ((projectionOrbitClosure p).starProjection_apply_mem x) + +/-- Scalar center forces every nonzero projection to have full central support. -/ +theorem centralSupport_eq_one_of_factor + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (p : AlgebraProjection M) (hp : p.val≠0) : (centralSupport p).val=1 := by + obtain ⟨z,hz⟩ := hfactor (centralSupport p).val (centralSupport_commutes p) + have he := le_centralSupport p + change (centralSupport p).val*p.val=p.val at he + rw [hz,smul_mul_assoc,one_mul] at he + have hz1 : z=1 := (smul_left_injective ℂ hp) (he.trans (one_smul ℂ p.val).symm) + rw [hz,hz1,one_smul] + +theorem traceFree_projection_eq_zero_or_eq_zero_of_no_links + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (p q : AlgebraProjection M) (hlink : ∀ a : M.toStarSubalgebra, q.val*a*p.val=0) : + p.val=0 ∨ q.val=0 := by + by_cases hp : p.val=0 + · exact Or.inl hp + · right + have h := mul_centralSupport_eq_zero_of_no_links p q hlink + rwa [centralSupport_eq_one_of_factor hfactor p hp,mul_one] at h + +end + +/-! Trace-free upper bounds of arbitrary directed nets of partial isometries. +A weak operator ultralimit suffices: extension identities with each fixed net +member force the limit to satisfy b b* b = b. No trace or countability is used. -/ +section +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- Left multiplication by a fixed operator preserves matrix-coefficient limits. -/ +theorem wot_limit_mul_left {ι : Type*} {l : Filter ι} + (a : ι → M.toStarSubalgebra) (b c : M.toStarSubalgebra) + (ht : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val x)) l + (𝓝 (inner ℂ y (b.val x)))) : + ∀ x y : H, Tendsto (fun i => inner ℂ y ((c*a i).val x)) l + (𝓝 (inner ℂ y ((c*b).val x))) := by + intro x y + change Tendsto (fun i => inner ℂ y (c.val ((a i).val x))) l + (𝓝 (inner ℂ y (c.val (b.val x)))) + simpa only [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_left] + using ht x (star c.val y) + +/-- Right multiplication by a fixed operator preserves matrix-coefficient limits. -/ +theorem wot_limit_mul_right {ι : Type*} {l : Filter ι} + (a : ι → M.toStarSubalgebra) (b c : M.toStarSubalgebra) + (ht : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val x)) l + (𝓝 (inner ℂ y (b.val x)))) : + ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i*c).val x)) l + (𝓝 (inner ℂ y ((b*c).val x))) := fun x y => ht (c.val x) y + +/-- Matrix coefficients determine an element of the concrete algebra. -/ +theorem wot_limit_unique {ι : Type*} {l : Filter ι} [l.NeBot] + (a : ι → M.toStarSubalgebra) (b c : M.toStarSubalgebra) + (hb : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val x)) l + (𝓝 (inner ℂ y (b.val x)))) + (hc : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val x)) l + (𝓝 (inner ℂ y (c.val x)))) : b=c := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + exact ext_inner_left ℂ (fun y => tendsto_nhds_unique (hb x y) (hc x y)) + +namespace PartialIsometry + +/-- Every monotone directed net has a partial-isometry upper bound, retaining +any prescribed bounds on its initial and final projections. -/ +theorem traceFree_monotone_upper_bound + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → PartialIsometry M) (ha : Monotone a) + (p q : AlgebraProjection M) (hp : ∀ i, (a i).support ≤ p) + (hq : ∀ i, (a i).target ≤ q) : + ∃ v : PartialIsometry M, (∀ i, a i ≤ v) ∧ v.support ≤ p ∧ v.target ≤ q := by + let ω : Ultrafilter ι := Ultrafilter.of atTop + obtain ⟨T, _, ht⟩ := exists_weak_operator_ultralimit ω + (fun i => (a i).val.val) 1 (by norm_num) (fun i => (a i).norm_le_one) + let b : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M (fun i => (a i).val) T ht⟩ + have hb : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val.val x)) (ω : Filter ι) + (𝓝 (inner ℂ y (b.val x))) := ht + have hbp (i : ι) : b*(a i).support.val=(a i).val := by + apply wot_limit_unique (fun j => (a j).val*(a i).support.val) _ _ + (wot_limit_mul_right _ _ _ hb) + intro x y + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y (z.val x)) (ha hj)).symm + have hab (i : ι) : star (a i).val*b=(a i).support.val := by + apply wot_limit_unique (fun j => star (a i).val*(a j).val) _ _ + (wot_limit_mul_left _ _ _ hb) + intro x y + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y (z.val x)) + (cross_initial_rev (ha hj))).symm + have hba (i : ι) : star b*(a i).val=(a i).support.val := by + simpa only [star_mul, star_star, (a i).support.property.isSelfAdjoint.star_eq] + using congrArg star (hab i) + have hfix (i : ι) : (b*star b)*(a i).val=(a i).val := by + rw [mul_assoc, hba i, hbp i] + have hpartial : (b*star b)*b=b := by + apply wot_limit_unique (fun i => (b*star b)*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + simpa only [hfix] using hb + have hid : (star b*b)*(star b*b)=star b*b := by + calc _ = star b*((b*star b)*b) := by simp only [mul_assoc] + _ = star b*b := by rw [hpartial] + let v : PartialIsometry M := ⟨⟨star b*b, ⟨hid, IsSelfAdjoint.star_mul_self b⟩⟩, b, rfl⟩ + refine ⟨v, hbp, ?_, ?_⟩ + · apply (v.support_le_iff_mul p).mpr + apply wot_limit_unique (fun i => (a i).val*p.val) _ _ + (wot_limit_mul_right _ _ _ hb) + simpa only [fun i => ((a i).support_le_iff_mul p).mp (hp i)] using hb + · apply (v.target_le_iff_mul q).mpr + apply wot_limit_unique (fun i => q.val*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + simpa only [fun i => ((a i).target_le_iff_mul q).mp (hq i)] using hb + +end PartialIsometry +end + +/-! Trace-free chain upper bounds and maximal partial isometries, with prescribed +initial and final projection bounds. The index set may be uncountable. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +theorem traceFree_chain_upper_bound (c : Set (PartialIsometry M)) + (hc : IsChain (· ≤ ·) c) (hne : c.Nonempty) + (p q : AlgebraProjection M) (hp : ∀ v ∈ c, v.support ≤ p) + (hq : ∀ v ∈ c, v.target ≤ q) : + ∃ v : PartialIsometry M, (∀ w ∈ c, w ≤ v) ∧ v.support ≤ p ∧ v.target ≤ q := by + let : Nonempty c := hne.to_subtype + let : IsDirected c (· ≤ ·) := ⟨by + intro u v + rcases hc.total u.property v.property with h | h + · exact ⟨v, h, le_rfl⟩ + · exact ⟨u, le_rfl, h⟩⟩ + obtain ⟨v, hv, hvp, hvq⟩ := traceFree_monotone_upper_bound + (fun w : c => w.val) (fun _ _ h => h) p q + (fun w => hp w.val w.property) (fun w => hq w.val w.property) + exact ⟨v, fun w hw => hv ⟨w,hw⟩, hvp, hvq⟩ + +theorem traceFree_exists_maximal_between (p q : AlgebraProjection M) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ + ∀ w : PartialIsometry M, w.support ≤ p → w.target ≤ q → v ≤ w → w ≤ v := by + let S : Set (PartialIsometry M) := {v | v.support ≤ p ∧ v.target ≤ q} + obtain ⟨v,hv⟩ := zorn_le₀ S (by + intro c hc hchain + by_cases hne : c.Nonempty + · obtain ⟨v, hcv, hvp, hvq⟩ := traceFree_chain_upper_bound c hchain hne p q + (fun w hw => (hc hw).1) (fun w hw => (hc hw).2) + exact ⟨v, ⟨hvp, hvq⟩, hcv⟩ + · refine ⟨zero, ⟨?_, ?_⟩, ?_⟩ + · change p.val*0=0 + exact mul_zero _ + · apply (zero.target_le_iff_mul q).mpr + exact mul_zero _ + · intro w hw + exact (hne ⟨w,hw⟩).elim) + exact ⟨v,hv.1.1,hv.1.2,fun w hp hq h => hv.2 ⟨hp,hq⟩ h⟩ + +end PartialIsometry +end + +/-! Projection comparison from scalar center, without a supplied trace. +The maximal partial isometry, central support and polar linking are constructed. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + +include hfactor in +theorem traceFree_exists_nonzero_partialIsometry_between_projections + (p q : AlgebraProjection M) (hp : p.val≠0) (hq : q.val≠0) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ v.support.val≠0 := by + have hex : ∃ a : M.toStarSubalgebra, q.val*a*p.val≠0 := by + by_contra hn + have hz : ∀ a : M.toStarSubalgebra, q.val*a*p.val=0 := by + simpa only [not_exists,not_not] using hn + exact (traceFree_projection_eq_zero_or_eq_zero_of_no_links hfactor p q hz).elim hp hq + obtain ⟨a,ha⟩ := hex + apply exists_partialIsometry_of_link p q (q.val*a*p.val) + · rw [mul_assoc,p.property.isIdempotentElem.eq] + · rw [← mul_assoc,← mul_assoc,q.property.isIdempotentElem.eq] + · exact ha + +include hfactor in +theorem traceFree_exists_partialIsometry_comparison (p q : AlgebraProjection M) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ + (v.support=p ∨ v.target=q) := by + obtain ⟨v,hvp,hvq,hmax⟩ := PartialIsometry.traceFree_exists_maximal_between p q + let r : AlgebraProjection M := + ⟨p.val-v.support.val,v.support.property.sub_of_mul_eq_right p.property hvp⟩ + let s : AlgebraProjection M := + ⟨q.val-v.target.val,v.target.property.sub_of_mul_eq_right q.property hvq⟩ + have hrp : r ≤ p := by + change p.val*(p.val-v.support.val)=p.val-v.support.val + rw [mul_sub,p.property.isIdempotentElem.eq,hvp] + have hsq : s ≤ q := by + change q.val*(q.val-v.target.val)=q.val-v.target.val + rw [mul_sub,q.property.isIdempotentElem.eq,hvq] + have hzero : r.val=0 ∨ s.val=0 := by + by_contra hn + have hr : r.val≠0 := fun h => hn (Or.inl h) + have hs : s.val≠0 := fun h => hn (Or.inr h) + obtain ⟨w,hwr,hws,hw0⟩ := + traceFree_exists_nonzero_partialIsometry_between_projections hfactor r s hr hs + have hpw : v.support.val*w.support.val=0 := by + calc _ = v.support.val*(r.val*w.support.val) := by rw [hwr] + _ = (v.support.val*r.val)*w.support.val := (mul_assoc _ _ _).symm + _ = 0 := by + change (v.support.val*(p.val-v.support.val))*w.support.val=0 + rw [mul_sub,projection_mul_of_le hvp,v.support.property.isIdempotentElem.eq, + sub_self,zero_mul] + have hqw : v.target.val*w.target.val=0 := by + calc _ = v.target.val*(s.val*w.target.val) := by rw [hws] + _ = (v.target.val*s.val)*w.target.val := (mul_assoc _ _ _).symm + _ = 0 := by + change (v.target.val*(q.val-v.target.val))*w.target.val=0 + rw [mul_sub,projection_mul_of_le hvq,v.target.property.isIdempotentElem.eq, + sub_self,zero_mul] + let u := PartialIsometry.patch v w hpw hqw + have hup : u.support ≤ p := by + change p.val*(v.support.val+w.support.val)=v.support.val+w.support.val + rw [mul_add,hvp,show p.val*w.support.val=w.support.val from hwr.trans hrp] + have huq : u.target ≤ q := by + apply (u.target_le_iff_mul q).mpr + change q.val*(v.val+w.val)=v.val+w.val + rw [mul_add,(v.target_le_iff_mul q).mp hvq, + (w.target_le_iff_mul q).mp (hws.trans hsq)] + have hvu : v ≤ u := v.le_patch w hpw hqw + exact (v.patch_ne w hpw hqw hw0) (le_antisymm (hmax u hup huq hvu) hvu) + refine ⟨v,hvp,hvq,?_⟩ + rcases hzero with hr | hs + · exact Or.inl (Subtype.ext (sub_eq_zero.mp hr).symm) + · exact Or.inr (Subtype.ext (sub_eq_zero.mp hs).symm) + +end Tracial + +/-! The original finiteness predicate excludes proper self-equivalence of a +projection. Projection comparison is connected to the unchanged IsII1Factor +predicate, with no representation, trace, or separability premise. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +namespace Tracial +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +/-- The identity partial isometry on a projection. -/ +def onProjection (p : AlgebraProjection M) : PartialIsometry M := + ⟨p, p.val, by rw [p.property.isSelfAdjoint.star_eq, p.property.isIdempotentElem.eq]⟩ + +theorem onProjection_target (p : AlgebraProjection M) : (onProjection p).target=p := by + apply Subtype.ext + change p.val*star p.val=p.val + rw [p.property.isSelfAdjoint.star_eq, p.property.isIdempotentElem.eq] + +/-- A finite algebra has no partial isometry from a projection onto a proper +subprojection of itself. Finiteness is used on v + (1 - p). -/ +theorem target_eq_support_of_finite + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (v : PartialIsometry M) (hv : v.target ≤ v.support) : v.target=v.support := by + let r : AlgebraProjection M := ⟨1-v.support.val,v.support.property.one_sub⟩ + let w := onProjection r + have hp : v.support.val*w.support.val=0 := by + change v.support.val*(1-v.support.val)=0 + rw [mul_sub,mul_one,v.support.property.isIdempotentElem.eq,sub_self] + have hq : v.target.val*w.target.val=0 := by + rw [show w.target=r from onProjection_target r] + change v.target.val*(1-v.support.val)=0 + rw [mul_sub,mul_one,projection_mul_of_le hv,sub_self] + let u := patch v w hp hq + have hu : star u.val*u.val=1 := by + rw [u.initial] + change v.support.val+(1-v.support.val)=1 + abel + have huf := hfinite u.val hu + change u.target.val=1 at huf + rw [patch_target,show w.target=r from onProjection_target r] at huf + apply Subtype.ext + change v.target.val+(1-v.support.val)=1 at huf + have he : v.target.val+(1-v.support.val)=v.support.val+(1-v.support.val) := by + rw [huf] + abel + exact add_right_cancel he + +/-- Finiteness also excludes a proper enlargement equivalent to a projection. -/ +theorem target_eq_support_of_finite_of_le + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (v : PartialIsometry M) (hv : v.support ≤ v.target) : v.target=v.support := by + have he : v.adjoint.target=v.support := by + apply Subtype.ext + change star v.val*star (star v.val)=v.support.val + rw [star_star,v.initial] + have h := target_eq_support_of_finite hfinite v.adjoint (by + change v.adjoint.target ≤ v.target + rw [he] + exact hv) + change v.adjoint.target=v.target at h + rw [he] at h + exact h.symm + +end PartialIsometry +end Tracial + +/-- Comparison in the exact original concrete algebra, packaged by its proved +bicommutant property. The underlying operators and star subalgebra are unchanged. -/ +theorem isII1Factor_projection_comparison + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) + (p q : Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed)) : + ∃ v : Tracial.PartialIsometry (vonNeumannOfWOTClosed S hS.weaklyClosed), + v.support ≤ p ∧ v.target ≤ q ∧ (v.support=p ∨ v.target=q) := by + apply Tracial.traceFree_exists_partialIsometry_comparison + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + +/-- The exact original finite-isometry field makes every projection finite. -/ +theorem isII1Factor_no_proper_self_equivalence + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) + (v : Tracial.PartialIsometry (vonNeumannOfWOTClosed S hS.weaklyClosed)) + (hv : v.target ≤ v.support) : v.target=v.support := + Tracial.PartialIsometry.target_eq_support_of_finite hS.finite v hv + +end + +/-! Arbitrary-chain bounds with moving orthogonal initial and final supports, obtained from successive fixed-multiplier weak operator limits without a trace. -/ +namespace Tracial +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- Orthogonality passes to subprojections in both variables. -/ +theorem projection_orthogonal_of_le {p q r s : AlgebraProjection M} + (h : p.val*q.val=0) (hr : r ≤ p) (hs : s ≤ q) : r.val*s.val=0 := by + calc _ = (r.val*p.val)*(q.val*s.val) := by rw [projection_mul_of_le hr,hs] + _ = r.val*(p.val*q.val)*s.val := by simp only [mul_assoc] + _ = 0 := by rw [h,mul_zero,zero_mul] + +namespace PartialIsometry + +theorem target_mono {v w : PartialIsometry M} (h : v ≤ w) : v.target ≤ w.target := by + apply (v.target_le_iff_mul w.target).mpr + calc _ = w.target.val*(w.val*v.support.val) := by rw [h] + _ = v.val := by rw [← mul_assoc,w.target_mul,h] + +/-- A directed increasing family of square-zero partial isometries has an +upper bound with orthogonal initial/final projections inside p. -/ +theorem traceFree_orthogonal_monotone_upper_bound + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → PartialIsometry M) (ha : Monotone a) + (p : AlgebraProjection M) (hp : ∀ i, (a i).support ≤ p) + (hq : ∀ i, (a i).target ≤ p) + (ho : ∀ i, (a i).support.val*(a i).target.val=0) : + ∃ v : PartialIsometry M, (∀ i, a i ≤ v) ∧ v.support ≤ p ∧ v.target ≤ p ∧ + v.support.val*v.target.val=0 := by + let ω : Ultrafilter ι := Ultrafilter.of atTop + obtain ⟨T, _, ht⟩ := exists_weak_operator_ultralimit ω + (fun i => (a i).val.val) 1 (by norm_num) (fun i => (a i).norm_le_one) + let b : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M (fun i => (a i).val) T ht⟩ + have hb : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val.val x)) (ω : Filter ι) + (𝓝 (inner ℂ y (b.val x))) := ht + have hbp (i : ι) : b*(a i).support.val=(a i).val := by + apply wot_limit_unique (fun j => (a j).val*(a i).support.val) _ _ + (wot_limit_mul_right _ _ _ hb) + intro x y + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y (z.val x)) (ha hj)).symm + have hab (i : ι) : star (a i).val*b=(a i).support.val := by + apply wot_limit_unique (fun j => star (a i).val*(a j).val) _ _ + (wot_limit_mul_left _ _ _ hb) + intro x y + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y (z.val x)) + (cross_initial_rev (ha hj))).symm + have hba (i : ι) : star b*(a i).val=(a i).support.val := by + simpa only [star_mul, star_star, (a i).support.property.isSelfAdjoint.star_eq] + using congrArg star (hab i) + have hfix (i : ι) : (b*star b)*(a i).val=(a i).val := by + rw [mul_assoc, hba i, hbp i] + have hpartial : (b*star b)*b=b := by + apply wot_limit_unique (fun i => (b*star b)*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + simpa only [hfix] using hb + have hid : (star b*b)*(star b*b)=star b*b := by + calc _ = star b*((b*star b)*b) := by simp only [mul_assoc] + _ = star b*b := by rw [hpartial] + let v : PartialIsometry M := ⟨⟨star b*b, ⟨hid, IsSelfAdjoint.star_mul_self b⟩⟩, b, rfl⟩ + have hcross (i j : ι) : (a i).val*(a j).val=0 := by + obtain ⟨k,hik,hjk⟩ := exists_ge_ge i j + exact (a i).mul_eq_zero (a j) + (projection_orthogonal_of_le (ho k) (support_mono (ha hik)) (target_mono (ha hjk))) + have hbi (i : ι) : b*(a i).val=0 := by + apply wot_limit_unique (fun j => (a j).val*(a i).val) _ _ + (wot_limit_mul_right _ _ _ hb) + simpa only [hcross] using (fun x y : H => + (tendsto_const_nhds : Tendsto (fun _ : ι => inner ℂ y ((0 : M.toStarSubalgebra).val x)) + (ω : Filter ι) (𝓝 (inner ℂ y ((0 : M.toStarSubalgebra).val x))))) + have hbb : b*b=0 := by + apply wot_limit_unique (fun i => b*(a i).val) _ _ (wot_limit_mul_left _ _ _ hb) + simpa only [hbi] using (fun x y : H => + (tendsto_const_nhds : Tendsto (fun _ : ι => inner ℂ y ((0 : M.toStarSubalgebra).val x)) + (ω : Filter ι) (𝓝 (inner ℂ y ((0 : M.toStarSubalgebra).val x))))) + refine ⟨v, hbp, ?_, ?_, ?_⟩ + · apply (v.support_le_iff_mul p).mpr + apply wot_limit_unique (fun i => (a i).val*p.val) _ _ + (wot_limit_mul_right _ _ _ hb) + simpa only [fun i => ((a i).support_le_iff_mul p).mp (hp i)] using hb + · apply (v.target_le_iff_mul p).mpr + apply wot_limit_unique (fun i => p.val*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + simpa only [fun i => ((a i).target_le_iff_mul p).mp (hq i)] using hb + · change (star b*b)*(b*star b)=0 + calc _ = star b*(b*b)*star b := by simp only [mul_assoc] + _ = 0 := by rw [hbb,mul_zero,zero_mul] + +theorem traceFree_orthogonal_chain_upper_bound (c : Set (PartialIsometry M)) + (hc : IsChain (· ≤ ·) c) (hne : c.Nonempty) + (p : AlgebraProjection M) (hp : ∀ v ∈ c, v.support ≤ p) + (hq : ∀ v ∈ c, v.target ≤ p) + (ho : ∀ v ∈ c, v.support.val*v.target.val=0) : + ∃ v : PartialIsometry M, (∀ w ∈ c, w ≤ v) ∧ v.support ≤ p ∧ v.target ≤ p ∧ + v.support.val*v.target.val=0 := by + let : Nonempty c := hne.to_subtype + let : IsDirected c (· ≤ ·) := ⟨by + intro u v + rcases hc.total u.property v.property with h | h + · exact ⟨v,h,le_rfl⟩ + · exact ⟨u,le_rfl,h⟩⟩ + obtain ⟨v,hv,hvp,hvq,hvo⟩ := traceFree_orthogonal_monotone_upper_bound + (fun w : c => w.val) (fun _ _ h => h) p + (fun w => hp w.val w.property) (fun w => hq w.val w.property) + (fun w => ho w.val w.property) + exact ⟨v,fun w hw => hv ⟨w,hw⟩,hvp,hvq,hvo⟩ + +theorem traceFree_exists_maximal_orthogonal (p : AlgebraProjection M) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ p ∧ + v.support.val*v.target.val=0 ∧ + ∀ w : PartialIsometry M, w.support ≤ p → w.target ≤ p → + w.support.val*w.target.val=0 → v ≤ w → w ≤ v := by + let S : Set (PartialIsometry M) := + {v | v.support ≤ p ∧ v.target ≤ p ∧ v.support.val*v.target.val=0} + obtain ⟨v,hv⟩ := zorn_le₀ S (by + intro c hc hchain + by_cases hne : c.Nonempty + · obtain ⟨v,hcv,hvp,hvq,hvo⟩ := traceFree_orthogonal_chain_upper_bound c hchain hne p + (fun w hw => (hc hw).1) (fun w hw => (hc hw).2.1) (fun w hw => (hc hw).2.2) + exact ⟨v,⟨hvp,hvq,hvo⟩,hcv⟩ + · refine ⟨zero,⟨?_,?_,?_⟩,?_⟩ + · change p.val*0=0 + exact mul_zero _ + · apply (zero.target_le_iff_mul p).mpr + exact mul_zero _ + · exact zero_mul _ + · intro w hw + exact (hne ⟨w,hw⟩).elim) + exact ⟨v,hv.1.1,hv.1.2.1,hv.1.2.2,fun w hp hq ho h => hv.2 ⟨hp,hq,ho⟩ h⟩ + +/-! Simultaneous least initial and final support bounds for arbitrary directed +partial-isometry nets. The actual ultralimit is chosen once for all bounds. -/ + +/-- The initial and final projections of this upper bound are the respective +least upper bounds of the net's initial and final projections. -/ +theorem traceFree_monotone_least_supports + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → PartialIsometry M) (ha : Monotone a) : + ∃ v : PartialIsometry M, (∀ i, a i ≤ v) ∧ + (∀ p : AlgebraProjection M, (∀ i, (a i).support ≤ p) → v.support ≤ p) ∧ + (∀ q : AlgebraProjection M, (∀ i, (a i).target ≤ q) → v.target ≤ q) := by + let ω : Ultrafilter ι := Ultrafilter.of atTop + obtain ⟨T, _, ht⟩ := exists_weak_operator_ultralimit ω + (fun i => (a i).val.val) 1 (by norm_num) (fun i => (a i).norm_le_one) + let b : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M (fun i => (a i).val) T ht⟩ + have hb : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val.val x)) (ω : Filter ι) + (𝓝 (inner ℂ y (b.val x))) := ht + have hbp (i : ι) : b*(a i).support.val=(a i).val := by + apply wot_limit_unique (fun j => (a j).val*(a i).support.val) _ _ + (wot_limit_mul_right _ _ _ hb) + intro x y + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y (z.val x)) (ha hj)).symm + have hab (i : ι) : star (a i).val*b=(a i).support.val := by + apply wot_limit_unique (fun j => star (a i).val*(a j).val) _ _ + (wot_limit_mul_left _ _ _ hb) + intro x y + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y (z.val x)) + (cross_initial_rev (ha hj))).symm + have hba (i : ι) : star b*(a i).val=(a i).support.val := by + simpa only [star_mul, star_star, (a i).support.property.isSelfAdjoint.star_eq] + using congrArg star (hab i) + have hfix (i : ι) : (b*star b)*(a i).val=(a i).val := by + rw [mul_assoc, hba i, hbp i] + have hpartial : (b*star b)*b=b := by + apply wot_limit_unique (fun i => (b*star b)*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + simpa only [hfix] using hb + have hid : (star b*b)*(star b*b)=star b*b := by + calc _ = star b*((b*star b)*b) := by simp only [mul_assoc] + _ = star b*b := by rw [hpartial] + let v : PartialIsometry M := ⟨⟨star b*b, ⟨hid, IsSelfAdjoint.star_mul_self b⟩⟩, b, rfl⟩ + refine ⟨v, hbp, ?_, ?_⟩ + · intro p hp + apply (v.support_le_iff_mul p).mpr + apply wot_limit_unique (fun i => (a i).val*p.val) _ _ + (wot_limit_mul_right _ _ _ hb) + simpa only [fun i => ((a i).support_le_iff_mul p).mp (hp i)] using hb + · intro q hq + apply (v.target_le_iff_mul q).mpr + apply wot_limit_unique (fun i => q.val*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + simpa only [fun i => ((a i).target_le_iff_mul q).mp (hq i)] using hb + +end PartialIsometry +end Tracial + +/-! Complete actual partial isometries to unitaries in a finite factor. +The construction uses projection comparison and finiteness, without a trace. -/ +open scoped CStarAlgebra +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance unitaryPolarCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance unitaryPolarOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance unitaryPolarStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfactor hfinite in +theorem PartialIsometry.exists_unitary_extension (v : PartialIsometry M) : + ∃ u : unitary M.toStarSubalgebra, (u : M.toStarSubalgebra)*v.support.val=v.val := by + let p : AlgebraProjection M := ⟨1-v.support.val,v.support.property.one_sub⟩ + let q : AlgebraProjection M := ⟨1-v.target.val,v.target.property.one_sub⟩ + obtain ⟨w,hwp,hwq,hw⟩ := traceFree_exists_partialIsometry_comparison hfactor p q + have hp : v.support.val*w.support.val=0 := by + calc _ = v.support.val*(p.val*w.support.val) := by rw [hwp] + _ = (v.support.val*p.val)*w.support.val := (mul_assoc _ _ _).symm + _ = 0 := by + change (v.support.val*(1-v.support.val))*w.support.val=0 + rw [v.support.property.mul_one_sub_self,zero_mul] + have hq : v.target.val*w.target.val=0 := by + calc _ = v.target.val*(q.val*w.target.val) := by rw [hwq] + _ = (v.target.val*q.val)*w.target.val := (mul_assoc _ _ _).symm + _ = 0 := by + change (v.target.val*(1-v.target.val))*w.target.val=0 + rw [v.target.property.mul_one_sub_self,zero_mul] + let a := v.patch w hp hq + have hi : star a.val*a.val=1 := by + rcases hw with hw | hw + · rw [a.initial] + change v.support.val+w.support.val=1 + rw [hw] + change v.support.val+(1-v.support.val)=1 + abel + · have hf : a.val*star a.val=1 := by + change a.target.val=1 + rw [PartialIsometry.patch_target,hw] + change v.target.val+(1-v.target.val)=1 + abel + have h := hfinite (star a.val) (by simpa only [star_star] using hf) + simpa only [star_star] using h + exact ⟨⟨a.val,⟨hi,hfinite a.val hi⟩⟩,v.le_patch w hp hq⟩ + +include hfactor hfinite in +theorem exists_unitary_polar_decomposition (x : M.toStarSubalgebra) : + ∃ u : unitary M.toStarSubalgebra, (u : M.toStarSubalgebra)*CFC.sqrt (star x*x)=x := by + obtain ⟨v,hvx,hvi,_⟩ := exists_polar_decomposition x + let a := CFC.sqrt (star x*x) + let w : PartialIsometry M := ⟨rangeProjection a,v,hvi⟩ + obtain ⟨u,hu⟩ := w.exists_unitary_extension hfactor hfinite + have ha : w.support.val*a=a := rangeProjection_mul a + refine ⟨u,?_⟩ + calc (u : M.toStarSubalgebra)*a = (u : M.toStarSubalgebra)*(w.support.val*a) := by rw [ha] + _ = w.val*a := by rw [← mul_assoc,hu] + _ = x := hvx + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/FreeGroupMoments.lean b/lean/OAI/Analysis/FactorGeneration/FreeGroupMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..306cde9239c04042c1dea842b19de3673e26ee8f --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/FreeGroupMoments.lean @@ -0,0 +1,364 @@ +import OAI.Analysis.FactorGeneration.HaarSequences + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Every nonempty reduced word in successive Haar variables has zero trace. +The induction eliminates the largest label, retaining centered lower-label gaps. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def unitaryWord {A : Type*} (v : A → unitary (Q τ ω)) (w : List (A × Bool)) : Q τ ω := + (w.map (fun x => algebraSignedLetter (v x.1 : Q τ ω) (!x.2))).prod + +theorem unitaryWord_nil {A : Type*} (v : A → unitary (Q τ ω)) : + unitaryWord τ ω v []=1 := rfl + +theorem unitaryWord_cons {A : Type*} (v : A → unitary (Q τ ω)) + (x : A × Bool) (w : List (A × Bool)) : + unitaryWord τ ω v (x::w)=algebraSignedLetter (v x.1 : Q τ ω) (!x.2)*unitaryWord τ ω v w := rfl + +theorem unitaryWord_append {A : Type*} (v : A → unitary (Q τ ω)) + (a b : List (A × Bool)) : unitaryWord τ ω v (a++b)=unitaryWord τ ω v a*unitaryWord τ ω v b := by + simp [unitaryWord,List.map_append,List.prod_append] + +theorem unitaryWord_mem {A : Type*} (v : A → unitary (Q τ ω)) + (D : StarSubalgebra ℂ (Q τ ω)) (w : List (A × Bool)) + (hv : ∀ x ∈ w,(v x.1 : Q τ ω) ∈ D) : unitaryWord τ ω v w ∈ D := by + induction w with + | nil => exact D.one_mem + | cons x w ih => + apply D.mul_mem _ (ih (fun y hy => hv y (by simp [hy]))) + have hx := hv x (by simp) + change algebraSignedLetter (v x.1 : Q τ ω) (!x.2) ∈ D + unfold algebraSignedLetter + split + · exact star_mem hx + · exact hx + +/-- Scan the tail after a maximal label. Empty gaps can only join equal signs. -/ +theorem maximal_word_gaps (v : ℕ → unitary (Q τ ω)) + (D : StarSubalgebra ℂ (Q τ ω)) (n : ℕ) + (hv : ∀ i < n,(v i : Q τ ω) ∈ D) + (hzero : ∀ a : List (ℕ × Bool),FreeGroup.IsReduced a → a ≠ [] → + (∀ x ∈ a,x.1 < n) → quotientTrace τ ω (unitaryWord τ ω v a)=0) + (w : List (ℕ × Bool)) (s : Bool) + (hr : FreeGroup.IsReduced ((n,s)::w)) (hn : ∀ x ∈ w,x.1 ≤ n) : + ∃ xs b,b ∈ D ∧ SignedReducedGaps τ ω D.toSubalgebra (!s) xs ∧ + unitaryWord τ ω v ((n,s)::w)=betweenWord (v n : Q τ ω) (!s) xs b := by + classical + by_cases hex : ∃ x ∈ w,x.1=n + · obtain ⟨a,t,c,he,ha⟩ := word_split_first n w hex + have hlt : ∀ x ∈ a,x.1 < n := by + intro x hx + have := hn x (by rw [he]; simp [hx]) + have := ha x hx + omega + have har : FreeGroup.IsReduced a := reduced_append_left (he ▸ reduced_tail hr) + have hcr : FreeGroup.IsReduced ((n,t)::c) := reduced_append_right (he ▸ reduced_tail hr) + have hcn : ∀ x ∈ c,x.1 ≤ n := by + intro x hx + exact hn x (by rw [he]; simp [hx]) + obtain ⟨xs,b,hb,hxs,hev⟩ := maximal_word_gaps v D n hv hzero c t hcr hcn + have ham : unitaryWord τ ω v a ∈ D := unitaryWord_mem τ ω v D a (fun x hx => hv _ (hlt x hx)) + have hac : (!s) ≠ (!t) → quotientTrace τ ω (unitaryWord τ ω v a)=0 := by + intro hst + apply hzero a har _ hlt + intro hempty + have hr' : FreeGroup.IsReduced ((n,s)::(n,t)::c) := by + simpa only [he,hempty,List.nil_append] using hr + have hst' : s=t := (FreeGroup.isReduced_cons_cons.mp hr').1 rfl + exact hst (congrArg Bool.not hst') + refine ⟨(unitaryWord τ ω v a,!t)::xs,b,hb,⟨ham,hac,hxs⟩,?_⟩ + rw [unitaryWord_cons,he,unitaryWord_append,hev] + simp only [betweenWord,mul_assoc] + · refine ⟨[],unitaryWord τ ω v w,?_,trivial,rfl⟩ + apply unitaryWord_mem τ ω v D w + intro x hx + apply hv + have := hn x hx + have : x.1 ≠ n := fun he => hex ⟨x,hx,he⟩ + omega +termination_by w.length + decreasing_by simp only [he,List.length_append,List.length_cons]; omega + +theorem successive_reduced_word_zero (v : ℕ → unitary (Q τ ω)) + (D : ℕ → StarSubalgebra ℂ (Q τ ω)) + (hv : ∀ i j,i < j → (v i : Q τ ω) ∈ D j) + (hep : ∀ j,HaarEndpoints τ ω (D j).toSubalgebra (v j)) + (n : ℕ) (w : List (ℕ × Bool)) (hr : FreeGroup.IsReduced w) (hw : w ≠ []) + (hn : ∀ x ∈ w,x.1 < n) : quotientTrace τ ω (unitaryWord τ ω v w)=0 := by + classical + induction n generalizing w with + | zero => + cases w with + | nil => exact (hw rfl).elim + | cons x w => have := hn x (by simp); omega + | succ n ih => + by_cases hex : ∃ x ∈ w,x.1=n + · obtain ⟨a,s,b,he,ha⟩ := word_split_first n w hex + have halt : ∀ x ∈ a,x.1 < n := by + intro x hx + have := hn x (by rw [he]; simp [hx]) + have := ha x hx + omega + have hbr : FreeGroup.IsReduced ((n,s)::b) := reduced_append_right (he ▸ hr) + have hbn : ∀ x ∈ b,x.1 ≤ n := by + intro x hx + have := hn x (by rw [he]; simp [hx]) + omega + obtain ⟨xs,c,hc,hxs,hev⟩ := maximal_word_gaps τ ω v (D n) n + (fun i hi => hv i n hi) ih b s hbr hbn + rw [he,unitaryWord_append,hev] + exact (hep n).signed_gaps τ ω _ + (unitaryWord_mem τ ω v (D n) a (fun x hx => hv _ _ (halt x hx))) c hc _ xs hxs + · apply ih w hr hw + intro x hx + have := hn x hx + have : x.1 ≠ n := fun he => hex ⟨x,hx,he⟩ + omega + +end + +/-! The actual free-group representation furnished by successive Haar variables. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def unitaryRepresentation {A : Type*} (v : A → unitary (Q τ ω)) : + FreeGroup A →* unitary (Q τ ω) := FreeGroup.lift v + +theorem unitaryRepresentation_mk {A : Type*} (v : A → unitary (Q τ ω)) + (w : List (A × Bool)) : + (unitaryRepresentation τ ω v (FreeGroup.mk w) : Q τ ω)=unitaryWord τ ω v w := by + rw [unitaryRepresentation,FreeGroup.lift_mk] + induction w with + | nil => rfl + | cons x w ih => + simp only [List.map_cons,List.prod_cons,Submonoid.coe_mul,unitaryWord_cons,ih] + cases x.2 <;> rfl + +theorem successive_freeGroup_trace (v : ℕ → unitary (Q τ ω)) + (D : ℕ → StarSubalgebra ℂ (Q τ ω)) + (hv : ∀ i j,i < j → (v i : Q τ ω) ∈ D j) + (hep : ∀ j,HaarEndpoints τ ω (D j).toSubalgebra (v j)) + (g : FreeGroup ℕ) (hg : g ≠ 1) : + quotientTrace τ ω (unitaryRepresentation τ ω v g : Q τ ω)=0 := by + rw [← FreeGroup.mk_toWord (x := g),unitaryRepresentation_mk] + apply successive_reduced_word_zero τ ω v D hv hep + (g.toWord.toFinset.sup Prod.fst+1) g.toWord FreeGroup.isReduced_toWord + (fun h => hg (FreeGroup.toWord_eq_nil_iff.mp h)) + intro x hx + have := Finset.le_sup (f := Prod.fst) (List.mem_toFinset.mpr hx) + omega + +/-- Zero nonidentity moments imply faithfulness, since the unit has trace one. -/ +theorem unitaryRepresentation_injective {A : Type*} (v : A → unitary (Q τ ω)) + (hzero : ∀ g : FreeGroup A,g ≠ 1 → + quotientTrace τ ω (unitaryRepresentation τ ω v g : Q τ ω)=0) : + Function.Injective (unitaryRepresentation τ ω v) := by + apply (injective_iff_map_eq_one (unitaryRepresentation τ ω v)).mpr + intro g hg + by_contra hne + have ht := hzero g hne + rw [hg] at ht + have : (1 : ℂ)=0 := (quotientTrace_one τ ω).symm.trans ht + exact one_ne_zero this + +theorem unitaryRepresentation_gram {A : Type*} [DecidableEq A] + (v : A → unitary (Q τ ω)) + (hzero : ∀ g : FreeGroup A,g ≠ 1 → + quotientTrace τ ω (unitaryRepresentation τ ω v g : Q τ ω)=0) + (g h : FreeGroup A) : + quotientTrace τ ω (star (unitaryRepresentation τ ω v g : Q τ ω)* + (unitaryRepresentation τ ω v h : Q τ ω))=if g=h then 1 else 0 := by + have he : star (unitaryRepresentation τ ω v g : Q τ ω)* + (unitaryRepresentation τ ω v h : Q τ ω)= + (unitaryRepresentation τ ω v (g⁻¹*h) : Q τ ω) := by + exact (congrArg (fun a : unitary (Q τ ω) => (a : Q τ ω)) + (((unitaryRepresentation τ ω v).map_mul (g⁻¹) h).trans + (congrArg (fun a => a*unitaryRepresentation τ ω v h) + ((unitaryRepresentation τ ω v).map_inv g)))).symm + apply (congrArg (quotientTrace τ ω) he).trans + by_cases hgh : g=h + · subst h + rw [_root_.inv_mul_cancel,map_one,ite_eq_left rfl] + exact quotientTrace_one τ ω + · rw [ite_eq_right hgh] + exact hzero _ (fun heq => hgh (_root_.inv_mul_eq_one.mp heq)) + +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem SuccessiveCoordinateHaar.freeGroup_trace + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) + (g : FreeGroup ℕ) (hg : g ≠ 1) : + quotientTrace τ ω + (unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) g : Q τ ω)=0 := + successive_freeGroup_trace τ ω _ F.algebra + (fun _ _ hij => F.variable_mem τ ω u hu hij) (F.variable_endpoints τ ω u hu) g hg + +theorem SuccessiveCoordinateHaar.freeGroup_injective + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) : + Function.Injective (unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t))) := + unitaryRepresentation_injective τ ω _ (F.freeGroup_trace τ ω u hu) + +theorem SuccessiveCoordinateHaar.freeGroup_gram + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (g h : FreeGroup ℕ) : + quotientTrace τ ω + (star (unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) g : Q τ ω)* + (unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) h : Q τ ω))= + if g=h then 1 else 0 := + unitaryRepresentation_gram τ ω _ (F.freeGroup_trace τ ω u hu) g h + +end + +/-! Reduced-word moments for p*y*(star p). Distinct labels have centered ratios; +reducedness requires distinct labels precisely at opposite-sign gaps. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {A : Type*} + +def conjugateVariables (p : A → unitary (Q τ ω)) (y : unitary (Q τ ω)) + (a : A) : unitary (Q τ ω) := p a*y*star (p a) + +def conjugateGaps (p : A → unitary (Q τ ω)) (a : A × Bool) : + List (A × Bool) → List (Q τ ω × Bool) + | [] => [] + | b::w => ((↑(star (p a.1)*p b.1) : Q τ ω),!b.2)::conjugateGaps p b w + +def conjugateEnd (p : A → unitary (Q τ ω)) (a : A × Bool) : List (A × Bool) → Q τ ω + | [] => ↑(star (p a.1)) + | b::w => conjugateEnd p b w + +theorem signed_conjugate (p y : unitary (Q τ ω)) (s : Bool) : + algebraSignedLetter (↑(p*y*(star p)) : Q τ ω) s= + (p : Q τ ω)*algebraSignedLetter (y : Q τ ω) s*↑(star p) := by + cases s with + | false => rfl + | true => + change star ((p : Q τ ω)*(y : Q τ ω)*star (p : Q τ ω))= + (p : Q τ ω)*star (y : Q τ ω)*star (p : Q τ ω) + rw [star_mul,star_mul,star_star,mul_assoc] + +theorem conjugateWord_formula (p : A → unitary (Q τ ω)) (y : unitary (Q τ ω)) + (a : A × Bool) (w : List (A × Bool)) : + unitaryWord τ ω (conjugateVariables τ ω p y) (a::w)= + (p a.1 : Q τ ω)*betweenWord (y : Q τ ω) (!a.2) + (conjugateGaps τ ω p a w) (conjugateEnd τ ω p a w) := by + induction w generalizing a with + | nil => + rw [unitaryWord_cons,unitaryWord_nil,mul_one] + change algebraSignedLetter (↑(p a.1*y*star (p a.1)) : Q τ ω) (!a.2)=_ + rw [signed_conjugate] + exact mul_assoc _ _ _ + | cons b w ih => + rw [unitaryWord_cons,ih] + change algebraSignedLetter (↑(p a.1*y*star (p a.1)) : Q τ ω) (!a.2)*_= _ + rw [signed_conjugate] + simp only [conjugateGaps,conjugateEnd,betweenWord,Submonoid.coe_mul,mul_assoc] + +theorem conjugateEnd_mem (p : A → unitary (Q τ ω)) + (D : StarSubalgebra ℂ (Q τ ω)) (hp : ∀ a,(p a : Q τ ω) ∈ D) + (a : A × Bool) (w : List (A × Bool)) : conjugateEnd τ ω p a w ∈ D := by + induction w generalizing a with + | nil => exact star_mem (hp a.1) + | cons b w ih => exact ih b + +theorem conjugateGaps_reduced (p : A → unitary (Q τ ω)) + (D : StarSubalgebra ℂ (Q τ ω)) (hp : ∀ a,(p a : Q τ ω) ∈ D) + (hzero : ∀ a b,a ≠ b → quotientTrace τ ω (↑(star (p a)*p b) : Q τ ω)=0) + (a : A × Bool) (w : List (A × Bool)) (hr : FreeGroup.IsReduced (a::w)) : + SignedReducedGaps τ ω D.toSubalgebra (!a.2) (conjugateGaps τ ω p a w) := by + induction w generalizing a with + | nil => trivial + | cons b w ih => + have ha : star (p a.1 : Q τ ω) ∈ D := star_mem (hp a.1) + refine ⟨D.mul_mem ha (hp b.1),?_,ih b (reduced_tail hr)⟩ + intro hsign + apply hzero + intro he + exact hsign (congrArg Bool.not ((FreeGroup.isReduced_cons_cons.mp hr).1 he)) + +theorem conjugate_reduced_word_zero (p : A → unitary (Q τ ω)) + (D : StarSubalgebra ℂ (Q τ ω)) (hp : ∀ a,(p a : Q τ ω) ∈ D) + (hzero : ∀ a b,a ≠ b → quotientTrace τ ω (↑(star (p a)*p b) : Q τ ω)=0) + (y : unitary (Q τ ω)) (hy : HaarEndpoints τ ω D.toSubalgebra y) + (w : List (A × Bool)) (hr : FreeGroup.IsReduced w) (hw : w ≠ []) : + quotientTrace τ ω (unitaryWord τ ω (conjugateVariables τ ω p y) w)=0 := by + cases w with + | nil => exact (hw rfl).elim + | cons a w => + rw [conjugateWord_formula] + exact hy.signed_gaps τ ω _ (hp a.1) _ (conjugateEnd_mem τ ω p D hp a w) + _ _ (conjugateGaps_reduced τ ω p D hp hzero a w hr) + +theorem conjugate_freeGroup_trace [DecidableEq A] (p : A → unitary (Q τ ω)) + (D : StarSubalgebra ℂ (Q τ ω)) (hp : ∀ a,(p a : Q τ ω) ∈ D) + (hzero : ∀ a b,a ≠ b → quotientTrace τ ω (↑(star (p a)*p b) : Q τ ω)=0) + (y : unitary (Q τ ω)) (hy : HaarEndpoints τ ω D.toSubalgebra y) + (g : FreeGroup A) (hg : g ≠ 1) : + quotientTrace τ ω (unitaryRepresentation τ ω (conjugateVariables τ ω p y) g : Q τ ω)=0 := by + rw [← FreeGroup.mk_toWord (x := g),unitaryRepresentation_mk] + exact conjugate_reduced_word_zero τ ω p D hp hzero y hy g.toWord + FreeGroup.isReduced_toWord (fun h => hg (FreeGroup.toWord_eq_nil_iff.mp h)) + +end + +/-! Positive and negative conjugate terms in first-order correlation. Same-sign gaps require no centering hypothesis. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {D : StarSubalgebra ℂ (Q τ ω)} {W : unitary (Q τ ω)} + +theorem HaarEndpoints.base_correlation (hW : HaarEndpoints τ ω D.toSubalgebra W) + (xi : Q τ ω) (hxi : xi ∈ D) : quotientTrace τ ω (star xi*(W : Q τ ω))=0 := by + have hstar : star xi ∈ D := star_mem hxi + have h := hW.signed_gaps τ ω (star xi) hstar 1 D.one_mem false [] trivial + simpa only [betweenWord,algebraSignedLetter,Bool.false_eq_true,ite_false,mul_one] using h + +theorem HaarEndpoints.positive_conjugate_correlation + (hW : HaarEndpoints τ ω D.toSubalgebra W) + (xi : Q τ ω) (hxi : xi ∈ D) (p z : unitary (Q τ ω)) + (hp : (p : Q τ ω) ∈ D) (hz : (z : Q τ ω) ∈ D) + (hcenter : quotientTrace τ ω (star (p : Q τ ω))=0) : + quotientTrace τ ω (star xi*(↑(p*(z*star W)*star p) : Q τ ω)*(W : Q τ ω))=0 := by + have hstar : star xi ∈ D := star_mem hxi + have hpstar : star (p : Q τ ω) ∈ D := star_mem hp + have h := hW.signed_gaps τ ω (star xi*(p : Q τ ω)*(z : Q τ ω)) + (D.mul_mem (D.mul_mem hstar hp) hz) 1 D.one_mem true [(star (p : Q τ ω),false)] + ⟨hpstar,fun _ => hcenter,trivial⟩ + change quotientTrace τ ω ((star xi*(p : Q τ ω)*(z : Q τ ω))* + (star (W : Q τ ω)*star (p : Q τ ω)*((W : Q τ ω)*1)))=0 at h + simpa only [Submonoid.coe_mul,Unitary.coe_star,mul_one,mul_assoc] using h + +theorem HaarEndpoints.negative_conjugate_correlation + (hW : HaarEndpoints τ ω D.toSubalgebra W) + (xi : Q τ ω) (hxi : xi ∈ D) (p z : unitary (Q τ ω)) + (hp : (p : Q τ ω) ∈ D) (hz : (z : Q τ ω) ∈ D) : + quotientTrace τ ω (star xi*star (↑(p*(z*star W)*star p) : Q τ ω)*(W : Q τ ω))=0 := by + have hstar : star xi ∈ D := star_mem hxi + have hpstar : star (p : Q τ ω) ∈ D := star_mem hp + have hzstar : star (z : Q τ ω) ∈ D := star_mem hz + have h := hW.signed_gaps τ ω (star xi*(p : Q τ ω)) (D.mul_mem hstar hp) + 1 D.one_mem false [(star (z : Q τ ω)*star (p : Q τ ω),false)] + ⟨D.mul_mem hzstar hpstar,fun hh => (hh rfl).elim,trivial⟩ + change quotientTrace τ ω ((star xi*(p : Q τ ω))* + ((W : Q τ ω)*(star (z : Q τ ω)*star (p : Q τ ω))*((W : Q τ ω)*1)))=0 at h + simpa only [Submonoid.coe_mul,Unitary.coe_star,star_mul,star_star,mul_one,mul_assoc] using h + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/FreeWords.lean b/lean/OAI/Analysis/FactorGeneration/FreeWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..69ac3ccca7ab8f391af9608ef4976830e900aa1d --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/FreeWords.lean @@ -0,0 +1,205 @@ +import Lean.Elab.Tactic.Omega +import Mathlib.Algebra.BigOperators.Group.Finset.Basic +import Mathlib.Algebra.BigOperators.Group.List.Basic +import Mathlib.Algebra.Group.Conj +import Mathlib.Data.Finset.Prod +import Mathlib.Data.Fintype.Fin +import Mathlib.Data.Fintype.Prod +import Mathlib.GroupTheory.FreeGroup.Basic +import Mathlib.Tactic.Linarith + +namespace OAI + +namespace Generator + +/-! Distinct nonidentity off-diagonal prefix ratios, distinguished by abelian exponent coordinates. Labels start at zero. -/ + +def freePrefix : ℕ → FreeGroup ℕ + | 0 => 1 + | n + 1 => freePrefix n * FreeGroup.of n + +def prefixRatio (k j : ℕ) : FreeGroup ℕ := freePrefix k * (freePrefix j)⁻¹ + +def exponentCoordinate (i : ℕ) : FreeGroup ℕ →* Multiplicative ℤ := + FreeGroup.lift fun j => Multiplicative.ofAdd (if i = j then 1 else 0) + +theorem freePrefix_eq_prod (n : ℕ) : + freePrefix n = ((List.range n).map FreeGroup.of).prod := by + induction n with + | zero => simp [freePrefix] + | succ n ih => rw [freePrefix, List.prod_range_succ, ih] + +theorem exponentCoordinate_prefix (i n : ℕ) : + Multiplicative.toAdd (exponentCoordinate i (freePrefix n)) = + if i < n then 1 else 0 := by + induction n with + | zero => simp [freePrefix] + | succ n ih => + rw [freePrefix, map_mul, toAdd_mul, ih] + simp only [exponentCoordinate, FreeGroup.lift_apply_of, toAdd_ofAdd] + split_ifs <;> omega + +theorem exponentCoordinate_ratio (i k j : ℕ) : + Multiplicative.toAdd (exponentCoordinate i (prefixRatio k j)) = + (if i < k then 1 else 0) - (if i < j then 1 else 0) := by + simp [prefixRatio, exponentCoordinate_prefix, sub_eq_add_neg] + +/-- Two differences of initial-segment indicators identify their endpoints, +provided the first interval is nonempty. -/ +theorem indicator_difference_injective {k j k' j' : ℕ} (hkj : k ≠ j) + (h : ∀ i : ℕ, (if i < k then (1 : ℤ) else 0) - (if i < j then 1 else 0) = + (if i < k' then 1 else 0) - (if i < j' then 1 else 0)) : + k = k' ∧ j = j' := by + have hk := h k + have hj := h j + have hk' := h k' + have hj' := h j' + omega + +theorem prefixRatio_injective_offDiagonal {k j k' j' : ℕ} (hkj : k ≠ j) + (h : prefixRatio k j = prefixRatio k' j') : k = k' ∧ j = j' := by + apply indicator_difference_injective hkj + intro i + simpa only [exponentCoordinate_ratio] using + congrArg (fun g => Multiplicative.toAdd (exponentCoordinate i g)) h + +theorem freePrefix_injective : Function.Injective freePrefix := by + intro k j h + have hk := congrArg (fun g => Multiplicative.toAdd (exponentCoordinate k g)) h + have hj := congrArg (fun g => Multiplicative.toAdd (exponentCoordinate j g)) h + simp only [exponentCoordinate_prefix] at hk hj + omega + +theorem prefixRatio_eq_one_iff (k j : ℕ) : prefixRatio k j = 1 ↔ k = j := by + rw [prefixRatio, mul_inv_eq_one] + exact freePrefix_injective.eq_iff + +/-! The exact multiplicity sum for prefix ratios, with labels g_(k+1) indexed by k : Fin n. -/ +noncomputable section +open scoped BigOperators +local instance : DecidableEq (FreeGroup ℕ) := Classical.decEq _ + +def pairRatio {n : ℕ} (ij : Fin n × Fin n) : FreeGroup ℕ := + prefixRatio (ij.1.val + 1) (ij.2.val + 1) + +theorem pairRatio_eq_one_iff {n : ℕ} (ij : Fin n × Fin n) : + pairRatio ij = 1 ↔ ij.1 = ij.2 := by + simp [pairRatio, prefixRatio_eq_one_iff, Fin.ext_iff] + +theorem pairRatio_injective_offDiagonal {n : ℕ} {ij kl : Fin n × Fin n} + (hij : ij.1 ≠ ij.2) (h : pairRatio ij = pairRatio kl) : ij = kl := by + have hne : ij.1.val + 1 ≠ ij.2.val + 1 := by + intro hval + apply hij + apply Fin.ext + omega + have he := prefixRatio_injective_offDiagonal hne h + apply Prod.ext <;> apply Fin.ext <;> omega + +def multiplicity (n : ℕ) (p : FreeGroup ℕ) : ℕ := by + classical + exact (Finset.univ.filter fun ij : Fin n × Fin n => pairRatio ij = p).card + +def ratioLabels (n : ℕ) : Finset (FreeGroup ℕ) := by + classical + exact insert 1 ((Finset.univ : Finset (Fin n)).offDiag.image pairRatio) + +theorem multiplicity_one (n : ℕ) : multiplicity n 1 = n := by + classical + have hset : (Finset.univ.filter fun ij : Fin n × Fin n => pairRatio ij = 1) = + (Finset.univ : Finset (Fin n)).diag := by + ext ij + simp [pairRatio_eq_one_iff] + simp [multiplicity, hset] + +theorem multiplicity_offDiagonal {n : ℕ} {ij : Fin n × Fin n} (hij : ij.1 ≠ ij.2) : + multiplicity n (pairRatio ij) = 1 := by + classical + have hset : (Finset.univ.filter fun kl : Fin n × Fin n => pairRatio kl = pairRatio ij) = + {ij} := by + ext kl + simp only [Finset.mem_filter, Finset.mem_univ, true_and, Finset.mem_singleton] + exact ⟨fun h => (pairRatio_injective_offDiagonal hij h.symm).symm, fun h => h ▸ rfl⟩ + simp [multiplicity, hset] + +/-- For n > 0 this is exactly the image of all ordered pairs in the source. -/ +theorem ratioLabels_eq_image {n : ℕ} (hn : 0 < n) : + ratioLabels n = (Finset.univ : Finset (Fin n × Fin n)).image pairRatio := by + classical + ext p + simp only [ratioLabels, Finset.mem_insert, Finset.mem_image, Finset.mem_univ, true_and] + constructor + · rintro (rfl | ⟨ij, _, hp⟩) + · exact ⟨(⟨0, hn⟩, ⟨0, hn⟩), (pairRatio_eq_one_iff _).mpr rfl⟩ + · exact ⟨ij, hp⟩ + · rintro ⟨ij, rfl⟩ + by_cases hij : ij.1 = ij.2 + · exact Or.inl ((pairRatio_eq_one_iff _).mpr hij) + · exact Or.inr ⟨ij, by simp [hij], rfl⟩ + +/-- n_e = n and every off-diagonal label has multiplicity one. -/ +theorem multiplicity_square_sum (n : ℕ) : + ∑ p ∈ ratioLabels n, multiplicity n p ^ 2 = 2 * n ^ 2 - n := by + classical + have hnot : (1 : FreeGroup ℕ) ∉ (Finset.univ : Finset (Fin n)).offDiag.image pairRatio := by + intro h + obtain ⟨ij, hij, heq⟩ := Finset.mem_image.mp h + exact (Finset.mem_offDiag.mp hij).2.2 ((pairRatio_eq_one_iff _).mp heq) + have hsum : ∑ p ∈ (Finset.univ : Finset (Fin n)).offDiag.image pairRatio, + multiplicity n p ^ 2 = n * n - n := by + rw [Finset.sum_image] + · calc + _ = ∑ _ij ∈ (Finset.univ : Finset (Fin n)).offDiag, (1 : ℕ) := by + apply Finset.sum_congr rfl + intro ij hij + rw [multiplicity_offDiagonal (Finset.mem_offDiag.mp hij).2.2] + simp + _ = n * n - n := by simp + · intro ij hij kl _hkl heq + exact pairRatio_injective_offDiagonal (Finset.mem_offDiag.mp hij).2.2 heq + rw [ratioLabels, Finset.sum_insert hnot, multiplicity_one, hsum] + have hn : n ≤ n * n := by nlinarith + simp only [pow_two] + omega + +end + +/-! Ordered prefix products. The element h denotes the unitary exponential of a self-adjoint operator, not its logarithm. The final letter is unperturbed. -/ +variable {G : Type*} [Group G] + +def prefixes : List G → List G + | [] => [] + | s :: ss => s :: (prefixes ss).map (fun g => s * g) + +theorem conjugate_list_prod (s : G) (xs : List G) : + (xs.map (fun g => s * g * s⁻¹)).prod = s * xs.prod * s⁻¹ := by + induction xs with + | nil => simp + | cons x xs ih => + simp only [List.map_cons, List.prod_cons] + rw [ih] + simp [mul_assoc] + +theorem prefix_perturbation (ss : List G) (h : G) : + ((prefixes ss).map (fun g => g * h * g⁻¹)).prod * ss.prod = + (ss.map (fun s => s * h)).prod := by + induction ss with + | nil => simp [prefixes] + | cons s ss ih => + have hmap : ((prefixes ss).map (fun g => (s * g) * h * (s * g)⁻¹)).prod = + s * ((prefixes ss).map (fun g => g * h * g⁻¹)).prod * s⁻¹ := by + rw [← conjugate_list_prod] + simp [List.map_map, Function.comp_def, mul_assoc] + simp only [prefixes, List.map_cons, List.map_map, Function.comp_def, List.prod_cons] + rw [hmap] + simpa only [mul_assoc, inv_mul_cancel_left] using congrArg (fun v => s * h * v) ih + +/-- The exact prefix cancellation identity with the unperturbed terminal factor. -/ +theorem prefix_perturbation_terminal (ss : List G) (h terminal : G) : + ((prefixes ss).map (fun g => g * h * g⁻¹)).prod * (ss.prod * terminal) = + (ss.map (fun s => s * h)).prod * terminal := by + rw [← mul_assoc, prefix_perturbation] + +end Generator + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/FunctionalLimits.lean b/lean/OAI/Analysis/FactorGeneration/FunctionalLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..691b324653b881cd9b5e826b6d4b5666118edf98 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/FunctionalLimits.lean @@ -0,0 +1,213 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.InnerProductSpace.Dual +import Mathlib.Analysis.Normed.Module.Dual +import Mathlib.Analysis.Normed.Module.HahnBanach +import Mathlib.Order.Filter.Ultrafilter.Basic +import Mathlib.Tactic.LinearCombination +import Mathlib.Topology.MetricSpace.ProperSpace +import OAI.Analysis.FactorGeneration.OperatorLimits + +namespace OAI + +noncomputable section + +namespace Generator + +/-! A functional bounded by a Hilbert-valued linear map factors through one +inner product. The proof uses the actual range, Hahn--Banach, and Riesz. -/ +namespace Tracial + +section +variable {E : Type*} [AddCommGroup E] [Module ℂ E] +variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℂ V] [CompleteSpace V] + +theorem exists_inner_factor_of_bound (F : E →ₗ[ℂ] V) (φ : E →ₗ[ℂ] ℂ) + (C : ℝ) (hb : ∀ x : E, ‖φ x‖ ≤ C*‖F x‖) : + ∃ η : V, ∀ x : E, φ x=inner ℂ η (F x) := by + classical + have hfiber {x y : E} (h : F x=F y) : φ x=φ y := by + have hb' := hb (x-y) + rw [map_sub,map_sub,h,sub_self,norm_zero,mul_zero] at hb' + exact sub_eq_zero.mp (norm_eq_zero.mp (le_antisymm hb' (norm_nonneg _))) + have hex (z : LinearMap.range F) : ∃ x : E, F x=z.val := z.property + choose a ha using hex + let L : LinearMap.range F →ₗ[ℂ] ℂ := + { toFun := fun z => φ (a z) + map_add' := by + intro z w + calc φ (a (z+w)) = φ (a z+a w) := hfiber (by rw [ha,map_add,ha,ha]; rfl) + _ = φ (a z)+φ (a w) := map_add φ _ _ + map_smul' := by + intro c z + calc φ (a (c • z)) = φ (c • a z) := hfiber (by rw [ha,map_smul,ha]; rfl) + _ = c • φ (a z) := map_smul φ _ _ } + have hL (x : E) : L ⟨F x,LinearMap.mem_range_self F x⟩=φ x := hfiber (ha _) + let l : LinearMap.range F →L[ℂ] ℂ := L.mkContinuous C (fun z => by + have h := hb (a z) + rw [ha] at h + exact h) + obtain ⟨g,hg,_⟩ := exists_extension_norm_eq (LinearMap.range F) l + refine ⟨(InnerProductSpace.toDual ℂ V).symm g,?_⟩ + intro x + rw [InnerProductSpace.toDual_symm_apply] + exact ((hg ⟨F x,LinearMap.mem_range_self F x⟩).trans (hL x)).symm + +end + +/-! Pointwise ultrafilter limits of uniformly bounded complex functionals. +Compactness is used only for scalar closed balls, with no separability premise. -/ +open Filter +open scoped Topology +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] + +theorem exists_bounded_functional_ultralimit {ι : Type*} (ω : Ultrafilter ι) + (f : ι → E →L[ℂ] ℂ) (C : ℝ) (hC : 0 ≤ C) (hf : ∀ i, ‖f i‖ ≤ C) : + ∃ φ : E →L[ℂ] ℂ, ‖φ‖ ≤ C ∧ + ∀ x : E, Tendsto (fun i => f i x) (ω : Filter ι) (𝓝 (φ x)) := by + have hex (x : E) : ∃ z : ℂ, ‖z‖ ≤ C*‖x‖ ∧ + Tendsto (fun i => f i x) (ω : Filter ι) (𝓝 z) := by + obtain ⟨z,hz,ht⟩ := (isCompact_closedBall (0 : ℂ) (C*‖x‖)).ultrafilter_le_nhds + (ω.map (fun i => f i x)) (by + apply le_principal_iff.mpr + change ∀ᶠ i in (ω : Filter ι), f i x ∈ Metric.closedBall 0 (C*‖x‖) + exact Eventually.of_forall (fun i => by + simpa only [Metric.mem_closedBall,dist_zero_right] using + (f i).le_of_opNorm_le (hf i) x)) + exact ⟨z,by simpa only [Metric.mem_closedBall,dist_zero_right] using hz,ht⟩ + choose v hv ht using hex + have hadd (x y : E) : v (x+y)=v x+v y := by + apply tendsto_nhds_unique (ht (x+y)) + simpa only [map_add] using (ht x).add (ht y) + have hsmul (c : ℂ) (x : E) : v (c • x)=c • v x := by + apply tendsto_nhds_unique (ht (c • x)) + simpa only [map_smul,smul_eq_mul] using (ht x).const_mul c + let φ : E →L[ℂ] ℂ := LinearMap.mkContinuous + { toFun := v, map_add' := hadd, map_smul' := hsmul } C hv + exact ⟨φ,φ.opNorm_le_bound hC hv,ht⟩ + +end Tracial + +/-! A separable normed space has a countable family of bounded linear +functionals separating its points. All functionals are constructed by +Hahn--Banach at a countable dense family of vectors. -/ +section +variable (E : Type*) [NormedAddCommGroup E] [NormedSpace ℂ E] + [TopologicalSpace.SeparableSpace E] + +theorem exists_countable_total_dual : + ∃ g : ℕ → StrongDual ℂ E, (∀ n, ‖g n‖ ≤ 1) ∧ + ∀ x : E, (∀ n, g n x = 0) → x = 0 := by + choose g hg he using fun n => exists_dual_vector'' ℂ (TopologicalSpace.denseSeq E n) + refine ⟨g, hg, fun x hx => ?_⟩ + by_contra hzero + have hp : 0 < ‖x‖ := norm_pos_iff.mpr hzero + obtain ⟨n, hn⟩ := (TopologicalSpace.denseRange_denseSeq E).exists_dist_lt x + (by positivity : 0 < ‖x‖ / 3) + have hb : ‖TopologicalSpace.denseSeq E n‖ ≤ ‖TopologicalSpace.denseSeq E n - x‖ := by + calc + ‖TopologicalSpace.denseSeq E n‖ = + ‖g n (TopologicalSpace.denseSeq E n - x)‖ := by + simp only [map_sub, hx, sub_zero, he, RCLike.norm_ofReal, + abs_of_nonneg (norm_nonneg _)] + _ ≤ ‖g n‖ * ‖TopologicalSpace.denseSeq E n - x‖ := (g n).le_opNorm _ + _ ≤ ‖TopologicalSpace.denseSeq E n - x‖ := by + simpa only [one_mul] using mul_le_mul_of_nonneg_right (hg n) (norm_nonneg _) + have ht := norm_le_norm_add_norm_sub (TopologicalSpace.denseSeq E n) x + rw [norm_sub_rev] at ht + rw [dist_eq_norm] at hn + rw [norm_sub_rev] at hb + linarith + +end + +/-! Hermitian symmetrization and complex polarization for bounded functionals. +No tracial functional or finite factor is supplied to these algebraic lemmas. -/ +open scoped CStarAlgebra +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance polarizationCStar : CStarAlgebra M.toStarSubalgebra := {} + +def conjugateFunctional (φ : M.toStarSubalgebra →L[ℂ] ℂ) : + M.toStarSubalgebra →L[ℂ] ℂ := + LinearMap.mkContinuous + { toFun := fun x => star (φ (star x)) + map_add' := by intros; simp only [star_add,map_add] + map_smul' := by intros; simp only [star_smul,map_smul,star_star,RingHom.id_apply] } + ‖φ‖ (fun x => by + change ‖star (φ (star x))‖ ≤ ‖φ‖*‖x‖ + simpa only [norm_star] using φ.le_opNorm (star x)) + +theorem conjugateFunctional_apply (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (x : M.toStarSubalgebra) : conjugateFunctional φ x=star (φ (star x)) := rfl + +theorem conjugateFunctional_norm_le (φ : M.toStarSubalgebra →L[ℂ] ℂ) : + ‖conjugateFunctional φ‖ ≤ ‖φ‖ := by + apply (conjugateFunctional φ).opNorm_le_bound (norm_nonneg φ) + intro x + simpa only [conjugateFunctional_apply,norm_star] using φ.le_opNorm (star x) + +def hermitianFunctional (φ : M.toStarSubalgebra →L[ℂ] ℂ) : + M.toStarSubalgebra →L[ℂ] ℂ := (1/2 : ℂ) • (φ+conjugateFunctional φ) + +theorem hermitianFunctional_apply (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (x : M.toStarSubalgebra) : hermitianFunctional φ x=(φ x+star (φ (star x)))/2 := by + simp only [hermitianFunctional,smul_apply,add_apply, + conjugateFunctional_apply,smul_eq_mul] + ring + +theorem hermitianFunctional_norm_le (φ : M.toStarSubalgebra →L[ℂ] ℂ) : + ‖hermitianFunctional φ‖ ≤ ‖φ‖ := by + change ‖(1/2 : ℂ) • (φ+conjugateFunctional φ)‖ ≤ _ + rw [norm_smul] + have h := norm_add_le φ (conjugateFunctional φ) + have h' := conjugateFunctional_norm_le φ + norm_num + linarith + +theorem hermitianFunctional_star (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (x : M.toStarSubalgebra) : hermitianFunctional φ (star x)=star (hermitianFunctional φ x) := by + simp only [hermitianFunctional_apply,star_star,star_div₀,star_add,star_ofNat] + rw [add_comm] + +theorem hermitianFunctional_selfAdjoint (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + hermitianFunctional φ x=((φ x).re : ℂ) := by + rw [hermitianFunctional_apply,hx.star_eq] + exact (Complex.re_eq_add_conj _).symm + +theorem hermitianFunctional_one (φ : M.toStarSubalgebra →L[ℂ] ℂ) (hφ : φ 1=1) : + hermitianFunctional φ 1=1 := by + rw [hermitianFunctional_selfAdjoint φ 1 (IsSelfAdjoint.one _),hφ] + rfl + +/-- Equality of complex quadratic values polarizes to the full trace identity. -/ +theorem functional_trace_of_quadratic (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (hφ : ∀ x : M.toStarSubalgebra, φ (star x*x)=φ (x*star x)) + (x y : M.toStarSubalgebra) : φ (x*y)=φ (y*x) := by + have hp := hφ (x+star y) + have hi := hφ (x+Complex.I • star y) + simp only [star_add,star_star,add_mul,mul_add,map_add] at hp + simp only [star_add,star_smul,star_star,add_mul,mul_add,smul_mul_assoc, + mul_smul_comm,map_add,map_smul,smul_eq_mul] at hi + rw [hφ x,← hφ y] at hp hi + simp only [show star Complex.I = -Complex.I from Complex.conj_I] at hi + linear_combination (norm := ring_nf) -(1/2 : ℂ)*hp - (Complex.I/2)*hi + simp only [Complex.I_sq] + ring + +theorem hermitianFunctional_trace (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (hφ : ∀ x : M.toStarSubalgebra, (φ (star x*x)).re=(φ (x*star x)).re) + (x y : M.toStarSubalgebra) : hermitianFunctional φ (x*y)=hermitianFunctional φ (y*x) := by + apply functional_trace_of_quadratic + intro z + rw [hermitianFunctional_selfAdjoint φ _ (IsSelfAdjoint.star_mul_self z), + hermitianFunctional_selfAdjoint φ _ (IsSelfAdjoint.mul_star_self z),hφ z] + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Generation.lean b/lean/OAI/Analysis/FactorGeneration/Generation.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc85a8ba7953c12f6a081ca789e4bd57307a09d7 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Generation.lean @@ -0,0 +1,209 @@ +import OAI.Analysis.FactorGeneration.AmplificationEncoding +import OAI.Analysis.FactorGeneration.Correlation +import OAI.Analysis.FactorGeneration.MatrixGenerators +import OAI.Analysis.FactorGeneration.PerturbationBounds +import OAI.Analysis.FactorGeneration.RelativeGeneration + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Relative generation under represented-factor hypotheses: unitaries in a dense G-delta set satisfy W*(N,u)=M. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem relative_generation_at_continuity (u : TraceUnitary τ) + (hcont : ∀ x : M.toStarSubalgebra, + ContinuousAt (fun v => projectionNorm (relativeTraceSpace (N := N) τ v) (baseVector τ x)) u) : + relativeGenerated (N := N) τ u=M := by + classical + by_contra hneq + let Q := relativeGenerated (N := N) τ u + have hQM : Q ≤ M := relativeGenerated_le τ hNM u + obtain ⟨z,hz⟩ := exists_unitary_outside hQM hneq + let xi := subalgebraResidual τ hQM (z : M.toStarSubalgebra) + let s : ℝ := τ.norm₂ xi + have hs : 0 < s := subalgebraResidual_norm_pos τ hQM _ hz + let α : ℝ := min (1/4) (s/32)/2 + have hα : 0 < α := half_pos (lt_min (by norm_num) (by positivity)) + have hq : α < 1/4 := by + have h := min_le_left (1/4 : ℝ) (s/32) + dsimp [α] at hα ⊢ + linarith + have hsmall : α < s/32 := by + have h := min_le_right (1/4 : ℝ) (s/32) + dsimp [α] at hα ⊢ + linarith + have hhalf : α < 1/2 := by linarith + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + have hω : (ω : Filter ℕ) ≤ atTop := Ultrafilter.of_le atTop + have he (n : ℕ) := exists_represented_perturbation τ ω hNM hfactor hdiff hirr hsep hω + u.toUnitary z xi (n+1) (Nat.succ_pos _) α hα hhalf + choose v t hv ht using he + let V : ℕ → TraceUnitary τ := fun n => ⟨v n⟩ + have hV : Tendsto V atTop (𝓝 u) := by + apply (TraceUnitary.tendsto_iff τ atTop V u).mpr + exact squeeze_zero (fun _ => norm_nonneg _) hv (perturbation_size_tendsto α) + let F : TraceUnitary τ → ℝ := fun v => + projectionNorm (relativeTraceSpace (N := N) τ v) (baseVector τ xi) + have hFzero : F u=0 := by + change ‖(vectorOrbitClosure Q.toStarSubalgebra τ.vector).starProjection + (baseVector τ (subalgebraResidual τ hQM (z : M.toStarSubalgebra)))‖=0 + rw [subalgebraResidual_projection,norm_zero] + let δ : ℕ → ℝ := fun n => 1/((n+1 : ℕ) : ℝ) + have hδ : Tendsto δ atTop (𝓝 0) := + tendsto_one_div_atTop_nhds_zero_nat.comp (tendsto_add_atTop_nat 1) + let c : ℕ → ℂ := fun n => τ.trace (star xi*relativeUnitaryWord τ hNM (V n) (t n) (n+1)) + have hc (n : ℕ) : ‖c n-((α*s^2/2 : ℝ) : ℂ)‖ ≤ + s*(4*α^2/(1-2*α))+δ n := by + have hn := ht n + have hcorr : τ.trace (star xi*(z : M.toStarSubalgebra))=(s : ℂ)^2 := + subalgebraResidual_correlation τ hQM (z : M.toStarSubalgebra) + rw [hcorr] at hn + have heq : ((α*s^2/2 : ℝ) : ℂ)=(α : ℂ)/2*(s : ℂ)^2 := by + push_cast + ring + rw [heq] + exact hn + have hproj (n : ℕ) : ‖c n‖ ≤ F (V n) := + relativeUnitaryWord_correlation_le τ hNM (V n) (t n) (n+1) xi + exact no_continuous_correlated_sequence F (hcont xi) hFzero V hV δ hδ c + hs hα hq hsmall hc hproj + +theorem represented_relative_generation : + ∃ C : Set (TraceUnitary τ), IsGδ C ∧ Dense C ∧ + ∀ u ∈ C, wstar ((N : Set (H →L[ℂ] H)) ∪ {(u.algebra τ).val})=M.toStarSubalgebra := by + obtain ⟨C,hC,hd,hcont⟩ := common_relative_projection_continuity_algebra τ hNM hsep + refine ⟨C,hC,hd,fun u hu => ?_⟩ + exact congrArg VonNeumannAlgebra.toStarSubalgebra + (relative_generation_at_continuity τ hNM hfactor hdiff hirr hsep u (hcont u hu)) + +end + +/-! Four generators under a faithful normalized vector trace and trace-vector separability. -/ +open scoped ComplexStarModule +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem represented_four_selfAdjoint_generators (τ : TracialRepresentation M) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ a ∈ M,∃ b ∈ M,∃ c ∈ M,∃ d ∈ M, + IsSelfAdjoint a ∧ IsSelfAdjoint b ∧ IsSelfAdjoint c ∧ IsSelfAdjoint d ∧ + wstar {a,b,c,d}=M.toStarSubalgebra := by + obtain ⟨P,hPM,hP,hscalar,a,ha,b,hb,hsa,hsb,hPgen⟩ := + exists_irreducible_two_generated_subfactor τ le_rfl hfactor hdiff + (fun c hc => hfactor c hc) hsep + have hPfactor (c : P.toStarSubalgebra) (hc : ∀ a : P.toStarSubalgebra,a*c=c*a) : + ∃ z : ℂ,c=z • (1 : P.toStarSubalgebra) := by + obtain ⟨z,hz⟩ := hP.factor c hc + exact ⟨z,by simpa only [Algebra.algebraMap_eq_smul_one] using hz⟩ + have hirr (c : M.toStarSubalgebra) + (hc : ∀ a : P.toStarSubalgebra,coordinateInclusion hPM a*c=c*coordinateInclusion hPM a) : + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra) := + ⟨τ.trace c,hscalar c (fun a => congrArg Subtype.val (hc a))⟩ + obtain ⟨C,_,hC,hgen⟩ := represented_relative_generation τ hPM hPfactor hP.diffuse hirr hsep + let : Nonempty (TraceUnitary τ) := ⟨⟨1⟩⟩ + obtain ⟨u,hu⟩ := hC.nonempty + let v : H →L[ℂ] H := (u.algebra τ).val + have hv : v ∈ M.toStarSubalgebra := (u.algebra τ).property + have hvgen : wstar ((P : Set (H →L[ℂ] H)) ∪ {v})=M.toStarSubalgebra := hgen u hu + refine ⟨a,hPM ha,b,hPM hb,ℜ v,realPart_mem _ hv,ℑ v,imaginaryPart_mem _ hv, + hsa,hsb,(ℜ v).property,(ℑ v).property,le_antisymm ?_ ?_⟩ + · exact wstar_le (vonNeumann_wotClosed M) + (by rintro _ (rfl | rfl | rfl | rfl) + · exact hPM ha + · exact hPM hb + · exact realPart_mem _ hv + · exact imaginaryPart_mem _ hv) + · let Q := wstar {a,b,(ℜ v : H →L[ℂ] H),(ℑ v : H →L[ℂ] H)} + have hPQ : P.toStarSubalgebra ≤ Q := by + rw [← hPgen] + exact wstar_mono (by intro x hx; simp only [Set.mem_insert_iff,Set.mem_singleton_iff] at hx ⊢; tauto) + rw [← hvgen] + apply wstar_le (wstar_closed _) + rintro x (hx | rfl) + · exact hPQ hx + · apply (mem_iff_parts_mem Q v).mpr + exact ⟨subset_wstar _ (by simp),subset_wstar _ (by simp)⟩ + +end + +/-! Single generation for the explicit faithful normalized vector-trace +representation with separable trace-vector range. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem represented_two_selfAdjoint_generators (τ : TracialRepresentation M) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ a ∈ M,∃ b ∈ M,IsSelfAdjoint a ∧ IsSelfAdjoint b ∧ wstar {a,b}=M.toStarSubalgebra := by + obtain ⟨E,_,_,_,_,_⟩ := exists_commuting_matrix_extension τ + (FiniteMatrixStage.scalarStage M).units ⟨0,(FiniteMatrixStage.scalarStage M).positive⟩ hfactor hdiff 2 (by norm_num) + let N := E.relativeVonNeumann + let τN := restrictedTrace τ E.relativeVonNeumann_le + have hsepN : TopologicalSpace.IsSeparable (Set.range (baseVector τN)) := by + apply hsep.mono + rintro y ⟨a,rfl⟩ + exact ⟨coordinateInclusion E.relativeVonNeumann_le a,rfl⟩ + obtain ⟨a,ha,b,hb,c,hc,d,hd,hsa,hsb,hsc,hsd,hgen⟩ := represented_four_selfAdjoint_generators + τN (E.relative_scalar_center 0 hfactor) (E.relative_diffuse 0 hdiff) hsepN + let a' : E.commutant := E.relativeEquiv.symm ⟨a,ha⟩ + let b' : E.commutant := E.relativeEquiv.symm ⟨b,hb⟩ + let c' : E.commutant := E.relativeEquiv.symm ⟨c,hc⟩ + let d' : E.commutant := E.relativeEquiv.symm ⟨d,hd⟩ + have hs (x : H →L[ℂ] H) (hx : x ∈ N) (h : IsSelfAdjoint x) : + IsSelfAdjoint (E.relativeEquiv.symm ⟨x,hx⟩) := + (show IsSelfAdjoint (⟨x,hx⟩ : N.toStarSubalgebra) from Subtype.ext h.star_eq).map E.relativeEquiv.symm + exact E.two_generators_of_four_commutant_generators a' b' c' d' + (hs a ha hsa) (hs b hb hsb) (hs c hc hsc) (hs d hd hsd) hgen + +theorem represented_single_generator (τ : TracialRepresentation M) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + SinglyGenerated M.toStarSubalgebra := by + obtain ⟨a,ha,b,hb,hsa,hsb,hgen⟩ := represented_two_selfAdjoint_generators τ hfactor hdiff hsep + exact ⟨a+Complex.I • b,M.add_mem ha (M.smul_mem hb _),(wstar_pack hsa hsb).trans hgen⟩ + +theorem singlyGenerated_of_tracialRepresentation (hM : IsII1Factor M.toStarSubalgebra) + (τ : TracialRepresentation M) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + SinglyGenerated M.toStarSubalgebra := by + apply represented_single_generator τ _ hM.diffuse hsep + intro c hc + obtain ⟨z,hz⟩ := hM.factor c hc + exact ⟨z,by simpa only [Algebra.algebraMap_eq_smul_one] using hz⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/GroupTrace.lean b/lean/OAI/Analysis/FactorGeneration/GroupTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..52bf1376e9c0ff9736998e02b11ea372d969e45d --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/GroupTrace.lean @@ -0,0 +1,391 @@ +import OAI.Analysis.FreeGroupFactor.Operators +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Topology.Order + +namespace OAI + +noncomputable section + +namespace UltrapowerBridge + +section +open scoped ENNReal Pointwise +local instance groupAlgebraDecEq (G : Type*) : DecidableEq G := Classical.decEq _ +abbrev Ell2 (G : Type*) := FreeGroupFactorMain.GroupHilbert G +abbrev Operator (G : Type*) := FreeGroupFactorMain.GroupOperator G +/-- Reindex a square-summable vector by a permutation. -/ +abbrev reindexVector {G : Type*} (e : G ≃ G) (f : Ell2 G) : Ell2 G := + FreeGroupFactorMain.hilbertReindex e f + +@[simp] theorem reindexVector_apply {G : Type*} (e : G ≃ G) (f : Ell2 G) (g : G) : + reindexVector e f g = f (e.symm g) := rfl + +theorem reindexVector_norm {G : Type*} (e : G ≃ G) (f : Ell2 G) : + ‖reindexVector e f‖ = ‖f‖ := by + exact (FreeGroupFactorMain.hilbertReindex e).norm_map f + +/-- The bounded unitary implementation of a permutation on ell2. -/ +abbrev reindex {G : Type*} (e : G ≃ G) : Ell2 G ≃ₗᵢ[ℂ] Ell2 G := + FreeGroupFactorMain.hilbertReindex e + +/-- The left regular operator, constructed on every square-summable vector. -/ +abbrev leftRegular {G : Type*} [Group G] (g : G) : Ell2 G →L[ℂ] Ell2 G := + FreeGroupFactorMain.leftRegular g + +@[simp] theorem leftRegular_apply {G : Type*} [Group G] (g b : G) (f : Ell2 G) : + leftRegular g f b = f (g⁻¹ * b) := rfl + +@[simp] theorem leftRegular_one {G : Type*} [Group G] : leftRegular (1 : G) = 1 := by + ext f b + simp + +@[simp] theorem leftRegular_mul {G : Type*} [Group G] (g h : G) : + leftRegular (g * h) = leftRegular g * leftRegular h := by + ext f b + simp + +theorem leftRegular_norm_vector {G : Type*} [Group G] (g : G) (f : Ell2 G) : + ‖leftRegular g f‖ = ‖f‖ := reindexVector_norm (Equiv.mulLeft g) f + +variable (G : Type*) [Group G] + +abbrev regularOperators : Set (Operator G) := FreeGroupFactorMain.leftTranslations G +abbrev groupAlgebra : StarSubalgebra ℂ (Operator G) := + FreeGroupFactorMain.groupVonNeumann G + +def delta : Ell2 G := by + classical + exact lp.single 2 (1 : G) 1 +def trace (T : groupAlgebra G) : ℂ := inner ℂ (delta G) ((T : Operator G) (delta G)) + +@[simp] theorem leftRegular_trace (g : G) : + inner ℂ (delta G) (leftRegular g (delta G)) = if g = 1 then 1 else 0 := by + classical + rw [delta, lp.inner_single_left] + simp [lp.single_apply, Pi.single_apply] + +variable {G} +@[simp] theorem leftRegular_star {G : Type*} [Group G] (g : G) : + star (leftRegular g) = leftRegular g⁻¹ := by + change star ((reindex (Equiv.mulLeft g)) : Ell2 G →L[ℂ] Ell2 G) = _ + rw [LinearIsometryEquiv.star_eq_symm] + ext f b + change f (g * b) = f ((g⁻¹)⁻¹ * b) + simp + +/-- Right translations, needed to prove that the identity vector is separating. -/ +def rightRegular {G : Type*} [Group G] (g : G) : Ell2 G →L[ℂ] Ell2 G := + (reindex (Equiv.mulRight g)).toContinuousLinearEquiv.toContinuousLinearMap + +@[simp] theorem rightRegular_apply {G : Type*} [Group G] (g b : G) (f : Ell2 G) : + rightRegular g f b = f (b * g⁻¹) := rfl + +theorem left_right_commute {G : Type*} [Group G] (g h : G) : + leftRegular g * rightRegular h = rightRegular h * leftRegular g := by + ext f b + simp [mul_assoc] + +theorem regularOperators_star (G : Type*) [Group G] : + star (regularOperators G) = regularOperators G := by + rw [regularOperators, FreeGroupFactorMain.leftTranslations_eq_range] + ext T + simp only [Set.mem_star, Set.mem_range] + constructor + · rintro ⟨g, hg⟩ + exact ⟨g⁻¹, by simpa only [leftRegular_star, star_star] using congrArg star hg⟩ + · rintro ⟨g, rfl⟩ + exact ⟨g⁻¹, (leftRegular_star g).symm⟩ + +/-- Exact equality with the manuscript's plain double commutant of lambda(G). -/ +theorem groupAlgebra_carrier (G : Type*) [Group G] : + (groupAlgebra G : Set (Operator G)) = + Set.centralizer (Set.centralizer (regularOperators G)) := by + rw [groupAlgebra, FreeGroupFactorMain.groupVonNeumann, + StarSubalgebra.coe_centralizer_centralizer, + regularOperators_star, Set.union_self] + +/-- The target algebra actually satisfies mathlib's concrete von Neumann algebra definition. -/ +abbrev concreteGroupAlgebra (G : Type*) [Group G] : VonNeumannAlgebra (Ell2 G) := + FreeGroupFactorMain.groupVonNeumannBundled G + +theorem rightRegular_mem_commutant (G : Type*) [Group G] (g : G) : + rightRegular g ∈ StarSubalgebra.centralizer ℂ (regularOperators G) := by + rw [StarSubalgebra.mem_centralizer_iff] + intro T hT + rw [regularOperators, FreeGroupFactorMain.leftTranslations_eq_range] at hT + obtain ⟨h, rfl⟩ := hT + exact ⟨left_right_commute h g, by rw [leftRegular_star]; exact left_right_commute h⁻¹ g⟩ + +theorem algebra_right_commute (G : Type*) [Group G] (T : groupAlgebra G) + (g : G) : + (T : Operator G) * rightRegular g = + rightRegular g * (T : Operator G) := by + have ht := T.property + change (T : Operator G) ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (regularOperators G) : Set (Operator G)) at ht + rw [StarSubalgebra.mem_centralizer_iff] at ht + exact (ht (rightRegular g) (rightRegular_mem_commutant G g)).1.symm + +theorem rightRegular_delta (G : Type*) [Group G] (g : G) : + rightRegular g (delta G) = lp.single 2 g (1 : ℂ) := by + classical + ext b + simp [delta, lp.single_apply, Pi.single_apply, mul_inv_eq_one] + +/-- Fourier coefficients at the identity separate all elements of the group algebra, +by commuting with right translations and using the density of finitely supported vectors. -/ +theorem delta_separating (G : Type*) [Group G] (T : groupAlgebra G) + (hT : (T : Operator G) (delta G) = 0) : T = 0 := by + classical + apply Subtype.ext + change (T : Operator G) = 0 + apply lp.ext_continuousLinearMap (by simp) + intro g + apply ContinuousLinearMap.ext + intro c + change (T : Operator G) (lp.single 2 g c) = 0 + have hs : lp.single 2 g c = c • rightRegular g (delta G) := by + rw [rightRegular_delta, ← lp.single_smul] + simp + have hz : (T : Operator G) (rightRegular g (delta G)) = 0 := by + change ((T : Operator G) * rightRegular g) (delta G) = 0 + rw [algebra_right_commute] + change rightRegular g ((T : Operator G) (delta G)) = 0 + rw [hT, map_zero] + rw [hs, map_smul, hz, smul_zero] + +/-- The canonical vector functional evaluated on a positive square. -/ +theorem trace_star_mul_self (G : Type*) [Group G] (T : groupAlgebra G) : + trace G (star T * T) = + inner ℂ ((T : Operator G) (delta G)) + ((T : Operator G) (delta G)) := by + exact ContinuousLinearMap.adjoint_inner_right (T : Operator G) + (delta G) ((T : Operator G) (delta G)) + +/-- Faithfulness of the canonical vector trace. -/ +theorem trace_faithful (G : Type*) [Group G] (T : groupAlgebra G) : + trace G (star T * T) = 0 ↔ T = 0 := by + rw [trace_star_mul_self, inner_self_eq_zero] + constructor + · exact delta_separating G T + · intro h + subst T + simp + +end + +section +local instance traceDecEq (G : Type*) : DecidableEq G := Classical.decEq _ +open scoped ComplexConjugate +variable {G : Type*} [Group G] + +@[simp] theorem delta_inner (ξ : Ell2 G) : inner ℂ (delta G) ξ = ξ 1 := by + classical + simp [delta, lp.inner_single_left] + +theorem algebra_apply_single (T : groupAlgebra G) (g b : G) : + (T : Operator G) (lp.single 2 g (1 : ℂ)) b = + (T : Operator G) (delta G) (b * g⁻¹) := by + rw [← rightRegular_delta G g] + have h := congrArg (fun S : Operator G => S (delta G) b) (algebra_right_commute G T g) + exact h + +theorem adjoint_coefficient (T : groupAlgebra G) (g : G) : + star (((star T : groupAlgebra G) : Operator G) (delta G) g) = + (T : Operator G) (delta G) g⁻¹ := by + classical + have h := ContinuousLinearMap.adjoint_inner_left (T : Operator G) + (lp.single 2 g (1 : ℂ)) (delta G) + simpa [lp.inner_single_right, delta_inner, algebra_apply_single, + RCLike.inner_apply, ContinuousLinearMap.star_eq_adjoint] using h + +theorem trace_mul_formula (S T : groupAlgebra G) : + trace G (S * T) = ∑' g : G, + (S : Operator G) (delta G) g⁻¹ * (T : Operator G) (delta G) g := by + change inner ℂ (delta G) ((S : Operator G) ((T : Operator G) (delta G))) = _ + rw [← ContinuousLinearMap.adjoint_inner_left, lp.inner_eq_tsum] + apply tsum_congr + intro g + rw [RCLike.inner_apply] + change _ * star (((star S : groupAlgebra G) : Operator G) (delta G) g) = _ + rw [adjoint_coefficient, mul_comm] + +/-- Cyclicity for all bounded operators in the actual double commutant. -/ +theorem trace_mul_comm (S T : groupAlgebra G) : trace G (S * T) = trace G (T * S) := by + rw [trace_mul_formula, trace_mul_formula] + rw [← (Equiv.inv G).tsum_eq (fun g : G => + (T : Operator G) (delta G) g⁻¹ * (S : Operator G) (delta G) g)] + apply tsum_congr + intro g + simp [mul_comm] + +@[simp] theorem trace_one : trace G (1 : groupAlgebra G) = 1 := by + classical + simp [trace, delta] + +@[simp] theorem trace_add (S T : groupAlgebra G) : trace G (S + T) = trace G S + trace G T := by + exact inner_add_right _ _ _ + +@[simp] theorem trace_smul (c : ℂ) (T : groupAlgebra G) : trace G (c • T) = c * trace G T := by + exact inner_smul_right _ _ _ + +def traceLinear : groupAlgebra G →ₗ[ℂ] ℂ where + toFun := trace G + map_add' := trace_add + map_smul' := trace_smul + +/-- The canonical trace two-norm is the norm of the identity-vector image. -/ +def traceNorm (T : groupAlgebra G) : ℝ := ‖(T : Operator G) (delta G)‖ + +theorem traceNorm_sq (T : groupAlgebra G) : + traceNorm T ^ 2 = (trace G (star T * T)).re := by + rw [trace_star_mul_self] + simp [traceNorm, inner_self_eq_norm_sq_to_K, ← Complex.ofReal_pow] + +end + +section +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- A concrete finite tracial von Neumann algebra in a faithful vector-trace +representation. These are operator-algebra data, without approximation assumptions. -/ +structure TracialRepresentation (M : VonNeumannAlgebra H) where + vector : H + norm_vector : ‖vector‖ = 1 + cyclic : ∀ S T : M.toStarSubalgebra, + inner ℂ vector ((S : H →L[ℂ] H) ((T : H →L[ℂ] H) vector)) = + inner ℂ vector ((T : H →L[ℂ] H) ((S : H →L[ℂ] H) vector)) + separating : ∀ T : M.toStarSubalgebra, (T : H →L[ℂ] H) vector = 0 → T = 0 + +namespace TracialRepresentation +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +abbrev Algebra := M.toStarSubalgebra + +def trace (T : Algebra (M := M)) : ℂ := inner ℂ τ.vector ((T : H →L[ℂ] H) τ.vector) +def norm₂ (T : Algebra (M := M)) : ℝ := ‖(T : H →L[ℂ] H) τ.vector‖ + +@[simp] theorem trace_one : τ.trace 1 = 1 := by + simp [trace, inner_self_eq_norm_sq_to_K, τ.norm_vector] + +theorem trace_mul_comm (S T : Algebra (M := M)) : τ.trace (S*T) = τ.trace (T*S) := + τ.cyclic S T + +theorem trace_star_mul (T : Algebra (M := M)) : + τ.trace (star T*T) = (τ.norm₂ T : ℂ)^2 := by + unfold trace norm₂ + change inner ℂ τ.vector ((star (T : H →L[ℂ] H)) ((T : H →L[ℂ] H) τ.vector)) = _ + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right, inner_self_eq_norm_sq_to_K] + norm_cast + +theorem norm₂_star (T : Algebra (M := M)) : τ.norm₂ (star T) = τ.norm₂ T := by + have h := τ.trace_mul_comm (star T) T + have h2 := τ.trace_star_mul (star T) + simp only [star_star] at h2 + rw [τ.trace_star_mul, h2] at h + have hr := congrArg Complex.re h + simp only [← Complex.ofReal_pow, Complex.ofReal_re] at hr + have hn : 0 ≤ τ.norm₂ T := norm_nonneg _ + have hs : 0 ≤ τ.norm₂ (star T) := norm_nonneg _ + nlinarith + +@[simp] theorem norm₂_zero : τ.norm₂ 0 = 0 := by simp [norm₂] +@[simp] theorem norm₂_sub (S T : Algebra (M := M)) : + τ.norm₂ (S-T) = ‖(S : H →L[ℂ] H) τ.vector - (T : H →L[ℂ] H) τ.vector‖ := rfl + +theorem norm₂_add_le (S T : Algebra (M := M)) : τ.norm₂ (S+T) ≤ τ.norm₂ S+τ.norm₂ T := + norm_add_le _ _ + +theorem norm₂_smul (c : ℂ) (T : Algebra (M := M)) : τ.norm₂ (c • T) = ‖c‖*τ.norm₂ T := + norm_smul _ _ + +theorem norm₂_mul_le (S T : Algebra (M := M)) : τ.norm₂ (S*T) ≤ ‖S‖ * τ.norm₂ T := + (S : H →L[ℂ] H).le_opNorm ((T : H →L[ℂ] H) τ.vector) + +theorem norm₂_mul_le_right (S T : Algebra (M := M)) : τ.norm₂ (S*T) ≤ τ.norm₂ S * ‖T‖ := by + rw [← τ.norm₂_star (S*T), star_mul] + have h := τ.norm₂_mul_le (star T) (star S) + simpa [τ.norm₂_star, mul_comm, ContinuousLinearMap.star_eq_adjoint] using h + +theorem norm₂_le_norm (T : Algebra (M := M)) : τ.norm₂ T ≤ ‖T‖ := by + have h := (T : H →L[ℂ] H).le_opNorm τ.vector + simpa [norm₂, τ.norm_vector] using h + +theorem norm_trace_le_norm₂ (T : Algebra (M := M)) : ‖τ.trace T‖ ≤ τ.norm₂ T := by + simpa [trace, norm₂, τ.norm_vector] using norm_inner_le_norm τ.vector ((T : H →L[ℂ] H) τ.vector) + +theorem norm₂_eq_zero_iff (T : Algebra (M := M)) : τ.norm₂ T = 0 ↔ T = 0 := by + constructor + · intro h + exact τ.separating T (norm_eq_zero.mp h) + · rintro rfl + exact τ.norm₂_zero + +end TracialRepresentation + +local instance finiteTraceDecEq (G : Type*) : DecidableEq G := Classical.decEq _ +/-- The actual group algebra supplies the concrete tracial data; no group +approximation, ICC, factor, or countability premise occurs. -/ +def groupTracialRepresentation (G : Type*) [Group G] : + TracialRepresentation (concreteGroupAlgebra G) where + vector := delta G + norm_vector := by simp [delta, lp.norm_single] + cyclic := trace_mul_comm + separating := delta_separating G + +end + +variable (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- The actual ultraweak topology, generated by absolutely summable vector +functionals. No continuity of a chosen trace is built into this definition. -/ +@[instance_reducible] def ultraweakTopology : TopologicalSpace (H →L[ℂ] H) := + ⨅ (ξ : ℕ → H) (η : ℕ → H) (_ : Summable (fun n => ‖ξ n‖ * ‖η n‖)), + TopologicalSpace.induced (fun T : H →L[ℂ] H => ∑' n, inner ℂ (ξ n) (T (η n))) + inferInstance + +variable {H} +omit [CompleteSpace H] in +theorem vectorFunctional_ultraweak_continuous (ξ η : H) : + @Continuous _ _ (ultraweakTopology H) inferInstance + (fun T : H →L[ℂ] H => inner ℂ ξ (T η)) := by + let x : ℕ → H := fun n => if n = 0 then ξ else 0 + let y : ℕ → H := fun n => if n = 0 then η else 0 + have hs : Summable (fun n => ‖x n‖ * ‖y n‖) := by + exact (hasSum_ite_eq (0 : ℕ) (‖ξ‖ * ‖η‖)).summable.congr (by intro n; by_cases h : n = 0 <;> simp [x,y,h]) + have hc : @Continuous _ _ (ultraweakTopology H) inferInstance + (fun T : H →L[ℂ] H => ∑' n, inner ℂ (x n) (T (y n))) := + continuous_iInf_dom (i := x) (continuous_iInf_dom (i := y) + (continuous_iInf_dom (i := hs) continuous_induced_dom)) + have he (T : H →L[ℂ] H) : + (fun n => inner ℂ (x n) (T (y n))) = + (fun n => if n = 0 then inner ℂ ξ (T η) else 0) := by + funext n + by_cases h : n = 0 <;> simp [x,y,h] + have hf : (fun T : H →L[ℂ] H => ∑' n, inner ℂ (x n) (T (y n))) = + (fun T => inner ℂ ξ (T η)) := by + funext T + rw [he] + exact tsum_ite_eq 0 _ + rw [hf] at hc + exact hc + +@[instance_reducible] def algebraUltraweakTopology (M : VonNeumannAlgebra H) : + TopologicalSpace M.toStarSubalgebra := + TopologicalSpace.induced (fun T : M.toStarSubalgebra => (T : H →L[ℂ] H)) (ultraweakTopology H) + +/-- Vector traces are normal, expressed as continuity for the actual ultraweak topology. -/ +theorem TracialRepresentation.trace_normal {M : VonNeumannAlgebra H} + (τ : TracialRepresentation M) : + @Continuous _ _ (algebraUltraweakTopology M) inferInstance τ.trace := + @Continuous.comp _ _ _ (algebraUltraweakTopology M) (ultraweakTopology H) _ + _ _ (vectorFunctional_ultraweak_continuous τ.vector τ.vector) continuous_induced_dom + +end UltrapowerBridge + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/HaarIndependence.lean b/lean/OAI/Analysis/FactorGeneration/HaarIndependence.lean new file mode 100644 index 0000000000000000000000000000000000000000..f22d25e8bf9100e8ce99c7faf01fef5ad15fba0c --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/HaarIndependence.lean @@ -0,0 +1,261 @@ +import OAI.Analysis.FactorGeneration.ProductWords +import OAI.Analysis.FactorGeneration.ResidualCompletion + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Two-norm continuity of ordered moments along uniformly operator-bounded +representatives. No topological-ring structure on the two-norm quotient is used. -/ +section +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem quotient_bounded_mul_norm (a : Bounded M) (C : ℝ) (ha : ∀ j,‖a.val j‖ ≤ C) + (b : Q τ ω) : ‖quotientMap τ (ω : Filter ℕ) a*b‖ ≤ C*‖b‖ := by + induction b using Quotient.inductionOn with + | h b => + have hp := quotient_norm_tendsto τ ω (a*b) + have hb := (quotient_norm_tendsto τ ω b).const_mul C + rw [map_mul] at hp + apply le_of_tendsto_of_tendsto hp hb + exact Eventually.of_forall (fun j => (τ.norm₂_mul_le (a.val j) (b.val j)).trans + (mul_le_mul_of_nonneg_right (ha j) (norm_nonneg _))) + +theorem quotient_mul_bounded_norm (a : Bounded M) (C : ℝ) (ha : ∀ j,‖a.val j‖ ≤ C) + (b : Q τ ω) : ‖b*quotientMap τ (ω : Filter ℕ) a‖ ≤ C*‖b‖ := by + induction b using Quotient.inductionOn with + | h b => + have hp := quotient_norm_tendsto τ ω (b*a) + have hb := (quotient_norm_tendsto τ ω b).const_mul C + rw [map_mul] at hp + apply le_of_tendsto_of_tendsto hp hb + apply Eventually.of_forall + intro j + calc τ.norm₂ (b.val j*a.val j) ≤ τ.norm₂ (b.val j)*‖a.val j‖ := τ.norm₂_mul_le_right _ _ + _ ≤ τ.norm₂ (b.val j)*C := mul_le_mul_of_nonneg_left (ha j) (norm_nonneg _) + _ = C*τ.norm₂ (b.val j) := mul_comm _ _ + +theorem quotient_fixed_right_tendsto (b : Q τ ω) (a : ℕ → Q τ ω) (v : Q τ ω) + (ha : Tendsto a atTop (𝓝 v)) : Tendsto (fun n => a n*b) atTop (𝓝 (v*b)) := by + obtain ⟨b',hb⟩ := quotientMap_surjective τ (ω : Filter ℕ) b + obtain ⟨C,_,hbound⟩ := b'.property + apply tendsto_iff_norm_sub_tendsto_zero.mpr + have ht := (tendsto_iff_norm_sub_tendsto_zero.mp ha).const_mul C + apply squeeze_zero (fun n => norm_nonneg _) _ (by simpa only [mul_zero] using ht) + intro n + rw [← sub_mul,← hb] + exact quotient_mul_bounded_norm τ ω b' C hbound (a n-v) + +theorem quotient_bounded_mul_tendsto (a : ℕ → Bounded M) (C : ℝ) + (hC : ∀ n j,‖(a n).val j‖ ≤ C) (v : Q τ ω) (b : ℕ → Q τ ω) (w : Q τ ω) + (ha : Tendsto (fun n => quotientMap τ (ω : Filter ℕ) (a n)) atTop (𝓝 v)) + (hb : Tendsto b atTop (𝓝 w)) : + Tendsto (fun n => quotientMap τ (ω : Filter ℕ) (a n)*b n) atTop (𝓝 (v*w)) := by + have ht1 := (tendsto_iff_norm_sub_tendsto_zero.mp hb).const_mul C + have ht2 := tendsto_iff_norm_sub_tendsto_zero.mp (quotient_fixed_right_tendsto τ ω w _ v ha) + apply tendsto_iff_norm_sub_tendsto_zero.mpr + apply squeeze_zero (fun n => norm_nonneg _) _ (by simpa only [mul_zero,zero_add] using ht1.add ht2) + intro n + have he : quotientMap τ (ω : Filter ℕ) (a n)*b n-v*w= + quotientMap τ (ω : Filter ℕ) (a n)*(b n-w)+ + (quotientMap τ (ω : Filter ℕ) (a n)*w-v*w) := by rw [mul_sub,sub_add_sub_cancel] + rw [he] + exact (norm_add_le (quotientMap τ (ω : Filter ℕ) (a n)*(b n-w)) + (quotientMap τ (ω : Filter ℕ) (a n)*w-v*w)).trans + (add_le_add (quotient_bounded_mul_norm τ ω (a n) C (hC n) (b n-w)) le_rfl) + +theorem quotient_fixed_left_tendsto (b : Q τ ω) (a : ℕ → Q τ ω) (v : Q τ ω) + (ha : Tendsto a atTop (𝓝 v)) : Tendsto (fun n => b*a n) atTop (𝓝 (b*v)) := by + obtain ⟨b',rfl⟩ := quotientMap_surjective τ (ω : Filter ℕ) b + obtain ⟨C,_,hbound⟩ := b'.property + exact quotient_bounded_mul_tendsto τ ω (fun _ => b') C (fun _ => hbound) _ a v tendsto_const_nhds ha + +theorem quotient_star_tendsto (a : ℕ → Q τ ω) (v : Q τ ω) + (ha : Tendsto a atTop (𝓝 v)) : Tendsto (fun n => star (a n)) atTop (𝓝 (star v)) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + simpa only [← star_sub,quotient_norm_star] using tendsto_iff_norm_sub_tendsto_zero.mp ha + +theorem quotient_partial_signed_tendsto (a : ℕ → ℕ → PartialUnitary M) (v : Q τ ω) + (ha : Tendsto (fun n => quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) atTop (𝓝 v)) + (s : Bool) : Tendsto (fun n => quotientMap τ (ω : Filter ℕ) + (algebraSignedLetter (boundedPartialUnitary (a n)) s)) atTop (𝓝 (algebraSignedLetter v s)) := by + cases s with + | false => exact ha + | true => simpa only [algebraSignedLetter,↓reduceIte,quotientMap_star] using quotient_star_tendsto τ ω _ v ha + +theorem quotient_partial_core_tendsto (a : ℕ → ℕ → PartialUnitary M) (v : Q τ ω) + (ha : Tendsto (fun n => quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) atTop (𝓝 v)) + (x : ℕ → Q τ ω) (s : Bool) (xs : List (Bool × ℕ)) : + Tendsto (fun n => algebraWordCore (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) x s xs) + atTop (𝓝 (algebraWordCore v x s xs)) := by + have hsign (t : Bool) := quotient_partial_signed_tendsto τ ω a v ha t + have he (n : ℕ) (t : Bool) : quotientMap τ (ω : Filter ℕ) + (algebraSignedLetter (boundedPartialUnitary (a n)) t)= + algebraSignedLetter (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) t := by + cases t <;> simp only [algebraSignedLetter,Bool.false_eq_true,↓reduceIte,quotientMap_star] + induction xs with + | nil => simpa only [algebraWordCore,he] using hsign s + | cons t xs ih => + have hbound : ∀ n j,‖(algebraSignedLetter (boundedPartialUnitary (a n)) t.1).val j‖ ≤ 1 := by + intro n j + cases t.1 with + | false => + change ‖(a n j).val‖ ≤ 1 + exact (a n j).unitary.norm_le_one + | true => + change ‖star (a n j).val‖ ≤ 1 + exact (a n j).unitary.adjoint.norm_le_one + have hh := quotient_bounded_mul_tendsto τ ω + (fun n => algebraSignedLetter (boundedPartialUnitary (a n)) t.1) 1 hbound _ + (fun n => x t.2*algebraWordCore (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) x s xs) + _ (hsign t.1) (quotient_fixed_left_tendsto τ ω (x t.2) _ _ ih) + simpa only [he,algebraWordCore,mul_assoc] using hh + +theorem quotient_trace_tendsto (a : ℕ → Q τ ω) (v : Q τ ω) + (ha : Tendsto a atTop (𝓝 v)) : + Tendsto (fun n => quotientTrace τ ω (a n)) atTop (𝓝 (quotientTrace τ ω v)) := by + have he (b : Q τ ω) : quotientTrace τ ω b=inner ℂ (1 : Q τ ω) b := by + rw [inner_eq_trace,star_one,one_mul] + simp only [he] + exact tendsto_const_nhds.inner ha + +theorem exactOrderedMoments_partial_limit (a : ℕ → ℕ → PartialUnitary M) (v : Q τ ω) + (ha : Tendsto (fun n => quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) atTop (𝓝 v)) + (x : ℕ → Q τ ω) + (hm : ∀ n,ExactOrderedMoments τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) x) : + ExactOrderedMoments τ ω v x := by + intro first last xs s + have ht := quotient_partial_core_tendsto τ ω a v ha x s xs + have ht' := quotient_trace_tendsto τ ω _ _ (quotient_fixed_left_tendsto τ ω + (optionalCoefficient x first) _ _ (quotient_fixed_right_tendsto τ ω (optionalCoefficient x last) _ _ ht)) + rw [algebraWordCore_endpoints] + apply tendsto_nhds_unique ht' + apply tendsto_const_nhds.congr + intro n + have hh := hm n first last xs s + rw [algebraWordCore_endpoints] at hh + exact hh.symm + +end + +/-! A genuine unitary in the included quotient with every signed ordered +moment zero. This statement does not assert all Haar powers or freeness. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exactOrderedMoments_zero (ω : Ultrafilter ℕ) (x : ℕ → Q τ ω) : + ExactOrderedMoments τ ω 0 x := by + intro first last xs s + have hz : algebraPatchingWord (0 : Q τ ω) + (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)])=0 := by + cases xs <;> simp [algebraPatchingWord,algebraSignedLetter] + rw [hz,mul_zero] + exact (traceLinear τ ω).map_zero + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_full_support_ordered_independence + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) : + ∃ u : ℕ → PartialUnitary M, + (∀ j,(u j).val.val ∈ N) ∧ + star (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u))* + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)=1 ∧ + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)* + star (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u))=1 ∧ + ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)) x := by + let v : ℕ → PartialUnitary M := fun _ => zeroPartialUnitary + have hv : ∀ j,(v j).val.val ∈ N := fun _ => N.zero_mem + have hz : quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)=0 := by + change quotientMap τ (ω : Filter ℕ) 0=0 + exact map_zero _ + have hm : ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) x := by + rw [hz] + exact exactOrderedMoments_zero τ ω x + obtain ⟨a,ha⟩ := exists_exact_residual_iteration (H := H) (N := N) (M := M) + τ hNM hfactor hdiff hirr hsep ω hω v hv x hx hm + obtain ⟨u,hu⟩ := exists_coordinate_monotone_upper τ hNM a ha.2.2.1 ha.2.1 + have hc := quotient_geometric_upper_completion τ ω a u hu.2 + (quotientResidualTrace τ ω v) ha.2.2.2.2 + have hunit := quotient_unitary_of_zero_residual τ ω u hc.1 + exact ⟨u,hu.1,hunit.1,hunit.2, + exactOrderedMoments_partial_limit τ ω a _ hc.2 x ha.2.2.2.1⟩ + +/-- Membership is witnessed by the actual inclusion homomorphism of quotients. -/ +theorem exists_included_ordered_unitary + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) : + ∃ t : Q τ ω, + (∃ q : TracialQuotient (restrictedTrace τ hNM) (ω : Filter ℕ), + quotientInclusion τ hNM (ω : Filter ℕ) q=t) ∧ + star t*t=1 ∧ t*star t=1 ∧ ExactOrderedMoments τ ω t x := by + obtain ⟨u,hu,hi,hf,hm⟩ := exists_full_support_ordered_independence τ hNM hfactor hdiff hirr hsep + ω hω x hx + obtain ⟨b,hb⟩ := boundedPartialUnitary_inclusion hNM u hu + refine ⟨quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u),?_,hi,hf,hm⟩ + refine ⟨quotientMap (restrictedTrace τ hNM) (ω : Filter ℕ) b,?_⟩ + change quotientMap τ (ω : Filter ℕ) (boundedInclusion hNM b)=_ + rw [hb] + +end + +/-! Two actual applications of ordered independence produce a unitary with +all reduced signed moments, including runs of same-sign letters. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_included_reduced_unitary + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) : + ∃ t : unitary (Q τ ω), + (∃ q : TracialQuotient (restrictedTrace τ hNM) (ω : Filter ℕ), + quotientInclusion τ hNM (ω : Filter ℕ) q=(t : Q τ ω)) ∧ + ReducedOrderedMoments τ ω (t : Q τ ω) x := by + obtain ⟨u,⟨qu,hqu⟩,hui,huf,hum⟩ := + exists_included_ordered_unitary τ hNM hfactor hdiff hirr hsep ω hω x hx + obtain ⟨v,⟨qv,hqv⟩,hvi,hvf,hvm⟩ := + exists_included_ordered_unitary τ hNM hfactor hdiff hirr hsep ω hω + (productCenteredFamily τ ω u x) (productCenteredFamily_centered τ ω u x huf hx hum) + have hunit : u*v ∈ unitary (Q τ ω) := by + apply (unitary (Q τ ω)).mul_mem + · exact ⟨hui,huf⟩ + · exact ⟨hvi,hvf⟩ + refine ⟨⟨u*v,hunit⟩,⟨qu*qv,?_⟩,?_⟩ + · rw [map_mul,hqu,hqv] + · intro a b s xs hxs + exact product_reduced_moment τ ω u v x hvm a b s xs hxs + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/HaarPatches.lean b/lean/OAI/Analysis/FactorGeneration/HaarPatches.lean new file mode 100644 index 0000000000000000000000000000000000000000..cef70dc6c5237a1c2cb1bd48fdf4626ee9aa7b55 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/HaarPatches.lean @@ -0,0 +1,359 @@ +import OAI.Analysis.FactorGeneration.LocalPatches + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! The same ordered signed words in any star algebra, with exact transport +through bounded sequence evaluation and the actual quotient homomorphism. -/ +section +open UltrapowerBridge + +def algebraSignedLetter {A : Type*} [Star A] (v : A) (s : Bool) : A := + if s then star v else v + +def algebraPatchingWord {A : Type*} [Monoid A] [Star A] (v : A) : + List (Bool × A) → A + | [] => 1 + | (s,x)::xs => algebraSignedLetter v s*x*algebraPatchingWord v xs + +def optionalCoefficient {A : Type*} [One A] (x : ℕ → A) : Option ℕ → A + | none => 1 + | some i => x i + +theorem map_algebraPatchingWord {A B : Type*} [Ring A] [Ring B] + [StarRing A] [StarRing B] [Algebra ℂ A] [Algebra ℂ B] + (f : A →⋆ₐ[ℂ] B) (v : A) (xs : List (Bool × A)) : + f (algebraPatchingWord v xs) = + algebraPatchingWord (f v) (xs.map (fun a => (a.1,f a.2))) := by + induction xs with + | nil => exact f.map_one + | cons a xs ih => + simp only [algebraPatchingWord,List.map_cons,map_mul,ih] + congr 2 + cases a.1 + · rfl + · exact map_star f v + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem algebraPatchingWord_eq (v : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + algebraPatchingWord v xs = patchingWord v xs := by + induction xs with + | nil => rfl + | cons a xs ih => simp only [algebraPatchingWord,patchingWord,ih,algebraSignedLetter,signedLetter] + +def boundedEvaluation (j : ℕ) : Bounded M →⋆ₐ[ℂ] M.toStarSubalgebra where + toFun a := a.val j + map_one' := rfl + map_mul' _ _ := rfl + map_zero' := rfl + map_add' _ _ := rfl + commutes' _ := rfl + map_star' _ := rfl + +theorem bounded_word_evaluation (v : Bounded M) (xs : List (Bool × Bounded M)) (j : ℕ) : + (algebraPatchingWord v xs).val j = + patchingWord (v.val j) (xs.map (fun a => (a.1,a.2.val j))) := by + induction xs with + | nil => rfl + | cons a xs ih => + change (algebraSignedLetter v a.1).val j * a.2.val j * + (algebraPatchingWord v xs).val j = _ + rw [ih] + simp only [List.map_cons,patchingWord] + cases a.1 <;> rfl + +end + +/-! The finite-error f=1 conclusion of Popa Lemma 3.2, for the irreducible +scalar-commutant inclusion with the explicit represented-factor hypotheses. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem patchingTolerance_scale (δ : ℝ) (k : ℕ) : + patchingTolerance δ k=δ*patchingTolerance 1 k := by + induction k with + | zero => simp + | succ k ih => rw [patchingTolerance_succ,patchingTolerance_succ,ih]; ring + +def diagonalCoefficientFamily (x : ℕ → ℕ → M.toStarSubalgebra) (j : ℕ) : Finset M.toStarSubalgebra := by + classical + exact (Finset.range (j+1)).image (fun i => x i j) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_finite_partial_independence + (F : Finset M.toStarSubalgebra) (hF : ∀ x ∈ F,‖x‖ ≤ 1) + (hcenter : ∀ x ∈ F,τ.trace x=0) (n : ℕ) (ε : ℝ) (hε : 0 < ε) : + ∃ v : PartialUnitary M,v.val.val ∈ N ∧ 1/4 < (τ.trace v.support.val).re ∧ + ∀ x₀ ∈ (F : Set M.toStarSubalgebra) ∪ {1},∀ xs : List (Bool × M.toStarSubalgebra), + 1 ≤ xs.length → xs.length ≤ n → patchingCoefficients (F : Set M.toStarSubalgebra) xs → + ‖τ.trace (x₀*patchingWord v.val xs)‖ ≤ ε := by + let δ := ε/patchingTolerance 1 n + have ht := patchingTolerance_pos 1 (by norm_num) n + have hδ : 0 < δ := div_pos hε ht + obtain ⟨v,hv,hs⟩ := exists_large_admissible_partialUnitary τ hNM hfactor hdiff hirr hsep + F hF hcenter n δ hδ + have he : patchingTolerance δ n=ε := by + rw [patchingTolerance_scale] + exact div_mul_cancel₀ ε ht.ne' + refine ⟨v,hv.2,hs,?_⟩ + intro x₀ hx₀ xs hpos hn hc + have hh := hv.1.2 x₀ hx₀ xs hpos hn hc + have hmono := patchingTolerance_mono δ hδ hn + rw [he] at hmono + exact hh.trans ((mul_le_of_le_one_right (patchingTolerance_pos δ hδ xs.length).le + (PartialUnitary.support_trace_le_one τ v)).trans hmono) + +/-- A genuine diagonal sequence for a countable family of varying centered +contractions; the coefficient at stage j may depend on j. This is still a +partial-unitary construction, not a full free Haar unitary. -/ +theorem exists_diagonal_partial_independence + (x : ℕ → ℕ → M.toStarSubalgebra) (hx : ∀ i j,‖x i j‖ ≤ 1) + (hc : ∀ i j,τ.trace (x i j)=0) : + ∃ v : ℕ → PartialUnitary M,∀ j, + (v j).val.val ∈ N ∧ 1/4 < (τ.trace (v j).support.val).re ∧ + ∀ a ∈ (diagonalCoefficientFamily x j : Set M.toStarSubalgebra) ∪ {1}, + ∀ xs : List (Bool × M.toStarSubalgebra), + 1 ≤ xs.length → xs.length ≤ j+1 → + patchingCoefficients (diagonalCoefficientFamily x j : Set M.toStarSubalgebra) xs → + ‖τ.trace (a*patchingWord (v j).val xs)‖ ≤ 1/((j : ℝ)+1) := by + classical + have hstage : ∀ j,∃ v : PartialUnitary M,v.val.val ∈ N ∧ 1/4 < (τ.trace v.support.val).re ∧ + ∀ a ∈ (diagonalCoefficientFamily x j : Set M.toStarSubalgebra) ∪ {1}, + ∀ xs : List (Bool × M.toStarSubalgebra), + 1 ≤ xs.length → xs.length ≤ j+1 → + patchingCoefficients (diagonalCoefficientFamily x j : Set M.toStarSubalgebra) xs → + ‖τ.trace (a*patchingWord v.val xs)‖ ≤ 1/((j : ℝ)+1) := by + intro j + apply exists_finite_partial_independence τ hNM hfactor hdiff hirr hsep + (diagonalCoefficientFamily x j) ?_ ?_ (j+1) _ (by positivity) + · intro a ha + obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp ha + exact hx i j + · intro a ha + obtain ⟨i,hi,rfl⟩ := Finset.mem_image.mp ha + exact hc i j + choose v hv using hstage + exact ⟨v,hv⟩ + +end + +/-! A countable diagonal construction with actual vanishing ordered moments. +The countable coefficients may vary with the sequence coordinate. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def indexedCoefficient (x : ℕ → ℕ → M.toStarSubalgebra) (j : ℕ) : + Option ℕ → M.toStarSubalgebra + | none => 1 + | some i => x i j + +theorem eventually_list_indices (is : List ℕ) : ∀ᶠ j : ℕ in atTop,∀ i ∈ is,i ≤ j := by + induction is with + | nil => exact Eventually.of_forall (fun _ => by simp) + | cons i is ih => + filter_upwards [ih,eventually_ge_atTop i] with j hj hi + intro a ha + rcases List.mem_cons.mp ha with rfl | ha + · exact hi + · exact hj a ha + +theorem eventually_indexedCoefficient (x : ℕ → ℕ → M.toStarSubalgebra) (i : Option ℕ) : + ∀ᶠ j : ℕ in atTop,indexedCoefficient x j i ∈ + (diagonalCoefficientFamily x j : Set M.toStarSubalgebra) ∪ {1} := by + classical + cases i with + | none => exact Eventually.of_forall (fun _ => Or.inr rfl) + | some i => + filter_upwards [eventually_ge_atTop i] with j hj + exact Or.inl (Finset.mem_image.mpr ⟨i,Finset.mem_range.mpr (by omega),rfl⟩) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +/-- Every nonempty source word is encoded by its internal index list, final +sign and two optional endpoint indices. None represents exactly the unit. -/ +theorem exists_countable_partial_independence + (x : ℕ → ℕ → M.toStarSubalgebra) (hx : ∀ i j,‖x i j‖ ≤ 1) + (hc : ∀ i j,τ.trace (x i j)=0) : + ∃ v : ℕ → PartialUnitary M, + (∀ j,(v j).val.val ∈ N) ∧ (∀ j,1/4 < (τ.trace (v j).support.val).re) ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + Tendsto (fun j => τ.trace (indexedCoefficient x j first * patchingWord (v j).val + (xs.map (fun a => (a.1,x a.2 j)) ++ [(s,indexedCoefficient x j last)]))) atTop (𝓝 0) := by + classical + obtain ⟨v,hv⟩ := exists_diagonal_partial_independence τ hNM hfactor hdiff hirr hsep x hx hc + refine ⟨v,fun j => (hv j).1,fun j => (hv j).2.1,?_⟩ + intro first last xs s + apply tendsto_iff_norm_sub_tendsto_zero.mpr + simp only [sub_zero] + apply squeeze_zero' (Eventually.of_forall (fun _ => norm_nonneg _)) ?_ + tendsto_one_div_add_atTop_nhds_zero_nat + filter_upwards [eventually_list_indices (xs.map Prod.snd),eventually_ge_atTop xs.length, + eventually_indexedCoefficient x first,eventually_indexedCoefficient x last] with j hj hlen hfirst hlast + apply (hv j).2.2 _ hfirst _ (by simp) (by simpa using Nat.add_le_add_right hlen 1) + apply patchingCoefficients_append_endpoint _ _ ?_ (s,indexedCoefficient x j last) hlast + intro a ha + obtain ⟨b,hb,rfl⟩ := List.mem_map.mp ha + exact Finset.mem_image.mpr ⟨b.2,Finset.mem_range.mpr (by + have hh := hj b.2 (List.mem_map.mpr ⟨b,hb,rfl⟩) + omega),rfl⟩ + +end + +/-! Actual positive-support partial independence in the bounded-sequence +tracial quotient. Freeness is expressed by domination of atTop. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def boundedPartialUnitary (v : ℕ → PartialUnitary M) : Bounded M := + ⟨fun j => (v j).val,1,zero_le_one,fun j => (v j).unitary.norm_le_one⟩ + +def boundedPartialSupport (v : ℕ → PartialUnitary M) : Bounded M := + ⟨fun j => (v j).support.val,1,zero_le_one,fun j => (v j).support.property.norm_le⟩ + +theorem boundedPartialSupport_projection (v : ℕ → PartialUnitary M) : + IsStarProjection (boundedPartialSupport v) := by + constructor + · apply Subtype.ext + funext j + exact (v j).support.property.isIdempotentElem + · apply Subtype.ext + funext j + exact (v j).support.property.isSelfAdjoint + +theorem boundedPartialUnitary_initial (v : ℕ → PartialUnitary M) : + star (boundedPartialUnitary v)*boundedPartialUnitary v = boundedPartialSupport v := by + apply Subtype.ext + funext j + exact (v j).unitary.initial + +theorem boundedPartialUnitary_final (v : ℕ → PartialUnitary M) : + boundedPartialUnitary v*star (boundedPartialUnitary v) = boundedPartialSupport v := by + apply Subtype.ext + funext j + exact (v j).unitary.final + +theorem boundedPartialUnitary_inclusion (hNM : N ≤ M) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) : + ∃ w : Bounded N,boundedInclusion hNM w = boundedPartialUnitary v := by + refine ⟨⟨fun j => ⟨(v j).val.val,hv j⟩,1,zero_le_one, + fun j => (v j).unitary.norm_le_one⟩,?_⟩ + rfl + +theorem quotient_ordered_moment_zero (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (x : ℕ → Bounded M) + (first last : Option ℕ) (xs : List (Bool × ℕ)) (s : Bool) + (hz : Tendsto (fun j => τ.trace (indexedCoefficient (fun i => (x i).val) j first * + patchingWord (v j).val (xs.map (fun a => (a.1,(x a.2).val j)) ++ + [(s,indexedCoefficient (fun i => (x i).val) j last)]))) atTop (𝓝 0)) : + quotientTrace τ ω (optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (x i)) first * + algebraPatchingWord (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) + (xs.map (fun a => (a.1,quotientMap τ (ω : Filter ℕ) (x a.2))) ++ + [(s,optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (x i)) last)])) = 0 := by + let f := quotientStarAlgHom τ (ω : Filter ℕ) + let b : Bounded M := optionalCoefficient x first * algebraPatchingWord (boundedPartialUnitary v) + (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]) + have hopt (i : Option ℕ) : f (optionalCoefficient x i) = + optionalCoefficient (fun i => f (x i)) i := by cases i <;> simp [optionalCoefficient] + have hb : f b = optionalCoefficient (fun i => f (x i)) first * + algebraPatchingWord (f (boundedPartialUnitary v)) + (xs.map (fun a => (a.1,f (x a.2))) ++ [(s,optionalCoefficient (fun i => f (x i)) last)]) := by + simp only [b,map_mul,map_algebraPatchingWord,hopt,List.map_append,List.map_cons,List.map_nil, + List.map_map,Function.comp_def] + change quotientTrace τ ω (optionalCoefficient (fun i => f (x i)) first * + algebraPatchingWord (f (boundedPartialUnitary v)) + (xs.map (fun a => (a.1,f (x a.2))) ++ [(s,optionalCoefficient (fun i => f (x i)) last)])) = 0 + rw [← hb] + apply tendsto_nhds_unique (traceRep_tendsto τ ω b) + have he (j : ℕ) : b.val j = indexedCoefficient (fun i => (x i).val) j first * + patchingWord (v j).val (xs.map (fun a => (a.1,(x a.2).val j)) ++ + [(s,indexedCoefficient (fun i => (x i).val) j last)]) := by + change (optionalCoefficient x first).val j * _ = _ + rw [bounded_word_evaluation] + have ho (i : Option ℕ) : (optionalCoefficient x i).val j = + indexedCoefficient (fun i => (x i).val) j i := by cases i <;> rfl + simp only [ho,List.map_append,List.map_cons,List.map_nil,List.map_map,Function.comp_def] + rfl + simpa only [he] using hz.mono_left hω + +end + +/-! Exact multilinearity factors for ordered words; no factors are inverted +and signs affect only the partial-unitary letters. -/ + +theorem algebraPatchingWord_scale {A I : Type*} [Ring A] [Star A] [Algebra ℂ A] + (v : A) (x y : I → A) (c : I → ℂ) (h : ∀ i,x i=c i • y i) + (xs : List (Bool × I)) : + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2))) = + (xs.map (fun a => c a.2)).prod • + algebraPatchingWord v (xs.map (fun a => (a.1,y a.2))) := by + induction xs with + | nil => simp [algebraPatchingWord] + | cons a xs ih => + simp only [List.map_cons,algebraPatchingWord,ih,List.prod_cons] + rw [h a.2] + simp only [ + mul_smul_comm,smul_mul_assoc,smul_smul,mul_comm (c a.2)] + +theorem optionalCoefficient_scale {A : Type*} [Ring A] [Algebra ℂ A] + (x y : ℕ → A) (c : ℕ → ℂ) (h : ∀ i,x i=c i • y i) (i : Option ℕ) : + optionalCoefficient x i=optionalCoefficient c i • optionalCoefficient y i := by + cases i <;> simp [optionalCoefficient,h] + +theorem ordered_moment_scale {A : Type*} [Ring A] [Star A] [Algebra ℂ A] + (v : A) (x y : ℕ → A) (c : ℕ → ℂ) (h : ∀ i,x i=c i • y i) + (first last : Option ℕ) (xs : List (Bool × ℕ)) (s : Bool) : + optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]) = + (optionalCoefficient c first * ((xs.map (fun a => c a.2)).prod * optionalCoefficient c last)) • + (optionalCoefficient y first * + algebraPatchingWord v (xs.map (fun a => (a.1,y a.2)) ++ [(s,optionalCoefficient y last)])) := by + have hw := algebraPatchingWord_scale v (optionalCoefficient x) (optionalCoefficient y) + (optionalCoefficient c) (optionalCoefficient_scale x y c h) + (xs.map (fun a => (a.1,some a.2)) ++ [(s,last)]) + simp only [List.map_append,List.map_cons,List.map_nil,List.map_map,Function.comp_def, + optionalCoefficient,List.prod_append,List.prod_cons,List.prod_nil,mul_one] at hw + change algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]) = + ((xs.map (fun a => c a.2)).prod * optionalCoefficient c last) • + algebraPatchingWord v (xs.map (fun a => (a.1,y a.2)) ++ [(s,optionalCoefficient y last)]) at hw + rw [hw,optionalCoefficient_scale x y c h first,smul_mul_assoc,mul_smul_comm,smul_smul] + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/HaarSequences.lean b/lean/OAI/Analysis/FactorGeneration/HaarSequences.lean new file mode 100644 index 0000000000000000000000000000000000000000..1379bd9b52b0c0556e9c392a71a76937457f952e --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/HaarSequences.lean @@ -0,0 +1,522 @@ +import OAI.Analysis.FactorGeneration.RepresentedFreeness + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! One constructed Haar extension retains endpoint moments, represented +norm-closed freeness, and an actual unitary sequence in the included algebra. -/ +section +attribute [local instance] quotientL2AddCommMonoid quotientL2AddCommGroup + quotientOperatorSemiring quotientOperatorNonAssocSemiring quotientOperatorAlgebra + quotientOperatorSemitopology +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +/-- Full endpoint formula; the internal factors alone must be centered. -/ +def HaarEndpoints (D : Subalgebra ℂ (Q τ ω)) (t : unitary (Q τ ω)) : Prop := + ∀ c ∈ D,∀ d ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (c*integerValueWord τ ω t n xs d)=0 + +theorem HaarEndpoints.haar {D : Subalgebra ℂ (Q τ ω)} {t : unitary (Q τ ω)} + (h : HaarEndpoints τ ω D t) (n : ℤ) (hn : n ≠ 0) : + quotientTrace τ ω (↑(t^n) : Q τ ω)=0 := by + simpa only [integerValueWord,mul_one,one_mul] using + h 1 D.one_mem 1 D.one_mem n hn [] (by simp) + +theorem HaarEndpoints.representedFree {D : Subalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D t) : + representedClosedFree τ ω t D := by + apply represented_haar_free_interface τ ω t D (h.haar τ ω) + apply endpoint_all_alternating τ ω _ D + intro c hc d hd q hq xs hxs + apply endpoint_moments_laurent_closure τ ω D t h c d q hc hd + (Submodule.le_topologicalClosure _ (Submodule.subset_span hq)) xs + intro z hz + exact ⟨(hxs z hz).1,(hxs z hz).2.1, + Submodule.le_topologicalClosure _ (Submodule.subset_span (hxs z hz).2.2)⟩ + +structure CoordinateHaarData (hNM : N ≤ M) (D : Subalgebra ℂ (Q τ ω)) where + t : unitary (Q τ ω) + coordinates : Bounded N + unitary_coordinates : ∀ j,coordinates.val j ∈ unitary N.toStarSubalgebra + represents : quotientInclusion τ hNM (ω : Filter ℕ) + (quotientMap (restrictedTrace τ hNM) (ω : Filter ℕ) coordinates)=(t : Q τ ω) + endpoints : HaarEndpoints τ ω D t + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem nonempty_coordinateHaarData (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (hD : TopologicalSpace.IsSeparable (D : Set (Q τ ω))) : + Nonempty (CoordinateHaarData τ ω hNM D) := by + obtain ⟨t,⟨b,hb,he⟩,_,hep⟩ := exists_coordinate_haar_endpoints + (H := H) (N := N) (M := M) τ ω hNM hfactor hdiff hirr hsep hω D hD + exact ⟨⟨t,b,hb,he,hep⟩⟩ + +end + +/-! Scalar expansion of same-sign gaps. Opposite-sign gaps must be centered, +so deleting a scalar gap can never cancel an entire power. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def SamePowerSign (n m : ℤ) : Prop := (0 < n ∧ 0 < m) ∨ (n < 0 ∧ m < 0) + +def ReducedIntegerGaps (D : Subalgebra ℂ (Q τ ω)) : ℤ → List (Q τ ω × ℤ) → Prop + | _,[] => True + | n,(d,m)::xs => d ∈ D ∧ m ≠ 0 ∧ + (quotientTrace τ ω d=0 ∨ SamePowerSign n m) ∧ ReducedIntegerGaps D m xs + +theorem integerValueWord_mul_power (t : unitary (Q τ ω)) (n m : ℤ) + (xs : List (Q τ ω × ℤ)) (b : Q τ ω) : + (↑(t^n) : Q τ ω)*integerValueWord τ ω t m xs b= + integerValueWord τ ω t (n+m) xs b := by + cases xs <;> simp [integerValueWord,zpow_add,mul_assoc] + +/-- Prefixes are absorbed into an arbitrary linear functional. Its centered +endpoint property is preserved when a centered gap is appended. -/ +theorem reduced_integer_gap_functional (D : Subalgebra ℂ (Q τ ω)) + (t : unitary (Q τ ω)) (L : Q τ ω →ₗ[ℂ] ℂ) + (hm : ∀ b ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + L (integerValueWord τ ω t n xs b)=0) + (n : ℤ) (hn : n ≠ 0) (xs : List (Q τ ω × ℤ)) + (hx : ReducedIntegerGaps τ ω D n xs) (b : Q τ ω) (hb : b ∈ D) : + L (integerValueWord τ ω t n xs b)=0 := by + induction xs generalizing L n with + | nil => exact hm b hb n hn [] (by simp) + | cons z xs ih => + rcases z with ⟨d,m⟩ + rcases hx with ⟨hd,hm0,hgap,hxs⟩ + let d0 := d-quotientTrace τ ω d • (1 : Q τ ω) + have hd0 : d0 ∈ D := D.sub_mem hd (D.smul_mem D.one_mem _) + have ht0 : quotientTrace τ ω d0=0 := by + change (traceLinear τ ω) (d-quotientTrace τ ω d • (1 : Q τ ω))=0 + rw [map_sub,map_smul] + change quotientTrace τ ω d-quotientTrace τ ω d*quotientTrace τ ω 1=0 + rw [quotientTrace_one,mul_one,sub_self] + let L' : Q τ ω →ₗ[ℂ] ℂ := L.comp (LinearMap.mulLeft ℂ ((↑(t^n) : Q τ ω)*d0)) + have hL' : ∀ c ∈ D,∀ k : ℤ,k ≠ 0 → ∀ ys : List (Q τ ω × ℤ), + (∀ z ∈ ys,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + L' (integerValueWord τ ω t k ys c)=0 := by + intro c hc k hk ys hys + exact hm c hc n hn ((d0,k)::ys) (by + intro z hz + rcases List.mem_cons.mp hz with rfl | hz + · exact ⟨hd0,ht0,hk⟩ + · exact hys z hz) + have hc := ih L' hL' m hm0 hxs + have hs : quotientTrace τ ω d * L (integerValueWord τ ω t (n+m) xs b)=0 := by + rcases hgap with hzero | hsign + · rw [hzero,zero_mul] + · have hsum : n+m ≠ 0 := by rcases hsign with h | h <;> omega + rw [ih L hm (n+m) hsum ?_] + · exact mul_zero _ + · cases xs with + | nil => trivial + | cons z ys => + rcases hxs with ⟨hz,hnz,hgz,hys⟩ + refine ⟨hz,hnz,?_,hys⟩ + rcases hgz with hzero | hsame + · exact Or.inl hzero + · right + rcases hsign with h | h <;> rcases hsame with h' | h' <;> + simp only [SamePowerSign] at * <;> omega + have he : d=d0+quotientTrace τ ω d • (1 : Q τ ω) := by + simp only [d0,sub_add_cancel] + change L ((↑(t^n) : Q τ ω)*d*integerValueWord τ ω t m xs b)=0 + rw [he,mul_add,add_mul,map_add] + change L' (integerValueWord τ ω t m xs b) + + L (((↑(t^n) : Q τ ω)*(quotientTrace τ ω d • (1 : Q τ ω)))* + integerValueWord τ ω t m xs b)=0 + rw [hc,mul_smul_comm,mul_one,smul_mul_assoc,map_smul, + integerValueWord_mul_power,smul_eq_mul,hs,add_zero] + +theorem HaarEndpoints.reduced_gaps {D : Subalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D t) + (a : Q τ ω) (ha : a ∈ D) (b : Q τ ω) (hb : b ∈ D) + (n : ℤ) (hn : n ≠ 0) (xs : List (Q τ ω × ℤ)) + (hx : ReducedIntegerGaps τ ω D n xs) : + quotientTrace τ ω (a*integerValueWord τ ω t n xs b)=0 := by + apply reduced_integer_gap_functional τ ω D t + ((traceLinear τ ω).comp (LinearMap.mulLeft ℂ a)) + (fun b hb n hn xs hxs => h a ha b hb n hn xs hxs) n hn xs hx b hb + +/-! Expand nonzero integer powers into signs while retaining the exact rule: +only an equal-sign gap may have a nonzero scalar part. -/ + +def signExponent (s : Bool) : ℤ := if s then -1 else 1 + +theorem signedLetter_integer (t : unitary (Q τ ω)) (s : Bool) : + algebraSignedLetter (t : Q τ ω) s=(↑(t^signExponent s) : Q τ ω) := by + cases s + · simp [signExponent,algebraSignedLetter] + · change star (t : Q τ ω)=(↑(t^(-1 : ℤ)) : Q τ ω) + rw [zpow_neg_one] + rfl + +def SignedReducedGaps (D : Subalgebra ℂ (Q τ ω)) : Bool → List (Q τ ω × Bool) → Prop + | _,[] => True + | s,(d,t)::xs => d ∈ D ∧ (s ≠ t → quotientTrace τ ω d=0) ∧ SignedReducedGaps D t xs + +theorem betweenWord_integerValue (t : unitary (Q τ ω)) (s : Bool) + (xs : List (Q τ ω × Bool)) (b : Q τ ω) : + betweenWord (t : Q τ ω) s xs b=integerValueWord τ ω t (signExponent s) + (xs.map (fun z => (z.1,signExponent z.2))) b := by + induction xs generalizing s with + | nil => simp [betweenWord,integerValueWord,signedLetter_integer] + | cons z xs ih => simp [betweenWord,integerValueWord,signedLetter_integer,ih] + +theorem signedReducedGaps_integer {D : Subalgebra ℂ (Q τ ω)} + (s : Bool) (xs : List (Q τ ω × Bool)) (hx : SignedReducedGaps τ ω D s xs) : + ReducedIntegerGaps τ ω D (signExponent s) + (xs.map (fun z => (z.1,signExponent z.2))) := by + induction xs generalizing s with + | nil => trivial + | cons z xs ih => + refine ⟨hx.1,?_,?_,ih z.2 hx.2.2⟩ + · cases z.2 <;> simp [signExponent] + · by_cases h : s=z.2 + · right + rw [h] + cases z.2 <;> simp [signExponent,SamePowerSign] + · exact Or.inl (hx.2.1 h) + +theorem HaarEndpoints.signed_gaps {D : Subalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D t) + (a : Q τ ω) (ha : a ∈ D) (b : Q τ ω) (hb : b ∈ D) + (s : Bool) (xs : List (Q τ ω × Bool)) (hx : SignedReducedGaps τ ω D s xs) : + quotientTrace τ ω (a*betweenWord (t : Q τ ω) s xs b)=0 := by + rw [betweenWord_integerValue] + apply h.reduced_gaps τ ω a ha b hb _ (by cases s <;> simp [signExponent]) + exact signedReducedGaps_integer τ ω s xs hx + +theorem signedReducedGaps_repeat {D : Subalgebra ℂ (Q τ ω)} + (s : Bool) (n : ℕ) (xs : List (Q τ ω × Bool)) + (hx : SignedReducedGaps τ ω D s xs) : + SignedReducedGaps τ ω D s (List.replicate n (1,s)++xs) := by + induction n with + | zero => simpa using hx + | succ n ih => + rw [List.replicate_succ,List.cons_append] + exact ⟨D.one_mem,fun h => (h rfl).elim,ih⟩ + +theorem signedReducedGaps_blocks {D : Subalgebra ℂ (Q τ ω)} + (s : Bool) (n : ℕ) (xs : List (Q τ ω × (Bool × ℕ))) + (hx : ∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0) : + SignedReducedGaps τ ω D s (powerBlockGaps s n xs) := by + induction xs generalizing s n with + | nil => + simpa only [powerBlockGaps,List.append_nil] using + signedReducedGaps_repeat τ ω (D := D) s n [] trivial + | cons z xs ih => + apply signedReducedGaps_repeat + exact ⟨(hx z (by simp)).1,fun _ => (hx z (by simp)).2, + ih _ _ (fun w hw => hx w (by simp [hw]))⟩ + +theorem integerValueWord_blocks (t : unitary (Q τ ω)) (n : ℤ) (hn : n ≠ 0) + (xs : List (Q τ ω × ℤ)) (hx : ∀ z ∈ xs,z.2 ≠ 0) (b : Q τ ω) : + integerValueWord τ ω t n xs b=betweenWord (t : Q τ ω) (integerPowerBlock n).1 + (powerBlockGaps (integerPowerBlock n).1 (integerPowerBlock n).2 + (xs.map (fun z => (z.1,integerPowerBlock z.2)))) b := by + rw [← powerBlockWord_expand] + induction xs generalizing n with + | nil => simp [integerValueWord,powerBlockWord,integerPowerBlock_eval t n hn] + | cons z xs ih => + simp only [integerValueWord,List.map_cons,powerBlockWord,integerPowerBlock_eval t n hn] + rw [ih z.2 (hx z (by simp)) (fun w hw => hx w (by simp [hw]))] + +end + +/-! Absorption of base-algebra unitaries, with signed scalar gap expansions. -/ + +section Algebra +variable {A : Type*} [Monoid A] [StarMul A] + +def absorbedGapList (u : A) (s : Bool) : List (A × Bool) → List (A × Bool) + | [] => [] + | (d,t)::xs => (productRight u s*d*productLeft u t,t)::absorbedGapList u t xs + +theorem betweenWord_absorb_left (u v : A) (s : Bool) (xs : List (A × Bool)) (b : A) : + betweenWord (u*v) s xs b=productLeft u s*betweenWord v s (absorbedGapList u s xs) + (productRight u (finalWordSign s xs)*b) := by + induction xs generalizing s with + | nil => simp [betweenWord,absorbedGapList,finalWordSign,signed_product_split,mul_assoc] + | cons z xs ih => + simp only [betweenWord,absorbedGapList,finalWordSign,signed_product_split,ih,mul_assoc] +end Algebra +section + +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem absorbedGapList_reduced (D : StarSubalgebra ℂ (Q τ ω)) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ D) + (s : Bool) (xs : List (Q τ ω × Bool)) + (hx : SignedReducedGaps τ ω D.toSubalgebra s xs) : + SignedReducedGaps τ ω D.toSubalgebra s (absorbedGapList (u : Q τ ω) s xs) := by + induction xs generalizing s with + | nil => trivial + | cons z xs ih => + rcases z with ⟨d,r⟩ + refine ⟨?_,?_,ih r hx.2.2⟩ + · cases s <;> cases r <;> simp only [productRight,productLeft,Bool.false_eq_true, + ↓reduceIte,mul_one,one_mul] + · exact D.mul_mem hx.1 hu + · exact hx.1 + · exact D.mul_mem (D.mul_mem (D.star_mem' hu) hx.1) hu + · exact D.mul_mem (D.star_mem' hu) hx.1 + · intro hne + cases s <;> cases r + · exact (hne rfl).elim + · simpa [productRight,productLeft] using hx.2.1 (by decide) + · change quotientTrace τ ω (star (u : Q τ ω)*d*(u : Q τ ω))=0 + rw [quotientTrace_mul_comm τ ω (star (u : Q τ ω)*d),← mul_assoc, + u.property.2,one_mul] + exact hx.2.1 (by decide) + · exact (hne rfl).elim + +theorem HaarEndpoints.mul_left_signed {D : StarSubalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D.toSubalgebra t) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ D) + (a : Q τ ω) (ha : a ∈ D) (b : Q τ ω) (hb : b ∈ D) + (s : Bool) (xs : List (Q τ ω × Bool)) + (hx : SignedReducedGaps τ ω D.toSubalgebra s xs) : + quotientTrace τ ω (a*betweenWord (↑(u*t) : Q τ ω) s xs b)=0 := by + change quotientTrace τ ω (a*betweenWord ((u : Q τ ω)*(t : Q τ ω)) s xs b)=0 + rw [betweenWord_absorb_left,← mul_assoc] + apply h.signed_gaps τ ω _ ?_ _ ?_ s _ (absorbedGapList_reduced τ ω D u hu s xs hx) + · cases s <;> simp only [productLeft,Bool.false_eq_true,↓reduceIte,mul_one] + · exact D.mul_mem ha hu + · exact ha + · cases finalWordSign s xs <;> simp only [productRight,Bool.false_eq_true,↓reduceIte,one_mul] + · exact hb + · exact D.mul_mem (D.star_mem' hu) hb + +theorem HaarEndpoints.mul_left {D : StarSubalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D.toSubalgebra t) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ D) : + HaarEndpoints τ ω D.toSubalgebra (u*t) := by + intro a ha b hb n hn xs hxs + rw [integerValueWord_blocks τ ω _ n hn xs (fun z hz => (hxs z hz).2.2)] + apply h.mul_left_signed τ ω u hu a ha b hb + apply signedReducedGaps_blocks + intro z hz + obtain ⟨w,hw,rfl⟩ := List.mem_map.mp hz + exact ⟨(hxs w hw).1,(hxs w hw).2.1⟩ + +theorem integerValueWord_inv (t : unitary (Q τ ω)) (n : ℤ) + (xs : List (Q τ ω × ℤ)) (b : Q τ ω) : + integerValueWord τ ω t⁻¹ n xs b=integerValueWord τ ω t (-n) + (xs.map (fun z => (z.1,-z.2))) b := by + induction xs generalizing n with + | nil => simp [integerValueWord,zpow_neg] + | cons z xs ih => simp [integerValueWord,zpow_neg,ih] + +theorem HaarEndpoints.inv {D : Subalgebra ℂ (Q τ ω)} {t : unitary (Q τ ω)} + (h : HaarEndpoints τ ω D t) : HaarEndpoints τ ω D t⁻¹ := by + intro a ha b hb n hn xs hxs + rw [integerValueWord_inv] + apply h a ha b hb (-n) (neg_ne_zero.mpr hn) + intro z hz + obtain ⟨w,hw,rfl⟩ := List.mem_map.mp hz + exact ⟨(hxs w hw).1,(hxs w hw).2.1,neg_ne_zero.mpr (hxs w hw).2.2⟩ + +theorem HaarEndpoints.mul_right {D : StarSubalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D.toSubalgebra t) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ D) : + HaarEndpoints τ ω D.toSubalgebra (t*u) := by + have h' := (h.inv τ ω).mul_left τ ω u⁻¹ (show (↑u⁻¹ : Q τ ω) ∈ D from D.star_mem' hu) + simpa only [mul_inv_rev,inv_inv] using h'.inv τ ω + +theorem HaarEndpoints.absorb {D : StarSubalgebra ℂ (Q τ ω)} + {t : unitary (Q τ ω)} (h : HaarEndpoints τ ω D.toSubalgebra t) + (a b : unitary (Q τ ω)) (ha : (a : Q τ ω) ∈ D) (hb : (b : Q τ ω) ∈ D) : + HaarEndpoints τ ω D.toSubalgebra (a*t*b) := + (h.mul_left τ ω a ha).mul_right τ ω b hb + +end + +/-! Successive Haar choices in algebraic star subalgebras of the tracial quotient, with freeness retained in their represented operator-norm closures. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +structure SuccessiveCoordinateHaar (hNM : N ≤ M) (seed : Set (Q τ ω)) where + algebra : ℕ → StarSubalgebra ℂ (Q τ ω) + step : ∀ j,CoordinateHaarData τ ω hNM (algebra j).toSubalgebra + initial : algebra 0=StarAlgebra.adjoin ℂ seed + successor : ∀ j,algebra (j+1)=StarAlgebra.adjoin ℂ + (insert ((step j).t : Q τ ω) (algebra j : Set (Q τ ω))) + separable : ∀ j,TopologicalSpace.IsSeparable (algebra j : Set (Q τ ω)) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem nonempty_successiveCoordinateHaar (hω : (ω : Filter ℕ) ≤ atTop) + (seed : Set (Q τ ω)) (hseed : seed.Countable) : + Nonempty (SuccessiveCoordinateHaar τ ω hNM seed) := by + let : NormedSpace ℂ (Q τ ω) := (quotientInnerProductSpace τ ω).toNormedSpace + have : IsBoundedSMul ℂ (Q τ ω) := + IsBoundedSMul.of_norm_smul_le NormedSpace.norm_smul_le + have : ContinuousSMul ℂ (Q τ ω) := IsBoundedSMul.continuousSMul + let step (s : {s : Set (Q τ ω) // s.Countable}) := Classical.choice + (nonempty_coordinateHaarData τ ω hNM hfactor hdiff hirr hsep hω + (StarAlgebra.adjoin ℂ s.val).toSubalgebra (separable_countable_star_adjoin s.property)) + let S : ℕ → {s : Set (Q τ ω) // s.Countable} := Nat.rec ⟨seed,hseed⟩ + (fun _ s => ⟨insert ((step s).t : Q τ ω) s.val,s.property.insert _⟩) + refine ⟨⟨fun j => StarAlgebra.adjoin ℂ (S j).val,fun j => step (S j),rfl,?_, + fun j => separable_countable_star_adjoin (S j).property⟩⟩ + intro j + change StarAlgebra.adjoin ℂ (insert ((step (S j)).t : Q τ ω) (S j).val)= + StarAlgebra.adjoin ℂ (insert ((step (S j)).t : Q τ ω) + (StarAlgebra.adjoin ℂ (S j).val : Set (Q τ ω))) + apply le_antisymm + · apply StarAlgebra.adjoin_mono + exact Set.insert_subset_insert (StarAlgebra.subset_adjoin ℂ _) + · apply StarAlgebra.adjoin_le + apply Set.insert_subset + · exact StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert _ _) + · exact StarAlgebra.adjoin_mono (Set.subset_insert _ _) + +omit hfactor hdiff hirr hsep +variable {hNM} + +theorem SuccessiveCoordinateHaar.monotone {seed : Set (Q τ ω)} + (F : SuccessiveCoordinateHaar τ ω hNM seed) : Monotone F.algebra := by + apply monotone_nat_of_le_succ + intro j x hx + rw [F.successor] + exact StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert_of_mem _ hx) + +theorem SuccessiveCoordinateHaar.seed_mem {seed : Set (Q τ ω)} + (F : SuccessiveCoordinateHaar τ ω hNM seed) (j : ℕ) : seed ⊆ F.algebra j := by + intro x hx + apply F.monotone τ ω (Nat.zero_le j) + rw [F.initial] + exact StarAlgebra.subset_adjoin ℂ seed hx + +theorem SuccessiveCoordinateHaar.previous_mem {seed : Set (Q τ ω)} + (F : SuccessiveCoordinateHaar τ ω hNM seed) {i j : ℕ} (hij : i < j) : + ((F.step i).t : Q τ ω) ∈ F.algebra j := by + apply F.monotone τ ω hij + rw [F.successor] + exact StarAlgebra.subset_adjoin ℂ _ (Set.mem_insert _ _) + +end + +/-! Free variables and prefixes with Haar endpoint properties of W and y=zW*. Coordinates are retained in the sequence data. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def prefixVariable (u : unitary (Q τ ω)) (t : ℕ → unitary (Q τ ω)) : ℕ → unitary (Q τ ω) + | 0 => t 0 + | j+1 => u*t (j+1) + +def prefixProduct (u : unitary (Q τ ω)) (t : ℕ → unitary (Q τ ω)) : ℕ → unitary (Q τ ω) + | 0 => 1 + | j+1 => prefixProduct u t j*prefixVariable τ ω u t j + +theorem prefixProduct_formula (u : unitary (Q τ ω)) (t : ℕ → unitary (Q τ ω)) (ell : ℕ) : + prefixProduct τ ω u t (ell+1)=t 0*((List.range ell).map (fun j => u*t (j+1))).prod := by + induction ell with + | zero => simp [prefixProduct,prefixVariable] + | succ ell ih => + change prefixProduct τ ω u t (ell+1)*(u*t (ell+1))=_ + rw [ih] + simp only [List.range_succ,List.map_append,List.map_singleton,List.prod_append, + List.prod_singleton,mul_assoc] + +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem SuccessiveCoordinateHaar.variable_mem (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) {i j : ℕ} (hij : i < j) : + (prefixVariable τ ω u (fun k => (F.step k).t) i : Q τ ω) ∈ F.algebra j := by + cases i with + | zero => exact F.previous_mem τ ω hij + | succ i => exact (F.algebra j).mul_mem (F.seed_mem τ ω j hu) (F.previous_mem τ ω hij) + +theorem SuccessiveCoordinateHaar.prefix_mem (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) {k j : ℕ} (hkj : k ≤ j) : + (prefixProduct τ ω u (fun i => (F.step i).t) k : Q τ ω) ∈ F.algebra j := by + induction k with + | zero => exact (F.algebra j).one_mem + | succ k ih => + exact (F.algebra j).mul_mem (ih (by omega)) (F.variable_mem τ ω u hu (by omega)) + +theorem SuccessiveCoordinateHaar.variable_endpoints (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (j : ℕ) : + HaarEndpoints τ ω (F.algebra j).toSubalgebra + (prefixVariable τ ω u (fun k => (F.step k).t) j) := by + cases j with + | zero => exact (F.step 0).endpoints + | succ j => exact (F.step (j+1)).endpoints.mul_left τ ω u (F.seed_mem τ ω _ hu) + +theorem SuccessiveCoordinateHaar.prefix_endpoints (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (ell : ℕ) : + HaarEndpoints τ ω (F.algebra ell).toSubalgebra + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1)) := + (F.variable_endpoints τ ω u hu ell).mul_left τ ω _ (F.prefix_mem τ ω u hu le_rfl) + +theorem SuccessiveCoordinateHaar.target_endpoints (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary (Q τ ω)) (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (ell : ℕ) : + HaarEndpoints τ ω (F.algebra ell).toSubalgebra + (z*(prefixProduct τ ω u (fun k => (F.step k).t) (ell+1))⁻¹) := + ((F.prefix_endpoints τ ω u hu ell).inv τ ω).mul_left τ ω z (F.seed_mem τ ω _ hz) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_perturbation_haar_system (hω : (ω : Filter ℕ) ≤ atTop) + (u z : unitary (Q τ ω)) (xi : Q τ ω) : + ∃ F : SuccessiveCoordinateHaar τ ω hNM {(u : Q τ ω),(z : Q τ ω),xi}, + (∀ j,HaarEndpoints τ ω (F.algebra j).toSubalgebra + (prefixVariable τ ω u (fun k => (F.step k).t) j)) ∧ + ∀ ell,HaarEndpoints τ ω (F.algebra ell).toSubalgebra + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1)) ∧ + HaarEndpoints τ ω (F.algebra ell).toSubalgebra + (z*(prefixProduct τ ω u (fun k => (F.step k).t) (ell+1))⁻¹) := by + let F := Classical.choice (nonempty_successiveCoordinateHaar τ ω hNM hfactor hdiff hirr hsep hω + {(u : Q τ ω),(z : Q τ ω),xi} (((Set.countable_singleton xi).insert (z : Q τ ω)).insert (u : Q τ ω))) + exact ⟨F,F.variable_endpoints τ ω u (by simp),fun ell => + ⟨F.prefix_endpoints τ ω u (by simp) ell,F.target_endpoints τ ω u z (by simp) (by simp) ell⟩⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/HilbertLimits.lean b/lean/OAI/Analysis/FactorGeneration/HilbertLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..482423009b27f51193ff72035f3f411e7f1a61f4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/HilbertLimits.lean @@ -0,0 +1,465 @@ +import Mathlib.Analysis.CStarAlgebra.Hom +import Mathlib.Analysis.LocallyConvex.WeakSpace +import Mathlib.Topology.Semicontinuity.Basic +import OAI.Analysis.FactorGeneration.Bicommutant +import OAI.Analysis.FactorGeneration.CornerTrace + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Multiplication and adjoint limits in L2, with the necessary uniform +operator norm bounds stated explicitly. -/ +namespace Tracial +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem tendsto_vector_iff_norm₂ {I : Type*} (l : Filter I) + (a : I → M.toStarSubalgebra) (b : M.toStarSubalgebra) : + Tendsto (fun i => (a i : H →L[ℂ] H) τ.vector) l (𝓝 ((b : H →L[ℂ] H) τ.vector)) ↔ + Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0) := by + simpa only [dist_eq_norm,TracialRepresentation.norm₂_sub] using + (tendsto_iff_dist_tendsto_zero (f := fun i => (a i : H →L[ℂ] H) τ.vector) + (a := (b : H →L[ℂ] H) τ.vector)) + +theorem norm₂_limit_unique {I : Type*} {l : Filter I} [l.NeBot] + (a : I → M.toStarSubalgebra) {b c : M.toStarSubalgebra} + (hb : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) + (hc : Tendsto (fun i => τ.norm₂ (a i-c)) l (𝓝 0)) : b=c := by + have he := tendsto_nhds_unique ((tendsto_vector_iff_norm₂ τ l a b).mpr hb) + ((tendsto_vector_iff_norm₂ τ l a c).mpr hc) + apply sub_eq_zero.mp + apply τ.separating + change (b : H →L[ℂ] H) τ.vector-(c : H →L[ℂ] H) τ.vector=0 + exact sub_eq_zero.mpr he + +theorem norm₂_limit_star {I : Type*} {l : Filter I} (a : I → M.toStarSubalgebra) + (b : M.toStarSubalgebra) (h : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) : + Tendsto (fun i => τ.norm₂ (star (a i)-star b)) l (𝓝 0) := by + simpa only [← star_sub,τ.norm₂_star] using h + +theorem norm₂_limit_mul {I : Type*} {l : Filter I} + (a c : I → M.toStarSubalgebra) (b d : M.toStarSubalgebra) + (C : ℝ) (hC : ∀ i, ‖a i‖ ≤ C) + (ha : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) + (hc : Tendsto (fun i => τ.norm₂ (c i-d)) l (𝓝 0)) : + Tendsto (fun i => τ.norm₂ (a i*c i-b*d)) l (𝓝 0) := by + have hbound : ∀ i, τ.norm₂ (a i*c i-b*d) ≤ C*τ.norm₂ (c i-d)+τ.norm₂ (a i-b)*‖d‖ := by + intro i + have he : a i*c i-b*d = a i*(c i-d)+(a i-b)*d := by + simp only [mul_sub,sub_mul]; abel + rw [he] + exact (τ.norm₂_add_le _ _).trans (add_le_add + ((τ.norm₂_mul_le _ _).trans (mul_le_mul_of_nonneg_right (hC i) (norm_nonneg _))) + (τ.norm₂_mul_le_right _ _)) + apply squeeze_zero (fun i => norm_nonneg _) hbound + simpa using (hc.const_mul C).add (ha.mul_const ‖d‖) + +theorem norm₂_limit_trace {I : Type*} {l : Filter I} + (a : I → M.toStarSubalgebra) (b : M.toStarSubalgebra) + (h : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) : + Tendsto (fun i => τ.trace (a i)) l (𝓝 (τ.trace b)) := by + apply (tendsto_iff_norm_sub_tendsto_zero).mpr + apply squeeze_zero (fun i => norm_nonneg _) + (fun i => ?_) h + rw [← trace_sub] + exact τ.norm_trace_le_norm₂ _ + +end Tracial + +/-! A separating vector for a concrete von Neumann algebra is cyclic for its +commutant. The original representation need not be cyclic for the algebra. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def vectorOrbitMap (S : StarSubalgebra ℂ (H →L[ℂ] H)) (ξ : H) : S →ₗ[ℂ] H where + toFun a := a.val ξ + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def vectorOrbitClosure (S : StarSubalgebra ℂ (H →L[ℂ] H)) (ξ : H) : Submodule ℂ H := + (vectorOrbitMap S ξ).range.topologicalClosure + +instance vectorOrbitClosure_complete (S : StarSubalgebra ℂ (H →L[ℂ] H)) (ξ : H) : + CompleteSpace (vectorOrbitClosure S ξ) := + inferInstanceAs (CompleteSpace (vectorOrbitMap S ξ).range.topologicalClosure) + +theorem mem_vectorOrbitClosure (S : StarSubalgebra ℂ (H →L[ℂ] H)) (ξ : H) : + ξ ∈ vectorOrbitClosure S ξ := + Submodule.le_topologicalClosure _ ⟨1,rfl⟩ + +theorem vectorOrbitClosure_invariant (S : StarSubalgebra ℂ (H →L[ℂ] H)) (ξ : H) + (a : S) {y : H} (hy : y ∈ vectorOrbitClosure S ξ) : a.val y ∈ vectorOrbitClosure S ξ := by + have h : (vectorOrbitMap S ξ).range.topologicalClosure ≤ + (vectorOrbitClosure S ξ).comap a.val.toLinearMap := by + apply Submodule.topologicalClosure_minimal + · rintro z ⟨b,rfl⟩ + exact Submodule.le_topologicalClosure _ ⟨a*b,rfl⟩ + · exact (Submodule.isClosed_topologicalClosure _).preimage a.val.continuous + exact h hy + +theorem vectorOrbitProjection_commutes (S : StarSubalgebra ℂ (H →L[ℂ] H)) (ξ : H) + (a : S) : (vectorOrbitClosure S ξ).starProjection*a.val= + a.val*(vectorOrbitClosure S ξ).starProjection := by + apply starProjection_commutes_of_invariant + · exact fun y hy => vectorOrbitClosure_invariant S ξ a hy + · exact fun y hy => vectorOrbitClosure_invariant S ξ (star a) hy + +theorem commutant_orbitClosure_eq_top (M : VonNeumannAlgebra H) (ξ : H) + (hξ : ∀ a : M.toStarSubalgebra,a.val ξ=0 → a=0) : + vectorOrbitClosure M.commutant.toStarSubalgebra ξ=⊤ := by + let K := vectorOrbitClosure M.commutant.toStarSubalgebra ξ + have hQ : K.starProjection ∈ M := by + have h : K.starProjection ∈ M.commutant.commutant := by + apply VonNeumannAlgebra.mem_commutant_iff.mpr + intro a ha + exact (vectorOrbitProjection_commutes M.commutant.toStarSubalgebra ξ ⟨a,ha⟩).symm + simpa only [M.commutant_commutant] using h + have he : (1-K.starProjection) ξ=0 := by + change ξ-K.starProjection ξ=0 + rw [Submodule.starProjection_eq_self_iff.mpr (mem_vectorOrbitClosure _ _),sub_self] + have hzero := hξ ⟨1-K.starProjection,M.toStarSubalgebra.sub_mem M.one_mem hQ⟩ he + have h1 : K.starProjection=1 := by + have h := congrArg Subtype.val hzero + exact (sub_eq_zero.mp h).symm + apply top_unique + intro y _ + apply Submodule.starProjection_eq_self_iff.mp + rw [show (vectorOrbitClosure M.commutant.toStarSubalgebra ξ).starProjection=1 from h1] + rfl + +theorem commutant_orbit_dense (M : VonNeumannAlgebra H) (ξ : H) + (hξ : ∀ a : M.toStarSubalgebra,a.val ξ=0 → a=0) : + Dense (Set.range (fun a : M.commutant.toStarSubalgebra => a.val ξ)) := by + intro y + have h : y ∈ vectorOrbitClosure M.commutant.toStarSubalgebra ξ := by + rw [commutant_orbitClosure_eq_top M ξ hξ] + trivial + exact h + +end + +/-! Restrict the faithful trace representation to the closure of M times its +trace vector. This constructs a faithful, isometric, cyclic representation on +an actual Hilbert subspace. No Banach predual or WOT-closed image is asserted. -/ +namespace Tracial + +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +abbrev traceCyclicSpace := vectorOrbitClosure M.toStarSubalgebra τ.vector + +def traceCyclicVector : traceCyclicSpace τ := ⟨τ.vector,mem_vectorOrbitClosure _ _⟩ + +def traceCyclicOperator (a : M.toStarSubalgebra) : + traceCyclicSpace τ →L[ℂ] traceCyclicSpace τ := + a.val.restrict (fun _ hy => vectorOrbitClosure_invariant _ _ a hy) + +@[simp] theorem traceCyclicOperator_apply (a : M.toStarSubalgebra) (y : traceCyclicSpace τ) : + (traceCyclicOperator τ a y).val=a.val y.val := rfl + +theorem traceCyclicOperator_star (a : M.toStarSubalgebra) : + traceCyclicOperator τ (star a)=star (traceCyclicOperator τ a) := by + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + change inner ℂ y.val (star a.val x.val)=inner ℂ y (star (traceCyclicOperator τ a) x) + simp only [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + rfl + +def traceCyclicHom : M.toStarSubalgebra →⋆ₐ[ℂ] + (traceCyclicSpace τ →L[ℂ] traceCyclicSpace τ) where + toFun := traceCyclicOperator τ + map_one' := by ext y; rfl + map_mul' _ _ := by ext y; rfl + map_zero' := by ext y; rfl + map_add' _ _ := by ext y; rfl + commutes' _ := by ext y; rfl + map_star' := traceCyclicOperator_star τ + +theorem traceCyclicHom_injective : Function.Injective (traceCyclicHom τ) := by + intro a b hab + apply sub_eq_zero.mp + apply τ.separating + have h := congrArg (fun T : traceCyclicSpace τ →L[ℂ] traceCyclicSpace τ => + (T (traceCyclicVector τ)).val) hab + exact sub_eq_zero.mpr h + +theorem traceCyclicHom_norm (a : M.toStarSubalgebra) : ‖traceCyclicHom τ a‖=‖a‖ := by + let : CStarAlgebra M.toStarSubalgebra := {} + let : CStarAlgebra (traceCyclicSpace τ →L[ℂ] traceCyclicSpace τ) := {} + exact NonUnitalStarAlgHom.norm_map (traceCyclicHom τ) (traceCyclicHom_injective τ) a + +theorem traceCyclicHom_isometry : Isometry (traceCyclicHom τ) := + AddMonoidHomClass.isometry_of_norm (traceCyclicHom τ) (traceCyclicHom_norm τ) + +theorem traceCyclicVector_norm : ‖traceCyclicVector τ‖=1 := τ.norm_vector + +theorem traceCyclicHom_trace (a : M.toStarSubalgebra) : + inner ℂ (traceCyclicVector τ) (traceCyclicHom τ a (traceCyclicVector τ))=τ.trace a := rfl + +theorem traceCyclicHom_norm₂ (a : M.toStarSubalgebra) : + ‖traceCyclicHom τ a (traceCyclicVector τ)‖=τ.norm₂ a := rfl + +theorem traceCyclicHom_cyclic : + Dense (Set.range (fun a : M.toStarSubalgebra => traceCyclicHom τ a (traceCyclicVector τ))) := by + intro y + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨z,⟨a,rfl⟩,ha⟩ := Metric.mem_closure_iff.mp y.property ε hε + exact ⟨traceCyclicHom τ a (traceCyclicVector τ),⟨a,rfl⟩,ha⟩ + +theorem traceCyclicSpace_separable + (hsep : TopologicalSpace.IsSeparable + (Set.range (fun a : M.toStarSubalgebra => a.val τ.vector))) : + TopologicalSpace.SeparableSpace (traceCyclicSpace τ) := + hsep.closure.separableSpace + +end + +/-! The faithful cyclic restriction sends actual algebra balls to compact +weak-operator balls. On each bounded ball it is a closed topological embedding. -/ +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def cyclicBallMap (C : ℝ) (T : weakOperatorBall M C) : + traceCyclicSpace τ →WOT[ℂ] traceCyclicSpace τ := + ContinuousLinearMapWOT.ofCLM (traceCyclicHom τ ⟨T.val.toCLM,T.property.1⟩) + +theorem cyclicBallMap_continuous (C : ℝ) : Continuous (cyclicBallMap τ C) := by + apply ContinuousLinearMapWOT.continuous_iff.mpr + intro x y + change Continuous (fun T : weakOperatorBall M C => inner ℂ y.val (T.val x.val)) + exact ContinuousLinearMapWOT.continuous_inner_apply continuous_subtype_val x.val y.val + +theorem cyclicBallMap_injective (C : ℝ) : Function.Injective (cyclicBallMap τ C) := by + intro a b hab + have he : traceCyclicHom τ ⟨a.val.toCLM,a.property.1⟩= + traceCyclicHom τ ⟨b.val.toCLM,b.property.1⟩ := + congrArg ContinuousLinearMapWOT.toCLM hab + have he' := congrArg Subtype.val (traceCyclicHom_injective τ he) + apply Subtype.ext + exact congrArg ContinuousLinearMapWOT.ofCLM he' + +theorem cyclicBallMap_isClosedEmbedding (C : ℝ) : + Topology.IsClosedEmbedding (cyclicBallMap τ C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + exact (cyclicBallMap_continuous τ C).isClosedEmbedding (cyclicBallMap_injective τ C) + +def cyclicWeakOperatorBall (C : ℝ) : Set (traceCyclicSpace τ →WOT[ℂ] traceCyclicSpace τ) := + {T | ∃ a : M.toStarSubalgebra,‖a‖ ≤ C ∧ ContinuousLinearMapWOT.ofCLM (traceCyclicHom τ a)=T} + +theorem cyclicWeakOperatorBall_eq_range (C : ℝ) : + cyclicWeakOperatorBall τ C=Set.range (cyclicBallMap τ C) := by + ext T + constructor + · rintro ⟨a,ha,rfl⟩ + exact ⟨⟨ContinuousLinearMapWOT.ofCLM a.val,⟨a.property,ha⟩⟩,rfl⟩ + · rintro ⟨a,rfl⟩ + exact ⟨⟨a.val.toCLM,a.property.1⟩,a.property.2,rfl⟩ + +theorem cyclicWeakOperatorBall_isCompact (C : ℝ) : IsCompact (cyclicWeakOperatorBall τ C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + rw [cyclicWeakOperatorBall_eq_range] + exact isCompact_range (cyclicBallMap_continuous τ C) + +theorem cyclicWeakOperatorBall_isClosed (C : ℝ) : IsClosed (cyclicWeakOperatorBall τ C) := + (cyclicWeakOperatorBall_isCompact τ C).isClosed + +end Tracial + +/-! A real linear functional continuous for bounded trace-two-norm sequences +is WOT continuous on the unit ball. Closed convex slices of the trace-vector +ball supply the conversion; no identification of the two topologies is assumed. -/ +open Filter +open scoped Topology +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem traceVector_weak_continuous (C : ℝ) : + Continuous (fun T : weakOperatorBall M C => toWeakSpace ℂ H (T.val τ.vector)) := by + apply WeakBilin.continuous_of_continuous_eval + intro f + exact (ContinuousLinearMapWOT.continuous_dual_apply τ.vector f).comp continuous_subtype_val + +def traceFunctionalSlice (f : M.toStarSubalgebra →L[ℝ] ℝ) (r : ℝ) : Set H := + {ξ | ∃ a : M.toStarSubalgebra, ‖a‖ ≤ 1 ∧ f a ≤ r ∧ a.val τ.vector = ξ} + +theorem traceFunctionalSlice_convex (f : M.toStarSubalgebra →L[ℝ] ℝ) (r : ℝ) : + Convex ℝ (traceFunctionalSlice τ f r) := by + intro x hx y hy s t hs ht hst + obtain ⟨a, ha, hfa, rfl⟩ := hx + obtain ⟨b, hb, hfb, rfl⟩ := hy + refine ⟨s • a + t • b, ?_, ?_, rfl⟩ + · calc + ‖s • a + t • b‖ ≤ ‖s • a‖ + ‖t • b‖ := norm_add_le _ _ + _ = s * ‖a‖ + t * ‖b‖ := by + rw [norm_smul, norm_smul, Real.norm_of_nonneg hs, Real.norm_of_nonneg ht] + _ ≤ s * 1 + t * 1 := _root_.add_le_add + (mul_le_mul_of_nonneg_left ha hs) (mul_le_mul_of_nonneg_left hb ht) + _ = 1 := by simpa only [mul_one] using hst + · rw [map_add, map_smul, map_smul, smul_eq_mul, smul_eq_mul] + calc + s*f a+t*f b ≤ s*r+t*r := _root_.add_le_add + (mul_le_mul_of_nonneg_left hfa hs) (mul_le_mul_of_nonneg_left hfb ht) + _ = r := by rw [← add_mul, hst, one_mul] + +theorem traceFunctionalSlice_isClosed (f : M.toStarSubalgebra →L[ℝ] ℝ) + (hf : ∀ (a : ℕ → M.toStarSubalgebra) (b : M.toStarSubalgebra), + (∀ n, ‖a n‖ ≤ 1) → Tendsto (fun n => τ.norm₂ (a n-b)) atTop (𝓝 0) → + Tendsto (fun n => f (a n)) atTop (𝓝 (f b))) (r : ℝ) : + IsClosed (traceFunctionalSlice τ f r) := by + apply IsSeqClosed.isClosed + intro ξ z hz hlim + choose a ha hfa he using hz + have hva : Tendsto (fun n => (a n).val τ.vector) atTop (𝓝 z) := by + simpa only [he] using hlim + obtain ⟨b, hb, hbe⟩ := bounded_trace_limit τ a 1 zero_le_one ha z hva + refine ⟨b, hb, ?_, hbe⟩ + apply le_of_tendsto (hf a b ha ?_) (Eventually.of_forall hfa) + apply (tendsto_vector_iff_norm₂ τ atTop a b).mp + rwa [hbe] + +theorem unitBall_functional_sublevel_isClosed (f : M.toStarSubalgebra →L[ℝ] ℝ) + (hf : ∀ (a : ℕ → M.toStarSubalgebra) (b : M.toStarSubalgebra), + (∀ n, ‖a n‖ ≤ 1) → Tendsto (fun n => τ.norm₂ (a n-b)) atTop (𝓝 0) → + Tendsto (fun n => f (a n)) atTop (𝓝 (f b))) (r : ℝ) : + IsClosed {T : weakOperatorBall M 1 | f ⟨T.val.toCLM, T.property.1⟩ ≤ r} := by + have hclosed := traceFunctionalSlice_isClosed τ f hf r + have hconvex := traceFunctionalSlice_convex τ f r + have hw : IsClosed ((toWeakSpace ℂ H) '' traceFunctionalSlice τ f r) := by + rw [← closure_eq_iff_isClosed, ← hconvex.toWeakSpace_closure ℂ, hclosed.closure_eq] + have hpre := hw.preimage (traceVector_weak_continuous τ 1) + convert hpre using 1 + ext T + constructor + · intro h + exact ⟨T.val τ.vector, ⟨⟨T.val.toCLM, T.property.1⟩, T.property.2, h, rfl⟩, rfl⟩ + · rintro ⟨ξ, ⟨a, _, hfa, ha⟩, he⟩ + have hv : a.val τ.vector = T.val τ.vector := ha.trans ((toWeakSpace ℂ H).injective he) + have heq : a = (⟨T.val.toCLM, T.property.1⟩ : M.toStarSubalgebra) := by + apply sub_eq_zero.mp + apply τ.separating + change a.val τ.vector - T.val τ.vector = 0 + exact sub_eq_zero.mpr hv + change f ⟨T.val.toCLM, T.property.1⟩ ≤ r + simpa only [heq] using hfa + +theorem unitBall_functional_continuous_of_norm₂ (f : M.toStarSubalgebra →L[ℝ] ℝ) + (hf : ∀ (a : ℕ → M.toStarSubalgebra) (b : M.toStarSubalgebra), + (∀ n, ‖a n‖ ≤ 1) → Tendsto (fun n => τ.norm₂ (a n-b)) atTop (𝓝 0) → + Tendsto (fun n => f (a n)) atTop (𝓝 (f b))) : + Continuous (fun T : weakOperatorBall M 1 => f ⟨T.val.toCLM, T.property.1⟩) := by + apply continuous_iff_lower_upperSemicontinuous.mpr + constructor + · exact lowerSemicontinuous_iff_isClosed_preimage.mpr + (unitBall_functional_sublevel_isClosed τ f hf) + · apply upperSemicontinuous_iff_isClosed_preimage.mpr + intro r + have hn := unitBall_functional_sublevel_isClosed τ (-f) + (fun a b ha ht => (hf a b ha ht).neg) (-r) + change IsClosed {T : weakOperatorBall M 1 | r ≤ f ⟨T.val.toCLM, T.property.1⟩} + simpa only [neg_apply, neg_le_neg_iff] using hn + +end Tracial + +/-! On a uniformly operator-norm bounded family in a faithfully vector-traced +von Neumann algebra, L2 convergence implies strong and adjoint-strong convergence +in the original Hilbert space. -/ +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +omit [CompleteSpace H] in +theorem bounded_operators_tendsto_of_dense {I : Type*} {l : Filter I} + (a : I → H →L[ℂ] H) (b : H →L[ℂ] H) (C : ℝ) + (ha : ∀ i,‖a i‖ ≤ C) (s : Set H) (hs : Dense s) + (hlim : ∀ y ∈ s,Tendsto (fun i => a i y) l (𝓝 (b y))) : + ∀ y : H,Tendsto (fun i => a i y) l (𝓝 (b y)) := by + intro y + apply Metric.tendsto_nhds.mpr + intro ε hε + let D := |C|+‖b‖+1 + have hD : 0 < D := by dsimp [D]; positivity + obtain ⟨z,hz,hyz⟩ := Metric.mem_closure_iff.mp (hs y) (ε/(2*D)) (by positivity) + have hzlim := Metric.tendsto_nhds.mp (hlim z hz) (ε/2) (by positivity) + filter_upwards [hzlim] with i hi + have he : a i y-b y=(a i-b) (y-z)+(a i z-b z) := by + simp only [sub_apply,map_sub]; abel + have hn : ‖a i-b‖ ≤ D := by + calc + ‖a i-b‖ ≤ ‖a i‖+‖b‖ := norm_sub_le _ _ + _ ≤ |C|+‖b‖ := _root_.add_le_add ((ha i).trans (le_abs_self C)) le_rfl + _ ≤ D := le_add_of_nonneg_right zero_le_one + have hd : D*‖y-z‖ < ε/2 := by + have h := (mul_lt_mul_iff_right₀ hD).mpr hyz + rw [dist_eq_norm] at h + have heq : D*(ε/(2*D))=ε/2 := by field_simp + rw [heq] at h + exact h + rw [dist_eq_norm,he] + have hbound := ((a i-b).le_opNorm (y-z)).trans + (mul_le_mul_of_nonneg_right hn (norm_nonneg _)) + have hi' : ‖a i z-b z‖ < ε/2 := by simpa only [dist_eq_norm] using hi + exact (norm_add_le _ _).trans_lt (by linarith) + +namespace Tracial +open UltrapowerBridge +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem norm₂_limit_strong {I : Type*} {l : Filter I} + (a : I → M.toStarSubalgebra) (b : M.toStarSubalgebra) (C : ℝ) + (ha : ∀ i,‖a i‖ ≤ C) + (hlim : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) : + ∀ y : H,Tendsto (fun i => (a i).val y) l (𝓝 (b.val y)) := by + apply bounded_operators_tendsto_of_dense (fun i => (a i).val) b.val C ha + (Set.range (fun c : M.commutant.toStarSubalgebra => c.val τ.vector)) + (commutant_orbit_dense M τ.vector τ.separating) + rintro _ ⟨c,rfl⟩ + have he (d : M.toStarSubalgebra) : d.val (c.val τ.vector)=c.val (d.val τ.vector) := + congrArg (fun T : H →L[ℂ] H => T τ.vector) + (VonNeumannAlgebra.mem_commutant_iff.mp c.property d.val d.property) + simp only [he] + exact c.val.continuous.continuousAt.tendsto.comp + ((tendsto_vector_iff_norm₂ τ l a b).mpr hlim) + +theorem norm₂_limit_strong_star {I : Type*} {l : Filter I} + (a : I → M.toStarSubalgebra) (b : M.toStarSubalgebra) (C : ℝ) + (ha : ∀ i,‖a i‖ ≤ C) + (hlim : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) : + ∀ y : H,Tendsto (fun i => (star (a i)).val y) l (𝓝 ((star b).val y)) := + norm₂_limit_strong τ (fun i => star (a i)) (star b) C + (fun i => by + change ‖star ((a i).val)‖ ≤ C + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint.norm_map] + exact ha i) (norm₂_limit_star τ a b hlim) + +theorem bounded_strong_iff_norm₂ {I : Type*} {l : Filter I} + (a : I → M.toStarSubalgebra) (b : M.toStarSubalgebra) (C : ℝ) + (ha : ∀ i,‖a i‖ ≤ C) : + (∀ y : H,Tendsto (fun i => (a i).val y) l (𝓝 (b.val y))) ↔ + Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0) := + ⟨fun h => (tendsto_vector_iff_norm₂ τ l a b).mp (h τ.vector), + norm₂_limit_strong τ a b C ha⟩ + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/HilbertProjections.lean b/lean/OAI/Analysis/FactorGeneration/HilbertProjections.lean new file mode 100644 index 0000000000000000000000000000000000000000..13f7ff968f3854646050632ce32a0e55a776dd8d --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/HilbertProjections.lean @@ -0,0 +1,248 @@ +import Mathlib.Algebra.Order.Archimedean.Real.Basic +import Mathlib.Analysis.InnerProductSpace.Projection.Basic +import Mathlib.Tactic.Linarith +import Mathlib.Topology.Baire.Lemmas +import Mathlib.Topology.MetricSpace.Pseudo.Defs +import Mathlib.Topology.Semicontinuity.Basic + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Baire continuity points from rational sublevel boundaries, without a global boundedness assumption. -/ +section +open Set Filter Topology +variable {X : Type*} [TopologicalSpace X] + +/-- An explicit countable intersection of open sets of continuity points. -/ +def continuityCore (f : X → ℝ) : Set X := + ⋂ q : ℚ, (frontier {x | f x ≤ (q : ℝ)})ᶜ + +theorem continuityCore_isGδ (f : X → ℝ) : IsGδ (continuityCore f) := + IsGδ.iInter_of_isOpen fun _ => isClosed_frontier.isOpen_compl + +theorem continuityCore_dense [BaireSpace X] {f : X → ℝ} + (hf : LowerSemicontinuous f) : Dense (continuityCore f) := by + apply dense_iInter_of_isOpen (fun _ => isClosed_frontier.isOpen_compl) + intro q + exact interior_eq_empty_iff_dense_compl.mp (interior_frontier (hf.isClosed_preimage q)) + +theorem continuousAt_of_mem_continuityCore {f : X → ℝ} + (hf : LowerSemicontinuous f) {x : X} (hx : x ∈ continuityCore f) : + ContinuousAt f x := by + apply continuousAt_iff_lower_upperSemicontinuousAt.mpr + refine ⟨hf x, ?_⟩ + intro b hb + obtain ⟨q, hxq, hqb⟩ := exists_rat_btwn hb + have hnot : x ∉ frontier {y | f y ≤ (q : ℝ)} := Set.mem_iInter.mp hx q + have hint : x ∈ interior {y | f y ≤ (q : ℝ)} := + (mem_interior_iff_notMem_frontier (show x ∈ {y | f y ≤ (q : ℝ)} from hxq.le)).mpr hnot + have hnhds : {y | f y ≤ (q : ℝ)} ∈ 𝓝 x := mem_interior_iff_mem_nhds.mp hint + exact Filter.mem_of_superset hnhds fun y hy => lt_of_le_of_lt hy hqb + +/-- The common continuity set for a countable family, as used before +extending the projection-norm conclusion to all L2 vectors. -/ +theorem common_continuity_core [BaireSpace X] (f : ℕ → X → ℝ) + (hf : ∀ n, LowerSemicontinuous (f n)) : + ∃ C : Set X, IsGδ C ∧ Dense C ∧ ∀ x ∈ C, ∀ n, ContinuousAt (f n) x := by + refine ⟨⋂ n, continuityCore (f n), IsGδ.iInter (fun n => continuityCore_isGδ (f n)), + dense_iInter_of_Gδ (fun n => continuityCore_isGδ (f n)) + (fun n => continuityCore_dense (hf n)), ?_⟩ + intro x hx n + exact continuousAt_of_mem_continuityCore (hf n) (Set.mem_iInter.mp hx n) + +/-- The uniform Lipschitz estimate in the vector variable extends continuity +from a dense sequence to every vector (eq:projection-vector-lipschitz). -/ +theorem continuousAt_of_dense_lipschitz {E : Type*} [PseudoMetricSpace E] + (F : E → X → ℝ) (e : ℕ → E) (he : DenseRange e) + (hLip : ∀ x a b, dist (F a x) (F b x) ≤ dist a b) + {x : X} (hcont : ∀ n, ContinuousAt (F (e n)) x) (a : E) : + ContinuousAt (F a) x := by + rw [Metric.continuousAt_iff'] + intro ε hε + obtain ⟨n, hn⟩ := he.exists_dist_lt a (show 0 < ε / 3 by linarith) + have hncont := Metric.continuousAt_iff'.mp (hcont n) (ε / 3) (by linarith) + filter_upwards [hncont] with y hy + have hleft := hLip y a (e n) + have hright := hLip x (e n) a + rw [dist_comm (e n) a] at hright + calc + dist (F a y) (F a x) ≤ dist (F a y) (F (e n) y) + + dist (F (e n) y) (F a x) := dist_triangle _ _ _ + _ ≤ dist (F a y) (F (e n) y) + + (dist (F (e n) y) (F (e n) x) + dist (F (e n) x) (F a x)) := + by linarith [dist_triangle (F (e n) y) (F (e n) x) (F a x)] + _ < ε := by linarith + +/-- Baire continuity of a family of Hilbert-space projections. -/ +theorem common_continuity_of_lipschitz [BaireSpace X] + {E : Type*} [PseudoMetricSpace E] [TopologicalSpace.SeparableSpace E] [Nonempty E] + (F : E → X → ℝ) (hf : ∀ a, LowerSemicontinuous (F a)) + (hLip : ∀ x a b, dist (F a x) (F b x) ≤ dist a b) : + ∃ C : Set X, IsGδ C ∧ Dense C ∧ ∀ x ∈ C, ∀ a, ContinuousAt (F a) x := by + obtain ⟨e, he⟩ := TopologicalSpace.exists_dense_seq (α := E) + obtain ⟨C, hG, hd, hC⟩ := common_continuity_core (fun n => F (e n)) (fun n => hf (e n)) + exact ⟨C, hG, hd, fun x hx a => continuousAt_of_dense_lipschitz F e he hLip (hC x hx) a⟩ + +end + +/-! Hilbert-space projection and correlation identities. The inner product is conjugate-linear in its first argument, so `inner ℂ ξ W` represents τ(ξ* W). -/ +section +open scoped InnerProductSpace +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] +variable (K : Submodule ℂ E) [K.HasOrthogonalProjection] + +def projectionNorm (ξ : E) : ℝ := ‖K.starProjection ξ‖ + +theorem projectionNorm_bounds (ξ : E) : + 0 ≤ projectionNorm K ξ ∧ projectionNorm K ξ ≤ ‖ξ‖ := + ⟨norm_nonneg _, K.norm_starProjection_apply_le ξ⟩ + +theorem projectionNorm_lipschitz (ξ η : E) : + dist (projectionNorm K ξ) (projectionNorm K η) ≤ dist ξ η := by + calc + dist (projectionNorm K ξ) (projectionNorm K η) ≤ + dist (K.starProjection ξ) (K.starProjection η) := by + simpa only [projectionNorm, dist_eq_norm] using + dist_norm_norm_le (K.starProjection ξ) (K.starProjection η) + _ ≤ dist ξ η := by + simp only [dist_eq_norm, ← map_sub] + exact K.norm_starProjection_apply_le (ξ - η) + +theorem correlation_le_projectionNorm (ξ W : E) (hW : W ∈ K) (hunit : ‖W‖ = 1) : + ‖inner ℂ ξ W‖ ≤ projectionNorm K ξ := by + have hfix : K.starProjection W = W := K.starProjection_eq_self_iff.mpr hW + have hi : inner ℂ (K.starProjection ξ) W = inner ℂ ξ W := by + rw [K.inner_starProjection_left_eq_right, hfix] + rw [← hi] + simpa [projectionNorm, hunit] using norm_inner_le_norm (K.starProjection ξ) W + +def residual (z : E) : E := z - K.starProjection z + +theorem residual_projection_zero (z : E) : K.starProjection (residual K z) = 0 := by + apply K.starProjection_apply_eq_zero_iff.mpr + exact K.sub_starProjection_mem_orthogonal z + +theorem residual_norm_pos {z : E} (hz : z ∉ K) : 0 < ‖residual K z‖ := by + apply norm_pos_iff.mpr + intro hzero + have heq : z = K.starProjection z := sub_eq_zero.mp hzero + exact hz (heq.symm ▸ K.starProjection_apply_mem z) + +theorem residual_correlation (z : E) : + inner ℂ (residual K z) z = (‖residual K z‖ : ℂ) ^ 2 := by + have horth : inner ℂ (residual K z) (K.starProjection z) = 0 := + K.starProjection_inner_eq_zero z _ (K.starProjection_apply_mem z) + have hself := inner_self_eq_norm_sq_to_K (𝕜 := ℂ) (residual K z) + calc + inner ℂ (residual K z) z = + inner ℂ (residual K z) (residual K z + K.starProjection z) := by + simp only [residual, sub_add_cancel] + _ = inner ℂ (residual K z) (residual K z) := by rw [inner_add_right, horth, add_zero] + _ = _ := hself + +/-- Instantiation of the topological theorem with actual orthogonal projections. +Lower semicontinuity remains an explicit prerequisite to prove for W*(P,u). -/ +theorem common_projectionNorm_continuity {X : Type*} [TopologicalSpace X] [BaireSpace X] + [TopologicalSpace.SeparableSpace E] (L : X → Submodule ℂ E) + [∀ x, (L x).HasOrthogonalProjection] + (hsemi : ∀ ξ, LowerSemicontinuous (fun x => projectionNorm (L x) ξ)) : + ∃ C : Set X, IsGδ C ∧ Dense C ∧ + ∀ x ∈ C, ∀ ξ, ContinuousAt (fun y => projectionNorm (L y) ξ) x := + common_continuity_of_lipschitz (fun ξ x => projectionNorm (L x) ξ) hsemi + (fun x ξ η => projectionNorm_lipschitz (L x) ξ η) + +end + +/-! Lower semicontinuity from a continuous family dense in each projected subspace. -/ +open Set Filter Topology +variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +def normalizedCorrelation (ξ w : E) : ℝ := ‖inner ℂ ξ w‖ / ‖w‖ + +theorem normalizedCorrelation_continuousAt (ξ : E) {w : E} (hw : w ≠ 0) : + ContinuousAt (normalizedCorrelation ξ) w := by + exact (continuous_const.inner continuous_id).norm.continuousAt.div + continuous_norm.continuousAt (norm_ne_zero_iff.mpr hw) + +theorem normalizedCorrelation_le_projectionNorm (K : Submodule ℂ E) + [K.HasOrthogonalProjection] (ξ w : E) (hw : w ∈ K) : + normalizedCorrelation ξ w ≤ projectionNorm K ξ := by + by_cases hzero : w = 0 + · simpa [normalizedCorrelation, hzero] using (projectionNorm_bounds K ξ).1 + have hnorm : 0 < ‖w‖ := norm_pos_iff.mpr hzero + apply (div_le_iff₀ hnorm).mpr + have hfix : K.starProjection w = w := K.starProjection_eq_self_iff.mpr hw + have hi : inner ℂ (K.starProjection ξ) w = inner ℂ ξ w := by + rw [K.inner_starProjection_left_eq_right, hfix] + rw [← hi] + exact norm_inner_le_norm _ _ + +theorem normalizedCorrelation_starProjection (K : Submodule ℂ E) + [K.HasOrthogonalProjection] (ξ : E) : + normalizedCorrelation ξ (K.starProjection ξ) = projectionNorm K ξ := by + by_cases hz : K.starProjection ξ = 0 + · simp [normalizedCorrelation, projectionNorm, hz] + have hfix : K.starProjection (K.starProjection ξ) = K.starProjection ξ := + K.starProjection_eq_self_iff.mpr (K.starProjection_apply_mem ξ) + have hi : inner ℂ (K.starProjection ξ) (K.starProjection ξ) = + inner ℂ ξ (K.starProjection ξ) := by + rw [K.inner_starProjection_left_eq_right, hfix] + rw [normalizedCorrelation, ← hi, inner_self_eq_norm_sq_to_K] + simp [projectionNorm, Complex.norm_real, pow_two, norm_ne_zero_iff.mpr hz] + +/-- Dense continuous sections imply lower semicontinuity of every projection norm. +The index type need not be countable, matching the P-coefficient polynomials. -/ +theorem projectionNorm_lowerSemicontinuous {X I : Type*} [TopologicalSpace X] + (L : X → Submodule ℂ E) [∀ x, (L x).HasOrthogonalProjection] + (b : I → X → E) (hb : ∀ i x, b i x ∈ L x) (hc : ∀ i, Continuous (b i)) + (hd : ∀ x, DenseRange (fun i => (⟨b i x, hb i x⟩ : L x))) (ξ : E) : + LowerSemicontinuous (fun x => projectionNorm (L x) ξ) := by + intro x r hr + by_cases hneg : r < 0 + · exact Filter.Eventually.of_forall fun y => hneg.trans_le (projectionNorm_bounds (L y) ξ).1 + have hr0 : 0 ≤ r := le_of_not_gt hneg + have hp : 0 < projectionNorm (L x) ξ := lt_of_le_of_lt hr0 hr + have hv : (L x).starProjection ξ ≠ 0 := norm_pos_iff.mp hp + have hqcont := normalizedCorrelation_continuousAt ξ hv + have hqvalue := normalizedCorrelation_starProjection (L x) ξ + obtain ⟨δ, hδ, hδprop⟩ := Metric.continuousAt_iff.mp hqcont + ((projectionNorm (L x) ξ - r) / 2) (by linarith) + obtain ⟨i, hi⟩ := (hd x).exists_dist_lt ((L x).orthogonalProjectionOnto ξ) hδ + have hidist : dist (b i x) ((L x).starProjection ξ) < δ := by + simpa only [Submodule.starProjection_apply, Subtype.dist_eq, dist_comm] using hi + have hiq : r < normalizedCorrelation ξ (b i x) := by + have ht := hδprop hidist + rw [hqvalue, Real.dist_eq] at ht + have hl := (abs_lt.mp ht).1 + linarith + have hbinz : b i x ≠ 0 := by + intro hz + simp [normalizedCorrelation, hz] at hiq + linarith + have hbq : ContinuousAt (fun y => normalizedCorrelation ξ (b i y)) x := + (normalizedCorrelation_continuousAt ξ hbinz).comp (hc i).continuousAt + have hevent : ∀ᶠ y in 𝓝 x, r < normalizedCorrelation ξ (b i y) := + hbq (Ioi_mem_nhds hiq) + exact hevent.mono fun y hy => + hy.trans_le (normalizedCorrelation_le_projectionNorm (L y) ξ (b i y) (hb i y)) + +/-- The generic Hilbert-space content of lem:projection-continuity, with +semicontinuity proved from dense continuous sections rather than assumed. -/ +theorem common_projectionNorm_continuity_of_denseSections + {X I : Type*} [TopologicalSpace X] [BaireSpace X] + [TopologicalSpace.SeparableSpace E] + (L : X → Submodule ℂ E) [∀ x, (L x).HasOrthogonalProjection] + (b : I → X → E) (hb : ∀ i x, b i x ∈ L x) (hc : ∀ i, Continuous (b i)) + (hd : ∀ x, DenseRange (fun i => (⟨b i x, hb i x⟩ : L x))) : + ∃ C : Set X, IsGδ C ∧ Dense C ∧ + ∀ x ∈ C, ∀ ξ, ContinuousAt (fun y => projectionNorm (L y) ξ) x := + common_projectionNorm_continuity L (projectionNorm_lowerSemicontinuous L b hb hc hd) + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/LaurentAlgebra.lean b/lean/OAI/Analysis/FactorGeneration/LaurentAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..c0ed230655ed4599e32838f1596bdc068a984f49 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/LaurentAlgebra.lean @@ -0,0 +1,247 @@ +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Algebra.Star.Unitary +import Mathlib.Analysis.Complex.Basic +import Mathlib.Analysis.Normed.Module.Basic +import Mathlib.Analysis.Normed.Operator.Bilinear +import Mathlib.Topology.Algebra.Module.Spaces.ContinuousLinearMap +import Mathlib.Topology.Algebra.StarSubalgebra +import OAI.Analysis.FactorGeneration.Words + +namespace OAI + +noncomputable section + +namespace Generator + +/-! The algebraic star algebra generated by one unitary is exactly the linear +span of all its integer powers. No topology on the ambient algebra is needed. -/ +section +variable {R A : Type*} [CommRing R] [StarRing R] + [Ring A] [StarRing A] [Algebra R A] [StarModule R A] + +def unitaryPowerMonoid (v : unitary A) : Submonoid A where + carrier := Set.range (fun n : ℤ => (↑(v^n) : A)) + one_mem' := ⟨0, by simp⟩ + mul_mem' := by + rintro a b ⟨n,rfl⟩ ⟨m,rfl⟩ + exact ⟨n+m,by simp [zpow_add]⟩ + +theorem unitary_power_mem_adjoin (v : unitary A) (n : ℤ) : + (↑(v^n) : A) ∈ StarAlgebra.adjoin R {(v : A)} := by + have hv := StarAlgebra.self_mem_adjoin_singleton R (v : A) + cases n with + | ofNat n => simpa using (StarAlgebra.adjoin R {(v : A)}).pow_mem hv n + | negSucc n => + have hs : star (v : A) ∈ StarAlgebra.adjoin R {(v : A)} := star_mem hv + have hp := (StarAlgebra.adjoin R {(v : A)}).pow_mem hs (n+1) + change (↑(v ^ (-(↑n + 1) : ℤ)) : A) ∈ _ + rw [zpow_neg, ← Int.natCast_add_one, zpow_natCast] + change star ((v : A)^(n+1)) ∈ _ + rw [star_pow] + exact hp + +theorem unitary_adjoin_eq_span (v : unitary A) : + (StarAlgebra.adjoin R {(v : A)}).toSubalgebra.toSubmodule = + Submodule.span R (Set.range (fun n : ℤ => (↑(v^n) : A))) := by + apply le_antisymm + · rw [StarAlgebra.adjoin_eq_span] + apply Submodule.span_mono + change Submonoid.closure _ ≤ unitaryPowerMonoid v + apply Submonoid.closure_le.mpr + intro x hx + rcases hx with hx | hx + · obtain rfl := Set.mem_singleton_iff.mp hx + exact ⟨1,by simp⟩ + · have hx' : x = star (v : A) := by + have he : star x = (v : A) := by simpa using hx + exact (star_star x).symm.trans (congrArg star he) + subst x + exact ⟨-1,by change (↑(v ^ (-1 : ℤ)) : A) = _; rw [zpow_neg_one]; rfl⟩ + · apply Submodule.span_le.mpr + rintro x ⟨n,rfl⟩ + exact unitary_power_mem_adjoin v n + +end + +/-! Centered Laurent polynomials and their norm closure. -/ +open scoped Topology +section Algebraic +variable {A : Type*} [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +def nonzeroUnitaryPowers (v : unitary A) : Set A := + {x | ∃ n : ℤ,n ≠ 0 ∧ x=(↑(v^n) : A)} + +def centerLinear (φ : A →ₗ[ℂ] ℂ) : A →ₗ[ℂ] A := + LinearMap.id - φ.smulRight (1 : A) + +omit [StarRing A] [StarModule ℂ A] in +@[simp] theorem centerLinear_apply (φ : A →ₗ[ℂ] ℂ) (x : A) : + centerLinear φ x = x-φ x • (1 : A) := rfl + +theorem center_adjoin_mem_span (v : unitary A) (φ : A →ₗ[ℂ] ℂ) + (h1 : φ 1=1) (hhaar : ∀ n : ℤ,n ≠ 0 → φ (↑(v^n) : A)=0) + (x : A) (hx : x ∈ StarAlgebra.adjoin ℂ {(v : A)}) : + centerLinear φ x ∈ Submodule.span ℂ (nonzeroUnitaryPowers v) := by + have hx' : x ∈ Submodule.span ℂ (Set.range (fun n : ℤ => (↑(v^n) : A))) := by + rw [← unitary_adjoin_eq_span]; exact hx + clear hx + induction hx' using Submodule.span_induction with + | mem x hx => + obtain ⟨n,rfl⟩ := hx + by_cases hn : n=0 + · simp [hn,h1] + · rw [centerLinear_apply,hhaar n hn,zero_smul,sub_zero] + exact Submodule.subset_span ⟨n,hn,rfl⟩ + | zero => simpa only [map_zero] using (Submodule.span ℂ (nonzeroUnitaryPowers v)).zero_mem + | add x y hx hy ihx ihy => + rw [map_add]; exact Submodule.add_mem _ ihx ihy + | smul r x hx ih => + rw [map_smul]; exact Submodule.smul_mem _ r ih + +end Algebraic +section +variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] + [StarRing A] [StarModule ℂ A] [ContinuousStar A] + +/-- Every centered element of the actual norm-closed generated star algebra +is a norm limit of linear combinations of nonzero powers. -/ +theorem centered_elemental_mem_closedSpan (v : unitary A) (φ : A →L[ℂ] ℂ) + (h1 : φ 1=1) (hhaar : ∀ n : ℤ,n ≠ 0 → φ (↑(v^n) : A)=0) + (x : A) (hx : x ∈ StarAlgebra.elemental ℂ (v : A)) (hcenter : φ x=0) : + x ∈ (Submodule.span ℂ (nonzeroUnitaryPowers v)).topologicalClosure := by + let S := (Submodule.span ℂ (nonzeroUnitaryPowers v)).topologicalClosure + let f : A →L[ℂ] A := ContinuousLinearMap.id ℂ A - φ.smulRight (1 : A) + have hc : IsClosed {y : A | f y ∈ S} := (Submodule.span ℂ (nonzeroUnitaryPowers v)).isClosed_topologicalClosure.preimage f.continuous + have hp : ∀ y ∈ StarAlgebra.adjoin ℂ {(v : A)},f y ∈ S := by + intro y hy + exact Submodule.le_topologicalClosure _ (center_adjoin_mem_span v φ.toLinearMap h1 hhaar y hy) + have hh : f x ∈ S := closure_minimal hp hc hx + change x-φ x • (1 : A) ∈ S at hh + simpa only [hcenter,zero_smul,sub_zero] using hh + +end + +/-! A continuous functional on a normed algebra extends zero product moments +separately to the closed linear span in each slot. -/ +open scoped Topology +section +variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] + +def sandwichFunctional (φ : A →L[ℂ] ℂ) (a b : A) : A →L[ℂ] ℂ where + toFun x := φ (a*x*b) + map_add' x y := by simp only [mul_add,add_mul,map_add] + map_smul' c x := by simp only [mul_smul_comm,smul_mul_assoc,map_smul,RingHom.id_apply] + cont := by fun_prop + +theorem functional_sandwich_closedSpan (φ : A →L[ℂ] ℂ) (S : Set A) (a b x : A) + (hx : x ∈ (Submodule.span ℂ S).topologicalClosure) + (hm : ∀ y ∈ S,φ (a*y*b)=0) : φ (a*x*b)=0 := by + let f := sandwichFunctional φ a b + have hs : Submodule.span ℂ S ≤ LinearMap.ker f.toLinearMap := by + apply Submodule.span_le.mpr + intro y hy + exact hm y hy + exact (Submodule.span ℂ S).topologicalClosure_minimal hs f.isClosed_ker hx + +theorem functional_product_closedSpan (φ : A →L[ℂ] ℂ) + (sets : List (Set A)) (xs : List A) (a : A) + (hxs : List.Forall₂ (fun S x => x ∈ (Submodule.span ℂ S).topologicalClosure) sets xs) + (hm : ∀ ys,List.Forall₂ (fun S y => y ∈ S) sets ys → φ (a*ys.prod)=0) : + φ (a*xs.prod)=0 := by + induction xs generalizing sets a with + | nil => cases hxs; exact hm [] .nil + | cons x xs ih => + cases hxs with + | @cons S x sets xs hx hxs => + have hh := functional_sandwich_closedSpan φ S a xs.prod x hx (by + intro y hy + apply ih sets (a*y) hxs + intro ys hys + simpa only [List.prod_cons,mul_assoc] using hm (y::ys) (.cons hy hys)) + simpa only [List.prod_cons,mul_assoc] using hh + +theorem alternatingFrom_closedSpan_slots (S T : Set A) (b : Bool) (xs : List A) + (hx : alternatingFrom ((Submodule.span ℂ S).topologicalClosure : Set A) + ((Submodule.span ℂ T).topologicalClosure : Set A) b xs) : + List.Forall₂ (fun s x => x ∈ (Submodule.span ℂ s).topologicalClosure) + (alternatingSlotSets S T b xs.length) xs := by + induction xs generalizing b with + | nil => exact .nil + | cons x xs ih => + cases b <;> exact .cons hx.1 (ih _ hx.2) + +theorem alternatingMomentsZero_closedSpan (φ : A →L[ℂ] ℂ) (S T : Set A) + (hm : alternatingMomentsZero φ S T) : + alternatingMomentsZero φ ((Submodule.span ℂ S).topologicalClosure : Set A) + ((Submodule.span ℂ T).topologicalClosure : Set A) := by + intro b xs hn hx + have hh := functional_product_closedSpan φ (alternatingSlotSets S T b xs.length) xs 1 + (alternatingFrom_closedSpan_slots S T b xs hx) (by + intro ys hys + have hl : ys.length=xs.length := by + rw [← hys.length_eq,alternatingSlotSets_length] + have hy : ys ≠ [] := by + intro he + have hz : xs.length=0 := by simpa [he] using hl.symm + exact hn (List.length_eq_zero_iff.mp hz) + have ha : alternatingFrom S T b ys := by + apply (alternatingFrom_slots S T b ys).mpr + simpa only [hl] using hys + simpa only [one_mul] using hm b ys hy ha) + simpa only [one_mul] using hh + +/-- Standard freeness: every nonempty alternating product of centered elements +vanishes, starting with either algebra and with no restriction on length parity. -/ +def freeSets (φ : A → ℂ) (S T : Set A) : Prop := + alternatingMomentsZero φ {x | x ∈ S ∧ φ x=0} {x | x ∈ T ∧ φ x=0} + +end + +/-! Norm completion of algebraic mixed moments gives full freeness of the +actual generated C*-algebra from the closed base algebra. -/ +variable {A : Type*} [NormedRing A] [NormedAlgebra ℂ A] + +/-- Centering commutes with norm approximation in a unital subalgebra. -/ +theorem centered_subalgebra_closure_mem (φ : A →L[ℂ] ℂ) (h1 : φ 1=1) + (D : Subalgebra ℂ A) (x : A) (hx : x ∈ D.topologicalClosure) (hcenter : φ x=0) : + x ∈ (Submodule.span ℂ {d | d ∈ D ∧ φ d=0}).topologicalClosure := by + let S := Submodule.span ℂ {d | d ∈ D ∧ φ d=0} + let f : A →L[ℂ] A := ContinuousLinearMap.id ℂ A - φ.smulRight (1 : A) + have hc : IsClosed {y : A | f y ∈ S.topologicalClosure} := + S.isClosed_topologicalClosure.preimage f.continuous + have hp : ∀ y ∈ D,f y ∈ S.topologicalClosure := by + intro y hy + apply Submodule.le_topologicalClosure + apply Submodule.subset_span + change y-φ y • (1 : A) ∈ D ∧ φ (y-φ y • (1 : A))=0 + refine ⟨D.sub_mem hy (D.smul_mem D.one_mem _),?_⟩ + simp only [map_sub,map_smul,h1,smul_eq_mul,mul_one,sub_self] + have hh : f x ∈ S.topologicalClosure := closure_minimal hp hc hx + change x-φ x • (1 : A) ∈ S.topologicalClosure at hh + simpa only [hcenter,zero_smul,sub_zero] using hh + +variable [StarRing A] [StarModule ℂ A] [ContinuousStar A] + +theorem unitary_generated_free_of_power_moments (φ : A →L[ℂ] ℂ) (h1 : φ 1=1) + (v : unitary A) (D : Subalgebra ℂ A) + (hhaar : ∀ n : ℤ,n ≠ 0 → φ (↑(v^n) : A)=0) + (hm : alternatingMomentsZero φ (nonzeroUnitaryPowers v) {d | d ∈ D ∧ φ d=0}) : + freeSets φ (StarAlgebra.elemental ℂ (v : A)) D.topologicalClosure := by + have hclosed := alternatingMomentsZero_closedSpan φ _ _ hm + intro b xs hn hx + apply hclosed b xs hn + clear hn + induction xs generalizing b with + | nil => trivial + | cons x xs ih => + cases b with + | true => + exact ⟨centered_elemental_mem_closedSpan v φ h1 hhaar x hx.1.1 hx.1.2,ih _ hx.2⟩ + | false => + exact ⟨centered_subalgebra_closure_mem φ h1 D x hx.1.1 hx.1.2,ih _ hx.2⟩ + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/LaurentMoments.lean b/lean/OAI/Analysis/FactorGeneration/LaurentMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..6535825911789c4af02f2f3861aa3cc6e68950e9 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/LaurentMoments.lean @@ -0,0 +1,439 @@ +import OAI.Analysis.FactorGeneration.HaarIndependence +import OAI.Analysis.FactorGeneration.Words + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Extend exact moments by separate trace continuity in the two-norm. No +joint continuity of quotient multiplication, or operator-norm structure on Q, +is assumed. -/ +section +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def traceClosedSpan (S : Set (Q τ ω)) : Submodule ℂ (Q τ ω) := + (Submodule.span ℂ S).topologicalClosure + +theorem sandwich_trace_inner (a z b : Q τ ω) : + quotientTrace τ ω (a*z*b)=inner ℂ (star (b*a)) z := by + rw [inner_eq_trace,star_star,quotientTrace_mul_comm τ ω (a*z),← mul_assoc] + +theorem sandwich_trace_closedSpan (S : Set (Q τ ω)) (a b z : Q τ ω) + (hz : z ∈ traceClosedSpan τ ω S) + (h : ∀ y ∈ S,quotientTrace τ ω (a*y*b)=0) : + quotientTrace τ ω (a*z*b)=0 := by + let f : Q τ ω →L[ℂ] ℂ := innerSL ℂ (star (b*a)) + have hs : Submodule.span ℂ S ≤ LinearMap.ker f.toLinearMap := by + apply Submodule.span_le.mpr + intro y hy + change inner ℂ (star (b*a)) y=0 + rw [← sandwich_trace_inner] + exact h y hy + have hc := (Submodule.span ℂ S).topologicalClosure_minimal hs f.isClosed_ker + have hh := hc hz + change inner ℂ (star (b*a)) z=0 at hh + rwa [← sandwich_trace_inner] at hh + +/-! Extend exact moments by separate trace continuity in the two-norm. No +joint continuity of quotient multiplication, or operator-norm structure on Q, +is assumed. -/ + +def integerValueWord (v : unitary (Q τ ω)) (n : ℤ) : List (Q τ ω × ℤ) → Q τ ω → Q τ ω + | [],b => (↑(v^n) : Q τ ω)*b + | (d,m)::xs,b => (↑(v^n) : Q τ ω)*d*integerValueWord v m xs b + +theorem integerValueWord_indexed (v : unitary (Q τ ω)) (x : ℕ → Q τ ω) + (n : ℤ) (xs : List (ℕ × ℤ)) (b : Q τ ω) : + integerValueWord τ ω v n (xs.map (fun z => (x z.1,z.2))) b=integerWord v x n xs b := by + induction xs generalizing n with + | nil => rfl + | cons a xs ih => simp only [List.map_cons,integerValueWord,integerWord,ih] + +/-- All internal coefficients are extended one at a time, with the other +factors fixed. Uniform bounds on simultaneous approximants are unnecessary. -/ +theorem integerValueWord_closedSpan (v : unitary (Q τ ω)) (x : ℕ → Q τ ω) + (a b : Q τ ω) (n : ℤ) (xs : List (Q τ ω × ℤ)) + (hxs : ∀ z ∈ xs,z.1 ∈ traceClosedSpan τ ω (Set.range x)) + (hm : ∀ is : List ℕ,is.length=xs.length → + quotientTrace τ ω (a*integerWord v x n (is.zip (xs.map Prod.snd)) b)=0) : + quotientTrace τ ω (a*integerValueWord τ ω v n xs b)=0 := by + induction xs generalizing a n with + | nil => exact hm [] rfl + | cons z xs ih => + have hi (i : ℕ) : quotientTrace τ ω + ((a*(↑(v^n) : Q τ ω)*x i)*integerValueWord τ ω v z.2 xs b)=0 := by + apply ih (a*(↑(v^n) : Q τ ω)*x i) z.2 + · exact fun y hy => hxs y (by simp [hy]) + · intro is his + have hh := hm (i::is) (by simp [his]) + simpa only [List.map_cons,List.zip_cons_cons,integerWord,mul_assoc] using hh + have hh := sandwich_trace_closedSpan τ ω (Set.range x) (a*(↑(v^n) : Q τ ω)) + (integerValueWord τ ω v z.2 xs b) z.1 (hxs z (by simp)) (by + rintro _ ⟨i,rfl⟩ + exact hi i) + simpa only [integerValueWord,mul_assoc] using hh + +/-- The optional endpoints span the unit and the given centered family. -/ +theorem optionalCoefficient_range (x : ℕ → Q τ ω) : + Set.range (optionalCoefficient x)=insert 1 (Set.range x) := by + ext z + constructor + · rintro ⟨i,rfl⟩ + cases i <;> simp [optionalCoefficient] + · intro h + rcases Set.mem_insert_iff.mp h with rfl | ⟨i,rfl⟩ + · exact ⟨none,rfl⟩ + · exact ⟨some i,rfl⟩ + +theorem integerWord_right_factor {A : Type*} [Monoid A] [StarMul A] + (v : unitary A) (x : ℕ → A) (n : ℤ) (xs : List (ℕ × ℤ)) (b : A) : + integerWord v x n xs b=integerWord v x n xs 1*b := by + induction xs generalizing n with + | nil => simp only [integerWord,mul_one] + | cons z xs ih => + simp only [integerWord] + rw [ih z.2] + simp only [mul_assoc] + +theorem integerWord_closed_endpoints (v : unitary (Q τ ω)) (x : ℕ → Q τ ω) + (hm : ReducedOrderedMoments τ ω (v : Q τ ω) x) + (a b : Q τ ω) + (ha : a ∈ traceClosedSpan τ ω (insert 1 (Set.range x))) + (hb : b ∈ traceClosedSpan τ ω (insert 1 (Set.range x))) + (n : ℤ) (hn : n ≠ 0) (xs : List (ℕ × ℤ)) (hxs : ∀ z ∈ xs,z.2 ≠ 0) : + quotientTrace τ ω (a*integerWord v x n xs b)=0 := by + have hright (i : Option ℕ) : + quotientTrace τ ω (optionalCoefficient x i*integerWord v x n xs b)=0 := by + have htail := integerWord_right_factor v x n xs + rw [htail,← mul_assoc] + have hh := sandwich_trace_closedSpan τ ω (insert 1 (Set.range x)) + (optionalCoefficient x i*integerWord v x n xs 1) 1 b hb (by + intro y hy + rw [← optionalCoefficient_range] at hy + obtain ⟨j,rfl⟩ := hy + have hj := reducedOrderedMoments_integerWord τ ω v x hm i j n hn xs hxs + rw [htail (optionalCoefficient x j)] at hj + simpa only [mul_one,mul_assoc] using hj) + simpa only [mul_one] using hh + have hh := sandwich_trace_closedSpan τ ω (insert 1 (Set.range x)) 1 + (integerWord v x n xs b) a ha (by + intro y hy + rw [← optionalCoefficient_range] at hy + obtain ⟨i,rfl⟩ := hy + simpa only [one_mul] using hright i) + simpa only [one_mul] using hh + +theorem reduced_integer_moment_closedSpan (v : unitary (Q τ ω)) (x : ℕ → Q τ ω) + (hm : ReducedOrderedMoments τ ω (v : Q τ ω) x) + (a b : Q τ ω) + (ha : a ∈ traceClosedSpan τ ω (insert 1 (Set.range x))) + (hb : b ∈ traceClosedSpan τ ω (insert 1 (Set.range x))) + (n : ℤ) (hn : n ≠ 0) (xs : List (Q τ ω × ℤ)) + (hxs : ∀ z ∈ xs,z.1 ∈ traceClosedSpan τ ω (Set.range x) ∧ z.2 ≠ 0) : + quotientTrace τ ω (a*integerValueWord τ ω v n xs b)=0 := by + apply integerValueWord_closedSpan τ ω v x a b n xs (fun z hz => (hxs z hz).1) + intro is his + apply integerWord_closed_endpoints τ ω v x hm a b ha hb n hn + intro z hz + have hz' := List.of_mem_zip hz + obtain ⟨d,hd,he⟩ := List.mem_map.mp hz'.2 + exact he ▸ (hxs d hd).2 + +end + +/-! Construct an included Haar unitary and the full nonzero-integer endpoint +formula over any two-norm-separable unital subalgebra of the actual quotient. -/ +section +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem exists_centered_dense_quotient_family (D : Subalgebra ℂ (Q τ ω)) + (hD : TopologicalSpace.IsSeparable (D : Set (Q τ ω))) : + ∃ x : ℕ → Q τ ω,(∀ i,x i ∈ D ∧ quotientTrace τ ω (x i)=0) ∧ + ∀ d ∈ D,quotientTrace τ ω d=0 → d ∈ closure (Set.range x) := by + let S : Set (Q τ ω) := {d | d ∈ D ∧ quotientTrace τ ω d=0} + have hS : TopologicalSpace.IsSeparable S := hD.mono (fun _ h => h.1) + let : TopologicalSpace.SeparableSpace S := hS.separableSpace + let : Nonempty S := ⟨⟨0,D.zero_mem,(traceLinear τ ω).map_zero⟩⟩ + obtain ⟨v,hv⟩ := TopologicalSpace.exists_dense_seq (α := S) + refine ⟨fun i => (v i).val,fun i => (v i).property,?_⟩ + intro d hd ht + have hh := mem_closure_image continuous_subtype_val.continuousAt (hv (⟨d,hd,ht⟩ : S)) + simpa only [← Set.range_comp,Function.comp_def] using hh + +theorem subalgebra_mem_centered_closedSpan (D : Subalgebra ℂ (Q τ ω)) + (x : ℕ → Q τ ω) + (hx : ∀ d ∈ D,quotientTrace τ ω d=0 → d ∈ closure (Set.range x)) + (d : Q τ ω) (hd : d ∈ D) : d ∈ traceClosedSpan τ ω (insert 1 (Set.range x)) := by + let z := d-quotientTrace τ ω d • (1 : Q τ ω) + have hzD : z ∈ D := D.sub_mem hd (D.smul_mem D.one_mem _) + have hzt : quotientTrace τ ω z=0 := by + change (traceLinear τ ω) (d-quotientTrace τ ω d • (1 : Q τ ω))=0 + rw [map_sub,map_smul] + change quotientTrace τ ω d-quotientTrace τ ω d*quotientTrace τ ω 1=0 + rw [quotientTrace_one,mul_one,sub_self] + have hz : z ∈ traceClosedSpan τ ω (insert 1 (Set.range x)) := by + apply Submodule.closure_subset_topologicalClosure_span + exact closure_mono (Set.subset_insert _ _) (hx z hzD hzt) + have h1 : (1 : Q τ ω) ∈ traceClosedSpan τ ω (insert 1 (Set.range x)) := + Submodule.le_topologicalClosure _ (Submodule.subset_span (Set.mem_insert _ _)) + have hh := (traceClosedSpan τ ω (insert 1 (Set.range x))).add_mem hz + ((traceClosedSpan τ ω (insert 1 (Set.range x))).smul_mem (quotientTrace τ ω d) h1) + simpa only [z,sub_add_cancel] using hh + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +private theorem included_haar_endpoint_moments_of_dense_family (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (x : ℕ → Q τ ω) + (hx : ∀ i,x i ∈ D ∧ quotientTrace τ ω (x i)=0) + (hdense : ∀ d ∈ D,quotientTrace τ ω d=0 → d ∈ closure (Set.range x)) : + ∃ t : unitary (Q τ ω), + (∃ q : TracialQuotient (restrictedTrace τ hNM) (ω : Filter ℕ), + quotientInclusion τ hNM (ω : Filter ℕ) q=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + ∀ a ∈ D,∀ b ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (a*integerValueWord τ ω t n xs b)=0 := by + obtain ⟨t,ht⟩ := exists_included_reduced_unitary τ hNM hfactor hdiff hirr hsep ω hω + x (fun i => (hx i).2) + refine ⟨t,ht.1,reducedOrderedMoments_haar τ ω t x ht.2,?_⟩ + intro a ha b hb n hn xs hxs + apply reduced_integer_moment_closedSpan τ ω t x ht.2 a b + (subalgebra_mem_centered_closedSpan τ ω D x hdense a ha) + (subalgebra_mem_centered_closedSpan τ ω D x hdense b hb) n hn xs + intro z hz + refine ⟨?_,(hxs z hz).2.2⟩ + exact Submodule.closure_subset_topologicalClosure_span _ (hdense z.1 (hxs z hz).1 (hxs z hz).2.1) + +theorem exists_included_haar_endpoint_moments (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (hD : TopologicalSpace.IsSeparable (D : Set (Q τ ω))) : + ∃ t : unitary (Q τ ω), + (∃ q : TracialQuotient (restrictedTrace τ hNM) (ω : Filter ℕ), + quotientInclusion τ hNM (ω : Filter ℕ) q=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + ∀ a ∈ D,∀ b ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (a*integerValueWord τ ω t n xs b)=0 := by + obtain ⟨x,hx⟩ := exists_centered_dense_quotient_family τ ω D hD + exact included_haar_endpoint_moments_of_dense_family τ ω hNM hfactor hdiff hirr hsep + hω D x hx.1 hx.2 + +end + +/-! Extend a trace identity in each factor to the closed linear span of its +allowed values. This uses separate continuity only. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem trace_product_closedSpan (sets : List (Set (Q τ ω))) (xs : List (Q τ ω)) + (a : Q τ ω) + (hxs : List.Forall₂ (fun S x => x ∈ traceClosedSpan τ ω S) sets xs) + (hm : ∀ ys,List.Forall₂ (fun S y => y ∈ S) sets ys → + quotientTrace τ ω (a*ys.prod)=0) : + quotientTrace τ ω (a*xs.prod)=0 := by + induction xs generalizing sets a with + | nil => + cases hxs + exact hm [] .nil + | cons x xs ih => + cases hxs with + | @cons S x sets xs hx hxs => + have hh := sandwich_trace_closedSpan τ ω S a xs.prod x hx (by + intro y hy + apply ih sets (a*y) hxs + intro ys hys + have hz := hm (y::ys) (.cons hy hys) + simpa only [List.prod_cons,mul_assoc] using hz) + simpa only [List.prod_cons,mul_assoc] using hh + +/-! Exact mixed moments for the closed linear span of the nonzero Haar powers. +This does not identify that span with the centered part of a generated C*-algebra. -/ + +def nonzeroPowerSet (v : unitary (Q τ ω)) : Set (Q τ ω) := + {q | ∃ n : ℤ,n ≠ 0 ∧ q=(↑(v^n) : Q τ ω)} + +def alternatingFactors (q : Q τ ω) : List (Q τ ω × Q τ ω) → Q τ ω → List (Q τ ω) + | [],b => [q,b] + | (d,p)::xs,b => q::d::alternatingFactors p xs b + +def alternatingPowerSets (P : Set (Q τ ω)) : List (Q τ ω × Q τ ω) → Q τ ω → List (Set (Q τ ω)) + | [],b => [P,{b}] + | (d,_)::xs,b => P::{d}::alternatingPowerSets P xs b + +theorem alternatingFactors_closedSpan (P : Set (Q τ ω)) (q b : Q τ ω) + (xs : List (Q τ ω × Q τ ω)) (hq : q ∈ traceClosedSpan τ ω P) + (hxs : ∀ z ∈ xs,z.2 ∈ traceClosedSpan τ ω P) : + List.Forall₂ (fun S x => x ∈ traceClosedSpan τ ω S) + (alternatingPowerSets τ ω P xs b) (alternatingFactors τ ω q xs b) := by + have hsingle (z : Q τ ω) : z ∈ traceClosedSpan τ ω {z} := + Submodule.le_topologicalClosure _ (Submodule.subset_span (Set.mem_singleton z)) + induction xs generalizing q with + | nil => exact .cons hq (.cons (hsingle b) .nil) + | cons z xs ih => + exact .cons hq (.cons (hsingle z.1) + (ih z.2 (hxs z (by simp)) (fun y hy => hxs y (by simp [hy])))) + +theorem alternatingPowerSets_integerWord (D : Subalgebra ℂ (Q τ ω)) + (v : unitary (Q τ ω)) (xs : List (Q τ ω × Q τ ω)) + (hxs : ∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0) + (b : Q τ ω) (ys : List (Q τ ω)) + (hys : List.Forall₂ (fun S y => y ∈ S) + (alternatingPowerSets τ ω (nonzeroPowerSet τ ω v) xs b) ys) : + ∃ n : ℤ,n ≠ 0 ∧ ∃ zs : List (Q τ ω × ℤ), + (∀ z ∈ zs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) ∧ + ys.prod=integerValueWord τ ω v n zs b := by + induction xs generalizing ys with + | nil => + cases hys with + | cons hp ht => + cases ht with + | cons hb ht => + cases ht + obtain ⟨n,hn,rfl⟩ := hp + obtain rfl := Set.mem_singleton_iff.mp hb + exact ⟨n,hn,[],by simp,by simp [integerValueWord]⟩ + | cons z xs ih => + cases hys with + | cons hp ht => + cases ht with + | cons hd ht => + obtain ⟨n,hn,rfl⟩ := hp + obtain rfl := Set.mem_singleton_iff.mp hd + obtain ⟨m,hm,zs,hzs,he⟩ := ih (fun y hy => hxs y (by simp [hy])) _ ht + refine ⟨n,hn,(z.1,m)::zs,?_,?_⟩ + · intro y hy + rcases List.mem_cons.mp hy with rfl | hy + · exact ⟨(hxs z (by simp)).1,(hxs z (by simp)).2,hm⟩ + · exact hzs y hy + · simp only [List.prod_cons,he,integerValueWord,mul_assoc] + +/-- Extends the actual nonzero-exponent formula to arbitrary closed-span +combinations in every Haar slot, while retaining arbitrary endpoints in D. -/ +theorem endpoint_moments_laurent_closure (D : Subalgebra ℂ (Q τ ω)) + (v : unitary (Q τ ω)) + (hm : ∀ a ∈ D,∀ b ∈ D,∀ n : ℤ,n ≠ 0 → ∀ xs : List (Q τ ω × ℤ), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ≠ 0) → + quotientTrace τ ω (a*integerValueWord τ ω v n xs b)=0) + (a b q : Q τ ω) (ha : a ∈ D) (hb : b ∈ D) + (hq : q ∈ traceClosedSpan τ ω (nonzeroPowerSet τ ω v)) + (xs : List (Q τ ω × Q τ ω)) + (hxs : ∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ + z.2 ∈ traceClosedSpan τ ω (nonzeroPowerSet τ ω v)) : + quotientTrace τ ω (a*(alternatingFactors τ ω q xs b).prod)=0 := by + apply trace_product_closedSpan τ ω (alternatingPowerSets τ ω (nonzeroPowerSet τ ω v) xs b) + _ a (alternatingFactors_closedSpan τ ω _ q b xs hq (fun z hz => (hxs z hz).2.2)) + intro ys hys + obtain ⟨n,hn,zs,hzs,he⟩ := alternatingPowerSets_integerWord τ ω D v xs + (fun z hz => ⟨(hxs z hz).1,(hxs z hz).2.1⟩) b ys hys + rw [he] + exact hm a ha b hb n hn zs hzs + +end + +/-! Construct an included Haar unitary and the full nonzero-integer endpoint +formula over any two-norm-separable unital subalgebra of the actual quotient. -/ +section +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_included_haar_laurent_moments (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (hD : TopologicalSpace.IsSeparable (D : Set (Q τ ω))) : + ∃ t : unitary (Q τ ω), + (∃ q : TracialQuotient (restrictedTrace τ hNM) (ω : Filter ℕ), + quotientInclusion τ hNM (ω : Filter ℕ) q=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + ∀ a ∈ D,∀ b ∈ D,∀ q ∈ traceClosedSpan τ ω (nonzeroPowerSet τ ω t), + ∀ xs : List (Q τ ω × Q τ ω), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ + z.2 ∈ traceClosedSpan τ ω (nonzeroPowerSet τ ω t)) → + quotientTrace τ ω (a*(alternatingFactors τ ω q xs b).prod)=0 := by + obtain ⟨t,ht,hhaar,hm⟩ := exists_included_haar_endpoint_moments τ ω hNM hfactor hdiff hirr hsep hω D hD + refine ⟨t,ht,hhaar,?_⟩ + intro a ha b hb q hq xs hxs + exact endpoint_moments_laurent_closure τ ω D t hm a b q ha hb hq xs hxs + +end + +/-! From the endpoint formula to every alternating word shape. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem alternating_tail_normal_form (P : Set (Q τ ω)) (D : Subalgebra ℂ (Q τ ω)) + (tail : List (Q τ ω)) (q : Q τ ω) + (ht : alternatingFrom P {d | d ∈ D ∧ quotientTrace τ ω d=0} false tail) : + ∃ xs : List (Q τ ω × Q τ ω), ∃ b ∈ D, + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ∈ P) ∧ + (q::tail).prod=(alternatingFactors τ ω q xs b).prod := by + induction tail using List.twoStepInduction generalizing q with + | nil => exact ⟨[],1,D.one_mem,by simp,by simp [alternatingFactors]⟩ + | singleton d => exact ⟨[],d,ht.1.1,by simp,rfl⟩ + | cons_cons d p tail ih _ => + obtain ⟨xs,b,hb,hxs,he⟩ := ih p ht.2.2 + refine ⟨(d,p)::xs,b,hb,?_,?_⟩ + · intro z hz + rcases List.mem_cons.mp hz with rfl | hz + · exact ⟨ht.1.1,ht.1.2,ht.2.1⟩ + · exact hxs z hz + · change q*(d*(p::tail).prod)=q*(d*(alternatingFactors τ ω p xs b).prod) + rw [he] + +theorem endpoint_all_alternating (P : Set (Q τ ω)) (D : Subalgebra ℂ (Q τ ω)) + (hm : ∀ a ∈ D,∀ b ∈ D,∀ q ∈ P,∀ xs : List (Q τ ω × Q τ ω), + (∀ z ∈ xs,z.1 ∈ D ∧ quotientTrace τ ω z.1=0 ∧ z.2 ∈ P) → + quotientTrace τ ω (a*(alternatingFactors τ ω q xs b).prod)=0) : + alternatingMomentsZero (quotientTrace τ ω) P {d | d ∈ D ∧ quotientTrace τ ω d=0} := by + intro start word hn hw + cases word with + | nil => exact False.elim (hn rfl) + | cons x tail => + cases start with + | true => + obtain ⟨xs,b,hb,hxs,he⟩ := alternating_tail_normal_form τ ω P D tail x hw.2 + rw [he] + simpa only [one_mul] using hm 1 D.one_mem b hb x hw.1 xs hxs + | false => + cases tail with + | nil => simpa only [List.prod_cons,List.prod_nil,mul_one] using hw.1.2 + | cons q tail => + obtain ⟨xs,b,hb,hxs,he⟩ := alternating_tail_normal_form τ ω P D tail q hw.2.2 + change quotientTrace τ ω (x*(q::tail).prod)=0 + rw [he] + exact hm x hw.1.1 b hb q hw.2.1 xs hxs + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/LocalPatches.lean b/lean/OAI/Analysis/FactorGeneration/LocalPatches.lean new file mode 100644 index 0000000000000000000000000000000000000000..c9f316f3d2c7dd977aa5571d41e2c91113621d8c --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/LocalPatches.lean @@ -0,0 +1,428 @@ +import OAI.Analysis.FactorGeneration.PatchingBounds +import OAI.Analysis.FactorGeneration.RepresentedCorners +import OAI.Analysis.FactorGeneration.ResidualEstimates + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Construct local patches in the actual f=1 residual. Both residual trace +terms are retained. Admissibility of the full extended word family is not asserted. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +theorem unitResidual_scalar_two_moment_bound (v : PartialUnitary M) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) + (x : M.toStarSubalgebra) (A B : ℝ) (hAB : 0 ≤ A+B) + (hA : ‖τ.trace x‖ ≤ A*(τ.trace v.support.val).re) + (hB : ‖τ.trace (star v.val*x*v.val)‖ ≤ B*(τ.trace v.support.val).re) : + ‖cornerScalar τ (unitResidual v) x‖ ≤ (A+B)/3 := by + have htrace : τ.trace ((unitResidual v).val*x*(unitResidual v).val)= + τ.trace x-τ.trace (star v.val*x*v.val) := by + simpa only [residualCorner,unitResidual,identityProjection,one_mul] using + residualCorner_compression_trace τ (identityProjection M) v (one_mul _) x + rw [cornerScalar,htrace,norm_div,projection_trace_real τ (unitResidual v), + Complex.norm_real,Real.norm_of_nonneg (unitResidual_positive τ v hsmall).le] + rw [div_le_iff₀ (unitResidual_positive τ v hsmall)] + have hn := norm_sub_le (τ.trace x) (τ.trace (star v.val*x*v.val)) + rw [unitResidual_trace,Complex.sub_re,Complex.one_re] + nlinarith [mul_le_mul_of_nonneg_left hsmall hAB] + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_unitResidual_local_compression + (v : PartialUnitary M) (hvN : v.val.val ∈ N) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) (A B : ι → ℝ) + (hAB : ∀ i ∈ F,0 ≤ A i+B i) + (hA : ∀ i ∈ F,‖τ.trace (x i)‖ ≤ A i*(τ.trace v.support.val).re) + (hB : ∀ i ∈ F,‖τ.trace (star v.val*x i*v.val)‖ ≤ B i*(τ.trace v.support.val).re) + (η : ℝ) (hη : 0 < η) : + ∃ q : AlgebraProjection M,q ≤ unitResidual v ∧ q.val ≠ 0 ∧ q.val.val ∈ N ∧ + ∀ i ∈ F,τ.norm₂ (q.val*x i*q.val) < (η+(A i+B i)/3)*τ.norm₂ q.val ∧ + norm₁ τ (q.val*x i*q.val) < (η+(A i+B i)/3)*(τ.trace q.val).re := by + have hp : (unitResidual v).val ≠ 0 := by + intro h + have hh := unitResidual_positive τ v hsmall + rw [h,show τ.trace 0=0 from inner_zero_right _,Complex.zero_re] at hh + exact (lt_irrefl _ hh) + have hpN : (unitResidual v).val.val ∈ N := by + have hvp : v.support.val.val ∈ N := by + rw [← v.unitary.initial] + exact N.mul_mem (N.toStarSubalgebra.star_mem' hvN) hvN + exact N.sub_mem N.one_mem hvp + obtain ⟨q,hqp,hq,hqN,hlocal⟩ := exists_irreducible_corner_local_piece τ hNM hfactor hdiff hirr hsep + (unitResidual v) hp hpN F x η hη + refine ⟨q,hqp,hq,hqN,fun i hi => ?_⟩ + have hs := unitResidual_scalar_two_moment_bound τ v hsmall (x i) (A i) (B i) + (hAB i hi) (hA i hi) (hB i hi) + have hn : τ.norm₂ (q.val*x i*q.val) < (η+(A i+B i)/3)*τ.norm₂ q.val := by + have ht := τ.norm₂_add_le (q.val*x i*q.val-cornerScalar τ (unitResidual v) (x i) • q.val) + (cornerScalar τ (unitResidual v) (x i) • q.val) + rw [sub_add_cancel,τ.norm₂_smul] at ht + have hmul := mul_le_mul_of_nonneg_right hs (show 0 ≤ τ.norm₂ q.val from norm_nonneg _) + have hh := (hlocal i hi).1 + nlinarith only [ht,hmul,hh] + exact ⟨hn,compression_norm₁_lt_of_norm₂ τ q hq (x i) _ hn⟩ + +/-- Choose the patch unitary after q, so the same q controls all two-letter +terms and the signed one-letter traces are as small as prescribed. -/ +theorem exists_unitResidual_controlled_patch + (v : PartialUnitary M) (hvN : v.val.val ∈ N) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) (A B : ι → ℝ) + (hAB : ∀ i ∈ F,0 ≤ A i+B i) + (hA : ∀ i ∈ F,‖τ.trace (x i)‖ ≤ A i*(τ.trace v.support.val).re) + (hB : ∀ i ∈ F,‖τ.trace (star v.val*x i*v.val)‖ ≤ B i*(τ.trace v.support.val).re) + (L R : Finset M.toStarSubalgebra) (η κ : ℝ) (hη : 0 < η) (hκ : 0 < κ) : + ∃ (q : AlgebraProjection M) (w : CornerUnitary q), + q ≤ unitResidual v ∧ q.val ≠ 0 ∧ q.val.val ∈ N ∧ w.val.val ∈ N ∧ + (∀ a ∈ L,∀ b ∈ R,∀ s : Bool,‖τ.trace (a*signedLetter w.val s*b)‖ < κ*(τ.trace q.val).re) ∧ + (∀ i ∈ F,∀ u z : CornerUnitary q,∀ a b : M.toStarSubalgebra,‖a‖ ≤ 1 → ‖b‖ ≤ 1 → + ‖τ.trace (a*u.val*x i*z.val*b)‖ < (η+(A i+B i)/3)*(τ.trace q.val).re) := by + obtain ⟨q,hqp,hq,hqN,hlocal⟩ := exists_unitResidual_local_compression τ hNM hfactor hdiff hirr hsep + v hvN hsmall F x A B hAB hA hB η hη + let qN := projectionInSubalgebra q hqN + have hqN0 : qN.val ≠ 0 := by + intro hz + exact hq (Subtype.ext (congrArg (fun a : N.toStarSubalgebra => a.val) hz)) + obtain ⟨w,hw⟩ := exists_cornerUnitary_small_signed_traces τ hNM hdiff qN hqN0 L R + (κ*(τ.trace q.val).re) (mul_pos hκ (projection_trace_pos τ q.val q.property hq)) + let wM : CornerUnitary q := { + val := coordinateInclusion hNM w.val + initial := by + rw [← map_star,← map_mul,w.initial] + rfl + final := by + rw [← map_star,← map_mul,w.final] + rfl } + refine ⟨q,wM,hqp,hq,hqN,w.val.property,hw,fun i hi u z a b ha hb => ?_⟩ + have hh := (hlocal i hi).1 + calc _ ≤ τ.norm₂ (q.val*x i*q.val)*τ.norm₂ q.val := two_patch_trace_le τ q u z a (x i) b ha hb + _ < ((η+(A i+B i)/3)*τ.norm₂ q.val)*τ.norm₂ q.val := + mul_lt_mul_of_pos_right hh (corner_norm₂_pos τ q hq) + _ = _ := by rw [projection_trace_sq τ q.val q.property]; ring + +end + +/-! A single actual residual patch controls every finite internal word of the +source family. All scalar moment premises are proved from admissibility. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_admissible_family_patch + (F : Finset M.toStarSubalgebra) (hcenter : ∀ x ∈ F,τ.trace x=0) + (n : ℕ) (δ : ℝ) (hδ : 0 < δ) + (v : PartialUnitary M) + (hv : PatchingAdmissibleIn (P := N) τ (identityProjection M) F n (patchingTolerance δ) v) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) + (κ : ℝ) (hκ : 0 < κ) : + ∃ (q : AlgebraProjection M) (w : CornerUnitary q), + q ≤ unitResidual v ∧ q.val ≠ 0 ∧ q.val.val ∈ N ∧ w.val.val ∈ N ∧ + (∀ a ∈ outerWordFamily v.val F n,∀ b ∈ outerWordFamily v.val F n,∀ s : Bool, + ‖τ.trace (a*signedLetter w.val s*b)‖ < κ*(τ.trace q.val).re) ∧ + (∀ x ∈ F,∀ xs : List (Bool × M.toStarSubalgebra), + xs.length+2 ≤ n → (∀ a ∈ xs,a.2 ∈ F) → + ∀ u z : CornerUnitary q,∀ a b : M.toStarSubalgebra,‖a‖ ≤ 1 → ‖b‖ ≤ 1 → + ‖τ.trace (a*u.val*(x*patchingWord v.val xs)*z.val*b)‖ < + (2*patchingTolerance δ (xs.length+2)/3)*(τ.trace q.val).re) := by + let X := middleWordFamily F n + let mid := fun i : M.toStarSubalgebra × List (Bool × M.toStarSubalgebra) => + i.1*patchingWord v.val i.2 + let A := fun i : M.toStarSubalgebra × List (Bool × M.toStarSubalgebra) => + middleMomentError (patchingTolerance δ) i.2.length + let B := fun i : M.toStarSubalgebra × List (Bool × M.toStarSubalgebra) => + patchingTolerance δ (i.2.length+2) + have hm := middleWordFamily_moments τ v (identityProjection M) F n + (patchingTolerance δ) hv.1 hcenter + obtain ⟨q,w,hqp,hq,hqN,hwN,hfirst,hsecond⟩ := exists_unitResidual_controlled_patch τ hNM + hfactor hdiff hirr hsep v hv.2 hsmall X mid A B + (fun i _ => add_nonneg + (middleMomentError_nonneg _ (fun k => (patchingTolerance_pos δ hδ k).le) _) + (patchingTolerance_pos δ hδ _).le) + (fun i hi => (hm i hi).1) (fun i hi => (hm i hi).2) + (outerWordFamily v.val F n) (outerWordFamily v.val F n) + (δ/3) κ (by positivity) hκ + refine ⟨q,w,hqp,hq,hqN,hwN,hfirst,?_⟩ + intro x hx xs hlen hxs u z a b ha hb + have hi : (x,xs) ∈ X := (mem_middleWordFamily F n x xs).mpr ⟨hx,hlen,hxs⟩ + have hh := hsecond (x,xs) hi u z a b ha hb + exact hh.trans_le (mul_le_mul_of_nonneg_right (patchingTolerance_middle_budget δ hδ xs.length) + (projection_trace_pos τ q.val q.property hq).le) + +end + +/-! Trace estimates for each actual binary-mask term, using the constructed +finite families. No moment estimate or middle-family extraction is assumed. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def signedCornerUnitary {q : AlgebraProjection M} (w : CornerUnitary q) (s : Bool) : + CornerUnitary q := if s then w.adjoint else w + +@[simp] theorem signedCornerUnitary_val {q : AlgebraProjection M} (w : CornerUnitary q) (s : Bool) : + (signedCornerUnitary w s).val=signedLetter w.val s := by cases s <;> rfl + +theorem maskedWord_one_decomposition + (xs : List (Bool × M.toStarSubalgebra)) (bs : List Bool) + (hlen : bs.length=xs.length) (hcount : bs.count true=1) : + ∃ pre a post,xs=pre++a::post ∧ + bs=List.replicate pre.length false++true::List.replicate post.length false := by + obtain ⟨i,cs,hbs⟩ := exists_first_true bs (by omega) + have hc : cs.count true=0 := by simpa [hbs,List.count_replicate] using hcount + have hcs := (count_true_zero_iff cs).mp hc + have hl : i+1+cs.length=xs.length := by + rw [hbs] at hlen + simp only [List.length_append,List.length_replicate,List.length_cons] at hlen + omega + obtain ⟨pre,a,post,hxs,hp⟩ := exists_list_split xs i (by omega) + have ht : cs.length=post.length := by rw [hxs,List.length_append,List.length_cons,hp] at hl; omega + refine ⟨pre,a,post,hxs,?_⟩ + simpa only [hp,ht] using (hbs.trans (congrArg (fun ds => List.replicate i false++true::ds) hcs)) + +theorem maskedWord_one_trace_lt (v : PartialUnitary M) {q : AlgebraProjection M} + (w : CornerUnitary q) (F : Finset M.toStarSubalgebra) (n : ℕ) (κ : ℝ) + (hfirst : ∀ a ∈ outerWordFamily v.val F n,∀ b ∈ outerWordFamily v.val F n,∀ s : Bool, + ‖τ.trace (a*signedLetter w.val s*b)‖ < κ*(τ.trace q.val).re) + (x₀ : M.toStarSubalgebra) (hx₀ : x₀ ∈ (F : Set M.toStarSubalgebra) ∪ {1}) + (xs : List (Bool × M.toStarSubalgebra)) (hn : xs.length ≤ n) + (hc : patchingCoefficients (F : Set M.toStarSubalgebra) xs) + (bs : List Bool) (hlen : bs.length=xs.length) (hcount : bs.count true=1) : + ‖τ.trace (x₀*maskedWord v.val w.val xs bs)‖ < κ*(τ.trace q.val).re := by + obtain ⟨pre,a,post,hxs,hbs⟩ := maskedWord_one_decomposition xs bs hlen hcount + have hall := patchingCoefficients_mem (F : Set M.toStarSubalgebra) xs hc + have hpre : ∀ c ∈ pre,c.2 ∈ (F : Set M.toStarSubalgebra) ∪ {1} := by + intro c hc; apply hall c; simp [hxs,hc] + have hpost : ∀ c ∈ post,c.2 ∈ (F : Set M.toStarSubalgebra) ∪ {1} := by + intro c hc; apply hall c; simp [hxs,hc] + have ha : a.2 ∈ (F : Set M.toStarSubalgebra) ∪ {1} := hall a (by simp [hxs]) + have hsize : pre.length+1+post.length ≤ n := by simpa [hxs,Nat.add_assoc,Nat.add_comm,Nat.add_left_comm] using hn + have hL := mem_outerWordFamily v.val F n x₀ pre hx₀ (by omega) hpre + have hR := mem_outerWordFamily v.val F n a.2 post ha (by omega) hpost + have hh := hfirst _ hL _ hR a.1 + rw [hxs,hbs,maskedWord_one] + simpa only [mul_assoc] using hh + +theorem maskedWord_two_trace_lt (v : PartialUnitary M) {q : AlgebraProjection M} + (w : CornerUnitary q) (F : Finset M.toStarSubalgebra) (n : ℕ) (δ : ℝ) + (hF : ∀ x ∈ F,‖x‖ ≤ 1) + (hsecond : ∀ x ∈ F,∀ ys : List (Bool × M.toStarSubalgebra), + ys.length+2 ≤ n → (∀ a ∈ ys,a.2 ∈ F) → + ∀ u z : CornerUnitary q,∀ a b : M.toStarSubalgebra,‖a‖ ≤ 1 → ‖b‖ ≤ 1 → + ‖τ.trace (a*u.val*(x*patchingWord v.val ys)*z.val*b)‖ < + (2*patchingTolerance δ (ys.length+2)/3)*(τ.trace q.val).re) + (x₀ : M.toStarSubalgebra) (h₀ : ‖x₀‖ ≤ 1) + (xs : List (Bool × M.toStarSubalgebra)) (hn : xs.length ≤ n) + (hc : patchingCoefficients (F : Set M.toStarSubalgebra) xs) + (bs : List Bool) (hlen : bs.length=xs.length) (hcount : 2 ≤ bs.count true) : + ∃ r,r+2 ≤ xs.length ∧ + (bs ≠ exceptionalMask xs.length → r+2 ≤ xs.length-1) ∧ + ‖τ.trace (x₀*maskedWord v.val w.val xs bs)‖ < + (2*patchingTolerance δ (r+2)/3)*(τ.trace q.val).re := by + obtain ⟨pre,a,mid,b,post,cs,hxs,hbs,ha,hm,ht,hsize⟩ := + maskedWord_two_decomposition (F : Set M.toStarSubalgebra) xs hc bs hlen hcount + have hall := patchingCoefficients_norm (F : Set M.toStarSubalgebra) hF xs hc + have hpre : ∀ c ∈ pre,‖c.2‖ ≤ 1 := by intro c hc; apply hall c; simp [hxs,hc] + have hpost : ∀ c ∈ post,‖c.2‖ ≤ 1 := by intro c hc; apply hall c; simp [hxs,hc] + have hb : ‖b.2‖ ≤ 1 := hall b (by simp [hxs]) + have hp := patchingWord_norm_le_one v.val v.unitary.norm_le_one pre hpre + have ht' := maskedWord_norm_le_one v.val w.val v.unitary.norm_le_one w.norm_le_one post cs hpost + have hL : ‖x₀*patchingWord v.val pre‖ ≤ 1 := (norm_mul_le _ _).trans + ((mul_le_mul h₀ hp (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1)) + have hR : ‖b.2*maskedWord v.val w.val post cs‖ ≤ 1 := (norm_mul_le _ _).trans + ((mul_le_mul hb ht' (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1)) + refine ⟨mid.length,hsize,?_,?_⟩ + · intro he + by_contra h + have heq : mid.length+2=xs.length := by omega + have heq' : mid.length+2= + (List.replicate pre.length false++true::(List.replicate mid.length false++true::cs)).length := by + rw [← hbs,hlen,heq] + have hh := first_two_eq_exceptional pre.length mid.length cs heq' + rw [← hbs,hlen] at hh + exact he hh + · have hh := hsecond a.2 ha mid (by omega) hm + (signedCornerUnitary w a.1) (signedCornerUnitary w b.1) + (x₀*patchingWord v.val pre) (b.2*maskedWord v.val w.val post cs) hL hR + rw [hxs,hbs,maskedWord_first_two] + simpa only [signedCornerUnitary_val,mul_assoc] using hh + +end + +/-! Strict support growth for the actual f=1 admissible set. The single patch +is chosen from the finite coefficient families before any word is tested. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem unitResidual_orthogonal (v : PartialUnitary M) (q : AlgebraProjection M) + (hq : q ≤ unitResidual v) : v.support.val*q.val=0 := by + change (1-v.support.val)*q.val=q.val at hq + have hh : q.val-v.support.val*q.val=q.val := by simpa only [sub_mul,one_mul] using hq + exact sub_eq_self.mp hh + +def unitResidualPatch (v : PartialUnitary M) (q : AlgebraProjection M) (w : CornerUnitary q) + (hq : q ≤ unitResidual v) : PartialUnitary M := + ⟨⟨v.support.val+q.val,v.support.property.add q.property (unitResidual_orthogonal v q hq)⟩, + v.unitary.patch w (unitResidual_orthogonal v q hq)⟩ + +theorem unitResidualPatch_extends (v : PartialUnitary M) (q : AlgebraProjection M) + (w : CornerUnitary q) (hq : q ≤ unitResidual v) : v ≤ unitResidualPatch v q w hq := by + have hh := v.unitary.patch_extends w (unitResidual_orthogonal v q hq) + change (v.unitary.patch w (unitResidual_orthogonal v q hq)).val*v.support.val=v.val + simpa only [v.unitary.initial] using hh + +theorem unitResidualPatch_trace (v : PartialUnitary M) (q : AlgebraProjection M) + (w : CornerUnitary q) (hq : q ≤ unitResidual v) : + (τ.trace (unitResidualPatch v q w hq).support.val).re = + (τ.trace v.support.val).re+(τ.trace q.val).re := by + change (τ.trace (v.support.val+q.val)).re=_ + rw [cornerTrace_add,Complex.add_re] + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +/-- The full extension satisfies every original admissibility inequality and +has strictly greater support trace. No patch growth premise is assumed. -/ +theorem exists_strict_admissible_unit_patch + (F : Finset M.toStarSubalgebra) (hF : ∀ x ∈ F,‖x‖ ≤ 1) + (hcenter : ∀ x ∈ F,τ.trace x=0) (n : ℕ) (δ : ℝ) (hδ : 0 < δ) + (v : PartialUnitary M) + (hv : PatchingAdmissibleIn (P := N) τ (identityProjection M) F n (patchingTolerance δ) v) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) : + ∃ u : PartialUnitary M, + PatchingAdmissibleIn (P := N) τ (identityProjection M) F n (patchingTolerance δ) u ∧ + v ≤ u ∧ (τ.trace v.support.val).re < (τ.trace u.support.val).re := by + classical + obtain ⟨q,w,hqp,hq,hqN,hwN,hfirst,hsecond⟩ := exists_admissible_family_patch τ hNM + hfactor hdiff hirr hsep F hcenter n δ hδ v hv hsmall (δ/3) (by positivity) + let u := unitResidualPatch v q w hqp + have htq := projection_trace_pos τ q.val q.property hq + have htv : 0 ≤ (τ.trace v.support.val).re := by + rw [← v.unitary.trace_norm_sq τ]; positivity + have hg : (τ.trace u.support.val).re=(τ.trace v.support.val).re+(τ.trace q.val).re := + unitResidualPatch_trace τ v q w hqp + refine ⟨u,⟨⟨?_,?_⟩,?_⟩,unitResidualPatch_extends v q w hqp,by rw [hg]; linarith⟩ + · exact one_mul _ + · intro x₀ hx₀ xs hpos hn hc + have h₀ : ‖x₀‖ ≤ 1 := by + rcases hx₀ with h | h + · exact hF x₀ h + · rw [Set.mem_singleton_iff.mp h]; exact (IsStarProjection.one _).norm_le + let k := xs.length + let A := patchingTolerance δ k*(τ.trace v.support.val).re + let B := (2*patchingTolerance δ k/3)*(τ.trace q.val).re + let C := (2*patchingTolerance δ (k-1)/3)*(τ.trace q.val).re + have hεk := patchingTolerance_pos δ hδ k + have hεprev := patchingTolerance_pos δ hδ (k-1) + have hA : 0 ≤ A := mul_nonneg (patchingTolerance_pos δ hδ k).le htv + have hB : 0 ≤ B := mul_nonneg (by positivity) htq.le + have hC : 0 ≤ C := mul_nonneg (by positivity) htq.le + have hκ : (δ/3)*(τ.trace q.val).re ≤ C := by + have hd : δ ≤ patchingTolerance δ (k-1) := patchingTolerance_mono δ hδ (Nat.zero_le _) + apply mul_le_mul_of_nonneg_right _ htq.le + linarith + have hterm : ∀ bs ∈ binaryMasks k, + ‖τ.trace (x₀*maskedWord v.val w.val xs bs)‖ ≤ + C+(if bs=List.replicate k false then A else 0)+(if bs=exceptionalMask k then B else 0) := by + intro bs hbs + have hlen : bs.length=xs.length := (mem_binaryMasks k bs).mp hbs + have hAi : 0 ≤ (if bs=List.replicate k false then A else 0) := by split_ifs <;> positivity + have hBi : 0 ≤ (if bs=exceptionalMask k then B else 0) := by split_ifs <;> positivity + by_cases hz : bs.count true=0 + · have he : bs=List.replicate k false := by + simpa only [hlen] using (count_true_zero_iff bs).mp hz + have hh : ‖τ.trace (x₀*maskedWord v.val w.val xs bs)‖ ≤ A := by + rw [he,maskedWord_no_patch] + exact hv.1.2 x₀ hx₀ xs hpos hn hc + rw [ite_eq_left he] + linarith + · by_cases ho : bs.count true=1 + · have hh := (maskedWord_one_trace_lt τ v w F n (δ/3) hfirst x₀ hx₀ xs hn hc bs hlen ho).le.trans hκ + linarith + · obtain ⟨r,hr,hex,hbound⟩ := maskedWord_two_trace_lt τ v w F n δ hF hsecond x₀ h₀ xs hn hc bs hlen (by omega) + by_cases he : bs=exceptionalMask k + · have hmono := patchingTolerance_mono δ hδ hr + have hb : (2*patchingTolerance δ (r+2)/3)*(τ.trace q.val).re ≤ B := by + apply mul_le_mul_of_nonneg_right _ htq.le + linarith + have hh := hbound.le.trans hb + rw [ite_eq_left he] + linarith + · have hmono := patchingTolerance_mono δ hδ (hex he) + have hb : (2*patchingTolerance δ (r+2)/3)*(τ.trace q.val).re ≤ C := by + apply mul_le_mul_of_nonneg_right _ htq.le + linarith + have hh := hbound.le.trans hb + linarith + have hsum := sum_three_budgets (binaryMasks k) (binaryMasks_nodup k) + (fun bs => ‖τ.trace (x₀*maskedWord v.val w.val xs bs)‖) + (List.replicate k false) (exceptionalMask k) C A B hA hB hterm + have hbudget : ((binaryMasks k).length : ℝ)*C+B=patchingTolerance δ k*(τ.trace q.val).re := by + rw [binaryMasks_length,Nat.cast_pow,Nat.cast_ofNat] + have hh := congrArg (fun z : ℝ => z*(τ.trace q.val).re) (patchingTolerance_mask_budget δ k hpos) + dsimp [C,B] + nlinarith only [hh] + have hh := (patching_trace_sum_le τ v.val w.val x₀ xs).trans hsum + change ‖τ.trace (x₀*patchingWord (v.val+w.val) xs)‖ ≤ _ + rw [hg] + dsimp [A] at hh + nlinarith only [hh,hbudget] + · exact N.add_mem hv.2 hwN + +/-- The maximal-element contradiction now gives support trace strictly greater +than one quarter in the f=1 scalar-commutant setting. -/ +theorem exists_large_admissible_partialUnitary + (F : Finset M.toStarSubalgebra) (hF : ∀ x ∈ F,‖x‖ ≤ 1) + (hcenter : ∀ x ∈ F,τ.trace x=0) (n : ℕ) (δ : ℝ) (hδ : 0 < δ) : + ∃ v : PartialUnitary M, + PatchingAdmissibleIn (P := N) τ (identityProjection M) F n (patchingTolerance δ) v ∧ + 1/4 < (τ.trace v.support.val).re := by + obtain ⟨v,hv,hmax⟩ := exists_maximal_patchingAdmissibleIn τ hNM (identityProjection M) F hF n (patchingTolerance δ) + refine ⟨v,hv,?_⟩ + by_contra h + obtain ⟨u,hu,hvu,hgrow⟩ := exists_strict_admissible_unit_patch τ hNM hfactor hdiff hirr hsep + F hF hcenter n δ hδ v hv (by linarith) + have hh := PartialUnitary.support_trace_mono τ (hmax u hu hvu) + linarith + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/LocalQuantization.lean b/lean/OAI/Analysis/FactorGeneration/LocalQuantization.lean new file mode 100644 index 0000000000000000000000000000000000000000..28bfd4494f21772f1718faa9563cf383c77c7183 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/LocalQuantization.lean @@ -0,0 +1,553 @@ +import OAI.Analysis.FactorGeneration.MatrixExpectation + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! An actual irreducible subalgebra and its constructed conditional +expectation give finite pinching partitions with energy arbitrarily close +to the expectation energy. No partition or expectation is supplied. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_expectation_energy_partition (hNM : N ≤ M) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (η : ℝ) (hη : 0 < η) : + ∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ N) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < + (∑ i ∈ F,τ.norm₂ (conditionalExpectation τ hNM (x i))^2)+η := by + let Q := CornerPartition.single (identityProjection M) + have hQ : ∀ i,(Q.piece i).val.val ∈ N := fun _ => N.one_mem + have hpinch (a : M.toStarSubalgebra) : Q.pinch a=a := by + rw [CornerPartition.single_pinch] + change 1*a*1=a + simp only [one_mul,mul_one] + obtain ⟨R,_,hR,hE,_⟩ := exists_component_controlled_refinement τ hNM hirr Q hQ + F x (conditionalExpectation τ hNM ∘ x) + (fun i _ => conditionalExpectation_mem τ hNM (x i)) + (fun i _ => conditionalExpectation_orthogonal τ hNM (x i)) + (∑ i ∈ F,τ.norm₂ (conditionalExpectation τ hNM (x i))^2) η hη + (by simp only [Function.comp_apply,hpinch,le_refl]) + exact ⟨R,hR,hE⟩ + +end + +/-! Convert the source's decreasing irreducible chain into actual finite +pinching partitions. The chain and its irreducibility are explicit inputs; +its existence in an arbitrary factor is not asserted. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_decreasing_centered_pinching_partition (A : ℕ → VonNeumannAlgebra H) + (hAM : ∀ n,A n ≤ M) (hA : Antitone A) + (hirr : ∀ n,∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := A n), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hscalar : ∀ c : M.toStarSubalgebra,(∀ n,c.val ∈ A n) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ n,∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ A n) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε := by + obtain ⟨n,hn⟩ := decreasing_expectations_finite_centered_budget τ A hAM hA hscalar + F x hx (ε/2) (half_pos hε) + obtain ⟨Q,hQ,hE⟩ := exists_expectation_energy_partition τ (hAM n) (hirr n) + F x (ε/2) (half_pos hε) + exact ⟨n,Q,hQ,by linarith⟩ + +/-- Center arbitrary elements by their actual scalar trace before selecting +one partition for the whole finite family. -/ +theorem exists_decreasing_scalar_pinching_partition (A : ℕ → VonNeumannAlgebra H) + (hAM : ∀ n,A n ≤ M) (hA : Antitone A) + (hirr : ∀ n,∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := A n), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hscalar : ∀ c : M.toStarSubalgebra,(∀ n,c.val ∈ A n) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (ε : ℝ) (hε : 0 < ε) : + ∃ n,∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ A n) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i)-τ.trace (x i) • (1 : M.toStarSubalgebra))^2) < ε := by + let y : ι → M.toStarSubalgebra := fun i => x i-τ.trace (x i) • (1 : M.toStarSubalgebra) + have hy : ∀ i ∈ F,τ.trace (y i)=0 := by + intro i _ + dsimp [y] + change coordinateTraceLinear τ (x i-τ.trace (x i) • (1 : M.toStarSubalgebra))=0 + rw [map_sub,map_smul] + change τ.trace (x i)-τ.trace (x i)*τ.trace 1=0 + rw [τ.trace_one,mul_one,sub_self] + obtain ⟨n,Q,hQ,hE⟩ := exists_decreasing_centered_pinching_partition τ A hAM hA hirr hscalar + F y hy ε hε + refine ⟨n,Q,hQ,?_⟩ + have h1 : Q.pinch (1 : M.toStarSubalgebra)=1 := by + unfold CornerPartition.pinch + simpa only [mul_one,(Q.piece _).property.isIdempotentElem.eq] using + (show (∑ i,(Q.piece i).val)=1 from Q.total) + simpa only [y,Q.pinch_sub,Q.pinch_smul,h1] using hE + +end + +/-! Restrict a compatible unit partition to an actual corner, retaining +all pieces and the exact compression. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace CornerPartition +variable (Q : CornerPartition (identityProjection M)) (p : AlgebraProjection M) +variable (hc : ∀ i,Commute p.val (Q.piece i).val) + +def restrictPiece (i : Fin Q.size) : AlgebraProjection M := + ⟨p.val*(Q.piece i).val,p.property.mul (Q.piece i).property (hc i)⟩ + +theorem restrictPiece_le (i : Fin Q.size) : Q.restrictPiece p hc i ≤ Q.piece i := by + change (Q.piece i).val*(p.val*(Q.piece i).val)=p.val*(Q.piece i).val + rw [← mul_assoc,← (hc i).eq,mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + +def restrictTo : CornerPartition p where + size := Q.size + piece := Q.restrictPiece p hc + orthogonal i j hij := orthogonal_subprojections (Q.orthogonal i j hij) + (Q.restrictPiece_le p hc i) (Q.restrictPiece_le p hc j) + total := by + change (∑ i,p.val*(Q.piece i).val)=p.val + rw [← Finset.mul_sum,Q.total] + exact mul_one p.val + +theorem restrictTo_mem (P : StarSubalgebra ℂ M.toStarSubalgebra) + (hp : p.val ∈ P) (hQ : ∀ i,(Q.piece i).val ∈ P) : + ∀ i,((Q.restrictTo p hc).piece i).val ∈ P := + fun i => P.mul_mem hp (hQ i) + +theorem restrictTo_pinch (x : M.toStarSubalgebra) : + (Q.restrictTo p hc).pinch x=Q.pinch (p.val*x*p.val) := by + unfold pinch + apply Finset.sum_congr rfl + intro i _ + change (p.val*(Q.piece i).val)*x*(p.val*(Q.piece i).val)= + (Q.piece i).val*(p.val*x*p.val)*(Q.piece i).val + calc (p.val*(Q.piece i).val)*x*(p.val*(Q.piece i).val) = + ((Q.piece i).val*p.val)*x*(p.val*(Q.piece i).val) := + congrArg (fun z => z*x*(p.val*(Q.piece i).val)) (hc i).eq + _ = _ := by simp only [mul_assoc] + +theorem restrictTo_pinch_of_supported (x : M.toStarSubalgebra) + (hl : p.val*x=x) (hr : x*p.val=x) : + (Q.restrictTo p hc).pinch x=Q.pinch x := by + rw [Q.restrictTo_pinch p hc,hl,hr] + +/-- The binary partition selecting p and its complement. -/ +def splitUnit (p : AlgebraProjection M) : CornerPartition (identityProjection M) := + binary (identityProjection M) p (one_mul p.val) + +theorem splitUnit_mem (P : StarSubalgebra ℂ M.toStarSubalgebra) (hp : p.val ∈ P) : + ∀ i,((splitUnit p).piece i).val ∈ P := by + have hall (b : Bool) : + ((if b then p else (⟨1-p.val,p.property.one_sub⟩ : AlgebraProjection M))).val ∈ P := by + cases b + · exact P.sub_mem P.one_mem hp + · exact hp + intro i + exact hall ((Fintype.equivFin Bool).symm i) + +theorem refines_splitUnit_commutes (R : CornerPartition (identityProjection M)) + (h : (splitUnit p).Refines R) : ∀ i,Commute p.val (R.piece i).val := by + have hall (b : Bool) (r : AlgebraProjection M) + (hr : r ≤ (if b then p else (⟨1-p.val,p.property.one_sub⟩ : AlgebraProjection M))) : + Commute p.val r.val := by + cases b + · have hl : p.val*r.val=0 := by + change (1-p.val)*r.val=r.val at hr + rw [sub_mul,one_mul,sub_eq_self] at hr + exact hr + have hright : r.val*p.val=0 := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq, + r.property.isSelfAdjoint.star_eq,star_zero] using congrArg star hl + show p.val*r.val=r.val*p.val + rw [hl,hright] + · change r ≤ p at hr + show p.val*r.val=r.val*p.val + rw [show p.val*r.val=r.val from hr,projection_mul_of_le hr] + intro i + obtain ⟨j,hj⟩ := h i + exact hall ((Fintype.equivFin Bool).symm j) (R.piece i) hj + +end CornerPartition +end + +/-! Complete a corner partition by the complementary projection. This lets +the existing compatible refinement construction act on an actual p-corner. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} {p : AlgebraProjection M} +namespace CornerPartition +variable (Q : CornerPartition p) + +def completionPiece : Fin Q.size ⊕ Unit → AlgebraProjection M := + Sum.elim Q.piece (fun _ => ⟨1-p.val,p.property.one_sub⟩) + +theorem completionPiece_orthogonal (i j : Fin Q.size ⊕ Unit) (h : i ≠ j) : + (Q.completionPiece i).val*(Q.completionPiece j).val=0 := by + cases i with + | inl i => + cases j with + | inl j => exact Q.orthogonal i j (fun he => h (congrArg Sum.inl he)) + | inr j => + change (Q.piece i).val*(1-p.val)=0 + rw [mul_sub,mul_one,projection_mul_of_le (Q.piece_le i),sub_self] + | inr i => + cases j with + | inl j => + change (1-p.val)*(Q.piece j).val=0 + rw [sub_mul,one_mul,show p.val*(Q.piece j).val=(Q.piece j).val from Q.piece_le j,sub_self] + | inr j => exact (h (congrArg Sum.inr (Subsingleton.elim i j))).elim + +theorem completionPiece_total : (∑ i, (Q.completionPiece i).val)=(identityProjection M).val := by + rw [Fintype.sum_sum_type] + change (∑ i, (Q.piece i).val)+(∑ _ : Unit, (1-p.val))=1 + calc + _ = p.val+(1-p.val) := + congrArg₂ (fun x y : M.toStarSubalgebra => x+y) Q.total (by simp) + _ = 1 := by abel + +def completeUnit : CornerPartition (identityProjection M) := + ofFamily Q.completionPiece Q.completionPiece_orthogonal Q.completionPiece_total + +theorem completeUnit_mem (P : StarSubalgebra ℂ M.toStarSubalgebra) + (hp : p.val ∈ P) (hQ : ∀ i,(Q.piece i).val ∈ P) : + ∀ i,((Q.completeUnit).piece i).val ∈ P := by + intro i + change (Q.completionPiece ((Fintype.equivFin (Fin Q.size ⊕ Unit)).symm i)).val ∈ P + cases (Fintype.equivFin (Fin Q.size ⊕ Unit)).symm i with + | inl j => exact hQ j + | inr j => exact P.sub_mem P.one_mem hp + +theorem completeUnit_pinch (x : M.toStarSubalgebra) : + Q.completeUnit.pinch x=Q.pinch x+(1-p.val)*x*(1-p.val) := by + rw [completeUnit,ofFamily_pinch,Fintype.sum_sum_type] + simp only [completionPiece,Fintype.sum_unique] + rfl + +theorem completeUnit_pinch_supported (x : M.toStarSubalgebra) (hl : p.val*x=x) : + Q.completeUnit.pinch x=Q.pinch x := by + rw [Q.completeUnit_pinch,sub_mul,one_mul,hl,sub_self,zero_mul,add_zero] + +theorem completeUnit_refines_split : (splitUnit p).Refines Q.completeUnit := by + intro i + let k := (Fintype.equivFin (Fin Q.size ⊕ Unit)).symm i + change ∃ j, Q.completionPiece k ≤ (splitUnit p).piece j + cases hk : k with + | inl a => + refine ⟨(Fintype.equivFin Bool) true,?_⟩ + have he : ((splitUnit p).piece ((Fintype.equivFin Bool) true)).val=p.val := by + change (if (Fintype.equivFin Bool).symm ((Fintype.equivFin Bool) true) = true + then p else _).val=p.val + rw [Equiv.symm_apply_apply] + rfl + exact (congrArg (fun z : M.toStarSubalgebra => z*(Q.piece a).val) he).trans (Q.piece_le a) + | inr a => + refine ⟨(Fintype.equivFin Bool) false,?_⟩ + have he : ((splitUnit p).piece ((Fintype.equivFin Bool) false)).val=1-p.val := by + change (if (Fintype.equivFin Bool).symm ((Fintype.equivFin Bool) false) = true + then p else _).val=1-p.val + rw [Equiv.symm_apply_apply] + rfl + exact (congrArg (fun z : M.toStarSubalgebra => z*(1-p.val)) he).trans + p.property.one_sub.isIdempotentElem.eq + +end CornerPartition +end + +/-! Transfer actual corner partitions along a concrete von Neumann +subalgebra inclusion, preserving pieces, pinching and tracial energy. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +namespace CornerPartition +variable {p : AlgebraProjection N} (Q : CornerPartition p) + +def mapInclusion (hNM : N ≤ M) : CornerPartition (includedProjection hNM p) where + size := Q.size + piece i := includedProjection hNM (Q.piece i) + orthogonal i j hij := by + change coordinateInclusion hNM (Q.piece i).val*coordinateInclusion hNM (Q.piece j).val=0 + rw [← map_mul,Q.orthogonal i j hij,map_zero] + total := by + change (∑ i,coordinateInclusion hNM (Q.piece i).val)=coordinateInclusion hNM p.val + rw [← map_sum,Q.total] + +theorem include_pinch (hNM : N ≤ M) (x : N.toStarSubalgebra) : + (Q.mapInclusion hNM).pinch (coordinateInclusion hNM x)=coordinateInclusion hNM (Q.pinch x) := by + unfold pinch + change (∑ i,coordinateInclusion hNM (Q.piece i).val*coordinateInclusion hNM x* + coordinateInclusion hNM (Q.piece i).val)=coordinateInclusion hNM _ + simp only [← map_mul,← map_sum] + +theorem include_piece_mem (hNM : N ≤ M) (i : Fin Q.size) : + ((Q.mapInclusion hNM).piece i).val.val ∈ N := (Q.piece i).val.property + +/-- Unit partitions use the ambient identity, with no transport of the +underlying finite index set. -/ +def includeUnit (Q : CornerPartition (identityProjection N)) (hNM : N ≤ M) : + CornerPartition (identityProjection M) where + size := Q.size + piece := (Q.mapInclusion hNM).piece + orthogonal := (Q.mapInclusion hNM).orthogonal + total := (Q.mapInclusion hNM).total + +theorem includeUnit_pinch (Q : CornerPartition (identityProjection N)) + (hNM : N ≤ M) (x : N.toStarSubalgebra) : + (Q.includeUnit hNM).pinch (coordinateInclusion hNM x)=coordinateInclusion hNM (Q.pinch x) := + Q.include_pinch hNM x + +theorem includeUnit_energy (Q : CornerPartition (identityProjection N)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : N.toStarSubalgebra) : + τ.norm₂ ((Q.includeUnit hNM).pinch (coordinateInclusion hNM x))^2= + (restrictedTrace τ hNM).norm₂ (Q.pinch x)^2 := by + rw [Q.includeUnit_pinch] + rfl + +end CornerPartition +end + +/-! The two applications of orthogonal refinement in Popa A.1.2, equations +(2) and (3). The inner decreasing chain need only be irreducible in N; +irreducibility of its terms in the ambient M is not imposed. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_nested_chain_centered_partition (hNM : N ≤ M) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (A : ℕ → VonNeumannAlgebra H) (hAN : ∀ n,A n ≤ N) (hA : Antitone A) + (hAirr : ∀ n,∀ c : N.toStarSubalgebra, + (∀ a : insideAlgebra (M := N) (P := A n), + (a : N.toStarSubalgebra)*c=c*(a : N.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hscalar : ∀ c : N.toStarSubalgebra,(∀ n,c.val ∈ A n) → + ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ N) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε := by + let y : ι → N.toStarSubalgebra := fun i => + ⟨(conditionalExpectation τ hNM (x i)).val,conditionalExpectation_mem τ hNM (x i)⟩ + have he (i : ι) : coordinateInclusion hNM (y i)=conditionalExpectation τ hNM (x i) := rfl + have hy : ∀ i ∈ F,(restrictedTrace τ hNM).trace (y i)=0 := by + intro i hi + rw [restrictedTrace_trace,he,conditionalExpectation_trace,hx i hi] + obtain ⟨n,Q,hQ,hE⟩ := exists_decreasing_centered_pinching_partition (restrictedTrace τ hNM) + A hAN hA hAirr hscalar F y hy (ε/2) (half_pos hε) + let R := Q.includeUnit hNM + have hR : ∀ i,(R.piece i).val.val ∈ N := Q.include_piece_mem hNM + have hbudget : (∑ i ∈ F,τ.norm₂ (R.pinch (conditionalExpectation τ hNM (x i)))^2) ≤ ε/2 := by + have hi (i : ι) : τ.norm₂ (R.pinch (conditionalExpectation τ hNM (x i)))^2= + (restrictedTrace τ hNM).norm₂ (Q.pinch (y i))^2 := by + rw [← he] + exact Q.includeUnit_energy τ hNM (y i) + simpa only [hi] using hE.le + obtain ⟨S,_,hS,hE,_⟩ := exists_component_controlled_refinement τ hNM hirr R hR + F x (conditionalExpectation τ hNM ∘ x) + (fun i _ => conditionalExpectation_mem τ hNM (x i)) + (fun i _ => conditionalExpectation_orthogonal τ hNM (x i)) + (ε/2) (ε/2) (half_pos hε) hbudget + exact ⟨S,hS,by linarith⟩ + +end + +/-! Nonzero local projections obtained from the constructed nested-chain +partition. This implements the finite squared-energy selection at the end +of A.1.2, while retaining the chain as a structural premise. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- Finite pinching energy selects one nonzero projection with simultaneous +strict squared-L2 bounds, with the actual trace as the weight. -/ +theorem CornerPartition.exists_indexed_local_L2_piece + {p : AlgebraProjection M} (Q : CornerPartition p) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (ε : ℝ) (hE : (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε*(τ.trace p.val).re) : + ∃ j : Fin Q.size,(Q.piece j).val ≠ 0 ∧ + ∀ i ∈ F,τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val)^2 < + ε*(τ.trace (Q.piece j).val).re := by + have htrace := Q.trace_total τ + have he : (∑ j : Fin Q.size,∑ i ∈ F,τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val)^2) < + ε*∑ j : Fin Q.size,(τ.trace (Q.piece j).val).re := by + rw [Finset.sum_comm,htrace] + simpa only [← Q.pinch_energy τ] using hE + obtain ⟨j,_,hj,hjE⟩ := exists_small_energy_piece Finset.univ F + (fun j => (τ.trace (Q.piece j).val).re) + (fun j i => τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val)^2) ε + (fun j _ => by rw [projection_trace_sq τ _ (Q.piece j).property]; positivity) + (fun _ _ _ _ => sq_nonneg _) he + refine ⟨j,?_,hjE⟩ + intro hz + have ht : τ.trace (Q.piece j).val=0 := by rw [hz]; exact inner_zero_right _ + rw [ht,Complex.zero_re] at hj + exact (lt_irrefl 0 hj) + +theorem exists_nested_chain_local_piece (hNM : N ≤ M) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (A : ℕ → VonNeumannAlgebra H) (hAN : ∀ n,A n ≤ N) (hA : Antitone A) + (hAirr : ∀ n,∀ c : N.toStarSubalgebra, + (∀ a : insideAlgebra (M := N) (P := A n), + (a : N.toStarSubalgebra)*c=c*(a : N.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hscalar : ∀ c : N.toStarSubalgebra,(∀ n,c.val ∈ A n) → + ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ q : AlgebraProjection M,q.val ≠ 0 ∧ q.val.val ∈ N ∧ + ∀ i ∈ F,τ.norm₂ (q.val*x i*q.val) < ε*τ.norm₂ q.val ∧ + norm₁ τ (q.val*x i*q.val) < ε*(τ.trace q.val).re := by + obtain ⟨Q,hQ,hE⟩ := exists_nested_chain_centered_partition τ hNM hirr A hAN hA hAirr hscalar + F x hx (ε^2) (sq_pos_of_pos hε) + have he : (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε^2*(τ.trace (identityProjection M).val).re := by + simpa only [show (identityProjection M).val=1 from rfl,τ.trace_one,Complex.one_re,mul_one] using hE + obtain ⟨j,hj,hjE⟩ := Q.exists_indexed_local_L2_piece τ F x (ε^2) he + refine ⟨Q.piece j,hj,hQ j,fun i hi => ?_⟩ + have ht := hjE i hi + rw [projection_trace_sq τ _ (Q.piece j).property] at ht + have hn : τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val) < ε*τ.norm₂ (Q.piece j).val := by + nlinarith [show 0 ≤ τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val) from norm_nonneg _, + mul_nonneg hε.le (show 0 ≤ τ.norm₂ (Q.piece j).val from norm_nonneg _)] + exact ⟨hn,compression_norm₁_lt_of_norm₂ τ (Q.piece j) hj (x i) ε hn⟩ + +end + +/-! Local quantization by finite matrix approximation and Bell pinching under represented trace-vector separability. -/ +open scoped BigOperators +open UltrapowerBridge FiniteMatrixStage +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_matrix_generated_ambient_centered_partition + (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (hNM : N ≤ M) (hfactor : IsII1Factor (generated A)) + (hirr : ∀ c : M.toStarSubalgebra,(∀ a : generated A,a.val*c.val=c.val*a.val) → + c=τ.trace c • (1 : M.toStarSubalgebra)) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ generated A) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε := by + let R := generatedVonNeumann A + have hRM : R ≤ M := (generatedVonNeumann_le A).trans hNM + have hirrR : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := R), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra) := by + intro c hc + refine ⟨τ.trace c,hirr c (fun a => ?_)⟩ + exact congrArg Subtype.val (hc ⟨⟨a.val,hRM a.property⟩,a.property⟩) + let y : ι → R.toStarSubalgebra := fun i => + ⟨(conditionalExpectation τ hRM (x i)).val,conditionalExpectation_mem τ hRM (x i)⟩ + have he (i : ι) : coordinateInclusion hRM (y i)=conditionalExpectation τ hRM (x i) := rfl + have hy : ∀ i ∈ F,(restrictedTrace τ hRM).trace (y i)=0 := by + intro i hi + rw [restrictedTrace_trace,he,conditionalExpectation_trace,hx i hi] + obtain ⟨Q,hE⟩ := exists_matrix_generated_centered_partition A hA + (restrictedTrace τ hRM) hfactor F y hy (ε/2) (half_pos hε) + let Q' := Q.includeUnit hRM + have hQ' : ∀ i,(Q'.piece i).val.val ∈ R := Q.include_piece_mem hRM + have hb : (∑ i ∈ F,τ.norm₂ (Q'.pinch (conditionalExpectation τ hRM (x i)))^2) ≤ ε/2 := by + have hi (i : ι) : τ.norm₂ (Q'.pinch (conditionalExpectation τ hRM (x i)))^2= + (restrictedTrace τ hRM).norm₂ (Q.pinch (y i))^2 := by + rw [← he] + exact Q.includeUnit_energy τ hRM (y i) + simpa only [hi] using hE.le + obtain ⟨S,_,hS,hSE,_⟩ := exists_component_controlled_refinement τ hRM hirrR Q' hQ' + F x (conditionalExpectation τ hRM ∘ x) + (fun i _ => conditionalExpectation_mem τ hRM (x i)) + (fun i _ => conditionalExpectation_orthogonal τ hRM (x i)) + (ε/2) (ε/2) (half_pos hε) hb + exact ⟨S,hS,by linarith⟩ + +theorem exists_irreducible_centered_partition (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition (identityProjection M), + (∀ i,(Q.piece i).val.val ∈ N) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε := by + obtain ⟨A,_,hA,_,hR,hRN,hRM⟩ := + exists_irreducible_matrix_generated_II1 τ hNM hfactor hdiff hirr hsep + obtain ⟨Q,hQ,hE⟩ := exists_matrix_generated_ambient_centered_partition τ A hA hNM hR hRM + F x hx ε hε + exact ⟨Q,fun i => hRN (hQ i),hE⟩ + +theorem exists_irreducible_local_piece (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ q : AlgebraProjection M,q.val ≠ 0 ∧ q.val.val ∈ N ∧ + ∀ i ∈ F,τ.norm₂ (q.val*x i*q.val) < ε*τ.norm₂ q.val ∧ + norm₁ τ (q.val*x i*q.val) < ε*(τ.trace q.val).re := by + obtain ⟨Q,hQ,hE⟩ := exists_irreducible_centered_partition τ hNM hfactor hdiff hirr hsep + F x hx (ε^2) (sq_pos_of_pos hε) + have he : (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε^2*(τ.trace (identityProjection M).val).re := by + simpa only [show (identityProjection M).val=1 from rfl,τ.trace_one,Complex.one_re,mul_one] using hE + obtain ⟨j,hj,hjE⟩ := Q.exists_indexed_local_L2_piece τ F x (ε^2) he + refine ⟨Q.piece j,hj,hQ j,fun i hi => ?_⟩ + have ht := hjE i hi + rw [projection_trace_sq τ _ (Q.piece j).property] at ht + have hn : τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val) < ε*τ.norm₂ (Q.piece j).val := by + nlinarith [show 0 ≤ τ.norm₂ ((Q.piece j).val*x i*(Q.piece j).val) from norm_nonneg _, + mul_nonneg hε.le (show 0 ≤ τ.norm₂ (Q.piece j).val from norm_nonneg _)] + exact ⟨hn,compression_norm₁_lt_of_norm₂ τ (Q.piece j) hj (x i) ε hn⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/LocalizedStates.lean b/lean/OAI/Analysis/FactorGeneration/LocalizedStates.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5b64108ca23ad9e92f9d5d40ef133e8f589a288 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/LocalizedStates.lean @@ -0,0 +1,826 @@ +import OAI.Analysis.FactorGeneration.SpectralStates + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Localization of actual signed vector/dimension values. Fixed strict +sublevel sets, rather than a limiting strict inequality, supply Zorn bounds. -/ +open Filter +open scoped Topology +section +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +namespace AlgebraProjection + +/-- A continuous orthogonally additive real charge nonnegative on G admits a +nonzero corner all of whose subprojections have nonnegative charge. -/ +theorem exists_nonnegative_corner + (μ : AlgebraProjection M → ℝ) + (hadd : ∀ p q (ho : p.val*q.val=0), μ (orthogonalSum p q ho)=μ p+μ q) + (hcont : ∀ (I : Type u) [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (a : I → AlgebraProjection M), Monotone a → + ∀ p, IsLUB (Set.range a) p → Tendsto (fun i => μ (a i)) atTop (𝓝 (μ p))) + (G : AlgebraProjection M) (hG : G.val≠0) (hμG : 0 ≤ μ G) : + ∃ F : AlgebraProjection M, F ≤ G ∧ F.val≠0 ∧ ∀ p, p ≤ F → 0 ≤ μ p := by + classical + by_cases hall : ∀ p : AlgebraProjection M, p ≤ G → 0 ≤ μ p + · exact ⟨G,le_rfl,hG,hall⟩ + push Not at hall + obtain ⟨r,hrG,hr⟩ := hall + let S : Set (AlgebraProjection M) := {p | p ≤ G ∧ μ p ≤ μ r} + obtain ⟨v,hv⟩ := zorn_le₀ S (by + intro c hc hchain + by_cases hne : c.Nonempty + · let : Nonempty c := hne.to_subtype + let : IsDirected c (· ≤ ·) := ⟨by + intro a b + rcases hchain.total a.property b.property with h | h + · exact ⟨b,h,le_rfl⟩ + · exact ⟨a,le_rfl,h⟩⟩ + obtain ⟨p,hp⟩ := exists_isLUB_monotone (fun q : c => q.val) (fun _ _ h => h) + refine ⟨p,⟨?_,?_⟩,fun q hq => hp.1 ⟨⟨q,hq⟩,rfl⟩⟩ + · exact hp.2 (by rintro _ ⟨q,rfl⟩; exact (hc q.property).1) + · exact le_of_tendsto (hcont c (fun q : c => q.val) (fun _ _ h => h) p hp) + (Eventually.of_forall (fun q => (hc q.property).2)) + · exact ⟨r,⟨hrG,le_rfl⟩,fun q hq => (hne ⟨q,hq⟩).elim⟩) + have hvG : v ≤ G := hv.1.1 + have hvneg : μ v < 0 := hv.1.2.trans_lt hr + let F := remainder v G hvG + have hF : F.val≠0 := by + intro hz + have he : G=v := Subtype.ext (sub_eq_zero.mp hz) + rw [he] at hμG + exact (not_lt_of_ge hμG) hvneg + refine ⟨F,remainder_le v G hvG,hF,?_⟩ + intro p hp + by_contra hnot + have hpneg : μ p<0 := lt_of_not_ge hnot + have ho : v.val*p.val=0 := projection_orthogonal_of_le + (remainder_orthogonal v G hvG) le_rfl hp + let q := orthogonalSum v p ho + have hqG : q ≤ G := orthogonalSum_le ho hvG (hp.trans (remainder_le v G hvG)) + have he : μ q=μ v+μ p := hadd v p ho + have hqμ : μ q ≤ μ r := by linarith [hv.1.2] + have hqv : q ≤ v := hv.2 ⟨hqG,hqμ⟩ (le_orthogonalSum_left _ _ ho) + have hqeq : q=v := le_antisymm hqv (le_orthogonalSum_left _ _ ho) + rw [hqeq] at he + linarith + +end AlgebraProjection + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +theorem traceFreeDimension_tendsto_monotone + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) + (p : AlgebraProjection M) (hp : IsLUB (Set.range q) p) : + Tendsto (fun i => traceFreeDimension hfactor hdiff (q i)) atTop + (𝓝 (traceFreeDimension hfactor hdiff p)) := by + rw [traceFreeDimension_isLUB_monotone hfactor hdiff hfinite hunit q hq p hp] + exact tendsto_atTop_isLUB ((traceFreeDimension_mono hfactor hdiff).comp hq) + (isLUB_csSup (Set.range_nonempty _) (traceFreeDimension_range_bddAbove hfactor hdiff q)) + +include hfinite in +/-- Concrete localization for a real linear combination of the actual vector +functional and the already constructed dimension; no linear trace is assumed. -/ +theorem exists_signed_vector_dimension_corner + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (ξ : H) (c d : ℝ) (G : AlgebraProjection M) (hG : G.val≠0) + (hμG : 0 ≤ c*G.vectorValue ξ+d*traceFreeDimension hfactor hdiff G) : + ∃ F : AlgebraProjection M, F ≤ G ∧ F.val≠0 ∧ + ∀ p, p ≤ F → 0 ≤ c*p.vectorValue ξ+d*traceFreeDimension hfactor hdiff p := by + apply AlgebraProjection.exists_nonnegative_corner + (fun p => c*p.vectorValue ξ+d*traceFreeDimension hfactor hdiff p) ?_ ?_ G hG hμG + · intro p q ho + have hν : (orthogonalSum p q ho).vectorValue ξ=p.vectorValue ξ+q.vectorValue ξ := by + change (inner ℂ ξ (p.val.val ξ+q.val.val ξ)).re=_ + rw [inner_add_right,Complex.add_re] + rfl + have hD := traceFreeDyadicSup_orthogonal_add hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ p q hunit (one_mul _) (one_mul _) ho + change traceFreeDimension hfactor hdiff (orthogonalSum p q ho)= + traceFreeDimension hfactor hdiff p+traceFreeDimension hfactor hdiff q at hD + rw [hν,hD] + ring + · intro I _ _ _ a ha p hp + exact ((AlgebraProjection.vectorValue_tendsto_monotone a ha p hp ξ).const_mul c).add + ((traceFreeDimension_tendsto_monotone hfactor hdiff hfinite hunit a ha p hp).const_mul d) + +include hfinite in +theorem exists_vector_dimension_lower_corner + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (ξ : H) (G : AlgebraProjection M) (hG : G.val≠0) : + ∃ F : AlgebraProjection M, F ≤ G ∧ F.val≠0 ∧ ∀ p, p ≤ F → + G.vectorValue ξ*traceFreeDimension hfactor hdiff p ≤ + p.vectorValue ξ*traceFreeDimension hfactor hdiff G := by + obtain ⟨F,hFG,hF,h⟩ := exists_signed_vector_dimension_corner hfactor hdiff hfinite hunit + ξ (traceFreeDimension hfactor hdiff G) (-G.vectorValue ξ) G hG (by nlinarith) + exact ⟨F,hFG,hF,fun p hp => by have hh := h p hp; nlinarith⟩ + +include hfinite in +theorem exists_vector_dimension_upper_corner + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (ξ : H) (G : AlgebraProjection M) (hG : G.val≠0) : + ∃ F : AlgebraProjection M, F ≤ G ∧ F.val≠0 ∧ ∀ p, p ≤ F → + p.vectorValue ξ*traceFreeDimension hfactor hdiff G ≤ + G.vectorValue ξ*traceFreeDimension hfactor hdiff p := by + obtain ⟨F,hFG,hF,h⟩ := exists_signed_vector_dimension_corner hfactor hdiff hfinite hunit + ξ (-traceFreeDimension hfactor hdiff G) (G.vectorValue ξ) G hG (by nlinarith) + exact ⟨F,hFG,hF,fun p hp => by have hh := h p hp; nlinarith⟩ + +end + +/-! Tight multiplicative localization of an actual Hilbert vector functional +against the constructed projection dimension. The corner is constructed. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +/-- An actual unit vector admits a nonzero corner on which every projection +value is between a D(p) and (1+ε)a D(p), with a strictly positive. -/ +theorem exists_vector_dimension_localization + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (ξ : H) (hξ : ‖ξ‖=1) (ε : ℝ) (hε : 0<ε) : + ∃ (E : AlgebraProjection M) (a : ℝ), E.val≠0 ∧ 0 inner ℂ ξ (x.val ξ) + map_add' := fun x y => inner_add_right _ _ _ + map_smul' := fun c x => inner_smul_right _ _ _ } + (‖ξ‖^2) (fun x => by + calc ‖inner ℂ ξ (x.val ξ)‖ ≤ ‖ξ‖*‖x.val ξ‖ := norm_inner_le_norm _ _ + _ ≤ ‖ξ‖*(‖x.val‖*‖ξ‖) := mul_le_mul_of_nonneg_left (x.val.le_opNorm ξ) (norm_nonneg _) + _ = ‖ξ‖^2*‖x‖ := by change ‖ξ‖*(‖x‖*‖ξ‖)=_; ring) + +theorem vectorFunctional_apply (ξ : H) (x : M.toStarSubalgebra) : + vectorFunctional ξ x=inner ℂ ξ (x.val ξ) := rfl + +theorem vectorFunctional_norm_le (ξ : H) : ‖vectorFunctional (M := M) ξ‖ ≤ ‖ξ‖^2 := + LinearMap.mkContinuous_norm_le _ (by positivity) _ + +/-- A positive operator supported by p is approximated inside that same corner. -/ +theorem exists_positive_corner_spectral_approximation + (p : AlgebraProjection M) (x : M.toStarSubalgebra) (hx : 0 ≤ x) + (hpx : p.val*x=x) (ε : ℝ) (hε : 0<ε) : + ∃ (Q : CornerPartition p) (c : Fin Q.size → ℝ), + (∀ i, 0 ≤ c i) ∧ (∀ i, Commute (Q.piece i).val x) ∧ + ‖x-∑ i, (c i : ℂ) • (Q.piece i).val‖ < ε := by + have hxp : x*p.val=x := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq,hx.isSelfAdjoint.star_eq] + using congrArg star hpx + let I : SpectralInterval x := + { proj := p + lo := 0 + hi := ‖x‖ + lower := by simpa only [hpx,hxp,Complex.ofReal_zero,zero_smul,sub_zero] using hx + upper := (initialSpectralInterval p x hx.isSelfAdjoint).upper } + have hI : I.lo ≤ I.hi := norm_nonneg x + obtain ⟨n,hn⟩ := I.exists_approximant hx.isSelfAdjoint hI ε hε + let e := (Fintype.equivFin (DyadicIndex n)).symm + refine ⟨I.partition hx.isSelfAdjoint n,fun i => (I.level hx.isSelfAdjoint n (e i)).lo,?_,?_,?_⟩ + · intro i + exact (I.level_endpoints hx.isSelfAdjoint hI n (e i)).1 + · intro i + exact I.partition_commutes hx.isSelfAdjoint (Commute.refl x) (hpx.trans hxp.symm) n i + · change ‖x-∑ i, ((I.level hx.isSelfAdjoint n (e i)).lo : ℂ) • + (I.level hx.isSelfAdjoint n (e i)).proj.val‖ < ε + rw [Equiv.sum_comp e (fun i => ((I.level hx.isSelfAdjoint n i).lo : ℂ) • + (I.level hx.isSelfAdjoint n i).proj.val)] + change ‖p.val*x*p.val-∑ i, ((I.level hx.isSelfAdjoint n i).lo : ℂ) • + (I.level hx.isSelfAdjoint n i).proj.val‖ < ε at hn + simpa only [hpx,hxp] using hn + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem IsDimensionSpectralValue.corner_bound + {x : M.toStarSubalgebra} {t : ℂ} (ht : IsDimensionSpectralValue hfactor hdiff x t) + (p : AlgebraProjection M) (hpx : Commute p.val x) + (Q : CornerPartition p) (c : Fin Q.size → ℂ) (hc : ∀ i, Commute (Q.piece i).val x) : + ‖t-∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)‖ ≤ + ‖x-∑ i, c i • (Q.piece i).val‖ := by + classical + let r : AlgebraProjection M := ⟨1-p.val,p.property.one_sub⟩ + let q : Fin Q.size ⊕ Unit → AlgebraProjection M := Sum.elim Q.piece (fun _ => r) + let d : Fin Q.size ⊕ Unit → ℂ := Sum.elim c (fun _ => 0) + have ho (i j : Fin Q.size ⊕ Unit) (h : i≠j) : (q i).val*(q j).val=0 := by + cases i with + | inl i => + cases j with + | inl j => exact Q.orthogonal i j (fun he => h (congrArg Sum.inl he)) + | inr j => + change (Q.piece i).val*(1-p.val)=0 + rw [mul_sub,mul_one,projection_mul_of_le (Q.piece_le i),sub_self] + | inr i => + cases j with + | inl j => + change (1-p.val)*(Q.piece j).val=0 + rw [sub_mul,one_mul,show p.val*(Q.piece j).val=(Q.piece j).val from Q.piece_le j,sub_self] + | inr j => exact (h (congrArg Sum.inr (Subsingleton.elim i j))).elim + have hs : (∑ i, (q i).val)=(1 : M.toStarSubalgebra) := by + simp only [q,Fintype.sum_sum_type,Sum.elim_inl,Sum.elim_inr,Fintype.sum_unique,Q.total] + change p.val+(1-p.val)=1 + abel + have hqc (i : Fin Q.size ⊕ Unit) : Commute (q i).val x := by + cases i with + | inl i => exact hc i + | inr i => exact (Commute.one_left x).sub_left hpx + have hh := ht.family_bound hfactor hdiff q ho hs d hqc + simpa only [q,d,Fintype.sum_sum_type,Sum.elim_inl,Sum.elim_inr,zero_mul,zero_smul, + Finset.sum_const_zero,add_zero] using hh + +end + +/-! Projection localization yields actual positive-operator inequalities for +bounded linear functionals, and a nearly cyclic functional on the corner. -/ +open scoped BigOperators CStarAlgebra +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance localizedCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance localizedOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance localizedPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance localizedLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance localizedStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem positive_functional_bounds_of_projection_bounds + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (φ : M.toStarSubalgebra →L[ℂ] ℂ) (E : AlgebraProjection M) + (a b : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) + (hproj : ∀ p : AlgebraProjection M, p ≤ E → + a*traceFreeDimension hfactor hdiff p ≤ (φ p.val).re ∧ + (φ p.val).re ≤ b*traceFreeDimension hfactor hdiff p) + (x : M.toStarSubalgebra) (hx : 0 ≤ x) (hEx : E.val*x=x) : + a*(dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint).re ≤ (φ x).re ∧ + (φ x).re ≤ b*(dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint).re := by + let t := dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint + have hxE : x*E.val=x := by + simpa only [star_mul,E.property.isSelfAdjoint.star_eq,hx.isSelfAdjoint.star_eq] + using congrArg star hEx + have happrox (ε : ℝ) (hε : 0<ε) : + a*t.re ≤ (φ x).re+ε ∧ (φ x).re ≤ b*t.re+ε := by + let C := a+b+‖φ‖+1 + have hC : 0 mul_le_mul_of_nonneg_left + (hproj (Q.piece i) (Q.piece_le i)).1 (hc i)) + have hvb : v ≤ b*w := by + rw [hv,show b*w=∑ i, c i*(b*traceFreeDimension hfactor hdiff (Q.piece i)) by + simp only [w,Finset.mul_sum]; apply Finset.sum_congr rfl; intro i _; ring] + exact Finset.sum_le_sum (fun i _ => mul_le_mul_of_nonneg_left + (hproj (Q.piece i) (Q.piece_le i)).2 (hc i)) + have hspec := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx.isSelfAdjoint).2.corner_bound + hfactor hdiff E (hEx.trans hxE.symm) Q (fun i => (c i : ℂ)) hQ + have htw : |t.re-w| ≤ δ := by + have h := Complex.abs_re_le_norm (t-(w : ℂ)) + rw [Complex.sub_re,Complex.ofReal_re] at h + apply h.trans + rw [hw] + exact hspec.trans herr.le + have hφ : |(φ x).re-v| ≤ ‖φ‖*δ := by + have he : (φ x).re-v=(φ (x-y)).re := by rw [map_sub,Complex.sub_re] + rw [he] + exact (Complex.abs_re_le_norm _).trans ((φ.le_opNorm _).trans + (mul_le_mul_of_nonneg_left herr.le (norm_nonneg φ))) + have htw' := abs_le.mp htw + have hφ' := abs_le.mp hφ + have had := mul_nonneg ha hδ.le + have hbd := mul_nonneg hb hδ.le + dsimp only [C] at hCδ + constructor <;> nlinarith + constructor + · apply le_of_forall_pos_le_add + intro ε hε + exact (happrox ε hε).1 + · apply le_of_forall_pos_le_add + intro ε hε + exact (happrox ε hε).2 + +/-- Concrete projection and positive-operator localization, with an actual +bounded complex-linear functional and a nonzero constructed corner. -/ +theorem exists_localized_vector_functional + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (ξ : H) (hξ : ‖ξ‖=1) (ε : ℝ) (hε : 0<ε) : + ∃ (E : AlgebraProjection M) (a : ℝ), E.val≠0 ∧ 0 hz' i)] at ht + exact hp ht.symm + +end EquivalentPartition + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfactor hdiff hfinite in +/-- Every actual finite equivalent partition has the expected base dimension. -/ +theorem EquivalentPartition.dimension_base + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {p : AlgebraProjection M} {ι : Type*} [Fintype ι] [Nonempty ι] + (E : EquivalentPartition p ι) : + traceFreeDimension hfactor hdiff E.base=traceFreeDimension hfactor hdiff p/Fintype.card ι := by + have he (i : ι) : traceFreeDimension hfactor hdiff (E.leg i).target= + traceFreeDimension hfactor hdiff E.base := + (traceFreeDyadicSup_equivalent hfactor hdiff ⟨1,IsStarProjection.one _⟩ + (show E.base.Equivalent (E.leg i).target from ⟨E.leg i,E.initial i,rfl⟩)).symm + have h := traceFreeDimension_sum_of_total hfactor hdiff hfinite hunit + (fun i => (E.leg i).target) E.orthogonal p E.total + simp only [he,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] at h + apply (eq_div_iff (by exact_mod_cast Fintype.card_ne_zero : (Fintype.card ι : ℝ)≠0)).mpr + linarith + +include hfactor hdiff hfinite in +/-- A partition of 1 with common initial projection inside any given nonzero E. -/ +theorem exists_equivalent_partition_base_le + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (E : AlgebraProjection M) (hE : E.val≠0) : + ∃ (n : ℕ) (_hn : 0 vectorFunctional (M := M) ((Q.leg i).val.val ξ)) + _ ≤ ∑ i, ‖(Q.leg i).val.val ξ‖^2 := + Finset.sum_le_sum (fun i _ => vectorFunctional_norm_le (M := M) ((Q.leg i).val.val ξ)) + +theorem matrixVectorFunctional_nearly_cyclic (Q : EquivalentPartition p ι) (hp : p.val=1) + (ξ : H) (ε : ℝ) + (hcorner : ∀ x : M.toStarSubalgebra, Q.base.val*x=x → x*Q.base.val=x → + (vectorFunctional ξ (star x*x)).re ≤ (1+ε)*(vectorFunctional ξ (x*star x)).re) + (x : M.toStarSubalgebra) : + (Q.matrixVectorFunctional ξ (star x*x)).re ≤ + (1+ε)*(Q.matrixVectorFunctional ξ (x*star x)).re := by + have hl : (Q.matrixVectorFunctional ξ (star x*x)).re= + ∑ i, ∑ j, (vectorFunctional ξ (star (Q.stateCoefficient x j i)*Q.stateCoefficient x j i)).re := by + rw [Q.matrixVectorFunctional_apply,Complex.re_sum] + apply Finset.sum_congr rfl + intro i _ + rw [Q.stateCoefficient_mul hp,map_sum,Complex.re_sum] + apply Finset.sum_congr rfl + intro j _ + rw [Q.stateCoefficient_star] + have hr : (Q.matrixVectorFunctional ξ (x*star x)).re= + ∑ i, ∑ j, (vectorFunctional ξ (Q.stateCoefficient x j i*star (Q.stateCoefficient x j i))).re := by + rw [Q.matrixVectorFunctional_apply,Complex.re_sum] + simp_rw [Q.stateCoefficient_mul hp,map_sum,Complex.re_sum] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + apply Finset.sum_congr rfl + intro i _ + rw [Q.stateCoefficient_star] + rw [hl,hr,Finset.mul_sum] + apply Finset.sum_le_sum + intro i _ + rw [Finset.mul_sum] + exact Finset.sum_le_sum (fun j _ => hcorner (Q.stateCoefficient x j i) + (Q.stateCoefficient_left x j i) (Q.stateCoefficient_right x j i)) + +end EquivalentPartition +end + +/-! Globally defined positive unital linear functionals with arbitrarily small multiplicative quadratic trace error. -/ +open scoped BigOperators CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance approxTraceCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance approxTraceOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance approxTracePreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance approxTraceLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance approxTraceStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfactor hdiff hfinite in +/-- A constructed approximate tracial state on the entire original algebra. -/ +theorem exists_approximately_tracial_state + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (ε : ℝ) (hε : 0<ε) : + ∃ φ : M.toStarSubalgebra →L[ℂ] ℂ, + ‖φ‖ ≤ 1 ∧ φ 1=1 ∧ (∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) ∧ + ∀ x : M.toStarSubalgebra, (φ (star x*x)).re ≤ (1+ε)*(φ (x*star x)).re := by + classical + obtain ⟨ξ,hξ⟩ := exists_unit_vector_of_unit_ne_zero hunit + obtain ⟨E,hE,hfaith,hcorner⟩ := exists_corner_nearly_cyclic_vector + hfactor hdiff hfinite hunit ξ hξ ε hε + obtain ⟨n,hn,Q,hQE,hQ⟩ := exists_equivalent_partition_base_le hfactor hdiff hfinite hunit E hE + have hbase : 0<(vectorFunctional ξ Q.base.val).re := hfaith Q.base hQE hQ + let A : ℝ := ∑ i, ‖(Q.leg i).val.val ξ‖^2 + have hi (i : Fin n) : ‖(Q.leg i).val.val ξ‖^2=(vectorFunctional ξ Q.base.val).re := by + have h := congrArg Complex.re (vectorFunctional_star_mul_self ξ (Q.leg i).val) + rw [(Q.leg i).initial,Q.initial] at h + exact_mod_cast h.symm + have hA : 0 vectorFunctional_positive _ x hx) + have hFtrace (x : M.toStarSubalgebra) : (F (star x*x)).re ≤ (1+ε)*(F (x*star x)).re := by + apply Q.matrixVectorFunctional_nearly_cyclic rfl ξ ε ?_ x + intro y hly hry + have hl : E.val*y=y := by + calc E.val*y = E.val*(Q.base.val*y) := by rw [hly] + _ = y := by rw [← mul_assoc,show E.val*Q.base.val=Q.base.val from hQE,hly] + have hr : y*E.val=y := by + calc y*E.val = (y*Q.base.val)*E.val := by rw [hry] + _ = y := by rw [mul_assoc,projection_mul_of_le hQE,hry] + exact hcorner y hl hr + let φ : M.toStarSubalgebra →L[ℂ] ℂ := ((A⁻¹ : ℝ) : ℂ) • F + have hφ (x : M.toStarSubalgebra) : (φ x).re=A⁻¹*(F x).re := by + simp only [φ,smul_apply,smul_eq_mul,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + refine ⟨φ,?_,?_,?_,?_⟩ + · change ‖((A⁻¹ : ℝ) : ℂ) • F‖ ≤ 1 + rw [norm_smul,Complex.norm_real,Real.norm_of_nonneg (inv_nonneg.mpr hA.le)] + exact (mul_le_mul_of_nonneg_left hFnorm (inv_nonneg.mpr hA.le)).trans_eq (inv_mul_cancel₀ hA.ne') + · change ((A⁻¹ : ℝ) : ℂ)*(F 1)=1 + rw [hF1,← Complex.ofReal_mul,inv_mul_cancel₀ hA.ne',Complex.ofReal_one] + · intro x hx + rw [hφ] + exact mul_nonneg (inv_nonneg.mpr hA.le) (hFpos x hx) + · intro x + rw [hφ,hφ] + have h := mul_le_mul_of_nonneg_left (hFtrace x) (inv_nonneg.mpr hA.le) + calc A⁻¹*(F (star x*x)).re ≤ A⁻¹*((1+ε)*(F (x*star x)).re) := h + _ = (1+ε)*(A⁻¹*(F (x*star x)).re) := by ring + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/LongWords.lean b/lean/OAI/Analysis/FactorGeneration/LongWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..3c5200b7b7df1537f09e4aaa84baa78917409c45 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/LongWords.lean @@ -0,0 +1,453 @@ +import Mathlib.Algebra.BigOperators.Fin +import OAI.Analysis.FactorGeneration.Coefficients +import OAI.Analysis.FactorGeneration.Convolution +import OAI.Analysis.FactorGeneration.Exponential +import OAI.Analysis.FactorGeneration.Words + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Factorial coefficient majorization in every homogeneous degree. -/ +section +open scoped BigOperators +open Generator.CoefficientOrder +variable {G : Type*} [Monoid G] + +@[simp] theorem normCoefficients_zero : normCoefficients (0 : MonoidAlgebra ℂ G) = 0 := by + ext w; simp + +@[simp] theorem normCoefficients_one : normCoefficients (1 : MonoidAlgebra ℂ G) = 1 := by + classical + ext w + simp only [normCoefficients_apply, MonoidAlgebra.one_def, MonoidAlgebra.coeff_single, + Finsupp.single_apply] + split_ifs <;> norm_num + +omit [Monoid G] in +@[simp] theorem normCoefficients_single (g : G) (c : ℂ) : + normCoefficients (MonoidAlgebra.single g c) = MonoidAlgebra.single g ‖c‖ := by + classical + ext w + simp only [normCoefficients_apply, MonoidAlgebra.coeff_single, Finsupp.single_apply] + split_ifs <;> simp + +theorem normCoefficients_sub_le (f g : MonoidAlgebra ℂ G) : + normCoefficients (f - g) ≤ normCoefficients f + normCoefficients g := by + intro w + simpa using norm_sub_le (f.coeff w) (g.coeff w) + +theorem normCoefficients_sum_le {I : Type*} (s : Finset I) (f : I → MonoidAlgebra ℂ G) : + normCoefficients (∑ i ∈ s, f i) ≤ ∑ i ∈ s, normCoefficients (f i) := by + classical + induction s using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + simp only [Finset.sum_insert hi] + exact le_trans (normCoefficients_add_le _ _) (add_le_add le_rfl ih) + +theorem normCoefficients_pow_le (b : MonoidAlgebra ℂ G) (a : MonoidAlgebra ℝ G) + (ha : 0 ≤ a) (hb : normCoefficients b ≤ a) (d : ℕ) : + normCoefficients (b ^ d) ≤ a ^ d := by + induction d with + | zero => simp + | succ d ih => + rw [pow_succ, pow_succ] + exact le_trans (normCoefficients_mul_le _ _) + (mul_le_mul ih hb (fun w => normCoefficients_nonnegative b w) (pow_nonneg ha d)) + +theorem normCoefficients_real_smul (r : ℝ) (hr : 0 ≤ r) (b : MonoidAlgebra ℂ G) : + normCoefficients (r • b) = r • normCoefficients b := by + ext w + simp [Real.norm_eq_abs, abs_of_nonneg hr] + +/-- Original-degree factorial terms are bounded by nondecreasing row words. -/ +theorem exponentialDegree_le_orderedWords + (rows : List (MonoidAlgebra ℂ G × MonoidAlgebra ℝ G)) + (h : ∀ row ∈ rows, 0 ≤ row.2 ∧ normCoefficients row.1 ≤ row.2) (d : ℕ) : + normCoefficients (exponentialDegree (rows.map Prod.fst) d) ≤ + orderedWords (rows.map Prod.snd) d := by + induction rows generalizing d with + | nil => + cases d <;> simp [exponentialDegree] + | cons row rows ih => + have hr := h row (by simp) + have ht : ∀ r ∈ rows, 0 ≤ r.2 ∧ normCoefficients r.1 ≤ r.2 := + fun r hm => h r (by simp [hm]) + have hp : ∀ a ∈ rows.map Prod.snd, 0 ≤ a := by + intro a ha + obtain ⟨r, hm, rfl⟩ := List.mem_map.mp ha + exact (ht r hm).1 + simp only [List.map_cons, exponentialDegree] + rw [orderedWords_cons] + apply (normCoefficients_sum_le _ _).trans + apply Finset.sum_le_sum + intro k _ + have hw0 : 0 ≤ (k.factorial : ℝ)⁻¹ := by positivity + have hw1 : (k.factorial : ℝ)⁻¹ ≤ 1 := by + apply inv_le_one_of_one_le₀ + exact_mod_cast Nat.factorial_pos k + have hpow := normCoefficients_pow_le row.1 row.2 hr.1 hr.2 k + have hfactor : normCoefficients ((k.factorial : ℝ)⁻¹ • row.1 ^ k) ≤ row.2 ^ k := by + rw [normCoefficients_real_smul _ hw0] + intro w + change (k.factorial : ℝ)⁻¹ * ‖(row.1 ^ k).coeff w‖ ≤ (row.2 ^ k).coeff w + exact (mul_le_mul_of_nonneg_left (hpow w) hw0).trans + (by simpa using mul_le_mul_of_nonneg_right hw1 ((pow_nonneg hr.1 k) w)) + exact le_trans (normCoefficients_mul_le _ _) + (mul_le_mul hfactor (ih ht (d - k)) + (fun w => normCoefficients_nonnegative _ w) (pow_nonneg hr.1 k)) + +/-- The source's full coefficient inequality, for arbitrary monoids and all d. +The sum on the right is the actual collected convolution power. -/ +theorem exponentialDegree_coefficient_majorization + (rows : List (MonoidAlgebra ℂ G × MonoidAlgebra ℝ G)) + (h : ∀ row ∈ rows, 0 ≤ row.2 ∧ normCoefficients row.1 ≤ row.2) (d : ℕ) : + normCoefficients (exponentialDegree (rows.map Prod.fst) d) ≤ + (rows.map Prod.snd).sum ^ d := by + apply (exponentialDegree_le_orderedWords rows h d).trans + apply orderedWords_le_sum_pow + intro a ha + obtain ⟨r, hm, rfl⟩ := List.mem_map.mp ha + exact (h r hm).1 + +end + +/-! The nonlinear remainder of the actual ordered convolution-operator +exponentials, evaluated at δ₁, without assumed degree estimates. -/ +section +open scoped BigOperators +open Generator.CoefficientOrder Generator.FreeConvolution +variable {A : Type*} +local notation "H" => SquareSpace (FreeGroup A) +local notation "Op" => H →L[ℂ] H + +/-- All original-degree bounds follow from coefficient majorization and the +norm of the positive total convolution operator. -/ +theorem free_exponentialDegree_bound + (rows : List (MonoidAlgebra ℂ (FreeGroup A) × MonoidAlgebra ℝ (FreeGroup A))) + (h : ∀ row ∈ rows, 0 ≤ row.2 ∧ normCoefficients row.1 ≤ row.2) (d : ℕ) : + ‖regular (exponentialDegree (rows.map Prod.fst) d) delta‖ ≤ + ‖realRegular (rows.map Prod.snd).sum‖ ^ d := by + exact (regular_delta_norm_le (exponentialDegree_coefficient_majorization rows h d)).trans + (realRegular_pow_delta_norm_le _ d) + +/-- Actual nonlinear remainder. The positive total's norm bound is the only +analytic bound required; no degree-bound or series-sum hypothesis is assumed. -/ +theorem free_exponential_product_remainder + (rows : List (MonoidAlgebra ℂ (FreeGroup A) × MonoidAlgebra ℝ (FreeGroup A))) + (h : ∀ row ∈ rows, 0 ≤ row.2 ∧ normCoefficients row.1 ≤ row.2) + {α : ℝ} (hα : 0 < α) (hhalf : α < 1 / 2) + (hbound : ‖realRegular (rows.map Prod.snd).sum‖ ≤ 2 * α) : + ‖((rows.map (fun r => NormedSpace.exp (regular r.1))).prod - 1 - + (rows.map (fun r => regular r.1)).sum) delta‖ ≤ 4 * α ^ 2 / (1 - 2 * α) := by + let xs : List Op := rows.map (fun r => regular r.1) + let coeff : ℕ → H := fun d => exponentialDegree xs d delta + have hsum : HasSum coeff ((xs.map NormedSpace.exp).prod delta) := by + exact (exponentialDegree_hasSum xs).map + (ContinuousLinearMap.apply ℂ H delta).toAddMonoidHom + (ContinuousLinearMap.apply ℂ H delta).continuous + have hid (d : ℕ) : exponentialDegree xs d = + regular (exponentialDegree (rows.map Prod.fst) d) := by + simpa [xs, List.map_map, Function.comp_def] using + (exponentialDegree_map (regular.restrictScalars ℝ) (rows.map Prod.fst) d).symm + have hdegree (d : ℕ) : ‖coeff d‖ ≤ (2 * α) ^ d := by + change ‖exponentialDegree xs d delta‖ ≤ _ + rw [hid] + exact (free_exponentialDegree_bound rows h d).trans + (pow_le_pow_left₀ (norm_nonneg _) hbound d) + have ht := perturbation_remainder_from_degree_bounds hα hhalf coeff hsum + (fun n => hdegree (n + 2)) + simpa [coeff, xs, List.map_map, Function.comp_def, sub_apply] using ht + +end + +/-! Signed rows B_k and positive rows A_k with free basis indexed by prefix ratios in FreeGroup Nat. -/ +section +open scoped BigOperators +open Generator.CoefficientOrder Generator.FreeConvolution +local notation "G" => FreeGroup ℕ +local notation "F" => FreeGroup G +local instance : DecidableEq G := Classical.decEq _ +local instance : DecidableEq F := Classical.decEq _ + +def positiveLetterPair (p : G) : MonoidAlgebra ℝ F := + MonoidAlgebra.single (letter (p, true)) 1 + MonoidAlgebra.single (letter (p, false)) 1 + +def negativeLetterPair (p : G) : MonoidAlgebra ℂ F := + MonoidAlgebra.single (letter (p, true)) 1 - MonoidAlgebra.single (letter (p, false)) 1 + +def perturbationRow {n : ℕ} (α : ℝ) (k : Fin n) : MonoidAlgebra ℂ F × MonoidAlgebra ℝ F := + ((α / (2 * n)) • ∑ j : Fin n, negativeLetterPair (pairRatio (k, j)), + (α / (2 * n)) • ∑ j : Fin n, positiveLetterPair (pairRatio (k, j))) + +def perturbationRows (n : ℕ) (α : ℝ) : + List (MonoidAlgebra ℂ F × MonoidAlgebra ℝ F) := List.ofFn (perturbationRow (n := n) α) + +theorem positiveLetterPair_nonnegative (p : G) : 0 ≤ positiveLetterPair p := by + intro w + simp only [positiveLetterPair, MonoidAlgebra.coeff_add, Finsupp.add_apply, + MonoidAlgebra.coeff_single, Finsupp.single_apply] + split_ifs <;> norm_num + +theorem negativeLetterPair_dominated (p : G) : + normCoefficients (negativeLetterPair p) ≤ positiveLetterPair p := by + simpa [negativeLetterPair, positiveLetterPair] using + normCoefficients_sub_le (MonoidAlgebra.single (letter (p, true)) 1) + (MonoidAlgebra.single (letter (p, false)) 1) + +/-- Positivity and domination are proved for the source rows, not assumed. -/ +theorem perturbationRows_dominated (n : ℕ) (α : ℝ) (hα : 0 ≤ α) : + ∀ row ∈ perturbationRows n α, 0 ≤ row.2 ∧ normCoefficients row.1 ≤ row.2 := by + intro row hr + obtain ⟨k, rfl⟩ := List.mem_ofFn.mp (show row ∈ List.ofFn (perturbationRow (n := n) α) from hr) + have hc : 0 ≤ α / (2 * n) := by positivity + have hp : 0 ≤ ∑ j : Fin n, positiveLetterPair (pairRatio (k, j)) := + Finset.sum_nonneg (fun j _ => positiveLetterPair_nonnegative _) + constructor + · intro w + change 0 ≤ α / (2 * n) * (∑ j : Fin n, positiveLetterPair (pairRatio (k, j))).coeff w + exact mul_nonneg hc (hp w) + · change normCoefficients ((α / (2 * n)) • _) ≤ (α / (2 * n)) • _ + rw [normCoefficients_real_smul _ hc] + have hb : normCoefficients (∑ j : Fin n, negativeLetterPair (pairRatio (k, j))) ≤ + ∑ j : Fin n, positiveLetterPair (pairRatio (k, j)) := + (normCoefficients_sum_le _ _).trans + (Finset.sum_le_sum (fun j _ => negativeLetterPair_dominated _)) + intro w + exact mul_le_mul_of_nonneg_left (hb w) hc + +/-- Exact regrouping of the ordered-pair sum using the proved fiber counts. -/ +theorem pairRatio_sum_multiplicity {R : Type*} [AddCommMonoid R] + (n : ℕ) (hn : 0 < n) (f : G → R) : + (∑ k : Fin n, ∑ j : Fin n, f (pairRatio (k, j))) = + ∑ p ∈ ratioLabels n, multiplicity n p • f p := by + have hm : ∀ ij ∈ (Finset.univ : Finset (Fin n × Fin n)), pairRatio ij ∈ ratioLabels n := by + intro ij _ + rw [ratioLabels_eq_image hn] + exact Finset.mem_image.mpr ⟨ij, Finset.mem_univ _, rfl⟩ + have h := Finset.sum_fiberwise_of_maps_to' hm f + simpa [multiplicity, Fintype.sum_prod_type] using h.symm + +/-- The sum of the source's positive rows is exactly its collected coefficient +family, including the n copies of the identity prefix ratio. -/ +theorem perturbationRows_positive_total (n : ℕ) (hn : 0 < n) (α : ℝ) : + (perturbationRows n α |>.map Prod.snd).sum = + (α / (2 * n)) • ∑ p ∈ ratioLabels n, multiplicity n p • positiveLetterPair p := by + simp only [perturbationRows, List.map_ofFn, List.sum_ofFn, Function.comp_def, perturbationRow] + rw [← Finset.smul_sum, pairRatio_sum_multiplicity n hn] + +/-- Identification of λ(A) with the signed-letter operator already bounded. -/ +theorem perturbationRows_total_operator (n : ℕ) (hn : 0 < n) (α : ℝ) : + realRegular (perturbationRows n α |>.map Prod.snd).sum = + ∑ a ∈ prefixLetterSupport n, (prefixWeight n α a : ℂ) • leftRegular (letter a) := by + rw [perturbationRows_positive_total n hn] + simp only [map_smul, map_sum, map_nsmul, Finset.smul_sum] + simp only [prefixLetterSupport, Finset.product_eq_sprod, prefixWeight, + Finset.sum_product, Fintype.sum_bool] + apply Finset.sum_congr rfl + intro p _ + simp [positiveLetterPair, realRegular, MonoidAlgebra.lift_single, leftRegularHom, + smul_add] + simp only [← nsmul_eq_mul, ← Nat.cast_smul_eq_nsmul ℝ, smul_smul] + norm_cast + +/-- Uniform all-degree bound for the manuscript's literal formal rows. -/ +theorem perturbationRows_degree_bound (n : ℕ) (hn : 0 < n) + (α : ℝ) (hα : 0 ≤ α) (d : ℕ) : + ‖regular (exponentialDegree (perturbationRows n α |>.map Prod.fst) d) delta‖ ≤ + (2 * α) ^ d := by + apply (free_exponentialDegree_bound _ (perturbationRows_dominated n α hα) d).trans + apply pow_le_pow_left₀ (norm_nonneg _) + rw [perturbationRows_total_operator n hn] + exact prefix_convolution_operator_bound n hn α hα + +/-- The source's nonlinear estimate on the actual regular representation, +with its exact rows and constants, for every positive word length. -/ +theorem perturbationRows_remainder (n : ℕ) (hn : 0 < n) + (α : ℝ) (hα : 0 < α) (hhalf : α < 1 / 2) : + ‖((perturbationRows n α |>.map (fun r => NormedSpace.exp (regular r.1))).prod - 1 - + (perturbationRows n α |>.map (fun r => regular r.1)).sum) delta‖ ≤ + 4 * α ^ 2 / (1 - 2 * α) := by + apply free_exponential_product_remainder _ (perturbationRows_dominated n α hα.le) hα hhalf + rw [perturbationRows_total_operator n hn] + exact prefix_convolution_operator_bound n hn α hα.le + +end + +/-! Transfer of the nonlinear estimate to an algebra with a continuous Hilbert +realization and orthonormal reduced-word images, without an independence hypothesis. -/ +section +open scoped BigOperators InnerProductSpace +open Generator.FreeConvolution +variable {B E : Type*} [NormedRing B] [NormedAlgebra ℂ B] [CompleteSpace B] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] +local notation "F" => FreeGroup (FreeGroup ℕ) + +/-- The literal source remainder in any continuous Hilbert realization whose +reduced-word images are orthonormal. -/ +theorem perturbationRows_remainder_transfer + (Φ : MonoidAlgebra ℂ F →ₐ[ℂ] B) (ι : B →L[ℂ] E) + (horth : Orthonormal ℂ (fun g => ι (Φ (MonoidAlgebra.single g 1)))) + (n : ℕ) (hn : 0 < n) (α : ℝ) (hα : 0 < α) (hhalf : α < 1 / 2) : + ‖ι ((perturbationRows n α |>.map (fun r => NormedSpace.exp (Φ r.1))).prod - + 1 - (perturbationRows n α |>.map (fun r => Φ r.1)).sum)‖ ≤ + 4 * α ^ 2 / (1 - 2 * α) := by + let xs : List B := (perturbationRows n α).map (fun r => Φ r.1) + let coeff : ℕ → E := fun d => ι (exponentialDegree xs d) + have hsum : HasSum coeff (ι (xs.map NormedSpace.exp).prod) := + (exponentialDegree_hasSum xs).map ι.toAddMonoidHom ι.continuous + have hbound : ‖realRegular (perturbationRows n α |>.map Prod.snd).sum‖ ≤ 2 * α := by + rw [perturbationRows_total_operator n hn] + exact prefix_convolution_operator_bound n hn α hα.le + have hid (d : ℕ) : exponentialDegree xs d = + Φ (exponentialDegree (perturbationRows n α |>.map Prod.fst) d) := by + simpa [xs, List.map_map, Function.comp_def] using + (exponentialDegree_map (Φ.restrictScalars ℝ) (perturbationRows n α |>.map Prod.fst) d).symm + have hdegree (d : ℕ) : ‖coeff d‖ ≤ (2 * α) ^ d := by + change ‖ι (exponentialDegree xs d)‖ ≤ _ + rw [hid] + have hiso := groupRing_norm_eq_regular (ι.toLinearMap.comp Φ.toLinearMap) horth + (exponentialDegree (perturbationRows n α |>.map Prod.fst) d) + change ‖ι (Φ (exponentialDegree (perturbationRows n α |>.map Prod.fst) d))‖ = _ at hiso + rw [hiso] + exact (free_exponentialDegree_bound (perturbationRows n α) + (perturbationRows_dominated n α hα.le) d).trans + (pow_le_pow_left₀ (norm_nonneg _) hbound d) + have ht := perturbation_remainder_from_degree_bounds hα hhalf coeff hsum + (fun k => hdegree (k + 2)) + simpa [coeff, xs, List.map_map, Function.comp_def, map_sub] using ht + +end + +/-! The exact finite free basis and its injective realization in a countable free basis. -/ +section +open scoped BigOperators +open Generator.FreeConvolution +local notation "G" => FreeGroup ℕ +local notation "F" => FreeGroup G +local instance : DecidableEq G := Classical.decEq _ + +/-- The manuscript's finite set S, including the identity prefix ratio as a label. -/ +def PrefixLabel (n : ℕ) := {p : G // p ∈ ratioLabels n} + +def pairLabel {n : ℕ} (k j : Fin n) : PrefixLabel n := + ⟨pairRatio (k, j), by + rw [ratioLabels_eq_image (Nat.zero_lt_of_lt k.isLt)] + exact Finset.mem_image.mpr ⟨(k, j), Finset.mem_univ _, rfl⟩⟩ + +def prefixWordEmbedding (n : ℕ) : FreeGroup (PrefixLabel n) →* F := + FreeGroup.map Subtype.val + +theorem prefixWordEmbedding_injective (n : ℕ) : Function.Injective (prefixWordEmbedding n) := + FreeGroup.map_injective Subtype.val_injective + +def prefixRingEmbedding (n : ℕ) : MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) →ₐ[ℂ] + MonoidAlgebra ℂ F := MonoidAlgebra.mapDomainAlgHom ℂ ℂ (prefixWordEmbedding n) + +@[simp] theorem prefixRingEmbedding_single (n : ℕ) (g : FreeGroup (PrefixLabel n)) (c : ℂ) : + prefixRingEmbedding n (MonoidAlgebra.single g c) = + MonoidAlgebra.single (prefixWordEmbedding n g) c := by + exact MonoidAlgebra.mapDomain_single + +/-- Literal B_k in the free group on the finite label set S. -/ +def finitePerturbationRow {n : ℕ} (α : ℝ) (k : Fin n) : + MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) := + (α / (2 * n)) • ∑ j : Fin n, + (MonoidAlgebra.single (FreeGroup.of (pairLabel k j)) 1 - + MonoidAlgebra.single ((FreeGroup.of (pairLabel k j))⁻¹) 1) + +def finitePerturbationRows (n : ℕ) (α : ℝ) := + List.ofFn (finitePerturbationRow (n := n) α) + +@[simp] theorem finitePerturbationRow_embed {n : ℕ} (α : ℝ) (k : Fin n) : + prefixRingEmbedding n (finitePerturbationRow α k) = (perturbationRow α k).1 := by + have hs (c : ℝ) (f : MonoidAlgebra ℂ (FreeGroup (PrefixLabel n))) : + prefixRingEmbedding n (c • f) = c • prefixRingEmbedding n f := + map_smul ((prefixRingEmbedding n).restrictScalars ℝ).toLinearMap c f + simp only [finitePerturbationRow, perturbationRow, hs, map_sum, map_sub, + prefixRingEmbedding_single] + congr 1 + +theorem finitePerturbationRows_embed (n : ℕ) (α : ℝ) : + (finitePerturbationRows n α).map (prefixRingEmbedding n) = + (perturbationRows n α).map Prod.fst := by + simp [finitePerturbationRows, perturbationRows, List.map_ofFn, Function.comp_def] + +def embeddedCoefficientMap (n : ℕ) : + MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) →ₗ[ℂ] SquareSpace F := + (ContinuousLinearMap.apply ℂ (SquareSpace F) delta).toLinearMap.comp + (regular.toLinearMap.comp (prefixRingEmbedding n).toLinearMap) + +theorem embeddedCoefficientMap_orthonormal (n : ℕ) : + Orthonormal ℂ (fun g => embeddedCoefficientMap n (MonoidAlgebra.single g 1)) := by + have h := regular_delta_orthonormal.comp (prefixWordEmbedding n) (prefixWordEmbedding_injective n) + simpa [embeddedCoefficientMap, LinearMap.comp_apply, Function.comp_def] using h + +/-- All-degree estimate on the exact finite formal group F_S. -/ +theorem finitePerturbationRows_degree_bound (n : ℕ) (hn : 0 < n) + (α : ℝ) (hα : 0 ≤ α) (d : ℕ) : + ‖embeddedCoefficientMap n (exponentialDegree (finitePerturbationRows n α) d)‖ ≤ + (2 * α) ^ d := by + change ‖regular (prefixRingEmbedding n (exponentialDegree (finitePerturbationRows n α) d)) delta‖ ≤ _ + have hmap := exponentialDegree_map ((prefixRingEmbedding n).restrictScalars ℝ) + (finitePerturbationRows n α) d + change prefixRingEmbedding n (exponentialDegree (finitePerturbationRows n α) d) = + exponentialDegree ((finitePerturbationRows n α).map (prefixRingEmbedding n)) d at hmap + rw [hmap, finitePerturbationRows_embed] + exact perturbationRows_degree_bound n hn α hα d + +end + +/-! Exact finite-basis version of the source's nonlinear estimate. Unlike the +ambient transport lemma, only reduced words in F_S occur in the hypothesis. -/ +open scoped BigOperators InnerProductSpace +variable {B E : Type*} [NormedRing B] [NormedAlgebra ℂ B] [CompleteSpace B] +variable [NormedAddCommGroup E] [InnerProductSpace ℂ E] + +/-- Remainder bounds in a continuous Hilbert realization of the finite free group with orthonormal word images. -/ +theorem finite_prefix_remainder_transfer (n : ℕ) (hn : 0 < n) + (Φ : MonoidAlgebra ℂ (FreeGroup (PrefixLabel n)) →ₐ[ℂ] B) (ι : B →L[ℂ] E) + (horth : Orthonormal ℂ (fun g => ι (Φ (MonoidAlgebra.single g 1)))) + (α : ℝ) (hα : 0 < α) (hhalf : α < 1 / 2) : + ‖ι ((finitePerturbationRows n α |>.map (fun r => NormedSpace.exp (Φ r))).prod - + 1 - (finitePerturbationRows n α |>.map Φ).sum)‖ ≤ + 4 * α ^ 2 / (1 - 2 * α) := by + let xs : List B := (finitePerturbationRows n α).map Φ + let coeff : ℕ → E := fun d => ι (exponentialDegree xs d) + have hsum : HasSum coeff (ι (xs.map NormedSpace.exp).prod) := + (exponentialDegree_hasSum xs).map ι.toAddMonoidHom ι.continuous + have hid (d : ℕ) : exponentialDegree xs d = + Φ (exponentialDegree (finitePerturbationRows n α) d) := by + exact (exponentialDegree_map (Φ.restrictScalars ℝ) _ d).symm + have hdegree (d : ℕ) : ‖coeff d‖ ≤ (2 * α) ^ d := by + change ‖ι (exponentialDegree xs d)‖ ≤ _ + rw [hid] + have hiso := groupRing_norm_eq_of_orthonormal (ι.toLinearMap.comp Φ.toLinearMap) + (embeddedCoefficientMap n) horth (embeddedCoefficientMap_orthonormal n) + (exponentialDegree (finitePerturbationRows n α) d) + change ‖ι (Φ (exponentialDegree (finitePerturbationRows n α) d))‖ = _ at hiso + rw [hiso] + exact finitePerturbationRows_degree_bound n hn α hα.le d + have ht := perturbation_remainder_from_degree_bounds hα hhalf coeff hsum + (fun k => hdegree (k + 2)) + simpa [coeff, xs, List.map_map, Function.comp_def, map_sub] using ht + +/-- The unconditional finite-free-group remainder, on the actual left regular +representation of exactly F_S and for every positive word length. -/ +theorem finite_prefix_regular_remainder (n : ℕ) (hn : 0 < n) + (α : ℝ) (hα : 0 < α) (hhalf : α < 1 / 2) : + ‖((finitePerturbationRows n α |>.map (fun r => NormedSpace.exp (FreeConvolution.regular r))).prod - + 1 - (finitePerturbationRows n α |>.map FreeConvolution.regular).sum) + FreeConvolution.delta‖ ≤ 4 * α ^ 2 / (1 - 2 * α) := by + exact finite_prefix_remainder_transfer n hn FreeConvolution.regular + (ContinuousLinearMap.apply ℂ (SquareSpace (FreeGroup (PrefixLabel n))) FreeConvolution.delta) + FreeConvolution.regular_delta_orthonormal α hα hhalf + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Main.lean b/lean/OAI/Analysis/FactorGeneration/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..cb864e7290dcce253f962970fb75ebb510e52a3e --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Main.lean @@ -0,0 +1,47 @@ +import OAI.Analysis.FactorGeneration.Generation +import OAI.Analysis.FactorGeneration.PredualContinuity +import OAI.Analysis.FactorGeneration.TraceTransport + +namespace OAI + +namespace Generator + +/-! Single generation of a finite diffuse factor with a separable Banach predual, +using its faithful normal trace and given-predual continuity. -/ +noncomputable section +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem single_generation_of_II1_separable_predual + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) + (hsep : HasSeparablePredual S) : SinglyGenerated S := by + let M := vonNeumannOfWOTClosed S hS.weaklyClosed + have hf : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + obtain ⟨z, hz⟩ := hS.factor c hc + exact ⟨z, hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + have hunit : (1 : M.toStarSubalgebra) ≠ 0 := by + intro h + exact hS.nonzero (congrArg Subtype.val h).symm + let E := Tracial.TraceFreePreHilbert hf hS.diffuse hS.finite hunit + let : NormedAddCommGroup E := + Tracial.traceFreePreHilbertNormedAddCommGroup hf hS.diffuse hS.finite hunit + let : InnerProductSpace ℂ E := + Tracial.traceFreePreHilbertInnerProductSpace hf hS.diffuse hS.finite hunit + let N := Tracial.traceFreeHilbertClosure hf hS.diffuse hS.finite hunit + let τ := Tracial.traceFreeHilbertClosureTrace hf hS.diffuse hS.finite hunit + have hN := Tracial.traceFreeHilbertClosure_isII1Factor hf hS.diffuse hS.finite hunit + have hpre := Tracial.traceFreeHilbertClosure_hasSeparablePredual hf hS.diffuse hS.finite hunit hsep + have htrace := Tracial.traceOrbit_isSeparable_of_separablePredual τ hpre + exact Tracial.traceFreeHilbert_singlyGenerated_pullback hf hS.diffuse hS.finite hunit + (Tracial.singlyGenerated_of_tracialRepresentation hN τ htrace) + +theorem mainTarget : @MainTarget H _ _ _ := + single_generation_of_II1_separable_predual + +end + +end Generator + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixAlgebras.lean b/lean/OAI/Analysis/FactorGeneration/MatrixAlgebras.lean new file mode 100644 index 0000000000000000000000000000000000000000..2b7e2cebcac4ebf3d72d61a06028a8ffbafcf0b5 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixAlgebras.lean @@ -0,0 +1,601 @@ +import Mathlib.Analysis.SpecialFunctions.Complex.CircleAddChar +import Mathlib.LinearAlgebra.Matrix.Trace +import OAI.Analysis.FactorGeneration.MatrixUnits +import OAI.Analysis.FactorGeneration.ProjectionComparison +import OAI.Analysis.FactorGeneration.SpectralApproximation + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Equal-trace finite partitions extend to actual matrix units in the same +factor. The theorem also retains a prescribed corner as the sum of diagonals. -/ +open scoped BigOperators +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + +include hfactor in +theorem exists_matrixUnits_for_partition {p : AlgebraProjection M} + (Q : CornerPartition p) (hn : 0 < Q.size) + (ht : ∀ i j, τ.trace (Q.piece i).val=τ.trace (Q.piece j).val) : + ∃ E : Fin Q.size → Fin Q.size → M.toStarSubalgebra, + (∀ i, E i i=(Q.piece i).val) ∧ + (∀ i j, star (E i j)=E j i) ∧ + (∀ i j k l, E i j*E k l=if j=k then E i l else 0) ∧ + (∑ i, E i i)=p.val := by + classical + let o : Fin Q.size := ⟨0,hn⟩ + have hv : ∀ i, ∃ v : M.toStarSubalgebra, + star v*v=(Q.piece o).val ∧ v*star v=(Q.piece i).val := fun i => + exists_partialIsometry_of_trace_eq τ hfactor (Q.piece o) (Q.piece i) (ht o i) + choose v hvi hvf using hv + let V (i : Fin Q.size) : PartialIsometry M := ⟨Q.piece o,v i,hvi i⟩ + have htarget (i : Fin Q.size) : (V i).target=Q.piece i := Subtype.ext (hvf i) + have hcross (i j : Fin Q.size) (hij : i≠j) : star (v i)*v j=0 := by + exact (V i).adjoint.mul_eq_zero (V j) (by + change (V i).target.val*(V j).target.val=0 + rw [htarget,htarget] + exact Q.orthogonal i j hij) + let E (i j : Fin Q.size) := v i*star (v j) + refine ⟨E,hvf,?_,?_,?_⟩ + · intro i j + simp only [E,star_mul,star_star] + · intro i j k l + by_cases hjk : j=k + · subst k + rw [ite_eq_left rfl] + change (v i*star (v j))*(v j*star (v l))=v i*star (v l) + calc _ = (v i*(star (v j)*v j))*star (v l) := by simp only [mul_assoc] + _ = v i*star (v l) := by + rw [hvi,show v i*(Q.piece o).val=v i from (V i).mul_support] + · rw [ite_eq_right hjk] + change (v i*star (v j))*(v k*star (v l))=0 + calc _ = (v i*(star (v j)*v k))*star (v l) := by simp only [mul_assoc] + _ = 0 := by rw [hcross j k hjk,mul_zero,zero_mul] + · simpa only [E,hvf] using Q.total + +end Tracial + +/-! The matrix-unit image in the original represented algebra, with its +finite dimensionality and weak-operator closedness proved. -/ +open scoped BigOperators +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} {ι : Type*} [Fintype ι] [DecidableEq ι] +namespace MatrixUnitSystem +variable (E : Generator.MatrixUnitSystem ι M.toStarSubalgebra) + +def concreteHom : Matrix ι ι ℂ →⋆ₐ[ℂ] (H →L[ℂ] H) := + M.toStarSubalgebra.subtype.comp E.hom + +def concreteAlgebra : StarSubalgebra ℂ (H →L[ℂ] H) := E.concreteHom.range + +theorem concreteAlgebra_le : E.concreteAlgebra ≤ M.toStarSubalgebra := by + rintro x ⟨a,rfl⟩ + exact (E.hom a).property + +theorem mem_concreteAlgebra (x : M.toStarSubalgebra) : + x.val ∈ E.concreteAlgebra ↔ x ∈ E.algebra := by + constructor + · rintro ⟨a,ha⟩ + exact ⟨a,Subtype.ext ha⟩ + · rintro ⟨a,ha⟩ + exact ⟨a,congrArg Subtype.val ha⟩ + +instance concrete_finiteDimensional : FiniteDimensional ℂ E.concreteAlgebra := by + change FiniteDimensional ℂ E.concreteHom.toAlgHom.range + exact FiniteDimensional.of_surjective E.concreteHom.toAlgHom.rangeRestrict.toLinearMap + E.concreteHom.toAlgHom.rangeRestrict_surjective + +def wotLinearMap : Matrix ι ι ℂ →ₗ[ℂ] (H →WOT[ℂ] H) := + (ContinuousLinearMap.WOTofCLM.toLinearMap).comp E.concreteHom.toAlgHom.toLinearMap + +theorem concreteAlgebra_wotClosed : WOTClosed E.concreteAlgebra := by + have heq : {T : H →WOT[ℂ] H | T.toCLM ∈ E.concreteAlgebra} = + (E.wotLinearMap.range : Set (H →WOT[ℂ] H)) := by + ext T + constructor + · rintro ⟨a,ha⟩ + exact ⟨a, congrArg ContinuousLinearMapWOT.ofCLM ha⟩ + · rintro ⟨a,ha⟩ + exact ⟨a,congrArg ContinuousLinearMapWOT.toCLM ha⟩ + unfold WOTClosed + rw [heq] + exact E.wotLinearMap.range.closed_of_finiteDimensional + +theorem concreteHom_injective (o : ι) (ho : E.entry o o ≠ 0) : + Function.Injective E.concreteHom := + Subtype.val_injective.comp (E.hom_injective o ho) + +end MatrixUnitSystem + +namespace Tracial +theorem exists_matrixAlgebra_for_unit_partition (τ : TracialRepresentation M) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (Q : CornerPartition (identityProjection M)) (hn : 0 < Q.size) + (ht : ∀ i j, τ.trace (Q.piece i).val=τ.trace (Q.piece j).val) : + ∃ E : Generator.MatrixUnitSystem (Fin Q.size) M.toStarSubalgebra, + (∀ i, E.entry i i=(Q.piece i).val) ∧ + Function.Injective E.hom ∧ + E.concreteAlgebra ≤ M.toStarSubalgebra ∧ WOTClosed E.concreteAlgebra := by + obtain ⟨e,hd,hs,hm,hu⟩ := exists_matrixUnits_for_partition τ hfactor Q hn ht + let E : Generator.MatrixUnitSystem (Fin Q.size) M.toStarSubalgebra := ⟨e,hs,hm,hu⟩ + have : Nontrivial M.toStarSubalgebra := by + apply nontrivial_of_ne (0 : M.toStarSubalgebra) 1 + intro h + have ht := congrArg τ.trace h + have hz : τ.trace 0=0 := by simp [TracialRepresentation.trace] + rw [hz,τ.trace_one] at ht + exact zero_ne_one ht + have : Nonempty (Fin Q.size) := ⟨⟨0,hn⟩⟩ + exact ⟨E,hd,E.injective,E.concreteAlgebra_le,E.concreteAlgebra_wotClosed⟩ + +end Tracial +end + +/-! The actual relative commutant in M is a diffuse scalar-center von +Neumann algebra, with the restricted faithful trace available from M. -/ +namespace MatrixUnitSystem + +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} {ι : Type*} [Fintype ι] [DecidableEq ι] +variable (E : MatrixUnitSystem ι M.toStarSubalgebra) + +def relativeStar : StarSubalgebra ℂ (H →L[ℂ] H) where + carrier := {x | ∃ a : E.commutant, a.val.val=x} + zero_mem' := ⟨0,rfl⟩ + one_mem' := ⟨1,rfl⟩ + add_mem' := by rintro x y ⟨a,rfl⟩ ⟨b,rfl⟩; exact ⟨a+b,rfl⟩ + mul_mem' := by rintro x y ⟨a,rfl⟩ ⟨b,rfl⟩; exact ⟨a*b,rfl⟩ + algebraMap_mem' z := ⟨algebraMap ℂ E.commutant z,rfl⟩ + star_mem' := by rintro x ⟨a,rfl⟩; exact ⟨star a,rfl⟩ + +theorem relativeStar_mem (x : H →L[ℂ] H) : + x ∈ E.relativeStar ↔ x ∈ M ∧ ∀ i j, (E.entry i j).val*x=x*(E.entry i j).val := by + constructor + · rintro ⟨a,rfl⟩ + exact ⟨a.val.property,fun i j => congrArg Subtype.val (a.property i j).eq⟩ + · rintro ⟨hx,hc⟩ + exact ⟨⟨⟨x,hx⟩,fun i j => Subtype.ext (hc i j)⟩,rfl⟩ + +theorem relativeStar_bicommutant : + Set.centralizer (Set.centralizer (E.relativeStar : Set (H →L[ℂ] H))) = + (E.relativeStar : Set (H →L[ℂ] H)) := by + apply Set.Subset.antisymm + · intro a ha + apply (E.relativeStar_mem a).mpr + constructor + · rw [← SetLike.mem_coe,← M.centralizer_centralizer] + exact fun b hb => ha b (fun c hc => hb c ((E.relativeStar_mem c).mp hc).1) + · intro i j + exact ha (E.entry i j).val + (fun b hb => (((E.relativeStar_mem b).mp hb).2 i j).symm) + · intro a ha b hb + exact (hb a ha).symm + +def relativeVonNeumann : VonNeumannAlgebra H where + toStarSubalgebra := E.relativeStar + centralizer_centralizer' := E.relativeStar_bicommutant + +theorem relativeVonNeumann_le : E.relativeVonNeumann ≤ M := by + intro x hx + exact ((E.relativeStar_mem x).mp hx).1 + +def relativeEquiv : E.commutant ≃⋆ₐ[ℂ] E.relativeVonNeumann.toStarSubalgebra where + toFun a := ⟨a.val.val,⟨a,rfl⟩⟩ + invFun a := ⟨⟨a.val,((E.relativeStar_mem a.val).mp a.property).1⟩, + fun i j => Subtype.ext (((E.relativeStar_mem a.val).mp a.property).2 i j)⟩ + left_inv _ := rfl + right_inv _ := rfl + map_mul' _ _ := rfl + map_add' _ _ := rfl + map_smul' _ _ := rfl + map_star' _ := rfl + +theorem relative_scalar_center (o : ι) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (c : E.relativeVonNeumann.toStarSubalgebra) + (hc : ∀ a : E.relativeVonNeumann.toStarSubalgebra,a*c=c*a) : + ∃ z : ℂ,c=z • (1 : E.relativeVonNeumann.toStarSubalgebra) := by + obtain ⟨z,hz⟩ := E.commutant_scalar_center o hfactor (E.relativeEquiv.symm c) (by + intro a + apply E.relativeEquiv.injective + change E.relativeEquiv (a*E.relativeEquiv.symm c)= + E.relativeEquiv (E.relativeEquiv.symm c*a) + rw [map_mul,map_mul,E.relativeEquiv.apply_symm_apply] + exact hc (E.relativeEquiv a)) + refine ⟨z,?_⟩ + have h := congrArg E.relativeEquiv hz + simpa only [StarAlgEquiv.apply_symm_apply,map_smul,map_one] using h + +theorem relative_diffuse (o : ι) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (p : E.relativeVonNeumann.toStarSubalgebra) (hp : IsStarProjection p) (hp0 : p ≠ 0) : + ∃ q : E.relativeVonNeumann.toStarSubalgebra, + IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q := by + obtain ⟨q,hq,hq0,hqp,hpq,hqp'⟩ := E.commutant_diffuse o hdiff + (E.relativeEquiv.symm p) (hp.map E.relativeEquiv.symm) (by + intro h + apply hp0 + simpa using congrArg E.relativeEquiv h) + refine ⟨E.relativeEquiv q,?_,?_,?_,?_,?_⟩ + · exact hq.map E.relativeEquiv.toStarAlgHom + · intro h + apply hq0 + exact E.relativeEquiv.injective (h.trans (map_zero E.relativeEquiv).symm) + · intro h + apply hqp + exact E.relativeEquiv.injective (h.trans (E.relativeEquiv.apply_symm_apply p).symm) + · simpa only [map_mul,StarAlgEquiv.apply_symm_apply] using congrArg E.relativeEquiv hpq + · simpa only [map_mul,StarAlgEquiv.apply_symm_apply] using congrArg E.relativeEquiv hqp' + +end + +/-! Passing an irreducible inclusion through a common finite matrix algebra +preserves irreducibility of the actual relative commutants. -/ +variable {ι A B : Type*} [Fintype ι] [DecidableEq ι] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable [Ring B] [StarRing B] [Algebra ℂ B] [StarModule ℂ B] + +omit [StarModule ℂ A] [StarModule ℂ B] in +theorem commute_mapped_of_amplify (E : MatrixUnitSystem ι A) (o : ι) + (f : A →⋆ₐ[ℂ] B) (y : B) + (hE : ∀ i j,Commute (f (E.entry i j)) y) + (hamp : ∀ a : A,Commute (f (E.amplify o a)) y) (x : A) : Commute (f x) y := by + rw [← E.reconstruct o x,map_sum] + apply Commute.sum_left + intro i hi + rw [map_sum] + apply Commute.sum_left + intro j hj + rw [map_mul,map_mul] + exact ((hE i o).mul_left (hamp _)).mul_left (hE o j) + +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} +variable (E : MatrixUnitSystem ι N.toStarSubalgebra) (hNM : N ≤ M) + +theorem relative_inclusion : + E.relativeVonNeumann ≤ (E.map (coordinateInclusion hNM)).relativeVonNeumann := by + intro x hx + have h := (E.relativeStar_mem x).mp hx + apply ((E.map (coordinateInclusion hNM)).relativeStar_mem x).mpr + exact ⟨hNM h.1,h.2⟩ + +theorem relative_irreducible (o : ι) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (c : (E.map (coordinateInclusion hNM)).relativeVonNeumann.toStarSubalgebra) + (hc : ∀ a : E.relativeVonNeumann.toStarSubalgebra, + coordinateInclusion (E.relative_inclusion hNM) a*c= + c*coordinateInclusion (E.relative_inclusion hNM) a) : + ∃ z : ℂ,c=z • (1 : (E.map (coordinateInclusion hNM)).relativeVonNeumann.toStarSubalgebra) := by + let F := E.map (coordinateInclusion hNM) + let cM := coordinateInclusion F.relativeVonNeumann_le c + have hentries : ∀ i j,Commute (coordinateInclusion hNM (E.entry i j)) cM := by + intro i j + apply Subtype.ext + exact ((F.relativeStar_mem c.val).mp c.property).2 i j + have hamp (a : N.toStarSubalgebra) : Commute + (coordinateInclusion hNM (E.amplify o a)) cM := by + let b : E.relativeVonNeumann.toStarSubalgebra := + E.relativeEquiv ⟨E.amplify o a,E.amplify_mem o a⟩ + apply Subtype.ext + exact congrArg (fun t : F.relativeVonNeumann.toStarSubalgebra => t.val) (hc b) + obtain ⟨z,hz⟩ := hirr cM (fun x => + E.commute_mapped_of_amplify o (coordinateInclusion hNM) cM hentries hamp x) + exact ⟨z,Subtype.ext (congrArg (fun t : M.toStarSubalgebra => t.val) hz)⟩ + +end MatrixUnitSystem + +/-! Explicit Bell projections in two equal finite matrix factors. -/ +open scoped BigOperators +namespace Bell +variable {n : ℕ} [NeZero n] + +theorem char_sum (t : ZMod n) : + (∑ i : ZMod n, ZMod.stdAddChar (t*i)) = if t=0 then (n : ℂ) else 0 := by + split_ifs with h + · simp [h] + · exact AddChar.sum_eq_zero_of_ne_one (ZMod.isPrimitive_stdAddChar n h) + +theorem char_star (t : ZMod n) : star (ZMod.stdAddChar t) = ZMod.stdAddChar (-t) := by + simp only [ZMod.stdAddChar_apply, AddChar.map_neg_eq_inv] + exact (Circle.coe_inv_eq_conj (ZMod.toCircle t)).symm + +def projection (s f : ZMod n) : Matrix (ZMod n × ZMod n) (ZMod n × ZMod n) ℂ := + fun a b => if a.2=a.1+s ∧ b.2=b.1+s then + (n : ℂ)⁻¹ * ZMod.stdAddChar (f*(a.1-b.1)) else 0 + +theorem projection_star (s f : ZMod n) : star (projection s f) = projection s f := by + ext a b + change star (projection s f b a)=projection s f a b + simp only [projection, apply_ite star, star_mul, char_star, star_zero] + rw [show -(f*(b.1-a.1))=f*(a.1-b.1) by ring] + simp [and_comm, mul_comm] + +theorem projection_mul (s f t g : ZMod n) : + projection s f * projection t g = if s=t ∧ f=g then projection s f else 0 := by + ext a b + simp only [Matrix.mul_apply, Fintype.sum_prod_type, projection] + have hterm (i j : ZMod n) : + (if a.2=a.1+s ∧ j=i+s then (n : ℂ)⁻¹*ZMod.stdAddChar (f*(a.1-i)) else 0) * + (if j=i+t ∧ b.2=b.1+t then (n : ℂ)⁻¹*ZMod.stdAddChar (g*(i-b.1)) else 0) = + if a.2=a.1+s ∧ b.2=b.1+t ∧ s=t then + if j=i+s then (n : ℂ)⁻¹^2 * + ZMod.stdAddChar (f*a.1-g*b.1) * ZMod.stdAddChar ((g-f)*i) else 0 + else 0 := by + by_cases ha : a.2=a.1+s + · by_cases hb : b.2=b.1+t + · by_cases hs : s=t + · subst t + by_cases hj : j=i+s + · simp only [ha,hb,hj,and_self,ite_true] + calc + _ = (n : ℂ)⁻¹^2 * (ZMod.stdAddChar (f*(a.1-i)) * + ZMod.stdAddChar (g*(i-b.1))) := by ring + _ = _ := by + rw [← AddChar.map_add_eq_mul, + show f*(a.1-i)+g*(i-b.1)=(f*a.1-g*b.1)+(g-f)*i by ring, + AddChar.map_add_eq_mul] + ring + · simp [ha,hb,hj] + · by_cases hj : j=i+s + · simp [ha,hb,hs,hj] + · simp [ha,hb,hs,hj] + · simp [hb] + · simp [ha] + simp_rw [hterm] + by_cases hs : s=t + · subst t + by_cases ha : a.2=a.1+s ∧ b.2=b.1+s + · simp only [ha.1,ha.2,and_self,ite_true,Finset.sum_ite_eq',Finset.mem_univ] + rw [← Finset.mul_sum, char_sum] + by_cases hf : f=g + · subst g + simp only [sub_self,ite_true,Matrix.ite_apply,Matrix.zero_apply, and_self, projection, ha, ite_true] + rw [show f*a.1-f*b.1=f*(a.1-b.1) by ring] + field_simp + · simp [sub_eq_zero,Ne.symm hf,hf] + · simp [ha,Matrix.ite_apply,projection] + · simp [hs] + +theorem projection_total : (∑ s : ZMod n, ∑ f : ZMod n, projection s f) = 1 := by + ext a b + simp only [Matrix.sum_apply, Matrix.one_apply] + have hf (s : ZMod n) : (∑ f : ZMod n, projection s f a b) = + if a.2=a.1+s ∧ b.2=b.1+s ∧ a.1=b.1 then 1 else 0 := by + simp only [projection] + by_cases h : a.2=a.1+s ∧ b.2=b.1+s + · simp only [h.1,h.2,and_self,true_and,ite_true] + rw [← Finset.mul_sum] + simp_rw [mul_comm _ (a.1-b.1)] + rw [char_sum] + by_cases hab : a.1=b.1 + · simp [hab] + · simp [hab,sub_eq_zero] + · simp [h,show ¬(a.2=a.1+s ∧ b.2=b.1+s ∧ a.1=b.1) by tauto] + simp_rw [hf] + by_cases hab : a.1=b.1 + · have hs (s : ZMod n) : a.2=a.1+s ↔ s=a.2-a.1 := by + constructor + · intro h; rw [h]; simp + · intro h; rw [h]; abel + simp_rw [hs] + simp only [hab, and_true] + simp_rw [ite_and] + simp [Prod.ext_iff,hab,eq_comm] + · simp [hab,show a≠b by exact fun h => hab (congrArg Prod.fst h)] + +/-- The matrix unit in the first tensor factor, with identity on the second. -/ +def leftEntry (i j : ZMod n) : Matrix (ZMod n × ZMod n) (ZMod n × ZMod n) ℂ := + fun a b => if a.1=i ∧ b.1=j ∧ a.2=b.2 then 1 else 0 + +theorem mul_leftEntry (X : Matrix (ZMod n × ZMod n) (ZMod n × ZMod n) ℂ) + (i j : ZMod n) (a b : ZMod n × ZMod n) : + (X * leftEntry i j) a b = if b.1=j then X a (i,b.2) else 0 := by + simp only [Matrix.mul_apply,Fintype.sum_prod_type,leftEntry,mul_ite,mul_one,mul_zero] + by_cases h : b.1=j + · simp [h,ite_and] + · simp [h] + +theorem projection_sandwich (s f i j : ZMod n) : + projection s f * leftEntry i j * projection s f = + if i=j then (n : ℂ)⁻¹ • projection s f else 0 := by + apply Matrix.ext + intro a b + have hr : (if i=j then (n : ℂ)⁻¹ • projection s f else 0) a b = + if i=j then (n : ℂ)⁻¹ * projection s f a b else 0 := by + split_ifs <;> rfl + rw [hr] + rw [Matrix.mul_apply] + simp only [mul_leftEntry,Fintype.sum_prod_type,ite_mul,zero_mul] + simp only [Finset.sum_ite_irrel, Finset.sum_const_zero] + simp only [Finset.sum_ite_eq',Finset.mem_univ,ite_true] + have hterm (k : ZMod n) : projection s f a (i,k)*projection s f (j,k) b = + if a.2=a.1+s ∧ b.2=b.1+s ∧ i=j then + if k=i+s then (n : ℂ)⁻¹^2 * ZMod.stdAddChar (f*(a.1-b.1)) else 0 + else 0 := by + by_cases ha : a.2=a.1+s + · by_cases hb : b.2=b.1+s + · by_cases hij : i=j + · subst j + by_cases hk : k=i+s + · simp only [projection,ha,hb,hk,and_self,ite_true] + calc + _ = (n : ℂ)⁻¹^2 * (ZMod.stdAddChar (f*(a.1-i)) * + ZMod.stdAddChar (f*(i-b.1))) := by ring + _ = _ := by rw [← AddChar.map_add_eq_mul, + show f*(a.1-i)+f*(i-b.1)=f*(a.1-b.1) by ring] + · simp [projection,ha,hb,hk] + · by_cases hk : k=i+s + · simp [projection,ha,hb,hij,hk] + · simp [projection,ha,hb,hij,hk] + · simp [projection,hb] + · simp [projection,ha] + simp_rw [hterm] + by_cases hij : i=j <;> by_cases h : a.2=a.1+s ∧ b.2=b.1+s <;> + simp [hij,h,projection,pow_two,mul_assoc] + +end Bell + +/-! Exact normalized traces of constructed matrix algebras and all their +commuting product refinements. -/ +open scoped BigOperators +namespace MatrixUnitSystem + +section +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} {ι : Type*} [Fintype ι] [DecidableEq ι] +variable (E : MatrixUnitSystem ι M.toStarSubalgebra) (τ : TracialRepresentation M) + +theorem trace_diagonal_eq (i j : ι) : τ.trace (E.entry i i)=τ.trace (E.entry j j) := by + have h := τ.trace_mul_comm (E.entry i j) (E.entry j i) + simpa only [E.mul_entry,ite_true] using h + +theorem trace_off_diagonal (i j : ι) (hij : i ≠ j) : τ.trace (E.entry i j)=0 := by + have h := τ.trace_mul_comm (E.entry i i) (E.entry i j) + simpa [E.mul_entry,hij,Ne.symm hij,TracialRepresentation.trace] using h + +theorem trace_diagonal (o : ι) : + τ.trace (E.entry o o)=(Fintype.card ι : ℂ)⁻¹ := by + have h : (Fintype.card ι : ℂ)*τ.trace (E.entry o o)=1 := by + calc _ = ∑ i, τ.trace (E.entry i i) := by + simp only [E.trace_diagonal_eq τ _ o,Finset.sum_const,Finset.card_univ,nsmul_eq_mul] + _ = τ.trace (∑ i,E.entry i i) := by + let t : M.toStarSubalgebra →+ ℂ := + { toFun := τ.trace, map_zero' := by simp [TracialRepresentation.trace], + map_add' := τ.trace_add } + exact (map_sum t _ _).symm + _ = 1 := by rw [E.total,τ.trace_one] + exact eq_inv_of_mul_eq_one_right h + +theorem trace_hom (_ : ι) (a : Matrix ι ι ℂ) : + τ.trace (E.hom a)=(Fintype.card ι : ℂ)⁻¹*Matrix.trace a := by + have hsum (b : ι → M.toStarSubalgebra) : τ.trace (∑ i,b i)=∑ i,τ.trace (b i) := by + let t : M.toStarSubalgebra →+ ℂ := + { toFun := τ.trace, map_zero' := by simp [TracialRepresentation.trace], + map_add' := τ.trace_add } + exact map_sum t _ _ + rw [E.hom_apply,hsum] + simp only [hsum,τ.trace_smul] + have hentry (i j : ι) : τ.trace (E.entry i j)= + if i=j then (Fintype.card ι : ℂ)⁻¹ else 0 := by + split + · next h => subst j; exact E.trace_diagonal τ i + · next h => exact E.trace_off_diagonal τ i j h + simp only [hentry,mul_ite,mul_zero,Finset.sum_ite_eq,Finset.mem_univ,ite_true] + rw [Matrix.trace,Finset.mul_sum] + exact Finset.sum_congr rfl fun i _ => mul_comm _ _ + +end + +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} {n : ℕ} [NeZero n] +variable (E F : MatrixUnitSystem (ZMod n) M.toStarSubalgebra) +variable (hc : ∀ i j k l,Commute (E.entry i j) (F.entry k l)) + +theorem product_hom_leftEntry (i j : ZMod n) : + (E.product F hc).hom (Bell.leftEntry i j) = E.entry i j := by + simp only [hom_apply,Fintype.sum_prod_type,Bell.leftEntry,ite_smul,one_smul,zero_smul] + simp only [ite_and,Finset.sum_ite_irrel,Finset.sum_const_zero,Finset.sum_ite_eq',Finset.mem_univ,ite_true] + rw [← E.product_sum_left F hc i j] + apply Finset.sum_congr rfl + intro k hk + rw [Finset.sum_eq_single j] + · simp + · intro l hl hlj + simp [hlj] + · simp + +def bellPiece (s f : ZMod n) : AlgebraProjection M := + ⟨(E.product F hc).hom (Bell.projection s f),by + constructor + · show (E.product F hc).hom (Bell.projection s f) * + (E.product F hc).hom (Bell.projection s f) = _ + rw [← map_mul,Bell.projection_mul,ite_eq_left ⟨rfl,rfl⟩] + · show star ((E.product F hc).hom (Bell.projection s f)) = _ + rw [← map_star,Bell.projection_star]⟩ + +theorem bellPiece_orthogonal (a b : ZMod n × ZMod n) (h : a≠b) : + (E.bellPiece F hc a.1 a.2).val * (E.bellPiece F hc b.1 b.2).val = 0 := by + change (E.product F hc).hom _ * (E.product F hc).hom _ = 0 + rw [← map_mul,Bell.projection_mul,ite_eq_right (fun he => h (Prod.ext he.1 he.2)),map_zero] + +theorem bellPiece_total : + (∑ a : ZMod n × ZMod n,(E.bellPiece F hc a.1 a.2).val) = 1 := by + change (∑ a : ZMod n × ZMod n,(E.product F hc).hom (Bell.projection a.1 a.2))=1 + rw [← map_sum,Fintype.sum_prod_type,Bell.projection_total,map_one] + +def bellPartition : CornerPartition (identityProjection M) where + size := Fintype.card (ZMod n × ZMod n) + piece i := let a := (Fintype.equivFin (ZMod n × ZMod n)).symm i + E.bellPiece F hc a.1 a.2 + orthogonal _ _ h := E.bellPiece_orthogonal F hc _ _ + (fun he => h ((Fintype.equivFin (ZMod n × ZMod n)).symm.injective he)) + total := ((Fintype.equivFin (ZMod n × ZMod n)).symm.sum_comp + (fun a => (E.bellPiece F hc a.1 a.2).val)).trans (E.bellPiece_total F hc) + +theorem bellPiece_sandwich_entry (s f i j : ZMod n) : + (E.bellPiece F hc s f).val * E.entry i j * (E.bellPiece F hc s f).val = + if i=j then (n : ℂ)⁻¹ • (E.bellPiece F hc s f).val else 0 := by + rw [← E.product_hom_leftEntry F hc i j] + change ((E.product F hc).hom _ * (E.product F hc).hom _) * (E.product F hc).hom _ = _ + rw [← map_mul,← map_mul,Bell.projection_sandwich] + split <;> simp [bellPiece,map_smul] + +theorem bellPartition_pinch_entry (i j : ZMod n) : + (E.bellPartition F hc).pinch (E.entry i j) = + if i=j then (n : ℂ)⁻¹ • (1 : M.toStarSubalgebra) else 0 := by + have hpiece (a : Fin (E.bellPartition F hc).size) : + ((E.bellPartition F hc).piece a).val * E.entry i j * + ((E.bellPartition F hc).piece a).val = + if i=j then (n : ℂ)⁻¹ • ((E.bellPartition F hc).piece a).val else 0 := + E.bellPiece_sandwich_entry F hc _ _ i j + unfold CornerPartition.pinch + simp_rw [hpiece] + split + · simp only [← Finset.smul_sum,(E.bellPartition F hc).total] + rfl + · simp + +theorem bellPartition_pinch_algebra (τ : TracialRepresentation M) + (x : M.toStarSubalgebra) (hx : x ∈ E.algebra) : + (E.bellPartition F hc).pinch x = τ.trace x • (1 : M.toStarSubalgebra) := by + obtain ⟨a,rfl⟩ := hx + change (E.bellPartition F hc).pinch (E.hom a)=τ.trace (E.hom a) • 1 + rw [E.trace_hom τ 0] + have hsum (y : ZMod n → M.toStarSubalgebra) : + (E.bellPartition F hc).pinch (∑ i,y i) = + ∑ i,(E.bellPartition F hc).pinch (y i) := by + simp only [CornerPartition.pinch,Finset.mul_sum,Finset.sum_mul] + exact Finset.sum_comm + simp only [hom_apply,hsum,CornerPartition.pinch_smul,E.bellPartition_pinch_entry F hc, + smul_ite,smul_zero,Finset.sum_ite_eq,Finset.mem_univ,ite_true,smul_smul] + rw [← Finset.sum_smul,Matrix.trace,Finset.mul_sum] + congr 1 + simp [ZMod.card,mul_comm] + +end MatrixUnitSystem + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixEncoding.lean b/lean/OAI/Analysis/FactorGeneration/MatrixEncoding.lean new file mode 100644 index 0000000000000000000000000000000000000000..47c5a2f52bd4222e46b0acfe6300db2696562c91 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixEncoding.lean @@ -0,0 +1,162 @@ +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Analysis.Complex.Basic +import Mathlib.LinearAlgebra.Matrix.Hermitian +import Mathlib.LinearAlgebra.Matrix.Notation +import Mathlib.Tactic.FinCases + +namespace OAI + +namespace Generator.MatrixEncoding + +/-! Algebraic encoding of four corner operators by two self-adjoint matrices. -/ +section +variable {R : Type*} [Ring R] [StarRing R] +local notation "Mat" => Matrix (Fin 2) (Fin 2) R + +def E11 : Mat := !![1, 0; 0, 0] +def E12 : Mat := !![0, 1; 0, 0] +def E21 : Mat := !![0, 0; 1, 0] +def E22 : Mat := !![0, 0; 0, 1] +def corner (a : R) : Mat := !![a, 0; 0, 0] +def encodeA (a₁ a₂ C : R) : Mat := !![a₁, 0; 0, a₂ + C] +def encodeB (a₃ a₄ : R) : Mat := !![a₃, 1; 1, a₄] + +theorem encodeA_selfAdjoint {a₁ a₂ C : R} + (h₁ : IsSelfAdjoint a₁) (h₂ : IsSelfAdjoint a₂) (hC : IsSelfAdjoint C) : + IsSelfAdjoint (encodeA a₁ a₂ C) := by + apply Matrix.IsHermitian.isSelfAdjoint + apply Matrix.IsHermitian.ext + intro i j + fin_cases i <;> fin_cases j <;> + simp [encodeA, h₁.star_eq, h₂.star_eq, hC.star_eq] + +theorem encodeB_selfAdjoint {a₃ a₄ : R} + (h₃ : IsSelfAdjoint a₃) (h₄ : IsSelfAdjoint a₄) : + IsSelfAdjoint (encodeB a₃ a₄) := by + apply Matrix.IsHermitian.isSelfAdjoint + apply Matrix.IsHermitian.ext + intro i j + fin_cases i <;> fin_cases j <;> simp [encodeB, h₃.star_eq, h₄.star_eq] + +omit [StarRing R] in +theorem complement : (1 : Mat) - E11 = E22 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [E11, E22] + +theorem star_E12 : star (E12 : Mat) = E21 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [E12, E21, Matrix.star_apply] + +omit [StarRing R] in +theorem cut_offDiagonal (a₃ a₄ : R) : E11 * encodeB a₃ a₄ * E22 = E12 := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [E11, E12, E22, encodeB, Matrix.mul_apply, Fin.sum_univ_two] + +omit [StarRing R] in +theorem cut_a₁ (a₁ a₂ C : R) : E11 * encodeA a₁ a₂ C * E11 = corner a₁ := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [E11, encodeA, corner, Matrix.mul_apply, Fin.sum_univ_two] + +omit [StarRing R] in +theorem cut_a₂ (a₁ a₂ C : R) : + E12 * encodeA a₁ a₂ C * E21 - corner C = corner a₂ := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [E12, E21, encodeA, corner] + +omit [StarRing R] in +theorem cut_a₃ (a₃ a₄ : R) : E11 * encodeB a₃ a₄ * E11 = corner a₃ := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [E11, encodeB, corner, Matrix.mul_apply, Fin.sum_univ_two] + +omit [StarRing R] in +theorem cut_a₄ (a₃ a₄ : R) : E12 * encodeB a₃ a₄ * E21 = corner a₄ := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [E12, E21, encodeB, corner, Matrix.mul_apply, Fin.sum_univ_two] + +omit [StarRing R] in +theorem matrix_reconstruction (X : Mat) : + X = corner (X 0 0) + corner (X 0 1) * E12 + + E21 * corner (X 1 0) + E21 * corner (X 1 1) * E12 := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [corner, E12, E21] + +variable {𝕜 : Type*} [CommRing 𝕜] [StarRing 𝕜] [Algebra 𝕜 R] [StarModule 𝕜 R] + +theorem matrix_units_mem (NQ : StarSubalgebra 𝕜 Mat) {a₃ a₄ : R} (hE : (E11 : Mat) ∈ NQ) + (hB : encodeB a₃ a₄ ∈ NQ) : + (E22 : Mat) ∈ NQ ∧ (E12 : Mat) ∈ NQ ∧ (E21 : Mat) ∈ NQ := by + have h22 : (E22 : Mat) ∈ NQ := (complement (R := R)) ▸ sub_mem NQ.one_mem hE + have h12 : (E12 : Mat) ∈ NQ := cut_offDiagonal a₃ a₄ ▸ + NQ.mul_mem (NQ.mul_mem hE hB) h22 + exact ⟨h22, h12, (star_E12 (R := R)) ▸ star_mem h12⟩ + +theorem encoded_corners_mem (NQ : StarSubalgebra 𝕜 Mat) {a₁ a₂ a₃ a₄ C : R} + (hE : (E11 : Mat) ∈ NQ) (hA : encodeA a₁ a₂ C ∈ NQ) + (hB : encodeB a₃ a₄ ∈ NQ) (hC : corner C ∈ NQ) : + corner a₁ ∈ NQ ∧ corner a₂ ∈ NQ ∧ corner a₃ ∈ NQ ∧ corner a₄ ∈ NQ := by + obtain ⟨_, h12, h21⟩ := matrix_units_mem NQ hE hB + exact ⟨cut_a₁ a₁ a₂ C ▸ NQ.mul_mem (NQ.mul_mem hE hA) hE, + cut_a₂ a₁ a₂ C ▸ sub_mem (NQ.mul_mem (NQ.mul_mem h12 hA) h21) hC, + cut_a₃ a₃ a₄ ▸ NQ.mul_mem (NQ.mul_mem hE hB) hE, + cut_a₄ a₃ a₄ ▸ NQ.mul_mem (NQ.mul_mem h12 hB) h21⟩ + +omit [StarRing R] [StarRing 𝕜] [StarModule 𝕜 R] in +theorem corner_algebraMap (c : 𝕜) : + corner (algebraMap 𝕜 R c) = c • (E11 : Mat) := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [corner, E11, Algebra.algebraMap_eq_smul_one] + +/-- The source's shift C 1_N needs no extra corner-membership hypothesis. -/ +theorem encoded_corners_mem_scalar (NQ : StarSubalgebra 𝕜 Mat) + {a₁ a₂ a₃ a₄ : R} (C : 𝕜) + (hE : (E11 : Mat) ∈ NQ) (hA : encodeA a₁ a₂ (algebraMap 𝕜 R C) ∈ NQ) + (hB : encodeB a₃ a₄ ∈ NQ) : + corner a₁ ∈ NQ ∧ corner a₂ ∈ NQ ∧ corner a₃ ∈ NQ ∧ corner a₄ ∈ NQ := by + apply encoded_corners_mem NQ hE hA hB + rw [corner_algebraMap] + exact NQ.smul_mem hE C + +theorem eq_top_of_corner_and_units (NQ : StarSubalgebra 𝕜 Mat) (hc : ∀ a : R, corner a ∈ NQ) + (h12 : (E12 : Mat) ∈ NQ) (h21 : (E21 : Mat) ∈ NQ) : NQ = ⊤ := by + apply top_unique + intro X _ + rw [matrix_reconstruction X] + exact NQ.add_mem (NQ.add_mem (NQ.add_mem (hc _) (NQ.mul_mem (hc _) h12)) + (NQ.mul_mem h21 (hc _))) (NQ.mul_mem (NQ.mul_mem h21 (hc _)) h12) + +end + +/-! Algebraic diagonal identities used by the analytic gap recovery. -/ +variable {R : Type*} [Ring R] [StarRing R] [Algebra ℂ R] [StarModule ℂ R] + +omit [StarRing R] [Algebra ℂ R] [StarModule ℂ R] in +theorem E22_idempotent : (E22 : Matrix (Fin 2) (Fin 2) R)*E22=E22 := by + ext i j + fin_cases i <;> fin_cases j <;> simp [E22] + +omit [StarRing R] [Algebra ℂ R] [StarModule ℂ R] in +theorem E22_commute_encodeA (a₁ a₂ : R) : Commute E22 (encodeA a₁ a₂ 0) := by + show E22*encodeA a₁ a₂ 0=encodeA a₁ a₂ 0*E22 + ext i j + fin_cases i <;> fin_cases j <;> simp [E22,encodeA] + +omit [StarRing R] [StarModule ℂ R] in +theorem encodeA_scalar_shift (a₁ a₂ : R) (C : ℂ) : + encodeA a₁ a₂ (algebraMap ℂ R C)=C • E22+encodeA a₁ a₂ 0 := by + ext i j + fin_cases i <;> fin_cases j <;> + simp [encodeA,E22,Algebra.algebraMap_eq_smul_one,add_comm] + +theorem scalar_shift_selfAdjoint (C : ℝ) : IsSelfAdjoint (algebraMap ℂ R (C : ℂ)) := by + simp [IsSelfAdjoint,← algebraMap_star_comm] + +end Generator.MatrixEncoding + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixExpectation.lean b/lean/OAI/Analysis/FactorGeneration/MatrixExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..33b5efd5ecc72df0e6d1d90015d885ad008d2679 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixExpectation.lean @@ -0,0 +1,312 @@ +import OAI.Analysis.FactorGeneration.MatrixSequence + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Construct contractive expectations onto the actual finite matrix stages. +For every element of their weak closure, these expectations converge in L2 +and remain in its operator norm ball. -/ +open Filter +open scoped Topology +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem conditionalExpectation_best_approximation (τ : TracialRepresentation M) (hNM : N ≤ M) + (x y : M.toStarSubalgebra) (hy : y.val ∈ N) : + τ.norm₂ (x-conditionalExpectation τ hNM x) ≤ τ.norm₂ (x-y) := by + have he : conditionalExpectation τ hNM (x-y)=conditionalExpectation τ hNM x-y := by + change conditionalExpectationCLM τ hNM (x-y)=_ + rw [map_sub] + change conditionalExpectation τ hNM x-conditionalExpectation τ hNM y=_ + rw [conditionalExpectation_fixed τ hNM y hy] + have h := conditionalExpectation_pythagoras τ hNM (x-y) + rw [he,show x-y-(conditionalExpectation τ hNM x-y)=x-conditionalExpectation τ hNM x by abel] at h + nlinarith [sq_nonneg (τ.norm₂ (conditionalExpectation τ hNM x-y)), + show 0 ≤ τ.norm₂ (x-y) from norm_nonneg _] + +end Tracial +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def stageVonNeumann (E : FiniteMatrixStage N) : VonNeumannAlgebra H := + vonNeumannOfWOTClosed E.units.concreteAlgebra E.units.concreteAlgebra_wotClosed + +theorem stageVonNeumann_le (E : FiniteMatrixStage N) : E.stageVonNeumann ≤ N := + E.units.concreteAlgebra_le + +def stageExpectation (E : FiniteMatrixStage N) (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) : M.toStarSubalgebra := + conditionalExpectation τ (E.stageVonNeumann_le.trans hNM) x + +theorem stageExpectation_mem (E : FiniteMatrixStage N) (τ : TracialRepresentation M) + (hNM : N ≤ M) (x : M.toStarSubalgebra) : + (E.stageExpectation τ hNM x).val ∈ E.units.concreteAlgebra := + conditionalExpectation_mem τ (E.stageVonNeumann_le.trans hNM) x + +theorem stageExpectation_norm_le (E : FiniteMatrixStage N) (τ : TracialRepresentation M) + (hNM : N ≤ M) (x : M.toStarSubalgebra) : ‖E.stageExpectation τ hNM x‖ ≤ ‖x‖ := + conditionalExpectation_norm_le τ (E.stageVonNeumann_le.trans hNM) x + +theorem stageExpectation_norm₂_tendsto (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : M.toStarSubalgebra) + (hx : x.val ∈ generated A) : + Tendsto (fun n => τ.norm₂ (x-(A n).stageExpectation τ hNM x)) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + obtain ⟨n,y,hy,he⟩ := exists_stage_norm₂_approximation A hA τ hNM x hx ε hε + refine ⟨n,?_⟩ + intro m hm + have h := conditionalExpectation_best_approximation τ + ((A m).stageVonNeumann_le.trans hNM) x y (hA hm hy) + change τ.norm₂ (x-(A m).stageExpectation τ hNM x) ≤ τ.norm₂ (x-y) at h + simpa only [Real.dist_eq,sub_zero,abs_of_nonneg (show 0 ≤ τ.norm₂ _ from norm_nonneg _)] + using h.trans_lt he + +theorem exists_bounded_stage_approximation (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : M.toStarSubalgebra) + (hx : x.val ∈ generated A) : + ∃ a : ℕ → M.toStarSubalgebra, + (∀ n,(a n).val ∈ (A n).units.concreteAlgebra) ∧ + (∀ n,‖a n‖ ≤ ‖x‖) ∧ Tendsto (fun n => τ.norm₂ (x-a n)) atTop (𝓝 0) := + ⟨fun n => (A n).stageExpectation τ hNM x,fun n => (A n).stageExpectation_mem τ hNM x, + fun n => (A n).stageExpectation_norm_le τ hNM x,stageExpectation_norm₂_tendsto A hA τ hNM x hx⟩ + +end FiniteMatrixStage + +/-! Construct scalarizing partitions for an actual finite matrix algebra +inside a diffuse finite factor. No chain or pinching hypothesis is assumed. -/ +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_scalar_pinching_for_matrixUnits + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + {n : ℕ} (hn : 0 < n) (E : MatrixUnitSystem (Fin n) M.toStarSubalgebra) : + ∃ Q : CornerPartition (identityProjection M), + ∀ x : M.toStarSubalgebra,x ∈ E.algebra → Q.pinch x=τ.trace x • (1 : M.toStarSubalgebra) := by + let : NeZero n := ⟨hn.ne'⟩ + let e : ZMod n ≃ Fin n := Fintype.equivOfCardEq (by simp) + let E' := E.reindex e + obtain ⟨F,hc,_,_,_,_⟩ := exists_commuting_matrix_extension τ E' 0 hfactor hdiff n hn + let F' := F.reindex e + have hc' : ∀ i j k l,Commute (E'.entry i j) (F'.entry k l) := + fun i j k l => hc i j (e k) (e l) + refine ⟨E'.bellPartition F' hc',fun x hx => ?_⟩ + apply E'.bellPartition_pinch_algebra F' hc' τ x + rwa [MatrixUnitSystem.reindex_algebra] + +end Tracial + +/-! Finite matrix approximation and Bell partitions give actual small +pinching energy. The commuting matrix factor is constructed, not assumed. -/ +open Filter +open scoped BigOperators Topology +namespace FiniteMatrixStage + +section +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N : VonNeumannAlgebra H} + +theorem exists_matrix_approximated_centered_partition (τ : TracialRepresentation N) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + {ι : Type*} (F : Finset ι) (x : ι → N.toStarSubalgebra) + (hx : ∀ i ∈ F,(x i).val ∈ generated A) + (ht : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition (identityProjection N), + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε := by + have hi (i : ι) (hi : i ∈ F) : Tendsto + (fun n => τ.norm₂ (x i-(A n).stageExpectation τ le_rfl (x i))^2) + atTop (𝓝 0) := by + simpa only [zero_pow (by decide : 2 ≠ 0)] using + (stageExpectation_norm₂_tendsto A hA τ le_rfl (x i) (hx i hi)).pow 2 + have hlim : Tendsto + (fun n => ∑ i ∈ F,τ.norm₂ (x i-(A n).stageExpectation τ le_rfl (x i))^2) + atTop (𝓝 0) := by + simpa only [Finset.sum_const_zero] using tendsto_finsetSum F hi + obtain ⟨n,hn⟩ := (hlim.eventually (gt_mem_nhds hε)).exists + obtain ⟨Q,hQ⟩ := exists_scalar_pinching_for_matrixUnits τ hfactor hdiff + (A n).positive (A n).units + refine ⟨Q,lt_of_le_of_lt (Finset.sum_le_sum fun i hi => ?_) hn⟩ + have hm : (A n).stageExpectation τ le_rfl (x i) ∈ (A n).units.algebra := + ((A n).units.mem_concreteAlgebra _).mp ((A n).stageExpectation_mem τ le_rfl (x i)) + have hz : Q.pinch ((A n).stageExpectation τ le_rfl (x i))=0 := by + rw [hQ _ hm] + change τ.trace (conditionalExpectation τ _ (x i)) • (1 : N.toStarSubalgebra)=0 + rw [conditionalExpectation_trace,ht i hi,zero_smul] + have he : Q.pinch (x i)=Q.pinch (x i-(A n).stageExpectation τ le_rfl (x i)) := by + rw [Q.pinch_sub,hz,sub_zero] + rw [he] + exact pow_le_pow_left₀ (norm_nonneg _) (Q.pinch_norm₂_le τ _) 2 + +/-- View the same finite matrix stage inside any algebra containing it. -/ +def restrictStage (E : FiniteMatrixStage N) (R : VonNeumannAlgebra H) + (hER : E.units.concreteAlgebra ≤ R.toStarSubalgebra) : FiniteMatrixStage R where + size := E.size + positive := E.positive + units := { + entry := fun i j => ⟨(E.units.entry i j).val, + hER ((E.units.mem_concreteAlgebra _).mpr (E.units.entry_mem i j))⟩ + star_entry := fun i j => Subtype.ext (congrArg (fun x : N.toStarSubalgebra => x.val) (E.units.star_entry i j)) + mul_entry := fun i j k l => by + apply Subtype.ext + simpa only [MulMemClass.coe_mul,ZeroMemClass.coe_zero,Subtype.coe_mk, + apply_ite Subtype.val] using congrArg (fun x : N.toStarSubalgebra => x.val) (E.units.mul_entry i j k l) + total := by + apply Subtype.ext + have h := congrArg (fun x : N.toStarSubalgebra => x.val) E.units.total + change R.toStarSubalgebra.subtype (∑ i,_) = 1 + rw [map_sum] + change N.toStarSubalgebra.subtype (∑ i,E.units.entry i i)=1 at h + rw [map_sum] at h + exact h } + +theorem restrictStage_concreteAlgebra (E : FiniteMatrixStage N) (R : VonNeumannAlgebra H) + (hER : E.units.concreteAlgebra ≤ R.toStarSubalgebra) : + (E.restrictStage R hER).units.concreteAlgebra=E.units.concreteAlgebra := by + have hh (a : Matrix (Fin E.size) (Fin E.size) ℂ) : + (E.restrictStage R hER).units.concreteHom a = E.units.concreteHom a := by + change R.toStarSubalgebra.subtype ((E.restrictStage R hER).units.hom a) = + N.toStarSubalgebra.subtype (E.units.hom a) + change R.toStarSubalgebra.subtype + (∑ i, ∑ j, a i j • (E.restrictStage R hER).units.entry i j) = + N.toStarSubalgebra.subtype (∑ i, ∑ j, a i j • E.units.entry i j) + simp only [map_sum,map_smul] + rfl + change (E.restrictStage R hER).units.concreteHom.range=E.units.concreteHom.range + congr 1 + exact DFunLike.ext _ _ hh + +theorem exists_matrix_generated_centered_partition (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation (generatedVonNeumann A)) + (hfactor : IsII1Factor (generated A)) + {ι : Type*} (F : Finset ι) (x : ι → (generatedVonNeumann A).toStarSubalgebra) + (ht : ∀ i ∈ F,τ.trace (x i)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition (identityProjection (generatedVonNeumann A)), + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε := by + let B (n : ℕ) := (A n).restrictStage (generatedVonNeumann A) (stage_le_generated A n) + have hB (n : ℕ) : (B n).units.concreteAlgebra=(A n).units.concreteAlgebra := + (A n).restrictStage_concreteAlgebra _ _ + have hmono : Monotone (fun n => (B n).units.concreteAlgebra) := by + simpa only [hB] using hA + have hgen : generated B=generated A := by simp only [generated,hB] + apply exists_matrix_approximated_centered_partition τ + (fun c hc => by + obtain ⟨z,hz⟩ := hfactor.factor c hc + refine ⟨z,?_⟩ + apply Subtype.ext + exact congrArg (fun x : generated A => (x : H →L[ℂ] H)) hz) + hfactor.diffuse B hmono F x (fun i _ => ?_) ht ε hε + rw [hgen] + exact (x i).property + +end + +/-! Countably many finite matrix algebras give L2 separability of their weak closure. -/ +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem stage_vector_range_separable (E : FiniteMatrixStage N) (ξ : H) : + TopologicalSpace.IsSeparable (Set.range (fun a : E.units.concreteAlgebra => a.val ξ)) := by + let : FiniteDimensional ℂ E.units.concreteAlgebra := E.units.concrete_finiteDimensional + exact TopologicalSpace.isSeparable_range (by fun_prop) + +theorem generated_vector_range_separable (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) (ξ : H) : + TopologicalSpace.IsSeparable (Set.range (fun a : generated A => a.val ξ)) := by + classical + let S : ℕ → Set H := fun n => Set.range (fun a : (A n).units.concreteAlgebra => a.val ξ) + have hs : TopologicalSpace.IsSeparable (⋃ n,S n) := + TopologicalSpace.IsSeparable.iUnion (fun n => stage_vector_range_separable (A n) ξ) + apply hs.closure.mono + rintro _ ⟨x,rfl⟩ + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨n,a,ha⟩ := exists_stage_strong_approximation A hA x {ξ} ε hε + exact ⟨a.val ξ,Set.mem_iUnion.mpr ⟨n,⟨a,rfl⟩⟩, + by simpa only [dist_eq_norm] using ha ξ (Finset.mem_singleton_self ξ)⟩ + +theorem generated_norm₂_separable (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) : + TopologicalSpace.IsSeparable (Set.range (baseVector (generatedTrace A τ hNM))) := + generated_vector_range_separable A hA τ.vector + +end FiniteMatrixStage + +/-! The actual finite-stage conditional expectations converge strongly and +adjoint-strongly on every vector in the given representation. The generated +algebra also has a constructed separable faithful cyclic Hilbert representation. -/ +open Filter +open scoped Topology +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem stageExpectation_strong_tendsto (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : M.toStarSubalgebra) + (hx : x.val ∈ generated A) (y : H) : + Tendsto (fun n => ((A n).stageExpectation τ hNM x).val y) atTop (𝓝 (x.val y)) := by + apply norm₂_limit_strong τ _ x ‖x‖ + (fun n => (A n).stageExpectation_norm_le τ hNM x) _ y + simpa only [TracialRepresentation.norm₂_sub,norm_sub_rev] using + stageExpectation_norm₂_tendsto A hA τ hNM x hx + +theorem stageExpectation_strong_star_tendsto (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : M.toStarSubalgebra) + (hx : x.val ∈ generated A) (y : H) : + Tendsto (fun n => (star ((A n).stageExpectation τ hNM x)).val y) atTop (𝓝 ((star x).val y)) := by + apply norm₂_limit_strong_star τ _ x ‖x‖ + (fun n => (A n).stageExpectation_norm_le τ hNM x) _ y + simpa only [TracialRepresentation.norm₂_sub,norm_sub_rev] using + stageExpectation_norm₂_tendsto A hA τ hNM x hx + +theorem exists_bounded_strong_stage_approximation (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : M.toStarSubalgebra) + (hx : x.val ∈ generated A) : + ∃ a : ℕ → M.toStarSubalgebra, + (∀ n,(a n).val ∈ (A n).units.concreteAlgebra) ∧ (∀ n,‖a n‖ ≤ ‖x‖) ∧ + (∀ y : H,Tendsto (fun n => (a n).val y) atTop (𝓝 (x.val y))) ∧ + (∀ y : H,Tendsto (fun n => (star (a n)).val y) atTop (𝓝 ((star x).val y))) := + ⟨fun n => (A n).stageExpectation τ hNM x,fun n => (A n).stageExpectation_mem τ hNM x, + fun n => (A n).stageExpectation_norm_le τ hNM x, + stageExpectation_strong_tendsto A hA τ hNM x hx, + stageExpectation_strong_star_tendsto A hA τ hNM x hx⟩ + +theorem generated_cyclicSpace_separable (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) : + TopologicalSpace.SeparableSpace (traceCyclicSpace (generatedTrace A τ hNM)) := + traceCyclicSpace_separable _ (generated_norm₂_separable A hA τ hNM) + +end FiniteMatrixStage + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixGenerators.lean b/lean/OAI/Analysis/FactorGeneration/MatrixGenerators.lean new file mode 100644 index 0000000000000000000000000000000000000000..1d1fd98f98c9577450cd855a4f84f50d83a334e9 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixGenerators.lean @@ -0,0 +1,280 @@ +import OAI.Analysis.FactorGeneration.ProjectionEncoding +import OAI.Analysis.FactorGeneration.TensorRefinement + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Diagonal projections and one full-support rank-one projection generate +every finite full matrix algebra, including matrices larger than size two. -/ +namespace MatrixUnitSystem +open scoped BigOperators +variable {ι A : Type*} [Fintype ι] [DecidableEq ι] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable (E : MatrixUnitSystem ι A) + +def fullProjectionMatrix : Matrix ι ι ℂ := fun _ _ => (Fintype.card ι : ℂ)⁻¹ + +omit [DecidableEq ι] in +theorem fullProjectionMatrix_projection [Nonempty ι] : + IsStarProjection (fullProjectionMatrix (ι := ι)) := by + have hn : (Fintype.card ι : ℂ) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero + constructor + · ext i j + simp only [Matrix.mul_apply,fullProjectionMatrix,Finset.sum_const,Finset.card_univ, + nsmul_eq_mul] + field_simp + · ext i j + simp [fullProjectionMatrix,Matrix.star_apply] + +def fullProjection : A := E.hom (fullProjectionMatrix (ι := ι)) + +theorem fullProjection_projection [Nonempty ι] : IsStarProjection E.fullProjection := + (fullProjectionMatrix_projection (ι := ι)).map E.hom + +omit [StarModule ℂ A] in +theorem diagonal_commute (i j : ι) : Commute (E.entry i i) (E.entry j j) := by + show E.entry i i*E.entry j j=E.entry j j*E.entry i i + by_cases h : i=j + · subst j; rfl + · simp [E.mul_entry,h,Ne.symm h] + +theorem cut_fullProjection (i j : ι) : + E.entry i i*E.fullProjection*E.entry j j=(Fintype.card ι : ℂ)⁻¹ • E.entry i j := by + simp only [fullProjection,hom_apply,fullProjectionMatrix,Finset.mul_sum,Finset.sum_mul, + mul_smul_comm,E.mul_entry,smul_ite,smul_zero] + simp [E.mul_entry,smul_ite] + +theorem recover_entry [Nonempty ι] (i j : ι) : + (Fintype.card ι : ℂ) • (E.entry i i*E.fullProjection*E.entry j j)=E.entry i j := by + rw [E.cut_fullProjection,smul_smul,mul_inv_cancel₀,one_smul] + exact_mod_cast Fintype.card_ne_zero + +theorem fullProjection_mem : E.fullProjection ∈ E.algebra := ⟨_,rfl⟩ + +theorem algebra_le_of_projection_mem [Nonempty ι] (S : StarSubalgebra ℂ A) + (hd : ∀ i,E.entry i i ∈ S) (hq : E.fullProjection ∈ S) : E.algebra ≤ S := by + apply (E.algebra_le_iff S).mpr + intro i j + rw [← E.recover_entry i j] + exact S.smul_mem (S.mul_mem (S.mul_mem (hd i) hq) (hd j)) _ + +theorem algebra_eq_adjoin_projections [Nonempty ι] : + E.algebra = StarAlgebra.adjoin ℂ (Set.range (fun i => E.entry i i) ∪ {E.fullProjection}) := by + apply le_antisymm + · apply E.algebra_le_of_projection_mem + · intro i; exact StarAlgebra.subset_adjoin ℂ _ (Or.inl ⟨i,rfl⟩) + · exact StarAlgebra.subset_adjoin ℂ _ (Or.inr rfl) + · apply StarAlgebra.adjoin_le + rintro x (⟨i,rfl⟩ | rfl) + · exact E.entry_mem i i + · exact E.fullProjection_mem + +end MatrixUnitSystem + +/-! Two actual self-adjoint generators for the weak closure of countably +many pairwise commuting finite full matrix factors. -/ +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem countable_projection_generator {ι : Type*} [Countable ι] [Nonempty ι] + (e : ι → (H →L[ℂ] H)) (hp : ∀ i,IsStarProjection (e i)) + (hc : ∀ i j,Commute (e i) (e j)) : + ∃ b : H →L[ℂ] H,IsSelfAdjoint b ∧ ‖b‖ ≤ 1 ∧ wstar {b}=wstar (Set.range e) := by + obtain ⟨f,hf⟩ := exists_surjective_nat ι + obtain ⟨b,hb,hn,hgen⟩ := CommutingProjectionEncoding.exists_selfAdjoint_generator + (fun n => e (f n)) (fun n => hp (f n)) (fun n m => hc (f n) (f m)) + refine ⟨b,hb,hn,hgen.trans ?_⟩ + congr 1 + ext x + constructor + · rintro ⟨n,rfl⟩; exact ⟨f n,rfl⟩ + · rintro ⟨i,rfl⟩ + obtain ⟨n,rfl⟩ := hf i + exact ⟨n,rfl⟩ + +namespace MatrixUnitSystem +variable {ι κ A : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +theorem fullProjection_commute (E : MatrixUnitSystem ι A) (F : MatrixUnitSystem κ A) + (hc : ∀ i j k l,Commute (E.entry i j) (F.entry k l)) : + Commute E.fullProjection F.fullProjection := by + apply (E.commute_algebra_iff _).mpr _ _ E.fullProjection_mem + intro i j + exact ((F.commute_algebra_iff _).mpr (fun k l => (hc i j k l).symm) _ + F.fullProjection_mem).symm + +end MatrixUnitSystem +namespace FiniteMatrixStage +variable {N : VonNeumannAlgebra H} + +theorem two_generators_of_commuting_factors (F : ℕ → FiniteMatrixStage N) + (hc : ∀ n m,n ≠ m → ∀ i j k l, + Commute ((F n).units.entry i j) ((F m).units.entry k l)) : + ∃ a ∈ generated F,∃ b ∈ generated F, + IsSelfAdjoint a ∧ IsSelfAdjoint b ∧ wstar {a,b}=generated F := by + classical + let I := (n : ℕ) × Fin (F n).size + let : Nonempty I := ⟨⟨0,⟨0,(F 0).positive⟩⟩⟩ + let (n : ℕ) : Nonempty (Fin (F n).size) := ⟨⟨0,(F n).positive⟩⟩ + let d : I → (H →L[ℂ] H) := fun i => ((F i.1).units.entry i.2 i.2).val + let q : ℕ → (H →L[ℂ] H) := fun n => (F n).units.fullProjection.val + have hdproj (i : I) : IsStarProjection (d i) := + ((F i.1).units.diagonal_projection i.2).map N.toStarSubalgebra.subtype + have hqproj (n : ℕ) : IsStarProjection (q n) := + (F n).units.fullProjection_projection.map N.toStarSubalgebra.subtype + have hdcomm (i j : I) : Commute (d i) (d j) := by + obtain ⟨n,i⟩ := i + obtain ⟨m,j⟩ := j + by_cases h : n=m + · subst m + exact congrArg Subtype.val ((F n).units.diagonal_commute i j).eq + · exact congrArg Subtype.val (hc n m h i i j j).eq + have hqcomm (n m : ℕ) : Commute (q n) (q m) := by + by_cases h : n=m + · subst m; exact Commute.refl _ + · exact congrArg Subtype.val ((F n).units.fullProjection_commute (F m).units (hc n m h)).eq + obtain ⟨a,ha,_,hagen⟩ := countable_projection_generator d hdproj hdcomm + obtain ⟨b,hb,_,hbgen⟩ := countable_projection_generator q hqproj hqcomm + have hdmem (i : I) : d i ∈ generated F := + stage_le_generated F i.1 (((F i.1).units.mem_concreteAlgebra _).mpr + ((F i.1).units.entry_mem i.2 i.2)) + have hqmem (n : ℕ) : q n ∈ generated F := + stage_le_generated F n (((F n).units.mem_concreteAlgebra _).mpr (F n).units.fullProjection_mem) + have hamem : a ∈ generated F := by + have hle : wstar {a} ≤ generated F := by + rw [hagen] + exact wstar_le (generated_closed F) (by rintro _ ⟨i,rfl⟩; exact hdmem i) + exact hle (subset_wstar _ rfl) + have hbmem : b ∈ generated F := by + have hle : wstar {b} ≤ generated F := by + rw [hbgen] + exact wstar_le (generated_closed F) (by rintro _ ⟨n,rfl⟩; exact hqmem n) + exact hle (subset_wstar _ rfl) + refine ⟨a,hamem,b,hbmem,ha,hb,le_antisymm ?_ ?_⟩ + · exact wstar_le (generated_closed F) (by rintro _ (rfl | rfl) <;> assumption) + · apply generated_minimal F _ (wstar_closed _) + intro n x hx + let y : N.toStarSubalgebra := ⟨x,(F n).units.concreteAlgebra_le hx⟩ + let S := (wstar {a,b}).comap N.toStarSubalgebra.subtype + have hdS (i : Fin (F n).size) : (F n).units.entry i i ∈ S := by + change d ⟨n,i⟩ ∈ wstar {a,b} + apply (wstar_mono (s := {a}) (t := {a,b}) (by simp)) + rw [hagen] + exact subset_wstar (Set.range d) (Set.mem_range_self (⟨n,i⟩ : I)) + have hqS : (F n).units.fullProjection ∈ S := by + change q n ∈ wstar {a,b} + apply (wstar_mono (s := {b}) (t := {a,b}) (by simp)) + rw [hbgen] + exact subset_wstar _ (Set.mem_range_self n) + exact (F n).units.algebra_le_of_projection_mem S hdS hqS + (((F n).units.mem_concreteAlgebra y).mp hx) + +end FiniteMatrixStage + +end + +/-! The retained tensor extensions supply commuting factors generating +exactly the original matrix-union weak closure. -/ +namespace FiniteMatrixStage +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N : VonNeumannAlgebra H} + +theorem concrete_le_iff (E : FiniteMatrixStage N) (S : StarSubalgebra ℂ (H →L[ℂ] H)) : + E.units.concreteAlgebra ≤ S ↔ E.units.algebra ≤ S.comap N.toStarSubalgebra.subtype := by + constructor + · intro h x hx + exact h ((E.units.mem_concreteAlgebra x).mpr hx) + · intro h x hx + let y : N.toStarSubalgebra := ⟨x,E.units.concreteAlgebra_le hx⟩ + exact h ((E.units.mem_concreteAlgebra y).mp hx) + +theorem exists_commuting_factors_of_tensor_extensions (A : ℕ → FiniteMatrixStage N) + (hzero : A 0=scalarStage N) (hstep : ∀ n,TensorExtension (A n) (A (n+1))) : + ∃ F : ℕ → FiniteMatrixStage N, + (∀ n m,n ≠ m → ∀ i j k l,Commute ((F n).units.entry i j) ((F m).units.entry k l)) ∧ + generated F=generated A := by + have hm : Monotone (fun n => (A n).units.algebra) := + monotone_nat_of_le_succ (fun n => (hstep n).algebra_le) + choose F hc he using hstep + have hFA (n : ℕ) : (F n).units.algebra ≤ (A (n+1)).units.algebra := by + rw [he n]; exact le_sup_right + have hcomm_lt (n m : ℕ) (hnm : n < m) (i j : Fin (F n).size) (k l : Fin (F m).size) : + Commute ((F n).units.entry i j) ((F m).units.entry k l) := by + exact ((A m).units.commute_algebra_iff _).mpr (fun a b => hc m a b k l) _ + (hm (Nat.succ_le_of_lt hnm) (hFA n ((F n).units.entry_mem i j))) + refine ⟨F,?_,le_antisymm ?_ ?_⟩ + · intro n m hnm i j k l + rcases lt_or_gt_of_ne hnm with h | h + · exact hcomm_lt n m h i j k l + · exact (hcomm_lt m n h k l i j).symm + · apply generated_minimal F _ (generated_closed A) + intro n + apply ((F n).concrete_le_iff _).mpr + exact (hFA n).trans (((A (n+1)).concrete_le_iff _).mp (stage_le_generated A (n+1))) + · apply generated_minimal A _ (generated_closed F) + intro n + apply ((A n).concrete_le_iff _).mpr + induction n with + | zero => + rw [hzero] + apply ((scalarStage N).units.algebra_le_iff _).mpr + intro i j + exact (generated F).one_mem + | succ n ih => + rw [he n] + exact sup_le ih (((F n).concrete_le_iff _).mp (stage_le_generated F n)) + +theorem two_generators_of_tensor_extensions (A : ℕ → FiniteMatrixStage N) + (hzero : A 0=scalarStage N) (hstep : ∀ n,TensorExtension (A n) (A (n+1))) : + ∃ a ∈ generated A,∃ b ∈ generated A, + IsSelfAdjoint a ∧ IsSelfAdjoint b ∧ wstar {a,b}=generated A := by + obtain ⟨F,hF,hgen⟩ := exists_commuting_factors_of_tensor_extensions A hzero hstep + rw [← hgen] + exact two_generators_of_commuting_factors F hF + +end FiniteMatrixStage + +/-! The represented irreducible matrix subfactor can be constructed together +with two self-adjoint generators, without hyperfinite uniqueness. -/ +namespace Tracial +open UltrapowerBridge FiniteMatrixStage +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem exists_irreducible_two_generated_subfactor + (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ P : VonNeumannAlgebra H,P ≤ N ∧ IsII1Factor P.toStarSubalgebra ∧ + (∀ c : M.toStarSubalgebra,(∀ a : P.toStarSubalgebra,a.val*c.val=c.val*a.val) → + c=τ.trace c • (1 : M.toStarSubalgebra)) ∧ + ∃ a ∈ P,∃ b ∈ P,IsSelfAdjoint a ∧ IsSelfAdjoint b ∧ wstar {a,b}=P.toStarSubalgebra := by + let S : Set M.toStarSubalgebra := {b | τ.trace b=0} + obtain ⟨x,hx,hdense⟩ := exists_countable_norm₂_dense τ S + ⟨0,by change τ.trace 0=0; simp [TracialRepresentation.trace]⟩ + (hsep.mono (Set.image_subset_range _ _)) + obtain ⟨A,hA,hstep,_,_,hlim⟩ := exists_countable_tensor_refinement τ hNM + hfactor hdiff hirr x hx (scalarStage N) + have hscalar := generated_relative_scalar A τ hNM + (scalar_common_commutant_of_dense_energy_decay τ hNM A x hdense hlim) + obtain ⟨a,ha,b,hb,hsa,hsb,hgen⟩ := two_generators_of_tensor_extensions A hA hstep + exact ⟨generatedVonNeumann A,generatedVonNeumann_le A, + generated_isII1 A τ hNM hdiff hscalar,hscalar,a,ha,b,hb,hsa,hsb,hgen⟩ + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixRefinement.lean b/lean/OAI/Analysis/FactorGeneration/MatrixRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a18c7288c07c4d525fb9436ff847c7bf6ee3dc1 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixRefinement.lean @@ -0,0 +1,386 @@ +import OAI.Analysis.FactorGeneration.EnergyDescent +import OAI.Analysis.FactorGeneration.Expectations +import OAI.Analysis.FactorGeneration.MatrixAlgebras +import OAI.Analysis.FactorGeneration.UniformPartitions + +namespace OAI + +noncomputable section + +namespace Generator + +/-! A normal element of a diffuse finite factor has L2 approximations in +constructed full dyadic matrix algebras. No prescribed MASA is needed. -/ +namespace Tracial +open scoped BigOperators + +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_normal_matrix_approximation + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (x : M.toStarSubalgebra) [IsStarNormal x] (ε : ℝ) (hε : 0 < ε) : + ∃ k n : ℕ,n=2^k ∧ ∃ E : MatrixUnitSystem (Fin n) M.toStarSubalgebra, + ∃ c : Fin n → ℂ,τ.norm₂ (x-∑ j,c j • E.entry j j) < ε := by + obtain ⟨Q,c,hc⟩ := exists_normal_spectral_approximation x (ε/2) (by positivity) + obtain ⟨k,R,hn,ht,d,hd⟩ := exists_dyadic_spectral_sum_approximation τ hdiff Q + (fun _ : Unit => c) (ε/2) (by positivity) + obtain ⟨E,hdiag,hstar,hmul,hsum⟩ := exists_matrixUnits_for_partition τ hfactor R + (by rw [hn]; positivity) (fun i j => (ht i).trans (ht j).symm) + let F : MatrixUnitSystem (Fin R.size) M.toStarSubalgebra := ⟨E,hstar,hmul,hsum⟩ + refine ⟨k,R.size,hn,F,d (),?_⟩ + change τ.norm₂ (x-∑ j,d () j • E j j) < ε + simp only [hdiag] + have he : x-∑ j,d () j • (R.piece j).val = + (x-∑ i,c i • (Q.piece i).val)+ + ((∑ i,c i • (Q.piece i).val)-∑ j,d () j • (R.piece j).val) := by abel + rw [he] + exact (τ.norm₂_add_le _ _).trans_lt (by + have h₁ := (τ.norm₂_le_norm _).trans_lt hc + have h₂ := hd () + linarith) + +end + +/-! A constructed full matrix algebra reduces the actual relative-commutant +expectation energy by a uniform factor for a centered nonzero element. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N D M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem commutator_norm₂_bound (a b : M.toStarSubalgebra) : + τ.norm₂ (a*b-b*a) ≤ 2*‖a‖*τ.norm₂ b := by + have h := norm_sub_le (baseVector τ (a*b)) (baseVector τ (b*a)) + change τ.norm₂ (a*b-b*a) ≤ τ.norm₂ (a*b)+τ.norm₂ (b*a) at h + have hl := τ.norm₂_mul_le a b + have hr := τ.norm₂_mul_le_right b a + nlinarith + +theorem commutator_norm₂_approximation (u v x z : M.toStarSubalgebra) + (hc : v*z=z*v) : + τ.norm₂ (u*x-x*u) ≤ 2*‖u‖*τ.norm₂ (x-z)+2*‖z‖*τ.norm₂ (u-v) := by + have he : u*x-x*u=(u*(x-z)-(x-z)*u)- (z*(u-v)-(u-v)*z) := by + simp only [mul_sub,sub_mul] + rw [hc] + abel + rw [he] + have h := norm_sub_le (baseVector τ (u*(x-z)-(x-z)*u)) + (baseVector τ (z*(u-v)-(u-v)*z)) + change τ.norm₂ ((u*(x-z)-(x-z)*u)-(z*(u-v)-(u-v)*z)) ≤ + τ.norm₂ (u*(x-z)-(x-z)*u)+τ.norm₂ (z*(u-v)-(u-v)*z) at h + exact h.trans (add_le_add (commutator_norm₂_bound τ u (x-z)) + (commutator_norm₂_bound τ z (u-v))) + +theorem expectation_energy_descent_of_unitary_approximation (hDM : D ≤ M) + (u : unitary M.toStarSubalgebra) (v x : M.toStarSubalgebra) + (hd : τ.norm₂ x ≤ τ.norm₂ (conjugateLinear u x-x)) + (hclose : τ.norm₂ ((u : M.toStarSubalgebra)-v) < + τ.norm₂ x/(4*(‖x‖+1))) + (hc : ∀ z : M.toStarSubalgebra,z.val ∈ D → v*z=z*v) : + τ.norm₂ (conditionalExpectation τ hDM x)^2 ≤ (15/16 : ℝ)*τ.norm₂ x^2 := by + let z := conditionalExpectation τ hDM x + have hcomm := commutator_norm₂_approximation τ (u : M.toStarSubalgebra) v x z + (hc z (conditionalExpectation_mem τ hDM x)) + have hdisp := displacement_le_commutator τ u x + have hu := unitary_norm_le (u : M.toStarSubalgebra) u.property.1 + have hz := conditionalExpectation_norm_le τ hDM x + have hn : 0 ≤ τ.norm₂ (x-z) := norm_nonneg _ + have hδ : 0 ≤ τ.norm₂ ((u : M.toStarSubalgebra)-v) := norm_nonneg _ + have hsmall : 4*(‖x‖+1)*τ.norm₂ ((u : M.toStarSubalgebra)-v) < τ.norm₂ x := by + have h := (lt_div_iff₀ (by positivity : 0 < 4*(‖x‖+1))).mp hclose + nlinarith + have hr : τ.norm₂ x/4 ≤ τ.norm₂ (x-z) := by + have h₁ := mul_le_mul_of_nonneg_right hu hn + have h₂ := mul_le_mul_of_nonneg_right hz hδ + nlinarith + have hpy := conditionalExpectation_pythagoras τ hDM x + change τ.norm₂ z^2+τ.norm₂ (x-z)^2=τ.norm₂ x^2 at hpy + nlinarith [sq_nonneg (τ.norm₂ (x-z)-τ.norm₂ x/4), + show 0 ≤ τ.norm₂ x from norm_nonneg _] + +theorem exists_irreducible_matrix_energy_descent (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (hx : x ≠ 0) (ht : τ.trace x=0) : + ∃ k n : ℕ,n=2^k ∧ ∃ E : MatrixUnitSystem (Fin n) N.toStarSubalgebra, + τ.norm₂ (conditionalExpectation τ (E.map (coordinateInclusion hNM)).relativeVonNeumann_le x)^2 ≤ + (15/16 : ℝ)*τ.norm₂ x^2 := by + let P := insideAlgebra (M := M) (P := N) + obtain ⟨u,hu⟩ := exists_strict_centered_displacement τ P (by + intro c hc + exact hirr c (fun a => hc ⟨coordinateInclusion hNM a,a.property⟩)) x hx ht + let a : N.toStarSubalgebra := ⟨(u.val : M.toStarSubalgebra).val,u.property⟩ + let : IsStarNormal a := ⟨by + apply Subtype.ext + exact congrArg (fun b : M.toStarSubalgebra => b.val) + (u.val.property.1.trans u.val.property.2.symm)⟩ + have hxpos : 0 < τ.norm₂ x := lt_of_le_of_ne (norm_nonneg _) + (fun h => hx ((τ.norm₂_eq_zero_iff x).mp h.symm)) + obtain ⟨k,n,hn,E,c,hc⟩ := exists_normal_matrix_approximation (restrictedTrace τ hNM) + hfactor hdiff a (τ.norm₂ x/(4*(‖x‖+1))) (by positivity) + let F := E.map (coordinateInclusion hNM) + let v : M.toStarSubalgebra := ∑ j,c j • F.entry j j + refine ⟨k,n,hn,E,expectation_energy_descent_of_unitary_approximation τ + F.relativeVonNeumann_le u.val v x hu.le ?_ ?_⟩ + · change τ.norm₂ (coordinateInclusion hNM (a-∑ j,c j • E.entry j j)) < _ at hc + rw [map_sub,map_sum] at hc + simp only [map_smul] at hc + exact hc + · intro z hz + have hz' := ((F.relativeStar_mem z.val).mp hz).2 + change (∑ j,c j • F.entry j j)*z=z*(∑ j,c j • F.entry j j) + simp only [Finset.sum_mul,Finset.mul_sum,smul_mul_assoc,mul_smul_comm] + apply Finset.sum_congr rfl + intro j _ + exact congrArg (fun b : M.toStarSubalgebra => c j • b) (Subtype.ext (hz' j j)) + +end Tracial + +/-! Concrete commutants reverse matrix-algebra inclusion. Expectations are +compatible with restriction to an intermediate represented subalgebra. -/ +section +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {D P M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem conditionalExpectation_restricted (hPM : P ≤ M) (hDP : D ≤ P) + (x : P.toStarSubalgebra) : + conditionalExpectation τ (hDP.trans hPM) (coordinateInclusion hPM x)= + coordinateInclusion hPM (conditionalExpectation (restrictedTrace τ hPM) hDP x) := by + apply conditionalExpectation_eq_of_orthogonal τ (hDP.trans hPM) + · exact conditionalExpectation_mem (restrictedTrace τ hPM) hDP x + · intro a + let b : insideAlgebra (M := P) (P := D) := ⟨⟨a.val.val,hDP a.property⟩,a.property⟩ + exact conditionalExpectation_orthogonal (restrictedTrace τ hPM) hDP x b + +end Tracial +namespace MatrixUnitSystem +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable {ι κ : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] + +theorem relative_antitone (E : MatrixUnitSystem ι M.toStarSubalgebra) + (F : MatrixUnitSystem κ M.toStarSubalgebra) (h : E.algebra ≤ F.algebra) : + F.relativeVonNeumann ≤ E.relativeVonNeumann := by + intro x hx + have hx' := (F.relativeStar_mem x).mp hx + apply (E.relativeStar_mem x).mpr + refine ⟨hx'.1,?_⟩ + let y : M.toStarSubalgebra := ⟨x,hx'.1⟩ + have hF : ∀ i j,Commute (F.entry i j) y := fun i j => Subtype.ext (hx'.2 i j) + intro i j + exact congrArg Subtype.val (((F.commute_algebra_iff y).mpr hF) _ (h (E.entry_mem i j))).eq + +/-- The product commutant is exactly the commutant of the new system inside +of the old commutant, with both algebras represented on the same H. -/ +theorem relative_product_inside (E : MatrixUnitSystem ι M.toStarSubalgebra) + (F : MatrixUnitSystem κ E.relativeVonNeumann.toStarSubalgebra) + (hc : ∀ i j k l,Commute (E.entry i j) + ((F.map (coordinateInclusion E.relativeVonNeumann_le)).entry k l)) : + (E.product (F.map (coordinateInclusion E.relativeVonNeumann_le)) hc).relativeVonNeumann = + F.relativeVonNeumann := by + let G := F.map (coordinateInclusion E.relativeVonNeumann_le) + apply le_antisymm + · intro x hx + have hE := E.relative_antitone (E.product G hc) (E.algebra_le_product_left G hc) hx + have hG := G.relative_antitone (E.product G hc) (E.algebra_le_product_right G hc) hx + exact (F.relativeStar_mem x).mpr ⟨hE,((G.relativeStar_mem x).mp hG).2⟩ + · intro x hx + have hF := (F.relativeStar_mem x).mp hx + have hE := (E.relativeStar_mem x).mp hF.1 + apply ((E.product G hc).relativeStar_mem x).mpr + refine ⟨hE.1,?_⟩ + intro a b + change ((E.entry a.1 b.1).val*(F.entry a.2 b.2).val)*x= + x*((E.entry a.1 b.1).val*(F.entry a.2 b.2).val) + rw [mul_assoc,hF.2,← mul_assoc,hE.2,mul_assoc] + +end MatrixUnitSystem + +end + +/-! Quantitative energy descent retaining a prescribed finite matrix algebra +in an irreducible inclusion. All expectations and refinements are constructed. -/ +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} {ι : Type*} [Fintype ι] [DecidableEq ι] + +theorem exists_compatible_matrix_energy_descent (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (E : MatrixUnitSystem ι N.toStarSubalgebra) (o : ι) + (x : M.toStarSubalgebra) (ht : τ.trace x=0) + (hy : conditionalExpectation τ (E.map (coordinateInclusion hNM)).relativeVonNeumann_le x ≠ 0) : + ∃ k n : ℕ,n=2^k ∧ ∃ F : MatrixUnitSystem (Fin n) N.toStarSubalgebra, + ∃ hc : ∀ i j l m,Commute (E.entry i j) (F.entry l m), + E.algebra ≤ (E.product F hc).algebra ∧ + τ.norm₂ (conditionalExpectation τ + ((E.product F hc).map (coordinateInclusion hNM)).relativeVonNeumann_le x)^2 ≤ + (15/16 : ℝ)*τ.norm₂ + (conditionalExpectation τ (E.map (coordinateInclusion hNM)).relativeVonNeumann_le x)^2 := by + let EM := E.map (coordinateInclusion hNM) + let C := EM.relativeVonNeumann + let hCM := EM.relativeVonNeumann_le + let y := conditionalExpectation τ hCM x + let yC : C.toStarSubalgebra := ⟨y.val,conditionalExpectation_mem τ hCM x⟩ + let τC := restrictedTrace τ hCM + have hyC : yC ≠ 0 := by + intro h + apply hy + exact Subtype.ext (congrArg (fun b : C.toStarSubalgebra => b.val) h) + have htC : τC.trace yC=0 := (conditionalExpectation_trace τ hCM x).trans ht + obtain ⟨k,n,hn,G,hG⟩ := exists_irreducible_matrix_energy_descent τC + (E.relative_inclusion hNM) (E.relative_scalar_center o hfactor) + (E.relative_diffuse o hdiff) (E.relative_irreducible hNM o hirr) yC hyC htC + let F := G.map (coordinateInclusion E.relativeVonNeumann_le) + have hc : ∀ i j l m,Commute (E.entry i j) (F.entry l m) := by + intro i j l m + apply Subtype.ext + exact ((E.relativeStar_mem (G.entry l m).val).mp (G.entry l m).property).2 i j + let GM := G.map (coordinateInclusion (E.relative_inclusion hNM)) + have hcM : ∀ i j l m,Commute (EM.entry i j) + ((GM.map (coordinateInclusion hCM)).entry l m) := by + intro i j l m + apply Subtype.ext + exact congrArg (fun b : N.toStarSubalgebra => b.val) (hc i j l m).eq + have hproduct : ((E.product F hc).map (coordinateInclusion hNM)).relativeVonNeumann = + GM.relativeVonNeumann := by + convert EM.relative_product_inside GM hcM using 1 + rfl + let hDC := GM.relativeVonNeumann_le + have he : conditionalExpectation τ (hDC.trans hCM) x = + coordinateInclusion hCM (conditionalExpectation τC hDC yC) := by + rw [← conditionalExpectation_tower τ (hDC.trans hCM) hCM hDC x] + exact conditionalExpectation_restricted τ hCM hDC yC + refine ⟨k,n,hn,F,hc,E.algebra_le_product_left F hc,?_⟩ + have hnorm : τ.norm₂ (conditionalExpectation τ (hDC.trans hCM) x)^2 ≤ + (15/16 : ℝ)*τ.norm₂ y^2 := by + rw [he] + exact hG + simpa only [hproduct] using hnorm + +end Tracial + +/-! Reindex full matrix units without changing their actual algebra or +relative commutant. This keeps iterated constructions indexed by Fin n. -/ +namespace MatrixUnitSystem +open scoped BigOperators +variable {ι κ A : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] + +def reindex (E : MatrixUnitSystem ι A) (e : κ ≃ ι) : MatrixUnitSystem κ A where + entry i j := E.entry (e i) (e j) + star_entry i j := E.star_entry _ _ + mul_entry i j k l := by simpa only [e.apply_eq_iff_eq] using E.mul_entry (e i) (e j) (e k) (e l) + total := (e.sum_comp (fun i => E.entry i i)).trans E.total + +theorem reindex_algebra (E : MatrixUnitSystem ι A) (e : κ ≃ ι) : + (E.reindex e).algebra=E.algebra := by + apply le_antisymm + · exact ((E.reindex e).algebra_le_iff _).mpr (fun i j => E.entry_mem _ _) + · apply (E.algebra_le_iff _).mpr + intro i j + simpa only [reindex,Equiv.apply_symm_apply] using + (E.reindex e).entry_mem (e.symm i) (e.symm j) + +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem map_algebra_mono (E : MatrixUnitSystem ι N.toStarSubalgebra) + (F : MatrixUnitSystem κ N.toStarSubalgebra) (h : E.algebra ≤ F.algebra) + (f : N.toStarSubalgebra →⋆ₐ[ℂ] M.toStarSubalgebra) : + (E.map f).algebra ≤ (F.map f).algebra := by + apply ((E.map f).algebra_le_iff _).mpr + intro i j + obtain ⟨a,ha⟩ := (F.mem_algebra (E.entry i j)).mp (h (E.entry_mem i j)) + change f (E.entry i j) ∈ (F.map f).algebra + rw [← ha] + simp only [map_sum,map_smul] + exact (F.map f).algebra.sum_mem fun k _ => + (F.map f).algebra.sum_mem fun l _ => (F.map f).algebra.smul_mem ((F.map f).entry_mem k l) _ + +theorem mapped_reindex_relative (E : MatrixUnitSystem ι N.toStarSubalgebra) + (e : κ ≃ ι) (f : N.toStarSubalgebra →⋆ₐ[ℂ] M.toStarSubalgebra) : + ((E.reindex e).map f).relativeVonNeumann=(E.map f).relativeVonNeumann := by + apply le_antisymm + · exact (E.map f).relative_antitone _ (E.map_algebra_mono _ (E.reindex_algebra e).ge f) + · exact ((E.reindex e).map f).relative_antitone _ ((E.reindex e).map_algebra_mono _ + (E.reindex_algebra e).le f) + +end MatrixUnitSystem + +/-! An actual full matrix algebra of any positive finite size can be +constructed in the relative commutant. No commuting matrix units are assumed. -/ +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} {ι : Type*} [Fintype ι] [DecidableEq ι] + +theorem exists_commuting_matrix_extension + (τ : TracialRepresentation M) (E : MatrixUnitSystem ι M.toStarSubalgebra) (o : ι) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (n : ℕ) (hn : 0 < n) : + ∃ F : MatrixUnitSystem (Fin n) M.toStarSubalgebra, + ∃ hc : ∀ i j k l,Commute (E.entry i j) (F.entry k l), + Function.Injective F.hom ∧ + (∀ j,τ.trace (F.entry j j)=(((n : ℝ)⁻¹ : ℝ) : ℂ)) ∧ + E.algebra ≤ (E.product F hc).algebra ∧ + WOTClosed (E.product F hc).concreteAlgebra := by + let C := E.relativeVonNeumann + let τC := restrictedTrace τ E.relativeVonNeumann_le + obtain ⟨Q,hsize,ht⟩ := exists_uniform_trace_partition τC (E.relative_diffuse o hdiff) + n (identityProjection C) (n : ℝ)⁻¹ (inv_nonneg.mpr (Nat.cast_nonneg n)) (by + change τC.trace 1=(n : ℂ)*(((n : ℝ)⁻¹ : ℝ) : ℂ) + simp [τC.trace_one,hn.ne']) + subst n + obtain ⟨G,hdiag,hG,hGM,hGW⟩ := exists_matrixAlgebra_for_unit_partition τC + (E.relative_scalar_center o hfactor) Q hn (fun i j => (ht i).trans (ht j).symm) + let f := coordinateInclusion E.relativeVonNeumann_le + let F := G.map f + have hc : ∀ i j k l,Commute (E.entry i j) (F.entry k l) := by + intro i j k l + apply Subtype.ext + exact ((E.relativeStar_mem (G.entry k l).val).mp (G.entry k l).property).2 i j + refine ⟨F,hc,?_,?_,E.algebra_le_product_left F hc, + (E.product F hc).concreteAlgebra_wotClosed⟩ + · intro a b hab + apply hG + have hm (a : Matrix (Fin Q.size) (Fin Q.size) ℂ) : F.hom a=f (G.hom a) := by + simp only [MatrixUnitSystem.hom_apply,map_sum,map_smul] + rfl + rw [hm,hm] at hab + exact (StarSubalgebra.inclusion_injective E.relativeVonNeumann_le) hab + · intro j + change τC.trace (G.entry j j)=_ + rw [hdiag] + exact ht j + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixSequence.lean b/lean/OAI/Analysis/FactorGeneration/MatrixSequence.lean new file mode 100644 index 0000000000000000000000000000000000000000..c8e872e73d286e86bc76f251359b3d2d31ce7646 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixSequence.lean @@ -0,0 +1,583 @@ +import OAI.Analysis.FactorGeneration.MatrixRefinement + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Finite matrix stages and a quantified refinement operation, including +zero expectation. Reindexing changes no represented algebra. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +structure FiniteMatrixStage (N : VonNeumannAlgebra H) where + size : ℕ + positive : 0 < size + units : MatrixUnitSystem (Fin size) N.toStarSubalgebra + +namespace FiniteMatrixStage +open Tracial +variable {N M : VonNeumannAlgebra H} + +def commutant (E : FiniteMatrixStage N) (hNM : N ≤ M) : VonNeumannAlgebra H := + (E.units.map (coordinateInclusion hNM)).relativeVonNeumann + +theorem commutant_le (E : FiniteMatrixStage N) (hNM : N ≤ M) : E.commutant hNM ≤ M := + (E.units.map (coordinateInclusion hNM)).relativeVonNeumann_le + +def energy (E : FiniteMatrixStage N) (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) : ℝ := + τ.norm₂ (conditionalExpectation τ (E.commutant_le hNM) x)^2 + +theorem energy_nonneg (E : FiniteMatrixStage N) (τ : TracialRepresentation M) + (hNM : N ≤ M) (x : M.toStarSubalgebra) : 0 ≤ E.energy τ hNM x := sq_nonneg _ + +theorem commutant_antitone (E F : FiniteMatrixStage N) (hNM : N ≤ M) + (hEF : E.units.algebra ≤ F.units.algebra) : F.commutant hNM ≤ E.commutant hNM := + (E.units.map (coordinateInclusion hNM)).relative_antitone _ + (E.units.map_algebra_mono F.units hEF (coordinateInclusion hNM)) + +theorem energy_antitone (E F : FiniteMatrixStage N) (τ : TracialRepresentation M) + (hNM : N ≤ M) (hEF : E.units.algebra ≤ F.units.algebra) (x : M.toStarSubalgebra) : + F.energy τ hNM x ≤ E.energy τ hNM x := by + have h := conditionalExpectation_nested_energy τ (F.commutant_le hNM) (E.commutant_le hNM) + (E.commutant_antitone F hNM hEF) x + dsimp [energy] + nlinarith [sq_nonneg (τ.norm₂ (conditionalExpectation τ (E.commutant_le hNM) x- + conditionalExpectation τ (F.commutant_le hNM) x))] + +theorem exists_refinement_descent (E : FiniteMatrixStage N) (τ : TracialRepresentation M) + (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (ht : τ.trace x=0) : + ∃ F : FiniteMatrixStage N,E.units.algebra ≤ F.units.algebra ∧ + F.energy τ hNM x ≤ (15/16 : ℝ)*E.energy τ hNM x := by + by_cases hz : conditionalExpectation τ (E.commutant_le hNM) x=0 + · refine ⟨E,le_rfl,?_⟩ + simp [energy,hz] + · obtain ⟨k,n,hn,F,hc,hEF,hdesc⟩ := exists_compatible_matrix_energy_descent τ hNM + hfactor hdiff hirr E.units ⟨0,E.positive⟩ x ht hz + let G := E.units.product F hc + let e := (Fintype.equivFin (Fin E.size × Fin n)).symm + let S : FiniteMatrixStage N := ⟨Fintype.card (Fin E.size × Fin n),by + simp only [Fintype.card_prod,Fintype.card_fin] + rw [hn] + exact Nat.mul_pos E.positive (by positivity),G.reindex e⟩ + refine ⟨S,?_,?_⟩ + · change E.units.algebra ≤ (G.reindex e).algebra + rw [G.reindex_algebra] + exact hEF + · change τ.norm₂ (conditionalExpectation τ + ((G.reindex e).map (coordinateInclusion hNM)).relativeVonNeumann_le x)^2 ≤ _ + simp only [G.mapped_reindex_relative e (coordinateInclusion hNM)] + exact hdesc + +end FiniteMatrixStage + +end + +/-! Iterated compatible full matrix refinements attain every positive +finite-family commutant expectation budget. The reduction factor is proved. -/ +namespace FiniteMatrixStage + +section +open scoped BigOperators +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +include hfactor hdiff hirr + +theorem exists_finite_family_descent {σ : Type*} (S : Finset σ) + (x : σ → M.toStarSubalgebra) (ht : ∀ s ∈ S,τ.trace (x s)=0) (E : FiniteMatrixStage N) : + ∃ F : FiniteMatrixStage N,E.units.algebra ≤ F.units.algebra ∧ + ∀ s ∈ S,F.energy τ hNM (x s) ≤ (15/16 : ℝ)*E.energy τ hNM (x s) := by + classical + induction S using Finset.induction_on with + | empty => exact ⟨E,le_rfl,by simp⟩ + | @insert s S hs ih => + obtain ⟨F,hEF,hF⟩ := ih (fun t ht' => ht t (Finset.mem_insert_of_mem ht')) + obtain ⟨G,hFG,hG⟩ := F.exists_refinement_descent τ hNM hfactor hdiff hirr (x s) + (ht s (Finset.mem_insert_self s S)) + refine ⟨G,hEF.trans hFG,?_⟩ + intro t ht' + rcases Finset.mem_insert.mp ht' with rfl | ht' + · exact hG.trans (mul_le_mul_of_nonneg_left (E.energy_antitone F τ hNM hEF _) (by norm_num)) + · exact (F.energy_antitone G τ hNM hFG _).trans (hF t ht') + +theorem exists_iterated_energy_descent {σ : Type*} (S : Finset σ) + (x : σ → M.toStarSubalgebra) (ht : ∀ s ∈ S,τ.trace (x s)=0) + (E : FiniteMatrixStage N) (r : ℕ) : + ∃ F : FiniteMatrixStage N,E.units.algebra ≤ F.units.algebra ∧ + ∀ s ∈ S,F.energy τ hNM (x s) ≤ (15/16 : ℝ)^r*E.energy τ hNM (x s) := by + induction r with + | zero => exact ⟨E,le_rfl,by simp⟩ + | succ r ih => + obtain ⟨F,hEF,hF⟩ := ih + obtain ⟨G,hFG,hG⟩ := exists_finite_family_descent τ hNM hfactor hdiff hirr S x ht F + refine ⟨G,hEF.trans hFG,?_⟩ + intro s hs + calc G.energy τ hNM (x s) ≤ (15/16 : ℝ)*F.energy τ hNM (x s) := hG s hs + _ ≤ (15/16 : ℝ)*((15/16 : ℝ)^r*E.energy τ hNM (x s)) := + mul_le_mul_of_nonneg_left (hF s hs) (by norm_num) + _ = _ := by rw [pow_succ]; ring + +theorem exists_finite_matrix_energy_budget {σ : Type*} (S : Finset σ) + (x : σ → M.toStarSubalgebra) (ht : ∀ s ∈ S,τ.trace (x s)=0) + (E : FiniteMatrixStage N) (ε : ℝ) (hε : 0 < ε) : + ∃ F : FiniteMatrixStage N,E.units.algebra ≤ F.units.algebra ∧ + (∑ s ∈ S,F.energy τ hNM (x s)) < ε := by + let A := ∑ s ∈ S,E.energy τ hNM (x s) + have hA : 0 ≤ A := Finset.sum_nonneg (fun s _ => E.energy_nonneg τ hNM (x s)) + obtain ⟨r,hr⟩ := exists_pow_lt_of_lt_one + (show 0 < ε/(A+1) from div_pos hε (by positivity)) (by norm_num : (15/16 : ℝ) < 1) + obtain ⟨F,hEF,hF⟩ := exists_iterated_energy_descent τ hNM hfactor hdiff hirr S x ht E r + refine ⟨F,hEF,?_⟩ + have hbound : (∑ s ∈ S,F.energy τ hNM (x s)) ≤ (15/16 : ℝ)^r*A := by + calc (∑ s ∈ S,F.energy τ hNM (x s)) ≤ + ∑ s ∈ S,(15/16 : ℝ)^r*E.energy τ hNM (x s) := + Finset.sum_le_sum (fun s hs => hF s hs) + _ = _ := (Finset.mul_sum S _ _).symm + have hsmall := (lt_div_iff₀ (by positivity : 0 < A+1)).mp hr + have hp : 0 ≤ (15/16 : ℝ)^r := by positivity + nlinarith + +end + +/-! A single increasing sequence of full matrix algebras simultaneously +kills every member of a supplied countable centered family in commutant L2. -/ +open Filter +open scoped BigOperators Topology +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem exists_countable_matrix_refinement (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : ℕ → M.toStarSubalgebra) (ht : ∀ s,τ.trace (x s)=0) (E : FiniteMatrixStage N) : + ∃ A : ℕ → FiniteMatrixStage N,A 0=E ∧ + Monotone (fun n => (A n).units.algebra) ∧ + (∀ n,(∑ s ∈ Finset.range n,(A n).energy τ hNM (x s)) < (1/2 : ℝ)^n) ∧ + ∀ s,Tendsto (fun n => (A n).energy τ hNM (x s)) atTop (𝓝 0) := by + have hex (n : ℕ) (F : FiniteMatrixStage N) := exists_finite_matrix_energy_budget τ hNM + hfactor hdiff hirr (Finset.range (n+1)) x (fun s _ => ht s) F + ((1/2 : ℝ)^(n+1)) (by positivity) + let next (n : ℕ) (F : FiniteMatrixStage N) := (hex n F).choose + let A : ℕ → FiniteMatrixStage N := fun n => Nat.rec E (fun n F => next n F) n + have hstep (n : ℕ) : (A n).units.algebra ≤ (A (n+1)).units.algebra ∧ + (∑ s ∈ Finset.range (n+1),(A (n+1)).energy τ hNM (x s)) < (1/2 : ℝ)^(n+1) := + (hex n (A n)).choose_spec + have hbudget (n : ℕ) : + (∑ s ∈ Finset.range n,(A n).energy τ hNM (x s)) < (1/2 : ℝ)^n := by + cases n with + | zero => simp + | succ n => exact (hstep n).2 + refine ⟨A,rfl,monotone_nat_of_le_succ (fun n => (hstep n).1),hbudget,?_⟩ + intro s + apply squeeze_zero' (Filter.Eventually.of_forall (fun n => (A n).energy_nonneg τ hNM (x s))) + ?_ (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num)) + filter_upwards [eventually_ge_atTop (s+1)] with n hn + exact (Finset.single_le_sum (fun t _ => (A n).energy_nonneg τ hNM (x t)) + (Finset.mem_range.mpr (by omega))).trans (hbudget n).le + +end FiniteMatrixStage + +/-! L2 separability supplies a countable centered dense family. The constructed +matrix sequence has scalar common relative commutant in the ambient algebra. -/ +section +open Filter +open scoped Topology +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_countable_norm₂_dense (S : Set M.toStarSubalgebra) + (hne : S.Nonempty) (hsep : TopologicalSpace.IsSeparable (baseVector τ '' S)) : + ∃ a : ℕ → M.toStarSubalgebra,(∀ n,a n ∈ S) ∧ + ∀ b ∈ S,∀ ε : ℝ,0 < ε → ∃ n,τ.norm₂ (b-a n) < ε := by + let T := baseVector τ '' S + let : TopologicalSpace.SeparableSpace T := hsep.separableSpace + let : Nonempty T := ⟨⟨baseVector τ hne.choose,Set.mem_image_of_mem _ hne.choose_spec⟩⟩ + obtain ⟨v,hv⟩ := TopologicalSpace.exists_dense_seq (α := T) + have hex (n : ℕ) : ∃ a ∈ S,baseVector τ a=(v n).val := (v n).property + choose a ha he using hex + refine ⟨a,ha,?_⟩ + intro b hb ε hε + let z : T := ⟨baseVector τ b,Set.mem_image_of_mem _ hb⟩ + obtain ⟨w,⟨n,rfl⟩,hw⟩ := Metric.mem_closure_iff.mp (hv z) ε hε + refine ⟨n,?_⟩ + change ‖baseVector τ (b-a n)‖ < ε + rw [map_sub,he n] + simpa only [Subtype.dist_eq,dist_eq_norm] using hw + +end Tracial +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem scalar_common_commutant_of_dense_energy_decay (τ : TracialRepresentation M) (hNM : N ≤ M) + (A : ℕ → FiniteMatrixStage N) (x : ℕ → M.toStarSubalgebra) + (hdense : ∀ b : M.toStarSubalgebra,τ.trace b=0 → ∀ ε : ℝ,0 < ε → + ∃ s,τ.norm₂ (b-x s) < ε) + (hlim : ∀ s,Tendsto (fun n => (A n).energy τ hNM (x s)) atTop (𝓝 0)) + (c : M.toStarSubalgebra) (hc : ∀ n,c.val ∈ (A n).commutant hNM) : + c=τ.trace c • (1 : M.toStarSubalgebra) := by + let y := c-τ.trace c • (1 : M.toStarSubalgebra) + have hyt : τ.trace y=0 := by + dsimp [y] + rw [trace_sub,cornerTrace_smul,τ.trace_one,mul_one,sub_self] + have hym (n : ℕ) : y.val ∈ (A n).commutant hNM := + ((A n).commutant hNM).sub_mem (hc n) + (((A n).commutant hNM).smul_mem ((A n).commutant hNM).one_mem _) + suffices y=0 from sub_eq_zero.mp this + by_contra hy + have hp : 0 < τ.norm₂ y := lt_of_le_of_ne (norm_nonneg _) + (fun h => hy ((τ.norm₂_eq_zero_iff y).mp h.symm)) + obtain ⟨s,hs⟩ := hdense y hyt (τ.norm₂ y/4) (by positivity) + obtain ⟨n,hn⟩ := ((tendsto_order.mp (hlim s)).2 ((τ.norm₂ y/4)^2) (by positivity)).exists + let hDM := (A n).commutant_le hNM + let z := conditionalExpectation τ hDM (x s) + have hz : τ.norm₂ z < τ.norm₂ y/4 := by + change τ.norm₂ z^2 < (τ.norm₂ y/4)^2 at hn + nlinarith [show 0 ≤ τ.norm₂ z from norm_nonneg _] + have hdiff : τ.norm₂ (y-z) ≤ τ.norm₂ (y-x s) := by + have he : conditionalExpectation τ hDM (y-x s)=y-z := by + change conditionalExpectationCLM τ hDM (y-x s)=y-z + rw [map_sub] + change conditionalExpectation τ hDM y-z=y-z + rw [conditionalExpectation_fixed τ hDM y (hym n)] + rw [← he] + exact conditionalExpectation_norm₂_le τ hDM _ + have hadd := τ.norm₂_add_le (y-z) z + rw [sub_add_cancel] at hadd + linarith + +theorem exists_irreducible_matrix_sequence (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) (E : FiniteMatrixStage N) : + ∃ A : ℕ → FiniteMatrixStage N,A 0=E ∧ + Monotone (fun n => (A n).units.algebra) ∧ + ∀ c : M.toStarSubalgebra,(∀ n,c.val ∈ (A n).commutant hNM) → + c=τ.trace c • (1 : M.toStarSubalgebra) := by + let S : Set M.toStarSubalgebra := {b | τ.trace b=0} + obtain ⟨x,hx,hdense⟩ := exists_countable_norm₂_dense τ S ⟨0,by change τ.trace 0=0; simp [TracialRepresentation.trace]⟩ + (hsep.mono (Set.image_subset_range _ _)) + obtain ⟨A,hA,hmono,_,hlim⟩ := exists_countable_matrix_refinement τ hNM hfactor hdiff hirr x hx E + exact ⟨A,hA,hmono,scalar_common_commutant_of_dense_energy_decay τ hNM A x hdense hlim⟩ + +end FiniteMatrixStage + +end + +/-! The actual weakly closed star algebra generated by the increasing finite +matrix stages. Its ambient relative commutant is scalar. This does not yet +package a diffuse II1 subfactor or derive the representation hypotheses. -/ +section +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem vonNeumann_wotClosed (M : VonNeumannAlgebra H) : WOTClosed M.toStarSubalgebra := by + change IsClosed {T : H →WOT[ℂ] H | T.toCLM ∈ (M : Set (H →L[ℂ] H))} + rw [← M.centralizer_centralizer] + change IsClosed {T : H →WOT[ℂ] H | + ∀ S ∈ Set.centralizer (M : Set (H →L[ℂ] H)),S*T.toCLM=T.toCLM*S} + simp only [Set.ofPred_forall] + apply isClosed_iInter + intro S + apply isClosed_iInter + intro hS + have he : {T : H →WOT[ℂ] H | S*T.toCLM=T.toCLM*S} = + {T : H →WOT[ℂ] H | + (ContinuousLinearMapWOT.equiv.symm S)*T=T*(ContinuousLinearMapWOT.equiv.symm S)} := by + ext T + let e : (H →WOT[ℂ] H) ≃ (H →L[ℂ] H) := ContinuousLinearMapWOT.equiv + exact e.injective.eq_iff + rw [he] + exact isClosed_eq (continuous_const_mul _) (continuous_mul_const _) + +end Tracial +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def generated (A : ℕ → FiniteMatrixStage N) : StarSubalgebra ℂ (H →L[ℂ] H) := + wstar (⋃ n,((A n).units.concreteAlgebra : Set (H →L[ℂ] H))) + +theorem generated_closed (A : ℕ → FiniteMatrixStage N) : WOTClosed (generated A) := wstar_closed _ + +theorem stage_le_generated (A : ℕ → FiniteMatrixStage N) (n : ℕ) : + (A n).units.concreteAlgebra ≤ generated A := by + intro x hx + exact subset_wstar _ (Set.mem_iUnion.mpr ⟨n,hx⟩) + +theorem generated_le (A : ℕ → FiniteMatrixStage N) : generated A ≤ N.toStarSubalgebra := by + apply wstar_le (vonNeumann_wotClosed N) + intro x hx + obtain ⟨n,hn⟩ := Set.mem_iUnion.mp hx + exact (A n).units.concreteAlgebra_le hn + +theorem generated_minimal (A : ℕ → FiniteMatrixStage N) + (R : StarSubalgebra ℂ (H →L[ℂ] H)) (hR : WOTClosed R) + (h : ∀ n,(A n).units.concreteAlgebra ≤ R) : generated A ≤ R := by + apply wstar_le hR + intro x hx + obtain ⟨n,hn⟩ := Set.mem_iUnion.mp hx + exact h n hn + +theorem generated_relative_scalar (A : ℕ → FiniteMatrixStage N) + (τ : TracialRepresentation M) (hNM : N ≤ M) + (hirr : ∀ c : M.toStarSubalgebra,(∀ n,c.val ∈ (A n).commutant hNM) → + c=τ.trace c • (1 : M.toStarSubalgebra)) + (c : M.toStarSubalgebra) + (hc : ∀ a : generated A,a.val*c.val=c.val*a.val) : + c=τ.trace c • (1 : M.toStarSubalgebra) := by + apply hirr c + intro n + apply (((A n).units.map (coordinateInclusion hNM)).relativeStar_mem c.val).mpr + refine ⟨c.property,?_⟩ + intro i j + have hi : ((A n).units.entry i j).val ∈ (A n).units.concreteAlgebra := by + exact ((A n).units.mem_concreteAlgebra _).mpr ((A n).units.entry_mem i j) + exact hc ⟨((A n).units.entry i j).val,stage_le_generated A n hi⟩ + +theorem concrete_stage_monotone (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.algebra)) : + Monotone (fun n => (A n).units.concreteAlgebra) := by + intro i j hij x hx + let a : N.toStarSubalgebra := ⟨x,(A i).units.concreteAlgebra_le hx⟩ + exact ((A j).units.mem_concreteAlgebra a).mpr + (hA hij (((A i).units.mem_concreteAlgebra a).mp hx)) + +def scalarStage (N : VonNeumannAlgebra H) : FiniteMatrixStage N where + size := 1 + positive := by norm_num + units := { + entry := fun _ _ => 1 + star_entry := by intros; simp + mul_entry := by + intro i j k l + rw [ite_eq_left (Subsingleton.elim j k),one_mul] + total := by simp } + +theorem exists_irreducible_matrix_generated_algebra + (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ A : ℕ → FiniteMatrixStage N,A 0=scalarStage N ∧ + Monotone (fun n => (A n).units.concreteAlgebra) ∧ + (∀ n,FiniteDimensional ℂ (A n).units.concreteAlgebra) ∧ + WOTClosed (generated A) ∧ generated A ≤ N.toStarSubalgebra ∧ + ∀ c : M.toStarSubalgebra,(∀ a : generated A,a.val*c.val=c.val*a.val) → + c=τ.trace c • (1 : M.toStarSubalgebra) := by + obtain ⟨A,hA,hmono,hscalar⟩ := exists_irreducible_matrix_sequence τ hNM hfactor hdiff hirr hsep (scalarStage N) + exact ⟨A,hA,concrete_stage_monotone A hmono,fun n => (A n).units.concrete_finiteDimensional, + generated_closed A,generated_le A,generated_relative_scalar A τ hNM hscalar⟩ + +end FiniteMatrixStage + +end + +/-! The constructed matrix-generated weak closure is an actual II1 factor. +Its bundled von Neumann algebra and faithful trace use the same operators. -/ +section +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {P M : VonNeumannAlgebra H} + +theorem irreducible_subalgebra_isII1 (τ : TracialRepresentation M) (hPM : P ≤ M) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P.toStarSubalgebra,coordinateInclusion hPM a*c=c*coordinateInclusion hPM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) : IsII1Factor P.toStarSubalgebra where + nonzero := tracial_nonzero τ + weaklyClosed := vonNeumann_wotClosed P + factor c hc := by + obtain ⟨z,hz⟩ := hirr (coordinateInclusion hPM c) (fun a => by + simpa only [map_mul] using congrArg (coordinateInclusion hPM) (hc a)) + refine ⟨z,?_⟩ + rw [Algebra.algebraMap_eq_smul_one] + apply Subtype.ext + exact congrArg (fun b : M.toStarSubalgebra => b.val) hz + finite := tracial_isometry_coisometry (restrictedTrace τ hPM) + diffuse := irreducible_subalgebra_diffuse τ hPM hdiff hirr + +end Tracial +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def generatedVonNeumann (A : ℕ → FiniteMatrixStage N) : VonNeumannAlgebra H := + vonNeumannOfWOTClosed (generated A) (generated_closed A) + +theorem generatedVonNeumann_le (A : ℕ → FiniteMatrixStage N) : generatedVonNeumann A ≤ N := + generated_le A + +def generatedTrace (A : ℕ → FiniteMatrixStage N) (τ : TracialRepresentation M) (hNM : N ≤ M) : + TracialRepresentation (generatedVonNeumann A) := + restrictedTrace τ ((generatedVonNeumann_le A).trans hNM) + +theorem generated_isII1 (A : ℕ → FiniteMatrixStage N) + (τ : TracialRepresentation M) (hNM : N ≤ M) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra,(∀ a : generated A,a.val*c.val=c.val*a.val) → + c=τ.trace c • (1 : M.toStarSubalgebra)) : IsII1Factor (generated A) := by + apply irreducible_subalgebra_isII1 (restrictedTrace τ hNM) (generatedVonNeumann_le A) hdiff + intro c hc + have h := hirr (coordinateInclusion hNM c) (fun a => + congrArg (fun b : N.toStarSubalgebra => b.val) (hc a)) + refine ⟨τ.trace (coordinateInclusion hNM c),?_⟩ + exact Subtype.ext (congrArg (fun b : M.toStarSubalgebra => b.val) h) + +theorem exists_irreducible_matrix_generated_II1 + (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ A : ℕ → FiniteMatrixStage N,A 0=scalarStage N ∧ + Monotone (fun n => (A n).units.concreteAlgebra) ∧ + (∀ n,FiniteDimensional ℂ (A n).units.concreteAlgebra) ∧ + IsII1Factor (generated A) ∧ generated A ≤ N.toStarSubalgebra ∧ + ∀ c : M.toStarSubalgebra,(∀ a : generated A,a.val*c.val=c.val*a.val) → + c=τ.trace c • (1 : M.toStarSubalgebra) := by + obtain ⟨A,hA,hmono,hfd,_,hAN,hscalar⟩ := + exists_irreducible_matrix_generated_algebra τ hNM hfactor hdiff hirr hsep + exact ⟨A,hA,hmono,hfd,generated_isII1 A τ hNM hdiff hscalar,hAN,hscalar⟩ + +end FiniteMatrixStage + +end + +/-! Finite matrix stages strongly approximate the actual weakly generated +algebra. The approximants here have no operator norm bound. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def bicommutantStar (S : StarSubalgebra ℂ (H →L[ℂ] H)) : StarSubalgebra ℂ (H →L[ℂ] H) := + StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (S : Set (H →L[ℂ] H)) : Set (H →L[ℂ] H)) + +theorem bicommutantStar_coe (S : StarSubalgebra ℂ (H →L[ℂ] H)) : + (bicommutantStar S : Set (H →L[ℂ] H))= + Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H))) := by + unfold bicommutantStar + rw [StarSubalgebra.coe_centralizer_centralizer,StarMemClass.star_coe_eq,Set.union_self] + +def bicommutantVonNeumann (S : StarSubalgebra ℂ (H →L[ℂ] H)) : VonNeumannAlgebra H where + toStarSubalgebra := bicommutantStar S + centralizer_centralizer' := by + change Set.centralizer (Set.centralizer (bicommutantStar S : Set (H →L[ℂ] H)))= + (bicommutantStar S : Set (H →L[ℂ] H)) + rw [bicommutantStar_coe,Set.centralizer_centralizer_centralizer] + +theorem bicommutantVonNeumann_coe (S : StarSubalgebra ℂ (H →L[ℂ] H)) : + (bicommutantVonNeumann S : Set (H →L[ℂ] H))= + Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H))) := by + exact bicommutantStar_coe S + +theorem wstar_starAlgebra_eq_bicommutant (S : StarSubalgebra ℂ (H →L[ℂ] H)) : + wstar (S : Set (H →L[ℂ] H))=(bicommutantVonNeumann S).toStarSubalgebra := by + apply le_antisymm + · apply wstar_le (Tracial.vonNeumann_wotClosed _) + intro a ha + change a ∈ (bicommutantVonNeumann S : Set (H →L[ℂ] H)) + rw [bicommutantVonNeumann_coe] + exact fun b hb => (hb a ha).symm + · intro a ha + have hb : a ∈ Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H))) := by + rwa [← bicommutantVonNeumann_coe] + rw [← SetLike.mem_coe,← wotClosed_bicommutant _ (wstar_closed _)] + exact fun b hb' => hb b (fun c hc => hb' c (subset_wstar _ hc)) + +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {N M : VonNeumannAlgebra H} + +def stageUnion (A : ℕ → FiniteMatrixStage N) : StarSubalgebra ℂ (H →L[ℂ] H) := + ⨆ n,(A n).units.concreteAlgebra + +theorem stageUnion_coe (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) : + (stageUnion A : Set (H →L[ℂ] H))=⋃ n,((A n).units.concreteAlgebra : Set (H →L[ℂ] H)) := + StarSubalgebra.coe_iSup_of_directed hA.directed_le + +theorem generated_eq_wstar_union (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) : + generated A=wstar (stageUnion A : Set (H →L[ℂ] H)) := by + rw [stageUnion_coe A hA] + rfl + +theorem exists_stage_strong_approximation (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) (T : generated A) + (s : Finset H) (ε : ℝ) (hε : 0 < ε) : + ∃ n,∃ a : (A n).units.concreteAlgebra,∀ x ∈ s,‖T.val x-a.val x‖ < ε := by + have hT : T.val ∈ Set.centralizer (Set.centralizer (stageUnion A : Set (H →L[ℂ] H))) := by + rw [← bicommutantVonNeumann_coe] + change T.val ∈ (bicommutantVonNeumann (stageUnion A)).toStarSubalgebra + rw [← wstar_starAlgebra_eq_bicommutant,← generated_eq_wstar_union A hA] + exact T.property + obtain ⟨a,ha⟩ := bicommutant_finite_strong_approximation (stageUnion A) T.val hT s ε hε + have hm := a.property + rw [← SetLike.mem_coe,stageUnion_coe A hA] at hm + obtain ⟨n,hn⟩ := Set.mem_iUnion.mp hm + exact ⟨n,⟨a.val,hn⟩,ha⟩ + +theorem exists_stage_norm₂_approximation (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) (x : M.toStarSubalgebra) + (hx : x.val ∈ generated A) (ε : ℝ) (hε : 0 < ε) : + ∃ n,∃ a : M.toStarSubalgebra,a.val ∈ (A n).units.concreteAlgebra ∧ τ.norm₂ (x-a) < ε := by + classical + obtain ⟨n,a,ha⟩ := exists_stage_strong_approximation A hA ⟨x.val,hx⟩ {τ.vector} ε hε + exact ⟨n,⟨a.val,hNM ((A n).units.concreteAlgebra_le a.property)⟩,a.property, + ha τ.vector (Finset.mem_singleton_self _)⟩ + +end FiniteMatrixStage + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MatrixUnits.lean b/lean/OAI/Analysis/FactorGeneration/MatrixUnits.lean new file mode 100644 index 0000000000000000000000000000000000000000..34204ab49ce102823682ea9fe8ef4397bcf3fbfa --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MatrixUnits.lean @@ -0,0 +1,509 @@ +import Mathlib.Algebra.Star.StarProjection +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Analysis.Complex.Basic +import Mathlib.Data.Matrix.Basis +import Mathlib.LinearAlgebra.Matrix.ConjTranspose +import Mathlib.Topology.Algebra.Module.FiniteDimension + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Actual finite matrix algebras from matrix-unit laws. No factor or trace +hypothesis is needed for the algebraic construction. -/ +open scoped BigOperators + +structure MatrixUnitSystem (ι A : Type*) [Fintype ι] [DecidableEq ι] + [Ring A] [StarRing A] [Algebra ℂ A] where + entry : ι → ι → A + star_entry : ∀ i j, star (entry i j) = entry j i + mul_entry : ∀ i j k l, entry i j * entry k l = if j = k then entry i l else 0 + total : ∑ i, entry i i = 1 + +namespace MatrixUnitSystem +variable {ι A : Type*} [Fintype ι] [DecidableEq ι] +variable [Ring A] [StarRing A] [Algebra ℂ A] +variable (E : MatrixUnitSystem ι A) + +def linearMap : Matrix ι ι ℂ →ₗ[ℂ] A where + toFun a := ∑ i, ∑ j, a i j • E.entry i j + map_add' a b := by simp [add_smul, Finset.sum_add_distrib] + map_smul' c a := by simp [Finset.smul_sum, smul_smul] + +theorem linearMap_apply (a : Matrix ι ι ℂ) : + E.linearMap a = ∑ i, ∑ j, a i j • E.entry i j := rfl + +@[simp] theorem linearMap_single (i j : ι) (c : ℂ) : + E.linearMap (Matrix.single i j c) = c • E.entry i j := by + simp [linearMap_apply, Matrix.single, ite_smul, ite_and] + +theorem linearMap_one : E.linearMap 1 = 1 := by + simpa [linearMap_apply, Matrix.one_apply, ite_smul] using E.total + +theorem linearMap_mul (a b : Matrix ι ι ℂ) : + E.linearMap (a*b) = E.linearMap a * E.linearMap b := by + simp only [linearMap_apply, Matrix.mul_apply, Finset.sum_smul, + Finset.sum_mul, Finset.mul_sum, smul_mul_smul, E.mul_entry] + simp only [smul_ite, smul_zero, Finset.sum_ite_eq', Finset.mem_univ, ite_true] + conv_rhs => + arg 2 + intro k + rw [Finset.sum_comm] + rw [Finset.sum_comm (f := fun k i => ∑ l, (a i k * b k l) • E.entry i l)] + apply Finset.sum_congr rfl + intro i hi + exact Finset.sum_comm + +variable [StarModule ℂ A] + +theorem linearMap_star (a : Matrix ι ι ℂ) : + E.linearMap (star a) = star (E.linearMap a) := by + simp only [linearMap_apply, star_sum, star_smul, E.star_entry] + rw [Finset.sum_comm] + rfl + +def hom : Matrix ι ι ℂ →⋆ₐ[ℂ] A where + toFun := E.linearMap + map_one' := E.linearMap_one + map_mul' := E.linearMap_mul + map_zero' := E.linearMap.map_zero + map_add' := E.linearMap.map_add + commutes' c := by + rw [Algebra.algebraMap_eq_smul_one, E.linearMap.map_smul, E.linearMap_one, + Algebra.algebraMap_eq_smul_one] + map_star' := E.linearMap_star + +@[simp] theorem hom_apply (a : Matrix ι ι ℂ) : + E.hom a = ∑ i, ∑ j, a i j • E.entry i j := rfl + +@[simp] theorem hom_single (i j : ι) (c : ℂ) : + E.hom (Matrix.single i j c) = c • E.entry i j := E.linearMap_single i j c + +theorem sandwich (a : Matrix ι ι ℂ) (o i j : ι) : + E.entry o i * E.hom a * E.entry j o = a i j • E.entry o o := by + simp only [hom_apply, Finset.mul_sum, Finset.sum_mul, mul_smul_comm, + E.mul_entry, smul_ite, smul_zero] + simp [E.mul_entry, smul_ite] + +theorem hom_injective (o : ι) (ho : E.entry o o ≠ 0) : Function.Injective E.hom := by + intro a b hab + ext i j + have h := congrArg (fun x => E.entry o i*x*E.entry j o) hab + rw [E.sandwich, E.sandwich] at h + exact (smul_left_injective ℂ ho) h + +def algebra : StarSubalgebra ℂ A := E.hom.range + +theorem mem_algebra (x : A) : x ∈ E.algebra ↔ + ∃ a : Matrix ι ι ℂ, (∑ i, ∑ j, a i j • E.entry i j) = x := Iff.rfl + +theorem entry_mem (i j : ι) : E.entry i j ∈ E.algebra := by + exact ⟨Matrix.single i j 1, (E.hom_single i j 1).trans (one_smul _ _)⟩ + +def equiv (o : ι) (ho : E.entry o o ≠ 0) : Matrix ι ι ℂ ≃⋆ₐ[ℂ] E.algebra := + StarAlgEquiv.ofInjective E.hom (E.hom_injective o ho) + +instance algebra_finiteDimensional : FiniteDimensional ℂ E.algebra := by + change FiniteDimensional ℂ E.hom.toAlgHom.range + exact FiniteDimensional.of_surjective E.hom.toAlgHom.rangeRestrict.toLinearMap + E.hom.toAlgHom.rangeRestrict_surjective + +theorem algebra_isClosed [TopologicalSpace A] [IsTopologicalAddGroup A] + [ContinuousSMul ℂ A] [T2Space A] : IsClosed (E.algebra : Set A) := by + let : FiniteDimensional ℂ E.algebra.toSubalgebra.toSubmodule := E.algebra_finiteDimensional + exact E.algebra.toSubalgebra.toSubmodule.closed_of_finiteDimensional + +/-! Commuting unital systems multiply to a larger full matrix algebra. +This proves compatibility algebraically; it does not construct a system in +a relative commutant or establish irreducibility of an infinite union. -/ +open scoped BigOperators +variable {ι κ A : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable (E : MatrixUnitSystem ι A) + +omit [StarModule ℂ A] in +theorem diagonal_ne_zero [Nontrivial A] (o : ι) : E.entry o o ≠ 0 := by + intro h + have hz (i : ι) : E.entry i i = 0 := by + have hio : E.entry i o = 0 := by + have hm := E.mul_entry i o o o + simpa [h] using hm.symm + have hm := E.mul_entry i o o i + simpa [hio] using hm.symm + have ht := E.total + simp only [hz, Finset.sum_const_zero] at ht + exact zero_ne_one ht + +theorem injective [Nontrivial A] [Nonempty ι] : Function.Injective E.hom := + E.hom_injective (Classical.arbitrary ι) (E.diagonal_ne_zero _) + +theorem algebra_le_iff (S : StarSubalgebra ℂ A) : + E.algebra ≤ S ↔ ∀ i j, E.entry i j ∈ S := by + constructor + · exact fun h i j => h (E.entry_mem i j) + · intro h x hx + obtain ⟨a,rfl⟩ := (E.mem_algebra x).mp hx + exact S.sum_mem fun i _ => S.sum_mem fun j _ => S.smul_mem (h i j) _ + +theorem commute_algebra_iff (x : A) : + (∀ a ∈ E.algebra, Commute a x) ↔ ∀ i j, Commute (E.entry i j) x := by + constructor + · exact fun h i j => h _ (E.entry_mem i j) + · intro h a ha + obtain ⟨b,rfl⟩ := (E.mem_algebra a).mp ha + show (∑ i, ∑ j, b i j • E.entry i j)*x=x*(∑ i, ∑ j, b i j • E.entry i j) + simp only [Finset.sum_mul, Finset.mul_sum, smul_mul_assoc, mul_smul_comm, + (h _ _).eq] + +variable (F : MatrixUnitSystem κ A) +variable (hc : ∀ i j k l, Commute (E.entry i j) (F.entry k l)) + +def product : MatrixUnitSystem (ι × κ) A where + entry a b := E.entry a.1 b.1 * F.entry a.2 b.2 + star_entry a b := by + rw [star_mul,E.star_entry,F.star_entry] + exact (hc _ _ _ _).eq.symm + mul_entry a b c d := by + have hr : (E.entry a.1 b.1*F.entry a.2 b.2)*(E.entry c.1 d.1*F.entry c.2 d.2)= + (E.entry a.1 b.1*E.entry c.1 d.1)*(F.entry a.2 b.2*F.entry c.2 d.2) := by + calc _ = E.entry a.1 b.1*(F.entry a.2 b.2*E.entry c.1 d.1)*F.entry c.2 d.2 := by + simp only [mul_assoc] + _ = _ := by rw [(hc c.1 d.1 a.2 b.2).eq.symm]; simp only [mul_assoc] + rw [hr,E.mul_entry,F.mul_entry] + by_cases h1 : b.1=c.1 <;> by_cases h2 : b.2=c.2 <;> + simp [h1,h2,Prod.ext_iff] + total := by + rw [Fintype.sum_prod_type] + simp only [← Finset.mul_sum,F.total,mul_one,E.total] + +omit [StarModule ℂ A] in +theorem product_entry (a b : ι × κ) : + (E.product F hc).entry a b = E.entry a.1 b.1 * F.entry a.2 b.2 := rfl + +omit [StarModule ℂ A] in +theorem product_sum_left (i j : ι) : + (∑ k, (E.product F hc).entry (i,k) (j,k)) = E.entry i j := by + simp only [product_entry, ← Finset.mul_sum, F.total, mul_one] + +omit [StarModule ℂ A] in +theorem product_sum_right (k l : κ) : + (∑ i, (E.product F hc).entry (i,k) (i,l)) = F.entry k l := by + simp only [product_entry, ← Finset.sum_mul, E.total, one_mul] + +theorem algebra_le_product_left : E.algebra ≤ (E.product F hc).algebra := by + apply (E.algebra_le_iff _).mpr + intro i j + rw [← E.product_sum_left F hc i j] + exact (E.product F hc).algebra.sum_mem fun k _ => (E.product F hc).entry_mem _ _ + +theorem algebra_le_product_right : F.algebra ≤ (E.product F hc).algebra := by + apply (F.algebra_le_iff _).mpr + intro k l + rw [← E.product_sum_right F hc k l] + exact (E.product F hc).algebra.sum_mem fun i _ => (E.product F hc).entry_mem _ _ + +theorem product_algebra_eq_sup : (E.product F hc).algebra = E.algebra ⊔ F.algebra := by + apply le_antisymm + · apply ((E.product F hc).algebra_le_iff _).mpr + intro a b + exact (E.algebra ⊔ F.algebra).mul_mem ((show E.algebra ≤ E.algebra ⊔ F.algebra from le_sup_left) (E.entry_mem a.1 b.1)) + ((show F.algebra ≤ E.algebra ⊔ F.algebra from le_sup_right) (F.entry_mem a.2 b.2)) + · exact sup_le (E.algebra_le_product_left F hc) (E.algebra_le_product_right F hc) + +omit [StarModule ℂ A] in +theorem diagonal_sum_retained (c : ι → ℂ) : + (∑ a : ι × κ, c a.1 • (E.product F hc).entry a a) = ∑ i, c i • E.entry i i := by + rw [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro i hi + change (∑ k, c i • (E.product F hc).entry (i,k) (i,k)) = _ + rw [← Finset.smul_sum, E.product_sum_left] + +/-! Corner amplification inside the actual matrix-unit commutant. -/ +open scoped BigOperators +variable {ι A : Type*} [Fintype ι] [DecidableEq ι] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable (E : MatrixUnitSystem ι A) + +def commutant : StarSubalgebra ℂ A where + carrier := {x | ∀ i j, Commute (E.entry i j) x} + zero_mem' := by intro i j; exact Commute.zero_right _ + one_mem' := by intro i j; exact Commute.one_right _ + add_mem' hx hy := fun i j => (hx i j).add_right (hy i j) + mul_mem' hx hy := fun i j => (hx i j).mul_right (hy i j) + algebraMap_mem' c := fun i j => (Algebra.commutes c _).symm + star_mem' hx := by + intro i j + show E.entry i j*star _=star _*E.entry i j + simpa only [star_mul,E.star_entry] using (congrArg star (hx j i).eq).symm + +theorem mem_commutant (x : A) : x ∈ E.commutant ↔ ∀ i j, Commute (E.entry i j) x := Iff.rfl + +def amplify (o : ι) (x : A) : A := ∑ i, E.entry i o*x*E.entry o i + +omit [StarModule ℂ A] in +theorem entry_mul_amplify (o i j : ι) (x : A) : + E.entry i j * E.amplify o x = E.entry i o*x*E.entry o j := by + simp only [amplify,Finset.mul_sum,← mul_assoc,E.mul_entry] + simp [ite_mul] + +omit [StarModule ℂ A] in +theorem amplify_mul_entry (o i j : ι) (x : A) : + E.amplify o x * E.entry i j = E.entry i o*x*E.entry o j := by + simp only [amplify,Finset.sum_mul,mul_assoc,E.mul_entry] + simp [mul_ite] + +theorem amplify_mem (o : ι) (x : A) : E.amplify o x ∈ E.commutant := by + intro i j + show E.entry i j * E.amplify o x = E.amplify o x * E.entry i j + rw [E.entry_mul_amplify,E.amplify_mul_entry] + +omit [StarModule ℂ A] in +theorem amplify_star (o : ι) (x : A) : star (E.amplify o x)=E.amplify o (star x) := by + simp only [amplify,star_sum,star_mul,E.star_entry,mul_assoc] + +omit [StarModule ℂ A] in +theorem amplify_zero (o : ι) : E.amplify o 0=0 := by simp [amplify] + +omit [StarModule ℂ A] in +theorem amplify_corner (o i j : ι) (x : A) : + E.entry i o*E.amplify o x*E.entry o j = E.entry i o*x*E.entry o j := by + rw [E.entry_mul_amplify] + simp only [mul_assoc,E.mul_entry,ite_true] + +omit [StarModule ℂ A] in +theorem amplify_mul (o : ι) (x y : A) : + E.amplify o x*E.amplify o y=E.amplify o (x*E.entry o o*y) := by + simp only [amplify,Finset.sum_mul] + apply Finset.sum_congr rfl + intro i hi + change (E.entry i o*x*E.entry o i)*E.amplify o y = _ + rw [mul_assoc,E.entry_mul_amplify] + simp only [mul_assoc] + +theorem amplify_compression (o : ι) (x : A) (hx : x ∈ E.commutant) : + E.amplify o (E.entry o o*x)=x := by + simp only [amplify] + calc _ = ∑ i, E.entry i i*x := by + apply Finset.sum_congr rfl + intro i hi + rw [← mul_assoc,E.mul_entry,ite_eq_left rfl,mul_assoc,← (hx o i).eq, + ← mul_assoc,E.mul_entry,ite_eq_left rfl] + _ = x := by rw [← Finset.sum_mul,E.total,one_mul] + +omit [StarModule ℂ A] in +theorem reconstruct (o : ι) (x : A) : + (∑ i, ∑ j, E.entry i o*E.amplify o (E.entry o i*x*E.entry j o)*E.entry o j)=x := by + simp only [E.amplify_corner] + have h (i j : ι) : E.entry i o*(E.entry o i*x*E.entry j o)*E.entry o j= + E.entry i i*x*E.entry j j := by + calc _ = (E.entry i o*E.entry o i)*x*(E.entry j o*E.entry o j) := by + simp only [mul_assoc] + _ = _ := by simp only [E.mul_entry,ite_true] + simp only [h,← Finset.mul_sum,E.total,mul_one,← Finset.sum_mul,one_mul] + +/-- The commutant of a full unital matrix algebra in a scalar-center algebra +has scalar center. The finite matrix decomposition is constructed above. -/ +theorem commutant_scalar_center (o : ι) + (hfactor : ∀ c : A, (∀ a : A,a*c=c*a) → ∃ z : ℂ,c=z • (1 : A)) + (c : E.commutant) (hc : ∀ a : E.commutant,a*c=c*a) : + ∃ z : ℂ,c=z • (1 : E.commutant) := by + obtain ⟨z,hz⟩ := hfactor c.val (by + intro x + have h (i j : ι) : Commute + (E.entry i o*E.amplify o (E.entry o i*x*E.entry j o)*E.entry o j) c.val := by + have hm : Commute (E.amplify o (E.entry o i*x*E.entry j o)) c.val := + congrArg Subtype.val (hc ⟨_,E.amplify_mem o _⟩) + exact ((c.property i o).mul_left hm).mul_left (c.property o j) + rw [← E.reconstruct o x] + simp only [Finset.sum_mul,Finset.mul_sum,(h _ _).eq]) + exact ⟨z,Subtype.ext hz⟩ + +/-! Diffuseness passes to the full matrix-unit commutant by splitting a +compressed projection and amplifying the split. -/ +open scoped BigOperators +variable {ι A : Type*} [Fintype ι] [DecidableEq ι] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable (E : MatrixUnitSystem ι A) + +omit [StarModule ℂ A] in +theorem diagonal_projection (o : ι) : IsStarProjection (E.entry o o) := by + exact ⟨by show E.entry o o*E.entry o o=E.entry o o; simpa using E.mul_entry o o o o,E.star_entry o o⟩ + +omit [StarModule ℂ A] in +theorem amplify_projection (o : ι) (q : A) (hq : IsStarProjection q) + (hs : q*E.entry o o=q) : IsStarProjection (E.amplify o q) := by + constructor + · show E.amplify o q*E.amplify o q=E.amplify o q + rw [E.amplify_mul,hs,hq.isIdempotentElem.eq] + · show star (E.amplify o q)=E.amplify o q + rw [E.amplify_star,hq.isSelfAdjoint.star_eq] + +theorem commutant_diffuse (o : ι) + (hdiff : ∀ p : A,IsStarProjection p → p ≠ 0 → + ∃ q : A,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (p : E.commutant) (hp : IsStarProjection p) (hp0 : p ≠ 0) : + ∃ q : E.commutant,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q := by + have hpA : IsStarProjection p.val := hp.map E.commutant.subtype + let r : A := E.entry o o*p.val + have hr : IsStarProjection r := (E.diagonal_projection o).mul hpA (p.property o o) + have hr0 : r ≠ 0 := by + intro h + have he := E.amplify_compression o p.val p.property + rw [show E.entry o o*p.val=0 from h,E.amplify_zero] at he + exact hp0 (Subtype.ext he.symm) + obtain ⟨q,hq,hq0,hqr,hrq,hqr'⟩ := hdiff r hr hr0 + have hqs : q*E.entry o o=q := by + have hre : r*E.entry o o=r := by + dsimp [r] + rw [mul_assoc,← (p.property o o).eq,← mul_assoc, + (E.diagonal_projection o).isIdempotentElem.eq] + calc q*E.entry o o = (q*r)*E.entry o o := by rw [hqr'] + _ = q*r := by rw [mul_assoc,hre] + _ = q := hqr' + have hsq : E.entry o o*q=q := by + simpa only [star_mul,hq.isSelfAdjoint.star_eq,E.star_entry] using congrArg star hqs + let Q : E.commutant := ⟨E.amplify o q,E.amplify_mem o q⟩ + have hQ : IsStarProjection Q := by + constructor + · exact Subtype.ext (E.amplify_projection o q hq hqs).isIdempotentElem.eq + · exact Subtype.ext (E.amplify_projection o q hq hqs).isSelfAdjoint.star_eq + have hrec : E.entry o o*Q.val*E.entry o o=q := by + change E.entry o o*E.amplify o q*E.entry o o=q + rw [E.amplify_corner,hsq,hqs] + refine ⟨Q,hQ,?_,?_,?_,?_⟩ + · intro h + have hz : Q.val=0 := congrArg Subtype.val h + rw [hz,mul_zero,zero_mul] at hrec + exact hq0 hrec.symm + · intro h + have hz : Q.val=p.val := congrArg Subtype.val h + rw [hz,mul_assoc,← (p.property o o).eq,← mul_assoc, + (E.diagonal_projection o).isIdempotentElem.eq] at hrec + exact hqr hrec.symm + · apply Subtype.ext + change p.val*E.amplify o q=E.amplify o q + rw [← E.amplify_compression o p.val p.property,E.amplify_mul] + congr 1 + rw [mul_assoc,hsq] + exact hrq + · apply Subtype.ext + change E.amplify o q*p.val=E.amplify o q + rw [← E.amplify_compression o p.val p.property,E.amplify_mul,hqs] + exact congrArg (E.amplify o) hqr' + +open scoped BigOperators +variable {ι κ A B : Type*} [Fintype ι] [DecidableEq ι] [Fintype κ] [DecidableEq κ] +variable [Ring A] [StarRing A] [Algebra ℂ A] +variable [Ring B] [StarRing B] [Algebra ℂ B] +variable (E : MatrixUnitSystem ι A) + +def map (f : A →⋆ₐ[ℂ] B) : MatrixUnitSystem ι B where + entry i j := f (E.entry i j) + star_entry i j := by rw [← map_star,E.star_entry] + mul_entry i j k l := by + rw [← map_mul,E.mul_entry] + split <;> simp_all + total := by rw [← map_sum,E.total,map_one] + +theorem map_entry (f : A →⋆ₐ[ℂ] B) (i j : ι) : (E.map f).entry i j=f (E.entry i j) := rfl + +theorem diagonal_sum_retained_right (F : MatrixUnitSystem κ A) + (hc : ∀ i j k l, Commute (E.entry i j) (F.entry k l)) (d : κ → ℂ) : + (∑ a : ι × κ,d a.2 • (E.product F hc).entry a a)=∑ k,d k • F.entry k k := by + rw [Fintype.sum_prod_type,Finset.sum_comm] + apply Finset.sum_congr rfl + intro k hk + change (∑ i, d k • (E.product F hc).entry (i,k) (i,k)) = _ + rw [← Finset.smul_sum,E.product_sum_right] + +/-! Actual matrix amplification by coefficients in the full matrix-unit +commutant. The evaluation homomorphism is proved surjective algebraically. -/ +open scoped BigOperators +variable {ι A : Type*} [Fintype ι] [DecidableEq ι] +variable [Ring A] [StarRing A] [Algebra ℂ A] [StarModule ℂ A] +variable (E : MatrixUnitSystem ι A) + +def coefficientEval (a : Matrix ι ι E.commutant) : A := + ∑ i,∑ j,E.commutant.subtype (a i j)*E.entry i j + +theorem coefficientEval_mul (a b : Matrix ι ι E.commutant) : + E.coefficientEval (a*b)=E.coefficientEval a*E.coefficientEval b := by + simp only [coefficientEval,Matrix.mul_apply,map_sum,map_mul, + Finset.sum_mul,Finset.mul_sum] + have he (i j k l : ι) : + ((a i j).val*E.entry i j)*((b k l).val*E.entry k l)= + (a i j).val*(b k l).val*(E.entry i j*E.entry k l) := by + rw [mul_assoc,← mul_assoc (E.entry i j),((b k l).property i j).eq] + simp only [mul_assoc] + change (∑ i,∑ j,∑ k,(a i k).val*(b k j).val*E.entry i j) = + ∑ k,∑ l,∑ i,∑ j,((a i j).val*E.entry i j)*((b k l).val*E.entry k l) + simp only [he,E.mul_entry,mul_ite,mul_zero,Finset.sum_ite_eq',Finset.mem_univ,ite_true] + conv_lhs => + arg 2 + intro i + rw [Finset.sum_comm] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + exact Finset.sum_comm + +theorem coefficientEval_star (a : Matrix ι ι E.commutant) : + E.coefficientEval (star a)=star (E.coefficientEval a) := by + simp only [coefficientEval,star_sum,star_mul,E.star_entry,Matrix.star_apply, + map_star] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + exact ((star (a i j)).property j i).eq.symm + +theorem coefficientEval_one : E.coefficientEval 1=1 := by + simpa [coefficientEval,Matrix.one_apply,apply_ite,ite_mul] using E.total + +def coefficientHom : Matrix ι ι E.commutant →⋆ₐ[ℂ] A where + toFun := E.coefficientEval + map_one' := E.coefficientEval_one + map_mul' := E.coefficientEval_mul + map_zero' := by simp [coefficientEval] + map_add' a b := by simp [coefficientEval,add_mul,Finset.sum_add_distrib] + commutes' c := by + rw [Algebra.algebraMap_eq_smul_one] + change E.coefficientEval (c • 1)=algebraMap ℂ A c + simp only [coefficientEval,Matrix.smul_apply,map_smul,smul_mul_assoc, + ← Finset.smul_sum] + change c • E.coefficientEval 1=algebraMap ℂ A c + rw [E.coefficientEval_one,Algebra.algebraMap_eq_smul_one] + map_star' := E.coefficientEval_star + +theorem coefficientHom_single (i j : ι) (a : E.commutant) : + E.coefficientHom (Matrix.single i j a)=a.val*E.entry i j := by + change E.coefficientEval (Matrix.single i j a)=_ + simp [coefficientEval,Matrix.single,apply_ite,ite_mul,ite_and] + +theorem coefficientHom_surjective (o : ι) : Function.Surjective E.coefficientHom := by + intro x + let a : Matrix ι ι E.commutant := fun i j => + ⟨E.amplify o (E.entry o i*x*E.entry j o),E.amplify_mem o _⟩ + refine ⟨a,?_⟩ + change (∑ i,∑ j,E.amplify o (E.entry o i*x*E.entry j o)*E.entry i j)=x + calc (∑ i,∑ j,E.amplify o (E.entry o i*x*E.entry j o)*E.entry i j) = + ∑ i,∑ j,E.entry i o*E.amplify o (E.entry o i*x*E.entry j o)*E.entry o j := by + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + change (a i j).val*E.entry i j=E.entry i o*(a i j).val*E.entry o j + rw [((a i j).property i o).eq,mul_assoc,E.mul_entry,ite_eq_left rfl] + _ = x := E.reconstruct o x + +end MatrixUnitSystem + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/MonotoneTrace.lean b/lean/OAI/Analysis/FactorGeneration/MonotoneTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..372ce1d732a88e0902f5148fa518cd3f02e3ef9c --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/MonotoneTrace.lean @@ -0,0 +1,406 @@ +import Mathlib.Algebra.BigOperators.Intervals +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Range +import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Abs +import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.Rpow.Basic +import Mathlib.Topology.Algebra.InfiniteSum.NatInt +import Mathlib.Topology.Algebra.InfiniteSum.Order +import OAI.Analysis.FactorGeneration.GroupTrace +import OAI.Analysis.FactorGeneration.OperatorLimits + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Bounded positive monotone nets have actual least upper bounds in M. +Every displayed vector-trace bound passes to the constructed bound. -/ +section +open Filter +open scoped Topology +namespace Tracial + +section +open UltrapowerBridge +variable {H I : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + +theorem exists_monotone_positive_limit (a : I → M.toStarSubalgebra) + (hmono : Monotone (fun i => (a i).val)) + (hpos : ∀ i, 0 ≤ (a i).val) (C : ℝ) (hC : 0 ≤ C) + (hbound : ∀ i, ‖a i‖ ≤ C) (r : ℝ) (htrace : ∀ i, (τ.trace (a i)).re ≤ r) : + ∃ b : M.toStarSubalgebra, 0 ≤ b.val ∧ ‖b‖ ≤ C ∧ + (∀ i, (a i).val ≤ b.val) ∧ + (∀ c : M.toStarSubalgebra, (∀ i, (a i).val ≤ c.val) → b.val ≤ c.val) ∧ + (τ.trace b).re ≤ r := by + let ω : Ultrafilter I := Ultrafilter.of atTop + obtain ⟨T, hT, ht⟩ := exists_weak_operator_ultralimit ω + (fun i => (a i).val) C hC hbound + let b : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M a T ht⟩ + have hw : Tendsto (fun i => ContinuousLinearMapWOT.ofCLM (a i).val) (ω : Filter I) + (𝓝 (ContinuousLinearMapWOT.ofCLM T)) := + ContinuousLinearMapWOT.tendsto_iff_forall_inner_apply_tendsto.mpr ht + refine ⟨b, ?_, hT, ?_, ?_, ?_⟩ + · exact weakOperator_nonneg_isClosed.mem_of_tendsto hw (Eventually.of_forall hpos) + · intro i + apply (weakOperator_lowerBound_isClosed (a i).val).mem_of_tendsto hw + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact hmono hj + · intro c hc + exact (weakOperator_upperBound_isClosed c.val).mem_of_tendsto hw (Eventually.of_forall hc) + · exact le_of_tendsto (Complex.continuous_re.tendsto _ |>.comp (ht τ.vector τ.vector)) + (Eventually.of_forall htrace) + +end + +/-! Positivity, order, and faithfulness of the actual vector trace, using +ambient operator order throughout. No identification with subtype spectral +order is needed. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem ambient_trace_nonneg (a : M.toStarSubalgebra) (ha : 0 ≤ a.val) : + 0 ≤ (τ.trace a).re := + ContinuousLinearMap.nonneg_iff_isPositive.mp ha |>.re_inner_nonneg_right τ.vector + +theorem ambient_trace_mono {a b : M.toStarSubalgebra} (hab : a.val ≤ b.val) : + (τ.trace a).re ≤ (τ.trace b).re := by + have h := ambient_trace_nonneg τ (b-a) (sub_nonneg.mpr hab) + change 0 ≤ (inner ℂ τ.vector (b.val τ.vector - a.val τ.vector)).re at h + simpa only [TracialRepresentation.trace, inner_sub_right, Complex.sub_re, sub_nonneg] using h + +theorem ambient_sqrt_mem (a : M.toStarSubalgebra) (ha : 0 ≤ a.val) : + CFC.sqrt a.val ∈ M.toStarSubalgebra := by + let : IsClosed (M.toStarSubalgebra : Set (H →L[ℂ] H)) := base_norm_closed M + rw [CFC.sqrt_eq_real_sqrt a.val ha, cfcₙ_eq_cfc Real.continuous_sqrt.continuousOn] + exact cfc_mem (𝕜' := ℂ) Real.sqrt a.property + +theorem ambient_eq_zero_of_trace_zero (a : M.toStarSubalgebra) + (ha : 0 ≤ a.val) (ht : (τ.trace a).re = 0) : a = 0 := by + let s : M.toStarSubalgebra := ⟨CFC.sqrt a.val, ambient_sqrt_mem a ha⟩ + have hs : star s * s = a := by + apply Subtype.ext + change star (CFC.sqrt a.val) * CFC.sqrt a.val = a.val + rw [(CFC.sqrt_nonneg a.val).isSelfAdjoint.star_eq, CFC.sqrt_mul_sqrt_self a.val ha] + have h := congrArg Complex.re (τ.trace_star_mul s) + rw [hs, ht] at h + simp only [← Complex.ofReal_pow, Complex.ofReal_re] at h + have hz : τ.norm₂ s = 0 := by nlinarith [sq_nonneg (τ.norm₂ s)] + have sz := (τ.norm₂_eq_zero_iff s).mp hz + simpa only [sz, star_zero, mul_zero] using hs.symm + +/-- Any lower bound of a uniformly bounded positive sequence whose traces +tend to zero is nonpositive. The sequence need not itself be monotone. -/ +theorem ambient_lowerBound_nonpos_of_trace_tendsto_zero + (b : ℕ → M.toStarSubalgebra) (hpos : ∀ n, 0 ≤ (b n).val) + (C : ℝ) (hC : 0 ≤ C) (hbound : ∀ n, ‖b n‖ ≤ C) + (ht : Tendsto (fun n => (τ.trace (b n)).re) atTop (𝓝 0)) + (c : M.toStarSubalgebra) (hc : ∀ n, c.val ≤ (b n).val) : c.val ≤ 0 := by + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + obtain ⟨T, _, hT⟩ := exists_weak_operator_ultralimit ω (fun n => (b n).val) C hC hbound + let d : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M b T hT⟩ + have hw : Tendsto (fun n => ContinuousLinearMapWOT.ofCLM (b n).val) (ω : Filter ℕ) + (𝓝 (ContinuousLinearMapWOT.ofCLM T)) := + ContinuousLinearMapWOT.tendsto_iff_forall_inner_apply_tendsto.mpr hT + have hd : 0 ≤ d.val := weakOperator_nonneg_isClosed.mem_of_tendsto hw + (Eventually.of_forall hpos) + have hz : (τ.trace d).re = 0 := tendsto_nhds_unique + (Complex.continuous_re.tendsto _ |>.comp (hT τ.vector τ.vector)) + (ht.mono_left (Ultrafilter.of_le atTop)) + have hcd : c.val ≤ d.val := (weakOperator_lowerBound_isClosed c.val).mem_of_tendsto hw + (Eventually.of_forall hc) + simpa only [ambient_eq_zero_of_trace_zero τ d hd hz, ZeroMemClass.coe_zero] using hcd + +end Tracial + +end + +/-! Absolute values in the represented algebra, with ambient order bounds +and the actual trace two-norm. -/ +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def ambientAbsoluteValue (a : M.toStarSubalgebra) : M.toStarSubalgebra := + ⟨CFC.abs a.val, ambient_sqrt_mem (star a*a) (star_mul_self_nonneg a.val)⟩ + +theorem ambientAbsoluteValue_nonneg (a : M.toStarSubalgebra) : + 0 ≤ (ambientAbsoluteValue a).val := CFC.abs_nonneg _ + +theorem ambientAbsoluteValue_norm (a : M.toStarSubalgebra) : + ‖ambientAbsoluteValue a‖ = ‖a‖ := by + change ‖CFC.abs a.val‖ = ‖a.val‖ + exact CFC.norm_abs + +theorem ambientAbsoluteValue_norm₂ (a : M.toStarSubalgebra) : + τ.norm₂ (ambientAbsoluteValue a) = τ.norm₂ a := by + have he : star (ambientAbsoluteValue a)*ambientAbsoluteValue a = star a*a := by + apply Subtype.ext + change star (CFC.abs a.val)*CFC.abs a.val = star a.val*a.val + rw [(CFC.abs_nonneg a.val).isSelfAdjoint.star_eq, CFC.abs_mul_abs] + have h := congrArg Complex.re (τ.trace_star_mul (ambientAbsoluteValue a)) + rw [he, τ.trace_star_mul] at h + simp only [← Complex.ofReal_pow, Complex.ofReal_re] at h + nlinarith [show 0 ≤ τ.norm₂ a from norm_nonneg _, + show 0 ≤ τ.norm₂ (ambientAbsoluteValue a) from norm_nonneg _] + +theorem ambientAbsoluteValue_trace_le_norm₂ (a : M.toStarSubalgebra) : + (τ.trace (ambientAbsoluteValue a)).re ≤ τ.norm₂ a := + (Complex.re_le_norm _).trans ((τ.norm_trace_le_norm₂ _).trans_eq + (ambientAbsoluteValue_norm₂ τ a)) + +theorem ambient_le_absoluteValue (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a.val) : + a.val ≤ (ambientAbsoluteValue a).val := by + apply sub_nonneg.mp + change 0 ≤ CFC.abs a.val - a.val + rw [CFC.abs_sub_self a.val ha] + exact nsmul_nonneg (CFC.negPart_nonneg a.val) 2 + +theorem ambient_neg_absoluteValue_le (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a.val) : + -(ambientAbsoluteValue a).val ≤ a.val := by + have h : 0 ≤ CFC.abs a.val + a.val := by + rw [CFC.abs_add_self a.val ha] + exact nsmul_nonneg (CFC.posPart_nonneg a.val) 2 + apply neg_le_iff_add_nonneg.mpr + change 0 ≤ a.val + CFC.abs a.val + simpa only [add_comm] using h + +theorem norm₂_realPart_le (a : M.toStarSubalgebra) : + τ.norm₂ (realPart a) ≤ τ.norm₂ a := by + have he : τ.norm₂ (realPart a) = (1/2 : ℝ) * τ.norm₂ (a+star a) := by + rw [realPart_apply_coe] + change ‖(2 : ℝ)⁻¹ • ((a+star a).val τ.vector)‖ = _ + rw [norm_smul] + norm_num + rfl + rw [he] + have h := τ.norm₂_add_le a (star a) + rw [τ.norm₂_star] at h + linarith + +theorem norm₂_imaginaryPart_le (a : M.toStarSubalgebra) : + τ.norm₂ (imaginaryPart a) ≤ τ.norm₂ a := by + have h := norm₂_realPart_le τ (Complex.I • (-a)) + have hr : (realPart (Complex.I • (-a)) : M.toStarSubalgebra) = imaginaryPart a := by + rw [smul_neg, map_neg, realPart_I_smul, neg_neg] + rw [hr, τ.norm₂_smul, Complex.norm_I, one_mul] at h + have hn : τ.norm₂ (-a) = τ.norm₂ a := norm_neg _ + rwa [hn] at h + +end Tracial + +/-! The bounded monotone transform a ↦ 1 - (1+a)⁻¹ of positive operators. +Its bounds prepare a construction of decreasing order majorants from small +trace tails. No tail majorant or predual continuity is asserted here. -/ +section +variable {A : Type*} [CStarAlgebra A] [PartialOrder A] [StarOrderedRing A] + +def positiveResolvent (a : A) : A := cfc (fun t : ℝ => 1 - (1 + t)⁻¹) a + +theorem positiveResolvent_continuousOn (a : A) (ha : 0 ≤ a) : + ContinuousOn (fun t : ℝ => 1 - (1 + t)⁻¹) (spectrum ℝ a) := by + apply continuousOn_const.sub + apply (continuousOn_const.add continuousOn_id).inv₀ + intro t ht + have := spectrum_nonneg_of_nonneg ha ht + change 1 + t ≠ 0 + linarith + +theorem positiveResolvent_eq (a : A) (ha : 0 ≤ a) : + positiveResolvent a = 1 - Ring.inverse (1 + a) := by + have hn (t : ℝ) (ht : t ∈ spectrum ℝ a) : 1 + t ≠ 0 := by + have := spectrum_nonneg_of_nonneg ha ht + positivity + have hi : ContinuousOn (fun t : ℝ => (1 + t)⁻¹) (spectrum ℝ a) := + (continuousOn_const.add continuousOn_id).inv₀ hn + rw [positiveResolvent, cfc_sub (fun _ : ℝ => 1) (fun t => (1 + t)⁻¹) a + continuousOn_const hi, + cfc_const_one ℝ a, cfc_inv (fun t : ℝ => 1 + t) a hn, + cfc_const_add (1 : ℝ) (fun t : ℝ => t) a continuousOn_id ha.isSelfAdjoint, + cfc_id' ℝ a ha.isSelfAdjoint] + simp only [map_one] + +theorem positiveResolvent_nonneg (a : A) (ha : 0 ≤ a) : 0 ≤ positiveResolvent a := by + apply cfc_nonneg + intro t ht + have ht0 := spectrum_nonneg_of_nonneg ha ht + have hi : (1 + t)⁻¹ ≤ 1 := inv_le_one_of_one_le₀ (by linarith) + linarith + +theorem positiveResolvent_le_one (a : A) (ha : 0 ≤ a) : positiveResolvent a ≤ 1 := by + apply cfc_le_one + intro t ht + have ht0 := spectrum_nonneg_of_nonneg ha ht + exact sub_le_self _ (inv_nonneg.mpr (by linarith)) + +theorem positiveResolvent_mono {a b : A} (ha : 0 ≤ a) (hab : a ≤ b) : + positiveResolvent a ≤ positiveResolvent b := by + rw [positiveResolvent_eq a ha, positiveResolvent_eq b (ha.trans hab)] + apply sub_le_sub_left + exact CStarAlgebra.ringInverse_le_ringInverse (add_le_add le_rfl hab) + (isStrictlyPositive_one.add_nonneg ha) + +theorem positiveResolvent_le_self (a : A) (ha : 0 ≤ a) : positiveResolvent a ≤ a := by + calc + positiveResolvent a ≤ cfc (fun t : ℝ => t) a := by + apply cfc_mono (hf := positiveResolvent_continuousOn a ha) (hg := continuousOn_id) + intro t ht + have ht0 := spectrum_nonneg_of_nonneg ha ht + have hp : 0 < 1 + t := by linarith + have hi : 1 - t ≤ (1 + t)⁻¹ := by + rw [inv_eq_one_div] + apply (le_div_iff₀ hp).mpr + nlinarith [sq_nonneg t] + change 1 - (1 + t)⁻¹ ≤ t + linarith + _ = a := cfc_id' ℝ a ha.isSelfAdjoint + +theorem half_le_positiveResolvent (a : A) (ha : 0 ≤ a) (ha1 : a ≤ 1) : + (1 / 2 : ℝ) • a ≤ positiveResolvent a := by + rw [← cfc_const_mul_id (1 / 2 : ℝ) a ha.isSelfAdjoint] + apply cfc_mono (hf := by fun_prop) (hg := positiveResolvent_continuousOn a ha) + intro t ht + have ht0 := spectrum_nonneg_of_nonneg ha ht + have ht1 : t ≤ 1 := (CFC.le_one_iff (R := ℝ) a ha.isSelfAdjoint).mp ha1 t ht + have hp : 0 < 1 + t := by linarith + have hi : (1 + t)⁻¹ ≤ 1 - t / 2 := by + rw [inv_eq_one_div] + apply (div_le_iff₀ hp).mpr + nlinarith + linarith + +theorem positiveResolvent_norm_le_one (a : A) (ha : 0 ≤ a) : ‖positiveResolvent a‖ ≤ 1 := + (CStarAlgebra.norm_le_one_iff_of_nonneg _ (positiveResolvent_nonneg a ha)).mpr + (positiveResolvent_le_one a ha) + +end + +/-! Decreasing positive order majorants for positive contractions with +summable trace. The finite-tail resolvents and their least upper bounds are +constructed in the actual algebra. -/ +open Filter +open scoped Topology BigOperators +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def algebraPositiveResolvent (a : M.toStarSubalgebra) : M.toStarSubalgebra := by + let : IsClosed (M.toStarSubalgebra : Set (H →L[ℂ] H)) := base_norm_closed M + exact ⟨positiveResolvent a.val, + cfc_mem (𝕜' := ℂ) (fun t : ℝ => 1 - (1+t)⁻¹) a.property⟩ + +theorem ambient_trace_finset_sum {ι : Type*} (s : Finset ι) + (a : ι → M.toStarSubalgebra) : + (τ.trace (∑ k ∈ s, a k)).re = ∑ k ∈ s, (τ.trace (a k)).re := by + classical + induction s using Finset.induction_on with + | empty => simp [TracialRepresentation.trace] + | @insert k s hk ih => + rw [Finset.sum_insert hk, Finset.sum_insert hk, ← ih] + change (inner ℂ τ.vector ((a k).val τ.vector + (∑ i ∈ s, a i).val τ.vector)).re = _ + rw [inner_add_right, Complex.add_re] + rfl + +theorem ambient_trace_real_smul (r : ℝ) (a : M.toStarSubalgebra) : + (τ.trace (r • a)).re = r * (τ.trace a).re := by + change (inner ℂ τ.vector ((r : ℂ) • a.val τ.vector)).re = _ + simp only [inner_smul_right, Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, + zero_mul, sub_zero] + rfl + +theorem exists_positive_trace_tail_majorants (a : ℕ → M.toStarSubalgebra) + (hpos : ∀ n, 0 ≤ (a n).val) (hbound : ∀ n, ‖a n‖ ≤ 1) + (hsum : Summable (fun n => (τ.trace (a n)).re)) : + ∃ b : ℕ → M.toStarSubalgebra, + (∀ n, 0 ≤ (b n).val) ∧ (∀ n, ‖b n‖ ≤ 2) ∧ + Antitone (fun n => (b n).val) ∧ (∀ n, (a n).val ≤ (b n).val) ∧ + (∀ n, (τ.trace (b n)).re ≤ 2 * ∑' k, (τ.trace (a (n+k))).re) ∧ + (∀ c : M.toStarSubalgebra, (∀ n, c.val ≤ (b n).val) → c.val ≤ 0) := by + classical + let s (n m : ℕ) : M.toStarSubalgebra := ∑ k ∈ Finset.Ico n m, a k + have hsval (n m : ℕ) : (s n m).val = ∑ k ∈ Finset.Ico n m, (a k).val := by + exact map_sum M.toStarSubalgebra.subtype _ _ + have hspos (n m : ℕ) : 0 ≤ (s n m).val := by + rw [hsval] + exact Finset.sum_nonneg (fun k _ => hpos k) + have hsmono (n : ℕ) : Monotone (fun m => (s n m).val) := by + intro i j hij + change (s n i).val ≤ (s n j).val + rw [hsval, hsval] + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.Ico_subset_Ico le_rfl hij) + (fun k _ _ => hpos k) + have hsanti (m : ℕ) : Antitone (fun n => (s n m).val) := by + intro i j hij + change (s j m).val ≤ (s i m).val + rw [hsval, hsval] + exact Finset.sum_le_sum_of_subset_of_nonneg (Finset.Ico_subset_Ico hij le_rfl) + (fun k _ _ => hpos k) + let u (n m : ℕ) := algebraPositiveResolvent (s n m) + have hup (n m : ℕ) : 0 ≤ (u n m).val := positiveResolvent_nonneg _ (hspos n m) + have huone (n m : ℕ) : (u n m).val ≤ 1 := positiveResolvent_le_one _ (hspos n m) + have humono (n : ℕ) : Monotone (fun m => (u n m).val) := + fun i j hij => positiveResolvent_mono (hspos n i) (hsmono n hij) + have hut (n m : ℕ) : (τ.trace (u n m)).re ≤ ∑' k, (τ.trace (a (n+k))).re := by + calc + (τ.trace (u n m)).re ≤ (τ.trace (s n m)).re := + ambient_trace_mono τ (positiveResolvent_le_self _ (hspos n m)) + _ = ∑ k ∈ Finset.range (m-n), (τ.trace (a (n+k))).re := by + rw [ambient_trace_finset_sum, Finset.sum_Ico_eq_sum_range] + _ ≤ ∑' k, (τ.trace (a (n+k))).re := + Summable.sum_le_tsum _ (fun k _ => ambient_trace_nonneg τ _ (hpos _)) + (by simpa only [Nat.add_comm] using (summable_nat_add_iff n).mpr hsum) + have hc (n : ℕ) := exists_monotone_positive_limit τ (u n) (humono n) (hup n) + 1 zero_le_one (fun m => positiveResolvent_norm_le_one _ (hspos n m)) + (∑' k, (τ.trace (a (n+k))).re) (hut n) + choose c hcp hcn hcu hcl hct using hc + have hcanti : Antitone (fun n => (c n).val) := by + intro i j hij + apply hcl j + intro m + exact (positiveResolvent_mono (hspos j m) (hsanti m hij)).trans (hcu i m) + let b (n : ℕ) : M.toStarSubalgebra := (2 : ℝ) • c n + have hbp (n : ℕ) : 0 ≤ (b n).val := by + change 0 ≤ (2 : ℝ) • (c n).val + exact smul_nonneg (by norm_num : (0 : ℝ) ≤ 2) (hcp n) + have hbn (n : ℕ) : ‖b n‖ ≤ 2 := by + dsimp [b] + rw [norm_smul, Real.norm_eq_abs, abs_of_pos (by norm_num : (0 : ℝ) < 2)] + exact (mul_le_mul_of_nonneg_left (hcn n) (by norm_num : (0 : ℝ) ≤ 2)).trans_eq + (mul_one 2) + have hbt (n : ℕ) : (τ.trace (b n)).re ≤ 2 * ∑' k, (τ.trace (a (n+k))).re := by + rw [ambient_trace_real_smul] + exact mul_le_mul_of_nonneg_left (hct n) (by norm_num) + refine ⟨b, hbp, hbn, ?_, ?_, hbt, ?_⟩ + · intro i j hij + change (2 : ℝ) • (c j).val ≤ (2 : ℝ) • (c i).val + exact smul_le_smul_of_nonneg_left (hcanti hij) (by norm_num : (0 : ℝ) ≤ 2) + · intro n + change (a n).val ≤ (2 : ℝ) • (c n).val + have ha1 : (a n).val ≤ 1 := + (CStarAlgebra.norm_le_one_iff_of_nonneg _ (hpos n)).mp (hbound n) + have hn : s n (n+1) = a n := by simp [s] + have hv := hcu n (n+1) + change positiveResolvent (s n (n+1)).val ≤ (c n).val at hv + rw [hn] at hv + have hh : (1/2 : ℝ) • (a n).val ≤ (c n).val := + (half_le_positiveResolvent _ (hpos n) ha1).trans hv + have hd := smul_le_smul_of_nonneg_left hh (by norm_num : (0 : ℝ) ≤ 2) + simpa only [smul_smul, show (2 : ℝ) * (1/2) = 1 by norm_num, one_smul] using hd + · apply ambient_lowerBound_nonpos_of_trace_tendsto_zero τ b hbp 2 (by norm_num) hbn + apply squeeze_zero (fun n => ambient_trace_nonneg τ _ (hbp n)) hbt + simpa only [Nat.add_comm, mul_zero] using + (tendsto_const_nhds.mul (tendsto_sum_nat_add (fun n => (τ.trace (a n)).re)) : + Tendsto (fun n => 2 * ∑' k, (τ.trace (a (k+n))).re) atTop (𝓝 (2*0))) + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/NormalDimension.lean b/lean/OAI/Analysis/FactorGeneration/NormalDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..d8e6df6401a54ad1ff0c52512a3afbca49b85c8d --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/NormalDimension.lean @@ -0,0 +1,709 @@ +import OAI.Analysis.FactorGeneration.Dimension + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Increasing projection suprema and compatible sequential comparison. +The witnesses live in the original algebra; no trace or dimension is used. -/ +namespace Tracial + +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +namespace AlgebraProjection + +/-- Actual least upper bounds for arbitrary nonempty directed projection nets. -/ +theorem exists_isLUB_monotone + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) : + ∃ p : AlgebraProjection M, IsLUB (Set.range q) p := by + obtain ⟨v,hv,hs,_⟩ := PartialIsometry.traceFree_monotone_least_supports + (fun i => PartialIsometry.onProjection (q i)) (fun _ _ h => hq h) + refine ⟨v.support,?_,?_⟩ + · rintro _ ⟨i,rfl⟩ + exact PartialIsometry.support_mono (hv i) + · intro p hp + exact hs p (fun i => hp ⟨i,rfl⟩) + +end AlgebraProjection +namespace PartialIsometry + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfactor hfinite in +/-- Extend a given embedding to a larger source while keeping its target in r. -/ +theorem exists_extension_of_subequivalent (v : PartialIsometry M) + (p r : AlgebraProjection M) (hp : v.support ≤ p) (hr : v.target ≤ r) + (hpr : p.Subequivalent r) : + ∃ w : PartialIsometry M, v ≤ w ∧ w.support=p ∧ w.target ≤ r := by + obtain ⟨u,hu,ht⟩ := AlgebraProjection.remainder_subequivalent hfinite hfactor hp hr + (show v.support.Equivalent v.target from ⟨v,rfl,rfl⟩) hpr + have hi : v.support.val*u.support.val=0 := by + rw [hu] + exact AlgebraProjection.remainder_orthogonal _ _ hp + have ho : v.target.val*u.target.val=0 := + projection_orthogonal_of_le (AlgebraProjection.remainder_orthogonal _ _ hr) le_rfl ht + refine ⟨v.patch u hi ho,v.le_patch u hi ho,?_,?_⟩ + · apply Subtype.ext + change v.support.val+u.support.val=p.val + rw [hu] + change v.support.val+(p.val-v.support.val)=p.val + abel + · have he : (v.patch u hi ho).target=orthogonalSum v.target u.target ho := + Subtype.ext (v.patch_target u hi ho) + rw [he] + exact orthogonalSum_le ho hr (ht.trans (AlgebraProjection.remainder_le _ _ hr)) + +include hfactor hfinite in +/-- A sequence of comparable sources admits compatible actual embeddings. -/ +theorem exists_monotone_embeddings (q : ℕ → AlgebraProjection M) (hq : Monotone q) + (r : AlgebraProjection M) (hr : ∀ n, (q n).Subequivalent r) : + ∃ a : ℕ → PartialIsometry M, Monotone a ∧ + (∀ n, (a n).support=q n) ∧ (∀ n, (a n).target ≤ r) := by + classical + obtain ⟨v,hv,ht⟩ := hr 0 + let step (n : ℕ) (w : {w : PartialIsometry M // w.support=q n ∧ w.target ≤ r}) := + exists_extension_of_subequivalent hfactor hfinite w.val (q (n+1)) r + (by rw [w.property.1]; exact hq (Nat.le_succ n)) w.property.2 (hr (n+1)) + let a : (n : ℕ) → {w : PartialIsometry M // w.support=q n ∧ w.target ≤ r} := + Nat.rec ⟨v,hv,ht⟩ (fun n w => ⟨(step n w).choose,(step n w).choose_spec.2⟩) + refine ⟨fun n => (a n).val,?_,fun n => (a n).property.1,fun n => (a n).property.2⟩ + apply monotone_nat_of_le_succ + intro n + exact (step n (a n)).choose_spec.1 + +end PartialIsometry +namespace AlgebraProjection + +/-- Sequential increasing-union comparison, with a constructed compatible +partial-isometry limit. No dimension-continuity premise occurs. -/ +theorem isLUB_subequivalent_of_sequence + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (q : ℕ → AlgebraProjection M) (hq : Monotone q) + (p : AlgebraProjection M) (hp : IsLUB (Set.range q) p) + (r : AlgebraProjection M) (hr : ∀ n, (q n).Subequivalent r) : + p.Subequivalent r := by + obtain ⟨a,ha,hs,ht⟩ := PartialIsometry.exists_monotone_embeddings hfactor hfinite q hq r hr + obtain ⟨v,hv,hvs,hvt⟩ := PartialIsometry.traceFree_monotone_least_supports a ha + refine ⟨v,le_antisymm (hvs p (fun n => by rw [hs]; exact hp.1 ⟨n,rfl⟩)) ?_,hvt r ht⟩ + apply hp.2 + rintro _ ⟨n,rfl⟩ + rw [← hs n] + exact PartialIsometry.support_mono (hv n) + +end AlgebraProjection +end + +/-! Continuity of the constructed dimension on arbitrary increasing projection +nets. Compatible sequential embeddings are proved first; dimension approximation +then constructs a countable subfamily with the same projection supremum. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem traceFreeDimension_range_bddAbove {I : Type*} (q : I → AlgebraProjection M) : + BddAbove (Set.range (fun i => traceFreeDimension hfactor hdiff (q i))) := + ⟨1,by rintro _ ⟨i,rfl⟩; exact traceFreeDimension_le_one hfactor hdiff (q i)⟩ + +include hfinite in +/-- Continuity on sequences follows from compatible embeddings into each +concrete dyadic upper approximant of the real supremum. -/ +theorem traceFreeDimension_isLUB_sequence + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (q : ℕ → AlgebraProjection M) (hq : Monotone q) + (p : AlgebraProjection M) (hp : IsLUB (Set.range q) p) : + traceFreeDimension hfactor hdiff p = + sSup (Set.range (fun n => traceFreeDimension hfactor hdiff (q n))) := by + let c := sSup (Set.range (fun n => traceFreeDimension hfactor hdiff (q n))) + have hb := traceFreeDimension_range_bddAbove hfactor hdiff q + have hne := Set.range_nonempty (fun n => traceFreeDimension hfactor hdiff (q n)) + have hqc (n : ℕ) : traceFreeDimension hfactor hdiff (q n) ≤ c := le_csSup hb ⟨n,rfl⟩ + have hc : 0 ≤ c := (traceFreeDimension_nonneg hfactor hdiff (q 0)).trans (hqc 0) + have hc1 : c ≤ 1 := csSup_le hne (by + rintro _ ⟨n,rfl⟩; exact traceFreeDimension_le_one hfactor hdiff (q n)) + apply le_antisymm ?_ (csSup_le hne (by + rintro _ ⟨n,rfl⟩ + exact traceFreeDimension_mono hfactor hdiff (hp.1 ⟨n,rfl⟩))) + apply le_of_all_dyadic_errors + intro n + obtain ⟨r,hcr,hrc⟩ := traceFreeDimension_exists_upper hfactor hdiff hfinite hunit c hc hc1 n + have hqr (k : ℕ) : (q k).Subequivalent r := + (traceFreeDimension_le_iff_subequivalent hfactor hdiff hfinite hunit _ _).mp + ((hqc k).trans hcr) + exact (traceFreeDimension_subequivalent hfactor hdiff + (AlgebraProjection.isLUB_subequivalent_of_sequence hfactor hfinite q hq p hp r hqr)).trans hrc + +/-- Every countable family in a directed preorder has an increasing majorant +above a specified index. This is not countable cofinality of the preorder. -/ +theorem exists_monotone_dominating_from + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] (f : ℕ → I) (i : I) : + ∃ a : ℕ → I, Monotone a ∧ (∀ n, f n ≤ a n) ∧ (∀ n, i ≤ a n) := by + classical + let upper (x y : I) := (exists_ge_ge x y).choose + have hl (x y : I) : x ≤ upper x y := (exists_ge_ge x y).choose_spec.1 + have hr (x y : I) : y ≤ upper x y := (exists_ge_ge x y).choose_spec.2 + let a : ℕ → I := Nat.rec (upper i (f 0)) (fun n j => upper j (f (n+1))) + have ha : Monotone a := monotone_nat_of_le_succ (fun n => hl (a n) (f (n+1))) + refine ⟨a,ha,?_,fun n => (hl i (f 0)).trans (ha (Nat.zero_le n))⟩ + intro n + cases n with + | zero => exact hr i (f 0) + | succ n => exact hr (a n) (f (n+1)) + +include hfinite in +/-- Construct an increasing countable subfamily whose supremum dimension is +the real supremum of the entire directed family. No countability is assumed. -/ +theorem traceFreeDimension_exists_exhausting_sequence + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) : + ∃ (a : ℕ → I) (s : AlgebraProjection M), Monotone a ∧ + IsLUB (Set.range (fun n => q (a n))) s ∧ + traceFreeDimension hfactor hdiff s = + sSup (Set.range (fun i => traceFreeDimension hfactor hdiff (q i))) := by + classical + let c := sSup (Set.range (fun i => traceFreeDimension hfactor hdiff (q i))) + have hb := traceFreeDimension_range_bddAbove hfactor hdiff q + have hqc (i : I) : traceFreeDimension hfactor hdiff (q i) ≤ c := le_csSup hb ⟨i,rfl⟩ + have hex (n : ℕ) : ∃ i, c-1/2^n < traceFreeDimension hfactor hdiff (q i) := by + have hn : c-1/2^n traceFreeDimension hfactor hdiff (q i))) hn + exact ⟨i,hi⟩ + choose f hf using hex + obtain ⟨a,ha,hfa,_⟩ := exists_monotone_dominating_from f (Classical.choice ‹Nonempty I›) + obtain ⟨s,hs⟩ := AlgebraProjection.exists_isLUB_monotone (fun n => q (a n)) (hq.comp ha) + refine ⟨a,s,ha,hs,le_antisymm ?_ ?_⟩ + · rw [traceFreeDimension_isLUB_sequence hfactor hdiff hfinite hunit _ (hq.comp ha) s hs] + exact csSup_le (Set.range_nonempty _) (by rintro _ ⟨n,rfl⟩; exact hqc (a n)) + · apply le_of_all_dyadic_errors + intro n + have hfq := traceFreeDimension_mono hfactor hdiff (hq (hfa n)) + have hqs := traceFreeDimension_mono hfactor hdiff (hs.1 ⟨n,rfl⟩) + have hfn := hf n + linarith + +include hfinite in +/-- The constructed countable supremum bounds the entire net: adjoining any +one index cannot increase its dimension, so strict increase forces equality. -/ +theorem traceFreeDimension_exists_isLUB + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) : + ∃ p : AlgebraProjection M, IsLUB (Set.range q) p ∧ + traceFreeDimension hfactor hdiff p = + sSup (Set.range (fun i => traceFreeDimension hfactor hdiff (q i))) := by + obtain ⟨a,s,ha,hs,hd⟩ := traceFreeDimension_exists_exhausting_sequence + hfactor hdiff hfinite hunit q hq + have hupper (i : I) : q i ≤ s := by + obtain ⟨b,hb,hab,hib⟩ := exists_monotone_dominating_from a i + obtain ⟨t,ht⟩ := AlgebraProjection.exists_isLUB_monotone (fun n => q (b n)) (hq.comp hb) + have hst : s ≤ t := hs.2 (by + rintro _ ⟨n,rfl⟩; exact (hq (hab n)).trans (ht.1 ⟨n,rfl⟩)) + have htd : traceFreeDimension hfactor hdiff t ≤ traceFreeDimension hfactor hdiff s := by + rw [hd,traceFreeDimension_isLUB_sequence hfactor hdiff hfinite hunit _ (hq.comp hb) t ht] + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨n,rfl⟩ + exact le_csSup (traceFreeDimension_range_bddAbove hfactor hdiff q) ⟨b n,rfl⟩ + have he : s=t := by + by_contra hne + exact (not_lt_of_ge htd) (traceFreeDimension_strictMono hfactor hdiff hfinite hunit + (lt_of_le_of_ne hst hne)) + rw [he] + exact (hq (hib 0)).trans (ht.1 ⟨0,rfl⟩) + refine ⟨s,⟨?_,?_⟩,hd⟩ + · rintro _ ⟨i,rfl⟩; exact hupper i + · intro p hp + exact hs.2 (by rintro _ ⟨n,rfl⟩; exact hp ⟨a n,rfl⟩) + +include hfinite in +/-- Order continuity on arbitrary nonempty directed projection nets. -/ +theorem traceFreeDimension_isLUB_monotone + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) + (p : AlgebraProjection M) (hp : IsLUB (Set.range q) p) : + traceFreeDimension hfactor hdiff p = + sSup (Set.range (fun i => traceFreeDimension hfactor hdiff (q i))) := by + obtain ⟨s,hs,hd⟩ := traceFreeDimension_exists_isLUB hfactor hdiff hfinite hunit q hq + have he : p=s := le_antisymm (hp.2 hs.1) (hs.2 hp.1) + rw [he] + exact hd + +end Tracial + +/-! Original-factor wrapper for normalized faithful order-continuous projection +dimension. This does not assert the existence of a linear trace functional. -/ +section +universe v +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +namespace Tracial +variable {M : VonNeumannAlgebra H} + +/-- Arbitrary increasing-union comparison, now a consequence of the constructed +dimension continuity and exact classification of comparison. -/ +theorem traceFree_isLUB_subequivalent + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) + (p : AlgebraProjection M) (hp : IsLUB (Set.range q) p) + (r : AlgebraProjection M) (hr : ∀ i, (q i).Subequivalent r) : + p.Subequivalent r := by + apply (traceFreeDimension_le_iff_subequivalent hfactor hdiff hfinite hunit p r).mp + rw [traceFreeDimension_isLUB_monotone hfactor hdiff hfinite hunit q hq p hp] + apply csSup_le (Set.range_nonempty _) + rintro _ ⟨i,rfl⟩ + exact traceFreeDimension_subequivalent hfactor hdiff (hr i) + +end Tracial + +/-- The same actual dimension satisfies all finite laws and arbitrary-directed +supremum continuity under exactly the original IsII1Factor hypothesis. -/ +theorem isII1Factor_projection_dimension_orderContinuous + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) : + ∃ D : Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed) → ℝ, + D ⟨1,IsStarProjection.one _⟩=1 ∧ + (∀ q, 0 ≤ D q ∧ D q ≤ 1) ∧ + (∀ q, D q=0 ↔ q.val=0) ∧ + (∀ q r, D q ≤ D r ↔ q.Subequivalent r) ∧ + (∀ q r, D q=D r ↔ q.Equivalent r) ∧ + (∀ q r (ho : q.val*r.val=0), D (Tracial.orthogonalSum q r ho)=D q+D r) ∧ + (∀ (I : Type v) [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → Tracial.AlgebraProjection (vonNeumannOfWOTClosed S hS.weaklyClosed)), + Monotone q → ∃ p, IsLUB (Set.range q) p ∧ + D p=sSup (Set.range (fun i => D (q i)))) := by + let M := vonNeumannOfWOTClosed S hS.weaklyClosed + have hf : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + let p : Tracial.AlgebraProjection M := ⟨1,IsStarProjection.one _⟩ + have hp : p.val≠0 := by + intro h + exact hS.nonzero (congrArg Subtype.val h).symm + have hle (q : Tracial.AlgebraProjection M) : q ≤ p := one_mul _ + refine ⟨Tracial.traceFreeDimension hf hS.diffuse,?_,?_,?_,?_,?_,?_,?_⟩ + · exact Tracial.traceFreeDyadicSup_self hf hS.diffuse p + · intro q + exact ⟨Tracial.traceFreeDimension_nonneg hf hS.diffuse q, + Tracial.traceFreeDimension_le_one hf hS.diffuse q⟩ + · intro q + exact Tracial.traceFreeDyadicSup_eq_zero_iff hf hS.diffuse hS.finite p q hp + · intro q r + exact Tracial.traceFreeDimension_le_iff_subequivalent hf hS.diffuse hS.finite hp q r + · intro q r + exact Tracial.traceFreeDyadicSup_eq_iff_equivalent hf hS.diffuse hS.finite p q r hp (hle q) (hle r) + · intro q r ho + exact Tracial.traceFreeDyadicSup_orthogonal_add hf hS.diffuse hS.finite p q r hp (hle q) (hle r) ho + · intro I _ _ _ q hq + exact Tracial.traceFreeDimension_exists_isLUB hf hS.diffuse hS.finite hp q hq + +end + +/-! Exact prescribed dimensions are attained by actual subprojections. +Chain bounds use the proved arbitrary-net continuity of dimension. -/ +namespace Tracial + +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +theorem traceFreeDimension_exists_small_subprojection + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (p : AlgebraProjection M) (hp : p.val≠0) (ε : ℝ) (hε : 0<ε) : + ∃ q : AlgebraProjection M, q ≤ p ∧ 0 < traceFreeDimension hfactor hdiff q ∧ + traceFreeDimension hfactor hdiff q < ε := by + classical + have hpD : 0 < traceFreeDimension hfactor hdiff p := + traceFreeDyadicSup_pos hfactor hdiff hfinite _ p hp + obtain ⟨n,hn⟩ := exists_pow_lt_of_lt_one (lt_min hε hpD) (by norm_num : (1/2 : ℝ)<1) + rw [one_div_pow] at hn + have hn0 : (0 : ℝ)<1/2^n := by positivity + have hi : Nonempty (DyadicIndex n) := Fintype.card_pos_iff.mp (by + rw [card_dyadicIndex]; positivity) + let i : DyadicIndex n := Classical.choice hi + let e := (traceFreeDyadicPartition hfactor hdiff ⟨1,IsStarProjection.one _⟩ n).subset {i} + have heD : traceFreeDimension hfactor hdiff e=1/2^n := by + change traceFreeDyadicSup hfactor hdiff ⟨1,IsStarProjection.one _⟩ + ((traceFreeDyadicPartition hfactor hdiff ⟨1,IsStarProjection.one _⟩ n).subset {i})=1/2^n + rw [traceFreeDyadicSup_subset hfactor hdiff hfinite ⟨1,IsStarProjection.one _⟩ hunit] + simp only [dyadicWeight,Finset.card_singleton,Nat.cast_one] + obtain ⟨v,hv,ht⟩ := (traceFreeDimension_le_iff_subequivalent hfactor hdiff hfinite hunit e p).mp + (by rw [heD]; exact (lt_min_iff.mp hn).2.le) + have he : traceFreeDimension hfactor hdiff v.target=1/2^n := by + have h := traceFreeDyadicSup_equivalent hfactor hdiff ⟨1,IsStarProjection.one _⟩ + (show e.Equivalent v.target from ⟨v,hv,rfl⟩) + exact h.symm.trans heD + exact ⟨v.target,ht,by rw [he]; exact hn0,by rw [he]; exact (lt_min_iff.mp hn).1⟩ + +include hfinite in +theorem traceFreeDimension_bounded_chain + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (c : Set (AlgebraProjection M)) (hc : IsChain (· ≤ ·) c) (hne : c.Nonempty) + (p : AlgebraProjection M) (d : ℝ) + (hp : ∀ q ∈ c, q ≤ p) (hd : ∀ q ∈ c, traceFreeDimension hfactor hdiff q ≤ d) : + ∃ q : AlgebraProjection M, (∀ r ∈ c, r ≤ q) ∧ q ≤ p ∧ + traceFreeDimension hfactor hdiff q ≤ d := by + let : Nonempty c := hne.to_subtype + let : IsDirected c (· ≤ ·) := ⟨by + intro u v + rcases hc.total u.property v.property with h | h + · exact ⟨v,h,le_rfl⟩ + · exact ⟨u,le_rfl,h⟩⟩ + obtain ⟨q,hq,hD⟩ := traceFreeDimension_exists_isLUB hfactor hdiff hfinite hunit + (fun r : c => r.val) (fun _ _ h => h) + refine ⟨q,fun r hr => hq.1 ⟨⟨r,hr⟩,rfl⟩,?_,?_⟩ + · exact hq.2 (by rintro _ ⟨r,rfl⟩; exact hp r.val r.property) + · rw [hD] + exact csSup_le (Set.range_nonempty _) (by rintro _ ⟨r,rfl⟩; exact hd r.val r.property) + +include hfinite in +theorem traceFreeDimension_exists_maximal_below + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (p : AlgebraProjection M) (d : ℝ) (hd : 0 ≤ d) : + ∃ q : AlgebraProjection M, q ≤ p ∧ traceFreeDimension hfactor hdiff q ≤ d ∧ + ∀ r : AlgebraProjection M, r ≤ p → traceFreeDimension hfactor hdiff r ≤ d → + q ≤ r → r ≤ q := by + let S : Set (AlgebraProjection M) := {q | q ≤ p ∧ traceFreeDimension hfactor hdiff q ≤ d} + obtain ⟨q,hq⟩ := zorn_le₀ S (by + intro c hc hchain + by_cases hne : c.Nonempty + · obtain ⟨q,hcq,hqp,hqd⟩ := traceFreeDimension_bounded_chain hfactor hdiff hfinite hunit + c hchain hne p d (fun q hq => (hc hq).1) (fun q hq => (hc hq).2) + exact ⟨q,⟨hqp,hqd⟩,hcq⟩ + · refine ⟨⟨0,IsStarProjection.zero _⟩,⟨mul_zero _,?_⟩,?_⟩ + · have hz := traceFreeDyadicSup_zero hfactor hdiff ⟨1,IsStarProjection.one _⟩ + ⟨0,IsStarProjection.zero _⟩ hunit rfl + exact hz.le.trans hd + · intro r hr + exact (hne ⟨r,hr⟩).elim) + exact ⟨q,hq.1.1,hq.1.2,fun r hr hrd hqr => hq.2 ⟨hr,hrd⟩ hqr⟩ + +include hfinite in +/-- Every dimension between zero and D(p) is realized inside p. -/ +theorem traceFreeDimension_exists_subprojection + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (p : AlgebraProjection M) (d : ℝ) (hd : 0 ≤ d) + (hdp : d ≤ traceFreeDimension hfactor hdiff p) : + ∃ q : AlgebraProjection M, q ≤ p ∧ traceFreeDimension hfactor hdiff q=d := by + obtain ⟨q,hqp,hqd,hmax⟩ := traceFreeDimension_exists_maximal_below + hfactor hdiff hfinite hunit p d hd + refine ⟨q,hqp,le_antisymm hqd ?_⟩ + by_contra hnot + have hlt : traceFreeDimension hfactor hdiff q < d := lt_of_not_ge hnot + let r := AlgebraProjection.remainder q p hqp + have hr : r.val≠0 := by + change p.val-q.val≠0 + intro hz + have he : p=q := Subtype.ext (sub_eq_zero.mp hz) + rw [he] at hdp + exact (not_lt_of_ge hdp) hlt + obtain ⟨s,hs,hpos,hsmall⟩ := traceFreeDimension_exists_small_subprojection + hfactor hdiff hfinite hunit r hr (d-traceFreeDimension hfactor hdiff q) (sub_pos.mpr hlt) + have ho : q.val*s.val=0 := + projection_orthogonal_of_le (AlgebraProjection.remainder_orthogonal q p hqp) le_rfl hs + let t := orthogonalSum q s ho + have htp : t ≤ p := orthogonalSum_le ho hqp (hs.trans (AlgebraProjection.remainder_le q p hqp)) + have htD : traceFreeDimension hfactor hdiff t= + traceFreeDimension hfactor hdiff q+traceFreeDimension hfactor hdiff s := + traceFreeDyadicSup_orthogonal_add hfactor hdiff hfinite ⟨1,IsStarProjection.one _⟩ q s + hunit (one_mul _) (one_mul _) ho + have htd : traceFreeDimension hfactor hdiff t ≤ d := by rw [htD]; linarith + have hle : t ≤ q := hmax t htp htd (le_orthogonalSum_left _ _ ho) + have hmono := traceFreeDimension_mono hfactor hdiff hle + rw [htD] at hmono + linarith + +end + +/-! Finite partitions with prescribed dimensions, and actual equivalent +partitions of arbitrary positive finite size in every corner. -/ +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +theorem traceFreeDimension_remainder + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (q p : AlgebraProjection M) (hq : q ≤ p) : + traceFreeDimension hfactor hdiff (AlgebraProjection.remainder q p hq)= + traceFreeDimension hfactor hdiff p-traceFreeDimension hfactor hdiff q := by + have h := traceFreeDyadicSup_orthogonal_add hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ q (AlgebraProjection.remainder q p hq) + hunit (one_mul _) (one_mul _) (AlgebraProjection.remainder_orthogonal q p hq) + rw [AlgebraProjection.orthogonalSum_remainder] at h + change traceFreeDimension hfactor hdiff p= + traceFreeDimension hfactor hdiff q+ + traceFreeDimension hfactor hdiff (AlgebraProjection.remainder q p hq) at h + linarith + +include hfinite in +/-- Every prescribed finite list of nonnegative dimensions summing to D(p) +is realized by pairwise orthogonal actual projections summing to p. -/ +theorem traceFreeDimension_exists_partition + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (n : ℕ) (p : AlgebraProjection M) (d : Fin n → ℝ) + (hd : ∀ i, 0 ≤ d i) (hsum : ∑ i, d i=traceFreeDimension hfactor hdiff p) : + ∃ q : Fin n → AlgebraProjection M, (∀ i, q i ≤ p) ∧ + (∀ i j, i≠j → (q i).val*(q j).val=0) ∧ + (∑ i, (q i).val)=p.val ∧ (∀ i, traceFreeDimension hfactor hdiff (q i)=d i) := by + induction n generalizing p with + | zero => + have hpD : traceFreeDimension hfactor hdiff p=0 := by simpa using hsum.symm + have hpz : p.val=0 := (traceFreeDyadicSup_eq_zero_iff hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ p hunit).mp hpD + refine ⟨fun i => Fin.elim0 i,fun i => Fin.elim0 i,fun i => Fin.elim0 i,?_,fun i => Fin.elim0 i⟩ + simpa using hpz.symm + | succ n ih => + have hsum' : d 0+∑ i : Fin n, d i.succ=traceFreeDimension hfactor hdiff p := by + simpa only [Fin.sum_univ_succ] using hsum + have hdp : d 0 ≤ traceFreeDimension hfactor hdiff p := by + have hh : 0 ≤ ∑ i : Fin n, d i.succ := Finset.sum_nonneg (fun i _ => hd i.succ) + linarith + obtain ⟨q,hqp,hqd⟩ := traceFreeDimension_exists_subprojection + hfactor hdiff hfinite hunit p (d 0) (hd 0) hdp + let r := AlgebraProjection.remainder q p hqp + have hrD : traceFreeDimension hfactor hdiff r= + traceFreeDimension hfactor hdiff p-d 0 := by + rw [traceFreeDimension_remainder hfactor hdiff hfinite hunit q p hqp,hqd] + obtain ⟨b,hbr,hbo,hbs,hbd⟩ := ih r (fun i => d i.succ) (fun i => hd i.succ) (by + rw [hrD]; linarith) + let a : Fin (n+1) → AlgebraProjection M := Fin.cons q b + have hqb (i : Fin n) : q.val*(b i).val=0 := + projection_orthogonal_of_le (AlgebraProjection.remainder_orthogonal q p hqp) le_rfl (hbr i) + refine ⟨a,?_,?_,?_,?_⟩ + · intro i + refine Fin.cases hqp (fun j => ?_) i + exact (hbr j).trans (AlgebraProjection.remainder_le q p hqp) + · intro i + refine Fin.cases ?_ (fun j => ?_) i + · intro k + refine Fin.cases ?_ (fun l => ?_) k + · intro h; exact (h rfl).elim + · intro _; exact hqb l + · intro k + refine Fin.cases ?_ (fun l => ?_) k + · intro _; exact PartialIsometry.orthogonal_reverse q (b j) (hqb j) + · intro h + exact hbo j l (fun he => h (congrArg Fin.succ he)) + · rw [Fin.sum_univ_succ] + change q.val+(∑ i, (b i).val)=p.val + rw [hbs] + change q.val+(p.val-q.val)=p.val + abel + · intro i + exact Fin.cases hqd hbd i + +include hfinite in +/-- A finite corner partition into n equal dimensions, for every n>0. -/ +theorem traceFreeDimension_exists_uniform_partition + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (n : ℕ) (hn : 0 traceFreeDimension hfactor hdiff p/n) + · intro i + exact div_nonneg (traceFreeDimension_nonneg hfactor hdiff p) (Nat.cast_nonneg n) + · simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + field_simp + +include hfactor hdiff hfinite in +/-- Actual matrix-unit legs for a partition of every positive finite size. -/ +theorem traceFreeDimension_exists_equivalent_partition + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (n : ℕ) (hn : 0 (v i).adjoint.mul_eq_zero (v j) (by + change (v i).target.val*(v j).target.val=0 + rw [ht i,ht j]; exact hqo i j hij) + total := by simpa only [ht] using hqs + bound := fun i => by rw [ht]; exact hqp i }⟩ + +end Tracial + +/-! Actual vector functionals and their continuity on directed projection +suprema. No factor, trace, separability, or dimension hypothesis is used. -/ +open Filter +open scoped Topology BigOperators +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace AlgebraProjection + +/-- The original Hilbert-space vector functional on actual projections. -/ +def vectorValue (ξ : H) (p : AlgebraProjection M) : ℝ := + (inner ℂ ξ (p.val.val ξ)).re + +theorem vectorValue_eq_norm_sq (ξ : H) (p : AlgebraProjection M) : + vectorValue ξ p = ‖p.val.val ξ‖^2 := by + have hs : star p.val.val=p.val.val := congrArg Subtype.val p.property.isSelfAdjoint.star_eq + have hi : p.val.val (p.val.val ξ)=p.val.val ξ := + congrArg (fun a : M.toStarSubalgebra => a.val ξ) p.property.isIdempotentElem.eq + have he : inner ℂ (p.val.val ξ) (p.val.val ξ)=inner ℂ ξ (p.val.val ξ) := by + rw [← ContinuousLinearMap.adjoint_inner_right p.val.val] + rw [← ContinuousLinearMap.star_eq_adjoint,hs,hi] + rw [vectorValue,← he,inner_self_eq_norm_sq_to_K] + norm_cast + +theorem vectorValue_nonneg (ξ : H) (p : AlgebraProjection M) : 0 ≤ vectorValue ξ p := by + rw [vectorValue_eq_norm_sq] + positivity + +theorem vectorValue_remainder (ξ : H) (p q : AlgebraProjection M) (h : p ≤ q) : + vectorValue ξ (remainder p q h)=vectorValue ξ q-vectorValue ξ p := by + change (inner ℂ ξ (q.val.val ξ-p.val.val ξ)).re=_ + rw [inner_sub_right,Complex.sub_re] + rfl + +theorem vectorValue_mono (ξ : H) : Monotone (vectorValue (M := M) ξ) := by + intro p q hpq + have h := vectorValue_nonneg ξ (remainder p q hpq) + rw [vectorValue_remainder] at h + linarith + +/-- Retains the matrix-coefficient limit of the concrete projection supremum. +The ultrafilter is the fixed extension of atTop, not a countable subsequence. -/ +theorem exists_isLUB_monotone_vector_limit + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → AlgebraProjection M) (ha : Monotone a) : + ∃ p : AlgebraProjection M, IsLUB (Set.range a) p ∧ + ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i).val.val x)) + ((Ultrafilter.of atTop : Ultrafilter ι) : Filter ι) (𝓝 (inner ℂ y (p.val.val x))) := by + let ω : Ultrafilter ι := Ultrafilter.of atTop + obtain ⟨T, _, ht⟩ := exists_weak_operator_ultralimit ω + (fun i => ((a i).val : H →L[ℂ] H)) 1 (by norm_num) + (fun i => (a i).property.norm_le) + let b : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M (fun i => (a i).val) T ht⟩ + have hb (x y : H) : Tendsto (fun i => inner ℂ y (((a i).val : H →L[ℂ] H) x)) + (ω : Filter ι) (𝓝 (inner ℂ y ((b : H →L[ℂ] H) x))) := ht x y + have hadj (i : ι) (x y : H) : + inner ℂ x (((a i).val : H →L[ℂ] H) y) = + inner ℂ (((a i).val : H →L[ℂ] H) x) y := by + have hs : star (((a i).val : H →L[ℂ] H)) = ((a i).val : H →L[ℂ] H) := + congrArg Subtype.val (a i).property.isSelfAdjoint.star_eq + calc inner ℂ x (((a i).val : H →L[ℂ] H) y) = + inner ℂ x (star (((a i).val : H →L[ℂ] H)) y) := by rw [hs] + _ = inner ℂ (((a i).val : H →L[ℂ] H) x) y := by + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + have hself : star b = b := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + have hh := (hb y x).star + change Tendsto (fun i => (starRingEnd ℂ) (inner ℂ x (((a i).val : H →L[ℂ] H) y))) + (ω : Filter ι) (𝓝 ((starRingEnd ℂ) (inner ℂ x ((b : H →L[ℂ] H) y)))) at hh + simp only [inner_conj_symm] at hh + have eq := tendsto_nhds_unique (hb x y) (hh.congr (fun i => (hadj i y x).symm)) + change inner ℂ y (star (b : H →L[ℂ] H) x) = inner ℂ y ((b : H →L[ℂ] H) x) + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + exact eq.symm + have hba (i : ι) : b * (a i).val = (a i).val := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + apply tendsto_nhds_unique (hb (((a i).val : H →L[ℂ] H) x) y) + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y ((z : H →L[ℂ] H) x)) (ha hj)).symm + have hab (i : ι) : (a i).val * b = (a i).val := by + have h := congrArg star (hba i) + simpa only [star_mul, hself, (a i).property.isSelfAdjoint.star_eq] using h + have hid : b * b = b := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + apply tendsto_nhds_unique (hb ((b : H →L[ℂ] H) x) y) + exact (hb x y).congr (fun i => + (congrArg (fun z : M.toStarSubalgebra => inner ℂ y ((z : H →L[ℂ] H) x)) (hab i)).symm) + refine ⟨⟨b,⟨hid,hself⟩⟩,⟨?_,?_⟩,hb⟩ + · rintro _ ⟨i,rfl⟩ + exact hba i + · intro p hp + change p.val*b=b + apply wot_limit_unique (fun i => p.val*(a i).val) _ _ + (wot_limit_mul_left _ _ _ hb) + have hpa (i : ι) : p.val*(a i).val=(a i).val := hp ⟨i,rfl⟩ + simpa only [hpa] using hb + +/-- The vector functional preserves any directed projection supremum. -/ +theorem vectorValue_isLUB_monotone + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → AlgebraProjection M) (ha : Monotone a) + (p : AlgebraProjection M) (hp : IsLUB (Set.range a) p) (ξ : H) : + IsLUB (Set.range (fun i => vectorValue ξ (a i))) (vectorValue ξ p) := by + obtain ⟨q,hq,ht⟩ := exists_isLUB_monotone_vector_limit a ha + have he : q=p := le_antisymm (hq.2 hp.1) (hp.2 hq.1) + subst q + refine ⟨?_,?_⟩ + · rintro _ ⟨i,rfl⟩ + exact vectorValue_mono ξ (hp.1 ⟨i,rfl⟩) + · intro r hr + exact le_of_tendsto ((Complex.continuous_re.tendsto _).comp (ht ξ ξ)) + (Eventually.of_forall (fun i => hr ⟨i,rfl⟩)) + +theorem vectorValue_tendsto_monotone + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → AlgebraProjection M) (ha : Monotone a) + (p : AlgebraProjection M) (hp : IsLUB (Set.range a) p) (ξ : H) : + Tendsto (fun i => vectorValue ξ (a i)) atTop (𝓝 (vectorValue ξ p)) := + tendsto_atTop_isLUB ((vectorValue_mono ξ).comp ha) + (vectorValue_isLUB_monotone a ha p hp ξ) + +end AlgebraProjection +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/NormalTrace.lean b/lean/OAI/Analysis/FactorGeneration/NormalTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..1490bb156a5183dfa7e3921ef106c69ecd52b9ac --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/NormalTrace.lean @@ -0,0 +1,480 @@ +import OAI.Analysis.FactorGeneration.FunctionalLimits +import OAI.Analysis.FactorGeneration.LocalizedStates + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! A genuine linear state with exact equality of real quadratic values, +constructed from the original finite factor predicates by scalar compactness. -/ +section +open Filter +open scoped Topology CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance quadraticStateCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance quadraticStateOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance quadraticStatePreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance quadraticStateLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance quadraticStateStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfactor hdiff hfinite in +theorem exists_real_quadratic_state (hunit : (1 : M.toStarSubalgebra) ≠ 0) : + ∃ φ : M.toStarSubalgebra →L[ℂ] ℂ, + ‖φ‖ ≤ 1 ∧ φ 1=1 ∧ (∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) ∧ + ∀ x : M.toStarSubalgebra, (φ (star x*x)).re=(φ (x*star x)).re := by + have hex (n : ℕ) := exists_approximately_tracial_state hfactor hdiff hfinite hunit + (1/((n : ℝ)+1)) (by positivity) + choose f hf hfone hfpos hfquad using hex + let ω := Ultrafilter.of (atTop : Filter ℕ) + obtain ⟨φ,hφ,ht⟩ := exists_bounded_functional_ultralimit ω f 1 (by norm_num) hf + have hε : Tendsto (fun n : ℕ => 1/((n : ℝ)+1)) (ω : Filter ℕ) (𝓝 0) := + tendsto_one_div_add_atTop_nhds_zero_nat.mono_left (Ultrafilter.of_le _) + have hre (x : M.toStarSubalgebra) := (Complex.continuous_re.tendsto (φ x)).comp (ht x) + have hle (x : M.toStarSubalgebra) : (φ (star x*x)).re ≤ (φ (x*star x)).re := by + have hr := (hε.const_add 1).mul (hre (x*star x)) + have h := le_of_tendsto_of_tendsto (hre (star x*x)) hr + (Eventually.of_forall (fun n => hfquad n x)) + simpa only [add_zero,one_mul] using h + refine ⟨φ,hφ,?_,?_,?_⟩ + · apply tendsto_nhds_unique (ht 1) + simpa only [hfone] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => (1 : ℂ)) (ω : Filter ℕ) (𝓝 1)) + · intro x hx + exact ge_of_tendsto (hre x) (Eventually.of_forall (fun n => hfpos n x hx)) + · intro x + exact le_antisymm (hle x) (by simpa only [star_star] using hle (star x)) + +end + +/-! Construction of a tracial state on the original concrete finite diffuse factor without a supplied trace. -/ +section +open scoped CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance tracialStateCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance tracialStateOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance tracialStatePreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance tracialStateLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance tracialStateStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfactor hdiff hfinite in +theorem exists_tracial_state (hunit : (1 : M.toStarSubalgebra) ≠ 0) : + ∃ φ : M.toStarSubalgebra →L[ℂ] ℂ, + ‖φ‖ ≤ 1 ∧ φ 1=1 ∧ (∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) ∧ + (∀ x : M.toStarSubalgebra, φ (star x)=star (φ x)) ∧ + ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x) := by + obtain ⟨φ,hφ,h1,hpos,hquad⟩ := exists_real_quadratic_state hfactor hdiff hfinite hunit + refine ⟨hermitianFunctional φ,(hermitianFunctional_norm_le φ).trans hφ, + hermitianFunctional_one φ h1,?_,hermitianFunctional_star φ, + hermitianFunctional_trace φ hquad⟩ + intro x hx + rw [hermitianFunctional_selfAdjoint φ x hx.isSelfAdjoint,Complex.ofReal_re] + exact hpos x hx + +end + +/-! Every positive normalized tracial functional agrees with the dimension on +all projections. Lower and upper dyadic bounds use actual partial isometries. -/ +section +open scoped BigOperators CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance stateDimensionCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance stateDimensionOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance stateDimensionPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance stateDimensionLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance stateDimensionStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem algebraProjection_nonneg (p : AlgebraProjection M) : 0 ≤ p.val := by + have h : star p.val*p.val=p.val := by + rw [p.property.isSelfAdjoint.star_eq,p.property.isIdempotentElem.eq] + rw [← h] + exact star_mul_self_nonneg _ + +theorem tracialFunctional_equivalent (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (htrace : ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x)) + {p q : AlgebraProjection M} (h : p.Equivalent q) : φ p.val=φ q.val := by + obtain ⟨v,hv,ht⟩ := h + rw [← hv,← ht,← v.initial] + exact htrace (star v.val) v.val + +theorem positiveFunctional_projection_mono (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (hpos : ∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) + {p q : AlgebraProjection M} (h : p ≤ q) : (φ p.val).re ≤ (φ q.val).re := by + have hr := hpos (AlgebraProjection.remainder p q h).val + (algebraProjection_nonneg _) + change 0 ≤ (φ (q.val-p.val)).re at hr + rw [map_sub,Complex.sub_re] at hr + linarith + +theorem tracialFunctional_subequivalent (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (hpos : ∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) + (htrace : ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x)) + {p q : AlgebraProjection M} (h : p.Subequivalent q) : (φ p.val).re ≤ (φ q.val).re := by + obtain ⟨v,hv,ht⟩ := h + have he := tracialFunctional_equivalent φ htrace + (show p.Equivalent v.target from ⟨v,hv,rfl⟩) + rw [he] + exact positiveFunctional_projection_mono φ hpos ht + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem tracialFunctional_dyadic_subset_re (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (h1 : φ 1=1) (htrace : ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x)) + (n : ℕ) (s : Finset (DyadicIndex n)) : + (φ ((traceFreeDyadicPartition hfactor hdiff ⟨1,IsStarProjection.one _⟩ n).subset s).val).re= + dyadicWeight n s := by + let E := traceFreeDyadicPartition hfactor hdiff ⟨1,IsStarProjection.one _⟩ n + have he (i : DyadicIndex n) : (φ (E.leg i).target.val).re=(φ E.base.val).re := by + exact congrArg Complex.re (tracialFunctional_equivalent φ htrace + (show (E.leg i).target.Equivalent E.base from + AlgebraProjection.equivalent_symm ⟨E.leg i,E.initial i,rfl⟩)) + have ht := congrArg (fun x : M.toStarSubalgebra => (φ x).re) E.total + simp only [map_sum,Complex.re_sum,he,Finset.sum_const,Finset.card_univ, + nsmul_eq_mul,card_dyadicIndex,Nat.cast_pow,Nat.cast_ofNat,h1,Complex.one_re] at ht + have hb : (φ E.base.val).re=1/(2 : ℝ)^n := by + apply (eq_div_iff (ne_of_gt (pow_pos (by norm_num : (0 : ℝ)<2) n))).mpr + nlinarith [ht] + change (φ (E.subset s).val).re=_ + rw [E.subset_val,map_sum,Complex.re_sum] + simp only [he,hb,Finset.sum_const,nsmul_eq_mul] + change (s.card : ℝ)*(1/2^n)=(s.card : ℝ)/2^n + ring + +include hfinite in +theorem tracialFunctional_projection_dimension_re (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (φ : M.toStarSubalgebra →L[ℂ] ℂ) (h1 : φ 1=1) + (hpos : ∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) + (htrace : ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x)) + (p : AlgebraProjection M) : (φ p.val).re=traceFreeDimension hfactor hdiff p := by + apply eq_of_all_dyadic_errors + intro n + obtain ⟨s,t,_,_,hs,ht,hl,hu,hgap⟩ := traceFreeDyadicSup_rounding hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ p hunit (one_mul _) n + have hφl := tracialFunctional_subequivalent φ hpos htrace hs + have hφu := tracialFunctional_subequivalent φ hpos htrace ht + rw [tracialFunctional_dyadic_subset_re hfactor hdiff φ h1 htrace] at hφl hφu + change dyadicWeight n s ≤ traceFreeDimension hfactor hdiff p at hl + change traceFreeDimension hfactor hdiff p ≤ dyadicWeight n t at hu + have hn : 0 ≤ 1/(2 : ℝ)^n := by positivity + rw [show (2 : ℝ)/2^n=2*(1/2^n) by ring] + apply abs_le.mpr + constructor <;> linarith + +include hfinite in +theorem tracialFunctional_projection_dimension (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (φ : M.toStarSubalgebra →L[ℂ] ℂ) (h1 : φ 1=1) + (hpos : ∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) + (hstar : ∀ x : M.toStarSubalgebra, φ (star x)=star (φ x)) + (htrace : ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x)) + (p : AlgebraProjection M) : φ p.val=(traceFreeDimension hfactor hdiff p : ℂ) := by + apply Complex.ext + · exact tracialFunctional_projection_dimension_re hfactor hdiff hfinite hunit φ h1 hpos htrace p + · have h := congrArg Complex.im (hstar p.val) + rw [p.property.isSelfAdjoint.star_eq] at h + change (φ p.val).im= -(φ p.val).im at h + change (φ p.val).im=0 + linarith + +end + +/-! Identification of the actual tracial state with the spectral dimension +value, and unrestricted additivity for noncommuting self-adjoint operators. -/ +section +open scoped BigOperators CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance spectralAdditivityCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance spectralAdditivityOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance spectralAdditivityPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance spectralAdditivityLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance spectralAdditivityStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem functional_isDimensionSpectralValue (φ : M.toStarSubalgebra →L[ℂ] ℂ) + (hnorm : ‖φ‖ ≤ 1) + (hproj : ∀ p : AlgebraProjection M, φ p.val=(traceFreeDimension hfactor hdiff p : ℂ)) + (x : M.toStarSubalgebra) : IsDimensionSpectralValue hfactor hdiff x (φ x) := by + intro Q c _ + have he : φ (∑ i, c i • (Q.piece i).val)= + ∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ) := by + simp only [map_sum,map_smul,smul_eq_mul,hproj] + rw [← he,← map_sub] + simpa only [one_mul] using φ.le_of_opNorm_le hnorm (x-∑ i, c i • (Q.piece i).val) + +theorem functional_eq_dimensionSpectralValue (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (φ : M.toStarSubalgebra →L[ℂ] ℂ) (hnorm : ‖φ‖ ≤ 1) + (hproj : ∀ p : AlgebraProjection M, φ p.val=(traceFreeDimension hfactor hdiff p : ℂ)) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + φ x=dimensionSpectralValue hfactor hdiff hfinite hunit x hx := + (functional_isDimensionSpectralValue hfactor hdiff φ hnorm hproj x).unique hfactor hdiff hx + (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx).2 + +/-- The missing noncommuting additivity law, from the constructed linear state. -/ +theorem dimensionSpectralValue_add (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) : + dimensionSpectralValue hfactor hdiff hfinite hunit (x+y) (hx.add hy)= + dimensionSpectralValue hfactor hdiff hfinite hunit x hx+ + dimensionSpectralValue hfactor hdiff hfinite hunit y hy := by + obtain ⟨φ,hnorm,h1,hpos,hstar,htrace⟩ := exists_tracial_state hfactor hdiff hfinite hunit + have hproj := tracialFunctional_projection_dimension hfactor hdiff hfinite hunit φ h1 hpos hstar htrace + rw [← functional_eq_dimensionSpectralValue hfactor hdiff hfinite hunit φ hnorm hproj (x+y) (hx.add hy), + ← functional_eq_dimensionSpectralValue hfactor hdiff hfinite hunit φ hnorm hproj x hx, + ← functional_eq_dimensionSpectralValue hfactor hdiff hfinite hunit φ hnorm hproj y hy,map_add] + +include hfactor hdiff hfinite in +theorem tracialFunctional_faithful (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (φ : M.toStarSubalgebra →L[ℂ] ℂ) (hnorm : ‖φ‖ ≤ 1) (h1 : φ 1=1) + (hpos : ∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (φ x).re) + (hstar : ∀ x : M.toStarSubalgebra, φ (star x)=star (φ x)) + (htrace : ∀ x y : M.toStarSubalgebra, φ (x*y)=φ (y*x)) + (x : M.toStarSubalgebra) (hx : 0 ≤ x) : φ x=0 ↔ x=0 := by + rw [functional_eq_dimensionSpectralValue hfactor hdiff hfinite hunit φ hnorm + (tracialFunctional_projection_dimension hfactor hdiff hfinite hunit φ h1 hpos hstar htrace) + x hx.isSelfAdjoint] + exact dimensionSpectralValue_eq_zero_iff_of_nonneg hfactor hdiff hfinite hunit x hx + +end + +/-! The constructed faithful normalized trace on the original algebra. +Projection-net continuity is proved explicitly; no general normality or +representation theorem is hidden in the definition. -/ +section +open Filter +open scoped Topology CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance tracePreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance traceLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance traceStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +def traceFreeTrace : M.toStarSubalgebra →L[ℂ] ℂ := + (exists_tracial_state hfactor hdiff hfinite hunit).choose + +theorem traceFreeTrace_spec : + ‖traceFreeTrace hfactor hdiff hfinite hunit‖ ≤ 1 ∧ + traceFreeTrace hfactor hdiff hfinite hunit 1=1 ∧ + (∀ x : M.toStarSubalgebra, 0 ≤ x → 0 ≤ (traceFreeTrace hfactor hdiff hfinite hunit x).re) ∧ + (∀ x : M.toStarSubalgebra, traceFreeTrace hfactor hdiff hfinite hunit (star x)= + star (traceFreeTrace hfactor hdiff hfinite hunit x)) ∧ + ∀ x y : M.toStarSubalgebra, traceFreeTrace hfactor hdiff hfinite hunit (x*y)= + traceFreeTrace hfactor hdiff hfinite hunit (y*x) := + (exists_tracial_state hfactor hdiff hfinite hunit).choose_spec + +theorem traceFreeTrace_projection (p : AlgebraProjection M) : + traceFreeTrace hfactor hdiff hfinite hunit p.val=(traceFreeDimension hfactor hdiff p : ℂ) := by + obtain ⟨_,h1,hpos,hstar,htrace⟩ := traceFreeTrace_spec hfactor hdiff hfinite hunit + exact tracialFunctional_projection_dimension hfactor hdiff hfinite hunit _ h1 hpos hstar htrace p + +theorem traceFreeTrace_selfAdjoint (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + traceFreeTrace hfactor hdiff hfinite hunit x= + dimensionSpectralValue hfactor hdiff hfinite hunit x hx := + functional_eq_dimensionSpectralValue hfactor hdiff hfinite hunit _ + (traceFreeTrace_spec hfactor hdiff hfinite hunit).1 + (traceFreeTrace_projection hfactor hdiff hfinite hunit) x hx + +theorem traceFreeTrace_faithful (x : M.toStarSubalgebra) (hx : 0 ≤ x) : + traceFreeTrace hfactor hdiff hfinite hunit x=0 ↔ x=0 := by + rw [traceFreeTrace_selfAdjoint hfactor hdiff hfinite hunit x hx.isSelfAdjoint] + exact dimensionSpectralValue_eq_zero_iff_of_nonneg hfactor hdiff hfinite hunit x hx + +theorem traceFreeTrace_projection_tendsto + {I : Type*} [Preorder I] [IsDirected I (· ≤ ·)] [Nonempty I] + (q : I → AlgebraProjection M) (hq : Monotone q) + (p : AlgebraProjection M) (hp : IsLUB (Set.range q) p) : + Tendsto (fun i => traceFreeTrace hfactor hdiff hfinite hunit (q i).val) atTop + (𝓝 (traceFreeTrace hfactor hdiff hfinite hunit p.val)) := by + simp only [traceFreeTrace_projection] + exact Complex.continuous_ofReal.continuousAt.tendsto.comp + (traceFreeDimension_tendsto_monotone hfactor hdiff hfinite hunit q hq p hp) + +end + +/-! The constructed trace is dominated by a finite sum of concrete vector +functionals. The matrix partition is constructed inside the localized corner. -/ +section +open scoped BigOperators CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance dominationCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance dominationOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance dominationPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance dominationLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance dominationStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +theorem traceFreeTrace_matrix_diagonal {ι : Type*} [Fintype ι] + (Q : EquivalentPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M) ι) + (x : M.toStarSubalgebra) : + (∑ i, traceFreeTrace hfactor hdiff hfinite hunit (Q.stateCoefficient x i i))= + traceFreeTrace hfactor hdiff hfinite hunit x := by + let τ := traceFreeTrace hfactor hdiff hfinite hunit + have ht := (traceFreeTrace_spec hfactor hdiff hfinite hunit).2.2.2.2 + have hi (i : ι) : τ (Q.stateCoefficient x i i)=τ ((Q.leg i).target.val*x) := by + change τ ((star (Q.leg i).val*x)*(Q.leg i).val)=_ + rw [ht] + congr 1 + change (∑ i, τ (Q.stateCoefficient x i i))=τ x + simp_rw [hi] + rw [← map_sum,← Finset.sum_mul,Q.total,one_mul] + +theorem traceFreeTrace_exists_finite_vector_domination : + ∃ (n : ℕ) (ξ : Fin n → H) (C : ℝ), 0 (Q.leg i).val.val ξ,a⁻¹,inv_pos.mpr ha,?_⟩ + intro x hx + let τ := traceFreeTrace hfactor hdiff hfinite hunit + have hi (i : Fin n) : a*(τ (Q.stateCoefficient x i i)).re ≤ + (vectorFunctional ξ (Q.stateCoefficient x i i)).re := by + have hpos : 0 ≤ Q.stateCoefficient x i i := star_left_conjugate_nonneg hx (Q.leg i).val + have hEx : E.val*Q.stateCoefficient x i i=Q.stateCoefficient x i i := by + calc E.val*Q.stateCoefficient x i i = + E.val*(Q.base.val*Q.stateCoefficient x i i) := by rw [Q.stateCoefficient_left] + _ = Q.stateCoefficient x i i := by rw [← mul_assoc,hQE,Q.stateCoefficient_left] + have h := (hloc (Q.stateCoefficient x i i) hpos hEx).1 + rwa [← traceFreeTrace_selfAdjoint hfactor hdiff hfinite hunit _ hpos.isSelfAdjoint] at h + have hsum := Finset.sum_le_sum (fun i (_ : i ∈ (Finset.univ : Finset (Fin n))) => hi i) + rw [← Finset.mul_sum,← Complex.re_sum, + traceFreeTrace_matrix_diagonal hfactor hdiff hfinite hunit] at hsum + have hv : (∑ i, (vectorFunctional ξ (Q.stateCoefficient x i i)).re)= + ∑ i, (inner ℂ ((Q.leg i).val.val ξ) (x.val ((Q.leg i).val.val ξ))).re := by + rw [← Complex.re_sum,← Q.matrixVectorFunctional_apply] + simp only [EquivalentPartition.matrixVectorFunctional,sum_apply,Complex.re_sum, + vectorFunctional_apply] + rw [hv] at hsum + have h := mul_le_mul_of_nonneg_left hsum (inv_nonneg.mpr ha.le) + simpa only [← mul_assoc,inv_mul_cancel₀ ha.ne',one_mul] using h + +/-- The scalar Cauchy--Schwarz bound follows from positivity of a centered square. -/ +theorem traceFreeTrace_norm_sq_le (x : M.toStarSubalgebra) : + ‖traceFreeTrace hfactor hdiff hfinite hunit x‖^2 ≤ + (traceFreeTrace hfactor hdiff hfinite hunit (star x*x)).re := by + let τ := traceFreeTrace hfactor hdiff hfinite hunit + obtain ⟨_,h1,hpos,hstar,_⟩ := traceFreeTrace_spec hfactor hdiff hfinite hunit + change τ 1=1 at h1 + change ∀ x : M.toStarSubalgebra, τ (star x)=star (τ x) at hstar + have h := hpos (star (x-(τ x) • 1)*(x-(τ x) • 1)) (star_mul_self_nonneg _) + change 0 ≤ (τ (star (x-(τ x) • 1)*(x-(τ x) • 1))).re at h + have he : τ (star (x-(τ x) • 1)*(x-(τ x) • 1))= + τ (star x*x)-star (τ x)*(τ x) := by + simp only [star_sub,star_smul,star_one,sub_mul,mul_sub,smul_mul_assoc, + mul_smul_comm,mul_one,one_mul,map_sub,map_smul,smul_eq_mul,h1,hstar] + ring + rw [he,Complex.sub_re] at h + change ‖τ x‖^2 ≤ (τ (star x*x)).re + have hn : (star (τ x)*(τ x)).re=‖τ x‖^2 := by + rw [RCLike.star_def,Complex.conj_mul',← Complex.ofReal_pow,Complex.ofReal_re] + rw [hn] at h + linarith + +end + +/-! Finite vector-functional representation and actual ultraweak continuity of +the constructed trace. No normality criterion is taken as an axiom. -/ +open scoped BigOperators CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceNormalCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceNormalOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceNormalPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance traceNormalLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance traceNormalStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +theorem traceFreeTrace_finite_vector_representation : + ∃ (n : ℕ) (ξ η : Fin n → H), ∀ x : M.toStarSubalgebra, + traceFreeTrace hfactor hdiff hfinite hunit x=∑ i, inner ℂ (η i) (x.val (ξ i)) := by + obtain ⟨n,ξ,C,hC,hbound⟩ := traceFreeTrace_exists_finite_vector_domination hfactor hdiff hfinite hunit + let V := PiLp 2 (fun _ : Fin n => H) + let F : M.toStarSubalgebra →ₗ[ℂ] V := + { toFun := fun x => WithLp.toLp 2 (fun i => x.val (ξ i)) + map_add' := by intros; ext i; rfl + map_smul' := by intros; ext i; rfl } + let τ := traceFreeTrace hfactor hdiff hfinite hunit + have hb (x : M.toStarSubalgebra) : ‖τ x‖ ≤ Real.sqrt C*‖F x‖ := by + have hs := (traceFreeTrace_norm_sq_le hfactor hdiff hfinite hunit x).trans + (hbound (star x*x) (star_mul_self_nonneg _)) + have hi (i : Fin n) : (inner ℂ (ξ i) ((star x*x).val (ξ i))).re=‖x.val (ξ i)‖^2 := by + change (vectorFunctional (ξ i) (star x*x)).re=_ + rw [vectorFunctional_star_mul_self,← Complex.ofReal_pow,Complex.ofReal_re] + simp only [hi] at hs + have hFn : ‖F x‖^2=∑ i, ‖x.val (ξ i)‖^2 := PiLp.norm_sq_eq_of_L2 _ (F x) + rw [← hFn] at hs + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg _))).mp + rw [mul_pow,Real.sq_sqrt hC.le] + exact hs + obtain ⟨η,hη⟩ := exists_inner_factor_of_bound F τ.toLinearMap (Real.sqrt C) hb + refine ⟨n,ξ,fun i => η i,?_⟩ + intro x + exact (hη x).trans (PiLp.inner_apply η (F x)) + +theorem traceFreeTrace_normal : + @Continuous _ _ (UltrapowerBridge.algebraUltraweakTopology M) inferInstance + (traceFreeTrace hfactor hdiff hfinite hunit) := by + obtain ⟨n,ξ,η,h⟩ := traceFreeTrace_finite_vector_representation hfactor hdiff hfinite hunit + have hc : @Continuous _ _ (UltrapowerBridge.ultraweakTopology H) inferInstance + (fun T : H →L[ℂ] H => ∑ i, inner ℂ (η i) (T (ξ i))) := by + let : TopologicalSpace (H →L[ℂ] H) := UltrapowerBridge.ultraweakTopology H + exact continuous_finsetSum _ (fun i _ => UltrapowerBridge.vectorFunctional_ultraweak_continuous (η i) (ξ i)) + have he : (traceFreeTrace hfactor hdiff hfinite hunit : M.toStarSubalgebra → ℂ)= + (fun x => ∑ i, inner ℂ (η i) (x.val (ξ i))) := funext h + rw [he] + exact @Continuous.comp _ _ _ (UltrapowerBridge.algebraUltraweakTopology M) + (UltrapowerBridge.ultraweakTopology H) _ _ _ hc continuous_induced_dom + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/OperatorLimits.lean b/lean/OAI/Analysis/FactorGeneration/OperatorLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..8c5123011bf67aace6802d897f91fba08eae8dc9 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/OperatorLimits.lean @@ -0,0 +1,200 @@ +import Mathlib.Analysis.InnerProductSpace.StarOrder +import Mathlib.Analysis.InnerProductSpace.WeakOperatorTopology +import Mathlib.Analysis.Normed.Module.Basic +import Mathlib.Analysis.Normed.Module.WeakDual +import Mathlib.Analysis.Normed.Ring.Lemmas +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Topology.Algebra.Algebra + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Operator-norm completeness of the manuscript's concrete algebra, derived +from its actual double-commutant property. No quotient completeness is assumed. -/ +namespace Tracial + +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem base_norm_closed (M : VonNeumannAlgebra H) : + IsClosed (M.toStarSubalgebra : Set (H →L[ℂ] H)) := by + change IsClosed (M : Set (H →L[ℂ] H)) + rw [← M.centralizer_centralizer] + exact Set.isClosed_centralizer _ + +instance baseCompleteSpace (M : VonNeumannAlgebra H) : CompleteSpace M.toStarSubalgebra := + (base_norm_closed M).completeSpace_coe + +instance baseNormedAlgebraRat (M : VonNeumannAlgebra H) : NormedAlgebra ℚ M.toStarSubalgebra := + .restrictScalars ℚ ℂ M.toStarSubalgebra + +end + +/-! Bounded operator families have weak operator ultralimits. This is proved +from Banach--Alaoglu and Riesz representation, not assumed as compactness. -/ +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem exists_weak_vector_ultralimit {ι : Type*} (ω : Ultrafilter ι) + (v : ι → H) (C : ℝ) (hv : ∀ i, ‖v i‖ ≤ C) : + ∃ z : H, ‖z‖ ≤ C ∧ ∀ y : H, + Tendsto (fun i => inner ℂ y (v i)) (ω : Filter ι) (𝓝 (inner ℂ y z)) := by + let f : ι → WeakDual ℂ H := fun i => + StrongDual.toWeakDual (InnerProductSpace.toDual ℂ H (v i)) + obtain ⟨d, hd, ht⟩ := (WeakDual.isCompact_closedBall (0 : StrongDual ℂ H) C).ultrafilter_le_nhds + (ω.map f) (by + apply le_principal_iff.mpr + change ∀ᶠ i in (ω : Filter ι), f i ∈ _ + exact Eventually.of_forall fun i => by + simpa [f, Metric.mem_closedBall, dist_zero_right] using hv i) + let z := (InnerProductSpace.toDual ℂ H).symm (WeakDual.toStrongDual d) + refine ⟨z, ?_, ?_⟩ + · have hd' : ‖WeakDual.toStrongDual d‖ ≤ C := by + simpa only [Set.mem_preimage, Metric.mem_closedBall, dist_zero_right] using hd + simpa only [z, LinearIsometryEquiv.norm_map] using hd' + · intro y + have he : Tendsto (fun i => inner ℂ (v i) y) (ω : Filter ι) + (𝓝 (inner ℂ z y)) := by + have h := (WeakBilin.eval_continuous _ y).continuousAt.tendsto.comp ht + change Tendsto (fun i => inner ℂ (v i) y) (ω : Filter ι) (𝓝 (d y)) at h + rw [show inner ℂ z y = d y from InnerProductSpace.toDual_symm_apply] + exact h + have hs := he.star + change Tendsto (fun i => (starRingEnd ℂ) (inner ℂ (v i) y)) (ω : Filter ι) + (𝓝 ((starRingEnd ℂ) (inner ℂ z y))) at hs + simpa only [inner_conj_symm] using hs + +theorem exists_weak_operator_ultralimit {ι : Type*} (ω : Ultrafilter ι) + (a : ι → H →L[ℂ] H) (C : ℝ) (hC : 0 ≤ C) (ha : ∀ i, ‖a i‖ ≤ C) : + ∃ T : H →L[ℂ] H, ‖T‖ ≤ C ∧ ∀ x y : H, + Tendsto (fun i => inner ℂ y (a i x)) (ω : Filter ι) (𝓝 (inner ℂ y (T x))) := by + have h (x : H) := exists_weak_vector_ultralimit ω (fun i => a i x) (C * ‖x‖) + (fun i => (a i).le_of_opNorm_le (ha i) x) + choose v hv ht using h + have hadd (x z : H) : v (x+z) = v x + v z := by + apply ext_inner_left ℂ + intro y + apply tendsto_nhds_unique (ht (x+z) y) + simpa only [map_add, inner_add_right] using (ht x y).add (ht z y) + have hsmul (c : ℂ) (x : H) : v (c • x) = c • v x := by + apply ext_inner_left ℂ + intro y + apply tendsto_nhds_unique (ht (c • x) y) + simpa only [map_smul, inner_smul_right] using (ht x y).const_mul c + let T : H →L[ℂ] H := LinearMap.mkContinuous + { toFun := v, map_add' := hadd, map_smul' := hsmul } C hv + exact ⟨T, T.opNorm_le_bound hC hv, ht⟩ + +/-- The double-commutant property retains the weak limit in the actual algebra. -/ +theorem weak_operator_limit_mem (M : VonNeumannAlgebra H) + {ι : Type*} {l : Filter ι} [l.NeBot] (a : ι → M.toStarSubalgebra) + (T : H →L[ℂ] H) + (ht : ∀ x y : H, Tendsto (fun i => inner ℂ y ((a i : H →L[ℂ] H) x)) l + (𝓝 (inner ℂ y (T x)))) : T ∈ M := by + change T ∈ (M : Set (H →L[ℂ] H)) + rw [← M.centralizer_centralizer] + intro S hS + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + have he (i : ι) : inner ℂ y ((a i : H →L[ℂ] H) (S x)) = + inner ℂ (star S y) ((a i : H →L[ℂ] H) x) := by + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_left] + exact congrArg (fun R : H →L[ℂ] H => inner ℂ y (R x)) (hS (a i) (a i).property) + have hh := (ht (S x) y).congr he + have heq := tendsto_nhds_unique hh (ht x (star S y)) + simpa only [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_left, mul_apply_eq_comp] using heq.symm + +/-! Operator-norm balls of an actual von Neumann algebra are compact for the +weak operator topology, using the previously constructed operator ultralimits. -/ + +def weakOperatorBall (M : VonNeumannAlgebra H) (C : ℝ) : Set (H →WOT[ℂ] H) := + {T | T.toCLM ∈ M ∧ ‖T.toCLM‖ ≤ C} + +theorem weakOperatorBall_isCompact (M : VonNeumannAlgebra H) (C : ℝ) : + IsCompact (weakOperatorBall M C) := by + classical + by_cases hC : 0 ≤ C + · apply isCompact_iff_ultrafilter_le_nhds'.mpr + intro ω hω + let a : (H →WOT[ℂ] H) → M.toStarSubalgebra := fun T => + if h : T ∈ weakOperatorBall M C then ⟨T.toCLM,h.1⟩ else 0 + have ha (T : H →WOT[ℂ] H) : ‖a T‖ ≤ C := by + dsimp [a] + split_ifs with h + · exact h.2 + · change ‖(0 : H →L[ℂ] H)‖ ≤ C + simpa only [norm_zero] using hC + obtain ⟨T,hT,ht⟩ := exists_weak_operator_ultralimit ω (fun U => (a U).val) C hC ha + have hm := weak_operator_limit_mem M a T ht + refine ⟨ContinuousLinearMapWOT.ofCLM T,⟨hm,hT⟩,?_⟩ + have hl : Tendsto (fun U => ContinuousLinearMapWOT.ofCLM (a U).val) + (ω : Filter (H →WOT[ℂ] H)) (𝓝 (ContinuousLinearMapWOT.ofCLM T)) := + ContinuousLinearMapWOT.tendsto_iff_forall_inner_apply_tendsto.mpr ht + have he : (fun U => ContinuousLinearMapWOT.ofCLM (a U).val) =ᶠ[ω] id := by + filter_upwards [show ∀ᶠ U in (ω : Filter (H →WOT[ℂ] H)),U ∈ weakOperatorBall M C from hω] + with U hU + simp only [a,dite_eq_left hU,ContinuousLinearMapWOT.ofCLM_toCLM,id_eq] + exact hl.congr' he + · have he : weakOperatorBall M C=∅ := by + apply Set.eq_empty_iff_forall_notMem.mpr + intro T hT + exact hC ((norm_nonneg _).trans hT.2) + rw [he] + exact isCompact_empty + +theorem weakOperatorBall_isClosed (M : VonNeumannAlgebra H) (C : ℝ) : + IsClosed (weakOperatorBall M C) := (weakOperatorBall_isCompact M C).isClosed + +end Tracial + +/-! Operator order bounds are closed in the weak operator topology. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem weakOperator_nonneg_isClosed : + IsClosed {T : H →WOT[ℂ] H | 0 ≤ T.toCLM} := by + have hi (x : H) : Continuous (fun T : H →WOT[ℂ] H => inner ℂ (T x) x) := by + simpa only [Function.comp_def, id_eq, inner_conj_symm] using + (Complex.continuous_conj.comp + (ContinuousLinearMapWOT.continuous_inner_apply continuous_id x x)) + have he : {T : H →WOT[ℂ] H | 0 ≤ T.toCLM} = + ⋂ x : H, {T : H →WOT[ℂ] H | + ((inner ℂ (T x) x).re : ℂ) = inner ℂ (T x) x ∧ 0 ≤ (inner ℂ (T x) x).re} := by + ext T + simp only [Set.mem_ofPred_eq, Set.mem_iInter, ContinuousLinearMap.nonneg_iff_isPositive, + ContinuousLinearMap.isPositive_iff_complex] + rfl + rw [he] + apply isClosed_iInter + intro x + exact (isClosed_eq (Complex.continuous_ofReal.comp (Complex.continuous_re.comp (hi x))) + (hi x)).inter (isClosed_le continuous_const (Complex.continuous_re.comp (hi x))) + +theorem weakOperator_lowerBound_isClosed (a : H →L[ℂ] H) : + IsClosed {T : H →WOT[ℂ] H | a ≤ T.toCLM} := by + have h := (weakOperator_nonneg_isClosed (H := H)).preimage + (continuous_id.sub (continuous_const (y := ContinuousLinearMapWOT.ofCLM a))) + convert h using 1 + ext T + change (a ≤ T.toCLM) ↔ 0 ≤ T.toCLM - a + exact sub_nonneg.symm + +theorem weakOperator_upperBound_isClosed (b : H →L[ℂ] H) : + IsClosed {T : H →WOT[ℂ] H | T.toCLM ≤ b} := by + have h := (weakOperator_nonneg_isClosed (H := H)).preimage + ((continuous_const (y := ContinuousLinearMapWOT.ofCLM b)).sub continuous_id) + convert h using 1 + ext T + change (T.toCLM ≤ b) ↔ 0 ≤ b - T.toCLM + exact sub_nonneg.symm + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/OrbitMinima.lean b/lean/OAI/Analysis/FactorGeneration/OrbitMinima.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e2b825cf307e62c96a921a37bb6163a29113a86 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/OrbitMinima.lean @@ -0,0 +1,173 @@ +import Mathlib.Analysis.CStarAlgebra.Unitary.Span +import OAI.Analysis.FactorGeneration.CornerTrace + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! The least-norm unitary-orbit point is scalar when the coordinate inclusion has scalar commutant. -/ +section +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def subalgebraUnitaries (P : StarSubalgebra ℂ M.toStarSubalgebra) : Subgroup (unitary M.toStarSubalgebra) where + carrier := {u | (u : M.toStarSubalgebra) ∈ P} + one_mem' := P.one_mem + mul_mem' hu hv := P.mul_mem hu hv + inv_mem' hu := by + change star _ ∈ P + exact star_mem hu + +def ambientUnitary (P : StarSubalgebra ℂ M.toStarSubalgebra) (u : unitary P) : + subalgebraUnitaries P := + ⟨Unitary.map { toFun := P.subtype, map_one' := map_one _, map_mul' := map_mul _, map_star' := map_star _ } u, u.val.property⟩ + +theorem commutes_of_fixed_unitaries (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] + (c : M.toStarSubalgebra) + (hc : ∀ u : subalgebraUnitaries P, conjugateLinear u.val c = c) : + ∀ a : P, (a : M.toStarSubalgebra)*c = c*(a : M.toStarSubalgebra) := by + let : CStarAlgebra P := {} + intro a + obtain ⟨u, s, ha, _⟩ := CStarAlgebra.exists_sum_four_unitary a + have hu (i : Fin 4) : ((u i).val : M.toStarSubalgebra)*c = c*((u i).val : M.toStarSubalgebra) := by + have h := congrArg (fun z : M.toStarSubalgebra => z * ((u i).val : M.toStarSubalgebra)) (hc (ambientUnitary P (u i))) + change (((u i).val : M.toStarSubalgebra)*c*star ((u i).val : M.toStarSubalgebra))*((u i).val : M.toStarSubalgebra) = _ at h + have he : star ((u i).val : M.toStarSubalgebra)*((u i).val : M.toStarSubalgebra) = 1 := + congrArg Subtype.val (u i).property.1 + simpa only [mul_assoc, he, mul_one] using h + change P.subtype a*c = c*P.subtype a + rw [ha, map_sum, Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + simp only [map_smul, smul_mul_assoc, mul_smul_comm] + exact congrArg (fun z : M.toStarSubalgebra => s i • z) (hu i) + +/-- Irreducibility is exactly the coordinate relative-commutant hypothesis. +Completeness of P is automatic for a von Neumann subalgebra, and is used only +to express its elements as sums of four unitaries. -/ +theorem scalar_mem_traceOrbitHull (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] + (hirr : ∀ c : M.toStarSubalgebra, (∀ a : P, (a : M.toStarSubalgebra)*c = c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c = z • (1 : M.toStarSubalgebra)) (b : M.toStarSubalgebra) : + baseVector τ (τ.trace b • (1 : M.toStarSubalgebra)) ∈ traceOrbitHull τ (subalgebraUnitaries P) b := by + obtain ⟨c, _, hc, _, hfixed⟩ := traceOrbitHull_minimum τ (subalgebraUnitaries P) b + obtain ⟨z, rfl⟩ := hirr c (commutes_of_fixed_unitaries P c hfixed) + have hz := traceOrbitHull_trace τ (subalgebraUnitaries P) b hc + have he : z = τ.trace b := by + change inner ℂ τ.vector (z • τ.vector) = _ at hz + rw [inner_smul_right, inner_self_eq_norm_sq_to_K, τ.norm_vector] at hz + simpa using hz + simpa only [he] using hc + +theorem trace_distance_le_unitary_displacement (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] + (hirr : ∀ c : M.toStarSubalgebra, (∀ a : P, (a : M.toStarSubalgebra)*c = c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c = z • (1 : M.toStarSubalgebra)) + (b : M.toStarSubalgebra) (δ : ℝ) + (hδ : ∀ u : subalgebraUnitaries P, τ.norm₂ (conjugateLinear u.val b-b) ≤ δ) : + τ.norm₂ (b-τ.trace b • (1 : M.toStarSubalgebra)) ≤ δ := by + have h := traceOrbitHull_distance τ (subalgebraUnitaries P) b δ hδ + (scalar_mem_traceOrbitHull τ P hirr b) + rw [norm_sub_rev] at h + exact h + +end + +/-! Irreducibility excludes disconnected nonzero ambient projections. +This gives the projection part of irreducibility in every nonzero corner. -/ +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P, (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + +theorem baseVector_inner_eq_trace (a b : M.toStarSubalgebra) : + inner ℂ (baseVector τ a) (baseVector τ b)=τ.trace (star a*b) := by + change _ = inner ℂ τ.vector (star (a : H →L[ℂ] H) ((b : H →L[ℂ] H) τ.vector)) + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + rfl + +/-- A continuous trace test vanishing on an orbit vanishes on its closed +convex hull. -/ +theorem orbitHull_trace_test_zero (G : Subgroup (unitary M.toStarSubalgebra)) + (b d : M.toStarSubalgebra) + (hd : ∀ u : G, τ.trace (star d * conjugateLinear u.val b)=0) + {ξ : H} (hξ : ξ ∈ traceOrbitHull τ G b) : + inner ℂ (baseVector τ d) ξ=0 := by + let K : Set H := {ξ | inner ℂ (baseVector τ d) ξ=0} + have hc : IsClosed K := isClosed_eq (continuous_const.inner continuous_id) continuous_const + have hv : Convex ℝ K := by + intro x hx y hy s t hs ht hst + change inner ℂ (baseVector τ d) (s • x+t • y)=0 + rw [inner_add_right,inner_smul_right_eq_smul,inner_smul_right_eq_smul] + change s • inner ℂ (baseVector τ d) x+t • inner ℂ (baseVector τ d) y=0 + rw [show inner ℂ (baseVector τ d) x=0 from hx, + show inner ℂ (baseVector τ d) y=0 from hy,smul_zero,smul_zero,add_zero] + apply (closure_minimal (convexHull_min ?_ hv) hc) hξ + rintro _ ⟨a,⟨u,rfl⟩,rfl⟩ + exact (baseVector_inner_eq_trace τ d (conjugateLinear u.val b)).trans (hd u) + +include τ hirr in +/-- Nonzero ambient projections cannot have all their P matrix coefficients +zero in an irreducible inclusion. No comparison theorem is assumed. -/ +theorem projection_eq_zero_or_eq_zero_of_no_links (r s : AlgebraProjection M) + (hlink : ∀ a : P, s.val*(a : M.toStarSubalgebra)*r.val=0) : + r.val=0 ∨ s.val=0 := by + have htest : ∀ u : subalgebraUnitaries P, + τ.trace (star s.val*conjugateLinear u.val r.val)=0 := by + intro u + change τ.trace (star s.val*((u.val : M.toStarSubalgebra)*r.val* + star (u.val : M.toStarSubalgebra)))=0 + rw [s.property.isSelfAdjoint.star_eq,← mul_assoc,← mul_assoc, + hlink ⟨u.val.val,u.property⟩,zero_mul] + exact inner_zero_right _ + have hz := orbitHull_trace_test_zero τ (subalgebraUnitaries P) r.val s.val htest + (scalar_mem_traceOrbitHull τ P hirr r.val) + rw [map_smul,inner_smul_right,baseVector_inner_eq_trace, + s.property.isSelfAdjoint.star_eq,mul_one] at hz + rcases mul_eq_zero.mp hz with hr | hs + · left + by_contra hn + have hp := projection_trace_pos τ r.val r.property hn + rw [hr,Complex.zero_re] at hp + exact (lt_irrefl 0 hp) + · right + by_contra hn + have hp := projection_trace_pos τ s.val s.property hn + rw [hs,Complex.zero_re] at hp + exact (lt_irrefl 0 hp) + +include τ hirr in +/-- Every projection commuting with pPp inside pMp is either zero or p. -/ +theorem corner_commutant_projection_trivial (p r : AlgebraProjection M) + (hrp : r ≤ p) + (hr : ∀ a : P, Commute r.val (p.val*(a : M.toStarSubalgebra)*p.val)) : + r.val=0 ∨ r.val=p.val := by + let s : AlgebraProjection M := ⟨p.val-r.val,r.property.sub_of_mul_eq_right p.property hrp⟩ + have hlink (a : P) : s.val*(a : M.toStarSubalgebra)*r.val=0 := by + have hl : p.val*r.val=r.val := hrp + have hright := projection_mul_of_le hrp + have he := congrArg (fun z : M.toStarSubalgebra => z*r.val) (hr a).eq + simp only [mul_assoc,hl,r.property.isIdempotentElem.eq] at he + have he' : r.val*((p.val*(a : M.toStarSubalgebra))*r.val)= + (p.val*(a : M.toStarSubalgebra))*r.val := by + simpa only [mul_assoc,hl,r.property.isIdempotentElem.eq] using he + have he'' : r.val*(a : M.toStarSubalgebra)*r.val= + p.val*(a : M.toStarSubalgebra)*r.val := by + simpa only [← mul_assoc,hright] using he' + change (p.val-r.val)*(a : M.toStarSubalgebra)*r.val=0 + rw [sub_mul,sub_mul,he'',sub_self] + rcases projection_eq_zero_or_eq_zero_of_no_links τ P hirr r s hlink with h | h + · exact Or.inl h + · exact Or.inr (sub_eq_zero.mp h).symm + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PartialIsometries.lean b/lean/OAI/Analysis/FactorGeneration/PartialIsometries.lean new file mode 100644 index 0000000000000000000000000000000000000000..1da429d04947828f5a2d91693a1ddd2259852708 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PartialIsometries.lean @@ -0,0 +1,457 @@ +import Mathlib.Topology.Order.IsLUB +import Mathlib.Topology.Order.MonotoneConvergence +import OAI.Analysis.FactorGeneration.HilbertLimits + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Actual partial isometries, allowing distinct initial and final projections, +with the extension order and its exact trace distance. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +structure PartialIsometry (M : VonNeumannAlgebra H) where + support : AlgebraProjection M + val : M.toStarSubalgebra + initial : star val*val=support.val + +namespace PartialIsometry + +theorem mul_support (v : PartialIsometry M) : v.val*v.support.val=v.val := by + have htr : star v.val*(v.val*v.support.val)=v.support.val := by + rw [← mul_assoc,v.initial,v.support.property.isIdempotentElem.eq] + have he : star (v.val-v.val*v.support.val)*(v.val-v.val*v.support.val)=0 := by + simp only [star_sub,star_mul,v.support.property.isSelfAdjoint.star_eq,sub_mul,mul_sub, + mul_assoc,v.initial,htr,v.support.property.isIdempotentElem.eq,sub_self] + exact (sub_eq_zero.mp ((CStarRing.star_mul_self_eq_zero_iff _).mp he)).symm + +def target (v : PartialIsometry M) : AlgebraProjection M := + ⟨v.val*star v.val,⟨by + change (v.val*star v.val)*(v.val*star v.val)=v.val*star v.val + calc _ = (v.val*(star v.val*v.val))*star v.val := by simp only [mul_assoc] + _ = v.val*star v.val := by rw [v.initial,v.mul_support], + IsSelfAdjoint.mul_star_self _⟩⟩ + +theorem target_mul (v : PartialIsometry M) : v.target.val*v.val=v.val := by + change (v.val*star v.val)*v.val=v.val + rw [mul_assoc,v.initial,v.mul_support] + +def adjoint (v : PartialIsometry M) : PartialIsometry M := + ⟨v.target,star v.val,by simp only [star_star]; rfl⟩ + +theorem norm_le_one (v : PartialIsometry M) : ‖v.val‖ ≤ 1 := by + have he : ‖v.val‖*‖v.val‖=‖v.support.val‖ := by + rw [← CStarRing.norm_star_mul_self,v.initial] + have hp := v.support.property.norm_le + nlinarith [norm_nonneg v.val] + +theorem trace_support_eq_target (τ : TracialRepresentation M) (v : PartialIsometry M) : + τ.trace v.support.val=τ.trace v.target.val := by + rw [← v.initial] + exact τ.trace_mul_comm _ _ + +def Extends (v w : PartialIsometry M) : Prop := w.val*v.support.val=v.val + +theorem support_le_of_extends {v w : PartialIsometry M} (h : Extends v w) : + v.support ≤ w.support := by + have hh := congrArg (fun z : M.toStarSubalgebra => star z*z) h + have hcomp : v.support.val*w.support.val*v.support.val=v.support.val := by + calc _ = v.support.val*(star w.val*w.val)*v.support.val := by rw [w.initial] + _ = star (w.val*v.support.val)*(w.val*v.support.val) := by + simp only [star_mul,v.support.property.isSelfAdjoint.star_eq,mul_assoc] + _ = v.support.val := hh.trans v.initial + have hdouble : v.support.val*w.support.val*w.support.val*v.support.val=v.support.val := by + calc _ = v.support.val*(w.support.val*w.support.val)*v.support.val := by + simp only [mul_assoc] + _ = v.support.val := by rw [w.support.property.isIdempotentElem.eq,hcomp] + have hz : star (v.support.val-w.support.val*v.support.val)* + (v.support.val-w.support.val*v.support.val)=0 := by + simp only [star_sub,star_mul,v.support.property.isSelfAdjoint.star_eq, + w.support.property.isSelfAdjoint.star_eq,sub_mul,mul_sub] + simp only [← mul_assoc,v.support.property.isIdempotentElem.eq,hcomp,hdouble, + sub_self] + exact (sub_eq_zero.mp ((CStarRing.star_mul_self_eq_zero_iff _).mp hz)).symm + +theorem cross_initial {v w : PartialIsometry M} (h : Extends v w) : + star w.val*v.val=v.support.val := by + calc star w.val*v.val = star w.val*(w.val*v.support.val) := by rw [h] + _ = v.support.val := by rw [← mul_assoc,w.initial]; exact support_le_of_extends h + +theorem cross_initial_rev {v w : PartialIsometry M} (h : Extends v w) : + star v.val*w.val=v.support.val := by + simpa only [star_mul,star_star,v.support.property.isSelfAdjoint.star_eq] + using congrArg star (cross_initial h) + +theorem extends_refl (v : PartialIsometry M) : Extends v v := v.mul_support + +theorem extends_trans {u v w : PartialIsometry M} (huv : Extends u v) (hvw : Extends v w) : + Extends u w := by + change w.val*u.support.val=u.val + calc w.val*u.support.val = w.val*(v.support.val*u.support.val) := by + rw [show v.support.val*u.support.val=u.support.val from support_le_of_extends huv] + _ = u.val := by rw [← mul_assoc,hvw,huv] + +@[ext] theorem ext {v w : PartialIsometry M} (h : v.val=w.val) : v=w := by + have hp : v.support=w.support := by + apply Subtype.ext + calc v.support.val = star v.val*v.val := v.initial.symm + _ = star w.val*w.val := by rw [h] + _ = w.support.val := w.initial + cases v + cases w + cases hp + cases h + rfl + +instance : PartialOrder (PartialIsometry M) where + le := Extends + le_refl := extends_refl + le_trans _ _ _ := extends_trans + le_antisymm v w hvw hwv := by + apply ext + have hs := le_antisymm (support_le_of_extends hvw) (support_le_of_extends hwv) + change w.val*v.support.val=v.val at hvw + rw [hs,w.mul_support] at hvw + exact hvw.symm + +theorem support_mono {v w : PartialIsometry M} (h : v ≤ w) : v.support ≤ w.support := + support_le_of_extends h + +theorem difference_square {v w : PartialIsometry M} (h : v ≤ w) : + star (w.val-v.val)*(w.val-v.val)=w.support.val-v.support.val := by + simp only [star_sub,sub_mul,mul_sub,w.initial,v.initial, + cross_initial h,cross_initial_rev h,sub_self,sub_zero] + +theorem distance_sq (τ : TracialRepresentation M) {v w : PartialIsometry M} (h : v ≤ w) : + τ.norm₂ (w.val-v.val)^2=(τ.trace w.support.val).re-(τ.trace v.support.val).re := by + have he := congrArg Complex.re (τ.trace_star_mul (w.val-v.val)) + rw [difference_square h,trace_sub,Complex.sub_re] at he + simpa only [← Complex.ofReal_pow,Complex.ofReal_re] using he.symm + +theorem support_trace_mono (τ : TracialRepresentation M) {v w : PartialIsometry M} (h : v ≤ w) : + (τ.trace v.support.val).re ≤ (τ.trace w.support.val).re := by + have he := distance_sq τ h + nlinarith [sq_nonneg (τ.norm₂ (w.val-v.val))] + +end PartialIsometry + +end + +/-! Actual L2 limits of partial isometries and upper bounds of increasing +sequences, using their exact support-trace distance. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace PartialIsometry + +theorem support_trace_le_one (v : PartialIsometry M) : (τ.trace v.support.val).re ≤ 1 := by + rw [projection_trace_sq τ _ v.support.property] + have h := (τ.norm₂_le_norm v.support.val).trans v.support.property.norm_le + nlinarith [show 0 ≤ τ.norm₂ v.support.val from norm_nonneg _] + +theorem monotone_cauchy (a : ℕ → PartialIsometry M) (ha : Monotone a) : + CauchySeq (fun n => ((a n).val : H →L[ℂ] H) τ.vector) := by + let t : ℕ → ℝ := fun n => (τ.trace (a n).support.val).re + have ht : Monotone t := fun i j hij => support_trace_mono τ (ha hij) + have hb : BddAbove (Set.range t) := ⟨1,by rintro _ ⟨n,rfl⟩; exact support_trace_le_one τ (a n)⟩ + have hc := tendsto_atTop_ciSup ht hb + apply Metric.cauchySeq_iff'.mpr + intro ε hε + obtain ⟨N,hN⟩ := eventually_atTop.mp (hc (Ioi_mem_nhds (show (⨆ n, t n)-ε^2 < ⨆ n,t n by nlinarith))) + refine ⟨N,fun n hn => ?_⟩ + have hupper : t n ≤ ⨆ n,t n := le_ciSup hb n + have hsmall : (⨆ n,t n)-ε^2 < t N := hN N le_rfl + have he := distance_sq τ (ha hn) + change τ.norm₂ ((a n).val-(a N).val)^2=t n-t N at he + rw [dist_eq_norm] + change τ.norm₂ ((a n).val-(a N).val)<ε + nlinarith [show 0 ≤ τ.norm₂ ((a n).val-(a N).val) from norm_nonneg _] + +/-- Closedness of actual partial isometries in the operator norm unit ball +for L2 convergence. -/ +theorem of_L2_limit (a : ℕ → PartialIsometry M) (b : M.toStarSubalgebra) + (hb : Tendsto (fun n => τ.norm₂ ((a n).val-b)) atTop (𝓝 0)) : + ∃ v : PartialIsometry M, v.val=b := by + let p : M.toStarSubalgebra := star b*b + have hp : Tendsto (fun n => τ.norm₂ ((a n).support.val-p)) atTop (𝓝 0) := by + have ht := norm₂_limit_mul τ (fun n => star (a n).val) (fun n => (a n).val) + (star b) b 1 (fun n => (a n).adjoint.norm_le_one) + (norm₂_limit_star τ _ _ hb) hb + simpa only [(a _).initial] using ht + have hproj : IsStarProjection p := by + constructor + · have ht := norm₂_limit_mul τ (fun n => (a n).support.val) (fun n => (a n).support.val) + p p 1 (fun n => (a n).support.property.norm_le) hp hp + have ht' : Tendsto (fun n => τ.norm₂ ((a n).support.val-p*p)) atTop (𝓝 0) := by + simpa only [(a _).support.property.isIdempotentElem.eq] using ht + exact norm₂_limit_unique τ _ ht' hp + · change star (star b*b)=star b*b + simp only [star_mul,star_star] + exact ⟨⟨⟨p,hproj⟩,b,rfl⟩,rfl⟩ + +/-- A bounded L2 limit retains every eventually fixed extension. -/ +theorem le_of_eventually_le_limit (a : ℕ → PartialIsometry M) (v w : PartialIsometry M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) + (hw : ∀ᶠ n in atTop, w ≤ a n) : w ≤ v := by + have ht := norm₂_limit_mul τ (fun n => (a n).val) (fun _ => w.support.val) + v.val w.support.val 1 (fun n => (a n).norm_le_one) hv + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) + have hc : Tendsto (fun n => τ.norm₂ ((a n).val*w.support.val-w.val)) atTop (𝓝 0) := by + apply tendsto_const_nhds.congr' + filter_upwards [hw] with n hn + rw [show (a n).val*w.support.val=w.val from hn,sub_self,τ.norm₂_zero] + exact norm₂_limit_unique τ _ ht hc + +theorem monotone_limit (a : ℕ → PartialIsometry M) (ha : Monotone a) : + ∃ v : PartialIsometry M, (∀ n, a n ≤ v) ∧ + Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0) := by + obtain ⟨ξ,hξ⟩ := cauchySeq_tendsto_of_complete (monotone_cauchy τ a ha) + obtain ⟨b,hb,hbξ⟩ := bounded_trace_limit τ (fun n => (a n).val) 1 (by norm_num) + (fun n => (a n).norm_le_one) ξ hξ + have ht : Tendsto (fun n => τ.norm₂ ((a n).val-b)) atTop (𝓝 0) := by + apply (tendsto_vector_iff_norm₂ τ atTop _ b).mp + simpa only [hbξ] using hξ + obtain ⟨v,hv⟩ := of_L2_limit τ a b ht + rw [← hv] at ht + refine ⟨v,fun n => ?_,ht⟩ + apply le_of_eventually_le_limit τ a v (a n) ht + exact (eventually_ge_atTop n).mono (fun m hm => ha hm) + +/-! Every nonempty chain of actual partial isometries has an upper bound which +is an L2 limit of a sequence from the chain. This is the analytic chain +construction underlying the projection-comparison Zorn argument. -/ + +theorem eq_of_le_of_trace_eq {v w : PartialIsometry M} (h : v ≤ w) + (ht : (τ.trace v.support.val).re=(τ.trace w.support.val).re) : v=w := by + have he := distance_sq τ h + rw [ht,sub_self] at he + have hz := (τ.norm₂_eq_zero_iff _).mp (sq_eq_zero_iff.mp he) + exact ext (sub_eq_zero.mp hz).symm + +theorem support_limit (a : ℕ → PartialIsometry M) (v : PartialIsometry M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) : + Tendsto (fun n => τ.norm₂ ((a n).support.val-v.support.val)) atTop (𝓝 0) := by + have ht := norm₂_limit_mul τ (fun n => star (a n).val) (fun n => (a n).val) + (star v.val) v.val 1 (fun n => (a n).adjoint.norm_le_one) + (norm₂_limit_star τ _ _ hv) hv + simpa only [(a _).initial,v.initial] using ht + +theorem support_trace_limit (a : ℕ → PartialIsometry M) (v : PartialIsometry M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) : + Tendsto (fun n => (τ.trace (a n).support.val).re) atTop (𝓝 (τ.trace v.support.val).re) := + (Complex.continuous_re.tendsto _).comp (norm₂_limit_trace τ _ _ (support_limit τ a v hv)) + +theorem limit_le_of_le (a : ℕ → PartialIsometry M) (v w : PartialIsometry M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) + (hw : ∀ n, a n ≤ w) : v ≤ w := by + have ht := norm₂_limit_mul τ (fun _ => w.val) (fun n => (a n).support.val) + w.val v.support.val 1 (fun _ => w.norm_le_one) + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) + (support_limit τ a v hv) + have he : (fun n => w.val*(a n).support.val)=(fun n => (a n).val) := funext hw + simp only [show ∀ n, w.val*(a n).support.val=(a n).val from hw] at ht + exact norm₂_limit_unique τ _ ht hv + +/-- A nonempty chain has a sequential L2 upper bound; no countability of the +chain and no cyclicity of the trace vector are assumed. -/ +theorem chain_limit (c : Set (PartialIsometry M)) (hc : IsChain (· ≤ ·) c) (hne : c.Nonempty) : + ∃ (a : ℕ → PartialIsometry M) (v : PartialIsometry M), + (∀ n, a n ∈ c) ∧ Monotone a ∧ (∀ w ∈ c, w ≤ v) ∧ + Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0) := by + classical + let t : PartialIsometry M → ℝ := fun v => (τ.trace v.support.val).re + have hb : BddAbove (t '' c) := ⟨1,by rintro _ ⟨w,hw,rfl⟩; exact support_trace_le_one τ w⟩ + obtain ⟨r,hrmono,hrlim,hrmem⟩ := exists_seq_tendsto_sSup (hne.image t) hb + choose a hac har using hrmem + have htotal : ∀ u ∈ c, ∀ v ∈ c, u ≤ v ∨ v ≤ u := by + intro u hu v hv + by_cases he : u=v + · exact Or.inl he.le + · exact hc hu hv he + have hmono : Monotone a := by + intro i j hij + rcases htotal (a i) (hac i) (a j) (hac j) with h | h + · exact h + · have he : t (a j)=t (a i) := le_antisymm (support_trace_mono τ h) + (by rw [har,har]; exact hrmono hij) + exact (eq_of_le_of_trace_eq τ h he).symm.le + obtain ⟨v,hav,hlim⟩ := monotone_limit τ a hmono + have htv : t v=sSup (t '' c) := by + apply tendsto_nhds_unique (support_trace_limit τ a v hlim) + change Tendsto (fun n => t (a n)) atTop (𝓝 (sSup (t '' c))) + simpa only [har] using hrlim + refine ⟨a,v,hac,hmono,?_,hlim⟩ + intro w hw + by_cases hex : ∃ n, w ≤ a n + · obtain ⟨n,hn⟩ := hex + exact hn.trans (hav n) + · have haw : ∀ n, a n ≤ w := by + intro n + exact (htotal (a n) (hac n) w hw).resolve_right (fun h => hex ⟨n,h⟩) + have hvw := limit_le_of_le τ a v w hlim haw + have htw : t w ≤ t v := by rw [htv]; exact le_csSup hb ⟨w,hw,rfl⟩ + have he : t v=t w := le_antisymm (support_trace_mono τ hvw) htw + exact (eq_of_le_of_trace_eq τ hvw he).symm.le + +end PartialIsometry + +end + +/-! Orthogonal patching with distinct source and target supports. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace PartialIsometry + +def zero : PartialIsometry M := ⟨⟨0,IsStarProjection.zero _⟩,0,by simp⟩ + +theorem support_le_iff_mul (v : PartialIsometry M) (p : AlgebraProjection M) : + v.support ≤ p ↔ v.val*p.val=v.val := by + constructor + · intro h + calc _ = (v.val*v.support.val)*p.val := by rw [v.mul_support] + _ = v.val := by rw [mul_assoc,projection_mul_of_le h,v.mul_support] + · intro h + have he : v.support.val*p.val=v.support.val := by + rw [← v.initial,mul_assoc,h] + change p.val*v.support.val=v.support.val + simpa only [star_mul,p.property.isSelfAdjoint.star_eq, + v.support.property.isSelfAdjoint.star_eq] using congrArg star he + +theorem target_le_iff_mul (v : PartialIsometry M) (q : AlgebraProjection M) : + v.target ≤ q ↔ q.val*v.val=v.val := by + constructor + · intro h + calc _ = q.val*(v.target.val*v.val) := by rw [v.target_mul] + _ = v.val := by rw [← mul_assoc,h,v.target_mul] + · intro h + change q.val*(v.val*star v.val)=v.val*star v.val + rw [← mul_assoc,h] + +theorem mul_eq_zero (v w : PartialIsometry M) (h : v.support.val*w.target.val=0) : + v.val*w.val=0 := by + calc _ = (v.val*v.support.val)*(w.target.val*w.val) := by + rw [v.mul_support,w.target_mul] + _ = v.val*(v.support.val*w.target.val)*w.val := by simp only [mul_assoc] + _ = 0 := by rw [h,mul_zero,zero_mul] + +theorem orthogonal_reverse (p q : AlgebraProjection M) (h : p.val*q.val=0) : + q.val*p.val=0 := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq, + q.property.isSelfAdjoint.star_eq,star_zero] using congrArg star h + +def patch (v w : PartialIsometry M) + (hp : v.support.val*w.support.val=0) (hq : v.target.val*w.target.val=0) : + PartialIsometry M where + support := ⟨v.support.val+w.support.val,v.support.property.add w.support.property hp⟩ + val := v.val+w.val + initial := by + have h₁ : star v.val*w.val=0 := v.adjoint.mul_eq_zero w hq + have h₂ : star w.val*v.val=0 := + w.adjoint.mul_eq_zero v (orthogonal_reverse _ _ hq) + simp only [star_add,add_mul,mul_add,v.initial,w.initial,h₁,h₂,add_zero,zero_add] + +theorem patch_target (v w : PartialIsometry M) + (hp : v.support.val*w.support.val=0) (hq : v.target.val*w.target.val=0) : + (patch v w hp hq).target.val=v.target.val+w.target.val := by + have hwt : w.adjoint.target=w.support := Subtype.ext (by + change star w.val*star (star w.val)=w.support.val + rw [star_star,w.initial]) + have hvt : v.adjoint.target=v.support := Subtype.ext (by + change star v.val*star (star v.val)=v.support.val + rw [star_star,v.initial]) + have h₁ : v.val*star w.val=0 := v.mul_eq_zero w.adjoint (by rw [hwt]; exact hp) + have h₂ : w.val*star v.val=0 := w.mul_eq_zero v.adjoint (by + rw [hvt]; exact orthogonal_reverse _ _ hp) + change (v.val+w.val)*star (v.val+w.val)=v.val*star v.val+w.val*star w.val + simp only [star_add,add_mul,mul_add,h₁,h₂,add_zero,zero_add] + +theorem le_patch (v w : PartialIsometry M) + (hp : v.support.val*w.support.val=0) (hq : v.target.val*w.target.val=0) : + v ≤ patch v w hp hq := by + have hw : w.val*v.support.val=0 := by + calc _ = (w.val*w.support.val)*v.support.val := by rw [w.mul_support] + _ = 0 := by rw [mul_assoc,orthogonal_reverse _ _ hp,mul_zero] + change (v.val+w.val)*v.support.val=v.val + rw [add_mul,v.mul_support,hw,add_zero] + +theorem patch_ne (v w : PartialIsometry M) + (hp : v.support.val*w.support.val=0) (hq : v.target.val*w.target.val=0) + (hw : w.support.val≠0) : patch v w hp hq ≠ v := by + intro he + have hh := congrArg (fun z : PartialIsometry M => z.support.val) he + change v.support.val+w.support.val=v.support.val at hh + exact hw (add_left_cancel (hh.trans (add_zero _).symm)) + +end PartialIsometry + +end + +/-! A maximal actual partial isometry between subprojections of prescribed +projections. Chain upper bounds are constructed L2 limits, not assumed. -/ +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace PartialIsometry + +theorem supports_of_L2_limit (a : ℕ → PartialIsometry M) (v : PartialIsometry M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) + (p q : AlgebraProjection M) + (hp : ∀ n, (a n).support ≤ p) (hq : ∀ n, (a n).target ≤ q) : + v.support ≤ p ∧ v.target ≤ q := by + constructor + · apply (v.support_le_iff_mul p).mpr + have ht := norm₂_limit_mul τ (fun n => (a n).val) (fun _ => p.val) + v.val p.val 1 (fun n => (a n).norm_le_one) hv + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) + have he : ∀ n, (a n).val*p.val=(a n).val := fun n => + ((a n).support_le_iff_mul p).mp (hp n) + simp only [he] at ht + exact norm₂_limit_unique τ _ ht hv + · apply (v.target_le_iff_mul q).mpr + have ht := norm₂_limit_mul τ (fun _ => q.val) (fun n => (a n).val) + q.val v.val 1 (fun _ => q.property.norm_le) + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) hv + have he : ∀ n, q.val*(a n).val=(a n).val := fun n => + ((a n).target_le_iff_mul q).mp (hq n) + simp only [he] at ht + exact norm₂_limit_unique τ _ ht hv + +include τ in +theorem exists_maximal_between (p q : AlgebraProjection M) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ + ∀ w : PartialIsometry M, w.support ≤ p → w.target ≤ q → v ≤ w → w ≤ v := by + let S : Set (PartialIsometry M) := {v | v.support ≤ p ∧ v.target ≤ q} + obtain ⟨v,hv⟩ := zorn_le₀ S (by + intro c hc hchain + by_cases hne : c.Nonempty + · obtain ⟨a,v,ha,_,hcv,hlim⟩ := chain_limit τ c hchain hne + exact ⟨v,supports_of_L2_limit τ a v hlim p q + (fun n => (hc (ha n)).1) (fun n => (hc (ha n)).2),hcv⟩ + · refine ⟨zero,⟨?_,?_⟩,?_⟩ + · change p.val*0=0 + exact mul_zero _ + · apply (zero.target_le_iff_mul q).mpr + exact mul_zero _ + · intro w hw + exact (hne ⟨w,hw⟩).elim) + exact ⟨v,hv.1.1,hv.1.2,fun w hp hq h => hv.2 ⟨hp,hq⟩ h⟩ + +end PartialIsometry + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PartialUnitaries.lean b/lean/OAI/Analysis/FactorGeneration/PartialUnitaries.lean new file mode 100644 index 0000000000000000000000000000000000000000..71f664468a574d832c373f990528ee8ab3b5f9bd --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PartialUnitaries.lean @@ -0,0 +1,475 @@ +import Mathlib.Analysis.InnerProductSpace.Orthonormal +import Mathlib.Topology.Order.IsLUB +import Mathlib.Topology.Order.MonotoneConvergence +import OAI.Analysis.FactorGeneration.HilbertLimits + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Popa's extension order on actual supported partial unitaries, and its +exact L2 distance identity. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +structure PartialUnitary (M : VonNeumannAlgebra H) where + support : AlgebraProjection M + unitary : CornerUnitary support + +namespace PartialUnitary +abbrev val (v : PartialUnitary M) := v.unitary.val + +def Extends (v w : PartialUnitary M) : Prop := w.val*v.support.val=v.val + +theorem support_le_of_extends {v w : PartialUnitary M} (h : Extends v w) : + v.support ≤ w.support := by + have hv : w.support.val*v.val=v.val := by + calc w.support.val*v.val = w.support.val*(w.val*v.support.val) := by rw [h] + _ = v.val := by rw [← mul_assoc,w.unitary.support_mul]; exact h + change w.support.val*v.support.val=v.support.val + calc w.support.val*v.support.val = w.support.val*(v.val*star v.val) := by rw [v.unitary.final] + _ = v.support.val := by rw [← mul_assoc,hv,v.unitary.final] + +theorem cross_initial {v w : PartialUnitary M} (h : Extends v w) : + star w.val*v.val=v.support.val := by + calc star w.val*v.val = star w.val*(w.val*v.support.val) := by rw [h] + _ = v.support.val := by rw [← mul_assoc,w.unitary.initial]; exact support_le_of_extends h + +theorem cross_initial_rev {v w : PartialUnitary M} (h : Extends v w) : + star v.val*w.val=v.support.val := by + simpa only [star_mul,star_star,v.support.property.isSelfAdjoint.star_eq] + using congrArg star (cross_initial h) + +theorem left_extends {v w : PartialUnitary M} (h : Extends v w) : + v.support.val*w.val=v.val := by + calc v.support.val*w.val = (v.val*star v.val)*w.val := by rw [v.unitary.final] + _ = v.val := by rw [mul_assoc,cross_initial_rev h,v.unitary.mul_support] + +theorem extends_refl (v : PartialUnitary M) : Extends v v := v.unitary.mul_support + +theorem extends_trans {u v w : PartialUnitary M} (huv : Extends u v) (hvw : Extends v w) : + Extends u w := by + change w.val*u.support.val=u.val + calc w.val*u.support.val = w.val*(v.support.val*u.support.val) := by + rw [show v.support.val*u.support.val=u.support.val from support_le_of_extends huv] + _ = u.val := by rw [← mul_assoc,hvw,huv] + +@[ext] theorem ext {v w : PartialUnitary M} (h : v.val=w.val) : v=w := by + have hp : v.support=w.support := by + apply Subtype.ext + calc v.support.val = star v.val*v.val := v.unitary.initial.symm + _ = star w.val*w.val := by rw [h] + _ = w.support.val := w.unitary.initial + cases v with | mk p v => + cases w with | mk q w => + dsimp at hp + subst q + congr 1 + cases v + cases w + congr 1 + +instance : PartialOrder (PartialUnitary M) where + le := Extends + le_refl := extends_refl + le_trans _ _ _ := extends_trans + le_antisymm v w hvw hwv := by + apply ext + have hs := le_antisymm (support_le_of_extends hvw) (support_le_of_extends hwv) + change w.val*v.support.val=v.val at hvw + rw [hs,w.unitary.mul_support] at hvw + exact hvw.symm + +theorem support_mono {v w : PartialUnitary M} (h : v ≤ w) : v.support ≤ w.support := + support_le_of_extends h + +theorem difference_square {v w : PartialUnitary M} (h : v ≤ w) : + star (w.val-v.val)*(w.val-v.val)=w.support.val-v.support.val := by + simp only [star_sub,sub_mul,mul_sub,w.unitary.initial,v.unitary.initial, + cross_initial h,cross_initial_rev h,sub_self,sub_zero] + +theorem distance_sq (τ : TracialRepresentation M) {v w : PartialUnitary M} (h : v ≤ w) : + τ.norm₂ (w.val-v.val)^2=(τ.trace w.support.val).re-(τ.trace v.support.val).re := by + have he := congrArg Complex.re (τ.trace_star_mul (w.val-v.val)) + rw [difference_square h,trace_sub,Complex.sub_re] at he + simpa only [← Complex.ofReal_pow,Complex.ofReal_re] using he.symm + +theorem support_trace_mono (τ : TracialRepresentation M) {v w : PartialUnitary M} (h : v ≤ w) : + (τ.trace v.support.val).re ≤ (τ.trace w.support.val).re := by + have he := distance_sq τ h + nlinarith [sq_nonneg (τ.norm₂ (w.val-v.val))] + +end PartialUnitary + +end + +/-! Actual L2 limits of partial unitaries and upper bounds of increasing +sequences, using their exact support-trace distance. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace PartialUnitary + +theorem support_trace_le_one (v : PartialUnitary M) : (τ.trace v.support.val).re ≤ 1 := by + rw [projection_trace_sq τ _ v.support.property] + have h := (τ.norm₂_le_norm v.support.val).trans v.support.property.norm_le + nlinarith [show 0 ≤ τ.norm₂ v.support.val from norm_nonneg _] + +theorem monotone_cauchy (a : ℕ → PartialUnitary M) (ha : Monotone a) : + CauchySeq (fun n => ((a n).val : H →L[ℂ] H) τ.vector) := by + let t : ℕ → ℝ := fun n => (τ.trace (a n).support.val).re + have ht : Monotone t := fun i j hij => support_trace_mono τ (ha hij) + have hb : BddAbove (Set.range t) := ⟨1,by rintro _ ⟨n,rfl⟩; exact support_trace_le_one τ (a n)⟩ + have hc := tendsto_atTop_ciSup ht hb + apply Metric.cauchySeq_iff'.mpr + intro ε hε + obtain ⟨N,hN⟩ := eventually_atTop.mp (hc (Ioi_mem_nhds (show (⨆ n, t n)-ε^2 < ⨆ n,t n by nlinarith))) + refine ⟨N,fun n hn => ?_⟩ + have hupper : t n ≤ ⨆ n,t n := le_ciSup hb n + have hsmall : (⨆ n,t n)-ε^2 < t N := hN N le_rfl + have he := distance_sq τ (ha hn) + change τ.norm₂ ((a n).val-(a N).val)^2=t n-t N at he + rw [dist_eq_norm] + change τ.norm₂ ((a n).val-(a N).val)<ε + nlinarith [show 0 ≤ τ.norm₂ ((a n).val-(a N).val) from norm_nonneg _] + +/-- Closedness of actual partial unitaries in the operator norm unit ball +for L2 convergence. -/ +theorem of_L2_limit (a : ℕ → PartialUnitary M) (b : M.toStarSubalgebra) + (hb : Tendsto (fun n => τ.norm₂ ((a n).val-b)) atTop (𝓝 0)) : + ∃ v : PartialUnitary M, v.val=b := by + let p : M.toStarSubalgebra := star b*b + have hp : Tendsto (fun n => τ.norm₂ ((a n).support.val-p)) atTop (𝓝 0) := by + have ht := norm₂_limit_mul τ (fun n => star (a n).val) (fun n => (a n).val) + (star b) b 1 (fun n => (a n).unitary.adjoint.norm_le_one) + (norm₂_limit_star τ _ _ hb) hb + simpa only [(a _).unitary.initial] using ht + have hfinal : b*star b=p := by + have ht := norm₂_limit_mul τ (fun n => (a n).val) (fun n => star (a n).val) + b (star b) 1 (fun n => (a n).unitary.norm_le_one) hb (norm₂_limit_star τ _ _ hb) + have ht' : Tendsto (fun n => τ.norm₂ ((a n).support.val-b*star b)) atTop (𝓝 0) := by + simpa only [(a _).unitary.final] using ht + exact norm₂_limit_unique τ _ ht' hp + have hproj : IsStarProjection p := by + constructor + · have ht := norm₂_limit_mul τ (fun n => (a n).support.val) (fun n => (a n).support.val) + p p 1 (fun n => (a n).support.property.norm_le) hp hp + have ht' : Tendsto (fun n => τ.norm₂ ((a n).support.val-p*p)) atTop (𝓝 0) := by + simpa only [(a _).support.property.isIdempotentElem.eq] using ht + exact norm₂_limit_unique τ _ ht' hp + · change star (star b*b)=star b*b + simp only [star_mul,star_star] + exact ⟨⟨⟨p,hproj⟩,⟨b,rfl,hfinal⟩⟩,rfl⟩ + +/-- A bounded L2 limit retains every eventually fixed extension. -/ +theorem le_of_eventually_le_limit (a : ℕ → PartialUnitary M) (v w : PartialUnitary M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) + (hw : ∀ᶠ n in atTop, w ≤ a n) : w ≤ v := by + have ht := norm₂_limit_mul τ (fun n => (a n).val) (fun _ => w.support.val) + v.val w.support.val 1 (fun n => (a n).unitary.norm_le_one) hv + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) + have hc : Tendsto (fun n => τ.norm₂ ((a n).val*w.support.val-w.val)) atTop (𝓝 0) := by + apply tendsto_const_nhds.congr' + filter_upwards [hw] with n hn + rw [show (a n).val*w.support.val=w.val from hn,sub_self,τ.norm₂_zero] + exact norm₂_limit_unique τ _ ht hc + +theorem monotone_limit (a : ℕ → PartialUnitary M) (ha : Monotone a) : + ∃ v : PartialUnitary M, (∀ n, a n ≤ v) ∧ + Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0) := by + obtain ⟨ξ,hξ⟩ := cauchySeq_tendsto_of_complete (monotone_cauchy τ a ha) + obtain ⟨b,hb,hbξ⟩ := bounded_trace_limit τ (fun n => (a n).val) 1 (by norm_num) + (fun n => (a n).unitary.norm_le_one) ξ hξ + have ht : Tendsto (fun n => τ.norm₂ ((a n).val-b)) atTop (𝓝 0) := by + apply (tendsto_vector_iff_norm₂ τ atTop _ b).mp + simpa only [hbξ] using hξ + obtain ⟨v,hv⟩ := of_L2_limit τ a b ht + rw [← hv] at ht + refine ⟨v,fun n => ?_,ht⟩ + apply le_of_eventually_le_limit τ a v (a n) ht + exact (eventually_ge_atTop n).mono (fun m hm => ha hm) + +/-! Every nonempty chain of actual partial unitaries has an upper bound which +is an L2 limit of a sequence from the chain. This is the analytic chain +construction underlying the error-constrained Zorn argument. -/ + +theorem eq_of_le_of_trace_eq {v w : PartialUnitary M} (h : v ≤ w) + (ht : (τ.trace v.support.val).re=(τ.trace w.support.val).re) : v=w := by + have he := distance_sq τ h + rw [ht,sub_self] at he + have hz := (τ.norm₂_eq_zero_iff _).mp (sq_eq_zero_iff.mp he) + exact ext (sub_eq_zero.mp hz).symm + +theorem support_limit (a : ℕ → PartialUnitary M) (v : PartialUnitary M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) : + Tendsto (fun n => τ.norm₂ ((a n).support.val-v.support.val)) atTop (𝓝 0) := by + have ht := norm₂_limit_mul τ (fun n => star (a n).val) (fun n => (a n).val) + (star v.val) v.val 1 (fun n => (a n).unitary.adjoint.norm_le_one) + (norm₂_limit_star τ _ _ hv) hv + simpa only [(a _).unitary.initial,v.unitary.initial] using ht + +theorem support_trace_limit (a : ℕ → PartialUnitary M) (v : PartialUnitary M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) : + Tendsto (fun n => (τ.trace (a n).support.val).re) atTop (𝓝 (τ.trace v.support.val).re) := + (Complex.continuous_re.tendsto _).comp (norm₂_limit_trace τ _ _ (support_limit τ a v hv)) + +theorem limit_le_of_le (a : ℕ → PartialUnitary M) (v w : PartialUnitary M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) + (hw : ∀ n, a n ≤ w) : v ≤ w := by + have ht := norm₂_limit_mul τ (fun _ => w.val) (fun n => (a n).support.val) + w.val v.support.val 1 (fun _ => w.unitary.norm_le_one) + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) + (support_limit τ a v hv) + have he : (fun n => w.val*(a n).support.val)=(fun n => (a n).val) := funext hw + simp only [show ∀ n, w.val*(a n).support.val=(a n).val from hw] at ht + exact norm₂_limit_unique τ _ ht hv + +/-- A nonempty chain has a sequential L2 upper bound; no countability of the +chain and no cyclicity of the trace vector are assumed. -/ +theorem chain_limit (c : Set (PartialUnitary M)) (hc : IsChain (· ≤ ·) c) (hne : c.Nonempty) : + ∃ (a : ℕ → PartialUnitary M) (v : PartialUnitary M), + (∀ n, a n ∈ c) ∧ Monotone a ∧ (∀ w ∈ c, w ≤ v) ∧ + Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0) := by + classical + let t : PartialUnitary M → ℝ := fun v => (τ.trace v.support.val).re + have hb : BddAbove (t '' c) := ⟨1,by rintro _ ⟨w,hw,rfl⟩; exact support_trace_le_one τ w⟩ + obtain ⟨r,hrmono,hrlim,hrmem⟩ := exists_seq_tendsto_sSup (hne.image t) hb + choose a hac har using hrmem + have htotal : ∀ u ∈ c, ∀ v ∈ c, u ≤ v ∨ v ≤ u := by + intro u hu v hv + by_cases he : u=v + · exact Or.inl he.le + · exact hc hu hv he + have hmono : Monotone a := by + intro i j hij + rcases htotal (a i) (hac i) (a j) (hac j) with h | h + · exact h + · have he : t (a j)=t (a i) := le_antisymm (support_trace_mono τ h) + (by rw [har,har]; exact hrmono hij) + exact (eq_of_le_of_trace_eq τ h he).symm.le + obtain ⟨v,hav,hlim⟩ := monotone_limit τ a hmono + have htv : t v=sSup (t '' c) := by + apply tendsto_nhds_unique (support_trace_limit τ a v hlim) + change Tendsto (fun n => t (a n)) atTop (𝓝 (sSup (t '' c))) + simpa only [har] using hrlim + refine ⟨a,v,hac,hmono,?_,hlim⟩ + intro w hw + by_cases hex : ∃ n, w ≤ a n + · obtain ⟨n,hn⟩ := hex + exact hn.trans (hav n) + · have haw : ∀ n, a n ≤ w := by + intro n + exact (htotal (a n) (hac n) w hw).resolve_right (fun h => hex ⟨n,h⟩) + have hvw := limit_le_of_le τ a v w hlim haw + have htw : t w ≤ t v := by rw [htv]; exact le_csSup hb ⟨w,hw,rfl⟩ + have he : t v=t w := le_antisymm (support_trace_mono τ hvw) htw + exact (eq_of_le_of_trace_eq τ hvw he).symm.le + +end PartialUnitary + +end + +/-! Actual orthogonal corner unitaries from dyadic trace cuts. These supply +weakly vanishing scalar matrix coefficients for the scalar-commutant case +of Popa's coordinate nonintertwining criterion. -/ +section +open Filter +open scoped Topology BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + +def dyadicSign (n : ℕ) (i : DyadicIndex (n+1)) : ℂ := if i.2 then -1 else 1 + +def dyadicRademacher (p : AlgebraProjection M) (n : ℕ) : M.toStarSubalgebra := + dyadicEval τ hdiff p (n+1) (dyadicSign n) + +theorem dyadicRademacher_star (p : AlgebraProjection M) (n : ℕ) : + star (dyadicRademacher τ hdiff p n)=dyadicRademacher τ hdiff p n := by + unfold dyadicRademacher dyadicEval + rw [projectionSum_star] + congr 1 + funext i + cases h : i.2 <;> simp [dyadicSign,h] + +theorem dyadicRademacher_sq (p : AlgebraProjection M) (n : ℕ) : + dyadicRademacher τ hdiff p n*dyadicRademacher τ hdiff p n=p.val := by + unfold dyadicRademacher dyadicEval + rw [projectionSum_mul _ (dyadicProjection_orthogonal τ hdiff p (n+1))] + have he : (fun i : DyadicIndex (n+1) => dyadicSign n i*dyadicSign n i) = fun _ => 1 := by + funext i + cases h : i.2 <;> simp [dyadicSign,h] + rw [he] + exact dyadicEval_one τ hdiff p (n+1) + +def dyadicCornerUnitary (p : AlgebraProjection M) (n : ℕ) : CornerUnitary p where + val := dyadicRademacher τ hdiff p n + initial := by rw [dyadicRademacher_star,dyadicRademacher_sq] + final := by rw [dyadicRademacher_star,dyadicRademacher_sq] + +/-- The next sign is centered even after multiplication by an arbitrary +member of the previous finite dyadic algebra. -/ +theorem dyadicRademacher_centered_over_previous (p : AlgebraProjection M) (n : ℕ) + (c : DyadicIndex n → ℂ) : + τ.trace (dyadicEval τ hdiff p n c*dyadicRademacher τ hdiff p n)=0 := by + rw [← dyadicEval_refine τ hdiff p n c] + unfold dyadicRademacher dyadicEval + rw [projectionSum_mul _ (dyadicProjection_orthogonal τ hdiff p (n+1))] + rw [dyadicEval_trace] + change (∑ i : DyadicIndex n × Bool, + (c i.1*dyadicSign n i)*((τ.trace p.val).re/(2:ℝ)^(n+1) : ℝ))=0 + rw [Fintype.sum_prod_type] + apply Finset.sum_eq_zero + intro i _ + rw [Fintype.sum_bool] + simp [dyadicSign] + +theorem dyadicRademacher_trace_mul_of_lt (p : AlgebraProjection M) {m n : ℕ} (hmn : m < n) : + τ.trace (dyadicRademacher τ hdiff p m*dyadicRademacher τ hdiff p n)=0 := by + obtain ⟨c,hc⟩ := dyadicEval_lift τ hdiff p (Nat.succ_le_iff.mpr hmn) (dyadicSign m) + change τ.trace (dyadicEval τ hdiff p (m+1) (dyadicSign m)*_)=0 + rw [hc] + exact dyadicRademacher_centered_over_previous τ hdiff p n c + +theorem dyadicRademacher_trace_mul_of_ne (p : AlgebraProjection M) {m n : ℕ} (hmn : m ≠ n) : + τ.trace (dyadicRademacher τ hdiff p m*dyadicRademacher τ hdiff p n)=0 := by + rcases lt_or_gt_of_ne hmn with h | h + · exact dyadicRademacher_trace_mul_of_lt τ hdiff p h + · rw [τ.trace_mul_comm] + exact dyadicRademacher_trace_mul_of_lt τ hdiff p h + +theorem coordinate_inner_eq_trace (a b : M.toStarSubalgebra) : + inner ℂ ((a : H →L[ℂ] H) τ.vector) ((b : H →L[ℂ] H) τ.vector)=τ.trace (star a*b) := by + change _ = inner ℂ τ.vector (star (a : H →L[ℂ] H) ((b : H →L[ℂ] H) τ.vector)) + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + +theorem dyadicRademacher_norm₂ (p : AlgebraProjection M) (n : ℕ) : + τ.norm₂ (dyadicRademacher τ hdiff p n)=τ.norm₂ p.val := by + have he := (dyadicCornerUnitary τ hdiff p n).trace_norm_sq τ + rw [projection_trace_sq τ p.val p.property] at he + change τ.norm₂ (dyadicRademacher τ hdiff p n)^2=τ.norm₂ p.val^2 at he + have h₁ : 0 ≤ τ.norm₂ (dyadicRademacher τ hdiff p n) := norm_nonneg _ + have h₂ : 0 ≤ τ.norm₂ p.val := norm_nonneg _ + nlinarith + +end + +/-! Popa 1308.3982v3, §1.5, scalar-target specialization. The sequence is +constructed from actual dyadic trace cuts in each nonzero corner; neither +nonintertwining nor Haar existence is an assumption. -/ +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +omit [CompleteSpace H] in +/-- Bessel's inequality makes the coefficients of an orthonormal sequence vanish. -/ +theorem orthonormal_inner_tendsto_zero (v : ℕ → H) (hv : Orthonormal ℂ v) (x : H) : + Tendsto (fun n => inner ℂ x (v n)) atTop (𝓝 0) := by + have ht := (hv.inner_products_summable x).tendsto_atTop_zero + have hh : Tendsto (fun n => inner ℂ (v n) x) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + have he := ht (Iio_mem_nhds (sq_pos_of_pos hε)) + obtain ⟨N,hN⟩ := eventually_atTop.mp he + refine ⟨N,fun n hn => ?_⟩ + rw [dist_zero_right] + have h : ‖inner ℂ (v n) x‖^2 < ε^2 := hN n hn + nlinarith [norm_nonneg (inner ℂ (v n) x)] + have hs := hh.star + simp only [star_zero] at hs + change Tendsto (fun n => (starRingEnd ℂ) (inner ℂ (v n) x)) atTop (𝓝 0) at hs + simpa only [inner_conj_symm] using hs + +variable (τ : TracialRepresentation M) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + +theorem dyadicRademacher_weak_trace_zero (p : AlgebraProjection M) (hp : p.val ≠ 0) (x : H) : + Tendsto (fun n => inner ℂ x ((dyadicRademacher τ hdiff p n : H →L[ℂ] H) τ.vector)) + atTop (𝓝 0) := by + let s : ℝ := τ.norm₂ p.val + have hs : 0 < s := lt_of_le_of_ne (norm_nonneg _) (fun h => hp ((τ.norm₂_eq_zero_iff p.val).mp h.symm)) + have hsC : (s : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hs.ne' + let v : ℕ → H := fun n => (s : ℂ)⁻¹ • ((dyadicRademacher τ hdiff p n : H →L[ℂ] H) τ.vector) + have hv : Orthonormal ℂ v := by + constructor + · intro n + change ‖(s : ℂ)⁻¹ • ((dyadicRademacher τ hdiff p n : H →L[ℂ] H) τ.vector)‖=1 + rw [norm_smul,norm_inv,Complex.norm_real,Real.norm_of_nonneg hs.le] + change s⁻¹*τ.norm₂ (dyadicRademacher τ hdiff p n)=1 + rw [dyadicRademacher_norm₂] + exact inv_mul_cancel₀ hs.ne' + · intro m n hmn + dsimp [v] + rw [inner_smul_left,inner_smul_right,coordinate_inner_eq_trace, + dyadicRademacher_star,dyadicRademacher_trace_mul_of_ne τ hdiff p hmn,mul_zero,mul_zero] + have ht := (orthonormal_inner_tendsto_zero v hv x).const_mul (s : ℂ) + simp only [mul_zero] at ht + apply ht.congr + intro n + dsimp [v] + rw [inner_smul_right,← mul_assoc,mul_inv_cancel₀ hsC,one_mul] + +theorem dyadicRademacher_mixed_trace_zero (p : AlgebraProjection M) (hp : p.val ≠ 0) + (x y : M.toStarSubalgebra) : + Tendsto (fun n => τ.trace (x*dyadicRademacher τ hdiff p n*y)) atTop (𝓝 0) := by + have ht := dyadicRademacher_weak_trace_zero τ hdiff p hp + (((star (y*x) : M.toStarSubalgebra) : H →L[ℂ] H) τ.vector) + apply ht.congr + intro n + rw [coordinate_inner_eq_trace,star_star,τ.trace_mul_comm (x*dyadicRademacher τ hdiff p n) y,← mul_assoc] + +/-- The same sequence has vanishing ambient mixed traces, even when the +coefficients belong to M and the partial unitaries belong to P. -/ +theorem inclusion_corner_mixed_trace_zero {P : VonNeumannAlgebra H} (hPM : P ≤ M) + (hdiffP : ∀ p : P.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : P.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + (p : AlgebraProjection P) (hp : p.val ≠ 0) (x y : M.toStarSubalgebra) : + Tendsto (fun n => τ.trace (x*coordinateInclusion hPM + (dyadicCornerUnitary (restrictedTrace τ hPM) hdiffP p n).val*y)) atTop (𝓝 0) := by + have ht := dyadicRademacher_weak_trace_zero (restrictedTrace τ hPM) hdiffP p hp + (((star (y*x) : M.toStarSubalgebra) : H →L[ℂ] H) τ.vector) + apply ht.congr + intro n + change inner ℂ (((star (y*x) : M.toStarSubalgebra) : H →L[ℂ] H) τ.vector) + ((coordinateInclusion hPM (dyadicCornerUnitary (restrictedTrace τ hPM) hdiffP p n).val : H →L[ℂ] H) τ.vector)=_ + rw [coordinate_inner_eq_trace,star_star,τ.trace_mul_comm (x*_) y,← mul_assoc] + +/-- Actual simultaneous scalar nonintertwining choices in every nonzero +corner, with arbitrary finite sets of ambient left and right coefficients. -/ +theorem exists_cornerUnitary_small_mixed_traces {P : VonNeumannAlgebra H} (hPM : P ≤ M) + (hdiffP : ∀ p : P.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : P.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + (p : AlgebraProjection P) (hp : p.val ≠ 0) + (F G : Finset M.toStarSubalgebra) (ε : ℝ) (hε : 0 < ε) : + ∃ v : CornerUnitary p, ∀ x ∈ F, ∀ y ∈ G, + ‖τ.trace (x*coordinateInclusion hPM v.val*y)‖ < ε := by + have he : ∀ᶠ n : ℕ in atTop, ∀ x ∈ F, ∀ y ∈ G, + ‖τ.trace (x*coordinateInclusion hPM + (dyadicCornerUnitary (restrictedTrace τ hPM) hdiffP p n).val*y)‖ < ε := by + rw [eventually_all_finset] + intro x hx + rw [eventually_all_finset] + intro y hy + have ht := (inclusion_corner_mixed_trace_zero τ hPM hdiffP p hp x y).norm + simp only [norm_zero] at ht + exact ht (Iio_mem_nhds hε) + obtain ⟨n,hn⟩ := he.exists + exact ⟨dyadicCornerUnitary (restrictedTrace τ hPM) hdiffP p n,hn⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PatchingBounds.lean b/lean/OAI/Analysis/FactorGeneration/PatchingBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..086580f7624614957f87930052bdc0b90e3efc2d --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PatchingBounds.lean @@ -0,0 +1,400 @@ +import OAI.Analysis.FactorGeneration.PatchingWords + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Exact positive tolerance recurrence used in Popa Lemma 3.2. -/ +section + +def patchingTolerance (δ : ℝ) : ℕ → ℝ + | 0 => δ + | k+1 => (2 : ℝ)^(k+2)*patchingTolerance δ k + +@[simp] theorem patchingTolerance_zero (δ : ℝ) : patchingTolerance δ 0=δ := rfl +@[simp] theorem patchingTolerance_succ (δ : ℝ) (k : ℕ) : + patchingTolerance δ (k+1)=2^(k+2)*patchingTolerance δ k := rfl + +theorem patchingTolerance_pos (δ : ℝ) (hδ : 0 < δ) (k : ℕ) : + 0 < patchingTolerance δ k := by + induction k with + | zero => exact hδ + | succ k ih => exact mul_pos (pow_pos (by norm_num) _) ih + +theorem patchingTolerance_four_mul_le (δ : ℝ) (hδ : 0 < δ) (k : ℕ) : + 4*patchingTolerance δ k ≤ patchingTolerance δ (k+1) := by + have hp : (4 : ℝ) ≤ 2^(k+2) := by + have h := one_le_pow₀ (show (1 : ℝ) ≤ 2 by norm_num) (n := k) + rw [pow_add] + norm_num + nlinarith only [h] + exact mul_le_mul_of_nonneg_right hp (patchingTolerance_pos δ hδ k).le + +theorem patchingTolerance_mono (δ : ℝ) (hδ : 0 < δ) : Monotone (patchingTolerance δ) := by + apply monotone_nat_of_le_succ + intro k + have hp := patchingTolerance_pos δ hδ k + have hh := patchingTolerance_four_mul_le δ hδ k + linarith + +theorem middleMomentError_nonneg (ε : ℕ → ℝ) (hε : ∀ k,0 ≤ ε k) (r : ℕ) : + 0 ≤ middleMomentError ε r := by + unfold middleMomentError + split + · exact le_rfl + · exact hε r + +/-- Choose eta=delta/3. Both middle moments fit within 2 epsilon_(r+2)/3. -/ +theorem patchingTolerance_middle_budget (δ : ℝ) (hδ : 0 < δ) (r : ℕ) : + δ/3+(middleMomentError (patchingTolerance δ) r+patchingTolerance δ (r+2))/3 ≤ + 2*patchingTolerance δ (r+2)/3 := by + have hm : middleMomentError (patchingTolerance δ) r ≤ patchingTolerance δ r := by + unfold middleMomentError + split + · exact (patchingTolerance_pos δ hδ r).le + · exact le_rfl + have hd : δ ≤ patchingTolerance δ r := patchingTolerance_mono δ hδ (Nat.zero_le r) + have hstep := patchingTolerance_four_mul_le δ hδ r + have hstep2 := patchingTolerance_mono δ hδ (show r+1 ≤ r+2 by omega) + have hp := patchingTolerance_pos δ hδ r + linarith + +end + +/-! Explicit binary masks for the existing ordered expansion. A true bit is a +patch letter. Occurrences are retained even when their operator values coincide. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def binaryMasks : ℕ → List (List Bool) + | 0 => [[]] + | n+1 => (binaryMasks n).map (false :: ·) ++ (binaryMasks n).map (true :: ·) + +theorem mem_binaryMasks (n : ℕ) (bs : List Bool) : + bs ∈ binaryMasks n ↔ bs.length=n := by + induction n generalizing bs with + | zero => simp [binaryMasks] + | succ n ih => + cases bs with + | nil => simp [binaryMasks] + | cons b bs => cases b <;> simp [binaryMasks,ih] + +theorem binaryMasks_length (n : ℕ) : (binaryMasks n).length=2^n := by + induction n with + | zero => simp [binaryMasks] + | succ n ih => simp [binaryMasks,ih,pow_succ]; omega + +def maskedWord (v w : M.toStarSubalgebra) : + List (Bool × M.toStarSubalgebra) → List Bool → M.toStarSubalgebra + | [], _ => 1 + | (s,x)::xs, bs => + signedLetter (if bs.headD false then w else v) s*x*maskedWord v w xs bs.tail + +theorem patchingExpansion_eq_masks (v w : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + patchingExpansion v w xs = (binaryMasks xs.length).map + (fun bs => (bs.count true,maskedWord v w xs bs)) := by + induction xs with + | nil => simp [patchingExpansion,binaryMasks,maskedWord] + | cons a xs ih => + simp [patchingExpansion,binaryMasks,ih,List.map_map,Function.comp_def,maskedWord] + +theorem maskedWord_append (v w : M.toStarSubalgebra) + (xs ys : List (Bool × M.toStarSubalgebra)) (bs cs : List Bool) + (hlen : bs.length=xs.length) : + maskedWord v w (xs++ys) (bs++cs) = maskedWord v w xs bs*maskedWord v w ys cs := by + induction xs generalizing bs with + | nil => have hb : bs=[] := List.length_eq_zero_iff.mp hlen; simp [hb,maskedWord] + | cons a xs ih => + cases bs with + | nil => simp at hlen + | cons b bs => simp [maskedWord,ih bs (by simpa using hlen),mul_assoc] + +theorem maskedWord_no_patch (v w : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + maskedWord v w xs (List.replicate xs.length false)=patchingWord v xs := by + induction xs with + | nil => rfl + | cons a xs ih => simp [maskedWord,patchingWord,List.replicate_succ,ih] + +theorem maskedWord_norm_le_one (v w : M.toStarSubalgebra) (hv : ‖v‖ ≤ 1) (hw : ‖w‖ ≤ 1) + (xs : List (Bool × M.toStarSubalgebra)) (bs : List Bool) + (hx : ∀ a ∈ xs,‖a.2‖ ≤ 1) : ‖maskedWord v w xs bs‖ ≤ 1 := by + induction xs generalizing bs with + | nil => exact (IsStarProjection.one _).norm_le + | cons a xs ih => + have hp : ‖if bs.headD false then w else v‖ ≤ 1 := by split <;> assumption + have ha := hx a (by simp) + have ht := ih bs.tail (fun c hc => hx c (by simp [hc])) + have hs : ‖signedLetter (if bs.headD false then w else v) a.1*a.2‖ ≤ 1 := by + apply (norm_mul_le _ _).trans + rw [signedLetter_norm] + exact (mul_le_mul hp ha (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1) + exact (norm_mul_le _ _).trans + ((mul_le_mul hs ht (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1)) + +/-- Locate the first patch, with no earlier patch occurrences. -/ +theorem exists_first_true (bs : List Bool) (h : 1 ≤ bs.count true) : + ∃ i cs,bs=List.replicate i false++true::cs := by + induction bs with + | nil => simp at h + | cons b bs ih => + cases b with + | true => exact ⟨0,bs,rfl⟩ + | false => + obtain ⟨i,cs,he⟩ := ih (by simpa using h) + exact ⟨i+1,cs,by simp [List.replicate_succ,he]⟩ + +/-- Locate the first two patches; all bits before and between them are false. -/ +theorem exists_first_two_true (bs : List Bool) (h : 2 ≤ bs.count true) : + ∃ i r cs,bs=List.replicate i false++true::(List.replicate r false++true::cs) := by + obtain ⟨i,ds,he⟩ := exists_first_true bs (by omega) + have hd : 1 ≤ ds.count true := by + rw [he] at h + simpa [List.count_replicate] using h + obtain ⟨r,cs,hr⟩ := exists_first_true ds hd + exact ⟨i,r,cs,by rw [he,hr]⟩ + +/-- The second moment has full word length only for the two-endpoint mask. -/ +theorem first_two_full_length_iff (i r : ℕ) (cs : List Bool) : + r+2=(List.replicate i false++true::(List.replicate r false++true::cs)).length ↔ + i=0 ∧ cs=[] := by + simp only [List.length_append,List.length_replicate,List.length_cons] + rw [← List.length_eq_zero_iff] + omega + +theorem first_two_other_length (i r : ℕ) (cs : List Bool) (h : i ≠ 0 ∨ cs ≠ []) : + r+2+1 ≤ (List.replicate i false++true::(List.replicate r false++true::cs)).length := by + have hn : cs ≠ [] → 0 < cs.length := List.length_pos_iff.mpr + simp only [List.length_append,List.length_replicate,List.length_cons] + rcases h with h | h + · omega + · have := hn h; omega + +end + +/-! Mask uniqueness and a deliberately coarse budget that avoids off-by-one +counts: 2^k ordinary budgets plus one exceptional budget fit epsilon_k. -/ +section + +theorem binaryMasks_nodup (n : ℕ) : (binaryMasks n).Nodup := by + induction n with + | zero => simp [binaryMasks] + | succ n ih => + rw [binaryMasks,List.nodup_append] + refine ⟨ih.map (fun _ _ h => List.cons.inj h |>.2), + ih.map (fun _ _ h => List.cons.inj h |>.2),?_⟩ + intro a ha b hb + obtain ⟨x,hx,rfl⟩ := List.mem_map.mp ha + obtain ⟨y,hy,rfl⟩ := List.mem_map.mp hb + simp + +theorem count_true_zero_iff (bs : List Bool) : + bs.count true=0 ↔ bs=List.replicate bs.length false := by + induction bs with + | nil => simp + | cons b bs ih => cases b <;> simp [List.replicate_succ,ih] + +def exceptionalMask (k : ℕ) : List Bool := true::(List.replicate (k-2) false++[true]) + +theorem exceptionalMask_eq (r : ℕ) : + exceptionalMask (r+2)=true::(List.replicate r false++[true]) := by + simp [exceptionalMask] + +theorem first_two_eq_exceptional (i r : ℕ) (cs : List Bool) + (h : r+2=(List.replicate i false++true::(List.replicate r false++true::cs)).length) : + List.replicate i false++true::(List.replicate r false++true::cs) = + exceptionalMask (List.replicate i false++true::(List.replicate r false++true::cs)).length := by + obtain ⟨hi,hcs⟩ := (first_two_full_length_iff i r cs).mp h + subst i; subst cs + simp [exceptionalMask,Nat.add_comm] + omega + +theorem sum_indicator_le {α : Type*} [DecidableEq α] (xs : List α) (hn : xs.Nodup) + (a : α) (B : ℝ) (hB : 0 ≤ B) : + (xs.map (fun b => if b=a then B else 0)).sum ≤ B := by + have he : (xs.map (fun b => if b=a then B else 0)).sum = (xs.count a : ℝ)*B := by + clear hn + induction xs with + | nil => simp + | cons b xs ih => + by_cases h : b=a + · subst b; simp [ih,add_mul]; ring + · simp [h,ih] + rw [he] + have hh : xs.count a ≤ 1 := (List.nodup_iff_count_le_one.mp hn) a + have hh' : (xs.count a : ℝ) ≤ 1 := by exact_mod_cast hh + exact (mul_le_mul_of_nonneg_right hh' hB).trans_eq (one_mul B) + +theorem sum_three_budgets {α : Type*} [DecidableEq α] + (xs : List α) (hn : xs.Nodup) (f : α → ℝ) (a b : α) (C A B : ℝ) + (hA : 0 ≤ A) (hB : 0 ≤ B) + (hf : ∀ x ∈ xs,f x ≤ C+(if x=a then A else 0)+(if x=b then B else 0)) : + (xs.map f).sum ≤ (xs.length : ℝ)*C+A+B := by + have he : (xs.map (fun x => C+(if x=a then A else 0)+(if x=b then B else 0))).sum = + (xs.length : ℝ)*C+(xs.map (fun x => if x=a then A else 0)).sum+ + (xs.map (fun x => if x=b then B else 0)).sum := by + clear hn hf + induction xs with + | nil => simp + | cons x xs ih => simp only [List.map_cons,List.sum_cons,List.length_cons,Nat.cast_add,Nat.cast_one] + rw [ih]; ring + have hle : (xs.map f).sum ≤ + (xs.map (fun x => C+(if x=a then A else 0)+(if x=b then B else 0))).sum := by + clear he hn + induction xs with + | nil => simp + | cons x xs ih => + simp only [List.map_cons,List.sum_cons] + exact add_le_add (hf x (by simp)) + (ih (fun y hy => hf y (by simp [hy]))) + rw [he] at hle + have h₁ := sum_indicator_le xs hn a A hA + have h₂ := sum_indicator_le xs hn b B hB + linarith + +/-- The coarse ordinary+exceptional budget is exactly epsilon_k. The two +special masks are each counted only once; no binomial count is assumed. -/ +theorem patchingTolerance_mask_budget (δ : ℝ) (k : ℕ) (hk : 1 ≤ k) : + (2^k : ℝ)*(2*patchingTolerance δ (k-1)/3)+2*patchingTolerance δ k/3 = + patchingTolerance δ k := by + obtain ⟨j,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : k ≠ 0) + simp only [Nat.succ_eq_add_one,Nat.add_sub_cancel,patchingTolerance_succ] + rw [show j+2=(j+1)+1 by omega,pow_succ] + ring + +end + +/-! Extract actual coefficient segments and fixed one-patch outer factors. +These lemmas apply to the source lists without assuming segment membership. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem exists_list_split {α : Type*} (xs : List α) (i : ℕ) (hi : i < xs.length) : + ∃ pre a post,xs=pre++a::post ∧ pre.length=i := by + induction i generalizing xs with + | zero => + cases xs with + | nil => simp at hi + | cons a xs => exact ⟨[],a,xs,rfl,rfl⟩ + | succ i ih => + cases xs with + | nil => simp at hi + | cons a xs => + obtain ⟨pre,b,post,he,hp⟩ := ih xs (by simpa using hi) + exact ⟨a::pre,b,post,by simp [he],by simp [hp]⟩ + +theorem exists_list_split_two {α : Type*} (xs : List α) (i r : ℕ) + (hlen : i+r+2 ≤ xs.length) : + ∃ pre a mid b post,xs=pre++a::(mid++b::post) ∧ pre.length=i ∧ mid.length=r := by + obtain ⟨pre,a,rest,he,hp⟩ := exists_list_split xs i (by omega) + have hr : r < rest.length := by rw [he,List.length_append,List.length_cons,hp] at hlen; omega + obtain ⟨mid,b,post,hm,hl⟩ := exists_list_split rest r hr + exact ⟨pre,a,mid,b,post,by rw [he,hm],hp,hl⟩ + +theorem patchingCoefficients_before (F : Set M.toStarSubalgebra) + (pre : List (Bool × M.toStarSubalgebra)) (a : Bool × M.toStarSubalgebra) + (post : List (Bool × M.toStarSubalgebra)) + (h : patchingCoefficients F (pre++a::post)) : + (∀ c ∈ pre,c.2 ∈ F) ∧ patchingCoefficients F (a::post) := by + induction pre with + | nil => exact ⟨by simp,h⟩ + | cons b pre ih => + have hb : b.2 ∈ F ∧ patchingCoefficients F (pre++a::post) := by + cases pre <;> exact h + obtain ⟨hi,ht⟩ := ih hb.2 + exact ⟨fun c hc => by + rcases List.mem_cons.mp hc with rfl | hc + · exact hb.1 + · exact hi c hc,ht⟩ + +theorem patchingCoefficients_middle (F : Set M.toStarSubalgebra) + (pre mid post : List (Bool × M.toStarSubalgebra)) (a b : Bool × M.toStarSubalgebra) + (h : patchingCoefficients F (pre++a::(mid++b::post))) : + a.2 ∈ F ∧ (∀ c ∈ mid,c.2 ∈ F) := by + have ht := (patchingCoefficients_before F pre a (mid++b::post) h).2 + have hi := (patchingCoefficients_before F (a::mid) b post ht).1 + exact ⟨hi a (by simp),fun c hc => hi c (by simp [hc])⟩ + +theorem maskedWord_first_two (v w : M.toStarSubalgebra) + (pre mid post : List (Bool × M.toStarSubalgebra)) (a b : Bool × M.toStarSubalgebra) + (cs : List Bool) : + maskedWord v w (pre++a::(mid++b::post)) + (List.replicate pre.length false++true::(List.replicate mid.length false++true::cs)) = + patchingWord v pre*signedLetter w a.1*(a.2*patchingWord v mid)* + signedLetter w b.1*(b.2*maskedWord v w post cs) := by + rw [maskedWord_append v w pre _ _ _ (List.length_replicate ..),maskedWord_no_patch] + simp only [maskedWord,List.headD_cons,List.tail_cons,↓reduceIte] + rw [maskedWord_append v w mid _ _ _ (List.length_replicate ..),maskedWord_no_patch] + simp [maskedWord,mul_assoc] + +/-- Every mask with at least two true bits yields its actual internal middle +segment, with no assumptions about a separately supplied finite list. -/ +theorem maskedWord_two_decomposition (F : Set M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) (hc : patchingCoefficients F xs) + (bs : List Bool) (hlen : bs.length=xs.length) (hcount : 2 ≤ bs.count true) : + ∃ pre a mid b post cs, + xs=pre++a::(mid++b::post) ∧ + bs=List.replicate pre.length false++true::(List.replicate mid.length false++true::cs) ∧ + a.2 ∈ F ∧ (∀ c ∈ mid,c.2 ∈ F) ∧ cs.length=post.length ∧ + mid.length+2 ≤ xs.length := by + obtain ⟨i,r,cs,hbs⟩ := exists_first_two_true bs hcount + have hlen' : i+r+2+cs.length=xs.length := by + rw [hbs] at hlen + simp only [List.length_append,List.length_replicate,List.length_cons] at hlen + omega + obtain ⟨pre,a,mid,b,post,hxs,hp,hm⟩ := exists_list_split_two xs i r (by omega) + have hi := patchingCoefficients_middle F pre mid post a b (by rwa [← hxs]) + have ht : cs.length=post.length := by + rw [hxs,List.length_append,List.length_cons,List.length_append,List.length_cons,hp,hm] at hlen' + omega + exact ⟨pre,a,mid,b,post,cs,hxs,by simpa [hp,hm] using hbs,hi.1,hi.2,ht,by omega⟩ + +theorem maskedWord_one (v w : M.toStarSubalgebra) + (pre post : List (Bool × M.toStarSubalgebra)) (a : Bool × M.toStarSubalgebra) : + maskedWord v w (pre++a::post) + (List.replicate pre.length false++true::List.replicate post.length false) = + patchingWord v pre*signedLetter w a.1*(a.2*patchingWord v post) := by + rw [maskedWord_append v w pre _ _ _ (List.length_replicate ..),maskedWord_no_patch] + simp [maskedWord,maskedWord_no_patch,mul_assoc] + +end + +/-! The triangle inequality for the exact noncommutative mask expansion. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem trace_list_sum (xs : List M.toStarSubalgebra) : + τ.trace xs.sum=(xs.map τ.trace).sum := by + induction xs with + | nil => exact inner_zero_right _ + | cons x xs ih => simp only [List.sum_cons,List.map_cons,cornerTrace_add,ih] + +theorem norm_list_sum_le (xs : List ℂ) : ‖xs.sum‖ ≤ (xs.map norm).sum := by + induction xs with + | nil => simp + | cons x xs ih => simpa only [List.sum_cons,List.map_cons] using + (norm_add_le x xs.sum).trans (add_le_add le_rfl ih) + +theorem patching_trace_sum_le (v w x₀ : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + ‖τ.trace (x₀*patchingWord (v+w) xs)‖ ≤ + ((binaryMasks xs.length).map (fun bs => ‖τ.trace (x₀*maskedWord v w xs bs)‖)).sum := by + rw [← patchingExpansion_sum,patchingExpansion_eq_masks] + simp only [List.map_map,Function.comp_def] + rw [← sum_map_left_mul,trace_list_sum] + simpa only [List.map_map,Function.comp_def] using norm_list_sum_le + ((((binaryMasks xs.length).map (fun bs => maskedWord v w xs bs)).map (fun z => x₀*z)).map τ.trace) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PatchingWords.lean b/lean/OAI/Analysis/FactorGeneration/PatchingWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..dfd074b507706bbd4b50e70e7b6b04d85ad85f31 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PatchingWords.lean @@ -0,0 +1,577 @@ +import OAI.Analysis.FactorGeneration.PartialUnitaries + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Ordered signed mixed words in Popa 1308.3982v3, Lemma 3.2. +The L2 continuity estimate keeps the order of every coefficient. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def signedLetter (v : M.toStarSubalgebra) (s : Bool) : M.toStarSubalgebra := + if s then star v else v + +def patchingWord (v : M.toStarSubalgebra) : List (Bool × M.toStarSubalgebra) → M.toStarSubalgebra + | [] => 1 + | (s,x)::xs => signedLetter v s*x*patchingWord v xs + +theorem signedLetter_norm (v : M.toStarSubalgebra) (s : Bool) : + ‖signedLetter v s‖=‖v‖ := by + cases s + · rfl + · change ‖star (v : H →L[ℂ] H)‖=‖(v : H →L[ℂ] H)‖ + rw [ContinuousLinearMap.star_eq_adjoint] + exact ContinuousLinearMap.adjoint.norm_map _ + +theorem signedLetter_sub (v w : M.toStarSubalgebra) (s : Bool) : + signedLetter v s-signedLetter w s=signedLetter (v-w) s := by + cases s <;> simp [signedLetter,star_sub] + +theorem signedLetter_norm₂ (τ : TracialRepresentation M) (v : M.toStarSubalgebra) (s : Bool) : + τ.norm₂ (signedLetter v s)=τ.norm₂ v := by cases s <;> simp [signedLetter,τ.norm₂_star] + +theorem patchingWord_norm_le_one (v : M.toStarSubalgebra) (hv : ‖v‖ ≤ 1) + (xs : List (Bool × M.toStarSubalgebra)) (hx : ∀ a ∈ xs, ‖a.2‖ ≤ 1) : + ‖patchingWord v xs‖ ≤ 1 := by + induction xs with + | nil => exact (IsStarProjection.one (M.toStarSubalgebra)).norm_le + | cons a xs ih => + have ha := hx a (by simp) + have ht := ih (fun b hb => hx b (by simp [hb])) + have hs : ‖signedLetter v a.1*a.2‖ ≤ 1 := + (norm_mul_le _ _).trans ((mul_le_mul (by rw [signedLetter_norm]; exact hv) ha + (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1)) + exact (norm_mul_le _ _).trans ((mul_le_mul hs ht (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1)) + +theorem patchingWord_norm₂_sub_le (τ : TracialRepresentation M) + (v w : M.toStarSubalgebra) (hv : ‖v‖ ≤ 1) (hw : ‖w‖ ≤ 1) + (xs : List (Bool × M.toStarSubalgebra)) (hx : ∀ a ∈ xs, ‖a.2‖ ≤ 1) : + τ.norm₂ (patchingWord v xs-patchingWord w xs) ≤ xs.length*τ.norm₂ (v-w) := by + induction xs with + | nil => simp [patchingWord] + | cons a xs ih => + have ha := hx a (by simp) + have htail : ∀ b ∈ xs, ‖b.2‖ ≤ 1 := fun b hb => hx b (by simp [hb]) + have he : patchingWord v (a::xs)-patchingWord w (a::xs) = + ((signedLetter v a.1-signedLetter w a.1)*a.2)*patchingWord v xs+ + (signedLetter w a.1*a.2)*(patchingWord v xs-patchingWord w xs) := by + simp [patchingWord,sub_mul,mul_sub] + have hfirst : τ.norm₂ (((signedLetter v a.1-signedLetter w a.1)*a.2)*patchingWord v xs) ≤ + τ.norm₂ (v-w) := by + have h1 := τ.norm₂_mul_le_right ((signedLetter v a.1-signedLetter w a.1)*a.2) (patchingWord v xs) + have h2 := τ.norm₂_mul_le_right (signedLetter v a.1-signedLetter w a.1) a.2 + rw [signedLetter_sub,signedLetter_norm₂] at h2 + calc _ ≤ τ.norm₂ ((signedLetter v a.1-signedLetter w a.1)*a.2) := + h1.trans (mul_le_of_le_one_right (norm_nonneg _) (patchingWord_norm_le_one v hv xs htail)) + _ ≤ τ.norm₂ (v-w) := by + rw [signedLetter_sub] + exact h2.trans (mul_le_of_le_one_right (norm_nonneg _) ha) + have hs : ‖signedLetter w a.1*a.2‖ ≤ 1 := by + calc _ ≤ ‖signedLetter w a.1‖*‖a.2‖ := norm_mul_le _ _ + _ ≤ 1 := by rw [signedLetter_norm]; nlinarith [norm_nonneg w,norm_nonneg a.2] + have hsecond : τ.norm₂ ((signedLetter w a.1*a.2)*(patchingWord v xs-patchingWord w xs)) ≤ + xs.length*τ.norm₂ (v-w) := by + exact ((τ.norm₂_mul_le _ _).trans (mul_le_of_le_one_left (norm_nonneg _) hs)).trans (ih htail) + rw [he] + have hsum := τ.norm₂_add_le + (((signedLetter v a.1-signedLetter w a.1)*a.2)*patchingWord v xs) + ((signedLetter w a.1*a.2)*(patchingWord v xs-patchingWord w xs)) + simp only [List.length_cons,Nat.cast_add,Nat.cast_one] + nlinarith + +/-- Uniform trace continuity of every actual signed mixed word. -/ +theorem mixed_trace_sub_le (τ : TracialRepresentation M) + (v w x₀ : M.toStarSubalgebra) (hv : ‖v‖ ≤ 1) (hw : ‖w‖ ≤ 1) (h₀ : ‖x₀‖ ≤ 1) + (xs : List (Bool × M.toStarSubalgebra)) (hx : ∀ a ∈ xs, ‖a.2‖ ≤ 1) : + ‖τ.trace (x₀*patchingWord v xs)-τ.trace (x₀*patchingWord w xs)‖ ≤ + xs.length*τ.norm₂ (v-w) := by + rw [← trace_sub,← mul_sub] + exact ((τ.norm_trace_le_norm₂ _).trans ((τ.norm₂_mul_le _ _).trans + (mul_le_of_le_one_left (norm_nonneg _) h₀))).trans + (patchingWord_norm₂_sub_le τ v w hv hw xs hx) + +/-- Actual simultaneous control of signed one-patch terms, including arbitrary +ambient coefficients. This uses the constructed corner unitaries in P. -/ +theorem exists_cornerUnitary_small_signed_traces (τ : TracialRepresentation M) + {P : VonNeumannAlgebra H} (hPM : P ≤ M) + (hdiffP : ∀ p : P.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : P.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (p : AlgebraProjection P) (hp : p.val ≠ 0) (F G : Finset M.toStarSubalgebra) + (ε : ℝ) (hε : 0 < ε) : + ∃ v : CornerUnitary p, ∀ x ∈ F, ∀ y ∈ G, ∀ s : Bool, + ‖τ.trace (x*signedLetter (coordinateInclusion hPM v.val) s*y)‖ < ε := by + classical + obtain ⟨v,hv⟩ := exists_cornerUnitary_small_mixed_traces τ hPM hdiffP p hp + (F ∪ G.image star) (G ∪ F.image star) ε hε + refine ⟨v,fun x hx y hy s => ?_⟩ + cases s + · exact hv x (Finset.mem_union_left _ hx) y (Finset.mem_union_left _ hy) + · have hh := hv (star y) (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨y,hy,rfl⟩)) + (star x) (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨x,hx,rfl⟩)) + have he : τ.trace (star (x*star (coordinateInclusion hPM v.val)*y)) = + star (τ.trace (x*star (coordinateInclusion hPM v.val)*y)) := by + let z := x*star (coordinateInclusion hPM v.val)*y + change inner ℂ τ.vector (star (z : H →L[ℂ] H) τ.vector)= + star (inner ℂ τ.vector ((z : H →L[ℂ] H) τ.vector)) + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + exact (inner_conj_symm _ _).symm + simp only [star_mul,star_star,← mul_assoc] at he + rw [he,norm_star] at hh + exact hh + +end + +/-! The scalar-commutant specialization of the error-constrained chain and +Zorn step in Popa 1308.3982v3 Lemma 3.2. The internal coefficients are in F; +only the two endpoints may be 1. No local-quantization or growth assumption. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- The last coefficient is an endpoint; all earlier coefficients are internal. -/ +def patchingCoefficients (F : Set M.toStarSubalgebra) : List (Bool × M.toStarSubalgebra) → Prop + | [] => True + | [a] => a.2 ∈ F ∪ {1} + | a::b::xs => a.2 ∈ F ∧ patchingCoefficients F (b::xs) + +theorem patchingCoefficients_norm (F : Set M.toStarSubalgebra) + (hF : ∀ x ∈ F, ‖x‖ ≤ 1) (xs : List (Bool × M.toStarSubalgebra)) + (hx : patchingCoefficients F xs) : ∀ a ∈ xs, ‖a.2‖ ≤ 1 := by + induction xs with + | nil => simp + | cons a xs ih => + cases xs with + | nil => + have ha : ‖a.2‖ ≤ 1 := by + rcases hx with h | h + · exact hF _ h + · rw [Set.mem_singleton_iff.mp h]; exact (IsStarProjection.one (M.toStarSubalgebra)).norm_le + simpa using ha + | cons b xs => + intro c hc + rcases List.mem_cons.mp hc with rfl | hc + · exact hF _ hx.1 + · exact ih hx.2 c hc + +def PatchingAdmissible (f : AlgebraProjection M) (F : Set M.toStarSubalgebra) + (n : ℕ) (ε : ℕ → ℝ) (v : PartialUnitary M) : Prop := + v.support ≤ f ∧ ∀ x₀ ∈ F ∪ {1}, ∀ xs : List (Bool × M.toStarSubalgebra), + 1 ≤ xs.length → xs.length ≤ n → patchingCoefficients F xs → + ‖τ.trace (x₀*patchingWord v.val xs)‖ ≤ ε xs.length*(τ.trace v.support.val).re + +theorem mixed_trace_limit (a : ℕ → PartialUnitary M) (v : PartialUnitary M) + (hv : Tendsto (fun n => τ.norm₂ ((a n).val-v.val)) atTop (𝓝 0)) + (x₀ : M.toStarSubalgebra) (h₀ : ‖x₀‖ ≤ 1) + (xs : List (Bool × M.toStarSubalgebra)) (hx : ∀ a ∈ xs, ‖a.2‖ ≤ 1) : + Tendsto (fun n => τ.trace (x₀*patchingWord (a n).val xs)) atTop + (𝓝 (τ.trace (x₀*patchingWord v.val xs))) := by + apply tendsto_iff_norm_sub_tendsto_zero.mpr + apply squeeze_zero (fun _ => norm_nonneg _) + (fun n => mixed_trace_sub_le τ _ _ _ (a n).unitary.norm_le_one v.unitary.norm_le_one h₀ xs hx) + simpa using hv.const_mul (xs.length : ℝ) + +theorem patchingAdmissible_limit (f : AlgebraProjection M) (F : Set M.toStarSubalgebra) + (hF : ∀ x ∈ F, ‖x‖ ≤ 1) (n : ℕ) (ε : ℕ → ℝ) + (a : ℕ → PartialUnitary M) (v : PartialUnitary M) + (ha : ∀ i, PatchingAdmissible τ f F n ε (a i)) + (hv : Tendsto (fun i => τ.norm₂ ((a i).val-v.val)) atTop (𝓝 0)) : + PatchingAdmissible τ f F n ε v := by + have hp := PartialUnitary.support_limit τ a v hv + have hsupport : v.support ≤ f := by + have ht := norm₂_limit_mul τ (fun _ => f.val) (fun i => (a i).support.val) + f.val v.support.val 1 (fun _ => f.property.norm_le) + (by simp only [sub_self,TracialRepresentation.norm₂_zero]; exact tendsto_const_nhds) hp + have he : (fun i => f.val*(a i).support.val)=(fun i => (a i).support.val) := + funext (fun i => (ha i).1) + simp only [show ∀ i, f.val*(a i).support.val=(a i).support.val from fun i => (ha i).1] at ht + exact norm₂_limit_unique τ _ ht hp + refine ⟨hsupport,fun x₀ hx₀ xs hlen hn hx => ?_⟩ + have h₀ : ‖x₀‖ ≤ 1 := by + rcases hx₀ with h | h + · exact hF _ h + · rw [Set.mem_singleton_iff.mp h]; exact (IsStarProjection.one (M.toStarSubalgebra)).norm_le + have ht := (mixed_trace_limit τ a v hv x₀ h₀ xs (patchingCoefficients_norm F hF xs hx)).norm + have hr := (PartialUnitary.support_trace_limit τ a v hv).const_mul (ε xs.length) + exact le_of_tendsto_of_tendsto ht hr (Eventually.of_forall (fun i => (ha i).2 x₀ hx₀ xs hlen hn hx)) + +def zeroPartialUnitary : PartialUnitary M := + ⟨⟨0,IsStarProjection.zero _⟩,⟨0,by simp,by simp⟩⟩ + +theorem patchingAdmissible_zero (f : AlgebraProjection M) (F : Set M.toStarSubalgebra) + (n : ℕ) (ε : ℕ → ℝ) : PatchingAdmissible τ f F n ε zeroPartialUnitary := by + constructor + · change f.val*0=0; exact mul_zero _ + · intro x₀ hx₀ xs hlen hn hx + cases xs with + | nil => simp at hlen + | cons a xs => + have hs : signedLetter (0 : M.toStarSubalgebra) a.1=0 := by + cases a.1 <;> simp [signedLetter] + change ‖τ.trace (x₀*(signedLetter 0 a.1*a.2*patchingWord 0 xs))‖ ≤ + ε (xs.length+1)*(τ.trace 0).re + simp only [hs,zero_mul,mul_zero] + have ht : τ.trace 0=0 := inner_zero_right _ + rw [ht,norm_zero,Complex.zero_re,mul_zero] + +/-- A maximal element in the scalar mixed-word admissible set. -/ +theorem exists_maximal_patchingAdmissible (f : AlgebraProjection M) (F : Set M.toStarSubalgebra) + (hF : ∀ x ∈ F, ‖x‖ ≤ 1) (n : ℕ) (ε : ℕ → ℝ) : + ∃ v : PartialUnitary M, PatchingAdmissible τ f F n ε v ∧ + ∀ w : PartialUnitary M, PatchingAdmissible τ f F n ε w → v ≤ w → w ≤ v := by + obtain ⟨v,hv⟩ := zorn_le₀ {v | PatchingAdmissible τ f F n ε v} (by + intro c hc hchain + by_cases hne : c.Nonempty + · obtain ⟨a,v,hac,ham,hav,hlim⟩ := PartialUnitary.chain_limit τ c hchain hne + exact ⟨v,patchingAdmissible_limit τ f F hF n ε a v (fun i => hc (hac i)) hlim,hav⟩ + · exact ⟨zeroPartialUnitary,patchingAdmissible_zero τ f F n ε, + fun w hw => (hne ⟨w,hw⟩).elim⟩) + exact ⟨v,hv.1,fun w hw hvw => hv.2 hw hvw⟩ + +end + +/-! The error-constrained partial unitaries stay in the prescribed algebra P, +while all word coefficients and the trace live in M. This prevents replacing +the source inclusion P subset M by the trivial inclusion M subset M. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M P : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hPM : P ≤ M) + +include hPM +theorem inclusion_mem_of_bounded_L2_limit (a : ℕ → M.toStarSubalgebra) (b : M.toStarSubalgebra) + (C : ℝ) (hC : 0 ≤ C) (ha : ∀ n, ‖a n‖ ≤ C) + (hmem : ∀ n, (a n).val ∈ P) + (hb : Tendsto (fun n => τ.norm₂ (a n-b)) atTop (𝓝 0)) : b.val ∈ P := by + let aP : ℕ → P.toStarSubalgebra := fun n => ⟨(a n).val,hmem n⟩ + have ht := (tendsto_vector_iff_norm₂ τ atTop a b).mpr hb + obtain ⟨c,hc,he⟩ := bounded_trace_limit (restrictedTrace τ hPM) aP C hC ha + ((b : H →L[ℂ] H) τ.vector) ht + have hcb : coordinateInclusion hPM c=b := by + apply sub_eq_zero.mp + apply τ.separating + change (c : H →L[ℂ] H) τ.vector-(b : H →L[ℂ] H) τ.vector=0 + exact sub_eq_zero.mpr he + have hv := congrArg Subtype.val hcb + rw [← hv] + exact c.property + +def PatchingAdmissibleIn (f : AlgebraProjection M) (F : Set M.toStarSubalgebra) + (n : ℕ) (ε : ℕ → ℝ) (v : PartialUnitary M) : Prop := + PatchingAdmissible τ f F n ε v ∧ v.val.val ∈ P + +theorem patchingAdmissibleIn_limit (f : AlgebraProjection M) (F : Set M.toStarSubalgebra) + (hF : ∀ x ∈ F, ‖x‖ ≤ 1) (n : ℕ) (ε : ℕ → ℝ) + (a : ℕ → PartialUnitary M) (v : PartialUnitary M) + (ha : ∀ i, PatchingAdmissibleIn (P := P) τ f F n ε (a i)) + (hv : Tendsto (fun i => τ.norm₂ ((a i).val-v.val)) atTop (𝓝 0)) : + PatchingAdmissibleIn (P := P) τ f F n ε v := by + exact ⟨patchingAdmissible_limit τ f F hF n ε a v (fun i => (ha i).1) hv, + inclusion_mem_of_bounded_L2_limit τ hPM _ _ 1 (by norm_num) + (fun i => (a i).unitary.norm_le_one) (fun i => (ha i).2) hv⟩ + +/-- The actual maximal admissible partial unitary lies in P, with mixed-word +errors measured in the ambient tracial algebra M. No support-growth bound. -/ +theorem exists_maximal_patchingAdmissibleIn (f : AlgebraProjection M) + (F : Set M.toStarSubalgebra) (hF : ∀ x ∈ F, ‖x‖ ≤ 1) (n : ℕ) (ε : ℕ → ℝ) : + ∃ v : PartialUnitary M, PatchingAdmissibleIn (P := P) τ f F n ε v ∧ + ∀ w : PartialUnitary M, PatchingAdmissibleIn (P := P) τ f F n ε w → v ≤ w → w ≤ v := by + obtain ⟨v,hv⟩ := zorn_le₀ {v | PatchingAdmissibleIn (P := P) τ f F n ε v} (by + intro c hc hchain + by_cases hne : c.Nonempty + · obtain ⟨a,v,hac,ham,hav,hlim⟩ := PartialUnitary.chain_limit τ c hchain hne + exact ⟨v,patchingAdmissibleIn_limit τ hPM f F hF n ε a v (fun i => hc (hac i)) hlim,hav⟩ + · refine ⟨zeroPartialUnitary,⟨patchingAdmissible_zero τ f F n ε,?_⟩, + fun w hw => (hne ⟨w,hw⟩).elim⟩ + exact P.zero_mem) + exact ⟨v,hv.1,fun w hw hvw => hv.2 hw hvw⟩ + +end + +/-! Finite enumeration of the actual ordered word family. Only endpoints may +be 1. The middle segments retain all signs and their precise lengths. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- All lists of length at most n over a finite alphabet. -/ +def boundedLists {α : Type*} (A : Finset α) : ℕ → Finset (List α) + | 0 => {[]} + | n+1 => by + classical + exact insert [] ((A ×ˢ boundedLists A n).image (fun z => z.1 :: z.2)) + +theorem mem_boundedLists {α : Type*} (A : Finset α) (n : ℕ) (xs : List α) : + xs ∈ boundedLists A n ↔ xs.length ≤ n ∧ ∀ a ∈ xs, a ∈ A := by + classical + induction n generalizing xs with + | zero => cases xs <;> simp [boundedLists] + | succ n ih => + cases xs with + | nil => simp [boundedLists] + | cons a xs => simp [boundedLists, ih, List.length_cons, and_left_comm] + +/-- A finite alphabet of signs and coefficients. -/ +def signedAlphabet (F : Finset M.toStarSubalgebra) : Finset (Bool × M.toStarSubalgebra) := + Finset.univ ×ˢ F + +@[simp] theorem mem_signedAlphabet (F : Finset M.toStarSubalgebra) + (a : Bool × M.toStarSubalgebra) : a ∈ signedAlphabet F ↔ a.2 ∈ F := by + simp [signedAlphabet] + +/-- Every word admitted by the source definition, with its leading coefficient. -/ +def admissibleWordFamily (F : Finset M.toStarSubalgebra) (n : ℕ) : + Finset (M.toStarSubalgebra × List (Bool × M.toStarSubalgebra)) := by + classical + exact ((insert 1 F) ×ˢ boundedLists (signedAlphabet (insert 1 F)) n).filter + (fun z => 1 ≤ z.2.length ∧ patchingCoefficients (F : Set M.toStarSubalgebra) z.2) + +theorem patchingCoefficients_mem (F : Set M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) (hx : patchingCoefficients F xs) : + ∀ a ∈ xs, a.2 ∈ F ∪ {1} := by + induction xs with + | nil => simp + | cons a xs ih => + cases xs with + | nil => simpa [patchingCoefficients, or_comm] using hx + | cons b xs => + intro c hc + rcases List.mem_cons.mp hc with rfl | hc + · exact Or.inl hx.1 + · exact ih hx.2 c hc + +theorem mem_admissibleWordFamily (F : Finset M.toStarSubalgebra) (n : ℕ) + (x : M.toStarSubalgebra) (xs : List (Bool × M.toStarSubalgebra)) : + (x,xs) ∈ admissibleWordFamily F n ↔ + x ∈ (F : Set M.toStarSubalgebra) ∪ {1} ∧ 1 ≤ xs.length ∧ xs.length ≤ n ∧ + patchingCoefficients (F : Set M.toStarSubalgebra) xs := by + classical + simp only [admissibleWordFamily, Finset.mem_filter, Finset.mem_product, + Finset.mem_insert, mem_boundedLists, mem_signedAlphabet] + constructor + · rintro ⟨⟨hx,hlen,ha⟩,hpos,hc⟩ + exact ⟨hx.symm,hpos,hlen,hc⟩ + · rintro ⟨hx,hpos,hlen,hc⟩ + refine ⟨⟨hx.symm,hlen,?_⟩,hpos,hc⟩ + intro a ha + exact (patchingCoefficients_mem _ xs hc a ha).symm + +/-- The uncompressed middle coefficient between the first two patch letters. +Every coefficient here is internal to the original word. -/ +def middleWordFamily (F : Finset M.toStarSubalgebra) (n : ℕ) : + Finset (M.toStarSubalgebra × List (Bool × M.toStarSubalgebra)) := by + classical + exact (F ×ˢ boundedLists (signedAlphabet F) n).filter (fun z => z.2.length+2 ≤ n) + +theorem mem_middleWordFamily (F : Finset M.toStarSubalgebra) (n : ℕ) + (x : M.toStarSubalgebra) (xs : List (Bool × M.toStarSubalgebra)) : + (x,xs) ∈ middleWordFamily F n ↔ + x ∈ F ∧ xs.length+2 ≤ n ∧ ∀ a ∈ xs,a.2 ∈ F := by + classical + simp only [middleWordFamily,Finset.mem_filter,Finset.mem_product, + mem_boundedLists,mem_signedAlphabet] + constructor + · rintro ⟨⟨hx,hlen,ha⟩,hb⟩; exact ⟨hx,hb,ha⟩ + · rintro ⟨hx,hb,ha⟩; exact ⟨⟨hx,by omega,ha⟩,hb⟩ + +/-- Actual fixed outer coefficients needed for one-patch terms. -/ +def outerWordFamily (v : M.toStarSubalgebra) (F : Finset M.toStarSubalgebra) (n : ℕ) : + Finset M.toStarSubalgebra := by + classical + exact ((insert 1 F) ×ˢ boundedLists (signedAlphabet (insert 1 F)) n).image + (fun z => z.1*patchingWord v z.2) + +theorem mem_outerWordFamily (v : M.toStarSubalgebra) (F : Finset M.toStarSubalgebra) + (n : ℕ) (x : M.toStarSubalgebra) (xs : List (Bool × M.toStarSubalgebra)) + (hx : x ∈ (F : Set M.toStarSubalgebra) ∪ {1}) (hlen : xs.length ≤ n) + (ha : ∀ a ∈ xs,a.2 ∈ (F : Set M.toStarSubalgebra) ∪ {1}) : + x*patchingWord v xs ∈ outerWordFamily v F n := by + classical + apply Finset.mem_image.mpr + refine ⟨(x,xs),Finset.mem_product.mpr ⟨by simpa using hx.symm,?_⟩,rfl⟩ + exact (mem_boundedLists _ _ _).mpr ⟨hlen,fun a h => by + simpa using (ha a h).symm⟩ + +end + +/-! The two moment bounds in Popa Lemma 3.2 equation (6), derived from +admissibility for the actual signed internal segment, including length zero. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem patchingCoefficients_of_internal (F : Set M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) (hx : ∀ a ∈ xs,a.2 ∈ F) : + patchingCoefficients F xs := by + induction xs with + | nil => trivial + | cons a xs ih => + cases xs with + | nil => exact Or.inl (hx a (by simp)) + | cons b xs => + exact ⟨hx a (by simp),ih (fun c hc => hx c (by simp [hc]))⟩ + +theorem patchingCoefficients_append_endpoint (F : Set M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) (hx : ∀ a ∈ xs,a.2 ∈ F) + (a : Bool × M.toStarSubalgebra) (ha : a.2 ∈ F ∪ {1}) : + patchingCoefficients F (xs ++ [a]) := by + induction xs with + | nil => exact ha + | cons b xs ih => + have ht := ih (fun c hc => hx c (by simp [hc])) + cases xs with + | nil => exact ⟨hx b (by simp),ht⟩ + | cons c xs => exact ⟨hx b (by simp),ht⟩ + +theorem patchingWord_append (v : M.toStarSubalgebra) + (xs ys : List (Bool × M.toStarSubalgebra)) : + patchingWord v (xs++ys)=patchingWord v xs*patchingWord v ys := by + induction xs with + | nil => simp [patchingWord] + | cons a xs ih => simp [patchingWord,ih,mul_assoc] + +/-- A_i is zero for an empty middle segment, since its sole coefficient is centered. -/ +def middleMomentError (ε : ℕ → ℝ) (r : ℕ) : ℝ := if r=0 then 0 else ε r + +theorem admissible_middle_trace (v : PartialUnitary M) (f : AlgebraProjection M) + (F : Set M.toStarSubalgebra) (n : ℕ) (ε : ℕ → ℝ) + (hv : PatchingAdmissible τ f F n ε v) (hcenter : ∀ x ∈ F,τ.trace x=0) + (x : M.toStarSubalgebra) (xs : List (Bool × M.toStarSubalgebra)) + (hx : x ∈ F) (hxs : ∀ a ∈ xs,a.2 ∈ F) (hlen : xs.length ≤ n) : + ‖τ.trace (x*patchingWord v.val xs)‖ ≤ + middleMomentError ε xs.length*(τ.trace v.support.val).re := by + cases xs with + | nil => simp [patchingWord,middleMomentError,hcenter x hx] + | cons a xs => + exact hv.2 x (Or.inl hx) (a::xs) (by simp) hlen + (patchingCoefficients_of_internal F _ hxs) + +/-- Appending a positive v and prepending v* gives an admitted word of length r+2. +The two new endpoint coefficients are exactly 1. -/ +theorem admissible_middle_second_trace (v : PartialUnitary M) (f : AlgebraProjection M) + (F : Set M.toStarSubalgebra) (n : ℕ) (ε : ℕ → ℝ) + (hv : PatchingAdmissible τ f F n ε v) + (x : M.toStarSubalgebra) (xs : List (Bool × M.toStarSubalgebra)) + (hx : x ∈ F) (hxs : ∀ a ∈ xs,a.2 ∈ F) (hlen : xs.length+2 ≤ n) : + ‖τ.trace (star v.val*(x*patchingWord v.val xs)*v.val)‖ ≤ + ε (xs.length+2)*(τ.trace v.support.val).re := by + let ys : List (Bool × M.toStarSubalgebra) := (true,x)::(xs++[(false,1)]) + have hi : ∀ a ∈ (true,x)::xs,a.2 ∈ F := by + intro a ha + rcases List.mem_cons.mp ha with rfl | ha + · exact hx + · exact hxs a ha + have hc : patchingCoefficients F ys := + patchingCoefficients_append_endpoint F ((true,x)::xs) hi (false,1) (Or.inr rfl) + have hy : ys.length=xs.length+2 := by simp [ys] + have hh := hv.2 1 (Or.inr rfl) ys (by rw [hy]; omega) (by rw [hy]; exact hlen) hc + rw [hy] at hh + simpa only [ys,patchingWord,patchingWord_append,signedLetter, Bool.false_eq_true, + ↓reduceIte, mul_one,one_mul,mul_assoc] using hh + +theorem middleWordFamily_moments (v : PartialUnitary M) (f : AlgebraProjection M) + (F : Finset M.toStarSubalgebra) (n : ℕ) (ε : ℕ → ℝ) + (hv : PatchingAdmissible τ f (F : Set M.toStarSubalgebra) n ε v) + (hcenter : ∀ x ∈ F,τ.trace x=0) + (i : M.toStarSubalgebra × List (Bool × M.toStarSubalgebra)) + (hi : i ∈ middleWordFamily F n) : + ‖τ.trace (i.1*patchingWord v.val i.2)‖ ≤ + middleMomentError ε i.2.length*(τ.trace v.support.val).re ∧ + ‖τ.trace (star v.val*(i.1*patchingWord v.val i.2)*v.val)‖ ≤ + ε (i.2.length+2)*(τ.trace v.support.val).re := by + obtain ⟨hx,hlen,hxs⟩ := (mem_middleWordFamily F n i.1 i.2).mp hi + exact ⟨admissible_middle_trace τ v f F n ε hv hcenter i.1 i.2 hx hxs (by omega), + admissible_middle_second_trace τ v f F n ε hv i.1 i.2 hx hxs hlen⟩ + +end + +/-! Actual noncommutative binary expansion in Popa Lemma 3.2, equation (1). +Each list entry retains the number of patch letters used and its ordered +operator product. There is no commuting-coefficient hypothesis. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def patchingExpansion (v w : M.toStarSubalgebra) : + List (Bool × M.toStarSubalgebra) → List (ℕ × M.toStarSubalgebra) + | [] => [(0,1)] + | (s,x)::xs => + (patchingExpansion v w xs).map (fun z => (z.1,signedLetter v s*x*z.2)) ++ + (patchingExpansion v w xs).map (fun z => (z.1+1,signedLetter w s*x*z.2)) + +theorem sum_map_left_mul (a : M.toStarSubalgebra) (xs : List M.toStarSubalgebra) : + (xs.map (fun x => a*x)).sum=a*xs.sum := by + induction xs with + | nil => simp + | cons x xs ih => simp [ih,mul_add] + +theorem signedLetter_add (v w : M.toStarSubalgebra) (s : Bool) : + signedLetter (v+w) s=signedLetter v s+signedLetter w s := by + cases s <;> simp [signedLetter,star_add] + +theorem patchingExpansion_sum (v w : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + ((patchingExpansion v w xs).map Prod.snd).sum=patchingWord (v+w) xs := by + induction xs with + | nil => simp [patchingExpansion,patchingWord] + | cons a xs ih => + simp only [patchingExpansion,List.map_append,List.sum_append,List.map_map,Function.comp_def] + have hv : ((patchingExpansion v w xs).map (fun z => signedLetter v a.1*a.2*z.2)).sum = + (signedLetter v a.1*a.2)*((patchingExpansion v w xs).map Prod.snd).sum := by + simpa only [List.map_map,Function.comp_def] using + sum_map_left_mul (signedLetter v a.1*a.2) ((patchingExpansion v w xs).map Prod.snd) + have hw : ((patchingExpansion v w xs).map (fun z => signedLetter w a.1*a.2*z.2)).sum = + (signedLetter w a.1*a.2)*((patchingExpansion v w xs).map Prod.snd).sum := by + simpa only [List.map_map,Function.comp_def] using + sum_map_left_mul (signedLetter w a.1*a.2) ((patchingExpansion v w xs).map Prod.snd) + rw [hv,hw,ih] + simp only [patchingWord,signedLetter_add,add_mul] + +theorem patchingExpansion_length (v w : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + (patchingExpansion v w xs).length=2^xs.length := by + induction xs with + | nil => simp [patchingExpansion] + | cons a xs ih => simp [patchingExpansion,ih,pow_succ]; omega + +theorem patchingExpansion_degree_le (v w : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + ∀ z ∈ patchingExpansion v w xs, z.1 ≤ xs.length := by + induction xs with + | nil => simp [patchingExpansion] + | cons a xs ih => + intro z hz + rcases List.mem_append.mp hz with h | h + · obtain ⟨y,hy,rfl⟩ := List.mem_map.mp h + have he := ih y hy + simpa using he.trans (Nat.le_succ _) + · obtain ⟨y,hy,rfl⟩ := List.mem_map.mp h + exact Nat.succ_le_succ (ih y hy) + +/-- The unique term containing no patch letters is exactly the original word. -/ +theorem patchingExpansion_zero_filter (v w : M.toStarSubalgebra) + (xs : List (Bool × M.toStarSubalgebra)) : + (patchingExpansion v w xs).filter (fun z => z.1==0)=[(0,patchingWord v xs)] := by + induction xs with + | nil => simp [patchingExpansion,patchingWord] + | cons a xs ih => + simp only [patchingExpansion,List.filter_append,List.filter_map] + simp only [Function.comp_def] + simp [patchingWord,ih] + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PerturbationBounds.lean b/lean/OAI/Analysis/FactorGeneration/PerturbationBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..9d982106f2187d6e6aaf2a9bee9089476f65785f --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PerturbationBounds.lean @@ -0,0 +1,305 @@ +import Mathlib.Analysis.Calculus.MeanValue +import Mathlib.Analysis.SpecialFunctions.Exponential +import OAI.Analysis.FactorGeneration.WordCorrelation + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Exact 2 ell signed coefficients in each formal row. In particular the +identity prefix label is still a nonidentity basis letter in the formal group. -/ +section +attribute [local instance] Classical.propDecidable Classical.decEq +open scoped BigOperators InnerProductSpace +open FreeConvolution + +theorem pairLabel_right_injective {ell : ℕ} (k : Fin ell) : + Function.Injective (pairLabel k) := by + intro i j hij + have h := congrArg Subtype.val hij + change freePrefix (k.val+1)*(freePrefix (i.val+1))⁻¹= + freePrefix (k.val+1)*(freePrefix (j.val+1))⁻¹ at h + have he := freePrefix_injective (inv_injective (mul_left_cancel h)) + exact Fin.ext (Nat.add_right_cancel he) + +def rowSignedWord {ell : ℕ} (k : Fin ell) (a : Fin ell × Bool) : + FreeGroup (PrefixLabel ell) := letter (pairLabel k a.1,a.2) + +theorem rowSignedWord_injective {ell : ℕ} (k : Fin ell) : + Function.Injective (rowSignedWord k) := by + intro a b hab + have h := letter_injective hab + exact Prod.ext (pairLabel_right_injective k (congrArg Prod.fst h)) (congrArg (fun x : PrefixLabel ell × Bool => x.2) h) + +theorem finitePerturbationRow_signed {ell : ℕ} (α : ℝ) (k : Fin ell) : + finitePerturbationRow α k= + ∑ a : Fin ell × Bool, (if a.2 then ((α/(2*ell) : ℝ) : ℂ) else -((α/(2*ell) : ℝ) : ℂ)) • + MonoidAlgebra.single (rowSignedWord k a) 1 := by + rw [finitePerturbationRow,Fintype.sum_prod_type] + simp only [Fintype.sum_bool,rowSignedWord,letter_true,letter_false, + Bool.false_eq_true,ite_false,ite_true,neg_smul,← sub_eq_add_neg,← smul_sub,← Finset.smul_sum] + exact (IsScalarTower.algebraMap_smul ℂ (α/(2*ell) : ℝ) _).symm + +theorem finitePerturbationRow_norm_sq {E : Type*} [NormedAddCommGroup E] + [InnerProductSpace ℂ E] {ell : ℕ} (α : ℝ) (k : Fin ell) + (Ψ : MonoidAlgebra ℂ (FreeGroup (PrefixLabel ell)) →ₗ[ℂ] E) + (hΨ : Orthonormal ℂ (fun g => Ψ (MonoidAlgebra.single g 1))) : + ‖Ψ (finitePerturbationRow α k)‖^2=2*ell*(α/(2*ell))^2 := by + have hv : Orthonormal ℂ (fun a => Ψ (MonoidAlgebra.single (rowSignedWord k a) 1)) := + hΨ.comp (rowSignedWord k) (rowSignedWord_injective k) + rw [finitePerturbationRow_signed,map_sum] + simp only [map_smul] + rw [← inner_self_eq_norm_sq (𝕜 := ℂ),hv.inner_sum,map_sum] + calc + _ = ∑ a : Fin ell × Bool, ‖(if a.2 then ((α/(2*ell) : ℝ) : ℂ) + else -((α/(2*ell) : ℝ) : ℂ))‖^2 := by + apply Finset.sum_congr rfl + intro a _ + rw [mul_comm] + exact inner_self_eq_norm_sq (𝕜 := ℂ) + (if a.2 then ((α/(2*ell) : ℝ) : ℂ) else -((α/(2*ell) : ℝ) : ℂ)) + _ = _ := by + simp only [Fintype.sum_prod_type,Fintype.sum_bool,Bool.false_eq_true,ite_false,ite_true, + norm_neg,Complex.norm_real,Real.norm_eq_abs,sq_abs,Finset.sum_const,Finset.card_univ, + Fintype.card_fin,nsmul_eq_mul] + ring + +end + +/-! Exact trace-two-norm of the single common logarithmic perturbation. -/ +namespace Tracial + +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem quotient_norm_unitary_mul (g : unitary (Q τ ω)) (a : Q τ ω) : + ‖(g : Q τ ω)*a‖=‖a‖ := by + rw [← quotient_norm_star,star_mul,quotient_norm_mul_unitary τ ω _ (star (g : Q τ ω)), + quotient_norm_star] + simpa only [star_star] using g.property.1 + +theorem SuccessiveCoordinateHaar.commonPerturbation_norm_sq + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) : + ‖sequenceQuotient τ ω (F.commonPerturbation τ ω u z ell α)‖^2= + 2*ell*(α/(2*ell))^2 := by + let k : Fin ell := ⟨0,hell⟩ + let Ψ := (sequenceInclusion τ ω).toLinearMap.comp (F.perturbationMap τ ω u z ell).toLinearMap + have ho := coordinateGroupRing_orthonormal τ ω _ _ (F.coordinateConjugates_quotient τ ω u z ell) + (F.conjugate_trace τ ω _ _ hu hz ell) + have hr := finitePerturbationRow_norm_sq α k Ψ ho + have hn : ‖Ψ (finitePerturbationRow α k)‖= + ‖sequenceQuotient τ ω (F.commonPerturbation τ ω u z ell α)‖ := by + change ‖sequenceInclusion τ ω (F.perturbationMap τ ω u z ell (finitePerturbationRow α k))‖=_ + rw [sequenceInclusion_apply,LinearIsometry.norm_map,F.perturbationMap_row,map_mul,map_mul,map_star] + let g := sequenceUnitaryQuotient τ ω (F.coordinatePrefix τ ω u (k.val+1)) + change ‖(g : Q τ ω)*sequenceQuotient τ ω (F.commonPerturbation τ ω u z ell α)*star (g : Q τ ω)‖=_ + rw [quotient_norm_mul_unitary τ ω _ (star (g : Q τ ω)),quotient_norm_unitary_mul] + simpa only [star_star] using g.property.1 + rwa [hn] at hr + +theorem SuccessiveCoordinateHaar.commonPerturbation_norm + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 ≤ α) : + ‖sequenceQuotient τ ω (F.commonPerturbation τ ω u z ell α)‖= + α/Real.sqrt (2*ell) := by + have hn : (0 : ℝ)<2*ell := by positivity + apply (sq_eq_sq₀ (norm_nonneg _) (div_nonneg hα (Real.sqrt_nonneg _))).mp + rw [F.commonPerturbation_norm_sq τ ω u z hu hz ell hell α] + simp only [div_pow,Real.sq_sqrt hn.le] + field_simp [ne_of_gt hn] + +end + +/-! Sharp trace-two-norm displacement of a skew-adjoint exponential, via the +real path t ↦ exp(t K). This proves the scalar-calculus estimate used in the +manuscript without an extra exponential factor. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def traceVectorCLM : M.toStarSubalgebra →L[ℂ] H := + ({ toFun := fun a => (a : H →L[ℂ] H) τ.vector + map_add' := fun _ _ => rfl + map_smul' := fun _ _ => rfl } : M.toStarSubalgebra →ₗ[ℂ] H).mkContinuous 1 + (fun a => by + change τ.norm₂ a ≤ 1*‖a‖ + simpa only [one_mul] using τ.norm₂_le_norm a) + +theorem norm₂_exp_sub_one_le (K : M.toStarSubalgebra) (hK : star K = -K) : + τ.norm₂ (NormedSpace.exp K-1) ≤ τ.norm₂ K := by + let V := (traceVectorCLM τ).restrictScalars ℝ + have hd (t : ℝ) : HasDerivAt (fun s : ℝ => V (NormedSpace.exp (s • K))) + (V (NormedSpace.exp (t • K)*K)) t := + V.hasFDerivAt.comp_hasDerivAt t (hasDerivAt_exp_smul_const K t) + have hb (t : ℝ) : ‖V (NormedSpace.exp (t • K)*K)‖ ≤ τ.norm₂ K := by + have hu : NormedSpace.exp (t • K) ∈ unitary M.toStarSubalgebra := by + apply NormedSpace.exp_mem_unitary_of_mem_skewAdjoint + rw [skewAdjoint.mem_iff,star_smul,star_trivial,hK] + exact smul_neg _ _ + have hn := unitary_norm_le (NormedSpace.exp (t • K)) hu.1 + change τ.norm₂ (NormedSpace.exp (t • K)*K) ≤ _ + calc + _ ≤ ‖NormedSpace.exp (t • K)‖*τ.norm₂ K := τ.norm₂_mul_le _ _ + _ ≤ 1*τ.norm₂ K := mul_le_mul_of_nonneg_right hn (norm_nonneg _) + _ = _ := one_mul _ + have h := norm_image_sub_le_of_norm_deriv_le_segment_01' + (fun t _ => (hd t).hasDerivWithinAt) (fun t _ => hb t) + change ‖V (NormedSpace.exp K-1)‖ ≤ _ + rw [map_sub] + simpa only [one_smul,zero_smul,NormedSpace.exp_zero] using h + +theorem norm₂_exp_mul_sub_le (K : M.toStarSubalgebra) (hK : star K = -K) + (u : unitary M.toStarSubalgebra) : + τ.norm₂ (NormedSpace.exp K*(u : M.toStarSubalgebra)-u) ≤ τ.norm₂ K := by + have he : NormedSpace.exp K*(u : M.toStarSubalgebra)-u= + (NormedSpace.exp K-1)*(u : M.toStarSubalgebra) := by rw [sub_mul,one_mul] + rw [he] + have hn := unitary_norm_le (u : M.toStarSubalgebra) u.property.1 + calc + _ ≤ τ.norm₂ (NormedSpace.exp K-1)*‖(u : M.toStarSubalgebra)‖ := τ.norm₂_mul_le_right _ _ + _ ≤ τ.norm₂ (NormedSpace.exp K-1)*1 := mul_le_mul_of_nonneg_left hn (norm_nonneg _) + _ ≤ τ.norm₂ K := by rw [mul_one]; exact norm₂_exp_sub_one_le τ K hK + +end + +/-! A single coordinate satisfies the size and correlation bounds for the +literal word. Its P-valued unitary letters are the retained construction. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +def unitaryCoordinate (a : unitary (Sequences M)) (n : ℕ) : unitary M.toStarSubalgebra := + ⟨(a : Sequences M) n,⟨congrArg (fun b : Sequences M => b n) a.property.1, + congrArg (fun b : Sequences M => b n) a.property.2⟩⟩ + +def SuccessiveCoordinateHaar.retainedUnitary (F : SuccessiveCoordinateHaar τ ω hNM seed) + (j n : ℕ) : unitary N.toStarSubalgebra := + ⟨(F.step j).coordinates.val n,(F.step j).unitary_coordinates n⟩ + +theorem SuccessiveCoordinateHaar.perturbedUnitary_apply + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (ell : ℕ) (α : ℝ) (n : ℕ) : + (F.perturbedUnitary τ ω u z ell α : Sequences M) n= + NormedSpace.exp (F.commonPerturbation τ ω u z ell α n)*(u : M.toStarSubalgebra) := by + change (NormedSpace.exp (F.commonPerturbation τ ω u z ell α)) n*(u : M.toStarSubalgebra)=_ + rw [sequence_exp_apply] + +theorem SuccessiveCoordinateHaar.perturbedUnitary_distance + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (ell : ℕ) (α : ℝ) (n : ℕ) : + τ.norm₂ ((F.perturbedUnitary τ ω u z ell α : Sequences M) n-u) ≤ + τ.norm₂ (F.commonPerturbation τ ω u z ell α n) := by + rw [F.perturbedUnitary_apply] + exact norm₂_exp_mul_sub_le τ _ + (congrArg (fun a : Sequences M => a n) (F.commonPerturbation_skew τ ω u z ell α)) u + +theorem SuccessiveCoordinateHaar.perturbedWord_apply + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (ell : ℕ) (α : ℝ) (n : ℕ) : + (F.perturbedWord τ ω u z ell α : Sequences M) n= + coordinateInclusion hNM (F.retainedUnitary τ ω 0 n : N.toStarSubalgebra)* + ((List.range ell).map (fun j => + (F.perturbedUnitary τ ω u z ell α : Sequences M) n* + coordinateInclusion hNM (F.retainedUnitary τ ω (j+1) n : N.toStarSubalgebra))).prod := by + change sequenceEval n (F.perturbedWord τ ω u z ell α : Sequences M)=_ + simp only [perturbedWord,Submonoid.coe_mul,Submonoid.coe_list_prod,map_mul,map_list_prod, + List.map_map,Function.comp_def] + change (F.haarSequence τ ω 0 : Sequences M) n* + ((List.range ell).map (fun j => (F.perturbedUnitary τ ω u z ell α : Sequences M) n* + (F.haarSequence τ ω (j+1) : Sequences M) n)).prod=_ + simp only [F.haarSequence_apply,retainedUnitary] + +theorem SuccessiveCoordinateHaar.select_perturbation_coordinate + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (xi : M.toStarSubalgebra) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) (hxi : constantQuotient τ ω xi ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) : + ∃ n : ℕ, + τ.norm₂ ((F.perturbedUnitary τ ω u z ell α : Sequences M) n-u) < + α/Real.sqrt (2*ell)+1/(ell : ℝ) ∧ + ‖τ.trace (star xi*(F.perturbedWord τ ω u z ell α : Sequences M) n)- + (α : ℂ)/2*τ.trace (star xi*(z : M.toStarSubalgebra))‖ < + τ.norm₂ xi*(4*α^2/(1-2*α))+1/(ell : ℝ) := by + have hε : (0 : ℝ)<1/(ell : ℝ) := by positivity + have hc := F.perturbedWord_correlation τ ω u z (constantQuotient τ ω xi) hu hz hxi ell hell α hα hhalf + have hb : ‖inner ℂ (sequenceInclusion τ ω (constantSequence xi)) + (sequenceInclusion τ ω (F.perturbedWord τ ω u z ell α : Sequences M))- + (α : ℂ)/2*τ.trace (star xi*(z : M.toStarSubalgebra))‖ ≤ τ.norm₂ xi*(4*α^2/(1-2*α)) := by + have ht : quotientTrace τ ω (star (constantQuotient τ ω xi)* + (constantQuotientUnitary τ ω z : Q τ ω))=τ.trace (star xi*(z : M.toStarSubalgebra)) := by + change quotientTrace τ ω (star (constantQuotient τ ω xi)* + constantQuotient τ ω (z : M.toStarSubalgebra))=_ + rw [← map_star,← map_mul,constantQuotient_trace] + rw [ht,constantQuotient_norm] at hc + rw [sequenceInclusion_apply,sequenceInclusion_apply,inclusion_inner] + exact hc + obtain ⟨n,hn,ht⟩ := select_coordinate_with_bounds τ ω + (F.commonPerturbation τ ω u z ell α) (constantSequence xi) + (F.perturbedWord τ ω u z ell α : Sequences M) + (α/Real.sqrt (2*ell)) (τ.norm₂ xi*(4*α^2/(1-2*α))) (1/(ell : ℝ)) + ((α : ℂ)/2*τ.trace (star xi*(z : M.toStarSubalgebra))) hε + (F.commonPerturbation_norm τ ω u z hu hz ell hell α hα.le).le hb + exact ⟨n,(F.perturbedUnitary_distance τ ω u z ell α n).trans_lt hn,ht⟩ + +end + +/-! The manuscript's two perturbation inequalities, constructed under explicit +faithful vector-trace, irreducibility, diffuseness and trace-vector separability +data. No perturbation endpoint or free-moment premise is assumed. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_represented_perturbation (hω : (ω : Filter ℕ) ≤ atTop) + (u z : unitary M.toStarSubalgebra) (xi : M.toStarSubalgebra) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) : + ∃ u' : unitary M.toStarSubalgebra, ∃ t : ℕ → unitary N.toStarSubalgebra, + τ.norm₂ ((u' : M.toStarSubalgebra)-u) ≤ α/Real.sqrt (2*ell)+1/(ell : ℝ) ∧ + ‖τ.trace (star xi*(coordinateInclusion hNM (t 0 : N.toStarSubalgebra)* + ((List.range ell).map (fun j => (u' : M.toStarSubalgebra)* + coordinateInclusion hNM (t (j+1) : N.toStarSubalgebra))).prod))- + (α : ℂ)/2*τ.trace (star xi*(z : M.toStarSubalgebra))‖ ≤ + τ.norm₂ xi*(4*α^2/(1-2*α))+1/(ell : ℝ) := by + obtain ⟨F⟩ := nonempty_successiveCoordinateHaar τ ω hNM hfactor hdiff hirr hsep hω + {(constantQuotientUnitary τ ω u : Q τ ω),(constantQuotientUnitary τ ω z : Q τ ω), + constantQuotient τ ω xi} + (((Set.countable_singleton (constantQuotient τ ω xi)).insert _).insert _) + obtain ⟨n,hn,ht⟩ := F.select_perturbation_coordinate τ ω u z xi + (by simp) (by simp) (by simp) ell hell α hα hhalf + refine ⟨unitaryCoordinate (F.perturbedUnitary τ ω u z ell α) n, + (fun j => F.retainedUnitary τ ω j n),hn.le,?_⟩ + have he := F.perturbedWord_apply τ ω u z ell α n + simpa only [unitaryCoordinate,he] using ht.le + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Pinching.lean b/lean/OAI/Analysis/FactorGeneration/Pinching.lean new file mode 100644 index 0000000000000000000000000000000000000000..94cf0796584f2cabae735518578c6cbce2c470aa --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Pinching.lean @@ -0,0 +1,494 @@ +import OAI.Analysis.FactorGeneration.CornerTrace + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Finite pinching in the actual ambient algebra. The squared L2 energy +is a sum of the energies of the mutually orthogonal compression blocks. +These identities do not postulate a local-quantizing partition. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- A finite projection partition of a corner, allowing zero pieces. -/ +structure CornerPartition (p : AlgebraProjection M) where + size : ℕ + piece : Fin size → AlgebraProjection M + orthogonal : ∀ i j, i ≠ j → (piece i).val * (piece j).val = 0 + total : ∑ i, (piece i).val = p.val + +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) + +theorem piece_le (i : Fin Q.size) : Q.piece i ≤ p := by + change p.val * (Q.piece i).val = (Q.piece i).val + rw [← Q.total, Finset.sum_mul] + simpa only [(Q.piece i).property.isIdempotentElem.eq] using + (Finset.sum_eq_single i (fun j _ hji => Q.orthogonal j i hji) + (fun h => (h (Finset.mem_univ i)).elim)) + +def pinch (x : M.toStarSubalgebra) : M.toStarSubalgebra := + ∑ i, (Q.piece i).val * x * (Q.piece i).val + +theorem pinch_add (x y : M.toStarSubalgebra) : + Q.pinch (x+y) = Q.pinch x + Q.pinch y := by + simp [pinch, mul_add, add_mul, Finset.sum_add_distrib] + +theorem pinch_sub (x y : M.toStarSubalgebra) : + Q.pinch (x-y) = Q.pinch x - Q.pinch y := by + simp [pinch, mul_sub, sub_mul, Finset.sum_sub_distrib] + +theorem pinch_smul (c : ℂ) (x : M.toStarSubalgebra) : + Q.pinch (c • x) = c • Q.pinch x := by + simp [pinch, Finset.smul_sum] + +theorem pinch_support (x : M.toStarSubalgebra) : + p.val * Q.pinch x = Q.pinch x ∧ Q.pinch x * p.val = Q.pinch x := by + constructor + · have h (i : Fin Q.size) : p.val * (Q.piece i).val = (Q.piece i).val := Q.piece_le i + simp only [pinch, Finset.mul_sum, ← mul_assoc, h] + · simp only [pinch, Finset.sum_mul, mul_assoc, projection_mul_of_le (Q.piece_le _)] + +theorem pinch_left (i : Fin Q.size) (x : M.toStarSubalgebra) : + (Q.piece i).val * Q.pinch x = (Q.piece i).val * x * (Q.piece i).val := by + rw [pinch, Finset.mul_sum] + rw [Finset.sum_eq_single i] + · simp only [← mul_assoc, (Q.piece i).property.isIdempotentElem.eq] + · intro j _ hji + simp only [← mul_assoc, Q.orthogonal i j hji.symm, zero_mul] + · simp + +theorem pinch_right (i : Fin Q.size) (x : M.toStarSubalgebra) : + Q.pinch x * (Q.piece i).val = (Q.piece i).val * x * (Q.piece i).val := by + rw [pinch, Finset.sum_mul] + rw [Finset.sum_eq_single i] + · simp only [mul_assoc, (Q.piece i).property.isIdempotentElem.eq] + · intro j _ hji + simp only [mul_assoc, Q.orthogonal j i hji, mul_zero] + · simp + +theorem pinch_idempotent (x : M.toStarSubalgebra) : Q.pinch (Q.pinch x) = Q.pinch x := by + unfold pinch + apply Finset.sum_congr rfl + intro i _ + change (Q.piece i).val * Q.pinch x * (Q.piece i).val = _ + rw [Q.pinch_left] + simp only [mul_assoc, (Q.piece i).property.isIdempotentElem.eq] + +theorem pinch_trace (x : M.toStarSubalgebra) : + τ.trace (Q.pinch x) = τ.trace (p.val*x*p.val) := by + have hq (i : Fin Q.size) : + τ.trace ((Q.piece i).val*x*(Q.piece i).val) = τ.trace (x*(Q.piece i).val) := by + rw [τ.trace_mul_comm, ← mul_assoc, (Q.piece i).property.isIdempotentElem.eq, + τ.trace_mul_comm] + change coordinateTraceLinear τ (∑ i, (Q.piece i).val*x*(Q.piece i).val) = _ + rw [map_sum] + change (∑ i, τ.trace ((Q.piece i).val*x*(Q.piece i).val)) = _ + simp only [hq] + change (∑ i, coordinateTraceLinear τ (x*(Q.piece i).val)) = _ + rw [← map_sum (coordinateTraceLinear τ), ← Finset.mul_sum, Q.total] + change τ.trace (x*p.val) = _ + rw [τ.trace_mul_comm (p.val*x) p.val, ← mul_assoc, p.property.isIdempotentElem.eq, + τ.trace_mul_comm p.val x] + +end CornerPartition + +/-! Actual compression energies and the energy lost by finite pinching. +No existence statement about small-energy partitions is assumed here. -/ + +theorem norm₂_sq_trace (x : M.toStarSubalgebra) : + τ.norm₂ x ^ 2 = (τ.trace (star x*x)).re := by + rw [τ.trace_star_mul, ← Complex.ofReal_pow, Complex.ofReal_re] + +theorem trace_compression_pairing (q : AlgebraProjection M) (x y : M.toStarSubalgebra) : + τ.trace (star (q.val*x*q.val)*y) = τ.trace (star x*(q.val*y*q.val)) := by + simp only [star_mul, q.property.isSelfAdjoint.star_eq] + rw [mul_assoc q.val (star x*q.val), τ.trace_mul_comm q.val] + simp only [mul_assoc] + +theorem baseVector_inner_trace (x y : M.toStarSubalgebra) : + inner ℂ (baseVector τ x) (baseVector τ y) = τ.trace (star x*y) := by + change inner ℂ ((x : H →L[ℂ] H) τ.vector) ((y : H →L[ℂ] H) τ.vector) = _ + rw [← ContinuousLinearMap.adjoint_inner_right] + rfl + +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) + +theorem pinch_pairing (x y : M.toStarSubalgebra) : + τ.trace (star (Q.pinch x)*y) = τ.trace (star x*Q.pinch y) := by + simp only [pinch, star_sum, Finset.sum_mul, Finset.mul_sum] + change coordinateTraceLinear τ _ = coordinateTraceLinear τ _ + simp only [map_sum] + exact Finset.sum_congr rfl (fun i _ => trace_compression_pairing τ (Q.piece i) x y) + +theorem pinch_residual_orthogonal (x : M.toStarSubalgebra) : + inner ℂ (baseVector τ (Q.pinch x)) (baseVector τ (x-Q.pinch x)) = 0 := by + rw [baseVector_inner_trace] + rw [Q.pinch_pairing τ, Q.pinch_sub, Q.pinch_idempotent, sub_self, mul_zero] + exact inner_zero_right _ + +theorem pinch_pythagoras (x : M.toStarSubalgebra) : + τ.norm₂ (Q.pinch x)^2 + τ.norm₂ (x-Q.pinch x)^2 = τ.norm₂ x^2 := by + have h := norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero + (baseVector τ (Q.pinch x)) (baseVector τ (x-Q.pinch x)) + (Q.pinch_residual_orthogonal τ x) + rw [← map_add, add_sub_cancel] at h + change τ.norm₂ x * τ.norm₂ x = τ.norm₂ (Q.pinch x)*τ.norm₂ (Q.pinch x) + + τ.norm₂ (x-Q.pinch x)*τ.norm₂ (x-Q.pinch x) at h + simpa only [pow_two] using h.symm + +theorem pinch_norm₂_le (x : M.toStarSubalgebra) : τ.norm₂ (Q.pinch x) ≤ τ.norm₂ x := by + have h := Q.pinch_pythagoras τ x + nlinarith [sq_nonneg (τ.norm₂ (x-Q.pinch x)), show 0 ≤ τ.norm₂ x from norm_nonneg _, + show 0 ≤ τ.norm₂ (Q.pinch x) from norm_nonneg _] + +theorem pinch_block_orthogonal (x : M.toStarSubalgebra) (i j : Fin Q.size) (hij : i ≠ j) : + star ((Q.piece i).val*x*(Q.piece i).val) * ((Q.piece j).val*x*(Q.piece j).val) = 0 := by + simp only [star_mul, (Q.piece i).property.isSelfAdjoint.star_eq] + calc (Q.piece i).val*star x*(Q.piece i).val*((Q.piece j).val*x*(Q.piece j).val) = + ((Q.piece i).val*star x)*((Q.piece i).val*(Q.piece j).val)*x*(Q.piece j).val := by + simp only [mul_assoc] + _ = 0 := by rw [Q.orthogonal i j hij, mul_zero, zero_mul, zero_mul] + +theorem pinch_energy (x : M.toStarSubalgebra) : + τ.norm₂ (Q.pinch x)^2 = ∑ i, τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2 := by + have h : star (Q.pinch x)*Q.pinch x = + ∑ i, star ((Q.piece i).val*x*(Q.piece i).val)*((Q.piece i).val*x*(Q.piece i).val) := by + simp only [pinch, star_sum, Finset.sum_mul, Finset.mul_sum] + apply Finset.sum_congr rfl + intro i _ + exact Finset.sum_eq_single i (fun j _ hji => Q.pinch_block_orthogonal x j i hji) + (by simp) + rw [norm₂_sq_trace τ, h] + change (coordinateTraceLinear τ _).re = _ + rw [map_sum, Complex.re_sum] + exact Finset.sum_congr rfl (fun i _ => (norm₂_sq_trace τ _).symm) + +/-- The precise finite energy input is the squared norm of the pinched +corner-centered family; orthogonality proves this equality. -/ +theorem pinch_family_energy (F : Finset M.toStarSubalgebra) : + (∑ i, ∑ x ∈ F, τ.norm₂ ((Q.piece i).val*cornerCentered τ p x*(Q.piece i).val)^2) = + ∑ x ∈ F, τ.norm₂ (Q.pinch (cornerCentered τ p x))^2 := by + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro x _ + exact (Q.pinch_energy τ _).symm + +/-! Partition refinement decreases the actual compression energy. The final +selection theorem retains membership in the prescribed subalgebra. -/ + +theorem pinch_corner : Q.pinch p.val = p.val := by + unfold pinch + calc (∑ i, (Q.piece i).val*p.val*(Q.piece i).val) = ∑ i, (Q.piece i).val := by + apply Finset.sum_congr rfl + intro i _ + rw [projection_mul_of_le (Q.piece_le i), (Q.piece i).property.isIdempotentElem.eq] + _ = p.val := Q.total + +theorem pinch_corner_compression (x : M.toStarSubalgebra) : + Q.pinch (p.val*x*p.val) = Q.pinch x := by + unfold pinch + apply Finset.sum_congr rfl + intro i _ + have hl : p.val*(Q.piece i).val = (Q.piece i).val := Q.piece_le i + have hr := projection_mul_of_le (Q.piece_le i) + simp only [← mul_assoc, hr] + simp only [mul_assoc, hl] + +theorem pinch_cornerCentered (x : M.toStarSubalgebra) : + Q.pinch (cornerCentered τ p x) = Q.pinch x - cornerScalar τ p x • p.val := by + rw [cornerCentered, Q.pinch_sub, Q.pinch_smul, Q.pinch_corner, Q.pinch_corner_compression] + +theorem pinch_compress_of_le (r : AlgebraProjection M) (i : Fin Q.size) + (hr : r ≤ Q.piece i) (x : M.toStarSubalgebra) : + r.val*Q.pinch x*r.val = r.val*x*r.val := by + have hl : (Q.piece i).val*r.val = r.val := hr + have hright := projection_mul_of_le hr + calc r.val*Q.pinch x*r.val = (r.val*(Q.piece i).val)*Q.pinch x*r.val := by rw [hright] + _ = r.val*((Q.piece i).val*Q.pinch x)*r.val := by rw [mul_assoc r.val] + _ = r.val*((Q.piece i).val*x*(Q.piece i).val)*r.val := by rw [Q.pinch_left] + _ = r.val*x*r.val := by + simp only [← mul_assoc, hright] + simp only [mul_assoc, hl] + +def Refines (R : CornerPartition p) : Prop := ∀ i, ∃ j, R.piece i ≤ Q.piece j + +theorem pinch_refinement (R : CornerPartition p) (h : Q.Refines R) (x : M.toStarSubalgebra) : + R.pinch (Q.pinch x) = R.pinch x := by + unfold pinch + apply Finset.sum_congr rfl + intro i _ + obtain ⟨j,hj⟩ := h i + exact Q.pinch_compress_of_le (R.piece i) j hj x + +theorem refinement_energy_le (R : CornerPartition p) (h : Q.Refines R) + (x : M.toStarSubalgebra) : + (∑ i, τ.norm₂ ((R.piece i).val*x*(R.piece i).val)^2) ≤ + ∑ i, τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2 := by + rw [← R.pinch_energy τ, ← Q.pinch_energy τ, ← Q.pinch_refinement R h x] + exact pow_le_pow_left₀ (norm_nonneg _) (R.pinch_norm₂_le τ (Q.pinch x)) 2 + +theorem trace_total : (∑ i, (τ.trace (Q.piece i).val).re) = (τ.trace p.val).re := by + rw [← Complex.re_sum] + change (∑ i, coordinateTraceLinear τ (Q.piece i).val).re = _ + rw [← map_sum, Q.total] + rfl + +/-- Converting a genuine pinching budget into the requested nonzero local +piece. The budget is explicit; this theorem does not claim to construct it. -/ +theorem exists_local_piece_of_pinching_energy + (P : StarSubalgebra ℂ M.toStarSubalgebra) (hP : ∀ i, (Q.piece i).val ∈ P) + (F : Finset M.toStarSubalgebra) (ε : ℝ) (hε : 0 < ε) + (henergy : (∑ x ∈ F, τ.norm₂ (Q.pinch (cornerCentered τ p x))^2) < + ε^2 * (τ.trace p.val).re) : + ∃ q : AlgebraProjection M, q ≤ p ∧ q.val ≠ 0 ∧ q.val ∈ P ∧ ∀ x ∈ F, + norm₁ τ (q.val*x*q.val-cornerScalar τ p x • q.val) < ε*(τ.trace q.val).re := by + obtain ⟨q,hqp,hq,⟨i,_,rfl⟩,h⟩ := exists_corner_L1_of_partition_energy τ + Finset.univ p Q.piece (fun i _ => Q.piece_le i) F ε hε (by + simpa only [Q.pinch_family_energy τ, Q.trace_total τ] using henergy) + refine ⟨Q.piece i,hqp,hq,hP i,fun x hx => ?_⟩ + simpa only [compress_cornerCentered τ hqp] using h x hx + +end CornerPartition + +end + +/-! Actual finite refinement of a corner partition by partitions of its blocks. +The dependent family of block sizes is flattened without changing any piece. +No small-energy partition is an input to these constructions. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +namespace CornerPartition +variable {p : AlgebraProjection M} + +/-- Reindex an explicitly finite orthogonal family by Fin. -/ +def ofFamily {ι : Type*} [Fintype ι] (a : ι → AlgebraProjection M) + (ha : ∀ i j, i ≠ j → (a i).val*(a j).val=0) + (ht : ∑ i, (a i).val=p.val) : CornerPartition p where + size := Fintype.card ι + piece i := a ((Fintype.equivFin ι).symm i) + orthogonal i j hij := ha _ _ (fun h => hij ((Fintype.equivFin ι).symm.injective h)) + total := by simpa only using (Equiv.sum_comp (Fintype.equivFin ι).symm (fun i => (a i).val)).trans ht + +theorem ofFamily_pinch {ι : Type*} [Fintype ι] (a : ι → AlgebraProjection M) + (ha : ∀ i j, i ≠ j → (a i).val*(a j).val=0) + (ht : ∑ i, (a i).val=p.val) (x : M.toStarSubalgebra) : + (ofFamily a ha ht).pinch x = ∑ i, (a i).val*x*(a i).val := by + exact Equiv.sum_comp (Fintype.equivFin ι).symm (fun i => (a i).val*x*(a i).val) + +/-- The partition with its corner as its only piece. -/ +def single (p : AlgebraProjection M) : CornerPartition p where + size := 1 + piece _ := p + orthogonal i j hij := (hij (Subsingleton.elim _ _)).elim + total := by simp + +@[simp] theorem single_pinch (p : AlgebraProjection M) (x : M.toStarSubalgebra) : + (single p).pinch x = p.val*x*p.val := by + change (∑ _ : Fin 1, p.val*x*p.val) = _ + simp + +variable (Q : CornerPartition p) (R : (i : Fin Q.size) → CornerPartition (Q.piece i)) + +theorem blockFamily_orthogonal (a b : (i : Fin Q.size) × Fin (R i).size) (hab : a ≠ b) : + ((R a.1).piece a.2).val * ((R b.1).piece b.2).val = 0 := by + by_cases h : a.1=b.1 + · obtain ⟨i,j⟩ := a + obtain ⟨k,l⟩ := b + dsimp at h ⊢ + subst k + exact (R i).orthogonal j l (fun h => hab (by cases h; rfl)) + · exact orthogonal_subprojections (Q.orthogonal a.1 b.1 h) + ((R a.1).piece_le a.2) ((R b.1).piece_le b.2) + +theorem blockFamily_total : + (∑ a : (i : Fin Q.size) × Fin (R i).size, ((R a.1).piece a.2).val) = p.val := by + rw [Fintype.sum_sigma] + simpa only [(R _).total] using Q.total + +/-- All blocks are replaced by their chosen finite subpartitions. -/ +def refineBlocks : CornerPartition p := + ofFamily (fun a : (i : Fin Q.size) × Fin (R i).size => (R a.1).piece a.2) + (Q.blockFamily_orthogonal R) (Q.blockFamily_total R) + +theorem refineBlocks_refines : Q.Refines (Q.refineBlocks R) := by + intro i + let a := (Fintype.equivFin ((j : Fin Q.size) × Fin (R j).size)).symm i + exact ⟨a.1,(R a.1).piece_le a.2⟩ + +theorem refineBlocks_mem (P : StarSubalgebra ℂ M.toStarSubalgebra) + (hP : ∀ i j, ((R i).piece j).val ∈ P) : + ∀ i, ((Q.refineBlocks R).piece i).val ∈ P := by + intro i + exact hP _ _ + +theorem refineBlocks_pinch (x : M.toStarSubalgebra) : + (Q.refineBlocks R).pinch x = ∑ i, (R i).pinch x := by + rw [refineBlocks,ofFamily_pinch,Fintype.sum_sigma] + rfl + +/-- Energy splits into the actual energies of the independently refined blocks. -/ +theorem refineBlocks_energy (τ : TracialRepresentation M) (x : M.toStarSubalgebra) : + τ.norm₂ ((Q.refineBlocks R).pinch x)^2 = ∑ i, τ.norm₂ ((R i).pinch x)^2 := by + rw [(Q.refineBlocks R).pinch_energy τ] + change (∑ j, τ.norm₂ (((Q.refineBlocks R).piece j).val*x* + ((Q.refineBlocks R).piece j).val)^2) = _ + let e := (Fintype.equivFin ((i : Fin Q.size) × Fin (R i).size)).symm + change (∑ j, τ.norm₂ (((R (e j).1).piece (e j).2).val*x* + ((R (e j).1).piece (e j).2).val)^2) = _ + rw [show (∑ j, τ.norm₂ (((R (e j).1).piece (e j).2).val*x* + ((R (e j).1).piece (e j).2).val)^2) = + ∑ a : (i : Fin Q.size) × Fin (R i).size, + τ.norm₂ (((R a.1).piece a.2).val*x*((R a.1).piece a.2).val)^2 from + Equiv.sum_comp e (fun a => τ.norm₂ (((R a.1).piece a.2).val*x* + ((R a.1).piece a.2).val)^2),Fintype.sum_sigma] + exact Finset.sum_congr rfl (fun i _ => ((R i).pinch_energy τ x).symm) + +theorem refines_refl : Q.Refines Q := fun i => ⟨i,le_refl _⟩ + +theorem refines_trans {R S : CornerPartition p} (hQR : Q.Refines R) (hRS : R.Refines S) : + Q.Refines S := by + intro i + obtain ⟨j,hj⟩ := hRS i + obtain ⟨k,hk⟩ := hQR j + exact ⟨k,hj.trans hk⟩ + +end CornerPartition + +end + +/-! Centered energy and the block scalar term that refinement preserves. +A blockwise descent applies to centered compressions, not to their full energy. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem cornerCentered_trace_all (p : AlgebraProjection M) (x : M.toStarSubalgebra) : + τ.trace (cornerCentered τ p x)=0 := by + by_cases hp : p.val=0 + · simp only [cornerCentered,hp,zero_mul,mul_zero,smul_zero,sub_zero] + exact inner_zero_right _ + · exact cornerCentered_trace τ p hp x + +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) + +theorem pinch_centered_trace (x : M.toStarSubalgebra) : + τ.trace (Q.pinch (cornerCentered τ p x))=0 := by + rw [Q.pinch_trace τ,(cornerCentered_support τ p x).1, + (cornerCentered_support τ p x).2,cornerCentered_trace_all] + +theorem pinch_centered_orthogonal (x : M.toStarSubalgebra) (c : ℂ) : + inner ℂ (baseVector τ (c • p.val)) + (baseVector τ (Q.pinch (cornerCentered τ p x))) = 0 := by + rw [map_smul,inner_smul_left,baseVector_inner_trace,p.property.isSelfAdjoint.star_eq, + (Q.pinch_support _).1,Q.pinch_centered_trace τ] + simp + +/-- Pinching energy is centered energy plus the unchanged corner scalar energy. -/ +theorem pinch_scalar_energy (x : M.toStarSubalgebra) : + τ.norm₂ (Q.pinch x)^2 = τ.norm₂ (Q.pinch (cornerCentered τ p x))^2 + + ‖cornerScalar τ p x‖^2 * (τ.trace p.val).re := by + have h := norm_add_sq_eq_norm_sq_add_norm_sq_of_inner_eq_zero + (baseVector τ (cornerScalar τ p x • p.val)) + (baseVector τ (Q.pinch (cornerCentered τ p x))) + (Q.pinch_centered_orthogonal τ x _) + rw [← map_add,Q.pinch_cornerCentered τ] at h + have he : cornerScalar τ p x • p.val + + (Q.pinch x-cornerScalar τ p x • p.val) = Q.pinch x := by abel + rw [he,← Q.pinch_cornerCentered τ] at h + change τ.norm₂ (Q.pinch x)*τ.norm₂ (Q.pinch x) = + τ.norm₂ (cornerScalar τ p x • p.val)*τ.norm₂ (cornerScalar τ p x • p.val) + + τ.norm₂ (Q.pinch (cornerCentered τ p x))*τ.norm₂ (Q.pinch (cornerCentered τ p x)) at h + rw [τ.norm₂_smul] at h + rw [projection_trace_sq τ p.val p.property] + nlinarith only [h] + +theorem scalar_energy_le_pinch (x : M.toStarSubalgebra) : + ‖cornerScalar τ p x‖^2 * (τ.trace p.val).re ≤ τ.norm₂ (Q.pinch x)^2 := by + rw [Q.pinch_scalar_energy τ] + exact le_add_of_nonneg_left (sq_nonneg _) + +end CornerPartition + +end + +/-! Energy of compatible block refinements, including the scalar term. +The scalar term is necessary even when the original operator has trace zero. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) +variable (R : (i : Fin Q.size) → CornerPartition (Q.piece i)) + +/-- The part of the compression energy fixed by the current block traces. -/ +def scalarEnergy (x : M.toStarSubalgebra) : ℝ := + ∑ i, ‖cornerScalar τ (Q.piece i) x‖^2 * (τ.trace (Q.piece i).val).re + +theorem scalarEnergy_nonneg (x : M.toStarSubalgebra) : 0 ≤ Q.scalarEnergy τ x := by + apply Finset.sum_nonneg + intro i _ + exact mul_nonneg (sq_nonneg _) (by rw [projection_trace_sq τ _ (Q.piece i).property]; positivity) + +theorem refineBlocks_scalar_energy (x : M.toStarSubalgebra) : + τ.norm₂ ((Q.refineBlocks R).pinch x)^2 = + (∑ i, τ.norm₂ ((R i).pinch (cornerCentered τ (Q.piece i) x))^2) + Q.scalarEnergy τ x := by + rw [Q.refineBlocks_energy R τ] + simp only [scalarEnergy,← Finset.sum_add_distrib] + exact Finset.sum_congr rfl (fun i _ => (R i).pinch_scalar_energy τ x) + +theorem scalarEnergy_le_refineBlocks (x : M.toStarSubalgebra) : + Q.scalarEnergy τ x ≤ τ.norm₂ ((Q.refineBlocks R).pinch x)^2 := by + rw [Q.refineBlocks_scalar_energy τ R] + exact le_add_of_nonneg_left (Finset.sum_nonneg (fun _ _ => sq_nonneg _)) + +/-- Compatible descent bounds centered block energies and retains the full +coarse scalar term. In particular it does not multiply that term by c. -/ +theorem refineBlocks_descent (x : M.toStarSubalgebra) (c : ℝ) + (h : ∀ i, τ.norm₂ ((R i).pinch (cornerCentered τ (Q.piece i) x))^2 ≤ + c * τ.norm₂ (cornerCentered τ (Q.piece i) x)^2) : + τ.norm₂ ((Q.refineBlocks R).pinch x)^2 ≤ + c*(τ.norm₂ (Q.pinch x)^2-Q.scalarEnergy τ x)+Q.scalarEnergy τ x := by + have he : τ.norm₂ (Q.pinch x)^2 = + (∑ i, τ.norm₂ (cornerCentered τ (Q.piece i) x)^2)+Q.scalarEnergy τ x := by + rw [Q.pinch_energy τ] + have hi (i : Fin Q.size) : τ.norm₂ ((Q.piece i).val*x*(Q.piece i).val)^2 = + τ.norm₂ (cornerCentered τ (Q.piece i) x)^2+ + ‖cornerScalar τ (Q.piece i) x‖^2*(τ.trace (Q.piece i).val).re := by + have hh := (single (Q.piece i)).pinch_scalar_energy τ x + simpa only [single_pinch,(cornerCentered_support τ _ _).1, + (cornerCentered_support τ _ _).2] using hh + simp only [hi,Finset.sum_add_distrib,scalarEnergy] + rw [Q.refineBlocks_scalar_energy τ R,he,add_sub_cancel_right] + have hh := Finset.sum_le_sum (s := Finset.univ) (fun i _ => h i) + rw [← Finset.mul_sum] at hh + linarith only [hh] + +/-- A target below the current scalar term cannot be reached by refining +these blocks, regardless of the quality of centered local estimates. -/ +theorem no_refineBlocks_budget_below_scalar (x : M.toStarSubalgebra) (b : ℝ) + (hb : b ≤ Q.scalarEnergy τ x) : + ¬ τ.norm₂ ((Q.refineBlocks R).pinch x)^2 < b := + not_lt_of_ge (hb.trans (Q.scalarEnergy_le_refineBlocks τ R x)) + +end CornerPartition + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PredualContinuity.lean b/lean/OAI/Analysis/FactorGeneration/PredualContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..ba1b5e79dd23d51e9ece56b3b5722cd1f4bbaddf --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PredualContinuity.lean @@ -0,0 +1,188 @@ +import Mathlib.Analysis.SpecificLimits.Normed +import OAI.Analysis.FactorGeneration.MonotoneTrace +import OAI.Analysis.FactorGeneration.PredualRange + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Given-predual evaluations are uniformly small on operator order +intervals bounded by positive contractions with small trace. This is derived +from the constructed tail majorants, without assuming predual normality. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] M.toStarSubalgebra) + +theorem predual_summable_trace_sandwich (x : X) (a p : ℕ → M.toStarSubalgebra) + (hp : ∀ n, 0 ≤ (p n).val) (hpn : ∀ n, ‖p n‖ ≤ 1) + (hpt : Summable (fun n => (τ.trace (p n)).re)) + (hal : ∀ n, -(p n).val ≤ (a n).val) (hau : ∀ n, (a n).val ≤ (p n).val) : + Tendsto (fun n => predualFunctional M.toStarSubalgebra e x (a n)) atTop (𝓝 0) := by + obtain ⟨b, _, _, hbanti, hpb, _, hbg⟩ := exists_positive_trace_tail_majorants τ p hp hpn hpt + exact predualFunctional_order_squeeze_tendsto_zero M.toStarSubalgebra e x a b hbanti hbg + (fun n => (neg_le_neg (hpb n)).trans (hal n)) (fun n => (hau n).trans (hpb n)) + +theorem predual_small_of_small_trace_sandwich (x : X) (ε : ℝ) (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ ∀ a p : M.toStarSubalgebra, + 0 ≤ p.val → ‖p‖ ≤ 1 → (τ.trace p).re < δ → + -p.val ≤ a.val → a.val ≤ p.val → + ‖predualFunctional M.toStarSubalgebra e x a‖ < ε := by + by_contra h + push Not at h + have hseq (n : ℕ) := h ((1/2 : ℝ)^n) (pow_pos (by norm_num) n) + choose a p hp hpn hpt hal hau hbad using hseq + have hsum : Summable (fun n => (τ.trace (p n)).re) := + Summable.of_nonneg_of_le (fun n => ambient_trace_nonneg τ _ (hp n)) + (fun n => (hpt n).le) (summable_geometric_of_norm_lt_one (by norm_num : ‖(1/2 : ℝ)‖ < 1)) + have ht := predual_summable_trace_sandwich τ e x a p hp hpn hsum hal hau + have he := Metric.tendsto_nhds.mp ht ε hε + obtain ⟨n, hn⟩ := he.exists + exact (not_lt_of_ge (hbad n)) (by simpa only [dist_zero_right] using hn) + +theorem predual_trace_sandwich_tendsto_zero {I : Type*} {l : Filter I} + (x : X) (a p : I → M.toStarSubalgebra) + (hp : ∀ i, 0 ≤ (p i).val) (hpn : ∀ i, ‖p i‖ ≤ 1) + (hpt : Tendsto (fun i => (τ.trace (p i)).re) l (𝓝 0)) + (hal : ∀ i, -(p i).val ≤ (a i).val) (hau : ∀ i, (a i).val ≤ (p i).val) : + Tendsto (fun i => predualFunctional M.toStarSubalgebra e x (a i)) l (𝓝 0) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + obtain ⟨δ, hδ, hsmall⟩ := predual_small_of_small_trace_sandwich τ e x ε hε + filter_upwards [hpt.eventually (gt_mem_nhds hδ)] with i hi + simpa only [dist_zero_right] using hsmall (a i) (p i) (hp i) (hpn i) hi (hal i) (hau i) + +/-! Given-predual evaluation is uniformly trace-two-norm continuous on every +operator-norm bounded ball. No WOT continuity premise is used. -/ + +theorem predual_small_of_small_norm₂_selfAdjoint (x : X) (ε : ℝ) (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ ∀ a : M.toStarSubalgebra, + IsSelfAdjoint a.val → ‖a‖ ≤ 1 → τ.norm₂ a < δ → + ‖predualFunctional M.toStarSubalgebra e x a‖ < ε := by + obtain ⟨δ, hδ, hs⟩ := predual_small_of_small_trace_sandwich τ e x ε hε + refine ⟨δ, hδ, fun a ha hn ht => hs a (ambientAbsoluteValue a) + (ambientAbsoluteValue_nonneg a) ?_ ?_ (ambient_neg_absoluteValue_le a ha) + (ambient_le_absoluteValue a ha)⟩ + · exact (ambientAbsoluteValue_norm a).le.trans hn + · exact (ambientAbsoluteValue_trace_le_norm₂ τ a).trans_lt ht + +theorem predual_small_of_small_norm₂ (x : X) (ε : ℝ) (hε : 0 < ε) : + ∃ δ : ℝ, 0 < δ ∧ ∀ a : M.toStarSubalgebra, + ‖a‖ ≤ 1 → τ.norm₂ a < δ → + ‖predualFunctional M.toStarSubalgebra e x a‖ < ε := by + obtain ⟨δ, hδ, hs⟩ := predual_small_of_small_norm₂_selfAdjoint τ e x (ε/2) (by positivity) + refine ⟨δ, hδ, ?_⟩ + intro a hn ht + have hrsa : IsSelfAdjoint ((realPart a : M.toStarSubalgebra).val) := + congrArg (fun b : M.toStarSubalgebra => b.val) (realPart a).property + have hisa : IsSelfAdjoint ((imaginaryPart a : M.toStarSubalgebra).val) := + congrArg (fun b : M.toStarSubalgebra => b.val) (imaginaryPart a).property + have hr := hs (realPart a) hrsa ((realPart.norm_le a).trans hn) + ((norm₂_realPart_le τ a).trans_lt ht) + have hi := hs (imaginaryPart a) hisa ((imaginaryPart.norm_le a).trans hn) + ((norm₂_imaginaryPart_le τ a).trans_lt ht) + let f := predualFunctional M.toStarSubalgebra e x + have he : f a = f (realPart a) + Complex.I * f (imaginaryPart a) := by + change f a = f (realPart a) + Complex.I • f (imaginaryPart a) + rw [← map_smul, ← map_add, realPart_add_I_smul_imaginaryPart] + rw [he] + have hb := norm_add_le (f (realPart a)) (Complex.I * f (imaginaryPart a)) + rw [norm_mul, Complex.norm_I, one_mul] at hb + exact hb.trans_lt (by linarith) + +theorem predual_norm₂_tendsto_zero_unitBall {I : Type*} {l : Filter I} + (x : X) (a : I → M.toStarSubalgebra) (hn : ∀ i, ‖a i‖ ≤ 1) + (ht : Tendsto (fun i => τ.norm₂ (a i)) l (𝓝 0)) : + Tendsto (fun i => predualFunctional M.toStarSubalgebra e x (a i)) l (𝓝 0) := by + apply Metric.tendsto_nhds.mpr + intro ε hε + obtain ⟨δ, hδ, hs⟩ := predual_small_of_small_norm₂ τ e x ε hε + filter_upwards [ht.eventually (gt_mem_nhds hδ)] with i hi + simpa only [dist_zero_right] using hs (a i) (hn i) hi + +theorem predual_norm₂_tendsto_zero {I : Type*} {l : Filter I} + (x : X) (a : I → M.toStarSubalgebra) (C : ℝ) (hn : ∀ i, ‖a i‖ ≤ C) + (ht : Tendsto (fun i => τ.norm₂ (a i)) l (𝓝 0)) : + Tendsto (fun i => predualFunctional M.toStarSubalgebra e x (a i)) l (𝓝 0) := by + let D : ℝ := |C|+1 + have hD : 0 < D := by dsimp [D]; positivity + have hDn : ‖((D⁻¹ : ℝ) : ℂ)‖ = D⁻¹ := by + rw [Complex.norm_real, Real.norm_of_nonneg (inv_nonneg.mpr hD.le)] + let b (i : I) : M.toStarSubalgebra := ((D⁻¹ : ℝ) : ℂ) • a i + have hb (i : I) : ‖b i‖ ≤ 1 := by + change ‖((D⁻¹ : ℝ) : ℂ) • a i‖ ≤ 1 + rw [norm_smul, hDn] + apply (inv_mul_le_iff₀ hD).mpr + rw [mul_one] + exact (hn i).trans ((le_abs_self C).trans (le_add_of_nonneg_right zero_le_one)) + have hbt : Tendsto (fun i => τ.norm₂ (b i)) l (𝓝 0) := by + simpa only [b, τ.norm₂_smul, hDn, mul_zero] using ht.const_mul D⁻¹ + have h := (predual_norm₂_tendsto_zero_unitBall τ e x b hb hbt).const_smul (D : ℂ) + have he (i : I) : (D : ℂ) • predualFunctional M.toStarSubalgebra e x (b i) = + predualFunctional M.toStarSubalgebra e x (a i) := by + rw [← map_smul] + congr 1 + simp only [b, smul_smul, ← Complex.ofReal_mul, mul_inv_cancel₀ hD.ne', + Complex.ofReal_one, one_smul] + simpa only [he, smul_zero] using h + +theorem predual_norm₂_tendsto {I : Type*} {l : Filter I} + (x : X) (a : I → M.toStarSubalgebra) (b : M.toStarSubalgebra) + (C : ℝ) (hn : ∀ i, ‖a i‖ ≤ C) + (ht : Tendsto (fun i => τ.norm₂ (a i-b)) l (𝓝 0)) : + Tendsto (fun i => predualFunctional M.toStarSubalgebra e x (a i)) l + (𝓝 (predualFunctional M.toStarSubalgebra e x b)) := by + have h := predual_norm₂_tendsto_zero τ e x (fun i => a i-b) (C+‖b‖) + (fun i => (norm_sub_le _ _).trans (_root_.add_le_add (hn i) le_rfl)) ht + simpa only [map_sub, tendsto_sub_nhds_zero_iff] using h + +end + +/-! Every evaluation from the given Banach predual belongs to the constructed +cyclic predual. In particular, the original separable-predual hypothesis +supplies trace-orbit separability without an additional continuity premise. -/ +open UltrapowerBridge +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] M.toStarSubalgebra) + +include τ in +theorem predualFunctional_unitBall_continuous (x : X) : + Continuous (fun T : weakOperatorBall M 1 => + predualFunctional M.toStarSubalgebra e x ⟨T.val.toCLM, T.property.1⟩) := by + let f := predualFunctional M.toStarSubalgebra e x + have hr := unitBall_functional_continuous_of_norm₂ τ + (Complex.reCLM.comp (f.restrictScalars ℝ)) (fun a b hn ht => + Complex.continuous_re.tendsto _ |>.comp (predual_norm₂_tendsto τ e x a b 1 hn ht)) + have hi := unitBall_functional_continuous_of_norm₂ τ + (Complex.imCLM.comp (f.restrictScalars ℝ)) (fun a b hn ht => + Complex.continuous_im.tendsto _ |>.comp (predual_norm₂_tendsto τ e x a b 1 hn ht)) + have h := (Complex.continuous_ofReal.comp hr).add + ((Complex.continuous_ofReal.comp hi).mul (continuous_const (y := Complex.I))) + change Continuous (fun T : weakOperatorBall M 1 => + ((f ⟨T.val.toCLM, T.property.1⟩).re : ℂ) + + ((f ⟨T.val.toCLM, T.property.1⟩).im : ℂ) * Complex.I) at h + simpa only [Complex.re_add_im] using h + +theorem predualFunctional_mem_cyclicPredual (x : X) : + predualFunctional M.toStarSubalgebra e x ∈ cyclicPredual τ := + mem_cyclicPredual_of_unitBall_continuous τ _ (predualFunctional_unitBall_continuous τ e x) + +theorem traceOrbit_isSeparable_of_separablePredual + (hsep : HasSeparablePredual M.toStarSubalgebra) : + TopologicalSpace.IsSeparable (Set.range (baseVector τ)) := by + obtain ⟨X, g, s, c, hs, ⟨e⟩⟩ := hsep + exact traceOrbit_isSeparable_of_given_membership τ e (predualFunctional_mem_cyclicPredual τ e) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PredualOrder.lean b/lean/OAI/Analysis/FactorGeneration/PredualOrder.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef78560c81546741f974c7e0164dd93385179090 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PredualOrder.lean @@ -0,0 +1,528 @@ +import Mathlib.Algebra.Star.Subalgebra +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Analysis.InnerProductSpace.StarOrder +import Mathlib.Analysis.Normed.Module.HahnBanach +import Mathlib.Analysis.Normed.Module.WeakDual +import Mathlib.Analysis.Normed.Operator.LinearIsometry +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Operator norm geometry for the original existential Banach-predual gap. +These statements use only concrete Hilbert operators. They do not identify +any predual or prove trace-orbit separability. -/ +section +open scoped ComplexConjugate +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + +theorem norm_imaginary_shift_apply_sq (A : H →L[ℂ] H) (t : ℝ) (x : H) : + ‖(A + ((t : ℂ)*Complex.I) • 1) x‖^2 = + ‖A x‖^2 - 2*t*(inner ℂ (A x) x).im + t^2*‖x‖^2 := by + change ‖A x + ((t : ℂ)*Complex.I) • x‖^2 = _ + rw [norm_add_sq (𝕜 := ℂ),inner_smul_right] + change ‖A x‖^2 + 2*((t : ℂ)*Complex.I*inner ℂ (A x) x).re + + ‖((t : ℂ)*Complex.I) • x‖^2 = _ + simp only [ + Complex.mul_re,Complex.mul_im,Complex.ofReal_re,Complex.ofReal_im, + Complex.I_re,Complex.I_im,zero_mul,mul_zero,sub_zero,add_zero,mul_one, + norm_smul,norm_mul,Complex.norm_real,Complex.norm_I,mul_pow, + Real.norm_eq_abs,sq_abs] + ring + +variable [CompleteSpace H] + +/-- Self-adjointness and a norm bound are characterized by translated norm balls. -/ +theorem selfAdjoint_norm_le_iff_imaginary_shifts (A : H →L[ℂ] H) (C : ℝ) (hC : 0 ≤ C) : + (IsSelfAdjoint A ∧ ‖A‖ ≤ C) ↔ + ∀ t : ℝ, ‖A + ((t : ℂ)*Complex.I) • 1‖ ≤ Real.sqrt (C^2+t^2) := by + constructor + · rintro ⟨ha,hn⟩ t + apply ContinuousLinearMap.opNorm_le_bound _ (Real.sqrt_nonneg _) + intro x + have hi : (inner ℂ (A x) x).im = 0 := by + have h := congrArg Complex.im + ((LinearMap.isSymmetric_iff_inner_map_self_real A.toLinearMap).mp ha.isSymmetric x) + simp only [Complex.conj_im,ContinuousLinearMap.coe_coe] at h + linarith + have hx := (A.le_opNorm x).trans (mul_le_mul_of_nonneg_right hn (norm_nonneg x)) + have hsq := (sq_le_sq₀ (norm_nonneg _) (mul_nonneg hC (norm_nonneg x))).mpr hx + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg x))).mp + rw [norm_imaginary_shift_apply_sq,hi,mul_zero,sub_zero,mul_pow, + Real.sq_sqrt (by positivity : 0 ≤ C^2+t^2)] + nlinarith + · intro h + have hn : ‖A‖ ≤ C := by + simpa only [Complex.ofReal_zero,zero_mul,zero_smul,add_zero,zero_pow (by decide : 2 ≠ 0), + Real.sqrt_sq hC] using h 0 + refine ⟨?_,hn⟩ + apply ContinuousLinearMap.isSelfAdjoint_iff_isSymmetric.mpr + apply (LinearMap.isSymmetric_iff_inner_map_self_real A.toLinearMap).mpr + intro x + have hb (t : ℝ) : -2*t*(inner ℂ (A x) x).im ≤ C^2*‖x‖^2 := by + have hx := ((A + ((t : ℂ)*Complex.I) • 1).le_opNorm x).trans + (mul_le_mul_of_nonneg_right (h t) (norm_nonneg x)) + have hs := (sq_le_sq₀ (norm_nonneg _) + (mul_nonneg (Real.sqrt_nonneg _) (norm_nonneg x))).mpr hx + rw [norm_imaginary_shift_apply_sq,mul_pow, + Real.sq_sqrt (by positivity : 0 ≤ C^2+t^2)] at hs + nlinarith [sq_nonneg ‖A x‖] + have hi : (inner ℂ (A x) x).im = 0 := by + by_contra hi + have ht := hb ((C^2*‖x‖^2+1)/(-2*(inner ℂ (A x) x).im)) + have he : -2*((C^2*‖x‖^2+1)/(-2*(inner ℂ (A x) x).im)) * + (inner ℂ (A x) x).im = C^2*‖x‖^2+1 := by + field_simp [hi] + rw [he] at ht + linarith + apply Complex.ext + · rfl + · simp only [Complex.conj_im,ContinuousLinearMap.coe_coe,hi,neg_zero] + +end + +/-! Bounded self-adjoint sets are weak-star compact for the actual Banach +predual isometry. No predual uniqueness or WOT compatibility is assumed. -/ +section +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) (C : ℝ) (hC : 0 ≤ C) + +include hC + +/-- The self-adjoint ball pulled back to the given weak-star dual is closed. -/ +theorem predual_selfAdjointBall_isClosed : + IsClosed {φ : WeakDual ℂ X | + IsSelfAdjoint (e (WeakDual.toStrongDual φ)).val ∧ ‖e (WeakDual.toStrongDual φ)‖ ≤ C} := by + have he : {φ : WeakDual ℂ X | + IsSelfAdjoint (e (WeakDual.toStrongDual φ)).val ∧ ‖e (WeakDual.toStrongDual φ)‖ ≤ C} = + ⋂ t : ℝ, WeakDual.toStrongDual ⁻¹' + Metric.closedBall (-e.symm (((t : ℂ)*Complex.I) • (1 : S))) (Real.sqrt (C^2+t^2)) := by + ext φ + simp only [Set.mem_iInter,Set.mem_preimage,Metric.mem_closedBall,dist_eq_norm,sub_neg_eq_add] + change (IsSelfAdjoint (e (WeakDual.toStrongDual φ)).val ∧ + ‖(e (WeakDual.toStrongDual φ)).val‖ ≤ C) ↔ _ + rw [selfAdjoint_norm_le_iff_imaginary_shifts _ C hC] + apply forall_congr' + intro t + rw [← e.norm_map (WeakDual.toStrongDual φ + e.symm (((t : ℂ)*Complex.I) • (1 : S))), + map_add,e.apply_symm_apply] + rfl + rw [he] + exact isClosed_iInter (fun t => WeakDual.isClosed_closedBall _ _) + +/-- The same set is compact without adding continuity of the algebra isometry. -/ +theorem predual_selfAdjointBall_isCompact : + IsCompact {φ : WeakDual ℂ X | + IsSelfAdjoint (e (WeakDual.toStrongDual φ)).val ∧ ‖e (WeakDual.toStrongDual φ)‖ ≤ C} := by + apply (WeakDual.isCompact_closedBall (0 : StrongDual ℂ X) C).of_isClosed_subset + (predual_selfAdjointBall_isClosed S e C hC) + intro φ hφ + change dist (WeakDual.toStrongDual φ) 0 ≤ C + rw [dist_zero_right,← e.norm_map] + exact hφ.2 + +end + +/-! Positive operator balls are compact in the weak-star topology of the +given Banach predual. The isometry is not assumed weak-operator continuous. -/ +section +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] + +/-- Positivity on a bounded self-adjoint ball is one more translated norm bound. -/ +theorem positive_norm_le_iff_real_shift (A : H →L[ℂ] H) (C : ℝ) (hC : 0 ≤ C) : + (A.IsPositive ∧ ‖A‖ ≤ C) ↔ + (IsSelfAdjoint A ∧ ‖A‖ ≤ C ∧ ‖A - (C : ℂ) • 1‖ ≤ C) := by + have hc : algebraMap ℝ (H →L[ℂ] H) C = (C : ℂ) • 1 := by + ext x + simp + have hsa : IsSelfAdjoint (algebraMap ℝ (H →L[ℂ] H) C) := + (isSelfAdjoint_iff.mpr (star_trivial C)).algebraMap _ + constructor + · rintro ⟨hp, hn⟩ + have ha := ContinuousLinearMap.nonneg_iff_isPositive.mpr hp + have hupper := (CStarAlgebra.norm_le_iff_le_algebraMap A hC ha).mp hn + have hdiff : 0 ≤ algebraMap ℝ (H →L[ℂ] H) C - A := sub_nonneg.mpr hupper + refine ⟨IsSelfAdjoint.of_nonneg ha, hn, ?_⟩ + rw [← hc, norm_sub_rev] + exact (CStarAlgebra.norm_le_iff_le_algebraMap _ hC hdiff).mpr + (sub_le_self _ ha) + · rintro ⟨ha, hn, hd⟩ + rw [← hc] at hd + have hlo := (ha.sub hsa).neg_algebraMap_norm_le_self + have hm := neg_le_neg (algebraMap_mono (H →L[ℂ] H) hd) + have h : -(algebraMap ℝ (H →L[ℂ] H) C) ≤ + A - algebraMap ℝ (H →L[ℂ] H) C := hm.trans hlo + refine ⟨ContinuousLinearMap.nonneg_iff_isPositive.mp ?_, hn⟩ + simpa only [neg_add_cancel, sub_add_cancel, add_neg_cancel, + ← add_sub_assoc, add_sub_cancel_left] using + add_le_add_right h (algebraMap ℝ (H →L[ℂ] H) C) + +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) (C : ℝ) (hC : 0 ≤ C) + +include hC + +/-- Positive balls are weak-star closed for the actual given predual. -/ +theorem predual_positiveBall_isClosed : + IsClosed {φ : WeakDual ℂ X | + ContinuousLinearMap.IsPositive (e (WeakDual.toStrongDual φ)).val ∧ + ‖e (WeakDual.toStrongDual φ)‖ ≤ C} := by + have he : {φ : WeakDual ℂ X | + ContinuousLinearMap.IsPositive (e (WeakDual.toStrongDual φ)).val ∧ + ‖e (WeakDual.toStrongDual φ)‖ ≤ C} = + {φ : WeakDual ℂ X | + IsSelfAdjoint (e (WeakDual.toStrongDual φ)).val ∧ + ‖e (WeakDual.toStrongDual φ)‖ ≤ C} ∩ + (WeakDual.toStrongDual ⁻¹' Metric.closedBall (e.symm ((C : ℂ) • (1 : S))) C) := by + ext φ + simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, Set.mem_preimage, + Metric.mem_closedBall, dist_eq_norm] + rw [← e.norm_map (WeakDual.toStrongDual φ - e.symm ((C : ℂ) • (1 : S))), + map_sub, e.apply_symm_apply] + change (_ ∧ ‖(e (WeakDual.toStrongDual φ)).val‖ ≤ C) ↔ _ + rw [positive_norm_le_iff_real_shift _ C hC] + exact and_assoc.symm + rw [he] + exact (predual_selfAdjointBall_isClosed S e C hC).inter + (WeakDual.isClosed_closedBall _ _) + +/-- Banach--Alaoglu compactness for positive operator balls in the given predual. -/ +theorem predual_positiveBall_isCompact : + IsCompact {φ : WeakDual ℂ X | + ContinuousLinearMap.IsPositive (e (WeakDual.toStrongDual φ)).val ∧ + ‖e (WeakDual.toStrongDual φ)‖ ≤ C} := by + apply (WeakDual.isCompact_closedBall (0 : StrongDual ℂ X) C).of_isClosed_subset + (predual_positiveBall_isClosed S e C hC) + intro φ hφ + change dist (WeakDual.toStrongDual φ) 0 ≤ C + rw [dist_zero_right, ← e.norm_map] + exact hφ.2 + +end + +/-! Closed and compact order intervals for the given Banach predual. +All inequalities are the concrete operator Loewner order. -/ +section +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) + +/-- A positive order interval is the intersection of two translated positive balls. -/ +theorem predual_zeroInterval_eq (b : S) : + {φ : WeakDual ℂ X | 0 ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val} = + {φ : WeakDual ℂ X | + ContinuousLinearMap.IsPositive (e (WeakDual.toStrongDual φ)).val ∧ + ‖e (WeakDual.toStrongDual φ)‖ ≤ ‖b‖} ∩ + (fun φ : WeakDual ℂ X => StrongDual.toWeakDual (e.symm b) - φ) ⁻¹' + {φ : WeakDual ℂ X | + ContinuousLinearMap.IsPositive (e (WeakDual.toStrongDual φ)).val ∧ + ‖e (WeakDual.toStrongDual φ)‖ ≤ ‖b‖} := by + ext φ + simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, Set.mem_preimage, map_sub, + StrongDual.toStrongDual_toWeakDual, e.apply_symm_apply] + change (0 ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val) ↔ + ((e (WeakDual.toStrongDual φ)).val.IsPositive ∧ + ‖(e (WeakDual.toStrongDual φ)).val‖ ≤ ‖b.val‖) ∧ + (b.val - (e (WeakDual.toStrongDual φ)).val).IsPositive ∧ + ‖b.val - (e (WeakDual.toStrongDual φ)).val‖ ≤ ‖b.val‖ + simp only [← ContinuousLinearMap.nonneg_iff_isPositive] + constructor + · rintro ⟨ha, hab⟩ + have hd := sub_nonneg.mpr hab + exact ⟨⟨ha, CStarAlgebra.norm_le_norm_of_le_of_nonneg hab ha⟩, + hd, CStarAlgebra.norm_le_norm_of_le_of_nonneg (sub_le_self _ ha) hd⟩ + · rintro ⟨⟨ha, _⟩, hd, _⟩ + exact ⟨ha, sub_nonneg.mp hd⟩ + +theorem predual_zeroInterval_isClosed (b : S) : + IsClosed {φ : WeakDual ℂ X | 0 ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val} := by + rw [predual_zeroInterval_eq S e b] + exact (predual_positiveBall_isClosed S e ‖b‖ (norm_nonneg b)).inter + ((predual_positiveBall_isClosed S e ‖b‖ (norm_nonneg b)).preimage + (continuous_const.sub continuous_id)) + +theorem predual_zeroInterval_isCompact (b : S) : + IsCompact {φ : WeakDual ℂ X | 0 ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val} := by + apply (WeakDual.isCompact_closedBall (0 : StrongDual ℂ X) ‖b‖).of_isClosed_subset + (predual_zeroInterval_isClosed S e b) + intro φ hφ + change dist (WeakDual.toStrongDual φ) 0 ≤ ‖b‖ + rw [dist_zero_right, ← e.norm_map] + exact CStarAlgebra.norm_le_norm_of_le_of_nonneg hφ.2 hφ.1 + +/-- Translate an arbitrary interval to one with lower endpoint zero. -/ +theorem predual_orderInterval_eq (a b : S) : + {φ : WeakDual ℂ X | a.val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val} = + (fun φ : WeakDual ℂ X => φ - StrongDual.toWeakDual (e.symm a)) ⁻¹' + {φ : WeakDual ℂ X | 0 ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ (b-a).val} := by + ext φ + simp only [Set.mem_ofPred_eq, Set.mem_preimage, map_sub, + StrongDual.toStrongDual_toWeakDual, e.apply_symm_apply] + change (a.val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val) ↔ + (0 ≤ (e (WeakDual.toStrongDual φ)).val - a.val ∧ + (e (WeakDual.toStrongDual φ)).val - a.val ≤ b.val - a.val) + rw [sub_nonneg, sub_le_sub_iff_right] + +theorem predual_orderInterval_isClosed (a b : S) : + IsClosed {φ : WeakDual ℂ X | a.val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val} := by + rw [predual_orderInterval_eq S e a b] + exact (predual_zeroInterval_isClosed S e (b-a)).preimage + (continuous_id.sub continuous_const) + +theorem predual_orderInterval_isCompact (a b : S) : + IsCompact {φ : WeakDual ℂ X | a.val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ b.val} := by + apply (WeakDual.isCompact_closedBall (0 : StrongDual ℂ X) + (‖b-a‖+‖a‖)).of_isClosed_subset (predual_orderInterval_isClosed S e a b) + intro φ hφ + change dist (WeakDual.toStrongDual φ) 0 ≤ ‖b-a‖+‖a‖ + rw [dist_zero_right, ← e.norm_map] + have hd : ‖(e (WeakDual.toStrongDual φ)).val-a.val‖ ≤ ‖b.val-a.val‖ := + CStarAlgebra.norm_le_norm_of_le_of_nonneg (sub_le_sub_right hφ.2 a.val) + (sub_nonneg.mpr hφ.1) + calc + ‖e (WeakDual.toStrongDual φ)‖ = + ‖((e (WeakDual.toStrongDual φ)).val-a.val)+a.val‖ := by rw [sub_add_cancel]; rfl + _ ≤ ‖(e (WeakDual.toStrongDual φ)).val-a.val‖+‖a.val‖ := norm_add_le _ _ + _ ≤ ‖b-a‖+‖a‖ := add_le_add hd le_rfl + +end + +/-! Monotone order limits in the algebra converge for the actual given +Banach predual. Greatest/least bounds are tested only against members of S, +not against all ambient operators. -/ +section +open Filter +open scoped Topology +variable {H X I : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) +variable [Preorder I] [Nonempty I] + +/-- A decreasing net converges weak-star to its greatest lower bound in S. -/ +theorem predual_antitone_tendsto (a : I → S) (l : S) + (hanti : Antitone (fun i => (a i).val)) + (hlower : ∀ i, l.val ≤ (a i).val) + (hgreatest : ∀ b : S, (∀ i, b.val ≤ (a i).val) → b.val ≤ l.val) : + Tendsto (fun i => StrongDual.toWeakDual (e.symm (a i))) atTop + (𝓝 (StrongDual.toWeakDual (e.symm l))) := by + let u : I → WeakDual ℂ X := fun i => StrongDual.toWeakDual (e.symm (a i)) + have hu (i : I) : ∀ᶠ j in atTop, + u j ∈ {φ : WeakDual ℂ X | l.val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ (a i).val} := by + filter_upwards [eventually_ge_atTop i] with j hj + simpa only [u, Set.mem_ofPred_eq, StrongDual.toStrongDual_toWeakDual, + e.apply_symm_apply] using And.intro (hlower j) (hanti hj) + inhabit I + apply (predual_orderInterval_isCompact S e l (a default)).tendsto_nhds_of_unique_mapClusterPt + (hu default) + intro φ hφ hc + have hbound (i : I) := (predual_orderInterval_isClosed S e l (a i)).mem_of_mapClusterPt + hc (hu i) + apply WeakDual.toStrongDual.injective + apply e.injective + apply Subtype.ext + simpa only [StrongDual.toStrongDual_toWeakDual, e.apply_symm_apply] using + le_antisymm (hgreatest (e (WeakDual.toStrongDual φ)) (fun i => (hbound i).2)) hφ.1 + +/-- An increasing net converges weak-star to its least upper bound in S. -/ +theorem predual_monotone_tendsto (a : I → S) (l : S) + (hmono : Monotone (fun i => (a i).val)) + (hupper : ∀ i, (a i).val ≤ l.val) + (hleast : ∀ b : S, (∀ i, (a i).val ≤ b.val) → l.val ≤ b.val) : + Tendsto (fun i => StrongDual.toWeakDual (e.symm (a i))) atTop + (𝓝 (StrongDual.toWeakDual (e.symm l))) := by + let u : I → WeakDual ℂ X := fun i => StrongDual.toWeakDual (e.symm (a i)) + have hu (i : I) : ∀ᶠ j in atTop, + u j ∈ {φ : WeakDual ℂ X | (a i).val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ l.val} := by + filter_upwards [eventually_ge_atTop i] with j hj + simpa only [u, Set.mem_ofPred_eq, StrongDual.toStrongDual_toWeakDual, + e.apply_symm_apply] using And.intro (hmono hj) (hupper j) + inhabit I + apply (predual_orderInterval_isCompact S e (a default) l).tendsto_nhds_of_unique_mapClusterPt + (hu default) + intro φ hφ hc + have hbound (i : I) := (predual_orderInterval_isClosed S e (a i) l).mem_of_mapClusterPt + hc (hu i) + apply WeakDual.toStrongDual.injective + apply e.injective + apply Subtype.ext + simpa only [StrongDual.toStrongDual_toWeakDual, e.apply_symm_apply] using + le_antisymm hφ.2 (hleast (e (WeakDual.toStrongDual φ)) (fun i => (hbound i).1)) + +/-- In particular, decreasing positive nets with infimum zero tend weak-star to zero. -/ +theorem predual_antitone_tendsto_zero (a : I → S) + (hanti : Antitone (fun i => (a i).val)) + (hpos : ∀ i, 0 ≤ (a i).val) + (hgreatest : ∀ b : S, (∀ i, b.val ≤ (a i).val) → b.val ≤ 0) : + Tendsto (fun i => StrongDual.toWeakDual (e.symm (a i))) atTop (𝓝 0) := by + simpa only [map_zero] using predual_antitone_tendsto S e a 0 hanti hpos hgreatest + +end + +/-! The actual given predual embeds isometrically into the norm dual of S. +Conjugation accounts for the conjugate-linear predual isometry. These +functionals preserve monotone order limits. No canonical-predual membership +or weak-operator continuity is assumed. -/ +section +open Filter +open scoped Topology ComplexConjugate +variable {H X I : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) + +/-- Evaluation by x, made complex-linear in the algebra argument. -/ +def predualFunctional (x : X) : StrongDual ℂ S := + LinearMap.mkContinuous + { toFun := fun a => conj (e.symm a x) + map_add' := by intros; simp + map_smul' := by + intro c a + rw [e.symm.map_smulₛₗ] + simp } + ‖x‖ (by + intro a + change ‖conj (e.symm a x)‖ ≤ ‖x‖ * ‖a‖ + simp only [Complex.norm_conj] + exact ((e.symm a).le_opNorm x).trans_eq (by rw [e.symm.norm_map, mul_comm])) + +@[simp] theorem predualFunctional_apply (x : X) (a : S) : + predualFunctional S e x a = conj (e.symm a x) := rfl + +theorem predualFunctional_norm (x : X) : ‖predualFunctional S e x‖ = ‖x‖ := by + apply le_antisymm + · apply (predualFunctional S e x).opNorm_le_bound (norm_nonneg x) + intro a + rw [predualFunctional_apply, Complex.norm_conj] + exact ((e.symm a).le_opNorm x).trans_eq (by rw [e.symm.norm_map, mul_comm]) + · obtain ⟨g, hg, hx⟩ := exists_dual_vector'' ℂ x + calc + ‖x‖ = ‖predualFunctional S e x (e g)‖ := by simp [hx] + _ ≤ ‖predualFunctional S e x‖ * ‖e g‖ := (predualFunctional S e x).le_opNorm _ + _ ≤ ‖predualFunctional S e x‖ := by + simpa only [e.norm_map, mul_one] using + mul_le_mul_of_nonneg_left hg (norm_nonneg (predualFunctional S e x)) + +/-- A conjugate-linear isometric embedding of the actual given predual. -/ +def predualFunctionalIsometry : X →ₗᵢ⋆[ℂ] StrongDual ℂ S where + toFun := predualFunctional S e + map_add' x y := by ext a; simp + map_smul' c x := by ext a; simp + norm_map' := predualFunctional_norm S e + +/-- Given-predual evaluation functionals separate every two algebra elements. -/ +theorem predualFunctional_separates (a b : S) + (h : ∀ x : X, predualFunctional S e x a = predualFunctional S e x b) : a = b := by + apply e.symm.injective + ext x + exact (starRingEnd ℂ).injective (h x) + +variable [Preorder I] [Nonempty I] + +/-- The embedded functional preserves decreasing order limits in S. -/ +theorem predualFunctional_antitone_tendsto (x : X) (a : I → S) (l : S) + (hanti : Antitone (fun i => (a i).val)) + (hlower : ∀ i, l.val ≤ (a i).val) + (hgreatest : ∀ b : S, (∀ i, b.val ≤ (a i).val) → b.val ≤ l.val) : + Tendsto (fun i => predualFunctional S e x (a i)) atTop + (𝓝 (predualFunctional S e x l)) := by + exact (Complex.continuous_conj.tendsto _).comp + ((WeakDual.eval_continuous x).tendsto _ |>.comp + (predual_antitone_tendsto S e a l hanti hlower hgreatest)) + +/-- The embedded functional preserves increasing order limits in S. -/ +theorem predualFunctional_monotone_tendsto (x : X) (a : I → S) (l : S) + (hmono : Monotone (fun i => (a i).val)) + (hupper : ∀ i, (a i).val ≤ l.val) + (hleast : ∀ b : S, (∀ i, (a i).val ≤ b.val) → l.val ≤ b.val) : + Tendsto (fun i => predualFunctional S e x (a i)) atTop + (𝓝 (predualFunctional S e x l)) := by + exact (Complex.continuous_conj.tendsto _).comp + ((WeakDual.eval_continuous x).tendsto _ |>.comp + (predual_monotone_tendsto S e a l hmono hupper hleast)) + +end + +/-! An arbitrary net squeezed into shrinking operator order intervals +converges in the topology of the given Banach predual. The net itself need +not be monotone. No normal-functional decomposition is used. -/ +open Filter +open scoped Topology +variable {H X I : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) +variable [Preorder I] [Nonempty I] + +theorem predual_order_squeeze_tendsto_zero (a b : I → S) + (hanti : Antitone (fun i => (b i).val)) + (hgreatest : ∀ c : S, (∀ i, c.val ≤ (b i).val) → c.val ≤ 0) + (hlower : ∀ i, -(b i).val ≤ (a i).val) + (hupper : ∀ i, (a i).val ≤ (b i).val) : + Tendsto (fun i => StrongDual.toWeakDual (e.symm (a i))) atTop (𝓝 0) := by + let u : I → WeakDual ℂ X := fun i => StrongDual.toWeakDual (e.symm (a i)) + have hu (i : I) : ∀ᶠ j in atTop, + u j ∈ {φ : WeakDual ℂ X | -(b i).val ≤ (e (WeakDual.toStrongDual φ)).val ∧ + (e (WeakDual.toStrongDual φ)).val ≤ (b i).val} := by + filter_upwards [eventually_ge_atTop i] with j hj + simpa only [u, Set.mem_ofPred_eq, StrongDual.toStrongDual_toWeakDual, + e.apply_symm_apply] using + And.intro ((neg_le_neg (hanti hj)).trans (hlower j)) ((hupper j).trans (hanti hj)) + inhabit I + apply (predual_orderInterval_isCompact S e (-b default) (b default)).tendsto_nhds_of_unique_mapClusterPt + (hu default) + intro φ _ hc + have hb (i : I) := (predual_orderInterval_isClosed S e (-b i) (b i)).mem_of_mapClusterPt + hc (hu i) + have hn : (e (WeakDual.toStrongDual φ)).val ≤ 0 := + hgreatest _ (fun i => (hb i).2) + have hp : 0 ≤ (e (WeakDual.toStrongDual φ)).val := by + have h := hgreatest (-e (WeakDual.toStrongDual φ)) (fun i => by + change -(e (WeakDual.toStrongDual φ)).val ≤ (b i).val + have hi : -(b i).val ≤ (e (WeakDual.toStrongDual φ)).val := (hb i).1 + simpa only [neg_neg] using neg_le_neg hi) + exact neg_nonpos.mp h + apply WeakDual.toStrongDual.injective + apply e.injective + apply Subtype.ext + simpa using le_antisymm hn hp + +theorem predualFunctional_order_squeeze_tendsto_zero (x : X) (a b : I → S) + (hanti : Antitone (fun i => (b i).val)) + (hgreatest : ∀ c : S, (∀ i, c.val ≤ (b i).val) → c.val ≤ 0) + (hlower : ∀ i, -(b i).val ≤ (a i).val) + (hupper : ∀ i, (a i).val ≤ (b i).val) : + Tendsto (fun i => predualFunctional S e x (a i)) atTop (𝓝 0) := by + have h := (Complex.continuous_conj.tendsto _).comp + ((WeakDual.eval_continuous x).tendsto _ |>.comp + (predual_order_squeeze_tendsto_zero S e a b hanti hgreatest hlower hupper)) + have hz : (0 : WeakDual ℂ X) x = 0 := rfl + simpa [Function.comp_def, predualFunctional, hz] using h + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/PredualRange.lean b/lean/OAI/Analysis/FactorGeneration/PredualRange.lean new file mode 100644 index 0000000000000000000000000000000000000000..35eee6f24369d7bb2bc53674cb692b5f342b6927 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/PredualRange.lean @@ -0,0 +1,346 @@ +import OAI.Analysis.FactorGeneration.CyclicPredual +import OAI.Analysis.FactorGeneration.FunctionalLimits +import OAI.Analysis.FactorGeneration.MatrixExpectation +import OAI.Analysis.FactorGeneration.PredualOrder + +namespace OAI + +noncomputable section + +namespace Generator + +/-! An actual separable Banach predual for the constructed matrix-generated +factor. The existential convention is exactly Generator.HasSeparablePredual. -/ +section +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem cyclicPredualEvaluation_surjective : Function.Surjective (cyclicPredualEvaluationIsometry τ) := by + intro φ + let c : ℂ := (‖φ‖+1 : ℝ) + have hc : c ≠ 0 := by dsimp [c]; exact_mod_cast ne_of_gt (by positivity : 0 < ‖φ‖+1) + have hnorm : ‖c⁻¹ • φ‖ ≤ 1 := by + rw [norm_smul,norm_inv] + have hn : ‖c‖=‖φ‖+1 := by dsimp [c]; rw [Complex.norm_real,Real.norm_of_nonneg (by positivity)] + rw [hn] + exact (inv_mul_le_one₀ (by positivity : 0 < ‖φ‖+1)).mpr (by linarith) + obtain ⟨a,_,ha⟩ := cyclicPredualEvaluation_unitBall_surjective τ (c⁻¹ • φ) hnorm + refine ⟨c • a,?_⟩ + rw [map_smul] + change c • cyclicPredualEvaluation τ a=φ + rw [ha,smul_smul,mul_inv_cancel₀ hc,one_smul] + +def cyclicPredualLinearEquiv : M.toStarSubalgebra ≃ₗᵢ[ℂ] StrongDual ℂ (cyclicPredual τ) := + LinearIsometryEquiv.ofSurjective (cyclicPredualEvaluationIsometry τ) + (cyclicPredualEvaluation_surjective τ) + +def algebraStarIsometry (M : VonNeumannAlgebra H) : + M.toStarSubalgebra ≃ₗᵢ⋆[ℂ] M.toStarSubalgebra := + { starLinearEquiv ℂ with + norm_map' := fun a => by + change ‖star a.val‖=‖a.val‖ + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint.norm_map] } + +def cyclicPredualDualEquiv : StrongDual ℂ (cyclicPredual τ) ≃ₗᵢ⋆[ℂ] M.toStarSubalgebra := + (cyclicPredualLinearEquiv τ).symm.trans (algebraStarIsometry M) + +theorem hasSeparablePredual_of_trace_separable + (hsep : TopologicalSpace.IsSeparable (Set.range (fun a : M.toStarSubalgebra => a.val τ.vector))) : + HasSeparablePredual M.toStarSubalgebra := by + let := traceCyclicSpace_separable τ hsep + let := cyclicPredual_separable τ + exact ⟨cyclicPredual τ,inferInstance,inferInstance,inferInstance,inferInstance, + ⟨cyclicPredualDualEquiv τ⟩⟩ + +end Tracial + +namespace FiniteMatrixStage +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem generated_hasSeparablePredual (A : ℕ → FiniteMatrixStage N) + (hA : Monotone (fun n => (A n).units.concreteAlgebra)) + (τ : TracialRepresentation M) (hNM : N ≤ M) : HasSeparablePredual (generated A) := + hasSeparablePredual_of_trace_separable (generatedTrace A τ hNM) + (generated_norm₂_separable A hA τ hNM) + +theorem exists_irreducible_matrix_generated_II1_separablePredual + (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ A : ℕ → FiniteMatrixStage N,A 0=scalarStage N ∧ + Monotone (fun n => (A n).units.concreteAlgebra) ∧ + (∀ n,FiniteDimensional ℂ (A n).units.concreteAlgebra) ∧ + IsII1Factor (generated A) ∧ HasSeparablePredual (generated A) ∧ + generated A ≤ N.toStarSubalgebra ∧ + ∀ c : M.toStarSubalgebra,(∀ a : generated A,a.val*c.val=c.val*a.val) → + c=τ.trace c • (1 : M.toStarSubalgebra) := by + obtain ⟨A,hA,hmono,hfd,hII,hAN,hscalar⟩ := + exists_irreducible_matrix_generated_II1 τ hNM hfactor hdiff hirr hsep + exact ⟨A,hA,hmono,hfd,hII,generated_hasSeparablePredual A hmono τ hNM,hAN,hscalar⟩ + +end FiniteMatrixStage + +end + +/-! Separability of the actual cyclic predual implies separability of the +trace-vector orbit. This does not identify an arbitrary given Banach predual +with the cyclic predual. -/ +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- A vector is determined by its trace-vector coefficient functional. -/ +theorem cyclicCoefficient_traceVector_injective : + Function.Injective (fun ξ : traceCyclicSpace τ => + cyclicCoefficient τ ξ (traceCyclicVector τ)) := by + intro ξ η he + apply (traceCyclicHom_cyclic τ).eq_of_inner_left ℂ + rintro _ ⟨a, rfl⟩ + exact congrArg (fun f : StrongDual ℂ M.toStarSubalgebra => f a) he + +/-- A countable total family of dual evaluations supplies a countable total +family of actual trace vectors. -/ +theorem exists_countable_total_traceVectors + [TopologicalSpace.SeparableSpace (cyclicPredual τ)] : + ∃ a : ℕ → M.toStarSubalgebra, (∀ n, ‖a n‖ ≤ 1) ∧ + ∀ ξ : traceCyclicSpace τ, + (∀ n, inner ℂ ξ (traceCyclicHom τ (a n) (traceCyclicVector τ)) = 0) → ξ = 0 := by + obtain ⟨g, hg, htotal⟩ := exists_countable_total_dual (cyclicPredual τ) + let a : ℕ → M.toStarSubalgebra := fun n => (cyclicPredualLinearEquiv τ).symm (g n) + have he (n : ℕ) : cyclicPredualEvaluation τ (a n) = g n := + (cyclicPredualLinearEquiv τ).apply_symm_apply (g n) + refine ⟨a, fun n => ?_, fun ξ hξ => ?_⟩ + · exact ((cyclicPredualLinearEquiv τ).symm.norm_map (g n)).le.trans (hg n) + · let f : cyclicPredual τ := ⟨cyclicCoefficient τ ξ (traceCyclicVector τ), + cyclicCoefficient_mem τ ξ (traceCyclicVector τ)⟩ + have hf : f = 0 := htotal f (fun n => by + rw [← he] + exact hξ n) + apply (traceCyclicHom_cyclic τ).eq_zero_of_inner_left ℂ + rintro _ ⟨b, rfl⟩ + exact congrArg (fun q : cyclicPredual τ => q.val b) hf + +theorem traceCyclicSpace_separable_of_cyclicPredual + [TopologicalSpace.SeparableSpace (cyclicPredual τ)] : + TopologicalSpace.SeparableSpace (traceCyclicSpace τ) := by + obtain ⟨a, _, ha⟩ := exists_countable_total_traceVectors τ + let v : ℕ → traceCyclicSpace τ := fun n => traceCyclicHom τ (a n) (traceCyclicVector τ) + let V := (Submodule.span ℂ (Set.range v)).topologicalClosure + have htop : V = ⊤ := by + apply Submodule.orthogonal_eq_bot_iff.mp + apply eq_bot_iff.mpr + intro ξ hξ + change ξ = 0 + apply ha ξ + intro n + exact (Submodule.mem_orthogonal' V ξ).mp hξ (v n) + (Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨n, rfl⟩)) + have hs : TopologicalSpace.IsSeparable (V : Set (traceCyclicSpace τ)) := + (Set.countable_range v).isSeparable.span.closure + rw [htop, Submodule.top_coe] at hs + exact TopologicalSpace.isSeparable_univ_iff.mp hs + +theorem traceOrbit_isSeparable_of_cyclicPredual + [TopologicalSpace.SeparableSpace (cyclicPredual τ)] : + TopologicalSpace.IsSeparable (Set.range (baseVector τ)) := by + let := traceCyclicSpace_separable_of_cyclicPredual τ + apply (TopologicalSpace.isSeparable_range + (continuous_subtype_val : Continuous (fun ξ : traceCyclicSpace τ => ξ.val))).mono + rintro ξ ⟨a, rfl⟩ + exact ⟨traceCyclicHom τ a (traceCyclicVector τ), rfl⟩ + +end Tracial + +/-! The given predual as a closed separating subspace of the algebra norm dual, with its evaluation duality. -/ +section +open scoped ComplexConjugate +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) + +/-- Keep the norm topology explicit through the nested dual construction. -/ +instance predualAlgebraDualNormed : NormedAddCommGroup (StrongDual ℂ S) := inferInstance + +def predualFunctionals : Submodule ℂ (StrongDual ℂ S) := + (predualFunctionalIsometry S e).toLinearMap.range + +instance predualFunctionals_normed : NormedAddCommGroup (predualFunctionals S e) := inferInstance + +instance predualFunctionals_normedSpace : NormedSpace ℂ (predualFunctionals S e) := inferInstance + +def predualFunctionalsEquiv : X ≃ₗᵢ⋆[ℂ] predualFunctionals S e := + (predualFunctionalIsometry S e).equivRange + +@[simp] theorem predualFunctionalsEquiv_val (x : X) : + (predualFunctionalsEquiv S e x).val = predualFunctional S e x := rfl + +theorem predualFunctionals_isClosed [CompleteSpace X] : + IsClosed (predualFunctionals S e : Set (StrongDual ℂ S)) := + (predualFunctionalIsometry S e).isometry.isClosedEmbedding.isClosed_range + +theorem predualFunctionals_separable [TopologicalSpace.SeparableSpace X] : + TopologicalSpace.SeparableSpace (predualFunctionals S e) := + (TopologicalSpace.isSeparable_range (predualFunctionalIsometry S e).continuous).separableSpace + +def predualRangeEvaluation (a : S) : StrongDual ℂ (predualFunctionals S e) := + (ContinuousLinearMap.apply ℂ ℂ a).domRestrict (predualFunctionals S e) + +@[simp] theorem predualRangeEvaluation_apply (a : S) (f : predualFunctionals S e) : + predualRangeEvaluation S e a f = f.val a := rfl + +theorem predualRangeEvaluation_norm (a : S) : ‖predualRangeEvaluation S e a‖ = ‖a‖ := by + apply le_antisymm + · apply (predualRangeEvaluation S e a).opNorm_le_bound (norm_nonneg a) + intro f + exact (f.val.le_opNorm a).trans_eq (mul_comm _ _) + · rw [← e.symm.norm_map a] + apply (e.symm a).opNorm_le_bound (norm_nonneg _) + intro x + have h := (predualRangeEvaluation S e a).le_opNorm (predualFunctionalsEquiv S e x) + simpa only [predualRangeEvaluation_apply, predualFunctionalsEquiv_val, + predualFunctional_apply, Complex.norm_conj, LinearIsometryEquiv.norm_map] using h + +/-- Pull a dual functional back through the conjugate-linear range equivalence. -/ +def predualRangePullback (φ : StrongDual ℂ (predualFunctionals S e)) : StrongDual ℂ X := + LinearMap.mkContinuous + { toFun := fun x => conj (φ (predualFunctionalsEquiv S e x)) + map_add' := by intros; simp + map_smul' := by + intro c x + rw [(predualFunctionalsEquiv S e).map_smulₛₗ] + simp } + ‖φ‖ (by + intro x + change ‖conj (φ (predualFunctionalsEquiv S e x))‖ ≤ ‖φ‖ * ‖x‖ + simpa only [Complex.norm_conj, LinearIsometryEquiv.norm_map] using + φ.le_opNorm (predualFunctionalsEquiv S e x)) + +/-- Every functional on the embedded given predual is evaluation at an actual a in S. -/ +theorem predualRangeEvaluation_surjective : Function.Surjective (predualRangeEvaluation S e) := by + intro φ + refine ⟨e (predualRangePullback S e φ), ?_⟩ + ext f + obtain ⟨x, rfl⟩ := (predualFunctionalsEquiv S e).surjective f + simp only [predualRangeEvaluation_apply, predualFunctionalsEquiv_val, + predualFunctional_apply, e.symm_apply_apply] + change conj (conj (φ (predualFunctionalsEquiv S e x))) = _ + exact star_star _ + +end + +/-! Hahn–Banach comparison of preduals from normal-functional membership and evaluation surjectivity. -/ +section +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] [CompleteSpace X] +variable (S : StarSubalgebra ℂ (H →L[ℂ] H)) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) + +/-- A closed separating predual contained in an evaluation predual equals it. +The inclusion is a substantive hypothesis, not supplied by this theorem. -/ +theorem predualFunctionals_eq_of_le (F : Submodule ℂ (StrongDual ℂ S)) + (hincl : predualFunctionals S e ≤ F) + (hdual : ∀ φ : StrongDual ℂ F, ∃ a : S, ∀ f : F, φ f = f.val a) : + predualFunctionals S e = F := by + let : NormedAddCommGroup F := inferInstance + let : NormedSpace ℂ F := inferInstance + apply le_antisymm hincl + intro f hf + let K : Submodule ℂ F := (predualFunctionals S e).comap F.subtype + let : IsClosed (K : Set F) := + (predualFunctionals_isClosed S e).preimage continuous_subtype_val + let z : F := ⟨f, hf⟩ + by_contra hz + have hq : K.mkQ z ≠ 0 := by + intro heq + exact hz ((Submodule.Quotient.mk_eq_zero K).mp heq) + obtain ⟨g, hg⟩ := SeparatingDual.exists_ne_zero (R := ℂ) hq + obtain ⟨a, ha⟩ := hdual (g.comp K.mkQL) + have ha0 : a = 0 := by + apply predualFunctional_separates S e a 0 + intro x + have hmem : predualFunctional S e x ∈ predualFunctionals S e := ⟨x, rfl⟩ + let fx : F := ⟨predualFunctional S e x, hincl hmem⟩ + have hk : K.mkQ fx = 0 := (Submodule.Quotient.mk_eq_zero K).mpr hmem + have hx := ha fx + change g (K.mkQ fx) = predualFunctional S e x a at hx + rw [hk, map_zero] at hx + simpa only [map_zero] using hx.symm + apply hg + have hz' := ha z + change g (K.mkQ z) = f a at hz' + simpa only [ha0, map_zero] using hz' + +end + +/-! Conditional comparison with the constructed cyclic predual. Membership +of the given-predual evaluations in that space is an explicit unproved input; +it is not obtained merely from their order-limit convergence. -/ +namespace Tracial +open UltrapowerBridge +variable {H X : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup X] [NormedSpace ℂ X] [CompleteSpace X] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (e : StrongDual ℂ X ≃ₗᵢ⋆[ℂ] M.toStarSubalgebra) + +/-- Normal-functional membership is sufficient for equality with the given predual. -/ +theorem predualFunctionals_eq_cyclicPredual_of_membership + (hmem : ∀ x : X, predualFunctional M.toStarSubalgebra e x ∈ cyclicPredual τ) : + predualFunctionals M.toStarSubalgebra e = cyclicPredual τ := by + apply predualFunctionals_eq_of_le M.toStarSubalgebra e (cyclicPredual τ) + · rintro f ⟨x, rfl⟩ + exact hmem x + · intro φ + obtain ⟨a, ha⟩ := cyclicPredualEvaluation_surjective τ φ + refine ⟨a, fun f => ?_⟩ + exact (congrArg (fun ψ : StrongDual ℂ (cyclicPredual τ) => ψ f) ha).symm + +/-- Under the same explicit membership input, separability transfers to the cyclic predual. -/ +theorem cyclicPredual_separable_of_given_membership [TopologicalSpace.SeparableSpace X] + (hmem : ∀ x : X, predualFunctional M.toStarSubalgebra e x ∈ cyclicPredual τ) : + TopologicalSpace.SeparableSpace (cyclicPredual τ) := by + rw [← predualFunctionals_eq_cyclicPredual_of_membership τ e hmem] + exact predualFunctionals_separable M.toStarSubalgebra e + +/-! The original given-predual evaluations suffice for trace-orbit separability +once their normal-functional membership (equivalently unit-ball WOT +continuity) is proved. The remaining input is displayed literally. -/ + +omit [CompleteSpace X] in +theorem given_predual_membership_iff_unitBall_continuity : + (∀ x : X, predualFunctional M.toStarSubalgebra e x ∈ cyclicPredual τ) ↔ + ∀ x : X, Continuous (fun T : weakOperatorBall M 1 => + predualFunctional M.toStarSubalgebra e x ⟨T.val.toCLM, T.property.1⟩) := by + exact forall_congr' (fun x => mem_cyclicPredual_iff_unitBall_continuous τ _) + +theorem traceOrbit_isSeparable_of_given_membership [TopologicalSpace.SeparableSpace X] + (hmem : ∀ x : X, predualFunctional M.toStarSubalgebra e x ∈ cyclicPredual τ) : + TopologicalSpace.IsSeparable (Set.range (baseVector τ)) := by + let := cyclicPredual_separable_of_given_membership τ e hmem + exact traceOrbit_isSeparable_of_cyclicPredual τ + +theorem traceOrbit_isSeparable_of_given_unitBall_continuity [TopologicalSpace.SeparableSpace X] + (hc : ∀ x : X, Continuous (fun T : weakOperatorBall M 1 => + predualFunctional M.toStarSubalgebra e x ⟨T.val.toCLM, T.property.1⟩)) : + TopologicalSpace.IsSeparable (Set.range (baseVector τ)) := + traceOrbit_isSeparable_of_given_membership τ e + ((given_predual_membership_iff_unitBall_continuity τ e).mpr hc) + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ProductWords.lean b/lean/OAI/Analysis/FactorGeneration/ProductWords.lean new file mode 100644 index 0000000000000000000000000000000000000000..0b0cbe2ef00e80e3502ae7a208b464c16670ffe4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ProductWords.lean @@ -0,0 +1,326 @@ +import OAI.Analysis.FactorGeneration.ResidualMoments + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Exact signed-word expansion for a product of two unitaries. A unit gap +is allowed only between equal signs; opposite signs retain a centered gap. -/ + +section Algebra +variable {A : Type*} [Monoid A] [StarMul A] + +def productLeft (u : A) (s : Bool) : A := if s then 1 else u +def productRight (u : A) (s : Bool) : A := if s then star u else 1 + +theorem signed_product_split (u v : A) (s : Bool) : + algebraSignedLetter (u*v) s = productLeft u s*algebraSignedLetter v s*productRight u s := by + cases s <;> simp [algebraSignedLetter,productLeft,productRight,star_mul] + +def betweenWord (v : A) (s : Bool) : List (A × Bool) → A → A + | [], b => algebraSignedLetter v s*b + | (d,t)::xs, b => algebraSignedLetter v s*d*betweenWord v t xs b + +def productGapList (u : A) (s : Bool) : List (A × Bool) → List (Bool × A) + | [] => [] + | (d,t)::xs => (s,productRight u s*d*productLeft u t)::productGapList u t xs + +def finalWordSign (s : Bool) : List (A × Bool) → Bool + | [] => s + | (_,t)::xs => finalWordSign t xs + +theorem betweenWord_product (u v : A) (s : Bool) (xs : List (A × Bool)) (b : A) : + betweenWord (u*v) s xs b = productLeft u s * algebraPatchingWord v + (productGapList u s xs ++ [(finalWordSign s xs,productRight u (finalWordSign s xs)*b)]) := by + induction xs generalizing s with + | nil => simp [betweenWord,productGapList,finalWordSign,algebraPatchingWord, + signed_product_split,mul_assoc] + | cons a xs ih => + simp only [betweenWord,productGapList,finalWordSign,List.cons_append, + algebraPatchingWord,signed_product_split,ih,mul_assoc] + +end Algebra +section + +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem exactOrderedMoments_values (v : Q τ ω) (y : ℕ → Q τ ω) + (hm : ExactOrderedMoments τ ω v y) (a b : Q τ ω) + (ha : ∃ i : Option ℕ,optionalCoefficient y i=a) + (hb : ∃ i : Option ℕ,optionalCoefficient y i=b) + (xs : List (Bool × Q τ ω)) (hxs : ∀ z ∈ xs,∃ i,y i=z.2) (s : Bool) : + quotientTrace τ ω (a*algebraPatchingWord v (xs++[(s,b)]))=0 := by + have hencode : ∃ is : List (Bool × ℕ),is.map (fun z => (z.1,y z.2))=xs := by + induction xs with + | nil => exact ⟨[],rfl⟩ + | cons z xs ih => + obtain ⟨i,hi⟩ := hxs z (by simp) + obtain ⟨is,his⟩ := ih (fun z hz => hxs z (by simp [hz])) + exact ⟨(z.1,i)::is,by simp [hi,his]⟩ + obtain ⟨i,rfl⟩ := ha + obtain ⟨j,rfl⟩ := hb + obtain ⟨is,rfl⟩ := hencode + exact hm i j is s + +/-- Centered coefficients may separate arbitrary signs; unit coefficients may +only separate equal signs. This excludes cancellation through an internal unit. -/ +def ProductGaps (x : ℕ → Q τ ω) (s : Bool) : List (Q τ ω × Bool) → Prop + | [] => True + | (d,t)::xs => ((∃ i,x i=d) ∨ (d=1 ∧ s=t)) ∧ ProductGaps x t xs + +def ReducedOrderedMoments (t : Q τ ω) (x : ℕ → Q τ ω) : Prop := + ∀ a b : Option ℕ,∀ s : Bool,∀ xs : List (Q τ ω × Bool), + ProductGaps τ ω x s xs → + quotientTrace τ ω (optionalCoefficient x a*betweenWord t s xs (optionalCoefficient x b))=0 + +end + +/-! The actual countable centered coefficients needed to expand words in UV. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +abbrev ProductFamilyIndex := ℕ ⊕ ((Bool × Option ℕ) ⊕ ℕ) + +def productFamilyValue (u : Q τ ω) (x : ℕ → Q τ ω) : ProductFamilyIndex → Q τ ω + | .inl i => x i + | .inr (.inl (s,i)) => if s then star u*optionalCoefficient x i else optionalCoefficient x i*u + | .inr (.inr i) => star u*x i*u + +def productCenteredFamily (u : Q τ ω) (x : ℕ → Q τ ω) (n : ℕ) : Q τ ω := + match Encodable.decode (α := ProductFamilyIndex) n with + | none => 0 + | some i => productFamilyValue τ ω u x i + +theorem productCenteredFamily_encode (u : Q τ ω) (x : ℕ → Q τ ω) (i : ProductFamilyIndex) : + productCenteredFamily τ ω u x (Encodable.encode i)=productFamilyValue τ ω u x i := by + simp [productCenteredFamily] + +theorem productCenteredFamily_centered (u : Q τ ω) (x : ℕ → Q τ ω) + (hu : u*star u=1) (hx : ∀ i,quotientTrace τ ω (x i)=0) + (hm : ExactOrderedMoments τ ω u x) : + ∀ i,quotientTrace τ ω (productCenteredFamily τ ω u x i)=0 := by + intro n + unfold productCenteredFamily + cases Encodable.decode (α := ProductFamilyIndex) n with + | none => exact (traceLinear τ ω).map_zero + | some i => + cases i with + | inl j => exact hx j + | inr i => + cases i with + | inl a => + rcases a with ⟨s,j⟩ + cases s + · simpa [productFamilyValue,algebraPatchingWord,algebraSignedLetter,optionalCoefficient] + using hm j none [] false + · simpa [productFamilyValue,algebraPatchingWord,algebraSignedLetter,optionalCoefficient] + using hm none j [] true + | inr j => + change quotientTrace τ ω (star u*x j*u)=0 + rw [quotientTrace_mul_comm τ ω (star u*x j),← mul_assoc,hu,one_mul] + exact hx j + +theorem productFamily_original (u : Q τ ω) (x : ℕ → Q τ ω) (i : ℕ) : + ∃ j,productCenteredFamily τ ω u x j=x i := + ⟨Encodable.encode (Sum.inl i : ProductFamilyIndex),productCenteredFamily_encode τ ω u x _⟩ + +theorem productFamily_right (u : Q τ ω) (x : ℕ → Q τ ω) (i : Option ℕ) : + ∃ j,productCenteredFamily τ ω u x j=optionalCoefficient x i*u := + ⟨Encodable.encode (Sum.inr (Sum.inl (false,i)) : ProductFamilyIndex), + productCenteredFamily_encode τ ω u x _⟩ + +theorem productFamily_left (u : Q τ ω) (x : ℕ → Q τ ω) (i : Option ℕ) : + ∃ j,productCenteredFamily τ ω u x j=star u*optionalCoefficient x i := + ⟨Encodable.encode (Sum.inr (Sum.inl (true,i)) : ProductFamilyIndex), + productCenteredFamily_encode τ ω u x _⟩ + +theorem productFamily_conjugate (u : Q τ ω) (x : ℕ → Q τ ω) (i : ℕ) : + ∃ j,productCenteredFamily τ ω u x j=star u*x i*u := + ⟨Encodable.encode (Sum.inr (Sum.inr i) : ProductFamilyIndex), + productCenteredFamily_encode τ ω u x _⟩ + +theorem productFamily_optional (u : Q τ ω) (x : ℕ → Q τ ω) (i : Option ℕ) : + ∃ j : Option ℕ,optionalCoefficient (productCenteredFamily τ ω u x) j=optionalCoefficient x i := by + cases i with + | none => exact ⟨none,rfl⟩ + | some i => + obtain ⟨j,hj⟩ := productFamily_original τ ω u x i + exact ⟨some j,hj⟩ + +theorem productFamily_first (u : Q τ ω) (x : ℕ → Q τ ω) (a : Option ℕ) (s : Bool) : + ∃ j : Option ℕ,optionalCoefficient (productCenteredFamily τ ω u x) j= + optionalCoefficient x a*productLeft u s := by + cases s + · obtain ⟨j,hj⟩ := productFamily_right τ ω u x a + exact ⟨some j,hj⟩ + · simpa [productLeft] using productFamily_optional τ ω u x a + +theorem productFamily_last (u : Q τ ω) (x : ℕ → Q τ ω) (b : Option ℕ) (s : Bool) : + ∃ j : Option ℕ,optionalCoefficient (productCenteredFamily τ ω u x) j= + productRight u s*optionalCoefficient x b := by + cases s + · simpa [productRight] using productFamily_optional τ ω u x b + · obtain ⟨j,hj⟩ := productFamily_left τ ω u x b + exact ⟨some j,hj⟩ + +theorem productFamily_gap (u : Q τ ω) (x : ℕ → Q τ ω) + (s t : Bool) (d : Q τ ω) (hd : (∃ i,x i=d) ∨ (d=1 ∧ s=t)) : + ∃ j,productCenteredFamily τ ω u x j=productRight u s*d*productLeft u t := by + rcases hd with ⟨i,rfl⟩ | ⟨rfl,rfl⟩ + · cases s <;> cases t + · simpa [productRight,productLeft,optionalCoefficient] using productFamily_right τ ω u x (some i) + · simpa [productRight,productLeft] using productFamily_original τ ω u x i + · simpa [productRight,productLeft] using productFamily_conjugate τ ω u x i + · simpa [productRight,productLeft,optionalCoefficient] using productFamily_left τ ω u x (some i) + · cases s + · simpa [productRight,productLeft,optionalCoefficient] using productFamily_right τ ω u x none + · simpa [productRight,productLeft,optionalCoefficient] using productFamily_left τ ω u x none + +theorem productGapList_members (u : Q τ ω) (x : ℕ → Q τ ω) + (s : Bool) (xs : List (Q τ ω × Bool)) (hx : ProductGaps τ ω x s xs) : + ∀ z ∈ productGapList u s xs,∃ i,productCenteredFamily τ ω u x i=z.2 := by + induction xs generalizing s with + | nil => simp [productGapList] + | cons a xs ih => + intro z hz + rcases List.mem_cons.mp hz with rfl | hz + · exact productFamily_gap τ ω u x s a.2 a.1 hx.1 + · exact ih a.2 hx.2 z hz + +/-- The product has every reduced signed moment, including same-sign unit gaps. -/ +theorem product_reduced_moment (u v : Q τ ω) (x : ℕ → Q τ ω) + (hm : ExactOrderedMoments τ ω v (productCenteredFamily τ ω u x)) + (a b : Option ℕ) (s : Bool) (xs : List (Q τ ω × Bool)) + (hx : ProductGaps τ ω x s xs) : + quotientTrace τ ω (optionalCoefficient x a*betweenWord (u*v) s xs + (optionalCoefficient x b))=0 := by + rw [betweenWord_product,← mul_assoc] + exact exactOrderedMoments_values τ ω v _ hm _ _ + (productFamily_first τ ω u x a s) + (productFamily_last τ ω u x b (finalWordSign s xs)) _ + (productGapList_members τ ω u x s xs hx) _ + +end + +/-! Expand positive-length signed powers into individual letters. Repeated +letters have unit gaps; boundaries between powers retain centered coefficients. -/ + +section Algebra +variable {A : Type*} [Monoid A] [StarMul A] + +def powerBlockGaps (s : Bool) (n : ℕ) : List (A × (Bool × ℕ)) → List (A × Bool) + | [] => List.replicate n (1,s) + | (d,(t,k))::xs => List.replicate n (1,s) ++ (d,t)::powerBlockGaps t k xs + +def powerBlockWord (v : A) (s : Bool) (n : ℕ) : List (A × (Bool × ℕ)) → A → A + | [],b => algebraSignedLetter v s^(n+1)*b + | (d,(t,k))::xs,b => algebraSignedLetter v s^(n+1)*d*powerBlockWord v t k xs b + +theorem betweenWord_repeat_prefix (v : A) (s : Bool) (n : ℕ) (xs : List (A × Bool)) (b : A) : + betweenWord v s (List.replicate n (1,s) ++ xs) b = + algebraSignedLetter v s^n*betweenWord v s xs b := by + induction n with + | zero => simp + | succ n ih => simp [List.replicate_succ,betweenWord,ih,pow_succ',mul_assoc] + +theorem powerBlockWord_expand (v : A) (s : Bool) (n : ℕ) + (xs : List (A × (Bool × ℕ))) (b : A) : + powerBlockWord v s n xs b = betweenWord v s (powerBlockGaps s n xs) b := by + induction xs generalizing s n with + | nil => + rw [powerBlockGaps,← List.append_nil (List.replicate n (1,s)),betweenWord_repeat_prefix] + simp [powerBlockWord,betweenWord,pow_succ,mul_assoc] + | cons a xs ih => + rcases a with ⟨d,t,k⟩ + simp only [powerBlockGaps,betweenWord_repeat_prefix,betweenWord,powerBlockWord,ih, + pow_succ,mul_assoc] + +/-- Magnitude is encoded as predecessor, so every resulting block has positive length. -/ +def integerPowerBlock : ℤ → Bool × ℕ + | .ofNat n => (false,n-1) + | .negSucc n => (true,n) + +theorem integerPowerBlock_eval (v : unitary A) (n : ℤ) (hn : n ≠ 0) : + (↑(v^n) : A)=algebraSignedLetter (v : A) (integerPowerBlock n).1^ + ((integerPowerBlock n).2+1) := by + cases n with + | ofNat n => + cases n with + | zero => exact (hn rfl).elim + | succ n => + change (↑(v^((n+1 : ℕ) : ℤ)) : A)=(v : A)^(n+1) + rw [zpow_natCast] + rfl + | negSucc n => + rw [zpow_negSucc] + change star ((v : A)^(n+1))=_ + simp [integerPowerBlock,algebraSignedLetter,star_pow] + +def integerWord (v : unitary A) (x : ℕ → A) (n : ℤ) : List (ℕ × ℤ) → A → A + | [],b => (↑(v^n) : A)*b + | (i,m)::xs,b => (↑(v^n) : A)*x i*integerWord v x m xs b + +theorem integerWord_blocks (v : unitary A) (x : ℕ → A) (n : ℤ) (hn : n ≠ 0) + (xs : List (ℕ × ℤ)) (hxs : ∀ a ∈ xs,a.2 ≠ 0) (b : A) : + integerWord v x n xs b = powerBlockWord (v : A) (integerPowerBlock n).1 + (integerPowerBlock n).2 (xs.map (fun a => (x a.1,integerPowerBlock a.2))) b := by + induction xs generalizing n with + | nil => simp [integerWord,powerBlockWord,integerPowerBlock_eval v n hn] + | cons a xs ih => + simp only [integerWord,List.map_cons,powerBlockWord,integerPowerBlock_eval v n hn] + rw [ih a.2 (hxs a (by simp)) (fun z hz => hxs z (by simp [hz]))] + +end Algebra + +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem productGaps_repeat_prefix (x : ℕ → Q τ ω) (s : Bool) (n : ℕ) + (xs : List (Q τ ω × Bool)) (hx : ProductGaps τ ω x s xs) : + ProductGaps τ ω x s (List.replicate n (1,s)++xs) := by + induction n with + | zero => simpa using hx + | succ n ih => + rw [List.replicate_succ,List.cons_append] + exact ⟨Or.inr ⟨rfl,rfl⟩,ih⟩ + +theorem productGaps_powerBlocks (x : ℕ → Q τ ω) (s : Bool) (n : ℕ) + (xs : List (Q τ ω × (Bool × ℕ))) (hx : ∀ z ∈ xs,∃ i,x i=z.1) : + ProductGaps τ ω x s (powerBlockGaps s n xs) := by + induction xs generalizing s n with + | nil => + simpa [powerBlockGaps] using productGaps_repeat_prefix τ ω x s n [] trivial + | cons a xs ih => + apply productGaps_repeat_prefix + exact ⟨Or.inl (hx a (by simp)),ih a.2.1 a.2.2 (fun z hz => hx z (by simp [hz]))⟩ + +theorem reducedOrderedMoments_integerWord (v : unitary (Q τ ω)) (x : ℕ → Q τ ω) + (hm : ReducedOrderedMoments τ ω (v : Q τ ω) x) + (a b : Option ℕ) (n : ℤ) (hn : n ≠ 0) (xs : List (ℕ × ℤ)) + (hxs : ∀ z ∈ xs,z.2 ≠ 0) : + quotientTrace τ ω (optionalCoefficient x a*integerWord v x n xs (optionalCoefficient x b))=0 := by + rw [integerWord_blocks v x n hn xs hxs,powerBlockWord_expand] + apply hm + apply productGaps_powerBlocks + intro z hz + obtain ⟨j,hj,rfl⟩ := List.mem_map.mp hz + exact ⟨j.1,rfl⟩ + +theorem reducedOrderedMoments_haar (v : unitary (Q τ ω)) (x : ℕ → Q τ ω) + (hm : ReducedOrderedMoments τ ω (v : Q τ ω) x) (n : ℤ) (hn : n ≠ 0) : + quotientTrace τ ω (↑(v^n) : Q τ ω)=0 := by + simpa [optionalCoefficient,integerWord] using + reducedOrderedMoments_integerWord τ ω v x hm none none n hn [] (by simp) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ProjectionComparison.lean b/lean/OAI/Analysis/FactorGeneration/ProjectionComparison.lean new file mode 100644 index 0000000000000000000000000000000000000000..c4b0f80398c61181740eec6abbf09f05128bb094 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ProjectionComparison.lean @@ -0,0 +1,152 @@ +import OAI.Analysis.FactorGeneration.OrbitMinima +import OAI.Analysis.FactorGeneration.PartialIsometries +import OAI.Analysis.FactorGeneration.Supports + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! A nonzero coefficient linking two projections produces an actual nonzero +partial isometry between subprojections. Scalar center supplies such coefficients. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem exists_partialIsometry_of_link (p q : AlgebraProjection M) + (x : M.toStarSubalgebra) (hxp : x*p.val=x) (hqx : q.val*x=x) (hx : x≠0) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ v.support.val≠0 := by + obtain ⟨v,hvx,hvi,hvf⟩ := exists_polar_with_supports x + let w : PartialIsometry M := ⟨rangeProjection (star x),v,hvi⟩ + refine ⟨w,?_,?_,?_⟩ + · apply (rangeProjection_le_iff (star x) p).mpr + simpa only [star_mul,p.property.isSelfAdjoint.star_eq] using congrArg star hxp + · have ht : w.target=rangeProjection x := Subtype.ext hvf + rw [ht] + exact (rangeProjection_le_iff x q).mpr hqx + · intro hz + have hv0 : v=0 := (CStarRing.star_mul_self_eq_zero_iff _).mp (hvi.trans hz) + rw [hv0,zero_mul] at hvx + exact hx hvx.symm + +theorem exists_nonzero_partialIsometry_between_projections + (τ : TracialRepresentation M) + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (p q : AlgebraProjection M) (hp : p.val≠0) (hq : q.val≠0) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ v.support.val≠0 := by + classical + let P : StarSubalgebra ℂ M.toStarSubalgebra := ⊤ + let : CompleteSpace P := isClosed_univ.completeSpace_coe + have hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P, (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + exact hfactor c (fun a => hc ⟨a,StarSubalgebra.mem_top⟩) + have hex : ∃ a : P, q.val*(a : M.toStarSubalgebra)*p.val≠0 := by + by_contra hn + have hz : ∀ a : P, q.val*(a : M.toStarSubalgebra)*p.val=0 := by + simpa only [not_exists,not_not] using hn + exact (projection_eq_zero_or_eq_zero_of_no_links τ P hirr p q hz).elim hp hq + obtain ⟨a,ha⟩ := hex + apply exists_partialIsometry_of_link p q (q.val*(a : M.toStarSubalgebra)*p.val) + · rw [mul_assoc,p.property.isIdempotentElem.eq] + · rw [← mul_assoc,← mul_assoc,q.property.isIdempotentElem.eq] + · exact ha + +end + +/-! Projection comparison and equal-trace equivalence in the actual factor. +Both polar decomposition and the maximal partial isometry are constructed. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + +include τ hfactor in +theorem exists_partialIsometry_comparison (p q : AlgebraProjection M) : + ∃ v : PartialIsometry M, v.support ≤ p ∧ v.target ≤ q ∧ + (v.support=p ∨ v.target=q) := by + obtain ⟨v,hvp,hvq,hmax⟩ := PartialIsometry.exists_maximal_between τ p q + let r : AlgebraProjection M := + ⟨p.val-v.support.val,v.support.property.sub_of_mul_eq_right p.property hvp⟩ + let s : AlgebraProjection M := + ⟨q.val-v.target.val,v.target.property.sub_of_mul_eq_right q.property hvq⟩ + have hrp : r ≤ p := by + change p.val*(p.val-v.support.val)=p.val-v.support.val + rw [mul_sub,p.property.isIdempotentElem.eq,hvp] + have hsq : s ≤ q := by + change q.val*(q.val-v.target.val)=q.val-v.target.val + rw [mul_sub,q.property.isIdempotentElem.eq,hvq] + have hzero : r.val=0 ∨ s.val=0 := by + by_contra hn + have hr : r.val≠0 := fun h => hn (Or.inl h) + have hs : s.val≠0 := fun h => hn (Or.inr h) + obtain ⟨w,hwr,hws,hw0⟩ := + exists_nonzero_partialIsometry_between_projections τ hfactor r s hr hs + have hpw : v.support.val*w.support.val=0 := by + calc _ = v.support.val*(r.val*w.support.val) := by rw [hwr] + _ = (v.support.val*r.val)*w.support.val := (mul_assoc _ _ _).symm + _ = 0 := by + change (v.support.val*(p.val-v.support.val))*w.support.val=0 + rw [mul_sub,projection_mul_of_le hvp,v.support.property.isIdempotentElem.eq, + sub_self,zero_mul] + have hqw : v.target.val*w.target.val=0 := by + calc _ = v.target.val*(s.val*w.target.val) := by rw [hws] + _ = (v.target.val*s.val)*w.target.val := (mul_assoc _ _ _).symm + _ = 0 := by + change (v.target.val*(q.val-v.target.val))*w.target.val=0 + rw [mul_sub,projection_mul_of_le hvq,v.target.property.isIdempotentElem.eq, + sub_self,zero_mul] + let u := PartialIsometry.patch v w hpw hqw + have hup : u.support ≤ p := by + change p.val*(v.support.val+w.support.val)=v.support.val+w.support.val + rw [mul_add,hvp,show p.val*w.support.val=w.support.val from hwr.trans hrp] + have huq : u.target ≤ q := by + apply (u.target_le_iff_mul q).mpr + change q.val*(v.val+w.val)=v.val+w.val + rw [mul_add,(v.target_le_iff_mul q).mp hvq, + (w.target_le_iff_mul q).mp (hws.trans hsq)] + have hvu : v ≤ u := v.le_patch w hpw hqw + exact (v.patch_ne w hpw hqw hw0) (le_antisymm (hmax u hup huq hvu) hvu) + refine ⟨v,hvp,hvq,?_⟩ + rcases hzero with hr | hs + · exact Or.inl (Subtype.ext (sub_eq_zero.mp hr).symm) + · exact Or.inr (Subtype.ext (sub_eq_zero.mp hs).symm) + +theorem projection_eq_of_le_of_trace_eq {p q : AlgebraProjection M} + (hpq : p ≤ q) (ht : τ.trace p.val=τ.trace q.val) : p=q := by + let r : AlgebraProjection M := ⟨q.val-p.val,p.property.sub_of_mul_eq_right q.property hpq⟩ + have hz : τ.trace r.val=0 := by + change τ.trace (q.val-p.val)=0 + rw [trace_sub,ht,sub_self] + have hr : r.val=0 := by + by_contra hn + have hh := projection_trace_pos τ r.val r.property hn + rw [hz,Complex.zero_re] at hh + exact (lt_irrefl _ hh) + exact Subtype.ext (sub_eq_zero.mp hr).symm + +include hfactor in +theorem exists_partialIsometry_of_trace_eq (p q : AlgebraProjection M) + (ht : τ.trace p.val=τ.trace q.val) : + ∃ v : M.toStarSubalgebra, star v*v=p.val ∧ v*star v=q.val := by + obtain ⟨v,hvp,hvq,hfull⟩ := exists_partialIsometry_comparison τ hfactor p q + have he := v.trace_support_eq_target τ + have hboth : v.support=p ∧ v.target=q := by + rcases hfull with hp | hq + · refine ⟨hp,projection_eq_of_le_of_trace_eq τ hvq ?_⟩ + rw [← he,hp,ht] + · refine ⟨projection_eq_of_le_of_trace_eq τ hvp ?_,hq⟩ + rw [he,hq,ht] + exact ⟨v.val,v.initial.trans (congrArg (fun z : AlgebraProjection M => z.val) hboth.1), + congrArg (fun z : AlgebraProjection M => z.val) hboth.2⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ProjectionEncoding.lean b/lean/OAI/Analysis/FactorGeneration/ProjectionEncoding.lean new file mode 100644 index 0000000000000000000000000000000000000000..302f67e9c7d2568c3afa663a12696f458adc25eb --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ProjectionEncoding.lean @@ -0,0 +1,204 @@ +import Mathlib.Analysis.CStarAlgebra.Projection +import Mathlib.Analysis.Normed.Algebra.Basic +import Mathlib.Analysis.SpecificLimits.Normed +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NoncommRing +import Mathlib.Topology.Algebra.InfiniteSum.Constructions +import OAI.Analysis.FactorGeneration.Bicommutant + +namespace OAI + +noncomputable section + +namespace Generator + +/-! A separated idempotent is recovered from commutation with a norm-small +perturbation. This is an elementary substitute for the spectral-cut step. -/ +section +variable {A : Type*} [NormedRing A] [NormedAlgebra ℝ A] + +theorem offDiagonal_eq_zero_of_gap (p t x : A) (hp : p*p=p) + (hpt : Commute p t) (a : ℝ) (ha : 2*‖t‖ < a) + (hx : Commute (a • p+t) x) : p*x*(1-p)=0 := by + let y := p*x*(1-p) + have hleft : p*(a • p+t) = a • p+p*t := by + rw [mul_add,mul_smul_comm,hp] + have hright : (a • p+t)*(1-p)=t*(1-p) := by + rw [add_mul,smul_mul_assoc,mul_sub,mul_one,hp,sub_self,smul_zero,zero_add] + have he := congrArg (fun z : A => p*z*(1-p)) hx.eq + have hy : a • y = y*t-t*y := by + have ht : t*(1-p)=(1-p)*t := by + rw [mul_sub,sub_mul,mul_one,one_mul,hpt.eq] + have h : a • y+t*y=y*t := by + calc a • y+t*y = (p*(a • p+t))*x*(1-p) := by + rw [hleft,add_mul,add_mul,smul_mul_assoc,smul_mul_assoc] + dsimp [y] + rw [hpt.eq] + simp only [mul_assoc] + _ = p*((a • p+t)*x)*(1-p) := by simp only [mul_assoc] + _ = p*(x*(a • p+t))*(1-p) := he + _ = y*t := by + simp only [mul_assoc] + rw [hright,ht] + simp only [y,mul_assoc] + exact eq_sub_of_add_eq' (by simpa only [add_comm] using h) + have han : 0 ≤ a := (mul_nonneg (by norm_num) (norm_nonneg t)).trans ha.le + have hn : a*‖y‖ ≤ 2*‖t‖*‖y‖ := by + calc a*‖y‖ = ‖a • y‖ := by rw [norm_smul,Real.norm_of_nonneg han] + _ = ‖y*t-t*y‖ := congrArg norm hy + _ ≤ ‖y*t‖+‖t*y‖ := norm_sub_le _ _ + _ ≤ ‖y‖*‖t‖+‖t‖*‖y‖ := add_le_add (norm_mul_le _ _) (norm_mul_le _ _) + _ = 2*‖t‖*‖y‖ := by ring + have hz : ‖y‖=0 := by nlinarith [norm_nonneg y] + exact norm_eq_zero.mp hz + +theorem commute_projection_of_gap (p t x : A) (hp : p*p=p) + (hpt : Commute p t) (a : ℝ) (ha : 2*‖t‖ < a) + (hx : Commute (a • p+t) x) : Commute p x := by + have h₁ := offDiagonal_eq_zero_of_gap p t x hp hpt a ha hx + have hcp : (1-p)*(1-p)=1-p := by noncomm_ring [hp] + have hcpt : Commute (1-p) (-t) := ((Commute.one_left t).sub_left hpt).neg_right + have hcx : Commute (a • (1-p)+ -t) x := by + have he : a • (1-p)+ -t = a • (1 : A)-(a • p+t) := by + rw [smul_sub]; abel + rw [he] + exact ((Commute.one_left x).smul_left a).sub_left hx + have h₂ := offDiagonal_eq_zero_of_gap (1-p) (-t) x hcp hcpt a + (by simpa only [norm_neg] using ha) hcx + simp only [sub_sub_cancel] at h₂ + show p*x=x*p + have h₁' : p*x=p*x*p := by simpa only [mul_sub,mul_one,sub_eq_zero] using h₁ + have h₂' : x*p=p*x*p := by simpa only [sub_mul,one_mul,sub_eq_zero] using h₂ + exact h₁'.trans h₂'.symm + +end + +/-! Countably many commuting projections have one self-adjoint generator. +We use coefficients 3*4^(-(n+1)), whose strict gap admits direct norm recovery +through the double commutant. No trace, tensor model, or uniqueness is used. -/ +namespace CommutingProjectionEncoding +open scoped BigOperators Topology +open Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def weight (n : ℕ) : ℝ := (3/4)*(1/4)^n + +theorem weight_nonneg (n : ℕ) : 0 ≤ weight n := by unfold weight; positivity + +theorem weight_hasSum (n : ℕ) : + HasSum (fun k => weight (n+k)) ((1/4 : ℝ)^n) := by + have h := (hasSum_geometric_of_lt_one (by norm_num : (0:ℝ) ≤ 1/4) + (by norm_num : (1/4:ℝ) < 1)).mul_left ((3/4:ℝ)*(1/4)^n) + convert! h using 1 + · ext k; simp only [weight,pow_add]; ring + · ring + +def tail (e : ℕ → (H →L[ℂ] H)) (n : ℕ) : (H →L[ℂ] H) := ∑' k, weight (n+k) • e (n+k) + +variable (e : ℕ → (H →L[ℂ] H)) (hp : ∀ n, IsStarProjection (e n)) +include hp + +theorem term_norm_le (n k : ℕ) : ‖(weight (n+k) • e (n+k) : (H →L[ℂ] H))‖ ≤ weight (n+k) := by + rw [norm_smul,Real.norm_of_nonneg (weight_nonneg _)] + exact (mul_le_mul_of_nonneg_left (hp (n+k)).norm_le (weight_nonneg _)).trans_eq (mul_one _) + +theorem tail_summable (n : ℕ) : Summable (fun k => (weight (n+k) • e (n+k) : (H →L[ℂ] H))) := by + exact (weight_hasSum n).summable.of_norm_bounded (term_norm_le e hp n) + +theorem tail_norm_le (n : ℕ) : ‖tail e n‖ ≤ (1/4 : ℝ)^n := + tsum_of_norm_bounded (weight_hasSum n) (term_norm_le e hp n) + +theorem tail_step (n : ℕ) : tail e n = weight n • e n + tail e (n+1) := by + have h := (tail_summable e hp n).tsum_eq_zero_add + simpa only [tail,Nat.add_zero,Nat.add_assoc,Nat.add_comm,Nat.add_left_comm] using h + +theorem tail_selfAdjoint (n : ℕ) : IsSelfAdjoint (tail e n) := by + have h := (tail_summable e hp n).hasSum.star + simp only [star_smul,star_trivial,(hp _).isSelfAdjoint.star_eq] at h + exact h.unique (tail_summable e hp n).hasSum + +theorem tail_mem (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : WOTClosed S) + (he : ∀ n, e n ∈ S) (n : ℕ) : tail e n ∈ S := by + apply (wotClosed_normClosed S hS).mem_of_tendsto (tail_summable e hp n).hasSum + exact Eventually.of_forall fun s => S.sum_mem fun k _ => by + rw [← Complex.coe_smul] + exact S.smul_mem (he (n+k)) _ + +variable (hc : ∀ i j, Commute (e i) (e j)) +include hc + +omit hp [CompleteSpace H] in +theorem projection_commutes_tail (i n : ℕ) : Commute (e i) (tail e n) := + Commute.tsum_right _ fun k => (hc i (n+k)).smul_right _ + +theorem projection_mem_of_tail_mem (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : WOTClosed S) + (n : ℕ) (ht : tail e n ∈ S) : e n ∈ S := by + change e n ∈ (S : Set (H →L[ℂ] H)) + rw [← wotClosed_bicommutant S hS] + intro x hx + have hxt : Commute (weight n • e n+tail e (n+1)) x := by + rw [← tail_step e hp n] + exact hx _ ht + have hgap : 2*‖tail e (n+1)‖ < weight n := by + have h := tail_norm_le e hp (n+1) + have hn : 0 < (1/4:ℝ)^n := by positivity + dsimp [weight] + rw [pow_succ] at h + nlinarith + exact (commute_projection_of_gap (e n) (tail e (n+1)) x + (hp n).isIdempotentElem.eq (projection_commutes_tail e hc n (n+1)) + (weight n) hgap hxt).eq.symm + +theorem projection_mem_wstar (n : ℕ) : e n ∈ wstar {tail e 0} := by + let S := wstar {tail e 0} + have hS : WOTClosed S := wstar_closed _ + have ht : ∀ k, tail e k ∈ S := by + intro k + induction k with + | zero => exact subset_wstar _ (Set.mem_singleton _) + | succ k ih => + have he := projection_mem_of_tail_mem e hp hc S hS k ih + have hs : weight k • e k ∈ S := by + rw [← Complex.coe_smul] + exact S.smul_mem he _ + have h := S.sub_mem ih hs + rw [tail_step e hp k,add_sub_cancel_left] at h + exact h + exact projection_mem_of_tail_mem e hp hc S hS n (ht n) + +theorem wstar_encoding : wstar {tail e 0} = wstar (Set.range e) := by + apply le_antisymm + · apply wstar_le (wstar_closed _) + intro x hx + rcases Set.mem_singleton_iff.mp hx with rfl + exact tail_mem e hp (wstar (Set.range e)) (wstar_closed _) + (fun n => subset_wstar (Set.range e) (Set.mem_range_self n)) 0 + · apply wstar_le (wstar_closed _) + rintro x ⟨n,rfl⟩ + exact projection_mem_wstar e hp hc n + +/-- Countable commuting-projection encoding without additional structural hypotheses. -/ +theorem exists_selfAdjoint_generator : + ∃ b : (H →L[ℂ] H), IsSelfAdjoint b ∧ ‖b‖ ≤ 1 ∧ wstar {b}=wstar (Set.range e) := + ⟨tail e 0,tail_selfAdjoint e hp 0,by simpa using tail_norm_le e hp 0, + wstar_encoding e hp hc⟩ + +end CommutingProjectionEncoding + +/-! The spectral separation step as an exact membership theorem for literal W*. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem idempotent_mem_wstar_of_gap (p t : H →L[ℂ] H) (hp : p*p=p) + (hpt : Commute p t) (a : ℝ) (ha : 2*‖t‖ < a) : p ∈ wstar {a • p+t} := by + let S := wstar {a • p+t} + change p ∈ (S : Set (H →L[ℂ] H)) + rw [← wotClosed_bicommutant S (wstar_closed _)] + intro x hx + exact (commute_projection_of_gap p t x hp hpt a ha + (hx _ (subset_wstar _ rfl))).eq.symm + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ProjectionLimits.lean b/lean/OAI/Analysis/FactorGeneration/ProjectionLimits.lean new file mode 100644 index 0000000000000000000000000000000000000000..3dd31c45867ee233748d0d1debf8bd7e88d8d156 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ProjectionLimits.lean @@ -0,0 +1,619 @@ +import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Order.Zorn +import OAI.Analysis.FactorGeneration.TraceTopology + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! A nonzero projection in a diffuse tracial algebra contains nonzero projections of arbitrarily small trace. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem projection_trace_sq (p : M.toStarSubalgebra) (hp : IsStarProjection p) : + (τ.trace p).re = τ.norm₂ p ^ 2 := by + have h := congrArg Complex.re (τ.trace_star_mul p) + simpa only [hp.isSelfAdjoint.star_eq, hp.isIdempotentElem.eq, + ← Complex.ofReal_pow, Complex.ofReal_re] using h + +theorem projection_trace_pos (p : M.toStarSubalgebra) (hp : IsStarProjection p) (hne : p ≠ 0) : + 0 < (τ.trace p).re := by + rw [projection_trace_sq τ p hp] + exact sq_pos_of_ne_zero (fun h => hne ((τ.norm₂_eq_zero_iff p).mp h)) + +theorem exists_half_trace_subprojection + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + (p : M.toStarSubalgebra) (hp : IsStarProjection p) (hne : p ≠ 0) : + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ p*q = q ∧ q*p = q ∧ + (τ.trace q).re ≤ (τ.trace p).re/2 := by + obtain ⟨q, hq, hq0, hqp, hpq, hqp'⟩ := hdiff p hp hne + by_cases hsmall : (τ.trace q).re ≤ (τ.trace p).re/2 + · exact ⟨q,hq,hq0,hpq,hqp',hsmall⟩ + · refine ⟨p-q, ?_, sub_ne_zero.mpr hqp.symm, ?_, ?_, ?_⟩ + · exact hq.sub_of_mul_eq_right hp hpq + · rw [mul_sub, hp.isIdempotentElem.eq, hpq] + · rw [sub_mul, hp.isIdempotentElem.eq, hqp'] + · have ht : τ.trace (p-q) = τ.trace p-τ.trace q := inner_sub_right _ _ _ + rw [ht, Complex.sub_re] + linarith + +theorem exists_geometric_trace_subprojection + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + (p : M.toStarSubalgebra) (hp : IsStarProjection p) (hne : p ≠ 0) (n : ℕ) : + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ p*q = q ∧ q*p = q ∧ + (τ.trace q).re ≤ (1/2 : ℝ)^n * (τ.trace p).re := by + induction n with + | zero => exact ⟨p,hp,hne,hp.isIdempotentElem.eq,hp.isIdempotentElem.eq,by simp⟩ + | succ n ih => + obtain ⟨q,hq,hq0,hpq,hqp,htq⟩ := ih + obtain ⟨r,hr,hr0,hqr,hrq,htr⟩ := exists_half_trace_subprojection τ hdiff q hq hq0 + refine ⟨r,hr,hr0,?_,?_,?_⟩ + · calc p*r = p*(q*r) := by rw [hqr] + _ = (p*q)*r := (mul_assoc _ _ _).symm + _ = r := by rw [hpq,hqr] + · calc r*p = (r*q)*p := by rw [hrq] + _ = r*(q*p) := mul_assoc _ _ _ + _ = r := by rw [hqp,hrq] + · rw [pow_succ] + nlinarith + +theorem exists_small_trace_subprojection + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + (p : M.toStarSubalgebra) (hp : IsStarProjection p) (hne : p ≠ 0) + (ε : ℝ) (hε : 0 < ε) : + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ p*q = q ∧ q*p = q ∧ + 0 < (τ.trace q).re ∧ (τ.trace q).re < ε := by + have ht : Tendsto (fun n : ℕ => (1/2 : ℝ)^n * (τ.trace p).re) atTop (𝓝 0) := by + simpa using (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0:ℝ) ≤ 1/2) + (by norm_num : (1/2:ℝ) < 1)).mul_const (τ.trace p).re + have he : ∀ᶠ n : ℕ in atTop, (1/2 : ℝ)^n * (τ.trace p).re < ε := ht (Iio_mem_nhds hε) + obtain ⟨n,hn⟩ := he.exists + obtain ⟨q,hq,hq0,hpq,hqp,hbound⟩ := exists_geometric_trace_subprojection τ hdiff p hp hne n + exact ⟨q,hq,hq0,hpq,hqp,projection_trace_pos τ q hq hq0,hbound.trans_lt hn⟩ + +end + +/-! Monotone projection limits with trace bounds, giving chain bounds for prescribed trace cuts. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- Projections with their algebraic range-inclusion order. -/ +def AlgebraProjection (M : VonNeumannAlgebra H) := + {p : M.toStarSubalgebra // IsStarProjection p} + +instance algebraProjectionPartialOrder : PartialOrder (AlgebraProjection M) where + le p q := q.val * p.val = p.val + le_refl p := p.property.isIdempotentElem.eq + le_trans a b c hab hbc := by + calc c.val * a.val = c.val * (b.val * a.val) := by rw [hab] + _ = (c.val * b.val) * a.val := (mul_assoc _ _ _).symm + _ = a.val := by rw [hbc, hab] + le_antisymm a b hab hba := by + apply Subtype.ext + have h := congrArg star hab + simp only [star_mul, a.property.isSelfAdjoint.star_eq, + b.property.isSelfAdjoint.star_eq] at h + exact h.symm.trans hba + +theorem projection_mul_of_le {p q : AlgebraProjection M} (h : p ≤ q) : + p.val * q.val = p.val := by + have he := congrArg star h + simpa only [star_mul, p.property.isSelfAdjoint.star_eq, + q.property.isSelfAdjoint.star_eq] using he + +/-- A bounded increasing net of actual projections has a projection upper bound +with the same trace bound. No projection-lattice completeness is assumed. -/ +theorem monotone_projection_upper_bound (τ : TracialRepresentation M) + {ι : Type*} [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] + (a : ι → AlgebraProjection M) (ha : Monotone a) (r : ℝ) + (hr : ∀ i, (τ.trace (a i).val).re ≤ r) : + ∃ b : AlgebraProjection M, (∀ i, a i ≤ b) ∧ (τ.trace b.val).re ≤ r ∧ + ∀ p : AlgebraProjection M, (∀ i, a i ≤ p) → b ≤ p := by + let ω : Ultrafilter ι := Ultrafilter.of atTop + obtain ⟨T, hT, ht⟩ := exists_weak_operator_ultralimit ω + (fun i => ((a i).val : H →L[ℂ] H)) 1 (by norm_num) + (fun i => (a i).property.norm_le) + let b : M.toStarSubalgebra := ⟨T, weak_operator_limit_mem M (fun i => (a i).val) T ht⟩ + have hb (x y : H) : Tendsto (fun i => inner ℂ y (((a i).val : H →L[ℂ] H) x)) + (ω : Filter ι) (𝓝 (inner ℂ y ((b : H →L[ℂ] H) x))) := ht x y + have hadj (i : ι) (x y : H) : + inner ℂ x (((a i).val : H →L[ℂ] H) y) = + inner ℂ (((a i).val : H →L[ℂ] H) x) y := by + have hs : star (((a i).val : H →L[ℂ] H)) = ((a i).val : H →L[ℂ] H) := + congrArg Subtype.val (a i).property.isSelfAdjoint.star_eq + calc inner ℂ x (((a i).val : H →L[ℂ] H) y) = + inner ℂ x (star (((a i).val : H →L[ℂ] H)) y) := by rw [hs] + _ = inner ℂ (((a i).val : H →L[ℂ] H) x) y := by + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + have hself : star b = b := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + have hh := (hb y x).star + change Tendsto (fun i => (starRingEnd ℂ) (inner ℂ x (((a i).val : H →L[ℂ] H) y))) + (ω : Filter ι) (𝓝 ((starRingEnd ℂ) (inner ℂ x ((b : H →L[ℂ] H) y)))) at hh + simp only [inner_conj_symm] at hh + have eq := tendsto_nhds_unique (hb x y) (hh.congr (fun i => (hadj i y x).symm)) + change inner ℂ y (star (b : H →L[ℂ] H) x) = inner ℂ y ((b : H →L[ℂ] H) x) + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + exact eq.symm + have hba (i : ι) : b * (a i).val = (a i).val := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + apply tendsto_nhds_unique (hb (((a i).val : H →L[ℂ] H) x) y) + apply tendsto_const_nhds.congr' + filter_upwards [(eventually_ge_atTop i).filter_mono (Ultrafilter.of_le atTop)] with j hj + exact (congrArg (fun z : M.toStarSubalgebra => inner ℂ y ((z : H →L[ℂ] H) x)) (ha hj)).symm + have hab (i : ι) : (a i).val * b = (a i).val := by + have h := congrArg star (hba i) + simpa only [star_mul, hself, (a i).property.isSelfAdjoint.star_eq] using h + have hid : b * b = b := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + apply tendsto_nhds_unique (hb ((b : H →L[ℂ] H) x) y) + exact (hb x y).congr (fun i => + (congrArg (fun z : M.toStarSubalgebra => inner ℂ y ((z : H →L[ℂ] H) x)) (hab i)).symm) + refine ⟨⟨b, ⟨hid, hself⟩⟩, hba, ?_, ?_⟩ + · exact le_of_tendsto ((Complex.continuous_re.tendsto _).comp (hb τ.vector τ.vector)) + (Eventually.of_forall hr) + · intro p hp + change p.val * b = b + apply Subtype.ext + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + have hh := hb x (star (p.val : H →L[ℂ] H) y) + simp only [ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_left] at hh + exact tendsto_nhds_unique hh ((hb x y).congr (fun i => + (congrArg (fun z : M.toStarSubalgebra => inner ℂ y ((z : H →L[ℂ] H) x)) (hp i)).symm)) + +end + +/-! Exact trace cuts in a diffuse coordinate algebra. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_maximal_trace_subprojection (p : AlgebraProjection M) + (r : ℝ) (hr : 0 ≤ r) : + ∃ q : AlgebraProjection M, q ≤ p ∧ (τ.trace q.val).re ≤ r ∧ + ∀ s : AlgebraProjection M, s ≤ p → (τ.trace s.val).re ≤ r → q ≤ s → s ≤ q := by + let S : Set (AlgebraProjection M) := {q | q ≤ p ∧ (τ.trace q.val).re ≤ r} + obtain ⟨q,hq⟩ := zorn_le₀ S (by + intro c hc hchain + by_cases hne : c.Nonempty + · let : Nonempty c := hne.to_subtype + let : IsDirected c (· ≤ ·) := ⟨by + intro x y + obtain ⟨z,hz,hxz,hyz⟩ := hchain.directedOn x.val x.property y.val y.property + exact ⟨⟨z,hz⟩,hxz,hyz⟩⟩ + obtain ⟨b,hb,hbr,hmin⟩ := monotone_projection_upper_bound τ + (fun x : c => x.val) (fun _ _ h => h) r (fun x => (hc x.property).2) + exact ⟨b, ⟨hmin p (fun x => (hc x.property).1),hbr⟩, + fun z hz => hb ⟨z,hz⟩⟩ + · refine ⟨⟨0,IsStarProjection.zero _⟩, ⟨?_,?_⟩, ?_⟩ + · change p.val * 0 = 0 + exact mul_zero _ + · simpa [TracialRepresentation.trace] using hr + · intro z hz + exact (hne ⟨z,hz⟩).elim) + exact ⟨q,hq.1.1,hq.1.2,fun s hsp hsr hqs => hq.2 ⟨hsp,hsr⟩ hqs⟩ + +/-- Every projection can be cut to any smaller prescribed real trace. -/ +theorem exists_exact_trace_subprojection + (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + (p : M.toStarSubalgebra) (hp : IsStarProjection p) + (r : ℝ) (hr : 0 ≤ r) (hrp : r ≤ (τ.trace p).re) : + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ p*q = q ∧ q*p = q ∧ + τ.trace q = (r : ℂ) := by + obtain ⟨q,hqp,hqr,hmax⟩ := exists_maximal_trace_subprojection τ ⟨p,hp⟩ r hr + have hpq : p*q.val = q.val := hqp + have hqp' : q.val*p = q.val := projection_mul_of_le hqp + have htrace : (τ.trace q.val).re = r := by + by_contra hne + have hlt : (τ.trace q.val).re < r := lt_of_le_of_ne hqr hne + have hres : IsStarProjection (p-q.val) := q.property.sub_of_mul_eq_right hp hpq + have hres0 : p-q.val ≠ 0 := by + intro he + have he' : p=q.val := sub_eq_zero.mp he + rw [he'] at hrp + exact (not_lt_of_ge hrp) hlt + obtain ⟨s,hs,hs0,hps,hsp,hst,hsmall⟩ := exists_small_trace_subprojection τ hdiff + (p-q.val) hres hres0 (r-(τ.trace q.val).re) (sub_pos.mpr hlt) + have hqs : q.val*s = 0 := by + calc q.val*s = q.val*((p-q.val)*s) := by rw [hps] + _ = (q.val*(p-q.val))*s := (mul_assoc _ _ _).symm + _ = 0 := by rw [mul_sub,hqp',q.property.isIdempotentElem.eq,sub_self,zero_mul] + have hsq : s*q.val = 0 := by + simpa only [star_mul,hs.isSelfAdjoint.star_eq,q.property.isSelfAdjoint.star_eq,star_zero] + using congrArg star hqs + have hps' : p*s=s := by + have he : p*(p-q.val)=p-q.val := by rw [mul_sub,hp.isIdempotentElem.eq,hpq] + calc p*s = p*((p-q.val)*s) := by rw [hps] + _ = (p*(p-q.val))*s := (mul_assoc _ _ _).symm + _ = s := by rw [he,hps] + let t : AlgebraProjection M := ⟨q.val+s,q.property.add hs hqs⟩ + have htp : t ≤ ⟨p,hp⟩ := by + change p*(q.val+s)=q.val+s + rw [mul_add,hpq,hps'] + have hqt : q ≤ t := by + change (q.val+s)*q.val=q.val + rw [add_mul,q.property.isIdempotentElem.eq,hsq,add_zero] + have htt : (τ.trace t.val).re ≤ r := by + change (τ.trace (q.val+s)).re ≤ r + have he : τ.trace (q.val+s)=τ.trace q.val+τ.trace s := inner_add_right _ _ _ + rw [he,Complex.add_re] + linarith + have heq : t=q := le_antisymm (hmax t htp htt hqt) hqt + have he : q.val+s=q.val := congrArg Subtype.val heq + have : s=0 := add_left_cancel (he.trans (add_zero q.val).symm) + exact hs0 this + refine ⟨q.val,q.property,hpq,hqp',?_⟩ + have he := τ.trace_star_mul q.val + rw [q.property.isSelfAdjoint.star_eq,q.property.isIdempotentElem.eq] at he + rw [he,← Complex.ofReal_pow] + congr 1 + rw [← projection_trace_sq τ q.val q.property,htrace] + +end + +/-! Algebraic part of Popa 1308.3982v3, Lemma 3.2: adding a supported +partial unitary in the residual corner. The small mixed-word estimates and +the existence of an appropriate patch are separate analytic requirements. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- An actual operator with identical initial and final support p. -/ +structure CornerUnitary (p : AlgebraProjection M) where + val : M.toStarSubalgebra + initial : star val * val = p.val + final : val * star val = p.val + +namespace CornerUnitary +variable {p q : AlgebraProjection M} + +theorem mul_support (v : CornerUnitary p) : v.val*p.val=v.val := by + have htr : star v.val*(v.val*p.val)=p.val := by + rw [← mul_assoc,v.initial,p.property.isIdempotentElem.eq] + have he : star (v.val-v.val*p.val)*(v.val-v.val*p.val)=0 := by + simp only [star_sub,star_mul,p.property.isSelfAdjoint.star_eq,sub_mul,mul_sub, + mul_assoc,v.initial,htr,p.property.isIdempotentElem.eq,sub_self] + exact (sub_eq_zero.mp ((CStarRing.star_mul_self_eq_zero_iff _).mp he)).symm + +theorem support_mul (v : CornerUnitary p) : p.val*v.val=v.val := by + calc p.val*v.val = (v.val*star v.val)*v.val := by rw [v.final] + _ = v.val*(star v.val*v.val) := mul_assoc _ _ _ + _ = v.val := by rw [v.initial,v.mul_support] + +def adjoint (v : CornerUnitary p) : CornerUnitary p := + ⟨star v.val,by simpa only [star_star] using v.final, + by simpa only [star_star] using v.initial⟩ + +theorem mul_eq_zero (v : CornerUnitary p) (w : CornerUnitary q) (hpq : p.val*q.val=0) : + v.val*w.val=0 := by + calc v.val*w.val = (v.val*p.val)*(q.val*w.val) := by rw [v.mul_support,w.support_mul] + _ = v.val*(p.val*q.val)*w.val := by simp only [mul_assoc] + _ = 0 := by rw [hpq,mul_zero,zero_mul] + +def patch (v : CornerUnitary p) (w : CornerUnitary q) (hpq : p.val*q.val=0) : + CornerUnitary ⟨p.val+q.val,p.property.add q.property hpq⟩ where + val := v.val+w.val + initial := by + have hqp : q.val*p.val=0 := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq,q.property.isSelfAdjoint.star_eq,star_zero] + using congrArg star hpq + have h₁ : star v.val*w.val=0 := v.adjoint.mul_eq_zero w hpq + have h₂ : star w.val*v.val=0 := w.adjoint.mul_eq_zero v hqp + change star (v.val+w.val)*(v.val+w.val)=p.val+q.val + rw [star_add,add_mul,mul_add,mul_add,v.initial,w.initial,h₁,h₂,add_zero,zero_add] + final := by + have hqp : q.val*p.val=0 := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq,q.property.isSelfAdjoint.star_eq,star_zero] + using congrArg star hpq + have h₁ : v.val*star w.val=0 := v.mul_eq_zero w.adjoint hpq + have h₂ : w.val*star v.val=0 := w.mul_eq_zero v.adjoint hqp + change (v.val+w.val)*star (v.val+w.val)=p.val+q.val + rw [star_add,add_mul,mul_add,mul_add,v.final,w.final,h₁,h₂,add_zero,zero_add] + +theorem patch_extends (v : CornerUnitary p) (w : CornerUnitary q) (hpq : p.val*q.val=0) : + (patch v w hpq).val*(star v.val*v.val)=v.val := by + have hqp : q.val*p.val=0 := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq,q.property.isSelfAdjoint.star_eq,star_zero] + using congrArg star hpq + change (v.val+w.val)*(star v.val*v.val)=v.val + rw [v.initial,add_mul,v.mul_support] + have he : w.val*p.val=0 := by + calc w.val*p.val=(w.val*q.val)*p.val := by rw [w.mul_support] + _ = 0 := by rw [mul_assoc,hqp,mul_zero] + rw [he,add_zero] + +theorem norm_sq (v : CornerUnitary p) : ‖v.val‖*‖v.val‖=‖p.val‖ := by + rw [← CStarRing.norm_star_mul_self,v.initial] + +theorem norm_le_one (v : CornerUnitary p) : ‖v.val‖ ≤ 1 := by + have he := v.norm_sq + have hp := p.property.norm_le + nlinarith [norm_nonneg v.val] + +theorem trace_norm_sq (τ : TracialRepresentation M) (v : CornerUnitary p) : + τ.norm₂ v.val ^ 2 = (τ.trace p.val).re := by + have he := congrArg Complex.re (τ.trace_star_mul v.val) + rw [v.initial] at he + simpa only [← Complex.ofReal_pow,Complex.ofReal_re] using he.symm + +theorem patch_trace_increases (τ : TracialRepresentation M) + (v : CornerUnitary p) (w : CornerUnitary q) (hpq : p.val*q.val=0) (hq : q.val ≠ 0) : + (τ.trace (star v.val*v.val)).re < + (τ.trace (star (patch v w hpq).val*(patch v w hpq).val)).re := by + rw [v.initial,(patch v w hpq).initial] + have he : τ.trace (p.val+q.val)=τ.trace p.val+τ.trace q.val := inner_add_right _ _ _ + rw [he,Complex.add_re] + exact lt_add_of_pos_right _ (projection_trace_pos τ q.val q.property hq) + +end CornerUnitary + +end + +/-! Dyadic projections inside a diffuse algebra with faithful trace. -/ +section +open UltrapowerBridge +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +/-- At depth n there are 2^n indices; a successor appends a binary branch. -/ +def DyadicIndex : ℕ → Type + | 0 => Unit + | n+1 => DyadicIndex n × Bool + +instance dyadicIndexFintype : (n : ℕ) → Fintype (DyadicIndex n) + | 0 => inferInstanceAs (Fintype Unit) + | n+1 => @instFintypeProd _ _ (dyadicIndexFintype n) inferInstance + +instance dyadicIndexDecidableEq (n : ℕ) : DecidableEq (DyadicIndex n) := Classical.decEq _ + +theorem card_dyadicIndex (n : ℕ) : Fintype.card (DyadicIndex n) = 2^n := by + induction n with + | zero => rfl + | succ n ih => change Fintype.card (DyadicIndex n × Bool) = _; simp [ih,pow_succ] + +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + +include hdiff in +theorem exists_half_trace_cut (p : AlgebraProjection M) : + ∃ q : AlgebraProjection M, q ≤ p ∧ τ.trace q.val = ((τ.trace p.val).re/2 : ℝ) := by + have ht : 0 ≤ (τ.trace p.val).re := by + rw [projection_trace_sq τ p.val p.property] + positivity + obtain ⟨q,hq,hpq,hqp,htr⟩ := exists_exact_trace_subprojection τ hdiff p.val p.property + ((τ.trace p.val).re/2) (by positivity) (by linarith) + exact ⟨⟨q,hq⟩,hpq,htr⟩ + +def halfTraceCut (p : AlgebraProjection M) : AlgebraProjection M := + (exists_half_trace_cut τ hdiff p).choose + +theorem halfTraceCut_le (p : AlgebraProjection M) : halfTraceCut τ hdiff p ≤ p := + (exists_half_trace_cut τ hdiff p).choose_spec.1 + +theorem halfTraceCut_trace (p : AlgebraProjection M) : + τ.trace (halfTraceCut τ hdiff p).val = ((τ.trace p.val).re/2 : ℝ) := + (exists_half_trace_cut τ hdiff p).choose_spec.2 + +/-- Both halves belong to the original algebra. -/ +def splitProjection (p : AlgebraProjection M) (b : Bool) : AlgebraProjection M := + if b then ⟨p.val-(halfTraceCut τ hdiff p).val, + (halfTraceCut τ hdiff p).property.sub_of_mul_eq_right p.property (halfTraceCut_le τ hdiff p)⟩ + else halfTraceCut τ hdiff p + +theorem splitProjection_le (p : AlgebraProjection M) (b : Bool) : + splitProjection τ hdiff p b ≤ p := by + cases b + · exact halfTraceCut_le τ hdiff p + · change p.val*(p.val-(halfTraceCut τ hdiff p).val)=p.val-(halfTraceCut τ hdiff p).val + rw [mul_sub,p.property.isIdempotentElem.eq,halfTraceCut_le τ hdiff p] + +theorem splitProjection_sum (p : AlgebraProjection M) : + (splitProjection τ hdiff p false).val+(splitProjection τ hdiff p true).val=p.val := by + simp [splitProjection] + +theorem splitProjection_orthogonal (p : AlgebraProjection M) : + (splitProjection τ hdiff p false).val*(splitProjection τ hdiff p true).val=0 := by + change (halfTraceCut τ hdiff p).val*(p.val-(halfTraceCut τ hdiff p).val)=0 + rw [mul_sub,projection_mul_of_le (halfTraceCut_le τ hdiff p), + (halfTraceCut τ hdiff p).property.isIdempotentElem.eq,sub_self] + +theorem splitProjection_trace (p : AlgebraProjection M) (b : Bool) : + τ.trace (splitProjection τ hdiff p b).val = ((τ.trace p.val).re/2 : ℝ) := by + cases b + · exact halfTraceCut_trace τ hdiff p + · change τ.trace (p.val-(halfTraceCut τ hdiff p).val)=_ + have he : τ.trace (p.val-(halfTraceCut τ hdiff p).val)= + τ.trace p.val-τ.trace (halfTraceCut τ hdiff p).val := inner_sub_right _ _ _ + have hreal : τ.trace p.val = ((τ.trace p.val).re : ℂ) := by + have h := τ.trace_star_mul p.val + rw [p.property.isSelfAdjoint.star_eq,p.property.isIdempotentElem.eq] at h + rw [h,← Complex.ofReal_pow,Complex.ofReal_re] + rw [he,halfTraceCut_trace,hreal] + simp only [Complex.ofReal_re] + push_cast + ring + +def dyadicProjection (p : AlgebraProjection M) : (n : ℕ) → DyadicIndex n → AlgebraProjection M + | 0, _ => p + | n+1, i => splitProjection τ hdiff (dyadicProjection p n i.1) i.2 + +theorem dyadicProjection_le_parent (p : AlgebraProjection M) (n : ℕ) (i : DyadicIndex (n+1)) : + dyadicProjection τ hdiff p (n+1) i ≤ dyadicProjection τ hdiff p n i.1 := + splitProjection_le τ hdiff _ _ + +theorem dyadicProjection_trace (p : AlgebraProjection M) (n : ℕ) (i : DyadicIndex n) : + (τ.trace (dyadicProjection τ hdiff p n i).val).re = (τ.trace p.val).re/(2:ℝ)^n := by + induction n with + | zero => simp [dyadicProjection] + | succ n ih => + change (τ.trace (splitProjection τ hdiff (dyadicProjection τ hdiff p n i.1) i.2).val).re = _ + rw [splitProjection_trace,Complex.ofReal_re,ih,pow_succ] + ring + +theorem dyadicProjection_sum (p : AlgebraProjection M) (n : ℕ) : + ∑ i : DyadicIndex n, (dyadicProjection τ hdiff p n i).val = p.val := by + induction n with + | zero => change (∑ _ : Unit, p.val)=p.val; simp + | succ n ih => + change (∑ i : DyadicIndex n × Bool, + (splitProjection τ hdiff (dyadicProjection τ hdiff p n i.1) i.2).val)=p.val + rw [Fintype.sum_prod_type] + simpa only [Fintype.sum_bool,add_comm,splitProjection_sum] using ih + +theorem orthogonal_subprojections {p q a b : AlgebraProjection M} + (hpq : p.val*q.val=0) (ha : a ≤ p) (hb : b ≤ q) : a.val*b.val=0 := by + calc a.val*b.val = (a.val*p.val)*(q.val*b.val) := by rw [projection_mul_of_le ha,hb] + _ = a.val*(p.val*q.val)*b.val := by simp only [mul_assoc] + _ = 0 := by rw [hpq,mul_zero,zero_mul] + +theorem dyadicProjection_orthogonal (p : AlgebraProjection M) (n : ℕ) + (i j : DyadicIndex n) (hij : i ≠ j) : + (dyadicProjection τ hdiff p n i).val*(dyadicProjection τ hdiff p n j).val=0 := by + induction n with + | zero => exact (hij (@Subsingleton.elim Unit _ i j)).elim + | succ n ih => + by_cases he : i.1=j.1 + · obtain ⟨i,b⟩ := i + obtain ⟨j,c⟩ := j + dsimp at he + subst j + cases b <;> cases c + · exact (hij rfl).elim + · exact splitProjection_orthogonal τ hdiff _ + · have h := congrArg star (splitProjection_orthogonal τ hdiff (dyadicProjection τ hdiff p n i)) + simpa only [dyadicProjection,star_mul,star_zero,(splitProjection τ hdiff _ false).property.isSelfAdjoint.star_eq, + (splitProjection τ hdiff _ true).property.isSelfAdjoint.star_eq] using h + · exact (hij rfl).elim + · exact orthogonal_subprojections (ih i.1 j.1 he) + (dyadicProjection_le_parent τ hdiff p n i) (dyadicProjection_le_parent τ hdiff p n j) + +end + +/-! Finite spectral sums in the constructed dyadic projection algebras. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def coordinateTraceLinear (τ : TracialRepresentation M) : M.toStarSubalgebra →ₗ[ℂ] ℂ where + toFun := τ.trace + map_add' _ _ := inner_add_right _ _ _ + map_smul' _ _ := inner_smul_right _ _ _ + +theorem projection_trace_real (τ : TracialRepresentation M) (p : AlgebraProjection M) : + τ.trace p.val = ((τ.trace p.val).re : ℂ) := by + have h := τ.trace_star_mul p.val + rw [p.property.isSelfAdjoint.star_eq,p.property.isIdempotentElem.eq] at h + rw [h,← Complex.ofReal_pow,Complex.ofReal_re] + +variable {ι : Type*} [Fintype ι] + +def projectionSum (a : ι → AlgebraProjection M) (c : ι → ℂ) : M.toStarSubalgebra := + ∑ i, c i • (a i).val + +theorem projectionSum_star (a : ι → AlgebraProjection M) (c : ι → ℂ) : + star (projectionSum a c)=projectionSum a (fun i => star (c i)) := by + simp only [projectionSum,star_sum,star_smul,(a _).property.isSelfAdjoint.star_eq] + +theorem projectionSum_mul (a : ι → AlgebraProjection M) + (ha : ∀ i j, i ≠ j → (a i).val*(a j).val=0) (c d : ι → ℂ) : + projectionSum a c*projectionSum a d=projectionSum a (fun i => c i*d i) := by + classical + unfold projectionSum + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.mul_sum] + rw [Finset.sum_eq_single i] + · rw [smul_mul_assoc,mul_smul_comm,smul_smul,(a i).property.isIdempotentElem.eq] + · intro j _ hji + rw [smul_mul_assoc,mul_smul_comm,ha i j hji.symm,smul_zero,smul_zero] + · simp + +theorem projectionSum_trace (τ : TracialRepresentation M) + (a : ι → AlgebraProjection M) (c : ι → ℂ) : + τ.trace (projectionSum a c)=∑ i, c i*τ.trace (a i).val := by + change coordinateTraceLinear τ (∑ i, c i • (a i).val)=_ + rw [map_sum] + apply Finset.sum_congr rfl + intro i _ + exact (coordinateTraceLinear τ).map_smul (c i) (a i).val + +variable (τ : TracialRepresentation M) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q = q ∧ q*p = q) + +abbrev dyadicEval (p : AlgebraProjection M) (n : ℕ) (c : DyadicIndex n → ℂ) := + projectionSum (dyadicProjection τ hdiff p n) c + +theorem dyadicEval_one (p : AlgebraProjection M) (n : ℕ) : + dyadicEval τ hdiff p n (fun _ => 1)=p.val := by + simpa only [dyadicEval,projectionSum,one_smul] using dyadicProjection_sum τ hdiff p n + +theorem dyadicEval_refine (p : AlgebraProjection M) (n : ℕ) (c : DyadicIndex n → ℂ) : + dyadicEval τ hdiff p (n+1) (fun i => c i.1)=dyadicEval τ hdiff p n c := by + change (∑ i : DyadicIndex n × Bool, c i.1 • + (splitProjection τ hdiff (dyadicProjection τ hdiff p n i.1) i.2).val)=_ + rw [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro i _ + rw [Fintype.sum_bool,add_comm,← smul_add,splitProjection_sum] + +theorem dyadicEval_lift (p : AlgebraProjection M) {m n : ℕ} (hmn : m ≤ n) + (c : DyadicIndex m → ℂ) : + ∃ d : DyadicIndex n → ℂ, dyadicEval τ hdiff p m c=dyadicEval τ hdiff p n d := by + induction n,hmn using Nat.le_induction with + | base => exact ⟨c,rfl⟩ + | succ n hmn ih => + obtain ⟨d,hd⟩ := ih + exact ⟨fun i => d i.1,hd.trans (dyadicEval_refine τ hdiff p n d).symm⟩ + +theorem dyadicEval_trace (p : AlgebraProjection M) (n : ℕ) (c : DyadicIndex n → ℂ) : + τ.trace (dyadicEval τ hdiff p n c)= + ∑ i, c i*((τ.trace p.val).re/(2:ℝ)^n : ℝ) := by + rw [projectionSum_trace] + apply Finset.sum_congr rfl + intro i _ + rw [projection_trace_real,dyadicProjection_trace] + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/QuotientCorners.lean b/lean/OAI/Analysis/FactorGeneration/QuotientCorners.lean new file mode 100644 index 0000000000000000000000000000000000000000..657f2c93d8d35380e5eb2adb99c68f4a4cb950f2 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/QuotientCorners.lean @@ -0,0 +1,279 @@ +import OAI.Analysis.FactorGeneration.QuotientHilbert + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Exact coordinate centering in projection corners whose traces have a +uniform positive lower bound. The corner scalar is divided by its actual +trace; no global-centering-to-corner-centering implication is assumed. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem corner_trace_norm_lower (f : Bounded M) (δ : ℝ) + (hlower : ∀ j,δ ≤ (τ.trace (f.val j)).re) (j : ℕ) : + δ ≤ ‖τ.trace (f.val j)‖ := (hlower j).trans (Complex.re_le_norm _) + +def boundedCornerScalar (f b : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (δ : ℝ) (hδ : 0 < δ) (hlower : ∀ j,δ ≤ (τ.trace (f.val j)).re) : Bounded M := + ⟨fun j => (τ.trace (b.val j)/τ.trace (f.val j)) • f.val j,by + obtain ⟨C,hC,hb⟩ := b.property + refine ⟨C/δ,div_nonneg hC hδ.le,fun j => ?_⟩ + rw [norm_smul] + apply (mul_le_of_le_one_right (norm_nonneg _) (hf j).norm_le).trans + rw [norm_div] + exact div_le_div₀ hC + (((τ.norm_trace_le_norm₂ _).trans (τ.norm₂_le_norm _)).trans (hb j)) + hδ (corner_trace_norm_lower τ f δ hlower j)⟩ + +def boundedCornerCenter (f a : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (δ : ℝ) (hδ : 0 < δ) (hlower : ∀ j,δ ≤ (τ.trace (f.val j)).re) : Bounded M := + f*a*f-boundedCornerScalar τ f (f*a*f) hf δ hδ hlower + +theorem boundedCornerCenter_trace (f a : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (δ : ℝ) (hδ : 0 < δ) (hlower : ∀ j,δ ≤ (τ.trace (f.val j)).re) (j : ℕ) : + τ.trace ((boundedCornerCenter τ f a hf δ hδ hlower).val j)=0 := by + have hne : τ.trace (f.val j) ≠ 0 := by + intro h + have := hlower j + rw [h,Complex.zero_re] at this + linarith + change τ.trace (f.val j*a.val j*f.val j - + (τ.trace (f.val j*a.val j*f.val j)/τ.trace (f.val j)) • f.val j)=0 + rw [TracialRepresentation.trace_sub,TracialRepresentation.trace_smul,div_mul_cancel₀ _ hne,sub_self] + +theorem boundedCornerCenter_supported (f a : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (δ : ℝ) (hδ : 0 < δ) (hlower : ∀ j,δ ≤ (τ.trace (f.val j)).re) : + f*boundedCornerCenter τ f a hf δ hδ hlower=boundedCornerCenter τ f a hf δ hδ hlower ∧ + boundedCornerCenter τ f a hf δ hδ hlower*f=boundedCornerCenter τ f a hf δ hδ hlower := by + constructor <;> apply Subtype.ext <;> funext j + · change f.val j*(f.val j*a.val j*f.val j - _ • f.val j)=_ + simp only [mul_sub,← mul_assoc,mul_smul_comm,(hf j).isIdempotentElem.eq] + rfl + · change (f.val j*a.val j*f.val j - _ • f.val j)*f.val j=_ + simp only [sub_mul,mul_assoc,smul_mul_assoc,(hf j).isIdempotentElem.eq] + rfl + +theorem boundedCornerCenter_quotient (ω : Ultrafilter ℕ) + (f a : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (δ : ℝ) (hδ : 0 < δ) (hlower : ∀ j,δ ≤ (τ.trace (f.val j)).re) + (hz : quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (f*a*f))=0) : + quotientMap τ (ω : Filter ℕ) (boundedCornerCenter τ f a hf δ hδ hlower)= + quotientMap τ (ω : Filter ℕ) (f*a*f) := by + apply (quotientMap_eq_iff τ (ω : Filter ℕ) _ _).mpr + let b := f*a*f + have ht := ((traceRep_tendsto τ ω b).norm).div_const δ + change traceRep τ ω b=0 at hz + rw [hz,norm_zero,zero_div] at ht + change Tendsto (fun j => τ.norm₂ ((boundedCornerCenter τ f a hf δ hδ hlower).val j - b.val j)) _ _ + apply squeeze_zero (fun _ => norm_nonneg _) (fun j => ?_) ht + have he : (boundedCornerCenter τ f a hf δ hδ hlower).val j - b.val j = + -((τ.trace (b.val j)/τ.trace (f.val j)) • f.val j) := by + change (b.val j - _)-b.val j = _ + abel + rw [he] + have hn : τ.norm₂ (-((τ.trace (b.val j)/τ.trace (f.val j)) • f.val j)) = + ‖τ.trace (b.val j)/τ.trace (f.val j)‖*τ.norm₂ (f.val j) := by + change ‖-((τ.trace (b.val j)/τ.trace (f.val j)) • ((f.val j : H →L[ℂ] H) τ.vector))‖ = _ + rw [norm_neg,norm_smul] + rfl + change τ.norm₂ (-((τ.trace (b.val j)/τ.trace (f.val j)) • f.val j)) ≤ _ + rw [hn] + apply (mul_le_of_le_one_right (norm_nonneg _) ((τ.norm₂_le_norm _).trans (hf j).norm_le)).trans + rw [norm_div] + exact div_le_div₀ (norm_nonneg _) le_rfl hδ (corner_trace_norm_lower τ f δ hlower j) + +end + +/-! A projection sequence of positive quotient trace can be changed on an +ultrafilter-null set so every coordinate corner has uniformly positive trace. +Coordinates are replaced only by the unit, preserving subalgebra membership. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem quotientMap_eq_of_eventuallyEq (l : Filter ℕ) (a b : Bounded M) + (he : a.val =ᶠ[l] b.val) : quotientMap τ l a=quotientMap τ l b := by + apply (quotientMap_eq_iff τ l a b).mpr + have hh : (fun _ : ℕ => (0 : ℝ)) =ᶠ[l] (fun j => τ.norm₂ (a.val j-b.val j)) := by + filter_upwards [he] with j hj + rw [hj,sub_self,τ.norm₂_zero] + exact tendsto_const_nhds.congr' hh + +theorem exists_uniform_positive_corner_representative (ω : Ultrafilter ℕ) + (f : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (ht : 0 < (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) f)).re) : + ∃ δ : ℝ,0 < δ ∧ ∃ g : Bounded M, + (∀ j,IsStarProjection (g.val j)) ∧ (∀ j,δ ≤ (τ.trace (g.val j)).re) ∧ + quotientMap τ (ω : Filter ℕ) g=quotientMap τ (ω : Filter ℕ) f ∧ + (∀ j,g.val j=f.val j ∨ g.val j=1) := by + classical + let t := (traceRep τ ω f).re + change 0 < t at ht + let δ : ℝ := min (t/2) (1/2) + have hδ : 0 < δ := lt_min (half_pos ht) (by norm_num) + have hδt : δ < t := (min_le_left _ _).trans_lt (half_lt_self ht) + have hδ1 : δ ≤ 1 := (min_le_right _ _).trans (by norm_num) + let g : Bounded M := ⟨fun j => if δ ≤ (τ.trace (f.val j)).re then f.val j else 1, + 1,zero_le_one,fun j => by + change ‖if δ ≤ (τ.trace (f.val j)).re then f.val j else 1‖ ≤ 1 + split_ifs + · exact (hf j).norm_le + · exact operator_norm_one_le⟩ + refine ⟨δ,hδ,g,?_,?_,?_,?_⟩ + · intro j + change IsStarProjection (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1) + split_ifs + · exact hf j + · exact IsStarProjection.one _ + · intro j + change δ ≤ (τ.trace (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)).re + split_ifs with h + · exact h + · simpa only [τ.trace_one,Complex.one_re] using hδ1 + · apply quotientMap_eq_of_eventuallyEq τ + have he := (tendsto_order.mp + (Complex.continuous_re.continuousAt.tendsto.comp (traceRep_tendsto τ ω f))).1 δ hδt + filter_upwards [he] with j hj + change δ < (τ.trace (f.val j)).re at hj + change (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)=f.val j + rw [ite_eq_left hj.le] + · intro j + change (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)=f.val j ∨ + (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)=1 + split_ifs <;> simp + +end + +/-! A projection sequence of positive quotient trace can be changed on an +ultrafilter-null set so every coordinate corner has uniformly positive trace. +Coordinates are replaced only by the unit, preserving subalgebra membership. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_eventually_positive_corner_representative (ω : Ultrafilter ℕ) + (f : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (ht : 0 < (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) f)).re) : + ∃ δ : ℝ,0 < δ ∧ ∃ g : Bounded M, + (∀ j,IsStarProjection (g.val j)) ∧ (∀ j,δ ≤ (τ.trace (g.val j)).re) ∧ + g.val =ᶠ[(ω : Filter ℕ)] f.val ∧ + (∀ j,g.val j=f.val j ∨ g.val j=1) := by + classical + let t := (traceRep τ ω f).re + change 0 < t at ht + let δ : ℝ := min (t/2) (1/2) + have hδ : 0 < δ := lt_min (half_pos ht) (by norm_num) + have hδt : δ < t := (min_le_left _ _).trans_lt (half_lt_self ht) + have hδ1 : δ ≤ 1 := (min_le_right _ _).trans (by norm_num) + let g : Bounded M := ⟨fun j => if δ ≤ (τ.trace (f.val j)).re then f.val j else 1, + 1,zero_le_one,fun j => by + change ‖if δ ≤ (τ.trace (f.val j)).re then f.val j else 1‖ ≤ 1 + split_ifs + · exact (hf j).norm_le + · exact operator_norm_one_le⟩ + refine ⟨δ,hδ,g,?_,?_,?_,?_⟩ + · intro j + change IsStarProjection (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1) + split_ifs + · exact hf j + · exact IsStarProjection.one _ + · intro j + change δ ≤ (τ.trace (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)).re + split_ifs with h + · exact h + · simpa only [τ.trace_one,Complex.one_re] using hδ1 + · have he := (tendsto_order.mp + (Complex.continuous_re.continuousAt.tendsto.comp (traceRep_tendsto τ ω f))).1 δ hδt + filter_upwards [he] with j hj + change δ < (τ.trace (f.val j)).re at hj + change (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)=f.val j + rw [ite_eq_left hj.le] + · intro j + change (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)=f.val j ∨ + (if δ ≤ (τ.trace (f.val j)).re then f.val j else 1)=1 + split_ifs <;> simp + +theorem exists_eventually_centered_corner_representatives (ω : Ultrafilter ℕ) + (f : Bounded M) (hf : ∀ j,IsStarProjection (f.val j)) + (ht : 0 < (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) f)).re) + (x : ℕ → Q τ ω) + (hx : ∀ i,quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) f*x i* + quotientMap τ (ω : Filter ℕ) f)=0) : + ∃ δ : ℝ,0 < δ ∧ ∃ g : Bounded M, + (∀ j,IsStarProjection (g.val j)) ∧ (∀ j,δ ≤ (τ.trace (g.val j)).re) ∧ + g.val =ᶠ[(ω : Filter ℕ)] f.val ∧ (∀ j,g.val j=f.val j ∨ g.val j=1) ∧ + ∃ b : ℕ → Bounded M,∀ i, + g*b i=b i ∧ b i*g=b i ∧ (∀ j,τ.trace ((b i).val j)=0) ∧ + quotientMap τ (ω : Filter ℕ) (b i)= + quotientMap τ (ω : Filter ℕ) f*x i*quotientMap τ (ω : Filter ℕ) f := by + classical + obtain ⟨δ,hδ,g,hg,hgl,hgf,hgor⟩ := + exists_eventually_positive_corner_representative τ ω f hf ht + have he := quotientMap_eq_of_eventuallyEq τ (ω : Filter ℕ) g f hgf + choose a ha using fun i => quotientMap_surjective τ (ω : Filter ℕ) (x i) + let b := fun i => boundedCornerCenter τ g (a i) hg δ hδ hgl + refine ⟨δ,hδ,g,hg,hgl,hgf,hgor,b,fun i => ?_⟩ + have hclass : quotientMap τ (ω : Filter ℕ) (g*a i*g)= + quotientMap τ (ω : Filter ℕ) f*x i*quotientMap τ (ω : Filter ℕ) f := by + let q := quotientMap τ (ω : Filter ℕ) + calc + q ((g*a i)*g) = (q g*q (a i))*q g := + (map_mul q (g*a i) g).trans + (congrArg (fun y : Q τ ω => y*q g) (map_mul q g (a i))) + _ = q f*x i*q f := + congrArg₂ (fun y z : Q τ ω => y*z) + (congrArg₂ (fun y z : Q τ ω => y*z) he (ha i)) he + have hzero : quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (g*a i*g))=0 := by + rw [hclass] + exact hx i + obtain ⟨hl,hr⟩ := boundedCornerCenter_supported τ g (a i) hg δ hδ hgl + exact ⟨hl,hr,boundedCornerCenter_trace τ g (a i) hg δ hδ hgl, + (boundedCornerCenter_quotient τ ω g (a i) hg δ hδ hgl hzero).trans hclass⟩ + +end + +/-! Scalar normalization preserves exact corner support and centering. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem exists_supported_centered_contraction (g b : Bounded M) + (hl : g*b=b) (hr : b*g=b) (hc : ∀ j,τ.trace (b.val j)=0) : + ∃ c : ℂ,c ≠ 0 ∧ ∃ a : Bounded M, + g*a=a ∧ a*g=a ∧ (∀ j,‖a.val j‖ ≤ 1) ∧ + (∀ j,τ.trace (a.val j)=0) ∧ b=c • a := by + obtain ⟨C,hC,hbound⟩ := b.property + let r : ℝ := C+1 + have hpos : 0 < r := by dsimp [r]; linarith + have hne : (r : ℂ) ≠ 0 := Complex.ofReal_ne_zero.mpr hpos.ne' + refine ⟨(r : ℂ),hne,(r : ℂ)⁻¹ • b,?_,?_,?_,?_,?_⟩ + · rw [mul_smul_comm,hl] + · rw [smul_mul_assoc,hr] + · intro j + change ‖(r : ℂ)⁻¹ • b.val j‖ ≤ 1 + rw [norm_smul,norm_inv,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hpos] + apply (inv_mul_le_iff₀ hpos).mpr + simpa only [mul_one] using (hbound j).trans (by dsimp [r]; linarith) + · intro j + change τ.trace ((r : ℂ)⁻¹ • b.val j)=0 + rw [TracialRepresentation.trace_smul,hc j,mul_zero] + · rw [smul_smul,mul_inv_cancel₀ hne,one_smul] + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/QuotientHilbert.lean b/lean/OAI/Analysis/FactorGeneration/QuotientHilbert.lean new file mode 100644 index 0000000000000000000000000000000000000000..aee1010d36f6fcc7364fa9e8a8bedb9cbbacd60c --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/QuotientHilbert.lean @@ -0,0 +1,258 @@ +import Mathlib.Analysis.InnerProductSpace.Completion +import OAI.Analysis.FactorGeneration.Ultrapower + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! The actual trace Hilbert completion of the bounded-sequence tracial quotient. +The vector-trace representation is explicit data; its existence for an arbitrary +factor is not asserted here. No free-independence premise occurs. -/ +open Filter +open scoped Topology ComplexConjugate +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +abbrev Q := TracialQuotient τ (ω : Filter ℕ) + +@[simp] theorem trace_add (a b : Q τ ω) : + quotientTrace τ ω (a+b) = quotientTrace τ ω a + quotientTrace τ ω b := by + induction a using Quotient.inductionOn with + | h a => + induction b using Quotient.inductionOn with + | h b => + apply tendsto_nhds_unique (traceRep_tendsto τ ω (a+b)) + change Tendsto (fun n => τ.trace (a.val n + b.val n)) _ + (𝓝 (traceRep τ ω a + traceRep τ ω b)) + simpa only [TracialRepresentation.trace_add] using + (traceRep_tendsto τ ω a).add (traceRep_tendsto τ ω b) + +@[simp] theorem trace_smul (c : ℂ) (a : Q τ ω) : + quotientTrace τ ω (c • a) = c * quotientTrace τ ω a := by + induction a using Quotient.inductionOn with + | h a => + apply tendsto_nhds_unique (traceRep_tendsto τ ω (c • a)) + change Tendsto (fun n => τ.trace (c • a.val n)) _ (𝓝 (c * traceRep τ ω a)) + simpa only [TracialRepresentation.trace_smul] using + (traceRep_tendsto τ ω a).const_mul c + +def traceLinear : Q τ ω →ₗ[ℂ] ℂ where + toFun := quotientTrace τ ω + map_add' := trace_add τ ω + map_smul' := trace_smul τ ω + +theorem trace_pair (a b : M.toStarSubalgebra) : + τ.trace (star a*b) = inner ℂ ((a : H →L[ℂ] H) τ.vector) + ((b : H →L[ℂ] H) τ.vector) := by + unfold TracialRepresentation.trace + change inner ℂ τ.vector ((star (a : H →L[ℂ] H)) ((b : H →L[ℂ] H) τ.vector)) = _ + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + +theorem trace_pair_conj (a b : Q τ ω) : + star (quotientTrace τ ω (star b*a)) = quotientTrace τ ω (star a*b) := by + induction a using Quotient.inductionOn with + | h a => + induction b using Quotient.inductionOn with + | h b => + change star (traceRep τ ω (star b*a)) = traceRep τ ω (star a*b) + apply tendsto_nhds_unique ((traceRep_tendsto τ ω (star b*a)).star) + have ht := traceRep_tendsto τ ω (star a*b) + change Tendsto (fun n => τ.trace (star (a.val n)*b.val n)) _ _ at ht + change Tendsto (fun n => star (τ.trace (star (b.val n)*a.val n))) _ _ + convert ht using 1 + funext n + simp only [trace_pair] + exact inner_conj_symm _ _ + +theorem trace_square_nonneg (a : Q τ ω) : + 0 ≤ (quotientTrace τ ω (star a*a)).re := by + induction a using Quotient.inductionOn with + | h a => + have ht := Complex.continuous_re.continuousAt.tendsto.comp (traceRep_tendsto τ ω (star a*a)) + change 0 ≤ (traceRep τ ω (star a*a)).re + apply ge_of_tendsto ht + exact Eventually.of_forall (fun n => by + change 0 ≤ (τ.trace (star (a.val n)*a.val n)).re + rw [τ.trace_star_mul] + simpa only [← Complex.ofReal_pow, Complex.ofReal_re] using sq_nonneg (τ.norm₂ (a.val n))) + +/-- The quotient two-norm is the ultralimit of the coordinate two-norms. -/ +theorem norm₂_tendsto (a : Bounded M) : + Tendsto (fun n => τ.norm₂ (a.val n)) (ω : Filter ℕ) + (𝓝 (Real.sqrt (quotientTrace τ ω (star (quotientMap τ (ω : Filter ℕ) a) * + quotientMap τ (ω : Filter ℕ) a)).re)) := by + change Tendsto (fun n => τ.norm₂ (a.val n)) (ω : Filter ℕ) + (𝓝 (Real.sqrt (traceRep τ ω (star a*a)).re)) + have ht := (Complex.continuous_re.continuousAt.tendsto.comp (traceRep_tendsto τ ω (star a*a))).sqrt + convert ht using 1 + funext n + change τ.norm₂ (a.val n) = Real.sqrt (τ.trace (star (a.val n)*a.val n)).re + rw [τ.trace_star_mul, ← Complex.ofReal_pow, Complex.ofReal_re] + exact (Real.sqrt_sq (show 0 ≤ τ.norm₂ (a.val n) from norm_nonneg _)).symm + +theorem trace_square_faithful (a : Q τ ω) + (ha : quotientTrace τ ω (star a*a) = 0) : a = 0 := by + induction a using Quotient.inductionOn with + | h a => + change quotientMap τ (ω : Filter ℕ) a = quotientMap τ (ω : Filter ℕ) 0 + apply (quotientMap_eq_iff τ (ω : Filter ℕ) a 0).mpr + have ht := norm₂_tendsto τ ω a + change quotientTrace τ ω (star (quotientMap τ (ω : Filter ℕ) a) * + quotientMap τ (ω : Filter ℕ) a) = 0 at ha + simpa [TraceRel, ha] using ht + +/-- The norm here is the trace norm, not the operator norm. -/ +@[instance_reducible] def quotientInnerCore : InnerProductSpace.Core ℂ (Q τ ω) where + inner a b := quotientTrace τ ω (star a*b) + conj_inner_symm := trace_pair_conj τ ω + re_inner_nonneg := trace_square_nonneg τ ω + add_left a b c := by simp only [star_add, add_mul, trace_add] + smul_left a b c := by simp only [star_smul, smul_mul_assoc, trace_smul]; rfl + definite := trace_square_faithful τ ω + +instance quotientNormedAddCommGroup : NormedAddCommGroup (Q τ ω) := + (quotientInnerCore τ ω).toNormedAddCommGroup +instance quotientInnerProductSpace : InnerProductSpace ℂ (Q τ ω) := + .ofCore { quotientInnerCore τ ω with } + +@[simp] theorem inner_eq_trace (a b : Q τ ω) : + inner ℂ a b = quotientTrace τ ω (star a*b) := rfl + +/-- Genuine complete complex Hilbert space for the quotient trace. -/ +abbrev L2 := UniformSpace.Completion (Q τ ω) + +def inclusion : Q τ ω →ₗᵢ[ℂ] L2 τ ω := + UniformSpace.Completion.toComplₗᵢ + +@[simp] theorem inclusion_inner (a b : Q τ ω) : + inner ℂ (inclusion τ ω a) (inclusion τ ω b) = quotientTrace τ ω (star a*b) := by + exact UniformSpace.Completion.inner_coe (𝕜 := ℂ) a b + +theorem inclusion_injective : Function.Injective (inclusion τ ω) := + (inclusion τ ω).injective + +end + +/-! Centering actual bounded representatives changes no centered quotient +class. Every such class is a nonzero scalar multiple of a coordinatewise +centered contraction representative. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def boundedScalarTrace (a : Bounded M) : Bounded M := + ⟨fun j => τ.trace (a.val j) • (1 : M.toStarSubalgebra),by + obtain ⟨C,hC,ha⟩ := a.property + refine ⟨C,hC,fun j => ?_⟩ + rw [norm_smul] + exact (mul_le_of_le_one_right (norm_nonneg _) operator_norm_one_le).trans + (((τ.norm_trace_le_norm₂ _).trans (τ.norm₂_le_norm _)).trans (ha j))⟩ + +def boundedCenter (a : Bounded M) : Bounded M := a-boundedScalarTrace τ a + +theorem boundedCenter_trace (a : Bounded M) (j : ℕ) : + τ.trace ((boundedCenter τ a).val j)=0 := by + change τ.trace (a.val j - τ.trace (a.val j) • 1)=0 + simp only [TracialRepresentation.trace_sub,TracialRepresentation.trace_smul,τ.trace_one, + mul_one,sub_self] + +theorem boundedCenter_quotient (ω : Ultrafilter ℕ) (a : Bounded M) + (ha : quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) a)=0) : + quotientMap τ (ω : Filter ℕ) (boundedCenter τ a)=quotientMap τ (ω : Filter ℕ) a := by + apply (quotientMap_eq_iff τ (ω : Filter ℕ) _ _).mpr + have ht := (traceRep_tendsto τ ω a).norm + change traceRep τ ω a=0 at ha + rw [ha,norm_zero] at ht + change Tendsto (fun j => τ.norm₂ ((a.val j-τ.trace (a.val j) • 1)-a.val j)) _ _ + have he (j : ℕ) : (a.val j-τ.trace (a.val j) • 1)-a.val j = + -(τ.trace (a.val j) • (1 : M.toStarSubalgebra)) := by abel + have hn (j : ℕ) : τ.norm₂ (-(τ.trace (a.val j) • (1 : M.toStarSubalgebra))) = + ‖τ.trace (a.val j)‖ := by + change ‖-(τ.trace (a.val j) • τ.vector)‖ = _ + rw [norm_neg,norm_smul,τ.norm_vector,mul_one] + simpa only [he,hn] using ht + +theorem exists_centered_contraction_representative (ω : Ultrafilter ℕ) + (q : TracialQuotient τ (ω : Filter ℕ)) (hq : quotientTrace τ ω q=0) : + ∃ c : ℂ,c ≠ 0 ∧ ∃ b : Bounded M, + (∀ j,‖b.val j‖ ≤ 1) ∧ (∀ j,τ.trace (b.val j)=0) ∧ + q=c • quotientMap τ (ω : Filter ℕ) b := by + obtain ⟨a,rfl⟩ := quotientMap_surjective τ (ω : Filter ℕ) q + obtain ⟨C,hC,hbound⟩ := (boundedCenter τ a).property + let r : ℝ := C+1 + have hr : 0 < r := by dsimp [r]; linarith + have hrc : (r : ℂ) ≠ 0 := by exact_mod_cast ne_of_gt hr + refine ⟨(r : ℂ),hrc,(r : ℂ)⁻¹ • boundedCenter τ a,?_,?_,?_⟩ + · intro j + change ‖(r : ℂ)⁻¹ • (boundedCenter τ a).val j‖ ≤ 1 + rw [norm_smul,norm_inv,Complex.norm_real,Real.norm_eq_abs,abs_of_pos hr] + apply (inv_mul_le_iff₀ hr).mpr + simpa only [mul_one] using (hbound j).trans (by dsimp [r]; linarith) + · intro j + change τ.trace ((r : ℂ)⁻¹ • (boundedCenter τ a).val j)=0 + rw [TracialRepresentation.trace_smul,boundedCenter_trace,mul_zero] + · rw [quotientMap_smul,smul_smul,mul_inv_cancel₀ hrc,one_smul, + boundedCenter_quotient τ ω a hq] + +end + +/-! Trace Cauchy–Schwarz and unitary invariance on the tracial quotient. -/ +open Filter +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +@[simp] theorem quotient_norm_one : ‖(1 : Q τ ω)‖ = 1 := by + rw [norm_eq_sqrt_re_inner (𝕜 := ℂ), inner_eq_trace, star_one, one_mul, quotientTrace_one] + norm_num + +@[simp] theorem quotient_norm_star (a : Q τ ω) : ‖star a‖ = ‖a‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + rw [norm_sq_eq_re_inner (𝕜 := ℂ), norm_sq_eq_re_inner (𝕜 := ℂ), + inner_eq_trace, inner_eq_trace, star_star, quotientTrace_mul_comm τ ω a (star a)] + +@[simp] theorem quotient_trace_sub (a b : Q τ ω) : + quotientTrace τ ω (a-b) = quotientTrace τ ω a-quotientTrace τ ω b := + (traceLinear τ ω).map_sub a b + +theorem quotient_norm_mul_unitary (a u : Q τ ω) (hu : u*star u = 1) : + ‖a*u‖ = ‖a‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + rw [norm_sq_eq_re_inner (𝕜 := ℂ), norm_sq_eq_re_inner (𝕜 := ℂ), + inner_eq_trace, inner_eq_trace, star_mul] + have he : quotientTrace τ ω (star u*star a*(a*u)) = quotientTrace τ ω (star a*a) := by + rw [mul_assoc, quotientTrace_mul_comm τ ω (star u) (star a*(a*u))] + simp only [mul_assoc, hu, mul_one] + rw [he] + +theorem quotient_trace_cauchy_schwarz (a b : Q τ ω) : + ‖quotientTrace τ ω (star a*b)‖ ≤ ‖a‖*‖b‖ := + norm_inner_le_norm a b + +/-- The source's complex trace error bound from its actual first-order identity +and the actual quotient remainder, with unitary right multiplication accounted for. -/ +theorem quotient_correlation_remainder (ξ v c w : Q τ ω) (target : ℂ) (R : ℝ) + (hw : w*star w = 1) + (hfirst : quotientTrace τ ω (star ξ*((1+c)*w)) = target) + (hrem : ‖v-(1+c)‖ ≤ R) : + ‖quotientTrace τ ω (star ξ*(v*w))-target‖ ≤ ‖ξ‖*R := by + have he : quotientTrace τ ω (star ξ*(v*w))-target = + quotientTrace τ ω (star ξ*((v-(1+c))*w)) := by + rw [← hfirst, sub_mul, mul_sub, quotient_trace_sub] + rw [he] + apply (quotient_trace_cauchy_schwarz τ ω ξ _).trans + rw [quotient_norm_mul_unitary τ ω _ w hw] + exact mul_le_mul_of_nonneg_left hrem (norm_nonneg ξ) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/QuotientRepresentation.lean b/lean/OAI/Analysis/FactorGeneration/QuotientRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..353a5c0428c2ff8ef96e73e476caaea63b5d0d8f --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/QuotientRepresentation.lean @@ -0,0 +1,473 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousLinearMap +import Mathlib.Analysis.Normed.Algebra.Exponential +import Mathlib.Analysis.Normed.Operator.Extend +import Mathlib.Topology.ContinuousMap.Bounded.Star +import OAI.Analysis.FactorGeneration.OperatorLimits +import OAI.Analysis.FactorGeneration.QuotientHilbert + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Complete operator-norm bounded sequences and their contractive map to the +actual quotient trace Hilbert space. This map is not asserted injective. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +abbrev Sequences (M : VonNeumannAlgebra H) := BoundedContinuousFunction ℕ M.toStarSubalgebra + +instance sequencesIsTopologicalRing : IsTopologicalRing (Sequences M) := + @NonUnitalSeminormedRing.toIsTopologicalRing (Sequences M) inferInstance + +/-- Forget continuity (automatic on the discrete index set) and retain boundedness. -/ +def boundedMap : Sequences M →⋆ₐ[ℂ] Bounded M where + toFun a := ⟨a, ⟨‖a‖, norm_nonneg a, a.norm_coe_le_norm⟩⟩ + map_one' := rfl + map_mul' _ _ := rfl + map_zero' := rfl + map_add' _ _ := rfl + commutes' _ := rfl + map_star' _ := rfl + +theorem boundedMap_surjective : Function.Surjective (boundedMap (M := M)) := by + intro a + obtain ⟨C, _, hC⟩ := a.property + refine ⟨BoundedContinuousFunction.ofNormedAddCommGroupDiscrete a.val C hC, ?_⟩ + apply Subtype.ext + funext n + rfl + +/-- The actual star-algebra quotient map on complete bounded sequences. -/ +def sequenceQuotient : Sequences M →⋆ₐ[ℂ] Q τ ω := + (quotientStarAlgHom τ (ω : Filter ℕ)).comp boundedMap + +theorem sequenceQuotient_surjective : Function.Surjective (sequenceQuotient τ ω) := by + intro q + obtain ⟨b, rfl⟩ := quotientMap_surjective τ (ω : Filter ℕ) q + obtain ⟨a, rfl⟩ := boundedMap_surjective b + exact ⟨a, rfl⟩ + +theorem quotient_norm_tendsto (a : Bounded M) : + Tendsto (fun n => τ.norm₂ (a.val n)) (ω : Filter ℕ) + (𝓝 ‖quotientMap τ (ω : Filter ℕ) a‖) := by + rw [norm_eq_sqrt_re_inner (𝕜 := ℂ), inner_eq_trace] + exact norm₂_tendsto τ ω a + +theorem sequence_norm_tendsto (a : Sequences M) : + Tendsto (fun n => τ.norm₂ (a n)) (ω : Filter ℕ) (𝓝 ‖sequenceQuotient τ ω a‖) := by + rw [norm_eq_sqrt_re_inner (𝕜 := ℂ), inner_eq_trace] + exact norm₂_tendsto τ ω (boundedMap a) + +theorem sequenceQuotient_norm_le (a : Sequences M) : + ‖sequenceQuotient τ ω a‖ ≤ ‖a‖ := by + apply le_of_tendsto (sequence_norm_tendsto τ ω a) + exact Eventually.of_forall (fun n => (τ.norm₂_le_norm (a n)).trans (a.norm_coe_le_norm n)) + +/-- The continuous Hilbert realization used by the analytic remainder theorem. -/ +def sequenceInclusion : Sequences M →L[ℂ] L2 τ ω := + LinearMap.mkContinuous + { toFun := fun a => inclusion τ ω (sequenceQuotient τ ω a) + map_add' := by intros; simp only [map_add] + map_smul' := by intros; simp only [map_smul]; rfl } 1 + (by + intro a + change ‖inclusion τ ω (sequenceQuotient τ ω a)‖ ≤ 1*‖a‖ + rw [LinearIsometry.norm_map, one_mul] + exact sequenceQuotient_norm_le τ ω a) + +@[simp] theorem sequenceInclusion_apply (a : Sequences M) : + sequenceInclusion τ ω a = inclusion τ ω (sequenceQuotient τ ω a) := rfl + +theorem sequenceInclusion_norm_le (a : Sequences M) : ‖sequenceInclusion τ ω a‖ ≤ ‖a‖ := by + rw [sequenceInclusion_apply, LinearIsometry.norm_map] + exact sequenceQuotient_norm_le τ ω a + +/-- Literal ultralimit inner product, including the complex orientation. -/ +theorem sequence_inner_tendsto (a b : Sequences M) : + Tendsto (fun n => τ.trace (star (a n)*b n)) (ω : Filter ℕ) + (𝓝 (inner ℂ (sequenceInclusion τ ω a) (sequenceInclusion τ ω b))) := by + rw [sequenceInclusion_apply, sequenceInclusion_apply, inclusion_inner] + exact traceRep_tendsto τ ω (star (boundedMap a)*boundedMap b) + +/-- The kernel consists exactly of trace-null bounded sequences. -/ +theorem sequenceInclusion_eq_zero_iff (a : Sequences M) : + sequenceInclusion τ ω a = 0 ↔ Tendsto (fun n => τ.norm₂ (a n)) (ω : Filter ℕ) (𝓝 0) := by + rw [sequenceInclusion_apply, ← (inclusion τ ω).map_zero, + (inclusion τ ω).injective.eq_iff] + change quotientMap τ (ω : Filter ℕ) (boundedMap a) = quotientMap τ (ω : Filter ℕ) 0 ↔ _ + rw [quotientMap_eq_iff] + change Tendsto (fun n => τ.norm₂ (a n - 0)) (ω : Filter ℕ) (𝓝 0) ↔ _ + simp only [sub_zero] + +end + +/-! The faithful constant embedding into the tracial quotient, with its trace and trace norm, for every ultrafilter. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def constantSequence : M.toStarSubalgebra →⋆ₐ[ℂ] Sequences M where + toFun := BoundedContinuousFunction.const ℕ + map_one' := rfl + map_mul' _ _ := rfl + map_zero' := rfl + map_add' _ _ := rfl + commutes' _ := rfl + map_star' _ := rfl + +def constantQuotient : M.toStarSubalgebra →⋆ₐ[ℂ] Q τ ω := + (sequenceQuotient τ ω).comp constantSequence + +@[simp] theorem constantQuotient_trace (a : M.toStarSubalgebra) : + quotientTrace τ ω (constantQuotient τ ω a) = τ.trace a := by + exact tendsto_nhds_unique (traceRep_tendsto τ ω (boundedMap (constantSequence a))) + tendsto_const_nhds + +@[simp] theorem constantQuotient_norm (a : M.toStarSubalgebra) : + ‖constantQuotient τ ω a‖ = τ.norm₂ a := by + exact tendsto_nhds_unique (sequence_norm_tendsto τ ω (constantSequence a)) tendsto_const_nhds + +/-- No nonzero constant element is killed by the tracial quotient ideal. -/ +theorem constantQuotient_injective : Function.Injective (constantQuotient τ ω) := by + intro a b h + apply sub_eq_zero.mp + apply (τ.norm₂_eq_zero_iff (a-b)).mp + rw [← constantQuotient_norm τ ω, map_sub, h, sub_self, norm_zero] + +@[simp] theorem constantQuotient_inner (a b : M.toStarSubalgebra) : + inner ℂ (inclusion τ ω (constantQuotient τ ω a)) + (inclusion τ ω (constantQuotient τ ω b)) = τ.trace (star a*b) := by + rw [inclusion_inner, ← map_star, ← map_mul, constantQuotient_trace] + +end + +/-! Left multiplication by bounded representatives on the completed trace +Hilbert space. The quotient ideal, not an assumed operator action, determines +which representatives induce the same operator. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem sequence_mul_norm_le (a : Sequences M) (b : Q τ ω) : + ‖sequenceQuotient τ ω a*b‖ ≤ ‖a‖*‖b‖ := by + induction b using Quotient.inductionOn with + | h b => + have hp := quotient_norm_tendsto τ ω (boundedMap a*b) + have hb := (quotient_norm_tendsto τ ω b).const_mul ‖a‖ + apply le_of_tendsto_of_tendsto hp hb + exact Eventually.of_forall (fun n => + (τ.norm₂_mul_le (a n) (b.val n)).trans + (mul_le_mul_of_nonneg_right (a.norm_coe_le_norm n) (norm_nonneg _))) + +def leftOnQuotient (a : Sequences M) : Q τ ω →L[ℂ] Q τ ω := + LinearMap.mkContinuous (LinearMap.mulLeft ℂ (sequenceQuotient τ ω a)) ‖a‖ + (sequence_mul_norm_le τ ω a) + +@[simp] theorem leftOnQuotient_apply (a : Sequences M) (b : Q τ ω) : + leftOnQuotient τ ω a b = sequenceQuotient τ ω a*b := rfl + +theorem inclusion_denseRange : DenseRange (inclusion τ ω) := + UniformSpace.Completion.denseRange_coe + +/-- Bounded left multiplication extended to the actual Hilbert completion. -/ +def leftAction (a : Sequences M) : L2 τ ω →L[ℂ] L2 τ ω := + ((inclusion τ ω).toContinuousLinearMap.comp (leftOnQuotient τ ω a)).extend + (inclusion τ ω).toContinuousLinearMap + +@[simp] theorem leftAction_inclusion (a : Sequences M) (b : Q τ ω) : + leftAction τ ω a (inclusion τ ω b) = inclusion τ ω (sequenceQuotient τ ω a*b) := by + exact ContinuousLinearMap.extend_eq + ((inclusion τ ω).toContinuousLinearMap.comp (leftOnQuotient τ ω a)) + (e := (inclusion τ ω).toContinuousLinearMap) + (inclusion_denseRange τ ω) ((inclusion τ ω).isometry.isUniformInducing) b + +@[simp] theorem leftAction_coe (a : Sequences M) (b : Q τ ω) : + leftAction τ ω a (b : L2 τ ω) = ((sequenceQuotient τ ω a*b : Q τ ω) : L2 τ ω) := + leftAction_inclusion τ ω a b + +theorem leftAction_norm_le (a : Sequences M) : ‖leftAction τ ω a‖ ≤ ‖a‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg a) + apply isClosed_property (inclusion_denseRange τ ω) + (isClosed_le (by fun_prop) (by fun_prop)) + intro b + simpa only [leftAction_inclusion, LinearIsometry.norm_map] using sequence_mul_norm_le τ ω a b + +@[simp] theorem leftAction_one : leftAction τ ω 1 = 1 := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + simp only [leftAction_coe, map_one, one_mul, one_apply_eq_self] + +@[simp] theorem leftAction_mul (a b : Sequences M) : + leftAction τ ω (a*b) = leftAction τ ω a*leftAction τ ω b := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro c + simp only [mul_apply_eq_comp, leftAction_coe, map_mul, mul_assoc] + +@[simp] theorem leftAction_add (a b : Sequences M) : + leftAction τ ω (a+b) = leftAction τ ω a+leftAction τ ω b := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro c + simp only [add_apply, leftAction_coe, map_add, add_mul, UniformSpace.Completion.coe_add] + +private theorem completionT2Space (E : Type*) [UniformSpace E] : + T2Space (UniformSpace.Completion E) := inferInstance + +@[simp] theorem leftAction_smul (c : ℂ) (a : Sequences M) : + leftAction τ ω (c • a) = c • leftAction τ ω a := by + let : T2Space (L2 τ ω) := completionT2Space (Q τ ω) + apply ContinuousLinearMap.coeFn_injective + apply (inclusion_denseRange τ ω).equalizer (leftAction τ ω (c • a)).continuous + ((c • leftAction τ ω a : L2 τ ω →L[ℂ] L2 τ ω)).continuous + funext b + change leftAction τ ω (c • a) (inclusion τ ω b) = c • leftAction τ ω a (inclusion τ ω b) + calc + _ = inclusion τ ω (sequenceQuotient τ ω (c • a)*b) := leftAction_inclusion τ ω (c • a) b + _ = inclusion τ ω (c • (sequenceQuotient τ ω a*b)) := + congrArg (inclusion τ ω) + ((congrArg (fun z : Q τ ω => z*b) (map_smul (sequenceQuotient τ ω) c a)).trans + (smul_mul_assoc c (sequenceQuotient τ ω a) b)) + _ = c • inclusion τ ω (sequenceQuotient τ ω a*b) := (inclusion τ ω).map_smul c _ + _ = _ := congrArg (fun z : L2 τ ω => c • z) (leftAction_inclusion τ ω a b).symm + +@[simp] theorem leftAction_zero : leftAction τ ω 0 = 0 := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + simp only [leftAction_coe, map_zero, zero_mul, zero_apply, UniformSpace.Completion.coe_zero] + +@[simp] theorem leftAction_star (a : Sequences M) : + leftAction τ ω (star a) = star (leftAction τ ω a) := by + rw [ContinuousLinearMap.star_eq_adjoint] + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro x y + refine UniformSpace.Completion.induction_on₂ x y + (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b c + simp only [leftAction_coe, UniformSpace.Completion.inner_coe, inner_eq_trace, map_star, star_mul, star_star, mul_assoc] + +/-- A concrete star-algebra action, constructed from the trace quotient. -/ +def sequenceAction : Sequences M →⋆ₐ[ℂ] (L2 τ ω →L[ℂ] L2 τ ω) where + toFun := leftAction τ ω + map_one' := leftAction_one τ ω + map_mul' := leftAction_mul τ ω + map_zero' := leftAction_zero τ ω + map_add' := leftAction_add τ ω + commutes' c := by + change leftAction τ ω (algebraMap ℂ (Sequences M) c) = algebraMap ℂ (L2 τ ω →L[ℂ] L2 τ ω) c + calc + _ = leftAction τ ω (c • (1 : Sequences M)) := congrArg (leftAction τ ω) (Algebra.algebraMap_eq_smul_one c) + _ = c • (1 : L2 τ ω →L[ℂ] L2 τ ω) := + (leftAction_smul τ ω c 1).trans + (congrArg (fun T : L2 τ ω →L[ℂ] L2 τ ω => c • T) (leftAction_one τ ω)) + _ = _ := (Algebra.algebraMap_eq_smul_one c).symm + map_star' := leftAction_star τ ω + +/-- Equality of operators is precisely equality in the tracial quotient. -/ +theorem leftAction_eq_iff (a b : Sequences M) : + leftAction τ ω a = leftAction τ ω b ↔ sequenceQuotient τ ω a = sequenceQuotient τ ω b := by + constructor + · intro h + have he := congrArg (fun T : L2 τ ω →L[ℂ] L2 τ ω => T (inclusion τ ω 1)) h + simpa only [leftAction_inclusion, mul_one, (inclusion τ ω).injective.eq_iff] using he + · intro h + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro c + simp only [leftAction_coe, h] + +end + +/-! Faithful concrete Hilbert-space representation of the tracial quotient +star algebra. Weak operator closedness of its image is not claimed here. -/ +open Filter +open scoped Topology +section +open UltrapowerBridge +section Descent +variable {A B C : Type*} [Ring A] [Ring B] [Ring C] + [StarRing A] [StarRing B] [StarRing C] + [Algebra ℂ A] [Algebra ℂ B] [Algebra ℂ C] + +/-- Descend a proved compatible map through a surjective star-algebra map. -/ +def descendStarAlgHom (q : A →⋆ₐ[ℂ] B) (hq : Function.Surjective q) + (f : A →⋆ₐ[ℂ] C) (g : B → C) (hg : ∀ a, g (q a) = f a) : B →⋆ₐ[ℂ] C where + toFun := g + map_one' := by rw [← (map_one q), hg, (map_one f)] + map_mul' x y := by + obtain ⟨a,rfl⟩ := hq x + obtain ⟨b,rfl⟩ := hq y + rw [← (map_mul q), hg, (map_mul f), hg, hg] + map_zero' := by rw [← (map_zero q), hg, (map_zero f)] + map_add' x y := by + obtain ⟨a,rfl⟩ := hq x + obtain ⟨b,rfl⟩ := hq y + rw [← (map_add q), hg, (map_add f), hg, hg] + commutes' c := by + have hq : q (algebraMap ℂ A c) = algebraMap ℂ B c := q.commutes c + have hf : f (algebraMap ℂ A c) = algebraMap ℂ C c := f.commutes c + rw [← hq, hg, hf] + map_star' x := by + obtain ⟨a,rfl⟩ := hq x + rw [← map_star q, hg, map_star f, hg] +end Descent + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def quotientOperator (a : Q τ ω) : L2 τ ω →L[ℂ] L2 τ ω := + leftAction τ ω ((sequenceQuotient_surjective τ ω a).choose) + +@[simp] theorem quotientOperator_mk (a : Sequences M) : + quotientOperator τ ω (sequenceQuotient τ ω a) = leftAction τ ω a := by + apply (leftAction_eq_iff τ ω _ a).mpr + exact (sequenceQuotient_surjective τ ω (sequenceQuotient τ ω a)).choose_spec + +@[simp] theorem sequenceAction_apply (a : Sequences M) : + sequenceAction τ ω a = leftAction τ ω a := rfl + +/-- The quotient itself, rather than a chosen representative algebra, acts +faithfully by bounded Hilbert-space operators. -/ +def quotientRepresentation : Q τ ω →⋆ₐ[ℂ] (L2 τ ω →L[ℂ] L2 τ ω) := + descendStarAlgHom (A := Sequences M) (B := Q τ ω) (C := L2 τ ω →L[ℂ] L2 τ ω) + (sequenceQuotient τ ω) (sequenceQuotient_surjective τ ω) + (sequenceAction τ ω) (quotientOperator τ ω) (fun a => + (quotientOperator_mk τ ω a).trans (sequenceAction_apply τ ω a).symm) + +@[simp] theorem quotientRepresentation_inclusion (a b : Q τ ω) : + quotientRepresentation τ ω a (inclusion τ ω b) = inclusion τ ω (a*b) := by + change quotientOperator τ ω a (inclusion τ ω b) = _ + obtain ⟨s,hs⟩ := sequenceQuotient_surjective τ ω a + have ho : quotientOperator τ ω a=leftAction τ ω s := + (congrArg (quotientOperator τ ω) hs.symm).trans (quotientOperator_mk τ ω s) + exact (congrArg (fun T : L2 τ ω →L[ℂ] L2 τ ω => T (inclusion τ ω b)) ho).trans + ((leftAction_inclusion τ ω s b).trans (congrArg (fun z : Q τ ω => inclusion τ ω (z*b)) hs)) + +/-- The identity vector separates all represented quotient elements. -/ +theorem quotientRepresentation_separating (a : Q τ ω) + (h : quotientRepresentation τ ω a (inclusion τ ω 1) = 0) : a = 0 := by + apply (inclusion τ ω).injective + rw [(inclusion τ ω).map_zero] + simpa only [quotientRepresentation_inclusion, mul_one] using h + +theorem quotientRepresentation_injective : Function.Injective (quotientRepresentation τ ω) := by + intro a b h + have he := congrArg (fun T : L2 τ ω →L[ℂ] L2 τ ω => T (inclusion τ ω 1)) h + simpa only [quotientRepresentation_inclusion, mul_one, + (inclusion τ ω).injective.eq_iff] using he + +/-- The represented vector trace is precisely the original ultralimit trace. -/ +theorem quotientRepresentation_trace (a : Q τ ω) : + inner ℂ (inclusion τ ω 1) (quotientRepresentation τ ω a (inclusion τ ω 1)) = + quotientTrace τ ω a := by + simp only [quotientRepresentation_inclusion, mul_one, inclusion_inner, star_one, one_mul] + +end + +/-! The standard completion/continuous-linear-map structures are not new hypotheses. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +@[instance_reducible] def quotientL2AddCommMonoid : AddCommMonoid (L2 τ ω) := + (inferInstance : NormedAddCommGroup (L2 τ ω)).toAddCommGroup.toAddCommMonoid + +@[instance_reducible] def quotientL2AddCommGroup : AddCommGroup (L2 τ ω) := + (inferInstance : NormedAddCommGroup (L2 τ ω)).toAddCommGroup + +attribute [local instance] quotientL2AddCommMonoid quotientL2AddCommGroup + +@[instance_reducible] def quotientOperatorSemiring : Semiring (L2 τ ω →L[ℂ] L2 τ ω) := + (inferInstance : NormedRing (L2 τ ω →L[ℂ] L2 τ ω)).toRing.toSemiring + +@[instance_reducible] def quotientOperatorNonAssocSemiring : NonUnitalNonAssocSemiring (L2 τ ω →L[ℂ] L2 τ ω) := + (inferInstance : NormedRing (L2 τ ω →L[ℂ] L2 τ ω)).toRing.toSemiring.toNonUnitalSemiring.toNonUnitalNonAssocSemiring + +attribute [local instance] quotientOperatorSemiring quotientOperatorNonAssocSemiring + +@[instance_reducible] def quotientOperatorAlgebra : Algebra ℂ (L2 τ ω →L[ℂ] L2 τ ω) := + ContinuousLinearMap.algebra + +attribute [local instance] quotientOperatorAlgebra + +theorem quotientOperatorSemitopology : IsSemitopologicalSemiring (L2 τ ω →L[ℂ] L2 τ ω) := + inferInstance + +end + +/-! Fixed-index selection for bounded coordinate representatives. -/ +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def sequenceEval (n : ℕ) : Sequences M →ₐ[ℂ] M.toStarSubalgebra where + toFun a := a n + map_one' := rfl + map_mul' _ _ := rfl + map_zero' := rfl + map_add' _ _ := rfl + commutes' _ := rfl + +/-- Operator-norm exponentials of bounded sequences evaluate coordinatewise. -/ +theorem sequence_exp_apply (a : Sequences M) (n : ℕ) : + (NormedSpace.exp a) n = NormedSpace.exp (a n) := + NormedSpace.map_exp (sequenceEval n) + (BoundedContinuousFunction.lipschitz_eval_const n).continuous a + +theorem sequence_exp_product_apply (a : List (Sequences M)) (n : ℕ) : + ((a.map NormedSpace.exp).prod) n = + (a.map (fun b => NormedSpace.exp (b n))).prod := by + induction a with + | nil => rfl + | cons b a ih => + change (NormedSpace.exp b) n * ((a.map NormedSpace.exp).prod) n = + NormedSpace.exp (b n) * (a.map (fun b => NormedSpace.exp (b n))).prod + rw [sequence_exp_apply, ih] + +/-- Both limits hold at one coordinate, with the same positive tolerance. -/ +theorem select_coordinate (a ξ b : Sequences M) (ε : ℝ) (hε : 0 < ε) : + ∃ n : ℕ, τ.norm₂ (a n) < ‖sequenceQuotient τ ω a‖ + ε ∧ + ‖τ.trace (star (ξ n)*b n) - + inner ℂ (sequenceInclusion τ ω ξ) (sequenceInclusion τ ω b)‖ < ε := by + have hn : ∀ᶠ n in (ω : Filter ℕ), τ.norm₂ (a n) < ‖sequenceQuotient τ ω a‖ + ε := + (sequence_norm_tendsto τ ω a) + (Iio_mem_nhds (lt_add_of_pos_right _ hε)) + have ht := Metric.tendsto_nhds.mp (sequence_inner_tendsto τ ω ξ b) ε hε + obtain ⟨n, hn, ht⟩ := (hn.and ht).exists + exact ⟨n, hn, by simpa only [dist_eq_norm] using ht⟩ + +/-- Source-facing error transfer: a common representative index preserves a +quotient size bound and a complex trace-correlation bound, up to epsilon. -/ +theorem select_coordinate_with_bounds (a ξ b : Sequences M) + (d r ε : ℝ) (target : ℂ) (hε : 0 < ε) + (ha : ‖sequenceQuotient τ ω a‖ ≤ d) + (hb : ‖inner ℂ (sequenceInclusion τ ω ξ) (sequenceInclusion τ ω b) - target‖ ≤ r) : + ∃ n : ℕ, τ.norm₂ (a n) < d + ε ∧ ‖τ.trace (star (ξ n)*b n)-target‖ < r+ε := by + obtain ⟨n,hn,ht⟩ := select_coordinate τ ω a ξ b ε hε + refine ⟨n, hn.trans_le (add_le_add ha le_rfl), ?_⟩ + have h := norm_sub_le_norm_sub_add_norm_sub (τ.trace (star (ξ n)*b n)) + (inner ℂ (sequenceInclusion τ ω ξ) (sequenceInclusion τ ω b)) target + linarith + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/RelativeGeneration.lean b/lean/OAI/Analysis/FactorGeneration/RelativeGeneration.lean new file mode 100644 index 0000000000000000000000000000000000000000..79257f227783a28f8d9b1e74b057d625b71baca4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/RelativeGeneration.lean @@ -0,0 +1,406 @@ +import OAI.Analysis.FactorGeneration.HilbertProjections +import OAI.Analysis.FactorGeneration.MatrixSequence + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Actual finite star polynomials in one unitary variable and coefficients in +an included von Neumann algebra. Both uniform operator bounds and continuity +of trace-vector evaluation are proved by recursion on the expression. -/ +open Filter +open scoped Topology + +inductive RelativePolynomial (A : Type*) where + | coeff : A → RelativePolynomial A + | indeterminate : RelativePolynomial A + | add : RelativePolynomial A → RelativePolynomial A → RelativePolynomial A + | mul : RelativePolynomial A → RelativePolynomial A → RelativePolynomial A + | smul : ℂ → RelativePolynomial A → RelativePolynomial A + | adjoint : RelativePolynomial A → RelativePolynomial A + +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hNM : N ≤ M) +namespace RelativePolynomial + +def eval : Generator.RelativePolynomial N.toStarSubalgebra → TraceUnitary τ → M.toStarSubalgebra + | .coeff a, _ => coordinateInclusion hNM a + | .indeterminate, u => u.algebra τ + | .add p q, u => eval p u+eval q u + | .mul p q, u => eval p u*eval q u + | .smul z p, u => z • eval p u + | .adjoint p, u => star (eval p u) + +theorem norm_bound (p : Generator.RelativePolynomial N.toStarSubalgebra) : + ∃ C : ℝ, 0 ≤ C ∧ ∀ u : TraceUnitary τ, ‖eval τ hNM p u‖ ≤ C := by + induction p with + | coeff a => exact ⟨‖a‖,norm_nonneg _,fun _ => le_rfl⟩ + | indeterminate => exact ⟨1,zero_le_one,TraceUnitary.algebra_norm_le τ⟩ + | add p q hp hq => + obtain ⟨C,hC,hp⟩ := hp + obtain ⟨D,hD,hq⟩ := hq + exact ⟨C+D,add_nonneg hC hD,fun u => (norm_add_le _ _).trans (add_le_add (hp u) (hq u))⟩ + | mul p q hp hq => + obtain ⟨C,hC,hp⟩ := hp + obtain ⟨D,hD,hq⟩ := hq + exact ⟨C*D,mul_nonneg hC hD,fun u => (norm_mul_le _ _).trans + (mul_le_mul (hp u) (hq u) (norm_nonneg _) hC)⟩ + | smul z p hp => + obtain ⟨C,hC,hp⟩ := hp + refine ⟨‖z‖*C,mul_nonneg (norm_nonneg _) hC,fun u => ?_⟩ + simpa only [eval,norm_smul] using mul_le_mul_of_nonneg_left (hp u) (norm_nonneg z) + | adjoint p hp => + obtain ⟨C,hC,hp⟩ := hp + refine ⟨C,hC,fun u => ?_⟩ + change ‖star (eval τ hNM p u).val‖ ≤ C + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint.norm_map] + exact hp u + +def sectionVector (p : Generator.RelativePolynomial N.toStarSubalgebra) (u : TraceUnitary τ) : H := + (eval τ hNM p u).val τ.vector + +theorem continuous_sectionVector (p : Generator.RelativePolynomial N.toStarSubalgebra) : + Continuous (sectionVector τ hNM p) := by + induction p with + | coeff a => + change Continuous (fun _ : TraceUnitary τ => (coordinateInclusion hNM a).val τ.vector) + exact continuous_const + | indeterminate => exact (TraceUnitary.vector_isometry τ).continuous + | add p q hp hq => exact hp.add hq + | smul z p hp => exact continuous_const.smul hp + | adjoint p hp => + apply continuous_iff_continuousAt.mpr + intro u + apply (tendsto_vector_iff_norm₂ τ (𝓝 u) _ _).mpr + exact norm₂_limit_star τ _ _ ((tendsto_vector_iff_norm₂ τ (𝓝 u) _ _).mp hp.continuousAt) + | mul p q hp hq => + obtain ⟨C,_,hC⟩ := norm_bound τ hNM p + apply continuous_iff_continuousAt.mpr + intro u + apply (tendsto_vector_iff_norm₂ τ (𝓝 u) _ _).mpr + exact norm₂_limit_mul τ _ _ _ _ C hC + ((tendsto_vector_iff_norm₂ τ (𝓝 u) _ _).mp hp.continuousAt) + ((tendsto_vector_iff_norm₂ τ (𝓝 u) _ _).mp hq.continuousAt) + +end RelativePolynomial +end Tracial + +/-! The literal algebra W*(N,u), its trace Hilbert subspace, and density of +actual N-coefficient star-polynomial values in that subspace. -/ +open Filter +open scoped Topology +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hNM : N ≤ M) + +def relativeGenerators (u : TraceUnitary τ) : Set (H →L[ℂ] H) := + (N : Set (H →L[ℂ] H)) ∪ {(u.algebra τ).val} + +def relativeGenerated (u : TraceUnitary τ) : VonNeumannAlgebra H := + vonNeumannOfWOTClosed (wstar (relativeGenerators (N := N) τ u)) (wstar_closed _) + +include hNM in +theorem relativeGenerated_le (u : TraceUnitary τ) : relativeGenerated (N := N) τ u ≤ M := by + apply wstar_le (vonNeumann_wotClosed M) + intro a ha + rcases ha with ha | ha + · exact hNM ha + · rcases Set.mem_singleton_iff.mp ha with rfl + exact (u.algebra τ).property + +theorem le_relativeGenerated (u : TraceUnitary τ) : N ≤ relativeGenerated (N := N) τ u := + fun _ ha => subset_wstar _ (Or.inl ha) + +theorem unitary_mem_relativeGenerated (u : TraceUnitary τ) : + (u.algebra τ).val ∈ relativeGenerated (N := N) τ u := + subset_wstar _ (Or.inr rfl) + +namespace RelativePolynomial + +def valueAlgebra (u : TraceUnitary τ) : StarSubalgebra ℂ (H →L[ℂ] H) := + StarAlgebra.adjoin ℂ (relativeGenerators (N := N) τ u) + +theorem eval_mem (p : Generator.RelativePolynomial N.toStarSubalgebra) (u : TraceUnitary τ) : + (eval τ hNM p u).val ∈ valueAlgebra (N := N) τ u := by + induction p with + | coeff a => exact StarAlgebra.subset_adjoin ℂ _ (Or.inl a.property) + | indeterminate => exact StarAlgebra.subset_adjoin ℂ _ (Or.inr rfl) + | add p q hp hq => exact (valueAlgebra (N := N) τ u).add_mem hp hq + | mul p q hp hq => exact (valueAlgebra (N := N) τ u).mul_mem hp hq + | smul z p hp => exact (valueAlgebra (N := N) τ u).smul_mem hp z + | adjoint p hp => exact (valueAlgebra (N := N) τ u).star_mem' hp + +theorem exists_eval (u : TraceUnitary τ) (a : valueAlgebra (N := N) τ u) : + ∃ p : Generator.RelativePolynomial N.toStarSubalgebra, (eval τ hNM p u).val=a.val := by + rcases a with ⟨a,ha⟩ + induction ha using StarAlgebra.adjoin_induction with + | mem a ha => + rcases ha with ha | ha + · exact ⟨.coeff ⟨a,ha⟩,rfl⟩ + · rcases Set.mem_singleton_iff.mp ha with rfl + exact ⟨.indeterminate,rfl⟩ + | algebraMap z => exact ⟨.smul z (.coeff 1),by simp [eval,Algebra.algebraMap_eq_smul_one]⟩ + | add a b _ _ ha hb => + obtain ⟨p,hp⟩ := ha + obtain ⟨q,hq⟩ := hb + exact ⟨.add p q,by change (eval τ hNM p u).val+(eval τ hNM q u).val=a+b; rw [hp,hq]⟩ + | mul a b _ _ ha hb => + obtain ⟨p,hp⟩ := ha + obtain ⟨q,hq⟩ := hb + exact ⟨.mul p q,by change (eval τ hNM p u).val*(eval τ hNM q u).val=a*b; rw [hp,hq]⟩ + | star a _ ha => + obtain ⟨p,hp⟩ := ha + exact ⟨.adjoint p,by change star (eval τ hNM p u).val=star a; rw [hp]⟩ + +theorem valueAlgebra_le (u : TraceUnitary τ) : + valueAlgebra (N := N) τ u ≤ (relativeGenerated (N := N) τ u).toStarSubalgebra := + StarAlgebra.adjoin_le (subset_wstar _) + +theorem generated_eq_wstar_values (u : TraceUnitary τ) : + (relativeGenerated (N := N) τ u).toStarSubalgebra = + wstar (valueAlgebra (N := N) τ u : Set (H →L[ℂ] H)) := by + apply le_antisymm + · exact wstar_mono (StarAlgebra.subset_adjoin ℂ _) + · exact wstar_le (wstar_closed _) (valueAlgebra_le τ u) + +theorem exists_vector_approximation (u : TraceUnitary τ) + (a : (relativeGenerated (N := N) τ u).toStarSubalgebra) (ε : ℝ) (hε : 0 < ε) : + ∃ p : Generator.RelativePolynomial N.toStarSubalgebra, + ‖a.val τ.vector-sectionVector τ hNM p u‖ < ε := by + classical + have ha : a.val ∈ Set.centralizer (Set.centralizer + (valueAlgebra (N := N) τ u : Set (H →L[ℂ] H))) := by + rw [← bicommutantVonNeumann_coe] + change a.val ∈ (bicommutantVonNeumann (valueAlgebra (N := N) τ u)).toStarSubalgebra + rw [← wstar_starAlgebra_eq_bicommutant,← generated_eq_wstar_values] + exact a.property + obtain ⟨b,hb⟩ := bicommutant_finite_strong_approximation _ a.val ha {τ.vector} ε hε + obtain ⟨p,hp⟩ := exists_eval τ hNM u b + exact ⟨p,by simpa only [sectionVector,hp] using hb τ.vector (Finset.mem_singleton_self _)⟩ + +end RelativePolynomial + +def relativeTraceSpace (u : TraceUnitary τ) : Submodule ℂ H := + vectorOrbitClosure (relativeGenerated (N := N) τ u).toStarSubalgebra τ.vector + +instance relativeTraceSpace_complete (u : TraceUnitary τ) : + CompleteSpace (relativeTraceSpace (N := N) τ u) := + inferInstanceAs (CompleteSpace (vectorOrbitClosure _ _)) + +theorem polynomialVector_mem (p : Generator.RelativePolynomial N.toStarSubalgebra) + (u : TraceUnitary τ) : RelativePolynomial.sectionVector τ hNM p u ∈ + relativeTraceSpace (N := N) τ u := + Submodule.le_topologicalClosure _ ⟨⟨(RelativePolynomial.eval τ hNM p u).val, + RelativePolynomial.valueAlgebra_le τ u (RelativePolynomial.eval_mem τ hNM p u)⟩,rfl⟩ + +theorem polynomialVector_dense (u : TraceUnitary τ) : + DenseRange (fun p : Generator.RelativePolynomial N.toStarSubalgebra => + (⟨RelativePolynomial.sectionVector τ hNM p u,polynomialVector_mem τ hNM p u⟩ : + relativeTraceSpace (N := N) τ u)) := by + intro ξ + apply Metric.mem_closure_iff.mpr + intro ε hε + have hξ : ξ.val ∈ closure (Set.range (fun a : (relativeGenerated (N := N) τ u).toStarSubalgebra => + a.val τ.vector)) := ξ.property + obtain ⟨_,⟨a,rfl⟩,ha⟩ := Metric.mem_closure_iff.mp hξ (ε/2) (half_pos hε) + obtain ⟨p,hp⟩ := RelativePolynomial.exists_vector_approximation τ hNM u a (ε/2) (half_pos hε) + refine ⟨_,⟨p,rfl⟩,?_⟩ + change dist ξ.val (RelativePolynomial.sectionVector τ hNM p u) < ε + have hdist := dist_triangle ξ.val (a.val τ.vector) (RelativePolynomial.sectionVector τ hNM p u) + rw [dist_eq_norm (a.val τ.vector)] at hdist + linarith + +end Tracial + +/-! The literal interleaved word belongs to W*(N,u), is unitary, and has +trace norm one. The printed perturbation-size bound tends to zero. -/ +open Filter +open scoped Topology +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hNM : N ≤ M) + +def relativeUnitaryWord (u : TraceUnitary τ) (t : ℕ → unitary N.toStarSubalgebra) (ell : ℕ) : + M.toStarSubalgebra := + coordinateInclusion hNM (t 0 : N.toStarSubalgebra)* + ((List.range ell).map (fun j => u.algebra τ* + coordinateInclusion hNM (t (j+1) : N.toStarSubalgebra))).prod + +theorem relativeUnitaryWord_mem_unitary (u : TraceUnitary τ) + (t : ℕ → unitary N.toStarSubalgebra) (ell : ℕ) : + relativeUnitaryWord τ hNM u t ell ∈ unitary M.toStarSubalgebra := by + apply (unitary M.toStarSubalgebra).mul_mem + · exact Unitary.map_mem (coordinateInclusion hNM) (t 0).property + · apply (unitary M.toStarSubalgebra).list_prod_mem + intro a ha + obtain ⟨j,_,rfl⟩ := List.mem_map.mp ha + exact (unitary M.toStarSubalgebra).mul_mem u.toUnitary.property + (Unitary.map_mem (coordinateInclusion hNM) (t (j+1)).property) + +theorem relativeUnitaryWord_mem_generated (u : TraceUnitary τ) + (t : ℕ → unitary N.toStarSubalgebra) (ell : ℕ) : + (relativeUnitaryWord τ hNM u t ell).val ∈ relativeGenerated (N := N) τ u := by + let S := (relativeGenerated (N := N) τ u).toStarSubalgebra + have hn (j : ℕ) : (coordinateInclusion hNM (t j : N.toStarSubalgebra)).val ∈ S := + le_relativeGenerated τ u (t j).val.property + apply S.mul_mem (hn 0) + change ((List.range ell).map (fun j => u.algebra τ* + coordinateInclusion hNM (t (j+1) : N.toStarSubalgebra))).prod ∈ + insideAlgebra (M := M) (P := relativeGenerated (N := N) τ u) + apply (insideAlgebra (M := M) (P := relativeGenerated (N := N) τ u)).list_prod_mem + intro a ha + obtain ⟨j,_,rfl⟩ := List.mem_map.mp ha + exact S.mul_mem (unitary_mem_relativeGenerated τ u) (hn (j+1)) + +theorem norm₂_unitary (u : unitary M.toStarSubalgebra) : + τ.norm₂ (u : M.toStarSubalgebra)=1 := by + have h := norm₂_sq_trace τ (u : M.toStarSubalgebra) + rw [u.property.1,τ.trace_one,Complex.one_re] at h + nlinarith [show 0 ≤ τ.norm₂ (u : M.toStarSubalgebra) from norm_nonneg _] + +theorem relativeUnitaryWord_correlation_le (u : TraceUnitary τ) + (t : ℕ → unitary N.toStarSubalgebra) (ell : ℕ) (xi : M.toStarSubalgebra) : + ‖τ.trace (star xi*relativeUnitaryWord τ hNM u t ell)‖ ≤ + projectionNorm (relativeTraceSpace (N := N) τ u) (baseVector τ xi) := by + rw [← baseVector_inner_trace] + apply correlation_le_projectionNorm + · exact Submodule.le_topologicalClosure _ ⟨⟨(relativeUnitaryWord τ hNM u t ell).val, + relativeUnitaryWord_mem_generated τ hNM u t ell⟩,rfl⟩ + · exact norm₂_unitary τ ⟨_,relativeUnitaryWord_mem_unitary τ hNM u t ell⟩ + +theorem perturbation_size_tendsto (α : ℝ) : + Tendsto (fun n : ℕ => α/Real.sqrt (2*((n+1 : ℕ) : ℝ))+1/((n+1 : ℕ) : ℝ)) atTop (𝓝 0) := by + have hn : Tendsto (fun n : ℕ => ((n+1 : ℕ) : ℝ)) atTop atTop := + tendsto_natCast_atTop_atTop.comp (tendsto_add_atTop_nat 1) + have ht : Tendsto (fun n : ℕ => 2*((n+1 : ℕ) : ℝ)) atTop atTop := + hn.const_mul_atTop (by norm_num : (0 : ℝ) < 2) + have hs := (Real.tendsto_sqrt_atTop.comp ht).const_div_atTop α + have hi := hn.const_div_atTop (1 : ℝ) + simpa only [add_zero,Function.comp_def] using hs.add hi + +end Tracial + +/-! Projection continuity for generated algebras, using the complete trace-unitary metric, dense polynomial sections, and trace-vector separability. -/ +open Filter +open scoped Topology +namespace Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hNM : N ≤ M) + +include hNM in +theorem relative_projection_lowerSemicontinuous (ξ : H) : + LowerSemicontinuous (fun u : TraceUnitary τ => + projectionNorm (relativeTraceSpace (N := N) τ u) ξ) := + projectionNorm_lowerSemicontinuous (relativeTraceSpace (N := N) τ) + (RelativePolynomial.sectionVector τ hNM) (polynomialVector_mem τ hNM) + (RelativePolynomial.continuous_sectionVector τ hNM) (polynomialVector_dense τ hNM) ξ + +include hNM in +theorem common_relative_projection_continuity + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ C : Set (TraceUnitary τ), IsGδ C ∧ Dense C ∧ + ∀ u ∈ C, ∀ ξ : traceCyclicSpace τ, + ContinuousAt (fun v => projectionNorm (relativeTraceSpace (N := N) τ v) ξ.val) u := by + let := traceCyclicSpace_separable τ hsep + exact common_continuity_of_lipschitz + (fun (ξ : traceCyclicSpace τ) u => projectionNorm (relativeTraceSpace (N := N) τ u) ξ.val) + (fun ξ => relative_projection_lowerSemicontinuous τ hNM ξ.val) + (fun u ξ η => projectionNorm_lipschitz (relativeTraceSpace (N := N) τ u) ξ.val η.val) + +include hNM in +theorem common_relative_projection_continuity_algebra + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + ∃ C : Set (TraceUnitary τ), IsGδ C ∧ Dense C ∧ + ∀ u ∈ C, ∀ x : M.toStarSubalgebra, + ContinuousAt (fun v => projectionNorm (relativeTraceSpace (N := N) τ v) (baseVector τ x)) u := by + obtain ⟨C,hC,hd,hcont⟩ := common_relative_projection_continuity τ hNM hsep + exact ⟨C,hC,hd,fun u hu x => hcont u hu + ⟨baseVector τ x,Submodule.le_topologicalClosure _ ⟨x,rfl⟩⟩⟩ + +/-! The bounded conditional expectation agrees with the actual Hilbert +projection. Proper subalgebras have a unitary outside them, yielding the +nonzero represented residual used by thm:relative-generation. -/ + +theorem conditionalExpectation_vector_projection (x : M.toStarSubalgebra) : + (vectorOrbitClosure N.toStarSubalgebra τ.vector).starProjection (baseVector τ x) = + baseVector τ (conditionalExpectation τ hNM x) := by + apply Submodule.eq_starProjection_of_mem_of_inner_eq_zero + · exact Submodule.le_topologicalClosure _ + ⟨⟨(conditionalExpectation τ hNM x).val,conditionalExpectation_mem τ hNM x⟩,rfl⟩ + · intro w hw + rw [← map_sub] + apply inner_eq_zero_symm.mp + have hc : IsClosed {y : H | inner ℂ y (baseVector τ (x-conditionalExpectation τ hNM x))=0} := + isClosed_eq (continuous_id.inner continuous_const) continuous_const + apply closure_minimal (t := {y : H | inner ℂ y (baseVector τ (x-conditionalExpectation τ hNM x))=0}) + ?_ hc hw + rintro _ ⟨a,rfl⟩ + change inner ℂ (baseVector τ (coordinateInclusion hNM a)) + (baseVector τ (x-conditionalExpectation τ hNM x))=0 + rw [baseVector_inner_trace] + exact conditionalExpectation_orthogonal τ hNM x + ⟨star (coordinateInclusion hNM a),N.toStarSubalgebra.star_mem' a.property⟩ + +include hNM in +theorem exists_unitary_outside (hne : N ≠ M) : + ∃ z : unitary M.toStarSubalgebra, (z : M.toStarSubalgebra).val ∉ N := by + classical + by_contra h + have hu : ∀ z : unitary M.toStarSubalgebra, (z : M.toStarSubalgebra).val ∈ N := by + simpa only [not_exists,not_not] using h + let : CStarAlgebra M.toStarSubalgebra := {} + let S := (insideAlgebra (M := M) (P := N)).toSubalgebra.toSubmodule + have hs : (⊤ : Submodule ℂ M.toStarSubalgebra) ≤ S := by + rw [← CStarAlgebra.span_unitary M.toStarSubalgebra] + exact Submodule.span_le.mpr (fun z hz => hu ⟨z,hz⟩) + apply hne + apply le_antisymm hNM + intro a ha + exact hs (show (⟨a,ha⟩ : M.toStarSubalgebra) ∈ (⊤ : Submodule ℂ M.toStarSubalgebra) from trivial) + +def subalgebraResidual (x : M.toStarSubalgebra) : M.toStarSubalgebra := + x-conditionalExpectation τ hNM x + +theorem subalgebraResidual_vector (x : M.toStarSubalgebra) : + baseVector τ (subalgebraResidual τ hNM x) = + residual (vectorOrbitClosure N.toStarSubalgebra τ.vector) (baseVector τ x) := by + rw [residual,conditionalExpectation_vector_projection τ hNM] + exact map_sub (baseVector τ) _ _ + +theorem subalgebraResidual_projection (x : M.toStarSubalgebra) : + (vectorOrbitClosure N.toStarSubalgebra τ.vector).starProjection + (baseVector τ (subalgebraResidual τ hNM x))=0 := by + rw [subalgebraResidual_vector] + exact residual_projection_zero _ _ + +theorem subalgebraResidual_correlation (x : M.toStarSubalgebra) : + τ.trace (star (subalgebraResidual τ hNM x)*x)= + (τ.norm₂ (subalgebraResidual τ hNM x) : ℂ)^2 := by + rw [← baseVector_inner_trace] + change inner ℂ (baseVector τ (subalgebraResidual τ hNM x)) (baseVector τ x)= + (‖baseVector τ (subalgebraResidual τ hNM x)‖ : ℂ)^2 + rw [subalgebraResidual_vector] + exact residual_correlation _ _ + +theorem subalgebraResidual_norm_pos (x : M.toStarSubalgebra) (hx : x.val ∉ N) : + 0 < τ.norm₂ (subalgebraResidual τ hNM x) := by + apply lt_of_le_of_ne (norm_nonneg _) + intro h + have hz := (τ.norm₂_eq_zero_iff _).mp h.symm + have he : x=conditionalExpectation τ hNM x := sub_eq_zero.mp hz + exact hx (he ▸ conditionalExpectation_mem τ hNM x) + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/RepresentedCorners.lean b/lean/OAI/Analysis/FactorGeneration/RepresentedCorners.lean new file mode 100644 index 0000000000000000000000000000000000000000..03f730f1804468e061b55cfa8ba21a525d9a8cd2 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/RepresentedCorners.lean @@ -0,0 +1,473 @@ +import OAI.Analysis.FactorGeneration.LocalQuantization + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! The actual corner on pH. Extension by zero identifies its operators with +supported ambient operators; weak closedness is proved by WOT continuity. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (p : AlgebraProjection M) + +def cornerSpace : Submodule ℂ H where + carrier := {x | p.val.val x=x} + zero_mem' := by simp + add_mem' hx hy := by simp_all + smul_mem' c x hx := by simp_all + +@[simp] theorem mem_cornerSpace (x : H) : x ∈ cornerSpace p ↔ p.val.val x=x := Iff.rfl + +instance cornerSpace_complete : CompleteSpace (cornerSpace p) := by + have hc : IsClosed (cornerSpace p : Set H) := isClosed_eq p.val.val.continuous continuous_id + exact hc.completeSpace_coe + +def cornerProject : H →L[ℂ] cornerSpace p := + p.val.val.codRestrict (cornerSpace p) (fun x => by + change p.val.val (p.val.val x)=p.val.val x + exact congrArg (fun a : M.toStarSubalgebra => a.val x) p.property.isIdempotentElem.eq) + +@[simp] theorem cornerProject_coe (x : H) : (cornerProject p x).val=p.val.val x := rfl +@[simp] theorem cornerProject_subtype (x : cornerSpace p) : cornerProject p x.val=x := + Subtype.ext x.property + +theorem cornerProject_inner (x : H) (y : cornerSpace p) : + inner ℂ (cornerProject p x) y=inner ℂ x y.val := by + change inner ℂ (p.val.val x) y.val=inner ℂ x y.val + have hs : star p.val.val=p.val.val := congrArg Subtype.val p.property.isSelfAdjoint.star_eq + rw [← hs,ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left,y.property] + +def cornerExtend (a : cornerSpace p →L[ℂ] cornerSpace p) : H →L[ℂ] H := + (cornerSpace p).subtypeL.comp (a.comp (cornerProject p)) + +@[simp] theorem cornerExtend_apply (a : cornerSpace p →L[ℂ] cornerSpace p) (x : H) : + cornerExtend p a x=(a (cornerProject p x)).val := rfl + +@[simp] theorem cornerExtend_zero : cornerExtend p 0=0 := by ext x; rfl +@[simp] theorem cornerExtend_add (a b : cornerSpace p →L[ℂ] cornerSpace p) : + cornerExtend p (a+b)=cornerExtend p a+cornerExtend p b := by ext x; rfl +@[simp] theorem cornerExtend_smul (c : ℂ) (a : cornerSpace p →L[ℂ] cornerSpace p) : + cornerExtend p (c • a)=c • cornerExtend p a := by ext x; rfl +@[simp] theorem cornerExtend_one : cornerExtend p 1=p.val.val := by ext x; rfl +@[simp] theorem cornerExtend_mul (a b : cornerSpace p →L[ℂ] cornerSpace p) : + cornerExtend p (a*b)=cornerExtend p a*cornerExtend p b := by + ext x + simp only [mul_apply_eq_comp,cornerExtend_apply,cornerProject_subtype] + +@[simp] theorem cornerExtend_star (a : cornerSpace p →L[ℂ] cornerSpace p) : + cornerExtend p (star a)=star (cornerExtend p a) := by + apply ContinuousLinearMap.ext + intro x + apply ext_inner_left ℂ + intro y + rw [cornerExtend_apply,← cornerProject_inner,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right] + change inner ℂ (a (cornerProject p y)) (cornerProject p x)=_ + rw [← inner_conj_symm,cornerProject_inner,inner_conj_symm] + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + rfl + +theorem cornerExtend_injective : Function.Injective (cornerExtend p) := by + intro a b hab + ext x + have h := congrArg (fun T : H →L[ℂ] H => T x.val) hab + simpa only [cornerExtend_apply,cornerProject_subtype] using h + +@[simp] theorem cornerExtend_left (a : cornerSpace p →L[ℂ] cornerSpace p) : + p.val.val*cornerExtend p a=cornerExtend p a := by + ext x + exact (a (cornerProject p x)).property + +@[simp] theorem cornerExtend_right (a : cornerSpace p →L[ℂ] cornerSpace p) : + cornerExtend p a*p.val.val=cornerExtend p a := by + rw [← cornerExtend_one p,← cornerExtend_mul,mul_one] + +def cornerStarAlgebra : StarSubalgebra ℂ (cornerSpace p →L[ℂ] cornerSpace p) where + carrier := {a | cornerExtend p a ∈ M} + zero_mem' := by simp + one_mem' := by simp + add_mem' ha hb := by simpa using M.add_mem ha hb + mul_mem' ha hb := by simpa using M.mul_mem ha hb + algebraMap_mem' c := by + change cornerExtend p (c • 1) ∈ M + simpa using M.toStarSubalgebra.smul_mem p.val.property c + star_mem' ha := by simpa using star_mem ha + +theorem cornerExtend_wot_continuous : Continuous (fun a : cornerSpace p →WOT[ℂ] cornerSpace p => + ContinuousLinearMapWOT.ofCLM (cornerExtend p a.toCLM)) := by + apply ContinuousLinearMapWOT.continuous_iff.mpr + intro x y + simp only [ContinuousLinearMapWOT.ofCLM_apply,cornerExtend_apply,← cornerProject_inner] + exact ContinuousLinearMapWOT.continuous_inner_apply continuous_id _ _ + +theorem cornerStarAlgebra_wotClosed : WOTClosed (cornerStarAlgebra p) := + (vonNeumann_wotClosed M).preimage (cornerExtend_wot_continuous p) + +def representedCorner : VonNeumannAlgebra (cornerSpace p) := + vonNeumannOfWOTClosed (cornerStarAlgebra p) (cornerStarAlgebra_wotClosed p) + +def cornerEmbedding : (representedCorner p).toStarSubalgebra →⋆ₙₐ[ℂ] M.toStarSubalgebra where + toFun a := ⟨cornerExtend p a.val,a.property⟩ + map_zero' := Subtype.ext (cornerExtend_zero p) + map_add' a b := Subtype.ext (cornerExtend_add p a.val b.val) + map_mul' a b := Subtype.ext (cornerExtend_mul p a.val b.val) + map_smul' c a := Subtype.ext (cornerExtend_smul p c a.val) + map_star' a := Subtype.ext (cornerExtend_star p a.val) + +theorem cornerEmbedding_injective : Function.Injective (cornerEmbedding p) := by + intro a b h + exact Subtype.ext (cornerExtend_injective p (congrArg Subtype.val h)) + +@[simp] theorem cornerEmbedding_one : cornerEmbedding p 1=p.val := + Subtype.ext (cornerExtend_one p) +@[simp] theorem cornerEmbedding_left (a : (representedCorner p).toStarSubalgebra) : + p.val*cornerEmbedding p a=cornerEmbedding p a := Subtype.ext (cornerExtend_left p a.val) +@[simp] theorem cornerEmbedding_right (a : (representedCorner p).toStarSubalgebra) : + cornerEmbedding p a*p.val=cornerEmbedding p a := Subtype.ext (cornerExtend_right p a.val) + +/-! Compression and extension are inverse on supported operators. -/ + +def cornerCompressOperator (x : H →L[ℂ] H) : cornerSpace p →L[ℂ] cornerSpace p := + (cornerProject p).comp (x.comp (cornerSpace p).subtypeL) + +@[simp] theorem cornerCompressOperator_apply (x : H →L[ℂ] H) (y : cornerSpace p) : + (cornerCompressOperator p x y).val=p.val.val (x y.val) := rfl + +theorem cornerExtend_compress (x : H →L[ℂ] H) : + cornerExtend p (cornerCompressOperator p x)=p.val.val*x*p.val.val := by ext y; rfl + +@[simp] theorem cornerCompress_extend (x : cornerSpace p →L[ℂ] cornerSpace p) : + cornerCompressOperator p (cornerExtend p x)=x := by + apply cornerExtend_injective p + rw [cornerExtend_compress,cornerExtend_left,cornerExtend_right] + +def cornerCompress (x : M.toStarSubalgebra) : (representedCorner p).toStarSubalgebra := + ⟨cornerCompressOperator p x.val,by + change cornerExtend p (cornerCompressOperator p x.val) ∈ M + rw [cornerExtend_compress] + exact M.mul_mem (M.mul_mem p.val.property x.property) p.val.property⟩ + +@[simp] theorem cornerEmbedding_compress (x : M.toStarSubalgebra) : + cornerEmbedding p (cornerCompress p x)=p.val*x*p.val := Subtype.ext (cornerExtend_compress p x.val) + +@[simp] theorem cornerCompress_embedding (x : (representedCorner p).toStarSubalgebra) : + cornerCompress p (cornerEmbedding p x)=x := Subtype.ext (cornerCompress_extend p x.val) + +theorem cornerEmbedding_range : Set.range (cornerEmbedding p)= + {x : M.toStarSubalgebra | p.val*x=x ∧ x*p.val=x} := by + ext x + constructor + · rintro ⟨a,rfl⟩ + exact ⟨cornerEmbedding_left p a,cornerEmbedding_right p a⟩ + · rintro ⟨hl,hr⟩ + exact ⟨cornerCompress p x,by rw [cornerEmbedding_compress,hl,hr]⟩ + +end + +/-! The normalized faithful vector trace on the actual corner pH. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (p : AlgebraProjection M) + +theorem corner_norm₂_pos (hp : p.val ≠ 0) : 0 < τ.norm₂ p.val := + lt_of_le_of_ne (norm_nonneg _) (fun h => hp ((τ.norm₂_eq_zero_iff _).mp h.symm)) + +def normalizedCornerVector : cornerSpace p := + ((τ.norm₂ p.val : ℂ)⁻¹) • cornerProject p τ.vector + +theorem normalizedCornerVector_norm (hp : p.val ≠ 0) : ‖normalizedCornerVector τ p‖=1 := by + change ‖((τ.norm₂ p.val : ℂ)⁻¹) • cornerProject p τ.vector‖=1 + rw [norm_smul,norm_inv,Complex.norm_real,Real.norm_of_nonneg (show 0 ≤ τ.norm₂ p.val from norm_nonneg _)] + change (τ.norm₂ p.val)⁻¹*τ.norm₂ p.val=1 + exact inv_mul_cancel₀ (corner_norm₂_pos τ p hp).ne' + +theorem normalizedCornerVector_pairing (a : (representedCorner p).toStarSubalgebra) : + inner ℂ (normalizedCornerVector τ p) (a.val (normalizedCornerVector τ p))= + ((τ.norm₂ p.val : ℂ)^2)⁻¹ * τ.trace (cornerEmbedding p a) := by + simp only [normalizedCornerVector,map_smul,inner_smul_left,inner_smul_right, + map_inv₀,Complex.conj_ofReal] + rw [cornerProject_inner] + change (τ.norm₂ p.val : ℂ)⁻¹*((τ.norm₂ p.val : ℂ)⁻¹*τ.trace (cornerEmbedding p a))=_ + ring + +def representedCornerTrace (hp : p.val ≠ 0) : TracialRepresentation (representedCorner p) where + vector := normalizedCornerVector τ p + norm_vector := normalizedCornerVector_norm τ p hp + cyclic a b := by + change inner ℂ (normalizedCornerVector τ p) ((a*b).val (normalizedCornerVector τ p))= + inner ℂ (normalizedCornerVector τ p) ((b*a).val (normalizedCornerVector τ p)) + rw [normalizedCornerVector_pairing,normalizedCornerVector_pairing,map_mul,map_mul,τ.trace_mul_comm] + separating a ha := by + apply cornerEmbedding_injective p + rw [map_zero] + apply τ.separating + have h : ((τ.norm₂ p.val : ℂ)⁻¹) • (a.val (cornerProject p τ.vector))=0 := by + simpa only [normalizedCornerVector,map_smul] using ha + have hscalar : (τ.norm₂ p.val : ℂ)⁻¹ ≠ 0 := + inv_ne_zero (Complex.ofReal_ne_zero.mpr (corner_norm₂_pos τ p hp).ne') + have hz := (smul_eq_zero.mp h).resolve_left hscalar + exact congrArg Subtype.val hz + +theorem representedCornerTrace_norm₂ (hp : p.val ≠ 0) + (a : (representedCorner p).toStarSubalgebra) : + (representedCornerTrace τ p hp).norm₂ a=τ.norm₂ (cornerEmbedding p a)/τ.norm₂ p.val := by + change ‖a.val (((τ.norm₂ p.val : ℂ)⁻¹) • cornerProject p τ.vector)‖=_ + rw [map_smul,norm_smul,norm_inv,Complex.norm_real,Real.norm_of_nonneg (show 0 ≤ τ.norm₂ p.val from norm_nonneg _)] + change (τ.norm₂ p.val)⁻¹*τ.norm₂ (cornerEmbedding p a)=_ + exact (div_eq_inv_mul _ _).symm + +theorem representedCornerTrace_trace (hp : p.val ≠ 0) + (a : (representedCorner p).toStarSubalgebra) : + (representedCornerTrace τ p hp).trace a=τ.trace (cornerEmbedding p a)/τ.trace p.val := by + change inner ℂ (normalizedCornerVector τ p) (a.val (normalizedCornerVector τ p))=_ + rw [normalizedCornerVector_pairing] + have ht : τ.trace p.val=(τ.norm₂ p.val : ℂ)^2 := by + have h := τ.trace_star_mul p.val + rwa [p.property.isSelfAdjoint.star_eq,p.property.isIdempotentElem.eq] at h + rw [ht,div_eq_inv_mul] + +end + +/-! Subcorner inclusion, inherited diffuseness/irreducibility, and L2 separability. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (p : AlgebraProjection M) + +def projectionInSubalgebra (hpN : p.val.val ∈ N) : AlgebraProjection N := + ⟨⟨p.val.val,hpN⟩,⟨Subtype.ext (congrArg (fun a : M.toStarSubalgebra => a.val) p.property.isIdempotentElem.eq), + Subtype.ext (congrArg (fun a : M.toStarSubalgebra => a.val) p.property.isSelfAdjoint.star_eq)⟩⟩ + +/-- Both corners act on the same pH; only the membership predicate changes. -/ +def representedSubcorner (hpN : p.val.val ∈ N) : VonNeumannAlgebra (cornerSpace p) := + representedCorner (projectionInSubalgebra p hpN) + +theorem representedSubcorner_le (hpN : p.val.val ∈ N) (hNM : N ≤ M) : + representedSubcorner p hpN ≤ representedCorner p := fun _ h => hNM h + +theorem representedCorner_diffuse + (hdiff : ∀ r : M.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) : + ∀ r : (representedCorner p).toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : (representedCorner p).toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q := by + intro r hr hr0 + have hr' := hr.map (cornerEmbedding p) + have hr0' : cornerEmbedding p r ≠ 0 := by + intro h + exact hr0 (cornerEmbedding_injective p (h.trans (map_zero (cornerEmbedding p)).symm)) + obtain ⟨q,hq,hq0,hqr,hrq,hqr'⟩ := hdiff _ hr' hr0' + have hl : p.val*q=q := by + rw [← hrq,← mul_assoc,cornerEmbedding_left,hrq] + have hh : q*p.val=q := by + rw [← hqr',mul_assoc,cornerEmbedding_right,hqr'] + let q' := cornerCompress p q + have he : cornerEmbedding p q'=q := by rw [cornerEmbedding_compress,hl,hh] + have hi := cornerEmbedding_injective p + refine ⟨q',⟨?_,?_⟩,?_,?_,?_,?_⟩ + · apply hi + rw [map_mul,he,hq.isIdempotentElem.eq] + · apply hi + rw [map_star,he,hq.isSelfAdjoint.star_eq] + · intro hz + apply hq0 + rw [← he,hz,map_zero] + · intro hz + exact hqr (he.symm.trans (congrArg (cornerEmbedding p) hz)) + · apply hi + rw [map_mul,he,hrq] + · apply hi + rw [map_mul,he,hqr'] + +include τ in +theorem representedCorner_irreducible (hpN : p.val.val ∈ N) (hNM : N ≤ M) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) : + ∀ c : (representedCorner p).toStarSubalgebra, + (∀ a : (representedSubcorner p hpN).toStarSubalgebra, + coordinateInclusion (representedSubcorner_le p hpN hNM) a*c= + c*coordinateInclusion (representedSubcorner_le p hpN hNM) a) → + ∃ z : ℂ,c=z • (1 : (representedCorner p).toStarSubalgebra) := by + intro c hc + have hirr' : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N),(a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra) := by + intro c hh + exact hirr c (fun a => hh ⟨coordinateInclusion hNM a,a.property⟩) + obtain ⟨z,hz⟩ := corner_commutant_scalar τ (insideAlgebra (M := M) (P := N)) hirr' p + (cornerEmbedding p c) (cornerEmbedding_left p c) (cornerEmbedding_right p c) (by + intro a + let b : (representedSubcorner p hpN).toStarSubalgebra := + cornerCompress (projectionInSubalgebra p hpN) ⟨a.val.val,a.property⟩ + have hb : cornerEmbedding p + (coordinateInclusion (representedSubcorner_le p hpN hNM) b)=p.val*a.val*p.val := + Subtype.ext (cornerExtend_compress p a.val.val) + have h := congrArg (cornerEmbedding p) (hc b) + rw [map_mul,map_mul,hb] at h + exact h.symm) + refine ⟨z,cornerEmbedding_injective p ?_⟩ + simpa only [map_smul,cornerEmbedding_one] using hz + +include τ in +theorem representedCorner_factor + (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) : + ∀ c : (representedCorner p).toStarSubalgebra, + (∀ a : (representedCorner p).toStarSubalgebra,a*c=c*a) → + ∃ z : ℂ,c=z • (1 : (representedCorner p).toStarSubalgebra) := by + exact representedCorner_irreducible τ p p.val.property le_rfl hfactor + +theorem representedCorner_separable (hp : p.val ≠ 0) + (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) : + TopologicalSpace.IsSeparable (Set.range (baseVector (representedCornerTrace τ p hp))) := by + let f : H → cornerSpace p := fun x => ((τ.norm₂ p.val : ℂ)⁻¹) • cornerProject p x + have hf : Continuous f := by + dsimp [f] + exact (cornerProject p).continuous.const_smul ((τ.norm₂ p.val : ℂ)⁻¹) + apply (hsep.image hf).mono + rintro y ⟨a,rfl⟩ + refine ⟨baseVector τ (cornerEmbedding p a),⟨cornerEmbedding p a,rfl⟩,?_⟩ + change ((τ.norm₂ p.val : ℂ)⁻¹) • cornerProject p (a.val (cornerProject p τ.vector)).val= + a.val (((τ.norm₂ p.val : ℂ)⁻¹) • cornerProject p τ.vector) + rw [cornerProject_subtype,map_smul] + +end + +/-! Transport actual unit partitions on pH to ambient partitions of p. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (p : AlgebraProjection M) +namespace CornerPartition +variable (Q : CornerPartition (identityProjection (representedCorner p))) + +def fromRepresentedCorner : CornerPartition p where + size := Q.size + piece i := ⟨cornerEmbedding p (Q.piece i).val,(Q.piece i).property.map (cornerEmbedding p)⟩ + orthogonal i j hij := by + change cornerEmbedding p (Q.piece i).val*cornerEmbedding p (Q.piece j).val=0 + rw [← map_mul,Q.orthogonal i j hij,map_zero] + total := by + change (∑ i,cornerEmbedding p (Q.piece i).val)=p.val + rw [← map_sum,Q.total] + exact cornerEmbedding_one p + +theorem fromRepresentedCorner_pinch (x : (representedCorner p).toStarSubalgebra) : + (Q.fromRepresentedCorner p).pinch (cornerEmbedding p x)=cornerEmbedding p (Q.pinch x) := by + unfold pinch + change (∑ i,cornerEmbedding p (Q.piece i).val*cornerEmbedding p x* + cornerEmbedding p (Q.piece i).val)=cornerEmbedding p _ + simp only [← map_mul,← map_sum] + +theorem fromRepresentedCorner_pinch_compress (x : M.toStarSubalgebra) : + (Q.fromRepresentedCorner p).pinch x=cornerEmbedding p (Q.pinch (cornerCompress p x)) := by + rw [← Q.fromRepresentedCorner_pinch,cornerEmbedding_compress] + unfold pinch + apply Finset.sum_congr rfl + intro i _ + change cornerEmbedding p (Q.piece i).val*x*cornerEmbedding p (Q.piece i).val= + cornerEmbedding p (Q.piece i).val*(p.val*x*p.val)*cornerEmbedding p (Q.piece i).val + simp only [← mul_assoc,cornerEmbedding_right] + simp only [mul_assoc,cornerEmbedding_left] + +theorem fromRepresentedCorner_mem {N : VonNeumannAlgebra H} (hpN : p.val.val ∈ N) + (hQ : ∀ i,(Q.piece i).val.val ∈ representedSubcorner p hpN) : + ∀ i,((Q.fromRepresentedCorner p).piece i).val.val ∈ N := hQ + +theorem fromRepresentedCorner_energy (τ : TracialRepresentation M) (hp : p.val ≠ 0) + (x : M.toStarSubalgebra) : + τ.norm₂ ((Q.fromRepresentedCorner p).pinch x)^2= + (τ.trace p.val).re*(representedCornerTrace τ p hp).norm₂ (Q.pinch (cornerCompress p x))^2 := by + rw [Q.fromRepresentedCorner_pinch_compress,representedCornerTrace_norm₂,projection_trace_sq τ _ p.property] + field_simp [(corner_norm₂_pos τ p hp).ne'] + +end CornerPartition + +end + +/-! Actual centered pNp pinching partitions and local pieces. The corner, +normalized trace, structural properties, and separability are constructed. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_irreducible_corner_zero_trace_partition + (p : AlgebraProjection M) (hp : p.val ≠ 0) (hpN : p.val.val ∈ N) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (hx : ∀ i ∈ F,τ.trace (p.val*x i*p.val)=0) (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition p,(∀ i,(Q.piece i).val.val ∈ N) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (x i))^2) < ε*(τ.trace p.val).re := by + let τp := representedCornerTrace τ p hp + let pN := projectionInSubalgebra p hpN + let hinc := representedSubcorner_le p hpN hNM + have hf := representedCorner_factor (restrictedTrace τ hNM) pN hfactor + have hd := representedCorner_diffuse pN hdiff + have hi := representedCorner_irreducible τ p hpN hNM hirr + have hs := representedCorner_separable τ p hp hsep + let y : ι → (representedCorner p).toStarSubalgebra := fun i => cornerCompress p (x i) + have hy : ∀ i ∈ F,τp.trace (y i)=0 := by + intro i hi + rw [representedCornerTrace_trace,cornerEmbedding_compress,hx i hi,zero_div] + obtain ⟨Q,hQ,hE⟩ := exists_irreducible_centered_partition τp hinc hf hd hi hs F y hy ε hε + refine ⟨Q.fromRepresentedCorner p,Q.fromRepresentedCorner_mem p hpN hQ,?_⟩ + have henergy : (∑ i ∈ F,τ.norm₂ ((Q.fromRepresentedCorner p).pinch (x i))^2)= + (τ.trace p.val).re*(∑ i ∈ F,τp.norm₂ (Q.pinch (y i))^2) := by + simp only [Q.fromRepresentedCorner_energy p τ hp,Finset.mul_sum,τp,y] + rw [henergy,mul_comm ε] + exact mul_lt_mul_of_pos_left hE (projection_trace_pos τ p.val p.property hp) + +theorem exists_irreducible_corner_centered_partition + (p : AlgebraProjection M) (hp : p.val ≠ 0) (hpN : p.val.val ∈ N) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (ε : ℝ) (hε : 0 < ε) : + ∃ Q : CornerPartition p,(∀ i,(Q.piece i).val.val ∈ N) ∧ + (∑ i ∈ F,τ.norm₂ (Q.pinch (cornerCentered τ p (x i)))^2) < ε^2*(τ.trace p.val).re := by + apply exists_irreducible_corner_zero_trace_partition τ hNM hfactor hdiff hirr hsep + p hp hpN F (fun i => cornerCentered τ p (x i)) _ (ε^2) (sq_pos_of_pos hε) + intro i _ + rw [(cornerCentered_support τ p (x i)).1,(cornerCentered_support τ p (x i)).2, + cornerCentered_trace τ p hp] + +theorem exists_irreducible_corner_local_piece + (p : AlgebraProjection M) (hp : p.val ≠ 0) (hpN : p.val.val ∈ N) + {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) + (ε : ℝ) (hε : 0 < ε) : + ∃ q : AlgebraProjection M,q ≤ p ∧ q.val ≠ 0 ∧ q.val.val ∈ N ∧ + ∀ i ∈ F, + τ.norm₂ (q.val*x i*q.val-cornerScalar τ p (x i) • q.val) < ε*τ.norm₂ q.val ∧ + norm₁ τ (q.val*x i*q.val-cornerScalar τ p (x i) • q.val) < ε*(τ.trace q.val).re := by + obtain ⟨Q,hQ,hE⟩ := exists_irreducible_corner_centered_partition τ hNM hfactor hdiff hirr hsep + p hp hpN F x ε hε + obtain ⟨j,hj,hjE⟩ := Q.exists_indexed_local_L2_piece τ F (fun i => cornerCentered τ p (x i)) (ε^2) hE + refine ⟨Q.piece j,Q.piece_le j,hj,hQ j,fun i hi => ?_⟩ + have ht := hjE i hi + rw [projection_trace_sq τ _ (Q.piece j).property] at ht + have hn : τ.norm₂ ((Q.piece j).val*cornerCentered τ p (x i)*(Q.piece j).val) < + ε*τ.norm₂ (Q.piece j).val := by + nlinarith [show 0 ≤ τ.norm₂ ((Q.piece j).val*cornerCentered τ p (x i)*(Q.piece j).val) from norm_nonneg _, + mul_nonneg hε.le (show 0 ≤ τ.norm₂ (Q.piece j).val from norm_nonneg _)] + have h₁ := compression_norm₁_lt_of_norm₂ τ (Q.piece j) hj (cornerCentered τ p (x i)) ε hn + rw [compress_cornerCentered τ (Q.piece_le j)] at hn h₁ + exact ⟨hn,h₁⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/RepresentedFreeness.lean b/lean/OAI/Analysis/FactorGeneration/RepresentedFreeness.lean new file mode 100644 index 0000000000000000000000000000000000000000..811e4880d5f098ab8b78c87fa4e23a6e6faf5d08 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/RepresentedFreeness.lean @@ -0,0 +1,163 @@ +import OAI.Analysis.FactorGeneration.CoordinateUnitaries +import OAI.Analysis.FactorGeneration.LaurentAlgebra + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Full freeness in the faithful bounded-operator representation. The quotient +image is not asserted to be complete or weak-operator closed. -/ +section +attribute [local instance] quotientL2AddCommMonoid quotientL2AddCommGroup + quotientOperatorSemiring quotientOperatorNonAssocSemiring quotientOperatorAlgebra + quotientOperatorSemitopology +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +abbrev QuotientOperators := L2 τ ω →L[ℂ] L2 τ ω + +def quotientVectorState : QuotientOperators τ ω →L[ℂ] ℂ := + (innerSL ℂ (inclusion τ ω 1)).comp + (ContinuousLinearMap.apply ℂ (L2 τ ω) (inclusion τ ω 1)) + +@[simp] theorem quotientVectorState_representation (a : Q τ ω) : + quotientVectorState τ ω (quotientRepresentation τ ω a)=quotientTrace τ ω a := + quotientRepresentation_trace τ ω a + +@[simp] theorem quotientVectorState_one : quotientVectorState τ ω 1=1 := by + have h := quotientVectorState_representation τ ω 1 + rw [show quotientRepresentation τ ω 1=1 from (quotientRepresentation τ ω).map_one] at h + exact h.trans (quotientTrace_one τ ω) + +def representedUnitary (v : unitary (Q τ ω)) : unitary (QuotientOperators τ ω) := + Unitary.map (StarMonoidHom.ofClass (quotientRepresentation τ ω)) v + +@[simp] theorem representedUnitary_coe (v : unitary (Q τ ω)) : + (representedUnitary τ ω v : QuotientOperators τ ω)=quotientRepresentation τ ω (v : Q τ ω) := rfl + +theorem representedUnitary_power (v : unitary (Q τ ω)) (n : ℤ) : + (↑((representedUnitary τ ω v)^n) : QuotientOperators τ ω)= + quotientRepresentation τ ω (↑(v^n) : Q τ ω) := by + exact (congrArg (fun w : unitary (QuotientOperators τ ω) => (w : QuotientOperators τ ω)) + (map_zpow (Unitary.map (StarMonoidHom.ofClass (quotientRepresentation τ ω))) v n)).symm + +theorem represented_nonzero_powers (v : unitary (Q τ ω)) : + quotientRepresentation τ ω '' nonzeroUnitaryPowers v = + nonzeroUnitaryPowers (representedUnitary τ ω v) := by + ext x + constructor + · rintro ⟨q,⟨n,hn,rfl⟩,rfl⟩ + exact ⟨n,hn,(representedUnitary_power τ ω v n).symm⟩ + · rintro ⟨n,hn,rfl⟩ + exact ⟨↑(v^n),⟨n,hn,rfl⟩,(representedUnitary_power τ ω v n).symm⟩ + +theorem represented_centered_subalgebra (D : Subalgebra ℂ (Q τ ω)) : + quotientRepresentation τ ω '' {d | d ∈ D ∧ quotientTrace τ ω d=0} = + {d | d ∈ D.map (quotientRepresentation τ ω).toAlgHom ∧ quotientVectorState τ ω d=0} := by + ext x + constructor + · rintro ⟨q,⟨hq,hc⟩,rfl⟩ + exact ⟨⟨q,hq,rfl⟩,by simpa only [quotientVectorState_representation] using hc⟩ + · rintro ⟨⟨q,hq,rfl⟩,hc⟩ + change quotientVectorState τ ω (quotientRepresentation τ ω q)=0 at hc + exact ⟨q,⟨hq,by rwa [quotientVectorState_representation] at hc⟩,rfl⟩ + +/-- The exact endpoint formula proves freeness for the actual represented C*(v) +and the norm closure of the represented base algebra. -/ +theorem represented_haar_free (v : unitary (Q τ ω)) (D : Subalgebra ℂ (Q τ ω)) + (hhaar : ∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(v^n) : Q τ ω)=0) + (hpow : alternatingMomentsZero (quotientTrace τ ω) (nonzeroUnitaryPowers v) + {d | d ∈ D ∧ quotientTrace τ ω d=0}) : + freeSets (A := QuotientOperators τ ω) (quotientVectorState τ ω) + (StarAlgebra.elemental (A := QuotientOperators τ ω) ℂ (quotientRepresentation τ ω (v : Q τ ω))) + (D.map (quotientRepresentation τ ω).toAlgHom).topologicalClosure := by + have hmap := alternatingMomentsZero_map (quotientRepresentation τ ω).toMonoidHom + (quotientTrace τ ω) (quotientVectorState τ ω) (quotientVectorState_representation τ ω) + _ _ hpow + change alternatingMomentsZero (quotientVectorState τ ω) + (quotientRepresentation τ ω '' nonzeroUnitaryPowers v) + (quotientRepresentation τ ω '' {d | d ∈ D ∧ quotientTrace τ ω d=0}) at hmap + have hm := (congrArg₂ (alternatingMomentsZero (quotientVectorState τ ω)) + (represented_nonzero_powers τ ω v) (represented_centered_subalgebra τ ω D)).mp hmap + have hh := unitary_generated_free_of_power_moments (A := QuotientOperators τ ω) + (quotientVectorState τ ω) (quotientVectorState_one τ ω) (representedUnitary τ ω v) + (D.map (quotientRepresentation τ ω).toAlgHom) + (fun n hn => by rw [representedUnitary_power,quotientVectorState_representation]; exact hhaar n hn) hm + simpa only [representedUnitary_coe] using hh + +end + +/-! Named interfaces keep the operator topology explicit without repeatedly +elaborating its instance data inside large existential constructions. -/ +section +attribute [local instance] quotientL2AddCommMonoid quotientL2AddCommGroup + quotientOperatorSemiring quotientOperatorNonAssocSemiring quotientOperatorAlgebra + quotientOperatorSemitopology +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def representedFreeFrom (v : unitary (Q τ ω)) (D : Subalgebra ℂ (QuotientOperators τ ω)) : Prop := + freeSets (quotientVectorState τ ω) + (StarAlgebra.elemental ℂ (quotientRepresentation τ ω (v : Q τ ω))) D + +def representedClosedFree (v : unitary (Q τ ω)) (D : Subalgebra ℂ (Q τ ω)) : Prop := + representedFreeFrom τ ω v (D.map (quotientRepresentation τ ω).toAlgHom).topologicalClosure + +theorem represented_haar_free_interface (v : unitary (Q τ ω)) (D : Subalgebra ℂ (Q τ ω)) + (hhaar : ∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(v^n) : Q τ ω)=0) + (hpow : alternatingMomentsZero (quotientTrace τ ω) (nonzeroUnitaryPowers v) + {d | d ∈ D ∧ quotientTrace τ ω d=0}) : representedClosedFree τ ω v D := + represented_haar_free τ ω v D hhaar hpow + +end + +/-! A Haar unitary free from the represented base algebra, with a bounded +sequence of actual coordinate unitaries in the included algebra. -/ +attribute [local instance] quotientL2AddCommMonoid quotientL2AddCommGroup + quotientOperatorSemiring quotientOperatorNonAssocSemiring quotientOperatorAlgebra + quotientOperatorSemitopology +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_coordinate_haar_free (hω : (ω : Filter ℕ) ≤ atTop) + (D : Subalgebra ℂ (Q τ ω)) (hD : TopologicalSpace.IsSeparable (D : Set (Q τ ω))) : + ∃ t : unitary (Q τ ω), + (∃ b : Bounded N,(∀ j,b.val j ∈ unitary N.toStarSubalgebra) ∧ + quotientInclusion τ hNM (ω : Filter ℕ) + (quotientMap (restrictedTrace τ hNM) (ω : Filter ℕ) b)=(t : Q τ ω)) ∧ + (∀ n : ℤ,n ≠ 0 → quotientTrace τ ω (↑(t^n) : Q τ ω)=0) ∧ + representedClosedFree τ ω t D := by + obtain ⟨t,ht,hhaar,hep⟩ := exists_coordinate_haar_endpoints + (H := H) (N := N) (M := M) τ ω hNM hfactor hdiff hirr hsep hω D hD + have hpow : alternatingMomentsZero (quotientTrace τ ω) (nonzeroPowerSet τ ω t) + {d | d ∈ D ∧ quotientTrace τ ω d=0} := by + apply endpoint_all_alternating τ ω _ D + intro c hc d hd q hq xs hxs + apply endpoint_moments_laurent_closure τ ω D t hep c d q hc hd + (Submodule.le_topologicalClosure _ (Submodule.subset_span hq)) xs + intro z hz + exact ⟨(hxs z hz).1,(hxs z hz).2.1, + Submodule.le_topologicalClosure _ (Submodule.subset_span (hxs z hz).2.2)⟩ + exact ⟨t,ht,hhaar,represented_haar_free_interface τ ω t D hhaar hpow⟩ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ResidualCompletion.lean b/lean/OAI/Analysis/FactorGeneration/ResidualCompletion.lean new file mode 100644 index 0000000000000000000000000000000000000000..cc8f942de4ec7144f753cab698c13c81e7e2bf5f --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ResidualCompletion.lean @@ -0,0 +1,632 @@ +import OAI.Analysis.FactorGeneration.CornerIndependence +import OAI.Analysis.FactorGeneration.QuotientCorners +import OAI.Analysis.FactorGeneration.QuotientRepresentation +import OAI.Analysis.FactorGeneration.ResidualMoments + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Actual residual projections, null-set masking, and coordinatewise +orthogonal partial-unitary patching. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def boundedPartialResidual (v : ℕ → PartialUnitary M) : Bounded M := + 1-boundedPartialSupport v + +theorem boundedPartialResidual_projection (v : ℕ → PartialUnitary M) (j : ℕ) : + IsStarProjection ((boundedPartialResidual v).val j) := (v j).support.property.one_sub + +theorem boundedPartialResidual_mem (v : ℕ → PartialUnitary M) + (hv : ∀ j,(v j).val.val ∈ N) (j : ℕ) : + ((boundedPartialResidual v).val j).val ∈ N := by + have hs : (v j).support.val.val ∈ N := by + rw [← (v j).unitary.initial] + have hstar : star ((v j).val.val) ∈ N.toStarSubalgebra := + star_mem (show (v j).val.val ∈ N.toStarSubalgebra from hv j) + exact N.mul_mem hstar (hv j) + exact N.sub_mem N.one_mem hs + +def maskPartialSequence (S : Set ℕ) (v : ℕ → PartialUnitary M) : ℕ → PartialUnitary M := + fun j => @ite (PartialUnitary M) (j ∈ S) (Classical.propDecidable _) (v j) zeroPartialUnitary + +theorem maskPartialSequence_quotient (τ : TracialRepresentation M) (l : Filter ℕ) + (S : Set ℕ) (hS : S ∈ l) (v : ℕ → PartialUnitary M) : + quotientMap τ l (boundedPartialUnitary (maskPartialSequence S v))= + quotientMap τ l (boundedPartialUnitary v) ∧ + quotientMap τ l (boundedPartialSupport (maskPartialSequence S v))= + quotientMap τ l (boundedPartialSupport v) := by + constructor + · apply quotientMap_eq_of_eventuallyEq τ + filter_upwards [hS] with j hj + change (maskPartialSequence S v j).val=(v j).val + simp only [maskPartialSequence,ite_eq_left hj] + · apply quotientMap_eq_of_eventuallyEq τ + filter_upwards [hS] with j hj + change (maskPartialSequence S v j).support.val=(v j).support.val + simp only [maskPartialSequence,ite_eq_left hj] + +theorem maskPartialSequence_mem (S : Set ℕ) (v : ℕ → PartialUnitary M) + (hv : ∀ j,(v j).val.val ∈ N) : ∀ j,(maskPartialSequence S v j).val.val ∈ N := by + intro j + by_cases hj : j ∈ S + · simpa only [maskPartialSequence,ite_eq_left hj] using hv j + · simp only [maskPartialSequence,ite_eq_right hj] + exact N.zero_mem + +theorem maskPartialSequence_orthogonal (S : Set ℕ) (v w : ℕ → PartialUnitary M) + (hw : ∀ j ∈ S,(w j).support ≤ unitResidual (v j)) : + ∀ j,(v j).support.val*(maskPartialSequence S w j).support.val=0 := by + intro j + by_cases hj : j ∈ S + · simp only [maskPartialSequence,ite_eq_left hj] + have hh := hw j hj + change (1-(v j).support.val)*(w j).support.val=(w j).support.val at hh + rw [sub_mul,one_mul] at hh + exact sub_eq_self.mp hh + · simp [maskPartialSequence,hj,zeroPartialUnitary] + +def patchPartialSequence (v w : ℕ → PartialUnitary M) + (h : ∀ j,(v j).support.val*(w j).support.val=0) : ℕ → PartialUnitary M := + fun j => ⟨⟨(v j).support.val+(w j).support.val, + (v j).support.property.add (w j).support.property (h j)⟩, + (v j).unitary.patch (w j).unitary (h j)⟩ + +theorem patchPartialSequence_bounded (v w : ℕ → PartialUnitary M) + (h : ∀ j,(v j).support.val*(w j).support.val=0) : + boundedPartialUnitary (patchPartialSequence v w h)=boundedPartialUnitary v+boundedPartialUnitary w ∧ + boundedPartialSupport (patchPartialSequence v w h)=boundedPartialSupport v+boundedPartialSupport w := + ⟨rfl,rfl⟩ + +theorem patchPartialSequence_mem (v w : ℕ → PartialUnitary M) + (h : ∀ j,(v j).support.val*(w j).support.val=0) + (hv : ∀ j,(v j).val.val ∈ N) (hw : ∀ j,(w j).val.val ∈ N) : + ∀ j,(patchPartialSequence v w h j).val.val ∈ N := + fun j => N.add_mem (hv j) (hw j) + +end + +/-! An actual positive residual support increment with exact ordered moments +for arbitrary countably many centered compressed quotient coefficients. -/ +open Filter +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +private theorem exists_supported_centered_contraction_family + (g : Bounded M) (b : ℕ → Bounded M) + (hl : ∀ i, g*b i=b i) (hr : ∀ i, b i*g=b i) + (hc : ∀ i j, τ.trace ((b i).val j)=0) : + ∃ (c : ℕ → ℂ) (a : ℕ → Bounded M), + (∀ i, c i ≠ 0) ∧ (∀ i, g*a i=a i) ∧ (∀ i, a i*g=a i) ∧ + (∀ i j, ‖(a i).val j‖ ≤ 1) ∧ (∀ i j, τ.trace ((a i).val j)=0) ∧ + ∀ i, b i=c i • a i := by + choose c hcne a hal har han hac hae using fun i => + exists_supported_centered_contraction (H := H) (M := M) τ g (b i) (hl i) (hr i) (hc i) + exact ⟨c, a, hcne, hal, har, han, hac, hae⟩ + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +private theorem residual_quotient_increment_of_normalized_representatives + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (x : ℕ → Q τ ω) + (g : Bounded M) (hg : ∀ j,IsStarProjection (g.val j)) + (hgN : ∀ j,(g.val j).val ∈ N) (hg0 : ∀ j,g.val j ≠ 0) + (hgf : g.val =ᶠ[(ω : Filter ℕ)] (boundedPartialResidual v).val) + (c : ℕ → ℂ) (a : ℕ → Bounded M) + (han : ∀ i j, ‖(a i).val j‖ ≤ 1) (hac : ∀ i j,τ.trace ((a i).val j)=0) + (hal : ∀ i,g*a i=a i) (har : ∀ i,a i*g=a i) + (hscale : ∀ i,quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)= + c i • quotientMap τ (ω : Filter ℕ) (a i)) : + ∃ w : ℕ → PartialUnitary M, + (∀ j,(w j).val.val ∈ N) ∧ + (∀ j,(v j).support.val*(w j).support.val=0) ∧ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re/4 ≤ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w))).re ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω ( + optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) first * + algebraPatchingWord (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) + (xs.map (fun a => (a.1,quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x a.2* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))) ++ + [(s,optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) last)]))=0 := by + classical + let f := boundedPartialResidual v + obtain ⟨w,hwN,hws,hwt,hwm⟩ := exists_quotient_corner_partial_sequence (H := H) (N := N) (M := M) τ hNM hfactor hdiff hirr hsep + ω hω g hg hgN hg0 a han hac hal har + let S : Set ℕ := {j | g.val j=f.val j} + have hS : S ∈ (ω : Filter ℕ) := hgf + have he := maskPartialSequence_quotient τ (ω : Filter ℕ) S hS w + have heg := quotientMap_eq_of_eventuallyEq τ (ω : Filter ℕ) g f hgf + refine ⟨maskPartialSequence S w,maskPartialSequence_mem S w hwN,?_,?_,?_⟩ + · apply maskPartialSequence_orthogonal S v w + intro j hj + change f.val j*(w j).support.val=(w j).support.val + exact (congrArg (fun q => q*(w j).support.val) hj.symm).trans (hws j) + · exact (congrArg₂ (fun q r => (quotientTrace τ ω q).re/4 ≤ + (quotientTrace τ ω r).re) heg he.2.symm).mp hwt + · intro first last xs s + let F : Q τ ω → ℂ := fun u => quotientTrace τ ω ( + optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) f*x i* + quotientMap τ (ω : Filter ℕ) f) first * + algebraPatchingWord u (xs.map (fun a => (a.1,quotientMap τ (ω : Filter ℕ) f*x a.2* + quotientMap τ (ω : Filter ℕ) f)) ++ [(s,optionalCoefficient + (fun i => quotientMap τ (ω : Filter ℕ) f*x i*quotientMap τ (ω : Filter ℕ) f) last)])) + refine (congrArg F he.1).trans ?_ + exact (congrArg (quotientTrace τ ω) + (ordered_moment_scale _ _ _ c hscale first last xs s)).trans + ((trace_smul τ ω _ _).trans + ((congrArg (fun z => _ * z) (hwm first last xs s)).trans (mul_zero _))) + +private theorem residual_quotient_increment_of_representatives + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) + (x : ℕ → Q τ ω) (δ : ℝ) (hδ : 0 < δ) (g : Bounded M) + (hg : ∀ j,IsStarProjection (g.val j)) (hgl : ∀ j,δ ≤ (τ.trace (g.val j)).re) + (hgf : g.val =ᶠ[(ω : Filter ℕ)] (boundedPartialResidual v).val) + (hgor : ∀ j,g.val j=(boundedPartialResidual v).val j ∨ g.val j=1) + (b : ℕ → Bounded M) (hb : ∀ i, + g*b i=b i ∧ b i*g=b i ∧ (∀ j,τ.trace ((b i).val j)=0) ∧ + quotientMap τ (ω : Filter ℕ) (b i)= + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) : + ∃ w : ℕ → PartialUnitary M, + (∀ j,(w j).val.val ∈ N) ∧ + (∀ j,(v j).support.val*(w j).support.val=0) ∧ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re/4 ≤ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w))).re ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω ( + optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) first * + algebraPatchingWord (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) + (xs.map (fun a => (a.1,quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x a.2* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))) ++ + [(s,optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) last)]))=0 := by + classical + let f := boundedPartialResidual v + have hgN : ∀ j,(g.val j).val ∈ N := by + intro j + rcases hgor j with h | h + · rw [h]; exact boundedPartialResidual_mem v hv j + · rw [h]; exact N.one_mem + have hg0 : ∀ j,g.val j ≠ 0 := by + intro j hz + have hh := hgl j + have hztrace : τ.trace (0 : M.toStarSubalgebra)=0 := inner_zero_right _ + rw [hz,hztrace,Complex.zero_re] at hh + exact (not_le_of_gt hδ) hh + obtain ⟨c,a,hcne,hal,har,han,hac,hae⟩ := + exists_supported_centered_contraction_family (H := H) (M := M) τ g b + (fun i => (hb i).1) (fun i => (hb i).2.1) (fun i => (hb i).2.2.1) + have hscale (i : ℕ) : quotientMap τ (ω : Filter ℕ) f*x i*quotientMap τ (ω : Filter ℕ) f= + c i • quotientMap τ (ω : Filter ℕ) (a i) := by + exact (hb i).2.2.2.symm.trans + ((congrArg (quotientMap τ (ω : Filter ℕ)) (hae i)).trans + (quotientMap_smul τ (ω : Filter ℕ) (c i) (a i))) + exact residual_quotient_increment_of_normalized_representatives (H := H) (N := N) (M := M) + τ hNM hfactor hdiff hirr hsep ω hω v x g hg hgN hg0 hgf c a han hac hal har hscale + +theorem exists_residual_quotient_increment + (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) + (ht : 0 < (quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re) + (x : ℕ → Q τ ω) + (hc : ∀ i,quotientTrace τ ω ( + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))=0) : + ∃ w : ℕ → PartialUnitary M, + (∀ j,(w j).val.val ∈ N) ∧ + (∀ j,(v j).support.val*(w j).support.val=0) ∧ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re/4 ≤ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w))).re ∧ + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω ( + optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) first * + algebraPatchingWord (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) + (xs.map (fun a => (a.1,quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x a.2* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))) ++ + [(s,optionalCoefficient (fun i => quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)*x i* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) last)]))=0 := by + let f := boundedPartialResidual v + obtain ⟨δ,hδ,g,hg,hgl,hgf,hgor,b,hb⟩ := + exists_eventually_centered_corner_representatives (H := H) (M := M) τ ω f + (boundedPartialResidual_projection v) ht x hc + exact residual_quotient_increment_of_representatives (H := H) (N := N) (M := M) + τ hNM hfactor hdiff hirr hsep ω hω v hv x δ hδ g hg hgl hgf hgor b hb + +end + +/-! Faithful-trace completion criterion and the exact quarter-increment +residual estimate for actual orthogonal coordinate patches. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem quotient_projection_eq_zero_of_trace_re (p : Q τ ω) (hp : IsStarProjection p) + (ht : (quotientTrace τ ω p).re=0) : p=0 := by + have h : ‖p‖^2=0 := by + rw [norm_sq_eq_re_inner (𝕜 := ℂ),inner_eq_trace,hp.isSelfAdjoint.star_eq,hp.isIdempotentElem.eq] + exact ht + exact norm_eq_zero.mp (sq_eq_zero_iff.mp h) + +theorem quotient_unitary_of_zero_residual (v : ℕ → PartialUnitary M) + (ht : (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re=0) : + star (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v))* + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)=1 ∧ + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)* + star (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v))=1 := by + have hp := ((boundedPartialSupport_projection v).one_sub).map (quotientStarAlgHom τ (ω : Filter ℕ)) + have hz := quotient_projection_eq_zero_of_trace_re τ ω _ hp ht + change quotientMap τ (ω : Filter ℕ) (1-boundedPartialSupport v)=0 at hz + rw [map_sub,map_one,sub_eq_zero] at hz + constructor + · rw [← quotientMap_star,← map_mul,boundedPartialUnitary_initial] + exact hz.symm + · rw [← quotientMap_star,← map_mul,boundedPartialUnitary_final] + exact hz.symm + +theorem quotient_patch_residual_bound (v w : ℕ → PartialUnitary M) + (h : ∀ j,(v j).support.val*(w j).support.val=0) + (ht : (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re/4 ≤ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w))).re) : + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) + (boundedPartialResidual (patchPartialSequence v w h)))).re ≤ + (3/4 : ℝ)*(quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re := by + have he : boundedPartialResidual (patchPartialSequence v w h)= + boundedPartialResidual v-boundedPartialSupport w := by + unfold boundedPartialResidual + rw [(patchPartialSequence_bounded v w h).2] + abel + have hsub : quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v) - + quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w)) = + quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) - + quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w)) := + (traceLinear τ ω).map_sub + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) + (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w)) + rw [he,map_sub,hsub,Complex.sub_re] + linarith + +end + +/-! Actual moment-preserving residual extensions, retaining coordinate partial +unitaries in N and the quantitative decrease of residual support. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem bounded_orthogonal_patch_supported (v w : ℕ → PartialUnitary M) + (h : ∀ j,(v j).support.val*(w j).support.val=0) : + boundedPartialResidual v*boundedPartialUnitary w=boundedPartialUnitary w ∧ + boundedPartialUnitary w*boundedPartialResidual v=boundedPartialUnitary w := by + have hl (j : ℕ) : (v j).support.val*(w j).val=0 := by + calc (v j).support.val*(w j).val = + (v j).support.val*((w j).support.val*(w j).val) := by rw [(w j).unitary.support_mul] + _ = 0 := by rw [← mul_assoc,h j,zero_mul] + have hr (j : ℕ) : (w j).val*(v j).support.val=0 := by + have hqp : (w j).support.val*(v j).support.val=0 := by + simpa only [star_mul,(v j).support.property.isSelfAdjoint.star_eq, + (w j).support.property.isSelfAdjoint.star_eq,star_zero] using congrArg star (h j) + calc (w j).val*(v j).support.val = + ((w j).val*(w j).support.val)*(v j).support.val := by rw [(w j).unitary.mul_support] + _ = 0 := by rw [mul_assoc,hqp,mul_zero] + constructor + · apply Subtype.ext + funext j + change (1-(v j).support.val)*(w j).val=(w j).val + rw [sub_mul,one_mul,hl j,sub_zero] + · apply Subtype.ext + funext j + change (w j).val*(1-(v j).support.val)=(w j).val + rw [mul_sub,mul_one,hr j,sub_zero] + +theorem quotient_orthogonal_patch_supported (ω : Ultrafilter ℕ) + (v w : ℕ → PartialUnitary M) (h : ∀ j,(v j).support.val*(w j).support.val=0) : + ∀ s,quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)* + algebraSignedLetter (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) s= + algebraSignedLetter (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) s ∧ + algebraSignedLetter (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) s* + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)= + algebraSignedLetter (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) s := by + have hleft := congrArg (quotientMap τ (ω : Filter ℕ)) (bounded_orthogonal_patch_supported v w h).1 + have hright := congrArg (quotientMap τ (ω : Filter ℕ)) (bounded_orthogonal_patch_supported v w h).2 + rw [map_mul] at hleft hright + have hf : star (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))= + quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v) := + (((boundedPartialSupport_projection v).one_sub).map + (quotientStarAlgHom τ (ω : Filter ℕ))).isSelfAdjoint.star_eq + intro s + cases s with + | false => exact ⟨hleft,hright⟩ + | true => + constructor + · simpa only [star_mul,hf,algebraSignedLetter,↓reduceIte] using congrArg star hright + · simpa only [star_mul,hf,algebraSignedLetter,↓reduceIte] using congrArg star hleft + +theorem patchPartialSequence_extends (v w : ℕ → PartialUnitary M) + (h : ∀ j,(v j).support.val*(w j).support.val=0) : + ∀ j,v j ≤ patchPartialSequence v w h j := by + intro j + change ((v j).unitary.patch (w j).unitary (h j)).val*(v j).support.val=(v j).val + simpa only [(v j).unitary.initial] using + (v j).unitary.patch_extends (w j).unitary (h j) + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +private theorem exact_residual_patch_of_centered_family (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) + (ht : 0 < (quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re) + (x : ℕ → Q τ ω) + (hm : ExactOrderedMoments τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) x) + (hz : ∀ i, let f := quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v) + let V := quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v) + quotientTrace τ ω (f*cyclicResidualFamily τ ω f (residualWordFamily τ ω V x) i*f)=0) : + ∃ u : ℕ → PartialUnitary M, + (∀ j,(u j).val.val ∈ N) ∧ (∀ j,v j ≤ u j) ∧ + ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)) x ∧ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual u))).re ≤ + (3/4 : ℝ)*(quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re := by + let V := quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v) + let f := quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v) + have hf : f*f=f := + (((boundedPartialSupport_projection v).one_sub).map + (quotientStarAlgHom τ (ω : Filter ℕ))).isIdempotentElem.eq + let y := residualWordFamily τ ω V x + let z := cyclicResidualFamily τ ω f y + obtain ⟨w,hwN,hortho,htrace,hmw⟩ := exists_residual_quotient_increment (H := H) (N := N) (M := M) τ hNM hfactor hdiff hirr hsep + ω hω v hv ht z hz + have hzs : (fun i => f*z i*f)=z := funext (cyclicResidualFamily_supported τ ω f hf y) + have hwexact : ExactOrderedMoments τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)) z := by + change ExactOrderedMoments τ ω _ (fun i => f*z i*f) at hmw + rw [hzs] at hmw + exact hmw + refine ⟨patchPartialSequence v w hortho,patchPartialSequence_mem v w hortho hv hwN, + patchPartialSequence_extends v w hortho,?_,quotient_patch_residual_bound τ ω v w hortho htrace⟩ + have he := (congrArg (quotientMap τ (ω : Filter ℕ)) + (patchPartialSequence_bounded v w hortho).1).trans + (map_add (quotientMap τ (ω : Filter ℕ)) _ _) + exact (congrArg (fun u => ExactOrderedMoments τ ω u x) he).mpr + (exactOrderedMoments_add_of_cyclic τ ω V _ f x hm + (quotient_orthogonal_patch_supported τ ω v w hortho) hwexact) + +theorem exists_exact_residual_patch (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) + (ht : 0 < (quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) + (hm : ExactOrderedMoments τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) x) : + ∃ u : ℕ → PartialUnitary M, + (∀ j,(u j).val.val ∈ N) ∧ (∀ j,v j ≤ u j) ∧ + ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)) x ∧ + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual u))).re ≤ + (3/4 : ℝ)*(quotientTrace τ ω + (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re := by + let V := quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v) + let P := quotientMap τ (ω : Filter ℕ) (boundedPartialSupport v) + let f := quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v) + have hp : IsStarProjection P := (boundedPartialSupport_projection v).map + (quotientStarAlgHom τ (ω : Filter ℕ)) + have hfp : f=1-P := by simp only [f,P,boundedPartialResidual,map_sub,map_one] + have hf : f*f=f := by rw [hfp]; exact hp.one_sub.isIdempotentElem.eq + have hi : star V*V=P := by + dsimp only [V,P] + rw [← quotientMap_star,← map_mul,boundedPartialUnitary_initial] + have hfinal : V*star V=P := by + dsimp only [V,P] + rw [← quotientMap_star,← map_mul,boundedPartialUnitary_final] + let y := residualWordFamily τ ω V x + let z := cyclicResidualFamily τ ω f y + have hy : ∀ i,quotientTrace τ ω (f*y i*f)=0 := by + rw [hfp] + exact residualWordFamily_compression_centered τ ω V P hp hi hfinal x hx hm + have hnonzero : quotientTrace τ ω f ≠ 0 := by + intro hz + have hh : 0 < (quotientTrace τ ω f).re := ht + rw [hz,Complex.zero_re] at hh + exact lt_irrefl _ hh + have hz : ∀ i,quotientTrace τ ω (f*z i*f)=0 := + cyclicResidualFamily_centered τ ω f hf hnonzero y hy + exact exact_residual_patch_of_centered_family (H := H) (N := N) (M := M) + τ hNM hfactor hdiff hirr hsep ω hω v hv ht x hm hz + +end + +/-! Iteration of actual moment-preserving partial-unitary extensions. Every +stage retains its coordinate representatives and a geometric residual bound. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def quotientResidualTrace (ω : Ultrafilter ℕ) (v : ℕ → PartialUnitary M) : ℝ := + (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v))).re + +theorem quotientResidualTrace_nonneg (ω : Ultrafilter ℕ) (v : ℕ → PartialUnitary M) : + 0 ≤ quotientResidualTrace τ ω v := by + have hp := ((boundedPartialSupport_projection v).one_sub).map + (quotientStarAlgHom τ (ω : Filter ℕ)) + change IsStarProjection (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) at hp + have hh := trace_square_nonneg τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialResidual v)) + rwa [hp.isSelfAdjoint.star_eq,hp.isIdempotentElem.eq] at hh + +variable (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ r : N.toStarSubalgebra,IsStarProjection r → r ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ r ∧ r*q=q ∧ q*r=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +variable (hsep : TopologicalSpace.IsSeparable (Set.range (baseVector τ))) +include hfactor hdiff hirr hsep + +theorem exists_exact_residual_step (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) + (hm : ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) x) : + ∃ u : ℕ → PartialUnitary M, + (∀ j,(u j).val.val ∈ N) ∧ (∀ j,v j ≤ u j) ∧ + ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)) x ∧ + quotientResidualTrace τ ω u ≤ (3/4 : ℝ)*quotientResidualTrace τ ω v := by + by_cases ht : 0 < quotientResidualTrace τ ω v + · exact exists_exact_residual_patch (H := H) (N := N) (M := M) τ hNM hfactor hdiff hirr hsep ω hω v hv ht x hx hm + · have hz := le_antisymm (not_lt.mp ht) (quotientResidualTrace_nonneg τ ω v) + exact ⟨v,hv,fun _ => le_rfl,hm,by rw [hz,mul_zero]⟩ + +theorem exists_exact_residual_iteration (ω : Ultrafilter ℕ) (hω : (ω : Filter ℕ) ≤ atTop) + (v : ℕ → PartialUnitary M) (hv : ∀ j,(v j).val.val ∈ N) + (x : ℕ → Q τ ω) (hx : ∀ i,quotientTrace τ ω (x i)=0) + (hm : ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)) x) : + ∃ a : ℕ → ℕ → PartialUnitary M,a 0=v ∧ + (∀ n j,(a n j).val.val ∈ N) ∧ (∀ j,Monotone (fun n => a n j)) ∧ + (∀ n,ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) x) ∧ + ∀ n,quotientResidualTrace τ ω (a n) ≤ (3/4 : ℝ)^n*quotientResidualTrace τ ω v := by + let S := {u : ℕ → PartialUnitary M // (∀ j,(u j).val.val ∈ N) ∧ + ExactOrderedMoments τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)) x} + have next (u : S) : ∃ w : S,(∀ j,u.val j ≤ w.val j) ∧ + quotientResidualTrace τ ω w.val ≤ (3/4 : ℝ)*quotientResidualTrace τ ω u.val := by + obtain ⟨w,hw,hle,hmw,hr⟩ := exists_exact_residual_step (H := H) (N := N) (M := M) τ hNM hfactor hdiff hirr hsep + ω hω u.val u.property.1 x hx u.property.2 + exact ⟨⟨w,hw,hmw⟩,hle,hr⟩ + let step : S → S := fun u => (next u).choose + have hs (u : S) := (next u).choose_spec + let a : ℕ → S := fun n => Nat.rec (⟨v,hv,hm⟩ : S) (fun _ u => step u) n + refine ⟨fun n => (a n).val,rfl,fun n => (a n).property.1,?_,fun n => (a n).property.2,?_⟩ + · intro j + apply monotone_nat_of_le_succ + intro n + exact (hs (a n)).1 j + · intro n + induction n with + | zero => simp only [pow_zero,one_mul]; exact le_rfl + | succ n ih => + calc quotientResidualTrace τ ω (a (n+1)).val ≤ + (3/4 : ℝ)*quotientResidualTrace τ ω (a n).val := (hs (a n)).2 + _ ≤ (3/4 : ℝ)*((3/4 : ℝ)^n*quotientResidualTrace τ ω v) := + mul_le_mul_of_nonneg_left ih (by norm_num) + _ = _ := by rw [pow_succ]; ring + +end + +/-! Coordinatewise monotone upper bounds and quantitative convergence in the +actual quotient two-norm. No completeness of the quotient is assumed. -/ +open UltrapowerBridge Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem quotient_trace_sub' (a b : Q τ ω) : + quotientTrace τ ω (a-b)=quotientTrace τ ω a-quotientTrace τ ω b := + (traceLinear τ ω).map_sub a b + +theorem quotientResidualTrace_eq (v : ℕ → PartialUnitary M) : + quotientResidualTrace τ ω v = + 1-(quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport v))).re := by + simp only [quotientResidualTrace,boundedPartialResidual,map_sub,map_one, + quotient_trace_sub',quotientTrace_one,Complex.sub_re,Complex.one_re] + +theorem quotient_partial_distance_sq (v w : ℕ → PartialUnitary M) (h : ∀ j,v j ≤ w j) : + ‖quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)- + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)‖^2= + quotientResidualTrace τ ω v-quotientResidualTrace τ ω w := by + have he : star (boundedPartialUnitary w-boundedPartialUnitary v)* + (boundedPartialUnitary w-boundedPartialUnitary v)=boundedPartialSupport w-boundedPartialSupport v := by + apply Subtype.ext + funext j + exact PartialUnitary.difference_square (h j) + rw [norm_sq_eq_re_inner (𝕜 := ℂ),inner_eq_trace,← map_sub,← quotientMap_star,← map_mul,he, + map_sub,quotient_trace_sub'] + change (quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport w))- + quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) (boundedPartialSupport v))).re = _ + rw [Complex.sub_re,quotientResidualTrace_eq,quotientResidualTrace_eq] + ring + +theorem quotientResidualTrace_antitone (v w : ℕ → PartialUnitary M) (h : ∀ j,v j ≤ w j) : + quotientResidualTrace τ ω w ≤ quotientResidualTrace τ ω v := by + have he := quotient_partial_distance_sq τ ω v w h + nlinarith [sq_nonneg ‖quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary w)- + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary v)‖] + +include τ in +theorem exists_coordinate_monotone_upper (hNM : N ≤ M) + (a : ℕ → ℕ → PartialUnitary M) (ha : ∀ j,Monotone (fun n => a n j)) + (hN : ∀ n j,(a n j).val.val ∈ N) : + ∃ u : ℕ → PartialUnitary M,(∀ j,(u j).val.val ∈ N) ∧ ∀ n j,a n j ≤ u j := by + choose u hu hlim using fun j => PartialUnitary.monotone_limit τ (fun n => a n j) (ha j) + refine ⟨u,fun j => ?_,fun n j => hu j n⟩ + exact inclusion_mem_of_bounded_L2_limit τ hNM (fun n => (a n j).val) (u j).val + 1 zero_le_one (fun n => (a n j).unitary.norm_le_one) (fun n => hN n j) (hlim j) + +theorem quotient_geometric_upper_completion + (a : ℕ → ℕ → PartialUnitary M) (u : ℕ → PartialUnitary M) + (hu : ∀ n j,a n j ≤ u j) (r : ℝ) + (hr : ∀ n,quotientResidualTrace τ ω (a n) ≤ (3/4 : ℝ)^n*r) : + quotientResidualTrace τ ω u=0 ∧ + Tendsto (fun n => quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))) atTop + (𝓝 (quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u))) := by + have ht : Tendsto (fun n : ℕ => (3/4 : ℝ)^n*r) atTop (𝓝 0) := by + simpa only [zero_mul] using + (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0 : ℝ) ≤ 3/4) (by norm_num : (3/4 : ℝ) < 1)).mul_const r + have hz : quotientResidualTrace τ ω u=0 := by + apply le_antisymm _ (quotientResidualTrace_nonneg τ ω u) + apply ge_of_tendsto ht + exact Eventually.of_forall (fun n => + (quotientResidualTrace_antitone τ ω (a n) u (hu n)).trans (hr n)) + refine ⟨hz,?_⟩ + have hs : Tendsto (fun n => ‖quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)- + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))‖^2) atTop (𝓝 0) := by + apply squeeze_zero (fun n => sq_nonneg _) _ ht + intro n + rw [quotient_partial_distance_sq τ ω (a n) u (hu n),hz,sub_zero] + exact hr n + apply tendsto_iff_norm_sub_tendsto_zero.mpr + have hn : Tendsto (fun n => ‖quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary u)- + quotientMap τ (ω : Filter ℕ) (boundedPartialUnitary (a n))‖) atTop (𝓝 0) := by + simpa only [Real.sqrt_sq_eq_abs,abs_norm,Real.sqrt_zero] using hs.sqrt + exact hn.congr (fun n => norm_sub_rev _ _) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ResidualEstimates.lean b/lean/OAI/Analysis/FactorGeneration/ResidualEstimates.lean new file mode 100644 index 0000000000000000000000000000000000000000..be55c687197bad562c7a58f6cd97481f17b8280c --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ResidualEstimates.lean @@ -0,0 +1,146 @@ +import OAI.Analysis.FactorGeneration.PartialUnitaries + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Correct residual-corner trace identity for arbitrary f. The first term +is trace(f*x), not trace(x); they agree when f=1. This is the distinction +at Popa 1308.3982v3 Lemma 3.2, equation (5). -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def residualCorner (f : AlgebraProjection M) (v : PartialUnitary M) (hv : v.support ≤ f) : + AlgebraProjection M := + ⟨f.val-v.support.val,v.support.property.sub_of_mul_eq_right f.property hv⟩ + +theorem projection_compression_trace (p : AlgebraProjection M) (x : M.toStarSubalgebra) : + τ.trace (p.val*x*p.val) = τ.trace (x*p.val) := by + rw [τ.trace_mul_comm,← mul_assoc,p.property.isIdempotentElem.eq,τ.trace_mul_comm] + +theorem residualCorner_trace (f : AlgebraProjection M) (v : PartialUnitary M) + (hv : v.support ≤ f) : + τ.trace (residualCorner f v hv).val = τ.trace f.val-τ.trace v.support.val := + trace_sub τ _ _ + +theorem residualCorner_compression_trace (f : AlgebraProjection M) (v : PartialUnitary M) + (hv : v.support ≤ f) (x : M.toStarSubalgebra) : + τ.trace ((residualCorner f v hv).val*x*(residualCorner f v hv).val) = + τ.trace (f.val*x)-τ.trace (star v.val*x*v.val) := by + rw [projection_compression_trace] + change τ.trace (x*(f.val-v.support.val)) = _ + rw [mul_sub,trace_sub,τ.trace_mul_comm x f.val] + congr 1 + calc τ.trace (x*v.support.val) = τ.trace ((x*v.val)*star v.val) := by + rw [mul_assoc,v.unitary.final] + _ = τ.trace (star v.val*x*v.val) := by + rw [τ.trace_mul_comm] + simp only [mul_assoc] + +theorem residualCorner_positive (f : AlgebraProjection M) (hf : f.val ≠ 0) + (v : PartialUnitary M) (hv : v.support ≤ f) + (hsmall : (τ.trace v.support.val).re ≤ (τ.trace f.val).re/4) : + 0 < (τ.trace (residualCorner f v hv).val).re := by + rw [residualCorner_trace,Complex.sub_re] + have h := projection_trace_pos τ f.val f.property hf + linarith + +theorem residualCorner_support_ratio (f : AlgebraProjection M) (hf : f.val ≠ 0) + (v : PartialUnitary M) (hv : v.support ≤ f) + (hsmall : (τ.trace v.support.val).re ≤ (τ.trace f.val).re/4) : + (τ.trace v.support.val).re / (τ.trace (residualCorner f v hv).val).re ≤ (1/3 : ℝ) := by + rw [div_le_iff₀ (residualCorner_positive τ f hf v hv hsmall)] + rw [residualCorner_trace,Complex.sub_re] + linarith + +/-- This keeps the f-dependent scalar term that cannot be bounded from +global centering alone. -/ +theorem residualCorner_scalar_bound (f : AlgebraProjection M) (hf : f.val ≠ 0) + (v : PartialUnitary M) (hv : v.support ≤ f) + (hsmall : (τ.trace v.support.val).re ≤ (τ.trace f.val).re/4) + (x : M.toStarSubalgebra) : + ‖cornerScalar τ (residualCorner f v hv) x‖ ≤ + (‖τ.trace (f.val*x)‖+‖τ.trace (star v.val*x*v.val)‖) / + (τ.trace (residualCorner f v hv).val).re := by + rw [cornerScalar,residualCorner_compression_trace,norm_div, + projection_trace_real τ (residualCorner f v hv),Complex.norm_real, + Real.norm_of_nonneg (residualCorner_positive τ f hf v hv hsmall).le] + exact div_le_div_of_nonneg_right (norm_sub_le _ _) (residualCorner_positive τ f hf v hv hsmall).le + +end + +/-! The justified f=1 scalar estimate in the support-growth argument. +Every estimate is tied to the current partial unitary's actual residual; +there is no arbitrary-corner centering assertion. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def unitResidual (v : PartialUnitary M) : AlgebraProjection M := + ⟨1-v.support.val,v.support.property.one_sub⟩ + +theorem unitResidual_trace (v : PartialUnitary M) : + τ.trace (unitResidual v).val=1-τ.trace v.support.val := by + rw [unitResidual,trace_sub,τ.trace_one] + +theorem unitResidual_compression_trace (v : PartialUnitary M) (x : M.toStarSubalgebra) + (ht : τ.trace x=0) : + τ.trace ((unitResidual v).val*x*(unitResidual v).val) = -τ.trace (star v.val*x*v.val) := by + have h := residualCorner_compression_trace τ ⟨1,IsStarProjection.one _⟩ v + (show v.support ≤ (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M) from one_mul _) x + simpa only [residualCorner,unitResidual,one_mul,ht,zero_sub] using h + +theorem unitResidual_positive (v : PartialUnitary M) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) : + 0 < (τ.trace (unitResidual v).val).re := by + rw [unitResidual_trace,Complex.sub_re,Complex.one_re] + linarith + +/-- A previously controlled length-two moment gives the factor 1/3 in the +current residual's scalar expectation. No new centering premise is inferred. -/ +theorem unitResidual_scalar_bound (v : PartialUnitary M) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) + (x : M.toStarSubalgebra) (ht : τ.trace x=0) (δ : ℝ) (hδ : 0 ≤ δ) + (hmoment : ‖τ.trace (star v.val*x*v.val)‖ ≤ δ*(τ.trace v.support.val).re) : + ‖cornerScalar τ (unitResidual v) x‖ ≤ δ/3 := by + rw [cornerScalar,unitResidual_compression_trace τ v x ht,norm_div,norm_neg, + projection_trace_real τ (unitResidual v),Complex.norm_real, + Real.norm_of_nonneg (unitResidual_positive τ v hsmall).le] + rw [div_le_iff₀ (unitResidual_positive τ v hsmall)] + rw [unitResidual_trace,Complex.sub_re,Complex.one_re] + nlinarith [mul_le_mul_of_nonneg_left hsmall hδ] + +/-- The corresponding actual residual compression bound, once a local +centered L2 estimate has been proved for q. It retains q and its trace. -/ +theorem unitResidual_local_L2 (v : PartialUnitary M) + (hsmall : (τ.trace v.support.val).re ≤ 1/4) + (x : M.toStarSubalgebra) (ht : τ.trace x=0) (δ η : ℝ) (hδ : 0 ≤ δ) + (hmoment : ‖τ.trace (star v.val*x*v.val)‖ ≤ δ*(τ.trace v.support.val).re) + (q : AlgebraProjection M) (hq : q ≤ unitResidual v) + (hlocal : τ.norm₂ (q.val*cornerCentered τ (unitResidual v) x*q.val) < η*τ.norm₂ q.val) : + τ.norm₂ (q.val*x*q.val) < (η+δ/3)*τ.norm₂ q.val := by + have he : q.val*x*q.val = q.val*cornerCentered τ (unitResidual v) x*q.val + + cornerScalar τ (unitResidual v) x • q.val := by + rw [compress_cornerCentered τ hq,sub_add_cancel] + calc τ.norm₂ (q.val*x*q.val) ≤ + τ.norm₂ (q.val*cornerCentered τ (unitResidual v) x*q.val)+ + τ.norm₂ (cornerScalar τ (unitResidual v) x • q.val) := by + conv_lhs => rw [he] + exact τ.norm₂_add_le _ _ + _ ≤ τ.norm₂ (q.val*cornerCentered τ (unitResidual v) x*q.val)+δ/3*τ.norm₂ q.val := by + rw [τ.norm₂_smul] + have hh := mul_le_mul_of_nonneg_right + (unitResidual_scalar_bound τ v hsmall x ht δ hδ hmoment) + (show 0 ≤ τ.norm₂ q.val from norm_nonneg _) + linarith only [hh] + _ < (η+δ/3)*τ.norm₂ q.val := by nlinarith only [hlocal] + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/ResidualMoments.lean b/lean/OAI/Analysis/FactorGeneration/ResidualMoments.lean new file mode 100644 index 0000000000000000000000000000000000000000..b8a10d10da1e9976b26c421d410731802b9072b5 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/ResidualMoments.lean @@ -0,0 +1,545 @@ +import Mathlib.Logic.Encodable.Basic +import OAI.Analysis.FactorGeneration.HaarPatches +import OAI.Analysis.FactorGeneration.QuotientHilbert + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Valid residual-corner identities in the actual quotient. Compression +centering requires two exact moments; global centering alone is insufficient. -/ +section +open Filter +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem quotient_partial_residual_annihilation (v p : Q τ ω) (hp : IsStarProjection p) + (hi : star v*v=p) (hf : v*star v=p) : + v*(1-p)=0 ∧ star v*(1-p)=0 ∧ (1-p)*v=0 ∧ (1-p)*star v=0 := by + have hpf : p*(1-p)=0 := by rw [mul_sub,mul_one,hp.isIdempotentElem.eq,sub_self] + have hstar : star (1-p)=1-p := by rw [star_sub,star_one,hp.isSelfAdjoint.star_eq] + have hright (a : Q τ ω) (ha : star a*a=p) : a*(1-p)=0 := by + apply trace_square_faithful τ ω + rw [star_mul,hstar,mul_assoc,← mul_assoc (star a),ha,hpf,mul_zero] + exact (traceLinear τ ω).map_zero + have h1 := hright v hi + have h2 := hright (star v) (by simpa only [star_star] using hf) + refine ⟨h1,h2,?_,?_⟩ + · simpa only [star_mul,hstar,star_star,star_zero] using congrArg star h2 + · simpa only [star_mul,hstar,star_zero] using congrArg star h1 + +theorem quotient_residual_compression_trace (v p z : Q τ ω) + (hp : IsStarProjection p) (hf : v*star v=p) : + quotientTrace τ ω ((1-p)*z*(1-p)) = + quotientTrace τ ω z - quotientTrace τ ω (star v*z*v) := by + have hff : (1-p)*(1-p)=1-p := by + noncomm_ring [hp.isIdempotentElem.eq] + calc quotientTrace τ ω ((1-p)*z*(1-p)) = quotientTrace τ ω (z*(1-p)*(1-p)) := by + rw [mul_assoc (1-p) z (1-p),quotientTrace_mul_comm τ ω (1-p) (z*(1-p))] + _ = quotientTrace τ ω (z*(1-p)) := by rw [mul_assoc,hff] + _ = quotientTrace τ ω z - quotientTrace τ ω (z*p) := by + rw [mul_sub,mul_one] + exact (traceLinear τ ω).map_sub z (z*p) + _ = quotientTrace τ ω z - quotientTrace τ ω (star v*z*v) := by + rw [← hf,← mul_assoc z v (star v),quotientTrace_mul_comm τ ω (z*v) (star v),mul_assoc] + +theorem quotient_residual_centered (v p z : Q τ ω) (hp : IsStarProjection p) + (hf : v*star v=p) (hz : quotientTrace τ ω z=0) + (hvz : quotientTrace τ ω (star v*z*v)=0) : + quotientTrace τ ω ((1-p)*z*(1-p))=0 := by + rw [quotient_residual_compression_trace τ ω v p z hp hf,hz,hvz,sub_self] + +theorem algebraPatchingWord_append {A : Type*} [Monoid A] [Star A] + (v : A) (xs ys : List (Bool × A)) : + algebraPatchingWord v (xs++ys)=algebraPatchingWord v xs*algebraPatchingWord v ys := by + induction xs with + | nil => simp [algebraPatchingWord] + | cons a xs ih => simp only [List.cons_append,algebraPatchingWord,ih,mul_assoc] + +theorem quotient_residual_word_centered (v p : Q τ ω) (hp : IsStarProjection p) + (hf : v*star v=p) (x : ℕ → Q τ ω) + (hm : ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω (optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ + [(s,optionalCoefficient x last)]))=0) + (i j : ℕ) (xs : List (Bool × ℕ)) (s : Bool) : + quotientTrace τ ω ((1-p)*(x i * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ [(s,x j)]))*(1-p))=0 := by + apply quotient_residual_centered τ ω v p _ hp hf + · exact hm (some i) (some j) xs s + · have h := hm none none ((true,i)::(xs++[(s,j)])) false + simpa [optionalCoefficient,algebraPatchingWord,algebraSignedLetter, + algebraPatchingWord_append,mul_assoc] using h + +/-! All residual middle coefficients from exact independence: the original +centered coefficients, words with two centered endpoints, and the vanishing +compressions when an endpoint is the unit. -/ + +theorem quotient_residual_signed_annihilation (v p : Q τ ω) (hp : IsStarProjection p) + (hi : star v*v=p) (hf : v*star v=p) (s : Bool) : + (1-p)*algebraSignedLetter v s=0 ∧ algebraSignedLetter v s*(1-p)=0 := by + obtain ⟨h1,h2,h3,h4⟩ := quotient_partial_residual_annihilation τ ω v p hp hi hf + cases s + · exact ⟨h3,h1⟩ + · exact ⟨h4,h2⟩ + +theorem quotient_residual_word_unit_left (v p : Q τ ω) (hp : IsStarProjection p) + (hi : star v*v=p) (hf : v*star v=p) (ys : List (Bool × Q τ ω)) (hy : ys ≠ []) : + (1-p)*algebraPatchingWord v ys=0 := by + cases ys with + | nil => exact (hy rfl).elim + | cons a ys => + simp only [algebraPatchingWord,← mul_assoc, + (quotient_residual_signed_annihilation τ ω v p hp hi hf a.1).1,zero_mul] + +theorem quotient_residual_word_unit_right (v p : Q τ ω) (hp : IsStarProjection p) + (hi : star v*v=p) (hf : v*star v=p) (ys : List (Bool × Q τ ω)) (s : Bool) : + algebraPatchingWord v (ys++[(s,1)])*(1-p)=0 := by + rw [algebraPatchingWord_append] + simp only [algebraPatchingWord,mul_one,mul_assoc, + (quotient_residual_signed_annihilation τ ω v p hp hi hf s).2,mul_zero] + +theorem quotient_residual_all_words_centered (v p : Q τ ω) (hp : IsStarProjection p) + (hi : star v*v=p) (hf : v*star v=p) (x : ℕ → Q τ ω) + (hm : ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω (optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ + [(s,optionalCoefficient x last)]))=0) + (first last : Option ℕ) (xs : List (Bool × ℕ)) (s : Bool) : + quotientTrace τ ω ((1-p)*(optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ + [(s,optionalCoefficient x last)]))*(1-p))=0 := by + cases first with + | none => + simp only [optionalCoefficient,one_mul] + rw [quotient_residual_word_unit_left τ ω v p hp hi hf _ (by simp),zero_mul] + exact (traceLinear τ ω).map_zero + | some i => + cases last with + | none => + change quotientTrace τ ω ((1-p)*(x i*algebraPatchingWord v + (xs.map (fun a => (a.1,x a.2)) ++ [(s,1)]))*(1-p))=0 + rw [mul_assoc,mul_assoc, + quotient_residual_word_unit_right τ ω v p hp hi hf,mul_zero,mul_zero] + exact (traceLinear τ ω).map_zero + | some j => exact quotient_residual_word_centered τ ω v p hp hf x hm i j xs s + +theorem quotient_residual_coefficient_centered (v p : Q τ ω) (hp : IsStarProjection p) + (hf : v*star v=p) (x : ℕ → Q τ ω) (hc : ∀ i,quotientTrace τ ω (x i)=0) + (hm : ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω (optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ + [(s,optionalCoefficient x last)]))=0) (i : ℕ) : + quotientTrace τ ω ((1-p)*x i*(1-p))=0 := by + apply quotient_residual_centered τ ω v p (x i) hp hf (hc i) + simpa [optionalCoefficient,algebraPatchingWord,algebraSignedLetter] using + hm none none [(true,i)] false + +end + +/-! A countable family containing every original coefficient and every old +nonempty ordered signed word, with both optional endpoints retained. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +abbrev ResidualWordIndex := ℕ ⊕ (Option ℕ × Option ℕ × List (Bool × ℕ) × Bool) + +def residualWordValue (v : Q τ ω) (x : ℕ → Q τ ω) : ResidualWordIndex → Q τ ω + | .inl i => x i + | .inr (first,last,xs,s) => optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]) + +def residualWordFamily (v : Q τ ω) (x : ℕ → Q τ ω) (i : ℕ) : Q τ ω := + match Encodable.decode (α := ResidualWordIndex) i with + | none => 0 + | some k => residualWordValue τ ω v x k + +theorem residualWordFamily_encode (v : Q τ ω) (x : ℕ → Q τ ω) (k : ResidualWordIndex) : + residualWordFamily τ ω v x (Encodable.encode k)=residualWordValue τ ω v x k := by + simp [residualWordFamily] + +theorem residualWordFamily_contains_coefficient (v : Q τ ω) (x : ℕ → Q τ ω) (i : ℕ) : + ∃ j,residualWordFamily τ ω v x j=x i := + ⟨Encodable.encode (Sum.inl i : ResidualWordIndex),residualWordFamily_encode τ ω v x (.inl i)⟩ + +theorem residualWordFamily_contains_word (v : Q τ ω) (x : ℕ → Q τ ω) + (first last : Option ℕ) (xs : List (Bool × ℕ)) (s : Bool) : + ∃ j,residualWordFamily τ ω v x j=optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]) := + ⟨Encodable.encode (Sum.inr (first,last,xs,s) : ResidualWordIndex), + residualWordFamily_encode τ ω v x (.inr (first,last,xs,s))⟩ + +theorem residualWordFamily_compression_centered (v p : Q τ ω) (hp : IsStarProjection p) + (hi : star v*v=p) (hf : v*star v=p) (x : ℕ → Q τ ω) + (hc : ∀ i,quotientTrace τ ω (x i)=0) + (hm : ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω (optionalCoefficient x first * + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ + [(s,optionalCoefficient x last)]))=0) : + ∀ i,quotientTrace τ ω ((1-p)*residualWordFamily τ ω v x i*(1-p))=0 := by + intro i + unfold residualWordFamily + cases h : Encodable.decode (α := ResidualWordIndex) i with + | none => simp only [mul_zero,zero_mul]; exact (traceLinear τ ω).map_zero + | some k => + cases k with + | inl j => exact quotient_residual_coefficient_centered τ ω v p hp hf x hc hm j + | inr k => + rcases k with ⟨first,last,xs,s⟩ + exact quotient_residual_all_words_centered τ ω v p hp hi hf x hm first last xs s + +/-! Ordered mixed words grouped at each increment letter. The intervening +old runs are actual members of the previously enumerated residual family. -/ + +theorem residualWordFamily_contains_run (v : Q τ ω) (x : ℕ → Q τ ω) + (i : ℕ) (pre : List (Bool × ℕ)) : + ∃ j,residualWordFamily τ ω v x j=x i* + algebraPatchingWord v (pre.map (fun a => (a.1,x a.2))) := by + induction pre using List.reverseRecOn with + | nil => simpa [algebraPatchingWord] using residualWordFamily_contains_coefficient τ ω v x i + | append_singleton pre a ih => + simpa [List.map_append,optionalCoefficient] using + residualWordFamily_contains_word τ ω v x (some i) (some a.2) pre a.1 + +theorem residualWordFamily_contains_outer_run (v : Q τ ω) (x : ℕ → Q τ ω) + (first : Option ℕ) (pre : List (Bool × ℕ)) : + ∃ j : Option ℕ,optionalCoefficient (residualWordFamily τ ω v x) j= + optionalCoefficient x first*algebraPatchingWord v (pre.map (fun a => (a.1,x a.2))) := by + induction pre using List.reverseRecOn with + | nil => + cases first with + | none => exact ⟨none,by simp [optionalCoefficient,algebraPatchingWord]⟩ + | some i => + obtain ⟨j,hj⟩ := residualWordFamily_contains_coefficient τ ω v x i + exact ⟨some j,by simpa [optionalCoefficient,algebraPatchingWord] using hj⟩ + | append_singleton pre a ih => + obtain ⟨j,hj⟩ := residualWordFamily_contains_word τ ω v x first (some a.2) pre a.1 + exact ⟨some j,by simpa [List.map_append,optionalCoefficient] using hj⟩ + +def algebraMixedTail {A : Type*} [Monoid A] [Star A] (v w : A) (x : ℕ → A) + (last : Option ℕ) (b s : Bool) : List (Bool × Bool × ℕ) → A + | [] => algebraSignedLetter (if b then w else v) s * optionalCoefficient x last + | (c,t,i)::xs => algebraSignedLetter (if c then w else v) t*x i* + algebraMixedTail v w x last b s xs + +/-- Every actual ordered mixed term is either the original word or an ordered +increment word with enumerated internal blocks and an explicit old prefix. -/ +theorem algebraMixedTail_normalize (v w : Q τ ω) (x : ℕ → Q τ ω) + (last : Option ℕ) (b s : Bool) (xs : List (Bool × Bool × ℕ)) : + algebraMixedTail v w x last b s xs = + algebraPatchingWord v (xs.map (fun a => (a.2.1,x a.2.2)) ++ + [(s,optionalCoefficient x last)]) ∨ + ∃ pre : List (Bool × ℕ), ∃ ys : List (Bool × ℕ), ∃ t : Bool, ∃ last' : Option ℕ, + algebraMixedTail v w x last b s xs = + algebraPatchingWord v (pre.map (fun a => (a.1,x a.2))) * + algebraPatchingWord w (ys.map (fun a => (a.1,residualWordFamily τ ω v x a.2)) ++ + [(t,optionalCoefficient (residualWordFamily τ ω v x) last')]) := by + induction xs with + | nil => + cases b with + | false => exact Or.inl (by simp [algebraMixedTail,algebraPatchingWord]) + | true => + obtain ⟨j,hj⟩ := residualWordFamily_contains_outer_run τ ω v x last [] + refine Or.inr ⟨[],[],s,j,?_⟩ + simp only [List.map_nil,algebraPatchingWord,mul_one] at hj + simp [algebraMixedTail,algebraPatchingWord,hj] + | cons a xs ih => + rcases a with ⟨c,t,i⟩ + cases c with + | false => + rcases ih with h | ⟨pre,ys,u,last',h⟩ + · exact Or.inl (by simp [algebraMixedTail,algebraPatchingWord,h]) + · exact Or.inr ⟨(t,i)::pre,ys,u,last',by + simp only [algebraMixedTail,Bool.false_eq_true,↓reduceIte,h,List.map_cons, + algebraPatchingWord,mul_assoc]⟩ + | true => + rcases ih with h | ⟨pre,ys,u,last',h⟩ + · obtain ⟨j,hj⟩ := residualWordFamily_contains_word τ ω v x (some i) last + (xs.map (fun a => (a.2.1,a.2.2))) s + refine Or.inr ⟨[],[],t,some j,?_⟩ + simp only [algebraMixedTail,↓reduceIte,h,List.map_nil,List.nil_append, + algebraPatchingWord,one_mul,mul_one,optionalCoefficient] + simp only [List.map_map,Function.comp_def,optionalCoefficient] at hj + rw [hj,mul_assoc] + · obtain ⟨j,hj⟩ := residualWordFamily_contains_run τ ω v x i pre + refine Or.inr ⟨[],(t,j)::ys,u,last',?_⟩ + simp only [algebraMixedTail,↓reduceIte,h,List.map_nil,List.map_cons, + List.cons_append,algebraPatchingWord,one_mul] + rw [hj] + simp only [mul_assoc] + +end + +/-! Cyclic endpoint correction for residual patching. Outer endpoints are +multiplied before compression, and the scalar part is handled separately. -/ +section +open UltrapowerBridge Filter + +def algebraWordCore {A : Type*} [Monoid A] [Star A] (v : A) (x : ℕ → A) + (s : Bool) : List (Bool × ℕ) → A + | [] => algebraSignedLetter v s + | (t,i)::xs => algebraSignedLetter v t*x i*algebraWordCore v x s xs + +theorem algebraWordCore_endpoints {A : Type*} [Monoid A] [Star A] + (v : A) (x : ℕ → A) (last : Option ℕ) (s : Bool) (xs : List (Bool × ℕ)) : + algebraPatchingWord v (xs.map (fun a => (a.1,x a.2)) ++ + [(s,optionalCoefficient x last)])=algebraWordCore v x s xs*optionalCoefficient x last := by + induction xs with + | nil => simp [algebraPatchingWord,algebraWordCore] + | cons a xs ih => simp [algebraPatchingWord,algebraWordCore,ih,mul_assoc] + +theorem algebraWordCore_map {A : Type*} [Monoid A] [Star A] + (w : A) (x y : ℕ → A) (k : ℕ → ℕ) (h : ∀ i,x i=y (k i)) + (s : Bool) (xs : List (Bool × ℕ)) : + algebraWordCore w x s xs=algebraWordCore w y s (xs.map (fun a => (a.1,k a.2))) := by + induction xs with + | nil => rfl + | cons a xs ih => simp only [algebraWordCore,List.map_cons,h,ih] + +theorem algebraWordCore_support {A : Type*} [Monoid A] [Star A] + (w f : A) (hw : ∀ s,f*algebraSignedLetter w s=algebraSignedLetter w s ∧ + algebraSignedLetter w s*f=algebraSignedLetter w s) + (x : ℕ → A) (s : Bool) (xs : List (Bool × ℕ)) : + f*algebraWordCore w x s xs=algebraWordCore w x s xs ∧ + algebraWordCore w x s xs*f=algebraWordCore w x s xs := by + induction xs with + | nil => exact hw s + | cons a xs ih => + constructor + · simp only [algebraWordCore,← mul_assoc,(hw a.1).1] + · simp only [algebraWordCore,mul_assoc,ih.2] + +theorem algebraWordCore_compress {A : Type*} [Monoid A] [Star A] + (w f : A) (hw : ∀ s,f*algebraSignedLetter w s=algebraSignedLetter w s ∧ + algebraSignedLetter w s*f=algebraSignedLetter w s) + (x : ℕ → A) (s : Bool) (xs : List (Bool × ℕ)) : + algebraWordCore w (fun i => f*x i*f) s xs=algebraWordCore w x s xs := by + induction xs with + | nil => rfl + | cons a xs ih => + simp only [algebraWordCore,ih] + calc algebraSignedLetter w a.1*(f*x a.2*f)*algebraWordCore w x s xs = + (algebraSignedLetter w a.1*f)*x a.2*(f*algebraWordCore w x s xs) := by + simp only [mul_assoc] + _ = _ := by rw [(hw a.1).2,(algebraWordCore_support w f hw x s xs).1] + +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def ExactOrderedMoments (w : Q τ ω) (x : ℕ → Q τ ω) : Prop := + ∀ first last : Option ℕ,∀ xs : List (Bool × ℕ),∀ s : Bool, + quotientTrace τ ω (optionalCoefficient x first * algebraPatchingWord w + (xs.map (fun a => (a.1,x a.2)) ++ [(s,optionalCoefficient x last)]))=0 + +theorem exactOrderedMoments_core (w : Q τ ω) (x : ℕ → Q τ ω) + (h : ExactOrderedMoments τ ω w x) (last : Option ℕ) (s : Bool) (xs : List (Bool × ℕ)) : + quotientTrace τ ω (algebraWordCore w x s xs*optionalCoefficient x last)=0 := by + have hh := h none last xs s + rw [algebraWordCore_endpoints] at hh + simpa only [optionalCoefficient,one_mul] using hh + +theorem trace_supported_cyclic_compression (c f z : Q τ ω) + (hl : f*c=c) (hr : c*f=c) : + quotientTrace τ ω (c*(f*z*f))=quotientTrace τ ω (c*z) := by + calc quotientTrace τ ω (c*(f*z*f)) = quotientTrace τ ω ((c*(f*z))*f) := by simp only [mul_assoc] + _ = quotientTrace τ ω (f*(c*(f*z))) := quotientTrace_mul_comm τ ω _ _ + _ = quotientTrace τ ω (c*z) := by rw [← mul_assoc f c,hl,← mul_assoc c f,hr] + +/-- Transfer exact moments from compressed internal coefficients and centered +cyclic endpoint products. The scalar correction uses the moment with both +endpoints equal to the unit. -/ +theorem exact_moment_of_cyclic_family (w f : Q τ ω) + (hw : ∀ s,f*algebraSignedLetter w s=algebraSignedLetter w s ∧ + algebraSignedLetter w s*f=algebraSignedLetter w s) + (y z : ℕ → Q τ ω) (k : ℕ → ℕ) (hk : ∀ i,f*y i*f=z (k i)) + (hc : ∀ a b : Option ℕ,∃ j : ℕ,∃ c : ℂ, + f*(optionalCoefficient y b*optionalCoefficient y a)*f=z j+c • f) + (hm : ExactOrderedMoments τ ω w z) + (a b : Option ℕ) (xs : List (Bool × ℕ)) (s : Bool) : + quotientTrace τ ω (optionalCoefficient y a*algebraPatchingWord w + (xs.map (fun t => (t.1,y t.2)) ++ [(s,optionalCoefficient y b)]))=0 := by + let C := algebraWordCore w y s xs + have hs := algebraWordCore_support w f hw y s xs + have he : C=algebraWordCore w z s (xs.map (fun t => (t.1,k t.2))) := by + dsimp only [C] + rw [← algebraWordCore_compress w f hw y s xs] + exact algebraWordCore_map w _ z k hk s xs + obtain ⟨j,c,hj⟩ := hc a b + have hzero : quotientTrace τ ω (C*z j)=0 := by + rw [he] + exact exactOrderedMoments_core τ ω w z hm (some j) s _ + have hunit : quotientTrace τ ω C=0 := by + simpa only [he,optionalCoefficient,mul_one] using + exactOrderedMoments_core τ ω w z hm none s (xs.map (fun t => (t.1,k t.2))) + rw [algebraWordCore_endpoints,← mul_assoc] + change quotientTrace τ ω (optionalCoefficient y a*C*optionalCoefficient y b)=0 + rw [quotientTrace_mul_comm τ ω (optionalCoefficient y a*C),← mul_assoc, + quotientTrace_mul_comm τ ω (optionalCoefficient y b*optionalCoefficient y a) C] + rw [← trace_supported_cyclic_compression τ ω C f _ hs.1 hs.2,hj,mul_add, + mul_smul_comm,hs.2,trace_add,trace_smul,hzero,hunit,mul_zero,add_zero] + +end + +/-! Countable supported family for actual residual patching, including centered +cyclic products of the two outer blocks. -/ +section +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +def quotientCornerCenter (f z : Q τ ω) : Q τ ω := + f*z*f-(quotientTrace τ ω (f*z*f)/quotientTrace τ ω f) • f + +theorem quotientCornerCenter_supported (f z : Q τ ω) (hf : f*f=f) : + f*quotientCornerCenter τ ω f z=quotientCornerCenter τ ω f z ∧ + quotientCornerCenter τ ω f z*f=quotientCornerCenter τ ω f z := by + constructor + · simp only [quotientCornerCenter,mul_sub,mul_smul_comm,← mul_assoc,hf] + · simp only [quotientCornerCenter,sub_mul,smul_mul_assoc,mul_assoc,hf] + +theorem quotientCornerCenter_trace (f z : Q τ ω) (ht : quotientTrace τ ω f ≠ 0) : + quotientTrace τ ω (quotientCornerCenter τ ω f z)=0 := by + unfold quotientCornerCenter + change (traceLinear τ ω) (_-_) = 0 + rw [map_sub] + change quotientTrace τ ω (f*z*f)-quotientTrace τ ω + ((quotientTrace τ ω (f*z*f)/quotientTrace τ ω f) • f)=0 + rw [trace_smul,div_mul_cancel₀ _ ht,sub_self] + +theorem quotientCornerCenter_decompose (f z : Q τ ω) : + f*z*f=quotientCornerCenter τ ω f z+ + (quotientTrace τ ω (f*z*f)/quotientTrace τ ω f) • f := by + unfold quotientCornerCenter + abel + +abbrev CyclicFamilyIndex := ℕ ⊕ (Option ℕ × Option ℕ) + +def cyclicFamilyValue (f : Q τ ω) (y : ℕ → Q τ ω) : CyclicFamilyIndex → Q τ ω + | .inl i => f*y i*f + | .inr (a,b) => quotientCornerCenter τ ω f (optionalCoefficient y b*optionalCoefficient y a) + +def cyclicResidualFamily (f : Q τ ω) (y : ℕ → Q τ ω) (i : ℕ) : Q τ ω := + match Encodable.decode (α := CyclicFamilyIndex) i with + | none => 0 + | some k => cyclicFamilyValue τ ω f y k + +theorem cyclicResidualFamily_encode (f : Q τ ω) (y : ℕ → Q τ ω) (k : CyclicFamilyIndex) : + cyclicResidualFamily τ ω f y (Encodable.encode k)=cyclicFamilyValue τ ω f y k := by + simp [cyclicResidualFamily] + +theorem cyclicResidualFamily_supported (f : Q τ ω) (hf : f*f=f) (y : ℕ → Q τ ω) : + ∀ i,f*cyclicResidualFamily τ ω f y i*f=cyclicResidualFamily τ ω f y i := by + intro i + unfold cyclicResidualFamily + cases Encodable.decode (α := CyclicFamilyIndex) i with + | none => simp only [mul_zero,zero_mul] + | some k => + cases k with + | inl j => simp only [cyclicFamilyValue,← mul_assoc,hf]; simp only [mul_assoc,hf] + | inr ab => + obtain ⟨hl,hr⟩ := quotientCornerCenter_supported τ ω f + (optionalCoefficient y ab.2*optionalCoefficient y ab.1) hf + exact (congrArg (fun z => z*f) hl).trans hr + +theorem cyclicResidualFamily_centered (f : Q τ ω) (hf : f*f=f) + (ht : quotientTrace τ ω f ≠ 0) (y : ℕ → Q τ ω) + (hy : ∀ i,quotientTrace τ ω (f*y i*f)=0) : + ∀ i,quotientTrace τ ω (f*cyclicResidualFamily τ ω f y i*f)=0 := by + intro i + rw [cyclicResidualFamily_supported τ ω f hf] + unfold cyclicResidualFamily + cases Encodable.decode (α := CyclicFamilyIndex) i with + | none => exact (traceLinear τ ω).map_zero + | some k => + cases k with + | inl j => exact hy j + | inr ab => exact quotientCornerCenter_trace τ ω f _ ht + +theorem cyclicResidualFamily_internal (f : Q τ ω) (y : ℕ → Q τ ω) : + ∃ k : ℕ → ℕ,∀ i,f*y i*f=cyclicResidualFamily τ ω f y (k i) := by + refine ⟨fun i => Encodable.encode (Sum.inl i : CyclicFamilyIndex),fun i => ?_⟩ + exact (cyclicResidualFamily_encode τ ω f y (.inl i)).symm + +theorem cyclicResidualFamily_outer (f : Q τ ω) (y : ℕ → Q τ ω) : + ∀ a b : Option ℕ,∃ j : ℕ,∃ c : ℂ, + f*(optionalCoefficient y b*optionalCoefficient y a)*f= + cyclicResidualFamily τ ω f y j+c • f := by + intro a b + refine ⟨Encodable.encode (Sum.inr (a,b) : CyclicFamilyIndex), + quotientTrace τ ω (f*(optionalCoefficient y b*optionalCoefficient y a)*f)/quotientTrace τ ω f,?_⟩ + rw [cyclicResidualFamily_encode] + exact quotientCornerCenter_decompose τ ω f _ + +end + +/-! Exact preservation of every original ordered moment under orthogonal +patching, once the constructed cyclic residual family has exact moments. -/ +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +theorem algebraSignedLetter_add' {A : Type*} [AddMonoid A] [StarAddMonoid A] + (v w : A) (s : Bool) : + algebraSignedLetter (v+w) s=algebraSignedLetter v s+algebraSignedLetter w s := by + cases s <;> simp [algebraSignedLetter,star_add] + +/-- Distribute every signed letter while preserving the full multiplication +order. The premise is checked for actual mixed terms, not scalar estimates. -/ +theorem ordered_sum_zero_of_all_mixed (v w : Q τ ω) (x : ℕ → Q τ ω) + (last : Option ℕ) (s : Bool) (xs : List (Bool × ℕ)) (a : Q τ ω) + (h : ∀ cs : List (Bool × Bool × ℕ),∀ b : Bool, + quotientTrace τ ω (a*algebraMixedTail v w x last b s cs)=0) : + quotientTrace τ ω (a*algebraPatchingWord (v+w) + (xs.map (fun t => (t.1,x t.2)) ++ [(s,optionalCoefficient x last)]))=0 := by + induction xs generalizing a with + | nil => + have hv := h [] false + have hw := h [] true + simp only [algebraMixedTail,↓reduceIte,Bool.false_eq_true] at hv hw + simp only [List.map_nil,List.nil_append,algebraPatchingWord,mul_one, + algebraSignedLetter_add',add_mul,mul_add,trace_add,hv,hw,add_zero] + | cons t xs ih => + have ht (b : Bool) : quotientTrace τ ω + ((a*algebraSignedLetter (if b then w else v) t.1*x t.2)* + algebraPatchingWord (v+w) + (xs.map (fun t => (t.1,x t.2)) ++ [(s,optionalCoefficient x last)]))=0 := by + apply ih + intro cs c + simpa only [algebraMixedTail,mul_assoc] using h ((b,t.1,t.2)::cs) c + have hv := ht false + have hw := ht true + simp only [Bool.false_eq_true,↓reduceIte] at hv hw + simp only [List.map_cons,List.cons_append,algebraPatchingWord,algebraSignedLetter_add', + add_mul,mul_add,trace_add] + simpa only [mul_assoc,add_zero] using congrArg₂ (·+·) hv hw + +theorem exactOrderedMoments_add_of_cyclic (v w f : Q τ ω) (x : ℕ → Q τ ω) + (hm : ExactOrderedMoments τ ω v x) + (hs : ∀ s,f*algebraSignedLetter w s=algebraSignedLetter w s ∧ + algebraSignedLetter w s*f=algebraSignedLetter w s) + (hw : ExactOrderedMoments τ ω w + (cyclicResidualFamily τ ω f (residualWordFamily τ ω v x))) : + ExactOrderedMoments τ ω (v+w) x := by + intro first last xs s + apply ordered_sum_zero_of_all_mixed τ ω v w x last s xs + intro cs b + rcases algebraMixedTail_normalize τ ω v w x last b s cs with h | ⟨pre,ys,t,last',h⟩ + · rw [h] + simpa only [List.map_map,Function.comp_def] using + hm first last (cs.map (fun a => (a.2.1,a.2.2))) s + · obtain ⟨first',hfirst⟩ := residualWordFamily_contains_outer_run τ ω v x first pre + rw [h,← mul_assoc,← hfirst] + obtain ⟨k,hk⟩ := cyclicResidualFamily_internal τ ω f (residualWordFamily τ ω v x) + exact exact_moment_of_cyclic_family τ ω w f hs _ _ k hk + (cyclicResidualFamily_outer τ ω f _) hw first' last' ys t + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/SpectralApproximation.lean b/lean/OAI/Analysis/FactorGeneration/SpectralApproximation.lean new file mode 100644 index 0000000000000000000000000000000000000000..42e2694da4e7542fd052f76a15884d885fd597e5 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/SpectralApproximation.lean @@ -0,0 +1,404 @@ +import OAI.Analysis.FactorGeneration.SpectralPinching + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Common finite refinements of two commuting corner partitions. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace CornerPartition +variable {p : AlgebraProjection M} (Q R : CornerPartition p) +variable (hc : ∀ i j, Commute (Q.piece i).val (R.piece j).val) + +def jointPiece (a : Fin Q.size × Fin R.size) : AlgebraProjection M := + ⟨(Q.piece a.1).val*(R.piece a.2).val, + (Q.piece a.1).property.mul (R.piece a.2).property (hc a.1 a.2)⟩ + +theorem jointPiece_le_left (a : Fin Q.size × Fin R.size) : Q.jointPiece R hc a ≤ Q.piece a.1 := by + change (Q.piece a.1).val*((Q.piece a.1).val*(R.piece a.2).val)=(Q.piece a.1).val*(R.piece a.2).val + rw [← mul_assoc,(Q.piece a.1).property.isIdempotentElem.eq] + +theorem jointPiece_le_right (a : Fin Q.size × Fin R.size) : Q.jointPiece R hc a ≤ R.piece a.2 := by + change (R.piece a.2).val*((Q.piece a.1).val*(R.piece a.2).val)=(Q.piece a.1).val*(R.piece a.2).val + rw [← mul_assoc,← (hc a.1 a.2).eq,mul_assoc,(R.piece a.2).property.isIdempotentElem.eq] + +theorem jointPiece_orthogonal (a b : Fin Q.size × Fin R.size) (hab : a ≠ b) : + (Q.jointPiece R hc a).val*(Q.jointPiece R hc b).val=0 := by + by_cases h : a.1=b.1 + · have h₂ : a.2 ≠ b.2 := fun h₂ => hab (Prod.ext h h₂) + exact orthogonal_subprojections (R.orthogonal a.2 b.2 h₂) + (Q.jointPiece_le_right R hc a) (Q.jointPiece_le_right R hc b) + · exact orthogonal_subprojections (Q.orthogonal a.1 b.1 h) + (Q.jointPiece_le_left R hc a) (Q.jointPiece_le_left R hc b) + +theorem jointPiece_total : (∑ a : Fin Q.size × Fin R.size, (Q.jointPiece R hc a).val)=p.val := by + change (∑ a : Fin Q.size × Fin R.size, (Q.piece a.1).val*(R.piece a.2).val)=p.val + rw [Fintype.sum_prod_type] + simp only [← Finset.mul_sum,R.total,projection_mul_of_le (Q.piece_le _)] + exact Q.total + +def joint : CornerPartition p := ofFamily (Q.jointPiece R hc) + (Q.jointPiece_orthogonal R hc) (Q.jointPiece_total R hc) + +theorem joint_refines_left : Q.Refines (Q.joint R hc) := by + intro i + let a := (Fintype.equivFin (Fin Q.size × Fin R.size)).symm i + exact ⟨a.1,Q.jointPiece_le_left R hc a⟩ + +theorem joint_refines_right : R.Refines (Q.joint R hc) := by + intro i + let a := (Fintype.equivFin (Fin Q.size × Fin R.size)).symm i + exact ⟨a.2,Q.jointPiece_le_right R hc a⟩ + +/-- A spectral sum on Q is represented exactly on the common refinement. -/ +theorem joint_sum_left (c : Fin Q.size → ℂ) : + (∑ a : Fin Q.size × Fin R.size, c a.1 • (Q.jointPiece R hc a).val)= + ∑ i, c i • (Q.piece i).val := by + rw [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro i _ + change (∑ j, c i • ((Q.piece i).val*(R.piece j).val))=_ + rw [← Finset.smul_sum,← Finset.mul_sum,R.total,projection_mul_of_le (Q.piece_le i)] + +theorem joint_sum_right (c : Fin R.size → ℂ) : + (∑ a : Fin Q.size × Fin R.size, c a.2 • (Q.jointPiece R hc a).val)= + ∑ j, c j • (R.piece j).val := by + rw [Fintype.sum_prod_type,Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + change (∑ i, c j • ((Q.piece i).val*(R.piece j).val))=_ + rw [← Finset.smul_sum,← Finset.sum_mul,Q.total] + have hleft : p.val*(R.piece j).val=(R.piece j).val := R.piece_le j + rw [hleft] + +end CornerPartition + +/-! Simultaneous finite spectral approximation of two commuting self-adjoint +operators. The same actual partition is used for both. -/ + +theorem exists_joint_spectral_approximation (p : AlgebraProjection M) + (a b : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (hb : IsSelfAdjoint b) + (hab : Commute a b) (hpa : Commute p.val a) (hpb : Commute p.val b) + (ε : ℝ) (hε : 0 < ε) : + ∃ (S : CornerPartition p) (c d : Fin S.size → ℝ), + ‖p.val*a*p.val-∑ i, (c i : ℂ) • (S.piece i).val‖ < ε ∧ + ‖p.val*b*p.val-∑ i, (d i : ℂ) • (S.piece i).val‖ < ε := by + obtain ⟨Q,c,hQfix,hQ,hc⟩ := exists_finite_spectral_approximation_preserving_commutant p a ha ε hε + obtain ⟨R,d,hRfix,hR,hd⟩ := exists_finite_spectral_approximation_preserving_commutant p b hb ε hε + have hcross (i : Fin Q.size) (j : Fin R.size) : Commute (Q.piece i).val (R.piece j).val := by + have hqp : Commute p.val (Q.piece i).val := + (hQ p.val hpa.symm (Commute.refl _) i).symm + exact (hR (Q.piece i).val (hQ b hab hpb i).symm hqp j).symm + let e := (Fintype.equivFin (Fin Q.size × Fin R.size)).symm + refine ⟨Q.joint R hcross,fun i => c (e i).1,fun i => d (e i).2,?_,?_⟩ + · have he := Equiv.sum_comp e (fun i => (c i.1 : ℂ) • (Q.jointPiece R hcross i).val) + change ‖p.val*a*p.val-∑ i, (c (e i).1 : ℂ) • (Q.jointPiece R hcross (e i)).val‖ < ε + rw [he,Q.joint_sum_left R hcross (fun i => (c i : ℂ))] + exact hc + · have he := Equiv.sum_comp e (fun i => (d i.2 : ℂ) • (Q.jointPiece R hcross i).val) + change ‖p.val*b*p.val-∑ i, (d (e i).2 : ℂ) • (Q.jointPiece R hcross (e i)).val‖ < ε + rw [he,Q.joint_sum_right R hcross (fun i => (d i : ℂ))] + exact hd + +/-- Complex finite spectral sums are constructed from the joint real and +imaginary approximations. No small pinching-energy premise occurs. -/ +theorem exists_complex_spectral_approximation (p : AlgebraProjection M) + (a b : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (hb : IsSelfAdjoint b) + (hab : Commute a b) (hpa : Commute p.val a) (hpb : Commute p.val b) + (ε : ℝ) (hε : 0 < ε) : + ∃ (S : CornerPartition p) (c : Fin S.size → ℂ), + ‖p.val*(a+Complex.I • b)*p.val-∑ i, c i • (S.piece i).val‖ < ε := by + obtain ⟨S,c,d,hc,hd⟩ := exists_joint_spectral_approximation p a b ha hb hab hpa hpb + (ε/2) (half_pos hε) + refine ⟨S,fun i => (c i : ℂ)+Complex.I*(d i : ℂ),?_⟩ + have he : p.val*(a+Complex.I • b)*p.val- + (∑ i, ((c i : ℂ)+Complex.I*(d i : ℂ)) • (S.piece i).val) = + (p.val*a*p.val-∑ i, (c i : ℂ) • (S.piece i).val)+ + Complex.I • (p.val*b*p.val-∑ i, (d i : ℂ) • (S.piece i).val) := by + simp only [mul_add,add_mul,mul_smul_comm,smul_mul_assoc,add_smul, + mul_smul,Finset.sum_add_distrib,Finset.smul_sum,smul_sub] + abel + rw [he] + have hn := norm_add_le (p.val*a*p.val-∑ i, (c i : ℂ) • (S.piece i).val) + (Complex.I • (p.val*b*p.val-∑ i, (d i : ℂ) • (S.piece i).val)) + rw [norm_smul,Complex.norm_I,one_mul] at hn + linarith + +end + +/-! Finite spectral approximation for an actual normal operator. -/ +section +open scoped BigOperators ComplexStarModule +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def identityProjection (M : VonNeumannAlgebra H) : AlgebraProjection M := ⟨1,IsStarProjection.one _⟩ + +theorem exists_normal_spectral_approximation (x : M.toStarSubalgebra) [IsStarNormal x] + (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition (identityProjection M)) (c : Fin Q.size → ℂ), + ‖x-∑ i, c i • (Q.piece i).val‖ < ε := by + obtain ⟨Q,c,h⟩ := exists_complex_spectral_approximation (identityProjection M) + (ℜ x) (ℑ x) (ℜ x).property (ℑ x).property (Commute.realPart_imaginaryPart x) + (Commute.one_left _) (Commute.one_left _) ε hε + refine ⟨Q,c,?_⟩ + simpa only [identityProjection,one_mul,mul_one,realPart_add_I_smul_imaginaryPart] using h + +theorem exists_unitary_spectral_approximation (u : unitary M.toStarSubalgebra) + (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition (identityProjection M)) (c : Fin Q.size → ℂ), + ‖(u : M.toStarSubalgebra)-∑ i, c i • (Q.piece i).val‖ < ε := by + let : IsStarNormal (u : M.toStarSubalgebra) := ⟨by change star (u : M.toStarSubalgebra)*(u : M.toStarSubalgebra) = (u : M.toStarSubalgebra)*star (u : M.toStarSubalgebra); rw [u.property.1,u.property.2]⟩ + exact exists_normal_spectral_approximation (u : M.toStarSubalgebra) ε hε + +end + +/-! Transport constructed spectral partitions through an actual inclusion of +von Neumann algebras on the same Hilbert space. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def algebraInclusion (h : N ≤ M) : N.toStarSubalgebra →⋆ₐ[ℂ] M.toStarSubalgebra := + StarSubalgebra.inclusion h + +def includedProjection (h : N ≤ M) (p : AlgebraProjection N) : AlgebraProjection M := + ⟨algebraInclusion h p.val,by + constructor + · change algebraInclusion h p.val * algebraInclusion h p.val = algebraInclusion h p.val + rw [← map_mul,p.property.isIdempotentElem.eq] + · change star (algebraInclusion h p.val)=algebraInclusion h p.val + rw [← map_star,p.property.isSelfAdjoint.star_eq]⟩ + +def includedUnitPartition (h : N ≤ M) (Q : CornerPartition (identityProjection N)) : + CornerPartition (identityProjection M) where + size := Q.size + piece i := includedProjection h (Q.piece i) + orthogonal i j hij := by + change algebraInclusion h (Q.piece i).val * algebraInclusion h (Q.piece j).val=0 + rw [← map_mul,Q.orthogonal i j hij,map_zero] + total := by + change (∑ i,algebraInclusion h (Q.piece i).val)=1 + rw [← map_sum,Q.total] + exact map_one (algebraInclusion h) + +theorem includedUnitPartition_mem (h : N ≤ M) (Q : CornerPartition (identityProjection N)) + (i : Fin Q.size) : ((includedUnitPartition h Q).piece i).val.val ∈ N := + (Q.piece i).val.property + +theorem exists_unitary_subalgebra_spectral_approximation (h : N ≤ M) + (u : unitary M.toStarSubalgebra) (hu : (u : M.toStarSubalgebra).val ∈ N) + (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition (identityProjection M)) (c : Fin Q.size → ℂ), + (∀ i, (Q.piece i).val.val ∈ N) ∧ + ‖(u : M.toStarSubalgebra)-∑ i, c i • (Q.piece i).val‖ < ε := by + let uN : unitary N.toStarSubalgebra := ⟨⟨(u : M.toStarSubalgebra).val,hu⟩,by + constructor + · apply Subtype.ext + exact congrArg (fun z : M.toStarSubalgebra => z.val) u.property.1 + · apply Subtype.ext + exact congrArg (fun z : M.toStarSubalgebra => z.val) u.property.2⟩ + obtain ⟨Q,c,hc⟩ := exists_unitary_spectral_approximation uN ε hε + refine ⟨includedUnitPartition h Q,c,includedUnitPartition_mem h Q,?_⟩ + have hn : ‖algebraInclusion h ((uN : N.toStarSubalgebra)- + ∑ i,c i • (Q.piece i).val)‖=‖(uN : N.toStarSubalgebra)- + ∑ i,c i • (Q.piece i).val‖ := rfl + rw [map_sub,map_sum] at hn + simp only [map_smul] at hn + change ‖(u : M.toStarSubalgebra)-∑ i,c i • algebraInclusion h (Q.piece i).val‖ < ε + exact hn ▸ hc + +end + +/-! Finite simultaneous spectral approximation of any commuting self-adjoint +family, preserving a prior partition and the entire common commutant. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace CornerPartition + +theorem joint_preserves_commutant (Q R : CornerPartition (identityProjection M)) + (hcross : ∀ i j,Commute (Q.piece i).val (R.piece j).val) + (y : M.toStarSubalgebra) + (hQ : ∀ i,Commute (Q.piece i).val y) (hR : ∀ j,Commute (R.piece j).val y) : + ∀ k,Commute ((Q.joint R hcross).piece k).val y := by + intro k + let a := (Fintype.equivFin (Fin Q.size × Fin R.size)).symm k + exact (hQ a.1).mul_left (hR a.2) + +theorem joint_spectral_sum_left (Q R : CornerPartition (identityProjection M)) + (hcross : ∀ i j,Commute (Q.piece i).val (R.piece j).val) + (c : Fin Q.size → ℂ) : + ∃ d : Fin (Q.joint R hcross).size → ℂ, + (∑ k,d k • ((Q.joint R hcross).piece k).val)=∑ i,c i • (Q.piece i).val := by + let e := (Fintype.equivFin (Fin Q.size × Fin R.size)).symm + refine ⟨fun k => c (e k).1,?_⟩ + exact (Equiv.sum_comp e (fun a => c a.1 • (Q.jointPiece R hcross a).val)).trans + (Q.joint_sum_left R hcross c) + +theorem joint_spectral_sum_right (Q R : CornerPartition (identityProjection M)) + (hcross : ∀ i j,Commute (Q.piece i).val (R.piece j).val) + (c : Fin R.size → ℂ) : + ∃ d : Fin (Q.joint R hcross).size → ℂ, + (∑ k,d k • ((Q.joint R hcross).piece k).val)=∑ i,c i • (R.piece i).val := by + let e := (Fintype.equivFin (Fin Q.size × Fin R.size)).symm + refine ⟨fun k => c (e k).2,?_⟩ + exact (Equiv.sum_comp e (fun a => c a.2 • (Q.jointPiece R hcross a).val)).trans + (Q.joint_sum_right R hcross c) + +end CornerPartition + +theorem exists_finite_abelian_spectral_refinement {ι : Type*} + (x : ι → M.toStarSubalgebra) (hx : ∀ i,IsSelfAdjoint (x i)) + (hcomm : ∀ i j,Commute (x i) (x j)) + (Q : CornerPartition (identityProjection M)) + (hQ : ∀ y : M.toStarSubalgebra,(∀ i,Commute (x i) y) → + ∀ j,Commute (Q.piece j).val y) + (F : Finset ι) (ε : ℝ) (hε : 0 < ε) : + ∃ R : CornerPartition (identityProjection M),Q.Refines R ∧ + (∀ y : M.toStarSubalgebra,(∀ i,Commute (x i) y) → + ∀ j,Commute (R.piece j).val y) ∧ + ∀ i ∈ F,∃ c : Fin R.size → ℂ,‖x i-∑ j,c j • (R.piece j).val‖ < ε := by + classical + induction F using Finset.induction_on generalizing Q with + | empty => exact ⟨Q,Q.refines_refl,hQ,by simp⟩ + | @insert i F hiF ih => + obtain ⟨R,hQR,hR,happrox⟩ := ih Q hQ + obtain ⟨S,c,_,hS,hc⟩ := exists_finite_spectral_approximation_preserving_commutant + (identityProjection M) (x i) (hx i) ε hε + have hcross (j : Fin R.size) (k : Fin S.size) : + Commute (R.piece j).val (S.piece k).val := + (hS (R.piece j).val (hR (x i) (fun l => hcomm l i) j).symm (Commute.one_left _) k).symm + refine ⟨R.joint S hcross,Q.refines_trans hQR (R.joint_refines_left S hcross),?_,?_⟩ + · intro y hy + exact R.joint_preserves_commutant S hcross y (hR y hy) + (hS y (hy i) (Commute.one_left _)) + · intro l hl + rcases Finset.mem_insert.mp hl with rfl | hl + · obtain ⟨d,hd⟩ := R.joint_spectral_sum_right S hcross (fun j => (c j : ℂ)) + refine ⟨d,?_⟩ + rw [hd] + simpa only [show (identityProjection M).val=1 from rfl,one_mul,mul_one] using hc + · obtain ⟨a,ha⟩ := happrox l hl + obtain ⟨d,hd⟩ := R.joint_spectral_sum_left S hcross a + exact ⟨d,by rwa [hd]⟩ + +end + +/-! Finite orthogonal families can be completed to unit partitions. Refining +blocks retains explicit disjoint index sets whose sums recover those blocks. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem orthogonal_family_sum_projection {ι : Type*} [Fintype ι] + (q : ι → AlgebraProjection M) + (hq : ∀ i j, i ≠ j → (q i).val*(q j).val=0) : + IsStarProjection (∑ i,(q i).val) := by + classical + constructor + · show (∑ i,(q i).val)*(∑ i,(q i).val)=∑ i,(q i).val + rw [Finset.sum_mul] + apply Finset.sum_congr rfl + intro i _ + rw [Finset.mul_sum,Finset.sum_eq_single i] + · exact (q i).property.isIdempotentElem.eq + · intro j _ hji + exact hq i j hji.symm + · simp + · show star (∑ i,(q i).val)=∑ i,(q i).val + simp only [star_sum, (q _).property.isSelfAdjoint.star_eq] + +theorem exists_completed_orthogonal_family {ι : Type*} [Fintype ι] + (q : ι → AlgebraProjection M) + (hq : ∀ i j, i ≠ j → (q i).val*(q j).val=0) : + ∃ Q : CornerPartition (identityProjection M), + ∃ e : Option ι ≃ Fin Q.size, + (∀ i,Q.piece (e (some i))=q i) ∧ + (Q.piece (e none)).val=1-∑ i,(q i).val := by + classical + let s := ∑ i,(q i).val + have hs : IsStarProjection s := orthogonal_family_sum_projection q hq + let a : Option ι → AlgebraProjection M := fun i => + i.elim ⟨1-s,hs.one_sub⟩ q + have hleft (i : ι) : s*(q i).val=(q i).val := by + dsimp [s] + rw [Finset.sum_mul,Finset.sum_eq_single i] + · exact (q i).property.isIdempotentElem.eq + · intro j _ hji + exact hq j i hji + · simp + have hright (i : ι) : (q i).val*s=(q i).val := by + simpa only [star_mul,hs.isSelfAdjoint.star_eq, + (q i).property.isSelfAdjoint.star_eq] using congrArg star (hleft i) + have ha (i j : Option ι) (hij : i ≠ j) : (a i).val*(a j).val=0 := by + cases i with + | none => + cases j with + | none => exact (hij rfl).elim + | some j => change (1-s)*(q j).val=0; rw [sub_mul,one_mul,hleft,sub_self] + | some i => + cases j with + | none => change (q i).val*(1-s)=0; rw [mul_sub,mul_one,hright,sub_self] + | some j => exact hq i j (fun h => hij (congrArg some h)) + have ht : (∑ i,(a i).val)=(identityProjection M).val := by + rw [Fintype.sum_option] + change (1-s)+s=1 + abel + let Q := CornerPartition.ofFamily a ha ht + refine ⟨Q,Fintype.equivFin (Option ι),?_,?_⟩ + · intro i + change a ((Fintype.equivFin (Option ι)).symm + ((Fintype.equivFin (Option ι)) (some i)))=q i + rw [Equiv.symm_apply_apply] + rfl + · change (a ((Fintype.equivFin (Option ι)).symm + ((Fintype.equivFin (Option ι)) none))).val=1-s + rw [Equiv.symm_apply_apply] + rfl + +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) +variable (R : (i : Fin Q.size) → CornerPartition (Q.piece i)) + +def blockIndices (i : Fin Q.size) : Finset (Fin (Q.refineBlocks R).size) := + Finset.univ.filter fun j => + ((Fintype.equivFin ((k : Fin Q.size) × Fin (R k).size)).symm j).1=i + +theorem blockIndices_disjoint {i j : Fin Q.size} (hij : i ≠ j) : + Disjoint (Q.blockIndices R i) (Q.blockIndices R j) := by + classical + apply Finset.disjoint_left.mpr + intro k hi hj + exact hij ((Finset.mem_filter.mp hi).2.symm.trans (Finset.mem_filter.mp hj).2) + +theorem sum_blockIndices (i : Fin Q.size) : + (∑ j ∈ Q.blockIndices R i,((Q.refineBlocks R).piece j).val)=(Q.piece i).val := by + classical + rw [blockIndices,Finset.sum_filter] + let e := (Fintype.equivFin ((k : Fin Q.size) × Fin (R k).size)).symm + change (∑ j,if (e j).1=i then ((R (e j).1).piece (e j).2).val else 0)=_ + rw [Equiv.sum_comp e (fun a => if a.1=i then ((R a.1).piece a.2).val else 0), + Fintype.sum_sigma] + simp only [Finset.sum_ite_irrel,Finset.sum_const_zero,(R _).total] + simp + +end CornerPartition + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/SpectralDimension.lean b/lean/OAI/Analysis/FactorGeneration/SpectralDimension.lean new file mode 100644 index 0000000000000000000000000000000000000000..f3e84dd3e365b3293ec1dc5c1826b7e0e60a95a4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/SpectralDimension.lean @@ -0,0 +1,500 @@ +import OAI.Analysis.FactorGeneration.NormalDimension +import OAI.Analysis.FactorGeneration.SpectralApproximation + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Finite spectral weights of the constructed projection dimension obey an +operator-norm bound. No linear trace on noncommuting elements is assumed. -/ +section +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +include hfinite in +theorem traceFreeDimension_finsetSum + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} (q : I → AlgebraProjection M) (s : Finset I) + (ho : ∀ i ∈ s, ∀ j ∈ s, i≠j → (q i).val*(q j).val=0) : + traceFreeDimension hfactor hdiff (AlgebraProjection.finsetSum q s ho)= + ∑ i ∈ s, traceFreeDimension hfactor hdiff (q i) := by + classical + induction s using Finset.induction_on with + | empty => + have hz : (AlgebraProjection.finsetSum q ∅ ho).val=0 := by simp [AlgebraProjection.finsetSum] + simpa only [Finset.sum_empty,traceFreeDimension] using traceFreeDyadicSup_zero hfactor hdiff + ⟨1,IsStarProjection.one _⟩ _ hunit hz + | @insert i s hi ih => + have hos : ∀ j ∈ s, ∀ k ∈ s, j≠k → (q j).val*(q k).val=0 := + fun j hj k hk => ho j (Finset.mem_insert_of_mem hj) k (Finset.mem_insert_of_mem hk) + let r := AlgebraProjection.finsetSum q s hos + have hqr : (q i).val*r.val=0 := by + change (q i).val*(∑ j ∈ s, (q j).val)=0 + rw [Finset.mul_sum] + exact Finset.sum_eq_zero (fun j hj => ho i (Finset.mem_insert_self _ _) j + (Finset.mem_insert_of_mem hj) (fun he => hi (he.symm ▸ hj))) + have he : AlgebraProjection.finsetSum q (insert i s) ho=orthogonalSum (q i) r hqr := by + apply Subtype.ext + exact Finset.sum_insert hi + rw [he,Finset.sum_insert hi] + have hadd := traceFreeDyadicSup_orthogonal_add hfactor hdiff hfinite + ⟨1,IsStarProjection.one _⟩ (q i) r hunit (one_mul _) (one_mul _) hqr + change traceFreeDimension hfactor hdiff (orthogonalSum (q i) r hqr)= + traceFreeDimension hfactor hdiff (q i)+traceFreeDimension hfactor hdiff r at hadd + rw [hadd,ih hos] + +include hfinite in +theorem traceFreeDimension_sum_of_total + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Fintype I] (q : I → AlgebraProjection M) + (ho : ∀ i j, i≠j → (q i).val*(q j).val=0) + (p : AlgebraProjection M) (hp : ∑ i, (q i).val=p.val) : + ∑ i, traceFreeDimension hfactor hdiff (q i)=traceFreeDimension hfactor hdiff p := by + classical + have he : AlgebraProjection.finsetSum q Finset.univ (fun i _ j _ => ho i j)=p := Subtype.ext hp + rw [← he] + exact (traceFreeDimension_finsetSum hfactor hdiff hfinite hunit q Finset.univ _).symm + +include hfinite in +/-- A finite orthogonal spectral value has the required operator-norm bound. -/ +theorem traceFreeDimension_spectralWeight_norm_le + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Fintype I] (q : I → AlgebraProjection M) + (ho : ∀ i j, i≠j → (q i).val*(q j).val=0) (c : I → ℂ) : + ‖∑ i, c i*(traceFreeDimension hfactor hdiff (q i) : ℂ)‖ ≤ + ‖∑ i, c i • (q i).val‖ := by + classical + let a : M.toStarSubalgebra := ∑ i, c i • (q i).val + have hpiece (i : I) : a*(q i).val=c i • (q i).val := by + dsimp [a] + rw [Finset.sum_mul] + apply (Finset.sum_eq_single i ?_ ?_).trans + (by rw [smul_mul_assoc,(q i).property.isIdempotentElem.eq]) + · intro j _ hji + rw [smul_mul_assoc,ho j i hji,smul_zero] + · intro h; exact (h (Finset.mem_univ i)).elim + have hterm (i : I) : ‖c i*(traceFreeDimension hfactor hdiff (q i) : ℂ)‖ ≤ + ‖a‖*traceFreeDimension hfactor hdiff (q i) := by + by_cases hz : (q i).val=0 + · have hD := traceFreeDyadicSup_zero hfactor hdiff ⟨1,IsStarProjection.one _⟩ (q i) hunit hz + change traceFreeDimension hfactor hdiff (q i)=0 at hD + simp only [hD,Complex.ofReal_zero,mul_zero,norm_zero,le_refl] + · have hnorm := norm_mul_le a (q i).val + rw [hpiece i,norm_smul] at hnorm + have hpos : 0 < ‖(q i).val‖ := norm_pos_iff.mpr hz + have hci : ‖c i‖ ≤ ‖a‖ := by nlinarith + rw [norm_mul,Complex.norm_real,Real.norm_of_nonneg (traceFreeDimension_nonneg hfactor hdiff _)] + exact mul_le_mul_of_nonneg_right hci (traceFreeDimension_nonneg hfactor hdiff _) + have hdim : (∑ i, traceFreeDimension hfactor hdiff (q i)) ≤ 1 := by + rw [← traceFreeDimension_finsetSum hfactor hdiff hfinite hunit q Finset.univ + (fun i _ j _ => ho i j)] + exact traceFreeDimension_le_one hfactor hdiff _ + calc + ‖∑ i, c i*(traceFreeDimension hfactor hdiff (q i) : ℂ)‖ ≤ + ∑ i, ‖c i*(traceFreeDimension hfactor hdiff (q i) : ℂ)‖ := norm_sum_le _ _ + _ ≤ ∑ i, ‖a‖*traceFreeDimension hfactor hdiff (q i) := Finset.sum_le_sum (fun i _ => hterm i) + _ = ‖a‖*(∑ i, traceFreeDimension hfactor hdiff (q i)) := (Finset.mul_sum _ _ _).symm + _ ≤ ‖a‖ := by nlinarith [norm_nonneg a] + +include hfinite in +/-- In a fixed orthogonal partition, the spectral-value map is contractive. -/ +theorem traceFreeDimension_spectralWeight_sub_norm_le + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + {I : Type*} [Fintype I] (q : I → AlgebraProjection M) + (ho : ∀ i j, i≠j → (q i).val*(q j).val=0) (c d : I → ℂ) : + ‖(∑ i, c i*(traceFreeDimension hfactor hdiff (q i) : ℂ))- + (∑ i, d i*(traceFreeDimension hfactor hdiff (q i) : ℂ))‖ ≤ + ‖(∑ i, c i • (q i).val)-(∑ i, d i • (q i).val)‖ := by + simpa only [sub_mul,sub_smul,Finset.sum_sub_distrib] using + traceFreeDimension_spectralWeight_norm_le hfactor hdiff hfinite hunit q ho (fun i => c i-d i) + +/-! Spectral dimension weights agree under common commuting refinements. +Contractivity is proved for two commuting partitions, not noncommuting inputs. -/ +namespace CornerPartition +variable {p : AlgebraProjection M} (Q R : CornerPartition p) +variable (hc : ∀ i j, Commute (Q.piece i).val (R.piece j).val) + +include hfinite in +theorem dimension_joint_row (hunit : (1 : M.toStarSubalgebra) ≠ 0) (i : Fin Q.size) : + ∑ j, traceFreeDimension hfactor hdiff (Q.jointPiece R hc (i,j))= + traceFreeDimension hfactor hdiff (Q.piece i) := by + apply traceFreeDimension_sum_of_total hfactor hdiff hfinite hunit + (fun j => Q.jointPiece R hc (i,j)) + (fun j k hjk => Q.jointPiece_orthogonal R hc (i,j) (i,k) (fun h => hjk (congrArg Prod.snd h))) + change (∑ j, (Q.piece i).val*(R.piece j).val)=(Q.piece i).val + rw [← Finset.mul_sum,R.total,projection_mul_of_le (Q.piece_le i)] + +include hfinite in +theorem dimension_joint_column (hunit : (1 : M.toStarSubalgebra) ≠ 0) (j : Fin R.size) : + ∑ i, traceFreeDimension hfactor hdiff (Q.jointPiece R hc (i,j))= + traceFreeDimension hfactor hdiff (R.piece j) := by + apply traceFreeDimension_sum_of_total hfactor hdiff hfinite hunit + (fun i => Q.jointPiece R hc (i,j)) + (fun i k hik => Q.jointPiece_orthogonal R hc (i,j) (k,j) (fun h => hik (congrArg Prod.fst h))) + change (∑ i, (Q.piece i).val*(R.piece j).val)=(R.piece j).val + rw [← Finset.sum_mul,Q.total] + exact R.piece_le j + +include hfinite in +theorem dimension_weight_joint_left (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (c : Fin Q.size → ℂ) : + (∑ a : Fin Q.size × Fin R.size, + c a.1*(traceFreeDimension hfactor hdiff (Q.jointPiece R hc a) : ℂ))= + ∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ) := by + rw [Fintype.sum_prod_type] + apply Finset.sum_congr rfl + intro i _ + dsimp only + rw [← Finset.mul_sum,← Complex.ofReal_sum,dimension_joint_row hfactor hdiff hfinite Q R hc hunit] + +include hfinite in +theorem dimension_weight_joint_right (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (c : Fin R.size → ℂ) : + (∑ a : Fin Q.size × Fin R.size, + c a.2*(traceFreeDimension hfactor hdiff (Q.jointPiece R hc a) : ℂ))= + ∑ i, c i*(traceFreeDimension hfactor hdiff (R.piece i) : ℂ) := by + rw [Fintype.sum_prod_type,Finset.sum_comm] + apply Finset.sum_congr rfl + intro j _ + dsimp only + rw [← Finset.mul_sum,← Complex.ofReal_sum,dimension_joint_column hfactor hdiff hfinite Q R hc hunit] + +include hfinite hc in +/-- Changing between two commuting partitions preserves the norm estimate. -/ +theorem dimension_weight_cross_norm_le (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (c : Fin Q.size → ℂ) (d : Fin R.size → ℂ) : + ‖(∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ))- + (∑ j, d j*(traceFreeDimension hfactor hdiff (R.piece j) : ℂ))‖ ≤ + ‖(∑ i, c i • (Q.piece i).val)-(∑ j, d j • (R.piece j).val)‖ := by + have h := traceFreeDimension_spectralWeight_sub_norm_le hfactor hdiff hfinite hunit + (Q.jointPiece R hc) (Q.jointPiece_orthogonal R hc) (fun a => c a.1) (fun a => d a.2) + rwa [Q.dimension_weight_joint_left hfactor hdiff hfinite R hc hunit c, + Q.dimension_weight_joint_right hfactor hdiff hfinite R hc hunit d, + Q.joint_sum_left R hc c,Q.joint_sum_right R hc d] at h + +include hfinite hc in +theorem dimension_weight_eq_of_commuting_sums_eq (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (c : Fin Q.size → ℂ) (d : Fin R.size → ℂ) + (he : (∑ i, c i • (Q.piece i).val)=(∑ j, d j • (R.piece j).val)) : + (∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ))= + (∑ j, d j*(traceFreeDimension hfactor hdiff (R.piece j) : ℂ)) := by + have h := Q.dimension_weight_cross_norm_le hfactor hdiff hfinite R hc hunit c d + rw [he,sub_self,norm_zero] at h + exact sub_eq_zero.mp (norm_eq_zero.mp (le_antisymm h (norm_nonneg _))) + +end CornerPartition + +end + +/-! Construct the unique real spectral dimension value of each self-adjoint +operator by norm approximation. Global noncommuting additivity is not asserted. -/ +section +open Filter +open scoped BigOperators Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +/-- Approximation specification, not an assumed linear trace. -/ +def IsDimensionSpectralValue (x : M.toStarSubalgebra) (t : ℂ) : Prop := + ∀ (Q : CornerPartition ⟨1,IsStarProjection.one _⟩) (c : Fin Q.size → ℂ), + (∀ i, Commute (Q.piece i).val x) → + ‖t-∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)‖ ≤ + ‖x-∑ i, c i • (Q.piece i).val‖ + +include hfinite in +/-- Actual finite spectral approximants are Cauchy in their dimension values, +and their real limit controls every commuting spectral approximation. -/ +theorem traceFreeDimension_exists_spectral_value + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + ∃ t : ℂ, t.im=0 ∧ IsDimensionSpectralValue hfactor hdiff x t := by + classical + have happrox (n : ℕ) : + ∃ (Q : CornerPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M)) + (c : Fin Q.size → ℝ), + (∀ y : M.toStarSubalgebra, Commute x y → ∀ i, Commute (Q.piece i).val y) ∧ + ‖x-∑ i, (c i : ℂ) • (Q.piece i).val‖ < 1/2^n := by + obtain ⟨Q,c,_,hQ,herr⟩ := exists_finite_spectral_approximation_preserving_commutant + ⟨1,IsStarProjection.one _⟩ x hx (1/2^n) (by positivity) + exact ⟨Q,c,fun y hy => hQ y hy (Commute.one_left y),by simpa only [one_mul,mul_one] using herr⟩ + choose Q c hQ herr using happrox + let f (n : ℕ) : ℂ := ∑ i, (c n i : ℂ)*(traceFreeDimension hfactor hdiff ((Q n).piece i) : ℂ) + let a (n : ℕ) : M.toStarSubalgebra := ∑ i, (c n i : ℂ) • ((Q n).piece i).val + have hbound (n : ℕ) (R : CornerPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M)) + (d : Fin R.size → ℂ) (hR : ∀ j, Commute (R.piece j).val x) : + ‖f n-∑ j, d j*(traceFreeDimension hfactor hdiff (R.piece j) : ℂ)‖ ≤ + 1/2^n+‖x-∑ j, d j • (R.piece j).val‖ := by + have hc (i : Fin (Q n).size) (j : Fin R.size) : + Commute ((Q n).piece i).val (R.piece j).val := hQ n _ (hR j).symm i + have h := (Q n).dimension_weight_cross_norm_le hfactor hdiff hfinite R hc hunit + (fun i => (c n i : ℂ)) d + refine h.trans ?_ + have htri := dist_triangle (a n) x (∑ j, d j • (R.piece j).val) + simp only [dist_eq_norm] at htri + rw [norm_sub_rev (a n) x] at htri + exact htri.trans (add_le_add (herr n).le le_rfl) + have heps : Tendsto (fun n : ℕ => (1 : ℝ)/2^n) atTop (𝓝 0) := by + simpa only [one_div_pow] using tendsto_pow_atTop_nhds_zero_of_lt_one + (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num : (1/2 : ℝ)<1) + have hf : CauchySeq f := by + apply Metric.cauchySeq_iff.mpr + intro ε hε + obtain ⟨N,hN⟩ := eventually_atTop.mp (heps.eventually (gt_mem_nhds (half_pos hε))) + refine ⟨N,?_⟩ + intro m hm n hn + rw [dist_eq_norm] + have h := hbound m (Q n) (fun i => (c n i : ℂ)) (hQ n x (Commute.refl x)) + have he := herr n + have hm' := hN m hm + have hn' := hN n hn + change ‖f m-f n‖ ≤ _ at h + linarith + obtain ⟨t,ht⟩ := cauchySeq_tendsto_of_complete hf + have him (n : ℕ) : (f n).im=0 := by simp [f] + refine ⟨t,?_,?_⟩ + · have hi := Complex.continuous_im.tendsto t |>.comp ht + exact tendsto_nhds_unique hi (by + change Tendsto (fun n => (f n).im) atTop (𝓝 0) + simpa only [him] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (𝓝 0))) + · intro R d hR + apply le_of_tendsto_of_tendsto' ((ht.sub_const _).norm) + (by simpa only [zero_add] using heps.add_const ‖x-∑ j, d j • (R.piece j).val‖) + exact fun n => hbound n R d hR + +theorem IsDimensionSpectralValue.unique + {x : M.toStarSubalgebra} (hx : IsSelfAdjoint x) {s t : ℂ} + (hs : IsDimensionSpectralValue hfactor hdiff x s) + (ht : IsDimensionSpectralValue hfactor hdiff x t) : s=t := by + apply sub_eq_zero.mp + apply norm_eq_zero.mp + apply eq_of_all_dyadic_errors + intro n + obtain ⟨Q,c,_,hQ,herr⟩ := exists_finite_spectral_approximation_preserving_commutant + ⟨1,IsStarProjection.one _⟩ x hx (1/2^n) (by positivity) + have hcomm := hQ x (Commute.refl x) (Commute.one_left x) + have hs' := hs Q (fun i => (c i : ℂ)) hcomm + have ht' := ht Q (fun i => (c i : ℂ)) hcomm + simp only [one_mul,mul_one] at herr + let w : ℂ := ∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ) + have htri := dist_triangle s w t + simp only [dist_eq_norm] at htri + rw [norm_sub_rev w t] at htri + dsimp only [w] at htri + have hnorm : ‖s-t‖ ≤ 2/2^n := by + rw [show (2 : ℝ)/2^n=2*(1/2^n) by ring] + linarith + simpa only [sub_zero,abs_of_nonneg (norm_nonneg _)] using hnorm + +/-- This is a constructed scalar value on self-adjoint operators; it is not +yet packaged as a linear functional. -/ +def dimensionSpectralValue (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : ℂ := + (traceFreeDimension_exists_spectral_value hfactor hdiff hfinite hunit x hx).choose + +theorem dimensionSpectralValue_spec (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx).im=0 ∧ + IsDimensionSpectralValue hfactor hdiff x + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx) := + (traceFreeDimension_exists_spectral_value hfactor hdiff hfinite hunit x hx).choose_spec + +end + +/-! The constructed spectral value is bounded and extends the actual +projection dimension. These laws do not assert noncommuting additivity. -/ +section +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem IsDimensionSpectralValue.norm_le {x : M.toStarSubalgebra} {t : ℂ} + (ht : IsDimensionSpectralValue hfactor hdiff x t) : ‖t‖ ≤ ‖x‖ := by + have h := ht (CornerPartition.single ⟨1,IsStarProjection.one _⟩) (fun _ => 0) + (fun _ => Commute.one_left x) + simpa only [zero_mul,zero_smul,Finset.sum_const_zero,sub_zero] using h + +theorem IsDimensionSpectralValue.on_projection (p : AlgebraProjection M) {t : ℂ} + (ht : IsDimensionSpectralValue hfactor hdiff p.val t) : + t=(traceFreeDimension hfactor hdiff p : ℂ) := by + classical + let r : AlgebraProjection M := ⟨1-p.val,p.property.one_sub⟩ + let a (b : Bool) : AlgebraProjection M := if b then r else p + have hpr : p.val*r.val=0 := by + change p.val*(1-p.val)=0 + rw [mul_sub,mul_one,p.property.isIdempotentElem.eq,sub_self] + have ho (b c : Bool) (hbc : b≠c) : (a b).val*(a c).val=0 := by + cases b <;> cases c + · exact (hbc rfl).elim + · exact hpr + · exact PartialIsometry.orthogonal_reverse p r hpr + · exact (hbc rfl).elim + have ha : (∑ b : Bool, (a b).val)=(1 : M.toStarSubalgebra) := by + change (∑ b : Bool, (if b then r else p).val)=1 + simp only [Fintype.sum_bool,ite_true,Bool.false_eq_true,ite_false] + change (1-p.val)+p.val=1 + abel + let Q : CornerPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M) := + CornerPartition.ofFamily a ho ha + let e : Fin Q.size ≃ Bool := (Fintype.equivFin Bool).symm + let c (i : Fin Q.size) : ℂ := if e i then 0 else 1 + have hQ (i : Fin Q.size) : Commute (Q.piece i).val p.val := by + change Commute (a (e i)).val p.val + cases h : e i + · exact Commute.refl p.val + · exact (Commute.one_left p.val).sub_left (Commute.refl p.val) + have hs : (∑ i, c i • (Q.piece i).val)=p.val := by + change (∑ i, (if e i then (0 : ℂ) else 1) • (a (e i)).val)=p.val + exact (Equiv.sum_comp e (fun b : Bool => (if b then (0 : ℂ) else 1) • (a b).val)).trans + (by simp [a]) + have hw : (∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ))= + (traceFreeDimension hfactor hdiff p : ℂ) := by + change (∑ i, (if e i then (0 : ℂ) else 1)* + (traceFreeDimension hfactor hdiff (a (e i)) : ℂ))=_ + exact (Equiv.sum_comp e (fun b : Bool => (if b then (0 : ℂ) else 1)* + (traceFreeDimension hfactor hdiff (a b) : ℂ))).trans (by simp [a]) + have h := ht Q c hQ + rw [hs,sub_self,norm_zero] at h + exact (sub_eq_zero.mp (norm_eq_zero.mp (le_antisymm h (norm_nonneg _)))).trans hw + +theorem dimensionSpectralValue_norm_le (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + ‖dimensionSpectralValue hfactor hdiff hfinite hunit x hx‖ ≤ ‖x‖ := + (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx).2.norm_le hfactor hdiff + +theorem dimensionSpectralValue_projection (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (p : AlgebraProjection M) : + dimensionSpectralValue hfactor hdiff hfinite hunit p.val p.property.isSelfAdjoint= + (traceFreeDimension hfactor hdiff p : ℂ) := + (dimensionSpectralValue_spec hfactor hdiff hfinite hunit p.val p.property.isSelfAdjoint).2.on_projection + hfactor hdiff p + +theorem dimensionSpectralValue_one (hunit : (1 : M.toStarSubalgebra) ≠ 0) : + dimensionSpectralValue hfactor hdiff hfinite hunit 1 (IsSelfAdjoint.one _)=1 := by + rw [dimensionSpectralValue_projection hfactor hdiff hfinite hunit ⟨1,IsStarProjection.one _⟩] + exact congrArg Complex.ofReal (traceFreeDyadicSup_self hfactor hdiff ⟨1,IsStarProjection.one _⟩) + +end + +/-! Finite-family tests and real homogeneity for the constructed spectral value. +These statements do not assert additivity for noncommuting operators. -/ +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem IsDimensionSpectralValue.family_bound {x : M.toStarSubalgebra} {t : ℂ} + (ht : IsDimensionSpectralValue hfactor hdiff x t) + {I : Type*} [Fintype I] (q : I → AlgebraProjection M) + (ho : ∀ i j, i≠j → (q i).val*(q j).val=0) + (hs : ∑ i, (q i).val=(1 : M.toStarSubalgebra)) + (c : I → ℂ) (hc : ∀ i, Commute (q i).val x) : + ‖t-∑ i, c i*(traceFreeDimension hfactor hdiff (q i) : ℂ)‖ ≤ + ‖x-∑ i, c i • (q i).val‖ := by + classical + let Q : CornerPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M) := + CornerPartition.ofFamily q ho hs + let e : Fin Q.size ≃ I := (Fintype.equivFin I).symm + have h := ht Q (fun i => c (e i)) (fun i => hc (e i)) + change ‖t-∑ i, c (e i)*(traceFreeDimension hfactor hdiff (q (e i)) : ℂ)‖ ≤ + ‖x-∑ i, c (e i) • (q (e i)).val‖ at h + rw [Equiv.sum_comp e (fun i => c i*(traceFreeDimension hfactor hdiff (q i) : ℂ)), + Equiv.sum_comp e (fun i => c i • (q i).val)] at h + exact h + +theorem dimensionSpectralValue_eq_of_approximants + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (t : ℂ) + (h : ∀ ε : ℝ, 0 < ε → + ∃ (Q : CornerPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M)) + (c : Fin Q.size → ℂ), + (∀ i, Commute (Q.piece i).val x) ∧ + ‖x-∑ i, c i • (Q.piece i).val‖ < ε ∧ + ‖t-∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)‖ < ε) : + dimensionSpectralValue hfactor hdiff hfinite hunit x hx=t := by + apply sub_eq_zero.mp + apply norm_eq_zero.mp + apply le_antisymm ?_ (norm_nonneg _) + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨Q,c,hc,hxerr,hterr⟩ := h (ε/2) (half_pos hε) + have hxval := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx).2 Q c hc + have htri := dist_triangle + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx) + (∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)) t + simp only [dist_eq_norm] at htri + rw [norm_sub_rev (∑ i, c i*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)) t] at htri + linarith + +theorem dimensionSpectralValue_real_smul + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (r : ℝ) (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + dimensionSpectralValue hfactor hdiff hfinite hunit (r • x) ((IsSelfAdjoint.all r).smul hx)= + (r : ℂ)*dimensionSpectralValue hfactor hdiff hfinite hunit x hx := by + apply dimensionSpectralValue_eq_of_approximants hfactor hdiff hfinite hunit + intro ε hε + have hr : 0 < ‖r‖+1 := by positivity + obtain ⟨Q,c,_,hQ,herr⟩ := exists_finite_spectral_approximation_preserving_commutant + ⟨1,IsStarProjection.one _⟩ x hx (ε/(‖r‖+1)) (div_pos hε hr) + simp only [one_mul,mul_one] at herr + have hc := hQ x (Commute.refl x) (Commute.one_left x) + have hval := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx).2 + Q (fun i => (c i : ℂ)) hc + have hb : ‖r‖*(ε/(‖r‖+1)) < ε := by + have hh := (div_pos hε hr) + have he : (‖r‖+1)*(ε/(‖r‖+1))=ε := mul_div_cancel₀ _ (ne_of_gt hr) + nlinarith + refine ⟨Q,fun i => (r : ℂ)*(c i : ℂ),?_,?_,?_⟩ + · intro i + show (Q.piece i).val*(r • x)=(r • x)*(Q.piece i).val + rw [mul_smul_comm,smul_mul_assoc,(hc i).eq] + · have he : (r • x)-∑ i, ((r : ℂ)*(c i : ℂ)) • (Q.piece i).val= + r • (x-∑ i, (c i : ℂ) • (Q.piece i).val) := by + simp only [smul_sub,Finset.smul_sum,← smul_assoc,Complex.real_smul] + rw [he,norm_smul] + exact (mul_le_mul_of_nonneg_left herr.le (norm_nonneg r)).trans_lt hb + · rw [show (∑ i, ((r : ℂ)*(c i : ℂ))*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ))= + (r : ℂ)*(∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)) by + rw [Finset.mul_sum]; simp only [mul_assoc],← mul_sub,norm_mul,Complex.norm_real] + exact (mul_le_mul_of_nonneg_left (hval.trans herr.le) (norm_nonneg r)).trans_lt hb + +theorem dimensionSpectralValue_zero (hunit : (1 : M.toStarSubalgebra) ≠ 0) : + dimensionSpectralValue hfactor hdiff hfinite hunit 0 (IsSelfAdjoint.zero _)=0 := by + have h := dimensionSpectralValue_norm_le hfactor hdiff hfinite hunit 0 (IsSelfAdjoint.zero _) + rw [norm_zero] at h + exact norm_eq_zero.mp (le_antisymm h (norm_nonneg _)) + +theorem dimensionSpectralValue_neg (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + dimensionSpectralValue hfactor hdiff hfinite hunit (-x) hx.neg= + -dimensionSpectralValue hfactor hdiff hfinite hunit x hx := by + simpa only [neg_one_smul,Complex.ofReal_neg,Complex.ofReal_one,neg_one_mul] using + dimensionSpectralValue_real_smul hfactor hdiff hfinite hunit (-1) x hx + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/SpectralPinching.lean b/lean/OAI/Analysis/FactorGeneration/SpectralPinching.lean new file mode 100644 index 0000000000000000000000000000000000000000..8e0c43a543cfd5521c1a19c2ab909954ab54bb21 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/SpectralPinching.lean @@ -0,0 +1,649 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Commute +import OAI.Analysis.FactorGeneration.Pinching +import OAI.Analysis.FactorGeneration.Supports + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Actual sign splitting inside a prescribed residual corner. -/ +section +open scoped CStarAlgebra BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance cornerCutCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance cornerCutOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance cornerCutPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance cornerCutLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance cornerCutStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +/-- Functional calculus positive parts retain a given right support. -/ +theorem positivePart_right_support (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) + (p : AlgebraProjection M) (hp : x*p.val=x) : x⁺*p.val=x⁺ := by + have he : x⁺*(1-p.val)=x⁻*(1-p.val) := by + apply sub_eq_zero.mp + rw [← sub_mul,CFC.posPart_sub_negPart x hx,mul_sub,mul_one,hp,sub_self] + have hz : star (x⁺*(1-p.val))*(x⁺*(1-p.val))=0 := by + nth_rw 2 [he] + rw [star_mul,star_sub,star_one,p.property.isSelfAdjoint.star_eq, + (CFC.posPart_nonneg x).isSelfAdjoint.star_eq] + calc (1-p.val)*x⁺*(x⁻*(1-p.val)) = (1-p.val)*(x⁺*x⁻)*(1-p.val) := by + simp only [mul_assoc] + _ = 0 := by rw [CFC.posPart_mul_negPart,mul_zero,zero_mul] + have h := (CStarRing.star_mul_self_eq_zero_iff _).mp hz + rw [mul_sub,mul_one,sub_eq_zero] at h + exact h.symm + +theorem positiveSupport_le_corner (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) + (p : AlgebraProjection M) (hp : x*p.val=x) : positiveSupport x ≤ p := by + apply (rangeProjection_le_iff _ p).mpr + have h := congrArg star (positivePart_right_support x hx p hp) + simpa only [star_mul,p.property.isSelfAdjoint.star_eq, + (CFC.posPart_nonneg x).isSelfAdjoint.star_eq] using h + +def cornerSpectralShift (p : AlgebraProjection M) (x : M.toStarSubalgebra) (t : ℝ) : + M.toStarSubalgebra := p.val*x*p.val-(t : ℂ) • p.val + +theorem cornerSpectralShift_selfAdjoint (p : AlgebraProjection M) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (t : ℝ) : + IsSelfAdjoint (cornerSpectralShift p x t) := by + change star (p.val*x*p.val-(t : ℂ) • p.val) = _ + simp only [cornerSpectralShift,star_sub,star_mul,star_smul,p.property.isSelfAdjoint.star_eq,hx.star_eq, + Complex.star_def,Complex.conj_ofReal,mul_assoc] + +theorem cornerSpectralShift_support (p : AlgebraProjection M) (x : M.toStarSubalgebra) (t : ℝ) : + cornerSpectralShift p x t*p.val=cornerSpectralShift p x t := by + simp only [cornerSpectralShift,sub_mul,smul_mul_assoc,mul_assoc,p.property.isIdempotentElem.eq] + +def cornerSpectralCut (p : AlgebraProjection M) (x : M.toStarSubalgebra) (t : ℝ) : + AlgebraProjection M := positiveSupport (cornerSpectralShift p x t) + +theorem cornerSpectralCut_le (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (t : ℝ) : cornerSpectralCut p x t ≤ p := + positiveSupport_le_corner _ (cornerSpectralShift_selfAdjoint p x hx t) p + (cornerSpectralShift_support p x t) + +namespace CornerPartition +/-- Splitting p at an explicitly given subprojection q. -/ +def binary (p q : AlgebraProjection M) (hq : q ≤ p) : CornerPartition p := + ofFamily (fun b : Bool => if b then q else + ⟨p.val-q.val,q.property.sub_of_mul_eq_right p.property hq⟩) + (by + intro i j hij + cases i <;> cases j + · exact (hij rfl).elim + · change (p.val-q.val)*q.val=0 + rw [sub_mul,hq,q.property.isIdempotentElem.eq,sub_self] + · change q.val*(p.val-q.val)=0 + rw [mul_sub,projection_mul_of_le hq,q.property.isIdempotentElem.eq,sub_self] + · exact (hij rfl).elim) + (by + rw [Fintype.sum_bool] + change q.val+(p.val-q.val)=p.val + abel) + +theorem binary_pinch (p q : AlgebraProjection M) (hq : q ≤ p) (x : M.toStarSubalgebra) : + (binary p q hq).pinch x = q.val*x*q.val+(p.val-q.val)*x*(p.val-q.val) := by + rw [binary,ofFamily_pinch,Fintype.sum_bool] + rfl + +end CornerPartition + +/-- The finite corner partition constructed from the shifted positive part. -/ +def cornerSpectralPartition (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (t : ℝ) : CornerPartition p := + CornerPartition.binary p (cornerSpectralCut p x t) (cornerSpectralCut_le p x hx t) + +/-- Its high block has the promised spectral lower bound. -/ +theorem cornerSpectralCut_lower (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (t : ℝ) : + 0 ≤ (cornerSpectralCut p x t).val*x*(cornerSpectralCut p x t).val - + (t : ℂ) • (cornerSpectralCut p x t).val := by + have hc := positiveSupport_compression (cornerSpectralShift p x t) + (cornerSpectralShift_selfAdjoint p x hx t) + have hqp := cornerSpectralCut_le p x hx t + have hleft : p.val*(cornerSpectralCut p x t).val=(cornerSpectralCut p x t).val := hqp + have he : (cornerSpectralCut p x t).val * cornerSpectralShift p x t * + (cornerSpectralCut p x t).val = + (cornerSpectralCut p x t).val*x*(cornerSpectralCut p x t).val - + (t : ℂ) • (cornerSpectralCut p x t).val := by + simp only [cornerSpectralShift,mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc] + simp only [← mul_assoc,projection_mul_of_le hqp] + simp only [mul_assoc,hleft,(cornerSpectralCut p x t).property.isIdempotentElem.eq] + rw [← he] + exact hc.symm ▸ CFC.posPart_nonneg _ + +/-- The low block has the opposite shifted sign in the same corner. -/ +theorem cornerSpectralCut_upper (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (t : ℝ) : + let r := p.val-(cornerSpectralCut p x t).val + r*x*r-(t : ℂ) • r ≤ 0 := by + let q := cornerSpectralCut p x t + let r : AlgebraProjection M := ⟨p.val-q.val,q.property.sub_of_mul_eq_right p.property + (cornerSpectralCut_le p x hx t)⟩ + have hrp : r ≤ p := by + change p.val*(p.val-q.val)=p.val-q.val + rw [mul_sub,p.property.isIdempotentElem.eq,cornerSpectralCut_le p x hx t] + have hrleft : p.val*r.val=r.val := hrp + have hs := cornerSpectralShift_support p x t + have hsl : p.val*cornerSpectralShift p x t=cornerSpectralShift p x t := by + have h := congrArg star hs + simpa only [star_mul,p.property.isSelfAdjoint.star_eq, + (cornerSpectralShift_selfAdjoint p x hx t).star_eq] using h + have hc : r.val*cornerSpectralShift p x t*r.val = -(cornerSpectralShift p x t)⁻ := by + change (p.val-q.val)*cornerSpectralShift p x t*(p.val-q.val)=_ + have he : (p.val-q.val)*cornerSpectralShift p x t*(p.val-q.val) = + (1-q.val)*cornerSpectralShift p x t*(1-q.val) := by + simp only [sub_mul,mul_sub,one_mul,mul_one,hsl,hs,mul_assoc] + rw [he] + exact positiveSupport_complement_compression _ (cornerSpectralShift_selfAdjoint p x hx t) + have he : r.val*cornerSpectralShift p x t*r.val=r.val*x*r.val-(t : ℂ) • r.val := by + simp only [cornerSpectralShift,mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc] + simp only [← mul_assoc,projection_mul_of_le hrp] + simp only [mul_assoc,hrleft,r.property.isIdempotentElem.eq] + change r.val*x*r.val-(t : ℂ) • r.val ≤ 0 + rw [← he,hc] + exact neg_nonpos.mpr (CFC.negPart_nonneg _) + +end + +/-! The constructed spectral splitting preserves the compressed operator. +This is distinct from using that splitting to reduce other operators' energy. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace CornerPartition + +theorem binary_pinch_of_commutes (p q : AlgebraProjection M) (hq : q ≤ p) + (x : M.toStarSubalgebra) (hl : p.val*x=x) (hr : x*p.val=x) + (hc : q.val*x=x*q.val) : (binary p q hq).pinch x=x := by + have hqq : q.val*x*q.val=q.val*x := by + rw [hc,mul_assoc,q.property.isIdempotentElem.eq] + rw [binary_pinch] + simp only [sub_mul,mul_sub,hl,hr,hqq] + rw [hc] + simp only [mul_assoc,projection_mul_of_le hq] + abel + +end CornerPartition + +theorem cornerSpectralCut_commutes (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (t : ℝ) : + (cornerSpectralCut p x t).val*(p.val*x*p.val)= + (p.val*x*p.val)*(cornerSpectralCut p x t).val := by + let q := cornerSpectralCut p x t + have h := (positiveSupport_commutes (cornerSpectralShift p x t) + (cornerSpectralShift_selfAdjoint p x hx t)).eq + change q.val*(p.val*x*p.val-(t : ℂ) • p.val) = + (p.val*x*p.val-(t : ℂ) • p.val)*q.val at h + have hqp := cornerSpectralCut_le p x hx t + have hleft : p.val*q.val=q.val := hqp + have hright : q.val*p.val=q.val := projection_mul_of_le hqp + simp only [mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc, + hright,hleft] at h + exact sub_left_inj.mp h + +theorem cornerSpectralPartition_pinch (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (t : ℝ) : + (cornerSpectralPartition p x hx t).pinch x=p.val*x*p.val := by + rw [← (cornerSpectralPartition p x hx t).pinch_corner_compression] + apply CornerPartition.binary_pinch_of_commutes + · simp only [← mul_assoc,p.property.isIdempotentElem.eq] + · simp only [mul_assoc,p.property.isIdempotentElem.eq] + · exact cornerSpectralCut_commutes p x hx t + +end + +/-! Interval bounds propagated through constructed spectral corner splits. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance intervalCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance intervalOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance intervalPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance intervalLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance intervalStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem compress_scalar_shift {p q : AlgebraProjection M} (hqp : q ≤ p) + (x : M.toStarSubalgebra) (t : ℝ) : + q.val*(p.val*x*p.val-(t : ℂ) • p.val)*q.val = + q.val*x*q.val-(t : ℂ) • q.val := by + have hl : p.val*q.val=q.val := hqp + have hr := projection_mul_of_le hqp + simp only [mul_sub,sub_mul,mul_smul_comm,smul_mul_assoc] + simp only [← mul_assoc,hr] + simp only [mul_assoc,hl,q.property.isIdempotentElem.eq] + +theorem lower_bound_compress {p q : AlgebraProjection M} (hqp : q ≤ p) + (x : M.toStarSubalgebra) (t : ℝ) + (h : 0 ≤ p.val*x*p.val-(t : ℂ) • p.val) : + 0 ≤ q.val*x*q.val-(t : ℂ) • q.val := by + have hh := star_left_conjugate_nonneg h q.val + rw [q.property.isSelfAdjoint.star_eq,compress_scalar_shift hqp] at hh + exact hh + +theorem upper_bound_compress {p q : AlgebraProjection M} (hqp : q ≤ p) + (x : M.toStarSubalgebra) (t : ℝ) + (h : p.val*x*p.val-(t : ℂ) • p.val ≤ 0) : + q.val*x*q.val-(t : ℂ) • q.val ≤ 0 := by + have hh := star_left_conjugate_nonneg (neg_nonneg.mpr h) q.val + rw [q.property.isSelfAdjoint.star_eq,mul_neg,neg_mul,compress_scalar_shift hqp] at hh + exact neg_nonneg.mp hh + +structure SpectralInterval (x : M.toStarSubalgebra) where + proj : AlgebraProjection M + lo : ℝ + hi : ℝ + lower : 0 ≤ proj.val*x*proj.val-(lo : ℂ) • proj.val + upper : proj.val*x*proj.val-(hi : ℂ) • proj.val ≤ 0 + +namespace SpectralInterval +variable {x : M.toStarSubalgebra} (I : SpectralInterval x) (hx : IsSelfAdjoint x) + +def midpoint : ℝ := (I.lo+I.hi)/2 + +def highProjection : AlgebraProjection M := cornerSpectralCut I.proj x I.midpoint + +def lowProjection : AlgebraProjection M := + ⟨I.proj.val-(I.highProjection).val, + (I.highProjection).property.sub_of_mul_eq_right I.proj.property + (cornerSpectralCut_le I.proj x hx I.midpoint)⟩ + +theorem high_le (hx : IsSelfAdjoint x) : I.highProjection ≤ I.proj := + cornerSpectralCut_le I.proj x hx I.midpoint + +theorem low_le : I.lowProjection hx ≤ I.proj := by + change I.proj.val*(I.proj.val-(I.highProjection).val)=I.proj.val-I.highProjection.val + rw [mul_sub,I.proj.property.isIdempotentElem.eq,I.high_le hx] + +def high : SpectralInterval x where + proj := I.highProjection + lo := I.midpoint + hi := I.hi + lower := cornerSpectralCut_lower I.proj x hx I.midpoint + upper := upper_bound_compress (I.high_le hx) x I.hi I.upper + +def low : SpectralInterval x where + proj := I.lowProjection hx + lo := I.lo + hi := I.midpoint + lower := lower_bound_compress (I.low_le hx) x I.lo I.lower + upper := cornerSpectralCut_upper I.proj x hx I.midpoint + +def child (b : Bool) : SpectralInterval x := if b then I.high hx else I.low hx + +theorem child_le (b : Bool) : (I.child hx b).proj ≤ I.proj := by + cases b + · exact I.low_le hx + · exact I.high_le hx + +theorem child_width (b : Bool) : + (I.child hx b).hi-(I.child hx b).lo=(I.hi-I.lo)/2 := by + cases b <;> dsimp [child,high,low,midpoint] <;> ring + +theorem child_total : (I.child hx false).proj.val+(I.child hx true).proj.val=I.proj.val := by + change (I.proj.val-(I.highProjection).val)+(I.highProjection).val=I.proj.val + exact sub_add_cancel _ _ + +theorem child_orthogonal (b c : Bool) (h : b ≠ c) : + (I.child hx b).proj.val*(I.child hx c).proj.val=0 := by + have hl : I.proj.val*(I.highProjection).val=(I.highProjection).val := I.high_le hx + have hr := projection_mul_of_le (I.high_le hx) + cases b <;> cases c + · exact (h rfl).elim + · change (I.proj.val-(I.highProjection).val)*(I.highProjection).val=0 + rw [sub_mul,hl,(I.highProjection).property.isIdempotentElem.eq,sub_self] + · change (I.highProjection).val*(I.proj.val-(I.highProjection).val)=0 + rw [mul_sub,hr,(I.highProjection).property.isIdempotentElem.eq,sub_self] + · exact (h rfl).elim + +theorem child_compression_total : + (I.child hx false).proj.val*x*(I.child hx false).proj.val+ + (I.child hx true).proj.val*x*(I.child hx true).proj.val=I.proj.val*x*I.proj.val := by + have h := cornerSpectralPartition_pinch I.proj x hx I.midpoint + rw [cornerSpectralPartition,CornerPartition.binary_pinch] at h + exact (add_comm _ _).trans h + +end SpectralInterval + +end + +/-! Finite dyadic trees of actual spectral interval cuts. -/ +section +open scoped CStarAlgebra BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +namespace SpectralInterval +variable {x : M.toStarSubalgebra} (I : SpectralInterval x) (hx : IsSelfAdjoint x) + +def level (I : SpectralInterval x) (hx : IsSelfAdjoint x) : (n : ℕ) → DyadicIndex n → SpectralInterval x + | 0,_ => I + | n+1,i => (level I hx n i.1).child hx i.2 + +theorem level_le : ∀ n i, (I.level hx n i).proj ≤ I.proj + | 0,_ => le_refl _ + | n+1,i => ((I.level hx n i.1).child_le hx i.2).trans (level_le n i.1) + +theorem level_width : ∀ n i, + (I.level hx n i).hi-(I.level hx n i).lo = (I.hi-I.lo)/(2:ℝ)^n + | 0,_ => by simp [level] + | n+1,i => by + change ((I.level hx n i.1).child hx i.2).hi- + ((I.level hx n i.1).child hx i.2).lo=_ + rw [child_width,level_width n i.1,pow_succ,div_div] + +theorem level_total : ∀ n, (∑ i : DyadicIndex n, (I.level hx n i).proj.val)=I.proj.val + | 0 => by + change (∑ _ : Unit, I.proj.val)=I.proj.val + simp + | n+1 => by + change (∑ i : DyadicIndex n × Bool, ((I.level hx n i.1).child hx i.2).proj.val)=_ + rw [Fintype.sum_prod_type] + have he (i : DyadicIndex n) : + (∑ b : Bool, ((I.level hx n i).child hx b).proj.val)=(I.level hx n i).proj.val := by + rw [Fintype.sum_bool,add_comm,child_total] + simp only [he] + exact level_total n + +theorem level_orthogonal : ∀ n (i j : DyadicIndex n), i ≠ j → + (I.level hx n i).proj.val*(I.level hx n j).proj.val=0 + | 0,i,j,h => (h (@Subsingleton.elim Unit _ i j)).elim + | n+1,⟨i,b⟩,⟨j,c⟩,h => by + change ((I.level hx n i).child hx b).proj.val*((I.level hx n j).child hx c).proj.val=0 + by_cases hij : i=j + · subst j + exact (I.level hx n i).child_orthogonal hx b c (fun hbc => h (by cases hbc; rfl)) + · exact orthogonal_subprojections (level_orthogonal n i j hij) + ((I.level hx n i).child_le hx b) ((I.level hx n j).child_le hx c) + +theorem level_compression_total : ∀ n, + (∑ i : DyadicIndex n, (I.level hx n i).proj.val*x*(I.level hx n i).proj.val) = + I.proj.val*x*I.proj.val + | 0 => by + change (∑ _ : Unit, I.proj.val*x*I.proj.val)=I.proj.val*x*I.proj.val + simp + | n+1 => by + change (∑ i : DyadicIndex n × Bool, ((I.level hx n i.1).child hx i.2).proj.val*x* + ((I.level hx n i.1).child hx i.2).proj.val)=_ + rw [Fintype.sum_prod_type] + have he (i : DyadicIndex n) : + (∑ b : Bool, ((I.level hx n i).child hx b).proj.val*x* + ((I.level hx n i).child hx b).proj.val)= + (I.level hx n i).proj.val*x*(I.level hx n i).proj.val := by + rw [Fintype.sum_bool,add_comm,child_compression_total] + simp only [he] + exact level_compression_total n + +def partition (n : ℕ) : CornerPartition I.proj := + CornerPartition.ofFamily (fun i : DyadicIndex n => (I.level hx n i).proj) + (I.level_orthogonal hx n) (I.level_total hx n) + +theorem partition_pinch (n : ℕ) : (I.partition hx n).pinch x=I.proj.val*x*I.proj.val := by + rw [partition,CornerPartition.ofFamily_pinch] + exact I.level_compression_total hx n + +end SpectralInterval + +/-! Finite spectral approximations constructed by successive sign cuts. +The approximation bound is proved from the leaf intervals. -/ +local instance approximationCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance approximationOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance approximationPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance approximationLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance approximationStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +namespace SpectralInterval +variable {x : M.toStarSubalgebra} (I : SpectralInterval x) (hx : IsSelfAdjoint x) + +theorem error_upper : I.proj.val*x*I.proj.val-(I.lo : ℂ) • I.proj.val ≤ + ((I.hi-I.lo : ℝ) : ℂ) • I.proj.val := by + calc I.proj.val*x*I.proj.val-(I.lo : ℂ) • I.proj.val ≤ + (I.hi : ℂ) • I.proj.val-(I.lo : ℂ) • I.proj.val := + sub_le_sub_right (sub_nonpos.mp I.upper) _ + _ = _ := by rw [← sub_smul,Complex.ofReal_sub] + +def approximant (n : ℕ) : M.toStarSubalgebra := + ∑ i : DyadicIndex n, ((I.level hx n i).lo : ℂ) • (I.level hx n i).proj.val + +theorem approximant_error_sum (n : ℕ) : + I.proj.val*x*I.proj.val-I.approximant hx n = + ∑ i : DyadicIndex n, ((I.level hx n i).proj.val*x*(I.level hx n i).proj.val- + ((I.level hx n i).lo : ℂ) • (I.level hx n i).proj.val) := by + rw [Finset.sum_sub_distrib,I.level_compression_total hx] + rfl + +theorem approximant_error_nonneg (n : ℕ) : + 0 ≤ I.proj.val*x*I.proj.val-I.approximant hx n := by + rw [I.approximant_error_sum hx] + exact Finset.sum_nonneg (fun i _ => (I.level hx n i).lower) + +theorem approximant_error_upper (n : ℕ) : + I.proj.val*x*I.proj.val-I.approximant hx n ≤ + (((I.hi-I.lo)/(2:ℝ)^n : ℝ) : ℂ) • I.proj.val := by + rw [I.approximant_error_sum hx] + have he := Finset.sum_le_sum (s := (Finset.univ : Finset (DyadicIndex n))) + (fun i _ => (I.level hx n i).error_upper) + simp only [I.level_width hx] at he + rw [← Finset.smul_sum,I.level_total hx] at he + exact he + +/-- Actual operator norm approximation, not an assumed energy budget. -/ +theorem approximant_norm_error (n : ℕ) (hab : I.lo ≤ I.hi) : + ‖I.proj.val*x*I.proj.val-I.approximant hx n‖ ≤ (I.hi-I.lo)/(2:ℝ)^n := by + have hw : 0 ≤ (I.hi-I.lo)/(2:ℝ)^n := div_nonneg (sub_nonneg.mpr hab) (by positivity) + calc ‖I.proj.val*x*I.proj.val-I.approximant hx n‖ ≤ + ‖(((I.hi-I.lo)/(2:ℝ)^n : ℝ) : ℂ) • I.proj.val‖ := + CStarAlgebra.norm_le_norm_of_le_of_nonneg (I.approximant_error_upper hx n) + (I.approximant_error_nonneg hx n) + _ = ((I.hi-I.lo)/(2:ℝ)^n)*‖I.proj.val‖ := by + rw [norm_smul,Complex.norm_real,Real.norm_of_nonneg hw] + _ ≤ (I.hi-I.lo)/(2:ℝ)^n := by + nlinarith only [mul_le_mul_of_nonneg_left I.proj.property.norm_le hw] + +theorem exists_approximant (hab : I.lo ≤ I.hi) (ε : ℝ) (hε : 0 < ε) : + ∃ n, ‖I.proj.val*x*I.proj.val-I.approximant hx n‖ < ε := by + obtain ⟨n,hn⟩ := exists_nat_gt ((I.hi-I.lo)/ε) + have hnp : (n : ℝ)<(2:ℝ)^n := by exact_mod_cast (show n < 2^n from Nat.lt_two_pow_self) + have hbound : (I.hi-I.lo)/(2:ℝ)^n < ε := by + rw [div_lt_iff₀ (by positivity : (0:ℝ)<2^n)] + have hh := (div_lt_iff₀ hε).mp hn + nlinarith [mul_lt_mul_of_pos_left hnp hε] + exact ⟨n,(I.approximant_norm_error hx n hab).trans_lt hbound⟩ + +end SpectralInterval + +/-- Start the construction with the actual operator norm bounds in any corner. -/ +def initialSpectralInterval (p : AlgebraProjection M) (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) : SpectralInterval x := by + let oneP : AlgebraProjection M := ⟨1,IsStarProjection.one _⟩ + have hp : p ≤ oneP := one_mul _ + have hs (r : ℝ) : algebraMap ℝ M.toStarSubalgebra r=(r : ℂ) • (1 : M.toStarSubalgebra) := by + rw [Algebra.algebraMap_eq_smul_one,Complex.coe_smul] + refine ⟨p,-‖x‖,‖x‖,?_,?_⟩ + · apply lower_bound_compress hp x (-‖x‖) + have h := hx.neg_algebraMap_norm_le_self + rw [hs] at h + change 0 ≤ 1*x*1-((-‖x‖ : ℝ) : ℂ) • (1 : M.toStarSubalgebra) + simpa only [one_mul,mul_one,Complex.ofReal_neg,neg_smul] using sub_nonneg.mpr h + · apply upper_bound_compress hp x ‖x‖ + have h := hx.le_algebraMap_norm_self + rw [hs] at h + change 1*x*1-(‖x‖ : ℂ) • (1 : M.toStarSubalgebra) ≤ 0 + simpa only [one_mul,mul_one] using sub_nonpos.mpr h + +/-- An actual finite orthogonal spectral approximation of a compressed +self-adjoint operator. All projections and coefficients are constructed. -/ +theorem exists_finite_spectral_approximation (p : AlgebraProjection M) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition p) (c : Fin Q.size → ℝ), + Q.pinch x=p.val*x*p.val ∧ + ‖p.val*x*p.val-∑ i, (c i : ℂ) • (Q.piece i).val‖ < ε := by + let I := initialSpectralInterval p x hx + have hI : I.lo ≤ I.hi := neg_le_self (norm_nonneg _) + obtain ⟨n,hn⟩ := I.exists_approximant hx hI ε hε + let e := (Fintype.equivFin (DyadicIndex n)).symm + refine ⟨I.partition hx n,fun i => (I.level hx n (e i)).lo,I.partition_pinch hx n,?_⟩ + have he := Equiv.sum_comp e (fun i => ((I.level hx n i).lo : ℂ) • (I.level hx n i).proj.val) + change ‖p.val*x*p.val-∑ i, ((I.level hx n (e i)).lo : ℂ) • + (I.level hx n (e i)).proj.val‖ < ε + rw [he] + exact hn + +end + +/-! Constructed cuts preserve commutation with other operators. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge ContinuousLinearMap LinearMap +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance spectralCommutationCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance spectralCommutationOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance spectralCommutationStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +omit [CompleteSpace H] in +theorem kernel_invariant_of_commutes (x y : H →L[ℂ] H) (h : x*y=y*x) : + x.ker ∈ Module.End.invtSubmodule y.toLinearMap := by + intro ξ hξ + change x (y ξ)=0 + have he := congrArg (fun t : H →L[ℂ] H => t ξ) h + change x (y ξ)=y (x ξ) at he + rw [he,show x ξ=0 from hξ,map_zero] + +theorem kernelProjection_commutes (x y : M.toStarSubalgebra) + (hxy : Commute x y) (hxys : Commute x (star y)) : + Commute (kernelProjection x).val y := by + let k := x.val.ker.starProjection + have hk : IsIdempotentElem k.toLinearMap := + (isStarProjection_starProjection (U := x.val.ker)).isIdempotentElem.toLinearMap + have h₁ := kernel_invariant_of_commutes x.val y.val (congrArg Subtype.val hxy.eq) + have h₂ : x.val.ker ∈ Module.End.invtSubmodule y.val.adjoint.toLinearMap := by + exact kernel_invariant_of_commutes x.val (star y).val (congrArg Subtype.val hxys.eq) + have hc : Commute k.toLinearMap y.val.toLinearMap := by + apply (LinearMap.IsIdempotentElem.commute_iff hk).mpr + change k.range ∈ Module.End.invtSubmodule y.val.toLinearMap ∧ + k.ker ∈ Module.End.invtSubmodule y.val.toLinearMap + rw [Submodule.range_starProjection,Submodule.ker_starProjection] + exact ⟨h₁,ContinuousLinearMap.orthogonal_mem_invtSubmodule h₂⟩ + apply Subtype.ext + ext ξ + exact congrArg (fun t : H →ₗ[ℂ] H => t ξ) hc.eq + +theorem positiveSupport_commutes_of_commutes (x y : M.toStarSubalgebra) + (hxy : Commute x y) (hxys : Commute x (star y)) : + Commute (positiveSupport x).val y := by + have hpos := hxy.cfcₙ_real (fun t : ℝ => t⁺) + have hposs := hxys.cfcₙ_real (fun t : ℝ => t⁺) + change Commute x⁺ y at hpos + change Commute x⁺ (star y) at hposs + have hs : IsSelfAdjoint x⁺ := (CFC.posPart_nonneg x).isSelfAdjoint + have hk := kernelProjection_commutes x⁺ y hpos hposs + change Commute (1-(kernelProjection (star x⁺)).val) y + rw [hs.star_eq] + exact (Commute.one_left y).sub_left hk + +end + +/-! Spectral interval partitions in the commutant of a prescribed operator. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem selfAdjoint_commutes_star_right {x y : M.toStarSubalgebra} + (hx : IsSelfAdjoint x) (hxy : Commute x y) : Commute x (star y) := by + have h := congrArg star hxy.eq + simp only [star_mul,hx.star_eq] at h + exact h.symm + +theorem positiveSupport_commutes_of_selfAdjoint {x y : M.toStarSubalgebra} + (hx : IsSelfAdjoint x) (hxy : Commute x y) : + Commute (positiveSupport x).val y := + positiveSupport_commutes_of_commutes x y hxy (selfAdjoint_commutes_star_right hx hxy) + +theorem cornerSpectralCut_commutes_with (p : AlgebraProjection M) (x y : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) (hxy : Commute x y) (hp : Commute p.val y) (t : ℝ) : + Commute (cornerSpectralCut p x t).val y := by + apply positiveSupport_commutes_of_selfAdjoint (cornerSpectralShift_selfAdjoint p x hx t) + have hscalar : Commute ((t : ℂ) • p.val) y := by + show ((t : ℂ) • p.val)*y=y*((t : ℂ) • p.val) + rw [smul_mul_assoc,mul_smul_comm,hp.eq] + exact ((hp.mul_left hxy).mul_left hp).sub_left hscalar + +namespace SpectralInterval +variable {x y : M.toStarSubalgebra} (I : SpectralInterval x) (hx : IsSelfAdjoint x) + +theorem child_commutes (hxy : Commute x y) (hp : Commute I.proj.val y) (b : Bool) : + Commute (I.child hx b).proj.val y := by + have hq := cornerSpectralCut_commutes_with I.proj x y hx hxy hp I.midpoint + cases b + · exact hp.sub_left hq + · exact hq + +theorem level_commutes (hxy : Commute x y) (hp : Commute I.proj.val y) : + ∀ n i, Commute (I.level hx n i).proj.val y + | 0,_ => hp + | n+1,i => (I.level hx n i.1).child_commutes hx hxy (level_commutes hxy hp n i.1) i.2 + +theorem partition_commutes (hxy : Commute x y) (hp : Commute I.proj.val y) + (n : ℕ) (i : Fin (I.partition hx n).size) : + Commute ((I.partition hx n).piece i).val y := + I.level_commutes hx hxy hp n _ + +end SpectralInterval + +/-- The finite construction retains a prescribed commutation relation. -/ +theorem exists_finite_spectral_approximation_commuting (p : AlgebraProjection M) + (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (hxy : Commute x y) + (hp : Commute p.val y) (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition p) (c : Fin Q.size → ℝ), + Q.pinch x=p.val*x*p.val ∧ (∀ i, Commute (Q.piece i).val y) ∧ + ‖p.val*x*p.val-∑ i, (c i : ℂ) • (Q.piece i).val‖ < ε := by + let I := initialSpectralInterval p x hx + have hI : I.lo ≤ I.hi := neg_le_self (norm_nonneg _) + obtain ⟨n,hn⟩ := I.exists_approximant hx hI ε hε + let e := (Fintype.equivFin (DyadicIndex n)).symm + refine ⟨I.partition hx n,fun i => (I.level hx n (e i)).lo,I.partition_pinch hx n, + I.partition_commutes hx hxy hp n,?_⟩ + have he := Equiv.sum_comp e (fun i => ((I.level hx n i).lo : ℂ) • (I.level hx n i).proj.val) + change ‖p.val*x*p.val-∑ i, ((I.level hx n (e i)).lo : ℂ) • + (I.level hx n (e i)).proj.val‖ < ε + rw [he] + exact hn + +/-- One constructed partition preserves the whole displayed commutant, +not a separately selected partition for each test operator. -/ +theorem exists_finite_spectral_approximation_preserving_commutant (p : AlgebraProjection M) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition p) (c : Fin Q.size → ℝ), + Q.pinch x=p.val*x*p.val ∧ + (∀ y : M.toStarSubalgebra, Commute x y → Commute p.val y → + ∀ i, Commute (Q.piece i).val y) ∧ + ‖p.val*x*p.val-∑ i, (c i : ℂ) • (Q.piece i).val‖ < ε := by + let I := initialSpectralInterval p x hx + have hI : I.lo ≤ I.hi := neg_le_self (norm_nonneg _) + obtain ⟨n,hn⟩ := I.exists_approximant hx hI ε hε + let e := (Fintype.equivFin (DyadicIndex n)).symm + refine ⟨I.partition hx n,fun i => (I.level hx n (e i)).lo,I.partition_pinch hx n, + fun y hxy hp => I.partition_commutes hx hxy hp n,?_⟩ + have he := Equiv.sum_comp e (fun i => ((I.level hx n i).lo : ℂ) • (I.level hx n i).proj.val) + change ‖p.val*x*p.val-∑ i, ((I.level hx n (e i)).lo : ℂ) • + (I.level hx n (e i)).proj.val‖ < ε + rw [he] + exact hn + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/SpectralStates.lean b/lean/OAI/Analysis/FactorGeneration/SpectralStates.lean new file mode 100644 index 0000000000000000000000000000000000000000..c64e0d6e7ad2790e0c736b8e598962ef3ca48665 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/SpectralStates.lean @@ -0,0 +1,459 @@ +import Mathlib.Algebra.Star.UnitaryStarAlgAut +import OAI.Analysis.FactorGeneration.SpectralDimension + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Additivity on commuting self-adjoint operators, proved using actual common +spectral refinements. The commutation hypothesis is essential to this proof. -/ +open scoped BigOperators +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem dimensionSpectralValue_add_of_commute + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) + (hxy : Commute x y) : + dimensionSpectralValue hfactor hdiff hfinite hunit (x+y) (hx.add hy)= + dimensionSpectralValue hfactor hdiff hfinite hunit x hx+ + dimensionSpectralValue hfactor hdiff hfinite hunit y hy := by + classical + apply sub_eq_zero.mp + apply norm_eq_zero.mp + apply le_antisymm ?_ (norm_nonneg _) + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨Q,c,_,hQ,herrQ⟩ := exists_finite_spectral_approximation_preserving_commutant + ⟨1,IsStarProjection.one _⟩ x hx (ε/4) (by positivity) + obtain ⟨R,d,_,hR,herrR⟩ := exists_finite_spectral_approximation_preserving_commutant + ⟨1,IsStarProjection.one _⟩ y hy (ε/4) (by positivity) + simp only [one_mul,mul_one] at herrQ herrR + have hQx := hQ x (Commute.refl x) (Commute.one_left x) + have hQy := hQ y hxy (Commute.one_left y) + have hRx := hR x hxy.symm (Commute.one_left x) + have hRy := hR y (Commute.refl y) (Commute.one_left y) + have hc (i : Fin Q.size) (j : Fin R.size) : + Commute (Q.piece i).val (R.piece j).val := + (hR _ (hQy i).symm (Commute.one_left _) j).symm + let q := Q.jointPiece R hc + let b (a : Fin Q.size × Fin R.size) : ℂ := (c a.1 : ℂ)+(d a.2 : ℂ) + let sx : M.toStarSubalgebra := ∑ i, (c i : ℂ) • (Q.piece i).val + let sy : M.toStarSubalgebra := ∑ j, (d j : ℂ) • (R.piece j).val + let wx : ℂ := ∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ) + let wy : ℂ := ∑ j, (d j : ℂ)*(traceFreeDimension hfactor hdiff (R.piece j) : ℂ) + have hsum : (∑ a, b a • (q a).val)=sx+sy := by + simp only [b,add_smul,Finset.sum_add_distrib] + exact congrArg₂ (·+·) (Q.joint_sum_left R hc (fun i => (c i : ℂ))) + (Q.joint_sum_right R hc (fun j => (d j : ℂ))) + have hweight : (∑ a, b a*(traceFreeDimension hfactor hdiff (q a) : ℂ))=wx+wy := by + simp only [b,add_mul,Finset.sum_add_distrib] + exact congrArg₂ (·+·) + (Q.dimension_weight_joint_left hfactor hdiff hfinite R hc hunit (fun i => (c i : ℂ))) + (Q.dimension_weight_joint_right hfactor hdiff hfinite R hc hunit (fun j => (d j : ℂ))) + have hcomm (a : Fin Q.size × Fin R.size) : Commute (q a).val (x+y) := + ((hQx a.1).mul_left (hRx a.2)).add_right ((hQy a.1).mul_left (hRy a.2)) + have hz := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit (x+y) (hx.add hy)).2.family_bound + hfactor hdiff q (Q.jointPiece_orthogonal R hc) (Q.jointPiece_total R hc) b hcomm + rw [hsum,hweight] at hz + have he : ‖(x+y)-(sx+sy)‖ ≤ ‖x-sx‖+‖y-sy‖ := by + rw [show (x+y)-(sx+sy)=(x-sx)+(y-sy) by abel] + exact norm_add_le _ _ + have hxv := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx).2 + Q (fun i => (c i : ℂ)) hQx + have hyv := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit y hy).2 + R (fun j => (d j : ℂ)) hRy + let vx := dimensionSpectralValue hfactor hdiff hfinite hunit x hx + let vy := dimensionSpectralValue hfactor hdiff hfinite hunit y hy + have hv : ‖(vx+vy)-(wx+wy)‖ ≤ ‖vx-wx‖+‖vy-wy‖ := by + rw [show (vx+vy)-(wx+wy)=(vx-wx)+(vy-wy) by abel] + exact norm_add_le _ _ + have htri := dist_triangle + (dimensionSpectralValue hfactor hdiff hfinite hunit (x+y) (hx.add hy)) (wx+wy) (vx+vy) + simp only [dist_eq_norm] at htri + rw [norm_sub_rev (wx+wy) (vx+vy)] at htri + change ‖vx-wx‖ ≤ ‖x-sx‖ at hxv + change ‖vy-wy‖ ≤ ‖y-sy‖ at hyv + change ‖x-sx‖ < ε/4 at herrQ + change ‖y-sy‖ < ε/4 at herrR + change ‖dimensionSpectralValue hfactor hdiff hfinite hunit (x+y) (hx.add hy)-(vx+vy)‖ ≤ 0+ε + linarith + +theorem dimensionSpectralValue_sub_of_commute + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) + (hxy : Commute x y) : + dimensionSpectralValue hfactor hdiff hfinite hunit (x-y) (hx.sub hy)= + dimensionSpectralValue hfactor hdiff hfinite hunit x hx- + dimensionSpectralValue hfactor hdiff hfinite hunit y hy := by + simpa only [sub_eq_add_neg,dimensionSpectralValue_neg hfactor hdiff hfinite hunit y hy] using + dimensionSpectralValue_add_of_commute hfactor hdiff hfinite hunit x (-y) hx hy.neg hxy.neg_right + +theorem dimensionSpectralValue_sub_norm_le_of_commute + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) + (hxy : Commute x y) : + ‖dimensionSpectralValue hfactor hdiff hfinite hunit x hx- + dimensionSpectralValue hfactor hdiff hfinite hunit y hy‖ ≤ ‖x-y‖ := by + rw [← dimensionSpectralValue_sub_of_commute hfactor hdiff hfinite hunit x y hx hy hxy] + exact dimensionSpectralValue_norm_le hfactor hdiff hfinite hunit (x-y) (hx.sub hy) + +end + +/-! Positive spectral approximants, positivity of the constructed scalar, and +order preservation on commuting self-adjoint operators. -/ +open scoped BigOperators CStarAlgebra +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance spectralValueCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance spectralValueOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance spectralValuePreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance spectralValueLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance spectralValueStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +namespace SpectralInterval +variable {x : M.toStarSubalgebra} (I : SpectralInterval x) (hx : IsSelfAdjoint x) + +theorem child_endpoints (hI : I.lo ≤ I.hi) (b : Bool) : + I.lo ≤ (I.child hx b).lo ∧ (I.child hx b).lo ≤ (I.child hx b).hi ∧ + (I.child hx b).hi ≤ I.hi := by + cases b <;> dsimp [child,low,high,midpoint] + · exact ⟨le_rfl,by linarith,by linarith⟩ + · exact ⟨by linarith,by linarith,le_rfl⟩ + +theorem level_endpoints (hI : I.lo ≤ I.hi) : ∀ n i, + I.lo ≤ (I.level hx n i).lo ∧ (I.level hx n i).lo ≤ (I.level hx n i).hi ∧ + (I.level hx n i).hi ≤ I.hi + | 0,_ => ⟨le_rfl,hI,le_rfl⟩ + | n+1,i => by + have h := level_endpoints hI n i.1 + have hchild := (I.level hx n i.1).child_endpoints hx h.2.1 i.2 + exact ⟨h.1.trans hchild.1,hchild.2.1,hchild.2.2.trans h.2.2⟩ + +end SpectralInterval + +/-- A positive operator has arbitrarily accurate finite positive spectral +approximants preserving its entire commutant. -/ +theorem exists_positive_spectral_approximation + (x : M.toStarSubalgebra) (hx : 0 ≤ x) (ε : ℝ) (hε : 0 < ε) : + ∃ (Q : CornerPartition (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M)) + (c : Fin Q.size → ℝ), + (∀ i, 0 ≤ c i) ∧ + (∀ y : M.toStarSubalgebra, Commute x y → ∀ i, Commute (Q.piece i).val y) ∧ + ‖x-∑ i, (c i : ℂ) • (Q.piece i).val‖ < ε := by + let I : SpectralInterval x := + { proj := ⟨1,IsStarProjection.one _⟩ + lo := 0 + hi := ‖x‖ + lower := by simpa only [one_mul,mul_one,Complex.ofReal_zero,zero_smul,sub_zero] using hx + upper := (initialSpectralInterval ⟨1,IsStarProjection.one _⟩ x hx.isSelfAdjoint).upper } + have hI : I.lo ≤ I.hi := norm_nonneg x + obtain ⟨n,hn⟩ := I.exists_approximant hx.isSelfAdjoint hI ε hε + let e := (Fintype.equivFin (DyadicIndex n)).symm + refine ⟨I.partition hx.isSelfAdjoint n,fun i => (I.level hx.isSelfAdjoint n (e i)).lo,?_,?_,?_⟩ + · intro i + exact (I.level_endpoints hx.isSelfAdjoint hI n (e i)).1 + · intro y hy i + exact I.partition_commutes hx.isSelfAdjoint hy (Commute.one_left y) n i + · change ‖x-∑ i, ((I.level hx.isSelfAdjoint n (e i)).lo : ℂ) • + (I.level hx.isSelfAdjoint n (e i)).proj.val‖ < ε + rw [Equiv.sum_comp e (fun i => ((I.level hx.isSelfAdjoint n i).lo : ℂ) • + (I.level hx.isSelfAdjoint n i).proj.val)] + change ‖1*x*1-∑ i, ((I.level hx.isSelfAdjoint n i).lo : ℂ) • + (I.level hx.isSelfAdjoint n i).proj.val‖ < ε at hn + simpa only [one_mul,mul_one] using hn + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem dimensionSpectralValue_nonneg + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (x : M.toStarSubalgebra) (hx : 0 ≤ x) : + 0 ≤ (dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint).re := by + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨Q,c,hc,hQ,herr⟩ := exists_positive_spectral_approximation x hx ε hε + have hval := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx.isSelfAdjoint).2 + Q (fun i => (c i : ℂ)) (hQ x (Commute.refl x)) + let t := dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint + let w : ℝ := ∑ i, c i*traceFreeDimension hfactor hdiff (Q.piece i) + have hw : 0 ≤ w := Finset.sum_nonneg (fun i _ => mul_nonneg (hc i) + (traceFreeDimension_nonneg hfactor hdiff _)) + have he : (w : ℂ)=∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ) := by + simp only [w,Complex.ofReal_sum,Complex.ofReal_mul] + have hb : ‖t-(w : ℂ)‖ < ε := by rw [he]; exact hval.trans_lt herr + have hre := Complex.re_le_norm ((w : ℂ)-t) + rw [Complex.sub_re,Complex.ofReal_re,norm_sub_rev (w : ℂ) t] at hre + change 0 ≤ t.re+ε + linarith + +theorem dimensionSpectralValue_mono_of_commute + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (hy : IsSelfAdjoint y) + (hxy : Commute x y) (hle : x ≤ y) : + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx).re ≤ + (dimensionSpectralValue hfactor hdiff hfinite hunit y hy).re := by + have h := dimensionSpectralValue_nonneg hfactor hdiff hfinite hunit (y-x) (sub_nonneg.mpr hle) + rw [dimensionSpectralValue_sub_of_commute hfactor hdiff hfinite hunit y x hy hx hxy.symm, + Complex.sub_re] at h + exact sub_nonneg.mp h + +end + +/-! A nonzero positive operator dominates a positive multiple of an actual +nonzero spectral projection. This proves faithfulness without linearity. -/ +open scoped CStarAlgebra +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance spectralFaithfulCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance spectralFaithfulOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance spectralFaithfulPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance spectralFaithfulLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance spectralFaithfulStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem positive_spectral_cut_domination + (x : M.toStarSubalgebra) (hx : 0 ≤ x) (t : ℝ) : + (t : ℂ) • (cornerSpectralCut ⟨1,IsStarProjection.one _⟩ x t).val ≤ x := by + let p : AlgebraProjection M := ⟨1,IsStarProjection.one _⟩ + let q := cornerSpectralCut p x t + have hl : 0 ≤ q.val*x*q.val-(t : ℂ) • q.val := cornerSpectralCut_lower p x hx.isSelfAdjoint t + have hr := star_left_conjugate_nonneg hx (1-q.val) + rw [star_sub,star_one,q.property.isSelfAdjoint.star_eq] at hr + have hsum := add_nonneg hl hr + have he := cornerSpectralPartition_pinch p x hx.isSelfAdjoint t + rw [cornerSpectralPartition,CornerPartition.binary_pinch] at he + change q.val*x*q.val+(1-q.val)*x*(1-q.val)=1*x*1 at he + simp only [one_mul,mul_one] at he + have he' : q.val*x*q.val-(t : ℂ) • q.val+(1-q.val)*x*(1-q.val)=x-(t : ℂ) • q.val := by + rw [show q.val*x*q.val-(t : ℂ) • q.val+(1-q.val)*x*(1-q.val)= + (q.val*x*q.val+(1-q.val)*x*(1-q.val))-(t : ℂ) • q.val by abel,he] + rw [he'] at hsum + exact sub_nonneg.mp hsum + +theorem positive_spectral_cut_ne_zero + (x : M.toStarSubalgebra) (hx : 0 ≤ x) (t : ℝ) (ht : 0 ≤ t) (htx : t < ‖x‖) : + (cornerSpectralCut ⟨1,IsStarProjection.one _⟩ x t).val ≠ 0 := by + intro hz + have h := cornerSpectralCut_upper ⟨1,IsStarProjection.one _⟩ x hx.isSelfAdjoint t + dsimp only at h + rw [hz,sub_zero,one_mul,mul_one] at h + have hn := CStarAlgebra.norm_le_norm_of_le_of_nonneg (sub_nonpos.mp h) hx + rw [norm_smul,Complex.norm_real,Real.norm_of_nonneg ht] at hn + have hone := (IsStarProjection.one M.toStarSubalgebra).norm_le + have hb : ‖x‖ ≤ t := hn.trans (by nlinarith) + exact (not_lt_of_ge hb) htx + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem dimensionSpectralValue_spectral_cut_lower + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (x : M.toStarSubalgebra) (hx : 0 ≤ x) (t : ℝ) : + t*traceFreeDimension hfactor hdiff (cornerSpectralCut ⟨1,IsStarProjection.one _⟩ x t) ≤ + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint).re := by + let q := cornerSpectralCut (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M) x t + have hq : Commute q.val x := by + show q.val*x=x*q.val + simpa only [one_mul,mul_one] using cornerSpectralCut_commutes + ⟨1,IsStarProjection.one _⟩ x hx.isSelfAdjoint t + have htq : Commute (t • q.val) x := by + show (t • q.val)*x=x*(t • q.val) + rw [smul_mul_assoc,mul_smul_comm,hq.eq] + have hle : t • q.val ≤ x := by + simpa only [Complex.coe_smul] using positive_spectral_cut_domination x hx t + have h := dimensionSpectralValue_mono_of_commute hfactor hdiff hfinite hunit + (t • q.val) x ((IsSelfAdjoint.all t).smul q.property.isSelfAdjoint) hx.isSelfAdjoint htq hle + rw [dimensionSpectralValue_real_smul hfactor hdiff hfinite hunit t q.val q.property.isSelfAdjoint, + dimensionSpectralValue_projection hfactor hdiff hfinite hunit q, + ← Complex.ofReal_mul,Complex.ofReal_re] at h + exact h + +theorem dimensionSpectralValue_pos + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (x : M.toStarSubalgebra) (hx : 0 ≤ x) (hx0 : x≠0) : + 0 < (dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint).re := by + have hn : 0 < ‖x‖ := norm_pos_iff.mpr hx0 + let q := cornerSpectralCut (⟨1,IsStarProjection.one _⟩ : AlgebraProjection M) x (‖x‖/2) + have hq : q.val≠0 := positive_spectral_cut_ne_zero x hx (‖x‖/2) (by positivity) (by linarith) + have hd : 0 < traceFreeDimension hfactor hdiff q := traceFreeDyadicSup_pos + hfactor hdiff hfinite ⟨1,IsStarProjection.one _⟩ q hq + exact (mul_pos (half_pos hn) hd).trans_le + (dimensionSpectralValue_spectral_cut_lower hfactor hdiff hfinite hunit x hx (‖x‖/2)) + +theorem dimensionSpectralValue_eq_zero_iff_of_nonneg + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (x : M.toStarSubalgebra) (hx : 0 ≤ x) : + dimensionSpectralValue hfactor hdiff hfinite hunit x hx.isSelfAdjoint=0 ↔ x=0 := by + constructor + · intro h + by_contra hx0 + have hp := dimensionSpectralValue_pos hfactor hdiff hfinite hunit x hx hx0 + rw [h,Complex.zero_re] at hp + exact (lt_irrefl 0) hp + · intro h + subst x + exact dimensionSpectralValue_zero hfactor hdiff hfinite hunit + +end + +/-! Unitary conjugacy preserves projection dimension and its constructed +spectral extension. No trace identity is assumed. -/ +open scoped BigOperators +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +def AlgebraProjection.unitaryConjugate (p : AlgebraProjection M) + (u : unitary M.toStarSubalgebra) : AlgebraProjection M := + ⟨Unitary.conjStarAlgAut ℂ M.toStarSubalgebra u p.val, + p.property.map (Unitary.conjStarAlgAut ℂ M.toStarSubalgebra u)⟩ + +theorem AlgebraProjection.equivalent_unitaryConjugate (p : AlgebraProjection M) + (u : unitary M.toStarSubalgebra) : p.Equivalent (p.unitaryConjugate u) := by + let v : PartialIsometry M := + { support := p + val := (u : M.toStarSubalgebra)*p.val + initial := by + simp only [star_mul,p.property.isSelfAdjoint.star_eq] + rw [mul_assoc,← mul_assoc (star (u : M.toStarSubalgebra)), + Unitary.star_mul_self_of_mem u.property,one_mul,p.property.isIdempotentElem.eq] } + refine ⟨v,rfl,?_⟩ + apply Subtype.ext + change ((u : M.toStarSubalgebra)*p.val)*star ((u : M.toStarSubalgebra)*p.val)= + (u : M.toStarSubalgebra)*p.val*star (u : M.toStarSubalgebra) + simp only [star_mul,p.property.isSelfAdjoint.star_eq,mul_assoc] + rw [← mul_assoc p.val,p.property.isIdempotentElem.eq] + +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem traceFreeDimension_unitaryConjugate (p : AlgebraProjection M) + (u : unitary M.toStarSubalgebra) : + traceFreeDimension hfactor hdiff (p.unitaryConjugate u)=traceFreeDimension hfactor hdiff p := + (traceFreeDyadicSup_equivalent hfactor hdiff ⟨1,IsStarProjection.one _⟩ + (p.equivalent_unitaryConjugate u)).symm + +theorem dimensionSpectralValue_unitary_conjugate + (hunit : (1 : M.toStarSubalgebra) ≠ 0) + (u : unitary M.toStarSubalgebra) (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + dimensionSpectralValue hfactor hdiff hfinite hunit + (Unitary.conjStarAlgAut ℂ M.toStarSubalgebra u x) + (hx.map (Unitary.conjStarAlgAut ℂ M.toStarSubalgebra u))= + dimensionSpectralValue hfactor hdiff hfinite hunit x hx := by + classical + let φ := Unitary.conjStarAlgAut ℂ M.toStarSubalgebra u + have hnorm (a : M.toStarSubalgebra) : ‖φ a‖=‖a‖ := by + change ‖((u : M.toStarSubalgebra)*a)*(star u : unitary M.toStarSubalgebra)‖=‖a‖ + rw [CStarRing.norm_mul_coe_unitary,CStarRing.norm_coe_unitary_mul] + apply sub_eq_zero.mp + apply norm_eq_zero.mp + apply le_antisymm ?_ (norm_nonneg _) + apply le_of_forall_pos_le_add + intro ε hε + obtain ⟨Q,c,_,hQ,herr⟩ := exists_finite_spectral_approximation_preserving_commutant + ⟨1,IsStarProjection.one _⟩ x hx (ε/2) (half_pos hε) + simp only [one_mul,mul_one] at herr + have hc := hQ x (Commute.refl x) (Commute.one_left x) + let q (i : Fin Q.size) := (Q.piece i).unitaryConjugate u + have ho (i j : Fin Q.size) (hij : i≠j) : (q i).val*(q j).val=0 := by + change φ (Q.piece i).val*φ (Q.piece j).val=0 + exact (map_mul φ (Q.piece i).val (Q.piece j).val).symm.trans + ((congrArg φ (Q.orthogonal i j hij)).trans (map_zero φ)) + have hs : (∑ i, (q i).val)=(1 : M.toStarSubalgebra) := by + change (∑ i, φ (Q.piece i).val)=1 + exact (map_sum φ (fun i => (Q.piece i).val) Finset.univ).symm.trans + ((congrArg φ Q.total).trans (map_one φ)) + have hcomm (i : Fin Q.size) : Commute (q i).val (φ x) := + (hc i).map φ + have hmap : (∑ i, (c i : ℂ) • (q i).val)=φ (∑ i, (c i : ℂ) • (Q.piece i).val) := by + change (∑ i, (c i : ℂ) • φ (Q.piece i).val)=_ + simp only [map_sum,map_smul] + have hval := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit (φ x) (hx.map φ)).2.family_bound + hfactor hdiff q ho hs (fun i => (c i : ℂ)) hcomm + have hweight : (∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (q i) : ℂ))= + ∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ) := by + simp only [q,traceFreeDimension_unitaryConjugate hfactor hdiff] + have hval' : + ‖dimensionSpectralValue hfactor hdiff hfinite hunit (φ x) (hx.map φ) - + ∑ i, (c i : ℂ) * (traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)‖ ≤ + ‖x - ∑ i, (c i : ℂ) • (Q.piece i).val‖ := by + calc + _ = ‖dimensionSpectralValue hfactor hdiff hfinite hunit (φ x) (hx.map φ) - + ∑ i, (c i : ℂ) * (traceFreeDimension hfactor hdiff (q i) : ℂ)‖ := + congrArg (fun z : ℂ => ‖dimensionSpectralValue hfactor hdiff hfinite hunit + (φ x) (hx.map φ) - z‖) hweight.symm + _ ≤ ‖φ x - ∑ i, (c i : ℂ) • (q i).val‖ := hval + _ = ‖φ (x - ∑ i, (c i : ℂ) • (Q.piece i).val)‖ := + congrArg (fun z : M.toStarSubalgebra => ‖z‖) + ((congrArg (fun z => φ x - z) hmap).trans (map_sub φ x _).symm) + _ = _ := hnorm _ + have hxval := (dimensionSpectralValue_spec hfactor hdiff hfinite hunit x hx).2 + Q (fun i => (c i : ℂ)) hc + have htri := dist_triangle + (dimensionSpectralValue hfactor hdiff hfinite hunit (φ x) (hx.map φ)) + (∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)) + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx) + simp only [dist_eq_norm] at htri + rw [norm_sub_rev (∑ i, (c i : ℂ)*(traceFreeDimension hfactor hdiff (Q.piece i) : ℂ)) + (dimensionSpectralValue hfactor hdiff hfinite hunit x hx)] at htri + change ‖dimensionSpectralValue hfactor hdiff hfinite hunit (φ x) (hx.map φ)- + dimensionSpectralValue hfactor hdiff hfinite hunit x hx‖ ≤ 0+ε + linarith only [htri,hval',hxval,herr] + +end + +/-! The constructed scalar agrees on x*x and xx*, by an actual unitary polar +decomposition. This is a quadratic identity, not unrestricted additivity. -/ +open scoped CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance spectralSquareCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance spectralSquareOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance spectralSquareStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) + +theorem dimensionSpectralValue_star_mul_self + (hunit : (1 : M.toStarSubalgebra) ≠ 0) (x : M.toStarSubalgebra) : + dimensionSpectralValue hfactor hdiff hfinite hunit (star x*x) (IsSelfAdjoint.star_mul_self x)= + dimensionSpectralValue hfactor hdiff hfinite hunit (x*star x) (IsSelfAdjoint.mul_star_self x) := by + obtain ⟨u,hu⟩ := exists_unitary_polar_decomposition hfactor hfinite x + let a := CFC.sqrt (star x*x) + have ha : star a=a := (CFC.sqrt_nonneg _).isSelfAdjoint.star_eq + have haa : a*a=star x*x := CFC.sqrt_mul_sqrt_self _ (star_mul_self_nonneg _) + have he : Unitary.conjStarAlgAut ℂ M.toStarSubalgebra u (star x*x)=x*star x := by + change (u : M.toStarSubalgebra)*(star x*x)*star (u : M.toStarSubalgebra)=x*star x + calc _ = ((u : M.toStarSubalgebra)*a)*star ((u : M.toStarSubalgebra)*a) := by + rw [star_mul,ha,← haa] + simp only [mul_assoc] + _ = x*star x := by rw [hu] + have h := dimensionSpectralValue_unitary_conjugate hfactor hdiff hfinite hunit + u (star x*x) (IsSelfAdjoint.star_mul_self x) + simpa only [he] using h.symm + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/SpectralTruncation.lean b/lean/OAI/Analysis/FactorGeneration/SpectralTruncation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f02b57e9678d9731051a10efc5d81b505c3ab27a --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/SpectralTruncation.lean @@ -0,0 +1,319 @@ +import OAI.Analysis.FactorGeneration.Pinching +import OAI.Analysis.FactorGeneration.Supports +import OAI.Analysis.FactorGeneration.UnitaryMetric + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Positivity of the tracial pairing does not require the two positive +operators to commute. These estimates will control spectral truncation. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +local instance tracePairingCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance tracePairingOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance tracePairingPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance tracePairingLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance tracePairingStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem trace_mul_nonneg (a b : M.toStarSubalgebra) (ha : 0 ≤ a) (hb : 0 ≤ b) : + 0 ≤ (τ.trace (a*b)).re := by + let s := CFC.sqrt a + have hs : star s=s := (CFC.sqrt_nonneg a).isSelfAdjoint.star_eq + have h := trace_nonneg_of_nonneg τ (star s*b*s) (star_left_conjugate_nonneg hb s) + rw [hs,τ.trace_mul_comm (s*b) s,← mul_assoc,CFC.sqrt_mul_sqrt_self a ha] at h + exact h + +theorem trace_mul_mono (a b c : M.toStarSubalgebra) (ha : 0 ≤ a) (hbc : b ≤ c) : + (τ.trace (a*b)).re ≤ (τ.trace (a*c)).re := by + have h := trace_mul_nonneg τ a (c-b) ha (sub_nonneg.mpr hbc) + rw [mul_sub,trace_sub,Complex.sub_re] at h + linarith + +theorem trace_mul_le_norm (a x : M.toStarSubalgebra) (ha : 0 ≤ a) + (hx : IsSelfAdjoint x) : + (τ.trace (a*x)).re ≤ ‖x‖ * (τ.trace a).re := by + have h := trace_mul_mono τ a x (algebraMap ℝ M.toStarSubalgebra ‖x‖) ha + hx.le_algebraMap_norm_self + rw [Algebra.algebraMap_eq_smul_one,mul_smul_comm,mul_one,← Complex.coe_smul, + cornerTrace_smul,Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] at h + exact h + +theorem norm₂_sub_sq (x y : M.toStarSubalgebra) : + τ.norm₂ (x-y)^2 = τ.norm₂ x^2 + τ.norm₂ y^2 - + 2*(τ.trace (star x*y)).re := by + have h := norm_sub_sq (𝕜 := ℂ) (baseVector τ x) (baseVector τ y) + rw [← map_sub,baseVector_inner_trace] at h + change τ.norm₂ (x-y)^2 = τ.norm₂ x^2 - 2*(τ.trace (star x*y)).re + τ.norm₂ y^2 at h + linarith + +end + +/-! Upper spectral truncation of a self-adjoint operator. The truncation +remains in the original operator ball and has a positive discarded part. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance truncationCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance truncationOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance truncationLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance truncationStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +def upperTruncate (a : M.toStarSubalgebra) (C : ℝ) : M.toStarSubalgebra := + a-(a-algebraMap ℝ M.toStarSubalgebra C)⁺ + +theorem upperTruncate_cfc (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (C : ℝ) : + upperTruncate a C = cfc (fun t : ℝ => min t C) a := by + have hf : (fun t : ℝ => min t C) = fun t => t-(t-C)⁺ := by + funext t + simp only [_root_.posPart_def] + by_cases h : t ≤ C + · rw [min_eq_left h,max_eq_right (sub_nonpos.mpr h),sub_zero] + · rw [min_eq_right (le_of_not_ge h),max_eq_left (sub_nonneg.mpr (le_of_not_ge h))] + ring + rw [hf,cfc_sub (fun t : ℝ => t) (fun t => (t-C)⁺) a,cfc_id' ℝ a] + unfold upperTruncate + congr 1 + rw [CFC.posPart_def,cfcₙ_eq_cfc] + have hs : cfc (fun t : ℝ => t-C) a = a-algebraMap ℝ M.toStarSubalgebra C := by + rw [cfc_sub (fun t : ℝ => t) (fun _ => C) a,cfc_id' ℝ a,cfc_const C a ha] + rw [← hs,← cfc_comp (fun t : ℝ => t⁺) (fun t => t-C) a] + rfl + +theorem upperTruncate_selfAdjoint (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (C : ℝ) : + IsSelfAdjoint (upperTruncate a C) := + ha.sub (CFC.posPart_nonneg _).isSelfAdjoint + +theorem upperTruncate_norm_le (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) + (C R : ℝ) (hC : 0 ≤ C) (hR : ‖a‖ ≤ R) : ‖upperTruncate a C‖ ≤ R := by + obtain (hH | hH) := subsingleton_or_nontrivial H + · have ha0 : a=0 := Subtype.ext (Subsingleton.elim _ _) + have hz : upperTruncate a C=0 := Subtype.ext (Subsingleton.elim _ _) + simpa only [hz,norm_zero] using (norm_nonneg a).trans hR + rw [upperTruncate_cfc a ha C] + apply norm_cfc_le ((norm_nonneg a).trans hR) + intro t ht + have htR := (spectrum.norm_le_norm_of_mem ht).trans hR + rw [Real.norm_eq_abs,abs_le] at htR ⊢ + exact ⟨le_min htR.1 (by linarith), (min_le_left _ _).trans htR.2⟩ + +theorem upperTruncate_discard_mul (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (C : ℝ) : + (a-algebraMap ℝ M.toStarSubalgebra C)⁺ * upperTruncate a C = + C • (a-algebraMap ℝ M.toStarSubalgebra C)⁺ := by + let b := a-algebraMap ℝ M.toStarSubalgebra C + have hb : IsSelfAdjoint b := ha.sub (IsSelfAdjoint.algebraMap _ (IsSelfAdjoint.all C)) + have he : upperTruncate a C = algebraMap ℝ M.toStarSubalgebra C-b⁻ := by + have hh := CFC.posPart_sub_negPart b hb + have heq : a=b+algebraMap ℝ M.toStarSubalgebra C := by dsimp [b]; abel + change a-b⁺=algebraMap ℝ M.toStarSubalgebra C-b⁻ + nth_rw 1 [heq] + nth_rw 1 [← hh] + abel + rw [he,mul_sub,CFC.posPart_mul_negPart,sub_zero, + Algebra.algebraMap_eq_smul_one,mul_smul_comm,mul_one] + +theorem upperTruncate_distance (τ : TracialRepresentation M) + (a x : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (hx : IsSelfAdjoint x) : + τ.norm₂ (upperTruncate a ‖x‖-x)^2 + + τ.norm₂ ((a-algebraMap ℝ M.toStarSubalgebra ‖x‖)⁺)^2 ≤ τ.norm₂ (a-x)^2 := by + let d := (a-algebraMap ℝ M.toStarSubalgebra ‖x‖)⁺ + let z := upperTruncate a ‖x‖ + have hd : 0 ≤ d := CFC.posPart_nonneg _ + have had : a=z+d := by dsimp [z,d,upperTruncate]; abel + have hdz : d*z=‖x‖ • d := upperTruncate_discard_mul a ha ‖x‖ + have ht := trace_mul_le_norm τ d x hd hx + have hsq := norm₂_sub_sq τ (a-x) d + have hid : a-x-d=z-x := by rw [had]; abel + rw [hid,(ha.sub hx).star_eq,τ.trace_mul_comm (a-x) d] at hsq + have htrace : (τ.trace (d*(a-x))).re = + τ.norm₂ d^2+‖x‖*(τ.trace d).re-(τ.trace (d*x)).re := by + rw [had,mul_sub,mul_add,trace_sub,cornerTrace_add,hdz,← Complex.coe_smul, + cornerTrace_smul,Complex.sub_re,Complex.add_re,Complex.mul_re, + Complex.ofReal_re,Complex.ofReal_im,zero_mul,sub_zero] + rw [norm₂_sq_trace τ,hd.isSelfAdjoint.star_eq] + ring + rw [htrace] at hsq + change τ.norm₂ (z-x)^2 + τ.norm₂ d^2 ≤ τ.norm₂ (a-x)^2 + linarith + +end + +/-! Spectral truncation forces a self-adjoint least-distance point in a +subalgebra ball to have norm at most the norm of the ambient test operator. -/ +section +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} +local instance interiorCStar (A : VonNeumannAlgebra H) : CStarAlgebra A.toStarSubalgebra := {} +local instance interiorOrder (A : VonNeumannAlgebra H) : PartialOrder A.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance interiorPreorder (A : VonNeumannAlgebra H) : Preorder A.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance interiorLE (A : VonNeumannAlgebra H) : LE A.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toLE +local instance interiorStarOrder (A : VonNeumannAlgebra H) : StarOrderedRing A.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem included_selfAdjoint (hNM : N ≤ M) (a : N.toStarSubalgebra) (ha : IsSelfAdjoint a) : + IsSelfAdjoint (coordinateInclusion hNM a) := by + change star (coordinateInclusion hNM a)=coordinateInclusion hNM a + rw [← map_star,ha.star_eq] + +theorem included_upperTruncate (hNM : N ≤ M) (a : N.toStarSubalgebra) + (ha : IsSelfAdjoint a) (C : ℝ) : + coordinateInclusion hNM (upperTruncate a C)=upperTruncate (coordinateInclusion hNM a) C := by + rw [upperTruncate_cfc a ha C, + upperTruncate_cfc _ (included_selfAdjoint hNM a ha) C] + exact (coordinateInclusion hNM).map_cfc (fun t : ℝ => min t C) a + (by fun_prop) (by fun_prop) ha (included_selfAdjoint hNM a ha) + +theorem selfAdjoint_norm_le_of_bounds (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) + (C : ℝ) (hC : 0 ≤ C) (hu : a ≤ algebraMap ℝ M.toStarSubalgebra C) + (hl : -a ≤ algebraMap ℝ M.toStarSubalgebra C) : ‖a‖ ≤ C := by + obtain (hA | hA) := subsingleton_or_nontrivial M.toStarSubalgebra + · simpa only [Subsingleton.elim a 0,norm_zero] using hC + have hpos : ∀ t ∈ spectrum ℝ a,t ≤ C := by + apply (cfc_le_iff (fun t : ℝ => t) (fun _ => C) a).mp + rw [cfc_id' ℝ a ha,cfc_const C a ha] + exact hu + have hneg : ∀ t ∈ spectrum ℝ a,-t ≤ C := by + apply (cfc_le_iff (fun t : ℝ => -t) (fun _ => C) a).mp + rw [cfc_neg (fun t : ℝ => t) a,cfc_id' ℝ a ha,cfc_const C a ha] + exact hl + rcases CStarAlgebra.norm_or_neg_norm_mem_spectrum a ha with h | h + · exact hpos _ h + · simpa using hneg _ h + +theorem selfAdjoint_ball_minimum_upper (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (R : ℝ) + (c : N.toStarSubalgebra) (hc : IsSelfAdjoint c) (hcR : ‖c‖ ≤ R) + (hmin : ∀ a : N.toStarSubalgebra, IsSelfAdjoint a → ‖a‖ ≤ R → + τ.norm₂ (x-coordinateInclusion hNM c) ≤ τ.norm₂ (x-coordinateInclusion hNM a)) : + coordinateInclusion hNM c ≤ algebraMap ℝ M.toStarSubalgebra ‖x‖ := by + have hz := hmin (upperTruncate c ‖x‖) (upperTruncate_selfAdjoint c hc ‖x‖) + (upperTruncate_norm_le c hc ‖x‖ R (norm_nonneg _) hcR) + rw [included_upperTruncate hNM c hc] at hz + have hd := upperTruncate_distance τ (coordinateInclusion hNM c) x + (included_selfAdjoint hNM c hc) hx + have hrev (a b : M.toStarSubalgebra) : τ.norm₂ (a-b)=τ.norm₂ (b-a) := norm_sub_rev _ _ + rw [hrev x,hrev x] at hz + have he : τ.norm₂ ((coordinateInclusion hNM c-algebraMap ℝ M.toStarSubalgebra ‖x‖)⁺)=0 := by + nlinarith [show 0 ≤ τ.norm₂ (coordinateInclusion hNM c-x) from norm_nonneg _, + show 0 ≤ τ.norm₂ (upperTruncate (coordinateInclusion hNM c) ‖x‖-x) from norm_nonneg _, + show 0 ≤ τ.norm₂ ((coordinateInclusion hNM c-algebraMap ℝ M.toStarSubalgebra ‖x‖)⁺) from norm_nonneg _] + exact sub_nonpos.mp ((CFC.posPart_eq_zero_iff _ + ((included_selfAdjoint hNM c hc).sub (IsSelfAdjoint.algebraMap _ (IsSelfAdjoint.all ‖x‖)))).mp + ((τ.norm₂_eq_zero_iff _).mp he)) + +theorem selfAdjoint_ball_minimum_norm (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (R : ℝ) + (c : N.toStarSubalgebra) (hc : IsSelfAdjoint c) (hcR : ‖c‖ ≤ R) + (hmin : ∀ a : N.toStarSubalgebra, IsSelfAdjoint a → ‖a‖ ≤ R → + τ.norm₂ (x-coordinateInclusion hNM c) ≤ τ.norm₂ (x-coordinateInclusion hNM a)) : + ‖c‖ ≤ ‖x‖ := by + have hu := selfAdjoint_ball_minimum_upper τ hNM x hx R c hc hcR hmin + have hn := selfAdjoint_ball_minimum_upper τ hNM (-x) hx.neg R (-c) hc.neg + (by simpa using hcR) (by + intro a ha hRa + have h := hmin (-a) ha.neg (by simpa using hRa) + have hneg (b : M.toStarSubalgebra) : τ.norm₂ (-b)=τ.norm₂ b := norm_neg _ + rw [map_neg,show -x- -(coordinateInclusion hNM c)=-(x-coordinateInclusion hNM c) by abel, + show -x-coordinateInclusion hNM a=-(x-coordinateInclusion hNM (-a)) by rw [map_neg]; abel, + hneg,hneg] + exact h) + rw [map_neg,norm_neg] at hn + exact selfAdjoint_norm_le_of_bounds _ (included_selfAdjoint hNM c hc) ‖x‖ (norm_nonneg _) hu hn + +end + +/-! Two-sided spectral clipping and trace-norm control. The auxiliary trace +is explicit; the trace-free construction supplies it on its actual closure. -/ +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance clippingCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance clippingOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance clippingStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +def traceSymmetrize (a : M.toStarSubalgebra) : M.toStarSubalgebra := + (2 : ℂ)⁻¹ • (a+star a) + +theorem traceSymmetrize_selfAdjoint (a : M.toStarSubalgebra) : IsSelfAdjoint (traceSymmetrize a) := by + change star ((2 : ℂ)⁻¹ • (a+star a)) = (2 : ℂ)⁻¹ • (a+star a) + simp [add_comm] + +theorem traceSymmetrize_eq_self (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) : + traceSymmetrize a = a := by + simp only [traceSymmetrize,ha.star_eq,← two_smul ℂ a,smul_smul] + norm_num + +theorem traceSymmetrize_sub (a b : M.toStarSubalgebra) : + traceSymmetrize (a-b) = traceSymmetrize a-traceSymmetrize b := by + simp only [traceSymmetrize,star_sub,smul_add,smul_sub] + abel + +theorem traceSymmetrize_norm₂_le (τ : TracialRepresentation M) (a : M.toStarSubalgebra) : + τ.norm₂ (traceSymmetrize a) ≤ τ.norm₂ a := by + rw [traceSymmetrize,τ.norm₂_smul,norm_inv] + norm_num only [Complex.norm_ofNat] + have h := τ.norm₂_add_le a (star a) + rw [τ.norm₂_star] at h + linarith + +def traceClip (a : M.toStarSubalgebra) (C : ℝ) : M.toStarSubalgebra := + -upperTruncate (-upperTruncate a C) C + +theorem traceClip_selfAdjoint (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (C : ℝ) : + IsSelfAdjoint (traceClip a C) := + (upperTruncate_selfAdjoint _ (upperTruncate_selfAdjoint a ha C).neg C).neg + +theorem traceClip_cfc (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (C : ℝ) : + traceClip a C = cfc (fun t : ℝ => -min (-min t C) C) a := by + rw [traceClip,upperTruncate_cfc _ (upperTruncate_selfAdjoint a ha C).neg C, + upperTruncate_cfc a ha C,← cfc_neg (fun t : ℝ => min t C) a, + ← cfc_comp (fun t : ℝ => min t C) (fun t : ℝ => -min t C) a] + simp only [Function.comp_def] + rw [cfc_neg (fun t : ℝ => min (-min t C) C) a] + +theorem traceClip_norm_le (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) + (C : ℝ) (hC : 0 ≤ C) : ‖traceClip a C‖ ≤ C := by + rw [traceClip_cfc a ha C] + apply norm_cfc_le hC + intro t _ + rw [Real.norm_eq_abs,abs_le] + constructor + · exact neg_le_neg (min_le_right _ _) + · have h : -C ≤ min (-min t C) C := + le_min (neg_le_neg (min_le_right _ _)) (by linarith) + linarith + +theorem traceClip_distance (τ : TracialRepresentation M) (a x : M.toStarSubalgebra) + (ha : IsSelfAdjoint a) (hx : IsSelfAdjoint x) : + τ.norm₂ (traceClip a ‖x‖-x) ≤ τ.norm₂ (a-x) := by + have h₁ := upperTruncate_distance τ a x ha hx + have h₂ := upperTruncate_distance τ (-upperTruncate a ‖x‖) (-x) + (upperTruncate_selfAdjoint a ha ‖x‖).neg hx.neg + rw [norm_neg] at h₂ + have hn (b : M.toStarSubalgebra) : τ.norm₂ (-b) = τ.norm₂ b := norm_neg _ + have he : traceClip a ‖x‖-x = -(upperTruncate (-upperTruncate a ‖x‖) ‖x‖-(-x)) := by + dsimp [traceClip]; abel + have he' : -upperTruncate a ‖x‖-(-x) = -(upperTruncate a ‖x‖-x) := by abel + rw [he',hn] at h₂ + rw [he,hn] + have hnonneg : 0 ≤ τ.norm₂ (a-x) := norm_nonneg _ + nlinarith [sq_nonneg (τ.norm₂ ((a-algebraMap ℝ M.toStarSubalgebra ‖x‖)⁺)), + sq_nonneg (τ.norm₂ ((-upperTruncate a ‖x‖-algebraMap ℝ M.toStarSubalgebra ‖x‖)⁺))] + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Subfactors.lean b/lean/OAI/Analysis/FactorGeneration/Subfactors.lean new file mode 100644 index 0000000000000000000000000000000000000000..be86cec357d03f54bb19a88ebf1614e2a9073c48 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Subfactors.lean @@ -0,0 +1,543 @@ +import Mathlib.Analysis.Normed.Module.FiniteDimension +import OAI.Analysis.FactorGeneration.ProjectionComparison +import OAI.Analysis.FactorGeneration.SpectralApproximation + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! The actual von Neumann algebra of operators in N commuting with a finite +projection partition. Its double-commutant identity and completeness are +proved, so spectral approximation can be performed inside this algebra. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) + +def blockStarAlgebra (N : VonNeumannAlgebra H) : StarSubalgebra ℂ (H →L[ℂ] H) where + carrier := {a | a ∈ N ∧ ∀ i, (Q.piece i).val.val*a=a*(Q.piece i).val.val} + zero_mem' := ⟨N.zero_mem,by simp⟩ + one_mem' := ⟨N.one_mem,by simp⟩ + add_mem' ha hb := ⟨N.add_mem ha.1 hb.1,by + intro i + simp only [mul_add,add_mul,ha.2 i,hb.2 i]⟩ + mul_mem' ha hb := ⟨N.mul_mem ha.1 hb.1,by + intro i + rw [← mul_assoc,ha.2 i,mul_assoc,hb.2 i,← mul_assoc]⟩ + algebraMap_mem' c := ⟨N.toStarSubalgebra.algebraMap_mem c,by + intro i + exact (Algebra.commutes c _).symm⟩ + star_mem' ha := ⟨star_mem ha.1,by + intro i + have hs : star (Q.piece i).val.val=(Q.piece i).val.val := + congrArg Subtype.val (Q.piece i).property.isSelfAdjoint.star_eq + simpa only [star_mul,hs] using (congrArg star (ha.2 i)).symm⟩ + +theorem blockStarAlgebra_bicommutant (N : VonNeumannAlgebra H) : + Set.centralizer (Set.centralizer (Q.blockStarAlgebra N : Set (H →L[ℂ] H))) = + (Q.blockStarAlgebra N : Set (H →L[ℂ] H)) := by + apply Set.Subset.antisymm + · intro a ha + refine ⟨?_,?_⟩ + · change a ∈ (N : Set (H →L[ℂ] H)) + rw [← N.centralizer_centralizer] + intro b hb + exact ha b (fun c hc => hb c hc.1) + · intro i + apply ha + intro b hb + exact (hb.2 i).symm + · intro a ha b hb + exact (hb a ha).symm + +def blockVonNeumann (N : VonNeumannAlgebra H) : VonNeumannAlgebra H where + toStarSubalgebra := Q.blockStarAlgebra N + centralizer_centralizer' := Q.blockStarAlgebra_bicommutant N + +theorem blockVonNeumann_le (N : VonNeumannAlgebra H) : Q.blockVonNeumann N ≤ N := + fun _ h => h.1 + +theorem blockVonNeumann_mem_iff (N : VonNeumannAlgebra H) (a : M.toStarSubalgebra) : + a.val ∈ Q.blockVonNeumann N ↔ a.val ∈ N ∧ ∀ i, Commute (Q.piece i).val a := by + constructor + · rintro ⟨ha,hc⟩ + exact ⟨ha,fun i => Subtype.ext (hc i)⟩ + · rintro ⟨ha,hc⟩ + exact ⟨ha,fun i => congrArg Subtype.val (hc i).eq⟩ + +theorem piece_commute (i j : Fin Q.size) : Commute (Q.piece i).val (Q.piece j).val := by + by_cases h : i=j + · subst j; exact Commute.refl _ + · show (Q.piece i).val*(Q.piece j).val=(Q.piece j).val*(Q.piece i).val + rw [Q.orthogonal i j h,Q.orthogonal j i (Ne.symm h)] + +theorem piece_mem_blockVonNeumann (N : VonNeumannAlgebra H) + (hN : ∀ i, (Q.piece i).val.val ∈ N) (i : Fin Q.size) : + (Q.piece i).val.val ∈ Q.blockVonNeumann N := + (Q.blockVonNeumann_mem_iff N _).mpr ⟨hN i,fun j => Q.piece_commute j i⟩ + +theorem compression_mem_blockVonNeumann (N : VonNeumannAlgebra H) + (hN : ∀ i, (Q.piece i).val.val ∈ N) (i : Fin Q.size) + (a : M.toStarSubalgebra) (ha : a.val ∈ N) : + ((Q.piece i).val*a*(Q.piece i).val).val ∈ Q.blockVonNeumann N := by + apply (Q.blockVonNeumann_mem_iff N _).mpr + refine ⟨N.mul_mem (N.mul_mem (hN i) ha) (hN i),?_⟩ + intro j + by_cases h : j=i + · subst j + show (Q.piece i).val*((Q.piece i).val*a*(Q.piece i).val)= + ((Q.piece i).val*a*(Q.piece i).val)*(Q.piece i).val + simp only [← mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + simp only [mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + · show (Q.piece j).val*((Q.piece i).val*a*(Q.piece i).val)= + ((Q.piece i).val*a*(Q.piece i).val)*(Q.piece j).val + rw [← mul_assoc,← mul_assoc,Q.orthogonal j i h,zero_mul,zero_mul] + simp only [mul_assoc,Q.orthogonal i j (Ne.symm h),mul_zero] + +end CornerPartition + +end + +/-! Irreducibility passes to actual corners. Spectral approximation reduces +self-adjoint corner commutants to their projections; no corner-factor or +normalized-trace existence statement is assumed. -/ +section +open scoped BigOperators ComplexStarModule +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (P : StarSubalgebra ℂ M.toStarSubalgebra) [CompleteSpace P] +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P, (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + +include τ hirr in +/-- A self-adjoint element of the relative corner commutant is scalar in +that corner, including the zero corner. -/ +theorem selfAdjoint_corner_commutant_scalar (p : AlgebraProjection M) + (c : M.toStarSubalgebra) (hc : IsSelfAdjoint c) + (hl : p.val*c=c) (hr : c*p.val=c) + (hcomm : ∀ a : P, Commute c (p.val*(a : M.toStarSubalgebra)*p.val)) : + ∃ z : ℂ, c=z • p.val := by + let L : Submodule ℂ M.toStarSubalgebra := Submodule.span ℂ {p.val} + have hclosed : IsClosed (L : Set M.toStarSubalgebra) := L.closed_of_finiteDimensional + have hcL : c ∈ closure (L : Set M.toStarSubalgebra) := by + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨Q,d,hfix,hQ,hd⟩ := + exists_finite_spectral_approximation_preserving_commutant p c hc ε hε + have hpieces (i : Fin Q.size) : (Q.piece i).val ∈ L := by + have htriv := corner_commutant_projection_trivial τ P hirr p (Q.piece i) + (Q.piece_le i) (fun a => hQ (p.val*(a : M.toStarSubalgebra)*p.val) + (hcomm a) (by + show p.val*(p.val*(a : M.toStarSubalgebra)*p.val)= + (p.val*(a : M.toStarSubalgebra)*p.val)*p.val + simp only [← mul_assoc,p.property.isIdempotentElem.eq] + simp only [mul_assoc,p.property.isIdempotentElem.eq]) i) + rcases htriv with h | h + · rw [h]; exact L.zero_mem + · rw [h]; exact Submodule.subset_span (Set.mem_singleton _) + refine ⟨∑ i, (d i : ℂ) • (Q.piece i).val, + L.sum_mem (fun i _ => L.smul_mem _ (hpieces i)),?_⟩ + simpa only [dist_eq_norm,hl,hr] using hd + have hm : c ∈ L := by + change c ∈ (L : Set M.toStarSubalgebra) + rw [← hclosed.closure_eq] + exact hcL + exact Submodule.mem_span_singleton.mp hm |>.imp (fun z hz => hz.symm) + +omit [CompleteSpace P] in +/-- Taking adjoints preserves the supported relative-commutant condition. -/ +theorem corner_commutant_star (p : AlgebraProjection M) (c : M.toStarSubalgebra) + (hcomm : ∀ a : P, Commute c (p.val*(a : M.toStarSubalgebra)*p.val)) : + ∀ a : P, Commute (star c) (p.val*(a : M.toStarSubalgebra)*p.val) := by + intro a + have h := congrArg star (hcomm (star a)).eq + change star (c*(p.val*star (a : M.toStarSubalgebra)*p.val)) = + star ((p.val*star (a : M.toStarSubalgebra)*p.val)*c) at h + show star c*(p.val*(a : M.toStarSubalgebra)*p.val)= + (p.val*(a : M.toStarSubalgebra)*p.val)*star c + simpa only [star_mul,star_star,p.property.isSelfAdjoint.star_eq, + mul_assoc] using h.symm + +include τ hirr in +/-- Exact irreducibility in pMp, stated in ambient coordinates. The scalar +is the normalized corner trace when p is nonzero. -/ +theorem corner_commutant_scalar (p : AlgebraProjection M) (c : M.toStarSubalgebra) + (hl : p.val*c=c) (hr : c*p.val=c) + (hcomm : ∀ a : P, Commute c (p.val*(a : M.toStarSubalgebra)*p.val)) : + ∃ z : ℂ, c=z • p.val := by + have hsl : p.val*star c=star c := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq] using congrArg star hr + have hsr : star c*p.val=star c := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq] using congrArg star hl + have hstar := corner_commutant_star P p c hcomm + have hreal : ∀ a : P, Commute (ℜ c : M.toStarSubalgebra) + (p.val*(a : M.toStarSubalgebra)*p.val) := by + intro a + rw [realPart_apply_coe] + exact ((hcomm a).add_left (hstar a)).smul_left (2 : ℝ)⁻¹ + have himag : ∀ a : P, Commute (ℑ c : M.toStarSubalgebra) + (p.val*(a : M.toStarSubalgebra)*p.val) := by + intro a + rw [imaginaryPart_apply_coe] + exact (((hcomm a).sub_left (hstar a)).smul_left (2 : ℝ)⁻¹).smul_left (-Complex.I) + obtain ⟨a,ha⟩ := selfAdjoint_corner_commutant_scalar τ P hirr p (ℜ c) + (ℜ c).property (by simp [realPart_apply_coe,mul_add,hl,hsl]) + (by simp [realPart_apply_coe,add_mul,hr,hsr]) hreal + obtain ⟨b,hb⟩ := selfAdjoint_corner_commutant_scalar τ P hirr p (ℑ c) + (ℑ c).property (by simp [imaginaryPart_apply_coe,mul_sub,hl,hsl]) + (by simp [imaginaryPart_apply_coe,sub_mul,hr,hsr]) himag + refine ⟨a+Complex.I*b,?_⟩ + calc c = (ℜ c : M.toStarSubalgebra)+Complex.I • (ℑ c : M.toStarSubalgebra) := + (realPart_add_I_smul_imaginaryPart c).symm + _ = (a+Complex.I*b) • p.val := by rw [ha,hb,smul_smul,add_smul] + +end + +/-! The relative commutant of a finite block algebra consists of scalars on +each block. This statement is proved from coordinate irreducibility. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +namespace CornerPartition +variable (Q : CornerPartition (identityProjection M)) + +theorem pinch_eq_self_of_commutes (c : M.toStarSubalgebra) + (hc : ∀ i, Commute (Q.piece i).val c) : Q.pinch c=c := by + unfold pinch + calc (∑ i, (Q.piece i).val*c*(Q.piece i).val) = ∑ i, c*(Q.piece i).val := by + apply Finset.sum_congr rfl + intro i _ + rw [(hc i).eq,mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + _ = c := by rw [← Finset.mul_sum,Q.total]; exact mul_one c + +include τ in +theorem block_commutant_scalar_blocks + (hN : ∀ i, (Q.piece i).val.val ∈ N) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (c : M.toStarSubalgebra) + (hc : ∀ a : insideAlgebra (M := M) (P := Q.blockVonNeumann N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) : + ∃ z : Fin Q.size → ℂ, c=∑ i,z i • (Q.piece i).val := by + have hqi (i : Fin Q.size) : Commute (Q.piece i).val c := + hc ⟨(Q.piece i).val,Q.piece_mem_blockVonNeumann N hN i⟩ + have hlocal (i : Fin Q.size) : ∃ z : ℂ, + (Q.piece i).val*c*(Q.piece i).val=z • (Q.piece i).val := by + apply corner_commutant_scalar τ (insideAlgebra (M := M) (P := N)) hirr (Q.piece i) + · simp only [← mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + · simp only [mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + · intro a + have hb : Commute ((Q.piece i).val*(a : M.toStarSubalgebra)*(Q.piece i).val) c := + hc ⟨_,Q.compression_mem_blockVonNeumann N hN i a.val a.property⟩ + have hp : Commute ((Q.piece i).val*(a : M.toStarSubalgebra)*(Q.piece i).val) + (Q.piece i).val := by + show ((Q.piece i).val*(a : M.toStarSubalgebra)*(Q.piece i).val)*(Q.piece i).val= + (Q.piece i).val*((Q.piece i).val*(a : M.toStarSubalgebra)*(Q.piece i).val) + simp only [mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + simp only [← mul_assoc,(Q.piece i).property.isIdempotentElem.eq] + exact ((hp.mul_right hb).mul_right hp).symm + choose z hz using hlocal + exact ⟨z,(Q.pinch_eq_self_of_commutes c hqi).symm.trans + (Finset.sum_congr rfl (fun i _ => hz i))⟩ + +include τ in +theorem block_commutant_mem_subalgebra + (hN : ∀ i, (Q.piece i).val.val ∈ N) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : insideAlgebra (M := M) (P := N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) + (c : M.toStarSubalgebra) + (hc : ∀ a : insideAlgebra (M := M) (P := Q.blockVonNeumann N), + (a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) : c.val ∈ N := by + obtain ⟨z,rfl⟩ := Q.block_commutant_scalar_blocks τ hN hirr c hc + change (∑ i,z i • (Q.piece i).val) ∈ insideAlgebra (M := M) (P := N) + exact (insideAlgebra (M := M) (P := N)).sum_mem + (fun i _ => (insideAlgebra (M := M) (P := N)).smul_mem (hN i) (z i)) + +end CornerPartition + +end + +/-! Orthogonality to the prescribed subalgebra is stronger than global +centering. It is preserved by compressions and conjugations from that +subalgebra and removes every block scalar term exactly. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +def TraceOrthogonal (P : StarSubalgebra ℂ M.toStarSubalgebra) (x : M.toStarSubalgebra) : Prop := + ∀ a : P, τ.trace ((a : M.toStarSubalgebra)*x)=0 + +namespace TraceOrthogonal +variable {P : StarSubalgebra ℂ M.toStarSubalgebra} {x : M.toStarSubalgebra} +variable (hx : TraceOrthogonal τ P x) +include hx + +theorem trace_zero : τ.trace x=0 := by simpa using hx (1 : P) + +theorem compression (p : AlgebraProjection M) (hp : p.val ∈ P) : + TraceOrthogonal τ P (p.val*x*p.val) := by + intro a + have h := hx ⟨p.val*(a : M.toStarSubalgebra)*p.val,P.mul_mem (P.mul_mem hp a.property) hp⟩ + change τ.trace ((p.val*(a : M.toStarSubalgebra)*p.val)*x)=0 at h + calc τ.trace ((a : M.toStarSubalgebra)*(p.val*x*p.val)) = + τ.trace (p.val*((a : M.toStarSubalgebra)*(p.val*x))) := by + rw [← mul_assoc (a : M.toStarSubalgebra),τ.trace_mul_comm] + _ = 0 := by simpa only [mul_assoc] using h + +theorem conjugate (u : unitary M.toStarSubalgebra) (hu : (u : M.toStarSubalgebra) ∈ P) : + TraceOrthogonal τ P (conjugateLinear u x) := by + intro a + have h := hx ⟨star (u : M.toStarSubalgebra)*(a : M.toStarSubalgebra)*(u : M.toStarSubalgebra), + P.mul_mem (P.mul_mem (P.star_mem' hu) a.property) hu⟩ + change τ.trace ((a : M.toStarSubalgebra)*((u : M.toStarSubalgebra)*x*star (u : M.toStarSubalgebra)))=0 + rw [← mul_assoc (a : M.toStarSubalgebra),τ.trace_mul_comm] + simpa only [mul_assoc] using h + +theorem pinch {p : AlgebraProjection M} (Q : CornerPartition p) + (hQ : ∀ i,(Q.piece i).val ∈ P) : TraceOrthogonal τ P (Q.pinch x) := by + intro a + change coordinateTraceLinear τ ((a : M.toStarSubalgebra)*∑ i,(Q.piece i).val*x*(Q.piece i).val)=0 + rw [Finset.mul_sum,map_sum] + exact Finset.sum_eq_zero (fun i _ => hx.compression τ (Q.piece i) (hQ i) a) + +theorem cornerScalar_zero (p : AlgebraProjection M) (hp : p.val ∈ P) : + cornerScalar τ p x=0 := by + rw [cornerScalar,(hx.compression τ p hp).trace_zero τ,zero_div] + +theorem scalarEnergy_zero {p : AlgebraProjection M} (Q : CornerPartition p) + (hQ : ∀ i,(Q.piece i).val ∈ P) : Q.scalarEnergy τ x=0 := by + unfold CornerPartition.scalarEnergy + simp only [hx.cornerScalar_zero τ _ (hQ _),norm_zero,zero_pow (by decide : 2 ≠ 0),zero_mul, + Finset.sum_const_zero] + +end TraceOrthogonal + +/-- If an orthogonal operator is averaged by subalgebra unitaries and all +fixed points lie in the subalgebra, the actual least-norm orbit point is zero. -/ +theorem zero_mem_orbitHull_of_orthogonal + (P : StarSubalgebra ℂ M.toStarSubalgebra) + (G : Subgroup (unitary M.toStarSubalgebra)) + (hG : ∀ u : G,(u.val : M.toStarSubalgebra) ∈ P) + (hfixed : ∀ c : M.toStarSubalgebra, + (∀ u : G,conjugateLinear u.val c=c) → c ∈ P) + (x : M.toStarSubalgebra) (hx : TraceOrthogonal τ P x) : + (0 : H) ∈ traceOrbitHull τ G x := by + obtain ⟨c,_,hc,_,hfix⟩ := traceOrbitHull_minimum τ G x + have hcP := hfixed c hfix + have htest : ∀ u : G,τ.trace (star c*conjugateLinear u.val x)=0 := + fun u => (hx.conjugate τ u.val (hG u)) ⟨star c,P.star_mem' hcP⟩ + have hz := orbitHull_trace_test_zero τ G x c htest hc + have hv : baseVector τ c=0 := inner_self_eq_zero.mp hz + exact hv ▸ hc + +/-! Quantitative control of the scalar energy that survives compatible +refinement. An orthogonal residual changes none of the block traces. -/ +namespace CornerPartition +variable {p : AlgebraProjection M} (Q : CornerPartition p) + +theorem scalarEnergy_le_energy (x : M.toStarSubalgebra) : + Q.scalarEnergy τ x ≤ τ.norm₂ (Q.pinch x)^2 := by + have h := Q.scalarEnergy_le_refineBlocks τ (fun i => single (Q.piece i)) x + rw [Q.refineBlocks_pinch] at h + have he : (∑ i,(single (Q.piece i)).pinch x)=Q.pinch x := by + simp only [single_pinch] + rfl + rw [he] at h + exact h + +theorem cornerScalar_eq_of_orthogonal_difference + (P : StarSubalgebra ℂ M.toStarSubalgebra) (hp : p.val ∈ P) + (x y : M.toStarSubalgebra) (hxy : TraceOrthogonal τ P (x-y)) : + cornerScalar τ p x=cornerScalar τ p y := by + have h := (hxy.compression τ p hp).trace_zero τ + rw [mul_sub,sub_mul,trace_sub,sub_eq_zero] at h + exact congrArg (fun t : ℂ => t/τ.trace p.val) h + +theorem scalarEnergy_eq_of_orthogonal_difference + (P : StarSubalgebra ℂ M.toStarSubalgebra) (hQ : ∀ i,(Q.piece i).val ∈ P) + (x y : M.toStarSubalgebra) (hxy : TraceOrthogonal τ P (x-y)) : + Q.scalarEnergy τ x=Q.scalarEnergy τ y := by + unfold scalarEnergy + apply Finset.sum_congr rfl + intro i _ + rw [cornerScalar_eq_of_orthogonal_difference τ (p := Q.piece i) P (hQ i) x y hxy] + +/-- All later scalar terms are bounded by the already controlled coarse +energy of the subalgebra component. There is no claim that global centering +provides this bound. -/ +theorem refinement_scalarEnergy_le_component + (P : StarSubalgebra ℂ M.toStarSubalgebra) (R : CornerPartition p) + (hR : ∀ i,(R.piece i).val ∈ P) (hQR : Q.Refines R) + (x y : M.toStarSubalgebra) (hxy : TraceOrthogonal τ P (x-y)) : + R.scalarEnergy τ x ≤ τ.norm₂ (Q.pinch y)^2 := by + rw [R.scalarEnergy_eq_of_orthogonal_difference τ P hR x y hxy] + have h := Q.refinement_energy_le τ R hQR y + rw [← Q.pinch_energy τ,← R.pinch_energy τ] at h + exact (R.scalarEnergy_le_energy τ y).trans h + +theorem pinch_mem (P : StarSubalgebra ℂ M.toStarSubalgebra) + (hQ : ∀ i,(Q.piece i).val ∈ P) (y : M.toStarSubalgebra) (hy : y ∈ P) : + Q.pinch y ∈ P := + P.sum_mem (fun i _ => P.mul_mem (P.mul_mem (hQ i) hy) (hQ i)) + +/-- Pythagoras separates the orthogonal component from the component in P. -/ +theorem orthogonal_component_energy + (P : StarSubalgebra ℂ M.toStarSubalgebra) (hQ : ∀ i,(Q.piece i).val ∈ P) + (x y : M.toStarSubalgebra) (hy : y ∈ P) (hxy : TraceOrthogonal τ P (x-y)) : + τ.norm₂ (Q.pinch x)^2 = τ.norm₂ (Q.pinch (x-y))^2+τ.norm₂ (Q.pinch y)^2 := by + have ho : inner ℂ (baseVector τ (Q.pinch y)) (baseVector τ (Q.pinch (x-y)))=0 := by + rw [baseVector_inner_eq_trace] + exact (hxy.pinch τ Q hQ) ⟨star (Q.pinch y),P.star_mem' (Q.pinch_mem P hQ y hy)⟩ + have he : Q.pinch x=Q.pinch y+Q.pinch (x-y) := by rw [Q.pinch_sub]; abel + rw [he] + change ‖baseVector τ (Q.pinch y+Q.pinch (x-y))‖^2 = _ + rw [map_add,norm_add_sq (𝕜 := ℂ),ho] + change τ.norm₂ (Q.pinch y)^2+2*0+τ.norm₂ (Q.pinch (x-y))^2=_ + ring + +end CornerPartition + +end + +/-! A corner whose only projections are zero and its unit is scalar. +The proof constructs spectral approximations; minimality is not a scalar-corner axiom. -/ +section +open scoped BigOperators ComplexStarModule +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +theorem selfAdjoint_corner_scalar_of_projections (p : AlgebraProjection M) + (hmin : ∀ q : AlgebraProjection M,q ≤ p → q.val=0 ∨ q.val=p.val) + (c : M.toStarSubalgebra) (hc : IsSelfAdjoint c) + (hl : p.val*c=c) (hr : c*p.val=c) : ∃ z : ℂ,c=z • p.val := by + let L : Submodule ℂ M.toStarSubalgebra := Submodule.span ℂ {p.val} + have hclosed : IsClosed (L : Set M.toStarSubalgebra) := L.closed_of_finiteDimensional + have hm : c ∈ closure (L : Set M.toStarSubalgebra) := by + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨Q,d,_,hd⟩ := exists_finite_spectral_approximation p c hc ε hε + have hpieces (i : Fin Q.size) : (Q.piece i).val ∈ L := by + rcases hmin (Q.piece i) (Q.piece_le i) with h | h + · rw [h]; exact L.zero_mem + · rw [h]; exact Submodule.subset_span (Set.mem_singleton _) + refine ⟨∑ i,(d i : ℂ) • (Q.piece i).val, + L.sum_mem (fun i _ => L.smul_mem _ (hpieces i)),?_⟩ + simpa only [dist_eq_norm,hl,hr] using hd + rw [hclosed.closure_eq] at hm + exact (Submodule.mem_span_singleton.mp hm).imp (fun z hz => hz.symm) + +theorem corner_scalar_of_projections (p : AlgebraProjection M) + (hmin : ∀ q : AlgebraProjection M,q ≤ p → q.val=0 ∨ q.val=p.val) + (c : M.toStarSubalgebra) (hl : p.val*c=c) (hr : c*p.val=c) : + ∃ z : ℂ,c=z • p.val := by + have hsl : p.val*star c=star c := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq] using congrArg star hr + have hsr : star c*p.val=star c := by + simpa only [star_mul,p.property.isSelfAdjoint.star_eq] using congrArg star hl + obtain ⟨a,ha⟩ := selfAdjoint_corner_scalar_of_projections p hmin (ℜ c) + (ℜ c).property (by simp [realPart_apply_coe,mul_add,hl,hsl]) + (by simp [realPart_apply_coe,add_mul,hr,hsr]) + obtain ⟨b,hb⟩ := selfAdjoint_corner_scalar_of_projections p hmin (ℑ c) + (ℑ c).property (by simp [imaginaryPart_apply_coe,mul_sub,hl,hsl]) + (by simp [imaginaryPart_apply_coe,sub_mul,hr,hsr]) + refine ⟨a+Complex.I*b,?_⟩ + calc c = (ℜ c : M.toStarSubalgebra)+Complex.I • (ℑ c : M.toStarSubalgebra) := + (realPart_add_I_smul_imaginaryPart c).symm + _ = (a+Complex.I*b) • p.val := by rw [ha,hb,smul_smul,add_smul] + +end + +/-! Diffuseness descends to an irreducible von Neumann subalgebra of a +diffuse finite tracial algebra. Finiteness follows from the actual faithful trace. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {P M : VonNeumannAlgebra H} + +theorem irreducible_subalgebra_diffuse (τ : TracialRepresentation M) (hPM : P ≤ M) + (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : P.toStarSubalgebra,coordinateInclusion hPM a*c=c*coordinateInclusion hPM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (p : P.toStarSubalgebra) (hp : IsStarProjection p) (hp0 : p ≠ 0) : + ∃ q : P.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q := by + classical + by_contra hn + let pP : AlgebraProjection P := ⟨p,hp⟩ + have hmin : ∀ q : AlgebraProjection P,q ≤ pP → q.val=0 ∨ q.val=p := by + intro q hq + by_cases hq0 : q.val=0 + · exact Or.inl hq0 + by_cases hqp : q.val=p + · exact Or.inr hqp + exact False.elim (hn ⟨q.val,q.property,hq0,hqp,hq,projection_mul_of_le hq⟩) + let pM := includedProjection hPM pP + have hpM0 : pM.val ≠ 0 := by + intro h + apply hp0 + exact Subtype.ext (congrArg (fun b : M.toStarSubalgebra => b.val) h) + obtain ⟨q,hq,hq0,hqp,hpq,hqp'⟩ := hdiff pM.val pM.property hpM0 + let Q : StarSubalgebra ℂ M.toStarSubalgebra := insideAlgebra (M := M) (P := P) + have hirrQ : ∀ c : M.toStarSubalgebra, + (∀ a : Q,(a : M.toStarSubalgebra)*c=c*(a : M.toStarSubalgebra)) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra) := by + intro c hc + exact hirr c (fun a => hc ⟨coordinateInclusion hPM a,a.property⟩) + have hcomm : ∀ a : Q,Commute q (pM.val*(a : M.toStarSubalgebra)*pM.val) := by + intro a + let aP : P.toStarSubalgebra := ⟨a.val.val,a.property⟩ + obtain ⟨z,hz⟩ := corner_scalar_of_projections pP hmin (p*aP*p) + (by change p*(p*aP*p)=p*aP*p; simp only [← mul_assoc,hp.isIdempotentElem.eq]) + (by change (p*aP*p)*p=p*aP*p; simp only [mul_assoc,hp.isIdempotentElem.eq]) + have he : pM.val*(a : M.toStarSubalgebra)*pM.val=z • pM.val := by + exact Subtype.ext (congrArg (fun b : P.toStarSubalgebra => b.val) hz) + rw [he] + show q*(z • pM.val)=(z • pM.val)*q + rw [mul_smul_comm,smul_mul_assoc,hqp',hpq] + exact (corner_commutant_projection_trivial τ Q hirrQ pM ⟨q,hq⟩ hpq hcomm).elim hq0 hqp + +theorem tracial_isometry_coisometry (τ : TracialRepresentation M) + (v : M.toStarSubalgebra) (hv : star v*v=1) : v*star v=1 := by + let p : AlgebraProjection M := ⟨v*star v,by + constructor + · change (v*star v)*(v*star v)=v*star v + calc _ = v*(star v*v)*star v := by simp only [mul_assoc] + _ = v*star v := by rw [hv,mul_one] + · simp only [IsSelfAdjoint,star_mul,star_star]⟩ + have ht : τ.trace p.val=τ.trace (identityProjection M).val := by + change τ.trace (v*star v)=τ.trace 1 + rw [τ.trace_mul_comm,hv] + have h := projection_eq_of_le_of_trace_eq τ (p := p) (q := identityProjection M) + (one_mul _) ht + exact congrArg Subtype.val h + +theorem tracial_nonzero (τ : TracialRepresentation M) : (0 : H →L[ℂ] H) ≠ 1 := by + intro h + have hzero : τ.vector=0 := by + have he := congrArg (fun T : H →L[ℂ] H => T τ.vector) h + exact he.symm + have hn := τ.norm_vector + rw [hzero,norm_zero] at hn + exact zero_ne_one hn + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Supports.lean b/lean/OAI/Analysis/FactorGeneration/Supports.lean new file mode 100644 index 0000000000000000000000000000000000000000..9c165c4674fd8bcab42da9d7d27ee607e13ad888 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Supports.lean @@ -0,0 +1,411 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Order +import Mathlib.Analysis.InnerProductSpace.LinearMap +import Mathlib.Analysis.Normed.Operator.Extend +import Mathlib.Analysis.SpecialFunctions.ContinuousFunctionalCalculus.PosPart.Basic +import OAI.Analysis.FactorGeneration.ProjectionLimits + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Kernel and range projections constructed in the actual von Neumann algebra. +Membership follows from commutant invariance, with no spectral theorem assumed. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- The orthogonal projection onto an operator's kernel belongs to its +von Neumann algebra. This uses the actual double-commutant definition. -/ +theorem kernelProjection_mem (x : M.toStarSubalgebra) : + (x.val.ker).starProjection ∈ M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff + isStarProjection_starProjection M).mpr + intro y hy + rw [Submodule.range_starProjection] + intro ξ hξ + change x.val (y ξ)=0 + have hc := (VonNeumannAlgebra.mem_commutant_iff.mp hy) x.val x.property + have he := congrArg (fun t : H →L[ℂ] H => t ξ) hc + change x.val (y ξ)=y (x.val ξ) at he + rw [he,show x.val ξ=0 from hξ,map_zero] + +def kernelProjection (x : M.toStarSubalgebra) : AlgebraProjection M := + ⟨⟨x.val.ker.starProjection,kernelProjection_mem x⟩,by + constructor + · apply Subtype.ext + exact (isStarProjection_starProjection + (U := x.val.ker)).isIdempotentElem.eq + · apply Subtype.ext + exact (isStarProjection_starProjection + (U := x.val.ker)).isSelfAdjoint.star_eq⟩ + +theorem kernelProjection_apply (x : M.toStarSubalgebra) (ξ : H) : + ((kernelProjection x).val : H →L[ℂ] H) ξ = x.val.ker.starProjection ξ := rfl + +theorem mul_kernelProjection (x : M.toStarSubalgebra) : x*(kernelProjection x).val=0 := by + apply Subtype.ext + ext ξ + exact Submodule.starProjection_apply_mem x.val.ker ξ + +theorem kernelProjection_fixes (x : M.toStarSubalgebra) (ξ : H) (hξ : x.val ξ=0) : + ((kernelProjection x).val : H →L[ℂ] H) ξ=ξ := + Submodule.starProjection_eq_self_iff.mpr hξ + +/-- This is the largest algebra projection annihilated on the left by x. -/ +theorem le_kernelProjection_iff (x : M.toStarSubalgebra) (q : AlgebraProjection M) : + q ≤ kernelProjection x ↔ x*q.val=0 := by + constructor + · intro h + calc x*q.val = x*((kernelProjection x).val*q.val) := by rw [h] + _ = 0 := by rw [← mul_assoc,mul_kernelProjection,zero_mul] + · intro h + apply Subtype.ext + ext ξ + apply kernelProjection_fixes + have he := congrArg (fun t : M.toStarSubalgebra => (t : H →L[ℂ] H) ξ) h + exact he + +/-- The projection onto the closed range of x, expressed via ker(x*). -/ +def rangeProjection (x : M.toStarSubalgebra) : AlgebraProjection M := + ⟨1-(kernelProjection (star x)).val,(kernelProjection (star x)).property.one_sub⟩ + +theorem rangeProjection_mul (x : M.toStarSubalgebra) : (rangeProjection x).val*x=x := by + have h := congrArg star (mul_kernelProjection (star x)) + simp only [star_mul,(kernelProjection (star x)).property.isSelfAdjoint.star_eq, + star_star,star_zero] at h + change (1-(kernelProjection (star x)).val)*x=x + rw [sub_mul,one_mul,h,sub_zero] + +/-- Minimality retains any prescribed corner supporting x. -/ +theorem rangeProjection_le_iff (x : M.toStarSubalgebra) (q : AlgebraProjection M) : + rangeProjection x ≤ q ↔ q.val*x=x := by + constructor + · intro h + calc q.val*x = q.val*((rangeProjection x).val*x) := by rw [rangeProjection_mul] + _ = x := by rw [← mul_assoc,h,rangeProjection_mul] + · intro h + let r : AlgebraProjection M := ⟨1-q.val,q.property.one_sub⟩ + have hz : star x*r.val=0 := by + have hh := congrArg star h + simp only [star_mul,q.property.isSelfAdjoint.star_eq] at hh + change star x*(1-q.val)=0 + rw [mul_sub,mul_one,hh,sub_self] + have hr := (le_kernelProjection_iff (star x) r).mpr hz + have hs := projection_mul_of_le hr + change (1-q.val)*(kernelProjection (star x)).val=1-q.val at hs + change q.val*(1-(kernelProjection (star x)).val)=1-(kernelProjection (star x)).val + simp only [sub_mul,one_mul] at hs + simp only [mul_sub,mul_one] + apply (sub_eq_sub_iff_add_eq_add).mpr + have hh := (sub_eq_sub_iff_add_eq_add).mp hs + simpa only [add_comm,add_left_comm,add_assoc] using hh + +/-- Kernel projections fix the range of every operator they annihilate. -/ +theorem kernelProjection_mul_of_mul_eq_zero (x y : M.toStarSubalgebra) (h : x*y=0) : + (kernelProjection x).val*y=y := by + apply Subtype.ext + ext ξ + apply kernelProjection_fixes + exact congrArg (fun t : M.toStarSubalgebra => (t : H →L[ℂ] H) ξ) h + +/-- For self-adjoint x, its range projection kills every y killed by x. -/ +theorem rangeProjection_mul_eq_zero (x y : M.toStarSubalgebra) (hx : IsSelfAdjoint x) + (h : x*y=0) : (rangeProjection x).val*y=0 := by + change (1-(kernelProjection (star x)).val)*y=0 + rw [hx.star_eq,sub_mul,one_mul,kernelProjection_mul_of_mul_eq_zero x y h,sub_self] + +end + +/-! Spectral sign cuts from continuous positive parts and actual range projections. +These are constructed operators, not assumed Borel functional calculus data. -/ +open scoped CStarAlgebra +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance positiveSupportCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance positiveSupportOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance positiveSupportPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance positiveSupportLE : LE M.toStarSubalgebra := (CStarAlgebra.spectralOrder _).toLE +local instance positiveSupportStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +def positiveSupport (x : M.toStarSubalgebra) : AlgebraProjection M := rangeProjection x⁺ + +theorem positiveSupport_mul_pos (x : M.toStarSubalgebra) : + (positiveSupport x).val*x⁺=x⁺ := rangeProjection_mul _ + +theorem positiveSupport_mul_neg (x : M.toStarSubalgebra) : + (positiveSupport x).val*x⁻=0 := + rangeProjection_mul_eq_zero x⁺ x⁻ (CFC.posPart_nonneg x).isSelfAdjoint + (CFC.posPart_mul_negPart x) + +theorem positiveSupport_mul (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + (positiveSupport x).val*x=x⁺ := by + calc (positiveSupport x).val*x = (positiveSupport x).val*(x⁺-x⁻) := + congrArg (fun z => (positiveSupport x).val*z) (CFC.posPart_sub_negPart x hx).symm + _ = x⁺ := by rw [mul_sub,positiveSupport_mul_pos,positiveSupport_mul_neg,sub_zero] + +theorem mul_positiveSupport (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + x*(positiveSupport x).val=x⁺ := by + have h := congrArg star (positiveSupport_mul x hx) + simpa only [star_mul,hx.star_eq,(positiveSupport x).property.isSelfAdjoint.star_eq, + (CFC.posPart_nonneg x).isSelfAdjoint.star_eq] using h + +theorem positiveSupport_commutes (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + Commute (positiveSupport x).val x := by + show (positiveSupport x).val*x=x*(positiveSupport x).val + rw [positiveSupport_mul x hx,mul_positiveSupport x hx] + +theorem positiveSupport_compression (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + (positiveSupport x).val*x*(positiveSupport x).val=x⁺ := by + rw [mul_assoc,mul_positiveSupport x hx,positiveSupport_mul_pos] + +theorem positiveSupport_complement_mul (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) : + (1-(positiveSupport x).val)*x = -x⁻ := by + rw [sub_mul,one_mul,positiveSupport_mul x hx] + calc x-x⁺ = (x⁺-x⁻)-x⁺ := congrArg (fun z => z-x⁺) (CFC.posPart_sub_negPart x hx).symm + _ = -x⁻ := by abel + +theorem positiveSupport_complement_compression (x : M.toStarSubalgebra) + (hx : IsSelfAdjoint x) : + (1-(positiveSupport x).val)*x*(1-(positiveSupport x).val) = -x⁻ := by + have hright : x⁻*(positiveSupport x).val=0 := by + have h := congrArg star (positiveSupport_mul_neg x) + simpa only [star_mul,(positiveSupport x).property.isSelfAdjoint.star_eq, + (CFC.negPart_nonneg x).isSelfAdjoint.star_eq,star_zero] using h + rw [positiveSupport_complement_mul x hx,mul_sub,mul_one,neg_mul,hright,neg_zero,sub_zero] + +def spectralCut (x : M.toStarSubalgebra) (t : ℝ) : AlgebraProjection M := + positiveSupport (x-(t : ℂ) • (1 : M.toStarSubalgebra)) + +theorem spectralShift_selfAdjoint (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (t : ℝ) : + IsSelfAdjoint (x-(t : ℂ) • (1 : M.toStarSubalgebra)) := by + apply hx.sub + change star ((t : ℂ) • (1 : M.toStarSubalgebra)) = _ + simp only [star_smul,star_one,Complex.star_def,Complex.conj_ofReal] + +/-- The high spectral corner has nonnegative shifted compression. -/ +theorem spectralCut_lower (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (t : ℝ) : + 0 ≤ (spectralCut x t).val*(x-(t : ℂ) • (1 : M.toStarSubalgebra))*(spectralCut x t).val := by + rw [spectralCut,positiveSupport_compression _ (spectralShift_selfAdjoint x hx t)] + exact CFC.posPart_nonneg _ + +/-- Its complement has nonpositive shifted compression. -/ +theorem spectralCut_upper_complement (x : M.toStarSubalgebra) (hx : IsSelfAdjoint x) (t : ℝ) : + (1-(spectralCut x t).val)*(x-(t : ℂ) • (1 : M.toStarSubalgebra))* + (1-(spectralCut x t).val) ≤ 0 := by + rw [spectralCut,positiveSupport_complement_compression _ (spectralShift_selfAdjoint x hx t)] + exact neg_nonpos.mpr (CFC.negPart_nonneg _) + +end + +/-! A polar operator is constructed by extending the isometry on a range. +No polar-decomposition or projection-comparison hypothesis is used. -/ +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +theorem exists_isometric_range_factor (a x : H →L[ℂ] H) + (hnorm : ∀ ξ, ‖x ξ‖ = ‖a ξ‖) : + ∃ v : H →L[ℂ] H, v * a = x ∧ + star v * v = a.range.topologicalClosure.starProjection ∧ + v * a.range.topologicalClosure.starProjection = v := by + let K := a.range.topologicalClosure + let e : a.range →L[ℂ] K := + ⟨Submodule.inclusion a.range.le_topologicalClosure, + continuous_inclusion a.range.le_topologicalClosure⟩ + have hd : DenseRange e := + (denseRange_inclusion_iff a.range.le_topologicalClosure).mpr (by rfl) + have he : IsUniformInducing e := + (show Isometry e from fun _ _ => rfl).isUniformInducing + let f : a.range →L[ℂ] H := x.toLinearMap.compLeftInverse a.toLinearMap + have hf (ξ : H) : f ⟨a ξ, ⟨ξ, rfl⟩⟩ = x ξ := + LinearMap.compLeftInverse_apply_of_bdd _ _ ⟨1, by simp [hnorm]⟩ _ _ rfl + let g : K →L[ℂ] H := f.extend e + have hg (ξ : H) : g (e ⟨a ξ, ⟨ξ, rfl⟩⟩) = x ξ := + (ContinuousLinearMap.extend_eq f hd he _).trans (hf ξ) + have hgNorm : ∀ ξ : K, ‖g ξ‖ = ‖ξ‖ := by + intro ξ + refine hd.induction_on (p := fun ζ : K => ‖g ζ‖=‖ζ‖) ξ + (isClosed_eq (g.continuous.norm) continuous_norm) ?_ + rintro ⟨_, ζ, rfl⟩ + exact (congrArg norm (hg ζ)).trans (hnorm ζ) + let v : H →L[ℂ] H := g.comp K.orthogonalProjectionOnto + have hva : v * a = x := by + ext ξ + change g (K.orthogonalProjectionOnto (a ξ)) = x ξ + have hh : K.orthogonalProjectionOnto (a ξ) = e ⟨a ξ, ⟨ξ,rfl⟩⟩ := by + apply Subtype.ext + exact Submodule.starProjection_eq_self_iff.mpr + (a.range.le_topologicalClosure ⟨ξ,rfl⟩) + rw [hh,hg] + have hvs : v * K.starProjection = v := by + ext ξ + change g (K.orthogonalProjectionOnto (K.starProjection ξ)) = + g (K.orthogonalProjectionOnto ξ) + congr 1 + exact K.orthogonalProjectionOnto_mem_subspace_eq_self _ + refine ⟨v,hva,?_,hvs⟩ + have heq : (star v * v).toLinearMap = K.starProjection.toLinearMap := by + apply (ext_inner_map _ _).mp + intro ξ + change inner ℂ ((star v) (v ξ)) ξ = inner ℂ (K.starProjection ξ) ξ + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left, + inner_self_eq_norm_sq_to_K] + change (‖g (K.orthogonalProjectionOnto ξ)‖ : ℂ)^2 = _ + rw [hgNorm] + have hh := Submodule.inner_orthogonalProjectionOnto_eq_of_mem_left + (𝕜 := ℂ) (K.orthogonalProjectionOnto ξ) ξ + rw [inner_self_eq_norm_sq_to_K] at hh + rw [Submodule.starProjection_apply] + exact hh + ext ξ + exact congrArg (fun t : H →ₗ[ℂ] H => t ξ) heq + +end + +/-! Polar decomposition inside the given concrete von Neumann algebra. -/ +open scoped CStarAlgebra +section +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance polarCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance polarOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance polarStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem rangeProjection_eq_closure_projection (x : M.toStarSubalgebra) : + ((rangeProjection x).val : H →L[ℂ] H) = x.val.range.topologicalClosure.starProjection := by + have he : (star x.val).kerᗮ = x.val.range.topologicalClosure := by + simpa only [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_adjoint] + using (star x.val).orthogonal_ker + change 1-(star x.val).ker.starProjection = _ + have hh := (Submodule.starProjection_orthogonal (star x.val).ker).symm + simp only [he] at hh + exact hh + +theorem mul_closure_range_projection_eq_zero (a b : H →L[ℂ] H) (h : b*a=0) : + b*a.range.topologicalClosure.starProjection=0 := by + have hr : a.range ≤ b.ker := by + rintro _ ⟨ξ,rfl⟩ + exact congrArg (fun t : H →L[ℂ] H => t ξ) h + have hc : a.range.topologicalClosure ≤ b.ker := + a.range.topologicalClosure_minimal hr b.isClosed_ker + ext ξ + exact hc (Submodule.starProjection_apply_mem _ ξ) + +theorem exists_polar_decomposition (x : M.toStarSubalgebra) : + ∃ v : M.toStarSubalgebra, + v * CFC.sqrt (star x*x) = x ∧ + star v*v = (rangeProjection (CFC.sqrt (star x*x))).val ∧ + v*(rangeProjection (CFC.sqrt (star x*x))).val=v := by + let a := CFC.sqrt (star x*x) + have ha : IsSelfAdjoint a := (CFC.sqrt_nonneg _).isSelfAdjoint + have haa : a*a=star x*x := CFC.sqrt_mul_sqrt_self _ (star_mul_self_nonneg _) + have hn (ξ : H) : ‖x.val ξ‖=‖a.val ξ‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + have he := congrArg (fun t : M.toStarSubalgebra => + inner ℂ ξ ((t : H →L[ℂ] H) ξ)) haa + have has : star a.val=a.val := congrArg Subtype.val ha.star_eq + have hs (z : H →L[ℂ] H) : inner ℂ ξ ((star z*z) ξ) = (‖z ξ‖ : ℂ)^2 := by + rw [mul_apply_eq_comp,ContinuousLinearMap.star_eq_adjoint, + ContinuousLinearMap.adjoint_inner_right,inner_self_eq_norm_sq_to_K] + rfl + have he' : (‖a.val ξ‖ : ℂ)^2 = (‖x.val ξ‖ : ℂ)^2 := by + calc _ = inner ℂ ξ ((star a.val*a.val) ξ) := (hs _).symm + _ = inner ℂ ξ ((star x.val*x.val) ξ) := by rw [has]; exact he + _ = _ := hs _ + exact_mod_cast he'.symm + obtain ⟨v,hva,hvi,hvs⟩ := exists_isometric_range_factor a.val x.val hn + let s := rangeProjection a + have hs : (s.val : H →L[ℂ] H)=a.val.range.topologicalClosure.starProjection := + rangeProjection_eq_closure_projection a + rw [← hs] at hvi hvs + have hmem : v ∈ M := by + rw [← M.commutant_commutant] + apply VonNeumannAlgebra.mem_commutant_iff.mpr + intro y hy + have hya := (VonNeumannAlgebra.mem_commutant_iff.mp hy) a.val a.property + have hyx := (VonNeumannAlgebra.mem_commutant_iff.mp hy) x.val x.property + have hys := (VonNeumannAlgebra.mem_commutant_iff.mp hy) s.val.val s.val.property + have hz : (y*v-v*y)*a.val=0 := by + rw [sub_mul,mul_assoc,hva,mul_assoc,← hya,← mul_assoc,hva,hyx,sub_self] + have hd := mul_closure_range_projection_eq_zero a.val (y*v-v*y) hz + rw [← hs,sub_mul,mul_assoc,hvs,mul_assoc,← hys,← mul_assoc,hvs] at hd + exact sub_eq_zero.mp hd + exact ⟨⟨v,hmem⟩,Subtype.ext hva,Subtype.ext hvi,Subtype.ext hvs⟩ + +end + +/-! Exact initial and final support projections of the constructed polar part. -/ +open scoped CStarAlgebra +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance polarSupportsCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance polarSupportsOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance polarSupportsStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ + +theorem sqrt_rangeProjection (x : M.toStarSubalgebra) : + rangeProjection (CFC.sqrt (star x*x)) = rangeProjection (star x) := by + let a := CFC.sqrt (star x*x) + have ha : star a=a := (CFC.sqrt_nonneg _).isSelfAdjoint.star_eq + have he : star a.val*a.val=star x.val*x.val := by + change ((star a*a : M.toStarSubalgebra) : H →L[ℂ] H)=_ + rw [ha,CFC.sqrt_mul_sqrt_self _ (star_mul_self_nonneg _)] + rfl + have hk (z : H →L[ℂ] H) : (star z*z).ker=z.ker := by + exact z.ker_adjoint_comp_self + have hker : a.val.ker=x.val.ker := by rw [← hk a.val,he,hk] + apply Subtype.ext + apply Subtype.ext + change 1-(star a.val).ker.starProjection=1-(star (star x.val)).ker.starProjection + have has : star a.val=a.val := congrArg Subtype.val ha + simp only [has,star_star,hker] + +theorem exists_polar_with_supports (x : M.toStarSubalgebra) : + ∃ v : M.toStarSubalgebra, + v*CFC.sqrt (star x*x)=x ∧ + star v*v=(rangeProjection (star x)).val ∧ + v*star v=(rangeProjection x).val := by + obtain ⟨v,hvx,hvi,hvs⟩ := exists_polar_decomposition x + let a := CFC.sqrt (star x*x) + let s := rangeProjection a + have ht : IsStarProjection (v*star v) := by + constructor + · change (v*star v)*(v*star v)=v*star v + calc _ = (v*(star v*v))*star v := by simp only [mul_assoc] + _ = v*star v := by rw [hvi,hvs] + · exact IsSelfAdjoint.mul_star_self v + let t : AlgebraProjection M := ⟨v*star v,ht⟩ + have hxt : rangeProjection x ≤ t := by + apply (rangeProjection_le_iff x t).mpr + change (v*star v)*x=x + calc _ = (v*star v)*(v*a) := by rw [hvx] + _ = (v*(star v*v))*a := by simp only [mul_assoc] + _ = x := by rw [hvi,hvs,hvx] + have htx : t ≤ rangeProjection x := by + let r := rangeProjection x + have hz : (r.val*v-v)*a=0 := by + rw [sub_mul,mul_assoc,hvx,rangeProjection_mul,sub_self] + have he := mul_closure_range_projection_eq_zero a.val + ((r.val*v-v : M.toStarSubalgebra) : H →L[ℂ] H) + (congrArg Subtype.val hz) + rw [← rangeProjection_eq_closure_projection a] at he + have he' : (r.val*v-v)*s.val=0 := Subtype.ext he + rw [sub_mul,mul_assoc,hvs] at he' + change r.val*(v*star v)=v*star v + rw [← mul_assoc,sub_eq_zero.mp he'] + refine ⟨v,hvx,?_,?_⟩ + · simpa only [sqrt_rangeProjection] using hvi + · exact congrArg (fun z : AlgebraProjection M => z.val) (le_antisymm htx hxt) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Target.lean b/lean/OAI/Analysis/FactorGeneration/Target.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c1e60d68e3e31caf1f8392ce8242db16cc467bf --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Target.lean @@ -0,0 +1,84 @@ +import Mathlib.Analysis.InnerProductSpace.WeakOperatorTopology +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +namespace Generator + +/-! Weak operator generation of concrete finite diffuse factors with separable Banach preduals. -/ +noncomputable section +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- Weak operator closedness, not operator norm closedness. -/ +def WOTClosed (S : StarSubalgebra ℂ (H →L[ℂ] H)) : Prop := + IsClosed {T : H →WOT[ℂ] H | T.toCLM ∈ S} + +/-- The manuscript's W*(s), as the intersection of all weakly closed unital +star subalgebras containing s. This does not invoke a double-commutant theorem. -/ +def wstar (s : Set (H →L[ℂ] H)) : StarSubalgebra ℂ (H →L[ℂ] H) := + sInf {S | WOTClosed S ∧ s ⊆ S} + +theorem subset_wstar (s : Set (H →L[ℂ] H)) : s ⊆ wstar s := by + intro x hx + exact StarSubalgebra.mem_sInf.mpr fun S hS => hS.2 hx + +theorem wstar_le {s : Set (H →L[ℂ] H)} {S : StarSubalgebra ℂ (H →L[ℂ] H)} + (hS : WOTClosed S) (hs : s ⊆ S) : wstar s ≤ S := + sInf_le ⟨hS, hs⟩ + +theorem wstar_mono {s t : Set (H →L[ℂ] H)} (h : s ⊆ t) : wstar s ≤ wstar t := by + intro x hx + apply StarSubalgebra.mem_sInf.mpr + intro S hS + exact StarSubalgebra.mem_sInf.mp hx S ⟨hS.1, h.trans hS.2⟩ + +theorem wstar_closed (s : Set (H →L[ℂ] H)) : WOTClosed (wstar s) := by + unfold WOTClosed + have heq : {T : H →WOT[ℂ] H | T.toCLM ∈ wstar s} = + ⋂ (S : StarSubalgebra ℂ (H →L[ℂ] H)) (_ : WOTClosed S ∧ s ⊆ S), + {T : H →WOT[ℂ] H | T.toCLM ∈ S} := by + ext T + simp only [Set.mem_ofPred_eq, Set.mem_iInter, wstar, StarSubalgebra.mem_sInf] + rw [heq] + exact isClosed_iInter fun S => isClosed_iInter fun h => h.1 + +theorem wstar_eq (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : WOTClosed S) : + wstar (S : Set (H →L[ℂ] H)) = S := + le_antisymm (wstar_le hS (fun _ h => h)) (subset_wstar _) + +theorem wstar_idempotent (s : Set (H →L[ℂ] H)) : + wstar (wstar s : Set (H →L[ℂ] H)) = wstar s := + wstar_eq _ (wstar_closed _) + +/-- A nonzero finite diffuse factor, stated by its center, isometries, and +projections. These hypotheses do not include any generation conclusion. -/ +structure IsII1Factor (S : StarSubalgebra ℂ (H →L[ℂ] H)) : Prop where + nonzero : (0 : H →L[ℂ] H) ≠ 1 + weaklyClosed : WOTClosed S + factor : ∀ x : S, (∀ y : S, y * x = x * y) → ∃ c : ℂ, x = algebraMap ℂ S c + finite : ∀ v : S, star v * v = 1 → v * star v = 1 + diffuse : ∀ p : S, IsStarProjection p → p ≠ 0 → + ∃ q : S, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p * q = q ∧ q * p = q + +/-- Separable Banach predual, matching the existential predual convention of +mathlib's WStarAlgebra. This is not norm separability of S. -/ +def HasSeparablePredual (S : StarSubalgebra ℂ (H →L[ℂ] H)) : Prop := + ∃ (X : Type u) (_ : NormedAddCommGroup X) (_ : NormedSpace ℂ X) + (_ : CompleteSpace X) (_ : TopologicalSpace.SeparableSpace X), + Nonempty (StrongDual ℂ X ≃ₗᵢ⋆[ℂ] S) + +/-- Generation of the same algebra by one of its bounded operators. -/ +def SinglyGenerated (S : StarSubalgebra ℂ (H →L[ℂ] H)) : Prop := + ∃ x ∈ S, wstar {x} = S + +/-- The single-generation proposition for nonzero finite diffuse factors with separable Banach preduals. -/ +def MainTarget : Prop := + ∀ (S : StarSubalgebra ℂ (H →L[ℂ] H)), + IsII1Factor S → HasSeparablePredual S → SinglyGenerated S + +end + +end Generator + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/TensorRefinement.lean b/lean/OAI/Analysis/FactorGeneration/TensorRefinement.lean new file mode 100644 index 0000000000000000000000000000000000000000..10d7e9d7bb823fca8b41c13e2ae925315d722602 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/TensorRefinement.lean @@ -0,0 +1,211 @@ +import OAI.Analysis.FactorGeneration.MatrixSequence + +namespace OAI + +noncomputable section + +namespace Generator.FiniteMatrixStage + +/-! A finite refinement retaining its actual commuting matrix factor. +The relation composes, so finite energy descent can retain these witnesses. -/ +section +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def TensorExtension (E F : FiniteMatrixStage N) : Prop := + ∃ G : FiniteMatrixStage N, + (∀ i j k l,Commute (E.units.entry i j) (G.units.entry k l)) ∧ + F.units.algebra=E.units.algebra ⊔ G.units.algebra + +theorem TensorExtension.algebra_le {E F : FiniteMatrixStage N} (h : TensorExtension E F) : + E.units.algebra ≤ F.units.algebra := by + obtain ⟨G,_,hG⟩ := h + rw [hG] + exact le_sup_left + +theorem TensorExtension.refl (E : FiniteMatrixStage N) : TensorExtension E E := by + refine ⟨scalarStage N,fun _ _ _ _ => Commute.one_right _,?_⟩ + symm + apply sup_eq_left.mpr + apply ((scalarStage N).units.algebra_le_iff _).mpr + intro i j + exact E.units.algebra.one_mem + +theorem TensorExtension.trans {E F G : FiniteMatrixStage N} + (hEF : TensorExtension E F) (hFG : TensorExtension F G) : TensorExtension E G := by + obtain ⟨D,hD,hFD⟩ := hEF + obtain ⟨K,hK,hGK⟩ := hFG + have hDF : D.units.algebra ≤ F.units.algebra := by rw [hFD]; exact le_sup_right + have hEF : E.units.algebra ≤ F.units.algebra := by rw [hFD]; exact le_sup_left + have hDK : ∀ i j k l,Commute (D.units.entry i j) (K.units.entry k l) := by + intro i j k l + exact (F.units.commute_algebra_iff _).mpr (fun a b => hK a b k l) _ + (hDF (D.units.entry_mem i j)) + let P := D.units.product K.units hDK + let eqv := (Fintype.equivFin (Fin D.size × Fin K.size)).symm + let L : FiniteMatrixStage N := ⟨Fintype.card (Fin D.size × Fin K.size),by + simpa using Nat.mul_pos D.positive K.positive,P.reindex eqv⟩ + refine ⟨L,?_,?_⟩ + · intro i j k l + change Commute (E.units.entry i j) + (D.units.entry (eqv k).1 (eqv l).1*K.units.entry (eqv k).2 (eqv l).2) + apply (hD i j _ _).mul_right + exact (F.units.commute_algebra_iff _).mpr (fun a b => hK a b _ _) _ + (hEF (E.units.entry_mem i j)) + · change G.units.algebra=E.units.algebra ⊔ (P.reindex eqv).algebra + rw [P.reindex_algebra,D.units.product_algebra_eq_sup,hGK,hFD,sup_assoc] + +theorem exists_tensor_refinement_descent (E : FiniteMatrixStage N) (τ : TracialRepresentation M) + (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : M.toStarSubalgebra) (ht : τ.trace x=0) : + ∃ F : FiniteMatrixStage N,TensorExtension E F ∧ + F.energy τ hNM x ≤ (15/16 : ℝ)*E.energy τ hNM x := by + by_cases hz : conditionalExpectation τ (E.commutant_le hNM) x=0 + · refine ⟨E,TensorExtension.refl E,?_⟩ + simp [energy,hz] + · obtain ⟨k,n,hn,F,hc,_,hdesc⟩ := exists_compatible_matrix_energy_descent τ hNM + hfactor hdiff hirr E.units ⟨0,E.positive⟩ x ht hz + have hnpos : 0 < n := by rw [hn]; positivity + let G := E.units.product F hc + let eqv := (Fintype.equivFin (Fin E.size × Fin n)).symm + let S : FiniteMatrixStage N := ⟨Fintype.card (Fin E.size × Fin n),by + simpa using Nat.mul_pos E.positive hnpos,G.reindex eqv⟩ + refine ⟨S,⟨⟨n,hnpos,F⟩,hc,?_⟩,?_⟩ + · change (G.reindex eqv).algebra=E.units.algebra ⊔ F.algebra + rw [G.reindex_algebra,E.units.product_algebra_eq_sup] + · change τ.norm₂ (conditionalExpectation τ + ((G.reindex eqv).map (coordinateInclusion hNM)).relativeVonNeumann_le x)^2 ≤ _ + simp only [G.mapped_reindex_relative eqv (coordinateInclusion hNM)] + exact hdesc + +end + +/-! Tensor-factor-retaining compatible refinements attain every positive +finite-family commutant expectation budget. The reduction factor is proved. -/ +section +open scoped BigOperators +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hNM : N ≤ M) +variable (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) +variable (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) +include hfactor hdiff hirr + +theorem exists_tensor_finite_family_descent {σ : Type*} (S : Finset σ) + (x : σ → M.toStarSubalgebra) (ht : ∀ s ∈ S,τ.trace (x s)=0) (E : FiniteMatrixStage N) : + ∃ F : FiniteMatrixStage N,TensorExtension E F ∧ + ∀ s ∈ S,F.energy τ hNM (x s) ≤ (15/16 : ℝ)*E.energy τ hNM (x s) := by + classical + induction S using Finset.induction_on with + | empty => exact ⟨E,TensorExtension.refl E,by simp⟩ + | @insert s S hs ih => + obtain ⟨F,hEF,hF⟩ := ih (fun t ht' => ht t (Finset.mem_insert_of_mem ht')) + obtain ⟨G,hFG,hG⟩ := F.exists_tensor_refinement_descent τ hNM hfactor hdiff hirr (x s) + (ht s (Finset.mem_insert_self s S)) + refine ⟨G,hEF.trans hFG,?_⟩ + intro t ht' + rcases Finset.mem_insert.mp ht' with rfl | ht' + · exact hG.trans (mul_le_mul_of_nonneg_left (E.energy_antitone F τ hNM hEF.algebra_le _) (by norm_num)) + · exact (F.energy_antitone G τ hNM hFG.algebra_le _).trans (hF t ht') + +theorem exists_tensor_iterated_energy_descent {σ : Type*} (S : Finset σ) + (x : σ → M.toStarSubalgebra) (ht : ∀ s ∈ S,τ.trace (x s)=0) + (E : FiniteMatrixStage N) (r : ℕ) : + ∃ F : FiniteMatrixStage N,TensorExtension E F ∧ + ∀ s ∈ S,F.energy τ hNM (x s) ≤ (15/16 : ℝ)^r*E.energy τ hNM (x s) := by + induction r with + | zero => exact ⟨E,TensorExtension.refl E,by simp⟩ + | succ r ih => + obtain ⟨F,hEF,hF⟩ := ih + obtain ⟨G,hFG,hG⟩ := exists_tensor_finite_family_descent τ hNM hfactor hdiff hirr S x ht F + refine ⟨G,hEF.trans hFG,?_⟩ + intro s hs + calc G.energy τ hNM (x s) ≤ (15/16 : ℝ)*F.energy τ hNM (x s) := hG s hs + _ ≤ (15/16 : ℝ)*((15/16 : ℝ)^r*E.energy τ hNM (x s)) := + mul_le_mul_of_nonneg_left (hF s hs) (by norm_num) + _ = _ := by rw [pow_succ]; ring + +theorem exists_tensor_finite_matrix_energy_budget {σ : Type*} (S : Finset σ) + (x : σ → M.toStarSubalgebra) (ht : ∀ s ∈ S,τ.trace (x s)=0) + (E : FiniteMatrixStage N) (ε : ℝ) (hε : 0 < ε) : + ∃ F : FiniteMatrixStage N,TensorExtension E F ∧ + (∑ s ∈ S,F.energy τ hNM (x s)) < ε := by + let A := ∑ s ∈ S,E.energy τ hNM (x s) + have hA : 0 ≤ A := Finset.sum_nonneg (fun s _ => E.energy_nonneg τ hNM (x s)) + obtain ⟨r,hr⟩ := exists_pow_lt_of_lt_one + (show 0 < ε/(A+1) from div_pos hε (by positivity)) (by norm_num : (15/16 : ℝ) < 1) + obtain ⟨F,hEF,hF⟩ := exists_tensor_iterated_energy_descent τ hNM hfactor hdiff hirr S x ht E r + refine ⟨F,hEF,?_⟩ + have hbound : (∑ s ∈ S,F.energy τ hNM (x s)) ≤ (15/16 : ℝ)^r*A := by + calc (∑ s ∈ S,F.energy τ hNM (x s)) ≤ + ∑ s ∈ S,(15/16 : ℝ)^r*E.energy τ hNM (x s) := + Finset.sum_le_sum (fun s hs => hF s hs) + _ = _ := (Finset.mul_sum S _ _).symm + have hsmall := (lt_div_iff₀ (by positivity : 0 < A+1)).mp hr + have hp : 0 ≤ (15/16 : ℝ)^r := by positivity + nlinarith + +end + +/-! A single increasing sequence of full matrix algebras simultaneously +kills every member of a supplied countable centered family in commutant L2. -/ +open Filter +open scoped BigOperators Topology +open UltrapowerBridge Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +theorem exists_countable_tensor_refinement (τ : TracialRepresentation M) (hNM : N ≤ M) + (hfactor : ∀ c : N.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,a*c=c*a) → ∃ z : ℂ,c=z • (1 : N.toStarSubalgebra)) + (hdiff : ∀ p : N.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : N.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + (hirr : ∀ c : M.toStarSubalgebra, + (∀ a : N.toStarSubalgebra,coordinateInclusion hNM a*c=c*coordinateInclusion hNM a) → + ∃ z : ℂ,c=z • (1 : M.toStarSubalgebra)) + (x : ℕ → M.toStarSubalgebra) (ht : ∀ s,τ.trace (x s)=0) (E : FiniteMatrixStage N) : + ∃ A : ℕ → FiniteMatrixStage N,A 0=E ∧ + (∀ n,TensorExtension (A n) (A (n+1))) ∧ + Monotone (fun n => (A n).units.algebra) ∧ + (∀ n,(∑ s ∈ Finset.range n,(A n).energy τ hNM (x s)) < (1/2 : ℝ)^n) ∧ + ∀ s,Tendsto (fun n => (A n).energy τ hNM (x s)) atTop (𝓝 0) := by + have hex (n : ℕ) (F : FiniteMatrixStage N) := exists_tensor_finite_matrix_energy_budget τ hNM + hfactor hdiff hirr (Finset.range (n+1)) x (fun s _ => ht s) F + ((1/2 : ℝ)^(n+1)) (by positivity) + let next (n : ℕ) (F : FiniteMatrixStage N) := (hex n F).choose + let A : ℕ → FiniteMatrixStage N := fun n => Nat.rec E (fun n F => next n F) n + have hstep (n : ℕ) : TensorExtension (A n) (A (n+1)) ∧ + (∑ s ∈ Finset.range (n+1),(A (n+1)).energy τ hNM (x s)) < (1/2 : ℝ)^(n+1) := + (hex n (A n)).choose_spec + have hbudget (n : ℕ) : + (∑ s ∈ Finset.range n,(A n).energy τ hNM (x s)) < (1/2 : ℝ)^n := by + cases n with + | zero => simp + | succ n => exact (hstep n).2 + refine ⟨A,rfl,fun n => (hstep n).1, + monotone_nat_of_le_succ (fun n => (hstep n).1.algebra_le),hbudget,?_⟩ + intro s + apply squeeze_zero' (Filter.Eventually.of_forall (fun n => (A n).energy_nonneg τ hNM (x s))) + ?_ (tendsto_pow_atTop_nhds_zero_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num)) + filter_upwards [eventually_ge_atTop (s+1)] with n hn + exact (Finset.single_le_sum (fun t _ => (A n).energy_nonneg τ hNM (x t)) + (Finset.mem_range.mpr (by omega))).trans (hbudget n).le + +end Generator.FiniteMatrixStage + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/TraceHilbert.lean b/lean/OAI/Analysis/FactorGeneration/TraceHilbert.lean new file mode 100644 index 0000000000000000000000000000000000000000..5a7ef61e83b2cde2f4668400a5605c1cf0b17a92 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/TraceHilbert.lean @@ -0,0 +1,670 @@ +import Mathlib.Analysis.InnerProductSpace.Completion +import OAI.Analysis.FactorGeneration.CyclicPredual +import OAI.Analysis.FactorGeneration.NormalTrace + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! A separate type with the constructed trace inner product. Its norm is the +trace two-norm; the original concrete algebra retains its operator norm. +Lean's inner product is linear in the second argument. -/ +section +open scoped ComplexConjugate CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +/-- Algebraic type copy indexed by the original factor hypotheses. -/ +def TraceFreePreHilbert +(_hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +(_hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +(_hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +(_hunit : (1 : M.toStarSubalgebra) ≠ 0) + : Type _ := M.toStarSubalgebra + +local instance traceHilbertCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +instance traceFreePreHilbertRing : Ring E := inferInstanceAs (Ring M.toStarSubalgebra) +instance traceFreePreHilbertAlgebra : Algebra ℂ E := + inferInstanceAs (Algebra ℂ M.toStarSubalgebra) +instance traceFreePreHilbertStarRing : StarRing E := + inferInstanceAs (StarRing M.toStarSubalgebra) +instance traceFreePreHilbertStarModule : StarModule ℂ E := + inferInstanceAs (StarModule ℂ M.toStarSubalgebra) + +/-- Algebraic identification only: it does not identify the two norms. -/ +def traceFreeCopy : M.toStarSubalgebra ≃⋆ₐ[ℂ] E := + _root_.StarAlgEquiv.refl ℂ M.toStarSubalgebra + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +@[instance_reducible] def traceFreeInnerCore : InnerProductSpace.Core ℂ E where + inner x y := τ₀ (star ((copy).symm x) * (copy).symm y) + conj_inner_symm x y := by + change star (τ₀ (star ((copy).symm y) * (copy).symm x)) = _ + rw [← (traceFreeTrace_spec hfactor hdiff hfinite hunit).2.2.2.1] + simp only [star_mul, star_star] + re_inner_nonneg x := + (traceFreeTrace_spec hfactor hdiff hfinite hunit).2.2.1 _ (star_mul_self_nonneg _) + add_left x y z := by simp only [map_add, star_add, add_mul] + smul_left x y c := by + simp only [map_smul, star_smul, smul_mul_assoc] + rfl + definite x hx := by + have hz := (traceFreeTrace_faithful hfactor hdiff hfinite hunit _ + (star_mul_self_nonneg ((copy).symm x))).mp hx + have hx' : (copy).symm x = 0 := (CStarRing.star_mul_self_eq_zero_iff _).mp hz + exact (copy).symm.injective (hx'.trans (map_zero (copy).symm).symm) + +instance traceFreePreHilbertNormedAddCommGroup : NormedAddCommGroup E := + (traceFreeInnerCore hfactor hdiff hfinite hunit).toNormedAddCommGroup +instance traceFreePreHilbertInnerProductSpace : InnerProductSpace ℂ E := + .ofCore { traceFreeInnerCore hfactor hdiff hfinite hunit with } + +@[simp] theorem traceFreeCopy_inner (x y : M.toStarSubalgebra) : + inner ℂ (copy x) (copy y) = τ₀ (star x*y) := rfl + +theorem traceFreeCopy_norm_sq (x : M.toStarSubalgebra) : + ‖copy x‖^2 = (τ₀ (star x*x)).re := by + rw [← traceFreeCopy_inner hfactor hdiff hfinite hunit] + exact (inner_self_eq_norm_sq (𝕜 := ℂ) (copy x)).symm + +/-- The actual Hilbert completion; no representation is supplied. -/ +abbrev TraceFreeHilbert := UniformSpace.Completion E + +def traceFreeInclusion : E →ₗᵢ[ℂ] TraceFreeHilbert hfactor hdiff hfinite hunit := + UniformSpace.Completion.toComplₗᵢ + +@[simp] theorem traceFreeInclusion_inner (x y : M.toStarSubalgebra) : + inner ℂ (traceFreeInclusion hfactor hdiff hfinite hunit (copy x)) + (traceFreeInclusion hfactor hdiff hfinite hunit (copy y)) = τ₀ (star x*y) := + UniformSpace.Completion.inner_coe (𝕜 := ℂ) (copy x) (copy y) + +theorem traceFreeInclusion_denseRange : + DenseRange (traceFreeInclusion hfactor hdiff hfinite hunit) := + UniformSpace.Completion.denseRange_coe + +end + +/-! The trace two-norm bound for left multiplication uses the original +operator norm and positivity of a concrete sandwich. -/ +section +open scoped ComplexConjugate CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertBoundCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertBoundOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertBoundPreorder : Preorder M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toPreorder +local instance traceHilbertBoundLE : LE M.toStarSubalgebra := + (CStarAlgebra.spectralOrder _).toLE +local instance traceHilbertBoundStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +theorem traceFreeTrace_mul_square_le (a x : M.toStarSubalgebra) : + (τ₀ (star (a*x)*(a*x))).re ≤ ‖a‖^2 * (τ₀ (star x*x)).re := by + have hp : 0 ≤ algebraMap ℝ M.toStarSubalgebra (‖a‖^2)-star a*a := + sub_nonneg.mpr (CStarAlgebra.star_mul_le_algebraMap_norm_sq a) + have h := (traceFreeTrace_spec hfactor hdiff hfinite hunit).2.2.1 _ + (star_left_conjugate_nonneg hp x) + have he : star x*(algebraMap ℝ M.toStarSubalgebra (‖a‖^2)-star a*a)*x = + (‖a‖^2) • (star x*x)-star (a*x)*(a*x) := by + simp only [Algebra.algebraMap_eq_smul_one,mul_sub,sub_mul,mul_smul_comm, + smul_mul_assoc,mul_one,star_mul,mul_assoc] + rw [he,map_sub, ContinuousLinearMap.map_smul_of_tower, Complex.sub_re, Complex.real_smul, Complex.mul_re, + Complex.ofReal_re, Complex.ofReal_im, zero_mul, sub_zero] at h + exact sub_nonneg.mp h + +theorem traceFreeCopy_mul_norm_le (a x : M.toStarSubalgebra) : + ‖copy (a*x)‖ ≤ ‖a‖ * ‖copy x‖ := by + apply (sq_le_sq₀ (norm_nonneg _) (mul_nonneg (norm_nonneg _) (norm_nonneg _))).mp + rw [mul_pow, traceFreeCopy_norm_sq, traceFreeCopy_norm_sq] + exact traceFreeTrace_mul_square_le hfactor hdiff hfinite hunit a x + +theorem traceFreeInclusion_mul_norm_le (a x : M.toStarSubalgebra) : + ‖traceFreeInclusion hfactor hdiff hfinite hunit (copy (a*x))‖ ≤ + ‖a‖ * ‖traceFreeInclusion hfactor hdiff hfinite hunit (copy x)‖ := by + simpa only [LinearIsometry.norm_map] using + traceFreeCopy_mul_norm_le hfactor hdiff hfinite hunit a x + +end + +/-! Bounded left multiplication on the actual constructed trace Hilbert space. +All representation laws are proved on its dense algebraic subspace. -/ +section +open scoped ComplexConjugate CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertActionCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertActionOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertActionStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceHilbertOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +def traceFreeLeftOnPreHilbert (a : M.toStarSubalgebra) : E →L[ℂ] E := + LinearMap.mkContinuous (LinearMap.mulLeft ℂ (copy a)) ‖a‖ (by + intro x + obtain ⟨x,rfl⟩ := (copy).surjective x + exact traceFreeCopy_mul_norm_le hfactor hdiff hfinite hunit a x) + +@[simp] theorem traceFreeLeftOnPreHilbert_apply (a : M.toStarSubalgebra) (x : E) : + traceFreeLeftOnPreHilbert hfactor hdiff hfinite hunit a x = copy a*x := rfl + +def traceFreeLeftAction (a : M.toStarSubalgebra) : K →L[ℂ] K := + ((ι).toContinuousLinearMap.comp (traceFreeLeftOnPreHilbert hfactor hdiff hfinite hunit a)).extend + (ι).toContinuousLinearMap + +local notation "L" => traceFreeLeftAction hfactor hdiff hfinite hunit + +@[simp] theorem traceFreeLeftAction_inclusion (a : M.toStarSubalgebra) (x : E) : + L a (ι x) = ι (copy a*x) := by + exact ContinuousLinearMap.extend_eq + ((ι).toContinuousLinearMap.comp (traceFreeLeftOnPreHilbert hfactor hdiff hfinite hunit a)) + (e := (ι).toContinuousLinearMap) (traceFreeInclusion_denseRange hfactor hdiff hfinite hunit) + ((ι).isometry.isUniformInducing) x + +@[simp] theorem traceFreeLeftAction_coe (a : M.toStarSubalgebra) (x : E) : + L a (x : K) = ((copy a*x : E) : K) := + traceFreeLeftAction_inclusion hfactor hdiff hfinite hunit a x + +theorem traceFreeLeftAction_norm_le (a : M.toStarSubalgebra) : ‖L a‖ ≤ ‖a‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg a) + apply isClosed_property (traceFreeInclusion_denseRange hfactor hdiff hfinite hunit) + (isClosed_le (by fun_prop) (by fun_prop)) + intro x + obtain ⟨x,rfl⟩ := (copy).surjective x + rw [traceFreeLeftAction_inclusion,LinearIsometry.norm_map,LinearIsometry.norm_map] + exact traceFreeCopy_mul_norm_le hfactor hdiff hfinite hunit a x + +@[simp] theorem traceFreeLeftAction_one : L 1 = 1 := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + simp only [traceFreeLeftAction_coe,map_one,one_mul,one_apply_eq_self] + +@[simp] theorem traceFreeLeftAction_mul (a b : M.toStarSubalgebra) : + L (a*b) = L a*L b := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro c + simp only [mul_apply_eq_comp,traceFreeLeftAction_coe,map_mul,mul_assoc] + +@[simp] theorem traceFreeLeftAction_add (a b : M.toStarSubalgebra) : + L (a+b) = L a+L b := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro c + simp only [add_apply,traceFreeLeftAction_coe,map_add,add_mul,UniformSpace.Completion.coe_add] + +@[simp] theorem traceFreeLeftAction_smul (c : ℂ) (a : M.toStarSubalgebra) : + L (c • a) = c • L a := by + apply ContinuousLinearMap.ext + intro x + refine UniformSpace.Completion.induction_on x + (isClosed_eq (L (c • a)).continuous ((c • L a : K →L[ℂ] K)).continuous) ?_ + intro b + change L (c • a) (ι b) = c • L a (ι b) + rw [traceFreeLeftAction_inclusion,traceFreeLeftAction_inclusion,map_smul,smul_mul_assoc] + exact (ι).map_smul c _ + +@[simp] theorem traceFreeLeftAction_zero : L 0 = 0 := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b + simp only [traceFreeLeftAction_coe,map_zero,zero_mul,zero_apply,UniformSpace.Completion.coe_zero] + +@[simp] theorem traceFreeLeftAction_star (a : M.toStarSubalgebra) : L (star a) = star (L a) := by + rw [ContinuousLinearMap.star_eq_adjoint] + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro x y + refine UniformSpace.Completion.induction_on₂ x y (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro b c + obtain ⟨b,rfl⟩ := (copy).surjective b + obtain ⟨c,rfl⟩ := (copy).surjective c + rw [traceFreeLeftAction_coe,traceFreeLeftAction_coe] + rw [UniformSpace.Completion.inner_coe,UniformSpace.Completion.inner_coe] + change τ₀ (star (star a*b)*c) = τ₀ (star b*(a*c)) + simp only [star_mul,star_star,mul_assoc] + +def traceFreeHilbertAction : M.toStarSubalgebra →⋆ₐ[ℂ] (K →L[ℂ] K) where + toFun := L + map_one' := traceFreeLeftAction_one hfactor hdiff hfinite hunit + map_mul' := traceFreeLeftAction_mul hfactor hdiff hfinite hunit + map_zero' := traceFreeLeftAction_zero hfactor hdiff hfinite hunit + map_add' := traceFreeLeftAction_add hfactor hdiff hfinite hunit + commutes' c := by + rw [Algebra.algebraMap_eq_smul_one,traceFreeLeftAction_smul,traceFreeLeftAction_one, + Algebra.algebraMap_eq_smul_one] + map_star' := traceFreeLeftAction_star hfactor hdiff hfinite hunit + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit + +@[simp] theorem traceFreeHilbertAction_inclusion (a x : M.toStarSubalgebra) : + π a (ι (copy x)) = ι (copy (a*x)) := by + exact (traceFreeLeftAction_inclusion hfactor hdiff hfinite hunit a (copy x)).trans + (congrArg ι ((copy).map_mul a x).symm) + +def traceFreeHilbertVector : K := ι (copy 1) + +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +@[simp] theorem traceFreeHilbertAction_vector (a : M.toStarSubalgebra) : + π a Ω = ι (copy a) := by + change π a (ι (copy 1)) = _ + rw [traceFreeHilbertAction_inclusion,mul_one] + +theorem traceFreeHilbertVector_norm : ‖Ω‖ = 1 := by + have h := traceFreeCopy_norm_sq hfactor hdiff hfinite hunit 1 + rw [star_one,one_mul,(traceFreeTrace_spec hfactor hdiff hfinite hunit).2.1] at h + change ‖ι (copy 1)‖ = 1 + rw [LinearIsometry.norm_map] + have hn := norm_nonneg (copy 1) + change ‖copy 1‖^2 = 1 at h + nlinarith + +theorem traceFreeHilbertAction_injective : Function.Injective π := by + intro a b hab + have hv := congrArg (fun T : K →L[ℂ] K => T Ω) hab + simp only [traceFreeHilbertAction_vector] at hv + exact (copy).injective ((ι).injective hv) + +theorem traceFreeHilbertAction_norm (a : M.toStarSubalgebra) : ‖π a‖ = ‖a‖ := + NonUnitalStarAlgHom.norm_map π (traceFreeHilbertAction_injective hfactor hdiff hfinite hunit) a + +theorem traceFreeHilbertAction_trace (a : M.toStarSubalgebra) : inner ℂ Ω (π a Ω) = τ₀ a := by + rw [traceFreeHilbertAction_vector] + change inner ℂ (ι (copy 1)) (ι (copy a)) = _ + rw [traceFreeInclusion_inner,star_one,one_mul] + +theorem traceFreeHilbertAction_cyclic : DenseRange (fun a : M.toStarSubalgebra => π a Ω) := by + have hc : Function.Surjective (fun a : M.toStarSubalgebra => copy a) := + fun b => ⟨(copy).symm b,(copy).apply_symm_apply b⟩ + have h := (traceFreeInclusion_denseRange hfactor hdiff hfinite hunit).comp + hc.denseRange (ι).continuous + simpa only [traceFreeHilbertAction_vector,Function.comp_def] using h + +theorem exists_traceFreeHilbert_representation : + ∃ (ρ : M.toStarSubalgebra →⋆ₐ[ℂ] (K →L[ℂ] K)) (v : K), + ‖v‖ = 1 ∧ Function.Injective ρ ∧ (∀ a, ‖ρ a‖ = ‖a‖) ∧ + (∀ a, inner ℂ v (ρ a v) = τ₀ a) ∧ Dense (Set.range (fun a => ρ a v)) := + ⟨π,Ω,traceFreeHilbertVector_norm hfactor hdiff hfinite hunit, + traceFreeHilbertAction_injective hfactor hdiff hfinite hunit, + traceFreeHilbertAction_norm hfactor hdiff hfinite hunit, + traceFreeHilbertAction_trace hfactor hdiff hfinite hunit, + traceFreeHilbertAction_cyclic hfactor hdiff hfinite hunit⟩ + +end + +/-! Bounded right multiplication and its commutation with the constructed +left action. These supply separation on the actual double commutant. -/ +section +open scoped ComplexConjugate CStarAlgebra +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertRightCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertRightOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertRightStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceHilbertRightOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +theorem traceFreeCopy_star_norm (x : M.toStarSubalgebra) : ‖copy (star x)‖ = ‖copy x‖ := by + apply (sq_eq_sq₀ (norm_nonneg _) (norm_nonneg _)).mp + rw [traceFreeCopy_norm_sq,traceFreeCopy_norm_sq,star_star, + (traceFreeTrace_spec hfactor hdiff hfinite hunit).2.2.2.2] + +theorem traceFreeCopy_mul_norm_le_right (a x : M.toStarSubalgebra) : + ‖copy (x*a)‖ ≤ ‖a‖ * ‖copy x‖ := by + rw [← traceFreeCopy_star_norm hfactor hdiff hfinite hunit (x*a),star_mul] + simpa only [norm_star,traceFreeCopy_star_norm] using + traceFreeCopy_mul_norm_le hfactor hdiff hfinite hunit (star a) (star x) + +def traceFreeRightOnPreHilbert (a : M.toStarSubalgebra) : E →L[ℂ] E := + LinearMap.mkContinuous (LinearMap.mulRight ℂ (copy a)) ‖a‖ (by + intro x + obtain ⟨x,rfl⟩ := (copy).surjective x + exact traceFreeCopy_mul_norm_le_right hfactor hdiff hfinite hunit a x) + +def traceFreeRightAction (a : M.toStarSubalgebra) : K →L[ℂ] K := + ((ι).toContinuousLinearMap.comp (traceFreeRightOnPreHilbert hfactor hdiff hfinite hunit a)).extend + (ι).toContinuousLinearMap + +local notation "R" => traceFreeRightAction hfactor hdiff hfinite hunit + +@[simp] theorem traceFreeRightAction_inclusion (a : M.toStarSubalgebra) (x : E) : + R a (ι x) = ι (x*copy a) := by + exact ContinuousLinearMap.extend_eq + ((ι).toContinuousLinearMap.comp (traceFreeRightOnPreHilbert hfactor hdiff hfinite hunit a)) + (e := (ι).toContinuousLinearMap) (traceFreeInclusion_denseRange hfactor hdiff hfinite hunit) + ((ι).isometry.isUniformInducing) x + +@[simp] theorem traceFreeRightAction_coe (a : M.toStarSubalgebra) (x : E) : + R a (x : K) = ((x*copy a : E) : K) := + traceFreeRightAction_inclusion hfactor hdiff hfinite hunit a x + +theorem traceFreeLeftRight_commute (a b : M.toStarSubalgebra) : π a*R b = R b*π a := by + ext x + refine UniformSpace.Completion.induction_on x (isClosed_eq (by fun_prop) (by fun_prop)) ?_ + intro c + change traceFreeLeftAction hfactor hdiff hfinite hunit a (R b (c : K)) = + R b (traceFreeLeftAction hfactor hdiff hfinite hunit a (c : K)) + simp only [traceFreeLeftAction_coe,traceFreeRightAction_coe,mul_assoc] + +@[simp] theorem traceFreeRightAction_vector (a : M.toStarSubalgebra) : R a Ω = ι (copy a) := by + change R a (ι (copy 1)) = _ + rw [traceFreeRightAction_inclusion,map_one,one_mul] + +end + +/-! The actual double commutant of the new representation, with a constructed +faithful tracial vector. Equality with the original image is a later theorem. -/ +section +open Filter +open scoped ComplexConjugate CStarAlgebra Pointwise Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertClosureCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertClosureOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertClosureStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceHilbertClosureOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +/-- The bicommutant is a von Neumann algebra; no image-closedness is assumed. -/ +def traceFreeHilbertClosure : VonNeumannAlgebra K where + toStarSubalgebra := StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ ((π).range : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K)) + centralizer_centralizer' := by + change Set.centralizer (Set.centralizer + ((StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + ((π).range : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K))) : Set (K →L[ℂ] K))) = + ((StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + ((π).range : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K))) : Set (K →L[ℂ] K)) + rw [StarSubalgebra.coe_centralizer_centralizer] + simp only [Set.centralizer_centralizer_centralizer] + +local notation "N" => traceFreeHilbertClosure hfactor hdiff hfinite hunit + +theorem traceFreeHilbertClosure_mem_iff (T : K →L[ℂ] K) : + T ∈ N ↔ T ∈ Set.centralizer (Set.centralizer ((π).range : Set (K →L[ℂ] K))) := by + change T ∈ (StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ ((π).range : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K))) ↔ _ + simp only [← SetLike.mem_coe,StarSubalgebra.coe_centralizer_centralizer, + StarMemClass.star_coe_eq,Set.union_self] + +theorem traceFreeHilbertAction_mem_closure (a : M.toStarSubalgebra) : π a ∈ N := by + apply (traceFreeHilbertClosure_mem_iff hfactor hdiff hfinite hunit _).mpr + intro T hT + exact (hT (π a) ⟨a,rfl⟩).symm + +def traceFreeHilbertIntoClosure : M.toStarSubalgebra →⋆ₐ[ℂ] (N).toStarSubalgebra := + (π).codRestrict (N).toStarSubalgebra (traceFreeHilbertAction_mem_closure hfactor hdiff hfinite hunit) + +local notation "ρ" => traceFreeHilbertIntoClosure hfactor hdiff hfinite hunit + +theorem traceFreeHilbertClosure_strong_net (T : (N).toStarSubalgebra) : + ∃ a : Finset K × ℕ → M.toStarSubalgebra, ∀ x : K, + Tendsto (fun d => π (a d) x) atTop (𝓝 (T.val x)) := by + obtain ⟨b,hb⟩ := bicommutant_exists_strong_net (π).range T.val + ((traceFreeHilbertClosure_mem_iff hfactor hdiff hfinite hunit T.val).mp T.property) + have hex (d : Finset K × ℕ) : ∃ a : M.toStarSubalgebra, π a = (b d).val := (b d).property + choose a ha using hex + exact ⟨a,fun x => by simpa only [ha] using hb x⟩ + +theorem traceFreeHilbertClosure_right_commute (T : (N).toStarSubalgebra) (a : M.toStarSubalgebra) : + traceFreeRightAction hfactor hdiff hfinite hunit a*T.val = + T.val*traceFreeRightAction hfactor hdiff hfinite hunit a := by + apply (traceFreeHilbertClosure_mem_iff hfactor hdiff hfinite hunit T.val).mp T.property + rintro B ⟨b,rfl⟩ + exact traceFreeLeftRight_commute hfactor hdiff hfinite hunit b a + +theorem traceFreeHilbertClosure_separating (T : (N).toStarSubalgebra) (hT : T.val Ω = 0) : T = 0 := by + apply Subtype.ext + apply ContinuousLinearMap.ext + change ∀ x : K, T.val x = (0 : K) + apply isClosed_property (traceFreeHilbertAction_cyclic hfactor hdiff hfinite hunit) + (isClosed_eq T.val.continuous continuous_const) + intro a + rw [traceFreeHilbertAction_vector,← traceFreeRightAction_vector hfactor hdiff hfinite hunit a] + have he := congrArg (fun B : K →L[ℂ] K => B Ω) + (traceFreeHilbertClosure_right_commute hfactor hdiff hfinite hunit T a) + simpa only [mul_apply_eq_comp,hT,map_zero] using he.symm + +theorem traceFreeHilbertClosure_trace_commute_copy (T : (N).toStarSubalgebra) (b : M.toStarSubalgebra) : + inner ℂ Ω (T.val (π b Ω)) = inner ℂ Ω (π b (T.val Ω)) := by + classical + obtain ⟨a,ha⟩ := traceFreeHilbertClosure_strong_net hfactor hdiff hfinite hunit T + have he (d : Finset K × ℕ) : inner ℂ Ω (π (a d) (π b Ω)) = + inner ℂ Ω (π b (π (a d) Ω)) := by + change inner ℂ Ω ((π (a d)*π b) Ω) = inner ℂ Ω ((π b*π (a d)) Ω) + rw [← map_mul,← map_mul,traceFreeHilbertAction_trace,traceFreeHilbertAction_trace] + exact (traceFreeTrace_spec hfactor hdiff hfinite hunit).2.2.2.2 _ _ + have hl := (innerSL ℂ Ω).continuous.continuousAt.tendsto.comp (ha (π b Ω)) + have hr := ((innerSL ℂ Ω).comp (π b)).continuous.continuousAt.tendsto.comp (ha Ω) + exact tendsto_nhds_unique hl (hr.congr (fun d => (he d).symm)) + +theorem traceFreeHilbertClosure_trace_commute (S T : (N).toStarSubalgebra) : + inner ℂ Ω (S.val (T.val Ω)) = inner ℂ Ω (T.val (S.val Ω)) := by + classical + obtain ⟨a,ha⟩ := traceFreeHilbertClosure_strong_net hfactor hdiff hfinite hunit S + have hl := (innerSL ℂ Ω).continuous.continuousAt.tendsto.comp (ha (T.val Ω)) + have hr := ((innerSL ℂ Ω).comp T.val).continuous.continuousAt.tendsto.comp (ha Ω) + exact tendsto_nhds_unique hl (hr.congr (fun d => + traceFreeHilbertClosure_trace_commute_copy hfactor hdiff hfinite hunit T (a d))) + +/-- Output tracial representation on the actual bicommutant. Its fields are +proved above; no TracialRepresentation is an input to this construction. -/ +def traceFreeHilbertClosureTrace : UltrapowerBridge.TracialRepresentation N where + vector := Ω + norm_vector := traceFreeHilbertVector_norm hfactor hdiff hfinite hunit + cyclic := traceFreeHilbertClosure_trace_commute hfactor hdiff hfinite hunit + separating := traceFreeHilbertClosure_separating hfactor hdiff hfinite hunit + +theorem traceFreeHilbertClosureTrace_copy (a : M.toStarSubalgebra) : + (traceFreeHilbertClosureTrace hfactor hdiff hfinite hunit).trace (ρ a) = τ₀ a := + traceFreeHilbertAction_trace hfactor hdiff hfinite hunit a + +theorem traceFreeHilbertClosureTrace_cyclic : + DenseRange (fun a : (N).toStarSubalgebra => a.val Ω) := by + apply (traceFreeHilbertAction_cyclic hfactor hdiff hfinite hunit).mono + rintro x ⟨a,rfl⟩ + exact ⟨ρ a,rfl⟩ + +end + +/-! The constructed representation is WOT continuous on every original +operator-norm ball. This does not assert whole-carrier WOT continuity. -/ +open scoped ComplexConjugate CStarAlgebra BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertWOTCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertWOTOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertWOTStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceHilbertWOTOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit + +def traceFreeHilbertActionCLM : M.toStarSubalgebra →L[ℂ] (K →L[ℂ] K) := + (π).toLinearMap.mkContinuous 1 (by + intro a + rw [one_mul] + exact (traceFreeHilbertAction_norm hfactor hdiff hfinite hunit a).le) + +def traceFreeHilbertCoefficient (x y : K) : StrongDual ℂ M.toStarSubalgebra := + (innerSL ℂ y).comp ((ContinuousLinearMap.apply ℂ K x).comp + (traceFreeHilbertActionCLM hfactor hdiff hfinite hunit)) + +@[simp] theorem traceFreeHilbertCoefficient_apply (x y : K) (a : M.toStarSubalgebra) : + traceFreeHilbertCoefficient hfactor hdiff hfinite hunit x y a = inner ℂ y (π a x) := rfl + +theorem traceFreeHilbertCoefficient_continuous : Continuous + (fun p : K × K => traceFreeHilbertCoefficient hfactor hdiff hfinite hunit p.1 p.2) := + ((innerSL ℂ).continuous.comp continuous_snd).clm_comp + (((ContinuousLinearMap.apply ℂ K).continuous.comp continuous_fst).clm_comp continuous_const) + +theorem traceFreeHilbertCoefficient_copy_ball_continuous (C : ℝ) (a b : M.toStarSubalgebra) : + Continuous (fun T : weakOperatorBall M C => + traceFreeHilbertCoefficient hfactor hdiff hfinite hunit (ι (copy a)) (ι (copy b)) + ⟨T.val.toCLM,T.property.1⟩) := by + obtain ⟨n,ξ,η,ht⟩ := traceFreeTrace_finite_vector_representation hfactor hdiff hfinite hunit + have he (T : weakOperatorBall M C) : + traceFreeHilbertCoefficient hfactor hdiff hfinite hunit (ι (copy a)) (ι (copy b)) + ⟨T.val.toCLM,T.property.1⟩ = ∑ i, inner ℂ (b.val (η i)) (T.val (a.val (ξ i))) := by + rw [traceFreeHilbertCoefficient_apply,traceFreeHilbertAction_inclusion,traceFreeInclusion_inner,ht] + apply Finset.sum_congr rfl + intro i _ + change inner ℂ (η i) ((star b.val) (T.val (a.val (ξ i)))) = _ + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + simp_rw [he] + exact continuous_finsetSum _ (fun i _ => + ContinuousLinearMapWOT.continuous_inner_apply continuous_subtype_val (a.val (ξ i)) (b.val (η i))) + +theorem traceFreeHilbertCoefficient_ball_continuous (C : ℝ) (x y : K) : + Continuous (fun T : weakOperatorBall M C => + inner ℂ y (π ⟨T.val.toCLM,T.property.1⟩ x)) := by + have hd : DenseRange (fun a : M.toStarSubalgebra => ι (copy a)) := by + simpa only [traceFreeHilbertAction_vector] using + traceFreeHilbertAction_cyclic hfactor hdiff hfinite hunit + have hc := (ballContinuousFunctionals_isClosed M C).preimage + (traceFreeHilbertCoefficient_continuous hfactor hdiff hfinite hunit) + have hm : ∀ p : K × K, + traceFreeHilbertCoefficient hfactor hdiff hfinite hunit p.1 p.2 ∈ ballContinuousFunctionals M C := by + apply isClosed_property (hd.prodMap hd) hc + intro p + exact traceFreeHilbertCoefficient_copy_ball_continuous hfactor hdiff hfinite hunit C p.1 p.2 + exact hm (x,y) + +def traceFreeHilbertBallMap (C : ℝ) (T : weakOperatorBall M C) : K →WOT[ℂ] K := + ContinuousLinearMapWOT.ofCLM (π ⟨T.val.toCLM,T.property.1⟩) + +theorem traceFreeHilbertBallMap_continuous (C : ℝ) : + Continuous (traceFreeHilbertBallMap hfactor hdiff hfinite hunit C) := + ContinuousLinearMapWOT.continuous_iff.mpr + (traceFreeHilbertCoefficient_ball_continuous hfactor hdiff hfinite hunit C) + +theorem traceFreeHilbertBallMap_injective (C : ℝ) : + Function.Injective (traceFreeHilbertBallMap hfactor hdiff hfinite hunit C) := by + intro a b hab + have he := traceFreeHilbertAction_injective hfactor hdiff hfinite hunit + (congrArg ContinuousLinearMapWOT.toCLM hab) + apply Subtype.ext + exact congrArg (fun x : M.toStarSubalgebra => ContinuousLinearMapWOT.ofCLM x.val) he + +theorem traceFreeHilbertBallMap_isClosedEmbedding (C : ℝ) : + Topology.IsClosedEmbedding (traceFreeHilbertBallMap hfactor hdiff hfinite hunit C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + exact (traceFreeHilbertBallMap_continuous hfactor hdiff hfinite hunit C).isClosedEmbedding + (traceFreeHilbertBallMap_injective hfactor hdiff hfinite hunit C) + +def traceFreeHilbertWeakBall (C : ℝ) : Set (K →WOT[ℂ] K) := + {T | ∃ a : M.toStarSubalgebra, ‖a‖ ≤ C ∧ ContinuousLinearMapWOT.ofCLM (π a) = T} + +theorem traceFreeHilbertWeakBall_eq_range (C : ℝ) : + traceFreeHilbertWeakBall hfactor hdiff hfinite hunit C = + Set.range (traceFreeHilbertBallMap hfactor hdiff hfinite hunit C) := by + ext T + constructor + · rintro ⟨a,ha,rfl⟩ + exact ⟨⟨ContinuousLinearMapWOT.ofCLM a.val,⟨a.property,ha⟩⟩,rfl⟩ + · rintro ⟨a,rfl⟩ + exact ⟨⟨a.val.toCLM,a.property.1⟩,a.property.2,rfl⟩ + +theorem traceFreeHilbertWeakBall_isCompact (C : ℝ) : + IsCompact (traceFreeHilbertWeakBall hfactor hdiff hfinite hunit C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + rw [traceFreeHilbertWeakBall_eq_range] + exact isCompact_range (traceFreeHilbertBallMap_continuous hfactor hdiff hfinite hunit C) + +theorem traceFreeHilbertWeakBall_isClosed (C : ℝ) : + IsClosed (traceFreeHilbertWeakBall hfactor hdiff hfinite hunit C) := + (traceFreeHilbertWeakBall_isCompact hfactor hdiff hfinite hunit C).isClosed + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/TraceTopology.lean b/lean/OAI/Analysis/FactorGeneration/TraceTopology.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbc6fe5a58fcb8a6adb3cd4eb8ade6267335d1e4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/TraceTopology.lean @@ -0,0 +1,253 @@ +import Mathlib.Analysis.Convex.Hull +import Mathlib.Analysis.InnerProductSpace.Projection.Minimal +import Mathlib.Topology.Sequences +import OAI.Analysis.FactorGeneration.OperatorLimits +import OAI.Analysis.FactorGeneration.Ultrapower + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Operator-norm bounded trace-norm limits remain in the same ball of the algebra, without requiring a cyclic trace vector. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem bounded_trace_limit (a : ℕ → M.toStarSubalgebra) (C : ℝ) (hC : 0 ≤ C) + (ha : ∀ n, ‖a n‖ ≤ C) (ξ : H) + (hξ : Tendsto (fun n => (a n : H →L[ℂ] H) τ.vector) atTop (𝓝 ξ)) : + ∃ b : M.toStarSubalgebra, ‖b‖ ≤ C ∧ (b : H →L[ℂ] H) τ.vector = ξ := by + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + obtain ⟨T, hT, ht⟩ := exists_weak_operator_ultralimit ω + (fun n => (a n : H →L[ℂ] H)) C hC ha + refine ⟨⟨T, weak_operator_limit_mem M a T ht⟩, hT, ?_⟩ + apply ext_inner_left ℂ + intro y + exact tendsto_nhds_unique (ht τ.vector y) + ((continuous_const.inner continuous_id).continuousAt.tendsto.comp + (hξ.mono_left (Ultrafilter.of_le atTop))) + +/-- The trace image of an operator-norm ball is norm closed in H. -/ +theorem trace_ball_isClosed (C : ℝ) : + IsClosed {ξ : H | ∃ b : M.toStarSubalgebra, ‖b‖ ≤ C ∧ + (b : H →L[ℂ] H) τ.vector = ξ} := by + apply IsSeqClosed.isClosed + intro ξ z hz hlim + choose a ha he using hz + have hC : 0 ≤ C := (norm_nonneg (a 0)).trans (ha 0) + apply bounded_trace_limit τ a C hC ha z + simpa only [he] using hlim + +theorem trace_ball_convex (C : ℝ) : + Convex ℝ {ξ : H | ∃ b : M.toStarSubalgebra, ‖b‖ ≤ C ∧ + (b : H →L[ℂ] H) τ.vector = ξ} := by + intro x hx y hy s t hs ht hst + obtain ⟨a, ha, rfl⟩ := hx + obtain ⟨b, hb, rfl⟩ := hy + refine ⟨s • a + t • b, ?_, rfl⟩ + calc + ‖s • a + t • b‖ ≤ ‖s • a‖ + ‖t • b‖ := norm_add_le _ _ + _ = s * ‖a‖ + t * ‖b‖ := by rw [norm_smul, norm_smul, Real.norm_of_nonneg hs, Real.norm_of_nonneg ht] + _ ≤ s * C + t * C := add_le_add (mul_le_mul_of_nonneg_left ha hs) (mul_le_mul_of_nonneg_left hb ht) + _ = C := by rw [← add_mul, hst, one_mul] + +/-- Every point of the actual closed convex hull has an algebra representative +with the same operator norm bound. -/ +theorem bounded_representative_of_closed_convexHull (s : Set H) (C : ℝ) + (hs : ∀ ξ ∈ s, ∃ b : M.toStarSubalgebra, ‖b‖ ≤ C ∧ + (b : H →L[ℂ] H) τ.vector = ξ) + {ξ : H} (hξ : ξ ∈ closure (convexHull ℝ s)) : + ∃ b : M.toStarSubalgebra, ‖b‖ ≤ C ∧ (b : H →L[ℂ] H) τ.vector = ξ := by + exact (closure_minimal (convexHull_min hs (trace_ball_convex τ C)) + (trace_ball_isClosed τ C)) hξ + +/-! The actual closed convex unitary orbit in the coordinate trace Hilbert +space, with bounded representatives and conjugation invariance. -/ + +def baseVector : M.toStarSubalgebra →ₗ[ℂ] H where + toFun a := (a : H →L[ℂ] H) τ.vector + map_add' _ _ := rfl + map_smul' _ _ := rfl + +def conjugateLinear (u : unitary M.toStarSubalgebra) : + M.toStarSubalgebra →ₗ[ℂ] M.toStarSubalgebra where + toFun a := (u : M.toStarSubalgebra) * a * star (u : M.toStarSubalgebra) + map_add' _ _ := by simp only [mul_add, add_mul] + map_smul' _ _ := by simp only [mul_smul_comm, smul_mul_assoc]; rfl + +theorem conjugateLinear_mul (u v : unitary M.toStarSubalgebra) (a : M.toStarSubalgebra) : + conjugateLinear (u*v) a = conjugateLinear u (conjugateLinear v a) := by + change ((u : M.toStarSubalgebra)*(v : M.toStarSubalgebra))*a*star ((u : M.toStarSubalgebra)*(v : M.toStarSubalgebra)) = _ + simp only [conjugateLinear, LinearMap.coe_mk, AddHom.coe_mk, star_mul, mul_assoc] + +@[simp] theorem conjugateLinear_one (a : M.toStarSubalgebra) : conjugateLinear 1 a = a := by + simp [conjugateLinear] + +theorem conjugate_norm_le (u : unitary M.toStarSubalgebra) (a : M.toStarSubalgebra) : + ‖conjugateLinear u a‖ ≤ ‖a‖ := by + have hu := unitary_norm_le (u : M.toStarSubalgebra) (by simp) + have hs := unitary_norm_le (star (u : M.toStarSubalgebra)) (by simp) + calc + ‖conjugateLinear u a‖ ≤ (‖(u : M.toStarSubalgebra)‖ * ‖a‖) * ‖star (u : M.toStarSubalgebra)‖ := + (norm_mul_le _ _).trans (mul_le_mul_of_nonneg_right (norm_mul_le _ _) (norm_nonneg _)) + _ ≤ (1 * ‖a‖) * 1 := mul_le_mul (mul_le_mul_of_nonneg_right hu (norm_nonneg _)) hs (norm_nonneg _) (by simp) + _ = ‖a‖ := by ring + +theorem conjugate_norm₂_le (u : unitary M.toStarSubalgebra) (a : M.toStarSubalgebra) : + τ.norm₂ (conjugateLinear u a) ≤ τ.norm₂ a := by + have hu := unitary_norm_le (u : M.toStarSubalgebra) (by simp) + have hs := unitary_norm_le (star (u : M.toStarSubalgebra)) (by simp) + calc + τ.norm₂ (conjugateLinear u a) ≤ τ.norm₂ ((u : M.toStarSubalgebra)*a) * ‖star (u : M.toStarSubalgebra)‖ := τ.norm₂_mul_le_right _ _ + _ ≤ (‖(u : M.toStarSubalgebra)‖ * τ.norm₂ a) * ‖star (u : M.toStarSubalgebra)‖ := + mul_le_mul_of_nonneg_right (τ.norm₂_mul_le _ _) (norm_nonneg _) + _ ≤ (1 * τ.norm₂ a) * 1 := mul_le_mul (mul_le_mul_of_nonneg_right hu (norm_nonneg _)) hs (norm_nonneg _) (by simpa only [one_mul] using (show 0 ≤ τ.norm₂ a from norm_nonneg _)) + _ = τ.norm₂ a := by ring + +theorem conjugate_norm₂ (u : unitary M.toStarSubalgebra) (a : M.toStarSubalgebra) : + τ.norm₂ (conjugateLinear u a) = τ.norm₂ a := by + apply le_antisymm (conjugate_norm₂_le τ u a) + have h := conjugate_norm₂_le τ u⁻¹ (conjugateLinear u a) + simpa only [← conjugateLinear_mul, inv_mul_cancel, conjugateLinear_one] using h + +def algebraOrbit (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) : Set M.toStarSubalgebra := + {a | ∃ u : G, conjugateLinear u.val b = a} + +def traceOrbitHull (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) : Set H := + closure (convexHull ℝ (baseVector τ '' algebraOrbit G b)) + +theorem traceOrbitHull_eq (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) : + traceOrbitHull τ G b = closure (baseVector τ '' convexHull ℝ (algebraOrbit G b)) := by + exact congrArg closure ((baseVector τ |>.restrictScalars ℝ).image_convexHull (algebraOrbit G b)).symm + +theorem traceOrbitHull_nonempty (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) : + (traceOrbitHull τ G b).Nonempty := by + refine ⟨baseVector τ b, subset_closure (subset_convexHull ℝ _ ?_)⟩ + exact ⟨b, ⟨1, conjugateLinear_one b⟩, rfl⟩ + +theorem traceOrbitHull_representative (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) + {ξ : H} (hξ : ξ ∈ traceOrbitHull τ G b) : + ∃ c : M.toStarSubalgebra, ‖c‖ ≤ ‖b‖ ∧ baseVector τ c = ξ := by + apply bounded_representative_of_closed_convexHull τ _ ‖b‖ _ hξ + rintro ξ ⟨a, ⟨u, rfl⟩, rfl⟩ + exact ⟨conjugateLinear u.val b, conjugate_norm_le _ _, rfl⟩ + +theorem conjugate_mem_convexHull (G : Subgroup (unitary M.toStarSubalgebra)) + (b : M.toStarSubalgebra) (u : G) {a : M.toStarSubalgebra} + (ha : a ∈ convexHull ℝ (algebraOrbit G b)) : + conjugateLinear u.val a ∈ convexHull ℝ (algebraOrbit G b) := by + have h := Set.mem_image_of_mem (conjugateLinear u.val) ha + change conjugateLinear u.val a ∈ (conjugateLinear u.val |>.restrictScalars ℝ) '' convexHull ℝ (algebraOrbit G b) at h + rw [(conjugateLinear u.val |>.restrictScalars ℝ).image_convexHull] at h + apply convexHull_mono _ h + rintro _ ⟨_, ⟨v, rfl⟩, rfl⟩ + exact ⟨u*v, conjugateLinear_mul _ _ _⟩ + +theorem conjugate_mem_traceOrbitHull (G : Subgroup (unitary M.toStarSubalgebra)) + (b c : M.toStarSubalgebra) (u : G) + (hc : baseVector τ c ∈ traceOrbitHull τ G b) : + baseVector τ (conjugateLinear u.val c) ∈ traceOrbitHull τ G b := by + rw [traceOrbitHull_eq] at hc ⊢ + obtain ⟨v, hv, ht⟩ := mem_closure_iff_seq_limit.mp hc + choose a ha he using hv + apply mem_closure_of_tendsto (b := atTop) (f := fun n => baseVector τ (conjugateLinear u.val (a n))) + · rw [tendsto_iff_norm_sub_tendsto_zero] at ht ⊢ + have hn (n : ℕ) : ‖baseVector τ (conjugateLinear u.val (a n)) - baseVector τ (conjugateLinear u.val c)‖ = ‖v n - baseVector τ c‖ := by + rw [← map_sub, ← map_sub] + change τ.norm₂ (conjugateLinear u.val (a n-c)) = ‖v n-baseVector τ c‖ + rw [conjugate_norm₂] + change ‖baseVector τ (a n)-baseVector τ c‖ = _ + rw [he n] + simpa only [hn] using ht + · exact Eventually.of_forall fun n => Set.mem_image_of_mem _ (conjugate_mem_convexHull G b u (ha n)) + +end + +/-! The least-norm point of the actual orbit hull is represented in M and +fixed by every conjugating unitary; its trace and distance bounds are retained. -/ +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem baseVector_injective : Function.Injective (baseVector τ) := by + intro a b h + apply sub_eq_zero.mp + apply τ.separating + change baseVector τ (a-b) = 0 + rw [map_sub, h, sub_self] + +omit [CompleteSpace H] in +theorem convex_minimum_unique {K : Set H} (hK : Convex ℝ K) {x y : H} + (hx : x ∈ K) (hy : y ∈ K) (hmin : ∀ z ∈ K, ‖x‖ ≤ ‖z‖) (hnorm : ‖y‖ = ‖x‖) : x = y := by + have hm := hmin ((1/2 : ℝ) • x + (1/2 : ℝ) • y) + (hK hx hy (by norm_num) (by norm_num) (by norm_num)) + rw [← smul_add, norm_smul, Real.norm_of_nonneg (by norm_num : (0:ℝ) ≤ 1/2)] at hm + have hp := parallelogram_law_with_norm ℂ x y + have htriangle := norm_add_le x y + have he : ‖x+y‖ = 2*‖x‖ := by linarith + rw [he, hnorm] at hp + have hz : ‖x-y‖ ^ 2 = 0 := by nlinarith + exact sub_eq_zero.mp (norm_eq_zero.mp (sq_eq_zero_iff.mp hz)) + +theorem traceOrbitHull_minimum (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) : + ∃ c : M.toStarSubalgebra, ‖c‖ ≤ ‖b‖ ∧ baseVector τ c ∈ traceOrbitHull τ G b ∧ + (∀ ξ ∈ traceOrbitHull τ G b, τ.norm₂ c ≤ ‖ξ‖) ∧ + (∀ u : G, conjugateLinear u.val c = c) := by + let : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H + have hK : Convex ℝ (traceOrbitHull τ G b) := (convex_convexHull ℝ _).closure + obtain ⟨ξ, hξ, hmin⟩ := exists_norm_eq_iInf_of_complete_convex + (traceOrbitHull_nonempty τ G b) isClosed_closure.isComplete hK (0 : H) + obtain ⟨c, hc, rfl⟩ := traceOrbitHull_representative τ G b hξ + have hle : ∀ z ∈ traceOrbitHull τ G b, τ.norm₂ c ≤ ‖z‖ := by + intro z hz + have hi := ciInf_le (show BddBelow (Set.range (fun w : traceOrbitHull τ G b => ‖(0:H)-w.val‖)) from + ⟨0, by rintro _ ⟨w, rfl⟩; exact norm_nonneg _⟩) (⟨z,hz⟩ : traceOrbitHull τ G b) + rw [← hmin] at hi + change ‖baseVector τ c‖ ≤ ‖z‖ + simpa only [zero_sub, norm_neg] using hi + refine ⟨c, hc, hξ, hle, ?_⟩ + intro u + apply baseVector_injective τ + apply (convex_minimum_unique hK hξ (conjugate_mem_traceOrbitHull τ G b c u hξ) hle ?_).symm + exact conjugate_norm₂ τ u.val c + +theorem trace_conjugate (u : unitary M.toStarSubalgebra) (b : M.toStarSubalgebra) : + τ.trace (conjugateLinear u b) = τ.trace b := by + change τ.trace ((u : M.toStarSubalgebra)*b*star (u : M.toStarSubalgebra)) = _ + rw [τ.trace_mul_comm] + simp [← mul_assoc] + +theorem traceOrbitHull_trace (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) + {ξ : H} (hξ : ξ ∈ traceOrbitHull τ G b) : inner ℂ τ.vector ξ = τ.trace b := by + have hclosed : IsClosed {ξ : H | inner ℂ τ.vector ξ = τ.trace b} := + isClosed_eq (continuous_const.inner continuous_id) continuous_const + have hconv : Convex ℝ {ξ : H | inner ℂ τ.vector ξ = τ.trace b} := by + intro x hx y hy s t hs ht hst + change inner ℂ τ.vector (s • x+t • y) = _ + rw [inner_add_right] + rw [inner_smul_right_eq_smul, inner_smul_right_eq_smul, hx, hy, ← add_smul, hst, one_smul] + apply (closure_minimal (convexHull_min ?_ hconv) hclosed) hξ + rintro ξ ⟨a, ⟨u, rfl⟩, rfl⟩ + exact trace_conjugate τ u.val b + +theorem traceOrbitHull_distance (G : Subgroup (unitary M.toStarSubalgebra)) (b : M.toStarSubalgebra) + (δ : ℝ) (hδ : ∀ u : G, τ.norm₂ (conjugateLinear u.val b-b) ≤ δ) + {ξ : H} (hξ : ξ ∈ traceOrbitHull τ G b) : ‖ξ-baseVector τ b‖ ≤ δ := by + have hs : baseVector τ '' algebraOrbit G b ⊆ Metric.closedBall (baseVector τ b) δ := by + rintro ξ ⟨a, ⟨u, rfl⟩, rfl⟩ + rw [Metric.mem_closedBall, dist_eq_norm] + exact hδ u + simpa only [Metric.mem_closedBall, dist_eq_norm] using + (closure_minimal (convexHull_min hs (convex_closedBall _ _)) Metric.isClosed_closedBall) hξ + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/TraceTransport.lean b/lean/OAI/Analysis/FactorGeneration/TraceTransport.lean new file mode 100644 index 0000000000000000000000000000000000000000..4e5907fde2fcba2b18b0101120502badb5e815aa --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/TraceTransport.lean @@ -0,0 +1,804 @@ +import Mathlib.Analysis.CStarAlgebra.ContinuousFunctionalCalculus.Range +import OAI.Analysis.FactorGeneration.SpectralTruncation +import OAI.Analysis.FactorGeneration.TraceHilbert + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Literal weak-operator generation under a concrete star-algebra isomorphism. +Continuity is explicitly for the restricted WOT, not the operator norm topology. +This transport does not construct a trace representation of a finite factor. -/ +section +variable {H K : Type*} + [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + [NormedAddCommGroup K] [InnerProductSpace ℂ K] [CompleteSpace K] +variable {S : StarSubalgebra ℂ (H →L[ℂ] H)} + {T : StarSubalgebra ℂ (K →L[ℂ] K)} + +/-- The carrier equipped with the subspace topology from ambient WOT. -/ +abbrev WOTCarrier (S : StarSubalgebra ℂ (H →L[ℂ] H)) := + {a : H →WOT[ℂ] H // a.toCLM ∈ S} + +/-- A homomorphism viewed on the WOT carrier, with ambient WOT codomain. -/ +def wotMap (φ : S →⋆ₐ[ℂ] T) (a : WOTCarrier S) : K →WOT[ℂ] K := + ContinuousLinearMapWOT.ofCLM (φ ⟨a.val.toCLM, a.property⟩).val + +/-- Ambient concrete inverse image, contained in S. -/ +def concretePreimage (φ : S →⋆ₐ[ℂ] T) + (Q : StarSubalgebra ℂ (K →L[ℂ] K)) : StarSubalgebra ℂ (H →L[ℂ] H) := + (Q.comap (T.subtype.comp φ)).map S.subtype + +theorem concretePreimage_le (φ : S →⋆ₐ[ℂ] T) + (Q : StarSubalgebra ℂ (K →L[ℂ] K)) : concretePreimage φ Q ≤ S := by + rintro a ⟨b, _, rfl⟩ + exact b.property + +theorem mem_concretePreimage (φ : S →⋆ₐ[ℂ] T) + (Q : StarSubalgebra ℂ (K →L[ℂ] K)) (a : S) : + a.val ∈ concretePreimage φ Q ↔ (φ a).val ∈ Q := by + constructor + · rintro ⟨b, hb, hab⟩ + have h : b = a := Subtype.ext hab + subst b + exact hb + · intro ha + exact ⟨a, ha, rfl⟩ + +theorem concretePreimage_wotClosed (φ : S →⋆ₐ[ℂ] T) + (hS : WOTClosed S) (hφ : Continuous (wotMap φ)) + (Q : StarSubalgebra ℂ (K →L[ℂ] K)) (hQ : WOTClosed Q) : + WOTClosed (concretePreimage φ Q) := by + have hc := hS.isClosedMap_subtype_val _ (hQ.preimage hφ) + have heq : Subtype.val '' (wotMap φ ⁻¹' {a : K →WOT[ℂ] K | a.toCLM ∈ Q}) = + {a : H →WOT[ℂ] H | a.toCLM ∈ concretePreimage φ Q} := by + ext a + constructor + · rintro ⟨b, hb, rfl⟩ + exact (mem_concretePreimage φ Q ⟨b.val.toCLM, b.property⟩).mpr hb + · intro ha + have hs := concretePreimage_le φ Q ha + exact ⟨⟨a, hs⟩, (mem_concretePreimage φ Q ⟨a.toCLM, hs⟩).mp ha, rfl⟩ + exact (congrArg IsClosed heq).mp hc + +/-- WOT continuity suffices for the forward inclusion on generated algebras. -/ +theorem map_mem_wstar (φ : S →⋆ₐ[ℂ] T) + (hS : WOTClosed S) (hφ : Continuous (wotMap φ)) + (s : Set S) (a : S) (ha : a.val ∈ wstar (Subtype.val '' s)) : + (φ a).val ∈ wstar ((fun b : S => (φ b).val) '' s) := by + apply (mem_concretePreimage φ _ a).mp + apply wstar_le (concretePreimage_wotClosed φ hS hφ _ (wstar_closed _)) _ ha + rintro b ⟨c, hc, rfl⟩ + exact (mem_concretePreimage φ _ c).mpr (subset_wstar _ ⟨c, hc, rfl⟩) + +/-- An algebra isomorphism continuous in both directions for the concrete weak operator topologies. -/ +structure WOTStarAlgEquiv (S : StarSubalgebra ℂ (H →L[ℂ] H)) + (T : StarSubalgebra ℂ (K →L[ℂ] K)) where + toStarAlgEquiv : S ≃⋆ₐ[ℂ] T + continuous_toFun : Continuous (wotMap toStarAlgEquiv.toStarAlgHom) + continuous_invFun : Continuous (wotMap toStarAlgEquiv.symm.toStarAlgHom) + +namespace WOTStarAlgEquiv +variable (e : WOTStarAlgEquiv S T) + +def symm : WOTStarAlgEquiv T S where + toStarAlgEquiv := e.toStarAlgEquiv.symm + continuous_toFun := e.continuous_invFun + continuous_invFun := e.continuous_toFun + +theorem mem_wstar_iff (hS : WOTClosed S) (hT : WOTClosed T) + (s : Set S) (a : S) : + (e.toStarAlgEquiv a).val ∈ wstar ((fun b : S => (e.toStarAlgEquiv b).val) '' s) ↔ + a.val ∈ wstar (Subtype.val '' s) := by + constructor + · intro ha + have hs : ((fun b : T => (e.toStarAlgEquiv.symm b).val) '' + (e.toStarAlgEquiv '' s)) = Subtype.val '' s := by + ext b + simp only [Set.mem_image] + constructor + · rintro ⟨c, ⟨d, hd, rfl⟩, rfl⟩ + exact ⟨d, hd, by simp⟩ + · rintro ⟨c, hc, rfl⟩ + exact ⟨e.toStarAlgEquiv c, ⟨c, hc, rfl⟩, by simp⟩ + have hi : Subtype.val '' (e.toStarAlgEquiv '' s) = + (fun b : S => (e.toStarAlgEquiv b).val) '' s := Set.image_image _ _ _ + have hr := map_mem_wstar e.toStarAlgEquiv.symm.toStarAlgHom hT + e.continuous_invFun (e.toStarAlgEquiv '' s) (e.toStarAlgEquiv a) (hi ▸ ha) + change (e.toStarAlgEquiv.symm (e.toStarAlgEquiv a)).val ∈ + wstar ((fun b : T => (e.toStarAlgEquiv.symm b).val) '' (e.toStarAlgEquiv '' s)) at hr + simpa only [hs, StarAlgEquiv.symm_apply_apply] using hr + · exact map_mem_wstar e.toStarAlgEquiv.toStarAlgHom hS e.continuous_toFun s a + +theorem wstar_image_eq (hS : WOTClosed S) (hT : WOTClosed T) (s : Set S) : + wstar ((fun b : S => (e.toStarAlgEquiv b).val) '' s) = + ((wstar (Subtype.val '' s)).comap S.subtype).map + (T.subtype.comp e.toStarAlgEquiv.toStarAlgHom) := by + ext b + constructor + · intro hb + have hbt : b ∈ T := wstar_le hT (by rintro _ ⟨a, _, rfl⟩; exact (e.toStarAlgEquiv a).property) hb + let a := e.toStarAlgEquiv.symm ⟨b, hbt⟩ + have he : e.toStarAlgEquiv a = ⟨b, hbt⟩ := e.toStarAlgEquiv.apply_symm_apply _ + exact ⟨a, (e.mem_wstar_iff hS hT s a).mp (by simpa only [he] using hb), + congrArg Subtype.val he⟩ + · rintro ⟨a, ha, rfl⟩ + exact (e.mem_wstar_iff hS hT s a).mpr ha + +theorem wstar_singleton_eq (hS : WOTClosed S) (hT : WOTClosed T) + (a : S) (ha : wstar {a.val} = S) : + wstar {(e.toStarAlgEquiv a).val} = T := by + apply le_antisymm (wstar_le hT (by simp)) + intro b hb + have hg : (e.toStarAlgEquiv (e.toStarAlgEquiv.symm ⟨b, hb⟩)).val ∈ + wstar ((fun c : S => (e.toStarAlgEquiv c).val) '' {a}) := + (e.mem_wstar_iff hS hT {a} _).mpr (by simpa only [Set.image_singleton, ha] using + (e.toStarAlgEquiv.symm ⟨b, hb⟩).property) + simpa only [Set.image_singleton, StarAlgEquiv.apply_symm_apply] using hg + +include e in +theorem singlyGenerated_iff (hS : WOTClosed S) (hT : WOTClosed T) : + SinglyGenerated S ↔ SinglyGenerated T := by + constructor + · rintro ⟨a, ha, hg⟩ + exact ⟨(e.toStarAlgEquiv ⟨a, ha⟩).val, (e.toStarAlgEquiv ⟨a, ha⟩).property, + e.wstar_singleton_eq hS hT ⟨a, ha⟩ hg⟩ + · rintro ⟨b, hb, hg⟩ + exact ⟨(e.toStarAlgEquiv.symm ⟨b, hb⟩).val, (e.toStarAlgEquiv.symm ⟨b, hb⟩).property, + e.symm.wstar_singleton_eq hT hS ⟨b, hb⟩ hg⟩ + +end WOTStarAlgEquiv + +/-! Transport of the unchanged finite diffuse factor predicate. +The algebraic fields use the actual star isomorphism; target WOT closedness +is explicit. No trace or separability conclusion is inferred. -/ + +theorem isII1Factor_of_starAlgEquiv (e : S ≃⋆ₐ[ℂ] T) + (hS : IsII1Factor S) (hT : WOTClosed T) : IsII1Factor T where + nonzero := by + intro h + have ht : (0 : T) = 1 := Subtype.ext h + have hs : (0 : S) = 1 := e.injective (by simpa only [map_zero, map_one] using ht) + exact hS.nonzero (congrArg Subtype.val hs) + weaklyClosed := hT + factor := by + intro x hx + have hc : ∀ y : S, y * e.symm x = e.symm x * y := by + intro y + apply e.injective + change e (y * e.symm x) = e (e.symm x * y) + simpa only [map_mul, e.apply_symm_apply] using hx (e y) + obtain ⟨c, hc⟩ := hS.factor (e.symm x) hc + refine ⟨c, ?_⟩ + calc x = e (e.symm x) := (e.apply_symm_apply x).symm + _ = e (algebraMap ℂ S c) := congrArg e hc + _ = algebraMap ℂ T c := e.toAlgEquiv.commutes c + finite := by + intro v hv + have h : star (e.symm v) * e.symm v = 1 := by + simpa only [map_mul, map_star, map_one] using congrArg e.symm hv + have hf := hS.finite (e.symm v) h + simpa only [map_mul, map_star, map_one, e.apply_symm_apply] using congrArg e hf + diffuse := by + intro p hp hp0 + have hsp : IsStarProjection (e.symm p) := hp.map e.symm + have hsp0 : e.symm p ≠ 0 := by + intro hz + apply hp0 + simpa only [e.apply_symm_apply, map_zero] using congrArg e hz + obtain ⟨q, hq, hq0, hqp, hpq, hqp'⟩ := hS.diffuse (e.symm p) hsp hsp0 + refine ⟨e q, hq.map e, ?_, ?_, ?_, ?_⟩ + · intro hz + apply hq0 + apply e.injective + change e q = e 0 + simpa only [map_zero] using hz + · intro heq + apply hqp + apply e.injective + change e q = e (e.symm p) + simpa only [e.apply_symm_apply] using heq + · simpa only [map_mul, e.apply_symm_apply] using congrArg e hpq + · simpa only [map_mul, e.apply_symm_apply] using congrArg e hqp' + +theorem WOTStarAlgEquiv.isII1Factor_iff (e : WOTStarAlgEquiv S T) + (hS : WOTClosed S) (hT : WOTClosed T) : IsII1Factor S ↔ IsII1Factor T := + ⟨fun h => isII1Factor_of_starAlgEquiv e.toStarAlgEquiv h hT, + fun h => isII1Factor_of_starAlgEquiv e.toStarAlgEquiv.symm h hS⟩ + +end + +/-! Compact original image balls and spectral clipping identify the actual +bicommutant with the original algebra's represented image. -/ +open Filter +open scoped ComplexConjugate ComplexStarModule CStarAlgebra Pointwise Topology +namespace Tracial + +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertImageCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertImageOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertImageStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceHilbertImageOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +local notation "N" => traceFreeHilbertClosure hfactor hdiff hfinite hunit +local notation "ρ" => traceFreeHilbertIntoClosure hfactor hdiff hfinite hunit +local notation "σ" => traceFreeHilbertClosureTrace hfactor hdiff hfinite hunit +local instance traceHilbertImageClosureCStar : CStarAlgebra (N).toStarSubalgebra := {} + +def traceFreeHilbertVectorBall (C : ℝ) : Set K := + {x | ∃ a : M.toStarSubalgebra, ‖a‖ ≤ C ∧ π a Ω = x} + +theorem traceFreeHilbertVectorBall_isClosed (C : ℝ) : + IsClosed (traceFreeHilbertVectorBall hfactor hdiff hfinite hunit C) := by + apply IsSeqClosed.isClosed + intro v x hv hx + choose a ha he using hv + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + obtain ⟨T,hT,ht⟩ := (traceFreeHilbertWeakBall_isCompact hfactor hdiff hfinite hunit C).ultrafilter_le_nhds + (ω.map (fun n => ContinuousLinearMapWOT.ofCLM (π (a n)))) (by + apply le_principal_iff.mpr + change ∀ᶠ n in (ω : Filter ℕ), ContinuousLinearMapWOT.ofCLM (π (a n)) ∈ + traceFreeHilbertWeakBall hfactor hdiff hfinite hunit C + exact Eventually.of_forall (fun n => ⟨a n,ha n,rfl⟩)) + obtain ⟨b,hb,rfl⟩ := hT + refine ⟨b,hb,?_⟩ + apply ext_inner_left ℂ + intro y + have hw := (ContinuousLinearMapWOT.tendsto_iff_forall_inner_apply_tendsto.mp ht) Ω y + change Tendsto (fun n => inner ℂ y (π (a n) Ω)) (ω : Filter ℕ) + (𝓝 (inner ℂ y (π b Ω))) at hw + have hn := (innerSL ℂ y).continuous.continuousAt.tendsto.comp + (hx.mono_left (Ultrafilter.of_le atTop)) + exact tendsto_nhds_unique hw (by simpa only [Function.comp_def,innerSL_apply_apply,he] using hn) + +theorem traceFreeHilbertIntoClosure_symmetrize (a : M.toStarSubalgebra) : + ρ (traceSymmetrize a) = traceSymmetrize (ρ a) := by + simp only [traceSymmetrize,map_smul,map_add,map_star] + +theorem traceFreeHilbertIntoClosure_clip (a : M.toStarSubalgebra) (ha : IsSelfAdjoint a) (C : ℝ) : + ρ (traceClip a C) = traceClip (ρ a) C := by + rw [traceClip_cfc a ha C,traceClip_cfc _ (ha.map ρ) C] + exact (ρ).map_cfc (fun t : ℝ => -min (-min t C) C) a + (by fun_prop) (by fun_prop) ha (ha.map ρ) + +theorem traceFreeHilbertClosure_selfAdjoint_approximation + (x : (N).toStarSubalgebra) (hx : IsSelfAdjoint x) (ε : ℝ) (hε : 0 < ε) : + ∃ a : M.toStarSubalgebra, IsSelfAdjoint a ∧ ‖a‖ ≤ ‖x‖ ∧ (σ).norm₂ (ρ a-x) < ε := by + obtain ⟨v,⟨a,rfl⟩,ha⟩ := Metric.mem_closure_iff.mp + (traceFreeHilbertAction_cyclic hfactor hdiff hfinite hunit (x.val Ω)) ε hε + have ha' : (σ).norm₂ (ρ a-x) < ε := by + change ‖π a Ω-x.val Ω‖ < ε + simpa only [dist_eq_norm,norm_sub_rev] using ha + let b := traceSymmetrize a + have hb : IsSelfAdjoint b := traceSymmetrize_selfAdjoint a + have hb' : (σ).norm₂ (ρ b-x) ≤ (σ).norm₂ (ρ a-x) := by + have he : ρ b-x = traceSymmetrize (ρ a-x) := by + rw [traceSymmetrize_sub,traceSymmetrize_eq_self x hx] + exact congrArg (fun z => z-x) (traceFreeHilbertIntoClosure_symmetrize hfactor hdiff hfinite hunit a) + rw [he] + exact traceSymmetrize_norm₂_le σ _ + refine ⟨traceClip b ‖x‖,traceClip_selfAdjoint b hb _,traceClip_norm_le b hb _ (norm_nonneg _),?_⟩ + rw [traceFreeHilbertIntoClosure_clip hfactor hdiff hfinite hunit b hb] + exact (traceClip_distance σ (ρ b) x (hb.map ρ) hx).trans_lt (hb'.trans_lt ha') + +theorem traceFreeHilbertClosure_selfAdjoint_preimage (x : (N).toStarSubalgebra) + (hx : IsSelfAdjoint x) : ∃ a : M.toStarSubalgebra, ρ a = x := by + have hm : x.val Ω ∈ traceFreeHilbertVectorBall hfactor hdiff hfinite hunit ‖x‖ := by + apply (traceFreeHilbertVectorBall_isClosed hfactor hdiff hfinite hunit ‖x‖).closure_subset + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨a,_,ha,hax⟩ := traceFreeHilbertClosure_selfAdjoint_approximation hfactor hdiff hfinite hunit x hx ε hε + exact ⟨π a Ω,⟨a,ha,rfl⟩,by + change ‖π a Ω-x.val Ω‖ < ε at hax + simpa only [dist_eq_norm,norm_sub_rev] using hax⟩ + obtain ⟨a,_,ha⟩ := hm + refine ⟨a,?_⟩ + apply sub_eq_zero.mp + apply (σ).separating + change π a Ω-x.val Ω = 0 + exact sub_eq_zero.mpr ha + +theorem traceFreeHilbertIntoClosure_surjective : Function.Surjective ρ := by + intro x + obtain ⟨a,ha⟩ := traceFreeHilbertClosure_selfAdjoint_preimage hfactor hdiff hfinite hunit (ℜ x) (ℜ x).property + obtain ⟨b,hb⟩ := traceFreeHilbertClosure_selfAdjoint_preimage hfactor hdiff hfinite hunit (ℑ x) (ℑ x).property + refine ⟨a+Complex.I • b,?_⟩ + rw [map_add,map_smul,ha,hb] + exact realPart_add_I_smul_imaginaryPart x + +theorem traceFreeHilbertIntoClosure_injective : Function.Injective ρ := by + intro a b hab + exact traceFreeHilbertAction_injective hfactor hdiff hfinite hunit (congrArg Subtype.val hab) + +def traceFreeHilbertEquiv : M.toStarSubalgebra ≃⋆ₐ[ℂ] (N).toStarSubalgebra := + StarAlgEquiv.ofBijective ρ ⟨traceFreeHilbertIntoClosure_injective hfactor hdiff hfinite hunit, + traceFreeHilbertIntoClosure_surjective hfactor hdiff hfinite hunit⟩ + +theorem traceFreeHilbertAction_range_eq : (π).range = (N).toStarSubalgebra := by + ext T + constructor + · rintro ⟨a,rfl⟩ + exact traceFreeHilbertAction_mem_closure hfactor hdiff hfinite hunit a + · intro hT + obtain ⟨a,ha⟩ := traceFreeHilbertIntoClosure_surjective hfactor hdiff hfinite hunit ⟨T,hT⟩ + exact ⟨a,congrArg Subtype.val ha⟩ + +theorem traceHilbertVonNeumann_wotClosed {J : Type*} [NormedAddCommGroup J] [InnerProductSpace ℂ J] [CompleteSpace J] + (P : VonNeumannAlgebra J) : WOTClosed P.toStarSubalgebra := by + change IsClosed {T : J →WOT[ℂ] J | T.toCLM ∈ (P : Set (J →L[ℂ] J))} + rw [← P.centralizer_centralizer] + change IsClosed {T : J →WOT[ℂ] J | + ∀ S ∈ Set.centralizer (P : Set (J →L[ℂ] J)),S*T.toCLM=T.toCLM*S} + simp only [Set.ofPred_forall] + apply isClosed_iInter + intro S + apply isClosed_iInter + intro hS + have he : {T : J →WOT[ℂ] J | S*T.toCLM=T.toCLM*S} = + {T : J →WOT[ℂ] J | + (ContinuousLinearMapWOT.equiv.symm S)*T=T*(ContinuousLinearMapWOT.equiv.symm S)} := by + ext T + let e : (J →WOT[ℂ] J) ≃ (J →L[ℂ] J) := ContinuousLinearMapWOT.equiv + exact e.injective.eq_iff + rw [he] + exact isClosed_eq (continuous_const_mul _) (continuous_mul_const _) + +theorem traceFreeHilbertAction_range_wotClosed : WOTClosed (π).range := by + rw [traceFreeHilbertAction_range_eq] + exact traceHilbertVonNeumann_wotClosed N + +end + +/-! Algebraic and isometric transport of factor structure and existential Banach preduals. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceHilbertTransportCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceHilbertTransportOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceHilbertTransportStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceHilbertTransportOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +local notation "N" => traceFreeHilbertClosure hfactor hdiff hfinite hunit +local notation "ρ" => traceFreeHilbertIntoClosure hfactor hdiff hfinite hunit +local notation "σ" => traceFreeHilbertClosureTrace hfactor hdiff hfinite hunit +local instance traceHilbertTransportClosureCStar : CStarAlgebra (N).toStarSubalgebra := {} + +local notation "e" => traceFreeHilbertEquiv hfactor hdiff hfinite hunit + +theorem traceFreeHilbertEquiv_norm (a : M.toStarSubalgebra) : ‖e a‖ = ‖a‖ := + NonUnitalStarAlgHom.norm_map (e).toStarAlgHom (e).injective a + +def traceFreeHilbertIsometry : M.toStarSubalgebra ≃ₗᵢ[ℂ] (N).toStarSubalgebra := + { (e).toAlgEquiv.toLinearEquiv with + norm_map' := traceFreeHilbertEquiv_norm hfactor hdiff hfinite hunit } + +theorem traceFreeHilbertClosure_isII1Factor : IsII1Factor (N).toStarSubalgebra := by + have hM : IsII1Factor M.toStarSubalgebra := { + nonzero := fun h => hunit (Subtype.ext h.symm) + weaklyClosed := traceHilbertVonNeumann_wotClosed M + factor := by + intro a ha + obtain ⟨z,hz⟩ := hfactor a ha + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z).symm⟩ + finite := hfinite + diffuse := hdiff } + exact isII1Factor_of_starAlgEquiv e hM (traceHilbertVonNeumann_wotClosed N) + +theorem traceFreeHilbertClosure_hasSeparablePredual + (hsep : HasSeparablePredual M.toStarSubalgebra) : HasSeparablePredual (N).toStarSubalgebra := by + obtain ⟨X,g,s,c,hs,⟨d⟩⟩ := hsep + exact ⟨X,g,s,c,hs,⟨d.trans (traceFreeHilbertIsometry hfactor hdiff hfinite hunit)⟩⟩ + +end Tracial + +section +universe u +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- The original exact factor and predual predicates produce a concrete cyclic +tracial representation and an isometric algebra isomorphism. No WOT continuity +of the isomorphism on the whole carrier, or Hilbert separability, is asserted. -/ +theorem isII1Factor_cyclic_tracial_representation + (S : StarSubalgebra ℂ (H →L[ℂ] H)) (hS : IsII1Factor S) (hsep : HasSeparablePredual S) : + ∃ (K : Type u) (_ : NormedAddCommGroup K) (_ : InnerProductSpace ℂ K) (_ : CompleteSpace K) + (N : VonNeumannAlgebra K) (e : S ≃⋆ₐ[ℂ] N.toStarSubalgebra) + (τ : UltrapowerBridge.TracialRepresentation N), + IsII1Factor N.toStarSubalgebra ∧ HasSeparablePredual N.toStarSubalgebra ∧ + (∀ a, ‖e a‖ = ‖a‖) ∧ DenseRange (fun a : N.toStarSubalgebra => a.val τ.vector) := by + let M := vonNeumannOfWOTClosed S hS.weaklyClosed + have hf : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra) := by + intro c hc + obtain ⟨z,hz⟩ := hS.factor c hc + exact ⟨z,hz.trans (Algebra.algebraMap_eq_smul_one z)⟩ + have hunit : (1 : M.toStarSubalgebra) ≠ 0 := by + intro h + exact hS.nonzero (congrArg Subtype.val h).symm + let E := Tracial.TraceFreePreHilbert hf hS.diffuse hS.finite hunit + let : NormedAddCommGroup E := + Tracial.traceFreePreHilbertNormedAddCommGroup hf hS.diffuse hS.finite hunit + let : InnerProductSpace ℂ E := + Tracial.traceFreePreHilbertInnerProductSpace hf hS.diffuse hS.finite hunit + let K := Tracial.TraceFreeHilbert hf hS.diffuse hS.finite hunit + let g : NormedAddCommGroup K := inferInstance + let i : InnerProductSpace ℂ K := UniformSpace.Completion.innerProductSpace + let c : CompleteSpace K := inferInstance + exact ⟨K,g,i,c, + Tracial.traceFreeHilbertClosure hf hS.diffuse hS.finite hunit, + Tracial.traceFreeHilbertEquiv hf hS.diffuse hS.finite hunit, + Tracial.traceFreeHilbertClosureTrace hf hS.diffuse hS.finite hunit, + Tracial.traceFreeHilbertClosure_isII1Factor hf hS.diffuse hS.finite hunit, + Tracial.traceFreeHilbertClosure_hasSeparablePredual hf hS.diffuse hS.finite hunit hsep, + Tracial.traceFreeHilbertEquiv_norm hf hS.diffuse hS.finite hunit, + Tracial.traceFreeHilbertClosureTrace_cyclic hf hS.diffuse hS.finite hunit⟩ + +end + +/-! First step of generation transport: compact balls and closed vector balls +for the represented intersection with any original WOT-closed subalgebra. -/ +open Filter +open scoped Topology CStarAlgebra +namespace Tracial +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceSubalgebraBallCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceSubalgebraBallOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceSubalgebraBallStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceSubalgebraBallOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +local notation "N" => traceFreeHilbertClosure hfactor hdiff hfinite hunit +local notation "ρ" => traceFreeHilbertIntoClosure hfactor hdiff hfinite hunit +local notation "σ" => traceFreeHilbertClosureTrace hfactor hdiff hfinite hunit +local instance traceSubalgebraBallClosureCStar : CStarAlgebra (N).toStarSubalgebra := {} + +variable (Q : StarSubalgebra ℂ (H →L[ℂ] H)) + +def traceFreeSubalgebraWeakBall (C : ℝ) : Set (K →WOT[ℂ] K) := + {T | ∃ a : M.toStarSubalgebra, a.val ∈ Q ∧ ‖a‖ ≤ C ∧ + ContinuousLinearMapWOT.ofCLM (π a) = T} + +theorem traceFreeSubalgebraWeakBall_isCompact (hQ : WOTClosed Q) (C : ℝ) : + IsCompact (traceFreeSubalgebraWeakBall hfactor hdiff hfinite hunit Q C) := by + let : CompactSpace (weakOperatorBall M C) := + isCompact_iff_compactSpace.mp (weakOperatorBall_isCompact M C) + have hc : IsCompact {T : weakOperatorBall M C | T.val.toCLM ∈ Q} := + (hQ.preimage continuous_subtype_val).isCompact + have he : traceFreeSubalgebraWeakBall hfactor hdiff hfinite hunit Q C = + traceFreeHilbertBallMap hfactor hdiff hfinite hunit C '' + {T : weakOperatorBall M C | T.val.toCLM ∈ Q} := by + ext T + constructor + · rintro ⟨a,ha,hn,rfl⟩ + exact ⟨⟨ContinuousLinearMapWOT.ofCLM a.val,⟨a.property,hn⟩⟩,ha,rfl⟩ + · rintro ⟨a,ha,rfl⟩ + exact ⟨⟨a.val.toCLM,a.property.1⟩,ha,a.property.2,rfl⟩ + rw [he] + exact hc.image (traceFreeHilbertBallMap_continuous hfactor hdiff hfinite hunit C) + +def traceFreeSubalgebraVectorBall (C : ℝ) : Set K := + {x | ∃ a : M.toStarSubalgebra, a.val ∈ Q ∧ ‖a‖ ≤ C ∧ π a Ω = x} + +theorem traceFreeSubalgebraVectorBall_isClosed (hQ : WOTClosed Q) (C : ℝ) : + IsClosed (traceFreeSubalgebraVectorBall hfactor hdiff hfinite hunit Q C) := by + apply IsSeqClosed.isClosed + intro v x hv hx + choose a hQmem ha he using hv + let ω : Ultrafilter ℕ := Ultrafilter.of atTop + obtain ⟨T,hT,ht⟩ := (traceFreeSubalgebraWeakBall_isCompact hfactor hdiff hfinite hunit Q hQ C).ultrafilter_le_nhds + (ω.map (fun n => ContinuousLinearMapWOT.ofCLM (π (a n)))) (by + apply le_principal_iff.mpr + change ∀ᶠ n in (ω : Filter ℕ), ContinuousLinearMapWOT.ofCLM (π (a n)) ∈ + traceFreeSubalgebraWeakBall hfactor hdiff hfinite hunit Q C + exact Eventually.of_forall (fun n => ⟨a n,hQmem n,ha n,rfl⟩)) + obtain ⟨b,hbQ,hb,rfl⟩ := hT + refine ⟨b,hbQ,hb,?_⟩ + apply ext_inner_left ℂ + intro y + have hw := (ContinuousLinearMapWOT.tendsto_iff_forall_inner_apply_tendsto.mp ht) Ω y + change Tendsto (fun n => inner ℂ y (π (a n) Ω)) (ω : Filter ℕ) + (𝓝 (inner ℂ y (π b Ω))) at hw + have hn := (innerSL ℂ y).continuous.continuousAt.tendsto.comp + (hx.mono_left (Ultrafilter.of_le atTop)) + exact tendsto_nhds_unique hw (by simpa only [Function.comp_def,innerSL_apply_apply,he] using hn) + +theorem traceSymmetrize_mem_original (a : M.toStarSubalgebra) (ha : a.val ∈ Q) : + (traceSymmetrize a).val ∈ Q := by + have hs : star a.val ∈ Q := star_mem ha + exact Q.smul_mem (Q.add_mem ha hs) _ + +theorem traceClip_mem_original (hQ : WOTClosed Q) (a : M.toStarSubalgebra) + (haQ : a.val ∈ Q) (ha : IsSelfAdjoint a) (C : ℝ) : (traceClip a C).val ∈ Q := by + let P := Q.comap M.toStarSubalgebra.subtype + let : IsClosed (P : Set M.toStarSubalgebra) := + (hQ.preimage ContinuousLinearMapWOT.continuous_ofCLM).preimage continuous_subtype_val + change traceClip a C ∈ P + rw [traceClip_cfc a ha C] + exact cfc_mem (𝕜' := ℂ) (fun t : ℝ => -min (-min t C) C) haQ + +end Tracial + +/-! Closed images of original WOT-closed subalgebras in the constructed representation. -/ +open Filter +open scoped Topology CStarAlgebra ComplexStarModule +namespace Tracial + +section +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceSubalgebraImageCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceSubalgebraImageOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceSubalgebraImageStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceSubalgebraImageOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +local notation "N" => traceFreeHilbertClosure hfactor hdiff hfinite hunit +local notation "ρ" => traceFreeHilbertIntoClosure hfactor hdiff hfinite hunit +local notation "σ" => traceFreeHilbertClosureTrace hfactor hdiff hfinite hunit +local instance traceSubalgebraImageClosureCStar : CStarAlgebra (N).toStarSubalgebra := {} + +variable (Q : StarSubalgebra ℂ (H →L[ℂ] H)) + +local notation "P" => StarSubalgebra.map π (StarSubalgebra.comap + (StarSubalgebra.subtype (VonNeumannAlgebra.toStarSubalgebra M)) Q) + +/-- The double commutant of the represented intersection with Q. -/ +def traceFreeSubalgebraClosure : VonNeumannAlgebra K where + toStarSubalgebra := StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (P : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K)) + centralizer_centralizer' := by + change Set.centralizer (Set.centralizer + ((StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + (P : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K))) : Set (K →L[ℂ] K))) = + ((StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ + (P : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K))) : Set (K →L[ℂ] K)) + rw [StarSubalgebra.coe_centralizer_centralizer] + simp only [Set.centralizer_centralizer_centralizer] + +local notation "R" => traceFreeSubalgebraClosure hfactor hdiff hfinite hunit Q + +theorem traceFreeSubalgebraClosure_mem_iff (T : K →L[ℂ] K) : + T ∈ R ↔ T ∈ Set.centralizer (Set.centralizer (P : Set (K →L[ℂ] K))) := by + change T ∈ (StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ (P : Set (K →L[ℂ] K)) : Set (K →L[ℂ] K))) ↔ _ + simp only [← SetLike.mem_coe,StarSubalgebra.coe_centralizer_centralizer, + StarMemClass.star_coe_eq,Set.union_self] + +theorem traceFreeSubalgebraClosure_le : (R).toStarSubalgebra ≤ (N).toStarSubalgebra := by + intro T hT + apply (traceFreeHilbertClosure_mem_iff hfactor hdiff hfinite hunit T).mpr + have ht := (traceFreeSubalgebraClosure_mem_iff hfactor hdiff hfinite hunit Q T).mp hT + intro a ha + apply ht a + rintro b ⟨c,_,rfl⟩ + exact ha (π c) ⟨c,rfl⟩ + +def traceFreeSubalgebraInclusion : (R).toStarSubalgebra →⋆ₐ[ℂ] (N).toStarSubalgebra := + StarSubalgebra.inclusion (traceFreeSubalgebraClosure_le hfactor hdiff hfinite hunit Q) + +local notation "j" => traceFreeSubalgebraInclusion hfactor hdiff hfinite hunit Q + +theorem traceFreeSubalgebra_selfAdjoint_approximation + (hQ : WOTClosed Q) (x : (R).toStarSubalgebra) (hx : IsSelfAdjoint x) + (ε : ℝ) (hε : 0 < ε) : + ∃ a : M.toStarSubalgebra, a.val ∈ Q ∧ IsSelfAdjoint a ∧ ‖a‖ ≤ ‖j x‖ ∧ + (σ).norm₂ (ρ a-j x) < ε := by + classical + obtain ⟨v,hv⟩ := bicommutant_finite_strong_approximation P x.val + ((traceFreeSubalgebraClosure_mem_iff hfactor hdiff hfinite hunit Q x.val).mp x.property) + {Ω} ε hε + obtain ⟨a,haQ,ha⟩ := v.property + change π a = v.val at ha + have ha' : (σ).norm₂ (ρ a-j x) < ε := by + change ‖π a Ω-x.val Ω‖ < ε + have happrox := hv Ω (Finset.mem_singleton_self Ω) + change ‖x.val Ω-v.val Ω‖ < ε at happrox + rw [← ha] at happrox + simpa only [norm_sub_rev] using happrox + let b := traceSymmetrize a + have hb : IsSelfAdjoint b := traceSymmetrize_selfAdjoint a + have hbQ : b.val ∈ Q := traceSymmetrize_mem_original Q a haQ + have hJ : IsSelfAdjoint (j x) := hx.map j + have hb' : (σ).norm₂ (ρ b-j x) ≤ (σ).norm₂ (ρ a-j x) := by + have he : ρ b-j x = traceSymmetrize (ρ a-j x) := by + rw [traceSymmetrize_sub,traceSymmetrize_eq_self (j x) hJ] + exact congrArg (fun z => z-j x) + (traceFreeHilbertIntoClosure_symmetrize hfactor hdiff hfinite hunit a) + rw [he] + exact traceSymmetrize_norm₂_le σ _ + refine ⟨traceClip b ‖j x‖, + traceClip_mem_original Q hQ b hbQ hb _, + traceClip_selfAdjoint b hb _,traceClip_norm_le b hb _ (norm_nonneg _),?_⟩ + rw [traceFreeHilbertIntoClosure_clip hfactor hdiff hfinite hunit b hb] + exact (traceClip_distance σ (ρ b) (j x) (hb.map ρ) hJ).trans_lt (hb'.trans_lt ha') + +theorem traceFreeSubalgebra_selfAdjoint_preimage + (hQ : WOTClosed Q) (x : (R).toStarSubalgebra) (hx : IsSelfAdjoint x) : + ∃ a : M.toStarSubalgebra, a.val ∈ Q ∧ ρ a = j x := by + have hm : x.val Ω ∈ traceFreeSubalgebraVectorBall hfactor hdiff hfinite hunit Q ‖j x‖ := by + apply (traceFreeSubalgebraVectorBall_isClosed hfactor hdiff hfinite hunit Q hQ ‖j x‖).closure_subset + apply Metric.mem_closure_iff.mpr + intro ε hε + obtain ⟨a,haQ,_,ha,hax⟩ := traceFreeSubalgebra_selfAdjoint_approximation + hfactor hdiff hfinite hunit Q hQ x hx ε hε + exact ⟨π a Ω,⟨a,haQ,ha,rfl⟩,by + change ‖π a Ω-x.val Ω‖ < ε at hax + simpa only [dist_eq_norm,norm_sub_rev] using hax⟩ + obtain ⟨a,haQ,_,ha⟩ := hm + refine ⟨a,haQ,?_⟩ + apply sub_eq_zero.mp + apply (σ).separating + change π a Ω-x.val Ω = 0 + exact sub_eq_zero.mpr ha + +theorem traceFreeSubalgebraClosure_preimage + (hQ : WOTClosed Q) (x : (R).toStarSubalgebra) : + ∃ a : M.toStarSubalgebra, a.val ∈ Q ∧ ρ a = j x := by + obtain ⟨a,haQ,ha⟩ := traceFreeSubalgebra_selfAdjoint_preimage hfactor hdiff hfinite hunit Q hQ + (ℜ x) (ℜ x).property + obtain ⟨b,hbQ,hb⟩ := traceFreeSubalgebra_selfAdjoint_preimage hfactor hdiff hfinite hunit Q hQ + (ℑ x) (ℑ x).property + refine ⟨a+Complex.I • b,Q.add_mem haQ (Q.smul_mem hbQ _),?_⟩ + rw [map_add,map_smul,ha,hb,← map_smul,← map_add] + exact congrArg j (realPart_add_I_smul_imaginaryPart x) + +theorem traceFreeSubalgebraImage_eq_closure (hQ : WOTClosed Q) : + P = (R).toStarSubalgebra := by + apply le_antisymm + · intro T hT + apply (traceFreeSubalgebraClosure_mem_iff hfactor hdiff hfinite hunit Q T).mpr + exact fun a ha => (ha T hT).symm + · intro T hT + obtain ⟨a,haQ,ha⟩ := traceFreeSubalgebraClosure_preimage hfactor hdiff hfinite hunit Q hQ ⟨T,hT⟩ + exact ⟨a,haQ,congrArg Subtype.val ha⟩ + +/-- Every original WOT-closed subalgebra has WOT-closed represented intersection. +No cyclicity of its orbit, factor hypothesis on Q, or full WOT continuity is used. -/ +theorem traceFreeSubalgebraImage_wotClosed (hQ : WOTClosed Q) : + WOTClosed ((Q.comap M.toStarSubalgebra.subtype).map π) := by + rw [traceFreeSubalgebraImage_eq_closure hfactor hdiff hfinite hunit Q hQ] + exact traceHilbertVonNeumann_wotClosed R + +end + +/-! Generation pullback for the actual constructed trace representation. -/ +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} +local instance traceGenerationTransportCStar : CStarAlgebra M.toStarSubalgebra := {} +local instance traceGenerationTransportOrder : PartialOrder M.toStarSubalgebra := CStarAlgebra.spectralOrder _ +local instance traceGenerationTransportStarOrder : StarOrderedRing M.toStarSubalgebra := CStarAlgebra.spectralOrderedRing _ +variable (hfactor : ∀ c : M.toStarSubalgebra, + (∀ a : M.toStarSubalgebra, a*c=c*a) → ∃ z : ℂ, c=z • (1 : M.toStarSubalgebra)) +variable (hdiff : ∀ p : M.toStarSubalgebra, IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) +variable (hfinite : ∀ a : M.toStarSubalgebra, star a*a=1 → a*star a=1) +variable (hunit : (1 : M.toStarSubalgebra) ≠ 0) + +local notation "E" => TraceFreePreHilbert hfactor hdiff hfinite hunit +local notation "τ₀" => traceFreeTrace hfactor hdiff hfinite hunit + +local notation "copy" => traceFreeCopy hfactor hdiff hfinite hunit + +local notation "K" => TraceFreeHilbert hfactor hdiff hfinite hunit +local notation "ι" => traceFreeInclusion hfactor hdiff hfinite hunit +local instance traceGenerationTransportOperatorCStar : CStarAlgebra (K →L[ℂ] K) := {} + +local notation "π" => traceFreeHilbertAction hfactor hdiff hfinite hunit +local notation "Ω" => traceFreeHilbertVector hfactor hdiff hfinite hunit + +local notation "N" => traceFreeHilbertClosure hfactor hdiff hfinite hunit +local notation "ρ" => traceFreeHilbertIntoClosure hfactor hdiff hfinite hunit +local notation "σ" => traceFreeHilbertClosureTrace hfactor hdiff hfinite hunit +local instance traceGenerationTransportClosureCStar : CStarAlgebra (N).toStarSubalgebra := {} + +local notation "e" => traceFreeHilbertEquiv hfactor hdiff hfinite hunit + +/-- Pull a literal W*-generator back through the constructed representation. +Closed images of the original generated subalgebra replace any unproved +whole-carrier weak-operator continuity assertion. -/ +theorem traceFreeHilbert_singlyGenerated_pullback + (hgen : SinglyGenerated (N).toStarSubalgebra) : SinglyGenerated M.toStarSubalgebra := by + obtain ⟨b,hb,hgen⟩ := hgen + let a : M.toStarSubalgebra := (e).symm ⟨b,hb⟩ + let Q := wstar {a.val} + have hQM : Q ≤ M.toStarSubalgebra := + wstar_le (traceHilbertVonNeumann_wotClosed M) (by + intro c hc + obtain rfl := Set.mem_singleton_iff.mp hc + exact a.property) + let P := (Q.comap M.toStarSubalgebra.subtype).map π + have hbP : b ∈ P := by + refine ⟨a,subset_wstar {a.val} (Set.mem_singleton a.val),?_⟩ + exact congrArg Subtype.val ((e).apply_symm_apply ⟨b,hb⟩) + have hNP : (N).toStarSubalgebra ≤ P := by + rw [← hgen] + exact wstar_le (traceFreeSubalgebraImage_wotClosed hfactor hdiff hfinite hunit Q + (wstar_closed {a.val})) (by + intro c hc + obtain rfl := Set.mem_singleton_iff.mp hc + exact hbP) + refine ⟨a.val,a.property,le_antisymm hQM ?_⟩ + intro c hc + obtain ⟨d,hdQ,hd⟩ := hNP (traceFreeHilbertAction_mem_closure hfactor hdiff hfinite hunit ⟨c,hc⟩) + have hd' : d = (⟨c,hc⟩ : M.toStarSubalgebra) := + traceFreeHilbertAction_injective hfactor hdiff hfinite hunit hd + change d.val ∈ Q at hdQ + rw [hd'] at hdQ + exact hdQ + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/TracialInclusion.lean b/lean/OAI/Analysis/FactorGeneration/TracialInclusion.lean new file mode 100644 index 0000000000000000000000000000000000000000..02cef6bce9202aa9ec7287c513bd435b0ba7068f --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/TracialInclusion.lean @@ -0,0 +1,98 @@ +import OAI.Analysis.FactorGeneration.OperatorLimits +import OAI.Analysis.FactorGeneration.Ultrapower + +namespace OAI + +namespace Generator.Tracial + +/-! The restricted faithful trace and the actual P^omega -> M^omega +inclusion. All constructions are on the bounded-sequence quotient. -/ +noncomputable section +open Filter +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M P : VonNeumannAlgebra H} (τ : TracialRepresentation M) (hPM : P ≤ M) + +def coordinateInclusion : P.toStarSubalgebra →⋆ₐ[ℂ] M.toStarSubalgebra := + StarSubalgebra.inclusion hPM + +def restrictedTrace : TracialRepresentation P where + vector := τ.vector + norm_vector := τ.norm_vector + cyclic a b := τ.cyclic (coordinateInclusion hPM a) (coordinateInclusion hPM b) + separating a ha := by + have h := τ.separating (coordinateInclusion hPM a) ha + apply Subtype.ext + exact congrArg (fun x : M.toStarSubalgebra => x.val) h + +@[simp] theorem restrictedTrace_trace (a : P.toStarSubalgebra) : + (restrictedTrace τ hPM).trace a = τ.trace (coordinateInclusion hPM a) := rfl + +@[simp] theorem restrictedTrace_norm₂ (a : P.toStarSubalgebra) : + (restrictedTrace τ hPM).norm₂ a = τ.norm₂ (coordinateInclusion hPM a) := rfl + +def boundedInclusion : Bounded P →⋆ₐ[ℂ] Bounded M where + toFun a := ⟨fun n => coordinateInclusion hPM (a.val n), a.property⟩ + map_one' := rfl + map_mul' _ _ := rfl + map_zero' := rfl + map_add' _ _ := rfl + commutes' _ := rfl + map_star' _ := rfl + +theorem inclusion_traceRel_iff (l : Filter ℕ) (a b : Bounded P) : + TraceRel τ l (boundedInclusion hPM a) (boundedInclusion hPM b) ↔ + TraceRel (restrictedTrace τ hPM) l a b := Iff.rfl + +def quotientInclusion (l : Filter ℕ) : + TracialQuotient (restrictedTrace τ hPM) l →⋆ₐ[ℂ] TracialQuotient τ l where + toFun := Quotient.map (boundedInclusion hPM) (fun _ _ h => h) + map_one' := rfl + map_mul' a b := by + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => rfl + map_zero' := rfl + map_add' a b := by + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => rfl + commutes' _ := rfl + map_star' a := by induction a using Quotient.inductionOn with | h a => rfl + +@[simp] theorem quotientInclusion_mk (l : Filter ℕ) (a : Bounded P) : + quotientInclusion τ hPM l (quotientMap (restrictedTrace τ hPM) l a) = + quotientMap τ l (boundedInclusion hPM a) := rfl + +theorem quotientInclusion_injective (l : Filter ℕ) : Function.Injective (quotientInclusion τ hPM l) := by + intro a b + induction a using Quotient.inductionOn with | h a => + induction b using Quotient.inductionOn with | h b => + intro h + have hh := (quotientMap_eq_iff τ l (boundedInclusion hPM a) (boundedInclusion hPM b)).mp h + exact (quotientMap_eq_iff (restrictedTrace τ hPM) l a b).mpr + ((inclusion_traceRel_iff τ hPM l a b).mp hh) + +@[simp] theorem quotientInclusion_trace (ω : Ultrafilter ℕ) + (a : TracialQuotient (restrictedTrace τ hPM) (ω : Filter ℕ)) : + quotientTrace τ ω (quotientInclusion τ hPM (ω : Filter ℕ) a) = + quotientTrace (restrictedTrace τ hPM) ω a := by + induction a using Quotient.inductionOn with + | h a => + change traceRep τ ω (boundedInclusion hPM a) = traceRep (restrictedTrace τ hPM) ω a + exact tendsto_nhds_unique (traceRep_tendsto τ ω (boundedInclusion hPM a)) + (traceRep_tendsto (restrictedTrace τ hPM) ω a) + +/-- P, as a star subalgebra of M. Its completeness is derived, not assumed. -/ +def insideAlgebra : StarSubalgebra ℂ M.toStarSubalgebra := + P.toStarSubalgebra.comap M.toStarSubalgebra.subtype + +theorem insideAlgebra_closed : IsClosed (insideAlgebra (M := M) (P := P) : Set M.toStarSubalgebra) := + (base_norm_closed P).preimage continuous_subtype_val + +instance insideAlgebra_complete : CompleteSpace (insideAlgebra (M := M) (P := P)) := + (insideAlgebra_closed (M := M) (P := P)).completeSpace_coe + +end + +end Generator.Tracial + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Ultrapower.lean b/lean/OAI/Analysis/FactorGeneration/Ultrapower.lean new file mode 100644 index 0000000000000000000000000000000000000000..54b1b125c5a0ac952032207743628a9dd3294ed3 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Ultrapower.lean @@ -0,0 +1,266 @@ +import Mathlib.Order.Filter.Ultrafilter.Basic +import Mathlib.RingTheory.Congruence.Basic +import Mathlib.Tactic.NoncommRing +import Mathlib.Topology.MetricSpace.ProperSpace +import OAI.Analysis.FactorGeneration.GroupTrace + +namespace OAI + +noncomputable section + +namespace UltrapowerBridge + +section +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} + +omit [CompleteSpace H] in +theorem operator_norm_one_le : ‖(1 : H →L[ℂ] H)‖ ≤ 1 := + ContinuousLinearMap.opNorm_le_bound _ zero_le_one (by intro x; simp) + +/-- Operator-norm bounded sequences, as an actual star subalgebra of pointwise sequences. -/ +def boundedSequences (M : VonNeumannAlgebra H) : StarSubalgebra ℂ (ℕ → M.toStarSubalgebra) where + carrier := {a | ∃ C : ℝ, 0 ≤ C ∧ ∀ n, ‖a n‖ ≤ C} + zero_mem' := ⟨0, le_rfl, by simp⟩ + one_mem' := ⟨1, by norm_num, fun n => operator_norm_one_le⟩ + add_mem' := by + rintro a b ⟨C,hC,ha⟩ ⟨D,hD,hb⟩ + exact ⟨C+D, add_nonneg hC hD, fun n => + (norm_add_le _ _).trans (add_le_add (ha n) (hb n))⟩ + mul_mem' := by + rintro a b ⟨C,hC,ha⟩ ⟨D,hD,hb⟩ + exact ⟨C*D, mul_nonneg hC hD, fun n => + (norm_mul_le _ _).trans (mul_le_mul (ha n) (hb n) (norm_nonneg _) hC)⟩ + algebraMap_mem' c := by + refine ⟨‖c‖, norm_nonneg _, fun n => ?_⟩ + change ‖algebraMap ℂ M.toStarSubalgebra c‖ ≤ ‖c‖ + rw [Algebra.algebraMap_eq_smul_one, norm_smul] + exact (mul_le_mul_of_nonneg_left operator_norm_one_le (norm_nonneg c)).trans_eq (mul_one _) + star_mem' := by + rintro a ⟨C,hC,ha⟩ + refine ⟨C,hC,fun n => ?_⟩ + change ‖star (a n : H →L[ℂ] H)‖ ≤ C + simpa [ContinuousLinearMap.star_eq_adjoint] using ha n + +abbrev Bounded (M : VonNeumannAlgebra H) := boundedSequences M + +variable (τ : TracialRepresentation M) (l : Filter ℕ) +/-- The trace-null equivalence relation, before descending algebra operations. -/ +def TraceRel (a b : Bounded M) : Prop := + Tendsto (fun n => τ.norm₂ (a.val n-b.val n)) l (𝓝 0) + +theorem traceRel_refl (a : Bounded M) : TraceRel τ l a a := by + simp only [TraceRel, sub_self, τ.norm₂_zero] + exact tendsto_const_nhds + +theorem traceRel_symm {a b : Bounded M} (h : TraceRel τ l a b) : TraceRel τ l b a := by + simpa only [TraceRel, τ.norm₂_sub, norm_sub_rev] using h + +theorem traceRel_trans {a b c : Bounded M} + (hab : TraceRel τ l a b) (hbc : TraceRel τ l b c) : TraceRel τ l a c := by + apply squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) + (by simpa using hab.add hbc) + have he : a.val n-c.val n = (a.val n-b.val n)+(b.val n-c.val n) := by abel + rw [he] + exact τ.norm₂_add_le _ _ + +theorem traceRel_add {a b c d : Bounded M} + (hab : TraceRel τ l a b) (hcd : TraceRel τ l c d) : TraceRel τ l (a+c) (b+d) := by + apply squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) + (by simpa using hab.add hcd) + change τ.norm₂ ((a.val n+c.val n)-(b.val n+d.val n)) ≤ _ + have he : (a.val n+c.val n)-(b.val n+d.val n) = + (a.val n-b.val n)+(c.val n-d.val n) := by abel + rw [he] + exact τ.norm₂_add_le _ _ + +theorem traceRel_mul {a b c d : Bounded M} + (hab : TraceRel τ l a b) (hcd : TraceRel τ l c d) : TraceRel τ l (a*c) (b*d) := by + obtain ⟨C,hC,hc⟩ := c.property + obtain ⟨B,hB,hb⟩ := b.property + apply squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) + (by simpa using (hab.mul_const C).add (hcd.const_mul B)) + change τ.norm₂ (a.val n*c.val n-b.val n*d.val n) ≤ _ + have he : a.val n*c.val n-b.val n*d.val n = + (a.val n-b.val n)*c.val n+b.val n*(c.val n-d.val n) := by noncomm_ring + rw [he] + exact (τ.norm₂_add_le _ _).trans (add_le_add + ((τ.norm₂_mul_le_right _ _).trans (mul_le_mul_of_nonneg_left (hc n) (norm_nonneg _))) + ((τ.norm₂_mul_le _ _).trans (mul_le_mul_of_nonneg_right (hb n) (norm_nonneg _)))) + +theorem traceRel_star {a b : Bounded M} (hab : TraceRel τ l a b) : + TraceRel τ l (star a) (star b) := by + change Tendsto (fun n => τ.norm₂ (star (a.val n)-star (b.val n))) l (𝓝 0) + simpa only [TraceRel, ← star_sub, τ.norm₂_star] using hab + +/-- Algebra congruence proved from actual trace-norm estimates. -/ +def traceCongruence : RingCon (Bounded M) where + r := TraceRel τ l + iseqv := ⟨traceRel_refl τ l, traceRel_symm τ l, traceRel_trans τ l⟩ + add' := traceRel_add τ l + mul' := traceRel_mul τ l + +/-- Underlying ring of the tracial ultrapower when l is a free ultrafilter. -/ +abbrev TracialQuotient := (traceCongruence τ l).Quotient + +def quotientMap : Bounded M →+* TracialQuotient τ l := (traceCongruence τ l).mk' + +end + +section +open Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (l : Filter ℕ) + +theorem quotientMap_eq_iff (a b : Bounded M) : + quotientMap τ l a = quotientMap τ l b ↔ TraceRel τ l a b := Quotient.eq + +theorem quotientMap_surjective : Function.Surjective (quotientMap τ l) := Quotient.mk_surjective + +instance : Star (TracialQuotient τ l) := + ⟨Quotient.map' star (fun _ _ h => traceRel_star τ l h)⟩ + +@[simp] theorem quotientMap_star (a : Bounded M) : + quotientMap τ l (star a) = star (quotientMap τ l a) := rfl + +instance : StarRing (TracialQuotient τ l) where + star_involutive a := Quotient.inductionOn a (fun a => by + change quotientMap τ l (star (star a)) = quotientMap τ l a + rw [star_star]) + star_mul a b := Quotient.inductionOn₂ a b (fun a b => by + change quotientMap τ l (star (a*b)) = quotientMap τ l (star b*star a) + rw [star_mul]) + star_add a b := Quotient.inductionOn₂ a b (fun a b => by + change quotientMap τ l (star (a+b)) = quotientMap τ l (star a+star b) + rw [star_add]) + +@[simp] theorem quotientMap_smul (c : ℂ) (a : Bounded M) : + quotientMap τ l (c • a) = c • quotientMap τ l a := rfl + +instance : StarModule ℂ (TracialQuotient τ l) where + star_smul c a := Quotient.inductionOn a (fun a => + congrArg (quotientMap τ l) (star_smul c a)) + +def quotientStarAlgHom : Bounded M →⋆ₐ[ℂ] TracialQuotient τ l where + __ := quotientMap τ l + commutes' _ := rfl + map_star' := quotientMap_star τ l + +end + +open Filter +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) + +@[simp] theorem TracialRepresentation.trace_sub (a b : M.toStarSubalgebra) : + τ.trace (a-b) = τ.trace a-τ.trace b := inner_sub_right _ _ _ + +@[simp] theorem TracialRepresentation.trace_add (a b : M.toStarSubalgebra) : + τ.trace (a+b) = τ.trace a+τ.trace b := inner_add_right _ _ _ + +@[simp] theorem TracialRepresentation.trace_smul (c : ℂ) (a : M.toStarSubalgebra) : + τ.trace (c • a) = c*τ.trace a := inner_smul_right _ _ _ + +def traceRep (a : Bounded M) : ℂ := limUnder (ω : Filter ℕ) (fun n => τ.trace (a.val n)) + +theorem traceRep_tendsto (a : Bounded M) : + Tendsto (fun n => τ.trace (a.val n)) (ω : Filter ℕ) (𝓝 (traceRep τ ω a)) := by + apply tendsto_nhds_limUnder + obtain ⟨C,_,ha⟩ := a.property + obtain ⟨z, _, hz⟩ := (isCompact_closedBall (0 : ℂ) C).ultrafilter_le_nhds + (ω.map (fun n => τ.trace (a.val n))) (by + apply le_principal_iff.mpr + change {n | τ.trace (a.val n) ∈ Metric.closedBall 0 C} ∈ (ω : Filter ℕ) + exact Filter.Eventually.of_forall (fun n => by + simpa using ((τ.norm_trace_le_norm₂ _).trans (τ.norm₂_le_norm _)).trans (ha n))) + exact ⟨z,hz⟩ + +theorem traceRep_eq_of_rel {a b : Bounded M} (h : TraceRel τ (ω : Filter ℕ) a b) : + traceRep τ ω a = traceRep τ ω b := by + have hz : Tendsto (fun n => ‖τ.trace (a.val n)-τ.trace (b.val n)‖) + (ω : Filter ℕ) (𝓝 0) := by + apply squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) h + rw [← τ.trace_sub] + exact τ.norm_trace_le_norm₂ _ + have hnorm := ((traceRep_tendsto τ ω a).sub (traceRep_tendsto τ ω b)).norm + exact sub_eq_zero.mp (norm_eq_zero.mp (tendsto_nhds_unique hnorm hz)) + +/-- The actual ultralimit trace on the operator-algebra quotient. -/ +def quotientTrace : TracialQuotient τ (ω : Filter ℕ) → ℂ := + Quotient.lift (traceRep τ ω) (fun _ _ h => traceRep_eq_of_rel τ ω h) + +@[simp] theorem quotientTrace_mk (a : Bounded M) : + quotientTrace τ ω (quotientMap τ (ω : Filter ℕ) a) = traceRep τ ω a := rfl + +@[simp] theorem quotientTrace_one : quotientTrace τ ω 1 = 1 := by + apply tendsto_nhds_unique (traceRep_tendsto τ ω 1) + simp + +theorem quotientTrace_mul_comm (a b : TracialQuotient τ (ω : Filter ℕ)) : + quotientTrace τ ω (a*b) = quotientTrace τ ω (b*a) := by + induction a using Quotient.inductionOn with + | h a => + induction b using Quotient.inductionOn with + | h b => + change traceRep τ ω (a*b) = traceRep τ ω (b*a) + apply tendsto_nhds_unique (traceRep_tendsto τ ω (a*b)) + have ht := traceRep_tendsto τ ω (b*a) + change Tendsto (fun n => τ.trace (b.val n*a.val n)) _ _ at ht + change Tendsto (fun n => τ.trace (a.val n*b.val n)) _ _ + simpa only [τ.trace_mul_comm] using ht + +end UltrapowerBridge + +/-! Commutation with every bounded subalgebra sequence implies uniform coordinate commutator decay. -/ +open Filter +open scoped Topology +namespace Generator.Tracial +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (l : Filter ℕ) + +/-- Unitary norm bound without requiring a separate nontriviality instance. -/ +theorem unitary_norm_le (w : M.toStarSubalgebra) (hw : star w*w = 1) : ‖w‖ ≤ 1 := by + have h : ‖star w*w‖ = ‖w‖*‖w‖ := CStarRing.norm_star_mul_self + rw [hw] at h + have hone : ‖(1 : M.toStarSubalgebra)‖ ≤ 1 := operator_norm_one_le + nlinarith [norm_nonneg w] + +/-- A quotient commutant condition controls all coordinate unitaries uniformly. +The filter need not be ultra for this diagonal-selection step. -/ +theorem uniform_commutator_decay + (P : StarSubalgebra ℂ M.toStarSubalgebra) (b : Bounded M) + (hcomm : ∀ w : Bounded M, (∀ n, w.val n ∈ P) → + quotientMap τ l w * quotientMap τ l b = quotientMap τ l b * quotientMap τ l w) + (ε : ℝ) (hε : 0 < ε) : + ∀ᶠ n in l, ∀ w : M.toStarSubalgebra, w ∈ P → star w*w = 1 → w*star w = 1 → + τ.norm₂ (w*b.val n-b.val n*w) < ε := by + classical + let bad (n : ℕ) := ∃ w : M.toStarSubalgebra, + w ∈ P ∧ star w*w = 1 ∧ w*star w = 1 ∧ ε ≤ τ.norm₂ (w*b.val n-b.val n*w) + let w (n : ℕ) : M.toStarSubalgebra := if h : bad n then h.choose else 1 + have hw (n : ℕ) : w n ∈ P ∧ star (w n)*w n = 1 ∧ w n*star (w n) = 1 := by + dsimp [w] + split_ifs with h + · exact ⟨h.choose_spec.1,h.choose_spec.2.1,h.choose_spec.2.2.1⟩ + · simp + let W : Bounded M := ⟨w, ⟨1, zero_le_one, fun n => unitary_norm_le (w n) (hw n).2.1⟩⟩ + have hc := hcomm W (fun n => (hw n).1) + rw [← map_mul, ← map_mul, quotientMap_eq_iff] at hc + have ht : ∀ᶠ n in l, τ.norm₂ (w n*b.val n-b.val n*w n) < ε := + hc (Iio_mem_nhds hε) + filter_upwards [ht] with n hn v hv hv₁ hv₂ + by_contra hnot + have hb : bad n := ⟨v,hv,hv₁,hv₂,le_of_not_gt hnot⟩ + have he : w n = hb.choose := dite_eq_left hb + rw [he] at hn + exact (not_lt_of_ge hb.choose_spec.2.2.2) hn + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/UniformPartitions.lean b/lean/OAI/Analysis/FactorGeneration/UniformPartitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..a8bca7021737eaa0c3c2c979b76f265b9d9930d6 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/UniformPartitions.lean @@ -0,0 +1,339 @@ +import Mathlib.Algebra.Order.Floor.Semiring +import OAI.Analysis.FactorGeneration.SpectralApproximation + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Finite equal-trace partitions in an actual diffuse algebra, constructed +by repeated exact trace cuts. No matrix units or comparison theorem are +assumed. These partitions do not yet approximate an arbitrary given +spectral partition. -/ +section +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +variable (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + +include hdiff in +theorem exists_uniform_trace_partition (n : ℕ) (p : AlgebraProjection M) + (r : ℝ) (hr : 0 ≤ r) (ht : τ.trace p.val=((n : ℝ)*r : ℂ)) : + ∃ Q : CornerPartition p,Q.size=n ∧ ∀ i,τ.trace (Q.piece i).val=(r : ℂ) := by + induction n generalizing p with + | zero => + have hp0 : p.val=0 := by + by_contra h + have hpos := projection_trace_pos τ p.val p.property h + simp only [Nat.cast_zero,zero_mul,Complex.ofReal_zero] at ht + rw [ht,Complex.zero_re] at hpos + exact (lt_irrefl 0 hpos) + refine ⟨⟨0,Fin.elim0,fun i => Fin.elim0 i,?_⟩,rfl,fun i => Fin.elim0 i⟩ + simpa only [Finset.univ_eq_empty,Finset.sum_empty] using hp0.symm + | succ n ih => + have hrp : r ≤ (τ.trace p.val).re := by + have htR := congrArg Complex.re ht + simp only [Complex.mul_re,Complex.ofReal_re,Complex.ofReal_im, + mul_zero,sub_zero,Nat.cast_succ] at htR + rw [htR] + nlinarith [Nat.cast_nonneg (α := ℝ) n] + obtain ⟨q,hq,hpq,hqp,hqt⟩ := + exists_exact_trace_subprojection τ hdiff p.val p.property r hr hrp + let s : AlgebraProjection M := ⟨p.val-q,hq.sub_of_mul_eq_right p.property hpq⟩ + have hst : τ.trace s.val=((n : ℝ)*r : ℂ) := by + change τ.trace (p.val-q)=_ + rw [trace_sub,ht,hqt] + push_cast + ring + obtain ⟨Q,hsize,hQ⟩ := ih s hst + have hleft (i : Fin Q.size) : q*(Q.piece i).val=0 := by + have hle : (p.val-q)*(Q.piece i).val=(Q.piece i).val := Q.piece_le i + calc q*(Q.piece i).val = q*((p.val-q)*(Q.piece i).val) := by rw [hle] + _ = 0 := by rw [← mul_assoc,mul_sub,hqp,hq.isIdempotentElem.eq,sub_self,zero_mul] + have hright (i : Fin Q.size) : (Q.piece i).val*q=0 := by + simpa only [star_mul,hq.isSelfAdjoint.star_eq, + (Q.piece i).property.isSelfAdjoint.star_eq,star_zero] using congrArg star (hleft i) + let a : Fin (Q.size+1) → AlgebraProjection M := Fin.cons ⟨q,hq⟩ Q.piece + have ha (i j : Fin (Q.size+1)) (hij : i ≠ j) : (a i).val*(a j).val=0 := by + revert hij + refine Fin.cases ?_ (fun i => ?_) i + · refine Fin.cases ?_ (fun j => ?_) j + · intro hij + exact (hij rfl).elim + · intro _ + exact hleft j + · refine Fin.cases ?_ (fun j => ?_) j + · intro _ + exact hright i + · intro hij + exact Q.orthogonal i j (fun h => hij (congrArg Fin.succ h)) + have hat : (∑ i,(a i).val)=p.val := by + rw [Fin.sum_univ_succ] + change q+(∑ i,(Q.piece i).val)=p.val + rw [Q.total] + change q+(p.val-q)=p.val + abel + let R : CornerPartition p := ⟨Q.size+1,a,ha,hat⟩ + refine ⟨R,congrArg (fun k => k+1) hsize,?_⟩ + intro i + exact Fin.cases hqt hQ i + +/-! Complete finitely many orthogonal grid-trace projections to an actual +equal-trace unit partition, retaining explicit disjoint groups of pieces. -/ + +include hdiff in +theorem exists_uniform_trace_extension {ι : Type*} [Fintype ι] + (q : ι → AlgebraProjection M) + (hq : ∀ i j,i ≠ j → (q i).val*(q j).val=0) + (n : ℕ) (hn : 0 < n) (m : ι → ℕ) (hm : ∑ i,m i ≤ n) + (ht : ∀ i,τ.trace (q i).val=(((m i : ℝ)*(n : ℝ)⁻¹ : ℝ) : ℂ)) : + ∃ R : CornerPartition (identityProjection M), R.size=n ∧ + (∀ j,τ.trace (R.piece j).val=(((n : ℝ)⁻¹ : ℝ) : ℂ)) ∧ + ∃ J : ι → Finset (Fin R.size), + (∀ i j,i ≠ j → Disjoint (J i) (J j)) ∧ + ∀ i,(∑ j ∈ J i,(R.piece j).val)=(q i).val := by + classical + have hnR : (n : ℝ) ≠ 0 := ne_of_gt (Nat.cast_pos.mpr hn) + obtain ⟨C,e,he,hrem⟩ := exists_completed_orthogonal_family q hq + let count : Option ι → ℕ := fun a => a.elim (n-∑ i,m i) m + have hsum : τ.trace (∑ i,(q i).val)= + ((((∑ i,m i : ℕ) : ℝ)*(n : ℝ)⁻¹ : ℝ) : ℂ) := by + change coordinateTraceLinear τ (∑ i,(q i).val)=_ + rw [map_sum] + change (∑ i,τ.trace (q i).val)=_ + simp only [ht] + push_cast + rw [Finset.sum_mul] + have hc (a : Option ι) : τ.trace (C.piece (e a)).val= + (((count a : ℝ)*(n : ℝ)⁻¹ : ℝ) : ℂ) := by + cases a with + | some i => simpa only [he,count,Option.elim_some] using ht i + | none => + rw [hrem,trace_sub,τ.trace_one,hsum] + dsimp [count] + rw [Nat.cast_sub hm] + push_cast + have hnC : (n : ℂ) ≠ 0 := by exact_mod_cast hnR + field_simp + have hC (j : Fin C.size) : τ.trace (C.piece j).val= + (((count (e.symm j) : ℝ)*(n : ℝ)⁻¹ : ℝ) : ℂ) := by + simpa only [Equiv.apply_symm_apply] using hc (e.symm j) + choose D hDsize hDt using fun j => exists_uniform_trace_partition τ hdiff + (count (e.symm j)) (C.piece j) (n : ℝ)⁻¹ (by positivity) (by simpa only [Complex.ofReal_mul] using hC j) + let R := C.refineBlocks D + have hRt (j : Fin R.size) : τ.trace (R.piece j).val=(((n : ℝ)⁻¹ : ℝ) : ℂ) := by + exact hDt _ _ + have hsize : R.size=n := by + have htotal := R.trace_total τ + have heq : (R.size : ℝ)*(n : ℝ)⁻¹=1 := by + simpa only [hRt,Complex.ofReal_re,Finset.sum_const,Finset.card_univ, + Fintype.card_fin,nsmul_eq_mul,identityProjection,τ.trace_one,Complex.one_re] using htotal + have hmul := mul_inv_cancel₀ hnR + have hreal : (R.size : ℝ)=(n : ℝ) := + (mul_right_cancel₀ (inv_ne_zero hnR)) (heq.trans hmul.symm) + exact_mod_cast hreal + refine ⟨R,hsize,hRt,fun i => C.blockIndices D (e (some i)),?_,?_⟩ + · intro i j hij + apply C.blockIndices_disjoint + intro h + exact hij (Option.some.inj (e.injective h)) + · intro i + exact (C.sum_blockIndices D (e (some i))).trans (congrArg Subtype.val (he i)) + +/-! Quantitative equal-trace approximation by rounding down spectral pieces. +All projections and partitions are constructed in the given diffuse algebra. -/ + +include hdiff in +theorem exists_rounded_trace_subprojection (p : AlgebraProjection M) + (n : ℕ) (hn : 0 < n) : + ∃ m : ℕ, ∃ q : AlgebraProjection M, q ≤ p ∧ + τ.trace q.val=(((m : ℝ)*(n : ℝ)⁻¹ : ℝ) : ℂ) ∧ + τ.norm₂ (p.val-q.val)^2 < (n : ℝ)⁻¹ := by + have hnR : 0 < (n : ℝ) := Nat.cast_pos.mpr hn + let t := (τ.trace p.val).re + have ht : 0 ≤ t := by + dsimp [t] + rw [projection_trace_sq τ p.val p.property] + positivity + let m := ⌊t*(n : ℝ)⌋₊ + have hlow : (m : ℝ)*(n : ℝ)⁻¹ ≤ t := by + apply (mul_le_mul_iff_left₀ hnR).mp + have h := Nat.floor_le (mul_nonneg ht hnR.le) + dsimp [m] + field_simp + nlinarith + have herror : t-(m : ℝ)*(n : ℝ)⁻¹ < (n : ℝ)⁻¹ := by + have h := Nat.lt_floor_add_one (t*(n : ℝ)) + apply (mul_lt_mul_iff_left₀ hnR).mp + dsimp [m] + field_simp + nlinarith + obtain ⟨q,hq,hpq,_,hqt⟩ := exists_exact_trace_subprojection τ hdiff p.val p.property + ((m : ℝ)*(n : ℝ)⁻¹) (by positivity) hlow + refine ⟨m,⟨q,hq⟩,hpq,hqt,?_⟩ + rw [← projection_trace_sq τ _ (hq.sub_of_mul_eq_right p.property hpq), + trace_sub,hqt,Complex.sub_re,Complex.ofReal_re] + exact herror + +include hdiff in +theorem exists_uniform_trace_approximation + (Q : CornerPartition (identityProjection M)) (n : ℕ) (hn : 0 < n) : + ∃ R : CornerPartition (identityProjection M), R.size=n ∧ + (∀ j,τ.trace (R.piece j).val=(((n : ℝ)⁻¹ : ℝ) : ℂ)) ∧ + ∃ J : Fin Q.size → Finset (Fin R.size), + (∀ i j,i ≠ j → Disjoint (J i) (J j)) ∧ + (∀ i,(Q.piece i).val*(∑ j ∈ J i,(R.piece j).val)= + ∑ j ∈ J i,(R.piece j).val) ∧ + ∀ i,τ.norm₂ ((Q.piece i).val-∑ j ∈ J i,(R.piece j).val)^2 < (n : ℝ)⁻¹ := by + classical + choose m q hle ht herr using fun i => exists_rounded_trace_subprojection τ hdiff (Q.piece i) n hn + have horth (i j : Fin Q.size) (hij : i ≠ j) : (q i).val*(q j).val=0 := + orthogonal_subprojections (Q.orthogonal i j hij) (hle i) (hle j) + have htracele (i : Fin Q.size) : (m i : ℝ)*(n : ℝ)⁻¹ ≤ (τ.trace (Q.piece i).val).re := by + have hpos : 0 ≤ (τ.trace ((Q.piece i).val-(q i).val)).re := by + rw [projection_trace_sq τ _ ((q i).property.sub_of_mul_eq_right (Q.piece i).property (hle i))] + positivity + rw [trace_sub,ht,Complex.sub_re,Complex.ofReal_re] at hpos + linarith + have hsum : (∑ i,m i : ℕ) ≤ n := by + have h := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => htracele i) + rw [Q.trace_total τ] at h + have hreal : ((∑ i,m i : ℕ) : ℝ)*(n : ℝ)⁻¹ ≤ 1 := by + simpa only [Nat.cast_sum,Finset.sum_mul,identityProjection,τ.trace_one,Complex.one_re] using h + have hnR : 0 < (n : ℝ) := Nat.cast_pos.mpr hn + have hmul := mul_inv_cancel₀ (ne_of_gt hnR) + have hbound : ((∑ i,m i : ℕ) : ℝ) ≤ (n : ℝ) := + (mul_le_mul_iff_left₀ (inv_pos.mpr hnR)).mp (hreal.trans_eq hmul.symm) + exact_mod_cast hbound + obtain ⟨R,hsize,hRt,J,hJdis,hJsum⟩ := exists_uniform_trace_extension τ hdiff q horth n hn m hsum ht + refine ⟨R,hsize,hRt,J,hJdis,?_,?_⟩ + · intro i + rw [hJsum] + exact hle i + · intro i + rw [hJsum] + exact herr i + +include hdiff in +theorem exists_dyadic_trace_approximation + (Q : CornerPartition (identityProjection M)) (ε : ℝ) (hε : 0 < ε) : + ∃ k : ℕ, ∃ R : CornerPartition (identityProjection M), R.size=2^k ∧ + (∀ j,τ.trace (R.piece j).val=((((2^k : ℕ) : ℝ)⁻¹ : ℝ) : ℂ)) ∧ + ∃ J : Fin Q.size → Finset (Fin R.size), + (∀ i j,i ≠ j → Disjoint (J i) (J j)) ∧ + (∀ i,(Q.piece i).val*(∑ j ∈ J i,(R.piece j).val)= + ∑ j ∈ J i,(R.piece j).val) ∧ + ∀ i,τ.norm₂ ((Q.piece i).val-∑ j ∈ J i,(R.piece j).val)^2 < ε := by + obtain ⟨k,hk⟩ := exists_pow_lt_of_lt_one hε (by norm_num : (2 : ℝ)⁻¹ < 1) + have hk' : (((2^k : ℕ) : ℝ)⁻¹ : ℝ) < ε := by + simpa only [Nat.cast_pow,Nat.cast_ofNat,inv_pow] using hk + obtain ⟨R,hsize,ht,J,hd,hle,herr⟩ := exists_uniform_trace_approximation τ hdiff Q (2^k) (by positivity) + exact ⟨k,R,hsize,ht,J,hd,hle,fun i => (herr i).trans hk'⟩ + +end + +/-! A finite commuting self-adjoint family admits simultaneous L2 spectral +approximation on one constructed dyadic equal-trace partition. -/ +open scoped BigOperators +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem norm₂_finset_sum_le {ι : Type*} (F : Finset ι) (x : ι → M.toStarSubalgebra) : + τ.norm₂ (∑ i ∈ F,x i) ≤ ∑ i ∈ F,τ.norm₂ (x i) := by + classical + induction F using Finset.induction_on with + | empty => simp + | @insert i F hi ih => + rw [Finset.sum_insert hi,Finset.sum_insert hi] + exact (τ.norm₂_add_le _ _).trans (add_le_add le_rfl ih) + +variable (hdiff : ∀ p : M.toStarSubalgebra,IsStarProjection p → p ≠ 0 → + ∃ q : M.toStarSubalgebra,IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ p*q=q ∧ q*p=q) + +include hdiff in +theorem exists_dyadic_spectral_sum_approximation {ι : Type*} [Fintype ι] + (Q : CornerPartition (identityProjection M)) (c : ι → Fin Q.size → ℂ) + (ε : ℝ) (hε : 0 < ε) : + ∃ k : ℕ, ∃ R : CornerPartition (identityProjection M), R.size=2^k ∧ + (∀ j,τ.trace (R.piece j).val=((((2^k : ℕ) : ℝ)⁻¹ : ℝ) : ℂ)) ∧ + ∃ d : ι → Fin R.size → ℂ, ∀ i, + τ.norm₂ ((∑ l,c i l • (Q.piece l).val)-∑ j,d i j • (R.piece j).val) < ε := by + classical + let A : ℝ := ∑ i,∑ l,‖c i l‖ + have hA : 0 ≤ A := by dsimp [A]; positivity + let δ := ε/(A+1) + have hδ : 0 < δ := div_pos hε (by positivity) + have hsmall : A*δ < ε := by + dsimp [δ] + rw [← mul_div_assoc] + apply (div_lt_iff₀ (by positivity : 0 < A+1)).mpr + nlinarith + obtain ⟨k,R,hsize,ht,J,_,_,herr⟩ := exists_dyadic_trace_approximation τ hdiff Q (δ^2) (sq_pos_of_pos hδ) + let d : ι → Fin R.size → ℂ := fun i j => ∑ l,if j ∈ J l then c i l else 0 + have hd (i : ι) : (∑ j,d i j • (R.piece j).val)= + ∑ l,c i l • (∑ j ∈ J l,(R.piece j).val) := by + simp only [d,Finset.sum_smul] + rw [Finset.sum_comm] + apply Finset.sum_congr rfl + intro l _ + rw [Finset.smul_sum] + simp only [ite_smul,zero_smul] + simp + have herr' (l : Fin Q.size) : + τ.norm₂ ((Q.piece l).val-∑ j ∈ J l,(R.piece j).val) ≤ δ := by + have h := herr l + have hnonneg : 0 ≤ τ.norm₂ ((Q.piece l).val-∑ j ∈ J l,(R.piece j).val) := norm_nonneg _ + nlinarith + refine ⟨k,R,hsize,ht,d,?_⟩ + intro i + rw [hd,← Finset.sum_sub_distrib] + simp only [← smul_sub] + calc + τ.norm₂ (∑ l,c i l • ((Q.piece l).val-∑ j ∈ J l,(R.piece j).val)) ≤ + ∑ l,τ.norm₂ (c i l • ((Q.piece l).val-∑ j ∈ J l,(R.piece j).val)) := + norm₂_finset_sum_le τ Finset.univ _ + _ ≤ ∑ l,‖c i l‖*δ := by + apply Finset.sum_le_sum + intro l _ + rw [τ.norm₂_smul] + exact mul_le_mul_of_nonneg_left (herr' l) (norm_nonneg _) + _ = (∑ l,‖c i l‖)*δ := (Finset.sum_mul _ _ _).symm + _ ≤ A*δ := by + apply mul_le_mul_of_nonneg_right _ hδ.le + exact Finset.single_le_sum (fun j _ => Finset.sum_nonneg (fun l _ => norm_nonneg _)) (Finset.mem_univ i) + _ < ε := hsmall + +include hdiff in +theorem exists_finite_uniform_spectral_approximation {ι : Type*} [Fintype ι] + (x : ι → M.toStarSubalgebra) (hx : ∀ i,IsSelfAdjoint (x i)) + (hcomm : ∀ i j,Commute (x i) (x j)) (ε : ℝ) (hε : 0 < ε) : + ∃ k : ℕ, ∃ R : CornerPartition (identityProjection M), R.size=2^k ∧ + (∀ j,τ.trace (R.piece j).val=((((2^k : ℕ) : ℝ)⁻¹ : ℝ) : ℂ)) ∧ + ∃ d : ι → Fin R.size → ℂ, ∀ i, + τ.norm₂ (x i-∑ j,d i j • (R.piece j).val) < ε := by + classical + obtain ⟨Q,_,_,hQ⟩ := exists_finite_abelian_spectral_refinement x hx hcomm + (CornerPartition.single (identityProjection M)) + (by intro y _ j; exact Commute.one_left y) Finset.univ (ε/2) (by positivity) + choose c hc using fun i => hQ i (Finset.mem_univ i) + obtain ⟨k,R,hsize,ht,d,hd⟩ := exists_dyadic_spectral_sum_approximation τ hdiff Q c (ε/2) (by positivity) + refine ⟨k,R,hsize,ht,d,?_⟩ + intro i + have hsum : x i-∑ j,d i j • (R.piece j).val = + (x i-∑ l,c i l • (Q.piece l).val)+ + ((∑ l,c i l • (Q.piece l).val)-∑ j,d i j • (R.piece j).val) := by abel + rw [hsum] + exact (τ.norm₂_add_le _ _).trans_lt (by + have h₁ := (τ.norm₂_le_norm _).trans_lt (hc i) + have h₂ := hd i + linarith) + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/UnitaryMetric.lean b/lean/OAI/Analysis/FactorGeneration/UnitaryMetric.lean new file mode 100644 index 0000000000000000000000000000000000000000..3abf59c8d939aee59bb79cd1cfb815b99b403bfa --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/UnitaryMetric.lean @@ -0,0 +1,248 @@ +import Mathlib.Topology.MetricSpace.Isometry +import Mathlib.Topology.Metrizable.Basic +import OAI.Analysis.FactorGeneration.HilbertLimits + +namespace OAI + +noncomputable section + +namespace Generator.Tracial + +/-! Bounded self-adjoint least-distance elements in a von Neumann subalgebra. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} + +def selfAdjointTraceBall (τ : TracialRepresentation N) (R : ℝ) : Set H := + {ξ | ∃ a : N.toStarSubalgebra, IsSelfAdjoint a ∧ ‖a‖ ≤ R ∧ baseVector τ a=ξ} + +theorem selfAdjointTraceBall_closed (τ : TracialRepresentation N) (R : ℝ) : + IsClosed (selfAdjointTraceBall τ R) := by + apply IsSeqClosed.isClosed + intro ξ z hz hlim + choose a ha hR he using hz + have hlimA : Tendsto (fun n => baseVector τ (a n)) atTop (𝓝 z) := by + convert hlim using 1 + exact funext he + obtain ⟨b,hb,hbz⟩ := bounded_trace_limit τ a R ((norm_nonneg _).trans (hR 0)) hR z + hlimA + have hvec : Tendsto (fun n => (a n : H →L[ℂ] H) τ.vector) atTop + (𝓝 ((b : H →L[ℂ] H) τ.vector)) := by rw [hbz]; exact hlimA + have h := (tendsto_vector_iff_norm₂ τ atTop a b).mp hvec + have hs := norm₂_limit_star τ a b h + simp only [(ha _).star_eq] at hs + have hsb : star b=b := norm₂_limit_unique τ a hs h + exact ⟨b,hsb,hb,hbz⟩ + +theorem selfAdjointTraceBall_convex (τ : TracialRepresentation N) (R : ℝ) : + Convex ℝ (selfAdjointTraceBall τ R) := by + intro x hx y hy s t hs ht hst + obtain ⟨a,ha,hRa,rfl⟩ := hx + obtain ⟨b,hb,hRb,rfl⟩ := hy + refine ⟨s • a+t • b,((IsSelfAdjoint.all s).smul ha).add + ((IsSelfAdjoint.all t).smul hb),?_,rfl⟩ + calc ‖s • a+t • b‖ ≤ ‖s • a‖+‖t • b‖ := norm_add_le _ _ + _ = s*‖a‖+t*‖b‖ := by rw [norm_smul,norm_smul,Real.norm_of_nonneg hs,Real.norm_of_nonneg ht] + _ ≤ s*R+t*R := add_le_add (mul_le_mul_of_nonneg_left hRa hs) + (mul_le_mul_of_nonneg_left hRb ht) + _ = R := by rw [← add_mul,hst,one_mul] + +theorem exists_selfAdjoint_ball_minimum (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) (R : ℝ) (hR : 0 ≤ R) : + ∃ c : N.toStarSubalgebra, IsSelfAdjoint c ∧ ‖c‖ ≤ R ∧ + ∀ a : N.toStarSubalgebra, IsSelfAdjoint a → ‖a‖ ≤ R → + τ.norm₂ (x-coordinateInclusion hNM c) ≤ τ.norm₂ (x-coordinateInclusion hNM a) := by + let τN := restrictedTrace τ hNM + let K := selfAdjointTraceBall τN R + let : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H + obtain ⟨ξ,hξ,hmin⟩ := exists_norm_eq_iInf_of_complete_convex + (show K.Nonempty from ⟨0,0,IsSelfAdjoint.zero _,by simpa using hR,rfl⟩) + (selfAdjointTraceBall_closed τN R).isComplete (selfAdjointTraceBall_convex τN R) + (baseVector τ x) + obtain ⟨c,hc,hRc,rfl⟩ := hξ + refine ⟨c,hc,hRc,?_⟩ + intro a ha hRa + have h := ciInf_le (show BddBelow (Set.range (fun w : K => ‖baseVector τ x-w.val‖)) from + ⟨0,by rintro _ ⟨w,rfl⟩; exact norm_nonneg _⟩) + (⟨baseVector τN a,a,ha,hRa,rfl⟩ : K) + rw [← hmin] at h + exact h + +theorem exists_selfAdjoint_ball_variational (τ : TracialRepresentation M) (hNM : N ≤ M) + (x : M.toStarSubalgebra) (R : ℝ) (hR : 0 ≤ R) : + ∃ c : N.toStarSubalgebra, IsSelfAdjoint c ∧ ‖c‖ ≤ R ∧ + (∀ a : N.toStarSubalgebra, IsSelfAdjoint a → ‖a‖ ≤ R → + τ.norm₂ (x-coordinateInclusion hNM c) ≤ τ.norm₂ (x-coordinateInclusion hNM a)) ∧ + ∀ a : N.toStarSubalgebra, IsSelfAdjoint a → ‖a‖ ≤ R → + (inner ℂ (baseVector τ (x-coordinateInclusion hNM c)) + (baseVector τ (coordinateInclusion hNM (a-c)))).re ≤ 0 := by + let τN := restrictedTrace τ hNM + let K := selfAdjointTraceBall τN R + let : InnerProductSpace ℝ H := InnerProductSpace.rclikeToReal ℂ H + obtain ⟨ξ,hξ,hmin⟩ := exists_norm_eq_iInf_of_complete_convex + (show K.Nonempty from ⟨0,0,IsSelfAdjoint.zero _,by simpa using hR,rfl⟩) + (selfAdjointTraceBall_closed τN R).isComplete (selfAdjointTraceBall_convex τN R) + (baseVector τ x) + obtain ⟨c,hc,hRc,rfl⟩ := hξ + refine ⟨c,hc,hRc,?_,?_⟩ + · intro a ha hRa + have h := ciInf_le (show BddBelow (Set.range (fun w : K => ‖baseVector τ x-w.val‖)) from + ⟨0,by rintro _ ⟨w,rfl⟩; exact norm_nonneg _⟩) + (⟨baseVector τN a,a,ha,hRa,rfl⟩ : K) + rw [← hmin] at h + exact h + · intro a ha hRa + have h := (norm_eq_iInf_iff_real_inner_le_zero (selfAdjointTraceBall_convex τN R) + (show baseVector τN c ∈ K from ⟨c,hc,hRc,rfl⟩)).mp hmin + (baseVector τN a) ⟨a,ha,hRa,rfl⟩ + exact h + +end + +/-! Countable determination of a relative commutant from actual L2 +separability. Operator norm separability is not required. -/ +section +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +theorem commute_of_norm₂_limit (a : ℕ → M.toStarSubalgebra) + (b c : M.toStarSubalgebra) + (ha : Tendsto (fun n => τ.norm₂ (a n-b)) atTop (𝓝 0)) + (hc : ∀ n,Commute (a n) c) : Commute b c := by + have hr : Tendsto (fun n => τ.norm₂ (a n*c-b*c)) atTop (𝓝 0) := by + apply squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) + (by simpa using ha.mul_const ‖c‖) + rw [← sub_mul] + exact τ.norm₂_mul_le_right _ _ + have hl : Tendsto (fun n => τ.norm₂ (a n*c-c*b)) atTop (𝓝 0) := by + apply squeeze_zero (fun n => norm_nonneg _) (fun n => ?_) + (by simpa using ha.const_mul ‖c‖) + rw [(hc n).eq,← mul_sub] + exact τ.norm₂_mul_le _ _ + exact norm₂_limit_unique τ (fun n => a n*c) hr hl + +theorem exists_countable_commutant_family (S : Set M.toStarSubalgebra) + (hne : S.Nonempty) (hsep : TopologicalSpace.IsSeparable (baseVector τ '' S)) : + ∃ a : ℕ → M.toStarSubalgebra,(∀ n,a n ∈ S) ∧ + ∀ c : M.toStarSubalgebra,(∀ n,Commute (a n) c) ↔ ∀ b ∈ S,Commute b c := by + let T := baseVector τ '' S + let : TopologicalSpace.SeparableSpace T := hsep.separableSpace + let : Nonempty T := ⟨⟨baseVector τ hne.choose,Set.mem_image_of_mem _ hne.choose_spec⟩⟩ + obtain ⟨v,hv⟩ := TopologicalSpace.exists_dense_seq (α := T) + have hex (n : ℕ) : ∃ a ∈ S,baseVector τ a=(v n).val := (v n).property + choose a ha he using hex + refine ⟨a,ha,fun c => ⟨?_,fun h n => h (a n) (ha n)⟩⟩ + intro hc b hb + let z : T := ⟨baseVector τ b,Set.mem_image_of_mem _ hb⟩ + obtain ⟨w,hw,hlim⟩ := mem_closure_iff_seq_limit.mp (hv z) + choose k hk using hw + have ht : Tendsto (fun n => baseVector τ (a (k n))) atTop (𝓝 (baseVector τ b)) := by + have h := continuous_subtype_val.continuousAt.tendsto.comp hlim + convert h using 1 + funext n + exact (he (k n)).trans (congrArg Subtype.val (hk n)) + exact commute_of_norm₂_limit τ (fun n => a (k n)) b c + ((tendsto_vector_iff_norm₂ τ atTop _ b).mp ht) (fun n => hc (k n)) + +end + +/-! The unitary metric induced by a faithful trace vector, distinguishing the trace two-norm topology from the operator norm topology. -/ +open Filter +open scoped Topology +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) + +structure TraceUnitary (τ : TracialRepresentation M) where + toUnitary : unitary M.toStarSubalgebra + +namespace TraceUnitary + +def algebra (u : TraceUnitary τ) : M.toStarSubalgebra := u.toUnitary + +def vector (u : TraceUnitary τ) : H := (u.algebra τ).val τ.vector + +theorem vector_injective : Function.Injective (vector τ) := by + intro u v h + have he : u.algebra τ = v.algebra τ := by + apply sub_eq_zero.mp + apply τ.separating + exact sub_eq_zero.mpr h + cases u + cases v + congr 1 + exact Subtype.ext he + +instance : MetricSpace (TraceUnitary τ) := + MetricSpace.induced (vector τ) (vector_injective τ) inferInstance + +theorem vector_isometry : Isometry (vector τ) := fun _ _ => rfl + +@[simp] theorem dist_eq (u v : TraceUnitary τ) : + dist u v = τ.norm₂ (u.algebra τ-v.algebra τ) := by + change dist (vector τ u) (vector τ v) = _ + rw [dist_eq_norm] + rfl + +theorem algebra_norm_le (u : TraceUnitary τ) : ‖u.algebra τ‖ ≤ 1 := + unitary_norm_le _ u.toUnitary.property.1 + +theorem unitary_of_limit (u : ℕ → TraceUnitary τ) (a : M.toStarSubalgebra) + (ha : Tendsto (fun n => τ.norm₂ ((u n).algebra τ-a)) atTop (𝓝 0)) : + a ∈ unitary M.toStarSubalgebra := by + have hs := norm₂_limit_star τ (fun n => (u n).algebra τ) a ha + have hleft := norm₂_limit_mul τ (fun n => star ((u n).algebra τ)) + (fun n => (u n).algebra τ) (star a) a 1 + (fun n => by + change ‖star ((u n).algebra τ).val‖ ≤ 1 + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint.norm_map] + exact algebra_norm_le τ (u n)) hs ha + have hright := norm₂_limit_mul τ (fun n => (u n).algebra τ) + (fun n => star ((u n).algebra τ)) a (star a) 1 + (fun n => algebra_norm_le τ (u n)) ha hs + have hconst : Tendsto (fun _ : ℕ => τ.norm₂ ((1 : M.toStarSubalgebra)-1)) + atTop (𝓝 0) := by simpa only [sub_self,τ.norm₂_zero] using + (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (𝓝 0)) + have hl (n : ℕ) : star ((u n).algebra τ)*(u n).algebra τ=1 := + (u n).toUnitary.property.1 + have hr (n : ℕ) : (u n).algebra τ*star ((u n).algebra τ)=1 := + (u n).toUnitary.property.2 + simp only [hl] at hleft + simp only [hr] at hright + exact ⟨norm₂_limit_unique τ _ hleft hconst, norm₂_limit_unique τ _ hright hconst⟩ + +theorem vector_range_closed : IsClosed (Set.range (vector τ)) := by + apply IsSeqClosed.isClosed + intro x y hx hxy + choose u hu using hx + obtain ⟨a,_,hay⟩ := bounded_trace_limit τ (fun n => (u n).algebra τ) 1 zero_le_one + (fun n => algebra_norm_le τ (u n)) y (by change Tendsto (fun n => vector τ (u n)) atTop (𝓝 y); simpa only [hu] using hxy) + have ht : Tendsto (fun n => τ.norm₂ ((u n).algebra τ-a)) atTop (𝓝 0) := by + apply (tendsto_vector_iff_norm₂ τ atTop _ a).mp + change Tendsto (fun n => vector τ (u n)) atTop (𝓝 (a.val τ.vector)) + simpa only [hu,hay] using hxy + exact ⟨⟨⟨a,unitary_of_limit τ u a ht⟩⟩,hay⟩ + +instance : CompleteSpace (TraceUnitary τ) := + (completeSpace_iff_isComplete_range (vector_isometry τ).isUniformInducing).mpr + (vector_range_closed τ).isComplete + +/-- Convergence in the constructed metric is exactly trace two-norm convergence. -/ +theorem tendsto_iff {I : Type*} (l : Filter I) (u : I → TraceUnitary τ) + (v : TraceUnitary τ) : + Tendsto u l (𝓝 v) ↔ Tendsto (fun i => τ.norm₂ ((u i).algebra τ-v.algebra τ)) l (𝓝 0) := by + simpa only [dist_eq] using (tendsto_iff_dist_tendsto_zero (f := u) (a := v) (x := l)) + +end TraceUnitary + +end Generator.Tracial + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/WordCorrelation.lean b/lean/OAI/Analysis/FactorGeneration/WordCorrelation.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7962bec5307cd8140e8715aaae00e1f9a9491f3 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/WordCorrelation.lean @@ -0,0 +1,337 @@ +import OAI.Analysis.FactorGeneration.CoordinatePerturbation + +namespace OAI + +noncomputable section + +namespace Generator + +/-! Ordered prefix cancellation for the actual common perturbed unitary. +All identities are identities of bounded coordinate sequences. -/ +section +variable {G : Type*} [Group G] + +theorem prefixes_append_single (xs : List G) (x : G) : + prefixes (xs++[x])=prefixes xs++[xs.prod*x] := by + induction xs with + | nil => simp [prefixes] + | cons a xs ih => simp [prefixes,ih,List.map_append,mul_assoc] + +theorem evaluated_prefixes (s : ℕ → G) (n : ℕ) : + prefixes ((List.range n).map s)= + (List.range n).map (fun k => FreeGroup.lift s (freePrefix (k+1))) := by + induction n with + | zero => rfl + | succ n ih => + rw [List.range_succ,List.map_append,List.map_singleton,prefixes_append_single,ih, + List.map_append,List.map_singleton] + congr 2 + rw [freePrefix,map_mul,FreeGroup.lift_apply_of,freePrefix_eq_prod,map_list_prod] + simp only [List.map_map,Function.comp_def,FreeGroup.lift_apply_of] + +/-- The terminal letter is unperturbed; the same h occurs before every u. -/ +theorem interleaved_terminal (t : ℕ → G) (u h : G) (n : ℕ) : + let s : ℕ → G := fun k => if k=0 then t 0 else u*t k + ((List.range n).map (fun k => s k*h)).prod*s n= + t 0*((List.range n).map (fun k => h*u*t (k+1))).prod := by + dsimp only + induction n with + | zero => simp + | succ n ih => + rw [List.prod_range_succ,List.prod_range_succ] + simp only [Nat.add_one_ne_zero,ite_false] + calc + _ = (((List.range n).map (fun k => (if k=0 then t 0 else u*t k)*h)).prod* + (if n=0 then t 0 else u*t n))*(h*u*t (n+1)) := by simp only [mul_assoc] + _ = _ := by rw [ih]; simp only [mul_assoc] + +end +namespace Tracial + +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +def SuccessiveCoordinateHaar.perturbedWord (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : unitary (Sequences M) := + F.haarSequence τ ω 0*((List.range ell).map + (fun k => F.perturbedUnitary τ ω u z ell α*F.haarSequence τ ω (k+1))).prod + +theorem SuccessiveCoordinateHaar.coordinatePrefix_terminal + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u : unitary M.toStarSubalgebra) (ell : ℕ) : + F.coordinatePrefix τ ω u (ell+1)= + ((List.range ell).map (F.coordinateVariables τ ω u)).prod* + F.coordinateVariables τ ω u ell := by + rw [coordinatePrefix,freePrefix,(FreeGroup.lift (F.coordinateVariables τ ω u)).map_mul, + FreeGroup.lift_apply_of, + freePrefix_eq_prod,map_list_prod] + simp only [List.map_map,Function.comp_def,FreeGroup.lift_apply_of] + +theorem SuccessiveCoordinateHaar.perturbedWord_prefixes + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : + ((List.range ell).map (fun k => F.coordinatePrefix τ ω u (k+1)* + F.perturbingUnitary τ ω u z ell α*(F.coordinatePrefix τ ω u (k+1))⁻¹)).prod* + F.coordinatePrefix τ ω u (ell+1)=F.perturbedWord τ ω u z ell α := by + rw [F.coordinatePrefix_terminal] + have hp := prefix_perturbation_terminal ((List.range ell).map (F.coordinateVariables τ ω u)) + (F.perturbingUnitary τ ω u z ell α) (F.coordinateVariables τ ω u ell) + rw [evaluated_prefixes,List.map_map] at hp + rw [show ((List.range ell).map (fun k => F.coordinatePrefix τ ω u (k+1)* + F.perturbingUnitary τ ω u z ell α*(F.coordinatePrefix τ ω u (k+1))⁻¹)).prod* + (((List.range ell).map (F.coordinateVariables τ ω u)).prod*F.coordinateVariables τ ω u ell)= + (((List.range ell).map (F.coordinateVariables τ ω u)).map + (fun s => s*F.perturbingUnitary τ ω u z ell α)).prod*F.coordinateVariables τ ω u ell from hp] + have hs : F.coordinateVariables τ ω u = fun k => + if k=0 then F.haarSequence τ ω 0 else constantSequenceUnitary u*F.haarSequence τ ω k := by + funext k + cases k <;> simp [coordinateVariables] + rw [List.map_map,hs] + exact interleaved_terminal _ _ _ ell + +theorem SuccessiveCoordinateHaar.exponential_product_eq_word + (F : SuccessiveCoordinateHaar τ ω hNM seed) + (u z : unitary M.toStarSubalgebra) (ell : ℕ) (α : ℝ) : + ((finitePerturbationRows ell α).map + (fun r => NormedSpace.exp (F.perturbationMap τ ω u z ell r))).prod* + (F.coordinatePrefix τ ω u (ell+1) : Sequences M)= + (F.perturbedWord τ ω u z ell α : Sequences M) := by + have hr := congrArg (fun a : unitary (Sequences M) => (a : Sequences M)) + (F.perturbedWord_prefixes τ ω u z ell α) + rw [finitePerturbationRows,List.map_ofFn] + simp only [Function.comp_def,F.exponential_row] + rw [List.ofFn_eq_map] + change ((List.finRange ell).map ((fun k : ℕ => (↑(F.coordinatePrefix τ ω u (k+1)* + F.perturbingUnitary τ ω u z ell α*(F.coordinatePrefix τ ω u (k+1))⁻¹) : Sequences M)) ∘ Fin.val)).prod * _ = _ + rw [← List.map_map,show (List.finRange ell).map Fin.val=List.range ell from by ext i; simp] + simpa only [Submonoid.coe_mul,Submonoid.coe_list_prod,List.map_map,Function.comp_def] using hr + +end + +/-! The exact first-order trace calculation for the manuscript's prefix labels. -/ +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge Filter +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem SuccessiveCoordinateHaar.label_star_trace + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u : unitary (Q τ ω)) + (hu : (u : Q τ ω) ∈ seed) (ell : ℕ) (p : PrefixLabel ell) (hp : p.val ≠ 1) : + quotientTrace τ ω (star (F.labelUnitary τ ω u ell p : Q τ ω))=0 := by + let f := unitaryRepresentation τ ω (prefixVariable τ ω u (fun k => (F.step k).t)) + have he : (f p.val⁻¹ : Q τ ω)=star (f p.val : Q τ ω) := + congrArg Subtype.val (f.map_inv p.val) + change quotientTrace τ ω (star (f p.val : Q τ ω))=0 + rw [← he] + exact F.freeGroup_trace τ ω u hu _ (fun h => hp (inv_eq_one.mp h)) + +theorem SuccessiveCoordinateHaar.conjugate_positive_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary (Q τ ω)) (xi : Q τ ω) + (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (p : PrefixLabel ell) : + quotientTrace τ ω (star xi*(F.conjugateUnitary τ ω u z ell p : Q τ ω)* + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) : Q τ ω))= + if p.val=1 then quotientTrace τ ω (star xi*(z : Q τ ω)) else 0 := by + by_cases hp : p.val=1 + · apply Eq.trans ?_ (ite_eq_left hp).symm + have he : F.labelUnitary τ ω u ell p=1 := + (congrArg (unitaryRepresentation τ ω + (prefixVariable τ ω u (fun k => (F.step k).t))) hp).trans (map_one _) + let W := prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) + change quotientTrace τ ω (star xi*(↑(F.labelUnitary τ ω u ell p*(z*star W)* + star (F.labelUnitary τ ω u ell p)) : Q τ ω)*(W : Q τ ω))=_ + rw [he] + simp only [star_one,one_mul,mul_one,Submonoid.coe_mul,Unitary.coe_star,mul_assoc, + Unitary.coe_star_mul_self] + · apply Eq.trans ?_ (ite_eq_right hp).symm + exact (F.prefix_endpoints τ ω u hu ell).positive_conjugate_correlation τ ω xi + (F.seed_mem τ ω ell hxi) (F.labelUnitary τ ω u ell p) z (F.label_mem τ ω u hu ell p) + (F.seed_mem τ ω ell hz) (F.label_star_trace τ ω u hu ell p hp) + +theorem SuccessiveCoordinateHaar.conjugate_negative_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary (Q τ ω)) (xi : Q τ ω) + (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (p : PrefixLabel ell) : + quotientTrace τ ω (star xi*star (F.conjugateUnitary τ ω u z ell p : Q τ ω)* + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) : Q τ ω))=0 := + (F.prefix_endpoints τ ω u hu ell).negative_conjugate_correlation τ ω xi + (F.seed_mem τ ω ell hxi) (F.labelUnitary τ ω u ell p) z (F.label_mem τ ω u hu ell p) + (F.seed_mem τ ω ell hz) + +def SuccessiveCoordinateHaar.firstOrderTerm + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary (Q τ ω)) (ell : ℕ) (c : ℂ) : Q τ ω := + c • ∑ k : Fin ell,∑ j : Fin ell, + ((F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω)- + star (F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω)) + +theorem SuccessiveCoordinateHaar.firstOrder_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary (Q τ ω)) (xi : Q τ ω) + (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (c : ℂ) : + quotientTrace τ ω (star xi*F.firstOrderTerm τ ω u z ell c* + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) : Q τ ω))= + c*(ell : ℂ)*quotientTrace τ ω (star xi*(z : Q τ ω)) := by + let W := prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) + let L := (traceLinear τ ω).comp + ((LinearMap.mulRight ℂ (W : Q τ ω)).comp (LinearMap.mulLeft ℂ (star xi))) + have hpos (k j : Fin ell) : L (F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω)= + if k=j then quotientTrace τ ω (star xi*(z : Q τ ω)) else 0 := by + have h := F.conjugate_positive_correlation τ ω u z xi hu hz hxi ell (pairLabel k j) + change quotientTrace τ ω (star xi*(F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω)* + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) : Q τ ω))=_ + simpa only [pairLabel,pairRatio_eq_one_iff] using h + have hneg (k j : Fin ell) : L (star (F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω))=0 := + F.conjugate_negative_correlation τ ω u z xi hu hz hxi ell (pairLabel k j) + change L (c • ∑ k : Fin ell,∑ j : Fin ell, + ((F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω)- + star (F.conjugateUnitary τ ω u z ell (pairLabel k j) : Q τ ω)))=_ + simp only [map_smul,map_sum,map_sub,hpos,hneg,sub_zero] + simp [smul_eq_mul,nsmul_eq_mul,mul_assoc] + +theorem SuccessiveCoordinateHaar.linearized_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary (Q τ ω)) (xi : Q τ ω) + (hu : (u : Q τ ω) ∈ seed) (hz : (z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (c : ℂ) : + quotientTrace τ ω (star xi*(1+F.firstOrderTerm τ ω u z ell c)* + (prefixProduct τ ω u (fun k => (F.step k).t) (ell+1) : Q τ ω))= + c*(ell : ℂ)*quotientTrace τ ω (star xi*(z : Q τ ω)) := by + rw [mul_add,add_mul,trace_add,mul_one, + (F.prefix_endpoints τ ω u hu ell).base_correlation τ ω xi (F.seed_mem τ ω ell hxi),zero_add] + exact F.firstOrder_correlation τ ω u z xi hu hz hxi ell c + +end + +/-! The first-order term is exactly the sum of the mapped formal rows, and +its correlation is the manuscript's alpha/2 coefficient. -/ +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge Filter +open scoped BigOperators +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem SuccessiveCoordinateHaar.perturbationMap_firstOrder + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (ell : ℕ) (α : ℝ) : + sequenceQuotient τ ω (((finitePerturbationRows ell α).map (F.perturbationMap τ ω u z ell)).sum)= + F.firstOrderTerm τ ω (constantQuotientUnitary τ ω u) (constantQuotientUnitary τ ω z) + ell ((α/(2*ell) : ℝ) : ℂ) := by + let Ψ := (sequenceQuotient τ ω).toAlgHom.comp (F.perturbationMap τ ω u z ell) + let Y := F.conjugateUnitary τ ω (constantQuotientUnitary τ ω u) (constantQuotientUnitary τ ω z) ell + have hword (g : FreeGroup (PrefixLabel ell)) : Ψ (MonoidAlgebra.single g 1)= + (unitaryRepresentation τ ω Y g : Q τ ω) := + coordinateGroupRing_quotient_single τ ω _ _ (F.coordinateConjugates_quotient τ ω u z ell) g + have hgen (p : PrefixLabel ell) : Ψ (MonoidAlgebra.single (FreeGroup.of p) 1)=(Y p : Q τ ω) := by + rw [hword] + exact congrArg Subtype.val (show FreeGroup.lift Y (FreeGroup.of p)=Y p from FreeGroup.lift_apply_of) + have hinv (p : PrefixLabel ell) : Ψ (MonoidAlgebra.single ((FreeGroup.of p)⁻¹) 1)= + star (Y p : Q τ ω) := by + rw [hword,(unitaryRepresentation τ ω Y).map_inv] + change star (FreeGroup.lift Y (FreeGroup.of p) : Q τ ω)=_ + rw [FreeGroup.lift_apply_of] + have hs (r : ℝ) (a : MonoidAlgebra ℂ (FreeGroup (PrefixLabel ell))) : Ψ (r • a)=r • Ψ a := + map_smul (Ψ.restrictScalars ℝ).toLinearMap r a + have hrow (k : Fin ell) : Ψ (finitePerturbationRow α k)= + (α/(2*ell) : ℝ) • ∑ j : Fin ell,((Y (pairLabel k j) : Q τ ω)-star (Y (pairLabel k j) : Q τ ω)) := by + rw [finitePerturbationRow,hs] + congr 1 + simp only [map_sum,map_sub,hgen,hinv] + change (sequenceQuotient τ ω) (((List.ofFn (finitePerturbationRow (n := ell) α)).map + (F.perturbationMap τ ω u z ell)).sum)=_ + rw [List.map_ofFn,List.sum_ofFn,map_sum] + change (∑ k : Fin ell,Ψ (finitePerturbationRow α k))=_ + simp only [hrow,← Finset.smul_sum] + exact (IsScalarTower.algebraMap_smul ℂ (α/(2*ell) : ℝ) _).symm + +theorem SuccessiveCoordinateHaar.coordinate_linearized_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (xi : Q τ ω) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) : + quotientTrace τ ω (star xi*(1+sequenceQuotient τ ω + (((finitePerturbationRows ell α).map (F.perturbationMap τ ω u z ell)).sum))* + (prefixProduct τ ω (constantQuotientUnitary τ ω u) (fun k => (F.step k).t) (ell+1) : Q τ ω))= + (α : ℂ)/2*quotientTrace τ ω (star xi*(constantQuotientUnitary τ ω z : Q τ ω)) := by + rw [F.perturbationMap_firstOrder,F.linearized_correlation τ ω _ _ xi hu hz hxi] + have hn : (ell : ℂ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.ne_of_gt hell) + push_cast + field_simp [hn] + +end + +/-! The uniform trace correlation for the actual product of coordinate +exponentials. Identifying that product with a single-unitary perturbation word +is a separate remaining step. -/ +section +attribute [local instance] Classical.propDecidable Classical.decEq +open UltrapowerBridge Filter +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem SuccessiveCoordinateHaar.exponential_product_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (xi : Q τ ω) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) : + ‖quotientTrace τ ω (star xi*(sequenceQuotient τ ω + (((finitePerturbationRows ell α).map (fun r => NormedSpace.exp (F.perturbationMap τ ω u z ell r))).prod)* + (prefixProduct τ ω (constantQuotientUnitary τ ω u) (fun k => (F.step k).t) (ell+1) : Q τ ω)))- + (α : ℂ)/2*quotientTrace τ ω (star xi*(constantQuotientUnitary τ ω z : Q τ ω))‖ ≤ + ‖xi‖*(4*α^2/(1-2*α)) := by + let W := prefixProduct τ ω (constantQuotientUnitary τ ω u) (fun k => (F.step k).t) (ell+1) + apply quotient_correlation_remainder τ ω xi _ _ (W : Q τ ω) _ _ + (Unitary.coe_mul_star_self W) + · simpa only [mul_assoc] using F.coordinate_linearized_correlation τ ω u z xi hu hz hxi ell hell α + · have h := F.perturbation_remainder τ ω u z hu hz ell hell α hα hhalf + simpa only [remainderSequence,map_sub,map_one,sub_add_eq_sub_sub] using h + +end + +/-! The uniform correlation now belongs to the literal word in one common +perturbed unitary, as required by eq:perturbation-prefix. -/ +open UltrapowerBridge +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] +variable {N M : VonNeumannAlgebra H} (τ : TracialRepresentation M) (ω : Ultrafilter ℕ) +variable {hNM : N ≤ M} {seed : Set (Q τ ω)} + +theorem SuccessiveCoordinateHaar.coordinatePrefix_quotient + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u : unitary M.toStarSubalgebra) (k : ℕ) : + sequenceUnitaryQuotient τ ω (F.coordinatePrefix τ ω u k)= + prefixProduct τ ω (constantQuotientUnitary τ ω u) (fun j => (F.step j).t) k := by + rw [coordinatePrefix,freeGroup_quotient τ ω _ _ (F.coordinateVariables_quotient τ ω u), + unitaryRepresentation_prefix] + +theorem SuccessiveCoordinateHaar.perturbedWord_correlation + (F : SuccessiveCoordinateHaar τ ω hNM seed) (u z : unitary M.toStarSubalgebra) + (xi : Q τ ω) + (hu : (constantQuotientUnitary τ ω u : Q τ ω) ∈ seed) + (hz : (constantQuotientUnitary τ ω z : Q τ ω) ∈ seed) (hxi : xi ∈ seed) + (ell : ℕ) (hell : 0 < ell) (α : ℝ) (hα : 0 < α) (hhalf : α < 1/2) : + ‖quotientTrace τ ω (star xi*sequenceQuotient τ ω + (F.perturbedWord τ ω u z ell α : Sequences M))- + (α : ℂ)/2*quotientTrace τ ω (star xi*(constantQuotientUnitary τ ω z : Q τ ω))‖ ≤ + ‖xi‖*(4*α^2/(1-2*α)) := by + rw [← F.exponential_product_eq_word,map_mul] + have hp := congrArg Subtype.val (F.coordinatePrefix_quotient τ ω u (ell+1)) + change sequenceQuotient τ ω (F.coordinatePrefix τ ω u (ell+1) : Sequences M)=_ at hp + rw [hp] + exact F.exponential_product_correlation τ ω u z xi hu hz hxi ell hell α hα hhalf + +end Tracial + +end Generator + +end + +end OAI diff --git a/lean/OAI/Analysis/FactorGeneration/Words.lean b/lean/OAI/Analysis/FactorGeneration/Words.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d7e2d926983acba7865abf5d07ac5d52524f0a4 --- /dev/null +++ b/lean/OAI/Analysis/FactorGeneration/Words.lean @@ -0,0 +1,193 @@ +import Mathlib.Algebra.BigOperators.Group.List.Basic +import Mathlib.Algebra.BigOperators.Ring.Finset +import Mathlib.Algebra.Group.Hom.Defs +import Mathlib.Algebra.Order.BigOperators.Group.List +import Mathlib.Algebra.Order.Ring.Basic +import Mathlib.Algebra.Order.Ring.Defs +import Mathlib.Data.List.Induction +import Mathlib.Data.Set.Image +import Mathlib.GroupTheory.FreeGroup.Reduce + +namespace OAI + +namespace Generator + +/-! All alternating word shapes, allowing either algebra at either endpoint. -/ +section +variable {A : Type*} + +def alternatingFrom (S T : Set A) : Bool → List A → Prop + | _,[] => True + | b,x::xs => x ∈ (if b then S else T) ∧ alternatingFrom S T (!b) xs + +def alternatingSlotSets (S T : Set A) : Bool → ℕ → List (Set A) + | _,0 => [] + | b,n+1 => (if b then S else T)::alternatingSlotSets S T (!b) n + +theorem alternatingFrom_slots (S T : Set A) (b : Bool) (xs : List A) : + alternatingFrom S T b xs ↔ + List.Forall₂ (fun s x => x ∈ s) (alternatingSlotSets S T b xs.length) xs := by + induction xs generalizing b with + | nil => simp [alternatingFrom,alternatingSlotSets] + | cons x xs ih => simp [alternatingFrom,alternatingSlotSets,ih] + +theorem alternatingSlotSets_length (S T : Set A) (b : Bool) (n : ℕ) : + (alternatingSlotSets S T b n).length=n := by + induction n generalizing b with + | zero => rfl + | succ n ih => simp [alternatingSlotSets,ih] + +/-- Vanishing of every nonempty alternating word from two specified sets. -/ +def alternatingMomentsZero {K : Type*} [Zero K] [Monoid A] + (φ : A → K) (S T : Set A) : Prop := + ∀ b xs,xs ≠ [] → alternatingFrom S T b xs → φ xs.prod=0 + +end + +section +variable {A B K : Type*} + +theorem alternatingFrom_image (f : A → B) (S T : Set A) (b : Bool) (xs : List B) + (hx : alternatingFrom (f '' S) (f '' T) b xs) : + ∃ ys : List A,ys.map f=xs ∧ alternatingFrom S T b ys := by + induction xs generalizing b with + | nil => exact ⟨[],rfl,True.intro⟩ + | cons x xs ih => + have hx' : x ∈ f '' (if b then S else T) := by cases b <;> exact hx.1 + obtain ⟨y,hy,rfl⟩ := hx' + obtain ⟨ys,rfl,hys⟩ := ih (!b) hx.2 + exact ⟨y::ys,rfl,hy,hys⟩ + +theorem alternatingMomentsZero_map [Monoid A] [Monoid B] [Zero K] + (f : A →* B) (φ : A → K) (ψ : B → K) (hφ : ∀ a,ψ (f a)=φ a) + (S T : Set A) (hm : alternatingMomentsZero φ S T) : + alternatingMomentsZero ψ (f '' S) (f '' T) := by + intro b xs hn hx + obtain ⟨ys,rfl,hy⟩ := alternatingFrom_image f S T b xs hx + have hne : ys ≠ [] := by intro he; exact hn (by simp [he]) + rw [← map_list_prod,hφ] + exact hm b ys hne hy + +end + +/-! Splitting a reduced word at its first occurrence of a specified generator. -/ + +theorem word_split_first {A : Type*} [DecidableEq A] (n : A) + (w : List (A × Bool)) (h : ∃ x ∈ w,x.1=n) : + ∃ a s b,w=a++(n,s)::b ∧ ∀ x ∈ a,x.1 ≠ n := by + induction w with + | nil => simp at h + | cons x w ih => + by_cases hx : x.1=n + · exact ⟨[],x.2,w,by cases x; simp_all,by simp⟩ + · obtain ⟨a,s,b,he,ha⟩ := ih (by + obtain ⟨y,hy,hn⟩ := h + rcases List.mem_cons.mp hy with rfl | hy + · exact (hx hn).elim + · exact ⟨y,hy,hn⟩) + refine ⟨x::a,s,b,by simp [he],?_⟩ + intro y hy + rcases List.mem_cons.mp hy with rfl | hy + · exact hx + · exact ha y hy + +theorem reduced_append_left {A : Type*} {a b : List (A × Bool)} + (h : FreeGroup.IsReduced (a++b)) : FreeGroup.IsReduced a := + List.IsChain.left_of_append h + +theorem reduced_append_right {A : Type*} {a b : List (A × Bool)} + (h : FreeGroup.IsReduced (a++b)) : FreeGroup.IsReduced b := + List.IsChain.right_of_append h + +theorem reduced_tail {A : Type*} {a : A × Bool} {w : List (A × Bool)} + (h : FreeGroup.IsReduced (a::w)) : FreeGroup.IsReduced w := + List.IsChain.tail h + +/-! Noncommutative ordered row words and coefficient majorization, without commuting-row assumptions. -/ +variable {R : Type*} [Semiring R] + +def orderedWords : List R → ℕ → R + | [], 0 => 1 + | [], _ + 1 => 0 + | _ :: _, 0 => 1 + | a :: as, d + 1 => a * orderedWords (a :: as) d + orderedWords as (d + 1) +termination_by xs d => (d, xs.length) + +@[simp] theorem orderedWords_zero (xs : List R) : orderedWords xs 0 = 1 := by + cases xs <;> simp [orderedWords] + +@[simp] theorem orderedWords_nil (d : ℕ) : orderedWords ([] : List R) d = if d = 0 then 1 else 0 := by + cases d <;> simp [orderedWords] + +/-- Grouping nondecreasing row words by the number of initial first-row letters. -/ +theorem orderedWords_cons (a : R) (as : List R) (d : ℕ) : + orderedWords (a :: as) d = + ∑ k ∈ Finset.range (d + 1), a ^ k * orderedWords as (d - k) := by + induction d with + | zero => simp + | succ d ih => + rw [orderedWords, ih] + conv_rhs => rw [Finset.sum_range_succ'] + simp only [pow_zero, one_mul, Nat.sub_zero, Nat.add_sub_add_right] + rw [Finset.mul_sum] + congr 1 + apply Finset.sum_congr rfl + intro k _ + rw [pow_succ', mul_assoc] + +variable [PartialOrder R] [IsOrderedRing R] + +theorem orderedWords_nonneg (xs : List R) (hx : ∀ a ∈ xs, 0 ≤ a) (d : ℕ) : + 0 ≤ orderedWords xs d := by + induction d generalizing xs with + | zero => simp + | succ d ih => + induction xs with + | nil => simp + | cons a as iht => + rw [orderedWords] + exact add_nonneg (mul_nonneg (hx a (by simp)) (ih _ hx)) + (iht (fun b hb => hx b (by simp [hb]))) + +theorem orderedWords_tail_le (a : R) (as : List R) + (ha : 0 ≤ a) (has : ∀ b ∈ as, 0 ≤ b) (d : ℕ) : + orderedWords as d ≤ orderedWords (a :: as) d := by + cases d with + | zero => simp + | succ d => + rw [orderedWords] + exact le_add_of_nonneg_left (mul_nonneg ha + (orderedWords_nonneg _ (by simpa using And.intro ha has) d)) + +/-- Choosing the first row of a nondecreasing word gives a subset of all choices. -/ +theorem orderedWords_step_le (xs : List R) (hx : ∀ a ∈ xs, 0 ≤ a) (d : ℕ) : + orderedWords xs (d + 1) ≤ xs.sum * orderedWords xs d := by + induction xs with + | nil => simp + | cons a as ih => + have ha := hx a (by simp) + have has : ∀ b ∈ as, 0 ≤ b := fun b hb => hx b (by simp [hb]) + calc + orderedWords (a :: as) (d + 1) = + a * orderedWords (a :: as) d + orderedWords as (d + 1) := by rw [orderedWords] + _ ≤ a * orderedWords (a :: as) d + as.sum * orderedWords as d := + add_le_add le_rfl (ih has) + _ ≤ a * orderedWords (a :: as) d + as.sum * orderedWords (a :: as) d := + add_le_add le_rfl (mul_le_mul_of_nonneg_left (orderedWords_tail_le a as ha has d) + (List.sum_nonneg has)) + _ = _ := by rw [List.sum_cons, add_mul] + +/-- All-degree bound by the full distributive power, without commuting factors. -/ +theorem orderedWords_le_sum_pow (xs : List R) (hx : ∀ a ∈ xs, 0 ≤ a) (d : ℕ) : + orderedWords xs d ≤ xs.sum ^ d := by + induction d with + | zero => simp + | succ d ih => + calc + _ ≤ xs.sum * orderedWords xs d := orderedWords_step_le xs hx d + _ ≤ xs.sum * xs.sum ^ d := mul_le_mul_of_nonneg_left ih (List.sum_nonneg hx) + _ = _ := (pow_succ' _ _).symm + +end Generator + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/CommonConull.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/CommonConull.lean new file mode 100644 index 0000000000000000000000000000000000000000..4b326065bd89778a223a4376a59c7516778d56d3 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/CommonConull.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.FiniteFactor.BiasedPairs.PairIdentity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- One invariant Borel conull set for the original projection works for every +actual biased law, with strict positivity and the full uncapped pair identity. -/ +theorem sourceProjection_biased_common_conull + (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) (hr : SourceRationalIndependent θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (hp0 : p ≠ 0) (hp1 : p ≠ 1) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∃ Q : Set SourceTorus, MeasurableSet Q ∧ (∀ᵐ z ∂sourceTorusHaar, z ∈ Q) ∧ + (∀ z ∈ Q, + finiteFloorSupport θ (sourceTorusRepresentative z) ∧ + IsStarProjection (sourceTorusOperatorField p z) ∧ + (∀ r k m : ℤ, (sourceTorusOperatorField p (sourceTorusRotate θ r z) + (lp.single 2 m (1 : ℂ))) k = + (sourceTorusOperatorField p z (lp.single 2 (m+r) (1 : ℂ))) (k+r)) ∧ + (∀ n : ℕ, (∀ i, sourceTorusRepresentative z i ≤ + sourceTorusRepresentative (sourceTorusRotate θ n z) i) → + (z,sourceTorusRotate θ n z) ∈ sourceCappedPairZeroSet θ p) ∧ + 0 < (sourceCentralCoefficient p (sourceTorusRepresentative z)).re ∧ + (sourceCentralCoefficient p (sourceTorusRepresentative z)).re < 1 ∧ + (sourceCentralCoefficient p (sourceTorusRepresentative z)).im = 0) ∧ + (∀ n : ℤ, ∀ z ∈ Q, sourceTorusRotate θ n z ∈ Q) ∧ + ∀ j : ℕ, ∀ᵐ z ∂(sourceBiasedTorusMeasure j (fun _ => true) : Measure SourceSamplingTorus), + z.1 ∈ Q ∧ z.2 ∈ Q ∧ + ∃ D : SourceFiberHilbert →L[ℂ] SourceFiberHilbert, + ‖D‖ ≤ 1 ∧ + (∀ (v : SourceFiberHilbert) (k : ℤ), D v k = + (sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.2) / + sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.1) : ℂ) * v k) ∧ + (1-sourceTorusOperatorField p z.2)*D*sourceTorusOperatorField p z.1 = 0 := by + obtain ⟨Q,hQ,hQa,hQp,hQi⟩ := sourceProjection_positive_common_conull θ hθ hr hp hproj hp0 hp1 hinv + refine ⟨Q,hQ,hQa,hQp,hQi,?_⟩ + intro j + filter_upwards [sourceBiasedTorusMeasure_endpoints_conull j (fun _ => true) Q hQa, + sourceProjection_biased_ratio_identity θ hθ hs hp hproj hinv j] with z hQz hD + exact ⟨hQz.1,hQz.2,hD⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/Conull.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/Conull.lean new file mode 100644 index 0000000000000000000000000000000000000000..f48bd73bef6c5f0efe9dfaee494a284ab6393dd8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/Conull.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.FiniteFactor.BiasedPairs.Measures +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionPositiveConull + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter CouplingParameters +open scoped ENNReal +noncomputable section + +theorem sourceBiasedEndpoint_cube (j : ℕ) (r : SourceCoordinate → Bool) : + ∀ᵐ ω ∂sourceBiasedLaw j, ∀ i, sourceBiasedEndpoint r ω i ∈ Set.Ico (0 : ℝ) 1 := by + obtain ⟨g,_,_,_,hm,_⟩ := sourceBiasedEndpoint_density j r + have ha : (sourceBiasedLaw j).map (sourceBiasedEndpoint r) ≪ sourceSamplingHaar := by + rw [hm] + exact withDensity_absolutelyContinuous _ _ + exact ae_of_ae_map (sourceBiasedEndpoint_measurable r).aemeasurable + (ha.ae_le sourceSamplingHaar_cube) + +theorem sourceBiasedLaw_ordered (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ∀ i, (ω i).2.1 ≤ (ω i).2.2 := by + apply ae_all_iff.mpr + intro i + have ha : ∀ᵐ z ∂(stagedCouplingParameters j i.1).labelledCoupling, z.2.1 ≤ z.2.2 := by + rw [ae_iff] + change (stagedCouplingParameters j i.1).labelledCoupling {z | z.2.1 ≤ z.2.2}ᶜ = 0 + have hmeas : MeasurableSet {z : Fin 6 × (ℝ × ℝ) | z.2.1 ≤ z.2.2} := + measurableSet_le (by fun_prop) (by fun_prop) + rw [measure_compl hmeas (measure_ne_top _ _), + measure_univ,labelledCoupling_ordered,tsub_self] + exact (measurePreserving_eval_infinitePi + (fun i : SourceCoordinate => (stagedCouplingParameters j i.1).labelledCoupling) i).quasiMeasurePreserving.ae ha + +/-- Every mixed law, including nu_j, is carried by the actual ordered representatives. -/ +theorem sourceBiasedTorusMeasure_ordered (j : ℕ) (r : SourceCoordinate → Bool) : + ∀ᵐ z ∂(sourceBiasedTorusMeasure j r : Measure SourceSamplingTorus), + ∀ i, sourceTorusRepresentative z.1 i ≤ sourceTorusRepresentative z.2 i := by + have hm : MeasurableSet {z : SourceSamplingTorus | ∀ i, + sourceTorusRepresentative z.1 i ≤ sourceTorusRepresentative z.2 i} := by + simp only [Set.ofPred_forall] + exact MeasurableSet.iInter fun i => measurableSet_le + ((measurable_pi_apply i).comp (sourceTorusRepresentative_preserving.measurable.comp measurable_fst)) + ((measurable_pi_apply i).comp (sourceTorusRepresentative_preserving.measurable.comp measurable_snd)) + apply (ae_map_iff sourceSamplingTorusMap_continuous.measurable.aemeasurable hm).mpr + apply (ae_map_iff (sourceBiasedPair_measurable r).aemeasurable + (hm.preimage sourceSamplingTorusMap_continuous.measurable)).mpr + filter_upwards [sourceBiasedEndpoint_cube j (fun _ => false),sourceBiasedEndpoint_cube j r, + sourceBiasedLaw_ordered j] with ω hx hy hord + change ∀ i, sourceTorusRepresentative (sourceTorusQuotient (sourceBiasedEndpoint (fun _ => false) ω)) i ≤ + sourceTorusRepresentative (sourceTorusQuotient (sourceBiasedEndpoint r ω)) i + rw [sourceTorusRepresentative_quotient _ hx,sourceTorusRepresentative_quotient _ hy] + intro i + cases hr : r i + · simp [sourceBiasedEndpoint,blockProductEndpoint,endpoint,hr] + · simpa [sourceBiasedEndpoint,blockProductEndpoint,endpoint,hr] using hord i + +/-- The same Borel conull set works for both endpoints of every actual biased +or mixed-prefix coupling; there is no new null-set choice for each identity. -/ +theorem sourceBiasedTorusMeasure_endpoints_conull (j : ℕ) (r : SourceCoordinate → Bool) + (Q : Set SourceTorus) (hQ : ∀ᵐ z ∂sourceTorusHaar, z ∈ Q) : + ∀ᵐ z ∂(sourceBiasedTorusMeasure j r : Measure SourceSamplingTorus), z.1 ∈ Q ∧ z.2 ∈ Q := + (ae_of_ae_map (sourceTorusEndpoint_measurable false).aemeasurable + ((sourceBiasedTorusMeasure_marginal_ac j r false).ae_le hQ)).and + (ae_of_ae_map (sourceTorusEndpoint_measurable true).aemeasurable + ((sourceBiasedTorusMeasure_marginal_ac j r true).ae_le hQ)) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/Measures.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/Measures.lean new file mode 100644 index 0000000000000000000000000000000000000000..db74bf1c95bc6b9387828b4dbded9ba2a8991145 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/Measures.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.StageCoupling +import OAI.Analysis.FiniteFactor.OrbitSampling.TorusMarginals +import OAI.Analysis.FiniteFactor.Coupling.Order +import OAI.Analysis.FiniteFactor.Coupling.VectorBayes + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter CouplingParameters +open scoped ENNReal Topology +noncomputable section + +abbrev SourceBiasedSample := SourceCoordinate → Fin 6 × (ℝ × ℝ) +abbrev sourceBiasedLaw (j : ℕ) : Measure SourceBiasedSample := + blockProductCoupling (stagedCouplingParameters j) sourceBlockSize + +def sourceBiasedEndpoint (r : SourceCoordinate → Bool) : SourceBiasedSample → (SourceCoordinate → ℝ) := + blockProductEndpoint r + +theorem sourceBiasedEndpoint_measurable (r : SourceCoordinate → Bool) : + Measurable (sourceBiasedEndpoint r) := vectorEndpoint_measurable r + +/-- The mixed pair has the original x endpoint and selects x or y coordinatewise. -/ +def sourceBiasedPair (r : SourceCoordinate → Bool) (ω : SourceBiasedSample) : SourceSamplingPair := + (sourceBiasedEndpoint (fun _ => false) ω,sourceBiasedEndpoint r ω) + +theorem sourceBiasedPair_measurable (r : SourceCoordinate → Bool) : Measurable (sourceBiasedPair r) := + (sourceBiasedEndpoint_measurable _).prodMk (sourceBiasedEndpoint_measurable _) + +def sourceBiasedRealMeasure (j : ℕ) (r : SourceCoordinate → Bool) : Measure SourceSamplingPair := + (sourceBiasedLaw j).map (sourceBiasedPair r) + +instance sourceBiasedRealMeasure_probability (j : ℕ) (r : SourceCoordinate → Bool) : + IsProbabilityMeasure (sourceBiasedRealMeasure j r) := + inferInstanceAs (IsProbabilityMeasure ((sourceBiasedLaw j).map (sourceBiasedPair r))) + +def sourceBiasedTorusMeasure (j : ℕ) (r : SourceCoordinate → Bool) : FiniteMeasure SourceSamplingTorus := + ⟨(sourceBiasedRealMeasure j r).map sourceSamplingTorusMap,by infer_instance⟩ + +theorem sourceBiasedRealMeasure_marginal (j : ℕ) (r : SourceCoordinate → Bool) (b : Bool) : + (sourceBiasedRealMeasure j r).map (sourceSamplingEndpoint b) = + (sourceBiasedLaw j).map (sourceBiasedEndpoint (if b then r else fun _ => false)) := by + rw [sourceBiasedRealMeasure,Measure.map_map (sourceSamplingEndpoint_measurable b) + (sourceBiasedPair_measurable r)] + cases b <;> rfl + +/-- A nonnegative measurable version of each actual marginal density. -/ +theorem sourceBiasedEndpoint_density (j : ℕ) (r : SourceCoordinate → Bool) : + ∃ g : (SourceCoordinate → ℝ) → ℝ, Measurable g ∧ (∀ x, 0 ≤ g x) ∧ + MemLp g 2 sourceSamplingHaar ∧ + (sourceBiasedLaw j).map (sourceBiasedEndpoint r) = + sourceSamplingHaar.withDensity (fun x => ENNReal.ofReal (g x)) ∧ + (∫ x, g x^2 ∂sourceSamplingHaar) ≤ Real.exp (20*(2*(∑' s,sourceKappa s^2)+1)) := by + obtain ⟨f,hf,hf0,hfC,hfm⟩ := stagedCoupling_endpoint_L2_density j r + let g := fun x => max (hf.aestronglyMeasurable.mk f x) 0 + have hg : Measurable g := hf.aestronglyMeasurable.stronglyMeasurable_mk.measurable.max measurable_const + have he : f =ᵐ[sourceSamplingHaar] g := by + filter_upwards [hf.aestronglyMeasurable.ae_eq_mk,hf0] with x hx h0 + simp only [g,← hx,max_eq_left h0] + refine ⟨g,hg,fun _ => le_max_right _ _,(memLp_congr_ae he).mp hf,?_,?_⟩ + · exact hfm.trans (withDensity_congr_ae (he.fun_comp ENNReal.ofReal)) + · exact (integral_congr_ae (he.mono fun x hx => congrArg (fun t : ℝ => t^2) hx)).symm.trans_le hfC + +/-- Both mixed torus marginals have the same actual uniform L2 bound. -/ +theorem sourceBiasedTorusMeasure_density (j : ℕ) (r : SourceCoordinate → Bool) (b : Bool) : + ∃ g : SourceTorus → ℝ, Measurable g ∧ (∀ z, 0 ≤ g z) ∧ + MemLp g 2 sourceTorusHaar ∧ + (sourceBiasedTorusMeasure j r : Measure SourceSamplingTorus).map (sourceTorusEndpoint b) = + sourceTorusHaar.withDensity (fun z => ENNReal.ofReal (g z)) ∧ + (∫ z, g z^2 ∂sourceTorusHaar) ≤ Real.exp (20*(2*(∑' s,sourceKappa s^2)+1)) := by + obtain ⟨f,hf,hf0,hflp,hfm,hfC⟩ := sourceBiasedEndpoint_density j (if b then r else fun _ => false) + have hm : (sourceBiasedRealMeasure j r).map (sourceSamplingEndpoint b) = + sourceSamplingHaar.withDensity (fun x => ENNReal.ofReal (f x)) := + (sourceBiasedRealMeasure_marginal j r b).trans hfm + refine ⟨f ∘ sourceTorusRepresentative,hf.comp sourceTorusRepresentative_preserving.measurable, + fun z => hf0 _,hflp.comp_measurePreserving sourceTorusRepresentative_preserving, + sourceSamplingTorus_marginal_transport _ b f hf hm,?_⟩ + have he : (∫ z, (f (sourceTorusRepresentative z))^2 ∂sourceTorusHaar) = + ∫ x, f x^2 ∂sourceSamplingHaar := by + rw [← sourceTorusRepresentative_preserving.map_eq] + exact (integral_map sourceTorusRepresentative_preserving.measurable.aemeasurable + (hf.pow_const 2).aestronglyMeasurable).symm + exact he.trans_le hfC + +/-- Every endpoint of every mixed-prefix or full biased law belongs to any +prescribed Haar-conull Borel set. -/ +theorem sourceBiasedTorusMeasure_marginal_ac (j : ℕ) (r : SourceCoordinate → Bool) (b : Bool) : + (sourceBiasedTorusMeasure j r : Measure SourceSamplingTorus).map (sourceTorusEndpoint b) ≪ sourceTorusHaar := by + obtain ⟨g,_,_,_,hm,_⟩ := sourceBiasedTorusMeasure_density j r b + rw [hm] + exact withDensity_absolutelyContinuous _ _ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PairIdentity.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c299ae01dda23cc00e3f94f26a02ddd4b7198d8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PairIdentity.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.FiniteFactor.BiasedPairs.PrefixDomination +import OAI.Analysis.FiniteFactor.CrossedProduct.UncappedPairIdentity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section + +theorem sourceProjection_biased_prefix_pairs (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j n : ℕ) : + ∀ᵐ z ∂(sourceBiasedTorusMeasure j (sourceBiasedPrefixMask n) : Measure SourceSamplingTorus), + z ∈ sourceCappedPairZeroSet θ p := by + apply (sourceBiasedPrefix_domination j n).ae_le + change ∀ᵐ z ∂(∑ I ∈ (CouplingParameters.blockPrefix sourceBlockSize n).powerset, + (sourceSamplingLambdaTorus I : Measure SourceSamplingTorus)), z ∈ sourceCappedPairZeroSet θ p + rw [ae_iff,Measure.finsetSum_apply] + apply Finset.sum_eq_zero + intro I hI + exact ae_iff.mp (sourceProjection_lambda_pairs θ hθ hs hp hproj hinv I) + +/-- Weak transfer to the actual full biased law. Uniform absolute continuity +and the common compact zero sets have all been proved for these actual laws. -/ +theorem sourceProjection_biased_pairs (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) : + ∀ᵐ z ∂(sourceBiasedTorusMeasure j (fun _ => true) : Measure SourceSamplingTorus), + z ∈ sourceCappedPairZeroSet θ p := by + apply finiteMeasure_ae_of_compact_approximation _ _ (sourceBiasedPrefix_weak j) _ + (sourceCappedPairZeroSet_measurable θ p) + intro ε hε + have hhalf : 0 < ε / 2 := half_pos hε + obtain ⟨δ₁,hδ₁,h₁⟩ := sourceBiasedPrefix_uniformAC j false (ε / 2) hhalf + obtain ⟨δ₂,hδ₂,h₂⟩ := sourceBiasedPrefix_uniformAC j true (ε / 2) hhalf + obtain ⟨Q,_,hQ,hμQ,hK⟩ := exists_source_capped_compact θ p + MeasurableSet.univ (Eventually.of_forall (fun _ => Set.mem_univ _)) + (ne_of_gt (lt_min hδ₁ hδ₂)) + refine ⟨(Q ×ˢ Q) ∩ sourceCappedPairZeroSet θ p,hK,Set.inter_subset_right,?_⟩ + intro n + have hb₁ := h₁ Qᶜ hQ.isClosed.measurableSet.compl + (hμQ.trans_le (min_le_left _ _)) n + have hb₂ := h₂ Qᶜ hQ.isClosed.measurableSet.compl + (hμQ.trans_le (min_le_right _ _)) n + have hb := add_le_add hb₁ hb₂ + have he : (↑(ε / 2) : ℝ≥0∞) + ↑(ε / 2) = ε := by + rw [← ENNReal.coe_add,add_halves] + rw [he] at hb + exact (measure_pair_compact_loss _ Q hQ.isClosed.measurableSet _ + (sourceProjection_biased_prefix_pairs θ hθ hs hp hproj hinv j n)).trans hb + +/-- Both endpoints of every actual biased law have finite floor support. -/ +theorem sourceBiased_endpoints_finiteFloor (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) : + ∀ᵐ z ∂(sourceBiasedTorusMeasure j (fun _ => true) : Measure SourceSamplingTorus), + finiteFloorSupport θ (sourceTorusRepresentative z.1) ∧ + finiteFloorSupport θ (sourceTorusRepresentative z.2) := by + have hf := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (ae_finiteFloorSupport θ hθ.summable) + exact sourceBiasedTorusMeasure_endpoints_conull j (fun _ => true) _ hf + +/-- The full uncapped invariant-projection identity under the constructed nu_j. +The bounded diagonal acts by the original cocycle ratio on every l2 vector. -/ +theorem sourceProjection_biased_ratio_identity (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) : + ∀ᵐ z ∂(sourceBiasedTorusMeasure j (fun _ => true) : Measure SourceSamplingTorus), + ∃ D : SourceFiberHilbert →L[ℂ] SourceFiberHilbert, + ‖D‖ ≤ 1 ∧ + (∀ (v : SourceFiberHilbert) (k : ℤ), D v k = + (sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.2) / + sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.1) : ℂ) * v k) ∧ + (1-sourceTorusOperatorField p z.2)*D*sourceTorusOperatorField p z.1 = 0 := by + filter_upwards [sourceProjection_biased_pairs θ hθ hs hp hproj hinv j, + sourceBiased_endpoints_finiteFloor θ hθ j,sourceBiasedTorusMeasure_ordered j (fun _ => true)] + with z hz hf hord + refine ⟨fiberDiagonal (sourceCappedRatio θ z) (sourceCappedRatio_norm θ z), + fiberDiagonal_norm _ _,?_,hz⟩ + intro v k + rw [fiberDiagonal_apply,sourceCappedRatio_eq_ratio θ z hf.1 hf.2 hord k,Complex.ofReal_div] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PrefixDomination.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PrefixDomination.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b5c9ef8b67dfbab42b422b21feb458152adb66a --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PrefixDomination.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ReferenceOrdered +import OAI.Analysis.FiniteFactor.BiasedPairs.Conull + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter ProbabilityTheory CouplingParameters Finset +open scoped ENNReal +noncomputable section + +theorem sourceBiasedRealMeasure_ordered (j : ℕ) (r : SourceCoordinate → Bool) : + ∀ᵐ z ∂sourceBiasedRealMeasure j r, z ∈ sourceSamplingOrdered := by + apply (ae_map_iff (sourceBiasedPair_measurable r).aemeasurable sourceSamplingOrdered_measurable).mpr + filter_upwards [sourceBiasedLaw_ordered j] with ω hω + intro i + cases hr : r i + · simp [sourceBiasedPair,sourceBiasedEndpoint,blockProductEndpoint,endpoint,hr] + · simpa [sourceBiasedPair,sourceBiasedEndpoint,blockProductEndpoint,endpoint,hr] using hω i + +theorem sourceBiasedPrefix_domination_real (j n : ℕ) : + sourceBiasedRealMeasure j (sourceBiasedPrefixMask n) ≪ + ∑ I ∈ (blockPrefix sourceBlockSize n).powerset, sourceSamplingLambda I := by + have hh := (sourceBiasedPrefix_ac_reference j n).restrict sourceSamplingOrdered + rw [Measure.restrict_eq_self_of_ae_mem (sourceBiasedRealMeasure_ordered j _), + sourceFiniteReference_ordered_mixture] at hh + exact hh.trans Measure.smul_absolutelyContinuous + +/-- Finite-prefix domination by the actual lambda_I measures on the same torus +used for the uncapped invariant-projection identity and weak limits. -/ +theorem sourceBiasedPrefix_domination (j n : ℕ) : + (sourceBiasedTorusMeasure j (sourceBiasedPrefixMask n) : Measure SourceSamplingTorus) ≪ + ∑ I ∈ (blockPrefix sourceBlockSize n).powerset, + (sourceSamplingLambdaTorus I : Measure SourceSamplingTorus) := by + have hh := (sourceBiasedPrefix_domination_real j n).map sourceSamplingTorusMap_continuous.measurable + change _ ≪ _ at hh + have hm : (∑ I ∈ (blockPrefix sourceBlockSize n).powerset, sourceSamplingLambda I).map sourceSamplingTorusMap = + ∑ I ∈ (blockPrefix sourceBlockSize n).powerset, + (sourceSamplingLambdaTorus I : Measure SourceSamplingTorus) := by + let F := (blockPrefix sourceBlockSize n).powerset + change (∑ I ∈ F, sourceSamplingLambda I).map sourceSamplingTorusMap = + ∑ I ∈ F, (sourceSamplingLambdaTorus I : Measure SourceSamplingTorus) + induction F using Finset.induction_on with + | empty => simp + | @insert I F hi ih => + rw [Finset.sum_insert hi,Measure.map_add _ _ sourceSamplingTorusMap_continuous.measurable, + Finset.sum_insert hi,ih] + rfl + rw [hm] at hh + exact hh + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PrefixLimit.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PrefixLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ff6460d5c7fec952a1e81c7c33ba5c0b4ccb179 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/PrefixLimit.lean @@ -0,0 +1,66 @@ +import OAI.Analysis.FiniteFactor.BiasedPairs.Measures +import OAI.Analysis.FiniteFactor.L2UniformAbsoluteContinuity +import Mathlib.MeasureTheory.Integral.DominatedConvergence + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section + +/-- At prefix n, use y in the first n source blocks and x in the tail. -/ +def sourceBiasedPrefixMask (n : ℕ) (i : SourceCoordinate) : Bool := decide (i.1 < n) + +theorem sourceBiasedPrefixPair_tendsto (ω : SourceBiasedSample) : + Tendsto (fun n => sourceBiasedPair (sourceBiasedPrefixMask n) ω) atTop + (𝓝 (sourceBiasedPair (fun _ => true) ω)) := by + apply Tendsto.prodMk_nhds tendsto_const_nhds + apply tendsto_pi_nhds.mpr + intro i + apply tendsto_const_nhds.congr' + filter_upwards [eventually_gt_atTop i.1] with n hn + simp [sourceBiasedEndpoint,CouplingParameters.blockProductEndpoint, + sourceBiasedPrefixMask,hn] + +/-- The actual beta_n converge weakly to the actual full biased law nu_j. -/ +theorem sourceBiasedPrefix_weak (j : ℕ) : + Tendsto (fun n => sourceBiasedTorusMeasure j (sourceBiasedPrefixMask n)) atTop + (𝓝 (sourceBiasedTorusMeasure j (fun _ => true))) := by + apply FiniteMeasure.tendsto_of_forall_integral_tendsto + intro f + have hmap (r : SourceCoordinate → Bool) : + (∫ z, f z ∂(sourceBiasedTorusMeasure j r : Measure SourceSamplingTorus)) = + ∫ ω, f (sourceSamplingTorusMap (sourceBiasedPair r ω)) ∂sourceBiasedLaw j := by + change (∫ z, f z ∂((sourceBiasedLaw j).map (sourceBiasedPair r)).map sourceSamplingTorusMap) = _ + rw [integral_map sourceSamplingTorusMap_continuous.measurable.aemeasurable f.continuous.aestronglyMeasurable] + exact integral_map (sourceBiasedPair_measurable r).aemeasurable + (f.continuous.comp sourceSamplingTorusMap_continuous).aestronglyMeasurable + simp_rw [hmap] + apply tendsto_integral_of_dominated_convergence (fun _ => ‖f‖) + · intro n + exact ((f.continuous.comp sourceSamplingTorusMap_continuous).measurable.comp + (sourceBiasedPair_measurable _)).aestronglyMeasurable + · exact integrable_const _ + · intro n + exact Eventually.of_forall fun ω => f.norm_coe_le_norm _ + · apply Eventually.of_forall + intro ω + exact (f.continuous.comp sourceSamplingTorusMap_continuous).continuousAt.tendsto.comp + (sourceBiasedPrefixPair_tendsto ω) + +/-- Uniform absolute continuity covers every prefix and both endpoint choices. -/ +theorem sourceBiasedPrefix_uniformAC (j : ℕ) (b : Bool) (ε : ℝ≥0) (hε : 0 < ε) : + ∃ δ : ℝ≥0∞, 0 < δ ∧ ∀ A, MeasurableSet A → sourceTorusHaar A < δ → ∀ n, + ((sourceBiasedTorusMeasure j (sourceBiasedPrefixMask n) : Measure SourceSamplingTorus).map + (sourceTorusEndpoint b)) A ≤ ε := by + apply uniformAC_of_L2_densities sourceTorusHaar _ + (Real.exp (20*(2*(∑' s,sourceKappa s^2)+1))) _ ε hε + intro n + obtain ⟨g,_hg,hg0,hglp,hm,hC⟩ := sourceBiasedTorusMeasure_density j (sourceBiasedPrefixMask n) b + exact ⟨g,hglp,hg0,hm,hC⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/RealIdentity.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/RealIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..26a507888edb33e3c01d21de1351b1a814b24dae --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/RealIdentity.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.FiniteFactor.BiasedPairs.CommonConull + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Almost-everywhere original-base properties transfer to every actual mixed endpoint. -/ +theorem sourceBiasedEndpoint_ae (j : ℕ) (r : SourceCoordinate → Bool) + {P : (SourceCoordinate → ℝ) → Prop} (hP : ∀ᵐ x ∂sourceBaseMeasure, P x) : + ∀ᵐ ω ∂sourceBiasedLaw j, P (sourceBiasedEndpoint r ω) := by + obtain ⟨g,_,_,_,hm,_⟩ := sourceBiasedEndpoint_density j r + have ha : (sourceBiasedLaw j).map (sourceBiasedEndpoint r) ≪ sourceSamplingHaar := by + rw [hm] + exact withDensity_absolutelyContinuous _ _ + exact ae_of_ae_map (sourceBiasedEndpoint_measurable r).aemeasurable (ha.ae_le hP) + +/-- The full uncapped pair identity on the actual augmented probability space, +with the original real endpoints and original operator fields. -/ +theorem sourceProjection_biased_ratio_augmented (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, + ∃ D : SourceFiberHilbert →L[ℂ] SourceFiberHilbert, + ‖D‖ ≤ 1 ∧ + (∀ (v : SourceFiberHilbert) (k : ℤ), D v k = + (sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => true) ω) / + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => false) ω) : ℂ) * v k) ∧ + (1-sourceOperatorField p (sourceBiasedEndpoint (fun _ => true) ω))*D* + sourceOperatorField p (sourceBiasedEndpoint (fun _ => false) ω) = 0 := by + have ht := sourceProjection_biased_ratio_identity θ hθ hs hp hproj hinv j + have hr := ae_of_ae_map sourceSamplingTorusMap_continuous.measurable.aemeasurable ht + have ha := ae_of_ae_map (sourceBiasedPair_measurable (fun _ => true)).aemeasurable hr + filter_upwards [ha,sourceBiasedEndpoint_cube j (fun _ => false), + sourceBiasedEndpoint_cube j (fun _ => true)] with ω hω hx hy + obtain ⟨D,hDn,hDa,hD⟩ := hω + have hxe : sourceTorusRepresentative + (sourceSamplingTorusMap (sourceBiasedPair (fun _ => true) ω)).1 = + sourceBiasedEndpoint (fun _ => false) ω := sourceTorusRepresentative_quotient _ hx + have hye : sourceTorusRepresentative + (sourceSamplingTorusMap (sourceBiasedPair (fun _ => true) ω)).2 = + sourceBiasedEndpoint (fun _ => true) ω := sourceTorusRepresentative_quotient _ hy + refine ⟨D,hDn,?_,?_⟩ + · simpa only [hxe,hye] using hDa + · simpa only [sourceTorusOperatorField,hxe,hye] using hD + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BiasedPairs/ReferenceDomination.lean b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/ReferenceDomination.lean new file mode 100644 index 0000000000000000000000000000000000000000..93eb28fc3fb5540db768ccd362bfdf9e10f8e305 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BiasedPairs/ReferenceDomination.lean @@ -0,0 +1,77 @@ +import OAI.Analysis.FiniteFactor.Coupling.FiniteDisintegration +import OAI.Analysis.FiniteFactor.BiasedPairs.PrefixLimit + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory CouplingParameters +open scoped ENNReal +noncomputable section + +def sourceDiagonalHaarKernel : Kernel ℝ ℝ where + toFun := diagonalHaarReference + measurable' := by + apply Measure.measurable_of_measurable_coe + intro S hS + simp only [diagonalHaarReference,Measure.smul_apply,Measure.add_apply,smul_eq_mul] + exact measurable_const.mul (((Measure.measurable_coe hS).comp Measure.measurable_dirac).add measurable_const) + +instance sourceDiagonalHaarKernel_markov : IsMarkovKernel sourceDiagonalHaarKernel := + ⟨fun t => diagonalHaarReference_probability t⟩ + +/-- Independent diagonal-or-Haar replacement at a finite set of coordinates. -/ +def sourceFiniteReferenceKernel (F : Finset SourceCoordinate) : + Kernel (SourceCoordinate → ℝ) (SourceCoordinate → ℝ) := by + letI : ∀ i, IsMarkovKernel (if i ∈ F then sourceDiagonalHaarKernel else Kernel.id) := + fun i => by split_ifs <;> infer_instance + exact independentKernel (fun i => if i ∈ F then sourceDiagonalHaarKernel else Kernel.id) + +instance sourceFiniteReferenceKernel_markov (F : Finset SourceCoordinate) : + IsMarkovKernel (sourceFiniteReferenceKernel F) := by + unfold sourceFiniteReferenceKernel + infer_instance + +/-- The mixed prefix posterior is dominated for every full conditioning vector. -/ +theorem sourceMixedPosterior_ac (j : ℕ) (F : Finset SourceCoordinate) (x : SourceCoordinate → ℝ) : + mixedPosteriorKernel (fun i : SourceCoordinate => stagedCouplingParameters j i.1) + (fun i => decide (i ∈ F)) x ≪ sourceFiniteReferenceKernel F x := by + have hh := vectorPosterior_finite_ac + (fun i : SourceCoordinate => stagedCouplingParameters j i.1) F x + rw [vectorPosterior_finite_map] at hh + convert hh using 1 <;> + dsimp [mixedPosteriorKernel,sourceFiniteReferenceKernel,independentKernel] <;> + congr 1 <;> funext i <;> by_cases hi : i ∈ F <;> + simp [hi,sourceDiagonalHaarKernel] <;> rfl + +/-- Actual prefix-pair domination after integrating the full x marginal. +The x marginal is replaced by Haar only through its proved density, so the +infinite diagonal tail is not assumed Haar-distributed. -/ +theorem sourceBiasedPrefix_ac_reference (j n : ℕ) : + sourceBiasedRealMeasure j (sourceBiasedPrefixMask n) ≪ + sourceSamplingHaar ⊗ₘ sourceFiniteReferenceKernel (blockPrefix sourceBlockSize n) := by + let p := fun i : SourceCoordinate => stagedCouplingParameters j i.1 + have he : (fun i : SourceCoordinate => decide (i ∈ blockPrefix sourceBlockSize n)) = + sourceBiasedPrefixMask n := by + funext i + simp [sourceBiasedPrefixMask,mem_blockPrefix] + have hdis := mixedPosterior_disintegration p (sourceBiasedPrefixMask n) + have hbase : (vectorCoupling p).map (vectorEndpoint (fun _ => false)) ≪ sourceSamplingHaar := by + obtain ⟨g,_,_,_,hg,_⟩ := sourceBiasedEndpoint_density j (fun _ => false) + change (sourceBiasedLaw j).map (sourceBiasedEndpoint (fun _ => false)) ≪ sourceSamplingHaar + rw [hg] + exact withDensity_absolutelyContinuous _ _ + have hcond : ∀ᵐ x ∂((vectorCoupling p).map (vectorEndpoint (fun _ => false))), + mixedPosteriorKernel p (sourceBiasedPrefixMask n) x ≪ + sourceFiniteReferenceKernel (blockPrefix sourceBlockSize n) x := by + apply Filter.Eventually.of_forall + intro x + rw [← he] + exact sourceMixedPosterior_ac j _ x + have hh := hbase.compProd hcond + rw [hdis] at hh + exact hh + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/BoundedMatrixOperator.lean b/lean/OAI/Analysis/FiniteFactor/BoundedMatrixOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..9cdb4df0c8b1cc4f94c7ec0ca29106e2c9563028 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/BoundedMatrixOperator.lean @@ -0,0 +1,135 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.Normed.Operator.Extend + +namespace OAI + +namespace FiniteFactor +open Filter +open scoped ENNReal Topology +noncomputable section + +abbrev SourceFiberHilbert := lp (fun _ : ℤ => ℂ) 2 + +/-- Canonical inclusion of finite coordinate vectors in l2(Z). -/ +def fiberFiniteEmbedding : (ℤ →₀ ℂ) →ₗ[ℂ] SourceFiberHilbert := + Finsupp.linearCombination ℂ (fun n => lp.single 2 n (1 : ℂ)) + +theorem fiberFiniteEmbedding_single (n : ℤ) (c : ℂ) : + fiberFiniteEmbedding (Finsupp.single n c) = lp.single 2 n c := by + simp [fiberFiniteEmbedding, ← lp.single_smul] + +theorem fiberFiniteEmbedding_sum (a : ℤ →₀ ℂ) : + fiberFiniteEmbedding a = ∑ n ∈ a.support, lp.single 2 n (a n) := by + simp [fiberFiniteEmbedding, Finsupp.linearCombination_apply, Finsupp.sum, ← lp.single_smul] + +theorem fiberFiniteEmbedding_norm_sq (a : ℤ →₀ ℂ) : + ‖fiberFiniteEmbedding a‖ ^ 2 = ∑ n ∈ a.support, ‖a n‖ ^ 2 := by + rw [fiberFiniteEmbedding_sum] + simpa using lp.norm_sum_single (p := (2 : ℝ≥0∞)) (by norm_num) a a.support + +theorem fiberFiniteEmbedding_dense : DenseRange fiberFiniteEmbedding := by + intro x + apply isClosed_closure.mem_of_tendsto (lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ∞) x) + apply Eventually.of_forall + intro s + apply subset_closure + refine ⟨∑ n ∈ s, Finsupp.single n (x n), ?_⟩ + simp [fiberFiniteEmbedding_single] + +/-- The algebraic action of a matrix on finite vectors. -/ +def fiberMatrixLinear (m : ℤ → ℤ → ℂ) : (ℤ →₀ ℂ) →ₗ[ℂ] (ℤ → ℂ) := + Finsupp.linearCombination ℂ (fun n k => m k n) + +theorem fiberMatrixLinear_apply (m : ℤ → ℤ → ℂ) (a : ℤ →₀ ℂ) (k : ℤ) : + fiberMatrixLinear m a k = ∑ n ∈ a.support, a n * m k n := by + simp [fiberMatrixLinear, Finsupp.linearCombination_apply, Finsupp.sum, Finset.sum_apply, + Pi.smul_apply, smul_eq_mul] + +/-- Every bounded operator is determined by its coordinate matrix. -/ +theorem fiberOperator_ext {A B : SourceFiberHilbert →L[ℂ] SourceFiberHilbert} + (h : ∀ k n : ℤ, (A (lp.single 2 n (1 : ℂ))) k = (B (lp.single 2 n (1 : ℂ))) k) : A = B := by + apply lp.ext_continuousLinearMap (by norm_num : (2 : ℝ≥0∞) ≠ ∞) + intro n + apply ContinuousLinearMap.ext + intro c + apply Subtype.ext + funext k + change (A (lp.single 2 n c)) k = (B (lp.single 2 n c)) k + have he : lp.single 2 n c = c • (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) := by + simp [← lp.single_smul] + rw [he, map_smul, map_smul] + change c * (A (lp.single 2 n 1)) k = c * (B (lp.single 2 n 1)) k + rw [h] + +theorem fiberOperator_hasSum (A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (v : SourceFiberHilbert) : + HasSum (fun n : ℤ => v n • A (lp.single 2 n (1 : ℂ))) (A v) := by + convert (lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ∞) v).map A A.continuous using 1 + funext n + have he : lp.single 2 n (v n) = v n • (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) := by + simp [← lp.single_smul] + change v n • A (lp.single 2 n (1 : ℂ)) = A (lp.single 2 n (v n)) + rw [he, map_smul] + +theorem fiberOperator_action (A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (v : SourceFiberHilbert) (k : ℤ) : + (A v) k = ∑' n : ℤ, (A (lp.single 2 n (1 : ℂ))) k * v n := by + have h := (fiberOperator_hasSum A v).map + (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 k) (lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 k).continuous + have he := h.tsum_eq.symm + change (A v) k = ∑' n : ℤ, v n * (A (lp.single 2 n (1 : ℂ))) k at he + simpa only [mul_comm] using he + +variable (m : ℤ → ℤ → ℂ) (C : ℝ) +variable (hb : ∀ (s t : Finset ℤ) (a : ℤ → ℂ), + (∑ k ∈ t, ‖∑ n ∈ s, a n * m k n‖ ^ 2) ≤ C ^ 2 * ∑ n ∈ s, ‖a n‖ ^ 2) + +include C hb in +theorem fiberMatrixLinear_mem (a : ℤ →₀ ℂ) : Memℓp (fiberMatrixLinear m a) 2 := by + apply memℓp_gen' (C := C ^ 2 * ∑ n ∈ a.support, ‖a n‖ ^ 2) + intro t + simpa [fiberMatrixLinear_apply] using hb a.support t a + +/-- The finite matrix action takes values in actual l2, by the finite-sum bound. -/ +def fiberMatrixFinite : (ℤ →₀ ℂ) →ₗ[ℂ] SourceFiberHilbert where + toFun a := ⟨fiberMatrixLinear m a, fiberMatrixLinear_mem m C hb a⟩ + map_add' a b := by apply Subtype.ext; exact map_add (fiberMatrixLinear m) a b + map_smul' c a := by apply Subtype.ext; exact map_smul (fiberMatrixLinear m) c a + +theorem fiberMatrixFinite_norm_le (hC : 0 ≤ C) (a : ℤ →₀ ℂ) : + ‖fiberMatrixFinite m C hb a‖ ≤ C * ‖fiberFiniteEmbedding a‖ := by + have he : ‖fiberMatrixFinite m C hb a‖ ^ 2 = + ∑' k, ‖fiberMatrixLinear m a k‖ ^ 2 := by + simpa [fiberMatrixFinite] using lp.norm_rpow_eq_tsum (p := (2 : ℝ≥0∞)) (by norm_num) + (fiberMatrixFinite m C hb a) + have hsum : (∑' k, ‖fiberMatrixLinear m a k‖ ^ 2) ≤ + C ^ 2 * ∑ n ∈ a.support, ‖a n‖ ^ 2 := by + apply Real.tsum_le_of_sum_le + · intro k; positivity + · intro t; simpa [fiberMatrixLinear_apply] using hb a.support t a + rw [← he, ← fiberFiniteEmbedding_norm_sq] at hsum + have hpos := mul_nonneg hC (norm_nonneg (fiberFiniteEmbedding a)) + nlinarith [norm_nonneg (fiberMatrixFinite m C hb a)] + +/-- Extension of the bounded finite matrix action to every l2 vector. -/ +def boundedMatrixOperator : SourceFiberHilbert →L[ℂ] SourceFiberHilbert := + (fiberMatrixFinite m C hb).extendOfNorm fiberFiniteEmbedding + +theorem boundedMatrixOperator_norm (hC : 0 ≤ C) : ‖boundedMatrixOperator m C hb‖ ≤ C := + LinearMap.opNorm_extendOfNorm_le fiberFiniteEmbedding_dense hC + (fiberMatrixFinite_norm_le m C hb hC) + +theorem boundedMatrixOperator_entry (hC : 0 ≤ C) (k n : ℤ) : + (boundedMatrixOperator m C hb (lp.single 2 n (1 : ℂ))) k = m k n := by + rw [← fiberFiniteEmbedding_single n 1] + change ((fiberMatrixFinite m C hb).extendOfNorm fiberFiniteEmbedding + (fiberFiniteEmbedding (Finsupp.single n 1))) k = _ + rw [LinearMap.extendOfNorm_eq fiberFiniteEmbedding_dense + ⟨C, fiberMatrixFinite_norm_le m C hb hC⟩] + change fiberMatrixLinear m (Finsupp.single n 1) k = _ + simp [fiberMatrixLinear] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CompactGraphLusin.lean b/lean/OAI/Analysis/FiniteFactor/CompactGraphLusin.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca6846c21c38e9980ec4f03725772c6ce99453b2 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CompactGraphLusin.lean @@ -0,0 +1,86 @@ +import Mathlib.MeasureTheory.Measure.RegularityCompacts +import Mathlib.MeasureTheory.Constructions.Polish.Basic + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Set Filter +open scoped ENNReal +noncomputable section + +/-- A function whose graph is compact above Q is continuous on Q. -/ +theorem continuousOn_of_compact_graph {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + [T2Space X] {f : X → Y} {K : Set (X × Y)} (hK : IsCompact K) + (hgraph : ∀ z ∈ K, f z.1 = z.2) : ContinuousOn f (Prod.fst '' K) := by + let Q := Prod.fst '' K + let : CompactSpace K := isCompact_iff_compactSpace.mp hK + let g : K → X := fun z => z.1.1 + have hg : Continuous g := continuous_fst.comp continuous_subtype_val + have hi : Function.Injective g := by + intro z w h + apply Subtype.ext + apply Prod.ext h + exact (hgraph z.1 z.2).symm.trans ((congrArg f h).trans (hgraph w.1 w.2)) + have hmem (x : Q) : (x.1, f x.1) ∈ K := by + obtain ⟨z,hz,hx⟩ := x.2 + have he : (x.1, f x.1) = z := by + apply Prod.ext hx.symm + simpa only [← hx] using hgraph z hz + rwa [he] + let inv : Q → K := fun x => ⟨(x.1, f x.1), hmem x⟩ + have hinv : Continuous inv := + (hg.isClosedEmbedding hi).isEmbedding.isInducing.continuous_iff.mpr continuous_subtype_val + exact continuousOn_iff_continuous_domRestrict.mpr + (continuous_snd.comp (continuous_subtype_val.comp hinv)) + +/-- Lusin's theorem on Polish spaces, obtained from compact subsets of the +measurable graph. The compact set can be required to lie in a prescribed +Borel conull set. -/ +theorem exists_compact_lusin {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + [PolishSpace X] [PolishSpace Y] [MeasurableSpace X] [MeasurableSpace Y] + [BorelSpace X] [BorelSpace Y] (μ : Measure X) [IsFiniteMeasure μ] + {f : X → Y} (hf : Measurable f) {s : Set X} (hs : MeasurableSet s) + (hfull : ∀ᵐ x ∂μ, x ∈ s) {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ Q, Q ⊆ s ∧ IsCompact Q ∧ μ Qᶜ < ε ∧ ContinuousOn f Q := by + let graph : X → X × Y := fun x => (x,f x) + have hgraph : Measurable graph := measurable_id.prodMk hf + let G : Set (X × Y) := {z | z.1 ∈ s ∧ f z.1 = z.2} + have hG : MeasurableSet G := + (hs.preimage measurable_fst).inter (measurableSet_eq_fun (hf.comp measurable_fst) measurable_snd) + let ν := μ.map graph + obtain ⟨K,hKG,hK,hsmall⟩ := hG.exists_isCompact_sdiff_lt (μ := ν) (measure_ne_top _ _) hε + let Q : Set X := Prod.fst '' K + have hQ : IsCompact Q := hK.image continuous_fst + have hQs : Q ⊆ s := by + rintro x ⟨z,hz,rfl⟩ + exact (hKG hz).1 + have hmem (x : X) : graph x ∈ K ↔ x ∈ Q := by + constructor + · intro hx; exact ⟨graph x,hx,rfl⟩ + · rintro ⟨z,hz,hx⟩ + have he : graph x = z := by + apply Prod.ext hx.symm + simpa only [graph, ← hx] using (hKG hz).2 + rwa [he] + have hpre : graph ⁻¹' (G \ K) = s \ Q := by + ext x + change ((x ∈ s ∧ f x = f x) ∧ graph x ∉ K) ↔ (x ∈ s ∧ x ∉ Q) + rw [hmem] + simp + have hsmall' : μ (s \ Q) < ε := by + have he : ν (G \ K) = μ (s \ Q) := by + rw [Measure.map_apply hgraph (hG.diff hK.isClosed.measurableSet), hpre] + rwa [he] at hsmall + have heq : μ (s \ Q) = μ Qᶜ := by + apply measure_congr + filter_upwards [hfull] with x hx + apply propext + change (x ∈ s ∧ x ∉ Q) ↔ x ∉ Q + simp [hx] + refine ⟨Q,hQs,hQ,heq ▸ hsmall',?_⟩ + exact continuousOn_of_compact_graph hK (fun z hz => (hKG hz).2) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CompactZeroTransfer.lean b/lean/OAI/Analysis/FiniteFactor/CompactZeroTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..5ff500b22096e5ca0dfd53bab8249efd9edfc65e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CompactZeroTransfer.lean @@ -0,0 +1,63 @@ +import Mathlib.MeasureTheory.Measure.Portmanteau +import Mathlib.Topology.Algebra.Order.LiminfLimsup + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology ENNReal NNReal + +/-- Compact subsets carrying uniformly almost all approximating mass carry +all limiting mass as their uniform losses tend to zero. -/ +theorem finiteMeasure_ae_of_compact_approximation {X : Type*} + [MeasurableSpace X] [TopologicalSpace X] [T2Space X] + [OpensMeasurableSpace X] [HasOuterApproxClosed X] + (μ : ℕ → FiniteMeasure X) (ν : FiniteMeasure X) + (hlim : Tendsto μ atTop (𝓝 ν)) (Z : Set X) (hZ : MeasurableSet Z) + (hcompact : ∀ ε : ℝ≥0, 0 < ε → ∃ K, IsCompact K ∧ K ⊆ Z ∧ + ∀ n, (μ n : Measure X) Kᶜ ≤ ε) : + ∀ᵐ x ∂(ν : Measure X), x ∈ Z := by + have hmass : Tendsto (fun n => (μ n : Measure X) Set.univ) atTop + (𝓝 ((ν : Measure X) Set.univ)) := by + simpa only [Function.comp_def, FiniteMeasure.ennreal_mass] using + (ENNReal.continuous_coe.tendsto ν.mass).comp hlim.mass + have hfull : (ν : Measure X) Set.univ ≤ (ν : Measure X) Z := by + apply ENNReal.le_of_forall_pos_le_add + intro ε hε _ + obtain ⟨K,hK,hKZ,hbound⟩ := hcompact ε hε + have hle : ∀ n, (μ n : Measure X) Set.univ ≤ (μ n : Measure X) K + ε := by + intro n + rw [← measure_add_measure_compl hK.isClosed.measurableSet] + exact add_le_add le_rfl (hbound n) + have hsup := Filter.limsup_le_limsup (f := atTop) (Eventually.of_forall hle) + rw [hmass.limsup_eq, limsup_add_const atTop _ _ (by isBoundedDefault) (by isBoundedDefault)] at hsup + exact hsup.trans (add_le_add + ((FiniteMeasure.limsup_measure_closed_le_of_tendsto hlim hK.isClosed).trans + (measure_mono hKZ)) le_rfl) + rw [ae_iff] + change (ν : Measure X) Zᶜ = 0 + rw [measure_compl hZ (by finiteness), tsub_eq_zero_of_le hfull] + +/-- The loss outside a product compact set is bounded by its two marginal +losses. The identity set itself may only be Borel. -/ +theorem measure_pair_compact_loss {X : Type*} [MeasurableSpace X] + (μ : Measure (X × X)) (Q : Set X) (hQ : MeasurableSet Q) + (Z : Set (X × X)) (hZ : ∀ᵐ z ∂μ, z ∈ Z) : + μ ((Q ×ˢ Q) ∩ Z)ᶜ ≤ (μ.map Prod.fst) Qᶜ + (μ.map Prod.snd) Qᶜ := by + have he : (((Q ×ˢ Q) ∩ Z)ᶜ : Set (X × X)) =ᵐ[μ] ((Q ×ˢ Q)ᶜ : Set (X × X)) := by + filter_upwards [hZ] with z hz + apply propext + change (¬ (z ∈ Q ×ˢ Q ∧ z ∈ Z)) ↔ ¬ z ∈ Q ×ˢ Q + simp [hz] + rw [measure_congr he] + have hs : (Q ×ˢ Q)ᶜ = (Prod.fst ⁻¹' Qᶜ) ∪ (Prod.snd ⁻¹' Qᶜ) := by + ext z + simp only [Set.mem_compl_iff, Set.mem_prod, Set.mem_union, Set.mem_preimage] + tauto + rw [hs, Measure.map_apply measurable_fst hQ.compl, + Measure.map_apply measurable_snd hQ.compl] + exact measure_union_le _ _ + +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Contradiction.lean b/lean/OAI/Analysis/FiniteFactor/Contradiction.lean new file mode 100644 index 0000000000000000000000000000000000000000..2a6f3f368f8155117ffeb2aabc56fbfbe77a878c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Contradiction.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.FiniteFactor.Polynomial +import Mathlib.MeasureTheory.Integral.Bochner.Set +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Ring + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology + +/-- Choose the uniform ε before any endpoint coefficient arrays are supplied. -/ +noncomputable def polynomialEpsilon (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : ℝ := + (laurent_product_uniform_lower_bound K D δ hδ).choose + +theorem polynomialEpsilon_pos (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) : + 0 < polynomialEpsilon K D δ hδ := + (laurent_product_uniform_lower_bound K D δ hδ).choose_spec.1 + +noncomputable def coefficientMass (K : ℕ) (A B : ℤ → ℂ) : ℝ := + ∑ n ∈ Finset.range (2*K+1), ‖laurentProductCoefficient K A B (-(n : ℤ))‖ + +theorem polynomialEpsilon_le_mass (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) + (A B : ℤ → ℂ) + (hA : ∀ v : ℤ, -(K : ℤ) ≤ v → v ≤ K → ‖A v‖ ≤ D) + (hB : ∀ v : ℤ, -(K : ℤ) ≤ v → v ≤ K → ‖B v‖ ≤ D) + (hA0 : δ ≤ ‖A 0‖) (hB0 : δ ≤ ‖B 0‖) : + polynomialEpsilon K D δ hδ ≤ coefficientMass K A B := by + obtain ⟨n, hn, hbound⟩ := + (laurent_product_uniform_lower_bound K D δ hδ).choose_spec.2 A B hA hB hA0 hB0 + have hnmem : n ∈ Finset.range (2*K+1) := Finset.mem_range.mpr (by omega) + apply hbound.trans + unfold coefficientMass + exact Finset.single_le_sum (fun (i : ℕ) _ => norm_nonneg (laurentProductCoefficient K A B (-(i : ℤ)))) hnmem + +variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] + +/-- The finite-polynomial lower bound survives expectation on a measurable +event, using only almost-everywhere coefficient bounds. -/ +theorem polynomial_event_integral_lower (K : ℕ) (D δ : ℝ) (hδ : 0 < δ) + (A B : Ω → ℤ → ℂ) {E : Set Ω} (hE : MeasurableSet E) + (hint : IntegrableOn (fun ω => coefficientMass K (A ω) (B ω)) E μ) + (hA : ∀ᵐ ω ∂μ, ω ∈ E → + ∀ v : ℤ, -(K : ℤ) ≤ v → v ≤ K → ‖A ω v‖ ≤ D) + (hB : ∀ᵐ ω ∂μ, ω ∈ E → + ∀ v : ℤ, -(K : ℤ) ≤ v → v ≤ K → ‖B ω v‖ ≤ D) + (hA0 : ∀ᵐ ω ∂μ, ω ∈ E → δ ≤ ‖A ω 0‖) + (hB0 : ∀ᵐ ω ∂μ, ω ∈ E → δ ≤ ‖B ω 0‖) : + polynomialEpsilon K D δ hδ * μ.real E ≤ + ∫ ω in E, coefficientMass K (A ω) (B ω) ∂μ := by + have hlower : ∀ᵐ ω ∂μ, ω ∈ E → + polynomialEpsilon K D δ hδ ≤ coefficientMass K (A ω) (B ω) := by + filter_upwards [hA, hB, hA0, hB0] with ω ha hb ha0 hb0 hω + exact polynomialEpsilon_le_mass K D δ hδ _ _ (ha hω) (hb hω) (ha0 hω) (hb0 hω) + have hi := setIntegral_mono_on_ae + (integrable_const (polynomialEpsilon K D δ hδ)) hint hE hlower + rw [setIntegral_const, smul_eq_mul, mul_comm] at hi + exact hi + +omit [IsFiniteMeasure μ] in +/-- Sum the per-coefficient expectation bounds over the exact finite range. -/ +theorem coefficientMass_integral_upper (K : ℕ) (A B : Ω → ℤ → ℂ) + {E : Set Ω} {a : ℝ} + (hint : ∀ n ≤ 2*K, IntegrableOn + (fun ω => ‖laurentProductCoefficient K (A ω) (B ω) (-(n : ℤ))‖) E μ) + (hupper : ∀ n ≤ 2*K, + (∫ ω in E, ‖laurentProductCoefficient K (A ω) (B ω) (-(n : ℤ))‖ ∂μ) ≤ a) : + (∫ ω in E, coefficientMass K (A ω) (B ω) ∂μ) ≤ (2*(K : ℝ)+1)*a := by + unfold coefficientMass + rw [integral_finsetSum (Finset.range (2*K+1)) (fun n hn => hint n (by simpa using Nat.le_of_lt_succ (Finset.mem_range.mp hn)))] + calc + _ ≤ ∑ n ∈ Finset.range (2*K+1), a := + Finset.sum_le_sum (fun n hn => hupper n (Nat.le_of_lt_succ (Finset.mem_range.mp hn))) + _ = _ := by simp [Nat.cast_add, Nat.cast_mul] + +/-- The numerical relaxation in final-upper-bound. -/ +theorem exponential_tail_relaxation {L : ℝ} (hL : 0 ≤ L) : + Real.exp (-L) + 2 * Real.exp (-L/800) ≤ 3 * Real.exp (-L/10000) := by + 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 no_eventual_small_convolutions + {Ωs : ℕ → Type*} [∀ j, MeasurableSpace (Ωs j)] + (μs : ∀ j, Measure (Ωs j)) [∀ j, IsFiniteMeasure (μs j)] + (K : ℕ → ℕ) (D δ : ℕ → ℝ) (hδ : ∀ j, 0 < δ j) + (A B : ∀ j, Ωs j → ℤ → ℂ) (E : ∀ j, Set (Ωs j)) + (hE : ∀ j, MeasurableSet (E j)) + (hint : ∀ j, IntegrableOn (fun ω => coefficientMass (K j) (A j ω) (B j ω)) (E j) (μs j)) + (hA : ∀ j, ∀ᵐ ω ∂(μs j), ω ∈ E j → + ∀ v : ℤ, -(K j : ℤ) ≤ v → v ≤ K j → ‖A j ω v‖ ≤ D j) + (hB : ∀ j, ∀ᵐ ω ∂(μs j), ω ∈ E j → + ∀ v : ℤ, -(K j : ℤ) ≤ v → v ≤ K j → ‖B j ω v‖ ≤ D j) + (hA0 : ∀ j, ∀ᵐ ω ∂(μs j), ω ∈ E j → δ j ≤ ‖A j ω 0‖) + (hB0 : ∀ j, ∀ᵐ ω ∂(μs j), ω ∈ E j → δ j ≤ ‖B j ω 0‖) + {c : ℝ} (hc : 0 < c) + (hmass : ∀ᶠ j in atTop, c ≤ (μs j).real (E j)) + (hupper : ∀ᶠ j in atTop, + (∫ ω in E j, coefficientMass (K j) (A j ω) (B j ω) ∂(μs j)) ≤ + polynomialEpsilon (K j) (D j) (δ j) (hδ j) / ((j : ℝ)+1)) : False := by + have hsmall : ∀ᶠ (j : ℕ) in atTop, c ≤ 1 / ((j : ℝ)+1) := by + filter_upwards [hmass, hupper] with j hm hu + have hp := polynomialEpsilon_pos (K j) (D j) (δ j) (hδ j) + have hl := polynomial_event_integral_lower (K j) (D j) (δ j) (hδ j) + (A j) (B j) (hE j) (hint j) (hA j) (hB j) (hA0 j) (hB0 j) + have hmul : polynomialEpsilon (K j) (D j) (δ j) (hδ j) * c ≤ + polynomialEpsilon (K j) (D j) (δ j) (hδ j) * (1 / ((j : ℝ)+1)) := by + calc + _ ≤ polynomialEpsilon (K j) (D j) (δ j) (hδ j) * (μs j).real (E j) := + mul_le_mul_of_nonneg_left hm hp.le + _ ≤ _ := hl + _ ≤ polynomialEpsilon (K j) (D j) (δ j) (hδ j) / ((j : ℝ)+1) := hu + _ = _ := by ring + exact (mul_le_mul_iff_right₀ hp).mp (by simpa only [mul_comm] using hmul) + exact (not_le_of_gt hc) (ge_of_tendsto tendsto_one_div_add_atTop_nhds_zero_nat hsmall) + +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Convolution.lean b/lean/OAI/Analysis/FiniteFactor/Convolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..a62f1f2a5f3a8d2ed09979bd40d3a07be18e0c87 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Convolution.lean @@ -0,0 +1,158 @@ +import Mathlib.Analysis.InnerProductSpace.l2Space +import Mathlib.Analysis.InnerProductSpace.Orthogonal +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Ring + +namespace OAI + +namespace FiniteFactor +open scoped ComplexConjugate ENNReal + +/-- Monotonicity follows from the integer cocycle's one-step recurrence; +this includes negative integer indices. -/ +theorem cocycle_antitone_of_step {F w : ℤ → ℝ} + (hF : ∀ k, 0 ≤ F k) (hw : ∀ k, w k ≤ 1) + (hstep : ∀ k, F (k+1) = w k * F k) : Antitone F := by + apply antitone_int_of_succ_le + intro k + rw [hstep] + simpa using mul_le_mul_of_nonneg_right (hw k) (hF k) + +/-- Both cocycle ratio bounds, valid at every integer index. -/ +theorem cocycle_two_ratio_bounds {F G : ℤ → ℝ} + (hF : ∀ k, 0 < F k) (hG : ∀ k, 0 < G k) + (hFa : Antitone F) (hGa : Antitone G) (hGF : ∀ k, G k ≤ F k) + {n v : ℤ} (hn : 0 ≤ n) : + 0 < G (n + v) / F v ∧ + G (n + v) / F v ≤ min (G v / F v) (G (n + v) / F (n + v)) ∧ + min (G v / F v) (G (n + v) / F (n + v)) ≤ 1 := by + have hv : v ≤ n + v := by omega + refine ⟨div_pos (hG _) (hF _), le_min ?_ ?_, ?_⟩ + · exact div_le_div_of_nonneg_right (hGa hv) (hF v).le + · exact div_le_div_of_nonneg_left (hG _).le (hF _) (hFa hv) + · exact (min_le_left _ _).trans ((div_le_one (hF v)).2 (hGF v)) + +/-- Cauchy--Schwarz with a genuine integer translation of the second vector. -/ +theorem shifted_l2_norm_product (ξ γ : lp (fun _ : ℤ => ℂ) 2) (n : ℤ) : + Summable (fun v => ‖ξ v‖ * ‖γ (n + v)‖) ∧ + (∑' v, ‖ξ v‖ * ‖γ (n + v)‖) ≤ ‖ξ‖ * ‖γ‖ := by + have hp : Real.HolderConjugate 2 2 := by norm_num [Real.holderConjugate_iff] + have hξ : HasSum (fun v => ‖ξ v‖ ^ (2 : ℝ)) (‖ξ‖ ^ (2 : ℝ)) := by + simpa using lp.hasSum_norm (by norm_num : (0 : ℝ) < (2 : ℝ≥0∞).toReal) ξ + have hγ : HasSum (fun v => ‖γ (n + v)‖ ^ (2 : ℝ)) (‖γ‖ ^ (2 : ℝ)) := by + have h : HasSum (fun v : ℤ => ‖γ v‖ ^ (2 : ℝ)) (‖γ‖ ^ (2 : ℝ)) := by + simpa using lp.hasSum_norm (by norm_num : (0 : ℝ) < (2 : ℝ≥0∞).toReal) γ + exact (Equiv.addLeft n).hasSum_iff.mpr h + obtain ⟨C, _, hC, hs⟩ := Real.inner_le_Lp_mul_Lq_hasSum_of_nonneg hp + (norm_nonneg ξ) (norm_nonneg γ) (fun v => norm_nonneg (ξ v)) + (fun v => norm_nonneg (γ (n + v))) hξ hγ + exact ⟨hs.summable, hs.tsum_eq ▸ hC⟩ + +/-- The ratio-weighted convolution is absolutely convergent and has the sharp +product-of-L²-norms bound. -/ +theorem weighted_convolution_summable (ξ γ : lp (fun _ : ℤ => ℂ) 2) + (n : ℤ) {r : ℤ → ℝ} (hr0 : ∀ v, 0 ≤ r v) (hr1 : ∀ v, r v ≤ 1) : + Summable (fun v => ‖(r v : ℂ) * ξ v * conj (γ (n + v))‖) ∧ + (∑' v, ‖(r v : ℂ) * ξ v * conj (γ (n + v))‖) ≤ ‖ξ‖ * ‖γ‖ := by + obtain ⟨hs, hb⟩ := shifted_l2_norm_product ξ γ n + have hbound : ∀ v, ‖(r v : ℂ) * ξ v * conj (γ (n + v))‖ ≤ + ‖ξ v‖ * ‖γ (n + v)‖ := by + intro v + simp only [norm_mul, RCLike.norm_conj, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (hr0 v)] + calc + r v * ‖ξ v‖ * ‖γ (n + v)‖ = r v * (‖ξ v‖ * ‖γ (n + v)‖) := mul_assoc _ _ _ + _ ≤ 1 * (‖ξ v‖ * ‖γ (n + v)‖) := mul_le_mul_of_nonneg_right (hr1 v) (by positivity) + _ = _ := one_mul _ + have hsum := hs.of_nonneg_of_le (fun v => norm_nonneg _) hbound + exact ⟨hsum, (hsum.tsum_le_tsum hbound hs).trans hb⟩ + +/-- Exact rescaling used in coefficient-sequences; neither sequence is required + to belong to ℓ². -/ +noncomputable def leftCoefficient (F : ℤ → ℝ) (ξ : ℤ → ℂ) (v : ℤ) : ℂ := + ξ v / (F v : ℂ) + +noncomputable def rightCoefficient (G : ℤ → ℝ) (γ : ℤ → ℂ) (v : ℤ) : ℂ := + (G (-v) : ℂ) * conj (γ (-v)) + +theorem cocycle_convolution_term_eq (F G : ℤ → ℝ) (ξ γ : ℤ → ℂ) (n v : ℤ) : + leftCoefficient F ξ v * rightCoefficient G γ (-n-v) = + (G (n+v) / F v : ℝ) * ξ v * conj (γ (n+v)) := by + have hi : -(-n-v) = n+v := by omega + simp only [leftCoefficient, rightCoefficient, hi, Complex.ofReal_div] + ring + +theorem cocycle_convolution_absolute_convergence + (ξ γ : lp (fun _ : ℤ => ℂ) 2) {F G : ℤ → ℝ} + (hF : ∀ k, 0 < F k) (hG : ∀ k, 0 < G k) + (hFa : Antitone F) (hGa : Antitone G) (hGF : ∀ k, G k ≤ F k) + {n : ℤ} (hn : 0 ≤ n) : + Summable (fun v => ‖leftCoefficient F ξ v * rightCoefficient G γ (-n-v)‖) ∧ + (∑' v, ‖leftCoefficient F ξ v * rightCoefficient G γ (-n-v)‖) ≤ ‖ξ‖ * ‖γ‖ := by + simp only [cocycle_convolution_term_eq] + apply weighted_convolution_summable + · intro v + exact (cocycle_two_ratio_bounds hF hG hFa hGa hGF hn).1.le + · intro v + have h := cocycle_two_ratio_bounds hF hG hFa hGa hGF (v := v) hn + exact h.2.1.trans h.2.2 + +/-- Reindexing the Hilbert inner product gives the exact convolution from +coordinates of the shifted weighted vector. -/ +theorem weighted_shift_convolution_eq_inner + (ξ γ η : lp (fun _ : ℤ => ℂ) 2) (r : ℤ → ℝ) (n : ℤ) + (hη : ∀ v, η (n+v) = (r v : ℂ) * ξ v) : + (∑' v, (r v : ℂ) * ξ v * conj (γ (n+v))) = inner ℂ γ η := by + rw [lp.inner_eq_tsum] + rw [← (Equiv.addLeft n).tsum_eq (fun k : ℤ => inner ℂ (γ k) (η k))] + apply tsum_congr + intro v + change (r v : ℂ) * ξ v * conj (γ (n+v)) = inner ℂ (γ (n+v)) (η (n+v)) + rw [hη] + simp only [RCLike.inner_apply] + +/-- Orthogonality of the image vector to the complementary range produces +convolution-identity, with its original rescaled coefficients and signs. -/ +theorem cocycle_convolution_zero_of_range + (ξ γ η : lp (fun _ : ℤ => ℂ) 2) (F G : ℤ → ℝ) (n : ℤ) + (V : Submodule ℂ (lp (fun _ : ℤ => ℂ) 2)) + (hηV : η ∈ V) (hγV : γ ∈ Vᗮ) + (hη : ∀ v, η (n+v) = (G (n+v) / F v : ℝ) * ξ v) : + (∑' v, leftCoefficient F ξ v * rightCoefficient G γ (-n-v)) = 0 := by + simp only [cocycle_convolution_term_eq] + rw [weighted_shift_convolution_eq_inner ξ γ η _ n hη] + exact (Submodule.mem_orthogonal' V γ).mp hγV η hηV + +/-- Removing any finite part of a zero absolutely convergent series gives its + exact complementary tail, before applying the triangle inequality. -/ +theorem finite_part_eq_neg_tail {t : ℤ → ℂ} (ht : Summable t) + (hzero : ∑' v, t v = 0) (W : Finset ℤ) : + (∑ v ∈ W, t v) = -(∑' v : {v : ℤ // v ∉ W}, t v) := by + have h := ht.sum_add_tsum_subtype_compl W + rw [hzero] at h + exact eq_neg_of_add_eq_zero_left h + +theorem finite_part_norm_le_tail {t : ℤ → ℂ} (ht : Summable (fun v => ‖t v‖)) + (hzero : ∑' v, t v = 0) (W : Finset ℤ) : + ‖∑ v ∈ W, t v‖ ≤ ∑' v : {v : ℤ // v ∉ W}, ‖t v‖ := by + rw [finite_part_eq_neg_tail ht.of_norm hzero W, norm_neg] + exact norm_tsum_le_tsum_norm (ht.subtype _) + +/-- The deterministic omitted-index choice used for both complementary masks. -/ +def omittedIndex (K : ℕ) (n v : ℤ) : ℤ := + if (K : ℤ) < |v| then v else n+v + +theorem omittedIndex_spec (K : ℕ) (n v : ℤ) + (h : (K : ℤ) < |v| ∨ (K : ℤ) < |n+v|) : + (K : ℤ) < |omittedIndex K n v| ∧ + (omittedIndex K n v = v ∨ omittedIndex K n v = n+v) := by + unfold omittedIndex + split_ifs with hv + · exact ⟨hv, Or.inl rfl⟩ + · exact ⟨h.resolve_left hv, Or.inr rfl⟩ + +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CountableMaskedError.lean b/lean/OAI/Analysis/FiniteFactor/CountableMaskedError.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc786139fc376c1422d1b2d41e1a6256c07b31b6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CountableMaskedError.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.FiniteFactor.Convolution +import OAI.Analysis.FiniteFactor.TailEstimate + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Cauchy--Schwarz for genuinely infinite nonnegative coefficient series. -/ +theorem nonnegative_series_cauchy_schwarz {ι : Type*} (f g : ι → ℝ) + (hf : ∀ i, 0 ≤ f i) (hg : ∀ i, 0 ≤ g i) + (hfs : Summable (fun i => f i^2)) (hgs : Summable (fun i => g i^2)) : + Summable (fun i => f i*g i) ∧ + (∑' i, f i*g i) ≤ Real.sqrt (∑' i, f i^2)*Real.sqrt (∑' i, g i^2) := by + have hp : Real.HolderConjugate 2 2 := by norm_num [Real.holderConjugate_iff] + have hF : 0 ≤ ∑' i, f i^2 := tsum_nonneg (fun i => sq_nonneg _) + have hG : 0 ≤ ∑' i, g i^2 := tsum_nonneg (fun i => sq_nonneg _) + have hsf : HasSum (fun i => f i^(2 : ℝ)) ((Real.sqrt (∑' i, f i^2))^(2 : ℝ)) := by + simpa only [Real.rpow_two,Real.sq_sqrt hF] using hfs.hasSum + have hsg : HasSum (fun i => g i^(2 : ℝ)) ((Real.sqrt (∑' i, g i^2))^(2 : ℝ)) := by + simpa only [Real.rpow_two,Real.sq_sqrt hG] using hgs.hasSum + obtain ⟨C,_,hC,hs⟩ := Real.inner_le_Lp_mul_Lq_hasSum_of_nonneg hp + (Real.sqrt_nonneg _) (Real.sqrt_nonneg _) hf hg hsf hsg + exact ⟨hs.summable,hs.tsum_eq ▸ hC⟩ + +/-- Probability-space Cauchy--Schwarz after the pointwise series estimate. +Equivalent to the product-with-counting-measure argument; no independence or +finite truncation is assumed. -/ +theorem countable_error_integral_le {Ω ι : Type*} [MeasurableSpace Ω] [Countable ι] + {μ : Measure Ω} [IsProbabilityMeasure μ] (f g : ι → Ω → ℝ) (δ : ℝ) + (hf : ∀ i, Measurable (f i)) (hg : ∀ i, Measurable (g i)) + (hf0 : ∀ i ω, 0 ≤ f i ω) (hg0 : ∀ i ω, 0 ≤ g i ω) + (hfs : ∀ᵐ ω ∂μ, Summable (fun i => f i ω^2)) + (hgs : ∀ᵐ ω ∂μ, Summable (fun i => g i ω^2)) + (hfi : Integrable (fun ω => ∑' i, f i ω^2) μ) + (hfm : (∫ ω, (∑' i, f i ω^2) ∂μ) ≤ δ) + (hg1 : ∀ᵐ ω ∂μ, (∑' i, g i ω^2) ≤ 1) : + Integrable (fun ω => ∑' i, f i ω*g i ω) μ ∧ + (∫ ω, (∑' i, f i ω*g i ω) ∂μ) ≤ Real.sqrt δ := by + let F := fun ω => ∑' i, f i ω^2 + let S := fun ω => ∑' i, f i ω*g i ω + have hF0 (ω) : 0 ≤ F ω := tsum_nonneg (fun i => sq_nonneg _) + have hFm : Measurable F := Measurable.tsum (fun i => (hf i).pow_const 2) + have hSm : Measurable S := Measurable.tsum (fun i => (hf i).mul (hg i)) + have hS0 (ω) : 0 ≤ S ω := tsum_nonneg (fun i => mul_nonneg (hf0 i ω) (hg0 i ω)) + have hFroot : MemLp (fun ω => Real.sqrt (F ω)) 2 μ := by + apply (memLp_two_iff_integrable_sq (hFm.sqrt.aestronglyMeasurable)).mpr + simpa only [Real.sq_sqrt (hF0 _)] using hfi + have hS : ∀ᵐ ω ∂μ, S ω ≤ Real.sqrt (F ω) := by + filter_upwards [hfs,hgs,hg1] with ω hs ht h1 + have hh := (nonnegative_series_cauchy_schwarz (fun i => f i ω) (fun i => g i ω) + (fun i => hf0 i ω) (fun i => hg0 i ω) hs ht).2 + apply hh.trans + simpa only [Real.sqrt_one,mul_one] using + mul_le_mul_of_nonneg_left (Real.sqrt_le_sqrt h1) (Real.sqrt_nonneg (F ω)) + have hSi : Integrable S μ := (hFroot.integrable (by norm_num)).mono' + hSm.aestronglyMeasurable (hS.mono fun ω h => by rwa [Real.norm_of_nonneg (hS0 ω)]) + refine ⟨hSi,?_⟩ + have hh := integral_mul_le_sqrt_of_square_bounds hFroot (memLp_const (1 : ℝ)) + (Eventually.of_forall fun ω => Real.sqrt_nonneg (F ω)) (Eventually.of_forall fun _ => zero_le_one) + (by simpa only [Real.sq_sqrt (hF0 _)] using hfm) + (by simp : (∫ _ω : Ω, (1 : ℝ)^2 ∂μ) ≤ 1) + apply (integral_mono_ae hSi (hFroot.integrable (by norm_num)) hS).trans + simpa only [mul_one] using hh + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/BadEvents.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/BadEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..710688fe517f64f3f38848d1d1fa153a78d84b66 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/BadEvents.lean @@ -0,0 +1,183 @@ +import OAI.Analysis.FiniteFactor.Coupling.Conditioning +import OAI.Analysis.FiniteFactor.Coupling.Order + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory Filter Finset +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +def eligible (right : Bool) (x u : ℝ) : Prop := if right then u ≤ x else x < u + +instance eligible_decidable (right : Bool) (x u : ℝ) : Decidable (eligible right x u) := by + unfold eligible + infer_instance + +def eligibleIndices {ι : Type*} (right : ι → Bool) (x u : ι → ℝ) (I : Finset ι) : Finset ι := + I.filter (fun i => eligible (right i) (x i) (u i)) + +theorem eligible_measurable (right : Bool) (u : ℝ) : MeasurableSet {x : ℝ | eligible right x u} := by + cases right + · exact measurableSet_Iio + · exact measurableSet_Ici + +theorem eligible_count_measurable {ι : Type*} (right : ι → Bool) (u : ι → ℝ) (I : Finset ι) : + Measurable (fun x : ι → ℝ => (eligibleIndices right x u I).card) := by + unfold eligibleIndices + simp_rw [Finset.card_filter] + apply Finset.measurable_sum + intro i _ + exact Measurable.ite ((eligible_measurable (right i) (u i)).preimage (measurable_pi_apply i)) + measurable_const measurable_const + +/-- A measurable half of the noncrossing event, with the eligibility count +read from the conditioning vector. Taking right=false or right=true gives +the two orientations used in the contradiction. -/ +def badHalfEvent {ι : Type*} (right : ι → Bool) (u : ι → ℝ) (I : Finset ι) (q : ℝ) : + Set ((ι → ℝ) × (ι → ℝ)) := + {z | q/2 ≤ ((eligibleIndices right z.1 u I).card : ℝ) ∧ + ∀ i : I, ¬(eligible (right i) (z.1 i) (u i) ∧ z.2 i ∈ crossingPartner (right i) (u i))} + +theorem badHalfEvent_measurable {ι : Type*} (right : ι → Bool) (u : ι → ℝ) (I : Finset ι) (q : ℝ) : + MeasurableSet (badHalfEvent right u I q) := by + have hcount : Measurable (fun z : (ι → ℝ) × (ι → ℝ) => + ((eligibleIndices right z.1 u I).card : ℝ)) := + (measurable_of_countable (fun n : ℕ => (n : ℝ))).comp + ((eligible_count_measurable right u I).comp measurable_fst) + have hq : MeasurableSet {z : (ι → ℝ) × (ι → ℝ) | q/2 ≤ ((eligibleIndices right z.1 u I).card : ℝ)} := + measurableSet_le measurable_const hcount + have hi (i : I) : MeasurableSet {z : (ι → ℝ) × (ι → ℝ) | + ¬(eligible (right i) (z.1 i) (u i) ∧ z.2 i ∈ crossingPartner (right i) (u i))} := + (((eligible_measurable (right i) (u i)).preimage + ((measurable_pi_apply (i : ι)).comp measurable_fst)).inter + ((crossingPartner_measurable (right i) (u i)).preimage + ((measurable_pi_apply (i : ι)).comp measurable_snd))).compl + convert hq.inter (MeasurableSet.iInter hi) using 1 + ext z + simp [badHalfEvent] + +theorem badHalfEvent_section {ι : Type*} (right : ι → Bool) (x u : ι → ℝ) + (I : Finset ι) (q : ℝ) (hq : q/2 ≤ ((eligibleIndices right x u I).card : ℝ)) : + Prod.mk x ⁻¹' badHalfEvent right u I q = + Set.pi (eligibleIndices right x u I : Set ι) (fun i => (crossingPartner (right i) (u i))ᶜ) := by + ext y + simp only [Set.mem_preimage, badHalfEvent, Set.mem_ofPred_eq, Set.mem_pi, + Finset.mem_coe, eligibleIndices, Finset.mem_filter, Set.mem_compl_iff] + constructor + · intro h i hi + exact fun hy => h.2 ⟨i, hi.1⟩ ⟨hi.2, hy⟩ + · intro h + refine ⟨hq, fun i hi => ?_⟩ + exact h i ⟨i.2, hi.1⟩ hi.2 + +theorem vectorPosterior_badHalf_bound {ι : Type*} + (p : ι → CouplingParameters) (right : ι → Bool) (w : ι → Fin 2) + (x u : ι → ℝ) (I : Finset ι) (q m ρ L : ℝ) + (hx : ∀ i ∈ I, x i ∈ Set.Ico 0 1) + (hu : ∀ i ∈ I, (p i).width (w i) ≤ u i ∧ u i ≤ 1-(p i).width (w i)) + (hρ : ∀ i ∈ I, (p i).rho (w i) = ρ) + (hρ0 : 0 ≤ ρ) (hq : m/20 ≤ q) (hL : L ≤ m*ρ) : + vectorPosterior p right x (Prod.mk x ⁻¹' badHalfEvent right u I q) ≤ + ENNReal.ofReal (Real.exp (-L/400)) := by + by_cases hn : q/2 ≤ ((eligibleIndices right x u I).card : ℝ) + · rw [badHalfEvent_section right x u I q hn] + apply vectorPosterior_noncrossing_source_bound p right w x u (eligibleIndices right x u I) m ρ L + · intro i hi + exact hx i (Finset.mem_filter.mp hi).1 + · intro i hi + exact hu i (Finset.mem_filter.mp hi).1 + · intro i hi + exact (Finset.mem_filter.mp hi).2 + · intro i hi + exact hρ i (Finset.mem_filter.mp hi).1 + · exact hρ0 + · linarith + · exact hL + · have he : Prod.mk x ⁻¹' badHalfEvent right u I q = ∅ := by + ext y + simp [badHalfEvent, hn] + rw [he, measure_empty] + exact zero_le + +theorem vectorEndpoint_unitCube {ι : Type*} [Countable ι] + (p : ι → CouplingParameters) (right : ι → Bool) : + ∀ᵐ x ∂(vectorCoupling p).map (vectorEndpoint right), ∀ i, x i ∈ Set.Ico 0 1 := by + rw [vectorEndpoint_law, ae_all_iff] + intro i + have hi : ∀ᵐ t ∂(p i).selectedLaw true (right i), t ∈ Set.Ico 0 1 := + (withDensity_absolutelyContinuous _ _).ae_le (ae_restrict_mem measurableSet_Ico) + have hh := Measure.infinitePi_map_eval (fun i => (p i).selectedLaw true (right i)) i + rw [← hh] at hi + exact ae_of_ae_map (measurable_pi_apply i).aemeasurable hi + +/-- Actual conditional bound for each oriented bad event, ready for the +countably infinite masked-sum theorem. No conditional-independence assumption +or posterior bound is an input. -/ +theorem badHalf_condExp_bound {ι : Type*} [Countable ι] + (p : ι → CouplingParameters) (right : ι → Bool) (w : ι → Fin 2) + (u : ι → ℝ) (I : Finset ι) (q m ρ L : ℝ) + (hu : ∀ i ∈ I, (p i).width (w i) ≤ u i ∧ u i ≤ 1-(p i).width (w i)) + (hρ : ∀ i ∈ I, (p i).rho (w i) = ρ) + (hρ0 : 0 ≤ ρ) (hq : m/20 ≤ q) (hL : L ≤ m*ρ) : + ∀ᵐ ω ∂vectorCoupling p, + (vectorCoupling p)[ + (fun ω => (badHalfEvent right u I q).indicator (fun _ => (1 : ℝ)) + (vectorEndpoint right ω, vectorEndpoint (fun i => !right i) ω)) | + (inferInstance : MeasurableSpace (ι → ℝ)).comap (vectorEndpoint right)] ω ≤ Real.exp (-L/400) := by + apply vector_condExp_event_le p right (badHalfEvent_measurable right u I q) + filter_upwards [vectorEndpoint_unitCube p right] with x hx + have hh := vectorPosterior_badHalf_bound p right w x u I q m ρ L (fun i _ => hx i) hu hρ hρ0 hq hL + have hh' := ENNReal.toReal_mono ENNReal.ofReal_ne_top hh + simpa only [measureReal_def, ENNReal.toReal_ofReal (Real.exp_pos _).le] using hh' + +/-- On ordered noncrossing pairs, the two eligibility counts are complementary. +Thus the strict second half of the source bad event lies in the reverse +badHalfEvent; using a weak inequality there only enlarges that event. -/ +theorem noncrossing_eligible_complement {ι : Type*} (x y u : ι → ℝ) (I : Finset ι) + (hxy : ∀ i ∈ I, x i ≤ y i) (hn : ∀ i ∈ I, ¬(x i < u i ∧ u i ≤ y i)) : + (eligibleIndices (fun _ => false) x u I).card + + (eligibleIndices (fun _ => true) y u I).card = I.card := by + have he : eligibleIndices (fun _ => true) y u I = I.filter (fun i => ¬(x i < u i)) := by + ext i + simp only [eligibleIndices, Finset.mem_filter, eligible, ↓reduceIte] + constructor + · rintro ⟨hi, hy⟩ + exact ⟨hi, fun hx => hn i hi ⟨hx, hy⟩⟩ + · rintro ⟨hi, hx⟩ + exact ⟨hi, le_trans (le_of_not_gt hx) (hxy i hi)⟩ + rw [he] + exact Finset.card_filter_add_card_filter_not (fun i => x i < u i) + +/-- Exact source second-half event is contained in the reverse event whose +conditional estimate was proved above. All coordinates in I are accounted for. -/ +theorem second_bad_half_in_reverse {ι : Type*} (x y u : ι → ℝ) (I : Finset ι) + (hxy : ∀ i ∈ I, x i ≤ y i) + (hn : ∀ i ∈ I, ¬(x i < u i ∧ u i ≤ y i)) + (hcount : ((eligibleIndices (fun _ => false) x u I).card : ℝ) < (I.card : ℝ)/2) : + (y,x) ∈ badHalfEvent (fun _ => true) u I I.card := by + constructor + · have he := noncrossing_eligible_complement x y u I hxy hn + have her : ((eligibleIndices (fun _ => false) x u I).card : ℝ) + + ((eligibleIndices (fun _ => true) y u I).card : ℝ) = (I.card : ℝ) := by exact_mod_cast he + linarith + · intro i hi + exact hn i i.2 ⟨hi.2, hi.1⟩ + +/-- The pointwise orderedness needed for the complementary-event argument is +itself a theorem about the actual full augmented law. -/ +theorem vectorCoupling_ordered {ι : Type*} [Countable ι] (p : ι → CouplingParameters) : + vectorCoupling p {ω | ∀ i, (ω i).2.1 ≤ (ω i).2.2} = 1 := by + have he : {ω : ι → Fin 6 × (ℝ × ℝ) | ∀ i, (ω i).2.1 ≤ (ω i).2.2} = + Set.pi Set.univ (fun _ : ι => {z : Fin 6 × (ℝ × ℝ) | z.2.1 ≤ z.2.2}) := by ext ω; simp + rw [he, vectorCoupling, Measure.infinitePi_pi_univ] + · simp [labelledCoupling_ordered] + · intro i + exact orderedPairs_measurable.preimage measurable_snd + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Bayes.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Bayes.lean new file mode 100644 index 0000000000000000000000000000000000000000..1335a384edf0e1275c9464f4d194284f9fa493f6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Bayes.lean @@ -0,0 +1,131 @@ +import OAI.Analysis.FiniteFactor.Coupling.Crossing +import OAI.Analysis.FiniteFactor.Coupling.Marginals +import Mathlib.Probability.Kernel.Basic + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters +variable (p : CouplingParameters) + +theorem endpointDensity_measurable (right : Bool) : Measurable (p.endpointDensity right) := by + apply Measurable.add measurable_const + exact Finset.measurable_sum _ fun i _ => measurable_const.mul (p.endpointComponentDensity_measurable right i) + +theorem posteriorMass_measurable (right : Bool) (i : Fin 5) : + Measurable (fun t => p.posteriorMass right t i) := + (measurable_const.mul (p.endpointComponentDensity_measurable right i)).div + (p.endpointDensity_measurable right) + +def posteriorKernel (right : Bool) : Kernel ℝ ℝ where + toFun := p.posteriorLaw right + measurable' := by + apply Measure.measurable_of_measurable_coe + intro S hS + simp only [posteriorLaw, Measure.add_apply, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul] + apply Measurable.add + · exact (measurable_const.div (p.endpointDensity_measurable right)).ennreal_ofReal.mul + ((Measure.measurable_coe hS).comp Measure.measurable_dirac) + · exact Finset.measurable_sum _ fun i _ => + (p.posteriorMass_measurable right i).ennreal_ofReal.mul measurable_const + +instance posteriorKernel_markov (right : Bool) : IsMarkovKernel (p.posteriorKernel right) := + ⟨fun t => p.posteriorLaw_probability right t⟩ + +theorem posteriorLaw_weighted (right : Bool) (t : ℝ) (S : Set ℝ) : + ENNReal.ofReal (p.endpointDensity right t) * p.posteriorLaw right t S = + ENNReal.ofReal p.diagonalMass * Measure.dirac t S + + ∑ i, ENNReal.ofReal (p.replacementMass i) * + ENNReal.ofReal (p.endpointComponentDensity right i t) * p.endpointComponentLaw (!right) i S := by + have hh := p.diagonalMass_pos.trans_le (p.endpointDensity_lower right t) + have hc (a : ℝ) : p.endpointDensity right t * (a / p.endpointDensity right t) = a := by + field_simp [hh.ne'] + simp only [posteriorLaw, Measure.add_apply, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, + mul_add, Finset.mul_sum] + congr 1 + · rw [← mul_assoc, ← ENNReal.ofReal_mul hh.le, hc] + · apply Finset.sum_congr rfl + intro i _ + rw [← mul_assoc, ← ENNReal.ofReal_mul hh.le, posteriorMass, hc, + ENNReal.ofReal_mul (p.replacementMass_nonneg i)] + +theorem coupling_rectangle {A B : Set ℝ} (hA : MeasurableSet A) (hB : MeasurableSet B) : + p.coupling (A ×ˢ B) = ENNReal.ofReal p.diagonalMass * unitIntervalMeasure (A ∩ B) + + ∑ i, ENNReal.ofReal (p.replacementMass i) * + p.endpointComponentLaw false i A * p.endpointComponentLaw true i B := by + have hm : Measurable (fun t : ℝ => (t,t)) := measurable_id.prodMk measurable_id + have hdiag : (unitIntervalMeasure.map (fun t => (t,t))) (A ×ˢ B) = + unitIntervalMeasure (A ∩ B) := by + rw [Measure.map_apply hm (hA.prod hB)] + rfl + simp [p.coupling_eq_sum, Fin.sum_univ_succ, labelMass, + pairComponentLaw, smul_eq_mul, hdiag, Measure.prod_prod, mul_assoc] + +/-- The posterior formula satisfies the defining conditional-law identity on +all measurable rectangles, in either endpoint orientation. -/ +theorem posterior_rectangle_integral (right : Bool) {A B : Set ℝ} + (hA : MeasurableSet A) (hB : MeasurableSet B) : + (∫⁻ t in A, p.posteriorLaw right t B ∂(p.coupling.map (endpoint right))) = + ENNReal.ofReal p.diagonalMass * unitIntervalMeasure (A ∩ B) + + ∑ i, ENNReal.ofReal (p.replacementMass i) * + p.endpointComponentLaw right i A * p.endpointComponentLaw (!right) i B := by + have hk : Measurable (fun t => p.posteriorLaw right t B) := + (Measure.measurable_coe hB).comp (p.posteriorKernel right).measurable + rw [p.coupling_endpoint_density, + setLIntegral_withDensity_eq_setLIntegral_mul unitIntervalMeasure + (p.endpointDensity_measurable right).ennreal_ofReal hk hA] + change (∫⁻ t in A, ENNReal.ofReal (p.endpointDensity right t) * p.posteriorLaw right t B + ∂unitIntervalMeasure) = _ + simp_rw [p.posteriorLaw_weighted] + have hd : Measurable (fun t : ℝ => Measure.dirac t B) := + (Measure.measurable_coe hB).comp Measure.measurable_dirac + rw [lintegral_add_left + (f := fun t => ENNReal.ofReal p.diagonalMass * Measure.dirac t B) + (g := fun t => ∑ i, ENNReal.ofReal (p.replacementMass i) * + ENNReal.ofReal (p.endpointComponentDensity right i t) * p.endpointComponentLaw (!right) i B) + (measurable_const.mul hd), + lintegral_finsetSum (f := fun i t => ENNReal.ofReal (p.replacementMass i) * + ENNReal.ofReal (p.endpointComponentDensity right i t) * p.endpointComponentLaw (!right) i B) + Finset.univ (fun i _ => + (measurable_const.mul (p.endpointComponentDensity_measurable right i).ennreal_ofReal).mul measurable_const)] + congr 1 + · rw [lintegral_const_mul _ hd] + simp only [Measure.dirac_apply' _ hB] + rw [lintegral_indicator hB] + simp [Measure.restrict_apply hB, Set.inter_comm] + · apply Finset.sum_congr rfl + intro i _ + have hi := (p.endpointComponentDensity_measurable right i).ennreal_ofReal + rw [lintegral_mul_const (p.endpointComponentLaw (!right) i B) + (f := fun t => ENNReal.ofReal (p.replacementMass i) * ENNReal.ofReal (p.endpointComponentDensity right i t)) + (measurable_const.mul hi), lintegral_const_mul _ hi] + simp only [endpointComponentLaw] + rw [withDensity_apply _ hA] + +/-- Genuine forward disintegration of the constructed coupling. -/ +theorem conditional_given_x {A B : Set ℝ} (hA : MeasurableSet A) (hB : MeasurableSet B) : + (∫⁻ t in A, p.posteriorKernel false t B ∂(p.coupling.map Prod.fst)) = p.coupling (A ×ˢ B) := by + rw [p.coupling_rectangle hA hB] + exact p.posterior_rectangle_integral false hA hB + +/-- Genuine reverse disintegration of the same coupling. -/ +theorem conditional_given_y {A B : Set ℝ} (hA : MeasurableSet A) (hB : MeasurableSet B) : + (∫⁻ t in A, p.posteriorKernel true t B ∂(p.coupling.map Prod.snd)) = p.coupling (B ×ˢ A) := by + rw [p.coupling_rectangle hB hA] + have hi := p.posterior_rectangle_integral true hA hB + simp only [Bool.not_true] at hi + change (∫⁻ t in A, p.posteriorLaw true t B ∂(p.coupling.map (endpoint true))) = _ + rw [hi, Set.inter_comm A B] + congr 1 + apply Finset.sum_congr rfl + intro i _ + ring + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/BlockLimit.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/BlockLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..ee28d0f0daa17ae3291c8635bfe2211eb979d5a8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/BlockLimit.lean @@ -0,0 +1,113 @@ +import OAI.Analysis.FiniteFactor.Coupling.Limit +import OAI.Analysis.FiniteFactor.Coupling.Infinite + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped Topology ENNReal +noncomputable section +namespace CouplingParameters + +/-- The source coordinates, retaining the block and the position in that block. -/ +abbrev BlockCoordinate (m : ℕ → ℕ) := Σ s : ℕ, Fin (m s) + +def blockPrefix (m : ℕ → ℕ) (n : ℕ) : Finset (BlockCoordinate m) := + (Finset.range n).sigma (fun _ => Finset.univ) + +theorem mem_blockPrefix (m : ℕ → ℕ) (n : ℕ) (i : BlockCoordinate m) : + i ∈ blockPrefix m n ↔ i.1 < n := by simp [blockPrefix] + +theorem blockPrefix_mono (m : ℕ → ℕ) : Monotone (blockPrefix m) := by + intro n k hnk i hi + exact (mem_blockPrefix m k i).2 (lt_of_lt_of_le ((mem_blockPrefix m n i).1 hi) hnk) + +theorem blockPrefix_cover (m : ℕ → ℕ) (J : Finset (BlockCoordinate m)) : + ∃ n, J ⊆ blockPrefix m n := by + refine ⟨J.sup (fun i => i.1) + 1, fun i hi => ?_⟩ + exact (mem_blockPrefix m _ i).2 (Nat.lt_succ_of_le (Finset.le_sup (f := fun i => i.1) hi)) + +theorem blockPrefix_energy (p : ℕ → CouplingParameters) (m : ℕ → ℕ) + (hm : ∀ s, (p s).m = (m s : ℝ)) (j : ℕ) + (htag : ∀ s, (p s).tagged = decide (s=j)) + (hκ : Summable (fun s => (p s).kappa^2)) + (right : BlockCoordinate m → Bool) (n : ℕ) : + (∫ x, prefixDensity (fun i : BlockCoordinate m => p i.1) right (blockPrefix m n) x ^ 2 + ∂Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)) ≤ + Real.exp (20*(2*(∑' s, (p s).kappa^2)+1)) := by + apply (prefixDensity_energy _ right _).trans + apply Real.exp_le_exp.mpr + have heq : (∑ i ∈ blockPrefix m n, 20*(2*(p i.1).kappa^2/(p i.1).m + (p i.1).tagMass)) = + 20 * ∑ s ∈ Finset.range n, (p s).m * (2*(p s).kappa^2/(p s).m + (p s).tagMass) := by + rw [blockPrefix, Finset.sum_sigma] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro s _ + rw [hm s] + ring + rw [heq] + exact mul_le_mul_of_nonneg_left (uniform_block_budget p j htag hκ (Finset.range n)) (by norm_num) + +theorem infinite_block_source_density (p : ℕ → CouplingParameters) (m : ℕ → ℕ) + (hm : ∀ s, (p s).m = (m s : ℝ)) (j : ℕ) + (htag : ∀ s, (p s).tagged = decide (s=j)) + (hκ : ∀ s, (p s).kappa = sourceKappa s) (right : BlockCoordinate m → Bool) : + ∃ g : (BlockCoordinate m → ℝ) → ℝ, + MemLp g 2 (Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)) ∧ + (∀ᵐ x ∂Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure), 0 ≤ g x) ∧ + (∫ x, g x ^ 2 ∂Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)) ≤ + Real.exp (20*(2*(∑' s, sourceKappa s ^ 2)+1)) ∧ + Measure.infinitePi (fun i : BlockCoordinate m => (p i.1).selectedLaw true (right i)) = + (Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)).withDensity + (fun x => ENNReal.ofReal (g x)) := by + apply infiniteEndpoint_density_of_prefix_bound _ right (blockPrefix m) + (blockPrefix_mono m) (blockPrefix_cover m) + intro n + have hs : Summable (fun s => (p s).kappa^2) := by simpa only [hκ] using sourceKappa_sq_summable + simpa only [hκ] using blockPrefix_energy p m hm j htag hs right n + +/-- Actual augmented law on the block-indexed coordinates. -/ +def blockProductCoupling (p : ℕ → CouplingParameters) (m : ℕ → ℕ) : + Measure (BlockCoordinate m → Fin 6 × (ℝ × ℝ)) := + Measure.infinitePi (fun i => (p i.1).labelledCoupling) + +instance blockProductCoupling_probability (p : ℕ → CouplingParameters) (m : ℕ → ℕ) : + IsProbabilityMeasure (blockProductCoupling p m) := by unfold blockProductCoupling; infer_instance + +def blockProductEndpoint {m : ℕ → ℕ} (right : BlockCoordinate m → Bool) + (ω : BlockCoordinate m → Fin 6 × (ℝ × ℝ)) (i : BlockCoordinate m) : ℝ := + endpoint (right i) (ω i).2 + +theorem blockProductEndpoint_law (p : ℕ → CouplingParameters) (m : ℕ → ℕ) + (right : BlockCoordinate m → Bool) : + (blockProductCoupling p m).map (blockProductEndpoint right) = + Measure.infinitePi (fun i : BlockCoordinate m => (p i.1).selectedLaw true (right i)) := by + unfold blockProductCoupling blockProductEndpoint + rw [Measure.infinitePi_map_pi _ (f := fun (i : BlockCoordinate m) (z : Fin 6 × (ℝ × ℝ)) => endpoint (right i) z.2) + (fun i => (endpoint_measurable (right i)).comp measurable_snd)] + simp_rw [labelled_endpoint_density] + rfl + +/-- The density belongs to the actual law of the selected endpoint map, rather +than only to an abstract measure with matching finite moments. -/ +theorem blockProductEndpoint_L2_density (p : ℕ → CouplingParameters) (m : ℕ → ℕ) + (hm : ∀ s, (p s).m = (m s : ℝ)) (j : ℕ) + (htag : ∀ s, (p s).tagged = decide (s=j)) + (hκ : ∀ s, (p s).kappa = sourceKappa s) (right : BlockCoordinate m → Bool) : + ∃ g : (BlockCoordinate m → ℝ) → ℝ, + MemLp g 2 (Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)) ∧ + (∀ᵐ x ∂Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure), 0 ≤ g x) ∧ + (∫ x, g x ^ 2 ∂Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)) ≤ + Real.exp (20*(2*(∑' s, sourceKappa s ^ 2)+1)) ∧ + (blockProductCoupling p m).map (blockProductEndpoint right) = + (Measure.infinitePi (fun _ : BlockCoordinate m => unitIntervalMeasure)).withDensity + (fun x => ENNReal.ofReal (g x)) := by + rw [blockProductEndpoint_law] + exact infinite_block_source_density p m hm j htag hκ right + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Bounds.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Bounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..5216d696b8db2372d09bc15942c3c8383535e1e7 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Bounds.lean @@ -0,0 +1,113 @@ +import OAI.Analysis.FiniteFactor.Coupling.Mixture + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +noncomputable section +namespace CouplingParameters +variable (p : CouplingParameters) + +def minimumLength : Fin 5 → ℝ := + ![p.width 0/2, p.width 0/2, p.width 1/2, p.width 1/2, 1/p.m] + +theorem minimumLength_pos (i : Fin 5) : 0 < p.minimumLength i := by + have h₀ := p.width_pos 0 + have h₁ := p.width_pos 1 + fin_cases i <;> simp [minimumLength] <;> linarith [p.m_pos] + +theorem minimumLength_le (right : Bool) (i : Fin 5) : + p.minimumLength i ≤ p.endpointLength right i := by + have h₀ := p.width_upper 0 + have h₁ := p.width_upper 1 + cases right <;> fin_cases i <;> + simp [minimumLength, endpointLength, leftLength, rightLength] <;> linarith + +theorem weighted_minimumLength_le (i : Fin 5) : + p.replacementMass i / p.minimumLength i ≤ ![2*p.kappa, 2*p.kappa, 2*p.kappa, 2*p.kappa, 1] i := by + have h₀ := p.rho_div_width_le 0 + have h₁ := p.rho_div_width_le 1 + have he (w r : ℝ) : r / (w/2) = 2*(r/w) := by ring + fin_cases i <;> dsimp [replacementMass, minimumLength] + all_goals try { rw [he]; linarith } + unfold tagMass + split + · rw [div_self (ne_of_gt (one_div_pos.mpr p.m_pos))] + · simp + +theorem weighted_inverse_length_le (right : Bool) (i : Fin 5) : + p.replacementMass i * (p.endpointLength right i)⁻¹ ≤ + ![2*p.kappa, 2*p.kappa, 2*p.kappa, 2*p.kappa, 1] i := by + rw [← div_eq_mul_inv] + exact (div_le_div_of_nonneg_left (p.replacementMass_nonneg i) + (p.minimumLength_pos i) (p.minimumLength_le right i)).trans + (p.weighted_minimumLength_le i) + +theorem endpointDensity_upper (right : Bool) (t : ℝ) : + p.endpointDensity right t ≤ 2+8*p.kappa := by + have hb : (∑ i, p.replacementMass i * p.endpointComponentDensity right i t) ≤ + ∑ i : Fin 5, ![2*p.kappa, 2*p.kappa, 2*p.kappa, 2*p.kappa, 1] i := by + apply Finset.sum_le_sum + intro i _ + exact (mul_le_mul_of_nonneg_left (intervalDensity_le (p.endpointLength_pos right i).le t) + (p.replacementMass_nonneg i)).trans (p.weighted_inverse_length_le right i) + simp [Fin.sum_univ_succ] at hb + change p.diagonalMass + _ ≤ _ + simp [Fin.sum_univ_succ] + linarith [p.diagonalMass_le] + +theorem endpointDensity_lt_ten (right : Bool) (t : ℝ) : + p.endpointDensity right t < 10 := by + linarith [p.endpointDensity_upper right t, p.kappa_le] + +theorem weighted_minimumLength_energy (i : Fin 5) : + (p.replacementMass i)^2 / p.minimumLength i = + ![2*p.kappa^2/p.m, 2*p.kappa^2/p.m, 2*p.kappa^2/p.m, 2*p.kappa^2/p.m, p.tagMass] i := by + have he (w r : ℝ) : r^2 / (w/2) = 2*(r^2/w) := by ring + fin_cases i <;> dsimp [replacementMass, minimumLength] + all_goals try { rw [he, p.rho_energy]; ring } + unfold tagMass + split + · field_simp + · simp + +theorem endpointDensity_energy (right : Bool) : + (∫ t, p.endpointDensity right t ^ 2 ∂unitIntervalMeasure) ≤ + 1 + 40*p.kappa^2/p.m + 5*p.tagMass := by + have hbase := mixtureDensity_energy_le p.diagonalMass p.replacementMass + (p.endpointComponentDensity right) + (fun i => (memLp_const _).indicator (p.endpointInterval_measurable right i)) + (fun i => intervalDensity_integral (p.endpointInterval_measurable right i) + (p.endpointLength_pos right i) (p.endpointInterval_mass right i)) + p.mass_sum (fun i => (p.endpointLength right i)⁻¹) + (fun i => by + unfold endpointComponentDensity + rw [intervalDensity_energy (p.endpointInterval_measurable right i) + (p.endpointLength_pos right i) (p.endpointInterval_mass right i)] + linarith) + have hb : (∑ i, p.replacementMass i ^ 2 * (p.endpointLength right i)⁻¹) ≤ + ∑ i : Fin 5, ![2*p.kappa^2/p.m, 2*p.kappa^2/p.m, 2*p.kappa^2/p.m, 2*p.kappa^2/p.m, p.tagMass] i := by + apply Finset.sum_le_sum + intro i _ + rw [← div_eq_mul_inv, ← p.weighted_minimumLength_energy i] + exact div_le_div_of_nonneg_left (sq_nonneg _) (p.minimumLength_pos i) (p.minimumLength_le right i) + simp only [Fintype.card_fin] at hbase + simp [Fin.sum_univ_succ] at hb + change (∫ t, p.endpointDensity right t ^ 2 ∂unitIntervalMeasure) ≤ _ at hbase + simp [Fin.sum_univ_succ] at hbase + ring_nf at hbase hb ⊢ + linarith + +theorem endpointDensity_source_energy (right : Bool) : + (∫ t, p.endpointDensity right t ^ 2 ∂unitIntervalMeasure) ≤ + 1 + 20*(2*p.kappa^2/p.m + p.tagMass) := by + have := p.endpointDensity_energy right + have hn := p.tagMass_nonneg + ring_nf at this ⊢ + linarith + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Conditioning.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Conditioning.lean new file mode 100644 index 0000000000000000000000000000000000000000..13698376249a072be95b214f7fbd7409e0853431 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Conditioning.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.FiniteFactor.Coupling.Noncrossing +import OAI.Analysis.FiniteFactor.TailEstimate +import Mathlib.Probability.Kernel.CondDistrib + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +/-- Identification with mathlib's regular conditional distribution. -/ +theorem vectorPosterior_eq_condDistrib {ι : Type*} [Countable ι] + (p : ι → CouplingParameters) (right : ι → Bool) : + condDistrib (vectorEndpoint (fun i => !right i)) (vectorEndpoint right) (vectorCoupling p) + =ᵐ[(vectorCoupling p).map (vectorEndpoint right)] vectorPosterior p right := + condDistrib_ae_eq_of_measure_eq_compProd_of_measurable + (vectorEndpoint_measurable right) (vectorEndpoint_measurable (fun i => !right i)) + (vectorPosterior_disintegration p right).symm + +/-- A bound on the proved full-vector posterior is a conditional-expectation +bound on the original augmented probability space. -/ +theorem vector_condExp_event_le {ι : Type*} [Countable ι] + (p : ι → CouplingParameters) (right : ι → Bool) + {B : Set ((ι → ℝ) × (ι → ℝ))} (hB : MeasurableSet B) {δ : ℝ} + (hb : ∀ᵐ x ∂(vectorCoupling p).map (vectorEndpoint right), + (vectorPosterior p right x).real (Prod.mk x ⁻¹' B) ≤ δ) : + ∀ᵐ ω ∂vectorCoupling p, + (vectorCoupling p)[ + (fun ω => B.indicator (fun _ => (1 : ℝ)) + (vectorEndpoint right ω, vectorEndpoint (fun i => !right i) ω)) | + (inferInstance : MeasurableSpace (ι → ℝ)).comap (vectorEndpoint right)] ω ≤ δ := by + have hX := vectorEndpoint_measurable right + have hY := vectorEndpoint_measurable (fun i => !right i) + have hint : Integrable (B.indicator (fun _ => (1 : ℝ))) + ((vectorCoupling p).map (fun ω => (vectorEndpoint right ω, vectorEndpoint (fun i => !right i) ω))) := + (integrable_const _).indicator hB + have hc := condExp_prod_ae_eq_integral_condDistrib' hX hY.aemeasurable hint + have hk := ae_eq_comp hX.aemeasurable (vectorPosterior_eq_condDistrib p right) + have hb' := ae_of_ae_map hX.aemeasurable hb + filter_upwards [hc, hk, hb'] with ω hcω hkω hbω + simp only [Function.comp_apply] at hkω + rw [hcω, hkω] + have he : (fun y => B.indicator (fun _ => (1 : ℝ)) (vectorEndpoint right ω, y)) = + (Prod.mk (vectorEndpoint right ω) ⁻¹' B).indicator (fun _ => (1 : ℝ)) := rfl + rw [he, integral_indicator (measurable_prodMk_left hB), setIntegral_const] + simpa using hbω + +/-- The countably infinite masked estimate, instantiated on the actual +augmented coupling using the verified posterior. No conditional probability +hypothesis remains to be supplied independently of the kernel. -/ +theorem vector_mask_tsum_integral_le {ι V : Type*} [Countable ι] [Countable V] + (p : ι → CouplingParameters) (right : ι → Bool) + (B : V → Set ((ι → ℝ) × (ι → ℝ))) (hB : ∀ v, MeasurableSet (B v)) + (f : V → (ι → Fin 6 × (ℝ × ℝ)) → ℝ) (δ : ℝ) + (hf : ∀ v, Integrable (f v) (vectorCoupling p)) + (hfm : ∀ v, StronglyMeasurable[(inferInstance : MeasurableSpace (ι → ℝ)).comap (vectorEndpoint right)] (f v)) + (hf0 : ∀ v ω, 0 ≤ f v ω) + (hsum : ∀ᵐ ω ∂vectorCoupling p, Summable (fun v => f v ω)) + (hint : Integrable (fun ω => ∑' v, f v ω) (vectorCoupling p)) + (hb : ∀ v, ∀ᵐ x ∂(vectorCoupling p).map (vectorEndpoint right), + (vectorPosterior p right x).real (Prod.mk x ⁻¹' B v) ≤ δ) : + (∫ ω, (∑' v, ((fun ω => (vectorEndpoint right ω, + vectorEndpoint (fun i => !right i) ω)) ⁻¹' B v).indicator (f v) ω) ∂vectorCoupling p) ≤ + δ * ∫ ω, (∑' v, f v ω) ∂vectorCoupling p := by + apply conditional_mask_tsum_integral_le (vectorEndpoint_measurable right).comap_le + hf hfm hf0 + (fun v => (hB v).preimage ((vectorEndpoint_measurable right).prodMk + (vectorEndpoint_measurable (fun i => !right i)))) hsum hint + intro v + exact vector_condExp_event_le p right (hB v) (hb v) + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/CoordinateMass.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/CoordinateMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..1ec6ba0cb32a97be3c2ee57974685775a79723ee --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/CoordinateMass.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.FiniteFactor.Coupling.Infinite + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section + +/-- Endpoint tails of the original Haar representative have at most their +interval length; the endpoint singleton conventions cause no extra mass. -/ +theorem unitIntervalMeasure_right_tail (a : ℝ) : + unitIntervalMeasure (Set.Ici (1-a)) ≤ ENNReal.ofReal a := by + rw [unitIntervalMeasure,Measure.restrict_apply measurableSet_Ici] + have hs : Set.Ici (1-a) ∩ Set.Ico (0 : ℝ) 1 ⊆ Set.Icc (1-a) 1 := + fun _ h => ⟨h.1,h.2.2.le⟩ + exact (measure_mono hs).trans_eq (by simp [Real.volume_Icc]) + +theorem unitIntervalMeasure_left_tail (a : ℝ) : + unitIntervalMeasure (Set.Iic a) ≤ ENNReal.ofReal a := by + rw [unitIntervalMeasure,Measure.restrict_apply measurableSet_Iic] + have hs : Set.Iic a ∩ Set.Ico (0 : ℝ) 1 ⊆ Set.Icc 0 a := + fun _ h => ⟨h.2.1,h.1⟩ + exact (measure_mono hs).trans_eq (by simp [Real.volume_Icc]) + +namespace CouplingParameters + +theorem labelledCoupling_label (p : CouplingParameters) (l : Fin 6) : + p.labelledCoupling {z | z.1 = l} = ENNReal.ofReal (p.labelMass l) := by + have hm : MeasurableSet {z : Fin 6 × (ℝ × ℝ) | z.1 = l} := + (measurableSet_singleton l).preimage measurable_fst + have hi (i : Fin 6) : ((p.pairComponentLaw i).map (fun xy => (i,xy))) {z | z.1 = l} = + if i = l then 1 else 0 := by + have hmeas : Measurable (fun xy : ℝ × ℝ => (i,xy)) := measurable_const.prodMk measurable_id + rw [Measure.map_apply hmeas hm] + by_cases h : i = l <;> simp [h] + rw [labelledCoupling,Measure.finsetSum_apply] + simp only [Measure.smul_apply,smul_eq_mul,hi] + simp + +/-- The actual one-coordinate endpoint law is dominated by ten times Haar. -/ +theorem labelledEndpoint_set_le_ten (p : CouplingParameters) (b : Bool) + (A : Set ℝ) (hA : MeasurableSet A) : + p.labelledCoupling ((fun z => endpoint b z.2) ⁻¹' A) ≤ 10*unitIntervalMeasure A := by + have hmeas : Measurable (fun z : Fin 6 × (ℝ × ℝ) => endpoint b z.2) := + (endpoint_measurable b).comp measurable_snd + rw [← Measure.map_apply hmeas hA,labelled_endpoint_density] + change (unitIntervalMeasure.withDensity (fun t => ENNReal.ofReal (p.endpointDensity b t))) A ≤ _ + rw [withDensity_apply _ hA] + have hh := lintegral_mono (μ := unitIntervalMeasure.restrict A) + (fun t => ENNReal.ofReal_le_ofReal ((p.endpointDensity_lt_ten b t).le)) + simpa only [ENNReal.ofReal_ofNat,lintegral_const,Measure.restrict_apply_univ] using hh + +theorem labelledCoupling_right_tail (p : CouplingParameters) (a : ℝ) : + p.labelledCoupling {z | 1-a ≤ z.2.1} ≤ ENNReal.ofReal (10*a) := by + have hh := p.labelledEndpoint_set_le_ten false (Set.Ici (1-a)) measurableSet_Ici + apply hh.trans + exact (mul_le_mul le_rfl (unitIntervalMeasure_right_tail a) zero_le zero_le).trans_eq + (by rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 10)]; simp) + +theorem labelledCoupling_left_tail (p : CouplingParameters) (a : ℝ) : + p.labelledCoupling {z | z.2.2 ≤ a} ≤ ENNReal.ofReal (10*a) := by + have hh := p.labelledEndpoint_set_le_ten true (Set.Iic a) measurableSet_Iic + apply hh.trans + exact (mul_le_mul le_rfl (unitIntervalMeasure_left_tail a) zero_le zero_le).trans_eq + (by rw [ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 10)]; simp) + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Crossing.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Crossing.lean new file mode 100644 index 0000000000000000000000000000000000000000..f67295eb669d494d48889d256d32a11c59a7f526 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Crossing.lean @@ -0,0 +1,142 @@ +import OAI.Analysis.FiniteFactor.Coupling.Law + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters +variable (p : CouplingParameters) + +/-- Conditioning on y uses a bottom label; conditioning on x uses a top label. -/ +def crossingLabel (right : Bool) (w : Fin 2) : Fin 5 := + if right then ![1,3] w else ![0,2] w + +theorem crossingLabel_mass (right : Bool) (w : Fin 2) : + p.replacementMass (crossingLabel right w) = p.rho w := by + cases right <;> fin_cases w <;> simp [crossingLabel, replacementMass] + +theorem crossingLabel_length (right : Bool) (w : Fin 2) : + p.endpointLength right (crossingLabel right w) = 1-p.width w/2 := by + cases right <;> fin_cases w <;> + simp [crossingLabel, endpointLength, leftLength, rightLength] + +theorem crossingLabel_interval (right : Bool) (w : Fin 2) : + p.endpointInterval right (crossingLabel right w) = + if right then Set.Ico (p.width w/2) 1 else Set.Ico 0 (1-p.width w/2) := by + cases right <;> fin_cases w <;> + simp [crossingLabel, endpointInterval, leftLength, rightLength] + +theorem crossingLabel_opposite_interval (right : Bool) (w : Fin 2) : + p.endpointInterval (!right) (crossingLabel right w) = + if right then Set.Ico 0 (p.width w/2) else Set.Ico (1-p.width w/2) 1 := by + cases right <;> fin_cases w <;> + simp [crossingLabel, endpointInterval, leftLength, rightLength] + +/-- This is the conditional label weight from conditional-kernel. -/ +def posteriorMass (right : Bool) (t : ℝ) (i : Fin 5) : ℝ := + p.replacementMass i * p.endpointComponentDensity right i t / p.endpointDensity right t + +theorem posteriorMass_nonneg (right : Bool) (t : ℝ) (i : Fin 5) : + 0 ≤ p.posteriorMass right t i := by + apply div_nonneg + · exact mul_nonneg (p.replacementMass_nonneg i) + (intervalDensity_nonneg (p.endpointLength_pos right i).le t) + · exact (p.diagonalMass_pos.trans_le (p.endpointDensity_lower right t)).le + +theorem posteriorMass_sum (right : Bool) (t : ℝ) : + p.diagonalMass / p.endpointDensity right t + ∑ i, p.posteriorMass right t i = 1 := by + simp only [posteriorMass] + rw [← Finset.sum_div, ← add_div] + change p.endpointDensity right t / p.endpointDensity right t = 1 + exact div_self (ne_of_gt (p.diagonalMass_pos.trans_le (p.endpointDensity_lower right t))) + +theorem crossing_component_density_ge_one (right : Bool) (w : Fin 2) + {t u : ℝ} (ht : t ∈ Set.Ico 0 1) (hu : p.width w ≤ u ∧ u ≤ 1-p.width w) + (heligible : if right then u ≤ t else t < u) : + 1 ≤ p.endpointComponentDensity right (crossingLabel right w) t := by + have hw := p.width_pos w + have hupp := p.width_upper w + have hmem : t ∈ p.endpointInterval right (crossingLabel right w) := by + rw [p.crossingLabel_interval] + cases right <;> simp only [Bool.false_eq_true, ↓reduceIte] at * + · exact ⟨ht.1, by linarith [hu.2]⟩ + · exact ⟨by linarith [hu.1], ht.2⟩ + unfold endpointComponentDensity intervalDensity + rw [Set.indicator_of_mem hmem, p.crossingLabel_length] + exact (one_le_inv₀ (by linarith : 0 < 1-p.width w/2)).2 (by linarith) + +theorem crossing_posterior_lower (right : Bool) (w : Fin 2) + {t u : ℝ} (ht : t ∈ Set.Ico 0 1) (hu : p.width w ≤ u ∧ u ≤ 1-p.width w) + (heligible : if right then u ≤ t else t < u) : + p.rho w / 10 ≤ p.posteriorMass right t (crossingLabel right w) := by + have hh := p.diagonalMass_pos.trans_le (p.endpointDensity_lower right t) + have hd := p.crossing_component_density_ge_one right w ht hu heligible + unfold posteriorMass + rw [p.crossingLabel_mass] + calc + p.rho w / 10 ≤ p.rho w / p.endpointDensity right t := + div_le_div_of_nonneg_left (p.rho_nonneg w) hh (p.endpointDensity_lt_ten right t).le + _ ≤ _ := div_le_div_of_nonneg_right + (by simpa using mul_le_mul_of_nonneg_left hd (p.rho_nonneg w)) hh.le + +/-- The opposite endpoint of the selected label crosses the threshold surely. -/ +theorem crossing_partner_interval (right : Bool) (w : Fin 2) {u : ℝ} + (hu : p.width w ≤ u ∧ u ≤ 1-p.width w) : + p.endpointInterval (!right) (crossingLabel right w) ⊆ + if right then Set.Iio u else Set.Ici u := by + rw [p.crossingLabel_opposite_interval] + have hw := p.width_pos w + cases right <;> simp only [Bool.false_eq_true, ↓reduceIte] + · intro z hz + exact (by linarith [hz.1, hu.2] : u ≤ z) + · intro z hz + exact (by linarith [hz.2, hu.1] : z < u) + +/-- The actual probability measure in the displayed conditional-kernel formula. +The disintegration identities are proved separately. -/ +def posteriorLaw (right : Bool) (t : ℝ) : Measure ℝ := + ENNReal.ofReal (p.diagonalMass / p.endpointDensity right t) • Measure.dirac t + + ∑ i, ENNReal.ofReal (p.posteriorMass right t i) • p.endpointComponentLaw (!right) i + +instance posteriorLaw_probability (right : Bool) (t : ℝ) : + IsProbabilityMeasure (p.posteriorLaw right t) := by + constructor + simp only [posteriorLaw, Measure.add_apply, Measure.finsetSum_apply, Measure.smul_apply, + smul_eq_mul, measure_univ, mul_one] + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => p.posteriorMass_nonneg right t i), + ← ENNReal.ofReal_add (div_nonneg p.diagonalMass_pos.le + (p.diagonalMass_pos.trans_le (p.endpointDensity_lower right t)).le) + (Finset.sum_nonneg (fun i _ => p.posteriorMass_nonneg right t i)), + p.posteriorMass_sum] + simp + +theorem posteriorLaw_component_le (right : Bool) (t : ℝ) (i : Fin 5) (S : Set ℝ) : + ENNReal.ofReal (p.posteriorMass right t i) * p.endpointComponentLaw (!right) i S ≤ + p.posteriorLaw right t S := by + rw [posteriorLaw, Measure.add_apply, Measure.finsetSum_apply] + simp only [Measure.smul_apply, smul_eq_mul] + apply le_trans _ (le_add_left le_rfl) + exact Finset.single_le_sum (f := fun j => ENNReal.ofReal (p.posteriorMass right t j) * + p.endpointComponentLaw (!right) j S) (fun j _ => zero_le) (Finset.mem_univ i) + +/-- Both orientations of the actual posterior crossing estimate, with the +source constant 1/10 and no assumptions on a candidate projection. -/ +theorem posteriorLaw_crossing_lower (right : Bool) (w : Fin 2) + {t u : ℝ} (ht : t ∈ Set.Ico 0 1) (hu : p.width w ≤ u ∧ u ≤ 1-p.width w) + (heligible : if right then u ≤ t else t < u) : + ENNReal.ofReal (p.rho w / 10) ≤ + p.posteriorLaw right t (if right then Set.Iio u else Set.Ici u) := by + have hcomp := p.endpointComponentLaw_of_contains (!right) (crossingLabel right w) + (p.crossing_partner_interval right w hu) + have hterm := p.posteriorLaw_component_le right t (crossingLabel right w) + (if right then Set.Iio u else Set.Ici u) + rw [hcomp, mul_one] at hterm + exact (ENNReal.ofReal_le_ofReal (p.crossing_posterior_lower right w ht hu heligible)).trans hterm + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Density.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Density.lean new file mode 100644 index 0000000000000000000000000000000000000000..422b4cfce9a4852b2718fcc88c6db4fcc3df9b3c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Density.lean @@ -0,0 +1,110 @@ +import Mathlib.MeasureTheory.Integral.Bochner.Set +import Mathlib.MeasureTheory.Integral.Pi +import Mathlib.MeasureTheory.Measure.Lebesgue.Basic +import Mathlib.Algebra.Order.Chebyshev +import Mathlib.Analysis.SpecialFunctions.Exp +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section + +/-- Normalized restriction density, relative to the probability base measure. -/ +def intervalDensity {X : Type*} (U : Set X) (length : ℝ) : X → ℝ := + U.indicator (fun _ => length⁻¹) + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsProbabilityMeasure μ] + +theorem intervalDensity_integrable {U : Set X} (hU : MeasurableSet U) (l : ℝ) : + Integrable (intervalDensity U l) μ := (integrable_const _).indicator hU + +omit [MeasurableSpace X] in +theorem intervalDensity_nonneg [MeasurableSpace X] {U : Set X} {l : ℝ} (hl : 0 ≤ l) (x : X) : + 0 ≤ intervalDensity U l x := by + classical + by_cases hx : x ∈ U <;> simp [intervalDensity, hx, inv_nonneg.mpr hl] + +omit [MeasurableSpace X] in +theorem intervalDensity_le [MeasurableSpace X] {U : Set X} {l : ℝ} (hl : 0 ≤ l) (x : X) : + intervalDensity U l x ≤ l⁻¹ := by + classical + by_cases hx : x ∈ U <;> simp [intervalDensity, hx, inv_nonneg.mpr hl] + +omit [IsProbabilityMeasure μ] in +theorem intervalDensity_integral [IsProbabilityMeasure μ] {U : Set X} (hU : MeasurableSet U) + {l : ℝ} (hl : 0 < l) (hm : μ.real U = l) : + ∫ x, intervalDensity U l x ∂μ = 1 := by + rw [intervalDensity, integral_indicator hU, setIntegral_const, smul_eq_mul, hm] + exact mul_inv_cancel₀ hl.ne' + +theorem intervalDensity_sq_integrable {U : Set X} (hU : MeasurableSet U) (l : ℝ) : + Integrable (fun x => intervalDensity U l x ^ 2) μ := by + have heq : (fun x => intervalDensity U l x ^ 2) = U.indicator (fun _ => (l⁻¹)^2) := by + funext x + by_cases hx : x ∈ U <;> simp [intervalDensity, hx] + rw [heq] + exact (integrable_const _).indicator hU + +omit [IsProbabilityMeasure μ] in +theorem intervalDensity_sq_integral [IsProbabilityMeasure μ] {U : Set X} (hU : MeasurableSet U) + {l : ℝ} (hl : 0 < l) (hm : μ.real U = l) : + ∫ x, intervalDensity U l x ^ 2 ∂μ = l⁻¹ := by + have heq : (fun x => intervalDensity U l x ^ 2) = U.indicator (fun _ => (l⁻¹)^2) := by + funext x + by_cases hx : x ∈ U <;> simp [intervalDensity, hx] + rw [heq, integral_indicator hU, setIntegral_const, smul_eq_mul, hm] + field_simp + +/-- The mass-one identity cancels the linear term exactly. -/ +theorem density_energy_identity {h : X → ℝ} (hh : Integrable h μ) + (hh2 : Integrable (fun x => h x ^ 2) μ) (hm : ∫ x, h x ∂μ = 1) : + (∫ x, (h x - 1)^2 ∂μ) = (∫ x, h x ^ 2 ∂μ) - 1 := by + have heq : (fun x => (h x - 1)^2) = fun x => h x ^ 2 - 2*h x + 1 := by + funext x; ring + have h₁ := integral_add (hh2.sub (hh.const_mul 2)) (integrable_const (1 : ℝ)) + have h₂ := integral_sub hh2 (hh.const_mul 2) + dsimp only [Pi.sub_apply, Pi.add_apply] at h₁ h₂ + rw [heq, h₁, h₂, integral_const_mul, hm] + simp + ring + +/-- Each normalized interval perturbation has energy exactly 1/length - 1. -/ +theorem intervalDensity_energy {U : Set X} (hU : MeasurableSet U) + {l : ℝ} (hl : 0 < l) (hm : μ.real U = l) : + (∫ x, (intervalDensity U l x - 1)^2 ∂μ) = l⁻¹ - 1 := by + rw [density_energy_identity (intervalDensity_integrable hU l) + (intervalDensity_sq_integrable hU l) (intervalDensity_integral hU hl hm), + intervalDensity_sq_integral hU hl hm] + +/-- Finite independent endpoint selections: the square integral factors exactly. -/ +theorem product_density_sq_integral {ι : Type*} [Fintype ι] + {E : ι → Type*} [∀ i, MeasurableSpace (E i)] + (ν : ∀ i, Measure (E i)) [∀ i, SigmaFinite (ν i)] + (h : ∀ i, E i → ℝ) : + (∫ x, (∏ i, h i (x i))^2 ∂Measure.pi ν) = + ∏ i, ∫ x, h i x ^ 2 ∂ν i := by + simp_rw [← Finset.prod_pow] + exact integral_fintype_prod_eq_prod (fun i x => h i x ^ 2) + +/-- Finite product estimate used in uniform-product-density; the bound has +no dependence on the choice of endpoint orientation. -/ +theorem product_energy_le_exp {ι : Type*} [Fintype ι] + (A e : ι → ℝ) (hA0 : ∀ i, 0 ≤ A i) (hA : ∀ i, A i ≤ 1 + e i) : + (∏ i, A i) ≤ Real.exp (∑ i, e i) := by + calc + (∏ i, A i) ≤ ∏ i, Real.exp (e i) := by + apply Finset.prod_le_prod₀ (fun i _ => hA0 i) + intro i _ + exact (hA i).trans (by linarith [Real.add_one_le_exp (e i)]) + _ = _ := (Real.exp_sum _ _).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/FiniteDisintegration.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/FiniteDisintegration.lean new file mode 100644 index 0000000000000000000000000000000000000000..27691282cf1d5bc785ef7d21ea740183cc93bb7c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/FiniteDisintegration.lean @@ -0,0 +1,83 @@ +import OAI.Analysis.FiniteFactor.Coupling.FinitePosteriorAC + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +/-- The mixed posterior keeps every unselected coordinate fixed. -/ +def mixedPosteriorKernel {ι : Type*} (p : ι → CouplingParameters) (r : ι → Bool) : + Kernel (ι → ℝ) (ι → ℝ) := by + letI : ∀ i, IsMarkovKernel (if r i then (p i).posteriorKernel false else Kernel.id) := + fun i => by split_ifs <;> infer_instance + exact independentKernel (fun i => if r i then (p i).posteriorKernel false else Kernel.id) + +instance mixedPosteriorKernel_markov {ι : Type*} (p : ι → CouplingParameters) (r : ι → Bool) : + IsMarkovKernel (mixedPosteriorKernel p r) := by + unfold mixedPosteriorKernel + let : ∀ i, IsMarkovKernel (if r i then (p i).posteriorKernel false else Kernel.id) := + fun i => by split_ifs <;> infer_instance + infer_instance + +theorem mixedCoordinate_compProd (p : CouplingParameters) (r : Bool) : + p.selectedLaw true false ⊗ₘ (if r then p.posteriorKernel false else Kernel.id) = + p.labelledCoupling.map (fun ω => (endpoint false ω.2,endpoint r ω.2)) := by + cases r + · simp only [Bool.false_eq_true,ite_false] + rw [Measure.compProd_id,selectedLaw_endpoint] + unfold coupling + rw [Measure.map_map (endpoint_measurable false) measurable_snd, + Measure.map_map (by fun_prop) ((endpoint_measurable false).comp measurable_snd)] + rfl + · simp only [ite_true] + rw [posterior_compProd] + unfold coupling + rw [Measure.map_map (orientPair_measurable false) measurable_snd] + rfl + +/-- Disintegration of every mixed endpoint pair under the actual augmented +product law, conditioned on the entire original x vector. -/ +theorem mixedPosterior_disintegration {ι : Type*} (p : ι → CouplingParameters) (r : ι → Bool) : + ((vectorCoupling p).map (vectorEndpoint (fun _ => false))) ⊗ₘ (mixedPosteriorKernel p r) = + (vectorCoupling p).map (fun ω => (vectorEndpoint (fun _ => false) ω,vectorEndpoint r ω)) := by + rw [vectorEndpoint_law] + let κ := fun i => if r i then (p i).posteriorKernel false else Kernel.id + let : ∀ i, IsMarkovKernel (κ i) := fun i => by dsimp [κ]; split_ifs <;> infer_instance + have hh := independentKernel_compProd (fun i => (p i).selectedLaw true false) κ + dsimp [κ] at hh + simp_rw [mixedCoordinate_compProd] at hh + let zip : (ι → ℝ) × (ι → ℝ) → (ι → ℝ × ℝ) := fun z i => (z.1 i,z.2 i) + let unzip : (ι → ℝ × ℝ) → (ι → ℝ) × (ι → ℝ) := fun z => (fun i => (z i).1,fun i => (z i).2) + have hz : Measurable zip := by fun_prop + have hu : Measurable unzip := by fun_prop + have hleft := congrArg (fun ν : Measure (ι → ℝ × ℝ) => ν.map unzip) hh + rw [Measure.map_map hu hz] at hleft + have hid : unzip ∘ zip = id := rfl + rw [hid,Measure.map_id] at hleft + unfold mixedPosteriorKernel + rw [hleft] + have hp : (vectorCoupling p).map (fun ω i => (endpoint false (ω i).2,endpoint (r i) (ω i).2)) = + Measure.infinitePi (fun i => (p i).labelledCoupling.map + (fun ω => (endpoint false ω.2,endpoint (r i) ω.2))) := by + unfold vectorCoupling + exact Measure.infinitePi_map_pi _ (f := fun i (ω : Fin 6 × (ℝ × ℝ)) => + (endpoint false ω.2,endpoint (r i) ω.2)) (fun i => + ((endpoint_measurable false).comp measurable_snd).prodMk + ((endpoint_measurable (r i)).comp measurable_snd)) + have hv : Measurable (fun (ω : ι → Fin 6 × (ℝ × ℝ)) i => + (endpoint false (ω i).2,endpoint (r i) (ω i).2)) := by + apply Measurable.of_eval + intro i + exact ((endpoint_measurable false).comp (measurable_snd.comp (measurable_pi_apply i))).prodMk + ((endpoint_measurable (r i)).comp (measurable_snd.comp (measurable_pi_apply i))) + rw [← hp,Measure.map_map hu hv] + rfl + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/FiniteLaw.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/FiniteLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..ef629d7f56a237e8a653eeb0a46f119ae5c15ad1 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/FiniteLaw.lean @@ -0,0 +1,60 @@ +import OAI.Analysis.FiniteFactor.Coupling.Products + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +def selectedLaw (p : CouplingParameters) (enabled right : Bool) : Measure ℝ := + unitIntervalMeasure.withDensity (fun t => ENNReal.ofReal (p.selectedDensity enabled right t)) + +instance selectedLaw_probability (p : CouplingParameters) (enabled right : Bool) : + IsProbabilityMeasure (p.selectedLaw enabled right) := + densityMeasure_probability ((p.selectedDensity_memLp enabled right).integrable (by norm_num)) + (p.selectedDensity_nonneg enabled right) (p.selectedDensity_integral enabled right) + +theorem selectedLaw_endpoint (p : CouplingParameters) (right : Bool) : + p.selectedLaw true right = p.coupling.map (endpoint right) := + (p.coupling_endpoint_density right).symm + +theorem selectedLaw_apply_integral (p : CouplingParameters) (enabled right : Bool) + {S : Set ℝ} (hS : MeasurableSet S) : + p.selectedLaw enabled right S = ENNReal.ofReal (∫ t in S, p.selectedDensity enabled right t ∂unitIntervalMeasure) := by + rw [selectedLaw, withDensity_apply _ hS] + exact (ofReal_integral_eq_lintegral_ofReal + (((p.selectedDensity_memLp enabled right).integrable (by norm_num)).restrict) + (Filter.Eventually.of_forall (p.selectedDensity_nonneg enabled right))).symm + +/-- The actual finite product law has the product density with the established L2 bounds. +This identifies measures on every measurable set. -/ +theorem finiteProductLaw_density {ι : Type*} [Fintype ι] + (p : ι → CouplingParameters) (enabled right : ι → Bool) : + Measure.pi (fun i => (p i).selectedLaw (enabled i) (right i)) = + (Measure.pi (fun _ : ι => unitIntervalMeasure)).withDensity + (fun x => ENNReal.ofReal (finiteProductDensity p enabled right x)) := by + classical + apply Measure.pi_eq + intro S hS + rw [withDensity_apply _ (MeasurableSet.univ_pi hS)] + have hnon (x : ι → ℝ) : 0 ≤ finiteProductDensity p enabled right x := + Finset.prod_nonneg fun i _ => (p i).selectedDensity_nonneg (enabled i) (right i) (x i) + rw [← ofReal_integral_eq_lintegral_ofReal + ((finiteProductDensity_memLp p enabled right).integrable (by norm_num)).restrict + (Filter.Eventually.of_forall hnon)] + rw [Measure.restrict_pi_pi] + unfold finiteProductDensity + rw [integral_fintype_prod_eq_prod (fun i => (p i).selectedDensity (enabled i) (right i))] + rw [ENNReal.ofReal_prod_of_nonneg (fun i _ => integral_nonneg + ((p i).selectedDensity_nonneg (enabled i) (right i)))] + apply Finset.prod_congr rfl + intro i _ + exact ((p i).selectedLaw_apply_integral (enabled i) (right i) (hS i)).symm + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/FinitePosteriorAC.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/FinitePosteriorAC.lean new file mode 100644 index 0000000000000000000000000000000000000000..e67e227d0a644d256212d450d095931d09c0ad90 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/FinitePosteriorAC.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.FiniteFactor.FiniteProductAbsoluteContinuity +import OAI.Analysis.FiniteFactor.Coupling.VectorBayes + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +/-- A normalized reference law allowing either a diagonal or a Haar draw. -/ +def diagonalHaarReference (t : ℝ) : Measure ℝ := + (2 : ℝ≥0∞)⁻¹ • (Measure.dirac t + unitIntervalMeasure) + +instance diagonalHaarReference_probability (t : ℝ) : + IsProbabilityMeasure (diagonalHaarReference t) := by + constructor + simpa [diagonalHaarReference,Measure.smul_apply,Measure.add_apply,measure_univ] using ENNReal.inv_two_add_inv_two + +/-- Every coordinate posterior has an absolutely continuous off-diagonal part. +The diagonal atom is retained explicitly in the reference measure. -/ +theorem posteriorKernel_ac_diagonalHaar (p : CouplingParameters) (right : Bool) (t : ℝ) : + p.posteriorKernel right t ≪ diagonalHaarReference t := by + apply Measure.AbsolutelyContinuous.smul_right _ (by norm_num) + apply Measure.AbsolutelyContinuous.mk + intro S hS hzero + have hz : Measure.dirac t S = 0 ∧ unitIntervalMeasure S = 0 := by + simpa only [Measure.add_apply,add_eq_zero] using hzero + have hc (i : Fin 5) : p.endpointComponentLaw (!right) i S = 0 := + withDensity_absolutelyContinuous _ _ hz.2 + change p.posteriorLaw right t S = 0 + simp [posteriorLaw,Measure.add_apply,Measure.finsetSum_apply,Measure.smul_apply,hz.1,hc] + +/-- Full conditional law with only F resampled, given the entire original +endpoint vector. The coordinates outside F are exactly fixed. -/ +theorem vectorPosterior_finite_map {ι : Type*} [DecidableEq ι] + (p : ι → CouplingParameters) (F : Finset ι) (x : ι → ℝ) : + (vectorPosterior p (fun _ => false) x).map + (fun y i => if i ∈ F then y i else x i) = + Measure.infinitePi (fun i => if i ∈ F then (p i).posteriorKernel false (x i) + else Measure.dirac (x i)) := by + change (Measure.infinitePi (fun i => (p i).posteriorKernel false (x i))).map _ = _ + rw [Measure.infinitePi_map_pi _ (f := fun i y => if i ∈ F then y else x i) + (fun i => by split_ifs <;> fun_prop)] + congr 1 + funext i + by_cases hi : i ∈ F + · simp [hi] + · simp [hi,Measure.map_const] + +/-- Absolute continuity of the actual full-vector conditional law after a +finite replacement. This uses finitely many coordinate changes only. -/ +theorem vectorPosterior_finite_ac {ι : Type*} [DecidableEq ι] + (p : ι → CouplingParameters) (F : Finset ι) (x : ι → ℝ) : + (vectorPosterior p (fun _ => false) x).map + (fun y i => if i ∈ F then y i else x i) ≪ + Measure.infinitePi (fun i => if i ∈ F then diagonalHaarReference (x i) + else Measure.dirac (x i)) := by + rw [vectorPosterior_finite_map] + let μ := fun i => if i ∈ F then diagonalHaarReference (x i) else Measure.dirac (x i) + let ν := fun i => if i ∈ F then (p i).posteriorKernel false (x i) else Measure.dirac (x i) + let : ∀ i, IsProbabilityMeasure (μ i) := fun i => by dsimp [μ]; split_ifs <;> infer_instance + let : ∀ i, IsProbabilityMeasure (ν i) := fun i => by dsimp [ν]; split_ifs <;> infer_instance + apply infinitePi_ac_of_finite_changes μ ν F + · intro i hi + simpa [μ,ν,hi] using (p i).posteriorKernel_ac_diagonalHaar false (x i) + · intro i hi + simp [μ,ν,hi] + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Infinite.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Infinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..98b7a94840e723f28993e1d87f9961c3ed987aff --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Infinite.lean @@ -0,0 +1,60 @@ +import OAI.Analysis.FiniteFactor.Coupling.Marginals +import Mathlib.Probability.ProductMeasure + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +/-- The augmented countable product retains each coordinate's label and pair. -/ +abbrev CouplingSample := ℕ → Fin 6 × (ℝ × ℝ) + +def productCoupling (p : ℕ → CouplingParameters) : Measure CouplingSample := + Measure.infinitePi (fun i => (p i).labelledCoupling) + +instance productCoupling_probability (p : ℕ → CouplingParameters) : + IsProbabilityMeasure (productCoupling p) := by + unfold productCoupling + infer_instance + +def productEndpoint (right : ℕ → Bool) (ω : CouplingSample) (i : ℕ) : ℝ := + endpoint (right i) (ω i).2 + +theorem productEndpoint_measurable (right : ℕ → Bool) : Measurable (productEndpoint right) := by + apply Measurable.of_eval + intro i + exact (endpoint_measurable (right i)).comp (measurable_snd.comp (measurable_pi_apply i)) + +theorem labelled_endpoint_density (p : CouplingParameters) (right : Bool) : + p.labelledCoupling.map (fun z => endpoint right z.2) = + unitIntervalMeasure.withDensity (fun t => ENNReal.ofReal (p.endpointDensity right t)) := by + rw [← p.coupling_endpoint_density] + unfold coupling + rw [Measure.map_map (endpoint_measurable right) measurable_snd] + rfl + +/-- Every coordinatewise choice of endpoint marginals is exactly its product +law, including the mixed prefixes used in biased-identity. -/ +theorem productEndpoint_law (p : ℕ → CouplingParameters) (right : ℕ → Bool) : + (productCoupling p).map (productEndpoint right) = + Measure.infinitePi (fun i => unitIntervalMeasure.withDensity + (fun t => ENNReal.ofReal ((p i).endpointDensity (right i) t))) := by + unfold productCoupling productEndpoint + rw [Measure.infinitePi_map_pi (fun i => (p i).labelledCoupling) + (f := fun i (z : Fin 6 × (ℝ × ℝ)) => endpoint (right i) z.2) (fun i => (endpoint_measurable (right i)).comp measurable_snd)] + simp_rw [labelled_endpoint_density] + +/-- Independence is recorded as the exact finite-cylinder product formula. -/ +theorem productCoupling_cylinder (p : ℕ → CouplingParameters) (I : Finset ℕ) + (S : ℕ → Set (Fin 6 × (ℝ × ℝ))) (hS : ∀ i ∈ I, MeasurableSet (S i)) : + productCoupling p (Set.pi (I : Set ℕ) S) = ∏ i ∈ I, (p i).labelledCoupling (S i) := + Measure.infinitePi_pi _ hS + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Law.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Law.lean new file mode 100644 index 0000000000000000000000000000000000000000..2d16e31767fabe319d4a0373db662df1b8e93dfa --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Law.lean @@ -0,0 +1,106 @@ +import OAI.Analysis.FiniteFactor.Coupling.Bounds +import Mathlib.MeasureTheory.Measure.Prod +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section + +/-- A probability density gives an actual probability measure. -/ +theorem densityMeasure_probability {X : Type*} [MeasurableSpace X] + {μ : Measure X} {d : X → ℝ} (hd : Integrable d μ) + (h0 : ∀ x, 0 ≤ d x) (hm : ∫ x, d x ∂μ = 1) : + IsProbabilityMeasure (μ.withDensity (fun x => ENNReal.ofReal (d x))) := by + constructor + rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ, + ← ofReal_integral_eq_lintegral_ofReal hd (Filter.Eventually.of_forall h0), hm] + simp + +namespace CouplingParameters +variable (p : CouplingParameters) + +def endpointComponentLaw (right : Bool) (i : Fin 5) : Measure ℝ := + unitIntervalMeasure.withDensity (fun t => ENNReal.ofReal (p.endpointComponentDensity right i t)) + +instance endpointComponentLaw_probability (right : Bool) (i : Fin 5) : + IsProbabilityMeasure (p.endpointComponentLaw right i) := by + apply densityMeasure_probability + · exact intervalDensity_integrable (p.endpointInterval_measurable right i) _ + · exact intervalDensity_nonneg (p.endpointLength_pos right i).le + · exact intervalDensity_integral (p.endpointInterval_measurable right i) + (p.endpointLength_pos right i) (p.endpointInterval_mass right i) + +/-- Six labels: zero is diagonal; the five successors retain both widths and the tag. -/ +def labelMass : Fin 6 → ℝ := Fin.cons p.diagonalMass p.replacementMass + +def pairComponentLaw : Fin 6 → Measure (ℝ × ℝ) := + Fin.cons (unitIntervalMeasure.map (fun t => (t,t))) + (fun i => (p.endpointComponentLaw false i).prod (p.endpointComponentLaw true i)) + +theorem labelMass_nonneg (i : Fin 6) : 0 ≤ p.labelMass i := by + refine Fin.cases p.diagonalMass_pos.le (fun i => p.replacementMass_nonneg i) i + +theorem labelMass_sum : ∑ i, p.labelMass i = 1 := by + simpa [labelMass, Fin.sum_univ_succ] using p.mass_sum + +instance pairComponentLaw_probability (i : Fin 6) : IsProbabilityMeasure (p.pairComponentLaw i) := by + refine Fin.cases ?_ (fun i => ?_) i + · constructor + have hm : Measurable (fun t : ℝ => (t,t)) := measurable_id.prodMk measurable_id + rw [pairComponentLaw, Fin.cons_zero, Measure.map_apply hm MeasurableSet.univ] + simp + · change IsProbabilityMeasure ((p.endpointComponentLaw false i).prod (p.endpointComponentLaw true i)) + infer_instance + +/-- The actual augmented one-coordinate law, including its mixture label. -/ +def labelledCoupling : Measure (Fin 6 × (ℝ × ℝ)) := + ∑ i, ENNReal.ofReal (p.labelMass i) • + (p.pairComponentLaw i).map (fun xy => (i,xy)) + +instance labelledCoupling_probability : IsProbabilityMeasure p.labelledCoupling := by + constructor + have hmap (i : Fin 6) : ((p.pairComponentLaw i).map (fun xy => (i,xy))) Set.univ = 1 := by + have hm : Measurable (fun xy : ℝ × ℝ => (i,xy)) := measurable_const.prodMk measurable_id + rw [Measure.map_apply hm MeasurableSet.univ] + simp + simp only [labelledCoupling, Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, + hmap, mul_one] + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => p.labelMass_nonneg i), p.labelMass_sum] + simp + +/-- Forgetting labels gives the one-coordinate pair law. -/ +def coupling : Measure (ℝ × ℝ) := p.labelledCoupling.map Prod.snd + +instance coupling_probability : IsProbabilityMeasure p.coupling := by + constructor + rw [coupling, Measure.map_apply measurable_snd MeasurableSet.univ] + simp + +theorem endpointComponentLaw_eq (right : Bool) (i : Fin 5) : + p.endpointComponentLaw right i = ENNReal.ofReal ((p.endpointLength right i)⁻¹) • + unitIntervalMeasure.restrict (p.endpointInterval right i) := by + unfold endpointComponentLaw endpointComponentDensity intervalDensity + have heq : (fun t => ENNReal.ofReal ((p.endpointInterval right i).indicator + (fun _ => (p.endpointLength right i)⁻¹) t)) = + (p.endpointInterval right i).indicator (fun _ => ENNReal.ofReal ((p.endpointLength right i)⁻¹)) := by + funext t + by_cases ht : t ∈ p.endpointInterval right i <;> simp [ht] + rw [heq, withDensity_indicator (p.endpointInterval_measurable right i), withDensity_const] + +theorem endpointComponentLaw_of_contains (right : Bool) (i : Fin 5) {S : Set ℝ} + (hS : p.endpointInterval right i ⊆ S) : p.endpointComponentLaw right i S = 1 := by + have hu := measure_univ (μ := p.endpointComponentLaw right i) + rw [p.endpointComponentLaw_eq, Measure.smul_apply, + Measure.restrict_apply' (p.endpointInterval_measurable right i), Set.univ_inter] at hu + rw [p.endpointComponentLaw_eq, Measure.smul_apply, + Measure.restrict_apply' (p.endpointInterval_measurable right i), Set.inter_eq_right.mpr hS] + exact hu + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Limit.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Limit.lean new file mode 100644 index 0000000000000000000000000000000000000000..bf8ecad3228306bdb3801e504cbef7ec5b9f1fbf --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Limit.lean @@ -0,0 +1,54 @@ +import OAI.Analysis.FiniteFactor.Coupling.Prefix + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped Topology ENNReal +noncomputable section +namespace CouplingParameters + +/-- Uniformly square-integrable finite endpoint densities produce an actual +infinite-product density, with the same square-integral bound. -/ +theorem infiniteEndpoint_density_of_prefix_bound {ι : Type*} + (p : ι → CouplingParameters) (right : ι → Bool) (I : ℕ → Finset ι) + (hmono : Monotone I) (hcover : ∀ J : Finset ι, ∃ n, J ⊆ I n) + (C : ℝ) (hb : ∀ n, (∫ x, prefixDensity p right (I n) x ^ 2 + ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) ≤ C) : + ∃ g : (ι → ℝ) → ℝ, + MemLp g 2 (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) ∧ + (∀ᵐ x ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure), 0 ≤ g x) ∧ + (∫ x, g x ^ 2 ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) ≤ C ∧ + Measure.infinitePi (fun i => (p i).selectedLaw true (right i)) = + (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)).withDensity + (fun x => ENNReal.ofReal (g x)) := by + let μ := Measure.infinitePi (fun _ : ι => unitIntervalMeasure) + obtain ⟨g, hg, hnon, hgb, hsets⟩ := exists_nonneg_L2_limit + (fun n => prefixDensity p right (I n)) + (fun n => prefixDensity_memLp p right (I n)) + (fun n => Eventually.of_forall (prefixDensity_nonneg p right (I n))) C hb + (fun n m hnm => prefixDensity_inner p right (hmono hnm)) + refine ⟨g, hg, hnon, hgb, ?_⟩ + apply (Measure.isProjectiveLimit_infinitePi (fun i => (p i).selectedLaw true (right i))).unique + intro J + apply Measure.ext + intro S hS + rw [Measure.map_apply (measurable_restrict J) hS, + withDensity_apply _ (hS.preimage (measurable_restrict J)), + ← ofReal_integral_eq_lintegral_ofReal (hg.integrable (by norm_num)).restrict + (ae_restrict_of_ae hnon)] + obtain ⟨N, hN⟩ := hcover J + have he : ∀ n ≥ N, ENNReal.ofReal (∫ x in (J.restrict (π := fun _ : ι => ℝ)) ⁻¹' S, + prefixDensity p right (I n) x ∂μ) = + Measure.pi (fun i : J => (p i).selectedLaw true (right i)) S := by + intro n hn + exact prefixDensity_cylinder_of_subset p right (hN.trans (hmono hn)) hS + have ht := (ENNReal.continuous_ofReal.tendsto _).comp + (hsets ((J.restrict (π := fun _ : ι => ℝ)) ⁻¹' S) (hS.preimage (measurable_restrict J))) + exact tendsto_nhds_unique ht (tendsto_atTop_of_eventually_const he) + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Marginals.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Marginals.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2dc10e09edff89813be90ce0a8b0517a593bdfc --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Marginals.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.FiniteFactor.Coupling.Law + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section + +theorem withDensity_finite_sum {X ι : Type*} [MeasurableSpace X] [Fintype ι] + (μ : Measure X) (f : ι → X → ℝ≥0∞) (hf : ∀ i, Measurable (f i)) : + μ.withDensity (fun x => ∑ i, f i x) = ∑ i, μ.withDensity (f i) := by + ext S hS + rw [withDensity_apply _ hS, Measure.finsetSum_apply, + lintegral_finsetSum Finset.univ (fun i _ => hf i)] + simp_rw [withDensity_apply _ hS] + +theorem mixture_withDensity {X ι : Type*} [MeasurableSpace X] [Fintype ι] + (μ : Measure X) (q : ℝ) (π : ι → ℝ) (d : ι → X → ℝ) + (hq : 0 ≤ q) (hπ : ∀ i, 0 ≤ π i) (hd : ∀ i x, 0 ≤ d i x) + (hmd : ∀ i, Measurable (d i)) : + μ.withDensity (fun x => ENNReal.ofReal (mixtureDensity q π d x)) = + ENNReal.ofReal q • μ + ∑ i, ENNReal.ofReal (π i) • + μ.withDensity (fun x => ENNReal.ofReal (d i x)) := by + have heq : (fun x => ENNReal.ofReal (mixtureDensity q π d x)) = + fun x => ENNReal.ofReal q + ∑ i, ENNReal.ofReal (π i) * ENNReal.ofReal (d i x) := by + funext x + rw [mixtureDensity, ENNReal.ofReal_add hq (Finset.sum_nonneg (fun i _ => mul_nonneg (hπ i) (hd i x))), + ENNReal.ofReal_sum_of_nonneg (fun i _ => mul_nonneg (hπ i) (hd i x))] + simp_rw [ENNReal.ofReal_mul (hπ _)] + have hadd := withDensity_add_left (μ := μ) + (f := fun _ : X => ENNReal.ofReal q) measurable_const + (fun x => ∑ i, ENNReal.ofReal (π i) * ENNReal.ofReal (d i x)) + change μ.withDensity (fun x => ENNReal.ofReal q + ∑ i, ENNReal.ofReal (π i) * ENNReal.ofReal (d i x)) = _ at hadd + rw [heq, hadd, withDensity_const, + withDensity_finite_sum μ (fun i x => ENNReal.ofReal (π i) * ENNReal.ofReal (d i x)) + (fun i => measurable_const.mul (hmd i).ennreal_ofReal)] + congr 1 + apply Finset.sum_congr rfl + intro i _ + exact withDensity_smul (ENNReal.ofReal (π i)) (hmd i).ennreal_ofReal + +namespace CouplingParameters +variable (p : CouplingParameters) + +def endpoint (right : Bool) (xy : ℝ × ℝ) : ℝ := if right then xy.2 else xy.1 + +theorem endpoint_measurable (right : Bool) : Measurable (endpoint right) := by + cases right + · exact measurable_fst + · exact measurable_snd + +theorem endpointComponentDensity_measurable (right : Bool) (i : Fin 5) : + Measurable (p.endpointComponentDensity right i) := + measurable_const.indicator (p.endpointInterval_measurable right i) + +theorem coupling_eq_sum : p.coupling = ∑ i, ENNReal.ofReal (p.labelMass i) • p.pairComponentLaw i := by + unfold coupling labelledCoupling + rw [Measure.map_finset_sum' measurable_snd.aemeasurable] + apply Finset.sum_congr rfl + intro i _ + have hm : Measurable (fun xy : ℝ × ℝ => (i,xy)) := measurable_const.prodMk measurable_id + rw [Measure.map_smul _ measurable_snd.aemeasurable, Measure.map_map measurable_snd hm] + simp [Function.comp_def] + +theorem pairComponentLaw_endpoint (right : Bool) (i : Fin 6) : + (p.pairComponentLaw i).map (endpoint right) = + (Fin.cons unitIntervalMeasure (p.endpointComponentLaw right) : Fin 6 → Measure ℝ) i := by + refine Fin.cases ?_ (fun k => ?_) i + · change (unitIntervalMeasure.map (fun t => (t,t))).map (endpoint right) = _ + have hm : Measurable (fun t : ℝ => (t,t)) := measurable_id.prodMk measurable_id + rw [Measure.map_map (endpoint_measurable right) hm] + cases right <;> simp [endpoint, Function.comp_def] + · change ((p.endpointComponentLaw false k).prod (p.endpointComponentLaw true k)).map (endpoint right) = _ + cases right + · change Measure.map Prod.fst _ = _ + simp + · change Measure.map Prod.snd _ = _ + simp + +/-- Identification of the actual pair law's two endpoint densities. -/ +theorem coupling_endpoint_density (right : Bool) : + p.coupling.map (endpoint right) = + unitIntervalMeasure.withDensity (fun t => ENNReal.ofReal (p.endpointDensity right t)) := by + rw [p.coupling_eq_sum, Measure.map_finset_sum' (endpoint_measurable right).aemeasurable] + simp_rw [Measure.map_smul _ (endpoint_measurable right).aemeasurable, + p.pairComponentLaw_endpoint] + rw [Fin.sum_univ_succ] + change ENNReal.ofReal p.diagonalMass • unitIntervalMeasure + + ∑ i, ENNReal.ofReal (p.replacementMass i) • p.endpointComponentLaw right i = _ + exact (mixture_withDensity unitIntervalMeasure p.diagonalMass p.replacementMass + (p.endpointComponentDensity right) p.diagonalMass_pos.le p.replacementMass_nonneg + (fun i => intervalDensity_nonneg (p.endpointLength_pos right i).le) + (p.endpointComponentDensity_measurable right)).symm + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Mixture.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Mixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..672eb3252902987e2d636cc716868b5d0837402e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Mixture.lean @@ -0,0 +1,139 @@ +import OAI.Analysis.FiniteFactor.Coupling.Density +import OAI.Analysis.FiniteFactor.Coupling.Parameters +import Mathlib.MeasureTheory.Function.L2Space + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +noncomputable section + +variable {X : Type*} [MeasurableSpace X] {μ : Measure X} [IsProbabilityMeasure μ] +variable {ι : Type*} [Fintype ι] + +def mixtureDensity (q : ℝ) (π : ι → ℝ) (d : ι → X → ℝ) (x : X) : ℝ := + q + ∑ i, π i * d i x + +theorem mixtureDensity_memLp (q : ℝ) (π : ι → ℝ) (d : ι → X → ℝ) + (hd : ∀ i, MemLp (d i) 2 μ) : MemLp (mixtureDensity q π d) 2 μ := + (memLp_const q).add (memLp_finsetSum Finset.univ (fun i _ => (hd i).const_mul (π i))) + +theorem mixtureDensity_integral (q : ℝ) (π : ι → ℝ) (d : ι → X → ℝ) + (hd : ∀ i, Integrable (d i) μ) (hm : ∀ i, ∫ x, d i x ∂μ = 1) + (hπ : q + ∑ i, π i = 1) : ∫ x, mixtureDensity q π d x ∂μ = 1 := by + have hi := integral_add (integrable_const q) + (integrable_finsetSum Finset.univ (fun i _ => (hd i).const_mul (π i))) + unfold mixtureDensity + rw [hi, integral_finsetSum Finset.univ (fun i _ => (hd i).const_mul (π i))] + simp_rw [integral_const_mul, hm, mul_one] + simpa using hπ + +theorem mixtureDensity_energy_le (q : ℝ) (π : ι → ℝ) (d : ι → X → ℝ) + (hd : ∀ i, MemLp (d i) 2 μ) (hm : ∀ i, ∫ x, d i x ∂μ = 1) + (hπ : q + ∑ i, π i = 1) (E : ι → ℝ) + (hE : ∀ i, (∫ x, (d i x - 1)^2 ∂μ) ≤ E i) : + (∫ x, mixtureDensity q π d x ^ 2 ∂μ) ≤ + 1 + (Fintype.card ι : ℝ) * ∑ i, (π i)^2 * E i := by + classical + have hd1 (i) : Integrable (d i) μ := (hd i).integrable (by norm_num) + have hh := mixtureDensity_memLp q π d hd + have hm' := mixtureDensity_integral q π d hd1 hm hπ + have heq (x : X) : mixtureDensity q π d x - 1 = ∑ i, π i * (d i x - 1) := by + simp only [mixtureDensity, mul_sub, mul_one, Finset.sum_sub_distrib] + linarith + have hbound (x : X) : (mixtureDensity q π d x - 1)^2 ≤ + (Fintype.card ι : ℝ) * ∑ i, (π i)^2 * (d i x - 1)^2 := by + rw [heq] + simpa [mul_pow] using + (sq_sum_le_card_mul_sum_sq (s := Finset.univ) (f := fun i => π i * (d i x - 1))) + have hsub (i) : MemLp (fun x => d i x - 1) 2 μ := (hd i).sub (memLp_const 1) + have his (i) : Integrable (fun x => (π i)^2 * (d i x - 1)^2) μ := + (hsub i).integrable_sq.const_mul _ + have hi := integral_mono ((hh.sub (memLp_const 1)).integrable_sq) + ((integrable_finsetSum Finset.univ (fun i _ => his i)).const_mul (Fintype.card ι : ℝ)) hbound + rw [integral_const_mul, integral_finsetSum Finset.univ (fun i _ => his i)] at hi + simp_rw [integral_const_mul] at hi + have hsum : (∑ i, (π i)^2 * ∫ x, (d i x - 1)^2 ∂μ) ≤ ∑ i, (π i)^2 * E i := by + exact Finset.sum_le_sum fun i _ => mul_le_mul_of_nonneg_left (hE i) (sq_nonneg _) + have he := density_energy_identity (hh.integrable (by norm_num)) hh.integrable_sq hm' + have hc := mul_le_mul_of_nonneg_left hsum (Nat.cast_nonneg (Fintype.card ι) : (0 : ℝ) ≤ _) + dsimp only [Pi.sub_apply] at hi + linarith + +def unitIntervalMeasure : Measure ℝ := volume.restrict (Set.Ico 0 1) + +instance : IsProbabilityMeasure unitIntervalMeasure := by + constructor + simp [unitIntervalMeasure, Real.volume_Ico] + +theorem unitIntervalMeasure_interval {a b : ℝ} (ha : 0 ≤ a) (hab : a ≤ b) (hb : b ≤ 1) : + unitIntervalMeasure.real (Set.Ico a b) = b-a := by + rw [unitIntervalMeasure, measureReal_restrict_apply measurableSet_Ico, + Set.inter_eq_left.mpr (Set.Ico_subset_Ico ha hb), Real.volume_real_Ico_of_le hab] + +namespace CouplingParameters +variable (p : CouplingParameters) + +def endpointLength (right : Bool) (i : Fin 5) : ℝ := + if right then p.rightLength i else p.leftLength i + +def endpointInterval (right : Bool) (i : Fin 5) : Set ℝ := + if right then Set.Ico (1-p.rightLength i) 1 else Set.Ico 0 (p.leftLength i) + +def endpointComponentDensity (right : Bool) (i : Fin 5) : ℝ → ℝ := + intervalDensity (p.endpointInterval right i) (p.endpointLength right i) + +def endpointDensity (right : Bool) : ℝ → ℝ := + mixtureDensity p.diagonalMass p.replacementMass (p.endpointComponentDensity right) + +theorem endpointLength_pos (right : Bool) (i : Fin 5) : 0 < p.endpointLength right i := by + cases right <;> simp [endpointLength, leftLength_pos, rightLength_pos] + +theorem endpointLength_le (right : Bool) (i : Fin 5) : p.endpointLength right i ≤ 1 := by + have := p.lengths_sum_le i + have := p.leftLength_pos i + have := p.rightLength_pos i + cases right <;> simp [endpointLength] <;> linarith + +theorem endpointInterval_measurable (right : Bool) (i : Fin 5) : + MeasurableSet (p.endpointInterval right i) := by + cases right <;> exact measurableSet_Ico + +theorem endpointInterval_mass (right : Bool) (i : Fin 5) : + unitIntervalMeasure.real (p.endpointInterval right i) = p.endpointLength right i := by + have hpos := p.endpointLength_pos right i + have hle := p.endpointLength_le right i + cases right + · simpa [endpointInterval, endpointLength] using + unitIntervalMeasure_interval (a := 0) (by norm_num) hpos.le hle + · have h₀ : 0 ≤ 1-p.rightLength i := by simpa [endpointLength] using sub_nonneg.mpr hle + have h₁ : 1-p.rightLength i ≤ 1 := by have := p.rightLength_pos i; linarith + simpa [endpointInterval, endpointLength] using + unitIntervalMeasure_interval h₀ h₁ le_rfl + +theorem endpointDensity_memLp (right : Bool) : MemLp (p.endpointDensity right) 2 unitIntervalMeasure := by + apply mixtureDensity_memLp + intro i + exact (memLp_const _).indicator (p.endpointInterval_measurable right i) + +theorem endpointDensity_integral (right : Bool) : + ∫ t, p.endpointDensity right t ∂unitIntervalMeasure = 1 := by + apply mixtureDensity_integral + · intro i + exact intervalDensity_integrable (p.endpointInterval_measurable right i) _ + · intro i + exact intervalDensity_integral (p.endpointInterval_measurable right i) + (p.endpointLength_pos right i) (p.endpointInterval_mass right i) + · exact p.mass_sum + +theorem endpointDensity_lower (right : Bool) (t : ℝ) : + p.diagonalMass ≤ p.endpointDensity right t := by + apply le_add_of_nonneg_right + exact Finset.sum_nonneg fun i _ => mul_nonneg (p.replacementMass_nonneg i) + (intervalDensity_nonneg (p.endpointLength_pos right i).le t) + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Noncrossing.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Noncrossing.lean new file mode 100644 index 0000000000000000000000000000000000000000..abecaaa3c7cc6abfb60c6acbfd012bb5d3bbf934 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Noncrossing.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.FiniteFactor.Coupling.VectorBayes + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory Filter Finset +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +/-- The interval in which the unconditioned partner crosses an eligible threshold. -/ +def crossingPartner (right : Bool) (u : ℝ) : Set ℝ := + if right then Set.Iio u else Set.Ici u + +theorem crossingPartner_measurable (right : Bool) (u : ℝ) : MeasurableSet (crossingPartner right u) := by + cases right + · exact measurableSet_Ici + · exact measurableSet_Iio + +theorem posterior_noncrossing_le_exp (p : CouplingParameters) (right : Bool) (w : Fin 2) + {t u : ℝ} (ht : t ∈ Set.Ico 0 1) (hu : p.width w ≤ u ∧ u ≤ 1-p.width w) + (heligible : if right then u ≤ t else t < u) : + p.posteriorKernel right t (crossingPartner right u)ᶜ ≤ + ENNReal.ofReal (Real.exp (-(p.rho w / 10))) := by + have hlo := p.posteriorLaw_crossing_lower right w ht hu heligible + change ENNReal.ofReal (p.rho w / 10) ≤ p.posteriorKernel right t (crossingPartner right u) at hlo + rw [measure_compl (crossingPartner_measurable right u) (measure_ne_top _ _), measure_univ] + calc + 1 - p.posteriorKernel right t (crossingPartner right u) ≤ 1 - ENNReal.ofReal (p.rho w / 10) := + tsub_le_tsub_left hlo 1 + _ = ENNReal.ofReal (1 - p.rho w / 10) := by rw [ENNReal.ofReal_sub 1 (div_nonneg (p.rho_nonneg w) (by norm_num)), ENNReal.ofReal_one] + _ ≤ _ := ENNReal.ofReal_le_ofReal (by linarith [Real.add_one_le_exp (-(p.rho w / 10))]) + +/-- Simultaneous noncrossing of any fixed eligible coordinates, conditional on +the entire endpoint vector. The exponent is the sum of their actual biases. -/ +theorem vectorPosterior_noncrossing_le_exp {ι : Type*} + (p : ι → CouplingParameters) (right : ι → Bool) (w : ι → Fin 2) + (x u : ι → ℝ) (I : Finset ι) + (hx : ∀ i ∈ I, x i ∈ Set.Ico 0 1) + (hu : ∀ i ∈ I, (p i).width (w i) ≤ u i ∧ u i ≤ 1-(p i).width (w i)) + (heligible : ∀ i ∈ I, if right i then u i ≤ x i else x i < u i) : + vectorPosterior p right x (Set.pi (I : Set ι) (fun i => (crossingPartner (right i) (u i))ᶜ)) ≤ + ENNReal.ofReal (Real.exp (-(∑ i ∈ I, (p i).rho (w i) / 10))) := by + rw [vectorPosterior_independence _ _ _ _ _ (fun i _ => (crossingPartner_measurable (right i) (u i)).compl)] + calc + _ ≤ ∏ i ∈ I, ENNReal.ofReal (Real.exp (-((p i).rho (w i) / 10))) := by + apply Finset.prod_le_prod + intro i hi + exact (p i).posterior_noncrossing_le_exp (right i) (w i) (hx i hi) (hu i hi) (heligible i hi) + _ = _ := by + rw [← ENNReal.ofReal_prod_of_nonneg (fun i _ => (Real.exp_pos _).le), ← Real.exp_sum] + simp only [Finset.sum_neg_distrib] + +theorem vectorPosterior_noncrossing_source_bound {ι : Type*} + (p : ι → CouplingParameters) (right : ι → Bool) (w : ι → Fin 2) + (x u : ι → ℝ) (I : Finset ι) (m ρ L : ℝ) + (hx : ∀ i ∈ I, x i ∈ Set.Ico 0 1) + (hu : ∀ i ∈ I, (p i).width (w i) ≤ u i ∧ u i ≤ 1-(p i).width (w i)) + (heligible : ∀ i ∈ I, if right i then u i ≤ x i else x i < u i) + (hρ : ∀ i ∈ I, (p i).rho (w i) = ρ) + (hρ0 : 0 ≤ ρ) (hcard : m / 40 ≤ (I.card : ℝ)) (hL : L ≤ m*ρ) : + vectorPosterior p right x (Set.pi (I : Set ι) (fun i => (crossingPartner (right i) (u i))ᶜ)) ≤ + ENNReal.ofReal (Real.exp (-L/400)) := by + apply (vectorPosterior_noncrossing_le_exp p right w x u I hx hu heligible).trans + apply ENNReal.ofReal_le_ofReal + apply Real.exp_le_exp.mpr + have he : (∑ i ∈ I, (p i).rho (w i)/10) = I.card * (ρ/10) := by + calc + _ = ∑ i ∈ I, ρ/10 := Finset.sum_congr rfl (fun i hi => by rw [hρ i hi]) + _ = _ := by simp + rw [he] + have hh := mul_le_mul_of_nonneg_right hcard hρ0 + nlinarith + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Order.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Order.lean new file mode 100644 index 0000000000000000000000000000000000000000..d2aeb9b51ffe8ad47d7cc23f37323aff780a2f76 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Order.lean @@ -0,0 +1,65 @@ +import OAI.Analysis.FiniteFactor.Coupling.Infinite + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters +variable (p : CouplingParameters) + +def orderedPairs : Set (ℝ × ℝ) := {xy | xy.1 ≤ xy.2} + +theorem orderedPairs_measurable : MeasurableSet orderedPairs := + measurableSet_le measurable_fst measurable_snd + +theorem componentPair_ordered (i : Fin 6) : p.pairComponentLaw i orderedPairs = 1 := by + refine Fin.cases ?_ (fun k => ?_) i + · change (unitIntervalMeasure.map (fun t => (t,t))) orderedPairs = 1 + have hm : Measurable (fun t : ℝ => (t,t)) := measurable_id.prodMk measurable_id + rw [Measure.map_apply hm orderedPairs_measurable] + simp [orderedPairs] + · change ((p.endpointComponentLaw false k).prod (p.endpointComponentLaw true k)) orderedPairs = 1 + have hU := p.endpointComponentLaw_of_contains false k (Set.Subset.refl _) + have hV := p.endpointComponentLaw_of_contains true k (Set.Subset.refl _) + have hsub : (p.endpointInterval false k ×ˢ p.endpointInterval true k) ⊆ orderedPairs := by + intro xy hxy + have h₁ : xy.1 < p.leftLength k := hxy.1.2 + have h₂ : 1-p.rightLength k ≤ xy.2 := hxy.2.1 + have hlen := p.lengths_sum_le k + change xy.1 ≤ xy.2 + linarith + apply le_antisymm prob_le_one + have h := measure_mono (μ := (p.endpointComponentLaw false k).prod (p.endpointComponentLaw true k)) hsub + rw [Measure.prod_prod, hU, hV, mul_one] at h + exact h + +theorem coupling_ordered : p.coupling orderedPairs = 1 := by + rw [p.coupling_eq_sum, Measure.finsetSum_apply] + simp only [Measure.smul_apply, smul_eq_mul, p.componentPair_ordered, mul_one] + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => p.labelMass_nonneg i), p.labelMass_sum] + simp + +theorem labelledCoupling_ordered : p.labelledCoupling {z | z.2.1 ≤ z.2.2} = 1 := by + have h := p.coupling_ordered + rw [coupling, Measure.map_apply measurable_snd orderedPairs_measurable] at h + exact h + +/-- All infinitely many coordinates are ordered under the actual augmented law. -/ +theorem productCoupling_ordered (p : ℕ → CouplingParameters) : + productCoupling p {ω | ∀ i, (ω i).2.1 ≤ (ω i).2.2} = 1 := by + have hset : {ω : CouplingSample | ∀ i, (ω i).2.1 ≤ (ω i).2.2} = + Set.pi Set.univ (fun _ : ℕ => {z : Fin 6 × (ℝ × ℝ) | z.2.1 ≤ z.2.2}) := by + ext ω + simp + rw [hset, productCoupling, Measure.infinitePi_pi_univ] + · simp [labelledCoupling_ordered] + · intro i + exact orderedPairs_measurable.preimage measurable_snd + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Parameters.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Parameters.lean new file mode 100644 index 0000000000000000000000000000000000000000..69d6e81fd2bd6686527bc4bbc25b34007d5c43ec --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Parameters.lean @@ -0,0 +1,124 @@ +import Mathlib.Algebra.BigOperators.Fin +import Mathlib.Analysis.Real.Sqrt +import Mathlib.Tactic.FinCases +import Mathlib.Tactic.FieldSimp +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.Ring + +namespace OAI + +namespace FiniteFactor +noncomputable section +/-- One block of the actual coupling, with two distinct width labels. The +boolean records whether this is the tagged block. -/ +structure CouplingParameters where + m : ℝ + kappa : ℝ + width : Fin 2 → ℝ + tagged : Bool + m_ge : 100 ≤ m + kappa_nonneg : 0 ≤ kappa + kappa_le : kappa ≤ 1/100 + width_lower : ∀ i, 1/m ≤ width i + width_upper : ∀ i, width i ≤ 1/4 + +namespace CouplingParameters +variable (p : CouplingParameters) + +theorem m_pos : 0 < p.m := by linarith [p.m_ge] +theorem width_pos (i : Fin 2) : 0 < p.width i := + (one_div_pos.mpr p.m_pos).trans_le (p.width_lower i) + +def rho (i : Fin 2) : ℝ := p.kappa * Real.sqrt (p.width i / p.m) +def tagMass : ℝ := if p.tagged then 1/p.m else 0 +def diagonalMass : ℝ := 1 - 2*p.rho 0 - 2*p.rho 1 - p.tagMass + +theorem rho_nonneg (i : Fin 2) : 0 ≤ p.rho i := + mul_nonneg p.kappa_nonneg (Real.sqrt_nonneg _) + +theorem rho_le (i : Fin 2) : p.rho i ≤ p.kappa * p.width i := by + apply mul_le_mul_of_nonneg_left _ p.kappa_nonneg + apply (Real.sqrt_le_iff).2 + refine ⟨(p.width_pos i).le, ?_⟩ + apply (div_le_iff₀ p.m_pos).2 + have h := (div_le_iff₀ p.m_pos).1 (p.width_lower i) + nlinarith [p.width_pos i, mul_nonneg (p.width_pos i).le (sub_nonneg.mpr h)] + +theorem rho_div_width_le (i : Fin 2) : p.rho i / p.width i ≤ p.kappa := + (div_le_iff₀ (p.width_pos i)).2 (p.rho_le i) + +theorem rho_energy (i : Fin 2) : (p.rho i)^2 / p.width i = p.kappa^2 / p.m := by + rw [rho, mul_pow, Real.sq_sqrt (div_nonneg (p.width_pos i).le p.m_pos.le)] + field_simp [p.m_pos.ne', (p.width_pos i).ne'] + +theorem tagMass_nonneg : 0 ≤ p.tagMass := by + unfold tagMass + split + · exact div_nonneg zero_le_one p.m_pos.le + · exact le_rfl + +theorem tagMass_le : p.tagMass ≤ 1/100 := by + unfold tagMass + split + · exact one_div_le_one_div_of_le (by norm_num) p.m_ge + · norm_num + +theorem diagonalMass_lower : 98/100 ≤ p.diagonalMass := by + have h₀ := (p.rho_le 0).trans (mul_le_mul_of_nonneg_left (p.width_upper 0) p.kappa_nonneg) + have h₁ := (p.rho_le 1).trans (mul_le_mul_of_nonneg_left (p.width_upper 1) p.kappa_nonneg) + unfold diagonalMass + linarith [p.kappa_le, p.tagMass_le] + +theorem diagonalMass_pos : 0 < p.diagonalMass := by linarith [p.diagonalMass_lower] + +theorem diagonalMass_le : p.diagonalMass ≤ 1 := by + unfold diagonalMass + linarith [p.rho_nonneg 0, p.rho_nonneg 1, p.tagMass_nonneg] + +/-- 0/1 are top/bottom of width 0, 2/3 of width 1, 4 is the tag. +In particular equal numerical widths do not identify labels. -/ +def replacementMass : Fin 5 → ℝ := + ![p.rho 0, p.rho 0, p.rho 1, p.rho 1, p.tagMass] + +def leftLength : Fin 5 → ℝ := + ![1-p.width 0/2, p.width 0/2, 1-p.width 1/2, p.width 1/2, 1/p.m] + +def rightLength : Fin 5 → ℝ := + ![p.width 0/2, 1-p.width 0/2, p.width 1/2, 1-p.width 1/2, 1/p.m] + +theorem replacementMass_nonneg (i : Fin 5) : 0 ≤ p.replacementMass i := by + fin_cases i <;> simp [replacementMass, rho_nonneg, tagMass_nonneg] + +theorem mass_sum : p.diagonalMass + ∑ i, p.replacementMass i = 1 := by + simp [replacementMass, Fin.sum_univ_succ, diagonalMass] + ring + +theorem leftLength_pos (i : Fin 5) : 0 < p.leftLength i := by + have h₀ := p.width_pos 0 + have h₁ := p.width_pos 1 + have hu₀ := p.width_upper 0 + have hu₁ := p.width_upper 1 + have hm := one_div_pos.mpr p.m_pos + fin_cases i <;> simp [leftLength] <;> linarith [p.m_pos] + +theorem rightLength_pos (i : Fin 5) : 0 < p.rightLength i := by + have h₀ := p.width_pos 0 + have h₁ := p.width_pos 1 + have hu₀ := p.width_upper 0 + have hu₁ := p.width_upper 1 + have hm := one_div_pos.mpr p.m_pos + fin_cases i <;> simp [rightLength] <;> linarith [p.m_pos] + +theorem lengths_sum_le (i : Fin 5) : p.leftLength i + p.rightLength i ≤ 1 := by + have hm : 1/p.m ≤ 1/100 := one_div_le_one_div_of_le (by norm_num) p.m_ge + simp only [one_div] at hm + fin_cases i <;> simp [leftLength, rightLength] + linarith + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Prefix.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Prefix.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d244762982777d00514612db3b4b1241695cd18 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Prefix.lean @@ -0,0 +1,153 @@ +import OAI.Analysis.FiniteFactor.Coupling.FiniteLaw +import OAI.Analysis.FiniteFactor.ProductDensityLimit + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped Topology ENNReal +noncomputable section + +/-- Finite-coordinate factorization under the actual infinite product measure. -/ +theorem integral_infinitePi_finset_prod {ι : Type*} {X : ι → Type*} + [∀ i, MeasurableSpace (X i)] (μ : ∀ i, Measure (X i)) [∀ i, IsProbabilityMeasure (μ i)] + (I : Finset ι) (f : ∀ i, X i → ℝ) (hf : ∀ i, Measurable (f i)) : + (∫ x, ∏ i ∈ I, f i (x i) ∂Measure.infinitePi μ) = ∏ i ∈ I, ∫ t, f i t ∂μ i := by + classical + have he (x : ∀ i, X i) : (∏ i ∈ I, f i (x i)) = ∏ i : I, f i (x i) := + (Finset.prod_coe_sort I (fun i => f i (x i))).symm + simp_rw [he] + change (∫ x, (∏ i : I, f i (I.restrict x i)) ∂Measure.infinitePi μ) = _ + rw [integral_restrict_infinitePi μ + (f := fun x : ∀ i : I, X i => ∏ i : I, f i (x i)) + ((Finset.measurable_prod _ fun (i : I) _ => (hf i).comp (measurable_pi_apply i)).aestronglyMeasurable)] + rw [integral_fintype_prod_eq_prod] + exact Finset.prod_coe_sort I (fun i => ∫ t, f i t ∂μ i) + +namespace CouplingParameters +variable {ι : Type*} + +def prefixDensity (p : ι → CouplingParameters) (right : ι → Bool) + (I : Finset ι) (x : ι → ℝ) : ℝ := ∏ i ∈ I, (p i).endpointDensity (right i) (x i) + +theorem prefixDensity_measurable (p : ι → CouplingParameters) (right : ι → Bool) (I : Finset ι) : + Measurable (prefixDensity p right I) := + Finset.measurable_prod _ fun i _ => ((p i).endpointDensity_measurable (right i)).comp (measurable_pi_apply i) + +theorem prefixDensity_nonneg (p : ι → CouplingParameters) (right : ι → Bool) + (I : Finset ι) (x : ι → ℝ) : 0 ≤ prefixDensity p right I x := + Finset.prod_nonneg fun i _ => ((p i).diagonalMass_pos.trans_le ((p i).endpointDensity_lower (right i) (x i))).le + +theorem prefixDensity_memLp (p : ι → CouplingParameters) (right : ι → Bool) (I : Finset ι) : + MemLp (prefixDensity p right I) 2 (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) := by + apply MemLp.of_bound (prefixDensity_measurable p right I).aestronglyMeasurable (10 ^ I.card) + apply Eventually.of_forall + intro x + rw [Real.norm_of_nonneg (prefixDensity_nonneg p right I x)] + calc + _ ≤ ∏ i ∈ I, (10 : ℝ) := Finset.prod_le_prod₀ + (fun i _ => ((p i).diagonalMass_pos.trans_le ((p i).endpointDensity_lower (right i) (x i))).le) + (fun i _ => ((p i).endpointDensity_lt_ten (right i) (x i)).le) + _ = _ := by simp + +theorem prefixDensity_integral (p : ι → CouplingParameters) (right : ι → Bool) (I : Finset ι) : + (∫ x, prefixDensity p right I x ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) = 1 := by + unfold prefixDensity + rw [integral_infinitePi_finset_prod _ _ _ (fun i => (p i).endpointDensity_measurable (right i))] + simp [endpointDensity_integral] + +theorem prefixDensity_sq_integral (p : ι → CouplingParameters) (right : ι → Bool) (I : Finset ι) : + (∫ x, prefixDensity p right I x ^ 2 ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) = + ∏ i ∈ I, ∫ t, (p i).endpointDensity (right i) t ^ 2 ∂unitIntervalMeasure := by + simp only [prefixDensity, ← Finset.prod_pow] + exact integral_infinitePi_finset_prod _ _ _ (fun i => ((p i).endpointDensity_measurable (right i)).pow_const 2) + +theorem prefixDensity_energy (p : ι → CouplingParameters) (right : ι → Bool) (I : Finset ι) : + (∫ x, prefixDensity p right I x ^ 2 ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) ≤ + Real.exp (∑ i ∈ I, 20*(2*(p i).kappa^2/(p i).m + (p i).tagMass)) := by + classical + rw [prefixDensity_sq_integral, ← Finset.prod_coe_sort I, + ← Finset.sum_coe_sort I] + exact product_energy_le_exp _ _ (fun i => integral_nonneg (fun _ => sq_nonneg _)) + (fun i => (p i).endpointDensity_source_energy (right i)) + +/-- Exact orthogonality identity for nested finite product densities. -/ +theorem prefixDensity_inner (p : ι → CouplingParameters) (right : ι → Bool) + {I J : Finset ι} (hIJ : I ⊆ J) : + (∫ x, prefixDensity p right I x * prefixDensity p right J x + ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) = + ∫ x, prefixDensity p right I x ^ 2 ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure) := by + classical + have he (x : ι → ℝ) : prefixDensity p right I x * prefixDensity p right J x = + ∏ i ∈ J, if i ∈ I then (p i).endpointDensity (right i) (x i)^2 + else (p i).endpointDensity (right i) (x i) := by + have hi : prefixDensity p right I x = ∏ i ∈ J, + if i ∈ I then (p i).endpointDensity (right i) (x i) else 1 := by + rw [← Finset.prod_subset hIJ] + · apply Finset.prod_congr rfl + intro i hi + simp [hi] + · intro i _ hi + simp [hi] + rw [hi, prefixDensity, ← Finset.prod_mul_distrib] + apply Finset.prod_congr rfl + intro i _ + split <;> simp_all [sq] + simp_rw [he] + rw [integral_infinitePi_finset_prod (fun _ : ι => unitIntervalMeasure) J + (fun i t => if i ∈ I then (p i).endpointDensity (right i) t ^ 2 + else (p i).endpointDensity (right i) t) (fun i => by + split + · exact ((p i).endpointDensity_measurable (right i)).pow_const 2 + · exact (p i).endpointDensity_measurable (right i)), prefixDensity_sq_integral] + calc + _ = ∏ i ∈ I, ∫ t, (if i ∈ I then (p i).endpointDensity (right i) t ^ 2 + else (p i).endpointDensity (right i) t) ∂unitIntervalMeasure := by + symm + apply Finset.prod_subset hIJ + intro i _ hi + simp [hi, endpointDensity_integral] + _ = _ := by + apply Finset.prod_congr rfl + intro i hi + simp [hi] + +/-- The lifted prefix density has exactly the finite endpoint law on every +Borel cylinder at that prefix. -/ +theorem prefixDensity_cylinder (p : ι → CouplingParameters) (right : ι → Bool) + (I : Finset ι) {S : Set (I → ℝ)} (hS : MeasurableSet S) : + ENNReal.ofReal (∫ x in (I.restrict (π := fun _ : ι => ℝ)) ⁻¹' S, prefixDensity p right I x + ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) = + Measure.pi (fun i : I => (p i).selectedLaw true (right i)) S := by + classical + rw [finiteProductLaw_density, withDensity_apply _ hS] + rw [← Measure.infinitePi_map_restrict (fun _ : ι => unitIntervalMeasure), + setLIntegral_map hS (finiteProductDensity_measurable + (fun i : I => p i) (fun _ => true) (fun i => right i)).ennreal_ofReal (measurable_restrict I)] + have he (x : ι → ℝ) : finiteProductDensity (fun i : I => p i) + (fun _ => true) (fun i => right i) ((I.restrict (π := fun _ : ι => ℝ)) x) = prefixDensity p right I x := by + exact Finset.prod_coe_sort I (fun i => (p i).endpointDensity (right i) (x i)) + simp_rw [he] + exact ofReal_integral_eq_lintegral_ofReal + ((prefixDensity_memLp p right I).integrable (by norm_num)).restrict + (Eventually.of_forall (prefixDensity_nonneg p right I)) + +/-- Enlarging the prefix does not change any earlier cylinder law. -/ +theorem prefixDensity_cylinder_of_subset (p : ι → CouplingParameters) (right : ι → Bool) + {J I : Finset ι} (hJI : J ⊆ I) {S : Set (J → ℝ)} (hS : MeasurableSet S) : + ENNReal.ofReal (∫ x in (J.restrict (π := fun _ : ι => ℝ)) ⁻¹' S, prefixDensity p right I x + ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) = + Measure.pi (fun i : J => (p i).selectedLaw true (right i)) S := by + have he : (J.restrict (π := fun _ : ι => ℝ)) ⁻¹' S = (I.restrict (π := fun _ : ι => ℝ)) ⁻¹' ((Finset.restrict₂ (π := fun _ : ι => ℝ) hJI : (I → ℝ) → (J → ℝ)) ⁻¹' S) := by + rw [← Set.preimage_comp, Finset.restrict₂_comp_restrict hJI] + rw [he, prefixDensity_cylinder p right I (hS.preimage (measurable_restrict₂ hJI))] + have hh := congrArg (fun ν : Measure (J → ℝ) => ν S) + (isProjectiveMeasureFamily_pi (fun i => (p i).selectedLaw true (right i)) I J hJI) + rw [Measure.map_apply (show Measurable (Finset.restrict₂ (π := fun _ : ι => ℝ) hJI) from measurable_restrict₂ hJI) hS] at hh + exact hh.symm + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/Products.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/Products.lean new file mode 100644 index 0000000000000000000000000000000000000000..48b291b31a56abba75696ccde772a105363c2ffd --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/Products.lean @@ -0,0 +1,184 @@ +import OAI.Analysis.FiniteFactor.Coupling.Bayes +import Mathlib.Analysis.PSeries + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section + +/-- The source's kappa_s, with natural indices shifted to start at one. -/ +def sourceKappa (s : ℕ) : ℝ := 1 / (100*((s : ℝ)+1)) + +theorem sourceKappa_sq_summable : Summable (fun s => sourceKappa s ^ 2) := by + have hs : Summable (fun s : ℕ => 1/(s : ℝ)^2) := + Real.summable_one_div_nat_pow.mpr (by norm_num) + have hs' := (summable_nat_add_iff 1).2 hs + have heq (s : ℕ) : sourceKappa s ^ 2 = (1/10000 : ℝ) * (1/((s+1 : ℕ) : ℝ)^2) := by + simp only [sourceKappa, Nat.cast_add, Nat.cast_one] + field_simp + ring + simp_rw [heq] + exact hs'.mul_left _ + +namespace CouplingParameters + +theorem block_energy_cancellation (p : CouplingParameters) : + p.m * (2*p.kappa^2/p.m + p.tagMass) = 2*p.kappa^2 + if p.tagged then 1 else 0 := by + unfold tagMass + split <;> field_simp [p.m_pos.ne'] + simp + +/-- The sum over arbitrary finite sets of whole blocks is uniformly bounded. +The unique tagged block contributes at most one, even when it is absent. -/ +theorem uniform_block_budget (p : ℕ → CouplingParameters) (j : ℕ) + (htag : ∀ s, (p s).tagged = decide (s=j)) + (hκ : Summable (fun s => (p s).kappa^2)) (B : Finset ℕ) : + (∑ s ∈ B, (p s).m * (2*(p s).kappa^2/(p s).m + (p s).tagMass)) ≤ + 2*(∑' s, (p s).kappa^2) + 1 := by + simp_rw [block_energy_cancellation, htag, decide_eq_true_eq] + rw [Finset.sum_add_distrib, ← Finset.mul_sum] + have hs := hκ.sum_le_tsum B (fun s _ => sq_nonneg ((p s).kappa)) + have ht : (∑ s ∈ B, if s=j then (1 : ℝ) else 0) ≤ 1 := by + simp only [Finset.sum_ite_eq'] + split <;> norm_num + linarith + +/-- A coordinate may be omitted altogether, and every included coordinate may +choose its endpoint independently of every other coordinate. -/ +def selectedDensity (p : CouplingParameters) (enabled right : Bool) (t : ℝ) : ℝ := + if enabled then p.endpointDensity right t else 1 + +theorem selectedDensity_energy (p : CouplingParameters) (enabled right : Bool) : + (∫ t, p.selectedDensity enabled right t ^ 2 ∂unitIntervalMeasure) ≤ + 1 + 20*(2*p.kappa^2/p.m + p.tagMass) := by + cases enabled + · simp only [selectedDensity, Bool.false_eq_true, ↓reduceIte, one_pow] + simp only [integral_const, probReal_univ, smul_eq_mul, mul_one] + have he : 0 ≤ 20*(2*p.kappa^2/p.m + p.tagMass) := + mul_nonneg (by norm_num) (add_nonneg + (div_nonneg (mul_nonneg (by norm_num) (sq_nonneg _)) p.m_pos.le) p.tagMass_nonneg) + linarith + · exact p.endpointDensity_source_energy right + +/-- Actual finite product of the chosen coordinate densities. -/ +def finiteProductDensity {ι : Type*} [Fintype ι] (p : ι → CouplingParameters) + (enabled right : ι → Bool) (x : ι → ℝ) : ℝ := + ∏ i, (p i).selectedDensity (enabled i) (right i) (x i) + +theorem finiteProductDensity_energy {ι : Type*} [Fintype ι] + (p : ι → CouplingParameters) (enabled right : ι → Bool) : + (∫ x, finiteProductDensity p enabled right x ^ 2 + ∂Measure.pi (fun _ : ι => unitIntervalMeasure)) ≤ + Real.exp (∑ i, 20*(2*(p i).kappa^2/(p i).m + (p i).tagMass)) := by + unfold finiteProductDensity + rw [product_density_sq_integral] + exact product_energy_le_exp _ _ (fun i => integral_nonneg (fun _ => sq_nonneg _)) + (fun i => (p i).selectedDensity_energy (enabled i) (right i)) + +/-- Prefixes and all intermediate endpoint selections have a common square +integral bound. A finite prefix is represented by enabling its coordinates +inside any finite collection of blocks containing that prefix. -/ +theorem finite_block_product_uniform (p : ℕ → CouplingParameters) (m : ℕ → ℕ) + (hm : ∀ s, (p s).m = (m s : ℝ)) (j : ℕ) + (htag : ∀ s, (p s).tagged = decide (s=j)) + (hκ : Summable (fun s => (p s).kappa^2)) (B : Finset ℕ) + (enabled right : (Σ s : B, Fin (m s)) → Bool) : + (∫ x, finiteProductDensity (fun i : Σ s : B, Fin (m s) => p i.1) + enabled right x ^ 2 ∂Measure.pi (fun _ : Σ s : B, Fin (m s) => unitIntervalMeasure)) ≤ + Real.exp (20*(2*(∑' s, (p s).kappa^2)+1)) := by + apply (finiteProductDensity_energy _ enabled right).trans + apply Real.exp_le_exp.mpr + have heq : (∑ i : Σ s : B, Fin (m s), 20*(2*(p i.1).kappa^2/(p i.1).m + (p i.1).tagMass)) = + 20 * ∑ s ∈ B, (p s).m * (2*(p s).kappa^2/(p s).m + (p s).tagMass) := by + rw [Fintype.sum_sigma] + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + change (∑ s : B, (fun s : ℕ => (m s : ℝ) * (20*(2*(p s).kappa^2/(p s).m + (p s).tagMass))) s) = _ + rw [Finset.sum_coe_sort B (fun s => (m s : ℝ) * (20*(2*(p s).kappa^2/(p s).m + (p s).tagMass)))] + rw [Finset.mul_sum] + apply Finset.sum_congr rfl + intro s _ + rw [hm s] + ring + rw [heq] + exact mul_le_mul_of_nonneg_left (uniform_block_budget p j htag hκ B) (by norm_num) + +theorem selectedDensity_nonneg (p : CouplingParameters) (enabled right : Bool) (t : ℝ) : + 0 ≤ p.selectedDensity enabled right t := by + cases enabled + · exact zero_le_one + · exact (p.diagonalMass_pos.trans_le (p.endpointDensity_lower right t)).le + +theorem selectedDensity_le_ten (p : CouplingParameters) (enabled right : Bool) (t : ℝ) : + p.selectedDensity enabled right t ≤ 10 := by + cases enabled + · norm_num [selectedDensity] + · exact (p.endpointDensity_lt_ten right t).le + +theorem selectedDensity_measurable (p : CouplingParameters) (enabled right : Bool) : + Measurable (p.selectedDensity enabled right) := by + cases enabled + · exact measurable_const + · exact p.endpointDensity_measurable right + +theorem selectedDensity_memLp (p : CouplingParameters) (enabled right : Bool) : + MemLp (p.selectedDensity enabled right) 2 unitIntervalMeasure := by + cases enabled + · exact memLp_const 1 + · exact p.endpointDensity_memLp right + +theorem selectedDensity_integral (p : CouplingParameters) (enabled right : Bool) : + ∫ t, p.selectedDensity enabled right t ∂unitIntervalMeasure = 1 := by + cases enabled + · simp [selectedDensity] + · exact p.endpointDensity_integral right + +theorem finiteProductDensity_measurable {ι : Type*} [Fintype ι] + (p : ι → CouplingParameters) (enabled right : ι → Bool) : + Measurable (finiteProductDensity p enabled right) := by + exact Finset.measurable_prod _ fun i _ => + ((p i).selectedDensity_measurable (enabled i) (right i)).comp (measurable_pi_apply i) + +/-- Membership in L2 is proved, so the uniform square-integral bound is not +an assertion about a Bochner integral of a nonintegrable function. -/ +theorem finiteProductDensity_memLp {ι : Type*} [Fintype ι] + (p : ι → CouplingParameters) (enabled right : ι → Bool) : + MemLp (finiteProductDensity p enabled right) 2 (Measure.pi (fun _ : ι => unitIntervalMeasure)) := by + apply MemLp.of_bound (finiteProductDensity_measurable p enabled right).aestronglyMeasurable + ((10 : ℝ)^(Fintype.card ι)) + apply Filter.Eventually.of_forall + intro x + have hnon : 0 ≤ finiteProductDensity p enabled right x := + Finset.prod_nonneg fun i _ => (p i).selectedDensity_nonneg (enabled i) (right i) (x i) + rw [Real.norm_of_nonneg hnon] + unfold finiteProductDensity + calc + _ ≤ ∏ _i : ι, (10 : ℝ) := Finset.prod_le_prod₀ + (fun i _ => (p i).selectedDensity_nonneg (enabled i) (right i) (x i)) + (fun i _ => (p i).selectedDensity_le_ten (enabled i) (right i) (x i)) + _ = _ := by simp + +theorem finiteProductDensity_integral {ι : Type*} [Fintype ι] + (p : ι → CouplingParameters) (enabled right : ι → Bool) : + ∫ x, finiteProductDensity p enabled right x ∂Measure.pi (fun _ : ι => unitIntervalMeasure) = 1 := by + unfold finiteProductDensity + rw [integral_fintype_prod_eq_prod (fun i => (p i).selectedDensity (enabled i) (right i))] + simp [selectedDensity_integral] + +/-- Exact source kappa, independent of the tagged stage, yields one fixed bound. -/ +theorem finite_block_product_source_uniform (p : ℕ → CouplingParameters) (m : ℕ → ℕ) + (hm : ∀ s, (p s).m = (m s : ℝ)) (j : ℕ) + (htag : ∀ s, (p s).tagged = decide (s=j)) (hκ : ∀ s, (p s).kappa = sourceKappa s) + (B : Finset ℕ) (enabled right : (Σ s : B, Fin (m s)) → Bool) : + (∫ x, finiteProductDensity (fun i : Σ s : B, Fin (m s) => p i.1) + enabled right x ^ 2 ∂Measure.pi (fun _ : Σ s : B, Fin (m s) => unitIntervalMeasure)) ≤ + Real.exp (20*(2*(∑' s, sourceKappa s ^ 2)+1)) := by + have hs : Summable (fun s => (p s).kappa^2) := by simpa only [hκ] using sourceKappa_sq_summable + simpa only [hκ] using finite_block_product_uniform p m hm j htag hs B enabled right + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/TaggedAdmissibility.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/TaggedAdmissibility.lean new file mode 100644 index 0000000000000000000000000000000000000000..2afcad05683de867b7369debf190054aa9142c1e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/TaggedAdmissibility.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TagLaw +import OAI.Analysis.FiniteFactor.Coupling.CoordinateMass + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +def currentBoundary (p : CouplingParameters) : Set (Fin 6 × (ℝ × ℝ)) := + {z | z.2.1 < 1-2/p.m ∧ 2/p.m < z.2.2} + +def currentTag (p : CouplingParameters) : Set (Fin 6 × (ℝ × ℝ)) := + {z | z.1 = 5} ∩ p.currentBoundary + +def currentNonTag (p : CouplingParameters) : Set (Fin 6 × (ℝ × ℝ)) := + {z | z.1 ≠ 5} ∩ p.currentBoundary + +theorem currentBoundary_measurable (p : CouplingParameters) : MeasurableSet p.currentBoundary := + (measurableSet_lt (measurable_fst.comp measurable_snd) measurable_const).inter + (measurableSet_lt measurable_const (measurable_snd.comp measurable_snd)) + +theorem currentTag_measurable (p : CouplingParameters) : MeasurableSet p.currentTag := + ((measurableSet_singleton (5 : Fin 6)).preimage measurable_fst).inter p.currentBoundary_measurable + +theorem currentNonTag_measurable (p : CouplingParameters) : MeasurableSet p.currentNonTag := + (((measurableSet_singleton (5 : Fin 6)).preimage measurable_fst).compl).inter p.currentBoundary_measurable + +theorem currentTag_mass (p : CouplingParameters) : + p.labelledCoupling p.currentTag = ENNReal.ofReal p.tagMass := by + have hsmall : 1/p.m + 2/p.m < 1 := by + rw [← add_div] + apply (div_lt_one p.m_pos).mpr + linarith [p.m_ge] + have he : p.currentTag =ᵐ[p.labelledCoupling] {z | z.1 = 5} := by + filter_upwards [p.labelledCoupling_tag_support] with z hz + apply propext + constructor + · exact fun h => h.1 + · intro h + obtain ⟨hx,hy⟩ := hz h + exact ⟨h,by constructor <;> linarith⟩ + rw [measure_congr he,p.labelledCoupling_label] + rfl + +theorem currentTag_disjoint (p : CouplingParameters) : Disjoint p.currentTag p.currentNonTag := by + apply Set.disjoint_left.mpr + intro z ht ha + exact ha.1 ht.1 + +/-- The source's one-coordinate nontagged admissible mass, including both +endpoint losses, under the actual labelled coupling. -/ +theorem currentNonTag_mass_lower (p : CouplingParameters) : + ENNReal.ofReal (1-41/p.m) ≤ p.labelledCoupling p.currentNonTag := by + let L : Set (Fin 6 × (ℝ × ℝ)) := {z | z.1 = 5} + let X : Set (Fin 6 × (ℝ × ℝ)) := {z | 1-2/p.m ≤ z.2.1} + let Y : Set (Fin 6 × (ℝ × ℝ)) := {z | z.2.2 ≤ 2/p.m} + have he : p.currentNonTagᶜ = (L ∪ X) ∪ Y := by + ext z + simp only [currentNonTag,currentBoundary,L,X,Y,Set.mem_compl_iff,Set.mem_inter_iff, + Set.mem_union,Set.mem_ofPred_eq,not_and_or,not_not,not_lt] + tauto + have hL : p.labelledCoupling.real L ≤ 1/p.m := by + rw [measureReal_def,p.labelledCoupling_label] + change (ENNReal.ofReal p.tagMass).toReal ≤ 1/p.m + rw [ENNReal.toReal_ofReal p.tagMass_nonneg] + unfold tagMass + split_ifs + · exact le_rfl + · exact div_nonneg zero_le_one p.m_pos.le + have hX : p.labelledCoupling.real X ≤ 10*(2/p.m) := + ENNReal.toReal_le_of_le_ofReal (mul_nonneg (by norm_num) (div_nonneg (by norm_num) p.m_pos.le)) (p.labelledCoupling_right_tail (2/p.m)) + have hY : p.labelledCoupling.real Y ≤ 10*(2/p.m) := + ENNReal.toReal_le_of_le_ofReal (mul_nonneg (by norm_num) (div_nonneg (by norm_num) p.m_pos.le)) (p.labelledCoupling_left_tail (2/p.m)) + have hc := (measureReal_union_le (μ := p.labelledCoupling) (L ∪ X) Y).trans + (add_le_add (measureReal_union_le (μ := p.labelledCoupling) L X) le_rfl) + rw [← he,measureReal_compl p.currentNonTag_measurable] at hc + simp only [probReal_univ] at hc + have hh : 1-41/p.m ≤ p.labelledCoupling.real p.currentNonTag := by + have hid : 41/p.m = 1/p.m + 10*(2/p.m) + 10*(2/p.m) := by ring + rw [hid] + linarith + exact (ENNReal.ofReal_le_ofReal hh).trans_eq (ENNReal.ofReal_toReal (measure_ne_top _ _)) + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Coupling/VectorBayes.lean b/lean/OAI/Analysis/FiniteFactor/Coupling/VectorBayes.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a0593d0d8a709ad4d0a76c45aeaa935b4749b2d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Coupling/VectorBayes.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.FiniteFactor.Coupling.Infinite +import OAI.Analysis.FiniteFactor.Coupling.FiniteLaw +import OAI.Analysis.FiniteFactor.ProductKernel + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory Finset +open scoped ENNReal +noncomputable section +namespace CouplingParameters + +/-- The orientation records the conditioning endpoint first. -/ +def orientPair (right : Bool) (z : ℝ × ℝ) : ℝ × ℝ := + (endpoint right z, endpoint (!right) z) + +theorem orientPair_measurable (right : Bool) : Measurable (orientPair right) := + (endpoint_measurable right).prodMk (endpoint_measurable (!right)) + +theorem posterior_compProd (p : CouplingParameters) (right : Bool) : + (p.selectedLaw true right) ⊗ₘ (p.posteriorKernel right) = + p.coupling.map (orientPair right) := by + apply Measure.ext_prod + intro A B hA hB + rw [Measure.compProd_apply_prod hA hB, selectedLaw_endpoint, + Measure.map_apply (orientPair_measurable right) (hA.prod hB)] + cases right + · exact p.conditional_given_x hA hB + · have he : orientPair true ⁻¹' (A ×ˢ B) = B ×ˢ A := by + ext z + simp [orientPair, endpoint, and_comm] + rw [he] + exact p.conditional_given_y hA hB + +def vectorCoupling {ι : Type*} (p : ι → CouplingParameters) : + Measure (ι → Fin 6 × (ℝ × ℝ)) := Measure.infinitePi (fun i => (p i).labelledCoupling) + +instance vectorCoupling_probability {ι : Type*} (p : ι → CouplingParameters) : + IsProbabilityMeasure (vectorCoupling p) := by unfold vectorCoupling; infer_instance + +def vectorEndpoint {ι : Type*} (right : ι → Bool) (ω : ι → Fin 6 × (ℝ × ℝ)) (i : ι) : ℝ := + endpoint (right i) (ω i).2 + +theorem vectorEndpoint_measurable {ι : Type*} (right : ι → Bool) : Measurable (vectorEndpoint right) := by + exact Measurable.of_eval (fun i => (endpoint_measurable (right i)).comp + (measurable_snd.comp (measurable_pi_apply i))) + +theorem vectorEndpoint_law {ι : Type*} (p : ι → CouplingParameters) (right : ι → Bool) : + (vectorCoupling p).map (vectorEndpoint right) = + Measure.infinitePi (fun i => (p i).selectedLaw true (right i)) := by + unfold vectorCoupling vectorEndpoint + rw [Measure.infinitePi_map_pi _ + (f := fun i (z : Fin 6 × (ℝ × ℝ)) => endpoint (right i) z.2) + (fun i => (endpoint_measurable (right i)).comp measurable_snd)] + simp_rw [labelled_endpoint_density] + rfl + +def vectorPosterior {ι : Type*} (p : ι → CouplingParameters) (right : ι → Bool) : + Kernel (ι → ℝ) (ι → ℝ) := independentKernel (fun i => (p i).posteriorKernel (right i)) + +instance vectorPosterior_markov {ι : Type*} (p : ι → CouplingParameters) (right : ι → Bool) : + IsMarkovKernel (vectorPosterior p right) := by unfold vectorPosterior; infer_instance + +/-- The product posterior is the conditional law given the entire selected +endpoint vector. This identity holds for the actual augmented product law. -/ +theorem vectorPosterior_disintegration {ι : Type*} (p : ι → CouplingParameters) (right : ι → Bool) : + ((vectorCoupling p).map (vectorEndpoint right)) ⊗ₘ (vectorPosterior p right) = + (vectorCoupling p).map (fun ω => (vectorEndpoint right ω, vectorEndpoint (fun i => !right i) ω)) := by + rw [vectorEndpoint_law] + have hh := independentKernel_compProd (fun i => (p i).selectedLaw true (right i)) + (fun i => (p i).posteriorKernel (right i)) + simp_rw [posterior_compProd] at hh + let zip : (ι → ℝ) × (ι → ℝ) → (ι → ℝ × ℝ) := fun z i => (z.1 i, z.2 i) + let unzip : (ι → ℝ × ℝ) → (ι → ℝ) × (ι → ℝ) := fun z => (fun i => (z i).1, fun i => (z i).2) + have hz : Measurable zip := by fun_prop + have hu : Measurable unzip := by fun_prop + have hleft := congrArg (fun ν : Measure (ι → ℝ × ℝ) => ν.map unzip) hh + rw [Measure.map_map hu hz] at hleft + have hid : unzip ∘ zip = id := rfl + rw [hid, Measure.map_id] at hleft + change _ = (Measure.infinitePi (fun i => (p i).coupling.map (orientPair (right i)))).map unzip at hleft + unfold vectorPosterior + rw [hleft] + have hp : (vectorCoupling p).map (fun ω i => orientPair (right i) (ω i).2) = + Measure.infinitePi (fun i => (p i).coupling.map (orientPair (right i))) := by + unfold vectorCoupling + rw [Measure.infinitePi_map_pi _ + (f := fun i (z : Fin 6 × (ℝ × ℝ)) => orientPair (right i) z.2) + (fun i => (orientPair_measurable (right i)).comp measurable_snd)] + congr 1 + funext i + unfold coupling + rw [Measure.map_map (orientPair_measurable (right i)) measurable_snd] + rfl + have hv : Measurable (fun (ω : ι → Fin 6 × (ℝ × ℝ)) i => orientPair (right i) (ω i).2) := + Measurable.of_eval (fun i => (orientPair_measurable (right i)).comp + (measurable_snd.comp (measurable_pi_apply i))) + rw [← hp, Measure.map_map hu hv] + rfl + +/-- Full-vector conditional independence, including both endpoint orientations. +Together with vectorPosterior_disintegration this is independence under the +actual conditional law, not a statement about a separately chosen product. -/ +theorem vectorPosterior_independence {ι : Type*} (p : ι → CouplingParameters) (right : ι → Bool) + (x : ι → ℝ) (I : Finset ι) (S : ι → Set ℝ) (hS : ∀ i ∈ I, MeasurableSet (S i)) : + vectorPosterior p right x (Set.pi (I : Set ι) S) = + ∏ i ∈ I, (p i).posteriorKernel (right i) (x i) (S i) := + independentKernel_pi _ x I S hS + +/-- Defining conditional identity for every measurable pair of full-vector events. -/ +theorem vectorPosterior_rectangle {ι : Type*} (p : ι → CouplingParameters) (right : ι → Bool) + {A B : Set (ι → ℝ)} (hA : MeasurableSet A) (hB : MeasurableSet B) : + (∫⁻ x in A, vectorPosterior p right x B ∂((vectorCoupling p).map (vectorEndpoint right))) = + vectorCoupling p {ω | vectorEndpoint right ω ∈ A ∧ vectorEndpoint (fun i => !right i) ω ∈ B} := by + rw [← Measure.compProd_apply_prod hA hB, vectorPosterior_disintegration, + Measure.map_apply ((vectorEndpoint_measurable right).prodMk + (vectorEndpoint_measurable (fun i => !right i))) (hA.prod hB)] + rfl + +end CouplingParameters +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AngleLaw.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AngleLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..44d63e7f15c0bcc840cfed64c4eb8f17e0c1461b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AngleLaw.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.StageOperator +import Mathlib.Probability.ConditionalProbability +import Mathlib.Probability.Independence.InfinitePi + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- The source angle interval has length 1/N_s, where N_s=m_s K_s. -/ +def sourceAngleUnit (i : SourceCoordinate) : ℝ := + 1 / ((sourceBlockSize i.1 : ℝ) * (sourceStageState i.1).K) + +theorem sourceAngleUnit_pos (i : SourceCoordinate) : 0 < sourceAngleUnit i := + one_div_pos.mpr (mul_pos (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1)) + +def sourceAngleInterval (i : SourceCoordinate) : Set ℝ := + Set.Icc (sourceAngleUnit i) (2 * sourceAngleUnit i) + +/-- Normalized Lebesgue measure on the actual source interval. -/ +def sourceAngleMarginal (i : SourceCoordinate) : Measure ℝ := + cond volume (sourceAngleInterval i) + +theorem sourceAngleInterval_volume (i : SourceCoordinate) : + volume (sourceAngleInterval i) = ENNReal.ofReal (sourceAngleUnit i) := by + simp [sourceAngleInterval, Real.volume_Icc, show 2 * sourceAngleUnit i - sourceAngleUnit i = sourceAngleUnit i by ring] + +instance sourceAngleMarginal_probability (i : SourceCoordinate) : + IsProbabilityMeasure (sourceAngleMarginal i) := by + unfold sourceAngleMarginal + apply cond_isProbabilityMeasure_of_finite + · rw [sourceAngleInterval_volume]; exact (ENNReal.ofReal_pos.mpr (sourceAngleUnit_pos i)).ne' + · rw [sourceAngleInterval_volume]; exact ENNReal.ofReal_ne_top + +instance sourceAngleMarginal_atomless (i : SourceCoordinate) : + NullSingletonClass (sourceAngleMarginal i) := by + constructor + intro x + exact cond_absolutelyContinuous (measure_singleton x) + +/-- This law is selected before any invariant projection is considered. -/ +def sourceAngleLaw : Measure (SourceCoordinate → ℝ) := + Measure.infinitePi sourceAngleMarginal + +instance sourceAngleLaw_probability : IsProbabilityMeasure sourceAngleLaw := by + unfold sourceAngleLaw + infer_instance + +theorem sourceAngleLaw_coordinate (i : SourceCoordinate) : + sourceAngleLaw.map (fun θ => θ i) = sourceAngleMarginal i := + Measure.infinitePi_map_eval _ _ + +theorem sourceAngleLaw_independent : + iIndepFun (fun i (θ : SourceCoordinate → ℝ) => θ i) sourceAngleLaw := + iIndepFun_infinitePi (X := fun _ (x : ℝ) => x) (fun _ => measurable_id) + +theorem sourceAngleLaw_cylinder (I : Finset SourceCoordinate) + (S : SourceCoordinate → Set ℝ) (hS : ∀ i ∈ I, MeasurableSet (S i)) : + sourceAngleLaw (Set.pi (I : Set SourceCoordinate) S) = + ∏ i ∈ I, sourceAngleMarginal i (S i) := + Measure.infinitePi_pi _ hS + +theorem sourceAngleMarginal_ae (i : SourceCoordinate) : + ∀ᵐ t ∂sourceAngleMarginal i, t ∈ sourceAngleInterval i := by + exact ae_cond_mem measurableSet_Icc + +/-- All interval constraints hold simultaneously, not just coordinatewise. -/ +theorem sourceAngleLaw_admissible : ∀ᵐ θ ∂sourceAngleLaw, SourceAngles θ := by + have h (i : SourceCoordinate) : ∀ᵐ θ ∂sourceAngleLaw, θ i ∈ sourceAngleInterval i := by + have hh := sourceAngleMarginal_ae i + rw [← sourceAngleLaw_coordinate i] at hh + exact (ae_map_iff (measurable_pi_apply i).aemeasurable measurableSet_Icc).mp hh + filter_upwards [ae_all_iff.mpr h] with θ hθ + intro i + change (1 : ℝ) / ((sourceBlockSize i.1 : ℝ) * (sourceStageState i.1).K) ≤ θ i ∧ + θ i ≤ 2 / ((sourceBlockSize i.1 : ℝ) * (sourceStageState i.1).K) + simpa [sourceAngleInterval, sourceAngleUnit, div_eq_mul_inv] using hθ i + +theorem sourceAngleLaw_operator : ∀ᵐ θ ∂sourceAngleLaw, ∃ hθ : SourceAngles θ, + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + filter_upwards [sourceAngleLaw_admissible] with θ hθ + exact ⟨hθ, staged_sourceOperator_properties θ hθ⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AngleRelations.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AngleRelations.lean new file mode 100644 index 0000000000000000000000000000000000000000..c5111e2034600669317eea882a539c7211041e0b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AngleRelations.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.AngleLaw +import Mathlib.Data.Finsupp.Encodable + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory Filter +open scoped ENNReal +noncomputable section + +/-- Independent real variables cannot satisfy a prescribed affine equation +when the second variable has no atoms. -/ +theorem independent_sum_ne {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} + [IsProbabilityMeasure μ] {f g : Ω → ℝ} (hf : Measurable f) (hg : Measurable g) + (hfg : IndepFun f g μ) (hg0 : ∀ r : ℝ, μ {ω | g ω = r} = 0) (c : ℝ) : + ∀ᵐ ω ∂μ, f ω + g ω ≠ c := by + have hp : MeasurableSet {z : ℝ × ℝ | z.1+z.2 ≠ c} := + (measurableSet_eq_fun (measurable_fst.add measurable_snd) measurable_const).compl + have ha : ∀ᵐ z ∂(μ.map f).prod (μ.map g), z.1+z.2 ≠ c := by + apply (Measure.ae_prod_iff_ae_ae hp).mpr + apply Eventually.of_forall + intro x + have he : (μ.map g) {y : ℝ | x+y = c} = 0 := by + have hs : {y : ℝ | x+y = c} = {c-x} := by ext y; simp; constructor <;> intro h <;> linarith + rw [hs, Measure.map_apply hg (measurableSet_singleton _)] + exact hg0 _ + exact measure_eq_zero_iff_ae_notMem.mp he + rw [← hfg.map_prod_eq_prod_map_map hf.aemeasurable hg.aemeasurable] at ha + exact (ae_map_iff (hf.prodMk hg).aemeasurable hp).mp ha + +theorem sourceAngleLaw_scaled_atomless (i : SourceCoordinate) (a : ℝ) (ha : a ≠ 0) (r : ℝ) : + sourceAngleLaw {θ | a*θ i = r} = 0 := by + have hs : {θ : SourceCoordinate → ℝ | a*θ i = r} = + (fun θ : SourceCoordinate → ℝ => θ i) ⁻¹' {r/a} := by + ext θ + simp only [Set.mem_ofPred_eq, Set.mem_preimage, Set.mem_singleton_iff] + constructor + · intro h; apply (eq_div_iff ha).mpr; nlinarith [h] + · intro h; rw [h, mul_div_cancel₀ _ ha] + rw [hs, ← Measure.map_apply (measurable_pi_apply i) (measurableSet_singleton _), + sourceAngleLaw_coordinate] + exact measure_singleton _ + +/-- Every nontrivial finitely supported integer relation has probability zero. -/ +theorem sourceAngleLaw_relation_ne (v : SourceCoordinate →₀ ℤ) (hv : v ≠ 0) (c : ℤ) : + ∀ᵐ θ ∂sourceAngleLaw, v.sum (fun i n => (n : ℝ)*θ i) ≠ (c : ℝ) := by + classical + obtain ⟨i, hi⟩ := Finsupp.support_nonempty_iff.mpr hv + have hvi : (v i : ℝ) ≠ 0 := by exact_mod_cast Finsupp.mem_support_iff.mp hi + let f (j : SourceCoordinate) (θ : SourceCoordinate → ℝ) : ℝ := (v j : ℝ)*θ j + have hm (j : SourceCoordinate) : Measurable (f j) := measurable_const.mul (measurable_pi_apply j) + have hind : iIndepFun f sourceAngleLaw := + sourceAngleLaw_independent.comp (fun j (t : ℝ) => (v j : ℝ)*t) + (fun _ => measurable_const.mul measurable_id) + have hh := independent_sum_ne (Finset.measurable_sum (v.support.erase i) (fun j _ => hm j)) (hm i) + (by + convert hind.indepFun_finsetSum_of_notMem hm (Finset.notMem_erase i v.support) using 1 + funext θ + simp only [Finset.sum_apply]) + (sourceAngleLaw_scaled_atomless i (v i : ℝ) hvi) (c : ℝ) + filter_upwards [hh] with θ hθ + simpa only [Finsupp.sum, ← Finset.sum_erase_add _ _ hi] using hθ + +/-- Exact integer formulation of rational independence of 1 and all angles. -/ +def SourceRationalIndependent (θ : SourceCoordinate → ℝ) : Prop := + ∀ (v : SourceCoordinate →₀ ℤ) (c : ℤ), + v.sum (fun i n => (n : ℝ)*θ i) = (c : ℝ) → v = 0 ∧ c = 0 + +theorem sourceAngleLaw_rationalIndependent : + ∀ᵐ θ ∂sourceAngleLaw, SourceRationalIndependent θ := by + have h (v : SourceCoordinate →₀ ℤ) (c : ℤ) : + ∀ᵐ θ ∂sourceAngleLaw, v.sum (fun i n => (n : ℝ)*θ i) = (c : ℝ) → v = 0 ∧ c = 0 := by + by_cases hv : v = 0 + · subst v + apply Eventually.of_forall + intro θ hθ + simp only [Finsupp.sum_zero_index] at hθ + exact ⟨rfl, by exact_mod_cast hθ.symm⟩ + · filter_upwards [sourceAngleLaw_relation_ne v hv c] with θ hθ he + exact (hθ he).elim + exact ae_all_iff.mpr (fun v => ae_all_iff.mpr (h v)) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AssignedBadEvents.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AssignedBadEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..b47cf74cca79d3edd84456ce4ef6a6cc17b5c3b0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/AssignedBadEvents.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.CouplingBudget +import OAI.Analysis.FiniteFactor.BiasedPairs.RealIdentity +import OAI.Analysis.FiniteFactor.CrossedProduct.Attenuation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter CouplingParameters +open scoped ENNReal +noncomputable section + +/-- A deterministic source phase assignment, chosen from the fixed angles. -/ +structure SourcePhaseAssignment (θ : SourceCoordinate → ℝ) (j : ℕ) (k : ℤ) where + block : ℕ + width : Fin 2 + indices : Finset SourceCoordinate + later : j ≤ block + first_later : width = 0 → j < block + subset : indices ⊆ sourceBlockCoordinates block + card_lower : (sourceBlockSize block : ℝ)/20 ≤ (indices.card : ℝ) + threshold : ∀ i ∈ indices, + 1-Int.fract ((k : ℝ)*θ i) ∈ Set.Icc (sourceWidth block width) (1-sourceWidth block width) + +def sourceChosenAssignment (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (k : ℤ) + (hk : sourcePhaseLower j ≤ |(k : ℝ)|) : SourcePhaseAssignment θ j k := by + have hex : Nonempty (SourcePhaseAssignment θ j k) := by + obtain ⟨s,w,I,hjs,hw,hI,hcard,hu⟩ := exists_source_qualifying_assignment θ hθ j hphase k hk + exact ⟨⟨s,w,I,hjs,hw,hI,hcard,hu⟩⟩ + exact Classical.choice hex + +namespace SourcePhaseAssignment +variable {θ : SourceCoordinate → ℝ} {j : ℕ} {k : ℤ} + +def badEvent (a : SourcePhaseAssignment θ j k) (b : Bool) : Set SourceBiasedSample := + (fun ω => (sourceBiasedEndpoint (fun _ => b) ω, + sourceBiasedEndpoint (fun _ => !b) ω)) ⁻¹' + badHalfEvent (fun _ => b) (fun i => 1-Int.fract ((k : ℝ)*θ i)) a.indices a.indices.card + +theorem badEvent_measurable (a : SourcePhaseAssignment θ j k) (b : Bool) : + MeasurableSet (a.badEvent b) := + (badHalfEvent_measurable ..).preimage + ((sourceBiasedEndpoint_measurable _).prodMk (sourceBiasedEndpoint_measurable _)) + +/-- Both conditional estimates use the actual full-vector posterior and the +constructed numerical budget. The assignment has no sample argument. -/ +theorem badEvent_condExp (a : SourcePhaseAssignment θ j k) (b : Bool) : + ∀ᵐ ω ∂sourceBiasedLaw j, + (sourceBiasedLaw j)[(a.badEvent b).indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace (SourceCoordinate → ℝ)).comap + (sourceBiasedEndpoint (fun _ => b))] ω ≤ Real.exp (-(sourceStage j).L/400) := by + have hi (i : SourceCoordinate) (h : i ∈ a.indices) : i.1 = a.block := + mem_sourceBlockCoordinates (a.subset h) + have hh := badHalf_condExp_bound (fun i : SourceCoordinate => stagedCouplingParameters j i.1) + (fun _ => b) (fun _ => a.width) (fun i => 1-Int.fract ((k : ℝ)*θ i)) a.indices + a.indices.card (sourceBlockSize a.block) ((stagedCouplingParameters j a.block).rho a.width) + (sourceStage j).L + (fun i h => by simpa only [stagedCouplingParameters,hi i h,Set.mem_Icc] using a.threshold i h) + (fun i h => by rw [hi i h]) + ((stagedCouplingParameters j a.block).rho_nonneg a.width) + a.card_lower (staged_rho_budget j a.block a.later a.width a.first_later) + have he : (a.badEvent b).indicator (fun _ => (1 : ℝ)) = + fun ω => (badHalfEvent (fun _ => b) (fun i => 1-Int.fract ((k : ℝ)*θ i)) + a.indices a.indices.card).indicator (fun _ => (1 : ℝ)) + (sourceBiasedEndpoint (fun _ => b) ω,sourceBiasedEndpoint (fun _ => !b) ω) := by + funext ω + by_cases h : (sourceBiasedEndpoint (fun _ => b) ω,sourceBiasedEndpoint (fun _ => !b) ω) ∈ + badHalfEvent (fun _ => b) (fun i => 1-Int.fract ((k : ℝ)*θ i)) a.indices a.indices.card + · have hp : ω ∈ a.badEvent b := h + rw [Set.indicator_of_mem hp,Set.indicator_of_mem h] + · have hp : ω ∉ a.badEvent b := h + rw [Set.indicator_of_notMem hp,Set.indicator_of_notMem h] + rw [he] + exact hh + +/-- At an assigned index, failure of both oriented bad events forces an +actual floor crossing, hence the original uncapped ratio is attenuated. -/ +theorem attenuation_or_bad (hθ : SourceAngles θ) (a : SourcePhaseAssignment θ j k) : + ∀ᵐ ω ∂sourceBiasedLaw j, + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => true) ω) / + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => false) ω) ≤ + Real.exp (-(sourceStage j).L) ∨ ω ∈ a.badEvent false ∨ ω ∈ a.badEvent true := by + have hcube := vectorEndpoint_unitCube (fun i : SourceCoordinate => stagedCouplingParameters j i.1) + have hx := ae_of_ae_map (sourceBiasedEndpoint_measurable (fun _ => false)).aemeasurable + (hcube (fun _ => false)) + have hy := ae_of_ae_map (sourceBiasedEndpoint_measurable (fun _ => true)).aemeasurable + (hcube (fun _ => true)) + filter_upwards [hx,hy,sourceBiasedLaw_ordered j, + sourceBiasedEndpoint_ae j (fun _ => false) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => true) (ae_finiteFloorSupport θ hθ.summable)] + with ω hxc hyc hxy hfx hfy + let x := sourceBiasedEndpoint (fun _ => false) ω + let y := sourceBiasedEndpoint (fun _ => true) ω + let u := fun i => 1-Int.fract ((k : ℝ)*θ i) + by_cases hc : ∃ i ∈ a.indices, x i < u i ∧ u i ≤ y i + · obtain ⟨i,hi,hcross⟩ := hc + apply Or.inl + have hatt := sourceCocycle_crossing_attenuation θ sourceLogWeight sourceLogWeight_nonneg + hfx hfy hxy k i (hxc i) (hyc i) hcross + apply hatt.trans + apply Real.exp_le_exp.mpr + have his := mem_sourceBlockCoordinates (a.subset hi) + change -(sourceStage i.1).C ≤ -(sourceStage j).L + rw [his] + exact neg_le_neg (staged_drop_budget j a.block a.later) + · have hn : ∀ i ∈ a.indices, ¬(x i < u i ∧ u i ≤ y i) := by + intro i hi hc'; exact hc ⟨i,hi,hc'⟩ + by_cases hcount : (a.indices.card : ℝ)/2 ≤ + ((eligibleIndices (fun _ => false) x u a.indices).card : ℝ) + · apply Or.inr ∘ Or.inl + refine ⟨hcount,?_⟩ + intro i hh + exact hn i i.2 hh + · apply Or.inr ∘ Or.inr + exact second_bad_half_in_reverse x y u a.indices (fun i _ => hxy i) hn (lt_of_not_ge hcount) + +end SourcePhaseAssignment +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Attenuation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Attenuation.lean new file mode 100644 index 0000000000000000000000000000000000000000..c2682f3a9d652b47bee947282f9d763b8c61653f --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Attenuation.lean @@ -0,0 +1,88 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Cocycle + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped ENNReal +noncomputable section + +/-- Crossing 1-fract(a) raises the integer floor by exactly one, for either +sign of a. The half-open endpoints match the source's representatives. -/ +theorem floor_crossing_gap {x y a : ℝ} (hx : x ∈ Set.Ico 0 1) (hy : y ∈ Set.Ico 0 1) + (hcross : x < 1-Int.fract a ∧ 1-Int.fract a ≤ y) : + Int.floor (y+a) = Int.floor (x+a)+1 := by + have he (t : ℝ) : t+a = (t+Int.fract a)+(Int.floor a : ℝ) := by rw [Int.fract]; ring + have hxf : Int.floor (x+Int.fract a) = 0 := + Int.floor_eq_zero_iff.mpr ⟨add_nonneg hx.1 (Int.fract_nonneg _), by linarith [hcross.1]⟩ + have hyf : Int.floor (y+Int.fract a) = 1 := by + apply Int.floor_eq_iff.mpr + constructor + · norm_num + linarith [hcross.2] + · norm_num + linarith [hy.2, Int.fract_lt_one a] + rw [he y, he x, Int.floor_add_intCast, Int.floor_add_intCast, hxf, hyf] + omega + +/-- Every actual threshold crossing supplies the factor exp(-c_i) in the +source cocycle ratio. No attenuation property of an operator is assumed. -/ +theorem sourceCocycle_crossing_attenuation {ι : Type*} (θ c : ι → ℝ) + (hc : ∀ i, 0 ≤ c i) {x y : ι → ℝ} + (hx : finiteFloorSupport θ x) (hy : finiteFloorSupport θ y) + (hxy : ∀ i, x i ≤ y i) (k : ℤ) (i : ι) + (hxi : x i ∈ Set.Ico 0 1) (hyi : y i ∈ Set.Ico 0 1) + (hcross : x i < 1-Int.fract ((k : ℝ)*θ i) ∧ 1-Int.fract ((k : ℝ)*θ i) ≤ y i) : + sourceCocycle θ c k y / sourceCocycle θ c k x ≤ Real.exp (-c i) := by + have hs := (sourceLog_summable θ c hy k).sub (sourceLog_summable θ c hx k) + have hnon (j : ι) : 0 ≤ c j * (coordinateFloor θ k y j : ℝ) - c j * (coordinateFloor θ k x j : ℝ) := by + apply sub_nonneg.mpr + apply mul_le_mul_of_nonneg_left _ (hc j) + have hh : coordinateFloor θ k x j ≤ coordinateFloor θ k y j := + Int.floor_mono (add_le_add (hxy j) le_rfl) + exact_mod_cast hh + have hgap : c i * (coordinateFloor θ k y i : ℝ) - c i * (coordinateFloor θ k x i : ℝ) = c i := by + have hh := floor_crossing_gap hxi hyi hcross + change coordinateFloor θ k y i = coordinateFloor θ k x i + 1 at hh + rw [hh, Int.cast_add, Int.cast_one] + ring + have hle := hs.le_tsum i (fun j _ => hnon j) + rw [hgap, (sourceLog_summable θ c hy k).tsum_sub (sourceLog_summable θ c hx k)] at hle + rw [sourceCocycle, sourceCocycle, ← Real.exp_sub] + apply Real.exp_le_exp.mpr + change c i ≤ sourceLog θ c k y - sourceLog θ c k x at hle + linarith + +/-- The genuine finite-prefix bound for the source cocycle F_n. This is the +pointwise estimate needed before lifting the bound to powers of T. -/ +theorem sourceCocycle_prefix_bound {ι : Type*} (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) {x : ι → ℝ} + (hx : finiteFloorSupport θ x) (hx0 : ∀ i, 0 ≤ x i) (I : Finset ι) (n : ℕ) : + sourceCocycle θ c n x ≤ Real.exp ((∑ i ∈ I, c i) - (n : ℝ)*(∑ i ∈ I, c i*θ i)) := by + have hnon (i : ι) : 0 ≤ c i * (coordinateFloor θ n x i : ℝ) := by + apply mul_nonneg (hc i) + have hi : 0 ≤ coordinateFloor θ n x i := + Int.floor_nonneg.mpr (add_nonneg (hx0 i) (mul_nonneg (by exact_mod_cast Nat.zero_le n) (hθ i))) + exact_mod_cast hi + have hlo (i : ι) : c i * ((n : ℝ)*θ i-1) ≤ c i * (coordinateFloor θ n x i : ℝ) := by + apply mul_le_mul_of_nonneg_left _ (hc i) + have hh := Int.lt_floor_add_one (x i + (n : ℝ)*θ i) + change (n : ℝ)*θ i-1 ≤ (Int.floor (x i+(n : ℝ)*θ i) : ℝ) + linarith [hx0 i] + have hsum := (Finset.sum_le_sum (fun i (_hi : i ∈ I) => hlo i)).trans + ((sourceLog_summable θ c hx n).sum_le_tsum I (fun i _ => hnon i)) + have he : (∑ i ∈ I, c i * ((n : ℝ)*θ i-1)) = + (n : ℝ)*(∑ i ∈ I, c i*θ i) - ∑ i ∈ I, c i := by + rw [Finset.mul_sum, ← Finset.sum_sub_distrib] + apply Finset.sum_congr rfl + intro i _ + ring + rw [he] at hsum + apply Real.exp_le_exp.mpr + change _ ≤ sourceLog θ c n x at hsum + linarith + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/BoundaryEvent.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/BoundaryEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..36e7bc41205ccbb2376fd314be1c3c81dd1e1028 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/BoundaryEvent.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiniteCocycleBounds +import OAI.Analysis.FiniteFactor.BiasedPairs.RealIdentity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- The source margin 2K_j/N_s. At s=j it is exactly 2/m_j. -/ +def sourceExclusionWidth (j : ℕ) (i : SourceCoordinate) : ℝ := + 2*(sourceStageState j).K/((sourceBlockSize i.1 : ℝ)*(sourceStageState i.1).K) + +def sourceBoundaryEvent (j : ℕ) : Set SourceBiasedSample := + {ω | ∀ i : SourceCoordinate, j ≤ i.1 → + sourceBiasedEndpoint (fun _ => false) ω i < 1-sourceExclusionWidth j i ∧ + sourceExclusionWidth j i < sourceBiasedEndpoint (fun _ => true) ω i} + +theorem sourceExclusionWidth_current (j : ℕ) (i : Fin (sourceBlockSize j)) : + sourceExclusionWidth j ⟨j,i⟩ = 2/(sourceBlockSize j : ℝ) := by + unfold sourceExclusionWidth + field_simp [(sourceCutoff_pos j).ne'] + +theorem sourceBoundaryEvent_measurable (j : ℕ) : MeasurableSet (sourceBoundaryEvent j) := by + simp only [sourceBoundaryEvent,Set.ofPred_forall] + apply MeasurableSet.iInter + intro i + apply MeasurableSet.iInter + intro _hi + exact (measurableSet_lt ((measurable_pi_apply i).comp (sourceBiasedEndpoint_measurable _)) + measurable_const).inter + (measurableSet_lt measurable_const ((measurable_pi_apply i).comp (sourceBiasedEndpoint_measurable _))) + +/-- The actual source margins force zero later-coordinate floors for both +signs needed by the finite coefficient bound. -/ +theorem sourceBoundary_floor_zero (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (ω : SourceBiasedSample) (he : ω ∈ sourceBoundaryEvent j) + (hxc : ∀ i, sourceBiasedEndpoint (fun _ => false) ω i ∈ Set.Ico 0 1) + (hyc : ∀ i, sourceBiasedEndpoint (fun _ => true) ω i ∈ Set.Ico 0 1) + (v : ℤ) (hv : 0 ≤ v) (hvK : (v : ℝ) ≤ (sourceStageState j).K) : + ∀ i : SourceCoordinate, j ≤ i.1 → + coordinateFloor θ v (sourceBiasedEndpoint (fun _ => false) ω) i = 0 ∧ + coordinateFloor θ (-v) (sourceBiasedEndpoint (fun _ => true) ω) i = 0 := by + intro i hi + have hv0 : (0 : ℝ) ≤ v := by exact_mod_cast hv + have hn := mul_nonneg hv0 (hθ.nonneg i) + have hu : (v : ℝ)*θ i ≤ sourceExclusionWidth j i := by + calc + (v : ℝ)*θ i ≤ ((sourceStageState j).K : ℝ) * + (2/((sourceBlockSize i.1 : ℝ)*(sourceStageState i.1).K)) := + mul_le_mul hvK (hθ i).2 (hθ.nonneg i) (Nat.cast_nonneg _) + _ = _ := by unfold sourceExclusionWidth; ring + obtain ⟨hx,hy⟩ := he i hi + constructor + · apply Int.floor_eq_zero_iff.mpr + change 0 ≤ sourceBiasedEndpoint (fun _ => false) ω i + (v : ℝ)*θ i ∧ + sourceBiasedEndpoint (fun _ => false) ω i + (v : ℝ)*θ i < 1 + constructor <;> linarith [(hxc i).1] + · apply Int.floor_eq_zero_iff.mpr + change 0 ≤ sourceBiasedEndpoint (fun _ => true) ω i + ((-v : ℤ) : ℝ)*θ i ∧ + sourceBiasedEndpoint (fun _ => true) ω i + ((-v : ℤ) : ℝ)*θ i < 1 + rw [Int.cast_neg] + constructor <;> linarith [(hyc i).2] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CappedPair.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CappedPair.lean new file mode 100644 index 0000000000000000000000000000000000000000..da6ed3a666f39dfb3ef91859012c71df512aacb6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CappedPair.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.FiniteFactor.Fiber.PairZeroSet +import OAI.Analysis.FiniteFactor.CrossedProduct.LusinCompact + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology ENNReal +noncomputable section + +def sourceCappedRatio (θ : SourceCoordinate → ℝ) (z : SourceTorus × SourceTorus) (k : ℤ) : ℂ := + (min (sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.2) / + sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.1)) 1 : ℝ) + +theorem sourceCappedRatio_norm (θ : SourceCoordinate → ℝ) (z : SourceTorus × SourceTorus) (k : ℤ) : + ‖sourceCappedRatio θ z k‖ ≤ 1 := by + rw [sourceCappedRatio, Complex.norm_real, Real.norm_eq_abs, + abs_of_nonneg (le_min (le_of_lt (div_pos (sourceCocycle_pos ..) (sourceCocycle_pos ..))) zero_le_one)] + exact min_le_right _ _ + +theorem sourceCappedRatio_measurable (θ : SourceCoordinate → ℝ) (k : ℤ) : + Measurable (fun z => sourceCappedRatio θ z k) := by + apply Complex.measurable_ofReal.comp + apply Measurable.min _ measurable_const + exact (((sourceCocycle_measurable θ sourceLogWeight k).comp + sourceTorusRepresentative_preserving.measurable).comp measurable_snd).div + (((sourceCocycle_measurable θ sourceLogWeight k).comp + sourceTorusRepresentative_preserving.measurable).comp measurable_fst) + +theorem sourceCappedRatio_continuousOn (θ : SourceCoordinate → ℝ) (Q : Set SourceTorus) + (hF : ∀ k : ℤ, ContinuousOn + (fun z => sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z)) Q) (k : ℤ) : + ContinuousOn (fun z => sourceCappedRatio θ z k) (Q ×ˢ Q) := by + apply Complex.continuous_ofReal.comp_continuousOn + apply ContinuousOn.inf _ continuousOn_const + exact ((hF k).comp continuous_snd.continuousOn (fun z hz => hz.2)).div + ((hF k).comp continuous_fst.continuousOn (fun z hz => hz.1)) + (fun z _ => ne_of_gt (sourceCocycle_pos ..)) + +/-- The capped equation uses the previously constructed field of the original +operator, on the actual sampling torus. -/ +def sourceCappedPairZeroSet (θ : SourceCoordinate → ℝ) + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + Set (SourceTorus × SourceTorus) := + {z | fiberPairResidual (sourceTorusOperatorField H) (sourceCappedRatio θ) + (sourceCappedRatio_norm θ) z = 0} + +theorem sourceCappedPairZeroSet_measurable (θ : SourceCoordinate → ℝ) + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + MeasurableSet (sourceCappedPairZeroSet θ H) := + fiberPairZeroSet_measurable _ _ _ (sourceTorusOperatorField_stronglyMeasurable H) + (sourceCappedRatio_measurable θ) + +/-- The compact zero sets needed for Portmanteau are constructed from the +actual field and original cocycles, with arbitrarily small Haar loss. -/ +theorem exists_source_capped_compact (θ : SourceCoordinate → ℝ) + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + {s : Set SourceTorus} (hs : MeasurableSet s) (hfull : ∀ᵐ z ∂sourceTorusHaar, z ∈ s) + {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ Q, Q ⊆ s ∧ IsCompact Q ∧ sourceTorusHaar Qᶜ < ε ∧ + IsCompact ((Q ×ˢ Q) ∩ sourceCappedPairZeroSet θ H) := by + obtain ⟨Q,hQs,hQ,hμQ,hF,hP⟩ := exists_source_lusin_compact θ H hs hfull hε + exact ⟨Q,hQs,hQ,hμQ,fiberPairZeroSet_compact _ _ _ Q hQ ‖H‖ + (fun z _ => sourceTorusOperatorField_norm H z) hP + (sourceCappedRatio_continuousOn θ Q hF)⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CappedTransfer.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CappedTransfer.lean new file mode 100644 index 0000000000000000000000000000000000000000..bb77daab50526ee6a48790877a4b2499aef8e6f6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CappedTransfer.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.CappedPair +import OAI.Analysis.FiniteFactor.CompactZeroTransfer +import OAI.Analysis.FiniteFactor.L2UniformAbsoluteContinuity +import OAI.Analysis.FiniteFactor.CrossedProduct.OrderedTorusSampling +import OAI.Analysis.FiniteFactor.OrbitSampling.TorusLimitMarginals + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section + +/-- Uniform absolute continuity of both actual ordered sampling marginals, +derived from the previously proved L2 density bounds. -/ +theorem SourceOrderedTorusSampling.uniformAC {θ : SourceCoordinate → ℝ} + (hθ : SourceOrderedTorusSampling θ) (I : Finset SourceCoordinate) (r : Bool) + (ε : ℝ≥0) (hε : 0 < ε) : + ∃ δ : ℝ≥0∞, 0 < δ ∧ ∀ A, MeasurableSet A → sourceTorusHaar A < δ → ∀ n, + ((sourceSamplingTrimmedTorus I n θ : Measure SourceSamplingTorus).map + (sourceTorusEndpoint r)) A ≤ ε := by + obtain ⟨C,hC⟩ := hθ.marginals I r + apply uniformAC_of_L2_densities sourceTorusHaar _ C _ ε hε + intro n + obtain ⟨g,hg,hg0,he,hglp,hgC⟩ := hC n + exact ⟨g,hglp,hg0,he,hgC⟩ + +/-- The actual capped projection equation passes to lambda_I on the original +sampling torus. The approximant equations are the remaining orbit obligation; +no continuity or measurable-selection premise is assumed. -/ +theorem sourceCappedPair_limit_transfer {θ : SourceCoordinate → ℝ} + (hθ : SourceOrderedTorusSampling θ) (I : Finset SourceCoordinate) + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (hpair : ∀ n, ∀ᵐ z ∂(sourceSamplingTrimmedTorus I n θ : Measure SourceSamplingTorus), + z ∈ sourceCappedPairZeroSet θ H) : + ∀ᵐ z ∂(sourceSamplingLambdaTorus I : Measure SourceSamplingTorus), + z ∈ sourceCappedPairZeroSet θ H := by + have hlim : Tendsto (fun n => sourceSamplingTrimmedTorus I n θ) atTop + (𝓝 (sourceSamplingLambdaTorus I)) := by + apply FiniteMeasure.tendsto_of_forall_integral_tendsto + intro f + exact hθ.weak I f.toContinuousMap + apply finiteMeasure_ae_of_compact_approximation _ _ hlim _ + (sourceCappedPairZeroSet_measurable θ H) + intro ε hε + have hhalf : 0 < ε / 2 := half_pos hε + obtain ⟨δ₁,hδ₁,h₁⟩ := hθ.uniformAC I false (ε / 2) hhalf + obtain ⟨δ₂,hδ₂,h₂⟩ := hθ.uniformAC I true (ε / 2) hhalf + obtain ⟨Q,_,hQ,hμQ,hK⟩ := exists_source_capped_compact θ H + MeasurableSet.univ (Eventually.of_forall (fun _ => Set.mem_univ _)) + (ne_of_gt (lt_min hδ₁ hδ₂)) + refine ⟨(Q ×ˢ Q) ∩ sourceCappedPairZeroSet θ H,hK,Set.inter_subset_right,?_⟩ + intro n + have hb₁ := h₁ Qᶜ hQ.isClosed.measurableSet.compl + (hμQ.trans_le (min_le_left _ _)) n + have hb₂ := h₂ Qᶜ hQ.isClosed.measurableSet.compl + (hμQ.trans_le (min_le_right _ _)) n + have hb := add_le_add hb₁ hb₂ + have he : (↑(ε / 2) : ℝ≥0∞) + ↑(ε / 2) = ε := by + rw [← ENNReal.coe_add, add_halves] + rw [he] at hb + exact (measure_pair_compact_loss _ Q hQ.isClosed.measurableSet _ (hpair n)).trans hb + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CentralDiagonal.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CentralDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..9b61ee3f37801e9e6beea58ef69901496bd895d7 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CentralDiagonal.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.WeightedShiftField +import OAI.Analysis.FiniteFactor.CrossedProduct.FreeRotation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +def sourceFirstMultiplier : SourceBaseFunction where + toFun x := (x sourceFirstCoordinate : ℂ) + measurable := Complex.measurable_ofReal.comp (measurable_pi_apply sourceFirstCoordinate) + bound := 1 + bound_nonneg := zero_le_one + norm_le x hx := by + rw [Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg (hx sourceFirstCoordinate).1] + exact (hx sourceFirstCoordinate).2.le + +theorem sourceFirstMultiplier_distinct (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) (x : SourceCoordinate → ℝ) + (n k : ℤ) (hnk : n ≠ k) : + sourceFirstMultiplier.toFun (coordinateRotate θ n x) ≠ + sourceFirstMultiplier.toFun (coordinateRotate θ k x) := by + intro he + have he' := Complex.ofReal_injective he + change Int.fract (x sourceFirstCoordinate+(n : ℝ)*θ sourceFirstCoordinate) = + Int.fract (x sourceFirstCoordinate+(k : ℝ)*θ sourceFirstCoordinate) at he' + rw [Int.fract,Int.fract] at he' + apply hr.mul_ne_integer sourceFirstCoordinate (n-k) (sub_ne_zero.mpr hnk) + (Int.floor (x sourceFirstCoordinate+(n : ℝ)*θ sourceFirstCoordinate) - + Int.floor (x sourceFirstCoordinate+(k : ℝ)*θ sourceFirstCoordinate)) + push_cast + nlinarith + +/-- The field of pi(g) has its actual diagonal action on every vector. -/ +theorem sourceOperatorField_pi_action (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ (v : SourceFiberHilbert) (k : ℤ), + sourceOperatorField (sourcePi θ g) x v k = g.toFun (coordinateRotate θ k x) * v k := by + have hm := ae_all_iff.mpr (sourceMatrixEntry_pi θ g) + filter_upwards [hm,sourceOperatorField_entries_ae θ (sourcePi_mem θ g)] with x hm he v k + rw [fiberOperator_action] + simp_rw [he,hm] + have hs : (fun n : ℤ => (if k = n then g.toFun (coordinateRotate θ n x) else 0) * v n) = + fun n => if n = k then g.toFun (coordinateRotate θ k x) * v k else 0 := by + funext n + by_cases hn : n = k + · subst n; simp + · simp [hn,Ne.symm hn] + rw [hs] + simp + +/-- Commutation in the source algebra passes to the actual fields. -/ +theorem sourceOperatorField_commute (θ : SourceCoordinate → ℝ) + {A B : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) (hB : B ∈ sourceAlgebra θ) (hAB : A*B = B*A) : + ∀ᵐ x ∂sourceBaseMeasure, sourceOperatorField A x * sourceOperatorField B x = + sourceOperatorField B x * sourceOperatorField A x := by + filter_upwards [sourceOperatorField_mul θ hA hB,sourceOperatorField_mul θ hB hA] with x h₁ h₂ + rw [← h₁,← h₂,hAB] + +/-- Distinct diagonal eigenvalues force every off-diagonal matrix coefficient +of a commuting bounded operator to vanish. -/ +theorem fiber_commuting_diagonal_entry + (A G : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (d : ℤ → ℂ) + (hG : ∀ v k, G v k = d k * v k) (hAG : A*G = G*A) + (n k : ℤ) (hd : d n ≠ d k) : A (lp.single 2 n (1 : ℂ)) k = 0 := by + have hsingle : G (lp.single 2 n (1 : ℂ)) = d n • lp.single 2 n (1 : ℂ) := by + classical + apply Subtype.ext + funext j + change G (lp.single 2 n (1 : ℂ)) j = d n * (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) j + rw [hG] + by_cases hj : n = j + · subst j; rfl + · simp [lp.single_apply,hj] + have he := congrArg (fun T : SourceFiberHilbert →L[ℂ] SourceFiberHilbert => + T (lp.single 2 n (1 : ℂ)) k) hAG + change A (G (lp.single 2 n (1 : ℂ))) k = G (A (lp.single 2 n (1 : ℂ))) k at he + rw [hsingle,map_smul,hG] at he + change d n * A (lp.single 2 n (1 : ℂ)) k = d k * A (lp.single 2 n (1 : ℂ)) k at he + exact (mul_eq_mul_right_iff.mp he).resolve_left hd + +theorem sourceCentral_offDiagonal_zero (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) + {A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) + (hcentral : ∀ B ∈ sourceAlgebra θ, A*B = B*A) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ n k : ℤ, n ≠ k → + sourceOperatorField A x (lp.single 2 n (1 : ℂ)) k = 0 := by + filter_upwards [sourceOperatorField_pi_action θ sourceFirstMultiplier, + sourceOperatorField_commute θ hA (sourcePi_mem θ sourceFirstMultiplier) + (hcentral _ (sourcePi_mem θ sourceFirstMultiplier))] with x hG hc n k hnk + exact fiber_commuting_diagonal_entry _ _ _ hG hc n k (sourceFirstMultiplier_distinct θ hr x n k hnk) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CentralScalarField.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CentralScalarField.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ed250290fbdfa6cf3e03bfb260e58f78e97efa9 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CentralScalarField.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.CentralDiagonal +import OAI.Analysis.FiniteFactor.Fiber.Shift +import Mathlib.Algebra.Ring.Periodic + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +theorem sourceOperatorField_shift (θ : SourceCoordinate → ℝ) : + ∀ᵐ x ∂sourceBaseMeasure, sourceOperatorField (sourceShift SourceCoordinate) x = fiberShift 1 := by + classical + have hm := ae_all_iff.mpr sourceMatrixEntry_shift + filter_upwards [hm,sourceOperatorField_entries_ae θ (sourceShift_mem θ)] with x hm he + apply fiberOperator_ext + intro k n + rw [he,hm] + rw [fiberShift_single] + by_cases hk : k = n+1 + · subst k; simp [lp.single_apply] + · simp [lp.single_apply,hk] + +/-- Commutation with the bilateral shift makes all diagonal coefficients equal. -/ +theorem fiber_commuting_shift_diagonal (A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hc : A*fiberShift 1 = fiberShift 1*A) (n : ℤ) : + A (lp.single 2 n (1 : ℂ)) n = A (lp.single 2 0 (1 : ℂ)) 0 := by + have hperiod : Function.Periodic + (fun k : ℤ => A (lp.single 2 k (1 : ℂ)) k) 1 := by + intro k + have he := congrArg (fun T : SourceFiberHilbert →L[ℂ] SourceFiberHilbert => + T (lp.single 2 k (1 : ℂ)) (k+1)) hc + change A (fiberShift 1 (lp.single 2 k (1 : ℂ))) (k+1) = + (fiberShift 1 (A (lp.single 2 k (1 : ℂ)))) (k+1) at he + simpa only [fiberShift_single,fiberShift_apply,add_sub_cancel_right] using he + simpa using hperiod.int_mul_eq n + +/-- The scalar coefficient is the actual field's 00 entry. -/ +def sourceCentralCoefficient + (A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (x : SourceCoordinate → ℝ) : ℂ := sourceOperatorField A x (lp.single 2 0 (1 : ℂ)) 0 + +theorem sourceCentralCoefficient_measurable + (A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + Measurable (sourceCentralCoefficient A) := sourceOperatorField_entry_measurable A 0 0 + +/-- Every central element of the original algebra is a scalar field. The +scalar may still depend on x; ergodicity is needed to make it constant. -/ +theorem sourceCentral_scalar_field (θ : SourceCoordinate → ℝ) (hr : SourceRationalIndependent θ) + {A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) + (hcentral : ∀ B ∈ sourceAlgebra θ, A*B = B*A) : + ∀ᵐ x ∂sourceBaseMeasure, + sourceOperatorField A x = sourceCentralCoefficient A x • (1 : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) := by + filter_upwards [sourceCentral_offDiagonal_zero θ hr hA hcentral,sourceOperatorField_shift θ, + sourceOperatorField_commute θ hA (sourceShift_mem θ) (hcentral _ (sourceShift_mem θ))] + with x hd hs hc + rw [hs] at hc + apply fiberOperator_ext + intro k n + change sourceOperatorField A x (lp.single 2 n (1 : ℂ)) k = + sourceCentralCoefficient A x * (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) k + by_cases hnk : n = k + · subst k + simpa [lp.single_apply,sourceCentralCoefficient] using fiber_commuting_shift_diagonal _ hc n + · rw [hd n k hnk] + simp [lp.single_apply,hnk] + +/-- Covariance makes the actual scalar field invariant under every integer +rotation. No ergodicity hypothesis or constant-value conclusion is inserted. -/ +theorem sourceCentralCoefficient_rotation_invariant + (θ : SourceCoordinate → ℝ) (hr : SourceRationalIndependent θ) + {A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) + (hcentral : ∀ B ∈ sourceAlgebra θ, A*B = B*A) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ n : ℤ, + sourceCentralCoefficient A (coordinateRotate θ n x) = sourceCentralCoefficient A x := by + filter_upwards [sourceOperatorField_covariance θ hA,sourceCentral_scalar_field θ hr hA hcentral] + with x hc hs n + change sourceOperatorField A (coordinateRotate θ n x) (lp.single 2 0 (1 : ℂ)) 0 = _ + rw [hc,zero_add,hs] + change sourceCentralCoefficient A x * (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) n = _ + simp [lp.single_apply] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Cocycle.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Cocycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..87fc79b219435a49cb0118e7a3cc898bc7f2cb84 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Cocycle.lean @@ -0,0 +1,125 @@ +import Mathlib +import OAI.Analysis.FiniteFactor.CrossedProduct.FloorSupport + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Integer iterates of the source rotation, in [0,1) representatives. -/ +def coordinateRotate {ι : Type*} (θ : ι → ℝ) (k : ℤ) (x : ι → ℝ) (i : ι) : ℝ := + Int.fract (x i + (k : ℝ)*θ i) + +theorem coordinateFloor_add {ι : Type*} (θ : ι → ℝ) (x : ι → ℝ) (k n : ℤ) (i : ι) : + coordinateFloor θ (k+n) x i = coordinateFloor θ k x i + + coordinateFloor θ n (coordinateRotate θ k x) i := by + unfold coordinateFloor coordinateRotate + have he : x i + ((k+n : ℤ) : ℝ)*θ i = + (Int.fract (x i+(k : ℝ)*θ i)+(n : ℝ)*θ i) + (Int.floor (x i+(k : ℝ)*θ i) : ℝ) := by + rw [Int.fract] + push_cast + ring + rw [he, Int.floor_add_intCast] + omega + +theorem finiteFloorSupport_rotate {ι : Type*} (θ : ι → ℝ) {x : ι → ℝ} + (hx : finiteFloorSupport θ x) (k : ℤ) : finiteFloorSupport θ (coordinateRotate θ k x) := by + intro n + apply ((hx (k+n)).union (hx k)).subset + intro i hi + by_contra hn + simp only [Set.mem_union, Function.mem_support, not_or, not_not] at hn + have he := coordinateFloor_add θ x k n i + rw [hn.1, hn.2, zero_add] at he + exact hi he.symm + +/-- The source logarithmic cocycle, using the actual weighted floor sum. -/ +def sourceLog {ι : Type*} (θ c : ι → ℝ) (k : ℤ) (x : ι → ℝ) : ℝ := + ∑' i, c i * (coordinateFloor θ k x i : ℝ) + +def sourceCocycle {ι : Type*} (θ c : ι → ℝ) (k : ℤ) (x : ι → ℝ) : ℝ := + Real.exp (-sourceLog θ c k x) + +theorem sourceLog_summable {ι : Type*} (θ c : ι → ℝ) {x : ι → ℝ} + (hx : finiteFloorSupport θ x) (k : ℤ) : + Summable (fun i => c i * (coordinateFloor θ k x i : ℝ)) := by + apply summable_of_hasFiniteSupport + apply (hx k).subset + intro i hi + simp only [Function.mem_support] at * + intro hz + apply hi + simp [hz] + +theorem sourceLog_add {ι : Type*} (θ c : ι → ℝ) {x : ι → ℝ} + (hx : finiteFloorSupport θ x) (k n : ℤ) : + sourceLog θ c (k+n) x = sourceLog θ c k x + sourceLog θ c n (coordinateRotate θ k x) := by + unfold sourceLog + simp_rw [coordinateFloor_add, Int.cast_add, mul_add] + exact (sourceLog_summable θ c hx k).tsum_add + (sourceLog_summable θ c (finiteFloorSupport_rotate θ hx k) n) + +/-- The actual cocycle identity, proved on the conull domain supplied by +Borel--Cantelli. The rotation and sums are explicit. -/ +theorem sourceCocycle_add {ι : Type*} (θ c : ι → ℝ) {x : ι → ℝ} + (hx : finiteFloorSupport θ x) (k n : ℤ) : + sourceCocycle θ c (k+n) x = sourceCocycle θ c n (coordinateRotate θ k x) * sourceCocycle θ c k x := by + rw [sourceCocycle, sourceLog_add θ c hx, neg_add, Real.exp_add] + exact mul_comm _ _ + +theorem sourceCocycle_pos {ι : Type*} (θ c : ι → ℝ) (k : ℤ) (x : ι → ℝ) : + 0 < sourceCocycle θ c k x := Real.exp_pos _ + +theorem sourceCocycle_zero {ι : Type*} (θ c : ι → ℝ) {x : ι → ℝ} + (hx : ∀ i, x i ∈ Set.Ico 0 1) : sourceCocycle θ c 0 x = 1 := by + have hzero (i : ι) : coordinateFloor θ 0 x i = 0 := by + simpa [coordinateFloor] using Int.floor_eq_zero_iff.mpr (hx i) + simp [sourceCocycle, sourceLog, hzero] + +theorem sourceCocycle_measurable {ι : Type*} [Countable ι] + (θ c : ι → ℝ) (k : ℤ) : + @Measurable (ι → ℝ) ℝ + (@MeasurableSpace.pi ι (fun _ => ℝ) (fun _ => Real.measurableSpace)) + Real.measurableSpace (sourceCocycle θ c k) := by + apply Real.continuous_exp.measurable.comp + apply Measurable.neg + apply Measurable.tsum + intro i + have hm0 : Measurable (fun x : ι → ℝ => x i + (k : ℝ)*θ i) := + (measurable_pi_apply i).add measurable_const + have hm := Int.measurable_floor.comp hm0 + exact measurable_const.mul ((measurable_of_countable (fun z : ℤ => (z : ℝ))).comp hm) + +/-- The weight f=F_1 is positive and at most one on the source coordinate cube. -/ +theorem sourceWeight_le_one {ι : Type*} (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) {x : ι → ℝ} + (hx : ∀ i, x i ∈ Set.Ico 0 1) : sourceCocycle θ 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) + unfold coordinateFloor + exact_mod_cast Int.floor_nonneg.mpr (show 0 ≤ x i + (1 : ℤ)*θ i by simpa using add_nonneg (hx i).1 (hθ i)) + +/-- Ordered endpoints give the ratio bound for every integer, including +negative integers. Both infinite sums are justified by finite support. -/ +theorem sourceCocycle_ordered {ι : Type*} (θ c : ι → ℝ) + (hc : ∀ i, 0 ≤ c i) {x y : ι → ℝ} + (hx : finiteFloorSupport θ x) (hy : finiteFloorSupport θ y) + (hxy : ∀ i, x i ≤ y i) (k : ℤ) : sourceCocycle θ c k y ≤ sourceCocycle θ c k x := by + apply Real.exp_le_exp.mpr + apply neg_le_neg + exact Summable.tsum_le_tsum (fun i => mul_le_mul_of_nonneg_left + (by + have hh : coordinateFloor θ k x i ≤ coordinateFloor θ k y i := + Int.floor_mono (add_le_add (hxy i) le_rfl) + exact_mod_cast hh) (hc i)) + (sourceLog_summable θ c hx k) (sourceLog_summable θ c hy k) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ColumnSquareMass.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ColumnSquareMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..78a16989e0ffa6e5ec78481913d9c670cfe04a62 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ColumnSquareMass.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionColumns +import OAI.Analysis.FiniteFactor.TailEstimate + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +def sourceColumn (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (b : Bool) (x : SourceCoordinate → ℝ) : SourceFiberHilbert := + if b then sourceComplementColumn p x else sourceProjectionColumn p x + +theorem sourceColumn_coordinate_measurable + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (b : Bool) (k : ℤ) : + Measurable (fun x => sourceColumn p b x k) := by + cases b + · exact sourceOperatorField_entry_measurable p k 0 + · exact measurable_const.sub (sourceOperatorField_entry_measurable p k 0) + +theorem sourceColumn_square_hasSum + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (b : Bool) (x : SourceCoordinate → ℝ) (n : ℤ) : + HasSum (fun k : ℤ => ‖sourceColumn p b x (n+k)‖^2) (‖sourceColumn p b x‖^2) := by + have h : HasSum (fun k : ℤ => ‖sourceColumn p b x k‖^2) (‖sourceColumn p b x‖^2) := by + simpa using lp.hasSum_norm (by norm_num : (0 : ℝ) < (2 : ℝ≥0∞).toReal) (sourceColumn p b x) + exact (Equiv.addLeft n).hasSum_iff.mpr h + +/-- Actual endpoint square mass: integrable, and at most one. The shift is a +bijection of all integers; no finite coefficient cutoff is introduced. -/ +theorem sourceColumn_square_mass (θ : SourceCoordinate → ℝ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (j : ℕ) (b : Bool) (n : ℤ) : + Integrable (fun ω => ∑' k : ℤ, + ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (n+k)‖^2) (sourceBiasedLaw j) ∧ + (∫ ω, (∑' k : ℤ, ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (n+k)‖^2) + ∂sourceBiasedLaw j) ≤ 1 := by + let f := fun ω => ∑' k : ℤ, ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (n+k)‖^2 + have hm : Measurable f := Measurable.tsum (fun k => + (((sourceColumn_coordinate_measurable p b (n+k)).comp (sourceBiasedEndpoint_measurable _)).norm.pow_const 2)) + have h0 : ∀ ω, 0 ≤ f ω := fun ω => tsum_nonneg (fun _ => sq_nonneg _) + have h1 : ∀ᵐ ω ∂sourceBiasedLaw j, f ω ≤ 1 := by + filter_upwards [sourceBiasedEndpoint_ae j (fun _ => b) (sourceProjection_columns_norm θ hp hproj)] with ω hω + have hn : ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω)‖ ≤ 1 := by + cases b <;> simp only [sourceColumn,Bool.false_eq_true,↓reduceIte] <;> tauto + rw [show f ω = ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω)‖^2 from + (sourceColumn_square_hasSum p b _ n).tsum_eq] + nlinarith [norm_nonneg (sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω))] + have hi : Integrable f (sourceBiasedLaw j) := (integrable_const (1 : ℝ)).mono' hm.aestronglyMeasurable + (h1.mono fun ω h => by rwa [Real.norm_of_nonneg (h0 ω)]) + refine ⟨hi,?_⟩ + simpa using integral_mono_ae hi (integrable_const (1 : ℝ)) h1 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ConjugationVacuum.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ConjugationVacuum.lean new file mode 100644 index 0000000000000000000000000000000000000000..0185441b2cfff091111db3918b42dbc6e2dcfffb --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ConjugationVacuum.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Reflection +import OAI.Analysis.FiniteFactor.CrossedProduct.VacuumSeparating + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- Reflection of each total vacuum test equals its commutant adjoint on the vacuum. -/ +theorem sourceConjugation_fiberIndicator (θ : SourceCoordinate → ℝ) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (n : ℤ) : + sourceConjugation θ (sourceFiberIndicator A hA n) = + star (sourceScalar (sourceBaseIndicator A hA) * sourceCommutantRotation θ n) sourceVacuum := by + rw [star_mul, sourceScalar_star, sourceCommutantRotation_star] + apply Lp.ext + have hf := (sourceReflectionIndex_preserving θ).quasiMeasurePreserving.ae + (sourceFiberIndicator_coe A hA n) + have hs := (sourceTransportIndex_preserving θ (-n) (-n)).quasiMeasurePreserving.ae + (sourcePi_apply_ae (fun _ => 0) (sourceBaseStar (sourceBaseIndicator A hA)) sourceVacuum) + have hv := (sourceTransportIndex_preserving θ (-n) (-n)).quasiMeasurePreserving.ae sourceVacuum_coe + filter_upwards [sourceConjugation_apply_ae θ (sourceFiberIndicator A hA n), hf, + sourceTransport_apply_ae θ (-n) (-n) + (sourcePi (fun _ => 0) (sourceBaseStar (sourceBaseIndicator A hA)) sourceVacuum), hs, hv] + with z h1 h2 h3 h4 h5 + change (sourceConjugation θ (sourceFiberIndicator A hA n)) z = + (sourceTransport θ (-n) (-n) (sourcePi (fun _ => 0) (sourceBaseStar (sourceBaseIndicator A hA)) sourceVacuum)) z + rw [h1,h2,h3,h4,h5] + have he : coordinateRotate (fun _ : SourceCoordinate => 0) (z.2 - -n) + (coordinateRotate θ (-n) z.1) = coordinateRotate θ (-n) z.1 := by + funext i + simp [coordinateRotate, Int.fract_fract] + unfold sourcePiSymbol sourceTransportIndex + dsimp only + rw [he] + by_cases hn : z.2 = -n + · by_cases ha : coordinateRotate θ (-n) z.1 ∈ A <;> + simp [sourceReflectionIndex, sourceBaseStar, sourceBaseIndicator, hn, ha] + · have hn' : -z.2 ≠ n := by omega + have hn'' : z.2 + n ≠ 0 := by omega + simp [sourceReflectionIndex, sourceBaseStar, sourceBaseIndicator, hn', hn''] + +/-- The actual reflection sends H e_0 to H* e_0 for every source-algebra element. -/ +theorem sourceConjugation_algebra_vacuum (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + sourceConjugation θ (H sourceVacuum) = star H sourceVacuum := by + apply sub_eq_zero.mp + apply sourceFiberIndicators_total + intro A hA n + rw [inner_sub_right] + apply sub_eq_zero.mpr + rw [sourceConjugation_inner_symm, sourceConjugation_fiberIndicator, + ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right, + ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + have hr := congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T sourceVacuum) (sourceAlgebra_commutes_rotation θ hH n) + rw [sourceFiberIndicator_eq_orbit θ A hA n] + congr 1 + change sourceScalar (sourceBaseIndicator A hA) (sourceCommutantRotation θ n (H sourceVacuum)) = + H (sourceScalar (sourceBaseIndicator A hA) (sourceCommutantRotation θ n sourceVacuum)) + have hs' := congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T (sourceCommutantRotation θ n sourceVacuum)) + (sourceAlgebra_commutes_scalar θ hH (sourceBaseIndicator A hA)) + change sourceCommutantRotation θ n (H sourceVacuum) = H (sourceCommutantRotation θ n sourceVacuum) at hr + change sourceScalar (sourceBaseIndicator A hA) (H (sourceCommutantRotation θ n sourceVacuum)) = _ at hs' + rw [hr] + exact hs' + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ConvolutionCocycle.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ConvolutionCocycle.lean new file mode 100644 index 0000000000000000000000000000000000000000..5c1ec923af58a59f1fa8d1e5efe8f4d6f4da8552 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ConvolutionCocycle.lean @@ -0,0 +1,38 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Cocycle +import OAI.Analysis.FiniteFactor.Convolution + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +noncomputable section + +/-- The actual cocycle is antitone in every integer index, including negative indices. -/ +theorem sourceCocycle_antitone {ι : Type*} (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + {x : ι → ℝ} (hx : finiteFloorSupport θ x) : + Antitone (fun k : ℤ => sourceCocycle θ c k x) := by + intro k l hkl + apply Real.exp_le_exp.mpr + apply neg_le_neg + apply (sourceLog_summable θ c hx k).tsum_le_tsum _ (sourceLog_summable θ c hx l) + intro i + apply mul_le_mul_of_nonneg_left _ (hc i) + have hh : coordinateFloor θ k x i ≤ coordinateFloor θ l x i := by + apply Int.floor_mono + apply add_le_add le_rfl + exact mul_le_mul_of_nonneg_right (by exact_mod_cast hkl) (hθ i) + exact_mod_cast hh + +/-- Exact positive-power weight in terms of the two integer cocycle values. -/ +theorem sourceCocycle_power_weight {ι : Type*} (θ c : ι → ℝ) + {x : ι → ℝ} (hx : finiteFloorSupport θ x) (n : ℕ) (k : ℤ) : + sourceCocycle θ c n (coordinateRotate θ k x) = + sourceCocycle θ c ((n : ℤ)+k) x / sourceCocycle θ c k x := by + rw [add_comm (n : ℤ) k,sourceCocycle_add θ c hx] + exact (mul_div_cancel_right₀ _ (ne_of_gt (sourceCocycle_pos θ c k x))).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CouplingBudget.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CouplingBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b23304c17c3cb69684f06711d68e72f2f232463 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CouplingBudget.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseCoverage +import OAI.Analysis.FiniteFactor.Coupling.BadEvents + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +theorem sourceStage_L_mono : Monotone (fun s => (sourceStage s).L) := by + apply monotone_nat_of_le_succ + intro s + exact (sourceStage (s+1)).L_ge + +theorem staged_rho_first (j s : ℕ) : + (sourceBlockSize s : ℝ)*(stagedCouplingParameters j s).rho 0 = + sourceKappa s*Real.sqrt (sourceStageState s).G := by + have hm := sourceBlockSize_pos s + have hG : 0 ≤ (sourceStageState s).G := zero_le_one.trans (sourceStageState s).G_ge + change (sourceBlockSize s : ℝ)*(sourceKappa s* + Real.sqrt (((sourceStageState s).G/(sourceBlockSize s : ℝ))/(sourceBlockSize s : ℝ))) = _ + rw [div_div, Real.sqrt_div hG, Real.sqrt_mul_self hm.le] + field_simp + +theorem staged_rho_second (j s : ℕ) : + (sourceBlockSize s : ℝ)*(stagedCouplingParameters j s).rho 1 = + sourceKappa s*(sourceBlockSize s : ℝ)^(1/40 : ℝ) := by + have hm := sourceBlockSize_pos s + change (sourceBlockSize s : ℝ)*(sourceKappa s* + Real.sqrt (((sourceBlockSize s : ℝ)^(-19/20 : ℝ))/(sourceBlockSize s : ℝ))) = _ + rw [Real.sqrt_eq_rpow, div_eq_mul_inv, ← Real.rpow_neg_one, + ← Real.rpow_add hm, ← Real.rpow_mul hm.le] + have he : ((-19/20 : ℝ)+(-1))*(1/2) = -39/40 := by ring + rw [he] + calc + _ = sourceKappa s*((sourceBlockSize s : ℝ)^(1 : ℝ)*(sourceBlockSize s : ℝ)^(-39/40 : ℝ)) := by rw [Real.rpow_one]; ring + _ = _ := by rw [← Real.rpow_add hm]; norm_num + +/-- Both conditional crossing budgets now follow from the numerical source +construction. The tag location j does not affect these two mixture weights. -/ +theorem staged_rho_budget (j s : ℕ) (hjs : j ≤ s) (w : Fin 2) (hw : w = 0 → j < s) : + (sourceStage j).L ≤ (sourceBlockSize s : ℝ)*(stagedCouplingParameters j s).rho w := by + fin_cases w + · change (sourceStage j).L ≤ (sourceBlockSize s : ℝ)*(stagedCouplingParameters j s).rho 0 + obtain ⟨p,rfl⟩ := Nat.exists_eq_succ_of_ne_zero (show s ≠ 0 by have := hw rfl; omega) + rw [staged_rho_first] + have hh := (sourceStage p).next_budget + exact (sourceStage_L_mono (by have := hw rfl; omega : j ≤ p)).trans hh + · change (sourceStage j).L ≤ (sourceBlockSize s : ℝ)*(stagedCouplingParameters j s).rho 1 + rw [staged_rho_second] + exact (sourceStage_L_mono hjs).trans (sourceStage s).current_budget + +/-- The source coefficient L_j is bounded by the drop in each assigned block. -/ +theorem staged_drop_budget (j s : ℕ) (hjs : j ≤ s) : + (sourceStage j).L ≤ (sourceStage s).C := + (sourceStage_L_mono hjs).trans (le_max_left _ _) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CurrentTaggedEvent.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CurrentTaggedEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..3774e13451cacba763a26b15da192d292b471864 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/CurrentTaggedEvent.lean @@ -0,0 +1,88 @@ +import OAI.Analysis.FiniteFactor.Coupling.TaggedAdmissibility +import OAI.Analysis.FiniteFactor.FiniteSingleTag +import OAI.Analysis.FiniteFactor.TagExponentialLower +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionEvent + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter CouplingParameters +open scoped ENNReal +noncomputable section + +def sourceCurrentTaggedEvent (j : ℕ) : Set SourceBiasedSample := + sourceTaggedEvent j ∩ {ω | ∀ i : Fin (sourceBlockSize j), + ω ⟨j,i⟩ ∈ (stagedCouplingParameters j j).currentBoundary} + +theorem sourceCurrentTaggedEvent_measurable (j : ℕ) : MeasurableSet (sourceCurrentTaggedEvent j) := by + apply (sourceTaggedEvent_measurable j).inter + simp only [Set.ofPred_forall] + exact MeasurableSet.iInter fun i => ((stagedCouplingParameters j j).currentBoundary_measurable).preimage + (measurable_pi_apply (⟨j,i⟩ : SourceCoordinate)) + +/-- The actual current tagged block has mass at least exp(-82). This is a +finite independent exactly-one-tag calculation under sourceBiasedLaw j. -/ +theorem sourceCurrentTaggedEvent_mass (j : ℕ) : + ENNReal.ofReal (Real.exp (-82)) ≤ (sourceBiasedLaw j) (sourceCurrentTaggedEvent j) := by + let F := sourceBlockCoordinates j + let p := stagedCouplingParameters j j + let μ := fun i : SourceCoordinate => (stagedCouplingParameters j i.1).labelledCoupling + let T := fun _ : SourceCoordinate => p.currentTag + let A := fun _ : SourceCoordinate => p.currentNonTag + have hTm (i : SourceCoordinate) (hi : i ∈ F) : μ i (T i) = ENNReal.ofReal (1/(sourceBlockSize j : ℝ)) := by + have his := mem_sourceBlockCoordinates hi + change (stagedCouplingParameters j i.1).labelledCoupling p.currentTag = _ + rw [his,currentTag_mass] + simp [stagedCouplingParameters,tagMass] + have hAm (i : SourceCoordinate) (hi : i ∈ F) : + ENNReal.ofReal (1-41/(sourceBlockSize j : ℝ)) ≤ μ i (A i) := by + have his := mem_sourceBlockCoordinates hi + change _ ≤ (stagedCouplingParameters j i.1).labelledCoupling p.currentNonTag + rw [his] + exact p.currentNonTag_mass_lower + have hh := finite_single_tag_lower μ F T A + (fun _ _ => p.currentTag_measurable) (fun _ _ => p.currentNonTag_measurable) + (fun _ _ => p.currentTag_disjoint) (ENNReal.ofReal (1/(sourceBlockSize j : ℝ))) + (ENNReal.ofReal (1-41/(sourceBlockSize j : ℝ))) (fun i hi => (hTm i hi).symm.le) hAm + have hsub : (⋃ i ∈ F, singleTagCylinder F T A i) ⊆ sourceCurrentTaggedEvent j := by + intro ω hω + simp only [Set.mem_iUnion] at hω + obtain ⟨i,hi,hc⟩ := hω + have his := mem_sourceBlockCoordinates hi + rcases i with ⟨s,i⟩ + change s = j at his + subst s + have ht : ω ⟨j,i⟩ ∈ p.currentTag := by simpa [T] using hc ⟨j,i⟩ hi + refine ⟨⟨i,ht.1⟩,?_⟩ + intro u + have hu : (⟨j,u⟩ : SourceCoordinate) ∈ F := by + exact Finset.mem_map.mpr ⟨u,Finset.mem_univ _,rfl⟩ + have hcu := hc ⟨j,u⟩ hu + by_cases h : (⟨j,u⟩ : SourceCoordinate) = ⟨j,i⟩ + · have ht : ω ⟨j,u⟩ ∈ p.currentTag := by simpa only [ite_eq_left h] using hcu + exact ht.2 + · have ha : ω ⟨j,u⟩ ∈ p.currentNonTag := by simpa only [ite_eq_right h] using hcu + exact ha.2 + have hmt : (sourceBlockSize j : ℝ≥0∞)*ENNReal.ofReal (1/(sourceBlockSize j : ℝ)) = 1 := by + calc + _ = ENNReal.ofReal ((sourceBlockSize j : ℝ)*(1/(sourceBlockSize j : ℝ))) := by + rw [ENNReal.ofReal_mul (Nat.cast_nonneg _)] + simp + _ = 1 := by rw [mul_one_div_cancel (sourceBlockSize_pos j).ne']; simp + have hbase : 0 ≤ 1-41/(sourceBlockSize j : ℝ) := by + apply sub_nonneg.mpr + apply (div_le_one (sourceBlockSize_pos j)).mpr + have hm : (100 : ℝ) ≤ sourceBlockSize j := by exact_mod_cast (sourceStage j).m_ge_100 + linarith + change (F.card : ℝ≥0∞)*ENNReal.ofReal (1/(sourceBlockSize j : ℝ))* + (ENNReal.ofReal (1-41/(sourceBlockSize j : ℝ)))^(F.card-1) ≤ _ at hh + rw [show F.card = sourceBlockSize j from sourceBlockCoordinates_card j,hmt,one_mul, + ← ENNReal.ofReal_pow hbase] at hh + have hn := ENNReal.ofReal_le_ofReal (tag_probability_exponential_lower (sourceBlockSize j) + (sourceStage j).m_ge_100) + exact hn.trans (hh.trans (measure_mono hsub)) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/DiagonalLoss.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/DiagonalLoss.lean new file mode 100644 index 0000000000000000000000000000000000000000..603f66ab73c90e4b70f1203c1c3b1ece189768ff --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/DiagonalLoss.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionEvent +import OAI.Analysis.FiniteFactor.L2UniformAbsoluteContinuity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- Positive measurable functions have vanishing mass below the actual +source threshold 1/(j+1), without any quantitative lower bound. -/ +theorem positive_small_sets_tendsto {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (r : X → ℝ) (hr : Measurable r) + (hpos : ∀ᵐ x ∂μ, 0 < r x) : + Tendsto (fun j : ℕ => μ.real {x | r x < 1/((j : ℝ)+1)}) atTop (𝓝 0) := by + let f := fun j : ℕ => {x | r x < 1/((j : ℝ)+1)}.indicator (fun _ => (1 : ℝ)) + have hA (j : ℕ) : MeasurableSet {x | r x < 1/((j : ℝ)+1)} := measurableSet_lt hr measurable_const + have hm (j : ℕ) : AEStronglyMeasurable (f j) μ := (measurable_const.indicator (hA j)).aestronglyMeasurable + have hb (j : ℕ) : ∀ᵐ x ∂μ, ‖f j x‖ ≤ (1 : ℝ) := by + exact Eventually.of_forall fun x => by + by_cases h : x ∈ {x | r x < 1/((j : ℝ)+1)} + · simp only [f,Set.indicator_of_mem h,norm_one,le_refl] + · simp only [f,Set.indicator_of_notMem h,norm_zero,zero_le_one] + have hl : ∀ᵐ x ∂μ, Tendsto (fun j => f j x) atTop (𝓝 (0 : ℝ)) := by + filter_upwards [hpos] with x hx + apply tendsto_const_nhds.congr' + filter_upwards [(tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)).eventually (gt_mem_nhds hx)] with j hj + have hnot : x ∉ {x | r x < 1/((j : ℝ)+1)} := not_lt.mpr hj.le + simp only [f,Set.indicator_of_notMem hnot] + have ht := tendsto_integral_of_dominated_convergence (fun _ : X => (1 : ℝ)) hm (integrable_const 1) hb hl + have hi (j) : (∫ x, f j x ∂μ) = μ.real {x | r x < 1/((j : ℝ)+1)} := by + rw [integral_indicator (hA j)] + simp [measureReal_def] + simpa only [hi,integral_zero] using ht + +/-- The actual uniformly L2-bounded biased marginals inherit that vanishing +loss even though their full infinite-dimensional densities vary with j. -/ +theorem sourceBiased_positive_endpoint_loss (r : (SourceCoordinate → ℝ) → ℝ) + (hr : Measurable r) (hpos : ∀ᵐ x ∂sourceBaseMeasure, 0 < r x) (b : Bool) : + Tendsto (fun j : ℕ => (sourceBiasedLaw j).real + {ω | r (sourceBiasedEndpoint (fun _ => b) ω) < 1/((j : ℝ)+1)}) atTop (𝓝 0) := by + let C := Real.exp (20*(2*(∑' s,sourceKappa s^2)+1)) + have hbound (j : ℕ) : (sourceBiasedLaw j).real + {ω | r (sourceBiasedEndpoint (fun _ => b) ω) < 1/((j : ℝ)+1)} ≤ + Real.sqrt C * Real.sqrt (sourceBaseMeasure.real {x | r x < 1/((j : ℝ)+1)}) := by + obtain ⟨g,hg,hg0,hglp,he,hgC⟩ := sourceBiasedEndpoint_density j (fun _ => b) + have hA : MeasurableSet {x | r x < 1/((j : ℝ)+1)} := measurableSet_lt hr measurable_const + have hh := withDensity_L2_set_le sourceSamplingHaar g hglp hg0 _ hA C hgC + rw [← he,Measure.map_apply (sourceBiasedEndpoint_measurable _) hA] at hh + exact ENNReal.toReal_le_of_le_ofReal (by positivity) hh + have ht := ((positive_small_sets_tendsto sourceBaseMeasure r hr hpos).sqrt).const_mul (Real.sqrt C) + apply squeeze_zero (fun j => ENNReal.toReal_nonneg) hbound + simpa only [Real.sqrt_zero,mul_zero] using ht + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventExpectation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventExpectation.lean new file mode 100644 index 0000000000000000000000000000000000000000..576536d8a39fd2119ba32c82db2082e7bed358c0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventExpectation.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TruncatedBound + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The source per-coefficient expectation upper bound, with all convolution, +ratio and masked-error inputs discharged for the original invariant p. -/ +theorem sourceProjectionEvent_coefficient_expectation (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n : ℕ) : + (∫ ω in sourceProjectionEvent p j, ‖sourceTruncatedCoefficient θ p j n ω‖ ∂sourceBiasedLaw j) ≤ + Real.exp (-(sourceStage j).L)+2*Real.exp (-(sourceStage j).L/800) := by + let E := sourceProjectionEvent p j + let e := sourceOmittedError θ hθ p j hphase (n : ℤ) + let a := Real.exp (-(sourceStage j).L) + have hE := sourceProjectionEvent_measurable p j + have hi := (sourceTruncatedCoefficient_integrable θ hθ hs hp hproj hinv j n).norm + obtain ⟨hi0,hb0⟩ := sourceOmittedError_estimate θ hθ hp hproj j hphase n false + obtain ⟨hi1,hb1⟩ := sourceOmittedError_estimate θ hθ hp hproj j hphase n true + have hmajor : ∀ᵐ ω ∂sourceBiasedLaw j, + E.indicator (fun ω => ‖sourceTruncatedCoefficient θ p j n ω‖) ω ≤ a+e false ω+e true ω := by + filter_upwards [sourceProjectionEvent_error_pointwise θ hθ hs hp hproj hinv j hphase n] with ω hω + by_cases he : ω ∈ E + · rw [Set.indicator_of_mem he] + exact hω he + · rw [Set.indicator_of_notMem he] + exact add_nonneg (add_nonneg (Real.exp_pos _).le (sourceOmittedError_nonneg ..)) (sourceOmittedError_nonneg ..) + have hh := integral_mono_ae (hi.indicator hE) (((integrable_const a).add hi0).add hi1) hmajor + rw [integral_indicator hE] at hh + have he1 := integral_add ((integrable_const a).add hi0) hi1 + have he0 := integral_add (integrable_const a) hi0 + dsimp only [Pi.add_apply] at he1 he0 hh + rw [he1,he0] at hh + have ha : (∫ _ω : SourceBiasedSample, a ∂sourceBiasedLaw j) = a := by simp + rw [ha] at hh + change _ ≤ a+2*Real.exp (-(sourceStage j).L/800) + linarith + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventLossAssembly.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventLossAssembly.lean new file mode 100644 index 0000000000000000000000000000000000000000..19f6e6f1de326f4147e4a24beabad0c202eab231 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventLossAssembly.lean @@ -0,0 +1,66 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.CurrentTaggedEvent +import OAI.Analysis.FiniteFactor.CrossedProduct.FutureBoundaryLoss +import OAI.Analysis.FiniteFactor.CrossedProduct.DiagonalLoss + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- Current and future exclusions together give exactly the source boundary. -/ +theorem sourceCurrentFuture_boundary (j : ℕ) (ω : SourceBiasedSample) + (hc : ω ∈ sourceCurrentTaggedEvent j) (hf : ω ∈ sourceFutureBoundaryEvent j) : + ω ∈ sourceBoundaryEvent j := by + intro i hi + rcases i with ⟨s,i⟩ + change j ≤ s at hi + by_cases h : s = j + · subst s + rw [sourceExclusionWidth_current] + exact hc.2 i + · have hjs : j+1 ≤ s := by omega + obtain ⟨n,rfl⟩ := Nat.exists_eq_add_of_le hjs + exact sourceFutureBoundary_no_bad j ω hf n i + +def sourceDiagonalLossSet + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (j : ℕ) (b : Bool) : Set SourceBiasedSample := + {ω | (if b then 1-(sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => true) ω)).re + else (sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => false) ω)).re) < 1/((j : ℝ)+1)} + +/-- No independence is used between the current block and the three losses. -/ +theorem sourceProjectionEvent_mass_losses + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) : + Real.exp (-82) ≤ (sourceBiasedLaw j).real (sourceProjectionEvent p j) + + (sourceBiasedLaw j).real (sourceFutureBoundaryEvent j)ᶜ + + (sourceBiasedLaw j).real (sourceDiagonalLossSet p j false) + + (sourceBiasedLaw j).real (sourceDiagonalLossSet p j true) := by + have hsub : sourceCurrentTaggedEvent j ⊆ + ((sourceProjectionEvent p j ∪ (sourceFutureBoundaryEvent j)ᶜ) ∪ sourceDiagonalLossSet p j false) ∪ + sourceDiagonalLossSet p j true := by + intro ω hc + by_cases hf : ω ∈ sourceFutureBoundaryEvent j + · by_cases hx : ω ∈ sourceDiagonalLossSet p j false + · exact Or.inl (Or.inr hx) + · by_cases hy : ω ∈ sourceDiagonalLossSet p j true + · exact Or.inr hy + · refine Or.inl (Or.inl (Or.inl ⟨⟨hc.1,sourceCurrentFuture_boundary j ω hc hf⟩,?_⟩)) + constructor + · exact le_of_not_gt hx + · exact le_of_not_gt hy + · exact Or.inl (Or.inl (Or.inr hf)) + have hlow : Real.exp (-82) ≤ (sourceBiasedLaw j).real (sourceCurrentTaggedEvent j) := by + have hh := ENNReal.toReal_mono (measure_ne_top _ _) (sourceCurrentTaggedEvent_mass j) + simpa only [ENNReal.toReal_ofReal (Real.exp_pos _).le,measureReal_def] using hh + apply hlow.trans ((measureReal_mono hsub).trans ?_) + apply (measureReal_union_le _ _).trans + apply add_le_add _ le_rfl + apply (measureReal_union_le _ _).trans + exact add_le_add (measureReal_union_le _ _) le_rfl + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventMassUpper.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventMassUpper.lean new file mode 100644 index 0000000000000000000000000000000000000000..e7388578504f7fca9322410faa56a96a67937ea7 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventMassUpper.lean @@ -0,0 +1,49 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.EventExpectation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- An invariant projection in the original algebra forces the actual source +event to have mass at most 1/(j+1) whenever the fixed-angle phase condition +holds. Every coefficient, convolution and expectation input is discharged. -/ +theorem sourceProjectionEvent_mass_upper (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) : + (sourceBiasedLaw j).real (sourceProjectionEvent p j) ≤ 1/((j : ℝ)+1) := by + let K := (sourceStageState j).K + let A := fun ω => sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) + let B := fun ω => sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) + let Mass := fun ω => coefficientMass K (A ω) (B ω) + have hi : Integrable Mass (sourceBiasedLaw j) := by + dsimp only [Mass,coefficientMass] + exact integrable_finsetSum (Finset.range (2*K+1)) (fun n _ => + (sourceTruncatedCoefficient_integrable θ hθ hs hp hproj hinv j n).norm) + have hlow : (sourceStage j).ε * (sourceBiasedLaw j).real (sourceProjectionEvent p j) ≤ + ∫ ω in sourceProjectionEvent p j, Mass ω ∂sourceBiasedLaw j := by + have hh := setIntegral_mono_on_ae (integrable_const (sourceStage j).ε) hi.integrableOn + (sourceProjectionEvent_measurable p j) (sourceProjectionEvent_polynomial_lower θ hθ hp hproj j) + simpa only [setIntegral_const,smul_eq_mul,mul_comm] using hh + have hu := coefficientMass_integral_upper K A B (E := sourceProjectionEvent p j) + (μ := sourceBiasedLaw j) + (a := Real.exp (-(sourceStage j).L)+2*Real.exp (-(sourceStage j).L/800)) + (fun n _ => (sourceTruncatedCoefficient_integrable θ hθ hs hp hproj hinv j n).norm.integrableOn) + (fun n _ => sourceProjectionEvent_coefficient_expectation θ hθ hs hp hproj hinv j hphase n) + have hupper := hu.trans (sourceStage_error_budget j) + have hh : (sourceStage j).ε * (sourceBiasedLaw j).real (sourceProjectionEvent p j) ≤ + (sourceStage j).ε * (1/((j : ℝ)+1)) := by + calc + (sourceStage j).ε * (sourceBiasedLaw j).real (sourceProjectionEvent p j) ≤ + (sourceStage j).ε/((j : ℝ)+1) := hlow.trans hupper + _ = (sourceStage j).ε * (1/((j : ℝ)+1)) := by ring + nlinarith [(sourceStage j).ε_pos] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventPositive.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventPositive.lean new file mode 100644 index 0000000000000000000000000000000000000000..676769b62213f630e541fa9f7692f4e2ce9f6911 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/EventPositive.lean @@ -0,0 +1,41 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.EventLossAssembly +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionDiagonal + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- The actual source E_j has an eventual fixed positive lower bound for +any nontrivial invariant projection of the original algebra. The threshold +may depend on p; the positive lower bound does not. -/ +theorem sourceProjectionEvent_eventually_positive + (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) (hr : SourceRationalIndependent θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (hp0 : p ≠ 0) (hp1 : p ≠ 1) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∀ᶠ j : ℕ in atTop, Real.exp (-82)/2 ≤ (sourceBiasedLaw j).real (sourceProjectionEvent p j) := by + have hdiag := sourceProjection_strict_diagonal θ hθ hr hp hproj hp0 hp1 hinv + have hm : Measurable (fun x => (sourceCentralCoefficient p x).re) := + Complex.continuous_re.measurable.comp (sourceCentralCoefficient_measurable p) + have hpos0 : ∀ᵐ x ∂sourceBaseMeasure, 0 < (sourceCentralCoefficient p x).re := + hdiag.mono fun _ h => h.1 + have hpos1 : ∀ᵐ x ∂sourceBaseMeasure, 0 < 1-(sourceCentralCoefficient p x).re := + hdiag.mono fun _ h => sub_pos.mpr h.2.1 + have ht0 : Tendsto (fun j => (sourceBiasedLaw j).real (sourceDiagonalLossSet p j false)) atTop (𝓝 0) := + sourceBiased_positive_endpoint_loss _ hm hpos0 false + have ht1 : Tendsto (fun j => (sourceBiasedLaw j).real (sourceDiagonalLossSet p j true)) atTop (𝓝 0) := + sourceBiased_positive_endpoint_loss _ (measurable_const.sub hm) hpos1 true + have ht := (sourceFutureBoundary_loss_tendsto.add ht0).add ht1 + simp only [zero_add] at ht + have he := ht.eventually (gt_mem_nhds (half_pos (Real.exp_pos (-82)))) + filter_upwards [he] with j hj + have hh := sourceProjectionEvent_mass_losses p j + linarith + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberEnergy.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberEnergy.lean new file mode 100644 index 0000000000000000000000000000000000000000..1e650611f34c9007bc216fa963fbcd444ce23ece --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberEnergy.lean @@ -0,0 +1,91 @@ +import OAI.Analysis.FiniteFactor.Matrix.Entries + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Squared fiber norm of an actual source L2 vector. Fubini proves finiteness +and identifies it with the square-summable coordinate norm almost everywhere. -/ +def sourceFiberEnergy (f : SourceHilbert SourceCoordinate) (x : SourceCoordinate → ℝ) : ℝ := + ∫ n : ℤ, ‖f (x,n)‖ ^ 2 ∂Measure.count + +theorem source_norm_sq_integrable (f : SourceHilbert SourceCoordinate) : + Integrable (fun z => ‖f z‖ ^ 2) (sourceMeasure SourceCoordinate) := + (memLp_two_iff_integrable_sq_norm (Lp.aestronglyMeasurable f)).mp (Lp.memLp f) + +theorem sourceFiberEnergy_integrable (f : SourceHilbert SourceCoordinate) : + Integrable (sourceFiberEnergy f) sourceBaseMeasure := + (source_norm_sq_integrable f).integral_prod_left + +theorem sourceFiberEnergy_nonneg (f : SourceHilbert SourceCoordinate) (x) : + 0 ≤ sourceFiberEnergy f x := integral_nonneg fun _ => sq_nonneg _ + +theorem source_norm_sq_integral (f : SourceHilbert SourceCoordinate) : + ‖f‖ ^ 2 = ∫ z, ‖f z‖ ^ 2 ∂sourceMeasure SourceCoordinate := by + calc + ‖f‖ ^ 2 = RCLike.re (inner ℂ f f) := InnerProductSpace.norm_sq_eq_re_inner f + _ = ∫ z, RCLike.re (inner ℂ (f z) (f z)) ∂sourceMeasure SourceCoordinate := + (integral_re (L2.integrable_inner (𝕜 := ℂ) f f)).symm + _ = _ := by simp_rw [← InnerProductSpace.norm_sq_eq_re_inner] + +theorem source_norm_sq_energy (f : SourceHilbert SourceCoordinate) : + ‖f‖ ^ 2 = ∫ x, sourceFiberEnergy f x ∂sourceBaseMeasure := by + rw [source_norm_sq_integral, integral_prod _ (source_norm_sq_integrable f)] + rfl + +/-- Measurable localization commutes with taking the squared fiber norm. -/ +theorem sourceFiberEnergy_indicator (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) + (f : SourceHilbert SourceCoordinate) : + sourceFiberEnergy (sourceScalar (sourceBaseIndicator A hA) f) =ᵐ[sourceBaseMeasure] + A.indicator (sourceFiberEnergy f) := by + filter_upwards [source_ae_all_fibers + (sourceScalar_apply_ae (sourceBaseIndicator A hA) f)] with x hx + unfold sourceFiberEnergy + by_cases ha : x ∈ A + · simp only [Set.indicator_of_mem ha] + apply integral_congr_ae + exact Eventually.of_forall fun n => by dsimp only; rw [hx]; simp [sourceBaseIndicator, ha] + · simp only [Set.indicator_of_notMem ha] + have he : (fun n : ℤ => ‖(sourceScalar (sourceBaseIndicator A hA) f) (x,n)‖ ^ 2) = + fun _ => (0 : ℝ) := by + funext n + rw [hx] + simp [sourceBaseIndicator, ha] + rw [he, integral_zero] + +theorem sourceScalar_indicator_norm_sq (A : Set (SourceCoordinate → ℝ)) + (hA : MeasurableSet A) (f : SourceHilbert SourceCoordinate) : + ‖sourceScalar (sourceBaseIndicator A hA) f‖ ^ 2 = + ∫ x in A, sourceFiberEnergy f x ∂sourceBaseMeasure := by + rw [source_norm_sq_energy, integral_congr_ae (sourceFiberEnergy_indicator A hA f), + integral_indicator hA] + +theorem sourceAlgebra_fiberEnergy_le (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (f : SourceHilbert SourceCoordinate) : + ∀ᵐ x ∂sourceBaseMeasure, + sourceFiberEnergy (H f) x ≤ ‖H‖ ^ 2 * sourceFiberEnergy f x := by + apply ae_le_of_forall_setIntegral_le (sourceFiberEnergy_integrable (H f)) + ((sourceFiberEnergy_integrable f).const_mul (‖H‖ ^ 2)) + intro A hA _ + rw [← sourceScalar_indicator_norm_sq A hA, integral_const_mul, + ← sourceScalar_indicator_norm_sq A hA] + have he : sourceScalar (sourceBaseIndicator A hA) (H f) = + H (sourceScalar (sourceBaseIndicator A hA) f) := + congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => T f) + (sourceAlgebra_commutes_scalar θ hH (sourceBaseIndicator A hA)) + rw [he] + have hb := H.le_opNorm (sourceScalar (sourceBaseIndicator A hA) f) + have hn := norm_nonneg (H (sourceScalar (sourceBaseIndicator A hA) f)) + have hp := mul_nonneg (norm_nonneg H) + (norm_nonneg (sourceScalar (sourceBaseIndicator A hA) f)) + nlinarith [sq_nonneg (‖H‖ * ‖sourceScalar (sourceBaseIndicator A hA) f‖ - + ‖H (sourceScalar (sourceBaseIndicator A hA) f)‖)] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberIndicators.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberIndicators.lean new file mode 100644 index 0000000000000000000000000000000000000000..c06d068356ae5d0345d9ab7904d84286e6f457ea --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberIndicators.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.RotationCommutant +import OAI.Analysis.FiniteFactor.CrossedProduct.VacuumFunctional + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Bounded measurable indicator on the base. -/ +def sourceBaseIndicator (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) : + SourceBaseFunction where + toFun := A.indicator (fun _ => (1 : ℂ)) + measurable := measurable_const.indicator hA + bound := 1 + bound_nonneg := zero_le_one + norm_le := by intro x _; by_cases hx : x ∈ A <;> simp [hx] + +theorem sourceFiberMeasure_ne_top (A : Set (SourceCoordinate → ℝ)) (n : ℤ) : + sourceMeasure SourceCoordinate (A ×ˢ {n}) ≠ ∞ := by + rw [Measure.prod_prod] + simp + +def sourceFiberIndicator (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (n : ℤ) : + SourceHilbert SourceCoordinate := + indicatorConstLp 2 (hA.prod (measurableSet_singleton n)) (sourceFiberMeasure_ne_top A n) (1 : ℂ) + +theorem sourceFiberIndicator_coe (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (n : ℤ) : + sourceFiberIndicator A hA n =ᵐ[sourceMeasure SourceCoordinate] + (A ×ˢ {n}).indicator (fun _ => (1 : ℂ)) := + indicatorConstLp_coeFn + +theorem sourceVacuum_coe : sourceVacuum =ᵐ[sourceMeasure SourceCoordinate] + (Set.univ ×ˢ {(0 : ℤ)}).indicator (fun _ => (1 : ℂ)) := + indicatorConstLp_coeFn + +/-- Every bounded base indicator on an arbitrary fiber is in the vacuum's +commutant orbit. No cyclicity or separating property is assumed. -/ +theorem sourceFiberIndicator_eq_orbit (θ : SourceCoordinate → ℝ) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (n : ℤ) : + sourceFiberIndicator A hA n = sourceScalar (sourceBaseIndicator A hA) + (sourceCommutantRotation θ n sourceVacuum) := by + apply Lp.ext + have hv := (sourceTransportIndex_preserving θ n n).quasiMeasurePreserving.ae sourceVacuum_coe + filter_upwards [sourceFiberIndicator_coe A hA n, sourceHilbert_cube, + sourcePi_apply_ae (fun _ => 0) (sourceBaseIndicator A hA) + (sourceTransport θ n n sourceVacuum), sourceTransport_apply_ae θ n n sourceVacuum, + hv] with z hi hc hs ht hv + change (sourceFiberIndicator A hA n) z = + (sourcePi (fun _ => 0) (sourceBaseIndicator A hA) (sourceTransport θ n n sourceVacuum)) z + rw [hi,hs,ht,hv] + have he : coordinateRotate (fun _ : SourceCoordinate => 0) z.2 z.1 = z.1 := by + funext i + simpa [coordinateRotate] using Int.fract_eq_self.mpr (hc i) + unfold sourcePiSymbol + rw [he] + by_cases ha : z.1 ∈ A <;> by_cases hn : z.2 = n <;> + simp [sourceBaseIndicator, sourceTransportIndex, ha, hn, sub_eq_zero] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberSeparable.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberSeparable.lean new file mode 100644 index 0000000000000000000000000000000000000000..febddb7eaf30e6487153e3321821ebbbda3590b0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberSeparable.lean @@ -0,0 +1,28 @@ +import OAI.Analysis.FiniteFactor.BoundedMatrixOperator +import Mathlib.Topology.Algebra.Module.Basic + +namespace OAI + +namespace FiniteFactor +open Set TopologicalSpace +noncomputable section + +/-- Separability of the actual l2(Z) fiber, from its countable coordinate basis. -/ +instance sourceFiber_separable : TopologicalSpace.SeparableSpace SourceFiberHilbert := by + let b : ℤ → SourceFiberHilbert := fun n => lp.single 2 n (1 : ℂ) + let S := Submodule.span ℂ (Set.range b) + have hmem (a : ℤ →₀ ℂ) : fiberFiniteEmbedding a ∈ S := by + change (∑ n ∈ a.support, a n • b n) ∈ S + exact Submodule.sum_mem S fun n _ => Submodule.smul_mem S (a n) (Submodule.subset_span ⟨n,rfl⟩) + have hd : Dense (S : Set SourceFiberHilbert) := by + intro x + exact closure_mono (by rintro _ ⟨a,rfl⟩; exact hmem a) (fiberFiniteEmbedding_dense x) + have hs : IsSeparable (closure (S : Set SourceFiberHilbert)) := + (Set.countable_range b).isSeparable.span.closure + rw [hd.closure_eq] at hs + exact isSeparable_univ_iff.mp hs + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberTotal.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberTotal.lean new file mode 100644 index 0000000000000000000000000000000000000000..e2d9dc95bbb96c66665a298d3371c53bf0278b8e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiberTotal.lean @@ -0,0 +1,47 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiberIndicators +import Mathlib.MeasureTheory.Function.AEEqOfIntegral + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Measurable base indicators on the integer fibers determine an L2 vector. -/ +theorem sourceFiberIndicators_total (f : SourceHilbert SourceCoordinate) + (hf : ∀ (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (n : ℤ), + inner ℂ (sourceFiberIndicator A hA n) f = 0) : f = 0 := by + apply Lp.ext + refine (Lp.ae_eq_zero_of_forall_setIntegral_eq_zero f (by norm_num) (by norm_num) + (fun s _ hs => integrableOn_Lp_of_measure_ne_top f (by norm_num) hs.ne) ?_).trans ?_ + · intro s hs hμs + let A : ℤ → Set (SourceCoordinate → ℝ) := fun n => {x | (x,n) ∈ s} + have hA (n : ℤ) : MeasurableSet (A n) := hs.preimage (measurable_id.prodMk measurable_const) + have hcover : s = ⋃ n : ℤ, A n ×ˢ {n} := by + ext z + simp only [Set.mem_iUnion, Set.mem_prod, Set.mem_singleton_iff, A, Set.mem_ofPred_eq] + constructor + · intro hz; exact ⟨z.2, hz, rfl⟩ + · rintro ⟨n,hn,he⟩; simpa only [← he, Prod.eta] using hn + have hd : Pairwise (fun n m : ℤ => Disjoint (A n ×ˢ {n}) (A m ×ˢ {m})) := by + intro n m hnm + apply Set.disjoint_left.mpr + rintro z ⟨_,hn⟩ ⟨_,hm⟩ + exact hnm (hn.symm.trans hm) + have hi : IntegrableOn f (⋃ n : ℤ, A n ×ˢ {n}) (sourceMeasure SourceCoordinate) := by + rw [← hcover] + exact integrableOn_Lp_of_measure_ne_top f (by norm_num) hμs.ne + rw [hcover, integral_iUnion (fun n => (hA n).prod (measurableSet_singleton n)) hd hi] + have hz (n : ℤ) : ∫ z in A n ×ˢ {n}, f z ∂sourceMeasure SourceCoordinate = 0 := by + have he := hf (A n) (hA n) n + rw [sourceFiberIndicator, L2.inner_indicatorConstLp_one] at he + exact he + simp_rw [hz] + exact tsum_zero + · exact (Lp.coeFn_zero _ _ _).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FieldAlgebra.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FieldAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..4f84fb4a96645fd8db011a4686349858b4243e92 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FieldAlgebra.lean @@ -0,0 +1,149 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FieldRepresentation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal ComplexConjugate +noncomputable section + +theorem sourceFiberVector_basis (n : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, sourceFiberVector (sourceBasis n) x = lp.single 2 n (1 : ℂ) := by + filter_upwards [sourceFiberVector_coe (sourceBasis n), source_ae_all_fibers (sourceBasis_coe n)] + with x hf hb + apply Subtype.ext + funext k + rw [hf, hb] + by_cases hk : k = n + · subst k; simp [lp.single_apply] + · simp [lp.single_apply, hk] + +theorem sourceOperatorField_mul (θ : SourceCoordinate → ℝ) + {A B : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) (hB : B ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, + sourceOperatorField (A * B) x = sourceOperatorField A x * sourceOperatorField B x := by + have h (n : ℤ) : ∀ᵐ x ∂sourceBaseMeasure, + sourceOperatorField (A * B) x (lp.single 2 n (1 : ℂ)) = + sourceOperatorField A x (sourceOperatorField B x (lp.single 2 n (1 : ℂ))) := by + filter_upwards [sourceOperatorField_represents θ (mul_mem hA hB) (sourceBasis n), + sourceOperatorField_represents θ hA (B (sourceBasis n)), + sourceOperatorField_represents θ hB (sourceBasis n), sourceFiberVector_basis n] + with x hab ha hb he + rw [he] at hab hb + change sourceFiberVector (A (B (sourceBasis n))) x = _ at hab + rw [ha, hb] at hab + exact hab.symm + filter_upwards [ae_all_iff.mpr h] with x hx + apply fiberOperator_ext + intro k n + exact congrArg (fun v : SourceFiberHilbert => v k) (hx n) + +theorem sourceOperatorField_one (θ : SourceCoordinate → ℝ) : + ∀ᵐ x ∂sourceBaseMeasure, sourceOperatorField (1 : SourceHilbert SourceCoordinate →L[ℂ] + SourceHilbert SourceCoordinate) x = 1 := by + have h (n : ℤ) : ∀ᵐ x ∂sourceBaseMeasure, + sourceOperatorField (1 : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + x (lp.single 2 n (1 : ℂ)) = lp.single 2 n 1 := by + filter_upwards [sourceOperatorField_represents θ (one_mem (sourceAlgebra θ)) (sourceBasis n), + sourceFiberVector_basis n] with x hi he + change sourceFiberVector (sourceBasis n) x = _ at hi + rw [he] at hi + exact hi.symm + filter_upwards [ae_all_iff.mpr h] with x hx + apply fiberOperator_ext + intro k n + exact congrArg (fun v : SourceFiberHilbert => v k) (hx n) + +theorem fiberOperator_star_entry (A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (k n : ℤ) : + ((star A) (lp.single 2 n (1 : ℂ))) k = star ((A (lp.single 2 k (1 : ℂ))) n) := by + calc + _ = inner ℂ (lp.single 2 k (1 : ℂ)) ((star A) (lp.single 2 n (1 : ℂ))) := by + rw [lp.inner_single_left]; simp + _ = inner ℂ (A (lp.single 2 k (1 : ℂ))) (lp.single 2 n (1 : ℂ)) := by + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + _ = _ := by rw [lp.inner_single_right]; simp [RCLike.inner_apply] + +theorem sourceOperatorField_star (θ : SourceCoordinate → ℝ) + {A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, sourceOperatorField (star A) x = star (sourceOperatorField A x) := by + have hs : ∀ᵐ x ∂sourceBaseMeasure, ∀ k n : ℤ, + sourceMatrixEntry (star A) k n x = star (sourceMatrixEntry A n k x) := by + rw [ae_all_iff] + intro k + rw [ae_all_iff] + exact sourceMatrixEntry_star θ hA k + filter_upwards [sourceOperatorField_entries_ae θ hA, + sourceOperatorField_entries_ae θ (star_mem hA), hs] with x ha hstar hs + apply fiberOperator_ext + intro k n + rw [hstar, fiberOperator_star_entry, ha, hs] + +theorem sourceOperatorField_zero (x : SourceCoordinate → ℝ) : + sourceOperatorField (0 : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) x = 0 := by + apply norm_eq_zero.mp + exact le_antisymm (by simpa using sourceOperatorField_norm 0 x) (norm_nonneg _) + +theorem sourceOperatorField_sub (θ : SourceCoordinate → ℝ) + {A B : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) (hB : B ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, + sourceOperatorField (A - B) x = sourceOperatorField A x - sourceOperatorField B x := by + have hsub : ∀ᵐ x ∂sourceBaseMeasure, ∀ n k : ℤ, + sourceMatrixEntry (A-B) k n x = sourceMatrixEntry A k n x - sourceMatrixEntry B k n x := by + rw [ae_all_iff] + intro n + exact source_ae_all_fibers (Lp.coeFn_sub (A (sourceBasis n)) (B (sourceBasis n))) + filter_upwards [sourceOperatorField_entries_ae θ hA, sourceOperatorField_entries_ae θ hB, + sourceOperatorField_entries_ae θ (sub_mem hA hB), hsub] with x ha hb hab hs + apply fiberOperator_ext + intro k n + change (sourceOperatorField (A-B) x (lp.single 2 n (1 : ℂ))) k = + (sourceOperatorField A x (lp.single 2 n (1 : ℂ))) k - + (sourceOperatorField B x (lp.single 2 n (1 : ℂ))) k + rw [hab, ha, hb, hs] + +/-- Every projection in the source algebra yields an actual measurable +orthogonal-projection field. -/ +theorem sourceOperatorField_projection (θ : SourceCoordinate → ℝ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) : + ∀ᵐ x ∂sourceBaseMeasure, IsStarProjection (sourceOperatorField p x) := by + filter_upwards [sourceOperatorField_mul θ hp hp, sourceOperatorField_star θ hp] with x hm hs + refine ⟨?_, ?_⟩ + · change sourceOperatorField p x * sourceOperatorField p x = sourceOperatorField p x + rw [← hm, hproj.isIdempotentElem] + · change star (sourceOperatorField p x) = sourceOperatorField p x + rw [← hs, hproj.isSelfAdjoint.star_eq] + +/-- The original invariant-projection equation holds fiberwise for the actual +operator and projection fields. -/ +theorem sourceOperatorField_invariant (θ : SourceCoordinate → ℝ) + {p T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hT : T ∈ sourceAlgebra θ) + (hinv : (1-p)*T*p = 0) : + ∀ᵐ x ∂sourceBaseMeasure, + (1-sourceOperatorField p x)*sourceOperatorField T x*sourceOperatorField p x = 0 := by + have hsub := sub_mem (one_mem (sourceAlgebra θ)) hp + filter_upwards [sourceOperatorField_mul θ (mul_mem hsub hT) hp, + sourceOperatorField_mul θ hsub hT, sourceOperatorField_sub θ (one_mem (sourceAlgebra θ)) hp, + sourceOperatorField_one θ] with x hab ha hs h1 + rw [hinv, sourceOperatorField_zero, ha, hs, h1] at hab + exact hab.symm + +/-- The normal trace already proved is exactly the field-integral formula. -/ +theorem sourceVacuumFunctional_fieldIntegral (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + sourceVacuumFunctional H = ∫ x, + (sourceOperatorField H x (lp.single 2 0 (1 : ℂ))) 0 ∂sourceBaseMeasure := by + rw [sourceVacuumFunctional_matrixIntegral] + apply integral_congr_ae + filter_upwards [sourceOperatorField_entries_ae θ hH] with x hx + exact (hx 0 0).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FieldRepresentation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FieldRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..1a9b05d785eeb28259330032756aecd529e62ec1 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FieldRepresentation.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.OperatorField +import OAI.Analysis.FiniteFactor.Matrix.Action + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- Coordinate measurability suffices for strong measurability in l2(Z). -/ +theorem fiberCoordinates_stronglyMeasurable {X : Type*} [MeasurableSpace X] + (f : X → SourceFiberHilbert) (hf : ∀ n : ℤ, Measurable (fun x => f x n)) : + StronglyMeasurable f := by + apply stronglyMeasurable_of_tendsto (atTop : Filter (Finset ℤ)) + (f := fun s x => ∑ n ∈ s, lp.single 2 n (f x n)) + · intro s + have h (n : ℤ) : StronglyMeasurable (fun x => (lp.single 2 n (f x n) : SourceFiberHilbert)) := + (lp.singleContinuousLinearMap ℂ (fun _ : ℤ => ℂ) 2 n).continuous.comp_stronglyMeasurable + (hf n).stronglyMeasurable + convert Finset.stronglyMeasurable_sum s (fun n _ => h n) using 1 + funext x + simp only [Finset.sum_apply] + · rw [tendsto_pi_nhds] + intro x + exact lp.hasSum_single (by norm_num : (2 : ℝ≥0∞) ≠ ∞) (f x) + +/-- Every basis column of the actual field is a strongly measurable l2 vector. -/ +theorem sourceOperatorField_basis_stronglyMeasurable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (n : ℤ) : + StronglyMeasurable (fun x => sourceOperatorField H x (lp.single 2 n (1 : ℂ))) := + fiberCoordinates_stronglyMeasurable _ (fun k => sourceOperatorField_entry_measurable H k n) + +theorem sourceOperatorField_stronglyMeasurable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (v : SourceFiberHilbert) : StronglyMeasurable (fun x => sourceOperatorField H x v) := by + apply stronglyMeasurable_of_tendsto (atTop : Filter (Finset ℤ)) + (f := fun s x => ∑ n ∈ s, v n • sourceOperatorField H x (lp.single 2 n (1 : ℂ))) + · intro s + have h (n : ℤ) : StronglyMeasurable (fun x => v n • sourceOperatorField H x (lp.single 2 n (1 : ℂ))) := + (sourceOperatorField_basis_stronglyMeasurable H n).const_smul (v n) + convert Finset.stronglyMeasurable_sum s (fun n _ => h n) using 1 + funext x + simp only [Finset.sum_apply] + · rw [tendsto_pi_nhds] + intro x + exact fiberOperator_hasSum (sourceOperatorField H x) v + +/-- Fubini puts almost every actual L2 section in l2(Z). -/ +theorem source_fiber_memℓp (f : SourceHilbert SourceCoordinate) : + ∀ᵐ x ∂sourceBaseMeasure, Memℓp (fun n : ℤ => f (x,n)) 2 := by + filter_upwards [(source_norm_sq_integrable f).prod_right_ae] with x hx + apply memℓp_gen + have hs := integrable_count_iff.mp hx + simpa only [norm_pow, norm_norm, ENNReal.toReal_ofNat, Real.rpow_two] using hs + +/-- A fiber vector with an irrelevant zero value on the exceptional null set. -/ +def sourceFiberVector (f : SourceHilbert SourceCoordinate) (x : SourceCoordinate → ℝ) : + SourceFiberHilbert := by + classical + exact if h : Memℓp (fun n : ℤ => f (x,n)) 2 then ⟨fun n => f (x,n), h⟩ else 0 + +theorem sourceFiberVector_coe (f : SourceHilbert SourceCoordinate) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ n : ℤ, sourceFiberVector f x n = f (x,n) := by + filter_upwards [source_fiber_memℓp f] with x hx n + simp [sourceFiberVector, hx] + +/-- The constructed field acts as the original operator on every source L2 +vector. Neither decomposability nor a replacement representation is assumed. -/ +theorem sourceOperatorField_represents (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (f : SourceHilbert SourceCoordinate) : + ∀ᵐ x ∂sourceBaseMeasure, + sourceFiberVector (H f) x = sourceOperatorField H x (sourceFiberVector f x) := by + have ha : ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + (H f) (x,k) = ∑' n : ℤ, sourceMatrixEntry H k n x * f (x,n) := by + rw [ae_all_iff] + exact sourceMatrix_action_tsum θ hH f + filter_upwards [sourceFiberVector_coe f, sourceFiberVector_coe (H f), + sourceOperatorField_entries_ae θ hH, ha] with x hf hHf he ha + apply Subtype.ext + funext k + rw [hHf, fiberOperator_action] + simp_rw [he, hf] + exact ha k + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteAlgebra.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..e6a297d56a88428dfc7c01270ef81efdf6ead192 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteAlgebra.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Trace +import OAI.Analysis.FiniteFactor.Model + +namespace OAI + +namespace FiniteFactor +noncomputable section + +/-- The actual generated source algebra is finite: every isometry is unitary. -/ +theorem sourceAlgebra_finite (θ : SourceCoordinate → ℝ) : IsFiniteAlgebra (sourceAlgebra θ) := by + intro v hv hiso + let p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate := 1 - v * star v + have hp : p ∈ sourceAlgebra θ := sub_mem (one_mem _) (mul_mem hv (star_mem hv)) + have hw : (v * star v) * (v * star v) = v * star v := by + calc + _ = v * (star v * v) * star v := by simp only [mul_assoc] + _ = v * star v := by rw [hiso]; simp + have hps : star p = p := by + change star (1 - v * star v) = 1 - v * star v + rw [star_sub, star_one, star_mul, star_star] + have hpp : star p * p = p := by + rw [hps] + change (1 - v * star v) * (1 - v * star v) = 1 - v * star v + rw [sub_mul, one_mul, mul_sub, mul_one, hw] + abel + have ht : sourceVacuumFunctional (v * star v) = 1 := by + rw [sourceVacuumFunctional_tracial θ hv (star_mem hv), hiso, sourceVacuumFunctional_one] + have hz : sourceVacuumFunctional (star p * p) = 0 := by + rw [hpp] + change inner ℂ sourceVacuum ((1 - v * star v) sourceVacuum) = 0 + rw [sub_apply, inner_sub_right] + change sourceVacuumFunctional 1 - sourceVacuumFunctional (v * star v) = 0 + rw [sourceVacuumFunctional_one, ht, sub_self] + have hp0 := (sourceVacuumFunctional_square_eq_zero_iff θ hp).mp hz + exact (sub_eq_zero.mp hp0).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteCocycleBounds.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteCocycleBounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c43eab5eba8f6a32e98410cba4afd99519fb442 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteCocycleBounds.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.StageOperator +import OAI.Analysis.FiniteFactor.CrossedProduct.ConvolutionCocycle + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +noncomputable section + +theorem SourceAngles.le_one {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) (i : SourceCoordinate) : + θ i ≤ 1 := by + apply (hθ i).2.trans + apply (div_le_one (mul_pos (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1))).mpr + change (2 : ℝ) ≤ (sourceBlockSize i.1 : ℝ) * (sourceStageState i.1).K + have hm : (100 : ℝ) ≤ sourceBlockSize i.1 := by exact_mod_cast (sourceStage i.1).m_ge_100 + have hK : (1 : ℝ) ≤ (sourceStageState i.1).K := by exact_mod_cast (sourceStageState i.1).K_ge + nlinarith + +/-- Earlier coordinates contribute at most K+1 in absolute floor value. -/ +theorem sourceCoordinateFloor_abs_le (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (K : ℕ) (k : ℤ) (hk : |(k : ℝ)| ≤ K) (x : SourceCoordinate → ℝ) + (hx : ∀ i, x i ∈ Set.Ico 0 1) (i : SourceCoordinate) : + |(coordinateFloor θ k x i : ℝ)| ≤ (K : ℝ)+1 := by + have hm : |(k : ℝ)*θ i| ≤ K := by + rw [abs_mul,abs_of_nonneg (hθ.nonneg i)] + exact (mul_le_mul_of_nonneg_left (hθ.le_one i) (abs_nonneg _)).trans_eq (mul_one _) + |>.trans hk + have hlow := (abs_le.mp hm).1 + have hhigh := (abs_le.mp hm).2 + have hfl := Int.floor_le (x i+(k : ℝ)*θ i) + have hfu := Int.lt_floor_add_one (x i+(k : ℝ)*θ i) + change |(Int.floor (x i+(k : ℝ)*θ i) : ℝ)| ≤ _ + apply abs_le.mpr + constructor <;> linarith [(hx i).1,(hx i).2] + +theorem sourcePrefix_logWeight_sum (j : ℕ) : + (∑ i ∈ CouplingParameters.blockPrefix sourceBlockSize j, sourceLogWeight i) = (sourceStageState j).B := by + rw [CouplingParameters.blockPrefix,Finset.sum_sigma,sourceStage_previous_weight] + change (∑ s ∈ Finset.range j, ∑ _i : Fin (sourceBlockSize s), (sourceStage s).C) = _ + simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + apply Finset.sum_congr rfl + intro s _ + exact mul_comm _ _ + +/-- If later floors vanish, the actual full source logarithm is bounded by +the recursively recorded earlier-block sum. -/ +theorem sourceLog_finite_bound (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (k : ℤ) (hk : |(k : ℝ)| ≤ (sourceStageState j).K) + (x : SourceCoordinate → ℝ) (hx : ∀ i, x i ∈ Set.Ico 0 1) + (hzero : ∀ i : SourceCoordinate, j ≤ i.1 → coordinateFloor θ k x i = 0) : + |sourceLog θ sourceLogWeight k x| ≤ (((sourceStageState j).K : ℝ)+1)*(sourceStageState j).B := by + have he : sourceLog θ sourceLogWeight k x = + ∑ i ∈ CouplingParameters.blockPrefix sourceBlockSize j, + sourceLogWeight i*(coordinateFloor θ k x i : ℝ) := by + apply tsum_eq_sum + intro i hi + have hh : j ≤ i.1 := by + have := (CouplingParameters.mem_blockPrefix sourceBlockSize j i).not.mp hi + omega + rw [hzero i hh,Int.cast_zero,mul_zero] + rw [he,← sourcePrefix_logWeight_sum,Finset.mul_sum] + apply (Finset.abs_sum_le_sum_abs _ _).trans + apply Finset.sum_le_sum + intro i _ + rw [abs_mul,abs_of_nonneg (sourceLogWeight_nonneg i),mul_comm (((sourceStageState j).K : ℝ)+1)] + exact mul_le_mul_of_nonneg_left (sourceCoordinateFloor_abs_le θ hθ _ k hk x hx i) (sourceLogWeight_nonneg i) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteCoefficients.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteCoefficients.lean new file mode 100644 index 0000000000000000000000000000000000000000..325c5b98f37c9ad0864b73777ca4a06ec16621d0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteCoefficients.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.BoundaryEvent +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionColumns +import OAI.Analysis.FiniteFactor.Coupling.BadEvents + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Every signed finite coefficient uses the actual D_j. Positive indices +use the exact later-floor exclusions; negative indices use antitonicity. -/ +theorem sourceBoundary_cocycle_finite (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (ω : SourceBiasedSample) (he : ω ∈ sourceBoundaryEvent j) + (hxc : ∀ i, sourceBiasedEndpoint (fun _ => false) ω i ∈ Set.Ico 0 1) + (hyc : ∀ i, sourceBiasedEndpoint (fun _ => true) ω i ∈ Set.Ico 0 1) + (hfx : finiteFloorSupport θ (sourceBiasedEndpoint (fun _ => false) ω)) + (hfy : finiteFloorSupport θ (sourceBiasedEndpoint (fun _ => true) ω)) + (k : ℤ) (hk : |(k : ℝ)| ≤ (sourceStageState j).K) : + 1/sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => false) ω) ≤ (sourceStageState j).D ∧ + sourceCocycle θ sourceLogWeight (-k) (sourceBiasedEndpoint (fun _ => true) ω) ≤ (sourceStageState j).D := by + let x := sourceBiasedEndpoint (fun _ => false) ω + let y := sourceBiasedEndpoint (fun _ => true) ω + by_cases h0 : 0 ≤ k + · have hK : (k : ℝ) ≤ (sourceStageState j).K := (le_abs_self _).trans hk + have hz := sourceBoundary_floor_zero θ hθ j ω he hxc hyc k h0 hK + have hxlog := sourceLog_finite_bound θ hθ j k hk x hxc (fun i hi => (hz i hi).1) + have hylog := sourceLog_finite_bound θ hθ j (-k) (by simpa using hk) y hyc (fun i hi => (hz i hi).2) + constructor + · simp only [sourceCocycle,Real.exp_neg,one_div,inv_inv] + exact Real.exp_le_exp.mpr ((le_abs_self _).trans hxlog) + · exact Real.exp_le_exp.mpr ((neg_le_abs _).trans hylog) + · have hk0 : k ≤ 0 := le_of_not_ge h0 + have hD : (1 : ℝ) ≤ (sourceStageState j).D := + Real.one_le_exp (mul_nonneg (by positivity) (sourceStageState j).B_nonneg) + constructor + · have hh := sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfx hk0 + dsimp only at hh + rw [sourceCocycle_zero θ sourceLogWeight hxc] at hh + have hle : 1/sourceCocycle θ sourceLogWeight k x ≤ 1 := by + simpa only [one_div_one] using one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 1) hh + exact hle.trans hD + · have hh := sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfy + (show (0 : ℤ) ≤ -k by omega) + dsimp only at hh + rw [sourceCocycle_zero θ sourceLogWeight hyc] at hh + exact hh.trans hD + +/-- Finite coefficient bounds for the arbitrary projection in the original +algebra, on the actual source boundary-exclusion event. -/ +theorem sourceProjection_finite_coefficients (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceBoundaryEvent j → ∀ k : ℤ, + |(k : ℝ)| ≤ (sourceStageState j).K → + ‖sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) k‖ ≤ (sourceStageState j).D ∧ + ‖sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) k‖ ≤ (sourceStageState j).D := by + have hcube := CouplingParameters.vectorEndpoint_unitCube + (fun i : SourceCoordinate => stagedCouplingParameters j i.1) + filter_upwards [ + ae_of_ae_map (sourceBiasedEndpoint_measurable (fun _ => false)).aemeasurable (hcube (fun _ => false)), + ae_of_ae_map (sourceBiasedEndpoint_measurable (fun _ => true)).aemeasurable (hcube (fun _ => true)), + sourceBiasedEndpoint_ae j (fun _ => false) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => true) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => false) (sourceProjection_columns_norm θ hp hproj), + sourceBiasedEndpoint_ae j (fun _ => true) (sourceProjection_columns_norm θ hp hproj)] + with ω hxc hyc hfx hfy hnx hny + intro he k hk + obtain ⟨hx,hy⟩ := sourceBoundary_cocycle_finite θ hθ j ω he hxc hyc hfx hfy k hk + have hξ := (lp.norm_apply_le_norm (by norm_num : (2 : ℝ≥0∞) ≠ 0) + (sourceProjectionColumn p (sourceBiasedEndpoint (fun _ => false) ω)) k).trans hnx.1 + have hγ := (lp.norm_apply_le_norm (by norm_num : (2 : ℝ≥0∞) ≠ 0) + (sourceComplementColumn p (sourceBiasedEndpoint (fun _ => true) ω)) (-k)).trans hny.2 + constructor + · simp only [sourceProjectionLeftCoefficient,leftCoefficient,norm_div,Complex.norm_real, + Real.norm_eq_abs,abs_of_pos (sourceCocycle_pos ..)] + exact (div_le_div_of_nonneg_right hξ (sourceCocycle_pos ..).le).trans hx + · simp only [sourceProjectionRightCoefficient,rightCoefficient,norm_mul,RCLike.norm_conj, + Complex.norm_real,Real.norm_eq_abs,abs_of_pos (sourceCocycle_pos ..)] + exact ((mul_le_mul_of_nonneg_left hγ (sourceCocycle_pos ..).le).trans_eq (mul_one _)).trans hy + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteVectors.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteVectors.lean new file mode 100644 index 0000000000000000000000000000000000000000..41f2fea85cef764655c104e33894ae336dbd296d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FiniteVectors.lean @@ -0,0 +1,80 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiberEnergy +import Mathlib.MeasureTheory.Integral.Bochner.SumMeasure + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Finite coordinate vectors as actual constant-base L2 vectors. -/ +def sourceFiniteVector (s : Finset ℤ) (a : ℤ → ℂ) : SourceHilbert SourceCoordinate := + ∑ n ∈ s, a n • sourceBasis n + +theorem sourceHilbert_sum_coe {ι : Type*} (s : Finset ι) + (f : ι → SourceHilbert SourceCoordinate) : + ⇑(∑ i ∈ s, f i : SourceHilbert SourceCoordinate) =ᵐ[sourceMeasure SourceCoordinate] fun z => ∑ i ∈ s, f i z := by + classical + induction s using Finset.induction_on with + | empty => + simp only [Finset.sum_empty] + filter_upwards [Lp.coeFn_zero ℂ 2 (sourceMeasure SourceCoordinate)] with z hz + exact hz + | @insert i s hi ih => + simp only [Finset.sum_insert hi] + filter_upwards [Lp.coeFn_add (f i) (∑ j ∈ s, f j), ih] with z ha hs + simp only [ha, Pi.add_apply, hs] + +theorem sourceFiniteVector_coe (s : Finset ℤ) (a : ℤ → ℂ) : + sourceFiniteVector s a =ᵐ[sourceMeasure SourceCoordinate] + fun z => if z.2 ∈ s then a z.2 else 0 := by + have hs : ∀ᵐ z ∂sourceMeasure SourceCoordinate, ∀ n : ℤ, + (a n • sourceBasis n) z = a n * (if z.2 = n then 1 else 0) := by + rw [ae_all_iff] + intro n + filter_upwards [Lp.coeFn_smul (a n) (sourceBasis n), sourceBasis_coe n] with z hc hb + simp only [hc, Pi.smul_apply, smul_eq_mul, hb] + filter_upwards [sourceHilbert_sum_coe s (fun n => a n • sourceBasis n), hs] with z hz hs + change (∑ n ∈ s, a n • sourceBasis n) z = _ + rw [hz] + simp_rw [hs, mul_ite, mul_one, mul_zero] + simp + +theorem sourceFiniteVector_image_coe + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (s : Finset ℤ) (a : ℤ → ℂ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + (H (sourceFiniteVector s a)) (x,k) = ∑ n ∈ s, a n * sourceMatrixEntry H k n x := by + have hs : ∀ᵐ z ∂sourceMeasure SourceCoordinate, ∀ n : ℤ, + (a n • H (sourceBasis n)) z = a n * (H (sourceBasis n)) z := by + rw [ae_all_iff] + intro n + exact Lp.coeFn_smul (a n) (H (sourceBasis n)) + have he : H (sourceFiniteVector s a) = ∑ n ∈ s, a n • H (sourceBasis n) := by + simp [sourceFiniteVector] + rw [he] + filter_upwards [source_ae_all_fibers (sourceHilbert_sum_coe s (fun n => a n • H (sourceBasis n))), + source_ae_all_fibers hs] with x he hs k + rw [he] + exact Finset.sum_congr rfl fun n _ => hs k n + +theorem sourceFiniteVector_energy (s : Finset ℤ) (a : ℤ → ℂ) : + ∀ᵐ x ∂sourceBaseMeasure, + sourceFiberEnergy (sourceFiniteVector s a) x = ∑ n ∈ s, ‖a n‖ ^ 2 := by + filter_upwards [source_ae_all_fibers (sourceFiniteVector_coe s a)] with x hx + unfold sourceFiberEnergy + have he : (fun n : ℤ => ‖(sourceFiniteVector s a) (x,n)‖ ^ 2) = + (s : Set ℤ).indicator (fun n => ‖a n‖ ^ 2) := by + funext n + rw [hx] + by_cases hn : n ∈ s <;> simp [hn] + rw [he, integral_indicator s.measurableSet, setIntegral_finset] + · simp [measureReal_def] + · rw [← (s : Set ℤ).biUnion_of_singleton] + simp [integrableOn_finset_iUnion, integrableOn_singleton_iff] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FloorSupport.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FloorSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..741cde66d23899677440c0dc3dba80ef6904ac90 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FloorSupport.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.FiniteFactor.Coupling.Mixture +import Mathlib.Probability.ProductMeasure +import Mathlib.MeasureTheory.Function.Floor +import Mathlib.MeasureTheory.OuterMeasure.BorelCantelli + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- A uniform coordinate crosses the cut under translation by a with +probability at most |a|, valid for either sign and any size of translation. -/ +theorem unitInterval_floor_exception (a : ℝ) : + unitIntervalMeasure {t : ℝ | Int.floor (t+a) ≠ 0} ≤ ENNReal.ofReal |a| := by + have hm : MeasurableSet {t : ℝ | Int.floor (t+a) ≠ 0} := + (measurableSet_eq_fun (Int.measurable_floor.comp (measurable_id.add_const a)) measurable_const).compl + by_cases ha : |a| < 1 + · rw [unitIntervalMeasure, Measure.restrict_apply hm] + rcases le_total 0 a with hpos | hneg + · have hsub : {t : ℝ | Int.floor (t+a) ≠ 0} ∩ Set.Ico 0 1 ⊆ Set.Ico (1-a) 1 := by + intro t ht + have hn : ¬ (t+a ∈ Set.Ico (0 : ℝ) 1) := by + exact fun h => ht.1 (Int.floor_eq_zero_iff.mpr h) + have hlow : 0 ≤ t+a := add_nonneg ht.2.1 hpos + exact ⟨by by_contra h; apply hn; exact ⟨hlow, by linarith⟩, ht.2.2⟩ + apply (measure_mono hsub).trans + simp [Real.volume_Ico, abs_of_nonneg hpos] + · have hsub : {t : ℝ | Int.floor (t+a) ≠ 0} ∩ Set.Ico 0 1 ⊆ Set.Ico 0 (-a) := by + intro t ht + have hn : ¬ (t+a ∈ Set.Ico (0 : ℝ) 1) := by + exact fun h => ht.1 (Int.floor_eq_zero_iff.mpr h) + have hupp : t+a < 1 := by linarith [ht.2.2] + exact ⟨ht.2.1, by by_contra h; apply hn; exact ⟨by linarith, hupp⟩⟩ + apply (measure_mono hsub).trans + simp [Real.volume_Ico, abs_of_nonpos hneg] + · exact prob_le_one.trans (by simpa using ENNReal.ofReal_le_ofReal (le_of_not_gt ha)) + +/-- Source coordinate floors. Integer times include both directions. -/ +def coordinateFloor {ι : Type*} (θ : ι → ℝ) (k : ℤ) (x : ι → ℝ) (i : ι) : ℤ := + Int.floor (x i + (k : ℝ)*θ i) + +def finiteFloorSupport {ι : Type*} (θ : ι → ℝ) (x : ι → ℝ) : Prop := + ∀ k : ℤ, (Function.support (coordinateFloor θ k x)).Finite + +/-- Borel--Cantelli proves that every integer-time floor sum has only finitely +many nonzero terms, simultaneously. This is the source's conull domain for F_k. -/ +theorem ae_finiteFloorSupport {ι : Type*} [Countable ι] + (θ : ι → ℝ) (hθ : Summable (fun i => |θ i|)) : + ∀ᵐ x ∂Measure.infinitePi (fun _ : ι => unitIntervalMeasure), finiteFloorSupport θ x := by + rw [show (fun x : ι → ℝ => finiteFloorSupport θ x) = + (fun x => ∀ k : ℤ, (Function.support (coordinateFloor θ k x)).Finite) from rfl, ae_all_iff] + intro k + let μ := Measure.infinitePi (fun _ : ι => unitIntervalMeasure) + let E (i : ι) : Set (ι → ℝ) := {x | coordinateFloor θ k x i ≠ 0} + have hb (i : ι) : μ (E i) ≤ ENNReal.ofReal (|(k : ℝ)| * |θ i|) := by + have hm : MeasurableSet {t : ℝ | Int.floor (t+(k : ℝ)*θ i) ≠ 0} := + (measurableSet_eq_fun (Int.measurable_floor.comp + (measurable_id.add_const ((k : ℝ)*θ i))) measurable_const).compl + have he := congrArg (fun ν : Measure ℝ => ν {t : ℝ | Int.floor (t+(k : ℝ)*θ i) ≠ 0}) + (Measure.infinitePi_map_eval (fun _ : ι => unitIntervalMeasure) i) + rw [Measure.map_apply (measurable_pi_apply i) hm] at he + change μ (E i) = _ at he + rw [he, ← abs_mul] + exact unitInterval_floor_exception _ + have hs : (∑' i, μ (E i)) ≠ ∞ := by + apply ne_of_lt + apply lt_of_le_of_lt (ENNReal.tsum_le_tsum hb) + rw [← ENNReal.ofReal_tsum_of_nonneg (fun i => mul_nonneg (abs_nonneg _) (abs_nonneg _)) + (hθ.mul_left |(k : ℝ)|)] + exact ENNReal.ofReal_lt_top + exact ae_finite_setOfPred_mem hs + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FreeRotation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FreeRotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..0d6123fded787a4ca6d5674e670d303add85a8b3 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FreeRotation.lean @@ -0,0 +1,53 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.AngleRelations +import OAI.Analysis.FiniteFactor.CrossedProduct.Rotation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +def sourceFirstCoordinate : SourceCoordinate := + ⟨0, ⟨0, by have := (sourceStage 0).m_ge_100; change 0 < (sourceStage 0).m; omega⟩⟩ + +theorem SourceRationalIndependent.mul_ne_integer {θ : SourceCoordinate → ℝ} + (hθ : SourceRationalIndependent θ) (i : SourceCoordinate) (k : ℤ) (hk : k ≠ 0) (c : ℤ) : + (k : ℝ)*θ i ≠ (c : ℝ) := by + intro he + have hh := (hθ (Finsupp.single i k) c (by simpa using he)).1 + have hz := congrArg (fun v : SourceCoordinate →₀ ℤ => v i) hh + exact hk (by simpa using hz) + +/-- Every nonzero integer rotation has no fixed point, using one source +coordinate. This is pointwise freeness, not merely an almost-everywhere claim. -/ +theorem SourceRationalIndependent.rotation_free {θ : SourceCoordinate → ℝ} + (hθ : SourceRationalIndependent θ) (k : ℤ) (hk : k ≠ 0) (x : SourceCoordinate → ℝ) : + coordinateRotate θ k x ≠ x := by + intro he + have hh := congrFun he sourceFirstCoordinate + change Int.fract (x sourceFirstCoordinate+(k : ℝ)*θ sourceFirstCoordinate) = + x sourceFirstCoordinate at hh + rw [Int.fract] at hh + apply hθ.mul_ne_integer sourceFirstCoordinate k hk + (Int.floor (x sourceFirstCoordinate+(k : ℝ)*θ sourceFirstCoordinate)) + linarith + +theorem exists_source_free_base : ∃ θ : SourceCoordinate → ℝ, + SourceAngles θ ∧ SourceRationalIndependent θ ∧ + (∀ k : ℤ, MeasurePreserving (coordinateRotate θ k) + (Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure)) + (Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure))) ∧ + (∀ k : ℤ, k ≠ 0 → ∀ x, coordinateRotate θ k x ≠ x) ∧ + ∃ hθ : SourceAngles θ, + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + obtain ⟨θ, ha, hr⟩ := (sourceAngleLaw_admissible.and sourceAngleLaw_rationalIndependent).exists + exact ⟨θ, ha, hr, fun k => coordinateRotate_preserving θ k, + fun k hk x => hr.rotation_free k hk x, ha, staged_sourceOperator_properties θ ha⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBoundary.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBoundary.lean new file mode 100644 index 0000000000000000000000000000000000000000..cec261cef7b3994e9d97788eec45a9fee800a7f1 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBoundary.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.BoundaryEvent +import OAI.Analysis.FiniteFactor.Coupling.CoordinateMass + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +theorem sourceBiasedCoordinate_measure (j : ℕ) (i : SourceCoordinate) + (S : Set (Fin 6 × (ℝ × ℝ))) (hS : MeasurableSet S) : + (sourceBiasedLaw j) ((fun ω : SourceBiasedSample => ω i) ⁻¹' S) = + (stagedCouplingParameters j i.1).labelledCoupling S := by + have hm : Measurable (fun ω : SourceBiasedSample => ω i) := measurable_pi_apply i + rw [← Measure.map_apply hm hS] + have he : (sourceBiasedLaw j).map (fun ω => ω i) = (stagedCouplingParameters j i.1).labelledCoupling := + Measure.infinitePi_map_eval _ _ + rw [he] + +def sourceFutureBad (j n : ℕ) (i : Fin (sourceBlockSize (j+1+n))) : Set SourceBiasedSample := + {ω | 1-sourceExclusionWidth j ⟨j+1+n,i⟩ ≤ (ω ⟨j+1+n,i⟩).2.1 ∨ + (ω ⟨j+1+n,i⟩).2.2 ≤ sourceExclusionWidth j ⟨j+1+n,i⟩} + +def sourceFutureBoundaryEvent (j : ℕ) : Set SourceBiasedSample := + (⋃ n : ℕ, ⋃ i : Fin (sourceBlockSize (j+1+n)), sourceFutureBad j n i)ᶜ + +theorem sourceFutureBad_measurable (j n : ℕ) (i : Fin (sourceBlockSize (j+1+n))) : + MeasurableSet (sourceFutureBad j n i) := by + have hm : Measurable (fun ω : SourceBiasedSample => ω ⟨j+1+n,i⟩) := measurable_pi_apply _ + exact (measurableSet_le measurable_const (measurable_fst.comp (measurable_snd.comp hm))).union + (measurableSet_le (measurable_snd.comp (measurable_snd.comp hm)) measurable_const) + +theorem sourceFutureBoundaryEvent_measurable (j : ℕ) : MeasurableSet (sourceFutureBoundaryEvent j) := + (MeasurableSet.iUnion fun n => MeasurableSet.iUnion fun i => sourceFutureBad_measurable j n i).compl + +/-- The actual one-coordinate contribution to the future union loss. -/ +theorem sourceFutureBad_bound (j n : ℕ) (i : Fin (sourceBlockSize (j+1+n))) : + (sourceBiasedLaw j) (sourceFutureBad j n i) ≤ + ENNReal.ofReal (20*sourceExclusionWidth j ⟨j+1+n,i⟩) := by + let a := sourceExclusionWidth j ⟨j+1+n,i⟩ + let p := stagedCouplingParameters j (j+1+n) + have ha : 0 ≤ a := by dsimp [a,sourceExclusionWidth]; positivity + have hS : MeasurableSet ({z : Fin 6 × (ℝ × ℝ) | 1-a ≤ z.2.1} ∪ {z | z.2.2 ≤ a}) := + (measurableSet_le measurable_const (measurable_fst.comp measurable_snd)).union + (measurableSet_le (measurable_snd.comp measurable_snd) measurable_const) + change (sourceBiasedLaw j) ((fun ω : SourceBiasedSample => ω ⟨j+1+n,i⟩) ⁻¹' + ({z | 1-a ≤ z.2.1} ∪ {z | z.2.2 ≤ a})) ≤ ENNReal.ofReal (20*a) + rw [sourceBiasedCoordinate_measure _ _ _ hS] + apply (measure_union_le _ _).trans + apply (add_le_add (p.labelledCoupling_right_tail a) (p.labelledCoupling_left_tail a)).trans_eq + rw [← ENNReal.ofReal_add (mul_nonneg (by norm_num) ha) (mul_nonneg (by norm_num) ha)] + congr 1 + ring + +theorem sourceFutureBoundary_no_bad (j : ℕ) (ω : SourceBiasedSample) + (h : ω ∈ sourceFutureBoundaryEvent j) (n : ℕ) (i : Fin (sourceBlockSize (j+1+n))) : + (ω ⟨j+1+n,i⟩).2.1 < 1-sourceExclusionWidth j ⟨j+1+n,i⟩ ∧ + sourceExclusionWidth j ⟨j+1+n,i⟩ < (ω ⟨j+1+n,i⟩).2.2 := by + have hn : ω ∉ sourceFutureBad j n i := by + intro hb + exact h (Set.mem_iUnion.mpr ⟨n,Set.mem_iUnion.mpr ⟨i,hb⟩⟩) + exact ⟨lt_of_not_ge (fun hx => hn (Or.inl hx)),lt_of_not_ge (fun hy => hn (Or.inr hy))⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBoundaryLoss.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBoundaryLoss.lean new file mode 100644 index 0000000000000000000000000000000000000000..bfd293ac4918c058b9ad0ebce6524bff1423f909 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBoundaryLoss.lean @@ -0,0 +1,52 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FutureBoundary +import OAI.Analysis.FiniteFactor.CrossedProduct.FutureBudget + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +theorem sourceFutureBoundary_loss_bound (j : ℕ) : + (sourceBiasedLaw j) (sourceFutureBoundaryEvent j)ᶜ ≤ + ENNReal.ofReal (80*((sourceStageState j).K : ℝ)/(sourceStageState (j+1)).K) := by + have hb (n : ℕ) : (sourceBiasedLaw j) (⋃ i : Fin (sourceBlockSize (j+1+n)), sourceFutureBad j n i) ≤ + ENNReal.ofReal (40*((sourceStageState j).K : ℝ)/(sourceStageState (j+1+n)).K) := by + apply (measure_iUnion_le _).trans + rw [tsum_fintype] + apply (Finset.sum_le_sum (fun i _ => sourceFutureBad_bound j n i)).trans_eq + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => by dsimp [sourceExclusionWidth]; positivity)] + congr 1 + simp only [sourceExclusionWidth,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] + field_simp [(sourceBlockSize_pos (j+1+n)).ne',(sourceCutoff_pos (j+1+n)).ne'] + ring + have hs : Summable (fun n : ℕ => 1/((sourceStageState (j+1+n)).K : ℝ)) := + sourceCutoff_reciprocal_summable.comp_injective (fun a b h => by omega) + have he (n : ℕ) : 40*((sourceStageState j).K : ℝ)/(sourceStageState (j+1+n)).K = + (40*((sourceStageState j).K : ℝ))*(1/((sourceStageState (j+1+n)).K : ℝ)) := by ring + have hss : Summable (fun n : ℕ => 40*((sourceStageState j).K : ℝ)/(sourceStageState (j+1+n)).K) := by + simp_rw [he] + exact hs.mul_left _ + rw [sourceFutureBoundaryEvent,compl_compl] + apply (measure_iUnion_le _).trans + apply (ENNReal.tsum_le_tsum hb).trans + rw [← ENNReal.ofReal_tsum_of_nonneg (fun n => by positivity) hss] + apply ENNReal.ofReal_le_ofReal + simp_rw [he] + rw [tsum_mul_left] + calc + _ ≤ (40*((sourceStageState j).K : ℝ))*(2/((sourceStageState (j+1)).K : ℝ)) := + mul_le_mul_of_nonneg_left (sourceCutoff_tail_bound (j+1)) (by positivity) + _ = _ := by ring + +theorem sourceFutureBoundary_loss_tendsto : + Tendsto (fun j : ℕ => (sourceBiasedLaw j).real (sourceFutureBoundaryEvent j)ᶜ) atTop (𝓝 0) := by + apply squeeze_zero (fun j => ENNReal.toReal_nonneg) + (fun j => ENNReal.toReal_le_of_le_ofReal (by positivity) (sourceFutureBoundary_loss_bound j)) + exact sourceFutureBudget_tendsto + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBudget.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBudget.lean new file mode 100644 index 0000000000000000000000000000000000000000..7d1c2b7798c47c9d9672a45515fa1df687183e8b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/FutureBudget.lean @@ -0,0 +1,44 @@ +import OAI.Analysis.FiniteFactor.OrbitSampling.Tail +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseDecay + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- The exact recursive cutoff is at least m_j squared, giving vanishing +future boundary loss rather than merely geometric cutoff growth. -/ +theorem sourceNextCutoff_ge_square (m : ℕ) (hm : 100 ≤ m) : + (m : ℝ)^2 ≤ (sourceNextCutoff m : ℝ) := by + have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm + have hp : (m : ℝ)^2 ≤ (m : ℝ)^((3/4 : ℝ)*(m : ℝ)) := by + rw [← Real.rpow_natCast] + exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num; linarith) + exact hp.trans (Nat.le_ceil _) + +theorem sourceCutoff_ratio_tendsto : + Tendsto (fun j : ℕ => ((sourceStageState j).K : ℝ)/(sourceStageState (j+1)).K) atTop (𝓝 0) := by + have hbound (j : ℕ) : ((sourceStageState j).K : ℝ)/(sourceStageState (j+1)).K ≤ + 1/(sourceBlockSize j : ℝ) := by + have hm := sourceBlockSize_pos j + have hK := sourceCutoff_pos (j+1) + have hnext : (sourceBlockSize j : ℝ)^2 ≤ (sourceStageState (j+1)).K := + sourceNextCutoff_ge_square (sourceBlockSize j) (sourceStage j).m_ge_100 + have hprev : ((sourceStageState j).K : ℝ) ≤ sourceBlockSize j := by exact_mod_cast (sourceStage j).m_ge_K + apply (div_le_div_iff₀ hK hm).mpr + nlinarith + have ht : Tendsto (fun j : ℕ => (sourceBlockSize j : ℝ)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.comp sourceBlockSize_tendsto) + apply squeeze_zero (fun j => div_nonneg (Nat.cast_nonneg _) (Nat.cast_nonneg _)) hbound + simpa only [one_div] using ht + +theorem sourceFutureBudget_tendsto : + Tendsto (fun j : ℕ => 80*((sourceStageState j).K : ℝ)/(sourceStageState (j+1)).K) atTop (𝓝 0) := by + simpa only [mul_div_assoc,mul_zero] using sourceCutoff_ratio_tendsto.const_mul 80 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/GeneratedAlgebra.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/GeneratedAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..45d457b8f7689506be58c07142a9bf7078a64bee --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/GeneratedAlgebra.lean @@ -0,0 +1,125 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.StageOperator +import OAI.Analysis.FiniteFactor.CrossedProduct.Rotation +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Algebra.Star.Subalgebra + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Pointwise +noncomputable section + +/-- A bounded Borel function on the source cube. Values outside the cube +are irrelevant because the representation evaluates rotation representatives. -/ +structure SourceBaseFunction where + toFun : (SourceCoordinate → ℝ) → ℂ + measurable : Measurable toFun + bound : ℝ + bound_nonneg : 0 ≤ bound + norm_le : ∀ x, (∀ i, x i ∈ Set.Ico 0 1) → ‖toFun x‖ ≤ bound + +def sourcePiSymbol (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) + (z : (SourceCoordinate → ℝ) × ℤ) : ℂ := g.toFun (coordinateRotate θ z.2 z.1) + +theorem sourcePiSymbol_measurable (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + Measurable (sourcePiSymbol θ g) := by + apply g.measurable.comp + apply Measurable.of_eval + intro i + unfold coordinateRotate + fun_prop + +theorem sourcePiSymbol_bound (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) (z) : + ‖sourcePiSymbol θ g z‖ ≤ g.bound := + g.norm_le _ (fun _ => ⟨Int.fract_nonneg _, Int.fract_lt_one _⟩) + +theorem sourcePiSymbol_memLp (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + MemLp (sourcePiSymbol θ g) ∞ (sourceMeasure SourceCoordinate) := + memLp_top_of_bound (sourcePiSymbol_measurable θ g).aestronglyMeasurable g.bound + (Eventually.of_forall (sourcePiSymbol_bound θ g)) + +def sourcePi (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate := + (ContinuousLinearMap.mul ℂ ℂ).holderL (sourceMeasure SourceCoordinate) ∞ 2 2 + ((sourcePiSymbol_memLp θ g).toLp (sourcePiSymbol θ g)) + +theorem sourcePi_apply_ae (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) + (f : SourceHilbert SourceCoordinate) : + sourcePi θ g f =ᵐ[sourceMeasure SourceCoordinate] fun z => sourcePiSymbol θ g z * f z := by + have hh := (ContinuousLinearMap.mul ℂ ℂ).coeFn_holder + ((sourcePiSymbol_memLp θ g).toLp (sourcePiSymbol θ g)) f (r := 2) + filter_upwards [hh, (sourcePiSymbol_memLp θ g).coeFn_toLp] with z hz hg + simpa [sourcePi, hg] using hz + +theorem sourcePi_norm_le (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + ‖sourcePi θ g‖ ≤ g.bound := by + apply ContinuousLinearMap.opNorm_le_bound _ g.bound_nonneg + intro f + have hh : ‖sourcePi θ g f‖ ≤ ‖g.bound • f‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [sourcePi_apply_ae θ g f, Lp.coeFn_smul g.bound f] with z hz hs + rw [hz, hs, Pi.smul_apply, norm_mul, norm_smul, Real.norm_eq_abs, abs_of_nonneg g.bound_nonneg] + exact mul_le_mul_of_nonneg_right (sourcePiSymbol_bound θ g z) (norm_nonneg _) + simpa [norm_smul, Real.norm_eq_abs, abs_of_nonneg g.bound_nonneg] using hh + +/-- Double commutant of a concrete family, including its adjoints. -/ +def sourceGeneratedVonNeumann {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] (S : Set (H →L[ℂ] H)) : VonNeumannAlgebra H where + toStarSubalgebra := StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S) + centralizer_centralizer' := by + have he : (StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S)).carrier = + Set.centralizer (Set.centralizer (S ∪ star S)) := + StarSubalgebra.coe_centralizer_centralizer ℂ S + rw [he] + simp + +theorem mem_sourceGeneratedVonNeumann {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] + [CompleteSpace H] (S : Set (H →L[ℂ] H)) {T : H →L[ℂ] H} (hT : T ∈ S) : + T ∈ sourceGeneratedVonNeumann S := by + have he : (StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S)).carrier = + Set.centralizer (Set.centralizer (S ∪ star S)) := + StarSubalgebra.coe_centralizer_centralizer ℂ S + change T ∈ (StarSubalgebra.centralizer ℂ (StarSubalgebra.centralizer ℂ S)).carrier + rw [he] + exact Set.subset_centralizer_centralizer (Or.inl hT) + +/-- The actual generated algebra of the source regular representation. +Factor, trace, finiteness and predual properties are separate obligations. -/ +def sourceAlgebra (θ : SourceCoordinate → ℝ) : VonNeumannAlgebra (SourceHilbert SourceCoordinate) := + sourceGeneratedVonNeumann ({sourceShift SourceCoordinate} ∪ Set.range (sourcePi θ)) + +theorem sourcePi_mem (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + sourcePi θ g ∈ sourceAlgebra θ := + mem_sourceGeneratedVonNeumann _ (Or.inr ⟨g,rfl⟩) + +theorem sourceShift_mem (θ : SourceCoordinate → ℝ) : + sourceShift SourceCoordinate ∈ sourceAlgebra θ := + mem_sourceGeneratedVonNeumann _ (Or.inl rfl) + +def sourceWeightBase (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) : SourceBaseFunction where + toFun := fun x => (sourceCocycle θ sourceLogWeight 1 x : ℂ) + measurable := Complex.measurable_ofReal.comp (sourceCocycle_measurable θ sourceLogWeight 1) + bound := 1 + bound_nonneg := zero_le_one + norm_le := by + intro x hx + rw [Complex.norm_real, Real.norm_of_nonneg (sourceCocycle_pos _ _ _ _).le] + exact sourceWeight_le_one θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hx + +theorem sourceMultiplication_eq_pi (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) : + sourceMultiplication θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg = + sourcePi θ (sourceWeightBase θ hθ) := rfl + +/-- Actual membership of the already verified staged operator in its generated +von Neumann algebra, without an assumed operator-membership hypothesis. -/ +theorem staged_sourceOperator_mem (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) : + sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg ∈ sourceAlgebra θ := by + change sourceShift SourceCoordinate * sourceMultiplication θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg ∈ _ + rw [sourceMultiplication_eq_pi θ hθ] + exact mul_mem (sourceShift_mem θ) (sourcePi_mem θ (sourceWeightBase θ hθ)) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/HilbertSeparable.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/HilbertSeparable.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c5a42b9cc65a609be7d9dc93805296e00a038c0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/HilbertSeparable.lean @@ -0,0 +1,19 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.GeneratedAlgebra +import Mathlib.MeasureTheory.Measure.SeparableMeasure + +namespace OAI + +namespace FiniteFactor +noncomputable section + +/-- The actual regular-representation Hilbert space is separable. This uses +the countably generated Borel structure of the countable real product times +Z and the finite exponent 2. It does not assert a predual for the algebra. -/ +instance sourceHilbert_separable : TopologicalSpace.SeparableSpace (SourceHilbert SourceCoordinate) := by + let : Fact ((2 : ENNReal) ≠ ⊤) := ⟨by norm_num⟩ + infer_instance + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/IndicatorProjection.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/IndicatorProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..a96960d9dfff00de1709cd78e822e49a1d8d2c5b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/IndicatorProjection.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ScalarCenter +import OAI.Analysis.FiniteFactor.CrossedProduct.MultiplicationAdjoint +import OAI.Analysis.FiniteFactor.CrossedProduct.SmallPartitionSets + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +def sourceIndicatorProjection (θ : SourceCoordinate → ℝ) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) : + SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate := + sourcePi θ (sourceBaseIndicator A hA) + +theorem sourceIndicatorProjection_mem (θ : SourceCoordinate → ℝ) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) : + sourceIndicatorProjection θ A hA ∈ sourceAlgebra θ := sourcePi_mem θ _ + +theorem sourceIndicatorProjection_projection (θ : SourceCoordinate → ℝ) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) : + IsStarProjection (sourceIndicatorProjection θ A hA) := by + classical + let g := sourceBaseIndicator A hA + constructor + · apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [sourcePi_apply_ae θ g (sourcePi θ g f),sourcePi_apply_ae θ g f] with z hh hf + change (sourcePi θ g (sourcePi θ g f)) z = (sourcePi θ g f) z + rw [hh,hf] + by_cases hz : coordinateRotate θ z.2 z.1 ∈ A <;> simp [sourcePiSymbol,g,sourceBaseIndicator,hz] + · change star (sourcePi θ g) = sourcePi θ g + rw [sourcePi_star] + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [sourcePi_apply_ae θ (sourceBaseStar g) f,sourcePi_apply_ae θ g f] with z hs hf + rw [hs,hf] + by_cases hz : coordinateRotate θ z.2 z.1 ∈ A <;> simp [sourcePiSymbol,sourceBaseStar,g,sourceBaseIndicator,hz] + +/-- The projection's trace is the measure of its original base event. -/ +theorem sourceIndicatorProjection_trace (θ : SourceCoordinate → ℝ) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) : + sourceVacuumFunctional (sourceIndicatorProjection θ A hA) = + ((sourceBaseMeasure A).toReal : ℂ) := by + rw [sourceVacuumFunctional_matrixIntegral] + have he : sourceMatrixEntry (sourceIndicatorProjection θ A hA) 0 0 =ᵐ[sourceBaseMeasure] + A.indicator (fun _ => (1 : ℂ)) := by + filter_upwards [sourceMatrixEntry_pi θ (sourceBaseIndicator A hA) 0,sourceSamplingHaar_cube] with x hx hc + have hr : coordinateRotate θ 0 x = x := by + funext i + simpa [coordinateRotate] using Int.fract_eq_self.mpr (hc i) + simpa [sourceIndicatorProjection,sourceBaseIndicator,hr] using hx 0 + rw [integral_congr_ae he,integral_indicator hA] + simp [measureReal_def] + +/-- A genuine finite partition of the identity inside the original algebra. -/ +theorem sourceIndicatorProjection_partition_sum (θ : SourceCoordinate → ℝ) (n : ℕ) (hn : 0 < n) : + (∑ j : Fin n, sourceIndicatorProjection θ (sourceSmallPartitionSet n j) + (sourceSmallPartitionSet_measurable n j)) = 1 := by + apply ContinuousLinearMap.ext + intro f + change (∑ j : Fin n, sourceIndicatorProjection θ (sourceSmallPartitionSet n j) + (sourceSmallPartitionSet_measurable n j)) f = f + rw [sum_apply] + apply Lp.ext + have hall := ae_all_iff.mpr (fun j : Fin n => + sourcePi_apply_ae θ (sourceBaseIndicator (sourceSmallPartitionSet n j) + (sourceSmallPartitionSet_measurable n j)) f) + filter_upwards [sourceHilbert_sum_coe Finset.univ (fun j : Fin n => + sourceIndicatorProjection θ (sourceSmallPartitionSet n j) (sourceSmallPartitionSet_measurable n j) f),hall] + with z hs ha + rw [hs] + change (∑ j : Fin n, (sourcePi θ (sourceBaseIndicator (sourceSmallPartitionSet n j) + (sourceSmallPartitionSet_measurable n j)) f) z) = f z + simp_rw [ha] + change (∑ j : Fin n, (sourceSmallPartitionSet n j).indicator (fun _ => (1 : ℂ)) + (coordinateRotate θ z.2 z.1) * f z) = f z + rw [← Finset.sum_mul,sourceSmallPartition_indicator_sum n hn _ + ⟨Int.fract_nonneg _,Int.fract_lt_one _⟩,one_mul] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/InvariantConull.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/InvariantConull.lean new file mode 100644 index 0000000000000000000000000000000000000000..dbaf50c750bc0359c2fa5247195cb986af76dcc8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/InvariantConull.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.UncappedPairIdentity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +@[simp] theorem sourceTorusRotate_zero (θ : SourceCoordinate → ℝ) (z : SourceTorus) : + sourceTorusRotate θ 0 z = z := by + funext i + simp [sourceTorusRotate] + +theorem sourceTorusRotate_add (θ : SourceCoordinate → ℝ) (n m : ℤ) (z : SourceTorus) : + sourceTorusRotate θ n (sourceTorusRotate θ m z) = sourceTorusRotate θ (n+m) z := by + funext i + simp only [sourceTorusRotate, add_zsmul] + abel + +theorem sourceTorusRotate_preserving (θ : SourceCoordinate → ℝ) (n : ℤ) : + MeasurePreserving (sourceTorusRotate θ n) sourceTorusHaar sourceTorusHaar := by + have he : sourceTorusRotate θ n = + sourceTorusQuotient ∘ coordinateRotate θ n ∘ sourceTorusRepresentative := by + funext z + simp only [Function.comp_def,sourceTorusQuotient_rotate,sourceTorusQuotient_representative] + rw [he] + exact sourceTorusQuotient_preserving.comp + ((coordinateRotate_preserving θ n).comp sourceTorusRepresentative_preserving) + +theorem exists_source_invariant_conull (θ : SourceCoordinate → ℝ) + (P : SourceTorus → Prop) (hP : ∀ᵐ z ∂sourceTorusHaar, P z) : + ∃ Q : Set SourceTorus, MeasurableSet Q ∧ (∀ᵐ z ∂sourceTorusHaar, z ∈ Q) ∧ + (∀ z ∈ Q, P z) ∧ (∀ n : ℤ, ∀ z ∈ Q, sourceTorusRotate θ n z ∈ Q) := by + let B : Set SourceTorus := (toMeasurable sourceTorusHaar {z | ¬ P z})ᶜ + have hB : MeasurableSet B := (measurableSet_toMeasurable _ _).compl + have hBa : ∀ᵐ z ∂sourceTorusHaar, z ∈ B := by + rw [ae_iff] at hP ⊢ + simpa [B,measure_toMeasurable] using hP + let Q : Set SourceTorus := ⋂ n : ℤ, (sourceTorusRotate θ n) ⁻¹' B + refine ⟨Q,MeasurableSet.iInter (fun n => hB.preimage (sourceTorusRotate_continuous θ n).measurable),?_,?_,?_⟩ + · have hall := ae_all_iff.mpr (fun n : ℤ => (sourceTorusRotate_preserving θ n).quasiMeasurePreserving.ae hBa) + simpa only [Q,Set.mem_iInter,Set.mem_preimage] using hall + · intro z hz + have hb : z ∈ B := by simpa using Set.mem_iInter.mp hz 0 + by_contra hn + exact hb (subset_toMeasurable sourceTorusHaar _ hn) + · intro n z hz + apply Set.mem_iInter.mpr + intro m + change sourceTorusRotate θ m (sourceTorusRotate θ n z) ∈ B + rw [sourceTorusRotate_add] + exact Set.mem_iInter.mp hz (m+n) + +/-- A single invariant Borel conull set for the fixed original projection: +finite cocycles, actual projection fields, all covariance entries and all +ordered orbit identities hold at every point of the set. -/ +theorem sourceProjection_common_conull (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∃ Q : Set SourceTorus, MeasurableSet Q ∧ (∀ᵐ z ∂sourceTorusHaar, z ∈ Q) ∧ + (∀ z ∈ Q, + finiteFloorSupport θ (sourceTorusRepresentative z) ∧ + IsStarProjection (sourceTorusOperatorField p z) ∧ + (∀ r k m : ℤ, (sourceTorusOperatorField p (sourceTorusRotate θ r z) + (lp.single 2 m (1 : ℂ))) k = + (sourceTorusOperatorField p z (lp.single 2 (m+r) (1 : ℂ))) (k+r)) ∧ + (∀ n : ℕ, (∀ i, sourceTorusRepresentative z i ≤ + sourceTorusRepresentative (sourceTorusRotate θ n z) i) → + (z,sourceTorusRotate θ n z) ∈ sourceCappedPairZeroSet θ p)) ∧ + (∀ n : ℤ, ∀ z ∈ Q, sourceTorusRotate θ n z ∈ Q) := by + apply exists_source_invariant_conull + have hf := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (ae_finiteFloorSupport θ hθ.summable) + have hc := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (sourceOperatorField_covariance θ hp) + filter_upwards [hf,hc,sourceTorusOperatorField_projection θ hp hproj, + sourceProjection_ordered_orbits θ hθ hp hproj hinv] with z hf hc hp ho + refine ⟨hf,hp,?_,ho⟩ + intro r k m + change (sourceOperatorField p (sourceTorusRepresentative (sourceTorusRotate θ r z)) + (lp.single 2 m (1 : ℂ))) k = _ + rw [sourceTorusRepresentative_rotate] + exact hc r m k + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/InvariantProjection.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/InvariantProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..2e243396425d7a2282da629022ae0a5d182f5360 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/InvariantProjection.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.EventPositive +import OAI.Analysis.FiniteFactor.CrossedProduct.EventMassUpper + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- The source probability contradiction for the original operator and +original algebra. All event, convolution and error estimates are proved +from this p's actual projection and invariance identities. -/ +theorem sourceInvariantProjection_trivial + (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) (hr : SourceRationalIndependent θ) + (hs : SourceOrderedTorusSampling θ) (hphase : ∃ J, SourceSecondPhasesFrom θ J) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + p = 0 ∨ p = 1 := by + by_cases hp0 : p = 0 + · exact Or.inl hp0 + by_cases hp1 : p = 1 + · exact Or.inr hp1 + exfalso + have hlow := sourceProjectionEvent_eventually_positive θ hθ hr hp hproj hp0 hp1 hinv + obtain ⟨J,hJ⟩ := hphase + have hbound : ∀ᶠ j : ℕ in atTop, Real.exp (-82)/2 ≤ 1/((j : ℝ)+1) := by + filter_upwards [hlow,eventually_ge_atTop J] with j hj hJj + have hphasej : SourceSecondPhasesFrom θ j := fun s hjs => hJ s (hJj.trans hjs) + exact hj.trans (sourceProjectionEvent_mass_upper θ hθ hs hp hproj hinv j hphasej) + have hzero : Real.exp (-82)/2 ≤ 0 := + ge_of_tendsto (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) hbound + exact (not_le_of_gt (half_pos (Real.exp_pos (-82)))) hzero + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/LusinCompact.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/LusinCompact.lean new file mode 100644 index 0000000000000000000000000000000000000000..fad729a52aea62af5450a40ccf0b3ac4f2ee908d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/LusinCompact.lean @@ -0,0 +1,43 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusOperatorField +import OAI.Analysis.FiniteFactor.CrossedProduct.FiberSeparable +import OAI.Analysis.FiniteFactor.CompactGraphLusin + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- All cocycles and all vector columns of the actual operator field are +continuous on one compact subset of any prescribed Borel conull set. -/ +theorem exists_source_lusin_compact (θ : SourceCoordinate → ℝ) + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + {s : Set SourceTorus} (hs : MeasurableSet s) (hfull : ∀ᵐ z ∂sourceTorusHaar, z ∈ s) + {ε : ℝ≥0∞} (hε : ε ≠ 0) : + ∃ Q, Q ⊆ s ∧ IsCompact Q ∧ sourceTorusHaar Qᶜ < ε ∧ + (∀ k : ℤ, ContinuousOn + (fun z => sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z)) Q) ∧ + (∀ k : ℤ, ContinuousOn + (fun z => sourceTorusOperatorField H z (lp.single 2 k (1 : ℂ))) Q) := by + borelize (↥SourceFiberHilbert) + let f : SourceTorus → (ℤ → ℝ × SourceFiberHilbert) := fun z k => + (sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z), + sourceTorusOperatorField H z (lp.single 2 k (1 : ℂ))) + have hf : Measurable f := by + apply Measurable.of_eval + intro k + exact ((sourceCocycle_measurable θ sourceLogWeight k).comp + sourceTorusRepresentative_preserving.measurable).prodMk + (sourceTorusOperatorField_stronglyMeasurable H (lp.single 2 k (1 : ℂ))).measurable + obtain ⟨Q,hQs,hQ,hμQ,hfQ⟩ := exists_compact_lusin sourceTorusHaar hf hs hfull hε + refine ⟨Q,hQs,hQ,hμQ,?_,?_⟩ + · intro k + exact continuous_fst.comp_continuousOn ((continuous_apply k).comp_continuousOn hfQ) + · intro k + exact continuous_snd.comp_continuousOn ((continuous_apply k).comp_continuousOn hfQ) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MaskedError.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MaskedError.lean new file mode 100644 index 0000000000000000000000000000000000000000..bab54315e6f56d4eef6770b4528bc8cb729a1ba7 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MaskedError.lean @@ -0,0 +1,73 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.MaskedSquareMass +import OAI.Analysis.FiniteFactor.CountableMaskedError + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Both source expected-error estimates for the full infinite coefficient +sum. b=false,r=0,s=n gives the first orientation; b=true,r=n,s=0 gives the +second, after commuting the scalar product. -/ +theorem sourceOmitted_masked_error (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n r s : ℤ) (b : Bool) : + let error := fun ω => ∑' k : ℤ, (sourceOmittedBadEvent θ hθ j hphase n k b).indicator + (fun ω => ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (r+k)‖ * + ‖sourceColumn p (!b) (sourceBiasedEndpoint (fun _ => !b) ω) (s+k)‖) ω + Integrable error (sourceBiasedLaw j) ∧ + (∫ ω, error ω ∂sourceBiasedLaw j) ≤ Real.exp (-(sourceStage j).L/800) := by + let H := fun k => sourceOmittedBadEvent θ hθ j hphase n k b + let u := fun k ω => ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (r+k)‖ + let g := fun k ω => ‖sourceColumn p (!b) (sourceBiasedEndpoint (fun _ => !b) ω) (s+k)‖ + let f := fun k => (H k).indicator (u k) + have hu (k) : Measurable (u k) := + ((sourceColumn_coordinate_measurable p b (r+k)).comp (sourceBiasedEndpoint_measurable _)).norm + have hg (k) : Measurable (g k) := + ((sourceColumn_coordinate_measurable p (!b) (s+k)).comp (sourceBiasedEndpoint_measurable _)).norm + have hH (k) : MeasurableSet (H k) := sourceOmittedBadEvent_measurable θ hθ j hphase n k b + have hf (k) : Measurable (f k) := (hu k).indicator (hH k) + have hf0 (k ω) : 0 ≤ f k ω := by + by_cases h : ω ∈ H k <;> simp [f,h,u] + have hule (k ω) : (f k ω)^2 ≤ (u k ω)^2 := by + by_cases h : ω ∈ H k <;> simp [f,h,sq_nonneg] + have hhe (k ω) : (f k ω)^2 = (H k).indicator (fun ω => (u k ω)^2) ω := by + by_cases h : ω ∈ H k <;> simp [f,h] + have hus (ω) : Summable (fun k => (u k ω)^2) := (sourceColumn_square_hasSum p b _ r).summable + have hfs (ω) : Summable (fun k => (f k ω)^2) := + (hus ω).of_nonneg_of_le (fun k => sq_nonneg _) (fun k => hule k ω) + have hsumle (ω) : (∑' k, (f k ω)^2) ≤ ∑' k, (u k ω)^2 := + (hfs ω).tsum_le_tsum (fun k => hule k ω) (hus ω) + have hfi : Integrable (fun ω => ∑' k, (f k ω)^2) (sourceBiasedLaw j) := by + apply (sourceColumn_square_mass θ hp hproj j b r).1.mono' + (Measurable.tsum (fun k => (hf k).pow_const 2)).aestronglyMeasurable + exact Eventually.of_forall fun ω => by + rw [Real.norm_of_nonneg (tsum_nonneg (fun k => sq_nonneg _))] + exact hsumle ω + have hfm : (∫ ω, (∑' k, (f k ω)^2) ∂sourceBiasedLaw j) ≤ Real.exp (-(sourceStage j).L/400) := by + simp_rw [hhe] + exact sourceOmitted_masked_square θ hθ hp hproj j hphase n r b + have hg1 : ∀ᵐ ω ∂sourceBiasedLaw j, (∑' k, (g k ω)^2) ≤ 1 := by + filter_upwards [sourceBiasedEndpoint_ae j (fun _ => !b) (sourceProjection_columns_norm θ hp hproj)] with ω hω + have hn : ‖sourceColumn p (!b) (sourceBiasedEndpoint (fun _ => !b) ω)‖ ≤ 1 := by + cases b <;> simp only [Bool.not_false,Bool.not_true,sourceColumn,Bool.false_eq_true,↓reduceIte] <;> tauto + rw [(sourceColumn_square_hasSum p (!b) _ s).tsum_eq] + nlinarith [norm_nonneg (sourceColumn p (!b) (sourceBiasedEndpoint (fun _ => !b) ω))] + obtain ⟨hi,hb⟩ := countable_error_integral_le f g (Real.exp (-(sourceStage j).L/400)) + hf hg hf0 (fun k ω => norm_nonneg _) (Eventually.of_forall hfs) + (Eventually.of_forall fun ω => (sourceColumn_square_hasSum p (!b) _ s).summable) hfi hfm hg1 + have he (k ω) : f k ω*g k ω = (H k).indicator (fun ω => u k ω*g k ω) ω := by + by_cases h : ω ∈ H k <;> simp [f,h] + simp_rw [he] at hi hb + refine ⟨hi,hb.trans_eq ?_⟩ + rw [Real.sqrt_eq_rpow,← Real.exp_mul] + congr 1 + ring + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MaskedSquareMass.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MaskedSquareMass.lean new file mode 100644 index 0000000000000000000000000000000000000000..db94992d93f8cfa6265cd5fd3d4dda65ff1ca904 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MaskedSquareMass.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ColumnSquareMass +import OAI.Analysis.FiniteFactor.CrossedProduct.OmittedBadEvents + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The actual source columns and deterministic omitted-index masks satisfy +the infinite conditional square estimate in both orientations. -/ +theorem sourceOmitted_masked_square (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n r : ℤ) (b : Bool) : + (∫ ω, (∑' k : ℤ, (sourceOmittedBadEvent θ hθ j hphase n k b).indicator + (fun ω => ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (r+k)‖^2) ω) + ∂sourceBiasedLaw j) ≤ Real.exp (-(sourceStage j).L/400) := by + let f := fun k ω => ‖sourceColumn p b (sourceBiasedEndpoint (fun _ => b) ω) (r+k)‖^2 + have hfm (k : ℤ) : Measurable (f k) := + (((sourceColumn_coordinate_measurable p b (r+k)).comp (sourceBiasedEndpoint_measurable _)).norm.pow_const 2) + have h0 (k : ℤ) (ω) : 0 ≤ f k ω := sq_nonneg _ + have hs (ω) : Summable (fun k => f k ω) := (sourceColumn_square_hasSum p b _ r).summable + obtain ⟨hint,hbound⟩ := sourceColumn_square_mass θ hp hproj j b r + have hf (k : ℤ) : Integrable (f k) (sourceBiasedLaw j) := by + apply hint.mono' (hfm k).aestronglyMeasurable + exact Eventually.of_forall fun ω => by + rw [Real.norm_of_nonneg (h0 k ω)] + exact (hs ω).le_tsum k (fun i _ => h0 i ω) + have hcond (k : ℤ) := (sourceOmittedBadEvent_condExp θ hθ j hphase).mono + (fun ω h => h n k b) + let m := (inferInstance : MeasurableSpace (SourceCoordinate → ℝ)).comap + (sourceBiasedEndpoint (fun _ => b)) + have hstrong (k : ℤ) : StronglyMeasurable[m] (f k) := by + have hh : Measurable[m] (f k) := + ((sourceColumn_coordinate_measurable p b (r+k)).norm.pow_const 2).comp + (comap_measurable (sourceBiasedEndpoint (fun _ => b))) + exact hh.stronglyMeasurable + have hh := conditional_mask_tsum_integral_le + (sourceBiasedEndpoint_measurable (fun _ => b)).comap_le hf hstrong + h0 (fun k => sourceOmittedBadEvent_measurable θ hθ j hphase n k b) + (Eventually.of_forall hs) hint hcond + apply hh.trans + exact (mul_le_mul_of_nonneg_left hbound (Real.exp_pos _).le).trans_eq (mul_one _) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MultiplicationAdjoint.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MultiplicationAdjoint.lean new file mode 100644 index 0000000000000000000000000000000000000000..59594a5acbc88023541d4e79e7bf562b11cc129d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/MultiplicationAdjoint.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.GeneratedAlgebra +import Mathlib.Analysis.InnerProductSpace.Adjoint + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal ComplexConjugate +noncomputable section + +/-- Conjugate of a bounded source base function, with the same bound. -/ +def sourceBaseStar (g : SourceBaseFunction) : SourceBaseFunction where + toFun := fun x => star (g.toFun x) + measurable := Complex.continuous_conj.measurable.comp g.measurable + bound := g.bound + bound_nonneg := g.bound_nonneg + norm_le := by intro x hx; simpa using g.norm_le x hx + +/-- The multiplication representation has the actual Hilbert adjoint. -/ +theorem sourcePi_star (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) : + star (sourcePi θ g) = sourcePi θ (sourceBaseStar g) := by + rw [ContinuousLinearMap.star_eq_adjoint] + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro f h + change (∫ z, inner ℂ ((sourcePi θ (sourceBaseStar g) f) z) (h z) ∂sourceMeasure SourceCoordinate) = + ∫ z, inner ℂ (f z) ((sourcePi θ g h) z) ∂sourceMeasure SourceCoordinate + apply integral_congr_ae + filter_upwards [sourcePi_apply_ae θ (sourceBaseStar g) f, + sourcePi_apply_ae θ g h] with z hf hh + rw [hf, hh] + simp [sourcePiSymbol, sourceBaseStar, RCLike.inner_apply, mul_comm, mul_left_comm, mul_assoc] + +/-- Any two such multiplication operators commute, even for different angles. -/ +theorem sourcePi_commute (θ φ : SourceCoordinate → ℝ) (g h : SourceBaseFunction) : + sourcePi θ g * sourcePi φ h = sourcePi φ h * sourcePi θ g := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [sourcePi_apply_ae θ g (sourcePi φ h f), + sourcePi_apply_ae φ h f, sourcePi_apply_ae φ h (sourcePi θ g f), + sourcePi_apply_ae θ g f] with z hg hh hg' hh' + change (sourcePi θ g (sourcePi φ h f)) z = (sourcePi φ h (sourcePi θ g f)) z + rw [hg, hh, hg', hh'] + ring + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NoMinimalProjection.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NoMinimalProjection.lean new file mode 100644 index 0000000000000000000000000000000000000000..dad600cdeb4148da8418bf7174c9568ae4f1d74c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NoMinimalProjection.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.IndicatorProjection +import OAI.Analysis.FiniteFactor.Diffuse.SmallPartitions +import OAI.Analysis.FiniteFactor.CrossedProduct.Trace +import OAI.Analysis.FiniteFactor.CrossedProduct.VacuumSeparating + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- The original algebra has identity partitions of arbitrarily small trace, +using equal intervals of its first Haar coordinate. -/ +theorem sourceAlgebra_small_trace_partitions (θ : SourceCoordinate → ℝ) (ε : ℝ) (hε : 0 < ε) : + ∃ n : ℕ, ∃ e : Fin n → (sourceAlgebra θ).toStarSubalgebra, + (∀ j, IsStarProjection (e j : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate)) ∧ + (∑ j, e j) = 1 ∧ + ∀ j, (sourceVacuumFunctional (e j)).re < ε := by + obtain ⟨n,hn⟩ := exists_nat_gt (max (1 : ℝ) (1/ε)) + have hnR : (0 : ℝ) < n := lt_trans zero_lt_one ((le_max_left _ _).trans_lt hn) + have hnN : 0 < n := by exact_mod_cast hnR + have hsmall : 1/(n : ℝ) < ε := by + have hh : 1 < (n : ℝ)*ε := (div_lt_iff₀ hε).mp ((le_max_right _ _).trans_lt hn) + exact (div_lt_iff₀ hnR).mpr (by nlinarith) + let e : Fin n → (sourceAlgebra θ).toStarSubalgebra := fun j => + ⟨sourceIndicatorProjection θ (sourceSmallPartitionSet n j) (sourceSmallPartitionSet_measurable n j), + sourceIndicatorProjection_mem θ _ _⟩ + refine ⟨n,e,fun j => sourceIndicatorProjection_projection θ _ _,?_,?_⟩ + · apply Subtype.ext + simpa [e] using sourceIndicatorProjection_partition_sum θ n hnN + · intro j + change (sourceVacuumFunctional (sourceIndicatorProjection θ (sourceSmallPartitionSet n j) + (sourceSmallPartitionSet_measurable n j))).re < ε + rw [sourceIndicatorProjection_trace,Complex.ofReal_re] + exact (ENNReal.toReal_le_of_le_ofReal (by positivity : 0 ≤ 1/(n : ℝ)) + (sourceSmallPartitionSet_measure_le n hnN j)).trans_lt hsmall + +/-- Actual nonzero proper subprojections of every nonzero projection in the +original algebra. The support construction is internal to this same algebra. -/ +theorem sourceAlgebra_hasNoMinimalProjection (θ : SourceCoordinate → ℝ) : + HasNoMinimalProjection (sourceAlgebra θ) := by + intro p hp hproj hp0 + let p' : (sourceAlgebra θ).toStarSubalgebra := ⟨p,hp⟩ + obtain ⟨q,hqs,hqi,hq0,hqne,hqp⟩ := + Nonhyperlinear.Diffuseness.no_minimal_projection_of_small_partitions + (sourceAlgebra θ) sourceVacuum + (fun A B => sourceVacuumFunctional_tracial θ A.property B.property) + (fun A hz => Subtype.ext (sourceVacuum_separating θ A.property hz)) + (sourceAlgebra_small_trace_partitions θ) + p' (Subtype.ext hproj.isSelfAdjoint.star_eq) (Subtype.ext hproj.isIdempotentElem) + (fun hz => hp0 (congrArg Subtype.val hz)) + refine ⟨q,q.property,⟨congrArg Subtype.val hqi,congrArg Subtype.val hqs⟩,?_,?_,congrArg Subtype.val hqp⟩ + · exact fun hz => hq0 (Subtype.ext hz) + · exact fun hz => hqne (Subtype.ext hz) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NormalFunctionalSpace.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NormalFunctionalSpace.lean new file mode 100644 index 0000000000000000000000000000000000000000..7dd19603515dd353e9c79e1a2b7d482c9d74c370 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NormalFunctionalSpace.lean @@ -0,0 +1,124 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.HilbertSeparable +import Mathlib.Analysis.InnerProductSpace.Dual +import Mathlib.Topology.Algebra.Module.Basic + +namespace OAI + +namespace FiniteFactor +open TopologicalSpace +noncomputable section + +abbrev SourceAlgebraSpace (θ : SourceCoordinate → ℝ) := (sourceAlgebra θ).toStarSubalgebra + +def sourceAlgebraInclusion (θ : SourceCoordinate → ℝ) : + SourceAlgebraSpace θ →L[ℂ] (SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) := + (sourceAlgebra θ).toStarSubalgebra.toSubmodule.subtypeL + +/-- An actual vector functional restricted to the original source algebra. -/ +def sourceVectorFunctional (θ : SourceCoordinate → ℝ) + (ξ η : SourceHilbert SourceCoordinate) : StrongDual ℂ (SourceAlgebraSpace θ) := + (innerSL ℂ ξ).comp ((ContinuousLinearMap.apply ℂ (SourceHilbert SourceCoordinate) η).comp + (sourceAlgebraInclusion θ)) + +@[simp] theorem sourceVectorFunctional_apply (θ : SourceCoordinate → ℝ) + (ξ η : SourceHilbert SourceCoordinate) (A : SourceAlgebraSpace θ) : + sourceVectorFunctional θ ξ η A = inner ℂ ξ ((A : SourceHilbert SourceCoordinate →L[ℂ] + SourceHilbert SourceCoordinate) η) := rfl + +theorem sourceVectorFunctional_norm (θ : SourceCoordinate → ℝ) + (ξ η : SourceHilbert SourceCoordinate) : + ‖sourceVectorFunctional θ ξ η‖ ≤ ‖ξ‖*‖η‖ := by + apply ContinuousLinearMap.opNorm_le_bound _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) + intro A + change ‖inner ℂ ξ ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) η)‖ ≤ _ + calc + _ ≤ ‖ξ‖ * ‖(A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) η‖ := + norm_inner_le_norm _ _ + _ ≤ ‖ξ‖ * (‖A‖ * ‖η‖) := mul_le_mul_of_nonneg_left + ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate).le_opNorm η) (norm_nonneg _) + _ = (‖ξ‖*‖η‖)*‖A‖ := by ring + +theorem sourceVectorFunctional_continuous (θ : SourceCoordinate → ℝ) : + Continuous (fun z : SourceHilbert SourceCoordinate × SourceHilbert SourceCoordinate => + sourceVectorFunctional θ z.1 z.2) := by + unfold sourceVectorFunctional + fun_prop + +/-- The norm-closed span of actual vector functionals. This constructs a +Banach space; identifying its whole dual with the source algebra is a +separate surjectivity theorem, not part of this definition. -/ +abbrev sourceNormalFunctionalSpace (θ : SourceCoordinate → ℝ) : + Submodule ℂ (StrongDual ℂ (SourceAlgebraSpace θ)) := + (Submodule.span ℂ (Set.range (fun z : SourceHilbert SourceCoordinate × SourceHilbert SourceCoordinate => + sourceVectorFunctional θ z.1 z.2))).topologicalClosure + +instance sourceNormalFunctionalSpace_complete (θ : SourceCoordinate → ℝ) : + CompleteSpace (sourceNormalFunctionalSpace θ) := by + unfold sourceNormalFunctionalSpace + infer_instance + +instance sourceNormalFunctionalSpace_separable (θ : SourceCoordinate → ℝ) : + SeparableSpace (sourceNormalFunctionalSpace θ) := by + let : NormedAddCommGroup (StrongDual ℂ (SourceAlgebraSpace θ)) := inferInstance + apply TopologicalSpace.IsSeparable.separableSpace + change IsSeparable (closure (Submodule.span ℂ (Set.range + (fun z : SourceHilbert SourceCoordinate × SourceHilbert SourceCoordinate => + sourceVectorFunctional θ z.1 z.2)) : Set (StrongDual ℂ (SourceAlgebraSpace θ)))) + exact (isSeparable_range (sourceVectorFunctional_continuous θ)).span.closure + +theorem sourceVectorFunctional_mem (θ : SourceCoordinate → ℝ) + (ξ η : SourceHilbert SourceCoordinate) : sourceVectorFunctional θ ξ η ∈ sourceNormalFunctionalSpace θ := + Submodule.le_topologicalClosure _ (Submodule.subset_span ⟨(ξ,η),rfl⟩) + +/-- A named carrier keeps the inherited Banach-space structures coherent in +iterated continuous duals. Its underlying set is exactly the closed span. -/ +def SourceNormalPredualSpace (θ : SourceCoordinate → ℝ) : Type := + sourceNormalFunctionalSpace θ + +instance sourceNormalPredualSpace_normedGroup (θ : SourceCoordinate → ℝ) : + NormedAddCommGroup (SourceNormalPredualSpace θ) := by + unfold SourceNormalPredualSpace + exact Submodule.normedAddCommGroup (E := StrongDual ℂ (SourceAlgebraSpace θ)) + (sourceNormalFunctionalSpace θ) + +instance sourceNormalPredualSpace_normedSpace (θ : SourceCoordinate → ℝ) : + NormedSpace ℂ (SourceNormalPredualSpace θ) := by + unfold SourceNormalPredualSpace + exact Submodule.normedSpace (𝕜 := ℂ) (E := StrongDual ℂ (SourceAlgebraSpace θ)) + (sourceNormalFunctionalSpace θ) + +instance sourceNormalPredualSpace_complete (θ : SourceCoordinate → ℝ) : + CompleteSpace (SourceNormalPredualSpace θ) := + inferInstanceAs (CompleteSpace (sourceNormalFunctionalSpace θ)) + +instance sourceNormalPredualSpace_separable (θ : SourceCoordinate → ℝ) : + SeparableSpace (SourceNormalPredualSpace θ) := + inferInstanceAs (SeparableSpace (sourceNormalFunctionalSpace θ)) + +/-- Evaluation by each actual algebra element on the constructed space. -/ +def sourceNormalEvaluation (θ : SourceCoordinate → ℝ) (A : SourceAlgebraSpace θ) : + StrongDual ℂ (SourceNormalPredualSpace θ) := by + exact (ContinuousLinearMap.apply ℂ ℂ A).comp + (sourceNormalFunctionalSpace θ).subtypeL + +@[simp] theorem sourceNormalEvaluation_vector (θ : SourceCoordinate → ℝ) (A : SourceAlgebraSpace θ) + (ξ η : SourceHilbert SourceCoordinate) : + sourceNormalEvaluation θ A ⟨sourceVectorFunctional θ ξ η,sourceVectorFunctional_mem θ ξ η⟩ = + inner ℂ ξ ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) η) := rfl + +/-- The constructed functionals separate the original algebra elements. -/ +theorem sourceNormalEvaluation_injective (θ : SourceCoordinate → ℝ) : + Function.Injective (sourceNormalEvaluation θ) := by + intro A B h + apply Subtype.ext + apply ContinuousLinearMap.ext + intro η + apply ext_inner_left ℂ + intro ξ + exact congrArg (fun F : StrongDual ℂ (SourceNormalPredualSpace θ) => + F ⟨sourceVectorFunctional θ ξ η,sourceVectorFunctional_mem θ ξ η⟩) h + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NormalRiesz.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NormalRiesz.lean new file mode 100644 index 0000000000000000000000000000000000000000..095d1927fbde6c7d631bf3f4734d0888ea37ea3e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/NormalRiesz.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.VectorFunctionalRelations + +namespace OAI + +namespace FiniteFactor +noncomputable section + +def sourceNormalRieszLinear (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (η : SourceHilbert SourceCoordinate) : + SourceHilbert SourceCoordinate →ₗ[ℂ] ℂ where + toFun ξ := star (F (sourceVectorInSpace θ ξ η)) + map_add' ξ ξ' := by + exact (congrArg (fun v : SourceNormalPredualSpace θ => star (F v)) + (sourceVectorInSpace_add_left θ ξ ξ' η)).trans + ((congrArg star (F.map_add _ _)).trans (star_add _ _)) + map_smul' c ξ := by + calc + _ = star (F (star c • sourceVectorInSpace θ ξ η)) := + congrArg (fun v : SourceNormalPredualSpace θ => star (F v)) + (sourceVectorInSpace_smul_left θ c ξ η) + _ = star (star c * F (sourceVectorInSpace θ ξ η)) := congrArg star (F.map_smul (star c) _) + _ = c * star (F (sourceVectorInSpace θ ξ η)) := by simp [star_mul,mul_comm] + +theorem sourceNormalRieszLinear_bound (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (η ξ : SourceHilbert SourceCoordinate) : + ‖sourceNormalRieszLinear θ F η ξ‖ ≤ (‖F‖*‖η‖)*‖ξ‖ := by + change ‖star (F (sourceVectorInSpace θ ξ η))‖ ≤ _ + rw [norm_star] + calc + _ ≤ ‖F‖*‖sourceVectorInSpace θ ξ η‖ := F.le_opNorm _ + _ ≤ ‖F‖*(‖ξ‖*‖η‖) := mul_le_mul_of_nonneg_left (sourceVectorFunctional_norm θ ξ η) (norm_nonneg _) + _ = (‖F‖*‖η‖)*‖ξ‖ := by ring + +def sourceNormalRieszFunctional (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (η : SourceHilbert SourceCoordinate) : + StrongDual ℂ (SourceHilbert SourceCoordinate) := + (sourceNormalRieszLinear θ F η).mkContinuous (‖F‖*‖η‖) (sourceNormalRieszLinear_bound θ F η) + +def sourceNormalRieszVector (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (η : SourceHilbert SourceCoordinate) : + SourceHilbert SourceCoordinate := + (InnerProductSpace.toDual ℂ (SourceHilbert SourceCoordinate)).symm (sourceNormalRieszFunctional θ F η) + +theorem sourceNormalRieszVector_inner (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (ξ η : SourceHilbert SourceCoordinate) : + inner ℂ ξ (sourceNormalRieszVector θ F η) = F (sourceVectorInSpace θ ξ η) := by + have he := congrArg (fun f : StrongDual ℂ (SourceHilbert SourceCoordinate) => f ξ) + ((InnerProductSpace.toDual ℂ (SourceHilbert SourceCoordinate)).apply_symm_apply + (sourceNormalRieszFunctional θ F η)) + change inner ℂ (sourceNormalRieszVector θ F η) ξ = star (F (sourceVectorInSpace θ ξ η)) at he + have hs := congrArg star he + calc + _ = star (inner ℂ (sourceNormalRieszVector θ F η) ξ) := (inner_conj_symm ξ _).symm + _ = _ := by simpa only [star_star] using hs + +theorem sourceNormalRieszVector_norm (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (η : SourceHilbert SourceCoordinate) : + ‖sourceNormalRieszVector θ F η‖ ≤ ‖F‖*‖η‖ := by + rw [sourceNormalRieszVector,LinearIsometryEquiv.norm_map] + exact LinearMap.mkContinuous_norm_le _ (mul_nonneg (norm_nonneg _) (norm_nonneg _)) _ + +/-- Every functional on the constructed Banach space gives an actual bounded +operator by Riesz representation. Membership in the source algebra is proved +separately by commutation, not assumed here. -/ +def sourceNormalRieszOperator (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) : + SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate := + LinearMap.mkContinuous + { toFun := sourceNormalRieszVector θ F + map_add' := fun η η' => by + apply ext_inner_left ℂ + intro ξ + rw [inner_add_right,sourceNormalRieszVector_inner,sourceNormalRieszVector_inner, + sourceNormalRieszVector_inner,sourceVectorInSpace_add_right,map_add] + map_smul' := fun c η => by + apply ext_inner_left ℂ + intro ξ + rw [inner_smul_right,sourceNormalRieszVector_inner,sourceNormalRieszVector_inner, + sourceVectorInSpace_smul_right,map_smul] + rfl } + ‖F‖ (sourceNormalRieszVector_norm θ F) + +theorem sourceNormalRieszOperator_inner (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) (ξ η : SourceHilbert SourceCoordinate) : + inner ℂ ξ (sourceNormalRieszOperator θ F η) = F (sourceVectorInSpace θ ξ η) := + sourceNormalRieszVector_inner θ F ξ η + +theorem sourceNormalRieszOperator_norm (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) : ‖sourceNormalRieszOperator θ F‖ ≤ ‖F‖ := + LinearMap.mkContinuous_norm_le _ (norm_nonneg _) _ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OmittedBadEvents.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OmittedBadEvents.lean new file mode 100644 index 0000000000000000000000000000000000000000..a562c333c79579522dd82114ace681ceaf32c094 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OmittedBadEvents.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.AssignedBadEvents +import OAI.Analysis.FiniteFactor.Convolution + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The source omitted-index masks. Near tagged indices and retained terms +have empty masks. Far assignments depend on n,v and fixed angles only. -/ +def sourceOmittedBadEvent (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n v : ℤ) (b : Bool) : + Set SourceBiasedSample := + if h : (((sourceStageState j).K : ℤ) < |v| ∨ ((sourceStageState j).K : ℤ) < |n+v|) ∧ + sourcePhaseLower j < |(omittedIndex (sourceStageState j).K n v : ℝ)| then + (sourceChosenAssignment θ hθ j hphase (omittedIndex (sourceStageState j).K n v) h.2.le).badEvent b + else ∅ + +theorem sourceOmittedBadEvent_measurable (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n v : ℤ) (b : Bool) : + MeasurableSet (sourceOmittedBadEvent θ hθ j hphase n v b) := by + unfold sourceOmittedBadEvent + split_ifs + · exact SourcePhaseAssignment.badEvent_measurable _ _ + · exact MeasurableSet.empty + +/-- All actual omitted masks obey the same conditional bound, in each +orientation and simultaneously over every integer shift and coefficient. -/ +theorem sourceOmittedBadEvent_condExp (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) : + ∀ᵐ ω ∂sourceBiasedLaw j, ∀ (n v : ℤ) (b : Bool), + (sourceBiasedLaw j)[(sourceOmittedBadEvent θ hθ j hphase n v b).indicator (fun _ => (1 : ℝ)) | + (inferInstance : MeasurableSpace (SourceCoordinate → ℝ)).comap + (sourceBiasedEndpoint (fun _ => b))] ω ≤ Real.exp (-(sourceStage j).L/400) := by + simp only [ae_all_iff] + intro n v b + unfold sourceOmittedBadEvent + split_ifs + · exact SourcePhaseAssignment.badEvent_condExp _ b + · filter_upwards [] with ω + simp only [Set.indicator_empty] + change (sourceBiasedLaw j)[(0 : SourceBiasedSample → ℝ) | _] ω ≤ _ + rw [condExp_zero] + exact (Real.exp_pos _).le + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OmittedRatio.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OmittedRatio.lean new file mode 100644 index 0000000000000000000000000000000000000000..2aa1f6e97a277e5dbee2c88e9cfab58ce11cc0cc --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OmittedRatio.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.OmittedBadEvents +import OAI.Analysis.FiniteFactor.CrossedProduct.TagGeometry +import OAI.Analysis.FiniteFactor.CrossedProduct.ConvolutionCocycle + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The source two-ratio inequality and deterministic omitted-index choice +turn tagged and phase attenuation into the pointwise error majorant. -/ +theorem sourceOmitted_ratio_bound (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n v : ℤ) (hn : 0 ≤ n) + (hv : ((sourceStageState j).K : ℤ) < |v| ∨ ((sourceStageState j).K : ℤ) < |n+v|) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceTagEndpointEvent j → + sourceCocycle θ sourceLogWeight (n+v) (sourceBiasedEndpoint (fun _ => true) ω) / + sourceCocycle θ sourceLogWeight v (sourceBiasedEndpoint (fun _ => false) ω) ≤ + Real.exp (-(sourceStage j).L) + + (sourceOmittedBadEvent θ hθ j hphase n v false).indicator (fun _ => (1 : ℝ)) ω + + (sourceOmittedBadEvent θ hθ j hphase n v true).indicator (fun _ => (1 : ℝ)) ω := by + let k := omittedIndex (sourceStageState j).K n v + have hk := omittedIndex_spec (sourceStageState j).K n v hv + have hlarge : ∀ᵐ ω ∂sourceBiasedLaw j, + sourcePhaseLower j < |(k : ℝ)| → + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => true) ω) / + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => false) ω) ≤ + Real.exp (-(sourceStage j).L) ∨ + ω ∈ sourceOmittedBadEvent θ hθ j hphase n v false ∨ + ω ∈ sourceOmittedBadEvent θ hθ j hphase n v true := by + by_cases hh : sourcePhaseLower j < |(k : ℝ)| + · have ha := (sourceChosenAssignment θ hθ j hphase k hh.le).attenuation_or_bad hθ + filter_upwards [ha] with ω hω _ + have htest : (((sourceStageState j).K : ℤ) < |v| ∨ ((sourceStageState j).K : ℤ) < |n+v|) ∧ + sourcePhaseLower j < |(omittedIndex (sourceStageState j).K n v : ℝ)| := ⟨hv,hh⟩ + simpa only [sourceOmittedBadEvent,dite_eq_left htest] using hω + · exact Eventually.of_forall fun ω h => (hh h).elim + filter_upwards [hlarge,sourceTagEndpoint_attenuation θ hθ j, + sourceBiasedEndpoint_ae j (fun _ => false) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => true) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedLaw_ordered j] with ω hfar htag hfx hfy hxy + intro he + let x := sourceBiasedEndpoint (fun _ => false) ω + let y := sourceBiasedEndpoint (fun _ => true) ω + have hb := cocycle_two_ratio_bounds + (fun k => sourceCocycle_pos θ sourceLogWeight k x) + (fun k => sourceCocycle_pos θ sourceLogWeight k y) + (sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfx) + (sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfy) + (sourceCocycle_ordered θ sourceLogWeight sourceLogWeight_nonneg hfx hfy hxy) + (v := v) hn + have hratio : sourceCocycle θ sourceLogWeight (n+v) y / sourceCocycle θ sourceLogWeight v x ≤ + sourceCocycle θ sourceLogWeight k y / sourceCocycle θ sourceLogWeight k x := by + rcases hk.2 with h | h + · rw [show k = v from h] + exact hb.2.1.trans (min_le_left _ _) + · rw [show k = n+v from h] + exact hb.2.1.trans (min_le_right _ _) + have h1 := hb.2.1.trans hb.2.2 + have hbad0 (b : Bool) : 0 ≤ (sourceOmittedBadEvent θ hθ j hphase n v b).indicator (fun _ => (1 : ℝ)) ω := by + by_cases h : ω ∈ sourceOmittedBadEvent θ hθ j hphase n v b <;> simp [h] + have hpos := (Real.exp_pos (-(sourceStage j).L)).le + by_cases hh : sourcePhaseLower j < |(k : ℝ)| + · rcases hfar hh with h | h | h + · have hle := hratio.trans h + linarith [hbad0 false,hbad0 true] + · rw [Set.indicator_of_mem h] + linarith [hbad0 true] + · rw [Set.indicator_of_mem h] + linarith [hbad0 false] + · have hklo : ((sourceStageState j).K : ℝ) ≤ |(k : ℝ)| := by + have hki : ((sourceStageState j).K : ℤ) < |k| := hk.1 + exact_mod_cast hki.le + have hh' := htag he k hklo (le_of_not_gt hh) + have hle := hratio.trans hh' + linarith [hbad0 false,hbad0 true] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Operator.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Operator.lean new file mode 100644 index 0000000000000000000000000000000000000000..e65dbf720f4612b506cb87273d5e7513ade5ee56 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Operator.lean @@ -0,0 +1,143 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Cocycle +import Mathlib.MeasureTheory.Function.Holder +import Mathlib.MeasureTheory.Function.L2Space + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The regular representation written as L2(X × Z), canonically equivalent +to the source's L2(X; l2(Z)). -/ +abbrev sourceMeasure (ι : Type*) : Measure ((ι → ℝ) × ℤ) := + (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)).prod Measure.count + +abbrev SourceHilbert (ι : Type*) : Type _ := Lp ℂ 2 (sourceMeasure ι) + +/-- The actual diagonal entry f(sigma^k x) of pi(f). -/ +def sourceDiagonal {ι : Type*} (θ c : ι → ℝ) (z : (ι → ℝ) × ℤ) : ℂ := + sourceCocycle θ c 1 (coordinateRotate θ z.2 z.1) + +theorem sourceDiagonal_measurable {ι : Type*} [Countable ι] (θ c : ι → ℝ) : + Measurable (sourceDiagonal θ c) := by + apply Complex.measurable_ofReal.comp + apply (sourceCocycle_measurable θ c 1).comp + apply Measurable.of_eval + intro i + unfold coordinateRotate + fun_prop + +theorem sourceDiagonal_norm_le {ι : Type*} (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (z : (ι → ℝ) × ℤ) : + ‖sourceDiagonal θ c z‖ ≤ 1 := by + rw [sourceDiagonal, Complex.norm_real, Real.norm_of_nonneg (sourceCocycle_pos _ _ _ _).le] + apply sourceWeight_le_one θ c hθ hc + intro i + exact ⟨Int.fract_nonneg _, Int.fract_lt_one _⟩ + +theorem sourceDiagonal_ne_zero {ι : Type*} (θ c : ι → ℝ) (z : (ι → ℝ) × ℤ) : + sourceDiagonal θ c z ≠ 0 := by + unfold sourceDiagonal + exact_mod_cast (sourceCocycle_pos θ c 1 (coordinateRotate θ z.2 z.1)).ne' + +theorem sourceDiagonal_memLp {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : + MemLp (sourceDiagonal θ c) ∞ (sourceMeasure ι) := + memLp_top_of_bound (sourceDiagonal_measurable θ c).aestronglyMeasurable 1 + (Eventually.of_forall (sourceDiagonal_norm_le θ c hθ hc)) + +/-- A bounded multiplication operator from the actual source formula. -/ +def sourceMultiplication {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : SourceHilbert ι →L[ℂ] SourceHilbert ι := + (ContinuousLinearMap.mul ℂ ℂ).holderL (sourceMeasure ι) ∞ 2 2 + ((sourceDiagonal_memLp θ c hθ hc).toLp (sourceDiagonal θ c)) + +theorem sourceMultiplication_apply_ae {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (f : SourceHilbert ι) : + sourceMultiplication θ c hθ hc f =ᵐ[sourceMeasure ι] fun z => sourceDiagonal θ c z * f z := by + have hh := (ContinuousLinearMap.mul ℂ ℂ).coeFn_holder + ((sourceDiagonal_memLp θ c hθ hc).toLp (sourceDiagonal θ c)) f (r := 2) + filter_upwards [hh, (sourceDiagonal_memLp θ c hθ hc).coeFn_toLp] with z hz hw + simpa [sourceMultiplication, hw] using hz + +theorem sourceMultiplication_injective {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : + Function.Injective (sourceMultiplication θ c hθ hc) := by + intro f g hfg + apply Lp.ext + filter_upwards [sourceMultiplication_apply_ae θ c hθ hc f, + sourceMultiplication_apply_ae θ c hθ hc g] with z hf hg + rw [hfg, hg] at hf + exact mul_left_cancel₀ (sourceDiagonal_ne_zero θ c z) hf.symm + +/-- The shift S e_k=e_(k+1), so its action on coordinate functions uses k-1. -/ +def sourceShiftIndex {ι : Type*} (z : (ι → ℝ) × ℤ) : (ι → ℝ) × ℤ := (z.1, z.2-1) + +theorem sourceShiftIndex_preserving (ι : Type*) : + MeasurePreserving (sourceShiftIndex (ι := ι)) (sourceMeasure ι) (sourceMeasure ι) := by + have hm : Measurable (fun k : ℤ => k-1) := measurable_of_countable _ + have hi : Function.Injective (fun k : ℤ => k-1) := by intro a b h; dsimp at h; omega + have hs : Function.Surjective (fun k : ℤ => k-1) := by intro k; exact ⟨k+1, by dsimp; omega⟩ + have hp : MeasurePreserving (fun k : ℤ => k-1) Measure.count Measure.count := by + refine ⟨hm, ?_⟩ + ext S hS + rw [Measure.map_apply hm hS, Measure.count_apply (hS.preimage hm), Measure.count_apply hS, + ← hi.encard_image, Set.image_preimage_eq S hs] + exact (MeasurePreserving.id _).prod hp + +def sourceShift (ι : Type*) : SourceHilbert ι →L[ℂ] SourceHilbert ι := + (Lp.compMeasurePreservingₗᵢ ℂ sourceShiftIndex (sourceShiftIndex_preserving ι)).toContinuousLinearMap + +/-- T=U pi(f), constructed as a bounded operator, with no assumed factor or +invariant-subspace properties. -/ +def sourceOperator {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : SourceHilbert ι →L[ℂ] SourceHilbert ι := + (sourceShift ι).comp (sourceMultiplication θ c hθ hc) + +theorem sourceOperator_injective {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : + Function.Injective (sourceOperator θ c hθ hc) := by + intro f g h + apply sourceMultiplication_injective θ c hθ hc + exact (Lp.compMeasurePreservingₗᵢ ℂ sourceShiftIndex + (sourceShiftIndex_preserving ι)).injective h + +theorem sourceMultiplication_norm_le {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (f : SourceHilbert ι) : + ‖sourceMultiplication θ c hθ hc f‖ ≤ ‖f‖ := by + apply Lp.norm_le_norm_of_ae_le + filter_upwards [sourceMultiplication_apply_ae θ c hθ hc f] with z hz + rw [hz, norm_mul] + exact mul_le_of_le_one_left (norm_nonneg _) (sourceDiagonal_norm_le θ c hθ hc z) + +theorem sourceOperator_norm_le_one {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : ‖sourceOperator θ c hθ hc‖ ≤ 1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro f + change ‖Lp.compMeasurePreserving sourceShiftIndex (sourceShiftIndex_preserving ι) + (sourceMultiplication θ c hθ hc f)‖ ≤ 1 * ‖f‖ + rw [Lp.norm_compMeasurePreserving, one_mul] + exact sourceMultiplication_norm_le θ c hθ hc f + +/-- This constructs a nonzero bounded T, independently of any candidate projection. -/ +theorem sourceOperator_ne_zero {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) : sourceOperator θ c hθ hc ≠ 0 := by + let A : Set ((ι → ℝ) × ℤ) := Set.univ ×ˢ {0} + have hA : MeasurableSet A := MeasurableSet.univ.prod (measurableSet_singleton 0) + have hmass : sourceMeasure ι A = 1 := by simp [A, sourceMeasure, Measure.prod_prod] + let e : SourceHilbert ι := indicatorConstLp 2 hA (by rw [hmass]; exact ENNReal.one_ne_top) 1 + have hen : ‖e‖ = 1 := by + rw [norm_indicatorConstLp (by norm_num) (by norm_num)] + simp [measureReal_def, hmass] + have he : e ≠ 0 := by intro he; rw [he, norm_zero] at hen; norm_num at hen + intro hT + apply he + apply sourceOperator_injective θ c hθ hc + simp [hT] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OperatorField.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OperatorField.lean new file mode 100644 index 0000000000000000000000000000000000000000..bbaabac75c6f3960d1c9b2d00e85da1a16cc9c15 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OperatorField.lean @@ -0,0 +1,89 @@ +import OAI.Analysis.FiniteFactor.Matrix.Bounds +import OAI.Analysis.FiniteFactor.Matrix.Integrals +import OAI.Analysis.FiniteFactor.BoundedMatrixOperator + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +def sourceMatrixGood (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (x : SourceCoordinate → ℝ) : Prop := + ∀ (s t : Finset ℤ) (a : ℤ → ℂ), + (∑ k ∈ t, ‖∑ n ∈ s, a n * sourceMatrixEntry H k n x‖ ^ 2) ≤ + ‖H‖ ^ 2 * ∑ n ∈ s, ‖a n‖ ^ 2 + +/-- A Borel good set, removing just one null set for algebra elements. -/ +def sourceFieldGoodSet + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + Set (SourceCoordinate → ℝ) := + (toMeasurable sourceBaseMeasure {x | ¬ sourceMatrixGood H x})ᶜ + +theorem sourceFieldGoodSet_measurable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + MeasurableSet (sourceFieldGoodSet H) := (measurableSet_toMeasurable _ _).compl + +theorem sourceFieldGoodSet_good + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + {x : SourceCoordinate → ℝ} (hx : x ∈ sourceFieldGoodSet H) : sourceMatrixGood H x := by + by_contra hn + exact hx (subset_toMeasurable sourceBaseMeasure _ hn) + +theorem sourceFieldGoodSet_ae (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : ∀ᵐ x ∂sourceBaseMeasure, x ∈ sourceFieldGoodSet H := by + have hb : ∀ᵐ x ∂sourceBaseMeasure, sourceMatrixGood H x := sourceMatrix_finite_bound_all θ hH + rw [ae_iff] at hb ⊢ + simpa [sourceFieldGoodSet, measure_toMeasurable] using hb + +/-- The actual bounded operator field, extended by zero on a Borel null set. -/ +def sourceOperatorField + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (x : SourceCoordinate → ℝ) : SourceFiberHilbert →L[ℂ] SourceFiberHilbert := by + classical + exact if hx : x ∈ sourceFieldGoodSet H then + boundedMatrixOperator (fun k n => sourceMatrixEntry H k n x) ‖H‖ + (sourceFieldGoodSet_good H hx) + else 0 + +theorem sourceOperatorField_norm + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (x) : + ‖sourceOperatorField H x‖ ≤ ‖H‖ := by + classical + unfold sourceOperatorField + split_ifs + · exact boundedMatrixOperator_norm _ _ _ (norm_nonneg H) + · simp + +theorem sourceOperatorField_entry + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (k n : ℤ) (x) : + (sourceOperatorField H x (lp.single 2 n (1 : ℂ))) k = + (sourceFieldGoodSet H).indicator (sourceMatrixEntry H k n) x := by + classical + unfold sourceOperatorField + split_ifs with hx + · rw [Set.indicator_of_mem hx] + exact boundedMatrixOperator_entry _ _ _ (norm_nonneg H) k n + · simp [hx] + +theorem sourceOperatorField_entry_measurable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (k n : ℤ) : + Measurable (fun x => (sourceOperatorField H x (lp.single 2 n (1 : ℂ))) k) := by + simp_rw [sourceOperatorField_entry] + exact (sourceMatrixEntry_measurable H k n).indicator (sourceFieldGoodSet_measurable H) + +/-- Field entries recover the original coefficients on one conull set. -/ +theorem sourceOperatorField_entries_ae (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k n : ℤ, + (sourceOperatorField H x (lp.single 2 n (1 : ℂ))) k = sourceMatrixEntry H k n x := by + filter_upwards [sourceFieldGoodSet_ae θ hH] with x hx k n + rw [sourceOperatorField_entry, Set.indicator_of_mem hx] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrbitNormalization.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrbitNormalization.lean new file mode 100644 index 0000000000000000000000000000000000000000..b59c92409fdd386cc84c90e265a53cefcecee27b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrbitNormalization.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.FiniteFactor.Fiber.Shift +import OAI.Analysis.FiniteFactor.CrossedProduct.CappedPair +import OAI.Analysis.FiniteFactor.OrbitSampling.TorusSupport + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +theorem sourceCocycle_orbit_ratio (θ c : SourceCoordinate → ℝ) + {x : SourceCoordinate → ℝ} (hx : finiteFloorSupport θ x) (n k : ℤ) : + sourceCocycle θ c k (coordinateRotate θ n x) / sourceCocycle θ c k x = + sourceCocycle θ c n (coordinateRotate θ k x) / sourceCocycle θ c n x := by + apply (div_eq_div_iff (ne_of_gt (sourceCocycle_pos ..)) (ne_of_gt (sourceCocycle_pos ..))).mpr + rw [← sourceCocycle_add θ c hx n k, ← sourceCocycle_add θ c hx k n, add_comm n k] + +theorem sourceTorusRepresentative_rotate (θ : SourceCoordinate → ℝ) (n : ℤ) (z : SourceTorus) : + sourceTorusRepresentative (sourceTorusRotate θ n z) = + coordinateRotate θ n (sourceTorusRepresentative z) := by + have hc : ∀ i, coordinateRotate θ n (sourceTorusRepresentative z) i ∈ Set.Ico (0 : ℝ) 1 := + fun i => ⟨Int.fract_nonneg _,Int.fract_lt_one _⟩ + calc + _ = sourceTorusRepresentative (sourceTorusQuotient + (coordinateRotate θ n (sourceTorusRepresentative z))) := by + rw [sourceTorusQuotient_rotate, sourceTorusQuotient_representative] + _ = _ := sourceTorusRepresentative_quotient _ hc + +/-- Covariance and invariance give the rotated range inclusion after removing +the shift. This is an identity of bounded operators, not a range assumption. -/ +theorem fiber_rotated_invariant + (A B W : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (n : ℤ) + (hc : fiberShift (-n) * A = B * fiberShift (-n)) + (hi : (1-A)*W*A = 0) : + (1-B)*(fiberShift (-n)*W)*A = 0 := by + have he : (1-B)*fiberShift (-n) = fiberShift (-n)*(1-A) := by + rw [sub_mul, one_mul, mul_sub, mul_one, hc] + calc + _ = ((1-B)*fiberShift (-n))*W*A := by simp only [mul_assoc] + _ = (fiberShift (-n)*(1-A))*W*A := by rw [he] + _ = fiberShift (-n)*((1-A)*W*A) := by simp only [mul_assoc] + _ = 0 := by rw [hi, mul_zero] + +/-- On ordered actual orbit pairs, the capped diagonal is exactly the +normalized weighted shift power. -/ +theorem sourceCappedRatio_orbit_diagonal + (θ : SourceCoordinate → ℝ) (z : SourceTorus) (n : ℕ) + (hx : finiteFloorSupport θ (sourceTorusRepresentative z)) + (hord : ∀ i, sourceTorusRepresentative z i ≤ + sourceTorusRepresentative (sourceTorusRotate θ n z) i) + (W : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hW : ∀ (v : SourceFiberHilbert) (k : ℤ), W v k = + (sourceCocycle θ sourceLogWeight n + (coordinateRotate θ (k-(n : ℤ)) (sourceTorusRepresentative z)) : ℂ) * v (k-(n : ℤ))) : + fiberDiagonal (sourceCappedRatio θ (z,sourceTorusRotate θ n z)) + (sourceCappedRatio_norm θ (z,sourceTorusRotate θ n z)) = + (sourceCocycle θ sourceLogWeight n (sourceTorusRepresentative z) : ℂ)⁻¹ • + (fiberShift (-(n : ℤ))*W) := by + apply ContinuousLinearMap.ext + intro v + apply Subtype.ext + funext k + change sourceCappedRatio θ (z,sourceTorusRotate θ n z) k * v k = + (sourceCocycle θ sourceLogWeight n (sourceTorusRepresentative z) : ℂ)⁻¹ * + (W v (k-(-(n : ℤ)))) + have hord' : ∀ i, sourceTorusRepresentative z i ≤ coordinateRotate θ n (sourceTorusRepresentative z) i := by + simpa only [sourceTorusRepresentative_rotate] using hord + have hle := sourceCocycle_ordered θ sourceLogWeight sourceLogWeight_nonneg hx + (finiteFloorSupport_rotate θ hx n) hord' k + rw [sourceCappedRatio, sourceTorusRepresentative_rotate, + min_eq_left ((div_le_one (sourceCocycle_pos ..)).mpr hle), + sourceCocycle_orbit_ratio θ sourceLogWeight hx n k, Complex.ofReal_div, hW] + have he : k-(-(n : ℤ))-(n : ℤ) = k := by omega + rw [he] + simp only [div_eq_mul_inv] + ring + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrderedSampling.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrderedSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..941ac798b96e1d721d71ea30487ce0b439c2d6ff --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrderedSampling.lean @@ -0,0 +1,38 @@ +import OAI.Analysis.FiniteFactor.OrbitSampling.TrimmedWeak +import OAI.Analysis.FiniteFactor.OrbitSampling.TrimmedMarginals +import OAI.Analysis.FiniteFactor.OrbitSampling.OrbitSupport +import OAI.Analysis.FiniteFactor.OrbitSampling.LambdaMass +import OAI.Analysis.FiniteFactor.OrbitSampling.LambdaMarginals + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped Classical ENNReal Topology +noncomputable section + +theorem sourceOrderedSampling_event : ∀ᵐ θ ∂sourceAngleLaw, + ∀ I : Finset SourceCoordinate, + (∀ f : C(SourceSamplingTorus,ℝ), + Tendsto (fun s => ∫ p, f p ∂(sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus)) + atTop (𝓝 (∫ p, f p ∂(sourceSamplingLambdaTorus I : Measure SourceSamplingTorus)))) ∧ + (∀ s, ∀ᵐ p ∂sourceSamplingTrimmed I s θ, + (∀ i, p.1 i ≤ p.2 i) ∧ ∃ n ∈ sourceSamplingPowers s, 0 < n ∧ p.2 = coordinateRotate θ n p.1) ∧ + (∀ r : Bool, ∃ C : ℝ, ∀ s, ∃ g : (SourceCoordinate → ℝ) → ℝ, + Measurable g ∧ (∀ x, 0 ≤ g x) ∧ + (sourceSamplingTrimmed I s θ).map (sourceSamplingEndpoint r) = + sourceSamplingHaar.withDensity (fun x => ENNReal.ofReal (g x)) ∧ + MemLp g 2 sourceSamplingHaar ∧ (∫ x, g x^2 ∂sourceSamplingHaar) ≤ C) ∧ + (∀ᶠ s in atTop, 0 < ((sourceSamplingTrimmed I s θ) Set.univ).toReal) := by + filter_upwards [sourceSamplingTrimmed_weak_event,sourceSamplingTrimmed_marginals_event] with θ hw hm + intro I + refine ⟨(hw I).2.2,fun s => sourceSamplingTrimmed_orbits I s θ,hm I,?_⟩ + have hmass : Tendsto (fun s => ((sourceSamplingTrimmed I s θ) Set.univ).toReal) atTop + (𝓝 (((sourceSamplingLambda I) Set.univ).toReal)) := + NNReal.continuous_coe.continuousAt.tendsto.comp (hw I).1.mass + exact hmass.eventually (Ioi_mem_nhds (sourceSamplingLambda_mass_pos I)) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrderedTorusSampling.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrderedTorusSampling.lean new file mode 100644 index 0000000000000000000000000000000000000000..7b92300e6bbeb4c92349369138bd3c10ed6fc5f3 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/OrderedTorusSampling.lean @@ -0,0 +1,40 @@ +import OAI.Analysis.FiniteFactor.OrbitSampling.TorusMarginals +import OAI.Analysis.FiniteFactor.OrbitSampling.TorusSupport +import OAI.Analysis.FiniteFactor.CrossedProduct.OrderedSampling + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +structure SourceOrderedTorusSampling (θ : SourceCoordinate → ℝ) : Prop where + weak : ∀ (I : Finset SourceCoordinate) (f : C(SourceSamplingTorus,ℝ)), + Tendsto (fun s => ∫ p, f p ∂(sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus)) + atTop (𝓝 (∫ p, f p ∂(sourceSamplingLambdaTorus I : Measure SourceSamplingTorus))) + support : ∀ (I : Finset SourceCoordinate) (s : ℕ), + ∀ᵐ p ∂(sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus), + (∀ i, sourceTorusRepresentative p.1 i ≤ sourceTorusRepresentative p.2 i) ∧ + ∃ n ∈ sourceSamplingPowers s, 0 < n ∧ p.2 = sourceTorusRotate θ n p.1 + marginals : ∀ (I : Finset SourceCoordinate) (r : Bool), ∃ C : ℝ, ∀ s, + ∃ g : SourceTorus → ℝ, Measurable g ∧ (∀ z, 0 ≤ g z) ∧ + (sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus).map (sourceTorusEndpoint r) = + sourceTorusHaar.withDensity (fun z => ENNReal.ofReal (g z)) ∧ + MemLp g 2 sourceTorusHaar ∧ (∫ z, g z^2 ∂sourceTorusHaar) ≤ C + positive : ∀ I : Finset SourceCoordinate, ∀ᶠ s in atTop, + 0 < ((sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus) Set.univ).toReal + +theorem sourceOrderedTorusSampling_event : ∀ᵐ θ ∂sourceAngleLaw, SourceOrderedTorusSampling θ := by + filter_upwards [sourceOrderedSampling_event,sourceSamplingTrimmed_torus_marginals_event] with θ hs hm + refine ⟨fun I => (hs I).1,fun I s => sourceSamplingTrimmed_torus_orbits I s θ,hm,?_⟩ + intro I + have he (s : ℕ) : (sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus) Set.univ = + sourceSamplingTrimmed I s θ Set.univ := by + exact Measure.map_apply sourceSamplingTorusMap_continuous.measurable MeasurableSet.univ + simpa only [he] using (hs I).2.2.2 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseCount.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..9510482c28d5c0c63450596f627c1cf7923109b6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseCount.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseMarginal +import OAI.Analysis.FiniteFactor.IndependentCount +import OAI.Analysis.FiniteFactor.CrossedProduct.StageCoupling + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Finset +open scoped ENNReal Classical +noncomputable section + +def sourceBlockCoordinates (s : ℕ) : Finset SourceCoordinate := + Finset.univ.map ⟨fun i : Fin (sourceBlockSize s) => ⟨s,i⟩, by intro i j h; cases h; rfl⟩ + +@[simp] theorem sourceBlockCoordinates_card (s : ℕ) : + (sourceBlockCoordinates s).card = sourceBlockSize s := by simp [sourceBlockCoordinates] + +theorem mem_sourceBlockCoordinates {s : ℕ} {i : SourceCoordinate} + (hi : i ∈ sourceBlockCoordinates s) : i.1 = s := by + obtain ⟨j, _, rfl⟩ := Finset.mem_map.mp hi + rfl + +def sourcePhaseMissSet (s : ℕ) (k : ℤ) : Set ℝ := + {t | 1-Int.fract ((k : ℝ)*t) ∉ Set.Icc (sourceWidth s 1) (1-sourceWidth s 1)} + +theorem sourcePhaseMissSet_measurable (s : ℕ) (k : ℤ) : MeasurableSet (sourcePhaseMissSet s k) := by + exact measurableSet_Icc.compl.preimage + (measurable_const.sub (sourceFract_measurable.comp (by fun_prop))) + +def sourceFewPhases (s : ℕ) (k : ℤ) : Set (SourceCoordinate → ℝ) := + {θ | (((sourceBlockCoordinates s).filter (fun i => θ i ∉ sourcePhaseMissSet s k)).card : ℝ) < + (sourceBlockSize s : ℝ)/20} + +def sourceMissCount (s : ℕ) : ℕ := Nat.ceil ((19/20 : ℝ)*(sourceBlockSize s : ℝ)) + +theorem sourceFewPhases_subset_misses (s : ℕ) (k : ℤ) : + sourceFewPhases s k ⊆ coordinateMissEvent (sourceBlockCoordinates s) (sourceMissCount s) + (fun _ => sourcePhaseMissSet s k) := by + intro θ hθ + apply mem_coordinateMissEvent_of_card + apply Nat.ceil_le.mpr + have hc := Finset.card_filter_add_card_filter_not (s := sourceBlockCoordinates s) + (p := fun i => θ i ∈ sourcePhaseMissSet s k) + have hcR : (((sourceBlockCoordinates s).filter (fun i => θ i ∈ sourcePhaseMissSet s k)).card : ℝ) + + (((sourceBlockCoordinates s).filter (fun i => θ i ∉ sourcePhaseMissSet s k)).card : ℝ) = + (sourceBlockSize s : ℝ) := by + rw [sourceBlockCoordinates_card] at hc + exact_mod_cast hc + change (((sourceBlockCoordinates s).filter (fun i => θ i ∉ sourcePhaseMissSet s k)).card : ℝ) < + (sourceBlockSize s : ℝ)/20 at hθ + nlinarith + +/-- The fixed-power failure probability in Proposition phases, for the actual +angle product measure. The ceiling records the exact finite counting step. -/ +theorem sourceFewPhases_probability (s : ℕ) (k : ℤ) + (hk : ((sourceBlockSize s : ℝ)*(sourceStageState s).K)/4 ≤ |(k : ℝ)|) : + sourceAngleLaw (sourceFewPhases s k) ≤ + (2 : ℝ≥0∞)^sourceBlockSize s * + (ENNReal.ofReal (10*sourceWidth s 1))^sourceMissCount s := by + apply (measure_mono (sourceFewPhases_subset_misses s k)).trans + simpa only [sourceBlockCoordinates_card] using + coordinateMissEvent_bound (sourceBlockCoordinates s) (sourceMissCount s) + (fun _ => sourcePhaseMissSet s k) (fun _ => sourcePhaseMissSet_measurable s k) + (ENNReal.ofReal (10*sourceWidth s 1)) (by + intro i hi + have his := mem_sourceBlockCoordinates hi + apply sourceAngle_phase_miss i k (sourceWidth s 1) + · exact (by positivity : (0 : ℝ) ≤ 1/(sourceBlockSize s : ℝ)).trans (sourceWidth_bounds s 1).1 + · simpa only [his] using hk) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseCoverage.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseCoverage.lean new file mode 100644 index 0000000000000000000000000000000000000000..bca666f87453ab9144139425649b8f5319d2cb67 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseCoverage.lean @@ -0,0 +1,96 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Phases + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped ENNReal Topology Classical +noncomputable section + +def sourceFirstPhaseLower (s : ℕ) : ℝ := (sourceStageState s).G*(sourceStageState s).K + +theorem sourcePhaseUpper_tendsto : Tendsto sourcePhaseUpper atTop atTop := by + apply tendsto_atTop_mono (f := fun s => (sourceBlockSize s : ℝ)) _ + (tendsto_natCast_atTop_atTop.comp sourceBlockSize_tendsto) + intro s + have hm : (100 : ℝ) ≤ sourceBlockSize s := by exact_mod_cast (sourceStage s).m_ge_100 + unfold sourcePhaseUpper + conv_lhs => rw [← Real.rpow_one (sourceBlockSize s : ℝ)] + exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) + +theorem sourcePhaseOverlap (s : ℕ) : sourceFirstPhaseLower (s+1) < sourcePhaseUpper s := + (sourceStage s).next_gap + +/-- The real interval coverage from the contradiction, with the first range +used only at strictly later blocks. No magnitude is silently omitted. -/ +theorem sourcePhase_range_coverage (j : ℕ) (t : ℝ) (ht : sourcePhaseLower j ≤ t) : + ∃ s : ℕ, + (j ≤ s ∧ sourcePhaseLower s ≤ t ∧ t ≤ sourcePhaseUpper s) ∨ + (j < s ∧ sourceFirstPhaseLower s ≤ t ∧ t ≤ sourcePhaseLower s) := by + have hex : ∃ s : ℕ, j ≤ s ∧ t ≤ sourcePhaseUpper s := + ((eventually_ge_atTop j).and (sourcePhaseUpper_tendsto.eventually (eventually_ge_atTop t))).exists + let s := Nat.find hex + have hs := Nat.find_spec hex + change j ≤ s ∧ t ≤ sourcePhaseUpper s at hs + by_cases he : s = j + · exact ⟨s, Or.inl ⟨hs.1, by simpa [he] using ht, hs.2⟩⟩ + · have hj : j < s := by omega + by_cases hmid : sourcePhaseLower s ≤ t + · exact ⟨s, Or.inl ⟨hs.1,hmid,hs.2⟩⟩ + · obtain ⟨p,hp⟩ := Nat.exists_eq_succ_of_ne_zero (show s ≠ 0 by omega) + have hprev : ¬(j ≤ p ∧ t ≤ sourcePhaseUpper p) := Nat.find_min hex (by change p < s; omega) + have htprev : sourcePhaseUpper p < t := by + by_contra hh + apply hprev + exact ⟨by omega, le_of_not_gt hh⟩ + refine ⟨s, Or.inr ⟨hj, ?_, (lt_of_not_ge hmid).le⟩⟩ + rw [hp] + exact (sourcePhaseOverlap p).le.trans htprev.le + +/-- The finite deterministic qualifying list at one selected block. -/ +def sourceQualifying (θ : SourceCoordinate → ℝ) (s : ℕ) (k : ℤ) (w : Fin 2) : + Finset SourceCoordinate := + (sourceBlockCoordinates s).filter (fun i => + 1-Int.fract ((k : ℝ)*θ i) ∈ Set.Icc (sourceWidth s w) (1-sourceWidth s w)) + +def SourceSecondPhasesFrom (θ : SourceCoordinate → ℝ) (j : ℕ) : Prop := + ∀ s : ℕ, j ≤ s → ∀ k : ℤ, sourcePhaseLower s ≤ |(k : ℝ)| → + |(k : ℝ)| ≤ sourcePhaseUpper s → + (sourceBlockSize s : ℝ)/20 ≤ ((sourceQualifying θ s k 1).card : ℝ) + +theorem sourceAngleLaw_second_phases_from : + ∀ᵐ θ ∂sourceAngleLaw, ∃ j : ℕ, SourceSecondPhasesFrom θ j := by + filter_upwards [sourceAngleLaw_second_phases] with θ hθ + obtain ⟨j,hj⟩ := Filter.eventually_atTop.mp hθ + refine ⟨j, fun s hs k hlo hhi => ?_⟩ + simpa [sourceQualifying, sourcePhaseMissSet] using hj s hs k hlo hhi + +/-- For every large omitted index, this constructs a block, width, and finite +qualifying list depending only on the fixed angles and the index. -/ +theorem exists_source_qualifying_assignment (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (k : ℤ) + (hk : sourcePhaseLower j ≤ |(k : ℝ)|) : + ∃ (s : ℕ) (w : Fin 2) (I : Finset SourceCoordinate), + j ≤ s ∧ (w = 0 → j < s) ∧ I ⊆ sourceBlockCoordinates s ∧ + (sourceBlockSize s : ℝ)/20 ≤ (I.card : ℝ) ∧ + ∀ i ∈ I, 1-Int.fract ((k : ℝ)*θ i) ∈ Set.Icc (sourceWidth s w) (1-sourceWidth s w) := by + obtain ⟨s, hs | hs⟩ := sourcePhase_range_coverage j |(k : ℝ)| hk + · refine ⟨s, 1, sourceQualifying θ s k 1, hs.1, by simp, Finset.filter_subset _ _, + hphase s hs.1 k hs.2.1 hs.2.2, ?_⟩ + intro i hi + exact (Finset.mem_filter.mp hi).2 + · refine ⟨s, 0, sourceBlockCoordinates s, hs.1.le, fun _ => hs.1, le_rfl, ?_, ?_⟩ + · rw [sourceBlockCoordinates_card] + have hh : (0 : ℝ) ≤ sourceBlockSize s := Nat.cast_nonneg _ + linarith + · intro i hi + have his := mem_sourceBlockCoordinates hi + rcases i with ⟨t,i⟩ + change t = s at his + subst t + exact hθ.first_phase s k hs.2.1 hs.2.2 i + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseDecay.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseDecay.lean new file mode 100644 index 0000000000000000000000000000000000000000..9813c2b713b5509a7bd657a2ff2027eaaedee3be --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseDecay.lean @@ -0,0 +1,82 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseCount +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- An explicit majorant for the positive-power union bound. -/ +def sourcePhaseFailureMajorant (s : ℕ) : ℝ := + (sourceBlockSize s : ℝ)^((4/5 : ℝ)*(sourceBlockSize s : ℝ)) * + 2^sourceBlockSize s * (10*sourceWidth s 1)^sourceMissCount s + +theorem phaseFailureMajorant_le (m q : ℕ) (hm : (100 : ℝ) ≤ m) + (hroot : (10 : ℝ) ≤ (m : ℝ)^(1/100 : ℝ)) + (hq : (19/20 : ℝ)*(m : ℝ) ≤ q) : + (m : ℝ)^((4/5 : ℝ)*(m : ℝ))*2^m* + (10*(m : ℝ)^(-19/20 : ℝ))^q ≤ (m : ℝ)^(-2 : ℝ) := by + have hm0 : (0 : ℝ) < m := by linarith + have hm1 : (1 : ℝ) ≤ m := by linarith + have hb : 10*(m : ℝ)^(-19/20 : ℝ) ≤ (m : ℝ)^(-47/50 : ℝ) := by + calc + _ ≤ (m : ℝ)^(1/100 : ℝ)*(m : ℝ)^(-19/20 : ℝ) := by gcongr + _ = _ := by rw [← Real.rpow_add hm0]; norm_num + have htwo : (2 : ℝ)^m ≤ ((m : ℝ)^(1/100 : ℝ))^m := by + gcongr + linarith + calc + _ ≤ (m : ℝ)^((4/5 : ℝ)*(m : ℝ))*((m : ℝ)^(1/100 : ℝ))^m* + ((m : ℝ)^(-47/50 : ℝ))^q := by gcongr + _ = (m : ℝ)^((4/5 : ℝ)*(m : ℝ)+(1/100 : ℝ)*(m : ℝ)+(-47/50 : ℝ)*(q : ℝ)) := by + rw [← Real.rpow_mul_natCast hm0.le, ← Real.rpow_mul_natCast hm0.le, + ← Real.rpow_add hm0, ← Real.rpow_add hm0] + _ ≤ (m : ℝ)^(-2 : ℝ) := by + apply Real.rpow_le_rpow_of_exponent_le hm1 + nlinarith + +theorem sourceBlockSize_tendsto : Tendsto sourceBlockSize atTop atTop := by + have hs : StrictMono (fun s => (sourceStageState s).K) := by + apply strictMono_nat_of_lt_succ + intro s + have hh := sourceStage_cutoff_growth s + omega + exact tendsto_atTop_mono (fun s => (sourceStage s).m_ge_K) hs.tendsto_atTop + +theorem sourcePhaseFailureMajorant_eventually : + ∀ᶠ s in atTop, sourcePhaseFailureMajorant s ≤ (sourceBlockSize s : ℝ)^(-2 : ℝ) := by + have ht : Tendsto (fun s => (sourceBlockSize s : ℝ)^(1/100 : ℝ)) atTop atTop := + (tendsto_rpow_atTop (by norm_num)).comp + (tendsto_natCast_atTop_atTop.comp sourceBlockSize_tendsto) + filter_upwards [ht.eventually (eventually_ge_atTop 10)] with s hs + exact phaseFailureMajorant_le (sourceBlockSize s) (sourceMissCount s) + (by exact_mod_cast (sourceStage s).m_ge_100) hs (Nat.le_ceil _) + +/-- The reciprocal-square majorant is summable from m_s >= 2^(s+1). -/ +theorem sourceBlockSize_inverseSquare_summable : + Summable (fun s => (sourceBlockSize s : ℝ)^(-2 : ℝ)) := by + apply (summable_geometric_of_lt_one (by norm_num : (0 : ℝ) ≤ 1/2) (by norm_num)).of_nonneg_of_le + · intro s; positivity + · intro s + have hm1 : (1 : ℝ) ≤ sourceBlockSize s := by exact_mod_cast (show 1 ≤ sourceBlockSize s by change 1 ≤ (sourceStage s).m; have := (sourceStage s).m_ge_100; omega) + have hp : (2 : ℝ)^s ≤ sourceBlockSize s := by + have hh := (sourceStage s).m_ge_pow + have hh' : 2^s ≤ sourceBlockSize s := by change 2^(s+1) ≤ sourceBlockSize s at hh; have := Nat.le_mul_of_pos_right (2^s) (by omega : 0 < 2); rw [pow_succ] at hh; omega + exact_mod_cast hh' + calc + _ ≤ (sourceBlockSize s : ℝ)^(-1 : ℝ) := Real.rpow_le_rpow_of_exponent_le hm1 (by norm_num) + _ = 1/(sourceBlockSize s : ℝ) := by rw [Real.rpow_neg_one, one_div] + _ ≤ 1/(2 : ℝ)^s := one_div_le_one_div_of_le (by positivity) hp + _ = (1/2 : ℝ)^s := by rw [one_div_pow] + +theorem sourcePhaseFailureMajorant_summable : Summable sourcePhaseFailureMajorant := by + apply sourceBlockSize_inverseSquare_summable.of_norm_bounded_eventually_nat + filter_upwards [sourcePhaseFailureMajorant_eventually] with s hs + rwa [Real.norm_eq_abs, abs_of_nonneg (by unfold sourcePhaseFailureMajorant sourceWidth; dsimp; positivity)] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseFirst.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseFirst.lean new file mode 100644 index 0000000000000000000000000000000000000000..e1b3b4e41ba1c477b7cf24950f2b6ef8035713ed --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseFirst.lean @@ -0,0 +1,62 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.AngleLaw +import OAI.Analysis.FiniteFactor.CrossedProduct.StageCoupling + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- Fractional-part threshold in the small phase range, with both signs. -/ +theorem phase_threshold_of_abs {a t : ℝ} (ha : 0 < a) (ha4 : a ≤ 1/4) + (hlo : a ≤ |t|) (hhi : |t| ≤ 1/2) : + 1 - Int.fract t ∈ Set.Icc a (1-a) := by + have ht0 : |t| ≠ 0 := ne_of_gt (ha.trans_le hlo) + have hf : Int.fract |t| = |t| := Int.fract_eq_self.mpr ⟨abs_nonneg _, by linarith⟩ + rcases le_total 0 t with hp | hn + · rw [abs_of_nonneg hp] at hf hlo hhi + rw [hf] + constructor <;> linarith + · have he : t = -|t| := by rw [abs_of_nonpos hn]; ring + rw [he, Int.fract_neg (by rw [hf]; exact ht0), hf] + constructor <;> linarith + +/-- Phase bounds for every stage and realization. +There is no eventual-stage or probabilistic assumption. -/ +theorem SourceAngles.first_phase {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) + (s : ℕ) (k : ℤ) + (hlo : (sourceStageState s).G * (sourceStageState s).K ≤ |(k : ℝ)|) + (hhi : |(k : ℝ)| ≤ ((sourceBlockSize s : ℝ) * (sourceStageState s).K)/4) + (i : Fin (sourceBlockSize s)) : + 1 - Int.fract ((k : ℝ)*θ ⟨s,i⟩) ∈ + Set.Icc ((sourceStageState s).G/(sourceBlockSize s : ℝ)) + (1-(sourceStageState s).G/(sourceBlockSize s : ℝ)) := by + have hm := sourceBlockSize_pos s + have hK := sourceCutoff_pos s + have hG : 0 < (sourceStageState s).G := lt_of_lt_of_le zero_lt_one (sourceStageState s).G_ge + have ha4 : (sourceStageState s).G / (sourceBlockSize s : ℝ) ≤ 1/4 := by + apply (div_le_iff₀ hm).mpr + have hh := (sourceStage s).m_ge_G + change 4*(sourceStageState s).G ≤ (sourceBlockSize s : ℝ) at hh + linarith + apply phase_threshold_of_abs (div_pos hG hm) ha4 + · rw [abs_mul, abs_of_nonneg (hθ.nonneg ⟨s,i⟩)] + calc + (sourceStageState s).G / (sourceBlockSize s : ℝ) = + ((sourceStageState s).G*(sourceStageState s).K) * + (1/((sourceBlockSize s : ℝ)*(sourceStageState s).K)) := by field_simp + _ ≤ |(k : ℝ)| *θ ⟨s,i⟩ := + mul_le_mul hlo (hθ ⟨s,i⟩).1 (by positivity) (abs_nonneg _) + · rw [abs_mul, abs_of_nonneg (hθ.nonneg ⟨s,i⟩)] + calc + |(k : ℝ)| *θ ⟨s,i⟩ ≤ + (((sourceBlockSize s : ℝ)*(sourceStageState s).K)/4) * + (2/((sourceBlockSize s : ℝ)*(sourceStageState s).K)) := + mul_le_mul hhi (hθ ⟨s,i⟩).2 (hθ.nonneg _) (by positivity) + _ = 1/2 := by field_simp; norm_num + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseMarginal.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseMarginal.lean new file mode 100644 index 0000000000000000000000000000000000000000..90b646075484ef3c6bd94d7f38cfa7b4990765e1 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PhaseMarginal.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.AngleLaw +import OAI.Analysis.FiniteFactor.PeriodizedUniform + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory +open scoped ENNReal +noncomputable section + +theorem unitInterval_middle_compl (b : ℝ) (hb : 0 ≤ b) : + unitIntervalMeasure (Set.Icc b (1-b))ᶜ ≤ ENNReal.ofReal (2*b) := by + rw [unitIntervalMeasure, Measure.restrict_apply measurableSet_Icc.compl] + have hsub : (Set.Icc b (1-b))ᶜ ∩ Set.Ico (0 : ℝ) 1 ⊆ + Set.Ico 0 b ∪ Set.Ioc (1-b) 1 := by + intro x hx + by_cases hxb : x < b + · exact Or.inl ⟨hx.2.1,hxb⟩ + · exact Or.inr ⟨by by_contra hh; exact hx.1 ⟨le_of_not_gt hxb, le_of_not_gt hh⟩, hx.2.2.le⟩ + calc + _ ≤ volume (Set.Ico 0 b ∪ Set.Ioc (1-b) 1) := measure_mono hsub + _ ≤ volume (Set.Ico (0 : ℝ) b) + volume (Set.Ioc (1-b) 1) := measure_union_le _ _ + _ = ENNReal.ofReal (2*b) := by + rw [Real.volume_Ico, Real.volume_Ioc] + simp only [sub_zero, sub_sub_cancel] + rw [← ENNReal.ofReal_add hb hb] + congr 1 + ring + +/-- The actual source-angle phase law has density at most five in the +second phase range. This is domination on all Borel sets. -/ +theorem sourceAngle_positive_phase_domination (i : SourceCoordinate) (c : ℝ) + (hc : 0 < c) (hlen : 1/4 ≤ c*sourceAngleUnit i) : + (sourceAngleMarginal i).map (fun t => Int.fract (c*t)) ≤ + (5 : ℝ≥0∞) • unitIntervalMeasure := by + have ha := sourceAngleUnit_pos i + have he : (sourceAngleMarginal i).map (fun t => Int.fract (c*t)) = + (cond volume (Set.Ioc (c*sourceAngleUnit i) (c*(2*sourceAngleUnit i)))).map Int.fract := by + rw [← cond_interval_mul_pos (sourceAngleUnit i) (2*sourceAngleUnit i) c (by linarith) hc, + Measure.map_map sourceFract_measurable (by fun_prop)] + rw [sourceAngleMarginal, sourceAngleInterval, cond_closed_interval_eq] + rfl + rw [he] + have hpos : c*sourceAngleUnit i < c*(2*sourceAngleUnit i) := by nlinarith + apply (fract_interval_domination _ _ hpos).trans + have hh : 1+1/(c*(2*sourceAngleUnit i)-c*sourceAngleUnit i) ≤ (5 : ℝ) := by + have heq : c*(2*sourceAngleUnit i)-c*sourceAngleUnit i = c*sourceAngleUnit i := by ring + rw [heq] + have hh := one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 1/4) hlen + have hh' : 1/(c*sourceAngleUnit i) ≤ 4 := by + simpa [one_div, mul_inv_rev] using hh + linarith + have hscalar : ENNReal.ofReal (1+1/(c*(2*sourceAngleUnit i)-c*sourceAngleUnit i)) ≤ 5 := by + exact_mod_cast ENNReal.ofReal_le_ofReal hh + gcongr + +/-- Reflection preserves the symmetric phase eligibility interval, including +integer phases at the cut. -/ +theorem fract_neg_middle_iff (b t : ℝ) : + Int.fract (-t) ∈ Set.Icc b (1-b) ↔ Int.fract t ∈ Set.Icc b (1-b) := by + by_cases ht : Int.fract t = 0 + · rw [Int.fract_neg_eq_zero.mpr ht, ht] + · rw [Int.fract_neg ht] + constructor <;> intro h <;> constructor <;> linarith [h.1,h.2] + +theorem threshold_middle_iff (b t : ℝ) : + 1-Int.fract t ∈ Set.Icc b (1-b) ↔ Int.fract t ∈ Set.Icc b (1-b) := by + constructor <;> intro h <;> constructor <;> linarith [h.1,h.2] + +/-- Proposition phases' one-coordinate miss bound, valid for both signs and +for every coordinate in the actual source interval. -/ +theorem sourceAngle_phase_miss (i : SourceCoordinate) (k : ℤ) (b : ℝ) (hb : 0 ≤ b) + (hk : ((sourceBlockSize i.1 : ℝ)*(sourceStageState i.1).K)/4 ≤ |(k : ℝ)|) : + sourceAngleMarginal i {t | 1-Int.fract ((k : ℝ)*t) ∉ Set.Icc b (1-b)} ≤ + ENNReal.ofReal (10*b) := by + have hN := mul_pos (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1) + have hkpos : 0 < |(k : ℝ)| := lt_of_lt_of_le (by positivity) hk + have hlen : 1/4 ≤ |(k : ℝ)| *sourceAngleUnit i := by + unfold sourceAngleUnit + rw [mul_one_div] + apply (le_div_iff₀ hN).mpr + nlinarith [hk] + have he : {t : ℝ | 1-Int.fract ((k : ℝ)*t) ∉ Set.Icc b (1-b)} = + (fun t : ℝ => Int.fract (|(k : ℝ)| *t)) ⁻¹' (Set.Icc b (1-b))ᶜ := by + ext t + simp only [Set.mem_ofPred_eq, Set.mem_preimage, Set.mem_compl_iff, threshold_middle_iff] + rcases le_total 0 (k : ℝ) with hpos | hneg + · rw [abs_of_nonneg hpos] + · rw [abs_of_nonpos hneg, neg_mul, fract_neg_middle_iff] + rw [he, ← Measure.map_apply (f := fun t : ℝ => Int.fract (|(k : ℝ)| *t)) + (by exact sourceFract_measurable.comp (by fun_prop)) measurableSet_Icc.compl] + calc + _ ≤ ((5 : ℝ≥0∞) • unitIntervalMeasure) (Set.Icc b (1-b))ᶜ := + sourceAngle_positive_phase_domination i |(k : ℝ)| hkpos hlen _ + _ = 5 * unitIntervalMeasure (Set.Icc b (1-b))ᶜ := rfl + _ ≤ 5 * ENNReal.ofReal (2*b) := by + have hh := unitInterval_middle_compl b hb + gcongr + _ = ENNReal.ofReal (10*b) := by + rw [show (5 : ℝ≥0∞) = ENNReal.ofReal 5 by norm_num, ← ENNReal.ofReal_mul (by norm_num : (0 : ℝ) ≤ 5)] + congr 1 + ring + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Phases.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Phases.lean new file mode 100644 index 0000000000000000000000000000000000000000..d3a59c209bb12aa35064942257d17256daa38d67 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Phases.lean @@ -0,0 +1,113 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseFirst +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseDecay + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped ENNReal Topology Classical +noncomputable section + +def sourcePhaseUpper (s : ℕ) : ℝ := + (sourceBlockSize s : ℝ)^((4/5 : ℝ)*(sourceBlockSize s : ℝ)) + +def sourcePhaseLower (s : ℕ) : ℝ := + ((sourceBlockSize s : ℝ)*(sourceStageState s).K)/4 + +def sourcePhaseFailure (s : ℕ) : Set (SourceCoordinate → ℝ) := + ⋃ n ∈ Finset.Icc 1 (Nat.floor (sourcePhaseUpper s)), + if sourcePhaseLower s ≤ (n : ℝ) then sourceFewPhases s (n : ℤ) else ∅ + +theorem sourcePhaseFailure_bound (s : ℕ) : + sourceAngleLaw (sourcePhaseFailure s) ≤ ENNReal.ofReal (sourcePhaseFailureMajorant s) := by + let B : ℝ≥0∞ := (2 : ℝ≥0∞)^sourceBlockSize s * + (ENNReal.ofReal (10*sourceWidth s 1))^sourceMissCount s + have hn (n : ℕ) : sourceAngleLaw + (if sourcePhaseLower s ≤ (n : ℝ) then sourceFewPhases s (n : ℤ) else ∅) ≤ B := by + split_ifs with h + · apply sourceFewPhases_probability + simpa only [sourcePhaseLower, Int.cast_natCast, abs_of_nonneg (Nat.cast_nonneg (α := ℝ) n)] using h + · simp + have hQ : 0 ≤ sourcePhaseUpper s := by unfold sourcePhaseUpper; positivity + have hc : ((Finset.Icc 1 (Nat.floor (sourcePhaseUpper s))).card : ℝ≥0∞) ≤ + ENNReal.ofReal (sourcePhaseUpper s) := by + simp only [Nat.card_Icc, Nat.add_sub_cancel] + exact_mod_cast ENNReal.ofReal_le_ofReal (Nat.floor_le hQ) + calc + _ ≤ ∑ n ∈ Finset.Icc 1 (Nat.floor (sourcePhaseUpper s)), sourceAngleLaw + (if sourcePhaseLower s ≤ (n : ℝ) then sourceFewPhases s (n : ℤ) else ∅) := + measure_biUnion_finset_le _ _ + _ ≤ ∑ _n ∈ Finset.Icc 1 (Nat.floor (sourcePhaseUpper s)), B := + Finset.sum_le_sum (fun n _ => hn n) + _ = ((Finset.Icc 1 (Nat.floor (sourcePhaseUpper s))).card : ℝ≥0∞)*B := by simp [nsmul_eq_mul] + _ ≤ ENNReal.ofReal (sourcePhaseUpper s)*B := by gcongr + _ = ENNReal.ofReal (sourcePhaseFailureMajorant s) := by + have hw : 0 ≤ 10*sourceWidth s 1 := by unfold sourceWidth; dsimp; positivity + dsimp [B] + rw [show (2 : ℝ≥0∞)^sourceBlockSize s = ENNReal.ofReal ((2 : ℝ)^sourceBlockSize s) by simp, + ← ENNReal.ofReal_pow hw, + ← ENNReal.ofReal_mul (by positivity : (0 : ℝ) ≤ 2^sourceBlockSize s), + ← ENNReal.ofReal_mul hQ] + congr 1 + unfold sourcePhaseFailureMajorant sourcePhaseUpper + ring + +theorem sourcePhaseFailure_finite : + ∀ᵐ θ ∂sourceAngleLaw, {s | θ ∈ sourcePhaseFailure s}.Finite := by + apply ae_finite_setOfPred_mem + apply ne_of_lt + apply lt_of_le_of_lt (ENNReal.tsum_le_tsum sourcePhaseFailure_bound) + rw [← ENNReal.ofReal_tsum_of_nonneg + (fun s => by unfold sourcePhaseFailureMajorant sourceWidth; dsimp; positivity) + sourcePhaseFailureMajorant_summable] + exact ENNReal.ofReal_lt_top + +theorem sourcePhaseMissSet_natAbs (s : ℕ) (k : ℤ) : + sourcePhaseMissSet s (k.natAbs : ℤ) = sourcePhaseMissSet s k := by + ext t + simp only [sourcePhaseMissSet, Set.mem_ofPred_eq, threshold_middle_iff] + rcases le_total 0 k with hp | hn + · have he : (k.natAbs : ℤ) = k := by rw [Int.natCast_natAbs, abs_of_nonneg hp] + rw [he] + · have he : (k.natAbs : ℤ) = -k := by rw [Int.natCast_natAbs, abs_of_nonpos hn] + rw [he, Int.cast_neg, neg_mul, fract_neg_middle_iff] + +/-- Proposition phases, assertion 2, for all signed integer powers at every +sufficiently late stage on one probability-one event. -/ +theorem sourceAngleLaw_second_phases : ∀ᵐ θ ∂sourceAngleLaw, + ∀ᶠ s in atTop, ∀ k : ℤ, sourcePhaseLower s ≤ |(k : ℝ)| → + |(k : ℝ)| ≤ sourcePhaseUpper s → + (sourceBlockSize s : ℝ)/20 ≤ + (((sourceBlockCoordinates s).filter (fun i => θ i ∉ sourcePhaseMissSet s k)).card : ℝ) := by + filter_upwards [sourcePhaseFailure_finite] with θ hθ + have he : ∀ᶠ s in atTop, θ ∉ sourcePhaseFailure s := by + apply Filter.eventually_atTop.mpr + refine ⟨hθ.toFinset.sup id+1, ?_⟩ + intro s hs hm + have hh := Finset.le_sup (f := id) (hθ.mem_toFinset.mpr hm) + dsimp only [id] at hh + omega + filter_upwards [he] with s hs + intro k hklo hkhi + by_contra h + have hcast : (k.natAbs : ℝ) = |(k : ℝ)| := by rw [← Int.cast_abs, ← Int.natCast_natAbs, Int.cast_natCast] + have hnpos : 1 ≤ k.natAbs := by + have hh : (0 : ℝ) < sourcePhaseLower s := by + unfold sourcePhaseLower + exact div_pos (mul_pos (sourceBlockSize_pos s) (sourceCutoff_pos s)) (by norm_num) + have : (0 : ℝ) < k.natAbs := by rw [hcast]; exact hh.trans_le hklo + exact_mod_cast this + have hnupper : k.natAbs ≤ Nat.floor (sourcePhaseUpper s) := Nat.le_floor (by rwa [hcast]) + apply hs + apply Set.mem_iUnion.mpr + refine ⟨k.natAbs, Set.mem_iUnion.mpr ⟨Finset.mem_Icc.mpr ⟨hnpos, hnupper⟩, ?_⟩⟩ + rw [ite_eq_left (by rwa [hcast])] + change (((sourceBlockCoordinates s).filter + (fun i => θ i ∉ sourcePhaseMissSet s (k.natAbs : ℤ))).card : ℝ) < (sourceBlockSize s : ℝ)/20 + rw [sourcePhaseMissSet_natAbs] + exact lt_of_not_ge h + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Powers.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Powers.lean new file mode 100644 index 0000000000000000000000000000000000000000..401ae10edeee0de700a0b5846f1df69e0fd8efe6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Powers.lean @@ -0,0 +1,131 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Operator +import OAI.Analysis.FiniteFactor.CrossedProduct.Attenuation +import OAI.Analysis.FiniteFactor.Quasinilpotence + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- Composition of the actual representative rotations. -/ +theorem coordinateRotate_add {ι : Type*} (θ : ι → ℝ) (k n : ℤ) (x : ι → ℝ) : + coordinateRotate θ n (coordinateRotate θ k x) = coordinateRotate θ (k+n) x := by + funext i + unfold coordinateRotate + rw [Int.fract_eq_fract] + refine ⟨-Int.floor (x i + (k : ℝ)*θ i), ?_⟩ + rw [Int.fract] + push_cast + ring + +def sourceShiftNIndex {ι : Type*} (n : ℕ) (z : (ι → ℝ) × ℤ) : (ι → ℝ) × ℤ := + (z.1, z.2-(n : ℤ)) + +theorem sourceShiftNIndex_preserving (ι : Type*) (n : ℕ) : + MeasurePreserving (sourceShiftNIndex (ι := ι) n) (sourceMeasure ι) (sourceMeasure ι) := by + induction n with + | zero => + have he : sourceShiftNIndex (ι := ι) 0 = id := by funext z; simp [sourceShiftNIndex] + rw [he] + exact MeasurePreserving.id _ + | succ n ih => + convert ih.comp (sourceShiftIndex_preserving ι) using 1 + funext z + simp [sourceShiftNIndex, sourceShiftIndex, sub_sub, add_comm] + +theorem sourceOperator_apply_ae {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) (f : SourceHilbert ι) : + sourceOperator θ c hθ hc f =ᵐ[sourceMeasure ι] fun z => + sourceDiagonal θ c (sourceShiftIndex z) * f (sourceShiftIndex z) := by + have he := Lp.coeFn_compMeasurePreserving (sourceMultiplication θ c hθ hc f) + (sourceShiftIndex_preserving ι) + have hm := (sourceShiftIndex_preserving ι).quasiMeasurePreserving.ae + (sourceMultiplication_apply_ae θ c hθ hc f) + exact he.trans hm + +/-- The actual powers of the constructed weighted shift, on the conull +finite-floor-support domain. No power formula is assumed. -/ +theorem sourceOperator_pow_apply_ae {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hs : Summable (fun i => |θ i|)) (n : ℕ) (f : SourceHilbert ι) : + (sourceOperator θ c hθ hc ^ n) f =ᵐ[sourceMeasure ι] fun z => + (sourceCocycle θ c n (coordinateRotate θ (z.2-(n : ℤ)) z.1) : ℂ) * + f (sourceShiftNIndex n z) := by + induction n with + | zero => + apply Eventually.of_forall + intro z + have hzero : sourceCocycle θ c 0 (coordinateRotate θ z.2 z.1) = 1 := + sourceCocycle_zero θ c (fun i => ⟨Int.fract_nonneg _, Int.fract_lt_one _⟩) + simp [sourceShiftNIndex, hzero] + | succ n ih => + have hfs : ∀ᵐ z ∂sourceMeasure ι, finiteFloorSupport θ z.1 := + Measure.quasiMeasurePreserving_fst.ae (ae_finiteFloorSupport θ hs) + have hih := (sourceShiftIndex_preserving ι).quasiMeasurePreserving.ae ih + have he := sourceOperator_apply_ae θ c hθ hc ((sourceOperator θ c hθ hc ^ n) f) + have hpow : (sourceOperator θ c hθ hc ^ (n+1)) f = + sourceOperator θ c hθ hc ((sourceOperator θ c hθ hc ^ n) f) := by + rw [pow_succ'] + rfl + rw [hpow] + filter_upwards [he, hih, hfs] with z hz hi hx + rw [hz, hi] + have hrot : coordinateRotate θ (n : ℤ) (coordinateRotate θ (z.2-((n+1 : ℕ) : ℤ)) z.1) = + coordinateRotate θ (z.2-1) z.1 := by + rw [coordinateRotate_add] + congr 1 + push_cast + omega + have hcoe := sourceCocycle_add θ c (finiteFloorSupport_rotate θ hx (z.2-((n+1 : ℕ) : ℤ))) + (n : ℤ) 1 + rw [hrot] at hcoe + have hind : sourceShiftNIndex n (sourceShiftIndex z) = sourceShiftNIndex (n+1) z := by + simp [sourceShiftNIndex, sourceShiftIndex, sub_sub, add_comm] + have hidx : (sourceShiftIndex z).2-(n : ℤ) = z.2-((n+1 : ℕ) : ℤ) := by + simp [sourceShiftIndex] + omega + simp only [sourceDiagonal, sourceShiftIndex] at * + rw [show z.2-1-(n : ℤ) = z.2-((n+1 : ℕ) : ℤ) from hidx, hind] + simp only [Nat.cast_add, Nat.cast_one] at hcoe ⊢ + rw [hcoe, Complex.ofReal_mul] + exact (mul_assoc _ _ _).symm + +/-- The source's finite-prefix operator bound, now for the constructed T. -/ +theorem sourceOperator_pow_norm_prefix_bound {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hs : Summable (fun i => |θ i|)) (I : Finset ι) (n : ℕ) : + ‖sourceOperator θ c hθ hc ^ n‖ ≤ + Real.exp ((∑ i ∈ I, c i) - (n : ℝ)*(∑ i ∈ I, c i*θ i)) := by + apply ContinuousLinearMap.opNorm_le_bound _ (Real.exp_pos _).le + intro f + let g := Lp.compMeasurePreserving (sourceShiftNIndex n) (sourceShiftNIndex_preserving ι n) f + have hg := Lp.coeFn_compMeasurePreserving f (sourceShiftNIndex_preserving ι n) + have hfs : ∀ᵐ z ∂sourceMeasure ι, finiteFloorSupport θ z.1 := + Measure.quasiMeasurePreserving_fst.ae (ae_finiteFloorSupport θ hs) + have hle : ‖(sourceOperator θ c hθ hc ^ n) f‖ ≤ + Real.exp ((∑ i ∈ I, c i) - (n : ℝ)*(∑ i ∈ I, c i*θ i)) * ‖g‖ := by + apply Lp.norm_le_mul_norm_of_ae_le_mul + filter_upwards [sourceOperator_pow_apply_ae θ c hθ hc hs n f, hg, hfs] with z hz hg hx + rw [hz, hg, norm_mul, Complex.norm_real, + Real.norm_of_nonneg (sourceCocycle_pos _ _ _ _).le] + apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) + exact sourceCocycle_prefix_bound θ c hθ hc + (finiteFloorSupport_rotate θ hx _) (fun i => Int.fract_nonneg _) I n + simpa [g, Lp.norm_compMeasurePreserving] using hle + +/-- Norm quasinilpotence of this concrete operator follows from divergence of +its coordinate weighted-angle sums, not from any assumed operator property. -/ +theorem sourceOperator_norm_quasinilpotent {ι : Type*} [Countable ι] (θ c : ι → ℝ) + (hθ : ∀ i, 0 ≤ θ i) (hc : ∀ i, 0 ≤ c i) + (hs : Summable (fun i => |θ i|)) (I : ℕ → Finset ι) + (hdiv : Tendsto (fun q => ∑ i ∈ I q, c i*θ i) atTop atTop) : + Tendsto (fun n : ℕ => ‖sourceOperator θ c hθ hc ^ n‖ ^ (1/(n : ℝ))) atTop (𝓝 0) := + norm_quasinilpotent_of_prefix_bounds _ _ _ hdiv + (fun q n _ => sourceOperator_pow_norm_prefix_bound θ c hθ hc hs (I q) n) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PredualIdentification.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PredualIdentification.lean new file mode 100644 index 0000000000000000000000000000000000000000..f010597b592fd391c7eefa9a0bfe824efaff09c8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PredualIdentification.lean @@ -0,0 +1,130 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.NormalRiesz +import OAI.Analysis.FiniteFactor.Model +import Mathlib.Analysis.CStarAlgebra.Basic + +namespace OAI + +namespace FiniteFactor +open TopologicalSpace +noncomputable section + +/-- The reconstructed operator belongs to the original algebra, by its +verified double-commutant definition. -/ +theorem sourceNormalRieszOperator_mem (θ : SourceCoordinate → ℝ) + (F : StrongDual ℂ (SourceNormalPredualSpace θ)) : + sourceNormalRieszOperator θ F ∈ sourceAlgebra θ := by + rw [← (sourceAlgebra θ).commutant_commutant] + apply VonNeumannAlgebra.mem_commutant_iff.mpr + intro b hb + apply ContinuousLinearMap.ext + intro η + apply ext_inner_left ℂ + intro ξ + change inner ℂ ξ (b (sourceNormalRieszOperator θ F η)) = + inner ℂ ξ (sourceNormalRieszOperator θ F (b η)) + have hv : sourceVectorInSpace θ ξ (b η) = sourceVectorInSpace θ (star b ξ) η := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro A + change inner ℂ ξ ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (b η)) = + inner ℂ (star b ξ) ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) η) + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_left] + exact congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + inner ℂ ξ (T η)) ((VonNeumannAlgebra.mem_commutant_iff.mp hb) A A.property) + calc + _ = inner ℂ (star b ξ) (sourceNormalRieszOperator θ F η) := + (ContinuousLinearMap.adjoint_inner_left b (sourceNormalRieszOperator θ F η) ξ).symm + _ = F (sourceVectorInSpace θ (star b ξ) η) := sourceNormalRieszOperator_inner θ F _ η + _ = F (sourceVectorInSpace θ ξ (b η)) := congrArg F hv.symm + _ = _ := (sourceNormalRieszOperator_inner θ F ξ (b η)).symm + +/-- Equality on actual vector functionals determines a functional on their +closed span. -/ +theorem sourceNormalFunctionals_ext (θ : SourceCoordinate → ℝ) + (F G : StrongDual ℂ (SourceNormalPredualSpace θ)) + (h : ∀ ξ η, F (sourceVectorInSpace θ ξ η) = G (sourceVectorInSpace θ ξ η)) : F = G := by + let S : Submodule ℂ (StrongDual ℂ (SourceAlgebraSpace θ)) := + Submodule.span ℂ (Set.range (fun z : SourceHilbert SourceCoordinate × SourceHilbert SourceCoordinate => + sourceVectorFunctional θ z.1 z.2)) + have hs : ∀ φ ∈ S, ∀ hφ : φ ∈ sourceNormalFunctionalSpace θ, F ⟨φ,hφ⟩ = G ⟨φ,hφ⟩ := by + intro φ hφ + induction hφ using Submodule.span_induction with + | mem φ hφ => + obtain ⟨⟨ξ,η⟩,rfl⟩ := hφ + intro _ + exact h ξ η + | zero => intro _; exact (map_zero F).trans (map_zero G).symm + | add φ ψ hφ hψ ihφ ihψ => + intro hsum + have hφ' := Submodule.le_topologicalClosure S hφ + have hψ' := Submodule.le_topologicalClosure S hψ + change F (⟨φ,hφ'⟩+⟨ψ,hψ'⟩) = G (⟨φ,hφ'⟩+⟨ψ,hψ'⟩) + exact (F.map_add ⟨φ,hφ'⟩ ⟨ψ,hψ'⟩).trans + ((congrArg₂ (· + ·) (ihφ hφ') (ihψ hψ')).trans (G.map_add ⟨φ,hφ'⟩ ⟨ψ,hψ'⟩).symm) + | smul c φ hφ ihφ => + intro hsmul + have hφ' := Submodule.le_topologicalClosure S hφ + change F (c • ⟨φ,hφ'⟩) = G (c • ⟨φ,hφ'⟩) + exact (F.map_smul c ⟨φ,hφ'⟩).trans + ((congrArg (fun z : ℂ => c • z) (ihφ hφ')).trans (G.map_smul c ⟨φ,hφ'⟩).symm) + let j : S → SourceNormalPredualSpace θ := fun φ => ⟨φ,Submodule.le_topologicalClosure S φ.property⟩ + have hd : DenseRange j := (denseRange_inclusion_iff (Submodule.le_topologicalClosure S)).mpr + (by intro φ hφ; exact hφ) + apply ContinuousLinearMap.ext + intro φ + have hsub : Set.range j ⊆ {ψ | F ψ = G ψ} := by + rintro ψ ⟨χ,rfl⟩ + exact hs χ χ.property _ + exact (closure_minimal hsub (isClosed_eq F.continuous G.continuous)) (hd φ) + +/-- Every continuous functional on the constructed separable Banach space +is evaluation by an element of the original source algebra. -/ +theorem sourceNormalEvaluation_surjective (θ : SourceCoordinate → ℝ) : + Function.Surjective (sourceNormalEvaluation θ) := by + intro F + refine ⟨⟨sourceNormalRieszOperator θ F,sourceNormalRieszOperator_mem θ F⟩,?_⟩ + apply sourceNormalFunctionals_ext + intro ξ η + exact sourceNormalRieszOperator_inner θ F ξ η + +theorem sourceNormalEvaluation_norm (θ : SourceCoordinate → ℝ) (A : SourceAlgebraSpace θ) : + ‖sourceNormalEvaluation θ A‖ = ‖A‖ := by + apply le_antisymm + · apply ContinuousLinearMap.opNorm_le_bound _ (norm_nonneg A) + intro φ + change ‖(φ.1 : StrongDual ℂ (SourceAlgebraSpace θ)) A‖ ≤ _ + exact ((φ.1 : StrongDual ℂ (SourceAlgebraSpace θ)).le_opNorm A).trans_eq (mul_comm _ _) + · have he : sourceNormalRieszOperator θ (sourceNormalEvaluation θ A) = + (A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) := by + apply ContinuousLinearMap.ext + intro η + apply ext_inner_left ℂ + intro ξ + exact sourceNormalRieszOperator_inner θ (sourceNormalEvaluation θ A) ξ η + change ‖(A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate)‖ ≤ _ + rw [← he] + exact sourceNormalRieszOperator_norm θ (sourceNormalEvaluation θ A) + +def sourceNormalEvaluationIsometry (θ : SourceCoordinate → ℝ) : + SourceAlgebraSpace θ →ₗᵢ[ℂ] StrongDual ℂ (SourceNormalPredualSpace θ) where + toFun := sourceNormalEvaluation θ + map_add' A B := by apply ContinuousLinearMap.ext; intro φ; exact map_add (φ.1 : StrongDual ℂ (SourceAlgebraSpace θ)) A B + map_smul' c A := by apply ContinuousLinearMap.ext; intro φ; exact map_smul (φ.1 : StrongDual ℂ (SourceAlgebraSpace θ)) c A + norm_map' := sourceNormalEvaluation_norm θ + +/-- The full dual identification, with the exact conjugate-linear convention +required by Target.HasSeparablePredual. -/ +def sourcePredualIdentification (θ : SourceCoordinate → ℝ) : + StrongDual ℂ (SourceNormalPredualSpace θ) ≃ₗᵢ⋆[ℂ] SourceAlgebraSpace θ := + (LinearIsometryEquiv.ofSurjective (sourceNormalEvaluationIsometry θ) + (sourceNormalEvaluation_surjective θ)).symm.trans (starₗᵢ ℂ) + +theorem sourceAlgebra_hasSeparablePredual (θ : SourceCoordinate → ℝ) : + HasSeparablePredual (sourceAlgebra θ) := by + refine ⟨SourceNormalPredualSpace θ,inferInstance,inferInstance,inferInstance,inferInstance,?_⟩ + exact ⟨sourcePredualIdentification θ⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedBase.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedBase.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7c2cf7bd94565572811f7ce7ef0fa5f5939967b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedBase.lean @@ -0,0 +1,39 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.OrderedTorusSampling +import OAI.Analysis.FiniteFactor.CrossedProduct.FreeRotation +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseCoverage +import OAI.Analysis.FiniteFactor.CrossedProduct.GeneratedAlgebra +import OAI.Analysis.FiniteFactor.CrossedProduct.HilbertSeparable +import OAI.Analysis.FiniteFactor.CrossedProduct.VacuumFunctional + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- One fixed realization supplies phases, rational independence, ordered +sampling and the actual nonzero quasinilpotent operator in its generated +algebra, before any candidate invariant projection. Factor and predual +properties are not included: they remain obligations about this algebra. -/ +theorem exists_source_prepared_base : ∃ θ : SourceCoordinate → ℝ, + SourceRationalIndependent θ ∧ + (∃ j : ℕ, SourceSecondPhasesFrom θ j) ∧ + SourceOrderedTorusSampling θ ∧ + (∀ k : ℤ, MeasurePreserving (coordinateRotate θ k) sourceSamplingHaar sourceSamplingHaar) ∧ + (∀ k : ℤ, k ≠ 0 → ∀ x, coordinateRotate θ k x ≠ x) ∧ + ∃ hθ : SourceAngles θ, + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ∈ sourceAlgebra θ ∧ T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + have hall := sourceAngleLaw_admissible.and (sourceAngleLaw_rationalIndependent.and + (sourceAngleLaw_second_phases_from.and sourceOrderedTorusSampling_event)) + obtain ⟨θ,ha,hr,hp,hs⟩ := hall.exists + exact ⟨θ,hr,hp,hs,fun k => coordinateRotate_preserving θ k, + fun k hk x => hr.rotation_free k hk x,ha,staged_sourceOperator_mem θ ha, + staged_sourceOperator_properties θ ha⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedErgodic.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedErgodic.lean new file mode 100644 index 0000000000000000000000000000000000000000..c99ddcfe2096d3b248226e520eb63d4a08e69082 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedErgodic.lean @@ -0,0 +1,35 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PreparedFinite +import OAI.Analysis.FiniteFactor.CrossedProduct.ScalarCenter +import OAI.Analysis.FiniteFactor.CrossedProduct.PredualIdentification +import OAI.Analysis.FiniteFactor.CrossedProduct.InvariantConull + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- The actual source construction now includes proved ergodicity, scalar center, +finiteness and the exact separable predual. No minimal-projection or arbitrary +invariant-projection conclusion is asserted here. -/ +theorem exists_source_prepared_ergodic : ∃ θ : SourceCoordinate → ℝ, + SourceRationalIndependent θ ∧ + (∃ j : ℕ, SourceSecondPhasesFrom θ j) ∧ + SourceOrderedTorusSampling θ ∧ + Ergodic (coordinateRotate θ 1) sourceBaseMeasure ∧ + HasScalarCenter (sourceAlgebra θ) ∧ + IsFiniteAlgebra (sourceAlgebra θ) ∧ + HasSeparablePredual (sourceAlgebra θ) ∧ + ∃ hθ : SourceAngles θ, + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ∈ sourceAlgebra θ ∧ T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + obtain ⟨θ,hr,hphase,hs,_hm,_hfree,hfinite,_htrace,hT⟩ := exists_source_prepared_finite + exact ⟨θ,hr,hphase,hs,coordinateRotate_ergodic θ hr,sourceAlgebra_hasScalarCenter θ hr, + hfinite,sourceAlgebra_hasSeparablePredual θ,hT⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedFactor.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedFactor.lean new file mode 100644 index 0000000000000000000000000000000000000000..bd2f5fa713a68e1bfba8b674b712a42025932ace --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedFactor.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PreparedErgodic +import OAI.Analysis.FiniteFactor.CrossedProduct.NoMinimalProjection + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +theorem exists_source_prepared_factor : ∃ θ : SourceCoordinate → ℝ, + SourceRationalIndependent θ ∧ + (∃ j : ℕ, SourceSecondPhasesFrom θ j) ∧ + SourceOrderedTorusSampling θ ∧ + Ergodic (coordinateRotate θ 1) sourceBaseMeasure ∧ + HasScalarCenter (sourceAlgebra θ) ∧ + IsFiniteAlgebra (sourceAlgebra θ) ∧ + HasNoMinimalProjection (sourceAlgebra θ) ∧ + HasSeparablePredual (sourceAlgebra θ) ∧ + ∃ hθ : SourceAngles θ, + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ∈ sourceAlgebra θ ∧ T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + obtain ⟨θ,hr,hphase,hs,he,hcenter,hfinite,hpredual,hT⟩ := exists_source_prepared_ergodic + exact ⟨θ,hr,hphase,hs,he,hcenter,hfinite,sourceAlgebra_hasNoMinimalProjection θ,hpredual,hT⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedFinite.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedFinite.lean new file mode 100644 index 0000000000000000000000000000000000000000..f502e267748c212f9db07518564d4596a3e30966 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/PreparedFinite.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PreparedBase +import OAI.Analysis.FiniteFactor.CrossedProduct.TracialRepresentation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- One actual finite tracial source algebra, with the sampled rotation and +nonzero quasinilpotent operator. Scalar center, no minimal projections, +separable predual and the invariant-projection conclusion remain separate. -/ +theorem exists_source_prepared_finite : ∃ θ : SourceCoordinate → ℝ, + SourceRationalIndependent θ ∧ + (∃ j : ℕ, SourceSecondPhasesFrom θ j) ∧ + SourceOrderedTorusSampling θ ∧ + (∀ k : ℤ, MeasurePreserving (coordinateRotate θ k) sourceSamplingHaar sourceSamplingHaar) ∧ + (∀ k : ℤ, k ≠ 0 → ∀ x, coordinateRotate θ k x ≠ x) ∧ + IsFiniteAlgebra (sourceAlgebra θ) ∧ + Nonempty (TracialRepresentation (sourceAlgebra θ)) ∧ + ∃ hθ : SourceAngles θ, + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ∈ sourceAlgebra θ ∧ T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + obtain ⟨θ,hr,hp,hs,hm,hf,ho⟩ := exists_source_prepared_base + exact ⟨θ,hr,hp,hs,hm,hf,sourceAlgebra_finite θ,⟨sourceTracialRepresentation θ⟩,ho⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionColumns.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionColumns.lean new file mode 100644 index 0000000000000000000000000000000000000000..07c43abfdd5bb2516bf0640fd44c0cd2af9cfa7b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionColumns.lean @@ -0,0 +1,61 @@ +import OAI.Analysis.FiniteFactor.BiasedPairs.RealIdentity +import OAI.Analysis.FiniteFactor.Fiber.ProjectionDiagonal +import OAI.Analysis.FiniteFactor.Convolution + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +open scoped ComplexConjugate +noncomputable section + +def sourceProjectionColumn + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (x : SourceCoordinate → ℝ) : SourceFiberHilbert := sourceOperatorField p x (lp.single 2 0 (1 : ℂ)) + +def sourceComplementColumn + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (x : SourceCoordinate → ℝ) : SourceFiberHilbert := (1-sourceOperatorField p x) (lp.single 2 0 (1 : ℂ)) + +def sourceProjectionLeftCoefficient (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (x : SourceCoordinate → ℝ) (k : ℤ) : ℂ := + leftCoefficient (fun k => sourceCocycle θ sourceLogWeight k x) (sourceProjectionColumn p x) k + +def sourceProjectionRightCoefficient (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (y : SourceCoordinate → ℝ) (k : ℤ) : ℂ := + rightCoefficient (fun k => sourceCocycle θ sourceLogWeight k y) (sourceComplementColumn p y) k + +theorem fiberProjection_column_norm_le_one + (P : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (hP : IsStarProjection P) (k : ℤ) : + ‖P (lp.single 2 k (1 : ℂ))‖ ≤ 1 := by + have hd := (fiberProjection_diagonal_bounds P hP k).2.1 + have he := congrArg Complex.re (fiberProjection_diagonal_inner P hP k) + rw [show ∀ v : SourceFiberHilbert, (inner ℂ v v).re = ‖v‖^2 from inner_self_eq_norm_sq (𝕜 := ℂ)] at he + nlinarith [norm_nonneg (P (lp.single 2 k (1 : ℂ)))] + +theorem sourceProjection_columns_norm (θ : SourceCoordinate → ℝ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) : + ∀ᵐ x ∂sourceBaseMeasure, ‖sourceProjectionColumn p x‖ ≤ 1 ∧ ‖sourceComplementColumn p x‖ ≤ 1 := by + filter_upwards [sourceOperatorField_projection θ hp hproj] with x hx + exact ⟨fiberProjection_column_norm_le_one _ hx 0,fiberProjection_column_norm_le_one _ hx.one_sub 0⟩ + +theorem sourceProjectionLeftCoefficient_measurable (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (k : ℤ) : + Measurable (fun x => sourceProjectionLeftCoefficient θ p x k) := + (sourceOperatorField_entry_measurable p k 0).div + (Complex.continuous_ofReal.measurable.comp (sourceCocycle_measurable θ sourceLogWeight k)) + +theorem sourceProjectionRightCoefficient_measurable (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (k : ℤ) : + Measurable (fun y => sourceProjectionRightCoefficient θ p y k) := by + apply (Complex.continuous_ofReal.measurable.comp (sourceCocycle_measurable θ sourceLogWeight (-k))).mul + exact Complex.continuous_conj.measurable.comp + (measurable_const.sub (sourceOperatorField_entry_measurable p (-k) 0)) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionConvolution.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..6b28c76d22f00a97b037f34066350b6d05755cf8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionConvolution.lean @@ -0,0 +1,74 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionColumns +import OAI.Analysis.FiniteFactor.CrossedProduct.ConvolutionCocycle +import OAI.Analysis.FiniteFactor.Fiber.TransportConvolution + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ComplexConjugate ENNReal +noncomputable section + +/-- The original coefficient sequences satisfy every nonnegative convolution +identity under the actual augmented biased law, with absolute sum at most one. +This instantiates the range and weight hypotheses from the constructed algebra. -/ +theorem sourceProjection_convolution (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ∀ n : ℕ, + (∑' k : ℤ, sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) k * + sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) (-(n : ℤ)-k)) = 0 ∧ + Summable (fun k : ℤ => ‖sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) k * + sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) (-(n : ℤ)-k)‖) ∧ + (∑' k : ℤ, ‖sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) k * + sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) (-(n : ℤ)-k)‖) ≤ 1 := by + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + have hInv : ∀ᵐ y ∂sourceBaseMeasure, ∀ n : ℕ, + (1-sourceOperatorField p y)*sourceOperatorField (T^n) y*sourceOperatorField p y = 0 := by + apply ae_all_iff.mpr + intro n + exact sourceOperatorField_invariant θ hp (pow_mem (staged_sourceOperator_mem θ hθ) n) + (invariant_projection_pow p T hproj.isIdempotentElem hinv n) + have hAct := ae_all_iff.mpr (sourceOperatorField_sourceOperator_pow θ hθ) + filter_upwards [sourceProjection_biased_ratio_augmented θ hθ hs hp hproj hinv j, + sourceBiasedEndpoint_ae j (fun _ => false) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => true) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedLaw_ordered j, + sourceBiasedEndpoint_ae j (fun _ => true) (sourceOperatorField_projection θ hp hproj), + sourceBiasedEndpoint_ae j (fun _ => true) hInv, + sourceBiasedEndpoint_ae j (fun _ => true) hAct, + sourceBiasedEndpoint_ae j (fun _ => false) (sourceProjection_columns_norm θ hp hproj), + sourceBiasedEndpoint_ae j (fun _ => true) (sourceProjection_columns_norm θ hp hproj)] + with ω hD hfx hfy hord hPy hi ha hnx hny + intro n + let x := sourceBiasedEndpoint (fun _ => false) ω + let y := sourceBiasedEndpoint (fun _ => true) ω + have hxy : ∀ i, x i ≤ y i := hord + obtain ⟨D,_hDn,hDa,hd⟩ := hD + have hz : (∑' k : ℤ, sourceProjectionLeftCoefficient θ p x k * + sourceProjectionRightCoefficient θ p y (-(n : ℤ)-k)) = 0 := by + apply fiber_transport_convolution_zero (sourceOperatorField p x) (sourceOperatorField p y) D + (sourceOperatorField (T^n) y) hPy + (fun k => sourceCocycle θ sourceLogWeight k x) (fun k => sourceCocycle θ sourceLogWeight k y) + (fun k => ne_of_gt (sourceCocycle_pos ..)) (n : ℤ) hd (hi n) hDa + intro v k + have hk : (n : ℤ)+k-(n : ℤ) = k := by omega + rw [ha n v ((n : ℤ)+k),hk,sourceCocycle_power_weight θ sourceLogWeight hfy n k,Complex.ofReal_div] + obtain ⟨habs,hbound⟩ := cocycle_convolution_absolute_convergence + (sourceProjectionColumn p x) (sourceComplementColumn p y) + (fun k => sourceCocycle_pos θ sourceLogWeight k x) + (fun k => sourceCocycle_pos θ sourceLogWeight k y) + (sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfx) + (sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfy) + (sourceCocycle_ordered θ sourceLogWeight sourceLogWeight_nonneg hfx hfy hxy) + (n := (n : ℤ)) (by omega) + refine ⟨hz,habs,hbound.trans ?_⟩ + exact (mul_le_mul hnx.1 hny.2 (norm_nonneg _) (by norm_num)).trans_eq (one_mul 1) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionDiagonal.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..33dc7ce3c8e12db50ae7e23282c9f5c4253060a6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionDiagonal.lean @@ -0,0 +1,131 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ScalarCenter +import OAI.Analysis.FiniteFactor.Fiber.ProjectionDiagonal +import OAI.Analysis.FiniteFactor.CrossedProduct.OrbitNormalization +import OAI.Analysis.FiniteFactor.CrossedProduct.VacuumSeparating + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- Faithfulness turns a zero diagonal almost everywhere into the zero projection. -/ +theorem sourceProjection_zero_of_diagonal_zero (θ : SourceCoordinate → ℝ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hz : sourceCentralCoefficient p =ᵐ[sourceBaseMeasure] fun _ => 0) : p = 0 := by + apply (sourceVacuumFunctional_square_eq_zero_iff θ hp).mp + rw [hproj.isSelfAdjoint.star_eq,hproj.isIdempotentElem,sourceVacuumFunctional_fieldIntegral θ hp] + change (∫ x, sourceCentralCoefficient p x ∂sourceBaseMeasure) = 0 + rw [integral_congr_ae hz,integral_zero] + +theorem sourceProjection_one_of_diagonal_one (θ : SourceCoordinate → ℝ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hz : sourceCentralCoefficient p =ᵐ[sourceBaseMeasure] fun _ => 1) : p = 1 := by + have hsub := sub_mem (one_mem (sourceAlgebra θ)) hp + have hh : sourceCentralCoefficient (1-p) =ᵐ[sourceBaseMeasure] fun _ => 0 := by + filter_upwards [sourceOperatorField_sub θ (one_mem (sourceAlgebra θ)) hp, + sourceOperatorField_one θ,hz] with x hs h1 hz + unfold sourceCentralCoefficient at * + rw [hs,h1] + change (lp.single 2 0 (1 : ℂ) : SourceFiberHilbert) 0 - sourceOperatorField p x (lp.single 2 0 (1 : ℂ)) 0 = 0 + simp [hz,lp.single_apply] + exact (sub_eq_zero.mp (sourceProjection_zero_of_diagonal_zero θ hsub hproj.one_sub hh)).symm + +/-- The diagonal's zero event is backwards invariant and its one event forwards +invariant. Both implications follow from the original invariant operator. -/ +theorem sourceProjection_diagonal_rotation_implications + (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∀ᵐ x ∂sourceBaseMeasure, + (sourceCentralCoefficient p (coordinateRotate θ 1 x) = 0 → sourceCentralCoefficient p x = 0) ∧ + (sourceCentralCoefficient p x = 1 → sourceCentralCoefficient p (coordinateRotate θ 1 x) = 1) := by + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + have hw := sourceOperatorField_sourceOperator_pow θ hθ 1 + simp only [pow_one,Nat.cast_one] at hw + filter_upwards [sourceOperatorField_projection θ hp hproj, + (coordinateRotate_preserving θ 1).quasiMeasurePreserving.ae (sourceOperatorField_projection θ hp hproj), + sourceOperatorField_invariant θ hp (staged_sourceOperator_mem θ hθ) hinv, + sourceOperatorField_covariance θ hp,hw] with x hpx hqx hi hc hw + let P := sourceOperatorField p x + let Q := sourceOperatorField p (coordinateRotate θ 1 x) + let D := fiberShift (-1) * sourceOperatorField T x + have hcov : fiberShift (-1)*P = Q*fiberShift (-1) := + fiber_covariance_operator P Q 1 (fun k m => hc 1 m k) + have hrot : (1-Q)*D*P = 0 := fiber_rotated_invariant P Q _ 1 hcov hi + have hd (v : SourceFiberHilbert) (k : ℤ) : D v k = + (sourceCocycle θ sourceLogWeight 1 (coordinateRotate θ k x) : ℂ) * v k := by + change sourceOperatorField T x v (k-(-1)) = _ + rw [hw] + simp + let a : ℂ := sourceCocycle θ sourceLogWeight 1 (coordinateRotate θ 0 x) + have ha : a ≠ 0 := by + dsimp [a] + exact_mod_cast (sourceCocycle_pos θ sourceLogWeight 1 (coordinateRotate θ 0 x)).ne' + apply fiberProjection_diagonal_implications P Q D hpx hqx hrot a ha (fun v => hd v 0) + apply Subtype.ext + funext k + rw [hd] + change _ = a * (lp.single 2 0 (1 : ℂ) : SourceFiberHilbert) k + by_cases hk : k = 0 + · subst k; rfl + · simp [lp.single_apply,Pi.single_eq_of_ne hk] + +theorem sourceProjection_strict_diagonal + (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) (hr : SourceRationalIndependent θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (hp0 : p ≠ 0) (hp1 : p ≠ 1) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∀ᵐ x ∂sourceBaseMeasure, + 0 < (sourceCentralCoefficient p x).re ∧ (sourceCentralCoefficient p x).re < 1 ∧ + (sourceCentralCoefficient p x).im = 0 := by + have he := coordinateRotate_ergodic θ hr + have hm := sourceCentralCoefficient_measurable p + have hi := sourceProjection_diagonal_rotation_implications θ hθ hp hproj hinv + have hn0 : ∀ᵐ x ∂sourceBaseMeasure, sourceCentralCoefficient p x ≠ 0 := by + have hh := he.ae_empty_or_univ_of_preimage_ae_le + (s := {x | sourceCentralCoefficient p x = 0}) (measurableSet_eq_fun hm measurable_const).nullMeasurableSet + (hi.mono fun x hx => hx.1) + rcases hh with hh | hh + · filter_upwards [hh] with x hx + change (sourceCentralCoefficient p x = 0) = False at hx + exact fun h => (Eq.mp hx h).elim + · exfalso + apply hp0 (sourceProjection_zero_of_diagonal_zero θ hp hproj ?_) + filter_upwards [hh] with x hx + exact Eq.mpr hx trivial + have hn1 : ∀ᵐ x ∂sourceBaseMeasure, sourceCentralCoefficient p x ≠ 1 := by + have hh := he.ae_empty_or_univ_of_ae_le_preimage + (s := {x | sourceCentralCoefficient p x = 1}) (measurableSet_eq_fun hm measurable_const).nullMeasurableSet + (hi.mono fun x hx => hx.2) + rcases hh with hh | hh + · filter_upwards [hh] with x hx + change (sourceCentralCoefficient p x = 1) = False at hx + exact fun h => (Eq.mp hx h).elim + · exfalso + apply hp1 (sourceProjection_one_of_diagonal_one θ hp hproj ?_) + filter_upwards [hh] with x hx + exact Eq.mpr hx trivial + filter_upwards [sourceOperatorField_projection θ hp hproj,hn0,hn1] with x hx h0 h1 + have hb := fiberProjection_diagonal_bounds _ hx 0 + change 0 ≤ (sourceCentralCoefficient p x).re ∧ (sourceCentralCoefficient p x).re ≤ 1 ∧ + (sourceCentralCoefficient p x).im = 0 at hb + refine ⟨lt_of_le_of_ne hb.1 ?_,lt_of_le_of_ne hb.2.1 ?_,hb.2.2⟩ + · intro hh + apply h0 + apply Complex.ext + · exact hh.symm + · exact hb.2.2 + · intro hh + apply h1 + apply Complex.ext + · exact hh + · exact hb.2.2 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionErrors.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionErrors.lean new file mode 100644 index 0000000000000000000000000000000000000000..92151375e170e3a78efea3ffe5c2c78b7739851b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionErrors.lean @@ -0,0 +1,121 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionEvent +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionConvolution +import OAI.Analysis.FiniteFactor.CrossedProduct.MaskedError +import OAI.Analysis.FiniteFactor.CrossedProduct.OmittedRatio +import OAI.Analysis.FiniteFactor.Truncation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Exchange the coefficient and sample viewpoints of the same mask. -/ +theorem indicator_swap {ι Ω : Type*} (H : ι → Set Ω) (f : ι → Ω → ℝ) (i : ι) (ω : Ω) : + {k | ω ∈ H k}.indicator (fun k => f k ω) i = (H i).indicator (f i) ω := by + classical + by_cases h : ω ∈ H i + · rw [Set.indicator_of_mem (show i ∈ {k | ω ∈ H k} from h),Set.indicator_of_mem h] + · rw [Set.indicator_of_notMem (show i ∉ {k | ω ∈ H k} from h),Set.indicator_of_notMem h] + +def sourceTruncatedCoefficient (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) (n : ℤ) + (ω : SourceBiasedSample) : ℂ := + laurentProductCoefficient (sourceStageState j).K + (sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω)) + (sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω)) (-n) + +def sourceOmittedError (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n : ℤ) (b : Bool) (ω : SourceBiasedSample) : ℝ := + ∑' k : ℤ, (sourceOmittedBadEvent θ hθ j hphase n k b).indicator + (fun ω => ‖sourceProjectionColumn p (sourceBiasedEndpoint (fun _ => false) ω) k‖ * + ‖sourceComplementColumn p (sourceBiasedEndpoint (fun _ => true) ω) (n+k)‖) ω + +theorem sourceOmittedError_nonneg (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n : ℤ) (b : Bool) (ω) : + 0 ≤ sourceOmittedError θ hθ p j hphase n b ω := + tsum_nonneg (fun _k => Set.indicator_nonneg (fun _ _ => mul_nonneg (norm_nonneg _) (norm_nonneg _)) ω) + +/-- Both actual infinite error sums are integrable and have the source bound. -/ +theorem sourceOmittedError_estimate (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n : ℤ) (b : Bool) : + Integrable (sourceOmittedError θ hθ p j hphase n b) (sourceBiasedLaw j) ∧ + (∫ ω, sourceOmittedError θ hθ p j hphase n b ω ∂sourceBiasedLaw j) ≤ Real.exp (-(sourceStage j).L/800) := by + unfold sourceOmittedError + cases b + · simpa only [sourceOmittedError,sourceColumn,Bool.false_eq_true,↓reduceIte,Bool.not_false,zero_add] using + sourceOmitted_masked_error θ hθ hp hproj j hphase n 0 n false + · simpa only [sourceOmittedError,sourceColumn,Bool.false_eq_true,↓reduceIte,Bool.not_true,zero_add,mul_comm] using + sourceOmitted_masked_error θ hθ hp hproj j hphase n n 0 true + +theorem sourceProjectionEvent_error_pointwise (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j : ℕ) (hphase : SourceSecondPhasesFrom θ j) (n : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceProjectionEvent p j → + ‖sourceTruncatedCoefficient θ p j n ω‖ ≤ Real.exp (-(sourceStage j).L) + + sourceOmittedError θ hθ p j hphase n false ω + sourceOmittedError θ hθ p j hphase n true ω := by + let H := fun b v => sourceOmittedBadEvent θ hθ j hphase (n : ℤ) v b + have hratio : ∀ᵐ ω ∂sourceBiasedLaw j, ∀ v : ℤ, + v ∉ convolutionWindow (sourceStageState j).K n → ω ∈ sourceTagEndpointEvent j → + sourceCocycle θ sourceLogWeight ((n : ℤ)+v) (sourceBiasedEndpoint (fun _ => true) ω) / + sourceCocycle θ sourceLogWeight v (sourceBiasedEndpoint (fun _ => false) ω) ≤ + Real.exp (-(sourceStage j).L)+(H false v).indicator (fun _ => (1 : ℝ)) ω+ + (H true v).indicator (fun _ => (1 : ℝ)) ω := by + apply ae_all_iff.mpr + intro v + by_cases hv : v ∉ convolutionWindow (sourceStageState j).K n + · exact (sourceOmitted_ratio_bound θ hθ j hphase n v (by omega) + ((not_mem_convolutionWindow _ _ _).mp hv)).mono (fun ω h _ => h) + · exact Eventually.of_forall (fun ω h => (hv h).elim) + filter_upwards [hratio,sourceProjection_convolution θ hθ hs hp hproj hinv j, + sourceTaggedEvent_endpoints j,sourceBiasedLaw_ordered j, + sourceBiasedEndpoint_ae j (fun _ => false) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => true) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => false) (sourceProjection_columns_norm θ hp hproj), + sourceBiasedEndpoint_ae j (fun _ => true) (sourceProjection_columns_norm θ hp hproj)] + with ω hr hc ht hxy hfx hfy hnx hny + intro he + let x := sourceBiasedEndpoint (fun _ => false) ω + let y := sourceBiasedEndpoint (fun _ => true) ω + have hind (b : Bool) (v : ℤ) : + {k | ω ∈ H b k}.indicator (fun _ => (1 : ℝ)) v = (H b v).indicator (fun _ => (1 : ℝ)) ω := + indicator_swap (H b) (fun _ _ => (1 : ℝ)) v ω + have hmask (b : Bool) (v : ℤ) : + {k | ω ∈ H b k}.indicator + (fun k => ‖sourceProjectionColumn p x k‖*‖sourceComplementColumn p y ((n : ℤ)+k)‖) v = + (H b v).indicator (fun ω => + ‖sourceProjectionColumn p (sourceBiasedEndpoint (fun _ => false) ω) v‖* + ‖sourceComplementColumn p (sourceBiasedEndpoint (fun _ => true) ω) ((n : ℤ)+v)‖) ω := by + by_cases h : ω ∈ H b v + · rw [Set.indicator_of_mem (show v ∈ {k | ω ∈ H b k} from h),Set.indicator_of_mem h] + · rw [Set.indicator_of_notMem (show v ∉ {k | ω ∈ H b k} from h),Set.indicator_of_notMem h] + have hh := laurent_error_pointwise (sourceStageState j).K (n : ℤ) + (sourceProjectionColumn p x) (sourceComplementColumn p y) + (fun k => sourceCocycle_pos θ sourceLogWeight k x) (fun k => sourceCocycle_pos θ sourceLogWeight k y) + (sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfx) + (sourceCocycle_antitone θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg hfy) + (sourceCocycle_ordered θ sourceLogWeight sourceLogWeight_nonneg hfx hfy hxy) + (by omega : (0 : ℤ) ≤ n) (H₁ := {v | ω ∈ H false v}) (H₂ := {v | ω ∈ H true v}) + (Real.exp_pos (-(sourceStage j).L)).le (hc n).1 + (fun v hv => by rw [hind false v,hind true v]; exact hr v hv (ht he.1.1)) + simp_rw [hmask] at hh + change ‖sourceTruncatedCoefficient θ p j n ω‖ ≤ + Real.exp (-(sourceStage j).L)*(‖sourceProjectionColumn p x‖*‖sourceComplementColumn p y‖)+ + sourceOmittedError θ hθ p j hphase n false ω+sourceOmittedError θ hθ p j hphase n true ω at hh + have hnorm : ‖sourceProjectionColumn p x‖*‖sourceComplementColumn p y‖ ≤ 1 := by + simpa only [one_mul] using mul_le_mul hnx.1 hny.2 (norm_nonneg _) (by norm_num : (0 : ℝ) ≤ 1) + have hbound := mul_le_mul_of_nonneg_left hnorm (Real.exp_pos (-(sourceStage j).L)).le + linarith + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionEvent.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionEvent.lean new file mode 100644 index 0000000000000000000000000000000000000000..fde5b4352bad94f9934aa48b7b641904d97af057 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionEvent.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiniteCoefficients +import OAI.Analysis.FiniteFactor.CrossedProduct.TagLaw +import OAI.Analysis.FiniteFactor.CrossedProduct.StagePolynomial + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ComplexConjugate +noncomputable section + +def sourceDiagonalEvent + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) : Set SourceBiasedSample := + {ω | 1/((j : ℝ)+1) ≤ (sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => false) ω)).re ∧ + 1/((j : ℝ)+1) ≤ 1-(sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => true) ω)).re} + +theorem sourceDiagonalEvent_measurable + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) : + MeasurableSet (sourceDiagonalEvent p j) := by + have hm (b : Bool) : Measurable (fun ω => (sourceCentralCoefficient p + (sourceBiasedEndpoint (fun _ => b) ω)).re) := + Complex.continuous_re.measurable.comp ((sourceCentralCoefficient_measurable p).comp + (sourceBiasedEndpoint_measurable _)) + exact (measurableSet_le measurable_const (hm false)).inter + (measurableSet_le measurable_const (measurable_const.sub (hm true))) + +/-- The actual three conditions defining E_j in the source, with j+1 indexing. -/ +def sourceProjectionEvent + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) : Set SourceBiasedSample := + sourceTaggedEvent j ∩ sourceBoundaryEvent j ∩ sourceDiagonalEvent p j + +theorem sourceProjectionEvent_measurable + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) : + MeasurableSet (sourceProjectionEvent p j) := + ((sourceTaggedEvent_measurable j).inter (sourceBoundaryEvent_measurable j)).inter + (sourceDiagonalEvent_measurable p j) + +/-- The zero coefficient bounds use the actual diagonal and F_0=1. -/ +theorem sourceProjection_zero_coefficients (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceDiagonalEvent p j → + 1/((j : ℝ)+1) ≤ ‖sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) 0‖ ∧ + 1/((j : ℝ)+1) ≤ ‖sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) 0‖ := by + filter_upwards [sourceBiasedEndpoint_cube j (fun _ => false),sourceBiasedEndpoint_cube j (fun _ => true)] + with ω hxc hyc + intro he + constructor + · have hz : sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω) 0 = + sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => false) ω) := by + simp only [sourceProjectionLeftCoefficient,leftCoefficient,sourceCocycle_zero θ sourceLogWeight hxc, + Complex.ofReal_one,div_one] + rfl + rw [hz] + exact he.1.trans (Complex.re_le_norm _) + · have hz : sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω) 0 = + conj (1-sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => true) ω)) := by + simp only [sourceProjectionRightCoefficient,rightCoefficient,neg_zero, + sourceCocycle_zero θ sourceLogWeight hyc,Complex.ofReal_one,one_mul] + congr 1 + rw [hz,RCLike.norm_conj] + have hh := Complex.re_le_norm (1-sourceCentralCoefficient p (sourceBiasedEndpoint (fun _ => true) ω)) + exact he.2.trans (by simpa only [Complex.sub_re,Complex.one_re] using hh) + +/-- The actual source-stage polynomial lower bound holds on the exact E_j. +This theorem does not assert that E_j has positive probability. -/ +theorem sourceProjectionEvent_polynomial_lower (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceProjectionEvent p j → + (sourceStage j).ε ≤ coefficientMass (sourceStageState j).K + (sourceProjectionLeftCoefficient θ p (sourceBiasedEndpoint (fun _ => false) ω)) + (sourceProjectionRightCoefficient θ p (sourceBiasedEndpoint (fun _ => true) ω)) := by + filter_upwards [sourceProjection_finite_coefficients θ hθ hp hproj j, + sourceProjection_zero_coefficients θ p j] with ω hc hz + intro he + apply sourceStage_polynomial_lower + · intro k hklo hkhi + exact (hc he.1.2 k (by exact_mod_cast abs_le.mpr ⟨hklo,hkhi⟩)).1 + · intro k hklo hkhi + exact (hc he.1.2 k (by exact_mod_cast abs_le.mpr ⟨hklo,hkhi⟩)).2 + · exact (hz he.2).1 + · exact (hz he.2).2 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionPairIdentity.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionPairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f80e081e5b6288fe5dc5eefca46b8fbcd71d165f --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionPairIdentity.lean @@ -0,0 +1,95 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.OrbitNormalization +import OAI.Analysis.FiniteFactor.CrossedProduct.CappedTransfer + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- Every original invariant projection satisfies the normalized equation on +all its ordered positive orbit pairs, on one conull set. -/ +theorem sourceProjection_ordered_orbits (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∀ᵐ z ∂sourceTorusHaar, ∀ n : ℕ, + (∀ i, sourceTorusRepresentative z i ≤ sourceTorusRepresentative (sourceTorusRotate θ n z) i) → + (z,sourceTorusRotate θ n z) ∈ sourceCappedPairZeroSet θ p := by + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + have hf := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (ae_finiteFloorSupport θ hθ.summable) + have hc := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (sourceOperatorField_covariance θ hp) + have hi : ∀ᵐ z ∂sourceTorusHaar, ∀ n : ℕ, + (1-sourceTorusOperatorField p z)*sourceTorusOperatorField (T^n) z*sourceTorusOperatorField p z = 0 := by + rw [ae_all_iff] + intro n + exact sourceTorusOperatorField_invariant θ hp (pow_mem (staged_sourceOperator_mem θ hθ) n) + (invariant_projection_pow p T hproj.isIdempotentElem hinv n) + have hw := ae_all_iff.mpr (sourceTorusOperatorField_sourceOperator_pow θ hθ) + filter_upwards [hf,hc,hi,hw] with z hf hc hi hw n hord + have hcov : fiberShift (-(n : ℤ))*sourceTorusOperatorField p z = + sourceTorusOperatorField p (sourceTorusRotate θ n z)*fiberShift (-(n : ℤ)) := by + apply fiber_covariance_operator + intro k m + change (sourceOperatorField p (sourceTorusRepresentative (sourceTorusRotate θ n z)) + (lp.single 2 m (1 : ℂ))) k = _ + rw [sourceTorusRepresentative_rotate] + exact hc n m k + have hrot := fiber_rotated_invariant _ _ (sourceTorusOperatorField (T^n) z) n hcov (hi n) + change (1-sourceTorusOperatorField p (sourceTorusRotate θ n z))* + fiberDiagonal (sourceCappedRatio θ (z,sourceTorusRotate θ n z)) + (sourceCappedRatio_norm θ (z,sourceTorusRotate θ n z))*sourceTorusOperatorField p z = 0 + rw [sourceCappedRatio_orbit_diagonal θ z n hf hord _ (hw n)] + ext1 vector + have hv := congrArg (fun operator : SourceFiberHilbert →L[ℂ] SourceFiberHilbert => + operator vector) hrot + dsimp only [T] at hv + simp only [mul_apply_eq_comp, zero_apply] at hv + simp only [mul_apply_eq_comp, smul_apply, map_smul, zero_apply, hv, smul_zero] + +/-- The approximant equations follow from the original invariant projection, +the actual positive orbit support, and absolute continuity of the first +marginal. They are not assumed as a transfer premise. -/ +theorem sourceProjection_sampling_pairs (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (I : Finset SourceCoordinate) (s : ℕ) : + ∀ᵐ z ∂(sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus), + z ∈ sourceCappedPairZeroSet θ p := by + obtain ⟨C,hC⟩ := hs.marginals I false + obtain ⟨g,_,_,hg,_,_⟩ := hC s + have hac : (sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus).map Prod.fst ≪ + sourceTorusHaar := by + change (sourceSamplingTrimmedTorus I s θ : Measure SourceSamplingTorus).map + (sourceTorusEndpoint false) ≪ _ + rw [hg] + exact withDensity_absolutelyContinuous _ _ + have horbit := ae_of_ae_map measurable_fst.aemeasurable + (hac.ae_le (sourceProjection_ordered_orbits θ hθ hp hproj hinv)) + filter_upwards [horbit,hs.support I s] with z hz hsupport + obtain ⟨hord,n,hn,hnpos,he⟩ := hsupport + have hn0 : 0 ≤ n := le_of_lt hnpos + have hncast : (n.toNat : ℤ) = n := Int.toNat_of_nonneg hn0 + have hh := hz n.toNat + rw [hncast, ← he] at hh + exact hh hord + +theorem sourceProjection_lambda_pairs (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (I : Finset SourceCoordinate) : + ∀ᵐ z ∂(sourceSamplingLambdaTorus I : Measure SourceSamplingTorus), + z ∈ sourceCappedPairZeroSet θ p := + sourceCappedPair_limit_transfer hs I p (sourceProjection_sampling_pairs θ hθ hs hp hproj hinv I) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionPositiveConull.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionPositiveConull.lean new file mode 100644 index 0000000000000000000000000000000000000000..fd40867bdc0f430c22ffbb0dbe4e41a7ec7543c8 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ProjectionPositiveConull.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionDiagonal +import OAI.Analysis.FiniteFactor.CrossedProduct.InvariantConull + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- The strict diagonal conclusion and every previously verified orbit identity +hold on one invariant Borel conull set for the original candidate projection. -/ +theorem sourceProjection_positive_common_conull + (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) (hr : SourceRationalIndependent θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) (hp0 : p ≠ 0) (hp1 : p ≠ 1) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) : + ∃ Q : Set SourceTorus, MeasurableSet Q ∧ (∀ᵐ z ∂sourceTorusHaar, z ∈ Q) ∧ + (∀ z ∈ Q, + finiteFloorSupport θ (sourceTorusRepresentative z) ∧ + IsStarProjection (sourceTorusOperatorField p z) ∧ + (∀ r k m : ℤ, (sourceTorusOperatorField p (sourceTorusRotate θ r z) + (lp.single 2 m (1 : ℂ))) k = + (sourceTorusOperatorField p z (lp.single 2 (m+r) (1 : ℂ))) (k+r)) ∧ + (∀ n : ℕ, (∀ i, sourceTorusRepresentative z i ≤ + sourceTorusRepresentative (sourceTorusRotate θ n z) i) → + (z,sourceTorusRotate θ n z) ∈ sourceCappedPairZeroSet θ p) ∧ + 0 < (sourceCentralCoefficient p (sourceTorusRepresentative z)).re ∧ + (sourceCentralCoefficient p (sourceTorusRepresentative z)).re < 1 ∧ + (sourceCentralCoefficient p (sourceTorusRepresentative z)).im = 0) ∧ + (∀ n : ℤ, ∀ z ∈ Q, sourceTorusRotate θ n z ∈ Q) := by + obtain ⟨Q,hQ,hQa,hQp,_⟩ := sourceProjection_common_conull θ hθ hp hproj hinv + have hd := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (sourceProjection_strict_diagonal θ hθ hr hp hproj hp0 hp1 hinv) + obtain ⟨R,hR,hRa,hRp,hRi⟩ := exists_source_invariant_conull θ + (fun z => z ∈ Q ∧ 0 < (sourceCentralCoefficient p (sourceTorusRepresentative z)).re ∧ + (sourceCentralCoefficient p (sourceTorusRepresentative z)).re < 1 ∧ + (sourceCentralCoefficient p (sourceTorusRepresentative z)).im = 0) (hQa.and hd) + refine ⟨R,hR,hRa,?_,hRi⟩ + intro z hz + have hh := hQp z (hRp z hz).1 + exact ⟨hh.1,hh.2.1,hh.2.2.1,hh.2.2.2,(hRp z hz).2⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ReferenceMixture.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ReferenceMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..51b2ceeb242a0a0a6294d01db0ed2260102fb5d1 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ReferenceMixture.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.FiniteFactor.FiniteProductMixture +import OAI.Analysis.FiniteFactor.BiasedPairs.ReferenceDomination + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory CouplingParameters Finset +open scoped ENNReal +noncomputable section + +def sourceResamplingKernel (I : Finset SourceCoordinate) : + Kernel (SourceCoordinate → ℝ) (SourceCoordinate → ℝ) := by + letI : ∀ i : SourceCoordinate, IsMarkovKernel + (if i ∈ I then Kernel.const ℝ unitIntervalMeasure else Kernel.id) := + fun i => by split_ifs <;> infer_instance + exact independentKernel (fun i : SourceCoordinate => + if i ∈ I then Kernel.const ℝ unitIntervalMeasure else Kernel.id) + +instance sourceResamplingKernel_markov (I : Finset SourceCoordinate) : + IsMarkovKernel (sourceResamplingKernel I) := by + unfold sourceResamplingKernel + infer_instance + +theorem sourceResamplingKernel_apply (I : Finset SourceCoordinate) (x : SourceCoordinate → ℝ) : + sourceResamplingKernel I x = finiteChoiceLaw (fun i => Measure.dirac (x i)) + (fun _ => unitIntervalMeasure) I := by + dsimp [sourceResamplingKernel,independentKernel,finiteChoiceLaw] + congr 1 + funext i + by_cases hi : i ∈ I <;> simp [hi]; rfl + +theorem sourceFiniteReferenceKernel_apply (F : Finset SourceCoordinate) (x : SourceCoordinate → ℝ) : + sourceFiniteReferenceKernel F x = finiteAverageLaw (fun i => Measure.dirac (x i)) + (fun _ => unitIntervalMeasure) F := by + dsimp [sourceFiniteReferenceKernel,independentKernel,finiteAverageLaw] + congr 1 + funext i + by_cases hi : i ∈ F + · simp only [ite_eq_left hi] + rfl + · simp only [ite_eq_right hi] + rfl + +/-- The exact finite replacement-pattern expansion of the reference kernel. -/ +theorem sourceFiniteReferenceKernel_mixture (F : Finset SourceCoordinate) (x : SourceCoordinate → ℝ) : + sourceFiniteReferenceKernel F x = ((2 : ℝ≥0∞)⁻¹)^F.card • + ∑ I ∈ F.powerset, sourceResamplingKernel I x := by + rw [sourceFiniteReferenceKernel_apply,finiteAverageLaw_eq_sum] + simp_rw [sourceResamplingKernel_apply] + +/-- Integrating over the actual Haar base preserves the finite mixture formula. -/ +theorem sourceFiniteReference_compProd_mixture (F : Finset SourceCoordinate) : + sourceSamplingHaar ⊗ₘ sourceFiniteReferenceKernel F = + ((2 : ℝ≥0∞)⁻¹)^F.card • + ∑ I ∈ F.powerset, sourceSamplingHaar ⊗ₘ sourceResamplingKernel I := by + apply Measure.ext + intro S hS + rw [Measure.compProd_apply hS,Measure.smul_apply,Measure.finsetSum_apply,smul_eq_mul] + simp_rw [sourceFiniteReferenceKernel_mixture,Measure.smul_apply,Measure.finsetSum_apply,smul_eq_mul] + rw [lintegral_const_mul _ (Finset.measurable_sum _ fun I _ => + Kernel.measurable_kernel_prodMk_left hS), + lintegral_finsetSum F.powerset (fun I _ => Kernel.measurable_kernel_prodMk_left hS)] + congr 1 + apply Finset.sum_congr rfl + intro I hI + exact (Measure.compProd_apply hS).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ReferenceOrdered.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ReferenceOrdered.lean new file mode 100644 index 0000000000000000000000000000000000000000..a2e5efb269ac4eb7c9c38b320d3dae2e287e54c2 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ReferenceOrdered.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ResamplingLaw + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter ProbabilityTheory CouplingParameters +open scoped ENNReal +noncomputable section + +/-- The independent Haar pair has no equality boundary at any coordinate. -/ +theorem sourceSamplingPairHaar_coordinate_ne : + ∀ᵐ z ∂sourceSamplingPairHaar, ∀ i, (z i).1 ≠ (z i).2 := by + let : NullSingletonClass unitIntervalMeasure := by unfold unitIntervalMeasure; infer_instance + apply ae_all_iff.mpr + intro i + have hp : ∀ᵐ z ∂unitIntervalMeasure.prod unitIntervalMeasure, z.1 ≠ z.2 := by + apply (Measure.ae_prod_iff_ae_ae (isClosed_eq continuous_fst continuous_snd).measurableSet.compl).mpr + apply Eventually.of_forall + intro x + have hh : ∀ᵐ y ∂unitIntervalMeasure, y ≠ x := by + rw [ae_iff] + simp + exact hh.mono fun y hy => hy.symm + exact (measurePreserving_eval_infinitePi + (fun _ : SourceCoordinate => unitIntervalMeasure.prod unitIntervalMeasure) i).quasiMeasurePreserving.ae hp + +/-- Strict and non-strict order coincide for the replacement coordinates. -/ +theorem sourceSamplingLimit_order_event (I : Finset SourceCoordinate) : + (sourceSamplingLimitMap I ⁻¹' sourceSamplingOrdered) =ᵐ[sourceSamplingPairHaar] + sourceSamplingTriangleSet I := by + filter_upwards [sourceSamplingPairHaar_coordinate_ne] with z hz + apply propext + change (∀ i, (z i).1 ≤ if i ∈ I then (z i).2 else (z i).1) ↔ + (∀ i ∈ I, (z i).1 < (z i).2) + constructor + · intro h i hi + exact lt_of_le_of_ne (by simpa [hi] using h i) (hz i) + · intro h i + by_cases hi : i ∈ I + · simpa [hi] using (h i hi).le + · simp [hi] + +theorem sourceResampling_ordered_restriction (I : Finset SourceCoordinate) : + (sourceSamplingHaar ⊗ₘ sourceResamplingKernel I).restrict sourceSamplingOrdered = + sourceSamplingLambda I := by + rw [sourceResampling_compProd_eq_map, + Measure.restrict_map (sourceSamplingLimitMap_measurable I) sourceSamplingOrdered_measurable, + Measure.restrict_congr_set (sourceSamplingLimit_order_event I)] + rfl + +/-- Exact finite-prefix reference mixture after imposing global order. -/ +theorem sourceFiniteReference_ordered_mixture (F : Finset SourceCoordinate) : + (sourceSamplingHaar ⊗ₘ sourceFiniteReferenceKernel F).restrict sourceSamplingOrdered = + ((2 : ℝ≥0∞)⁻¹)^F.card • ∑ I ∈ F.powerset, sourceSamplingLambda I := by + have hs : (∑ I ∈ F.powerset, sourceSamplingHaar ⊗ₘ sourceResamplingKernel I).restrict sourceSamplingOrdered = + ∑ I ∈ F.powerset, (sourceSamplingHaar ⊗ₘ sourceResamplingKernel I).restrict sourceSamplingOrdered := + map_sum (Measure.restrictₗ sourceSamplingOrdered) _ _ + rw [sourceFiniteReference_compProd_mixture,Measure.restrict_smul,hs] + simp_rw [sourceResampling_ordered_restriction] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Reflection.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Reflection.lean new file mode 100644 index 0000000000000000000000000000000000000000..c21cc707550a73b272443957ef01dc159d2a3176 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Reflection.lean @@ -0,0 +1,90 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Transport + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ComplexConjugate +noncomputable section + +/-- The reflection for the source regular representation. -/ +def sourceReflectionIndex (θ : SourceCoordinate → ℝ) + (z : (SourceCoordinate → ℝ) × ℤ) : (SourceCoordinate → ℝ) × ℤ := + (coordinateRotate θ z.2 z.1, -z.2) + +theorem sourceReflectionIndex_preserving (θ : SourceCoordinate → ℝ) : + MeasurePreserving (sourceReflectionIndex θ) + (sourceMeasure SourceCoordinate) (sourceMeasure SourceCoordinate) := by + have hn : MeasurePreserving (fun n : ℤ => -n) Measure.count Measure.count := by + refine ⟨measurable_of_countable _, ?_⟩ + ext S hS + rw [Measure.map_apply (measurable_of_countable _) hS, + Measure.count_apply (hS.preimage (measurable_of_countable _)), Measure.count_apply hS, + ← neg_injective.encard_image, Set.image_preimage_eq S neg_surjective] + have hm : Measurable (Function.uncurry (fun (n : ℤ) (x : SourceCoordinate → ℝ) => coordinateRotate θ n x)) := by + apply Measurable.of_eval + intro i + unfold coordinateRotate + fun_prop + have hp := hn.skew_product hm (Eventually.of_forall (fun n => (coordinateRotate_preserving θ n).map_eq)) + exact Measure.measurePreserving_swap.comp (hp.comp Measure.measurePreserving_swap) + +def sourceReflectionLinear (θ : SourceCoordinate → ℝ) : + SourceHilbert SourceCoordinate →ₗᵢ[ℂ] SourceHilbert SourceCoordinate := + Lp.compMeasurePreservingₗᵢ ℂ (sourceReflectionIndex θ) (sourceReflectionIndex_preserving θ) + +/-- Explicit conjugate-linear isometry; no modular or tracial property assumed. -/ +def sourceConjugation (θ : SourceCoordinate → ℝ) (f : SourceHilbert SourceCoordinate) : + SourceHilbert SourceCoordinate := star (sourceReflectionLinear θ f) + +theorem sourceConjugation_apply_ae (θ : SourceCoordinate → ℝ) (f : SourceHilbert SourceCoordinate) : + sourceConjugation θ f =ᵐ[sourceMeasure SourceCoordinate] + fun z => star (f (sourceReflectionIndex θ z)) := by + filter_upwards [Lp.coeFn_star (sourceReflectionLinear θ f), + Lp.coeFn_compMeasurePreserving f (sourceReflectionIndex_preserving θ)] with z hs hr + change (star (sourceReflectionLinear θ f)) z = _ + rw [hs] + change star ((sourceReflectionLinear θ f) z) = _ + change (sourceReflectionLinear θ f) z = f (sourceReflectionIndex θ z) at hr + rw [hr] + +theorem sourceConjugation_involutive (θ : SourceCoordinate → ℝ) (f : SourceHilbert SourceCoordinate) : + sourceConjugation θ (sourceConjugation θ f) = f := by + apply Lp.ext + have ht := (sourceReflectionIndex_preserving θ).quasiMeasurePreserving.ae (sourceConjugation_apply_ae θ f) + filter_upwards [sourceConjugation_apply_ae θ (sourceConjugation θ f), ht, sourceHilbert_cube] with z h1 h2 hc + rw [h1,h2,star_star] + congr 1 + apply Prod.ext + · change coordinateRotate θ (-z.2) (coordinateRotate θ z.2 z.1) = z.1 + rw [coordinateRotate_add, add_neg_cancel] + funext i + simpa [coordinateRotate] using Int.fract_eq_self.mpr (hc i) + · simp [sourceReflectionIndex] + +theorem sourceL2_star_inner (f g : SourceHilbert SourceCoordinate) : + inner ℂ (star f) (star g) = star (inner ℂ f g) := by + rw [L2.inner_def, L2.inner_def] + change _ = conj (∫ z, inner ℂ (f z) (g z) ∂sourceMeasure SourceCoordinate) + rw [← integral_conj] + apply integral_congr_ae + filter_upwards [Lp.coeFn_star f, Lp.coeFn_star g] with z hf hg + rw [hf,hg] + simp [RCLike.inner_apply, mul_comm] + +theorem sourceConjugation_inner (θ : SourceCoordinate → ℝ) (f g : SourceHilbert SourceCoordinate) : + inner ℂ (sourceConjugation θ f) (sourceConjugation θ g) = star (inner ℂ f g) := by + rw [sourceConjugation, sourceConjugation, sourceL2_star_inner, + (sourceReflectionLinear θ).inner_map_map] + +theorem sourceConjugation_inner_symm (θ : SourceCoordinate → ℝ) (f g : SourceHilbert SourceCoordinate) : + inner ℂ f (sourceConjugation θ g) = inner ℂ g (sourceConjugation θ f) := by + have hh := sourceConjugation_inner θ (sourceConjugation θ f) g + rw [sourceConjugation_involutive] at hh + rw [hh] + exact inner_conj_symm _ _ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ResamplingLaw.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ResamplingLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..507b6c4076e79875bdf00f76961ae1d593671bcd --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ResamplingLaw.lean @@ -0,0 +1,58 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ReferenceMixture + +namespace OAI + +namespace FiniteFactor +open MeasureTheory ProbabilityTheory CouplingParameters +open scoped ENNReal +noncomputable section + +theorem sourceResampling_coordinate_compProd (I : Finset SourceCoordinate) (i : SourceCoordinate) : + unitIntervalMeasure ⊗ₘ (if i ∈ I then Kernel.const ℝ unitIntervalMeasure else Kernel.id) = + (unitIntervalMeasure.prod unitIntervalMeasure).map + (fun z : ℝ × ℝ => (z.1,if i ∈ I then z.2 else z.1)) := by + by_cases hi : i ∈ I + · simp [hi,Measure.compProd_const] + · simp only [ite_eq_right hi,Measure.compProd_id] + have hf : (unitIntervalMeasure.prod unitIntervalMeasure).map Prod.fst = unitIntervalMeasure := + measurePreserving_fst.map_eq + conv_lhs => rw [← hf] + rw [Measure.map_map (by fun_prop) measurable_fst] + rfl + +/-- Each replacement pattern is exactly the unrestricted source pair law. -/ +theorem sourceResampling_compProd_eq_map (I : Finset SourceCoordinate) : + sourceSamplingHaar ⊗ₘ sourceResamplingKernel I = + sourceSamplingPairHaar.map (sourceSamplingLimitMap I) := by + let κ := fun i : SourceCoordinate => if i ∈ I then Kernel.const ℝ unitIntervalMeasure else Kernel.id + let : ∀ i, IsMarkovKernel (κ i) := fun i => by dsimp [κ]; split_ifs <;> infer_instance + have hh := independentKernel_compProd (fun _ : SourceCoordinate => unitIntervalMeasure) κ + dsimp [κ] at hh + simp_rw [sourceResampling_coordinate_compProd] at hh + let zip : SourceSamplingPair → (SourceCoordinate → ℝ × ℝ) := fun z i => (z.1 i,z.2 i) + let unzip : (SourceCoordinate → ℝ × ℝ) → SourceSamplingPair := fun z => (fun i => (z i).1,fun i => (z i).2) + have hz : Measurable zip := by fun_prop + have hu : Measurable unzip := by fun_prop + have hleft := congrArg (fun ν : Measure (SourceCoordinate → ℝ × ℝ) => ν.map unzip) hh + rw [Measure.map_map hu hz] at hleft + have hid : unzip ∘ zip = id := rfl + rw [hid,Measure.map_id] at hleft + unfold sourceResamplingKernel + rw [hleft] + have hm (i : SourceCoordinate) : Measurable (fun z : ℝ × ℝ => (z.1,if i ∈ I then z.2 else z.1)) := by + by_cases hi : i ∈ I <;> simp only [hi,ite_true,ite_false] <;> fun_prop + have hp : sourceSamplingPairHaar.map + (fun z i => ((z i).1,if i ∈ I then (z i).2 else (z i).1)) = + Measure.infinitePi (fun i : SourceCoordinate => (unitIntervalMeasure.prod unitIntervalMeasure).map + (fun z : ℝ × ℝ => (z.1,if i ∈ I then z.2 else z.1))) := + Measure.infinitePi_map_pi _ hm + have hmap : Measurable (fun z : SourceCoordinate → ℝ × ℝ => + fun i => ((z i).1,if i ∈ I then (z i).2 else (z i).1)) := + Measurable.of_eval fun i => (hm i).comp (measurable_pi_apply i) + rw [← hp,Measure.map_map hu hmap] + rfl + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Rotation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Rotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..bc8d75fa998ddf14a74a0d8608dbb66f61318632 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Rotation.lean @@ -0,0 +1,67 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Cocycle +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Periodic + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +def sourceCircleRepresentative (x : AddCircle (1 : ℝ)) : ℝ := + (AddCircle.equivIco 1 0 x).val + +theorem sourceCircleRepresentative_measurable : Measurable sourceCircleRepresentative := + measurable_subtype_coe.comp (AddCircle.measurableEquivIco 1 0).measurable + +theorem sourceCircleRepresentative_coe (x : ℝ) : + sourceCircleRepresentative (x : AddCircle (1 : ℝ)) = Int.fract x := by + have hx : Int.fract x ∈ Set.Ico (0 : ℝ) (0+1) := + ⟨Int.fract_nonneg _, by simpa using Int.fract_lt_one x⟩ + have he := AddCircle.equivIco_coe_eq (p := (1 : ℝ)) (a := 0) hx + rw [AddCircle.coe_fract] at he + exact congrArg Subtype.val he + +theorem sourceCircle_mk_preserving : + MeasurePreserving ((↑) : ℝ → AddCircle (1 : ℝ)) unitIntervalMeasure volume := by + simpa [unitIntervalMeasure, restrict_Ico_eq_restrict_Ioc] using + AddCircle.measurePreserving_mk 1 0 + +theorem sourceCircleRepresentative_preserving : + MeasurePreserving sourceCircleRepresentative volume unitIntervalMeasure := by + refine ⟨sourceCircleRepresentative_measurable, ?_⟩ + rw [← sourceCircle_mk_preserving.map_eq, + Measure.map_map sourceCircleRepresentative_measurable sourceCircle_mk_preserving.measurable] + have he : (sourceCircleRepresentative ∘ ((↑) : ℝ → AddCircle (1 : ℝ))) =ᵐ[unitIntervalMeasure] id := by + filter_upwards [ae_restrict_mem measurableSet_Ico] with x hx + rw [Function.comp_apply, sourceCircleRepresentative_coe] + exact Int.fract_eq_self.mpr hx + rw [Measure.map_congr he, Measure.map_id] + +/-- Translation modulo one preserves the exact real representative measure. -/ +theorem unitInterval_rotate_preserving (a : ℝ) : + MeasurePreserving (fun x : ℝ => Int.fract (x+a)) unitIntervalMeasure unitIntervalMeasure := by + have hh := sourceCircleRepresentative_preserving.comp + ((measurePreserving_add_right (volume : Measure (AddCircle (1 : ℝ))) (a : AddCircle (1 : ℝ))).comp + sourceCircle_mk_preserving) + convert hh using 1 + funext x + simpa only [Function.comp_apply, ← AddCircle.coe_add] using (sourceCircleRepresentative_coe (x+a)).symm + +/-- All integer iterates of the countable source rotation preserve its actual +infinite product measure. This is not an assumed action property. -/ +theorem coordinateRotate_preserving {ι : Type*} (θ : ι → ℝ) (k : ℤ) : + MeasurePreserving (coordinateRotate θ k) + (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) + (Measure.infinitePi (fun _ : ι => unitIntervalMeasure)) := by + have hm (i : ι) : Measurable (fun x : ℝ => Int.fract (x+(k : ℝ)*θ i)) := + (unitInterval_rotate_preserving _).measurable + refine ⟨Measurable.of_eval (fun i => (hm i).comp (measurable_pi_apply i)), ?_⟩ + unfold coordinateRotate + rw [Measure.infinitePi_map_pi _ hm] + simp_rw [(unitInterval_rotate_preserving _).map_eq] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/RotationCommutant.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/RotationCommutant.lean new file mode 100644 index 0000000000000000000000000000000000000000..e4f4d40c10821b1e186fb367fbcc734ff051449d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/RotationCommutant.lean @@ -0,0 +1,86 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Transport +import OAI.Analysis.FiniteFactor.CrossedProduct.ScalarCommutant + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +def sourceCommutantRotation (θ : SourceCoordinate → ℝ) (n : ℤ) := sourceTransport θ n n + +theorem sourceCommutantRotation_star (θ : SourceCoordinate → ℝ) (n : ℤ) : + star (sourceCommutantRotation θ n) = sourceCommutantRotation θ (-n) := + sourceTransport_star θ n n + +theorem sourceCommutantRotation_pi (θ : SourceCoordinate → ℝ) (n : ℤ) + (g : SourceBaseFunction) : + sourceCommutantRotation θ n * sourcePi θ g = sourcePi θ g * sourceCommutantRotation θ n := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + have ht := (sourceTransportIndex_preserving θ n n).quasiMeasurePreserving.ae + (sourcePi_apply_ae θ g f) + filter_upwards [sourceTransport_apply_ae θ n n (sourcePi θ g f), + sourcePi_apply_ae θ g (sourceTransport θ n n f), sourceTransport_apply_ae θ n n f, + ht] with z h1 h2 h3 h4 + change (sourceTransport θ n n (sourcePi θ g f)) z = (sourcePi θ g (sourceTransport θ n n f)) z + rw [h1,h2,h3,h4] + have he : sourcePiSymbol θ g (sourceTransportIndex θ n n z) = sourcePiSymbol θ g z := by + unfold sourcePiSymbol sourceTransportIndex + dsimp only + rw [coordinateRotate_add] + congr 2 + omega + rw [he] + +theorem sourceTransport_shift (θ : SourceCoordinate → ℝ) (n m : ℤ) : + sourceTransport θ n m * sourceShift SourceCoordinate = + sourceShift SourceCoordinate * sourceTransport θ n m := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + have ht := (sourceTransportIndex_preserving θ n m).quasiMeasurePreserving.ae + (sourceShift_apply_ae f) + have hs := (sourceShiftIndex_preserving SourceCoordinate).quasiMeasurePreserving.ae + (sourceTransport_apply_ae θ n m f) + filter_upwards [sourceTransport_apply_ae θ n m (sourceShift SourceCoordinate f), + sourceShift_apply_ae (sourceTransport θ n m f), ht, hs] with z h1 h2 h3 h4 + change (sourceTransport θ n m (sourceShift SourceCoordinate f)) z = + (sourceShift SourceCoordinate (sourceTransport θ n m f)) z + rw [h1,h2,h3,h4] + congr 1 + apply Prod.ext + · rfl + · dsimp [sourceTransportIndex, sourceShiftIndex]; omega + +theorem sourceCommutantRotation_mem (θ : SourceCoordinate → ℝ) (n : ℤ) : + sourceCommutantRotation θ n ∈ StarSubalgebra.centralizer ℂ + ({sourceShift SourceCoordinate} ∪ Set.range (sourcePi θ)) := by + apply (StarSubalgebra.mem_centralizer_iff ℂ).mpr + intro A hA + rcases hA with hA | ⟨g,rfl⟩ + · obtain rfl : A = sourceShift SourceCoordinate := hA + refine ⟨(sourceTransport_shift θ n n).symm, ?_⟩ + have hs := congrArg star (sourceTransport_shift θ (-n) (-n)) + have he : star (sourceTransport θ (-n) (-n)) = sourceTransport θ n n := by + rw [sourceTransport_star]; simp + simpa only [star_mul, he, sourceCommutantRotation] using hs + · exact ⟨(sourceCommutantRotation_pi θ n g).symm, by + rw [sourcePi_star] + exact (sourceCommutantRotation_pi θ n (sourceBaseStar g)).symm⟩ + +theorem sourceAlgebra_commutes_rotation (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (n : ℤ) : + sourceCommutantRotation θ n * H = H * sourceCommutantRotation θ n := by + change H ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ + ({sourceShift SourceCoordinate} ∪ Set.range (sourcePi θ))) at hH + exact ((StarSubalgebra.mem_centralizer_iff ℂ).mp hH _ + (sourceCommutantRotation_mem θ n)).1 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/RotationErgodic.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/RotationErgodic.lean new file mode 100644 index 0000000000000000000000000000000000000000..45c7f23e88afe44687db0e07c4ca34811d342904 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/RotationErgodic.lean @@ -0,0 +1,37 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusErgodic + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +theorem sourceTorusRepresentative_rotationStep (θ : SourceCoordinate → ℝ) (z : SourceTorus) : + sourceTorusRepresentative (sourceTorusRotationStep θ z) = + coordinateRotate θ 1 (sourceTorusRepresentative z) := by + funext i + have hz : ((sourceTorusRepresentative z i : ℝ) : UnitAddCircle) = z i := + congrFun (sourceTorusQuotient_representative z) i + change sourceCircleRepresentative (z i + (θ i : UnitAddCircle)) = + Int.fract (sourceTorusRepresentative z i + (1 : ℤ) * θ i) + rw [← hz,← AddCircle.coe_add,sourceCircleRepresentative_coe] + norm_num + +/-- Ergodicity for the exact real-coordinate model used by the original algebra. -/ +theorem coordinateRotate_ergodic (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) : + Ergodic (coordinateRotate θ 1) sourceSamplingHaar := + sourceTorusRepresentative_preserving.ergodic_of_ergodic_semiconj + (sourceTorusRotationStep_ergodic θ hr) (coordinateRotate_preserving θ 1).measurable + (sourceTorusRepresentative_rotationStep θ) + +theorem sourceRotation_invariant_constant (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) {f : (SourceCoordinate → ℝ) → ℂ} + (hf : Measurable f) (hi : f ∘ coordinateRotate θ 1 =ᵐ[sourceSamplingHaar] f) : + ∃ c : ℂ, f =ᵐ[sourceSamplingHaar] fun _ => c := + (coordinateRotate_ergodic θ hr).ae_eq_const_of_ae_eq_comp₀ hf.nullMeasurable hi + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ScalarCenter.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ScalarCenter.lean new file mode 100644 index 0000000000000000000000000000000000000000..64d4349fe3da847549f6a137550363f637a110ed --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ScalarCenter.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.FiniteFactor.Model +import OAI.Analysis.FiniteFactor.CrossedProduct.RotationErgodic +import OAI.Analysis.FiniteFactor.CrossedProduct.CentralScalarField + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- Constancy of the representing field is equality of the original operators. -/ +theorem sourceOperator_eq_scalar_of_field (θ : SourceCoordinate → ℝ) + {A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) (c : ℂ) + (hc : ∀ᵐ x ∂sourceBaseMeasure, sourceOperatorField A x = + c • (1 : SourceFiberHilbert →L[ℂ] SourceFiberHilbert)) : + A = c • (1 : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) := by + apply ContinuousLinearMap.ext + intro f + change A f = c • f + apply Lp.ext + have he : ∀ᵐ z ∂sourceMeasure SourceCoordinate, (A f) z = c * f z := by + apply (Measure.ae_prod_iff_ae_ae + (measurableSet_eq_fun (Lp.stronglyMeasurable (A f)).measurable + (measurable_const.mul (Lp.stronglyMeasurable f).measurable))).mpr + filter_upwards [sourceOperatorField_represents θ hA f,sourceFiberVector_coe (A f), + sourceFiberVector_coe f,hc] with x ha hAf hf hx + apply Eventually.of_forall + intro k + have hk := congrArg (fun v : SourceFiberHilbert => v k) ha + rw [hx] at hk + change sourceFiberVector (A f) x k = c * sourceFiberVector f x k at hk + simpa only [hAf,hf,Pi.mul_apply] using hk + filter_upwards [he,Lp.coeFn_smul c f] with z hz hs + simpa only [hs,Pi.smul_apply,smul_eq_mul] using hz + +theorem sourceCentralCoefficient_constant (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) + {A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) (hcentral : ∀ B ∈ sourceAlgebra θ, A*B = B*A) : + ∃ c : ℂ, sourceCentralCoefficient A =ᵐ[sourceBaseMeasure] fun _ => c := by + apply sourceRotation_invariant_constant θ hr (sourceCentralCoefficient_measurable A) + filter_upwards [sourceCentralCoefficient_rotation_invariant θ hr hA hcentral] with x hx + exact hx 1 + +theorem sourceAlgebra_hasScalarCenter (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) : HasScalarCenter (sourceAlgebra θ) := by + intro A hA hcentral + obtain ⟨c,hc⟩ := sourceCentralCoefficient_constant θ hr hA hcentral + refine ⟨c,sourceOperator_eq_scalar_of_field θ hA c ?_⟩ + filter_upwards [sourceCentral_scalar_field θ hr hA hcentral,hc] with x hx hc + rw [hx,hc] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ScalarCommutant.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ScalarCommutant.lean new file mode 100644 index 0000000000000000000000000000000000000000..b7ac8f07898b67179c16e3a3349a23cea198e9f0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/ScalarCommutant.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.MultiplicationAdjoint + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- Scalar base multiplication, independent of the fiber coordinate. -/ +def sourceScalar (g : SourceBaseFunction) : + SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate := + sourcePi (fun _ => 0) g + +theorem sourceScalar_star (g : SourceBaseFunction) : + star (sourceScalar g) = sourceScalar (sourceBaseStar g) := + sourcePi_star _ _ + +theorem sourceShift_apply_ae (f : SourceHilbert SourceCoordinate) : + sourceShift SourceCoordinate f =ᵐ[sourceMeasure SourceCoordinate] + fun z => f (sourceShiftIndex z) := + Lp.coeFn_compMeasurePreserving f (sourceShiftIndex_preserving _) + +theorem sourceScalar_shift_commute (g : SourceBaseFunction) : + sourceScalar g * sourceShift SourceCoordinate = + sourceShift SourceCoordinate * sourceScalar g := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + have hg := (sourceShiftIndex_preserving SourceCoordinate).quasiMeasurePreserving.ae + (sourcePi_apply_ae (fun _ => 0) g f) + filter_upwards [sourcePi_apply_ae (fun _ => 0) g (sourceShift SourceCoordinate f), + sourceShift_apply_ae f, sourceShift_apply_ae (sourceScalar g f), hg] with z h1 h2 h3 h4 + change (sourcePi (fun _ => 0) g (sourceShift SourceCoordinate f)) z = + (sourceShift SourceCoordinate (sourceScalar g f)) z + rw [h1, h2, h3] + change _ = (sourcePi (fun _ => 0) g f) (sourceShiftIndex z) + rw [h4] + have he : sourcePiSymbol (fun _ => 0) g z = + sourcePiSymbol (fun _ => 0) g (sourceShiftIndex z) := by + unfold sourcePiSymbol + congr 1 + funext i + simp [coordinateRotate, sourceShiftIndex] + rw [he] + +/-- The scalar multipliers commute with the generators and their adjoints. -/ +theorem sourceScalar_mem_generator_commutant (θ : SourceCoordinate → ℝ) + (g : SourceBaseFunction) : + sourceScalar g ∈ StarSubalgebra.centralizer ℂ + ({sourceShift SourceCoordinate} ∪ Set.range (sourcePi θ)) := by + apply (StarSubalgebra.mem_centralizer_iff ℂ).mpr + intro A hA + rcases hA with hA | ⟨h, rfl⟩ + · obtain rfl : A = sourceShift SourceCoordinate := hA + refine ⟨(sourceScalar_shift_commute g).symm, ?_⟩ + have hs := congrArg star (sourceScalar_shift_commute (sourceBaseStar g)) + have hg : star (sourceScalar (sourceBaseStar g)) = sourceScalar g := by + rw [← sourceScalar_star, star_star] + simpa only [star_mul, hg] using hs + · exact ⟨sourcePi_commute θ _ h g, by + rw [sourcePi_star] + exact sourcePi_commute θ _ (sourceBaseStar h) g⟩ + +/-- The commutation holds for every element of the actual double commutant. -/ +theorem sourceAlgebra_commutes_scalar (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (g : SourceBaseFunction) : + sourceScalar g * H = H * sourceScalar g := by + change H ∈ StarSubalgebra.centralizer ℂ + (StarSubalgebra.centralizer ℂ + ({sourceShift SourceCoordinate} ∪ Set.range (sourcePi θ))) at hH + exact ((StarSubalgebra.mem_centralizer_iff ℂ).mp hH _ + (sourceScalar_mem_generator_commutant θ g)).1 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/SmallPartitionSets.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/SmallPartitionSets.lean new file mode 100644 index 0000000000000000000000000000000000000000..984d381d2b544b64373b34c88220fe8f54bdab97 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/SmallPartitionSets.lean @@ -0,0 +1,66 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FreeRotation +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusModel + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +def sourceSmallPartitionSet (n : ℕ) (j : Fin n) : Set (SourceCoordinate → ℝ) := + {x | x sourceFirstCoordinate ∈ Set.Ico ((j : ℝ)/(n : ℝ)) (((j : ℝ)+1)/(n : ℝ))} + +theorem sourceSmallPartitionSet_measurable (n : ℕ) (j : Fin n) : + MeasurableSet (sourceSmallPartitionSet n j) := + measurableSet_Ico.preimage (measurable_pi_apply sourceFirstCoordinate) + +theorem unitInterval_partition_unique (n : ℕ) (hn : 0 < n) (t : ℝ) (ht : t ∈ Set.Ico 0 1) : + ∃! j : Fin n, t ∈ Set.Ico ((j : ℝ)/(n : ℝ)) (((j : ℝ)+1)/(n : ℝ)) := by + have hnR : (0 : ℝ) < n := by exact_mod_cast hn + have hnt : 0 ≤ (n : ℝ)*t := mul_nonneg hnR.le ht.1 + have hlt : Nat.floor ((n : ℝ)*t) < n := + (Nat.floor_lt hnt).mpr (by nlinarith [ht.2]) + let k : Fin n := ⟨Nat.floor ((n : ℝ)*t),hlt⟩ + have he (j : Fin n) : t ∈ Set.Ico ((j : ℝ)/(n : ℝ)) (((j : ℝ)+1)/(n : ℝ)) ↔ + Nat.floor ((n : ℝ)*t) = j.val := by + rw [Nat.floor_eq_iff hnt] + change _ ≤ t ∧ t < _ ↔ _ ≤ _ ∧ _ < _ + rw [div_le_iff₀ hnR,lt_div_iff₀ hnR] + simp only [mul_comm] + refine ⟨k,(he k).mpr rfl,?_⟩ + intro j hj + exact Fin.ext ((he j).mp hj).symm + +theorem sourceSmallPartition_indicator_sum (n : ℕ) (hn : 0 < n) + (x : SourceCoordinate → ℝ) (hx : x sourceFirstCoordinate ∈ Set.Ico 0 1) : + ∑ j : Fin n, (sourceSmallPartitionSet n j).indicator (fun _ => (1 : ℂ)) x = 1 := by + classical + obtain ⟨k,hk,hunique⟩ := unitInterval_partition_unique n hn (x sourceFirstCoordinate) hx + have hk' : x ∈ sourceSmallPartitionSet n k := hk + rw [Finset.sum_eq_single k] + · exact Set.indicator_of_mem hk' _ + · intro j _ hj + exact Set.indicator_of_notMem (s := sourceSmallPartitionSet n j) (a := x) + (fun h => hj (hunique j h)) (fun _ => (1 : ℂ)) + · simp + +/-- Every cell has mass at most 1/n under the actual product Haar measure. -/ +theorem sourceSmallPartitionSet_measure_le (n : ℕ) (_hn : 0 < n) (j : Fin n) : + sourceSamplingHaar (sourceSmallPartitionSet n j) ≤ ENNReal.ofReal (1/(n : ℝ)) := by + change sourceSamplingHaar ((fun x => x sourceFirstCoordinate) ⁻¹' + Set.Ico ((j : ℝ)/(n : ℝ)) (((j : ℝ)+1)/(n : ℝ))) ≤ _ + rw [← Measure.map_apply (measurable_pi_apply sourceFirstCoordinate) measurableSet_Ico, + Measure.infinitePi_map_eval] + calc + unitIntervalMeasure _ ≤ volume (Set.Ico ((j : ℝ)/(n : ℝ)) (((j : ℝ)+1)/(n : ℝ))) := + Measure.restrict_apply_le _ _ + _ = _ := by + rw [Real.volume_Ico] + congr 1 + ring + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StageCoupling.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StageCoupling.lean new file mode 100644 index 0000000000000000000000000000000000000000..a6ac9263990c7a654f438c8c2ef759691fc6c1db --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StageCoupling.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.StageOperator + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped ENNReal +noncomputable section + +/-- Both source widths, derived from the stages already constructed. -/ +def sourceWidth (s : ℕ) : Fin 2 → ℝ := + ![(sourceStageState s).G/(sourceBlockSize s : ℝ), (sourceBlockSize s : ℝ)^(-19/20 : ℝ)] + +theorem sourceWidth_bounds (s : ℕ) (w : Fin 2) : + 1/(sourceBlockSize s : ℝ) ≤ sourceWidth s w ∧ sourceWidth s w ≤ 1/4 := by + have hm : (100 : ℝ) ≤ sourceBlockSize s := by exact_mod_cast (sourceStage s).m_ge_100 + have hm0 := sourceBlockSize_pos s + fin_cases w + · simp only [sourceWidth] + constructor + · exact div_le_div_of_nonneg_right (sourceStageState s).G_ge hm0.le + · apply (div_le_iff₀ hm0).mpr + have hh := (sourceStage s).m_ge_G + change 4*(sourceStageState s).G ≤ (sourceBlockSize s : ℝ) at hh + linarith + · simp only [sourceWidth] + constructor + · rw [one_div, ← Real.rpow_neg_one] + exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num) + · have hsqrt : (4 : ℝ) ≤ Real.sqrt (sourceBlockSize s : ℝ) := by + apply (Real.le_sqrt (by norm_num) hm0.le).mpr + nlinarith + have hpow : Real.sqrt (sourceBlockSize s : ℝ) ≤ (sourceBlockSize s : ℝ)^(19/20 : ℝ) := by + rw [Real.sqrt_eq_rpow] + exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num) + have hh := one_div_le_one_div_of_le (by norm_num : (0 : ℝ) < 4) (hsqrt.trans hpow) + rw [show (-19/20 : ℝ) = -(19/20) by ring, Real.rpow_neg hm0.le] + simpa [one_div] using hh + +/-- The source coupling parameters now have all width and scale hypotheses +discharged by the recursive construction. j is the unique tagged block. -/ +def stagedCouplingParameters (j s : ℕ) : CouplingParameters where + m := sourceBlockSize s + kappa := sourceKappa s + width := sourceWidth s + tagged := decide (s=j) + m_ge := by exact_mod_cast (sourceStage s).m_ge_100 + kappa_nonneg := by unfold sourceKappa; positivity + kappa_le := by + unfold sourceKappa + apply one_div_le_one_div_of_le (by norm_num) + have hh : (0 : ℝ) ≤ s := Nat.cast_nonneg s + nlinarith + width_lower := fun w => (sourceWidth_bounds s w).1 + width_upper := fun w => (sourceWidth_bounds s w).2 + +/-- Actual infinite endpoint densities for the recursively constructed source +coupling. There are no assumed scale, width, or density hypotheses. -/ +theorem stagedCoupling_endpoint_L2_density (j : ℕ) (right : SourceCoordinate → Bool) : + ∃ g : (SourceCoordinate → ℝ) → ℝ, + MemLp g 2 (Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure)) ∧ + (∀ᵐ x ∂Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure), 0 ≤ g x) ∧ + (∫ x, g x ^ 2 ∂Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure)) ≤ + Real.exp (20*(2*(∑' s, sourceKappa s ^ 2)+1)) ∧ + (CouplingParameters.blockProductCoupling (stagedCouplingParameters j) sourceBlockSize).map + (CouplingParameters.blockProductEndpoint right) = + (Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure)).withDensity + (fun x => ENNReal.ofReal (g x)) := + CouplingParameters.blockProductEndpoint_L2_density (stagedCouplingParameters j) sourceBlockSize + (fun _ => rfl) j (fun _ => rfl) (fun _ => rfl) right + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StageOperator.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StageOperator.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d3e32ef4e62505e6bc2fa7ebc06b605818e3295 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StageOperator.lean @@ -0,0 +1,160 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.Stages +import OAI.Analysis.FiniteFactor.CrossedProduct.Powers +import OAI.Analysis.FiniteFactor.Coupling.BlockLimit + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped Topology ENNReal +noncomputable section + +def sourceBlockSize (s : ℕ) : ℕ := (sourceStage s).m +abbrev SourceCoordinate := CouplingParameters.BlockCoordinate sourceBlockSize + +def sourceLogWeight (i : SourceCoordinate) : ℝ := (sourceStage i.1).C + +def SourceAngles (θ : SourceCoordinate → ℝ) : Prop := + let realGroup : GroupWithZero ℝ := + (@DivisionRing.toDivisionSemiring ℝ Real.instField.toDivisionRing).toGroupWithZero + let realOrder : LE ℝ := @Preorder.toLE ℝ Real.partialOrder.toPreorder + ∀ i : SourceCoordinate, + let block : ℝ := @Nat.cast ℝ Real.instNatCast (sourceBlockSize i.1) + let cutoff : ℝ := @Nat.cast ℝ Real.instNatCast (sourceStageState i.1).K + let denominator : ℝ := @Mul.mul ℝ Real.instMul block cutoff + let lower : ℝ := + @Div.div ℝ realGroup.toDiv (@One.one ℝ Real.instOne) denominator + let upper : ℝ := + @Div.div ℝ realGroup.toDiv (@Nat.cast ℝ Real.instNatCast 2) denominator + @LE.le ℝ realOrder lower (θ i) ∧ @LE.le ℝ realOrder (θ i) upper + +theorem sourceBlockSize_pos (s : ℕ) : (0 : ℝ) < sourceBlockSize s := by + exact_mod_cast (show 0 < (sourceStage s).m by have := (sourceStage s).m_ge_100; omega) + +theorem sourceCutoff_pos (s : ℕ) : (0 : ℝ) < (sourceStageState s).K := by + exact_mod_cast (show 0 < (sourceStageState s).K by have := (sourceStageState s).K_ge; omega) + +theorem sourceCutoff_ge_pow (s : ℕ) : 2^s ≤ (sourceStageState s).K := by + induction s with + | zero => exact (sourceStageState 0).K_ge + | succ s ih => + rw [pow_succ] + have hh : 2^s*2 ≤ 2*(sourceStageState s).K := by simpa [mul_comm] using Nat.mul_le_mul_left 2 ih + exact hh.trans (sourceStage_cutoff_growth s).le + +theorem sourceCutoff_reciprocal_summable : Summable (fun s => 1/((sourceStageState s).K : ℝ)) := by + apply (summable_geometric_of_lt_one (r := (1/2 : ℝ)) (by norm_num) (by norm_num)).of_nonneg_of_le + · intro s; positivity + · intro s + have hpow : (2 : ℝ)^s ≤ (sourceStageState s).K := by exact_mod_cast sourceCutoff_ge_pow s + have hh := one_div_le_one_div_of_le (by positivity : (0 : ℝ) < (2 : ℝ)^s) hpow + simpa [one_div_pow] using hh + +theorem SourceAngles.nonneg {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) + (i : SourceCoordinate) : + @LE.le ℝ (@Preorder.toLE ℝ Real.partialOrder.toPreorder) + (@Zero.zero ℝ Real.instZero) (θ i) := + let realGroup : GroupWithZero ℝ := + (@DivisionRing.toDivisionSemiring ℝ Real.instField.toDivisionRing).toGroupWithZero + let realOrder : Preorder ℝ := Real.partialOrder.toPreorder + let realStrict : @PosMulStrictMono ℝ Real.instMul Real.instZero realOrder := + @IsStrictOrderedRing.toPosMulStrictMono ℝ Real.semiring Real.partialOrder + Real.instIsStrictOrderedRing + let realReflect : @PosMulReflectLT ℝ Real.instMul Real.instZero realOrder := + @PosMulMono.toPosMulReflectLT ℝ Real.instMul Real.instZero Real.linearOrder + (@IsOrderedRing.toPosMulMono ℝ Real.semiring Real.partialOrder + Real.instIsOrderedRing) + let block : ℝ := @Nat.cast ℝ Real.instNatCast (sourceBlockSize i.1) + let cutoff : ℝ := @Nat.cast ℝ Real.instNatCast (sourceStageState i.1).K + let denominator : ℝ := @Mul.mul ℝ Real.instMul block cutoff + let lower : ℝ := + @Div.div ℝ realGroup.toDiv (@One.one ℝ Real.instOne) denominator + let upper : ℝ := + @Div.div ℝ realGroup.toDiv (@Nat.cast ℝ Real.instNatCast 2) denominator + let zeroReal : ℝ := @Zero.zero ℝ Real.instZero + @le_trans ℝ realOrder zeroReal lower (θ i) + (@le_of_lt ℝ realOrder zeroReal lower + ((@one_div_pos ℝ realGroup Real.partialOrder realReflect denominator).mpr + (@mul_pos ℝ realGroup.toMulZeroClass (a := block) (b := cutoff) + realOrder realStrict (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1)))) + (@And.left + (@LE.le ℝ realOrder.toLE lower (θ i)) + (@LE.le ℝ realOrder.toLE (θ i) upper) + (hθ i)) + +theorem sourceLogWeight_nonneg (i : SourceCoordinate) : 0 ≤ sourceLogWeight i := + le_max_of_le_right (sq_nonneg _) + +theorem exists_sourceAngles : ∃ θ : SourceCoordinate → ℝ, SourceAngles θ := by + refine ⟨fun i => 1/((sourceBlockSize i.1 : ℝ)*(sourceStageState i.1).K), ?_⟩ + intro i + exact ⟨le_rfl, div_le_div_of_nonneg_right (by norm_num) + (mul_pos (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1)).le⟩ + +/-- The source interval bounds imply actual angle summability for every +realization, with the recursively constructed sizes and cutoffs. -/ +theorem SourceAngles.summable {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) : + Summable (fun i => |θ i|) := by + have hs : Summable θ := by + rw [summable_sigma_of_nonneg hθ.nonneg] + refine ⟨fun s => (hasSum_fintype (fun t => θ ⟨s,t⟩)).summable, ?_⟩ + apply (sourceCutoff_reciprocal_summable.mul_left 2).of_nonneg_of_le + · intro s; exact tsum_nonneg (fun t => hθ.nonneg ⟨s,t⟩) + · intro s + rw [tsum_fintype] + have hh := Finset.sum_le_sum (fun (i : Fin (sourceBlockSize s)) (_ : i ∈ Finset.univ) => (hθ ⟨s,i⟩).2) + have he : (∑ _i : Fin (sourceBlockSize s), 2/((sourceBlockSize s : ℝ)*(sourceStageState s).K)) = + 2*(1/((sourceStageState s).K : ℝ)) := by + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp [(sourceBlockSize_pos s).ne', (sourceCutoff_pos s).ne'] + exact hh.trans_eq he + simpa only [abs_of_nonneg (hθ.nonneg _)] using hs + +/-- Each source block contributes at least one to the weighted-angle sum, +using C_s >= K_s^2 and the exact lower endpoint 1/(m_s*K_s). -/ +theorem SourceAngles.block_weight_lower {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) (s : ℕ) : + 1 ≤ ∑ t : Fin (sourceBlockSize s), sourceLogWeight ⟨s,t⟩*θ ⟨s,t⟩ := by + have hc : ((sourceStageState s).K : ℝ)^2 ≤ (sourceStage s).C := le_max_right _ _ + have hK : (1 : ℝ) ≤ (sourceStageState s).K := by exact_mod_cast (sourceStageState s).K_ge + have hlo : 1 ≤ (sourceStage s).C/((sourceStageState s).K : ℝ) := by + apply (le_div_iff₀ (sourceCutoff_pos s)).mpr + nlinarith + have hh : (∑ t : Fin (sourceBlockSize s), sourceLogWeight ⟨s,t⟩ * + (1/((sourceBlockSize s : ℝ)*(sourceStageState s).K))) ≤ + ∑ t : Fin (sourceBlockSize s), sourceLogWeight ⟨s,t⟩*θ ⟨s,t⟩ := + Finset.sum_le_sum (fun (t : Fin (sourceBlockSize s)) (_ : t ∈ Finset.univ) => + mul_le_mul_of_nonneg_left (hθ ⟨s,t⟩).1 (sourceLogWeight_nonneg ⟨s,t⟩)) + have he : (∑ t : Fin (sourceBlockSize s), sourceLogWeight ⟨s,t⟩ * + (1/((sourceBlockSize s : ℝ)*(sourceStageState s).K))) = + (sourceStage s).C/((sourceStageState s).K : ℝ) := by + simp only [sourceLogWeight, Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp [(sourceBlockSize_pos s).ne', (sourceCutoff_pos s).ne'] + rw [he] at hh + exact hlo.trans hh + +theorem SourceAngles.weighted_prefix_diverges {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) : + Tendsto (fun q => ∑ i ∈ CouplingParameters.blockPrefix sourceBlockSize q, sourceLogWeight i*θ i) + atTop atTop := by + apply tendsto_atTop_mono (f := fun q : ℕ => (q : ℝ)) _ tendsto_natCast_atTop_atTop + intro q + rw [CouplingParameters.blockPrefix, Finset.sum_sigma] + calc + (q : ℝ) = ∑ _s ∈ Finset.range q, (1 : ℝ) := by simp + _ ≤ _ := Finset.sum_le_sum (fun s _ => hθ.block_weight_lower s) + +/-- The recursively staged concrete source operator is nonzero, injective, +bounded by one, and norm-quasinilpotent for every admissible angle realization. +No factor, ergodicity, sampling, or invariant-projection conclusion is asserted. -/ +theorem staged_sourceOperator_properties (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) : + let T := sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg + T ≠ 0 ∧ Function.Injective T ∧ ‖T‖ ≤ 1 ∧ + Tendsto (fun n : ℕ => ‖T^n‖^(1/(n : ℝ))) atTop (𝓝 0) := by + refine ⟨sourceOperator_ne_zero _ _ _ _, sourceOperator_injective _ _ _ _, + sourceOperator_norm_le_one _ _ _ _, ?_⟩ + exact sourceOperator_norm_quasinilpotent _ _ _ _ hθ.summable + (CouplingParameters.blockPrefix sourceBlockSize) hθ.weighted_prefix_diverges + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StagePolynomial.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StagePolynomial.lean new file mode 100644 index 0000000000000000000000000000000000000000..11f0bb70c09dcc961f02e228ec03ddaeae8620f3 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/StagePolynomial.lean @@ -0,0 +1,60 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.StageOperator +import OAI.Analysis.FiniteFactor.Contradiction + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- The lower bound uses the very epsilon fixed by the recursive source +stage, which also occurs in its decay budget. No second choice is substituted. -/ +theorem sourceStage_polynomial_lower (j : ℕ) (A B : ℤ → ℂ) + (hA : ∀ v : ℤ, -((sourceStageState j).K : ℤ) ≤ v → v ≤ (sourceStageState j).K → + ‖A v‖ ≤ (sourceStageState j).D) + (hB : ∀ v : ℤ, -((sourceStageState j).K : ℤ) ≤ v → v ≤ (sourceStageState j).K → + ‖B v‖ ≤ (sourceStageState j).D) + (hA0 : 1/((j : ℝ)+1) ≤ ‖A 0‖) (hB0 : 1/((j : ℝ)+1) ≤ ‖B 0‖) : + (sourceStage j).ε ≤ coefficientMass (sourceStageState j).K A B := by + let K := (sourceStageState j).K + let a : Coefficients K := fun i => A ((i.val : ℤ)-K) + let b : Coefficients K := fun i => B ((i.val : ℤ)-K) + have ha : ∀ i, ‖a i‖ ≤ (sourceStageState j).D := by + intro i + apply hA <;> have := i.isLt <;> omega + have hb : ∀ i, ‖b i‖ ≤ (sourceStageState j).D := by + intro i + apply hB <;> have := i.isLt <;> omega + have ha0 : 1/((j : ℝ)+1) ≤ ‖a ⟨K,by omega⟩‖ := by simpa [a] using hA0 + have hb0 : 1/((j : ℝ)+1) ≤ ‖b ⟨K,by omega⟩‖ := by simpa [b] using hB0 + obtain ⟨i,hi⟩ := (sourceStage j).polynomial a b ha hb ha0 hb0 + have hiK : i.val ≤ 2*K := by have := i.isLt; omega + have he : -((2*K-i.val : ℕ) : ℤ) = (i.val : ℤ)-2*K := by omega + have hh : (sourceStage j).ε ≤ ‖laurentProductCoefficient K A B (-((2*K-i.val : ℕ) : ℤ))‖ := by + rw [he] + change (sourceStage j).ε ≤ ‖productCoefficient (K := K) + (fun i => A ((i.val : ℤ)-K)) (fun i => B ((i.val : ℤ)-K)) i.val‖ at hi + rw [shifted_productCoefficient K A B i.val] at hi + exact hi + apply hh.trans + change _ ≤ ∑ n ∈ Finset.range (2*K+1), ‖laurentProductCoefficient K A B (-(n : ℤ))‖ + exact Finset.single_le_sum (s := Finset.range (2*K+1)) (a := 2*K-i.val) + (fun i _ => norm_nonneg (laurentProductCoefficient K A B (-(i : ℤ)))) + (Finset.mem_range.mpr (by omega)) + +/-- The same source epsilon bounds the total permitted expected error. -/ +theorem sourceStage_error_budget (j : ℕ) : + (2*((sourceStageState j).K : ℝ)+1) * + (Real.exp (-(sourceStage j).L)+2*Real.exp (-(sourceStage j).L/800)) ≤ + (sourceStage j).ε/((j : ℝ)+1) := by + have hL : 0 ≤ (sourceStage j).L := + (zero_le_one.trans (sourceStageState j).previousL_ge).trans (sourceStage j).L_ge + have hh := mul_le_mul_of_nonneg_left (exponential_tail_relaxation hL) + (show (0 : ℝ) ≤ 2*((sourceStageState j).K : ℝ)+1 by positivity) + apply hh.trans + simpa only [Nat.cast_add,Nat.cast_mul,Nat.cast_ofNat,mul_assoc] using (sourceStage j).decay + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Stages.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Stages.lean new file mode 100644 index 0000000000000000000000000000000000000000..75b16b583b8776f37bf7322b7fd41a015470d66b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Stages.lean @@ -0,0 +1,174 @@ +import OAI.Analysis.FiniteFactor.Polynomial +import OAI.Analysis.FiniteFactor.Coupling.Products +import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics + +namespace OAI + +namespace FiniteFactor +open Filter Finset +open scoped Topology +noncomputable section + +def sourceNextCutoff (m : ℕ) : ℕ := Nat.ceil ((m : ℝ)^((3/4 : ℝ)*(m : ℝ))) + +theorem sourceNextCutoff_large (m : ℕ) (hm : 100 ≤ m) : 2*m < sourceNextCutoff m := by + have hmR : (100 : ℝ) ≤ m := by exact_mod_cast hm + have hp : (m : ℝ)^2 ≤ (m : ℝ)^((3/4 : ℝ)*(m : ℝ)) := by + rw [← Real.rpow_natCast] + exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num; linarith) + have hh := hp.trans (Nat.le_ceil _) + have hh2 : (2 : ℝ)*m < (sourceNextCutoff m : ℝ) := by + change (m : ℝ)^2 ≤ (sourceNextCutoff m : ℝ) at hh + nlinarith + exact_mod_cast hh2 + +theorem exists_source_block_length (R κ L G : ℝ) (hκ : 0 < κ) (hG : 0 < G) : + ∃ m : ℕ, R ≤ (m : ℝ) ∧ 100 ≤ m ∧ κ*(m : ℝ)^(1/40 : ℝ) ≥ L ∧ + G*(sourceNextCutoff m : ℝ) < (m : ℝ)^((4/5 : ℝ)*(m : ℝ)) := by + have ht : Tendsto (fun m : ℕ => (m : ℝ)^(1/40 : ℝ)) atTop atTop := + (tendsto_rpow_atTop (by norm_num)).comp tendsto_natCast_atTop_atTop + obtain ⟨m, hmR, hm100, hmG, hmκ⟩ := + ((tendsto_natCast_atTop_atTop.eventually (eventually_ge_atTop R)).and + ((eventually_ge_atTop (100 : ℕ)).and + ((tendsto_natCast_atTop_atTop.eventually (eventually_gt_atTop (2*G))).and + (ht.eventually (eventually_ge_atTop (L/κ)))))).exists + refine ⟨m, hmR, hm100, (div_le_iff₀ hκ).mp hmκ |>.trans_eq (mul_comm _ _), ?_⟩ + have hm1 : (1 : ℝ) ≤ m := by exact_mod_cast (show 1 ≤ m by omega) + have hm0 : (0 : ℝ) < m := lt_of_lt_of_le zero_lt_one hm1 + let A : ℝ := (m : ℝ)^((3/4 : ℝ)*(m : ℝ)) + have hApos : 0 < A := Real.rpow_pos_of_pos hm0 _ + have hA1 : 1 ≤ A := Real.one_le_rpow hm1 (by positivity) + have hceil : (sourceNextCutoff m : ℝ) ≤ 2*A := by + have hh := Nat.ceil_lt_add_one hApos.le + change (Nat.ceil A : ℝ) ≤ 2*A + linarith + calc + G*(sourceNextCutoff m : ℝ) ≤ G*(2*A) := mul_le_mul_of_nonneg_left hceil hG.le + _ < (m : ℝ)*A := by nlinarith + _ = (m : ℝ)^((3/4 : ℝ)*(m : ℝ)+1) := by rw [Real.rpow_add hm0, Real.rpow_one]; ring + _ ≤ (m : ℝ)^((4/5 : ℝ)*(m : ℝ)) := + Real.rpow_le_rpow_of_exponent_le hm1 (by + have hh : (100 : ℝ) ≤ m := by exact_mod_cast hm100 + linarith) + +/-- State already fixed before the new block length is chosen. B is the +previous weighted block-size sum; d is the previous coordinate count. -/ +structure SourceStageState where + K : ℕ + G : ℝ + d : ℕ + B : ℝ + previousL : ℝ + K_ge : 1 ≤ K + G_ge : 1 ≤ G + B_nonneg : 0 ≤ B + previousL_ge : 1 ≤ previousL + +def SourceStageState.D (a : SourceStageState) : ℝ := Real.exp (((a.K : ℝ)+1)*a.B) + +/-- Complete numerical output of one source stage. The polynomial bound is +proved before L, Gnext and m are selected. Stages use s=0 for source j=1. -/ +structure SourceStageChoice (s : ℕ) (a : SourceStageState) where + ε : ℝ + L : ℝ + Gnext : ℝ + m : ℕ + ε_pos : 0 < ε + polynomial : ∀ u v : Coefficients a.K, + (∀ i, ‖u i‖ ≤ a.D) → (∀ i, ‖v i‖ ≤ a.D) → + 1/((s : ℝ)+1) ≤ ‖u ⟨a.K, by omega⟩‖ → 1/((s : ℝ)+1) ≤ ‖v ⟨a.K, by omega⟩‖ → + ∃ n : Fin (2*a.K+1), ε ≤ ‖productCoefficient u v n.val‖ + L_ge : a.previousL ≤ L + decay : ((2*a.K : ℕ)+1 : ℝ)*3*Real.exp (-L/10000) ≤ ε/((s : ℝ)+1) + Gnext_ge : 1 ≤ Gnext + next_budget : sourceKappa (s+1) * Real.sqrt Gnext ≥ L + m_ge_K : a.K ≤ m + m_ge_pow : 2^(s+1) ≤ m + m_ge_G : 4*a.G ≤ (m : ℝ) + m_ge_100 : 100 ≤ m + previous_size : (a.d : ℝ) ≤ (m : ℝ)/100 + current_budget : sourceKappa s * (m : ℝ)^(1/40 : ℝ) ≥ L + next_gap : Gnext*(sourceNextCutoff m : ℝ) < (m : ℝ)^((4/5 : ℝ)*(m : ℝ)) + +theorem exists_sourceStageChoice (s : ℕ) (a : SourceStageState) : + Nonempty (SourceStageChoice s a) := by + have hs : 0 < (s : ℝ)+1 := by positivity + have hk (j : ℕ) : 0 < sourceKappa j := by unfold sourceKappa; positivity + obtain ⟨ε, hε, hp⟩ := uniform_product_coefficient_bound a.K a.D (1/((s : ℝ)+1)) (by positivity) + let target : ℝ := (ε/((s : ℝ)+1))/(((2*a.K : ℕ)+1 : ℝ)*3) + have ht : 0 < target := by dsimp [target]; positivity + obtain ⟨t, htL, htt⟩ := ((eventually_ge_atTop (a.previousL/10000)).and + (Real.tendsto_exp_neg_atTop_nhds_zero.eventually (gt_mem_nhds ht))).exists + let L : ℝ := 10000*t + have hL : a.previousL ≤ L := by dsimp [L]; linarith + have hLpos : 0 < L := lt_of_lt_of_le (by linarith [a.previousL_ge]) hL + let G : ℝ := (1+L/sourceKappa (s+1))^2 + have hG : 1 ≤ G := by dsimp [G]; nlinarith [div_pos hLpos (hk (s+1))] + have hbudget : L ≤ sourceKappa (s+1)*Real.sqrt G := by + rw [show Real.sqrt G = 1+L/sourceKappa (s+1) by + dsimp [G]; rw [Real.sqrt_sq (by linarith [div_pos hLpos (hk (s+1))])]] + rw [mul_add, mul_one, mul_div_cancel₀ _ (hk (s+1)).ne'] + linarith [hk (s+1)] + let R : ℝ := max (a.K : ℝ) (max ((2^(s+1) : ℕ) : ℝ) (max (4*a.G) (100*(a.d : ℝ)))) + obtain ⟨m, hmR, hm100, hmκ, hmgap⟩ := exists_source_block_length R (sourceKappa s) L G (hk s) (by linarith) + have hmK : (a.K : ℝ) ≤ m := (le_max_left _ _).trans hmR + have hm2 : (((2^(s+1) : ℕ)) : ℝ) ≤ m := (le_max_left _ _).trans ((le_max_right _ _).trans hmR) + have hmG : 4*a.G ≤ (m : ℝ) := (le_max_left _ _).trans + ((le_max_right _ _).trans ((le_max_right _ _).trans hmR)) + have hmd : 100*(a.d : ℝ) ≤ m := (le_max_right _ _).trans + ((le_max_right _ _).trans ((le_max_right _ _).trans hmR)) + refine ⟨⟨ε, L, G, m, hε, hp, hL, ?_, hG, hbudget, + by exact_mod_cast hmK, by exact_mod_cast hm2, hmG, hm100, by linarith, hmκ, hmgap⟩⟩ + have hden : 0 < (((2*a.K : ℕ)+1 : ℝ)*3) := by positivity + have htt' := (lt_div_iff₀ hden).mp htt + have he : -L/10000 = -t := by dsimp [L]; ring + rw [he] + nlinarith + +def selectedSourceStage (s : ℕ) (a : SourceStageState) : SourceStageChoice s a := + Classical.choice (exists_sourceStageChoice s a) + +def SourceStageChoice.C {s : ℕ} {a : SourceStageState} (b : SourceStageChoice s a) : ℝ := + max b.L ((a.K : ℝ)^2) + +def SourceStageChoice.next {s : ℕ} {a : SourceStageState} (b : SourceStageChoice s a) : SourceStageState where + K := sourceNextCutoff b.m + G := b.Gnext + d := a.d+b.m + B := a.B+b.C*(b.m : ℝ) + previousL := b.L + K_ge := by have := sourceNextCutoff_large b.m b.m_ge_100; omega + G_ge := b.Gnext_ge + B_nonneg := add_nonneg a.B_nonneg (mul_nonneg (le_max_of_le_right (sq_nonneg _)) (Nat.cast_nonneg _)) + previousL_ge := a.previousL_ge.trans b.L_ge + +/-- The infinite numerical construction is fixed without an operator or a +candidate invariant projection as an input. -/ +def sourceStageState : ℕ → SourceStageState + | 0 => ⟨100, 1, 0, 0, 1, by norm_num, le_rfl, le_rfl, le_rfl⟩ + | s+1 => (selectedSourceStage s (sourceStageState s)).next + +def sourceStage (s : ℕ) : SourceStageChoice s (sourceStageState s) := + selectedSourceStage s (sourceStageState s) + +theorem sourceStage_cutoff_growth (s : ℕ) : + 2*(sourceStageState s).K < (sourceStageState (s+1)).K := by + have h := sourceNextCutoff_large (sourceStage s).m (sourceStage s).m_ge_100 + exact (Nat.mul_le_mul_left 2 (sourceStage s).m_ge_K).trans_lt h + +theorem sourceStage_previous_size (s : ℕ) : + (sourceStageState s).d = ∑ t ∈ Finset.range s, (sourceStage t).m := by + induction s with + | zero => rfl + | succ s ih => simpa [Finset.sum_range_succ, sourceStageState, SourceStageChoice.next, sourceStage] using congrArg (fun x => x+(sourceStage s).m) ih + +theorem sourceStage_previous_weight (s : ℕ) : + (sourceStageState s).B = ∑ t ∈ Finset.range s, (sourceStage t).C*((sourceStage t).m : ℝ) := by + induction s with + | zero => rfl + | succ s ih => simpa [Finset.sum_range_succ, sourceStageState, SourceStageChoice.next, sourceStage] using congrArg (fun x => x+(sourceStage s).C*((sourceStage s).m : ℝ)) ih + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TagGeometry.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TagGeometry.lean new file mode 100644 index 0000000000000000000000000000000000000000..fc91553905a2cd3f0095ebdb31b1a57df2411d4c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TagGeometry.lean @@ -0,0 +1,84 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseFirst +import OAI.Analysis.FiniteFactor.BiasedPairs.RealIdentity +import OAI.Analysis.FiniteFactor.CrossedProduct.Attenuation +import OAI.Analysis.FiniteFactor.Coupling.BadEvents + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +theorem SourceAngles.tag_threshold {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) + (j : ℕ) (k : ℤ) (hk : ((sourceStageState j).K : ℝ) ≤ |(k : ℝ)|) + (hhi : |(k : ℝ)| ≤ ((sourceBlockSize j : ℝ)*(sourceStageState j).K)/4) + (i : Fin (sourceBlockSize j)) : + 1-Int.fract ((k : ℝ)*θ ⟨j,i⟩) ∈ Set.Icc (1/(sourceBlockSize j : ℝ)) (1-1/(sourceBlockSize j : ℝ)) := by + have hm := sourceBlockSize_pos j + have hK := sourceCutoff_pos j + apply phase_threshold_of_abs (one_div_pos.mpr hm) + · apply (div_le_iff₀ hm).mpr + have hh : (100 : ℝ) ≤ sourceBlockSize j := by exact_mod_cast (sourceStage j).m_ge_100 + linarith + · rw [abs_mul,abs_of_nonneg (hθ.nonneg ⟨j,i⟩)] + calc + 1/(sourceBlockSize j : ℝ) = (sourceStageState j).K * + (1/((sourceBlockSize j : ℝ)*(sourceStageState j).K)) := by field_simp + _ ≤ |(k : ℝ)| * θ ⟨j,i⟩ := + mul_le_mul hk (hθ ⟨j,i⟩).1 (by positivity) (abs_nonneg _) + · rw [abs_mul,abs_of_nonneg (hθ.nonneg ⟨j,i⟩)] + calc + |(k : ℝ)| * θ ⟨j,i⟩ ≤ (((sourceBlockSize j : ℝ)*(sourceStageState j).K)/4) * + (2/((sourceBlockSize j : ℝ)*(sourceStageState j).K)) := + mul_le_mul hhi (hθ ⟨j,i⟩).2 (hθ.nonneg _) (by positivity) + _ = 1/2 := by field_simp; norm_num + +/-- Endpoint consequence of a source tag; the label implication and positive +probability are separate obligations, not encoded into this predicate. -/ +def sourceTagEndpointEvent (j : ℕ) : Set SourceBiasedSample := + {ω | ∃ i : Fin (sourceBlockSize j), + sourceBiasedEndpoint (fun _ => false) ω ⟨j,i⟩ < 1/(sourceBlockSize j : ℝ) ∧ + 1-1/(sourceBlockSize j : ℝ) ≤ sourceBiasedEndpoint (fun _ => true) ω ⟨j,i⟩} + +theorem sourceTagEndpointEvent_measurable (j : ℕ) : MeasurableSet (sourceTagEndpointEvent j) := by + have he : sourceTagEndpointEvent j = ⋃ i : Fin (sourceBlockSize j), + {ω | sourceBiasedEndpoint (fun _ => false) ω ⟨j,i⟩ < 1/(sourceBlockSize j : ℝ) ∧ + 1-1/(sourceBlockSize j : ℝ) ≤ sourceBiasedEndpoint (fun _ => true) ω ⟨j,i⟩} := by + ext ω + simp [sourceTagEndpointEvent] + rw [he] + apply MeasurableSet.iUnion + intro i + exact (measurableSet_lt ((measurable_pi_apply ⟨j,i⟩).comp (sourceBiasedEndpoint_measurable _)) + measurable_const).inter + (measurableSet_le measurable_const ((measurable_pi_apply ⟨j,i⟩).comp (sourceBiasedEndpoint_measurable _))) + +/-- Actual cocycle attenuation on the endpoint event, simultaneously at all +near-range signed integer indices. No cutoff is applied to the ratio. -/ +theorem sourceTagEndpoint_attenuation (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceTagEndpointEvent j → ∀ k : ℤ, + ((sourceStageState j).K : ℝ) ≤ |(k : ℝ)| → + |(k : ℝ)| ≤ ((sourceBlockSize j : ℝ)*(sourceStageState j).K)/4 → + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => true) ω) / + sourceCocycle θ sourceLogWeight k (sourceBiasedEndpoint (fun _ => false) ω) ≤ + Real.exp (-(sourceStage j).L) := by + have hcube := CouplingParameters.vectorEndpoint_unitCube + (fun i : SourceCoordinate => stagedCouplingParameters j i.1) + filter_upwards [ + ae_of_ae_map (sourceBiasedEndpoint_measurable (fun _ => false)).aemeasurable (hcube (fun _ => false)), + ae_of_ae_map (sourceBiasedEndpoint_measurable (fun _ => true)).aemeasurable (hcube (fun _ => true)), + sourceBiasedLaw_ordered j, + sourceBiasedEndpoint_ae j (fun _ => false) (ae_finiteFloorSupport θ hθ.summable), + sourceBiasedEndpoint_ae j (fun _ => true) (ae_finiteFloorSupport θ hθ.summable)] + with ω hxc hyc hxy hfx hfy + rintro ⟨i,hxi,hyi⟩ k hk hhi + have ht := hθ.tag_threshold j k hk hhi i + have hatt := sourceCocycle_crossing_attenuation θ sourceLogWeight sourceLogWeight_nonneg + hfx hfy hxy k ⟨j,i⟩ (hxc _) (hyc _) ⟨hxi.trans_le ht.1,ht.2.trans hyi⟩ + exact hatt.trans (Real.exp_le_exp.mpr (neg_le_neg (le_max_left _ _))) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TagLaw.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TagLaw.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5fb38168e57fd42655fb65f37b05dfa5a25a96b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TagLaw.lean @@ -0,0 +1,87 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TagGeometry +import OAI.Analysis.FiniteFactor.Coupling.Order + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter CouplingParameters +open scoped ENNReal +noncomputable section + +namespace CouplingParameters + +def tagGood (p : CouplingParameters) : Set (Fin 6 × (ℝ × ℝ)) := + {z | z.1 = 5 → z.2.1 < 1/p.m ∧ 1-1/p.m ≤ z.2.2} + +theorem tagGood_measurable (p : CouplingParameters) : MeasurableSet p.tagGood := by + have hlabel : MeasurableSet {z : Fin 6 × (ℝ × ℝ) | z.1 = 5} := + (measurableSet_singleton (5 : Fin 6)).preimage measurable_fst + have hpair : MeasurableSet {z : Fin 6 × (ℝ × ℝ) | z.2.1 < 1/p.m ∧ 1-1/p.m ≤ z.2.2} := + (measurableSet_lt (measurable_fst.comp measurable_snd) measurable_const).inter + (measurableSet_le measurable_const (measurable_snd.comp measurable_snd)) + convert hlabel.compl.union hpair using 1 + ext z + simp only [tagGood,Set.mem_ofPred_eq,Set.mem_union,Set.mem_compl_iff,imp_iff_not_or] + +theorem labelledCoupling_tag_support (p : CouplingParameters) : + ∀ᵐ z ∂p.labelledCoupling, z.1 = 5 → z.2.1 < 1/p.m ∧ 1-1/p.m ≤ z.2.2 := by + have hmap (i : Fin 6) : ((p.pairComponentLaw i).map (fun xy => (i,xy))) p.tagGood = 1 := by + have hmeas : Measurable (fun xy : ℝ × ℝ => (i,xy)) := measurable_const.prodMk measurable_id + rw [Measure.map_apply hmeas (tagGood_measurable p)] + by_cases hi : i = 5 + · subst i + have hsub : p.endpointInterval false 4 ×ˢ p.endpointInterval true 4 ⊆ + (fun xy : ℝ × ℝ => ((5 : Fin 6),xy)) ⁻¹' p.tagGood := by + intro xy hxy _ + exact ⟨hxy.1.2,hxy.2.1⟩ + apply le_antisymm prob_le_one + have hh := measure_mono (μ := p.pairComponentLaw 5) hsub + have hmass : p.pairComponentLaw 5 (p.endpointInterval false 4 ×ˢ p.endpointInterval true 4) = 1 := by + change ((p.endpointComponentLaw false 4).prod (p.endpointComponentLaw true 4)) _ = 1 + rw [Measure.prod_prod,p.endpointComponentLaw_of_contains false 4 (Set.Subset.refl _), + p.endpointComponentLaw_of_contains true 4 (Set.Subset.refl _),mul_one] + rwa [hmass] at hh + · have he : (fun xy : ℝ × ℝ => (i,xy)) ⁻¹' p.tagGood = Set.univ := by + ext xy + simp [tagGood,hi] + rw [he,measure_univ] + have hm : p.labelledCoupling p.tagGood = 1 := by + rw [labelledCoupling,Measure.finsetSum_apply] + simp only [Measure.smul_apply,smul_eq_mul,hmap,mul_one] + rw [← ENNReal.ofReal_sum_of_nonneg (fun i _ => p.labelMass_nonneg i),p.labelMass_sum] + simp + rw [ae_iff] + change p.labelledCoupling p.tagGoodᶜ = 0 + rw [measure_compl (tagGood_measurable p) (measure_ne_top _ _),measure_univ,hm,tsub_self] + +end CouplingParameters + +def sourceTaggedEvent (j : ℕ) : Set SourceBiasedSample := + {ω | ∃ i : Fin (sourceBlockSize j), (ω ⟨j,i⟩).1 = 5} + +theorem sourceTaggedEvent_measurable (j : ℕ) : MeasurableSet (sourceTaggedEvent j) := by + have he : sourceTaggedEvent j = ⋃ i : Fin (sourceBlockSize j), {ω : SourceBiasedSample | (ω ⟨j,i⟩).1 = 5} := by + ext ω + simp [sourceTaggedEvent] + rw [he] + exact MeasurableSet.iUnion fun i => (measurableSet_singleton (5 : Fin 6)).preimage + (measurable_fst.comp (measurable_pi_apply (⟨j,i⟩ : SourceCoordinate))) + +/-- The actual labelled event has the geometric endpoint consequence needed +by every near-range ratio bound, under the original augmented biased law. -/ +theorem sourceTaggedEvent_endpoints (j : ℕ) : + ∀ᵐ ω ∂sourceBiasedLaw j, ω ∈ sourceTaggedEvent j → ω ∈ sourceTagEndpointEvent j := by + have h (i : Fin (sourceBlockSize j)) : ∀ᵐ ω ∂sourceBiasedLaw j, + (ω ⟨j,i⟩).1 = 5 → (ω ⟨j,i⟩).2.1 < 1/(sourceBlockSize j : ℝ) ∧ + 1-1/(sourceBlockSize j : ℝ) ≤ (ω ⟨j,i⟩).2.2 := + (measurePreserving_eval_infinitePi + (fun i : SourceCoordinate => (stagedCouplingParameters j i.1).labelledCoupling) ⟨j,i⟩).quasiMeasurePreserving.ae + (labelledCoupling_tag_support (stagedCouplingParameters j j)) + filter_upwards [ae_all_iff.mpr h] with ω hω + rintro ⟨i,hi⟩ + exact ⟨i,hω i hi⟩ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TailTrimming.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TailTrimming.lean new file mode 100644 index 0000000000000000000000000000000000000000..9ce3c58d27f2340d2ccc520387044f7455dab0c6 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TailTrimming.lean @@ -0,0 +1,103 @@ +import OAI.Analysis.FiniteFactor.OrbitSampling.Tail +import OAI.Analysis.FiniteFactor.CrossedProduct.PhaseDecay + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Finset +open scoped ENNReal Topology +noncomputable section + +theorem unitInterval_order_failure (a : ℝ) (ha : 0 ≤ a) : + unitIntervalMeasure {x : ℝ | Int.fract (x+a) < x} ≤ ENNReal.ofReal a := by + have hsub : {x : ℝ | Int.fract (x+a) < x} ⊆ {x : ℝ | Int.floor (x+a) ≠ 0} := by + intro x hx he + change Int.fract (x+a) < x at hx + rw [Int.fract, he, Int.cast_zero, sub_zero] at hx + linarith + simpa only [abs_of_nonneg ha] using (measure_mono hsub).trans (unitInterval_floor_exception a) + +def sourceTailOrderFailure (θ : SourceCoordinate → ℝ) (s n : ℕ) : Set (SourceCoordinate → ℝ) := + ⋃ r : ℕ, ⋃ i : Fin (sourceBlockSize (s+r)), + {x | Int.fract (x ⟨s+r,i⟩+(n : ℝ)*θ ⟨s+r,i⟩) < x ⟨s+r,i⟩} + +theorem SourceAngles.block_sum_le {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) (s : ℕ) : + (∑ i : Fin (sourceBlockSize s), θ ⟨s,i⟩) ≤ 2 / ((sourceStageState s).K : ℝ) := by + have hh := Finset.sum_le_sum (fun i (_ : i ∈ Finset.univ) => (hθ ⟨s,i⟩).2) + have he : (∑ _i : Fin (sourceBlockSize s), + 2 / ((sourceBlockSize s : ℝ)*(sourceStageState s).K)) = + 2 / ((sourceStageState s).K : ℝ) := by + simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] + field_simp [(sourceBlockSize_pos s).ne', (sourceCutoff_pos s).ne'] + exact hh.trans_eq he + +theorem SourceAngles.tail_block_summable {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) (s : ℕ) : + Summable (fun r : ℕ => ∑ i : Fin (sourceBlockSize (s+r)), θ ⟨s+r,i⟩) := by + have hh := sourceCutoff_reciprocal_summable.comp_injective (add_right_injective s) + have hs : Summable (fun r => 2 / ((sourceStageState (s+r)).K : ℝ)) := by + simpa [div_eq_mul_inv] using hh.mul_left 2 + exact hs.of_nonneg_of_le (fun r => Finset.sum_nonneg (fun i _ => hθ.nonneg _)) + (fun r => hθ.block_sum_le (s+r)) + +/-- Actual Haar probability of violating order in any tail coordinate, for +one positive orbit power. The countably infinite union is controlled. -/ +theorem SourceAngles.tail_order_probability {θ : SourceCoordinate → ℝ} (hθ : SourceAngles θ) (s n : ℕ) : + (Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure)) + (sourceTailOrderFailure θ s n) ≤ ENNReal.ofReal (4*(n : ℝ)/((sourceStageState s).K : ℝ)) := by + let μ := Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure) + have hcoord (i : SourceCoordinate) : + μ {x | Int.fract (x i+(n : ℝ)*θ i) < x i} ≤ ENNReal.ofReal ((n : ℝ)*θ i) := by + have hm : MeasurableSet {t : ℝ | Int.fract (t+(n : ℝ)*θ i) < t} := by + apply measurableSet_lt + · exact sourceFract_measurable.comp (by fun_prop) + · exact measurable_id + have he := congrArg (fun ν : Measure ℝ => ν {t : ℝ | Int.fract (t+(n : ℝ)*θ i) < t}) + (Measure.infinitePi_map_eval (fun _ : SourceCoordinate => unitIntervalMeasure) i) + rw [Measure.map_apply (measurable_pi_apply i) hm] at he + rw [show μ {x | Int.fract (x i+(n : ℝ)*θ i) < x i} = + unitIntervalMeasure {t | Int.fract (t+(n : ℝ)*θ i) < t} from he] + exact unitInterval_order_failure _ (mul_nonneg (Nat.cast_nonneg _) (hθ.nonneg _)) + have hblock (r : ℕ) : + μ (⋃ i : Fin (sourceBlockSize (s+r)), + {x | Int.fract (x ⟨s+r,i⟩+(n : ℝ)*θ ⟨s+r,i⟩) < x ⟨s+r,i⟩}) ≤ + ENNReal.ofReal ((n : ℝ)*(∑ i : Fin (sourceBlockSize (s+r)), θ ⟨s+r,i⟩)) := by + apply (measure_iUnion_le _).trans + calc + _ ≤ ∑' i : Fin (sourceBlockSize (s+r)), ENNReal.ofReal ((n : ℝ)*θ ⟨s+r,i⟩) := + ENNReal.tsum_le_tsum (fun i => hcoord ⟨s+r,i⟩) + _ = _ := by + rw [tsum_fintype, ← ENNReal.ofReal_sum_of_nonneg (fun i _ => mul_nonneg (Nat.cast_nonneg _) (hθ.nonneg _)), + ← Finset.mul_sum] + calc + _ ≤ ∑' r : ℕ, μ (⋃ i : Fin (sourceBlockSize (s+r)), + {x | Int.fract (x ⟨s+r,i⟩+(n : ℝ)*θ ⟨s+r,i⟩) < x ⟨s+r,i⟩}) := measure_iUnion_le _ + _ ≤ ∑' r : ℕ, ENNReal.ofReal ((n : ℝ)*(∑ i : Fin (sourceBlockSize (s+r)), θ ⟨s+r,i⟩)) := + ENNReal.tsum_le_tsum hblock + _ = ENNReal.ofReal ((n : ℝ)*sourceTailAngleSum θ s) := by + rw [← ENNReal.ofReal_tsum_of_nonneg + (fun r => mul_nonneg (Nat.cast_nonneg _) (Finset.sum_nonneg (fun i _ => hθ.nonneg _))) + ((hθ.tail_block_summable s).mul_left (n : ℝ)), tsum_mul_left] + rfl + _ ≤ _ := ENNReal.ofReal_le_ofReal (by + have hh := mul_le_mul_of_nonneg_left (hθ.tail_sum_bound s) (Nat.cast_nonneg n) + simpa [mul_div_assoc, mul_comm, mul_left_comm] using hh) + +/-- The source's trimming error tends to zero for every admissible angle +realization, uniformly for all positive powers up to Q_s=m_s^((7/10)m_s). -/ +theorem sourceSampling_tail_error_tendsto : + Tendsto (fun s => 4*(sourceBlockSize s : ℝ)^(-(sourceBlockSize s : ℝ)/20)) atTop (𝓝 0) := by + have ht : Tendsto (fun s => 4*(sourceBlockSize s : ℝ)⁻¹) atTop (𝓝 0) := by + have hi : Tendsto (fun s => (sourceBlockSize s : ℝ)⁻¹) atTop (𝓝 0) := + tendsto_inv_atTop_zero.comp (tendsto_natCast_atTop_atTop.comp sourceBlockSize_tendsto) + simpa using hi.const_mul (4 : ℝ) + apply squeeze_zero (fun s => by positivity) _ ht + intro s + apply mul_le_mul_of_nonneg_left _ (by norm_num) + rw [← Real.rpow_neg_one] + have hm : (100 : ℝ) ≤ sourceBlockSize s := by exact_mod_cast (sourceStage s).m_ge_100 + exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by linarith) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusCharacters.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusCharacters.lean new file mode 100644 index 0000000000000000000000000000000000000000..b5588071cf74f8d7e2c163af5e224d031fe17ed0 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusCharacters.lean @@ -0,0 +1,92 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusModel +import OAI.Analysis.FiniteFactor.CrossedProduct.AngleRelations +import Mathlib.Analysis.Fourier.AddCircle + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Set Algebra Submodule +open scoped ENNReal ComplexConjugate +noncomputable section + +def sourceCharacter (v : SourceCoordinate →₀ ℤ) : C(SourceTorus, ℂ) where + toFun x := fourier 1 (v.sum fun i n => n • x i) + continuous_toFun := (fourier 1).continuous.comp (by + unfold Finsupp.sum + exact continuous_finsetSum _ fun i _ => (continuous_apply i).zsmul (v i)) + +theorem sourceCharacter_zero : sourceCharacter 0 = 1 := by + ext x + simp [sourceCharacter] + +theorem sourceCharacter_add (v w : SourceCoordinate →₀ ℤ) : + sourceCharacter (v+w) = sourceCharacter v * sourceCharacter w := by + ext x + simp only [sourceCharacter, ContinuousMap.coe_mk, ContinuousMap.mul_apply] + rw [Finsupp.sum_add_index (by simp) (by intros; simp [add_zsmul])] + simp [fourier, AddCircle.toCircle_add] + +theorem sourceCharacter_neg (v : SourceCoordinate →₀ ℤ) : + sourceCharacter (-v) = star (sourceCharacter v) := by + ext x + have he := congrArg (fun f : C(SourceTorus, ℂ) => f x) (sourceCharacter_add v (-v)) + rw [add_neg_cancel, sourceCharacter_zero] at he + have hn : ‖sourceCharacter v x‖ = 1 := by + change ‖(AddCircle.toCircle (1 • v.sum (fun i n => n • x i)) : ℂ)‖ = 1 + exact Circle.norm_coe _ + have hc : sourceCharacter v x * star (sourceCharacter v x) = 1 := by + change sourceCharacter v x * conj (sourceCharacter v x) = 1 + rw [Complex.mul_conj, Complex.normSq_eq_norm_sq, hn] + norm_num + change sourceCharacter (-v) x = star (sourceCharacter v x) + exact mul_left_cancel₀ (by intro h; simp [h] at hn) (he.symm.trans hc.symm) + +def sourceCharacterAlgebra : StarSubalgebra ℂ C(SourceTorus, ℂ) where + toSubalgebra := Algebra.adjoin ℂ (range sourceCharacter) + star_mem' := by + change Algebra.adjoin ℂ (range sourceCharacter) ≤ star (Algebra.adjoin ℂ (range sourceCharacter)) + refine adjoin_le ?_ + rintro _ ⟨v,rfl⟩ + exact subset_adjoin ⟨-v,sourceCharacter_neg v⟩ + +theorem sourceCharacterAlgebra_span : + sourceCharacterAlgebra.toSubalgebra.toSubmodule = span ℂ (range sourceCharacter) := by + apply adjoin_eq_span_of_subset + refine .trans (fun x => Submonoid.closure_induction (fun _ => id) ⟨0,sourceCharacter_zero⟩ ?_) subset_span + rintro _ _ _ _ ⟨v,rfl⟩ ⟨w,rfl⟩ + exact ⟨v+w,sourceCharacter_add v w⟩ + +theorem sourceCharacter_single (i : SourceCoordinate) (x : SourceTorus) : + sourceCharacter (Finsupp.single i 1) x = fourier 1 (x i) := by + simp [sourceCharacter, Finsupp.sum_single_index] + +theorem sourceCharacterAlgebra_separates : sourceCharacterAlgebra.SeparatesPoints := by + classical + intro x y hxy + obtain ⟨i,hi⟩ := Function.ne_iff.mp hxy + refine ⟨_,⟨sourceCharacter (Finsupp.single i 1),subset_adjoin ⟨_,rfl⟩,rfl⟩,?_⟩ + dsimp only + rw [sourceCharacter_single,sourceCharacter_single,fourier_one,fourier_one,Ne,Circle.coe_inj] + exact fun he => hi (AddCircle.injective_toCircle one_ne_zero he) + +/-- Uniform density on the full countable product, with no finite-dimensional truncation assumption. -/ +theorem sourceCharacter_span_dense : + (span ℂ (range sourceCharacter)).topologicalClosure = ⊤ := by + rw [← sourceCharacterAlgebra_span] + exact congrArg (Subalgebra.toSubmodule ∘ StarSubalgebra.toSubalgebra) + (ContinuousMap.starSubalgebra_topologicalClosure_eq_top_of_separatesPoints _ + sourceCharacterAlgebra_separates) + +abbrev sourceCharacterL2 (v : SourceCoordinate →₀ ℤ) : Lp ℂ 2 sourceTorusHaar := + ContinuousMap.toLp 2 sourceTorusHaar ℂ (sourceCharacter v) + +theorem sourceCharacterL2_span_dense : + (span ℂ (range sourceCharacterL2)).topologicalClosure = ⊤ := by + simpa only [map_span,ContinuousLinearMap.coe_coe,← range_comp,Function.comp_def] using + (ContinuousMap.toLp_denseRange ℂ sourceTorusHaar ℂ (by norm_num : (2 : ℝ≥0∞) ≠ ∞)).topologicalClosure_map_submodule + sourceCharacter_span_dense + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusErgodic.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusErgodic.lean new file mode 100644 index 0000000000000000000000000000000000000000..679e36da68a7afa27d4055bb9bad5223ba34b33e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusErgodic.lean @@ -0,0 +1,120 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusRotation +import Mathlib.Dynamics.Ergodic.Function +import Mathlib.Analysis.InnerProductSpace.Orthogonal +import Mathlib.MeasureTheory.Function.LpSpace.Indicator + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Set Submodule +open scoped ENNReal ComplexConjugate +noncomputable section + +abbrev sourceRotationL2 (θ : SourceCoordinate → ℝ) : + Lp ℂ 2 sourceTorusHaar →ₗᵢ[ℂ] Lp ℂ 2 sourceTorusHaar := + Lp.compMeasurePreservingₗᵢ ℂ (sourceTorusRotationStep θ) (sourceTorusRotationStep_preserving θ) + +theorem sourceCharacterL2_zero_inner : + inner ℂ (sourceCharacterL2 0) (sourceCharacterL2 0) = 1 := by + rw [ContinuousMap.inner_toLp] + simp [sourceCharacter_zero] + +theorem sourceRotationL2_zero_character (θ : SourceCoordinate → ℝ) : + sourceRotationL2 θ (sourceCharacterL2 0) = sourceCharacterL2 0 := by + change Lp.compMeasurePreserving _ _ _ = _ + rw [sourceCharacterL2_rotation,sourceCharacter_zero] + simp + +/-- An invariant vector orthogonal to the constant character is zero. -/ +theorem sourceRotationL2_fixed_orthogonal_zero (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) (f : Lp ℂ 2 sourceTorusHaar) + (hf : sourceRotationL2 θ f = f) (h0 : inner ℂ (sourceCharacterL2 0) f = 0) : f = 0 := by + have hchar (v : SourceCoordinate →₀ ℤ) : inner ℂ f (sourceCharacterL2 v) = 0 := by + by_cases hv : v = 0 + · subst v + exact inner_eq_zero_symm.mpr h0 + · have he := (sourceRotationL2 θ).inner_map_map f (sourceCharacterL2 v) + rw [hf] at he + change inner ℂ f (Lp.compMeasurePreserving _ _ _) = _ at he + rw [sourceCharacterL2_rotation,inner_smul_right] at he + have hn := sourceCharacter_nonresonant θ hr v hv + by_contra hz + exact hn (mul_right_cancel₀ hz (he.trans (one_mul _).symm)) + have hs : span ℂ (range sourceCharacterL2) ≤ (innerSL ℂ f).ker := by + apply span_le.mpr + rintro _ ⟨v,rfl⟩ + exact hchar v + have ht : (span ℂ (range sourceCharacterL2)).topologicalClosure ≤ (innerSL ℂ f).ker := + Submodule.topologicalClosure_minimal _ hs (innerSL ℂ f).isClosed_ker + rw [sourceCharacterL2_span_dense] at ht + have hh : inner ℂ f f = 0 := ht (show f ∈ (⊤ : Submodule ℂ (Lp ℂ 2 sourceTorusHaar)) from trivial) + exact inner_self_eq_zero.mp hh + +theorem sourceRotationL2_fixed_constant (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) (f : Lp ℂ 2 sourceTorusHaar) + (hf : sourceRotationL2 θ f = f) : + ∃ c : ℂ, f = c • sourceCharacterL2 0 := by + let c := inner ℂ (sourceCharacterL2 0) f + refine ⟨c,sub_eq_zero.mp (sourceRotationL2_fixed_orthogonal_zero θ hr + (f-c • sourceCharacterL2 0) ?_ ?_)⟩ + · rw [map_sub,map_smul,hf,sourceRotationL2_zero_character] + · rw [inner_sub_right,inner_smul_right,sourceCharacterL2_zero_inner,mul_one] + exact sub_self _ + +theorem sourceTorus_invariant_memLp_constant (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) {f : SourceTorus → ℂ} + (hf : MemLp f 2 sourceTorusHaar) + (hinv : f ∘ sourceTorusRotationStep θ =ᵐ[sourceTorusHaar] f) : + ∃ c : ℂ, f =ᵐ[sourceTorusHaar] fun _ => c := by + have hfix : sourceRotationL2 θ (hf.toLp f) = hf.toLp f := by + apply Lp.ext + filter_upwards [Lp.coeFn_compMeasurePreserving (hf.toLp f) (sourceTorusRotationStep_preserving θ), + (sourceTorusRotationStep_preserving θ).quasiMeasurePreserving.ae hf.coeFn_toLp, + hf.coeFn_toLp,hinv] with x hc ht hx hi + exact hc.trans (ht.trans (hi.trans hx.symm)) + obtain ⟨c,hc⟩ := sourceRotationL2_fixed_constant θ hr (hf.toLp f) hfix + refine ⟨c,?_⟩ + have he := ContinuousMap.coeFn_toLp (𝕜 := ℂ) (p := (2 : ℝ≥0∞)) sourceTorusHaar (sourceCharacter 0) + filter_upwards [hf.coeFn_toLp,Lp.coeFn_smul c (sourceCharacterL2 0),he] with x hx hs he + rw [hc,hs,Pi.smul_apply,smul_eq_mul,he,sourceCharacter_zero] at hx + simpa using hx.symm + +/-- Ergodicity of the constructed countable-torus rotation itself. -/ +theorem sourceTorusRotationStep_ergodic (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) : Ergodic (sourceTorusRotationStep θ) sourceTorusHaar := by + classical + refine ⟨sourceTorusRotationStep_preserving θ,⟨fun s hs hi => ?_⟩⟩ + have hm : MemLp (s.indicator (fun _ : SourceTorus => (1 : ℂ))) 2 sourceTorusHaar := + (memLp_const (1 : ℂ)).indicator hs + have hinv : (s.indicator (fun _ : SourceTorus => (1 : ℂ))) ∘ sourceTorusRotationStep θ =ᵐ[sourceTorusHaar] + s.indicator (fun _ : SourceTorus => (1 : ℂ)) := by + apply Eventually.of_forall + intro x + have hh : sourceTorusRotationStep θ x ∈ s ↔ x ∈ s := by + change x ∈ (sourceTorusRotationStep θ) ⁻¹' s ↔ x ∈ s + rw [hi] + by_cases hx : x ∈ s + · simp [Function.comp_apply,hx,hh.mpr hx] + · have ht : sourceTorusRotationStep θ x ∉ s := fun h => hx (hh.mp h) + simp [Function.comp_apply,hx,ht] + obtain ⟨c,hc⟩ := sourceTorus_invariant_memLp_constant θ hr hm hinv + rw [Filter.eventuallyEmptyOrUniv_iff'] + by_cases h1 : c = 1 + · right + filter_upwards [hc] with x hx + apply propext + by_cases hxs : x ∈ s + · simp [hxs] + · simp [hxs,h1] at hx + · left + filter_upwards [hc] with x hx + by_cases hxs : x ∈ s + · simp [hxs] at hx + exact (h1 hx.symm).elim + · apply propext + simp [hxs] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusModel.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusModel.lean new file mode 100644 index 0000000000000000000000000000000000000000..3ca2f8b3961720c1f4a699127ae72233a95161fd --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusModel.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.FiniteFactor.OrbitSampling.CompactTorus + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Classical +noncomputable section + +abbrev SourceTorus := SourceCoordinate → UnitAddCircle +abbrev sourceTorusHaar : Measure SourceTorus := + Measure.infinitePi (fun _ : SourceCoordinate => (volume : Measure UnitAddCircle)) + +instance sourceUnitCircle_probability : IsProbabilityMeasure (volume : Measure UnitAddCircle) := by + rw [← sourceCircle_mk_preserving.map_eq] + infer_instance + +def sourceTorusQuotient (x : SourceCoordinate → ℝ) : SourceTorus := fun i => (x i : UnitAddCircle) +def sourceTorusRepresentative (z : SourceTorus) : SourceCoordinate → ℝ := + fun i => sourceCircleRepresentative (z i) + +theorem sourceTorusQuotient_preserving : MeasurePreserving sourceTorusQuotient sourceSamplingHaar sourceTorusHaar := by + refine ⟨Measurable.of_eval (fun i => sourceCircle_mk_preserving.measurable.comp (measurable_pi_apply i)),?_⟩ + unfold sourceTorusQuotient + rw [Measure.infinitePi_map_pi _ (fun _ => sourceCircle_mk_preserving.measurable)] + simp only [sourceCircle_mk_preserving.map_eq] + +theorem sourceTorusRepresentative_preserving : + MeasurePreserving sourceTorusRepresentative sourceTorusHaar sourceSamplingHaar := by + refine ⟨Measurable.of_eval (fun i => sourceCircleRepresentative_measurable.comp (measurable_pi_apply i)),?_⟩ + unfold sourceTorusRepresentative + rw [Measure.infinitePi_map_pi _ (fun _ => sourceCircleRepresentative_measurable)] + simp only [sourceCircleRepresentative_preserving.map_eq] + +theorem sourceTorusRepresentative_cube (z : SourceTorus) : + ∀ i, sourceTorusRepresentative z i ∈ Set.Ico (0 : ℝ) 1 := by + intro i + change ((AddCircle.equivIco 1 0) (z i)).val ∈ Set.Ico (0 : ℝ) 1 + simpa only [zero_add] using (AddCircle.equivIco 1 0 (z i)).property + +theorem sourceTorusRepresentative_quotient (x : SourceCoordinate → ℝ) + (hx : ∀ i, x i ∈ Set.Ico (0 : ℝ) 1) : + sourceTorusRepresentative (sourceTorusQuotient x) = x := by + funext i + exact (sourceCircleRepresentative_coe (x i)).trans (Int.fract_eq_self.mpr (hx i)) + +theorem sourceTorusQuotient_representative (z : SourceTorus) : + sourceTorusQuotient (sourceTorusRepresentative z) = z := by + funext i + exact (AddCircle.equivIco 1 0).symm_apply_apply (z i) + +/-- Change of variables for actual weighted laws across the real +representatives and compact torus, with the inverse needed only almost everywhere. -/ +theorem sourceTorusQuotient_withDensity (w : (SourceCoordinate → ℝ) → ℝ≥0∞) (hw : Measurable w) : + (sourceSamplingHaar.withDensity w).map sourceTorusQuotient = + sourceTorusHaar.withDensity (fun z => w (sourceTorusRepresentative z)) := by + ext A hA + have hQ := sourceTorusQuotient_preserving + have hR := sourceTorusRepresentative_preserving + rw [Measure.map_apply hQ.measurable hA,withDensity_apply _ (hQ.measurable hA),withDensity_apply _ hA, + ← lintegral_indicator (hQ.measurable hA),← lintegral_indicator hA] + have hm := (hw.comp hR.measurable).indicator hA + calc + _ = ∫⁻ x, A.indicator (fun z => w (sourceTorusRepresentative z)) (sourceTorusQuotient x) ∂sourceSamplingHaar := by + apply lintegral_congr_ae + filter_upwards [sourceSamplingHaar_cube] with x hx + change (if sourceTorusQuotient x ∈ A then w x else 0) = + (if sourceTorusQuotient x ∈ A then w (sourceTorusRepresentative (sourceTorusQuotient x)) else 0) + rw [sourceTorusRepresentative_quotient x hx] + _ = _ := hQ.lintegral_comp hm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusOperatorField.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusOperatorField.lean new file mode 100644 index 0000000000000000000000000000000000000000..eacd277f53f428d4659be2d04d8ebcd8fd5bb94b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusOperatorField.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.WeightedShiftField +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusModel + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The proved source field on the actual compact sampling torus. -/ +def sourceTorusOperatorField + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (z : SourceTorus) : + SourceFiberHilbert →L[ℂ] SourceFiberHilbert := + sourceOperatorField H (sourceTorusRepresentative z) + +theorem sourceTorusOperatorField_stronglyMeasurable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (v : SourceFiberHilbert) : + StronglyMeasurable (fun z => sourceTorusOperatorField H z v) := + (sourceOperatorField_stronglyMeasurable H v).comp_measurable sourceTorusRepresentative_preserving.measurable + +theorem sourceTorusOperatorField_norm + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (z : SourceTorus) : + ‖sourceTorusOperatorField H z‖ ≤ ‖H‖ := sourceOperatorField_norm H _ + +theorem sourceTorusOperatorField_projection (θ : SourceCoordinate → ℝ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) : + ∀ᵐ z ∂sourceTorusHaar, IsStarProjection (sourceTorusOperatorField p z) := + sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (sourceOperatorField_projection θ hp hproj) + +theorem sourceTorusOperatorField_invariant (θ : SourceCoordinate → ℝ) + {p T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hT : T ∈ sourceAlgebra θ) + (hinv : (1-p)*T*p = 0) : + ∀ᵐ z ∂sourceTorusHaar, + (1-sourceTorusOperatorField p z)*sourceTorusOperatorField T z*sourceTorusOperatorField p z = 0 := + sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (sourceOperatorField_invariant θ hp hT hinv) + +theorem sourceTorusOperatorField_sourceOperator_pow (θ : SourceCoordinate → ℝ) + (hθ : SourceAngles θ) (q : ℕ) : + ∀ᵐ z ∂sourceTorusHaar, ∀ (v : SourceFiberHilbert) (k : ℤ), + (sourceTorusOperatorField + (sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg ^ q) z v) k = + (sourceCocycle θ sourceLogWeight q + (coordinateRotate θ (k - (q : ℤ)) (sourceTorusRepresentative z)) : ℂ) * + v (k - (q : ℤ)) := + sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (sourceOperatorField_sourceOperator_pow θ hθ q) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusRotation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusRotation.lean new file mode 100644 index 0000000000000000000000000000000000000000..18891d894cd8a895a9680887775832e3e84ca017 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TorusRotation.lean @@ -0,0 +1,64 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.TorusCharacters + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter Set +open scoped ENNReal ComplexConjugate +noncomputable section + +def sourceTorusRotationStep (θ : SourceCoordinate → ℝ) (x : SourceTorus) : SourceTorus := + x + sourceTorusQuotient θ + +theorem sourceTorusRotationStep_preserving (θ : SourceCoordinate → ℝ) : + MeasurePreserving (sourceTorusRotationStep θ) sourceTorusHaar sourceTorusHaar := by + have hm (i : SourceCoordinate) : Measurable (fun z : UnitAddCircle => z + (θ i : UnitAddCircle)) := by fun_prop + refine ⟨by unfold sourceTorusRotationStep; fun_prop,?_⟩ + change (Measure.infinitePi _).map (fun x i => x i + (θ i : UnitAddCircle)) = _ + rw [Measure.infinitePi_map_pi _ hm] + simp only [(measurePreserving_add_right (volume : Measure UnitAddCircle) _).map_eq] + +theorem sourceCharacter_translate (v : SourceCoordinate →₀ ℤ) (x y : SourceTorus) : + sourceCharacter v (x+y) = sourceCharacter v x * sourceCharacter v y := by + simp only [sourceCharacter, ContinuousMap.coe_mk,Pi.add_apply,smul_add,Finsupp.sum, + Finset.sum_add_distrib] + simp [fourier,AddCircle.toCircle_add] + +/-- Rational independence rules out every nonconstant character eigenvalue 1. -/ +theorem sourceCharacter_nonresonant (θ : SourceCoordinate → ℝ) + (hr : SourceRationalIndependent θ) (v : SourceCoordinate →₀ ℤ) (hv : v ≠ 0) : + sourceCharacter v (sourceTorusQuotient θ) ≠ 1 := by + intro h + have hz : v.sum (fun i n => n • (θ i : UnitAddCircle)) = 0 := by + apply AddCircle.injective_toCircle one_ne_zero + apply Subtype.ext + simpa [sourceCharacter,fourier,sourceTorusQuotient] using h + have he : ((v.sum fun i n => (n : ℝ)*θ i : ℝ) : UnitAddCircle) = + v.sum (fun i n => n • (θ i : UnitAddCircle)) := by + unfold Finsupp.sum + induction v.support using Finset.induction_on with + | empty => simp + | @insert i s hi ih => + rw [Finset.sum_insert hi,Finset.sum_insert hi,AddCircle.coe_add,ih] + congr 1 + simpa only [zsmul_eq_mul] using (AddCircle.coe_zsmul (1 : ℝ) (n := v i) (x := θ i)) + rw [← he,AddCircle.coe_eq_zero_iff] at hz + obtain ⟨c,hc⟩ := hz + exact hv (hr v c (by simpa using hc.symm)).1 + +theorem sourceCharacterL2_rotation (θ : SourceCoordinate → ℝ) (v : SourceCoordinate →₀ ℤ) : + Lp.compMeasurePreserving (sourceTorusRotationStep θ) (sourceTorusRotationStep_preserving θ) + (sourceCharacterL2 v) = sourceCharacter v (sourceTorusQuotient θ) • sourceCharacterL2 v := by + apply Lp.ext + have he := ContinuousMap.coeFn_toLp (𝕜 := ℂ) (p := (2 : ℝ≥0∞)) sourceTorusHaar (sourceCharacter v) + filter_upwards [Lp.coeFn_compMeasurePreserving (sourceCharacterL2 v) (sourceTorusRotationStep_preserving θ), + (sourceTorusRotationStep_preserving θ).quasiMeasurePreserving.ae he,he, + Lp.coeFn_smul (sourceCharacter v (sourceTorusQuotient θ)) (sourceCharacterL2 v)] + with x hc ht hx hs + rw [hc,Function.comp_apply,ht,hs,Pi.smul_apply,smul_eq_mul,hx] + exact (sourceCharacter_translate v x (sourceTorusQuotient θ)).trans (mul_comm _ _) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Trace.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Trace.lean new file mode 100644 index 0000000000000000000000000000000000000000..652fe704bc84f904039c041b0aa4b8b40c7409bb --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Trace.lean @@ -0,0 +1,32 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ConjugationVacuum + +namespace OAI + +namespace FiniteFactor +noncomputable section + +/-- Traciality of the actual, previously constructed normal vacuum functional. -/ +theorem sourceVacuumFunctional_tracial (θ : SourceCoordinate → ℝ) + {A B : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hA : A ∈ sourceAlgebra θ) (hB : B ∈ sourceAlgebra θ) : + sourceVacuumFunctional (A * B) = sourceVacuumFunctional (B * A) := by + have hh := sourceConjugation_inner_symm θ (A sourceVacuum) (B sourceVacuum) + rw [sourceConjugation_algebra_vacuum θ hA, sourceConjugation_algebra_vacuum θ hB] at hh + have hc := congrArg (starRingEnd ℂ) hh + rw [inner_conj_symm, inner_conj_symm] at hc + change inner ℂ sourceVacuum (A (B sourceVacuum)) = inner ℂ sourceVacuum (B (A sourceVacuum)) + rw [← ContinuousLinearMap.adjoint_inner_left A (B sourceVacuum) sourceVacuum, + ← ContinuousLinearMap.adjoint_inner_left B (A sourceVacuum) sourceVacuum] + exact hc.symm + +/-- Equality of the two square expectations is derived from traciality. -/ +theorem sourceVacuumFunctional_square_commute (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + sourceVacuumFunctional (star H * H) = sourceVacuumFunctional (H * star H) := + sourceVacuumFunctional_tracial θ (star_mem hH) hH + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TracialRepresentation.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TracialRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..6567baf64621ffb05dc0490f92d41f1d46658d41 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TracialRepresentation.lean @@ -0,0 +1,30 @@ +import OAI.Analysis.FiniteFactor.OperatorTracialRepresentation +import OAI.Analysis.FiniteFactor.CrossedProduct.FiniteAlgebra + +namespace OAI + +namespace FiniteFactor +noncomputable section + +/-- Actual instantiation of the certified tracial-representation API. +Both central obligations are proved for this source algebra. -/ +def sourceTracialRepresentation (θ : SourceCoordinate → ℝ) : + TracialRepresentation (sourceAlgebra θ) where + vector := sourceVacuum + norm_vector := sourceVacuum_norm + cyclic := fun S T => sourceVacuumFunctional_tracial θ S.property T.property + separating := fun T hT => Subtype.ext (sourceVacuum_separating θ T.property hT) + +theorem sourceTracialRepresentation_trace (θ : SourceCoordinate → ℝ) + (T : (sourceAlgebra θ).toStarSubalgebra) : + (sourceTracialRepresentation θ).trace T = sourceVacuumFunctional T := rfl + +theorem sourceTracialRepresentation_normal (θ : SourceCoordinate → ℝ) : + @Continuous _ _ (sourceAlgebraUltraweakTopology θ) inferInstance + (sourceTracialRepresentation θ).trace := + sourceVacuumFunctional_algebra_normal θ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Transport.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Transport.lean new file mode 100644 index 0000000000000000000000000000000000000000..3a5458826ca5ea64aaa9b835b8941ff5c072a85e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/Transport.lean @@ -0,0 +1,100 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.MultiplicationAdjoint + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +/-- Combined integer base rotation and fiber translation. -/ +def sourceTransportIndex (θ : SourceCoordinate → ℝ) (n m : ℤ) + (z : (SourceCoordinate → ℝ) × ℤ) : (SourceCoordinate → ℝ) × ℤ := + (coordinateRotate θ n z.1, z.2 - m) + +theorem sourceTransportIndex_preserving (θ : SourceCoordinate → ℝ) (n m : ℤ) : + MeasurePreserving (sourceTransportIndex θ n m) + (sourceMeasure SourceCoordinate) (sourceMeasure SourceCoordinate) := by + have hm : Measurable (fun k : ℤ => k-m) := measurable_of_countable _ + have hi : Function.Injective (fun k : ℤ => k-m) := by intro a b h; dsimp at h; omega + have hs : Function.Surjective (fun k : ℤ => k-m) := by intro k; exact ⟨k+m, by dsimp; omega⟩ + have hp : MeasurePreserving (fun k : ℤ => k-m) Measure.count Measure.count := by + refine ⟨hm, ?_⟩ + ext S hS + rw [Measure.map_apply hm hS, Measure.count_apply (hS.preimage hm), Measure.count_apply hS, + ← hi.encard_image, Set.image_preimage_eq S hs] + exact (coordinateRotate_preserving θ n).prod hp + +def sourceTransport (θ : SourceCoordinate → ℝ) (n m : ℤ) : + SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate := + (Lp.compMeasurePreservingₗᵢ ℂ (sourceTransportIndex θ n m) + (sourceTransportIndex_preserving θ n m)).toContinuousLinearMap + +theorem sourceTransport_apply_ae (θ : SourceCoordinate → ℝ) (n m : ℤ) + (f : SourceHilbert SourceCoordinate) : + sourceTransport θ n m f =ᵐ[sourceMeasure SourceCoordinate] + fun z => f (sourceTransportIndex θ n m z) := + Lp.coeFn_compMeasurePreserving f (sourceTransportIndex_preserving θ n m) + +theorem sourceTransport_mul (θ : SourceCoordinate → ℝ) (n m p q : ℤ) : + sourceTransport θ n m * sourceTransport θ p q = sourceTransport θ (n+p) (m+q) := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + have ht := (sourceTransportIndex_preserving θ n m).quasiMeasurePreserving.ae + (sourceTransport_apply_ae θ p q f) + filter_upwards [sourceTransport_apply_ae θ n m (sourceTransport θ p q f), + sourceTransport_apply_ae θ (n+p) (m+q) f, ht] with z h1 h2 h3 + change (sourceTransport θ n m (sourceTransport θ p q f)) z = _ + rw [h1, h2, h3] + congr 1 + simp [sourceTransportIndex, coordinateRotate_add, sub_sub] + +theorem sourceHilbert_cube : ∀ᵐ z ∂sourceMeasure SourceCoordinate, + ∀ i, z.1 i ∈ Set.Ico (0 : ℝ) 1 := by + have hc : ∀ᵐ x ∂Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure), + ∀ i, x i ∈ Set.Ico (0 : ℝ) 1 := by + rw [ae_all_iff] + intro i + have hh : ∀ᵐ t ∂(Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure)).map + (fun x => x i), t ∈ Set.Ico (0 : ℝ) 1 := by + rw [Measure.infinitePi_map_eval] + exact ae_restrict_mem measurableSet_Ico + exact (ae_map_iff (measurable_pi_apply i).aemeasurable measurableSet_Ico).mp hh + exact Measure.quasiMeasurePreserving_fst.ae hc + +theorem sourceTransport_zero (θ : SourceCoordinate → ℝ) : sourceTransport θ 0 0 = 1 := by + apply ContinuousLinearMap.ext + intro f + apply Lp.ext + filter_upwards [sourceTransport_apply_ae θ 0 0 f, sourceHilbert_cube] with z hz hc + change (sourceTransport θ 0 0 f) z = f z + rw [hz] + congr 1 + apply Prod.ext + · funext i + simpa [sourceTransportIndex, coordinateRotate] using Int.fract_eq_self.mpr (hc i) + · simp [sourceTransportIndex] + +theorem sourceTransport_star (θ : SourceCoordinate → ℝ) (n m : ℤ) : + star (sourceTransport θ n m) = sourceTransport θ (-n) (-m) := by + have hi (f h : SourceHilbert SourceCoordinate) : + inner ℂ (sourceTransport θ n m f) (sourceTransport θ n m h) = inner ℂ f h := + (Lp.compMeasurePreservingₗᵢ ℂ (sourceTransportIndex θ n m) + (sourceTransportIndex_preserving θ n m)).inner_map_map f h + have hinv : sourceTransport θ n m * sourceTransport θ (-n) (-m) = 1 := by + rw [sourceTransport_mul]; simp only [add_neg_cancel, sourceTransport_zero] + rw [ContinuousLinearMap.star_eq_adjoint] + symm + apply (ContinuousLinearMap.eq_adjoint_iff _ _).mpr + intro f h + have hih := hi (sourceTransport θ (-n) (-m) f) h + have he : sourceTransport θ n m (sourceTransport θ (-n) (-m) f) = f := by + change (sourceTransport θ n m * sourceTransport θ (-n) (-m)) f = f + rw [hinv]; rfl + rw [he] at hih + exact hih.symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TruncatedBound.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TruncatedBound.lean new file mode 100644 index 0000000000000000000000000000000000000000..dc60c4b9356a13c38713783e7c6c01e7b8b172c4 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/TruncatedBound.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionErrors + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +theorem sourceTruncatedCoefficient_measurable (θ : SourceCoordinate → ℝ) + (p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (j : ℕ) (n : ℤ) : + Measurable (sourceTruncatedCoefficient θ p j n) := by + unfold sourceTruncatedCoefficient laurentProductCoefficient + apply Finset.measurable_sum + intro i _ + apply Finset.measurable_sum + intro k _ + split_ifs + · exact ((sourceProjectionLeftCoefficient_measurable θ p _).comp (sourceBiasedEndpoint_measurable _)).mul + ((sourceProjectionRightCoefficient_measurable θ p _).comp (sourceBiasedEndpoint_measurable _)) + · exact measurable_const + +/-- Each actual truncated coefficient has norm at most one under the full +biased law. This follows from the original absolute convolution bound. -/ +theorem sourceTruncatedCoefficient_norm_le_one (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j n : ℕ) : ∀ᵐ ω ∂sourceBiasedLaw j, ‖sourceTruncatedCoefficient θ p j n ω‖ ≤ 1 := by + filter_upwards [sourceProjection_convolution θ hθ hs hp hproj hinv j] with ω hc + unfold sourceTruncatedCoefficient + rw [laurent_coefficient_eq_finite_convolution] + apply (norm_sum_le _ _).trans + apply ((hc n).2.1.sum_le_tsum _ (fun k _ => norm_nonneg _)).trans + exact (hc n).2.2 + +theorem sourceTruncatedCoefficient_integrable (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (j n : ℕ) : Integrable (sourceTruncatedCoefficient θ p j n) (sourceBiasedLaw j) := + (integrable_const (1 : ℝ)).mono' (sourceTruncatedCoefficient_measurable θ p j n).aestronglyMeasurable + (sourceTruncatedCoefficient_norm_le_one θ hθ hs hp hproj hinv j n) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/UncappedPairIdentity.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/UncappedPairIdentity.lean new file mode 100644 index 0000000000000000000000000000000000000000..f7fcb3ea10119df4b9247f9cac0427b819c5bd8b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/UncappedPairIdentity.lean @@ -0,0 +1,60 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.ProjectionPairIdentity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal Topology +noncomputable section + +/-- The limiting endpoints have finite floor support, because both actual +lambda_I marginals are Haar-dominated. -/ +theorem sourceLambda_endpoints_finiteFloor (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (I : Finset SourceCoordinate) : + ∀ᵐ z ∂(sourceSamplingLambdaTorus I : Measure SourceSamplingTorus), + finiteFloorSupport θ (sourceTorusRepresentative z.1) ∧ + finiteFloorSupport θ (sourceTorusRepresentative z.2) := by + have hf := sourceTorusRepresentative_preserving.quasiMeasurePreserving.ae + (ae_finiteFloorSupport θ hθ.summable) + have h₁ := ae_of_ae_map (sourceTorusEndpoint_measurable false).aemeasurable + ((sourceSamplingLambdaTorus_marginal_ac I false).ae_le hf) + have h₂ := ae_of_ae_map (sourceTorusEndpoint_measurable true).aemeasurable + ((sourceSamplingLambdaTorus_marginal_ac I true).ae_le hf) + exact h₁.and h₂ + +theorem sourceCappedRatio_eq_ratio (θ : SourceCoordinate → ℝ) (z : SourceSamplingTorus) + (hx : finiteFloorSupport θ (sourceTorusRepresentative z.1)) + (hy : finiteFloorSupport θ (sourceTorusRepresentative z.2)) + (hord : ∀ i, sourceTorusRepresentative z.1 i ≤ sourceTorusRepresentative z.2 i) (k : ℤ) : + sourceCappedRatio θ z k = + (sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.2) / + sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.1) : ℝ) := by + unfold sourceCappedRatio + rw [min_eq_left ((div_le_one (sourceCocycle_pos ..)).mpr + (sourceCocycle_ordered θ sourceLogWeight sourceLogWeight_nonneg hx hy hord k))] + +theorem sourceProjection_lambda_ratio_identity (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (hs : SourceOrderedTorusSampling θ) + {p : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hp : p ∈ sourceAlgebra θ) (hproj : IsStarProjection p) + (hinv : (1-p)*sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg*p = 0) + (I : Finset SourceCoordinate) : + ∀ᵐ z ∂(sourceSamplingLambdaTorus I : Measure SourceSamplingTorus), + ∃ D : SourceFiberHilbert →L[ℂ] SourceFiberHilbert, + ‖D‖ ≤ 1 ∧ + (∀ (v : SourceFiberHilbert) (k : ℤ), D v k = + (sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.2) / + sourceCocycle θ sourceLogWeight k (sourceTorusRepresentative z.1) : ℂ) * v k) ∧ + (1-sourceTorusOperatorField p z.2)*D*sourceTorusOperatorField p z.1 = 0 := by + filter_upwards [sourceProjection_lambda_pairs θ hθ hs hp hproj hinv I, + sourceLambda_endpoints_finiteFloor θ hθ I,sourceSamplingLambdaTorus_ordered I] + with z hz hf hord + refine ⟨fiberDiagonal (sourceCappedRatio θ z) (sourceCappedRatio_norm θ z), + fiberDiagonal_norm _ _,?_,hz⟩ + intro v k + rw [fiberDiagonal_apply,sourceCappedRatio_eq_ratio θ z hf.1 hf.2 hord k,Complex.ofReal_div] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VacuumFunctional.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VacuumFunctional.lean new file mode 100644 index 0000000000000000000000000000000000000000..6e585458e7a3d0dc24a6892e03017ea83e57667d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VacuumFunctional.lean @@ -0,0 +1,162 @@ +import Mathlib +import OAI.Analysis.FiniteFactor.CrossedProduct.GeneratedAlgebra +import OAI.Analysis.FiniteFactor.OperatorUltraweak + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- The constant e_0 field in the actual L2(X times Z) source model. -/ +def sourceVacuum : SourceHilbert SourceCoordinate := + @indicatorConstLp ((SourceCoordinate → ℝ) × ℤ) ℂ + (@Prod.instMeasurableSpace (SourceCoordinate → ℝ) ℤ + (@MeasurableSpace.pi SourceCoordinate (fun _ => ℝ) + (fun _ => Real.measurableSpace)) Int.instMeasurableSpace) + (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup + (Set.univ ×ˢ {(0 : ℤ)}) + (@Nat.cast ENNReal + (ENNReal.instAddCommMonoidWithOne.toAddMonoidWithOne.toNatCast) + (Nat.succ (Nat.succ Nat.zero))) + (MeasurableSet.univ.prod (measurableSet_singleton (0 : ℤ))) + (letI : IsProbabilityMeasure unitIntervalMeasure := + ⟨(Measure.restrict_apply_univ + (μ := (volume : Measure ℝ)) (Set.Ico (0 : ℝ) 1)).trans + ((Real.volume_Ico (a := 0) (b := 1)).trans + ((congrArg ENNReal.ofReal (sub_zero (1 : ℝ))).trans + ENNReal.ofReal_one))⟩ + let base : Measure (SourceCoordinate → ℝ) := + Measure.infinitePi (fun _ : SourceCoordinate => unitIntervalMeasure) + let mass_one := + (Measure.prod_prod (μ := base) (ν := (Measure.count : Measure ℤ)) + Set.univ {(0 : ℤ)}).trans + ((congrArg₂ (fun left right : ℝ≥0∞ => left * right) + (measure_univ (μ := base)) + (Measure.count_singleton (0 : ℤ))).trans (one_mul (1 : ℝ≥0∞))) + fun mass_top => ENNReal.one_ne_top (mass_one.symm.trans mass_top)) (1 : ℂ) + +theorem sourceVacuum_norm : ‖sourceVacuum‖ = 1 := by + rw [sourceVacuum,norm_indicatorConstLp (by norm_num) (by norm_num)] + simp [measureReal_def,sourceMeasure,Measure.prod_prod] + +section + +local notation "vacuumMeasurable" => + @Prod.instMeasurableSpace (SourceCoordinate → ℝ) ℤ + (@MeasurableSpace.pi SourceCoordinate (fun _ => ℝ) + (fun _ => Real.measurableSpace)) Int.instMeasurableSpace +local notation "vacuumSemiring" => + Complex.instNormedField.toField.toCommRing.toRing.toSemiring +local notation "vacuumIdentity" => + @RingHom.id ℂ (@Semiring.toNonAssocSemiring ℂ vacuumSemiring) +local notation "vacuumHilbertGroup" => + @MeasureTheory.Lp.instNormedAddCommGroup + ((SourceCoordinate → ℝ) × ℤ) ℂ vacuumMeasurable + (@Nat.cast ENNReal + (ENNReal.instAddCommMonoidWithOne.toAddMonoidWithOne.toNatCast) + (Nat.succ (Nat.succ Nat.zero))) + (sourceMeasure SourceCoordinate) Complex.instNormedAddCommGroup + fact_one_le_two_ennreal +local notation "vacuumHilbertInner" => + @MeasureTheory.L2.innerProductSpace + ((SourceCoordinate → ℝ) × ℤ) ℂ ℂ Complex.instRCLike + vacuumMeasurable (sourceMeasure SourceCoordinate) + Complex.instNormedAddCommGroup (@RCLike.innerProductSpace ℂ Complex.instRCLike) +local notation "vacuumHilbertTopology" => + @UniformSpace.toTopologicalSpace (SourceHilbert SourceCoordinate) + (@PseudoMetricSpace.toUniformSpace (SourceHilbert SourceCoordinate) + (@MetricSpace.toPseudoMetricSpace (SourceHilbert SourceCoordinate) + (@NormedAddCommGroup.toMetricSpace (SourceHilbert SourceCoordinate) vacuumHilbertGroup))) +local notation "vacuumHilbertAddition" => + @AddCommGroup.toAddCommMonoid (SourceHilbert SourceCoordinate) + (@NormedAddCommGroup.toAddCommGroup (SourceHilbert SourceCoordinate) vacuumHilbertGroup) +local notation "vacuumHilbertModule" => + @NormedSpace.toModule ℂ (SourceHilbert SourceCoordinate) + (@DenselyNormedField.toNormedField ℂ + (@RCLike.toDenselyNormedField ℂ Complex.instRCLike)) + (@NormedAddCommGroup.toSeminormedAddCommGroup + (SourceHilbert SourceCoordinate) vacuumHilbertGroup) + (@InnerProductSpace.toNormedSpace ℂ (SourceHilbert SourceCoordinate) Complex.instRCLike + (@NormedAddCommGroup.toSeminormedAddCommGroup + (SourceHilbert SourceCoordinate) vacuumHilbertGroup) + vacuumHilbertInner) + +abbrev sourceVacuumFunctional + (operator : @ContinuousLinearMap ℂ ℂ vacuumSemiring vacuumSemiring vacuumIdentity + (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition + (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition + vacuumHilbertModule vacuumHilbertModule) : ℂ := + @inner ℂ (SourceHilbert SourceCoordinate) + (@InnerProductSpace.toInner ℂ (SourceHilbert SourceCoordinate) Complex.instRCLike + (@NormedAddCommGroup.toSeminormedAddCommGroup + (SourceHilbert SourceCoordinate) vacuumHilbertGroup) + vacuumHilbertInner) sourceVacuum + (@AddHom.toFun (SourceHilbert SourceCoordinate) (SourceHilbert SourceCoordinate) + (vacuumHilbertAddition).toAdd (vacuumHilbertAddition).toAdd + (@LinearMap.toAddHom ℂ ℂ vacuumSemiring vacuumSemiring vacuumIdentity + (SourceHilbert SourceCoordinate) (SourceHilbert SourceCoordinate) + vacuumHilbertAddition vacuumHilbertAddition vacuumHilbertModule vacuumHilbertModule + (@ContinuousLinearMap.toLinearMap ℂ ℂ vacuumSemiring vacuumSemiring vacuumIdentity + (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition + (SourceHilbert SourceCoordinate) vacuumHilbertTopology vacuumHilbertAddition + vacuumHilbertModule vacuumHilbertModule operator)) sourceVacuum) + +end + +theorem sourceVacuumFunctional_one : sourceVacuumFunctional 1 = 1 := by + simp [sourceVacuumFunctional,inner_self_eq_norm_sq_to_K,sourceVacuum_norm] + +theorem sourceVacuumFunctional_add (S T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + sourceVacuumFunctional (S+T) = sourceVacuumFunctional S + sourceVacuumFunctional T := by + simp [sourceVacuumFunctional,inner_add_right] + +theorem sourceVacuumFunctional_smul (c : ℂ) + (T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + sourceVacuumFunctional (c • T) = c * sourceVacuumFunctional T := by + simp [sourceVacuumFunctional,inner_smul_right] + +theorem sourceVacuumFunctional_bound + (T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + ‖sourceVacuumFunctional T‖ ≤ ‖T‖ := by + calc + _ ≤ ‖sourceVacuum‖ * ‖T sourceVacuum‖ := norm_inner_le_norm _ _ + _ ≤ ‖sourceVacuum‖ * (‖T‖ * ‖sourceVacuum‖) := + mul_le_mul_of_nonneg_left (T.le_opNorm _) (norm_nonneg _) + _ = _ := by rw [sourceVacuum_norm]; ring + +theorem sourceVacuumFunctional_square + (T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + sourceVacuumFunctional (star T*T) = inner ℂ (T sourceVacuum) (T sourceVacuum) := + ContinuousLinearMap.adjoint_inner_right T sourceVacuum (T sourceVacuum) + +theorem sourceVacuumFunctional_square_nonneg + (T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + 0 ≤ (sourceVacuumFunctional (star T*T)).re := by + rw [sourceVacuumFunctional_square] + rw [inner_self_eq_norm_sq_to_K] + exact_mod_cast sq_nonneg ‖T sourceVacuum‖ + +/-- Normality here is continuity for the actual ultraweak topology defined +by absolutely summable vector functionals, specialized to the source Hilbert space. -/ +theorem sourceVacuumFunctional_normal : + @Continuous _ _ (ultraweakTopology (SourceHilbert SourceCoordinate)) inferInstance sourceVacuumFunctional := + vectorFunctional_ultraweak_continuous sourceVacuum sourceVacuum + +@[instance_reducible] def sourceAlgebraUltraweakTopology (θ : SourceCoordinate → ℝ) : + TopologicalSpace (sourceAlgebra θ).toStarSubalgebra := + TopologicalSpace.induced (fun T : (sourceAlgebra θ).toStarSubalgebra => + (T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate)) + (ultraweakTopology (SourceHilbert SourceCoordinate)) + +theorem sourceVacuumFunctional_algebra_normal (θ : SourceCoordinate → ℝ) : + @Continuous _ _ (sourceAlgebraUltraweakTopology θ) inferInstance + (fun T : (sourceAlgebra θ).toStarSubalgebra => sourceVacuumFunctional T) := + @Continuous.comp _ _ _ (sourceAlgebraUltraweakTopology θ) (ultraweakTopology (SourceHilbert SourceCoordinate)) _ _ _ + sourceVacuumFunctional_normal continuous_induced_dom + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VacuumSeparating.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VacuumSeparating.lean new file mode 100644 index 0000000000000000000000000000000000000000..0c7d5664edd9ae603d2096ad110850d52f9222c9 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VacuumSeparating.lean @@ -0,0 +1,51 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiberTotal + +namespace OAI + +namespace FiniteFactor +open MeasureTheory +noncomputable section + +/-- The actual constant e_0 vector separates the source double commutant. -/ +theorem sourceVacuum_separating (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (hv : H sourceVacuum = 0) : H = 0 := by + have hkill (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (n : ℤ) : + H (sourceFiberIndicator A hA n) = 0 := by + rw [sourceFiberIndicator_eq_orbit θ A hA n] + have hs := congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T (sourceCommutantRotation θ n sourceVacuum)) + (sourceAlgebra_commutes_scalar θ hH (sourceBaseIndicator A hA)) + have hr := congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T sourceVacuum) (sourceAlgebra_commutes_rotation θ hH n) + change sourceScalar (sourceBaseIndicator A hA) (H (sourceCommutantRotation θ n sourceVacuum)) = + H (sourceScalar (sourceBaseIndicator A hA) (sourceCommutantRotation θ n sourceVacuum)) at hs + change sourceCommutantRotation θ n (H sourceVacuum) = H (sourceCommutantRotation θ n sourceVacuum) at hr + rw [← hs, ← hr, hv] + simp + have hstar : star H = 0 := by + apply ContinuousLinearMap.ext + intro f + change star H f = 0 + apply sourceFiberIndicators_total + intro A hA n + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right, hkill] + simp + exact star_eq_zero.mp hstar + +/-- Faithfulness on squares of the actual normal vacuum functional. -/ +theorem sourceVacuumFunctional_square_eq_zero_iff (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + sourceVacuumFunctional (star H * H) = 0 ↔ H = 0 := by + constructor + · intro hz + rw [sourceVacuumFunctional_square] at hz + exact sourceVacuum_separating θ hH (inner_self_eq_zero.mp hz) + · rintro rfl + simp [sourceVacuumFunctional] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VectorFunctionalRelations.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VectorFunctionalRelations.lean new file mode 100644 index 0000000000000000000000000000000000000000..92ca116027c62a22b76635f3d37b3d8770f324ac --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/VectorFunctionalRelations.lean @@ -0,0 +1,46 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.NormalFunctionalSpace + +namespace OAI + +namespace FiniteFactor +noncomputable section + +def sourceVectorInSpace (θ : SourceCoordinate → ℝ) (ξ η : SourceHilbert SourceCoordinate) : + SourceNormalPredualSpace θ := ⟨sourceVectorFunctional θ ξ η,sourceVectorFunctional_mem θ ξ η⟩ + +theorem sourceVectorInSpace_add_left (θ : SourceCoordinate → ℝ) (ξ ξ' η : SourceHilbert SourceCoordinate) : + sourceVectorInSpace θ (ξ+ξ') η = sourceVectorInSpace θ ξ η + sourceVectorInSpace θ ξ' η := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro A + change inner ℂ (ξ+ξ') (A.val η) = inner ℂ ξ (A.val η) + inner ℂ ξ' (A.val η) + exact inner_add_left _ _ _ + +theorem sourceVectorInSpace_smul_left (θ : SourceCoordinate → ℝ) (c : ℂ) (ξ η : SourceHilbert SourceCoordinate) : + sourceVectorInSpace θ (c • ξ) η = star c • sourceVectorInSpace θ ξ η := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro A + change inner ℂ (c • ξ) (A.val η) = star c * inner ℂ ξ (A.val η) + exact inner_smul_left _ _ _ + +theorem sourceVectorInSpace_add_right (θ : SourceCoordinate → ℝ) (ξ η η' : SourceHilbert SourceCoordinate) : + sourceVectorInSpace θ ξ (η+η') = sourceVectorInSpace θ ξ η + sourceVectorInSpace θ ξ η' := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro A + change inner ℂ ξ ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (η+η')) = inner ℂ ξ (A.val η) + inner ℂ ξ (A.val η') + rw [map_add,inner_add_right] + +theorem sourceVectorInSpace_smul_right (θ : SourceCoordinate → ℝ) (c : ℂ) (ξ η : SourceHilbert SourceCoordinate) : + sourceVectorInSpace θ ξ (c • η) = c • sourceVectorInSpace θ ξ η := by + apply Subtype.ext + apply ContinuousLinearMap.ext + intro A + change inner ℂ ξ ((A : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (c • η)) = c * inner ℂ ξ (A.val η) + rw [map_smul,inner_smul_right] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/CrossedProduct/WeightedShiftField.lean b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/WeightedShiftField.lean new file mode 100644 index 0000000000000000000000000000000000000000..1497a8b5ee78d0b15487dc31e1d65ee4d3286399 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/CrossedProduct/WeightedShiftField.lean @@ -0,0 +1,79 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FieldAlgebra +import OAI.Analysis.FiniteFactor.Matrix.Covariance + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +theorem sourceMatrixEntry_sourceOperator_pow (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (q : ℕ) (m : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + sourceMatrixEntry (sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg ^ q) k m x = + if k = m + (q : ℤ) then + (sourceCocycle θ sourceLogWeight q (coordinateRotate θ m x) : ℂ) else 0 := by + have hb := (sourceShiftNIndex_preserving SourceCoordinate q).quasiMeasurePreserving.ae + (sourceBasis_coe m) + filter_upwards [source_ae_all_fibers (sourceOperator_pow_apply_ae θ sourceLogWeight hθ.nonneg + sourceLogWeight_nonneg hθ.summable q (sourceBasis m)), source_ae_all_fibers hb] with x hp hb k + unfold sourceMatrixEntry + rw [hp, hb] + simp only [sourceShiftNIndex] + by_cases hk : k = m + (q : ℤ) + · simp [hk] + · have he : k - (q : ℤ) ≠ m := by omega + simp [he, hk] + +/-- The field of each power of the original quasinilpotent operator acts by +its verified source cocycle, simultaneously on every l2 vector. -/ +theorem sourceOperatorField_sourceOperator_pow (θ : SourceCoordinate → ℝ) (hθ : SourceAngles θ) + (q : ℕ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ (v : SourceFiberHilbert) (k : ℤ), + (sourceOperatorField + (sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg ^ q) x v) k = + (sourceCocycle θ sourceLogWeight q (coordinateRotate θ (k - (q : ℤ)) x) : ℂ) * + v (k - (q : ℤ)) := by + have hm := ae_all_iff.mpr (sourceMatrixEntry_sourceOperator_pow θ hθ q) + filter_upwards [sourceOperatorField_entries_ae θ (pow_mem (staged_sourceOperator_mem θ hθ) q), + hm] with x he hm v k + rw [fiberOperator_action] + simp_rw [he, hm] + have ht (n : ℤ) : + (if k = n + (q : ℤ) then + (sourceCocycle θ sourceLogWeight q (coordinateRotate θ n x) : ℂ) else 0) * v n = + if n = k - (q : ℤ) then + (sourceCocycle θ sourceLogWeight q (coordinateRotate θ (k - (q : ℤ)) x) : ℂ) * + v (k - (q : ℤ)) else 0 := by + by_cases hn : n = k - (q : ℤ) + · have hk : k = n + (q : ℤ) := by omega + rw [ite_eq_left hk, ite_eq_left hn, hn] + · have hk : k ≠ n + (q : ℤ) := by omega + rw [ite_eq_right hk, ite_eq_right hn, zero_mul] + simp_rw [ht] + simp + +/-- Covariance for the actual field's matrix, with all integer indices on one +conull set. This is the coordinate form of conjugation by the fiber shift. -/ +theorem sourceOperatorField_covariance (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ r n k : ℤ, + (sourceOperatorField H (coordinateRotate θ r x) (lp.single 2 n (1 : ℂ))) k = + (sourceOperatorField H x (lp.single 2 (n+r) (1 : ℂ))) (k+r) := by + have he : ∀ᵐ x ∂sourceBaseMeasure, ∀ r : ℤ, ∀ k n : ℤ, + (sourceOperatorField H (coordinateRotate θ r x) (lp.single 2 n (1 : ℂ))) k = + sourceMatrixEntry H k n (coordinateRotate θ r x) := by + rw [ae_all_iff] + intro r + exact (coordinateRotate_preserving θ r).quasiMeasurePreserving.ae + (sourceOperatorField_entries_ae θ hH) + filter_upwards [he, sourceOperatorField_entries_ae θ hH, + sourceMatrixEntry_covariance_all θ hH] with x he hx hc r n k + rw [he, hx, hc] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorCesaro.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorCesaro.lean new file mode 100644 index 0000000000000000000000000000000000000000..57ea12fbbab75d2dddcafc498a0d14b76aa60ff1 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorCesaro.lean @@ -0,0 +1,80 @@ +import Mathlib.Analysis.InnerProductSpace.Adjoint +import Mathlib.Analysis.InnerProductSpace.Projection.Submodule +import Mathlib.Analysis.SpecificLimits.Basic +import Mathlib.Algebra.Ring.GeomSum +import Mathlib.Tactic.Linarith +import Mathlib.Tactic.Positivity +import Mathlib.Tactic.NormNum +import Mathlib.Tactic.Abel + +namespace OAI + +noncomputable section +open Filter +open scoped Topology BigOperators +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- Cesàro means of the powers of a bounded operator. -/ +def cesaro (S : H →L[ℂ] H) (n : ℕ) : H →L[ℂ] H := + ((n+1 : ℕ) : ℂ)⁻¹ • ∑ k ∈ Finset.range (n+1), S^k + +omit [CompleteSpace H] in +lemma pow_norm_le_one [CompleteSpace H] (S : H →L[ℂ] H) (hS : ‖S‖≤1) (k : ℕ) : ‖S^k‖≤1 := +by + induction k with + | zero => + rw [pow_zero] + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro x + simp + | succ k ih => + rw [pow_succ] + exact (norm_mul_le _ _).trans (by nlinarith [norm_nonneg (S^k),norm_nonneg S]) + +lemma cesaro_norm_le_one (S : H →L[ℂ] H) (hS : ‖S‖≤1) (n : ℕ) : ‖cesaro S n‖≤1 := by + have hn : (0:ℝ)<(n+1:ℕ) := Nat.cast_pos.mpr (Nat.succ_pos n) + have hs : ‖∑ k ∈ Finset.range (n+1), S^k‖≤(n+1:ℕ) := by + calc + _ ≤ ∑ k ∈ Finset.range (n+1), ‖S^k‖ := norm_sum_le _ _ + _ ≤ ∑ k ∈ Finset.range (n+1), (1:ℝ) := Finset.sum_le_sum (fun k _ => pow_norm_le_one S hS k) + _ = _ := by simp + rw [cesaro,norm_smul,norm_inv] + simp only [Complex.norm_natCast] + exact (mul_le_mul_of_nonneg_left hs (inv_nonneg.mpr hn.le)).trans_eq (inv_mul_cancel₀ hn.ne') + +lemma cesaro_apply_norm_le (S : H →L[ℂ] H) (hS : ‖S‖≤1) (n : ℕ) (x : H) : + ‖cesaro S n x‖≤‖x‖ := + ((cesaro S n).le_opNorm x).trans (by nlinarith [cesaro_norm_le_one S hS n,norm_nonneg x]) + +omit [CompleteSpace H] in +lemma cesaro_mul_sub [CompleteSpace H] (S : H →L[ℂ] H) (n : ℕ) : + cesaro S n*(1-S)=((n+1:ℕ):ℂ)⁻¹ • (1-S^(n+1)) := by + rw [cesaro,smul_mul_assoc,geom_sum_mul_neg] + +lemma cesaro_range_bound (S : H →L[ℂ] H) (hS : ‖S‖≤1) (n : ℕ) (x : H) : + ‖cesaro S n ((1-S) x)‖≤((n+1:ℕ):ℝ)⁻¹*(2*‖x‖) := by + have hn : (0:ℝ)<(n+1:ℕ) := Nat.cast_pos.mpr (Nat.succ_pos n) + have hp : ‖(S^(n+1)) x‖≤‖x‖ := + ((S^(n+1)).le_opNorm x).trans (by nlinarith [pow_norm_le_one S hS (n+1),norm_nonneg x]) + have he := congrArg (fun T:H→L[ℂ]H => T x) (cesaro_mul_sub S n) + simp only [mul_apply_eq_comp,smul_apply] at he + rw [he,norm_smul,norm_inv] + simp only [Complex.norm_natCast] + apply mul_le_mul_of_nonneg_left _ (inv_nonneg.mpr hn.le) + change ‖x-(S^(n+1)) x‖≤_ + exact (norm_sub_le _ _).trans (by linarith) + +lemma cesaro_on_range (S : H →L[ℂ] H) (hS : ‖S‖≤1) (x : H) : + Tendsto (fun n => cesaro S n ((1-S) x)) atTop (𝓝 0) := by + apply tendsto_zero_iff_norm_tendsto_zero.mpr + have ht := (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜:=ℝ)).mul_const (2*‖x‖) + simp only [zero_mul,one_div] at ht + apply squeeze_zero (fun n=>norm_nonneg _) (cesaro_range_bound S hS · x) + simpa only [Nat.cast_add,Nat.cast_one] using ht + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorMeanErgodic.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorMeanErgodic.lean new file mode 100644 index 0000000000000000000000000000000000000000..2c5d46d0792a98378a605c72e03fa8b7f17d645a --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorMeanErgodic.lean @@ -0,0 +1,71 @@ +import OAI.Analysis.FiniteFactor.Diffuse.OperatorCesaro + +namespace OAI + +noncomputable section +open Filter +open scoped Topology BigOperators +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma cesaro_on_closedRange (S : H →L[ℂ] H) (hS : ‖S‖≤1) (x : H) + (hx : x∈(1-S).range.topologicalClosure) : + Tendsto (fun n=>cesaro S n x) atTop (𝓝 0) := by + apply Metric.tendsto_atTop.mpr + intro ε hε + have hcl : x∈closure ((1-S).range : Set H) := hx + obtain ⟨y,hy,hxy⟩ := Metric.mem_closure_iff.mp hcl (ε/2) (by positivity) + obtain ⟨z,rfl⟩ := hy + obtain ⟨N,hN⟩ := Metric.tendsto_atTop.mp (cesaro_on_range S hS z) (ε/2) (by positivity) + refine ⟨N,fun n hn=>?_⟩ + rw [dist_zero_right] + have he : cesaro S n x = cesaro S n (x-(1-S) z)+cesaro S n ((1-S) z) := by + rw [map_sub]; abel + rw [he] + have hh := hN n hn + rw [dist_zero_right] at hh + rw [dist_eq_norm] at hxy + change ‖x-(1-S) z‖<ε/2 at hxy + exact (norm_add_le _ _).trans_lt (by linarith [cesaro_apply_norm_le S hS n (x-(1-S) z)]) + +omit [CompleteSpace H] in +lemma cesaro_fixed [CompleteSpace H] (S : H →L[ℂ] H) (n : ℕ) (x : H) (hx : S x=x) : + cesaro S n x=x := by + have hp : ∀k:ℕ,(S^k) x=x := by + intro k + induction k with + | zero => simp + | succ k ih => rw [pow_succ',mul_apply_eq_comp,ih,hx] + simp only [cesaro,smul_apply,sum_apply,hp, + Finset.sum_const,Finset.card_range] + rw [← Nat.cast_smul_eq_nsmul ℂ,smul_smul,inv_mul_cancel₀ (by exact_mod_cast Nat.succ_ne_zero n),one_smul] + +/-- The Hilbert mean ergodic theorem for a selfadjoint contraction, proved +using telescoping on the dense range and the fixed-space orthogonal projection. -/ +theorem cesaro_tendsto_fixedProjection (S : H →L[ℂ] H) + (hS : ‖S‖≤1) (hstar : star S=S) (x : H) : + Tendsto (fun n=>cesaro S n x) atTop (𝓝 ((1-S).ker.starProjection x)) := by + let K := (1-S).ker + let : CompleteSpace K := (1-S).isClosed_ker.completeSpace_coe + have hP : S (K.starProjection x)=K.starProjection x := by + have h := K.starProjection_apply_mem x + change (K.starProjection x)-S (K.starProjection x)=0 at h + exact (sub_eq_zero.mp h).symm + have hk : Kᗮ=(1-S).range.topologicalClosure := by + have hh := ContinuousLinearMap.orthogonal_ker (1-S) + rw [←ContinuousLinearMap.star_eq_adjoint] at hh + simpa only [star_sub,star_one,hstar] using hh + have hr : x-K.starProjection x∈(1-S).range.topologicalClosure := by + rw [←hk] + exact K.sub_starProjection_mem_orthogonal x + have ht := (cesaro_on_closedRange S hS (x-K.starProjection x) hr).add_const (K.starProjection x) + simp only [zero_add] at ht + convert ht using 1 + funext n + rw [map_sub,cesaro_fixed S n _ hP,sub_add_cancel] + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorSupport.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorSupport.lean new file mode 100644 index 0000000000000000000000000000000000000000..47e98a5df60c7162a36e950e6af02667a24dc48e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/OperatorSupport.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.FiniteFactor.Diffuse.OperatorMeanErgodic +import Mathlib.Analysis.VonNeumannAlgebra.Basic + +namespace OAI + +noncomputable section +open Filter +open scoped Topology +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- The actual orthogonal projection onto the closed range of an operator. -/ +def rangeSupport (T : H →L[ℂ] H) : H →L[ℂ] H := + T.range.topologicalClosure.starProjection + +lemma rangeSupport_projection (T : H →L[ℂ] H) : IsStarProjection (rangeSupport T) := + isStarProjection_starProjection + +lemma rangeSupport_range (T : H →L[ℂ] H) : + (rangeSupport T).range=T.range.topologicalClosure := + Submodule.range_starProjection _ + +lemma rangeSupport_mul_self (T : H →L[ℂ] H) : rangeSupport T*T=T := by + ext x + apply Submodule.starProjection_eq_self_iff.mpr + exact Submodule.le_topologicalClosure _ ⟨x,rfl⟩ + +lemma rangeSupport_ne_zero {T : H →L[ℂ] H} (hT:T≠0) : rangeSupport T≠0 := by + intro h + have he:=rangeSupport_mul_self T + rw [h,zero_mul] at he + exact hT he.symm + +/-- Closed range support belongs to the same concrete von Neumann algebra. -/ +theorem rangeSupport_mem (M : VonNeumannAlgebra H) {T:H→L[ℂ]H} (hT:T∈M) : + rangeSupport T∈M := by + apply (VonNeumannAlgebra.IsStarProjection.mem_iff (rangeSupport_projection T) M).mpr + intro y hy + rw [rangeSupport_range] + apply Submodule.topologicalClosure_mem_invtSubmodule + intro x hx + obtain ⟨z,rfl⟩:=hx + refine ⟨y z,?_⟩ + have hc := VonNeumannAlgebra.mem_commutant_iff.mp hy T hT + exact congrArg (fun A:H→L[ℂ]H=>A z) hc + +lemma projection_mul_rangeSupport {p T:H→L[ℂ]H} (hp:IsStarProjection p) (h:p*T=T) : + p*rangeSupport T=rangeSupport T := by + have hs : Set.EqOn p id (T.range:Set H) := by + rintro _ ⟨x,rfl⟩ + have hx : T x ∈ p.range := ⟨T x, congrArg (fun A:H→L[ℂ]H=>A x) h⟩ + obtain ⟨y,hy⟩ := hx + change p (T x) = T x + rw [← hy] + exact congrArg (fun A:H→L[ℂ]H=>A y) hp.isIdempotentElem.eq + have hc : Set.EqOn p id (closure (T.range:Set H)) := + hs.closure p.continuous continuous_id + ext x + exact hc (T.range.topologicalClosure.starProjection_apply_mem x) + +lemma rangeSupport_mul_projection {p T:H→L[ℂ]H} (hp:IsStarProjection p) (h:p*T=T) : + rangeSupport T*p=rangeSupport T := by + have he:=congrArg star (projection_mul_rangeSupport hp h) + simpa only [star_mul,hp.isSelfAdjoint.star_eq,(rangeSupport_projection T).isSelfAdjoint.star_eq] using he + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/ProjectionTrace.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/ProjectionTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..99c01b2c42cbcec2be0588228e3dbd4732ebb119 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/ProjectionTrace.lean @@ -0,0 +1,50 @@ +import OAI.Analysis.FiniteFactor.Diffuse.OperatorSupport +import Mathlib.Analysis.CStarAlgebra.Basic + +namespace OAI + +noncomputable section +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma projection_vector_trace (v:H) {p:H→L[ℂ]H} (hp:IsStarProjection p) : + inner ℂ v (p v)=(‖p v‖:ℂ)^2 := by + have he : (star p)*(p)=p := by rw [hp.isSelfAdjoint.star_eq,hp.isIdempotentElem.eq] + calc + inner ℂ v (p v)=inner ℂ v ((star p) (p v)) := congrArg (fun A:H→L[ℂ]H=>inner ℂ v (A v)) he.symm + _ = _ := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right, + inner_self_eq_norm_sq_to_K] + norm_cast + +lemma projection_vector_trace_nonneg (v:H) {p:H→L[ℂ]H} (hp:IsStarProjection p) : + 0≤(inner ℂ v (p v)).re := by + rw [projection_vector_trace v hp] + simp only [←Complex.ofReal_pow,Complex.ofReal_re] + positivity + +lemma projection_difference {p q:H→L[ℂ]H} (hp:IsStarProjection p) (hq:IsStarProjection q) + (hqp:q*p=q) : IsStarProjection (p-q) := by + have hpq:p*q=q := by + have hh:=congrArg star hqp + simpa only [star_mul,hp.isSelfAdjoint.star_eq,hq.isSelfAdjoint.star_eq] using hh + apply isStarProjection_iff'.mpr + constructor + · calc + (p-q)*(p-q)=p*p-p*q-q*p+q*q := by noncomm_ring + _ = p-q := by rw [hp.isIdempotentElem.eq,hq.isIdempotentElem.eq,hpq,hqp]; abel + · simp only [star_sub,hp.isSelfAdjoint.star_eq,hq.isSelfAdjoint.star_eq] + +lemma projection_vector_trace_mono (v:H) {p q:H→L[ℂ]H} + (hp:IsStarProjection p) (hq:IsStarProjection q) (hqp:q*p=q) : + (inner ℂ v (q v)).re≤(inner ℂ v (p v)).re := by + have hh:=projection_vector_trace_nonneg v (projection_difference hp hq hqp) + change 0≤(inner ℂ v (p v-q v)).re at hh + rw [inner_sub_right,Complex.sub_re] at hh + linarith + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/SmallPartitions.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/SmallPartitions.lean new file mode 100644 index 0000000000000000000000000000000000000000..a3383863ada812a3f98ef2262f5f5ba273e16c38 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/SmallPartitions.lean @@ -0,0 +1,75 @@ +import OAI.Analysis.FiniteFactor.Diffuse.SupportTrace +import OAI.Analysis.FiniteFactor.Diffuse.ProjectionTrace + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- A faithful tracial concrete algebra with finite identity partitions of +arbitrarily small projection trace has no minimal projection. -/ +theorem no_minimal_projection_of_small_partitions (M:VonNeumannAlgebra H) (v:H) + (hcyclic:∀a b:M.toStarSubalgebra, + inner ℂ v (((a*b:M.toStarSubalgebra):H→L[ℂ]H) v)= + inner ℂ v (((b*a:M.toStarSubalgebra):H→L[ℂ]H) v)) + (hfaithful:∀T:M.toStarSubalgebra,(T:H→L[ℂ]H) v=0→T=0) + (hpart:∀ε:ℝ,0<ε→∃n:ℕ,∃e:Fin n→M.toStarSubalgebra, + (∀j,IsStarProjection (e j:H→L[ℂ]H)) ∧ (∑j,e j)=1 ∧ + ∀j,(inner ℂ v ((e j:H→L[ℂ]H) v)).re<ε) + (p:M.toStarSubalgebra) (hps:star p=p) (hpi:p*p=p) (hp0:p≠0) : + ∃q:M.toStarSubalgebra,star q=q ∧ q*q=q ∧ q≠0 ∧ q≠p ∧ q*p=q := by + classical + have hpp:IsStarProjection (p:H→L[ℂ]H) := + isStarProjection_iff'.mpr ⟨congrArg Subtype.val hpi,congrArg Subtype.val hps⟩ + have hpv:(p:H→L[ℂ]H) v≠0 := fun hz=>hp0 (hfaithful p hz) + have htpos:0<(inner ℂ v ((p:H→L[ℂ]H) v)).re := by + rw [projection_vector_trace v hpp] + simp only [←Complex.ofReal_pow,Complex.ofReal_re] + exact sq_pos_of_pos (norm_pos_iff.mpr hpv) + obtain ⟨n,e,hep,hes,het⟩:=hpart _ htpos + obtain ⟨j,hj⟩:∃j,p*e j≠0 := by + by_contra hn + have hh:∀j,p*e j=0 := by simpa only [not_exists,not_not] using hn + apply hp0 + calc + p=p*1 := (mul_one p).symm + _=p*(∑j,e j) := by rw [hes] + _=∑j,p*e j := Finset.mul_sum _ _ _ + _=0 := by simp [hh] + by_contra hnone + let T:H→L[ℂ]H := (p*e j:M.toStarSubalgebra) + have hT0:T≠0 := fun hh=>hj (Subtype.ext hh) + have hTnorm:‖T‖≤1 := by + exact (norm_mul_le (p:H→L[ℂ]H) (e j:H→L[ℂ]H)).trans + ((mul_le_mul (IsStarProjection.norm_le _ hpp) (IsStarProjection.norm_le _ (hep j)) + (norm_nonneg _) zero_le_one).trans_eq (one_mul 1)) + have hpT:(p:H→L[ℂ]H)*T=T := by + change ((p*p)*e j:M.toStarSubalgebra).val=(p*e j).val + rw [hpi] + let q:M.toStarSubalgebra := ⟨rangeSupport T,rangeSupport_mem M (p*e j).property⟩ + have hqp:q*p=q := Subtype.ext (rangeSupport_mul_projection hpp hpT) + have hq0:q≠0 := fun hh=>rangeSupport_ne_zero hT0 (congrArg Subtype.val hh) + have hqeq:q=p := by + by_contra hh + exact hnone ⟨q,Subtype.ext (rangeSupport_projection T).isSelfAdjoint.star_eq, + Subtype.ext (rangeSupport_projection T).isIdempotentElem.eq,hq0,hh,hqp⟩ + have heT:(e j:H→L[ℂ]H)*star T=star T := by + change (e j:H→L[ℂ]H)*star ((p:H→L[ℂ]H)*(e j:H→L[ℂ]H))=star ((p:H→L[ℂ]H)*(e j:H→L[ℂ]H)) + rw [star_mul,hpp.isSelfAdjoint.star_eq,(hep j).isSelfAdjoint.star_eq,←mul_assoc, + (hep j).isIdempotentElem.eq] + have hright:=rangeSupport_mul_projection (hep j) heT + have hle:=projection_vector_trace_mono v (hep j) (rangeSupport_projection (star T)) hright + have heq:=support_trace_eq M v hcyclic (p*e j) hTnorm + have hleft:rangeSupport T=(p:H→L[ℂ]H) := congrArg Subtype.val hqeq + change inner ℂ v (rangeSupport T v)=inner ℂ v (rangeSupport (star T) v) at heq + rw [hleft] at heq + rw [←heq] at hle + exact (not_lt_of_ge hle) (het j) + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/SupportLimit.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/SupportLimit.lean new file mode 100644 index 0000000000000000000000000000000000000000..d969cb9529637178a8ead091d5201b25bd36ab7a --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/SupportLimit.lean @@ -0,0 +1,52 @@ +import OAI.Analysis.FiniteFactor.Diffuse.OperatorSupport + +namespace OAI + +noncomputable section +open Filter +open scoped Topology BigOperators +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +lemma one_sub_star_mul_contraction (T:H→L[ℂ]H) (hT:‖T‖≤1) : + ‖1-star T*T‖≤1 := by + apply ContinuousLinearMap.opNorm_le_bound _ zero_le_one + intro x + change ‖x-(star T) (T x)‖≤1*‖x‖ + rw [one_mul] + have ht : ‖star T‖≤1 := by simpa [ContinuousLinearMap.star_eq_adjoint] using hT + have hb : ‖(star T) (T x)‖≤‖T x‖ := by + calc + _ ≤ ‖star T‖*‖T x‖ := (star T).le_opNorm _ + _ ≤ 1*‖T x‖ := mul_le_mul_of_nonneg_right ht (norm_nonneg _) + _ = _ := one_mul _ + have hi : RCLike.re (inner ℂ x ((star T) (T x)))=‖T x‖^2 := by + rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + exact inner_self_eq_norm_sq (𝕜:=ℂ) _ + have he := norm_sub_sq (𝕜:=ℂ) x ((star T) (T x)) + rw [hi] at he + nlinarith [norm_nonneg (x-(star T) (T x)),norm_nonneg x,norm_nonneg (T x), + norm_nonneg ((star T) (T x))] + +lemma rangeSupport_eq_one_sub_kernel (T:H→L[ℂ]H) : + rangeSupport T=1-(star T).ker.starProjection := by + have h := ContinuousLinearMap.orthogonal_ker (star T) + rw [←ContinuousLinearMap.star_eq_adjoint,star_star] at h + change T.range.topologicalClosure.starProjection = ContinuousLinearMap.id ℂ H - (star T).ker.starProjection + simpa only [h] using (Submodule.starProjection_orthogonal (star T).ker) + +lemma cesaro_star_mul_tendsto (T:H→L[ℂ]H) (hT:‖T‖≤1) (x:H) : + Tendsto (fun n=>cesaro (1-star T*T) n x) atTop + (𝓝 (T.ker.starProjection x)) := by + have hstar : star (1-star T*T)=1-star T*T := by simp + have hker : (1-(1-star T*T)).ker=T.ker := by + rw [sub_sub_cancel] + exact ContinuousLinearMap.ker_adjoint_comp_self T + simpa only [hker] using cesaro_tendsto_fixedProjection (1-star T*T) + (one_sub_star_mul_contraction T hT) hstar x + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/SupportTrace.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/SupportTrace.lean new file mode 100644 index 0000000000000000000000000000000000000000..319de877473d96018f036b19c0f6864d94e2ca0d --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/SupportTrace.lean @@ -0,0 +1,55 @@ +import OAI.Analysis.FiniteFactor.Diffuse.SupportLimit +import OAI.Analysis.FiniteFactor.Diffuse.TracePowers + +namespace OAI + +noncomputable section +open Filter +open scoped Topology BigOperators +namespace Nonhyperlinear.Diffuseness +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +def vectorFunctional (v:H) : (H→L[ℂ]H)→ₗ[ℂ]ℂ where + toFun T := inner ℂ v (T v) + map_add' T S := inner_add_right v (T v) (S v) + map_smul' c T := inner_smul_right v (T v) c + +theorem support_trace_eq (M:VonNeumannAlgebra H) (v:H) + (hcyclic:∀a b:M.toStarSubalgebra, + inner ℂ v (((a*b:M.toStarSubalgebra):H→L[ℂ]H) v)= + inner ℂ v (((b*a:M.toStarSubalgebra):H→L[ℂ]H) v)) + (T:M.toStarSubalgebra) (hT:‖(T:H→L[ℂ]H)‖≤1) : + inner ℂ v (rangeSupport (T:H→L[ℂ]H) v)= + inner ℂ v (rangeSupport (star (T:H→L[ℂ]H)) v) := by + let t:H→L[ℂ]H := T + let f:M.toStarSubalgebra→ₗ[ℂ]ℂ := + (vectorFunctional v).comp M.toStarSubalgebra.toSubmodule.subtype + have hf : ∀a b,f (a*b)=f (b*a) := hcyclic + have he : ∀n, inner ℂ v (cesaro (1-t*star t) n v)= + inner ℂ v (cesaro (1-star t*t) n v) := by + intro n + change vectorFunctional v (cesaro (1-t*star t) n)= + vectorFunctional v (cesaro (1-star t*t) n) + simp only [cesaro,map_smul,map_sum] + congr 1 + apply Finset.sum_congr rfl + intro k hk + exact trace_defect_pow f hf T (star T) k + have hts : ‖star t‖≤1 := by simpa [t,ContinuousLinearMap.star_eq_adjoint] using hT + have hl := Filter.Tendsto.inner (𝕜:=ℂ) (tendsto_const_nhds (x:=v)) (cesaro_star_mul_tendsto (star t) hts v) + have hr := Filter.Tendsto.inner (𝕜:=ℂ) (tendsto_const_nhds (x:=v)) (cesaro_star_mul_tendsto t hT v) + have hlim : inner ℂ v ((star t).ker.starProjection v)= + inner ℂ v (t.ker.starProjection v) := by + apply tendsto_nhds_unique hl + apply hr.congr' + exact Filter.Eventually.of_forall (fun n=>by simpa only [star_star] using (he n).symm) + change inner ℂ v (rangeSupport t v)=inner ℂ v (rangeSupport (star t) v) + rw [rangeSupport_eq_one_sub_kernel,rangeSupport_eq_one_sub_kernel,star_star] + change inner ℂ v (v-(star t).ker.starProjection v)=inner ℂ v (v-t.ker.starProjection v) + rw [inner_sub_right,inner_sub_right,hlim] + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Diffuse/TracePowers.lean b/lean/OAI/Analysis/FiniteFactor/Diffuse/TracePowers.lean new file mode 100644 index 0000000000000000000000000000000000000000..511a09d222999631f80610dc39fe84cd18b20880 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Diffuse/TracePowers.lean @@ -0,0 +1,34 @@ +import Mathlib.Analysis.Complex.Basic +import Mathlib.Algebra.Module.LinearMap.Defs +import Mathlib.Tactic.NoncommRing + +namespace OAI + +noncomputable section +open scoped BigOperators +namespace Nonhyperlinear.Diffuseness + +/-- Cyclicity equates every polynomial defect moment; no spectral assumption is used. -/ +theorem trace_defect_pow {A:Type*} [Ring A] [Algebra ℂ A] + (f:A→ₗ[ℂ]ℂ) (hf:∀a b,f (a*b)=f (b*a)) (a b:A) (n:ℕ) : + f ((1-a*b)^n)=f ((1-b*a)^n) := by + have hsem : SemiconjBy b (1-a*b) (1-b*a) := by + change b*(1-a*b)=(1-b*a)*b + noncomm_ring + induction n with + | zero => simp + | succ n ih => + have hp:= (hsem.pow_right n).eq + have he : (1-a*b)^(n+1)=(1-a*b)^n-a*(b*(1-a*b)^n) := by + rw [pow_succ'] + noncomm_ring + have he' : (1-b*a)^(n+1)=(1-b*a)^n-((1-b*a)^n*b)*a := by + rw [pow_succ] + noncomm_ring + rw [he,he',map_sub,map_sub,ih,hp,hf a] + +end Nonhyperlinear.Diffuseness + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Fiber/Diagonal.lean b/lean/OAI/Analysis/FiniteFactor/Fiber/Diagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..7a7010045c844c422dbca9be616c103fd8880614 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Fiber/Diagonal.lean @@ -0,0 +1,88 @@ +import OAI.Analysis.FiniteFactor.Fiber.StrongContinuity +import OAI.Analysis.FiniteFactor.CrossedProduct.FieldRepresentation + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- A bounded diagonal on the original l2(Z) fiber. -/ +def fiberDiagonal (d : ℤ → ℂ) (hd : ∀ k, ‖d k‖ ≤ 1) : + SourceFiberHilbert →L[ℂ] SourceFiberHilbert := + LinearMap.mkContinuous + { toFun := fun v => ⟨fun k => d k * v k, + (lp.memℓp v).mono' (fun k => by + rw [norm_mul] + exact (mul_le_mul_of_nonneg_right (hd k) (norm_nonneg _)).trans_eq (one_mul _))⟩ + map_add' := fun u v => by apply Subtype.ext; funext k; exact mul_add _ _ _ + map_smul' := fun c v => by apply Subtype.ext; funext k; exact mul_left_comm _ _ _ } + 1 (fun v => by + rw [one_mul] + apply lp.norm_mono (by norm_num) + intro k + change ‖d k * v k‖ ≤ ‖v k‖ + rw [norm_mul] + exact (mul_le_mul_of_nonneg_right (hd k) (norm_nonneg _)).trans_eq (one_mul _)) + +@[simp] theorem fiberDiagonal_apply (d : ℤ → ℂ) (hd : ∀ k, ‖d k‖ ≤ 1) + (v : SourceFiberHilbert) (k : ℤ) : fiberDiagonal d hd v k = d k * v k := rfl + +theorem fiberDiagonal_norm (d : ℤ → ℂ) (hd : ∀ k, ‖d k‖ ≤ 1) : + ‖fiberDiagonal d hd‖ ≤ 1 := + LinearMap.mkContinuous_norm_le _ (by norm_num) _ + +theorem fiberDiagonal_single (d : ℤ → ℂ) (hd : ∀ k, ‖d k‖ ≤ 1) (n : ℤ) : + fiberDiagonal d hd (lp.single 2 n (1 : ℂ)) = d n • lp.single 2 n (1 : ℂ) := by + classical + apply Subtype.ext + funext k + change d k * (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) k = + d n * (lp.single 2 n (1 : ℂ) : SourceFiberHilbert) k + by_cases h : n = k + · subst k; rfl + · simp [lp.single_apply, h] + +theorem fiberDiagonal_continuousOn {X : Type*} [TopologicalSpace X] + (d : X → ℤ → ℂ) (hd : ∀ x k, ‖d x k‖ ≤ 1) (Q : Set X) + (hc : ∀ k, ContinuousOn (fun x => d x k) Q) (v : SourceFiberHilbert) : + ContinuousOn (fun x => fiberDiagonal (d x) (hd x) v) Q := by + apply fiberField_continuousOn _ Q 1 (fun x _ => fiberDiagonal_norm _ _) _ v + intro k + simp_rw [fiberDiagonal_single] + exact (hc k).smul continuousOn_const + +theorem fiberDiagonal_stronglyMeasurable {X : Type*} [MeasurableSpace X] + (d : X → ℤ → ℂ) (hd : ∀ x k, ‖d x k‖ ≤ 1) + (hm : ∀ k, Measurable (fun x => d x k)) (v : SourceFiberHilbert) : + StronglyMeasurable (fun x => fiberDiagonal (d x) (hd x) v) := by + apply fiberCoordinates_stronglyMeasurable + intro k + exact (hm k).mul_const (v k) + +/-- Applying a measurable field to a measurable vector uses finite coordinate +approximations, without measurability in the operator norm topology. -/ +theorem fiberField_stronglyMeasurable_apply {X : Type*} [MeasurableSpace X] + (A : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hA : ∀ v, StronglyMeasurable (fun x => A x v)) + (v : X → SourceFiberHilbert) (hv : StronglyMeasurable v) : + StronglyMeasurable (fun x => A x (v x)) := by + classical + apply stronglyMeasurable_of_tendsto (atTop : Filter (Finset ℤ)) + (f := fun s x => ∑ k ∈ s, (v x k) • A x (lp.single 2 k (1 : ℂ))) + · intro s + have h (k : ℤ) : StronglyMeasurable (fun x => (v x k) • A x (lp.single 2 k (1 : ℂ))) := + (((lp.evalCLM ℂ (fun _ : ℤ => ℂ) 2 k).continuous.comp_stronglyMeasurable hv).smul + (hA (lp.single 2 k (1 : ℂ)))) + convert Finset.stronglyMeasurable_sum s (fun k _ => h k) using 1 + ext x + simp only [Finset.sum_apply] + · rw [tendsto_pi_nhds] + intro x + exact fiberOperator_hasSum (A x) (v x) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Fiber/PairZeroSet.lean b/lean/OAI/Analysis/FiniteFactor/Fiber/PairZeroSet.lean new file mode 100644 index 0000000000000000000000000000000000000000..ca49f2664aabfa4dea0ead07c5fdbe8a03bab3ab --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Fiber/PairZeroSet.lean @@ -0,0 +1,99 @@ +import OAI.Analysis.FiniteFactor.Fiber.Diagonal +import OAI.Analysis.FiniteFactor.CrossedProduct.FiberSeparable + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- The actual bounded operator whose vanishing is the pair identity. -/ +def fiberPairResidual {X : Type*} + (P : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (d : X × X → ℤ → ℂ) (hd : ∀ z k, ‖d z k‖ ≤ 1) (z : X × X) : + SourceFiberHilbert →L[ℂ] SourceFiberHilbert := + (1 - P z.2) * fiberDiagonal (d z) (hd z) * P z.1 + +theorem fiberPairResidual_eq_zero_iff {X : Type*} + (P : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (d : X × X → ℤ → ℂ) (hd : ∀ z k, ‖d z k‖ ≤ 1) (z : X × X) : + fiberPairResidual P d hd z = 0 ↔ + ∀ k : ℤ, fiberPairResidual P d hd z (lp.single 2 k (1 : ℂ)) = 0 := by + constructor + · intro h k; rw [h]; rfl + · intro h + apply fiberOperator_ext + intro k n + rw [h n] + rfl + +theorem fiberPairResidual_continuousOn {X : Type*} [TopologicalSpace X] + (P : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (d : X × X → ℤ → ℂ) (hd : ∀ z k, ‖d z k‖ ≤ 1) + (Q : Set X) (C : ℝ) (hC : ∀ x ∈ Q, ‖P x‖ ≤ C) + (hP : ∀ k : ℤ, ContinuousOn (fun x => P x (lp.single 2 k (1 : ℂ))) Q) + (hdc : ∀ k, ContinuousOn (fun z => d z k) (Q ×ˢ Q)) (v : SourceFiberHilbert) : + ContinuousOn (fun z => fiberPairResidual P d hd z v) (Q ×ˢ Q) := by + have hPs (w : SourceFiberHilbert) := fiberField_continuousOn P Q C hC hP w + have hx (w : SourceFiberHilbert) : ContinuousOn (fun z : X × X => P z.1 w) (Q ×ˢ Q) := + (hPs w).comp continuous_fst.continuousOn (fun z hz => hz.1) + have hy (w : SourceFiberHilbert) : ContinuousOn (fun z : X × X => P z.2 w) (Q ×ˢ Q) := + (hPs w).comp continuous_snd.continuousOn (fun z hz => hz.2) + have hD (w : SourceFiberHilbert) := fiberDiagonal_continuousOn d hd (Q ×ˢ Q) hdc w + have hv := fiberField_continuousOn_apply (fun z => fiberDiagonal (d z) (hd z)) + (Q ×ˢ Q) 1 (fun z _ => fiberDiagonal_norm _ _) hD (fun z => P z.1 v) (hx v) + have hpv := fiberField_continuousOn_apply (fun z : X × X => P z.2) + (Q ×ˢ Q) C (fun z hz => hC z.2 hz.2) hy _ hv + exact hv.sub hpv + +theorem fiberPairResidual_stronglyMeasurable {X : Type*} [MeasurableSpace X] + (P : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (d : X × X → ℤ → ℂ) (hd : ∀ z k, ‖d z k‖ ≤ 1) + (hP : ∀ v, StronglyMeasurable (fun x => P x v)) + (hdm : ∀ k, Measurable (fun z => d z k)) (v : SourceFiberHilbert) : + StronglyMeasurable (fun z => fiberPairResidual P d hd z v) := by + have hv := fiberField_stronglyMeasurable_apply (fun z => fiberDiagonal (d z) (hd z)) + (fun w => fiberDiagonal_stronglyMeasurable d hd hdm w) + (fun z => P z.1 v) ((hP v).comp_measurable measurable_fst) + have hpv := fiberField_stronglyMeasurable_apply (fun z : X × X => P z.2) + (fun w => (hP w).comp_measurable measurable_snd) _ hv + exact hv.sub hpv + +theorem fiberPairZeroSet_measurable {X : Type*} [MeasurableSpace X] + (P : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (d : X × X → ℤ → ℂ) (hd : ∀ z k, ‖d z k‖ ≤ 1) + (hP : ∀ v, StronglyMeasurable (fun x => P x v)) + (hdm : ∀ k, Measurable (fun z => d z k)) : + MeasurableSet {z | fiberPairResidual P d hd z = 0} := by + borelize (↥SourceFiberHilbert) + simp_rw [fiberPairResidual_eq_zero_iff, Set.ofPred_forall] + exact MeasurableSet.iInter (fun k => measurableSet_eq_fun + (fiberPairResidual_stronglyMeasurable P d hd hP hdm _).measurable measurable_const) + +theorem fiberPairZeroSet_compact {X : Type*} [TopologicalSpace X] [T2Space X] + (P : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (d : X × X → ℤ → ℂ) (hd : ∀ z k, ‖d z k‖ ≤ 1) + (Q : Set X) (hQ : IsCompact Q) (C : ℝ) (hC : ∀ x ∈ Q, ‖P x‖ ≤ C) + (hP : ∀ k : ℤ, ContinuousOn (fun x => P x (lp.single 2 k (1 : ℂ))) Q) + (hdc : ∀ k, ContinuousOn (fun z => d z k) (Q ×ˢ Q)) : + IsCompact ((Q ×ˢ Q) ∩ {z | fiberPairResidual P d hd z = 0}) := by + have he : ((Q ×ˢ Q) ∩ {z | fiberPairResidual P d hd z = 0}) = + ⋂ k : ℤ, ((Q ×ˢ Q) ∩ {z | fiberPairResidual P d hd z (lp.single 2 k (1 : ℂ)) = 0}) := by + ext z + simp only [Set.mem_inter_iff, Set.mem_ofPred_eq, Set.mem_iInter, + fiberPairResidual_eq_zero_iff] + constructor + · rintro ⟨hz,h⟩ k; exact ⟨hz,h k⟩ + · intro h; exact ⟨(h 0).1,fun k => (h k).2⟩ + apply (hQ.prod hQ).of_isClosed_subset _ Set.inter_subset_left + rw [he] + apply isClosed_iInter + intro k + exact (fiberPairResidual_continuousOn P d hd Q C hC hP hdc _).preimage_isClosed_of_isClosed + (hQ.prod hQ).isClosed isClosed_singleton + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Fiber/ProjectionDiagonal.lean b/lean/OAI/Analysis/FiniteFactor/Fiber/ProjectionDiagonal.lean new file mode 100644 index 0000000000000000000000000000000000000000..25294c1bc30376722fd6801e6d2f374225b45f8b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Fiber/ProjectionDiagonal.lean @@ -0,0 +1,93 @@ +import OAI.Analysis.FiniteFactor.Fiber.Shift +import OAI.Analysis.FiniteFactor.CrossedProduct.FieldAlgebra + +namespace OAI + +namespace FiniteFactor +noncomputable section + +/-- The diagonal of an orthogonal projection is the square norm of its column. -/ +theorem fiberProjection_diagonal_inner (P : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hp : IsStarProjection P) (k : ℤ) : + P (lp.single 2 k (1 : ℂ)) k = + inner ℂ (P (lp.single 2 k (1 : ℂ))) (P (lp.single 2 k (1 : ℂ))) := by + let e : SourceFiberHilbert := lp.single 2 k (1 : ℂ) + have hi : P (P e) = P e := congrArg (fun A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert => A e) + hp.isIdempotentElem + calc + _ = inner ℂ e (P e) := by simp [e,lp.inner_single_left] + _ = inner ℂ e (star P (P e)) := by rw [hp.isSelfAdjoint.star_eq,hi] + _ = _ := by rw [ContinuousLinearMap.star_eq_adjoint,ContinuousLinearMap.adjoint_inner_right] + +theorem fiberProjection_diagonal_zero_iff (P : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hp : IsStarProjection P) (k : ℤ) : + P (lp.single 2 k (1 : ℂ)) k = 0 ↔ P (lp.single 2 k (1 : ℂ)) = 0 := by + rw [fiberProjection_diagonal_inner P hp,inner_self_eq_zero] + +theorem fiberProjection_diagonal_one_iff (P : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hp : IsStarProjection P) (k : ℤ) : + P (lp.single 2 k (1 : ℂ)) k = 1 ↔ P (lp.single 2 k (1 : ℂ)) = lp.single 2 k (1 : ℂ) := by + have he := fiberProjection_diagonal_zero_iff (1-P) hp.one_sub k + change (lp.single 2 k (1 : ℂ) : SourceFiberHilbert) k - P (lp.single 2 k (1 : ℂ)) k = 0 ↔ + lp.single 2 k (1 : ℂ) - P (lp.single 2 k (1 : ℂ)) = 0 at he + simp only [lp.single_apply,Pi.single_eq_same] at he + rw [sub_eq_zero,sub_eq_zero] at he + simpa only [eq_comm] using he + +theorem fiberProjection_diagonal_bounds (P : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hp : IsStarProjection P) (k : ℤ) : + 0 ≤ (P (lp.single 2 k (1 : ℂ)) k).re ∧ + (P (lp.single 2 k (1 : ℂ)) k).re ≤ 1 ∧ + (P (lp.single 2 k (1 : ℂ)) k).im = 0 := by + have hr : (P (lp.single 2 k (1 : ℂ)) k).re = ‖P (lp.single 2 k (1 : ℂ))‖ ^ 2 := by + rw [fiberProjection_diagonal_inner P hp] + exact inner_self_eq_norm_sq (𝕜 := ℂ) _ + have hb : 1 - (P (lp.single 2 k (1 : ℂ)) k).re = ‖(1-P) (lp.single 2 k (1 : ℂ))‖ ^ 2 := by + have h := congrArg Complex.re (fiberProjection_diagonal_inner (1-P) hp.one_sub k) + change ((lp.single 2 k (1 : ℂ) : SourceFiberHilbert) k - P (lp.single 2 k (1 : ℂ)) k).re = _ at h + simpa only [lp.single_apply,Pi.single_eq_same,Complex.sub_re,Complex.one_re, + show ∀ v : SourceFiberHilbert, (inner ℂ v v).re = ‖v‖^2 from inner_self_eq_norm_sq (𝕜 := ℂ)] using h + refine ⟨by rw [hr]; positivity,by nlinarith [sq_nonneg ‖(1-P) (lp.single 2 k (1 : ℂ))‖],?_⟩ + rw [fiberProjection_diagonal_inner P hp] + exact inner_self_im (𝕜 := ℂ) _ + +/-- If a diagonal entry is zero, that coordinate annihilates the entire range. -/ +theorem fiberProjection_range_coordinate_zero (P : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hp : IsStarProjection P) (k : ℤ) (hz : P (lp.single 2 k (1 : ℂ)) k = 0) + (v : SourceFiberHilbert) : P v k = 0 := by + have hzv := (fiberProjection_diagonal_zero_iff P hp k).mp hz + have he : inner ℂ (lp.single 2 k (1 : ℂ)) (P v) = + inner ℂ (P (lp.single 2 k (1 : ℂ))) v := by + rw [← ContinuousLinearMap.adjoint_inner_right P (lp.single 2 k (1 : ℂ)) v, + ← ContinuousLinearMap.star_eq_adjoint,hp.isSelfAdjoint.star_eq] + simpa [lp.inner_single_left,hzv] using he + +/-- Positivity of the diagonal weight transfers zero backwards and one forwards. -/ +theorem fiberProjection_diagonal_implications + (P Q D : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hp : IsStarProjection P) (hq : IsStarProjection Q) + (hi : (1-Q)*D*P = 0) (a : ℂ) (ha : a ≠ 0) + (hd : ∀ v : SourceFiberHilbert, D v 0 = a * v 0) + (he : D (lp.single 2 0 (1 : ℂ)) = a • lp.single 2 0 (1 : ℂ)) : + (Q (lp.single 2 0 (1 : ℂ)) 0 = 0 → P (lp.single 2 0 (1 : ℂ)) 0 = 0) ∧ + (P (lp.single 2 0 (1 : ℂ)) 0 = 1 → Q (lp.single 2 0 (1 : ℂ)) 0 = 1) := by + let e : SourceFiberHilbert := lp.single 2 0 (1 : ℂ) + have hfix : Q (D (P e)) = D (P e) := by + have hh := congrArg (fun A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert => A e) hi + change D (P e) - Q (D (P e)) = 0 at hh + exact (sub_eq_zero.mp hh).symm + constructor + · intro hz + have hcoord := congrArg (fun v : SourceFiberHilbert => v 0) hfix + rw [fiberProjection_range_coordinate_zero Q hq 0 hz,hd] at hcoord + exact (mul_eq_zero.mp hcoord.symm).resolve_left ha + · intro h1 + have hpfix := (fiberProjection_diagonal_one_iff P hp 0).mp h1 + rw [hpfix,he,map_smul] at hfix + have hqfix : Q e = e := (smul_right_injective _ ha) hfix + exact (fiberProjection_diagonal_one_iff Q hq 0).mpr hqfix + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Fiber/Shift.lean b/lean/OAI/Analysis/FiniteFactor/Fiber/Shift.lean new file mode 100644 index 0000000000000000000000000000000000000000..fe233d60945de75e74f8bbb07b2055375b0c4e8f --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Fiber/Shift.lean @@ -0,0 +1,105 @@ +import OAI.Analysis.FiniteFactor.BoundedMatrixOperator + +namespace OAI + +namespace FiniteFactor +open Filter +open scoped ENNReal +noncomputable section + +/-- Coordinate translation on the original l2 fiber. -/ +def fiberShiftVector (n : ℤ) (v : SourceFiberHilbert) : SourceFiberHilbert := + ⟨fun k => v (k-n), memℓp_gen + ((Equiv.subRight n).summable_iff.mpr ((lp.memℓp v).summable (by norm_num)))⟩ + +theorem fiberShiftVector_norm (n : ℤ) (v : SourceFiberHilbert) : + ‖fiberShiftVector n v‖ = ‖v‖ := by + have he : ‖fiberShiftVector n v‖ ^ 2 = ‖v‖ ^ 2 := by + rw [show ‖fiberShiftVector n v‖ ^ 2 = + ∑' k, ‖fiberShiftVector n v k‖ ^ 2 by + simpa using lp.norm_rpow_eq_tsum (p := (2 : ℝ≥0∞)) (by norm_num) (fiberShiftVector n v)] + rw [show ‖v‖ ^ 2 = ∑' k, ‖v k‖ ^ 2 by + simpa using lp.norm_rpow_eq_tsum (p := (2 : ℝ≥0∞)) (by norm_num) v] + exact (Equiv.subRight n).tsum_eq (fun k => ‖v k‖ ^ 2) + nlinarith [norm_nonneg (fiberShiftVector n v), norm_nonneg v] + +def fiberShift (n : ℤ) : SourceFiberHilbert →L[ℂ] SourceFiberHilbert := + LinearMap.mkContinuous + { toFun := fiberShiftVector n + map_add' := fun u v => rfl + map_smul' := fun c v => rfl } + 1 (fun v => by + change ‖fiberShiftVector n v‖ ≤ 1 * ‖v‖ + rw [one_mul, fiberShiftVector_norm]) + +@[simp] theorem fiberShift_apply (n : ℤ) (v : SourceFiberHilbert) (k : ℤ) : + fiberShift n v k = v (k-n) := rfl + +theorem fiberShift_single (n m : ℤ) (c : ℂ) : + fiberShift n (lp.single 2 m c) = lp.single 2 (m+n) c := by + classical + apply Subtype.ext + funext k + change (lp.single 2 m c : SourceFiberHilbert) (k-n) = + (lp.single 2 (m+n) c : SourceFiberHilbert) k + by_cases h : m = k-n + · simp [lp.single_apply, h] + · have hh : m+n ≠ k := by omega + simp [lp.single_apply, h, hh] + +@[simp] theorem fiberShift_mul (n m : ℤ) : fiberShift n * fiberShift m = fiberShift (n+m) := by + apply ContinuousLinearMap.ext + intro v + apply Subtype.ext + funext k + change v (k-n-m) = v (k-(n+m)) + exact congrArg v (by omega) + +@[simp] theorem fiberShift_zero : fiberShift 0 = 1 := by + apply ContinuousLinearMap.ext + intro v + apply Subtype.ext + funext k + change v (k-0) = v k + rw [sub_zero] + +theorem fiber_covariance_operator + (A B : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (n : ℤ) + (h : ∀ k m : ℤ, (B (lp.single 2 m (1 : ℂ))) k = + (A (lp.single 2 (m+n) (1 : ℂ))) (k+n)) : + fiberShift (-n) * A = B * fiberShift (-n) := by + apply fiberOperator_ext + intro k m + change (A (lp.single 2 m (1 : ℂ))) (k-(-n)) = + (B (fiberShift (-n) (lp.single 2 m (1 : ℂ)))) k + rw [fiberShift_single, h] + simp + +/-- Invariance of a projection range persists under every nonnegative power. -/ +theorem invariant_projection_pow {R : Type*} [Ring R] (p T : R) + (hp : p*p = p) (hinv : (1-p)*T*p = 0) : ∀ n : ℕ, (1-p)*(T^n)*p = 0 := by + have hTp : T*p = p*T*p := by + have h := hinv + rw [sub_mul, one_mul, sub_mul] at h + exact sub_eq_zero.mp h + have hfix : ∀ n : ℕ, T^n*p = p*(T^n)*p := by + intro n + induction n with + | zero => simpa using hp.symm + | succ n ih => + calc + T^(n+1)*p = T*(T^n*p) := by rw [pow_succ', mul_assoc] + _ = T*(p*T^n*p) := by rw [ih] + _ = (T*p)*T^n*p := by simp only [mul_assoc] + _ = (p*T*p)*T^n*p := by rw [hTp] + _ = p*T*(p*T^n*p) := by simp only [mul_assoc] + _ = p*T*(T^n*p) := by rw [← ih] + _ = p*T^(n+1)*p := by rw [pow_succ']; simp only [mul_assoc] + intro n + rw [sub_mul, one_mul, sub_mul, hfix n] + simp only [mul_assoc, sub_self] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Fiber/StrongContinuity.lean b/lean/OAI/Analysis/FiniteFactor/Fiber/StrongContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..cfcd37561c6bea00aef413b64e3d59d6beb4344c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Fiber/StrongContinuity.lean @@ -0,0 +1,68 @@ +import OAI.Analysis.FiniteFactor.BoundedMatrixOperator +import Mathlib.Topology.MetricSpace.UniformConvergence + +namespace OAI + +namespace FiniteFactor +open Filter +open scoped Topology +noncomputable section + +/-- A uniformly bounded field is strongly continuous wherever all its basis +columns are continuous. No norm-continuity of the field is required. -/ +theorem fiberField_continuousOn {X : Type*} [TopologicalSpace X] + (A : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (Q : Set X) + (C : ℝ) (hC : ∀ x ∈ Q, ‖A x‖ ≤ C) + (hb : ∀ k : ℤ, ContinuousOn (fun x => A x (lp.single 2 k (1 : ℂ))) Q) + (v : SourceFiberHilbert) : ContinuousOn (fun x => A x v) Q := by + classical + let w : Finset ℤ → SourceFiberHilbert := fun s => ∑ k ∈ s, lp.single 2 k (v k) + have hw : Tendsto w atTop (𝓝 v) := lp.hasSum_single (by norm_num) v + have he : Tendsto (fun s => C * ‖v - w s‖) atTop (𝓝 0) := by + simpa using ((tendsto_const_nhds (x := v)).sub hw).norm.const_mul C + have hu : TendstoUniformlyOn (fun s x => A x (w s)) (fun x => A x v) atTop Q := by + apply Metric.tendstoUniformlyOn_iff.mpr + intro ε hε + filter_upwards [(tendsto_order.mp he).2 ε hε] with s hs x hx + rw [dist_eq_norm, ← map_sub] + exact ((A x).le_opNorm (v - w s)).trans_lt + ((mul_le_mul_of_nonneg_right (hC x hx) (norm_nonneg _)).trans_lt hs) + apply hu.continuousOn + apply Filter.Eventually.frequently + apply Eventually.of_forall + intro s + have hh : (fun x => A x (w s)) = + fun x => ∑ k ∈ s, (v k) • A x (lp.single 2 k (1 : ℂ)) := by + funext x + simp only [w, map_sum] + apply Finset.sum_congr rfl + intro k _ + rw [show lp.single 2 k (v k) = (v k) • (lp.single 2 k (1 : ℂ) : SourceFiberHilbert) by + simp [← lp.single_smul], map_smul] + rw [hh] + exact continuousOn_finsetSum s (fun k _ => (hb k).const_smul (v k)) + +/-- Evaluation on a varying continuous vector preserves strong continuity +under a uniform operator bound. -/ +theorem fiberField_continuousOn_apply {X : Type*} [TopologicalSpace X] + (A : X → SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (Q : Set X) + (C : ℝ) (hC : ∀ x ∈ Q, ‖A x‖ ≤ C) + (hA : ∀ v, ContinuousOn (fun x => A x v) Q) + (v : X → SourceFiberHilbert) (hv : ContinuousOn v Q) : + ContinuousOn (fun x => A x (v x)) Q := by + intro x hx + have he : Tendsto (fun y => C * ‖v y - v x‖) (𝓝[Q] x) (𝓝 0) := by + simpa using ((hv x hx).sub_const (v x)).norm.const_mul C + have hzero : Tendsto (fun y => A y (v y - v x)) (𝓝[Q] x) (𝓝 0) := by + apply squeeze_zero_norm' _ he + filter_upwards [self_mem_nhdsWithin] with y hy + exact ((A y).le_opNorm _).trans + (mul_le_mul_of_nonneg_right (hC y hy) (norm_nonneg _)) + have ht := hzero.add (hA (v x) x hx) + change Tendsto _ _ _ + simpa only [map_sub, sub_add_cancel, zero_add] using ht + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Fiber/TransportConvolution.lean b/lean/OAI/Analysis/FiniteFactor/Fiber/TransportConvolution.lean new file mode 100644 index 0000000000000000000000000000000000000000..fcf760ab03a8e5035605cbd35a282c19457e2ec4 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Fiber/TransportConvolution.lean @@ -0,0 +1,59 @@ +import OAI.Analysis.FiniteFactor.Convolution +import OAI.Analysis.FiniteFactor.Fiber.ProjectionDiagonal + +namespace OAI + +namespace FiniteFactor +open scoped ComplexConjugate +noncomputable section + +/-- Composition of the two genuine range inclusions used in the convolution. -/ +theorem invariant_transport_composition {R : Type*} [Ring R] (P Q D W : R) + (hD : (1-Q)*D*P = 0) (hW : (1-Q)*W*Q = 0) : + (1-Q)*W*D*P = 0 := by + have hd : D*P = Q*D*P := by + apply sub_eq_zero.mp + simpa only [sub_mul,one_mul] using hD + calc + _ = (1-Q)*W*(D*P) := by simp only [mul_assoc] + _ = (1-Q)*W*(Q*D*P) := by rw [hd] + _ = ((1-Q)*W*Q)*D*P := by simp only [mul_assoc] + _ = 0 := by rw [hW,zero_mul,zero_mul] + +theorem fiber_complement_inner_zero + (Q : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) (hQ : IsStarProjection Q) + (u v : SourceFiberHilbert) (hv : (1-Q) v = 0) : + inner ℂ ((1-Q) u) v = 0 := by + rw [← ContinuousLinearMap.adjoint_inner_right (1-Q) u v, + ← ContinuousLinearMap.star_eq_adjoint,hQ.one_sub.isSelfAdjoint.star_eq,hv,inner_zero_right] + +/-- The source convolution vanishes whenever the actual transport and weighted +power identities hold. No square summability of rescaled coefficients is assumed. -/ +theorem fiber_transport_convolution_zero + (P Q D W : SourceFiberHilbert →L[ℂ] SourceFiberHilbert) + (hQ : IsStarProjection Q) (F G : ℤ → ℝ) (hG : ∀ k, G k ≠ 0) (n : ℤ) + (hD : (1-Q)*D*P = 0) (hW : (1-Q)*W*Q = 0) + (hDa : ∀ (v : SourceFiberHilbert) (k : ℤ), D v k = (G k / F k : ℂ) * v k) + (hWa : ∀ (v : SourceFiberHilbert) (k : ℤ), W v (n+k) = (G (n+k) / G k : ℂ) * v k) : + (∑' k, leftCoefficient F (P (lp.single 2 0 (1 : ℂ))) k * + rightCoefficient G ((1-Q) (lp.single 2 0 (1 : ℂ))) (-n-k)) = 0 := by + let ξ := P (lp.single 2 0 (1 : ℂ)) + let γ := (1-Q) (lp.single 2 0 (1 : ℂ)) + let η := W (D ξ) + have hη : ∀ k, η (n+k) = ((G (n+k) / F k : ℝ) : ℂ) * ξ k := by + intro k + dsimp [η] + rw [hWa,hDa,Complex.ofReal_div] + have hg : (G k : ℂ) ≠ 0 := by exact_mod_cast hG k + field_simp + have hz : (1-Q) η = 0 := by + exact congrArg (fun A : SourceFiberHilbert →L[ℂ] SourceFiberHilbert => A (lp.single 2 0 (1 : ℂ))) + (invariant_transport_composition P Q D W hD hW) + simp only [cocycle_convolution_term_eq] + rw [weighted_shift_convolution_eq_inner ξ γ η (fun k => G (n+k)/F k) n hη] + exact fiber_complement_inner_zero Q hQ _ η hz + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/FiniteMeasureCylinderCriterion.lean b/lean/OAI/Analysis/FiniteFactor/FiniteMeasureCylinderCriterion.lean new file mode 100644 index 0000000000000000000000000000000000000000..acfe5104992a472758de8c56aa6d68d81da04b3a --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/FiniteMeasureCylinderCriterion.lean @@ -0,0 +1,41 @@ +import Mathlib.MeasureTheory.Measure.Portmanteau + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +/-- Finite-measure version of the neighborhood pi-system criterion. Total +mass convergence is required; zero limiting mass is handled separately. -/ +theorem finiteMeasure_tendsto_of_piSystem {Ω : Type*} [MeasurableSpace Ω] + [TopologicalSpace Ω] [SecondCountableTopology Ω] [OpensMeasurableSpace Ω] + [Nonempty Ω] {S : Set (Set Ω)} (hS : IsPiSystem S) + {μ : ℕ → FiniteMeasure Ω} {ν : FiniteMeasure Ω} + (hmeas : ∀ s ∈ S, MeasurableSet s) + (hbasis : ∀ u : Set Ω, IsOpen u → ∀ x ∈ u, ∃ s ∈ S, s ∈ 𝓝 x ∧ s ⊆ u) + (hmass : Tendsto (fun n => (μ n).mass) atTop (𝓝 ν.mass)) + (hsets : ∀ s ∈ S, Tendsto (fun n => μ n s) atTop (𝓝 (ν s))) : + Tendsto μ atTop (𝓝 ν) := by + by_cases hν : ν = 0 + · subst ν + exact FiniteMeasure.tendsto_zero_of_tendsto_zero_mass hmass + apply FiniteMeasure.tendsto_of_tendsto_normalize_testAgainstNN_of_tendsto_mass _ hmass + apply hS.tendsto_probabilityMeasure_of_tendsto_of_mem hmeas hbasis + intro s hs + have hv := ν.mass_nonzero_iff.mpr hν + have he : ∀ᶠ n in atTop, μ n ≠ 0 := by + filter_upwards [hmass.eventually (eventually_ne_nhds hv)] with n hn + exact (μ n).mass_nonzero_iff.mp hn + have hi : Tendsto (fun n => (μ n).mass⁻¹ * μ n s) atTop (𝓝 (ν.mass⁻¹ * ν s)) := + (hmass.inv₀ hv).mul (hsets s hs) + rw [← ν.normalize_eq_of_nonzero hν s] at hi + apply hi.congr' + filter_upwards [he] with n hn + exact ((μ n).normalize_eq_of_nonzero hn s).symm + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/FiniteMixtureAlgebra.lean b/lean/OAI/Analysis/FiniteFactor/FiniteMixtureAlgebra.lean new file mode 100644 index 0000000000000000000000000000000000000000..7f540dc6671448366417a705827a53f8e78ccf9a --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/FiniteMixtureAlgebra.lean @@ -0,0 +1,56 @@ +import OAI.Analysis.FiniteFactor.FiniteProductAbsoluteContinuity +import Mathlib.Algebra.BigOperators.Group.Finset.Powerset + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Finset +open scoped ENNReal +noncomputable section + +/-- Equal-weight mixture of two probability measures. -/ +def probabilityAverage {X : Type*} [MeasurableSpace X] (μ ν : Measure X) : Measure X := + (2 : ℝ≥0∞)⁻¹ • (μ + ν) + +instance probabilityAverage_probability {X : Type*} [MeasurableSpace X] + (μ ν : Measure X) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : + IsProbabilityMeasure (probabilityAverage μ ν) := by + constructor + simpa [probabilityAverage,Measure.smul_apply,Measure.add_apply,measure_univ] + using ENNReal.inv_two_add_inv_two + +/-- A single-coordinate update, as a linear operation on the remaining law. -/ +def coordinateUpdateLaw {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] + (i : ι) (μ : Measure X) (ν : Measure (ι → X)) : Measure (ι → X) := + (μ.prod ν).map (fun z : X × (ι → X) => Function.update z.2 i z.1) + +theorem measurable_coordinateUpdate {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] (i : ι) : + Measurable (fun z : X × (ι → X) => Function.update z.2 i z.1) := by + apply Measurable.of_eval + intro k + by_cases hk : k = i + · subst k; simpa using (measurable_fst : Measurable (Prod.fst : X × (ι → X) → X)) + · simpa [Function.update_of_ne hk,Function.comp_def] using (measurable_pi_apply k).comp + (measurable_snd : Measurable (Prod.snd : X × (ι → X) → (ι → X))) + +theorem coordinateUpdateLaw_add_right {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] + (i : ι) (μ : Measure X) (ν η : Measure (ι → X)) + [SFinite μ] [SFinite ν] [SFinite η] : + coordinateUpdateLaw i μ (ν+η) = coordinateUpdateLaw i μ ν + coordinateUpdateLaw i μ η := by + rw [coordinateUpdateLaw,Measure.prod_add,Measure.map_add _ _ (measurable_coordinateUpdate i)] + rfl + +theorem coordinateUpdateLaw_average {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] + (i : ι) (μ ν : Measure X) (η : Measure (ι → X)) + [SFinite μ] [SFinite ν] [SFinite η] : + coordinateUpdateLaw i (probabilityAverage μ ν) η = + (2 : ℝ≥0∞)⁻¹ • (coordinateUpdateLaw i μ η + coordinateUpdateLaw i ν η) := by + unfold coordinateUpdateLaw probabilityAverage + rw [Measure.prod_smul_left,Measure.add_prod, + Measure.map_smul _ (measurable_coordinateUpdate i).aemeasurable, + Measure.map_add _ _ (measurable_coordinateUpdate i)] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/FiniteProductAbsoluteContinuity.lean b/lean/OAI/Analysis/FiniteFactor/FiniteProductAbsoluteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..91f3240c9bab95b0bede5d65fa3a794ce1979727 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/FiniteProductAbsoluteContinuity.lean @@ -0,0 +1,111 @@ +import Mathlib.Probability.ProductMeasure +import Mathlib.MeasureTheory.Measure.Prod + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Finset +open scoped ENNReal +noncomputable section + +/-- Replacing one independent coordinate is a measurable pushforward of a +single fresh draw and the original full product. -/ +theorem infinitePi_update_law {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] + (μ : ι → Measure X) [∀ i, IsProbabilityMeasure (μ i)] + (i : ι) (ν : Measure X) [IsProbabilityMeasure ν] : + (ν.prod (Measure.infinitePi μ)).map (fun z : X × (ι → X) => Function.update z.2 i z.1) = + Measure.infinitePi (Function.update μ i ν) := by + let : ∀ k, IsProbabilityMeasure (Function.update μ i ν k) := fun k => by + by_cases hk : k = i + · subst k; simpa using (inferInstance : IsProbabilityMeasure ν) + · simpa [Function.update_of_ne hk] using (inferInstance : IsProbabilityMeasure (μ k)) + have hm : Measurable (fun z : X × (ι → X) => Function.update z.2 i z.1) := by + apply Measurable.of_eval + intro k + by_cases hk : k = i + · subst k; simpa using (measurable_fst : Measurable (Prod.fst : X × (ι → X) → X)) + · simpa [Function.update_of_ne hk,Function.comp_def] using (measurable_pi_apply k).comp + (measurable_snd : Measurable (Prod.snd : X × (ι → X) → (ι → X))) + apply Measure.eq_infinitePi + intro S A hA + rw [Measure.map_apply hm (MeasurableSet.pi S.countable_toSet (fun k _ => hA k))] + by_cases hi : i ∈ S + · have he : (fun z : X × (ι → X) => Function.update z.2 i z.1) ⁻¹' Set.pi (S : Set ι) A = + A i ×ˢ Set.pi (↑(S.erase i) : Set ι) A := by + ext z + simp only [Set.mem_preimage,Set.mem_pi,Finset.mem_coe,Set.mem_prod,mem_erase] + constructor + · intro hz + refine ⟨by simpa using hz i hi,?_⟩ + intro k hk + simpa [Function.update_of_ne hk.1] using hz k hk.2 + · rintro ⟨hz,hrest⟩ k hk + by_cases hki : k = i + · subst k; simpa using hz + · simpa [Function.update_of_ne hki] using hrest k ⟨hki,hk⟩ + rw [he,Measure.prod_prod,Measure.infinitePi_pi _ (fun k _ => hA k)] + rw [← Finset.mul_prod_erase S (fun k => Function.update μ i ν k (A k)) hi] + simp only [Function.update_self] + congr 1 + exact Finset.prod_congr rfl fun k hk => by rw [Function.update_of_ne (mem_erase.mp hk).1] + · have he : (fun z : X × (ι → X) => Function.update z.2 i z.1) ⁻¹' Set.pi (S : Set ι) A = + Set.univ ×ˢ Set.pi (S : Set ι) A := by + ext z + simp only [Set.mem_preimage,Set.mem_pi,Finset.mem_coe,Set.mem_prod,Set.mem_univ,true_and] + apply forall_congr' + intro k + constructor <;> intro h hk + · simpa [Function.update_of_ne (show k ≠ i from fun he => hi (he ▸ hk))] using h hk + · simpa [Function.update_of_ne (show k ≠ i from fun he => hi (he ▸ hk))] using h hk + rw [he,Measure.prod_prod,measure_univ,one_mul,Measure.infinitePi_pi _ (fun k _ => hA k)] + exact Finset.prod_congr rfl fun k hk => by + rw [Function.update_of_ne (show k ≠ i from fun he => hi (he ▸ hk))] + +/-- Absolute continuity survives finitely many coordinate changes. No assertion +about arbitrary infinite families of absolutely continuous marginals is used. -/ +theorem infinitePi_ac_of_finite_changes {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] + (μ ν : ι → Measure X) [∀ i, IsProbabilityMeasure (μ i)] + [∀ i, IsProbabilityMeasure (ν i)] (F : Finset ι) + (hac : ∀ i ∈ F, ν i ≪ μ i) (heq : ∀ i ∉ F, ν i = μ i) : + Measure.infinitePi ν ≪ Measure.infinitePi μ := by + induction F using Finset.induction_on generalizing ν with + | empty => + have h : ν = μ := funext fun i => heq i (by simp) + rw [h] + | @insert i F hi ih => + let σ := Function.update ν i (μ i) + let : ∀ k, IsProbabilityMeasure (σ k) := fun k => by + by_cases hk : k = i + · subst k; simpa [σ] using (inferInstance : IsProbabilityMeasure (μ i)) + · simpa [σ,Function.update_of_ne hk] using (inferInstance : IsProbabilityMeasure (ν k)) + have hσ : Measure.infinitePi σ ≪ Measure.infinitePi μ := by + apply ih σ + · intro k hk + have hki : k ≠ i := fun h => hi (h ▸ hk) + simpa [σ,Function.update_of_ne hki] using hac k (mem_insert_of_mem hk) + · intro k hk + by_cases hki : k = i + · subst k; simp [σ] + · simpa [σ,Function.update_of_ne hki] using heq k (by simp [hki,hk]) + have hupdate : Function.update σ i (ν i) = ν := by + ext k + by_cases hk : k = i <;> simp [σ,hk,Function.update_of_ne] + have hsame : Function.update σ i (μ i) = σ := by simp [σ] + have hprod := (hac i (mem_insert_self i F)).prod + (Measure.AbsolutelyContinuous.rfl : Measure.infinitePi σ ≪ Measure.infinitePi σ) + have hmap : ((ν i).prod (Measure.infinitePi σ)).map (fun z : X × (ι → X) => Function.update z.2 i z.1) ≪ + ((μ i).prod (Measure.infinitePi σ)).map (fun z : X × (ι → X) => Function.update z.2 i z.1) := by + apply hprod.map + apply Measurable.of_eval + intro k + by_cases hk : k = i + · subst k; simpa using (measurable_fst : Measurable (Prod.fst : X × (ι → X) → X)) + · simpa [Function.update_of_ne hk,Function.comp_def] using (measurable_pi_apply k).comp + (measurable_snd : Measurable (Prod.snd : X × (ι → X) → (ι → X))) + rw [infinitePi_update_law,infinitePi_update_law,hupdate,hsame] at hmap + exact hmap.trans hσ + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/FiniteProductMixture.lean b/lean/OAI/Analysis/FiniteFactor/FiniteProductMixture.lean new file mode 100644 index 0000000000000000000000000000000000000000..1433c04ab7b7f08c93e41118208dd1e0a1e879da --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/FiniteProductMixture.lean @@ -0,0 +1,107 @@ +import OAI.Analysis.FiniteFactor.FiniteMixtureAlgebra +import Mathlib.MeasureTheory.Measure.WithDensity + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Finset +open scoped ENNReal +noncomputable section +variable {ι X : Type*} [DecidableEq ι] [MeasurableSpace X] + +variable (μ ν : ι → Measure X) [∀ i, IsProbabilityMeasure (μ i)] [∀ i, IsProbabilityMeasure (ν i)] + +def finiteChoiceLaw (I : Finset ι) : Measure (ι → X) := by + letI : ∀ i, IsProbabilityMeasure (if i ∈ I then ν i else μ i) := + fun i => by split_ifs <;> infer_instance + exact Measure.infinitePi (fun i => if i ∈ I then ν i else μ i) + +instance finiteChoiceLaw_probability (I : Finset ι) : IsProbabilityMeasure (finiteChoiceLaw μ ν I) := by + unfold finiteChoiceLaw + infer_instance + +def finiteAverageLaw (F : Finset ι) : Measure (ι → X) := by + letI : ∀ i, IsProbabilityMeasure (if i ∈ F then probabilityAverage (μ i) (ν i) else μ i) := + fun i => by split_ifs <;> infer_instance + exact Measure.infinitePi (fun i => if i ∈ F then probabilityAverage (μ i) (ν i) else μ i) + +instance finiteAverageLaw_probability (F : Finset ι) : IsProbabilityMeasure (finiteAverageLaw μ ν F) := by + unfold finiteAverageLaw + infer_instance + +theorem finiteChoiceLaw_update_base (I : Finset ι) (i : ι) (hi : i ∉ I) : + coordinateUpdateLaw i (μ i) (finiteChoiceLaw μ ν I) = finiteChoiceLaw μ ν I := by + unfold coordinateUpdateLaw finiteChoiceLaw + rw [infinitePi_update_law] + congr 1 + funext k + by_cases hk : k = i + · subst k; simp [hi] + · simp [Function.update_of_ne hk] + +theorem finiteChoiceLaw_update_replace (I : Finset ι) (i : ι) : + coordinateUpdateLaw i (ν i) (finiteChoiceLaw μ ν I) = finiteChoiceLaw μ ν (insert i I) := by + unfold coordinateUpdateLaw finiteChoiceLaw + rw [infinitePi_update_law] + congr 1 + funext k + by_cases hk : k = i + · subst k; simp + · simp [hk] + +theorem finiteAverageLaw_insert (F : Finset ι) (i : ι) : + finiteAverageLaw μ ν (insert i F) = + coordinateUpdateLaw i (probabilityAverage (μ i) (ν i)) (finiteAverageLaw μ ν F) := by + unfold coordinateUpdateLaw finiteAverageLaw + rw [infinitePi_update_law] + congr 1 + funext k + by_cases hk : k = i + · subst k; simp + · simp [hk] + +variable {μ ν} + +theorem coordinateUpdateLaw_smul_right (i : ι) (μ : Measure X) (ν : Measure (ι → X)) + [SFinite μ] [SFinite ν] (c : ℝ≥0∞) : + coordinateUpdateLaw i μ (c • ν) = c • coordinateUpdateLaw i μ ν := by + unfold coordinateUpdateLaw + rw [Measure.prod_smul_right, + Measure.map_smul _ (measurable_coordinateUpdate i).aemeasurable] + +theorem coordinateUpdateLaw_finset_sum {A : Type*} (i : ι) (μ : Measure X) + (ν : A → Measure (ι → X)) [SFinite μ] [∀ a, IsFiniteMeasure (ν a)] (S : Finset A) : + coordinateUpdateLaw i μ (∑ a ∈ S, ν a) = ∑ a ∈ S, coordinateUpdateLaw i μ (ν a) := by + classical + induction S using Finset.induction_on with + | empty => simp [coordinateUpdateLaw] + | @insert a S ha ih => + rw [Finset.sum_insert ha,coordinateUpdateLaw_add_right,Finset.sum_insert ha,ih] + +/-- The finite independent diagonal-or-replacement mixture is an exact finite +sum of the laws for each replacement pattern. -/ +theorem finiteAverageLaw_eq_sum (μ ν : ι → Measure X) + [∀ i, IsProbabilityMeasure (μ i)] [∀ i, IsProbabilityMeasure (ν i)] (F : Finset ι) : + finiteAverageLaw μ ν F = ((2 : ℝ≥0∞)⁻¹)^F.card • + ∑ I ∈ F.powerset, finiteChoiceLaw μ ν I := by + induction F using Finset.induction_on with + | empty => simp [finiteAverageLaw,finiteChoiceLaw] + | @insert i F hi ih => + rw [finiteAverageLaw_insert,coordinateUpdateLaw_average,ih, + coordinateUpdateLaw_smul_right,coordinateUpdateLaw_smul_right, + coordinateUpdateLaw_finset_sum,coordinateUpdateLaw_finset_sum] + have hb : (∑ I ∈ F.powerset, coordinateUpdateLaw i (μ i) (finiteChoiceLaw μ ν I)) = + ∑ I ∈ F.powerset, finiteChoiceLaw μ ν I := by + apply Finset.sum_congr rfl + intro I hI + apply finiteChoiceLaw_update_base + exact fun h => hi ((Finset.mem_powerset.mp hI) h) + simp_rw [finiteChoiceLaw_update_replace] + rw [hb,← smul_add,smul_smul,Finset.sum_powerset_insert hi, + Finset.card_insert_of_notMem hi,pow_succ] + rw [mul_comm] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/FiniteSingleTag.lean b/lean/OAI/Analysis/FiniteFactor/FiniteSingleTag.lean new file mode 100644 index 0000000000000000000000000000000000000000..13b9adbe1a63420babe3f7900e5598da512341d3 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/FiniteSingleTag.lean @@ -0,0 +1,77 @@ +import Mathlib.Probability.ProductMeasure +import Mathlib.Algebra.BigOperators.Group.Finset.Basic + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Finset +open scoped ENNReal Classical +noncomputable section + +variable {ι X : Type*} [Countable ι] [MeasurableSpace X] + +def singleTagCylinder (F : Finset ι) (T A : ι → Set X) (i : ι) : Set (ι → X) := + Set.pi (F : Set ι) (fun q => if q = i then T q else A q) + +theorem singleTagCylinder_measurable (F : Finset ι) (T A : ι → Set X) + (hT : ∀ q ∈ F, MeasurableSet (T q)) (hA : ∀ q ∈ F, MeasurableSet (A q)) (i : ι) : + MeasurableSet (singleTagCylinder F T A i) := by + classical + have he : singleTagCylinder F T A i = ⋂ q, ⋂ (_ : q ∈ F), + (fun ω : ι → X => ω q) ⁻¹' (if q = i then T q else A q) := by + ext ω + simp [singleTagCylinder,Set.mem_pi] + rw [he] + apply MeasurableSet.iInter + intro q + apply MeasurableSet.iInter + intro hq + by_cases h : q = i + · simpa only [ite_eq_left h] using (hT q hq).preimage (measurable_pi_apply q) + · simpa only [ite_eq_right h] using (hA q hq).preimage (measurable_pi_apply q) + +/-- Independent finite coordinates with one distinguished tag. The other +coordinates are explicitly nontagged, so these cylinders are disjoint. -/ +theorem finite_single_tag_lower (μ : ι → Measure X) [∀ q, IsProbabilityMeasure (μ q)] + (F : Finset ι) (T A : ι → Set X) + (hT : ∀ q ∈ F, MeasurableSet (T q)) (hA : ∀ q ∈ F, MeasurableSet (A q)) + (hdisj : ∀ q ∈ F, Disjoint (T q) (A q)) (t a : ℝ≥0∞) + (hTm : ∀ q ∈ F, t ≤ μ q (T q)) (hAm : ∀ q ∈ F, a ≤ μ q (A q)) : + (F.card : ℝ≥0∞)*t*a^(F.card-1) ≤ + (Measure.infinitePi μ) (⋃ i ∈ F, singleTagCylinder F T A i) := by + classical + have hd : Set.PairwiseDisjoint (F : Set ι) (singleTagCylinder F T A) := by + intro i hi l hl hil + apply Set.disjoint_left.mpr + intro ω hωi hωl + have ht : ω i ∈ T i := by simpa using (hωi i hi) + have ha : ω i ∈ A i := by simpa only [ite_eq_right hil] using (hωl i hi) + exact Set.disjoint_left.mp (hdisj i hi) ht ha + have hsingle (i : ι) (hi : i ∈ F) : t*a^(F.card-1) ≤ + (Measure.infinitePi μ) (singleTagCylinder F T A i) := by + have hmeas (q : ι) (hq : q ∈ F) : MeasurableSet (if q = i then T q else A q) := by + split_ifs <;> first | exact hT q hq | exact hA q hq + rw [singleTagCylinder,Measure.infinitePi_pi _ hmeas] + have he : t*a^(F.card-1) = ∏ q ∈ F, if q = i then t else a := by + rw [← Finset.mul_prod_erase F (fun q => if q = i then t else a) hi,ite_eq_left rfl] + congr 1 + calc + a^(F.card-1) = ∏ _q ∈ F.erase i, a := by simp [Finset.card_erase_of_mem hi] + _ = _ := by + apply Finset.prod_congr rfl + intro q hq + rw [ite_eq_right (Finset.mem_erase.mp hq).1] + rw [he] + apply Finset.prod_le_prod + intro q hq + by_cases h : q = i + · simpa only [ite_eq_left h] using hTm q hq + · simpa only [ite_eq_right h] using hAm q hq + rw [measure_biUnion_finset hd (fun i _ => singleTagCylinder_measurable F T A hT hA i)] + have hh := Finset.sum_le_sum hsingle + simpa only [Finset.sum_const,nsmul_eq_mul,mul_assoc] using hh + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/IndependentCount.lean b/lean/OAI/Analysis/FiniteFactor/IndependentCount.lean new file mode 100644 index 0000000000000000000000000000000000000000..7914fba2f424ff73ae585bf5a591f84eb4d04972 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/IndependentCount.lean @@ -0,0 +1,57 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.AngleLaw +import Mathlib.Data.Finset.Powerset + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Finset +open scoped ENNReal Classical +noncomputable section + +/-- The finite union event specifying at least q coordinate misses. -/ +def coordinateMissEvent (I : Finset SourceCoordinate) (q : ℕ) + (S : SourceCoordinate → Set ℝ) : Set (SourceCoordinate → ℝ) := + ⋃ J ∈ I.powersetCard q, Set.pi (J : Set SourceCoordinate) S + +/-- Independence and the union bound, retaining the exact natural exponent. +This lemma uses the actual source angle law. -/ +theorem coordinateMissEvent_bound (I : Finset SourceCoordinate) (q : ℕ) + (S : SourceCoordinate → Set ℝ) (hS : ∀ i, MeasurableSet (S i)) + (b : ℝ≥0∞) (hb : ∀ i ∈ I, sourceAngleMarginal i (S i) ≤ b) : + sourceAngleLaw (coordinateMissEvent I q S) ≤ (2 : ℝ≥0∞)^I.card * b^q := by + classical + have hJ (J : Finset SourceCoordinate) (hJ : J ∈ I.powersetCard q) : + sourceAngleLaw (Set.pi (J : Set SourceCoordinate) S) ≤ b^q := by + rcases Finset.mem_powersetCard.mp hJ with ⟨hsub, hcard⟩ + rw [sourceAngleLaw_cylinder J S (fun i _ => hS i)] + calc + _ ≤ ∏ _i ∈ J, b := Finset.prod_le_prod (fun i hi => hb i (hsub hi)) + _ = b^q := by simp [hcard] + have hc : (I.powersetCard q).card ≤ 2^I.card := by + rw [← Finset.card_powerset] + exact Finset.card_le_card (fun J hJ => Finset.mem_powerset.mpr (Finset.mem_powersetCard.mp hJ).1) + calc + _ ≤ ∑ J ∈ I.powersetCard q, sourceAngleLaw (Set.pi (J : Set SourceCoordinate) S) := + measure_biUnion_finset_le _ _ + _ ≤ ∑ _J ∈ I.powersetCard q, b^q := Finset.sum_le_sum hJ + _ = ((I.powersetCard q).card : ℝ≥0∞)*b^q := by simp [nsmul_eq_mul] + _ ≤ (2 : ℝ≥0∞)^I.card*b^q := by + have hc' : ((I.powersetCard q).card : ℝ≥0∞) ≤ (2 : ℝ≥0∞)^I.card := by exact_mod_cast hc + gcongr + +/-- Any realization with at least q misses lies in the union event. -/ +theorem mem_coordinateMissEvent_of_card (I : Finset SourceCoordinate) (q : ℕ) + (S : SourceCoordinate → Set ℝ) (θ : SourceCoordinate → ℝ) + (h : q ≤ (I.filter (fun i => θ i ∈ S i)).card) : θ ∈ coordinateMissEvent I q S := by + classical + obtain ⟨J, hJ, hcard⟩ := Finset.exists_subset_card_eq h + apply Set.mem_iUnion.mpr + refine ⟨J, Set.mem_iUnion.mpr ⟨Finset.mem_powersetCard.mpr ⟨?_, hcard⟩, ?_⟩⟩ + · exact hJ.trans (Finset.filter_subset _ _) + · intro i hi + exact (Finset.mem_filter.mp (hJ hi)).2 + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/L2UniformAbsoluteContinuity.lean b/lean/OAI/Analysis/FiniteFactor/L2UniformAbsoluteContinuity.lean new file mode 100644 index 0000000000000000000000000000000000000000..4d87ed40f0d799c8b3bae92dca8035c4171a7c18 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/L2UniformAbsoluteContinuity.lean @@ -0,0 +1,70 @@ +import OAI.Analysis.FiniteFactor.TailEstimate +import Mathlib.MeasureTheory.Measure.WithDensityFinite + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal NNReal Topology +noncomputable section + +/-- Cauchy--Schwarz bounds the mass of any Borel set under an actual L2 +density, in terms of the original reference measure of the set. -/ +theorem withDensity_L2_set_le {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (g : X → ℝ) + (hg : MemLp g 2 μ) (hg0 : ∀ x, 0 ≤ g x) + (A : Set X) (hA : MeasurableSet A) (C : ℝ) (hC : (∫ x, g x ^ 2 ∂μ) ≤ C) : + (μ.withDensity (fun x => ENNReal.ofReal (g x))) A ≤ + ENNReal.ofReal (Real.sqrt C * Real.sqrt ((μ A).toReal)) := by + have hi : MemLp (A.indicator (fun _ : X => (1 : ℝ))) 2 μ := + (memLp_const (1 : ℝ)).indicator hA + have hcs := integral_mul_le_sqrt_squares hg hi + (Eventually.of_forall hg0) + (Eventually.of_forall (fun x => Set.indicator_nonneg (fun _ _ => zero_le_one) x)) + have hint : (∫ x, g x * A.indicator (fun _ : X => (1 : ℝ)) x ∂μ) = ∫ x in A, g x ∂μ := by + rw [← integral_indicator hA] + apply integral_congr_ae + apply Eventually.of_forall + intro x + by_cases hx : x ∈ A <;> simp [hx] + have hsquare : (∫ x, (A.indicator (fun _ : X => (1 : ℝ)) x) ^ 2 ∂μ) = (μ A).toReal := by + have he : (fun x => (A.indicator (fun _ : X => (1 : ℝ)) x) ^ 2) = + A.indicator (fun _ : X => (1 : ℝ)) := by + funext x; by_cases hx : x ∈ A <;> simp [hx] + rw [he, integral_indicator hA] + simp [measureReal_def] + rw [hint, hsquare] at hcs + rw [withDensity_apply _ hA, ← ofReal_integral_eq_lintegral_ofReal + (hg.integrable (by norm_num)).restrict (Eventually.of_forall hg0)] + exact ENNReal.ofReal_le_ofReal (hcs.trans + (mul_le_mul_of_nonneg_right (Real.sqrt_le_sqrt hC) (Real.sqrt_nonneg _))) + +/-- Uniform L2 density bounds imply uniform absolute continuity, with no +measurable-selection premise for the densities. -/ +theorem uniformAC_of_L2_densities {X : Type*} [MeasurableSpace X] + (μ : Measure X) [IsFiniteMeasure μ] (ν : ℕ → Measure X) (C : ℝ) + (hν : ∀ n, ∃ g : X → ℝ, MemLp g 2 μ ∧ (∀ x, 0 ≤ g x) ∧ + ν n = μ.withDensity (fun x => ENNReal.ofReal (g x)) ∧ (∫ x, g x^2 ∂μ) ≤ C) + (ε : ℝ≥0) (hε : 0 < ε) : + ∃ δ : ℝ≥0∞, 0 < δ ∧ ∀ A, MeasurableSet A → μ A < δ → ∀ n, ν n A ≤ ε := by + let r : ℝ := (ε : ℝ) / (Real.sqrt C + 1) + have hr : 0 < r := div_pos (by exact_mod_cast hε) (by positivity) + refine ⟨ENNReal.ofReal (r^2), ENNReal.ofReal_pos.mpr (sq_pos_of_pos hr), ?_⟩ + intro A hA hμ n + obtain ⟨g,hg,hg0,he,hgC⟩ := hν n + rw [he] + apply (withDensity_L2_set_le μ g hg hg0 A hA C hgC).trans + have hreal : (μ A).toReal ≤ r^2 := by + exact (ENNReal.toReal_le_of_le_ofReal (by positivity) hμ.le) + have hs : Real.sqrt ((μ A).toReal) ≤ r := by + exact (Real.sqrt_le_sqrt hreal).trans_eq (Real.sqrt_sq hr.le) + have hmul : Real.sqrt C * r ≤ (ε : ℝ) := by + have heq : r * (Real.sqrt C + 1) = (ε : ℝ) := div_mul_cancel₀ _ (by positivity) + nlinarith [Real.sqrt_nonneg C] + exact (ENNReal.ofReal_le_ofReal + ((mul_le_mul_of_nonneg_left hs (Real.sqrt_nonneg C)).trans hmul)).trans_eq (by simp) + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Main.lean b/lean/OAI/Analysis/FiniteFactor/Main.lean new file mode 100644 index 0000000000000000000000000000000000000000..28c3d0dd4fe991c9fa135baa81445bd52e471023 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Main.lean @@ -0,0 +1,23 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.InvariantProjection +import OAI.Analysis.FiniteFactor.CrossedProduct.PreparedFactor + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped Topology +noncomputable section + +theorem main_theorem : MainTarget.{0} := by + obtain ⟨θ,hr,hphase,hs,_he,hcenter,hfinite,hminimal,hpredual,hθ,hT,hT0,_hinj,_hcontract,hqn⟩ := + exists_source_prepared_factor + refine ⟨SourceHilbert SourceCoordinate,inferInstance,inferInstance,inferInstance,sourceAlgebra θ, + hcenter,hfinite,hminimal,hpredual, + sourceOperator θ sourceLogWeight hθ.nonneg sourceLogWeight_nonneg,hT,hT0,hqn,?_⟩ + intro p hp hproj hinv + exact sourceInvariantProjection_trivial θ hθ hr hs hphase hp hproj hinv + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Matrix/Action.lean b/lean/OAI/Analysis/FiniteFactor/Matrix/Action.lean new file mode 100644 index 0000000000000000000000000000000000000000..e5814d1b914582f3e9637ed34729ea3df826b7d7 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Matrix/Action.lean @@ -0,0 +1,128 @@ +import OAI.Analysis.FiniteFactor.Matrix.Integrals +import Mathlib.MeasureTheory.Integral.Bochner.SumMeasure + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal ComplexConjugate +noncomputable section + +def sourceFiberInner (f g : SourceHilbert SourceCoordinate) (x : SourceCoordinate → ℝ) : ℂ := + ∫ n : ℤ, inner ℂ (f (x,n)) (g (x,n)) ∂Measure.count + +theorem sourceFiberInner_integrable (f g : SourceHilbert SourceCoordinate) : + Integrable (sourceFiberInner f g) sourceBaseMeasure := + (L2.integrable_inner (𝕜 := ℂ) f g).integral_prod_left + +theorem source_inner_fiber (f g : SourceHilbert SourceCoordinate) : + inner ℂ f g = ∫ x, sourceFiberInner f g x ∂sourceBaseMeasure := + integral_prod _ (L2.integrable_inner (𝕜 := ℂ) f g) + +theorem sourceScalar_indicator_inner (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) + (f g : SourceHilbert SourceCoordinate) : + inner ℂ (sourceScalar (sourceBaseIndicator A hA) f) g = + ∫ x in A, sourceFiberInner f g x ∂sourceBaseMeasure := by + rw [source_inner_fiber, ← integral_indicator hA] + apply integral_congr_ae + filter_upwards [source_ae_all_fibers (sourceScalar_apply_ae (sourceBaseIndicator A hA) f)] with x hx + unfold sourceFiberInner + by_cases ha : x ∈ A + · simp only [Set.indicator_of_mem ha] + apply integral_congr_ae + exact Eventually.of_forall fun n => by dsimp only; rw [hx]; simp [sourceBaseIndicator, ha] + · simp only [Set.indicator_of_notMem ha] + have he : (fun n : ℤ => inner ℂ ((sourceScalar (sourceBaseIndicator A hA) f) (x,n)) (g (x,n))) = + fun _ => (0 : ℂ) := by + funext n + rw [hx] + simp [sourceBaseIndicator, ha] + rw [he, integral_zero] + +/-- The scalar distribution identity determining every output coordinate of H. -/ +theorem source_coordinate_action_inner (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (f : SourceHilbert SourceCoordinate) (k : ℤ) : + (fun x => (H f) (x,k)) =ᵐ[sourceBaseMeasure] + sourceFiberInner ((star H) (sourceBasis k)) f := by + apply Integrable.ae_eq_of_forall_setIntegral_eq _ _ (source_fiber_integrable _ _) + (sourceFiberInner_integrable _ _) + intro A hA _ + rw [← source_fiber_integral, ← L2.inner_indicatorConstLp_one] + change inner ℂ (sourceFiberIndicator A hA k) (H f) = _ + rw [← ContinuousLinearMap.adjoint_inner_left, ← ContinuousLinearMap.star_eq_adjoint] + have he : (star H) (sourceFiberIndicator A hA k) = + sourceScalar (sourceBaseIndicator A hA) ((star H) (sourceBasis k)) := by + rw [← sourceScalar_indicator_basis] + exact (congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T (sourceBasis k)) (sourceAlgebra_commutes_scalar θ (star_mem hH) + (sourceBaseIndicator A hA))).symm + rw [he, sourceScalar_indicator_inner] + +/-- Actual action on arbitrary L2 input, expressed through the constructed +matrix entries. The counting integral is an absolutely convergent series a.e. -/ +theorem sourceMatrix_action (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (f : SourceHilbert SourceCoordinate) (k : ℤ) : + (fun x => (H f) (x,k)) =ᵐ[sourceBaseMeasure] + fun x => ∫ n : ℤ, sourceMatrixEntry H k n x * f (x,n) ∂Measure.count := by + have hs : ∀ᵐ x ∂sourceBaseMeasure, ∀ n : ℤ, + sourceMatrixEntry (star H) n k x = star (sourceMatrixEntry H k n x) := by + rw [ae_all_iff] + intro n + exact sourceMatrixEntry_star θ hH n k + filter_upwards [source_coordinate_action_inner θ hH f k, hs] with x hx hs + rw [hx] + unfold sourceFiberInner + apply integral_congr_ae + exact Eventually.of_forall fun n => by + change inner ℂ (sourceMatrixEntry (star H) n k x) (f (x,n)) = _ + rw [hs] + simp [RCLike.inner_apply, mul_comm] + +/-- The matrix action is absolutely integrable over the counting measure. -/ +theorem sourceMatrix_action_integrable (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (f : SourceHilbert SourceCoordinate) (k : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, + Integrable (fun n : ℤ => sourceMatrixEntry H k n x * f (x,n)) Measure.count := by + have hs : ∀ᵐ x ∂sourceBaseMeasure, ∀ n : ℤ, + sourceMatrixEntry (star H) n k x = star (sourceMatrixEntry H k n x) := by + rw [ae_all_iff] + intro n + exact sourceMatrixEntry_star θ hH n k + filter_upwards [(L2.integrable_inner (𝕜 := ℂ) ((star H) (sourceBasis k)) f).prod_right_ae, + hs] with x hi hs + apply hi.congr + exact Eventually.of_forall fun n => by + change inner ℂ (sourceMatrixEntry (star H) n k x) (f (x,n)) = _ + rw [hs] + simp [RCLike.inner_apply, mul_comm] + +theorem sourceMatrix_action_tsum (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (f : SourceHilbert SourceCoordinate) (k : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, + (H f) (x,k) = ∑' n : ℤ, sourceMatrixEntry H k n x * f (x,n) := by + filter_upwards [sourceMatrix_action θ hH f k, sourceMatrix_action_integrable θ hH f k] + with x hx hi + rw [hx, integral_countable hi] + simp [measureReal_def] + +/-- Products are given by the matrix product on a single conull base set. -/ +theorem sourceMatrix_mul (θ : SourceCoordinate → ℝ) + {H B : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k n : ℤ, + sourceMatrixEntry (H * B) k n x = + ∫ r : ℤ, sourceMatrixEntry H k r x * sourceMatrixEntry B r n x ∂Measure.count := by + rw [ae_all_iff] + intro k + rw [ae_all_iff] + intro n + exact sourceMatrix_action θ hH (B (sourceBasis n)) k + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Matrix/Bounds.lean b/lean/OAI/Analysis/FiniteFactor/Matrix/Bounds.lean new file mode 100644 index 0000000000000000000000000000000000000000..26b3ca13f80545dda09437511cb568b807ea808b --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Matrix/Bounds.lean @@ -0,0 +1,72 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiniteVectors +import Mathlib.Topology.Instances.Complex + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +/-- Continuity in a separable parameter lets a countable dense family of +almost-everywhere inequalities determine every parameter on one conull set. -/ +theorem ae_forall_le_of_continuous {X E : Type*} [MeasurableSpace X] + (μ : Measure X) [TopologicalSpace E] [TopologicalSpace.SeparableSpace E] + (f g : E → X → ℝ) (hf : ∀ x, Continuous (fun e => f e x)) + (hg : ∀ x, Continuous (fun e => g e x)) + (h : ∀ e, ∀ᵐ x ∂μ, f e x ≤ g e x) : + ∀ᵐ x ∂μ, ∀ e, f e x ≤ g e x := by + obtain ⟨s, hsc, hsd⟩ := TopologicalSpace.exists_countable_dense E + have hs : ∀ᵐ x ∂μ, ∀ e ∈ s, f e x ≤ g e x := + (ae_ball_iff hsc).mpr fun e _ => h e + filter_upwards [hs] with x hx e + exact le_on_closure hx (hf x).continuousOn (hg x).continuousOn (hsd e) + +theorem sourceFiberEnergy_finite_le (f : SourceHilbert SourceCoordinate) (s : Finset ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, ∑ n ∈ s, ‖f (x,n)‖ ^ 2 ≤ sourceFiberEnergy f x := by + filter_upwards [(source_norm_sq_integrable f).prod_right_ae] with x hx + have h := setIntegral_le_integral (μ := Measure.count) (s := (s : Set ℤ)) + hx (Eventually.of_forall fun n => sq_nonneg ‖f (x,n)‖) + rw [setIntegral_finset s hx.integrableOn] at h + simpa [measureReal_def, sourceFiberEnergy] using h + +/-- Each finite scalar matrix compression satisfies the actual operator norm bound. -/ +theorem sourceMatrix_finite_bound (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (s t : Finset ℤ) (a : ℤ → ℂ) : + ∀ᵐ x ∂sourceBaseMeasure, + (∑ k ∈ t, ‖∑ n ∈ s, a n * sourceMatrixEntry H k n x‖ ^ 2) ≤ + ‖H‖ ^ 2 * ∑ n ∈ s, ‖a n‖ ^ 2 := by + filter_upwards [sourceFiniteVector_image_coe H s a, + sourceFiniteVector_energy s a, + sourceFiberEnergy_finite_le (H (sourceFiniteVector s a)) t, + sourceAlgebra_fiberEnergy_le θ hH (sourceFiniteVector s a)] with x hc he hf hh + calc + _ = ∑ k ∈ t, ‖(H (sourceFiniteVector s a)) (x,k)‖ ^ 2 := by simp_rw [hc] + _ ≤ sourceFiberEnergy (H (sourceFiniteVector s a)) x := hf + _ ≤ ‖H‖ ^ 2 * sourceFiberEnergy (sourceFiniteVector s a) x := hh + _ = _ := by rw [he] + +/-- One conull set works for every complex finite input vector and every finite +output truncation. No field or boundedness hypothesis has been substituted. -/ +theorem sourceMatrix_finite_bound_all (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ (s t : Finset ℤ) (a : ℤ → ℂ), + (∑ k ∈ t, ‖∑ n ∈ s, a n * sourceMatrixEntry H k n x‖ ^ 2) ≤ + ‖H‖ ^ 2 * ∑ n ∈ s, ‖a n‖ ^ 2 := by + rw [ae_all_iff] + intro s + rw [ae_all_iff] + intro t + apply ae_forall_le_of_continuous (E := ℤ → ℂ) sourceBaseMeasure + (fun a x => ∑ k ∈ t, ‖∑ n ∈ s, a n * sourceMatrixEntry H k n x‖ ^ 2) + (fun a _ => ‖H‖ ^ 2 * ∑ n ∈ s, ‖a n‖ ^ 2) + · intro x; fun_prop + · intro x; fun_prop + · exact sourceMatrix_finite_bound θ hH s t + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Matrix/Covariance.lean b/lean/OAI/Analysis/FiniteFactor/Matrix/Covariance.lean new file mode 100644 index 0000000000000000000000000000000000000000..704b80458780ccd66f31825f7a8d77a865e4bf23 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Matrix/Covariance.lean @@ -0,0 +1,81 @@ +import OAI.Analysis.FiniteFactor.Matrix.Entries + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +noncomputable section + +theorem sourceCommutantRotation_basis (θ : SourceCoordinate → ℝ) (n m : ℤ) : + sourceCommutantRotation θ n (sourceBasis m) = sourceBasis (m+n) := by + apply Lp.ext + have hb := (sourceTransportIndex_preserving θ n n).quasiMeasurePreserving.ae + (sourceBasis_coe m) + filter_upwards [sourceTransport_apply_ae θ n n (sourceBasis m), hb, + sourceBasis_coe (m+n)] with z ht hb he + change (sourceTransport θ n n (sourceBasis m)) z = _ + rw [ht, hb, he] + simp only [sourceTransportIndex] + simp only [sub_eq_iff_eq_add] + +/-- Matrix form of H(sigma^r x) = S^(-r) H(x) S^r, for the original +regular representation and every integer power of the base rotation. -/ +theorem sourceMatrixEntry_covariance (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (r n : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + sourceMatrixEntry H k n (coordinateRotate θ r x) = + sourceMatrixEntry H (k+r) (n+r) x := by + have he : H (sourceBasis (n+r)) = sourceCommutantRotation θ r (H (sourceBasis n)) := by + rw [← sourceCommutantRotation_basis θ r n] + exact (congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T (sourceBasis n)) (sourceAlgebra_commutes_rotation θ hH r)).symm + have ht := source_ae_all_fibers (sourceTransport_apply_ae θ r r (H (sourceBasis n))) + filter_upwards [ht] with x hx k + unfold sourceMatrixEntry + rw [he] + change _ = (sourceTransport θ r r (H (sourceBasis n))) (x,k+r) + rw [hx] + simp [sourceTransportIndex] + +/-- All countably many covariance identities hold on one conull base set. -/ +theorem sourceMatrixEntry_covariance_all (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ r n k : ℤ, + sourceMatrixEntry H k n (coordinateRotate θ r x) = + sourceMatrixEntry H (k+r) (n+r) x := by + rw [ae_all_iff] + intro r + rw [ae_all_iff] + exact sourceMatrixEntry_covariance θ hH r + +/-- Matrix entries of the actual multiplication generators. -/ +theorem sourceMatrixEntry_pi (θ : SourceCoordinate → ℝ) (g : SourceBaseFunction) (n : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + sourceMatrixEntry (sourcePi θ g) k n x = + if k = n then g.toFun (coordinateRotate θ n x) else 0 := by + filter_upwards [source_ae_all_fibers (sourcePi_apply_ae θ g (sourceBasis n)), + source_ae_all_fibers (sourceBasis_coe n)] with x hp hb k + unfold sourceMatrixEntry + rw [hp, hb] + by_cases hk : k = n <;> simp [hk, sourcePiSymbol] + +/-- Matrix entries of the original fiber shift. -/ +theorem sourceMatrixEntry_shift (n : ℤ) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + sourceMatrixEntry (sourceShift SourceCoordinate) k n x = + if k = n+1 then 1 else 0 := by + have hb := (sourceShiftIndex_preserving SourceCoordinate).quasiMeasurePreserving.ae + (sourceBasis_coe n) + filter_upwards [source_ae_all_fibers (sourceShift_apply_ae (sourceBasis n)), + source_ae_all_fibers hb] with x hs hb k + unfold sourceMatrixEntry + rw [hs, hb] + simp only [sourceShiftIndex] + simp only [sub_eq_iff_eq_add] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Matrix/Entries.lean b/lean/OAI/Analysis/FiniteFactor/Matrix/Entries.lean new file mode 100644 index 0000000000000000000000000000000000000000..cebc49cbee94eeacaa9d1adcd27d3e781156c279 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Matrix/Entries.lean @@ -0,0 +1,78 @@ +import OAI.Analysis.FiniteFactor.CrossedProduct.FiberTotal +import Mathlib.MeasureTheory.Integral.Prod + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal +noncomputable section + +abbrev sourceBaseMeasure : Measure (SourceCoordinate → ℝ) := + Measure.infinitePi (fun _ => unitIntervalMeasure) + +/-- A product almost-everywhere identity holds on every integer fiber. -/ +theorem source_ae_all_fibers {p : (SourceCoordinate → ℝ) × ℤ → Prop} + (hp : ∀ᵐ z ∂sourceMeasure SourceCoordinate, p z) : + ∀ᵐ x ∂sourceBaseMeasure, ∀ n : ℤ, p (x,n) := by + exact (Measure.ae_ae_of_ae_prod hp).mono fun x hx => Measure.ae_count_iff.mp hx + +/-- Constant coordinate vector, realized in the original source L2 space. -/ +def sourceBasis (n : ℤ) : SourceHilbert SourceCoordinate := + sourceFiberIndicator Set.univ MeasurableSet.univ n + +theorem sourceBasis_coe (n : ℤ) : sourceBasis n =ᵐ[sourceMeasure SourceCoordinate] + fun z => if z.2 = n then 1 else 0 := by + filter_upwards [sourceFiberIndicator_coe Set.univ MeasurableSet.univ n] with z hz + rw [show (sourceBasis n) z = _ from hz] + by_cases hn : z.2 = n <;> simp [hn] + +theorem sourceBasis_zero : sourceBasis 0 = sourceVacuum := rfl + +/-- Actual matrix coefficients obtained by applying H to constant e_n. -/ +def sourceMatrixEntry (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (k n : ℤ) (x : SourceCoordinate → ℝ) : ℂ := (H (sourceBasis n)) (x,k) + +theorem sourceScalar_apply_ae (g : SourceBaseFunction) (f : SourceHilbert SourceCoordinate) : + sourceScalar g f =ᵐ[sourceMeasure SourceCoordinate] fun z => g.toFun z.1 * f z := by + filter_upwards [sourcePi_apply_ae (fun _ => 0) g f, sourceHilbert_cube] with z hz hc + change (sourcePi (fun _ => 0) g f) z = _ + rw [hz] + have he : coordinateRotate (fun _ : SourceCoordinate => 0) z.2 z.1 = z.1 := by + funext i + simpa [coordinateRotate] using Int.fract_eq_self.mpr (hc i) + simp [sourcePiSymbol, he] + +theorem sourceScalar_indicator_basis (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) + (n : ℤ) : sourceScalar (sourceBaseIndicator A hA) (sourceBasis n) = + sourceFiberIndicator A hA n := by + apply Lp.ext + filter_upwards [sourceScalar_apply_ae (sourceBaseIndicator A hA) (sourceBasis n), + sourceBasis_coe n, sourceFiberIndicator_coe A hA n] with z hs hb hi + rw [hs, hb, hi] + by_cases ha : z.1 ∈ A <;> by_cases hn : z.2 = n <;> simp [sourceBaseIndicator, ha, hn] + +/-- Localizing an input coordinate localizes every output coordinate by the +same base indicator. This uses the proved commutant of the actual algebra. -/ +theorem sourceMatrixEntry_localize (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) + (n : ℤ) : ∀ᵐ x ∂sourceBaseMeasure, ∀ k : ℤ, + (H (sourceFiberIndicator A hA n)) (x,k) = + A.indicator (sourceMatrixEntry H k n) x := by + have he : H (sourceFiberIndicator A hA n) = + sourceScalar (sourceBaseIndicator A hA) (H (sourceBasis n)) := by + rw [← sourceScalar_indicator_basis] + exact (congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => T (sourceBasis n)) (sourceAlgebra_commutes_scalar θ hH + (sourceBaseIndicator A hA))).symm + rw [he] + apply (source_ae_all_fibers (sourceScalar_apply_ae (sourceBaseIndicator A hA) + (H (sourceBasis n)))).mono + intro x hx k + rw [hx] + by_cases ha : x ∈ A <;> simp [sourceBaseIndicator, sourceMatrixEntry, ha] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Matrix/Integrals.lean b/lean/OAI/Analysis/FiniteFactor/Matrix/Integrals.lean new file mode 100644 index 0000000000000000000000000000000000000000..7c10db7750229aef07357ae4a14fb3e9016db2ed --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Matrix/Integrals.lean @@ -0,0 +1,94 @@ +import OAI.Analysis.FiniteFactor.Matrix.Entries + +namespace OAI + +namespace FiniteFactor +open MeasureTheory Filter +open scoped ENNReal ComplexConjugate +noncomputable section + +theorem source_fiber_restrict (A : Set (SourceCoordinate → ℝ)) (n : ℤ) : + (sourceMeasure SourceCoordinate).restrict (A ×ˢ {n}) = + (sourceBaseMeasure.restrict A).map (fun x => (x,n)) := by + rw [← Measure.prod_restrict] + simp only [Measure.restrict_singleton, Measure.count_singleton, one_smul] + exact Measure.prod_dirac _ + +theorem source_fiber_integral (f : SourceHilbert SourceCoordinate) + (A : Set (SourceCoordinate → ℝ)) (n : ℤ) : + ∫ z in A ×ˢ {n}, f z ∂sourceMeasure SourceCoordinate = + ∫ x in A, f (x,n) ∂sourceBaseMeasure := by + rw [source_fiber_restrict] + exact integral_map (measurable_id.prodMk measurable_const).aemeasurable + (Lp.stronglyMeasurable f).aestronglyMeasurable + +theorem source_fiber_integrable (f : SourceHilbert SourceCoordinate) (n : ℤ) : + Integrable (fun x => f (x,n)) sourceBaseMeasure := by + have hi := integrableOn_Lp_of_measure_ne_top f (by norm_num : (1 : ℝ≥0∞) ≤ 2) + (sourceFiberMeasure_ne_top Set.univ n) + rw [IntegrableOn, source_fiber_restrict, Measure.restrict_univ] at hi + exact (integrable_map_measure (Lp.stronglyMeasurable f).aestronglyMeasurable + (measurable_id.prodMk measurable_const).aemeasurable).mp hi + +theorem sourceMatrixEntry_measurable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (k n : ℤ) : + Measurable (sourceMatrixEntry H k n) := + (Lp.stronglyMeasurable (H (sourceBasis n))).measurable.comp + (measurable_id.prodMk measurable_const) + +theorem sourceMatrixEntry_integrable + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) (k n : ℤ) : + Integrable (sourceMatrixEntry H k n) sourceBaseMeasure := + source_fiber_integrable _ _ + +theorem sourceMatrixEntry_setIntegral + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) + (A : Set (SourceCoordinate → ℝ)) (hA : MeasurableSet A) (k n : ℤ) : + ∫ x in A, sourceMatrixEntry H k n x ∂sourceBaseMeasure = + inner ℂ (sourceFiberIndicator A hA k) (H (sourceBasis n)) := by + rw [sourceFiberIndicator, L2.inner_indicatorConstLp_one, source_fiber_integral] + rfl + +/-- The displayed trace integral is the actual previously proved normal state. -/ +theorem sourceVacuumFunctional_matrixIntegral + (H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate) : + sourceVacuumFunctional H = ∫ x, sourceMatrixEntry H 0 0 x ∂sourceBaseMeasure := by + rw [← setIntegral_univ, sourceMatrixEntry_setIntegral H Set.univ MeasurableSet.univ] + rfl + +/-- Adjoint matrix coefficients agree almost everywhere, on the actual source base. -/ +theorem sourceMatrixEntry_star (θ : SourceCoordinate → ℝ) + {H : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate} + (hH : H ∈ sourceAlgebra θ) (k n : ℤ) : + sourceMatrixEntry (star H) k n =ᵐ[sourceBaseMeasure] + fun x => star (sourceMatrixEntry H n k x) := by + apply Integrable.ae_eq_of_forall_setIntegral_eq _ _ + (sourceMatrixEntry_integrable _ _ _) + (Complex.conjCLE.integrable_comp_iff.mpr (sourceMatrixEntry_integrable H n k)) + intro A hA _ + change (∫ x in A, sourceMatrixEntry (star H) k n x ∂sourceBaseMeasure) = + ∫ x in A, conj (sourceMatrixEntry H n k x) ∂sourceBaseMeasure + rw [sourceMatrixEntry_setIntegral _ A hA, integral_conj, sourceMatrixEntry_setIntegral _ A hA, + inner_conj_symm] + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right] + have he : H (sourceFiberIndicator A hA k) = + sourceScalar (sourceBaseIndicator A hA) (H (sourceBasis k)) := by + rw [← sourceScalar_indicator_basis] + exact (congrArg (fun T : SourceHilbert SourceCoordinate →L[ℂ] SourceHilbert SourceCoordinate => + T (sourceBasis k)) (sourceAlgebra_commutes_scalar θ hH (sourceBaseIndicator A hA))).symm + rw [he] + have hs : star (sourceScalar (sourceBaseIndicator A hA)) = + sourceScalar (sourceBaseIndicator A hA) := by + rw [sourceScalar_star] + congr 1 + unfold sourceBaseStar sourceBaseIndicator + congr 1 + funext x + by_cases hx : x ∈ A <;> simp [hx] + rw [← ContinuousLinearMap.adjoint_inner_right, ← ContinuousLinearMap.star_eq_adjoint, + hs, sourceScalar_indicator_basis] + +end +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/Model.lean b/lean/OAI/Analysis/FiniteFactor/Model.lean new file mode 100644 index 0000000000000000000000000000000000000000..0ad11c52b191e3e5ef4e38b05f78bf857f2bc04c --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/Model.lean @@ -0,0 +1,43 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Analysis.SpecialFunctions.Pow.Real + +namespace OAI + +namespace FiniteFactor +open Filter +open scoped Topology +universe u + +variable {H : Type u} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- A concrete factor has scalar center. -/ +def HasScalarCenter (M : VonNeumannAlgebra H) : Prop := + ∀ a ∈ M, (∀ b ∈ M, a * b = b * a) → ∃ z : ℂ, a = z • (1 : H →L[ℂ] H) + +/-- Finiteness: every isometry in the algebra is unitary. -/ +def IsFiniteAlgebra (M : VonNeumannAlgebra H) : Prop := + ∀ v ∈ M, star v * v = 1 → v * star v = 1 + +/-- No nonzero projection is minimal, excluding matrix factors. -/ +def HasNoMinimalProjection (M : VonNeumannAlgebra H) : Prop := + ∀ p ∈ M, IsStarProjection p → p ≠ 0 → + ∃ q ∈ M, IsStarProjection q ∧ q ≠ 0 ∧ q ≠ p ∧ q * p = q + +/-- A separable Banach space whose dual is conjugate-linearly isometric to M. -/ +def HasSeparablePredual (M : VonNeumannAlgebra H) : Prop := + ∃ (E : Type u) (_ : NormedAddCommGroup E) (_ : NormedSpace ℂ E) + (_ : CompleteSpace E) (_ : TopologicalSpace.SeparableSpace E), + Nonempty (StrongDual ℂ E ≃ₗᵢ⋆[ℂ] M.toStarSubalgebra) + +def MainTarget : Prop := + ∃ (H : Type u) (_ : NormedAddCommGroup H) (_ : InnerProductSpace ℂ H) + (_ : CompleteSpace H) (M : VonNeumannAlgebra H), + HasScalarCenter M ∧ IsFiniteAlgebra M ∧ HasNoMinimalProjection M ∧ + HasSeparablePredual M ∧ + ∃ T : H →L[ℂ] H, T ∈ M ∧ T ≠ 0 ∧ + Tendsto (fun n : ℕ => ‖T ^ n‖ ^ (1 / (n : ℝ))) atTop (𝓝 0) ∧ + ∀ p ∈ M, IsStarProjection p → (1 - p) * T * p = 0 → p = 0 ∨ p = 1 + +end FiniteFactor + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/OperatorTracialRepresentation.lean b/lean/OAI/Analysis/FiniteFactor/OperatorTracialRepresentation.lean new file mode 100644 index 0000000000000000000000000000000000000000..45b29c1df1884415a0e143e9ef1cbb0f187b0a45 --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/OperatorTracialRepresentation.lean @@ -0,0 +1,90 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Analysis.InnerProductSpace.Adjoint + +namespace OAI + +noncomputable section +namespace FiniteFactor +open scoped Topology +variable {H : Type*} [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- A concrete finite tracial von Neumann algebra in a faithful vector-trace +representation. These are operator-algebra data, without approximation assumptions. -/ +structure TracialRepresentation (M : VonNeumannAlgebra H) where + vector : H + norm_vector : ‖vector‖ = 1 + cyclic : ∀ S T : M.toStarSubalgebra, + inner ℂ vector ((S : H →L[ℂ] H) ((T : H →L[ℂ] H) vector)) = + inner ℂ vector ((T : H →L[ℂ] H) ((S : H →L[ℂ] H) vector)) + separating : ∀ T : M.toStarSubalgebra, (T : H →L[ℂ] H) vector = 0 → T = 0 + +namespace TracialRepresentation +variable {M : VonNeumannAlgebra H} (τ : TracialRepresentation M) +abbrev Algebra := M.toStarSubalgebra + +def trace (T : Algebra (M := M)) : ℂ := inner ℂ τ.vector ((T : H →L[ℂ] H) τ.vector) +def norm₂ (T : Algebra (M := M)) : ℝ := ‖(T : H →L[ℂ] H) τ.vector‖ + +@[simp] theorem trace_one : τ.trace 1 = 1 := by + simp [trace, inner_self_eq_norm_sq_to_K, τ.norm_vector] + +theorem trace_mul_comm (S T : Algebra (M := M)) : τ.trace (S*T) = τ.trace (T*S) := + τ.cyclic S T + +theorem trace_star_mul (T : Algebra (M := M)) : + τ.trace (star T*T) = (τ.norm₂ T : ℂ)^2 := by + unfold trace norm₂ + change inner ℂ τ.vector ((star (T : H →L[ℂ] H)) ((T : H →L[ℂ] H) τ.vector)) = _ + rw [ContinuousLinearMap.star_eq_adjoint, ContinuousLinearMap.adjoint_inner_right, inner_self_eq_norm_sq_to_K] + norm_cast + +theorem norm₂_star (T : Algebra (M := M)) : τ.norm₂ (star T) = τ.norm₂ T := by + have h := τ.trace_mul_comm (star T) T + have h2 := τ.trace_star_mul (star T) + simp only [star_star] at h2 + rw [τ.trace_star_mul, h2] at h + have hr := congrArg Complex.re h + simp only [← Complex.ofReal_pow, Complex.ofReal_re] at hr + have hn : 0 ≤ τ.norm₂ T := norm_nonneg _ + have hs : 0 ≤ τ.norm₂ (star T) := norm_nonneg _ + nlinarith + +@[simp] theorem norm₂_zero : τ.norm₂ 0 = 0 := by simp [norm₂] +@[simp] theorem norm₂_sub (S T : Algebra (M := M)) : + τ.norm₂ (S-T) = ‖(S : H →L[ℂ] H) τ.vector - (T : H →L[ℂ] H) τ.vector‖ := rfl + +theorem norm₂_add_le (S T : Algebra (M := M)) : τ.norm₂ (S+T) ≤ τ.norm₂ S+τ.norm₂ T := + norm_add_le _ _ + +theorem norm₂_smul (c : ℂ) (T : Algebra (M := M)) : τ.norm₂ (c • T) = ‖c‖*τ.norm₂ T := + norm_smul _ _ + +theorem norm₂_mul_le (S T : Algebra (M := M)) : τ.norm₂ (S*T) ≤ ‖S‖ * τ.norm₂ T := + (S : H →L[ℂ] H).le_opNorm ((T : H →L[ℂ] H) τ.vector) + +theorem norm₂_mul_le_right (S T : Algebra (M := M)) : τ.norm₂ (S*T) ≤ τ.norm₂ S * ‖T‖ := by + rw [← τ.norm₂_star (S*T), star_mul] + have h := τ.norm₂_mul_le (star T) (star S) + simpa [τ.norm₂_star, mul_comm, ContinuousLinearMap.star_eq_adjoint] using h + +theorem norm₂_le_norm (T : Algebra (M := M)) : τ.norm₂ T ≤ ‖T‖ := by + have h := (T : H →L[ℂ] H).le_opNorm τ.vector + simpa [norm₂, τ.norm_vector] using h + +theorem norm_trace_le_norm₂ (T : Algebra (M := M)) : ‖τ.trace T‖ ≤ τ.norm₂ T := by + simpa [trace, norm₂, τ.norm_vector] using norm_inner_le_norm τ.vector ((T : H →L[ℂ] H) τ.vector) + +theorem norm₂_eq_zero_iff (T : Algebra (M := M)) : τ.norm₂ T = 0 ↔ T = 0 := by + constructor + · intro h + exact τ.separating T (norm_eq_zero.mp h) + · rintro rfl + exact τ.norm₂_zero + +end TracialRepresentation + +end FiniteFactor + +end + +end OAI diff --git a/lean/OAI/Analysis/FiniteFactor/OperatorUltraweak.lean b/lean/OAI/Analysis/FiniteFactor/OperatorUltraweak.lean new file mode 100644 index 0000000000000000000000000000000000000000..792e344920b1294cdf011acaf455070f2afc8f3e --- /dev/null +++ b/lean/OAI/Analysis/FiniteFactor/OperatorUltraweak.lean @@ -0,0 +1,47 @@ +import Mathlib.Analysis.VonNeumannAlgebra.Basic +import Mathlib.Topology.Order + +namespace OAI + +noncomputable section +namespace FiniteFactor +variable (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] + +/-- The actual ultraweak topology, generated by absolutely summable vector +functionals. No continuity of a chosen trace is built into this definition. -/ +@[instance_reducible] def ultraweakTopology : TopologicalSpace (H →L[ℂ] H) := + ⨅ (ξ : ℕ → H) (η : ℕ → H) (_ : Summable (fun n => ‖ξ n‖ * ‖η n‖)), + TopologicalSpace.induced (fun T : H →L[ℂ] H => ∑' n, inner ℂ (ξ n) (T (η n))) + inferInstance + +variable {H} +omit [CompleteSpace H] in +theorem vectorFunctional_ultraweak_continuous [CompleteSpace H] (ξ η : H) : + @Continuous _ _ (ultraweakTopology H) inferInstance + (fun T : H →L[ℂ] H => inner ℂ ξ (T η)) := by + let x : ℕ → H := fun n => if n = 0 then ξ else 0 + let y : ℕ → H := fun n => if n = 0 then η else 0 + have hs : Summable (fun n => ‖x n‖ * ‖y n‖) := by + exact (hasSum_ite_eq (0 : ℕ) (‖ξ‖ * ‖η‖)).summable.congr (by intro n; by_cases h : n = 0 <;> simp [x,y,h]) + have hc : @Continuous _ _ (ultraweakTopology H) inferInstance + (fun T : H →L[ℂ] H => ∑' n, inner ℂ (x n) (T (y n))) := + continuous_iInf_dom (i := x) (continuous_iInf_dom (i := y) + (continuous_iInf_dom (i := hs) continuous_induced_dom)) + have he (T : H →L[ℂ] H) : + (fun n => inner ℂ (x n) (T (y n))) = + (fun n => if n = 0 then inner ℂ ξ (T η) else 0) := by + funext n + by_cases h : n = 0 <;> simp [x,y,h] + have hf : (fun T : H →L[ℂ] H => ∑' n, inner ℂ (x n) (T (y n))) = + (fun T => inner ℂ ξ (T η)) := by + funext T + rw [he] + exact tsum_ite_eq 0 _ + rw [hf] at hc + exact hc + +end FiniteFactor + +end + +end OAI